gentelella/production/js/select/select2.full.js

2 lines
60 KiB
JavaScript
Raw Normal View History

2015-05-19 06:25:00 +00:00
!function(){if(window.define)var e=window.define;if(window.require)var t=window.require;if(window.jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd.define,t=jQuery.fn.select2.amd.require;var n,t,e;!function(r){function i(e,t){return _.call(e,t)}function o(e,t){var n,r,i,o,s,a,l,c,u,d,h,p=t&&t.split("/"),f=y.map,g=f&&f["*"]||{};if(e&&"."===e.charAt(0))if(t){for(p=p.slice(0,p.length-1),e=e.split("/"),s=e.length-1,y.nodeIdCompat&&b.test(e[s])&&(e[s]=e[s].replace(b,"")),e=p.concat(e),u=0;u<e.length;u+=1)if(h=e[u],"."===h)e.splice(u,1),u-=1;else if(".."===h){if(1===u&&(".."===e[2]||".."===e[0]))break;u>0&&(e.splice(u-1,2),u-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((p||g)&&f){for(n=e.split("/"),u=n.length;u>0;u-=1){if(r=n.slice(0,u).join("/"),p)for(d=p.length;d>0;d-=1)if(i=f[p.slice(0,d).join("/")],i&&(i=i[r])){o=i,a=u;break}if(o)break;!l&&g&&g[r]&&(l=g[r],c=u)}!o&&l&&(o=l,a=c),o&&(n.splice(0,a,o),e=n.join("/"))}return e}function s(e,t){return function(){return p.apply(r,$.call(arguments,0).concat([e,t]))}}function a(e){return function(t){return o(t,e)}}function l(e){return function(t){m[e]=t}}function c(e){if(i(v,e)){var t=v[e];delete v[e],w[e]=!0,h.apply(r,t)}if(!i(m,e)&&!i(w,e))throw new Error("No "+e);return m[e]}function u(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function d(e){return function(){return y&&y.config&&y.config[e]||{}}}var h,p,f,g,m={},v={},y={},w={},_=Object.prototype.hasOwnProperty,$=[].slice,b=/\.js$/;f=function(e,t){var n,r=u(e),i=r[0];return e=r[1],i&&(i=o(i,t),n=c(i)),i?e=n&&n.normalize?n.normalize(e,a(t)):o(e,t):(e=o(e,t),r=u(e),i=r[0],e=r[1],i&&(n=c(i))),{f:i?i+"!"+e:e,n:e,pr:i,p:n}},g={require:function(e){return s(e)},exports:function(e){var t=m[e];return"undefined"!=typeof t?t:m[e]={}},module:function(e){return{id:e,uri:"",exports:m[e],config:d(e)}}},h=function(e,t,n,o){var a,u,d,h,p,y,_=[],$=typeof n;if(o=o||e,"undefined"===$||"function"===$){for(t=!t.length&&n.length?["require","exports","module"]:t,p=0;p<t.length;p+=1)if(h=f(t[p],o),u=h.f,"require"===u)_[p]=g.require(e);else if("exports"===u)_[p]=g.exports(e),y=!0;else if("module"===u)a=_[p]=g.module(e);else if(i(m,u)||i(v,u)||i(w,u))_[p]=c(u);else{if(!h.p)throw new Error(e+" missing "+u);h.p.load(h.n,s(o,!0),l(u),{}),_[p]=m[u]}d=n?n.apply(m[e],_):void 0,e&&(a&&a.exports!==r&&a.exports!==m[e]?m[e]=a.exports:d===r&&y||(m[e]=d))}else e&&(m[e]=n)},n=t=p=function(e,t,n,i,o){if("string"==typeof e)return g[e]?g[e](t):c(f(e,t).f);if(!e.splice){if(y=e,y.deps&&p(y.deps,y.callback),!t)return;t.splice?(e=t,t=n,n=null):e=r}return t=t||function(){},"function"==typeof n&&(n=i,i=o),i?h(r,e,t,n):setTimeout(function(){h(r,e,t,n)},4),p},p.config=function(e){return p(e)},n._defined=m,e=function(e,t,n){t.splice||(n=t,t=[]),i(m,e)||i(v,e)||(v[e]=[e,t,n])},e.amd={jQuery:!0}}(),e("almond",function(){}),e("jquery",[],function(){var e=jQuery||$;return null==e&&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."),e}),e("select2/utils",[],function(){function e(e){var t=e.prototype,n=[];for(var r in t){var i=t[r];"function"==typeof i&&"constructor"!==r&&n.push(r)}return n}var t={};t.Extend=function(e,t){function n(){this.constructor=e}var r={}.hasOwnProperty;for(var i in t)r.call(t,i)&&(e[i]=t[i]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},t.Decorate=function(t,n){function r(){var e=Array.prototype.unshift,r=n.prototype.constructor.length,i=t.prototype.constructor;r>0&&(e.call(arguments,t.prototype.constructor),i=n.prototype.constructor),i.apply(this,arguments)}function i(){this.constructor=r}var o=e(n),s=e(t);n.displayName=t.displayName,r.prototype=new i;for(var a=0;a<s.length;a++){var l=s[a];r.prototype[l]=t.prototype[l]}for(var c=(function(e){var t=function(){};e in r.prototype&&(t=r.prototype[e]);var i=n.prototype[e];return function(){var e=Array.prototype.unshift;return e.call(argum
this._request&&(this._request.abort(),this._request=null);var o=n.extend({type:"GET"},this.ajaxOptions);"function"==typeof o.url&&(o.url=o.url(e)),"function"==typeof o.data&&(o.data=o.data(e)),this.ajaxOptions.delay&&""!==e.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(r,this.ajaxOptions.delay)):r()},r}),e("select2/data/tags",["jquery"],function(e){function t(t,n,r){var i=r.get("tags"),o=r.get("createTag");if(void 0!==o&&(this.createTag=o),t.call(this,n,r),e.isArray(i))for(var s=0;s<i.length;s++){var a=i[s],l=this._normalizeItem(a),c=this.option(l);this.$element.append(c)}}return t.prototype.query=function(e,t,n){function r(e,o){for(var s=e.results,a=0;a<s.length;a++){var l=s[a],c=null!=l.children&&!r({results:l.children},!0),u=l.text===t.term;if(u||c)return o?!1:(e.data=s,void n(e))}if(o)return!0;var d=i.createTag(t);if(null!=d){var h=i.option(d);h.attr("data-select2-tag",!0),i.$element.append(h),i.insertTag(s,d)}e.results=s,n(e)}var i=this;return this._removeOldTags(),null==t.term||""===t.term||null!=t.page?void e.call(this,t,n):void e.call(this,t,r)},t.prototype.createTag=function(e,t){return{id:t.term,text:t.term}},t.prototype.insertTag=function(e,t,n){t.unshift(n)},t.prototype._removeOldTags=function(){var t=(this._lastTag,this.$element.find("option[data-select2-tag]"));t.each(function(){this.selected||e(this).remove()})},t}),e("select2/data/tokenizer",["jquery"],function(e){function t(e,t,n){var r=n.get("tokenizer");void 0!==r&&(this.tokenizer=r),e.call(this,t,n)}return t.prototype.bind=function(e,t,n){e.call(this,t,n),this.$search=t.dropdown.$search||t.selection.$search||n.find(".select2-search__field")},t.prototype.query=function(e,t,n){function r(e){i.select(e)}var i=this;t.term=t.term||"";var o=this.tokenizer(t,this.options,r);o.term!==t.term&&(this.$search.length&&(this.$search.val(o.term),this.$search.focus()),t.term=o.term),e.call(this,t,n)},t.prototype.tokenizer=function(t,n,r,i){for(var o=r.get("tokenSeparators")||[],s=n.term,a=0,l=this.createTag||function(e){return{id:e.term,text:e.term}};a<s.length;){var c=s[a];if(-1!==o.indexOf(c)){var u=s.substr(0,a),d=e.extend({},n,{term:u}),h=l(d);i(h),s=s.substr(a+1)||"",a=0}else a++}return{term:s}},t}),e("select2/data/minimumInputLength",[],function(){function e(e,t,n){this.minimumInputLength=n.get("minimumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){return t.term=t.term||"",t.term.length<this.minimumInputLength?void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):void e.call(this,t,n)},e}),e("select2/data/maximumInputLength",[],function(){function e(e,t,n){this.maximumInputLength=n.get("maximumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){return t.term=t.term||"",this.maximumInputLength>0&&t.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{minimum:this.maximumInputLength,input:t.term,params:t}}):void e.call(this,t,n)},e}),e("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){var r=this;this.current(function(i){var o=null!=i?i.length:0;return r.maximumSelectionLength>0&&o>=r.maximumSelectionLength?void r.trigger("results:message",{message:"maximumSelected",args:{maximum:r.maximumSelectionLength}}):void e.call(r,t,n)})},e}),e("select2/dropdown",["jquery","./utils"],function(e,t){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('<span class="select2-dropdown"><span class="select2-results"></span></span>');return t.attr("dir",this.options.get("dir")),this.$dropdown=t,t},n.prototype.position=function(){},n.prototype.destroy=function(){this.$dropdown.remove()},n.prototype.bind=function(e){var t=this;e.on("select",function(e){t._onSelect(e)}),e.on("unselect",function(e){t._onUnSelect(e)})},n.prototype._onS