diff --git a/Gemfile b/Gemfile index a8bf18746..7cda93671 100644 --- a/Gemfile +++ b/Gemfile @@ -48,13 +48,11 @@ gem 'rqrcode_png' gem 'acts-as-taggable-on', '~> 6.0' group :development, :test do -#group :'development.rb.example', :test do gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] gem 'rspec-rails', '~> 3.8' end group :development do -#group :'development.rb.example' do gem 'awesome_print' gem 'web-console', '>= 3.3.0' gem 'listen', '>= 3.0.5', '< 3.2' @@ -78,6 +76,10 @@ gem 'faraday', '~> 0.15.4' # view gem 'active_decorator' +gem 'bootstrap', '~> 4.3.1' +gem 'jquery-rails' +gem 'simple_form' +gem 'font-awesome-sass', '4.7.0' # i18n gem 'rails-i18n', '~> 5.1' diff --git a/Gemfile.lock b/Gemfile.lock index 9c80af8a9..a33cd2ef6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -59,6 +59,8 @@ GEM archive-zip (0.11.0) io-like (~> 0.3.0) arel (9.0.0) + autoprefixer-rails (9.6.1) + execjs awesome_print (1.8.0) axlsx (3.0.0.pre) htmlentities (~> 4.3, >= 4.3.4) @@ -71,6 +73,10 @@ GEM bindex (0.5.0) bootsnap (1.3.1) msgpack (~> 1.0) + bootstrap (4.3.1) + autoprefixer-rails (>= 9.1.0) + popper_js (>= 1.14.3, < 2) + sassc-rails (>= 2.0.0) builder (3.2.3) bulk_insert (1.7.0) activerecord (>= 3.2.0) @@ -105,6 +111,8 @@ GEM faraday (0.15.4) multipart-post (>= 1.2, < 3) ffi (1.9.25) + font-awesome-sass (4.7.0) + sass (>= 3.2) globalid (0.4.1) activesupport (>= 4.2.0) grape-entity (0.7.1) @@ -120,6 +128,10 @@ GEM jbuilder (2.7.0) activesupport (>= 4.2.0) multi_json (>= 1.2) + jquery-rails (4.3.5) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) jwt (2.1.0) kaminari (1.1.1) activesupport (>= 4.1.0) @@ -165,6 +177,7 @@ GEM multi_xml (~> 0.5) rack (>= 1.2, < 3) pdfkit (0.8.4.1) + popper_js (1.14.5) public_suffix (3.0.2) puma (3.12.0) rack (2.0.5) @@ -266,6 +279,15 @@ GEM sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) + sassc (2.0.1) + ffi (~> 1.9) + rake + sassc-rails (2.1.2) + railties (>= 4.0.0) + sassc (>= 2.0) + sprockets (> 3.0) + sprockets-rails + tilt searchkick (3.1.3) activemodel (>= 4.2) elasticsearch (>= 5) @@ -278,6 +300,9 @@ GEM rack (>= 1.5.0) rack-protection (>= 1.5.0) redis (>= 3.3.5, < 5) + simple_form (4.1.0) + actionpack (>= 5.0) + activemodel (>= 5.0) simple_xlsx_reader (1.0.4) nokogiri rubyzip @@ -336,14 +361,17 @@ DEPENDENCIES axlsx (~> 3.0.0.pre) axlsx_rails (~> 0.5.2) bootsnap (>= 1.1.0) + bootstrap (~> 4.3.1) bulk_insert byebug capybara (>= 2.15, < 4.0) chromedriver-helper faraday (~> 0.15.4) + font-awesome-sass (= 4.7.0) gitlab! grape-entity (~> 0.7.1) jbuilder (~> 2.5) + jquery-rails kaminari (~> 1.1, >= 1.1.1) listen (>= 3.0.5, < 3.2) mysql2 (>= 0.4.4, < 0.6.0) @@ -366,6 +394,7 @@ DEPENDENCIES searchkick selenium-webdriver sidekiq + simple_form simple_xlsx_reader sinatra spreadsheet diff --git a/app/assets/images/logo.png b/app/assets/images/logo.png new file mode 100644 index 000000000..436d23490 Binary files /dev/null and b/app/assets/images/logo.png differ diff --git a/app/assets/javascripts/additional-methods.min.js b/app/assets/javascripts/additional-methods.min.js new file mode 100644 index 000000000..ae53b9610 --- /dev/null +++ b/app/assets/javascripts/additional-methods.min.js @@ -0,0 +1,4 @@ +/*! jQuery Validation Plugin - v1.19.1 - 6/15/2019 + * https://jqueryvalidation.org/ + * Copyright (c) 2019 Jörn Zaefferer; Licensed MIT */ +!function(a){"function"==typeof define&&define.amd?define(["jquery","./jquery.validate.min"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){return function(){function b(a){return a.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ").replace(/[.(),;:!?%#$'\"_+=\/\-“”’]*/g,"")}a.validator.addMethod("maxWords",function(a,c,d){return this.optional(c)||b(a).match(/\b\w+\b/g).length<=d},a.validator.format("Please enter {0} words or less.")),a.validator.addMethod("minWords",function(a,c,d){return this.optional(c)||b(a).match(/\b\w+\b/g).length>=d},a.validator.format("Please enter at least {0} words.")),a.validator.addMethod("rangeWords",function(a,c,d){var e=b(a),f=/\b\w+\b/g;return this.optional(c)||e.match(f).length>=d[0]&&e.match(f).length<=d[1]},a.validator.format("Please enter between {0} and {1} words."))}(),a.validator.addMethod("abaRoutingNumber",function(a){var b=0,c=a.split(""),d=c.length;if(9!==d)return!1;for(var e=0;e9?"0":f,g="JABCDEFGHI".substr(f,1).toString(),i.match(/[ABEH]/)?k===f:i.match(/[KPQS]/)?k===g:k===f||k===g},"Please specify a valid CIF number."),a.validator.addMethod("cnhBR",function(a){if(a=a.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g,""),11!==a.length)return!1;var b,c,d,e,f,g,h=0,i=0;if(b=a.charAt(0),new Array(12).join(b)===a)return!1;for(e=0,f=9,g=0;e<9;++e,--f)h+=+(a.charAt(e)*f);for(c=h%11,c>=10&&(c=0,i=2),h=0,e=0,f=1,g=0;e<9;++e,++f)h+=+(a.charAt(e)*f);return d=h%11,d>=10?d=0:d-=i,String(c).concat(d)===a.substr(-2)},"Please specify a valid CNH number"),a.validator.addMethod("cnpjBR",function(a,b){"use strict";if(this.optional(b))return!0;if(a=a.replace(/[^\d]+/g,""),14!==a.length)return!1;if("00000000000000"===a||"11111111111111"===a||"22222222222222"===a||"33333333333333"===a||"44444444444444"===a||"55555555555555"===a||"66666666666666"===a||"77777777777777"===a||"88888888888888"===a||"99999999999999"===a)return!1;for(var c=a.length-2,d=a.substring(0,c),e=a.substring(c),f=0,g=c-7,h=c;h>=1;h--)f+=d.charAt(c-h)*g--,g<2&&(g=9);var i=f%11<2?0:11-f%11;if(i!==parseInt(e.charAt(0),10))return!1;c+=1,d=a.substring(0,c),f=0,g=c-7;for(var j=c;j>=1;j--)f+=d.charAt(c-j)*g--,g<2&&(g=9);return i=f%11<2?0:11-f%11,i===parseInt(e.charAt(1),10)},"Please specify a CNPJ value number"),a.validator.addMethod("cpfBR",function(a,b){"use strict";if(this.optional(b))return!0;if(a=a.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g,""),11!==a.length)return!1;var c,d,e,f,g=0;if(c=parseInt(a.substring(9,10),10),d=parseInt(a.substring(10,11),10),e=function(a,b){var c=10*a%11;return 10!==c&&11!==c||(c=0),c===b},""===a||"00000000000"===a||"11111111111"===a||"22222222222"===a||"33333333333"===a||"44444444444"===a||"55555555555"===a||"66666666666"===a||"77777777777"===a||"88888888888"===a||"99999999999"===a)return!1;for(f=1;f<=9;f++)g+=parseInt(a.substring(f-1,f),10)*(11-f);if(e(g,c)){for(g=0,f=1;f<=10;f++)g+=parseInt(a.substring(f-1,f),10)*(12-f);return e(g,d)}return!1},"Please specify a valid CPF number"),a.validator.addMethod("creditcard",function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9 \-]+/.test(a))return!1;var c,d,e=0,f=0,g=!1;if(a=a.replace(/\D/g,""),a.length<13||a.length>19)return!1;for(c=a.length-1;c>=0;c--)d=a.charAt(c),f=parseInt(d,10),g&&(f*=2)>9&&(f-=9),e+=f,g=!g;return e%10===0},"Please enter a valid credit card number."),a.validator.addMethod("creditcardtypes",function(a,b,c){if(/[^0-9\-]+/.test(a))return!1;a=a.replace(/\D/g,"");var d=0;return c.mastercard&&(d|=1),c.visa&&(d|=2),c.amex&&(d|=4),c.dinersclub&&(d|=8),c.enroute&&(d|=16),c.discover&&(d|=32),c.jcb&&(d|=64),c.unknown&&(d|=128),c.all&&(d=255),1&d&&(/^(5[12345])/.test(a)||/^(2[234567])/.test(a))?16===a.length:2&d&&/^(4)/.test(a)?16===a.length:4&d&&/^(3[47])/.test(a)?15===a.length:8&d&&/^(3(0[012345]|[68]))/.test(a)?14===a.length:16&d&&/^(2(014|149))/.test(a)?15===a.length:32&d&&/^(6011)/.test(a)?16===a.length:64&d&&/^(3)/.test(a)?16===a.length:64&d&&/^(2131|1800)/.test(a)?15===a.length:!!(128&d)},"Please enter a valid credit card number."),a.validator.addMethod("currency",function(a,b,c){var d,e="string"==typeof c,f=e?c:c[0],g=!!e||c[1];return f=f.replace(/,/g,""),f=g?f+"]":f+"]?",d="^["+f+"([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$",d=new RegExp(d),this.optional(b)||d.test(a)},"Please specify a valid currency"),a.validator.addMethod("dateFA",function(a,b){return this.optional(b)||/^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test(a)},a.validator.messages.date),a.validator.addMethod("dateITA",function(a,b){var c,d,e,f,g,h=!1,i=/^\d{1,2}\/\d{1,2}\/\d{4}$/;return i.test(a)?(c=a.split("/"),d=parseInt(c[0],10),e=parseInt(c[1],10),f=parseInt(c[2],10),g=new Date(Date.UTC(f,e-1,d,12,0,0,0)),h=g.getUTCFullYear()===f&&g.getUTCMonth()===e-1&&g.getUTCDate()===d):h=!1,this.optional(b)||h},a.validator.messages.date),a.validator.addMethod("dateNL",function(a,b){return this.optional(b)||/^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(a)},a.validator.messages.date),a.validator.addMethod("extension",function(a,b,c){return c="string"==typeof c?c.replace(/,/g,"|"):"png|jpe?g|gif",this.optional(b)||a.match(new RegExp("\\.("+c+")$","i"))},a.validator.format("Please enter a value with a valid extension.")),a.validator.addMethod("giroaccountNL",function(a,b){return this.optional(b)||/^[0-9]{1,7}$/.test(a)},"Please specify a valid giro account number"),a.validator.addMethod("greaterThan",function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.not(".validate-greaterThan-blur").length&&e.addClass("validate-greaterThan-blur").on("blur.validate-greaterThan",function(){a(c).valid()}),b>e.val()},"Please enter a greater value."),a.validator.addMethod("greaterThanEqual",function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.not(".validate-greaterThanEqual-blur").length&&e.addClass("validate-greaterThanEqual-blur").on("blur.validate-greaterThanEqual",function(){a(c).valid()}),b>=e.val()},"Please enter a greater value."),a.validator.addMethod("iban",function(a,b){if(this.optional(b))return!0;var c,d,e,f,g,h,i,j,k,l=a.replace(/ /g,"").toUpperCase(),m="",n=!0,o="",p="",q=5;if(l.lengthd)},a.validator.format("Please select no more than {0} files.")),a.validator.addMethod("maxsize",function(b,c,d){if(this.optional(c))return!0;if("file"===a(c).attr("type")&&c.files&&c.files.length)for(var e=0;ed)return!1;return!0},a.validator.format("File size must not exceed {0} bytes each.")),a.validator.addMethod("maxsizetotal",function(b,c,d){if(this.optional(c))return!0;if("file"===a(c).attr("type")&&c.files&&c.files.length)for(var e=0,f=0;fd)return!1;return!0},a.validator.format("Total size of all files must not exceed {0} bytes.")),a.validator.addMethod("mobileNL",function(a,b){return this.optional(b)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test(a)},"Please specify a valid mobile number"),a.validator.addMethod("mobileRU",function(a,b){var c=a.replace(/\(|\)|\s+|-/g,"");return this.optional(b)||c.length>9&&/^((\+7|7|8)+([0-9]){10})$/.test(c)},"Please specify a valid mobile number"),a.validator.addMethod("mobileUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/)},"Please specify a valid mobile number"),a.validator.addMethod("netmask",function(a,b){return this.optional(b)||/^(254|252|248|240|224|192|128)\.0\.0\.0|255\.(254|252|248|240|224|192|128|0)\.0\.0|255\.255\.(254|252|248|240|224|192|128|0)\.0|255\.255\.255\.(254|252|248|240|224|192|128|0)/i.test(a)},"Please enter a valid netmask."),a.validator.addMethod("nieES",function(a,b){"use strict";if(this.optional(b))return!0;var c,d=new RegExp(/^[MXYZ]{1}[0-9]{7,8}[TRWAGMYFPDXBNJZSQVHLCKET]{1}$/gi),e="TRWAGMYFPDXBNJZSQVHLCKET",f=a.substr(a.length-1).toUpperCase();return a=a.toString().toUpperCase(),!(a.length>10||a.length<9||!d.test(a))&&(a=a.replace(/^[X]/,"0").replace(/^[Y]/,"1").replace(/^[Z]/,"2"),c=9===a.length?a.substr(0,8):a.substr(0,9),e.charAt(parseInt(c,10)%23)===f)},"Please specify a valid NIE number."),a.validator.addMethod("nifES",function(a,b){"use strict";return!!this.optional(b)||(a=a.toUpperCase(),!!a.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)")&&(/^[0-9]{8}[A-Z]{1}$/.test(a)?"TRWAGMYFPDXBNJZSQVHLCKE".charAt(a.substring(8,0)%23)===a.charAt(8):!!/^[KLM]{1}/.test(a)&&a[8]==="TRWAGMYFPDXBNJZSQVHLCKE".charAt(a.substring(8,1)%23)))},"Please specify a valid NIF number."),a.validator.addMethod("nipPL",function(a){"use strict";if(a=a.replace(/[^0-9]/g,""),10!==a.length)return!1;for(var b=[6,5,7,2,3,4,5,6,7],c=0,d=0;d<9;d++)c+=b[d]*a[d];var e=c%11,f=10===e?0:e;return f===parseInt(a[9],10)},"Please specify a valid NIP number."),a.validator.addMethod("nisBR",function(a){var b,c,d,e,f,g=0;if(a=a.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g,""),11!==a.length)return!1;for(c=parseInt(a.substring(10,11),10),b=parseInt(a.substring(0,10),10),e=2;e<12;e++)f=e,10===e&&(f=2),11===e&&(f=3),g+=b%10*f,b=parseInt(b/10,10);return d=g%11,d=d>1?11-d:0,c===d},"Please specify a valid NIS/PIS number"),a.validator.addMethod("notEqualTo",function(b,c,d){return this.optional(c)||!a.validator.methods.equalTo.call(this,b,c,d)},"Please enter a different value, values must not be the same."),a.validator.addMethod("nowhitespace",function(a,b){return this.optional(b)||/^\S+$/i.test(a)},"No white space please"),a.validator.addMethod("pattern",function(a,b,c){return!!this.optional(b)||("string"==typeof c&&(c=new RegExp("^(?:"+c+")$")),c.test(a))},"Invalid format."),a.validator.addMethod("phoneNL",function(a,b){return this.optional(b)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test(a)},"Please specify a valid phone number."),a.validator.addMethod("phonePL",function(a,b){a=a.replace(/\s+/g,"");var c=/^(?:(?:(?:\+|00)?48)|(?:\(\+?48\)))?(?:1[2-8]|2[2-69]|3[2-49]|4[1-68]|5[0-9]|6[0-35-9]|[7-8][1-9]|9[145])\d{7}$/;return this.optional(b)||c.test(a)},"Please specify a valid phone number"),a.validator.addMethod("phonesUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/)},"Please specify a valid uk phone number"),a.validator.addMethod("phoneUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/)},"Please specify a valid phone number"),a.validator.addMethod("phoneUS",function(a,b){return a=a.replace(/\s+/g,""),this.optional(b)||a.length>9&&a.match(/^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]\d{2}-?\d{4}$/)},"Please specify a valid phone number"),a.validator.addMethod("postalcodeBR",function(a,b){return this.optional(b)||/^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test(a)},"Informe um CEP válido."),a.validator.addMethod("postalCodeCA",function(a,b){return this.optional(b)||/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ] *\d[ABCEGHJKLMNPRSTVWXYZ]\d$/i.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postalcodeIT",function(a,b){return this.optional(b)||/^\d{5}$/.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postalcodeNL",function(a,b){return this.optional(b)||/^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postcodeUK",function(a,b){return this.optional(b)||/^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test(a)},"Please specify a valid UK postcode"),a.validator.addMethod("require_from_group",function(b,c,d){var e=a(d[1],c.form),f=e.eq(0),g=f.data("valid_req_grp")?f.data("valid_req_grp"):a.extend({},this),h=e.filter(function(){return g.elementValue(this)}).length>=d[0];return f.data("valid_req_grp",g),a(c).data("being_validated")||(e.data("being_validated",!0),e.each(function(){g.element(this)}),e.data("being_validated",!1)),h},a.validator.format("Please fill at least {0} of these fields.")),a.validator.addMethod("skip_or_fill_minimum",function(b,c,d){var e=a(d[1],c.form),f=e.eq(0),g=f.data("valid_skip")?f.data("valid_skip"):a.extend({},this),h=e.filter(function(){return g.elementValue(this)}).length,i=0===h||h>=d[0];return f.data("valid_skip",g),a(c).data("being_validated")||(e.data("being_validated",!0),e.each(function(){g.element(this)}),e.data("being_validated",!1)),i},a.validator.format("Please either skip these fields or fill at least {0} of them.")),a.validator.addMethod("stateUS",function(a,b,c){var d,e="undefined"==typeof c,f=!e&&"undefined"!=typeof c.caseSensitive&&c.caseSensitive,g=!e&&"undefined"!=typeof c.includeTerritories&&c.includeTerritories,h=!e&&"undefined"!=typeof c.includeMilitary&&c.includeMilitary;return d=g||h?g&&h?"^(A[AEKLPRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":g?"^(A[KLRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":"^(A[AEKLPRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$":"^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$",d=f?new RegExp(d):new RegExp(d,"i"),this.optional(b)||d.test(a)},"Please specify a valid state"),a.validator.addMethod("strippedminlength",function(b,c,d){return a(b).text().length>=d},a.validator.format("Please enter at least {0} characters")),a.validator.addMethod("time",function(a,b){return this.optional(b)||/^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test(a)},"Please enter a valid time, between 00:00 and 23:59"),a.validator.addMethod("time12h",function(a,b){return this.optional(b)||/^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test(a)},"Please enter a valid time in 12-hour am/pm format"),a.validator.addMethod("url2",function(a,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},a.validator.messages.url),a.validator.addMethod("vinUS",function(a){if(17!==a.length)return!1;var b,c,d,e,f,g,h=["A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z"],i=[1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9],j=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2],k=0;for(b=0;b<17;b++){if(e=j[b],d=a.slice(b,b+1),8===b&&(g=d),isNaN(d)){for(c=0;c 0){ + setTimeout(function(){ + $('.admin-alert-container .alert').alert('close'); + }, 2000); + } +}); + +// var progressBar = new Turbolinks.ProgressBar(); + +// $(document).on('ajax:send', function(event){ +// console.log('ajax send', event); +// progressBar.setValue(0) +// progressBar.show() +// }); +// +// $(document).on('ajax:complete', function(event){ +// console.log('ajax complete', event); +// progressBar.setValue(1) +// progressBar.hide() // 分页时不触发,奇怪 +// }); +// $(document).on('ajax:success', function(event){ +// console.log('ajax success', event); +// }); +// $(document).on('ajax:error', function(event){ +// console.log('ajax error', event); +// }); + +$(function () { +}); \ No newline at end of file diff --git a/app/assets/javascripts/admins/common-refuse-modal.js b/app/assets/javascripts/admins/common-refuse-modal.js new file mode 100644 index 000000000..5eb2f3f46 --- /dev/null +++ b/app/assets/javascripts/admins/common-refuse-modal.js @@ -0,0 +1,54 @@ +$(document).on('turbolinks:load', function() { + var $refuseModal = $('.admin-common-refuse-modal'); + if ($refuseModal.length > 0) { + var $form = $refuseModal.find('form.admin-common-refuse-form'); + var $applyIdInput = $refuseModal.find('.modal-body input[name="apply_id"]'); + + $form.validate({ + errorElement: 'span', + errorClass: 'danger text-danger', + rules: { + reason: { + required: true, + maxlength: 200 + }, + } + }); + + // modal ready fire + $refuseModal.on('show.bs.modal', function (event) { + var $link = $(event.relatedTarget); + + var applyId = $link.data('id'); + var url = $link.data('url'); + + $applyIdInput.val(applyId); + $form.data('url', url); + }); + // modal visited fire + $refuseModal.on('shown.bs.modal', function(){ + $refuseModal.find('.modal-body input[name="reason"]').focus(); + }); + $refuseModal.on('hide.bs.modal', function () { + $applyIdInput.val(''); + $form.data('url', ''); + }) + + $refuseModal.on('click', '.submit-btn', function(){ + $form.find('.error').html(''); + + if ($form.valid()) { + var url = $form.data('url'); + + $.ajax({ + method: 'POST', + dataType: 'script', + url: url, + data: $form.serialize(), + }).done(function(){ + $refuseModal.modal('hide'); + }); + } + }); + } +}); \ No newline at end of file diff --git a/app/assets/javascripts/admins/daily_school_statistics/index.js b/app/assets/javascripts/admins/daily_school_statistics/index.js new file mode 100644 index 000000000..7c3aa2d4f --- /dev/null +++ b/app/assets/javascripts/admins/daily_school_statistics/index.js @@ -0,0 +1,12 @@ +$(document).on('turbolinks:load', function(){ + if ($('body.admins-daily-school-statistics-index-page').length > 0) { + $('.export-action').on('click', function(){ + var form = $(".daily-school-statistic-list-form .search-form") + var exportLink = $(this); + var keyword = form.find("input[name='keyword']").val(); + + var url = exportLink.data("url").split('?')[0] + "?keyword=" + keyword; + window.open(url); + }); + } +}) \ No newline at end of file diff --git a/app/assets/javascripts/admins/identity_authentications/index.js b/app/assets/javascripts/admins/identity_authentications/index.js new file mode 100644 index 000000000..2da644ec2 --- /dev/null +++ b/app/assets/javascripts/admins/identity_authentications/index.js @@ -0,0 +1,18 @@ +$(document).on('turbolinks:load', function() { + if ($('body.admins-identity-authentications-index-page').length > 0) { + var $searchFrom = $('.identity-authentication-list-form'); + + $searchFrom.on('click', '.search-form-tab', function(){ + var $link = $(this); + + $searchFrom.find('input[name="keyword"]').val(''); + $searchFrom.find('select[name="status"]').val('processed'); + + if($link.data('value') === 'processed'){ + $searchFrom.find('.status-filter').show(); + } else { + $searchFrom.find('.status-filter').hide(); + } + }); + } +}) \ No newline at end of file diff --git a/app/assets/javascripts/admins/professional_authentications/index.js b/app/assets/javascripts/admins/professional_authentications/index.js new file mode 100644 index 000000000..769a6b2fc --- /dev/null +++ b/app/assets/javascripts/admins/professional_authentications/index.js @@ -0,0 +1,18 @@ +$(document).on('turbolinks:load', function() { + if ($('body.admins-professional-authentications-index-page').length > 0) { + var $searchFrom = $('.professional-authentication-list-form'); + + $searchFrom.on('click', '.search-form-tab', function(){ + var $link = $(this); + + $searchFrom.find('input[name="keyword"]').val(''); + $searchFrom.find('select[name="status"]').val('processed'); + + if($link.data('value') === 'processed'){ + $searchFrom.find('.status-filter').show(); + } else { + $searchFrom.find('.status-filter').hide(); + } + }); + } +}) \ No newline at end of file diff --git a/app/assets/javascripts/admins/school_statistics/index.js b/app/assets/javascripts/admins/school_statistics/index.js new file mode 100644 index 000000000..f6c364e76 --- /dev/null +++ b/app/assets/javascripts/admins/school_statistics/index.js @@ -0,0 +1,135 @@ +$(document).on('turbolinks:load', function(){ + if ($('body.admins-school-statistics-index-page').length > 0) { + var searchForm = $(".school-statistic-list-form .search-form"); + var growFormUrl = searchForm.data('grow-form-url'); + var contrastFormUrl = searchForm.data('contrast-form-url'); + + var dataTypeInput = searchForm.find("input[name='data_type']"); + var keywordInput = searchForm.find("input[name='keyword']"); + var contrastBtn = searchForm.find(".contrast-btn"); + var growBtn = searchForm.find(".grow-btn"); + var contrastDateContainer = searchForm.find('.contrast-date-container'); + var growDateContainer = searchForm.find('.grow-date-container'); + + // 数据对比日期输入框 + var beginDateInput = searchForm.find("input[name='begin_date']"); + var endDateInput = searchForm.find("input[name='end_date']"); + var otherBeginDateInput = searchForm.find("input[name='other_begin_date']"); + var otherEndDateInput = searchForm.find("input[name='other_end_date']"); + + // 新增数据日期输入框 + var growBeginDateInput = searchForm.find("input[name='grow_begin_date']"); + var growEndDateInput = searchForm.find("input[name='grow_end_date']"); + + // 数据展示切换: 数据对比、新增数据 + searchForm.on('click', ".contrast-btn", function(){ + if(contrastBtn.hasClass("active")) { return } + changeDataType("contrast"); + submitForm(); + }); + searchForm.on('click', ".grow-btn", function(){ + if(growBtn.hasClass("active")) { return } + changeDataType("grow"); + submitForm(); + }); + + // 搜索按钮 + searchForm.on('click', ".search-btn", function(){ + console.log('submit'); + submitForm(); + }); + + $('.school-statistic-list-container').on('change', '.contrast-column-select', function() { + searchForm.find("input[name='contrast_column']").val($('.contrast-column-select').val()); + submitForm(); + }); + + var submitForm = function(){ + if(!validateFrom()) { return } + + var form = searchForm; + var url = dataTypeInput.val() == "contrast" ? contrastFormUrl : growFormUrl; + + $.ajax({ + url: url, + data: form.serialize(), + dataType: "script" + }) + }; + + var validateFrom = function(){ + if (dataTypeInput.val() != "contrast") { return true; } + + // 全部为空时,需要展示空数据页 + if (beginDateInput.val() == "" && endDateInput.val() == "" && + otherBeginDateInput.val() == "" && otherBeginDateInput.val() == "") { + return true; + } + + if (beginDateInput.val() != "" && endDateInput.val() != "" && + otherBeginDateInput.val() != "" && otherBeginDateInput.val() != "") { + return true; + } + + return false; + }; + + var changeDataType = function(dataType){ + if (dataTypeInput.val() == dataType) { return } + + if (dataType == "contrast") { + contrastBtn.addClass("active"); + growBtn.removeClass("active"); + dataTypeInput.val('contrast'); + growDateContainer.hide(); + contrastDateContainer.show(); + + clearGrowDateInput(); + } else { + contrastBtn.removeClass("active"); + growBtn.addClass("active"); + dataTypeInput.val('grow'); + growDateContainer.show(); + contrastDateContainer.hide(); + + clearContrastDateInput(); + } + }; + + var clearGrowDateInput = function() { + searchForm.find("input[name='grow_begin_date']").val(''); + searchForm.find("input[name='grow_end_date']").val(''); + searchForm.find("input[name='grow_date_input']").val(''); + }; + + var clearContrastDateInput = function(){ + searchForm.find("input[name='begin_date']").val(''); + searchForm.find("input[name='end_date']").val(''); + searchForm.find("input[name='other_begin_date']").val(''); + searchForm.find("input[name='other_end_date']").val(''); + searchForm.find("input[name='date_input']").val(''); + searchForm.find("input[name='other_date_input']").val(''); + }; + + var baseOptions = { + autoclose: true, + language: 'zh-CN', + format: 'yyyy-mm-dd', + startDate: '2017-04-01', + endDate: '-1d' + } + + var defineDateRangeSelect = function(element){ + var options = $.extend({inputs: $(element).find('.start-date, .end-date')}, baseOptions); + $(element).datepicker(options); + + $(element).find('.start-date').datepicker().on('changeDate', function(e){ + $(element).find('.end-date').datepicker('setStartDate', e.date); + }) + }; + + defineDateRangeSelect('.grow-date-input-daterange'); + defineDateRangeSelect('.date-input-daterange'); + defineDateRangeSelect('.other-date-input-daterange'); + } +}) \ No newline at end of file diff --git a/app/assets/javascripts/admins/search-form-tab.js b/app/assets/javascripts/admins/search-form-tab.js new file mode 100644 index 000000000..6009412d5 --- /dev/null +++ b/app/assets/javascripts/admins/search-form-tab.js @@ -0,0 +1,10 @@ +$(document).on('turbolinks:load', function() { + var $tabs = $('.search-form-container .search-form-tabs'); + if ($tabs.length > 0) { + $tabs.on('click', '.search-form-tab', function(){ + var $activeTab = $(this); + $tabs.find('.search-form-tab').removeClass('active'); + $activeTab.addClass('active'); + }); + } +}); \ No newline at end of file diff --git a/app/assets/javascripts/admins/sidebar.js b/app/assets/javascripts/admins/sidebar.js new file mode 100644 index 000000000..432aa700b --- /dev/null +++ b/app/assets/javascripts/admins/sidebar.js @@ -0,0 +1,16 @@ +$(document).on('turbolinks:load', function(){ + $('#sidebarCollapse').on('click', function () { + $(this).toggleClass('active'); + $('#sidebar').toggleClass('active'); + $.cookie('admin_sidebar_collapse', $(this).hasClass('active'), {path: '/admins'}); + }); + + var sidebarController = $('#sidebar').data('current-controller'); + if (sidebarController.length > 0) { + $('#sidebar a.active').removeClass('active'); + $('#sidebar ul.collapse.show').removeClass('show'); + var activeLi = $('#sidebar a[data-controller="' + sidebarController + '"]'); + activeLi.addClass('active'); + activeLi.parent().parent('ul.collapse').addClass('show'); + } +}); \ No newline at end of file diff --git a/app/assets/javascripts/admins/users/edit.js b/app/assets/javascripts/admins/users/edit.js new file mode 100644 index 000000000..1d66466fb --- /dev/null +++ b/app/assets/javascripts/admins/users/edit.js @@ -0,0 +1,156 @@ +$(document).on('turbolinks:load', function() { + if ($('body.admins-users-edit-page, body.admins-users-update-page').length > 0) { + var initDepartmentSelect = true; + + // ************** 学校选择 ************* + var matcherFunc = function(params, data){ + if ($.trim(params.term) === '') { + return data; + } + if (typeof data.text === 'undefined') { + return null; + } + + if (data.name && data.name.indexOf(params.term) > -1) { + var modifiedData = $.extend({}, data, true); + return modifiedData; + } + + // Return `null` if the term should not be displayed + return null; + } + + var defineSchoolSelect = function (schools) { + $('.school-select').select2({ + theme: 'bootstrap4', + placeholder: '查询学校/单位', + minimumInputLength: 1, + data: schools, + templateResult: function (item) { + if(!item.id || item.id === '') return item.text; + return item.name; + }, + templateSelection: function(item){ + if (item.id) { + $('#user_school_id').val(item.id); + getDepartmentsData(item.id, defineDepartmentSelect2); + } + return item.name || item.text; + }, + matcher: matcherFunc + }); + }; + + var defineDepartmentSelect2 = function(departments){ + departments.unshift({ id: '-1', name: '未选择' }); // 可不选 + + if (!initDepartmentSelect) { $('.department-select').empty(); } // 为了能够回填部门 + initDepartmentSelect = false; + + $('.department-select').select2({ + theme: 'bootstrap4', + placeholder: '查询学院/部门', + minimumInputLength: 0, + data: departments, + templateResult: function (item) { + if(!item.id || item.id === '') return item.text; + return item.name; + }, + templateSelection: function(item){ + if (item.id) { + $('#user_department_id').val(item.id); + } + return item.name || item.text; + }, + matcher: matcherFunc + }); + }; + + var getDepartmentsData = function(school_id, callback){ + $.ajax({ + url: '/api/schools/' + school_id + '/departments/for_option.json', + dataType: 'json', + type: 'GET', + success: function(data) { + callback(data.departments); + } + }) + } + + // 初始化学校选择器 + $.ajax({ + url: '/api/schools/for_option.json', + dataType: 'json', + type: 'GET', + success: function(data) { + defineSchoolSelect(data.schools); + } + }); + + // **************** 地区选择 **************** + $('.province-city-select').cxSelect({ + url: '/javascripts/educoder/province-data.json', + selects: ['province-select', 'city-select'] + }); + + // *********** 职业选择 ************ + var identityData = [ + { + "v": "teacher", + "n": "教师", + "s": [{"n": "教授", "v": "教授"},{"n": "副教授", "v": "副教授"},{"n": "讲师", "v": "讲师"},{"n": "助教", "v": "助教"}] + }, + { + "v": "student", + "n": "学生", + "s": [] + }, + { + "v": "professional", + "n": "专业人士", + "s": [{"n": "企业管理者", "v": "企业管理者"},{"n": "部门管理者", "v": "部门管理者"},{"n": "高级工程师", "v": "高级工程师"},{"n": "工程师", "v": "工程师"},{"n": "助理工程师", "v": "助理工程师"}] + } + ]; + $('.user-identity-select').cxSelect({ + data: identityData, + jsonValue: 'v', + selects: ['identity-select', 'technical-title-select'] + }); + $('.identity-select').on('change', function(){ + if($(this).val() === 'student'){ + $('.technical-title-select-wrapper').hide(); + $('.form-group.user_student_id').show(); + } else { + $('.technical-title-select-wrapper').show(); + $('.form-group.user_student_id').hide(); + } + }) + + + var $form = $('form.edit_user') + $form.validate({ + errorElement: 'span', + errorClass: 'danger text-danger', + rules: { + "user[password]": { + required: false, + minlength: 5 + }, + "user[password_confirmation]": { + required: false, + minlength: 5, + equalTo: "#user_password" + }, + }, + messages: { + "user[password_confirmation]": { + equalTo: "两次密码输入不一致" + } + } + }) + + $form.submit(function(e){ + if(!$form.valid()){ e.preventDefault(); } + }) + } +}); \ No newline at end of file diff --git a/app/assets/javascripts/admins/users/index.js b/app/assets/javascripts/admins/users/index.js new file mode 100644 index 000000000..f0ddf1e0f --- /dev/null +++ b/app/assets/javascripts/admins/users/index.js @@ -0,0 +1,121 @@ +$(document).on('turbolinks:load', function(){ + if ($('body.admins-users-index-page').length > 0) { + + var showSuccessNotify = function() { + $.notify({ + message: '操作成功' + },{ + type: 'success' + }); + } + + // lock user + $('.users-list-container').on('click', '.lock-action', function(){ + var $lockAction = $(this); + var $unlockAction = $lockAction.siblings('.unlock-action'); + + var userId = $lockAction.data('id'); + + $.ajax({ + url: '/admins/users/' + userId + '/lock', + method: 'POST', + dataType: 'json', + success: function() { + showSuccessNotify(); + $lockAction.hide(); + $unlockAction.show(); + } + }); + }); + + // unlock user + $('.users-list-container').on('click', '.unlock-action', function(){ + var $unlockAction = $(this); + var $lockAction = $unlockAction.siblings('.lock-action'); + + var userId = $unlockAction.data('id'); + + $.ajax({ + url: '/admins/users/' + userId + '/unlock', + method: 'POST', + dataType: 'json', + success: function() { + showSuccessNotify(); + $lockAction.show(); + $unlockAction.hide(); + } + }); + }); + + // active user + $('.users-list-container').on('click', '.active-action', function(){ + var $activeAction = $(this); + var $unlockAction = $activeAction.siblings('.unlock-action'); + var $lockAction = $activeAction.siblings('.lock-action'); + + var userId = $activeAction.data('id'); + + $.ajax({ + url: '/admins/users/' + userId + '/unlock', + method: 'POST', + dataType: 'json', + success: function() { + showSuccessNotify(); + $activeAction.hide(); + $lockAction.show(); + $unlockAction.hide(); + } + }); + }); + + // ***************** reward grade modal ***************** + var $rewardGradeModal = $('.admin-users-reward-grade-modal'); + var $form = $rewardGradeModal.find('form.admin-users-reward-grade-form'); + + $form.validate({ + errorElement: 'span', + errorClass: 'danger text-danger', + rules: { + grade: { + required: true, + digits: true + }, + } + }); + + // modal ready fire + $rewardGradeModal.on('show.bs.modal', function (event) { + var $link = $(event.relatedTarget); + + var userId = $link.data('id'); + $rewardGradeModal.find('.modal-body input[name="user_id"]').val(userId); + }); + // modal visited fire + $rewardGradeModal.on('shown.bs.modal', function(){ + $rewardGradeModal.find('.modal-body input[name="grade"]').focus(); + }); + + $('.admin-users-reward-grade-modal .submit-btn').on('click', function(){ + $form.find('.error').html(''); + + if ($form.valid()) { + var userId = $form.find('input[name="user_id"]').val(); + + $.ajax({ + method: 'POST', + dataType: 'json', + url: "/admins/users/" + userId + "/reward_grade", + data: $form.serialize(), + success: function(data) { + showSuccessNotify(); + $('.users-list-container .user-item-' + userId + ' td.grade-content').html(data.grade); + $rewardGradeModal.modal('hide'); + }, + error: function(res) { + $rewardGradeModal.find('.error').html(res.responseJSON.message); + } + }); + } + }); + } +}); \ No newline at end of file diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index a3fb4b534..07a3c90d4 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -13,4 +13,7 @@ //= require rails-ujs //= require activestorage //= require turbolinks +//= require jquery3 +//= require popper +//= require bootstrap-sprockets //= require_tree . diff --git a/app/assets/javascripts/bootstrap-datepicker.js b/app/assets/javascripts/bootstrap-datepicker.js new file mode 100644 index 000000000..70d91c557 --- /dev/null +++ b/app/assets/javascripts/bootstrap-datepicker.js @@ -0,0 +1,2039 @@ +/*! + * Datepicker for Bootstrap v1.9.0 (https://github.com/uxsolutions/bootstrap-datepicker) + * + * Licensed under the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0) + */ + +(function(factory){ + if (typeof define === 'function' && define.amd) { + define(['jquery'], factory); + } else if (typeof exports === 'object') { + factory(require('jquery')); + } else { + factory(jQuery); + } +}(function($, undefined){ + function UTCDate(){ + return new Date(Date.UTC.apply(Date, arguments)); + } + function UTCToday(){ + var today = new Date(); + return UTCDate(today.getFullYear(), today.getMonth(), today.getDate()); + } + function isUTCEquals(date1, date2) { + return ( + date1.getUTCFullYear() === date2.getUTCFullYear() && + date1.getUTCMonth() === date2.getUTCMonth() && + date1.getUTCDate() === date2.getUTCDate() + ); + } + function alias(method, deprecationMsg){ + return function(){ + if (deprecationMsg !== undefined) { + $.fn.datepicker.deprecated(deprecationMsg); + } + + return this[method].apply(this, arguments); + }; + } + function isValidDate(d) { + return d && !isNaN(d.getTime()); + } + + var DateArray = (function(){ + var extras = { + get: function(i){ + return this.slice(i)[0]; + }, + contains: function(d){ + // Array.indexOf is not cross-browser; + // $.inArray doesn't work with Dates + var val = d && d.valueOf(); + for (var i=0, l=this.length; i < l; i++) + // Use date arithmetic to allow dates with different times to match + if (0 <= this[i].valueOf() - val && this[i].valueOf() - val < 1000*60*60*24) + return i; + return -1; + }, + remove: function(i){ + this.splice(i,1); + }, + replace: function(new_array){ + if (!new_array) + return; + if (!$.isArray(new_array)) + new_array = [new_array]; + this.clear(); + this.push.apply(this, new_array); + }, + clear: function(){ + this.length = 0; + }, + copy: function(){ + var a = new DateArray(); + a.replace(this); + return a; + } + }; + + return function(){ + var a = []; + a.push.apply(a, arguments); + $.extend(a, extras); + return a; + }; + })(); + + + // Picker object + + var Datepicker = function(element, options){ + $.data(element, 'datepicker', this); + + this._events = []; + this._secondaryEvents = []; + + this._process_options(options); + + this.dates = new DateArray(); + this.viewDate = this.o.defaultViewDate; + this.focusDate = null; + + this.element = $(element); + this.isInput = this.element.is('input'); + this.inputField = this.isInput ? this.element : this.element.find('input'); + this.component = this.element.hasClass('date') ? this.element.find('.add-on, .input-group-addon, .input-group-append, .input-group-prepend, .btn') : false; + if (this.component && this.component.length === 0) + this.component = false; + this.isInline = !this.component && this.element.is('div'); + + this.picker = $(DPGlobal.template); + + // Checking templates and inserting + if (this._check_template(this.o.templates.leftArrow)) { + this.picker.find('.prev').html(this.o.templates.leftArrow); + } + + if (this._check_template(this.o.templates.rightArrow)) { + this.picker.find('.next').html(this.o.templates.rightArrow); + } + + this._buildEvents(); + this._attachEvents(); + + if (this.isInline){ + this.picker.addClass('datepicker-inline').appendTo(this.element); + } + else { + this.picker.addClass('datepicker-dropdown dropdown-menu'); + } + + if (this.o.rtl){ + this.picker.addClass('datepicker-rtl'); + } + + if (this.o.calendarWeeks) { + this.picker.find('.datepicker-days .datepicker-switch, thead .datepicker-title, tfoot .today, tfoot .clear') + .attr('colspan', function(i, val){ + return Number(val) + 1; + }); + } + + this._process_options({ + startDate: this._o.startDate, + endDate: this._o.endDate, + daysOfWeekDisabled: this.o.daysOfWeekDisabled, + daysOfWeekHighlighted: this.o.daysOfWeekHighlighted, + datesDisabled: this.o.datesDisabled + }); + + this._allow_update = false; + this.setViewMode(this.o.startView); + this._allow_update = true; + + this.fillDow(); + this.fillMonths(); + + this.update(); + + if (this.isInline){ + this.show(); + } + }; + + Datepicker.prototype = { + constructor: Datepicker, + + _resolveViewName: function(view){ + $.each(DPGlobal.viewModes, function(i, viewMode){ + if (view === i || $.inArray(view, viewMode.names) !== -1){ + view = i; + return false; + } + }); + + return view; + }, + + _resolveDaysOfWeek: function(daysOfWeek){ + if (!$.isArray(daysOfWeek)) + daysOfWeek = daysOfWeek.split(/[,\s]*/); + return $.map(daysOfWeek, Number); + }, + + _check_template: function(tmp){ + try { + // If empty + if (tmp === undefined || tmp === "") { + return false; + } + // If no html, everything ok + if ((tmp.match(/[<>]/g) || []).length <= 0) { + return true; + } + // Checking if html is fine + var jDom = $(tmp); + return jDom.length > 0; + } + catch (ex) { + return false; + } + }, + + _process_options: function(opts){ + // Store raw options for reference + this._o = $.extend({}, this._o, opts); + // Processed options + var o = this.o = $.extend({}, this._o); + + // Check if "de-DE" style date is available, if not language should + // fallback to 2 letter code eg "de" + var lang = o.language; + if (!dates[lang]){ + lang = lang.split('-')[0]; + if (!dates[lang]) + lang = defaults.language; + } + o.language = lang; + + // Retrieve view index from any aliases + o.startView = this._resolveViewName(o.startView); + o.minViewMode = this._resolveViewName(o.minViewMode); + o.maxViewMode = this._resolveViewName(o.maxViewMode); + + // Check view is between min and max + o.startView = Math.max(this.o.minViewMode, Math.min(this.o.maxViewMode, o.startView)); + + // true, false, or Number > 0 + if (o.multidate !== true){ + o.multidate = Number(o.multidate) || false; + if (o.multidate !== false) + o.multidate = Math.max(0, o.multidate); + } + o.multidateSeparator = String(o.multidateSeparator); + + o.weekStart %= 7; + o.weekEnd = (o.weekStart + 6) % 7; + + var format = DPGlobal.parseFormat(o.format); + if (o.startDate !== -Infinity){ + if (!!o.startDate){ + if (o.startDate instanceof Date) + o.startDate = this._local_to_utc(this._zero_time(o.startDate)); + else + o.startDate = DPGlobal.parseDate(o.startDate, format, o.language, o.assumeNearbyYear); + } + else { + o.startDate = -Infinity; + } + } + if (o.endDate !== Infinity){ + if (!!o.endDate){ + if (o.endDate instanceof Date) + o.endDate = this._local_to_utc(this._zero_time(o.endDate)); + else + o.endDate = DPGlobal.parseDate(o.endDate, format, o.language, o.assumeNearbyYear); + } + else { + o.endDate = Infinity; + } + } + + o.daysOfWeekDisabled = this._resolveDaysOfWeek(o.daysOfWeekDisabled||[]); + o.daysOfWeekHighlighted = this._resolveDaysOfWeek(o.daysOfWeekHighlighted||[]); + + o.datesDisabled = o.datesDisabled||[]; + if (!$.isArray(o.datesDisabled)) { + o.datesDisabled = o.datesDisabled.split(','); + } + o.datesDisabled = $.map(o.datesDisabled, function(d){ + return DPGlobal.parseDate(d, format, o.language, o.assumeNearbyYear); + }); + + var plc = String(o.orientation).toLowerCase().split(/\s+/g), + _plc = o.orientation.toLowerCase(); + plc = $.grep(plc, function(word){ + return /^auto|left|right|top|bottom$/.test(word); + }); + o.orientation = {x: 'auto', y: 'auto'}; + if (!_plc || _plc === 'auto') + ; // no action + else if (plc.length === 1){ + switch (plc[0]){ + case 'top': + case 'bottom': + o.orientation.y = plc[0]; + break; + case 'left': + case 'right': + o.orientation.x = plc[0]; + break; + } + } + else { + _plc = $.grep(plc, function(word){ + return /^left|right$/.test(word); + }); + o.orientation.x = _plc[0] || 'auto'; + + _plc = $.grep(plc, function(word){ + return /^top|bottom$/.test(word); + }); + o.orientation.y = _plc[0] || 'auto'; + } + if (o.defaultViewDate instanceof Date || typeof o.defaultViewDate === 'string') { + o.defaultViewDate = DPGlobal.parseDate(o.defaultViewDate, format, o.language, o.assumeNearbyYear); + } else if (o.defaultViewDate) { + var year = o.defaultViewDate.year || new Date().getFullYear(); + var month = o.defaultViewDate.month || 0; + var day = o.defaultViewDate.day || 1; + o.defaultViewDate = UTCDate(year, month, day); + } else { + o.defaultViewDate = UTCToday(); + } + }, + _applyEvents: function(evs){ + for (var i=0, el, ch, ev; i < evs.length; i++){ + el = evs[i][0]; + if (evs[i].length === 2){ + ch = undefined; + ev = evs[i][1]; + } else if (evs[i].length === 3){ + ch = evs[i][1]; + ev = evs[i][2]; + } + el.on(ev, ch); + } + }, + _unapplyEvents: function(evs){ + for (var i=0, el, ev, ch; i < evs.length; i++){ + el = evs[i][0]; + if (evs[i].length === 2){ + ch = undefined; + ev = evs[i][1]; + } else if (evs[i].length === 3){ + ch = evs[i][1]; + ev = evs[i][2]; + } + el.off(ev, ch); + } + }, + _buildEvents: function(){ + var events = { + keyup: $.proxy(function(e){ + if ($.inArray(e.keyCode, [27, 37, 39, 38, 40, 32, 13, 9]) === -1) + this.update(); + }, this), + keydown: $.proxy(this.keydown, this), + paste: $.proxy(this.paste, this) + }; + + if (this.o.showOnFocus === true) { + events.focus = $.proxy(this.show, this); + } + + if (this.isInput) { // single input + this._events = [ + [this.element, events] + ]; + } + // component: input + button + else if (this.component && this.inputField.length) { + this._events = [ + // For components that are not readonly, allow keyboard nav + [this.inputField, events], + [this.component, { + click: $.proxy(this.show, this) + }] + ]; + } + else { + this._events = [ + [this.element, { + click: $.proxy(this.show, this), + keydown: $.proxy(this.keydown, this) + }] + ]; + } + this._events.push( + // Component: listen for blur on element descendants + [this.element, '*', { + blur: $.proxy(function(e){ + this._focused_from = e.target; + }, this) + }], + // Input: listen for blur on element + [this.element, { + blur: $.proxy(function(e){ + this._focused_from = e.target; + }, this) + }] + ); + + if (this.o.immediateUpdates) { + // Trigger input updates immediately on changed year/month + this._events.push([this.element, { + 'changeYear changeMonth': $.proxy(function(e){ + this.update(e.date); + }, this) + }]); + } + + this._secondaryEvents = [ + [this.picker, { + click: $.proxy(this.click, this) + }], + [this.picker, '.prev, .next', { + click: $.proxy(this.navArrowsClick, this) + }], + [this.picker, '.day:not(.disabled)', { + click: $.proxy(this.dayCellClick, this) + }], + [$(window), { + resize: $.proxy(this.place, this) + }], + [$(document), { + 'mousedown touchstart': $.proxy(function(e){ + // Clicked outside the datepicker, hide it + if (!( + this.element.is(e.target) || + this.element.find(e.target).length || + this.picker.is(e.target) || + this.picker.find(e.target).length || + this.isInline + )){ + this.hide(); + } + }, this) + }] + ]; + }, + _attachEvents: function(){ + this._detachEvents(); + this._applyEvents(this._events); + }, + _detachEvents: function(){ + this._unapplyEvents(this._events); + }, + _attachSecondaryEvents: function(){ + this._detachSecondaryEvents(); + this._applyEvents(this._secondaryEvents); + }, + _detachSecondaryEvents: function(){ + this._unapplyEvents(this._secondaryEvents); + }, + _trigger: function(event, altdate){ + var date = altdate || this.dates.get(-1), + local_date = this._utc_to_local(date); + + this.element.trigger({ + type: event, + date: local_date, + viewMode: this.viewMode, + dates: $.map(this.dates, this._utc_to_local), + format: $.proxy(function(ix, format){ + if (arguments.length === 0){ + ix = this.dates.length - 1; + format = this.o.format; + } else if (typeof ix === 'string'){ + format = ix; + ix = this.dates.length - 1; + } + format = format || this.o.format; + var date = this.dates.get(ix); + return DPGlobal.formatDate(date, format, this.o.language); + }, this) + }); + }, + + show: function(){ + if (this.inputField.is(':disabled') || (this.inputField.prop('readonly') && this.o.enableOnReadonly === false)) + return; + if (!this.isInline) + this.picker.appendTo(this.o.container); + this.place(); + this.picker.show(); + this._attachSecondaryEvents(); + this._trigger('show'); + if ((window.navigator.msMaxTouchPoints || 'ontouchstart' in document) && this.o.disableTouchKeyboard) { + $(this.element).blur(); + } + return this; + }, + + hide: function(){ + if (this.isInline || !this.picker.is(':visible')) + return this; + this.focusDate = null; + this.picker.hide().detach(); + this._detachSecondaryEvents(); + this.setViewMode(this.o.startView); + + if (this.o.forceParse && this.inputField.val()) + this.setValue(); + this._trigger('hide'); + return this; + }, + + destroy: function(){ + this.hide(); + this._detachEvents(); + this._detachSecondaryEvents(); + this.picker.remove(); + delete this.element.data().datepicker; + if (!this.isInput){ + delete this.element.data().date; + } + return this; + }, + + paste: function(e){ + var dateString; + if (e.originalEvent.clipboardData && e.originalEvent.clipboardData.types + && $.inArray('text/plain', e.originalEvent.clipboardData.types) !== -1) { + dateString = e.originalEvent.clipboardData.getData('text/plain'); + } else if (window.clipboardData) { + dateString = window.clipboardData.getData('Text'); + } else { + return; + } + this.setDate(dateString); + this.update(); + e.preventDefault(); + }, + + _utc_to_local: function(utc){ + if (!utc) { + return utc; + } + + var local = new Date(utc.getTime() + (utc.getTimezoneOffset() * 60000)); + + if (local.getTimezoneOffset() !== utc.getTimezoneOffset()) { + local = new Date(utc.getTime() + (local.getTimezoneOffset() * 60000)); + } + + return local; + }, + _local_to_utc: function(local){ + return local && new Date(local.getTime() - (local.getTimezoneOffset()*60000)); + }, + _zero_time: function(local){ + return local && new Date(local.getFullYear(), local.getMonth(), local.getDate()); + }, + _zero_utc_time: function(utc){ + return utc && UTCDate(utc.getUTCFullYear(), utc.getUTCMonth(), utc.getUTCDate()); + }, + + getDates: function(){ + return $.map(this.dates, this._utc_to_local); + }, + + getUTCDates: function(){ + return $.map(this.dates, function(d){ + return new Date(d); + }); + }, + + getDate: function(){ + return this._utc_to_local(this.getUTCDate()); + }, + + getUTCDate: function(){ + var selected_date = this.dates.get(-1); + if (selected_date !== undefined) { + return new Date(selected_date); + } else { + return null; + } + }, + + clearDates: function(){ + this.inputField.val(''); + this.update(); + this._trigger('changeDate'); + + if (this.o.autoclose) { + this.hide(); + } + }, + + setDates: function(){ + var args = $.isArray(arguments[0]) ? arguments[0] : arguments; + this.update.apply(this, args); + this._trigger('changeDate'); + this.setValue(); + return this; + }, + + setUTCDates: function(){ + var args = $.isArray(arguments[0]) ? arguments[0] : arguments; + this.setDates.apply(this, $.map(args, this._utc_to_local)); + return this; + }, + + setDate: alias('setDates'), + setUTCDate: alias('setUTCDates'), + remove: alias('destroy', 'Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead'), + + setValue: function(){ + var formatted = this.getFormattedDate(); + this.inputField.val(formatted); + return this; + }, + + getFormattedDate: function(format){ + if (format === undefined) + format = this.o.format; + + var lang = this.o.language; + return $.map(this.dates, function(d){ + return DPGlobal.formatDate(d, format, lang); + }).join(this.o.multidateSeparator); + }, + + getStartDate: function(){ + return this.o.startDate; + }, + + setStartDate: function(startDate){ + this._process_options({startDate: startDate}); + this.update(); + this.updateNavArrows(); + return this; + }, + + getEndDate: function(){ + return this.o.endDate; + }, + + setEndDate: function(endDate){ + this._process_options({endDate: endDate}); + this.update(); + this.updateNavArrows(); + return this; + }, + + setDaysOfWeekDisabled: function(daysOfWeekDisabled){ + this._process_options({daysOfWeekDisabled: daysOfWeekDisabled}); + this.update(); + return this; + }, + + setDaysOfWeekHighlighted: function(daysOfWeekHighlighted){ + this._process_options({daysOfWeekHighlighted: daysOfWeekHighlighted}); + this.update(); + return this; + }, + + setDatesDisabled: function(datesDisabled){ + this._process_options({datesDisabled: datesDisabled}); + this.update(); + return this; + }, + + place: function(){ + if (this.isInline) + return this; + var calendarWidth = this.picker.outerWidth(), + calendarHeight = this.picker.outerHeight(), + visualPadding = 10, + container = $(this.o.container), + windowWidth = container.width(), + scrollTop = this.o.container === 'body' ? $(document).scrollTop() : container.scrollTop(), + appendOffset = container.offset(); + + var parentsZindex = [0]; + this.element.parents().each(function(){ + var itemZIndex = $(this).css('z-index'); + if (itemZIndex !== 'auto' && Number(itemZIndex) !== 0) parentsZindex.push(Number(itemZIndex)); + }); + var zIndex = Math.max.apply(Math, parentsZindex) + this.o.zIndexOffset; + var offset = this.component ? this.component.parent().offset() : this.element.offset(); + var height = this.component ? this.component.outerHeight(true) : this.element.outerHeight(false); + var width = this.component ? this.component.outerWidth(true) : this.element.outerWidth(false); + var left = offset.left - appendOffset.left; + var top = offset.top - appendOffset.top; + + if (this.o.container !== 'body') { + top += scrollTop; + } + + this.picker.removeClass( + 'datepicker-orient-top datepicker-orient-bottom '+ + 'datepicker-orient-right datepicker-orient-left' + ); + + if (this.o.orientation.x !== 'auto'){ + this.picker.addClass('datepicker-orient-' + this.o.orientation.x); + if (this.o.orientation.x === 'right') + left -= calendarWidth - width; + } + // auto x orientation is best-placement: if it crosses a window + // edge, fudge it sideways + else { + if (offset.left < 0) { + // component is outside the window on the left side. Move it into visible range + this.picker.addClass('datepicker-orient-left'); + left -= offset.left - visualPadding; + } else if (left + calendarWidth > windowWidth) { + // the calendar passes the widow right edge. Align it to component right side + this.picker.addClass('datepicker-orient-right'); + left += width - calendarWidth; + } else { + if (this.o.rtl) { + // Default to right + this.picker.addClass('datepicker-orient-right'); + } else { + // Default to left + this.picker.addClass('datepicker-orient-left'); + } + } + } + + // auto y orientation is best-situation: top or bottom, no fudging, + // decision based on which shows more of the calendar + var yorient = this.o.orientation.y, + top_overflow; + if (yorient === 'auto'){ + top_overflow = -scrollTop + top - calendarHeight; + yorient = top_overflow < 0 ? 'bottom' : 'top'; + } + + this.picker.addClass('datepicker-orient-' + yorient); + if (yorient === 'top') + top -= calendarHeight + parseInt(this.picker.css('padding-top')); + else + top += height; + + if (this.o.rtl) { + var right = windowWidth - (left + width); + this.picker.css({ + top: top, + right: right, + zIndex: zIndex + }); + } else { + this.picker.css({ + top: top, + left: left, + zIndex: zIndex + }); + } + return this; + }, + + _allow_update: true, + update: function(){ + if (!this._allow_update) + return this; + + var oldDates = this.dates.copy(), + dates = [], + fromArgs = false; + if (arguments.length){ + $.each(arguments, $.proxy(function(i, date){ + if (date instanceof Date) + date = this._local_to_utc(date); + dates.push(date); + }, this)); + fromArgs = true; + } else { + dates = this.isInput + ? this.element.val() + : this.element.data('date') || this.inputField.val(); + if (dates && this.o.multidate) + dates = dates.split(this.o.multidateSeparator); + else + dates = [dates]; + delete this.element.data().date; + } + + dates = $.map(dates, $.proxy(function(date){ + return DPGlobal.parseDate(date, this.o.format, this.o.language, this.o.assumeNearbyYear); + }, this)); + dates = $.grep(dates, $.proxy(function(date){ + return ( + !this.dateWithinRange(date) || + !date + ); + }, this), true); + this.dates.replace(dates); + + if (this.o.updateViewDate) { + if (this.dates.length) + this.viewDate = new Date(this.dates.get(-1)); + else if (this.viewDate < this.o.startDate) + this.viewDate = new Date(this.o.startDate); + else if (this.viewDate > this.o.endDate) + this.viewDate = new Date(this.o.endDate); + else + this.viewDate = this.o.defaultViewDate; + } + + if (fromArgs){ + // setting date by clicking + this.setValue(); + this.element.change(); + } + else if (this.dates.length){ + // setting date by typing + if (String(oldDates) !== String(this.dates) && fromArgs) { + this._trigger('changeDate'); + this.element.change(); + } + } + if (!this.dates.length && oldDates.length) { + this._trigger('clearDate'); + this.element.change(); + } + + this.fill(); + return this; + }, + + fillDow: function(){ + if (this.o.showWeekDays) { + var dowCnt = this.o.weekStart, + html = ''; + if (this.o.calendarWeeks){ + html += ' '; + } + while (dowCnt < this.o.weekStart + 7){ + html += ''+dates[this.o.language].daysMin[(dowCnt++)%7]+''; + } + html += ''; + this.picker.find('.datepicker-days thead').append(html); + } + }, + + fillMonths: function(){ + var localDate = this._utc_to_local(this.viewDate); + var html = ''; + var focused; + for (var i = 0; i < 12; i++){ + focused = localDate && localDate.getMonth() === i ? ' focused' : ''; + html += '' + dates[this.o.language].monthsShort[i] + ''; + } + this.picker.find('.datepicker-months td').html(html); + }, + + setRange: function(range){ + if (!range || !range.length) + delete this.range; + else + this.range = $.map(range, function(d){ + return d.valueOf(); + }); + this.fill(); + }, + + getClassNames: function(date){ + var cls = [], + year = this.viewDate.getUTCFullYear(), + month = this.viewDate.getUTCMonth(), + today = UTCToday(); + if (date.getUTCFullYear() < year || (date.getUTCFullYear() === year && date.getUTCMonth() < month)){ + cls.push('old'); + } else if (date.getUTCFullYear() > year || (date.getUTCFullYear() === year && date.getUTCMonth() > month)){ + cls.push('new'); + } + if (this.focusDate && date.valueOf() === this.focusDate.valueOf()) + cls.push('focused'); + // Compare internal UTC date with UTC today, not local today + if (this.o.todayHighlight && isUTCEquals(date, today)) { + cls.push('today'); + } + if (this.dates.contains(date) !== -1) + cls.push('active'); + if (!this.dateWithinRange(date)){ + cls.push('disabled'); + } + if (this.dateIsDisabled(date)){ + cls.push('disabled', 'disabled-date'); + } + if ($.inArray(date.getUTCDay(), this.o.daysOfWeekHighlighted) !== -1){ + cls.push('highlighted'); + } + + if (this.range){ + if (date > this.range[0] && date < this.range[this.range.length-1]){ + cls.push('range'); + } + if ($.inArray(date.valueOf(), this.range) !== -1){ + cls.push('selected'); + } + if (date.valueOf() === this.range[0]){ + cls.push('range-start'); + } + if (date.valueOf() === this.range[this.range.length-1]){ + cls.push('range-end'); + } + } + return cls; + }, + + _fill_yearsView: function(selector, cssClass, factor, year, startYear, endYear, beforeFn){ + var html = ''; + var step = factor / 10; + var view = this.picker.find(selector); + var startVal = Math.floor(year / factor) * factor; + var endVal = startVal + step * 9; + var focusedVal = Math.floor(this.viewDate.getFullYear() / step) * step; + var selected = $.map(this.dates, function(d){ + return Math.floor(d.getUTCFullYear() / step) * step; + }); + + var classes, tooltip, before; + for (var currVal = startVal - step; currVal <= endVal + step; currVal += step) { + classes = [cssClass]; + tooltip = null; + + if (currVal === startVal - step) { + classes.push('old'); + } else if (currVal === endVal + step) { + classes.push('new'); + } + if ($.inArray(currVal, selected) !== -1) { + classes.push('active'); + } + if (currVal < startYear || currVal > endYear) { + classes.push('disabled'); + } + if (currVal === focusedVal) { + classes.push('focused'); + } + + if (beforeFn !== $.noop) { + before = beforeFn(new Date(currVal, 0, 1)); + if (before === undefined) { + before = {}; + } else if (typeof before === 'boolean') { + before = {enabled: before}; + } else if (typeof before === 'string') { + before = {classes: before}; + } + if (before.enabled === false) { + classes.push('disabled'); + } + if (before.classes) { + classes = classes.concat(before.classes.split(/\s+/)); + } + if (before.tooltip) { + tooltip = before.tooltip; + } + } + + html += '' + currVal + ''; + } + + view.find('.datepicker-switch').text(startVal + '-' + endVal); + view.find('td').html(html); + }, + + fill: function(){ + var d = new Date(this.viewDate), + year = d.getUTCFullYear(), + month = d.getUTCMonth(), + startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity, + startMonth = this.o.startDate !== -Infinity ? this.o.startDate.getUTCMonth() : -Infinity, + endYear = this.o.endDate !== Infinity ? this.o.endDate.getUTCFullYear() : Infinity, + endMonth = this.o.endDate !== Infinity ? this.o.endDate.getUTCMonth() : Infinity, + todaytxt = dates[this.o.language].today || dates['en'].today || '', + cleartxt = dates[this.o.language].clear || dates['en'].clear || '', + titleFormat = dates[this.o.language].titleFormat || dates['en'].titleFormat, + todayDate = UTCToday(), + titleBtnVisible = (this.o.todayBtn === true || this.o.todayBtn === 'linked') && todayDate >= this.o.startDate && todayDate <= this.o.endDate && !this.weekOfDateIsDisabled(todayDate), + tooltip, + before; + if (isNaN(year) || isNaN(month)) + return; + this.picker.find('.datepicker-days .datepicker-switch') + .text(DPGlobal.formatDate(d, titleFormat, this.o.language)); + this.picker.find('tfoot .today') + .text(todaytxt) + .css('display', titleBtnVisible ? 'table-cell' : 'none'); + this.picker.find('tfoot .clear') + .text(cleartxt) + .css('display', this.o.clearBtn === true ? 'table-cell' : 'none'); + this.picker.find('thead .datepicker-title') + .text(this.o.title) + .css('display', typeof this.o.title === 'string' && this.o.title !== '' ? 'table-cell' : 'none'); + this.updateNavArrows(); + this.fillMonths(); + var prevMonth = UTCDate(year, month, 0), + day = prevMonth.getUTCDate(); + prevMonth.setUTCDate(day - (prevMonth.getUTCDay() - this.o.weekStart + 7)%7); + var nextMonth = new Date(prevMonth); + if (prevMonth.getUTCFullYear() < 100){ + nextMonth.setUTCFullYear(prevMonth.getUTCFullYear()); + } + nextMonth.setUTCDate(nextMonth.getUTCDate() + 42); + nextMonth = nextMonth.valueOf(); + var html = []; + var weekDay, clsName; + while (prevMonth.valueOf() < nextMonth){ + weekDay = prevMonth.getUTCDay(); + if (weekDay === this.o.weekStart){ + html.push(''); + if (this.o.calendarWeeks){ + // ISO 8601: First week contains first thursday. + // ISO also states week starts on Monday, but we can be more abstract here. + var + // Start of current week: based on weekstart/current date + ws = new Date(+prevMonth + (this.o.weekStart - weekDay - 7) % 7 * 864e5), + // Thursday of this week + th = new Date(Number(ws) + (7 + 4 - ws.getUTCDay()) % 7 * 864e5), + // First Thursday of year, year from thursday + yth = new Date(Number(yth = UTCDate(th.getUTCFullYear(), 0, 1)) + (7 + 4 - yth.getUTCDay()) % 7 * 864e5), + // Calendar week: ms between thursdays, div ms per day, div 7 days + calWeek = (th - yth) / 864e5 / 7 + 1; + html.push(''+ calWeek +''); + } + } + clsName = this.getClassNames(prevMonth); + clsName.push('day'); + + var content = prevMonth.getUTCDate(); + + if (this.o.beforeShowDay !== $.noop){ + before = this.o.beforeShowDay(this._utc_to_local(prevMonth)); + if (before === undefined) + before = {}; + else if (typeof before === 'boolean') + before = {enabled: before}; + else if (typeof before === 'string') + before = {classes: before}; + if (before.enabled === false) + clsName.push('disabled'); + if (before.classes) + clsName = clsName.concat(before.classes.split(/\s+/)); + if (before.tooltip) + tooltip = before.tooltip; + if (before.content) + content = before.content; + } + + //Check if uniqueSort exists (supported by jquery >=1.12 and >=2.2) + //Fallback to unique function for older jquery versions + if ($.isFunction($.uniqueSort)) { + clsName = $.uniqueSort(clsName); + } else { + clsName = $.unique(clsName); + } + + html.push('' + content + ''); + tooltip = null; + if (weekDay === this.o.weekEnd){ + html.push(''); + } + prevMonth.setUTCDate(prevMonth.getUTCDate() + 1); + } + this.picker.find('.datepicker-days tbody').html(html.join('')); + + var monthsTitle = dates[this.o.language].monthsTitle || dates['en'].monthsTitle || 'Months'; + var months = this.picker.find('.datepicker-months') + .find('.datepicker-switch') + .text(this.o.maxViewMode < 2 ? monthsTitle : year) + .end() + .find('tbody span').removeClass('active'); + + $.each(this.dates, function(i, d){ + if (d.getUTCFullYear() === year) + months.eq(d.getUTCMonth()).addClass('active'); + }); + + if (year < startYear || year > endYear){ + months.addClass('disabled'); + } + if (year === startYear){ + months.slice(0, startMonth).addClass('disabled'); + } + if (year === endYear){ + months.slice(endMonth+1).addClass('disabled'); + } + + if (this.o.beforeShowMonth !== $.noop){ + var that = this; + $.each(months, function(i, month){ + var moDate = new Date(year, i, 1); + var before = that.o.beforeShowMonth(moDate); + if (before === undefined) + before = {}; + else if (typeof before === 'boolean') + before = {enabled: before}; + else if (typeof before === 'string') + before = {classes: before}; + if (before.enabled === false && !$(month).hasClass('disabled')) + $(month).addClass('disabled'); + if (before.classes) + $(month).addClass(before.classes); + if (before.tooltip) + $(month).prop('title', before.tooltip); + }); + } + + // Generating decade/years picker + this._fill_yearsView( + '.datepicker-years', + 'year', + 10, + year, + startYear, + endYear, + this.o.beforeShowYear + ); + + // Generating century/decades picker + this._fill_yearsView( + '.datepicker-decades', + 'decade', + 100, + year, + startYear, + endYear, + this.o.beforeShowDecade + ); + + // Generating millennium/centuries picker + this._fill_yearsView( + '.datepicker-centuries', + 'century', + 1000, + year, + startYear, + endYear, + this.o.beforeShowCentury + ); + }, + + updateNavArrows: function(){ + if (!this._allow_update) + return; + + var d = new Date(this.viewDate), + year = d.getUTCFullYear(), + month = d.getUTCMonth(), + startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity, + startMonth = this.o.startDate !== -Infinity ? this.o.startDate.getUTCMonth() : -Infinity, + endYear = this.o.endDate !== Infinity ? this.o.endDate.getUTCFullYear() : Infinity, + endMonth = this.o.endDate !== Infinity ? this.o.endDate.getUTCMonth() : Infinity, + prevIsDisabled, + nextIsDisabled, + factor = 1; + switch (this.viewMode){ + case 4: + factor *= 10; + /* falls through */ + case 3: + factor *= 10; + /* falls through */ + case 2: + factor *= 10; + /* falls through */ + case 1: + prevIsDisabled = Math.floor(year / factor) * factor <= startYear; + nextIsDisabled = Math.floor(year / factor) * factor + factor > endYear; + break; + case 0: + prevIsDisabled = year <= startYear && month <= startMonth; + nextIsDisabled = year >= endYear && month >= endMonth; + break; + } + + this.picker.find('.prev').toggleClass('disabled', prevIsDisabled); + this.picker.find('.next').toggleClass('disabled', nextIsDisabled); + }, + + click: function(e){ + e.preventDefault(); + e.stopPropagation(); + + var target, dir, day, year, month; + target = $(e.target); + + // Clicked on the switch + if (target.hasClass('datepicker-switch') && this.viewMode !== this.o.maxViewMode){ + this.setViewMode(this.viewMode + 1); + } + + // Clicked on today button + if (target.hasClass('today') && !target.hasClass('day')){ + this.setViewMode(0); + this._setDate(UTCToday(), this.o.todayBtn === 'linked' ? null : 'view'); + } + + // Clicked on clear button + if (target.hasClass('clear')){ + this.clearDates(); + } + + if (!target.hasClass('disabled')){ + // Clicked on a month, year, decade, century + if (target.hasClass('month') + || target.hasClass('year') + || target.hasClass('decade') + || target.hasClass('century')) { + this.viewDate.setUTCDate(1); + + day = 1; + if (this.viewMode === 1){ + month = target.parent().find('span').index(target); + year = this.viewDate.getUTCFullYear(); + this.viewDate.setUTCMonth(month); + } else { + month = 0; + year = Number(target.text()); + this.viewDate.setUTCFullYear(year); + } + + this._trigger(DPGlobal.viewModes[this.viewMode - 1].e, this.viewDate); + + if (this.viewMode === this.o.minViewMode){ + this._setDate(UTCDate(year, month, day)); + } else { + this.setViewMode(this.viewMode - 1); + this.fill(); + } + } + } + + if (this.picker.is(':visible') && this._focused_from){ + this._focused_from.focus(); + } + delete this._focused_from; + }, + + dayCellClick: function(e){ + var $target = $(e.currentTarget); + var timestamp = $target.data('date'); + var date = new Date(timestamp); + + if (this.o.updateViewDate) { + if (date.getUTCFullYear() !== this.viewDate.getUTCFullYear()) { + this._trigger('changeYear', this.viewDate); + } + + if (date.getUTCMonth() !== this.viewDate.getUTCMonth()) { + this._trigger('changeMonth', this.viewDate); + } + } + this._setDate(date); + }, + + // Clicked on prev or next + navArrowsClick: function(e){ + var $target = $(e.currentTarget); + var dir = $target.hasClass('prev') ? -1 : 1; + if (this.viewMode !== 0){ + dir *= DPGlobal.viewModes[this.viewMode].navStep * 12; + } + this.viewDate = this.moveMonth(this.viewDate, dir); + this._trigger(DPGlobal.viewModes[this.viewMode].e, this.viewDate); + this.fill(); + }, + + _toggle_multidate: function(date){ + var ix = this.dates.contains(date); + if (!date){ + this.dates.clear(); + } + + if (ix !== -1){ + if (this.o.multidate === true || this.o.multidate > 1 || this.o.toggleActive){ + this.dates.remove(ix); + } + } else if (this.o.multidate === false) { + this.dates.clear(); + this.dates.push(date); + } + else { + this.dates.push(date); + } + + if (typeof this.o.multidate === 'number') + while (this.dates.length > this.o.multidate) + this.dates.remove(0); + }, + + _setDate: function(date, which){ + if (!which || which === 'date') + this._toggle_multidate(date && new Date(date)); + if ((!which && this.o.updateViewDate) || which === 'view') + this.viewDate = date && new Date(date); + + this.fill(); + this.setValue(); + if (!which || which !== 'view') { + this._trigger('changeDate'); + } + this.inputField.trigger('change'); + if (this.o.autoclose && (!which || which === 'date')){ + this.hide(); + } + }, + + moveDay: function(date, dir){ + var newDate = new Date(date); + newDate.setUTCDate(date.getUTCDate() + dir); + + return newDate; + }, + + moveWeek: function(date, dir){ + return this.moveDay(date, dir * 7); + }, + + moveMonth: function(date, dir){ + if (!isValidDate(date)) + return this.o.defaultViewDate; + if (!dir) + return date; + var new_date = new Date(date.valueOf()), + day = new_date.getUTCDate(), + month = new_date.getUTCMonth(), + mag = Math.abs(dir), + new_month, test; + dir = dir > 0 ? 1 : -1; + if (mag === 1){ + test = dir === -1 + // If going back one month, make sure month is not current month + // (eg, Mar 31 -> Feb 31 == Feb 28, not Mar 02) + ? function(){ + return new_date.getUTCMonth() === month; + } + // If going forward one month, make sure month is as expected + // (eg, Jan 31 -> Feb 31 == Feb 28, not Mar 02) + : function(){ + return new_date.getUTCMonth() !== new_month; + }; + new_month = month + dir; + new_date.setUTCMonth(new_month); + // Dec -> Jan (12) or Jan -> Dec (-1) -- limit expected date to 0-11 + new_month = (new_month + 12) % 12; + } + else { + // For magnitudes >1, move one month at a time... + for (var i=0; i < mag; i++) + // ...which might decrease the day (eg, Jan 31 to Feb 28, etc)... + new_date = this.moveMonth(new_date, dir); + // ...then reset the day, keeping it in the new month + new_month = new_date.getUTCMonth(); + new_date.setUTCDate(day); + test = function(){ + return new_month !== new_date.getUTCMonth(); + }; + } + // Common date-resetting loop -- if date is beyond end of month, make it + // end of month + while (test()){ + new_date.setUTCDate(--day); + new_date.setUTCMonth(new_month); + } + return new_date; + }, + + moveYear: function(date, dir){ + return this.moveMonth(date, dir*12); + }, + + moveAvailableDate: function(date, dir, fn){ + do { + date = this[fn](date, dir); + + if (!this.dateWithinRange(date)) + return false; + + fn = 'moveDay'; + } + while (this.dateIsDisabled(date)); + + return date; + }, + + weekOfDateIsDisabled: function(date){ + return $.inArray(date.getUTCDay(), this.o.daysOfWeekDisabled) !== -1; + }, + + dateIsDisabled: function(date){ + return ( + this.weekOfDateIsDisabled(date) || + $.grep(this.o.datesDisabled, function(d){ + return isUTCEquals(date, d); + }).length > 0 + ); + }, + + dateWithinRange: function(date){ + return date >= this.o.startDate && date <= this.o.endDate; + }, + + keydown: function(e){ + if (!this.picker.is(':visible')){ + if (e.keyCode === 40 || e.keyCode === 27) { // allow down to re-show picker + this.show(); + e.stopPropagation(); + } + return; + } + var dateChanged = false, + dir, newViewDate, + focusDate = this.focusDate || this.viewDate; + switch (e.keyCode){ + case 27: // escape + if (this.focusDate){ + this.focusDate = null; + this.viewDate = this.dates.get(-1) || this.viewDate; + this.fill(); + } + else + this.hide(); + e.preventDefault(); + e.stopPropagation(); + break; + case 37: // left + case 38: // up + case 39: // right + case 40: // down + if (!this.o.keyboardNavigation || this.o.daysOfWeekDisabled.length === 7) + break; + dir = e.keyCode === 37 || e.keyCode === 38 ? -1 : 1; + if (this.viewMode === 0) { + if (e.ctrlKey){ + newViewDate = this.moveAvailableDate(focusDate, dir, 'moveYear'); + + if (newViewDate) + this._trigger('changeYear', this.viewDate); + } else if (e.shiftKey){ + newViewDate = this.moveAvailableDate(focusDate, dir, 'moveMonth'); + + if (newViewDate) + this._trigger('changeMonth', this.viewDate); + } else if (e.keyCode === 37 || e.keyCode === 39){ + newViewDate = this.moveAvailableDate(focusDate, dir, 'moveDay'); + } else if (!this.weekOfDateIsDisabled(focusDate)){ + newViewDate = this.moveAvailableDate(focusDate, dir, 'moveWeek'); + } + } else if (this.viewMode === 1) { + if (e.keyCode === 38 || e.keyCode === 40) { + dir = dir * 4; + } + newViewDate = this.moveAvailableDate(focusDate, dir, 'moveMonth'); + } else if (this.viewMode === 2) { + if (e.keyCode === 38 || e.keyCode === 40) { + dir = dir * 4; + } + newViewDate = this.moveAvailableDate(focusDate, dir, 'moveYear'); + } + if (newViewDate){ + this.focusDate = this.viewDate = newViewDate; + this.setValue(); + this.fill(); + e.preventDefault(); + } + break; + case 13: // enter + if (!this.o.forceParse) + break; + focusDate = this.focusDate || this.dates.get(-1) || this.viewDate; + if (this.o.keyboardNavigation) { + this._toggle_multidate(focusDate); + dateChanged = true; + } + this.focusDate = null; + this.viewDate = this.dates.get(-1) || this.viewDate; + this.setValue(); + this.fill(); + if (this.picker.is(':visible')){ + e.preventDefault(); + e.stopPropagation(); + if (this.o.autoclose) + this.hide(); + } + break; + case 9: // tab + this.focusDate = null; + this.viewDate = this.dates.get(-1) || this.viewDate; + this.fill(); + this.hide(); + break; + } + if (dateChanged){ + if (this.dates.length) + this._trigger('changeDate'); + else + this._trigger('clearDate'); + this.inputField.trigger('change'); + } + }, + + setViewMode: function(viewMode){ + this.viewMode = viewMode; + this.picker + .children('div') + .hide() + .filter('.datepicker-' + DPGlobal.viewModes[this.viewMode].clsName) + .show(); + this.updateNavArrows(); + this._trigger('changeViewMode', new Date(this.viewDate)); + } + }; + + var DateRangePicker = function(element, options){ + $.data(element, 'datepicker', this); + this.element = $(element); + this.inputs = $.map(options.inputs, function(i){ + return i.jquery ? i[0] : i; + }); + delete options.inputs; + + this.keepEmptyValues = options.keepEmptyValues; + delete options.keepEmptyValues; + + datepickerPlugin.call($(this.inputs), options) + .on('changeDate', $.proxy(this.dateUpdated, this)); + + this.pickers = $.map(this.inputs, function(i){ + return $.data(i, 'datepicker'); + }); + this.updateDates(); + }; + DateRangePicker.prototype = { + updateDates: function(){ + this.dates = $.map(this.pickers, function(i){ + return i.getUTCDate(); + }); + this.updateRanges(); + }, + updateRanges: function(){ + var range = $.map(this.dates, function(d){ + return d.valueOf(); + }); + $.each(this.pickers, function(i, p){ + p.setRange(range); + }); + }, + clearDates: function(){ + $.each(this.pickers, function(i, p){ + p.clearDates(); + }); + }, + dateUpdated: function(e){ + // `this.updating` is a workaround for preventing infinite recursion + // between `changeDate` triggering and `setUTCDate` calling. Until + // there is a better mechanism. + if (this.updating) + return; + this.updating = true; + + var dp = $.data(e.target, 'datepicker'); + + if (dp === undefined) { + return; + } + + var new_date = dp.getUTCDate(), + keep_empty_values = this.keepEmptyValues, + i = $.inArray(e.target, this.inputs), + j = i - 1, + k = i + 1, + l = this.inputs.length; + if (i === -1) + return; + + $.each(this.pickers, function(i, p){ + if (!p.getUTCDate() && (p === dp || !keep_empty_values)) + p.setUTCDate(new_date); + }); + + if (new_date < this.dates[j]){ + // Date being moved earlier/left + while (j >= 0 && new_date < this.dates[j]){ + this.pickers[j--].setUTCDate(new_date); + } + } else if (new_date > this.dates[k]){ + // Date being moved later/right + while (k < l && new_date > this.dates[k]){ + this.pickers[k++].setUTCDate(new_date); + } + } + this.updateDates(); + + delete this.updating; + }, + destroy: function(){ + $.map(this.pickers, function(p){ p.destroy(); }); + $(this.inputs).off('changeDate', this.dateUpdated); + delete this.element.data().datepicker; + }, + remove: alias('destroy', 'Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead') + }; + + function opts_from_el(el, prefix){ + // Derive options from element data-attrs + var data = $(el).data(), + out = {}, inkey, + replace = new RegExp('^' + prefix.toLowerCase() + '([A-Z])'); + prefix = new RegExp('^' + prefix.toLowerCase()); + function re_lower(_,a){ + return a.toLowerCase(); + } + for (var key in data) + if (prefix.test(key)){ + inkey = key.replace(replace, re_lower); + out[inkey] = data[key]; + } + return out; + } + + function opts_from_locale(lang){ + // Derive options from locale plugins + var out = {}; + // Check if "de-DE" style date is available, if not language should + // fallback to 2 letter code eg "de" + if (!dates[lang]){ + lang = lang.split('-')[0]; + if (!dates[lang]) + return; + } + var d = dates[lang]; + $.each(locale_opts, function(i,k){ + if (k in d) + out[k] = d[k]; + }); + return out; + } + + var old = $.fn.datepicker; + var datepickerPlugin = function(option){ + var args = Array.apply(null, arguments); + args.shift(); + var internal_return; + this.each(function(){ + var $this = $(this), + data = $this.data('datepicker'), + options = typeof option === 'object' && option; + if (!data){ + var elopts = opts_from_el(this, 'date'), + // Preliminary otions + xopts = $.extend({}, defaults, elopts, options), + locopts = opts_from_locale(xopts.language), + // Options priority: js args, data-attrs, locales, defaults + opts = $.extend({}, defaults, locopts, elopts, options); + if ($this.hasClass('input-daterange') || opts.inputs){ + $.extend(opts, { + inputs: opts.inputs || $this.find('input').toArray() + }); + data = new DateRangePicker(this, opts); + } + else { + data = new Datepicker(this, opts); + } + $this.data('datepicker', data); + } + if (typeof option === 'string' && typeof data[option] === 'function'){ + internal_return = data[option].apply(data, args); + } + }); + + if ( + internal_return === undefined || + internal_return instanceof Datepicker || + internal_return instanceof DateRangePicker + ) + return this; + + if (this.length > 1) + throw new Error('Using only allowed for the collection of a single element (' + option + ' function)'); + else + return internal_return; + }; + $.fn.datepicker = datepickerPlugin; + + var defaults = $.fn.datepicker.defaults = { + assumeNearbyYear: false, + autoclose: false, + beforeShowDay: $.noop, + beforeShowMonth: $.noop, + beforeShowYear: $.noop, + beforeShowDecade: $.noop, + beforeShowCentury: $.noop, + calendarWeeks: false, + clearBtn: false, + toggleActive: false, + daysOfWeekDisabled: [], + daysOfWeekHighlighted: [], + datesDisabled: [], + endDate: Infinity, + forceParse: true, + format: 'mm/dd/yyyy', + keepEmptyValues: false, + keyboardNavigation: true, + language: 'en', + minViewMode: 0, + maxViewMode: 4, + multidate: false, + multidateSeparator: ',', + orientation: "auto", + rtl: false, + startDate: -Infinity, + startView: 0, + todayBtn: false, + todayHighlight: false, + updateViewDate: true, + weekStart: 0, + disableTouchKeyboard: false, + enableOnReadonly: true, + showOnFocus: true, + zIndexOffset: 10, + container: 'body', + immediateUpdates: false, + title: '', + templates: { + leftArrow: '«', + rightArrow: '»' + }, + showWeekDays: true + }; + var locale_opts = $.fn.datepicker.locale_opts = [ + 'format', + 'rtl', + 'weekStart' + ]; + $.fn.datepicker.Constructor = Datepicker; + var dates = $.fn.datepicker.dates = { + en: { + days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], + daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], + daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], + months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], + monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], + today: "Today", + clear: "Clear", + titleFormat: "MM yyyy" + } + }; + + var DPGlobal = { + viewModes: [ + { + names: ['days', 'month'], + clsName: 'days', + e: 'changeMonth' + }, + { + names: ['months', 'year'], + clsName: 'months', + e: 'changeYear', + navStep: 1 + }, + { + names: ['years', 'decade'], + clsName: 'years', + e: 'changeDecade', + navStep: 10 + }, + { + names: ['decades', 'century'], + clsName: 'decades', + e: 'changeCentury', + navStep: 100 + }, + { + names: ['centuries', 'millennium'], + clsName: 'centuries', + e: 'changeMillennium', + navStep: 1000 + } + ], + validParts: /dd?|DD?|mm?|MM?|yy(?:yy)?/g, + nonpunctuation: /[^ -\/:-@\u5e74\u6708\u65e5\[-`{-~\t\n\r]+/g, + parseFormat: function(format){ + if (typeof format.toValue === 'function' && typeof format.toDisplay === 'function') + return format; + // IE treats \0 as a string end in inputs (truncating the value), + // so it's a bad format delimiter, anyway + var separators = format.replace(this.validParts, '\0').split('\0'), + parts = format.match(this.validParts); + if (!separators || !separators.length || !parts || parts.length === 0){ + throw new Error("Invalid date format."); + } + return {separators: separators, parts: parts}; + }, + parseDate: function(date, format, language, assumeNearby){ + if (!date) + return undefined; + if (date instanceof Date) + return date; + if (typeof format === 'string') + format = DPGlobal.parseFormat(format); + if (format.toValue) + return format.toValue(date, format, language); + var fn_map = { + d: 'moveDay', + m: 'moveMonth', + w: 'moveWeek', + y: 'moveYear' + }, + dateAliases = { + yesterday: '-1d', + today: '+0d', + tomorrow: '+1d' + }, + parts, part, dir, i, fn; + if (date in dateAliases){ + date = dateAliases[date]; + } + if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/i.test(date)){ + parts = date.match(/([\-+]\d+)([dmwy])/gi); + date = new Date(); + for (i=0; i < parts.length; i++){ + part = parts[i].match(/([\-+]\d+)([dmwy])/i); + dir = Number(part[1]); + fn = fn_map[part[2].toLowerCase()]; + date = Datepicker.prototype[fn](date, dir); + } + return Datepicker.prototype._zero_utc_time(date); + } + + parts = date && date.match(this.nonpunctuation) || []; + + function applyNearbyYear(year, threshold){ + if (threshold === true) + threshold = 10; + + // if year is 2 digits or less, than the user most likely is trying to get a recent century + if (year < 100){ + year += 2000; + // if the new year is more than threshold years in advance, use last century + if (year > ((new Date()).getFullYear()+threshold)){ + year -= 100; + } + } + + return year; + } + + var parsed = {}, + setters_order = ['yyyy', 'yy', 'M', 'MM', 'm', 'mm', 'd', 'dd'], + setters_map = { + yyyy: function(d,v){ + return d.setUTCFullYear(assumeNearby ? applyNearbyYear(v, assumeNearby) : v); + }, + m: function(d,v){ + if (isNaN(d)) + return d; + v -= 1; + while (v < 0) v += 12; + v %= 12; + d.setUTCMonth(v); + while (d.getUTCMonth() !== v) + d.setUTCDate(d.getUTCDate()-1); + return d; + }, + d: function(d,v){ + return d.setUTCDate(v); + } + }, + val, filtered; + setters_map['yy'] = setters_map['yyyy']; + setters_map['M'] = setters_map['MM'] = setters_map['mm'] = setters_map['m']; + setters_map['dd'] = setters_map['d']; + date = UTCToday(); + var fparts = format.parts.slice(); + // Remove noop parts + if (parts.length !== fparts.length){ + fparts = $(fparts).filter(function(i,p){ + return $.inArray(p, setters_order) !== -1; + }).toArray(); + } + // Process remainder + function match_part(){ + var m = this.slice(0, parts[i].length), + p = parts[i].slice(0, m.length); + return m.toLowerCase() === p.toLowerCase(); + } + if (parts.length === fparts.length){ + var cnt; + for (i=0, cnt = fparts.length; i < cnt; i++){ + val = parseInt(parts[i], 10); + part = fparts[i]; + if (isNaN(val)){ + switch (part){ + case 'MM': + filtered = $(dates[language].months).filter(match_part); + val = $.inArray(filtered[0], dates[language].months) + 1; + break; + case 'M': + filtered = $(dates[language].monthsShort).filter(match_part); + val = $.inArray(filtered[0], dates[language].monthsShort) + 1; + break; + } + } + parsed[part] = val; + } + var _date, s; + for (i=0; i < setters_order.length; i++){ + s = setters_order[i]; + if (s in parsed && !isNaN(parsed[s])){ + _date = new Date(date); + setters_map[s](_date, parsed[s]); + if (!isNaN(_date)) + date = _date; + } + } + } + return date; + }, + formatDate: function(date, format, language){ + if (!date) + return ''; + if (typeof format === 'string') + format = DPGlobal.parseFormat(format); + if (format.toDisplay) + return format.toDisplay(date, format, language); + var val = { + d: date.getUTCDate(), + D: dates[language].daysShort[date.getUTCDay()], + DD: dates[language].days[date.getUTCDay()], + m: date.getUTCMonth() + 1, + M: dates[language].monthsShort[date.getUTCMonth()], + MM: dates[language].months[date.getUTCMonth()], + yy: date.getUTCFullYear().toString().substring(2), + yyyy: date.getUTCFullYear() + }; + val.dd = (val.d < 10 ? '0' : '') + val.d; + val.mm = (val.m < 10 ? '0' : '') + val.m; + date = []; + var seps = $.extend([], format.separators); + for (var i=0, cnt = format.parts.length; i <= cnt; i++){ + if (seps.length) + date.push(seps.shift()); + date.push(val[format.parts[i]]); + } + return date.join(''); + }, + headTemplate: ''+ + ''+ + ''+ + ''+ + ''+ + ''+defaults.templates.leftArrow+''+ + ''+ + ''+defaults.templates.rightArrow+''+ + ''+ + '', + contTemplate: '', + footTemplate: ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + '' + }; + DPGlobal.template = '
'+ + '
'+ + ''+ + DPGlobal.headTemplate+ + ''+ + DPGlobal.footTemplate+ + '
'+ + '
'+ + '
'+ + ''+ + DPGlobal.headTemplate+ + DPGlobal.contTemplate+ + DPGlobal.footTemplate+ + '
'+ + '
'+ + '
'+ + ''+ + DPGlobal.headTemplate+ + DPGlobal.contTemplate+ + DPGlobal.footTemplate+ + '
'+ + '
'+ + '
'+ + ''+ + DPGlobal.headTemplate+ + DPGlobal.contTemplate+ + DPGlobal.footTemplate+ + '
'+ + '
'+ + '
'+ + ''+ + DPGlobal.headTemplate+ + DPGlobal.contTemplate+ + DPGlobal.footTemplate+ + '
'+ + '
'+ + '
'; + + $.fn.datepicker.DPGlobal = DPGlobal; + + + /* DATEPICKER NO CONFLICT + * =================== */ + + $.fn.datepicker.noConflict = function(){ + $.fn.datepicker = old; + return this; + }; + + /* DATEPICKER VERSION + * =================== */ + $.fn.datepicker.version = '1.9.0'; + + $.fn.datepicker.deprecated = function(msg){ + var console = window.console; + if (console && console.warn) { + console.warn('DEPRECATED: ' + msg); + } + }; + + + /* DATEPICKER DATA-API + * ================== */ + + $(document).on( + 'focus.datepicker.data-api click.datepicker.data-api', + '[data-provide="datepicker"]', + function(e){ + var $this = $(this); + if ($this.data('datepicker')) + return; + e.preventDefault(); + // component click requires us to explicitly show it + datepickerPlugin.call($this, 'show'); + } + ); + $(function(){ + datepickerPlugin.call($('[data-provide="datepicker-inline"]')); + }); + +})); \ No newline at end of file diff --git a/app/assets/javascripts/bootstrap-notify.js b/app/assets/javascripts/bootstrap-notify.js new file mode 100755 index 000000000..bef308b5f --- /dev/null +++ b/app/assets/javascripts/bootstrap-notify.js @@ -0,0 +1,350 @@ +/* +* Project: Bootstrap Notify = v3.1.3 +* Description: Turns standard Bootstrap alerts into "Growl-like" notifications. +* Author: Mouse0270 aka Robert McIntosh +* License: MIT License +* Website: https://github.com/mouse0270/bootstrap-growl +*/ +(function (factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['jquery'], factory); + } else if (typeof exports === 'object') { + // Node/CommonJS + factory(require('jquery')); + } else { + // Browser globals + factory(jQuery); + } +}(function ($) { + // Create the defaults once + var defaults = { + element: 'body', + position: null, + type: "info", + allow_dismiss: true, + newest_on_top: false, + showProgressbar: false, + placement: { + from: "top", + align: "right" + }, + offset: 20, + spacing: 10, + z_index: 1031, + delay: 1000, + timer: 1000, + url_target: '_blank', + mouse_over: null, + animate: { + enter: 'animated fadeInDown', + exit: 'animated fadeOutUp' + }, + onShow: null, + onShown: null, + onClose: null, + onClosed: null, + icon_type: 'class', + template: '' + }; + + String.format = function() { + var str = arguments[0]; + for (var i = 1; i < arguments.length; i++) { + str = str.replace(RegExp("\\{" + (i - 1) + "\\}", "gm"), arguments[i]); + } + return str; + }; + + function Notify ( element, content, options ) { + // Setup Content of Notify + var content = { + content: { + message: typeof content == 'object' ? content.message : content, + title: content.title ? content.title : '', + icon: content.icon ? content.icon : '', + url: content.url ? content.url : '#', + target: content.target ? content.target : '-' + } + }; + + options = $.extend(true, {}, content, options); + this.settings = $.extend(true, {}, defaults, options); + this._defaults = defaults; + if (this.settings.content.target == "-") { + this.settings.content.target = this.settings.url_target; + } + this.animations = { + start: 'webkitAnimationStart oanimationstart MSAnimationStart animationstart', + end: 'webkitAnimationEnd oanimationend MSAnimationEnd animationend' + } + + if (typeof this.settings.offset == 'number') { + this.settings.offset = { + x: this.settings.offset, + y: this.settings.offset + }; + } + + this.init(); + }; + + $.extend(Notify.prototype, { + init: function () { + var self = this; + + this.buildNotify(); + if (this.settings.content.icon) { + this.setIcon(); + } + if (this.settings.content.url != "#") { + this.styleURL(); + } + this.placement(); + this.bind(); + + this.notify = { + $ele: this.$ele, + update: function(command, update) { + var commands = {}; + if (typeof command == "string") { + commands[command] = update; + }else{ + commands = command; + } + for (var command in commands) { + switch (command) { + case "type": + this.$ele.removeClass('alert-' + self.settings.type); + this.$ele.find('[data-notify="progressbar"] > .progress-bar').removeClass('progress-bar-' + self.settings.type); + self.settings.type = commands[command]; + this.$ele.addClass('alert-' + commands[command]).find('[data-notify="progressbar"] > .progress-bar').addClass('progress-bar-' + commands[command]); + break; + case "icon": + var $icon = this.$ele.find('[data-notify="icon"]'); + if (self.settings.icon_type.toLowerCase() == 'class') { + $icon.removeClass(self.settings.content.icon).addClass(commands[command]); + }else{ + if (!$icon.is('img')) { + $icon.find('img'); + } + $icon.attr('src', commands[command]); + } + break; + case "progress": + var newDelay = self.settings.delay - (self.settings.delay * (commands[command] / 100)); + this.$ele.data('notify-delay', newDelay); + this.$ele.find('[data-notify="progressbar"] > div').attr('aria-valuenow', commands[command]).css('width', commands[command] + '%'); + break; + case "url": + this.$ele.find('[data-notify="url"]').attr('href', commands[command]); + break; + case "target": + this.$ele.find('[data-notify="url"]').attr('target', commands[command]); + break; + default: + this.$ele.find('[data-notify="' + command +'"]').html(commands[command]); + }; + } + var posX = this.$ele.outerHeight() + parseInt(self.settings.spacing) + parseInt(self.settings.offset.y); + self.reposition(posX); + }, + close: function() { + self.close(); + } + }; + }, + buildNotify: function () { + var content = this.settings.content; + this.$ele = $(String.format(this.settings.template, this.settings.type, content.title, content.message, content.url, content.target)); + this.$ele.attr('data-notify-position', this.settings.placement.from + '-' + this.settings.placement.align); + if (!this.settings.allow_dismiss) { + this.$ele.find('[data-notify="dismiss"]').css('display', 'none'); + } + if ((this.settings.delay <= 0 && !this.settings.showProgressbar) || !this.settings.showProgressbar) { + this.$ele.find('[data-notify="progressbar"]').remove(); + } + }, + setIcon: function() { + if (this.settings.icon_type.toLowerCase() == 'class') { + this.$ele.find('[data-notify="icon"]').addClass(this.settings.content.icon); + }else{ + if (this.$ele.find('[data-notify="icon"]').is('img')) { + this.$ele.find('[data-notify="icon"]').attr('src', this.settings.content.icon); + }else{ + this.$ele.find('[data-notify="icon"]').append('Notify Icon'); + } + } + }, + styleURL: function() { + this.$ele.find('[data-notify="url"]').css({ + backgroundImage: 'url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)', + height: '100%', + left: '0px', + position: 'absolute', + top: '0px', + width: '100%', + zIndex: this.settings.z_index + 1 + }); + this.$ele.find('[data-notify="dismiss"]').css({ + position: 'absolute', + right: '10px', + top: '5px', + zIndex: this.settings.z_index + 2 + }); + }, + placement: function() { + var self = this, + offsetAmt = this.settings.offset.y, + css = { + display: 'inline-block', + margin: '0px auto', + position: this.settings.position ? this.settings.position : (this.settings.element === 'body' ? 'fixed' : 'absolute'), + transition: 'all .5s ease-in-out', + zIndex: this.settings.z_index + }, + hasAnimation = false, + settings = this.settings; + + $('[data-notify-position="' + this.settings.placement.from + '-' + this.settings.placement.align + '"]:not([data-closing="true"])').each(function() { + return offsetAmt = Math.max(offsetAmt, parseInt($(this).css(settings.placement.from)) + parseInt($(this).outerHeight()) + parseInt(settings.spacing)); + }); + if (this.settings.newest_on_top == true) { + offsetAmt = this.settings.offset.y; + } + css[this.settings.placement.from] = offsetAmt+'px'; + + switch (this.settings.placement.align) { + case "left": + case "right": + css[this.settings.placement.align] = this.settings.offset.x+'px'; + break; + case "center": + css.left = 0; + css.right = 0; + break; + } + this.$ele.css(css).addClass(this.settings.animate.enter); + $.each(Array('webkit', 'moz', 'o', 'ms', ''), function(index, prefix) { + self.$ele[0].style[prefix+'AnimationIterationCount'] = 1; + }); + + $(this.settings.element).append(this.$ele); + + if (this.settings.newest_on_top == true) { + offsetAmt = (parseInt(offsetAmt)+parseInt(this.settings.spacing)) + this.$ele.outerHeight(); + this.reposition(offsetAmt); + } + + if ($.isFunction(self.settings.onShow)) { + self.settings.onShow.call(this.$ele); + } + + this.$ele.one(this.animations.start, function(event) { + hasAnimation = true; + }).one(this.animations.end, function(event) { + if ($.isFunction(self.settings.onShown)) { + self.settings.onShown.call(this); + } + }); + + setTimeout(function() { + if (!hasAnimation) { + if ($.isFunction(self.settings.onShown)) { + self.settings.onShown.call(this); + } + } + }, 600); + }, + bind: function() { + var self = this; + + this.$ele.find('[data-notify="dismiss"]').on('click', function() { + self.close(); + }) + + this.$ele.mouseover(function(e) { + $(this).data('data-hover', "true"); + }).mouseout(function(e) { + $(this).data('data-hover', "false"); + }); + this.$ele.data('data-hover', "false"); + + if (this.settings.delay > 0) { + self.$ele.data('notify-delay', self.settings.delay); + var timer = setInterval(function() { + var delay = parseInt(self.$ele.data('notify-delay')) - self.settings.timer; + if ((self.$ele.data('data-hover') === 'false' && self.settings.mouse_over == "pause") || self.settings.mouse_over != "pause") { + var percent = ((self.settings.delay - delay) / self.settings.delay) * 100; + self.$ele.data('notify-delay', delay); + self.$ele.find('[data-notify="progressbar"] > div').attr('aria-valuenow', percent).css('width', percent + '%'); + } + if (delay <= -(self.settings.timer)) { + clearInterval(timer); + self.close(); + } + }, self.settings.timer); + } + }, + close: function() { + var self = this, + $successors = null, + posX = parseInt(this.$ele.css(this.settings.placement.from)), + hasAnimation = false; + + this.$ele.data('closing', 'true').addClass(this.settings.animate.exit); + self.reposition(posX); + + if ($.isFunction(self.settings.onClose)) { + self.settings.onClose.call(this.$ele); + } + + this.$ele.one(this.animations.start, function(event) { + hasAnimation = true; + }).one(this.animations.end, function(event) { + $(this).remove(); + if ($.isFunction(self.settings.onClosed)) { + self.settings.onClosed.call(this); + } + }); + + setTimeout(function() { + if (!hasAnimation) { + self.$ele.remove(); + if (self.settings.onClosed) { + self.settings.onClosed(self.$ele); + } + } + }, 600); + }, + reposition: function(posX) { + var self = this, + notifies = '[data-notify-position="' + this.settings.placement.from + '-' + this.settings.placement.align + '"]:not([data-closing="true"])', + $elements = this.$ele.nextAll(notifies); + if (this.settings.newest_on_top == true) { + $elements = this.$ele.prevAll(notifies); + } + $elements.each(function() { + $(this).css(self.settings.placement.from, posX); + posX = (parseInt(posX)+parseInt(self.settings.spacing)) + $(this).outerHeight(); + }); + } + }); + + $.notify = function ( content, options ) { + var plugin = new Notify( this, content, options ); + return plugin.notify; + }; + $.notifyDefaults = function( options ) { + defaults = $.extend(true, {}, defaults, options); + return defaults; + }; + $.notifyClose = function( command ) { + if (typeof command === "undefined" || command == "all") { + $('[data-notify]').find('[data-notify="dismiss"]').trigger('click'); + }else{ + $('[data-notify-position="'+command+'"]').find('[data-notify="dismiss"]').trigger('click'); + } + }; + +})); \ No newline at end of file diff --git a/app/assets/javascripts/bootstrap-notify.min.js b/app/assets/javascripts/bootstrap-notify.min.js new file mode 100755 index 000000000..f5ad385a0 --- /dev/null +++ b/app/assets/javascripts/bootstrap-notify.min.js @@ -0,0 +1,2 @@ +/* Project: Bootstrap Growl = v3.1.3 | Description: Turns standard Bootstrap alerts into "Growl-like" notifications. | Author: Mouse0270 aka Robert McIntosh | License: MIT License | Website: https://github.com/mouse0270/bootstrap-growl */ +!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t("object"==typeof exports?require("jquery"):jQuery)}(function(t){function e(e,i,n){var i={content:{message:"object"==typeof i?i.message:i,title:i.title?i.title:"",icon:i.icon?i.icon:"",url:i.url?i.url:"#",target:i.target?i.target:"-"}};n=t.extend(!0,{},i,n),this.settings=t.extend(!0,{},s,n),this._defaults=s,"-"==this.settings.content.target&&(this.settings.content.target=this.settings.url_target),this.animations={start:"webkitAnimationStart oanimationstart MSAnimationStart animationstart",end:"webkitAnimationEnd oanimationend MSAnimationEnd animationend"},"number"==typeof this.settings.offset&&(this.settings.offset={x:this.settings.offset,y:this.settings.offset}),this.init()}var s={element:"body",position:null,type:"info",allow_dismiss:!0,newest_on_top:!1,showProgressbar:!1,placement:{from:"top",align:"right"},offset:20,spacing:10,z_index:1031,delay:5e3,timer:1e3,url_target:"_blank",mouse_over:null,animate:{enter:"animated fadeInDown",exit:"animated fadeOutUp"},onShow:null,onShown:null,onClose:null,onClosed:null,icon_type:"class",template:''};String.format=function(){for(var t=arguments[0],e=1;e .progress-bar').removeClass("progress-bar-"+t.settings.type),t.settings.type=i[e],this.$ele.addClass("alert-"+i[e]).find('[data-notify="progressbar"] > .progress-bar').addClass("progress-bar-"+i[e]);break;case"icon":var n=this.$ele.find('[data-notify="icon"]');"class"==t.settings.icon_type.toLowerCase()?n.removeClass(t.settings.content.icon).addClass(i[e]):(n.is("img")||n.find("img"),n.attr("src",i[e]));break;case"progress":var a=t.settings.delay-t.settings.delay*(i[e]/100);this.$ele.data("notify-delay",a),this.$ele.find('[data-notify="progressbar"] > div').attr("aria-valuenow",i[e]).css("width",i[e]+"%");break;case"url":this.$ele.find('[data-notify="url"]').attr("href",i[e]);break;case"target":this.$ele.find('[data-notify="url"]').attr("target",i[e]);break;default:this.$ele.find('[data-notify="'+e+'"]').html(i[e])}var o=this.$ele.outerHeight()+parseInt(t.settings.spacing)+parseInt(t.settings.offset.y);t.reposition(o)},close:function(){t.close()}}},buildNotify:function(){var e=this.settings.content;this.$ele=t(String.format(this.settings.template,this.settings.type,e.title,e.message,e.url,e.target)),this.$ele.attr("data-notify-position",this.settings.placement.from+"-"+this.settings.placement.align),this.settings.allow_dismiss||this.$ele.find('[data-notify="dismiss"]').css("display","none"),(this.settings.delay<=0&&!this.settings.showProgressbar||!this.settings.showProgressbar)&&this.$ele.find('[data-notify="progressbar"]').remove()},setIcon:function(){"class"==this.settings.icon_type.toLowerCase()?this.$ele.find('[data-notify="icon"]').addClass(this.settings.content.icon):this.$ele.find('[data-notify="icon"]').is("img")?this.$ele.find('[data-notify="icon"]').attr("src",this.settings.content.icon):this.$ele.find('[data-notify="icon"]').append('Notify Icon')},styleURL:function(){this.$ele.find('[data-notify="url"]').css({backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)",height:"100%",left:"0px",position:"absolute",top:"0px",width:"100%",zIndex:this.settings.z_index+1}),this.$ele.find('[data-notify="dismiss"]').css({position:"absolute",right:"10px",top:"5px",zIndex:this.settings.z_index+2})},placement:function(){var e=this,s=this.settings.offset.y,i={display:"inline-block",margin:"0px auto",position:this.settings.position?this.settings.position:"body"===this.settings.element?"fixed":"absolute",transition:"all .5s ease-in-out",zIndex:this.settings.z_index},n=!1,a=this.settings;switch(t('[data-notify-position="'+this.settings.placement.from+"-"+this.settings.placement.align+'"]:not([data-closing="true"])').each(function(){return s=Math.max(s,parseInt(t(this).css(a.placement.from))+parseInt(t(this).outerHeight())+parseInt(a.spacing))}),1==this.settings.newest_on_top&&(s=this.settings.offset.y),i[this.settings.placement.from]=s+"px",this.settings.placement.align){case"left":case"right":i[this.settings.placement.align]=this.settings.offset.x+"px";break;case"center":i.left=0,i.right=0}this.$ele.css(i).addClass(this.settings.animate.enter),t.each(Array("webkit","moz","o","ms",""),function(t,s){e.$ele[0].style[s+"AnimationIterationCount"]=1}),t(this.settings.element).append(this.$ele),1==this.settings.newest_on_top&&(s=parseInt(s)+parseInt(this.settings.spacing)+this.$ele.outerHeight(),this.reposition(s)),t.isFunction(e.settings.onShow)&&e.settings.onShow.call(this.$ele),this.$ele.one(this.animations.start,function(){n=!0}).one(this.animations.end,function(){t.isFunction(e.settings.onShown)&&e.settings.onShown.call(this)}),setTimeout(function(){n||t.isFunction(e.settings.onShown)&&e.settings.onShown.call(this)},600)},bind:function(){var e=this;if(this.$ele.find('[data-notify="dismiss"]').on("click",function(){e.close()}),this.$ele.mouseover(function(){t(this).data("data-hover","true")}).mouseout(function(){t(this).data("data-hover","false")}),this.$ele.data("data-hover","false"),this.settings.delay>0){e.$ele.data("notify-delay",e.settings.delay);var s=setInterval(function(){var t=parseInt(e.$ele.data("notify-delay"))-e.settings.timer;if("false"===e.$ele.data("data-hover")&&"pause"==e.settings.mouse_over||"pause"!=e.settings.mouse_over){var i=(e.settings.delay-t)/e.settings.delay*100;e.$ele.data("notify-delay",t),e.$ele.find('[data-notify="progressbar"] > div').attr("aria-valuenow",i).css("width",i+"%")}t<=-e.settings.timer&&(clearInterval(s),e.close())},e.settings.timer)}},close:function(){var e=this,s=parseInt(this.$ele.css(this.settings.placement.from)),i=!1;this.$ele.data("closing","true").addClass(this.settings.animate.exit),e.reposition(s),t.isFunction(e.settings.onClose)&&e.settings.onClose.call(this.$ele),this.$ele.one(this.animations.start,function(){i=!0}).one(this.animations.end,function(){t(this).remove(),t.isFunction(e.settings.onClosed)&&e.settings.onClosed.call(this)}),setTimeout(function(){i||(e.$ele.remove(),e.settings.onClosed&&e.settings.onClosed(e.$ele))},600)},reposition:function(e){var s=this,i='[data-notify-position="'+this.settings.placement.from+"-"+this.settings.placement.align+'"]:not([data-closing="true"])',n=this.$ele.nextAll(i);1==this.settings.newest_on_top&&(n=this.$ele.prevAll(i)),n.each(function(){t(this).css(s.settings.placement.from,e),e=parseInt(e)+parseInt(s.settings.spacing)+t(this).outerHeight()})}}),t.notify=function(t,s){var i=new e(this,t,s);return i.notify},t.notifyDefaults=function(e){return s=t.extend(!0,{},s,e)},t.notifyClose=function(e){"undefined"==typeof e||"all"==e?t("[data-notify]").find('[data-notify="dismiss"]').trigger("click"):t('[data-notify-position="'+e+'"]').find('[data-notify="dismiss"]').trigger("click")}}); \ No newline at end of file diff --git a/app/assets/javascripts/bootstrap.viewer.js b/app/assets/javascripts/bootstrap.viewer.js new file mode 100755 index 000000000..4c6aa549a --- /dev/null +++ b/app/assets/javascripts/bootstrap.viewer.js @@ -0,0 +1,50 @@ +/* + * Copyright 2018-2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * WebSite: http://bootstrap-viewer.leftso.com + */ +$.fn.bootstrapViewer = function (options) { + $(this).on('click', function () { + var opts = $.extend({}, $.fn.bootstrapViewer.defaults, options); + var viewer = $(''); + $('body').append(viewer); + if ($(this).attr(opts.src)) { + $("#bootstrapViewer").find(".img-viewer").attr("src", $(this).attr(opts.src)); + $("#bootstrapViewer").modal(); + } else { + throw "图片不存在" + } + + }) + + $(this).on('mouseover', function () { + $(this).css('cursor', 'zoom-in'); + }) + +} +$.fn.bootstrapViewer.defaults = { + src: 'src' +} \ No newline at end of file diff --git a/app/assets/javascripts/i18n/bootstrap-datepicker.zh-CN.min.js b/app/assets/javascripts/i18n/bootstrap-datepicker.zh-CN.min.js new file mode 100644 index 000000000..8e6920b0c --- /dev/null +++ b/app/assets/javascripts/i18n/bootstrap-datepicker.zh-CN.min.js @@ -0,0 +1 @@ +!function(a){a.fn.datepicker.dates["zh-CN"]={days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],daysShort:["周日","周一","周二","周三","周四","周五","周六"],daysMin:["日","一","二","三","四","五","六"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],today:"今天",monthsTitle:"选择月份",clear:"清除",format:"yyyy-mm-dd",titleFormat:"yyyy年mm月",weekStart:1}}(jQuery); \ No newline at end of file diff --git a/app/assets/javascripts/i18n/jquery-validate-message-zh.js b/app/assets/javascripts/i18n/jquery-validate-message-zh.js new file mode 100644 index 000000000..715b5d55d --- /dev/null +++ b/app/assets/javascripts/i18n/jquery-validate-message-zh.js @@ -0,0 +1,33 @@ +(function( factory ) { + if ( typeof define === "function" && define.amd ) { + define( ["jquery", "../jquery.validate"], factory ); + } else { + factory( jQuery ); + } +}(function( $ ) { + + /* + * Translated default messages for the jQuery validation plugin. + * Locale: ZH (Chinese, 中文 (Zhōngwén), 汉语, 漢語) + */ + $.extend($.validator.messages, { + required: "这是必填字段", + remote: "请修正此字段", + email: "请输入有效的电子邮件地址", + url: "请输入有效的网址", + date: "请输入有效的日期", + dateISO: "请输入有效的日期 (YYYY-MM-DD)", + number: "请输入有效的数字", + digits: "只能输入数字", + creditcard: "请输入有效的信用卡号码", + equalTo: "你的输入不相同", + extension: "请输入有效的后缀", + maxlength: $.validator.format("最多可以输入 {0} 个字符"), + minlength: $.validator.format("最少要输入 {0} 个字符"), + rangelength: $.validator.format("请输入长度在 {0} 到 {1} 之间的字符串"), + range: $.validator.format("请输入范围在 {0} 到 {1} 之间的数值"), + max: $.validator.format("请输入不大于 {0} 的数值"), + min: $.validator.format("请输入不小于 {0} 的数值") + }); + +})); \ No newline at end of file diff --git a/app/assets/javascripts/i18n/select2-i18n.zh-CN.js b/app/assets/javascripts/i18n/select2-i18n.zh-CN.js new file mode 100755 index 000000000..061f6df21 --- /dev/null +++ b/app/assets/javascripts/i18n/select2-i18n.zh-CN.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/zh-CN",[],function(){return{errorLoading:function(){return"无法载入结果。"},inputTooLong:function(n){return"请删除"+(n.input.length-n.maximum)+"个字符"},inputTooShort:function(n){return"请再输入至少"+(n.minimum-n.input.length)+"个字符"},loadingMore:function(){return"载入更多结果…"},maximumSelected:function(n){return"最多只能选择"+n.maximum+"个项目"},noResults:function(){return"未找到结果"},searching:function(){return"搜索中…"},removeAllItems:function(){return"删除所有项目"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/app/assets/javascripts/jquery.cookie.min.js b/app/assets/javascripts/jquery.cookie.min.js new file mode 100644 index 000000000..c0f19d8a3 --- /dev/null +++ b/app/assets/javascripts/jquery.cookie.min.js @@ -0,0 +1,2 @@ +/*! jquery.cookie v1.4.1 | MIT */ +!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?a(require("jquery")):a(jQuery)}(function(a){function b(a){return h.raw?a:encodeURIComponent(a)}function c(a){return h.raw?a:decodeURIComponent(a)}function d(a){return b(h.json?JSON.stringify(a):String(a))}function e(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return a=decodeURIComponent(a.replace(g," ")),h.json?JSON.parse(a):a}catch(b){}}function f(b,c){var d=h.raw?b:e(b);return a.isFunction(c)?c(d):d}var g=/\+/g,h=a.cookie=function(e,g,i){if(void 0!==g&&!a.isFunction(g)){if(i=a.extend({},h.defaults,i),"number"==typeof i.expires){var j=i.expires,k=i.expires=new Date;k.setTime(+k+864e5*j)}return document.cookie=[b(e),"=",d(g),i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")}for(var l=e?void 0:{},m=document.cookie?document.cookie.split("; "):[],n=0,o=m.length;o>n;n++){var p=m[n].split("="),q=c(p.shift()),r=p.join("=");if(e&&e===q){l=f(r,g);break}e||void 0===(r=f(r))||(l[q]=r)}return l};h.defaults={},a.removeCookie=function(b,c){return void 0===a.cookie(b)?!1:(a.cookie(b,"",a.extend({},c,{expires:-1})),!a.cookie(b))}}); \ No newline at end of file diff --git a/app/assets/javascripts/jquery.cxselect.js b/app/assets/javascripts/jquery.cxselect.js new file mode 100755 index 000000000..9bd674664 --- /dev/null +++ b/app/assets/javascripts/jquery.cxselect.js @@ -0,0 +1,403 @@ +/*! + * jQuery cxSelect + * @name jquery.cxselect.js + * @version 1.4.1 + * @date 2016-11-02 + * @author ciaoca + * @email ciaoca@gmail.com + * @site https://github.com/ciaoca/cxSelect + * @license Released under the MIT license + */ +(function(factory) { + if (typeof define === 'function' && define.amd) { + define(['jquery'], factory); + } else { + factory(window.jQuery || window.Zepto || window.$); + }; +}(function($) { + var cxSelect = function() { + var self = this; + var dom, settings, callback; + + // 分配参数 + for (var i = 0, l = arguments.length; i < l; i++) { + if (cxSelect.isJquery(arguments[i]) || cxSelect.isZepto(arguments[i])) { + dom = arguments[i]; + } else if (cxSelect.isElement(arguments[i])) { + dom = $(arguments[i]); + } else if (typeof arguments[i] === 'function') { + callback = arguments[i]; + } else if (typeof arguments[i] === 'object') { + settings = arguments[i]; + }; + }; + + var api = new cxSelect.init(dom, settings); + + if (typeof callback === 'function') { + callback(api); + }; + + return api; + }; + + cxSelect.isElement = function(o){ + if (o && (typeof HTMLElement === 'function' || typeof HTMLElement === 'object') && o instanceof HTMLElement) { + return true; + } else { + return (o && o.nodeType && o.nodeType === 1) ? true : false; + }; + }; + + cxSelect.isJquery = function(o){ + return (o && o.length && (typeof jQuery === 'function' || typeof jQuery === 'object') && o instanceof jQuery) ? true : false; + }; + + cxSelect.isZepto = function(o){ + return (o && o.length && (typeof Zepto === 'function' || typeof Zepto === 'object') && Zepto.zepto.isZ(o)) ? true : false; + }; + + cxSelect.getIndex = function(n, required) { + return required ? n : n - 1; + }; + + cxSelect.getData = function(data, space) { + if (typeof space === 'string' && space.length) { + space = space.split('.'); + for (var i = 0, l = space.length; i < l; i++) { + data = data[space[i]]; + }; + }; + return data; + }; + + cxSelect.init = function(dom, settings) { + var self = this; + + if (!cxSelect.isJquery(dom) && !cxSelect.isZepto(dom)) {return}; + + var theSelect = { + dom: { + box: dom + } + }; + + self.attach = cxSelect.attach.bind(theSelect); + self.detach = cxSelect.detach.bind(theSelect); + self.setOptions = cxSelect.setOptions.bind(theSelect); + self.clear = cxSelect.clear.bind(theSelect); + + theSelect.changeEvent = function() { + cxSelect.selectChange.call(theSelect, this.className); + }; + + theSelect.settings = $.extend({}, $.cxSelect.defaults, settings, { + url: theSelect.dom.box.data('url'), + emptyStyle: theSelect.dom.box.data('emptyStyle'), + required: theSelect.dom.box.data('required'), + firstTitle: theSelect.dom.box.data('firstTitle'), + firstValue: theSelect.dom.box.data('firstValue'), + jsonSpace: theSelect.dom.box.data('jsonSpace'), + jsonName: theSelect.dom.box.data('jsonName'), + jsonValue: theSelect.dom.box.data('jsonValue'), + jsonSub: theSelect.dom.box.data('jsonSub') + }); + + var _dataSelects = theSelect.dom.box.data('selects'); + + if (typeof _dataSelects === 'string' && _dataSelects.length) { + theSelect.settings.selects = _dataSelects.split(','); + }; + + self.setOptions(); + self.attach(); + + // 使用独立接口获取数据 + if (!theSelect.settings.url && !theSelect.settings.data) { + cxSelect.start.apply(theSelect); + + // 设置自定义数据 + } else if ($.isArray(theSelect.settings.data)) { + cxSelect.start.call(theSelect, theSelect.settings.data); + + // 设置 URL,通过 Ajax 获取数据 + } else if (typeof theSelect.settings.url === 'string' && theSelect.settings.url.length) { + $.getJSON(theSelect.settings.url, function(json) { + cxSelect.start.call(theSelect, json); + }); + }; + }; + + // 设置参数 + cxSelect.setOptions = function(opts) { + var self = this; + + if (opts) { + $.extend(self.settings, opts); + }; + + // 初次或重设选择器组 + if (!$.isArray(self.selectArray) || !self.selectArray.length || (opts && opts.selects)) { + self.selectArray = []; + + if ($.isArray(self.settings.selects) && self.settings.selects.length) { + var _tempSelect; + + for (var i = 0, l = self.settings.selects.length; i < l; i++) { + _tempSelect = self.dom.box.find('select.' + self.settings.selects[i]); + + if (!_tempSelect || !_tempSelect.length) {break}; + + self.selectArray.push(_tempSelect); + }; + }; + }; + + if (opts) { + if (!$.isArray(opts.data) && typeof opts.url === 'string' && opts.url.length) { + $.getJSON(self.settings.url, function(json) { + cxSelect.start.call(self, json); + }); + + } else { + cxSelect.start.call(self, opts.data); + }; + }; + }; + + // 绑定 + cxSelect.attach = function() { + var self = this; + + if (!self.attachStatus) { + self.dom.box.on('change', 'select', self.changeEvent); + }; + + if (typeof self.attachStatus === 'boolean') { + cxSelect.start.call(self); + }; + + self.attachStatus = true; + }; + + // 移除绑定 + cxSelect.detach = function() { + var self = this; + self.dom.box.off('change', 'select', self.changeEvent); + self.attachStatus = false; + }; + + // 清空选项 + cxSelect.clear = function(index) { + var self = this; + var _style = { + display: '', + visibility: '' + }; + + index = isNaN(index) ? 0 : index; + + // 清空后面的 select + for (var i = index, l = self.selectArray.length; i < l; i++) { + self.selectArray[i].empty().prop('disabled', true); + + if (self.settings.emptyStyle === 'none') { + _style.display = 'none'; + } else if (self.settings.emptyStyle === 'hidden') { + _style.visibility = 'hidden'; + }; + + self.selectArray[i].css(_style); + }; + }; + + cxSelect.start = function(data) { + var self = this; + + if ($.isArray(data)) { + self.settings.data = cxSelect.getData(data, self.settings.jsonSpace); + }; + + if (!self.selectArray.length) {return}; + + // 保存默认值 + for (var i = 0, l = self.selectArray.length; i < l; i++) { + if (typeof self.selectArray[i].attr('data-value') !== 'string' && self.selectArray[i][0].options.length) { + self.selectArray[i].attr('data-value', self.selectArray[i].val()); + }; + }; + + if (self.settings.data || (typeof self.selectArray[0].data('url') === 'string' && self.selectArray[0].data('url').length)) { + cxSelect.getOptionData.call(self, 0); + } else { + self.selectArray[0].prop('disabled', false).css({ + 'display': '', + 'visibility': '' + }); + }; + }; + + // 获取选项数据 + cxSelect.getOptionData = function(index) { + var self = this; + + if (typeof index !== 'number' || isNaN(index) || index < 0 || index >= self.selectArray.length) {return}; + + var _indexPrev = index - 1; + var _select = self.selectArray[index]; + var _selectData; + var _valueIndex; + var _dataUrl = _select.data('url'); + var _jsonSpace = typeof _select.data('jsonSpace') === 'undefined' ? self.settings.jsonSpace : _select.data('jsonSpace'); + var _query = {}; + var _queryName; + var _selectName; + var _selectValue; + + cxSelect.clear.call(self, index); + + // 使用独立接口 + if (typeof _dataUrl === 'string' && _dataUrl.length) { + if (index > 0) { + for (var i = 0, j = 1; i < index; i++, j++) { + _queryName = self.selectArray[j].data('queryName'); + _selectName = self.selectArray[i].attr('name'); + _selectValue = self.selectArray[i].val(); + + if (typeof _queryName === 'string' && _queryName.length) { + _query[_queryName] = _selectValue; + } else if (typeof _selectName === 'string' && _selectName.length) { + _query[_selectName] = _selectValue; + }; + }; + }; + + $.getJSON(_dataUrl, _query, function(json) { + _selectData = cxSelect.getData(json, _jsonSpace); + + cxSelect.buildOption.call(self, index, _selectData); + }); + + // 使用整合数据 + } else if (self.settings.data && typeof self.settings.data === 'object') { + _selectData = self.settings.data; + + for (var i = 0; i < index; i++) { + _valueIndex = cxSelect.getIndex(self.selectArray[i][0].selectedIndex, typeof self.selectArray[i].data('required') === 'boolean' ? self.selectArray[i].data('required') : self.settings.required); + + if (typeof _selectData[_valueIndex] === 'object' && $.isArray(_selectData[_valueIndex][self.settings.jsonSub]) && _selectData[_valueIndex][self.settings.jsonSub].length) { + _selectData = _selectData[_valueIndex][self.settings.jsonSub]; + } else { + _selectData = null; + break; + }; + }; + + cxSelect.buildOption.call(self, index, _selectData); + }; + }; + + // 构建选项列表 + cxSelect.buildOption = function(index, data) { + var self = this; + + var _select = self.selectArray[index]; + var _required = typeof _select.data('required') === 'boolean' ? _select.data('required') : self.settings.required; + var _firstTitle = typeof _select.data('firstTitle') === 'undefined' ? self.settings.firstTitle : _select.data('firstTitle'); + var _firstValue = typeof _select.data('firstValue') === 'undefined' ? self.settings.firstValue : _select.data('firstValue'); + var _jsonName = typeof _select.data('jsonName') === 'undefined' ? self.settings.jsonName : _select.data('jsonName'); + var _jsonValue = typeof _select.data('jsonValue') === 'undefined' ? self.settings.jsonValue : _select.data('jsonValue'); + + if (!$.isArray(data)) {return}; + + var _html = !_required ? '' : ''; + + // 区分标题、值的数据 + if (typeof _jsonName === 'string' && _jsonName.length) { + // 无值字段时使用标题作为值 + if (typeof _jsonValue !== 'string' || !_jsonValue.length) { + _jsonValue = _jsonName; + }; + + for (var i = 0, l = data.length; i < l; i++) { + _html += ''; + }; + + // 数组即为值的数据 + } else { + for (var i = 0, l = data.length; i < l; i++) { + _html += ''; + }; + }; + + _select.html(_html).prop('disabled', false).css({ + 'display': '', + 'visibility': '' + }); + + // 初次加载设置默认值 + if (typeof _select.attr('data-value') === 'string') { + _select.val(String(_select.attr('data-value'))).removeAttr('data-value'); + + if (_select[0].selectedIndex < 0) { + _select[0].options[0].selected = true; + }; + }; + + if (_required || _select[0].selectedIndex > 0) { + _select.trigger('change'); + }; + + }; + + // 改变选择时的处理 + cxSelect.selectChange = function(name) { + var self = this; + + if (typeof name !== 'string' || !name.length) {return}; + + var index; + + name = name.replace(/\s+/g, ','); + name = ',' + name + ','; + + // 获取当前 select 位置 + for (var i = 0, l = self.selectArray.length; i < l; i++) { + if (name.indexOf(',' + self.settings.selects[i] + ',') > -1) { + index = i; + break; + }; + }; + + if (typeof index === 'number' && index > -1) { + index += 1; + cxSelect.getOptionData.call(self, index); + }; + }; + + $.cxSelect = function() { + return cxSelect.apply(this, arguments); + }; + + // 默认值 + $.cxSelect.defaults = { + selects: [], // 下拉选框组 + url: null, // 列表数据文件路径(URL)或数组数据 + data: null, // 自定义数据 + emptyStyle: null, // 无数据状态显示方式 + required: false, // 是否为必选 + firstTitle: '请选择', // 第一个选项的标题 + firstValue: '', // 第一个选项的值 + jsonSpace: '', // 数据命名空间 + jsonName: 'n', // 数据标题字段名称 + jsonValue: '', // 数据值字段名称 + jsonSub: 's' // 子集数据字段名称 + }; + + $.fn.cxSelect = function(settings, callback) { + this.each(function(i) { + $.cxSelect(this, settings, callback); + }); + return this; + }; +})); diff --git a/app/assets/javascripts/jquery.cxselect.min.js b/app/assets/javascripts/jquery.cxselect.min.js new file mode 100755 index 000000000..54549a920 --- /dev/null +++ b/app/assets/javascripts/jquery.cxselect.min.js @@ -0,0 +1,11 @@ +/*! + * jQuery cxSelect + * @name jquery.cxselect.js + * @version 1.4.1 + * @date 2016-11-02 + * @author ciaoca + * @email ciaoca@gmail.com + * @site https://github.com/ciaoca/cxSelect + * @license Released under the MIT license + */ +!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(window.jQuery||window.Zepto||window.$)}(function(a){var b=function(){var d,e,f,g,h,i;for(g=0,h=arguments.length;h>g;g++)b.isJquery(arguments[g])||b.isZepto(arguments[g])?d=arguments[g]:b.isElement(arguments[g])?d=a(arguments[g]):"function"==typeof arguments[g]?f=arguments[g]:"object"==typeof arguments[g]&&(e=arguments[g]);return i=new b.init(d,e),"function"==typeof f&&f(i),i};b.isElement=function(a){return a&&("function"==typeof HTMLElement||"object"==typeof HTMLElement)&&a instanceof HTMLElement?!0:a&&a.nodeType&&1===a.nodeType?!0:!1},b.isJquery=function(a){return a&&a.length&&("function"==typeof jQuery||"object"==typeof jQuery)&&a instanceof jQuery?!0:!1},b.isZepto=function(a){return a&&a.length&&("function"==typeof Zepto||"object"==typeof Zepto)&&Zepto.zepto.isZ(a)?!0:!1},b.getIndex=function(a,b){return b?a:a-1},b.getData=function(a,b){if("string"==typeof b&&b.length){b=b.split(".");for(var c=0,d=b.length;d>c;c++)a=a[b[c]]}return a},b.init=function(c,d){var f,g,e=this;(b.isJquery(c)||b.isZepto(c))&&(f={dom:{box:c}},e.attach=b.attach.bind(f),e.detach=b.detach.bind(f),e.setOptions=b.setOptions.bind(f),e.clear=b.clear.bind(f),f.changeEvent=function(){b.selectChange.call(f,this.className)},f.settings=a.extend({},a.cxSelect.defaults,d,{url:f.dom.box.data("url"),emptyStyle:f.dom.box.data("emptyStyle"),required:f.dom.box.data("required"),firstTitle:f.dom.box.data("firstTitle"),firstValue:f.dom.box.data("firstValue"),jsonSpace:f.dom.box.data("jsonSpace"),jsonName:f.dom.box.data("jsonName"),jsonValue:f.dom.box.data("jsonValue"),jsonSub:f.dom.box.data("jsonSub")}),g=f.dom.box.data("selects"),"string"==typeof g&&g.length&&(f.settings.selects=g.split(",")),e.setOptions(),e.attach(),f.settings.url||f.settings.data?a.isArray(f.settings.data)?b.start.call(f,f.settings.data):"string"==typeof f.settings.url&&f.settings.url.length&&a.getJSON(f.settings.url,function(a){b.start.call(f,a)}):b.start.apply(f))},b.setOptions=function(c){var e,f,g,d=this;if(c&&a.extend(d.settings,c),(!a.isArray(d.selectArray)||!d.selectArray.length||c&&c.selects)&&(d.selectArray=[],a.isArray(d.settings.selects)&&d.settings.selects.length))for(f=0,g=d.settings.selects.length;g>f&&(e=d.dom.box.find("select."+d.settings.selects[f]),e&&e.length);f++)d.selectArray.push(e);c&&(!a.isArray(c.data)&&"string"==typeof c.url&&c.url.length?a.getJSON(d.settings.url,function(a){b.start.call(d,a)}):b.start.call(d,c.data))},b.attach=function(){var a=this;a.attachStatus||a.dom.box.on("change","select",a.changeEvent),"boolean"==typeof a.attachStatus&&b.start.call(a),a.attachStatus=!0},b.detach=function(){var a=this;a.dom.box.off("change","select",a.changeEvent),a.attachStatus=!1},b.clear=function(a){var d,e,b=this,c={display:"",visibility:""};for(a=isNaN(a)?0:a,d=a,e=b.selectArray.length;e>d;d++)b.selectArray[d].empty().prop("disabled",!0),"none"===b.settings.emptyStyle?c.display="none":"hidden"===b.settings.emptyStyle&&(c.visibility="hidden"),b.selectArray[d].css(c)},b.start=function(c){var e,f,d=this;if(a.isArray(c)&&(d.settings.data=b.getData(c,d.settings.jsonSpace)),d.selectArray.length){for(e=0,f=d.selectArray.length;f>e;e++)"string"!=typeof d.selectArray[e].attr("data-value")&&d.selectArray[e][0].options.length&&d.selectArray[e].attr("data-value",d.selectArray[e].val());d.settings.data||"string"==typeof d.selectArray[0].data("url")&&d.selectArray[0].data("url").length?b.getOptionData.call(d,0):d.selectArray[0].prop("disabled",!1).css({display:"",visibility:""})}},b.getOptionData=function(c){var f,g,h,i,j,k,l,m,n,o,p,d=this;if(!("number"!=typeof c||isNaN(c)||0>c||c>=d.selectArray.length))if(f=d.selectArray[c],i=f.data("url"),j="undefined"==typeof f.data("jsonSpace")?d.settings.jsonSpace:f.data("jsonSpace"),k={},b.clear.call(d,c),"string"==typeof i&&i.length){if(c>0)for(o=0,p=1;c>o;o++,p++)l=d.selectArray[p].data("queryName"),m=d.selectArray[o].attr("name"),n=d.selectArray[o].val(),"string"==typeof l&&l.length?k[l]=n:"string"==typeof m&&m.length&&(k[m]=n);a.getJSON(i,k,function(a){g=b.getData(a,j),b.buildOption.call(d,c,g)})}else if(d.settings.data&&"object"==typeof d.settings.data){for(g=d.settings.data,o=0;c>o;o++){if(h=b.getIndex(d.selectArray[o][0].selectedIndex,"boolean"==typeof d.selectArray[o].data("required")?d.selectArray[o].data("required"):d.settings.required),"object"!=typeof g[h]||!a.isArray(g[h][d.settings.jsonSub])||!g[h][d.settings.jsonSub].length){g=null;break}g=g[h][d.settings.jsonSub]}b.buildOption.call(d,c,g)}},b.buildOption=function(b,c){var k,l,m,d=this,e=d.selectArray[b],f="boolean"==typeof e.data("required")?e.data("required"):d.settings.required,g="undefined"==typeof e.data("firstTitle")?d.settings.firstTitle:e.data("firstTitle"),h="undefined"==typeof e.data("firstValue")?d.settings.firstValue:e.data("firstValue"),i="undefined"==typeof e.data("jsonName")?d.settings.jsonName:e.data("jsonName"),j="undefined"==typeof e.data("jsonValue")?d.settings.jsonValue:e.data("jsonValue");if(a.isArray(c)){if(k=f?"":'","string"==typeof i&&i.length)for("string"==typeof j&&j.length||(j=i),l=0,m=c.length;m>l;l++)k+='";else for(l=0,m=c.length;m>l;l++)k+='";e.html(k).prop("disabled",!1).css({display:"",visibility:""}),"string"==typeof e.attr("data-value")&&(e.val(String(e.attr("data-value"))).removeAttr("data-value"),e[0].selectedIndex<0&&(e[0].options[0].selected=!0)),(f||e[0].selectedIndex>0)&&e.trigger("change")}},b.selectChange=function(a){var d,e,f,c=this;if("string"==typeof a&&a.length){for(a=a.replace(/\s+/g,","),a=","+a+",",e=0,f=c.selectArray.length;f>e;e++)if(a.indexOf(","+c.settings.selects[e]+",")>-1){d=e;break}"number"==typeof d&&d>-1&&(d+=1,b.getOptionData.call(c,d))}},a.cxSelect=function(){return b.apply(this,arguments)},a.cxSelect.defaults={selects:[],url:null,data:null,emptyStyle:null,required:!1,firstTitle:"请选择",firstValue:"",jsonSpace:"",jsonName:"n",jsonValue:"",jsonSub:"s"},a.fn.cxSelect=function(b,c){return this.each(function(){a.cxSelect(this,b,c)}),this}}); \ No newline at end of file diff --git a/app/assets/javascripts/jquery.validate.js b/app/assets/javascripts/jquery.validate.js new file mode 100644 index 000000000..70297bd5c --- /dev/null +++ b/app/assets/javascripts/jquery.validate.js @@ -0,0 +1,1650 @@ +/*! + * jQuery Validation Plugin v1.19.1 + * + * https://jqueryvalidation.org/ + * + * Copyright (c) 2019 Jörn Zaefferer + * Released under the MIT license + */ +(function( factory ) { + if ( typeof define === "function" && define.amd ) { + define( ["jquery"], factory ); + } else if (typeof module === "object" && module.exports) { + module.exports = factory( require( "jquery" ) ); + } else { + factory( jQuery ); + } +}(function( $ ) { + +$.extend( $.fn, { + + // https://jqueryvalidation.org/validate/ + validate: function( options ) { + + // If nothing is selected, return nothing; can't chain anyway + if ( !this.length ) { + if ( options && options.debug && window.console ) { + console.warn( "Nothing selected, can't validate, returning nothing." ); + } + return; + } + + // Check if a validator for this form was already created + var validator = $.data( this[ 0 ], "validator" ); + if ( validator ) { + return validator; + } + + // Add novalidate tag if HTML5. + this.attr( "novalidate", "novalidate" ); + + validator = new $.validator( options, this[ 0 ] ); + $.data( this[ 0 ], "validator", validator ); + + if ( validator.settings.onsubmit ) { + + this.on( "click.validate", ":submit", function( event ) { + + // Track the used submit button to properly handle scripted + // submits later. + validator.submitButton = event.currentTarget; + + // Allow suppressing validation by adding a cancel class to the submit button + if ( $( this ).hasClass( "cancel" ) ) { + validator.cancelSubmit = true; + } + + // Allow suppressing validation by adding the html5 formnovalidate attribute to the submit button + if ( $( this ).attr( "formnovalidate" ) !== undefined ) { + validator.cancelSubmit = true; + } + } ); + + // Validate the form on submit + this.on( "submit.validate", function( event ) { + if ( validator.settings.debug ) { + + // Prevent form submit to be able to see console output + event.preventDefault(); + } + + function handle() { + var hidden, result; + + // Insert a hidden input as a replacement for the missing submit button + // The hidden input is inserted in two cases: + // - A user defined a `submitHandler` + // - There was a pending request due to `remote` method and `stopRequest()` + // was called to submit the form in case it's valid + if ( validator.submitButton && ( validator.settings.submitHandler || validator.formSubmitted ) ) { + hidden = $( "" ) + .attr( "name", validator.submitButton.name ) + .val( $( validator.submitButton ).val() ) + .appendTo( validator.currentForm ); + } + + if ( validator.settings.submitHandler && !validator.settings.debug ) { + result = validator.settings.submitHandler.call( validator, validator.currentForm, event ); + if ( hidden ) { + + // And clean up afterwards; thanks to no-block-scope, hidden can be referenced + hidden.remove(); + } + if ( result !== undefined ) { + return result; + } + return false; + } + return true; + } + + // Prevent submit for invalid forms or custom submit handlers + if ( validator.cancelSubmit ) { + validator.cancelSubmit = false; + return handle(); + } + if ( validator.form() ) { + if ( validator.pendingRequest ) { + validator.formSubmitted = true; + return false; + } + return handle(); + } else { + validator.focusInvalid(); + return false; + } + } ); + } + + return validator; + }, + + // https://jqueryvalidation.org/valid/ + valid: function() { + var valid, validator, errorList; + + if ( $( this[ 0 ] ).is( "form" ) ) { + valid = this.validate().form(); + } else { + errorList = []; + valid = true; + validator = $( this[ 0 ].form ).validate(); + this.each( function() { + valid = validator.element( this ) && valid; + if ( !valid ) { + errorList = errorList.concat( validator.errorList ); + } + } ); + validator.errorList = errorList; + } + return valid; + }, + + // https://jqueryvalidation.org/rules/ + rules: function( command, argument ) { + var element = this[ 0 ], + isContentEditable = typeof this.attr( "contenteditable" ) !== "undefined" && this.attr( "contenteditable" ) !== "false", + settings, staticRules, existingRules, data, param, filtered; + + // If nothing is selected, return empty object; can't chain anyway + if ( element == null ) { + return; + } + + if ( !element.form && isContentEditable ) { + element.form = this.closest( "form" )[ 0 ]; + element.name = this.attr( "name" ); + } + + if ( element.form == null ) { + return; + } + + if ( command ) { + settings = $.data( element.form, "validator" ).settings; + staticRules = settings.rules; + existingRules = $.validator.staticRules( element ); + switch ( command ) { + case "add": + $.extend( existingRules, $.validator.normalizeRule( argument ) ); + + // Remove messages from rules, but allow them to be set separately + delete existingRules.messages; + staticRules[ element.name ] = existingRules; + if ( argument.messages ) { + settings.messages[ element.name ] = $.extend( settings.messages[ element.name ], argument.messages ); + } + break; + case "remove": + if ( !argument ) { + delete staticRules[ element.name ]; + return existingRules; + } + filtered = {}; + $.each( argument.split( /\s/ ), function( index, method ) { + filtered[ method ] = existingRules[ method ]; + delete existingRules[ method ]; + } ); + return filtered; + } + } + + data = $.validator.normalizeRules( + $.extend( + {}, + $.validator.classRules( element ), + $.validator.attributeRules( element ), + $.validator.dataRules( element ), + $.validator.staticRules( element ) + ), element ); + + // Make sure required is at front + if ( data.required ) { + param = data.required; + delete data.required; + data = $.extend( { required: param }, data ); + } + + // Make sure remote is at back + if ( data.remote ) { + param = data.remote; + delete data.remote; + data = $.extend( data, { remote: param } ); + } + + return data; + } +} ); + +// Custom selectors +$.extend( $.expr.pseudos || $.expr[ ":" ], { // '|| $.expr[ ":" ]' here enables backwards compatibility to jQuery 1.7. Can be removed when dropping jQ 1.7.x support + + // https://jqueryvalidation.org/blank-selector/ + blank: function( a ) { + return !$.trim( "" + $( a ).val() ); + }, + + // https://jqueryvalidation.org/filled-selector/ + filled: function( a ) { + var val = $( a ).val(); + return val !== null && !!$.trim( "" + val ); + }, + + // https://jqueryvalidation.org/unchecked-selector/ + unchecked: function( a ) { + return !$( a ).prop( "checked" ); + } +} ); + +// Constructor for validator +$.validator = function( options, form ) { + this.settings = $.extend( true, {}, $.validator.defaults, options ); + this.currentForm = form; + this.init(); +}; + +// https://jqueryvalidation.org/jQuery.validator.format/ +$.validator.format = function( source, params ) { + if ( arguments.length === 1 ) { + return function() { + var args = $.makeArray( arguments ); + args.unshift( source ); + return $.validator.format.apply( this, args ); + }; + } + if ( params === undefined ) { + return source; + } + if ( arguments.length > 2 && params.constructor !== Array ) { + params = $.makeArray( arguments ).slice( 1 ); + } + if ( params.constructor !== Array ) { + params = [ params ]; + } + $.each( params, function( i, n ) { + source = source.replace( new RegExp( "\\{" + i + "\\}", "g" ), function() { + return n; + } ); + } ); + return source; +}; + +$.extend( $.validator, { + + defaults: { + messages: {}, + groups: {}, + rules: {}, + errorClass: "error", + pendingClass: "pending", + validClass: "valid", + errorElement: "label", + focusCleanup: false, + focusInvalid: true, + errorContainer: $( [] ), + errorLabelContainer: $( [] ), + onsubmit: true, + ignore: ":hidden", + ignoreTitle: false, + onfocusin: function( element ) { + this.lastActive = element; + + // Hide error label and remove error class on focus if enabled + if ( this.settings.focusCleanup ) { + if ( this.settings.unhighlight ) { + this.settings.unhighlight.call( this, element, this.settings.errorClass, this.settings.validClass ); + } + this.hideThese( this.errorsFor( element ) ); + } + }, + onfocusout: function( element ) { + if ( !this.checkable( element ) && ( element.name in this.submitted || !this.optional( element ) ) ) { + this.element( element ); + } + }, + onkeyup: function( element, event ) { + + // Avoid revalidate the field when pressing one of the following keys + // Shift => 16 + // Ctrl => 17 + // Alt => 18 + // Caps lock => 20 + // End => 35 + // Home => 36 + // Left arrow => 37 + // Up arrow => 38 + // Right arrow => 39 + // Down arrow => 40 + // Insert => 45 + // Num lock => 144 + // AltGr key => 225 + var excludedKeys = [ + 16, 17, 18, 20, 35, 36, 37, + 38, 39, 40, 45, 144, 225 + ]; + + if ( event.which === 9 && this.elementValue( element ) === "" || $.inArray( event.keyCode, excludedKeys ) !== -1 ) { + return; + } else if ( element.name in this.submitted || element.name in this.invalid ) { + this.element( element ); + } + }, + onclick: function( element ) { + + // Click on selects, radiobuttons and checkboxes + if ( element.name in this.submitted ) { + this.element( element ); + + // Or option elements, check parent select in that case + } else if ( element.parentNode.name in this.submitted ) { + this.element( element.parentNode ); + } + }, + highlight: function( element, errorClass, validClass ) { + if ( element.type === "radio" ) { + this.findByName( element.name ).addClass( errorClass ).removeClass( validClass ); + } else { + $( element ).addClass( errorClass ).removeClass( validClass ); + } + }, + unhighlight: function( element, errorClass, validClass ) { + if ( element.type === "radio" ) { + this.findByName( element.name ).removeClass( errorClass ).addClass( validClass ); + } else { + $( element ).removeClass( errorClass ).addClass( validClass ); + } + } + }, + + // https://jqueryvalidation.org/jQuery.validator.setDefaults/ + setDefaults: function( settings ) { + $.extend( $.validator.defaults, settings ); + }, + + messages: { + required: "This field is required.", + remote: "Please fix this field.", + email: "Please enter a valid email address.", + url: "Please enter a valid URL.", + date: "Please enter a valid date.", + dateISO: "Please enter a valid date (ISO).", + number: "Please enter a valid number.", + digits: "Please enter only digits.", + equalTo: "Please enter the same value again.", + maxlength: $.validator.format( "Please enter no more than {0} characters." ), + minlength: $.validator.format( "Please enter at least {0} characters." ), + rangelength: $.validator.format( "Please enter a value between {0} and {1} characters long." ), + range: $.validator.format( "Please enter a value between {0} and {1}." ), + max: $.validator.format( "Please enter a value less than or equal to {0}." ), + min: $.validator.format( "Please enter a value greater than or equal to {0}." ), + step: $.validator.format( "Please enter a multiple of {0}." ) + }, + + autoCreateRanges: false, + + prototype: { + + init: function() { + this.labelContainer = $( this.settings.errorLabelContainer ); + this.errorContext = this.labelContainer.length && this.labelContainer || $( this.currentForm ); + this.containers = $( this.settings.errorContainer ).add( this.settings.errorLabelContainer ); + this.submitted = {}; + this.valueCache = {}; + this.pendingRequest = 0; + this.pending = {}; + this.invalid = {}; + this.reset(); + + var currentForm = this.currentForm, + groups = ( this.groups = {} ), + rules; + $.each( this.settings.groups, function( key, value ) { + if ( typeof value === "string" ) { + value = value.split( /\s/ ); + } + $.each( value, function( index, name ) { + groups[ name ] = key; + } ); + } ); + rules = this.settings.rules; + $.each( rules, function( key, value ) { + rules[ key ] = $.validator.normalizeRule( value ); + } ); + + function delegate( event ) { + var isContentEditable = typeof $( this ).attr( "contenteditable" ) !== "undefined" && $( this ).attr( "contenteditable" ) !== "false"; + + // Set form expando on contenteditable + if ( !this.form && isContentEditable ) { + this.form = $( this ).closest( "form" )[ 0 ]; + this.name = $( this ).attr( "name" ); + } + + // Ignore the element if it belongs to another form. This will happen mainly + // when setting the `form` attribute of an input to the id of another form. + if ( currentForm !== this.form ) { + return; + } + + var validator = $.data( this.form, "validator" ), + eventType = "on" + event.type.replace( /^validate/, "" ), + settings = validator.settings; + if ( settings[ eventType ] && !$( this ).is( settings.ignore ) ) { + settings[ eventType ].call( validator, this, event ); + } + } + + $( this.currentForm ) + .on( "focusin.validate focusout.validate keyup.validate", + ":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], " + + "[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], " + + "[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], " + + "[type='radio'], [type='checkbox'], [contenteditable], [type='button']", delegate ) + + // Support: Chrome, oldIE + // "select" is provided as event.target when clicking a option + .on( "click.validate", "select, option, [type='radio'], [type='checkbox']", delegate ); + + if ( this.settings.invalidHandler ) { + $( this.currentForm ).on( "invalid-form.validate", this.settings.invalidHandler ); + } + }, + + // https://jqueryvalidation.org/Validator.form/ + form: function() { + this.checkForm(); + $.extend( this.submitted, this.errorMap ); + this.invalid = $.extend( {}, this.errorMap ); + if ( !this.valid() ) { + $( this.currentForm ).triggerHandler( "invalid-form", [ this ] ); + } + this.showErrors(); + return this.valid(); + }, + + checkForm: function() { + this.prepareForm(); + for ( var i = 0, elements = ( this.currentElements = this.elements() ); elements[ i ]; i++ ) { + this.check( elements[ i ] ); + } + return this.valid(); + }, + + // https://jqueryvalidation.org/Validator.element/ + element: function( element ) { + var cleanElement = this.clean( element ), + checkElement = this.validationTargetFor( cleanElement ), + v = this, + result = true, + rs, group; + + if ( checkElement === undefined ) { + delete this.invalid[ cleanElement.name ]; + } else { + this.prepareElement( checkElement ); + this.currentElements = $( checkElement ); + + // If this element is grouped, then validate all group elements already + // containing a value + group = this.groups[ checkElement.name ]; + if ( group ) { + $.each( this.groups, function( name, testgroup ) { + if ( testgroup === group && name !== checkElement.name ) { + cleanElement = v.validationTargetFor( v.clean( v.findByName( name ) ) ); + if ( cleanElement && cleanElement.name in v.invalid ) { + v.currentElements.push( cleanElement ); + result = v.check( cleanElement ) && result; + } + } + } ); + } + + rs = this.check( checkElement ) !== false; + result = result && rs; + if ( rs ) { + this.invalid[ checkElement.name ] = false; + } else { + this.invalid[ checkElement.name ] = true; + } + + if ( !this.numberOfInvalids() ) { + + // Hide error containers on last error + this.toHide = this.toHide.add( this.containers ); + } + this.showErrors(); + + // Add aria-invalid status for screen readers + $( element ).attr( "aria-invalid", !rs ); + } + + return result; + }, + + // https://jqueryvalidation.org/Validator.showErrors/ + showErrors: function( errors ) { + if ( errors ) { + var validator = this; + + // Add items to error list and map + $.extend( this.errorMap, errors ); + this.errorList = $.map( this.errorMap, function( message, name ) { + return { + message: message, + element: validator.findByName( name )[ 0 ] + }; + } ); + + // Remove items from success list + this.successList = $.grep( this.successList, function( element ) { + return !( element.name in errors ); + } ); + } + if ( this.settings.showErrors ) { + this.settings.showErrors.call( this, this.errorMap, this.errorList ); + } else { + this.defaultShowErrors(); + } + }, + + // https://jqueryvalidation.org/Validator.resetForm/ + resetForm: function() { + if ( $.fn.resetForm ) { + $( this.currentForm ).resetForm(); + } + this.invalid = {}; + this.submitted = {}; + this.prepareForm(); + this.hideErrors(); + var elements = this.elements() + .removeData( "previousValue" ) + .removeAttr( "aria-invalid" ); + + this.resetElements( elements ); + }, + + resetElements: function( elements ) { + var i; + + if ( this.settings.unhighlight ) { + for ( i = 0; elements[ i ]; i++ ) { + this.settings.unhighlight.call( this, elements[ i ], + this.settings.errorClass, "" ); + this.findByName( elements[ i ].name ).removeClass( this.settings.validClass ); + } + } else { + elements + .removeClass( this.settings.errorClass ) + .removeClass( this.settings.validClass ); + } + }, + + numberOfInvalids: function() { + return this.objectLength( this.invalid ); + }, + + objectLength: function( obj ) { + /* jshint unused: false */ + var count = 0, + i; + for ( i in obj ) { + + // This check allows counting elements with empty error + // message as invalid elements + if ( obj[ i ] !== undefined && obj[ i ] !== null && obj[ i ] !== false ) { + count++; + } + } + return count; + }, + + hideErrors: function() { + this.hideThese( this.toHide ); + }, + + hideThese: function( errors ) { + errors.not( this.containers ).text( "" ); + this.addWrapper( errors ).hide(); + }, + + valid: function() { + return this.size() === 0; + }, + + size: function() { + return this.errorList.length; + }, + + focusInvalid: function() { + if ( this.settings.focusInvalid ) { + try { + $( this.findLastActive() || this.errorList.length && this.errorList[ 0 ].element || [] ) + .filter( ":visible" ) + .trigger( "focus" ) + + // Manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find + .trigger( "focusin" ); + } catch ( e ) { + + // Ignore IE throwing errors when focusing hidden elements + } + } + }, + + findLastActive: function() { + var lastActive = this.lastActive; + return lastActive && $.grep( this.errorList, function( n ) { + return n.element.name === lastActive.name; + } ).length === 1 && lastActive; + }, + + elements: function() { + var validator = this, + rulesCache = {}; + + // Select all valid inputs inside the form (no submit or reset buttons) + return $( this.currentForm ) + .find( "input, select, textarea, [contenteditable]" ) + .not( ":submit, :reset, :image, :disabled" ) + .not( this.settings.ignore ) + .filter( function() { + var name = this.name || $( this ).attr( "name" ); // For contenteditable + var isContentEditable = typeof $( this ).attr( "contenteditable" ) !== "undefined" && $( this ).attr( "contenteditable" ) !== "false"; + + if ( !name && validator.settings.debug && window.console ) { + console.error( "%o has no name assigned", this ); + } + + // Set form expando on contenteditable + if ( isContentEditable ) { + this.form = $( this ).closest( "form" )[ 0 ]; + this.name = name; + } + + // Ignore elements that belong to other/nested forms + if ( this.form !== validator.currentForm ) { + return false; + } + + // Select only the first element for each name, and only those with rules specified + if ( name in rulesCache || !validator.objectLength( $( this ).rules() ) ) { + return false; + } + + rulesCache[ name ] = true; + return true; + } ); + }, + + clean: function( selector ) { + return $( selector )[ 0 ]; + }, + + errors: function() { + var errorClass = this.settings.errorClass.split( " " ).join( "." ); + return $( this.settings.errorElement + "." + errorClass, this.errorContext ); + }, + + resetInternals: function() { + this.successList = []; + this.errorList = []; + this.errorMap = {}; + this.toShow = $( [] ); + this.toHide = $( [] ); + }, + + reset: function() { + this.resetInternals(); + this.currentElements = $( [] ); + }, + + prepareForm: function() { + this.reset(); + this.toHide = this.errors().add( this.containers ); + }, + + prepareElement: function( element ) { + this.reset(); + this.toHide = this.errorsFor( element ); + }, + + elementValue: function( element ) { + var $element = $( element ), + type = element.type, + isContentEditable = typeof $element.attr( "contenteditable" ) !== "undefined" && $element.attr( "contenteditable" ) !== "false", + val, idx; + + if ( type === "radio" || type === "checkbox" ) { + return this.findByName( element.name ).filter( ":checked" ).val(); + } else if ( type === "number" && typeof element.validity !== "undefined" ) { + return element.validity.badInput ? "NaN" : $element.val(); + } + + if ( isContentEditable ) { + val = $element.text(); + } else { + val = $element.val(); + } + + if ( type === "file" ) { + + // Modern browser (chrome & safari) + if ( val.substr( 0, 12 ) === "C:\\fakepath\\" ) { + return val.substr( 12 ); + } + + // Legacy browsers + // Unix-based path + idx = val.lastIndexOf( "/" ); + if ( idx >= 0 ) { + return val.substr( idx + 1 ); + } + + // Windows-based path + idx = val.lastIndexOf( "\\" ); + if ( idx >= 0 ) { + return val.substr( idx + 1 ); + } + + // Just the file name + return val; + } + + if ( typeof val === "string" ) { + return val.replace( /\r/g, "" ); + } + return val; + }, + + check: function( element ) { + element = this.validationTargetFor( this.clean( element ) ); + + var rules = $( element ).rules(), + rulesCount = $.map( rules, function( n, i ) { + return i; + } ).length, + dependencyMismatch = false, + val = this.elementValue( element ), + result, method, rule, normalizer; + + // Prioritize the local normalizer defined for this element over the global one + // if the former exists, otherwise user the global one in case it exists. + if ( typeof rules.normalizer === "function" ) { + normalizer = rules.normalizer; + } else if ( typeof this.settings.normalizer === "function" ) { + normalizer = this.settings.normalizer; + } + + // If normalizer is defined, then call it to retreive the changed value instead + // of using the real one. + // Note that `this` in the normalizer is `element`. + if ( normalizer ) { + val = normalizer.call( element, val ); + + // Delete the normalizer from rules to avoid treating it as a pre-defined method. + delete rules.normalizer; + } + + for ( method in rules ) { + rule = { method: method, parameters: rules[ method ] }; + try { + result = $.validator.methods[ method ].call( this, val, element, rule.parameters ); + + // If a method indicates that the field is optional and therefore valid, + // don't mark it as valid when there are no other rules + if ( result === "dependency-mismatch" && rulesCount === 1 ) { + dependencyMismatch = true; + continue; + } + dependencyMismatch = false; + + if ( result === "pending" ) { + this.toHide = this.toHide.not( this.errorsFor( element ) ); + return; + } + + if ( !result ) { + this.formatAndAdd( element, rule ); + return false; + } + } catch ( e ) { + if ( this.settings.debug && window.console ) { + console.log( "Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.", e ); + } + if ( e instanceof TypeError ) { + e.message += ". Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method."; + } + + throw e; + } + } + if ( dependencyMismatch ) { + return; + } + if ( this.objectLength( rules ) ) { + this.successList.push( element ); + } + return true; + }, + + // Return the custom message for the given element and validation method + // specified in the element's HTML5 data attribute + // return the generic message if present and no method specific message is present + customDataMessage: function( element, method ) { + return $( element ).data( "msg" + method.charAt( 0 ).toUpperCase() + + method.substring( 1 ).toLowerCase() ) || $( element ).data( "msg" ); + }, + + // Return the custom message for the given element name and validation method + customMessage: function( name, method ) { + var m = this.settings.messages[ name ]; + return m && ( m.constructor === String ? m : m[ method ] ); + }, + + // Return the first defined argument, allowing empty strings + findDefined: function() { + for ( var i = 0; i < arguments.length; i++ ) { + if ( arguments[ i ] !== undefined ) { + return arguments[ i ]; + } + } + return undefined; + }, + + // The second parameter 'rule' used to be a string, and extended to an object literal + // of the following form: + // rule = { + // method: "method name", + // parameters: "the given method parameters" + // } + // + // The old behavior still supported, kept to maintain backward compatibility with + // old code, and will be removed in the next major release. + defaultMessage: function( element, rule ) { + if ( typeof rule === "string" ) { + rule = { method: rule }; + } + + var message = this.findDefined( + this.customMessage( element.name, rule.method ), + this.customDataMessage( element, rule.method ), + + // 'title' is never undefined, so handle empty string as undefined + !this.settings.ignoreTitle && element.title || undefined, + $.validator.messages[ rule.method ], + "Warning: No message defined for " + element.name + "" + ), + theregex = /\$?\{(\d+)\}/g; + if ( typeof message === "function" ) { + message = message.call( this, rule.parameters, element ); + } else if ( theregex.test( message ) ) { + message = $.validator.format( message.replace( theregex, "{$1}" ), rule.parameters ); + } + + return message; + }, + + formatAndAdd: function( element, rule ) { + var message = this.defaultMessage( element, rule ); + + this.errorList.push( { + message: message, + element: element, + method: rule.method + } ); + + this.errorMap[ element.name ] = message; + this.submitted[ element.name ] = message; + }, + + addWrapper: function( toToggle ) { + if ( this.settings.wrapper ) { + toToggle = toToggle.add( toToggle.parent( this.settings.wrapper ) ); + } + return toToggle; + }, + + defaultShowErrors: function() { + var i, elements, error; + for ( i = 0; this.errorList[ i ]; i++ ) { + error = this.errorList[ i ]; + if ( this.settings.highlight ) { + this.settings.highlight.call( this, error.element, this.settings.errorClass, this.settings.validClass ); + } + this.showLabel( error.element, error.message ); + } + if ( this.errorList.length ) { + this.toShow = this.toShow.add( this.containers ); + } + if ( this.settings.success ) { + for ( i = 0; this.successList[ i ]; i++ ) { + this.showLabel( this.successList[ i ] ); + } + } + if ( this.settings.unhighlight ) { + for ( i = 0, elements = this.validElements(); elements[ i ]; i++ ) { + this.settings.unhighlight.call( this, elements[ i ], this.settings.errorClass, this.settings.validClass ); + } + } + this.toHide = this.toHide.not( this.toShow ); + this.hideErrors(); + this.addWrapper( this.toShow ).show(); + }, + + validElements: function() { + return this.currentElements.not( this.invalidElements() ); + }, + + invalidElements: function() { + return $( this.errorList ).map( function() { + return this.element; + } ); + }, + + showLabel: function( element, message ) { + var place, group, errorID, v, + error = this.errorsFor( element ), + elementID = this.idOrName( element ), + describedBy = $( element ).attr( "aria-describedby" ); + + if ( error.length ) { + + // Refresh error/success class + error.removeClass( this.settings.validClass ).addClass( this.settings.errorClass ); + + // Replace message on existing label + error.html( message ); + } else { + + // Create error element + error = $( "<" + this.settings.errorElement + ">" ) + .attr( "id", elementID + "-error" ) + .addClass( this.settings.errorClass ) + .html( message || "" ); + + // Maintain reference to the element to be placed into the DOM + place = error; + if ( this.settings.wrapper ) { + + // Make sure the element is visible, even in IE + // actually showing the wrapped element is handled elsewhere + place = error.hide().show().wrap( "<" + this.settings.wrapper + "/>" ).parent(); + } + if ( this.labelContainer.length ) { + this.labelContainer.append( place ); + } else if ( this.settings.errorPlacement ) { + this.settings.errorPlacement.call( this, place, $( element ) ); + } else { + place.insertAfter( element ); + } + + // Link error back to the element + if ( error.is( "label" ) ) { + + // If the error is a label, then associate using 'for' + error.attr( "for", elementID ); + + // If the element is not a child of an associated label, then it's necessary + // to explicitly apply aria-describedby + } else if ( error.parents( "label[for='" + this.escapeCssMeta( elementID ) + "']" ).length === 0 ) { + errorID = error.attr( "id" ); + + // Respect existing non-error aria-describedby + if ( !describedBy ) { + describedBy = errorID; + } else if ( !describedBy.match( new RegExp( "\\b" + this.escapeCssMeta( errorID ) + "\\b" ) ) ) { + + // Add to end of list if not already present + describedBy += " " + errorID; + } + $( element ).attr( "aria-describedby", describedBy ); + + // If this element is grouped, then assign to all elements in the same group + group = this.groups[ element.name ]; + if ( group ) { + v = this; + $.each( v.groups, function( name, testgroup ) { + if ( testgroup === group ) { + $( "[name='" + v.escapeCssMeta( name ) + "']", v.currentForm ) + .attr( "aria-describedby", error.attr( "id" ) ); + } + } ); + } + } + } + if ( !message && this.settings.success ) { + error.text( "" ); + if ( typeof this.settings.success === "string" ) { + error.addClass( this.settings.success ); + } else { + this.settings.success( error, element ); + } + } + this.toShow = this.toShow.add( error ); + }, + + errorsFor: function( element ) { + var name = this.escapeCssMeta( this.idOrName( element ) ), + describer = $( element ).attr( "aria-describedby" ), + selector = "label[for='" + name + "'], label[for='" + name + "'] *"; + + // 'aria-describedby' should directly reference the error element + if ( describer ) { + selector = selector + ", #" + this.escapeCssMeta( describer ) + .replace( /\s+/g, ", #" ); + } + + return this + .errors() + .filter( selector ); + }, + + // See https://api.jquery.com/category/selectors/, for CSS + // meta-characters that should be escaped in order to be used with JQuery + // as a literal part of a name/id or any selector. + escapeCssMeta: function( string ) { + return string.replace( /([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g, "\\$1" ); + }, + + idOrName: function( element ) { + return this.groups[ element.name ] || ( this.checkable( element ) ? element.name : element.id || element.name ); + }, + + validationTargetFor: function( element ) { + + // If radio/checkbox, validate first element in group instead + if ( this.checkable( element ) ) { + element = this.findByName( element.name ); + } + + // Always apply ignore filter + return $( element ).not( this.settings.ignore )[ 0 ]; + }, + + checkable: function( element ) { + return ( /radio|checkbox/i ).test( element.type ); + }, + + findByName: function( name ) { + return $( this.currentForm ).find( "[name='" + this.escapeCssMeta( name ) + "']" ); + }, + + getLength: function( value, element ) { + switch ( element.nodeName.toLowerCase() ) { + case "select": + return $( "option:selected", element ).length; + case "input": + if ( this.checkable( element ) ) { + return this.findByName( element.name ).filter( ":checked" ).length; + } + } + return value.length; + }, + + depend: function( param, element ) { + return this.dependTypes[ typeof param ] ? this.dependTypes[ typeof param ]( param, element ) : true; + }, + + dependTypes: { + "boolean": function( param ) { + return param; + }, + "string": function( param, element ) { + return !!$( param, element.form ).length; + }, + "function": function( param, element ) { + return param( element ); + } + }, + + optional: function( element ) { + var val = this.elementValue( element ); + return !$.validator.methods.required.call( this, val, element ) && "dependency-mismatch"; + }, + + startRequest: function( element ) { + if ( !this.pending[ element.name ] ) { + this.pendingRequest++; + $( element ).addClass( this.settings.pendingClass ); + this.pending[ element.name ] = true; + } + }, + + stopRequest: function( element, valid ) { + this.pendingRequest--; + + // Sometimes synchronization fails, make sure pendingRequest is never < 0 + if ( this.pendingRequest < 0 ) { + this.pendingRequest = 0; + } + delete this.pending[ element.name ]; + $( element ).removeClass( this.settings.pendingClass ); + if ( valid && this.pendingRequest === 0 && this.formSubmitted && this.form() ) { + $( this.currentForm ).submit(); + + // Remove the hidden input that was used as a replacement for the + // missing submit button. The hidden input is added by `handle()` + // to ensure that the value of the used submit button is passed on + // for scripted submits triggered by this method + if ( this.submitButton ) { + $( "input:hidden[name='" + this.submitButton.name + "']", this.currentForm ).remove(); + } + + this.formSubmitted = false; + } else if ( !valid && this.pendingRequest === 0 && this.formSubmitted ) { + $( this.currentForm ).triggerHandler( "invalid-form", [ this ] ); + this.formSubmitted = false; + } + }, + + previousValue: function( element, method ) { + method = typeof method === "string" && method || "remote"; + + return $.data( element, "previousValue" ) || $.data( element, "previousValue", { + old: null, + valid: true, + message: this.defaultMessage( element, { method: method } ) + } ); + }, + + // Cleans up all forms and elements, removes validator-specific events + destroy: function() { + this.resetForm(); + + $( this.currentForm ) + .off( ".validate" ) + .removeData( "validator" ) + .find( ".validate-equalTo-blur" ) + .off( ".validate-equalTo" ) + .removeClass( "validate-equalTo-blur" ) + .find( ".validate-lessThan-blur" ) + .off( ".validate-lessThan" ) + .removeClass( "validate-lessThan-blur" ) + .find( ".validate-lessThanEqual-blur" ) + .off( ".validate-lessThanEqual" ) + .removeClass( "validate-lessThanEqual-blur" ) + .find( ".validate-greaterThanEqual-blur" ) + .off( ".validate-greaterThanEqual" ) + .removeClass( "validate-greaterThanEqual-blur" ) + .find( ".validate-greaterThan-blur" ) + .off( ".validate-greaterThan" ) + .removeClass( "validate-greaterThan-blur" ); + } + + }, + + classRuleSettings: { + required: { required: true }, + email: { email: true }, + url: { url: true }, + date: { date: true }, + dateISO: { dateISO: true }, + number: { number: true }, + digits: { digits: true }, + creditcard: { creditcard: true } + }, + + addClassRules: function( className, rules ) { + if ( className.constructor === String ) { + this.classRuleSettings[ className ] = rules; + } else { + $.extend( this.classRuleSettings, className ); + } + }, + + classRules: function( element ) { + var rules = {}, + classes = $( element ).attr( "class" ); + + if ( classes ) { + $.each( classes.split( " " ), function() { + if ( this in $.validator.classRuleSettings ) { + $.extend( rules, $.validator.classRuleSettings[ this ] ); + } + } ); + } + return rules; + }, + + normalizeAttributeRule: function( rules, type, method, value ) { + + // Convert the value to a number for number inputs, and for text for backwards compability + // allows type="date" and others to be compared as strings + if ( /min|max|step/.test( method ) && ( type === null || /number|range|text/.test( type ) ) ) { + value = Number( value ); + + // Support Opera Mini, which returns NaN for undefined minlength + if ( isNaN( value ) ) { + value = undefined; + } + } + + if ( value || value === 0 ) { + rules[ method ] = value; + } else if ( type === method && type !== "range" ) { + + // Exception: the jquery validate 'range' method + // does not test for the html5 'range' type + rules[ method ] = true; + } + }, + + attributeRules: function( element ) { + var rules = {}, + $element = $( element ), + type = element.getAttribute( "type" ), + method, value; + + for ( method in $.validator.methods ) { + + // Support for in both html5 and older browsers + if ( method === "required" ) { + value = element.getAttribute( method ); + + // Some browsers return an empty string for the required attribute + // and non-HTML5 browsers might have required="" markup + if ( value === "" ) { + value = true; + } + + // Force non-HTML5 browsers to return bool + value = !!value; + } else { + value = $element.attr( method ); + } + + this.normalizeAttributeRule( rules, type, method, value ); + } + + // 'maxlength' may be returned as -1, 2147483647 ( IE ) and 524288 ( safari ) for text inputs + if ( rules.maxlength && /-1|2147483647|524288/.test( rules.maxlength ) ) { + delete rules.maxlength; + } + + return rules; + }, + + dataRules: function( element ) { + var rules = {}, + $element = $( element ), + type = element.getAttribute( "type" ), + method, value; + + for ( method in $.validator.methods ) { + value = $element.data( "rule" + method.charAt( 0 ).toUpperCase() + method.substring( 1 ).toLowerCase() ); + + // Cast empty attributes like `data-rule-required` to `true` + if ( value === "" ) { + value = true; + } + + this.normalizeAttributeRule( rules, type, method, value ); + } + return rules; + }, + + staticRules: function( element ) { + var rules = {}, + validator = $.data( element.form, "validator" ); + + if ( validator.settings.rules ) { + rules = $.validator.normalizeRule( validator.settings.rules[ element.name ] ) || {}; + } + return rules; + }, + + normalizeRules: function( rules, element ) { + + // Handle dependency check + $.each( rules, function( prop, val ) { + + // Ignore rule when param is explicitly false, eg. required:false + if ( val === false ) { + delete rules[ prop ]; + return; + } + if ( val.param || val.depends ) { + var keepRule = true; + switch ( typeof val.depends ) { + case "string": + keepRule = !!$( val.depends, element.form ).length; + break; + case "function": + keepRule = val.depends.call( element, element ); + break; + } + if ( keepRule ) { + rules[ prop ] = val.param !== undefined ? val.param : true; + } else { + $.data( element.form, "validator" ).resetElements( $( element ) ); + delete rules[ prop ]; + } + } + } ); + + // Evaluate parameters + $.each( rules, function( rule, parameter ) { + rules[ rule ] = $.isFunction( parameter ) && rule !== "normalizer" ? parameter( element ) : parameter; + } ); + + // Clean number parameters + $.each( [ "minlength", "maxlength" ], function() { + if ( rules[ this ] ) { + rules[ this ] = Number( rules[ this ] ); + } + } ); + $.each( [ "rangelength", "range" ], function() { + var parts; + if ( rules[ this ] ) { + if ( $.isArray( rules[ this ] ) ) { + rules[ this ] = [ Number( rules[ this ][ 0 ] ), Number( rules[ this ][ 1 ] ) ]; + } else if ( typeof rules[ this ] === "string" ) { + parts = rules[ this ].replace( /[\[\]]/g, "" ).split( /[\s,]+/ ); + rules[ this ] = [ Number( parts[ 0 ] ), Number( parts[ 1 ] ) ]; + } + } + } ); + + if ( $.validator.autoCreateRanges ) { + + // Auto-create ranges + if ( rules.min != null && rules.max != null ) { + rules.range = [ rules.min, rules.max ]; + delete rules.min; + delete rules.max; + } + if ( rules.minlength != null && rules.maxlength != null ) { + rules.rangelength = [ rules.minlength, rules.maxlength ]; + delete rules.minlength; + delete rules.maxlength; + } + } + + return rules; + }, + + // Converts a simple string to a {string: true} rule, e.g., "required" to {required:true} + normalizeRule: function( data ) { + if ( typeof data === "string" ) { + var transformed = {}; + $.each( data.split( /\s/ ), function() { + transformed[ this ] = true; + } ); + data = transformed; + } + return data; + }, + + // https://jqueryvalidation.org/jQuery.validator.addMethod/ + addMethod: function( name, method, message ) { + $.validator.methods[ name ] = method; + $.validator.messages[ name ] = message !== undefined ? message : $.validator.messages[ name ]; + if ( method.length < 3 ) { + $.validator.addClassRules( name, $.validator.normalizeRule( name ) ); + } + }, + + // https://jqueryvalidation.org/jQuery.validator.methods/ + methods: { + + // https://jqueryvalidation.org/required-method/ + required: function( value, element, param ) { + + // Check if dependency is met + if ( !this.depend( param, element ) ) { + return "dependency-mismatch"; + } + if ( element.nodeName.toLowerCase() === "select" ) { + + // Could be an array for select-multiple or a string, both are fine this way + var val = $( element ).val(); + return val && val.length > 0; + } + if ( this.checkable( element ) ) { + return this.getLength( value, element ) > 0; + } + return value !== undefined && value !== null && value.length > 0; + }, + + // https://jqueryvalidation.org/email-method/ + email: function( value, element ) { + + // From https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address + // Retrieved 2014-01-14 + // If you have a problem with this implementation, report a bug against the above spec + // Or use custom methods to implement your own email validation + return this.optional( element ) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test( value ); + }, + + // https://jqueryvalidation.org/url-method/ + url: function( value, element ) { + + // Copyright (c) 2010-2013 Diego Perini, MIT licensed + // https://gist.github.com/dperini/729294 + // see also https://mathiasbynens.be/demo/url-regex + // modified to allow protocol-relative URLs + return this.optional( element ) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test( value ); + }, + + // https://jqueryvalidation.org/date-method/ + date: ( function() { + var called = false; + + return function( value, element ) { + if ( !called ) { + called = true; + if ( this.settings.debug && window.console ) { + console.warn( + "The `date` method is deprecated and will be removed in version '2.0.0'.\n" + + "Please don't use it, since it relies on the Date constructor, which\n" + + "behaves very differently across browsers and locales. Use `dateISO`\n" + + "instead or one of the locale specific methods in `localizations/`\n" + + "and `additional-methods.js`." + ); + } + } + + return this.optional( element ) || !/Invalid|NaN/.test( new Date( value ).toString() ); + }; + }() ), + + // https://jqueryvalidation.org/dateISO-method/ + dateISO: function( value, element ) { + return this.optional( element ) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test( value ); + }, + + // https://jqueryvalidation.org/number-method/ + number: function( value, element ) { + return this.optional( element ) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test( value ); + }, + + // https://jqueryvalidation.org/digits-method/ + digits: function( value, element ) { + return this.optional( element ) || /^\d+$/.test( value ); + }, + + // https://jqueryvalidation.org/minlength-method/ + minlength: function( value, element, param ) { + var length = $.isArray( value ) ? value.length : this.getLength( value, element ); + return this.optional( element ) || length >= param; + }, + + // https://jqueryvalidation.org/maxlength-method/ + maxlength: function( value, element, param ) { + var length = $.isArray( value ) ? value.length : this.getLength( value, element ); + return this.optional( element ) || length <= param; + }, + + // https://jqueryvalidation.org/rangelength-method/ + rangelength: function( value, element, param ) { + var length = $.isArray( value ) ? value.length : this.getLength( value, element ); + return this.optional( element ) || ( length >= param[ 0 ] && length <= param[ 1 ] ); + }, + + // https://jqueryvalidation.org/min-method/ + min: function( value, element, param ) { + return this.optional( element ) || value >= param; + }, + + // https://jqueryvalidation.org/max-method/ + max: function( value, element, param ) { + return this.optional( element ) || value <= param; + }, + + // https://jqueryvalidation.org/range-method/ + range: function( value, element, param ) { + return this.optional( element ) || ( value >= param[ 0 ] && value <= param[ 1 ] ); + }, + + // https://jqueryvalidation.org/step-method/ + step: function( value, element, param ) { + var type = $( element ).attr( "type" ), + errorMessage = "Step attribute on input type " + type + " is not supported.", + supportedTypes = [ "text", "number", "range" ], + re = new RegExp( "\\b" + type + "\\b" ), + notSupported = type && !re.test( supportedTypes.join() ), + decimalPlaces = function( num ) { + var match = ( "" + num ).match( /(?:\.(\d+))?$/ ); + if ( !match ) { + return 0; + } + + // Number of digits right of decimal point. + return match[ 1 ] ? match[ 1 ].length : 0; + }, + toInt = function( num ) { + return Math.round( num * Math.pow( 10, decimals ) ); + }, + valid = true, + decimals; + + // Works only for text, number and range input types + // TODO find a way to support input types date, datetime, datetime-local, month, time and week + if ( notSupported ) { + throw new Error( errorMessage ); + } + + decimals = decimalPlaces( param ); + + // Value can't have too many decimals + if ( decimalPlaces( value ) > decimals || toInt( value ) % toInt( param ) !== 0 ) { + valid = false; + } + + return this.optional( element ) || valid; + }, + + // https://jqueryvalidation.org/equalTo-method/ + equalTo: function( value, element, param ) { + + // Bind to the blur event of the target in order to revalidate whenever the target field is updated + var target = $( param ); + if ( this.settings.onfocusout && target.not( ".validate-equalTo-blur" ).length ) { + target.addClass( "validate-equalTo-blur" ).on( "blur.validate-equalTo", function() { + $( element ).valid(); + } ); + } + return value === target.val(); + }, + + // https://jqueryvalidation.org/remote-method/ + remote: function( value, element, param, method ) { + if ( this.optional( element ) ) { + return "dependency-mismatch"; + } + + method = typeof method === "string" && method || "remote"; + + var previous = this.previousValue( element, method ), + validator, data, optionDataString; + + if ( !this.settings.messages[ element.name ] ) { + this.settings.messages[ element.name ] = {}; + } + previous.originalMessage = previous.originalMessage || this.settings.messages[ element.name ][ method ]; + this.settings.messages[ element.name ][ method ] = previous.message; + + param = typeof param === "string" && { url: param } || param; + optionDataString = $.param( $.extend( { data: value }, param.data ) ); + if ( previous.old === optionDataString ) { + return previous.valid; + } + + previous.old = optionDataString; + validator = this; + this.startRequest( element ); + data = {}; + data[ element.name ] = value; + $.ajax( $.extend( true, { + mode: "abort", + port: "validate" + element.name, + dataType: "json", + data: data, + context: validator.currentForm, + success: function( response ) { + var valid = response === true || response === "true", + errors, message, submitted; + + validator.settings.messages[ element.name ][ method ] = previous.originalMessage; + if ( valid ) { + submitted = validator.formSubmitted; + validator.resetInternals(); + validator.toHide = validator.errorsFor( element ); + validator.formSubmitted = submitted; + validator.successList.push( element ); + validator.invalid[ element.name ] = false; + validator.showErrors(); + } else { + errors = {}; + message = response || validator.defaultMessage( element, { method: method, parameters: value } ); + errors[ element.name ] = previous.message = message; + validator.invalid[ element.name ] = true; + validator.showErrors( errors ); + } + previous.valid = valid; + validator.stopRequest( element, valid ); + } + }, param ) ); + return "pending"; + } + } + +} ); + +// Ajax mode: abort +// usage: $.ajax({ mode: "abort"[, port: "uniqueport"]}); +// if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort() + +var pendingRequests = {}, + ajax; + +// Use a prefilter if available (1.5+) +if ( $.ajaxPrefilter ) { + $.ajaxPrefilter( function( settings, _, xhr ) { + var port = settings.port; + if ( settings.mode === "abort" ) { + if ( pendingRequests[ port ] ) { + pendingRequests[ port ].abort(); + } + pendingRequests[ port ] = xhr; + } + } ); +} else { + + // Proxy ajax + ajax = $.ajax; + $.ajax = function( settings ) { + var mode = ( "mode" in settings ? settings : $.ajaxSettings ).mode, + port = ( "port" in settings ? settings : $.ajaxSettings ).port; + if ( mode === "abort" ) { + if ( pendingRequests[ port ] ) { + pendingRequests[ port ].abort(); + } + pendingRequests[ port ] = ajax.apply( this, arguments ); + return pendingRequests[ port ]; + } + return ajax.apply( this, arguments ); + }; +} +return $; +})); \ No newline at end of file diff --git a/app/assets/javascripts/jquery.validate.min.js b/app/assets/javascripts/jquery.validate.min.js new file mode 100644 index 000000000..7bc947fbc --- /dev/null +++ b/app/assets/javascripts/jquery.validate.min.js @@ -0,0 +1,4 @@ +/*! jQuery Validation Plugin - v1.19.1 - 6/15/2019 + * https://jqueryvalidation.org/ + * Copyright (c) 2019 Jörn Zaefferer; Licensed MIT */ +!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.on("click.validate",":submit",function(b){c.submitButton=b.currentTarget,a(this).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(this).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.on("submit.validate",function(b){function d(){var d,e;return c.submitButton&&(c.settings.submitHandler||c.formSubmitted)&&(d=a("").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),!(c.settings.submitHandler&&!c.settings.debug)||(e=c.settings.submitHandler.call(c,c.currentForm,b),d&&d.remove(),void 0!==e&&e)}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c,d;return a(this[0]).is("form")?b=this.validate().form():(d=[],b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element(this)&&b,b||(d=d.concat(c.errorList))}),c.errorList=d),b},rules:function(b,c){var d,e,f,g,h,i,j=this[0],k="undefined"!=typeof this.attr("contenteditable")&&"false"!==this.attr("contenteditable");if(null!=j&&(!j.form&&k&&(j.form=this.closest("form")[0],j.name=this.attr("name")),null!=j.form)){if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(a,b){i[b]=f[b],delete f[b]}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g)),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}}),a.extend(a.expr.pseudos||a.expr[":"],{blank:function(b){return!a.trim(""+a(b).val())},filled:function(b){var c=a(b).val();return null!==c&&!!a.trim(""+c)},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:void 0===c?b:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",pendingClass:"pending",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(a)))},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(b,c){var d=[16,17,18,20,35,36,37,38,39,40,45,144,225];9===c.which&&""===this.elementValue(b)||a.inArray(c.keyCode,d)!==-1||(b.name in this.submitted||b.name in this.invalid)&&this.element(b)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}."),step:a.validator.format("Please enter a multiple of {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){var c="undefined"!=typeof a(this).attr("contenteditable")&&"false"!==a(this).attr("contenteditable");if(!this.form&&c&&(this.form=a(this).closest("form")[0],this.name=a(this).attr("name")),d===this.form){var e=a.data(this.form,"validator"),f="on"+b.type.replace(/^validate/,""),g=e.settings;g[f]&&!a(this).is(g.ignore)&&g[f].call(e,this,b)}}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c,d=this.currentForm,e=this.groups={};a.each(this.settings.groups,function(b,c){"string"==typeof c&&(c=c.split(/\s/)),a.each(c,function(a,c){e[c]=b})}),c=this.settings.rules,a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).on("focusin.validate focusout.validate keyup.validate",":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], [type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox'], [contenteditable], [type='button']",b).on("click.validate","select, option, [type='radio'], [type='checkbox']",b),this.settings.invalidHandler&&a(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){var c,d,e=this.clean(b),f=this.validationTargetFor(e),g=this,h=!0;return void 0===f?delete this.invalid[e.name]:(this.prepareElement(f),this.currentElements=a(f),d=this.groups[f.name],d&&a.each(this.groups,function(a,b){b===d&&a!==f.name&&(e=g.validationTargetFor(g.clean(g.findByName(a))),e&&e.name in g.invalid&&(g.currentElements.push(e),h=g.check(e)&&h))}),c=this.check(f)!==!1,h=h&&c,c?this.invalid[f.name]=!1:this.invalid[f.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),a(b).attr("aria-invalid",!c)),h},showErrors:function(b){if(b){var c=this;a.extend(this.errorMap,b),this.errorList=a.map(this.errorMap,function(a,b){return{message:a,element:c.findByName(b)[0]}}),this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.invalid={},this.submitted={},this.prepareForm(),this.hideErrors();var b=this.elements().removeData("previousValue").removeAttr("aria-invalid");this.resetElements(b)},resetElements:function(a){var b;if(this.settings.unhighlight)for(b=0;a[b];b++)this.settings.unhighlight.call(this,a[b],this.settings.errorClass,""),this.findByName(a[b].name).removeClass(this.settings.validClass);else a.removeClass(this.settings.errorClass).removeClass(this.settings.validClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b,c=0;for(b in a)void 0!==a[b]&&null!==a[b]&&a[b]!==!1&&c++;return c},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(a){a.not(this.containers).text(""),this.addWrapper(a).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").trigger("focus").trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea, [contenteditable]").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){var d=this.name||a(this).attr("name"),e="undefined"!=typeof a(this).attr("contenteditable")&&"false"!==a(this).attr("contenteditable");return!d&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),e&&(this.form=a(this).closest("form")[0],this.name=d),this.form===b.currentForm&&(!(d in c||!b.objectLength(a(this).rules()))&&(c[d]=!0,!0))})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.split(" ").join(".");return a(this.settings.errorElement+"."+b,this.errorContext)},resetInternals:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([])},reset:function(){this.resetInternals(),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c,d,e=a(b),f=b.type,g="undefined"!=typeof e.attr("contenteditable")&&"false"!==e.attr("contenteditable");return"radio"===f||"checkbox"===f?this.findByName(b.name).filter(":checked").val():"number"===f&&"undefined"!=typeof b.validity?b.validity.badInput?"NaN":e.val():(c=g?e.text():e.val(),"file"===f?"C:\\fakepath\\"===c.substr(0,12)?c.substr(12):(d=c.lastIndexOf("/"),d>=0?c.substr(d+1):(d=c.lastIndexOf("\\"),d>=0?c.substr(d+1):c)):"string"==typeof c?c.replace(/\r/g,""):c)},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d,e,f,g=a(b).rules(),h=a.map(g,function(a,b){return b}).length,i=!1,j=this.elementValue(b);"function"==typeof g.normalizer?f=g.normalizer:"function"==typeof this.settings.normalizer&&(f=this.settings.normalizer),f&&(j=f.call(b,j),delete g.normalizer);for(d in g){e={method:d,parameters:g[d]};try{if(c=a.validator.methods[d].call(this,j,b,e.parameters),"dependency-mismatch"===c&&1===h){i=!0;continue}if(i=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,e),!1}catch(k){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+b.id+", check the '"+e.method+"' method.",k),k instanceof TypeError&&(k.message+=". Exception occurred when checking element "+b.id+", check the '"+e.method+"' method."),k}}if(!i)return this.objectLength(g)&&this.successList.push(b),!0},customDataMessage:function(b,c){return a(b).data("msg"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase())||a(b).data("msg")},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;aWarning: No message defined for "+b.name+""),e=/\$?\{(\d+)\}/g;return"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),d},formatAndAdd:function(a,b){var c=this.defaultMessage(a,b);this.errorList.push({message:c,element:a,method:b.method}),this.errorMap[a.name]=c,this.submitted[a.name]=c},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)c=this.errorList[a],this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d,e,f,g,h=this.errorsFor(b),i=this.idOrName(b),j=a(b).attr("aria-describedby");h.length?(h.removeClass(this.settings.validClass).addClass(this.settings.errorClass),h.html(c)):(h=a("<"+this.settings.errorElement+">").attr("id",i+"-error").addClass(this.settings.errorClass).html(c||""),d=h,this.settings.wrapper&&(d=h.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(d):this.settings.errorPlacement?this.settings.errorPlacement.call(this,d,a(b)):d.insertAfter(b),h.is("label")?h.attr("for",i):0===h.parents("label[for='"+this.escapeCssMeta(i)+"']").length&&(f=h.attr("id"),j?j.match(new RegExp("\\b"+this.escapeCssMeta(f)+"\\b"))||(j+=" "+f):j=f,a(b).attr("aria-describedby",j),e=this.groups[b.name],e&&(g=this,a.each(g.groups,function(b,c){c===e&&a("[name='"+g.escapeCssMeta(b)+"']",g.currentForm).attr("aria-describedby",h.attr("id"))})))),!c&&this.settings.success&&(h.text(""),"string"==typeof this.settings.success?h.addClass(this.settings.success):this.settings.success(h,b)),this.toShow=this.toShow.add(h)},errorsFor:function(b){var c=this.escapeCssMeta(this.idOrName(b)),d=a(b).attr("aria-describedby"),e="label[for='"+c+"'], label[for='"+c+"'] *";return d&&(e=e+", #"+this.escapeCssMeta(d).replace(/\s+/g,", #")),this.errors().filter(e)},escapeCssMeta:function(a){return a.replace(/([\\!"#$%&'()*+,.\/:;<=>?@\[\]^`{|}~])/g,"\\$1")},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(b){return this.checkable(b)&&(b=this.findByName(b.name)),a(b).not(this.settings.ignore)[0]},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+this.escapeCssMeta(b)+"']")},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return!this.dependTypes[typeof a]||this.dependTypes[typeof a](a,b)},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(b){this.pending[b.name]||(this.pendingRequest++,a(b).addClass(this.settings.pendingClass),this.pending[b.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],a(b).removeClass(this.settings.pendingClass),c&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.submitButton&&a("input:hidden[name='"+this.submitButton.name+"']",this.currentForm).remove(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b,c){return c="string"==typeof c&&c||"remote",a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,{method:c})})},destroy:function(){this.resetForm(),a(this.currentForm).off(".validate").removeData("validator").find(".validate-equalTo-blur").off(".validate-equalTo").removeClass("validate-equalTo-blur").find(".validate-lessThan-blur").off(".validate-lessThan").removeClass("validate-lessThan-blur").find(".validate-lessThanEqual-blur").off(".validate-lessThanEqual").removeClass("validate-lessThanEqual-blur").find(".validate-greaterThanEqual-blur").off(".validate-greaterThanEqual").removeClass("validate-greaterThanEqual-blur").find(".validate-greaterThan-blur").off(".validate-greaterThan").removeClass("validate-greaterThan-blur")}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},normalizeAttributeRule:function(a,b,c,d){/min|max|step/.test(c)&&(null===b||/number|range|text/.test(b))&&(d=Number(d),isNaN(d)&&(d=void 0)),d||0===d?a[c]=d:b===c&&"range"!==b&&(a[c]=!0)},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),this.normalizeAttributeRule(e,g,c,d);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)d=f.data("rule"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()),""===d&&(d=!0),this.normalizeAttributeRule(e,g,c,d);return e},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0===e.param||e.param:(a.data(c.form,"validator").resetElements(a(c)),delete b[d])}}),a.each(b,function(d,e){b[d]=a.isFunction(e)&&"normalizer"!==d?e(c):e}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var c;b[this]&&(a.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(c=b[this].replace(/[\[\]]/g,"").split(/[\s,]+/),b[this]=[Number(c[0]),Number(c[1])]))}),a.validator.autoCreateRanges&&(null!=b.min&&null!=b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),null!=b.minlength&&null!=b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:void 0!==b&&null!==b&&b.length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[\/?#]\S*)?$/i.test(a)},date:function(){var a=!1;return function(b,c){return a||(a=!0,this.settings.debug&&window.console&&console.warn("The `date` method is deprecated and will be removed in version '2.0.0'.\nPlease don't use it, since it relies on the Date constructor, which\nbehaves very differently across browsers and locales. Use `dateISO`\ninstead or one of the locale specific methods in `localizations/`\nand `additional-methods.js`.")),this.optional(c)||!/Invalid|NaN/.test(new Date(b).toString())}}(),dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a)},number:function(a,b){return this.optional(b)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},minlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d},maxlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e<=d},rangelength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||a<=c},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},step:function(b,c,d){var e,f=a(c).attr("type"),g="Step attribute on input type "+f+" is not supported.",h=["text","number","range"],i=new RegExp("\\b"+f+"\\b"),j=f&&!i.test(h.join()),k=function(a){var b=(""+a).match(/(?:\.(\d+))?$/);return b&&b[1]?b[1].length:0},l=function(a){return Math.round(a*Math.pow(10,e))},m=!0;if(j)throw new Error(g);return e=k(d),(k(b)>e||l(b)%l(d)!==0)&&(m=!1),this.optional(c)||m},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.not(".validate-equalTo-blur").length&&e.addClass("validate-equalTo-blur").on("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d,e){if(this.optional(c))return"dependency-mismatch";e="string"==typeof e&&e||"remote";var f,g,h,i=this.previousValue(c,e);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),i.originalMessage=i.originalMessage||this.settings.messages[c.name][e],this.settings.messages[c.name][e]=i.message,d="string"==typeof d&&{url:d}||d,h=a.param(a.extend({data:b},d.data)),i.old===h?i.valid:(i.old=h,f=this,this.startRequest(c),g={},g[c.name]=b,a.ajax(a.extend(!0,{mode:"abort",port:"validate"+c.name,dataType:"json",data:g,context:f.currentForm,success:function(a){var d,g,h,j=a===!0||"true"===a;f.settings.messages[c.name][e]=i.originalMessage,j?(h=f.formSubmitted,f.resetInternals(),f.toHide=f.errorsFor(c),f.formSubmitted=h,f.successList.push(c),f.invalid[c.name]=!1,f.showErrors()):(d={},g=a||f.defaultMessage(c,{method:e,parameters:b}),d[c.name]=i.message=g,f.invalid[c.name]=!0,f.showErrors(d)),i.valid=j,f.stopRequest(c,j)}},d)),"pending")}}});var b,c={};return a.ajaxPrefilter?a.ajaxPrefilter(function(a,b,d){var e=a.port;"abort"===a.mode&&(c[e]&&c[e].abort(),c[e]=d)}):(b=a.ajax,a.ajax=function(d){var e=("mode"in d?d:a.ajaxSettings).mode,f=("port"in d?d:a.ajaxSettings).port;return"abort"===e?(c[f]&&c[f].abort(),c[f]=b.apply(this,arguments),c[f]):b.apply(this,arguments)}),a}); \ No newline at end of file diff --git a/app/assets/javascripts/select2.js b/app/assets/javascripts/select2.js new file mode 100755 index 000000000..d33caac21 --- /dev/null +++ b/app/assets/javascripts/select2.js @@ -0,0 +1,5891 @@ +/*! + * Select2 4.0.8 + * https://select2.github.io + * + * Released under the MIT license + * https://github.com/select2/select2/blob/master/LICENSE.md + */ +;(function (factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['jquery'], factory); + } else if (typeof module === 'object' && module.exports) { + // Node/CommonJS + module.exports = function (root, jQuery) { + if (jQuery === undefined) { + // require('jQuery') returns a factory that requires window to + // build a jQuery instance, we normalize how we use modules + // that require this pattern but the window provided is a noop + // if it's defined (how jquery works) + if (typeof window !== 'undefined') { + jQuery = require('jquery'); + } + else { + jQuery = require('jquery')(root); + } + } + factory(jQuery); + return jQuery; + }; + } else { + // Browser globals + factory(jQuery); + } +} (function (jQuery) { + // This is needed so we can catch the AMD loader configuration and use it + // The inner file should be wrapped (by `banner.start.js`) in a function that + // returns the AMD loader references. + var S2 =(function () { + // Restore the Select2 AMD loader so it can be used + // Needed mostly in the language files, where the loader is not inserted + if (jQuery && jQuery.fn && jQuery.fn.select2 && jQuery.fn.select2.amd) { + var S2 = jQuery.fn.select2.amd; + } +var S2;(function () { if (!S2 || !S2.requirejs) { +if (!S2) { S2 = {}; } else { require = S2; } +/** + * @license almond 0.3.3 Copyright jQuery Foundation and other contributors. + * Released under MIT license, http://github.com/requirejs/almond/LICENSE + */ +//Going sloppy to avoid 'use strict' string cost, but strict practices should +//be followed. +/*global setTimeout: false */ + +var requirejs, require, define; +(function (undef) { + var main, req, makeMap, handlers, + defined = {}, + waiting = {}, + config = {}, + defining = {}, + hasOwn = Object.prototype.hasOwnProperty, + aps = [].slice, + jsSuffixRegExp = /\.js$/; + + function hasProp(obj, prop) { + return hasOwn.call(obj, prop); + } + + /** + * Given a relative module name, like ./something, normalize it to + * a real name that can be mapped to a path. + * @param {String} name the relative name + * @param {String} baseName a real name that the name arg is relative + * to. + * @returns {String} normalized name + */ + function normalize(name, baseName) { + var nameParts, nameSegment, mapValue, foundMap, lastIndex, + foundI, foundStarMap, starI, i, j, part, normalizedBaseParts, + baseParts = baseName && baseName.split("/"), + map = config.map, + starMap = (map && map['*']) || {}; + + //Adjust any relative paths. + if (name) { + name = name.split('/'); + lastIndex = name.length - 1; + + // If wanting node ID compatibility, strip .js from end + // of IDs. Have to do this here, and not in nameToUrl + // because node allows either .js or non .js to map + // to same file. + if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) { + name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, ''); + } + + // Starts with a '.' so need the baseName + if (name[0].charAt(0) === '.' && baseParts) { + //Convert baseName to array, and lop off the last part, + //so that . matches that 'directory' and not name of the baseName's + //module. For instance, baseName of 'one/two/three', maps to + //'one/two/three.js', but we want the directory, 'one/two' for + //this normalization. + normalizedBaseParts = baseParts.slice(0, baseParts.length - 1); + name = normalizedBaseParts.concat(name); + } + + //start trimDots + for (i = 0; i < name.length; i++) { + part = name[i]; + if (part === '.') { + name.splice(i, 1); + i -= 1; + } else if (part === '..') { + // If at the start, or previous value is still .., + // keep them so that when converted to a path it may + // still work when converted to a path, even though + // as an ID it is less than ideal. In larger point + // releases, may be better to just kick out an error. + if (i === 0 || (i === 1 && name[2] === '..') || name[i - 1] === '..') { + continue; + } else if (i > 0) { + name.splice(i - 1, 2); + i -= 2; + } + } + } + //end trimDots + + name = name.join('/'); + } + + //Apply map config if available. + if ((baseParts || starMap) && map) { + nameParts = name.split('/'); + + for (i = nameParts.length; i > 0; i -= 1) { + nameSegment = nameParts.slice(0, i).join("/"); + + if (baseParts) { + //Find the longest baseName segment match in the config. + //So, do joins on the biggest to smallest lengths of baseParts. + for (j = baseParts.length; j > 0; j -= 1) { + mapValue = map[baseParts.slice(0, j).join('/')]; + + //baseName segment has config, find if it has one for + //this name. + if (mapValue) { + mapValue = mapValue[nameSegment]; + if (mapValue) { + //Match, update name to the new value. + foundMap = mapValue; + foundI = i; + break; + } + } + } + } + + if (foundMap) { + break; + } + + //Check for a star map match, but just hold on to it, + //if there is a shorter segment match later in a matching + //config, then favor over this star map. + if (!foundStarMap && starMap && starMap[nameSegment]) { + foundStarMap = starMap[nameSegment]; + starI = i; + } + } + + if (!foundMap && foundStarMap) { + foundMap = foundStarMap; + foundI = starI; + } + + if (foundMap) { + nameParts.splice(0, foundI, foundMap); + name = nameParts.join('/'); + } + } + + return name; + } + + function makeRequire(relName, forceSync) { + return function () { + //A version of a require function that passes a moduleName + //value for items that may need to + //look up paths relative to the moduleName + var args = aps.call(arguments, 0); + + //If first arg is not require('string'), and there is only + //one arg, it is the array form without a callback. Insert + //a null so that the following concat is correct. + if (typeof args[0] !== 'string' && args.length === 1) { + args.push(null); + } + return req.apply(undef, args.concat([relName, forceSync])); + }; + } + + function makeNormalize(relName) { + return function (name) { + return normalize(name, relName); + }; + } + + function makeLoad(depName) { + return function (value) { + defined[depName] = value; + }; + } + + function callDep(name) { + if (hasProp(waiting, name)) { + var args = waiting[name]; + delete waiting[name]; + defining[name] = true; + main.apply(undef, args); + } + + if (!hasProp(defined, name) && !hasProp(defining, name)) { + throw new Error('No ' + name); + } + return defined[name]; + } + + //Turns a plugin!resource to [plugin, resource] + //with the plugin being undefined if the name + //did not have a plugin prefix. + function splitPrefix(name) { + var prefix, + index = name ? name.indexOf('!') : -1; + if (index > -1) { + prefix = name.substring(0, index); + name = name.substring(index + 1, name.length); + } + return [prefix, name]; + } + + //Creates a parts array for a relName where first part is plugin ID, + //second part is resource ID. Assumes relName has already been normalized. + function makeRelParts(relName) { + return relName ? splitPrefix(relName) : []; + } + + /** + * Makes a name map, normalizing the name, and using a plugin + * for normalization if necessary. Grabs a ref to plugin + * too, as an optimization. + */ + makeMap = function (name, relParts) { + var plugin, + parts = splitPrefix(name), + prefix = parts[0], + relResourceName = relParts[1]; + + name = parts[1]; + + if (prefix) { + prefix = normalize(prefix, relResourceName); + plugin = callDep(prefix); + } + + //Normalize according + if (prefix) { + if (plugin && plugin.normalize) { + name = plugin.normalize(name, makeNormalize(relResourceName)); + } else { + name = normalize(name, relResourceName); + } + } else { + name = normalize(name, relResourceName); + parts = splitPrefix(name); + prefix = parts[0]; + name = parts[1]; + if (prefix) { + plugin = callDep(prefix); + } + } + + //Using ridiculous property names for space reasons + return { + f: prefix ? prefix + '!' + name : name, //fullName + n: name, + pr: prefix, + p: plugin + }; + }; + + function makeConfig(name) { + return function () { + return (config && config.config && config.config[name]) || {}; + }; + } + + handlers = { + require: function (name) { + return makeRequire(name); + }, + exports: function (name) { + var e = defined[name]; + if (typeof e !== 'undefined') { + return e; + } else { + return (defined[name] = {}); + } + }, + module: function (name) { + return { + id: name, + uri: '', + exports: defined[name], + config: makeConfig(name) + }; + } + }; + + main = function (name, deps, callback, relName) { + var cjsModule, depName, ret, map, i, relParts, + args = [], + callbackType = typeof callback, + usingExports; + + //Use name if no relName + relName = relName || name; + relParts = makeRelParts(relName); + + //Call the callback to define the module, if necessary. + if (callbackType === 'undefined' || callbackType === 'function') { + //Pull out the defined dependencies and pass the ordered + //values to the callback. + //Default to [require, exports, module] if no deps + deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps; + for (i = 0; i < deps.length; i += 1) { + map = makeMap(deps[i], relParts); + depName = map.f; + + //Fast path CommonJS standard dependencies. + if (depName === "require") { + args[i] = handlers.require(name); + } else if (depName === "exports") { + //CommonJS module spec 1.1 + args[i] = handlers.exports(name); + usingExports = true; + } else if (depName === "module") { + //CommonJS module spec 1.1 + cjsModule = args[i] = handlers.module(name); + } else if (hasProp(defined, depName) || + hasProp(waiting, depName) || + hasProp(defining, depName)) { + args[i] = callDep(depName); + } else if (map.p) { + map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {}); + args[i] = defined[depName]; + } else { + throw new Error(name + ' missing ' + depName); + } + } + + ret = callback ? callback.apply(defined[name], args) : undefined; + + if (name) { + //If setting exports via "module" is in play, + //favor that over return value and exports. After that, + //favor a non-undefined return value over exports use. + if (cjsModule && cjsModule.exports !== undef && + cjsModule.exports !== defined[name]) { + defined[name] = cjsModule.exports; + } else if (ret !== undef || !usingExports) { + //Use the return value from the function. + defined[name] = ret; + } + } + } else if (name) { + //May just be an object definition for the module. Only + //worry about defining if have a module name. + defined[name] = callback; + } + }; + + requirejs = require = req = function (deps, callback, relName, forceSync, alt) { + if (typeof deps === "string") { + if (handlers[deps]) { + //callback in this case is really relName + return handlers[deps](callback); + } + //Just return the module wanted. In this scenario, the + //deps arg is the module name, and second arg (if passed) + //is just the relName. + //Normalize module name, if it contains . or .. + return callDep(makeMap(deps, makeRelParts(callback)).f); + } else if (!deps.splice) { + //deps is a config object, not an array. + config = deps; + if (config.deps) { + req(config.deps, config.callback); + } + if (!callback) { + return; + } + + if (callback.splice) { + //callback is an array, which means it is a dependency list. + //Adjust args if there are dependencies + deps = callback; + callback = relName; + relName = null; + } else { + deps = undef; + } + } + + //Support require(['a']) + callback = callback || function () {}; + + //If relName is a function, it is an errback handler, + //so remove it. + if (typeof relName === 'function') { + relName = forceSync; + forceSync = alt; + } + + //Simulate async callback; + if (forceSync) { + main(undef, deps, callback, relName); + } else { + //Using a non-zero value because of concern for what old browsers + //do, and latest browsers "upgrade" to 4 if lower value is used: + //http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout: + //If want a value immediately, use require('id') instead -- something + //that works in almond on the global level, but not guaranteed and + //unlikely to work in other AMD implementations. + setTimeout(function () { + main(undef, deps, callback, relName); + }, 4); + } + + return req; + }; + + /** + * Just drops the config on the floor, but returns req in case + * the config return value is used. + */ + req.config = function (cfg) { + return req(cfg); + }; + + /** + * Expose module registry for debugging and tooling + */ + requirejs._defined = defined; + + define = function (name, deps, callback) { + if (typeof name !== 'string') { + throw new Error('See almond README: incorrect module build, no module name'); + } + + //This module may not have dependencies + if (!deps.splice) { + //deps is not an array, so probably means + //an object literal or factory function for + //the value. Adjust args. + callback = deps; + deps = []; + } + + if (!hasProp(defined, name) && !hasProp(waiting, name)) { + waiting[name] = [name, deps, callback]; + } + }; + + define.amd = { + jQuery: true + }; +}()); + +S2.requirejs = requirejs;S2.require = require;S2.define = define; +} +}()); +S2.define("almond", function(){}); + +/* global jQuery:false, $:false */ +S2.define('jquery',[],function () { + var _$ = jQuery || $; + + if (_$ == null && console && console.error) { + console.error( + 'Select2: An instance of jQuery or a jQuery-compatible library was not ' + + 'found. Make sure that you are including jQuery before Select2 on your ' + + 'web page.' + ); + } + + return _$; +}); + +S2.define('select2/utils',[ + 'jquery' +], function ($) { + var Utils = {}; + + Utils.Extend = function (ChildClass, SuperClass) { + var __hasProp = {}.hasOwnProperty; + + function BaseConstructor () { + this.constructor = ChildClass; + } + + for (var key in SuperClass) { + if (__hasProp.call(SuperClass, key)) { + ChildClass[key] = SuperClass[key]; + } + } + + BaseConstructor.prototype = SuperClass.prototype; + ChildClass.prototype = new BaseConstructor(); + ChildClass.__super__ = SuperClass.prototype; + + return ChildClass; + }; + + function getMethods (theClass) { + var proto = theClass.prototype; + + var methods = []; + + for (var methodName in proto) { + var m = proto[methodName]; + + if (typeof m !== 'function') { + continue; + } + + if (methodName === 'constructor') { + continue; + } + + methods.push(methodName); + } + + return methods; + } + + Utils.Decorate = function (SuperClass, DecoratorClass) { + var decoratedMethods = getMethods(DecoratorClass); + var superMethods = getMethods(SuperClass); + + function DecoratedClass () { + var unshift = Array.prototype.unshift; + + var argCount = DecoratorClass.prototype.constructor.length; + + var calledConstructor = SuperClass.prototype.constructor; + + if (argCount > 0) { + unshift.call(arguments, SuperClass.prototype.constructor); + + calledConstructor = DecoratorClass.prototype.constructor; + } + + calledConstructor.apply(this, arguments); + } + + DecoratorClass.displayName = SuperClass.displayName; + + function ctr () { + this.constructor = DecoratedClass; + } + + DecoratedClass.prototype = new ctr(); + + for (var m = 0; m < superMethods.length; m++) { + var superMethod = superMethods[m]; + + DecoratedClass.prototype[superMethod] = + SuperClass.prototype[superMethod]; + } + + var calledMethod = function (methodName) { + // Stub out the original method if it's not decorating an actual method + var originalMethod = function () {}; + + if (methodName in DecoratedClass.prototype) { + originalMethod = DecoratedClass.prototype[methodName]; + } + + var decoratedMethod = DecoratorClass.prototype[methodName]; + + return function () { + var unshift = Array.prototype.unshift; + + unshift.call(arguments, originalMethod); + + return decoratedMethod.apply(this, arguments); + }; + }; + + for (var d = 0; d < decoratedMethods.length; d++) { + var decoratedMethod = decoratedMethods[d]; + + DecoratedClass.prototype[decoratedMethod] = calledMethod(decoratedMethod); + } + + return DecoratedClass; + }; + + var Observable = function () { + this.listeners = {}; + }; + + Observable.prototype.on = function (event, callback) { + this.listeners = this.listeners || {}; + + if (event in this.listeners) { + this.listeners[event].push(callback); + } else { + this.listeners[event] = [callback]; + } + }; + + Observable.prototype.trigger = function (event) { + var slice = Array.prototype.slice; + var params = slice.call(arguments, 1); + + this.listeners = this.listeners || {}; + + // Params should always come in as an array + if (params == null) { + params = []; + } + + // If there are no arguments to the event, use a temporary object + if (params.length === 0) { + params.push({}); + } + + // Set the `_type` of the first object to the event + params[0]._type = event; + + if (event in this.listeners) { + this.invoke(this.listeners[event], slice.call(arguments, 1)); + } + + if ('*' in this.listeners) { + this.invoke(this.listeners['*'], arguments); + } + }; + + Observable.prototype.invoke = function (listeners, params) { + for (var i = 0, len = listeners.length; i < len; i++) { + listeners[i].apply(this, params); + } + }; + + Utils.Observable = Observable; + + Utils.generateChars = function (length) { + var chars = ''; + + for (var i = 0; i < length; i++) { + var randomChar = Math.floor(Math.random() * 36); + chars += randomChar.toString(36); + } + + return chars; + }; + + Utils.bind = function (func, context) { + return function () { + func.apply(context, arguments); + }; + }; + + Utils._convertData = function (data) { + for (var originalKey in data) { + var keys = originalKey.split('-'); + + var dataLevel = data; + + if (keys.length === 1) { + continue; + } + + for (var k = 0; k < keys.length; k++) { + var key = keys[k]; + + // Lowercase the first letter + // By default, dash-separated becomes camelCase + key = key.substring(0, 1).toLowerCase() + key.substring(1); + + if (!(key in dataLevel)) { + dataLevel[key] = {}; + } + + if (k == keys.length - 1) { + dataLevel[key] = data[originalKey]; + } + + dataLevel = dataLevel[key]; + } + + delete data[originalKey]; + } + + return data; + }; + + Utils.hasScroll = function (index, el) { + // Adapted from the function created by @ShadowScripter + // and adapted by @BillBarry on the Stack Exchange Code Review website. + // The original code can be found at + // http://codereview.stackexchange.com/q/13338 + // and was designed to be used with the Sizzle selector engine. + + var $el = $(el); + var overflowX = el.style.overflowX; + var overflowY = el.style.overflowY; + + //Check both x and y declarations + if (overflowX === overflowY && + (overflowY === 'hidden' || overflowY === 'visible')) { + return false; + } + + if (overflowX === 'scroll' || overflowY === 'scroll') { + return true; + } + + return ($el.innerHeight() < el.scrollHeight || + $el.innerWidth() < el.scrollWidth); + }; + + Utils.escapeMarkup = function (markup) { + var replaceMap = { + '\\': '\', + '&': '&', + '<': '<', + '>': '>', + '"': '"', + '\'': ''', + '/': '/' + }; + + // Do not try to escape the markup if it's not a string + if (typeof markup !== 'string') { + return markup; + } + + return String(markup).replace(/[&<>"'\/\\]/g, function (match) { + return replaceMap[match]; + }); + }; + + // Append an array of jQuery nodes to a given element. + Utils.appendMany = function ($element, $nodes) { + // jQuery 1.7.x does not support $.fn.append() with an array + // Fall back to a jQuery object collection using $.fn.add() + if ($.fn.jquery.substr(0, 3) === '1.7') { + var $jqNodes = $(); + + $.map($nodes, function (node) { + $jqNodes = $jqNodes.add(node); + }); + + $nodes = $jqNodes; + } + + $element.append($nodes); + }; + + // Cache objects in Utils.__cache instead of $.data (see #4346) + Utils.__cache = {}; + + var id = 0; + Utils.GetUniqueElementId = function (element) { + // Get a unique element Id. If element has no id, + // creates a new unique number, stores it in the id + // attribute and returns the new id. + // If an id already exists, it simply returns it. + + var select2Id = element.getAttribute('data-select2-id'); + if (select2Id == null) { + // If element has id, use it. + if (element.id) { + select2Id = element.id; + element.setAttribute('data-select2-id', select2Id); + } else { + element.setAttribute('data-select2-id', ++id); + select2Id = id.toString(); + } + } + return select2Id; + }; + + Utils.StoreData = function (element, name, value) { + // Stores an item in the cache for a specified element. + // name is the cache key. + var id = Utils.GetUniqueElementId(element); + if (!Utils.__cache[id]) { + Utils.__cache[id] = {}; + } + + Utils.__cache[id][name] = value; + }; + + Utils.GetData = function (element, name) { + // Retrieves a value from the cache by its key (name) + // name is optional. If no name specified, return + // all cache items for the specified element. + // and for a specified element. + var id = Utils.GetUniqueElementId(element); + if (name) { + if (Utils.__cache[id]) { + if (Utils.__cache[id][name] != null) { + return Utils.__cache[id][name]; + } + return $(element).data(name); // Fallback to HTML5 data attribs. + } + return $(element).data(name); // Fallback to HTML5 data attribs. + } else { + return Utils.__cache[id]; + } + }; + + Utils.RemoveData = function (element) { + // Removes all cached items for a specified element. + var id = Utils.GetUniqueElementId(element); + if (Utils.__cache[id] != null) { + delete Utils.__cache[id]; + } + }; + + return Utils; +}); + +S2.define('select2/results',[ + 'jquery', + './utils' +], function ($, Utils) { + function Results ($element, options, dataAdapter) { + this.$element = $element; + this.data = dataAdapter; + this.options = options; + + Results.__super__.constructor.call(this); + } + + Utils.Extend(Results, Utils.Observable); + + Results.prototype.render = function () { + var $results = $( + '
    ' + ); + + if (this.options.get('multiple')) { + $results.attr('aria-multiselectable', 'true'); + } + + this.$results = $results; + + return $results; + }; + + Results.prototype.clear = function () { + this.$results.empty(); + }; + + Results.prototype.displayMessage = function (params) { + var escapeMarkup = this.options.get('escapeMarkup'); + + this.clear(); + this.hideLoading(); + + var $message = $( + '
  • ' + ); + + var message = this.options.get('translations').get(params.message); + + $message.append( + escapeMarkup( + message(params.args) + ) + ); + + $message[0].className += ' select2-results__message'; + + this.$results.append($message); + }; + + Results.prototype.hideMessages = function () { + this.$results.find('.select2-results__message').remove(); + }; + + Results.prototype.append = function (data) { + this.hideLoading(); + + var $options = []; + + if (data.results == null || data.results.length === 0) { + if (this.$results.children().length === 0) { + this.trigger('results:message', { + message: 'noResults' + }); + } + + return; + } + + data.results = this.sort(data.results); + + for (var d = 0; d < data.results.length; d++) { + var item = data.results[d]; + + var $option = this.option(item); + + $options.push($option); + } + + this.$results.append($options); + }; + + Results.prototype.position = function ($results, $dropdown) { + var $resultsContainer = $dropdown.find('.select2-results'); + $resultsContainer.append($results); + }; + + Results.prototype.sort = function (data) { + var sorter = this.options.get('sorter'); + + return sorter(data); + }; + + Results.prototype.highlightFirstItem = function () { + var $options = this.$results + .find('.select2-results__option[aria-selected]'); + + var $selected = $options.filter('[aria-selected=true]'); + + // Check if there are any selected options + if ($selected.length > 0) { + // If there are selected options, highlight the first + $selected.first().trigger('mouseenter'); + } else { + // If there are no selected options, highlight the first option + // in the dropdown + $options.first().trigger('mouseenter'); + } + + this.ensureHighlightVisible(); + }; + + Results.prototype.setClasses = function () { + var self = this; + + this.data.current(function (selected) { + var selectedIds = $.map(selected, function (s) { + return s.id.toString(); + }); + + var $options = self.$results + .find('.select2-results__option[aria-selected]'); + + $options.each(function () { + var $option = $(this); + + var item = Utils.GetData(this, 'data'); + + // id needs to be converted to a string when comparing + var id = '' + item.id; + + if ((item.element != null && item.element.selected) || + (item.element == null && $.inArray(id, selectedIds) > -1)) { + $option.attr('aria-selected', 'true'); + } else { + $option.attr('aria-selected', 'false'); + } + }); + + }); + }; + + Results.prototype.showLoading = function (params) { + this.hideLoading(); + + var loadingMore = this.options.get('translations').get('searching'); + + var loading = { + disabled: true, + loading: true, + text: loadingMore(params) + }; + var $loading = this.option(loading); + $loading.className += ' loading-results'; + + this.$results.prepend($loading); + }; + + Results.prototype.hideLoading = function () { + this.$results.find('.loading-results').remove(); + }; + + Results.prototype.option = function (data) { + var option = document.createElement('li'); + option.className = 'select2-results__option'; + + var attrs = { + 'role': 'treeitem', + 'aria-selected': 'false' + }; + + var matches = window.Element.prototype.matches || + window.Element.prototype.msMatchesSelector || + window.Element.prototype.webkitMatchesSelector; + + if ((data.element != null && matches.call(data.element, ':disabled')) || + (data.element == null && data.disabled)) { + delete attrs['aria-selected']; + attrs['aria-disabled'] = 'true'; + } + + if (data.id == null) { + delete attrs['aria-selected']; + } + + if (data._resultId != null) { + option.id = data._resultId; + } + + if (data.title) { + option.title = data.title; + } + + if (data.children) { + attrs.role = 'group'; + attrs['aria-label'] = data.text; + delete attrs['aria-selected']; + } + + for (var attr in attrs) { + var val = attrs[attr]; + + option.setAttribute(attr, val); + } + + if (data.children) { + var $option = $(option); + + var label = document.createElement('strong'); + label.className = 'select2-results__group'; + + var $label = $(label); + this.template(data, label); + + var $children = []; + + for (var c = 0; c < data.children.length; c++) { + var child = data.children[c]; + + var $child = this.option(child); + + $children.push($child); + } + + var $childrenContainer = $('
      ', { + 'class': 'select2-results__options select2-results__options--nested' + }); + + $childrenContainer.append($children); + + $option.append(label); + $option.append($childrenContainer); + } else { + this.template(data, option); + } + + Utils.StoreData(option, 'data', data); + + return option; + }; + + Results.prototype.bind = function (container, $container) { + var self = this; + + var id = container.id + '-results'; + + this.$results.attr('id', id); + + container.on('results:all', function (params) { + self.clear(); + self.append(params.data); + + if (container.isOpen()) { + self.setClasses(); + self.highlightFirstItem(); + } + }); + + container.on('results:append', function (params) { + self.append(params.data); + + if (container.isOpen()) { + self.setClasses(); + } + }); + + container.on('query', function (params) { + self.hideMessages(); + self.showLoading(params); + }); + + container.on('select', function () { + if (!container.isOpen()) { + return; + } + + self.setClasses(); + + if (self.options.get('scrollAfterSelect')) { + self.highlightFirstItem(); + } + }); + + container.on('unselect', function () { + if (!container.isOpen()) { + return; + } + + self.setClasses(); + + if (self.options.get('scrollAfterSelect')) { + self.highlightFirstItem(); + } + }); + + container.on('open', function () { + // When the dropdown is open, aria-expended="true" + self.$results.attr('aria-expanded', 'true'); + self.$results.attr('aria-hidden', 'false'); + + self.setClasses(); + self.ensureHighlightVisible(); + }); + + container.on('close', function () { + // When the dropdown is closed, aria-expended="false" + self.$results.attr('aria-expanded', 'false'); + self.$results.attr('aria-hidden', 'true'); + self.$results.removeAttr('aria-activedescendant'); + }); + + container.on('results:toggle', function () { + var $highlighted = self.getHighlightedResults(); + + if ($highlighted.length === 0) { + return; + } + + $highlighted.trigger('mouseup'); + }); + + container.on('results:select', function () { + var $highlighted = self.getHighlightedResults(); + + if ($highlighted.length === 0) { + return; + } + + var data = Utils.GetData($highlighted[0], 'data'); + + if ($highlighted.attr('aria-selected') == 'true') { + self.trigger('close', {}); + } else { + self.trigger('select', { + data: data + }); + } + }); + + container.on('results:previous', function () { + var $highlighted = self.getHighlightedResults(); + + var $options = self.$results.find('[aria-selected]'); + + var currentIndex = $options.index($highlighted); + + // If we are already at the top, don't move further + // If no options, currentIndex will be -1 + if (currentIndex <= 0) { + return; + } + + var nextIndex = currentIndex - 1; + + // If none are highlighted, highlight the first + if ($highlighted.length === 0) { + nextIndex = 0; + } + + var $next = $options.eq(nextIndex); + + $next.trigger('mouseenter'); + + var currentOffset = self.$results.offset().top; + var nextTop = $next.offset().top; + var nextOffset = self.$results.scrollTop() + (nextTop - currentOffset); + + if (nextIndex === 0) { + self.$results.scrollTop(0); + } else if (nextTop - currentOffset < 0) { + self.$results.scrollTop(nextOffset); + } + }); + + container.on('results:next', function () { + var $highlighted = self.getHighlightedResults(); + + var $options = self.$results.find('[aria-selected]'); + + var currentIndex = $options.index($highlighted); + + var nextIndex = currentIndex + 1; + + // If we are at the last option, stay there + if (nextIndex >= $options.length) { + return; + } + + var $next = $options.eq(nextIndex); + + $next.trigger('mouseenter'); + + var currentOffset = self.$results.offset().top + + self.$results.outerHeight(false); + var nextBottom = $next.offset().top + $next.outerHeight(false); + var nextOffset = self.$results.scrollTop() + nextBottom - currentOffset; + + if (nextIndex === 0) { + self.$results.scrollTop(0); + } else if (nextBottom > currentOffset) { + self.$results.scrollTop(nextOffset); + } + }); + + container.on('results:focus', function (params) { + params.element.addClass('select2-results__option--highlighted'); + }); + + container.on('results:message', function (params) { + self.displayMessage(params); + }); + + if ($.fn.mousewheel) { + this.$results.on('mousewheel', function (e) { + var top = self.$results.scrollTop(); + + var bottom = self.$results.get(0).scrollHeight - top + e.deltaY; + + var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0; + var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height(); + + if (isAtTop) { + self.$results.scrollTop(0); + + e.preventDefault(); + e.stopPropagation(); + } else if (isAtBottom) { + self.$results.scrollTop( + self.$results.get(0).scrollHeight - self.$results.height() + ); + + e.preventDefault(); + e.stopPropagation(); + } + }); + } + + this.$results.on('mouseup', '.select2-results__option[aria-selected]', + function (evt) { + var $this = $(this); + + var data = Utils.GetData(this, 'data'); + + if ($this.attr('aria-selected') === 'true') { + if (self.options.get('multiple')) { + self.trigger('unselect', { + originalEvent: evt, + data: data + }); + } else { + self.trigger('close', {}); + } + + return; + } + + self.trigger('select', { + originalEvent: evt, + data: data + }); + }); + + this.$results.on('mouseenter', '.select2-results__option[aria-selected]', + function (evt) { + var data = Utils.GetData(this, 'data'); + + self.getHighlightedResults() + .removeClass('select2-results__option--highlighted'); + + self.trigger('results:focus', { + data: data, + element: $(this) + }); + }); + }; + + Results.prototype.getHighlightedResults = function () { + var $highlighted = this.$results + .find('.select2-results__option--highlighted'); + + return $highlighted; + }; + + Results.prototype.destroy = function () { + this.$results.remove(); + }; + + Results.prototype.ensureHighlightVisible = function () { + var $highlighted = this.getHighlightedResults(); + + if ($highlighted.length === 0) { + return; + } + + var $options = this.$results.find('[aria-selected]'); + + var currentIndex = $options.index($highlighted); + + var currentOffset = this.$results.offset().top; + var nextTop = $highlighted.offset().top; + var nextOffset = this.$results.scrollTop() + (nextTop - currentOffset); + + var offsetDelta = nextTop - currentOffset; + nextOffset -= $highlighted.outerHeight(false) * 2; + + if (currentIndex <= 2) { + this.$results.scrollTop(0); + } else if (offsetDelta > this.$results.outerHeight() || offsetDelta < 0) { + this.$results.scrollTop(nextOffset); + } + }; + + Results.prototype.template = function (result, container) { + var template = this.options.get('templateResult'); + var escapeMarkup = this.options.get('escapeMarkup'); + + var content = template(result, container); + + if (content == null) { + container.style.display = 'none'; + } else if (typeof content === 'string') { + container.innerHTML = escapeMarkup(content); + } else { + $(container).append(content); + } + }; + + return Results; +}); + +S2.define('select2/keys',[ + +], function () { + var KEYS = { + BACKSPACE: 8, + TAB: 9, + ENTER: 13, + SHIFT: 16, + CTRL: 17, + ALT: 18, + ESC: 27, + SPACE: 32, + PAGE_UP: 33, + PAGE_DOWN: 34, + END: 35, + HOME: 36, + LEFT: 37, + UP: 38, + RIGHT: 39, + DOWN: 40, + DELETE: 46 + }; + + return KEYS; +}); + +S2.define('select2/selection/base',[ + 'jquery', + '../utils', + '../keys' +], function ($, Utils, KEYS) { + function BaseSelection ($element, options) { + this.$element = $element; + this.options = options; + + BaseSelection.__super__.constructor.call(this); + } + + Utils.Extend(BaseSelection, Utils.Observable); + + BaseSelection.prototype.render = function () { + var $selection = $( + '' + ); + + this._tabindex = 0; + + if (Utils.GetData(this.$element[0], 'old-tabindex') != null) { + this._tabindex = Utils.GetData(this.$element[0], 'old-tabindex'); + } else if (this.$element.attr('tabindex') != null) { + this._tabindex = this.$element.attr('tabindex'); + } + + $selection.attr('title', this.$element.attr('title')); + $selection.attr('tabindex', this._tabindex); + + this.$selection = $selection; + + return $selection; + }; + + BaseSelection.prototype.bind = function (container, $container) { + var self = this; + + var id = container.id + '-container'; + var resultsId = container.id + '-results'; + + this.container = container; + + this.$selection.on('focus', function (evt) { + self.trigger('focus', evt); + }); + + this.$selection.on('blur', function (evt) { + self._handleBlur(evt); + }); + + this.$selection.on('keydown', function (evt) { + self.trigger('keypress', evt); + + if (evt.which === KEYS.SPACE) { + evt.preventDefault(); + } + }); + + container.on('results:focus', function (params) { + self.$selection.attr('aria-activedescendant', params.data._resultId); + }); + + container.on('selection:update', function (params) { + self.update(params.data); + }); + + container.on('open', function () { + // When the dropdown is open, aria-expanded="true" + self.$selection.attr('aria-expanded', 'true'); + self.$selection.attr('aria-owns', resultsId); + + self._attachCloseHandler(container); + }); + + container.on('close', function () { + // When the dropdown is closed, aria-expanded="false" + self.$selection.attr('aria-expanded', 'false'); + self.$selection.removeAttr('aria-activedescendant'); + self.$selection.removeAttr('aria-owns'); + + self.$selection.trigger('focus'); + + self._detachCloseHandler(container); + }); + + container.on('enable', function () { + self.$selection.attr('tabindex', self._tabindex); + }); + + container.on('disable', function () { + self.$selection.attr('tabindex', '-1'); + }); + }; + + BaseSelection.prototype._handleBlur = function (evt) { + var self = this; + + // This needs to be delayed as the active element is the body when the tab + // key is pressed, possibly along with others. + window.setTimeout(function () { + // Don't trigger `blur` if the focus is still in the selection + if ( + (document.activeElement == self.$selection[0]) || + ($.contains(self.$selection[0], document.activeElement)) + ) { + return; + } + + self.trigger('blur', evt); + }, 1); + }; + + BaseSelection.prototype._attachCloseHandler = function (container) { + var self = this; + + $(document.body).on('mousedown.select2.' + container.id, function (e) { + var $target = $(e.target); + + var $select = $target.closest('.select2'); + + var $all = $('.select2.select2-container--open'); + + $all.each(function () { + var $this = $(this); + + if (this == $select[0]) { + return; + } + + var $element = Utils.GetData(this, 'element'); + + $element.select2('close'); + }); + }); + }; + + BaseSelection.prototype._detachCloseHandler = function (container) { + $(document.body).off('mousedown.select2.' + container.id); + }; + + BaseSelection.prototype.position = function ($selection, $container) { + var $selectionContainer = $container.find('.selection'); + $selectionContainer.append($selection); + }; + + BaseSelection.prototype.destroy = function () { + this._detachCloseHandler(this.container); + }; + + BaseSelection.prototype.update = function (data) { + throw new Error('The `update` method must be defined in child classes.'); + }; + + return BaseSelection; +}); + +S2.define('select2/selection/single',[ + 'jquery', + './base', + '../utils', + '../keys' +], function ($, BaseSelection, Utils, KEYS) { + function SingleSelection () { + SingleSelection.__super__.constructor.apply(this, arguments); + } + + Utils.Extend(SingleSelection, BaseSelection); + + SingleSelection.prototype.render = function () { + var $selection = SingleSelection.__super__.render.call(this); + + $selection.addClass('select2-selection--single'); + + $selection.html( + '' + + '' + + '' + + '' + ); + + return $selection; + }; + + SingleSelection.prototype.bind = function (container, $container) { + var self = this; + + SingleSelection.__super__.bind.apply(this, arguments); + + var id = container.id + '-container'; + + this.$selection.find('.select2-selection__rendered') + .attr('id', id) + .attr('role', 'textbox') + .attr('aria-readonly', 'true'); + this.$selection.attr('aria-labelledby', id); + + this.$selection.on('mousedown', function (evt) { + // Only respond to left clicks + if (evt.which !== 1) { + return; + } + + self.trigger('toggle', { + originalEvent: evt + }); + }); + + this.$selection.on('focus', function (evt) { + // User focuses on the container + }); + + this.$selection.on('blur', function (evt) { + // User exits the container + }); + + container.on('focus', function (evt) { + if (!container.isOpen()) { + self.$selection.trigger('focus'); + } + }); + }; + + SingleSelection.prototype.clear = function () { + var $rendered = this.$selection.find('.select2-selection__rendered'); + $rendered.empty(); + $rendered.removeAttr('title'); // clear tooltip on empty + }; + + SingleSelection.prototype.display = function (data, container) { + var template = this.options.get('templateSelection'); + var escapeMarkup = this.options.get('escapeMarkup'); + + return escapeMarkup(template(data, container)); + }; + + SingleSelection.prototype.selectionContainer = function () { + return $(''); + }; + + SingleSelection.prototype.update = function (data) { + if (data.length === 0) { + this.clear(); + return; + } + + var selection = data[0]; + + var $rendered = this.$selection.find('.select2-selection__rendered'); + var formatted = this.display(selection, $rendered); + + $rendered.empty().append(formatted); + $rendered.attr('title', selection.title || selection.text); + }; + + return SingleSelection; +}); + +S2.define('select2/selection/multiple',[ + 'jquery', + './base', + '../utils' +], function ($, BaseSelection, Utils) { + function MultipleSelection ($element, options) { + MultipleSelection.__super__.constructor.apply(this, arguments); + } + + Utils.Extend(MultipleSelection, BaseSelection); + + MultipleSelection.prototype.render = function () { + var $selection = MultipleSelection.__super__.render.call(this); + + $selection.addClass('select2-selection--multiple'); + + $selection.html( + '
        ' + ); + + return $selection; + }; + + MultipleSelection.prototype.bind = function (container, $container) { + var self = this; + + MultipleSelection.__super__.bind.apply(this, arguments); + + this.$selection.on('click', function (evt) { + self.trigger('toggle', { + originalEvent: evt + }); + }); + + this.$selection.on( + 'click', + '.select2-selection__choice__remove', + function (evt) { + // Ignore the event if it is disabled + if (self.options.get('disabled')) { + return; + } + + var $remove = $(this); + var $selection = $remove.parent(); + + var data = Utils.GetData($selection[0], 'data'); + + self.trigger('unselect', { + originalEvent: evt, + data: data + }); + } + ); + }; + + MultipleSelection.prototype.clear = function () { + var $rendered = this.$selection.find('.select2-selection__rendered'); + $rendered.empty(); + $rendered.removeAttr('title'); + }; + + MultipleSelection.prototype.display = function (data, container) { + var template = this.options.get('templateSelection'); + var escapeMarkup = this.options.get('escapeMarkup'); + + return escapeMarkup(template(data, container)); + }; + + MultipleSelection.prototype.selectionContainer = function () { + var $container = $( + '
      • ' + + '' + + '×' + + '' + + '
      • ' + ); + + return $container; + }; + + MultipleSelection.prototype.update = function (data) { + this.clear(); + + if (data.length === 0) { + return; + } + + var $selections = []; + + for (var d = 0; d < data.length; d++) { + var selection = data[d]; + + var $selection = this.selectionContainer(); + var formatted = this.display(selection, $selection); + + $selection.append(formatted); + $selection.attr('title', selection.title || selection.text); + + Utils.StoreData($selection[0], 'data', selection); + + $selections.push($selection); + } + + var $rendered = this.$selection.find('.select2-selection__rendered'); + + Utils.appendMany($rendered, $selections); + }; + + return MultipleSelection; +}); + +S2.define('select2/selection/placeholder',[ + '../utils' +], function (Utils) { + function Placeholder (decorated, $element, options) { + this.placeholder = this.normalizePlaceholder(options.get('placeholder')); + + decorated.call(this, $element, options); + } + + Placeholder.prototype.normalizePlaceholder = function (_, placeholder) { + if (typeof placeholder === 'string') { + placeholder = { + id: '', + text: placeholder + }; + } + + return placeholder; + }; + + Placeholder.prototype.createPlaceholder = function (decorated, placeholder) { + var $placeholder = this.selectionContainer(); + + $placeholder.html(this.display(placeholder)); + $placeholder.addClass('select2-selection__placeholder') + .removeClass('select2-selection__choice'); + + return $placeholder; + }; + + Placeholder.prototype.update = function (decorated, data) { + var singlePlaceholder = ( + data.length == 1 && data[0].id != this.placeholder.id + ); + var multipleSelections = data.length > 1; + + if (multipleSelections || singlePlaceholder) { + return decorated.call(this, data); + } + + this.clear(); + + var $placeholder = this.createPlaceholder(this.placeholder); + + this.$selection.find('.select2-selection__rendered').append($placeholder); + }; + + return Placeholder; +}); + +S2.define('select2/selection/allowClear',[ + 'jquery', + '../keys', + '../utils' +], function ($, KEYS, Utils) { + function AllowClear () { } + + AllowClear.prototype.bind = function (decorated, container, $container) { + var self = this; + + decorated.call(this, container, $container); + + if (this.placeholder == null) { + if (this.options.get('debug') && window.console && console.error) { + console.error( + 'Select2: The `allowClear` option should be used in combination ' + + 'with the `placeholder` option.' + ); + } + } + + this.$selection.on('mousedown', '.select2-selection__clear', + function (evt) { + self._handleClear(evt); + }); + + container.on('keypress', function (evt) { + self._handleKeyboardClear(evt, container); + }); + }; + + AllowClear.prototype._handleClear = function (_, evt) { + // Ignore the event if it is disabled + if (this.options.get('disabled')) { + return; + } + + var $clear = this.$selection.find('.select2-selection__clear'); + + // Ignore the event if nothing has been selected + if ($clear.length === 0) { + return; + } + + evt.stopPropagation(); + + var data = Utils.GetData($clear[0], 'data'); + + var previousVal = this.$element.val(); + this.$element.val(this.placeholder.id); + + var unselectData = { + data: data + }; + this.trigger('clear', unselectData); + if (unselectData.prevented) { + this.$element.val(previousVal); + return; + } + + for (var d = 0; d < data.length; d++) { + unselectData = { + data: data[d] + }; + + // Trigger the `unselect` event, so people can prevent it from being + // cleared. + this.trigger('unselect', unselectData); + + // If the event was prevented, don't clear it out. + if (unselectData.prevented) { + this.$element.val(previousVal); + return; + } + } + + this.$element.trigger('change'); + + this.trigger('toggle', {}); + }; + + AllowClear.prototype._handleKeyboardClear = function (_, evt, container) { + if (container.isOpen()) { + return; + } + + if (evt.which == KEYS.DELETE || evt.which == KEYS.BACKSPACE) { + this._handleClear(evt); + } + }; + + AllowClear.prototype.update = function (decorated, data) { + decorated.call(this, data); + + if (this.$selection.find('.select2-selection__placeholder').length > 0 || + data.length === 0) { + return; + } + + var removeAll = this.options.get('translations').get('removeAllItems'); + + var $remove = $( + '' + + '×' + + '' + ); + Utils.StoreData($remove[0], 'data', data); + + this.$selection.find('.select2-selection__rendered').prepend($remove); + }; + + return AllowClear; +}); + +S2.define('select2/selection/search',[ + 'jquery', + '../utils', + '../keys' +], function ($, Utils, KEYS) { + function Search (decorated, $element, options) { + decorated.call(this, $element, options); + } + + Search.prototype.render = function (decorated) { + var $search = $( + '' + ); + + this.$searchContainer = $search; + this.$search = $search.find('input'); + + var $rendered = decorated.call(this); + + this._transferTabIndex(); + + return $rendered; + }; + + Search.prototype.bind = function (decorated, container, $container) { + var self = this; + + decorated.call(this, container, $container); + + container.on('open', function () { + self.$search.trigger('focus'); + }); + + container.on('close', function () { + self.$search.val(''); + self.$search.removeAttr('aria-activedescendant'); + self.$search.trigger('focus'); + }); + + container.on('enable', function () { + self.$search.prop('disabled', false); + + self._transferTabIndex(); + }); + + container.on('disable', function () { + self.$search.prop('disabled', true); + }); + + container.on('focus', function (evt) { + self.$search.trigger('focus'); + }); + + container.on('results:focus', function (params) { + self.$search.attr('aria-activedescendant', params.id); + }); + + this.$selection.on('focusin', '.select2-search--inline', function (evt) { + self.trigger('focus', evt); + }); + + this.$selection.on('focusout', '.select2-search--inline', function (evt) { + self._handleBlur(evt); + }); + + this.$selection.on('keydown', '.select2-search--inline', function (evt) { + evt.stopPropagation(); + + self.trigger('keypress', evt); + + self._keyUpPrevented = evt.isDefaultPrevented(); + + var key = evt.which; + + if (key === KEYS.BACKSPACE && self.$search.val() === '') { + var $previousChoice = self.$searchContainer + .prev('.select2-selection__choice'); + + if ($previousChoice.length > 0) { + var item = Utils.GetData($previousChoice[0], 'data'); + + self.searchRemoveChoice(item); + + evt.preventDefault(); + } + } + }); + + // Try to detect the IE version should the `documentMode` property that + // is stored on the document. This is only implemented in IE and is + // slightly cleaner than doing a user agent check. + // This property is not available in Edge, but Edge also doesn't have + // this bug. + var msie = document.documentMode; + var disableInputEvents = msie && msie <= 11; + + // Workaround for browsers which do not support the `input` event + // This will prevent double-triggering of events for browsers which support + // both the `keyup` and `input` events. + this.$selection.on( + 'input.searchcheck', + '.select2-search--inline', + function (evt) { + // IE will trigger the `input` event when a placeholder is used on a + // search box. To get around this issue, we are forced to ignore all + // `input` events in IE and keep using `keyup`. + if (disableInputEvents) { + self.$selection.off('input.search input.searchcheck'); + return; + } + + // Unbind the duplicated `keyup` event + self.$selection.off('keyup.search'); + } + ); + + this.$selection.on( + 'keyup.search input.search', + '.select2-search--inline', + function (evt) { + // IE will trigger the `input` event when a placeholder is used on a + // search box. To get around this issue, we are forced to ignore all + // `input` events in IE and keep using `keyup`. + if (disableInputEvents && evt.type === 'input') { + self.$selection.off('input.search input.searchcheck'); + return; + } + + var key = evt.which; + + // We can freely ignore events from modifier keys + if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) { + return; + } + + // Tabbing will be handled during the `keydown` phase + if (key == KEYS.TAB) { + return; + } + + self.handleSearch(evt); + } + ); + }; + + /** + * This method will transfer the tabindex attribute from the rendered + * selection to the search box. This allows for the search box to be used as + * the primary focus instead of the selection container. + * + * @private + */ + Search.prototype._transferTabIndex = function (decorated) { + this.$search.attr('tabindex', this.$selection.attr('tabindex')); + this.$selection.attr('tabindex', '-1'); + }; + + Search.prototype.createPlaceholder = function (decorated, placeholder) { + this.$search.attr('placeholder', placeholder.text); + }; + + Search.prototype.update = function (decorated, data) { + var searchHadFocus = this.$search[0] == document.activeElement; + + this.$search.attr('placeholder', ''); + + decorated.call(this, data); + + this.$selection.find('.select2-selection__rendered') + .append(this.$searchContainer); + + this.resizeSearch(); + if (searchHadFocus) { + this.$search.trigger('focus'); + } + }; + + Search.prototype.handleSearch = function () { + this.resizeSearch(); + + if (!this._keyUpPrevented) { + var input = this.$search.val(); + + this.trigger('query', { + term: input + }); + } + + this._keyUpPrevented = false; + }; + + Search.prototype.searchRemoveChoice = function (decorated, item) { + this.trigger('unselect', { + data: item + }); + + this.$search.val(item.text); + this.handleSearch(); + }; + + Search.prototype.resizeSearch = function () { + this.$search.css('width', '25px'); + + var width = ''; + + if (this.$search.attr('placeholder') !== '') { + width = this.$selection.find('.select2-selection__rendered').innerWidth(); + } else { + var minimumWidth = this.$search.val().length + 1; + + width = (minimumWidth * 0.75) + 'em'; + } + + this.$search.css('width', width); + }; + + return Search; +}); + +S2.define('select2/selection/eventRelay',[ + 'jquery' +], function ($) { + function EventRelay () { } + + EventRelay.prototype.bind = function (decorated, container, $container) { + var self = this; + var relayEvents = [ + 'open', 'opening', + 'close', 'closing', + 'select', 'selecting', + 'unselect', 'unselecting', + 'clear', 'clearing' + ]; + + var preventableEvents = [ + 'opening', 'closing', 'selecting', 'unselecting', 'clearing' + ]; + + decorated.call(this, container, $container); + + container.on('*', function (name, params) { + // Ignore events that should not be relayed + if ($.inArray(name, relayEvents) === -1) { + return; + } + + // The parameters should always be an object + params = params || {}; + + // Generate the jQuery event for the Select2 event + var evt = $.Event('select2:' + name, { + params: params + }); + + self.$element.trigger(evt); + + // Only handle preventable events if it was one + if ($.inArray(name, preventableEvents) === -1) { + return; + } + + params.prevented = evt.isDefaultPrevented(); + }); + }; + + return EventRelay; +}); + +S2.define('select2/translation',[ + 'jquery', + 'require' +], function ($, require) { + function Translation (dict) { + this.dict = dict || {}; + } + + Translation.prototype.all = function () { + return this.dict; + }; + + Translation.prototype.get = function (key) { + return this.dict[key]; + }; + + Translation.prototype.extend = function (translation) { + this.dict = $.extend({}, translation.all(), this.dict); + }; + + // Static functions + + Translation._cache = {}; + + Translation.loadPath = function (path) { + if (!(path in Translation._cache)) { + var translations = require(path); + + Translation._cache[path] = translations; + } + + return new Translation(Translation._cache[path]); + }; + + return Translation; +}); + +S2.define('select2/diacritics',[ + +], function () { + var diacritics = { + '\u24B6': 'A', + '\uFF21': 'A', + '\u00C0': 'A', + '\u00C1': 'A', + '\u00C2': 'A', + '\u1EA6': 'A', + '\u1EA4': 'A', + '\u1EAA': 'A', + '\u1EA8': 'A', + '\u00C3': 'A', + '\u0100': 'A', + '\u0102': 'A', + '\u1EB0': 'A', + '\u1EAE': 'A', + '\u1EB4': 'A', + '\u1EB2': 'A', + '\u0226': 'A', + '\u01E0': 'A', + '\u00C4': 'A', + '\u01DE': 'A', + '\u1EA2': 'A', + '\u00C5': 'A', + '\u01FA': 'A', + '\u01CD': 'A', + '\u0200': 'A', + '\u0202': 'A', + '\u1EA0': 'A', + '\u1EAC': 'A', + '\u1EB6': 'A', + '\u1E00': 'A', + '\u0104': 'A', + '\u023A': 'A', + '\u2C6F': 'A', + '\uA732': 'AA', + '\u00C6': 'AE', + '\u01FC': 'AE', + '\u01E2': 'AE', + '\uA734': 'AO', + '\uA736': 'AU', + '\uA738': 'AV', + '\uA73A': 'AV', + '\uA73C': 'AY', + '\u24B7': 'B', + '\uFF22': 'B', + '\u1E02': 'B', + '\u1E04': 'B', + '\u1E06': 'B', + '\u0243': 'B', + '\u0182': 'B', + '\u0181': 'B', + '\u24B8': 'C', + '\uFF23': 'C', + '\u0106': 'C', + '\u0108': 'C', + '\u010A': 'C', + '\u010C': 'C', + '\u00C7': 'C', + '\u1E08': 'C', + '\u0187': 'C', + '\u023B': 'C', + '\uA73E': 'C', + '\u24B9': 'D', + '\uFF24': 'D', + '\u1E0A': 'D', + '\u010E': 'D', + '\u1E0C': 'D', + '\u1E10': 'D', + '\u1E12': 'D', + '\u1E0E': 'D', + '\u0110': 'D', + '\u018B': 'D', + '\u018A': 'D', + '\u0189': 'D', + '\uA779': 'D', + '\u01F1': 'DZ', + '\u01C4': 'DZ', + '\u01F2': 'Dz', + '\u01C5': 'Dz', + '\u24BA': 'E', + '\uFF25': 'E', + '\u00C8': 'E', + '\u00C9': 'E', + '\u00CA': 'E', + '\u1EC0': 'E', + '\u1EBE': 'E', + '\u1EC4': 'E', + '\u1EC2': 'E', + '\u1EBC': 'E', + '\u0112': 'E', + '\u1E14': 'E', + '\u1E16': 'E', + '\u0114': 'E', + '\u0116': 'E', + '\u00CB': 'E', + '\u1EBA': 'E', + '\u011A': 'E', + '\u0204': 'E', + '\u0206': 'E', + '\u1EB8': 'E', + '\u1EC6': 'E', + '\u0228': 'E', + '\u1E1C': 'E', + '\u0118': 'E', + '\u1E18': 'E', + '\u1E1A': 'E', + '\u0190': 'E', + '\u018E': 'E', + '\u24BB': 'F', + '\uFF26': 'F', + '\u1E1E': 'F', + '\u0191': 'F', + '\uA77B': 'F', + '\u24BC': 'G', + '\uFF27': 'G', + '\u01F4': 'G', + '\u011C': 'G', + '\u1E20': 'G', + '\u011E': 'G', + '\u0120': 'G', + '\u01E6': 'G', + '\u0122': 'G', + '\u01E4': 'G', + '\u0193': 'G', + '\uA7A0': 'G', + '\uA77D': 'G', + '\uA77E': 'G', + '\u24BD': 'H', + '\uFF28': 'H', + '\u0124': 'H', + '\u1E22': 'H', + '\u1E26': 'H', + '\u021E': 'H', + '\u1E24': 'H', + '\u1E28': 'H', + '\u1E2A': 'H', + '\u0126': 'H', + '\u2C67': 'H', + '\u2C75': 'H', + '\uA78D': 'H', + '\u24BE': 'I', + '\uFF29': 'I', + '\u00CC': 'I', + '\u00CD': 'I', + '\u00CE': 'I', + '\u0128': 'I', + '\u012A': 'I', + '\u012C': 'I', + '\u0130': 'I', + '\u00CF': 'I', + '\u1E2E': 'I', + '\u1EC8': 'I', + '\u01CF': 'I', + '\u0208': 'I', + '\u020A': 'I', + '\u1ECA': 'I', + '\u012E': 'I', + '\u1E2C': 'I', + '\u0197': 'I', + '\u24BF': 'J', + '\uFF2A': 'J', + '\u0134': 'J', + '\u0248': 'J', + '\u24C0': 'K', + '\uFF2B': 'K', + '\u1E30': 'K', + '\u01E8': 'K', + '\u1E32': 'K', + '\u0136': 'K', + '\u1E34': 'K', + '\u0198': 'K', + '\u2C69': 'K', + '\uA740': 'K', + '\uA742': 'K', + '\uA744': 'K', + '\uA7A2': 'K', + '\u24C1': 'L', + '\uFF2C': 'L', + '\u013F': 'L', + '\u0139': 'L', + '\u013D': 'L', + '\u1E36': 'L', + '\u1E38': 'L', + '\u013B': 'L', + '\u1E3C': 'L', + '\u1E3A': 'L', + '\u0141': 'L', + '\u023D': 'L', + '\u2C62': 'L', + '\u2C60': 'L', + '\uA748': 'L', + '\uA746': 'L', + '\uA780': 'L', + '\u01C7': 'LJ', + '\u01C8': 'Lj', + '\u24C2': 'M', + '\uFF2D': 'M', + '\u1E3E': 'M', + '\u1E40': 'M', + '\u1E42': 'M', + '\u2C6E': 'M', + '\u019C': 'M', + '\u24C3': 'N', + '\uFF2E': 'N', + '\u01F8': 'N', + '\u0143': 'N', + '\u00D1': 'N', + '\u1E44': 'N', + '\u0147': 'N', + '\u1E46': 'N', + '\u0145': 'N', + '\u1E4A': 'N', + '\u1E48': 'N', + '\u0220': 'N', + '\u019D': 'N', + '\uA790': 'N', + '\uA7A4': 'N', + '\u01CA': 'NJ', + '\u01CB': 'Nj', + '\u24C4': 'O', + '\uFF2F': 'O', + '\u00D2': 'O', + '\u00D3': 'O', + '\u00D4': 'O', + '\u1ED2': 'O', + '\u1ED0': 'O', + '\u1ED6': 'O', + '\u1ED4': 'O', + '\u00D5': 'O', + '\u1E4C': 'O', + '\u022C': 'O', + '\u1E4E': 'O', + '\u014C': 'O', + '\u1E50': 'O', + '\u1E52': 'O', + '\u014E': 'O', + '\u022E': 'O', + '\u0230': 'O', + '\u00D6': 'O', + '\u022A': 'O', + '\u1ECE': 'O', + '\u0150': 'O', + '\u01D1': 'O', + '\u020C': 'O', + '\u020E': 'O', + '\u01A0': 'O', + '\u1EDC': 'O', + '\u1EDA': 'O', + '\u1EE0': 'O', + '\u1EDE': 'O', + '\u1EE2': 'O', + '\u1ECC': 'O', + '\u1ED8': 'O', + '\u01EA': 'O', + '\u01EC': 'O', + '\u00D8': 'O', + '\u01FE': 'O', + '\u0186': 'O', + '\u019F': 'O', + '\uA74A': 'O', + '\uA74C': 'O', + '\u0152': 'OE', + '\u01A2': 'OI', + '\uA74E': 'OO', + '\u0222': 'OU', + '\u24C5': 'P', + '\uFF30': 'P', + '\u1E54': 'P', + '\u1E56': 'P', + '\u01A4': 'P', + '\u2C63': 'P', + '\uA750': 'P', + '\uA752': 'P', + '\uA754': 'P', + '\u24C6': 'Q', + '\uFF31': 'Q', + '\uA756': 'Q', + '\uA758': 'Q', + '\u024A': 'Q', + '\u24C7': 'R', + '\uFF32': 'R', + '\u0154': 'R', + '\u1E58': 'R', + '\u0158': 'R', + '\u0210': 'R', + '\u0212': 'R', + '\u1E5A': 'R', + '\u1E5C': 'R', + '\u0156': 'R', + '\u1E5E': 'R', + '\u024C': 'R', + '\u2C64': 'R', + '\uA75A': 'R', + '\uA7A6': 'R', + '\uA782': 'R', + '\u24C8': 'S', + '\uFF33': 'S', + '\u1E9E': 'S', + '\u015A': 'S', + '\u1E64': 'S', + '\u015C': 'S', + '\u1E60': 'S', + '\u0160': 'S', + '\u1E66': 'S', + '\u1E62': 'S', + '\u1E68': 'S', + '\u0218': 'S', + '\u015E': 'S', + '\u2C7E': 'S', + '\uA7A8': 'S', + '\uA784': 'S', + '\u24C9': 'T', + '\uFF34': 'T', + '\u1E6A': 'T', + '\u0164': 'T', + '\u1E6C': 'T', + '\u021A': 'T', + '\u0162': 'T', + '\u1E70': 'T', + '\u1E6E': 'T', + '\u0166': 'T', + '\u01AC': 'T', + '\u01AE': 'T', + '\u023E': 'T', + '\uA786': 'T', + '\uA728': 'TZ', + '\u24CA': 'U', + '\uFF35': 'U', + '\u00D9': 'U', + '\u00DA': 'U', + '\u00DB': 'U', + '\u0168': 'U', + '\u1E78': 'U', + '\u016A': 'U', + '\u1E7A': 'U', + '\u016C': 'U', + '\u00DC': 'U', + '\u01DB': 'U', + '\u01D7': 'U', + '\u01D5': 'U', + '\u01D9': 'U', + '\u1EE6': 'U', + '\u016E': 'U', + '\u0170': 'U', + '\u01D3': 'U', + '\u0214': 'U', + '\u0216': 'U', + '\u01AF': 'U', + '\u1EEA': 'U', + '\u1EE8': 'U', + '\u1EEE': 'U', + '\u1EEC': 'U', + '\u1EF0': 'U', + '\u1EE4': 'U', + '\u1E72': 'U', + '\u0172': 'U', + '\u1E76': 'U', + '\u1E74': 'U', + '\u0244': 'U', + '\u24CB': 'V', + '\uFF36': 'V', + '\u1E7C': 'V', + '\u1E7E': 'V', + '\u01B2': 'V', + '\uA75E': 'V', + '\u0245': 'V', + '\uA760': 'VY', + '\u24CC': 'W', + '\uFF37': 'W', + '\u1E80': 'W', + '\u1E82': 'W', + '\u0174': 'W', + '\u1E86': 'W', + '\u1E84': 'W', + '\u1E88': 'W', + '\u2C72': 'W', + '\u24CD': 'X', + '\uFF38': 'X', + '\u1E8A': 'X', + '\u1E8C': 'X', + '\u24CE': 'Y', + '\uFF39': 'Y', + '\u1EF2': 'Y', + '\u00DD': 'Y', + '\u0176': 'Y', + '\u1EF8': 'Y', + '\u0232': 'Y', + '\u1E8E': 'Y', + '\u0178': 'Y', + '\u1EF6': 'Y', + '\u1EF4': 'Y', + '\u01B3': 'Y', + '\u024E': 'Y', + '\u1EFE': 'Y', + '\u24CF': 'Z', + '\uFF3A': 'Z', + '\u0179': 'Z', + '\u1E90': 'Z', + '\u017B': 'Z', + '\u017D': 'Z', + '\u1E92': 'Z', + '\u1E94': 'Z', + '\u01B5': 'Z', + '\u0224': 'Z', + '\u2C7F': 'Z', + '\u2C6B': 'Z', + '\uA762': 'Z', + '\u24D0': 'a', + '\uFF41': 'a', + '\u1E9A': 'a', + '\u00E0': 'a', + '\u00E1': 'a', + '\u00E2': 'a', + '\u1EA7': 'a', + '\u1EA5': 'a', + '\u1EAB': 'a', + '\u1EA9': 'a', + '\u00E3': 'a', + '\u0101': 'a', + '\u0103': 'a', + '\u1EB1': 'a', + '\u1EAF': 'a', + '\u1EB5': 'a', + '\u1EB3': 'a', + '\u0227': 'a', + '\u01E1': 'a', + '\u00E4': 'a', + '\u01DF': 'a', + '\u1EA3': 'a', + '\u00E5': 'a', + '\u01FB': 'a', + '\u01CE': 'a', + '\u0201': 'a', + '\u0203': 'a', + '\u1EA1': 'a', + '\u1EAD': 'a', + '\u1EB7': 'a', + '\u1E01': 'a', + '\u0105': 'a', + '\u2C65': 'a', + '\u0250': 'a', + '\uA733': 'aa', + '\u00E6': 'ae', + '\u01FD': 'ae', + '\u01E3': 'ae', + '\uA735': 'ao', + '\uA737': 'au', + '\uA739': 'av', + '\uA73B': 'av', + '\uA73D': 'ay', + '\u24D1': 'b', + '\uFF42': 'b', + '\u1E03': 'b', + '\u1E05': 'b', + '\u1E07': 'b', + '\u0180': 'b', + '\u0183': 'b', + '\u0253': 'b', + '\u24D2': 'c', + '\uFF43': 'c', + '\u0107': 'c', + '\u0109': 'c', + '\u010B': 'c', + '\u010D': 'c', + '\u00E7': 'c', + '\u1E09': 'c', + '\u0188': 'c', + '\u023C': 'c', + '\uA73F': 'c', + '\u2184': 'c', + '\u24D3': 'd', + '\uFF44': 'd', + '\u1E0B': 'd', + '\u010F': 'd', + '\u1E0D': 'd', + '\u1E11': 'd', + '\u1E13': 'd', + '\u1E0F': 'd', + '\u0111': 'd', + '\u018C': 'd', + '\u0256': 'd', + '\u0257': 'd', + '\uA77A': 'd', + '\u01F3': 'dz', + '\u01C6': 'dz', + '\u24D4': 'e', + '\uFF45': 'e', + '\u00E8': 'e', + '\u00E9': 'e', + '\u00EA': 'e', + '\u1EC1': 'e', + '\u1EBF': 'e', + '\u1EC5': 'e', + '\u1EC3': 'e', + '\u1EBD': 'e', + '\u0113': 'e', + '\u1E15': 'e', + '\u1E17': 'e', + '\u0115': 'e', + '\u0117': 'e', + '\u00EB': 'e', + '\u1EBB': 'e', + '\u011B': 'e', + '\u0205': 'e', + '\u0207': 'e', + '\u1EB9': 'e', + '\u1EC7': 'e', + '\u0229': 'e', + '\u1E1D': 'e', + '\u0119': 'e', + '\u1E19': 'e', + '\u1E1B': 'e', + '\u0247': 'e', + '\u025B': 'e', + '\u01DD': 'e', + '\u24D5': 'f', + '\uFF46': 'f', + '\u1E1F': 'f', + '\u0192': 'f', + '\uA77C': 'f', + '\u24D6': 'g', + '\uFF47': 'g', + '\u01F5': 'g', + '\u011D': 'g', + '\u1E21': 'g', + '\u011F': 'g', + '\u0121': 'g', + '\u01E7': 'g', + '\u0123': 'g', + '\u01E5': 'g', + '\u0260': 'g', + '\uA7A1': 'g', + '\u1D79': 'g', + '\uA77F': 'g', + '\u24D7': 'h', + '\uFF48': 'h', + '\u0125': 'h', + '\u1E23': 'h', + '\u1E27': 'h', + '\u021F': 'h', + '\u1E25': 'h', + '\u1E29': 'h', + '\u1E2B': 'h', + '\u1E96': 'h', + '\u0127': 'h', + '\u2C68': 'h', + '\u2C76': 'h', + '\u0265': 'h', + '\u0195': 'hv', + '\u24D8': 'i', + '\uFF49': 'i', + '\u00EC': 'i', + '\u00ED': 'i', + '\u00EE': 'i', + '\u0129': 'i', + '\u012B': 'i', + '\u012D': 'i', + '\u00EF': 'i', + '\u1E2F': 'i', + '\u1EC9': 'i', + '\u01D0': 'i', + '\u0209': 'i', + '\u020B': 'i', + '\u1ECB': 'i', + '\u012F': 'i', + '\u1E2D': 'i', + '\u0268': 'i', + '\u0131': 'i', + '\u24D9': 'j', + '\uFF4A': 'j', + '\u0135': 'j', + '\u01F0': 'j', + '\u0249': 'j', + '\u24DA': 'k', + '\uFF4B': 'k', + '\u1E31': 'k', + '\u01E9': 'k', + '\u1E33': 'k', + '\u0137': 'k', + '\u1E35': 'k', + '\u0199': 'k', + '\u2C6A': 'k', + '\uA741': 'k', + '\uA743': 'k', + '\uA745': 'k', + '\uA7A3': 'k', + '\u24DB': 'l', + '\uFF4C': 'l', + '\u0140': 'l', + '\u013A': 'l', + '\u013E': 'l', + '\u1E37': 'l', + '\u1E39': 'l', + '\u013C': 'l', + '\u1E3D': 'l', + '\u1E3B': 'l', + '\u017F': 'l', + '\u0142': 'l', + '\u019A': 'l', + '\u026B': 'l', + '\u2C61': 'l', + '\uA749': 'l', + '\uA781': 'l', + '\uA747': 'l', + '\u01C9': 'lj', + '\u24DC': 'm', + '\uFF4D': 'm', + '\u1E3F': 'm', + '\u1E41': 'm', + '\u1E43': 'm', + '\u0271': 'm', + '\u026F': 'm', + '\u24DD': 'n', + '\uFF4E': 'n', + '\u01F9': 'n', + '\u0144': 'n', + '\u00F1': 'n', + '\u1E45': 'n', + '\u0148': 'n', + '\u1E47': 'n', + '\u0146': 'n', + '\u1E4B': 'n', + '\u1E49': 'n', + '\u019E': 'n', + '\u0272': 'n', + '\u0149': 'n', + '\uA791': 'n', + '\uA7A5': 'n', + '\u01CC': 'nj', + '\u24DE': 'o', + '\uFF4F': 'o', + '\u00F2': 'o', + '\u00F3': 'o', + '\u00F4': 'o', + '\u1ED3': 'o', + '\u1ED1': 'o', + '\u1ED7': 'o', + '\u1ED5': 'o', + '\u00F5': 'o', + '\u1E4D': 'o', + '\u022D': 'o', + '\u1E4F': 'o', + '\u014D': 'o', + '\u1E51': 'o', + '\u1E53': 'o', + '\u014F': 'o', + '\u022F': 'o', + '\u0231': 'o', + '\u00F6': 'o', + '\u022B': 'o', + '\u1ECF': 'o', + '\u0151': 'o', + '\u01D2': 'o', + '\u020D': 'o', + '\u020F': 'o', + '\u01A1': 'o', + '\u1EDD': 'o', + '\u1EDB': 'o', + '\u1EE1': 'o', + '\u1EDF': 'o', + '\u1EE3': 'o', + '\u1ECD': 'o', + '\u1ED9': 'o', + '\u01EB': 'o', + '\u01ED': 'o', + '\u00F8': 'o', + '\u01FF': 'o', + '\u0254': 'o', + '\uA74B': 'o', + '\uA74D': 'o', + '\u0275': 'o', + '\u0153': 'oe', + '\u01A3': 'oi', + '\u0223': 'ou', + '\uA74F': 'oo', + '\u24DF': 'p', + '\uFF50': 'p', + '\u1E55': 'p', + '\u1E57': 'p', + '\u01A5': 'p', + '\u1D7D': 'p', + '\uA751': 'p', + '\uA753': 'p', + '\uA755': 'p', + '\u24E0': 'q', + '\uFF51': 'q', + '\u024B': 'q', + '\uA757': 'q', + '\uA759': 'q', + '\u24E1': 'r', + '\uFF52': 'r', + '\u0155': 'r', + '\u1E59': 'r', + '\u0159': 'r', + '\u0211': 'r', + '\u0213': 'r', + '\u1E5B': 'r', + '\u1E5D': 'r', + '\u0157': 'r', + '\u1E5F': 'r', + '\u024D': 'r', + '\u027D': 'r', + '\uA75B': 'r', + '\uA7A7': 'r', + '\uA783': 'r', + '\u24E2': 's', + '\uFF53': 's', + '\u00DF': 's', + '\u015B': 's', + '\u1E65': 's', + '\u015D': 's', + '\u1E61': 's', + '\u0161': 's', + '\u1E67': 's', + '\u1E63': 's', + '\u1E69': 's', + '\u0219': 's', + '\u015F': 's', + '\u023F': 's', + '\uA7A9': 's', + '\uA785': 's', + '\u1E9B': 's', + '\u24E3': 't', + '\uFF54': 't', + '\u1E6B': 't', + '\u1E97': 't', + '\u0165': 't', + '\u1E6D': 't', + '\u021B': 't', + '\u0163': 't', + '\u1E71': 't', + '\u1E6F': 't', + '\u0167': 't', + '\u01AD': 't', + '\u0288': 't', + '\u2C66': 't', + '\uA787': 't', + '\uA729': 'tz', + '\u24E4': 'u', + '\uFF55': 'u', + '\u00F9': 'u', + '\u00FA': 'u', + '\u00FB': 'u', + '\u0169': 'u', + '\u1E79': 'u', + '\u016B': 'u', + '\u1E7B': 'u', + '\u016D': 'u', + '\u00FC': 'u', + '\u01DC': 'u', + '\u01D8': 'u', + '\u01D6': 'u', + '\u01DA': 'u', + '\u1EE7': 'u', + '\u016F': 'u', + '\u0171': 'u', + '\u01D4': 'u', + '\u0215': 'u', + '\u0217': 'u', + '\u01B0': 'u', + '\u1EEB': 'u', + '\u1EE9': 'u', + '\u1EEF': 'u', + '\u1EED': 'u', + '\u1EF1': 'u', + '\u1EE5': 'u', + '\u1E73': 'u', + '\u0173': 'u', + '\u1E77': 'u', + '\u1E75': 'u', + '\u0289': 'u', + '\u24E5': 'v', + '\uFF56': 'v', + '\u1E7D': 'v', + '\u1E7F': 'v', + '\u028B': 'v', + '\uA75F': 'v', + '\u028C': 'v', + '\uA761': 'vy', + '\u24E6': 'w', + '\uFF57': 'w', + '\u1E81': 'w', + '\u1E83': 'w', + '\u0175': 'w', + '\u1E87': 'w', + '\u1E85': 'w', + '\u1E98': 'w', + '\u1E89': 'w', + '\u2C73': 'w', + '\u24E7': 'x', + '\uFF58': 'x', + '\u1E8B': 'x', + '\u1E8D': 'x', + '\u24E8': 'y', + '\uFF59': 'y', + '\u1EF3': 'y', + '\u00FD': 'y', + '\u0177': 'y', + '\u1EF9': 'y', + '\u0233': 'y', + '\u1E8F': 'y', + '\u00FF': 'y', + '\u1EF7': 'y', + '\u1E99': 'y', + '\u1EF5': 'y', + '\u01B4': 'y', + '\u024F': 'y', + '\u1EFF': 'y', + '\u24E9': 'z', + '\uFF5A': 'z', + '\u017A': 'z', + '\u1E91': 'z', + '\u017C': 'z', + '\u017E': 'z', + '\u1E93': 'z', + '\u1E95': 'z', + '\u01B6': 'z', + '\u0225': 'z', + '\u0240': 'z', + '\u2C6C': 'z', + '\uA763': 'z', + '\u0386': '\u0391', + '\u0388': '\u0395', + '\u0389': '\u0397', + '\u038A': '\u0399', + '\u03AA': '\u0399', + '\u038C': '\u039F', + '\u038E': '\u03A5', + '\u03AB': '\u03A5', + '\u038F': '\u03A9', + '\u03AC': '\u03B1', + '\u03AD': '\u03B5', + '\u03AE': '\u03B7', + '\u03AF': '\u03B9', + '\u03CA': '\u03B9', + '\u0390': '\u03B9', + '\u03CC': '\u03BF', + '\u03CD': '\u03C5', + '\u03CB': '\u03C5', + '\u03B0': '\u03C5', + '\u03CE': '\u03C9', + '\u03C2': '\u03C3', + '\u2019': '\'' + }; + + return diacritics; +}); + +S2.define('select2/data/base',[ + '../utils' +], function (Utils) { + function BaseAdapter ($element, options) { + BaseAdapter.__super__.constructor.call(this); + } + + Utils.Extend(BaseAdapter, Utils.Observable); + + BaseAdapter.prototype.current = function (callback) { + throw new Error('The `current` method must be defined in child classes.'); + }; + + BaseAdapter.prototype.query = function (params, callback) { + throw new Error('The `query` method must be defined in child classes.'); + }; + + BaseAdapter.prototype.bind = function (container, $container) { + // Can be implemented in subclasses + }; + + BaseAdapter.prototype.destroy = function () { + // Can be implemented in subclasses + }; + + BaseAdapter.prototype.generateResultId = function (container, data) { + var id = container.id + '-result-'; + + id += Utils.generateChars(4); + + if (data.id != null) { + id += '-' + data.id.toString(); + } else { + id += '-' + Utils.generateChars(4); + } + return id; + }; + + return BaseAdapter; +}); + +S2.define('select2/data/select',[ + './base', + '../utils', + 'jquery' +], function (BaseAdapter, Utils, $) { + function SelectAdapter ($element, options) { + this.$element = $element; + this.options = options; + + SelectAdapter.__super__.constructor.call(this); + } + + Utils.Extend(SelectAdapter, BaseAdapter); + + SelectAdapter.prototype.current = function (callback) { + var data = []; + var self = this; + + this.$element.find(':selected').each(function () { + var $option = $(this); + + var option = self.item($option); + + data.push(option); + }); + + callback(data); + }; + + SelectAdapter.prototype.select = function (data) { + var self = this; + + data.selected = true; + + // If data.element is a DOM node, use it instead + if ($(data.element).is('option')) { + data.element.selected = true; + + this.$element.trigger('change'); + + return; + } + + if (this.$element.prop('multiple')) { + this.current(function (currentData) { + var val = []; + + data = [data]; + data.push.apply(data, currentData); + + for (var d = 0; d < data.length; d++) { + var id = data[d].id; + + if ($.inArray(id, val) === -1) { + val.push(id); + } + } + + self.$element.val(val); + self.$element.trigger('change'); + }); + } else { + var val = data.id; + + this.$element.val(val); + this.$element.trigger('change'); + } + }; + + SelectAdapter.prototype.unselect = function (data) { + var self = this; + + if (!this.$element.prop('multiple')) { + return; + } + + data.selected = false; + + if ($(data.element).is('option')) { + data.element.selected = false; + + this.$element.trigger('change'); + + return; + } + + this.current(function (currentData) { + var val = []; + + for (var d = 0; d < currentData.length; d++) { + var id = currentData[d].id; + + if (id !== data.id && $.inArray(id, val) === -1) { + val.push(id); + } + } + + self.$element.val(val); + + self.$element.trigger('change'); + }); + }; + + SelectAdapter.prototype.bind = function (container, $container) { + var self = this; + + this.container = container; + + container.on('select', function (params) { + self.select(params.data); + }); + + container.on('unselect', function (params) { + self.unselect(params.data); + }); + }; + + SelectAdapter.prototype.destroy = function () { + // Remove anything added to child elements + this.$element.find('*').each(function () { + // Remove any custom data set by Select2 + Utils.RemoveData(this); + }); + }; + + SelectAdapter.prototype.query = function (params, callback) { + var data = []; + var self = this; + + var $options = this.$element.children(); + + $options.each(function () { + var $option = $(this); + + if (!$option.is('option') && !$option.is('optgroup')) { + return; + } + + var option = self.item($option); + + var matches = self.matches(params, option); + + if (matches !== null) { + data.push(matches); + } + }); + + callback({ + results: data + }); + }; + + SelectAdapter.prototype.addOptions = function ($options) { + Utils.appendMany(this.$element, $options); + }; + + SelectAdapter.prototype.option = function (data) { + var option; + + if (data.children) { + option = document.createElement('optgroup'); + option.label = data.text; + } else { + option = document.createElement('option'); + + if (option.textContent !== undefined) { + option.textContent = data.text; + } else { + option.innerText = data.text; + } + } + + if (data.id !== undefined) { + option.value = data.id; + } + + if (data.disabled) { + option.disabled = true; + } + + if (data.selected) { + option.selected = true; + } + + if (data.title) { + option.title = data.title; + } + + var $option = $(option); + + var normalizedData = this._normalizeItem(data); + normalizedData.element = option; + + // Override the option's data with the combined data + Utils.StoreData(option, 'data', normalizedData); + + return $option; + }; + + SelectAdapter.prototype.item = function ($option) { + var data = {}; + + data = Utils.GetData($option[0], 'data'); + + if (data != null) { + return data; + } + + if ($option.is('option')) { + data = { + id: $option.val(), + text: $option.text(), + disabled: $option.prop('disabled'), + selected: $option.prop('selected'), + title: $option.prop('title') + }; + } else if ($option.is('optgroup')) { + data = { + text: $option.prop('label'), + children: [], + title: $option.prop('title') + }; + + var $children = $option.children('option'); + var children = []; + + for (var c = 0; c < $children.length; c++) { + var $child = $($children[c]); + + var child = this.item($child); + + children.push(child); + } + + data.children = children; + } + + data = this._normalizeItem(data); + data.element = $option[0]; + + Utils.StoreData($option[0], 'data', data); + + return data; + }; + + SelectAdapter.prototype._normalizeItem = function (item) { + if (item !== Object(item)) { + item = { + id: item, + text: item + }; + } + + item = $.extend({}, { + text: '' + }, item); + + var defaults = { + selected: false, + disabled: false + }; + + if (item.id != null) { + item.id = item.id.toString(); + } + + if (item.text != null) { + item.text = item.text.toString(); + } + + if (item._resultId == null && item.id && this.container != null) { + item._resultId = this.generateResultId(this.container, item); + } + + return $.extend({}, defaults, item); + }; + + SelectAdapter.prototype.matches = function (params, data) { + var matcher = this.options.get('matcher'); + + return matcher(params, data); + }; + + return SelectAdapter; +}); + +S2.define('select2/data/array',[ + './select', + '../utils', + 'jquery' +], function (SelectAdapter, Utils, $) { + function ArrayAdapter ($element, options) { + var data = options.get('data') || []; + + ArrayAdapter.__super__.constructor.call(this, $element, options); + + this.addOptions(this.convertToOptions(data)); + } + + Utils.Extend(ArrayAdapter, SelectAdapter); + + ArrayAdapter.prototype.select = function (data) { + var $option = this.$element.find('option').filter(function (i, elm) { + return elm.value == data.id.toString(); + }); + + if ($option.length === 0) { + $option = this.option(data); + + this.addOptions($option); + } + + ArrayAdapter.__super__.select.call(this, data); + }; + + ArrayAdapter.prototype.convertToOptions = function (data) { + var self = this; + + var $existing = this.$element.find('option'); + var existingIds = $existing.map(function () { + return self.item($(this)).id; + }).get(); + + var $options = []; + + // Filter out all items except for the one passed in the argument + function onlyItem (item) { + return function () { + return $(this).val() == item.id; + }; + } + + for (var d = 0; d < data.length; d++) { + var item = this._normalizeItem(data[d]); + + // Skip items which were pre-loaded, only merge the data + if ($.inArray(item.id, existingIds) >= 0) { + var $existingOption = $existing.filter(onlyItem(item)); + + var existingData = this.item($existingOption); + var newData = $.extend(true, {}, item, existingData); + + var $newOption = this.option(newData); + + $existingOption.replaceWith($newOption); + + continue; + } + + var $option = this.option(item); + + if (item.children) { + var $children = this.convertToOptions(item.children); + + Utils.appendMany($option, $children); + } + + $options.push($option); + } + + return $options; + }; + + return ArrayAdapter; +}); + +S2.define('select2/data/ajax',[ + './array', + '../utils', + 'jquery' +], function (ArrayAdapter, Utils, $) { + function AjaxAdapter ($element, options) { + this.ajaxOptions = this._applyDefaults(options.get('ajax')); + + if (this.ajaxOptions.processResults != null) { + this.processResults = this.ajaxOptions.processResults; + } + + AjaxAdapter.__super__.constructor.call(this, $element, options); + } + + Utils.Extend(AjaxAdapter, ArrayAdapter); + + AjaxAdapter.prototype._applyDefaults = function (options) { + var defaults = { + data: function (params) { + return $.extend({}, params, { + q: params.term + }); + }, + transport: function (params, success, failure) { + var $request = $.ajax(params); + + $request.then(success); + $request.fail(failure); + + return $request; + } + }; + + return $.extend({}, defaults, options, true); + }; + + AjaxAdapter.prototype.processResults = function (results) { + return results; + }; + + AjaxAdapter.prototype.query = function (params, callback) { + var matches = []; + var self = this; + + if (this._request != null) { + // JSONP requests cannot always be aborted + if ($.isFunction(this._request.abort)) { + this._request.abort(); + } + + this._request = null; + } + + var options = $.extend({ + type: 'GET' + }, this.ajaxOptions); + + if (typeof options.url === 'function') { + options.url = options.url.call(this.$element, params); + } + + if (typeof options.data === 'function') { + options.data = options.data.call(this.$element, params); + } + + function request () { + var $request = options.transport(options, function (data) { + var results = self.processResults(data, params); + + if (self.options.get('debug') && window.console && console.error) { + // Check to make sure that the response included a `results` key. + if (!results || !results.results || !$.isArray(results.results)) { + console.error( + 'Select2: The AJAX results did not return an array in the ' + + '`results` key of the response.' + ); + } + } + + callback(results); + }, function () { + // Attempt to detect if a request was aborted + // Only works if the transport exposes a status property + if ('status' in $request && + ($request.status === 0 || $request.status === '0')) { + return; + } + + self.trigger('results:message', { + message: 'errorLoading' + }); + }); + + self._request = $request; + } + + if (this.ajaxOptions.delay && params.term != null) { + if (this._queryTimeout) { + window.clearTimeout(this._queryTimeout); + } + + this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay); + } else { + request(); + } + }; + + return AjaxAdapter; +}); + +S2.define('select2/data/tags',[ + 'jquery' +], function ($) { + function Tags (decorated, $element, options) { + var tags = options.get('tags'); + + var createTag = options.get('createTag'); + + if (createTag !== undefined) { + this.createTag = createTag; + } + + var insertTag = options.get('insertTag'); + + if (insertTag !== undefined) { + this.insertTag = insertTag; + } + + decorated.call(this, $element, options); + + if ($.isArray(tags)) { + for (var t = 0; t < tags.length; t++) { + var tag = tags[t]; + var item = this._normalizeItem(tag); + + var $option = this.option(item); + + this.$element.append($option); + } + } + } + + Tags.prototype.query = function (decorated, params, callback) { + var self = this; + + this._removeOldTags(); + + if (params.term == null || params.page != null) { + decorated.call(this, params, callback); + return; + } + + function wrapper (obj, child) { + var data = obj.results; + + for (var i = 0; i < data.length; i++) { + var option = data[i]; + + var checkChildren = ( + option.children != null && + !wrapper({ + results: option.children + }, true) + ); + + var optionText = (option.text || '').toUpperCase(); + var paramsTerm = (params.term || '').toUpperCase(); + + var checkText = optionText === paramsTerm; + + if (checkText || checkChildren) { + if (child) { + return false; + } + + obj.data = data; + callback(obj); + + return; + } + } + + if (child) { + return true; + } + + var tag = self.createTag(params); + + if (tag != null) { + var $option = self.option(tag); + $option.attr('data-select2-tag', true); + + self.addOptions([$option]); + + self.insertTag(data, tag); + } + + obj.results = data; + + callback(obj); + } + + decorated.call(this, params, wrapper); + }; + + Tags.prototype.createTag = function (decorated, params) { + var term = $.trim(params.term); + + if (term === '') { + return null; + } + + return { + id: term, + text: term + }; + }; + + Tags.prototype.insertTag = function (_, data, tag) { + data.unshift(tag); + }; + + Tags.prototype._removeOldTags = function (_) { + var tag = this._lastTag; + + var $options = this.$element.find('option[data-select2-tag]'); + + $options.each(function () { + if (this.selected) { + return; + } + + $(this).remove(); + }); + }; + + return Tags; +}); + +S2.define('select2/data/tokenizer',[ + 'jquery' +], function ($) { + function Tokenizer (decorated, $element, options) { + var tokenizer = options.get('tokenizer'); + + if (tokenizer !== undefined) { + this.tokenizer = tokenizer; + } + + decorated.call(this, $element, options); + } + + Tokenizer.prototype.bind = function (decorated, container, $container) { + decorated.call(this, container, $container); + + this.$search = container.dropdown.$search || container.selection.$search || + $container.find('.select2-search__field'); + }; + + Tokenizer.prototype.query = function (decorated, params, callback) { + var self = this; + + function createAndSelect (data) { + // Normalize the data object so we can use it for checks + var item = self._normalizeItem(data); + + // Check if the data object already exists as a tag + // Select it if it doesn't + var $existingOptions = self.$element.find('option').filter(function () { + return $(this).val() === item.id; + }); + + // If an existing option wasn't found for it, create the option + if (!$existingOptions.length) { + var $option = self.option(item); + $option.attr('data-select2-tag', true); + + self._removeOldTags(); + self.addOptions([$option]); + } + + // Select the item, now that we know there is an option for it + select(item); + } + + function select (data) { + self.trigger('select', { + data: data + }); + } + + params.term = params.term || ''; + + var tokenData = this.tokenizer(params, this.options, createAndSelect); + + if (tokenData.term !== params.term) { + // Replace the search term if we have the search box + if (this.$search.length) { + this.$search.val(tokenData.term); + this.$search.trigger('focus'); + } + + params.term = tokenData.term; + } + + decorated.call(this, params, callback); + }; + + Tokenizer.prototype.tokenizer = function (_, params, options, callback) { + var separators = options.get('tokenSeparators') || []; + var term = params.term; + var i = 0; + + var createTag = this.createTag || function (params) { + return { + id: params.term, + text: params.term + }; + }; + + while (i < term.length) { + var termChar = term[i]; + + if ($.inArray(termChar, separators) === -1) { + i++; + + continue; + } + + var part = term.substr(0, i); + var partParams = $.extend({}, params, { + term: part + }); + + var data = createTag(partParams); + + if (data == null) { + i++; + continue; + } + + callback(data); + + // Reset the term to not include the tokenized portion + term = term.substr(i + 1) || ''; + i = 0; + } + + return { + term: term + }; + }; + + return Tokenizer; +}); + +S2.define('select2/data/minimumInputLength',[ + +], function () { + function MinimumInputLength (decorated, $e, options) { + this.minimumInputLength = options.get('minimumInputLength'); + + decorated.call(this, $e, options); + } + + MinimumInputLength.prototype.query = function (decorated, params, callback) { + params.term = params.term || ''; + + if (params.term.length < this.minimumInputLength) { + this.trigger('results:message', { + message: 'inputTooShort', + args: { + minimum: this.minimumInputLength, + input: params.term, + params: params + } + }); + + return; + } + + decorated.call(this, params, callback); + }; + + return MinimumInputLength; +}); + +S2.define('select2/data/maximumInputLength',[ + +], function () { + function MaximumInputLength (decorated, $e, options) { + this.maximumInputLength = options.get('maximumInputLength'); + + decorated.call(this, $e, options); + } + + MaximumInputLength.prototype.query = function (decorated, params, callback) { + params.term = params.term || ''; + + if (this.maximumInputLength > 0 && + params.term.length > this.maximumInputLength) { + this.trigger('results:message', { + message: 'inputTooLong', + args: { + maximum: this.maximumInputLength, + input: params.term, + params: params + } + }); + + return; + } + + decorated.call(this, params, callback); + }; + + return MaximumInputLength; +}); + +S2.define('select2/data/maximumSelectionLength',[ + +], function (){ + function MaximumSelectionLength (decorated, $e, options) { + this.maximumSelectionLength = options.get('maximumSelectionLength'); + + decorated.call(this, $e, options); + } + + MaximumSelectionLength.prototype.query = + function (decorated, params, callback) { + var self = this; + + this.current(function (currentData) { + var count = currentData != null ? currentData.length : 0; + if (self.maximumSelectionLength > 0 && + count >= self.maximumSelectionLength) { + self.trigger('results:message', { + message: 'maximumSelected', + args: { + maximum: self.maximumSelectionLength + } + }); + return; + } + decorated.call(self, params, callback); + }); + }; + + return MaximumSelectionLength; +}); + +S2.define('select2/dropdown',[ + 'jquery', + './utils' +], function ($, Utils) { + function Dropdown ($element, options) { + this.$element = $element; + this.options = options; + + Dropdown.__super__.constructor.call(this); + } + + Utils.Extend(Dropdown, Utils.Observable); + + Dropdown.prototype.render = function () { + var $dropdown = $( + '' + + '' + + '' + ); + + $dropdown.attr('dir', this.options.get('dir')); + + this.$dropdown = $dropdown; + + return $dropdown; + }; + + Dropdown.prototype.bind = function () { + // Should be implemented in subclasses + }; + + Dropdown.prototype.position = function ($dropdown, $container) { + // Should be implemented in subclasses + }; + + Dropdown.prototype.destroy = function () { + // Remove the dropdown from the DOM + this.$dropdown.remove(); + }; + + return Dropdown; +}); + +S2.define('select2/dropdown/search',[ + 'jquery', + '../utils' +], function ($, Utils) { + function Search () { } + + Search.prototype.render = function (decorated) { + var $rendered = decorated.call(this); + + var $search = $( + '' + + '' + + '' + ); + + this.$searchContainer = $search; + this.$search = $search.find('input'); + + $rendered.prepend($search); + + return $rendered; + }; + + Search.prototype.bind = function (decorated, container, $container) { + var self = this; + + decorated.call(this, container, $container); + + this.$search.on('keydown', function (evt) { + self.trigger('keypress', evt); + + self._keyUpPrevented = evt.isDefaultPrevented(); + }); + + // Workaround for browsers which do not support the `input` event + // This will prevent double-triggering of events for browsers which support + // both the `keyup` and `input` events. + this.$search.on('input', function (evt) { + // Unbind the duplicated `keyup` event + $(this).off('keyup'); + }); + + this.$search.on('keyup input', function (evt) { + self.handleSearch(evt); + }); + + container.on('open', function () { + self.$search.attr('tabindex', 0); + + self.$search.trigger('focus'); + + window.setTimeout(function () { + self.$search.trigger('focus'); + }, 0); + }); + + container.on('close', function () { + self.$search.attr('tabindex', -1); + + self.$search.val(''); + self.$search.trigger('blur'); + }); + + container.on('focus', function () { + if (!container.isOpen()) { + self.$search.trigger('focus'); + } + }); + + container.on('results:all', function (params) { + if (params.query.term == null || params.query.term === '') { + var showSearch = self.showSearch(params); + + if (showSearch) { + self.$searchContainer.removeClass('select2-search--hide'); + } else { + self.$searchContainer.addClass('select2-search--hide'); + } + } + }); + }; + + Search.prototype.handleSearch = function (evt) { + if (!this._keyUpPrevented) { + var input = this.$search.val(); + + this.trigger('query', { + term: input + }); + } + + this._keyUpPrevented = false; + }; + + Search.prototype.showSearch = function (_, params) { + return true; + }; + + return Search; +}); + +S2.define('select2/dropdown/hidePlaceholder',[ + +], function () { + function HidePlaceholder (decorated, $element, options, dataAdapter) { + this.placeholder = this.normalizePlaceholder(options.get('placeholder')); + + decorated.call(this, $element, options, dataAdapter); + } + + HidePlaceholder.prototype.append = function (decorated, data) { + data.results = this.removePlaceholder(data.results); + + decorated.call(this, data); + }; + + HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) { + if (typeof placeholder === 'string') { + placeholder = { + id: '', + text: placeholder + }; + } + + return placeholder; + }; + + HidePlaceholder.prototype.removePlaceholder = function (_, data) { + var modifiedData = data.slice(0); + + for (var d = data.length - 1; d >= 0; d--) { + var item = data[d]; + + if (this.placeholder.id === item.id) { + modifiedData.splice(d, 1); + } + } + + return modifiedData; + }; + + return HidePlaceholder; +}); + +S2.define('select2/dropdown/infiniteScroll',[ + 'jquery' +], function ($) { + function InfiniteScroll (decorated, $element, options, dataAdapter) { + this.lastParams = {}; + + decorated.call(this, $element, options, dataAdapter); + + this.$loadingMore = this.createLoadingMore(); + this.loading = false; + } + + InfiniteScroll.prototype.append = function (decorated, data) { + this.$loadingMore.remove(); + this.loading = false; + + decorated.call(this, data); + + if (this.showLoadingMore(data)) { + this.$results.append(this.$loadingMore); + this.loadMoreIfNeeded(); + } + }; + + InfiniteScroll.prototype.bind = function (decorated, container, $container) { + var self = this; + + decorated.call(this, container, $container); + + container.on('query', function (params) { + self.lastParams = params; + self.loading = true; + }); + + container.on('query:append', function (params) { + self.lastParams = params; + self.loading = true; + }); + + this.$results.on('scroll', this.loadMoreIfNeeded.bind(this)); + }; + + InfiniteScroll.prototype.loadMoreIfNeeded = function () { + var isLoadMoreVisible = $.contains( + document.documentElement, + this.$loadingMore[0] + ); + + if (this.loading || !isLoadMoreVisible) { + return; + } + + var currentOffset = this.$results.offset().top + + this.$results.outerHeight(false); + var loadingMoreOffset = this.$loadingMore.offset().top + + this.$loadingMore.outerHeight(false); + + if (currentOffset + 50 >= loadingMoreOffset) { + this.loadMore(); + } + }; + + InfiniteScroll.prototype.loadMore = function () { + this.loading = true; + + var params = $.extend({}, {page: 1}, this.lastParams); + + params.page++; + + this.trigger('query:append', params); + }; + + InfiniteScroll.prototype.showLoadingMore = function (_, data) { + return data.pagination && data.pagination.more; + }; + + InfiniteScroll.prototype.createLoadingMore = function () { + var $option = $( + '
      • ' + ); + + var message = this.options.get('translations').get('loadingMore'); + + $option.html(message(this.lastParams)); + + return $option; + }; + + return InfiniteScroll; +}); + +S2.define('select2/dropdown/attachBody',[ + 'jquery', + '../utils' +], function ($, Utils) { + function AttachBody (decorated, $element, options) { + this.$dropdownParent = options.get('dropdownParent') || $(document.body); + + decorated.call(this, $element, options); + } + + AttachBody.prototype.bind = function (decorated, container, $container) { + var self = this; + + var setupResultsEvents = false; + + decorated.call(this, container, $container); + + container.on('open', function () { + self._showDropdown(); + self._attachPositioningHandler(container); + + if (!setupResultsEvents) { + setupResultsEvents = true; + + container.on('results:all', function () { + self._positionDropdown(); + self._resizeDropdown(); + }); + + container.on('results:append', function () { + self._positionDropdown(); + self._resizeDropdown(); + }); + } + }); + + container.on('close', function () { + self._hideDropdown(); + self._detachPositioningHandler(container); + }); + + this.$dropdownContainer.on('mousedown', function (evt) { + evt.stopPropagation(); + }); + }; + + AttachBody.prototype.destroy = function (decorated) { + decorated.call(this); + + this.$dropdownContainer.remove(); + }; + + AttachBody.prototype.position = function (decorated, $dropdown, $container) { + // Clone all of the container classes + $dropdown.attr('class', $container.attr('class')); + + $dropdown.removeClass('select2'); + $dropdown.addClass('select2-container--open'); + + $dropdown.css({ + position: 'absolute', + top: -999999 + }); + + this.$container = $container; + }; + + AttachBody.prototype.render = function (decorated) { + var $container = $(''); + + var $dropdown = decorated.call(this); + $container.append($dropdown); + + this.$dropdownContainer = $container; + + return $container; + }; + + AttachBody.prototype._hideDropdown = function (decorated) { + this.$dropdownContainer.detach(); + }; + + AttachBody.prototype._attachPositioningHandler = + function (decorated, container) { + var self = this; + + var scrollEvent = 'scroll.select2.' + container.id; + var resizeEvent = 'resize.select2.' + container.id; + var orientationEvent = 'orientationchange.select2.' + container.id; + + var $watchers = this.$container.parents().filter(Utils.hasScroll); + $watchers.each(function () { + Utils.StoreData(this, 'select2-scroll-position', { + x: $(this).scrollLeft(), + y: $(this).scrollTop() + }); + }); + + $watchers.on(scrollEvent, function (ev) { + var position = Utils.GetData(this, 'select2-scroll-position'); + $(this).scrollTop(position.y); + }); + + $(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent, + function (e) { + self._positionDropdown(); + self._resizeDropdown(); + }); + }; + + AttachBody.prototype._detachPositioningHandler = + function (decorated, container) { + var scrollEvent = 'scroll.select2.' + container.id; + var resizeEvent = 'resize.select2.' + container.id; + var orientationEvent = 'orientationchange.select2.' + container.id; + + var $watchers = this.$container.parents().filter(Utils.hasScroll); + $watchers.off(scrollEvent); + + $(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent); + }; + + AttachBody.prototype._positionDropdown = function () { + var $window = $(window); + + var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above'); + var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below'); + + var newDirection = null; + + var offset = this.$container.offset(); + + offset.bottom = offset.top + this.$container.outerHeight(false); + + var container = { + height: this.$container.outerHeight(false) + }; + + container.top = offset.top; + container.bottom = offset.top + container.height; + + var dropdown = { + height: this.$dropdown.outerHeight(false) + }; + + var viewport = { + top: $window.scrollTop(), + bottom: $window.scrollTop() + $window.height() + }; + + var enoughRoomAbove = viewport.top < (offset.top - dropdown.height); + var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height); + + var css = { + left: offset.left, + top: container.bottom + }; + + // Determine what the parent element is to use for calculating the offset + var $offsetParent = this.$dropdownParent; + + // For statically positioned elements, we need to get the element + // that is determining the offset + if ($offsetParent.css('position') === 'static') { + $offsetParent = $offsetParent.offsetParent(); + } + + var parentOffset = $offsetParent.offset(); + + css.top -= parentOffset.top; + css.left -= parentOffset.left; + + if (!isCurrentlyAbove && !isCurrentlyBelow) { + newDirection = 'below'; + } + + if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) { + newDirection = 'above'; + } else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) { + newDirection = 'below'; + } + + if (newDirection == 'above' || + (isCurrentlyAbove && newDirection !== 'below')) { + css.top = container.top - parentOffset.top - dropdown.height; + } + + if (newDirection != null) { + this.$dropdown + .removeClass('select2-dropdown--below select2-dropdown--above') + .addClass('select2-dropdown--' + newDirection); + this.$container + .removeClass('select2-container--below select2-container--above') + .addClass('select2-container--' + newDirection); + } + + this.$dropdownContainer.css(css); + }; + + AttachBody.prototype._resizeDropdown = function () { + var css = { + width: this.$container.outerWidth(false) + 'px' + }; + + if (this.options.get('dropdownAutoWidth')) { + css.minWidth = css.width; + css.position = 'relative'; + css.width = 'auto'; + } + + this.$dropdown.css(css); + }; + + AttachBody.prototype._showDropdown = function (decorated) { + this.$dropdownContainer.appendTo(this.$dropdownParent); + + this._positionDropdown(); + this._resizeDropdown(); + }; + + return AttachBody; +}); + +S2.define('select2/dropdown/minimumResultsForSearch',[ + +], function () { + function countResults (data) { + var count = 0; + + for (var d = 0; d < data.length; d++) { + var item = data[d]; + + if (item.children) { + count += countResults(item.children); + } else { + count++; + } + } + + return count; + } + + function MinimumResultsForSearch (decorated, $element, options, dataAdapter) { + this.minimumResultsForSearch = options.get('minimumResultsForSearch'); + + if (this.minimumResultsForSearch < 0) { + this.minimumResultsForSearch = Infinity; + } + + decorated.call(this, $element, options, dataAdapter); + } + + MinimumResultsForSearch.prototype.showSearch = function (decorated, params) { + if (countResults(params.data.results) < this.minimumResultsForSearch) { + return false; + } + + return decorated.call(this, params); + }; + + return MinimumResultsForSearch; +}); + +S2.define('select2/dropdown/selectOnClose',[ + '../utils' +], function (Utils) { + function SelectOnClose () { } + + SelectOnClose.prototype.bind = function (decorated, container, $container) { + var self = this; + + decorated.call(this, container, $container); + + container.on('close', function (params) { + self._handleSelectOnClose(params); + }); + }; + + SelectOnClose.prototype._handleSelectOnClose = function (_, params) { + if (params && params.originalSelect2Event != null) { + var event = params.originalSelect2Event; + + // Don't select an item if the close event was triggered from a select or + // unselect event + if (event._type === 'select' || event._type === 'unselect') { + return; + } + } + + var $highlightedResults = this.getHighlightedResults(); + + // Only select highlighted results + if ($highlightedResults.length < 1) { + return; + } + + var data = Utils.GetData($highlightedResults[0], 'data'); + + // Don't re-select already selected resulte + if ( + (data.element != null && data.element.selected) || + (data.element == null && data.selected) + ) { + return; + } + + this.trigger('select', { + data: data + }); + }; + + return SelectOnClose; +}); + +S2.define('select2/dropdown/closeOnSelect',[ + +], function () { + function CloseOnSelect () { } + + CloseOnSelect.prototype.bind = function (decorated, container, $container) { + var self = this; + + decorated.call(this, container, $container); + + container.on('select', function (evt) { + self._selectTriggered(evt); + }); + + container.on('unselect', function (evt) { + self._selectTriggered(evt); + }); + }; + + CloseOnSelect.prototype._selectTriggered = function (_, evt) { + var originalEvent = evt.originalEvent; + + // Don't close if the control key is being held + if (originalEvent && (originalEvent.ctrlKey || originalEvent.metaKey)) { + return; + } + + this.trigger('close', { + originalEvent: originalEvent, + originalSelect2Event: evt + }); + }; + + return CloseOnSelect; +}); + +S2.define('select2/i18n/en',[],function () { + // English + return { + errorLoading: function () { + return 'The results could not be loaded.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'Please delete ' + overChars + ' character'; + + if (overChars != 1) { + message += 's'; + } + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Please enter ' + remainingChars + ' or more characters'; + + return message; + }, + loadingMore: function () { + return 'Loading more results…'; + }, + maximumSelected: function (args) { + var message = 'You can only select ' + args.maximum + ' item'; + + if (args.maximum != 1) { + message += 's'; + } + + return message; + }, + noResults: function () { + return 'No results found'; + }, + searching: function () { + return 'Searching…'; + }, + removeAllItems: function () { + return 'Remove all items'; + } + }; +}); + +S2.define('select2/defaults',[ + 'jquery', + 'require', + + './results', + + './selection/single', + './selection/multiple', + './selection/placeholder', + './selection/allowClear', + './selection/search', + './selection/eventRelay', + + './utils', + './translation', + './diacritics', + + './data/select', + './data/array', + './data/ajax', + './data/tags', + './data/tokenizer', + './data/minimumInputLength', + './data/maximumInputLength', + './data/maximumSelectionLength', + + './dropdown', + './dropdown/search', + './dropdown/hidePlaceholder', + './dropdown/infiniteScroll', + './dropdown/attachBody', + './dropdown/minimumResultsForSearch', + './dropdown/selectOnClose', + './dropdown/closeOnSelect', + + './i18n/en' +], function ($, require, + + ResultsList, + + SingleSelection, MultipleSelection, Placeholder, AllowClear, + SelectionSearch, EventRelay, + + Utils, Translation, DIACRITICS, + + SelectData, ArrayData, AjaxData, Tags, Tokenizer, + MinimumInputLength, MaximumInputLength, MaximumSelectionLength, + + Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll, + AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect, + + EnglishTranslation) { + function Defaults () { + this.reset(); + } + + Defaults.prototype.apply = function (options) { + options = $.extend(true, {}, this.defaults, options); + + if (options.dataAdapter == null) { + if (options.ajax != null) { + options.dataAdapter = AjaxData; + } else if (options.data != null) { + options.dataAdapter = ArrayData; + } else { + options.dataAdapter = SelectData; + } + + if (options.minimumInputLength > 0) { + options.dataAdapter = Utils.Decorate( + options.dataAdapter, + MinimumInputLength + ); + } + + if (options.maximumInputLength > 0) { + options.dataAdapter = Utils.Decorate( + options.dataAdapter, + MaximumInputLength + ); + } + + if (options.maximumSelectionLength > 0) { + options.dataAdapter = Utils.Decorate( + options.dataAdapter, + MaximumSelectionLength + ); + } + + if (options.tags) { + options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags); + } + + if (options.tokenSeparators != null || options.tokenizer != null) { + options.dataAdapter = Utils.Decorate( + options.dataAdapter, + Tokenizer + ); + } + + if (options.query != null) { + var Query = require(options.amdBase + 'compat/query'); + + options.dataAdapter = Utils.Decorate( + options.dataAdapter, + Query + ); + } + + if (options.initSelection != null) { + var InitSelection = require(options.amdBase + 'compat/initSelection'); + + options.dataAdapter = Utils.Decorate( + options.dataAdapter, + InitSelection + ); + } + } + + if (options.resultsAdapter == null) { + options.resultsAdapter = ResultsList; + + if (options.ajax != null) { + options.resultsAdapter = Utils.Decorate( + options.resultsAdapter, + InfiniteScroll + ); + } + + if (options.placeholder != null) { + options.resultsAdapter = Utils.Decorate( + options.resultsAdapter, + HidePlaceholder + ); + } + + if (options.selectOnClose) { + options.resultsAdapter = Utils.Decorate( + options.resultsAdapter, + SelectOnClose + ); + } + } + + if (options.dropdownAdapter == null) { + if (options.multiple) { + options.dropdownAdapter = Dropdown; + } else { + var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch); + + options.dropdownAdapter = SearchableDropdown; + } + + if (options.minimumResultsForSearch !== 0) { + options.dropdownAdapter = Utils.Decorate( + options.dropdownAdapter, + MinimumResultsForSearch + ); + } + + if (options.closeOnSelect) { + options.dropdownAdapter = Utils.Decorate( + options.dropdownAdapter, + CloseOnSelect + ); + } + + if ( + options.dropdownCssClass != null || + options.dropdownCss != null || + options.adaptDropdownCssClass != null + ) { + var DropdownCSS = require(options.amdBase + 'compat/dropdownCss'); + + options.dropdownAdapter = Utils.Decorate( + options.dropdownAdapter, + DropdownCSS + ); + } + + options.dropdownAdapter = Utils.Decorate( + options.dropdownAdapter, + AttachBody + ); + } + + if (options.selectionAdapter == null) { + if (options.multiple) { + options.selectionAdapter = MultipleSelection; + } else { + options.selectionAdapter = SingleSelection; + } + + // Add the placeholder mixin if a placeholder was specified + if (options.placeholder != null) { + options.selectionAdapter = Utils.Decorate( + options.selectionAdapter, + Placeholder + ); + } + + if (options.allowClear) { + options.selectionAdapter = Utils.Decorate( + options.selectionAdapter, + AllowClear + ); + } + + if (options.multiple) { + options.selectionAdapter = Utils.Decorate( + options.selectionAdapter, + SelectionSearch + ); + } + + if ( + options.containerCssClass != null || + options.containerCss != null || + options.adaptContainerCssClass != null + ) { + var ContainerCSS = require(options.amdBase + 'compat/containerCss'); + + options.selectionAdapter = Utils.Decorate( + options.selectionAdapter, + ContainerCSS + ); + } + + options.selectionAdapter = Utils.Decorate( + options.selectionAdapter, + EventRelay + ); + } + + if (typeof options.language === 'string') { + // Check if the language is specified with a region + if (options.language.indexOf('-') > 0) { + // Extract the region information if it is included + var languageParts = options.language.split('-'); + var baseLanguage = languageParts[0]; + + options.language = [options.language, baseLanguage]; + } else { + options.language = [options.language]; + } + } + + if ($.isArray(options.language)) { + var languages = new Translation(); + options.language.push('en'); + + var languageNames = options.language; + + for (var l = 0; l < languageNames.length; l++) { + var name = languageNames[l]; + var language = {}; + + try { + // Try to load it with the original name + language = Translation.loadPath(name); + } catch (e) { + try { + // If we couldn't load it, check if it wasn't the full path + name = this.defaults.amdLanguageBase + name; + language = Translation.loadPath(name); + } catch (ex) { + // The translation could not be loaded at all. Sometimes this is + // because of a configuration problem, other times this can be + // because of how Select2 helps load all possible translation files. + if (options.debug && window.console && console.warn) { + console.warn( + 'Select2: The language file for "' + name + '" could not be ' + + 'automatically loaded. A fallback will be used instead.' + ); + } + + continue; + } + } + + languages.extend(language); + } + + options.translations = languages; + } else { + var baseTranslation = Translation.loadPath( + this.defaults.amdLanguageBase + 'en' + ); + var customTranslation = new Translation(options.language); + + customTranslation.extend(baseTranslation); + + options.translations = customTranslation; + } + + return options; + }; + + Defaults.prototype.reset = function () { + function stripDiacritics (text) { + // Used 'uni range + named function' from http://jsperf.com/diacritics/18 + function match(a) { + return DIACRITICS[a] || a; + } + + return text.replace(/[^\u0000-\u007E]/g, match); + } + + function matcher (params, data) { + // Always return the object if there is nothing to compare + if ($.trim(params.term) === '') { + return data; + } + + // Do a recursive check for options with children + if (data.children && data.children.length > 0) { + // Clone the data object if there are children + // This is required as we modify the object to remove any non-matches + var match = $.extend(true, {}, data); + + // Check each child of the option + for (var c = data.children.length - 1; c >= 0; c--) { + var child = data.children[c]; + + var matches = matcher(params, child); + + // If there wasn't a match, remove the object in the array + if (matches == null) { + match.children.splice(c, 1); + } + } + + // If any children matched, return the new object + if (match.children.length > 0) { + return match; + } + + // If there were no matching children, check just the plain object + return matcher(params, match); + } + + var original = stripDiacritics(data.text).toUpperCase(); + var term = stripDiacritics(params.term).toUpperCase(); + + // Check if the text contains the term + if (original.indexOf(term) > -1) { + return data; + } + + // If it doesn't contain the term, don't return anything + return null; + } + + this.defaults = { + amdBase: './', + amdLanguageBase: './i18n/', + closeOnSelect: true, + debug: false, + dropdownAutoWidth: false, + escapeMarkup: Utils.escapeMarkup, + language: EnglishTranslation, + matcher: matcher, + minimumInputLength: 0, + maximumInputLength: 0, + maximumSelectionLength: 0, + minimumResultsForSearch: 0, + selectOnClose: false, + scrollAfterSelect: false, + sorter: function (data) { + return data; + }, + templateResult: function (result) { + return result.text; + }, + templateSelection: function (selection) { + return selection.text; + }, + theme: 'default', + width: 'resolve' + }; + }; + + Defaults.prototype.set = function (key, value) { + var camelKey = $.camelCase(key); + + var data = {}; + data[camelKey] = value; + + var convertedData = Utils._convertData(data); + + $.extend(true, this.defaults, convertedData); + }; + + var defaults = new Defaults(); + + return defaults; +}); + +S2.define('select2/options',[ + 'require', + 'jquery', + './defaults', + './utils' +], function (require, $, Defaults, Utils) { + function Options (options, $element) { + this.options = options; + + if ($element != null) { + this.fromElement($element); + } + + this.options = Defaults.apply(this.options); + + if ($element && $element.is('input')) { + var InputCompat = require(this.get('amdBase') + 'compat/inputData'); + + this.options.dataAdapter = Utils.Decorate( + this.options.dataAdapter, + InputCompat + ); + } + } + + Options.prototype.fromElement = function ($e) { + var excludedData = ['select2']; + + if (this.options.multiple == null) { + this.options.multiple = $e.prop('multiple'); + } + + if (this.options.disabled == null) { + this.options.disabled = $e.prop('disabled'); + } + + if (this.options.language == null) { + if ($e.prop('lang')) { + this.options.language = $e.prop('lang').toLowerCase(); + } else if ($e.closest('[lang]').prop('lang')) { + this.options.language = $e.closest('[lang]').prop('lang'); + } + } + + if (this.options.dir == null) { + if ($e.prop('dir')) { + this.options.dir = $e.prop('dir'); + } else if ($e.closest('[dir]').prop('dir')) { + this.options.dir = $e.closest('[dir]').prop('dir'); + } else { + this.options.dir = 'ltr'; + } + } + + $e.prop('disabled', this.options.disabled); + $e.prop('multiple', this.options.multiple); + + if (Utils.GetData($e[0], 'select2Tags')) { + if (this.options.debug && window.console && console.warn) { + console.warn( + 'Select2: The `data-select2-tags` attribute has been changed to ' + + 'use the `data-data` and `data-tags="true"` attributes and will be ' + + 'removed in future versions of Select2.' + ); + } + + Utils.StoreData($e[0], 'data', Utils.GetData($e[0], 'select2Tags')); + Utils.StoreData($e[0], 'tags', true); + } + + if (Utils.GetData($e[0], 'ajaxUrl')) { + if (this.options.debug && window.console && console.warn) { + console.warn( + 'Select2: The `data-ajax-url` attribute has been changed to ' + + '`data-ajax--url` and support for the old attribute will be removed' + + ' in future versions of Select2.' + ); + } + + $e.attr('ajax--url', Utils.GetData($e[0], 'ajaxUrl')); + Utils.StoreData($e[0], 'ajax-Url', Utils.GetData($e[0], 'ajaxUrl')); + } + + var dataset = {}; + + function upperCaseLetter(_, letter) { + return letter.toUpperCase(); + } + + // Pre-load all of the attributes which are prefixed with `data-` + for (var attr = 0; attr < $e[0].attributes.length; attr++) { + var attributeName = $e[0].attributes[attr].name; + var prefix = 'data-'; + + if (attributeName.substr(0, prefix.length) == prefix) { + // Get the contents of the attribute after `data-` + var dataName = attributeName.substring(prefix.length); + + // Get the data contents from the consistent source + // This is more than likely the jQuery data helper + var dataValue = Utils.GetData($e[0], dataName); + + // camelCase the attribute name to match the spec + var camelDataName = dataName.replace(/-([a-z])/g, upperCaseLetter); + + // Store the data attribute contents into the dataset since + dataset[camelDataName] = dataValue; + } + } + + // Prefer the element's `dataset` attribute if it exists + // jQuery 1.x does not correctly handle data attributes with multiple dashes + if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) { + dataset = $.extend(true, {}, $e[0].dataset, dataset); + } + + // Prefer our internal data cache if it exists + var data = $.extend(true, {}, Utils.GetData($e[0]), dataset); + + data = Utils._convertData(data); + + for (var key in data) { + if ($.inArray(key, excludedData) > -1) { + continue; + } + + if ($.isPlainObject(this.options[key])) { + $.extend(this.options[key], data[key]); + } else { + this.options[key] = data[key]; + } + } + + return this; + }; + + Options.prototype.get = function (key) { + return this.options[key]; + }; + + Options.prototype.set = function (key, val) { + this.options[key] = val; + }; + + return Options; +}); + +S2.define('select2/core',[ + 'jquery', + './options', + './utils', + './keys' +], function ($, Options, Utils, KEYS) { + var Select2 = function ($element, options) { + if (Utils.GetData($element[0], 'select2') != null) { + Utils.GetData($element[0], 'select2').destroy(); + } + + this.$element = $element; + + this.id = this._generateId($element); + + options = options || {}; + + this.options = new Options(options, $element); + + Select2.__super__.constructor.call(this); + + // Set up the tabindex + + var tabindex = $element.attr('tabindex') || 0; + Utils.StoreData($element[0], 'old-tabindex', tabindex); + $element.attr('tabindex', '-1'); + + // Set up containers and adapters + + var DataAdapter = this.options.get('dataAdapter'); + this.dataAdapter = new DataAdapter($element, this.options); + + var $container = this.render(); + + this._placeContainer($container); + + var SelectionAdapter = this.options.get('selectionAdapter'); + this.selection = new SelectionAdapter($element, this.options); + this.$selection = this.selection.render(); + + this.selection.position(this.$selection, $container); + + var DropdownAdapter = this.options.get('dropdownAdapter'); + this.dropdown = new DropdownAdapter($element, this.options); + this.$dropdown = this.dropdown.render(); + + this.dropdown.position(this.$dropdown, $container); + + var ResultsAdapter = this.options.get('resultsAdapter'); + this.results = new ResultsAdapter($element, this.options, this.dataAdapter); + this.$results = this.results.render(); + + this.results.position(this.$results, this.$dropdown); + + // Bind events + + var self = this; + + // Bind the container to all of the adapters + this._bindAdapters(); + + // Register any DOM event handlers + this._registerDomEvents(); + + // Register any internal event handlers + this._registerDataEvents(); + this._registerSelectionEvents(); + this._registerDropdownEvents(); + this._registerResultsEvents(); + this._registerEvents(); + + // Set the initial state + this.dataAdapter.current(function (initialData) { + self.trigger('selection:update', { + data: initialData + }); + }); + + // Hide the original select + $element.addClass('select2-hidden-accessible'); + $element.attr('aria-hidden', 'true'); + + // Synchronize any monitored attributes + this._syncAttributes(); + + Utils.StoreData($element[0], 'select2', this); + + // Ensure backwards compatibility with $element.data('select2'). + $element.data('select2', this); + }; + + Utils.Extend(Select2, Utils.Observable); + + Select2.prototype._generateId = function ($element) { + var id = ''; + + if ($element.attr('id') != null) { + id = $element.attr('id'); + } else if ($element.attr('name') != null) { + id = $element.attr('name') + '-' + Utils.generateChars(2); + } else { + id = Utils.generateChars(4); + } + + id = id.replace(/(:|\.|\[|\]|,)/g, ''); + id = 'select2-' + id; + + return id; + }; + + Select2.prototype._placeContainer = function ($container) { + $container.insertAfter(this.$element); + + var width = this._resolveWidth(this.$element, this.options.get('width')); + + if (width != null) { + $container.css('width', width); + } + }; + + Select2.prototype._resolveWidth = function ($element, method) { + var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i; + + if (method == 'resolve') { + var styleWidth = this._resolveWidth($element, 'style'); + + if (styleWidth != null) { + return styleWidth; + } + + return this._resolveWidth($element, 'element'); + } + + if (method == 'element') { + var elementWidth = $element.outerWidth(false); + + if (elementWidth <= 0) { + return 'auto'; + } + + return elementWidth + 'px'; + } + + if (method == 'style') { + var style = $element.attr('style'); + + if (typeof(style) !== 'string') { + return null; + } + + var attrs = style.split(';'); + + for (var i = 0, l = attrs.length; i < l; i = i + 1) { + var attr = attrs[i].replace(/\s/g, ''); + var matches = attr.match(WIDTH); + + if (matches !== null && matches.length >= 1) { + return matches[1]; + } + } + + return null; + } + + if (method == 'computedstyle') { + var computedStyle = window.getComputedStyle($element[0]); + + return computedStyle.width; + } + + return method; + }; + + Select2.prototype._bindAdapters = function () { + this.dataAdapter.bind(this, this.$container); + this.selection.bind(this, this.$container); + + this.dropdown.bind(this, this.$container); + this.results.bind(this, this.$container); + }; + + Select2.prototype._registerDomEvents = function () { + var self = this; + + this.$element.on('change.select2', function () { + self.dataAdapter.current(function (data) { + self.trigger('selection:update', { + data: data + }); + }); + }); + + this.$element.on('focus.select2', function (evt) { + self.trigger('focus', evt); + }); + + this._syncA = Utils.bind(this._syncAttributes, this); + this._syncS = Utils.bind(this._syncSubtree, this); + + if (this.$element[0].attachEvent) { + this.$element[0].attachEvent('onpropertychange', this._syncA); + } + + var observer = window.MutationObserver || + window.WebKitMutationObserver || + window.MozMutationObserver + ; + + if (observer != null) { + this._observer = new observer(function (mutations) { + $.each(mutations, self._syncA); + $.each(mutations, self._syncS); + }); + this._observer.observe(this.$element[0], { + attributes: true, + childList: true, + subtree: false + }); + } else if (this.$element[0].addEventListener) { + this.$element[0].addEventListener( + 'DOMAttrModified', + self._syncA, + false + ); + this.$element[0].addEventListener( + 'DOMNodeInserted', + self._syncS, + false + ); + this.$element[0].addEventListener( + 'DOMNodeRemoved', + self._syncS, + false + ); + } + }; + + Select2.prototype._registerDataEvents = function () { + var self = this; + + this.dataAdapter.on('*', function (name, params) { + self.trigger(name, params); + }); + }; + + Select2.prototype._registerSelectionEvents = function () { + var self = this; + var nonRelayEvents = ['toggle', 'focus']; + + this.selection.on('toggle', function () { + self.toggleDropdown(); + }); + + this.selection.on('focus', function (params) { + self.focus(params); + }); + + this.selection.on('*', function (name, params) { + if ($.inArray(name, nonRelayEvents) !== -1) { + return; + } + + self.trigger(name, params); + }); + }; + + Select2.prototype._registerDropdownEvents = function () { + var self = this; + + this.dropdown.on('*', function (name, params) { + self.trigger(name, params); + }); + }; + + Select2.prototype._registerResultsEvents = function () { + var self = this; + + this.results.on('*', function (name, params) { + self.trigger(name, params); + }); + }; + + Select2.prototype._registerEvents = function () { + var self = this; + + this.on('open', function () { + self.$container.addClass('select2-container--open'); + }); + + this.on('close', function () { + self.$container.removeClass('select2-container--open'); + }); + + this.on('enable', function () { + self.$container.removeClass('select2-container--disabled'); + }); + + this.on('disable', function () { + self.$container.addClass('select2-container--disabled'); + }); + + this.on('blur', function () { + self.$container.removeClass('select2-container--focus'); + }); + + this.on('query', function (params) { + if (!self.isOpen()) { + self.trigger('open', {}); + } + + this.dataAdapter.query(params, function (data) { + self.trigger('results:all', { + data: data, + query: params + }); + }); + }); + + this.on('query:append', function (params) { + this.dataAdapter.query(params, function (data) { + self.trigger('results:append', { + data: data, + query: params + }); + }); + }); + + this.on('keypress', function (evt) { + var key = evt.which; + + if (self.isOpen()) { + if (key === KEYS.ESC || key === KEYS.TAB || + (key === KEYS.UP && evt.altKey)) { + self.close(); + + evt.preventDefault(); + } else if (key === KEYS.ENTER) { + self.trigger('results:select', {}); + + evt.preventDefault(); + } else if ((key === KEYS.SPACE && evt.ctrlKey)) { + self.trigger('results:toggle', {}); + + evt.preventDefault(); + } else if (key === KEYS.UP) { + self.trigger('results:previous', {}); + + evt.preventDefault(); + } else if (key === KEYS.DOWN) { + self.trigger('results:next', {}); + + evt.preventDefault(); + } + } else { + if (key === KEYS.ENTER || key === KEYS.SPACE || + (key === KEYS.DOWN && evt.altKey)) { + self.open(); + + evt.preventDefault(); + } + } + }); + }; + + Select2.prototype._syncAttributes = function () { + this.options.set('disabled', this.$element.prop('disabled')); + + if (this.options.get('disabled')) { + if (this.isOpen()) { + this.close(); + } + + this.trigger('disable', {}); + } else { + this.trigger('enable', {}); + } + }; + + Select2.prototype._syncSubtree = function (evt, mutations) { + var changed = false; + var self = this; + + // Ignore any mutation events raised for elements that aren't options or + // optgroups. This handles the case when the select element is destroyed + if ( + evt && evt.target && ( + evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP' + ) + ) { + return; + } + + if (!mutations) { + // If mutation events aren't supported, then we can only assume that the + // change affected the selections + changed = true; + } else if (mutations.addedNodes && mutations.addedNodes.length > 0) { + for (var n = 0; n < mutations.addedNodes.length; n++) { + var node = mutations.addedNodes[n]; + + if (node.selected) { + changed = true; + } + } + } else if (mutations.removedNodes && mutations.removedNodes.length > 0) { + changed = true; + } + + // Only re-pull the data if we think there is a change + if (changed) { + this.dataAdapter.current(function (currentData) { + self.trigger('selection:update', { + data: currentData + }); + }); + } + }; + + /** + * Override the trigger method to automatically trigger pre-events when + * there are events that can be prevented. + */ + Select2.prototype.trigger = function (name, args) { + var actualTrigger = Select2.__super__.trigger; + var preTriggerMap = { + 'open': 'opening', + 'close': 'closing', + 'select': 'selecting', + 'unselect': 'unselecting', + 'clear': 'clearing' + }; + + if (args === undefined) { + args = {}; + } + + if (name in preTriggerMap) { + var preTriggerName = preTriggerMap[name]; + var preTriggerArgs = { + prevented: false, + name: name, + args: args + }; + + actualTrigger.call(this, preTriggerName, preTriggerArgs); + + if (preTriggerArgs.prevented) { + args.prevented = true; + + return; + } + } + + actualTrigger.call(this, name, args); + }; + + Select2.prototype.toggleDropdown = function () { + if (this.options.get('disabled')) { + return; + } + + if (this.isOpen()) { + this.close(); + } else { + this.open(); + } + }; + + Select2.prototype.open = function () { + if (this.isOpen()) { + return; + } + + this.trigger('query', {}); + }; + + Select2.prototype.close = function () { + if (!this.isOpen()) { + return; + } + + this.trigger('close', {}); + }; + + Select2.prototype.isOpen = function () { + return this.$container.hasClass('select2-container--open'); + }; + + Select2.prototype.hasFocus = function () { + return this.$container.hasClass('select2-container--focus'); + }; + + Select2.prototype.focus = function (data) { + // No need to re-trigger focus events if we are already focused + if (this.hasFocus()) { + return; + } + + this.$container.addClass('select2-container--focus'); + this.trigger('focus', {}); + }; + + Select2.prototype.enable = function (args) { + if (this.options.get('debug') && window.console && console.warn) { + console.warn( + 'Select2: The `select2("enable")` method has been deprecated and will' + + ' be removed in later Select2 versions. Use $element.prop("disabled")' + + ' instead.' + ); + } + + if (args == null || args.length === 0) { + args = [true]; + } + + var disabled = !args[0]; + + this.$element.prop('disabled', disabled); + }; + + Select2.prototype.data = function () { + if (this.options.get('debug') && + arguments.length > 0 && window.console && console.warn) { + console.warn( + 'Select2: Data can no longer be set using `select2("data")`. You ' + + 'should consider setting the value instead using `$element.val()`.' + ); + } + + var data = []; + + this.dataAdapter.current(function (currentData) { + data = currentData; + }); + + return data; + }; + + Select2.prototype.val = function (args) { + if (this.options.get('debug') && window.console && console.warn) { + console.warn( + 'Select2: The `select2("val")` method has been deprecated and will be' + + ' removed in later Select2 versions. Use $element.val() instead.' + ); + } + + if (args == null || args.length === 0) { + return this.$element.val(); + } + + var newVal = args[0]; + + if ($.isArray(newVal)) { + newVal = $.map(newVal, function (obj) { + return obj.toString(); + }); + } + + this.$element.val(newVal).trigger('change'); + }; + + Select2.prototype.destroy = function () { + this.$container.remove(); + + if (this.$element[0].detachEvent) { + this.$element[0].detachEvent('onpropertychange', this._syncA); + } + + if (this._observer != null) { + this._observer.disconnect(); + this._observer = null; + } else if (this.$element[0].removeEventListener) { + this.$element[0] + .removeEventListener('DOMAttrModified', this._syncA, false); + this.$element[0] + .removeEventListener('DOMNodeInserted', this._syncS, false); + this.$element[0] + .removeEventListener('DOMNodeRemoved', this._syncS, false); + } + + this._syncA = null; + this._syncS = null; + + this.$element.off('.select2'); + this.$element.attr('tabindex', + Utils.GetData(this.$element[0], 'old-tabindex')); + + this.$element.removeClass('select2-hidden-accessible'); + this.$element.attr('aria-hidden', 'false'); + Utils.RemoveData(this.$element[0]); + this.$element.removeData('select2'); + + this.dataAdapter.destroy(); + this.selection.destroy(); + this.dropdown.destroy(); + this.results.destroy(); + + this.dataAdapter = null; + this.selection = null; + this.dropdown = null; + this.results = null; + }; + + Select2.prototype.render = function () { + var $container = $( + '' + + '' + + '' + + '' + ); + + $container.attr('dir', this.options.get('dir')); + + this.$container = $container; + + this.$container.addClass('select2-container--' + this.options.get('theme')); + + Utils.StoreData($container[0], 'element', this.$element); + + return $container; + }; + + return Select2; +}); + +S2.define('jquery-mousewheel',[ + 'jquery' +], function ($) { + // Used to shim jQuery.mousewheel for non-full builds. + return $; +}); + +S2.define('jquery.select2',[ + 'jquery', + 'jquery-mousewheel', + + './select2/core', + './select2/defaults', + './select2/utils' +], function ($, _, Select2, Defaults, Utils) { + if ($.fn.select2 == null) { + // All methods that should return the element + var thisMethods = ['open', 'close', 'destroy']; + + $.fn.select2 = function (options) { + options = options || {}; + + if (typeof options === 'object') { + this.each(function () { + var instanceOptions = $.extend(true, {}, options); + + var instance = new Select2($(this), instanceOptions); + }); + + return this; + } else if (typeof options === 'string') { + var ret; + var args = Array.prototype.slice.call(arguments, 1); + + this.each(function () { + var instance = Utils.GetData(this, 'select2'); + + if (instance == null && window.console && console.error) { + console.error( + 'The select2(\'' + options + '\') method was called on an ' + + 'element that is not using Select2.' + ); + } + + ret = instance[options].apply(instance, args); + }); + + // Check if we should be returning `this` + if ($.inArray(options, thisMethods) > -1) { + return this; + } + + return ret; + } else { + throw new Error('Invalid arguments for Select2: ' + options); + } + }; + } + + if ($.fn.select2.defaults == null) { + $.fn.select2.defaults = Defaults; + } + + return Select2; +}); + + // Return the AMD loader configuration so it can be used outside of this file + return { + define: S2.define, + require: S2.require + }; +}()); + + // Autoload the jQuery bindings + // We know that all of the modules exist above this, so we're safe + var select2 = S2.require('jquery.select2'); + + // Hold the AMD module references on the jQuery function that was just loaded + // This allows Select2 to use the internal loader outside of this file, such + // as in the language files. + jQuery.fn.select2.amd = S2; + + // Return the Select2 instance for anyone who is importing it. + return select2; +})); diff --git a/app/assets/javascripts/select2.min.js b/app/assets/javascripts/select2.min.js new file mode 100755 index 000000000..9def5ae32 --- /dev/null +++ b/app/assets/javascripts/select2.min.js @@ -0,0 +1,2 @@ +/*! Select2 4.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */ +!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t),t}:n(jQuery)}(function(u){var e=function(){if(u&&u.fn&&u.fn.select2&&u.fn.select2.amd)var e=u.fn.select2.amd;var t,n,r,h,o,s,f,g,m,v,y,_,i,a,w;function b(e,t){return i.call(e,t)}function l(e,t){var n,r,i,o,s,a,l,c,u,d,p,h=t&&t.split("/"),f=y.map,g=f&&f["*"]||{};if(e){for(s=(e=e.split("/")).length-1,y.nodeIdCompat&&w.test(e[s])&&(e[s]=e[s].replace(w,"")),"."===e[0].charAt(0)&&h&&(e=h.slice(0,h.length-1).concat(e)),u=0;u":">",'"':""","'":"'","/":"/"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},i.appendMany=function(e,t){if("1.7"===o.fn.jquery.substr(0,3)){var n=o();o.map(t,function(e){n=n.add(e)}),t=n}e.append(t)},i.__cache={};var n=0;return i.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2-id");return null==t&&(e.id?(t=e.id,e.setAttribute("data-select2-id",t)):(e.setAttribute("data-select2-id",++n),t=n.toString())),t},i.StoreData=function(e,t,n){var r=i.GetUniqueElementId(e);i.__cache[r]||(i.__cache[r]={}),i.__cache[r][t]=n},i.GetData=function(e,t){var n=i.GetUniqueElementId(e);return t?i.__cache[n]&&null!=i.__cache[n][t]?i.__cache[n][t]:o(e).data(t):i.__cache[n]},i.RemoveData=function(e){var t=i.GetUniqueElementId(e);null!=i.__cache[t]&&delete i.__cache[t]},i}),e.define("select2/results",["jquery","./utils"],function(h,f){function r(e,t,n){this.$element=e,this.data=n,this.options=t,r.__super__.constructor.call(this)}return f.Extend(r,f.Observable),r.prototype.render=function(){var e=h('
          ');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e},r.prototype.clear=function(){this.$results.empty()},r.prototype.displayMessage=function(e){var t=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var n=h('
        • '),r=this.options.get("translations").get(e.message);n.append(t(r(e.args))),n[0].className+=" select2-results__message",this.$results.append(n)},r.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},r.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n",{class:"select2-results__options select2-results__options--nested"});p.append(l),s.append(a),s.append(p)}else this.template(e,t);return f.StoreData(t,"data",e),t},r.prototype.bind=function(t,e){var l=this,n=t.id+"-results";this.$results.attr("id",n),t.on("results:all",function(e){l.clear(),l.append(e.data),t.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),t.on("results:append",function(e){l.append(e.data),t.isOpen()&&l.setClasses()}),t.on("query",function(e){l.hideMessages(),l.showLoading(e)}),t.on("select",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("open",function(){l.$results.attr("aria-expanded","true"),l.$results.attr("aria-hidden","false"),l.setClasses(),l.ensureHighlightVisible()}),t.on("close",function(){l.$results.attr("aria-expanded","false"),l.$results.attr("aria-hidden","true"),l.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=l.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=l.getHighlightedResults();if(0!==e.length){var t=f.GetData(e[0],"data");"true"==e.attr("aria-selected")?l.trigger("close",{}):l.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e);if(!(n<=0)){var r=n-1;0===e.length&&(r=0);var i=t.eq(r);i.trigger("mouseenter");var o=l.$results.offset().top,s=i.offset().top,a=l.$results.scrollTop()+(s-o);0===r?l.$results.scrollTop(0):s-o<0&&l.$results.scrollTop(a)}}),t.on("results:next",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e)+1;if(!(n>=t.length)){var r=t.eq(n);r.trigger("mouseenter");var i=l.$results.offset().top+l.$results.outerHeight(!1),o=r.offset().top+r.outerHeight(!1),s=l.$results.scrollTop()+o-i;0===n?l.$results.scrollTop(0):ithis.$results.outerHeight()||o<0)&&this.$results.scrollTop(i)}},r.prototype.template=function(e,t){var n=this.options.get("templateResult"),r=this.options.get("escapeMarkup"),i=n(e,t);null==i?t.style.display="none":"string"==typeof i?t.innerHTML=r(i):h(t).append(i)},r}),e.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),e.define("select2/selection/base",["jquery","../utils","../keys"],function(n,r,i){function o(e,t){this.$element=e,this.options=t,o.__super__.constructor.call(this)}return r.Extend(o,r.Observable),o.prototype.render=function(){var e=n('');return this._tabindex=0,null!=r.GetData(this.$element[0],"old-tabindex")?this._tabindex=r.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),this.$selection=e},o.prototype.bind=function(e,t){var n=this,r=(e.id,e.id+"-results");this.container=e,this.$selection.on("focus",function(e){n.trigger("focus",e)}),this.$selection.on("blur",function(e){n._handleBlur(e)}),this.$selection.on("keydown",function(e){n.trigger("keypress",e),e.which===i.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){n.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){n.update(e.data)}),e.on("open",function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",r),n._attachCloseHandler(e)}),e.on("close",function(){n.$selection.attr("aria-expanded","false"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),n.$selection.trigger("focus"),n._detachCloseHandler(e)}),e.on("enable",function(){n.$selection.attr("tabindex",n._tabindex)}),e.on("disable",function(){n.$selection.attr("tabindex","-1")})},o.prototype._handleBlur=function(e){var t=this;window.setTimeout(function(){document.activeElement==t.$selection[0]||n.contains(t.$selection[0],document.activeElement)||t.trigger("blur",e)},1)},o.prototype._attachCloseHandler=function(e){n(document.body).on("mousedown.select2."+e.id,function(e){var t=n(e.target).closest(".select2");n(".select2.select2-container--open").each(function(){n(this);this!=t[0]&&r.GetData(this,"element").select2("close")})})},o.prototype._detachCloseHandler=function(e){n(document.body).off("mousedown.select2."+e.id)},o.prototype.position=function(e,t){t.find(".selection").append(e)},o.prototype.destroy=function(){this._detachCloseHandler(this.container)},o.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},o}),e.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,r){function i(){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e.addClass("select2-selection--single"),e.html(''),e},i.prototype.bind=function(t,e){var n=this;i.__super__.bind.apply(this,arguments);var r=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",r).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",r),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),t.on("focus",function(e){t.isOpen()||n.$selection.trigger("focus")})},i.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},i.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},i.prototype.selectionContainer=function(){return e("")},i.prototype.update=function(e){if(0!==e.length){var t=e[0],n=this.$selection.find(".select2-selection__rendered"),r=this.display(t,n);n.empty().append(r),n.attr("title",t.title||t.text)}else this.clear()},i}),e.define("select2/selection/multiple",["jquery","./base","../utils"],function(i,e,a){function n(e,t){n.__super__.constructor.apply(this,arguments)}return a.Extend(n,e),n.prototype.render=function(){var e=n.__super__.render.call(this);return e.addClass("select2-selection--multiple"),e.html('
            '),e},n.prototype.bind=function(e,t){var r=this;n.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){r.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(e){if(!r.options.get("disabled")){var t=i(this).parent(),n=a.GetData(t[0],"data");r.trigger("unselect",{originalEvent:e,data:n})}})},n.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},n.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},n.prototype.selectionContainer=function(){return i('
          • ×
          • ')},n.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=0;n×');a.StoreData(r[0],"data",t),this.$selection.find(".select2-selection__rendered").prepend(r)}},e}),e.define("select2/selection/search",["jquery","../utils","../keys"],function(r,s,a){function e(e,t,n){e.call(this,t,n)}return e.prototype.render=function(e){var t=r('');this.$searchContainer=t,this.$search=t.find("input");var n=e.call(this);return this._transferTabIndex(),n},e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("open",function(){r.$search.trigger("focus")}),t.on("close",function(){r.$search.val(""),r.$search.removeAttr("aria-activedescendant"),r.$search.trigger("focus")}),t.on("enable",function(){r.$search.prop("disabled",!1),r._transferTabIndex()}),t.on("disable",function(){r.$search.prop("disabled",!0)}),t.on("focus",function(e){r.$search.trigger("focus")}),t.on("results:focus",function(e){r.$search.attr("aria-activedescendant",e.id)}),this.$selection.on("focusin",".select2-search--inline",function(e){r.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){r._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){if(e.stopPropagation(),r.trigger("keypress",e),r._keyUpPrevented=e.isDefaultPrevented(),e.which===a.BACKSPACE&&""===r.$search.val()){var t=r.$searchContainer.prev(".select2-selection__choice");if(0this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.query=function(n,r,i){var o=this;this.current(function(e){var t=null!=e?e.length:0;0=o.maximumSelectionLength?o.trigger("results:message",{message:"maximumSelected",args:{maximum:o.maximumSelectionLength}}):n.call(o,r,i)})},e}),e.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('');return e.attr("dir",this.options.get("dir")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),e.define("select2/dropdown/search",["jquery","../utils"],function(i,e){function t(){}return t.prototype.render=function(e){var t=e.call(this),n=i('');return this.$searchContainer=n,this.$search=n.find("input"),t.prepend(n),t},t.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),this.$search.on("keydown",function(e){r.trigger("keypress",e),r._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(e){i(this).off("keyup")}),this.$search.on("keyup input",function(e){r.handleSearch(e)}),t.on("open",function(){r.$search.attr("tabindex",0),r.$search.trigger("focus"),window.setTimeout(function(){r.$search.trigger("focus")},0)}),t.on("close",function(){r.$search.attr("tabindex",-1),r.$search.val(""),r.$search.trigger("blur")}),t.on("focus",function(){t.isOpen()||r.$search.trigger("focus")}),t.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(r.showSearch(e)?r.$searchContainer.removeClass("select2-search--hide"):r.$searchContainer.addClass("select2-search--hide"))})},t.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},t.prototype.showSearch=function(e,t){return!0},t}),e.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,r){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,r)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),r=t.length-1;0<=r;r--){var i=t[r];this.placeholder.id===i.id&&n.splice(r,1)}return n},e}),e.define("select2/dropdown/infiniteScroll",["jquery"],function(n){function e(e,t,n,r){this.lastParams={},e.call(this,t,n,r),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("query",function(e){r.lastParams=e,r.loading=!0}),t.on("query:append",function(e){r.lastParams=e,r.loading=!0}),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},e.prototype.loadMoreIfNeeded=function(){var e=n.contains(document.documentElement,this.$loadingMore[0]);if(!this.loading&&e){var t=this.$results.offset().top+this.$results.outerHeight(!1);this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=t+50&&this.loadMore()}},e.prototype.loadMore=function(){this.loading=!0;var e=n.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=n('
          • '),t=this.options.get("translations").get("loadingMore");return e.html(t(this.lastParams)),e},e}),e.define("select2/dropdown/attachBody",["jquery","../utils"],function(f,a){function e(e,t,n){this.$dropdownParent=n.get("dropdownParent")||f(document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var r=this,i=!1;e.call(this,t,n),t.on("open",function(){r._showDropdown(),r._attachPositioningHandler(t),i||(i=!0,t.on("results:all",function(){r._positionDropdown(),r._resizeDropdown()}),t.on("results:append",function(){r._positionDropdown(),r._resizeDropdown()}))}),t.on("close",function(){r._hideDropdown(),r._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=f(""),n=e.call(this);return t.append(n),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._attachPositioningHandler=function(e,t){var n=this,r="scroll.select2."+t.id,i="resize.select2."+t.id,o="orientationchange.select2."+t.id,s=this.$container.parents().filter(a.hasScroll);s.each(function(){a.StoreData(this,"select2-scroll-position",{x:f(this).scrollLeft(),y:f(this).scrollTop()})}),s.on(r,function(e){var t=a.GetData(this,"select2-scroll-position");f(this).scrollTop(t.y)}),f(window).on(r+" "+i+" "+o,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n="scroll.select2."+t.id,r="resize.select2."+t.id,i="orientationchange.select2."+t.id;this.$container.parents().filter(a.hasScroll).off(n),f(window).off(n+" "+r+" "+i)},e.prototype._positionDropdown=function(){var e=f(window),t=this.$dropdown.hasClass("select2-dropdown--above"),n=this.$dropdown.hasClass("select2-dropdown--below"),r=null,i=this.$container.offset();i.bottom=i.top+this.$container.outerHeight(!1);var o={height:this.$container.outerHeight(!1)};o.top=i.top,o.bottom=i.top+o.height;var s=this.$dropdown.outerHeight(!1),a=e.scrollTop(),l=e.scrollTop()+e.height(),c=ai.bottom+s,d={left:i.left,top:o.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h=p.offset();d.top-=h.top,d.left-=h.left,t||n||(r="below"),u||!c||t?!c&&u&&t&&(r="below"):r="above",("above"==r||t&&"below"!==r)&&(d.top=o.top-h.top-s),null!=r&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+r),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+r)),this.$dropdownContainer.css(d)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),e.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,r){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,r)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,r=0;r');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container.addClass("select2-container--"+this.options.get("theme")),u.StoreData(e[0],"element",this.$element),e},d}),e.define("jquery-mousewheel",["jquery"],function(e){return e}),e.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],function(i,e,o,t,s){if(null==i.fn.select2){var a=["open","close","destroy"];i.fn.select2=function(t){if("object"==typeof(t=t||{}))return this.each(function(){var e=i.extend(!0,{},t);new o(i(this),e)}),this;if("string"!=typeof t)throw new Error("Invalid arguments for Select2: "+t);var n,r=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=s.GetData(this,"select2");null==e&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),n=e[t].apply(e,r)}),-1 .content { + flex: 1; + font-size: 14px; + + .box { + padding: 20px; + border-radius: 5px; + background: #fff; + } + } + + /* 面包屑 */ + .breadcrumb { + padding-left: 5px; + font-size: 20px; + background: unset; + } + + /* 内容表格 */ + table { + table-layout: fixed; + + td { + vertical-align: middle; + } + + tr { + &.no-data { + &:hover { + color: darkgrey; + background: unset; + } + + & > td { + text-align: center; + height: 300px; + } + } + } + } + + .action-container { + .action { + padding: 0 3px; + } + } + + /* 分页 */ + .paginate-container { + margin-top: 20px; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + + .paginate-total { + margin-bottom: 10px; + color: darkgrey; + } + + .pagination { + margin-bottom: 0px; + } + } + + /* 搜索表单 */ + .search-form-container { + display: flex; + margin-bottom: 20px; + + .search-form { + flex: 1; + + * { font-size: 14px; } + + select, input { + margin-right: 10px; + font-size: 14px; + } + } + } + + .global-error { + color: grey; + min-height: 300px; + + &-code { + font-size: 80px; + } + + &-text { + font-size: 24px; + } + } + + .nav-tabs { + .nav-link { + padding: 0.5rem 2rem; + } + } +} + diff --git a/app/assets/stylesheets/admins/daily-school-statistics.scss b/app/assets/stylesheets/admins/daily-school-statistics.scss new file mode 100644 index 000000000..d54881b77 --- /dev/null +++ b/app/assets/stylesheets/admins/daily-school-statistics.scss @@ -0,0 +1,5 @@ +.admins-daily-school-statistics-index-page { + .daily-school-statistic-list-container { + text-align: center; + } +} \ No newline at end of file diff --git a/app/assets/stylesheets/admins/identity-authentications.scss b/app/assets/stylesheets/admins/identity-authentications.scss new file mode 100644 index 000000000..417581058 --- /dev/null +++ b/app/assets/stylesheets/admins/identity-authentications.scss @@ -0,0 +1,9 @@ +.admins-identity-authentications-index-page { + .identity-authentication-list-container { + span { + &.apply-status-1 { color: #28a745; } + &.apply-status-2 { color: #dc3545; } + &.apply-status-3 { color: #6c757d; } + } + } +} \ No newline at end of file diff --git a/app/assets/stylesheets/admins/professional-authentications.scss b/app/assets/stylesheets/admins/professional-authentications.scss new file mode 100644 index 000000000..6ef78f92d --- /dev/null +++ b/app/assets/stylesheets/admins/professional-authentications.scss @@ -0,0 +1,9 @@ +.admins-professional-authentications-index-page { + .professional-authentication-list-container { + span { + &.apply-status-1 { color: #28a745; } + &.apply-status-2 { color: #dc3545; } + &.apply-status-3 { color: #6c757d; } + } + } +} \ No newline at end of file diff --git a/app/assets/stylesheets/admins/school-statistics.scss b/app/assets/stylesheets/admins/school-statistics.scss new file mode 100644 index 000000000..2bbcef5a3 --- /dev/null +++ b/app/assets/stylesheets/admins/school-statistics.scss @@ -0,0 +1,43 @@ +.admins-school-statistics-index-page { + .school-statistic-list-form { + .time-select { + flex: 1; + } + + .type-box { + .btn { margin: 0 5px; } + } + + .search-input { + width: 220px; + } + + .contrast-date-container { + display: flex; + align-items: center; + } + } + + .school-statistic-list-container { + .contrast-column-select { + position: absolute; + right: 30px; + top: 15px; + width: 130px; + } + + .relative { + position: relative; + } + + .right-border::after { + position: absolute; + top: 10px; + right: 0; + content: ''; + width: 0; + height: 20px; + border-right: 1px solid #000; + } + } +} \ No newline at end of file diff --git a/app/assets/stylesheets/admins/sidebar.scss b/app/assets/stylesheets/admins/sidebar.scss new file mode 100644 index 000000000..be7da93ac --- /dev/null +++ b/app/assets/stylesheets/admins/sidebar.scss @@ -0,0 +1,215 @@ +#sidebar { + min-width: 200px; + max-width: 200px; + background: #272822; + color: #fff; + transition: all 0.5s; + overflow-y: scroll; + + &::-webkit-scrollbar { + display:none + } + + &.active { + min-width: 60px; + max-width: 60px; + text-align: center; + + .sidebar-header { + padding: 10px; + display: flex; + flex-direction: column; + + &-logo { + padding-left: 5px; + overflow: hidden; + margin-bottom: 10px; + } + } + + ul li a { + padding: 10px; + text-align: center; + font-size: 0.85em; + display: flex; + justify-content: center; + + span { display: none } + + i { + margin-right: 0; + display: block; + font-size: 1.8em; + margin-bottom: 5px; + width: 30px; + height: 20px; + } + } + + .dropdown-toggle::after { + top: auto; + bottom: 10px; + right: 50%; + -webkit-transform: translateX(50%); + -ms-transform: translateX(50%); + transform: translateX(50%); + } + + ul ul a { + padding: 10px !important; + + span { display: none } + + i { + margin-left: 0px; + display: block; + font-size: 0.8em; + width: 30px; + height: 10px; + } + } + } + + .sidebar-header { + padding: 20px; + background: #272822; + display: flex; + flex-direction: row; + justify-content: space-between; + } + + #sidebarCollapse { + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + text-align: right; + + &.active { + width: 40px; + height: 30px; + background: #3f3f3f; + border: 1px solid grey; + border-radius: 3px; + + i.fold { display: none; } + i.unfold { display: block; } + } + + i.fold { + display: block; + } + i.unfold { display: none; } + } + + a, a:hover, a:focus { + color: inherit; + text-decoration: none; + transition: all 0.3s; + } + + & > ul > li > a > i { + width: 14px; + height: 14px; + } + + ul { + &.components { + padding: 20px 0; + border-bottom: 1px solid #3f3f3f; + } + + p { + color: #fff; + padding: 10px; + } + + li > a { + padding: 10px; + font-size: 1em; + display: block; + text-align: left; + + i { + margin-right: 10px; + font-size: 1em; + margin-bottom: 5px; + } + } + + li a { + &:hover, &.active { + color: #fff; + background: #276891; + } + } + + li.active > a, a[aria-expanded="true"] { + color: #fff; + //background: #276891; + } + + ul a { + font-size: 0.9em !important; + padding-left: 30px !important; + background: #3f3f3f; + } + } +} + +@media (max-width: 768px) { + #sidebar { + &.active { + padding: 10px 5px; + min-width: 40px; + max-width: 40px; + text-align: center; + margin-left: 0; + transform: none; + + .sidebar-header { + padding: 0px; + + .sidebar-header-logo { + display: none; + } + + #sidebarCollapse { + width: 30px; + height: 20px; + } + } + + ul li a { + padding: 10px; + font-size: 0.85em; + + i { + margin-right: 0; + display: block; + margin-bottom: 5px; + } + } + + & > ul > li > a > i { + font-size: 1.8em; + } + + ul ul a { + padding: 10px !important; + } + } + + .sidebar-header { + } + } + + .dropdown-toggle::after { + top: auto; + bottom: 10px; + right: 50%; + -webkit-transform: translateX(50%); + -ms-transform: translateX(50%); + transform: translateX(50%); + } +} diff --git a/app/assets/stylesheets/admins/users.scss b/app/assets/stylesheets/admins/users.scss new file mode 100644 index 000000000..925917bcc --- /dev/null +++ b/app/assets/stylesheets/admins/users.scss @@ -0,0 +1,36 @@ +.admins-users-index-page { + .user-list-form { + } + + .users-list-container { + text-align: center; + } +} +.admins-users-edit-page, .admins-users-update-page { + .user-edit-container { + .user-info { + &-content { + padding-top: 5px; + padding-bottom: 5px; + height: 80px; + } + + &-name { + flex: 2; + font-size: 16px; + } + + &-auth { + flex: 1; + + i.fa { + margin-right: 10px; + font-size: 16px; + width: 16px; + height: 16px; + text-align: center; + } + } + } + } +} \ No newline at end of file diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss new file mode 100644 index 000000000..b0692d898 --- /dev/null +++ b/app/assets/stylesheets/application.scss @@ -0,0 +1 @@ +@import "bootstrap"; \ No newline at end of file diff --git a/public/admin/Coco/assets/libs/bootstrap-xeditable/css/bootstrap-editable.css b/app/assets/stylesheets/bootstrap-datepicker.scss similarity index 63% rename from public/admin/Coco/assets/libs/bootstrap-xeditable/css/bootstrap-editable.css rename to app/assets/stylesheets/bootstrap-datepicker.scss index 423a9b49e..c8a35bb38 100644 --- a/public/admin/Coco/assets/libs/bootstrap-xeditable/css/bootstrap-editable.css +++ b/app/assets/stylesheets/bootstrap-datepicker.scss @@ -1,244 +1,26 @@ -/*! X-editable - v1.5.1 -* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery -* http://github.com/vitalets/x-editable -* Copyright (c) 2013 Vitaliy Potapov; Licensed MIT */ -.editableform { - margin-bottom: 0; /* overwrites bootstrap margin */ -} - -.editableform .control-group { - margin-bottom: 0; /* overwrites bootstrap margin */ - white-space: nowrap; /* prevent wrapping buttons on new line */ - line-height: 20px; /* overwriting bootstrap line-height. See #133 */ -} - -/* - BS3 width:1005 for inputs breaks editable form in popup - See: https://github.com/vitalets/x-editable/issues/393 -*/ -.editableform .form-control { - width: 100%; -} - -.editable-buttons { - display: inline-block; /* should be inline to take effect of parent's white-space: nowrap */ - vertical-align: top; - margin-left: 7px; - /* inline-block emulation for IE7*/ - zoom: 1; - *display: inline; -} - -.editable-buttons.editable-buttons-bottom { - display: block; - margin-top: 7px; - margin-left: 0; -} - -.editable-input { - vertical-align: top; - display: inline-block; /* should be inline to take effect of parent's white-space: nowrap */ - width: auto; /* bootstrap-responsive has width: 100% that breakes layout */ - white-space: normal; /* reset white-space decalred in parent*/ - /* display-inline emulation for IE7*/ - zoom: 1; - *display: inline; -} - -.editable-buttons .editable-cancel { - margin-left: 7px; -} - -/*for jquery-ui buttons need set height to look more pretty*/ -.editable-buttons button.ui-button-icon-only { - height: 24px; - width: 30px; -} - -.editableform-loading { - background: url('../img/loading.gif') center center no-repeat; - height: 25px; - width: auto; - min-width: 25px; -} - -.editable-inline .editableform-loading { - background-position: left 5px; -} - - .editable-error-block { - max-width: 300px; - margin: 5px 0 0 0; - width: auto; - white-space: normal; -} - -/*add padding for jquery ui*/ -.editable-error-block.ui-state-error { - padding: 3px; -} - -.editable-error { - color: red; -} - -/* ---- For specific types ---- */ - -.editableform .editable-date { - padding: 0; - margin: 0; - float: left; -} - -/* move datepicker icon to center of add-on button. See https://github.com/vitalets/x-editable/issues/183 */ -.editable-inline .add-on .icon-th { - margin-top: 3px; - margin-left: 1px; -} - - -/* checklist vertical alignment */ -.editable-checklist label input[type="checkbox"], -.editable-checklist label span { - vertical-align: middle; - margin: 0; -} - -.editable-checklist label { - white-space: nowrap; -} - -/* set exact width of textarea to fit buttons toolbar */ -.editable-wysihtml5 { - width: 566px; - height: 250px; -} - -/* clear button shown as link in date inputs */ -.editable-clear { - clear: both; - font-size: 0.9em; - text-decoration: none; - text-align: right; -} - -/* IOS-style clear button for text inputs */ -.editable-clear-x { - background: url('../img/clear.png') center center no-repeat; - display: block; - width: 13px; - height: 13px; - position: absolute; - opacity: 0.6; - z-index: 100; - - top: 50%; - right: 6px; - margin-top: -6px; - -} - -.editable-clear-x:hover { - opacity: 1; -} - -.editable-pre-wrapped { - white-space: pre-wrap; -} -.editable-container.editable-popup { - max-width: none !important; /* without this rule poshytip/tooltip does not stretch */ -} - -.editable-container.popover { - width: auto; /* without this rule popover does not stretch */ -} - -.editable-container.editable-inline { - display: inline-block; - vertical-align: middle; - width: auto; - /* inline-block emulation for IE7*/ - zoom: 1; - *display: inline; -} - -.editable-container.ui-widget { - font-size: inherit; /* jqueryui widget font 1.1em too big, overwrite it */ - z-index: 9990; /* should be less than select2 dropdown z-index to close dropdown first when click */ -} -.editable-click, -a.editable-click, -a.editable-click:hover { - text-decoration: none; - border-bottom: dashed 1px #0088cc; -} - -.editable-click.editable-disabled, -a.editable-click.editable-disabled, -a.editable-click.editable-disabled:hover { - color: #585858; - cursor: default; - border-bottom: none; -} - -.editable-empty, .editable-empty:hover, .editable-empty:focus{ - font-style: italic; - color: #DD1144; - /* border-bottom: none; */ - text-decoration: none; -} - -.editable-unsaved { - font-weight: bold; -} - -.editable-unsaved:after { -/* content: '*'*/ -} - -.editable-bg-transition { - -webkit-transition: background-color 1400ms ease-out; - -moz-transition: background-color 1400ms ease-out; - -o-transition: background-color 1400ms ease-out; - -ms-transition: background-color 1400ms ease-out; - transition: background-color 1400ms ease-out; -} - -/*see https://github.com/vitalets/x-editable/issues/139 */ -.form-horizontal .editable -{ - padding-top: 5px; - display:inline-block; -} - - /*! - * Datepicker for Bootstrap - * - * Copyright 2012 Stefan Petre - * Improvements by Andrew Rowls - * Licensed under the Apache License v2.0 - * http://www.apache.org/licenses/LICENSE-2.0 + * Datepicker for Bootstrap v1.9.0 (https://github.com/uxsolutions/bootstrap-datepicker) * + * Licensed under the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0) */ + .datepicker { padding: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; direction: ltr; - /*.dow { - border-top: 1px solid #ddd !important; - }*/ - } .datepicker-inline { width: 220px; } -.datepicker.datepicker-rtl { +.datepicker-rtl { direction: rtl; } -.datepicker.datepicker-rtl table tr td span { +.datepicker-rtl.dropdown-menu { + left: auto; +} +.datepicker-rtl table tr td span { float: right; } .datepicker-dropdown { @@ -250,36 +32,56 @@ a.editable-click.editable-disabled:hover { display: inline-block; border-left: 7px solid transparent; border-right: 7px solid transparent; - border-bottom: 7px solid #ccc; + border-bottom: 7px solid #999; + border-top: 0; border-bottom-color: rgba(0, 0, 0, 0.2); position: absolute; - top: -7px; - left: 6px; } .datepicker-dropdown:after { content: ''; display: inline-block; border-left: 6px solid transparent; border-right: 6px solid transparent; - border-bottom: 6px solid #ffffff; + border-bottom: 6px solid #fff; + border-top: 0; position: absolute; - top: -6px; +} +.datepicker-dropdown.datepicker-orient-left:before { + left: 6px; +} +.datepicker-dropdown.datepicker-orient-left:after { left: 7px; } -.datepicker > div { - display: none; +.datepicker-dropdown.datepicker-orient-right:before { + right: 6px; } -.datepicker.days div.datepicker-days { - display: block; +.datepicker-dropdown.datepicker-orient-right:after { + right: 7px; } -.datepicker.months div.datepicker-months { - display: block; +.datepicker-dropdown.datepicker-orient-bottom:before { + top: -7px; } -.datepicker.years div.datepicker-years { - display: block; +.datepicker-dropdown.datepicker-orient-bottom:after { + top: -6px; +} +.datepicker-dropdown.datepicker-orient-top:before { + bottom: -7px; + border-bottom: 0; + border-top: 7px solid #999; +} +.datepicker-dropdown.datepicker-orient-top:after { + bottom: -6px; + border-bottom: 0; + border-top: 6px solid #fff; } .datepicker table { margin: 0; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } .datepicker td, .datepicker th { @@ -295,31 +97,36 @@ a.editable-click.editable-disabled:hover { .table-striped .datepicker table tr th { background-color: transparent; } -.datepicker table tr td.day:hover { - background: #eeeeee; +.datepicker table tr td.day:hover, +.datepicker table tr td.day.focused { + background: #eee; cursor: pointer; } .datepicker table tr td.old, .datepicker table tr td.new { - color: #999999; + color: #999; } .datepicker table tr td.disabled, .datepicker table tr td.disabled:hover { background: none; - color: #999999; + color: #999; cursor: default; } +.datepicker table tr td.highlighted { + background: #d9edf7; + border-radius: 0; +} .datepicker table tr td.today, .datepicker table tr td.today:hover, .datepicker table tr td.today.disabled, .datepicker table tr td.today.disabled:hover { background-color: #fde19a; - background-image: -moz-linear-gradient(top, #fdd49a, #fdf59a); - background-image: -ms-linear-gradient(top, #fdd49a, #fdf59a); + background-image: -moz-linear-gradient(to bottom, #fdd49a, #fdf59a); + background-image: -ms-linear-gradient(to bottom, #fdd49a, #fdf59a); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fdd49a), to(#fdf59a)); - background-image: -webkit-linear-gradient(top, #fdd49a, #fdf59a); - background-image: -o-linear-gradient(top, #fdd49a, #fdf59a); - background-image: linear-gradient(top, #fdd49a, #fdf59a); + background-image: -webkit-linear-gradient(to bottom, #fdd49a, #fdf59a); + background-image: -o-linear-gradient(to bottom, #fdd49a, #fdf59a); + background-image: linear-gradient(to bottom, #fdd49a, #fdf59a); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fdd49a', endColorstr='#fdf59a', GradientType=0); border-color: #fdf59a #fdf59a #fbed50; @@ -369,7 +176,7 @@ a.editable-click.editable-disabled:hover { .datepicker table tr td.range:hover, .datepicker table tr td.range.disabled, .datepicker table tr td.range.disabled:hover { - background: #eeeeee; + background: #eee; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; @@ -379,12 +186,12 @@ a.editable-click.editable-disabled:hover { .datepicker table tr td.range.today.disabled, .datepicker table tr td.range.today.disabled:hover { background-color: #f3d17a; - background-image: -moz-linear-gradient(top, #f3c17a, #f3e97a); - background-image: -ms-linear-gradient(top, #f3c17a, #f3e97a); + background-image: -moz-linear-gradient(to bottom, #f3c17a, #f3e97a); + background-image: -ms-linear-gradient(to bottom, #f3c17a, #f3e97a); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f3c17a), to(#f3e97a)); - background-image: -webkit-linear-gradient(top, #f3c17a, #f3e97a); - background-image: -o-linear-gradient(top, #f3c17a, #f3e97a); - background-image: linear-gradient(top, #f3c17a, #f3e97a); + background-image: -webkit-linear-gradient(to bottom, #f3c17a, #f3e97a); + background-image: -o-linear-gradient(to bottom, #f3c17a, #f3e97a); + background-image: linear-gradient(to bottom, #f3c17a, #f3e97a); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f3c17a', endColorstr='#f3e97a', GradientType=0); border-color: #f3e97a #f3e97a #edde34; @@ -431,12 +238,12 @@ a.editable-click.editable-disabled:hover { .datepicker table tr td.selected.disabled, .datepicker table tr td.selected.disabled:hover { background-color: #9e9e9e; - background-image: -moz-linear-gradient(top, #b3b3b3, #808080); - background-image: -ms-linear-gradient(top, #b3b3b3, #808080); + background-image: -moz-linear-gradient(to bottom, #b3b3b3, #808080); + background-image: -ms-linear-gradient(to bottom, #b3b3b3, #808080); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#b3b3b3), to(#808080)); - background-image: -webkit-linear-gradient(top, #b3b3b3, #808080); - background-image: -o-linear-gradient(top, #b3b3b3, #808080); - background-image: linear-gradient(top, #b3b3b3, #808080); + background-image: -webkit-linear-gradient(to bottom, #b3b3b3, #808080); + background-image: -o-linear-gradient(to bottom, #b3b3b3, #808080); + background-image: linear-gradient(to bottom, #b3b3b3, #808080); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#b3b3b3', endColorstr='#808080', GradientType=0); border-color: #808080 #808080 #595959; @@ -482,14 +289,14 @@ a.editable-click.editable-disabled:hover { .datepicker table tr td.active.disabled, .datepicker table tr td.active.disabled:hover { background-color: #006dcc; - background-image: -moz-linear-gradient(top, #0088cc, #0044cc); - background-image: -ms-linear-gradient(top, #0088cc, #0044cc); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); - background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); - background-image: -o-linear-gradient(top, #0088cc, #0044cc); - background-image: linear-gradient(top, #0088cc, #0044cc); + background-image: -moz-linear-gradient(to bottom, #08c, #0044cc); + background-image: -ms-linear-gradient(to bottom, #08c, #0044cc); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#0044cc)); + background-image: -webkit-linear-gradient(to bottom, #08c, #0044cc); + background-image: -o-linear-gradient(to bottom, #08c, #0044cc); + background-image: linear-gradient(to bottom, #08c, #0044cc); background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#08c', endColorstr='#0044cc', GradientType=0); border-color: #0044cc #0044cc #002a80; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); @@ -540,13 +347,14 @@ a.editable-click.editable-disabled:hover { -moz-border-radius: 4px; border-radius: 4px; } -.datepicker table tr td span:hover { - background: #eeeeee; +.datepicker table tr td span:hover, +.datepicker table tr td span.focused { + background: #eee; } .datepicker table tr td span.disabled, .datepicker table tr td span.disabled:hover { background: none; - color: #999999; + color: #999; cursor: default; } .datepicker table tr td span.active, @@ -554,14 +362,14 @@ a.editable-click.editable-disabled:hover { .datepicker table tr td span.active.disabled, .datepicker table tr td span.active.disabled:hover { background-color: #006dcc; - background-image: -moz-linear-gradient(top, #0088cc, #0044cc); - background-image: -ms-linear-gradient(top, #0088cc, #0044cc); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); - background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); - background-image: -o-linear-gradient(top, #0088cc, #0044cc); - background-image: linear-gradient(top, #0088cc, #0044cc); + background-image: -moz-linear-gradient(to bottom, #08c, #0044cc); + background-image: -ms-linear-gradient(to bottom, #08c, #0044cc); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#0044cc)); + background-image: -webkit-linear-gradient(to bottom, #08c, #0044cc); + background-image: -o-linear-gradient(to bottom, #08c, #0044cc); + background-image: linear-gradient(to bottom, #08c, #0044cc); background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#08c', endColorstr='#0044cc', GradientType=0); border-color: #0044cc #0044cc #002a80; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); @@ -602,18 +410,26 @@ a.editable-click.editable-disabled:hover { } .datepicker table tr td span.old, .datepicker table tr td span.new { - color: #999999; + color: #999; } -.datepicker th.datepicker-switch { +.datepicker .datepicker-switch { width: 145px; } -.datepicker thead tr:first-child th, +.datepicker .datepicker-switch, +.datepicker .prev, +.datepicker .next, .datepicker tfoot tr th { cursor: pointer; } -.datepicker thead tr:first-child th:hover, +.datepicker .datepicker-switch:hover, +.datepicker .prev:hover, +.datepicker .next:hover, .datepicker tfoot tr th:hover { - background: #eeeeee; + background: #eee; +} +.datepicker .prev.disabled, +.datepicker .next.disabled { + visibility: hidden; } .datepicker .cw { font-size: 10px; @@ -621,16 +437,13 @@ a.editable-click.editable-disabled:hover { padding: 0 2px 0 5px; vertical-align: middle; } -.datepicker thead tr:first-child th.cw { - cursor: default; - background-color: transparent; +.input-append.date .add-on, +.input-prepend.date .add-on { + cursor: pointer; } .input-append.date .add-on i, .input-prepend.date .add-on i { - display: block; - cursor: pointer; - width: 16px; - height: 16px; + margin-top: 3px; } .input-daterange input { text-align: center; @@ -654,10 +467,11 @@ a.editable-click.editable-disabled:hover { font-weight: normal; line-height: 18px; text-align: center; - text-shadow: 0 1px 0 #ffffff; + text-shadow: 0 1px 0 #fff; vertical-align: middle; - background-color: #eeeeee; + background-color: #eee; border: 1px solid #ccc; margin-left: -5px; margin-right: -5px; } +/*# sourceMappingURL=bootstrap-datepicker.css.map */ \ No newline at end of file diff --git a/app/assets/stylesheets/bootstrap-datepicker.standalone.scss b/app/assets/stylesheets/bootstrap-datepicker.standalone.scss new file mode 100644 index 000000000..0e7014851 --- /dev/null +++ b/app/assets/stylesheets/bootstrap-datepicker.standalone.scss @@ -0,0 +1,510 @@ +/*! + * Datepicker for Bootstrap v1.9.0 (https://github.com/uxsolutions/bootstrap-datepicker) + * + * Licensed under the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0) + */ + +.datepicker { + padding: 4px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + direction: ltr; +} +.datepicker-inline { + width: 220px; +} +.datepicker-rtl { + direction: rtl; +} +.datepicker-rtl.dropdown-menu { + left: auto; +} +.datepicker-rtl table tr td span { + float: right; +} +.datepicker-dropdown { + top: 0; + left: 0; +} +.datepicker-dropdown:before { + content: ''; + display: inline-block; + border-left: 7px solid transparent; + border-right: 7px solid transparent; + border-bottom: 7px solid #999; + border-top: 0; + border-bottom-color: rgba(0, 0, 0, 0.2); + position: absolute; +} +.datepicker-dropdown:after { + content: ''; + display: inline-block; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-bottom: 6px solid #fff; + border-top: 0; + position: absolute; +} +.datepicker-dropdown.datepicker-orient-left:before { + left: 6px; +} +.datepicker-dropdown.datepicker-orient-left:after { + left: 7px; +} +.datepicker-dropdown.datepicker-orient-right:before { + right: 6px; +} +.datepicker-dropdown.datepicker-orient-right:after { + right: 7px; +} +.datepicker-dropdown.datepicker-orient-bottom:before { + top: -7px; +} +.datepicker-dropdown.datepicker-orient-bottom:after { + top: -6px; +} +.datepicker-dropdown.datepicker-orient-top:before { + bottom: -7px; + border-bottom: 0; + border-top: 7px solid #999; +} +.datepicker-dropdown.datepicker-orient-top:after { + bottom: -6px; + border-bottom: 0; + border-top: 6px solid #fff; +} +.datepicker table { + margin: 0; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.datepicker td, +.datepicker th { + text-align: center; + width: 20px; + height: 20px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + border: none; +} +.table-striped .datepicker table tr td, +.table-striped .datepicker table tr th { + background-color: transparent; +} +.datepicker table tr td.day:hover, +.datepicker table tr td.day.focused { + background: #eee; + cursor: pointer; +} +.datepicker table tr td.old, +.datepicker table tr td.new { + color: #999; +} +.datepicker table tr td.disabled, +.datepicker table tr td.disabled:hover { + background: none; + color: #999; + cursor: default; +} +.datepicker table tr td.highlighted { + background: #d9edf7; + border-radius: 0; +} +.datepicker table tr td.today, +.datepicker table tr td.today:hover, +.datepicker table tr td.today.disabled, +.datepicker table tr td.today.disabled:hover { + background-color: #fde19a; + background-image: -moz-linear-gradient(to bottom, #fdd49a, #fdf59a); + background-image: -ms-linear-gradient(to bottom, #fdd49a, #fdf59a); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fdd49a), to(#fdf59a)); + background-image: -webkit-linear-gradient(to bottom, #fdd49a, #fdf59a); + background-image: -o-linear-gradient(to bottom, #fdd49a, #fdf59a); + background-image: linear-gradient(to bottom, #fdd49a, #fdf59a); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fdd49a', endColorstr='#fdf59a', GradientType=0); + border-color: #fdf59a #fdf59a #fbed50; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + color: #000; +} +.datepicker table tr td.today:hover, +.datepicker table tr td.today:hover:hover, +.datepicker table tr td.today.disabled:hover, +.datepicker table tr td.today.disabled:hover:hover, +.datepicker table tr td.today:active, +.datepicker table tr td.today:hover:active, +.datepicker table tr td.today.disabled:active, +.datepicker table tr td.today.disabled:hover:active, +.datepicker table tr td.today.active, +.datepicker table tr td.today:hover.active, +.datepicker table tr td.today.disabled.active, +.datepicker table tr td.today.disabled:hover.active, +.datepicker table tr td.today.disabled, +.datepicker table tr td.today:hover.disabled, +.datepicker table tr td.today.disabled.disabled, +.datepicker table tr td.today.disabled:hover.disabled, +.datepicker table tr td.today[disabled], +.datepicker table tr td.today:hover[disabled], +.datepicker table tr td.today.disabled[disabled], +.datepicker table tr td.today.disabled:hover[disabled] { + background-color: #fdf59a; +} +.datepicker table tr td.today:active, +.datepicker table tr td.today:hover:active, +.datepicker table tr td.today.disabled:active, +.datepicker table tr td.today.disabled:hover:active, +.datepicker table tr td.today.active, +.datepicker table tr td.today:hover.active, +.datepicker table tr td.today.disabled.active, +.datepicker table tr td.today.disabled:hover.active { + background-color: #fbf069 \9; +} +.datepicker table tr td.today:hover:hover { + color: #000; +} +.datepicker table tr td.today.active:hover { + color: #fff; +} +.datepicker table tr td.range, +.datepicker table tr td.range:hover, +.datepicker table tr td.range.disabled, +.datepicker table tr td.range.disabled:hover { + background: #eee; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} +.datepicker table tr td.range.today, +.datepicker table tr td.range.today:hover, +.datepicker table tr td.range.today.disabled, +.datepicker table tr td.range.today.disabled:hover { + background-color: #f3d17a; + background-image: -moz-linear-gradient(to bottom, #f3c17a, #f3e97a); + background-image: -ms-linear-gradient(to bottom, #f3c17a, #f3e97a); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f3c17a), to(#f3e97a)); + background-image: -webkit-linear-gradient(to bottom, #f3c17a, #f3e97a); + background-image: -o-linear-gradient(to bottom, #f3c17a, #f3e97a); + background-image: linear-gradient(to bottom, #f3c17a, #f3e97a); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f3c17a', endColorstr='#f3e97a', GradientType=0); + border-color: #f3e97a #f3e97a #edde34; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} +.datepicker table tr td.range.today:hover, +.datepicker table tr td.range.today:hover:hover, +.datepicker table tr td.range.today.disabled:hover, +.datepicker table tr td.range.today.disabled:hover:hover, +.datepicker table tr td.range.today:active, +.datepicker table tr td.range.today:hover:active, +.datepicker table tr td.range.today.disabled:active, +.datepicker table tr td.range.today.disabled:hover:active, +.datepicker table tr td.range.today.active, +.datepicker table tr td.range.today:hover.active, +.datepicker table tr td.range.today.disabled.active, +.datepicker table tr td.range.today.disabled:hover.active, +.datepicker table tr td.range.today.disabled, +.datepicker table tr td.range.today:hover.disabled, +.datepicker table tr td.range.today.disabled.disabled, +.datepicker table tr td.range.today.disabled:hover.disabled, +.datepicker table tr td.range.today[disabled], +.datepicker table tr td.range.today:hover[disabled], +.datepicker table tr td.range.today.disabled[disabled], +.datepicker table tr td.range.today.disabled:hover[disabled] { + background-color: #f3e97a; +} +.datepicker table tr td.range.today:active, +.datepicker table tr td.range.today:hover:active, +.datepicker table tr td.range.today.disabled:active, +.datepicker table tr td.range.today.disabled:hover:active, +.datepicker table tr td.range.today.active, +.datepicker table tr td.range.today:hover.active, +.datepicker table tr td.range.today.disabled.active, +.datepicker table tr td.range.today.disabled:hover.active { + background-color: #efe24b \9; +} +.datepicker table tr td.selected, +.datepicker table tr td.selected:hover, +.datepicker table tr td.selected.disabled, +.datepicker table tr td.selected.disabled:hover { + background-color: #9e9e9e; + background-image: -moz-linear-gradient(to bottom, #b3b3b3, #808080); + background-image: -ms-linear-gradient(to bottom, #b3b3b3, #808080); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#b3b3b3), to(#808080)); + background-image: -webkit-linear-gradient(to bottom, #b3b3b3, #808080); + background-image: -o-linear-gradient(to bottom, #b3b3b3, #808080); + background-image: linear-gradient(to bottom, #b3b3b3, #808080); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#b3b3b3', endColorstr='#808080', GradientType=0); + border-color: #808080 #808080 #595959; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + color: #fff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); +} +.datepicker table tr td.selected:hover, +.datepicker table tr td.selected:hover:hover, +.datepicker table tr td.selected.disabled:hover, +.datepicker table tr td.selected.disabled:hover:hover, +.datepicker table tr td.selected:active, +.datepicker table tr td.selected:hover:active, +.datepicker table tr td.selected.disabled:active, +.datepicker table tr td.selected.disabled:hover:active, +.datepicker table tr td.selected.active, +.datepicker table tr td.selected:hover.active, +.datepicker table tr td.selected.disabled.active, +.datepicker table tr td.selected.disabled:hover.active, +.datepicker table tr td.selected.disabled, +.datepicker table tr td.selected:hover.disabled, +.datepicker table tr td.selected.disabled.disabled, +.datepicker table tr td.selected.disabled:hover.disabled, +.datepicker table tr td.selected[disabled], +.datepicker table tr td.selected:hover[disabled], +.datepicker table tr td.selected.disabled[disabled], +.datepicker table tr td.selected.disabled:hover[disabled] { + background-color: #808080; +} +.datepicker table tr td.selected:active, +.datepicker table tr td.selected:hover:active, +.datepicker table tr td.selected.disabled:active, +.datepicker table tr td.selected.disabled:hover:active, +.datepicker table tr td.selected.active, +.datepicker table tr td.selected:hover.active, +.datepicker table tr td.selected.disabled.active, +.datepicker table tr td.selected.disabled:hover.active { + background-color: #666666 \9; +} +.datepicker table tr td.active, +.datepicker table tr td.active:hover, +.datepicker table tr td.active.disabled, +.datepicker table tr td.active.disabled:hover { + background-color: #006dcc; + background-image: -moz-linear-gradient(to bottom, #08c, #0044cc); + background-image: -ms-linear-gradient(to bottom, #08c, #0044cc); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#0044cc)); + background-image: -webkit-linear-gradient(to bottom, #08c, #0044cc); + background-image: -o-linear-gradient(to bottom, #08c, #0044cc); + background-image: linear-gradient(to bottom, #08c, #0044cc); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#08c', endColorstr='#0044cc', GradientType=0); + border-color: #0044cc #0044cc #002a80; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + color: #fff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); +} +.datepicker table tr td.active:hover, +.datepicker table tr td.active:hover:hover, +.datepicker table tr td.active.disabled:hover, +.datepicker table tr td.active.disabled:hover:hover, +.datepicker table tr td.active:active, +.datepicker table tr td.active:hover:active, +.datepicker table tr td.active.disabled:active, +.datepicker table tr td.active.disabled:hover:active, +.datepicker table tr td.active.active, +.datepicker table tr td.active:hover.active, +.datepicker table tr td.active.disabled.active, +.datepicker table tr td.active.disabled:hover.active, +.datepicker table tr td.active.disabled, +.datepicker table tr td.active:hover.disabled, +.datepicker table tr td.active.disabled.disabled, +.datepicker table tr td.active.disabled:hover.disabled, +.datepicker table tr td.active[disabled], +.datepicker table tr td.active:hover[disabled], +.datepicker table tr td.active.disabled[disabled], +.datepicker table tr td.active.disabled:hover[disabled] { + background-color: #0044cc; +} +.datepicker table tr td.active:active, +.datepicker table tr td.active:hover:active, +.datepicker table tr td.active.disabled:active, +.datepicker table tr td.active.disabled:hover:active, +.datepicker table tr td.active.active, +.datepicker table tr td.active:hover.active, +.datepicker table tr td.active.disabled.active, +.datepicker table tr td.active.disabled:hover.active { + background-color: #003399 \9; +} +.datepicker table tr td span { + display: block; + width: 23%; + height: 54px; + line-height: 54px; + float: left; + margin: 1%; + cursor: pointer; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.datepicker table tr td span:hover, +.datepicker table tr td span.focused { + background: #eee; +} +.datepicker table tr td span.disabled, +.datepicker table tr td span.disabled:hover { + background: none; + color: #999; + cursor: default; +} +.datepicker table tr td span.active, +.datepicker table tr td span.active:hover, +.datepicker table tr td span.active.disabled, +.datepicker table tr td span.active.disabled:hover { + background-color: #006dcc; + background-image: -moz-linear-gradient(to bottom, #08c, #0044cc); + background-image: -ms-linear-gradient(to bottom, #08c, #0044cc); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#0044cc)); + background-image: -webkit-linear-gradient(to bottom, #08c, #0044cc); + background-image: -o-linear-gradient(to bottom, #08c, #0044cc); + background-image: linear-gradient(to bottom, #08c, #0044cc); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#08c', endColorstr='#0044cc', GradientType=0); + border-color: #0044cc #0044cc #002a80; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + color: #fff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); +} +.datepicker table tr td span.active:hover, +.datepicker table tr td span.active:hover:hover, +.datepicker table tr td span.active.disabled:hover, +.datepicker table tr td span.active.disabled:hover:hover, +.datepicker table tr td span.active:active, +.datepicker table tr td span.active:hover:active, +.datepicker table tr td span.active.disabled:active, +.datepicker table tr td span.active.disabled:hover:active, +.datepicker table tr td span.active.active, +.datepicker table tr td span.active:hover.active, +.datepicker table tr td span.active.disabled.active, +.datepicker table tr td span.active.disabled:hover.active, +.datepicker table tr td span.active.disabled, +.datepicker table tr td span.active:hover.disabled, +.datepicker table tr td span.active.disabled.disabled, +.datepicker table tr td span.active.disabled:hover.disabled, +.datepicker table tr td span.active[disabled], +.datepicker table tr td span.active:hover[disabled], +.datepicker table tr td span.active.disabled[disabled], +.datepicker table tr td span.active.disabled:hover[disabled] { + background-color: #0044cc; +} +.datepicker table tr td span.active:active, +.datepicker table tr td span.active:hover:active, +.datepicker table tr td span.active.disabled:active, +.datepicker table tr td span.active.disabled:hover:active, +.datepicker table tr td span.active.active, +.datepicker table tr td span.active:hover.active, +.datepicker table tr td span.active.disabled.active, +.datepicker table tr td span.active.disabled:hover.active { + background-color: #003399 \9; +} +.datepicker table tr td span.old, +.datepicker table tr td span.new { + color: #999; +} +.datepicker .datepicker-switch { + width: 145px; +} +.datepicker .datepicker-switch, +.datepicker .prev, +.datepicker .next, +.datepicker tfoot tr th { + cursor: pointer; +} +.datepicker .datepicker-switch:hover, +.datepicker .prev:hover, +.datepicker .next:hover, +.datepicker tfoot tr th:hover { + background: #eee; +} +.datepicker .prev.disabled, +.datepicker .next.disabled { + visibility: hidden; +} +.datepicker .cw { + font-size: 10px; + width: 12px; + padding: 0 2px 0 5px; + vertical-align: middle; +} +.input-append.date .add-on, +.input-prepend.date .add-on { + cursor: pointer; +} +.input-append.date .add-on i, +.input-prepend.date .add-on i { + margin-top: 3px; +} +.input-daterange input { + text-align: center; +} +.input-daterange input:first-child { + -webkit-border-radius: 3px 0 0 3px; + -moz-border-radius: 3px 0 0 3px; + border-radius: 3px 0 0 3px; +} +.input-daterange input:last-child { + -webkit-border-radius: 0 3px 3px 0; + -moz-border-radius: 0 3px 3px 0; + border-radius: 0 3px 3px 0; +} +.input-daterange .add-on { + display: inline-block; + width: auto; + min-width: 16px; + height: 20px; + padding: 4px 5px; + font-weight: normal; + line-height: 20px; + text-align: center; + text-shadow: 0 1px 0 #fff; + vertical-align: middle; + background-color: #eee; + border: 1px solid #ccc; + margin-left: -5px; + margin-right: -5px; +} +.datepicker.dropdown-menu { + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + float: left; + display: none; + min-width: 160px; + list-style: none; + background-color: #fff; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.2); + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -webkit-background-clip: padding-box; + -moz-background-clip: padding; + background-clip: padding-box; + *border-right-width: 2px; + *border-bottom-width: 2px; + color: #333333; + font-size: 13px; + line-height: 20px; +} +.datepicker.dropdown-menu th, +.datepicker.datepicker-inline th, +.datepicker.dropdown-menu td, +.datepicker.datepicker-inline td { + padding: 4px 5px; +} +/*# sourceMappingURL=bootstrap-datepicker.standalone.css.map */ \ No newline at end of file diff --git a/app/assets/stylesheets/select2-bootstrap4.min.scss b/app/assets/stylesheets/select2-bootstrap4.min.scss new file mode 100755 index 000000000..f84b4090a --- /dev/null +++ b/app/assets/stylesheets/select2-bootstrap4.min.scss @@ -0,0 +1 @@ +.select2-container--bootstrap4 .select2-selection--single{height:calc(1.5em + .75rem + 2px)!important}.select2-container--bootstrap4 .select2-selection--single .select2-selection__placeholder{color:#757575;line-height:calc(1.5em + .75rem)}.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow{position:absolute;top:50%;right:3px;width:20px}.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b{top:60%;border-color:#343a40 transparent transparent;border-style:solid;border-width:5px 4px 0;width:0;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute}.select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered{line-height:calc(1.5em + .75rem)}.select2-search--dropdown .select2-search__field{border:1px solid #ced4da;border-radius:.25rem}.select2-results__message{color:#6c757d}.select2-container--bootstrap4 .select2-selection--multiple{min-height:calc(1.5em + .75rem + 2px)!important}.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__rendered{-webkit-box-sizing:border-box;box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice{color:#343a40;border:1px solid #bdc6d0;border-radius:.2rem;padding:0 5px 0 0;cursor:pointer;float:left;margin-top:.3em;margin-right:5px}.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove{color:#bdc6d0;font-weight:700;margin-left:3px;margin-right:1px;padding-right:3px;padding-left:3px;float:left}.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove:hover{color:#343a40}.select2-container{display:block}.select2-container :focus{outline:0}.input-group .select2-container--bootstrap4{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.input-group-prepend~.select2-container--bootstrap4 .select2-selection{border-top-left-radius:0;border-bottom-left-radius:0}.select2-container--bootstrap4 .select2-selection{border:1px solid #ced4da;border-radius:.25rem;width:100%}.select2-container--bootstrap4.select2-container--focus .select2-selection{border-color:#17a2b8;-webkit-box-shadow:0 0 0 .2rem rgba(0,123,255,.25);box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.select2-container--bootstrap4.select2-container--focus.select2-container--open .select2-selection{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--bootstrap4.select2-container--disabled.select2-container--focus .select2-selection,.select2-container--bootstrap4.select2-container--disabled .select2-selection{background-color:#e9ecef;cursor:not-allowed;border-color:#ced4da;-webkit-box-shadow:none;box-shadow:none}.select2-container--bootstrap4.select2-container--disabled.select2-container--focus .select2-search__field,.select2-container--bootstrap4.select2-container--disabled .select2-search__field{background-color:transparent}form.was-validated select:invalid~.select2-container--bootstrap4 .select2-selection,select.is-invalid~.select2-container--bootstrap4 .select2-selection{border-color:#dc3545}form.was-validated select:valid~.select2-container--bootstrap4 .select2-selection,select.is-valid~.select2-container--bootstrap4 .select2-selection{border-color:#28a745}.select2-container--bootstrap4 .select2-dropdown{border-color:#ced4da;border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--bootstrap4 .select2-dropdown.select2-dropdown--above{border-top:1px solid #ced4da;border-top-left-radius:.25rem;border-top-right-radius:.25rem}.select2-container--bootstrap4 .select2-dropdown .select2-results__option[aria-selected=true]{background-color:#e9ecef}.select2-container--bootstrap4 .select2-results__option--highlighted,.select2-container--bootstrap4 .select2-results__option--highlighted.select2-results__option[aria-selected=true]{background-color:#007bff;color:#f8f9fa}.select2-container--bootstrap4 .select2-results__option[role=group]{padding:0}.select2-container--bootstrap4 .select2-results>.select2-results__options{max-height:15em;overflow-y:auto}.select2-container--bootstrap4 .select2-results__group{padding:6px;display:list-item;color:#6c757d}.select2-container--bootstrap4 .select2-selection__clear{width:1.2em;height:1.2em;line-height:1.15em;padding-left:.3em;margin-top:.5em;border-radius:100%;background-color:#6c757d;color:#f8f9fa;float:right;margin-right:.3em}.select2-container--bootstrap4 .select2-selection__clear:hover{background-color:#343a40} \ No newline at end of file diff --git a/app/assets/stylesheets/select2.min.scss b/app/assets/stylesheets/select2.min.scss new file mode 100755 index 000000000..dc2315ae0 --- /dev/null +++ b/app/assets/stylesheets/select2.min.scss @@ -0,0 +1 @@ +.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right;margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb} diff --git a/app/assets/stylesheets/users/banks.scss b/app/assets/stylesheets/users/banks.scss deleted file mode 100644 index 6f7c19148..000000000 --- a/app/assets/stylesheets/users/banks.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the users/banks controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index e62dcf6ed..46b3964c2 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -33,7 +33,7 @@ class AccountsController < ApplicationController uid_logger("start register: verifi_code is #{verifi_code}, code is #{code}, time is #{Time.now.to_i - verifi_code.try(:created_at).to_i}") # check_code = (verifi_code.try(:code) == code.strip && (Time.now.to_i - verifi_code.created_at.to_i) <= 10*60) # todo 上线前请删除万能验证码"513231" - unless code == "513231" && request.host == "47.96.87.25" + unless code == "513231" && request.subdomain == "pre-newweb" return normal_status(-2, "验证码不正确") if verifi_code.try(:code) != code.strip return normal_status(-2, "验证码已失效") if !verifi_code&.effective? end diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb deleted file mode 100644 index a6911e60a..000000000 --- a/app/controllers/admin_controller.rb +++ /dev/null @@ -1,8 +0,0 @@ -class AdminController < ApplicationController - layout 'admin' - before_action :require_admin - - def index - - end -end diff --git a/app/controllers/admins/base_controller.rb b/app/controllers/admins/base_controller.rb new file mode 100644 index 000000000..6f89e7afa --- /dev/null +++ b/app/controllers/admins/base_controller.rb @@ -0,0 +1,38 @@ +class Admins::BaseController < ApplicationController + include Admins::PaginateHelper + include Admins::RenderHelper + include Admins::ErrorRescueHandler + + layout 'admin' + + before_action :require_login, :require_admin! + + after_action :rebind_event_if_ajax_render_partial + + private + + def require_login + return if User.current.logged? + + redirect_to "/login?back_url=#{CGI::escape(request.fullpath)}" + end + + def require_admin! + return if current_user.blank? || !current_user.logged? + return if current_user.admin_or_business? + + render_forbidden + end + + # 触发after ajax render partial hooks,执行一些因为局部刷新后失效的绑定事件 + def rebind_event_if_ajax_render_partial + return if request.format.symbol != :js + return if response.content_type != 'text/javascript' + + path = Rails.root.join('app/views/admins/shared/after_render_js_hook.js.erb') + return unless File.exists?(path) + + append_js = ERB.new(File.open(path).read).result + response.body += append_js + end +end \ No newline at end of file diff --git a/app/controllers/admins/daily_school_statistics_controller.rb b/app/controllers/admins/daily_school_statistics_controller.rb new file mode 100644 index 000000000..eb9c75fbc --- /dev/null +++ b/app/controllers/admins/daily_school_statistics_controller.rb @@ -0,0 +1,36 @@ +class Admins::DailySchoolStatisticsController < Admins::BaseController + def index + params[:sort_by] = params[:sort_by].presence || :teacher_count + params[:sort_direction] = params[:sort_direction].presence || :desc + + total_count, statistics = Admins::SchoolDailyStatisticService.call(params) + + @statistics = paginate statistics, total_count: total_count + + respond_to do |format| + format.html { load_statistic_total } + format.js + end + end + + def export + params[:per_page] = 10000 + _count, @schools = Admins::SchoolDailyStatisticService.call(params) + + filename = ['学校统计总表', params[:keyword], Time.zone.now.strftime('%Y%m%d%H%M%S')].join('-') << '.xlsx' + render xlsx: 'export', filename: filename + end + + private + + def load_statistic_total + @teacher_total = User.joins(:user_extension).where(user_extensions: { identity: :teacher }).count + @student_total = User.joins(:user_extension).where(user_extensions: { identity: :student }).count + @course_total = Course.count + @active_course_total = Course.where(is_end: false).count + @shixun_homework_total = HomeworkCommon.where(homework_type: 4).count + @other_homework_total = HomeworkCommon.where(homework_type: [1, 3]).count + @shixun_total = Shixun.count + @shixun_evaluate_total = SchoolReport.sum(:shixun_evaluate_count) + end +end \ No newline at end of file diff --git a/app/controllers/admins/dashboards_controller.rb b/app/controllers/admins/dashboards_controller.rb new file mode 100644 index 000000000..5d5d6b184 --- /dev/null +++ b/app/controllers/admins/dashboards_controller.rb @@ -0,0 +1,4 @@ +class Admins::DashboardsController < Admins::BaseController + def index + end +end \ No newline at end of file diff --git a/app/controllers/admins/identity_authentications_controller.rb b/app/controllers/admins/identity_authentications_controller.rb new file mode 100644 index 000000000..90758ace8 --- /dev/null +++ b/app/controllers/admins/identity_authentications_controller.rb @@ -0,0 +1,26 @@ +class Admins::IdentityAuthenticationsController < Admins::BaseController + def index + params[:status] ||= 'pending' + + applies = Admins::ApplyUserAuthenticationQuery.call(params.merge(type: 1)) + + @applies = paginate applies.preload(user: { user_extension: [:school, :department] }) + end + + def agree + Admins::IdentityAuths::AgreeApplyService.call(current_apply) + render_success_js + end + + def refuse + Admins::IdentityAuths::RefuseApplyService.call(current_apply, params) + + render_success_js + end + + private + + def current_apply + @_current_apply ||= ApplyUserAuthentication.real_name_auth.find(params[:id]) + end +end \ No newline at end of file diff --git a/app/controllers/admins/professional_authentications_controller.rb b/app/controllers/admins/professional_authentications_controller.rb new file mode 100644 index 000000000..327ee696c --- /dev/null +++ b/app/controllers/admins/professional_authentications_controller.rb @@ -0,0 +1,26 @@ +class Admins::ProfessionalAuthenticationsController < Admins::BaseController + def index + params[:status] ||= 'pending' + + applies = Admins::ApplyUserAuthenticationQuery.call(params.merge(type: 2)) + + @applies = paginate applies.preload(user: { user_extension: [:school, :department] }) + end + + def agree + Admins::ProfessionalAuths::AgreeApplyService.call(current_apply) + render_success_js + end + + def refuse + Admins::ProfessionalAuths::RefuseApplyService.call(current_apply, params) + + render_success_js + end + + private + + def current_apply + @_current_apply ||= ApplyUserAuthentication.professional_auth.find(params[:id]) + end +end \ No newline at end of file diff --git a/app/controllers/admins/school_statistics_controller.rb b/app/controllers/admins/school_statistics_controller.rb new file mode 100644 index 000000000..fdd10c70f --- /dev/null +++ b/app/controllers/admins/school_statistics_controller.rb @@ -0,0 +1,49 @@ +class Admins::SchoolStatisticsController < Admins::BaseController + before_action :contrast_column_select_options, only: [:contrast] + + def index + params[:data_type] ||= 'grow' + params[:sort_by] = params[:sort_by].presence || :teacher_increase_count + params[:sort_direction] = params[:sort_direction].presence || :desc + + service = Admins::StatisticSchoolDataGrowService.new(params) + @grow_summary = service.grow_summary + + total_count, statistics = service.call + + @statistics = paginate statistics, total_count: total_count + end + + def contrast + params[:contrast_column] = params[:contrast_column].presence || :teacher_increase_count + params[:sort_direction] ||= :desc + params[:sort_by] = :percentage + + # 无对比日期时直接返回无数据页面 + if useless_contrast_date_parameter? + @total_count = 0 + @statistics = paginate([]) + return + end + + total_count, statistics = Admins::StatisticSchoolContrastDataService.call(params) + + @statistics = paginate statistics, total_count: total_count + rescue Admins::StatisticSchoolContrastDataService::ParameterError + render_unprocessable_entity('参数错误') + end + + private + + def useless_contrast_date_parameter? + params[:begin_date].blank? && params[:end_date].blank? && + params[:other_begin_date].blank? &¶ms[:other_end_date].blank? + end + + def contrast_column_select_options + @select_options = + Admins::StatisticSchoolContrastDataService::CONTRAST_COLUMN_LIST.map do |column| + [I18n.t("school_daily_report.#{column}"), column] + end + end +end diff --git a/app/controllers/admins/users_controller.rb b/app/controllers/admins/users_controller.rb new file mode 100644 index 000000000..cdb64c71f --- /dev/null +++ b/app/controllers/admins/users_controller.rb @@ -0,0 +1,62 @@ +class Admins::UsersController < Admins::BaseController + def index + params[:sort_by] = params[:sort_by].presence || 'created_on' + params[:sort_direction] = params[:sort_direction].presence || 'desc' + + users = Admins::UserQuery.call(params) + @users = paginate users.includes(user_extension: :school) + end + + def edit + @user = User.find(params[:id]) + end + + def update + @user = User.find(params[:id]) + + Admins::UpdateUserService.call(@user, update_params) + flash[:success] = '保存成功' + redirect_to edit_admins_user_path(@user) + rescue ActiveRecord::RecordInvalid + flash.now[:danger] = '保存失败' + render 'edit' + rescue Admins::UpdateUserService::Error => ex + flash.now[:danger] = ex.message + render 'edit' + end + + def destroy + User.find(params[:id]).destroy! + + render_delete_success + end + + def lock + User.find(params[:user_id]).lock! + + render_ok + end + + def unlock + User.find(params[:user_id]).activate! + + render_ok + end + + def reward_grade + user = User.find(params[:user_id]) + return render_unprocessable_entity('金币数量必须大于0') if params[:grade].to_i <= 0 + + RewardGradeService.call(user, container_id: user.id, container_type: 'Feedback', score: params[:grade].to_i, not_unique: true) + + render_ok(grade: user.grade) + end + + private + + def update_params + params.require(:user).permit(%i[lastname nickname gender identity technical_title student_id + mail phone location location_city school_id department_id admin business is_test + password professional_certification authentication]) + end +end \ No newline at end of file diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 5ba0db363..177eb1a42 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -40,7 +40,7 @@ class ApplicationController < ActionController::Base if @user_course_identity > Course::STUDENT && @course.is_public == 0 tip_exception(401, "..") unless User.current.logged? check_account - tip_exception(409, "您没有权限进入") + tip_exception(@course.excellent ? 410 : 409, "您没有权限进入") end uid_logger("###############user_course_identity:#{@user_course_identity}") end @@ -108,6 +108,7 @@ class ApplicationController < ActionController::Base def find_course return normal_status(2, '缺少course_id参数!') if params[:course_id].blank? @course = Course.find(params[:course_id]) + tip_exception(404, "") if @course.is_delete == 1 && !current_user.admin? rescue Exception => e tip_exception(e.message) end @@ -244,7 +245,8 @@ class ApplicationController < ActionController::Base # 测试版前端需求 - if request.host == "47.96.87.25" + logger.info("subdomain:#{request.subdomain}") + if request.subdomain == "pre-newweb" if params[:debug] == 'teacher' #todo 为了测试,记得讲debug删除 User.current = User.find 81403 elsif params[:debug] == 'student' @@ -568,7 +570,7 @@ class ApplicationController < ActionController::Base end def strf_date(date) - date.blank? ? '' : date.strftime("%Y-%m-%d") + date.blank? ? '' : date.to_date.strftime("%Y-%m-%d") end def logger_error(error) diff --git a/app/controllers/concerns/admins/error_rescue_handler.rb b/app/controllers/concerns/admins/error_rescue_handler.rb new file mode 100644 index 000000000..b1e29d5ce --- /dev/null +++ b/app/controllers/concerns/admins/error_rescue_handler.rb @@ -0,0 +1,24 @@ +module Admins::ErrorRescueHandler + extend ActiveSupport::Concern + + included do + rescue_from Exception, Educoder::TipException do |e| + raise e if Rails.env.development? + + Util.logger_error e + internal_server_error + end + + rescue_from ActionView::MissingTemplate, ActiveRecord::RecordNotFound, with: :render_not_found + rescue_from ActionController::ParameterMissing do + render_unprocessable_entity('参数缺失') + end + # form validation error + rescue_from ActiveModel::ValidationError do |ex| + render_unprocessable_entity(ex.model.errors.full_messages.join(',')) + end + rescue_from ActiveRecord::RecordInvalid do |ex| + render_unprocessable_entity(ex.record.errors.full_messages.join(',')) + end + end +end \ No newline at end of file diff --git a/app/controllers/concerns/admins/paginate_helper.rb b/app/controllers/concerns/admins/paginate_helper.rb new file mode 100644 index 000000000..da7652584 --- /dev/null +++ b/app/controllers/concerns/admins/paginate_helper.rb @@ -0,0 +1,24 @@ +module Admins::PaginateHelper + extend ActiveSupport::Concern + + def offset + (page - 1) * per_page + end + + def page + params[:page].to_i <= 0 ? 1 : params[:page].to_i + end + + def per_page + params[:per_page].to_i <= 0 || params[:per_page].to_i > 100 ? 20 : params[:per_page].to_i + end + alias_method :limit, :per_page + + def paginate(relations, total_count: nil) + if relations.is_a?(Array) + Kaminari.paginate_array(relations, limit: limit, offset: offset, total_count: total_count) + else + relations.page(page).per(per_page) + end + end +end \ No newline at end of file diff --git a/app/controllers/concerns/admins/render_helper.rb b/app/controllers/concerns/admins/render_helper.rb new file mode 100644 index 000000000..3651f892b --- /dev/null +++ b/app/controllers/concerns/admins/render_helper.rb @@ -0,0 +1,48 @@ +module Admins::RenderHelper + extend ActiveSupport::Concern + + def render_forbidden + respond_to do |format| + format.html { redirect_to '/403' } + format.json { super } + end + end + + def render_not_found + respond_to do |format| + format.html { render 'admins/shared/404' } + format.js { render_js_error('资源未找到') } + format.json { render status: 404, json: { message: '资源未找到' } } + end + end + + def render_unprocessable_entity(message) + respond_to do |format| + format.html { render 'admins/shared/422' } + format.js { render_js_error(message) } + format.json { render status: 422, json: { message: message } } + end + end + alias_method :render_error, :render_unprocessable_entity + + def internal_server_error + respond_to do |format| + format.html { render 'admins/shared/500' } + format.js { render_js_error(message) } + format.json { render status: 500, json: { message: '系统错误' } } + end + end + + def render_js_template(template, **opts) + render({ template: template, formats: :js }.merge(opts)) + end + + def render_delete_success + render_js_template 'admins/shared/delete' + end + alias_method :render_success_js, :render_delete_success + + def render_js_error(message) + render_js_template 'admins/shared/error', locals: { message: message } + end +end \ No newline at end of file diff --git a/app/controllers/concerns/git_helper.rb b/app/controllers/concerns/git_helper.rb index 6a3765401..eeb4671a4 100644 --- a/app/controllers/concerns/git_helper.rb +++ b/app/controllers/concerns/git_helper.rb @@ -34,8 +34,7 @@ module GitHelper rescue Exception => e Rails.logger.error(e.message) - Rails.logger.error("#####__________文档内容获取异常") - # raise Educoder::TipException.new("文档内容获取异常") + raise Educoder::TipException.new("文档内容获取异常") end end diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 14276b4dd..e29fa8d7d 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -16,23 +16,24 @@ class CoursesController < ApplicationController before_action :check_account, only: [:new, :create, :apply_to_join_course, :join_excellent_course] before_action :check_auth, except: [:index, :show, :students, :teachers, :board_list, :mine, :all_course_groups, :left_banner, :top_banner, :apply_to_join_course, :exit_course] - before_action :set_course, :user_course_identity, only: [:show, :update, :destroy, :settings, :set_invite_code_halt, - :set_public_or_private, :search_teacher_candidate, :teachers, :apply_teachers, - :top_banner, :left_banner, :add_teacher_popup, :add_teacher, - :graduation_group_list, :create_graduation_group, :join_graduation_group, - :course_group_list, :set_course_group, :change_course_admin, :change_course_teacher, - :delete_course_teacher, :teacher_application_review, :students, :all_course_groups, - :transfer_to_course_group, :delete_from_course, :search_users, :add_students_by_search, - :base_info, :get_historical_courses, :create_group_by_importing_file, - :attahcment_category_list,:export_member_scores_excel, :duplicate_course, - :switch_to_teacher, :switch_to_assistant, :switch_to_student, :exit_course, - :informs, :update_informs, :join_excellent_course, :online_learning, - :update_task_position, :tasks_list] + before_action :set_course, only: [:show, :update, :destroy, :settings, :set_invite_code_halt, + :set_public_or_private, :search_teacher_candidate, :teachers, :apply_teachers, + :top_banner, :left_banner, :add_teacher_popup, :add_teacher, + :graduation_group_list, :create_graduation_group, :join_graduation_group, + :course_group_list, :set_course_group, :change_course_admin, :change_course_teacher, + :delete_course_teacher, :teacher_application_review, :students, :all_course_groups, + :transfer_to_course_group, :delete_from_course, :search_users, :add_students_by_search, + :base_info, :get_historical_courses, :create_group_by_importing_file, + :attahcment_category_list,:export_member_scores_excel, :duplicate_course, + :switch_to_teacher, :switch_to_assistant, :switch_to_student, :exit_course, + :informs, :update_informs, :new_informs, :online_learning, :update_task_position, :tasks_list, :join_excellent_course] + before_action :user_course_identity, except: [:join_excellent_course, :index, :create, :new, :apply_to_join_course, + :search_course_list, :get_historical_course_students, :mine, :search_slim, :board_list] before_action :teacher_allowed, only: [:update, :destroy, :settings, :search_teacher_candidate, :transfer_to_course_group, :delete_from_course, :search_users, :add_students_by_search, :get_historical_courses, :add_teacher_popup, :add_teacher] before_action :admin_allowed, only: [:set_invite_code_halt, :set_public_or_private, :change_course_admin, - :set_course_group, :create_group_by_importing_file, :update_informs, + :set_course_group, :create_group_by_importing_file, :update_informs, :new_informs, :update_task_position, :tasks_list] before_action :teacher_or_admin_allowed, only: [:graduation_group_list, :create_graduation_group, :join_graduation_group, :change_course_teacher, :export_member_scores_excel, :course_group_list, @@ -41,6 +42,7 @@ class CoursesController < ApplicationController before_action :find_board, only: :board_list before_action :validate_page_size, only: :mine before_action :course_tasks, only: [:tasks_list, :update_task_position] + before_action :validate_inform_params, only: [:update_informs, :new_informs] if RUBY_PLATFORM =~ /linux/ require 'simple_xlsx_reader' @@ -117,6 +119,7 @@ class CoursesController < ApplicationController # Get /courses/:id/settings # Edit Page def settings + @course_modules = @course.course_modules.where.not(module_type: 'activity') end # POST /courses @@ -156,6 +159,8 @@ class CoursesController < ApplicationController @course.subject.subject_members.where.not(user_id: current_user.id).each do |s_member| CourseMember.create!(course_id: @course.id, user_id: s_member.user_id, role: 2) end + + Inform.create(container: @course, description: @subject.learning_notes, name: "学习须知") end course_module_types = params[:course_module_types] @@ -177,7 +182,7 @@ class CoursesController < ApplicationController extra_params = Hash.new extra_params[:school_id] = @school.id - if @course.is_end && (course_params[:end_date].blank? || course_params[:end_date].to_date > Date.today) + if @course.is_end && (course_params[:end_date].blank? || course_params[:end_date].to_date >= Date.today) extra_params[:is_end] = 0 elsif !@course.is_end && !course_params[:end_date].blank? && course_params[:end_date].to_date < Date.today extra_params[:is_end] = 1 @@ -230,14 +235,20 @@ class CoursesController < ApplicationController end def informs - + @informs = @course.informs end - def update_informs - tip_exception("公告内容不能为空") if params[:description].blank? - inform = @course.inform || Inform.new(container: @course) + def new_informs + inform = Inform.new(container: @course) + inform.name = params[:name] inform.description = params[:description] inform.save! + normal_status("创建成功") + end + + def update_informs + inform = @course.informs.find_by(id: params[:inform_id]) + inform.update_attributes!(name: params[:name], description: params[:description]) normal_status("更新成功") end @@ -545,7 +556,7 @@ class CoursesController < ApplicationController course_member = CourseMember.find_by!(id: params[:course_member_id].to_i, course_id: @course.id) tip_exception("删除失败") if course_member.CREATOR? or course_member.STUDENT? - course_student = CourseMember.find_by(id: course_member.user_id, course_id: @course.id, role: %i[STUDENT]) + course_student = CourseMember.find_by(user_id: course_member.user_id, course_id: @course.id, role: %i[STUDENT]) course_member.destroy! course_student.update_attributes(is_active: 1) if course_student.present? && !course_student.is_active normal_status(0, "删除成功") @@ -696,12 +707,12 @@ class CoursesController < ApplicationController if order == 1 # REDO:Extension - @students = @students.includes(user: :user_extension).order("user_extensions.student_id, course_members.id") + @students = @students.includes(user: :user_extension).order("user_extensions.student_id, users.login") elsif order == 2 - @students = @students.includes(:course_group).order("course_groups.position, course_members.id") + @students = @students.includes(:course_group).order("course_groups.position, users.login") else # REDO:Extension - @students = @students.includes(user: :user_extension).order("user_extensions.student_id, course_members.id") + @students = @students.includes(user: :user_extension).order("user_extensions.student_id, users.login") end if course_group_id.present? @@ -768,8 +779,10 @@ class CoursesController < ApplicationController students.each do |student| course_member = CourseMember.find_by(id: student[:course_member_id].to_i, course_id: @course.id) if course_member.present? + member_teacher = CourseMember.find_by(user_id: course_member.user_id, course_id: @course.id, role: %i[CREATOR PROFESSOR ASSISTANT_PROFESSOR]) student_ids << course_member.user_id course_member.destroy! + member_teacher.update_attributes(is_active: 1) if member_teacher.present? end end CourseDeleteStudentDeleteWorksJob.perform_later(@course.id, student_ids) if student_ids.present? @@ -1174,6 +1187,7 @@ class CoursesController < ApplicationController # Use callbacks to share common setup or constraints between actions. def set_course @course = Course.find_by!(id: params[:id]) + tip_exception(404, "") if @course.is_delete == 1 && !current_user.admin? end # Never trust parameters from the scary internet, only allow the white list through. @@ -1191,8 +1205,8 @@ class CoursesController < ApplicationController @subject = @course.present? ? @course.subject : Subject.find_by!(id: params[:subject_id]) tip_exception("开始时间不能为空") if params[:start_date].blank? tip_exception("结束时间不能为空") if params[:end_date].blank? - tip_exception("结束时间必须晚于开始时间") if params[:end_date] <= params[:start_date] - tip_exception("开始时间和结束时间不能与往期开课时间重叠") if @course.nil? && @subject.max_course_end_date && params[:start_date] <= strf_date(@subject.max_course_end_date) + tip_exception("结束时间必须晚于开始时间") if strf_date(params[:end_date]) <= strf_date(params[:start_date]) + tip_exception("开始时间和结束时间不能与往期开课时间重叠") if @course.nil? && @subject.max_course_end_date && strf_date(params[:start_date]) <= strf_date(@subject.max_course_end_date) validate_start_end_date if @course.present? tip_exception("开放课堂必须包含公告栏和在线学习模块") unless params[:course_module_types].include?("announcement") && params[:course_module_types].include?("online_learning") end @@ -1204,8 +1218,8 @@ class CoursesController < ApplicationController def validate_start_end_date prev_course = @subject.courses.where("id < #{@course.id}").last next_course = @subject.courses.where("id > #{@course.id}").first - tip_exception("开始时间不能与往期开课时间重叠") if prev_course && params[:start_date] <= strf_date(prev_course.end_date) - tip_exception("结束时间不能与后期开课时间重叠") if next_course && params[:end_date] >= strf_date(next_course.start_date) + tip_exception("开始时间不能与往期开课时间重叠") if prev_course && strf_date(params[:start_date]) <= strf_date(prev_course.end_date) + tip_exception("结束时间不能与后期开课时间重叠") if next_course && strf_date(params[:end_date]) >= strf_date(next_course.start_date) end # 超级管理员和课堂管理员的权限判断 @@ -1252,6 +1266,11 @@ class CoursesController < ApplicationController end end + def validate_inform_params + tip_exception("公告标题不能为空") if params[:name].blank? + tip_exception("公告内容不能为空") if params[:description].blank? + end + # def find_container # case params[:container_type] # when 'shixun_homework', 'common_homework', 'group_homework' diff --git a/app/controllers/exercise_answers_controller.rb b/app/controllers/exercise_answers_controller.rb index babdd50f7..3fc27c8f2 100644 --- a/app/controllers/exercise_answers_controller.rb +++ b/app/controllers/exercise_answers_controller.rb @@ -8,7 +8,7 @@ class ExerciseAnswersController < ApplicationController begin q_type = @exercise_question.question_type #试卷的类型 choice_id = params[:exercise_choice_id].present? ? params[:exercise_choice_id] : "" - answer_text = params[:answer_text].present? ? params[:answer_text] : "" #为字符串 + answer_text = params[:answer_text].present? ? params[:answer_text].strip : "" #为字符串 if q_type < Exercise::SUBJECTIVE && (q_type != Exercise::MULTIPLE) && choice_id.blank? normal_status(-1,"请选择序号") else diff --git a/app/controllers/exercise_questions_controller.rb b/app/controllers/exercise_questions_controller.rb index 75ada699d..e6f17778a 100644 --- a/app/controllers/exercise_questions_controller.rb +++ b/app/controllers/exercise_questions_controller.rb @@ -178,6 +178,7 @@ class ExerciseQuestionsController < ApplicationController def update ActiveRecord::Base.transaction do begin + standard_answer_change = false # 更新试卷题目的内容 question_options = { :question_title => params[:question_title], @@ -227,95 +228,102 @@ class ExerciseQuestionsController < ApplicationController if standard_answer.present? if @exercise_question.question_type <= Exercise::JUDGMENT #选择题/判断题,标准答案为一个或多个 exercise_standard_choices = @exercise_answers_array.pluck(:exercise_choice_id) #问题以前的全部标准答案选项位置 - common_standard_choices = standard_answer & exercise_standard_choices # 传入的标准答案的选项位置和以前的并集,即表示不用做更改的 - old_left_standard_choices = exercise_standard_choices - common_standard_choices # 以前的差集共同的,剩余的表示需要删掉 - new_left_standard_choices = standard_answer - common_standard_choices # 传入的标准答案差集共同的,剩余的表示需要新建 - if old_left_standard_choices.count > 0 - @exercise_answers_array.standard_by_ids(old_left_standard_choices).destroy_all - end - if new_left_standard_choices.count > 0 #新建标准答案 - new_left_standard_choices.each do |s| - standard_option = { - :exercise_question_id => @exercise_question.id, - :exercise_choice_id => s.to_i #即为选择的位置参数 - } - question_standard_answer = ExerciseStandardAnswer.new(standard_option) - question_standard_answer.save + if exercise_standard_choices.sort != standard_answer.sort #表示答案有更改的 + standard_answer_change = true + common_standard_choices = standard_answer & exercise_standard_choices # 传入的标准答案的选项位置和以前的并集,即表示不用做更改的 + old_left_standard_choices = exercise_standard_choices - common_standard_choices # 以前的差集共同的,剩余的表示需要删掉 + new_left_standard_choices = standard_answer - common_standard_choices # 传入的标准答案差集共同的,剩余的表示需要新建 + if old_left_standard_choices.count > 0 + @exercise_answers_array.standard_by_ids(old_left_standard_choices).destroy_all end + if new_left_standard_choices.count > 0 #新建标准答案 + new_left_standard_choices.each do |s| + standard_option = { + :exercise_question_id => @exercise_question.id, + :exercise_choice_id => s.to_i #即为选择的位置参数 + } + question_standard_answer = ExerciseStandardAnswer.new(standard_option) + question_standard_answer.save + end - end - if standard_answer.count > 1 && @exercise_question.question_type == Exercise::SINGLE #当标准答案数大于1,且不为多选时,修改为多选 - @exercise_question.update_attribute("question_type",Exercise::MULTIPLE) - elsif standard_answer.count == 1 && @exercise_question.question_type == Exercise::MULTIPLE - @exercise_question.update_attribute("question_type",Exercise::SINGLE) + end + if standard_answer.count > 1 && @exercise_question.question_type == Exercise::SINGLE #当标准答案数大于1,且不为多选时,修改为多选 + @exercise_question.update_attribute("question_type",Exercise::MULTIPLE) + elsif standard_answer.count == 1 && @exercise_question.question_type == Exercise::MULTIPLE + @exercise_question.update_attribute("question_type",Exercise::SINGLE) + end end elsif @exercise_question.question_type == Exercise::COMPLETION #填空题 old_ex_answer = @exercise_question.exercise_standard_answers #当前问题的全部标准答案 - old_ex_answer_choice_ids = old_ex_answer.pluck(:exercise_choice_id).uniq #全部的答案数组序号 - new_ex_answer_choice_ids = standard_answer.map {|a| a[:choice_id]}.uniq #新传入的答案数组序号 - - #删除多余的选项 - if old_ex_answer_choice_ids.count > new_ex_answer_choice_ids.count #有减少的填空 - delete_ex_answer_choice_ids = old_ex_answer_choice_ids - new_ex_answer_choice_ids - old_ex_answer.standard_by_ids(delete_ex_answer_choice_ids).destroy_all - end - standard_answer.each do |aa| - null_choice_id = aa[:choice_id] - null_choice_text = aa[:answer_text] - null_choice_text_count = null_choice_text.count #当前传入的答案数量 - null_choice_text_count_array = (1..null_choice_text_count).to_a + old_ex_answer_choice_texts = old_ex_answer.pluck(:answer_text).uniq.sort + new_ex_answer_choice_texts = standard_answer.pluck(:answer_text).sum.uniq.sort + if old_ex_answer_choice_texts != new_ex_answer_choice_texts #填空题标准答案有更改时,才会更新标准答案 + new_ex_answer_choice_ids = standard_answer.map {|a| a[:choice_id]}.uniq #新传入的答案数组序号 + old_ex_answer_choice_ids = old_ex_answer.pluck(:exercise_choice_id).uniq #全部的答案数组序号 + standard_answer_change = true + #删除多余的选项 + if old_ex_answer_choice_ids.count > new_ex_answer_choice_ids.count #有减少的填空 + delete_ex_answer_choice_ids = old_ex_answer_choice_ids - new_ex_answer_choice_ids + old_ex_answer.standard_by_ids(delete_ex_answer_choice_ids).destroy_all + end + standard_answer.each do |aa| + null_choice_id = aa[:choice_id] + null_choice_text = aa[:answer_text] + null_choice_text_count = null_choice_text.count #当前传入的答案数量 + null_choice_text_count_array = (1..null_choice_text_count).to_a - ex_answer_pre = old_ex_answer.standard_by_ids(null_choice_id) #当前问题的全部答案 - ex_answer_pre_count = ex_answer_pre.count - ex_answer_pre_count_array = (1..ex_answer_pre_count).to_a + ex_answer_pre = old_ex_answer.standard_by_ids(null_choice_id) #当前问题的全部答案 + ex_answer_pre_count = ex_answer_pre.count + ex_answer_pre_count_array = (1..ex_answer_pre_count).to_a - if old_ex_answer_choice_ids.include?(null_choice_id) #以前的填空题答案包含有现在的填空序号 - if null_choice_text_count >= ex_answer_pre_count - new_add_choice = null_choice_text_count_array - ex_answer_pre_count_array - ex_answer_pre_count_array.each do |n| - standard_option = { - :exercise_question_id => @exercise_question.id, - :exercise_choice_id => null_choice_id, - :answer_text => null_choice_text[n-1] - } - ex_answer_pre[n-1].update(standard_option) - end - if new_add_choice.count > 0 #表示有新增的 - new_add_choice.each do |i| + if old_ex_answer_choice_ids.include?(null_choice_id) #以前的填空题答案包含有现在的填空序号 + if null_choice_text_count >= ex_answer_pre_count + new_add_choice = null_choice_text_count_array - ex_answer_pre_count_array + ex_answer_pre_count_array.each do |n| standard_option = { :exercise_question_id => @exercise_question.id, :exercise_choice_id => null_choice_id, - :answer_text => null_choice_text[i-1] + :answer_text => null_choice_text[n-1] } - question_standard_answer = ExerciseStandardAnswer.new(standard_option) - question_standard_answer.save + ex_answer_pre[n-1].update(standard_option) + end + if new_add_choice.count > 0 #表示有新增的 + new_add_choice.each do |i| + standard_option = { + :exercise_question_id => @exercise_question.id, + :exercise_choice_id => null_choice_id, + :answer_text => null_choice_text[i-1] + } + question_standard_answer = ExerciseStandardAnswer.new(standard_option) + question_standard_answer.save + end + end + else + new_delete_choice = ex_answer_pre_count_array - null_choice_text_count_array + null_choice_text.each_with_index do |n,index| + standard_option = { + :exercise_question_id => @exercise_question.id, + :exercise_choice_id => null_choice_id, + :answer_text => n + } + ex_answer_pre[index].update(standard_option) + end + if new_delete_choice.count > 0 #表示填空题的答案有删减的 + new_delete_choice.each do |d| + ex_answer_pre[d-1].destroy + end end end else - new_delete_choice = ex_answer_pre_count_array - null_choice_text_count_array - null_choice_text.each_with_index do |n,index| + null_choice_text.each do |n| standard_option = { :exercise_question_id => @exercise_question.id, :exercise_choice_id => null_choice_id, :answer_text => n } - ex_answer_pre[index].update(standard_option) + question_standard_answer = ExerciseStandardAnswer.new(standard_option) + question_standard_answer.save end - if new_delete_choice.count > 0 #表示填空题的答案有删减的 - new_delete_choice.each do |d| - ex_answer_pre[d-1].destroy - end - end - end - else - null_choice_text.each do |n| - standard_option = { - :exercise_question_id => @exercise_question.id, - :exercise_choice_id => null_choice_id, - :answer_text => n - } - question_standard_answer = ExerciseStandardAnswer.new(standard_option) - question_standard_answer.save end end end @@ -348,20 +356,25 @@ class ExerciseQuestionsController < ApplicationController #当试卷已发布时(试卷的总状态),当标准答案修改时,如有已提交的学生,需重新计算分数. - if @exercise.exercise_status >= Exercise::PUBLISHED - ex_users_committed = @exercise.exercise_users.exercise_user_committed - if ex_users_committed.size > 0 - ex_users_committed.each do |ex_user| - user = ex_user.user - objective_score = calculate_student_score(@exercise,user)[:total_score] - subjective_score = ex_user.subjective_score - total_score_subjective_score = subjective_score < 0.0 ? 0.0 : subjective_score - total_score = objective_score + total_score_subjective_score - ex_user.update_attributes(objective_score:objective_score,score:total_score) - end - end + if standard_answer_change && @exercise.exercise_status >= Exercise::PUBLISHED + # ex_users_committed = @exercise.exercise_users.exercise_user_committed + # if ex_users_committed.size > 0 + # ex_users_committed.each do |ex_user| + # update_objective_score = update_single_score(@exercise_question,ex_user.user_id,standard_answer) + # if update_objective_score != 0 + # objective_score = ex_user.objective_score + # new_objective_score = objective_score + update_objective_score + # total_score = ex_user.score + update_objective_score + # total_score = total_score < 0.0 ? 0.0 : total_score + # ex_user.update_attributes(objective_score:new_objective_score,score:total_score) + # end + # end + # end + normal_status(3,"修改了标准答案\n是否重新计算学生答题的成绩?") + else + normal_status(0,"试卷更新成功!") end - normal_status(0,"试卷更新成功!") + rescue Exception => e uid_logger_error(e.message) tip_exception("页面调用失败!") @@ -370,6 +383,31 @@ class ExerciseQuestionsController < ApplicationController end end + def update_scores + ActiveRecord::Base.transaction do + begin + standard_answer = params[:standard_answers] + ex_users_committed = @exercise.exercise_users.exercise_user_committed + if ex_users_committed.size > 0 + ex_users_committed.each do |ex_user| + update_objective_score = update_single_score(@exercise_question,ex_user.user_id,standard_answer) + if update_objective_score != 0 + objective_score = ex_user.objective_score + new_objective_score = objective_score + update_objective_score + total_score = ex_user.score + update_objective_score + total_score = total_score < 0.0 ? 0.0 : total_score + ex_user.update_attributes(objective_score:new_objective_score,score:total_score) + end + end + end + normal_status(0,"学生成绩更新成功") + rescue Exception => e + uid_logger_error(e.message) + tip_exception("答案删除失败!") + end + end + end + # 试卷问题的上下移动 def up_down ActiveRecord::Base.transaction do diff --git a/app/controllers/exercises_controller.rb b/app/controllers/exercises_controller.rb index c9162448b..5db704fce 100644 --- a/app/controllers/exercises_controller.rb +++ b/app/controllers/exercises_controller.rb @@ -688,7 +688,8 @@ class ExercisesController < ApplicationController def publish tip_exception("缺少截止时间参数") if params[:end_time].blank? tip_exception("截止时间不能早于当前时间") if params[:end_time] <= strf_time(Time.now) - tip_exception("截止时间不能晚于课堂结束时间") if @course.end_date.present? && params[:end_time] > strf_time(@course.end_date.end_of_day) + tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")})") if + @course.end_date.present? && params[:end_time] > strf_time(@course.end_date.end_of_day) ActiveRecord::Base.transaction do begin check_ids = Exercise.where(id: params[:check_ids]) diff --git a/app/controllers/graduation_tasks_controller.rb b/app/controllers/graduation_tasks_controller.rb index 0885eeae2..727bdb77e 100644 --- a/app/controllers/graduation_tasks_controller.rb +++ b/app/controllers/graduation_tasks_controller.rb @@ -322,6 +322,8 @@ class GraduationTasksController < ApplicationController def publish_task tip_exception("缺少截止时间参数") if params[:end_time].blank? tip_exception("截止时间必须晚于当前时间") if params[:end_time] <= strf_time(Time.now) + tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")})") if + @course.end_date.present? && params[:end_time] > @course.end_date.end_of_day ActiveRecord::Base.transaction do begin @@ -397,8 +399,8 @@ class GraduationTasksController < ApplicationController tip_exception("发布时间不能早于当前时间") if params[:publish_time] <= Time.now.strftime("%Y-%m-%d %H:%M:%S") tip_exception("截止时间不能早于当前时间") if params[:end_time] <= Time.now.strftime("%Y-%m-%d %H:%M:%S") tip_exception("截止时间不能早于发布时间") if params[:publish_time] > params[:end_time] - tip_exception("截止时间不能早于课堂结束时间") if @course.end_date.present? && - params[:end_time] > @course.end_date.end_of_day + tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")})") if + @course.end_date.present? && params[:end_time] > @course.end_date.end_of_day @task.publish_time = params[:publish_time] @task.end_time = params[:end_time] @@ -410,7 +412,8 @@ class GraduationTasksController < ApplicationController elsif @task.status < 2 tip_exception("截止时间不能为空") if params[:end_time].blank? tip_exception("截止时间不能早于当前时间") if params[:end_time] <= Time.now.strftime("%Y-%m-%d %H:%M:%S") - tip_exception("截止时间不能早于课堂结束时间") if @course.end_date.present? && params[:end_time] > @course.end_date.end_of_day + tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")})") if + @course.end_date.present? && params[:end_time] > @course.end_date.end_of_day @task.end_time = params[:end_time] end @@ -421,8 +424,8 @@ class GraduationTasksController < ApplicationController if params[:allow_late].to_i == 1 tip_exception("补交结束时间不能为空") if params[:late_time].blank? tip_exception("补交结束时间不能早于截止时间") if params[:late_time] <= @task.end_time - tip_exception("补交结束时间不能晚于课堂结束时间") if @course.end_date.present? && params[:late_time] > - @course.end_date.end_of_day + tip_exception("补交结束时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")})") if + @course.end_date.present? && params[:late_time] > @course.end_date.end_of_day tip_exception("迟交扣分应为正整数") if params[:late_penalty] && params[:late_penalty].to_i < 0 @task.allow_late = true diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index eb3576f24..081e2fdf1 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -447,7 +447,8 @@ class HomeworkCommonsController < ApplicationController tip_exception("发布时间不能早于当前时间") if params[:publish_time] <= Time.now.strftime("%Y-%m-%d %H:%M:%S") tip_exception("截止时间不能早于当前时间") if params[:end_time] <= Time.now.strftime("%Y-%m-%d %H:%M:%S") tip_exception("截止时间不能早于发布时间") if params[:publish_time] > params[:end_time] - tip_exception("截止时间不能晚于课堂结束时间") if @course.end_date.present? && params[:end_time] > @course.end_date.end_of_day + tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")})") if + @course.end_date.present? && params[:end_time] > @course.end_date.end_of_day @homework.unified_setting = 1 @homework.homework_group_settings.destroy_all @@ -469,7 +470,8 @@ class HomeworkCommonsController < ApplicationController tip_exception("发布时间不能早于当前时间") if setting[:publish_time] <= strf_time(Time.now) tip_exception("截止时间不能早于当前时间") if setting[:end_time] <= strf_time(Time.now) tip_exception("截止时间不能早于发布时间") if setting[:publish_time] > setting[:end_time] - tip_exception("截止时间不能晚于课堂结束时间") if @course.end_date.present? && setting[:end_time] > @course.end_date.end_of_day + tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")})") if + @course.end_date.present? && setting[:end_time] > @course.end_date.end_of_day publish_time = setting[:publish_time] == "" ? Time.now : setting[:publish_time] @@ -503,7 +505,8 @@ class HomeworkCommonsController < ApplicationController if @homework.end_time > Time.now && @homework.unified_setting tip_exception("截止时间不能为空") if params[:end_time].blank? tip_exception("截止时间不能早于当前时间") if params[:end_time] <= strf_time(Time.now) - tip_exception("截止时间不能晚于课堂结束时间") if @course.end_date.present? && params[:end_time] > strf_time(@course.end_date.end_of_day) + tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")})") if + @course.end_date.present? && params[:end_time] > strf_time(@course.end_date.end_of_day) @homework.end_time = params[:end_time] @@ -521,7 +524,8 @@ class HomeworkCommonsController < ApplicationController tip_exception("截止时间不能早于等于当前时间") if setting[:end_time] <= strf_time(Time.now) tip_exception("截止时间不能早于发布时间") if setting[:publish_time] > setting[:end_time] - tip_exception("截止时间不能晚于课堂结束时间") if @course.end_date.present? && setting[:end_time] > strf_time(@course.end_date.end_of_day) + tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")})") if + @course.end_date.present? && setting[:end_time] > strf_time(@course.end_date.end_of_day) group_settings.none_published.update_all(publish_time: setting[:publish_time]) group_settings.none_end.update_all(end_time: setting[:end_time]) @@ -539,7 +543,7 @@ class HomeworkCommonsController < ApplicationController current_late_penalty = @homework.late_penalty if params[:allow_late] tip_exception("补交结束时间必须晚于截止时间") if params[:late_time] <= strf_time(@homework.end_time) - tip_exception("补交结束时间不能晚于课堂结束时间") if @course.end_date.present? && params[:late_time] > + tip_exception("补交结束时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")})") if @course.end_date.present? && params[:late_time] > strf_time(@course.end_date.end_of_day) tip_exception("迟交扣分不能小于0") if params[:late_penalty] && params[:late_penalty].to_i < 0 @@ -647,7 +651,7 @@ class HomeworkCommonsController < ApplicationController tip_exception("匿评开启时间不能早于截止时间") if params[:evaluation_start] < strf_time(@homework.end_time) tip_exception("匿评结束时间不能为空") if params[:evaluation_end].blank? tip_exception("匿评截止时间必须晚于匿评开启时间") if params[:evaluation_end] <= params[:evaluation_start] - tip_exception("匿评截止时间不能晚于课堂结束时间") if @course.end_date.present? && params[:evaluation_end] > + tip_exception("匿评截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")})") if @course.end_date.present? && params[:evaluation_end] > strf_time(@course.end_date.end_of_day) tip_exception("匿评数必须为正整数") if params[:evaluation_num].blank? || params[:evaluation_num].to_i < 1 tip_exception("缺评扣分不能为空") if params[:absence_penalty].blank? @@ -675,7 +679,7 @@ class HomeworkCommonsController < ApplicationController tip_exception("匿评结束时间不能为空") if @homework.anonymous_comment && params[:evaluation_end].blank? tip_exception("匿评截止时间必须晚于匿评开启时间") if @homework.anonymous_comment && params[:evaluation_end] <= strf_time(@homework_detail_manual.evaluation_start) - tip_exception("匿评截止时间不能晚于课堂结束时间") if @homework.anonymous_comment && + tip_exception("匿评截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")})") if @homework.anonymous_comment && @course.end_date.present? && params[:evaluation_end] > strf_time(@course.end_date.end_of_day) @homework_detail_manual.evaluation_end = !@homework.anonymous_comment ? nil : params[:evaluation_end] @@ -701,7 +705,7 @@ class HomeworkCommonsController < ApplicationController tip_exception("匿评申诉结束时间不能为空") if @homework.anonymous_appeal && params[:appeal_time].blank? tip_exception("匿评开启时间不能早于匿评截止时间") if @homework.anonymous_appeal && params[:appeal_time] <= strf_time(@homework_detail_manual.evaluation_end) - tip_exception("匿评申诉结束不能晚于课堂结束时间") if @homework.anonymous_appeal && + tip_exception("匿评申诉结束不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")})") if @homework.anonymous_appeal && @course.end_date.present? && params[:appeal_time] > strf_time(@course.end_date.end_of_day) @homework_detail_manual.appeal_time = @homework.anonymous_appeal ? params[:appeal_time] : nil @@ -992,13 +996,15 @@ class HomeworkCommonsController < ApplicationController @total_count = @subjects.size if reorder != "myshixun_count" - @subjects = @subjects.page(page).per(limit).includes(:shixuns, user: [user_extension: :school]) + # @subjects = @subjects.page(page).per(limit).includes(:shixuns, user: [user_extension: :school]) + @subjects = @subjects.page(page).per(limit).includes(:shixuns) else @subjects = @subjects[offset, limit] unless @subjects.blank? subject_ids = @subjects.pluck(:id) order_ids = subject_ids.size > 0 ? subject_ids.join(',') : -1 - @subjects = Subject.where(id: subject_ids).order("field(id,#{order_ids})").includes(:shixuns, user: [user_extension: :school]) + # @subjects = Subject.where(id: subject_ids).order("field(id,#{order_ids})").includes(:shixuns, user: [user_extension: :school]) + @subjects = Subject.where(id: subject_ids).order("field(id,#{order_ids})").includes(:shixuns) end end end @@ -1052,7 +1058,8 @@ class HomeworkCommonsController < ApplicationController tip_exception("请至少选择一个分班") if params[:group_ids].blank? && @course.course_groups.size != 0 tip_exception("缺少截止时间参数") if params[:end_time].blank? tip_exception("截止时间不能早于当前时间") if params[:end_time] <= strf_time(Time.now) - tip_exception("截止时间不能晚于课堂结束时间") if @course.end_date.present? && params[:end_time] > strf_time(@course.end_date.end_of_day) + tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")})") if + @course.end_date.present? && params[:end_time] > strf_time(@course.end_date.end_of_day) homeworks = @course.homework_commons.where(id: params[:homework_ids]) homeworks = homeworks.includes(:homework_group_settings, :homework_detail_manual) diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 90da7d8e5..2302272bf 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -44,7 +44,7 @@ class MessagesController < ApplicationController @current_user = current_user || nil @messages = @message.children.preload_messages.includes(:message_detail, :praise_treads) - @messages = @messages.ordered(sort: 1) unless @message.parent_id.nil? + # @messages = @messages.ordered(sort: 1) unless @message.parent_id.nil? @user_course_identity = current_user.course_identity(@message.board.course) case @user_course_identity @@ -52,6 +52,7 @@ class MessagesController < ApplicationController @messages = @messages.visible end + @messages = @messages.reorder("messages.created_on desc") @messages = @messages.page(@page).per(@page_size) end diff --git a/app/controllers/polls_controller.rb b/app/controllers/polls_controller.rb index ba3030424..0f301dd4f 100644 --- a/app/controllers/polls_controller.rb +++ b/app/controllers/polls_controller.rb @@ -246,7 +246,8 @@ class PollsController < ApplicationController def publish tip_exception("缺少截止时间参数") if params[:end_time].blank? tip_exception("截止时间不能早于当前时间") if params[:end_time] <= strf_time(Time.now) - tip_exception("截止时间不能晚于课堂结束时间") if @course.end_date.present? && params[:end_time] > strf_time(@course.end_date.end_of_day) + tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")})") if + @course.end_date.present? && params[:end_time] > strf_time(@course.end_date.end_of_day) ActiveRecord::Base.transaction do begin check_ids = Poll.where(id: params[:check_ids]) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index bfd386e1c..d9ab31b8d 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -109,7 +109,7 @@ class ShixunsController < ApplicationController can_fork = current_user.is_certification_teacher || current_user.admin? unless can_fork @can_fork = {can_fork: "已经职业认证的教师才能fork实训", - certi_url: edu_setting('old_edu_host') + "/account/professional_certification"} + certi_url: "/account/certification"} end @current_myshixun = @shixun.current_myshixun(current_user) if @shixun.fork_from diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index 6c5481787..a62707536 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -87,14 +87,6 @@ class SubjectsController < ApplicationController @courses = @subject.courses if @subject.excellent @members = @subject.subject_members.includes(:user) - shixuns = @subject.shixuns.published.pluck(:id) - challenge_ids = Challenge.where(shixun_id: shixuns).pluck(:id) - # 实训路径中的所有实训标签 - @tags = ChallengeTag.where(challenge_id: challenge_ids).pluck(:name).uniq - # 用户获取的实训标签 - # @user_tags = @subject.shixuns.map(&:user_tags_name).flatten.uniq - @user_tags = user_shixun_tags challenge_ids, @user.id - @my_subject_progress = @subject.my_subject_progress # 访问数变更 @subject.increment!(:visits) end diff --git a/app/helpers/admins/base_helper.rb b/app/helpers/admins/base_helper.rb new file mode 100644 index 000000000..c655be2e7 --- /dev/null +++ b/app/helpers/admins/base_helper.rb @@ -0,0 +1,102 @@ +module Admins::BaseHelper + def sidebar_item_group(url, text, **opts) + link_opts = url.start_with?('/') ? {} : { 'data-toggle': 'collapse', 'aria-expanded': false } + content = + link_to url, link_opts do + content_tag(:i, '', class: "fa fa-#{opts[:icon]}", 'data-toggle': 'tooltip', 'data-placement': 'right', 'data-boundary': 'window', title: text) + + content_tag(:span, text) + end + + content += + content_tag(:ul, id: url[1..-1], class: 'collapse list-unstyled', "data-parent": '#sidebar') do + yield + end + + raw content + end + + def sidebar_item(url, text, **opts) + content = + link_to url, 'data-controller': opts[:controller] do + content_tag(:i, '', class: "fa fa-#{opts[:icon]}", 'data-toggle': 'tooltip', 'data-placement': 'right', 'data-boundary': 'window', title: text) + + content_tag(:span, text) + end + + raw content + end + + def admin_sidebar_controller + key = params[:controller].to_s.gsub(/\//, '-') + SidebarUtil.controller_name(key) || key + end + + def define_admin_breadcrumbs(&block) + content_for(:setup_admin_breadcrumb, &block) + end + + def add_admin_breadcrumb(text, url = nil) + @_admin_breadcrumbs ||= [] + @_admin_breadcrumbs << OpenStruct.new(text: text, url: url) + end + + def display_text(str, default = '--') + str.presence || default + end + + def overflow_hidden_span(text, width: 300) + opts = { class: 'd-inline-block text-truncate', style: "max-width: #{width}px" } + opts.merge!('data-toggle': 'tooltip', title: text) if text != '--' + + content_tag(:span, text, opts) + end + + def sort_tag(content = '', **opts) + options = {} + options[:sort_by] = opts.delete(:name) + is_current_sort = params[:sort_by].to_s == options[:sort_by] + options[:sort_direction] = is_current_sort && params[:sort_direction].to_s == 'desc' ? 'asc' : 'desc' + + path = opts.delete(:path) + "?" + unsafe_params.merge(options).to_query + arrow_class = case params[:sort_direction].to_s + when 'desc' then 'fa-sort-amount-desc' + when 'asc' then 'fa-sort-amount-asc' + else '' + end + opts[:style] = "#{opts[:style]} ;position: relative;" + + content_tag(:span, opts) do + link_to path, remote: true do + content = content_tag(:span) { yield } if block_given? + + content += content_tag(:i, '', class: "fa color-light-green ml-1 #{arrow_class}", style: 'position: absolute;top:0;') if is_current_sort + raw content + end + end + end + + def javascript_void_link(name, **opts) + raw link_to(name, 'javascript:void(0)', opts) + end + + def agree_link(name, url, **opts) + klass = ['action agree-action', opts.delete(:class)].compact.join(' ') + + refresh_url_data = "refresh_url=#{CGI::escape(request.fullpath)}" + url = url + (url.index('?') ? '&' : '?') + refresh_url_data + + raw link_to(name, url, { method: :post, remote: true, class: klass, 'data-confirm': '确认审核通过?'}.merge(opts)) + end + + def delete_link(name, url, **opts) + klass = ['action delete-action', opts.delete(:class)].compact.join(' ') + + refresh_url_data = "refresh_url=#{CGI::escape(request.fullpath)}" + url = url + (url.index('?') ? '&' : '?') + refresh_url_data + + raw link_to(name, url, { method: :delete, remote: true, class: klass, 'data-confirm': '确认删除?'}.merge(opts)) + end + + def unsafe_params + params.except(:controller, :action).to_unsafe_h + end +end \ No newline at end of file diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 47f50a05f..44169dc59 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -158,10 +158,22 @@ module ApplicationHelper disk_auth_filename('UserAuthentication', source_id, 'ID') end + def auth_file_url(source_type, source_id, type) + File.join('/images', relative_path, source_type, "#{source_id}#{type}") + end + + def real_name_auth_file_url(source_id) + auth_file_url('UserAuthentication', source_id, 'ID') + end + def disk_professional_auth_filename(source_id) disk_auth_filename('UserAuthentication', source_id, 'PRO') end + def professional_auth_file_url(source_id) + auth_file_url('UserAuthentication', source_id, 'PRO') + end + def shixun_url_to_avatar(shixun) if File.exist?(disk_filename(shixun.class, shixun.id)) File.join("images/#{relative_path}", "#{shixun.class}", "#{shixun.id}") diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 6a4353aa2..c5d376baf 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -269,6 +269,6 @@ module CoursesHelper myshixun = Myshixun.where(user_id: user_id, shixun_id: subject&.shixuns).order("updated_at desc").first return "" unless myshixun stage_shixun = subject&.stage_shixuns.where(shixun_id: myshixun.shixun_id).take - progress = stage_shixun&.position.to_s + "-" + stage_shixun&.position.to_s + " " + myshixun.shixun&.name + progress = stage_shixun&.stage&.position.to_s + "-" + stage_shixun&.position.to_s + " " + myshixun.shixun&.name end end diff --git a/app/helpers/exercises_helper.rb b/app/helpers/exercises_helper.rb index baf594a42..2c417ea74 100644 --- a/app/helpers/exercises_helper.rb +++ b/app/helpers/exercises_helper.rb @@ -32,7 +32,7 @@ module ExercisesHelper ques_score = 0.0 end else - ques_score = answers_content.select(:score).pluck(:score).sum + ques_score = answers_content.score_reviewed.select(:score).pluck(:score).sum end if ques_score >= q.question_score #满分作答为正确 @@ -83,12 +83,13 @@ module ExercisesHelper @ex_sub_array = @ex_sub_array.sort_by {|k| k[:q_position]} end - #试卷的统计结果页面计算各题的 + #试卷的统计结果页面计算各题的。选择题和判断题原来是按:已回答了本题的人数来计算的。现需要按已提交试卷的人数来计算。2019-8-23 def exercise_commit_result(questions,user_ids) question_infos = [] percent = 0.0 + commit_user_ids = user_ids.size questions.includes(:exercise_choices).each do |ex| - ex_total_score = user_ids.count * ex&.question_score.to_f #该试卷的已回答的总分 + ex_total_score = commit_user_ids * ex&.question_score.to_f #该试卷的已回答的总分 # ex_answers = ex.exercise_answers if ex.question_type != Exercise::PRACTICAL ques_title = ex.question_title @@ -103,7 +104,7 @@ module ExercisesHelper end effictive_users_count = effictive_users.size #有效回答数,可能有重复的用户id,这里仅统计是否回答这个问题的全部人数 - + # if ex.question_type > Exercise::COMPLETION #当为主观题和实训题时, ex_answered_scores = effictive_users.score_reviewed.pluck(:score).sum #该问题的全部得分 percent = (ex_total_score == 0.0 ? 0.0 : (ex_answered_scores / ex_total_score.to_f).round(3) * 100) #正确率 @@ -113,8 +114,8 @@ module ExercisesHelper if ex.question_type <= Exercise::JUDGMENT #选择题和判断题 ex_choices = ex.exercise_choices standard_answer = ex.exercise_standard_answers.pluck(:exercise_choice_id).sort #标准答案的位置 - right_users_count = 0 - #该问题的正确率 + # right_users_count = 0 + # 该问题的正确率 if ex.question_type == Exercise::MULTIPLE #多选题 right_user_ids = user_ids standard_answer.each do |choice_position| @@ -122,19 +123,12 @@ module ExercisesHelper right_user_ids = right_user_ids & effictive_users.select{|answer| answer.exercise_choice_id == standard_answer_choice_id}.pluck(:user_id) end right_users_count = right_user_ids.size - # user_ids.each do |user_id| - # ex_choice_ids = effictive_users.map{|e| e.exercise_choice_id if e.user_id == user_id}.reject(&:blank?).uniq - # answer_choice_array = ex_choices.map{|a| a.choice_position if ex_choice_ids.include?(a.id)}.reject(&:blank?).uniq - # if answer_choice_array.sort == standard_answer - # right_users_count += 1 - # end - # end else #单选题和判断题 standard_answer_choice_id = ex_choices.select{|ec| ec.choice_position == standard_answer.first}.first&.id right_users_count = effictive_users.select{|answer| answer.exercise_choice_id == standard_answer_choice_id}.size end - percent = effictive_users_count > 0 ? (right_users_count / effictive_users_count.to_f).round(3)*100 : 0.0 + percent = commit_user_ids > 0 ? (right_users_count / commit_user_ids.to_f).round(3)*100 : 0.0 #每个选项的正确率 ex_choices.each do |c| @@ -180,7 +174,8 @@ module ExercisesHelper all_user_count += user_count standard_answer_count += 1 end - percent = effictive_users_count > 0 ? (all_user_count / effictive_users_count.to_f).round(3)*100 : 0.0 + percent = commit_user_ids > 0 ? (all_user_count / commit_user_ids.to_f).round(3)*100 : 0.0 + user_wrong_count = (effictive_users_count - all_user_count ) if effictive_users_count > 0 && user_wrong_count >= 0 @@ -406,7 +401,7 @@ module ExercisesHelper #TODO: 旧版多选题的标准答案是放在一个里面的,新版又做成了一个题有多个标准答案(exercise_choice_id存放的是标准答案的位置..) if q.question_type == 1 && standard_answer.size == 1 - standard_answer = standard_answer.first.to_s.split("").map(&:to_i) + standard_answer = standard_answer.first.to_s.split("").map(&:to_i).sort end if user_answer_content == standard_answer #答案一致,多选或单选才给分,答案不对不给分 @@ -438,8 +433,8 @@ module ExercisesHelper end if q.is_ordered answers_content.each do |u| - i_standard_answer = standard_answer_array.where(exercise_choice_id:u.exercise_choice_id).pluck(:answer_text).reject(&:blank?).map!(&:downcase) #该选项的全部标准答案 - if i_standard_answer.include?(u.answer_text.downcase) #该空的标准答案包含用户的答案才有分数 + i_standard_answer = standard_answer_array.where(exercise_choice_id:u.exercise_choice_id).pluck(:answer_text).reject(&:blank?).map{|a| a.strip.downcase} #该选项的全部标准答案 + if i_standard_answer.include?(u.answer_text.strip.downcase) #该空的标准答案包含用户的答案才有分数 u.update_column('score',q_score_2) score2 = score2 + q_score_2 else @@ -448,9 +443,9 @@ module ExercisesHelper end end else - st_answer_text = standard_answer_array.pluck(:answer_text).reject(&:blank?).map!(&:downcase) + st_answer_text = standard_answer_array.pluck(:answer_text).reject(&:blank?).map{|a| a.strip.downcase} answers_content.each do |u| - u_answer_text = u.answer_text.downcase + u_answer_text = u.answer_text.strip.downcase if st_answer_text.include?(u_answer_text) #只要标准答案包含用户的答案,就有分数。同时,下一次循环时,就会删除该标准答案。防止用户的相同答案获分 u.update_column("score",q_score_2) score2 = score2 + q_score_2 @@ -466,50 +461,59 @@ module ExercisesHelper end elsif q.question_type == 5 #实训题时,主观题这里不评分 q.exercise_shixun_challenges&.each do |exercise_cha| - game = Game.user_games(user.id,exercise_cha.challenge_id)&.first #当前用户的关卡 - if game.present? - exercise_cha_score = 0.0 - answer_status = 0 - # if game.status == 2 && game.final_score >= 0 - if game.final_score > 0 - exercise_cha_score = game.real_score(exercise_cha.question_score) - # exercise_cha_score = exercise_cha.question_score #每一关卡的得分 - answer_status = 1 - end - ex_shixun_answer_content = answers_content&.where(exercise_shixun_challenge_id: exercise_cha.id) - code = nil - if exercise_cha.challenge&.path.present? - cha_path = challenge_path(exercise_cha.challenge&.path) - game_challenge = game.game_codes.search_challenge_path(cha_path)&.first - if game_challenge.present? - game_code = game_challenge - code = game_code.try(:new_code) + user_shixun_score = exercise_cha&.exercise_shixun_answers&.where(user_id:user.id,exercise_question_id:q.id) + if user_shixun_score.present? + score5 += user_shixun_score&.first.score + else + game = Game.user_games(user.id,exercise_cha.challenge_id)&.first #当前用户的关卡 + if game.present? + exercise_cha_score = 0.0 + answer_status = 0 + # if game.status == 2 && game.final_score >= 0 + if game.final_score > 0 + exercise_cha_score = game.real_score(exercise_cha.question_score) + # exercise_cha_score = exercise_cha.question_score #每一关卡的得分 + answer_status = 1 + end + ex_shixun_answer_content = answers_content&.where(exercise_shixun_challenge_id: exercise_cha.id) + code = nil + if exercise_cha.challenge&.path.present? + cha_path = challenge_path(exercise_cha.challenge&.path) + game_challenge = game.game_codes.search_challenge_path(cha_path)&.first + if game_challenge.present? + game_code = game_challenge + code = game_code.try(:new_code) + else + begin + code = git_fle_content(game.myshixun.repo_path,cha_path) + rescue + code = "" + end + end + end + if ex_shixun_answer_content.blank? #把关卡的答案存入试卷的实训里 + ### Todo 实训题的_shixun_details里的代码是不是直接从这里取出就可以了?涉及到code的多个版本库的修改 + sx_option = { + :exercise_question_id => q.id, + :exercise_shixun_challenge_id => exercise_cha.id, + :user_id => user.id, + :score => exercise_cha_score.round(1), + :answer_text => code, + :status => answer_status + } + ExerciseShixunAnswer.create(sx_option) else - code = git_fle_content(game.myshixun.repo_path,cha_path) + ex_shixun_answer_content.first.update_attributes(score:exercise_cha_score.round(1),answer_text:code) end - end - if ex_shixun_answer_content.blank? #把关卡的答案存入试卷的实训里 - ### Todo 实训题的_shixun_details里的代码是不是直接从这里取出就可以了?涉及到code的多个版本库的修改 - sx_option = { - :exercise_question_id => q.id, - :exercise_shixun_challenge_id => exercise_cha.id, - :user_id => user.id, - :score => exercise_cha_score.round(1), - :answer_text => code, - :status => answer_status - } - ExerciseShixunAnswer.create(sx_option) + score5 += exercise_cha_score else - ex_shixun_answer_content.first.update_attributes(score:exercise_cha_score.round(1),answer_text:code) + score5 += 0.0 end - score5 += exercise_cha_score - else - score5 += 0.0 end end end user_scores = answers_content.blank? ? 0.0 : answers_content.score_reviewed.pluck(:score).sum - if user_scores > 0.0 + if user_scores > 0.0 stand_answer = 1 else stand_answer = 0 @@ -535,6 +539,82 @@ module ExercisesHelper } end + #当单个问题的分数更新时,更新用户的总分 + def update_single_score(q,user_id,standard_answer) + score1 = 0.0 #用户的新得分 + origin_score = 0.0 #用户的原来该问题的得分 + answers_content = q&.exercise_answers&.where(user_id: user_id) #学生的答案 + if answers_content.present? #用户回答了该题,才会改分数 + if q.question_type <= 2 #为选择题或判断题时 + origin_score = answers_content.first.score + answer_choice_array = [] + answers_content.each do |a| + answer_choice_array.push(a.exercise_choice.choice_position) #学生答案的位置 + end + user_answer_content = answer_choice_array.sort + + #TODO: 旧版多选题的标准答案是放在一个里面的,新版又做成了一个题有多个标准答案(exercise_choice_id存放的是标准答案的位置..) + if q.question_type == 1 && standard_answer.size == 1 + standard_answer = standard_answer.first.to_s.split("").map(&:to_i) + end + + if user_answer_content == standard_answer.sort #答案一致,多选或单选才给分,答案不对不给分 + if standard_answer.size > 0 + q_score_1 = q.question_score + else + q_score_1 = 0.0 + end + answers_content.update_all(:score => q_score_1) + score1 = q_score_1 + else + answers_content.update_all(:score => -1.0) + end + elsif q.question_type == 3 #填空题 + origin_score = answers_content.score_reviewed.pluck(:score).sum + + standard_answer_count = standard_answer.count + if standard_answer_count > 0 #存在标准答案时才有分数 + q_score_2 = (q.question_score.to_f / standard_answer_count) #每一空的得分 + else + q_score_2 = 0.0 + end + if q.is_ordered + answers_content.each do |u| + i_standard_answer = [] + standard_answer.each do |a| + if a[:choice_id] == u.exercise_choice_id + i_standard_answer += a[:answer_text] + end + end + i_standard_answer = i_standard_answer.map{|a| a.strip.downcase} + if i_standard_answer.include?(u.answer_text.strip.downcase) #该空的标准答案包含用户的答案才有分数 + u.update_column('score',q_score_2) + score1 = score1 + q_score_2 + else + u.update_column('score',-1.0) + score1 += 0.0 + end + end + else + st_answer_text = standard_answer.pluck(:answer_text).sum.map{|a| a.strip.downcase} + answers_content.each do |u| + u_answer_text = u.answer_text.downcase + if st_answer_text.include?(u_answer_text) #只要标准答案包含用户的答案,就有分数。同时,下一次循环时,就会删除该标准答案。防止用户的相同答案获分 + u.update_column("score",q_score_2) + score1 = score1 + q_score_2 + st_answer_text.delete(u_answer_text) + else + u.update_column('score',-1.0) + score1 += 0.0 + end + end + end + end + end + origin_score = origin_score < 0.0 ? 0.0 : origin_score + score1 - origin_score + end + #获取用户的相关信息 def exercise_use_info(ex_user,user_status,exercise) course = exercise.course diff --git a/app/helpers/homework_commons_helper.rb b/app/helpers/homework_commons_helper.rb index c77ae5937..fa563a72c 100644 --- a/app/helpers/homework_commons_helper.rb +++ b/app/helpers/homework_commons_helper.rb @@ -37,25 +37,25 @@ module HomeworkCommonsHelper when 3 if ho_detail_manual.evaluation_end && ho_detail_manual.evaluation_end > Time.now status << "匿评中" - time = how_much_time(ho_detail_manual.evaluation_end) + time = "提交剩余时间:" + how_much_time(ho_detail_manual.evaluation_end) time_status = 3 end when 4 if ho_detail_manual.appeal_time && ho_detail_manual.appeal_time > Time.now status << "申诉中" - time = how_much_time(ho_detail_manual.appeal_time) + time = "申诉剩余时间:" + how_much_time(ho_detail_manual.appeal_time) time_status = 4 end when 2, 5, 6 status << "评阅中" - time = course.end_date.present? ? how_much_time(course.end_date.end_of_day) : "" + time = "评阅剩余时间:" + (course.end_date.present? ? how_much_time(course.end_date.end_of_day) : "") time_status = 5 end # 如果还在补交阶段则显示补交结束时间 if homework_common.end_time && homework_common.end_time < Time.now && homework_common.allow_late && homework_common.late_time && homework_common.late_time > Time.now - time = how_much_time(homework_common.late_time) + time = "补交剩余时间:" + how_much_time(homework_common.late_time) time_status = 2 end else @@ -74,12 +74,12 @@ module HomeworkCommonsHelper when 1 if homework_common.end_time && homework_common.end_time >= Time.now status << "提交中" - time = how_much_time(homework_common.end_time) + time = "提交剩余时间:" + how_much_time(homework_common.end_time) time_status = 1 elsif homework_common.end_time && homework_common.end_time < Time.now time_status = 5 if homework_common.allow_late && (homework_common.late_time.nil? || homework_common.late_time >= Time.now) - time = how_much_time(homework_common.late_time) + time = "补交剩余时间:" + how_much_time(homework_common.late_time) time_status = 2 end status << "评阅中" @@ -114,11 +114,11 @@ module HomeworkCommonsHelper time_status = 0 elsif max_end_time.present? && max_end_time > Time.now #6.14 -hs 添加present? status << "提交中" - time = how_much_time(max_end_time) + time = "提交剩余时间:" + how_much_time(max_end_time) time_status = 1 elsif homework_common.allow_late && (homework_common.late_time.nil? || homework_common.late_time >= Time.now) status << "评阅中" - time = how_much_time(homework_common.late_time) + time = "补交剩余时间:" + how_much_time(homework_common.late_time) time_status = 2 else status << "评阅中" diff --git a/app/helpers/subjects_helper.rb b/app/helpers/subjects_helper.rb index 8aff41d25..75ae9f041 100644 --- a/app/helpers/subjects_helper.rb +++ b/app/helpers/subjects_helper.rb @@ -24,8 +24,8 @@ module SubjectsHelper elsif course.start_date && course.start_date > Date.today {status: 0, time: ""} elsif course.start_date && course.start_date <= Date.today && course.end_date >= Date.today - sum_week = ((course.end_date - course.start_date).to_i / 7.0).ceil - curr_week = ((Date.today - course.start_date).to_i / 7.0).ceil + sum_week = (((course.end_date - course.start_date).to_i + 1) / 7.0).ceil + curr_week = (((Date.today - course.start_date).to_i + 1) / 7.0).ceil {status: 1, time: "进行至第#{curr_week}周,共#{sum_week}周"} else {status: -1, time: ""} diff --git a/app/jobs/create_student_work_job.rb b/app/jobs/create_student_work_job.rb new file mode 100644 index 000000000..1fd9a9b00 --- /dev/null +++ b/app/jobs/create_student_work_job.rb @@ -0,0 +1,21 @@ +class CreateStudentWorkJob < ApplicationJob + queue_as :default + + def perform(homework_id) + homework = HomeworkCommon.find_by(id: homework_id) + course = homework&.course + return if homework.blank? || course.blank? + + attrs = %i[homework_common_id user_id created_at updated_at] + + same_attrs = {homework_common_id: homework.id} + + StudentWork.bulk_insert(*attrs) do |worker| + student_ids = course.students.pluck(:user_id) + + student_ids.each do |user_id| + worker.add same_attrs.merge(user_id: user_id) + end + end + end +end diff --git a/app/libs/sidebar_util.rb b/app/libs/sidebar_util.rb new file mode 100644 index 000000000..c58eab5e5 --- /dev/null +++ b/app/libs/sidebar_util.rb @@ -0,0 +1,11 @@ +class SidebarUtil + class << self + def controller_name(name) + sidebar_controller_map[name] + end + + def sidebar_controller_map + @_sidebar_controller_map ||= YAML.load_file(Rails.root.join('config/admins', 'sidebar.yml')) + end + end +end \ No newline at end of file diff --git a/app/libs/util/file_manage.rb b/app/libs/util/file_manage.rb new file mode 100644 index 000000000..620fd7f01 --- /dev/null +++ b/app/libs/util/file_manage.rb @@ -0,0 +1,40 @@ +module Util::FileManage + module_function + + # 不同的类型扩展不同的目录 + def relative_path + "avatars" + end + + def storage_path + File.join(Rails.root, "public", "images", relative_path) + end + + def disk_filename(source_type,source_id,image_file=nil) + File.join(storage_path, "#{source_type}", "#{source_id}") + end + + def disk_auth_filename(source_type, source_id, type) + File.join(storage_path, "#{source_type}", "#{source_id}#{type}") + end + + def disk_real_name_auth_filename(source_id) + disk_auth_filename('UserAuthentication', source_id, 'ID') + end + + def auth_file_url(source_type, source_id, type) + File.join('/images', relative_path, source_type, "#{source_id}#{type}") + end + + def real_name_auth_file_url(source_id) + auth_file_url('UserAuthentication', source_id, 'ID') + end + + def disk_professional_auth_filename(source_id) + disk_auth_filename('UserAuthentication', source_id, 'PRO') + end + + def professional_auth_file_url(source_id) + auth_file_url('UserAuthentication', source_id, 'PRO') + end +end \ No newline at end of file diff --git a/app/models/apply_user_authentication.rb b/app/models/apply_user_authentication.rb index d467eb850..c379fb82e 100644 --- a/app/models/apply_user_authentication.rb +++ b/app/models/apply_user_authentication.rb @@ -12,6 +12,12 @@ class ApplyUserAuthentication < ApplicationRecord after_create :send_tiding + def status_text + I18n.t!("apply_user_authentication.status.#{status}") + rescue I18n::MissingTranslationData + nil + end + private def send_tiding diff --git a/app/models/attachment.rb b/app/models/attachment.rb index 3a512278a..e3c55242f 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -19,7 +19,7 @@ class Attachment < ApplicationRecord scope :contains_only_project, -> { where(container_type: 'Project') } scope :contains_course_and_project, -> { contains_only_course.or(contains_only_project) } scope :mine, -> (author_id) { where(author_id: author_id) } - scope :simple_columns, -> { select(:id, :filename, :filesize, :created_on, :cloud_url, :author_id) } + scope :simple_columns, -> { select(:id, :filename, :filesize, :created_on, :cloud_url, :author_id, :content_type) } scope :search_by_container, -> (ids) {where(container_id: ids)} validates_length_of :description, maximum: 100 diff --git a/app/models/course.rb b/app/models/course.rb index baed1efe6..5a2a065ba 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -9,7 +9,7 @@ class Course < ApplicationRecord # 所属实践课程 belongs_to :subject, optional: true - has_one :inform, as: :container, dependent: :destroy + has_many :informs, as: :container, dependent: :destroy has_many :course_infos, dependent: :destroy # 课堂左侧导航栏的模块 @@ -82,6 +82,7 @@ class Course < ApplicationRecord scope :by_keywords, lambda { |keywords| where("name LIKE ?", "%#{keywords.split(" ").join('|')}%") unless keywords.blank? } + scope :started, -> { where("start_date is null or start_date <= '#{Date.today}'") } acts_as_taggable @@ -185,7 +186,7 @@ class Course < ApplicationRecord end def all_course_module_types - %w[activity announcement online_learning shixun_homework common_homework group_homework graduation exercise poll attachment board course_group] + %w[activity announcement online_learning shixun_homework common_homework group_homework exercise attachment course_group graduation poll board] end def get_course_module_by_type(type) diff --git a/app/models/homework_common.rb b/app/models/homework_common.rb index 332aff045..ac11a54b7 100644 --- a/app/models/homework_common.rb +++ b/app/models/homework_common.rb @@ -68,14 +68,14 @@ class HomeworkCommon < ApplicationRecord def category_info case self.homework_type when 'normal' - {category_id: course.common_course_modules.first.try(:id), category_name: course.common_course_modules.first.try(:module_name)} + {category_id: course.common_course_modules.first.try(:id), category_name: course.common_course_modules.first.try(:module_name), main: 1} when 'group' - {category_id: course.group_course_modules.first.try(:id), category_name: course.group_course_modules.first.try(:module_name)} + {category_id: course.group_course_modules.first.try(:id), category_name: course.group_course_modules.first.try(:module_name), main: 1} when 'practice' if self.course_second_category.present? - {category_id: self.course_second_category.try(:id), category_name: self.course_second_category.try(:name)} + {category_id: self.course_second_category.try(:id), category_name: self.course_second_category.try(:name), main: 0} else - {category_id: course.shixun_course_modules.take.try(:id), category_name: course.shixun_course_modules.take.try(:module_name)} + {category_id: course.shixun_course_modules.take.try(:id), category_name: course.shixun_course_modules.take.try(:module_name), main: 1} end end end diff --git a/app/models/inform.rb b/app/models/inform.rb index faf1d48e6..5caf80c5f 100644 --- a/app/models/inform.rb +++ b/app/models/inform.rb @@ -1,3 +1,6 @@ class Inform < ApplicationRecord belongs_to :container, polymorphic: true, optional: true + + validates :name, length: { maximum: 60 } + validates :description, length: { maximum: 5000 } end diff --git a/app/models/old_message_detail.rb b/app/models/old_message_detail.rb new file mode 100644 index 000000000..5c1b94f51 --- /dev/null +++ b/app/models/old_message_detail.rb @@ -0,0 +1,2 @@ +class OldMessageDetail < ApplicationRecord +end diff --git a/app/models/school.rb b/app/models/school.rb index a0c829160..8a28ae4bf 100644 --- a/app/models/school.rb +++ b/app/models/school.rb @@ -10,6 +10,9 @@ class School < ApplicationRecord has_many :ec_major_schools, :dependent => :destroy has_many :ec_majors, :through => :ec_major_schools + has_many :school_daily_reports, dependent: :destroy + has_many :courses + # 学校管理员 def manager?(user) ec_school_users.exists?(user_id: user.id) diff --git a/app/models/school_daily_active_user.rb b/app/models/school_daily_active_user.rb new file mode 100644 index 000000000..2abe85145 --- /dev/null +++ b/app/models/school_daily_active_user.rb @@ -0,0 +1,3 @@ +class SchoolDailyActiveUser < ApplicationRecord + belongs_to :school_daily_report +end \ No newline at end of file diff --git a/app/models/school_daily_report.rb b/app/models/school_daily_report.rb new file mode 100644 index 000000000..364f319ab --- /dev/null +++ b/app/models/school_daily_report.rb @@ -0,0 +1,5 @@ +class SchoolDailyReport < ApplicationRecord + belongs_to :school + + has_many :school_daily_active_users, dependent: :delete_all +end \ No newline at end of file diff --git a/app/models/school_report.rb b/app/models/school_report.rb new file mode 100644 index 000000000..b1183b3ec --- /dev/null +++ b/app/models/school_report.rb @@ -0,0 +1,3 @@ +class SchoolReport < ApplicationRecord + belongs_to :school +end \ No newline at end of file diff --git a/app/models/subject.rb b/app/models/subject.rb index b8d6eef8b..7b671cfb1 100644 --- a/app/models/subject.rb +++ b/app/models/subject.rb @@ -19,11 +19,11 @@ class Subject < ApplicationRecord has_many :stages, -> { order("stages.position ASC") }, dependent: :destroy # 开放课堂 - has_many :courses, -> { where("is_delete = 0").order("courses.id ASC") } + has_many :courses, -> { where("is_delete = 0").order("courses.created_at ASC") } validates :name, length: { maximum: 60 } - validates :description, length: { maximum: 5000 } - validates :learning_notes, length: { maximum: 500 } + validates :description, length: { maximum: 8000 } + validates :learning_notes, length: { maximum: 2000 } scope :visible, lambda{where(status: 2)} scope :published, lambda{where(status: 1)} @@ -39,9 +39,15 @@ class Subject < ApplicationRecord courses.pluck(:end_date).max end - # 挑战过路径的成员数 + # 是否有已开课的课堂 + def has_course_start? + courses.where("start_date <= '#{Date.today}' and end_date >= '#{Date.today}'").count > 0 + end + + # 挑战过路径的成员数(金课统计去重后的报名人数) def member_count - shixuns.pluck(:myshixuns_count).sum + excellent && CourseMember.where(role: 4, course_id: courses.pluck(:id)).pluck(:user_id).uniq.length > shixuns.pluck(:myshixuns_count).sum ? + CourseMember.where(role: 4, course_id: courses.pluck(:id)).pluck(:user_id).uniq.length : shixuns.pluck(:myshixuns_count).sum end def all_score diff --git a/app/models/user.rb b/app/models/user.rb index 449a86e8b..5ba8667f5 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -146,6 +146,8 @@ class User < ApplicationRecord attr_accessor :password, :password_confirmation + delegate :gender, :department_id, :school_id, :location, :location_city, :technical_title, to: :user_extension, allow_nil: true + before_save :update_hashed_password # @@ -232,8 +234,9 @@ class User < ApplicationRecord user_extension&.school&.name || '' end - def school_id - user_extension&.school_id + # 用户的学院名称 + def department_name + user_extension&.department&.name || '' end # 课堂的老师(创建者、老师、助教) @@ -440,6 +443,10 @@ class User < ApplicationRecord name.gsub(/\s+/, '').strip #6.11 -hs end + def only_real_name + "#{lastname}#{firstname}" + end + # 用户是否选题毕设课题 def selected_topic?(topic) student_graduation_topics.where(graduation_topic_id: topic.id).last.try(:status) diff --git a/app/queries/admins/apply_user_authentication_query.rb b/app/queries/admins/apply_user_authentication_query.rb new file mode 100644 index 000000000..a4d1c2a4a --- /dev/null +++ b/app/queries/admins/apply_user_authentication_query.rb @@ -0,0 +1,34 @@ +class Admins::ApplyUserAuthenticationQuery < ApplicationQuery + include CustomSortable + + attr_reader :params + + sort_columns :updated_at, default_by: :updated_at, default_direction: :desc + + def initialize(params) + @params = params + end + + def call + applies = ApplyUserAuthentication.where(auth_type: params[:type].presence || 1) + + status = + case params[:status] + when 'pending' then 0 + when 'processed' then [1, 2] + when 'agreed' then 1 + when 'refused' then 2 + else 0 + end + applies = applies.where(status: status) if status.present? + + # 关键字模糊查询 + keyword = params[:keyword].to_s.strip + if keyword.present? + applies = applies.joins(user: { user_extension: :school }) + .where('CONCAT(lastname,firstname) LIKE :keyword OR schools.name LIKE :keyword', keyword: "%#{keyword}%") + end + + custom_sort(applies, params[:sort_by], params[:sort_direction]) + end +end \ No newline at end of file diff --git a/app/queries/admins/user_query.rb b/app/queries/admins/user_query.rb new file mode 100644 index 000000000..5a633f059 --- /dev/null +++ b/app/queries/admins/user_query.rb @@ -0,0 +1,40 @@ +class Admins::UserQuery < ApplicationQuery + include CustomSortable + + attr_reader :params + + sort_columns :created_on, :last_login_on, :experience, :grade, default_by: :created_on, default_direction: :desc + + def initialize(params) + @params = params + end + + def call + users = User.where(type: 'User') + + # 状态 + status = params[:status] + users = users.where(status: status) if status.present? + + # 职业 + users = users.joins(:user_extension).where(user_extensions: { identity: params[:identity] }) if params[:identity].present? + + # 授权类型 + if params[:auto_trial].present? + users = users.joins(user_extension: :school).where(schools: { auto_users_trial: params[:auto_trial].to_i == 1 }) + end + + # 关键字检索 + keyword = params[:keyword].to_s.strip.presence + if keyword + sql = 'CONCAT(lastname, firstname) LIKE :keyword OR login LIKE :keyword OR mail LIKE :keyword OR phone LIKE :keyword' + users = users.where(sql, keyword: keyword) + end + + # 学校名称 + school_name = params[:school_name].to_s.strip.presence + users = users.joins(user_extension: :school).where('schools.name LIKE ?', "%#{school_name}%") if school_name + + custom_sort(users, params[:sort_by], params[:sort_direction]) + end +end \ No newline at end of file diff --git a/app/services/admins/identity_auths/agree_apply_service.rb b/app/services/admins/identity_auths/agree_apply_service.rb new file mode 100644 index 000000000..65a3b2376 --- /dev/null +++ b/app/services/admins/identity_auths/agree_apply_service.rb @@ -0,0 +1,38 @@ +class Admins::IdentityAuths::AgreeApplyService < ApplicationService + attr_reader :apply, :user + + def initialize(apply) + @apply = apply + @user = apply.user + end + + def call + ActiveRecord::Base.transaction do + apply.update!(status: 1) + user.update!(authentication: true) + + RewardGradeService.call(user, container_id: user.id, container_type: 'Authentication', score: 500) + + deal_tiding! + delete_auth_file! + end + end + + private + + def deal_tiding! + apply.tidings.where(tiding_type: 'Apply').update_all(status: 1) + + Tiding.create!(user_id: apply.user_id, trigger_user_id: 0, + container_id: apply.id, container_type: 'ApplyUserAuthentication', + belong_container_id: apply.user_id, belong_container_type: 'User', + status: 1, tiding_type: 'System') + end + + def delete_auth_file! + path = Util::FileManage.disk_real_name_auth_filename(user.id) + File.delete(path) if File.exists?(path) + + apply.update!(is_delete: true) + end +end \ No newline at end of file diff --git a/app/services/admins/identity_auths/refuse_apply_service.rb b/app/services/admins/identity_auths/refuse_apply_service.rb new file mode 100644 index 000000000..57581dd40 --- /dev/null +++ b/app/services/admins/identity_auths/refuse_apply_service.rb @@ -0,0 +1,40 @@ +class Admins::IdentityAuths::RefuseApplyService < ApplicationService + attr_reader :apply, :user, :params + + def initialize(apply, params) + @apply = apply + @user = apply.user + @params = params + end + + def call + ActiveRecord::Base.transaction do + apply.update!(status: 2, remarks: reason) + + deal_tiding! + delete_auth_file! + end + end + + private + + def reason + params[:reason].to_s.strip + end + + def deal_tiding! + apply.tidings.where(tiding_type: 'Apply').update_all(status: 1) + + Tiding.create!(user_id: apply.user_id, trigger_user_id: 0, + container_id: apply.id, container_type: 'ApplyUserAuthentication', + belong_container_id: apply.user_id, belong_container_type: 'User', + status: 2, tiding_type: 'System') + end + + def delete_auth_file! + path = Util::FileManage.disk_real_name_auth_filename(user.id) + File.delete(path) if File.exists?(path) + + apply.update!(is_delete: true) + end +end \ No newline at end of file diff --git a/app/services/admins/professional_auths/agree_apply_service.rb b/app/services/admins/professional_auths/agree_apply_service.rb new file mode 100644 index 000000000..81654f0d3 --- /dev/null +++ b/app/services/admins/professional_auths/agree_apply_service.rb @@ -0,0 +1,38 @@ +class Admins::ProfessionalAuths::AgreeApplyService < ApplicationService + attr_reader :apply, :user + + def initialize(apply) + @apply = apply + @user = apply.user + end + + def call + ActiveRecord::Base.transaction do + apply.update!(status: 1) + user.update!(professional_certification: true) + + RewardGradeService.call(user, container_id: user.id, container_type: 'Professional', score: 500) + + deal_tiding! + delete_auth_file! + end + end + + private + + def deal_tiding! + apply.tidings.where(tiding_type: 'Apply').update_all(status: 1) + + Tiding.create!(user_id: apply.user_id, trigger_user_id: 0, + container_id: apply.id, container_type: 'ApplyUserAuthentication', + belong_container_id: apply.user_id, belong_container_type: 'User', + status: 1, tiding_type: 'System') + end + + def delete_auth_file! + path = Util::FileManage.disk_professional_auth_filename(user.id) + File.delete(path) if File.exists?(path) + + apply.update!(is_delete: true) + end +end \ No newline at end of file diff --git a/app/services/admins/professional_auths/refuse_apply_service.rb b/app/services/admins/professional_auths/refuse_apply_service.rb new file mode 100644 index 000000000..b5332c999 --- /dev/null +++ b/app/services/admins/professional_auths/refuse_apply_service.rb @@ -0,0 +1,40 @@ +class Admins::ProfessionalAuths::RefuseApplyService < ApplicationService + attr_reader :apply, :user, :params + + def initialize(apply, params) + @apply = apply + @user = apply.user + @params = params + end + + def call + ActiveRecord::Base.transaction do + apply.update!(status: 2, remarks: reason) + + deal_tiding! + delete_auth_file! + end + end + + private + + def reason + params[:reason].to_s.strip + end + + def deal_tiding! + apply.tidings.where(tiding_type: 'Apply').update_all(status: 1) + + Tiding.create!(user_id: apply.user_id, trigger_user_id: 0, + container_id: apply.id, container_type: 'ApplyUserAuthentication', + belong_container_id: apply.user_id, belong_container_type: 'User', + status: 2, tiding_type: 'System') + end + + def delete_auth_file! + path = Util::FileManage.disk_professional_auth_filename(user.id) + File.delete(path) if File.exists?(path) + + apply.update!(is_delete: true) + end +end \ No newline at end of file diff --git a/app/services/admins/school_daily_statistic_service.rb b/app/services/admins/school_daily_statistic_service.rb new file mode 100644 index 000000000..64bb97864 --- /dev/null +++ b/app/services/admins/school_daily_statistic_service.rb @@ -0,0 +1,123 @@ +class Admins::SchoolDailyStatisticService < ApplicationService + include CustomSortable + + attr_reader :params + + sort_columns :student_count, :teacher_count, :homework_count, :other_homework_count, + :course_count, :active_course_count, :nearly_course_time, :shixun_count, :shixun_evaluate_count, + default_by: :teacher_count, default_direction: :desc + + def initialize(params) + @params = params + end + + def call + schools = School.group('schools.id') + + keyword = params[:keyword].try(:to_s).try(:strip) + if keyword.present? + schools = schools.where("schools.name LIKE :keyword OR schools.id LIKE :keyword", keyword: "%#{keyword}%") + end + + count = schools.count.count + + # 根据排序字段进行查询 + schools = query_by_sort_column(schools, params[:sort_by]) + schools = custom_sort(schools, params[:sort_by], params[:sort_direction]) + + schools = schools.limit(page_size).offset(offset) + # 查询并组装其它数据 + schools = package_other_data(schools) + + [count, schools] + end + + def package_other_data(schools) + ids = schools.map(&:id) + + student_map = UserExtension.where(school_id: ids, identity: :student).group(:school_id).count + teacher_map = UserExtension.where(school_id: ids, identity: :teacher).group(:school_id).count + + homeworks = HomeworkCommon.joins(:course) + shixun_homework_map = homeworks.where(homework_type: 4, courses: { school_id: ids }).group('school_id').count + other_homework_map = homeworks.where(homework_type: [1, 3], courses: { school_id: ids }).group('school_id').count + + courses = Course.where(is_delete: 0, school_id: ids).group('school_id') + course_map = courses.count + nearly_course_time_map = courses.joins(:course_acts).maximum('course_activities.updated_at') + active_course_map = courses.where(is_end: false).count + + shixun_map = Shixun.joins(user: :user_extension).where(user_extensions: { identity: :teacher, school_id: ids }) + .where(fork_from: nil).group('school_id').count + + reports = SchoolReport.where(school_id: ids) + evaluate_count_map = reports.each_with_object({}) { |report, obj| obj[report.school_id] = report.shixun_evaluate_count } + + schools.map do |school| + { + id: school.id, + name: school.name, + teacher_count: teacher_map[school.id], + student_count: student_map[school.id], + homework_count: shixun_homework_map[school.id], + other_homework_count: other_homework_map[school.id], + course_count: course_map[school.id], + nearly_course_time: nearly_course_time_map[school.id], + active_course_count: active_course_map[school.id], + shixun_count: shixun_map.fetch(school.id, 0), + shixun_evaluate_count: evaluate_count_map.fetch(school.id, 0) + } + end + end + + private + def query_by_sort_column(schools, sort_by_column) + base_query_column = 'schools.id, schools.name' + + case sort_by_column.to_s + when 'teacher_count' then + schools.joins('LEFT JOIN user_extensions ue ON ue.school_id = schools.id AND ue.identity = 0') + .select("#{base_query_column}, COUNT(*) teacher_count") + when 'student_count' then + schools.joins('LEFT JOIN user_extensions ue ON ue.school_id = schools.id AND ue.identity = 1') + .select("#{base_query_column}, COUNT(*) student_count") + when 'homework_count' then + schools.joins('LEFT JOIN courses ON courses.school_id = schools.id') + .joins('LEFT JOIN homework_commons hc ON hc.course_id = courses.id AND hc.homework_type = 4') + .select("#{base_query_column}, COUNT(*) homework_count") + when 'other_homework_count' then + schools.joins('LEFT JOIN courses ON courses.school_id = schools.id') + .joins('LEFT JOIN homework_commons hc ON hc.course_id = courses.id AND hc.homework_type IN (1, 3)') + .select("#{base_query_column}, COUNT(*) other_homework_count") + when 'course_count' then + schools.joins('LEFT JOIN courses cs ON cs.school_id = schools.id AND cs.is_delete = 0') + .select("#{base_query_column}, COUNT(*) course_count") + when 'shixun_count' then + schools.joins('LEFT JOIN user_extensions ue ON ue.school_id = schools.id AND ue.identity = 0') + .joins('LEFT JOIN users ON users.id = ue.user_id') + .joins('LEFT JOIN shixuns sx ON sx.user_id = users.id AND sx.fork_from IS NULL') + .select("#{base_query_column}, COUNT(*) shixun_count") + when 'shixun_evaluate_count' then + schools.joins('LEFT JOIN school_reports ON school_reports.school_id = schools.id') + .select("#{base_query_column}, shixun_evaluate_count") + when 'nearly_course_time' then + schools.joins('LEFT JOIN courses cs ON cs.school_id = schools.id AND cs.is_delete = 0') + .joins('LEFT JOIN course_activities acs ON acs.course_id = cs.id') + .select("#{base_query_column}, MAX(acs.updated_at) nearly_course_time") + when 'active_course_count' then + schools.joins('LEFT JOIN courses cs ON cs.school_id = schools.id AND cs.is_delete = 0 AND cs.is_end = false') + .select("#{base_query_column}, COUNT(*) active_course_count") + else + schools.joins('LEFT JOIN user_extensions ue ON ue.school_id = schools.id AND ue.identity = 0') + .select("#{base_query_column}, COUNT(*) teacher_count") + end + end + + def page_size + params[:per_page] || 20 + end + + def offset + (params[:page].to_i.zero? ? 0 : params[:page].to_i - 1) * page_size + end +end \ No newline at end of file diff --git a/app/services/admins/statistic_school_contrast_data_service.rb b/app/services/admins/statistic_school_contrast_data_service.rb new file mode 100644 index 000000000..0496b1371 --- /dev/null +++ b/app/services/admins/statistic_school_contrast_data_service.rb @@ -0,0 +1,80 @@ +class Admins::StatisticSchoolContrastDataService < ApplicationService + ParameterError = Class.new(StandardError) + + PAGE_SIZE = 20 + CONTRAST_COLUMN_LIST = %w( + teacher_increase_count student_increase_count course_increase_count + shixun_increase_count active_user_count shixun_homework_count shixun_evaluate_count + ).freeze + + attr_reader :params, :sort_direction, :contrast_column + + def initialize(params) + @params = params + @sort_direction = params[:sort_direction].to_s + @contrast_column = params[:contrast_column].to_s + end + + def call + validate_parameter! + reports = School.joins(:school_daily_reports).select(select_columns) + + keyword = params[:keyword].try(:to_s).try(:strip) + if keyword.present? + reports = reports.where("schools.name LIKE :keyword OR schools.id LIKE :keyword", keyword: "%#{keyword}%") + end + + count = reports.count('distinct(schools.id)') + + sql = query_report_sql(reports.group('schools.id').to_sql) + reports = SchoolDailyReport.find_by_sql(sql) + + [count, reports] + end + + private + def validate_parameter! + if %i[begin_date end_date other_begin_date other_end_date].any? { |key| params[key].blank? } + raise ParameterError + end + + unless %w(desc asc).include?(sort_direction) + raise ParameterError + end + + unless CONTRAST_COLUMN_LIST.include?(contrast_column) + raise ParameterError + end + end + + def format_date(date) + Time.zone.parse(date).strftime("%Y-%m-%d") + end + + def offset + (params[:page].to_i.zero? ? 0 : params[:page].to_i - 1) * PAGE_SIZE + end + + def select_columns + if contrast_column != 'active_user_count' + "schools.id school_id, schools.name school_name,"\ + "(SUM(IF(date BETWEEN '#{format_date(params[:begin_date])}' AND '#{format_date(params[:end_date])}', #{contrast_column}, 0))) total,"\ + "(SUM(IF(date BETWEEN '#{format_date(params[:other_begin_date])}' AND '#{format_date(params[:other_end_date])}', #{contrast_column}, 0))) other_total" + else + # 活跃用户对比时处理方法不同 + relations = SchoolDailyActiveUser.select('COUNT(distinct user_id)').joins(:school_daily_report) + .where('school_id = schools.id') + total_subquery = relations.where("date BETWEEN '#{format_date(params[:begin_date])}' AND '#{format_date(params[:end_date])}'").to_sql + other_total_subquery = relations.where("date BETWEEN '#{format_date(params[:other_begin_date])}' AND '#{format_date(params[:other_end_date])}'").to_sql + + "schools.id school_id, schools.name school_name, (#{total_subquery}) AS total, (#{other_total_subquery}) AS other_total" + end + end + + def query_report_sql(from_sql) + order_by = "(total = 0 AND other_total != 0) #{sort_direction}, (percentage != 0) #{sort_direction}, percentage #{sort_direction}" + + "SELECT reports.*, (other_total - total) increase, (IF(other_total - total = 0, 0.0, round((other_total - total) / IF(total = 0, 1, total), 5))) percentage "\ + "FROM (#{from_sql}) reports ORDER BY #{order_by} LIMIT #{PAGE_SIZE} OFFSET #{offset}" + end +end \ No newline at end of file diff --git a/app/services/admins/statistic_school_data_grow_service.rb b/app/services/admins/statistic_school_data_grow_service.rb new file mode 100644 index 000000000..8df106666 --- /dev/null +++ b/app/services/admins/statistic_school_data_grow_service.rb @@ -0,0 +1,107 @@ +class Admins::StatisticSchoolDataGrowService < ApplicationService + include CustomSortable + + PAGE_SIZE = 20 + + attr_reader :params + + sort_columns :teacher_increase_count, :student_increase_count, + :course_increase_count, :shixun_increase_count, :uniq_active_user_count, + :shixun_homework_count, :shixun_evaluate_count, + default_by: :teacher_increase_count, default_direction: :desc + + def initialize(params) + @params = params + end + + def call + reports = School.where(nil) + + reports = search_filter(reports) + + count = reports.count + + subquery = SchoolDailyActiveUser.select('COUNT(distinct(user_id))').joins(:school_daily_report) + .where(date_condition_sql).where("school_id is not null and school_id = schools.id").to_sql + reports = reports.joins("LEFT JOIN school_daily_reports sdr ON sdr.school_id = schools.id AND #{date_condition_sql}") + reports = reports.select( + 'schools.id school_id, schools.name school_name,'\ + 'SUM(teacher_increase_count) teacher_increase_count,'\ + 'SUM(student_increase_count) student_increase_count,'\ + 'SUM(course_increase_count) course_increase_count,'\ + 'SUM(shixun_increase_count) shixun_increase_count,'\ + 'SUM(shixun_homework_count) shixun_homework_count,'\ + 'SUM(shixun_evaluate_count) shixun_evaluate_count,'\ + "(#{subquery}) uniq_active_user_count,"\ + 'SUM(active_user_count) active_user_count').group('schools.id') + + reports = custom_sort(reports, params[:sort_by], params[:sort_direction]) + reports = reports.order('school_id asc').limit(PAGE_SIZE).offset(offset) + + [count, reports] + end + + def grow_summary + @_grow_summary ||= begin + reports = School.joins("LEFT JOIN school_daily_reports sdr ON sdr.school_id = schools.id") + .where(date_condition_sql) + + subquery = SchoolDailyActiveUser.select('COUNT(distinct user_id)') + .joins('LEFT JOIN school_daily_reports sdr ON sdr.id = school_daily_active_users.school_daily_report_id') + .where(date_condition_sql).to_sql + reports = search_filter(reports) + reports.select( + 'SUM(teacher_increase_count) teacher_increase_count,'\ + 'SUM(student_increase_count) student_increase_count,'\ + 'SUM(course_increase_count) course_increase_count,'\ + 'SUM(shixun_increase_count) shixun_increase_count,'\ + 'SUM(shixun_homework_count) shixun_homework_count,'\ + 'SUM(shixun_evaluate_count) shixun_evaluate_count,'\ + "(#{subquery}) uniq_active_user_count,"\ + 'SUM(active_user_count) active_user_count' + ).first + end + end + + private + + def search_filter(relations) + keyword = params[:keyword].try(:to_s).try(:strip) + if keyword.present? + relations = relations.where("schools.name LIKE :keyword OR schools.id LIKE :keyword", keyword: "%#{keyword}%") + end + + relations + end + + def date_condition_sql + date = query_date + if date.is_a?(Range) + "date BETWEEN '#{date.min.strftime('%Y-%m-%d')}' AND '#{date.max.strftime('%Y-%m-%d')}'" + else + "date = '#{date.strftime('%Y-%m-%d')}'" + end + end + + def query_date + if params[:grow_begin_date].present? + begin_time = Time.zone.parse(params[:grow_begin_date]) + end_date = if params[:grow_end_date].present? + Time.zone.parse(params[:grow_end_date]) + end + + end_date.blank? || end_date == begin_time ? begin_time : begin_time..end_date + else + yesterday + end + end + + def yesterday + # 每日凌晨5点为节点, 25日凌晨4点、3点、2点等等,未到更新数据时间点,看到的数据是:23日-24日的统计数据 + (Time.zone.now - 5.hours).beginning_of_day - 1.days + end + + def offset + (params[:page].to_i.zero? ? 0 : params[:page].to_i - 1) * PAGE_SIZE + end +end \ No newline at end of file diff --git a/app/services/admins/update_user_service.rb b/app/services/admins/update_user_service.rb new file mode 100644 index 000000000..9531d3718 --- /dev/null +++ b/app/services/admins/update_user_service.rb @@ -0,0 +1,52 @@ +class Admins::UpdateUserService < ApplicationService + Error = Class.new(StandardError) + + attr_reader :user, :params + + def initialize(user, params) + @user = user + @params = params + end + + def call + user.assign_attributes(user_attributes) + user.firstname = '' + user.password = password if params[:password].present? + + if params[:identity].to_s == 'student' + params[:technical_title] = nil + else + params[:student_id] = nil + end + user.user_extension.assign_attributes(user_extension_attributes) + + ActiveRecord::Base.transaction do + user.save! + user.user_extension.save! + + update_gitlab_password if params[:password].present? + end + + user + end + + private + + def user_attributes + params.slice(*%i[lastname nickname mail phone admin business is_test + professional_certification authentication]) + end + + def user_extension_attributes + params.slice(*%i[gender identity technical_title student_id location location_city school_id department_id]) + end + + def update_gitlab_password + return if user.gid.blank? + # 同步修改gitlab密码 + Gitlab.client.edit_user(user.gid, password: params[:password]) + rescue Exception => ex + Util.logger_error(ex) + raise Error, '保存失败' + end +end \ No newline at end of file diff --git a/app/services/homeworks_service.rb b/app/services/homeworks_service.rb index 78be3b8f9..64aec92c6 100644 --- a/app/services/homeworks_service.rb +++ b/app/services/homeworks_service.rb @@ -15,7 +15,8 @@ class HomeworksService homework_detail_manual.save! if homework_detail_manual HomeworkCommonsShixun.create!(homework_common_id: homework.id, shixun_id: shixun.id) HomeworksService.new.create_shixun_homework_cha_setting(homework, shixun) - HomeworksService.new.create_works_list(homework, course) + CreateStudentWorkJob.perform_later(homework.id) + # HomeworksService.new.create_works_list(homework, course) end homework end diff --git a/app/services/reward_grade_service.rb b/app/services/reward_grade_service.rb index 7642e1967..38eda7aaa 100644 --- a/app/services/reward_grade_service.rb +++ b/app/services/reward_grade_service.rb @@ -1,13 +1,14 @@ class RewardGradeService < ApplicationService - attr_reader :user, :attrs + attr_reader :user, :attrs, :not_unique def initialize(user, **attrs) @user = user + @not_unique = attrs.delete(:not_unique) || false @attrs = attrs.slice(*%i[container_id container_type score]) end def call - return if user.grades.exists?(attrs) + return if user.grades.exists?(attrs) && !not_unique ActiveRecord::Base.transaction do grade = user.grades.create!(attrs) diff --git a/app/services/users/course_service.rb b/app/services/users/course_service.rb index 9eb34917e..de70c5b86 100644 --- a/app/services/users/course_service.rb +++ b/app/services/users/course_service.rb @@ -23,11 +23,11 @@ class Users::CourseService def category_scope_courses case params[:category] when 'study' then - user.as_student_courses + user.as_student_courses.started when 'manage' then user.manage_courses else - ids = user.as_student_courses.pluck(:id) + user.manage_courses.pluck(:id) + ids = user.as_student_courses.started.pluck(:id) + user.manage_courses.pluck(:id) Course.where(id: ids) end end diff --git a/app/tasks/statistic_school_daily_report_task.rb b/app/tasks/statistic_school_daily_report_task.rb new file mode 100644 index 000000000..5cd3fda7c --- /dev/null +++ b/app/tasks/statistic_school_daily_report_task.rb @@ -0,0 +1,69 @@ +class StatisticSchoolDailyReportTask + def call + School.find_each do |school| + # 新增教师和学生 + users = User.joins(:user_extension) + .where(user_extensions: { school_id: school.id }) + + teacher_count = users.where(created_on: yesterday, user_extensions: { identity: :teacher }).count + student_count = users.where(created_on: yesterday, user_extensions: { identity: :student }).count + + # 活跃用户 + active_user_ids = users.where(last_login_on: yesterday).pluck(:id) + active_user_count = active_user_ids.size + + + # 新增课堂 + course_count = school.courses.where(created_at: yesterday).count + + # 新增实训 + shixun_count = Shixun.joins(user: :user_extension) + .where(user_extensions: { identity: :teacher, school_id: school.id }) + .where(created_at: yesterday).count + # 新增实训作业数 + shixun_homework_count = HomeworkCommon.joins(:course).where(courses: { school_id: school.id }) + .where(homework_type: 4, created_at: yesterday).count + + # 新增实训评测数量 + shixun_evaluate_count = EvaluateRecord.joins('LEFT JOIN homework_commons_shixuns hcs ON hcs.shixun_id = evaluate_records.shixun_id') + .joins('LEFT JOIN homework_commons hc ON hcs.homework_common_id = hc.id AND hc.homework_type = 4') + .joins('LEFT JOIN members ON members.user_id = evaluate_records.user_id') + .joins('LEFT JOIN courses ON members.course_id = courses.id AND hc.course_id = courses.id') + .where(courses: { school_id: school.id }) + .where(created_at: yesterday).reorder(nil).count + + # 无有效数据时不记录 + data = [teacher_count, student_count, course_count, shixun_count, active_user_count, + shixun_homework_count, shixun_evaluate_count] + next if data.all?(&:zero?) + + create_params = { + school_id: school.id, school_name: school.name, teacher_increase_count: teacher_count, + student_increase_count: student_count, course_increase_count: course_count, + shixun_homework_count: shixun_homework_count, shixun_evaluate_count: shixun_evaluate_count, + shixun_increase_count: shixun_count, active_user_count: active_user_count, date: current_date + } + report = SchoolDailyReport.create!(create_params) + + if active_user_ids.present? + values = '(' + active_user_ids.join(", #{report.id}),(") + ", #{report.id})" + user_sql = "INSERT INTO school_daily_active_users(user_id, school_daily_report_id) VALUES#{values}" + SchoolDailyActiveUser.connection.execute(user_sql) + end + end + end + + private + def current_date + @_current_date ||= Time.zone.now.beginning_of_day - 1.day + end + + def yesterday + @_yesterday ||= begin + # 每日凌晨5点为节点 + end_time = Time.zone.now.beginning_of_day + 5.hour + begin_time = end_time - 1.day + begin_time..end_time + end + end +end diff --git a/app/tasks/statistic_school_report_task.rb b/app/tasks/statistic_school_report_task.rb new file mode 100644 index 000000000..a55eb7a42 --- /dev/null +++ b/app/tasks/statistic_school_report_task.rb @@ -0,0 +1,20 @@ +class StatisticSchoolReportTask + def call + School.find_each do |school| + evaluate_count = Game.joins(:challenge) + .joins('LEFT JOIN members ON members.user_id = games.user_id') + .joins('LEFT JOIN homework_commons_shixuns hcs ON hcs.shixun_id = challenges.shixun_id') + .joins('LEFT JOIN homework_commons hc ON hcs.homework_common_id = hc.id AND hc.homework_type = 4') + .joins('LEFT JOIN courses ON hc.course_id = courses.id AND members.course_id = courses.id') + .where(courses: { school_id: school.id }) + .sum(:evaluate_count) + + report = SchoolReport.find_or_initialize_by(school_id: school.id) + + report.school_name = school.name + report.shixun_evaluate_count = evaluate_count + + report.save + end + end +end diff --git a/app/templates/shared/main.css b/app/templates/shared/main.css index 81b80cdf8..9e9bc4f50 100644 --- a/app/templates/shared/main.css +++ b/app/templates/shared/main.css @@ -760,9 +760,9 @@ html>body #ajax-indicator { position: fixed; } .paddingLeft28{padding-left:28px;} -.ant-modal-header{ - border-radius: 10px; -} +/*.ant-modal-header{*/ + /*border-radius: 10px;*/ +/*}*/ .color656565{ color:#656565; @@ -779,4 +779,7 @@ html>body #ajax-indicator { position: fixed; } border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; +} +.yslminHeigth{ + min-height: 400px; } \ No newline at end of file diff --git a/app/views/admin/index.html.erb b/app/views/admin/index.html.erb deleted file mode 100644 index e5ff016b5..000000000 --- a/app/views/admin/index.html.erb +++ /dev/null @@ -1,619 +0,0 @@ -2222222222z - -
            - - - -
            - -
            -
            -
            -
            -
            - -
            -
            -

            TOTAL VISITORS

            -

            0

            -
            -
            -
            - -
            -
            - -
            -
            -
            -
            - -
            -
            -

            TOTAL SALES

            -

            0

            - -
            -
            -
            - -
            -
            - -
            -
            -
            -
            - -
            -
            -

            OVERALL INCOME

            -

            $0

            -
            -
            -
            - -
            -
            - -
            -
            -
            -
            - -
            -
            -

            TOTAL USERS

            -

            0

            -
            -
            -
            - -
            -
            - -
            - - -
            -
            -
            -
            -

            Website Statistics

            - -
            -
            -
            -
            -
            - -
            -
            -
            -
            -
            -
            -
            - - -
            -
            -
            -
            -

            Server Status

            - -
            -
            -
            - -
            -

            Server Loads

            -
            - -
            -
            -
            - Processes
            - 0 -
            -
            - Connections
            - 0 -
            -
            - Avg. Load
            - 0 -
            -
            -
            -
            -
            -
            - 72% Complete (success) -
            -
            -
            -
            -
            -
            -
            -
            -
            -
            -
            -
            - -
            -
            - -
            -
            -
            -
            -

            Sales Report

            - -
            -
            -
            -
            -
            -
            - Completed Sales65 / 174 -
            -
            -
            -
            - Return(s) Processed22 / 25 -
            -
            -
            -
            - Shipped Products418 / 624 -
            -
            -
            -
            - Overall Product Stock19% -
            -
            -
            -
            -
            -
            -
            -
            -
            -
            - -
            -
            -
            -
            -
            -
            -
            -
            -
            -

            Todo List

            -
            - - - - - -
            -
            -
            -
              -
            • - - Generate monthly sales report for John - - - - -
              New
              -
              -
            • -
            • - - Mail those reports to John - - - -
            • -
            • - - Don't forget to send those reports to John - - - -
            • -
            • - - If you forgot, go back to office to pick them up - - - - -
              Today
              -
              -
            • -
            • - - Deliver reports by hand to John - - - -
            • -
            • - - Say John that you are sorry - - - -
            • -
            • - - Beg for your job... - - - - -
              Important
              -
              -
            • -
            • - - Look for a new job - - - - -
              -
              -
            • -
            -
            -
            -
            -
            -
            -
            -
            -
            -
            -
            -

            Notes

            -
            - - - - - -
            -
            -
            -
            -
            -
              -
            -
            -
            -
            -
            - -
            -
            -
            Saved
            -
            -
            -
            -
            -
            -
            -
            -
            -
            -
            -

            Weather Widget

            - -
            -
            - -
            - -
            -
            - -
            -
            -
            -

            Calendar Widget

            -
            - - - - -
            -
            -
            - -
            -
            -
            -
            -
            -
            -
            - -
            -
            - - - - -
            -
            -
            -
            -
            -
            C
            -
            -
            -
            - -
            -
            -
            7
            -
            8
            -
            9
            -
            +
            -
            -
            -
            4
            -
            5
            -
            6
            -
            -
            -
            -
            -
            1
            -
            2
            -
            3
            -
            ÷
            -
            -
            -
            0
            -
            .
            -
            =
            -
            x
            -
            -
            -
            -
            -
            -
            -
            - -
            -
            - -
            -
            -
            -
            -

            Stock Markets

            - -
            -
            -
            -
            -
            -

            NASDAQ

            -
            -
            - -
            -
            -
            -
            -

            DOW JONES

            -
            -
            - -
            -
            -
            -
            -

            S&P

            -
            -
            - -
            -
            -
            -
            -
            - -
            -
            -
            - - - - -
            - - - - -
            - \ No newline at end of file diff --git a/app/views/admins/daily_school_statistics/export.xlsx.axlsx b/app/views/admins/daily_school_statistics/export.xlsx.axlsx new file mode 100644 index 000000000..1757a8fe2 --- /dev/null +++ b/app/views/admins/daily_school_statistics/export.xlsx.axlsx @@ -0,0 +1,13 @@ +wb = xlsx_package.workbook +wb.add_worksheet(name: '统计总表') do |sheet| + sheet.add_row %w(ID 单位名称 教师总人数 学生总人数 课堂总数 正在进行课堂数 总实训数 实训评测总数 实训作业总数 其它作业总数 动态时间) + + @schools.each do |school| + sheet.add_row([ + school[:id].to_s, school[:name].to_s, (school[:teacher_count] || 0).to_s, (school[:student_count] || 0).to_s, + (school[:course_count] || 0).to_s, (school[:active_course_count] || 0).to_s, + (school[:shixun_count] || 0).to_s,(school[:shixun_evaluate_count] || 0).to_s, (school[:homework_count] || 0).to_s, + (school[:other_homework_count] || 0).to_s, format_time(school[:nearly_course_time]) + ]) + end +end \ No newline at end of file diff --git a/app/views/admins/daily_school_statistics/index.html.erb b/app/views/admins/daily_school_statistics/index.html.erb new file mode 100644 index 000000000..054e06fc6 --- /dev/null +++ b/app/views/admins/daily_school_statistics/index.html.erb @@ -0,0 +1,29 @@ +<% define_admin_breadcrumbs do %> + <% add_admin_breadcrumb('统计总表', admins_daily_school_statistics_path) %> +<% end %> + +
            + <%= form_tag(admins_daily_school_statistics_path, method: :get, class: 'form-inline search-form', remote: true) do %> + <%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: 'ID/单位名称搜索') %> + <%= submit_tag('搜索', class: 'btn btn-primary ml-3') %> + <% end %> + + <%#= link_to '导出Excel', export_admins_daily_school_statistics_path(format: :xlsx), class: 'btn btn-outline-primary export-action' %> + <%= javascript_void_link '导出Excel', class: 'btn btn-outline-primary export-action', 'data-url': export_admins_daily_school_statistics_path(format: :xlsx) %> +
            + +
            + 统计总计: + 教师总人数<%= @teacher_total %>人, + 学生总人数<%= @student_total %>人, + 课堂总数<%= @course_total %>个, + 正在进行课堂总数<%= @active_course_total %>个, + 实训总数<%= @shixun_total %>个, + 实训评测总数<%= @shixun_evaluate_total %>个, + 实训作业总数<%= @shixun_homework_total %>个, + 其它作业总数<%= @other_homework_total %>个 +
            + +
            + <%= render partial: 'admins/daily_school_statistics/shared/list', locals: { statistics: @statistics } %> +
            \ No newline at end of file diff --git a/app/views/admins/daily_school_statistics/index.js.erb b/app/views/admins/daily_school_statistics/index.js.erb new file mode 100644 index 000000000..d3e261f64 --- /dev/null +++ b/app/views/admins/daily_school_statistics/index.js.erb @@ -0,0 +1 @@ +$(".daily-school-statistic-list-container").html("<%= j(render partial: 'admins/daily_school_statistics/shared/list', locals: { statistics: @statistics }) %>") \ No newline at end of file diff --git a/app/views/admins/daily_school_statistics/shared/_list.html.erb b/app/views/admins/daily_school_statistics/shared/_list.html.erb new file mode 100644 index 000000000..611acdd2a --- /dev/null +++ b/app/views/admins/daily_school_statistics/shared/_list.html.erb @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + <% if statistics.present? %> + <% statistics.each do |statistic| %> + + + + + + + + + + + + + <% end %> + <% else %> + <%= render 'admins/shared/no_data_for_table' %> + <% end %> + +
            单位名称<%= sort_tag('教师总数', name: 'teacher_count', path: admins_daily_school_statistics_path) %><%= sort_tag('学生总数', name: 'student_count', path: admins_daily_school_statistics_path) %><%= sort_tag('课堂总数', name: 'course_count', path: admins_daily_school_statistics_path) %><%= sort_tag('正在进行课堂数', name: 'active_course_count', path: admins_daily_school_statistics_path) %><%= sort_tag('实训总数', name: 'shixun_count', path: admins_daily_school_statistics_path) %> + <%= sort_tag(name: 'shixun_evaluate_count', path: admins_daily_school_statistics_path) do %> + 实训评测总数 + + <% end %> + <%= sort_tag('实训作业总数', name: 'homework_count', path: admins_daily_school_statistics_path) %><%= sort_tag('其它作业总数', name: 'other_homework_count', path: admins_daily_school_statistics_path) %><%= sort_tag('动态时间', name: 'nearly_course_time', path: admins_daily_school_statistics_path) %>
            + <%= link_to statistic[:name], "/colleges/#{statistic[:id]}/statistics", + target: '_blank', data: { toggle: 'tooltip', title: '点击查看学校统计概况' } %> + <%= statistic[:teacher_count].to_i %><%= statistic[:student_count].to_i %><%= statistic[:course_count].to_i %><%= statistic[:active_course_count].to_i %><%= statistic[:shixun_count].to_i %><%= statistic[:shixun_evaluate_count].to_i %><%= statistic[:homework_count].to_i %><%= statistic[:other_homework_count].to_i %><%= statistic[:nearly_course_time]&.strftime('%Y-%m-%d %H:%M') %>
            + +<%= render partial: 'admins/shared/paginate', locals: { objects: statistics } %> \ No newline at end of file diff --git a/app/views/admins/dashboards/index.html.erb b/app/views/admins/dashboards/index.html.erb new file mode 100644 index 000000000..bff34dbcd --- /dev/null +++ b/app/views/admins/dashboards/index.html.erb @@ -0,0 +1,188 @@ +<% define_admin_breadcrumbs do %> + <% add_admin_breadcrumb('概览', admins_path) %> +<% end %> + +
            +
            +
            + +
            +
            +
            +
            +
            +
            +
            Traffic
            + 350,897 +
            +
            +
            + +
            +
            +
            +

            + 3.48% + Since last month +

            +
            +
            +
            +
            +
            +
            +
            +
            +
            New users
            + 2,356 +
            +
            +
            + +
            +
            +
            +

            + 3.48% + Since last week +

            +
            +
            +
            +
            +
            +
            +
            +
            +
            Sales
            + 924 +
            +
            +
            + +
            +
            +
            +

            + 1.10% + Since yesterday +

            +
            +
            +
            +
            +
            +
            +
            +
            +
            Performance
            + 49,65% +
            +
            +
            + +
            +
            +
            +

            + 12% + Since last month +

            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +

            Page visits

            +
            +
            + Test +
            +
            +
            +
            + + + + + + + + + + + + <% 5.times do %> + + + + + + + <% end %> + +
            TestTestTestTest
            /test/4,569340 + 46,53% +
            +
            +
            +
            +
            +
            +
            +
            +
            +

            Test

            +
            +
            + Test +
            +
            +
            +
            + + + + + + + + + + + <% 5.times do %> + + + + + + <% end %> + +
            TestTest
            + Test + + 1,480 + +
            + 60% +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            +
            \ No newline at end of file diff --git a/app/views/admins/identity_authentications/index.html.erb b/app/views/admins/identity_authentications/index.html.erb new file mode 100644 index 000000000..170a8fc4a --- /dev/null +++ b/app/views/admins/identity_authentications/index.html.erb @@ -0,0 +1,32 @@ +<% define_admin_breadcrumbs do %> + <% add_admin_breadcrumb('实名认证') %> +<% end %> + +
            + + + <%= form_tag(admins_identity_authentications_path(unsafe_params), method: :get, class: 'form-inline search-form justify-content-end mt-3', remote: true) do %> +
            + + <% status_options = [['全部', 'processed'], ['已同意', 'agreed'], ['已拒绝', 'refused']] %> + <%= select_tag(:status, options_for_select(status_options), class: 'form-control') %> +
            + <%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '姓名/学校/单位检索') %> + <%= submit_tag('搜索', class: 'btn btn-primary ml-3') %> + <% end %> +
            + +
            + <%= render(partial: 'admins/identity_authentications/shared/list', locals: { applies: @applies }) %> +
            + +<%= render(partial: 'admins/shared/admin_common_refuse_modal') %> \ No newline at end of file diff --git a/app/views/admins/identity_authentications/index.js.erb b/app/views/admins/identity_authentications/index.js.erb new file mode 100644 index 000000000..81d108b0d --- /dev/null +++ b/app/views/admins/identity_authentications/index.js.erb @@ -0,0 +1 @@ +$('.identity-authentication-list-container').html("<%= j( render partial: 'admins/identity_authentications/shared/list', locals: { applies: @applies } ) %>"); \ No newline at end of file diff --git a/app/views/admins/identity_authentications/shared/_list.html.erb b/app/views/admins/identity_authentications/shared/_list.html.erb new file mode 100644 index 000000000..f6aa53dd1 --- /dev/null +++ b/app/views/admins/identity_authentications/shared/_list.html.erb @@ -0,0 +1,74 @@ +<% is_processed = params[:status].to_s != 'pending' %> + + + + + + + + + + <% unless is_processed %> + + <% end %> + + <% if is_processed %> + + + <% else %> + + <% end %> + + + + <% if applies.present? %> + <% applies.each do |apply| %> + <% user = apply.user %> + + + + + + + + <% unless is_processed %> + + <% end %> + + + + <% if is_processed %> + + + <% else %> + + <% end %> + + <% end %> + <% else %> + <%= render 'admins/shared/no_data_for_table' %> + <% end %> + +
            头像姓名身份证号学校/单位职称 + 照片 + + 时间拒绝原因状态操作
            + <%= link_to "/users/#{user.login}", class: 'identity-authentication-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %> + + <% end %> + <%= user.real_name %><%= user.ID_number %><%= raw [user.school_name.presence, user.department_name.presence].compact.join('
            ') %>
            <%= user.identity %> <%= raw user.user_extension.student? && user.student_id ? "
            #{user.student_id}" : '' %>
            + <% if File.exists?(disk_real_name_auth_filename(user.id)) %> + <%= image_tag(real_name_auth_file_url(user.id).to_s + "?#{Time.now.to_i}", width: 40, height: 40, class: 'preview-image auth-image', data: { toggle: 'tooltip', title: '点击预览' }) %> + <% else %> + <%= content_tag(:span, '图片已删除', class: 'text-secondary') %> + <% end %> + <%= apply.updated_at.strftime('%Y-%m-%d %H:%M') %><%= overflow_hidden_span apply.remarks, width: 140 %><%= apply.status_text %> + <%= agree_link '同意', agree_admins_identity_authentication_path(apply, element: ".identity-authentication-#{apply.id}"), 'data-confirm': '确认审核通过?' %> + <%= javascript_void_link('拒绝', class: 'action refuse-action', + data: { + toggle: 'modal', target: '.admin-common-refuse-modal', id: apply.id, + url: refuse_admins_identity_authentication_path(apply, element: ".identity-authentication-#{apply.id}") + }) %> +
            + +<%= render partial: 'admins/shared/paginate', locals: { objects: applies } %> \ No newline at end of file diff --git a/app/views/admins/kaminari/_first_page.html.erb b/app/views/admins/kaminari/_first_page.html.erb new file mode 100644 index 000000000..148fc3f1c --- /dev/null +++ b/app/views/admins/kaminari/_first_page.html.erb @@ -0,0 +1,11 @@ +<%# Link to the "First" page + - available local variables + url: url to the first page + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote +-%> +
          • + <%= link_to_unless current_page.first?, t('views.pagination.first').html_safe, url, remote: remote, class: 'page-link' %> +
          • diff --git a/app/views/admins/kaminari/_gap.html.erb b/app/views/admins/kaminari/_gap.html.erb new file mode 100644 index 000000000..59236c8f6 --- /dev/null +++ b/app/views/admins/kaminari/_gap.html.erb @@ -0,0 +1,13 @@ +<%# Non-link tag that stands for skipped pages... + - available local variables + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote +-%> +
          • + <%= link_to 'javascript:void(0)', { class: 'page-link' } do %> + <%= t('views.pagination.truncate').html_safe %> + (current) + <% end %> +
          • diff --git a/app/views/admins/kaminari/_last_page.html.erb b/app/views/admins/kaminari/_last_page.html.erb new file mode 100644 index 000000000..3e8a524a0 --- /dev/null +++ b/app/views/admins/kaminari/_last_page.html.erb @@ -0,0 +1,11 @@ +<%# Link to the "Last" page + - available local variables + url: url to the last page + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote +-%> +
          • + <%= link_to_unless(current_page.last?, t('views.pagination.last').html_safe, url, remote: remote, class: 'page-link') %> +
          • diff --git a/app/views/admins/kaminari/_next_page.html.erb b/app/views/admins/kaminari/_next_page.html.erb new file mode 100644 index 000000000..211ddd423 --- /dev/null +++ b/app/views/admins/kaminari/_next_page.html.erb @@ -0,0 +1,11 @@ +<%# Link to the "Next" page + - available local variables + url: url to the next page + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote +-%> +
          • diff --git a/app/views/admins/kaminari/_page.html.erb b/app/views/admins/kaminari/_page.html.erb new file mode 100644 index 000000000..10a8374c7 --- /dev/null +++ b/app/views/admins/kaminari/_page.html.erb @@ -0,0 +1,19 @@ +<%# Link showing page number + - available local variables + page: a page object for "this" page + url: url to this page + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote +-%> +
          • + <% if page.current? %> + <%= link_to url, {remote: remote, rel: page.rel, class: 'page-link'} do %> + <%= page %> + (current) + <% end %> + <% else %> + <%= link_to page, url, {remote: remote, rel: page.rel, class: 'page-link'} %> + <% end %> +
          • diff --git a/app/views/admins/kaminari/_paginator.html.erb b/app/views/admins/kaminari/_paginator.html.erb new file mode 100644 index 000000000..8d090b129 --- /dev/null +++ b/app/views/admins/kaminari/_paginator.html.erb @@ -0,0 +1,27 @@ +<%# The container tag + - available local variables + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote + paginator: the paginator that renders the pagination tags inside +-%> +<%= paginator.render do -%> + +<% end -%> diff --git a/app/views/admins/kaminari/_prev_page.html.erb b/app/views/admins/kaminari/_prev_page.html.erb new file mode 100644 index 000000000..90c38dd36 --- /dev/null +++ b/app/views/admins/kaminari/_prev_page.html.erb @@ -0,0 +1,11 @@ +<%# Link to the "Previous" page + - available local variables + url: url to the previous page + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote +-%> + diff --git a/app/views/admins/professional_authentications/index.html.erb b/app/views/admins/professional_authentications/index.html.erb new file mode 100644 index 000000000..e10d2bd80 --- /dev/null +++ b/app/views/admins/professional_authentications/index.html.erb @@ -0,0 +1,32 @@ +<% define_admin_breadcrumbs do %> + <% add_admin_breadcrumb('职业认证') %> +<% end %> + +
            + + + <%= form_tag(admins_professional_authentications_path(unsafe_params), method: :get, class: 'form-inline search-form justify-content-end mt-3', remote: true) do %> +
            + + <% status_options = [['全部', 'processed'], ['已同意', 'agreed'], ['已拒绝', 'refused']] %> + <%= select_tag(:status, options_for_select(status_options), class: 'form-control') %> +
            + <%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '姓名/学校/单位检索') %> + <%= submit_tag('搜索', class: 'btn btn-primary ml-3') %> + <% end %> +
            + +
            + <%= render(partial: 'admins/professional_authentications/shared/list', locals: { applies: @applies }) %> +
            + +<%= render(partial: 'admins/shared/admin_common_refuse_modal') %> \ No newline at end of file diff --git a/app/views/admins/professional_authentications/index.js.erb b/app/views/admins/professional_authentications/index.js.erb new file mode 100644 index 000000000..468c131d6 --- /dev/null +++ b/app/views/admins/professional_authentications/index.js.erb @@ -0,0 +1 @@ +$('.professional-authentication-list-container').html("<%= j( render partial: 'admins/professional_authentications/shared/list', locals: { applies: @applies } ) %>"); \ No newline at end of file diff --git a/app/views/admins/professional_authentications/shared/_list.html.erb b/app/views/admins/professional_authentications/shared/_list.html.erb new file mode 100644 index 000000000..fd7685f98 --- /dev/null +++ b/app/views/admins/professional_authentications/shared/_list.html.erb @@ -0,0 +1,72 @@ +<% is_processed = params[:status].to_s != 'pending' %> + + + + + + + + + <% unless is_processed %> + + <% end %> + + <% if is_processed %> + + + <% else %> + + <% end %> + + + + <% if applies.present? %> + <% applies.each do |apply| %> + <% user = apply.user %> + + + + + + + <% unless is_processed %> + + <% end %> + + + + <% if is_processed %> + + + <% else %> + + <% end %> + + <% end %> + <% else %> + <%= render 'admins/shared/no_data_for_table' %> + <% end %> + +
            头像姓名学校/单位职称 + 照片 + + 时间拒绝原因状态操作
            + <%= link_to "/users/#{user.login}", class: 'professional-authentication-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %> + + <% end %> + <%= user.real_name %><%= raw [user.school_name.presence, user.department_name.presence].compact.join('
            ') %>
            <%= user.identity %> <%= raw user.user_extension.student? && user.student_id ? "
            #{user.student_id}" : '' %>
            + <% if File.exists?(disk_professional_auth_filename(user.id)) %> + <%= image_tag(professional_auth_file_url(user.id).to_s + "?#{Time.now.to_i}", width: 40, height: 40, class: 'preview-image auth-image', data: { toggle: 'tooltip', title: '点击预览' }) %> + <% else %> + <%= content_tag(:span, '图片已删除', class: 'text-secondary') %> + <% end %> + <%= apply.updated_at.strftime('%Y-%m-%d %H:%M') %><%= overflow_hidden_span apply.remarks, width: 140 %><%= apply.status_text %> + <%= agree_link '同意', agree_admins_professional_authentication_path(apply, element: ".professional-authentication-#{apply.id}"), 'data-confirm': '确认审核通过?' %> + <%= javascript_void_link('拒绝', class: 'action refuse-action', + data: { + toggle: 'modal', target: '.admin-common-refuse-modal', id: apply.id, + url: refuse_admins_professional_authentication_path(apply, element: ".professional-authentication-#{apply.id}") + }) %> +
            + +<%= render partial: 'admins/shared/paginate', locals: { objects: applies } %> \ No newline at end of file diff --git a/app/views/admins/school_statistics/contrast.js.erb b/app/views/admins/school_statistics/contrast.js.erb new file mode 100644 index 000000000..bc9916c12 --- /dev/null +++ b/app/views/admins/school_statistics/contrast.js.erb @@ -0,0 +1 @@ +$(".school-statistic-list-container").html("<%= j(render partial: 'admins/school_statistics/shared/contrast_list', locals: { statistics: @statistics, select_options: @select_options }) %>") \ No newline at end of file diff --git a/app/views/admins/school_statistics/index.html.erb b/app/views/admins/school_statistics/index.html.erb new file mode 100644 index 000000000..0453dfffa --- /dev/null +++ b/app/views/admins/school_statistics/index.html.erb @@ -0,0 +1,49 @@ +<% define_admin_breadcrumbs do %> + <% add_admin_breadcrumb('数据变化报表', admins_school_statistics_path) %> +<% end %> + +
            +
            +
            + + <%= hidden_field_tag :contrast_column, params[:contrast_column] %> + +
            +
            + <%= text_field_tag :grow_begin_date, params[:grow_begin_date], class: 'form-control start-date mx-0', placeholder: '开始时间' %> +
            + <%= text_field_tag :grow_end_date, params[:grow_end_date], class: 'form-control end-date mx-0', placeholder: '结束时间' %> +
            +
            +
            +
            + <%= text_field_tag :begin_date, params[:begin_date], class: 'form-control start-date mx-0', placeholder: '开始时间' %> +
            + <%= text_field_tag :end_date, params[:end_date], class: 'form-control end-date mx-0', placeholder: '结束时间' %> +
            +
            VS
            +
            + <%= text_field_tag :other_begin_date, params[:other_begin_date], class: 'form-control start-date mx-0', placeholder: '开始时间' %> +
            + <%= text_field_tag :other_end_date, params[:other_end_date], class: 'form-control end-date mx-0', placeholder: '结束时间' %> +
            +
            +
            + +
            + <%= hidden_field_tag :data_type, params[:data_type] || 'grow' %> + <%= javascript_void_link '时段对比', class: "btn btn-outline-info btn-sm contrast-btn #{params[:data_type] == 'contrast' ? 'active' : ''}", + data: { toggle: 'tooltip', trigger: 'hover', title: '请在左侧分别选择需进行对比的两个时段,具体从当日5:00开始计算,下表显示两时段选定指标两时段变化情况对比' } %> + <%= javascript_void_link '数据变化', class: "btn btn-outline-info btn-sm grow-btn #{params[:data_type] == 'contrast' ? '' : 'active'}", + data: { toggle: 'tooltip', trigger: 'hover', title: '请在左侧选择时间段,具体从当日5:00开始计算,下表显示选定时间段内各项指标数据变化情况' } %> +
            + + <%= text_field_tag :keyword, params[:keyword], placeholder: 'ID/单位名称检索', class: 'form-control mx-3 search-input' %> + + <%= javascript_void_link '搜索', class: 'btn btn-primary search-btn' %> +
            +
            + +
            + <%= render partial: 'admins/school_statistics/shared/list', locals: { statistics: @statistics } %> +
            \ No newline at end of file diff --git a/app/views/admins/school_statistics/index.js.erb b/app/views/admins/school_statistics/index.js.erb new file mode 100644 index 000000000..3f5f7334b --- /dev/null +++ b/app/views/admins/school_statistics/index.js.erb @@ -0,0 +1 @@ +$(".school-statistic-list-container").html("<%= j(render partial: 'admins/school_statistics/shared/list', locals: { statistics: @statistics }) %>") \ No newline at end of file diff --git a/app/views/admins/school_statistics/shared/_contrast_list.html.erb b/app/views/admins/school_statistics/shared/_contrast_list.html.erb new file mode 100644 index 000000000..928340c80 --- /dev/null +++ b/app/views/admins/school_statistics/shared/_contrast_list.html.erb @@ -0,0 +1,72 @@ +
            +
            + 学校数据统计(<%= I18n.t("school_daily_report.#{params[:contrast_column]}") %>变化统计情况) +
            + <%= select_tag :contrast_column, + options_for_select(select_options, params[:contrast_column]), + class: 'form-control contrast-column-select' %> + + <% if statistics.present? %> +
            + 说明:新增数=时段二-时段一;新增百分比=(新增数/时段一)*100%(保留小数点后五位) +
            + <% end %> +
            + +<% if statistics.present? %> + + + + + + + + + + + <% statistics.each do |statistic| %> + + + + + <% + increase = statistic['other_total'] - statistic['total'] + percentage = statistic['total'].zero? ? increase.to_f * 100 : (increase / statistic['total'].to_f) * 100 + %> + <% if increase > 0 %> + + <% if statistic['total'].zero? %> + + <% else %> + + <% end %> + <% elsif increase.zero? %> + + + <% else %> + + + <% end %> + + <% end %> + +
            单位名称时段一
            <%= "(#{params[:begin_date]} 05:00至#{(Time.zone.parse(params[:end_date]) + 1.days).strftime('%Y-%m-%d')} 05:00)" %>
            时段二
            <%= "(#{params[:other_begin_date]} 05:00至#{(Time.zone.parse(params[:other_end_date]) + 1.days).strftime('%Y-%m-%d')} 05:00)" %>
            + <%= sort_tag('变化情况', name: 'percentage', path: contrast_admins_school_statistics_path) %> +
            ( 新 增 数 | 新增百分比) +
            + <%= link_to statistic.school_name, "/colleges/#{statistic.school_id}/statistics", + target: '_blank', data: { toggle: 'tooltip', title: '点击查看学校统计概况' } %> + <%= statistic['total'] %><%= statistic['other_total'] %> + +<%= increase %> + -+<%= percentage.round(5) %>% + <%= increase %> + <%= percentage.round(5) %>% + <%= increase %> + <%= percentage.round(5) %>%
            + + <%= render partial: 'admins/shared/paginate', locals: { objects: statistics } %> +<% else %> +
            + 暂无数据,请选择时间段对比 +
            +<% end %> \ No newline at end of file diff --git a/app/views/admins/school_statistics/shared/_list.html.erb b/app/views/admins/school_statistics/shared/_list.html.erb new file mode 100644 index 000000000..aa043f097 --- /dev/null +++ b/app/views/admins/school_statistics/shared/_list.html.erb @@ -0,0 +1,56 @@ +
            + 统计总计: + <% if params[:grow_begin_date].present? %> + <%= params[:grow_begin_date] %> 05:00至<%= (Time.zone.parse(params[:grow_end_date]) + 1.days).strftime('%Y-%m-%d') %> 05:00 + <% else %> + <%= (Time.current - 5.hour).beginning_of_day.ago(1.days).strftime('%Y-%m-%d') %> 05:00至 + <%= (Time.current - 5.hour).beginning_of_day.strftime('%Y-%m-%d') %> 05:00, + <% end %> + 新增教师<%= @grow_summary.teacher_increase_count || 0 %>人, + 新增学生<%= @grow_summary.student_increase_count || 0 %>人, + 新增课堂<%= @grow_summary.course_increase_count || 0 %>个, + 新增实训<%= @grow_summary.shixun_increase_count || 0 %>个, + 新增实训作业<%= @grow_summary.shixun_homework_count || 0 %>个, + 新增实训评测<%= @grow_summary.shixun_evaluate_count || 0 %>个, + 活跃用户 + <%= @grow_summary.uniq_active_user_count.to_i.zero? ? @grow_summary.active_user_count.to_i : @grow_summary.uniq_active_user_count.to_i %> + 个 +
            + + + + + + + + + + + + + + + + <% if statistics.present? %> + <% statistics.each do |statistic| %> + + + + + + + + + + + <% end %> + <% else %> + <%= render 'admins/shared/no_data_for_table' %> + <% end %> + +
            单位名称<%= sort_tag('新增教师', name: 'teacher_increase_count', path: admins_school_statistics_path) %><%= sort_tag('新增学生', name: 'student_increase_count', path: admins_school_statistics_path) %><%= sort_tag('新增课堂', name: 'course_increase_count', path: admins_school_statistics_path) %><%= sort_tag('新增实训', name: 'shixun_increase_count', path: admins_school_statistics_path) %><%= sort_tag('新增实训作业', name: 'shixun_homework_count', path: admins_school_statistics_path) %><%= sort_tag('新增实训评测', name: 'shixun_evaluate_count', path: admins_school_statistics_path) %><%= sort_tag('活跃用户', name: 'uniq_active_user_count', path: admins_school_statistics_path) %>
            + <%= link_to statistic.school_name, "/colleges/#{statistic.school_id}/statistics", + target: '_blank', data: { toggle: 'tooltip', title: '点击查看学校统计概况' } %> + <%= statistic.teacher_increase_count.to_i %><%= statistic.student_increase_count.to_i %><%= statistic.course_increase_count.to_i %><%= statistic.shixun_increase_count.to_i %><%= statistic.shixun_homework_count.to_i %><%= statistic.shixun_evaluate_count.to_i %><%= statistic.uniq_active_user_count.to_i.zero? ? statistic.active_user_count.to_i : statistic.uniq_active_user_count.to_i %>
            + +<%= render partial: 'admins/shared/paginate', locals: { objects: statistics } %> \ No newline at end of file diff --git a/app/views/admins/shared/404.html.erb b/app/views/admins/shared/404.html.erb new file mode 100644 index 000000000..8e285cb27 --- /dev/null +++ b/app/views/admins/shared/404.html.erb @@ -0,0 +1,6 @@ +
            +
            + 404 +
            +
            资源未找到
            +
            \ No newline at end of file diff --git a/app/views/admins/shared/422.html.erb b/app/views/admins/shared/422.html.erb new file mode 100644 index 000000000..e56889496 --- /dev/null +++ b/app/views/admins/shared/422.html.erb @@ -0,0 +1,6 @@ +
            +
            + 422 +
            +
            <%= @message %>
            +
            \ No newline at end of file diff --git a/app/views/admins/shared/500.html.erb b/app/views/admins/shared/500.html.erb new file mode 100644 index 000000000..f053f58ec --- /dev/null +++ b/app/views/admins/shared/500.html.erb @@ -0,0 +1,6 @@ +
            +
            + 500 +
            +
            系统错误
            +
            \ No newline at end of file diff --git a/app/views/admins/shared/_admin_common_refuse_modal.html.erb b/app/views/admins/shared/_admin_common_refuse_modal.html.erb new file mode 100644 index 000000000..a2daf7f0c --- /dev/null +++ b/app/views/admins/shared/_admin_common_refuse_modal.html.erb @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/app/views/admins/shared/_alert.html.erb b/app/views/admins/shared/_alert.html.erb new file mode 100644 index 000000000..8c568f2a3 --- /dev/null +++ b/app/views/admins/shared/_alert.html.erb @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/app/views/admins/shared/_breadcrumb.html.erb b/app/views/admins/shared/_breadcrumb.html.erb new file mode 100644 index 000000000..8aea89871 --- /dev/null +++ b/app/views/admins/shared/_breadcrumb.html.erb @@ -0,0 +1,13 @@ +<% if @_admin_breadcrumbs.present? %> + +<% end %> \ No newline at end of file diff --git a/app/views/admins/shared/_flash_notice.html.erb b/app/views/admins/shared/_flash_notice.html.erb new file mode 100644 index 000000000..7bee80b0f --- /dev/null +++ b/app/views/admins/shared/_flash_notice.html.erb @@ -0,0 +1,20 @@ +<% flash.each do |k, v| %> + <% next unless %w(success danger warning info).include?(k.to_s) %> + + +<% end %> +<% flash.now.as_json.each do |k, v| %> + <% next unless %w(success danger warning info).include?(k.to_s) %> + + +<% end %> \ No newline at end of file diff --git a/app/views/admins/shared/_no_data_for_table.html.erb b/app/views/admins/shared/_no_data_for_table.html.erb new file mode 100644 index 000000000..1899f8d2e --- /dev/null +++ b/app/views/admins/shared/_no_data_for_table.html.erb @@ -0,0 +1 @@ +暂无数据 \ No newline at end of file diff --git a/app/views/admins/shared/_paginate.html.erb b/app/views/admins/shared/_paginate.html.erb new file mode 100644 index 000000000..b7e40e879 --- /dev/null +++ b/app/views/admins/shared/_paginate.html.erb @@ -0,0 +1,6 @@ +
            + <% if objects.size.nonzero? %> +
            <%= page_entries_info objects %>
            + <% end %> + <%= paginate objects, views_prefix: 'admins', remote: true %> +
            \ No newline at end of file diff --git a/app/views/admins/shared/_sidebar.html.erb b/app/views/admins/shared/_sidebar.html.erb new file mode 100644 index 000000000..2be899ebd --- /dev/null +++ b/app/views/admins/shared/_sidebar.html.erb @@ -0,0 +1,49 @@ +<% sidebar_collapse = request.cookies['admin_sidebar_collapse'].to_s == 'true' %> + \ No newline at end of file diff --git a/app/views/admins/shared/after_render_js_hook.js.erb b/app/views/admins/shared/after_render_js_hook.js.erb new file mode 100644 index 000000000..efc1e9295 --- /dev/null +++ b/app/views/admins/shared/after_render_js_hook.js.erb @@ -0,0 +1,4 @@ +; +$('[data-toggle="tooltip"]').tooltip(); +$('[data-toggle="popover"]').popover(); +$('img.preview-image').bootstrapViewer(); \ No newline at end of file diff --git a/app/views/admins/shared/delete.js.erb b/app/views/admins/shared/delete.js.erb new file mode 100644 index 000000000..74512d55b --- /dev/null +++ b/app/views/admins/shared/delete.js.erb @@ -0,0 +1,22 @@ +var deleteRow = $('<%= params[:element] %>'); +var refreshUrl = '<%= params[:refresh_url] %>'; + +$.notify({ message: '操作成功' },{ type: 'success' }); + +var refreshFunc = function(url) { + $.ajax({ + url: url.length > 0 ? url : window.location.href, + method: 'GET', + dataType: "script" + }) +} + +if(deleteRow.length > 0){ + var needRefresh = deleteRow.siblings().length == 0; + + deleteRow.remove(); + + if(needRefresh){ refreshFunc(refreshUrl); } +} else { + refreshFunc(refreshUrl); +} \ No newline at end of file diff --git a/app/views/admins/shared/error.js.erb b/app/views/admins/shared/error.js.erb new file mode 100644 index 000000000..ebb78aec6 --- /dev/null +++ b/app/views/admins/shared/error.js.erb @@ -0,0 +1,7 @@ +$('.admin-alert-container').html('<%= j( render partial: 'admins/shared/alert', locals: { message: message } ) %>'); + +setTimeout(function() { + if ($('.admin-alert-container button.close').length > 0) { + $('.admin-alert-container button.close').trigger('click'); + } +}, 2000) \ No newline at end of file diff --git a/app/views/admins/users/edit.html.erb b/app/views/admins/users/edit.html.erb new file mode 100644 index 000000000..3f9d71b96 --- /dev/null +++ b/app/views/admins/users/edit.html.erb @@ -0,0 +1,137 @@ +<% + define_admin_breadcrumbs do + add_admin_breadcrumb('用户管理', admins_users_path) + add_admin_breadcrumb('用户详情') + end +%> + +
            + + + <%= simple_form_for(@user, url: admins_user_path(@user)) do |f| %> + +
            基本信息
            +
            +
            + <%= f.input :lastname, label: '姓名', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-md-11', value: @user.only_real_name } %> +
            + +
            + <%= f.input :nickname, label: '昵称', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-md-11' } %> + <%= f.input :gender, as: :radio_buttons, label: '性别', collection: [%w(男 0), %w(女 1)], wrapper_html: { class: 'col-md-3' } %> +
            + +
            +
            + <%= f.label :identity, label: '职业' %> + <%= select_tag('user[identity]', [], class: 'form-control identity-select optional', 'data-value': @user.user_extension&.identity, 'data-first-title': '请选择') %> +
            +
            + <%= f.label :technical_title, label: '职称' %> + <%= select_tag('user[technical_title]', [], class: 'form-control technical-title-select optional', 'data-value': @user.technical_title) %> +
            + + <%= f.input :student_id, as: :tel, label: '学号', wrapper_html: { class: 'col-md-2', style: @user.user_extension.student? ? '' : 'display:none;' }, input_html: { class: 'student-id-input' } %> +
            + +
            + <%= f.input :mail, as: :email, label: '邮箱地址', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11' } %> + <%= f.input :phone, as: :tel, label: '手机号', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11' } %> +
            + +
            +
            + <%= f.label :location, label: '省份' %> + <%= select_tag('user[location]', [], class: 'form-control province-select optional', 'data-value': @user.location, 'data-first-title': '请选择') %> +
            +
            + <%= f.label :location_city, label: '城市' %> + <%= select_tag('user[location_city]', [], class: 'form-control city-select optional', 'data-value': @user.location_city) %> +
            +
            + +
            + <%= f.input :school_id, as: :hidden %> + <%= f.input :department_id, as: :hidden %> +
            + <%= f.label :school_name, label: '所属学校/单位' %> + <%= f.select :school_name, [@user.school_id], {}, class: 'form-control school-select optional' %> +
            +
            + <%= f.label :department_name, label: '所属学院/部门' %> + <%= f.select :department_name, [@user.department_id], {}, class: 'form-control department-select optional' %> +
            +
            +
            + +
            管理
            +
            + <% if current_user.admin? %> +
            + <%= f.label :role, label: '角色' %> +
            + <%= f.input :admin, as: :boolean, label: '管理员', checked_value: 1, unchecked_value: 0 %> + <%= f.input :business, as: :boolean, label: '运营人员', wrapper_html: { class: 'ml-3' }, checked_value: 1, unchecked_value: 0 %> + <%= f.input :is_test, as: :boolean, label: '测试账号', wrapper_html: { class: 'ml-3' }, checked_value: 1, unchecked_value: 0 %> +
            +
            + <% end %> + +
            + <%= f.label :role, label: '认证信息' %> +
            + <%= f.input :professional_certification, as: :boolean, label: '职业认证', checked_value: 1, unchecked_value: 0 %> + <%= f.input :authentication, as: :boolean, label: '实名认证', wrapper_html: { class: 'ml-3' }, checked_value: 1, unchecked_value: 0 %> +
            +
            + +
            + <%= f.input :password, as: :password, label: '修改密码', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11' } %> + <%= f.input :password_confirmation, as: :password, label: '确认密码', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11' } %> +
            +
            + +
            + <%= f.button :submit, value: '保存', class: 'btn-primary mr-3 px-4' %> + <%= link_to '取消', 'javascript:history.go(-1)', class: 'btn btn-secondary px-4' %> +
            + <% end %> +
            \ No newline at end of file diff --git a/app/views/admins/users/index.html.erb b/app/views/admins/users/index.html.erb new file mode 100644 index 000000000..5d2af36c3 --- /dev/null +++ b/app/views/admins/users/index.html.erb @@ -0,0 +1,35 @@ +<% define_admin_breadcrumbs do %> + <% add_admin_breadcrumb('用户管理', admins_users_path) %> +<% end %> + +
            + <%= form_tag(admins_users_path, method: :get, class: 'form-inline search-form', remote: true) do %> +
            + + <% status_options = [['全部', ''], ['正常', User::STATUS_ACTIVE], ['未激活', User::STATUS_REGISTERED], ['已锁定', User::STATUS_LOCKED]] %> + <%= select_tag(:status, options_for_select(status_options), class: 'form-control') %> +
            + +
            + + <% identity_options = [['全部', '']] + UserExtension.identities.map { |k, v| [I18n.t("user.identity.#{k}"), v] } %> + <%= select_tag(:identity, options_for_select(identity_options), class: 'form-control') %> +
            + +
            + + <% auto_trial_options = [['全部', ''], ['自动授权', 1], ['手动授权', 0]] %> + <%= select_tag(:auto_trial, options_for_select(auto_trial_options), class: 'form-control') %> +
            + + <%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: 'ID/姓名/邮箱/手机号检索') %> + <%= text_field_tag(:school_name, params[:school_name], class: 'form-control col-sm-2', placeholder: '学校/单位检索') %> + <%= submit_tag('搜索', class: 'btn btn-primary ml-3') %> + <% end %> +
            + +
            + <%= render partial: 'admins/users/shared/user_list', locals: { users: @users } %> +
            + +<%= render partial: 'admins/users/shared/reward_grade_modal' %> \ No newline at end of file diff --git a/app/views/admins/users/index.js.erb b/app/views/admins/users/index.js.erb new file mode 100644 index 000000000..4e9e41c71 --- /dev/null +++ b/app/views/admins/users/index.js.erb @@ -0,0 +1 @@ +$('.users-list-container').html("<%= j( render partial: 'admins/users/shared/user_list', locals: { users: @users } ) %>"); \ No newline at end of file diff --git a/app/views/admins/users/shared/_reward_grade_modal.html.erb b/app/views/admins/users/shared/_reward_grade_modal.html.erb new file mode 100644 index 000000000..87c74c499 --- /dev/null +++ b/app/views/admins/users/shared/_reward_grade_modal.html.erb @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/app/views/admins/users/shared/_user_list.html.erb b/app/views/admins/users/shared/_user_list.html.erb new file mode 100644 index 000000000..36b5d0f6e --- /dev/null +++ b/app/views/admins/users/shared/_user_list.html.erb @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + <% if users.present? %> + <% users.each do |user| %> + + + + + + + + + + + + <% end %> + <% else %> + <%= render 'admins/shared/no_data_for_table' %> + <% end %> + +
            真实姓名邮件地址手机号码单位<%= sort_tag('创建于', name: 'created_on', path: admins_users_path) %><%= sort_tag('最后登录', name: 'last_login_on', path: admins_users_path) %><%= sort_tag('经验值', name: 'experience', path: admins_users_path) %><%= sort_tag('金币', name: 'grade', path: admins_users_path) %>操作
            + <%= link_to "/users/#{user.login}", target: '_blank' do %> + <%= overflow_hidden_span user.real_name, width: 100 %> + <% end %> + <%= overflow_hidden_span display_text(user.mail), width: 150 %><%= overflow_hidden_span display_text(user.phone), width: 100 %><%= overflow_hidden_span display_text(user.school_name), width: 150 %><%= display_text(user.created_on&.strftime('%Y-%m-%d %H:%M')) %><%= display_text(user.last_login_on&.strftime('%Y-%m-%d %H:%M')) %><%= user.experience.to_i %><%= user.grade.to_i %> + <%= link_to '编辑', edit_admins_user_path(user), class: 'action' %> + + <%= javascript_void_link('奖励', class: 'action reward-grade-action', data: { toggle: 'modal', target: '.admin-users-reward-grade-modal', id: user.id }) %> + + <%= javascript_void_link '解锁', class: 'action unlock-action', data: { id: user.id, confirm: '确认解锁吗?' }, style: user.locked? ? '' : 'display: none;' %> + + <% if user.registered? %> + <%= javascript_void_link '激活', class: 'action active-action', data: { id: user.id, confirm: '确认激活吗?' } %> + <% end %> + + <% if user.id != current_user.id %> + <%= javascript_void_link '加锁', class: 'action lock-action', data: { id: user.id, confirm: '确认加锁吗?' }, style: user.locked? || user.registered? ? 'display: none;' : '' %> + <% end %> + + <%= delete_link '删除', admins_user_path(user, element: ".user-item-#{user.id}"), class: 'delete-user-action' %> +
            + +<%= render partial: 'admins/shared/paginate', locals: { objects: users } %> \ No newline at end of file diff --git a/app/views/admins/users/show.html.erb b/app/views/admins/users/show.html.erb new file mode 100644 index 000000000..8f1a2f69c --- /dev/null +++ b/app/views/admins/users/show.html.erb @@ -0,0 +1,6 @@ +<% define_admin_breadcrumbs do %> + <% add_admin_breadcrumb('用户管理', admins_users_path) %> + <% add_admin_breadcrumb('用户详情') %> +<% end %> + +

            Users Show

            \ No newline at end of file diff --git a/app/views/courses/informs.json.jbuilder b/app/views/courses/informs.json.jbuilder index d584be917..7fc396184 100644 --- a/app/views/courses/informs.json.jbuilder +++ b/app/views/courses/informs.json.jbuilder @@ -1 +1,5 @@ -json.description @course.inform&.description \ No newline at end of file +json.informs @informs do |inform| + json.id inform.id + json.name inform.name + json.description inform.description +end \ No newline at end of file diff --git a/app/views/courses/settings.json.jbuilder b/app/views/courses/settings.json.jbuilder index 376dc6f6d..27dc9aac4 100644 --- a/app/views/courses/settings.json.jbuilder +++ b/app/views/courses/settings.json.jbuilder @@ -9,7 +9,11 @@ json.start_date @course.start_date json.end_date @course.end_date json.is_public @course.is_public json.course_module_types @course.course_modules.where(hidden: 0).pluck(:module_type) -json.course_module_names @course.course_modules.where(hidden: 0).pluck(:module_name) +json.course_modules @course_modules do |module_type| + json.module_type module_type.module_type + json.hidden module_type.hidden + json.module_name module_type.module_name +end json.authentication @course.authentication json.professional_certification @course.professional_certification json.subject_id @course.subject_id diff --git a/app/views/exercises/_shixun_details.json.jbuilder b/app/views/exercises/_shixun_details.json.jbuilder index 29a39a594..bd559d37d 100644 --- a/app/views/exercises/_shixun_details.json.jbuilder +++ b/app/views/exercises/_shixun_details.json.jbuilder @@ -31,8 +31,9 @@ json.shixun_detail do if shixun_challenge.challenge&.path.present? if game.try(:lastest_code).blank? cha_path = challenge_path(shixun_challenge.challenge&.path) - latest_code = git_fle_content(game.myshixun.repo_path,cha_path) - if latest_code.to_s == "true" + begin + latest_code = git_fle_content(game.myshixun.repo_path,cha_path) + rescue latest_code = "" end else diff --git a/app/views/homework_commons/subjects.json.jbuilder b/app/views/homework_commons/subjects.json.jbuilder index 257fcc9d5..f24ff2097 100644 --- a/app/views/homework_commons/subjects.json.jbuilder +++ b/app/views/homework_commons/subjects.json.jbuilder @@ -6,12 +6,12 @@ end json.subject_list @subjects do |subject| json.subject_id subject.id json.subject_name subject.name - json.challenge_tags subject.shixun_tags + # json.challenge_tags subject.shixun_tags json.shixun_count subject.shixuns.unhidden.size json.myshixun_count subject.shixuns.pluck(:myshixuns_count).sum - json.creator subject.user&.full_name - json.creator_login subject.user&.login - json.school subject.user&.school_name + # json.creator subject.user&.full_name + # json.creator_login subject.user&.login + # json.school subject.user&.school_name end json.subjects_count @total_count \ No newline at end of file diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index 7cb97bdc7..4a62e8bf8 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb @@ -1,522 +1,38 @@ - - EduCoder后台管理 - <%= csrf_meta_tags %> - <%= csp_meta_tag %> + + EduCoder后台管理 + + - <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> + <%= csrf_meta_tags %> + <%= csp_meta_tag %> - + <%= stylesheet_link_tag 'admin', media: 'all','data-turbolinks-track': 'reload' %> + <%= javascript_include_tag 'admin', 'data-turbolinks-track': 'reload' %> + - - - -
            -
            -

            Task Progress Information

            -
            -

            CLEANING BUGS

            -
            -
            - 80% Complete -
            -
            -

            POSTING SOME STUFF

            -
            -
            - 65% Complete -
            -
            -

            BACKUP DATA FROM SERVER

            -
            -
            - 95% Complete -
            -
            -

            RE-DESIGNING WEB APPLICATION

            -
            -
            - 100% Complete -
            -
            -

            - -

            -
            -
            -
            - - -
            -
            -

            Logout Confirmation

            -
            -

            Are you sure want to logout from this awesome system?

            -

            - - Yeah, I'm sure -

            -
            -
            -
            - -
            + <% body_class = [params[:controller].gsub(/\//, '-').gsub('_', '-'), params[:action], 'page'].join('-') %> + + + <%= render partial: 'admins/shared/sidebar' %> - -
            -
            - - - -
            - - - - -
            - -<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> - +
            + - - - diff --git a/app/views/student_works/shixun_work.json.jbuilder b/app/views/student_works/shixun_work.json.jbuilder index 39e7eb1b3..1be74ea4c 100644 --- a/app/views/student_works/shixun_work.json.jbuilder +++ b/app/views/student_works/shixun_work.json.jbuilder @@ -11,8 +11,8 @@ json.image_url url_to_avatar(@work_user) json.complete_count @myshixun.passed_count json.challenges_count @shixun.challenges_count -json.efficiency number_with_precision @work.efficiency, precision: 2 -json.max_efficiency number_with_precision @homework.max_efficiency, precision: 2 +json.efficiency @homework.work_efficiency ? number_with_precision(@work.efficiency, precision: 2) : nil +json.max_efficiency @homework.work_efficiency ? number_with_precision(@homework.max_efficiency, precision: 2) : nil json.passed_time @myshixun.passed_time json.total_spend_time @myshixun.total_spend_time json.user_score @myshixun.total_score diff --git a/app/views/subjects/show.json.jbuilder b/app/views/subjects/show.json.jbuilder index ec76b5a2d..997e0c3d6 100644 --- a/app/views/subjects/show.json.jbuilder +++ b/app/views/subjects/show.json.jbuilder @@ -14,6 +14,7 @@ json.allow_add_member @is_manager json.is_creator @is_creator if @subject.excellent + json.has_start @subject.has_course_start? json.courses @courses do |course| json.course_id course.id json.first_category_url module_url(course.none_hidden_course_modules.first, course) @@ -23,26 +24,4 @@ if @subject.excellent json.course_identity @user.course_identity(course) json.course_status subject_course_status course end -end - - -json.members @members do |member| - json.partial! 'subject_member', locals: { user: member.user } - json.role member.role -end - -# 技能标签 -json.tags @tags do |tag| - unless tag.blank? - json.tag_name tag - json.status @user_tags.include?(tag) - end -end - -# 我的进展 -json.progress do - json.my_score @subject.my_subject_score - json.all_score @subject.all_score - json.learned @subject.my_subject_progress - json.time @subject.my_consume_time end \ No newline at end of file diff --git a/config/admins/sidebar.yml b/config/admins/sidebar.yml new file mode 100644 index 000000000..d58b92ad9 --- /dev/null +++ b/config/admins/sidebar.yml @@ -0,0 +1 @@ +admins-users: admins-users \ No newline at end of file diff --git a/config/aliyun_vod.yml.example b/config/aliyun_vod.yml.example deleted file mode 100644 index aa6547a62..000000000 --- a/config/aliyun_vod.yml.example +++ /dev/null @@ -1,16 +0,0 @@ -defaults: &defaults - access_key_id: 'test' - access_key_secret: 'test' - base_url: 'http://vod.cn-shanghai.aliyuncs.com' - cate_id: '-1' - callback_url: 'http://47.96.87.25:48080/api/callbacks/aliyun_vod.json' - signature_key: 'test12345678' - -development: - <<: *defaults - -test: - <<: *defaults - -production: - <<: *defaults \ No newline at end of file diff --git a/config/configuration.yml.example b/config/configuration.yml.example new file mode 100644 index 000000000..2a4f4f017 --- /dev/null +++ b/config/configuration.yml.example @@ -0,0 +1,17 @@ +defaults: &defaults + aliyun_vod: + access_key_id: 'test' + access_key_secret: 'test' + base_url: 'http://vod.cn-shanghai.aliyuncs.com' + cate_id: '-1' + callback_url: 'http://47.96.87.25:48080/api/callbacks/aliyun_vod.json' + signature_key: 'test12345678' + +development: + <<: *defaults + +test: + <<: *defaults + +production: + <<: *defaults \ No newline at end of file diff --git a/config/initializers/aliyun_vod_init.rb b/config/initializers/aliyun_vod_init.rb index d133fffbf..47b1dc6a3 100644 --- a/config/initializers/aliyun_vod_init.rb +++ b/config/initializers/aliyun_vod_init.rb @@ -1,7 +1,21 @@ -config = Rails.application.config_for(:aliyun_vod) -AliyunVod.access_key_id = config['access_key_id'] -AliyunVod.access_key_secret = config['access_key_secret'] -AliyunVod.base_url = config['base_url'] || 'http://vod.cn-shanghai.aliyuncs.com'.freeze -AliyunVod.cate_id = config['cate_id'] -AliyunVod.callback_url = config['callback_url'] -AliyunVod.signature_key = config['signature_key'] + +aliyun_vod_config = {} + +begin + config = Rails.application.config_for(:configuration) + aliyun_vod_config = config['aliyun_vod'] + raise 'oauth wechat config missing' if aliyun_vod_config.blank? +rescue => ex + raise ex if Rails.env.production? + + puts %Q{\033[33m [warning] aliyun vod config or configuration.yml missing, + please add it or execute 'cp config/configuration.yml.example config/configuration.yml' \033[0m} + aliyun_vod_config = {} +end + +AliyunVod.access_key_id = aliyun_vod_config['access_key_id'] +AliyunVod.access_key_secret = aliyun_vod_config['access_key_secret'] +AliyunVod.base_url = aliyun_vod_config['base_url'] || 'http://vod.cn-shanghai.aliyuncs.com'.freeze +AliyunVod.cate_id = aliyun_vod_config['cate_id'] +AliyunVod.callback_url = aliyun_vod_config['callback_url'] +AliyunVod.signature_key = aliyun_vod_config['signature_key'] diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index c664f7cdd..5298b4ab6 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -11,4 +11,4 @@ Rails.application.config.assets.paths << Rails.root.join('node_modules') # Precompile additional assets. # application.js, application.css, and all non-JS/CSS in the app/assets # folder are already added. -# Rails.application.config.assets.precompile += %w( admin.js admin.css ) +Rails.application.config.assets.precompile += %w( admin.js admin.scss ) diff --git a/config/initializers/simple_form.rb b/config/initializers/simple_form.rb new file mode 100644 index 000000000..bb43c3364 --- /dev/null +++ b/config/initializers/simple_form.rb @@ -0,0 +1,179 @@ +# frozen_string_literal: true +# +# Uncomment this and change the path if necessary to include your own +# components. +# See https://github.com/plataformatec/simple_form#custom-components to know +# more about custom components. +# Dir[Rails.root.join('lib/components/**/*.rb')].each { |f| require f } +# +# Use this setup block to configure all options available in SimpleForm. +SimpleForm.setup do |config| + # Wrappers are used by the form builder to generate a + # complete input. You can remove any component from the + # wrapper, change the order or even add your own to the + # stack. The options given below are used to wrap the + # whole input. + config.wrappers :default, class: :input, + hint_class: :field_with_hint, error_class: :field_with_errors, valid_class: :field_without_errors do |b| + ## Extensions enabled by default + # Any of these extensions can be disabled for a + # given input by passing: `f.input EXTENSION_NAME => false`. + # You can make any of these extensions optional by + # renaming `b.use` to `b.optional`. + + # Determines whether to use HTML5 (:email, :url, ...) + # and required attributes + b.use :html5 + + # Calculates placeholders automatically from I18n + # You can also pass a string as f.input placeholder: "Placeholder" + b.use :placeholder + + ## Optional extensions + # They are disabled unless you pass `f.input EXTENSION_NAME => true` + # to the input. If so, they will retrieve the values from the model + # if any exists. If you want to enable any of those + # extensions by default, you can change `b.optional` to `b.use`. + + # Calculates maxlength from length validations for string inputs + # and/or database column lengths + b.optional :maxlength + + # Calculate minlength from length validations for string inputs + b.optional :minlength + + # Calculates pattern from format validations for string inputs + b.optional :pattern + + # Calculates min and max from length validations for numeric inputs + b.optional :min_max + + # Calculates readonly automatically from readonly attributes + b.optional :readonly + + ## Inputs + # b.use :input, class: 'input', error_class: 'is-invalid', valid_class: 'is-valid' + b.use :label_input + b.use :hint, wrap_with: { tag: :span, class: :hint } + b.use :error, wrap_with: { tag: :span, class: :error } + + ## full_messages_for + # If you want to display the full error message for the attribute, you can + # use the component :full_error, like: + # + # b.use :full_error, wrap_with: { tag: :span, class: :error } + end + + # The default wrapper to be used by the FormBuilder. + config.default_wrapper = :default + + # Define the way to render check boxes / radio buttons with labels. + # Defaults to :nested for bootstrap config. + # inline: input + label + # nested: label > input + config.boolean_style = :nested + + # Default class for buttons + config.button_class = 'btn' + + # Method used to tidy up errors. Specify any Rails Array method. + # :first lists the first message for each field. + # Use :to_sentence to list all errors for each field. + # config.error_method = :first + + # Default tag used for error notification helper. + config.error_notification_tag = :div + + # CSS class to add for error notification helper. + config.error_notification_class = 'error_notification' + + # Series of attempts to detect a default label method for collection. + # config.collection_label_methods = [ :to_label, :name, :title, :to_s ] + + # Series of attempts to detect a default value method for collection. + # config.collection_value_methods = [ :id, :to_s ] + + # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none. + # config.collection_wrapper_tag = nil + + # You can define the class to use on all collection wrappers. Defaulting to none. + # config.collection_wrapper_class = nil + + # You can wrap each item in a collection of radio/check boxes with a tag, + # defaulting to :span. + # config.item_wrapper_tag = :span + + # You can define a class to use in all item wrappers. Defaulting to none. + # config.item_wrapper_class = nil + + # How the label text should be generated altogether with the required text. + # config.label_text = lambda { |label, required, explicit_label| "#{required} #{label}" } + + # You can define the class to use on all labels. Default is nil. + # config.label_class = nil + + # You can define the default class to be used on forms. Can be overriden + # with `html: { :class }`. Defaulting to none. + # config.default_form_class = nil + + # You can define which elements should obtain additional classes + # config.generate_additional_classes_for = [:wrapper, :label, :input] + + # Whether attributes are required by default (or not). Default is true. + # config.required_by_default = true + + # Tell browsers whether to use the native HTML5 validations (novalidate form option). + # These validations are enabled in SimpleForm's internal config but disabled by default + # in this configuration, which is recommended due to some quirks from different browsers. + # To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations, + # change this configuration to true. + config.browser_validations = false + + # Collection of methods to detect if a file type was given. + # config.file_methods = [ :mounted_as, :file?, :public_filename, :attached? ] + + # Custom mappings for input types. This should be a hash containing a regexp + # to match as key, and the input type that will be used when the field name + # matches the regexp as value. + # config.input_mappings = { /count/ => :integer } + + # Custom wrappers for input types. This should be a hash containing an input + # type as key and the wrapper that will be used for all inputs with specified type. + # config.wrapper_mappings = { string: :prepend } + + # Namespaces where SimpleForm should look for custom input classes that + # override default inputs. + # config.custom_inputs_namespaces << "CustomInputs" + + # Default priority for time_zone inputs. + # config.time_zone_priority = nil + + # Default priority for country inputs. + # config.country_priority = nil + + # When false, do not use translations for labels. + # config.translate_labels = true + + # Automatically discover new inputs in Rails' autoload path. + # config.inputs_discovery = true + + # Cache SimpleForm inputs discovery + # config.cache_discovery = !Rails.env.development? + + # Default class for inputs + # config.input_class = nil + + # Define the default class of the input wrapper of the boolean input. + config.boolean_label_class = 'checkbox' + + # Defines if the default input wrapper class should be included in radio + # collection wrappers. + # config.include_default_input_wrapper_class = true + + # Defines which i18n scope will be used in Simple Form. + # config.i18n_scope = 'simple_form' + + # Defines validation classes to the input_field. By default it's nil. + # config.input_field_valid_class = 'is-valid' + # config.input_field_error_class = 'is-invalid' +end diff --git a/config/initializers/simple_form_bootstrap.rb b/config/initializers/simple_form_bootstrap.rb new file mode 100644 index 000000000..ff3909d03 --- /dev/null +++ b/config/initializers/simple_form_bootstrap.rb @@ -0,0 +1,439 @@ +# frozen_string_literal: true + +# Please do not make direct changes to this file! +# This generator is maintained by the community around simple_form-bootstrap: +# https://github.com/rafaelfranca/simple_form-bootstrap +# All future development, tests, and organization should happen there. +# Background history: https://github.com/plataformatec/simple_form/issues/1561 + +# Uncomment this and change the path if necessary to include your own +# components. +# See https://github.com/plataformatec/simple_form#custom-components +# to know more about custom components. +# Dir[Rails.root.join('lib/components/**/*.rb')].each { |f| require f } + +# Use this setup block to configure all options available in SimpleForm. +SimpleForm.setup do |config| + # Default class for buttons + config.button_class = 'btn' + + # Define the default class of the input wrapper of the boolean input. + config.boolean_label_class = 'form-check-label' + + # How the label text should be generated altogether with the required text. + config.label_text = lambda { |label, required, explicit_label| "#{label} #{required}" } + + # Define the way to render check boxes / radio buttons with labels. + config.boolean_style = :inline + + # You can wrap each item in a collection of radio/check boxes with a tag + config.item_wrapper_tag = :div + + # Defines if the default input wrapper class should be included in radio + # collection wrappers. + config.include_default_input_wrapper_class = false + + # CSS class to add for error notification helper. + config.error_notification_class = 'alert alert-danger' + + # Method used to tidy up errors. Specify any Rails Array method. + # :first lists the first message for each field. + # :to_sentence to list all errors for each field. + config.error_method = :to_sentence + + # add validation classes to `input_field` + config.input_field_error_class = 'is-invalid' + config.input_field_valid_class = 'is-valid' + + + # vertical forms + # + # vertical default_wrapper + config.wrappers :vertical_form, tag: 'div', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + b.use :html5 + b.use :placeholder + b.optional :maxlength + b.optional :minlength + b.optional :pattern + b.optional :min_max + b.optional :readonly + b.use :label, class: 'form-control-label' + b.use :input, class: 'form-control', error_class: 'is-invalid' + b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback' } + b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } + end + + # vertical input for boolean + config.wrappers :vertical_boolean, tag: 'fieldset', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + b.use :html5 + b.optional :readonly + b.wrapper :form_check_wrapper, tag: 'div', class: 'form-check' do |bb| + bb.use :input, class: 'form-check-input', error_class: 'is-invalid' + bb.use :label, class: 'form-check-label' + bb.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback' } + bb.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } + end + end + + # vertical input for radio buttons and check boxes + config.wrappers :vertical_collection, item_wrapper_class: 'form-check', tag: 'fieldset', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + b.use :html5 + b.optional :readonly + b.wrapper :legend_tag, tag: 'legend', class: 'col-form-label pt-0' do |ba| + ba.use :label_text + end + b.use :input, class: 'form-check-input', error_class: 'is-invalid' + b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' } + b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } + end + + # vertical input for inline radio buttons and check boxes + config.wrappers :vertical_collection_inline, item_wrapper_class: 'form-check form-check-inline', tag: 'fieldset', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + b.use :html5 + b.optional :readonly + b.wrapper :legend_tag, tag: 'legend', class: 'col-form-label pt-0' do |ba| + ba.use :label_text + end + b.use :input, class: 'form-check-input', error_class: 'is-invalid' + b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' } + b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } + end + + # vertical file input + config.wrappers :vertical_file, tag: 'div', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + b.use :html5 + b.use :placeholder + b.optional :maxlength + b.optional :minlength + b.optional :readonly + b.use :label + b.use :input, class: 'form-control-file', error_class: 'is-invalid' + b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' } + b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } + end + + # vertical multi select + config.wrappers :vertical_multi_select, tag: 'div', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + b.use :html5 + b.optional :readonly + b.use :label, class: 'form-control-label' + b.wrapper tag: 'div', class: 'd-flex flex-row justify-content-between align-items-center' do |ba| + ba.use :input, class: 'form-control mx-1', error_class: 'is-invalid' + end + b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' } + b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } + end + + # vertical range input + config.wrappers :vertical_range, tag: 'div', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + b.use :html5 + b.use :placeholder + b.optional :readonly + b.optional :step + b.use :label + b.use :input, class: 'form-control-range', error_class: 'is-invalid' + b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' } + b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } + end + + + # horizontal forms + # + # horizontal default_wrapper + config.wrappers :horizontal_form, tag: 'div', class: 'form-group row', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + b.use :html5 + b.use :placeholder + b.optional :maxlength + b.optional :minlength + b.optional :pattern + b.optional :min_max + b.optional :readonly + b.use :label, class: 'col-sm-3 col-form-label' + b.wrapper :grid_wrapper, tag: 'div', class: 'col-sm-9' do |ba| + ba.use :input, class: 'form-control', error_class: 'is-invalid' + ba.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback' } + ba.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } + end + end + + # horizontal input for boolean + config.wrappers :horizontal_boolean, tag: 'div', class: 'form-group row', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + b.use :html5 + b.optional :readonly + b.wrapper tag: 'label', class: 'col-sm-3' do |ba| + ba.use :label_text + end + b.wrapper :grid_wrapper, tag: 'div', class: 'col-sm-9' do |wr| + wr.wrapper :form_check_wrapper, tag: 'div', class: 'form-check' do |bb| + bb.use :input, class: 'form-check-input', error_class: 'is-invalid' + bb.use :label, class: 'form-check-label' + bb.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' } + bb.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } + end + end + end + + # horizontal input for radio buttons and check boxes + config.wrappers :horizontal_collection, item_wrapper_class: 'form-check', tag: 'div', class: 'form-group row', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + b.use :html5 + b.optional :readonly + b.use :label, class: 'col-sm-3 form-control-label' + b.wrapper :grid_wrapper, tag: 'div', class: 'col-sm-9' do |ba| + ba.use :input, class: 'form-check-input', error_class: 'is-invalid' + ba.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' } + ba.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } + end + end + + # horizontal input for inline radio buttons and check boxes + config.wrappers :horizontal_collection_inline, item_wrapper_class: 'form-check form-check-inline', tag: 'div', class: 'form-group row', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + b.use :html5 + b.optional :readonly + b.use :label, class: 'col-sm-3 form-control-label' + b.wrapper :grid_wrapper, tag: 'div', class: 'col-sm-9' do |ba| + ba.use :input, class: 'form-check-input', error_class: 'is-invalid' + ba.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' } + ba.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } + end + end + + # horizontal file input + config.wrappers :horizontal_file, tag: 'div', class: 'form-group row', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + b.use :html5 + b.use :placeholder + b.optional :maxlength + b.optional :minlength + b.optional :readonly + b.use :label, class: 'col-sm-3 form-control-label' + b.wrapper :grid_wrapper, tag: 'div', class: 'col-sm-9' do |ba| + ba.use :input, error_class: 'is-invalid' + ba.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' } + ba.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } + end + end + + # horizontal multi select + config.wrappers :horizontal_multi_select, tag: 'div', class: 'form-group row', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + b.use :html5 + b.optional :readonly + b.use :label, class: 'col-sm-3 control-label' + b.wrapper :grid_wrapper, tag: 'div', class: 'col-sm-9' do |ba| + ba.wrapper tag: 'div', class: 'd-flex flex-row justify-content-between align-items-center' do |bb| + bb.use :input, class: 'form-control mx-1', error_class: 'is-invalid' + end + ba.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' } + ba.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } + end + end + + # horizontal range input + config.wrappers :horizontal_range, tag: 'div', class: 'form-group row', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + b.use :html5 + b.use :placeholder + b.optional :readonly + b.optional :step + b.use :label, class: 'col-sm-3 form-control-label' + b.wrapper :grid_wrapper, tag: 'div', class: 'col-sm-9' do |ba| + ba.use :input, class: 'form-control-range', error_class: 'is-invalid' + ba.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' } + ba.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } + end + end + + + # inline forms + # + # inline default_wrapper + config.wrappers :inline_form, tag: 'span', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + b.use :html5 + b.use :placeholder + b.optional :maxlength + b.optional :minlength + b.optional :pattern + b.optional :min_max + b.optional :readonly + b.use :label, class: 'sr-only' + + b.use :input, class: 'form-control', error_class: 'is-invalid' + b.use :error, wrap_with: { tag: 'div', class: 'invalid-feedback' } + b.optional :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } + end + + # inline input for boolean + config.wrappers :inline_boolean, tag: 'span', class: 'form-check flex-wrap justify-content-start mr-sm-2', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + b.use :html5 + b.optional :readonly + b.use :input, class: 'form-check-input', error_class: 'is-invalid' + b.use :label, class: 'form-check-label' + b.use :error, wrap_with: { tag: 'div', class: 'invalid-feedback' } + b.optional :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } + end + + + # bootstrap custom forms + # + # custom input for boolean + config.wrappers :custom_boolean, tag: 'fieldset', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + b.use :html5 + b.optional :readonly + b.wrapper :form_check_wrapper, tag: 'div', class: 'custom-control custom-checkbox' do |bb| + bb.use :input, class: 'custom-control-input', error_class: 'is-invalid' + bb.use :label, class: 'custom-control-label' + bb.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback' } + bb.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } + end + end + + config.wrappers :custom_boolean_switch, tag: 'fieldset', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + b.use :html5 + b.optional :readonly + b.wrapper :form_check_wrapper, tag: 'div', class: 'custom-control custom-checkbox-switch' do |bb| + bb.use :input, class: 'custom-control-input', error_class: 'is-invalid' + bb.use :label, class: 'custom-control-label' + bb.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback' } + bb.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } + end + end + + # custom input for radio buttons and check boxes + config.wrappers :custom_collection, item_wrapper_class: 'custom-control', tag: 'fieldset', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + b.use :html5 + b.optional :readonly + b.wrapper :legend_tag, tag: 'legend', class: 'col-form-label pt-0' do |ba| + ba.use :label_text + end + b.use :input, class: 'custom-control-input', error_class: 'is-invalid' + b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' } + b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } + end + + # custom input for inline radio buttons and check boxes + config.wrappers :custom_collection_inline, item_wrapper_class: 'custom-control custom-control-inline', tag: 'fieldset', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + b.use :html5 + b.optional :readonly + b.wrapper :legend_tag, tag: 'legend', class: 'col-form-label pt-0' do |ba| + ba.use :label_text + end + b.use :input, class: 'custom-control-input', error_class: 'is-invalid' + b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' } + b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } + end + + # custom file input + config.wrappers :custom_file, tag: 'div', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + b.use :html5 + b.use :placeholder + b.optional :maxlength + b.optional :minlength + b.optional :readonly + b.use :label, class: 'form-control-label' + b.wrapper :custom_file_wrapper, tag: 'div', class: 'custom-file' do |ba| + ba.use :input, class: 'custom-file-input', error_class: 'is-invalid' + ba.use :label, class: 'custom-file-label' + ba.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback' } + end + b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } + end + + # custom multi select + config.wrappers :custom_multi_select, tag: 'div', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + b.use :html5 + b.optional :readonly + b.use :label, class: 'form-control-label' + b.wrapper tag: 'div', class: 'd-flex flex-row justify-content-between align-items-center' do |ba| + ba.use :input, class: 'custom-select mx-1', error_class: 'is-invalid' + end + b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' } + b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } + end + + # custom range input + config.wrappers :custom_range, tag: 'div', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + b.use :html5 + b.use :placeholder + b.optional :readonly + b.optional :step + b.use :label, class: 'form-control-label' + b.use :input, class: 'custom-range', error_class: 'is-invalid' + b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' } + b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } + end + + + # Input Group - custom component + # see example app and config at https://github.com/rafaelfranca/simple_form-bootstrap + # config.wrappers :input_group, tag: 'div', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + # b.use :html5 + # b.use :placeholder + # b.optional :maxlength + # b.optional :minlength + # b.optional :pattern + # b.optional :min_max + # b.optional :readonly + # b.use :label, class: 'form-control-label' + # b.wrapper :input_group_tag, tag: 'div', class: 'input-group' do |ba| + # ba.optional :prepend + # ba.use :input, class: 'form-control', error_class: 'is-invalid' + # ba.optional :append + # end + # b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' } + # b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } + # end + + + # Floating Labels form + # + # floating labels default_wrapper + config.wrappers :floating_labels_form, tag: 'div', class: 'form-label-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + b.use :html5 + b.use :placeholder + b.optional :maxlength + b.optional :minlength + b.optional :pattern + b.optional :min_max + b.optional :readonly + b.use :input, class: 'form-control', error_class: 'is-invalid' + b.use :label, class: 'form-control-label' + b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback' } + b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } + end + + # custom multi select + config.wrappers :floating_labels_select, tag: 'div', class: 'form-label-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + b.use :html5 + b.optional :readonly + b.use :input, class: 'custom-select custom-select-lg', error_class: 'is-invalid' + b.use :label, class: 'form-control-label' + b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback' } + b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } + end + + + # The default wrapper to be used by the FormBuilder. + config.default_wrapper = :vertical_form + + # Custom wrappers for input types. This should be a hash containing an input + # type as key and the wrapper that will be used for all inputs with specified type. + config.wrapper_mappings = { + boolean: :vertical_boolean, + check_boxes: :vertical_collection_inline, + date: :vertical_multi_select, + datetime: :vertical_multi_select, + file: :vertical_file, + radio_buttons: :vertical_collection_inline, + range: :vertical_range, + time: :vertical_multi_select + } + + # enable custom form wrappers + # config.wrapper_mappings = { + # boolean: :custom_boolean, + # check_boxes: :custom_collection, + # date: :custom_multi_select, + # datetime: :custom_multi_select, + # file: :custom_file, + # radio_buttons: :custom_collection, + # range: :custom_range, + # time: :custom_multi_select + # } +end diff --git a/config/locales/apply_user_authentications/zh-CN.yml b/config/locales/apply_user_authentications/zh-CN.yml new file mode 100644 index 000000000..e886c2695 --- /dev/null +++ b/config/locales/apply_user_authentications/zh-CN.yml @@ -0,0 +1,7 @@ +zh-CN: + apply_user_authentication: + status: + '0': '待处理' + '1': '已同意' + '2': '已拒绝' + '3': '已撤销' \ No newline at end of file diff --git a/config/locales/kaminari/zh-CN.yml b/config/locales/kaminari/zh-CN.yml new file mode 100644 index 000000000..738131516 --- /dev/null +++ b/config/locales/kaminari/zh-CN.yml @@ -0,0 +1,17 @@ +zh-CN: + views: + pagination: + first: "« 首页" + last: "尾页 »" + previous: "‹ 上一页" + next: "下一页 ›" + truncate: "…" + helpers: + page_entries_info: + one_page: + display_entries: + zero: "暂无数据" + one: "共1条数据" + other: "共%{count}条数据" + more_pages: + display_entries: "当前%{first} - %{last},共%{total}条数据" \ No newline at end of file diff --git a/config/locales/school_daily_reports/zh-CN.yml b/config/locales/school_daily_reports/zh-CN.yml new file mode 100644 index 000000000..d175ed11b --- /dev/null +++ b/config/locales/school_daily_reports/zh-CN.yml @@ -0,0 +1,9 @@ +zh-CN: + school_daily_report: + teacher_increase_count: 新增教师 + student_increase_count: 新增学生 + course_increase_count: 新增课堂 + shixun_increase_count: 新增实训 + shixun_homework_count: 新增实训作业 + shixun_evaluate_count: 新增实训评测 + active_user_count: 活跃用户 \ No newline at end of file diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml new file mode 100644 index 000000000..237438334 --- /dev/null +++ b/config/locales/simple_form.en.yml @@ -0,0 +1,31 @@ +en: + simple_form: + "yes": 'Yes' + "no": 'No' + required: + text: 'required' + mark: '*' + # You can uncomment the line below if you need to overwrite the whole required html. + # When using html, text and mark won't be used. + # html: '*' + error_notification: + default_message: "Please review the problems below:" + # Examples + # labels: + # defaults: + # password: 'Password' + # user: + # new: + # email: 'E-mail to sign in.' + # edit: + # email: 'E-mail.' + # hints: + # defaults: + # username: 'User name to sign in.' + # password: 'No special characters, please.' + # include_blanks: + # defaults: + # age: 'Rather not say' + # prompts: + # defaults: + # age: 'Select your age' diff --git a/config/locales/tidings/zh-CN.yml b/config/locales/tidings/zh-CN.yml index 347b0139a..e6e8e676d 100644 --- a/config/locales/tidings/zh-CN.yml +++ b/config/locales/tidings/zh-CN.yml @@ -49,9 +49,9 @@ Apply_end: "申请发布实训:%{name}" ApplySubject: System: - "1_end": "你提交的实训课程发布申请:%{name},审核已通过" - "2_end": "你提交的实训课程发布申请:%{name},审核未通过
            原因:%{reason}" - Apply_end: "申请发布实训课程:%{name}" + "1_end": "你提交的实践课程发布申请:%{name},审核已通过" + "2_end": "你提交的实践课程发布申请:%{name},审核未通过
            原因:%{reason}" + Apply_end: "申请发布实践课程:%{name}" TrialAuthorization: System: "1_end": "你提交的试用授权申请,审核已通过" @@ -61,7 +61,7 @@ Course: Delete_end: "你删除了课堂:%s" Shixun_end: "你创建了实训:%s" - Subject_end: "你创建了实训课程:%s" + Subject_end: "你创建了实践课程:%s" ArchiveCourse_end: "你的课堂已经归档:%s" JournalsForMessage: Mentioned_end: "@了你:%s" diff --git a/config/routes.rb b/config/routes.rb index 80c4d4237..4fc660a45 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -8,7 +8,6 @@ Rails.application.routes.draw do get 'attachments/download/:id/:filename', to: 'attachments#show' resources :edu_settings - resources :admin scope '/api' do get 'home/index' get 'home/search' @@ -350,6 +349,7 @@ Rails.application.routes.draw do post 'exit_course' get 'informs' post 'update_informs' + post 'new_informs' get 'online_learning' post 'join_excellent_course' get 'tasks_list' @@ -604,6 +604,7 @@ Rails.application.routes.draw do post :up_down post :delete_answer post :adjust_score + post :update_scores end resource :exercise_answers,only:[:create,:destroy] end @@ -741,6 +742,40 @@ Rails.application.routes.draw do post 'callbacks/aliyun_vod', to: 'callbacks/aliyun_vods#create' end + namespace :admins do + get '/', to: 'dashboards#index' + + resources :daily_school_statistics, only: [:index] do + get :export, on: :collection + end + + resources :school_statistics, only: [:index] do + get :contrast, on: :collection + end + + resources :users, only: [:index, :edit, :update, :destroy] do + member do + post :reward_grade + post :lock + post :unlock + post :active + end + end + + resources :identity_authentications, only: [:index] do + member do + post :agree + post :refuse + end + end + resources :professional_authentications, only: [:index] do + member do + post :agree + post :refuse + end + end + end + #git 认证回调 match 'gitauth/*url', to: 'gits#auth', via: :all diff --git a/db/migrate/20190822022306_add_exercise_user_update.rb b/db/migrate/20190822022306_add_exercise_user_update.rb new file mode 100644 index 000000000..7a8784c30 --- /dev/null +++ b/db/migrate/20190822022306_add_exercise_user_update.rb @@ -0,0 +1,39 @@ +class AddExerciseUserUpdate < ActiveRecord::Migration[5.2] + + # include ExercisesHelper + # def change + # #2019,8,22添加 + # two_months = Time.now - 2.months + # exs = Exercise.all.is_exercise_published.where("publish_time > ?",two_months).includes(:exercise_questions,:exercise_users) + # exs.each do |ex| + # if ex.exercise_questions.where("created_at < ?",Time.now - 1.month).pluck(:question_type).include?(1) #含有多选题,且是1个月前创建的才更新 + # ex_users = ex.exercise_users.exercise_user_committed.where("end_at is not null and end_at > ?",two_months) + # if ex_users.exists? + # ex_users.each do |ex_user| + # calculate_score = calculate_student_score(ex,ex_user.user)[:total_score] + # subjective_score = ex_user.subjective_score + # total_score_subjective_score = subjective_score < 0.0 ? 0.0 : subjective_score + # total_score = calculate_score + total_score_subjective_score + # ex_user.update_attributes(score:total_score,objective_score:calculate_score) + # puts ex_user.id + # end + # end + # end + # end + # + # #1936的试卷成绩有问题。 + # # #https://www.educoder.net/courses/2935/exercises/1936/users/pizfnr5ts + # ex_special = Exercise.find_by_id(1936) + # ex_special_users = ex_special.exercise_users.exercise_user_committed.where("end_at is not null and end_at > ?",two_months) + # if ex_special.present? && ex_special_users.exists? + # ex_special_users.each do |ex_user| + # calculate_score = calculate_student_score(ex_special,ex_user.user)[:total_score] + # subjective_score = ex_user.subjective_score + # total_score_subjective_score = subjective_score < 0.0 ? 0.0 : subjective_score + # total_score = calculate_score + total_score_subjective_score + # ex_user.update_attributes(score:total_score,objective_score:calculate_score) + # puts ex_user.id + # end + # end + # end +end diff --git a/db/migrate/20190823015610_add_message_count_for_boards.rb b/db/migrate/20190823015610_add_message_count_for_boards.rb new file mode 100644 index 000000000..6f121cfc0 --- /dev/null +++ b/db/migrate/20190823015610_add_message_count_for_boards.rb @@ -0,0 +1,9 @@ +class AddMessageCountForBoards < ActiveRecord::Migration[5.2] + def change + boards = Board.where(:parent_id => 0) + Board.reset_column_information + boards.find_each do |board| + Board.reset_counters board.id, :messages + end + end +end diff --git a/db/migrate/20190823024643_modify_course_introduction_for_boards.rb b/db/migrate/20190823024643_modify_course_introduction_for_boards.rb new file mode 100644 index 000000000..3dfcf09f8 --- /dev/null +++ b/db/migrate/20190823024643_modify_course_introduction_for_boards.rb @@ -0,0 +1,42 @@ +class ModifyCourseIntroductionForBoards < ActiveRecord::Migration[5.2] + def change + platform = PlatformSample.where(:samples_type => "courseGuide").first + content = '大家好! + +欢迎进入在线课堂! + +该课堂对应于一个或多个线下班级,课堂成员可以利用老师发布的邀请码申请加入。 + +在这里,老师和教辅将结合教学内容,把不同类型的实训项目发布给大家,让大家在真实的实战环境中得到锻炼。 + +那么什么是实训项目呢?大家有空自己尝试一下就知道了: + +- Python实训:[Python程序设计入门](https://www.educoder.net/paths/13) | [大学计算机基础——基于Python](https://www.educoder.net/paths/11) + +- Java实训:[Java语言程序设计(基础篇)](https://www.educoder.net/paths/38) + +- C/C++实训:[C/C++程序设计](https://www.educoder.net/paths/3) | [数据结构与算法(C语言)](https://www.educoder.net/paths/4) + +- Matlab实训:[智取MATLAB:基本语法](https://www.educoder.net/shixuns/7bvs54gw/challenges) | [控制结构](https://www.educoder.net/shixuns/q4fowkfa/challenges) | [矩阵进阶](https://www.educoder.net/shixuns/grunzcs3/challenges) + +- HTML/CSS实训:[HTML5+CSS3网页制作(基础篇)](https://www.educoder.net/paths/15) + +- 云计算实训:[Docker企业级实训(基础篇)](https://www.educoder.net/paths/29) + +... ... 等等 + +你们现在就可以去体验哦! + +欢迎提出宝贵建议,平台一定会给您带来更多惊喜! + + +支持团队' + platform.update_column(:contents, content) + messages = Message.where(subject: "新课导语") + messages.find_each do |m| + m.update_column(:is_md, true) + message_detail = m.message_detail + message_detail.update_column(:content, content) if message_detail + end + end +end diff --git a/db/migrate/20190823063747_modify_contents_for_old_message_details.rb b/db/migrate/20190823063747_modify_contents_for_old_message_details.rb new file mode 100644 index 000000000..4607881fe --- /dev/null +++ b/db/migrate/20190823063747_modify_contents_for_old_message_details.rb @@ -0,0 +1,13 @@ +class ModifyContentsForOldMessageDetails < ActiveRecord::Migration[5.2] + def change + messages = Message.where(subject: "新课导语").where.not(parent_id: 0).where("created_on < '2019-08-23 02:00:00'") + messages.find_each do |m| + m.update_column(:is_md, true) + message_detail = m.message_detail + if message_detail + content = OldMessageDetail.find_by_id(message_detail.id)&.content + message_detail.update_column(:content, content) + end + end + end +end diff --git a/db/migrate/20190823090957_rechange_exercise_1936_scores.rb b/db/migrate/20190823090957_rechange_exercise_1936_scores.rb new file mode 100644 index 000000000..f089714ee --- /dev/null +++ b/db/migrate/20190823090957_rechange_exercise_1936_scores.rb @@ -0,0 +1,19 @@ +class RechangeExercise1936Scores < ActiveRecord::Migration[5.2] + include ExercisesHelper + def change + #1936的试卷成绩有问题。 + # #https://www.educoder.net/courses/2935/exercises/1936/users/pizfnr5ts + ex_special = Exercise.find_by_id(1936) + ex_special_users = ex_special&.exercise_users&.exercise_user_committed&.where("end_at is not null and end_at > ?",Time.now - 2.months) + if ex_special.present? && ex_special_users.exists? + ex_special_users.each do |ex_user| + calculate_score = calculate_student_score(ex_special,ex_user.user)[:total_score] + subjective_score = ex_user.subjective_score + total_score_subjective_score = subjective_score < 0.0 ? 0.0 : subjective_score + total_score = calculate_score + total_score_subjective_score + ex_user.update_attributes(score:total_score,objective_score:calculate_score) + puts ex_user.id + end + end + end +end diff --git a/db/migrate/20190824032658_migrate_subject_shixun_count.rb b/db/migrate/20190824032658_migrate_subject_shixun_count.rb new file mode 100644 index 000000000..bef29346e --- /dev/null +++ b/db/migrate/20190824032658_migrate_subject_shixun_count.rb @@ -0,0 +1,9 @@ +class MigrateSubjectShixunCount < ActiveRecord::Migration[5.2] + def change + Subject.reset_column_information + Subject.all.each do |subject| + Subject.reset_counters subject.id, :stage_shixuns + Subject.reset_counters subject.id, :shixuns + end + end +end diff --git a/dump.rdb b/dump.rdb index f7b65ded0..6d0966fe0 100644 Binary files a/dump.rdb and b/dump.rdb differ diff --git a/lib/tasks/course_end.rake b/lib/tasks/course_end.rake index d8e87eacf..841c30b27 100644 --- a/lib/tasks/course_end.rake +++ b/lib/tasks/course_end.rake @@ -2,7 +2,7 @@ namespace :course do desc "course end" task :end => :environment do - courses = Course.where("end_date <= '#{Date.today}' and is_end = 0") + courses = Course.where("end_date < '#{Date.today}' and is_end = 0") courses.each do |course| course.update_attribute(:is_end, 1) end diff --git a/lib/tasks/excellent_course_exercise.rake b/lib/tasks/excellent_course_exercise.rake index 0d8875806..4309eec26 100644 --- a/lib/tasks/excellent_course_exercise.rake +++ b/lib/tasks/excellent_course_exercise.rake @@ -14,16 +14,18 @@ namespace :excellent_course_exercise do course = Course.find_by(id: course_id) course.exercises.each_with_index do |exercise, index| - # 第一个试卷的参与人数和通过人数都是传的数据,后续的随机 - if index == 0 - members = course.students.order("id asc").limit(participant_count) - update_exercise_user(exercise, members, pass_count) - else - new_participant_count = rand((participant_count - 423)..participant_count) - new_pass_count = rand((new_participant_count - 113)..new_participant_count) + if exercise.exercise_users.where(commit_status: 1).count == 0 + # 第一个试卷的参与人数和通过人数都是传的数据,后续的随机 + if index == 0 + members = course.students.order("id asc").limit(participant_count) + update_exercise_user(exercise, members, pass_count) + else + new_participant_count = rand((participant_count - 423)..participant_count) + new_pass_count = rand((new_participant_count - 113)..new_participant_count) - members = course.students.order("id asc").limit(new_participant_count) - update_exercise_user(exercise, members, new_pass_count) + members = course.students.order("id asc").limit(new_participant_count) + update_exercise_user(exercise, members, new_pass_count) + end end end end @@ -147,7 +149,12 @@ namespace :excellent_course_exercise do game_code = game_challenge code = game_code.try(:new_code) else - code = git_fle_content(game.myshixun.repo_path,cha_path) + begin #8-23,hs + code = git_fle_content(game.myshixun.repo_path,cha_path) + rescue + code = "" + end + # code = git_fle_content(game.myshixun.repo_path,cha_path) end end if ex_shixun_answer_content.blank? #把关卡的答案存入试卷的实训里 diff --git a/lib/tasks/public_course.rake b/lib/tasks/public_course.rake index ff50a4e28..d4f62a6e0 100644 --- a/lib/tasks/public_course.rake +++ b/lib/tasks/public_course.rake @@ -88,6 +88,8 @@ namespace :public_course do homework.update_columns(publish_time: publish_time, end_time: end_time, created_at: created_at, updated_at: updated_at) homework.homework_detail_manual.update_columns(comment_status: 6, created_at: created_at, updated_at: updated_at) + + homework.student_works.where("work_status !=0 and update_time > '#{end_time}'").update_all(update_time: end_time) end when 3 # 试卷 @@ -110,6 +112,23 @@ namespace :public_course do end + task :create_homework_work => :environment do + course = Course.find(course_id) + course.practice_homeworks.each do |homework| + if homework.student_works.count == 0 + str = "" + CourseMember.students(course).each do |student| + str += "," if str != "" + str += "(#{homework.id},#{student.user_id}, '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}', '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}')" + end + if str != "" + sql = "insert into student_works (homework_common_id, user_id, created_at, updated_at) values" + str + ActiveRecord::Base.connection.execute sql + end + end + end + end + def min_swith(time) puts time return time < 9 ? "0#{time}" : time diff --git a/lib/tasks/public_message.rake b/lib/tasks/public_message.rake index ca54fbd7b..9b2f89224 100644 --- a/lib/tasks/public_message.rake +++ b/lib/tasks/public_message.rake @@ -2,9 +2,10 @@ namespace :sync do task :public_message => :environment do subject_id = ENV['args'].split(",")[0] # 对应课程的id - board_id = ENV['args'].split(",")[1] - message_id = ENV['args'].split(",")[2] - status = ENV['args'].split(",")[3] # 表示相应的期数 + shixun_id = ENV['args'].split(",")[1] # 对应课程的id + board_id = ENV['args'].split(",")[2] + message_id = ENV['args'].split(",")[3] + status = ENV['args'].split(",")[4] # 表示相应的期数 if status.to_i == 1 start_time = '2018-12-16' @@ -21,7 +22,6 @@ namespace :sync do shixun_ids = Shixun.find_by_sql("select shixun_id from stage_shixuns where stage_id in (select id from stages where subject_id=#{subject_id}) ").map(&:shixun_id) - discusses = Discuss.where(dis_id: shixun_ids).where("created_at >? and created_at :environment do + subject_id = ENV['args'].split(",")[0] # 对应课程的id + shixun_id = ENV['args'].split(",")[1] # 对应课程的id + board_id = ENV['args'].split(",")[2] + message_id = ENV['args'].split(",")[3] + status = ENV['args'].split(",")[4] # 表示相应的期数 + + if status.to_i == 1 + start_time = '2018-12-16' + end_time = '2019-04-01' + elsif status.to_i == 2 + start_time = '2019-04-07' + end_time = '2019-07-28' + else + # 这种情况是取所有的 + start_time = '2015-01-01' + end_time = '2022-07-28' + end + + if subject_id.to_i == -1 + discusses = Discuss.where("parent_id is null and dis_id=?", shixun_id) + else + shixun_ids = Shixun.find_by_sql("select shixun_id from stage_shixuns where stage_id in (select id from stages where + subject_id=#{subject_id}) ").map(&:shixun_id) + discusses = Discuss.where("parent_id is null").where(dis_id: shixun_ids) + end + + discusses.each do |discuss| + rand_created_on = random_time start_time, end_time + puts discuss.id + # 找到所有的子回复 + replies = Discuss.where(parent_id: discuss.id) + + # 如果有子回复,除了创建父回复外,还需要同步子回复 + new_message = Message.create!(board_id: board_id.to_i, author_id: discuss.user_id, parent_id: message_id, root_id: message_id) + new_message.update_columns(created_on: rand_created_on, updated_on: rand_created_on) + message_detail = MessageDetail.create!(message_id: new_message.id, content: discuss.try(:content)) + message_detail.update_columns(created_at: rand_created_on, updated_at: rand_created_on) + if replies.present? + replies.each do |reply| + puts("reply id si #{reply.id}") + reply_time = random_time(start_time, end_time) + while reply_time > rand_created_on + reply_time = random_time(start_time, end_time) + end + + reply_message = Message.create!(board_id: board_id.to_i, author_id: reply.user_id, parent_id: new_message.id, root_id: message_id) + reply_message.update_columns(created_on: reply_time, updated_on: reply_time) + reply_message_detail = MessageDetail.create!(message_id: reply_message.id, content: reply.try(:content)) + reply_message_detail.update_columns(created_at: rand_created_on, updated_at: rand_created_on) + end + end + end + + + def min_swith(time) + puts time + return time < 9 ? "0#{time}" : time + end + + def random_time(start_time, end_time) + hour = (6..23).to_a.sample(1).first + min = rand(60) + sec = rand(60) + + start_time = Date.parse(start_time) + end_time = Date.parse(end_time) + date = (start_time..end_time).to_a.sample(1).first + + time = "#{date} #{min_swith(hour)}:#{min_swith(min)}:#{min_swith(sec)}" + + puts time + time + end + # 子评论的时间必须小于父评论 + def smaller_time(parent_time, start_time, end_time) + large_time = random_time(start_time, end_time) + while large_time > parent_time + large_time = random_time(start_time, end_time) + end + large_time + end + end + + task :board_count => :environment do + Course.find_each do |course| + puts course.id + + begin + messages_count = Message.find_by_sql("select count(*) as count from messages where board_id in (select id from boards where course_id=#{course.id})").first.try(:count) + + Board.update_column(messages_count: messages_count) + rescue + + end + + end end -end \ No newline at end of file +end diff --git a/lib/templates/erb/scaffold/_form.html.erb b/lib/templates/erb/scaffold/_form.html.erb new file mode 100644 index 000000000..106b71eef --- /dev/null +++ b/lib/templates/erb/scaffold/_form.html.erb @@ -0,0 +1,15 @@ +<%# frozen_string_literal: true %> +<%%= simple_form_for(@<%= singular_table_name %>) do |f| %> + <%%= f.error_notification %> + <%%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %> + +
            + <%- attributes.each do |attribute| -%> + <%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %> + <%- end -%> +
            + +
            + <%%= f.button :submit %> +
            +<%% end %> diff --git a/public/admin/Coco/.idea/Coco.iml b/public/admin/Coco/.idea/Coco.iml deleted file mode 100644 index db3c98a62..000000000 --- a/public/admin/Coco/.idea/Coco.iml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/public/admin/Coco/.idea/encodings.xml b/public/admin/Coco/.idea/encodings.xml deleted file mode 100644 index 15a15b218..000000000 --- a/public/admin/Coco/.idea/encodings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/public/admin/Coco/.idea/misc.xml b/public/admin/Coco/.idea/misc.xml deleted file mode 100644 index ebba9e77e..000000000 --- a/public/admin/Coco/.idea/misc.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/public/admin/Coco/.idea/modules.xml b/public/admin/Coco/.idea/modules.xml deleted file mode 100644 index aef16b14d..000000000 --- a/public/admin/Coco/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/public/admin/Coco/.idea/vcs.xml b/public/admin/Coco/.idea/vcs.xml deleted file mode 100644 index b2bdec2d7..000000000 --- a/public/admin/Coco/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/public/admin/Coco/.idea/workspace.xml b/public/admin/Coco/.idea/workspace.xml deleted file mode 100644 index bafcf03cb..000000000 --- a/public/admin/Coco/.idea/workspace.xml +++ /dev/null @@ -1,492 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1564991764284 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/public/admin/Coco/404.html b/public/admin/Coco/404.html deleted file mode 100644 index e7883c951..000000000 --- a/public/admin/Coco/404.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - - 404 Not Found | Coco - Responsive Bootstrap Admin Template - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            -
            -

            Task Progress Information

            -
            -

            CLEANING BUGS

            -
            -
            - 80% Complete -
            -
            -

            POSTING SOME STUFF

            -
            -
            - 65% Complete -
            -
            -

            BACKUP DATA FROM SERVER

            -
            -
            - 95% Complete -
            -
            -

            RE-DESIGNING WEB APPLICATION

            -
            -
            - 100% Complete -
            -
            -

            - -

            -
            -
            -
            - - -
            -
            -

            Logout Confirmation

            -
            -

            Are you sure want to logout from this awesome system?

            -

            - - Yeah, I'm sure -

            -
            -
            -
            - - -
            -
            -

            404

            -

            The page you are looking for is definitely not this!


            -

            You better try our awesome search:

            -
            -
            - - - - - -
            -

            - Back to Dashboard -
            -
            - - -
            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/public/admin/Coco/500.html b/public/admin/Coco/500.html deleted file mode 100644 index 424b3fbd4..000000000 --- a/public/admin/Coco/500.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - - 500 Internal Server Error | Coco - Responsive Bootstrap Admin Template - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            -
            -

            Task Progress Information

            -
            -

            CLEANING BUGS

            -
            -
            - 80% Complete -
            -
            -

            POSTING SOME STUFF

            -
            -
            - 65% Complete -
            -
            -

            BACKUP DATA FROM SERVER

            -
            -
            - 95% Complete -
            -
            -

            RE-DESIGNING WEB APPLICATION

            -
            -
            - 100% Complete -
            -
            -

            - -

            -
            -
            -
            - - -
            -
            -

            Logout Confirmation

            -
            -

            Are you sure want to logout from this awesome system?

            -

            - - Yeah, I'm sure -

            -
            -
            -
            - - -
            -
            -

            500

            -

            We are unable to show this page to you correctly!


            -

            You better try our awesome search:

            -
            -
            - - - - - -
            -

            - Back to Dashboard -
            -
            - - -
            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/public/admin/Coco/advanced-forms.html b/public/admin/Coco/advanced-forms.html deleted file mode 100644 index 99172efe4..000000000 --- a/public/admin/Coco/advanced-forms.html +++ /dev/null @@ -1,864 +0,0 @@ - - - - - Advanced Forms | Coco - Responsive Bootstrap Admin Template - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            -
            -

            Task Progress Information

            -
            -

            CLEANING BUGS

            -
            -
            - 80% Complete -
            -
            -

            POSTING SOME STUFF

            -
            -
            - 65% Complete -
            -
            -

            BACKUP DATA FROM SERVER

            -
            -
            - 95% Complete -
            -
            -

            RE-DESIGNING WEB APPLICATION

            -
            -
            - 100% Complete -
            -
            -

            - -

            -
            -
            -
            - - -
            -
            -

            Logout Confirmation

            -
            -

            Are you sure want to logout from this awesome system?

            -

            - - Yeah, I'm sure -

            -
            -
            -
            - -
            - - - - - - - -
            - -
            -
            - - - -
            -
            -
            -

            Preferences

            -
            -
            - Live data updates -
            -
            - -
            -
            -
            -
            - Live feeds -
            -
            - -
            -
            -
            -
            - Sync data to cloud -
            -
            - -
            -
            -
            -
            - Keep activity record -
            -
            - -
            -
            -

            Other Settings

            -
            -
            - -
            -
            -
            -
            - -
            -
            -
            -
            -
            -
            -
            - - -
            - - - -
            - -
            -

            Advanced Forms

            -
            - - - -
            - -
            - -
            -
            -

            Inline Editing

            -
            - - - -
            -
            -
            -

            Click to edit

            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            Simple text fieldsuperuser
            Empty text field, required
            Select, local array, custom display
            Select, remote array, no buttonsAdmin
            Select, error while loadingActive
            Datepicker - - not implemented for Bootstrap 3 yet - -
            Combodate (date)
            Combodate (datetime)
            Textarea, buttons below. Submit by ctrl+enterawesome user!
            Checklist
            Select2 (tags mode)html, javascript
            Select2 (dropdown mode)
            -
            -
            - -
            -
            -

            IOS 7 Switches

            -
            - - - -
            -
            -
            -

            Large Size

            - - - - - - - -

            Default Size

            - - - - - - - -

            Small Size

            - - - - - - -
            -
            - -
            -
            -

            WYSIWYG Editor

            -
            - - - -
            -
            -
            - -
            -
            - -
            -
            -

            Inline WYSIWYG Editor

            -
            - - - -
            -
            -
            -
            - -
            -
            -
            -

            - Fusce vitae porttitor -

            -

            - - Lorem ipsum dolor sit amet dolor. Duis blandit vestibulum faucibus a, tortor. - -

            -

            - Proin nunc justo felis mollis tincidunt, risus risus pede, posuere cubilia Curae, Nullam euismod, enim. Etiam nibh ultricies dolor ac dignissim erat volutpat. Vivamus fermentum nisl nulla sem in metus. Maecenas wisi. Donec nec erat volutpat. -

            -
            -

            - Fusce vitae porttitor a, euismod convallis nisl, blandit risus tortor, pretium. - Vehicula vitae, imperdiet vel, ornare enim vel sodales rutrum -

            -
            -
            -

            - Libero nunc, rhoncus ante ipsum non ipsum. Nunc eleifend pede turpis id sollicitudin fringilla. Phasellus ultrices, velit ac arcu. -

            -
            -

            Pellentesque nunc. Donec suscipit erat. Pellentesque habitant morbi tristique ullamcorper.

            -

            Mauris mattis feugiat lectus nec mauris. Nullam vitae ante.

            -
            -
            -
            -
            -

            - Integer condimentum sit amet -

            -

            - Aenean nonummy a, mattis varius. Cras aliquet. - Praesent magna non mattis ac, rhoncus nunc, rhoncus eget, cursus pulvinar mollis.

            -

            Proin id nibh. Sed eu libero posuere sed, lectus. Phasellus dui gravida gravida feugiat mattis ac, felis.

            -

            Integer condimentum sit amet, tempor elit odio, a dolor non ante at sapien. Sed ac lectus. Nulla ligula quis eleifend mi, id leo velit pede cursus arcu id nulla ac lectus. Phasellus vestibulum. Nunc viverra enim quis diam.

            -
            -
            -

            - Praesent wisi accumsan sit amet nibh -

            -

            Donec ullamcorper, risus tortor, pretium porttitor. Morbi quam quis lectus non leo.

            -

            Integer faucibus scelerisque. Proin faucibus at, aliquet vulputate, odio at eros. Fusce gravida, erat vitae augue. Fusce urna fringilla gravida.

            -

            In hac habitasse platea dictumst. Praesent wisi accumsan sit amet nibh. Maecenas orci luctus a, lacinia quam sem, posuere commodo, odio condimentum tempor, pede semper risus. Suspendisse pede. In hac habitasse platea dictumst. Nam sed laoreet sit amet erat. Integer.

            -
            -
            -
            -
            -

            - CKEditor logo -

            -

            Quisque justo neque, mattis sed, fermentum ultrices posuere cubilia Curae, Vestibulum elit metus, quis placerat ut, lectus. Ut sagittis, nunc libero, egestas consequat lobortis velit rutrum ut, faucibus turpis. Fusce porttitor, nulla quis turpis. Nullam laoreet vel, consectetuer tellus suscipit ultricies, hendrerit wisi. Donec odio nec velit ac nunc sit amet, accumsan cursus aliquet. Vestibulum ante sit amet sagittis mi.

            -

            - Nullam laoreet vel consectetuer tellus suscipit -

            -
              -
            • Ut sagittis, nunc libero, egestas consequat lobortis velit rutrum ut, faucibus turpis.
            • -
            • Fusce porttitor, nulla quis turpis. Nullam laoreet vel, consectetuer tellus suscipit ultricies, hendrerit wisi.
            • -
            • Mauris eget tellus. Donec non felis. Nam eget dolor. Vestibulum enim. Donec.
            • -
            -

            Quisque justo neque, mattis sed, fermentum ultrices posuere cubilia Curae, Vestibulum elit metus, quis placerat ut, lectus.

            -

            Nullam laoreet vel, consectetuer tellus suscipit ultricies, hendrerit wisi. Ut sagittis, nunc libero, egestas consequat lobortis velit rutrum ut, faucibus turpis. Fusce porttitor, nulla quis turpis.

            -

            Donec odio nec velit ac nunc sit amet, accumsan cursus aliquet. Vestibulum ante sit amet sagittis mi. Sed in nonummy faucibus turpis. Mauris eget tellus. Donec non felis. Nam eget dolor. Vestibulum enim. Donec.

            -
            -
            -
            -
            - Tags of this article: -

            - inline, editing, floating, CKEditor -

            -
            -
            -
            -
            -
            -
            - - - - - -
            - - - - -
            - - -
            - - -
            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/public/admin/Coco/alerts.html b/public/admin/Coco/alerts.html deleted file mode 100644 index a045085b8..000000000 --- a/public/admin/Coco/alerts.html +++ /dev/null @@ -1,672 +0,0 @@ - - - - - Alerts | Coco - Responsive Bootstrap Admin Template - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            -
            -

            Task Progress Information

            -
            -

            CLEANING BUGS

            -
            -
            - 80% Complete -
            -
            -

            POSTING SOME STUFF

            -
            -
            - 65% Complete -
            -
            -

            BACKUP DATA FROM SERVER

            -
            -
            - 95% Complete -
            -
            -

            RE-DESIGNING WEB APPLICATION

            -
            -
            - 100% Complete -
            -
            -

            - -

            -
            -
            -
            - - -
            -
            -

            Logout Confirmation

            -
            -

            Are you sure want to logout from this awesome system?

            -

            - - Yeah, I'm sure -

            -
            -
            -
            - - -
            - - - - - - - -
            - -
            -
            - - - -
            -
            -
            -

            Preferences

            -
            -
            - Live data updates -
            -
            - -
            -
            -
            -
            - Live feeds -
            -
            - -
            -
            -
            -
            - Sync data to cloud -
            -
            - -
            -
            -
            -
            - Keep activity record -
            -
            - -
            -
            -

            Other Settings

            -
            -
            - -
            -
            -
            -
            - -
            -
            -
            -
            -
            -
            -
            - - -
            - - - -
            - -
            -

            Alerts

            -

            Inner Alert & Notification Elements

            -
            -
            -
            -
            -

            Standard Alert Elements

            -
            - - - -
            -
            -
            - -
            - Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alert Link. -
            -
            - Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alert Link. -
            -
            - Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alert Link. -
            -
            - Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alert Link. -
            - -
            -
            -
            -
            -
            -
            -

            Dismissable Alert Elements

            -
            - - - -
            -
            -
            - -
            - - Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alert Link. -
            -
            - - Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alert Link. -
            -
            - - Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alert Link. -
            -
            - - Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alert Link. -
            - -
            - -

            Big one!

            -

            Lorem ipsum dolor sit amet, consectetur adipisicing elit. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.

            -

            - - -

            -
            - -
            -
            -
            -
            - - - - -
            - - - - -
            - -
            - - -
            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/public/admin/Coco/assets/css/style-responsive.css b/public/admin/Coco/assets/css/style-responsive.css deleted file mode 100644 index 01ec72eef..000000000 --- a/public/admin/Coco/assets/css/style-responsive.css +++ /dev/null @@ -1,263 +0,0 @@ -/*Large Desktop*/ -@media (min-width: 1200px) { - -} - -/*Desktop*/ -@media (min-width: 992px) and (max-width: 1199px) { - -} - -/*Small desktop or tablet*/ -@media (min-width: 768px) and (max-width: 991px) { - body{overflow-x: hidden;} - .table-responsive { - width: 100%; - margin-bottom: 15px; - overflow-x: scroll; - overflow-y: hidden; - border: 1px solid #dddddd; - -ms-overflow-style: -ms-autohiding-scrollbar; - -webkit-overflow-scrolling: touch; - } - .table-responsive > .table { - margin-bottom: 0; - } - .table-responsive > .table > thead > tr > th, - .table-responsive > .table > tbody > tr > th, - .table-responsive > .table > tfoot > tr > th, - .table-responsive > .table > thead > tr > td, - .table-responsive > .table > tbody > tr > td, - .table-responsive > .table > tfoot > tr > td { - white-space: nowrap; - } - .table-responsive > .table-bordered { - border: 0; - } - .table-responsive > .table-bordered > thead > tr > th:first-child, - .table-responsive > .table-bordered > tbody > tr > th:first-child, - .table-responsive > .table-bordered > tfoot > tr > th:first-child, - .table-responsive > .table-bordered > thead > tr > td:first-child, - .table-responsive > .table-bordered > tbody > tr > td:first-child, - .table-responsive > .table-bordered > tfoot > tr > td:first-child { - border-left: 0; - } - .table-responsive > .table-bordered > thead > tr > th:last-child, - .table-responsive > .table-bordered > tbody > tr > th:last-child, - .table-responsive > .table-bordered > tfoot > tr > th:last-child, - .table-responsive > .table-bordered > thead > tr > td:last-child, - .table-responsive > .table-bordered > tbody > tr > td:last-child, - .table-responsive > .table-bordered > tfoot > tr > td:last-child { - border-right: 0; - } - .table-responsive > .table-bordered > tbody > tr:last-child > th, - .table-responsive > .table-bordered > tfoot > tr:last-child > th, - .table-responsive > .table-bordered > tbody > tr:last-child > td, - .table-responsive > .table-bordered > tfoot > tr:last-child > td { - border-bottom: 0; - } - .button-menu-mobile{display: block;} - .navbar{margin: 0 0 0 40px;} - .mobile-sidebar{left: 0px;} - .mobile-content{left: 225px;right: -225px;} - .box-info .icon-box{ - width: 45px; - font-size: 20px; - margin-top: 5px - } - .box-info .text-box p{font-size: 11px;} - .toolbar-btn-action{text-align: center;} - .gallery-wrap .column .inner .img-wrap{ - height: 60px; - overflow: hidden; - background: #ddd; - } - .gallery-wrap .column-3 .inner .img-wrap{ - height: 140px; - overflow: hidden; - background: #ddd; - } - .gallery-wrap .column-4 .inner .img-wrap{ - height: 100px; - overflow: hidden; - background: #ddd; - } - .user-profile-sidebar{text-align: center;} - -} - -/*Phone*/ -@media (max-width: 767px) { - body{overflow-x: hidden;} - - .mobile-sidebar{left: 0px;} - .mobile-content{left: 250px;right: -250px;} - .box-info table{margin: 0 0 0 0;} - .box-info .table-responsive{border: none;} - .nav.navbar-nav.top-navbar li span.absolute {left: 25px;} - .box-info .additional .list-group{margin-bottom: -10px;} - .toolbar-btn-action{text-align: center;} - .gallery-wrap .column{width: 25%;} - .gallery-wrap .column-4{width: 33.33333333333333%;} - .gallery-wrap .column-3{width: 50%;} - .gallery-wrap .column .inner .img-wrap{ - height: 70px; - overflow: hidden; - background: #ddd; - } - .gallery-wrap .column-3 .inner .img-wrap{ - height: 140px; - overflow: hidden; - background: #ddd; - } - .gallery-wrap .column-4 .inner .img-wrap{ - height: 105px; - overflow: hidden; - background: #ddd; - } - .widget.box-messages{ - margin-top:0px; - } - - footer{text-align: center;} - .navbar-nav{ - float:left; - margin:0px; - } - .navbar{ - border:none; - } - - .navbar-nav .open .dropdown-menu{ - float:left; - position: absolute; - background:#fff; - right:0px; - left:auto; - box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); - } - - .navbar-nav.navbar-right:last-child { - margin-right: -15px; - height:50px; - } - - .open > .dropdown-menu { - display: block; - } - - .nav-tabs.nav-justified > li { - display: table-cell; - width: 1%; - } - - .navbar-nav > li > a{ - padding-top: 15px; - padding-bottom: 15px; - } - - .navbar-right{ - float: right; - } - .navbar-nav > li{ - display: inline-block; - } - .lock-screen{text-align: center;} - - .profile-actions{ - bottom:auto; - top:60px; - } - .widget-tabbed{ - margin-top:40px; - } - .widget-tabbed .nav-tabs a{ - font-size:0px !important; - } - .widget-tabbed .nav-tabs a i{ - font-size:18px !important; - } - .the-timeline ul li.the-year{ - font-size:30px; - } - .ava-lock-screen{text-align: center; margin-bottom: 20px;} - .ava-lock-screen img{ - width: 100px; - margin: 0; - } - .open-right-sidebar .hide-phone{ - display: none; - } - - .la-pricing-table .la-col-4{width: 50%;} - .user-profile-sidebar{text-align: center;} -} - -@media (max-width: 480px){ - .box-info .icon-box{ - width: 100%; - display: block; - } - .box-info .icon-box,.box-info .text-box{text-align: center;} - .gallery-wrap .column,.gallery-wrap .column-3,.gallery-wrap .column-4{width: 33.33333333333333%;} - .gallery-wrap .column .inner .img-wrap,.gallery-wrap .column-3 .inner .img-wrap,.gallery-wrap .column-4 .inner .img-wrap{height: 70px;} - .login-wrap{margin: 20px 0 0 0;} - - .navbar-default { - border: none; - } - .open-right-sidebar .topbar-profile,.open-right-sidebar .hide-phone{ - display: none; - } - .the-timeline ul li.the-year{ - font-size:20px; - margin-left: 37%; - } - #wrapper:not(.enlarged) .topbar-profile,#wrapper:not(.enlarged) .hide-phone{ - display: none; - } - #wrapper .content-page{ - margin-left:0px !important; - padding-left:50px; - width:100%; - display: inline-block; - } - .open-right-sidebar .content-page > .content{ - opacity: 0; - } - .side-menu{ - z-index: 10 !important; - } - #weather h2{ - top:90px; - } - #weather .w-region{ - top:250px; - } - #stock-widget #stock-title{ - display: none; - } - #stock-widget .stock-options{ - margin-left: 15px; - } - .button-menu-mobile{display: block;} -} - -@media (max-width: 420px){ - .hide-phone{ - display: none !important; - } - - -} - -@media (max-width: 360px){ - .gallery-wrap .column,.gallery-wrap .column-3,.gallery-wrap .column-4{width: 50%;} - .gallery-wrap .column .inner .img-wrap,.gallery-wrap .column-3 .inner .img-wrap,.gallery-wrap .column-4 .inner .img-wrap{height: 80px;} - .la-pricing-table .la-col-4{width: 100%;} -} - -@media (max-width: 320px){ - .gallery-wrap .column,.gallery-wrap .column-3,.gallery-wrap .column-4{width: 50%;} - .gallery-wrap .column .inner .img-wrap,.gallery-wrap .column-3 .inner .img-wrap,.gallery-wrap .column-4 .inner .img-wrap{height: 70px;} -} \ No newline at end of file diff --git a/public/admin/Coco/assets/css/style.css b/public/admin/Coco/assets/css/style.css deleted file mode 100644 index f52dd4771..000000000 --- a/public/admin/Coco/assets/css/style.css +++ /dev/null @@ -1,5507 +0,0 @@ -@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700); -.bg-white-1 { - background-color: #ffffff !important; -} -.border-white-1 { - border-color: #ffffff !important; -} -.btn-white-1 { - background-color: #ffffff; - color: #fff; -} -.btn-white-1:hover { - background-color: #f2f2f2 !important; - color: #fff; -} -.text-white-1 { - color: #ffffff !important; -} -.panel-white-1 { - border-color: #f2f2f2 !important; -} -.panel-white-1 .panel-heading { - background-color: #ffffff !important; - border-color: #f2f2f2 !important; - border-radius: 0px; -} -.panel-white-1 .panel-heading a, -.panel-white-1 .panel-title { - color: #333; -} -.widget.white-1 { - background-color: #ffffff; - color: #333; -} -.widget.white-1 .widget-header h2 { - color: #333; -} -.bg-red-1 { - background-color: #eb5055 !important; -} -.border-red-1 { - border-color: #eb5055 !important; -} -.btn-red-1 { - background-color: #eb5055; - color: #fff; -} -.btn-red-1:hover { - background-color: #dd4449 !important; - color: #fff; -} -.text-red-1 { - color: #eb5055 !important; -} -.panel-red-1 { - border-color: #dd4449 !important; -} -.panel-red-1 .panel-heading { - background-color: #eb5055 !important; - border-color: #dd4449 !important; - border-radius: 0px; -} -.panel-red-1 .panel-heading a, -.panel-red-1 .panel-title { - color: #fff; -} -.widget.red-1 { - background-color: #eb5055; - color: #fff; -} -.widget.red-1 .widget-header h2 { - color: #fff; -} -.bg-blue-1 { - background-color: #3c989e !important; -} -.border-blue-1 { - border-color: #3c989e !important; -} -.btn-blue-1 { - background-color: #3c989e; - color: #fff; -} -.btn-blue-1:hover { - background-color: #3f7e82 !important; - color: #fff; -} -.text-blue-1 { - color: #3c989e !important; -} -.panel-blue-1 { - border-color: #3f7e82 !important; -} -.panel-blue-1 .panel-heading { - background-color: #3c989e !important; - border-color: #3f7e82 !important; - border-radius: 0px; -} -.panel-blue-1 .panel-heading a, -.panel-blue-1 .panel-title { - color: #fff; -} -.widget.blue-1 { - background-color: #3c989e; - color: #fff; -} -.widget.blue-1 .widget-header h2 { - color: #fff; -} -.bg-blue-2 { - background-color: #3498db !important; -} -.border-blue-2 { - border-color: #3498db !important; -} -.btn-blue-2 { - background-color: #3498db; - color: #fff; -} -.btn-blue-2:hover { - background-color: #3189c4 !important; - color: #fff; -} -.text-blue-2 { - color: #3498db !important; -} -.panel-blue-2 { - border-color: #3189c4 !important; -} -.panel-blue-2 .panel-heading { - background-color: #3498db !important; - border-color: #3189c4 !important; - border-radius: 0px; -} -.panel-blue-2 .panel-heading a, -.panel-blue-2 .panel-title { - color: #fff; -} -.widget.blue-2 { - background-color: #3498db; - color: #fff; -} -.widget.blue-2 .widget-header h2 { - color: #fff; -} -.bg-blue-3 { - background-color: #2980b9 !important; -} -.border-blue-3 { - border-color: #2980b9 !important; -} -.btn-blue-3 { - background-color: #2980b9; - color: #fff; -} -.btn-blue-3:hover { - background-color: #2e6f9a !important; - color: #fff; -} -.text-blue-3 { - color: #2980b9 !important; -} -.panel-blue-3 { - border-color: #2e6f9a !important; -} -.panel-blue-3 .panel-heading { - background-color: #2980b9 !important; - border-color: #2e6f9a !important; - border-radius: 0px; -} -.panel-blue-3 .panel-heading a, -.panel-blue-3 .panel-title { - color: #fff; -} -.widget.blue-3 { - background-color: #2980b9; - color: #fff; -} -.widget.blue-3 .widget-header h2 { - color: #fff; -} -.bg-darkblue-1 { - background-color: #252932 !important; -} -.border-darkblue-1 { - border-color: #252932 !important; -} -.btn-darkblue-1 { - background-color: #252932; - color: #fff; -} -.btn-darkblue-1:hover { - background-color: #1d1e20 !important; - color: #fff; -} -.text-darkblue-1 { - color: #252932 !important; -} -.panel-darkblue-1 { - border-color: #1d1e20 !important; -} -.panel-darkblue-1 .panel-heading { - background-color: #252932 !important; - border-color: #1d1e20 !important; - border-radius: 0px; -} -.panel-darkblue-1 .panel-heading a, -.panel-darkblue-1 .panel-title { - color: #fff; -} -.widget.darkblue-1 { - background-color: #252932; - color: #fff; -} -.widget.darkblue-1 .widget-header h2 { - color: #fff; -} -.bg-darkblue-2 { - background-color: #4a525f !important; -} -.border-darkblue-2 { - border-color: #4a525f !important; -} -.btn-darkblue-2 { - background-color: #4a525f; - color: #fff; -} -.btn-darkblue-2:hover { - background-color: #464749 !important; - color: #fff; -} -.text-darkblue-2 { - color: #4a525f !important; -} -.panel-darkblue-2 { - border-color: #464749 !important; -} -.panel-darkblue-2 .panel-heading { - background-color: #4a525f !important; - border-color: #464749 !important; - border-radius: 0px; -} -.panel-darkblue-2 .panel-heading a, -.panel-darkblue-2 .panel-title { - color: #fff; -} -.widget.darkblue-2 { - background-color: #4a525f; - color: #fff; -} -.widget.darkblue-2 .widget-header h2 { - color: #fff; -} -.bg-darkblue-3 { - background-color: #38464a !important; -} -.border-darkblue-3 { - border-color: #38464a !important; -} -.btn-darkblue-3 { - background-color: #38464a; - color: #fff; -} -.btn-darkblue-3:hover { - background-color: #323536 !important; - color: #fff; -} -.text-darkblue-3 { - color: #38464a !important; -} -.panel-darkblue-3 { - border-color: #323536 !important; -} -.panel-darkblue-3 .panel-heading { - background-color: #38464a !important; - border-color: #323536 !important; - border-radius: 0px; -} -.panel-darkblue-3 .panel-heading a, -.panel-darkblue-3 .panel-title { - color: #fff; -} -.widget.darkblue-3 { - background-color: #38464a; - color: #fff; -} -.widget.darkblue-3 .widget-header h2 { - color: #fff; -} -.bg-lightblue-1 { - background-color: #abb7b7 !important; -} -.border-lightblue-1 { - border-color: #abb7b7 !important; -} -.btn-lightblue-1 { - background-color: #abb7b7; - color: #fff; -} -.btn-lightblue-1:hover { - background-color: #a4a4a4 !important; - color: #fff; -} -.text-lightblue-1 { - color: #abb7b7 !important; -} -.panel-lightblue-1 { - border-color: #a4a4a4 !important; -} -.panel-lightblue-1 .panel-heading { - background-color: #abb7b7 !important; - border-color: #a4a4a4 !important; - border-radius: 0px; -} -.panel-lightblue-1 .panel-heading a, -.panel-lightblue-1 .panel-title { - color: #fff; -} -.widget.lightblue-1 { - background-color: #abb7b7; - color: #fff; -} -.widget.lightblue-1 .widget-header h2 { - color: #fff; -} -.bg-lightblue-2 { - background-color: #7a868f !important; -} -.border-lightblue-2 { - border-color: #7a868f !important; -} -.btn-lightblue-2 { - background-color: #7a868f; - color: #fff; -} -.btn-lightblue-2:hover { - background-color: #787878 !important; - color: #fff; -} -.text-lightblue-2 { - color: #7a868f !important; -} -.panel-lightblue-2 { - border-color: #787878 !important; -} -.panel-lightblue-2 .panel-heading { - background-color: #7a868f !important; - border-color: #787878 !important; - border-radius: 0px; -} -.panel-lightblue-2 .panel-heading a, -.panel-lightblue-2 .panel-title { - color: #fff; -} -.widget.lightblue-2 { - background-color: #7a868f; - color: #fff; -} -.widget.lightblue-2 .widget-header h2 { - color: #fff; -} -.bg-orange-1 { - background-color: #e84c3d !important; -} -.border-orange-1 { - border-color: #e84c3d !important; -} -.btn-orange-1 { - background-color: #e84c3d; - color: #fff; -} -.btn-orange-1:hover { - background-color: #d94132 !important; - color: #fff; -} -.text-orange-1 { - color: #e84c3d !important; -} -.panel-orange-1 { - border-color: #d94132 !important; -} -.panel-orange-1 .panel-heading { - background-color: #e84c3d !important; - border-color: #d94132 !important; - border-radius: 0px; -} -.panel-orange-1 .panel-heading a, -.panel-orange-1 .panel-title { - color: #fff; -} -.widget.orange-1 { - background-color: #e84c3d; - color: #fff; -} -.widget.orange-1 .widget-header h2 { - color: #fff; -} -.bg-orange-2 { - background-color: #de745e !important; -} -.border-orange-2 { - border-color: #de745e !important; -} -.btn-orange-2 { - background-color: #de745e; - color: #fff; -} -.btn-orange-2:hover { - background-color: #cf6954 !important; - color: #fff; -} -.text-orange-2 { - color: #de745e !important; -} -.panel-orange-2 { - border-color: #cf6954 !important; -} -.panel-orange-2 .panel-heading { - background-color: #de745e !important; - border-color: #cf6954 !important; - border-radius: 0px; -} -.panel-orange-2 .panel-heading a, -.panel-orange-2 .panel-title { - color: #fff; -} -.widget.orange-2 { - background-color: #de745e; - color: #fff; -} -.widget.orange-2 .widget-header h2 { - color: #fff; -} -.bg-orange-3 { - background-color: #e27a3f !important; -} -.border-orange-3 { - border-color: #e27a3f !important; -} -.btn-orange-3 { - background-color: #e27a3f; - color: #fff; -} -.btn-orange-3:hover { - background-color: #d26e35 !important; - color: #fff; -} -.text-orange-3 { - color: #e27a3f !important; -} -.panel-orange-3 { - border-color: #d26e35 !important; -} -.panel-orange-3 .panel-heading { - background-color: #e27a3f !important; - border-color: #d26e35 !important; - border-radius: 0px; -} -.panel-orange-3 .panel-heading a, -.panel-orange-3 .panel-title { - color: #fff; -} -.widget.orange-3 { - background-color: #e27a3f; - color: #fff; -} -.widget.orange-3 .widget-header h2 { - color: #fff; -} -.bg-orange-4 { - background-color: #edce8c !important; -} -.border-orange-4 { - border-color: #edce8c !important; -} -.btn-orange-4 { - background-color: #edce8c; - color: #fff; -} -.btn-orange-4:hover { - background-color: #e2c27e !important; - color: #fff; -} -.text-orange-4 { - color: #edce8c !important; -} -.panel-orange-4 { - border-color: #e2c27e !important; -} -.panel-orange-4 .panel-heading { - background-color: #edce8c !important; - border-color: #e2c27e !important; - border-radius: 0px; -} -.panel-orange-4 .panel-heading a, -.panel-orange-4 .panel-title { - color: #333; -} -.widget.orange-4 { - background-color: #edce8c; - color: #333; -} -.widget.orange-4 .widget-header h2 { - color: #333; -} -.bg-green-1 { - background-color: #68c39f !important; -} -.border-green-1 { - border-color: #68c39f !important; -} -.btn-green-1 { - background-color: #68c39f; - color: #fff; -} -.btn-green-1:hover { - background-color: #62b091 !important; - color: #fff; -} -.text-green-1 { - color: #68c39f !important; -} -.panel-green-1 { - border-color: #62b091 !important; -} -.panel-green-1 .panel-heading { - background-color: #68c39f !important; - border-color: #62b091 !important; - border-radius: 0px; -} -.panel-green-1 .panel-heading a, -.panel-green-1 .panel-title { - color: #fff; -} -.widget.green-1 { - background-color: #68c39f; - color: #fff; -} -.widget.green-1 .widget-header h2 { - color: #fff; -} -.bg-green-2 { - background-color: #9ec789 !important; -} -.border-green-2 { - border-color: #9ec789 !important; -} -.btn-green-2 { - background-color: #9ec789; - color: #fff; -} -.btn-green-2:hover { - background-color: #93b582 !important; - color: #fff; -} -.text-green-2 { - color: #9ec789 !important; -} -.panel-green-2 { - border-color: #93b582 !important; -} -.panel-green-2 .panel-heading { - background-color: #9ec789 !important; - border-color: #93b582 !important; - border-radius: 0px; -} -.panel-green-2 .panel-heading a, -.panel-green-2 .panel-title { - color: #fff; -} -.widget.green-2 { - background-color: #9ec789; - color: #fff; -} -.widget.green-2 .widget-header h2 { - color: #fff; -} -.bg-green-3 { - background-color: #209c83 !important; -} -.border-green-3 { - border-color: #209c83 !important; -} -.btn-green-3 { - background-color: #209c83; - color: #fff; -} -.btn-green-3:hover { - background-color: #247f6c !important; - color: #fff; -} -.text-green-3 { - color: #209c83 !important; -} -.panel-green-3 { - border-color: #247f6c !important; -} -.panel-green-3 .panel-heading { - background-color: #209c83 !important; - border-color: #247f6c !important; - border-radius: 0px; -} -.panel-green-3 .panel-heading a, -.panel-green-3 .panel-title { - color: #fff; -} -.widget.green-3 { - background-color: #209c83; - color: #fff; -} -.widget.green-3 .widget-header h2 { - color: #fff; -} -.bg-pink-1 { - background-color: #f57a82 !important; -} -.border-pink-1 { - border-color: #f57a82 !important; -} -.btn-pink-1 { - background-color: #f57a82; - color: #fff; -} -.btn-pink-1:hover { - background-color: #eb6b73 !important; - color: #fff; -} -.text-pink-1 { - color: #f57a82 !important; -} -.panel-pink-1 { - border-color: #eb6b73 !important; -} -.panel-pink-1 .panel-heading { - background-color: #f57a82 !important; - border-color: #eb6b73 !important; - border-radius: 0px; -} -.panel-pink-1 .panel-heading a, -.panel-pink-1 .panel-title { - color: #333; -} -.widget.pink-1 { - background-color: #f57a82; - color: #333; -} -.widget.pink-1 .widget-header h2 { - color: #333; -} -.bg-pink-2 { - background-color: #f56f6c !important; -} -.border-pink-2 { - border-color: #f56f6c !important; -} -.btn-pink-2 { - background-color: #f56f6c; - color: #fff; -} -.btn-pink-2:hover { - background-color: #ea605d !important; - color: #fff; -} -.text-pink-2 { - color: #f56f6c !important; -} -.panel-pink-2 { - border-color: #ea605d !important; -} -.panel-pink-2 .panel-heading { - background-color: #f56f6c !important; - border-color: #ea605d !important; - border-radius: 0px; -} -.panel-pink-2 .panel-heading a, -.panel-pink-2 .panel-title { - color: #fff; -} -.widget.pink-2 { - background-color: #f56f6c; - color: #fff; -} -.widget.pink-2 .widget-header h2 { - color: #fff; -} -.bg-yellow-1 { - background-color: #f4cda5 !important; -} -.border-yellow-1 { - border-color: #f4cda5 !important; -} -.btn-yellow-1 { - background-color: #f4cda5; - color: #fff; -} -.btn-yellow-1:hover { - background-color: #ebc095 !important; - color: #fff; -} -.text-yellow-1 { - color: #f4cda5 !important; -} -.panel-yellow-1 { - border-color: #ebc095 !important; -} -.panel-yellow-1 .panel-heading { - background-color: #f4cda5 !important; - border-color: #ebc095 !important; - border-radius: 0px; -} -.panel-yellow-1 .panel-heading a, -.panel-yellow-1 .panel-title { - color: #333; -} -.widget.yellow-1 { - background-color: #f4cda5; - color: #333; -} -.widget.yellow-1 .widget-header h2 { - color: #333; -} -.bg-yellow-2 { - background-color: #eae696 !important; -} -.border-yellow-2 { - border-color: #eae696 !important; -} -.btn-yellow-2 { - background-color: #eae696; - color: #fff; -} -.btn-yellow-2:hover { - background-color: #deda88 !important; - color: #fff; -} -.text-yellow-2 { - color: #eae696 !important; -} -.panel-yellow-2 { - border-color: #deda88 !important; -} -.panel-yellow-2 .panel-heading { - background-color: #eae696 !important; - border-color: #deda88 !important; - border-radius: 0px; -} -.panel-yellow-2 .panel-heading a, -.panel-yellow-2 .panel-title { - color: #333; -} -.widget.yellow-2 { - background-color: #eae696; - color: #333; -} -.widget.yellow-2 .widget-header h2 { - color: #333; -} -body { - background: #f3f3f3; - margin: 0; - -webkit-font-smoothing: antialiased; - text-rendering: optimizelegibility; - -webkit-text-size-adjust: 100%; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -} -h1, -h2, -h3, -h4, -h5, -h6 { - margin: 10px 0; -} -h1 { - line-height: 43px; -} -h2 { - line-height: 35px; -} -h3 { - line-height: 30px; -} -h4 { - line-height: 22px; -} -h3 small, -h4 small, -h5 small { - font-family: 'Open Sans'; - font-weight: 300; - color: #444; -} -h1, -h2, -h3, -h4, -h5, -h6 { - font-family: 'Open Sans'; - font-weight: 300; - color: #505458; -} -* { - outline: none !important; -} -a:hover, -a:active, -a:focus { - outline: 0; - text-decoration: none; -} -:focus { - outline: none; -} -::-moz-focus-inner { - border: 0; -} -.label { - padding: 0.3em 0.6em; -} -.container { - width: auto; -} -.navbar { - margin: 0 0 0 -15px; -} -.navbar-collapse { - padding: 0; - margin: 0; -} -.navbar-default { - background-color: transparent; - border: none; -} -.nav.navbar-nav.top-navbar .dropdown-menu > li { - position: relative; -} -.nav.navbar-nav.top-navbar .dropdown-menu > li > a { - cursor: pointer; - color: #4C5264; -} -.nav.navbar-nav.top-navbar > li span.absolute { - position: absolute; - top: 5px; - left: 25px; - font-size: 10px; - line-height: 7px !important; - font-weight: 400 ! important; - border-radius: 15px; - padding: 4px; - z-index: 4; -} -.table-noborder td { - border: 0px !important; -} -.badge { - vertical-align: bottom; -} -.btn-group.spaced .btn { - border-left: 1px solid rgba(0,0,0,0.1); -} -.btn-group.open { - z-index: 2 !important; -} -.bold { - font-weight: 700 !important; -} -.semibold { - font-weight: 600 !important; -} -.input-invis { - background: none !important; - border: none !important; -} -span.new-circle { - border-radius: 10px; - padding: 5px; -} -img.xs-avatar { - width: 50px; - padding: 2px; - background: #fff; - border: 1px solid #ddd; - margin: 0px 4px 0 0; - -webkit-border-radius: 100px !important; - -moz-border-radius: 100px !important; - border-radius: 100px !important; -} -img.ava-dropdown { - float: left; - margin: 0px 10px 0 0; -} -label { - font-family: "Open Sans"; - font-size: 13px; - font-weight: 600; -} -.no-left-padding { - padding-left: 0px; -} -.no-right-padding { - padding-right: 0px; -} -.nomargin { - margin: 0px !important; -} -.no-rounded { - -webkit-border-radius: 0px !important; - border-radius: 0px !important; -} -.full-rounded { - -webkit-border-radius: 20px !important; - -moz-border-radius: 20px !important; - border-radius: 20px !important; -} -.stacked { - margin: 0px; -} -.stacked > [class*="col-"] { - padding-left: 0px; - padding-right: 0px; - margin: 0px !important; -} -textarea, -input[type="text"], -input[type="password"], -input[type="datetime"], -input[type="datetime-local"], -input[type="date"], -input[type="month"], -input[type="time"], -input[type="week"], -input[type="number"], -input[type="email"], -input[type="url"], -input[type="search"], -input[type="tel"], -input[type="color"] { - -webkit-transition: background 0.2s linear; - -moz-transition: background 0.2s linear; - -ms-transition: background 0.2s linear; - -o-transition: background 0.2s linear; - transition: background 0.2s linear; -} -textarea:focus, -select:focus, -input[type="text"]:focus, -input[type="password"]:focus, -input[type="datetime"]:focus, -input[type="datetime-local"]:focus, -input[type="date"]:focus, -input[type="month"]:focus, -input[type="time"]:focus, -input[type="week"]:focus, -input[type="number"]:focus, -input[type="email"]:focus, -input[type="url"]:focus, -input[type="search"]:focus, -input[type="tel"]:focus, -input[type="color"]:focus, -.m-uneditable-input:focus { - background: #f1f1f1; - border-color: #eee; - -webkit-transition: background 0.2s linear; - -moz-transition: background 0.2s linear; - -ms-transition: background 0.2s linear; - -o-transition: background 0.2s linear; - transition: background 0.2s linear; -} -.icon-added input { - padding-left: 32px !important; -} -.icon-added i:first-child { - color: rgba(0,0,0,0.2); - display: block; - margin: 10px; - z-index: 3; - position: absolute; - text-align: center; -} -.loading { - display: block; - z-index: 2000; - width: 14px; - height: 14px; - border: solid 2px transparent; - border-top-color: #68C39F; - border-left-color: #68C39F; - border-radius: 10px; - -webkit-animation: pace-spinner 400ms linear infinite; - -moz-animation: pace-spinner 400ms linear infinite; - -ms-animation: pace-spinner 400ms linear infinite; - -o-animation: pace-spinner 400ms linear infinite; - animation: pace-spinner 400ms linear infinite; - -moz-border-bottom-colors: none; - -moz-border-left-colors: none; - -moz-border-right-colors: none; - -moz-border-top-colors: none; -} -.dropdown-menu { - -webkit-box-shadow: 0 0 0 0 rgba(0,0,0,0); - box-shadow: 0 0 0 0 rgba(0,0,0,0); - -webkit-border-radius: 2px; - border-radius: 2px; - font-size: 12px; - padding: 5px; - background: #fff; - border: 1px solid rgba(0,0,0,0.1); - border-bottom: 1px solid #d2d2d2; - box-shadow: inset 0px 1px 2px #fff; - top: 100%; -} -.dropdown-menu > li > a { - padding: 5px 7px; - -webkit-border-radius: 2px; - border-radius: 2px; - font-size: 13px; - color: #555; -} -.dropdown-menu > li > a:hover { - background: #aaa; - color: #fff; -} -.nav .dropdown-menu { - z-index: 8; -} -.dropdown-menu.dropdown-message ul { - white-space: inherit; -} -.dropdown-menu.dropdown-message > li > a { - word-wrap: break-word; - white-space: inherit; - width: 300px; - border-bottom: 1px solid #eee; -} -.dropdown-menu.dropdown-message li.dropdown-footer a { - display: block; -} -.dropdown-menu.dropdown-message li p { - font-size: 11px; - margin-bottom: 5px; -} -.dropdown-menu.dropdown-message li i.msg-time { - color: #7A868F; - font-size: 11px; - font-style: normal; -} -.dropdown-menu.dropdown-message li p i { - color: #7A868F; - font-size: 11px; - font-style: normal; -} -.dropdown-menu.dropdown-message .dropdown-message-scroll { - padding: 0px; -} -.dropdown-menu.dropdown-message .dropdown-message-scroll li { - padding: 5px 20px; -} -.dropdown-menu.dropdown-message .dropdown-message-scroll a, -.dropdown-menu.dropdown-message .dropdown-message-scroll strong { - text-decoration: none; - border-bottom: none; -} -.dropdown-menu.dropdown-message .dropdown-message-scroll .unread { - background: #FFFCE0; -} -.dropdown-menu.dropdown-message .dropdown-message-scroll a:hover { - color: #000; -} -.dropdown-header.notif-header { - font-size: 14px; - padding: 6px 8px 5px; -} -.dropdown-header.notif-header .pull-right { - margin-top: -19px; -} -.iradio, -.icheckbox { - margin-bottom: 10px; - margin-top: 10px; - min-height: 20px; - padding-left: 0px; -} -.icheckbox_square-aero { - margin-right: 5px; -} -.input-group-addon { - padding: 5px 12px; -} -i.i-xs { - font-size: 10px; -} -.widget-tabbed .nav-tabs:first-child { - margin-top: -39px; -} -.navbar-default .navbar-nav > .active > a, -.navbar-default .navbar-nav > .active > a:hover, -.navbar-default .navbar-nav > .active > a:focus { - color: #fff; - background-color: #545e6c; - border-bottom: none; -} -.navbar-default .navbar-nav > .open > a, -.navbar-default .navbar-nav > .open > a:hover, -.navbar-default .navbar-nav > .open > a:focus { - color: #fff; - background-color: #545e6c; -} -.navbar-nav > li > .dropdown-menu:before { - border-bottom: 6px solid #ABB7B7; - border-left: 6px solid transparent; - border-right: 6px solid transparent; - right: 18px; - content: ""; - height: 0; - margin-right: -3px; - pointer-events: none; - position: absolute; - width: 0; - bottom: 100%; -} -.navbar-nav > li > .dropdown-menu { - z-index: 8; - border-radius: 2px; - -webkit-border-radius: 2px; - padding: 0px; - border: 0px; - box-shadow: 0 2px 6px rgba(0,0,0,0.1); -} -.navbar-nav > li > .dropdown-menu > li > a { - -webkit-transition: all 200ms ease-in; - -moz-transition: all 200ms ease-in; - -ms-transition: all 200ms ease-in; - -o-transition: all 200ms ease-in; - transition: all 200ms ease-in; - -webkit-border-radius: 0px; - border-radius: 0px; -} -.navbar-nav > li > .dropdown-menu > li > a:hover, -.navbar-nav > li > .dropdown-menu > li > a:focus { - background: rgba(0,0,0,0.06); -} -.navbar-nav > li > .dropdown-menu .dropdown-header { - background: #ABB7B7; - color: #fff; - -webkit-border-radius: 2px 2px 0 0; - border-radius: 2px 2px 0 0; -} -.navbar-nav > li > .dropdown-menu .dropdown-header a { - display: inline-block; - width: auto; - padding: 0px; - border: none; - margin-right: 7px; -} -.navbar-nav > li > .dropdown-menu .dropdown-footer { - background: #ABB7B7; - color: #fff; - -webkit-border-radius: 0 0 2px 2px; - border-radius: 0 0 2px 2px; -} -.navbar-nav > li.language_bar > .dropdown-menu > li > a:hover, -.navbar-nav > li.language_bar > .dropdown-menu > li > a:focus { - background: rgba(0,0,0,0.3); -} -.navbar-nav > li.language_bar > .dropdown-menu:before, -.navbar-nav > li > .dropdown-menu.grid-dropdown:before { - border-bottom: 6px solid #fff; -} -.navbar-nav > li > .dropdown-menu.grid-dropdown { - width: 300px; - text-align: center; - font-size: 16px; - color: #252932; -} -.navbar-nav > li > .dropdown-menu.grid-dropdown a { - font-size: 13px; - color: #38464A; - width: 100%; - padding: 10px; - line-height: 30px; - display: block; - font-weight: 300; - font-family: "Open Sans"; - vertical-align: middle; - opacity: 0.7; - cursor: default; -} -.navbar-nav > li > .dropdown-menu.grid-dropdown a.clickable:hover { - background: #ABB7B7; - color: #fff; -} -.navbar-nav > li > .dropdown-menu.grid-dropdown a.clickable:hover i { - color: #fff; -} -.navbar-nav > li > .dropdown-menu.grid-dropdown a i { - font-size: 25px; - line-height: 30px; - height: 30px; - display: block; - color: #697a7a; -} -.navbar-nav > li > .dropdown-menu.grid-dropdown a.clickable { - opacity: 1; - cursor: pointer; -} -.navbar-nav > li > .dropdown-menu.grid-dropdown:before { - right: auto; - left: 18px; -} -.navbar-nav > li.topbar-profile > .dropdown-menu { - background: #7A868F; - color: #fff; -} -.navbar-nav > li.topbar-profile > .dropdown-menu > li > a { - color: #eee !important; - padding-left: 10px; - padding-right: 10px; - font-family: "Open Sans"; -} -.navbar-nav > li.topbar-profile > .dropdown-menu > li.divider { - background: rgba(0,0,0,0.1); - height: 2px; - border-bottom: 1px solid rgba(255,255,255,0.2); - margin: 4px 0; -} -.navbar-nav > li.topbar-profile > .dropdown-menu > li:hover > a, -.navbar-nav > li.topbar-profile > .dropdown-menu > li:focus > a { - color: #fff !important; -} -.navbar-nav > li.topbar-profile > .dropdown-menu:before { - border-bottom: 6px solid #7A868F; -} -.navbar-form { - margin: 0px; - padding: 0px; - position: relative; - margin-bottom: 10px; - border: none; - box-shadow: none; - border-bottom: 1px solid rgba(0,0,0,0.03); -} -.navbar-form .search-button { - background: none; - border: none; - position: absolute; - right: 5px; - top: 0px; - color: #ccc; - -webkit-box-shadow: 0px 0px 0px 0px !important; - box-shadow: 0px 0px 0px 0px !important; - -webkit-border-radius: 0px; - border-radius: 0px; - -webkit-transition: all 100ms ease-in; - -moz-transition: all 100ms ease-in; - -ms-transition: all 100ms ease-in; - -o-transition: all 100ms ease-in; - transition: all 100ms ease-in; -} -.navbar-form .search-button:hover { - color: #777 !important; - -webkit-transition: all 300ms ease-in; - -moz-transition: all 300ms ease-in; - -ms-transition: all 300ms ease-in; - -o-transition: all 300ms ease-in; - transition: all 300ms ease-in; -} -.navbar-form .form-control:focus + .search-button { - color: #ccc; -} -.navbar-form .form-group { - display: block; -} -.navbar-form .form-control { - background-color: transparent !important; - border: none; - color: #aaa; - box-shadow: none; - display: block; - width: 100%; - -webkit-border-radius: 0px; - border-radius: 0px; - -webkit-transition: all 300ms ease-in; - -moz-transition: all 300ms ease-in; - -ms-transition: all 300ms ease-in; - -o-transition: all 300ms ease-in; - transition: all 300ms ease-in; -} -.navbar-form .form-control:focus { - background-color: #f2f2f2 !important; - border-color: #888; - color: #888; - -webkit-transition: all 300ms ease-in; - -moz-transition: all 300ms ease-in; - -ms-transition: all 300ms ease-in; - -o-transition: all 300ms ease-in; - transition: all 300ms ease-in; -} -.navbar-form .form-control::-webkit-input-placeholder { - color: #ccc !important; - text-overflow: ellipsis; -} -.navbar-form .form-control:-moz-placeholder { - color: #ccc !important; - text-overflow: ellipsis; -} -.navbar-form .form-control::-moz-placeholder { - color: #ccc !important; - text-overflow: ellipsis; -} -.navbar-form .form-control:-ms-input-placeholder { - color: #ccc !important; - text-overflow: ellipsis; -} -.enlarged .navbar-form .form-control { - color: transparent; -} -.enlarged .navbar-form .form-control:hover, -.enlarged .navbar-form .form-control:focus { - color: #aaa; -} -.enlarged .navbar-form .form-control::-webkit-input-placeholder { - color: transparent !important; - text-overflow: ellipsis; -} -.enlarged .navbar-form .form-control:-moz-placeholder { - color: transparent !important; - text-overflow: ellipsis; -} -.enlarged .navbar-form .form-control::-moz-placeholder { - color: transparent !important; - text-overflow: ellipsis; -} -.enlarged .navbar-form .form-control:-ms-input-placeholder { - color: transparent !important; - text-overflow: ellipsis; -} -.rounded-image { - -webkit-border-radius: 100px; - border-radius: 100px; - overflow: hidden; - display: inline-block; -} -.rounded-image img { - width: 100%; -} -.profile-image { - border: 4px double rgba(0,0,0,0.2); -} -.profile-info .col-xs-4 { - padding: 0px 0px 0px 10px; -} -.profile-text { - color: #4A525F; - font-family: "Open Sans"; - font-size: 18px; -} -.profile-buttons { - margin-top: 5px; -} -.profile-buttons a { - color: #606b7c; - font-size: 13px; - line-height: 22px; - padding: 4px 10px 6px; - vertical-align: middle; - display: inline-block; -} -.profile-buttons a i { - font-size: 16px; - line-height: 25px; -} -.profile-buttons a:hover { - color: #fff; - background: rgba(0,0,0,0.2); - -webkit-border-radius: 3px; - border-radius: 3px; -} -.profile-status i { - color: #444; - font-size: 14px; - float: right; - margin-top: -14px; -} -i.online { - color: #00AC65; -} -hr.divider { - border-color: rgba(255,255,255,0.1); - width: 90%; - margin: 10px 5%; - display: block; - clear: both; -} -.the-timeline { - margin-bottom: 40px; -} -.the-timeline .post-to-timeline { - margin: 15px 0; -} -.the-timeline .post-to-timeline textarea { - height: 50px; - resize: none; - margin-bottom: 10px; -} -.the-timeline ul { - padding: 0; - list-style: none; - margin: 0 15px 0 30px; - border-left: 2px solid #ddd; -} -.the-timeline ul li.the-year { - background: transparent; - height: 100px; - line-height: 90px; - min-height: 100px; - left: -32px; - border-left: 4px solid transparent !important; - text-align: center; - font-size: 50px; - font-family: "Open Sans"; - font-weight: 700; -} -.the-timeline ul li.the-year p { - width: 20%; - margin-left: 41%; -} -.the-timeline ul li.the-year:before { - display: block; - border: 0px; - width: 40%; - top: 50px; - border-top: 2px solid #ddd !important; -} -.the-timeline ul li.the-year:after { - display: block; - border: 0px; - right: -32px; - content: " "; - top: 50px; - position: absolute; - left: auto; - width: 40%; - border-top: 2px solid #ddd; -} -.the-timeline ul li:before { - width: 10px; - height: 10px; - border-style: solid; - content: " "; - position: absolute; - left: -14px; - top: 19px; - border-width: 7.5px 8px 7.5px 0; - border-color: transparent #efefef transparent transparent; - display: block; -} -.the-timeline ul li { - padding: 5px 15px; - display: block; - min-height: 54px; - -webkit-border-radius: 3px; - border-radius: 3px; - margin: 20px 0 20px 40px; - background: #efefef; - position: relative; - border-left: 4px solid transparent; -} -.the-timeline ul li:hover { - border-left-color: #4A525F; -} -.the-timeline ul li:hover:before { - border-color: transparent #4A525F transparent transparent; -} -.the-timeline ul li p { - margin: 0; - padding: 0; -} -.the-timeline ul li .the-date { - position: absolute; - left: -69px; - top: 0; - width: 50px; - height: 50px; - background: #EB5055; - border-radius: 50%; - text-align: center; - line-height: 130%; -} -.the-timeline ul li .the-date span { - color: #fff; - font-size: 18px; - display: block; - margin-top: 8px; -} -.the-timeline ul li .the-date small { - color: #fff; - font-size: 12px; - display: block; -} -.videoWrapper { - position: relative; - padding-bottom: 56.25%; - padding-top: 25px; - height: 0; - margin-bottom: 15px; -} -.videoWrapper iframe { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - border: none; -} -iframe { - width: 100%; - border: none; -} -.breadcrumb { - padding: 0; - background: transparent; - font-size: 12px; - margin: 0; -} -.progress.progress-xs { - height: 5px; - margin-top: 25px; - margin-bottom: 20px; - border-radius: 0px; - -webkit-box-shadow: none; - box-shadow: none; -} -.progress.progress-xs.for-modal { - margin-top: 10px; - margin-bottom: 20px; -} -.progress.progress-xs .progress-bar { - font-size: 11px; - line-height: 16px; - color: #ffffff; - -webkit-box-shadow: inset 0 -1px 0 rgba(0,0,0,0); - box-shadow: inset 0 -1px 0 rgba(0,0,0,0); -} -.progress.progress-xs.progress-striped .progress-bar { - background-size: 10px 10px; -} -.progress.progress-sm { - height: 10px; - margin-top: 20px; - margin-bottom: 20px; - border-radius: 0px; - -webkit-box-shadow: none; - box-shadow: none; -} -.progress.progress-sm.progress-striped .progress-bar { - background-size: 15px 15px; -} -.table > thead > tr > th { - vertical-align: middle; - border-bottom: 1px solid #dddddd; -} -.form-control { - font-size: 13px; - border-radius: 0; - border-color: #ddd; - -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0); - box-shadow: inset 0 1px 1px rgba(0,0,0,0); -} -.form-control:focus { - border-color: #dadada; - -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0), 0 0 8px rgba(102,175,233,0); - box-shadow: inset 0 1px 1px rgba(0,0,0,0), 0 0 8px rgba(102,175,233,0); -} -.form-group .checkbox { - margin-left: 0; - padding-left: 0; -} -.btn { - border-radius: 2px; -} -.list-group-item:first-child { - border-top-right-radius: 0px; - border-top-left-radius: 0px; -} -.list-group-item:last-child { - border-bottom-right-radius: 0px; - border-bottom-left-radius: 0px; -} -.alert { - border-radius: 0px; -} -.btn-facebook { - background: #45619D; - border-color: #4D6CAD; -} -.btn-facebook:hover { - background: #395289; - border-color: #4D6CAD; -} -.btn-twitter { - background: #00ACEE; - border-color: #00B7FC; -} -.btn-twitter:hover { - background: #03A0DE; - border-color: #00B7FC; -} -.btn-gplus { - background: #D54636; - border-color: #B22E21; -} -.btn-gplus:hover { - background: #BF392E; - border-color: #B22E21; -} -.btn-vimeo { - background: #1BB6EC; - border-color: #0AA0D3; -} -.btn-vimeo:hover { - background: #12ADE3; - border-color: #0AA0D3; -} -.btn-pinterest { - background: #CD1F28; - border-color: #B70F17; -} -.btn-pinterest:hover { - background: #C9121A; - border-color: #B70F17; -} -.btn-instagram { - background: #4E3D35; - border-color: #392C24; -} -.btn-instagram:hover { - background: #483931; - border-color: #392C24; -} -.clear { - clear: both; -} -#wrapper { - width: 100%; - height: 100%; - background: #f3f3f3; - position: relative; -} -.page { - left: 0; - right: 0; - top: 0; - bottom: 0; -} -.rows, -.col, -.page { - position: absolute; -} -.rows { - left: 0; - right: 0; -} -.topbar { - left: 0px; - right: 0; - top: 0px; - height: 50px; - z-index: 11; - background: #424a55; - position: fixed; -} -.topbar .topbar-left { - float: left; - height: 50px; - position: relative; - z-index: 1; - width: 240px; - background: #424a55; -} -.logo h1 { - margin: 0px auto; - height: 50px; - text-align: center; -} -.logo h1 img { - height: 50%; -} -.topbar-profile .topbar-profile-image { - width: 35px; - position: relative; - margin-right: 5px; - margin-top: -15px; - margin-bottom: -12px; - border: 1px solid rgba(0,0,0,0.2); -} -.navbar-default .navbar-nav .topbar-profile > a { - font-family: "Open Sans"; -} -.navbar-right .iconify > a > i { - font-size: 18px; - color: #fff; - line-height: 17px; -} -.navbar-right .iconify > a:focus > i { - font-size: 18px; - color: #fff; - line-height: 17px; -} -.navbar-default .navbar-nav > li > a { - color: #fff; -} -.navbar-default .navbar-nav > li > a:hover, -.navbar-default .navbar-nav > li > a:focus { - color: #fff; -} -.right-opener { - border-left: 1px solid rgba(0,0,0,0.1); -} -.right-opener i { - color: rgba(255,255,255,0.8); -} -.right-opener .fa-angle-double-right { - display: none; -} -.open-right-sidebar .right-opener .fa-angle-double-right { - display: inline-block; -} -.open-right-sidebar .right-opener .fa-angle-double-left { - display: none; -} -.col { - top: 0; - bottom: 0; -} -.scroll-x { - overflow-x: auto; - -webkit-overflow-scrolling: touch; -} -.scroll-y { - overflow-y: auto; - -webkit-overflow-scrolling: touch; -} -.fill, -.pane { - position: absolute; - left: 0; - top: 0; - right: 0; - bottom: 0; - width: 100%; - height: 100%; -} -.pane { - display: none; -} -.side-menu { - width: 240px; - top: 0; - bottom: 0; - z-index: 2; -} -.side-menu.left { - background: #fff; - position: absolute; - top: 50px; - border-right: 1px solid #eee; -} -body.fixed-left .side-menu.left { - margin-top: 0px; - position: fixed; - height: 100%; - bottom: 50px; - margin-bottom: -50px; - padding-bottom: 50px; -} -.side-menu.left .scroll-y { - direction: rtl; - overflow-x: visible; -} -body.mobile .slimscrollleft, -body.mobile .slimscroller { - overflow-y: scroll; -} -.side-menu.left .scroll-y .sidebar-inner { - direction: ltr; -} -.content-page { - margin-left: 240px; - overflow: hidden; - position: relative; -} -.content-page > .content { - margin-top: 50px; - padding: 20px; - position: relative; -} -.side-menu.right { - width: 240px; - right: -240px; - position: fixed; - z-index: 15; - background: #fff; -} -.side-menu.right .tab-inner { - height: 100%; -} -#wrapper.open-right-sidebar { - padding-right: 240px; -} -.open-right-sidebar .topbar { - margin-right: 240px; -} -.open-right-sidebar .right { - right: 0px !important; -} -.header.rows { - height: 50px; -} -.header.rows-content-header { - height: 50px; -} -.header.left.side-menu { - background: #343838; -} -.header.content { - background: #FFFFFF; - border-bottom: 1px solid #E5E9EC; -} -.body.rows { - top: 0px; - bottom: 50px; -} -.body.content.rows { - top: 50px; - bottom: 0px; - background: #f3f3f3; - padding: 20px; - font-size: 13px; -} -body.fixed-left .left-footer { - bottom: 50px; -} -.left-footer { - height: 50px; - bottom: 0px; - display: none; - position: absolute; - width: 100%; - background: rgba(0,0,0,0.3); - color: #E8EAED; - padding: 15px; -} -.left-footer .progress.progress-xs { - margin: 9px 70px 9px 0; - overflow: visible; - position: relative; -} -.left-footer .progress.progress-xs .progress-precentage { - display: block; - position: absolute; - right: -20px; - top: -12px; - padding: 7px 5px; - border-radius: 50%; - background: #555; - color: #f3f3f3; -} -.left-footer .progress.progress-xs { - background: rgba(0,0,0,0.6); -} -.left-footer .progress.progress-xs .btn { - display: block; - position: absolute; - right: -70px; - top: -14px; - background: #555; - color: #f3f3f3; - border: none; -} -.button-menu-mobile { - position: absolute; - right: 0; - float: left; - top: 0px; - z-index: 2; - padding: 10px 18px; - height: 50px; - font-size: 21px; - background: transparent; - color: #fff; - border: none; -} -.button-menu-mobile:hover { - color: #aaa; -} -button.navbar-toggle { - padding: 5px 20px; -} -.breadcrumb { - top: 50px; - line-height: 30px; - padding: 0px 15px; - background: rgba(0,0,0,0.05); - position: relative; - font-family: "Open Sans"; - -webkit-border-radius: 0px !important; - -moz-border-radius: 0px !important; - border-radius: 0px !important; -} -.breadcrumb li a { - font-family: "Open Sans"; - color: #9dabab; -} -.breadcrumb li.active { - color: #7A868F; -} -.breadcrumb > li + li:before { - color: #9dabab; - padding: 0px 10px; - content: ""; - font-family: FontAwesome; -} -.sidebar-inner { - height: 100%; -} -#sidebar-menu, -#sidebar-menu ul, -#sidebar-menu li, -#sidebar-menu a { - margin: 0; - padding: 0; - border: 0; - list-style: none; - font-weight: normal; - text-decoration: none; - line-height: 1; - font-size: 13px; - position: relative; -} -#sidebar-menu a { - line-height: 1.3; -} -#sidebar-menu { - width: 100%; - font-family: "Open Sans"; -} -#sidebar-menu > ul > li { - background: #fff; - display: block; -} -#sidebar-menu > ul > li > a { - font-size: 13px; - display: block; - color: #555; - padding: 10px; - padding-right: 22px; -} -#sidebar-menu > ul > li > a > span { - vertical-align: middle; -} -#sidebar-menu > ul > li > a:hover { - color: #555; - background: #ffffff; - padding-left: 10px; -} -#sidebar-menu > ul > li > a > i { - color: rgba(0,0,0,0.4); - display: inline-block; - font-size: 15px; - line-height: 17px; - margin-left: 3px; - margin-right: 7px; - text-align: center; - vertical-align: middle; - width: 20px; -} -#sidebar-menu > ul > li > a > i.i-right { - margin: 3px 0 0 0; - float: right; -} -#sidebar-menu > ul > li > a:hover { - text-decoration: none; -} -#sidebar-menu > ul > li > a.subdrop { - background: #ffffff; -} -#sidebar-menu > ul > li > a.active, -#sidebar-menu > ul > li > a.active.subdrop { - color: #fff; - background: #7eccad !important; - font-weight: 600; - border-left: 0px solid rgba(0,0,0,0.3); -} -#sidebar-menu > ul > li > a.active i, -#sidebar-menu > ul > li > a.active.subdrop i { - color: #fff; -} -#sidebar-menu > ul > li > a span.label { - float: right; -} -#sidebar-menu > ul > li > a span.label.span-left { - float: none; - margin-left: 5px; -} -#sidebar-menu span.cnt { - position: absolute; - top: 8px; - right: 15px; - padding: 0; - margin: 0; - background: none; -} -#sidebar-menu ul ul { - display: none; - background: #ebebeb; -} -#sidebar-menu ul ul ul { - border-top: 1px solid rgba(0,0,0,0.1); - background: rgba(0,0,0,0.2); -} -#sidebar-menu ul ul li { - border-top: 0; -} -#sidebar-menu ul ul a { - padding: 10px 25px; - display: block; - color: #555; - font-family: "Open Sans"; - font-size: 12px; -} -#sidebar-menu ul ul ul a { - padding-left: 35px; -} -#sidebar-menu ul ul ul ul a { - padding-left: 45px; -} -#sidebar-menu ul ul a:hover { - color: #222; - background: #d9d9d9; -} -#sidebar-menu ul ul li a.active { - color: #222; - background: #dedede; -} -#sidebar-menu ul ul a i { - margin-right: 5px; -} -#wrapper.enlarged #sidebar-menu ul ul { - border: none; -} -#wrapper.enlarged .left.side-menu .widget { - display: none; -} -#wrapper.enlarged .profile-text { - display: none; -} -#wrapper.enlarged .profile-info .col-xs-4 { - width: 100%; - padding: 5px; -} -#wrapper.enlarged .profile-info .col-xs-8 { - width: 100%; - padding: 0 7px; -} -#wrapper.enlarged .left.side-menu { - width: 50px; - z-index: 5; -} -#wrapper.enlarged .content-page { - margin-left: 50px; -} -#wrapper.enlarged .left.side-menu .navbar-form input::-webkit-input-placeholder { - color: transparent !important; -} -#wrapper.enlarged .left.side-menu .navbar-form input:-moz-placeholder { - color: transparent !important; -} -#wrapper.enlarged .left.side-menu .navbar-form input::-moz-placeholder { - color: transparent !important; -} -#wrapper.enlarged .left.side-menu .navbar-form input:-ms-input-placeholder { - color: transparent !important; -} -#wrapper.enlarged .left.side-menu .navbar-form:hover { - width: 240px; - position: relative; - z-index: 5; -} -#wrapper.enlarged .topbar .topbar-left { - width: 50px !important; -} -#wrapper.enlarged .topbar .topbar-left .logo { - opacity: 0; - display: none; -} -#wrapper.enlarged .left.side-menu #sidebar-menu ul > li { - white-space: nowrap; -} -#wrapper.enlarged .left.side-menu #sidebar-menu ul > li > ul { - display: none; -} -#wrapper.enlarged .left.side-menu #sidebar-menu ul > li:hover > a { - background: #ffffff; -} -#wrapper.enlarged #sidebar-menu ul ul li a.active { - background: #dedede !important; -} -#wrapper.enlarged #sidebar-menu > ul > li:hover > a.open:after, -#wrapper.enlarged #sidebar-menu > ul > li:hover > a.active:after { - display: none; -} -#wrapper.enlarged .left.side-menu #sidebar-menu ul > li:hover > ul { - position: absolute; - left: 50px; - width: 190px; - display: block; -} -#wrapper.enlarged .left.side-menu #sidebar-menu ul ul li:hover > a { - background: #ababab !important; - color: #fff; -} -#wrapper.enlarged .left.side-menu #sidebar-menu ul ul li:hover > a i { - background: #ababab !important; - color: #fff; -} -#wrapper.enlarged .left.side-menu #sidebar-menu ul ul li:hover > ul { - position: absolute; - left: 190px; - margin-top: -36px; - width: 190px; - display: block; -} -#wrapper.enlarged .left.side-menu #sidebar-menu ul > li:hover > ul a { - background: #ebebeb; - padding-left: 10px; - border: none; - width: 190px; - box-shadow: none; - z-index: 6; - position: relative; -} -#wrapper.enlarged .left.side-menu #sidebar-menu ul ul li > a span.pull-right { - position: absolute; - right: 10px; - top: 12px; - -ms-transform: rotate(270deg); - -webkit-transform: rotate(270deg); - transform: rotate(270deg); -} -#wrapper.enlarged .left.side-menu #sidebar-menu ul > li > a span { - display: none; - padding-left: 10px; -} -#wrapper.enlarged .left.side-menu #sidebar-menu ul > li:hover > a span.pull-right { - position: absolute; - right: 10px; - top: 12px; -} -#wrapper.enlarged .left.side-menu #sidebar-menu ul > li:hover > a { - width: 240px; - position: relative; -} -#wrapper.enlarged .left.side-menu #sidebar-menu ul > li { - position: relative; -} -#wrapper.enlarged .left.side-menu #sidebar-menu ul > li:hover a span { - display: inline; -} -#wrapper.enlarged .left.side-menu .navbar-form .search-button { - right: 7px; -} -.side-menu.right .nav-tabs { - background: rgba(0,0,0,0.4); - border: none; -} -.side-menu.right .nav-tabs li { - text-align: center; -} -.side-menu.right .nav-tabs > li > a { - border-radius: 0px !important; - margin: 0px !important; - padding: 14px 15px 15px; - font-size: 13px; - color: rgba(255,255,255,0.9); - font-family: "Open Sans"; - border-bottom: 1px solid transparent; -} -.side-menu.right .nav > li > a:hover, -.side-menu.right .nav > li > a:focus { - background: rgba(255,255,255,0.1); - color: rgba(255,255,255,0.7); - border-color: rgba(255,255,255,0); -} -.side-menu.right .nav-tabs > li.active > a { - color: #777; -} -.side-menu.right .nav-tabs > li.active > a, -.side-menu.right .nav-tabs > li.active > a:hover, -.side-menu.right .nav-tabs > li.active > a:focus { - background: #fff; - border-color: #fff; - border-radius: 0px; -} -.side-menu.right .right-toolbar { - margin: 5px 15px 15px; -} -.side-menu.right .right-toolbar a { - color: #777; - font-size: 12px; -} -.side-menu.right .panel-group .panel { - border-radius: 0px; - border: none; - color: #f3f3f3; - background: transparent; -} -.side-menu.right .panel-default > .panel-heading { - background: transparent; - border: none; - border-radius: 0px; -} -.side-menu.right .panel-default > .panel-heading + .panel-collapse .panel-body { - border-top: none; -} -.side-menu.right .panel-title > a { - color: #fff; -} -.side-menu.right .panel-title > a .label { - margin-top: 2px; -} -.side-menu.right .tab-content, -.side-menu.right .tab-content > .tab-pane, -.side-menu.right .tab-content > .tab-pane.active { - height: 100%; - padding-bottom: 20px; -} -.accordion-toggle .panel-heading { - padding: 0px; -} -.accordion-toggle .panel-title a { - color: #fff; - font-size: 14px; - font-family: "Open Sans"; - display: block; - line-height: 22px; - padding: 9px 35px 9px 20px; - position: relative; -} -.accordion-toggle .panel-title a:after { - content: "\f106"; - display: block; - font-family: FontAwesome; - font-size: 10px; - line-height: 36px; - position: absolute; - top: 3px; - right: 15px; -} -.accordion-toggle .panel-title a.collapsed:after { - content: "\f107"; -} -.accordion-toggle .panel.panel-default .panel-title a { - color: #555; -} -.panel-group .panel { - border-radius: 3px; -} -.not-logged-avatar { - width: 100px; - margin: 0px auto; - display: block; - margin-bottom: 20px; - text-align: center; - box-shadow: 1px 1px 3px rgba(0,0,0,0.1); -} -.search-right { - padding: 10px 15px; -} -.search-right input { - background: rgba(0,0,0,0.1); - border: none; - color: #eee; -} -#notification-list a { - color: #555; - font-size: 13px; - font-weight: 600; - vertical-align: text-top; -} -#notification-list li { - margin-bottom: 10px; - padding-bottom: 10px; - border-bottom: 1px solid rgba(0,0,0,0.1); - font-family: "Open Sans"; -} -#notification-list a .muted { - display: block; - font-size: 12px; - font-weight: 300; - color: rgba(0,0,0,0.5); -} -#notification-list .icon-wrapper { - border-radius: 150px; - font-size: 20px; - width: 35px; - line-height: 29px; - text-align: center; - height: 35px; - margin-right: 10px; - float: left; - color: #555; - display: inline-block; - border: 2px solid #4EA6A6; -} -#inbox-list li { - margin-bottom: 15px; -} -#inbox-list a { - color: #555; -} -#inbox-list a .datetime { - font-size: 12px; - font-weight: 400; - color: rgba(0,0,0,0.4); - float: right; - font-family: "Open Sans"; -} -#inbox-list a .sender { - font-size: 13px; - display: block; - float: left; - font-weight: 600; - font-family: "Open Sans"; -} -#inbox-list a .title { - clear: both; - display: block; - font-size: 12px; - font-weight: 600; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - height: 15px; - color: rgba(0,0,0,0.6); -} -#inbox-list a .content { - clear: both; - display: block; - font-size: 11px; - font-weight: 300; - overflow: hidden; - color: rgba(0,0,0,0.5); -} -#updates-list li { - margin-bottom: 10px; -} -#updates-list a { - color: #555; - font-family: "Open Sans"; - font-size: 13px; -} -#updates-list .icon-wrapper { - border-radius: 50px; - font-size: 14px; - width: 24px; - line-height: 25px; - text-align: center; - height: 24px; - margin-right: 10px; - float: left; - color: #555; - display: inline-block; -} -#chat-panel .panel-body { - padding: 0px; -} -#chat-list li { - clear: both; - height: 55px; - opacity: 0.9; - padding: 7px 15px 10px; -} -#chat-list li:hover { - background: rgba(0,0,0,0.1); - opacity: 1; -} -#chat-list a { - font-size: 13px; - font-family: "Open Sans"; - color: #555; -} -#chat-list a.online .chat-user-avatar { - box-shadow: 0 0 0 2px #68C39F; -} -#chat-list a.away .chat-user-avatar { - box-shadow: 0 0 0 2px orange; -} -#chat-list a.offline .chat-user-avatar img { - filter: url("data:image/svg+xml;utf8,#grayscale"); - filter: gray; - -webkit-filter: grayscale(100%); -} -#chat-list .chat-user-avatar { - border-radius: 50px; - width: 34px; - height: 34px; - display: inline-block; - float: left; - margin-right: 10px; - margin-top: 3px; - border: 2px solid rgba(0,0,0,0); - box-shadow: 0 0 0 2px #555; - overflow: hidden; -} -#chat-list .chat-user-avatar img { - width: 100%; - height: 100%; -} -#chat-list .chat-user-msg { - font-size: 12px; - text-overflow: ellipsis; - white-space: nowrap; - overflow: hidden; - color: rgba(0,0,0,0.3); - display: block; -} -#settings .tab-inner { - color: rgba(0,0,0,0.8); -} -#settings .tab-inner h3 { - color: rgba(0,0,0,0.6); - margin-bottom: 20px; -} -#settings .tab-inner h4 { - color: rgba(0,0,0,0.6); - margin-bottom: 15px; -} -#settings .tab-inner .row { - margin-bottom: 10px; - font-size: 12px; -} -.page-heading { - margin: 0px 0 20px; - padding: 5px 0; -} -.page-heading h1 { - margin: 0; - padding: 0; - font-weight: 400; - font-size: 24px; - margin-bottom: 0px; -} -.page-heading h3 { - font-size: 15px; - margin-top: 0px; -} -.widget { - position: relative; - background: #fff; - color: #5b5b5b; - margin-bottom: 20px; -} -.widget-header, -.widget-content { - display: block; - width: 100%; - clear: both; -} -.portlets { - min-height: 50px; -} -.portlets .widget-header { - cursor: move; -} -.widget-footer { - -webkit-border-radius: 0 0 2px 2px; - border-radius: 0 0 2px 2px; - overflow: hidden; -} -.widget-header.transparent { - background: transparent; - border: none; -} -.widget-header.centered { - text-align: center; -} -.widget-header .left-btn { - position: absolute; - left: 10px; - top: 6px; -} -.widget-content { - -webkit-border-radius: 0 0 2px 2px; - border-radius: 0 0 2px 2px; -} -.widget-content.padding { - padding: 15px; -} -.widget-content.padding-sm { - padding: 10px; -} -.widget-content.padding-xs { - padding: 1%; -} -.widget.maximized { - position: fixed; - -webkit-border-radius: 0; - border-radius: 0; - top: 50px; - left: 240px; - right: 0px; - bottom: 0px; - z-index: 10; - margin: 0px; -} -#wrapper.enlarged .widget.maximized { - left: 50px; -} -#wrapper.open-right-sidebar .widget.maximized { - right: 240px; -} -.widget.modal-widget { - position: absolute; - display: block; - z-index: 10; - box-shadow: 0px 0px 2px rgba(0,0,0,0.2), 0px 10px 15px rgba(0,0,0,0.2); -} -.widget.modal-widget.modalize .widget-header { - background: #efefef; -} -.widget:before, -.widget:after { - display: table; - content: " "; -} -.widget:after { - clear: both; -} -.widget .des-thumbnail { - padding: 20px; -} -.widget .img-wrap { - width: 100%; - height: auto; - overflow: hidden; -} -.widget .img-wrap img { - width: 100%; -} -.widget .widget-header { - height: 43px; - display: block; -} -.widget .widget-header h2 { - padding: 4px 13px 4px 13px; - margin: 0px; - font-weight: 400; - font-size: 16px; - display: block; - color: #5b5b5b; -} -.widget .widget-header h2.no-style { - padding: 0px; - margin: 20px 0px 10px 0px; - margin-top: 20px; - margin-bottom: 10px; - font-size: 30px; - border-bottom: none; -} -.widget.box-messages { - margin-top: -50px; -} -.widget.box-messages h2 { - border-bottom: none; -} -.widget .statistic-chart { - padding: 0 0 0px 0; -} -.widget .statistic-chart .toolbar { - padding: 10px; - padding-top: 0px; -} -.widget.full { - padding: 0px; -} -.widget.full .box-footer { - padding: 20px 20px 15px 20px; -} -.widget.full .box-footer a, -.widget.full .box-footer a:hover { - color: #1B1E24; - text-decoration: none; -} -.widget .nav-tabs > li > a { - line-height: 1.428571429; - border: none; - margin-right: 6px; - background: rgba(0,0,0,0.04); - font-family: "Open Sans"; - color: #555; - font-size: 13px; -} -.widget .tab-content { - padding-top: 10px; - font-size: 13px; -} -.widget .tab-boxed { - padding: 10px; - border: 1px solid #ddd; - border-top: 0px; -} -.widget .nav-tabs > li > a i { - color: #555; -} -.widget .media-list { - margin-top: 30px; -} -.widget .media-list a { - color: #1B1E24; -} -.widget .media-list a:hover { - color: #212121; - text-decoration: none; -} -.widget .media-list .media { - padding: 5px 20px; - border-bottom: 1px solid #eaeaea; -} -.widget .media-list li:last-child.media { - border-bottom: none; -} -.widget .media-list .media .media-heading a { - font-size: 14px; - font-weight: 600; - color: #1B1E24; - margin-right: 5px; -} -.widget .media-list .media .media-heading small { - color: #65BD77; - font-size: 11px; -} -.widget .media-list .media p { - color: #909090; -} -.widget .media-list .media .media-object { - width: 50px; -} -.widget .nav-tabs > li.active > a, -.widget .nav-tabs > li.active > a:hover, -.widget .nav-tabs > li.active > a:focus { - cursor: default; - border-top: none; - border-right: none; - border-left: none; - border-bottom: none; - background-color: #7A868F; - color: #fff; -} -.widget .nav-tabs > li.active > a i, -.widget .nav-tabs > li.active > a:hover i, -.widget .nav-tabs > li.active > a:focus i { - color: #fff; -} -.widget .nav-tabs.nav-simple li a { - background: none; -} -.widget .nav-tabs.nav-simple > li.active > a, -.widget .nav-tabs.nav-simple > li.active > a:hover, -.widget .nav-tabs.nav-simple > li.active > a:focus { - border: 1px solid #ddd; - border-bottom: 1px solid #fff; - background: none; - color: #555; -} -.widget .nav-tabs.nav-simple > li.active > a i, -.widget .nav-tabs.nav-simple > li.active > a:hover i, -.widget .nav-tabs.nav-simple > li.active > a:focus i { - color: #555; -} -.widget .additional-box { - position: absolute; - top: 10px; - right: 15px; - z-index: 2; -} -.widget .additional-btn { - position: absolute; - top: 10px; - right: 13px; - z-index: 2; -} -.widget .left-toolbar { - position: absolute; - top: 10px; - left: 13px; - z-index: 2; -} -.widget:hover .additional-btn > a.hidden { - display: inline-block !important; - visibility: visible !important; -} -.widget:hover .additional-btn > a.hidden.nevershow, -.widget:hover .additional-btn > a.nevershow, -.widget .additional-btn > a.nevershow { - display: none !important; -} -.widget .widget-header:hover .additional-btn > a { - color: #909090; - -webkit-transition: All 0.4s ease; - -moz-transition: All 0.4s ease; - -o-transition: All 0.4s ease; -} -.widget.modal-widget.modalize .widget-header .additional-btn > a { - color: #909090; -} -.widget .btn-group { - z-index: 1; -} -.widget table .btn-group { - z-index: 1; -} -.widget .additional-btn .dropdown-menu { - z-index: 2; -} -.widget .widget-close, -.widget .widget-toggle { - font-size: 15px; -} -.widget .widget-close:hover { - color: #EB5055 !important; -} -.widget .additional-btn > a, -.widget .widget-header .additional-btn .btn-group > a { - color: #ccc; - margin-left: 7px; - margin-right: 0px; - cursor: pointer; - -webkit-transition: All 0.4s ease; - -moz-transition: All 0.4s ease; - -o-transition: All 0.4s ease; -} -.widget .additional-btn > a:hover { - text-decoration: none; - -webkit-transition: All 0.4s ease; - -moz-transition: All 0.4s ease; - -o-transition: All 0.4s ease; -} -.ui-sortable-placeholder { - background: #cdcdcd !important; - display: block; - visibility: visible !important; - min-height: 100%; - -webkit-box-shadow: inset 0 0 5px 0 rgba(0,0,0,0.1); - box-shadow: inset 0 0 5px 0 rgba(0,0,0,0.1); -} -.widget.ui-sortable-placeholder * { - visibility: hidden; -} -.transparent { - background: rgba(0,0,0,0); - color: #fff; -} -.white { - background: #ffffff; - color: #555; -} -.widget.success { - background: #65BD77; - color: #fff; -} -.widget.success h2 { - color: #2C7439; - border-bottom-color: #3B934B; -} -.widget.success:hover { - color: #DEFFE5; -} -.widget.success .additional-btn a.additional-icon { - color: #3B934B; -} -.widget.success .additional-btn a:hover.additional-icon { - color: #2C7439; -} -.widget.success .text-box h3 { - color: #215F2E; -} -.widget.success .progress-bar-success { - background-color: #215F2E; -} -.widget.success i.success { - color: #215F2E; -} -.widget.danger { - background: #D9534F; - color: #fff; -} -.widget.danger h2 { - color: #791C1A; - border-bottom-color: #791C1A; -} -.widget.danger:hover { - color: #fff; -} -.widget.danger .additional-btn a.additional-icon { - color: #791C1A; -} -.widget.danger .additional-btn a:hover.additional-icon { - color: #791C1A; -} -.widget.danger .text-box h3 { - color: #791C1A; -} -.widget.danger .progress-bar-danger { - background-color: #791C1A; -} -.widget.danger i.danger { - color: #791C1A; -} -.widget.info { - background: #4393D8; - color: #fff; -} -.widget.info h2 { - color: #15558B; - border-bottom-color: #15558B; -} -.widget.info:hover { - color: #DEFFE5; -} -.widget.info .additional-btn a.additional-icon { - color: #15558B; -} -.widget.info .additional-btn a:hover.additional-icon { - color: #15558B; -} -.widget.info .text-box h3 { - color: #15558B; -} -.widget.info .progress-bar-info { - background-color: #15558B; -} -.widget.info i.info { - color: #15558B; -} -.widget.warning { - background: #F7CB17; - color: #fff; -} -.widget.warning h2 { - color: #9D5D03; - border-bottom-color: #9D5D03; -} -.widget.warning:hover { - color: #DEFFE5; -} -.widget.warning .additional-btn a.additional-icon { - color: #9D5D03; -} -.widget.warning .additional-btn a:hover.additional-icon { - color: #9D5D03; -} -.widget.warning .text-box h3 { - color: #9D5D03; -} -.widget.warning .progress-bar-warning { - background-color: #9D5D03; -} -.widget .progress-bar-semi-transparent { - background-color: rgba(255,255,255,0.4); -} -.widget.warning i.warning { - color: #9D5D03; -} -.widget .additional { - padding: 0 15px; - background: #fff; - color: #909090; - margin: 15px -15px -15px -15px; -} -.widget .additional .list-box-info { - margin: 0 -15px; -} -.widget .additional .list-box-info ul { - list-style: none; - margin: 0; - padding: 0; -} -.widget .additional .list-box-info ul li { - background: #fff; - padding: 15px 20px; - color: #909090; - border-bottom: 1px solid #ddd; -} -.widget .additional .list-box-info ul li span.label { - float: right; - font-size: 13px; -} -.widget .additional .list-box-info ul li:last-child { - border-bottom: 1px solid #fff; -} -.left .widget { - margin: 10px; -} -.left .widget-header h2 { - color: #fff; - padding: 4px; -} -.left .widget .additional-btn { - right: 4px; -} -.widget.full h2 { - padding: 15px; - margin: 5px 0px 20px 0px; -} -.widget table { - margin: 0; -} -.widget table tr th, -.widget table tr td { - padding-left: 15px; - padding-right: 15px; -} -.widget .widget-icon { - font-size: 50px; - position: absolute; - right: 4%; - top: 10px; - color: #ffffff; -} -.widget .text-box h2 { - padding: 0; - margin: 0px 0; - font-weight: 300; - font-size: 32px; - display: block; - color: #fff; -} -.widget .text-box .maindata { - font-size: 11px; - color: #fff; - font-family: "Open Sans"; -} -.widget .text-box .maindata b { - font-size: 12px; -} -.top-summary .widget .progress { - margin: 0px; - background: rgba(0,0,0,0.2); -} -.top-summary .widget .widget-footer { - background: rgba(0,0,0,0.1); - padding: 4px 15px; - font-size: 12px; - color: rgba(255,255,255,0.9); -} -.top-summary .widget .widget-footer .rel-change { - font-size: 14px; - color: #fff; - margin-right: 7px; -} -.flip { - perspective: 600px; - perspective-origin: 50% 50%; - position: relative; -} -.flip:hover .widget-flip, -.flip.hover .widget-flip { - transform: rotateY(180deg); -} -.flip, -.widget-front, -.widget-back { - width: 100%; - height: 110px; -} -.widget-flip { - transition: all 600ms ease 0s, opacity 200ms ease 0s; - transform-style: preserve-3d; - position: relative; -} -.widget-front, -.widget-back { - backface-visibility: hidden; - transform-origin: 50% 50% 0; - position: absolute; - top: 0; - left: 0; -} -.widget-front { - z-index: 2; - background: #ff0000; -} -.widget-back { - background: #333; - transform: rotateY(180deg); -} -.dropdown-toggle.btn-sm { - padding-right: 6px; -} -.dropdown-toggle.btn-xs { - padding-right: 3px; -} -.btn-default { - background-color: #ABB7B7; - border-color: #ABB7B7; - color: #fff; -} -.btn-default:hover, -.btn-default:focus, -.btn-default:active, -.btn-default.active, -.open .dropdown-toggle.btn-default { - background-color: #98A3A3; - border-color: #98A3A3; - color: #fff; -} -.btn-primary { - background-color: #4A525F; - border-color: #4A525F; - color: #FFFFFF; -} -.btn-primary:hover, -.btn-primary:focus, -.btn-primary:active, -.btn-primary.active, -.open .dropdown-toggle.btn-primary { - background-color: #3E444F; - border-color: #3E444F; - color: #FFFFFF; -} -.btn-success { - background-color: #68C39F; - border-color: #68C39F; - color: #FFFFFF; -} -.btn-success:hover, -.btn-success:focus, -.btn-success:active, -.btn-success.active, -.open .dropdown-toggle.btn-success { - background-color: #5CAD8D; - border-color: #5CAD8D; - color: #FFFFFF; -} -.btn-info { - background-color: #65BBD6; - border-color: #65BBD6; - color: #FFFFFF; -} -.btn-info:hover, -.btn-info:focus, -.btn-info:active, -.btn-info.active, -.open .dropdown-toggle.btn-info { - background-color: #5BA9C2; - border-color: #5BA9C2; - color: #FFFFFF; -} -.btn-warning { - background-color: #FFC052; - border-color: #FFC052; - color: #FFFFFF; -} -.btn-warning:hover, -.btn-warning:focus, -.btn-warning:active, -.btn-warning.active, -.open .dropdown-toggle.btn-warning { - background-color: #F5B84F; - border-color: #F5B84F; - color: #FFFFFF; -} -.btn-danger { - background-color: #E15554; - border-color: #E15554; - color: #FFFFFF; -} -.btn-danger:hover, -.btn-danger:focus, -.btn-danger:active, -.btn-danger.active, -.open .dropdown-toggle.btn-danger { - background-color: #C74B4A; - border-color: #C74B4A; - color: #FFFFFF; -} -i.success { - color: #68C39F; -} -i.warning { - color: #FFC052; -} -i.info { - color: #65BBD6; -} -i.danger { - color: #E15554; -} -.label.label-success { - background: #68C39F; -} -.label.label-warning { - background: #FFC052; -} -.label.label-info { - background: #65BBD6; -} -.label.label-danger { - background: #E15554; -} -p.quick-post { - margin: 10px 5px; -} -p.quick-post i { - color: #909090; - margin: 5px; - cursor: pointer; -} -p.quick-post.message i { - margin: 0 2px; -} -p.quick-post.message { - margin: 3px 0px; - padding: 0; - text-align: right; -} -.chat-widget { - height: 300px; - margin-bottom: 20px; -} -form.input-chat { - margin-top: 20px; -} -.chat-widget .media-list { - margin: 0; -} -.chat-widget .media-list .media { - border-bottom: none; -} -.chat-widget .media-list .media .media-object { - width: 50px; - padding: 4px; - border: 1px solid #eaeaea; -} -.chat-widget .media-list .media .media-body { - background: #f7f7f7; - border-radius: 3px; - padding: 10px; - color: #677179; -} -.chat-widget .media-list .media .media-body p.time { - text-align: right; - color: #909090; - font-size: 11px; - font-style: italic; -} -.chat-widget .media-list .media .media-body.success { - background: #EDFFED; -} -.chat-widget .media-list .media .media-body.warning { - background: #FFFCE0; -} -.chat-widget .media-list .media .media-body.danger { - background: #FFE8E8; -} -.chat-widget .media-list .media .media-body.info { - background: #E5F5FF; -} -.selectpicker { - border-radius: 0; - font-size: 13px; -} -.icon-showcase i { - margin-right: 5px; -} -.bs-glyphicons { - padding-left: 0; - padding-bottom: 1px; - margin-bottom: 20px; - list-style: none; - overflow: hidden; -} -.bs-glyphicons li { - float: left; - width: 25%; - height: 115px; - padding: 10px; - margin: 0 -1px -1px 0; - font-size: 12px; - line-height: 1.4; - text-align: center; - border: 1px solid #ddd; -} -.bs-glyphicons .glyphicon { - margin-top: 5px; - margin-bottom: 10px; - font-size: 24px; -} -.bs-glyphicons .glyphicon-class { - display: block; - text-align: center; - word-wrap: break-word; -} -.bs-glyphicons li:hover { - background-color: rgba(86,61,124,0.1); -} -@media (min-width: 768px) { - .bs-glyphicons li { - width: 12.5%; - } -} -.search-box.has-feedback .form-control-feedback { - right: 5px; -} -.btn-toolbar .rows-check-cont { - margin-top: 6px; - margin-right: 15px; -} -.mail-list { - background: #fff; - color: #777; - box-shadow: 0px 0px 3px rgba(0,0,0,0.1); -} -.mail-reply { - font-size: 13px; - color: #777; -} -.sender-photo { - height: 30px; - margin-top: 5px; - float: left; - margin-right: 10px; -} -.menu-message { - margin: 20px 0; -} -.menu-message .list-group-item { - border: 0px; - border-left: 4px solid transparent; - background: rgba(255,255,255,0.8); - margin-bottom: 0px; - color: #666; -} -.menu-message .list-group-item.active { - background: rgba(255,255,255,0.4); - border-left: 4px solid #68C39F; - color: #666; -} -.menu-message .list-group-item.active .badge { - color: #fff; - background: #7A868F; -} -.menu-folders { - margin: 20px 0; -} -.menu-folders .list-group-item { - border: 0px; - background: rgba(255,255,255,0.8); - margin-bottom: 0px; - color: #666; - font-size: 13px; -} -.menu-folders .list-group-item i { - font-size: 14px; - margin-right: 5px; -} -.table-message tr.unread { - font-weight: 500; -} -.table-message tr.unread a { - font-weight: 500; -} -.table-message > tbody > tr > td { - border-bottom: 1px solid #f3f3f3 !important; -} -.table-message > tbody > tr > td > a { - display: block; - font-weight: 300; - color: #5b5b5b; -} -.table-message > tbody > tr > td > a:hover { - text-decoration: none; -} -.data-table-toolbar span.paging-status { - font-weight: bold; - margin: 10px 10px 0 0; -} -.input-message { - margin-top: -1px; -} -.new-message-btns { - width: 100%; -} -hr.dashed { - height: 1px; - background: transparent; - border-top: none; - border-bottom: 1px dashed #ddd; -} -.data-table-toolbar { - margin: 0px; - padding: 15px; - background: rgba(0,0,0,0.03); -} -.data-table-toolbar-footer { - margin-top: 15px; - padding: 0px; -} -.toolbar-btn-action { - text-align: right; -} -.gallery-wrap { - margin: 10px -10px; -} -.gallery-wrap:before, -.gallery-wrap:after { - display: table; - content: " "; -} -.gallery-wrap:after { - clear: both; -} -.gallery-wrap .column { - float: left; - width: 20%; - margin: 0; - padding: 0; -} -.gallery-wrap .column-4 { - float: left; - width: 25%; - margin: 0; - padding: 0; -} -.gallery-wrap .column-3 { - float: left; - width: 33.33333333333333%; - margin: 0; - padding: 0; -} -.gallery-wrap .column .inner, -.gallery-wrap .column-4 .inner, -.gallery-wrap .column-3 .inner { - margin: 10px; - position: relative; - overflow: hidden; - -webkit-transition: All 0.4s ease; - -moz-transition: All 0.4s ease; - -o-transition: All 0.4s ease; -} -.gallery-wrap .column .inner:hover, -.gallery-wrap .column-4 .inner:hover, -.gallery-wrap .column-3 .inner:hover { - -webkit-box-shadow: 0px 2px 3px 0px rgba(0,0,0,0.25); - -moz-box-shadow: 0px 2px 3px 0px rgba(0,0,0,0.25); - box-shadow: 0px 2px 3px 0px rgba(0,0,0,0.25); -} -.gallery-wrap .column .inner a .img-wrap, -.gallery-wrap .column-3 .inner a .img-wrap, -.gallery-wrap .column-4 .inner a .img-wrap { - cursor: pointer; - cursor: -webkit-zoom-in; - cursor: -moz-zoom-in; - cursor: zoom-in; -} -.gallery-wrap .column .inner .img-wrap { - height: 140px; - overflow: hidden; - background: #ddd; -} -.gallery-wrap .column-3 .inner .img-wrap { - height: 200px; - overflow: hidden; - background: #ddd; -} -.gallery-wrap .column-4 .inner .img-wrap { - height: 180px; - overflow: hidden; - background: #ddd; -} -.gallery-wrap .column .inner .img-frame, -.gallery-wrap .column-3 .inner .img-frame, -.gallery-wrap .column-4 .inner .img-frame { - padding: 5px; - background: #fff; - display: block; - position: relative; - -webkit-transition: All 0.4s ease; - -moz-transition: All 0.4s ease; - -o-transition: All 0.4s ease; -} -.gallery-wrap .column .inner:hover .img-frame, -.gallery-wrap .column-3 .inner:hover .img-frame, -.gallery-wrap .column-4 .inner:hover .img-frame { - background: #fff; -} -.gallery-wrap .column .inner:hover .img-frame.success, -.gallery-wrap .column-3 .inner:hover .img-frame.success, -.gallery-wrap .column-4 .inner:hover .img-frame.success { - background: #65BD77; -} -.gallery-wrap .column .inner:hover .img-frame.warning, -.gallery-wrap .column-3 .inner:hover .img-frame.warning, -.gallery-wrap .column-4 .inner:hover .img-frame.warning { - background: #FFCE00; -} -.gallery-wrap .column .inner:hover .img-frame.danger, -.gallery-wrap .column-3 .inner:hover .img-frame.danger, -.gallery-wrap .column-4 .inner:hover .img-frame.danger { - background: #D73D3D; -} -.gallery-wrap .column .inner:hover .img-frame.info, -.gallery-wrap .column-3 .inner:hover .img-frame.info, -.gallery-wrap .column-4 .inner:hover .img-frame.info { - background: #428BCA; -} -.gallery-wrap .column .inner .img-wrap img, -.gallery-wrap .column-4 .inner .img-wrap img, -.gallery-wrap .column-3 .inner .img-wrap img { - width: 100%; -} -.gallery-wrap .column .inner .caption-hover, -.gallery-wrap .column-4 .inner .caption-hover, -.gallery-wrap .column-3 .inner .caption-hover { - position: absolute; - bottom: -100px; - left: 0; - right: 0; - text-align: center; - color: #909090; - padding: 10px; - background: #fff; - -webkit-transition: All 0.4s ease; - -moz-transition: All 0.4s ease; - -o-transition: All 0.4s ease; -} -.gallery-wrap .column .inner .caption-hover.success, -.gallery-wrap .column-4 .inner .caption-hover.success, -.gallery-wrap .column-3 .inner .caption-hover.success { - color: #2C7439; - background: #65BD77; -} -.gallery-wrap .column .inner .caption-hover.danger, -.gallery-wrap .column-4 .inner .caption-hover.danger, -.gallery-wrap .column-3 .inner .caption-hover.danger { - color: #790D0D; - background: #D73D3D; -} -.gallery-wrap .column .inner .caption-hover.warning, -.gallery-wrap .column-4 .inner .caption-hover.warning, -.gallery-wrap .column-3 .inner .caption-hover.warning { - color: #B27C05; - background: #FFCE00; -} -.gallery-wrap .column .inner .caption-hover.info, -.gallery-wrap .column-4 .inner .caption-hover.info, -.gallery-wrap .column-3 .inner .caption-hover.info { - color: #0A487C; - background: #428BCA; -} -.gallery-wrap .column .inner:hover .caption-hover, -.gallery-wrap .column-4 .inner:hover .caption-hover, -.gallery-wrap .column-3 .inner:hover .caption-hover { - bottom: 0px; -} -.gallery-wrap .column .inner .caption-static, -.gallery-wrap .column-4 .inner .caption-static, -.gallery-wrap .column-3 .inner .caption-static { - position: absolute; - text-align: left; - font-weight: 300; - font-size: 12px; - color: #fff; - padding: 10px; - left: 0px; - bottom: 0px; - width: 100%; - background: -moz-linear-gradient(top,rgba(0,0,0,0) 0%,rgba(0,0,0,0.34) 100%); - background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,rgba(0,0,0,0)),color-stop(100%,rgba(0,0,0,0.34))); - background: -webkit-linear-gradient(top,rgba(0,0,0,0) 0%,rgba(0,0,0,0.34) 100%); - background: -o-linear-gradient(top,rgba(0,0,0,0) 0%,rgba(0,0,0,0.34) 100%); - background: -ms-linear-gradient(top,rgba(0,0,0,0) 0%,rgba(0,0,0,0.34) 100%); - background: linear-gradient(to bottom,rgba(0,0,0,0) 0%,rgba(0,0,0,0.34) 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000',endColorstr='#57000000',GradientType=0); - cursor: -webkit-zoom-in; - cursor: -moz-zoom-in; - cursor: zoom-in; - margin: 0; -} -.gallery-wrap .column .inner a:hover, -.gallery-wrap .column-4 .inner a:hover, -.gallery-wrap .column-3 .inner a:hover { - text-decoration: none; -} -.gallery-wrap .column .inner .caption-static.success, -.gallery-wrap .column-4 .inner .caption-static.success, -.gallery-wrap .column-3 .inner .caption-static.success { - color: #2C7439; - background: #65BD77; -} -.gallery-wrap .column .inner .caption-static.danger, -.gallery-wrap .column-4 .inner .caption-static.danger, -.gallery-wrap .column-3 .inner .caption-static.danger { - color: #790D0D; - background: #D73D3D; -} -.gallery-wrap .column .inner .caption-static.warning, -.gallery-wrap .column-4 .inner .caption-static.warning, -.gallery-wrap .column-3 .inner .caption-static.warning { - color: #B27C05; - background: #FFCE00; -} -.gallery-wrap .column .inner .caption-static.info, -.gallery-wrap .column-4 .inner .caption-static.info, -.gallery-wrap .column-3 .inner .caption-static.info { - color: #0A487C; - background: #428BCA; -} -.btn-facebook { - background: #45619D; - border-color: #4D6CAD; -} -.btn-facebook:hover { - background: #395289; - border-color: #4D6CAD; -} -.btn-twitter { - background: #00ACEE; - border-color: #00B7FC; -} -.btn-twitter:hover { - background: #03A0DE; - border-color: #00B7FC; -} -.btn-gplus { - background: #D54636; - border-color: #B22E21; -} -.btn-gplus:hover { - background: #BF392E; - border-color: #B22E21; -} -.btn-vimeo { - background: #1BB6EC; - border-color: #0AA0D3; -} -.btn-vimeo:hover { - background: #12ADE3; - border-color: #0AA0D3; -} -.btn-pinterest { - background: #CD1F28; - border-color: #B70F17; -} -.btn-pinterest:hover { - background: #C9121A; - border-color: #B70F17; -} -.btn-instagram { - background: #4E3D35; - border-color: #392C24; -} -.btn-instagram:hover { - background: #483931; - border-color: #392C24; -} -i.success { - color: #65BD77; -} -i.warning { - color: #F39C12; -} -i.info { - color: #3498DB; -} -i.danger { - color: #E85344; -} -.btn-facebook { - background-color: #4B66A0; - border-color: #4B66A0; - color: #fff; -} -.btn-facebook:hover, -.btn-facebook:focus, -.btn-facebook:active, -.btn-facebook.active, -.open .dropdown-toggle.btn-facebook { - background-color: #3B5A98; - border-color: #3B5A98; - color: #fff; -} -.btn-facebook:active, -.btn-facebook.active, -.open .dropdown-toggle.btn-facebook { - background-image: none; -} -.btn-facebook.disabled, -.btn-facebook[disabled], -fieldset[disabled] .btn-facebook, -.btn-facebook.disabled:hover, -.btn-facebook[disabled]:hover, -fieldset[disabled] .btn-facebook:hover, -.btn-facebook.disabled:focus, -.btn-facebook[disabled]:focus, -fieldset[disabled] .btn-facebook:focus, -.btn-facebook.disabled:active, -.btn-facebook[disabled]:active, -fieldset[disabled] .btn-facebook:active, -.btn-facebook.disabled.active, -.btn-facebook[disabled].active, -fieldset[disabled] .btn-facebook.active { - background-color: #6C89C1; - border-color: #6C89C1; - color: #fff; -} -.btn-facebook .badge { - color: #3B5A98; -} -.btn-twitter { - background-color: #55ACEE; - border-color: #55ACEE; - color: #fff; -} -.btn-twitter:hover, -.btn-twitter:focus, -.btn-twitter:active, -.btn-twitter.active, -.open .dropdown-toggle.btn-twitter { - background-color: #3490D3; - border-color: #3490D3; - color: #fff; -} -.btn-twitter:active, -.btn-twitter.active, -.open .dropdown-toggle.btn-twitter { - background-image: none; -} -.btn-twitter.disabled, -.btn-twitter[disabled], -fieldset[disabled] .btn-twitter, -.btn-twitter.disabled:hover, -.btn-twitter[disabled]:hover, -fieldset[disabled] .btn-twitter:hover, -.btn-twitter.disabled:focus, -.btn-twitter[disabled]:focus, -fieldset[disabled] .btn-twitter:focus, -.btn-twitter.disabled:active, -.btn-twitter[disabled]:active, -fieldset[disabled] .btn-twitter:active, -.btn-twitter.disabled.active, -.btn-twitter[disabled].active, -fieldset[disabled] .btn-twitter.active { - background-color: #7CC1F5; - border-color: #7CC1F5; - color: #fff; -} -.btn-twitter .badge { - color: #3490D3; -} -.btn-google-plus { - background-color: #D24333; - border-color: #D24333; - color: #fff; -} -.btn-google-plus:hover, -.btn-google-plus:focus, -.btn-google-plus:active, -.btn-google-plus.active, -.open .dropdown-toggle.btn-google-plus { - background-color: #BC2C1F; - border-color: #BC2C1F; - color: #fff; -} -.btn-google-plus:active, -.btn-google-plus.active, -.open .dropdown-toggle.btn-google-plus { - background-image: none; -} -.btn-google-plus.disabled, -.btn-google-plus[disabled], -fieldset[disabled] .btn-google-plus, -.btn-google-plus.disabled:hover, -.btn-google-plus[disabled]:hover, -fieldset[disabled] .btn-google-plus:hover, -.btn-google-plus.disabled:focus, -.btn-google-plus[disabled]:focus, -fieldset[disabled] .btn-google-plus:focus, -.btn-google-plus.disabled:active, -.btn-google-plus[disabled]:active, -fieldset[disabled] .btn-google-plus:active, -.btn-google-plus.disabled.active, -.btn-google-plus[disabled].active, -fieldset[disabled] .btn-google-plus.active { - background-color: #F0675A; - border-color: #F0675A; - color: #fff; -} -.btn-google-plus .badge { - color: #BC2C1F; -} -.btn-dribbble { - background-color: #E04C86; - border-color: #E04C86; - color: #fff; -} -.btn-dribbble:hover, -.btn-dribbble:focus, -.btn-dribbble:active, -.btn-dribbble.active, -.open .dropdown-toggle.btn-dribbble { - background-color: #D33471; - border-color: #D33471; - color: #fff; -} -.btn-dribbble:active, -.btn-dribbble.active, -.open .dropdown-toggle.btn-dribbble { - background-image: none; -} -.btn-dribbble.disabled, -.btn-dribbble[disabled], -fieldset[disabled] .btn-dribbble, -.btn-dribbble.disabled:hover, -.btn-dribbble[disabled]:hover, -fieldset[disabled] .btn-dribbble:hover, -.btn-dribbble.disabled:focus, -.btn-dribbble[disabled]:focus, -fieldset[disabled] .btn-dribbble:focus, -.btn-dribbble.disabled:active, -.btn-dribbble[disabled]:active, -fieldset[disabled] .btn-dribbble:active, -.btn-dribbble.disabled.active, -.btn-dribbble[disabled].active, -fieldset[disabled] .btn-dribbble.active { - background-color: #F571A5; - border-color: #F571A5; - color: #fff; -} -.btn-dribbble .badge { - color: #D33471; -} -.btn-flickr { - background-color: #0162DB; - border-color: #0162DB; - color: #fff; -} -.btn-flickr:hover, -.btn-flickr:focus, -.btn-flickr:active, -.btn-flickr.active, -.open .dropdown-toggle.btn-flickr { - background-color: #0555BF; - border-color: #0555BF; - color: #fff; -} -.btn-flickr:active, -.btn-flickr.active, -.open .dropdown-toggle.btn-flickr { - background-image: none; -} -.btn-flickr.disabled, -.btn-flickr[disabled], -fieldset[disabled] .btn-flickr, -.btn-flickr.disabled:hover, -.btn-flickr[disabled]:hover, -fieldset[disabled] .btn-flickr:hover, -.btn-flickr.disabled:focus, -.btn-flickr[disabled]:focus, -fieldset[disabled] .btn-flickr:focus, -.btn-flickr.disabled:active, -.btn-flickr[disabled]:active, -fieldset[disabled] .btn-flickr:active, -.btn-flickr.disabled.active, -.btn-flickr[disabled].active, -fieldset[disabled] .btn-flickr.active { - background-color: #2983F7; - border-color: #2983F7; - color: #fff; -} -.btn-flickr .badge { - color: #0555BF; -} -.btn-pinterest { - background-color: #CC2127; - border-color: #CC2127; - color: #fff; -} -.btn-pinterest:hover, -.btn-pinterest:focus, -.btn-pinterest:active, -.btn-pinterest.active, -.open .dropdown-toggle.btn-pinterest { - background-color: #B70F12; - border-color: #B70F12; - color: #fff; -} -.btn-pinterest:active, -.btn-pinterest.active, -.open .dropdown-toggle.btn-pinterest { - background-image: none; -} -.btn-pinterest.disabled, -.btn-pinterest[disabled], -fieldset[disabled] .btn-pinterest, -.btn-pinterest.disabled:hover, -.btn-pinterest[disabled]:hover, -fieldset[disabled] .btn-pinterest:hover, -.btn-pinterest.disabled:focus, -.btn-pinterest[disabled]:focus, -fieldset[disabled] .btn-pinterest:focus, -.btn-pinterest.disabled:active, -.btn-pinterest[disabled]:active, -fieldset[disabled] .btn-pinterest:active, -.btn-pinterest.disabled.active, -.btn-pinterest[disabled].active, -fieldset[disabled] .btn-pinterest.active { - background-color: #E53B3E; - border-color: #E53B3E; - color: #fff; -} -.btn-pinterest .badge { - color: #B70F12; -} -.btn-youtube { - background-color: #D92623; - border-color: #D92623; - color: #fff; -} -.btn-youtube:hover, -.btn-youtube:focus, -.btn-youtube:active, -.btn-youtube.active, -.open .dropdown-toggle.btn-youtube { - background-color: #C91212; - border-color: #C91212; - color: #fff; -} -.btn-youtube:active, -.btn-youtube.active, -.open .dropdown-toggle.btn-youtube { - background-image: none; -} -.btn-youtube.disabled, -.btn-youtube[disabled], -fieldset[disabled] .btn-youtube, -.btn-youtube.disabled:hover, -.btn-youtube[disabled]:hover, -fieldset[disabled] .btn-youtube:hover, -.btn-youtube.disabled:focus, -.btn-youtube[disabled]:focus, -fieldset[disabled] .btn-youtube:focus, -.btn-youtube.disabled:active, -.btn-youtube[disabled]:active, -fieldset[disabled] .btn-youtube:active, -.btn-youtube.disabled.active, -.btn-youtube[disabled].active, -fieldset[disabled] .btn-youtube.active { - background-color: #F04343; - border-color: #F04343; - color: #fff; -} -.btn-youtube .badge { - color: #C91212; -} -.btn-dropbox { - background-color: #1473C3; - border-color: #1473C3; - color: #fff; -} -.btn-dropbox:hover, -.btn-dropbox:focus, -.btn-dropbox:active, -.btn-dropbox.active, -.open .dropdown-toggle.btn-dropbox { - background-color: #0864B2; - border-color: #0864B2; - color: #fff; -} -.btn-dropbox:active, -.btn-dropbox.active, -.open .dropdown-toggle.btn-dropbox { - background-image: none; -} -.btn-dropbox.disabled, -.btn-dropbox[disabled], -fieldset[disabled] .btn-dropbox, -.btn-dropbox.disabled:hover, -.btn-dropbox[disabled]:hover, -fieldset[disabled] .btn-dropbox:hover, -.btn-dropbox.disabled:focus, -.btn-dropbox[disabled]:focus, -fieldset[disabled] .btn-dropbox:focus, -.btn-dropbox.disabled:active, -.btn-dropbox[disabled]:active, -fieldset[disabled] .btn-dropbox:active, -.btn-dropbox.disabled.active, -.btn-dropbox[disabled].active, -fieldset[disabled] .btn-dropbox.active { - background-color: #2E90E3; - border-color: #2E90E3; - color: #fff; -} -.btn-dropbox .badge { - color: #0864B2; -} -.btn-foursquare { - background-color: #0086BE; - border-color: #0086BE; - color: #fff; -} -.btn-foursquare:hover, -.btn-foursquare:focus, -.btn-foursquare:active, -.btn-foursquare.active, -.open .dropdown-toggle.btn-foursquare { - background-color: #0571A0; - border-color: #0571A0; - color: #fff; -} -.btn-foursquare:active, -.btn-foursquare.active, -.open .dropdown-toggle.btn-foursquare { - background-image: none; -} -.btn-foursquare.disabled, -.btn-foursquare[disabled], -fieldset[disabled] .btn-foursquare, -.btn-foursquare.disabled:hover, -.btn-foursquare[disabled]:hover, -fieldset[disabled] .btn-foursquare:hover, -.btn-foursquare.disabled:focus, -.btn-foursquare[disabled]:focus, -fieldset[disabled] .btn-foursquare:focus, -.btn-foursquare.disabled:active, -.btn-foursquare[disabled]:active, -fieldset[disabled] .btn-foursquare:active, -.btn-foursquare.disabled.active, -.btn-foursquare[disabled].active, -fieldset[disabled] .btn-foursquare.active { - background-color: #2CA0CE; - border-color: #2CA0CE; - color: #fff; -} -.btn-foursquare .badge { - color: #0571A0; -} -.btn-github { - background-color: #3B3B3B; - border-color: #3B3B3B; - color: #fff; -} -.btn-github:hover, -.btn-github:focus, -.btn-github:active, -.btn-github.active, -.open .dropdown-toggle.btn-github { - background-color: #212121; - border-color: #212121; - color: #fff; -} -.btn-github:active, -.btn-github.active, -.open .dropdown-toggle.btn-github { - background-image: none; -} -.btn-github.disabled, -.btn-github[disabled], -fieldset[disabled] .btn-github, -.btn-github.disabled:hover, -.btn-github[disabled]:hover, -fieldset[disabled] .btn-github:hover, -.btn-github.disabled:focus, -.btn-github[disabled]:focus, -fieldset[disabled] .btn-github:focus, -.btn-github.disabled:active, -.btn-github[disabled]:active, -fieldset[disabled] .btn-github:active, -.btn-github.disabled.active, -.btn-github[disabled].active, -fieldset[disabled] .btn-github.active { - background-color: #5F5F5F; - border-color: #5F5F5F; - color: #fff; -} -.btn-github .badge { - color: #212121; -} -.btn-linkedin { - background-color: #0085AE; - border-color: #0085AE; - color: #fff; -} -.btn-linkedin:hover, -.btn-linkedin:focus, -.btn-linkedin:active, -.btn-linkedin.active, -.open .dropdown-toggle.btn-linkedin { - background-color: #036C8E; - border-color: #036C8E; - color: #fff; -} -.btn-linkedin:active, -.btn-linkedin.active, -.open .dropdown-toggle.btn-linkedin { - background-image: none; -} -.btn-linkedin.disabled, -.btn-linkedin[disabled], -fieldset[disabled] .btn-linkedin, -.btn-linkedin.disabled:hover, -.btn-linkedin[disabled]:hover, -fieldset[disabled] .btn-linkedin:hover, -.btn-linkedin.disabled:focus, -.btn-linkedin[disabled]:focus, -fieldset[disabled] .btn-linkedin:focus, -.btn-linkedin.disabled:active, -.btn-linkedin[disabled]:active, -fieldset[disabled] .btn-linkedin:active, -.btn-linkedin.disabled.active, -.btn-linkedin[disabled].active, -fieldset[disabled] .btn-linkedin.active { - background-color: #24A7D3; - border-color: #24A7D3; - color: #fff; -} -.btn-linkedin .badge { - color: #036C8E; -} -.btn-tumblr { - background-color: #3E5A70; - border-color: #3E5A70; - color: #fff; -} -.btn-tumblr:hover, -.btn-tumblr:focus, -.btn-tumblr:active, -.btn-tumblr.active, -.open .dropdown-toggle.btn-tumblr { - background-color: #2E485D; - border-color: #2E485D; - color: #fff; -} -.btn-tumblr:active, -.btn-tumblr.active, -.open .dropdown-toggle.btn-tumblr { - background-image: none; -} -.btn-tumblr.disabled, -.btn-tumblr[disabled], -fieldset[disabled] .btn-tumblr, -.btn-tumblr.disabled:hover, -.btn-tumblr[disabled]:hover, -fieldset[disabled] .btn-tumblr:hover, -.btn-tumblr.disabled:focus, -.btn-tumblr[disabled]:focus, -fieldset[disabled] .btn-tumblr:focus, -.btn-tumblr.disabled:active, -.btn-tumblr[disabled]:active, -fieldset[disabled] .btn-tumblr:active, -.btn-tumblr.disabled.active, -.btn-tumblr[disabled].active, -fieldset[disabled] .btn-tumblr.active { - background-color: #586F81; - border-color: #586F81; - color: #fff; -} -.btn-tumblr .badge { - color: #2E485D; -} -.btn-vimeo { - background-color: #1BB6EC; - border-color: #1BB6EC; - color: #fff; -} -.btn-vimeo:hover, -.btn-vimeo:focus, -.btn-vimeo:active, -.btn-vimeo.active, -.open .dropdown-toggle.btn-vimeo { - background-color: #0D9DD1; - border-color: #0D9DD1; - color: #fff; -} -.btn-vimeo:active, -.btn-vimeo.active, -.open .dropdown-toggle.btn-vimeo { - background-image: none; -} -.btn-vimeo.disabled, -.btn-vimeo[disabled], -fieldset[disabled] .btn-vimeo, -.btn-vimeo.disabled:hover, -.btn-vimeo[disabled]:hover, -fieldset[disabled] .btn-vimeo:hover, -.btn-vimeo.disabled:focus, -.btn-vimeo[disabled]:focus, -fieldset[disabled] .btn-vimeo:focus, -.btn-vimeo.disabled:active, -.btn-vimeo[disabled]:active, -fieldset[disabled] .btn-vimeo:active, -.btn-vimeo.disabled.active, -.btn-vimeo[disabled].active, -fieldset[disabled] .btn-vimeo.active { - background-color: #4BCBFA; - border-color: #4BCBFA; - color: #fff; -} -.btn-vimeo .badge { - color: #0D9DD1; -} -.icon-facebook { - color: #4B66A0; -} -a .icon-facebook { - color: #4B66A0; -} -a:hover .icon-facebook, -a:focus .icon-facebook { - text-decoration: none; - color: #3B5A98; -} -.icon-twitter { - color: #55ACEE; -} -a .icon-twitter { - color: #55ACEE; -} -a:hover .icon-twitter, -a:focus .icon-twitter { - text-decoration: none; - color: #3490D3; -} -.icon-google-plus { - color: #D24333; -} -a .icon-google-plus { - color: #D24333; -} -a:hover .icon-google-plus, -a:focus .icon-google-plus { - text-decoration: none; - color: #BC2C1F; -} -.icon-dribbble { - color: #E04C86; -} -a .icon-dribbble { - color: #E04C86; -} -a:hover .icon-dribbble, -a:focus .icon-dribbble { - text-decoration: none; - color: #D33471; -} -.icon-flickr { - color: #0162DB; -} -a .icon-flickr { - color: #0162DB; -} -a:hover .icon-flickr, -a:focus .icon-flickr { - text-decoration: none; - color: #0555BF; -} -.icon-pinterest { - color: #CC2127; -} -a .icon-pinterest { - color: #CC2127; -} -a:hover .icon-pinterest, -a:focus .icon-pinterest { - text-decoration: none; - color: #B70F12; -} -.icon-youtube { - color: #D92623; -} -a .icon-youtube { - color: #D92623; -} -a:hover .icon-youtube, -a:focus .icon-youtube { - text-decoration: none; - color: #C91212; -} -.icon-dropbox { - color: #1473C3; -} -a .icon-dropbox { - color: #1473C3; -} -a:hover .icon-dropbox, -a:focus .icon-dropbox { - text-decoration: none; - color: #0864B2; -} -.icon-foursquare { - color: #0086BE; -} -a .icon-foursquare { - color: #0086BE; -} -a:hover .icon-foursquare, -a:focus .icon-foursquare { - text-decoration: none; - color: #0571A0; -} -.icon-github { - color: #3B3B3B; -} -a .icon-github { - color: #3B3B3B; -} -a:hover .icon-github, -a:focus .icon-github { - text-decoration: none; - color: #212121; -} -.icon-linkedin { - color: #0085AE; -} -a .icon-linkedin { - color: #0085AE; -} -a:hover .icon-linkedin, -a:focus .icon-linkedin { - text-decoration: none; - color: #036C8E; -} -.icon-tumblr { - color: #3E5A70; -} -a .icon-tumblr { - color: #3E5A70; -} -a:hover .icon-tumblr, -a:focus .icon-tumblr { - text-decoration: none; - color: #2E485D; -} -.icon-vimeo { - color: #1BB6EC; -} -a .icon-vimeo { - color: #1BB6EC; -} -a:hover .icon-vimeo, -a:focus .icon-vimeo { - text-decoration: none; - color: #0D9DD1; -} -.mfp-fade.mfp-bg { - opacity: 0; - -webkit-transition: all 0.4s ease-out; - -moz-transition: all 0.4s ease-out; - transition: all 0.4s ease-out; -} -.mfp-fade.mfp-bg.mfp-ready { - opacity: 0.8; -} -.mfp-fade.mfp-bg.mfp-removing { - opacity: 0; -} -.mfp-fade.mfp-wrap .mfp-content { - opacity: 0; - -webkit-transition: all 0.4s ease-out; - -moz-transition: all 0.4s ease-out; - transition: all 0.4s ease-out; -} -.mfp-fade.mfp-wrap.mfp-ready .mfp-content { - opacity: 1; -} -.mfp-fade.mfp-wrap.mfp-removing .mfp-content { - opacity: 0; -} -.login-page { - background: #7A868F; -} -.signup-page { - background: #7A868F; -} -.lock-page { - background: #252932; -} -.lock-page .container { - background: #7A868F; -} -.internal-error h1 { - -webkit-transform: rotate(10); - -moz-transform: rotate(10); - -ms-transform: rotate(10); - -o-transform: rotate(10); - transform: rotate(10); - -webkit-transform: rotate(10deg); - -moz-transform: rotate(10deg); - transform: rotate(10deg); - -o-transform: rotate(10deg); -} -.internal-error h2 { - -webkit-transform: rotate(-185); - -moz-transform: rotate(-185); - -ms-transform: rotate(-185); - -o-transform: rotate(-185); - transform: rotate(-185); - -webkit-transform: rotate(-185deg); - -moz-transform: rotate(-185deg); - transform: rotate(-185deg); - -o-transform: rotate(-185deg); -} -.internal-error .backbtn { - -webkit-transform: rotate(-44); - -moz-transform: rotate(-44); - -ms-transform: rotate(-44); - -o-transform: rotate(-44); - transform: rotate(-44); - -webkit-transform: rotate(-44deg); - -moz-transform: rotate(-44deg); - transform: rotate(-44deg); - -o-transform: rotate(-44deg); -} -.internal-error .searchbtn { - -webkit-transform: rotate(-44); - -moz-transform: rotate(-44); - -ms-transform: rotate(-44); - -o-transform: rotate(-44); - transform: rotate(-44); - -webkit-transform: rotate(-44deg); - -moz-transform: rotate(-44deg); - transform: rotate(-44deg); - -o-transform: rotate(-44deg); -} -.full-content-center { - width: 100%; - padding: 5px 0px; - max-width: 500px; - margin: 6% auto; - text-align: center; -} -.full-content { - background: #E5E9EC; -} -.full-content-center h1 { - font-size: 150px; - font-family: "Open Sans"; - line-height: 150px; - font-weight: 700; - color: #252932; -} -.maintenance h1 i { - font-size: 150px; - color: #252932; -} -.maintenance h1 { - font-size: 50px; - line-height: 100px; - color: #fff; - text-shadow: 1px 1px 0px rgba(0,0,0,0.1); -} -.login-wrap { - margin: 20px 10%; - text-align: left; - background: rgba(0,0,0,0.1); - padding: 20px 20px; - color: #fff; -} -.login-wrap a { - color: #fff; -} -.login-wrap i { - margin-right: 5px; -} -.login-wrap .checkbox { - margin-left: 0; - padding-left: 0; -} -.login-wrap .btn-block { - margin: 5px 0; -} -.login-wrap .login-input { - position: relative; -} -.login-wrap .login-input .text-input { - padding-left: 30px; -} -.login-wrap .login-input i.overlay { - position: absolute; - left: 10px; - top: 10px; - color: #aaa; -} -.widget .media-list.search-result .media a { - color: #46C45F; -} -.widget .media-list.search-result .media .media-heading a { - color: #1279D1; -} -.widget .media-list.search-result .media .media-heading span { - font-size: 12px; - font-weight: 400; - padding: 3px 5px; -} -.widget .media-list.search-result .media .media-object { - width: 100px; -} -ul.faq { - list-style: none; - padding-left: 10px; - margin: 20px 0 50px; -} -ul.faq li i { - margin-right: 5px; -} -ul.faq li { - margin: 10px 0; -} -ul.faq li a.faq-question { - cursor: pointer; - display: block; - font-size: 14px; -} -ul.faq li .faq-answer { - margin: 10px 15px; -} -table.pricing-table-style-1 { - text-align: center; - background: #fff; -} -table.pricing-table-style-1 thead tr th { - padding: 15px; - font-size: 18px; - font-weight: 600; - text-align: center; -} -table.pricing-table-style-1 thead tr th.best-choice { - color: #A2A7B7; - background: #0F1215; - border-bottom-color: #000; -} -table.pricing-table-style-1 tbody tr td.best-choice { - background: #1B1E24; - font-weight: 600; - font-size: 15px; - color: #fafafa; - border-top-color: #000; -} -table.pricing-table-style-1 tbody tr td.td-success { - background: #65BD77; - font-weight: 600; - color: #2C7439; - text-align: right; - border-top-color: #55AD67; -} -table.pricing-table-style-1 thead tr th.th-success { - color: #65BD77; - background: #55AD67; - border-bottom-color: #55AD67; -} -.la-pricing-table { - margin: 30px 0; - text-align: center; -} -.la-pricing-table:before, -.la-pricing-table:after { - display: table; - content: " "; -} -.la-pricing-table:after { - clear: both; -} -.la-pricing-table .la-col-4 { - float: left; - margin: 20px 0 20px 0; - padding: 0; - width: 25%; - border: 3px solid transparent; - -webkit-transition: all 0.4s ease-out; - -moz-transition: all 0.4s ease-out; - transition: all 0.4s ease-out; - position: relative; - overflow: hidden; -} -.la-pricing-table .la-col-4:hover { - border-color: #434D58; -} -.la-pricing-table .la-col-4 i.bg-big { - position: absolute; - font-size: 210px; - opacity: .05; - top: 20%; - left: 0; - right: 0; - -webkit-transition: all 0.4s ease-out; - -moz-transition: all 0.4s ease-out; - transition: all 0.4s ease-out; -} -.la-pricing-table .la-col-4:hover i.bg-big { - -webkit-transform: scale(2); - -moz-transform: scale(2); - -o-transform: scale(2); - -ms-transform: scale(2); - transform: scale(2); - opacity: 0; -} -.la-pricing-table .la-col-4 ul { - list-style: none; - padding: 0; - margin: 0; - background: #fff; -} -.la-pricing-table .la-col-4 ul li { - padding: 10px 20px; - display: block; - font-size: 13px; -} -.la-pricing-table .la-col-4 ul li.la-package { - font-size: 24px; - font-weight: 600; - background: #121515; - color: #fff; -} -.la-pricing-table .la-col-4 ul li.la-price { - font-size: 18px; - font-weight: 600; - color: #8E98AD; - background: #434D58; - margin: 0 20px; -} -.la-pricing-table .la-col-4 ul li.la-price i { - font-size: 13px; -} -.la-pricing-table .la-col-4:hover.success { - border-color: #2C7439; -} -.la-pricing-table .la-col-4.success ul { - background: #65BD77; -} -.la-pricing-table .la-col-4.success ul li { - color: #fff; -} -.la-pricing-table .la-col-4.success ul li.la-package { - color: #BCF5C6; - background: #2C7439; -} -.la-pricing-table .la-col-4.success ul li.la-price { - color: #fff; - background: #3E984D; -} -.la-pricing-table .la-col-4:hover.danger { - border-color: #B42424; -} -.la-pricing-table .la-col-4.danger ul { - background: #D73D3D; -} -.la-pricing-table .la-col-4.danger ul li { - color: #fff; -} -.la-pricing-table .la-col-4.danger ul li.la-package { - color: #FFB4B4; - background: #B42424; -} -.la-pricing-table .la-col-4.danger ul li.la-price { - color: #fff; - background: #C42E2E; -} -.la-pricing-table .la-col-4:hover.info { - border-color: #1F6AAA; -} -.la-pricing-table .la-col-4.info ul { - background: #529DDE; -} -.la-pricing-table .la-col-4.info ul li { - color: #fff; -} -.la-pricing-table .la-col-4.info ul li.la-package { - color: #C6E5FF; - background: #1F6AAA; -} -.la-pricing-table .la-col-4.info ul li.la-price { - color: #fff; - background: #2E71AD; -} -.la-pricing-table .la-col-4:hover.warning { - border-color: #F08600; -} -.la-pricing-table .la-col-4.warning ul { - background: #FFCE00; -} -.la-pricing-table .la-col-4.warning ul li { - color: #fff; -} -.la-pricing-table .la-col-4.warning ul li.la-package { - color: #FFF5C9; - background: #F08600; -} -.la-pricing-table .la-col-4.warning ul li.la-price { - color: #fff; - background: #FFAA00; -} -.invoice .widget-content.padding { - padding: 70px 30px; - color: #7A868F; -} -.payment-methods { - font-size: 30px; -} -.company-column { - padding: 15px; - margin-bottom: 20px; -} -.company-column address { - color: #7A868F; -} -.bill-to { - padding: 15px; - margin-bottom: 20px; - margin-top: 20px; - border: 1px dashed #E5E9EC; -} -.btn-default.disabled, -.btn-default[disabled], -fieldset[disabled] .btn-default, -.btn-default.disabled:hover, -.btn-default[disabled]:hover, -fieldset[disabled] .btn-default:hover, -.btn-default.disabled:focus, -.btn-default[disabled]:focus, -fieldset[disabled] .btn-default:focus, -.btn-default.disabled:active, -.btn-default[disabled]:active, -fieldset[disabled] .btn-default:active, -.btn-default.disabled.active, -.btn-default.active[disabled], -fieldset[disabled] .btn-default.active { - background-color: #ABB7B7; - border-color: #ABB7B7; - color: #fff; -} -#calculator { - height: auto; - font: bold 17px "Open Sans", Arial, sans-serif; - padding: 20px; -} -#calculator .col-xs-3, -#calculator .col-xs-9 { - padding: 0px 2%; -} -.calc-top .calc-screen { - height: 47px; - width: 100%; - overflow: hidden; - padding: 0 10px; - background: rgba(0,0,0,0.2); - border-radius: 2px; - box-shadow: inset 0px 4px rgba(0,0,0,0.1); - margin-bottom: 10px; - font-size: 21px; - line-height: 47px; - color: white; - text-shadow: 1px 1px 2px rgba(0,0,0,0.8); - text-align: right; - letter-spacing: 1px; -} -.calc-keys, -.calc-top { - overflow: hidden; -} -.calc-keys span, -.calc-top span.calc-clean { - float: left; - position: relative; - top: 0; - cursor: pointer; - width: 100%; - margin-bottom: 10px; - height: 46px; - background: white; - border-radius: 2px; - color: #666; - line-height: 46px; - text-align: center; - user-select: none; - transition: all 0.2s ease; -} -.calc-keys span.calc-operator { - background: #999; - margin-right: 0; - color: #fff; - font-size: 22px; -} -.calc-keys span.calc-eval { - background: #f1ff92; - color: #888e5f; -} -.calc-top span.calc-clean { - background: #EB5055; - color: white; -} -.calc-keys span:hover { - background: #9c89f6; - color: white; -} -.profile-banner { - width: 100%; - height: 300px; - background-position: center center; - background-size: cover; - position: relative; - background-color: #252932; - border-bottom: 4px solid #fff; - box-shadow: 2px 0px 4px rgba(0,0,0,0.1); -} -.avatar-container { - height: 300px; - text-align: center; -} -.profile-avatar { - width: 200px; - position: relative; - margin: 0px auto; - margin-top: 196px; - border: 4px solid #f3f3f3; -} -.profile-actions { - position: absolute; - bottom: 20px; -} -.user-profile-2 { - margin-top: 50px; -} -.user-profile-sidebar { - margin: 0 0 20px 0; -} -.user-profile-sidebar .user-identity { - margin: 20px 0 0 0; -} -.user-profile-sidebar img { - width: 90px; -} -.account-status-data { - text-align: center; - padding: 10px 0; - border-top: 1px dashed #ddd; - border-bottom: 1px dashed #ddd; - margin: 10px 0 20px 0; -} -.account-status-data h5 { - font-size: 11px; - line-height: 150%; - color: #909090; -} -.user-button { - margin: 15px 0; -} -.user-button .btn { - margin: 5px 0; -} -#social { - padding: 10px; - background: #E5E9EC; - text-align: center; -} -#social a:hover { - text-decoration: none; -} -.fa-circle.facebook { - color: #5471AE; -} -.fa-circle.twitter { - color: #4EC6F6; -} -.fa-circle.gplus { - color: #E24E3E; -} -.fa-circle.tumblr { - color: #4D77A3; -} -.fa-circle.linkedin { - color: #3097CE; -} -.user-profile-content { - margin: 30px 15px; -} -.easyWizardSteps { - list-style: none; - width: 100%; - overflow: hidden; - margin: 0; - padding: 0; - border-bottom: 0px solid rgba(0,0,0,0.1); - margin-bottom: 20px; - background: #7A868F; -} -.easyWizardSteps li { - font-size: 18px; - font-family: "Open Sans"; - display: inline-block; - padding: 10px 20px; - color: #eee; - border-right: 1px solid rgba(0,0,0,0.1); - margin-right: 0px; -} -.easyWizardSteps li:last-child { - border-right: 0px; -} -.easyWizardSteps li span { - font-size: 15px; - padding: 2px 9px; - border-radius: 50%; - margin-top: -5px; - color: #eee; - font-weight: 700; - margin-right: 5px; - border: 2px solid #eee; -} -.easyWizardSteps li.current span { - border: 2px solid #68C39F; - color: #68C39F; -} -.easyWizardSteps li.current { - color: #38464A; - background: #fff; -} -.easyWizardButtons { - overflow: hidden; - padding: 10px; -} -.easyWizardButtons button, -.easyWizardButtons .submit { - cursor: pointer; -} -.easyWizardButtons .prev { - float: left; -} -.easyWizardButtons .next, -.easyWizardButtons .submit { - float: right; -} -.notes { - padding: 15px; - border: 1px dashed #ddd; -} -section.step { - padding: 0 30px; -} -.the-notes { - padding: 15px 15px 15px 30px; - border-left: 4px solid #909090; - margin-bottom: 20px; -} -.the-notes.default { - background: #fff; -} -.the-notes.success { - background: #fff; - border-left-color: #65BD77; -} -.the-notes.warning { - background: #fff; - border-left-color: #F7CB17; -} -.the-notes.danger { - background: #fff; - border-left-color: #D9534F; -} -.the-notes.info { - background: #fff; - border-left-color: #4393D8; -} -.the-notes.success h4 { - color: #65BD77; -} -.the-notes.warning h4 { - color: #F7CB17; -} -.the-notes.danger h4 { - color: #D9534F; -} -.the-notes.inf h4 { - color: #4393D8; -} -.popover { - border-radius: 3px; - box-shadow: none; - opacity: 0.9; - border: none; -} -.popover .arrow { - border-top: none; -} -.popover .popover-title { - background: none repeat scroll 0 0 rgba(0,0,0,0.025); - font-family: "Open Sans"; -} -.popover .popover-content { - padding: 6px 11px; - font-family: Helvetica, Arial; - font-size: 12px; -} -.modal { - direction: rtl; - overflow-y: auto; -} -.modal .modal-dialog { - direction: ltr; -} -.modal-open { - overflow: auto; -} -.mini-stats { - font-size: 12px; - color: #555; -} -#website-statistics1 .widget-footer { - border-top: 1px solid #eee; -} -#website-statistics1 .widget-footer > .col-sm-4 { - padding-top: 25px; - padding-bottom: 20px; - font-size: 13px; -} -.status-data { - font-size: 12px; - font-family: "Open Sans"; - color: rgba(255,255,255,0.5); - padding-left: 30px; -} -.status-data .animate-number { - color: rgba(255,255,255,0.85); - font-size: 14px; - font-weight: 700; -} -.status-data .right-border { - border-right: 1px solid rgba(0,0,0,0.2); -} -#home-chart-2 { - margin-top: 24px; -} -.morris-chart svg { - width: 100% !important; -} -#website-statistic2 h4 { - color: #fff; -} -#website-statistic2 .progress { - background: rgba(0,0,0,0.2); -} -#website-statistic3 { - color: #fff; - padding: 20px; -} -#website-statistic3 h2 { - color: #fff; -} -#website-statistic3 .stock-status { - font-size: 21px; - font-family: "Open Sans"; - line-height: 35px; - display: block; - margin: 10px 0px; -} -.sales-report-data { - padding: 20px; -} -#chat_groups h2 { - color: rgba(0,0,0,0.7); - border-top: 1px solid rgba(0,0,0,0.1); - font-size: 13px; - font-weight: 600; - margin-bottom: 0px; - padding: 0px 15px; -} -#chat_groups li a { - display: block; - padding: 5px 15px; - font-size: 13px; - font-family: "Open Sans"; - color: rgba(0,0,0,0.5); -} -#chat_groups li a i { - margin-right: 5px; - font-size: 12px; -} -#recent_tickets { - display: none; -} -#recent_tickets h2 { - color: rgba(0,0,0,0.7); - border-top: 1px solid rgba(0,0,0,0.1); - font-size: 13px; - font-weight: 400; - margin-bottom: 0px; - padding: 0px 15px; -} -#recent_tickets li a { - display: block; - padding: 5px 15px; - font-size: 13px; - font-family: "Open Sans"; - color: rgba(0,0,0,0.5); -} -#recent_tickets li a i { - margin-right: 5px; -} -#recent_tickets li a span { - display: block; - color: rgba(0,0,0,0.4); - font-size: 12px; -} -#stock-widget .widget-content h4 { - position: absolute; - left: 15px; - top: 40px; -} -#stock-widget #stock-chart svg { - margin-top: -20px; -} -#stock-widget .stock-options { - margin-right: 15px; -} -#notes-app { - background: #fdfdbe; - overflow: hidden; -} -#note-data { - width: 100%; - position: absolute; - left: -100%; - padding-left: 55px; - -webkit-transition: all 300ms ease-in-out; - -moz-transition: all 300ms ease-in-out; - -o-transition: all 300ms ease-in-out; - transition: all 300ms ease-in-out; -} -#notes-app.new-item #notes-list { - left: -100%; - -webkit-transition: all 300ms ease-in-out; - -moz-transition: all 300ms ease-in-out; - -o-transition: all 300ms ease-in-out; - transition: all 300ms ease-in-out; -} -#notes-list { - left: 0%; - padding-left: 60px; - width: 100%; - height: 340px; - overflow: hidden; - padding-top: 7px; - position: absolute; - -webkit-transition: all 300ms ease-in-out; - -moz-transition: all 300ms ease-in-out; - -o-transition: all 300ms ease-in-out; - transition: all 300ms ease-in-out; -} -#notes-list a { - color: #555; -} -#notes-list ul li { - line-height: 31px; -} -#note-text { - min-height: 300px; - height: 100%; - background: none !important; - border: none !important; - line-height: 31px; - resize: none; -} -#notes-app .status-indicator { - position: absolute; - bottom: 15px; - right: 15px; - background: rgba(0,0,0,0.4); - color: #fff; - opacity: 0; - -webkit-transition: all 800ms ease-in-out; - -moz-transition: all 800ms ease-in-out; - -o-transition: all 800ms ease-in-out; - transition: all 800ms ease-in-out; - padding: 1px 6px 2px; -} -#notes-app.saved .status-indicator { - -webkit-transition: all 800ms ease-in-out; - -moz-transition: all 800ms ease-in-out; - -o-transition: all 800ms ease-in-out; - transition: all 800ms ease-in-out; - opacity: 1; -} -#notes-app .widget-content { - background: repeating-linear-gradient(0deg,transparent,transparent 30px,#f3f3f3 30px,#f3f3f3 31px); - height: 342px; - padding-top: 0px; -} -#notes-app .notes-line { - border-left: 3px double rgba(238,150,122,0.55); - position: absolute; - z-index: 0; - display: block; - height: 100%; - left: 50px; -} -#notes-app.new-item #note-data { - left: 0px; - -webkit-transition: all 300ms ease-in-out; - -moz-transition: all 300ms ease-in-out; - -o-transition: all 300ms ease-in-out; - transition: all 300ms ease-in-out; -} -.todo-list { - list-style: none; - padding: 0px; - margin: 0px; -} -.todo-list li { - list-style: none; - padding: 10px; - text-overflow: ellipsis; - width: 100%; - position: relative; - white-space: nowrap; - margin-bottom: 4px; - border-left: 4px solid rgba(0,0,0,0.04); - background: #f8f8f8; -} -.todo-list li.done { - opacity: 0.5; -} -.todo-list li.done .todo-item { - text-decoration: line-through; -} -.todo-list li > span { - line-height: 24px; - height: 25px; - display: inline-block; - text-overflow: ellipsis; - overflow: hidden; - max-width: 70%; - vertical-align: middle; -} -.todo-list .check-icon { - width: 30px; - margin-top: -2px; - display: inline-block; -} -.todo-list .todo-item { - font-size: 12px; - border-bottom: 1px dashed rgba(0,0,0,0) !important; -} -.todo-list .todo-item:hover { - border-bottom: 1px dashed rgba(0,0,0,0.2) !important; -} -.todo-list .todo-options { - font-size: 16px; - display: none; -} -.todo-list .editable-buttons { - display: inline-block; -} -.todo-list .todo-tags { - display: inline; - line-height: auto; - position: absolute; - top: 9px; - right: 9px; - font-family: "Open Sans"; -} -.todo-list .todo-options a { - color: #888; -} -.todo-list li:hover .todo-tags { - display: none; -} -.todo-list li:hover .todo-options { - display: inline; - position: absolute; - top: 9px; - right: 9px; -} -.todo-list li.done .todo-tags { - display: inline !important; -} -.todo-list li.done .todo-options { - display: none !important; -} -.todo-list li .editable-container.editable-inline { - margin-top: -4px; - overflow: visible; -} -.todo-list li.high { - border-left: 4px solid #EB5055; -} -.todo-list li.medium { - border-left: 4px solid #E27A3F; -} -.todo-list li.low { - border-left: 4px solid #FFC052; -} -#contextMenu { - position: absolute; - display: none; - z-index: 1000; -} -#weather-widget { - background: url(../../images/weather/weather-bg.jpg); - background-size: cover; - min-height: 364px; -} -#weather-widget h2 { - color: #fff; -} -#weather h2 { - position: absolute; - top: 60px; - right: 30px; - font-size: 50px; -} -#weather .w-region { - position: absolute; - top: 100px; - left: 20px; - font-size: 30px; - color: rgba(255,255,255,0.9); - font-family: "Open Sans"; -} -#weather .w-currently { - display: block; - font-size: 20px; - color: rgba(255,255,255,0.8); -} -#weather .w-temp2 { - font-size: 24px; - color: rgba(255,255,255,0.8); -} -.bic_calendar { - border: none; - background: none; - font-family: "Open Sans"; -} -.bic_calendar a { - color: #fff; -} -.bic_calendar .table tbody > tr > td { - padding: 2px 0px; - border: none !important; - line-height: 2.429; -} -.bic_calendar td > div { - padding: 4px; -} -.bic_calendar .button-month-next, -.bic_calendar .button-month-previous { - padding: 5px 15px !important; -} -.bic_calendar .days-month td { - background: rgba(0,0,0,0.1); - font-weight: 600; -} -.fc-event { - border: 0px; - padding: 1px 4px; -} -.dataTables_length, -div.dataTables_info { - margin-left: 15px; -} -.dataTables_filter, -.dataTables_paginate { - margin-right: 15px !important; -} -.dataTables_filter input { - margin-left: 6px; -} -.pagination li a, -.pagination li.disabled a { - background-color: #abb7b7; - border-color: #abb7b7; - border-radius: 2px !important; - color: #fff; -} -.pagination li.active a, -.pagination li:hover a, -.pagination > li > a:hover, -.pagination > li > span:hover, -.pagination > li > a:focus, -.pagination > li > span:focus { - background-color: #98a3a3 !important; - border-color: #98a3a3 !important; - color: #fff; -} -.pagination li.disabled a { - color: #ddd; -} -.pagination li.active a { - box-shadow: 0 3px 5px rgba(0,0,0,0.125) inset; -} -.streetview { - height: 300px; -} -.cluster { - color: #FFF; - text-align: center; - font-family: 'Arial,Helvetica'; - font-size: 11px; - font-weight: bold; -} -.cluster-1 { - background-image: url(../img/gmap/m1.png); - line-height: 53px; - width: 53px; - height: 52px; -} -.cluster-2 { - background-image: url(../img/gmap/m2.png); - line-height: 53px; - width: 56px; - height: 55px; -} -.cluster-3 { - background-image: url(../img/gmap/m3.png); - line-height: 66px; - width: 66px; - height: 65px; -} -.modal-content { - -webkit-border-radius: 2px; - border-radius: 2px; -} -.notification-positions { - border: 2px dashed #ddd; - padding: 2px; -} -.notification-positions div, -.notification-positions a { - height: 50px; - margin-bottom: 20px; - display: block; -} -.notification-positions .row:last-child, -.notification-positions .row:last-child div, -.notification-positions .row:last-child div a { - margin-bottom: 0px !important; -} -.jqstooltip { - -webkit-box-sizing: content-box; - -moz-box-sizing: content-box; - box-sizing: content-box; - -webkit-border-radius: 2px; - border-radius: 2px; - border-color: rgba(0,0,0,0.1) !important; - background: rgba(0,0,0,0.5) !important; -} -.rickshaw_graph .detail .x_label { - color: #333; -} -.echart { - position: relative; - display: inline-block; - vertical-align: middle; -} -.echart canvas { - display: block; -} -.percent { - position: absolute; - display: block; - vertical-align: middle; - width: 100%; - line-height: 0px; - text-align: center; - height: 100%; - left: 0px; - top: 50%; - font-weight: bold; - z-index: 2; - font-family: "Open Sans"; -} -.percent:after { - content: '%'; - color: rgba(255,255,255,0.7); - font-weight: normal; - margin-left: 0.1em; - margin-right: -5px; - font-size: 9px; -} -.jvectormap-zoomin, -.jvectormap-zoomout { - width: 18px; - height: 18px; - background: #68C39F; -} -.jvectormap-zoomin:hover, -.jvectormap-zoomout:hover { - background: #5CAD8D; -} -.jvectormap-zoomin { - top: auto; - bottom: 10px; -} -.jvectormap-zoomout { - top: auto; - left: 30px; - bottom: 10px; -} -.grid-example [class*="col-"] { - background: #fff; - border: 1px solid #f3f3f3; - padding-bottom: 10px; - padding-top: 10px; - text-align: center; - transition: all 0.3s ease 0s; -} -span.i-code { - display: none; -} -.icon-showcase p { - font-size: 14px; - vertical-align: middle; - line-height: 30px; -} -.icon-showcase p i { - font-size: 24px; - line-height: 30px; - text-align: center; - vertical-align: middle; - width: 24px; -} -#icons .the-icons i { - font-size: 24px; - line-height: 30px; - position: relative; - top: auto; - right: auto; -} -#icons .the-icons .i-name { - font-size: 14px; - line-height: 30px; -} -.ios-switch-default .on-background { - background: #ABB7B7; -} -.ios-switch-primary .on-background { - background: #2980B9; -} -.ios-switch-success .on-background { - background: #68C39F; -} -.ios-switch-warning .on-background { - background: #E27A3F; -} -.ios-switch-info .on-background { - background: #7A868F; -} -.ios-switch-danger .on-background { - background: #EB5055; -} -.ios-switch-lg { - height: 45px; - width: 75px; -} -.ios-switch-lg .handle { - height: 41px; - width: 41px; -} -.ios-switch-lg.on .handle { - -o-transform: translate3d(30px,0,0); - -ms-transform: translate3d(30px,0,0); - -moz-transform: translate3d(30px,0,0); - -webkit-transform: translate3d(30px,0,0); - transform: translate3d(30px,0,0); -} -.ios-switch-sm { - height: 25px; - width: 45px; -} -.ios-switch-sm .handle { - height: 21px; - width: 21px; -} -.ios-switch-sm.on .handle { - -o-transform: translate3d(20px,0,0); - -ms-transform: translate3d(20px,0,0); - -moz-transform: translate3d(20px,0,0); - -webkit-transform: translate3d(20px,0,0); - transform: translate3d(20px,0,0); -} -footer { - padding: 20px 0; - font-size: 12px; - border-top: 1px solid #B9C1CB; - margin-top: 40px; - color: #7A868F; -} -footer .footer-links a { - color: #7A868F; - padding: 1px 10px; - border-right: 1px solid rgba(0,0,0,0.1); -} -footer .footer-links a:hover { - color: #4A525F; -} -footer .footer-links a:last-child { - border: none; -} diff --git a/public/admin/Coco/assets/img/apple-touch-icon-114x114.png b/public/admin/Coco/assets/img/apple-touch-icon-114x114.png deleted file mode 100644 index 8730cf3ca..000000000 Binary files a/public/admin/Coco/assets/img/apple-touch-icon-114x114.png and /dev/null differ diff --git a/public/admin/Coco/assets/img/apple-touch-icon-120x120.png b/public/admin/Coco/assets/img/apple-touch-icon-120x120.png deleted file mode 100644 index 842e5d630..000000000 Binary files a/public/admin/Coco/assets/img/apple-touch-icon-120x120.png and /dev/null differ diff --git a/public/admin/Coco/assets/img/apple-touch-icon-144x144.png b/public/admin/Coco/assets/img/apple-touch-icon-144x144.png deleted file mode 100644 index f3bd3a329..000000000 Binary files a/public/admin/Coco/assets/img/apple-touch-icon-144x144.png and /dev/null differ diff --git a/public/admin/Coco/assets/img/apple-touch-icon-152x152.png b/public/admin/Coco/assets/img/apple-touch-icon-152x152.png deleted file mode 100644 index 09345fb2b..000000000 Binary files a/public/admin/Coco/assets/img/apple-touch-icon-152x152.png and /dev/null differ diff --git a/public/admin/Coco/assets/img/apple-touch-icon-57x57.png b/public/admin/Coco/assets/img/apple-touch-icon-57x57.png deleted file mode 100644 index 66b0a45e7..000000000 Binary files a/public/admin/Coco/assets/img/apple-touch-icon-57x57.png and /dev/null differ diff --git a/public/admin/Coco/assets/img/apple-touch-icon-72x72.png b/public/admin/Coco/assets/img/apple-touch-icon-72x72.png deleted file mode 100644 index da5e7b51c..000000000 Binary files a/public/admin/Coco/assets/img/apple-touch-icon-72x72.png and /dev/null differ diff --git a/public/admin/Coco/assets/img/apple-touch-icon-76x76.png b/public/admin/Coco/assets/img/apple-touch-icon-76x76.png deleted file mode 100644 index 7961a8b58..000000000 Binary files a/public/admin/Coco/assets/img/apple-touch-icon-76x76.png and /dev/null differ diff --git a/public/admin/Coco/assets/img/apple-touch-icon.png b/public/admin/Coco/assets/img/apple-touch-icon.png deleted file mode 100644 index 66b0a45e7..000000000 Binary files a/public/admin/Coco/assets/img/apple-touch-icon.png and /dev/null differ diff --git a/public/admin/Coco/assets/img/favicon.ico b/public/admin/Coco/assets/img/favicon.ico deleted file mode 100644 index 182b54de8..000000000 Binary files a/public/admin/Coco/assets/img/favicon.ico and /dev/null differ diff --git a/public/admin/Coco/assets/img/gmap/m1.png b/public/admin/Coco/assets/img/gmap/m1.png deleted file mode 100644 index 329ff524c..000000000 Binary files a/public/admin/Coco/assets/img/gmap/m1.png and /dev/null differ diff --git a/public/admin/Coco/assets/img/gmap/m2.png b/public/admin/Coco/assets/img/gmap/m2.png deleted file mode 100644 index b999cbcf6..000000000 Binary files a/public/admin/Coco/assets/img/gmap/m2.png and /dev/null differ diff --git a/public/admin/Coco/assets/img/gmap/m3.png b/public/admin/Coco/assets/img/gmap/m3.png deleted file mode 100644 index 9f30b3092..000000000 Binary files a/public/admin/Coco/assets/img/gmap/m3.png and /dev/null differ diff --git a/public/admin/Coco/assets/img/inv-logo.png b/public/admin/Coco/assets/img/inv-logo.png deleted file mode 100644 index 8c08d7fdd..000000000 Binary files a/public/admin/Coco/assets/img/inv-logo.png and /dev/null differ diff --git a/public/admin/Coco/assets/img/login-logo.png b/public/admin/Coco/assets/img/login-logo.png deleted file mode 100644 index 700722146..000000000 Binary files a/public/admin/Coco/assets/img/login-logo.png and /dev/null differ diff --git a/public/admin/Coco/assets/img/logo.png b/public/admin/Coco/assets/img/logo.png deleted file mode 100644 index dd8e2667c..000000000 Binary files a/public/admin/Coco/assets/img/logo.png and /dev/null differ diff --git a/public/admin/Coco/assets/js/apps/calculator.js b/public/admin/Coco/assets/js/apps/calculator.js deleted file mode 100644 index 42bd6bba0..000000000 --- a/public/admin/Coco/assets/js/apps/calculator.js +++ /dev/null @@ -1,85 +0,0 @@ -// Get all the keys from document -var keys = document.querySelectorAll('#calculator span'); -var operators = ['+', '-', 'x', '÷']; -var decimalAdded = false; - -// Add onclick event to all the keys and perform operations -for(var i = 0; i < keys.length; i++) { - keys[i].onclick = function(e) { - // Get the input and button values - var input = document.querySelector('.calc-screen'); - var inputVal = input.innerHTML; - var btnVal = this.innerHTML; - - // Now, just append the key values (btnValue) to the input string and finally use javascript's eval function to get the result - // If clear key is pressed, erase everything - if(btnVal == 'C') { - input.innerHTML = ''; - decimalAdded = false; - } - - // If eval key is pressed, calculate and display the result - else if(btnVal == '=') { - var equation = inputVal; - var lastChar = equation[equation.length - 1]; - - // Replace all instances of x and ÷ with * and / respectively. This can be done easily using regex and the 'g' tag which will replace all instances of the matched character/substring - equation = equation.replace(/x/g, '*').replace(/÷/g, '/'); - - // Final thing left to do is checking the last character of the equation. If it's an operator or a decimal, remove it - if(operators.indexOf(lastChar) > -1 || lastChar == '.') - equation = equation.replace(/.$/, ''); - - if(equation) - input.innerHTML = eval(equation); - - decimalAdded = false; - } - - // Basic functionality of the calculator is complete. But there are some problems like - // 1. No two operators should be added consecutively. - // 2. The equation shouldn't start from an operator except minus - // 3. not more than 1 decimal should be there in a number - - // We'll fix these issues using some simple checks - - // indexOf works only in IE9+ - else if(operators.indexOf(btnVal) > -1) { - // Operator is clicked - // Get the last character from the equation - var lastChar = inputVal[inputVal.length - 1]; - - // Only add operator if input is not empty and there is no operator at the last - if(inputVal != '' && operators.indexOf(lastChar) == -1) - input.innerHTML += btnVal; - - // Allow minus if the string is empty - else if(inputVal == '' && btnVal == '-') - input.innerHTML += btnVal; - - // Replace the last operator (if exists) with the newly pressed operator - if(operators.indexOf(lastChar) > -1 && inputVal.length > 1) { - // Here, '.' matches any character while $ denotes the end of string, so anything (will be an operator in this case) at the end of string will get replaced by new operator - input.innerHTML = inputVal.replace(/.$/, btnVal); - } - - decimalAdded =false; - } - - // Now only the decimal problem is left. We can solve it easily using a flag 'decimalAdded' which we'll set once the decimal is added and prevent more decimals to be added once it's set. It will be reset when an operator, eval or clear key is pressed. - else if(btnVal == '.') { - if(!decimalAdded) { - input.innerHTML += btnVal; - decimalAdded = true; - } - } - - // if any other key is pressed, just append it - else { - input.innerHTML += btnVal; - } - - // prevent page jumps - e.preventDefault(); - } -} \ No newline at end of file diff --git a/public/admin/Coco/assets/js/apps/notes.js b/public/admin/Coco/assets/js/apps/notes.js deleted file mode 100644 index 00f289eeb..000000000 --- a/public/admin/Coco/assets/js/apps/notes.js +++ /dev/null @@ -1,104 +0,0 @@ -var autosave; -var autosave_time = 5000; // miliseconds - -$(document).ready(function(){ - load_list(); - - $("#notes-list .scroller").slimscroll({ - height: '330px', - size: "5px" - }); - - $(".add-note").click(function(){ - save_note(); - $("#notes-app").addClass("new-item"); - $("#note-text").val(""); - $("#note-text").attr("rel",guidGenerator()); - }); - - $(".back-note-list").click(function(){ - save_note(); - $("#notes-app").removeClass("new-item"); - }); - - $(document).on("click", "#notes-list .note-trunc", function(e){ - e.preventDefault(); - var id = $(this).attr("rel"); - $("#note-text").attr("rel",id); - $("#note-text").val(localStorage.getItem(id)); - $("#notes-app").addClass("new-item"); - }); - - $(document).on("blur change", "#note-text", function(){ - save_note(); - }); - - $(document).on("click", "#notes-list .kill-note", function(e){ - e.preventDefault(); - var id = $(this).attr("rel"); - bootbox.confirm("Are you sure to remove this note?", function(result) { - if(result === true){ - localStorage.removeItem(id); - load_list(); - } - }); - }); - - autosave = window.setInterval(function(){ - if($("#notes-app").hasClass("new-item")){ - save_note(); - } - },autosave_time); -}); - -function save_note(){ - if($("#note-text").val() != ""){ - $("#notes-app").addClass("saved"); - localStorage.setItem($("#note-text").attr("rel"),$("#note-text").val()); - console.log("Note saved!"); - load_list(); - window.setTimeout(function(){ - $("#notes-app").removeClass("saved"); - },1000); - return true; - } - return false; -} - -function load_list(){ - $("#notes-list ul").html(""); - var ids = []; - for (var i = 0; i < localStorage.length; i++) { - var id = localStorage.length-i-1; - if(localStorage.key(id).startsWith("coco-note-")){ - ids.push(id); - } - } - ids = ids.sort(); - for (var x = 0;x < ids.length;x++){ - var note = localStorage.getItem(localStorage.key(ids[x])).truncate(40); - $("#notes-list ul").append("
          • "+note+"
          • "); - } -} - -function guidGenerator() { - var d = new Date().getTime(); - d = 9999999999999-d; - var S4 = function() { - return (((1+Math.random())*0x10000)|0).toString(16).substring(1); - }; - return "coco-note-"+(d+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4()); -} - -if (typeof String.prototype.startsWith != 'function') { - // see below for better implementation! - String.prototype.startsWith = function (str){ - return this.indexOf(str) == 0; - }; -} - -String.prototype.truncate = function(m) { - return (this.length > m) - ? jQuery.trim(this).substring(0, m) + "..." - : this; -}; \ No newline at end of file diff --git a/public/admin/Coco/assets/js/apps/todo.js b/public/admin/Coco/assets/js/apps/todo.js deleted file mode 100644 index cbdf9bcf4..000000000 --- a/public/admin/Coco/assets/js/apps/todo.js +++ /dev/null @@ -1,80 +0,0 @@ -$(document).ready(function(){ - $.fn.editable.defaults.mode = 'inline'; - $(".todo-list").sortable({ - cancel: ".done", - axis: "y", - cursor: "move", - forcePlaceholderSize: true - }); - - $(document).on("ifChecked", ".check-icon input", function(){ - var parent = $(this).parents("li:first"); - $(parent).addClass("done"); - $(parent).data("orig-order",$(parent).index()).insertAfter($(".todo-list li:last")); - $('.todo-item',parent).editable("toggleDisabled"); - }); - - $(document).on("ifUnchecked", ".check-icon input", function(){ - var parent = $(this).parents("li:first"); - $(parent).removeClass("done"); - if($(parent).data("orig-order")){ - $(parent).insertAfter($(".todo-list li:eq("+($(parent).data("orig-order")-1)+")")); - } - $('.todo-item',parent).editable("toggleDisabled"); - }); - - $(document).on("click",".add-todo", function(){ - var $item = '
          • '+ - ''+ - 'New item'+ - ''+ - ''+ - ''+ - '
          • '; - $(".todo-list").append($item); - - $('input').iCheck({ - checkboxClass: 'icheckbox_square-aero', - radioClass: 'iradio_square-aero', - increaseArea: '20%' - }); - - $('.todo-list .todo-item').editable({ - type: 'text' - }); - window.setTimeout(function () { - $(".todo-list li").removeClass("animated"); - }, 500); - }); - - $(document).on("click", ".todo-delete", function(){ - var parent = $(this).parents("li:first"); - $(parent).hide(200); - }) - - var $contextMenu = $("#contextMenu"); - var $rowClicked; - - $(document).on("contextmenu", ".todo-list li", function (e) { - $rowClicked = $(this) - $contextMenu.css({ - display: "block", - left: e.pageX, - top: e.pageY - }); - return false; - }); - - $contextMenu.on("click", "a", function () { - $rowClicked.removeAttr("class").addClass($(this).data("priority")); - $contextMenu.hide(); - }); - - $(document).click(function () { - $contextMenu.hide(); - }); - - $('.todo-list .todo-item').editable({ - type: 'text' - }); -}); \ No newline at end of file diff --git a/public/admin/Coco/assets/js/init.js b/public/admin/Coco/assets/js/init.js deleted file mode 100644 index 460eb0e03..000000000 --- a/public/admin/Coco/assets/js/init.js +++ /dev/null @@ -1,408 +0,0 @@ -var w; -var h; -var dw; -var dh; - -function executeFunctionByName(functionName, context /*, args */) { - var args = [].slice.call(arguments).splice(2); - var namespaces = functionName.split("."); - var func = namespaces.pop(); - for(var i = 0; i < namespaces.length; i++) { - context = context[namespaces[i]]; - } - return context[func].apply(this, args); -} - -var changeptype = function(){ - w = $(window).width(); - h = $(window).height(); - dw = $(document).width(); - dh = $(document).height(); - - if(jQuery.browser.mobile === true){ - $("body").addClass("mobile").removeClass("fixed-left"); - } - - if(!$("#wrapper").hasClass("forced")){ - if(w > 990){ - $("body").removeClass("smallscreen").addClass("widescreen"); - $("#wrapper").removeClass("enlarged"); - }else{ - $("body").removeClass("widescreen").addClass("smallscreen"); - $("#wrapper").addClass("enlarged"); - $(".left ul").removeAttr("style"); - } - if($("#wrapper").hasClass("enlarged") && $("body").hasClass("fixed-left")){ - $("body").removeClass("fixed-left").addClass("fixed-left-void"); - }else if(!$("#wrapper").hasClass("enlarged") && $("body").hasClass("fixed-left-void")){ - $("body").removeClass("fixed-left-void").addClass("fixed-left"); - } - - } - toggle_slimscroll(".slimscrollleft"); -} - -$(document).ready(function(){ - FastClick.attach(document.body); - resizefunc.push("initscrolls"); - resizefunc.push("changeptype"); - $('.sparkline').sparkline('html', { enableTagOptions: true }); - - $('.animate-number').each(function(){ - $(this).animateNumbers($(this).attr("data-value"), true, parseInt($(this).attr("data-duration"))); - }) - -//TOOLTIP -$('body').tooltip({ - selector: "[data-toggle=tooltip]", - container: "body" -}); - -//RESPONSIVE SIDEBAR - - -$(".open-right").click(function(e){ - $("#wrapper").toggleClass("open-right-sidebar"); - e.stopPropagation(); - $("body").trigger("resize"); -}); - - -$(".open-left").click(function(e){ - e.stopPropagation(); - $("#wrapper").toggleClass("enlarged"); - $("#wrapper").addClass("forced"); - - if($("#wrapper").hasClass("enlarged") && $("body").hasClass("fixed-left")){ - $("body").removeClass("fixed-left").addClass("fixed-left-void"); - }else if(!$("#wrapper").hasClass("enlarged") && $("body").hasClass("fixed-left-void")){ - $("body").removeClass("fixed-left-void").addClass("fixed-left"); - } - if($("#wrapper").hasClass("enlarged")){ - $(".left ul").removeAttr("style"); - }else{ - $(".subdrop").siblings("ul:first").show(); - } - toggle_slimscroll(".slimscrollleft"); - $("body").trigger("resize"); -}); - -// LEFT SIDE MAIN NAVIGATION -$("#sidebar-menu a").on('click',function(e){ - if(!$("#wrapper").hasClass("enlarged")){ - - if($(this).parent().hasClass("has_sub")) { - e.preventDefault(); - } - - if(!$(this).hasClass("subdrop")) { - // hide any open menus and remove all other classes - $("ul",$(this).parents("ul:first")).slideUp(350); - $("a",$(this).parents("ul:first")).removeClass("subdrop"); - $("#sidebar-menu .pull-right i").removeClass("fa-angle-up").addClass("fa-angle-down"); - - // open our new menu and add the open class - $(this).next("ul").slideDown(350); - $(this).addClass("subdrop"); - $(".pull-right i",$(this).parents(".has_sub:last")).removeClass("fa-angle-down").addClass("fa-angle-up"); - $(".pull-right i",$(this).siblings("ul")).removeClass("fa-angle-up").addClass("fa-angle-down"); - }else if($(this).hasClass("subdrop")) { - $(this).removeClass("subdrop"); - $(this).next("ul").slideUp(350); - $(".pull-right i",$(this).parent()).removeClass("fa-angle-up").addClass("fa-angle-down"); - //$(".pull-right i",$(this).parents("ul:eq(1)")).removeClass("fa-chevron-down").addClass("fa-chevron-left"); - } - } -}); - -// NAVIGATION HIGHLIGHT & OPEN PARENT -$("#sidebar-menu ul li.has_sub a.active").parents("li:last").children("a:first").addClass("active").trigger("click"); - -//WIDGET ACTIONS -$(".widget-header .widget-close").on("click",function(event){ - event.preventDefault(); - $item = $(this).parents(".widget:first"); - bootbox.confirm("Are you sure to remove this widget?", function(result) { - if(result === true){ - $item.addClass("animated bounceOutUp"); - window.setTimeout(function () { - if($item.data("is-app")){ - - $item.removeClass("animated bounceOutUp"); - if($item.hasClass("ui-draggable")){ - $item.find(".widget-popout").click(); - } - $item.hide(); - $("a[data-app='"+$item.attr("id")+"']").addClass("clickable"); - }else{ - $item.remove(); - } - }, 300); - } - }); -}); - -$(document).on("click", ".widget-header .widget-toggle", function(event){ - event.preventDefault(); - $(this).toggleClass("closed").parents(".widget:first").find(".widget-content").slideToggle(); -}); - -$(document).on("click", ".widget-header .widget-popout", function(event){ - event.preventDefault(); - var widget = $(this).parents(".widget:first"); - if(widget.hasClass("modal-widget")){ - $("i",this).removeClass("icon-window").addClass("icon-publish"); - widget.removeAttr("style").removeClass("modal-widget"); - widget.find(".widget-maximize,.widget-toggle").removeClass("nevershow"); - widget.draggable("destroy").resizable("destroy"); - }else{ - widget.removeClass("maximized"); - widget.find(".widget-maximize,.widget-toggle").addClass("nevershow"); - $("i",this).removeClass("icon-publish").addClass("icon-window"); - var w = widget.width(); - var h = widget.height(); - widget.addClass("modal-widget").removeAttr("style").width(w).height(h); - $(widget).draggable({ handle: ".widget-header",containment: ".content-page" }).css({"left":widget.position().left-2,"top":widget.position().top-2}).resizable({minHeight: 150,minWidth: 200}); - } - window.setTimeout(function () { - $("body").trigger("resize"); - },300); -}); - -$("a[data-app]").each(function(e){ - var app = $(this).data("app"); - var status = $(this).data("status"); - $("#"+app).data("is-app",true); - if(status == "inactive"){ - $("#"+app).hide(); - $(this).addClass("clickable"); - } -}); - -$(document).on("click", "a[data-app].clickable", function(event){ - event.preventDefault(); - $(this).removeClass("clickable"); - var app = $(this).data("app"); - $("#"+app).show(); - $("#"+app+" .widget-popout").click(); - topd = $("#"+app).offset().top - $(window).scrollTop(); - $("#"+app).css({"left":"10","top":-(topd-60)+"px"}).addClass("fadeInDown animated"); - window.setTimeout(function () { - $("#"+app).removeClass("fadeInDown animated"); - }, 300); -}); - -$(document).on("click", ".widget", function(){ - if($(this).hasClass("modal-widget")){ - $(".modal-widget").css("z-index",5); - $(this).css("z-index",6); - } -}); - -$(document).on("click", '.widget .reload', function (event) { - event.preventDefault(); - var el = $(this).parents(".widget:first"); - blockUI(el); - window.setTimeout(function () { - unblockUI(el); - }, 1000); -}); - -$(document).on("click", ".widget-header .widget-maximize", function(event){ - event.preventDefault(); - $(this).parents(".widget:first").removeAttr("style").toggleClass("maximized"); - $("i",this).toggleClass("icon-resize-full-1").toggleClass("icon-resize-small-1"); - $(this).parents(".widget:first").find(".widget-toggle").toggleClass("nevershow"); - $("body").trigger("resize"); - return false; -}); - -$( ".portlets" ).sortable({ - connectWith: ".portlets", - handle: ".widget-header", - cancel: ".modal-widget", - opacity: 0.5, - dropOnEmpty: true, - forcePlaceholderSize: true, - receive: function(event, ui) {$("body").trigger("resize")} -}); - -// Init Code Highlighter -prettyPrint(); - -//RUN RESIZE ITEMS -$(window).resize(debounce(resizeitems,100)); -$("body").trigger("resize"); - -//SELECT -$('.selectpicker').selectpicker(); - - -//FILE INPUT -$('input[type=file]').bootstrapFileInput(); - - -//DATE PICKER -$('.datepicker-input').datepicker(); - - -//ICHECK -$('input:not(.ios-switch)').iCheck({ - checkboxClass: 'icheckbox_square-aero', - radioClass: 'iradio_square-aero', - increaseArea: '20%' // optional -}); - -// IOS7 SWITCH -$(".ios-switch").each(function(){ - mySwitch = new Switch(this); -}); - -//GALLERY -$('.gallery-wrap').each(function() { // the containers for all your galleries - $(this).magnificPopup({ - delegate: 'a.zooming', // the selector for gallery item - type: 'image', - removalDelay: 300, - mainClass: 'mfp-fade', - gallery: { - enabled:true - } - }); -}); - - - -}); - -var debounce = function(func, wait, immediate) { - var timeout, result; - return function() { - var context = this, args = arguments; - var later = function() { - timeout = null; - if (!immediate) result = func.apply(context, args); - }; - var callNow = immediate && !timeout; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) result = func.apply(context, args); - return result; - }; -} - -function resizeitems(){ - if($.isArray(resizefunc)){ - for (i = 0; i < resizefunc.length; i++) { - window[resizefunc[i]](); - } - } -} - -function initscrolls(){ - if(jQuery.browser.mobile !== true){ - //SLIM SCROLL - $('.slimscroller').slimscroll({ - height: 'auto', - size: "5px" - }); - - $('.slimscrollleft').slimScroll({ - height: 'auto', - position: 'left', - size: "5px", - color: '#7A868F' - }); - } -} -function toggle_slimscroll(item){ - if($("#wrapper").hasClass("enlarged")){ - $(item).css("overflow","inherit").parent().css("overflow","inherit"); - $(item). siblings(".slimScrollBar").css("visibility","hidden"); - }else{ - $(item).css("overflow","hidden").parent().css("overflow","hidden"); - $(item). siblings(".slimScrollBar").css("visibility","visible"); - } -} - -function nifty_modal_alert(effect,header,text){ - - var randLetter = String.fromCharCode(65 + Math.floor(Math.random() * 26)); - var uniqid = randLetter + Date.now(); - - $modal = '
            '; - $modal += '
            '; - $modal += '

            '+header+'

            '; - $modal += '
            '+text; - $modal += '
            '; - $modal += '
            '; - $modal += '
            '; - - $("body").prepend($modal); - - window.setTimeout(function () { - $("#"+uniqid).addClass("md-show"); - $(".md-overlay,.md-close").click(function(){ - $("#"+uniqid).removeClass("md-show"); - window.setTimeout(function () {$("#"+uniqid).remove();},500); - }); - },100); - - return false; -} - -function blockUI(item) { - $(item).block({ - message: '
            ', - css: { - border: 'none', - width: '14px', - backgroundColor: 'none' - }, - overlayCSS: { - backgroundColor: '#fff', - opacity: 0.4, - cursor: 'wait' - } - }); -} - -function unblockUI(item) { - $(item).unblock(); -} - -function toggle_fullscreen(){ - var fullscreenEnabled = document.fullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled; - if(fullscreenEnabled){ - if(!document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement) { - launchIntoFullscreen(document.documentElement); - }else{ - exitFullscreen(); - } - } -} - - -// Thanks to http://davidwalsh.name/fullscreen - -function launchIntoFullscreen(element) { - if(element.requestFullscreen) { - element.requestFullscreen(); - } else if(element.mozRequestFullScreen) { - element.mozRequestFullScreen(); - } else if(element.webkitRequestFullscreen) { - element.webkitRequestFullscreen(); - } else if(element.msRequestFullscreen) { - element.msRequestFullscreen(); - } -} - -function exitFullscreen() { - if(document.exitFullscreen) { - document.exitFullscreen(); - } else if(document.mozCancelFullScreen) { - document.mozCancelFullScreen(); - } else if(document.webkitExitFullscreen) { - document.webkitExitFullscreen(); - } -} \ No newline at end of file diff --git a/public/admin/Coco/assets/js/pages/advanced-forms.js b/public/admin/Coco/assets/js/pages/advanced-forms.js deleted file mode 100644 index e32ee550c..000000000 --- a/public/admin/Coco/assets/js/pages/advanced-forms.js +++ /dev/null @@ -1,173 +0,0 @@ -$(function(){ - - $('#ckeditor').ckeditor({skin : 'bootstrapck'}); - - $.fn.editable.defaults.mode = 'inline'; - //defaults - $.fn.editable.defaults.url = '/post'; - - //enable / disable - $('#enable').click(function() { - $('#user .editable').editable('toggleDisabled'); - }); - - - - //editables - $('#username').editable({ - url: '/post', - type: 'text', - pk: 1, - name: 'username', - title: 'Enter username' - }); - - $('#firstname').editable({ - validate: function(value) { - if($.trim(value) == '') return 'This field is required'; - } - }); - - $('#sex').editable({ - prepend: "not selected", - source: [ - {value: 1, text: 'Male'}, - {value: 2, text: 'Female'} - ], - display: function(value, sourceData) { - var colors = {"": "gray", 1: "green", 2: "blue"}, - elem = $.grep(sourceData, function(o){return o.value == value;}); - - if(elem.length) { - $(this).text(elem[0].text).css("color", colors[value]); - } else { - $(this).empty(); - } - } - }); - - $('#status').editable(); - - $('#group').editable({ - showbuttons: false - }); - - $('#vacation').editable({ - datepicker: { - todayBtn: 'linked' - } - }); - - $('#dob').editable(); - - $('#event').editable({ - placement: 'right', - combodate: { - firstItem: 'name' - } - }); - - $('#meeting_start').editable({ - format: 'yyyy-mm-dd hh:ii', - viewformat: 'dd/mm/yyyy hh:ii', - validate: function(v) { - if(v && v.getDate() == 10) return 'Day cant be 10!'; - }, - datetimepicker: { - todayBtn: 'linked', - weekStart: 1 - } - }); - - $('#comments').editable({ - showbuttons: 'bottom' - }); - - $('#note').editable(); - $('#pencil').click(function(e) { - e.stopPropagation(); - e.preventDefault(); - $('#note').editable('toggle'); - }); - - $('#state').editable({ - source: ["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Dakota","North Carolina","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"] - }); - - $('#state2').editable({ - value: 'California', - typeahead: { - name: 'state', - local: ["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Dakota","North Carolina","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"] - } - }); - - $('#fruits').editable({ - pk: 1, - limit: 3, - source: [ - {value: 1, text: 'banana'}, - {value: 2, text: 'peach'}, - {value: 3, text: 'apple'}, - {value: 4, text: 'watermelon'}, - {value: 5, text: 'orange'} - ] - }); - - $('#tags').editable({ - inputclass: 'input-large', - select2: { - tags: ['html', 'javascript', 'css', 'ajax'], - tokenSeparators: [",", " "] - } - }); - - var countries = []; - $.each({"BD": "Bangladesh", "BE": "Belgium", "BF": "Burkina Faso", "BG": "Bulgaria", "BA": "Bosnia and Herzegovina", "BB": "Barbados", "WF": "Wallis and Futuna", "BL": "Saint Bartelemey", "BM": "Bermuda", "BN": "Brunei Darussalam", "BO": "Bolivia", "BH": "Bahrain", "BI": "Burundi", "BJ": "Benin", "BT": "Bhutan", "JM": "Jamaica", "BV": "Bouvet Island", "BW": "Botswana", "WS": "Samoa", "BR": "Brazil", "BS": "Bahamas", "JE": "Jersey", "BY": "Belarus", "O1": "Other Country", "LV": "Latvia", "RW": "Rwanda", "RS": "Serbia", "TL": "Timor-Leste", "RE": "Reunion", "LU": "Luxembourg", "TJ": "Tajikistan", "RO": "Romania", "PG": "Papua New Guinea", "GW": "Guinea-Bissau", "GU": "Guam", "GT": "Guatemala", "GS": "South Georgia and the South Sandwich Islands", "GR": "Greece", "GQ": "Equatorial Guinea", "GP": "Guadeloupe", "JP": "Japan", "GY": "Guyana", "GG": "Guernsey", "GF": "French Guiana", "GE": "Georgia", "GD": "Grenada", "GB": "United Kingdom", "GA": "Gabon", "SV": "El Salvador", "GN": "Guinea", "GM": "Gambia", "GL": "Greenland", "GI": "Gibraltar", "GH": "Ghana", "OM": "Oman", "TN": "Tunisia", "JO": "Jordan", "HR": "Croatia", "HT": "Haiti", "HU": "Hungary", "HK": "Hong Kong", "HN": "Honduras", "HM": "Heard Island and McDonald Islands", "VE": "Venezuela", "PR": "Puerto Rico", "PS": "Palestinian Territory", "PW": "Palau", "PT": "Portugal", "SJ": "Svalbard and Jan Mayen", "PY": "Paraguay", "IQ": "Iraq", "PA": "Panama", "PF": "French Polynesia", "BZ": "Belize", "PE": "Peru", "PK": "Pakistan", "PH": "Philippines", "PN": "Pitcairn", "TM": "Turkmenistan", "PL": "Poland", "PM": "Saint Pierre and Miquelon", "ZM": "Zambia", "EH": "Western Sahara", "RU": "Russian Federation", "EE": "Estonia", "EG": "Egypt", "TK": "Tokelau", "ZA": "South Africa", "EC": "Ecuador", "IT": "Italy", "VN": "Vietnam", "SB": "Solomon Islands", "EU": "Europe", "ET": "Ethiopia", "SO": "Somalia", "ZW": "Zimbabwe", "SA": "Saudi Arabia", "ES": "Spain", "ER": "Eritrea", "ME": "Montenegro", "MD": "Moldova, Republic of", "MG": "Madagascar", "MF": "Saint Martin", "MA": "Morocco", "MC": "Monaco", "UZ": "Uzbekistan", "MM": "Myanmar", "ML": "Mali", "MO": "Macao", "MN": "Mongolia", "MH": "Marshall Islands", "MK": "Macedonia", "MU": "Mauritius", "MT": "Malta", "MW": "Malawi", "MV": "Maldives", "MQ": "Martinique", "MP": "Northern Mariana Islands", "MS": "Montserrat", "MR": "Mauritania", "IM": "Isle of Man", "UG": "Uganda", "TZ": "Tanzania, United Republic of", "MY": "Malaysia", "MX": "Mexico", "IL": "Israel", "FR": "France", "IO": "British Indian Ocean Territory", "FX": "France, Metropolitan", "SH": "Saint Helena", "FI": "Finland", "FJ": "Fiji", "FK": "Falkland Islands (Malvinas)", "FM": "Micronesia, Federated States of", "FO": "Faroe Islands", "NI": "Nicaragua", "NL": "Netherlands", "NO": "Norway", "NA": "Namibia", "VU": "Vanuatu", "NC": "New Caledonia", "NE": "Niger", "NF": "Norfolk Island", "NG": "Nigeria", "NZ": "New Zealand", "NP": "Nepal", "NR": "Nauru", "NU": "Niue", "CK": "Cook Islands", "CI": "Cote d'Ivoire", "CH": "Switzerland", "CO": "Colombia", "CN": "China", "CM": "Cameroon", "CL": "Chile", "CC": "Cocos (Keeling) Islands", "CA": "Canada", "CG": "Congo", "CF": "Central African Republic", "CD": "Congo, The Democratic Republic of the", "CZ": "Czech Republic", "CY": "Cyprus", "CX": "Christmas Island", "CR": "Costa Rica", "CV": "Cape Verde", "CU": "Cuba", "SZ": "Swaziland", "SY": "Syrian Arab Republic", "KG": "Kyrgyzstan", "KE": "Kenya", "SR": "Suriname", "KI": "Kiribati", "KH": "Cambodia", "KN": "Saint Kitts and Nevis", "KM": "Comoros", "ST": "Sao Tome and Principe", "SK": "Slovakia", "KR": "Korea, Republic of", "SI": "Slovenia", "KP": "Korea, Democratic People's Republic of", "KW": "Kuwait", "SN": "Senegal", "SM": "San Marino", "SL": "Sierra Leone", "SC": "Seychelles", "KZ": "Kazakhstan", "KY": "Cayman Islands", "SG": "Singapore", "SE": "Sweden", "SD": "Sudan", "DO": "Dominican Republic", "DM": "Dominica", "DJ": "Djibouti", "DK": "Denmark", "VG": "Virgin Islands, British", "DE": "Germany", "YE": "Yemen", "DZ": "Algeria", "US": "United States", "UY": "Uruguay", "YT": "Mayotte", "UM": "United States Minor Outlying Islands", "LB": "Lebanon", "LC": "Saint Lucia", "LA": "Lao People's Democratic Republic", "TV": "Tuvalu", "TW": "Taiwan", "TT": "Trinidad and Tobago", "TR": "Turkey", "LK": "Sri Lanka", "LI": "Liechtenstein", "A1": "Anonymous Proxy", "TO": "Tonga", "LT": "Lithuania", "A2": "Satellite Provider", "LR": "Liberia", "LS": "Lesotho", "TH": "Thailand", "TF": "French Southern Territories", "TG": "Togo", "TD": "Chad", "TC": "Turks and Caicos Islands", "LY": "Libyan Arab Jamahiriya", "VA": "Holy See (Vatican City State)", "VC": "Saint Vincent and the Grenadines", "AE": "United Arab Emirates", "AD": "Andorra", "AG": "Antigua and Barbuda", "AF": "Afghanistan", "AI": "Anguilla", "VI": "Virgin Islands, U.S.", "IS": "Iceland", "IR": "Iran, Islamic Republic of", "AM": "Armenia", "AL": "Albania", "AO": "Angola", "AN": "Netherlands Antilles", "AQ": "Antarctica", "AP": "Asia/Pacific Region", "AS": "American Samoa", "AR": "Argentina", "AU": "Australia", "AT": "Austria", "AW": "Aruba", "IN": "India", "AX": "Aland Islands", "AZ": "Azerbaijan", "IE": "Ireland", "ID": "Indonesia", "UA": "Ukraine", "QA": "Qatar", "MZ": "Mozambique"}, function(k, v) { - countries.push({id: k, text: v}); - }); - $('#country').editable({ - source: countries, - select2: { - width: 200, - placeholder: 'Select country', - allowClear: true - } - }); - - - - $('#address').editable({ - url: '/post', - value: { - city: "Moscow", - street: "Lenina", - building: "12" - }, - validate: function(value) { - if(value.city == '') return 'city is required!'; - }, - display: function(value) { - if(!value) { - $(this).empty(); - return; - } - var html = '' + $('
            ').text(value.city).html() + ', ' + $('
            ').text(value.street).html() + ' st., bld. ' + $('
            ').text(value.building).html(); - $(this).html(html); - } - }); - - $('#user .editable').on('hidden', function(e, reason){ - if(reason === 'save' || reason === 'nochange') { - var $next = $(this).closest('tr').next().find('.editable'); - if($('#autoopen').is(':checked')) { - setTimeout(function() { - $next.editable('show'); - }, 300); - } else { - $next.focus(); - } - } - }); - -}); \ No newline at end of file diff --git a/public/admin/Coco/assets/js/pages/calendar.js b/public/admin/Coco/assets/js/pages/calendar.js deleted file mode 100644 index 4c11c17a1..000000000 --- a/public/admin/Coco/assets/js/pages/calendar.js +++ /dev/null @@ -1,126 +0,0 @@ -$(function () { - - function runCalendar() { - var $modal = $('#event-modal'); - $('#draggable-events div.draggable-event').each(function () { - // create an Event Object (http://arshaw.com/fullcalendar/docs/event_data/Event_Object/) - // it doesn't need to have a start or end - var eventObject = { - title: $.trim($(this).text()) // use the element's text as the event title - }; - // store the Event Object in the DOM element so we can get to it later - $(this).data('eventObject', eventObject); - // make the event draggable using jQuery UI - $(this).draggable({ - zIndex: 999, - revert: true, // will cause the event to go back to its - revertDuration: 20 // original position after the drag - }); - }); - /* Initialize the calendar */ - var date = new Date(); - var d = date.getDate(); - var m = date.getMonth(); - var y = date.getFullYear(); - var form = ''; - var calendar = $('#calendar').fullCalendar({ - slotDuration: '00:15:00', /* If we want to split day time each 15minutes */ - minTime: '08:00:00', - maxTime: '19:00:00', - header: { - left: 'prev,next today', - center: 'title', - right: 'month,agendaWeek,agendaDay' - }, - events: [{ - title: 'Take your pills!', - start: new Date(y, m, 2), - className: 'bg-darkblue-2' - }, { - title: 'Visit Doctor', - start: '2014-05-15 14:00:00', - start: '2014-05-15 15:00:00', - className: 'bg-red-1' - }], - editable: true, - droppable: true, // this allows things to be dropped onto the calendar !!! - drop: function (date, allDay) { // this function is called when something is dropped - // retrieve the dropped element's stored Event Object - var originalEventObject = $(this).data('eventObject'); - var $categoryClass = $(this).attr('data-class'); - // we need to copy it, so that multiple events don't have a reference to the same object - var copiedEventObject = $.extend({}, originalEventObject); - // assign it the date that was reported - copiedEventObject.start = date; - copiedEventObject.allDay = allDay; - if ($categoryClass) - copiedEventObject['className'] = [$categoryClass]; - // render the event on the calendar - // the last `true` argument determines if the event "sticks" (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/) - $('#calendar').fullCalendar('renderEvent', copiedEventObject, true); - // is the "remove after drop" checkbox checked? - if ($('#drop-remove').is(':checked')) { - // if so, remove the element from the "Draggable Events" list - $(this).remove(); - } - }, - - selectable: true, - eventClick: function (calEvent, jsEvent, view) { - var form = $("
            "); - form.append(""); - form.append("
            "); - $modal.modal({ - backdrop: 'static' - }); - $modal.find('.delete-event').show().end().find('.save-event').hide().end().find('.modal-body').empty().prepend(form).end().find('.delete-event').unbind('click').click(function () { - calendar.fullCalendar('removeEvents', function (ev) { - return (ev._id == calEvent._id); - }); - $modal.modal('hide'); - }); - $modal.find('form').on('submit', function () { - calEvent.title = form.find("input[type=text]").val(); - calendar.fullCalendar('updateEvent', calEvent); - $modal.modal('hide'); - return false; - }); - }, - select: function (start, end, allDay) { - $modal.modal({ - backdrop: 'static' - }); - form = $("
            "); - form.append("
            "); - form.find(".row").append("
            ").append("
            ").find("select[name='category']").append("") - .append("").append("").append("").append("").append(""); - $modal.find('.delete-event').hide().end().find('.save-event').show().end().find('.modal-body').empty().prepend(form).end().find('.save-event').unbind('click').click(function () { - form.submit(); - }); - $modal.find('form').on('submit', function () { - title = form.find("input[name='title']").val(); - $categoryClass = form.find("select[name='category'] option:checked").val(); - if (title !== null && title.length != 0) { - calendar.fullCalendar('renderEvent', { - title: title, - start: start, - end: end, - allDay: false, - className: $categoryClass - }, true); - } - else{ - alert('You need a title for the event!'); - } - $modal.modal('hide'); - return false; - }); - calendar.fullCalendar('unselect'); - } - - }); - } - - runCalendar(); - -}); \ No newline at end of file diff --git a/public/admin/Coco/assets/js/pages/datatables.js b/public/admin/Coco/assets/js/pages/datatables.js deleted file mode 100644 index 36f7eea45..000000000 --- a/public/admin/Coco/assets/js/pages/datatables.js +++ /dev/null @@ -1,60 +0,0 @@ -$(function(){ - $("#datatables-1").dataTable(); - - var table = $('#datatables-2').DataTable(); - - $("#datatables-2 tfoot th").each( function ( i ) { - var select = $('') - .appendTo( $(this).empty() ) - .on( 'change', function () { - table.column( i ) - .search( '^'+$(this).val()+'$', true, false ) - .draw(); - } ); - - table.column( i ).data().unique().sort().each( function ( d, j ) { - select.append( '' ) - } ); - } ); - - $('#datatables-3').dataTable( { - "footerCallback": function ( row, data, start, end, display ) { - var api = this.api(), data; - - // Remove the formatting to get integer data for summation - var intVal = function ( i ) { - return typeof i === 'string' ? - i.replace(/[\$,]/g, '')*1 : - typeof i === 'number' ? - i : 0; - }; - - // Total over all pages - data = api.column( 4 ).data(); - total = data.length ? - data.reduce( function (a, b) { - return intVal(a) + intVal(b); - } ) : - 0; - - // Total over this page - data = api.column( 4, { page: 'current'} ).data(); - pageTotal = data.length ? - data.reduce( function (a, b) { - return intVal(a) + intVal(b); - } ) : - 0; - - // Update footer - $( api.column( 4 ).footer() ).html( - '$'+pageTotal +' ( $'+ total +' total)' - ); - } - } ); - $('#datatables-4').DataTable( { - dom: 'T<"clear">lfrtip', - tableTools: { - "sSwfPath": "./assets/libs/jquery-datatables/extensions/TableTools/swf/copy_csv_xls_pdf.swf" - } - } ); -}) \ No newline at end of file diff --git a/public/admin/Coco/assets/js/pages/form-validation.js b/public/admin/Coco/assets/js/pages/form-validation.js deleted file mode 100644 index b75184b9a..000000000 --- a/public/admin/Coco/assets/js/pages/form-validation.js +++ /dev/null @@ -1,290 +0,0 @@ -$(document).ready(function() { - // Generate a simple captcha - function randomNumber(min, max) { - return Math.floor(Math.random() * (max - min + 1) + min); - }; - $('#captchaOperation').html([randomNumber(1, 20), '+', randomNumber(1, 30), '='].join(' ')); - - - //EXAMPLE REGISTER FORM - $('#registerForm').bootstrapValidator({ - message: 'This value is not valid', - fields: { - username: { - message: 'The username is not valid', - validators: { - notEmpty: { - message: 'The username is required and can\'t be empty' - }, - stringLength: { - min: 6, - max: 30, - message: 'The username must be more than 6 and less than 30 characters long' - }, - regexp: { - regexp: /^[a-zA-Z0-9_\.]+$/, - message: 'The username can only consist of alphabetical, number, dot and underscore' - }, - different: { - field: 'password', - message: 'The username and password can\'t be the same as each other' - } - } - }, - email: { - validators: { - notEmpty: { - message: 'The email address is required and can\'t be empty' - }, - emailAddress: { - message: 'The input is not a valid email address' - } - } - }, - password: { - validators: { - notEmpty: { - message: 'The password is required and can\'t be empty' - }, - identical: { - field: 'confirmPassword', - message: 'The password and its confirm are not the same' - }, - different: { - field: 'username', - message: 'The password can\'t be the same as username' - } - } - }, - confirmPassword: { - validators: { - notEmpty: { - message: 'The confirm password is required and can\'t be empty' - }, - identical: { - field: 'password', - message: 'The password and its confirm are not the same' - }, - different: { - field: 'username', - message: 'The password can\'t be the same as username' - } - } - }, - phoneNumber: { - validators: { - digits: { - message: 'The value can contain only digits' - } - } - }, - acceptTerms: { - validators: { - notEmpty: { - message: 'You have to accept the terms and policies' - } - } - }, - captcha: { - validators: { - callback: { - message: 'Wrong answer', - callback: function(value, validator) { - var items = $('#captchaOperation').html().split(' '), sum = parseInt(items[0]) + parseInt(items[2]); - return value == sum; - } - } - } - } - } - }); - - - //EXAMPLE CONTACT FORM - $('#contactForm').bootstrapValidator({ - message: 'This value is not valid', - fields: { - name: { - message: 'Name is not valid', - validators: { - notEmpty: { - message: 'Name is required and can\'t be empty' - }, - regexp: { - regexp: /^[a-zA-Z0-9_\.]+$/, - message: 'Name can only consist of alphabetical, number, dot and underscore' - } - } - }, - email: { - validators: { - notEmpty: { - message: 'The email address is required and can\'t be empty' - }, - emailAddress: { - message: 'The input is not a valid email address' - } - } - }, - website: { - validators: { - uri: { - message: 'The input is not a valid URL' - } - } - }, - Contactmessage: { - validators: { - notEmpty: { - message: 'Message is required and can\'t be empty' - }, - stringLength: { - min: 6, - message: 'Message must be more than 6 characters long' - } - } - }, - captcha: { - validators: { - callback: { - message: 'Wrong answer', - callback: function(value, validator) { - var items = $('#captchaOperation').html().split(' '), sum = parseInt(items[0]) + parseInt(items[2]); - return value == sum; - } - } - } - } - } - }); - - - //Regular expression based validators - $('#ExpressionValidator').bootstrapValidator({ - message: 'This value is not valid', - fields: { - email: { - validators: { - notEmpty: { - message: 'The email address is required and can\'t be empty' - }, - emailAddress: { - message: 'The input is not a valid email address' - } - } - }, - website: { - validators: { - uri: { - message: 'The input is not a valid URL' - } - } - }, - phoneNumber: { - validators: { - digits: { - message: 'The value can contain only digits' - } - } - }, - color: { - validators: { - hexColor: { - message: 'The input is not a valid hex color' - } - } - }, - zipCode: { - validators: { - usZipCode: { - message: 'The input is not a valid US zip code' - } - } - } - } - }); - - - //Regular expression based validators - $('#NotEmptyValidator').bootstrapValidator({ - message: 'This value is not valid', - fields: { - username: { - message: 'The username is not valid', - validators: { - notEmpty: { - message: 'The username is required and can\'t be empty' - }, - stringLength: { - min: 6, - max: 30, - message: 'The username must be more than 6 and less than 30 characters long' - }, - regexp: { - regexp: /^[a-zA-Z0-9_\.]+$/, - message: 'The username can only consist of alphabetical, number, dot and underscore' - } - } - }, - country: { - validators: { - notEmpty: { - message: 'The country is required and can\'t be empty' - } - } - } - } - }); - - - //Regular expression based validators - $('#IdenticalValidator').bootstrapValidator({ - message: 'This value is not valid', - fields: { - password: { - validators: { - notEmpty: { - message: 'The password is required and can\'t be empty' - }, - identical: { - field: 'confirmPassword', - message: 'The password and its confirm are not the same' - } - } - }, - confirmPassword: { - validators: { - notEmpty: { - message: 'The confirm password is required and can\'t be empty' - }, - identical: { - field: 'password', - message: 'The password and its confirm are not the same' - } - } - } - } - }); - - //Regular expression based validators - $('#OtherValidator').bootstrapValidator({ - message: 'This value is not valid', - fields: { - ages: { - validators: { - lessThan: { - value: 100, - inclusive: true, - message: 'The ages has to be less than 100' - }, - greaterThan: { - value: 10, - inclusive: false, - message: 'The ages has to be greater than or equals to 10' - } - } - } - } - }); - -}); \ No newline at end of file diff --git a/public/admin/Coco/assets/js/pages/form-wizard.js b/public/admin/Coco/assets/js/pages/form-wizard.js deleted file mode 100644 index 81f1880d5..000000000 --- a/public/admin/Coco/assets/js/pages/form-wizard.js +++ /dev/null @@ -1,6 +0,0 @@ -$(function() { - $('#myWizard').easyWizard({ - buttonsClass: 'btn btn-default', - submitButtonClass: 'btn btn-primary' - }); -}); \ No newline at end of file diff --git a/public/admin/Coco/assets/js/pages/forms.js b/public/admin/Coco/assets/js/pages/forms.js deleted file mode 100644 index 1a3672ddc..000000000 --- a/public/admin/Coco/assets/js/pages/forms.js +++ /dev/null @@ -1,5 +0,0 @@ -$(function() { - $('.summernote').summernote({ - height: 500 - }); -}); \ No newline at end of file diff --git a/public/admin/Coco/assets/js/pages/google-maps.js b/public/admin/Coco/assets/js/pages/google-maps.js deleted file mode 100644 index 8cb87bad8..000000000 --- a/public/admin/Coco/assets/js/pages/google-maps.js +++ /dev/null @@ -1,168 +0,0 @@ -$(function(){ - - $("#gmap-1").gmap3({ - marker:{ - latLng: [46.578498,2.457275], - options:{ - draggable:true - }, - events:{ - dragend: function(marker){ - $(this).gmap3({ - getaddress:{ - latLng:marker.getPosition(), - callback:function(results){ - var map = $(this).gmap3("get"), - infowindow = $(this).gmap3({get:"infowindow"}), - content = results && results[1] ? results && results[1].formatted_address : "no address"; - if (infowindow){ - infowindow.open(map, marker); - infowindow.setContent(content); - } else { - $(this).gmap3({ - infowindow:{ - anchor:marker, - options:{content: content} - } - }); - } - } - } - }); - } - } - }, - map:{ - options:{ - zoom: 5 - } - } - }); - - $("#gmap-2").gmap3({ - map:{ - options:{ - center:[46.578498,2.457275], - zoom: 4, - mapTypeId: google.maps.MapTypeId.TERRAIN - } - }, - marker:{ - values: [ - [49.28952958093682, 6.152559438984804], - { - latLng:[44.28952958093682, 6.152559438984804], - options:{ - icon: "http://maps.google.com/mapfiles/marker_green.png" - } - }, - [49.28952958093682, -1.1501188139848408], - { - latLng:[44.28952958093682, -1.1501188139848408], - events:{ - click:function(){ - alert("I'm the last one, and i have my own click event"); - } - } - } - ], - events:{ // events trigged by markers - click: function(){ - alert("Here is the default click event"); - } - }, - cluster:{ - radius: 100, - 0: { - content: "
            CLUSTER_COUNT
            ", - width: 53, - height: 52 - }, - 20: { - content: "
            CLUSTER_COUNT
            ", - width: 56, - height: 55 - }, - 50: { - content: "
            CLUSTER_COUNT
            ", - width: 66, - height: 65 - } - } - } - }); - - var fenway = new google.maps.LatLng(42.345573,-71.098326); - $("#gmap-3").gmap3({ - map:{ - options:{ - zoom: 14, - mapTypeId: google.maps.MapTypeId.ROADMAP, - streetViewControl: true, - center: fenway - } - }, - streetviewpanorama:{ - options:{ - container: $("#gmap-4"), - opts:{ - position: fenway, - pov: { - heading: 34, - pitch: 10, - zoom: 1 - } - } - } - } - }); - - $("#gmap-5").gmap3({ - map:{ - address:"ISTABBUL, TURKEY", - options:{ - zoom:4, - mapTypeId: google.maps.MapTypeId.SATELLITE, - mapTypeControl: true, - mapTypeControlOptions: { - style: google.maps.MapTypeControlStyle.DROPDOWN_MENU - }, - navigationControl: true, - scrollwheel: true, - streetViewControl: true - } - } - }); - - $("#gmap-6").gmap3({ - map:{ - options:{ - center:[33, -111], - zoom:10, - mapTypeControlOptions: { - mapTypeIds: [google.maps.MapTypeId.ROADMAP, - google.maps.MapTypeId.SATELLITE, - google.maps.MapTypeId.HYBRID, - google.maps.MapTypeId.TERRAIN, - "sectional"] - } - } - }, - imagemaptype:{ - id: "sectional", - options:{ - getTileUrl: function(coord, zoom) { - return "http://www.fourpeaksnavigation.com/sectionals/phx" + "/" + zoom + "/" + coord.x + "/" + coord.y + ".png"; - }, - tileSize: new google.maps.Size(256, 256), - isPng: true, - name: "Chart", - minZoom: 1, - maxZoom: 111 - }, - callback: function(){ - $(this).gmap3("get").setMapTypeId("sectional"); - } - } - }); -}); \ No newline at end of file diff --git a/public/admin/Coco/assets/js/pages/index.js b/public/admin/Coco/assets/js/pages/index.js deleted file mode 100644 index 2ddde98dd..000000000 --- a/public/admin/Coco/assets/js/pages/index.js +++ /dev/null @@ -1,373 +0,0 @@ -var timer; -var graph; -var graph2; - -$(document).ready(function(){ - $(".dial").knob(); - var cityAreaData = [ - 500.70, - 410.16, - 210.69, - 120.17, - 64.31, - 150.35, - 130.22, - 120.71, - 300.32 - ] - $('#vector-map').vectorMap({ - map: 'us_aea_en', - normalizeFunction: 'polynomial', - zoomOnScroll:true, - focusOn:{ - x: 0, - y: 0, - scale: 0.9 - }, - zoomMin:0.9, - hoverColor: false, - regionStyle:{ - initial: { - fill: '#bbbbbb', - "fill-opacity": 1, - stroke: '#a5ded9', - "stroke-width": 0, - "stroke-opacity": 0 - }, - hover: { - "fill-opacity": 0.8 - } - }, - markerStyle: { - initial: { - fill: '#F57A82', - stroke: 'rgba(230,140,110,.8)', - "fill-opacity": 1, - "stroke-width": 9, - "stroke-opacity": 0.5, - r: 3 - }, - hover: { - stroke: 'black', - "stroke-width": 2 - }, - selected: { - fill: 'blue' - }, - selectedHover: { - } - }, - backgroundColor: '#ffffff', - markers :[ - - {latLng: [35.85, -77.88], name: 'Rocky Mt,NC'}, - {latLng: [32.90, -97.03], name: 'Dallas/FW,TX'}, - {latLng: [39.37, -75.07], name: 'Millville,NJ'} - - ], - series: { - markers: [{ - attribute: 'r', - scale: [3, 7], - values: cityAreaData - }] - } - }); - if ("geolocation" in navigator) { - $('.js-geolocation').show(); - } else { - $('.js-geolocation').hide(); - } - - /* Where in the world are you? */ - $(document).on('click', '.js-geolocation', function() { - navigator.geolocation.getCurrentPosition(function(position) { - loadWeather(position.coords.latitude+','+position.coords.longitude); //load weather using your lat/lng coordinates - }); - }); - - resizefunc.push("reload_charts"); - //$(".content-page").resize(debounce(reload_charts,100)); - - load_charts(); - loadWeather('Seattle',''); - monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; - dayNames = ["S", "M", "T", "W", "T", "F", "S"]; - - var cTime = new Date(), month = cTime.getMonth()+1, year = cTime.getFullYear(); - - var events = [ - { - "date": "4/"+month+"/"+year, - "title": 'Meet a friend', - "link": 'javascript:;', - "color": 'rgba(255,255,255,0.2)', - "content": 'Contents here' - }, - { - "date": "7/"+month+"/"+year, - "title": 'Kick off meeting!', - "link": 'javascript:;', - "color": 'rgba(255,255,255,0.2)', - "content": 'Have a kick off meeting with .inc company' - }, - { - "date": "19/"+month+"/"+year, - "title": 'Link to Google', - "link": 'http://www.google.com', - "color": 'rgba(255,255,255,0.2)', - } - ]; - - $('#calendar-box2').bic_calendar({ - events: events, - dayNames: dayNames, - monthNames: monthNames, - showDays: true, - displayMonthController: true, - displayYearController: false, - popoverOptions:{ - placement: 'top', - trigger: 'hover', - html: true - }, - tooltipOptions:{ - placement: 'top', - html: true - } - }); -}); - -function loadWeather(location, woeid) { - $.simpleWeather({ - location: location, - woeid: woeid, - unit: 'c', - success: function(weather) { - html = '

            '+weather.temp+'°'+weather.units.temp+' / '+weather.tempAlt+'°F

            '; - html += ''+weather.city+', '+weather.region+''; - html += ''+weather.currently+''; - html += ''; - - $("#weather").html(html); - }, - error: function(error) { - $("#weather").html('

            '+error+'

            '); - } - }); -} - -function reload_charts(){ - graph.configure({ - width: $("#home-chart-3").width() - }); - graph.render(); - - graph2.configure({ - width: $("#home-chart-2").width() - }); - graph2.render(); - window.morris1.redraw(); - window.morris2.redraw(); -} - -function load_charts(){ - //MORRIS - - window.morris1 = Morris.Bar({ - element: 'morris-bar-home', - data: [ - { y: 'Indonesia', a: 952}, - { y: 'India', a: 985}, - { y: 'Malaysia', a: 955}, - { y: 'China', a: 785 }, - { y: 'Philipina', a: 700 }, - { y: 'Autralia', a: 601 }, - { y: 'United Kingdom', a: 421 }, - { y: 'United States', a: 725 }, - { y: 'Taiwan', a: 350 }, - { y: 'New Zealand', a: 120 }, - { y: 'Singapore', a: 124} - ], - xkey: 'y', - ykeys: ['a'], - redraw: true, - labels: ['Visitor'], - resize: true, - barColors: ['#45B29D'], - gridTextColor: ['#777'], - gridTextSize: 11, - hideHover: 'auto', - grid :false - }); - - //MORRIS - window.morris2 = Morris.Area({ - element: 'morris-home', - padding: 10, - behaveLikeLine: true, - gridEnabled: false, - gridLineColor: '#dddddd', - axes: true, - resize: true, - smooth:true, - pointSize: 0, - lineWidth: 0, - fillOpacity:0.85, - data: [ - {period: '2010 Q1', iphone: 4666, ipad: 3666, itouch: 2666}, - {period: '2010 Q2', iphone: 4441, ipad: 3441, itouch: 2441}, - {period: '2010 Q3', iphone: 6501, ipad: 4501, itouch: 2501}, - {period: '2010 Q4', iphone: 7689, ipad: 6689, itouch: 5689}, - {period: '2011 Q1', iphone: 4293, ipad: 3293, itouch: 2293}, - {period: '2011 Q2', iphone: 5881, ipad: 3881, itouch: 1881}, - {period: '2011 Q3', iphone: 5588, ipad: 3588, itouch: 1588}, - {period: '2011 Q4', iphone: 15073, ipad: 8967, itouch: 5175}, - {period: '2012 Q1', iphone: 10687, ipad: 4460, itouch: 2028}, - {period: '2012 Q2', iphone: 12432, ipad: 5713, itouch: 3791} - ], - lineColors:['#869d9d','#EFC94C','#45B29D'], - xkey: 'period', - redraw: true, - ykeys: ['iphone', 'ipad', 'itouch'], - labels: ['All Visitors', 'Returning Visitors', 'Unique Visitors'], - hideHover: 'auto' - - }); - /* - Morris.Donut({ - element: 'morris-donut', - data: [ - {label: "Download Sales", value: 12}, - {label: "In-Store Sales", value: 30}, - {label: "Mail-Order Sales", value: 20} - ] - }); - */ - var seriesData = [ [], [], []]; - var random = new Rickshaw.Fixtures.RandomData(50); - - for (var i = 0; i < 40; i++) { - random.addData(seriesData); - } - - graph = new Rickshaw.Graph( { - element: document.querySelector("#home-chart-3"), - height: 150, - renderer: 'line', - interpolation: 'linear', - series: [ - { - data: seriesData[0], - color: 'rgba(0,0,0,0.4)', - name:'S&P' - },{ - data: seriesData[1], - color: 'rgba(0,0,0,0.3)', - name:'Dow jones' - },{ - data: seriesData[2], - color: 'rgba(0,0,0,0.2)', - name:'Nasdaq' - } - ] - } ); - var hoverDetail = new Rickshaw.Graph.HoverDetail({ - graph: graph - }); - - graph.render(); - - setInterval( function() { - random.removeData(seriesData); - random.addData(seriesData); - for (lastitem in seriesData[0]); - var cur = parseInt($("#sp-status").text()); - - if(cur > seriesData[0][lastitem].y.toFixed(2)){ - $("#sp-status").addClass("text-danger").html(" "+seriesData[0][lastitem].y.toFixed(2)); - }else{ - $("#sp-status").removeClass("text-danger").html(" "+seriesData[0][lastitem].y.toFixed(2)); - } - for (lastitem in seriesData[1]); - var cur = parseInt($("#dow-status").text()); - - if(cur > seriesData[1][lastitem].y.toFixed(2)){ - $("#dow-status").addClass("text-danger").html(" "+seriesData[1][lastitem].y.toFixed(2)); - }else{ - $("#dow-status").removeClass("text-danger").html(" "+seriesData[1][lastitem].y.toFixed(2)); - } - for (lastitem in seriesData[2]); - var cur = parseInt($("#nasdaq-status").text()); - - if(cur > seriesData[2][lastitem].y.toFixed(2)){ - $("#nasdaq-status").addClass("text-danger").html(" "+seriesData[2][lastitem].y.toFixed(2)); - }else{ - $("#nasdaq-status").removeClass("text-danger").html(" "+seriesData[2][lastitem].y.toFixed(2)); - } - graph.update(); - - },5000); - - var seriesData2 = [ [], []]; - var random2 = new Rickshaw.Fixtures.RandomData(50); - - for (var i = 0; i < 50; i++) { - random2.addData(seriesData2); - } - graph2 = new Rickshaw.Graph( { - element: document.querySelector("#home-chart-2"), - height: 150, - interpolation: 'linear', - renderer: 'area', - series: [ - { - data: seriesData2[0], - color: 'rgba(255,255,255,0.3)', - name:'Web Server' - },{ - data: seriesData2[1], - color: 'rgba(255,255,255,0.1)', - name:'Database Server' - } - ] - } ); - var hoverDetail = new Rickshaw.Graph.HoverDetail( { - graph: graph2 - }); - - graph2.render(); - clearInterval(timer); - timer = setInterval( function() { - random2.removeData(seriesData2); - random2.addData(seriesData2); - for (lastitem in seriesData2[0]); - $('.ws-load').data('easyPieChart').update(seriesData2[0][lastitem].y); - //for (lastitem in seriesData2[1]); - //$('.ds-load').data('easyPieChart').update(seriesData2[1][lastitem].y); - graph2.update(); - - },2000); - - $('.ws-load').easyPieChart({ - animate: 1000, - trackColor: "rgba(0,0,0,0.1)", - barColor: "#68C39F", - scaleColor: false, - size: 90, - onStep: function(from, to, percent) { - $(this.el).find('.percent').text(Math.round(percent)); - } - }); - /*$('.ds-load').easyPieChart({ - animate: 1000, - scaleColor: false, - trackColor: "rgba(0,0,0,0.1)", - barColor: "#68C39F", - size: 50, - onStep: function(from, to, percent) { - $(this.el).find('.percent').text(Math.round(percent)); - } - });*/ -} -//http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20csv%20where%20url%3D%27http%3A%2F%2Fdownload.finance.yahoo.com%2Fd%2Fquotes.csv%3Fs%3dDOW%2CNASDAQ%2CSP%26f%3Dsl1d1t1c1ohgv%26e%3D.csv%27%20and%20columns%3D%27symbol%2Cprice%2Cdate%2Ctime%2Cchange%2Ccol1%2Chigh%2Clow%2Ccol2%27&format=json&diagnostics=true&callback= \ No newline at end of file diff --git a/public/admin/Coco/assets/js/pages/index2.js b/public/admin/Coco/assets/js/pages/index2.js deleted file mode 100644 index ab396c6c5..000000000 --- a/public/admin/Coco/assets/js/pages/index2.js +++ /dev/null @@ -1,378 +0,0 @@ -var timer; -var graph; -var graph2; - -$(document).ready(function(){ - $(".dial").knob(); - var cityAreaData = [ - 500.70, - 410.16, - 210.69, - 120.17, - 64.31, - 150.35, - 130.22, - 120.71, - 300.32 - ] - $('#vector-map').vectorMap({ - map: 'world_mill_en', - normalizeFunction: 'polynomial', - zoomOnScroll:true, - focusOn:{ - x: 0, - y: 0, - scale: 0.9 - }, - zoomMin:0.9, - hoverColor: false, - regionStyle:{ - initial: { - fill: '#bbbbbb', - "fill-opacity": 1, - stroke: '#a5ded9', - "stroke-width": 0, - "stroke-opacity": 0 - }, - hover: { - "fill-opacity": 0.8 - } - }, - markerStyle: { - initial: { - fill: '#F57A82', - stroke: 'rgba(230,140,110,.8)', - "fill-opacity": 1, - "stroke-width": 9, - "stroke-opacity": 0.5, - r: 3 - }, - hover: { - stroke: 'black', - "stroke-width": 2 - }, - selected: { - fill: 'blue' - }, - selectedHover: { - } - }, - backgroundColor: '#ffffff', - markers :[ - - {latLng: [35.85, -77.88], name: 'Rocky Mt,NC'}, - {latLng: [32.90, -97.03], name: 'Dallas/FW,TX'}, - {latLng: [41.00, 28.96], name: 'Istanbul, TR'}, - {latLng: [39.37, -75.07], name: 'Millville,NJ'} - - ], - series: { - markers: [{ - attribute: 'r', - scale: [3, 7], - values: cityAreaData - }] - } - }); - if ("geolocation" in navigator) { - $('.js-geolocation').show(); - } else { - $('.js-geolocation').hide(); - } - - /* Where in the world are you? */ - $(document).on('click', '.js-geolocation', function() { - navigator.geolocation.getCurrentPosition(function(position) { - loadWeather(position.coords.latitude+','+position.coords.longitude); //load weather using your lat/lng coordinates - }); - }); - - resizefunc.push("reload_charts"); - //$(".content-page").resize(debounce(reload_charts,100)); - - load_charts(); - loadWeather('Seattle',''); - monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; - dayNames = ["S", "M", "T", "W", "T", "F", "S"]; - - var cTime = new Date(), month = cTime.getMonth()+1, year = cTime.getFullYear(); - - var events = [ - { - "date": "4/"+month+"/"+year, - "title": 'Meet a friend', - "link": 'javascript:;', - "color": 'rgba(255,255,255,0.2)', - "content": 'Contents here' - }, - { - "date": "7/"+month+"/"+year, - "title": 'Kick off meeting!', - "link": 'javascript:;', - "color": 'rgba(255,255,255,0.2)', - "content": 'Have a kick off meeting with .inc company' - }, - { - "date": "19/"+month+"/"+year, - "title": 'Link to Google', - "link": 'http://www.google.com', - "color": 'rgba(255,255,255,0.2)', - } - ]; - - $('#calendar-box2').bic_calendar({ - events: events, - dayNames: dayNames, - monthNames: monthNames, - showDays: true, - displayMonthController: true, - displayYearController: false, - popoverOptions:{ - placement: 'top', - trigger: 'hover', - html: true - }, - tooltipOptions:{ - placement: 'top', - html: true - } - }); -}); - -function loadWeather(location, woeid) { - $.simpleWeather({ - location: location, - woeid: woeid, - unit: 'c', - success: function(weather) { - html = '

            '+weather.temp+'°'+weather.units.temp+' / '+weather.tempAlt+'°F

            '; - html += ''+weather.city+', '+weather.region+''; - html += ''+weather.currently+''; - html += ''; - - $("#weather").html(html); - }, - error: function(error) { - $("#weather").html('

            '+error+'

            '); - } - }); -} - -function reload_charts(){ - graph.configure({ - width: $("#home-chart-3").width() - }); - graph.render(); - - graph2.configure({ - width: $("#home-chart-2").width() - }); - graph2.render(); - window.morris1.redraw(); - window.morris2.redraw(); -} - -function load_charts(){ - //MORRIS - - window.morris1 = Morris.Bar({ - element: 'morris-bar-home', - data: [ - { y: 'Indonesia', a: 952}, - { y: 'India', a: 985}, - { y: 'Malaysia', a: 955}, - { y: 'China', a: 785 }, - { y: 'Philipina', a: 700 }, - { y: 'Autralia', a: 601 }, - { y: 'United Kingdom', a: 421 }, - { y: 'United States', a: 725 }, - { y: 'Taiwan', a: 350 }, - { y: 'New Zealand', a: 120 }, - { y: 'Singapore', a: 124} - ], - xkey: 'y', - ykeys: ['a'], - redraw: true, - labels: ['Visitor'], - resize: true, - barColors: ['#45B29D'], - gridTextColor: ['#777'], - gridTextSize: 11, - hideHover: 'auto', - grid :false - }); - - //MORRIS - window.morris2 = Morris.Line({ - element: 'morris-home', - padding: 20, - behaveLikeLine: true, - gridEnabled: false, - gridLineColor: '#dddddd', - axes: true, - resize: true, - smooth:false, - pointSize: 3, - lineWidth: 2, - fillOpacity:0.85, - data: [ - {period: '2009 Q1', iphone: 4666, ipad: 3666, itouch: 2666}, - {period: '2009 Q2', iphone: 4441, ipad: 3441, itouch: 2441}, - {period: '2009 Q3', iphone: 16501, ipad: 14501, itouch: 12501}, - {period: '2009 Q4', iphone: 7689, ipad: 6689, itouch: 5689}, - {period: '2010 Q1', iphone: 4666, ipad: 3666, itouch: 2666}, - {period: '2010 Q2', iphone: 4441, ipad: 3441, itouch: 2441}, - {period: '2010 Q3', iphone: 6501, ipad: 4501, itouch: 2501}, - {period: '2010 Q4', iphone: 7689, ipad: 6689, itouch: 5689}, - {period: '2011 Q1', iphone: 2293, ipad: 1293, itouch: 293}, - {period: '2011 Q2', iphone: 5881, ipad: 3881, itouch: 1881}, - {period: '2011 Q3', iphone: 5588, ipad: 3588, itouch: 1588}, - {period: '2011 Q4', iphone: 15073, ipad: 8967, itouch: 5175}, - {period: '2012 Q1', iphone: 10687, ipad: 4460, itouch: 2028}, - {period: '2012 Q2', iphone: 12432, ipad: 5713, itouch: 3791} - ], - lineColors:['#abb7b7','#ABC8E2','#183152'], - xkey: 'period', - redraw: true, - ykeys: ['iphone', 'ipad'], - labels: ['All Visitors', 'Returning Visitors'], - hideHover: 'auto' - - }); - /* - Morris.Donut({ - element: 'morris-donut', - data: [ - {label: "Download Sales", value: 12}, - {label: "In-Store Sales", value: 30}, - {label: "Mail-Order Sales", value: 20} - ] - }); - */ - var seriesData = [ [], [], []]; - var random = new Rickshaw.Fixtures.RandomData(50); - - for (var i = 0; i < 40; i++) { - random.addData(seriesData); - } - - graph = new Rickshaw.Graph( { - element: document.querySelector("#home-chart-3"), - height: 150, - renderer: 'line', - interpolation: 'linear', - series: [ - { - data: seriesData[0], - color: 'rgba(0,0,0,0.4)', - name:'S&P' - },{ - data: seriesData[1], - color: 'rgba(0,0,0,0.3)', - name:'Dow jones' - },{ - data: seriesData[2], - color: 'rgba(0,0,0,0.2)', - name:'Nasdaq' - } - ] - } ); - var hoverDetail = new Rickshaw.Graph.HoverDetail({ - graph: graph - }); - - graph.render(); - - setInterval( function() { - random.removeData(seriesData); - random.addData(seriesData); - for (lastitem in seriesData[0]); - var cur = parseInt($("#sp-status").text()); - - if(cur > seriesData[0][lastitem].y.toFixed(2)){ - $("#sp-status").addClass("text-danger").html(" "+seriesData[0][lastitem].y.toFixed(2)); - }else{ - $("#sp-status").removeClass("text-danger").html(" "+seriesData[0][lastitem].y.toFixed(2)); - } - for (lastitem in seriesData[1]); - var cur = parseInt($("#dow-status").text()); - - if(cur > seriesData[1][lastitem].y.toFixed(2)){ - $("#dow-status").addClass("text-danger").html(" "+seriesData[1][lastitem].y.toFixed(2)); - }else{ - $("#dow-status").removeClass("text-danger").html(" "+seriesData[1][lastitem].y.toFixed(2)); - } - for (lastitem in seriesData[2]); - var cur = parseInt($("#nasdaq-status").text()); - - if(cur > seriesData[2][lastitem].y.toFixed(2)){ - $("#nasdaq-status").addClass("text-danger").html(" "+seriesData[2][lastitem].y.toFixed(2)); - }else{ - $("#nasdaq-status").removeClass("text-danger").html(" "+seriesData[2][lastitem].y.toFixed(2)); - } - graph.update(); - - },5000); - - var seriesData2 = [ [], []]; - var random2 = new Rickshaw.Fixtures.RandomData(50); - - for (var i = 0; i < 50; i++) { - random2.addData(seriesData2); - } - graph2 = new Rickshaw.Graph( { - element: document.querySelector("#home-chart-2"), - height: 254, - interpolation: 'linear', - renderer: 'area', - series: [ - { - data: seriesData2[0], - color: 'rgba(255,255,255,0.3)', - name:'Web Server' - },{ - data: seriesData2[1], - color: 'rgba(255,255,255,0.1)', - name:'Database Server' - } - ] - } ); - var hoverDetail = new Rickshaw.Graph.HoverDetail( { - graph: graph2 - }); - - graph2.render(); - clearInterval(timer); - timer = setInterval( function() { - random2.removeData(seriesData2); - random2.addData(seriesData2); - for (lastitem in seriesData2[0]); - $('.ws-load').data('easyPieChart').update(seriesData2[0][lastitem].y); - //for (lastitem in seriesData2[1]); - //$('.ds-load').data('easyPieChart').update(seriesData2[1][lastitem].y); - graph2.update(); - - },2000); - - $('.ws-load').easyPieChart({ - animate: 1000, - trackColor: "rgba(0,0,0,0.1)", - barColor: "#68C39F", - scaleColor: false, - size: 90, - onStep: function(from, to, percent) { - $(this.el).find('.percent').text(Math.round(percent)); - } - }); - /*$('.ds-load').easyPieChart({ - animate: 1000, - scaleColor: false, - trackColor: "rgba(0,0,0,0.1)", - barColor: "#68C39F", - size: 50, - onStep: function(from, to, percent) { - $(this.el).find('.percent').text(Math.round(percent)); - } - });*/ -} -//http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20csv%20where%20url%3D%27http%3A%2F%2Fdownload.finance.yahoo.com%2Fd%2Fquotes.csv%3Fs%3dDOW%2CNASDAQ%2CSP%26f%3Dsl1d1t1c1ohgv%26e%3D.csv%27%20and%20columns%3D%27symbol%2Cprice%2Cdate%2Ctime%2Cchange%2Ccol1%2Chigh%2Clow%2Ccol2%27&format=json&diagnostics=true&callback= \ No newline at end of file diff --git a/public/admin/Coco/assets/js/pages/lockscreen.js b/public/admin/Coco/assets/js/pages/lockscreen.js deleted file mode 100644 index 2a314f3db..000000000 --- a/public/admin/Coco/assets/js/pages/lockscreen.js +++ /dev/null @@ -1,8 +0,0 @@ -$(function(){ - resizefunc.push("arrangesizeLockscreen"); - $(".lock-page .login-wrap").addClass("animated flipInX"); -}); - -function arrangesizeLockscreen(){ - $(".lock-page").height($(window).height()); -} \ No newline at end of file diff --git a/public/admin/Coco/assets/js/pages/morris-charts.js b/public/admin/Coco/assets/js/pages/morris-charts.js deleted file mode 100644 index 3d44fbdc6..000000000 --- a/public/admin/Coco/assets/js/pages/morris-charts.js +++ /dev/null @@ -1,61 +0,0 @@ -$(function(){ - Morris.Line({ - element: 'line-example', - resize: true, - data: [ - { y: '2006', a: 100, b: 90 }, - { y: '2007', a: 75, b: 65 }, - { y: '2008', a: 50, b: 40 }, - { y: '2009', a: 75, b: 65 }, - { y: '2010', a: 50, b: 40 }, - { y: '2011', a: 75, b: 65 }, - { y: '2012', a: 100, b: 90 } - ], - xkey: 'y', - ykeys: ['a', 'b'], - labels: ['Series A', 'Series B'] - }); - - Morris.Area({ - element: 'area-example', - resize: true, - data: [ - { y: '2006', a: 100, b: 90 }, - { y: '2007', a: 75, b: 65 }, - { y: '2008', a: 50, b: 40 }, - { y: '2009', a: 75, b: 65 }, - { y: '2010', a: 50, b: 40 }, - { y: '2011', a: 75, b: 65 }, - { y: '2012', a: 100, b: 90 } - ], - xkey: 'y', - ykeys: ['a', 'b'], - labels: ['Series A', 'Series B'] - }); - - Morris.Bar({ - element: 'bar-example', - resize: true, - data: [ - { y: '2007', a: 75, b: 65 }, - { y: '2008', a: 50, b: 40 }, - { y: '2009', a: 75, b: 65 }, - { y: '2010', a: 50, b: 40 }, - { y: '2011', a: 75, b: 65 } - ], - xkey: 'y', - ykeys: ['a', 'b'], - labels: ['Series A', 'Series B'] - }); - - Morris.Donut({ - element: 'donut-example', - resize: true, - data: [ - {label: "Download Sales", value: 12}, - {label: "In-Store Sales", value: 30}, - {label: "Mail-Order Sales", value: 20} - ] - }); - -}); \ No newline at end of file diff --git a/public/admin/Coco/assets/js/pages/nested-list.js b/public/admin/Coco/assets/js/pages/nested-list.js deleted file mode 100644 index e80ff3e37..000000000 --- a/public/admin/Coco/assets/js/pages/nested-list.js +++ /dev/null @@ -1,22 +0,0 @@ -var output; -$(document).ready(function(){ - var updateOutput = function(e) - { - var list = e.length ? e : $(e.target), - output = list.data('output'); - if (window.JSON) { - output.val(window.JSON.stringify(list.nestable('serialize')));//, null, 2)); - } else { - output.val('JSON browser support required for this demo.'); - } - }; - - // activate Nestable for list 1 - $('#nestable').nestable({ - group: 1 - }).on('change', updateOutput); - - $('#nestable2').nestable().on('change', updateOutput); - updateOutput($('#nestable').data('output', $('#nestable-output'))); - updateOutput($('#nestable2').data('output', $('#nestable2-output'))); -}) \ No newline at end of file diff --git a/public/admin/Coco/assets/js/pages/new-message.js b/public/admin/Coco/assets/js/pages/new-message.js deleted file mode 100644 index 70314ffce..000000000 --- a/public/admin/Coco/assets/js/pages/new-message.js +++ /dev/null @@ -1,11 +0,0 @@ -$(function(){ - $('.summernote-small').summernote({ - toolbar: [ - ['style', ['bold', 'italic', 'underline', 'clear']], - ['fontsize', ['fontsize']], - ['color', ['color']], - ['para', ['ul', 'ol', 'paragraph']] - ], - height: 200 - }); -}); \ No newline at end of file diff --git a/public/admin/Coco/assets/js/pages/notifications.js b/public/admin/Coco/assets/js/pages/notifications.js deleted file mode 100644 index 73f69bc66..000000000 --- a/public/admin/Coco/assets/js/pages/notifications.js +++ /dev/null @@ -1,101 +0,0 @@ -function notify(style,position) { - if(style == "error"){ - icon = "fa fa-exclamation"; - }else if(style == "warning"){ - icon = "fa fa-warning"; - }else if(style == "success"){ - icon = "fa fa-check"; - }else if(style == "info"){ - icon = "fa fa-question"; - }else{ - icon = "fa fa-circle-o"; - } - $.notify({ - title: 'Sample Notification', - text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas vitae orci ut dolor scelerisque aliquam.', - image: "" - }, { - style: 'metro', - className: style, - globalPosition:position, - showAnimation: "show", - showDuration: 0, - hideDuration: 0, - autoHide: false, - clickToHide: true - }); -} - -function notify2(style,position) { - $(".autohidebut").notify({ - text: ' Hi buddy. I\'m here!' - }, { - style: 'metro', - className: 'nonspaced', - elementPosition:position, - showAnimation: "show", - showDuration: 0, - hideDuration: 0, - autoHide: false, - clickToHide: true - }); -} - -function autohidenotify(style,position) { - if(style == "error"){ - icon = "fa fa-exclamation"; - }else if(style == "warning"){ - icon = "fa fa-warning"; - }else if(style == "success"){ - icon = "fa fa-check"; - }else if(style == "info"){ - icon = "fa fa-question"; - }else{ - icon = "fa fa-circle-o"; - } - $.notify({ - title: 'I will be closed in 3 seconds...', - text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas vitae orci ut dolor scelerisque aliquam.', - image: "" - }, { - style: 'metro', - className: style, - globalPosition:position, - showAnimation: "show", - showDuration: 0, - hideDuration: 0, - autoHideDelay: 3000, - autoHide: true, - clickToHide: true - }); -} - -function nconfirm() { - $.notify({ - title: 'Are you nuts?!', - text: 'Are you sure you want to do nothing?

            Yes No', - image: "" - }, { - style: 'metro', - className: "cool", - showAnimation: "show", - showDuration: 0, - hideDuration: 0, - autoHide: false, - clickToHide: false - }); -} - -$(function(){ - //listen for click events from this style - $(document).on('click', '.notifyjs-metro-base .no', function() { - //programmatically trigger propogating hide event - $(this).trigger('notify-hide'); - }); - $(document).on('click', '.notifyjs-metro-base .yes', function() { - //show button text - alert($(this).text() + " clicked!"); - //hide notification - $(this).trigger('notify-hide'); - }); -}) \ No newline at end of file diff --git a/public/admin/Coco/assets/js/pages/other-charts.js b/public/admin/Coco/assets/js/pages/other-charts.js deleted file mode 100644 index 6a986d2bd..000000000 --- a/public/admin/Coco/assets/js/pages/other-charts.js +++ /dev/null @@ -1,25 +0,0 @@ -var initCharts = function() { - var charts = $('.percentage'); - charts.easyPieChart({ - animate: 1000, - lineWidth: 5, - barColor: "#eb5055", - lineCap: "butt", - size: "150", - scaleColor: "transparent", - onStep: function(from, to, percent) { - $(this.el).find('.cpercent').text(Math.round(percent)); - } - }); - $('.updatePieCharts').on('click', function(e) { - e.preventDefault(); - charts.each(function() { - $(this).data('easyPieChart').update(Math.floor(100*Math.random())); - }); - }); -} - -$(function(){ - $(".knob").knob(); - initCharts(); -}) \ No newline at end of file diff --git a/public/admin/Coco/assets/js/pages/rickshaw-charts.js b/public/admin/Coco/assets/js/pages/rickshaw-charts.js deleted file mode 100644 index 117cbb4bd..000000000 --- a/public/admin/Coco/assets/js/pages/rickshaw-charts.js +++ /dev/null @@ -1,131 +0,0 @@ -$(function(){ - // Initiate graphs right after interface loaded - rungraphs(); - -}); - -function rungraphs(){ - var graph = new Rickshaw.Graph( { - element: document.querySelector("#chart-2"), - width: $("#chart-2").parent().width(), - height: 235, - renderer: 'area', - stroke: true, - series: [ { - data: [ { x: 0, y: 40 }, { x: 1, y: 49 }, { x: 2, y: 38 }, { x: 3, y: 20 }, { x: 4, y: 16 } ], - color: 'rgba(70,130,180,0.5)', - stroke: 'rgba(0,0,0,0.15)' - }, { - data: [ { x: 0, y: 22 }, { x: 1, y: 25 }, { x: 2, y: 38 }, { x: 3, y: 44 }, { x: 4, y: 46 } ], - color: 'rgba(202,226,247,0.5)', - stroke: 'rgba(0,0,0,0.15)' - } ] - } ); - - graph.renderer.unstack = true; - graph.render(); - - var graph = new Rickshaw.Graph({ - element: document.querySelector("#chart-1"), - width: $("#chart-1").parent().width(), - height: 235, - renderer: 'line', - series: [{ - data: [ { x: 0, y: 40 }, { x: 1, y: 49 }, { x: 2, y: 38 }, { x: 3, y: 30 }, { x: 4, y: 32 } ], - color: '#4682b4' - }, { - data: [ { x: 0, y: 20 }, { x: 1, y: 24 }, { x: 2, y: 19 }, { x: 3, y: 15 }, { x: 4, y: 16 } ], - color: '#9cc1e0' - }] - }); - graph.render(); - - var graph = new Rickshaw.Graph( { - element: document.querySelector("#chart-3"), - height: 235, - renderer: 'bar', - stack: false, - series: [ - { - data: [ { x: 0, y: 40 }, { x: 1, y: 49 }, { x: 2, y: 38 }, { x: 3, y: 30 }, { x: 4, y: 32 } ], - color: '#4682b4' - }, { - data: [ { x: 0, y: 20 }, { x: 1, y: 24 }, { x: 2, y: 19 }, { x: 3, y: 15 }, { x: 4, y: 16 } ], - color: '#9cc1e0' - - } ] - } ); - - graph.render(); - - var graph = new Rickshaw.Graph( { - element: document.querySelector("#chart-4"), - renderer: 'bar', - height: 235, - stack: true, - series: [ - { - data: [ { x: 0, y: 40 }, { x: 1, y: 49 }, { x: 2, y: 38 }, { x: 3, y: 30 }, { x: 4, y: 32 } ], - color: '#4682b4' - }, { - data: [ { x: 0, y: 20 }, { x: 1, y: 24 }, { x: 2, y: 19 }, { x: 3, y: 15 }, { x: 4, y: 16 } ], - color: '#9cc1e0' - - } ] -} ); - -graph.render(); -// set up our data series with 50 random data points - -var seriesData = [ [], [], [] ]; -var random = new Rickshaw.Fixtures.RandomData(150); - -for (var i = 0; i < 150; i++) { - random.addData(seriesData); -} - -// instantiate our graph! - -var graph = new Rickshaw.Graph( { - element: document.getElementById("chart-5"), - height: 500, - renderer: 'line', - series: [ - { - color: "#6FB07F", - data: seriesData[0], - name: 'New York' - }, { - color: "#FCB03C", - data: seriesData[1], - name: 'London' - }, { - color: "#FC5B3F", - data: seriesData[2], - name: 'Tokyo' - } - ] -} ); - -graph.render(); - -var hoverDetail = new Rickshaw.Graph.HoverDetail( { - graph: graph -} ); - -var legend = new Rickshaw.Graph.Legend( { - graph: graph, - element: document.getElementById('legend') - -} ); - -var shelving = new Rickshaw.Graph.Behavior.Series.Toggle( { - graph: graph, - legend: legend -} ); - -var axes = new Rickshaw.Graph.Axis.Time( { - graph: graph -} ); -axes.render(); -} \ No newline at end of file diff --git a/public/admin/Coco/assets/js/pages/sparkline-charts.js b/public/admin/Coco/assets/js/pages/sparkline-charts.js deleted file mode 100644 index 334731114..000000000 --- a/public/admin/Coco/assets/js/pages/sparkline-charts.js +++ /dev/null @@ -1,76 +0,0 @@ -$(function(){ - // Bar + line composite charts - $('#compositebar').sparkline('html', { type: 'bar', barColor: '#aaf' }); - $('#compositebar').sparkline([4,1,5,7,9,9,8,7,6,6,4,7,8,4,3,2,2,5,6,7], - { composite: true, fillColor: false, lineColor: 'red' }); - - // Larger line charts for the docs - $('.largeline').sparkline('html', - { type: 'line', height: '2.5em', width: '4em' }); - - // Customized line chart - $('#linecustom').sparkline('html', - {height: '1.5em', width: '8em', lineColor: '#f00', fillColor: '#ffa', - minSpotColor: false, maxSpotColor: false, spotColor: '#77f', spotRadius: 3}); - - // Bar charts using inline values - $('.sparkbar').sparkline('html', {type: 'bar'}); - - $('.barformat').sparkline([1, 3, 5, 3, 8], { - type: 'bar', - tooltipFormat: '{{value:levels}} - {{value}}', - tooltipValueLookups: { - levels: $.range_map({ ':2': 'Low', '3:6': 'Medium', '7:': 'High' }) - } - }); - - // Tri-state charts using inline values - $('.sparktristate').sparkline('html', {type: 'tristate'}); - $('.sparktristatecols').sparkline('html', - {type: 'tristate', colorMap: {'-2': '#fa7', '2': '#44f'} }); - - // Composite line charts, the second using values supplied via javascript - $('#compositeline').sparkline('html', { fillColor: false, changeRangeMin: 0, chartRangeMax: 10 }); - $('#compositeline').sparkline([4,1,5,7,9,9,8,7,6,6,4,7,8,4,3,2,2,5,6,7], - { composite: true, fillColor: false, lineColor: 'red', changeRangeMin: 0, chartRangeMax: 10 }); - - // Line charts with normal range marker - $('#normalline').sparkline('html', - { fillColor: false, normalRangeMin: -1, normalRangeMax: 8 }); - $('#normalExample').sparkline('html', - { fillColor: false, normalRangeMin: 80, normalRangeMax: 95, normalRangeColor: '#4f4' }); - - // Discrete charts - $('.discrete1').sparkline('html', - { type: 'discrete', lineColor: 'blue', xwidth: 18 }); - $('#discrete2').sparkline('html', - { type: 'discrete', lineColor: 'blue', thresholdColor: 'red', thresholdValue: 4 }); - - // Bullet charts - $('.sparkbullet').sparkline('html', { type: 'bullet' }); - - // Pie charts - $('.sparkpie').sparkline('html', { type: 'pie', height: '1.0em' }); - - // Box plots - $('.sparkboxplot').sparkline('html', { type: 'box'}); - $('.sparkboxplotraw').sparkline([ 1, 3, 5, 8, 10, 15, 18 ], - {type:'box', raw: true, showOutliers:true, target: 6}); - - // Box plot with specific field order - $('.boxfieldorder').sparkline('html', { - type: 'box', - tooltipFormatFieldlist: ['med', 'lq', 'uq'], - tooltipFormatFieldlistKey: 'field' - }); - - // click event demo sparkline - $('.clickdemo').sparkline(); - $('.clickdemo').bind('sparklineClick', function(ev) { - var sparkline = ev.sparklines[0], - region = sparkline.getCurrentRegionFields(); - value = region.y; - alert("Clicked on x="+region.x+" y="+region.y); - }); - -}); \ No newline at end of file diff --git a/public/admin/Coco/assets/js/pages/tabs-accordions.js b/public/admin/Coco/assets/js/pages/tabs-accordions.js deleted file mode 100644 index 9d89af4c0..000000000 --- a/public/admin/Coco/assets/js/pages/tabs-accordions.js +++ /dev/null @@ -1,3 +0,0 @@ -$(document).ready(function(){ - -}); \ No newline at end of file diff --git a/public/admin/Coco/assets/js/pages/vector-maps.js b/public/admin/Coco/assets/js/pages/vector-maps.js deleted file mode 100644 index 08f4c777b..000000000 --- a/public/admin/Coco/assets/js/pages/vector-maps.js +++ /dev/null @@ -1,32 +0,0 @@ -$(function(){ - $('#vmap-1').vectorMap({map: 'world_mill_en',backgroundColor: 'transparent', - regionStyle: { - initial: { - fill: '#8d8d8d' - } - }}); - $('#vmap-3').vectorMap({map: 'europe_mill_en',backgroundColor: 'transparent', - regionStyle: { - initial: { - fill: '#8d8d8d' - } - }}); - $('#vmap-4').vectorMap({map: 'us_aea_en',backgroundColor: 'transparent', - regionStyle: { - initial: { - fill: '#8d8d8d' - } - }}); - $('#vmap-5').vectorMap({map: 'uk_mill_en',backgroundColor: 'transparent', - regionStyle: { - initial: { - fill: '#8d8d8d' - } - }}); - $('#vmap-6').vectorMap({map: 'us-il-chicago_mill_en',backgroundColor: 'transparent', - regionStyle: { - initial: { - fill: '#8d8d8d' - } - }}); -}); \ No newline at end of file diff --git a/public/admin/Coco/assets/libs/animate-css/animate.min.css b/public/admin/Coco/assets/libs/animate-css/animate.min.css deleted file mode 100644 index a2aa5ffe7..000000000 --- a/public/admin/Coco/assets/libs/animate-css/animate.min.css +++ /dev/null @@ -1 +0,0 @@ -@charset "UTF-8";.animated{-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-fill-mode:both;animation-fill-mode:both}.animated.hinge{-webkit-animation-duration:2s;animation-duration:2s}@-webkit-keyframes bounce{0%,20%,50%,80%,100%{-webkit-transform:translateY(0);transform:translateY(0)}40%{-webkit-transform:translateY(-30px);transform:translateY(-30px)}60%{-webkit-transform:translateY(-15px);transform:translateY(-15px)}}@keyframes bounce{0%,20%,50%,80%,100%{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}40%{-webkit-transform:translateY(-30px);-ms-transform:translateY(-30px);transform:translateY(-30px)}60%{-webkit-transform:translateY(-15px);-ms-transform:translateY(-15px);transform:translateY(-15px)}}.bounce{-webkit-animation-name:bounce;animation-name:bounce}@-webkit-keyframes flash{0%,50%,100%{opacity:1}25%,75%{opacity:0}}@keyframes flash{0%,50%,100%{opacity:1}25%,75%{opacity:0}}.flash{-webkit-animation-name:flash;animation-name:flash}@-webkit-keyframes pulse{0%{-webkit-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.1);transform:scale(1.1)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes pulse{0%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.1);-ms-transform:scale(1.1);transform:scale(1.1)}100%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}.pulse{-webkit-animation-name:pulse;animation-name:pulse}@-webkit-keyframes shake{0%,100%{-webkit-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);transform:translateX(10px)}}@keyframes shake{0%,100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);-ms-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);-ms-transform:translateX(10px);transform:translateX(10px)}}.shake{-webkit-animation-name:shake;animation-name:shake}@-webkit-keyframes swing{20%{-webkit-transform:rotate(15deg);transform:rotate(15deg)}40%{-webkit-transform:rotate(-10deg);transform:rotate(-10deg)}60%{-webkit-transform:rotate(5deg);transform:rotate(5deg)}80%{-webkit-transform:rotate(-5deg);transform:rotate(-5deg)}100%{-webkit-transform:rotate(0);transform:rotate(0)}}@keyframes swing{20%{-webkit-transform:rotate(15deg);-ms-transform:rotate(15deg);transform:rotate(15deg)}40%{-webkit-transform:rotate(-10deg);-ms-transform:rotate(-10deg);transform:rotate(-10deg)}60%{-webkit-transform:rotate(5deg);-ms-transform:rotate(5deg);transform:rotate(5deg)}80%{-webkit-transform:rotate(-5deg);-ms-transform:rotate(-5deg);transform:rotate(-5deg)}100%{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0)}}.swing{-webkit-transform-origin:top center;-ms-transform-origin:top center;transform-origin:top center;-webkit-animation-name:swing;animation-name:swing}@-webkit-keyframes tada{0%{-webkit-transform:scale(1);transform:scale(1)}10%,20%{-webkit-transform:scale(.9)rotate(-3deg);transform:scale(.9)rotate(-3deg)}30%,50%,70%,90%{-webkit-transform:scale(1.1)rotate(3deg);transform:scale(1.1)rotate(3deg)}40%,60%,80%{-webkit-transform:scale(1.1)rotate(-3deg);transform:scale(1.1)rotate(-3deg)}100%{-webkit-transform:scale(1)rotate(0);transform:scale(1)rotate(0)}}@keyframes tada{0%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}10%,20%{-webkit-transform:scale(.9)rotate(-3deg);-ms-transform:scale(.9)rotate(-3deg);transform:scale(.9)rotate(-3deg)}30%,50%,70%,90%{-webkit-transform:scale(1.1)rotate(3deg);-ms-transform:scale(1.1)rotate(3deg);transform:scale(1.1)rotate(3deg)}40%,60%,80%{-webkit-transform:scale(1.1)rotate(-3deg);-ms-transform:scale(1.1)rotate(-3deg);transform:scale(1.1)rotate(-3deg)}100%{-webkit-transform:scale(1)rotate(0);-ms-transform:scale(1)rotate(0);transform:scale(1)rotate(0)}}.tada{-webkit-animation-name:tada;animation-name:tada}@-webkit-keyframes wobble{0%{-webkit-transform:translateX(0%);transform:translateX(0%)}15%{-webkit-transform:translateX(-25%)rotate(-5deg);transform:translateX(-25%)rotate(-5deg)}30%{-webkit-transform:translateX(20%)rotate(3deg);transform:translateX(20%)rotate(3deg)}45%{-webkit-transform:translateX(-15%)rotate(-3deg);transform:translateX(-15%)rotate(-3deg)}60%{-webkit-transform:translateX(10%)rotate(2deg);transform:translateX(10%)rotate(2deg)}75%{-webkit-transform:translateX(-5%)rotate(-1deg);transform:translateX(-5%)rotate(-1deg)}100%{-webkit-transform:translateX(0%);transform:translateX(0%)}}@keyframes wobble{0%{-webkit-transform:translateX(0%);-ms-transform:translateX(0%);transform:translateX(0%)}15%{-webkit-transform:translateX(-25%)rotate(-5deg);-ms-transform:translateX(-25%)rotate(-5deg);transform:translateX(-25%)rotate(-5deg)}30%{-webkit-transform:translateX(20%)rotate(3deg);-ms-transform:translateX(20%)rotate(3deg);transform:translateX(20%)rotate(3deg)}45%{-webkit-transform:translateX(-15%)rotate(-3deg);-ms-transform:translateX(-15%)rotate(-3deg);transform:translateX(-15%)rotate(-3deg)}60%{-webkit-transform:translateX(10%)rotate(2deg);-ms-transform:translateX(10%)rotate(2deg);transform:translateX(10%)rotate(2deg)}75%{-webkit-transform:translateX(-5%)rotate(-1deg);-ms-transform:translateX(-5%)rotate(-1deg);transform:translateX(-5%)rotate(-1deg)}100%{-webkit-transform:translateX(0%);-ms-transform:translateX(0%);transform:translateX(0%)}}.wobble{-webkit-animation-name:wobble;animation-name:wobble}@-webkit-keyframes bounceIn{0%{opacity:0;-webkit-transform:scale(.3);transform:scale(.3)}50%{opacity:1;-webkit-transform:scale(1.05);transform:scale(1.05)}70%{-webkit-transform:scale(.9);transform:scale(.9)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes bounceIn{0%{opacity:0;-webkit-transform:scale(.3);-ms-transform:scale(.3);transform:scale(.3)}50%{opacity:1;-webkit-transform:scale(1.05);-ms-transform:scale(1.05);transform:scale(1.05)}70%{-webkit-transform:scale(.9);-ms-transform:scale(.9);transform:scale(.9)}100%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}.bounceIn{-webkit-animation-name:bounceIn;animation-name:bounceIn}@-webkit-keyframes bounceInDown{0%{opacity:0;-webkit-transform:translateY(-2000px);transform:translateY(-2000px)}60%{opacity:1;-webkit-transform:translateY(30px);transform:translateY(30px)}80%{-webkit-transform:translateY(-10px);transform:translateY(-10px)}100%{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes bounceInDown{0%{opacity:0;-webkit-transform:translateY(-2000px);-ms-transform:translateY(-2000px);transform:translateY(-2000px)}60%{opacity:1;-webkit-transform:translateY(30px);-ms-transform:translateY(30px);transform:translateY(30px)}80%{-webkit-transform:translateY(-10px);-ms-transform:translateY(-10px);transform:translateY(-10px)}100%{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}.bounceInDown{-webkit-animation-name:bounceInDown;animation-name:bounceInDown}@-webkit-keyframes bounceInLeft{0%{opacity:0;-webkit-transform:translateX(-2000px);transform:translateX(-2000px)}60%{opacity:1;-webkit-transform:translateX(30px);transform:translateX(30px)}80%{-webkit-transform:translateX(-10px);transform:translateX(-10px)}100%{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes bounceInLeft{0%{opacity:0;-webkit-transform:translateX(-2000px);-ms-transform:translateX(-2000px);transform:translateX(-2000px)}60%{opacity:1;-webkit-transform:translateX(30px);-ms-transform:translateX(30px);transform:translateX(30px)}80%{-webkit-transform:translateX(-10px);-ms-transform:translateX(-10px);transform:translateX(-10px)}100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}}.bounceInLeft{-webkit-animation-name:bounceInLeft;animation-name:bounceInLeft}@-webkit-keyframes bounceInRight{0%{opacity:0;-webkit-transform:translateX(2000px);transform:translateX(2000px)}60%{opacity:1;-webkit-transform:translateX(-30px);transform:translateX(-30px)}80%{-webkit-transform:translateX(10px);transform:translateX(10px)}100%{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes bounceInRight{0%{opacity:0;-webkit-transform:translateX(2000px);-ms-transform:translateX(2000px);transform:translateX(2000px)}60%{opacity:1;-webkit-transform:translateX(-30px);-ms-transform:translateX(-30px);transform:translateX(-30px)}80%{-webkit-transform:translateX(10px);-ms-transform:translateX(10px);transform:translateX(10px)}100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}}.bounceInRight{-webkit-animation-name:bounceInRight;animation-name:bounceInRight}@-webkit-keyframes bounceInUp{0%{opacity:0;-webkit-transform:translateY(2000px);transform:translateY(2000px)}60%{opacity:1;-webkit-transform:translateY(-30px);transform:translateY(-30px)}80%{-webkit-transform:translateY(10px);transform:translateY(10px)}100%{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes bounceInUp{0%{opacity:0;-webkit-transform:translateY(2000px);-ms-transform:translateY(2000px);transform:translateY(2000px)}60%{opacity:1;-webkit-transform:translateY(-30px);-ms-transform:translateY(-30px);transform:translateY(-30px)}80%{-webkit-transform:translateY(10px);-ms-transform:translateY(10px);transform:translateY(10px)}100%{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}.bounceInUp{-webkit-animation-name:bounceInUp;animation-name:bounceInUp}@-webkit-keyframes bounceOut{0%{-webkit-transform:scale(1);transform:scale(1)}25%{-webkit-transform:scale(.95);transform:scale(.95)}50%{opacity:1;-webkit-transform:scale(1.1);transform:scale(1.1)}100%{opacity:0;-webkit-transform:scale(.3);transform:scale(.3)}}@keyframes bounceOut{0%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}25%{-webkit-transform:scale(.95);-ms-transform:scale(.95);transform:scale(.95)}50%{opacity:1;-webkit-transform:scale(1.1);-ms-transform:scale(1.1);transform:scale(1.1)}100%{opacity:0;-webkit-transform:scale(.3);-ms-transform:scale(.3);transform:scale(.3)}}.bounceOut{-webkit-animation-name:bounceOut;animation-name:bounceOut}@-webkit-keyframes bounceOutDown{0%{-webkit-transform:translateY(0);transform:translateY(0)}20%{opacity:1;-webkit-transform:translateY(-20px);transform:translateY(-20px)}100%{opacity:0;-webkit-transform:translateY(2000px);transform:translateY(2000px)}}@keyframes bounceOutDown{0%{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}20%{opacity:1;-webkit-transform:translateY(-20px);-ms-transform:translateY(-20px);transform:translateY(-20px)}100%{opacity:0;-webkit-transform:translateY(2000px);-ms-transform:translateY(2000px);transform:translateY(2000px)}}.bounceOutDown{-webkit-animation-name:bounceOutDown;animation-name:bounceOutDown}@-webkit-keyframes bounceOutLeft{0%{-webkit-transform:translateX(0);transform:translateX(0)}20%{opacity:1;-webkit-transform:translateX(20px);transform:translateX(20px)}100%{opacity:0;-webkit-transform:translateX(-2000px);transform:translateX(-2000px)}}@keyframes bounceOutLeft{0%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}20%{opacity:1;-webkit-transform:translateX(20px);-ms-transform:translateX(20px);transform:translateX(20px)}100%{opacity:0;-webkit-transform:translateX(-2000px);-ms-transform:translateX(-2000px);transform:translateX(-2000px)}}.bounceOutLeft{-webkit-animation-name:bounceOutLeft;animation-name:bounceOutLeft}@-webkit-keyframes bounceOutRight{0%{-webkit-transform:translateX(0);transform:translateX(0)}20%{opacity:1;-webkit-transform:translateX(-20px);transform:translateX(-20px)}100%{opacity:0;-webkit-transform:translateX(2000px);transform:translateX(2000px)}}@keyframes bounceOutRight{0%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}20%{opacity:1;-webkit-transform:translateX(-20px);-ms-transform:translateX(-20px);transform:translateX(-20px)}100%{opacity:0;-webkit-transform:translateX(2000px);-ms-transform:translateX(2000px);transform:translateX(2000px)}}.bounceOutRight{-webkit-animation-name:bounceOutRight;animation-name:bounceOutRight}@-webkit-keyframes bounceOutUp{0%{-webkit-transform:translateY(0);transform:translateY(0)}20%{opacity:1;-webkit-transform:translateY(20px);transform:translateY(20px)}100%{opacity:0;-webkit-transform:translateY(-2000px);transform:translateY(-2000px)}}@keyframes bounceOutUp{0%{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}20%{opacity:1;-webkit-transform:translateY(20px);-ms-transform:translateY(20px);transform:translateY(20px)}100%{opacity:0;-webkit-transform:translateY(-2000px);-ms-transform:translateY(-2000px);transform:translateY(-2000px)}}.bounceOutUp{-webkit-animation-name:bounceOutUp;animation-name:bounceOutUp}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}.fadeIn{-webkit-animation-name:fadeIn;animation-name:fadeIn}@-webkit-keyframes fadeInDown{0%{opacity:0;-webkit-transform:translateY(-20px);transform:translateY(-20px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes fadeInDown{0%{opacity:0;-webkit-transform:translateY(-20px);-ms-transform:translateY(-20px);transform:translateY(-20px)}100%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}.fadeInDown{-webkit-animation-name:fadeInDown;animation-name:fadeInDown}@-webkit-keyframes fadeInDownBig{0%{opacity:0;-webkit-transform:translateY(-2000px);transform:translateY(-2000px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes fadeInDownBig{0%{opacity:0;-webkit-transform:translateY(-2000px);-ms-transform:translateY(-2000px);transform:translateY(-2000px)}100%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}.fadeInDownBig{-webkit-animation-name:fadeInDownBig;animation-name:fadeInDownBig}@-webkit-keyframes fadeInLeft{0%{opacity:0;-webkit-transform:translateX(-20px);transform:translateX(-20px)}100%{opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes fadeInLeft{0%{opacity:0;-webkit-transform:translateX(-20px);-ms-transform:translateX(-20px);transform:translateX(-20px)}100%{opacity:1;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}}.fadeInLeft{-webkit-animation-name:fadeInLeft;animation-name:fadeInLeft}@-webkit-keyframes fadeInLeftBig{0%{opacity:0;-webkit-transform:translateX(-2000px);transform:translateX(-2000px)}100%{opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes fadeInLeftBig{0%{opacity:0;-webkit-transform:translateX(-2000px);-ms-transform:translateX(-2000px);transform:translateX(-2000px)}100%{opacity:1;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}}.fadeInLeftBig{-webkit-animation-name:fadeInLeftBig;animation-name:fadeInLeftBig}@-webkit-keyframes fadeInRight{0%{opacity:0;-webkit-transform:translateX(20px);transform:translateX(20px)}100%{opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes fadeInRight{0%{opacity:0;-webkit-transform:translateX(20px);-ms-transform:translateX(20px);transform:translateX(20px)}100%{opacity:1;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}}.fadeInRight{-webkit-animation-name:fadeInRight;animation-name:fadeInRight}@-webkit-keyframes fadeInRightBig{0%{opacity:0;-webkit-transform:translateX(2000px);transform:translateX(2000px)}100%{opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes fadeInRightBig{0%{opacity:0;-webkit-transform:translateX(2000px);-ms-transform:translateX(2000px);transform:translateX(2000px)}100%{opacity:1;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}}.fadeInRightBig{-webkit-animation-name:fadeInRightBig;animation-name:fadeInRightBig}@-webkit-keyframes fadeInUp{0%{opacity:0;-webkit-transform:translateY(20px);transform:translateY(20px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes fadeInUp{0%{opacity:0;-webkit-transform:translateY(20px);-ms-transform:translateY(20px);transform:translateY(20px)}100%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}.fadeInUp{-webkit-animation-name:fadeInUp;animation-name:fadeInUp}@-webkit-keyframes fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);-ms-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}.fadeInUpBig{-webkit-animation-name:fadeInUpBig;animation-name:fadeInUpBig}@-webkit-keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}.fadeOut{-webkit-animation-name:fadeOut;animation-name:fadeOut}@-webkit-keyframes fadeOutDown{0%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(20px);transform:translateY(20px)}}@keyframes fadeOutDown{0%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(20px);-ms-transform:translateY(20px);transform:translateY(20px)}}.fadeOutDown{-webkit-animation-name:fadeOutDown;animation-name:fadeOutDown}@-webkit-keyframes fadeOutDownBig{0%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(2000px);transform:translateY(2000px)}}@keyframes fadeOutDownBig{0%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(2000px);-ms-transform:translateY(2000px);transform:translateY(2000px)}}.fadeOutDownBig{-webkit-animation-name:fadeOutDownBig;animation-name:fadeOutDownBig}@-webkit-keyframes fadeOutLeft{0%{opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(-20px);transform:translateX(-20px)}}@keyframes fadeOutLeft{0%{opacity:1;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(-20px);-ms-transform:translateX(-20px);transform:translateX(-20px)}}.fadeOutLeft{-webkit-animation-name:fadeOutLeft;animation-name:fadeOutLeft}@-webkit-keyframes fadeOutLeftBig{0%{opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(-2000px);transform:translateX(-2000px)}}@keyframes fadeOutLeftBig{0%{opacity:1;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(-2000px);-ms-transform:translateX(-2000px);transform:translateX(-2000px)}}.fadeOutLeftBig{-webkit-animation-name:fadeOutLeftBig;animation-name:fadeOutLeftBig}@-webkit-keyframes fadeOutRight{0%{opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(20px);transform:translateX(20px)}}@keyframes fadeOutRight{0%{opacity:1;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(20px);-ms-transform:translateX(20px);transform:translateX(20px)}}.fadeOutRight{-webkit-animation-name:fadeOutRight;animation-name:fadeOutRight}@-webkit-keyframes fadeOutRightBig{0%{opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(2000px);transform:translateX(2000px)}}@keyframes fadeOutRightBig{0%{opacity:1;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(2000px);-ms-transform:translateX(2000px);transform:translateX(2000px)}}.fadeOutRightBig{-webkit-animation-name:fadeOutRightBig;animation-name:fadeOutRightBig}@-webkit-keyframes fadeOutUp{0%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(-20px);transform:translateY(-20px)}}@keyframes fadeOutUp{0%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(-20px);-ms-transform:translateY(-20px);transform:translateY(-20px)}}.fadeOutUp{-webkit-animation-name:fadeOutUp;animation-name:fadeOutUp}@-webkit-keyframes fadeOutUpBig{0%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(-2000px);transform:translateY(-2000px)}}@keyframes fadeOutUpBig{0%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(-2000px);-ms-transform:translateY(-2000px);transform:translateY(-2000px)}}.fadeOutUpBig{-webkit-animation-name:fadeOutUpBig;animation-name:fadeOutUpBig}@-webkit-keyframes flip{0%{-webkit-transform:perspective(400px)translateZ(0)rotateY(0)scale(1);transform:perspective(400px)translateZ(0)rotateY(0)scale(1)}0%,40%{-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}40%{-webkit-transform:perspective(400px)translateZ(150px)rotateY(170deg)scale(1);transform:perspective(400px)translateZ(150px)rotateY(170deg)scale(1)}50%{-webkit-transform:perspective(400px)translateZ(150px)rotateY(190deg)scale(1);transform:perspective(400px)translateZ(150px)rotateY(190deg)scale(1);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}80%{-webkit-transform:perspective(400px)translateZ(0)rotateY(360deg)scale(.95);transform:perspective(400px)translateZ(0)rotateY(360deg)scale(.95)}80%,100%{-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}100%{-webkit-transform:perspective(400px)translateZ(0)rotateY(360deg)scale(1);transform:perspective(400px)translateZ(0)rotateY(360deg)scale(1)}}@keyframes flip{0%{-webkit-transform:perspective(400px)translateZ(0)rotateY(0)scale(1);-ms-transform:perspective(400px)translateZ(0)rotateY(0)scale(1);transform:perspective(400px)translateZ(0)rotateY(0)scale(1)}0%,40%{-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}40%{-webkit-transform:perspective(400px)translateZ(150px)rotateY(170deg)scale(1);-ms-transform:perspective(400px)translateZ(150px)rotateY(170deg)scale(1);transform:perspective(400px)translateZ(150px)rotateY(170deg)scale(1)}50%{-webkit-transform:perspective(400px)translateZ(150px)rotateY(190deg)scale(1);-ms-transform:perspective(400px)translateZ(150px)rotateY(190deg)scale(1);transform:perspective(400px)translateZ(150px)rotateY(190deg)scale(1);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}80%{-webkit-transform:perspective(400px)translateZ(0)rotateY(360deg)scale(.95);-ms-transform:perspective(400px)translateZ(0)rotateY(360deg)scale(.95);transform:perspective(400px)translateZ(0)rotateY(360deg)scale(.95)}80%,100%{-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}100%{-webkit-transform:perspective(400px)translateZ(0)rotateY(360deg)scale(1);-ms-transform:perspective(400px)translateZ(0)rotateY(360deg)scale(1);transform:perspective(400px)translateZ(0)rotateY(360deg)scale(1)}}.animated.flip{-webkit-backface-visibility:visible;-ms-backface-visibility:visible;backface-visibility:visible;-webkit-animation-name:flip;animation-name:flip}@-webkit-keyframes flipInX{0%{-webkit-transform:perspective(400px)rotateX(90deg);transform:perspective(400px)rotateX(90deg);opacity:0}40%{-webkit-transform:perspective(400px)rotateX(-10deg);transform:perspective(400px)rotateX(-10deg)}70%{-webkit-transform:perspective(400px)rotateX(10deg);transform:perspective(400px)rotateX(10deg)}100%{-webkit-transform:perspective(400px)rotateX(0);transform:perspective(400px)rotateX(0);opacity:1}}@keyframes flipInX{0%{-webkit-transform:perspective(400px)rotateX(90deg);-ms-transform:perspective(400px)rotateX(90deg);transform:perspective(400px)rotateX(90deg);opacity:0}40%{-webkit-transform:perspective(400px)rotateX(-10deg);-ms-transform:perspective(400px)rotateX(-10deg);transform:perspective(400px)rotateX(-10deg)}70%{-webkit-transform:perspective(400px)rotateX(10deg);-ms-transform:perspective(400px)rotateX(10deg);transform:perspective(400px)rotateX(10deg)}100%{-webkit-transform:perspective(400px)rotateX(0);-ms-transform:perspective(400px)rotateX(0);transform:perspective(400px)rotateX(0);opacity:1}}.flipInX{-webkit-backface-visibility:visible!important;-ms-backface-visibility:visible!important;backface-visibility:visible!important;-webkit-animation-name:flipInX;animation-name:flipInX}@-webkit-keyframes flipInY{0%{-webkit-transform:perspective(400px)rotateY(90deg);transform:perspective(400px)rotateY(90deg);opacity:0}40%{-webkit-transform:perspective(400px)rotateY(-10deg);transform:perspective(400px)rotateY(-10deg)}70%{-webkit-transform:perspective(400px)rotateY(10deg);transform:perspective(400px)rotateY(10deg)}100%{-webkit-transform:perspective(400px)rotateY(0);transform:perspective(400px)rotateY(0);opacity:1}}@keyframes flipInY{0%{-webkit-transform:perspective(400px)rotateY(90deg);-ms-transform:perspective(400px)rotateY(90deg);transform:perspective(400px)rotateY(90deg);opacity:0}40%{-webkit-transform:perspective(400px)rotateY(-10deg);-ms-transform:perspective(400px)rotateY(-10deg);transform:perspective(400px)rotateY(-10deg)}70%{-webkit-transform:perspective(400px)rotateY(10deg);-ms-transform:perspective(400px)rotateY(10deg);transform:perspective(400px)rotateY(10deg)}100%{-webkit-transform:perspective(400px)rotateY(0);-ms-transform:perspective(400px)rotateY(0);transform:perspective(400px)rotateY(0);opacity:1}}.flipInY{-webkit-backface-visibility:visible!important;-ms-backface-visibility:visible!important;backface-visibility:visible!important;-webkit-animation-name:flipInY;animation-name:flipInY}@-webkit-keyframes flipOutX{0%{-webkit-transform:perspective(400px)rotateX(0);transform:perspective(400px)rotateX(0);opacity:1}100%{-webkit-transform:perspective(400px)rotateX(90deg);transform:perspective(400px)rotateX(90deg);opacity:0}}@keyframes flipOutX{0%{-webkit-transform:perspective(400px)rotateX(0);-ms-transform:perspective(400px)rotateX(0);transform:perspective(400px)rotateX(0);opacity:1}100%{-webkit-transform:perspective(400px)rotateX(90deg);-ms-transform:perspective(400px)rotateX(90deg);transform:perspective(400px)rotateX(90deg);opacity:0}}.flipOutX{-webkit-animation-name:flipOutX;animation-name:flipOutX;-webkit-backface-visibility:visible!important;-ms-backface-visibility:visible!important;backface-visibility:visible!important}@-webkit-keyframes flipOutY{0%{-webkit-transform:perspective(400px)rotateY(0);transform:perspective(400px)rotateY(0);opacity:1}100%{-webkit-transform:perspective(400px)rotateY(90deg);transform:perspective(400px)rotateY(90deg);opacity:0}}@keyframes flipOutY{0%{-webkit-transform:perspective(400px)rotateY(0);-ms-transform:perspective(400px)rotateY(0);transform:perspective(400px)rotateY(0);opacity:1}100%{-webkit-transform:perspective(400px)rotateY(90deg);-ms-transform:perspective(400px)rotateY(90deg);transform:perspective(400px)rotateY(90deg);opacity:0}}.flipOutY{-webkit-backface-visibility:visible!important;-ms-backface-visibility:visible!important;backface-visibility:visible!important;-webkit-animation-name:flipOutY;animation-name:flipOutY}@-webkit-keyframes lightSpeedIn{0%{-webkit-transform:translateX(100%)skewX(-30deg);transform:translateX(100%)skewX(-30deg);opacity:0}60%{-webkit-transform:translateX(-20%)skewX(30deg);transform:translateX(-20%)skewX(30deg);opacity:1}80%{-webkit-transform:translateX(0%)skewX(-15deg);transform:translateX(0%)skewX(-15deg);opacity:1}100%{-webkit-transform:translateX(0%)skewX(0);transform:translateX(0%)skewX(0);opacity:1}}@keyframes lightSpeedIn{0%{-webkit-transform:translateX(100%)skewX(-30deg);-ms-transform:translateX(100%)skewX(-30deg);transform:translateX(100%)skewX(-30deg);opacity:0}60%{-webkit-transform:translateX(-20%)skewX(30deg);-ms-transform:translateX(-20%)skewX(30deg);transform:translateX(-20%)skewX(30deg);opacity:1}80%{-webkit-transform:translateX(0%)skewX(-15deg);-ms-transform:translateX(0%)skewX(-15deg);transform:translateX(0%)skewX(-15deg);opacity:1}100%{-webkit-transform:translateX(0%)skewX(0);-ms-transform:translateX(0%)skewX(0);transform:translateX(0%)skewX(0);opacity:1}}.lightSpeedIn{-webkit-animation-name:lightSpeedIn;animation-name:lightSpeedIn;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}@-webkit-keyframes lightSpeedOut{0%{-webkit-transform:translateX(0%)skewX(0);transform:translateX(0%)skewX(0);opacity:1}100%{-webkit-transform:translateX(100%)skewX(-30deg);transform:translateX(100%)skewX(-30deg);opacity:0}}@keyframes lightSpeedOut{0%{-webkit-transform:translateX(0%)skewX(0);-ms-transform:translateX(0%)skewX(0);transform:translateX(0%)skewX(0);opacity:1}100%{-webkit-transform:translateX(100%)skewX(-30deg);-ms-transform:translateX(100%)skewX(-30deg);transform:translateX(100%)skewX(-30deg);opacity:0}}.lightSpeedOut{-webkit-animation-name:lightSpeedOut;animation-name:lightSpeedOut;-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}@-webkit-keyframes rotateIn{0%{-webkit-transform:rotate(-200deg);transform:rotate(-200deg);opacity:0}0%,100%{-webkit-transform-origin:center center;transform-origin:center center}100%{-webkit-transform:rotate(0);transform:rotate(0);opacity:1}}@keyframes rotateIn{0%{-webkit-transform:rotate(-200deg);-ms-transform:rotate(-200deg);transform:rotate(-200deg);opacity:0}0%,100%{-webkit-transform-origin:center center;-ms-transform-origin:center center;transform-origin:center center}100%{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);opacity:1}}.rotateIn{-webkit-animation-name:rotateIn;animation-name:rotateIn}@-webkit-keyframes rotateInDownLeft{0%{-webkit-transform:rotate(-90deg);transform:rotate(-90deg);opacity:0}0%,100%{-webkit-transform-origin:left bottom;transform-origin:left bottom}100%{-webkit-transform:rotate(0);transform:rotate(0);opacity:1}}@keyframes rotateInDownLeft{0%{-webkit-transform:rotate(-90deg);-ms-transform:rotate(-90deg);transform:rotate(-90deg);opacity:0}0%,100%{-webkit-transform-origin:left bottom;-ms-transform-origin:left bottom;transform-origin:left bottom}100%{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);opacity:1}}.rotateInDownLeft{-webkit-animation-name:rotateInDownLeft;animation-name:rotateInDownLeft}@-webkit-keyframes rotateInDownRight{0%{-webkit-transform:rotate(90deg);transform:rotate(90deg);opacity:0}0%,100%{-webkit-transform-origin:right bottom;transform-origin:right bottom}100%{-webkit-transform:rotate(0);transform:rotate(0);opacity:1}}@keyframes rotateInDownRight{0%{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg);opacity:0}0%,100%{-webkit-transform-origin:right bottom;-ms-transform-origin:right bottom;transform-origin:right bottom}100%{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);opacity:1}}.rotateInDownRight{-webkit-animation-name:rotateInDownRight;animation-name:rotateInDownRight}@-webkit-keyframes rotateInUpLeft{0%{-webkit-transform:rotate(90deg);transform:rotate(90deg);opacity:0}0%,100%{-webkit-transform-origin:left bottom;transform-origin:left bottom}100%{-webkit-transform:rotate(0);transform:rotate(0);opacity:1}}@keyframes rotateInUpLeft{0%{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg);opacity:0}0%,100%{-webkit-transform-origin:left bottom;-ms-transform-origin:left bottom;transform-origin:left bottom}100%{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);opacity:1}}.rotateInUpLeft{-webkit-animation-name:rotateInUpLeft;animation-name:rotateInUpLeft}@-webkit-keyframes rotateInUpRight{0%{-webkit-transform:rotate(-90deg);transform:rotate(-90deg);opacity:0}0%,100%{-webkit-transform-origin:right bottom;transform-origin:right bottom}100%{-webkit-transform:rotate(0);transform:rotate(0);opacity:1}}@keyframes rotateInUpRight{0%{-webkit-transform:rotate(-90deg);-ms-transform:rotate(-90deg);transform:rotate(-90deg);opacity:0}0%,100%{-webkit-transform-origin:right bottom;-ms-transform-origin:right bottom;transform-origin:right bottom}100%{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);opacity:1}}.rotateInUpRight{-webkit-animation-name:rotateInUpRight;animation-name:rotateInUpRight}@-webkit-keyframes rotateOut{0%{-webkit-transform:rotate(0);transform:rotate(0);opacity:1}0%,100%{-webkit-transform-origin:center center;transform-origin:center center}100%{-webkit-transform:rotate(200deg);transform:rotate(200deg);opacity:0}}@keyframes rotateOut{0%{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);opacity:1}0%,100%{-webkit-transform-origin:center center;-ms-transform-origin:center center;transform-origin:center center}100%{-webkit-transform:rotate(200deg);-ms-transform:rotate(200deg);transform:rotate(200deg);opacity:0}}.rotateOut{-webkit-animation-name:rotateOut;animation-name:rotateOut}@-webkit-keyframes rotateOutDownLeft{0%{-webkit-transform:rotate(0);transform:rotate(0);opacity:1}0%,100%{-webkit-transform-origin:left bottom;transform-origin:left bottom}100%{-webkit-transform:rotate(90deg);transform:rotate(90deg);opacity:0}}@keyframes rotateOutDownLeft{0%{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);opacity:1}0%,100%{-webkit-transform-origin:left bottom;-ms-transform-origin:left bottom;transform-origin:left bottom}100%{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg);opacity:0}}.rotateOutDownLeft{-webkit-animation-name:rotateOutDownLeft;animation-name:rotateOutDownLeft}@-webkit-keyframes rotateOutDownRight{0%{-webkit-transform:rotate(0);transform:rotate(0);opacity:1}0%,100%{-webkit-transform-origin:right bottom;transform-origin:right bottom}100%{-webkit-transform:rotate(-90deg);transform:rotate(-90deg);opacity:0}}@keyframes rotateOutDownRight{0%{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);opacity:1}0%,100%{-webkit-transform-origin:right bottom;-ms-transform-origin:right bottom;transform-origin:right bottom}100%{-webkit-transform:rotate(-90deg);-ms-transform:rotate(-90deg);transform:rotate(-90deg);opacity:0}}.rotateOutDownRight{-webkit-animation-name:rotateOutDownRight;animation-name:rotateOutDownRight}@-webkit-keyframes rotateOutUpLeft{0%{-webkit-transform:rotate(0);transform:rotate(0);opacity:1}0%,100%{-webkit-transform-origin:left bottom;transform-origin:left bottom}100%{-webkit-transform:rotate(-90deg);transform:rotate(-90deg);opacity:0}}@keyframes rotateOutUpLeft{0%{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);opacity:1}0%,100%{-webkit-transform-origin:left bottom;-ms-transform-origin:left bottom;transform-origin:left bottom}100%{-webkit-transform:rotate(-90deg);-ms-transform:rotate(-90deg);transform:rotate(-90deg);opacity:0}}.rotateOutUpLeft{-webkit-animation-name:rotateOutUpLeft;animation-name:rotateOutUpLeft}@-webkit-keyframes rotateOutUpRight{0%{-webkit-transform:rotate(0);transform:rotate(0);opacity:1}0%,100%{-webkit-transform-origin:right bottom;transform-origin:right bottom}100%{-webkit-transform:rotate(90deg);transform:rotate(90deg);opacity:0}}@keyframes rotateOutUpRight{0%{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);opacity:1}0%,100%{-webkit-transform-origin:right bottom;-ms-transform-origin:right bottom;transform-origin:right bottom}100%{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg);opacity:0}}.rotateOutUpRight{-webkit-animation-name:rotateOutUpRight;animation-name:rotateOutUpRight}@-webkit-keyframes slideInDown{0%{opacity:0;-webkit-transform:translateY(-2000px);transform:translateY(-2000px)}100%{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes slideInDown{0%{opacity:0;-webkit-transform:translateY(-2000px);-ms-transform:translateY(-2000px);transform:translateY(-2000px)}100%{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}.slideInDown{-webkit-animation-name:slideInDown;animation-name:slideInDown}@-webkit-keyframes slideInLeft{0%{opacity:0;-webkit-transform:translateX(-2000px);transform:translateX(-2000px)}100%{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes slideInLeft{0%{opacity:0;-webkit-transform:translateX(-2000px);-ms-transform:translateX(-2000px);transform:translateX(-2000px)}100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}}.slideInLeft{-webkit-animation-name:slideInLeft;animation-name:slideInLeft}@-webkit-keyframes slideInRight{0%{opacity:0;-webkit-transform:translateX(2000px);transform:translateX(2000px)}100%{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes slideInRight{0%{opacity:0;-webkit-transform:translateX(2000px);-ms-transform:translateX(2000px);transform:translateX(2000px)}100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}}.slideInRight{-webkit-animation-name:slideInRight;animation-name:slideInRight}@-webkit-keyframes slideOutLeft{0%{-webkit-transform:translateX(0);transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(-2000px);transform:translateX(-2000px)}}@keyframes slideOutLeft{0%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(-2000px);-ms-transform:translateX(-2000px);transform:translateX(-2000px)}}.slideOutLeft{-webkit-animation-name:slideOutLeft;animation-name:slideOutLeft}@-webkit-keyframes slideOutRight{0%{-webkit-transform:translateX(0);transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(2000px);transform:translateX(2000px)}}@keyframes slideOutRight{0%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}100%{opacity:0;-webkit-transform:translateX(2000px);-ms-transform:translateX(2000px);transform:translateX(2000px)}}.slideOutRight{-webkit-animation-name:slideOutRight;animation-name:slideOutRight}@-webkit-keyframes slideOutUp{0%{-webkit-transform:translateY(0);transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(-2000px);transform:translateY(-2000px)}}@keyframes slideOutUp{0%{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(-2000px);-ms-transform:translateY(-2000px);transform:translateY(-2000px)}}.slideOutUp{-webkit-animation-name:slideOutUp;animation-name:slideOutUp}@-webkit-keyframes hinge{0%{-webkit-transform:rotate(0);transform:rotate(0)}0%,20%,60%{-webkit-transform-origin:top left;transform-origin:top left;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}20%,60%{-webkit-transform:rotate(80deg);transform:rotate(80deg)}40%{-webkit-transform:rotate(60deg);transform:rotate(60deg)}40%,80%{-webkit-transform-origin:top left;transform-origin:top left;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}80%{-webkit-transform:rotate(60deg)translateY(0);transform:rotate(60deg)translateY(0);opacity:1}100%{-webkit-transform:translateY(700px);transform:translateY(700px);opacity:0}}@keyframes hinge{0%{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0)}0%,20%,60%{-webkit-transform-origin:top left;-ms-transform-origin:top left;transform-origin:top left;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}20%,60%{-webkit-transform:rotate(80deg);-ms-transform:rotate(80deg);transform:rotate(80deg)}40%{-webkit-transform:rotate(60deg);-ms-transform:rotate(60deg);transform:rotate(60deg)}40%,80%{-webkit-transform-origin:top left;-ms-transform-origin:top left;transform-origin:top left;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}80%{-webkit-transform:rotate(60deg)translateY(0);-ms-transform:rotate(60deg)translateY(0);transform:rotate(60deg)translateY(0);opacity:1}100%{-webkit-transform:translateY(700px);-ms-transform:translateY(700px);transform:translateY(700px);opacity:0}}.hinge{-webkit-animation-name:hinge;animation-name:hinge}@-webkit-keyframes rollIn{0%{opacity:0;-webkit-transform:translateX(-100%)rotate(-120deg);transform:translateX(-100%)rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0)rotate(0);transform:translateX(0)rotate(0)}}@keyframes rollIn{0%{opacity:0;-webkit-transform:translateX(-100%)rotate(-120deg);-ms-transform:translateX(-100%)rotate(-120deg);transform:translateX(-100%)rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0)rotate(0);-ms-transform:translateX(0)rotate(0);transform:translateX(0)rotate(0)}}.rollIn{-webkit-animation-name:rollIn;animation-name:rollIn}@-webkit-keyframes rollOut{0%{opacity:1;-webkit-transform:translateX(0)rotate(0);transform:translateX(0)rotate(0)}100%{opacity:0;-webkit-transform:translateX(100%)rotate(120deg);transform:translateX(100%)rotate(120deg)}}@keyframes rollOut{0%{opacity:1;-webkit-transform:translateX(0)rotate(0);-ms-transform:translateX(0)rotate(0);transform:translateX(0)rotate(0)}100%{opacity:0;-webkit-transform:translateX(100%)rotate(120deg);-ms-transform:translateX(100%)rotate(120deg);transform:translateX(100%)rotate(120deg)}}.rollOut{-webkit-animation-name:rollOut;animation-name:rollOut} \ No newline at end of file diff --git a/public/admin/Coco/assets/libs/bootstrap-bootbox/bootbox.min.js b/public/admin/Coco/assets/libs/bootstrap-bootbox/bootbox.min.js deleted file mode 100644 index 737d9e9f7..000000000 --- a/public/admin/Coco/assets/libs/bootstrap-bootbox/bootbox.min.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * bootbox.js v4.2.0 - * - * http://bootboxjs.com/license.txt - */ -!function(a,b){"use strict";"function"==typeof define&&define.amd?define(["jquery"],b):"object"==typeof exports?module.exports=b(require("jquery")):a.bootbox=b(a.jQuery)}(this,function a(b,c){"use strict";function d(a){var b=q[o.locale];return b?b[a]:q.en[a]}function e(a,c,d){a.stopPropagation(),a.preventDefault();var e=b.isFunction(d)&&d(a)===!1;e||c.modal("hide")}function f(a){var b,c=0;for(b in a)c++;return c}function g(a,c){var d=0;b.each(a,function(a,b){c(a,b,d++)})}function h(a){var c,d;if("object"!=typeof a)throw new Error("Please supply an object of options");if(!a.message)throw new Error("Please specify a message");return a=b.extend({},o,a),a.buttons||(a.buttons={}),a.backdrop=a.backdrop?"static":!1,c=a.buttons,d=f(c),g(c,function(a,e,f){if(b.isFunction(e)&&(e=c[a]={callback:e}),"object"!==b.type(e))throw new Error("button with key "+a+" must be an object");e.label||(e.label=a),e.className||(e.className=2>=d&&f===d-1?"btn-primary":"btn-default")}),a}function i(a,b){var c=a.length,d={};if(1>c||c>2)throw new Error("Invalid argument length");return 2===c||"string"==typeof a[0]?(d[b[0]]=a[0],d[b[1]]=a[1]):d=a[0],d}function j(a,c,d){return b.extend(!0,{},a,i(c,d))}function k(a,b,c,d){var e={className:"bootbox-"+a,buttons:l.apply(null,b)};return m(j(e,d,c),b)}function l(){for(var a={},b=0,c=arguments.length;c>b;b++){var e=arguments[b],f=e.toLowerCase(),g=e.toUpperCase();a[f]={label:d(g)}}return a}function m(a,b){var d={};return g(b,function(a,b){d[b]=!0}),g(a.buttons,function(a){if(d[a]===c)throw new Error("button key "+a+" is not allowed (options are "+b.join("\n")+")")}),a}var n={dialog:"",header:"",footer:"",closeButton:"",form:"
            ",inputs:{text:"",textarea:"",email:"",select:"",checkbox:"
            ",date:"",time:"",number:"",password:""}},o={locale:"en",backdrop:!0,animate:!0,className:null,closeButton:!0,show:!0,container:"body"},p={};p.alert=function(){var a;if(a=k("alert",["ok"],["message","callback"],arguments),a.callback&&!b.isFunction(a.callback))throw new Error("alert requires callback property to be a function when provided");return a.buttons.ok.callback=a.onEscape=function(){return b.isFunction(a.callback)?a.callback():!0},p.dialog(a)},p.confirm=function(){var a;if(a=k("confirm",["cancel","confirm"],["message","callback"],arguments),a.buttons.cancel.callback=a.onEscape=function(){return a.callback(!1)},a.buttons.confirm.callback=function(){return a.callback(!0)},!b.isFunction(a.callback))throw new Error("confirm requires a callback");return p.dialog(a)},p.prompt=function(){var a,d,e,f,h,i,k;f=b(n.form),d={className:"bootbox-prompt",buttons:l("cancel","confirm"),value:"",inputType:"text"},a=m(j(d,arguments,["title","callback"]),["cancel","confirm"]),i=a.show===c?!0:a.show;var o=["date","time","number"],q=document.createElement("input");if(q.setAttribute("type",a.inputType),o[a.inputType]&&(a.inputType=q.type),a.message=f,a.buttons.cancel.callback=a.onEscape=function(){return a.callback(null)},a.buttons.confirm.callback=function(){var c;switch(a.inputType){case"text":case"textarea":case"email":case"select":case"date":case"time":case"number":case"password":c=h.val();break;case"checkbox":var d=h.find("input:checked");c=[],g(d,function(a,d){c.push(b(d).val())})}return a.callback(c)},a.show=!1,!a.title)throw new Error("prompt requires a title");if(!b.isFunction(a.callback))throw new Error("prompt requires a callback");if(!n.inputs[a.inputType])throw new Error("invalid prompt type");switch(h=b(n.inputs[a.inputType]),a.inputType){case"text":case"textarea":case"email":case"date":case"time":case"number":case"password":h.val(a.value);break;case"select":var r={};if(k=a.inputOptions||[],!k.length)throw new Error("prompt with select requires options");g(k,function(a,d){var e=h;if(d.value===c||d.text===c)throw new Error("given options in wrong format");d.group&&(r[d.group]||(r[d.group]=b("").attr("label",d.group)),e=r[d.group]),e.append("")}),g(r,function(a,b){h.append(b)}),h.val(a.value);break;case"checkbox":var s=b.isArray(a.value)?a.value:[a.value];if(k=a.inputOptions||[],!k.length)throw new Error("prompt with checkbox requires options");if(!k[0].value||!k[0].text)throw new Error("given options in wrong format");h=b("
            "),g(k,function(c,d){var e=b(n.inputs[a.inputType]);e.find("input").attr("value",d.value),e.find("label").append(d.text),g(s,function(a,b){b===d.value&&e.find("input").prop("checked",!0)}),h.append(e)})}return a.placeholder&&h.attr("placeholder",a.placeholder),a.pattern&&h.attr("pattern",a.pattern),f.append(h),f.on("submit",function(a){a.preventDefault(),e.find(".btn-primary").click()}),e=p.dialog(a),e.off("shown.bs.modal"),e.on("shown.bs.modal",function(){h.focus()}),i===!0&&e.modal("show"),e},p.dialog=function(a){a=h(a);var c=b(n.dialog),d=c.find(".modal-body"),f=a.buttons,i="",j={onEscape:a.onEscape};if(g(f,function(a,b){i+="",j[a]=b.callback}),d.find(".bootbox-body").html(a.message),a.animate===!0&&c.addClass("fade"),a.className&&c.addClass(a.className),a.title&&d.before(n.header),a.closeButton){var k=b(n.closeButton);a.title?c.find(".modal-header").prepend(k):k.css("margin-top","-10px").prependTo(d)}return a.title&&c.find(".modal-title").html(a.title),i.length&&(d.after(n.footer),c.find(".modal-footer").html(i)),c.on("hidden.bs.modal",function(a){a.target===this&&c.remove()}),c.on("shown.bs.modal",function(){c.find(".btn-primary:first").focus()}),c.on("escape.close.bb",function(a){j.onEscape&&e(a,c,j.onEscape)}),c.on("click",".modal-footer button",function(a){var d=b(this).data("bb-handler");e(a,c,j[d])}),c.on("click",".bootbox-close-button",function(a){e(a,c,j.onEscape)}),c.on("keyup",function(a){27===a.which&&c.trigger("escape.close.bb")}),b(a.container).append(c),c.modal({backdrop:a.backdrop,keyboard:!1,show:!1}),a.show&&c.modal("show"),c},p.setDefaults=function(){var a={};2===arguments.length?a[arguments[0]]=arguments[1]:a=arguments[0],b.extend(o,a)},p.hideAll=function(){b(".bootbox").modal("hide")};var q={br:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Sim"},da:{OK:"OK",CANCEL:"Annuller",CONFIRM:"Accepter"},de:{OK:"OK",CANCEL:"Abbrechen",CONFIRM:"Akzeptieren"},en:{OK:"OK",CANCEL:"Cancel",CONFIRM:"OK"},es:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Aceptar"},fi:{OK:"OK",CANCEL:"Peruuta",CONFIRM:"OK"},fr:{OK:"OK",CANCEL:"Annuler",CONFIRM:"D'accord"},he:{OK:"אישור",CANCEL:"ביטול",CONFIRM:"אישור"},it:{OK:"OK",CANCEL:"Annulla",CONFIRM:"Conferma"},lt:{OK:"Gerai",CANCEL:"Atšaukti",CONFIRM:"Patvirtinti"},lv:{OK:"Labi",CANCEL:"Atcelt",CONFIRM:"Apstiprināt"},nl:{OK:"OK",CANCEL:"Annuleren",CONFIRM:"Accepteren"},no:{OK:"OK",CANCEL:"Avbryt",CONFIRM:"OK"},pl:{OK:"OK",CANCEL:"Anuluj",CONFIRM:"Potwierdź"},ru:{OK:"OK",CANCEL:"Отмена",CONFIRM:"Применить"},sv:{OK:"OK",CANCEL:"Avbryt",CONFIRM:"OK"},tr:{OK:"Tamam",CANCEL:"İptal",CONFIRM:"Onayla"},zh_CN:{OK:"OK",CANCEL:"取消",CONFIRM:"确认"},zh_TW:{OK:"OK",CANCEL:"取消",CONFIRM:"確認"}};return p.init=function(c){return a(c||b)},p}); \ No newline at end of file diff --git a/public/admin/Coco/assets/libs/bootstrap-calendar/css/bic_calendar.css b/public/admin/Coco/assets/libs/bootstrap-calendar/css/bic_calendar.css deleted file mode 100644 index 6037f7b48..000000000 --- a/public/admin/Coco/assets/libs/bootstrap-calendar/css/bic_calendar.css +++ /dev/null @@ -1,86 +0,0 @@ -.bic_calendar{ -} -.bic_calendar a{ - text-decoration: none; - color: #333; - display: block; - cursor: pointer; -} -.bic_calendar .table tbody > tr > td{ - text-align: center; - padding: 0px; -} -.bic_calendar td a{ - -} -.bic_calendar .header{ - padding: 10px 0 10px 0; -} -.bic_calendar .button-month-previous{ - padding: 5px; - float: left; -} -.bic_calendar .button-month-next{ - padding: 5px; - float: right; -} -.bic_calendar .button-year-previous{ - padding: 5px; - float: left; -} -.bic_calendar .button-year-next{ - padding: 5px; - float: right; -} -.bic_calendar .monthAndYear{ - text-align: center; - font-weight: 600; -} -.bic_calendar .days-month{ - font-weight: 600; -} -.bic_calendar .event{ - color: white; - background: #3B5A97; - font-weight: bold; -} - -.bic_calendar .event:hover > a{ - background: #3B5A97; - text-shadow: 0 0 4px #fff; -} -.bic_calendar .event a{ - color: white; -} -.bic_calendar .day:hover{ - background: rgba(0,0,0,0.04) -} -.bic_calendar .table{ - margin-bottom: 3px; -} -.bic_calendar .days-month td{ - background: #f0f0f0 ; -} -.bic_calendar .selection{ - background: rgba(141,200,230,0.5); -} -.bic_calendar .first-selection{ - border-radius: 6px 0 0 6px; - border-right: 0; -} -.bic_calendar .last-selection{ - border-radius: 0 6px 6px 0; - border-left: 0; -} -.bic_calendar .middle-selection{ - border-left: 0; - border-right: 0; - border-radius: 0; -} -.bic_calendar .popover{ - color: #000; - text-shadow: none; -} -.bic_calendar .popover-content{ - font-weight: 300; -} \ No newline at end of file diff --git a/public/admin/Coco/assets/libs/bootstrap-calendar/js/bic_calendar.min.js b/public/admin/Coco/assets/libs/bootstrap-calendar/js/bic_calendar.min.js deleted file mode 100644 index 3d1dcfe1d..000000000 --- a/public/admin/Coco/assets/libs/bootstrap-calendar/js/bic_calendar.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Bic Calendar - v3.1.2 - * A simple twitter bootstrap calendar / agenda to mark events and select range of dates. - * http://bichotll.github.io/bic_calendar - * - * Made by bichotll - * Under Apache License - */ -$.fn.bic_calendar=function(a){var b=$.extend({},$.fn.bic_calendar.defaults,a);return this.each(function(){function a(){n=$(''),d();var a=new Date,b=a.getMonth(),f=a.getFullYear();e(b,f);var g=$('');g.click(function(a){a.preventDefault(),b=(b+1)%12,0==b&&f++,c(b,f)});var h=$('');h.click(function(a){a.preventDefault(),b-=1,-1==b&&(f--,b=11),c(b,f)});var j=$('');j.click(function(a){a.preventDefault(),f++,c(b,f)});var l=$('');l.click(function(a){a.preventDefault(),f--,c(b,f)});var o=$('
            ');if(C===!0){var t=$(""),u=$('');t.append(l),t.append(u),t.append(j),u.append(r),o.append(t)}if(B===!0){var v=$(""),w=$('');v.append(h),v.append(w),v.append(g),w.append(q),o.append(v)}m=$('
            '),m.prepend(o),m.append(n),p.append(m),i(b,f),k()}function c(a,b){n.empty(),d(),e(a,b),i(a,b),l()}function d(){if(0!=v){var a=$(''),b="";$(o).each(function(a,c){b+=""}),b+="",a.append(b),n.append(a)}}function e(a,b){q.text(u[a]),r.text(b);for(var c=1,d=f(1,a,b),e=h(a,b),g=a+1,i="",j=0;7>j;j++){if(d>j){var k="";0==j&&(k+=""),k+='"),k+='
            ",6==j&&(k+=""),c++}i+=k}for(var l=1;e>=c;){var k="";l%7==1&&(k+=""),k+='
            ",l%7==0&&(k+=""),c++,l++,i+=k}if(l--,l%7!=0){k="";for(var j=l%7+1;7>=j;j++){var k="";k+=""),i+=k}}n.append(i)}function f(a,b,c){var d=new Date(c,b,a),e=d.getDay();return e+=D,0==e?e=6:e--,e}function g(a,b,c){return a>0&&13>a&&c>0&&32768>c&&b>0&&b<=new Date(c,a,0).getDate()}function h(a,b){for(var c=28;g(a+1,c+1,b);)c++;return c}function i(a,b){0!=y?$.ajax({type:y.type,url:y.url,data:{mes:a+1,ano:b},dataType:"json"}).done(function(c){"undefined"==typeof t&&(t=[]),$.each(c,function(a){t.push(c[a])}),j(a,b)}):j(a,b)}function j(a,b){for(var c=a+1,d=0;dc){var d=b;b=c,c=d}for($("#bic_calendar_"+b.getDate()+"_"+(parseInt(b.getMonth())+1)+"_"+b.getFullYear()+" div").addClass("selection first-selection");c>b;)b.setDate(b.getDate()+1),$("#bic_calendar_"+b.getDate()+"_"+(parseInt(b.getMonth())+1)+"_"+b.getFullYear()+" div").addClass("selection middle-selection");$("#bic_calendar_"+b.getDate()+"_"+(parseInt(b.getMonth())+1)+"_"+b.getFullYear()+" div").removeClass("middle-selection").addClass("selection last-selection")}}var m,n,o,p=$(this),q=$('
            '),r=$('
            '),s="bic_calendar",t=b.events;o="undefined"!=typeof b.dayNames?b.dayNames:["l","m","x","j","v","s","d"];var u;u="undefined"!=typeof b.monthNames?b.monthNames:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"];var v;v="undefined"!=typeof b.showDays?b.showDays:!0;var w;w="undefined"!=typeof b.popoverOptions?b.popoverOptions:{placement:"bottom",html:!0,trigger:"hover"};var x;x="undefined"!=typeof b.tooltipOptions?b.tooltipOptions:{placement:"bottom",trigger:"hover"};var y;y="undefined"!=typeof b.reqAjax?b.reqAjax:!1;var z=!1;"undefined"!=typeof b.enableSelect&&(z=b.enableSelect);var A=!1;"undefined"!=typeof b.multiSelect&&(A=b.multiSelect);var B=!0;"undefined"!=typeof b.displayMonthController&&(B=b.displayMonthController);var C=!0;"undefined"!=typeof b.displayYearController&&(C=b.displayYearController);var D=0;"undefined"!=typeof b.startWeekDay&&(D=b.startWeekDay);var E="",F="",G="";a()}),this}; \ No newline at end of file diff --git a/public/admin/Coco/assets/libs/bootstrap-datepicker/css/datepicker.css b/public/admin/Coco/assets/libs/bootstrap-datepicker/css/datepicker.css deleted file mode 100644 index b7065b7d5..000000000 --- a/public/admin/Coco/assets/libs/bootstrap-datepicker/css/datepicker.css +++ /dev/null @@ -1,182 +0,0 @@ -/*! - * Datepicker for Bootstrap - * - * Copyright 2012 Stefan Petre - * Licensed under the Apache License v2.0 - * http://www.apache.org/licenses/LICENSE-2.0 - * - */ -.datepicker { - top: 0; - left: 0; - padding: 4px; - margin-top: 1px; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - /*.dow { - border-top: 1px solid #ddd !important; - }*/ - -} -.datepicker:before { - content: ''; - display: inline-block; - border-left: 7px solid transparent; - border-right: 7px solid transparent; - border-bottom: 7px solid #ccc; - border-bottom-color: rgba(0, 0, 0, 0.2); - position: absolute; - top: -7px; - left: 6px; -} -.datepicker:after { - content: ''; - display: inline-block; - border-left: 6px solid transparent; - border-right: 6px solid transparent; - border-bottom: 6px solid #ffffff; - position: absolute; - top: -6px; - left: 7px; -} -.datepicker > div { - display: none; -} -.datepicker table { - width: 100%; - margin: 0; -} -.datepicker td, -.datepicker th { - text-align: center; - width: 20px; - height: 20px; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; -} -.datepicker td.day:hover { - background: #eeeeee; - cursor: pointer; -} -.datepicker td.day.disabled { - color: #eeeeee; -} -.datepicker td.old, -.datepicker td.new { - color: #999999; -} -.datepicker td.active, -.datepicker td.active:hover { - color: #ffffff; - background-color: #006dcc; - background-image: -moz-linear-gradient(top, #0088cc, #0044cc); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); - background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); - background-image: -o-linear-gradient(top, #0088cc, #0044cc); - background-image: linear-gradient(to bottom, #0088cc, #0044cc); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0); - border-color: #0044cc #0044cc #002a80; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - *background-color: #0044cc; - /* Darken IE7 buttons by default so they stand out more given they won't have borders */ - - filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); - color: #fff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); -} -.datepicker td.active:hover, -.datepicker td.active:hover:hover, -.datepicker td.active:focus, -.datepicker td.active:hover:focus, -.datepicker td.active:active, -.datepicker td.active:hover:active, -.datepicker td.active.active, -.datepicker td.active:hover.active, -.datepicker td.active.disabled, -.datepicker td.active:hover.disabled, -.datepicker td.active[disabled], -.datepicker td.active:hover[disabled] { - color: #ffffff; - background-color: #0044cc; - *background-color: #003bb3; -} -.datepicker td.active:active, -.datepicker td.active:hover:active, -.datepicker td.active.active, -.datepicker td.active:hover.active { - background-color: #003399 \9; -} -.datepicker td span { - display: block; - width: 47px; - height: 54px; - line-height: 54px; - float: left; - margin: 2px; - cursor: pointer; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; -} -.datepicker td span:hover { - background: #eeeeee; -} -.datepicker td span.active { - color: #ffffff; - background-color: #006dcc; - background-image: -moz-linear-gradient(top, #0088cc, #0044cc); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); - background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); - background-image: -o-linear-gradient(top, #0088cc, #0044cc); - background-image: linear-gradient(to bottom, #0088cc, #0044cc); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0); - border-color: #0044cc #0044cc #002a80; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - *background-color: #0044cc; - /* Darken IE7 buttons by default so they stand out more given they won't have borders */ - - filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); - color: #fff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); -} -.datepicker td span.active:hover, -.datepicker td span.active:focus, -.datepicker td span.active:active, -.datepicker td span.active.active, -.datepicker td span.active.disabled, -.datepicker td span.active[disabled] { - color: #ffffff; - background-color: #0044cc; - *background-color: #003bb3; -} -.datepicker td span.active:active, -.datepicker td span.active.active { - background-color: #003399 \9; -} -.datepicker td span.old { - color: #999999; -} -.datepicker th.switch { - width: 145px; -} -.datepicker th.next, -.datepicker th.prev { - font-size: 21px; -} -.datepicker thead tr:first-child th { - cursor: pointer; -} -.datepicker thead tr:first-child th:hover { - background: #eeeeee; -} -.input-append.date .add-on i, -.input-prepend.date .add-on i { - display: block; - cursor: pointer; - width: 16px; - height: 16px; -} \ No newline at end of file diff --git a/public/admin/Coco/assets/libs/bootstrap-datepicker/js/bootstrap-datepicker.js b/public/admin/Coco/assets/libs/bootstrap-datepicker/js/bootstrap-datepicker.js deleted file mode 100644 index bf3a56df0..000000000 --- a/public/admin/Coco/assets/libs/bootstrap-datepicker/js/bootstrap-datepicker.js +++ /dev/null @@ -1,474 +0,0 @@ -/* ========================================================= - * bootstrap-datepicker.js - * http://www.eyecon.ro/bootstrap-datepicker - * ========================================================= - * Copyright 2012 Stefan Petre - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ========================================================= */ - -!function( $ ) { - - // Picker object - - var Datepicker = function(element, options){ - this.element = $(element); - this.format = DPGlobal.parseFormat(options.format||this.element.data('date-format')||'mm/dd/yyyy'); - this.picker = $(DPGlobal.template) - .appendTo('body') - .on({ - click: $.proxy(this.click, this)//, - //mousedown: $.proxy(this.mousedown, this) - }); - this.isInput = this.element.is('input'); - this.component = this.element.is('.date') ? this.element.find('.add-on') : false; - - if (this.isInput) { - this.element.on({ - focus: $.proxy(this.show, this), - //blur: $.proxy(this.hide, this), - keyup: $.proxy(this.update, this) - }); - } else { - if (this.component){ - this.component.on('click', $.proxy(this.show, this)); - } else { - this.element.on('click', $.proxy(this.show, this)); - } - } - - this.minViewMode = options.minViewMode||this.element.data('date-minviewmode')||0; - if (typeof this.minViewMode === 'string') { - switch (this.minViewMode) { - case 'months': - this.minViewMode = 1; - break; - case 'years': - this.minViewMode = 2; - break; - default: - this.minViewMode = 0; - break; - } - } - this.viewMode = options.viewMode||this.element.data('date-viewmode')||0; - if (typeof this.viewMode === 'string') { - switch (this.viewMode) { - case 'months': - this.viewMode = 1; - break; - case 'years': - this.viewMode = 2; - break; - default: - this.viewMode = 0; - break; - } - } - this.startViewMode = this.viewMode; - this.weekStart = options.weekStart||this.element.data('date-weekstart')||0; - this.weekEnd = this.weekStart === 0 ? 6 : this.weekStart - 1; - this.onRender = options.onRender; - this.fillDow(); - this.fillMonths(); - this.update(); - this.showMode(); - }; - - Datepicker.prototype = { - constructor: Datepicker, - - show: function(e) { - this.picker.show(); - this.height = this.component ? this.component.outerHeight() : this.element.outerHeight(); - this.place(); - $(window).on('resize', $.proxy(this.place, this)); - if (e ) { - e.stopPropagation(); - e.preventDefault(); - } - if (!this.isInput) { - } - var that = this; - $(document).on('mousedown', function(ev){ - if ($(ev.target).closest('.datepicker').length == 0) { - that.hide(); - } - }); - this.element.trigger({ - type: 'show', - date: this.date - }); - }, - - hide: function(){ - this.picker.hide(); - $(window).off('resize', this.place); - this.viewMode = this.startViewMode; - this.showMode(); - if (!this.isInput) { - $(document).off('mousedown', this.hide); - } - //this.set(); - this.element.trigger({ - type: 'hide', - date: this.date - }); - }, - - set: function() { - var formated = DPGlobal.formatDate(this.date, this.format); - if (!this.isInput) { - if (this.component){ - this.element.find('input').prop('value', formated); - } - this.element.data('date', formated); - } else { - this.element.prop('value', formated); - } - }, - - setValue: function(newDate) { - if (typeof newDate === 'string') { - this.date = DPGlobal.parseDate(newDate, this.format); - } else { - this.date = new Date(newDate); - } - this.set(); - this.viewDate = new Date(this.date.getFullYear(), this.date.getMonth(), 1, 0, 0, 0, 0); - this.fill(); - }, - - place: function(){ - var offset = this.component ? this.component.offset() : this.element.offset(); - this.picker.css({ - top: offset.top + this.height, - left: offset.left - }); - }, - - update: function(newDate){ - this.date = DPGlobal.parseDate( - typeof newDate === 'string' ? newDate : (this.isInput ? this.element.prop('value') : this.element.data('date')), - this.format - ); - this.viewDate = new Date(this.date.getFullYear(), this.date.getMonth(), 1, 0, 0, 0, 0); - this.fill(); - }, - - fillDow: function(){ - var dowCnt = this.weekStart; - var html = ''; - while (dowCnt < this.weekStart + 7) { - html += ''+DPGlobal.dates.daysMin[(dowCnt++)%7]+''; - } - html += ''; - this.picker.find('.datepicker-days thead').append(html); - }, - - fillMonths: function(){ - var html = ''; - var i = 0 - while (i < 12) { - html += ''+DPGlobal.dates.monthsShort[i++]+''; - } - this.picker.find('.datepicker-months td').append(html); - }, - - fill: function() { - var d = new Date(this.viewDate), - year = d.getFullYear(), - month = d.getMonth(), - currentDate = this.date.valueOf(); - this.picker.find('.datepicker-days th:eq(1)') - .text(DPGlobal.dates.months[month]+' '+year); - var prevMonth = new Date(year, month-1, 28,0,0,0,0), - day = DPGlobal.getDaysInMonth(prevMonth.getFullYear(), prevMonth.getMonth()); - prevMonth.setDate(day); - prevMonth.setDate(day - (prevMonth.getDay() - this.weekStart + 7)%7); - var nextMonth = new Date(prevMonth); - nextMonth.setDate(nextMonth.getDate() + 42); - nextMonth = nextMonth.valueOf(); - var html = []; - var clsName, - prevY, - prevM; - while(prevMonth.valueOf() < nextMonth) { - if (prevMonth.getDay() === this.weekStart) { - html.push(''); - } - clsName = this.onRender(prevMonth); - prevY = prevMonth.getFullYear(); - prevM = prevMonth.getMonth(); - if ((prevM < month && prevY === year) || prevY < year) { - clsName += ' old'; - } else if ((prevM > month && prevY === year) || prevY > year) { - clsName += ' new'; - } - if (prevMonth.valueOf() === currentDate) { - clsName += ' active'; - } - html.push(''+prevMonth.getDate() + ''); - if (prevMonth.getDay() === this.weekEnd) { - html.push(''); - } - prevMonth.setDate(prevMonth.getDate()+1); - } - this.picker.find('.datepicker-days tbody').empty().append(html.join('')); - var currentYear = this.date.getFullYear(); - - var months = this.picker.find('.datepicker-months') - .find('th:eq(1)') - .text(year) - .end() - .find('span').removeClass('active'); - if (currentYear === year) { - months.eq(this.date.getMonth()).addClass('active'); - } - - html = ''; - year = parseInt(year/10, 10) * 10; - var yearCont = this.picker.find('.datepicker-years') - .find('th:eq(1)') - .text(year + '-' + (year + 9)) - .end() - .find('td'); - year -= 1; - for (var i = -1; i < 11; i++) { - html += ''+year+''; - year += 1; - } - yearCont.html(html); - }, - - click: function(e) { - e.stopPropagation(); - e.preventDefault(); - var target = $(e.target).closest('span, td, th'); - if (target.length === 1) { - switch(target[0].nodeName.toLowerCase()) { - case 'th': - switch(target[0].className) { - case 'switch': - this.showMode(1); - break; - case 'prev': - case 'next': - this.viewDate['set'+DPGlobal.modes[this.viewMode].navFnc].call( - this.viewDate, - this.viewDate['get'+DPGlobal.modes[this.viewMode].navFnc].call(this.viewDate) + - DPGlobal.modes[this.viewMode].navStep * (target[0].className === 'prev' ? -1 : 1) - ); - this.fill(); - this.set(); - break; - } - break; - case 'span': - if (target.is('.month')) { - var month = target.parent().find('span').index(target); - this.viewDate.setMonth(month); - } else { - var year = parseInt(target.text(), 10)||0; - this.viewDate.setFullYear(year); - } - if (this.viewMode !== 0) { - this.date = new Date(this.viewDate); - this.element.trigger({ - type: 'changeDate', - date: this.date, - viewMode: DPGlobal.modes[this.viewMode].clsName - }); - } - this.showMode(-1); - this.fill(); - this.set(); - break; - case 'td': - if (target.is('.day') && !target.is('.disabled')){ - var day = parseInt(target.text(), 10)||1; - var month = this.viewDate.getMonth(); - if (target.is('.old')) { - month -= 1; - } else if (target.is('.new')) { - month += 1; - } - var year = this.viewDate.getFullYear(); - this.date = new Date(year, month, day,0,0,0,0); - this.viewDate = new Date(year, month, Math.min(28, day),0,0,0,0); - this.fill(); - this.set(); - this.element.trigger({ - type: 'changeDate', - date: this.date, - viewMode: DPGlobal.modes[this.viewMode].clsName - }); - } - break; - } - } - }, - - mousedown: function(e){ - e.stopPropagation(); - e.preventDefault(); - }, - - showMode: function(dir) { - if (dir) { - this.viewMode = Math.max(this.minViewMode, Math.min(2, this.viewMode + dir)); - } - this.picker.find('>div').hide().filter('.datepicker-'+DPGlobal.modes[this.viewMode].clsName).show(); - } - }; - - $.fn.datepicker = function ( option, val ) { - return this.each(function () { - var $this = $(this), - data = $this.data('datepicker'), - options = typeof option === 'object' && option; - if (!data) { - $this.data('datepicker', (data = new Datepicker(this, $.extend({}, $.fn.datepicker.defaults,options)))); - } - if (typeof option === 'string') data[option](val); - }); - }; - - $.fn.datepicker.defaults = { - onRender: function(date) { - return ''; - } - }; - $.fn.datepicker.Constructor = Datepicker; - - var DPGlobal = { - modes: [ - { - clsName: 'days', - navFnc: 'Month', - navStep: 1 - }, - { - clsName: 'months', - navFnc: 'FullYear', - navStep: 1 - }, - { - clsName: 'years', - navFnc: 'FullYear', - navStep: 10 - }], - dates:{ - days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], - daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], - daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"], - months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], - monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] - }, - isLeapYear: function (year) { - return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0)) - }, - getDaysInMonth: function (year, month) { - return [31, (DPGlobal.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month] - }, - parseFormat: function(format){ - var separator = format.match(/[.\/\-\s].*?/), - parts = format.split(/\W+/); - if (!separator || !parts || parts.length === 0){ - throw new Error("Invalid date format."); - } - return {separator: separator, parts: parts}; - }, - parseDate: function(date, format) { - var parts = date.split(format.separator), - date = new Date(), - val; - date.setHours(0); - date.setMinutes(0); - date.setSeconds(0); - date.setMilliseconds(0); - if (parts.length === format.parts.length) { - var year = date.getFullYear(), day = date.getDate(), month = date.getMonth(); - for (var i=0, cnt = format.parts.length; i < cnt; i++) { - val = parseInt(parts[i], 10)||1; - switch(format.parts[i]) { - case 'dd': - case 'd': - day = val; - date.setDate(val); - break; - case 'mm': - case 'm': - month = val - 1; - date.setMonth(val - 1); - break; - case 'yy': - year = 2000 + val; - date.setFullYear(2000 + val); - break; - case 'yyyy': - year = val; - date.setFullYear(val); - break; - } - } - date = new Date(year, month, day, 0 ,0 ,0); - } - return date; - }, - formatDate: function(date, format){ - var val = { - d: date.getDate(), - m: date.getMonth() + 1, - yy: date.getFullYear().toString().substring(2), - yyyy: date.getFullYear() - }; - val.dd = (val.d < 10 ? '0' : '') + val.d; - val.mm = (val.m < 10 ? '0' : '') + val.m; - var date = []; - for (var i=0, cnt = format.parts.length; i < cnt; i++) { - date.push(val[format.parts[i]]); - } - return date.join(format.separator); - }, - headTemplate: ''+ - ''+ - '‹'+ - ''+ - '›'+ - ''+ - '', - contTemplate: '' - }; - DPGlobal.template = ''; - -}( window.jQuery ); \ No newline at end of file diff --git a/public/admin/Coco/assets/libs/bootstrap-fileinput/bootstrap.file-input.js b/public/admin/Coco/assets/libs/bootstrap-fileinput/bootstrap.file-input.js deleted file mode 100644 index 17a3b2754..000000000 --- a/public/admin/Coco/assets/libs/bootstrap-fileinput/bootstrap.file-input.js +++ /dev/null @@ -1,122 +0,0 @@ -/* - Bootstrap - File Input - ====================== - - This is meant to convert all file input tags into a set of elements that displays consistently in all browsers. - - Converts all - - into Bootstrap buttons - Browse - -*/ -$(function() { - -$.fn.bootstrapFileInput = function() { - - this.each(function(i,elem){ - - var $elem = $(elem); - - // Maybe some fields don't need to be standardized. - if (typeof $elem.attr('data-bfi-disabled') != 'undefined') { - return; - } - - // Set the word to be displayed on the button - var buttonWord = 'Browse'; - - if (typeof $elem.attr('title') != 'undefined') { - buttonWord = $elem.attr('title'); - } - - // Start by getting the HTML of the input element. - // Thanks for the tip http://stackoverflow.com/a/1299069 - var input = $('
            ').append( $elem.eq(0).clone() ).html(); - var className = ''; - - if (!!$elem.attr('class')) { - className = ' ' + $elem.attr('class'); - } - - // Now we're going to replace that input field with a Bootstrap button. - // The input will actually still be there, it will just be float above and transparent (done with the CSS). - $elem.replaceWith(''+buttonWord+input+''); - }) - - // After we have found all of the file inputs let's apply a listener for tracking the mouse movement. - // This is important because the in order to give the illusion that this is a button in FF we actually need to move the button from the file input under the cursor. Ugh. - .promise().done( function(){ - - // As the cursor moves over our new Bootstrap button we need to adjust the position of the invisible file input Browse button to be under the cursor. - // This gives us the pointer cursor that FF denies us - $('.file-input-wrapper').mousemove(function(cursor) { - - var input, wrapper, - wrapperX, wrapperY, - inputWidth, inputHeight, - cursorX, cursorY; - - // This wrapper element (the button surround this file input) - wrapper = $(this); - // The invisible file input element - input = wrapper.find("input"); - // The left-most position of the wrapper - wrapperX = wrapper.offset().left; - // The top-most position of the wrapper - wrapperY = wrapper.offset().top; - // The with of the browsers input field - inputWidth= input.width(); - // The height of the browsers input field - inputHeight= input.height(); - //The position of the cursor in the wrapper - cursorX = cursor.pageX; - cursorY = cursor.pageY; - - //The positions we are to move the invisible file input - // The 20 at the end is an arbitrary number of pixels that we can shift the input such that cursor is not pointing at the end of the Browse button but somewhere nearer the middle - moveInputX = cursorX - wrapperX - inputWidth + 20; - // Slides the invisible input Browse button to be positioned middle under the cursor - moveInputY = cursorY- wrapperY - (inputHeight/2); - - // Apply the positioning styles to actually move the invisible file input - input.css({ - left:moveInputX, - top:moveInputY - }); - }); - - $('.file-input-wrapper input[type=file]').change(function(){ - - var fileName; - fileName = $(this).val(); - - // Remove any previous file names - $(this).parent().next('.file-input-name').remove(); - if (!!$(this).prop('files') && $(this).prop('files').length > 1) { - fileName = $(this)[0].files.length+' files'; - //$(this).parent().after(''+$(this)[0].files.length+' files'); - } - else { - // var fakepath = 'C:\\fakepath\\'; - // fileName = $(this).val().replace('C:\\fakepath\\',''); - fileName = fileName.substring(fileName.lastIndexOf('\\')+1,fileName.length); - } - - $(this).parent().after(''+fileName+''); - }); - - }); - -}; - -// Add the styles before the first stylesheet -// This ensures they can be easily overridden with developer styles -var cssHtml = ''; -$('link[rel=stylesheet]').eq(0).before(cssHtml); - -}); \ No newline at end of file diff --git a/public/admin/Coco/assets/libs/bootstrap-inputmask/inputmask.js b/public/admin/Coco/assets/libs/bootstrap-inputmask/inputmask.js deleted file mode 100644 index a8010ea8f..000000000 --- a/public/admin/Coco/assets/libs/bootstrap-inputmask/inputmask.js +++ /dev/null @@ -1,360 +0,0 @@ -/* =========================================================== - * Bootstrap: inputmask.js v3.1.0 - * http://jasny.github.io/bootstrap/javascript/#inputmask - * - * Based on Masked Input plugin by Josh Bush (digitalbush.com) - * =========================================================== - * Copyright 2012-2014 Arnold Daniels - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ========================================================== */ - -+function ($) { "use strict"; - - var isIphone = (window.orientation !== undefined) - var isAndroid = navigator.userAgent.toLowerCase().indexOf("android") > -1 - var isIE = window.navigator.appName == 'Microsoft Internet Explorer' - - // INPUTMASK PUBLIC CLASS DEFINITION - // ================================= - - var Inputmask = function (element, options) { - if (isAndroid) return // No support because caret positioning doesn't work on Android - - this.$element = $(element) - this.options = $.extend({}, Inputmask.DEFAULTS, options) - this.mask = String(this.options.mask) - - this.init() - this.listen() - - this.checkVal() //Perform initial check for existing values - } - - Inputmask.DEFAULTS = { - mask: "", - placeholder: "_", - definitions: { - '9': "[0-9]", - 'a': "[A-Za-z]", - 'w': "[A-Za-z0-9]", - '*': "." - } - } - - Inputmask.prototype.init = function() { - var defs = this.options.definitions - var len = this.mask.length - - this.tests = [] - this.partialPosition = this.mask.length - this.firstNonMaskPos = null - - $.each(this.mask.split(""), $.proxy(function(i, c) { - if (c == '?') { - len-- - this.partialPosition = i - } else if (defs[c]) { - this.tests.push(new RegExp(defs[c])) - if (this.firstNonMaskPos === null) - this.firstNonMaskPos = this.tests.length - 1 - } else { - this.tests.push(null) - } - }, this)) - - this.buffer = $.map(this.mask.split(""), $.proxy(function(c, i) { - if (c != '?') return defs[c] ? this.options.placeholder : c - }, this)) - - this.focusText = this.$element.val() - - this.$element.data("rawMaskFn", $.proxy(function() { - return $.map(this.buffer, function(c, i) { - return this.tests[i] && c != this.options.placeholder ? c : null - }).join('') - }, this)) - } - - Inputmask.prototype.listen = function() { - if (this.$element.attr("readonly")) return - - var pasteEventName = (isIE ? 'paste' : 'input') + ".mask" - - this.$element - .on("unmask.bs.inputmask", $.proxy(this.unmask, this)) - - .on("focus.bs.inputmask", $.proxy(this.focusEvent, this)) - .on("blur.bs.inputmask", $.proxy(this.blurEvent, this)) - - .on("keydown.bs.inputmask", $.proxy(this.keydownEvent, this)) - .on("keypress.bs.inputmask", $.proxy(this.keypressEvent, this)) - - .on(pasteEventName, $.proxy(this.pasteEvent, this)) - } - - //Helper Function for Caret positioning - Inputmask.prototype.caret = function(begin, end) { - if (this.$element.length === 0) return - if (typeof begin == 'number') { - end = (typeof end == 'number') ? end : begin - return this.$element.each(function() { - if (this.setSelectionRange) { - this.setSelectionRange(begin, end) - } else if (this.createTextRange) { - var range = this.createTextRange() - range.collapse(true) - range.moveEnd('character', end) - range.moveStart('character', begin) - range.select() - } - }) - } else { - if (this.$element[0].setSelectionRange) { - begin = this.$element[0].selectionStart - end = this.$element[0].selectionEnd - } else if (document.selection && document.selection.createRange) { - var range = document.selection.createRange() - begin = 0 - range.duplicate().moveStart('character', -100000) - end = begin + range.text.length - } - return { - begin: begin, - end: end - } - } - } - - Inputmask.prototype.seekNext = function(pos) { - var len = this.mask.length - while (++pos <= len && !this.tests[pos]); - - return pos - } - - Inputmask.prototype.seekPrev = function(pos) { - while (--pos >= 0 && !this.tests[pos]); - - return pos - } - - Inputmask.prototype.shiftL = function(begin,end) { - var len = this.mask.length - - if (begin < 0) return - - for (var i = begin, j = this.seekNext(end); i < len; i++) { - if (this.tests[i]) { - if (j < len && this.tests[i].test(this.buffer[j])) { - this.buffer[i] = this.buffer[j] - this.buffer[j] = this.options.placeholder - } else - break - j = this.seekNext(j) - } - } - this.writeBuffer() - this.caret(Math.max(this.firstNonMaskPos, begin)) - } - - Inputmask.prototype.shiftR = function(pos) { - var len = this.mask.length - - for (var i = pos, c = this.options.placeholder; i < len; i++) { - if (this.tests[i]) { - var j = this.seekNext(i) - var t = this.buffer[i] - this.buffer[i] = c - if (j < len && this.tests[j].test(t)) - c = t - else - break - } - } - }, - - Inputmask.prototype.unmask = function() { - this.$element - .unbind(".mask") - .removeData("inputmask") - } - - Inputmask.prototype.focusEvent = function() { - this.focusText = this.$element.val() - var len = this.mask.length - var pos = this.checkVal() - this.writeBuffer() - - var that = this - var moveCaret = function() { - if (pos == len) - that.caret(0, pos) - else - that.caret(pos) - } - - moveCaret() - setTimeout(moveCaret, 50) - } - - Inputmask.prototype.blurEvent = function() { - this.checkVal() - if (this.$element.val() !== this.focusText) - this.$element.trigger('change') - } - - Inputmask.prototype.keydownEvent = function(e) { - var k = e.which - - //backspace, delete, and escape get special treatment - if (k == 8 || k == 46 || (isIphone && k == 127)) { - var pos = this.caret(), - begin = pos.begin, - end = pos.end - - if (end - begin === 0) { - begin = k != 46 ? this.seekPrev(begin) : (end = this.seekNext(begin - 1)) - end = k == 46 ? this.seekNext(end) : end - } - this.clearBuffer(begin, end) - this.shiftL(begin, end - 1) - - return false - } else if (k == 27) {//escape - this.$element.val(this.focusText) - this.caret(0, this.checkVal()) - return false - } - } - - Inputmask.prototype.keypressEvent = function(e) { - var len = this.mask.length - - var k = e.which, - pos = this.caret() - - if (e.ctrlKey || e.altKey || e.metaKey || k < 32) {//Ignore - return true - } else if (k) { - if (pos.end - pos.begin !== 0) { - this.clearBuffer(pos.begin, pos.end) - this.shiftL(pos.begin, pos.end - 1) - } - - var p = this.seekNext(pos.begin - 1) - if (p < len) { - var c = String.fromCharCode(k) - if (this.tests[p].test(c)) { - this.shiftR(p) - this.buffer[p] = c - this.writeBuffer() - var next = this.seekNext(p) - this.caret(next) - } - } - return false - } - } - - Inputmask.prototype.pasteEvent = function() { - var that = this - - setTimeout(function() { - that.caret(that.checkVal(true)) - }, 0) - } - - Inputmask.prototype.clearBuffer = function(start, end) { - var len = this.mask.length - - for (var i = start; i < end && i < len; i++) { - if (this.tests[i]) - this.buffer[i] = this.options.placeholder - } - } - - Inputmask.prototype.writeBuffer = function() { - return this.$element.val(this.buffer.join('')).val() - } - - Inputmask.prototype.checkVal = function(allow) { - var len = this.mask.length - //try to place characters where they belong - var test = this.$element.val() - var lastMatch = -1 - - for (var i = 0, pos = 0; i < len; i++) { - if (this.tests[i]) { - this.buffer[i] = this.options.placeholder - while (pos++ < test.length) { - var c = test.charAt(pos - 1) - if (this.tests[i].test(c)) { - this.buffer[i] = c - lastMatch = i - break - } - } - if (pos > test.length) - break - } else if (this.buffer[i] == test.charAt(pos) && i != this.partialPosition) { - pos++ - lastMatch = i - } - } - if (!allow && lastMatch + 1 < this.partialPosition) { - this.$element.val("") - this.clearBuffer(0, len) - } else if (allow || lastMatch + 1 >= this.partialPosition) { - this.writeBuffer() - if (!allow) this.$element.val(this.$element.val().substring(0, lastMatch + 1)) - } - return (this.partialPosition ? i : this.firstNonMaskPos) - } - - - // INPUTMASK PLUGIN DEFINITION - // =========================== - - var old = $.fn.inputmask - - $.fn.inputmask = function (options) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.inputmask') - - if (!data) $this.data('bs.inputmask', (data = new Inputmask(this, options))) - }) - } - - $.fn.inputmask.Constructor = Inputmask - - - // INPUTMASK NO CONFLICT - // ==================== - - $.fn.inputmask.noConflict = function () { - $.fn.inputmask = old - return this - } - - - // INPUTMASK DATA-API - // ================== - - $(document).on('focus.bs.inputmask.data-api', '[data-mask]', function (e) { - var $this = $(this) - if ($this.data('bs.inputmask')) return - $this.inputmask($this.data()) - }) - -}(window.jQuery); diff --git a/public/admin/Coco/assets/libs/bootstrap-select/bootstrap-select.min.css b/public/admin/Coco/assets/libs/bootstrap-select/bootstrap-select.min.css deleted file mode 100644 index 36fd6900e..000000000 --- a/public/admin/Coco/assets/libs/bootstrap-select/bootstrap-select.min.css +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * bootstrap-select v1.4.2 - * http://silviomoreto.github.io/bootstrap-select/ - * - * Copyright 2013 bootstrap-select - * Licensed under the MIT license - */.bootstrap-select.btn-group,.bootstrap-select.btn-group[class*="span"]{float:none;display:inline-block;margin-bottom:10px;margin-left:0}.form-search .bootstrap-select.btn-group,.form-inline .bootstrap-select.btn-group,.form-horizontal .bootstrap-select.btn-group{margin-bottom:0}.bootstrap-select.form-control{margin-bottom:0;padding:0;border:0}.bootstrap-select.btn-group.pull-right,.bootstrap-select.btn-group[class*="span"].pull-right,.row-fluid .bootstrap-select.btn-group[class*="span"].pull-right{float:right}.input-append .bootstrap-select.btn-group{margin-left:-1px}.input-prepend .bootstrap-select.btn-group{margin-right:-1px}.bootstrap-select:not([class*="span"]):not([class*="col-"]):not([class*="form-control"]){width:220px}.bootstrap-select{width:220px\0}.bootstrap-select.form-control:not([class*="span"]){width:100%}.bootstrap-select>.btn{width:100%}.error .bootstrap-select .btn{border:1px solid #b94a48}.dropdown-menu{z-index:2000}.bootstrap-select.show-menu-arrow.open>.btn{z-index:2051}.bootstrap-select .btn:focus{outline:thin dotted #333 !important;outline:5px auto -webkit-focus-ring-color !important;outline-offset:-2px}.bootstrap-select.btn-group .btn .filter-option{overflow:hidden;position:absolute;left:12px;right:25px;text-align:left}.bootstrap-select.btn-group .btn .caret{position:absolute;top:50%;right:12px;margin-top:-2px;vertical-align:middle}.bootstrap-select.btn-group>.disabled,.bootstrap-select.btn-group .dropdown-menu li.disabled>a{cursor:not-allowed}.bootstrap-select.btn-group>.disabled:focus{outline:none !important}.bootstrap-select.btn-group[class*="span"] .btn{width:100%}.bootstrap-select.btn-group .dropdown-menu{min-width:100%;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.bootstrap-select.btn-group .dropdown-menu.inner{position:static;border:0;padding:0;margin:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.bootstrap-select.btn-group .dropdown-menu dt{display:block;padding:3px 20px;cursor:default}.bootstrap-select.btn-group .div-contain{overflow:hidden}.bootstrap-select.btn-group .dropdown-menu li{position:relative}.bootstrap-select.btn-group .dropdown-menu li>a.opt{position:relative;padding-left:35px}.bootstrap-select.btn-group .dropdown-menu li>a{cursor:pointer}.bootstrap-select.btn-group .dropdown-menu li>dt small{font-weight:normal}.bootstrap-select.btn-group.show-tick .dropdown-menu li.selected a i.check-mark{display:inline-block;position:absolute;right:15px;margin-top:2.5px}.bootstrap-select.btn-group .dropdown-menu li a i.check-mark{display:none}.bootstrap-select.btn-group.show-tick .dropdown-menu li a span.text{margin-right:34px}.bootstrap-select.btn-group .dropdown-menu li small{padding-left:.5em}.bootstrap-select.btn-group .dropdown-menu li:not(.disabled)>a:hover small,.bootstrap-select.btn-group .dropdown-menu li:not(.disabled)>a:focus small,.bootstrap-select.btn-group .dropdown-menu li.active:not(.disabled)>a small{color:#64b1d8;color:rgba(255,255,255,0.4)}.bootstrap-select.btn-group .dropdown-menu li>dt small{font-weight:normal}.bootstrap-select.show-menu-arrow .dropdown-toggle:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #CCC;border-bottom-color:rgba(0,0,0,0.2);position:absolute;bottom:-4px;left:9px;display:none}.bootstrap-select.show-menu-arrow .dropdown-toggle:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid white;position:absolute;bottom:-4px;left:10px;display:none}.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:before{bottom:auto;top:-3px;border-top:7px solid #ccc;border-bottom:0;border-top-color:rgba(0,0,0,0.2)}.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:after{bottom:auto;top:-3px;border-top:6px solid #fff;border-bottom:0}.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:before{right:12px;left:auto}.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:after{right:13px;left:auto}.bootstrap-select.show-menu-arrow.open>.dropdown-toggle:before,.bootstrap-select.show-menu-arrow.open>.dropdown-toggle:after{display:block}.bootstrap-select.btn-group .no-results{padding:3px;background:#f5f5f5;margin:0 5px}.mobile-device{position:absolute;top:0;left:0;display:block !important;width:100%;height:100% !important;opacity:0}.bootstrap-select.fit-width{width:auto !important}.bootstrap-select.btn-group.fit-width .btn .filter-option{position:static}.bootstrap-select.btn-group.fit-width .btn .caret{position:static;top:auto;margin-top:-1px}.control-group.error .bootstrap-select .dropdown-toggle{border-color:#b94a48}.bootstrap-select-searchbox{padding:4px 8px}.bootstrap-select-searchbox input{margin-bottom:0} diff --git a/public/admin/Coco/assets/libs/bootstrap-select/bootstrap-select.min.js b/public/admin/Coco/assets/libs/bootstrap-select/bootstrap-select.min.js deleted file mode 100644 index cd4f7fe27..000000000 --- a/public/admin/Coco/assets/libs/bootstrap-select/bootstrap-select.min.js +++ /dev/null @@ -1,8 +0,0 @@ -/*! - * bootstrap-select v1.4.2 - * http://silviomoreto.github.io/bootstrap-select/ - * - * Copyright 2013 bootstrap-select - * Licensed under the MIT license - */ -;!function(b){b.expr[":"].icontains=function(e,c,d){return b(e).text().toUpperCase().indexOf(d[3].toUpperCase())>=0};var a=function(d,c,f){if(f){f.stopPropagation();f.preventDefault()}this.$element=b(d);this.$newElement=null;this.$button=null;this.$menu=null;this.options=b.extend({},b.fn.selectpicker.defaults,this.$element.data(),typeof c=="object"&&c);if(this.options.title===null){this.options.title=this.$element.attr("title")}this.val=a.prototype.val;this.render=a.prototype.render;this.refresh=a.prototype.refresh;this.setStyle=a.prototype.setStyle;this.selectAll=a.prototype.selectAll;this.deselectAll=a.prototype.deselectAll;this.init()};a.prototype={constructor:a,init:function(){this.$element.hide();this.multiple=this.$element.prop("multiple");var d=this.$element.attr("id");this.$newElement=this.createView();this.$element.after(this.$newElement);this.$menu=this.$newElement.find("> .dropdown-menu");this.$button=this.$newElement.find("> button");this.$searchbox=this.$newElement.find("input");if(d!==undefined){var c=this;this.$button.attr("data-id",d);b('label[for="'+d+'"]').click(function(f){f.preventDefault();c.$button.focus()})}this.checkDisabled();this.clickListener();if(this.options.liveSearch){this.liveSearchListener()}this.render();this.liHeight();this.setStyle();this.setWidth();if(this.options.container){this.selectPosition()}this.$menu.data("this",this);this.$newElement.data("this",this)},createDropdown:function(){var c=this.multiple?" show-tick":"";var f=this.options.header?'
            '+this.options.header+"
            ":"";var e=this.options.liveSearch?'':"";var d='
            ';return b(d)},createView:function(){var c=this.createDropdown();var d=this.createLi();c.find("ul").append(d);return c},reloadLi:function(){this.destroyLi();var c=this.createLi();this.$menu.find("ul").append(c)},destroyLi:function(){this.$menu.find("li").remove()},createLi:function(){var d=this,e=[],c="";this.$element.find("option").each(function(){var i=b(this);var g=i.attr("class")||"";var h=i.attr("style")||"";var m=i.data("content")?i.data("content"):i.html();var k=i.data("subtext")!==undefined?''+i.data("subtext")+"":"";var j=i.data("icon")!==undefined?' ':"";if(j!==""&&(i.is(":disabled")||i.parent().is(":disabled"))){j=""+j+""}if(!i.data("content")){m=j+''+m+k+""}if(d.options.hideDisabled&&(i.is(":disabled")||i.parent().is(":disabled"))){e.push('')}else{if(i.parent().is("optgroup")&&i.data("divider")!==true){if(i.index()===0){var l=i.parent().attr("label");var n=i.parent().data("subtext")!==undefined?''+i.parent().data("subtext")+"":"";var f=i.parent().data("icon")?' ':"";l=f+''+l+n+"";if(i[0].index!==0){e.push('
            '+l+"
            "+d.createA(m,"opt "+g,h))}else{e.push("
            "+l+"
            "+d.createA(m,"opt "+g,h))}}else{e.push(d.createA(m,"opt "+g,h))}}else{if(i.data("divider")===true){e.push('
            ')}else{if(b(this).data("hidden")===true){e.push("")}else{e.push(d.createA(m,g,h))}}}}});b.each(e,function(f,g){c+="
          • "+g+"
          • "});if(!this.multiple&&this.$element.find("option:selected").length===0&&!this.options.title){this.$element.find("option").eq(0).prop("selected",true).attr("selected","selected")}return b(c)},createA:function(e,c,d){return''+e+''},render:function(){var d=this;this.$element.find("option").each(function(h){d.setDisabled(h,b(this).is(":disabled")||b(this).parent().is(":disabled"));d.setSelected(h,b(this).is(":selected"))});this.tabIndex();var g=this.$element.find("option:selected").map(function(){var j=b(this);var i=j.data("icon")&&d.options.showIcon?' ':"";var h;if(d.options.showSubtext&&j.attr("data-subtext")&&!d.multiple){h=' '+j.data("subtext")+""}else{h=""}if(j.data("content")&&d.options.showContent){return j.data("content")}else{if(j.attr("title")!==undefined){return j.attr("title")}else{return i+j.html()+h}}}).toArray();var f=!this.multiple?g[0]:g.join(this.options.multipleSeparator);if(this.multiple&&this.options.selectedTextFormat.indexOf("count")>-1){var c=this.options.selectedTextFormat.split(">");var e=this.options.hideDisabled?":not([disabled])":"";if((c.length>1&&g.length>c[1])||(c.length==1&&g.length>=2)){f=this.options.countSelectedText.replace("{0}",g.length).replace("{1}",this.$element.find('option:not([data-divider="true"]):not([data-hidden="true"])'+e).length)}}if(!f){f=this.options.title!==undefined?this.options.title:this.options.noneSelectedText}this.$button.attr("title",b.trim(f));this.$newElement.find(".filter-option").html(f)},setStyle:function(e,d){if(this.$element.attr("class")){this.$newElement.addClass(this.$element.attr("class").replace(/selectpicker|mobile-device/gi,""))}var c=e?e:this.options.style;if(d=="add"){this.$button.addClass(c)}else{if(d=="remove"){this.$button.removeClass(c)}else{this.$button.removeClass(this.options.style);this.$button.addClass(c)}}},liHeight:function(){var e=this.$menu.parent().clone().appendTo("body"),f=e.addClass("open").find("> .dropdown-menu"),d=f.find("li > a").outerHeight(),c=this.options.header?f.find(".popover-title").outerHeight():0,g=this.options.liveSearch?f.find(".bootstrap-select-searchbox").outerHeight():0;e.remove();this.$newElement.data("liHeight",d).data("headerHeight",c).data("searchHeight",g)},setSize:function(){var h=this,d=this.$menu,i=d.find(".inner"),t=this.$newElement.outerHeight(),f=this.$newElement.data("liHeight"),r=this.$newElement.data("headerHeight"),l=this.$newElement.data("searchHeight"),k=d.find("li .divider").outerHeight(true),q=parseInt(d.css("padding-top"))+parseInt(d.css("padding-bottom"))+parseInt(d.css("border-top-width"))+parseInt(d.css("border-bottom-width")),o=this.options.hideDisabled?":not(.disabled)":"",n=b(window),g=q+parseInt(d.css("margin-top"))+parseInt(d.css("margin-bottom"))+2,p,u,s,j=function(){u=h.$newElement.offset().top-n.scrollTop();s=n.height()-u-t};j();if(this.options.header){d.css("padding-top",0)}if(this.options.size=="auto"){var e=function(){var v;j();p=s-g;if(h.options.dropupAuto){h.$newElement.toggleClass("dropup",(u>s)&&((p-g)3){v=f*3+g-2}else{v=0}d.css({"max-height":p+"px",overflow:"hidden","min-height":v+"px"});i.css({"max-height":p-r-l-q+"px","overflow-y":"auto","min-height":v-q+"px"})};e();b(window).resize(e);b(window).scroll(e)}else{if(this.options.size&&this.options.size!="auto"&&d.find("li"+o).length>this.options.size){var m=d.find("li"+o+" > *").filter(":not(.div-contain)").slice(0,this.options.size).last().parent().index();var c=d.find("li").slice(0,m+1).find(".div-contain").length;p=f*this.options.size+c*k+q;if(h.options.dropupAuto){this.$newElement.toggleClass("dropup",(u>s)&&(p .dropdown-menu").css("width");d.remove();this.$newElement.css("width",c)}else{if(this.options.width=="fit"){this.$menu.css("min-width","");this.$newElement.css("width","").addClass("fit-width")}else{if(this.options.width){this.$menu.css("min-width","");this.$newElement.css("width",this.options.width)}else{this.$menu.css("min-width","");this.$newElement.css("width","")}}}if(this.$newElement.hasClass("fit-width")&&this.options.width!=="fit"){this.$newElement.removeClass("fit-width")}},selectPosition:function(){var e=this,d="
            ",f=b(d),h,g,c=function(i){f.addClass(i.attr("class")).toggleClass("dropup",i.hasClass("dropup"));h=i.offset();g=i.hasClass("dropup")?0:i[0].offsetHeight;f.css({top:h.top+g,left:h.left,width:i[0].offsetWidth,position:"absolute"})};this.$newElement.on("click",function(){c(b(this));f.appendTo(e.options.container);f.toggleClass("open",!b(this).hasClass("open"));f.append(e.$menu)});b(window).resize(function(){c(e.$newElement)});b(window).on("scroll",function(){c(e.$newElement)});b("html").on("click",function(i){if(b(i.target).closest(e.$newElement).length<1){f.removeClass("open")}})},mobile:function(){this.$element.addClass("mobile-device").appendTo(this.$newElement);if(this.options.container){this.$menu.hide()}},refresh:function(){this.reloadLi();this.render();this.setWidth();this.setStyle();this.checkDisabled();this.liHeight()},update:function(){this.reloadLi();this.setWidth();this.setStyle();this.checkDisabled();this.liHeight()},setSelected:function(c,d){this.$menu.find("li").eq(c).toggleClass("selected",d)},setDisabled:function(c,d){if(d){this.$menu.find("li").eq(c).addClass("disabled").find("a").attr("href","#").attr("tabindex",-1)}else{this.$menu.find("li").eq(c).removeClass("disabled").find("a").removeAttr("href").attr("tabindex",0)}},isDisabled:function(){return this.$element.is(":disabled")},checkDisabled:function(){var c=this;if(this.isDisabled()){this.$button.addClass("disabled").attr("tabindex",-1)}else{if(this.$button.hasClass("disabled")){this.$button.removeClass("disabled")}if(this.$button.attr("tabindex")==-1){if(!this.$element.data("tabindex")){this.$button.removeAttr("tabindex")}}}this.$button.click(function(){return !c.isDisabled()})},tabIndex:function(){if(this.$element.is("[tabindex]")){this.$element.data("tabindex",this.$element.attr("tabindex"));this.$button.attr("tabindex",this.$element.data("tabindex"))}},clickListener:function(){var c=this;b("body").on("touchstart.dropdown",".dropdown-menu",function(d){d.stopPropagation()});this.$newElement.on("click",function(){c.setSize();if(!c.options.liveSearch&&!c.multiple){setTimeout(function(){c.$menu.find(".selected a").focus()},10)}});this.$menu.on("click","li a",function(k){var g=b(this).parent().index(),j=c.$element.val(),f=c.$element.prop("selectedIndex");if(c.multiple){k.stopPropagation()}k.preventDefault();if(!c.isDisabled()&&!b(this).parent().hasClass("disabled")){var d=c.$element.find("option");var i=d.eq(g);if(!c.multiple){d.prop("selected",false);i.prop("selected",true)}else{var h=i.prop("selected");i.prop("selected",!h)}if(!c.multiple){c.$button.focus()}else{if(c.options.liveSearch){c.$searchbox.focus()}}if((j!=c.$element.val()&&c.multiple)||(f!=c.$element.prop("selectedIndex")&&!c.multiple)){c.$element.change()}}});this.$menu.on("click","li.disabled a, li dt, li .div-contain, .popover-title, .popover-title :not(.close)",function(d){if(d.target==this){d.preventDefault();d.stopPropagation();if(!c.options.liveSearch){c.$button.focus()}else{c.$searchbox.focus()}}});this.$menu.on("click",".popover-title .close",function(){c.$button.focus()});this.$searchbox.on("click",function(d){d.stopPropagation()});this.$element.change(function(){c.render()})},liveSearchListener:function(){var d=this,c=b('
          • ');this.$newElement.on("click.dropdown.data-api",function(){d.$menu.find(".active").removeClass("active");if(!!d.$searchbox.val()){d.$searchbox.val("");d.$menu.find("li").show();if(!!c.parent().length){c.remove()}}if(!d.multiple){d.$menu.find(".selected").addClass("active")}setTimeout(function(){d.$searchbox.focus()},10)});this.$searchbox.on("input propertychange",function(){if(d.$searchbox.val()){d.$menu.find("li").show().not(":icontains("+d.$searchbox.val()+")").hide();if(!d.$menu.find("li").filter(":visible:not(.no-results)").length){if(!!c.parent().length){c.remove()}c.html('No results match "'+d.$searchbox.val()+'"').show();d.$menu.find("li").last().after(c)}else{if(!!c.parent().length){c.remove()}}}else{d.$menu.find("li").show();if(!!c.parent().length){c.remove()}}d.$menu.find("li.active").removeClass("active");d.$menu.find("li").filter(":visible:not(.divider)").eq(0).addClass("active").find("a").focus();b(this).focus()});this.$menu.on("mouseenter","a",function(f){d.$menu.find(".active").removeClass("active");b(f.currentTarget).parent().not(".disabled").addClass("active")});this.$menu.on("mouseleave","a",function(){d.$menu.find(".active").removeClass("active")})},val:function(c){if(c!==undefined){this.$element.val(c);this.$element.change();return this.$element}else{return this.$element.val()}},selectAll:function(){this.$element.find("option").prop("selected",true).attr("selected","selected");this.render()},deselectAll:function(){this.$element.find("option").prop("selected",false).removeAttr("selected");this.render()},keydown:function(p){var q,o,i,n,k,j,r,f,h,m,d,s,g={32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"};q=b(this);i=q.parent();if(q.is("input")){i=q.parent().parent()}m=i.data("this");if(m.options.liveSearch){i=q.parent().parent()}if(m.options.container){i=m.$menu}o=b("[role=menu] li:not(.divider) a",i);s=m.$menu.parent().hasClass("open");if(m.options.liveSearch){if(/(^9$|27)/.test(p.keyCode)&&s&&m.$menu.find(".active").length===0){p.preventDefault();m.$menu.parent().removeClass("open");m.$button.focus()}o=b("[role=menu] li:not(.divider):visible",i);if(!q.val()&&!/(38|40)/.test(p.keyCode)){if(o.filter(".active").length===0){o=m.$newElement.find("li").filter(":icontains("+g[p.keyCode]+")")}}}if(!o.length){return}if(/(38|40)/.test(p.keyCode)){if(!s){m.$menu.parent().addClass("open")}n=o.index(o.filter(":focus"));j=o.parent(":not(.disabled):visible").first().index();r=o.parent(":not(.disabled):visible").last().index();k=o.eq(n).parent().nextAll(":not(.disabled):visible").eq(0).index();f=o.eq(n).parent().prevAll(":not(.disabled):visible").eq(0).index();h=o.eq(k).parent().prevAll(":not(.disabled):visible").eq(0).index();if(m.options.liveSearch){o.each(function(e){if(b(this).is(":not(.disabled)")){b(this).data("index",e)}});n=o.index(o.filter(".active"));j=o.filter(":not(.disabled):visible").first().data("index");r=o.filter(":not(.disabled):visible").last().data("index");k=o.eq(n).nextAll(":not(.disabled):visible").eq(0).data("index");f=o.eq(n).prevAll(":not(.disabled):visible").eq(0).data("index");h=o.eq(k).prevAll(":not(.disabled):visible").eq(0).data("index")}d=q.data("prevIndex");if(p.keyCode==38){if(m.options.liveSearch){n-=1}if(n!=h&&n>f){n=f}if(nr){n=r}if(n==d){n=j}}q.data("prevIndex",n);if(!m.options.liveSearch){o.eq(n).focus()}else{p.preventDefault();if(!q.is(".dropdown-toggle")){o.removeClass("active");o.eq(n).addClass("active").find("a").focus();q.focus()}}}else{if(!q.is("input")){var c=[],l,t;o.each(function(){if(b(this).parent().is(":not(.disabled)")){if(b.trim(b(this).text().toLowerCase()).substring(0,1)==g[p.keyCode]){c.push(b(this).parent().index())}}});l=b(document).data("keycount");l++;b(document).data("keycount",l);t=b.trim(b(":focus").text().toLowerCase()).substring(0,1);if(t!=g[p.keyCode]){l=1;b(document).data("keycount",l)}else{if(l>=c.length){b(document).data("keycount",0);if(l>c.length){l=1}}}o.eq(c[l-1]).focus()}}if(/(13|32|^9$)/.test(p.keyCode)&&s){if(!/(32)/.test(p.keyCode)){p.preventDefault()}if(!m.options.liveSearch){b(":focus").click()}else{if(!/(32)/.test(p.keyCode)){m.$menu.find(".active a").click();q.focus()}}b(document).data("keycount",0)}if((/(^9$|27)/.test(p.keyCode)&&s&&(m.multiple||m.options.liveSearch))||(/(27)/.test(p.keyCode)&&!s)){m.$menu.parent().removeClass("open");m.$button.focus()}},hide:function(){this.$newElement.hide()},show:function(){this.$newElement.show()},destroy:function(){this.$newElement.remove();this.$element.remove()}};b.fn.selectpicker=function(e,f){var c=arguments;var g;var d=this.each(function(){if(b(this).is("select")){var m=b(this),l=m.data("selectpicker"),h=typeof e=="object"&&e;if(!l){m.data("selectpicker",(l=new a(this,h,f)))}else{if(h){for(var j in h){l.options[j]=h[j]}}}if(typeof e=="string"){var k=e;if(l[k] instanceof Function){[].shift.apply(c);g=l[k].apply(l,c)}else{g=l.options[k]}}}});if(g!==undefined){return g}else{return d}};b.fn.selectpicker.defaults={style:"btn-default",size:"auto",title:null,selectedTextFormat:"values",noneSelectedText:"Nothing selected",countSelectedText:"{0} of {1} selected",width:false,container:false,hideDisabled:false,showSubtext:false,showIcon:true,showContent:true,dropupAuto:true,header:false,liveSearch:false,multipleSeparator:", ",iconBase:"glyphicon",tickIcon:"glyphicon-ok"};b(document).data("keycount",0).on("keydown",".bootstrap-select [data-toggle=dropdown], .bootstrap-select [role=menu], .bootstrap-select-searchbox input",a.prototype.keydown).on("focusin.modal",".bootstrap-select [data-toggle=dropdown], .bootstrap-select [role=menu], .bootstrap-select-searchbox input",function(c){c.stopPropagation()})}(window.jQuery); \ No newline at end of file diff --git a/public/admin/Coco/assets/libs/bootstrap-select2/select2-spinner.gif b/public/admin/Coco/assets/libs/bootstrap-select2/select2-spinner.gif deleted file mode 100644 index 5b33f7e54..000000000 Binary files a/public/admin/Coco/assets/libs/bootstrap-select2/select2-spinner.gif and /dev/null differ diff --git a/public/admin/Coco/assets/libs/bootstrap-select2/select2.css b/public/admin/Coco/assets/libs/bootstrap-select2/select2.css deleted file mode 100644 index 6bad4dc21..000000000 --- a/public/admin/Coco/assets/libs/bootstrap-select2/select2.css +++ /dev/null @@ -1,589 +0,0 @@ -/* -Version: 3.4.3 Timestamp: Tue Sep 17 06:47:14 PDT 2013 -*/ -.select2-container { - margin: 0; - position: relative; - display: inline-block; - /* inline-block for ie7 */ - zoom: 1; - *display: inline; - vertical-align: middle; -} - -.select2-container, -.select2-drop, -.select2-search, -.select2-search input { - /* - Force border-box so that % widths fit the parent - container without overlap because of margin/padding. - - More Info : http://www.quirksmode.org/css/box.html - */ - -webkit-box-sizing: border-box; /* webkit */ - -moz-box-sizing: border-box; /* firefox */ - box-sizing: border-box; /* css3 */ -} - -.select2-container .select2-choice { - display: block; - height: 26px; - padding: 0 0 0 8px; - overflow: hidden; - position: relative; - - border: 1px solid #aaa; - white-space: nowrap; - line-height: 26px; - color: #444; - text-decoration: none; - - border-radius: 4px; - - background-clip: padding-box; - - -webkit-touch-callout: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - - background-color: #fff; -} - -.select2-container.select2-drop-above .select2-choice { - border-bottom-color: #aaa; - - border-radius: 0 0 4px 4px; - -} - -.select2-container.select2-allowclear .select2-choice .select2-chosen { - margin-right: 42px; -} - -.select2-container .select2-choice > .select2-chosen { - margin-right: 26px; - display: block; - overflow: hidden; - - white-space: nowrap; - - text-overflow: ellipsis; -} - -.select2-container .select2-choice abbr { - display: none; - width: 12px; - height: 12px; - position: absolute; - right: 24px; - top: 8px; - - font-size: 1px; - text-decoration: none; - - border: 0; - background: url('select2.png') right top no-repeat; - cursor: pointer; - outline: 0; -} - -.select2-container.select2-allowclear .select2-choice abbr { - display: inline-block; -} - -.select2-container .select2-choice abbr:hover { - background-position: right -11px; - cursor: pointer; -} - -.select2-drop-mask { - border: 0; - margin: 0; - padding: 0; - position: fixed; - left: 0; - top: 0; - min-height: 100%; - min-width: 100%; - height: auto; - width: auto; - opacity: 0; - z-index: 9998; - /* styles required for IE to work */ - background-color: #fff; - filter: alpha(opacity=0); -} - -.select2-drop { - width: 100%; - margin-top: -1px; - position: absolute; - z-index: 9999; - top: 100%; - - background: #fff; - color: #000; - border: 1px solid #aaa; - border-top: 0; - - border-radius: 0 0 4px 4px; - - -webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15); - box-shadow: 0 4px 5px rgba(0, 0, 0, .15); -} - -.select2-drop-auto-width { - border-top: 1px solid #aaa; - width: auto; -} - -.select2-drop-auto-width .select2-search { - padding-top: 4px; -} - -.select2-drop.select2-drop-above { - margin-top: 1px; - border-top: 1px solid #aaa; - border-bottom: 0; - - border-radius: 4px 4px 0 0; - - -webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15); - box-shadow: 0 -4px 5px rgba(0, 0, 0, .15); -} - -.select2-drop-active { - border: 1px solid #5897fb; - border-top: none; -} - -.select2-drop.select2-drop-above.select2-drop-active { - border-top: 1px solid #5897fb; -} - -.select2-container .select2-choice .select2-arrow { - display: inline-block; - width: 18px; - height: 100%; - position: absolute; - right: 0; - top: 0; - - border-left: 1px solid #aaa; - border-radius: 0 4px 4px 0; - - background-clip: padding-box; - - background: #ccc; -} - -.select2-container .select2-choice .select2-arrow b { - display: block; - width: 100%; - height: 100%; - background: url('select2.png') no-repeat 0 1px; -} - -.select2-search { - display: inline-block; - width: 100%; - min-height: 26px; - margin: 0; - padding-left: 4px; - padding-right: 4px; - position: relative; - z-index: 10000; - white-space: nowrap; -} - -.select2-search input { - width: 100%; - height: auto !important; - min-height: 26px; - padding: 4px 20px 4px 5px; - margin: 0; - - outline: 0; - font-family: sans-serif; - font-size: 1em; - - border: 1px solid #aaa; - border-radius: 0; - - -webkit-box-shadow: none; - box-shadow: none; - - background: #fff url('select2.png') no-repeat 100% -22px; - background: url('select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee)); - background: url('select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%); - background: url('select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%); - background: url('select2.png') no-repeat 100% -22px, linear-gradient(top, #fff 85%, #eee 99%); -} - -.select2-drop.select2-drop-above .select2-search input { - margin-top: 4px; -} - -.select2-search input.select2-active { - background: #fff url('select2-spinner.gif') no-repeat 100%; - background: url('select2-spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee)); - background: url('select2-spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%); - background: url('select2-spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%); - background: url('select2-spinner.gif') no-repeat 100%, linear-gradient(top, #fff 85%, #eee 99%); -} - -.select2-container-active .select2-choice, -.select2-container-active .select2-choices { - border: 1px solid #5897fb; - outline: none; - - -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .3); - box-shadow: 0 0 5px rgba(0, 0, 0, .3); -} - -.select2-dropdown-open .select2-choice { - border-bottom-color: transparent; - -webkit-box-shadow: 0 1px 0 #fff inset; - box-shadow: 0 1px 0 #fff inset; - - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; - - background-color: #eee; - background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #fff), color-stop(0.5, #eee)); - background-image: -webkit-linear-gradient(center bottom, #fff 0%, #eee 50%); - background-image: -moz-linear-gradient(center bottom, #fff 0%, #eee 50%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0); - background-image: linear-gradient(top, #fff 0%, #eee 50%); -} - -.select2-dropdown-open.select2-drop-above .select2-choice, -.select2-dropdown-open.select2-drop-above .select2-choices { - border: 1px solid #5897fb; - border-top-color: transparent; - - background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), color-stop(0.5, #eee)); - background-image: -webkit-linear-gradient(center top, #fff 0%, #eee 50%); - background-image: -moz-linear-gradient(center top, #fff 0%, #eee 50%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0); - background-image: linear-gradient(bottom, #fff 0%, #eee 50%); -} - -.select2-dropdown-open .select2-choice .select2-arrow { - background: transparent; - border-left: none; - filter: none; -} -.select2-dropdown-open .select2-choice .select2-arrow b { - background-position: -18px 1px; -} - -/* results */ -.select2-results { - max-height: 200px; - padding: 0 0 0 4px; - margin: 4px 4px 4px 0; - position: relative; - overflow-x: hidden; - overflow-y: auto; - -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -} - -.select2-results ul.select2-result-sub { - margin: 0; - padding-left: 0; -} - -.select2-results ul.select2-result-sub > li .select2-result-label { padding-left: 20px } -.select2-results ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 40px } -.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 60px } -.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 80px } -.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 100px } -.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 110px } -.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 120px } - -.select2-results li { - list-style: none; - display: list-item; - background-image: none; -} - -.select2-results li.select2-result-with-children > .select2-result-label { - font-weight: bold; -} - -.select2-results .select2-result-label { - padding: 3px 7px 4px; - margin: 0; - cursor: pointer; - - min-height: 1em; - - -webkit-touch-callout: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -.select2-results .select2-highlighted { - background: #3875d7; - color: #fff; -} - -.select2-results li em { - background: #feffde; - font-style: normal; -} - -.select2-results .select2-highlighted em { - background: transparent; -} - -.select2-results .select2-highlighted ul { - background: #fff; - color: #000; -} - - -.select2-results .select2-no-results, -.select2-results .select2-searching, -.select2-results .select2-selection-limit { - background: #f4f4f4; - display: list-item; -} - -/* -disabled look for disabled choices in the results dropdown -*/ -.select2-results .select2-disabled.select2-highlighted { - color: #666; - background: #f4f4f4; - display: list-item; - cursor: default; -} -.select2-results .select2-disabled { - background: #f4f4f4; - display: list-item; - cursor: default; -} - -.select2-results .select2-selected { - display: none; -} - -.select2-more-results.select2-active { - background: #f4f4f4 url('select2-spinner.gif') no-repeat 100%; -} - -.select2-more-results { - background: #f4f4f4; - display: list-item; -} - -/* disabled styles */ - -.select2-container.select2-container-disabled .select2-choice { - background-color: #f4f4f4; - background-image: none; - border: 1px solid #ddd; - cursor: default; -} - -.select2-container.select2-container-disabled .select2-choice .select2-arrow { - background-color: #f4f4f4; - background-image: none; - border-left: 0; -} - -.select2-container.select2-container-disabled .select2-choice abbr { - display: none; -} - - -/* multiselect */ - -.select2-container-multi .select2-choices { - height: auto !important; - height: 1%; - margin: 0; - padding: 0; - position: relative; - - border: 1px solid #aaa; - cursor: text; - overflow: hidden; - - background-color: #fff; - background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eee), color-stop(15%, #fff)); - background-image: -webkit-linear-gradient(top, #eee 1%, #fff 15%); - background-image: -moz-linear-gradient(top, #eee 1%, #fff 15%); - background-image: linear-gradient(top, #eee 1%, #fff 15%); -} - -.select2-locked { - padding: 3px 5px 3px 5px !important; -} - -.select2-container-multi .select2-choices { - min-height: 26px; -} - -.select2-container-multi.select2-container-active .select2-choices { - border: 1px solid #5897fb; - outline: none; - - -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .3); - box-shadow: 0 0 5px rgba(0, 0, 0, .3); -} -.select2-container-multi .select2-choices li { - float: left; - list-style: none; -} -.select2-container-multi .select2-choices .select2-search-field { - margin: 0; - padding: 0; - white-space: nowrap; -} - -.select2-container-multi .select2-choices .select2-search-field input { - padding: 5px; - margin: 1px 0; - - font-family: sans-serif; - font-size: 100%; - color: #666; - outline: 0; - border: 0; - -webkit-box-shadow: none; - box-shadow: none; - background: transparent !important; -} - -.select2-container-multi .select2-choices .select2-search-field input.select2-active { - background: #fff url('select2-spinner.gif') no-repeat 100% !important; -} - -.select2-default { - color: #999 !important; -} - -.select2-container-multi .select2-choices .select2-search-choice { - padding: 3px 5px 3px 18px; - margin: 3px 0 3px 5px; - position: relative; - - line-height: 13px; - color: #333; - cursor: default; - border: 1px solid #aaaaaa; - - border-radius: 3px; - - -webkit-box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05); - box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05); - - background-clip: padding-box; - - -webkit-touch-callout: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - - background-color: #e4e4e4; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#f4f4f4', GradientType=0); - background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eee)); - background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%); - background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%); - background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%); -} -.select2-container-multi .select2-choices .select2-search-choice .select2-chosen { - cursor: default; -} -.select2-container-multi .select2-choices .select2-search-choice-focus { - background: #d4d4d4; -} - -.select2-search-choice-close { - display: block; - width: 12px; - height: 13px; - position: absolute; - right: 3px; - top: 4px; - - font-size: 1px; - outline: none; - background: url('select2.png') right top no-repeat; -} - -.select2-container-multi .select2-search-choice-close { - left: 3px; -} - -.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover { - background-position: right -11px; -} -.select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close { - background-position: right -11px; -} - -/* disabled styles */ -.select2-container-multi.select2-container-disabled .select2-choices { - background-color: #f4f4f4; - background-image: none; - border: 1px solid #ddd; - cursor: default; -} - -.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice { - padding: 3px 5px 3px 5px; - border: 1px solid #ddd; - background-image: none; - background-color: #f4f4f4; -} - -.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close { display: none; - background: none; -} -/* end multiselect */ - - -.select2-result-selectable .select2-match, -.select2-result-unselectable .select2-match { - text-decoration: underline; -} - -.select2-offscreen, .select2-offscreen:focus { - clip: rect(0 0 0 0) !important; - width: 1px !important; - height: 1px !important; - border: 0 !important; - margin: 0 !important; - padding: 0 !important; - overflow: hidden !important; - position: absolute !important; - outline: 0 !important; - left: 0px !important; - top: 0px !important; -} - -.select2-display-none { - display: none; -} - -.select2-measure-scrollbar { - position: absolute; - top: -10000px; - left: -10000px; - width: 100px; - height: 100px; - overflow: scroll; -} -/* Retina-ize icons */ - - diff --git a/public/admin/Coco/assets/libs/bootstrap-select2/select2.min.js b/public/admin/Coco/assets/libs/bootstrap-select2/select2.min.js deleted file mode 100644 index 0910fdfe8..000000000 --- a/public/admin/Coco/assets/libs/bootstrap-select2/select2.min.js +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright 2012 Igor Vaynberg - -Version: 3.4.3 Timestamp: Tue Sep 17 06:47:14 PDT 2013 - -This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU -General Public License version 2 (the "GPL License"). You may choose either license to govern your -use of this software only upon the condition that you accept all of the terms of either the Apache -License or the GPL License. - -You may obtain a copy of the Apache License and the GPL License at: - -http://www.apache.org/licenses/LICENSE-2.0 -http://www.gnu.org/licenses/gpl-2.0.html - -Unless required by applicable law or agreed to in writing, software distributed under the Apache License -or the GPL Licesnse is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -either express or implied. See the Apache License and the GPL License for the specific language governing -permissions and limitations under the Apache License and the GPL License. -*/ -!function(a){"undefined"==typeof a.fn.each2&&a.extend(a.fn,{each2:function(b){for(var c=a([0]),d=-1,e=this.length;++dc;c++)e=a.charAt(c),b+=m[e]||e;return b}function o(a,b){for(var c=0,d=b.length;d>c;c+=1)if(q(a,b[c]))return c;return-1}function p(){var b=a(l);b.appendTo("body");var c={width:b.width()-b[0].clientWidth,height:b.height()-b[0].clientHeight};return b.remove(),c}function q(a,c){return a===c?!0:a===b||c===b?!1:null===a||null===c?!1:a.constructor===String?a+""==c+"":c.constructor===String?c+""==a+"":!1}function r(b,c){var d,e,f;if(null===b||b.length<1)return[];for(d=b.split(c),e=0,f=d.length;f>e;e+=1)d[e]=a.trim(d[e]);return d}function s(a){return a.outerWidth(!1)-a.width()}function t(c){var d="keyup-change-value";c.on("keydown",function(){a.data(c,d)===b&&a.data(c,d,c.val())}),c.on("keyup",function(){var e=a.data(c,d);e!==b&&c.val()!==e&&(a.removeData(c,d),c.trigger("keyup-change"))})}function u(c){c.on("mousemove",function(c){var d=i;(d===b||d.x!==c.pageX||d.y!==c.pageY)&&a(c.target).trigger("mousemove-filtered",c)})}function v(a,c,d){d=d||b;var e;return function(){var b=arguments;window.clearTimeout(e),e=window.setTimeout(function(){c.apply(d,b)},a)}}function w(a){var c,b=!1;return function(){return b===!1&&(c=a(),b=!0),c}}function x(a,b){var c=v(a,function(a){b.trigger("scroll-debounced",a)});b.on("scroll",function(a){o(a.target,b.get())>=0&&c(a)})}function y(a){a[0]!==document.activeElement&&window.setTimeout(function(){var d,b=a[0],c=a.val().length;a.focus(),a.is(":visible")&&b===document.activeElement&&(b.setSelectionRange?b.setSelectionRange(c,c):b.createTextRange&&(d=b.createTextRange(),d.collapse(!1),d.select()))},0)}function z(b){b=a(b)[0];var c=0,d=0;if("selectionStart"in b)c=b.selectionStart,d=b.selectionEnd-c;else if("selection"in document){b.focus();var e=document.selection.createRange();d=document.selection.createRange().text.length,e.moveStart("character",-b.value.length),c=e.text.length-d}return{offset:c,length:d}}function A(a){a.preventDefault(),a.stopPropagation()}function B(a){a.preventDefault(),a.stopImmediatePropagation()}function C(b){if(!h){var c=b[0].currentStyle||window.getComputedStyle(b[0],null);h=a(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:c.fontSize,fontFamily:c.fontFamily,fontStyle:c.fontStyle,fontWeight:c.fontWeight,letterSpacing:c.letterSpacing,textTransform:c.textTransform,whiteSpace:"nowrap"}),h.attr("class","select2-sizer"),a("body").append(h)}return h.text(b.val()),h.width()}function D(b,c,d){var e,g,f=[];e=b.attr("class"),e&&(e=""+e,a(e.split(" ")).each2(function(){0===this.indexOf("select2-")&&f.push(this)})),e=c.attr("class"),e&&(e=""+e,a(e.split(" ")).each2(function(){0!==this.indexOf("select2-")&&(g=d(this),g&&f.push(this))})),b.attr("class",f.join(" "))}function E(a,b,c,d){var e=n(a.toUpperCase()).indexOf(n(b.toUpperCase())),f=b.length;return 0>e?(c.push(d(a)),void 0):(c.push(d(a.substring(0,e))),c.push(""),c.push(d(a.substring(e,e+f))),c.push(""),c.push(d(a.substring(e+f,a.length))),void 0)}function F(a){var b={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})}function G(c){var d,e=null,f=c.quietMillis||100,g=c.url,h=this;return function(i){window.clearTimeout(d),d=window.setTimeout(function(){var d=c.data,f=g,j=c.transport||a.fn.select2.ajaxDefaults.transport,k={type:c.type||"GET",cache:c.cache||!1,jsonpCallback:c.jsonpCallback||b,dataType:c.dataType||"json"},l=a.extend({},a.fn.select2.ajaxDefaults.params,k);d=d?d.call(h,i.term,i.page,i.context):null,f="function"==typeof f?f.call(h,i.term,i.page,i.context):f,e&&e.abort(),c.params&&(a.isFunction(c.params)?a.extend(l,c.params.call(h)):a.extend(l,c.params)),a.extend(l,{url:f,dataType:c.dataType,data:d,success:function(a){var b=c.results(a,i.page);i.callback(b)}}),e=j.call(h,l)},f)}}function H(b){var d,e,c=b,f=function(a){return""+a.text};a.isArray(c)&&(e=c,c={results:e}),a.isFunction(c)===!1&&(e=c,c=function(){return e});var g=c();return g.text&&(f=g.text,a.isFunction(f)||(d=g.text,f=function(a){return a[d]})),function(b){var g,d=b.term,e={results:[]};return""===d?(b.callback(c()),void 0):(g=function(c,e){var h,i;if(c=c[0],c.children){h={};for(i in c)c.hasOwnProperty(i)&&(h[i]=c[i]);h.children=[],a(c.children).each2(function(a,b){g(b,h.children)}),(h.children.length||b.matcher(d,f(h),c))&&e.push(h)}else b.matcher(d,f(c),c)&&e.push(c)},a(c().results).each2(function(a,b){g(b,e.results)}),b.callback(e),void 0)}}function I(c){var d=a.isFunction(c);return function(e){var f=e.term,g={results:[]};a(d?c():c).each(function(){var a=this.text!==b,c=a?this.text:this;(""===f||e.matcher(f,c))&&g.results.push(a?this:{id:this,text:this})}),e.callback(g)}}function J(b,c){if(a.isFunction(b))return!0;if(!b)return!1;throw new Error(c+" must be a function or a falsy value")}function K(b){return a.isFunction(b)?b():b}function L(b){var c=0;return a.each(b,function(a,b){b.children?c+=L(b.children):c++}),c}function M(a,c,d,e){var h,i,j,k,l,f=a,g=!1;if(!e.createSearchChoice||!e.tokenSeparators||e.tokenSeparators.length<1)return b;for(;;){for(i=-1,j=0,k=e.tokenSeparators.length;k>j&&(l=e.tokenSeparators[j],i=a.indexOf(l),!(i>=0));j++);if(0>i)break;if(h=a.substring(0,i),a=a.substring(i+l.length),h.length>0&&(h=e.createSearchChoice.call(this,h,c),h!==b&&null!==h&&e.id(h)!==b&&null!==e.id(h))){for(g=!1,j=0,k=c.length;k>j;j++)if(q(e.id(h),e.id(c[j]))){g=!0;break}g||d(h)}}return f!==a?a:void 0}function N(b,c){var d=function(){};return d.prototype=new b,d.prototype.constructor=d,d.prototype.parent=b.prototype,d.prototype=a.extend(d.prototype,c),d}if(window.Select2===b){var c,d,e,f,g,h,j,k,i={x:0,y:0},c={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(a){switch(a=a.which?a.which:a){case c.LEFT:case c.RIGHT:case c.UP:case c.DOWN:return!0}return!1},isControl:function(a){var b=a.which;switch(b){case c.SHIFT:case c.CTRL:case c.ALT:return!0}return a.metaKey?!0:!1},isFunctionKey:function(a){return a=a.which?a.which:a,a>=112&&123>=a}},l="
            ",m={"\u24b6":"A","\uff21":"A","\xc0":"A","\xc1":"A","\xc2":"A","\u1ea6":"A","\u1ea4":"A","\u1eaa":"A","\u1ea8":"A","\xc3":"A","\u0100":"A","\u0102":"A","\u1eb0":"A","\u1eae":"A","\u1eb4":"A","\u1eb2":"A","\u0226":"A","\u01e0":"A","\xc4":"A","\u01de":"A","\u1ea2":"A","\xc5":"A","\u01fa":"A","\u01cd":"A","\u0200":"A","\u0202":"A","\u1ea0":"A","\u1eac":"A","\u1eb6":"A","\u1e00":"A","\u0104":"A","\u023a":"A","\u2c6f":"A","\ua732":"AA","\xc6":"AE","\u01fc":"AE","\u01e2":"AE","\ua734":"AO","\ua736":"AU","\ua738":"AV","\ua73a":"AV","\ua73c":"AY","\u24b7":"B","\uff22":"B","\u1e02":"B","\u1e04":"B","\u1e06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24b8":"C","\uff23":"C","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\xc7":"C","\u1e08":"C","\u0187":"C","\u023b":"C","\ua73e":"C","\u24b9":"D","\uff24":"D","\u1e0a":"D","\u010e":"D","\u1e0c":"D","\u1e10":"D","\u1e12":"D","\u1e0e":"D","\u0110":"D","\u018b":"D","\u018a":"D","\u0189":"D","\ua779":"D","\u01f1":"DZ","\u01c4":"DZ","\u01f2":"Dz","\u01c5":"Dz","\u24ba":"E","\uff25":"E","\xc8":"E","\xc9":"E","\xca":"E","\u1ec0":"E","\u1ebe":"E","\u1ec4":"E","\u1ec2":"E","\u1ebc":"E","\u0112":"E","\u1e14":"E","\u1e16":"E","\u0114":"E","\u0116":"E","\xcb":"E","\u1eba":"E","\u011a":"E","\u0204":"E","\u0206":"E","\u1eb8":"E","\u1ec6":"E","\u0228":"E","\u1e1c":"E","\u0118":"E","\u1e18":"E","\u1e1a":"E","\u0190":"E","\u018e":"E","\u24bb":"F","\uff26":"F","\u1e1e":"F","\u0191":"F","\ua77b":"F","\u24bc":"G","\uff27":"G","\u01f4":"G","\u011c":"G","\u1e20":"G","\u011e":"G","\u0120":"G","\u01e6":"G","\u0122":"G","\u01e4":"G","\u0193":"G","\ua7a0":"G","\ua77d":"G","\ua77e":"G","\u24bd":"H","\uff28":"H","\u0124":"H","\u1e22":"H","\u1e26":"H","\u021e":"H","\u1e24":"H","\u1e28":"H","\u1e2a":"H","\u0126":"H","\u2c67":"H","\u2c75":"H","\ua78d":"H","\u24be":"I","\uff29":"I","\xcc":"I","\xcd":"I","\xce":"I","\u0128":"I","\u012a":"I","\u012c":"I","\u0130":"I","\xcf":"I","\u1e2e":"I","\u1ec8":"I","\u01cf":"I","\u0208":"I","\u020a":"I","\u1eca":"I","\u012e":"I","\u1e2c":"I","\u0197":"I","\u24bf":"J","\uff2a":"J","\u0134":"J","\u0248":"J","\u24c0":"K","\uff2b":"K","\u1e30":"K","\u01e8":"K","\u1e32":"K","\u0136":"K","\u1e34":"K","\u0198":"K","\u2c69":"K","\ua740":"K","\ua742":"K","\ua744":"K","\ua7a2":"K","\u24c1":"L","\uff2c":"L","\u013f":"L","\u0139":"L","\u013d":"L","\u1e36":"L","\u1e38":"L","\u013b":"L","\u1e3c":"L","\u1e3a":"L","\u0141":"L","\u023d":"L","\u2c62":"L","\u2c60":"L","\ua748":"L","\ua746":"L","\ua780":"L","\u01c7":"LJ","\u01c8":"Lj","\u24c2":"M","\uff2d":"M","\u1e3e":"M","\u1e40":"M","\u1e42":"M","\u2c6e":"M","\u019c":"M","\u24c3":"N","\uff2e":"N","\u01f8":"N","\u0143":"N","\xd1":"N","\u1e44":"N","\u0147":"N","\u1e46":"N","\u0145":"N","\u1e4a":"N","\u1e48":"N","\u0220":"N","\u019d":"N","\ua790":"N","\ua7a4":"N","\u01ca":"NJ","\u01cb":"Nj","\u24c4":"O","\uff2f":"O","\xd2":"O","\xd3":"O","\xd4":"O","\u1ed2":"O","\u1ed0":"O","\u1ed6":"O","\u1ed4":"O","\xd5":"O","\u1e4c":"O","\u022c":"O","\u1e4e":"O","\u014c":"O","\u1e50":"O","\u1e52":"O","\u014e":"O","\u022e":"O","\u0230":"O","\xd6":"O","\u022a":"O","\u1ece":"O","\u0150":"O","\u01d1":"O","\u020c":"O","\u020e":"O","\u01a0":"O","\u1edc":"O","\u1eda":"O","\u1ee0":"O","\u1ede":"O","\u1ee2":"O","\u1ecc":"O","\u1ed8":"O","\u01ea":"O","\u01ec":"O","\xd8":"O","\u01fe":"O","\u0186":"O","\u019f":"O","\ua74a":"O","\ua74c":"O","\u01a2":"OI","\ua74e":"OO","\u0222":"OU","\u24c5":"P","\uff30":"P","\u1e54":"P","\u1e56":"P","\u01a4":"P","\u2c63":"P","\ua750":"P","\ua752":"P","\ua754":"P","\u24c6":"Q","\uff31":"Q","\ua756":"Q","\ua758":"Q","\u024a":"Q","\u24c7":"R","\uff32":"R","\u0154":"R","\u1e58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1e5a":"R","\u1e5c":"R","\u0156":"R","\u1e5e":"R","\u024c":"R","\u2c64":"R","\ua75a":"R","\ua7a6":"R","\ua782":"R","\u24c8":"S","\uff33":"S","\u1e9e":"S","\u015a":"S","\u1e64":"S","\u015c":"S","\u1e60":"S","\u0160":"S","\u1e66":"S","\u1e62":"S","\u1e68":"S","\u0218":"S","\u015e":"S","\u2c7e":"S","\ua7a8":"S","\ua784":"S","\u24c9":"T","\uff34":"T","\u1e6a":"T","\u0164":"T","\u1e6c":"T","\u021a":"T","\u0162":"T","\u1e70":"T","\u1e6e":"T","\u0166":"T","\u01ac":"T","\u01ae":"T","\u023e":"T","\ua786":"T","\ua728":"TZ","\u24ca":"U","\uff35":"U","\xd9":"U","\xda":"U","\xdb":"U","\u0168":"U","\u1e78":"U","\u016a":"U","\u1e7a":"U","\u016c":"U","\xdc":"U","\u01db":"U","\u01d7":"U","\u01d5":"U","\u01d9":"U","\u1ee6":"U","\u016e":"U","\u0170":"U","\u01d3":"U","\u0214":"U","\u0216":"U","\u01af":"U","\u1eea":"U","\u1ee8":"U","\u1eee":"U","\u1eec":"U","\u1ef0":"U","\u1ee4":"U","\u1e72":"U","\u0172":"U","\u1e76":"U","\u1e74":"U","\u0244":"U","\u24cb":"V","\uff36":"V","\u1e7c":"V","\u1e7e":"V","\u01b2":"V","\ua75e":"V","\u0245":"V","\ua760":"VY","\u24cc":"W","\uff37":"W","\u1e80":"W","\u1e82":"W","\u0174":"W","\u1e86":"W","\u1e84":"W","\u1e88":"W","\u2c72":"W","\u24cd":"X","\uff38":"X","\u1e8a":"X","\u1e8c":"X","\u24ce":"Y","\uff39":"Y","\u1ef2":"Y","\xdd":"Y","\u0176":"Y","\u1ef8":"Y","\u0232":"Y","\u1e8e":"Y","\u0178":"Y","\u1ef6":"Y","\u1ef4":"Y","\u01b3":"Y","\u024e":"Y","\u1efe":"Y","\u24cf":"Z","\uff3a":"Z","\u0179":"Z","\u1e90":"Z","\u017b":"Z","\u017d":"Z","\u1e92":"Z","\u1e94":"Z","\u01b5":"Z","\u0224":"Z","\u2c7f":"Z","\u2c6b":"Z","\ua762":"Z","\u24d0":"a","\uff41":"a","\u1e9a":"a","\xe0":"a","\xe1":"a","\xe2":"a","\u1ea7":"a","\u1ea5":"a","\u1eab":"a","\u1ea9":"a","\xe3":"a","\u0101":"a","\u0103":"a","\u1eb1":"a","\u1eaf":"a","\u1eb5":"a","\u1eb3":"a","\u0227":"a","\u01e1":"a","\xe4":"a","\u01df":"a","\u1ea3":"a","\xe5":"a","\u01fb":"a","\u01ce":"a","\u0201":"a","\u0203":"a","\u1ea1":"a","\u1ead":"a","\u1eb7":"a","\u1e01":"a","\u0105":"a","\u2c65":"a","\u0250":"a","\ua733":"aa","\xe6":"ae","\u01fd":"ae","\u01e3":"ae","\ua735":"ao","\ua737":"au","\ua739":"av","\ua73b":"av","\ua73d":"ay","\u24d1":"b","\uff42":"b","\u1e03":"b","\u1e05":"b","\u1e07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24d2":"c","\uff43":"c","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\xe7":"c","\u1e09":"c","\u0188":"c","\u023c":"c","\ua73f":"c","\u2184":"c","\u24d3":"d","\uff44":"d","\u1e0b":"d","\u010f":"d","\u1e0d":"d","\u1e11":"d","\u1e13":"d","\u1e0f":"d","\u0111":"d","\u018c":"d","\u0256":"d","\u0257":"d","\ua77a":"d","\u01f3":"dz","\u01c6":"dz","\u24d4":"e","\uff45":"e","\xe8":"e","\xe9":"e","\xea":"e","\u1ec1":"e","\u1ebf":"e","\u1ec5":"e","\u1ec3":"e","\u1ebd":"e","\u0113":"e","\u1e15":"e","\u1e17":"e","\u0115":"e","\u0117":"e","\xeb":"e","\u1ebb":"e","\u011b":"e","\u0205":"e","\u0207":"e","\u1eb9":"e","\u1ec7":"e","\u0229":"e","\u1e1d":"e","\u0119":"e","\u1e19":"e","\u1e1b":"e","\u0247":"e","\u025b":"e","\u01dd":"e","\u24d5":"f","\uff46":"f","\u1e1f":"f","\u0192":"f","\ua77c":"f","\u24d6":"g","\uff47":"g","\u01f5":"g","\u011d":"g","\u1e21":"g","\u011f":"g","\u0121":"g","\u01e7":"g","\u0123":"g","\u01e5":"g","\u0260":"g","\ua7a1":"g","\u1d79":"g","\ua77f":"g","\u24d7":"h","\uff48":"h","\u0125":"h","\u1e23":"h","\u1e27":"h","\u021f":"h","\u1e25":"h","\u1e29":"h","\u1e2b":"h","\u1e96":"h","\u0127":"h","\u2c68":"h","\u2c76":"h","\u0265":"h","\u0195":"hv","\u24d8":"i","\uff49":"i","\xec":"i","\xed":"i","\xee":"i","\u0129":"i","\u012b":"i","\u012d":"i","\xef":"i","\u1e2f":"i","\u1ec9":"i","\u01d0":"i","\u0209":"i","\u020b":"i","\u1ecb":"i","\u012f":"i","\u1e2d":"i","\u0268":"i","\u0131":"i","\u24d9":"j","\uff4a":"j","\u0135":"j","\u01f0":"j","\u0249":"j","\u24da":"k","\uff4b":"k","\u1e31":"k","\u01e9":"k","\u1e33":"k","\u0137":"k","\u1e35":"k","\u0199":"k","\u2c6a":"k","\ua741":"k","\ua743":"k","\ua745":"k","\ua7a3":"k","\u24db":"l","\uff4c":"l","\u0140":"l","\u013a":"l","\u013e":"l","\u1e37":"l","\u1e39":"l","\u013c":"l","\u1e3d":"l","\u1e3b":"l","\u017f":"l","\u0142":"l","\u019a":"l","\u026b":"l","\u2c61":"l","\ua749":"l","\ua781":"l","\ua747":"l","\u01c9":"lj","\u24dc":"m","\uff4d":"m","\u1e3f":"m","\u1e41":"m","\u1e43":"m","\u0271":"m","\u026f":"m","\u24dd":"n","\uff4e":"n","\u01f9":"n","\u0144":"n","\xf1":"n","\u1e45":"n","\u0148":"n","\u1e47":"n","\u0146":"n","\u1e4b":"n","\u1e49":"n","\u019e":"n","\u0272":"n","\u0149":"n","\ua791":"n","\ua7a5":"n","\u01cc":"nj","\u24de":"o","\uff4f":"o","\xf2":"o","\xf3":"o","\xf4":"o","\u1ed3":"o","\u1ed1":"o","\u1ed7":"o","\u1ed5":"o","\xf5":"o","\u1e4d":"o","\u022d":"o","\u1e4f":"o","\u014d":"o","\u1e51":"o","\u1e53":"o","\u014f":"o","\u022f":"o","\u0231":"o","\xf6":"o","\u022b":"o","\u1ecf":"o","\u0151":"o","\u01d2":"o","\u020d":"o","\u020f":"o","\u01a1":"o","\u1edd":"o","\u1edb":"o","\u1ee1":"o","\u1edf":"o","\u1ee3":"o","\u1ecd":"o","\u1ed9":"o","\u01eb":"o","\u01ed":"o","\xf8":"o","\u01ff":"o","\u0254":"o","\ua74b":"o","\ua74d":"o","\u0275":"o","\u01a3":"oi","\u0223":"ou","\ua74f":"oo","\u24df":"p","\uff50":"p","\u1e55":"p","\u1e57":"p","\u01a5":"p","\u1d7d":"p","\ua751":"p","\ua753":"p","\ua755":"p","\u24e0":"q","\uff51":"q","\u024b":"q","\ua757":"q","\ua759":"q","\u24e1":"r","\uff52":"r","\u0155":"r","\u1e59":"r","\u0159":"r","\u0211":"r","\u0213":"r","\u1e5b":"r","\u1e5d":"r","\u0157":"r","\u1e5f":"r","\u024d":"r","\u027d":"r","\ua75b":"r","\ua7a7":"r","\ua783":"r","\u24e2":"s","\uff53":"s","\xdf":"s","\u015b":"s","\u1e65":"s","\u015d":"s","\u1e61":"s","\u0161":"s","\u1e67":"s","\u1e63":"s","\u1e69":"s","\u0219":"s","\u015f":"s","\u023f":"s","\ua7a9":"s","\ua785":"s","\u1e9b":"s","\u24e3":"t","\uff54":"t","\u1e6b":"t","\u1e97":"t","\u0165":"t","\u1e6d":"t","\u021b":"t","\u0163":"t","\u1e71":"t","\u1e6f":"t","\u0167":"t","\u01ad":"t","\u0288":"t","\u2c66":"t","\ua787":"t","\ua729":"tz","\u24e4":"u","\uff55":"u","\xf9":"u","\xfa":"u","\xfb":"u","\u0169":"u","\u1e79":"u","\u016b":"u","\u1e7b":"u","\u016d":"u","\xfc":"u","\u01dc":"u","\u01d8":"u","\u01d6":"u","\u01da":"u","\u1ee7":"u","\u016f":"u","\u0171":"u","\u01d4":"u","\u0215":"u","\u0217":"u","\u01b0":"u","\u1eeb":"u","\u1ee9":"u","\u1eef":"u","\u1eed":"u","\u1ef1":"u","\u1ee5":"u","\u1e73":"u","\u0173":"u","\u1e77":"u","\u1e75":"u","\u0289":"u","\u24e5":"v","\uff56":"v","\u1e7d":"v","\u1e7f":"v","\u028b":"v","\ua75f":"v","\u028c":"v","\ua761":"vy","\u24e6":"w","\uff57":"w","\u1e81":"w","\u1e83":"w","\u0175":"w","\u1e87":"w","\u1e85":"w","\u1e98":"w","\u1e89":"w","\u2c73":"w","\u24e7":"x","\uff58":"x","\u1e8b":"x","\u1e8d":"x","\u24e8":"y","\uff59":"y","\u1ef3":"y","\xfd":"y","\u0177":"y","\u1ef9":"y","\u0233":"y","\u1e8f":"y","\xff":"y","\u1ef7":"y","\u1e99":"y","\u1ef5":"y","\u01b4":"y","\u024f":"y","\u1eff":"y","\u24e9":"z","\uff5a":"z","\u017a":"z","\u1e91":"z","\u017c":"z","\u017e":"z","\u1e93":"z","\u1e95":"z","\u01b6":"z","\u0225":"z","\u0240":"z","\u2c6c":"z","\ua763":"z"};j=a(document),g=function(){var a=1;return function(){return a++}}(),j.on("mousemove",function(a){i.x=a.pageX,i.y=a.pageY}),d=N(Object,{bind:function(a){var b=this;return function(){a.apply(b,arguments)}},init:function(c){var d,e,h,i,f=".select2-results";this.opts=c=this.prepareOpts(c),this.id=c.id,c.element.data("select2")!==b&&null!==c.element.data("select2")&&c.element.data("select2").destroy(),this.container=this.createContainer(),this.containerId="s2id_"+(c.element.attr("id")||"autogen"+g()),this.containerSelector="#"+this.containerId.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.body=w(function(){return c.element.closest("body")}),D(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.attr("style",c.element.attr("style")),this.container.css(K(c.containerCss)),this.container.addClass(K(c.containerCssClass)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",A),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),D(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(K(c.dropdownCssClass)),this.dropdown.data("select2",this),this.dropdown.on("click",A),this.results=d=this.container.find(f),this.search=e=this.container.find("input.select2-input"),this.queryCount=0,this.resultsPage=0,this.context=null,this.initContainer(),this.container.on("click",A),u(this.results),this.dropdown.on("mousemove-filtered touchstart touchmove touchend",f,this.bind(this.highlightUnderEvent)),x(80,this.results),this.dropdown.on("scroll-debounced",f,this.bind(this.loadMoreIfNeeded)),a(this.container).on("change",".select2-input",function(a){a.stopPropagation()}),a(this.dropdown).on("change",".select2-input",function(a){a.stopPropagation()}),a.fn.mousewheel&&d.mousewheel(function(a,b,c,e){var f=d.scrollTop();e>0&&0>=f-e?(d.scrollTop(0),A(a)):0>e&&d.get(0).scrollHeight-d.scrollTop()+e<=d.height()&&(d.scrollTop(d.get(0).scrollHeight-d.height()),A(a))}),t(e),e.on("keyup-change input paste",this.bind(this.updateResults)),e.on("focus",function(){e.addClass("select2-focused")}),e.on("blur",function(){e.removeClass("select2-focused")}),this.dropdown.on("mouseup",f,this.bind(function(b){a(b.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(b),this.selectHighlighted(b))})),this.dropdown.on("click mouseup mousedown",function(a){a.stopPropagation()}),a.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==c.maximumInputLength&&this.search.attr("maxlength",c.maximumInputLength);var h=c.element.prop("disabled");h===b&&(h=!1),this.enable(!h);var i=c.element.prop("readonly");i===b&&(i=!1),this.readonly(i),k=k||p(),this.autofocus=c.element.prop("autofocus"),c.element.prop("autofocus",!1),this.autofocus&&this.focus(),this.nextSearchTerm=b},destroy:function(){var a=this.opts.element,c=a.data("select2");this.close(),this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),c!==b&&(c.container.remove(),c.dropdown.remove(),a.removeClass("select2-offscreen").removeData("select2").off(".select2").prop("autofocus",this.autofocus||!1),this.elementTabIndex?a.attr({tabindex:this.elementTabIndex}):a.removeAttr("tabindex"),a.show())},optionToData:function(a){return a.is("option")?{id:a.prop("value"),text:a.text(),element:a.get(),css:a.attr("class"),disabled:a.prop("disabled"),locked:q(a.attr("locked"),"locked")||q(a.data("locked"),!0)}:a.is("optgroup")?{text:a.attr("label"),children:[],element:a.get(),css:a.attr("class")}:void 0},prepareOpts:function(c){var d,e,f,g,h=this;if(d=c.element,"select"===d.get(0).tagName.toLowerCase()&&(this.select=e=c.element),e&&a.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in c)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a ","
            "," ","
              ","
            ","
            "].join(""));return b},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var c,d,e;this.opts.minimumResultsForSearch>=0&&this.showSearch(!0),this.parent.opening.apply(this,arguments),this.showSearchInput!==!1&&this.search.val(this.focusser.val()),this.search.focus(),c=this.search.get(0),c.createTextRange?(d=c.createTextRange(),d.collapse(!1),d.select()):c.setSelectionRange&&(e=this.search.val().length,c.setSelectionRange(e,e)),""===this.search.val()&&this.nextSearchTerm!=b&&(this.search.val(this.nextSearchTerm),this.search.select()),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger(a.Event("select2-open"))},close:function(a){this.opened()&&(this.parent.close.apply(this,arguments),a=a||{focus:!0},this.focusser.removeAttr("disabled"),a.focus&&this.focusser.focus())},focus:function(){this.opened()?this.close():(this.focusser.removeAttr("disabled"),this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.removeAttr("disabled"),this.focusser.focus()},destroy:function(){a("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments)},initContainer:function(){var b,d=this.container,e=this.dropdown;this.opts.minimumResultsForSearch<0?this.showSearch(!1):this.showSearch(!0),this.selection=b=d.find(".select2-choice"),this.focusser=d.find(".select2-focusser"),this.focusser.attr("id","s2id_autogen"+g()),a("label[for='"+this.opts.element.attr("id")+"']").attr("for",this.focusser.attr("id")),this.focusser.attr("tabindex",this.elementTabIndex),this.search.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()){if(a.which===c.PAGE_UP||a.which===c.PAGE_DOWN)return A(a),void 0;switch(a.which){case c.UP:case c.DOWN:return this.moveHighlight(a.which===c.UP?-1:1),A(a),void 0;case c.ENTER:return this.selectHighlighted(),A(a),void 0;case c.TAB:return this.selectHighlighted({noFocus:!0}),void 0;case c.ESC:return this.cancel(a),A(a),void 0}}})),this.search.on("blur",this.bind(function(){document.activeElement===this.body().get(0)&&window.setTimeout(this.bind(function(){this.search.focus()}),0)})),this.focusser.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()&&a.which!==c.TAB&&!c.isControl(a)&&!c.isFunctionKey(a)&&a.which!==c.ESC){if(this.opts.openOnEnter===!1&&a.which===c.ENTER)return A(a),void 0;if(a.which==c.DOWN||a.which==c.UP||a.which==c.ENTER&&this.opts.openOnEnter){if(a.altKey||a.ctrlKey||a.shiftKey||a.metaKey)return;return this.open(),A(a),void 0}return a.which==c.DELETE||a.which==c.BACKSPACE?(this.opts.allowClear&&this.clear(),A(a),void 0):void 0}})),t(this.focusser),this.focusser.on("keyup-change input",this.bind(function(a){if(this.opts.minimumResultsForSearch>=0){if(a.stopPropagation(),this.opened())return;this.open()}})),b.on("mousedown","abbr",this.bind(function(a){this.isInterfaceEnabled()&&(this.clear(),B(a),this.close(),this.selection.focus())})),b.on("mousedown",this.bind(function(b){this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),A(b)})),e.on("mousedown",this.bind(function(){this.search.focus()})),b.on("focus",this.bind(function(a){A(a)})),this.focusser.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger(a.Event("select2-blur")))})),this.search.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.setPlaceholder()},clear:function(b){var c=this.selection.data("select2-data");if(c){var d=a.Event("select2-clearing");if(this.opts.element.trigger(d),d.isDefaultPrevented())return;var e=this.getPlaceholderOption();this.opts.element.val(e?e.val():""),this.selection.find(".select2-chosen").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),b!==!1&&(this.opts.element.trigger({type:"select2-removed",val:this.id(c),choice:c}),this.triggerChange({removed:c}))}},initSelection:function(){if(this.isPlaceholderOptionSelected())this.updateSelection(null),this.close(),this.setPlaceholder();else{var c=this;this.opts.initSelection.call(null,this.opts.element,function(a){a!==b&&null!==a&&(c.updateSelection(a),c.close(),c.setPlaceholder())})}},isPlaceholderOptionSelected:function(){var a;return this.getPlaceholder()?(a=this.getPlaceholderOption())!==b&&a.is(":selected")||""===this.opts.element.val()||this.opts.element.val()===b||null===this.opts.element.val():!1},prepareOpts:function(){var b=this.parent.prepareOpts.apply(this,arguments),c=this;return"select"===b.element.get(0).tagName.toLowerCase()?b.initSelection=function(a,b){var d=a.find(":selected");b(c.optionToData(d))}:"data"in b&&(b.initSelection=b.initSelection||function(c,d){var e=c.val(),f=null;b.query({matcher:function(a,c,d){var g=q(e,b.id(d));return g&&(f=d),g},callback:a.isFunction(d)?function(){d(f)}:a.noop})}),b},getPlaceholder:function(){return this.select&&this.getPlaceholderOption()===b?b:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var a=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&a!==b){if(this.select&&this.getPlaceholderOption()===b)return;this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(a)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear")}},postprocessResults:function(a,b,c){var d=0,e=this;if(this.findHighlightableChoices().each2(function(a,b){return q(e.id(b.data("select2-data")),e.opts.element.val())?(d=a,!1):void 0}),c!==!1&&(b===!0&&d>=0?this.highlight(d):this.highlight(0)),b===!0){var g=this.opts.minimumResultsForSearch;g>=0&&this.showSearch(L(a.results)>=g)}},showSearch:function(b){this.showSearchInput!==b&&(this.showSearchInput=b,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!b),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!b),a(this.dropdown,this.container).toggleClass("select2-with-searchbox",b))},onSelect:function(a,b){if(this.triggerSelect(a)){var c=this.opts.element.val(),d=this.data();this.opts.element.val(this.id(a)),this.updateSelection(a),this.opts.element.trigger({type:"select2-selected",val:this.id(a),choice:a}),this.nextSearchTerm=this.opts.nextSearchTerm(a,this.search.val()),this.close(),b&&b.noFocus||this.focusser.focus(),q(c,this.id(a))||this.triggerChange({added:a,removed:d})}},updateSelection:function(a){var d,e,c=this.selection.find(".select2-chosen");this.selection.data("select2-data",a),c.empty(),null!==a&&(d=this.opts.formatSelection(a,c,this.opts.escapeMarkup)),d!==b&&c.append(d),e=this.opts.formatSelectionCssClass(a,c),e!==b&&c.addClass(e),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==b&&this.container.addClass("select2-allowclear")},val:function(){var a,c=!1,d=null,e=this,f=this.data();if(0===arguments.length)return this.opts.element.val();if(a=arguments[0],arguments.length>1&&(c=arguments[1]),this.select)this.select.val(a).find(":selected").each2(function(a,b){return d=e.optionToData(b),!1}),this.updateSelection(d),this.setPlaceholder(),c&&this.triggerChange({added:d,removed:f});else{if(!a&&0!==a)return this.clear(c),void 0;if(this.opts.initSelection===b)throw new Error("cannot call val() if initSelection() is not defined");this.opts.element.val(a),this.opts.initSelection(this.opts.element,function(a){e.opts.element.val(a?e.id(a):""),e.updateSelection(a),e.setPlaceholder(),c&&e.triggerChange({added:a,removed:f})})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(a){var c,d=!1;return 0===arguments.length?(c=this.selection.data("select2-data"),c==b&&(c=null),c):(arguments.length>1&&(d=arguments[1]),a?(c=this.data(),this.opts.element.val(a?this.id(a):""),this.updateSelection(a),d&&this.triggerChange({added:a,removed:c})):this.clear(d),void 0)}}),f=N(d,{createContainer:function(){var b=a(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html(["
              ","
            • "," ","
            • ","
            ","
            ","
              ","
            ","
            "].join(""));return b},prepareOpts:function(){var b=this.parent.prepareOpts.apply(this,arguments),c=this;return"select"===b.element.get(0).tagName.toLowerCase()?b.initSelection=function(a,b){var d=[];a.find(":selected").each2(function(a,b){d.push(c.optionToData(b))}),b(d)}:"data"in b&&(b.initSelection=b.initSelection||function(c,d){var e=r(c.val(),b.separator),f=[];b.query({matcher:function(c,d,g){var h=a.grep(e,function(a){return q(a,b.id(g))}).length;return h&&f.push(g),h},callback:a.isFunction(d)?function(){for(var a=[],c=0;c0||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.open(),this.focusSearch(),b.preventDefault()))})),this.container.on("focus",b,this.bind(function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.clearSearch()},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){if(""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),this.select||""!==this.opts.element.val()){var c=this;this.opts.initSelection.call(null,this.opts.element,function(a){a!==b&&null!==a&&(c.updateSelection(a),c.close(),c.clearSearch())})}},clearSearch:function(){var a=this.getPlaceholder(),c=this.getMaxSearchWidth();a!==b&&0===this.getVal().length&&this.search.hasClass("select2-focused")===!1?(this.search.val(a).addClass("select2-default"),this.search.width(c>0?c:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.clearPlaceholder(),this.resizeSearch(),this.parent.opening.apply(this,arguments),this.focusSearch(),this.updateResults(!0),this.search.focus(),this.opts.element.trigger(a.Event("select2-open"))},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(b){var c=[],d=[],e=this;a(b).each(function(){o(e.id(this),c)<0&&(c.push(e.id(this)),d.push(this))}),b=d,this.selection.find(".select2-search-choice").remove(),a(b).each(function(){e.addSelectedChoice(this)}),e.postprocessResults()},tokenize:function(){var a=this.search.val();a=this.opts.tokenizer.call(this,a,this.data(),this.bind(this.onSelect),this.opts),null!=a&&a!=b&&(this.search.val(a),a.length>0&&this.open())},onSelect:function(a,b){this.triggerSelect(a)&&(this.addSelectedChoice(a),this.opts.element.trigger({type:"selected",val:this.id(a),choice:a}),(this.select||!this.opts.closeOnSelect)&&this.postprocessResults(a,!1,this.opts.closeOnSelect===!0),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()&&this.updateResults(!0),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:a}),b&&b.noFocus||this.focusSearch())},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(c){var j,k,d=!c.locked,e=a("
          • "),f=a("
          • "),g=d?e:f,h=this.id(c),i=this.getVal();j=this.opts.formatSelection(c,g.find("div"),this.opts.escapeMarkup),j!=b&&g.find("div").replaceWith("
            "+j+"
            "),k=this.opts.formatSelectionCssClass(c,g.find("div")),k!=b&&g.addClass(k),d&&g.find(".select2-search-choice-close").on("mousedown",A).on("click dblclick",this.bind(function(b){this.isInterfaceEnabled()&&(a(b.target).closest(".select2-search-choice").fadeOut("fast",this.bind(function(){this.unselect(a(b.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),this.close(),this.focusSearch()})).dequeue(),A(b))})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),g.data("select2-data",c),g.insertBefore(this.searchContainer),i.push(h),this.setVal(i)},unselect:function(a){var c,d,b=this.getVal();if(a=a.closest(".select2-search-choice"),0===a.length)throw"Invalid argument: "+a+". Must be .select2-search-choice";if(c=a.data("select2-data")){for(;(d=o(this.id(c),b))>=0;)b.splice(d,1),this.setVal(b),this.select&&this.postprocessResults();a.remove(),this.opts.element.trigger({type:"removed",val:this.id(c),choice:c}),this.triggerChange({removed:c})}},postprocessResults:function(a,b,c){var d=this.getVal(),e=this.results.find(".select2-result"),f=this.results.find(".select2-result-with-children"),g=this;e.each2(function(a,b){var c=g.id(b.data("select2-data"));o(c,d)>=0&&(b.addClass("select2-selected"),b.find(".select2-result-selectable").addClass("select2-selected"))}),f.each2(function(a,b){b.is(".select2-result-selectable")||0!==b.find(".select2-result-selectable:not(.select2-selected)").length||b.addClass("select2-selected")}),-1==this.highlight()&&c!==!1&&g.highlight(0),!this.opts.createSearchChoice&&!e.filter(".select2-result:not(.select2-selected)").length>0&&(!a||a&&!a.more&&0===this.results.find(".select2-no-results").length)&&J(g.opts.formatNoMatches,"formatNoMatches")&&this.results.append("
          • "+g.opts.formatNoMatches(g.search.val())+"
          • ")},getMaxSearchWidth:function(){return this.selection.width()-s(this.search)},resizeSearch:function(){var a,b,c,d,e,f=s(this.search);a=C(this.search)+10,b=this.search.offset().left,c=this.selection.width(),d=this.selection.offset().left,e=c-(b-d)-f,a>e&&(e=c-f),40>e&&(e=c-f),0>=e&&(e=a),this.search.width(Math.floor(e))},getVal:function(){var a;return this.select?(a=this.select.val(),null===a?[]:a):(a=this.opts.element.val(),r(a,this.opts.separator))},setVal:function(b){var c;this.select?this.select.val(b):(c=[],a(b).each(function(){o(this,c)<0&&c.push(this)}),this.opts.element.val(0===c.length?"":c.join(this.opts.separator)))},buildChangeDetails:function(a,b){for(var b=b.slice(0),a=a.slice(0),c=0;c. Attach to instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var b=[],c=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){b.push(c.opts.id(a(this).data("select2-data")))}),this.setVal(b),this.triggerChange()},data:function(b,c){var e,f,d=this;return 0===arguments.length?this.selection.find(".select2-search-choice").map(function(){return a(this).data("select2-data")}).get():(f=this.data(),b||(b=[]),e=a.map(b,function(a){return d.opts.id(a)}),this.setVal(e),this.updateSelection(b),this.clearSearch(),c&&this.triggerChange(this.buildChangeDetails(f,this.data())),void 0)}}),a.fn.select2=function(){var d,g,h,i,j,c=Array.prototype.slice.call(arguments,0),k=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],l=["opened","isFocused","container","dropdown"],m=["val","data"],n={search:"externalSearch"};return this.each(function(){if(0===c.length||"object"==typeof c[0])d=0===c.length?{}:a.extend({},c[0]),d.element=a(this),"select"===d.element.get(0).tagName.toLowerCase()?j=d.element.prop("multiple"):(j=d.multiple||!1,"tags"in d&&(d.multiple=j=!0)),g=j?new f:new e,g.init(d);else{if("string"!=typeof c[0])throw"Invalid arguments to select2 plugin: "+c;if(o(c[0],k)<0)throw"Unknown method: "+c[0];if(i=b,g=a(this).data("select2"),g===b)return;if(h=c[0],"container"===h?i=g.container:"dropdown"===h?i=g.dropdown:(n[h]&&(h=n[h]),i=g[h].apply(g,c.slice(1))),o(c[0],l)>=0||o(c[0],m)&&1==c.length)return!1}}),i===b?this:i},a.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(a,b,c,d){var e=[];return E(a.text,c.term,e,d),e.join("")},formatSelection:function(a,c,d){return a?d(a.text):b},sortResults:function(a){return a},formatResultCssClass:function(){return b},formatSelectionCssClass:function(){return b},formatNoMatches:function(){return"No matches found"},formatInputTooShort:function(a,b){var c=b-a.length;return"Please enter "+c+" more character"+(1==c?"":"s")},formatInputTooLong:function(a,b){var c=a.length-b;return"Please delete "+c+" character"+(1==c?"":"s")},formatSelectionTooBig:function(a){return"You can only select "+a+" item"+(1==a?"":"s")},formatLoadMore:function(){return"Loading more results..."},formatSearching:function(){return"Searching..."},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(a){return a.id},matcher:function(a,b){return n(""+b).toUpperCase().indexOf(n(""+a).toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:M,escapeMarkup:F,blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(a){return a},adaptDropdownCssClass:function(){return null},nextSearchTerm:function(){return b}},a.fn.select2.ajaxDefaults={transport:a.ajax,params:{type:"GET",cache:!1,dataType:"json"}},window.Select2={query:{ajax:G,local:H,tags:I},util:{debounce:v,markMatch:E,escapeMarkup:F,stripDiacritics:n},"class":{"abstract":d,single:e,multi:f}}}}(jQuery); \ No newline at end of file diff --git a/public/admin/Coco/assets/libs/bootstrap-select2/select2.png b/public/admin/Coco/assets/libs/bootstrap-select2/select2.png deleted file mode 100644 index 1d804ffb9..000000000 Binary files a/public/admin/Coco/assets/libs/bootstrap-select2/select2.png and /dev/null differ diff --git a/public/admin/Coco/assets/libs/bootstrap-typeahead/bootstrap3-typeahead.min.js b/public/admin/Coco/assets/libs/bootstrap-typeahead/bootstrap3-typeahead.min.js deleted file mode 100644 index 9d3cb53cc..000000000 --- a/public/admin/Coco/assets/libs/bootstrap-typeahead/bootstrap3-typeahead.min.js +++ /dev/null @@ -1 +0,0 @@ -!function($){"use strict";var Typeahead=function(element,options){this.$element=$(element),this.options=$.extend({},$.fn.typeahead.defaults,options),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.select=this.options.select||this.select,this.autoSelect="boolean"==typeof this.options.autoSelect?this.options.autoSelect:!0,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.source=this.options.source,this.$menu=$(this.options.menu),this.shown=!1,this.listen(),this.showHintOnFocus="boolean"==typeof this.options.showHintOnFocus?this.options.showHintOnFocus:!1};Typeahead.prototype={constructor:Typeahead,select:function(){var val=this.$menu.find(".active").data("value");return(this.autoSelect||val)&&this.$element.val(this.updater(val)).change(),this.hide()},updater:function(item){return item},setSource:function(source){this.source=source},show:function(){var scrollHeight,pos=$.extend({},this.$element.position(),{height:this.$element[0].offsetHeight});return scrollHeight="function"==typeof this.options.scrollHeight?this.options.scrollHeight.call():this.options.scrollHeight,this.$menu.insertAfter(this.$element).css({top:pos.top+pos.height+scrollHeight,left:pos.left}).show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(query){var items;return this.query="undefined"!=typeof query&&null!==query?query:this.$element.val()||"",this.query.length"+match+""})},render:function(items){var that=this;return items=$(items).map(function(i,item){return i=$(that.options.item).data("value",item),i.find("a").html(that.highlighter(item)),i[0]}),this.autoSelect&&items.first().addClass("active"),this.$menu.html(items),this},next:function(){var active=this.$menu.find(".active").removeClass("active"),next=active.next();next.length||(next=$(this.$menu.find("li")[0])),next.addClass("active")},prev:function(){var active=this.$menu.find(".active").removeClass("active"),prev=active.prev();prev.length||(prev=this.$menu.find("li").last()),prev.addClass("active")},listen:function(){this.$element.on("focus",$.proxy(this.focus,this)).on("blur",$.proxy(this.blur,this)).on("keypress",$.proxy(this.keypress,this)).on("keyup",$.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown",$.proxy(this.keydown,this)),this.$menu.on("click",$.proxy(this.click,this)).on("mouseenter","li",$.proxy(this.mouseenter,this)).on("mouseleave","li",$.proxy(this.mouseleave,this))},destroy:function(){this.$element.data("typeahead",null),this.$element.off("focus").off("blur").off("keypress").off("keyup"),this.eventSupported("keydown")&&this.$element.off("keydown"),this.$menu.remove()},eventSupported:function(eventName){var isSupported=eventName in this.$element;return isSupported||(this.$element.setAttribute(eventName,"return;"),isSupported="function"==typeof this.$element[eventName]),isSupported},move:function(e){if(this.shown){switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 38:e.preventDefault(),this.prev();break;case 40:e.preventDefault(),this.next()}e.stopPropagation()}},keydown:function(e){this.suppressKeyPressRepeat=~$.inArray(e.keyCode,[40,38,9,13,27]),this.shown||40!=e.keyCode?this.move(e):this.lookup("")},keypress:function(e){this.suppressKeyPressRepeat||this.move(e)},keyup:function(e){switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}e.stopPropagation(),e.preventDefault()},focus:function(){this.focused||(this.focused=!0,(0===this.options.minLength&&!this.$element.val()||this.options.showHintOnFocus)&&this.lookup())},blur:function(){this.focused=!1,!this.mousedover&&this.shown&&this.hide()},click:function(e){e.stopPropagation(),e.preventDefault(),this.select(),this.$element.focus()},mouseenter:function(e){this.mousedover=!0,this.$menu.find(".active").removeClass("active"),$(e.currentTarget).addClass("active")},mouseleave:function(){this.mousedover=!1,!this.focused&&this.shown&&this.hide()}};var old=$.fn.typeahead;$.fn.typeahead=function(option){var arg=arguments;return this.each(function(){var $this=$(this),data=$this.data("typeahead"),options="object"==typeof option&&option;data||$this.data("typeahead",data=new Typeahead(this,options)),"string"==typeof option&&(arg.length>1?data[option].apply(data,Array.prototype.slice.call(arg,1)):data[option]())})},$.fn.typeahead.defaults={source:[],items:8,menu:'',item:'
          • ',minLength:1,scrollHeight:0,autoSelect:!0},$.fn.typeahead.Constructor=Typeahead,$.fn.typeahead.noConflict=function(){return $.fn.typeahead=old,this},$(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(){var $this=$(this);$this.data("typeahead")||$this.typeahead($this.data())})}(window.jQuery); \ No newline at end of file diff --git a/public/admin/Coco/assets/libs/bootstrap-validator/css/bootstrapValidator.min.css b/public/admin/Coco/assets/libs/bootstrap-validator/css/bootstrapValidator.min.css deleted file mode 100644 index 030cbdf75..000000000 --- a/public/admin/Coco/assets/libs/bootstrap-validator/css/bootstrapValidator.min.css +++ /dev/null @@ -1,13 +0,0 @@ -/** - * BootstrapValidator (http://bootstrapvalidator.com) - * - * The best jQuery plugin to validate form fields. Designed to use with Bootstrap 3 - * - * @version v0.4.5 - * @author https://twitter.com/nghuuphuoc - * @copyright (c) 2013 - 2014 Nguyen Huu Phuoc - * @license MIT - */ - - -.bv-form .help-block{margin-bottom:0}.nav-tabs li.bv-tab-success>a{color:#3c763d}.nav-tabs li.bv-tab-error>a{color:#a94442} \ No newline at end of file diff --git a/public/admin/Coco/assets/libs/bootstrap-validator/js/bootstrapValidator.min.js b/public/admin/Coco/assets/libs/bootstrap-validator/js/bootstrapValidator.min.js deleted file mode 100644 index c10d0d567..000000000 --- a/public/admin/Coco/assets/libs/bootstrap-validator/js/bootstrapValidator.min.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * BootstrapValidator (http://bootstrapvalidator.com) - * - * The best jQuery plugin to validate form fields. Designed to use with Bootstrap 3 - * - * @version v0.4.5 - * @author https://twitter.com/nghuuphuoc - * @copyright (c) 2013 - 2014 Nguyen Huu Phuoc - * @license MIT - */ - -!function(a){var b=function(c,d){this.$form=a(c),this.options=a.extend({},b.DEFAULT_OPTIONS,d),this.$invalidField=null,this.$submitButton=null,this.STATUS_NOT_VALIDATED="NOT_VALIDATED",this.STATUS_VALIDATING="VALIDATING",this.STATUS_INVALID="INVALID",this.STATUS_VALID="VALID";var e=function(){for(var a=3,b=document.createElement("div"),c=b.all||[];b.innerHTML="",c[0];);return a>4?a:!a}(),f=document.createElement("div");this._changeEvent=9!==e&&"oninput"in f?"input":"keyup",this._submitIfValid=null,this._init()};b.DEFAULT_OPTIONS={elementClass:"bv-form",message:"This value is not valid",threshold:null,excluded:[":disabled",":hidden",":not(:visible)"],feedbackIcons:{valid:null,invalid:null,validating:null},submitButtons:'[type="submit"]',submitHandler:null,live:"enabled",fields:null},b.prototype={constructor:b,_init:function(){var b,c,d,e,f,g,h,i=this,j={excluded:this.$form.attr("data-bv-excluded"),trigger:this.$form.attr("data-bv-trigger"),message:this.$form.attr("data-bv-message"),submitButtons:this.$form.attr("data-bv-submitbuttons"),threshold:this.$form.attr("data-bv-threshold"),live:this.$form.attr("data-bv-live"),fields:{},feedbackIcons:{valid:this.$form.attr("data-bv-feedbackicons-valid"),invalid:this.$form.attr("data-bv-feedbackicons-invalid"),validating:this.$form.attr("data-bv-feedbackicons-validating")}};this.$form.attr("novalidate","novalidate").addClass(this.options.elementClass).on("submit.bv",function(a){a.preventDefault(),i.validate()}).on("click",this.options.submitButtons,function(){i.$submitButton=a(this),i._submitIfValid=!0}).find("[name], [data-bv-field]").each(function(){var k=a(this);if(!i._isExcluded(k)){var l=k.attr("name")||k.attr("data-bv-field"),m={};for(c in a.fn.bootstrapValidator.validators)if(b=a.fn.bootstrapValidator.validators[c],d=k.attr("data-bv-"+c.toLowerCase())+"",h="function"==typeof b.enableByHtml5?b.enableByHtml5(a(this)):null,h&&"false"!=d||h!==!0&&(""==d||"true"==d)){b.html5Attributes=b.html5Attributes||{message:"message"},m[c]=a.extend({},1==h?{}:h,m[c]);for(g in b.html5Attributes)e=b.html5Attributes[g],f=k.attr("data-bv-"+c.toLowerCase()+"-"+g),f&&("true"==f?f=!0:"false"==f&&(f=!1),m[c][e]=f)}var n={trigger:k.attr("data-bv-trigger"),message:k.attr("data-bv-message"),container:k.attr("data-bv-container"),selector:k.attr("data-bv-selector"),threshold:k.attr("data-bv-threshold"),validators:m};a.isEmptyObject(n.validators)||a.isEmptyObject(n)||(k.attr("data-bv-field",l),j.fields[l]=a.extend({},n,j.fields[l]))}}).end().find(this.options.submitButtons).each(function(){a("").attr("type","hidden").attr("name",a(this).attr("name")).val(a(this).val()).appendTo(i.$form)}),this.options=a.extend(!0,this.options,j);for(var k in this.options.fields)this._initField(k);this.setLiveMode(this.options.live)},_initField:function(b){if(null!=this.options.fields[b]&&null!=this.options.fields[b].validators){var c=this.getFieldElements(b);if(null==c)return void delete this.options.fields[b];for(var d in this.options.fields[b].validators)a.fn.bootstrapValidator.validators[d]||delete this.options.fields[b].validators[d];for(var e=this,f=c.attr("type"),g="radio"==f||"checkbox"==f||"file"==f||"SELECT"==c[0].tagName?"change":e._changeEvent,h=c.length,i=1==h||"radio"==f||"checkbox"==f,j=0;h>j;j++){var k=a(c[j]),l=k.parents(".form-group"),m=this.options.fields[b].container?l.find(this.options.fields[b].container):this._getMessageContainer(k);k.attr("data-bv-field")||k.attr("data-bv-field",b),k.on(g+".update.bv",function(){e._submitIfValid=!1,i?e.updateStatus(b,e.STATUS_NOT_VALIDATED,null):e.updateElementStatus(a(this),e.STATUS_NOT_VALIDATED,null)}),k.data("bv.messages",m);for(d in this.options.fields[b].validators)k.data("bv.result."+d,this.STATUS_NOT_VALIDATED),i&&j!=h-1||a("").css("display","none").attr("data-bv-validator",d).attr("data-bv-validator-for",b).html(this.options.fields[b].validators[d].message||this.options.fields[b].message||this.options.message).addClass("help-block").appendTo(m);if(this.options.feedbackIcons&&this.options.feedbackIcons.validating&&this.options.feedbackIcons.invalid&&this.options.feedbackIcons.valid&&(!i||j==h-1)){l.addClass("has-feedback");var n=a("").css("display","none").addClass("form-control-feedback").attr("data-bv-icon-for",b).insertAfter(k);0==l.find("label").length&&n.css("top",0)}}null==this.options.fields[b].enabled&&(this.options.fields[b].enabled=!0)}},_getMessageContainer:function(a){var b=a.parent();if(b.hasClass("form-group"))return b;var c=b.attr("class");if(!c)return this._getMessageContainer(b);c=c.split(" ");for(var d=c.length,e=0;d>e;e++)if(/^col-(xs|sm|md|lg)-\d+$/.test(c[e])||/^col-(xs|sm|md|lg)-offset-\d+$/.test(c[e]))return b;return this._getMessageContainer(b)},_submit:function(){if(this.isValid())this.options.submitHandler&&"function"==typeof this.options.submitHandler?this.options.submitHandler.call(this,this,this.$form,this.$submitButton):this.disableSubmitButtons(!0).defaultSubmit();else if("submitted"==this.options.live&&this.setLiveMode("enabled"),this.$invalidField){var b,c=this.$invalidField.parents(".tab-pane");c&&(b=c.attr("id"))&&a('a[href="#'+b+'"][data-toggle="tab"]').trigger("click.bs.tab.data-api"),this.$invalidField.focus()}},_isExcluded:function(b){if(this.options.excluded){"string"==typeof this.options.excluded&&(this.options.excluded=a.map(this.options.excluded.split(","),function(b){return a.trim(b)}));for(var c=this.options.excluded.length,d=0;c>d;d++)if("string"==typeof this.options.excluded[d]&&b.is(this.options.excluded[d])||"function"==typeof this.options.excluded[d]&&1==this.options.excluded[d].call(this,b,this))return!0}return!1},_exceedThreshold:function(a){var b=a.attr("data-bv-field"),c=this.options.fields[b].threshold||this.options.threshold;if(!c)return!0;var d=a.attr("type"),e=-1!=["button","checkbox","file","hidden","image","radio","reset","submit"].indexOf(d);return e||a.val().length>=c},getFieldElements:function(b){var c=this.options.fields[b].selector?a(this.options.fields[b].selector):this.$form.find('[name="'+b+'"]');return 0==c.length?null:c},setLiveMode:function(b){if(this.options.live=b,"submitted"==b)return this;var c=this;for(var d in this.options.fields)!function(e){var f=c.getFieldElements(e);if(f)for(var g=f.attr("type"),h=f.length,i=1==h||"radio"==g||"checkbox"==g,j=c.options.fields[d].trigger||c.options.trigger||("radio"==g||"checkbox"==g||"file"==g||"SELECT"==f[0].tagName?"change":c._changeEvent),k=a.map(j.split(" "),function(a){return a+".live.bv"}).join(" "),l=0;h>l;l++)"enabled"==b?a(f[l]).on(k,function(){c._exceedThreshold(a(this))&&(i?c.validateField(e):c.validateFieldElement(a(this),!1))}):a(f[l]).off(k)}(d);return this},disableSubmitButtons:function(a){return a?"disabled"!=this.options.live&&this.$form.find(this.options.submitButtons).attr("disabled","disabled"):this.$form.find(this.options.submitButtons).removeAttr("disabled"),this},validate:function(){if(!this.options.fields)return this;this.disableSubmitButtons(!0);for(var a in this.options.fields)this.validateField(a);return this.$submitButton&&this._submit(),this},validateField:function(b){for(var c=this.getFieldElements(b),d=c.attr("type"),e="radio"==d||"checkbox"==d?1:c.length,f=0;e>f;f++)this.validateFieldElement(a(c[f]),1==e);return this},validateFieldElement:function(b,c){var d,e,f=this,g=b.attr("data-bv-field"),h=this.options.fields[g].validators;if(!this.options.fields[g].enabled||this._isExcluded(b))return this;for(d in h){b.data("bv.dfs."+d)&&b.data("bv.dfs."+d).reject();var i=b.data("bv.result."+d);i!=this.STATUS_VALID&&i!=this.STATUS_INVALID&&(b.data("bv.result."+d,this.STATUS_VALIDATING),e=a.fn.bootstrapValidator.validators[d].validate(this,b,h[d]),"object"==typeof e?(c?this.updateStatus(g,this.STATUS_VALIDATING,d):this.updateElementStatus(b,this.STATUS_VALIDATING,d),b.data("bv.dfs."+d,e),e.done(function(a,b,d){a.removeData("bv.dfs."+b),c?f.updateStatus(a.attr("data-bv-field"),d?f.STATUS_VALID:f.STATUS_INVALID,b):f.updateElementStatus(a,d?f.STATUS_VALID:f.STATUS_INVALID,b),d&&1==f._submitIfValid&&f._submit()})):"boolean"==typeof e&&(c?this.updateStatus(g,e?this.STATUS_VALID:this.STATUS_INVALID,d):this.updateElementStatus(b,e?this.STATUS_VALID:this.STATUS_INVALID,d)))}return this},updateStatus:function(b,c,d){for(var e=this.getFieldElements(b),f=e.attr("type"),g="radio"==f||"checkbox"==f?1:e.length,h=0;g>h;h++)this.updateElementStatus(a(e[h]),c,d);return this},updateElementStatus:function(b,c,d){var e=this,f=b.attr("data-bv-field"),g=b.parents(".form-group"),h=b.data("bv.messages"),i=h.find(".help-block[data-bv-validator]"),j=g.find('.form-control-feedback[data-bv-icon-for="'+f+'"]');if(d)b.data("bv.result."+d,c);else for(var k in this.options.fields[f].validators)b.data("bv.result."+k,c);var l,m,n=b.parents(".tab-pane");switch(n&&(l=n.attr("id"))&&(m=a('a[href="#'+l+'"][data-toggle="tab"]').parent()),c){case this.STATUS_VALIDATING:this.disableSubmitButtons(!0),g.removeClass("has-success").removeClass("has-error"),d?i.filter('.help-block[data-bv-validator="'+d+'"]').hide():i.hide(),j&&j.removeClass(this.options.feedbackIcons.valid).removeClass(this.options.feedbackIcons.invalid).addClass(this.options.feedbackIcons.validating).show(),m&&m.removeClass("bv-tab-success").removeClass("bv-tab-error");break;case this.STATUS_INVALID:this.disableSubmitButtons(!0),g.removeClass("has-success").addClass("has-error"),d?i.filter('[data-bv-validator="'+d+'"]').show():i.show(),j&&j.removeClass(this.options.feedbackIcons.valid).removeClass(this.options.feedbackIcons.validating).addClass(this.options.feedbackIcons.invalid).show(),m&&m.removeClass("bv-tab-success").addClass("bv-tab-error");break;case this.STATUS_VALID:d?i.filter('[data-bv-validator="'+d+'"]').hide():i.hide();var o=0==i.filter(function(){var c=a(this).css("display"),d=a(this).attr("data-bv-validator");return"block"==c||b.data("bv.result."+d)!=e.STATUS_VALID}).length;this.disableSubmitButtons(!o),j&&j.removeClass(this.options.feedbackIcons.invalid).removeClass(this.options.feedbackIcons.validating).removeClass(this.options.feedbackIcons.valid).addClass(o?this.options.feedbackIcons.valid:this.options.feedbackIcons.invalid).show();var p=function(c){return 0==c.find(".help-block[data-bv-validator]").filter(function(){var c=a(this).css("display"),d=a(this).attr("data-bv-validator");return"block"==c||b.data("bv.result."+d)&&b.data("bv.result."+d)!=e.STATUS_VALID}).length};g.removeClass("has-error has-success").addClass(p(g)?"has-success":"has-error"),m&&m.removeClass("bv-tab-success").removeClass("bv-tab-error").addClass(p(n)?"bv-tab-success":"bv-tab-error");break;case this.STATUS_NOT_VALIDATED:default:this.disableSubmitButtons(!1),g.removeClass("has-success").removeClass("has-error"),d?i.filter('.help-block[data-bv-validator="'+d+'"]').hide():i.hide(),j&&j.removeClass(this.options.feedbackIcons.valid).removeClass(this.options.feedbackIcons.invalid).removeClass(this.options.feedbackIcons.validating).hide(),m&&m.removeClass("bv-tab-success").removeClass("bv-tab-error")}return this},isValid:function(){var b,c,d,e,f,g,h,i;for(c in this.options.fields)if(null!=this.options.fields[c]&&this.options.fields[c].enabled)for(b=this.getFieldElements(c),e=b.attr("type"),h="radio"==e||"checkbox"==e?1:b.length,i=0;h>i;i++)if(d=a(b[i]),!this._isExcluded(d))for(g in this.options.fields[c].validators){if(f=d.data("bv.result."+g),f==this.STATUS_NOT_VALIDATED||f==this.STATUS_VALIDATING)return!1;if(f==this.STATUS_INVALID)return this.$invalidField=d,!1}return!0},defaultSubmit:function(){this.$form.off("submit.bv").submit()},resetForm:function(b){var c,d,e,f,g;for(c in this.options.fields){d=this.getFieldElements(c),e=d.length;for(var h=0;e>h;h++)for(g in this.options.fields[c].validators)a(d[h]).removeData("bv.dfs."+g);this.updateStatus(c,this.STATUS_NOT_VALIDATED,null),b&&(f=d.attr("type"),"radio"==f||"checkbox"==f?d.removeAttr("checked").removeAttr("selected"):d.val(""))}return this.$invalidField=null,this.$submitButton=null,this.disableSubmitButtons(!1),this},enableFieldValidators:function(a,b){return this.options.fields[a].enabled=b,this.updateStatus(a,this.STATUS_NOT_VALIDATED,null),this}},a.fn.bootstrapValidator=function(c){var d=arguments;return this.each(function(){var e=a(this),f=e.data("bootstrapValidator"),g="object"==typeof c&&c;f||(f=new b(this,g),e.data("bootstrapValidator",f)),"string"==typeof c&&f[c].apply(f,Array.prototype.slice.call(d,1))})},a.fn.bootstrapValidator.validators={},a.fn.bootstrapValidator.Constructor=b,a.fn.bootstrapValidator.helpers={date:function(a,b,c,d){if(1e3>a||a>9999||0==b||b>12)return!1;var e=[31,28,31,30,31,30,31,31,30,31,30,31];if((a%400==0||a%100!=0&&a%4==0)&&(e[1]=29),0>c||c>e[b-1])return!1;if(d===!0){var f=new Date,g=f.getFullYear(),h=f.getMonth(),i=f.getDate();return g>a||a==g&&h>b-1||a==g&&b-1==h&&i>c}return!0},luhn:function(a){for(var b=a.length,c=0,d=[[0,1,2,3,4,5,6,7,8,9],[0,2,4,6,8,1,3,5,7,9]],e=0;b--;)e+=d[c][parseInt(a.charAt(b),10)],c^=1;return e%10===0&&e>0},mod_11_10:function(a){for(var b=5,c=a.length,d=0;c>d;d++)b=(2*(b||10)%11+parseInt(a.charAt(d),10))%10;return 1==b},mod_37_36:function(a,b){b=b||"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";for(var c=b.length,d=a.length,e=Math.floor(c/2),f=0;d>f;f++)e=(2*(e||c)%(c+1)+b.indexOf(a.charAt(f)))%c;return 1==e}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.base64={validate:function(a,b){var c=b.val();return""==c?!0:/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$/.test(c)}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.between={html5Attributes:{message:"message",min:"min",max:"max",inclusive:"inclusive"},enableByHtml5:function(a){return"range"==a.attr("type")?{min:a.attr("min"),max:a.attr("max")}:!1},validate:function(a,b,c){var d=b.val();return""==d?!0:(d=parseFloat(d),c.inclusive===!0?d>c.min&&d=c.min&&d<=c.max)}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.callback={validate:function(b,c,d){var e=c.val();if(d.callback&&"function"==typeof d.callback){var f=new a.Deferred;return f.resolve(c,"callback",d.callback.call(this,e,b)),f}return!0}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.choice={html5Attributes:{message:"message",min:"min",max:"max"},validate:function(a,b,c){var d=b.is("select")?a.getFieldElements(b.attr("data-bv-field")).find("option").filter(":selected").length:a.getFieldElements(b.attr("data-bv-field")).filter(":checked").length;return c.min&&dc.max?!1:!0}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.creditCard={validate:function(b,c){var d=c.val();if(""==d)return!0;if(/[^0-9-\s]+/.test(d))return!1;if(d=d.replace(/\D/g,""),!a.fn.bootstrapValidator.helpers.luhn(d))return!1;var e,f,g={AMERICAN_EXPRESS:{length:[15],prefix:["34","37"]},DINERS_CLUB:{length:[14],prefix:["300","301","302","303","304","305","36"]},DINERS_CLUB_US:{length:[16],prefix:["54","55"]},DISCOVER:{length:[16],prefix:["6011","622126","622127","622128","622129","62213","62214","62215","62216","62217","62218","62219","6222","6223","6224","6225","6226","6227","6228","62290","62291","622920","622921","622922","622923","622924","622925","644","645","646","647","648","649","65"]},JCB:{length:[16],prefix:["3528","3529","353","354","355","356","357","358"]},LASER:{length:[16,17,18,19],prefix:["6304","6706","6771","6709"]},MAESTRO:{length:[12,13,14,15,16,17,18,19],prefix:["5018","5020","5038","6304","6759","6761","6762","6763","6764","6765","6766"]},MASTERCARD:{length:[16],prefix:["51","52","53","54","55"]},SOLO:{length:[16,18,19],prefix:["6334","6767"]},UNIONPAY:{length:[16,17,18,19],prefix:["622126","622127","622128","622129","62213","62214","62215","62216","62217","62218","62219","6222","6223","6224","6225","6226","6227","6228","62290","62291","622920","622921","622922","622923","622924","622925"]},VISA:{length:[16],prefix:["4"]}};for(e in g)for(f in g[e].prefix)if(d.substr(0,g[e].prefix[f].length)==g[e].prefix[f]&&-1!=g[e].length.indexOf(d.length))return!0;return!1}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.cusip={validate:function(b,c){var d=c.val();if(""==d)return!0;if(d=d.toUpperCase(),!/^[0-9A-Z]{9}$/.test(d))return!1;for(var e=a.map(d.split(""),function(a){var b=a.charCodeAt(0);return b>="A".charCodeAt(0)&&b<="Z".charCodeAt(0)?b-"A".charCodeAt(0)+10:a}),f=e.length,g=0,h=0;f-1>h;h++){var i=parseInt(e[h]);h%2!=0&&(i*=2),i>9&&(i-=9),g+=i}return g=(10-g%10)%10,g==e[f-1]}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.cvv={html5Attributes:{message:"message",ccfield:"creditCardField"},validate:function(a,b,c){var d=b.val();if(""==d)return!0;if(!/^[0-9]{3,4}$/.test(d))return!1;if(!c.creditCardField)return!0;var e=a.getFieldElements(c.creditCardField).val();if(""==e)return!0;e=e.replace(/\D/g,"");var f,g,h={AMERICAN_EXPRESS:{length:[15],prefix:["34","37"]},DINERS_CLUB:{length:[14],prefix:["300","301","302","303","304","305","36"]},DINERS_CLUB_US:{length:[16],prefix:["54","55"]},DISCOVER:{length:[16],prefix:["6011","622126","622127","622128","622129","62213","62214","62215","62216","62217","62218","62219","6222","6223","6224","6225","6226","6227","6228","62290","62291","622920","622921","622922","622923","622924","622925","644","645","646","647","648","649","65"]},JCB:{length:[16],prefix:["3528","3529","353","354","355","356","357","358"]},LASER:{length:[16,17,18,19],prefix:["6304","6706","6771","6709"]},MAESTRO:{length:[12,13,14,15,16,17,18,19],prefix:["5018","5020","5038","6304","6759","6761","6762","6763","6764","6765","6766"]},MASTERCARD:{length:[16],prefix:["51","52","53","54","55"]},SOLO:{length:[16,18,19],prefix:["6334","6767"]},UNIONPAY:{length:[16,17,18,19],prefix:["622126","622127","622128","622129","62213","62214","62215","62216","62217","62218","62219","6222","6223","6224","6225","6226","6227","6228","62290","62291","622920","622921","622922","622923","622924","622925"]},VISA:{length:[16],prefix:["4"]}},i=null;for(f in h)for(g in h[f].prefix)if(e.substr(0,h[f].prefix[g].length)==h[f].prefix[g]&&-1!=h[f].length.indexOf(e.length)){i=f;break}return null==i?!1:"AMERICAN_EXPRESS"==i?4==d.length:3==d.length}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.date={html5Attributes:{message:"message",format:"format"},validate:function(b,c,d){var e=c.val();if(""==e)return!0;d.format=d.format||"MM/DD/YYYY";var f=d.format.split(" "),g=f[0],h=f.length>1?f[1]:null,i=f.length>2?f[2]:null,j=e.split(" "),k=j[0],l=j.length>1?j[1]:null;if(f.length!=j.length)return!1;var m=-1!=k.indexOf("/")?"/":-1!=k.indexOf("-")?"-":null;if(null==m)return!1;k=k.split(m),g=g.split(m);var n=k[g.indexOf("YYYY")],o=k[g.indexOf("MM")],p=k[g.indexOf("DD")],q=null,r=null,s=null;if(h){if(h=h.split(":"),l=l.split(":"),h.length!=l.length)return!1;if(r=l.length>0?l[0]:null,q=l.length>1?l[1]:null,s=l.length>2?l[2]:null,s&&(s=parseInt(s,10),0>s||s>60))return!1;if(r&&(r=parseInt(r,10),0>r||r>=24||i&&r>12))return!1;if(q&&(q=parseInt(q,10),0>q||q>59))return!1}return p=parseInt(p,10),o=parseInt(o,10),n=parseInt(n,10),a.fn.bootstrapValidator.helpers.date(n,o,p)}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.different={html5Attributes:{message:"message",field:"field"},validate:function(a,b,c){var d=b.val();if(""==d)return!0;var e=a.getFieldElements(c.field);return null==e?!0:d!=e.val()?(a.updateStatus(c.field,a.STATUS_VALID,"different"),!0):!1}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.digits={validate:function(a,b){var c=b.val();return""==c?!0:/^\d+$/.test(c)}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.ean={validate:function(a,b){var c=b.val();if(""==c)return!0;if(!/^(\d{8}|\d{12}|\d{13})$/.test(c))return!1;for(var d=c.length,e=0,f=8==d?[3,1]:[1,3],g=0;d-1>g;g++)e+=parseInt(c.charAt(g))*f[g%2];return e=10-e%10,e==c.charAt(d-1)}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.emailAddress={enableByHtml5:function(a){return"email"==a.attr("type")},validate:function(a,b){var c=b.val();if(""==c)return!0;var d=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return d.test(c)}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.file={html5Attributes:{extension:"extension",maxsize:"maxSize",message:"message",type:"type"},validate:function(a,b,c){var d=b.val();if(""==d)return!0;var e,f=c.extension?c.extension.split(","):null,g=c.type?c.type.split(","):null,h=window.File&&window.FileList&&window.FileReader;if(h)for(var i=b.get(0).files,j=i.length,k=0;j>k;k++){if(c.maxSize&&i[k].size>parseInt(c.maxSize))return!1;if(e=i[k].name.substr(i[k].name.lastIndexOf(".")+1),f&&-1==f.indexOf(e))return!1;if(g&&-1==g.indexOf(i[k].type))return!1}else if(e=d.substr(d.lastIndexOf(".")+1),f&&-1==f.indexOf(e))return!1;return!0}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.greaterThan={html5Attributes:{message:"message",value:"value",inclusive:"inclusive"},enableByHtml5:function(a){var b=a.attr("min");return b?{value:b}:!1},validate:function(a,b,c){var d=b.val();return""==d?!0:(d=parseFloat(d),c.inclusive===!0?d>c.value:d>=c.value)}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.grid={validate:function(b,c){var d=c.val();return""==d?!0:(d=d.toUpperCase(),/^[GRID:]*([0-9A-Z]{2})[-\s]*([0-9A-Z]{5})[-\s]*([0-9A-Z]{10})[-\s]*([0-9A-Z]{1})$/g.test(d)?(d=d.replace(/\s/g,"").replace(/-/g,""),"GRID:"==d.substr(0,5)&&(d=d.substr(5)),a.fn.bootstrapValidator.helpers.mod_37_36(d)):!1)}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.hex={validate:function(a,b){var c=b.val();return""==c?!0:/^[0-9a-fA-F]+$/.test(c)}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.hexColor={enableByHtml5:function(a){return"color"==a.attr("type")},validate:function(a,b){var c=b.val();return""==c?!0:/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(c)}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.iban={html5Attributes:{message:"message",country:"country"},validate:function(b,c,d){var e=c.val();if(""==e)return!0;var f={AD:"AD[0-9]{2}[0-9]{4}[0-9]{4}[A-Z0-9]{12}",AE:"AE[0-9]{2}[0-9]{3}[0-9]{16}",AL:"AL[0-9]{2}[0-9]{8}[A-Z0-9]{16}",AO:"AO[0-9]{2}[0-9]{21}",AT:"AT[0-9]{2}[0-9]{5}[0-9]{11}",AZ:"AZ[0-9]{2}[A-Z]{4}[A-Z0-9]{20}",BA:"BA[0-9]{2}[0-9]{3}[0-9]{3}[0-9]{8}[0-9]{2}",BE:"BE[0-9]{2}[0-9]{3}[0-9]{7}[0-9]{2}",BF:"BF[0-9]{2}[0-9]{23}",BG:"BG[0-9]{2}[A-Z]{4}[0-9]{4}[0-9]{2}[A-Z0-9]{8}",BH:"BH[0-9]{2}[A-Z]{4}[A-Z0-9]{14}",BI:"BI[0-9]{2}[0-9]{12}",BJ:"BJ[0-9]{2}[A-Z]{1}[0-9]{23}",BR:"BR[0-9]{2}[0-9]{8}[0-9]{5}[0-9]{10}[A-Z][A-Z0-9]",CH:"CH[0-9]{2}[0-9]{5}[A-Z0-9]{12}",CI:"CI[0-9]{2}[A-Z]{1}[0-9]{23}",CM:"CM[0-9]{2}[0-9]{23}",CR:"CR[0-9]{2}[0-9]{3}[0-9]{14}",CV:"CV[0-9]{2}[0-9]{21}",CY:"CY[0-9]{2}[0-9]{3}[0-9]{5}[A-Z0-9]{16}",CZ:"CZ[0-9]{2}[0-9]{20}",DE:"DE[0-9]{2}[0-9]{8}[0-9]{10}",DK:"DK[0-9]{2}[0-9]{14}",DO:"DO[0-9]{2}[A-Z0-9]{4}[0-9]{20}",DZ:"DZ[0-9]{2}[0-9]{20}",EE:"EE[0-9]{2}[0-9]{2}[0-9]{2}[0-9]{11}[0-9]{1}",ES:"ES[0-9]{2}[0-9]{4}[0-9]{4}[0-9]{1}[0-9]{1}[0-9]{10}",FI:"FI[0-9]{2}[0-9]{6}[0-9]{7}[0-9]{1}",FO:"FO[0-9]{2}[0-9]{4}[0-9]{9}[0-9]{1}",FR:"FR[0-9]{2}[0-9]{5}[0-9]{5}[A-Z0-9]{11}[0-9]{2}",GB:"GB[0-9]{2}[A-Z]{4}[0-9]{6}[0-9]{8}",GE:"GE[0-9]{2}[A-Z]{2}[0-9]{16}",GI:"GI[0-9]{2}[A-Z]{4}[A-Z0-9]{15}",GL:"GL[0-9]{2}[0-9]{4}[0-9]{9}[0-9]{1}",GR:"GR[0-9]{2}[0-9]{3}[0-9]{4}[A-Z0-9]{16}",GT:"GT[0-9]{2}[A-Z0-9]{4}[A-Z0-9]{20}",HR:"HR[0-9]{2}[0-9]{7}[0-9]{10}",HU:"HU[0-9]{2}[0-9]{3}[0-9]{4}[0-9]{1}[0-9]{15}[0-9]{1}",IE:"IE[0-9]{2}[A-Z]{4}[0-9]{6}[0-9]{8}",IL:"IL[0-9]{2}[0-9]{3}[0-9]{3}[0-9]{13}",IR:"IR[0-9]{2}[0-9]{22}",IS:"IS[0-9]{2}[0-9]{4}[0-9]{2}[0-9]{6}[0-9]{10}",IT:"IT[0-9]{2}[A-Z]{1}[0-9]{5}[0-9]{5}[A-Z0-9]{12}",JO:"JO[0-9]{2}[A-Z]{4}[0-9]{4}[0]{8}[A-Z0-9]{10}",KW:"KW[0-9]{2}[A-Z]{4}[0-9]{22}",KZ:"KZ[0-9]{2}[0-9]{3}[A-Z0-9]{13}",LB:"LB[0-9]{2}[0-9]{4}[A-Z0-9]{20}",LI:"LI[0-9]{2}[0-9]{5}[A-Z0-9]{12}",LT:"LT[0-9]{2}[0-9]{5}[0-9]{11}",LU:"LU[0-9]{2}[0-9]{3}[A-Z0-9]{13}",LV:"LV[0-9]{2}[A-Z]{4}[A-Z0-9]{13}",MC:"MC[0-9]{2}[0-9]{5}[0-9]{5}[A-Z0-9]{11}[0-9]{2}",MD:"MD[0-9]{2}[A-Z0-9]{20}",ME:"ME[0-9]{2}[0-9]{3}[0-9]{13}[0-9]{2}",MG:"MG[0-9]{2}[0-9]{23}",MK:"MK[0-9]{2}[0-9]{3}[A-Z0-9]{10}[0-9]{2}",ML:"ML[0-9]{2}[A-Z]{1}[0-9]{23}",MR:"MR13[0-9]{5}[0-9]{5}[0-9]{11}[0-9]{2}",MT:"MT[0-9]{2}[A-Z]{4}[0-9]{5}[A-Z0-9]{18}",MU:"MU[0-9]{2}[A-Z]{4}[0-9]{2}[0-9]{2}[0-9]{12}[0-9]{3}[A-Z]{3}",MZ:"MZ[0-9]{2}[0-9]{21}",NL:"NL[0-9]{2}[A-Z]{4}[0-9]{10}",NO:"NO[0-9]{2}[0-9]{4}[0-9]{6}[0-9]{1}",PK:"PK[0-9]{2}[A-Z]{4}[A-Z0-9]{16}",PL:"PL[0-9]{2}[0-9]{8}[0-9]{16}",PS:"PS[0-9]{2}[A-Z]{4}[A-Z0-9]{21}",PT:"PT[0-9]{2}[0-9]{4}[0-9]{4}[0-9]{11}[0-9]{2}",QA:"QA[0-9]{2}[A-Z]{4}[A-Z0-9]{21}",RO:"RO[0-9]{2}[A-Z]{4}[A-Z0-9]{16}",RS:"RS[0-9]{2}[0-9]{3}[0-9]{13}[0-9]{2}",SA:"SA[0-9]{2}[0-9]{2}[A-Z0-9]{18}",SE:"SE[0-9]{2}[0-9]{3}[0-9]{16}[0-9]{1}",SI:"SI[0-9]{2}[0-9]{5}[0-9]{8}[0-9]{2}",SK:"SK[0-9]{2}[0-9]{4}[0-9]{6}[0-9]{10}",SM:"SM[0-9]{2}[A-Z]{1}[0-9]{5}[0-9]{5}[A-Z0-9]{12}",SN:"SN[0-9]{2}[A-Z]{1}[0-9]{23}",TN:"TN59[0-9]{2}[0-9]{3}[0-9]{13}[0-9]{2}",TR:"TR[0-9]{2}[0-9]{5}[A-Z0-9]{1}[A-Z0-9]{16}",VG:"VG[0-9]{2}[A-Z]{4}[0-9]{16}"};e=e.replace(/[^a-zA-Z0-9]/g,"").toUpperCase();var g=d.country||e.substr(0,2);if(!f[g])return!1;if(!new RegExp("^"+f[g]+"$").test(e))return!1;e=e.substr(4)+e.substr(0,4),e=a.map(e.split(""),function(a){var b=a.charCodeAt(0);return b>="A".charCodeAt(0)&&b<="Z".charCodeAt(0)?b-"A".charCodeAt(0)+10:a}),e=e.join("");for(var h=parseInt(e.substr(0,1),10),i=e.length,j=1;i>j;++j)h=(10*h+parseInt(e.substr(j,1),10))%97;return 1==h}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.id={html5Attributes:{message:"message",country:"country"},validate:function(a,b,c){var d=b.val();if(""==d)return!0;var e=c.country||d.substr(0,2),f=["_",e.toLowerCase()].join("");return this[f]&&"function"==typeof this[f]?this[f](d):!0},_validateJMBG:function(a,b){if(!/^\d{13}$/.test(a))return!1;var c=parseInt(a.substr(0,2),10),d=parseInt(a.substr(2,2),10),e=(parseInt(a.substr(4,3),10),parseInt(a.substr(7,2),10)),f=parseInt(a.substr(12,1),10);if(c>31||d>12)return!1;for(var g=0,h=0;6>h;h++)g+=(7-h)*(parseInt(a.charAt(h))+parseInt(a.charAt(h+6)));if(g=11-g%11,(10==g||11==g)&&(g=0),g!=f)return!1;switch(b.toUpperCase()){case"BA":return e>=10&&19>=e;case"MK":return e>=41&&49>=e;case"ME":return e>=20&&29>=e;case"RS":return e>=70&&99>=e;case"SI":return e>=50&&59>=e;default:return!0}},_ba:function(a){return this._validateJMBG(a,"BA")},_mk:function(a){return this._validateJMBG(a,"MK")},_me:function(a){return this._validateJMBG(a,"ME")},_rs:function(a){return this._validateJMBG(a,"RS")},_si:function(a){return this._validateJMBG(a,"SI")},_bg:function(b){if(!/^\d{10}$/.test(b)&&!/^\d{6}\s\d{3}\s\d{1}$/.test(b))return!1;b=b.replace(/\s/g,"");var c=parseInt(b.substr(0,2),10)+1900,d=parseInt(b.substr(2,2),10),e=parseInt(b.substr(4,2),10);if(d>40?(c+=100,d-=40):d>20&&(c-=100,d-=20),!a.fn.bootstrapValidator.helpers.date(c,d,e))return!1;for(var f=0,g=[2,4,8,5,10,9,7,3,6],h=0;9>h;h++)f+=parseInt(b.charAt(h))*g[h];return f=f%11%10,f==b.substr(9,1)},_br:function(a){if(/^1{11}|2{11}|3{11}|4{11}|5{11}|6{11}|7{11}|8{11}|9{11}|0{11}$/.test(a))return!1;if(!/^\d{11}$/.test(a)&&!/^\d{3}\.\d{3}\.\d{3}-\d{2}$/.test(a))return!1;a=a.replace(/\./g,"").replace(/-/g,"");for(var b=0,c=0;9>c;c++)b+=(10-c)*parseInt(a.charAt(c));if(b=11-b%11,(10==b||11==b)&&(b=0),b!=a.charAt(9))return!1;var d=0;for(c=0;10>c;c++)d+=(11-c)*parseInt(a.charAt(c));return d=11-d%11,(10==d||11==d)&&(d=0),d==a.charAt(10)},_ch:function(a){if(!/^756[\.]{0,1}[0-9]{4}[\.]{0,1}[0-9]{4}[\.]{0,1}[0-9]{2}$/.test(a))return!1;a=a.replace(/\D/g,"").substr(3);for(var b=a.length,c=0,d=8==b?[3,1]:[1,3],e=0;b-1>e;e++)c+=parseInt(a.charAt(e))*d[e%2];return c=10-c%10,c==a.charAt(b-1)},_cl:function(a){if(!/^\d{7,8}[-]{0,1}[0-9K]$/.test(a))return!1;for(a=a.replace(/\D/g,"");a.length<9;)a="0"+a;for(var b=0,c=[3,2,7,6,5,4,3,2],d=0;8>d;d++)b+=parseInt(a.charAt(d))*c[d];return b=11-b%11,11==b?b=0:10==b&&(b="K"),b==a.charAt(8)},_cz:function(b){if(!/^\d{9,10}$/.test(b))return!1;var c=1900+parseInt(b.substr(0,2)),d=parseInt(b.substr(2,2))%50%20,e=parseInt(b.substr(4,2));if(9==b.length){if(c>=1980&&(c-=100),c>1953)return!1}else 1954>c&&(c+=100);if(!a.fn.bootstrapValidator.helpers.date(c,d,e))return!1;if(10==b.length){var f=parseInt(b.substr(0,9),10)%11;return 1985>c&&(f%=10),f==b.substr(9,1)}return!0},_dk:function(b){if(!/^[0-9]{6}[-]{0,1}[0-9]{4}$/.test(b))return!1;b=b.replace(/-/g,"");var c=parseInt(b.substr(0,2),10),d=parseInt(b.substr(2,2),10),e=parseInt(b.substr(4,2),10);switch(!0){case-1!="5678".indexOf(b.charAt(6))&&e>=58:e+=1800;break;case-1!="0123".indexOf(b.charAt(6)):case-1!="49".indexOf(b.charAt(6))&&e>=37:e+=1900;break;default:e+=2e3}return a.fn.bootstrapValidator.helpers.date(e,d,c)},_ee:function(a){return this._lt(a)},_es:function(a){if(!/^[0-9A-Z]{8}[-]{0,1}[0-9A-Z]$/.test(a)&&!/^[XYZ][-]{0,1}[0-9]{7}[-]{0,1}[0-9A-Z]$/.test(a))return!1;a=a.replace(/-/g,"");var b="XYZ".indexOf(a.charAt(0));-1!=b&&(a=b+a.substr(1)+"");var c=parseInt(a.substr(0,8),10);return c="TRWAGMYFPDXBNJZSQVHLCKE"[c%23],c==a.substr(8,1)},_fi:function(b){if(!/^[0-9]{6}[-+A][0-9]{3}[0-9ABCDEFHJKLMNPRSTUVWXY]$/.test(b))return!1;var c=parseInt(b.substr(0,2),10),d=parseInt(b.substr(2,2),10),e=parseInt(b.substr(4,2),10),f={"+":1800,"-":1900,A:2e3};if(e=f[b.charAt(6)]+e,!a.fn.bootstrapValidator.helpers.date(e,d,c))return!1;var g=parseInt(b.substr(7,3));if(2>g)return!1;var h=b.substr(0,6)+b.substr(7,3)+"";return h=parseInt(h),"0123456789ABCDEFHJKLMNPRSTUVWXY".charAt(h%31)==b.charAt(10)},_hr:function(b){return/^[0-9]{11}$/.test(b)?a.fn.bootstrapValidator.helpers.mod_11_10(b):!1},_ie:function(a){if(!/^\d{7}[A-W][AHWTX]?$/.test(a))return!1;var b=function(a){for(;a.length<7;)a="0"+a;for(var b="WABCDEFGHIJKLMNOPQRSTUV",c=0,d=0;7>d;d++)c+=parseInt(a.charAt(d))*(8-d);return c+=9*b.indexOf(a.substr(7)),b[c%23]};return 9!=a.length||"A"!=a.charAt(8)&&"H"!=a.charAt(8)?a.charAt(7)==b(a.substr(0,7)):a.charAt(7)==b(a.substr(0,7)+a.substr(8)+"")},_is:function(b){if(!/^[0-9]{6}[-]{0,1}[0-9]{4}$/.test(b))return!1;b=b.replace(/-/g,"");var c=parseInt(b.substr(0,2),10),d=parseInt(b.substr(2,2),10),e=parseInt(b.substr(4,2),10),f=parseInt(b.charAt(9));if(e=9==f?1900+e:100*(20+f)+e,!a.fn.bootstrapValidator.helpers.date(e,d,c,!0))return!1;for(var g=0,h=[3,2,7,6,5,4,3,2],i=0;8>i;i++)g+=parseInt(b.charAt(i))*h[i];return g=11-g%11,g==b.charAt(8)},_lt:function(b){if(!/^[0-9]{11}$/.test(b))return!1;var c=parseInt(b.charAt(0)),d=parseInt(b.substr(1,2),10),e=parseInt(b.substr(3,2),10),f=parseInt(b.substr(5,2),10),g=c%2==0?17+c/2:17+(c+1)/2;if(d=100*g+d,!a.fn.bootstrapValidator.helpers.date(d,e,f,!0))return!1;for(var h=0,i=[1,2,3,4,5,6,7,8,9,1],j=0;10>j;j++)h+=parseInt(b.charAt(j))*i[j];if(h%=11,10!=h)return h==b.charAt(10);for(h=0,i=[3,4,5,6,7,8,9,1,2,3],j=0;10>j;j++)h+=parseInt(b.charAt(j))*i[j];return h%=11,10==h&&(h=0),h==b.charAt(10)},_lv:function(b){if(!/^[0-9]{6}[-]{0,1}[0-9]{5}$/.test(b))return!1;b=b.replace(/\D/g,"");var c=parseInt(b.substr(0,2)),d=parseInt(b.substr(2,2)),e=parseInt(b.substr(4,2));if(e=e+1800+100*parseInt(b.charAt(6)),!a.fn.bootstrapValidator.helpers.date(e,d,c,!0))return!1;for(var f=0,g=[10,5,8,4,2,1,6,3,7,9],h=0;10>h;h++)f+=parseInt(b.charAt(h))*g[h];return f=(f+1)%11%10,f==b.charAt(10)},_nl:function(a){for(;a.length<9;)a="0"+a;if(!/^[0-9]{4}[.]{0,1}[0-9]{2}[.]{0,1}[0-9]{3}$/.test(a))return!1;if(a=a.replace(/\./g,""),0==parseInt(a,10))return!1;for(var b=0,c=a.length,d=0;c-1>d;d++)b+=(9-d)*parseInt(a.charAt(d));return b%=11,10==b&&(b=0),b==a.charAt(c-1)},_ro:function(b){if(!/^[0-9]{13}$/.test(b))return!1;var c=parseInt(b.charAt(0));if(0==c||7==c||8==c)return!1;var d=parseInt(b.substr(1,2),10),e=parseInt(b.substr(3,2),10),f=parseInt(b.substr(5,2),10),g={1:1900,2:1900,3:1800,4:1800,5:2e3,6:2e3};if(f>31&&e>12)return!1;if(9!=c&&(d=g[c+""]+d,!a.fn.bootstrapValidator.helpers.date(d,e,f)))return!1;for(var h=0,i=[2,7,9,1,4,6,3,5,8,2,7,9],j=b.length,k=0;j-1>k;k++)h+=parseInt(b.charAt(k))*i[k]; -return h%=11,10==h&&(h=1),h==b.charAt(j-1)},_se:function(b){if(!/^[0-9]{10}$/.test(b)&&!/^[0-9]{6}[-|+][0-9]{4}$/.test(b))return!1;b=b.replace(/[^0-9]/g,"");var c=parseInt(b.substr(0,2))+1900,d=parseInt(b.substr(2,2)),e=parseInt(b.substr(4,2));return a.fn.bootstrapValidator.helpers.date(c,d,e)?a.fn.bootstrapValidator.helpers.luhn(b):!1},_sk:function(a){return this._cz(a)},_sm:function(a){return/^\d{5}$/.test(a)},_za:function(b){if(!/^[0-9]{10}[0|1][8|9][0-9]$/.test(b))return!1;var c=parseInt(b.substr(0,2)),d=(new Date).getFullYear()%100,e=parseInt(b.substr(2,2)),f=parseInt(b.substr(4,2));return c=c>=d?c+1900:c+2e3,a.fn.bootstrapValidator.helpers.date(c,e,f)?a.fn.bootstrapValidator.helpers.luhn(b):!1}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.identical={html5Attributes:{message:"message",field:"field"},validate:function(a,b,c){var d=b.val();if(""==d)return!0;var e=a.getFieldElements(c.field);return null==e?!0:d==e.val()?(a.updateStatus(c.field,a.STATUS_VALID,"identical"),!0):!1}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.imei={validate:function(b,c){var d=c.val();if(""==d)return!0;switch(!0){case/^\d{15}$/.test(d):case/^\d{2}-\d{6}-\d{6}-\d{1}$/.test(d):case/^\d{2}\s\d{6}\s\d{6}\s\d{1}$/.test(d):return d=d.replace(/[^0-9]/g,""),a.fn.bootstrapValidator.helpers.luhn(d);case/^\d{14}$/.test(d):case/^\d{16}$/.test(d):case/^\d{2}-\d{6}-\d{6}(|-\d{2})$/.test(d):case/^\d{2}\s\d{6}\s\d{6}(|\s\d{2})$/.test(d):return!0;default:return!1}}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.integer={enableByHtml5:function(a){return"number"==a.attr("type")},validate:function(a,b){var c=b.val();return""==c?!0:/^(?:-?(?:0|[1-9][0-9]*))$/.test(c)}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.ip={html5Attributes:{message:"message",ipv4:"ipv4",ipv6:"ipv6"},validate:function(b,c,d){var e=c.val();return""==e?!0:(d=a.extend({},{ipv4:!0,ipv6:!0},d),d.ipv4?/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(e):d.ipv6?/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/.test(str):!1)}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.isbn={validate:function(a,b){var c=b.val();if(""==c)return!0;var d;switch(!0){case/^\d{9}[\dX]$/.test(c):case 13==c.length&&/^(\d+)-(\d+)-(\d+)-([\dX])$/.test(c):case 13==c.length&&/^(\d+)\s(\d+)\s(\d+)\s([\dX])$/.test(c):d="ISBN10";break;case/^(978|979)\d{9}[\dX]$/.test(c):case 17==c.length&&/^(978|979)-(\d+)-(\d+)-(\d+)-([\dX])$/.test(c):case 17==c.length&&/^(978|979)\s(\d+)\s(\d+)\s(\d+)\s([\dX])$/.test(c):d="ISBN13";break;default:return!1}c=c.replace(/[^0-9X]/gi,"");var e,f=c.split(""),g=f.length,h=0;switch(d){case"ISBN10":h=0;for(var i=0;g-1>i;i++)h+=(10-i)*parseInt(f[i]);return e=11-h%11,11==e?e=0:10==e&&(e="X"),e+""==f[g-1];case"ISBN13":h=0;for(var i=0;g-1>i;i++)h+=i%2==0?parseInt(f[i]):3*parseInt(f[i]);return e=10-h%10,10==e&&(e="0"),e+""==f[g-1];default:return!1}}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.isin={COUNTRY_CODES:"AF|AX|AL|DZ|AS|AD|AO|AI|AQ|AG|AR|AM|AW|AU|AT|AZ|BS|BH|BD|BB|BY|BE|BZ|BJ|BM|BT|BO|BQ|BA|BW|BV|BR|IO|BN|BG|BF|BI|KH|CM|CA|CV|KY|CF|TD|CL|CN|CX|CC|CO|KM|CG|CD|CK|CR|CI|HR|CU|CW|CY|CZ|DK|DJ|DM|DO|EC|EG|SV|GQ|ER|EE|ET|FK|FO|FJ|FI|FR|GF|PF|TF|GA|GM|GE|DE|GH|GI|GR|GL|GD|GP|GU|GT|GG|GN|GW|GY|HT|HM|VA|HN|HK|HU|IS|IN|ID|IR|IQ|IE|IM|IL|IT|JM|JP|JE|JO|KZ|KE|KI|KP|KR|KW|KG|LA|LV|LB|LS|LR|LY|LI|LT|LU|MO|MK|MG|MW|MY|MV|ML|MT|MH|MQ|MR|MU|YT|MX|FM|MD|MC|MN|ME|MS|MA|MZ|MM|NA|NR|NP|NL|NC|NZ|NI|NE|NG|NU|NF|MP|NO|OM|PK|PW|PS|PA|PG|PY|PE|PH|PN|PL|PT|PR|QA|RE|RO|RU|RW|BL|SH|KN|LC|MF|PM|VC|WS|SM|ST|SA|SN|RS|SC|SL|SG|SX|SK|SI|SB|SO|ZA|GS|SS|ES|LK|SD|SR|SJ|SZ|SE|CH|SY|TW|TJ|TZ|TH|TL|TG|TK|TO|TT|TN|TR|TM|TC|TV|UG|UA|AE|GB|US|UM|UY|UZ|VU|VE|VN|VG|VI|WF|EH|YE|ZM|ZW",validate:function(a,b){var c=b.val();if(""==c)return!0;c=c.toUpperCase();var d=new RegExp("^("+this.COUNTRY_CODES+")[0-9A-Z]{10}$");if(!d.test(c))return!1;for(var e="",f=c.length,g=0;f-1>g;g++){var h=c.charCodeAt(g);e+=h>57?(h-55).toString():c.charAt(g)}var i="",j=e.length,k=j%2!=0?0:1;for(g=0;j>g;g++)i+=parseInt(e[g])*(g%2==k?2:1)+"";var l=0;for(g=0;gh;h++)f+=parseInt(c.charAt(h))*g[h%2];return f=10-f%10,f==c.charAt(e-1)}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.issn={validate:function(a,b){var c=b.val();if(""==c)return!0;if(!/^\d{4}\-\d{3}[\dX]$/.test(c))return!1;c=c.replace(/[^0-9X]/gi,"");var d=c.split(""),e=d.length,f=0;"X"==d[7]&&(d[7]=10);for(var g=0;e>g;g++)f+=(8-g)*parseInt(d[g]);return f%11==0}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.lessThan={html5Attributes:{message:"message",value:"value",inclusive:"inclusive"},enableByHtml5:function(a){var b=a.attr("max");return b?{value:b}:!1},validate:function(a,b,c){var d=b.val();return""==d?!0:(d=parseFloat(d),c.inclusive===!1?d<=c.value:d0:""!=a.trim(c.val())}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.numeric={html5Attributes:{message:"message",separator:"separator"},validate:function(a,b,c){var d=b.val();if(""==d)return!0;var e=c.separator||".";return"."!=e&&(d=d.replace(e,".")),!isNaN(parseFloat(d))&&isFinite(d)}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.phone={html5Attributes:{message:"message",country:"country"},validate:function(a,b,c){var d=b.val();if(""==d)return!0;var e=(c.country||"US").toUpperCase();switch(e){case"US":default:return d=d.replace(/\D/g,""),/^(?:(1\-?)|(\+1 ?))?\(?(\d{3})[\)\-\.]?(\d{3})[\-\.]?(\d{4})$/.test(d)&&10==d.length}}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.regexp={html5Attributes:{message:"message",regexp:"regexp"},enableByHtml5:function(a){var b=a.attr("pattern");return b?{regexp:b}:!1},validate:function(a,b,c){var d=b.val();if(""==d)return!0;var e="string"==typeof c.regexp?new RegExp(c.regexp):c.regexp;return e.test(d)}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.remote={html5Attributes:{message:"message",url:"url",name:"name"},validate:function(b,c,d){var e=c.val();if(""==e)return!0;var f=c.attr("data-bv-field"),g=d.data;null==g&&(g={}),"function"==typeof g&&(g=g.call(this,b)),g[d.name||f]=e;var h=new a.Deferred,i=a.ajax({type:"POST",url:d.url,dataType:"json",data:g});return i.then(function(a){h.resolve(c,"remote",a.valid===!0||"true"===a.valid)}),h.fail(function(){i.abort()}),h}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.rtn={validate:function(a,b){var c=b.val();if(""==c)return!0;if(!/^\d{9}$/.test(c))return!1;for(var d=0,e=0;eg;g++)d+=e[g]*parseInt(c.charAt(g),36);return d=(10-d%10)%10,d==c.charAt(f-1)}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.siren={validate:function(b,c){var d=c.val();return""==d?!0:/^\d{9}$/.test(d)?a.fn.bootstrapValidator.helpers.luhn(d):!1}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.siret={validate:function(a,b){var c=b.val();if(""==c)return!0;for(var d,e=0,f=c.length,g=0;f>g;g++)d=parseInt(c.charAt(g),10),g%2==0&&(d=2*d,d>9&&(d-=9)),e+=d;return e%10==0}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.step={html5Attributes:{message:"message",base:"baseValue",step:"step"},validate:function(b,c,d){var e=c.val();if(""==e)return!0;if(d=a.extend({},{baseValue:0,step:1},d),e=parseFloat(e),isNaN(e)||!isFinite(e))return!1;var f=function(a,b){var c=Math.pow(10,b);a*=c;var d=a>0|-(0>a),e=a%1===.5*d;return e?(Math.floor(a)+(d>0))/c:Math.round(a)/c},g=function(a,b){if(0==b)return 1;var c=(a+"").split("."),d=(b+"").split("."),e=(1==c.length?0:c[1].length)+(1==d.length?0:d[1].length);return f(a-b*Math.floor(a/b),e)},h=g(e-d.baseValue,d.step);return 0==h||h==d.step}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.stringCase={html5Attributes:{message:"message","case":"case"},validate:function(a,b,c){var d=b.val();if(""==d)return!0;var e=(c["case"]||"lower").toLowerCase();switch(e){case"upper":return d===d.toUpperCase();case"lower":default:return d===d.toLowerCase()}}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.stringLength={html5Attributes:{message:"message",min:"min",max:"max"},enableByHtml5:function(a){var b=a.attr("maxlength");return b?{max:parseInt(b,10)}:!1},validate:function(b,c,d){var e=c.val();if(""==e)return!0;var f=a.trim(e).length;return d.min&&fd.max?!1:!0}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.uri={enableByHtml5:function(a){return"url"==a.attr("type")},validate:function(a,b){var c=b.val();if(""==c)return!0;var d=new RegExp("^(?:(?:https?|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?!10(?:\\.\\d{1,3}){3})(?!127(?:\\.\\d{1,3}){3})(?!169\\.254(?:\\.\\d{1,3}){2})(?!192\\.168(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:/[^\\s]*)?$","i");return d.test(c)}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.uuid={html5Attributes:{message:"message",version:"version"},validate:function(a,b,c){var d=b.val();if(""==d)return!0;var e={3:/^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,4:/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,5:/^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,all:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i},f=c.version?c.version+"":"all";return null==e[f]?!0:e[f].test(d)}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.vat={html5Attributes:{message:"message",country:"country"},validate:function(a,b,c){var d=b.val();if(""==d)return!0;var e=c.country||d.substr(0,2),f=["_",e.toLowerCase()].join("");return this[f]&&"function"==typeof this[f]?this[f](d):!0},_at:function(a){if(!/^ATU[0-9]{8}$/.test(a))return!1;a=a.substr(3);for(var b=0,c=[1,2,1,2,1,2,1],d=0,e=0;7>e;e++)d=parseInt(a.charAt(e))*c[e],d>9&&(d=Math.floor(d/10)+d%10),b+=d;return b=10-(b+4)%10,10==b&&(b=0),b==a.substr(7,1)},_be:function(a){if(!/^BE[0]{0,1}[0-9]{9}$/.test(a))return!1;if(a=a.substr(2),9==a.length&&(a="0"+a),0==a.substr(1,1))return!1;var b=parseInt(a.substr(0,8),10)+parseInt(a.substr(8,2),10);return b%97==0},_bg:function(b){if(!/^BG[0-9]{9,10}$/.test(b))return!1;b=b.substr(2);var c=0,d=0;if(9==b.length){for(d=0;8>d;d++)c+=parseInt(b.charAt(d))*(d+1);if(c%=11,10==c)for(c=0,d=0;8>d;d++)c+=parseInt(b.charAt(d))*(d+3);return c%=10,c==b.substr(8)}if(10==b.length){var e=function(b){var c=parseInt(b.substr(0,2),10)+1900,d=parseInt(b.substr(2,2),10),e=parseInt(b.substr(4,2),10);if(d>40?(c+=100,d-=40):d>20&&(c-=100,d-=20),!a.fn.bootstrapValidator.helpers.date(c,d,e))return!1;for(var f=0,g=[2,4,8,5,10,9,7,3,6],h=0;9>h;h++)f+=parseInt(b.charAt(h))*g[h];return f=f%11%10,f==b.substr(9,1)},f=function(a){for(var b=0,c=[21,19,17,13,11,9,7,3,1],d=0;9>d;d++)b+=parseInt(a.charAt(d))*c[d];return b%=10,b==a.substr(9,1)},g=function(a){for(var b=0,c=[4,3,2,7,6,5,4,3,2],d=0;9>d;d++)b+=parseInt(a.charAt(d))*c[d];return b=11-b%11,10==b?!1:(11==b&&(b=0),b==a.substr(9,1))};return e(b)||f(b)||g(b)}return!1},_ch:function(a){if(!/^CHE[0-9]{9}(MWST)?$/.test(a))return!1;a=a.substr(3);for(var b=0,c=[5,4,3,2,7,6,5,4],d=0;8>d;d++)b+=parseInt(a.charAt(d),10)*c[d];return b=11-b%11,10==b?!1:(11==b&&(b=0),b==a.substr(8,1))},_cy:function(a){if(!/^CY[0-5|9]{1}[0-9]{7}[A-Z]{1}$/.test(a))return!1;if(a=a.substr(2),"12"==a.substr(0,2))return!1;for(var b=0,c={0:1,1:0,2:5,3:7,4:9,5:13,6:15,7:17,8:19,9:21},d=0;8>d;d++){var e=parseInt(a.charAt(d),10);d%2==0&&(e=c[e+""]),b+=e}return b="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[b%26],b==a.substr(8,1)},_cz:function(b){if(!/^CZ[0-9]{8,10}$/.test(b))return!1;b=b.substr(2);var c=0,d=0;if(8==b.length){if(b.charAt(0)+""=="9")return!1;for(c=0,d=0;7>d;d++)c+=parseInt(b.charAt(d),10)*(8-d);return c=11-c%11,10==c&&(c=0),11==c&&(c=1),c==b.substr(7,1)}if(9==b.length&&b.charAt(0)+""=="6"){for(c=0,d=0;7>d;d++)c+=parseInt(b.charAt(d+1),10)*(8-d);return c=11-c%11,10==c&&(c=0),11==c&&(c=1),c=[8,7,6,5,4,3,2,1,0,9,10][c-1],c==b.substr(8,1)}if(9==b.length||10==b.length){var e=1900+parseInt(b.substr(0,2)),f=parseInt(b.substr(2,2))%50%20,g=parseInt(b.substr(4,2));if(9==b.length){if(e>=1980&&(e-=100),e>1953)return!1}else 1954>e&&(e+=100);if(!a.fn.bootstrapValidator.helpers.date(e,f,g))return!1;if(10==b.length){var h=parseInt(b.substr(0,9),10)%11;return 1985>e&&(h%=10),h==b.substr(9,1)}return!0}return!1},_de:function(b){return/^DE[0-9]{9}$/.test(b)?(b=b.substr(2),a.fn.bootstrapValidator.helpers.mod_11_10(b)):!1},_dk:function(a){if(!/^DK[0-9]{8}$/.test(a))return!1;a=a.substr(2);for(var b=0,c=[2,7,6,5,4,3,2,1],d=0;8>d;d++)b+=parseInt(a.charAt(d),10)*c[d];return b%11==0},_ee:function(a){if(!/^EE[0-9]{9}$/.test(a))return!1;a=a.substr(2);for(var b=0,c=[3,7,1,3,7,1,3,7,1],d=0;9>d;d++)b+=parseInt(a.charAt(d))*c[d];return b%10==0},_es:function(a){if(!/^ES[0-9A-Z][0-9]{7}[0-9A-Z]$/.test(a))return!1;a=a.substr(2);var b=function(a){var b=parseInt(a.substr(0,8),10);return b="TRWAGMYFPDXBNJZSQVHLCKE"[b%23],b==a.substr(8,1)},c=function(a){var b=["XYZ".indexOf(a.charAt(0)),a.substr(1)].join("");return b=parseInt(b,10),b="TRWAGMYFPDXBNJZSQVHLCKE"[b%23],b==a.substr(8,1)},d=function(a){var b,c=a.charAt(0);if(-1!="KLM".indexOf(c))return b=parseInt(a.substr(1,8),10),b="TRWAGMYFPDXBNJZSQVHLCKE"[b%23],b==a.substr(8,1);if(-1!="ABCDEFGHJNPQRSUVW".indexOf(c)){for(var d=0,e=[2,1,2,1,2,1,2],f=0,g=0;7>g;g++)f=parseInt(a.charAt(g+1))*e[g],f>9&&(f=Math.floor(f/10)+f%10),d+=f;return d=10-d%10,d==a.substr(8,1)||"JABCDEFGHI"[d]==a.substr(8,1)}return!1},e=a.charAt(0);return/^[0-9]$/.test(e)?b(a):/^[XYZ]$/.test(e)?c(a):d(a)},_fi:function(a){if(!/^FI[0-9]{8}$/.test(a))return!1;a=a.substr(2);for(var b=0,c=[7,9,10,5,8,4,2,1],d=0;8>d;d++)b+=parseInt(a.charAt(d))*c[d];return b%11==0},_fr:function(b){if(!/^FR[0-9A-Z]{2}[0-9]{9}$/.test(b))return!1;if(b=b.substr(2),!a.fn.bootstrapValidator.helpers.luhn(b.substr(2)))return!1;if(/^[0-9]{2}$/.test(b.substr(0,2)))return b.substr(0,2)==parseInt(b.substr(2)+"12",10)%97;var c,d="0123456789ABCDEFGHJKLMNPQRSTUVWXYZ";return c=/^[0-9]{1}$/.test(b.charAt(0))?24*d.indexOf(b.charAt(0))+d.indexOf(b.charAt(1))-10:34*d.indexOf(b.charAt(0))+d.indexOf(b.charAt(1))-100,(parseInt(b.substr(2),10)+1+Math.floor(c/11))%11==c%11},_gb:function(a){if(!(/^GB[0-9]{9}$/.test(a)||/^GB[0-9]{12}$/.test(a)||/^GBGD[0-9]{3}$/.test(a)||/^GBHA[0-9]{3}$/.test(a)||/^GB(GD|HA)8888[0-9]{5}$/.test(a)))return!1;a=a.substr(2);var b=a.length;if(5==b){var c=a.substr(0,2),d=parseInt(a.substr(2));return"GD"==c&&500>d||"HA"==c&&d>=500}if(11==b&&("GD8888"==a.substr(0,6)||"HA8888"==a.substr(0,6)))return"GD"==a.substr(0,2)&&parseInt(a.substr(6,3))>=500||"HA"==a.substr(0,2)&&parseInt(a.substr(6,3))<500?!1:parseInt(a.substr(6,3))%97==parseInt(a.substr(9,2));if(9==b||12==b){for(var e=0,f=[8,7,6,5,4,3,2,10,1],g=0;9>g;g++)e+=parseInt(a.charAt(g))*f[g];return e%=97,parseInt(a.substr(0,3))>=100?0==e||42==e||55==e:0==e}return!0},_gr:function(a){if(!/^GR[0-9]{9}$/.test(a))return!1;a=a.substr(2),8==a.length&&(a="0"+a);for(var b=0,c=[256,128,64,32,16,8,4,2],d=0;8>d;d++)b+=parseInt(a.charAt(d))*c[d];return b=b%11%10,b==a.substr(8,1)},_el:function(a){return/^EL[0-9]{9}$/.test(a)?(a="GR"+a.substr(2),this._gr(a)):!1},_hu:function(a){if(!/^HU[0-9]{8}$/.test(a))return!1;a=a.substr(2);for(var b=0,c=[9,7,3,1,9,7,3,1],d=0;8>d;d++)b+=parseInt(a.charAt(d))*c[d];return b%10==0},_hr:function(b){return/^HR[0-9]{11}$/.test(b)?(b=b.substr(2),a.fn.bootstrapValidator.helpers.mod_11_10(b)):!1},_ie:function(a){if(!/^IE[0-9]{1}[0-9A-Z\*\+]{1}[0-9]{5}[A-Z]{1,2}$/.test(a))return!1;a=a.substr(2);var b=function(a){for(;a.length<7;)a="0"+a;for(var b="WABCDEFGHIJKLMNOPQRSTUV",c=0,d=0;7>d;d++)c+=parseInt(a.charAt(d))*(8-d);return c+=9*b.indexOf(a.substr(7)),b[c%23]};return/^[0-9]+$/.test(a.substr(0,7))?a.charAt(7)==b(a.substr(0,7)+a.substr(8)+""):-1!="ABCDEFGHIJKLMNOPQRSTUVWXYZ+*".indexOf(a.charAt(1))?a.charAt(7)==b(a.substr(2,5)+a.substr(0,1)+""):!0},_it:function(b){if(!/^IT[0-9]{11}$/.test(b))return!1;if(b=b.substr(2),0==parseInt(b.substr(0,7)))return!1;var c=parseInt(b.substr(7,3));return 1>c||c>201&&999!=c&&888!=c?!1:a.fn.bootstrapValidator.helpers.luhn(b)},_lt:function(a){if(!/^LT([0-9]{7}1[0-9]{1}|[0-9]{10}1[0-9]{1})$/.test(a))return!1;a=a.substr(2);for(var b=a.length,c=0,d=0;b-1>d;d++)c+=parseInt(a.charAt(d))*(1+d%9);var e=c%11;if(10==e){c=0;for(var d=0;b-1>d;d++)c+=parseInt(a.charAt(d))*(1+(d+2)%9)}return e=e%11%10,e==a.charAt(b-1)},_lu:function(a){return/^LU[0-9]{8}$/.test(a)?(a=a.substr(2),a.substr(0,6)%89==a.substr(6,2)):!1},_lv:function(b){if(!/^LV[0-9]{11}$/.test(b))return!1;b=b.substr(2);var c=parseInt(b.charAt(0)),d=0,e=[],f=0,g=b.length;if(c>3){for(d=0,e=[9,1,4,8,3,10,2,5,7,6,1],f=0;g>f;f++)d+=parseInt(b.charAt(f))*e[f];return d%=11,3==d}var h=parseInt(b.substr(0,2)),i=parseInt(b.substr(2,2)),j=parseInt(b.substr(4,2));if(j=j+1800+100*parseInt(b.charAt(6)),!a.fn.bootstrapValidator.helpers.date(j,i,h))return!1;for(d=0,e=[10,5,8,4,2,1,6,3,7,9],f=0;g-1>f;f++)d+=parseInt(b.charAt(f))*e[f];return d=(d+1)%11%10,d==b.charAt(g-1)},_mt:function(a){if(!/^MT[0-9]{8}$/.test(a))return!1;a=a.substr(2);for(var b=0,c=[3,4,6,7,8,9,10,1],d=0;8>d;d++)b+=parseInt(a.charAt(d))*c[d];return b%37==0},_nl:function(a){if(!/^NL[0-9]{9}B[0-9]{2}$/.test(a))return!1;a=a.substr(2);for(var b=0,c=[9,8,7,6,5,4,3,2],d=0;8>d;d++)b+=parseInt(a.charAt(d))*c[d];return b%=11,b>9&&(b=0),b==a.substr(8,1)},_no:function(a){if(!/^NO[0-9]{9}$/.test(a))return!1;a=a.substr(2);for(var b=0,c=[3,2,7,6,5,4,3,2],d=0;8>d;d++)b+=parseInt(a.charAt(d))*c[d];return b=11-b%11,11==b&&(b=0),b==a.substr(8,1)},_pl:function(a){if(!/^PL[0-9]{10}$/.test(a))return!1;a=a.substr(2);for(var b=0,c=[6,5,7,2,3,4,5,6,7,-1],d=0;10>d;d++)b+=parseInt(a.charAt(d))*c[d];return b%11==0},_pt:function(a){if(!/^PT[0-9]{9}$/.test(a))return!1;a=a.substr(2);for(var b=0,c=[9,8,7,6,5,4,3,2],d=0;8>d;d++)b+=parseInt(a.charAt(d))*c[d];return b=11-b%11,b>9&&(b=0),b==a.substr(8,1)},_ro:function(a){if(!/^RO[1-9][0-9]{1,9}$/.test(a))return!1;a=a.substr(2);for(var b=a.length,c=[7,5,3,2,1,7,5,3,2].slice(10-b),d=0,e=0;b-1>e;e++)d+=parseInt(a.charAt(e))*c[e];return d=10*d%11%10,d==a.substr(b-1,1)},_ru:function(a){if(!/^RU([0-9]{9}|[0-9]{12})$/.test(a))return!1;if(a=a.substr(2),10==a.length){for(var b=0,c=[2,4,10,3,5,9,4,6,8,0],d=0;10>d;d++)b+=parseInt(a.charAt(d))*c[d];return b%=11,b>9&&(b%=10),b==a.substr(9,1)}if(12==a.length){for(var e=0,f=[7,2,4,10,3,5,9,4,6,8,0],g=0,h=[3,7,2,4,10,3,5,9,4,6,8,0],d=0;11>d;d++)e+=parseInt(a.charAt(d))*f[d],g+=parseInt(a.charAt(d))*h[d];return e%=11,e>9&&(e%=10),g%=11,g>9&&(g%=10),e==a.substr(10,1)&&g==a.substr(11,1)}return!1},_rs:function(a){if(!/^RS[0-9]{9}$/.test(a))return!1;a=a.substr(2);for(var b=10,c=0,d=0;8>d;d++)c=(parseInt(a.charAt(d))+b)%10,0==c&&(c=10),b=2*c%11;return(b+parseInt(a.substr(8,1)))%10==1},_se:function(b){return/^SE[0-9]{10}01$/.test(b)?(b=b.substr(2,10),a.fn.bootstrapValidator.helpers.luhn(b)):!1},_si:function(a){if(!/^SI[0-9]{8}$/.test(a))return!1;a=a.substr(2);for(var b=0,c=[8,7,6,5,4,3,2],d=0;7>d;d++)b+=parseInt(a.charAt(d))*c[d];return b=11-b%11,10==b&&(b=0),b==a.substr(7,1)},_sk:function(a){return/^SK[1-9][0-9][(2-4)|(6-9)][0-9]{7}$/.test(a)?(a=a.substr(2),a%11==0):!1}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.vin={validate:function(a,b){var c=b.val();if(""==c)return!0;if(!/^[a-hj-npr-z0-9]{8}[0-9xX][a-hj-npr-z0-9]{8}$/i.test(c))return!1;c=c.toUpperCase();for(var d={A:1,B:2,C:3,D:4,E:5,F:6,G:7,H:8,J:1,K:2,L:3,M:4,N:5,P:7,R:9,S:2,T:3,U:4,V:5,W:6,X:7,Y:8,Z:9,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,0:0},e=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2],f=0,g=c.length,h=0;g>h;h++)f+=d[c.charAt(h)+""]*e[h];var i=f%11;return 10==i&&(i="X"),i==c.charAt(8)}}}(window.jQuery),function(a){a.fn.bootstrapValidator.validators.zipCode={html5Attributes:{message:"message",country:"country"},validate:function(a,b,c){var d=b.val();if(""==d||!c.country)return!0;var e=(c.country||"US").toUpperCase();switch(e){case"CA":return/(?:A|B|C|E|G|J|K|L|M|N|P|R|S|T|V|X|Y){1}[0-9]{1}(?:A|B|C|E|G|J|K|L|M|N|P|R|S|T|V|X|Y){1}\s?[0-9]{1}(?:A|B|C|E|G|J|K|L|M|N|P|R|S|T|V|X|Y){1}[0-9]{1}/i.test(d);case"DK":return/^(DK(-|\s)?)?\d{4}$/i.test(d);case"GB":return this._gb(d);case"IT":return/^(I-|IT-)?\d{5}$/i.test(d);case"NL":return/^[1-9][0-9]{3} ?(?!sa|sd|ss)[a-z]{2}$/i.test(d);case"SE":return/^(S-)?\d{3}\s?\d{2}$/i.test(d);case"US":default:return/^\d{4,5}([\-]\d{4})?$/.test(d)}},_gb:function(a){for(var b="[ABCDEFGHIJKLMNOPRSTUWYZ]",c="[ABCDEFGHKLMNOPQRSTUVWXY]",d="[ABCDEFGHJKPMNRSTUVWXY]",e="[ABEHMNPRVWXY]",f="[ABDEFGHJLNPQRSTUWXYZ]",g=[new RegExp("^("+b+"{1}"+c+"?[0-9]{1,2})(\\s*)([0-9]{1}"+f+"{2})$","i"),new RegExp("^("+b+"{1}[0-9]{1}"+d+"{1})(\\s*)([0-9]{1}"+f+"{2})$","i"),new RegExp("^("+b+"{1}"+c+"{1}?[0-9]{1}"+e+"{1})(\\s*)([0-9]{1}"+f+"{2})$","i"),new RegExp("^(BF1)(\\s*)([0-6]{1}[ABDEFGHJLNPQRST]{1}[ABDEFGHJLNPQRSTUWZYZ]{1})$","i"),/^(GIR)(\s*)(0AA)$/i,/^(BFPO)(\s*)([0-9]{1,4})$/i,/^(BFPO)(\s*)(c\/o\s*[0-9]{1,3})$/i,/^([A-Z]{4})(\s*)(1ZZ)$/i,/^(AI-2640)$/i],h=0;h").text(c[f]).html();b=c.join("
            ")}d.addClass(a.fn.editableform.errorGroupClass),e.addClass(a.fn.editableform.errorBlockClass).html(b).show()}},submit:function(b){b.stopPropagation(),b.preventDefault();var c=this.input.input2value(),d=this.validate(c);if("object"===a.type(d)&&void 0!==d.newValue){if(c=d.newValue,this.input.value2input(c),"string"==typeof d.msg)return this.error(d.msg),this.showForm(),void 0}else if(d)return this.error(d),this.showForm(),void 0;if(!this.options.savenochange&&this.input.value2str(c)==this.input.value2str(this.value))return this.$div.triggerHandler("nochange"),void 0;var e=this.input.value2submit(c);this.isSaving=!0,a.when(this.save(e)).done(a.proxy(function(a){this.isSaving=!1;var b="function"==typeof this.options.success?this.options.success.call(this.options.scope,a,c):null;return b===!1?(this.error(!1),this.showForm(!1),void 0):"string"==typeof b?(this.error(b),this.showForm(),void 0):(b&&"object"==typeof b&&b.hasOwnProperty("newValue")&&(c=b.newValue),this.error(!1),this.value=c,this.$div.triggerHandler("save",{newValue:c,submitValue:e,response:a}),void 0)},this)).fail(a.proxy(function(a){this.isSaving=!1;var b;b="function"==typeof this.options.error?this.options.error.call(this.options.scope,a,c):"string"==typeof a?a:a.responseText||a.statusText||"Unknown error!",this.error(b),this.showForm()},this))},save:function(b){this.options.pk=a.fn.editableutils.tryParseJson(this.options.pk,!0);var c,d="function"==typeof this.options.pk?this.options.pk.call(this.options.scope):this.options.pk,e=!!("function"==typeof this.options.url||this.options.url&&("always"===this.options.send||"auto"===this.options.send&&null!==d&&void 0!==d));return e?(this.showLoading(),c={name:this.options.name||"",value:b,pk:d},"function"==typeof this.options.params?c=this.options.params.call(this.options.scope,c):(this.options.params=a.fn.editableutils.tryParseJson(this.options.params,!0),a.extend(c,this.options.params)),"function"==typeof this.options.url?this.options.url.call(this.options.scope,c):a.ajax(a.extend({url:this.options.url,data:c,type:"POST"},this.options.ajaxOptions))):void 0},validate:function(a){return void 0===a&&(a=this.value),"function"==typeof this.options.validate?this.options.validate.call(this.options.scope,a):void 0},option:function(a,b){a in this.options&&(this.options[a]=b),"value"===a&&this.setValue(b)},setValue:function(a,b){this.value=b?this.input.str2value(a):a,this.$form&&this.$form.is(":visible")&&this.input.value2input(this.value)}},a.fn.editableform=function(c){var d=arguments;return this.each(function(){var e=a(this),f=e.data("editableform"),g="object"==typeof c&&c;f||e.data("editableform",f=new b(this,g)),"string"==typeof c&&f[c].apply(f,Array.prototype.slice.call(d,1))})},a.fn.editableform.Constructor=b,a.fn.editableform.defaults={type:"text",url:null,params:null,name:null,pk:null,value:null,defaultValue:null,send:"auto",validate:null,success:null,error:null,ajaxOptions:null,showbuttons:!0,scope:null,savenochange:!1},a.fn.editableform.template='
            ',a.fn.editableform.loading='
            ',a.fn.editableform.buttons='',a.fn.editableform.errorGroupClass=null,a.fn.editableform.errorBlockClass="editable-error",a.fn.editableform.engine="jquery"}(window.jQuery),function(a){"use strict";a.fn.editableutils={inherit:function(a,b){var c=function(){};c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a,a.superclass=b.prototype},setCursorPosition:function(a,b){if(a.setSelectionRange)a.setSelectionRange(b,b);else if(a.createTextRange){var c=a.createTextRange();c.collapse(!0),c.moveEnd("character",b),c.moveStart("character",b),c.select()}},tryParseJson:function(a,b){if("string"==typeof a&&a.length&&a.match(/^[\{\[].*[\}\]]$/))if(b)try{a=new Function("return "+a)()}catch(c){}finally{return a}else a=new Function("return "+a)();return a},sliceObj:function(b,c,d){var e,f,g={};if(!a.isArray(c)||!c.length)return g;for(var h=0;h").text(b).html()},itemsByValue:function(b,c,d){if(!c||null===b)return[];if("function"!=typeof d){var e=d||"value";d=function(a){return a[e]}}var f=a.isArray(b),g=[],h=this;return a.each(c,function(c,e){if(e.children)g=g.concat(h.itemsByValue(b,e.children,d));else if(f)a.grep(b,function(a){return a==(e&&"object"==typeof e?d(e):e)}).length&&g.push(e);else{var i=e&&"object"==typeof e?d(e):e;b==i&&g.push(e)}}),g},createInput:function(b){var c,d,e,f=b.type;return"date"===f&&("inline"===b.mode?a.fn.editabletypes.datefield?f="datefield":a.fn.editabletypes.dateuifield&&(f="dateuifield"):a.fn.editabletypes.date?f="date":a.fn.editabletypes.dateui&&(f="dateui"),"date"!==f||a.fn.editabletypes.date||(f="combodate")),"datetime"===f&&"inline"===b.mode&&(f="datetimefield"),"wysihtml5"!==f||a.fn.editabletypes[f]||(f="textarea"),"function"==typeof a.fn.editabletypes[f]?(c=a.fn.editabletypes[f],d=this.sliceObj(b,this.objectKeys(c.defaults)),e=new c(d)):(a.error("Unknown type: "+f),!1)},supportsTransitions:function(){var a=document.body||document.documentElement,b=a.style,c="transition",d=["Moz","Webkit","Khtml","O","ms"];if("string"==typeof b[c])return!0;c=c.charAt(0).toUpperCase()+c.substr(1);for(var e=0;e"),this.tip().is(this.innerCss)?this.tip().append(this.$form):this.tip().find(this.innerCss).append(this.$form),this.renderForm()},hide:function(a){if(this.tip()&&this.tip().is(":visible")&&this.$element.hasClass("editable-open")){if(this.$form.data("editableform").isSaving)return this.delayedHide={reason:a},void 0;this.delayedHide=!1,this.$element.removeClass("editable-open"),this.innerHide(),this.$element.triggerHandler("hidden",a||"manual")}},innerShow:function(){},innerHide:function(){},toggle:function(a){this.container()&&this.tip()&&this.tip().is(":visible")?this.hide():this.show(a)},setPosition:function(){},save:function(a,b){this.$element.triggerHandler("save",b),this.hide("save")},option:function(a,b){this.options[a]=b,a in this.containerOptions?(this.containerOptions[a]=b,this.setContainerOption(a,b)):(this.formOptions[a]=b,this.$form&&this.$form.editableform("option",a,b))},setContainerOption:function(a,b){this.call("option",a,b)},destroy:function(){this.hide(),this.innerDestroy(),this.$element.off("destroyed"),this.$element.removeData("editableContainer")},innerDestroy:function(){},closeOthers:function(b){a(".editable-open").each(function(c,d){if(d!==b&&!a(d).find(b).length){var e=a(d),f=e.data("editableContainer");f&&("cancel"===f.options.onblur?e.data("editableContainer").hide("onblur"):"submit"===f.options.onblur&&e.data("editableContainer").tip().find("form").submit())}})},activate:function(){this.tip&&this.tip().is(":visible")&&this.$form&&this.$form.data("editableform").input.activate()}},a.fn.editableContainer=function(d){var e=arguments;return this.each(function(){var f=a(this),g="editableContainer",h=f.data(g),i="object"==typeof d&&d,j="inline"===i.mode?c:b;h||f.data(g,h=new j(this,i)),"string"==typeof d&&h[d].apply(h,Array.prototype.slice.call(e,1))})},a.fn.editableContainer.Popup=b,a.fn.editableContainer.Inline=c,a.fn.editableContainer.defaults={value:null,placement:"top",autohide:!0,onblur:"cancel",anim:!1,mode:"popup"},jQuery.event.special.destroyed={remove:function(a){a.handler&&a.handler()}}}(window.jQuery),function(a){"use strict";a.extend(a.fn.editableContainer.Inline.prototype,a.fn.editableContainer.Popup.prototype,{containerName:"editableform",innerCss:".editable-inline",containerClass:"editable-container editable-inline",initContainer:function(){this.$tip=a(""),this.options.anim||(this.options.anim=0)},splitOptions:function(){this.containerOptions={},this.formOptions=this.options},tip:function(){return this.$tip},innerShow:function(){this.$element.hide(),this.tip().insertAfter(this.$element).show()},innerHide:function(){this.$tip.hide(this.options.anim,a.proxy(function(){this.$element.show(),this.innerDestroy()},this))},innerDestroy:function(){this.tip()&&this.tip().empty().remove()}})}(window.jQuery),function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.editable.defaults,c,a.fn.editableutils.getConfigData(this.$element)),this.options.selector?this.initLive():this.init(),this.options.highlight&&!a.fn.editableutils.supportsTransitions()&&(this.options.highlight=!1)};b.prototype={constructor:b,init:function(){var b,c=!1;if(this.options.name=this.options.name||this.$element.attr("id"),this.options.scope=this.$element[0],this.input=a.fn.editableutils.createInput(this.options),this.input){switch(void 0===this.options.value||null===this.options.value?(this.value=this.input.html2value(a.trim(this.$element.html())),c=!0):(this.options.value=a.fn.editableutils.tryParseJson(this.options.value,!0),this.value="string"==typeof this.options.value?this.input.str2value(this.options.value):this.options.value),this.$element.addClass("editable"),"textarea"===this.input.type&&this.$element.addClass("editable-pre-wrapped"),"manual"!==this.options.toggle?(this.$element.addClass("editable-click"),this.$element.on(this.options.toggle+".editable",a.proxy(function(a){if(this.options.disabled||a.preventDefault(),"mouseenter"===this.options.toggle)this.show();else{var b="click"!==this.options.toggle;this.toggle(b)}},this))):this.$element.attr("tabindex",-1),"function"==typeof this.options.display&&(this.options.autotext="always"),this.options.autotext){case"always":b=!0;break;case"auto":b=!a.trim(this.$element.text()).length&&null!==this.value&&void 0!==this.value&&!c;break;default:b=!1}a.when(b?this.render():!0).then(a.proxy(function(){this.options.disabled?this.disable():this.enable(),this.$element.triggerHandler("init",this)},this))}},initLive:function(){var b=this.options.selector;this.options.selector=!1,this.options.autotext="never",this.$element.on(this.options.toggle+".editable",b,a.proxy(function(b){var c=a(b.target);c.data("editable")||(c.hasClass(this.options.emptyclass)&&c.empty(),c.editable(this.options).trigger(b))},this))},render:function(a){return this.options.display!==!1?this.input.value2htmlFinal?this.input.value2html(this.value,this.$element[0],this.options.display,a):"function"==typeof this.options.display?this.options.display.call(this.$element[0],this.value,a):this.input.value2html(this.value,this.$element[0]):void 0},enable:function(){this.options.disabled=!1,this.$element.removeClass("editable-disabled"),this.handleEmpty(this.isEmpty),"manual"!==this.options.toggle&&"-1"===this.$element.attr("tabindex")&&this.$element.removeAttr("tabindex")},disable:function(){this.options.disabled=!0,this.hide(),this.$element.addClass("editable-disabled"),this.handleEmpty(this.isEmpty),this.$element.attr("tabindex",-1)},toggleDisabled:function(){this.options.disabled?this.enable():this.disable()},option:function(b,c){return b&&"object"==typeof b?(a.each(b,a.proxy(function(b,c){this.option(a.trim(b),c)},this)),void 0):(this.options[b]=c,"disabled"===b?c?this.disable():this.enable():("value"===b&&this.setValue(c),this.container&&this.container.option(b,c),this.input.option&&this.input.option(b,c),void 0))},handleEmpty:function(b){this.options.display!==!1&&(this.isEmpty=void 0!==b?b:"function"==typeof this.input.isEmpty?this.input.isEmpty(this.$element):""===a.trim(this.$element.html()),this.options.disabled?this.isEmpty&&(this.$element.empty(),this.options.emptyclass&&this.$element.removeClass(this.options.emptyclass)):this.isEmpty?(this.$element.html(this.options.emptytext),this.options.emptyclass&&this.$element.addClass(this.options.emptyclass)):this.options.emptyclass&&this.$element.removeClass(this.options.emptyclass))},show:function(b){if(!this.options.disabled){if(this.container){if(this.container.tip().is(":visible"))return}else{var c=a.extend({},this.options,{value:this.value,input:this.input});this.$element.editableContainer(c),this.$element.on("save.internal",a.proxy(this.save,this)),this.container=this.$element.data("editableContainer")}this.container.show(b)}},hide:function(){this.container&&this.container.hide()},toggle:function(a){this.container&&this.container.tip().is(":visible")?this.hide():this.show(a)},save:function(a,b){if(this.options.unsavedclass){var c=!1;c=c||"function"==typeof this.options.url,c=c||this.options.display===!1,c=c||void 0!==b.response,c=c||this.options.savenochange&&this.input.value2str(this.value)!==this.input.value2str(b.newValue),c?this.$element.removeClass(this.options.unsavedclass):this.$element.addClass(this.options.unsavedclass)}if(this.options.highlight){var d=this.$element,e=d.css("background-color");d.css("background-color",this.options.highlight),setTimeout(function(){"transparent"===e&&(e=""),d.css("background-color",e),d.addClass("editable-bg-transition"),setTimeout(function(){d.removeClass("editable-bg-transition")},1700)},10)}this.setValue(b.newValue,!1,b.response)},validate:function(){return"function"==typeof this.options.validate?this.options.validate.call(this,this.value):void 0},setValue:function(b,c,d){this.value=c?this.input.str2value(b):b,this.container&&this.container.option("value",this.value),a.when(this.render(d)).then(a.proxy(function(){this.handleEmpty()},this))},activate:function(){this.container&&this.container.activate()},destroy:function(){this.disable(),this.container&&this.container.destroy(),this.input.destroy(),"manual"!==this.options.toggle&&(this.$element.removeClass("editable-click"),this.$element.off(this.options.toggle+".editable")),this.$element.off("save.internal"),this.$element.removeClass("editable editable-open editable-disabled"),this.$element.removeData("editable")}},a.fn.editable=function(c){var d={},e=arguments,f="editable";switch(c){case"validate":return this.each(function(){var b,c=a(this),e=c.data(f);e&&(b=e.validate())&&(d[e.options.name]=b)}),d;case"getValue":return 2===arguments.length&&arguments[1]===!0?d=this.eq(0).data(f).value:this.each(function(){var b=a(this),c=b.data(f);c&&void 0!==c.value&&null!==c.value&&(d[c.options.name]=c.input.value2submit(c.value))}),d;case"submit":var g=arguments[1]||{},h=this,i=this.editable("validate");if(a.isEmptyObject(i)){var j={};if(1===h.length){var k=h.data("editable"),l={name:k.options.name||"",value:k.input.value2submit(k.value),pk:"function"==typeof k.options.pk?k.options.pk.call(k.options.scope):k.options.pk};"function"==typeof k.options.params?l=k.options.params.call(k.options.scope,l):(k.options.params=a.fn.editableutils.tryParseJson(k.options.params,!0),a.extend(l,k.options.params)),j={url:k.options.url,data:l,type:"POST"},g.success=g.success||k.options.success,g.error=g.error||k.options.error}else{var m=this.editable("getValue");j={url:g.url,data:m,type:"POST"}}j.success="function"==typeof g.success?function(a){g.success.call(h,a,g)}:a.noop,j.error="function"==typeof g.error?function(){g.error.apply(h,arguments)}:a.noop,g.ajaxOptions&&a.extend(j,g.ajaxOptions),g.data&&a.extend(j.data,g.data),a.ajax(j)}else"function"==typeof g.error&&g.error.call(h,i);return this}return this.each(function(){var d=a(this),g=d.data(f),h="object"==typeof c&&c;return h&&h.selector?(g=new b(this,h),void 0):(g||d.data(f,g=new b(this,h)),"string"==typeof c&&g[c].apply(g,Array.prototype.slice.call(e,1)),void 0)})},a.fn.editable.defaults={type:"text",disabled:!1,toggle:"click",emptytext:"Empty",autotext:"auto",value:null,display:null,emptyclass:"editable-empty",unsavedclass:"editable-unsaved",selector:null,highlight:"#FFFF80"}}(window.jQuery),function(a){"use strict";a.fn.editabletypes={};var b=function(){};b.prototype={init:function(b,c,d){this.type=b,this.options=a.extend({},d,c)},prerender:function(){this.$tpl=a(this.options.tpl),this.$input=this.$tpl,this.$clear=null,this.error=null},render:function(){},value2html:function(b,c){a(c)[this.options.escape?"text":"html"](a.trim(b))},html2value:function(b){return a("
            ").html(b).text()},value2str:function(a){return a},str2value:function(a){return a},value2submit:function(a){return a},value2input:function(a){this.$input.val(a)},input2value:function(){return this.$input.val()},activate:function(){this.$input.is(":visible")&&this.$input.focus()},clear:function(){this.$input.val(null)},escape:function(b){return a("
            ").text(b).html()},autosubmit:function(){},destroy:function(){},setClass:function(){this.options.inputclass&&this.$input.addClass(this.options.inputclass)},setAttr:function(a){void 0!==this.options[a]&&null!==this.options[a]&&this.$input.attr(a,this.options[a])},option:function(a,b){this.options[a]=b}},b.defaults={tpl:"",inputclass:null,escape:!0,scope:null,showbuttons:!0},a.extend(a.fn.editabletypes,{abstractinput:b})}(window.jQuery),function(a){"use strict";var b=function(){};a.fn.editableutils.inherit(b,a.fn.editabletypes.abstractinput),a.extend(b.prototype,{render:function(){var b=a.Deferred();return this.error=null,this.onSourceReady(function(){this.renderList(),b.resolve()},function(){this.error=this.options.sourceError,b.resolve()}),b.promise()},html2value:function(){return null},value2html:function(b,c,d,e){var f=a.Deferred(),g=function(){"function"==typeof d?d.call(c,b,this.sourceData,e):this.value2htmlFinal(b,c),f.resolve()};return null===b?g.call(this):this.onSourceReady(g,function(){f.resolve()}),f.promise()},onSourceReady:function(b,c){var d;if(a.isFunction(this.options.source)?(d=this.options.source.call(this.options.scope),this.sourceData=null):d=this.options.source,this.options.sourceCache&&a.isArray(this.sourceData))return b.call(this),void 0;try{d=a.fn.editableutils.tryParseJson(d,!1)}catch(e){return c.call(this),void 0}if("string"==typeof d){if(this.options.sourceCache){var f,g=d;if(a(document).data(g)||a(document).data(g,{}),f=a(document).data(g),f.loading===!1&&f.sourceData)return this.sourceData=f.sourceData,this.doPrepend(),b.call(this),void 0;if(f.loading===!0)return f.callbacks.push(a.proxy(function(){this.sourceData=f.sourceData,this.doPrepend(),b.call(this)},this)),f.err_callbacks.push(a.proxy(c,this)),void 0;f.loading=!0,f.callbacks=[],f.err_callbacks=[]}var h=a.extend({url:d,type:"get",cache:!1,dataType:"json",success:a.proxy(function(d){f&&(f.loading=!1),this.sourceData=this.makeArray(d),a.isArray(this.sourceData)?(f&&(f.sourceData=this.sourceData,a.each(f.callbacks,function(){this.call()})),this.doPrepend(),b.call(this)):(c.call(this),f&&a.each(f.err_callbacks,function(){this.call()}))},this),error:a.proxy(function(){c.call(this),f&&(f.loading=!1,a.each(f.err_callbacks,function(){this.call()}))},this)},this.options.sourceOptions);a.ajax(h)}else this.sourceData=this.makeArray(d),a.isArray(this.sourceData)?(this.doPrepend(),b.call(this)):c.call(this)},doPrepend:function(){null!==this.options.prepend&&void 0!==this.options.prepend&&(a.isArray(this.prependData)||(a.isFunction(this.options.prepend)&&(this.options.prepend=this.options.prepend.call(this.options.scope)),this.options.prepend=a.fn.editableutils.tryParseJson(this.options.prepend,!0),"string"==typeof this.options.prepend&&(this.options.prepend={"":this.options.prepend}),this.prependData=this.makeArray(this.options.prepend)),a.isArray(this.prependData)&&a.isArray(this.sourceData)&&(this.sourceData=this.prependData.concat(this.sourceData)))},renderList:function(){},value2htmlFinal:function(){},makeArray:function(b){var c,d,e,f,g=[];if(!b||"string"==typeof b)return null;if(a.isArray(b)){f=function(a,b){return d={value:a,text:b},c++>=2?!1:void 0};for(var h=0;h1&&(e.children&&(e.children=this.makeArray(e.children)),g.push(e))):g.push({value:e,text:e})}else a.each(b,function(a,b){g.push({value:a,text:b})});return g},option:function(a,b){this.options[a]=b,"source"===a&&(this.sourceData=null),"prepend"===a&&(this.prependData=null)}}),b.defaults=a.extend({},a.fn.editabletypes.abstractinput.defaults,{source:null,prepend:!1,sourceError:"Error when loading list",sourceCache:!0,sourceOptions:null}),a.fn.editabletypes.list=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("text",a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.abstractinput),a.extend(b.prototype,{render:function(){this.renderClear(),this.setClass(),this.setAttr("placeholder")},activate:function(){this.$input.is(":visible")&&(this.$input.focus(),a.fn.editableutils.setCursorPosition(this.$input.get(0),this.$input.val().length),this.toggleClear&&this.toggleClear())},renderClear:function(){this.options.clear&&(this.$clear=a(''),this.$input.after(this.$clear).css("padding-right",24).keyup(a.proxy(function(b){if(!~a.inArray(b.keyCode,[40,38,9,13,27])){clearTimeout(this.t);var c=this;this.t=setTimeout(function(){c.toggleClear(b)},100)}},this)).parent().css("position","relative"),this.$clear.click(a.proxy(this.clear,this)))},postrender:function(){},toggleClear:function(){if(this.$clear){var a=this.$input.val().length,b=this.$clear.is(":visible");a&&!b&&this.$clear.show(),!a&&b&&this.$clear.hide()}},clear:function(){this.$clear.hide(),this.$input.val("").focus()}}),b.defaults=a.extend({},a.fn.editabletypes.abstractinput.defaults,{tpl:'',placeholder:null,clear:!0}),a.fn.editabletypes.text=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("textarea",a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.abstractinput),a.extend(b.prototype,{render:function(){this.setClass(),this.setAttr("placeholder"),this.setAttr("rows"),this.$input.keydown(function(b){b.ctrlKey&&13===b.which&&a(this).closest("form").submit()})},activate:function(){a.fn.editabletypes.text.prototype.activate.call(this)}}),b.defaults=a.extend({},a.fn.editabletypes.abstractinput.defaults,{tpl:"",inputclass:"input-large",placeholder:null,rows:7}),a.fn.editabletypes.textarea=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("select",a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.list),a.extend(b.prototype,{renderList:function(){this.$input.empty();var b=function(c,d){var e;if(a.isArray(d))for(var f=0;f",e),d[f].children))):(e.value=d[f].value,d[f].disabled&&(e.disabled=!0),c.append(a("