PageSourceSearch

https://binarymetrix.io/wp-content/litespeed/js/e0c53139bb43ea709fd1bcd782970830.js?ver=0a245

js binarymetrix.io collected 2026-10-09 17:51:56 UTC 12,264 bytes, 57 lines download raw bytes

1/**
2 * Select to dropdown list for Bootstrap 3
3 *
4 * @category        jQuery Plugin
5 * @version         1.2.1
6 * @author          Alexsander Vyshnyvetskyy <[email protected]>
7 * @link            https://github.com/wdmg/bootstrap-selectinput
8 * @copyright       Copyright (c) 2019 W.D.M.Group, Ukraine
9 * @license         https://opensource.org/licenses/MIT Massachusetts Institute of Technology (MIT) License
10 *
11 */
12+function($){"use strict";var _createClass=(function(){function defineProperties(target,props){for(var key in props){var prop=props[key];prop.configurable=!0;if(prop.value)prop.writable=!0}
13Object.defineProperties(target,props)}
14return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor}})();var _classCallCheck=function(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}};var SelectInput=(function($){var className="selectinput";var _jQueryNoConflict=$.fn[className];var defaults={id:null,dropdownClass:'.dropdown .selectinput',listClass:'.dropdown-menu',itemClass:'.dropdown-item',toggleClass:'.btn .btn-default .dropdown-toggle',toggleText:'Dropdown',toggleCaret:'<span class="caret"></span>',toggleChange:!0,autocomplete:!1,minInput:2,templates:{inputField:'<input type="text" autocomplete="false" class="form-control" />',autocompleteList:'<div class="autocomplete dropdown-menu" />',autocompleteItem:'<li><a class="item" href="#" /></li>'},onChange:function onChange(){},onShow:function onShow(){},onShown:function onShown(){},onHide:function onHide(){},onHidden:function onHidden(){},onAutocompleteSuccess:function onAutocompleteSuccess(){},onAutocompleteError:function onAutocompleteError(){},onAutocompleteShow:function onAutocompleteShow(){},onAutocompleteShown:function onAutocompleteShown(){},onAutocompleteHide:function onAutocompleteHide(){},onAutocompleteHidden:function onAutocompleteHidden(){},debug:!1};var SelectInput=(function(){function SelectInput($element,config){var _this=this;_classCallCheck(_this,SelectInput);config.dropdownClass=config.dropdownClass.replace(/\./g,'');config.listClass=config.listClass.replace(/\./g,'');config.itemClass=config.itemClass.replace(/\./g,'');config.toggleClass=config.toggleClass.replace(/\./g,'');_this._config=$.extend({},defaults,$element.data(),config);_this._$element=$element instanceof jQuery?$element:$($element);if(!_this._config.id)
15_this._widgetId='selectinput-'+Date.now().toString().substr(6);else _this._widgetId='selectinput-'+_this._config.id;_this._$element.each(function(){var $input=$(this);var type=_this.getInputType($input);if(!$input.data('select')||type==="select-one"||type==="select-multiple"||type==="text"){if(!_this._config.debug){$input.css('display','none')}
16$input.removeAttr('class');$input.attr('data-select',_this._widgetId);var options=_this.getInputValues($input);_this.buildDropdown($input,options);_this.attachBehaviors($input);_this.attachOriginals($input);if(_this._config.autocomplete){if(type==="select-multiple"){console.warn('Multiple select with autocomplete not allowed!',$input)}else{_this.attachAutocomplete($input)}}}else{console.warn('Element has not select or input field!',$input)}})}
17_createClass(SelectInput,{element:{value:function element(){var _this=this;return _this._$element}},getInputType:{value:function getInputType($input){return $input.get(0).type}},getInputValues:{value:function getInputValues($input){var _this=this;var values=[];var type=_this.getInputType($input);if(type==="select-one"||type==="select-multiple"){$input.find('option').each(function(){values.push({"value":typeof $(this).attr('value')==="undefined"?!1:$(this).attr('value'),"active":$(this).prop("selected"),"disabled":$(this).prop("disabled"),"label":$(this).text()});if(_this._config.toggleChange===!0&&$(this).prop("selected")===!0){_this._config.toggleText=$(this).text()}})}
18return values}},appendItems:{value:function appendItems(items,clear){var list='';var _this=this;if(clear)
19_this.$options.empty();$.each(items,function(key,item){if(item.value&&item.label){if(item.active===!0||item.selected===!0)
20list+='<li class="'+_this._config.itemClass+' active"><a href="#" data-value="'+item.value+'">'+item.label+'</a></li>';else if(item.disabled===!0)
21list+='<li class="'+_this._config.itemClass+' disabled"><a href="#" data-value="'+item.value+'">'+item.label+'</a></li>';else list+='<li class="'+_this._config.itemClass+'"><a href="#" data-value="'+item.value+'">'+item.label+'</a></li>'}else{list+='<li class="'+_this._config.itemClass+'"><a href="#" data-value="'+item+'">'+item+'</a></li>'}});_this.$options.append($(list))}},attachOriginals:{value:function attachOriginals($input){var _this=this;var type=_this.getInputType($input);$input.on('change',function(){var value=$(this).val();if(_this._config.debug)
22console.log('Original select has change value to: `'+value+'`',_this);if(value){var toggleText='';var $button=_this.$dropdown.find('[data-toggle="dropdown"]');if(type==="select-multiple"){var delimiter='';_this.$options.find('li').removeClass('active');$.each(value,function(index,value){var $target=_this.$options.find('a[data-value="'+value+'"]');
22if($target){$target.parent('li').addClass('active');toggleText=toggleText+delimiter+$target.text();if(delimiter.length==0)
23delimiter=', '}});if(toggleText.length>0){if(_this._config.autocomplete){_this.$input.val(toggleText)}else{$button.html(toggleText+' '+_this._config.toggleCaret)}}}else{var $target=_this.$options.find('a[data-value="'+value+'"]');if($target){_this.$options.find('li').removeClass('active');$target.parent('li').addClass('active');toggleText=$target.text();if(toggleText.length>0){if(_this._config.autocomplete){_this.$input.val(toggleText)}else{$button.html(toggleText+' '+_this._config.toggleCaret)}}}}}})}},attachBehaviors:{value:function attachBehaviors($input){var _this=this;var type=_this.getInputType($input);_this.$options.find('li').on('click',function(event){event.preventDefault();var _target=$(this);var label=_target.find('> a').text();var value=_target.find('> a').data('value');var $button=$(_this).find('[data-toggle="dropdown"]');if(_this._config.debug)
24console.log('On `click` from options list:'+value+' = '+label,_this);if(type==="select-multiple"){var values=$input.val();if(!values)
25values=[];if(!_target.hasClass('disabled')){if(_target.hasClass('active')){_target.removeClass('active');values.splice($input.val().indexOf(value),1)}else{_target.addClass('active');values.push(value)}}
26$input.val(values).change()}else if(type==="select-one"){if(!_target.hasClass('disabled')){_this.$options.find('li').removeClass('active');_target.addClass('active');if(_this._config.autocomplete&&$input.find("option[value='"+value+"']").length==0){$input.prop('selectedIndex',-1);$input.append(new Option(label,value,!0,!1))}
27$input.val(value).change()}else{event.stopPropagation()}}else if(type==="text"){if(!_target.hasClass('disabled')){$input.val(value).change()}else{event.stopPropagation()}}
28if(_this._config.debug)
29console.log('Element change value to: '+$input.val(),_this);if(_this._config.toggleChange===!0&&!_target.hasClass('disabled')){if(_this._config.autocomplete){if(label)
30_this.$input.val(label);}else{if(label)
31$button.html(label+' '+_this._config.toggleCaret);}}
32if(!_target.hasClass('disabled')){if(_this._config.debug)
33console.log('Call `onChange` method',_this);return _this._config.onChange.call(_this)}})}},buildDropdown:{value:function buildDropdown($input,options){var _this=this;var items='';var type=_this.getInputType($input);_this.$input=$(_this._config.templates.inputField);_this.$dropdown=$('<div class="'+_this._config.dropdownClass+'" />');var $button=$('<button class="'+_this._config.toggleClass+'" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" />');$button.attr('id',_this._selectId);if($input.prop('disabled'))
34$button.prop('disabled',"disabled");if(_this._config.autocomplete){var id=$input.attr('id');var name=$input.attr('name');var placeholder=$input.attr('placeholder');if(_this._widgetId)
35_this.$input.data('select',_this._widgetId);if(placeholder)
36_this.$input.prop('placeholder',placeholder);_this.$dropdown.append(_this.$input);$button.html(_this._config.toggleCaret);_this.$dropdown.append($button);_this.$dropdown.addClass('btn-group')}else{$button.html(_this._config.toggleText+' '+_this._config.toggleCaret);_this.$dropdown.append($button)}
37_this.$options=$('<ul class="'+_this._config.listClass+'" />');_this.appendItems(options);_this.$options.attr('aria-labelledby',_this._selectId);_this.$dropdown.append(_this.$options);_this.$dropdown.attr('id',_this._widgetId);if(!$input.next().is('.dropdown')){$input.after(_this.$dropdown)}
38if(type=="text"){$input.remove()}
39return _this._$element}},parseURL:{value:function parseURL(url){var pattern=new RegExp(/[?&]\w+=/);if(pattern.test(url)){return JSON.parse('{"'+decodeURIComponent(url).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')+'"}')}else{return JSON.parse('{"'+decodeURIComponent(url)+'":""}')}}},encodeURL:{value:function encodeURL(object){var url="";var pattern=new RegExp(/[?&]\w+=/);for(var key in object){if(pattern.test(url)){if(url!="")
40url+="&"}else{if(url!="")
41url+="?"}
42if(key!=""&&encodeURIComponent(object[key])=="")
43url=key;else if(key!=""&&encodeURIComponent(object[key])!="")
44url+=key+"="+encodeURIComponent(object[key]);}
45return url}},attachAutocomplete:{value:function buildAutocomplete($input){var _this=this;_this._callbackInProcess=!1;_this.$input.on('input',function(event){var value=event.target.value.trim();if(value.length>=parseInt(_this._config.minInput)&&!_this._callbackInProcess){_this._callbackInProcess=!0;var url=_this.parseURL(_this._config.autocomplete);url.value=value;url._t=Date.now();$.ajax({url:_this.encodeURL(url),success:function(response,status,jqXHR){if(!(typeof response=="object"))
46response=JSON.parse(response);if(_this._config.onAutocompleteSuccess instanceof Object&&_this._config.onAutocompleteSuccess instanceof Function){if(_this._config.debug)
47console.log('Call `onAutocompleteSuccess` method',this);_this._config.onAutocompleteSuccess.call(this)}
48if(Object.keys(response).length>0){if(_this._config.onAutocompleteShow instanceof Object&&_this._config.onAutocompleteShow instanceof Function){if(_this._config.debug)
49console.log('Call `onAutocompleteShow` method',this);_this._config.onAutocompleteShow.call(this)}
50var items=[];$.each(response,function(index,item){if(typeof item=="object"){$.each(item,function(index,ret){item=ret})}
51if(item.substr(0,value.length).toUpperCase()==value.toUpperCase()){items.push({label:"<b>"+item.substr(0,value.length)+"</b>"+item.substr(value.length),value:index})}});_this.appendItems(items,!0);_this.$dropdown.find('[data-toggle="dropdown"]').attr('aria-expanded',"true");_this.$dropdown.addClass('open');_this.attachBehaviors($input)}else{if(_this._config.onAutocompleteHide instanceof Object&&_this._config.onAutocompleteHide instanceof Function){if(_this._config.debug)
52console.log('Call `onAutocompleteHide` method',this);_this._config.onAutocompleteHide().call(this)}
53_this.$dropdown.find('[data-toggle="dropdown"]').attr('aria-expanded',"false");_this.$dropdown.removeClass('open')}
54_this._callbackInProcess=!1},error:function(jqXHR,status,error){if(_this._config.onAutocompleteError instanceof Object&&_this._config.onAutocompleteError instanceof Function){if(_this._config.debug)
55console.log('Call `onAutocompleteError` method',this);_this._config.onAutocompleteError.call(this)}
56_this._callbackInProcess=!1}})}})}}},{Default:{get:function(){return defaults}},_jQueryInterface:{value:function _jQueryInterface(config){var _this=this;config=config||{};return _this.each(function(){var $this=$(_this);var _config=$.extend({},SelectInput.Default,$this.data(),typeof config==="object"&&config);new SelectInput(_this,_config)})}}});return SelectInput})();$.fn[className]=SelectInput._jQueryInterface;$.fn[className].Constructor=SelectInput;$.fn[className].noConflict=function(){$.fn[className]=_jQueryNoConflict;return SelectInput._jQueryInterface};return SelectInput})(jQuery)}(jQuery)
57;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.