]> git.wh0rd.org - tt-rss.git/blobdiff - lib/dijit/form/FilteringSelect.js
upgrade dojo to 1.8.3 (refs #570)
[tt-rss.git] / lib / dijit / form / FilteringSelect.js
index 08703226c8c664f0e20558400d0f363b4e3f7f8f..de6808f27d3cda32afb35dfc2768bf4e0224eb58 100644 (file)
@@ -1,92 +1,2 @@
-/*
-       Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
-       Available via Academic Free License >= 2.1 OR the modified BSD license.
-       see: http://dojotoolkit.org/license for details
-*/
-
-
-if(!dojo._hasResource["dijit.form.FilteringSelect"]){
-dojo._hasResource["dijit.form.FilteringSelect"]=true;
-dojo.provide("dijit.form.FilteringSelect");
-dojo.require("dijit.form.ComboBox");
-dojo.declare("dijit.form.FilteringSelect",[dijit.form.MappedTextBox,dijit.form.ComboBoxMixin],{_isvalid:true,required:true,_lastDisplayedValue:"",isValid:function(){
-return this._isvalid||(!this.required&&this.get("displayedValue")=="");
-},_refreshState:function(){
-if(!this.searchTimer){
-this.inherited(arguments);
-}
-},_callbackSetLabel:function(_1,_2,_3){
-if((_2&&_2.query[this.searchAttr]!=this._lastQuery)||(!_2&&_1.length&&this.store.getIdentity(_1[0])!=this._lastQuery)){
-return;
-}
-if(!_1.length){
-this.valueNode.value="";
-dijit.form.TextBox.superclass._setValueAttr.call(this,"",_3||(_3===undefined&&!this._focused));
-this._isvalid=false;
-this.validate(this._focused);
-this.item=null;
-}else{
-this.set("item",_1[0],_3);
-}
-},_openResultList:function(_4,_5){
-if(_5.query[this.searchAttr]!=this._lastQuery){
-return;
-}
-if(this.item===undefined){
-this._isvalid=_4.length!=0||this._maxOptions!=0;
-this.validate(true);
-}
-dijit.form.ComboBoxMixin.prototype._openResultList.apply(this,arguments);
-},_getValueAttr:function(){
-return this.valueNode.value;
-},_getValueField:function(){
-return "value";
-},_setValueAttr:function(_6,_7){
-if(!this._onChangeActive){
-_7=null;
-}
-this._lastQuery=_6;
-if(_6===null||_6===""){
-this._setDisplayedValueAttr("",_7);
-return;
-}
-var _8=this;
-this.store.fetchItemByIdentity({identity:_6,onItem:function(_9){
-_8._callbackSetLabel(_9?[_9]:[],undefined,_7);
-}});
-},_setItemAttr:function(_a,_b,_c){
-this._isvalid=true;
-this.inherited(arguments);
-this.valueNode.value=this.value;
-this._lastDisplayedValue=this.textbox.value;
-},_getDisplayQueryString:function(_d){
-return _d.replace(/([\\\*\?])/g,"\\$1");
-},_setDisplayedValueAttr:function(_e,_f){
-if(!this._created){
-_f=false;
-}
-if(this.store){
-this._hideResultList();
-var _10=dojo.clone(this.query);
-this._lastQuery=_10[this.searchAttr]=this._getDisplayQueryString(_e);
-this.textbox.value=_e;
-this._lastDisplayedValue=_e;
-var _11=this;
-var _12={query:_10,queryOptions:{ignoreCase:this.ignoreCase,deep:true},onComplete:function(_13,_14){
-_11._fetchHandle=null;
-dojo.hitch(_11,"_callbackSetLabel")(_13,_14,_f);
-},onError:function(_15){
-_11._fetchHandle=null;
-console.error("dijit.form.FilteringSelect: "+_15);
-dojo.hitch(_11,"_callbackSetLabel")([],undefined,false);
-}};
-dojo.mixin(_12,this.fetchProperties);
-this._fetchHandle=this.store.fetch(_12);
-}
-},postMixInProperties:function(){
-this.inherited(arguments);
-this._isvalid=!this.required;
-},undo:function(){
-this.set("displayedValue",this._lastDisplayedValue);
-}});
-}
+//>>built
+define("dijit/form/FilteringSelect",["dojo/data/util/filter","dojo/_base/declare","dojo/_base/lang","dojo/when","./MappedTextBox","./ComboBoxMixin"],function(_1,_2,_3,_4,_5,_6){return _2("dijit.form.FilteringSelect",[_5,_6],{required:true,_lastDisplayedValue:"",_isValidSubset:function(){return this._opened;},isValid:function(){return !!this.item||(!this.required&&this.get("displayedValue")=="");},_refreshState:function(){if(!this.searchTimer){this.inherited(arguments);}},_callbackSetLabel:function(_7,_8,_9,_a){if((_8&&_8[this.searchAttr]!==this._lastQuery)||(!_8&&_7.length&&this.store.getIdentity(_7[0])!=this._lastQuery)){return;}if(!_7.length){this.set("value","",_a||(_a===undefined&&!this.focused),this.textbox.value,null);}else{this.set("item",_7[0],_a);}},_openResultList:function(_b,_c,_d){if(_c[this.searchAttr]!==this._lastQuery){return;}this.inherited(arguments);if(this.item===undefined){this.validate(true);}},_getValueAttr:function(){return this.valueNode.value;},_getValueField:function(){return "value";},_setValueAttr:function(_e,_f,_10,_11){if(!this._onChangeActive){_f=null;}if(_11===undefined){if(_e===null||_e===""){_e="";if(!_3.isString(_10)){this._setDisplayedValueAttr(_10||"",_f);return;}}var _12=this;this._lastQuery=_e;_4(this.store.get(_e),function(_13){_12._callbackSetLabel(_13?[_13]:[],undefined,undefined,_f);});}else{this.valueNode.value=_e;this.inherited(arguments);}},_setItemAttr:function(_14,_15,_16){this.inherited(arguments);this._lastDisplayedValue=this.textbox.value;},_getDisplayQueryString:function(_17){return _17.replace(/([\\\*\?])/g,"\\$1");},_setDisplayedValueAttr:function(_18,_19){if(_18==null){_18="";}if(!this._created){if(!("displayedValue" in this.params)){return;}_19=false;}if(this.store){this.closeDropDown();var _1a=_3.clone(this.query);var qs=this._getDisplayQueryString(_18),q;if(this.store._oldAPI){q=qs;}else{q=_1.patternToRegExp(qs,this.ignoreCase);q.toString=function(){return qs;};}this._lastQuery=_1a[this.searchAttr]=q;this.textbox.value=_18;this._lastDisplayedValue=_18;this._set("displayedValue",_18);var _1b=this;var _1c={ignoreCase:this.ignoreCase,deep:true};_3.mixin(_1c,this.fetchProperties);this._fetchHandle=this.store.query(_1a,_1c);_4(this._fetchHandle,function(_1d){_1b._fetchHandle=null;_1b._callbackSetLabel(_1d||[],_1a,_1c,_19);},function(err){_1b._fetchHandle=null;if(!_1b._cancelingQuery){console.error("dijit.form.FilteringSelect: "+err.toString());}});}},undo:function(){this.set("displayedValue",this._lastDisplayedValue);}});});
\ No newline at end of file