Files
BlueLotus_XSSReceiver/static/js/jqxinput.js

7 lines
15 KiB
JavaScript
Raw Normal View History

/*
jQWidgets v3.9.0 (2015-Oct)
Copyright (c) 2011-2015 jQWidgets.
License: http://jqwidgets.com/license/
*/
(function(a){a.jqx.jqxWidget("jqxInput","",{});a.extend(a.jqx._jqxInput.prototype,{defineInstance:function(){var c=this;var b={disabled:false,filter:c._filter,sort:c._sort,highlight:c._highlight,dropDownWidth:null,renderer:c._renderer,opened:false,$popup:a("<ul></ul>"),source:[],roundedCorners:true,searchMode:"default",placeHolder:"",width:null,height:null,value:"",rtl:false,displayMember:"",valueMember:"",events:["select","open","close","change"],popupZIndex:20000,items:8,item:'<li><a href:"#"></a></li>',minLength:1,maxLength:null};a.extend(true,this,b);return b},createInstance:function(b){this.render()},render:function(){if(this.element.nodeName.toLowerCase()=="textarea"){this.element.style.overflow="auto"}else{if(this.element.nodeName.toLowerCase()=="div"){this.baseHost=this.element;var b=this.host.find("input");var d=false;a.each(b,function(){var f=this.type;if(f==null||f=="text"||f=="textarea"){b=a(this);d=true;return false}});if(!d){throw new Error("jqxInput: Missing Text Input in the Input Group")}if(b.length>0){this.baseHost=a(this.element);this.host=b;this.element=b[0];this.baseHost.addClass(this.toThemeProperty("jqx-widget"));this.baseHost.addClass(this.toThemeProperty("jqx-rc-all"));this.baseHost.addClass(this.toThemeProperty("jqx-input-group"));var c=this.baseHost.children();var e=this;a.each(c,function(f){a(this).addClass(e.toThemeProperty("jqx-input-group-addon"));a(this).removeClass(e.toThemeProperty("jqx-rc-all"));if(f==0){a(this).addClass(e.toThemeProperty("jqx-rc-l"))}if(f==c.length-1){a(this).addClass(e.toThemeProperty("jqx-rc-r"))}if(this!=e.element){a(this).addClass(e.toThemeProperty("jqx-fill-state-normal"))}})}}}this.addHandlers();if(this.rtl){this.host.addClass(this.toThemeProperty("jqx-rtl"))}this.host.attr("role","textbox");a.jqx.aria(this,"aria-autocomplete","both");a.jqx.aria(this,"aria-disabled",this.disabled);a.jqx.aria(this,"aria-readonly",false);a.jqx.aria(this,"aria-multiline",false);if(this.source&&this.source.length){a.jqx.aria(this,"aria-haspopup",true)}if(this.value!=""){this.element.value=this.value}this._oldsource=this.source;this._updateSource()},_updateSource:function(){var d=this;var b=function(f){var e=new Array();e=a.map(f,function(h){if(h==undefined){return null}if(typeof h==="string"||h instanceof String){return{label:h,value:h}}if(typeof h!="string"&&h instanceof String==false){var g="";var i="";if(d.displayMember!=""&&d.displayMember!=undefined){if(h[d.displayMember]){g=h[d.displayMember]}}if(d.valueMember!=""&&d.valueMember!=undefined){i=h[d.valueMember]}if(g==""){g=h.label}if(i==""){i=h.value}return{label:g,value:i}}return h});return e};if(this.source&&this.source._source){this.adapter=this.source;if(this.adapter._source.localdata!=null){this.adapter.unbindBindingUpdate(this.element.id);this.adapter.bindBindingUpdate(this.element.id,function(e){d.source=b(d.adapter.records)})}else{var c={};if(this.adapter._options.data){a.extend(d.adapter._options.data,c)}else{if(this.source._source.data){a.extend(c,this.source._source.data)}this.adapter._options.data=c}this.adapter.unbindDownloadComplete(this.element.id);this.adapter.bindDownloadComplete(this.element.id,function(e){d.source=b(d.adapter.records)})}this.source.dataBind();return}if(!a.isFunction(this.source)){this.source=b(this.source)}},_refreshClasses:function(c){var b=c?"addClass":"removeClass";this.host[b](this.toThemeProperty("jqx-widget-content"));this.host[b](this.toThemeProperty("jqx-input"));this.host[b](this.toThemeProperty("jqx-widget"));this.$popup[b](this.toThemeProperty("jqx-popup"));if(a.jqx.browser.msie){this.$popup[b](this.toThemeProperty("jqx-noshadow"))}this.$popup[b](this.toThemeProperty("jqx-input-popup"));this.$popup[b](this.toThemeProperty("jqx-menu"));this.$popup[b](this.toThemeProperty("jqx-menu-vertical"));this.$popup[b](this.toThemeProperty("jqx-menu-dropdown"));this.$popup[b](this.toThemeProperty("jqx-widget"));this.$popup[b](this.toThemeProperty("jqx-widget-content"));if(this.roundedCorners){this.host[b](this.toThemeProperty("jqx-rc-all"));this.$popup[b](this.toThemeProperty("jqx-rc-all"))}if(t