mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-05 17:43:37 +00:00
Merge pull request #893 from JackDandy/feature/UpdateSelectBoxes
Update jQuery SelectBoxes 2.2.4 to 2.2.6
This commit is contained in:
commit
8f53e672cd
2 changed files with 14 additions and 7 deletions
|
@ -33,6 +33,7 @@
|
|||
* Update jquery.cookiejar 1.0.1 to 1.0.2
|
||||
* Update jQuery JSON 2.2 (c908771) to 2.6 (2339804)
|
||||
* Update jquery.form plugin 3.35.0 to 3.51.0 (6bf24a5)
|
||||
* Update jQuery SelectBoxes 2.2.4 to 2.2.6
|
||||
* Update jquery-tokeninput 1.60 to 1.62 (9c36e19)
|
||||
* Update jQuery UI Touch Punch 0.2.2 to 0.2.3
|
||||
* Update qTip 2.2.1 to 2.2.2
|
||||
|
|
20
gui/slick/js/lib/jquery.selectboxes.min.js
vendored
20
gui/slick/js/lib/jquery.selectboxes.min.js
vendored
|
@ -1,14 +1,20 @@
|
|||
/*
|
||||
*
|
||||
* Copyright (c) 2006-2008 Sam Collett (http://www.texotela.co.uk)
|
||||
* Copyright (c) 2006-2010 Sam Collett (http://www.texotela.co.uk)
|
||||
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
|
||||
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
|
||||
*
|
||||
* Version 2.2.4
|
||||
* Demo: http://www.texotela.co.uk/code/jquery/select/
|
||||
*
|
||||
* $LastChangedDate: 2008-06-17 17:27:25 +0100 (Tue, 17 Jun 2008) $
|
||||
* $Rev: 5727 $
|
||||
* Version 2.2.6
|
||||
*
|
||||
*/
|
||||
;(function(h){h.fn.addOption=function(){var j=function(a,f,c,g){var d=document.createElement("option");d.value=f,d.text=c;var b=a.options;var e=b.length;if(!a.cache){a.cache={};for(var i=0;i<e;i++){a.cache[b[i].value]=i}}if(typeof a.cache[f]=="undefined")a.cache[f]=e;a.options[a.cache[f]]=d;if(g){d.selected=true}};var k=arguments;if(k.length==0)return this;var l=true;var m=false;var n,o,p;if(typeof(k[0])=="object"){m=true;n=k[0]}if(k.length>=2){if(typeof(k[1])=="boolean")l=k[1];else if(typeof(k[2])=="boolean")l=k[2];if(!m){o=k[0];p=k[1]}}this.each(function(){if(this.nodeName.toLowerCase()!="select")return;if(m){for(var a in n){j(this,a,n[a],l)}}else{j(this,o,p,l)}});return this};h.fn.ajaxAddOption=function(c,g,d,b,e){if(typeof(c)!="string")return this;if(typeof(g)!="object")g={};if(typeof(d)!="boolean")d=true;this.each(function(){var f=this;h.getJSON(c,g,function(a){h(f).addOption(a,d);if(typeof b=="function"){if(typeof e=="object"){b.apply(f,e)}else{b.call(f)}}})});return this};h.fn.removeOption=function(){var d=arguments;if(d.length==0)return this;var b=typeof(d[0]);var e,i;if(b=="string"||b=="object"||b=="function"){e=d[0];if(e.constructor==Array){var j=e.length;for(var k=0;k<j;k++){this.removeOption(e[k],d[1])}return this}}else if(b=="number")i=d[0];else return this;this.each(function(){if(this.nodeName.toLowerCase()!="select")return;if(this.cache)this.cache=null;var a=false;var f=this.options;if(!!e){var c=f.length;for(var g=c-1;g>=0;g--){if(e.constructor==RegExp){if(f[g].value.match(e)){a=true}}else if(f[g].value==e){a=true}if(a&&d[1]===true)a=f[g].selected;if(a){f[g]=null}a=false}}else{if(d[1]===true){a=f[i].selected}else{a=true}if(a){this.remove(i)}}});return this};h.fn.sortOptions=function(e){var i=h(this).selectedValues();var j=typeof(e)=="undefined"?true:!!e;this.each(function(){if(this.nodeName.toLowerCase()!="select")return;var c=this.options;var g=c.length;var d=[];for(var b=0;b<g;b++){d[b]={v:c[b].value,t:c[b].text}}d.sort(function(a,f){o1t=a.t.toLowerCase(),o2t=f.t.toLowerCase();if(o1t==o2t)return 0;if(j){return o1t<o2t?-1:1}else{return o1t>o2t?-1:1}});for(var b=0;b<g;b++){c[b].text=d[b].t;c[b].value=d[b].v}}).selectOptions(i,true);return this};h.fn.selectOptions=function(g,d){var b=g;var e=typeof(g);if(e=="object"&&b.constructor==Array){var i=this;h.each(b,function(){i.selectOptions(this,d)})};var j=d||false;if(e!="string"&&e!="function"&&e!="object")return this;this.each(function(){if(this.nodeName.toLowerCase()!="select")return this;var a=this.options;var f=a.length;for(var c=0;c<f;c++){if(b.constructor==RegExp){if(a[c].value.match(b)){a[c].selected=true}else if(j){a[c].selected=false}}else{if(a[c].value==b){a[c].selected=true}else if(j){a[c].selected=false}}}});return this};h.fn.copyOptions=function(g,d){var b=d||"selected";if(h(g).size()==0)return this;this.each(function(){if(this.nodeName.toLowerCase()!="select")return this;var a=this.options;var f=a.length;for(var c=0;c<f;c++){if(b=="all"||(b=="selected"&&a[c].selected)){h(g).addOption(a[c].value,a[c].text)}}});return this};h.fn.containsOption=function(g,d){var b=false;var e=g;var i=typeof(e);var j=typeof(d);if(i!="string"&&i!="function"&&i!="object")return j=="function"?this:b;this.each(function(){if(this.nodeName.toLowerCase()!="select")return this;if(b&&j!="function")return false;var a=this.options;var f=a.length;for(var c=0;c<f;c++){if(e.constructor==RegExp){if(a[c].value.match(e)){b=true;if(j=="function")d.call(a[c],c)}}else{if(a[c].value==e){b=true;if(j=="function")d.call(a[c],c)}}}});return j=="function"?this:b};h.fn.selectedValues=function(){var a=[];this.selectedOptions().each(function(){a[a.length]=this.value});return a};h.fn.selectedTexts=function(){var a=[];this.selectedOptions().each(function(){a[a.length]=this.text});return a};h.fn.selectedOptions=function(){return this.find("option:selected")}})(jQuery);
|
||||
var $jscomp={scope:{},findInternal:function(a,c,b){a instanceof String&&(a=String(a));for(var d=a.length,e=0;e<d;e++){var f=a[e];if(c.call(b,f,e,a))return{i:e,v:f}}return{i:-1,v:void 0}}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(a,c,b){if(b.get||b.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[c]=b.value)};
|
||||
$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(a,c,b,d){if(c){b=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var e=a[d];e in b||(b[e]={});b=b[e]}a=a[a.length-1];d=b[a];c=c(d);c!=d&&null!=c&&$jscomp.defineProperty(b,a,{configurable:!0,writable:!0,value:c})}};
|
||||
$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(c,b){return $jscomp.findInternal(this,c,b).v}},"es6-impl","es3");
|
||||
(function(a){a.fn.addOption=function(){var c=function(c,b,a,k,d){var e=document.createElement("option");e.value=b;e.text=a;a=c.options;var g=a.length;if(!c.cache){c.cache={};for(var h=0;h<g;h++)c.cache[a[h].value]=h}if(d||0==d)for(h=e;d<=g;d++){var f=c.options[d];c.options[d]=h;a[d]=h;c.cache[a[d].value]=d;h=f}"undefined"==typeof c.cache[b]&&(c.cache[b]=g);c.options[c.cache[b]]=e;k&&(e.selected=!0)},b=arguments;if(0==b.length)return this;var a=!0,e=!1,f,k,h,g=0;"object"==typeof b[0]&&(e=!0,f=b[0]);
|
||||
2<=b.length&&("boolean"==typeof b[1]?(a=b[1],g=b[2]):("boolean"==typeof b[2]&&(a=b[2]),g=b[1]),e||(k=b[0],h=b[1]));this.each(function(){if("select"==this.nodeName.toLowerCase())if(e){var b=this;jQuery.each(f,function(d,e){"object"==typeof e&&jQuery.each(e,function(c,b){d=c;e=b});c(b,d,e,a,g);g+=1})}else c(this,k,h,a,g)});return this};a.fn.ajaxAddOption=function(c,b,d,e,f){if("string"!=typeof c)return this;"object"!=typeof b&&(b={});"boolean"!=typeof d&&(d=!0);this.each(function(){var k=this;a.getJSON(c,
|
||||
b,function(c){a(k).addOption(c,d);"function"==typeof e&&("object"==typeof f?e.apply(k,f):e.call(k))})});return this};a.fn.removeOption=function(){var c=arguments;if(0==c.length)return this;var b=typeof c[0],a,e;if("string"==b||"object"==b||"function"==b){if(a=c[0],a.constructor==Array){for(var b=a.length,f=0;f<b;f++)this.removeOption(a[f],c[1]);return this}}else if("number"==b)e=c[0];else return this;this.each(function(){if("select"==this.nodeName.toLowerCase()){this.cache&&(this.cache=null);var b=
|
||||
!1,d=this.options;if(a)for(var g=d.length-1;0<=g;g--)a.constructor==RegExp?d[g].value.match(a)&&(b=!0):d[g].value==a&&(b=!0),b&&!0===c[1]&&(b=d[g].selected),b&&(d[g]=null),b=!1;else(b=!0===c[1]?d[e].selected:!0)&&this.remove(e)}});return this};a.fn.sortOptions=function(c){var b=a(this).selectedValues(),d="undefined"==typeof c?!0:!!c;this.each(function(){if("select"==this.nodeName.toLowerCase()){for(var c=this.options,b=c.length,a=[],h=0;h<b;h++)a[h]={v:c[h].value,t:c[h].text};a.sort(function(c,a){o1t=
|
||||
c.t.toLowerCase();o2t=a.t.toLowerCase();return o1t==o2t?0:d?o1t<o2t?-1:1:o1t>o2t?-1:1});for(h=0;h<b;h++)c[h].text=a[h].t,c[h].value=a[h].v}}).selectOptions(b,!0);return this};a.fn.selectOptions=function(c,b){var d=typeof c;if("object"==d&&c.constructor==Array){var e=this;a.each(c,function(){e.selectOptions(this,b)})}var f=b||!1;if("string"!=d&&"function"!=d&&"object"!=d)return this;this.each(function(){if("select"!=this.nodeName.toLowerCase())return this;for(var a=this.options,b=a.length,d=0;d<b;d++)c.constructor==
|
||||
RegExp?a[d].value.match(c)?a[d].selected=!0:f&&(a[d].selected=!1):a[d].value==c?a[d].selected=!0:f&&(a[d].selected=!1)});return this};a.fn.copyOptions=function(c,b){var d=b||"selected";if(0==a(c).size())return this;this.each(function(){if("select"!=this.nodeName.toLowerCase())return this;for(var b=this.options,f=b.length,k=0;k<f;k++)("all"==d||"selected"==d&&b[k].selected)&&a(c).addOption(b[k].value,b[k].text)});return this};a.fn.containsOption=function(a,b){var c=!1,e=typeof a,f=typeof b;if("string"!=
|
||||
e&&"function"!=e&&"object"!=e)return"function"==f?this:c;this.each(function(){if("select"!=this.nodeName.toLowerCase())return this;if(c&&"function"!=f)return!1;for(var d=this.options,e=d.length,g=0;g<e;g++)a.constructor==RegExp?d[g].value.match(a)&&(c=!0,"function"==f&&b.call(d[g],g)):d[g].value==a&&(c=!0,"function"==f&&b.call(d[g],g))});return"function"==f?this:c};a.fn.selectedValues=function(){var a=[];this.selectedOptions().each(function(){a[a.length]=this.value});return a};a.fn.selectedTexts=
|
||||
function(){var a=[];this.selectedOptions().each(function(){a[a.length]=this.text});return a};a.fn.selectedOptions=function(){return this.find("option:selected")}})(jQuery);
|
||||
|
|
Loading…
Reference in a new issue