mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2026-02-10 16:01:33 +00:00
add dijit/dojo stuff; initial ui mockup
This commit is contained in:
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
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.Button"]){
|
||||
dojo._hasResource["dijit.form.Button"]=true;
|
||||
dojo.provide("dijit.form.Button");
|
||||
dojo.require("dijit.form._FormWidget");
|
||||
dojo.require("dijit._Container");
|
||||
dojo.require("dijit._HasDropDown");
|
||||
dojo.declare("dijit.form.Button",dijit.form._FormWidget,{label:"",showLabel:true,iconClass:"",type:"button",baseClass:"dijitButton",templateString:dojo.cache("dijit.form","templates/Button.html","<span class=\"dijit dijitReset dijitInline\"\n\t><span class=\"dijitReset dijitInline dijitButtonNode\"\n\t\tdojoAttachEvent=\"ondijitclick:_onButtonClick\"\n\t\t><span class=\"dijitReset dijitStretch dijitButtonContents\"\n\t\t\tdojoAttachPoint=\"titleNode,focusNode\"\n\t\t\twaiRole=\"button\" waiState=\"labelledby-${id}_label\"\n\t\t\t><span class=\"dijitReset dijitInline dijitIcon\" dojoAttachPoint=\"iconNode\"></span\n\t\t\t><span class=\"dijitReset dijitToggleButtonIconChar\">●</span\n\t\t\t><span class=\"dijitReset dijitInline dijitButtonText\"\n\t\t\t\tid=\"${id}_label\"\n\t\t\t\tdojoAttachPoint=\"containerNode\"\n\t\t\t></span\n\t\t></span\n\t></span\n\t><input ${!nameAttrSetting} type=\"${type}\" value=\"${value}\" class=\"dijitOffScreen\"\n\t\tdojoAttachPoint=\"valueNode\"\n/></span>\n"),attributeMap:dojo.delegate(dijit.form._FormWidget.prototype.attributeMap,{value:"valueNode",iconClass:{node:"iconNode",type:"class"}}),_onClick:function(e){
|
||||
if(this.disabled){
|
||||
return false;
|
||||
}
|
||||
this._clicked();
|
||||
return this.onClick(e);
|
||||
},_onButtonClick:function(e){
|
||||
if(this._onClick(e)===false){
|
||||
e.preventDefault();
|
||||
}else{
|
||||
if(this.type=="submit"&&!(this.valueNode||this.focusNode).form){
|
||||
for(var _1=this.domNode;_1.parentNode;_1=_1.parentNode){
|
||||
var _2=dijit.byNode(_1);
|
||||
if(_2&&typeof _2._onSubmit=="function"){
|
||||
_2._onSubmit(e);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(this.valueNode){
|
||||
this.valueNode.click();
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
},_fillContent:function(_3){
|
||||
if(_3&&(!this.params||!("label" in this.params))){
|
||||
this.set("label",_3.innerHTML);
|
||||
}
|
||||
},postCreate:function(){
|
||||
dojo.setSelectable(this.focusNode,false);
|
||||
this.inherited(arguments);
|
||||
},_setShowLabelAttr:function(_4){
|
||||
if(this.containerNode){
|
||||
dojo.toggleClass(this.containerNode,"dijitDisplayNone",!_4);
|
||||
}
|
||||
this.showLabel=_4;
|
||||
},onClick:function(e){
|
||||
return true;
|
||||
},_clicked:function(e){
|
||||
},setLabel:function(_5){
|
||||
dojo.deprecated("dijit.form.Button.setLabel() is deprecated. Use set('label', ...) instead.","","2.0");
|
||||
this.set("label",_5);
|
||||
},_setLabelAttr:function(_6){
|
||||
this.containerNode.innerHTML=this.label=_6;
|
||||
if(this.showLabel==false&&!this.params.title){
|
||||
this.titleNode.title=dojo.trim(this.containerNode.innerText||this.containerNode.textContent||"");
|
||||
}
|
||||
}});
|
||||
dojo.declare("dijit.form.DropDownButton",[dijit.form.Button,dijit._Container,dijit._HasDropDown],{baseClass:"dijitDropDownButton",templateString:dojo.cache("dijit.form","templates/DropDownButton.html","<span class=\"dijit dijitReset dijitInline\"\n\t><span class='dijitReset dijitInline dijitButtonNode'\n\t\tdojoAttachEvent=\"ondijitclick:_onButtonClick\" dojoAttachPoint=\"_buttonNode\"\n\t\t><span class=\"dijitReset dijitStretch dijitButtonContents\"\n\t\t\tdojoAttachPoint=\"focusNode,titleNode,_arrowWrapperNode\"\n\t\t\twaiRole=\"button\" waiState=\"haspopup-true,labelledby-${id}_label\"\n\t\t\t><span class=\"dijitReset dijitInline dijitIcon\"\n\t\t\t\tdojoAttachPoint=\"iconNode\"\n\t\t\t></span\n\t\t\t><span class=\"dijitReset dijitInline dijitButtonText\"\n\t\t\t\tdojoAttachPoint=\"containerNode,_popupStateNode\"\n\t\t\t\tid=\"${id}_label\"\n\t\t\t></span\n\t\t\t><span class=\"dijitReset dijitInline dijitArrowButtonInner\"></span\n\t\t\t><span class=\"dijitReset dijitInline dijitArrowButtonChar\">▼</span\n\t\t></span\n\t></span\n\t><input ${!nameAttrSetting} type=\"${type}\" value=\"${value}\" class=\"dijitOffScreen\"\n\t\tdojoAttachPoint=\"valueNode\"\n/></span>\n"),_fillContent:function(){
|
||||
if(this.srcNodeRef){
|
||||
var _7=dojo.query("*",this.srcNodeRef);
|
||||
dijit.form.DropDownButton.superclass._fillContent.call(this,_7[0]);
|
||||
this.dropDownContainer=this.srcNodeRef;
|
||||
}
|
||||
},startup:function(){
|
||||
if(this._started){
|
||||
return;
|
||||
}
|
||||
if(!this.dropDown){
|
||||
var _8=dojo.query("[widgetId]",this.dropDownContainer)[0];
|
||||
this.dropDown=dijit.byNode(_8);
|
||||
delete this.dropDownContainer;
|
||||
}
|
||||
dijit.popup.moveOffScreen(this.dropDown.domNode);
|
||||
this.inherited(arguments);
|
||||
},isLoaded:function(){
|
||||
var _9=this.dropDown;
|
||||
return (!_9.href||_9.isLoaded);
|
||||
},loadDropDown:function(){
|
||||
var _a=this.dropDown;
|
||||
if(!_a){
|
||||
return;
|
||||
}
|
||||
if(!this.isLoaded()){
|
||||
var _b=dojo.connect(_a,"onLoad",this,function(){
|
||||
dojo.disconnect(_b);
|
||||
this.openDropDown();
|
||||
});
|
||||
_a.refresh();
|
||||
}else{
|
||||
this.openDropDown();
|
||||
}
|
||||
},isFocusable:function(){
|
||||
return this.inherited(arguments)&&!this._mouseDown;
|
||||
}});
|
||||
dojo.declare("dijit.form.ComboButton",dijit.form.DropDownButton,{templateString:dojo.cache("dijit.form","templates/ComboButton.html","<table class=\"dijit dijitReset dijitInline dijitLeft\"\n\tcellspacing='0' cellpadding='0' waiRole=\"presentation\"\n\t><tbody waiRole=\"presentation\"><tr waiRole=\"presentation\"\n\t\t><td class=\"dijitReset dijitStretch dijitButtonNode\" dojoAttachPoint=\"buttonNode\" dojoAttachEvent=\"ondijitclick:_onButtonClick,onkeypress:_onButtonKeyPress\"\n\t\t><div id=\"${id}_button\" class=\"dijitReset dijitButtonContents\"\n\t\t\tdojoAttachPoint=\"titleNode\"\n\t\t\twaiRole=\"button\" waiState=\"labelledby-${id}_label\"\n\t\t\t><div class=\"dijitReset dijitInline dijitIcon\" dojoAttachPoint=\"iconNode\" waiRole=\"presentation\"></div\n\t\t\t><div class=\"dijitReset dijitInline dijitButtonText\" id=\"${id}_label\" dojoAttachPoint=\"containerNode\" waiRole=\"presentation\"></div\n\t\t></div\n\t\t></td\n\t\t><td id=\"${id}_arrow\" class='dijitReset dijitRight dijitButtonNode dijitArrowButton'\n\t\t\tdojoAttachPoint=\"_popupStateNode,focusNode,_buttonNode\"\n\t\t\tdojoAttachEvent=\"onkeypress:_onArrowKeyPress\"\n\t\t\ttitle=\"${optionsTitle}\"\n\t\t\twaiRole=\"button\" waiState=\"haspopup-true\"\n\t\t\t><div class=\"dijitReset dijitArrowButtonInner\" waiRole=\"presentation\"></div\n\t\t\t><div class=\"dijitReset dijitArrowButtonChar\" waiRole=\"presentation\">▼</div\n\t\t></td\n\t\t><td style=\"display:none !important;\"\n\t\t\t><input ${!nameAttrSetting} type=\"${type}\" value=\"${value}\" dojoAttachPoint=\"valueNode\"\n\t\t/></td></tr></tbody\n></table>\n"),attributeMap:dojo.mixin(dojo.clone(dijit.form.Button.prototype.attributeMap),{id:"",tabIndex:["focusNode","titleNode"],title:"titleNode"}),optionsTitle:"",baseClass:"dijitComboButton",cssStateNodes:{"buttonNode":"dijitButtonNode","titleNode":"dijitButtonContents","_popupStateNode":"dijitDownArrowButton"},_focusedNode:null,_onButtonKeyPress:function(_c){
|
||||
if(_c.charOrCode==dojo.keys[this.isLeftToRight()?"RIGHT_ARROW":"LEFT_ARROW"]){
|
||||
dijit.focus(this._popupStateNode);
|
||||
dojo.stopEvent(_c);
|
||||
}
|
||||
},_onArrowKeyPress:function(_d){
|
||||
if(_d.charOrCode==dojo.keys[this.isLeftToRight()?"LEFT_ARROW":"RIGHT_ARROW"]){
|
||||
dijit.focus(this.titleNode);
|
||||
dojo.stopEvent(_d);
|
||||
}
|
||||
},focus:function(_e){
|
||||
dijit.focus(_e=="start"?this.titleNode:this._popupStateNode);
|
||||
}});
|
||||
dojo.declare("dijit.form.ToggleButton",dijit.form.Button,{baseClass:"dijitToggleButton",checked:false,attributeMap:dojo.mixin(dojo.clone(dijit.form.Button.prototype.attributeMap),{checked:"focusNode"}),_clicked:function(_f){
|
||||
this.set("checked",!this.checked);
|
||||
},_setCheckedAttr:function(_10,_11){
|
||||
this.checked=_10;
|
||||
dojo.attr(this.focusNode||this.domNode,"checked",_10);
|
||||
dijit.setWaiState(this.focusNode||this.domNode,"pressed",_10);
|
||||
this._handleOnChange(_10,_11);
|
||||
},setChecked:function(_12){
|
||||
dojo.deprecated("setChecked("+_12+") is deprecated. Use set('checked',"+_12+") instead.","","2.0");
|
||||
this.set("checked",_12);
|
||||
},reset:function(){
|
||||
this._hasBeenBlurred=false;
|
||||
this.set("checked",this.params.checked||false);
|
||||
}});
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
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.CheckBox"]){
|
||||
dojo._hasResource["dijit.form.CheckBox"]=true;
|
||||
dojo.provide("dijit.form.CheckBox");
|
||||
dojo.require("dijit.form.ToggleButton");
|
||||
dojo.declare("dijit.form.CheckBox",dijit.form.ToggleButton,{templateString:dojo.cache("dijit.form","templates/CheckBox.html","<div class=\"dijit dijitReset dijitInline\" waiRole=\"presentation\"\n\t><input\n\t \t${!nameAttrSetting} type=\"${type}\" ${checkedAttrSetting}\n\t\tclass=\"dijitReset dijitCheckBoxInput\"\n\t\tdojoAttachPoint=\"focusNode\"\n\t \tdojoAttachEvent=\"onclick:_onClick\"\n/></div>\n"),baseClass:"dijitCheckBox",type:"checkbox",value:"on",readOnly:false,attributeMap:dojo.delegate(dijit.form._FormWidget.prototype.attributeMap,{readOnly:"focusNode"}),_setReadOnlyAttr:function(_1){
|
||||
this.readOnly=_1;
|
||||
dojo.attr(this.focusNode,"readOnly",_1);
|
||||
dijit.setWaiState(this.focusNode,"readonly",_1);
|
||||
},_setValueAttr:function(_2,_3){
|
||||
if(typeof _2=="string"){
|
||||
this.value=_2;
|
||||
dojo.attr(this.focusNode,"value",_2);
|
||||
_2=true;
|
||||
}
|
||||
if(this._created){
|
||||
this.set("checked",_2,_3);
|
||||
}
|
||||
},_getValueAttr:function(){
|
||||
return (this.checked?this.value:false);
|
||||
},_setLabelAttr:undefined,postMixInProperties:function(){
|
||||
if(this.value==""){
|
||||
this.value="on";
|
||||
}
|
||||
this.checkedAttrSetting=this.checked?"checked":"";
|
||||
this.inherited(arguments);
|
||||
},_fillContent:function(_4){
|
||||
},reset:function(){
|
||||
this._hasBeenBlurred=false;
|
||||
this.set("checked",this.params.checked||false);
|
||||
this.value=this.params.value||"on";
|
||||
dojo.attr(this.focusNode,"value",this.value);
|
||||
},_onFocus:function(){
|
||||
if(this.id){
|
||||
dojo.query("label[for='"+this.id+"']").addClass("dijitFocusedLabel");
|
||||
}
|
||||
this.inherited(arguments);
|
||||
},_onBlur:function(){
|
||||
if(this.id){
|
||||
dojo.query("label[for='"+this.id+"']").removeClass("dijitFocusedLabel");
|
||||
}
|
||||
this.inherited(arguments);
|
||||
},_onClick:function(e){
|
||||
if(this.readOnly){
|
||||
return false;
|
||||
}
|
||||
return this.inherited(arguments);
|
||||
}});
|
||||
dojo.declare("dijit.form.RadioButton",dijit.form.CheckBox,{type:"radio",baseClass:"dijitRadio",_setCheckedAttr:function(_5){
|
||||
this.inherited(arguments);
|
||||
if(!this._created){
|
||||
return;
|
||||
}
|
||||
if(_5){
|
||||
var _6=this;
|
||||
dojo.query("INPUT[type=radio]",this.focusNode.form||dojo.doc).forEach(function(_7){
|
||||
if(_7.name==_6.name&&_7!=_6.focusNode&&_7.form==_6.focusNode.form){
|
||||
var _8=dijit.getEnclosingWidget(_7);
|
||||
if(_8&&_8.checked){
|
||||
_8.set("checked",false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},_clicked:function(e){
|
||||
if(!this.checked){
|
||||
this.set("checked",true);
|
||||
}
|
||||
}});
|
||||
}
|
||||
@@ -0,0 +1,615 @@
|
||||
/*
|
||||
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.ComboBox"]){
|
||||
dojo._hasResource["dijit.form.ComboBox"]=true;
|
||||
dojo.provide("dijit.form.ComboBox");
|
||||
dojo.require("dojo.window");
|
||||
dojo.require("dojo.regexp");
|
||||
dojo.require("dojo.data.util.simpleFetch");
|
||||
dojo.require("dojo.data.util.filter");
|
||||
dojo.require("dijit._CssStateMixin");
|
||||
dojo.require("dijit.form._FormWidget");
|
||||
dojo.require("dijit.form.ValidationTextBox");
|
||||
dojo.requireLocalization("dijit.form","ComboBox",null,"ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw");
|
||||
dojo.declare("dijit.form.ComboBoxMixin",null,{item:null,pageSize:Infinity,store:null,fetchProperties:{},query:{},autoComplete:true,highlightMatch:"first",searchDelay:100,searchAttr:"name",labelAttr:"",labelType:"text",queryExpr:"${0}*",ignoreCase:true,hasDownArrow:true,templateString:dojo.cache("dijit.form","templates/ComboBox.html","<div class=\"dijit dijitReset dijitInlineTable dijitLeft\"\n\tid=\"widget_${id}\"\n\tdojoAttachPoint=\"comboNode\" waiRole=\"combobox\"\n\t><div class='dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton dijitArrowButtonContainer'\n\t\tdojoAttachPoint=\"downArrowNode\" waiRole=\"presentation\"\n\t\tdojoAttachEvent=\"onmousedown:_onArrowMouseDown\"\n\t\t><input class=\"dijitReset dijitInputField dijitArrowButtonInner\" value=\"▼ \" type=\"text\" tabIndex=\"-1\" readOnly waiRole=\"presentation\"\n\t\t\t${_buttonInputDisabled}\n\t/></div\n\t><div class='dijitReset dijitValidationContainer'\n\t\t><input class=\"dijitReset dijitInputField dijitValidationIcon dijitValidationInner\" value=\"Χ \" type=\"text\" tabIndex=\"-1\" readOnly waiRole=\"presentation\"\n\t/></div\n\t><div class=\"dijitReset dijitInputField dijitInputContainer\"\n\t\t><input class='dijitReset dijitInputInner' ${!nameAttrSetting} type=\"text\" autocomplete=\"off\"\n\t\t\tdojoAttachEvent=\"onkeypress:_onKeyPress,compositionend\"\n\t\t\tdojoAttachPoint=\"textbox,focusNode\" waiRole=\"textbox\" waiState=\"haspopup-true,autocomplete-list\"\n\t/></div\n></div>\n"),baseClass:"dijitTextBox dijitComboBox",cssStateNodes:{"downArrowNode":"dijitDownArrowButton"},_getCaretPos:function(_1){
|
||||
var _2=0;
|
||||
if(typeof (_1.selectionStart)=="number"){
|
||||
_2=_1.selectionStart;
|
||||
}else{
|
||||
if(dojo.isIE){
|
||||
var tr=dojo.doc.selection.createRange().duplicate();
|
||||
var _3=_1.createTextRange();
|
||||
tr.move("character",0);
|
||||
_3.move("character",0);
|
||||
try{
|
||||
_3.setEndPoint("EndToEnd",tr);
|
||||
_2=String(_3.text).replace(/\r/g,"").length;
|
||||
}
|
||||
catch(e){
|
||||
}
|
||||
}
|
||||
}
|
||||
return _2;
|
||||
},_setCaretPos:function(_4,_5){
|
||||
_5=parseInt(_5);
|
||||
dijit.selectInputText(_4,_5,_5);
|
||||
},_setDisabledAttr:function(_6){
|
||||
this.inherited(arguments);
|
||||
dijit.setWaiState(this.comboNode,"disabled",_6);
|
||||
},_abortQuery:function(){
|
||||
if(this.searchTimer){
|
||||
clearTimeout(this.searchTimer);
|
||||
this.searchTimer=null;
|
||||
}
|
||||
if(this._fetchHandle){
|
||||
if(this._fetchHandle.abort){
|
||||
this._fetchHandle.abort();
|
||||
}
|
||||
this._fetchHandle=null;
|
||||
}
|
||||
},_onInput:function(_7){
|
||||
if(!this.searchTimer&&(_7.type=="paste"||_7.type=="input")&&this._lastInput!=this.textbox.value){
|
||||
this.searchTimer=setTimeout(dojo.hitch(this,function(){
|
||||
this._onKeyPress({charOrCode:229});
|
||||
}),100);
|
||||
}
|
||||
this.inherited(arguments);
|
||||
},_onKeyPress:function(_8){
|
||||
var _9=_8.charOrCode;
|
||||
if(_8.altKey||((_8.ctrlKey||_8.metaKey)&&(_9!="x"&&_9!="v"))||_9==dojo.keys.SHIFT){
|
||||
return;
|
||||
}
|
||||
var _a=false;
|
||||
var _b="_startSearchFromInput";
|
||||
var pw=this._popupWidget;
|
||||
var dk=dojo.keys;
|
||||
var _c=null;
|
||||
this._prev_key_backspace=false;
|
||||
this._abortQuery();
|
||||
if(this._isShowingNow){
|
||||
pw.handleKey(_9);
|
||||
_c=pw.getHighlightedOption();
|
||||
}
|
||||
switch(_9){
|
||||
case dk.PAGE_DOWN:
|
||||
case dk.DOWN_ARROW:
|
||||
case dk.PAGE_UP:
|
||||
case dk.UP_ARROW:
|
||||
if(!this._isShowingNow){
|
||||
_a=true;
|
||||
_b="_startSearchAll";
|
||||
}else{
|
||||
this._announceOption(_c);
|
||||
}
|
||||
dojo.stopEvent(_8);
|
||||
break;
|
||||
case dk.ENTER:
|
||||
if(_c){
|
||||
if(_c==pw.nextButton){
|
||||
this._nextSearch(1);
|
||||
dojo.stopEvent(_8);
|
||||
break;
|
||||
}else{
|
||||
if(_c==pw.previousButton){
|
||||
this._nextSearch(-1);
|
||||
dojo.stopEvent(_8);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
this._setBlurValue();
|
||||
this._setCaretPos(this.focusNode,this.focusNode.value.length);
|
||||
}
|
||||
_8.preventDefault();
|
||||
case dk.TAB:
|
||||
var _d=this.get("displayedValue");
|
||||
if(pw&&(_d==pw._messages["previousMessage"]||_d==pw._messages["nextMessage"])){
|
||||
break;
|
||||
}
|
||||
if(_c){
|
||||
this._selectOption();
|
||||
}
|
||||
if(this._isShowingNow){
|
||||
this._lastQuery=null;
|
||||
this._hideResultList();
|
||||
}
|
||||
break;
|
||||
case " ":
|
||||
if(_c){
|
||||
dojo.stopEvent(_8);
|
||||
this._selectOption();
|
||||
this._hideResultList();
|
||||
}else{
|
||||
_a=true;
|
||||
}
|
||||
break;
|
||||
case dk.ESCAPE:
|
||||
if(this._isShowingNow){
|
||||
dojo.stopEvent(_8);
|
||||
this._hideResultList();
|
||||
}
|
||||
break;
|
||||
case dk.DELETE:
|
||||
case dk.BACKSPACE:
|
||||
this._prev_key_backspace=true;
|
||||
_a=true;
|
||||
break;
|
||||
default:
|
||||
_a=typeof _9=="string"||_9==229;
|
||||
}
|
||||
if(_a){
|
||||
this.item=undefined;
|
||||
this.searchTimer=setTimeout(dojo.hitch(this,_b),1);
|
||||
}
|
||||
},_autoCompleteText:function(_e){
|
||||
var fn=this.focusNode;
|
||||
dijit.selectInputText(fn,fn.value.length);
|
||||
var _f=this.ignoreCase?"toLowerCase":"substr";
|
||||
if(_e[_f](0).indexOf(this.focusNode.value[_f](0))==0){
|
||||
var _10=this._getCaretPos(fn);
|
||||
if((_10+1)>fn.value.length){
|
||||
fn.value=_e;
|
||||
dijit.selectInputText(fn,_10);
|
||||
}
|
||||
}else{
|
||||
fn.value=_e;
|
||||
dijit.selectInputText(fn);
|
||||
}
|
||||
},_openResultList:function(_11,_12){
|
||||
this._fetchHandle=null;
|
||||
if(this.disabled||this.readOnly||(_12.query[this.searchAttr]!=this._lastQuery)){
|
||||
return;
|
||||
}
|
||||
this._popupWidget.clearResultList();
|
||||
if(!_11.length&&!this._maxOptions){
|
||||
this._hideResultList();
|
||||
return;
|
||||
}
|
||||
_12._maxOptions=this._maxOptions;
|
||||
var _13=this._popupWidget.createOptions(_11,_12,dojo.hitch(this,"_getMenuLabelFromItem"));
|
||||
this._showResultList();
|
||||
if(_12.direction){
|
||||
if(1==_12.direction){
|
||||
this._popupWidget.highlightFirstOption();
|
||||
}else{
|
||||
if(-1==_12.direction){
|
||||
this._popupWidget.highlightLastOption();
|
||||
}
|
||||
}
|
||||
this._announceOption(this._popupWidget.getHighlightedOption());
|
||||
}else{
|
||||
if(this.autoComplete&&!this._prev_key_backspace&&!/^[*]+$/.test(_12.query[this.searchAttr])){
|
||||
this._announceOption(_13[1]);
|
||||
}
|
||||
}
|
||||
},_showResultList:function(){
|
||||
this._hideResultList();
|
||||
this.displayMessage("");
|
||||
dojo.style(this._popupWidget.domNode,{width:"",height:""});
|
||||
var _14=this.open();
|
||||
var _15=dojo.marginBox(this._popupWidget.domNode);
|
||||
this._popupWidget.domNode.style.overflow=((_14.h==_15.h)&&(_14.w==_15.w))?"hidden":"auto";
|
||||
var _16=_14.w;
|
||||
if(_14.h<this._popupWidget.domNode.scrollHeight){
|
||||
_16+=16;
|
||||
}
|
||||
dojo.marginBox(this._popupWidget.domNode,{h:_14.h,w:Math.max(_16,this.domNode.offsetWidth)});
|
||||
if(_16<this.domNode.offsetWidth){
|
||||
this._popupWidget.domNode.parentNode.style.left=dojo.position(this.domNode,true).x+"px";
|
||||
}
|
||||
dijit.setWaiState(this.comboNode,"expanded","true");
|
||||
},_hideResultList:function(){
|
||||
this._abortQuery();
|
||||
if(this._isShowingNow){
|
||||
dijit.popup.close(this._popupWidget);
|
||||
this._isShowingNow=false;
|
||||
dijit.setWaiState(this.comboNode,"expanded","false");
|
||||
dijit.removeWaiState(this.focusNode,"activedescendant");
|
||||
}
|
||||
},_setBlurValue:function(){
|
||||
var _17=this.get("displayedValue");
|
||||
var pw=this._popupWidget;
|
||||
if(pw&&(_17==pw._messages["previousMessage"]||_17==pw._messages["nextMessage"])){
|
||||
this._setValueAttr(this._lastValueReported,true);
|
||||
}else{
|
||||
if(typeof this.item=="undefined"){
|
||||
this.item=null;
|
||||
this.set("displayedValue",_17);
|
||||
}else{
|
||||
if(this.value!=this._lastValueReported){
|
||||
dijit.form._FormValueWidget.prototype._setValueAttr.call(this,this.value,true);
|
||||
}
|
||||
this._refreshState();
|
||||
}
|
||||
}
|
||||
},_onBlur:function(){
|
||||
this._hideResultList();
|
||||
this.inherited(arguments);
|
||||
},_setItemAttr:function(_18,_19,_1a){
|
||||
if(!_1a){
|
||||
_1a=this.labelFunc(_18,this.store);
|
||||
}
|
||||
this.value=this._getValueField()!=this.searchAttr?this.store.getIdentity(_18):_1a;
|
||||
this.item=_18;
|
||||
dijit.form.ComboBox.superclass._setValueAttr.call(this,this.value,_19,_1a);
|
||||
},_announceOption:function(_1b){
|
||||
if(!_1b){
|
||||
return;
|
||||
}
|
||||
var _1c;
|
||||
if(_1b==this._popupWidget.nextButton||_1b==this._popupWidget.previousButton){
|
||||
_1c=_1b.innerHTML;
|
||||
this.item=undefined;
|
||||
this.value="";
|
||||
}else{
|
||||
_1c=this.labelFunc(_1b.item,this.store);
|
||||
this.set("item",_1b.item,false,_1c);
|
||||
}
|
||||
this.focusNode.value=this.focusNode.value.substring(0,this._lastInput.length);
|
||||
dijit.setWaiState(this.focusNode,"activedescendant",dojo.attr(_1b,"id"));
|
||||
this._autoCompleteText(_1c);
|
||||
},_selectOption:function(evt){
|
||||
if(evt){
|
||||
this._announceOption(evt.target);
|
||||
}
|
||||
this._hideResultList();
|
||||
this._setCaretPos(this.focusNode,this.focusNode.value.length);
|
||||
dijit.form._FormValueWidget.prototype._setValueAttr.call(this,this.value,true);
|
||||
},_onArrowMouseDown:function(evt){
|
||||
if(this.disabled||this.readOnly){
|
||||
return;
|
||||
}
|
||||
dojo.stopEvent(evt);
|
||||
this.focus();
|
||||
if(this._isShowingNow){
|
||||
this._hideResultList();
|
||||
}else{
|
||||
this._startSearchAll();
|
||||
}
|
||||
},_startSearchAll:function(){
|
||||
this._startSearch("");
|
||||
},_startSearchFromInput:function(){
|
||||
this._startSearch(this.focusNode.value.replace(/([\\\*\?])/g,"\\$1"));
|
||||
},_getQueryString:function(_1d){
|
||||
return dojo.string.substitute(this.queryExpr,[_1d]);
|
||||
},_startSearch:function(key){
|
||||
if(!this._popupWidget){
|
||||
var _1e=this.id+"_popup";
|
||||
this._popupWidget=new dijit.form._ComboBoxMenu({onChange:dojo.hitch(this,this._selectOption),id:_1e,dir:this.dir});
|
||||
dijit.removeWaiState(this.focusNode,"activedescendant");
|
||||
dijit.setWaiState(this.textbox,"owns",_1e);
|
||||
}
|
||||
var _1f=dojo.clone(this.query);
|
||||
this._lastInput=key;
|
||||
this._lastQuery=_1f[this.searchAttr]=this._getQueryString(key);
|
||||
this.searchTimer=setTimeout(dojo.hitch(this,function(_20,_21){
|
||||
this.searchTimer=null;
|
||||
var _22={queryOptions:{ignoreCase:this.ignoreCase,deep:true},query:_20,onBegin:dojo.hitch(this,"_setMaxOptions"),onComplete:dojo.hitch(this,"_openResultList"),onError:function(_23){
|
||||
_21._fetchHandle=null;
|
||||
console.error("dijit.form.ComboBox: "+_23);
|
||||
dojo.hitch(_21,"_hideResultList")();
|
||||
},start:0,count:this.pageSize};
|
||||
dojo.mixin(_22,_21.fetchProperties);
|
||||
this._fetchHandle=_21.store.fetch(_22);
|
||||
var _24=function(_25,_26){
|
||||
_25.start+=_25.count*_26;
|
||||
_25.direction=_26;
|
||||
this._fetchHandle=this.store.fetch(_25);
|
||||
};
|
||||
this._nextSearch=this._popupWidget.onPage=dojo.hitch(this,_24,this._fetchHandle);
|
||||
},_1f,this),this.searchDelay);
|
||||
},_setMaxOptions:function(_27,_28){
|
||||
this._maxOptions=_27;
|
||||
},_getValueField:function(){
|
||||
return this.searchAttr;
|
||||
},compositionend:function(evt){
|
||||
this._onKeyPress({charOrCode:229});
|
||||
},constructor:function(){
|
||||
this.query={};
|
||||
this.fetchProperties={};
|
||||
},postMixInProperties:function(){
|
||||
if(!this.store){
|
||||
var _29=this.srcNodeRef;
|
||||
this.store=new dijit.form._ComboBoxDataStore(_29);
|
||||
if(!("value" in this.params)){
|
||||
var _2a=this.store.fetchSelectedItem();
|
||||
if(_2a){
|
||||
var _2b=this._getValueField();
|
||||
this.value=_2b!=this.searchAttr?this.store.getValue(_2a,_2b):this.labelFunc(_2a,this.store);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.inherited(arguments);
|
||||
},postCreate:function(){
|
||||
if(!this.hasDownArrow){
|
||||
this.downArrowNode.style.display="none";
|
||||
}
|
||||
var _2c=dojo.query("label[for=\""+this.id+"\"]");
|
||||
if(_2c.length){
|
||||
_2c[0].id=(this.id+"_label");
|
||||
var cn=this.comboNode;
|
||||
dijit.setWaiState(cn,"labelledby",_2c[0].id);
|
||||
}
|
||||
this.inherited(arguments);
|
||||
},uninitialize:function(){
|
||||
if(this._popupWidget&&!this._popupWidget._destroyed){
|
||||
this._hideResultList();
|
||||
this._popupWidget.destroy();
|
||||
}
|
||||
this.inherited(arguments);
|
||||
},_getMenuLabelFromItem:function(_2d){
|
||||
var _2e=this.labelAttr?this.store.getValue(_2d,this.labelAttr):this.labelFunc(_2d,this.store);
|
||||
var _2f=this.labelType;
|
||||
if(this.highlightMatch!="none"&&this.labelType=="text"&&this._lastInput){
|
||||
_2e=this.doHighlight(_2e,this._escapeHtml(this._lastInput));
|
||||
_2f="html";
|
||||
}
|
||||
return {html:_2f=="html",label:_2e};
|
||||
},doHighlight:function(_30,_31){
|
||||
var _32="i"+(this.highlightMatch=="all"?"g":"");
|
||||
var _33=this._escapeHtml(_30);
|
||||
_31=dojo.regexp.escapeString(_31);
|
||||
var ret=_33.replace(new RegExp("(^|\\s)("+_31+")",_32),"$1<span class=\"dijitComboBoxHighlightMatch\">$2</span>");
|
||||
return ret;
|
||||
},_escapeHtml:function(str){
|
||||
str=String(str).replace(/&/gm,"&").replace(/</gm,"<").replace(/>/gm,">").replace(/"/gm,""");
|
||||
return str;
|
||||
},open:function(){
|
||||
this._isShowingNow=true;
|
||||
return dijit.popup.open({popup:this._popupWidget,around:this.domNode,parent:this});
|
||||
},reset:function(){
|
||||
this.item=null;
|
||||
this.inherited(arguments);
|
||||
},labelFunc:function(_34,_35){
|
||||
return _35.getValue(_34,this.searchAttr).toString();
|
||||
}});
|
||||
dojo.declare("dijit.form._ComboBoxMenu",[dijit._Widget,dijit._Templated,dijit._CssStateMixin],{templateString:"<ul class='dijitReset dijitMenu' dojoAttachEvent='onmousedown:_onMouseDown,onmouseup:_onMouseUp,onmouseover:_onMouseOver,onmouseout:_onMouseOut' tabIndex='-1' style='overflow: \"auto\"; overflow-x: \"hidden\";'>"+"<li class='dijitMenuItem dijitMenuPreviousButton' dojoAttachPoint='previousButton' waiRole='option'></li>"+"<li class='dijitMenuItem dijitMenuNextButton' dojoAttachPoint='nextButton' waiRole='option'></li>"+"</ul>",_messages:null,baseClass:"dijitComboBoxMenu",postMixInProperties:function(){
|
||||
this._messages=dojo.i18n.getLocalization("dijit.form","ComboBox",this.lang);
|
||||
this.inherited(arguments);
|
||||
},_setValueAttr:function(_36){
|
||||
this.value=_36;
|
||||
this.onChange(_36);
|
||||
},onChange:function(_37){
|
||||
},onPage:function(_38){
|
||||
},postCreate:function(){
|
||||
this.previousButton.innerHTML=this._messages["previousMessage"];
|
||||
this.nextButton.innerHTML=this._messages["nextMessage"];
|
||||
this.inherited(arguments);
|
||||
},onClose:function(){
|
||||
this._blurOptionNode();
|
||||
},_createOption:function(_39,_3a){
|
||||
var _3b=_3a(_39);
|
||||
var _3c=dojo.doc.createElement("li");
|
||||
dijit.setWaiRole(_3c,"option");
|
||||
if(_3b.html){
|
||||
_3c.innerHTML=_3b.label;
|
||||
}else{
|
||||
_3c.appendChild(dojo.doc.createTextNode(_3b.label));
|
||||
}
|
||||
if(_3c.innerHTML==""){
|
||||
_3c.innerHTML=" ";
|
||||
}
|
||||
_3c.item=_39;
|
||||
return _3c;
|
||||
},createOptions:function(_3d,_3e,_3f){
|
||||
this.previousButton.style.display=(_3e.start==0)?"none":"";
|
||||
dojo.attr(this.previousButton,"id",this.id+"_prev");
|
||||
dojo.forEach(_3d,function(_40,i){
|
||||
var _41=this._createOption(_40,_3f);
|
||||
_41.className="dijitReset dijitMenuItem"+(this.isLeftToRight()?"":" dijitMenuItemRtl");
|
||||
dojo.attr(_41,"id",this.id+i);
|
||||
this.domNode.insertBefore(_41,this.nextButton);
|
||||
},this);
|
||||
var _42=false;
|
||||
if(_3e._maxOptions&&_3e._maxOptions!=-1){
|
||||
if((_3e.start+_3e.count)<_3e._maxOptions){
|
||||
_42=true;
|
||||
}else{
|
||||
if((_3e.start+_3e.count)>_3e._maxOptions&&_3e.count==_3d.length){
|
||||
_42=true;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(_3e.count==_3d.length){
|
||||
_42=true;
|
||||
}
|
||||
}
|
||||
this.nextButton.style.display=_42?"":"none";
|
||||
dojo.attr(this.nextButton,"id",this.id+"_next");
|
||||
return this.domNode.childNodes;
|
||||
},clearResultList:function(){
|
||||
while(this.domNode.childNodes.length>2){
|
||||
this.domNode.removeChild(this.domNode.childNodes[this.domNode.childNodes.length-2]);
|
||||
}
|
||||
},_onMouseDown:function(evt){
|
||||
dojo.stopEvent(evt);
|
||||
},_onMouseUp:function(evt){
|
||||
if(evt.target===this.domNode||!this._highlighted_option){
|
||||
return;
|
||||
}else{
|
||||
if(evt.target==this.previousButton){
|
||||
this.onPage(-1);
|
||||
}else{
|
||||
if(evt.target==this.nextButton){
|
||||
this.onPage(1);
|
||||
}else{
|
||||
var tgt=evt.target;
|
||||
while(!tgt.item){
|
||||
tgt=tgt.parentNode;
|
||||
}
|
||||
this._setValueAttr({target:tgt},true);
|
||||
}
|
||||
}
|
||||
}
|
||||
},_onMouseOver:function(evt){
|
||||
if(evt.target===this.domNode){
|
||||
return;
|
||||
}
|
||||
var tgt=evt.target;
|
||||
if(!(tgt==this.previousButton||tgt==this.nextButton)){
|
||||
while(!tgt.item){
|
||||
tgt=tgt.parentNode;
|
||||
}
|
||||
}
|
||||
this._focusOptionNode(tgt);
|
||||
},_onMouseOut:function(evt){
|
||||
if(evt.target===this.domNode){
|
||||
return;
|
||||
}
|
||||
this._blurOptionNode();
|
||||
},_focusOptionNode:function(_43){
|
||||
if(this._highlighted_option!=_43){
|
||||
this._blurOptionNode();
|
||||
this._highlighted_option=_43;
|
||||
dojo.addClass(this._highlighted_option,"dijitMenuItemSelected");
|
||||
}
|
||||
},_blurOptionNode:function(){
|
||||
if(this._highlighted_option){
|
||||
dojo.removeClass(this._highlighted_option,"dijitMenuItemSelected");
|
||||
this._highlighted_option=null;
|
||||
}
|
||||
},_highlightNextOption:function(){
|
||||
if(!this.getHighlightedOption()){
|
||||
var fc=this.domNode.firstChild;
|
||||
this._focusOptionNode(fc.style.display=="none"?fc.nextSibling:fc);
|
||||
}else{
|
||||
var ns=this._highlighted_option.nextSibling;
|
||||
if(ns&&ns.style.display!="none"){
|
||||
this._focusOptionNode(ns);
|
||||
}else{
|
||||
this.highlightFirstOption();
|
||||
}
|
||||
}
|
||||
dojo.window.scrollIntoView(this._highlighted_option);
|
||||
},highlightFirstOption:function(){
|
||||
var _44=this.domNode.firstChild;
|
||||
var _45=_44.nextSibling;
|
||||
this._focusOptionNode(_45.style.display=="none"?_44:_45);
|
||||
dojo.window.scrollIntoView(this._highlighted_option);
|
||||
},highlightLastOption:function(){
|
||||
this._focusOptionNode(this.domNode.lastChild.previousSibling);
|
||||
dojo.window.scrollIntoView(this._highlighted_option);
|
||||
},_highlightPrevOption:function(){
|
||||
if(!this.getHighlightedOption()){
|
||||
var lc=this.domNode.lastChild;
|
||||
this._focusOptionNode(lc.style.display=="none"?lc.previousSibling:lc);
|
||||
}else{
|
||||
var ps=this._highlighted_option.previousSibling;
|
||||
if(ps&&ps.style.display!="none"){
|
||||
this._focusOptionNode(ps);
|
||||
}else{
|
||||
this.highlightLastOption();
|
||||
}
|
||||
}
|
||||
dojo.window.scrollIntoView(this._highlighted_option);
|
||||
},_page:function(up){
|
||||
var _46=0;
|
||||
var _47=this.domNode.scrollTop;
|
||||
var _48=dojo.style(this.domNode,"height");
|
||||
if(!this.getHighlightedOption()){
|
||||
this._highlightNextOption();
|
||||
}
|
||||
while(_46<_48){
|
||||
if(up){
|
||||
if(!this.getHighlightedOption().previousSibling||this._highlighted_option.previousSibling.style.display=="none"){
|
||||
break;
|
||||
}
|
||||
this._highlightPrevOption();
|
||||
}else{
|
||||
if(!this.getHighlightedOption().nextSibling||this._highlighted_option.nextSibling.style.display=="none"){
|
||||
break;
|
||||
}
|
||||
this._highlightNextOption();
|
||||
}
|
||||
var _49=this.domNode.scrollTop;
|
||||
_46+=(_49-_47)*(up?-1:1);
|
||||
_47=_49;
|
||||
}
|
||||
},pageUp:function(){
|
||||
this._page(true);
|
||||
},pageDown:function(){
|
||||
this._page(false);
|
||||
},getHighlightedOption:function(){
|
||||
var ho=this._highlighted_option;
|
||||
return (ho&&ho.parentNode)?ho:null;
|
||||
},handleKey:function(key){
|
||||
switch(key){
|
||||
case dojo.keys.DOWN_ARROW:
|
||||
this._highlightNextOption();
|
||||
break;
|
||||
case dojo.keys.PAGE_DOWN:
|
||||
this.pageDown();
|
||||
break;
|
||||
case dojo.keys.UP_ARROW:
|
||||
this._highlightPrevOption();
|
||||
break;
|
||||
case dojo.keys.PAGE_UP:
|
||||
this.pageUp();
|
||||
break;
|
||||
}
|
||||
}});
|
||||
dojo.declare("dijit.form.ComboBox",[dijit.form.ValidationTextBox,dijit.form.ComboBoxMixin],{_setValueAttr:function(_4a,_4b,_4c){
|
||||
this.item=null;
|
||||
if(!_4a){
|
||||
_4a="";
|
||||
}
|
||||
dijit.form.ValidationTextBox.prototype._setValueAttr.call(this,_4a,_4b,_4c);
|
||||
}});
|
||||
dojo.declare("dijit.form._ComboBoxDataStore",null,{constructor:function(_4d){
|
||||
this.root=_4d;
|
||||
if(_4d.tagName!="SELECT"&&_4d.firstChild){
|
||||
_4d=dojo.query("select",_4d);
|
||||
if(_4d.length>0){
|
||||
_4d=_4d[0];
|
||||
}else{
|
||||
this.root.innerHTML="<SELECT>"+this.root.innerHTML+"</SELECT>";
|
||||
_4d=this.root.firstChild;
|
||||
}
|
||||
this.root=_4d;
|
||||
}
|
||||
dojo.query("> option",_4d).forEach(function(_4e){
|
||||
_4e.innerHTML=dojo.trim(_4e.innerHTML);
|
||||
});
|
||||
},getValue:function(_4f,_50,_51){
|
||||
return (_50=="value")?_4f.value:(_4f.innerText||_4f.textContent||"");
|
||||
},isItemLoaded:function(_52){
|
||||
return true;
|
||||
},getFeatures:function(){
|
||||
return {"dojo.data.api.Read":true,"dojo.data.api.Identity":true};
|
||||
},_fetchItems:function(_53,_54,_55){
|
||||
if(!_53.query){
|
||||
_53.query={};
|
||||
}
|
||||
if(!_53.query.name){
|
||||
_53.query.name="";
|
||||
}
|
||||
if(!_53.queryOptions){
|
||||
_53.queryOptions={};
|
||||
}
|
||||
var _56=dojo.data.util.filter.patternToRegExp(_53.query.name,_53.queryOptions.ignoreCase),_57=dojo.query("> option",this.root).filter(function(_58){
|
||||
return (_58.innerText||_58.textContent||"").match(_56);
|
||||
});
|
||||
if(_53.sort){
|
||||
_57.sort(dojo.data.util.sorter.createSortFunction(_53.sort,this));
|
||||
}
|
||||
_54(_57,_53);
|
||||
},close:function(_59){
|
||||
return;
|
||||
},getLabel:function(_5a){
|
||||
return _5a.innerHTML;
|
||||
},getIdentity:function(_5b){
|
||||
return dojo.attr(_5b,"value");
|
||||
},fetchItemByIdentity:function(_5c){
|
||||
var _5d=dojo.query("> option[value='"+_5c.identity+"']",this.root)[0];
|
||||
_5c.onItem(_5d);
|
||||
},fetchSelectedItem:function(){
|
||||
var _5e=this.root,si=_5e.selectedIndex;
|
||||
return typeof si=="number"?dojo.query("> option:nth-child("+(si!=-1?si+1:1)+")",_5e)[0]:null;
|
||||
}});
|
||||
dojo.extend(dijit.form._ComboBoxDataStore,dojo.data.util.simpleFetch);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
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.ComboButton"]){
|
||||
dojo._hasResource["dijit.form.ComboButton"]=true;
|
||||
dojo.provide("dijit.form.ComboButton");
|
||||
dojo.require("dijit.form.Button");
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
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.CurrencyTextBox"]){
|
||||
dojo._hasResource["dijit.form.CurrencyTextBox"]=true;
|
||||
dojo.provide("dijit.form.CurrencyTextBox");
|
||||
dojo.require("dojo.currency");
|
||||
dojo.require("dijit.form.NumberTextBox");
|
||||
dojo.declare("dijit.form.CurrencyTextBox",dijit.form.NumberTextBox,{currency:"",baseClass:"dijitTextBox dijitCurrencyTextBox",regExpGen:function(_1){
|
||||
return "("+(this._focused?this.inherited(arguments,[dojo.mixin({},_1,this.editOptions)])+"|":"")+dojo.currency.regexp(_1)+")";
|
||||
},_formatter:dojo.currency.format,parse:function(_2,_3){
|
||||
var v=dojo.currency.parse(_2,_3);
|
||||
if(isNaN(v)&&/\d+/.test(_2)){
|
||||
return this.inherited(arguments,[_2,dojo.mixin({},_3,this.editOptions)]);
|
||||
}
|
||||
return v;
|
||||
},_setConstraintsAttr:function(_4){
|
||||
if(!_4.currency&&this.currency){
|
||||
_4.currency=this.currency;
|
||||
}
|
||||
this.inherited(arguments,[dojo.currency._mixInDefaults(dojo.mixin(_4,{exponent:false}))]);
|
||||
}});
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
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.DateTextBox"]){
|
||||
dojo._hasResource["dijit.form.DateTextBox"]=true;
|
||||
dojo.provide("dijit.form.DateTextBox");
|
||||
dojo.require("dijit.Calendar");
|
||||
dojo.require("dijit.form._DateTimeTextBox");
|
||||
dojo.declare("dijit.form.DateTextBox",dijit.form._DateTimeTextBox,{baseClass:"dijitTextBox dijitDateTextBox",popupClass:"dijit.Calendar",_selector:"date",value:new Date("")});
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
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.DropDownButton"]){
|
||||
dojo._hasResource["dijit.form.DropDownButton"]=true;
|
||||
dojo.provide("dijit.form.DropDownButton");
|
||||
dojo.require("dijit.form.Button");
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
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);
|
||||
}});
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
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.Form"]){
|
||||
dojo._hasResource["dijit.form.Form"]=true;
|
||||
dojo.provide("dijit.form.Form");
|
||||
dojo.require("dijit._Widget");
|
||||
dojo.require("dijit._Templated");
|
||||
dojo.require("dijit.form._FormMixin");
|
||||
dojo.declare("dijit.form.Form",[dijit._Widget,dijit._Templated,dijit.form._FormMixin],{name:"",action:"",method:"",encType:"","accept-charset":"",accept:"",target:"",templateString:"<form dojoAttachPoint='containerNode' dojoAttachEvent='onreset:_onReset,onsubmit:_onSubmit' ${!nameAttrSetting}></form>",attributeMap:dojo.delegate(dijit._Widget.prototype.attributeMap,{action:"",method:"",encType:"","accept-charset":"",accept:"",target:""}),postMixInProperties:function(){
|
||||
this.nameAttrSetting=this.name?("name='"+this.name+"'"):"";
|
||||
this.inherited(arguments);
|
||||
},execute:function(_1){
|
||||
},onExecute:function(){
|
||||
},_setEncTypeAttr:function(_2){
|
||||
this.encType=_2;
|
||||
dojo.attr(this.domNode,"encType",_2);
|
||||
if(dojo.isIE){
|
||||
this.domNode.encoding=_2;
|
||||
}
|
||||
},postCreate:function(){
|
||||
if(dojo.isIE&&this.srcNodeRef&&this.srcNodeRef.attributes){
|
||||
var _3=this.srcNodeRef.attributes.getNamedItem("encType");
|
||||
if(_3&&!_3.specified&&(typeof _3.value=="string")){
|
||||
this.set("encType",_3.value);
|
||||
}
|
||||
}
|
||||
this.inherited(arguments);
|
||||
},reset:function(e){
|
||||
var _4={returnValue:true,preventDefault:function(){
|
||||
this.returnValue=false;
|
||||
},stopPropagation:function(){
|
||||
},currentTarget:e?e.target:this.domNode,target:e?e.target:this.domNode};
|
||||
if(!(this.onReset(_4)===false)&&_4.returnValue){
|
||||
this.inherited(arguments,[]);
|
||||
}
|
||||
},onReset:function(e){
|
||||
return true;
|
||||
},_onReset:function(e){
|
||||
this.reset(e);
|
||||
dojo.stopEvent(e);
|
||||
return false;
|
||||
},_onSubmit:function(e){
|
||||
var fp=dijit.form.Form.prototype;
|
||||
if(this.execute!=fp.execute||this.onExecute!=fp.onExecute){
|
||||
dojo.deprecated("dijit.form.Form:execute()/onExecute() are deprecated. Use onSubmit() instead.","","2.0");
|
||||
this.onExecute();
|
||||
this.execute(this.getValues());
|
||||
}
|
||||
if(this.onSubmit(e)===false){
|
||||
dojo.stopEvent(e);
|
||||
}
|
||||
},onSubmit:function(e){
|
||||
return this.isValid();
|
||||
},submit:function(){
|
||||
if(!(this.onSubmit()===false)){
|
||||
this.containerNode.submit();
|
||||
}
|
||||
}});
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
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.HorizontalRule"]){
|
||||
dojo._hasResource["dijit.form.HorizontalRule"]=true;
|
||||
dojo.provide("dijit.form.HorizontalRule");
|
||||
dojo.require("dijit._Widget");
|
||||
dojo.require("dijit._Templated");
|
||||
dojo.declare("dijit.form.HorizontalRule",[dijit._Widget,dijit._Templated],{templateString:"<div class=\"dijitRuleContainer dijitRuleContainerH\"></div>",count:3,container:"containerNode",ruleStyle:"",_positionPrefix:"<div class=\"dijitRuleMark dijitRuleMarkH\" style=\"left:",_positionSuffix:"%;",_suffix:"\"></div>",_genHTML:function(_1,_2){
|
||||
return this._positionPrefix+_1+this._positionSuffix+this.ruleStyle+this._suffix;
|
||||
},_isHorizontal:true,postCreate:function(){
|
||||
var _3;
|
||||
if(this.count==1){
|
||||
_3=this._genHTML(50,0);
|
||||
}else{
|
||||
var i;
|
||||
var _4=100/(this.count-1);
|
||||
if(!this._isHorizontal||this.isLeftToRight()){
|
||||
_3=this._genHTML(0,0);
|
||||
for(i=1;i<this.count-1;i++){
|
||||
_3+=this._genHTML(_4*i,i);
|
||||
}
|
||||
_3+=this._genHTML(100,this.count-1);
|
||||
}else{
|
||||
_3=this._genHTML(100,0);
|
||||
for(i=1;i<this.count-1;i++){
|
||||
_3+=this._genHTML(100-_4*i,i);
|
||||
}
|
||||
_3+=this._genHTML(0,this.count-1);
|
||||
}
|
||||
}
|
||||
this.domNode.innerHTML=_3;
|
||||
}});
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
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.HorizontalRuleLabels"]){
|
||||
dojo._hasResource["dijit.form.HorizontalRuleLabels"]=true;
|
||||
dojo.provide("dijit.form.HorizontalRuleLabels");
|
||||
dojo.require("dijit.form.HorizontalRule");
|
||||
dojo.declare("dijit.form.HorizontalRuleLabels",dijit.form.HorizontalRule,{templateString:"<div class=\"dijitRuleContainer dijitRuleContainerH dijitRuleLabelsContainer dijitRuleLabelsContainerH\"></div>",labelStyle:"",labels:[],numericMargin:0,minimum:0,maximum:1,constraints:{pattern:"#%"},_positionPrefix:"<div class=\"dijitRuleLabelContainer dijitRuleLabelContainerH\" style=\"left:",_labelPrefix:"\"><div class=\"dijitRuleLabel dijitRuleLabelH\">",_suffix:"</div></div>",_calcPosition:function(_1){
|
||||
return _1;
|
||||
},_genHTML:function(_2,_3){
|
||||
return this._positionPrefix+this._calcPosition(_2)+this._positionSuffix+this.labelStyle+this._labelPrefix+this.labels[_3]+this._suffix;
|
||||
},getLabels:function(){
|
||||
var _4=this.labels;
|
||||
if(!_4.length){
|
||||
_4=dojo.query("> li",this.srcNodeRef).map(function(_5){
|
||||
return String(_5.innerHTML);
|
||||
});
|
||||
}
|
||||
this.srcNodeRef.innerHTML="";
|
||||
if(!_4.length&&this.count>1){
|
||||
var _6=this.minimum;
|
||||
var _7=(this.maximum-_6)/(this.count-1);
|
||||
for(var i=0;i<this.count;i++){
|
||||
_4.push((i<this.numericMargin||i>=(this.count-this.numericMargin))?"":dojo.number.format(_6,this.constraints));
|
||||
_6+=_7;
|
||||
}
|
||||
}
|
||||
return _4;
|
||||
},postMixInProperties:function(){
|
||||
this.inherited(arguments);
|
||||
this.labels=this.getLabels();
|
||||
this.count=this.labels.length;
|
||||
}});
|
||||
}
|
||||
@@ -0,0 +1,209 @@
|
||||
/*
|
||||
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.HorizontalSlider"]){
|
||||
dojo._hasResource["dijit.form.HorizontalSlider"]=true;
|
||||
dojo.provide("dijit.form.HorizontalSlider");
|
||||
dojo.require("dijit.form._FormWidget");
|
||||
dojo.require("dijit._Container");
|
||||
dojo.require("dojo.dnd.move");
|
||||
dojo.require("dijit.form.Button");
|
||||
dojo.require("dojo.number");
|
||||
dojo.require("dojo._base.fx");
|
||||
dojo.declare("dijit.form.HorizontalSlider",[dijit.form._FormValueWidget,dijit._Container],{templateString:dojo.cache("dijit.form","templates/HorizontalSlider.html","<table class=\"dijit dijitReset dijitSlider dijitSliderH\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" rules=\"none\" dojoAttachEvent=\"onkeypress:_onKeyPress,onkeyup:_onKeyUp\"\n\t><tr class=\"dijitReset\"\n\t\t><td class=\"dijitReset\" colspan=\"2\"></td\n\t\t><td dojoAttachPoint=\"topDecoration\" class=\"dijitReset dijitSliderDecoration dijitSliderDecorationT dijitSliderDecorationH\"></td\n\t\t><td class=\"dijitReset\" colspan=\"2\"></td\n\t></tr\n\t><tr class=\"dijitReset\"\n\t\t><td class=\"dijitReset dijitSliderButtonContainer dijitSliderButtonContainerH\"\n\t\t\t><div class=\"dijitSliderDecrementIconH\" tabIndex=\"-1\" style=\"display:none\" dojoAttachPoint=\"decrementButton\"><span class=\"dijitSliderButtonInner\">-</span></div\n\t\t></td\n\t\t><td class=\"dijitReset\"\n\t\t\t><div class=\"dijitSliderBar dijitSliderBumper dijitSliderBumperH dijitSliderLeftBumper\" dojoAttachEvent=\"onmousedown:_onClkDecBumper\"></div\n\t\t></td\n\t\t><td class=\"dijitReset\"\n\t\t\t><input dojoAttachPoint=\"valueNode\" type=\"hidden\" ${!nameAttrSetting}\n\t\t\t/><div class=\"dijitReset dijitSliderBarContainerH\" waiRole=\"presentation\" dojoAttachPoint=\"sliderBarContainer\"\n\t\t\t\t><div waiRole=\"presentation\" dojoAttachPoint=\"progressBar\" class=\"dijitSliderBar dijitSliderBarH dijitSliderProgressBar dijitSliderProgressBarH\" dojoAttachEvent=\"onmousedown:_onBarClick\"\n\t\t\t\t\t><div class=\"dijitSliderMoveable dijitSliderMoveableH\"\n\t\t\t\t\t\t><div dojoAttachPoint=\"sliderHandle,focusNode\" class=\"dijitSliderImageHandle dijitSliderImageHandleH\" dojoAttachEvent=\"onmousedown:_onHandleClick\" waiRole=\"slider\" valuemin=\"${minimum}\" valuemax=\"${maximum}\"></div\n\t\t\t\t\t></div\n\t\t\t\t></div\n\t\t\t\t><div waiRole=\"presentation\" dojoAttachPoint=\"remainingBar\" class=\"dijitSliderBar dijitSliderBarH dijitSliderRemainingBar dijitSliderRemainingBarH\" dojoAttachEvent=\"onmousedown:_onBarClick\"></div\n\t\t\t></div\n\t\t></td\n\t\t><td class=\"dijitReset\"\n\t\t\t><div class=\"dijitSliderBar dijitSliderBumper dijitSliderBumperH dijitSliderRightBumper\" dojoAttachEvent=\"onmousedown:_onClkIncBumper\"></div\n\t\t></td\n\t\t><td class=\"dijitReset dijitSliderButtonContainer dijitSliderButtonContainerH\"\n\t\t\t><div class=\"dijitSliderIncrementIconH\" tabIndex=\"-1\" style=\"display:none\" dojoAttachPoint=\"incrementButton\"><span class=\"dijitSliderButtonInner\">+</span></div\n\t\t></td\n\t></tr\n\t><tr class=\"dijitReset\"\n\t\t><td class=\"dijitReset\" colspan=\"2\"></td\n\t\t><td dojoAttachPoint=\"containerNode,bottomDecoration\" class=\"dijitReset dijitSliderDecoration dijitSliderDecorationB dijitSliderDecorationH\"></td\n\t\t><td class=\"dijitReset\" colspan=\"2\"></td\n\t></tr\n></table>\n"),value:0,showButtons:true,minimum:0,maximum:100,discreteValues:Infinity,pageIncrement:2,clickSelect:true,slideDuration:dijit.defaultDuration,widgetsInTemplate:true,attributeMap:dojo.delegate(dijit.form._FormWidget.prototype.attributeMap,{id:""}),baseClass:"dijitSlider",cssStateNodes:{incrementButton:"dijitSliderIncrementButton",decrementButton:"dijitSliderDecrementButton",focusNode:"dijitSliderThumb"},_mousePixelCoord:"pageX",_pixelCount:"w",_startingPixelCoord:"x",_startingPixelCount:"l",_handleOffsetCoord:"left",_progressPixelSize:"width",_onKeyUp:function(e){
|
||||
if(this.disabled||this.readOnly||e.altKey||e.ctrlKey||e.metaKey){
|
||||
return;
|
||||
}
|
||||
this._setValueAttr(this.value,true);
|
||||
},_onKeyPress:function(e){
|
||||
if(this.disabled||this.readOnly||e.altKey||e.ctrlKey||e.metaKey){
|
||||
return;
|
||||
}
|
||||
switch(e.charOrCode){
|
||||
case dojo.keys.HOME:
|
||||
this._setValueAttr(this.minimum,false);
|
||||
break;
|
||||
case dojo.keys.END:
|
||||
this._setValueAttr(this.maximum,false);
|
||||
break;
|
||||
case ((this._descending||this.isLeftToRight())?dojo.keys.RIGHT_ARROW:dojo.keys.LEFT_ARROW):
|
||||
case (this._descending===false?dojo.keys.DOWN_ARROW:dojo.keys.UP_ARROW):
|
||||
case (this._descending===false?dojo.keys.PAGE_DOWN:dojo.keys.PAGE_UP):
|
||||
this.increment(e);
|
||||
break;
|
||||
case ((this._descending||this.isLeftToRight())?dojo.keys.LEFT_ARROW:dojo.keys.RIGHT_ARROW):
|
||||
case (this._descending===false?dojo.keys.UP_ARROW:dojo.keys.DOWN_ARROW):
|
||||
case (this._descending===false?dojo.keys.PAGE_UP:dojo.keys.PAGE_DOWN):
|
||||
this.decrement(e);
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
dojo.stopEvent(e);
|
||||
},_onHandleClick:function(e){
|
||||
if(this.disabled||this.readOnly){
|
||||
return;
|
||||
}
|
||||
if(!dojo.isIE){
|
||||
dijit.focus(this.sliderHandle);
|
||||
}
|
||||
dojo.stopEvent(e);
|
||||
},_isReversed:function(){
|
||||
return !this.isLeftToRight();
|
||||
},_onBarClick:function(e){
|
||||
if(this.disabled||this.readOnly||!this.clickSelect){
|
||||
return;
|
||||
}
|
||||
dijit.focus(this.sliderHandle);
|
||||
dojo.stopEvent(e);
|
||||
var _1=dojo.position(this.sliderBarContainer,true);
|
||||
var _2=e[this._mousePixelCoord]-_1[this._startingPixelCoord];
|
||||
this._setPixelValue(this._isReversed()?(_1[this._pixelCount]-_2):_2,_1[this._pixelCount],true);
|
||||
this._movable.onMouseDown(e);
|
||||
},_setPixelValue:function(_3,_4,_5){
|
||||
if(this.disabled||this.readOnly){
|
||||
return;
|
||||
}
|
||||
_3=_3<0?0:_4<_3?_4:_3;
|
||||
var _6=this.discreteValues;
|
||||
if(_6<=1||_6==Infinity){
|
||||
_6=_4;
|
||||
}
|
||||
_6--;
|
||||
var _7=_4/_6;
|
||||
var _8=Math.round(_3/_7);
|
||||
this._setValueAttr((this.maximum-this.minimum)*_8/_6+this.minimum,_5);
|
||||
},_setValueAttr:function(_9,_a){
|
||||
this.valueNode.value=this.value=_9;
|
||||
dijit.setWaiState(this.focusNode,"valuenow",_9);
|
||||
this.inherited(arguments);
|
||||
var _b=(_9-this.minimum)/(this.maximum-this.minimum);
|
||||
var _c=(this._descending===false)?this.remainingBar:this.progressBar;
|
||||
var _d=(this._descending===false)?this.progressBar:this.remainingBar;
|
||||
if(this._inProgressAnim&&this._inProgressAnim.status!="stopped"){
|
||||
this._inProgressAnim.stop(true);
|
||||
}
|
||||
if(_a&&this.slideDuration>0&&_c.style[this._progressPixelSize]){
|
||||
var _e=this;
|
||||
var _f={};
|
||||
var _10=parseFloat(_c.style[this._progressPixelSize]);
|
||||
var _11=this.slideDuration*(_b-_10/100);
|
||||
if(_11==0){
|
||||
return;
|
||||
}
|
||||
if(_11<0){
|
||||
_11=0-_11;
|
||||
}
|
||||
_f[this._progressPixelSize]={start:_10,end:_b*100,units:"%"};
|
||||
this._inProgressAnim=dojo.animateProperty({node:_c,duration:_11,onAnimate:function(v){
|
||||
_d.style[_e._progressPixelSize]=(100-parseFloat(v[_e._progressPixelSize]))+"%";
|
||||
},onEnd:function(){
|
||||
delete _e._inProgressAnim;
|
||||
},properties:_f});
|
||||
this._inProgressAnim.play();
|
||||
}else{
|
||||
_c.style[this._progressPixelSize]=(_b*100)+"%";
|
||||
_d.style[this._progressPixelSize]=((1-_b)*100)+"%";
|
||||
}
|
||||
},_bumpValue:function(_12,_13){
|
||||
if(this.disabled||this.readOnly){
|
||||
return;
|
||||
}
|
||||
var s=dojo.getComputedStyle(this.sliderBarContainer);
|
||||
var c=dojo._getContentBox(this.sliderBarContainer,s);
|
||||
var _14=this.discreteValues;
|
||||
if(_14<=1||_14==Infinity){
|
||||
_14=c[this._pixelCount];
|
||||
}
|
||||
_14--;
|
||||
var _15=(this.value-this.minimum)*_14/(this.maximum-this.minimum)+_12;
|
||||
if(_15<0){
|
||||
_15=0;
|
||||
}
|
||||
if(_15>_14){
|
||||
_15=_14;
|
||||
}
|
||||
_15=_15*(this.maximum-this.minimum)/_14+this.minimum;
|
||||
this._setValueAttr(_15,_13);
|
||||
},_onClkBumper:function(val){
|
||||
if(this.disabled||this.readOnly||!this.clickSelect){
|
||||
return;
|
||||
}
|
||||
this._setValueAttr(val,true);
|
||||
},_onClkIncBumper:function(){
|
||||
this._onClkBumper(this._descending===false?this.minimum:this.maximum);
|
||||
},_onClkDecBumper:function(){
|
||||
this._onClkBumper(this._descending===false?this.maximum:this.minimum);
|
||||
},decrement:function(e){
|
||||
this._bumpValue(e.charOrCode==dojo.keys.PAGE_DOWN?-this.pageIncrement:-1);
|
||||
},increment:function(e){
|
||||
this._bumpValue(e.charOrCode==dojo.keys.PAGE_UP?this.pageIncrement:1);
|
||||
},_mouseWheeled:function(evt){
|
||||
dojo.stopEvent(evt);
|
||||
var _16=!dojo.isMozilla;
|
||||
var _17=evt[(_16?"wheelDelta":"detail")]*(_16?1:-1);
|
||||
this._bumpValue(_17<0?-1:1,true);
|
||||
},startup:function(){
|
||||
if(this._started){
|
||||
return;
|
||||
}
|
||||
dojo.forEach(this.getChildren(),function(_18){
|
||||
if(this[_18.container]!=this.containerNode){
|
||||
this[_18.container].appendChild(_18.domNode);
|
||||
}
|
||||
},this);
|
||||
this.inherited(arguments);
|
||||
},_typematicCallback:function(_19,_1a,e){
|
||||
if(_19==-1){
|
||||
this._setValueAttr(this.value,true);
|
||||
}else{
|
||||
this[(_1a==(this._descending?this.incrementButton:this.decrementButton))?"decrement":"increment"](e);
|
||||
}
|
||||
},postCreate:function(){
|
||||
if(this.showButtons){
|
||||
this.incrementButton.style.display="";
|
||||
this.decrementButton.style.display="";
|
||||
this._connects.push(dijit.typematic.addMouseListener(this.decrementButton,this,"_typematicCallback",25,500));
|
||||
this._connects.push(dijit.typematic.addMouseListener(this.incrementButton,this,"_typematicCallback",25,500));
|
||||
}
|
||||
this.connect(this.domNode,!dojo.isMozilla?"onmousewheel":"DOMMouseScroll","_mouseWheeled");
|
||||
var _1b=dojo.declare(dijit.form._SliderMover,{widget:this});
|
||||
this._movable=new dojo.dnd.Moveable(this.sliderHandle,{mover:_1b});
|
||||
var _1c=dojo.query("label[for=\""+this.id+"\"]");
|
||||
if(_1c.length){
|
||||
_1c[0].id=(this.id+"_label");
|
||||
dijit.setWaiState(this.focusNode,"labelledby",_1c[0].id);
|
||||
}
|
||||
dijit.setWaiState(this.focusNode,"valuemin",this.minimum);
|
||||
dijit.setWaiState(this.focusNode,"valuemax",this.maximum);
|
||||
this.inherited(arguments);
|
||||
this._layoutHackIE7();
|
||||
},destroy:function(){
|
||||
this._movable.destroy();
|
||||
if(this._inProgressAnim&&this._inProgressAnim.status!="stopped"){
|
||||
this._inProgressAnim.stop(true);
|
||||
}
|
||||
this._supportingWidgets=dijit.findWidgets(this.domNode);
|
||||
this.inherited(arguments);
|
||||
}});
|
||||
dojo.declare("dijit.form._SliderMover",dojo.dnd.Mover,{onMouseMove:function(e){
|
||||
var _1d=this.widget;
|
||||
var _1e=_1d._abspos;
|
||||
if(!_1e){
|
||||
_1e=_1d._abspos=dojo.position(_1d.sliderBarContainer,true);
|
||||
_1d._setPixelValue_=dojo.hitch(_1d,"_setPixelValue");
|
||||
_1d._isReversed_=_1d._isReversed();
|
||||
}
|
||||
var _1f=e[_1d._mousePixelCoord]-_1e[_1d._startingPixelCoord];
|
||||
_1d._setPixelValue_(_1d._isReversed_?(_1e[_1d._pixelCount]-_1f):_1f,_1e[_1d._pixelCount],false);
|
||||
},destroy:function(e){
|
||||
dojo.dnd.Mover.prototype.destroy.apply(this,arguments);
|
||||
var _20=this.widget;
|
||||
_20._abspos=null;
|
||||
_20._setValueAttr(_20.value,true);
|
||||
}});
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
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.MappedTextBox"]){
|
||||
dojo._hasResource["dijit.form.MappedTextBox"]=true;
|
||||
dojo.provide("dijit.form.MappedTextBox");
|
||||
dojo.require("dijit.form.ValidationTextBox");
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
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.MultiSelect"]){
|
||||
dojo._hasResource["dijit.form.MultiSelect"]=true;
|
||||
dojo.provide("dijit.form.MultiSelect");
|
||||
dojo.require("dijit.form._FormWidget");
|
||||
dojo.declare("dijit.form.MultiSelect",dijit.form._FormValueWidget,{size:7,templateString:"<select multiple='true' ${!nameAttrSetting} dojoAttachPoint='containerNode,focusNode' dojoAttachEvent='onchange: _onChange'></select>",attributeMap:dojo.delegate(dijit.form._FormWidget.prototype.attributeMap,{size:"focusNode"}),reset:function(){
|
||||
this._hasBeenBlurred=false;
|
||||
this._setValueAttr(this._resetValue,true);
|
||||
},addSelected:function(_1){
|
||||
_1.getSelected().forEach(function(n){
|
||||
this.containerNode.appendChild(n);
|
||||
this.domNode.scrollTop=this.domNode.offsetHeight;
|
||||
var _2=_1.domNode.scrollTop;
|
||||
_1.domNode.scrollTop=0;
|
||||
_1.domNode.scrollTop=_2;
|
||||
},this);
|
||||
},getSelected:function(){
|
||||
return dojo.query("option",this.containerNode).filter(function(n){
|
||||
return n.selected;
|
||||
});
|
||||
},_getValueAttr:function(){
|
||||
return this.getSelected().map(function(n){
|
||||
return n.value;
|
||||
});
|
||||
},multiple:true,_setValueAttr:function(_3){
|
||||
dojo.query("option",this.containerNode).forEach(function(n){
|
||||
n.selected=(dojo.indexOf(_3,n.value)!=-1);
|
||||
});
|
||||
},invertSelection:function(_4){
|
||||
dojo.query("option",this.containerNode).forEach(function(n){
|
||||
n.selected=!n.selected;
|
||||
});
|
||||
this._handleOnChange(this.get("value"),_4==true);
|
||||
},_onChange:function(e){
|
||||
this._handleOnChange(this.get("value"),true);
|
||||
},resize:function(_5){
|
||||
if(_5){
|
||||
dojo.marginBox(this.domNode,_5);
|
||||
}
|
||||
},postCreate:function(){
|
||||
this._onChange();
|
||||
}});
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
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.NumberSpinner"]){
|
||||
dojo._hasResource["dijit.form.NumberSpinner"]=true;
|
||||
dojo.provide("dijit.form.NumberSpinner");
|
||||
dojo.require("dijit.form._Spinner");
|
||||
dojo.require("dijit.form.NumberTextBox");
|
||||
dojo.declare("dijit.form.NumberSpinner",[dijit.form._Spinner,dijit.form.NumberTextBoxMixin],{adjust:function(_1,_2){
|
||||
var tc=this.constraints,v=isNaN(_1),_3=!isNaN(tc.max),_4=!isNaN(tc.min);
|
||||
if(v&&_2!=0){
|
||||
_1=(_2>0)?_4?tc.min:_3?tc.max:0:_3?this.constraints.max:_4?tc.min:0;
|
||||
}
|
||||
var _5=_1+_2;
|
||||
if(v||isNaN(_5)){
|
||||
return _1;
|
||||
}
|
||||
if(_3&&(_5>tc.max)){
|
||||
_5=tc.max;
|
||||
}
|
||||
if(_4&&(_5<tc.min)){
|
||||
_5=tc.min;
|
||||
}
|
||||
return _5;
|
||||
},_onKeyPress:function(e){
|
||||
if((e.charOrCode==dojo.keys.HOME||e.charOrCode==dojo.keys.END)&&!(e.ctrlKey||e.altKey||e.metaKey)&&typeof this.get("value")!="undefined"){
|
||||
var _6=this.constraints[(e.charOrCode==dojo.keys.HOME?"min":"max")];
|
||||
if(typeof _6=="number"){
|
||||
this._setValueAttr(_6,false);
|
||||
}
|
||||
dojo.stopEvent(e);
|
||||
}
|
||||
}});
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
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.NumberTextBox"]){
|
||||
dojo._hasResource["dijit.form.NumberTextBox"]=true;
|
||||
dojo.provide("dijit.form.NumberTextBox");
|
||||
dojo.require("dijit.form.ValidationTextBox");
|
||||
dojo.require("dojo.number");
|
||||
dojo.declare("dijit.form.NumberTextBoxMixin",null,{regExpGen:dojo.number.regexp,value:NaN,editOptions:{pattern:"#.######"},_formatter:dojo.number.format,_setConstraintsAttr:function(_1){
|
||||
var _2=typeof _1.places=="number"?_1.places:0;
|
||||
if(_2){
|
||||
_2++;
|
||||
}
|
||||
if(typeof _1.max!="number"){
|
||||
_1.max=9*Math.pow(10,15-_2);
|
||||
}
|
||||
if(typeof _1.min!="number"){
|
||||
_1.min=-9*Math.pow(10,15-_2);
|
||||
}
|
||||
this.inherited(arguments,[_1]);
|
||||
if(this.focusNode&&this.focusNode.value&&!isNaN(this.value)){
|
||||
this.set("value",this.value);
|
||||
}
|
||||
},_onFocus:function(){
|
||||
if(this.disabled){
|
||||
return;
|
||||
}
|
||||
var _3=this.get("value");
|
||||
if(typeof _3=="number"&&!isNaN(_3)){
|
||||
var _4=this.format(_3,this.constraints);
|
||||
if(_4!==undefined){
|
||||
this.textbox.value=_4;
|
||||
}
|
||||
}
|
||||
this.inherited(arguments);
|
||||
},format:function(_5,_6){
|
||||
var _7=String(_5);
|
||||
if(typeof _5!="number"){
|
||||
return _7;
|
||||
}
|
||||
if(isNaN(_5)){
|
||||
return "";
|
||||
}
|
||||
if(!("rangeCheck" in this&&this.rangeCheck(_5,_6))&&_6.exponent!==false&&/\de[-+]?\d/i.test(_7)){
|
||||
return _7;
|
||||
}
|
||||
if(this.editOptions&&this._focused){
|
||||
_6=dojo.mixin({},_6,this.editOptions);
|
||||
}
|
||||
return this._formatter(_5,_6);
|
||||
},parse:dojo.number.parse,_getDisplayedValueAttr:function(){
|
||||
var v=this.inherited(arguments);
|
||||
return isNaN(v)?this.textbox.value:v;
|
||||
},filter:function(_8){
|
||||
return (_8===null||_8===""||_8===undefined)?NaN:this.inherited(arguments);
|
||||
},serialize:function(_9,_a){
|
||||
return (typeof _9!="number"||isNaN(_9))?"":this.inherited(arguments);
|
||||
},_setValueAttr:function(_b,_c,_d){
|
||||
if(_b!==undefined&&_d===undefined){
|
||||
_d=String(_b);
|
||||
if(typeof _b=="number"){
|
||||
if(isNaN(_b)){
|
||||
_d="";
|
||||
}else{
|
||||
if(("rangeCheck" in this&&this.rangeCheck(_b,this.constraints))||this.constraints.exponent===false||!/\de[-+]?\d/i.test(_d)){
|
||||
_d=undefined;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(!_b){
|
||||
_d="";
|
||||
_b=NaN;
|
||||
}else{
|
||||
_b=undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.inherited(arguments,[_b,_c,_d]);
|
||||
},_getValueAttr:function(){
|
||||
var v=this.inherited(arguments);
|
||||
if(isNaN(v)&&this.textbox.value!==""){
|
||||
if(this.constraints.exponent!==false&&/\de[-+]?\d/i.test(this.textbox.value)&&(new RegExp("^"+dojo.number._realNumberRegexp(dojo.mixin({},this.constraints))+"$").test(this.textbox.value))){
|
||||
var n=Number(this.textbox.value);
|
||||
return isNaN(n)?undefined:n;
|
||||
}else{
|
||||
return undefined;
|
||||
}
|
||||
}else{
|
||||
return v;
|
||||
}
|
||||
},isValid:function(_e){
|
||||
if(!this._focused||this._isEmpty(this.textbox.value)){
|
||||
return this.inherited(arguments);
|
||||
}else{
|
||||
var v=this.get("value");
|
||||
if(!isNaN(v)&&this.rangeCheck(v,this.constraints)){
|
||||
if(this.constraints.exponent!==false&&/\de[-+]?\d/i.test(this.textbox.value)){
|
||||
return true;
|
||||
}else{
|
||||
return this.inherited(arguments);
|
||||
}
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}});
|
||||
dojo.declare("dijit.form.NumberTextBox",[dijit.form.RangeBoundTextBox,dijit.form.NumberTextBoxMixin],{});
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
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.RadioButton"]){
|
||||
dojo._hasResource["dijit.form.RadioButton"]=true;
|
||||
dojo.provide("dijit.form.RadioButton");
|
||||
dojo.require("dijit.form.CheckBox");
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
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.RangeBoundTextBox"]){
|
||||
dojo._hasResource["dijit.form.RangeBoundTextBox"]=true;
|
||||
dojo.provide("dijit.form.RangeBoundTextBox");
|
||||
dojo.require("dijit.form.ValidationTextBox");
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
/*
|
||||
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.Select"]){
|
||||
dojo._hasResource["dijit.form.Select"]=true;
|
||||
dojo.provide("dijit.form.Select");
|
||||
dojo.require("dijit.form._FormSelectWidget");
|
||||
dojo.require("dijit._HasDropDown");
|
||||
dojo.require("dijit.Menu");
|
||||
dojo.require("dijit.Tooltip");
|
||||
dojo.requireLocalization("dijit.form","validate",null,"ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw");
|
||||
dojo.declare("dijit.form._SelectMenu",dijit.Menu,{buildRendering:function(){
|
||||
this.inherited(arguments);
|
||||
var o=(this.menuTableNode=this.domNode);
|
||||
var n=(this.domNode=dojo.create("div",{style:{overflowX:"hidden",overflowY:"scroll"}}));
|
||||
if(o.parentNode){
|
||||
o.parentNode.replaceChild(n,o);
|
||||
}
|
||||
dojo.removeClass(o,"dijitMenuTable");
|
||||
n.className=o.className+" dijitSelectMenu";
|
||||
o.className="dijitReset dijitMenuTable";
|
||||
dijit.setWaiRole(o,"listbox");
|
||||
dijit.setWaiRole(n,"presentation");
|
||||
n.appendChild(o);
|
||||
},resize:function(mb){
|
||||
if(mb){
|
||||
dojo.marginBox(this.domNode,mb);
|
||||
if("w" in mb){
|
||||
this.menuTableNode.style.width="100%";
|
||||
}
|
||||
}
|
||||
}});
|
||||
dojo.declare("dijit.form.Select",[dijit.form._FormSelectWidget,dijit._HasDropDown],{baseClass:"dijitSelect",templateString:dojo.cache("dijit.form","templates/Select.html","<table class=\"dijit dijitReset dijitInline dijitLeft\"\n\tdojoAttachPoint=\"_buttonNode,tableNode,focusNode\" cellspacing='0' cellpadding='0'\n\twaiRole=\"combobox\" waiState=\"haspopup-true\"\n\t><tbody waiRole=\"presentation\"><tr waiRole=\"presentation\"\n\t\t><td class=\"dijitReset dijitStretch dijitButtonContents dijitButtonNode\" waiRole=\"presentation\"\n\t\t\t><span class=\"dijitReset dijitInline dijitButtonText\" dojoAttachPoint=\"containerNode,_popupStateNode\"></span\n\t\t\t><input type=\"hidden\" ${!nameAttrSetting} dojoAttachPoint=\"valueNode\" value=\"${value}\" waiState=\"hidden-true\"\n\t\t/></td><td class=\"dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton\"\n\t\t\t\tdojoAttachPoint=\"titleNode\" waiRole=\"presentation\"\n\t\t\t><div class=\"dijitReset dijitArrowButtonInner\" waiRole=\"presentation\"></div\n\t\t\t><div class=\"dijitReset dijitArrowButtonChar\" waiRole=\"presentation\">▼</div\n\t\t></td\n\t></tr></tbody\n></table>\n"),attributeMap:dojo.mixin(dojo.clone(dijit.form._FormSelectWidget.prototype.attributeMap),{style:"tableNode"}),required:false,state:"",tooltipPosition:[],emptyLabel:"",_isLoaded:false,_childrenLoaded:false,_fillContent:function(){
|
||||
this.inherited(arguments);
|
||||
if(this.options.length&&!this.value&&this.srcNodeRef){
|
||||
var si=this.srcNodeRef.selectedIndex;
|
||||
this.value=this.options[si!=-1?si:0].value;
|
||||
}
|
||||
this.dropDown=new dijit.form._SelectMenu({id:this.id+"_menu"});
|
||||
dojo.addClass(this.dropDown.domNode,this.baseClass+"Menu");
|
||||
},_getMenuItemForOption:function(_1){
|
||||
if(!_1.value){
|
||||
return new dijit.MenuSeparator();
|
||||
}else{
|
||||
var _2=dojo.hitch(this,"_setValueAttr",_1);
|
||||
var _3=new dijit.MenuItem({option:_1,label:_1.label,onClick:_2,disabled:_1.disabled||false});
|
||||
dijit.setWaiRole(_3.focusNode,"listitem");
|
||||
return _3;
|
||||
}
|
||||
},_addOptionItem:function(_4){
|
||||
if(this.dropDown){
|
||||
this.dropDown.addChild(this._getMenuItemForOption(_4));
|
||||
}
|
||||
},_getChildren:function(){
|
||||
if(!this.dropDown){
|
||||
return [];
|
||||
}
|
||||
return this.dropDown.getChildren();
|
||||
},_loadChildren:function(_5){
|
||||
if(_5===true){
|
||||
if(this.dropDown){
|
||||
delete this.dropDown.focusedChild;
|
||||
}
|
||||
if(this.options.length){
|
||||
this.inherited(arguments);
|
||||
}else{
|
||||
dojo.forEach(this._getChildren(),function(_6){
|
||||
_6.destroyRecursive();
|
||||
});
|
||||
var _7=new dijit.MenuItem({label:" "});
|
||||
this.dropDown.addChild(_7);
|
||||
}
|
||||
}else{
|
||||
this._updateSelection();
|
||||
}
|
||||
var _8=this.options.length;
|
||||
this._isLoaded=false;
|
||||
this._childrenLoaded=true;
|
||||
if(!this._loadingStore){
|
||||
this._setValueAttr(this.value);
|
||||
}
|
||||
},_setValueAttr:function(_9){
|
||||
this.inherited(arguments);
|
||||
dojo.attr(this.valueNode,"value",this.get("value"));
|
||||
},_setDisplay:function(_a){
|
||||
this.containerNode.innerHTML="<span class=\"dijitReset dijitInline "+this.baseClass+"Label\">"+(_a||this.emptyLabel||" ")+"</span>";
|
||||
dijit.setWaiState(this.focusNode,"valuetext",(_a||this.emptyLabel||" "));
|
||||
},validate:function(_b){
|
||||
var _c=this.isValid(_b);
|
||||
this.state=_c?"":"Error";
|
||||
this._setStateClass();
|
||||
dijit.setWaiState(this.focusNode,"invalid",_c?"false":"true");
|
||||
var _d=_c?"":this._missingMsg;
|
||||
if(this._message!==_d){
|
||||
this._message=_d;
|
||||
dijit.hideTooltip(this.domNode);
|
||||
if(_d){
|
||||
dijit.showTooltip(_d,this.domNode,this.tooltipPosition,!this.isLeftToRight());
|
||||
}
|
||||
}
|
||||
return _c;
|
||||
},isValid:function(_e){
|
||||
return (!this.required||!(/^\s*$/.test(this.value)));
|
||||
},reset:function(){
|
||||
this.inherited(arguments);
|
||||
dijit.hideTooltip(this.domNode);
|
||||
this.state="";
|
||||
this._setStateClass();
|
||||
delete this._message;
|
||||
},postMixInProperties:function(){
|
||||
this.inherited(arguments);
|
||||
this._missingMsg=dojo.i18n.getLocalization("dijit.form","validate",this.lang).missingMessage;
|
||||
},postCreate:function(){
|
||||
this.inherited(arguments);
|
||||
if(this.tableNode.style.width){
|
||||
dojo.addClass(this.domNode,this.baseClass+"FixedWidth");
|
||||
}
|
||||
},isLoaded:function(){
|
||||
return this._isLoaded;
|
||||
},loadDropDown:function(_f){
|
||||
this._loadChildren(true);
|
||||
this._isLoaded=true;
|
||||
_f();
|
||||
},closeDropDown:function(){
|
||||
this.inherited(arguments);
|
||||
if(this.dropDown&&this.dropDown.menuTableNode){
|
||||
this.dropDown.menuTableNode.style.width="";
|
||||
}
|
||||
},uninitialize:function(_10){
|
||||
if(this.dropDown&&!this.dropDown._destroyed){
|
||||
this.dropDown.destroyRecursive(_10);
|
||||
delete this.dropDown;
|
||||
}
|
||||
this.inherited(arguments);
|
||||
}});
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
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.SimpleTextarea"]){
|
||||
dojo._hasResource["dijit.form.SimpleTextarea"]=true;
|
||||
dojo.provide("dijit.form.SimpleTextarea");
|
||||
dojo.require("dijit.form.TextBox");
|
||||
dojo.declare("dijit.form.SimpleTextarea",dijit.form.TextBox,{baseClass:"dijitTextBox dijitTextArea",attributeMap:dojo.delegate(dijit.form._FormValueWidget.prototype.attributeMap,{rows:"textbox",cols:"textbox"}),rows:"3",cols:"20",templateString:"<textarea ${!nameAttrSetting} dojoAttachPoint='focusNode,containerNode,textbox' autocomplete='off'></textarea>",postMixInProperties:function(){
|
||||
if(!this.value&&this.srcNodeRef){
|
||||
this.value=this.srcNodeRef.value;
|
||||
}
|
||||
this.inherited(arguments);
|
||||
},filter:function(_1){
|
||||
if(_1){
|
||||
_1=_1.replace(/\r/g,"");
|
||||
}
|
||||
return this.inherited(arguments);
|
||||
},postCreate:function(){
|
||||
this.inherited(arguments);
|
||||
if(dojo.isIE&&this.cols){
|
||||
dojo.addClass(this.textbox,"dijitTextAreaCols");
|
||||
}
|
||||
},_previousValue:"",_onInput:function(e){
|
||||
if(this.maxLength){
|
||||
var _2=parseInt(this.maxLength);
|
||||
var _3=this.textbox.value.replace(/\r/g,"");
|
||||
var _4=_3.length-_2;
|
||||
if(_4>0){
|
||||
if(e){
|
||||
dojo.stopEvent(e);
|
||||
}
|
||||
var _5=this.textbox;
|
||||
if(_5.selectionStart){
|
||||
var _6=_5.selectionStart;
|
||||
var cr=0;
|
||||
if(dojo.isOpera){
|
||||
cr=(this.textbox.value.substring(0,_6).match(/\r/g)||[]).length;
|
||||
}
|
||||
this.textbox.value=_3.substring(0,_6-_4-cr)+_3.substring(_6-cr);
|
||||
_5.setSelectionRange(_6-_4,_6-_4);
|
||||
}else{
|
||||
if(dojo.doc.selection){
|
||||
_5.focus();
|
||||
var _7=dojo.doc.selection.createRange();
|
||||
_7.moveStart("character",-_4);
|
||||
_7.text="";
|
||||
_7.select();
|
||||
}
|
||||
}
|
||||
}
|
||||
this._previousValue=this.textbox.value;
|
||||
}
|
||||
this.inherited(arguments);
|
||||
}});
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
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.Slider"]){
|
||||
dojo._hasResource["dijit.form.Slider"]=true;
|
||||
dojo.provide("dijit.form.Slider");
|
||||
dojo.deprecated("Call require() for HorizontalSlider / VerticalRule, explicitly rather than 'dijit.form.Slider' itself","","2.0");
|
||||
dojo.require("dijit.form.HorizontalSlider");
|
||||
dojo.require("dijit.form.VerticalSlider");
|
||||
dojo.require("dijit.form.HorizontalRule");
|
||||
dojo.require("dijit.form.VerticalRule");
|
||||
dojo.require("dijit.form.HorizontalRuleLabels");
|
||||
dojo.require("dijit.form.VerticalRuleLabels");
|
||||
}
|
||||
@@ -0,0 +1,209 @@
|
||||
/*
|
||||
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.TextBox"]){
|
||||
dojo._hasResource["dijit.form.TextBox"]=true;
|
||||
dojo.provide("dijit.form.TextBox");
|
||||
dojo.require("dijit.form._FormWidget");
|
||||
dojo.declare("dijit.form.TextBox",dijit.form._FormValueWidget,{trim:false,uppercase:false,lowercase:false,propercase:false,maxLength:"",selectOnClick:false,placeHolder:"",templateString:dojo.cache("dijit.form","templates/TextBox.html","<div class=\"dijit dijitReset dijitInline dijitLeft\" id=\"widget_${id}\" waiRole=\"presentation\"\n\t><div class=\"dijitReset dijitInputField dijitInputContainer\"\n\t\t><input class=\"dijitReset dijitInputInner\" dojoAttachPoint='textbox,focusNode' autocomplete=\"off\"\n\t\t\t${!nameAttrSetting} type='${type}'\n\t/></div\n></div>\n"),_singleNodeTemplate:"<input class=\"dijit dijitReset dijitLeft dijitInputField\" dojoAttachPoint=\"textbox,focusNode\" autocomplete=\"off\" type=\"${type}\" ${!nameAttrSetting} />",_buttonInputDisabled:dojo.isIE?"disabled":"",baseClass:"dijitTextBox",attributeMap:dojo.delegate(dijit.form._FormValueWidget.prototype.attributeMap,{maxLength:"focusNode"}),postMixInProperties:function(){
|
||||
var _1=this.type.toLowerCase();
|
||||
if(this.templateString.toLowerCase()=="input"||((_1=="hidden"||_1=="file")&&this.templateString==dijit.form.TextBox.prototype.templateString)){
|
||||
this.templateString=this._singleNodeTemplate;
|
||||
}
|
||||
this.inherited(arguments);
|
||||
},_setPlaceHolderAttr:function(v){
|
||||
this.placeHolder=v;
|
||||
if(!this._phspan){
|
||||
this._attachPoints.push("_phspan");
|
||||
this._phspan=dojo.create("span",{className:"dijitPlaceHolder dijitInputField"},this.textbox,"after");
|
||||
}
|
||||
this._phspan.innerHTML="";
|
||||
this._phspan.appendChild(document.createTextNode(v));
|
||||
this._updatePlaceHolder();
|
||||
},_updatePlaceHolder:function(){
|
||||
if(this._phspan){
|
||||
this._phspan.style.display=(this.placeHolder&&!this._focused&&!this.textbox.value)?"":"none";
|
||||
}
|
||||
},_getValueAttr:function(){
|
||||
return this.parse(this.get("displayedValue"),this.constraints);
|
||||
},_setValueAttr:function(_2,_3,_4){
|
||||
var _5;
|
||||
if(_2!==undefined){
|
||||
_5=this.filter(_2);
|
||||
if(typeof _4!="string"){
|
||||
if(_5!==null&&((typeof _5!="number")||!isNaN(_5))){
|
||||
_4=this.filter(this.format(_5,this.constraints));
|
||||
}else{
|
||||
_4="";
|
||||
}
|
||||
}
|
||||
}
|
||||
if(_4!=null&&_4!=undefined&&((typeof _4)!="number"||!isNaN(_4))&&this.textbox.value!=_4){
|
||||
this.textbox.value=_4;
|
||||
}
|
||||
this._updatePlaceHolder();
|
||||
this.inherited(arguments,[_5,_3]);
|
||||
},displayedValue:"",getDisplayedValue:function(){
|
||||
dojo.deprecated(this.declaredClass+"::getDisplayedValue() is deprecated. Use set('displayedValue') instead.","","2.0");
|
||||
return this.get("displayedValue");
|
||||
},_getDisplayedValueAttr:function(){
|
||||
return this.filter(this.textbox.value);
|
||||
},setDisplayedValue:function(_6){
|
||||
dojo.deprecated(this.declaredClass+"::setDisplayedValue() is deprecated. Use set('displayedValue', ...) instead.","","2.0");
|
||||
this.set("displayedValue",_6);
|
||||
},_setDisplayedValueAttr:function(_7){
|
||||
if(_7===null||_7===undefined){
|
||||
_7="";
|
||||
}else{
|
||||
if(typeof _7!="string"){
|
||||
_7=String(_7);
|
||||
}
|
||||
}
|
||||
this.textbox.value=_7;
|
||||
this._setValueAttr(this.get("value"),undefined,_7);
|
||||
},format:function(_8,_9){
|
||||
return ((_8==null||_8==undefined)?"":(_8.toString?_8.toString():_8));
|
||||
},parse:function(_a,_b){
|
||||
return _a;
|
||||
},_refreshState:function(){
|
||||
},_onInput:function(e){
|
||||
if(e&&e.type&&/key/i.test(e.type)&&e.keyCode){
|
||||
switch(e.keyCode){
|
||||
case dojo.keys.SHIFT:
|
||||
case dojo.keys.ALT:
|
||||
case dojo.keys.CTRL:
|
||||
case dojo.keys.TAB:
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(this.intermediateChanges){
|
||||
var _c=this;
|
||||
setTimeout(function(){
|
||||
_c._handleOnChange(_c.get("value"),false);
|
||||
},0);
|
||||
}
|
||||
this._refreshState();
|
||||
},postCreate:function(){
|
||||
if(dojo.isIE){
|
||||
var s=dojo.getComputedStyle(this.domNode);
|
||||
if(s){
|
||||
var ff=s.fontFamily;
|
||||
if(ff){
|
||||
var _d=this.domNode.getElementsByTagName("INPUT");
|
||||
if(_d){
|
||||
for(var i=0;i<_d.length;i++){
|
||||
_d[i].style.fontFamily=ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.textbox.setAttribute("value",this.textbox.value);
|
||||
this.inherited(arguments);
|
||||
if(dojo.isMoz||dojo.isOpera){
|
||||
this.connect(this.textbox,"oninput",this._onInput);
|
||||
}else{
|
||||
this.connect(this.textbox,"onkeydown",this._onInput);
|
||||
this.connect(this.textbox,"onkeyup",this._onInput);
|
||||
this.connect(this.textbox,"onpaste",this._onInput);
|
||||
this.connect(this.textbox,"oncut",this._onInput);
|
||||
}
|
||||
},_blankValue:"",filter:function(_e){
|
||||
if(_e===null){
|
||||
return this._blankValue;
|
||||
}
|
||||
if(typeof _e!="string"){
|
||||
return _e;
|
||||
}
|
||||
if(this.trim){
|
||||
_e=dojo.trim(_e);
|
||||
}
|
||||
if(this.uppercase){
|
||||
_e=_e.toUpperCase();
|
||||
}
|
||||
if(this.lowercase){
|
||||
_e=_e.toLowerCase();
|
||||
}
|
||||
if(this.propercase){
|
||||
_e=_e.replace(/[^\s]+/g,function(_f){
|
||||
return _f.substring(0,1).toUpperCase()+_f.substring(1);
|
||||
});
|
||||
}
|
||||
return _e;
|
||||
},_setBlurValue:function(){
|
||||
this._setValueAttr(this.get("value"),true);
|
||||
},_onBlur:function(e){
|
||||
if(this.disabled){
|
||||
return;
|
||||
}
|
||||
this._setBlurValue();
|
||||
this.inherited(arguments);
|
||||
if(this._selectOnClickHandle){
|
||||
this.disconnect(this._selectOnClickHandle);
|
||||
}
|
||||
if(this.selectOnClick&&dojo.isMoz){
|
||||
this.textbox.selectionStart=this.textbox.selectionEnd=undefined;
|
||||
}
|
||||
this._updatePlaceHolder();
|
||||
},_onFocus:function(by){
|
||||
if(this.disabled||this.readOnly){
|
||||
return;
|
||||
}
|
||||
if(this.selectOnClick&&by=="mouse"){
|
||||
this._selectOnClickHandle=this.connect(this.domNode,"onmouseup",function(){
|
||||
this.disconnect(this._selectOnClickHandle);
|
||||
var _10;
|
||||
if(dojo.isIE){
|
||||
var _11=dojo.doc.selection.createRange();
|
||||
var _12=_11.parentElement();
|
||||
_10=_12==this.textbox&&_11.text.length==0;
|
||||
}else{
|
||||
_10=this.textbox.selectionStart==this.textbox.selectionEnd;
|
||||
}
|
||||
if(_10){
|
||||
dijit.selectInputText(this.textbox);
|
||||
}
|
||||
});
|
||||
}
|
||||
this._updatePlaceHolder();
|
||||
this._refreshState();
|
||||
this.inherited(arguments);
|
||||
},reset:function(){
|
||||
this.textbox.value="";
|
||||
this.inherited(arguments);
|
||||
}});
|
||||
dijit.selectInputText=function(_13,_14,_15){
|
||||
var _16=dojo.global;
|
||||
var _17=dojo.doc;
|
||||
_13=dojo.byId(_13);
|
||||
if(isNaN(_14)){
|
||||
_14=0;
|
||||
}
|
||||
if(isNaN(_15)){
|
||||
_15=_13.value?_13.value.length:0;
|
||||
}
|
||||
dijit.focus(_13);
|
||||
if(_17["selection"]&&dojo.body()["createTextRange"]){
|
||||
if(_13.createTextRange){
|
||||
var _18=_13.createTextRange();
|
||||
with(_18){
|
||||
collapse(true);
|
||||
moveStart("character",-99999);
|
||||
moveStart("character",_14);
|
||||
moveEnd("character",_15-_14);
|
||||
select();
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(_16["getSelection"]){
|
||||
if(_13.setSelectionRange){
|
||||
_13.setSelectionRange(_14,_15);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
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.Textarea"]){
|
||||
dojo._hasResource["dijit.form.Textarea"]=true;
|
||||
dojo.provide("dijit.form.Textarea");
|
||||
dojo.require("dijit.form.SimpleTextarea");
|
||||
dojo.declare("dijit.form.Textarea",dijit.form.SimpleTextarea,{cols:"",_previousNewlines:0,_strictMode:(dojo.doc.compatMode!="BackCompat"),_getHeight:function(_1){
|
||||
var _2=_1.scrollHeight;
|
||||
if(dojo.isIE){
|
||||
_2+=_1.offsetHeight-_1.clientHeight-((dojo.isIE<8&&this._strictMode)?dojo._getPadBorderExtents(_1).h:0);
|
||||
}else{
|
||||
if(dojo.isMoz){
|
||||
_2+=_1.offsetHeight-_1.clientHeight;
|
||||
}else{
|
||||
if(dojo.isWebKit&&!(dojo.isSafari<4)){
|
||||
_2+=dojo._getBorderExtents(_1).h;
|
||||
}else{
|
||||
_2+=dojo._getPadBorderExtents(_1).h;
|
||||
}
|
||||
}
|
||||
}
|
||||
return _2;
|
||||
},_estimateHeight:function(_3){
|
||||
_3.style.maxHeight="";
|
||||
_3.style.height="auto";
|
||||
_3.rows=(_3.value.match(/\n/g)||[]).length+1;
|
||||
},_needsHelpShrinking:dojo.isMoz||dojo.isWebKit,_onInput:function(){
|
||||
this.inherited(arguments);
|
||||
if(this._busyResizing){
|
||||
return;
|
||||
}
|
||||
this._busyResizing=true;
|
||||
var _4=this.textbox;
|
||||
if(_4.scrollHeight&&_4.offsetHeight&&_4.clientHeight){
|
||||
var _5=this._getHeight(_4)+"px";
|
||||
if(_4.style.height!=_5){
|
||||
_4.style.maxHeight=_4.style.height=_5;
|
||||
}
|
||||
if(this._needsHelpShrinking){
|
||||
if(this._setTimeoutHandle){
|
||||
clearTimeout(this._setTimeoutHandle);
|
||||
}
|
||||
this._setTimeoutHandle=setTimeout(dojo.hitch(this,"_shrink"),0);
|
||||
}
|
||||
}else{
|
||||
this._estimateHeight(_4);
|
||||
}
|
||||
this._busyResizing=false;
|
||||
},_busyResizing:false,_shrink:function(){
|
||||
this._setTimeoutHandle=null;
|
||||
if(this._needsHelpShrinking&&!this._busyResizing){
|
||||
this._busyResizing=true;
|
||||
var _6=this.textbox;
|
||||
var _7=false;
|
||||
if(_6.value==""){
|
||||
_6.value=" ";
|
||||
_7=true;
|
||||
}
|
||||
var _8=_6.scrollHeight;
|
||||
if(!_8){
|
||||
this._estimateHeight(_6);
|
||||
}else{
|
||||
var _9=_6.style.paddingBottom;
|
||||
var _a=dojo._getPadExtents(_6);
|
||||
_a=_a.h-_a.t;
|
||||
_6.style.paddingBottom=_a+1+"px";
|
||||
var _b=this._getHeight(_6)-1+"px";
|
||||
if(_6.style.maxHeight!=_b){
|
||||
_6.style.paddingBottom=_a+_8+"px";
|
||||
_6.scrollTop=0;
|
||||
_6.style.maxHeight=this._getHeight(_6)-_8+"px";
|
||||
}
|
||||
_6.style.paddingBottom=_9;
|
||||
}
|
||||
if(_7){
|
||||
_6.value="";
|
||||
}
|
||||
this._busyResizing=false;
|
||||
}
|
||||
},resize:function(){
|
||||
this._onInput();
|
||||
},_setValueAttr:function(){
|
||||
this.inherited(arguments);
|
||||
this.resize();
|
||||
},postCreate:function(){
|
||||
this.inherited(arguments);
|
||||
dojo.style(this.textbox,{overflowY:"hidden",overflowX:"auto",boxSizing:"border-box",MsBoxSizing:"border-box",WebkitBoxSizing:"border-box",MozBoxSizing:"border-box"});
|
||||
this.connect(this.textbox,"onscroll",this._onInput);
|
||||
this.connect(this.textbox,"onresize",this._onInput);
|
||||
this.connect(this.textbox,"onfocus",this._onInput);
|
||||
this._setTimeoutHandle=setTimeout(dojo.hitch(this,"resize"),0);
|
||||
},uninitialize:function(){
|
||||
if(this._setTimeoutHandle){
|
||||
clearTimeout(this._setTimeoutHandle);
|
||||
}
|
||||
this.inherited(arguments);
|
||||
}});
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
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.TimeTextBox"]){
|
||||
dojo._hasResource["dijit.form.TimeTextBox"]=true;
|
||||
dojo.provide("dijit.form.TimeTextBox");
|
||||
dojo.require("dijit._TimePicker");
|
||||
dojo.require("dijit.form._DateTimeTextBox");
|
||||
dojo.declare("dijit.form.TimeTextBox",dijit.form._DateTimeTextBox,{baseClass:"dijitTextBox dijitTimeTextBox",popupClass:"dijit._TimePicker",_selector:"time",value:new Date("")});
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
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.ToggleButton"]){
|
||||
dojo._hasResource["dijit.form.ToggleButton"]=true;
|
||||
dojo.provide("dijit.form.ToggleButton");
|
||||
dojo.require("dijit.form.Button");
|
||||
}
|
||||
@@ -0,0 +1,211 @@
|
||||
/*
|
||||
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.ValidationTextBox"]){
|
||||
dojo._hasResource["dijit.form.ValidationTextBox"]=true;
|
||||
dojo.provide("dijit.form.ValidationTextBox");
|
||||
dojo.require("dojo.i18n");
|
||||
dojo.require("dijit.form.TextBox");
|
||||
dojo.require("dijit.Tooltip");
|
||||
dojo.requireLocalization("dijit.form","validate",null,"ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw");
|
||||
dojo.declare("dijit.form.ValidationTextBox",dijit.form.TextBox,{templateString:dojo.cache("dijit.form","templates/ValidationTextBox.html","<div class=\"dijit dijitReset dijitInlineTable dijitLeft\"\n\tid=\"widget_${id}\" waiRole=\"presentation\"\n\t><div class='dijitReset dijitValidationContainer'\n\t\t><input class=\"dijitReset dijitInputField dijitValidationIcon dijitValidationInner\" value=\"Χ \" type=\"text\" tabIndex=\"-1\" readOnly waiRole=\"presentation\"\n\t/></div\n\t><div class=\"dijitReset dijitInputField dijitInputContainer\"\n\t\t><input class=\"dijitReset dijitInputInner\" dojoAttachPoint='textbox,focusNode' autocomplete=\"off\"\n\t\t\t${!nameAttrSetting} type='${type}'\n\t/></div\n></div>\n"),baseClass:"dijitTextBox dijitValidationTextBox",required:false,promptMessage:"",invalidMessage:"$_unset_$",missingMessage:"$_unset_$",constraints:{},regExp:".*",regExpGen:function(_1){
|
||||
return this.regExp;
|
||||
},state:"",tooltipPosition:[],_setValueAttr:function(){
|
||||
this.inherited(arguments);
|
||||
this.validate(this._focused);
|
||||
},validator:function(_2,_3){
|
||||
return (new RegExp("^(?:"+this.regExpGen(_3)+")"+(this.required?"":"?")+"$")).test(_2)&&(!this.required||!this._isEmpty(_2))&&(this._isEmpty(_2)||this.parse(_2,_3)!==undefined);
|
||||
},_isValidSubset:function(){
|
||||
return this.textbox.value.search(this._partialre)==0;
|
||||
},isValid:function(_4){
|
||||
return this.validator(this.textbox.value,this.constraints);
|
||||
},_isEmpty:function(_5){
|
||||
return /^\s*$/.test(_5);
|
||||
},getErrorMessage:function(_6){
|
||||
return (this.required&&this._isEmpty(this.textbox.value))?this.missingMessage:this.invalidMessage;
|
||||
},getPromptMessage:function(_7){
|
||||
return this.promptMessage;
|
||||
},_maskValidSubsetError:true,validate:function(_8){
|
||||
var _9="";
|
||||
var _a=this.disabled||this.isValid(_8);
|
||||
if(_a){
|
||||
this._maskValidSubsetError=true;
|
||||
}
|
||||
var _b=this._isEmpty(this.textbox.value);
|
||||
var _c=!_a&&!_b&&_8&&this._isValidSubset();
|
||||
this.state=((_a||((!this._hasBeenBlurred||_8)&&_b)||_c)&&this._maskValidSubsetError)?"":"Error";
|
||||
if(this.state=="Error"){
|
||||
this._maskValidSubsetError=_8;
|
||||
}
|
||||
this._setStateClass();
|
||||
dijit.setWaiState(this.focusNode,"invalid",_a?"false":"true");
|
||||
if(_8){
|
||||
if(this.state=="Error"){
|
||||
_9=this.getErrorMessage(true);
|
||||
}else{
|
||||
_9=this.getPromptMessage(true);
|
||||
}
|
||||
this._maskValidSubsetError=true;
|
||||
}
|
||||
this.displayMessage(_9);
|
||||
return _a;
|
||||
},_message:"",displayMessage:function(_d){
|
||||
if(this._message==_d){
|
||||
return;
|
||||
}
|
||||
this._message=_d;
|
||||
dijit.hideTooltip(this.domNode);
|
||||
if(_d){
|
||||
dijit.showTooltip(_d,this.domNode,this.tooltipPosition,!this.isLeftToRight());
|
||||
}
|
||||
},_refreshState:function(){
|
||||
this.validate(this._focused);
|
||||
this.inherited(arguments);
|
||||
},constructor:function(){
|
||||
this.constraints={};
|
||||
},_setConstraintsAttr:function(_e){
|
||||
if(!_e.locale&&this.lang){
|
||||
_e.locale=this.lang;
|
||||
}
|
||||
this.constraints=_e;
|
||||
this._computePartialRE();
|
||||
},_computePartialRE:function(){
|
||||
var p=this.regExpGen(this.constraints);
|
||||
this.regExp=p;
|
||||
var _f="";
|
||||
if(p!=".*"){
|
||||
this.regExp.replace(/\\.|\[\]|\[.*?[^\\]{1}\]|\{.*?\}|\(\?[=:!]|./g,function(re){
|
||||
switch(re.charAt(0)){
|
||||
case "{":
|
||||
case "+":
|
||||
case "?":
|
||||
case "*":
|
||||
case "^":
|
||||
case "$":
|
||||
case "|":
|
||||
case "(":
|
||||
_f+=re;
|
||||
break;
|
||||
case ")":
|
||||
_f+="|$)";
|
||||
break;
|
||||
default:
|
||||
_f+="(?:"+re+"|$)";
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
try{
|
||||
"".search(_f);
|
||||
}
|
||||
catch(e){
|
||||
_f=this.regExp;
|
||||
console.warn("RegExp error in "+this.declaredClass+": "+this.regExp);
|
||||
}
|
||||
this._partialre="^(?:"+_f+")$";
|
||||
},postMixInProperties:function(){
|
||||
this.inherited(arguments);
|
||||
this.messages=dojo.i18n.getLocalization("dijit.form","validate",this.lang);
|
||||
if(this.invalidMessage=="$_unset_$"){
|
||||
this.invalidMessage=this.messages.invalidMessage;
|
||||
}
|
||||
if(!this.invalidMessage){
|
||||
this.invalidMessage=this.promptMessage;
|
||||
}
|
||||
if(this.missingMessage=="$_unset_$"){
|
||||
this.missingMessage=this.messages.missingMessage;
|
||||
}
|
||||
if(!this.missingMessage){
|
||||
this.missingMessage=this.invalidMessage;
|
||||
}
|
||||
this._setConstraintsAttr(this.constraints);
|
||||
},_setDisabledAttr:function(_10){
|
||||
this.inherited(arguments);
|
||||
this._refreshState();
|
||||
},_setRequiredAttr:function(_11){
|
||||
this.required=_11;
|
||||
dijit.setWaiState(this.focusNode,"required",_11);
|
||||
this._refreshState();
|
||||
},reset:function(){
|
||||
this._maskValidSubsetError=true;
|
||||
this.inherited(arguments);
|
||||
},_onBlur:function(){
|
||||
this.displayMessage("");
|
||||
this.inherited(arguments);
|
||||
}});
|
||||
dojo.declare("dijit.form.MappedTextBox",dijit.form.ValidationTextBox,{postMixInProperties:function(){
|
||||
this.inherited(arguments);
|
||||
this.nameAttrSetting="";
|
||||
},serialize:function(val,_12){
|
||||
return val.toString?val.toString():"";
|
||||
},toString:function(){
|
||||
var val=this.filter(this.get("value"));
|
||||
return val!=null?(typeof val=="string"?val:this.serialize(val,this.constraints)):"";
|
||||
},validate:function(){
|
||||
this.valueNode.value=this.toString();
|
||||
return this.inherited(arguments);
|
||||
},buildRendering:function(){
|
||||
this.inherited(arguments);
|
||||
this.valueNode=dojo.place("<input type='hidden'"+(this.name?" name='"+this.name+"'":"")+">",this.textbox,"after");
|
||||
},reset:function(){
|
||||
this.valueNode.value="";
|
||||
this.inherited(arguments);
|
||||
}});
|
||||
dojo.declare("dijit.form.RangeBoundTextBox",dijit.form.MappedTextBox,{rangeMessage:"",rangeCheck:function(_13,_14){
|
||||
return ("min" in _14?(this.compare(_13,_14.min)>=0):true)&&("max" in _14?(this.compare(_13,_14.max)<=0):true);
|
||||
},isInRange:function(_15){
|
||||
return this.rangeCheck(this.get("value"),this.constraints);
|
||||
},_isDefinitelyOutOfRange:function(){
|
||||
var val=this.get("value");
|
||||
var _16=false;
|
||||
var _17=false;
|
||||
if("min" in this.constraints){
|
||||
var min=this.constraints.min;
|
||||
min=this.compare(val,((typeof min=="number")&&min>=0&&val!=0)?0:min);
|
||||
_16=(typeof min=="number")&&min<0;
|
||||
}
|
||||
if("max" in this.constraints){
|
||||
var max=this.constraints.max;
|
||||
max=this.compare(val,((typeof max!="number")||max>0)?max:0);
|
||||
_17=(typeof max=="number")&&max>0;
|
||||
}
|
||||
return _16||_17;
|
||||
},_isValidSubset:function(){
|
||||
return this.inherited(arguments)&&!this._isDefinitelyOutOfRange();
|
||||
},isValid:function(_18){
|
||||
return this.inherited(arguments)&&((this._isEmpty(this.textbox.value)&&!this.required)||this.isInRange(_18));
|
||||
},getErrorMessage:function(_19){
|
||||
var v=this.get("value");
|
||||
if(v!==null&&v!==""&&v!==undefined&&(typeof v!="number"||!isNaN(v))&&!this.isInRange(_19)){
|
||||
return this.rangeMessage;
|
||||
}
|
||||
return this.inherited(arguments);
|
||||
},postMixInProperties:function(){
|
||||
this.inherited(arguments);
|
||||
if(!this.rangeMessage){
|
||||
this.messages=dojo.i18n.getLocalization("dijit.form","validate",this.lang);
|
||||
this.rangeMessage=this.messages.rangeMessage;
|
||||
}
|
||||
},_setConstraintsAttr:function(_1a){
|
||||
this.inherited(arguments);
|
||||
if(this.focusNode){
|
||||
if(this.constraints.min!==undefined){
|
||||
dijit.setWaiState(this.focusNode,"valuemin",this.constraints.min);
|
||||
}else{
|
||||
dijit.removeWaiState(this.focusNode,"valuemin");
|
||||
}
|
||||
if(this.constraints.max!==undefined){
|
||||
dijit.setWaiState(this.focusNode,"valuemax",this.constraints.max);
|
||||
}else{
|
||||
dijit.removeWaiState(this.focusNode,"valuemax");
|
||||
}
|
||||
}
|
||||
},_setValueAttr:function(_1b,_1c){
|
||||
dijit.setWaiState(this.focusNode,"valuenow",_1b);
|
||||
this.inherited(arguments);
|
||||
}});
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
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.VerticalRule"]){
|
||||
dojo._hasResource["dijit.form.VerticalRule"]=true;
|
||||
dojo.provide("dijit.form.VerticalRule");
|
||||
dojo.require("dijit.form.HorizontalRule");
|
||||
dojo.declare("dijit.form.VerticalRule",dijit.form.HorizontalRule,{templateString:"<div class=\"dijitRuleContainer dijitRuleContainerV\"></div>",_positionPrefix:"<div class=\"dijitRuleMark dijitRuleMarkV\" style=\"top:",_isHorizontal:false});
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
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.VerticalRuleLabels"]){
|
||||
dojo._hasResource["dijit.form.VerticalRuleLabels"]=true;
|
||||
dojo.provide("dijit.form.VerticalRuleLabels");
|
||||
dojo.require("dijit.form.HorizontalRuleLabels");
|
||||
dojo.declare("dijit.form.VerticalRuleLabels",dijit.form.HorizontalRuleLabels,{templateString:"<div class=\"dijitRuleContainer dijitRuleContainerV dijitRuleLabelsContainer dijitRuleLabelsContainerV\"></div>",_positionPrefix:"<div class=\"dijitRuleLabelContainer dijitRuleLabelContainerV\" style=\"top:",_labelPrefix:"\"><span class=\"dijitRuleLabel dijitRuleLabelV\">",_calcPosition:function(_1){
|
||||
return 100-_1;
|
||||
},_isHorizontal:false});
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
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.VerticalSlider"]){
|
||||
dojo._hasResource["dijit.form.VerticalSlider"]=true;
|
||||
dojo.provide("dijit.form.VerticalSlider");
|
||||
dojo.require("dijit.form.HorizontalSlider");
|
||||
dojo.declare("dijit.form.VerticalSlider",dijit.form.HorizontalSlider,{templateString:dojo.cache("dijit.form","templates/VerticalSlider.html","<table class=\"dijit dijitReset dijitSlider dijitSliderV\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" rules=\"none\" dojoAttachEvent=\"onkeypress:_onKeyPress,onkeyup:_onKeyUp\"\n\t><tr class=\"dijitReset\"\n\t\t><td class=\"dijitReset\"></td\n\t\t><td class=\"dijitReset dijitSliderButtonContainer dijitSliderButtonContainerV\"\n\t\t\t><div class=\"dijitSliderIncrementIconV\" tabIndex=\"-1\" style=\"display:none\" dojoAttachPoint=\"decrementButton\"><span class=\"dijitSliderButtonInner\">+</span></div\n\t\t></td\n\t\t><td class=\"dijitReset\"></td\n\t></tr\n\t><tr class=\"dijitReset\"\n\t\t><td class=\"dijitReset\"></td\n\t\t><td class=\"dijitReset\"\n\t\t\t><center><div class=\"dijitSliderBar dijitSliderBumper dijitSliderBumperV dijitSliderTopBumper\" dojoAttachEvent=\"onmousedown:_onClkIncBumper\"></div></center\n\t\t></td\n\t\t><td class=\"dijitReset\"></td\n\t></tr\n\t><tr class=\"dijitReset\"\n\t\t><td dojoAttachPoint=\"leftDecoration\" class=\"dijitReset dijitSliderDecoration dijitSliderDecorationL dijitSliderDecorationV\"></td\n\t\t><td class=\"dijitReset\" style=\"height:100%;\"\n\t\t\t><input dojoAttachPoint=\"valueNode\" type=\"hidden\" ${!nameAttrSetting}\n\t\t\t/><center class=\"dijitReset dijitSliderBarContainerV\" waiRole=\"presentation\" dojoAttachPoint=\"sliderBarContainer\"\n\t\t\t\t><div waiRole=\"presentation\" dojoAttachPoint=\"remainingBar\" class=\"dijitSliderBar dijitSliderBarV dijitSliderRemainingBar dijitSliderRemainingBarV\" dojoAttachEvent=\"onmousedown:_onBarClick\"><!--#5629--></div\n\t\t\t\t><div waiRole=\"presentation\" dojoAttachPoint=\"progressBar\" class=\"dijitSliderBar dijitSliderBarV dijitSliderProgressBar dijitSliderProgressBarV\" dojoAttachEvent=\"onmousedown:_onBarClick\"\n\t\t\t\t\t><div class=\"dijitSliderMoveable dijitSliderMoveableV\" style=\"vertical-align:top;\"\n\t\t\t\t\t\t><div dojoAttachPoint=\"sliderHandle,focusNode\" class=\"dijitSliderImageHandle dijitSliderImageHandleV\" dojoAttachEvent=\"onmousedown:_onHandleClick\" waiRole=\"slider\" valuemin=\"${minimum}\" valuemax=\"${maximum}\"></div\n\t\t\t\t\t></div\n\t\t\t\t></div\n\t\t\t></center\n\t\t></td\n\t\t><td dojoAttachPoint=\"containerNode,rightDecoration\" class=\"dijitReset dijitSliderDecoration dijitSliderDecorationR dijitSliderDecorationV\"></td\n\t></tr\n\t><tr class=\"dijitReset\"\n\t\t><td class=\"dijitReset\"></td\n\t\t><td class=\"dijitReset\"\n\t\t\t><center><div class=\"dijitSliderBar dijitSliderBumper dijitSliderBumperV dijitSliderBottomBumper\" dojoAttachEvent=\"onmousedown:_onClkDecBumper\"></div></center\n\t\t></td\n\t\t><td class=\"dijitReset\"></td\n\t></tr\n\t><tr class=\"dijitReset\"\n\t\t><td class=\"dijitReset\"></td\n\t\t><td class=\"dijitReset dijitSliderButtonContainer dijitSliderButtonContainerV\"\n\t\t\t><div class=\"dijitSliderDecrementIconV\" tabIndex=\"-1\" style=\"display:none\" dojoAttachPoint=\"incrementButton\"><span class=\"dijitSliderButtonInner\">-</span></div\n\t\t></td\n\t\t><td class=\"dijitReset\"></td\n\t></tr\n></table>\n"),_mousePixelCoord:"pageY",_pixelCount:"h",_startingPixelCoord:"y",_startingPixelCount:"t",_handleOffsetCoord:"top",_progressPixelSize:"height",_descending:true,_isReversed:function(){
|
||||
return this._descending;
|
||||
}});
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
/*
|
||||
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._DateTimeTextBox"]){
|
||||
dojo._hasResource["dijit.form._DateTimeTextBox"]=true;
|
||||
dojo.provide("dijit.form._DateTimeTextBox");
|
||||
dojo.require("dojo.date");
|
||||
dojo.require("dojo.date.locale");
|
||||
dojo.require("dojo.date.stamp");
|
||||
dojo.require("dijit.form.ValidationTextBox");
|
||||
new Date("X");
|
||||
dojo.declare("dijit.form._DateTimeTextBox",dijit.form.RangeBoundTextBox,{regExpGen:dojo.date.locale.regexp,datePackage:"dojo.date",compare:dojo.date.compare,format:function(_1,_2){
|
||||
if(!_1){
|
||||
return "";
|
||||
}
|
||||
return this.dateLocaleModule.format(_1,_2);
|
||||
},parse:function(_3,_4){
|
||||
return this.dateLocaleModule.parse(_3,_4)||(this._isEmpty(_3)?null:undefined);
|
||||
},serialize:function(_5,_6){
|
||||
if(_5.toGregorian){
|
||||
_5=_5.toGregorian();
|
||||
}
|
||||
return dojo.date.stamp.toISOString(_5,_6);
|
||||
},value:new Date(""),_blankValue:null,popupClass:"",_selector:"",constructor:function(_7){
|
||||
var _8=_7.datePackage?_7.datePackage+".Date":"Date";
|
||||
this.dateClassObj=dojo.getObject(_8,false);
|
||||
this.value=new this.dateClassObj("");
|
||||
this.datePackage=_7.datePackage||this.datePackage;
|
||||
this.dateLocaleModule=dojo.getObject(this.datePackage+".locale",false);
|
||||
this.regExpGen=this.dateLocaleModule.regexp;
|
||||
},_setConstraintsAttr:function(_9){
|
||||
_9.selector=this._selector;
|
||||
_9.fullYear=true;
|
||||
var _a=dojo.date.stamp.fromISOString;
|
||||
if(typeof _9.min=="string"){
|
||||
_9.min=_a(_9.min);
|
||||
}
|
||||
if(typeof _9.max=="string"){
|
||||
_9.max=_a(_9.max);
|
||||
}
|
||||
this.inherited(arguments,[_9]);
|
||||
},_onFocus:function(_b){
|
||||
this._open();
|
||||
this.inherited(arguments);
|
||||
},_setValueAttr:function(_c,_d,_e){
|
||||
if(_c!==undefined){
|
||||
if(!_c||_c.toString()==dijit.form._DateTimeTextBox.prototype.value.toString()){
|
||||
_c=null;
|
||||
}
|
||||
if(_c instanceof Date&&!(this.dateClassObj instanceof Date)){
|
||||
_c=new this.dateClassObj(_c);
|
||||
}
|
||||
}
|
||||
this.inherited(arguments,[_c,_d,_e]);
|
||||
if(this._picker){
|
||||
if(!_c){
|
||||
_c=new this.dateClassObj();
|
||||
}
|
||||
this._picker.set("value",_c);
|
||||
}
|
||||
},_open:function(){
|
||||
if(this.disabled||this.readOnly||!this.popupClass){
|
||||
return;
|
||||
}
|
||||
var _f=this;
|
||||
if(!this._picker){
|
||||
var _10=dojo.getObject(this.popupClass,false);
|
||||
this._picker=new _10({onValueSelected:function(_11){
|
||||
if(_f._tabbingAway){
|
||||
delete _f._tabbingAway;
|
||||
}else{
|
||||
_f.focus();
|
||||
}
|
||||
setTimeout(dojo.hitch(_f,"_close"),1);
|
||||
dijit.form._DateTimeTextBox.superclass._setValueAttr.call(_f,_11,true);
|
||||
},id:this.id+"_popup",dir:_f.dir,lang:_f.lang,value:this.get("value")||new this.dateClassObj(),constraints:_f.constraints,datePackage:_f.datePackage,isDisabledDate:function(_12){
|
||||
var _13=dojo.date.compare;
|
||||
var _14=_f.constraints;
|
||||
return _14&&((_14.min&&_13(_14.min,_12,_f._selector)>0)||(_14.max&&_13(_14.max,_12,_f._selector)<0));
|
||||
}});
|
||||
}
|
||||
if(!this._opened){
|
||||
dijit.popup.open({parent:this,popup:this._picker,orient:{"BL":"TL","TL":"BL"},around:this.domNode,onCancel:dojo.hitch(this,this._close),onClose:function(){
|
||||
_f._opened=false;
|
||||
}});
|
||||
this._opened=true;
|
||||
}
|
||||
dojo.marginBox(this._picker.domNode,{w:this.domNode.offsetWidth});
|
||||
},_close:function(){
|
||||
if(this._opened){
|
||||
dijit.popup.close(this._picker);
|
||||
this._opened=false;
|
||||
}
|
||||
},_onBlur:function(){
|
||||
this._close();
|
||||
if(this._picker){
|
||||
this._picker.destroy();
|
||||
delete this._picker;
|
||||
}
|
||||
this.inherited(arguments);
|
||||
},_getDisplayedValueAttr:function(){
|
||||
return this.textbox.value;
|
||||
},_setDisplayedValueAttr:function(_15,_16){
|
||||
this._setValueAttr(this.parse(_15,this.constraints),_16,_15);
|
||||
},destroy:function(){
|
||||
if(this._picker){
|
||||
this._picker.destroy();
|
||||
delete this._picker;
|
||||
}
|
||||
this.inherited(arguments);
|
||||
},postCreate:function(){
|
||||
this.inherited(arguments);
|
||||
this.connect(this.focusNode,"onkeypress",this._onKeyPress);
|
||||
this.connect(this.focusNode,"onclick",this._open);
|
||||
},_onKeyPress:function(e){
|
||||
var p=this._picker,dk=dojo.keys;
|
||||
if(p&&this._opened&&p.handleKey){
|
||||
if(p.handleKey(e)===false){
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(this._opened&&e.charOrCode==dk.ESCAPE&&!(e.shiftKey||e.ctrlKey||e.altKey||e.metaKey)){
|
||||
this._close();
|
||||
dojo.stopEvent(e);
|
||||
}else{
|
||||
if(!this._opened&&e.charOrCode==dk.DOWN_ARROW){
|
||||
this._open();
|
||||
dojo.stopEvent(e);
|
||||
}else{
|
||||
if(e.charOrCode===dk.TAB){
|
||||
this._tabbingAway=true;
|
||||
}else{
|
||||
if(this._opened&&(e.keyChar||e.charOrCode===dk.BACKSPACE||e.charOrCode==dk.DELETE)){
|
||||
setTimeout(dojo.hitch(this,function(){
|
||||
if(this._picker&&this._opened){
|
||||
dijit.placeOnScreenAroundElement(p.domNode.parentNode,this.domNode,{"BL":"TL","TL":"BL"},p.orient?dojo.hitch(p,"orient"):null);
|
||||
}
|
||||
}),1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}});
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
/*
|
||||
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._FormMixin"]){
|
||||
dojo._hasResource["dijit.form._FormMixin"]=true;
|
||||
dojo.provide("dijit.form._FormMixin");
|
||||
dojo.require("dojo.window");
|
||||
dojo.declare("dijit.form._FormMixin",null,{reset:function(){
|
||||
dojo.forEach(this.getDescendants(),function(_1){
|
||||
if(_1.reset){
|
||||
_1.reset();
|
||||
}
|
||||
});
|
||||
},validate:function(){
|
||||
var _2=false;
|
||||
return dojo.every(dojo.map(this.getDescendants(),function(_3){
|
||||
_3._hasBeenBlurred=true;
|
||||
var _4=_3.disabled||!_3.validate||_3.validate();
|
||||
if(!_4&&!_2){
|
||||
dojo.window.scrollIntoView(_3.containerNode||_3.domNode);
|
||||
_3.focus();
|
||||
_2=true;
|
||||
}
|
||||
return _4;
|
||||
}),function(_5){
|
||||
return _5;
|
||||
});
|
||||
},setValues:function(_6){
|
||||
dojo.deprecated(this.declaredClass+"::setValues() is deprecated. Use set('value', val) instead.","","2.0");
|
||||
return this.set("value",_6);
|
||||
},_setValueAttr:function(_7){
|
||||
var _8={};
|
||||
dojo.forEach(this.getDescendants(),function(_9){
|
||||
if(!_9.name){
|
||||
return;
|
||||
}
|
||||
var _a=_8[_9.name]||(_8[_9.name]=[]);
|
||||
_a.push(_9);
|
||||
});
|
||||
for(var _b in _8){
|
||||
if(!_8.hasOwnProperty(_b)){
|
||||
continue;
|
||||
}
|
||||
var _c=_8[_b],_d=dojo.getObject(_b,false,_7);
|
||||
if(_d===undefined){
|
||||
continue;
|
||||
}
|
||||
if(!dojo.isArray(_d)){
|
||||
_d=[_d];
|
||||
}
|
||||
if(typeof _c[0].checked=="boolean"){
|
||||
dojo.forEach(_c,function(w,i){
|
||||
w.set("value",dojo.indexOf(_d,w.value)!=-1);
|
||||
});
|
||||
}else{
|
||||
if(_c[0].multiple){
|
||||
_c[0].set("value",_d);
|
||||
}else{
|
||||
dojo.forEach(_c,function(w,i){
|
||||
w.set("value",_d[i]);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
},getValues:function(){
|
||||
dojo.deprecated(this.declaredClass+"::getValues() is deprecated. Use get('value') instead.","","2.0");
|
||||
return this.get("value");
|
||||
},_getValueAttr:function(){
|
||||
var _e={};
|
||||
dojo.forEach(this.getDescendants(),function(_f){
|
||||
var _10=_f.name;
|
||||
if(!_10||_f.disabled){
|
||||
return;
|
||||
}
|
||||
var _11=_f.get("value");
|
||||
if(typeof _f.checked=="boolean"){
|
||||
if(/Radio/.test(_f.declaredClass)){
|
||||
if(_11!==false){
|
||||
dojo.setObject(_10,_11,_e);
|
||||
}else{
|
||||
_11=dojo.getObject(_10,false,_e);
|
||||
if(_11===undefined){
|
||||
dojo.setObject(_10,null,_e);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
var ary=dojo.getObject(_10,false,_e);
|
||||
if(!ary){
|
||||
ary=[];
|
||||
dojo.setObject(_10,ary,_e);
|
||||
}
|
||||
if(_11!==false){
|
||||
ary.push(_11);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
var _12=dojo.getObject(_10,false,_e);
|
||||
if(typeof _12!="undefined"){
|
||||
if(dojo.isArray(_12)){
|
||||
_12.push(_11);
|
||||
}else{
|
||||
dojo.setObject(_10,[_12,_11],_e);
|
||||
}
|
||||
}else{
|
||||
dojo.setObject(_10,_11,_e);
|
||||
}
|
||||
}
|
||||
});
|
||||
return _e;
|
||||
},isValid:function(){
|
||||
this._invalidWidgets=dojo.filter(this.getDescendants(),function(_13){
|
||||
return !_13.disabled&&_13.isValid&&!_13.isValid();
|
||||
});
|
||||
return !this._invalidWidgets.length;
|
||||
},onValidStateChange:function(_14){
|
||||
},_widgetChange:function(_15){
|
||||
var _16=this._lastValidState;
|
||||
if(!_15||this._lastValidState===undefined){
|
||||
_16=this.isValid();
|
||||
if(this._lastValidState===undefined){
|
||||
this._lastValidState=_16;
|
||||
}
|
||||
}else{
|
||||
if(_15.isValid){
|
||||
this._invalidWidgets=dojo.filter(this._invalidWidgets||[],function(w){
|
||||
return (w!=_15);
|
||||
},this);
|
||||
if(!_15.isValid()&&!_15.get("disabled")){
|
||||
this._invalidWidgets.push(_15);
|
||||
}
|
||||
_16=(this._invalidWidgets.length===0);
|
||||
}
|
||||
}
|
||||
if(_16!==this._lastValidState){
|
||||
this._lastValidState=_16;
|
||||
this.onValidStateChange(_16);
|
||||
}
|
||||
},connectChildren:function(){
|
||||
dojo.forEach(this._changeConnections,dojo.hitch(this,"disconnect"));
|
||||
var _17=this;
|
||||
var _18=(this._changeConnections=[]);
|
||||
dojo.forEach(dojo.filter(this.getDescendants(),function(_19){
|
||||
return _19.validate;
|
||||
}),function(_1a){
|
||||
_18.push(_17.connect(_1a,"validate",dojo.hitch(_17,"_widgetChange",_1a)));
|
||||
_18.push(_17.connect(_1a,"_setDisabledAttr",dojo.hitch(_17,"_widgetChange",_1a)));
|
||||
});
|
||||
this._widgetChange(null);
|
||||
},startup:function(){
|
||||
this.inherited(arguments);
|
||||
this._changeConnections=[];
|
||||
this.connectChildren();
|
||||
}});
|
||||
}
|
||||
@@ -0,0 +1,307 @@
|
||||
/*
|
||||
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._FormSelectWidget"]){
|
||||
dojo._hasResource["dijit.form._FormSelectWidget"]=true;
|
||||
dojo.provide("dijit.form._FormSelectWidget");
|
||||
dojo.require("dijit.form._FormWidget");
|
||||
dojo.require("dojo.data.util.sorter");
|
||||
dojo.declare("dijit.form._FormSelectWidget",dijit.form._FormValueWidget,{multiple:false,options:null,store:null,query:null,queryOptions:null,onFetch:null,sortByLabel:true,loadChildrenOnOpen:false,getOptions:function(_1){
|
||||
var _2=_1,_3=this.options||[],l=_3.length;
|
||||
if(_2===undefined){
|
||||
return _3;
|
||||
}
|
||||
if(dojo.isArray(_2)){
|
||||
return dojo.map(_2,"return this.getOptions(item);",this);
|
||||
}
|
||||
if(dojo.isObject(_1)){
|
||||
if(!dojo.some(this.options,function(o,_4){
|
||||
if(o===_2||(o.value&&o.value===_2.value)){
|
||||
_2=_4;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
})){
|
||||
_2=-1;
|
||||
}
|
||||
}
|
||||
if(typeof _2=="string"){
|
||||
for(var i=0;i<l;i++){
|
||||
if(_3[i].value===_2){
|
||||
_2=i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(typeof _2=="number"&&_2>=0&&_2<l){
|
||||
return this.options[_2];
|
||||
}
|
||||
return null;
|
||||
},addOption:function(_5){
|
||||
if(!dojo.isArray(_5)){
|
||||
_5=[_5];
|
||||
}
|
||||
dojo.forEach(_5,function(i){
|
||||
if(i&&dojo.isObject(i)){
|
||||
this.options.push(i);
|
||||
}
|
||||
},this);
|
||||
this._loadChildren();
|
||||
},removeOption:function(_6){
|
||||
if(!dojo.isArray(_6)){
|
||||
_6=[_6];
|
||||
}
|
||||
var _7=this.getOptions(_6);
|
||||
dojo.forEach(_7,function(i){
|
||||
if(i){
|
||||
this.options=dojo.filter(this.options,function(_8,_9){
|
||||
return (_8.value!==i.value);
|
||||
});
|
||||
this._removeOptionItem(i);
|
||||
}
|
||||
},this);
|
||||
this._loadChildren();
|
||||
},updateOption:function(_a){
|
||||
if(!dojo.isArray(_a)){
|
||||
_a=[_a];
|
||||
}
|
||||
dojo.forEach(_a,function(i){
|
||||
var _b=this.getOptions(i),k;
|
||||
if(_b){
|
||||
for(k in i){
|
||||
_b[k]=i[k];
|
||||
}
|
||||
}
|
||||
},this);
|
||||
this._loadChildren();
|
||||
},setStore:function(_c,_d,_e){
|
||||
var _f=this.store;
|
||||
_e=_e||{};
|
||||
if(_f!==_c){
|
||||
dojo.forEach(this._notifyConnections||[],dojo.disconnect);
|
||||
delete this._notifyConnections;
|
||||
if(_c&&_c.getFeatures()["dojo.data.api.Notification"]){
|
||||
this._notifyConnections=[dojo.connect(_c,"onNew",this,"_onNewItem"),dojo.connect(_c,"onDelete",this,"_onDeleteItem"),dojo.connect(_c,"onSet",this,"_onSetItem")];
|
||||
}
|
||||
this.store=_c;
|
||||
}
|
||||
this._onChangeActive=false;
|
||||
if(this.options&&this.options.length){
|
||||
this.removeOption(this.options);
|
||||
}
|
||||
if(_c){
|
||||
var cb=function(_10){
|
||||
if(this.sortByLabel&&!_e.sort&&_10.length){
|
||||
_10.sort(dojo.data.util.sorter.createSortFunction([{attribute:_c.getLabelAttributes(_10[0])[0]}],_c));
|
||||
}
|
||||
if(_e.onFetch){
|
||||
_10=_e.onFetch(_10);
|
||||
}
|
||||
dojo.forEach(_10,function(i){
|
||||
this._addOptionForItem(i);
|
||||
},this);
|
||||
this._loadingStore=false;
|
||||
this.set("value",(("_pendingValue" in this)?this._pendingValue:_d));
|
||||
delete this._pendingValue;
|
||||
if(!this.loadChildrenOnOpen){
|
||||
this._loadChildren();
|
||||
}else{
|
||||
this._pseudoLoadChildren(_10);
|
||||
}
|
||||
this._fetchedWith=_11;
|
||||
this._lastValueReported=this.multiple?[]:null;
|
||||
this._onChangeActive=true;
|
||||
this.onSetStore();
|
||||
this._handleOnChange(this.value);
|
||||
};
|
||||
var _11=dojo.mixin({onComplete:cb,scope:this},_e);
|
||||
this._loadingStore=true;
|
||||
_c.fetch(_11);
|
||||
}else{
|
||||
delete this._fetchedWith;
|
||||
}
|
||||
return _f;
|
||||
},_setValueAttr:function(_12,_13){
|
||||
if(this._loadingStore){
|
||||
this._pendingValue=_12;
|
||||
return;
|
||||
}
|
||||
var _14=this.getOptions()||[];
|
||||
if(!dojo.isArray(_12)){
|
||||
_12=[_12];
|
||||
}
|
||||
dojo.forEach(_12,function(i,idx){
|
||||
if(!dojo.isObject(i)){
|
||||
i=i+"";
|
||||
}
|
||||
if(typeof i==="string"){
|
||||
_12[idx]=dojo.filter(_14,function(_15){
|
||||
return _15.value===i;
|
||||
})[0]||{value:"",label:""};
|
||||
}
|
||||
},this);
|
||||
_12=dojo.filter(_12,function(i){
|
||||
return i&&i.value;
|
||||
});
|
||||
if(!this.multiple&&(!_12[0]||!_12[0].value)&&_14.length){
|
||||
_12[0]=_14[0];
|
||||
}
|
||||
dojo.forEach(_14,function(i){
|
||||
i.selected=dojo.some(_12,function(v){
|
||||
return v.value===i.value;
|
||||
});
|
||||
});
|
||||
var val=dojo.map(_12,function(i){
|
||||
return i.value;
|
||||
}),_16=dojo.map(_12,function(i){
|
||||
return i.label;
|
||||
});
|
||||
this.value=this.multiple?val:val[0];
|
||||
this._setDisplay(this.multiple?_16:_16[0]);
|
||||
this._updateSelection();
|
||||
this._handleOnChange(this.value,_13);
|
||||
},_getDisplayedValueAttr:function(){
|
||||
var val=this.get("value");
|
||||
if(!dojo.isArray(val)){
|
||||
val=[val];
|
||||
}
|
||||
var ret=dojo.map(this.getOptions(val),function(v){
|
||||
if(v&&"label" in v){
|
||||
return v.label;
|
||||
}else{
|
||||
if(v){
|
||||
return v.value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},this);
|
||||
return this.multiple?ret:ret[0];
|
||||
},_getValueDeprecated:false,getValue:function(){
|
||||
return this._lastValue;
|
||||
},undo:function(){
|
||||
this._setValueAttr(this._lastValueReported,false);
|
||||
},_loadChildren:function(){
|
||||
if(this._loadingStore){
|
||||
return;
|
||||
}
|
||||
dojo.forEach(this._getChildren(),function(_17){
|
||||
_17.destroyRecursive();
|
||||
});
|
||||
dojo.forEach(this.options,this._addOptionItem,this);
|
||||
this._updateSelection();
|
||||
},_updateSelection:function(){
|
||||
this.value=this._getValueFromOpts();
|
||||
var val=this.value;
|
||||
if(!dojo.isArray(val)){
|
||||
val=[val];
|
||||
}
|
||||
if(val&&val[0]){
|
||||
dojo.forEach(this._getChildren(),function(_18){
|
||||
var _19=dojo.some(val,function(v){
|
||||
return _18.option&&(v===_18.option.value);
|
||||
});
|
||||
dojo.toggleClass(_18.domNode,this.baseClass+"SelectedOption",_19);
|
||||
dijit.setWaiState(_18.domNode,"selected",_19);
|
||||
},this);
|
||||
}
|
||||
this._handleOnChange(this.value);
|
||||
},_getValueFromOpts:function(){
|
||||
var _1a=this.getOptions()||[];
|
||||
if(!this.multiple&&_1a.length){
|
||||
var opt=dojo.filter(_1a,function(i){
|
||||
return i.selected;
|
||||
})[0];
|
||||
if(opt&&opt.value){
|
||||
return opt.value;
|
||||
}else{
|
||||
_1a[0].selected=true;
|
||||
return _1a[0].value;
|
||||
}
|
||||
}else{
|
||||
if(this.multiple){
|
||||
return dojo.map(dojo.filter(_1a,function(i){
|
||||
return i.selected;
|
||||
}),function(i){
|
||||
return i.value;
|
||||
})||[];
|
||||
}
|
||||
}
|
||||
return "";
|
||||
},_onNewItem:function(_1b,_1c){
|
||||
if(!_1c||!_1c.parent){
|
||||
this._addOptionForItem(_1b);
|
||||
}
|
||||
},_onDeleteItem:function(_1d){
|
||||
var _1e=this.store;
|
||||
this.removeOption(_1e.getIdentity(_1d));
|
||||
},_onSetItem:function(_1f){
|
||||
this.updateOption(this._getOptionObjForItem(_1f));
|
||||
},_getOptionObjForItem:function(_20){
|
||||
var _21=this.store,_22=_21.getLabel(_20),_23=(_22?_21.getIdentity(_20):null);
|
||||
return {value:_23,label:_22,item:_20};
|
||||
},_addOptionForItem:function(_24){
|
||||
var _25=this.store;
|
||||
if(!_25.isItemLoaded(_24)){
|
||||
_25.loadItem({item:_24,onComplete:function(i){
|
||||
this._addOptionForItem(_24);
|
||||
},scope:this});
|
||||
return;
|
||||
}
|
||||
var _26=this._getOptionObjForItem(_24);
|
||||
this.addOption(_26);
|
||||
},constructor:function(_27){
|
||||
this._oValue=(_27||{}).value||null;
|
||||
},_fillContent:function(){
|
||||
var _28=this.options;
|
||||
if(!_28){
|
||||
_28=this.options=this.srcNodeRef?dojo.query(">",this.srcNodeRef).map(function(_29){
|
||||
if(_29.getAttribute("type")==="separator"){
|
||||
return {value:"",label:"",selected:false,disabled:false};
|
||||
}
|
||||
return {value:_29.getAttribute("value"),label:String(_29.innerHTML),selected:_29.getAttribute("selected")||false,disabled:_29.getAttribute("disabled")||false};
|
||||
},this):[];
|
||||
}
|
||||
if(!this.value){
|
||||
this.value=this._getValueFromOpts();
|
||||
}else{
|
||||
if(this.multiple&&typeof this.value=="string"){
|
||||
this.value=this.value.split(",");
|
||||
}
|
||||
}
|
||||
},postCreate:function(){
|
||||
dojo.setSelectable(this.focusNode,false);
|
||||
this.inherited(arguments);
|
||||
this.connect(this,"onChange","_updateSelection");
|
||||
this.connect(this,"startup","_loadChildren");
|
||||
this._setValueAttr(this.value,null);
|
||||
},startup:function(){
|
||||
this.inherited(arguments);
|
||||
var _2a=this.store,_2b={};
|
||||
dojo.forEach(["query","queryOptions","onFetch"],function(i){
|
||||
if(this[i]){
|
||||
_2b[i]=this[i];
|
||||
}
|
||||
delete this[i];
|
||||
},this);
|
||||
if(_2a&&_2a.getFeatures()["dojo.data.api.Identity"]){
|
||||
this.store=null;
|
||||
this.setStore(_2a,this._oValue,_2b);
|
||||
}
|
||||
},destroy:function(){
|
||||
dojo.forEach(this._notifyConnections||[],dojo.disconnect);
|
||||
this.inherited(arguments);
|
||||
},_addOptionItem:function(_2c){
|
||||
},_removeOptionItem:function(_2d){
|
||||
},_setDisplay:function(_2e){
|
||||
},_getChildren:function(){
|
||||
return [];
|
||||
},_getSelectedOptionsAttr:function(){
|
||||
return this.getOptions(this.get("value"));
|
||||
},_pseudoLoadChildren:function(_2f){
|
||||
},onSetStore:function(){
|
||||
}});
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
/*
|
||||
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._FormWidget"]){
|
||||
dojo._hasResource["dijit.form._FormWidget"]=true;
|
||||
dojo.provide("dijit.form._FormWidget");
|
||||
dojo.require("dojo.window");
|
||||
dojo.require("dijit._Widget");
|
||||
dojo.require("dijit._Templated");
|
||||
dojo.require("dijit._CssStateMixin");
|
||||
dojo.declare("dijit.form._FormWidget",[dijit._Widget,dijit._Templated,dijit._CssStateMixin],{name:"",alt:"",value:"",type:"text",tabIndex:"0",disabled:false,intermediateChanges:false,scrollOnFocus:true,attributeMap:dojo.delegate(dijit._Widget.prototype.attributeMap,{value:"focusNode",id:"focusNode",tabIndex:"focusNode",alt:"focusNode",title:"focusNode"}),postMixInProperties:function(){
|
||||
this.nameAttrSetting=this.name?("name=\""+this.name.replace(/'/g,""")+"\""):"";
|
||||
this.inherited(arguments);
|
||||
},postCreate:function(){
|
||||
this.inherited(arguments);
|
||||
this.connect(this.domNode,"onmousedown","_onMouseDown");
|
||||
},_setDisabledAttr:function(_1){
|
||||
this.disabled=_1;
|
||||
dojo.attr(this.focusNode,"disabled",_1);
|
||||
if(this.valueNode){
|
||||
dojo.attr(this.valueNode,"disabled",_1);
|
||||
}
|
||||
dijit.setWaiState(this.focusNode,"disabled",_1);
|
||||
if(_1){
|
||||
this._hovering=false;
|
||||
this._active=false;
|
||||
var _2="tabIndex" in this.attributeMap?this.attributeMap.tabIndex:"focusNode";
|
||||
dojo.forEach(dojo.isArray(_2)?_2:[_2],function(_3){
|
||||
var _4=this[_3];
|
||||
if(dojo.isWebKit||dijit.hasDefaultTabStop(_4)){
|
||||
_4.setAttribute("tabIndex","-1");
|
||||
}else{
|
||||
_4.removeAttribute("tabIndex");
|
||||
}
|
||||
},this);
|
||||
}else{
|
||||
this.focusNode.setAttribute("tabIndex",this.tabIndex);
|
||||
}
|
||||
},setDisabled:function(_5){
|
||||
dojo.deprecated("setDisabled("+_5+") is deprecated. Use set('disabled',"+_5+") instead.","","2.0");
|
||||
this.set("disabled",_5);
|
||||
},_onFocus:function(e){
|
||||
if(this.scrollOnFocus){
|
||||
dojo.window.scrollIntoView(this.domNode);
|
||||
}
|
||||
this.inherited(arguments);
|
||||
},isFocusable:function(){
|
||||
return !this.disabled&&!this.readOnly&&this.focusNode&&(dojo.style(this.domNode,"display")!="none");
|
||||
},focus:function(){
|
||||
dijit.focus(this.focusNode);
|
||||
},compare:function(_6,_7){
|
||||
if(typeof _6=="number"&&typeof _7=="number"){
|
||||
return (isNaN(_6)&&isNaN(_7))?0:_6-_7;
|
||||
}else{
|
||||
if(_6>_7){
|
||||
return 1;
|
||||
}else{
|
||||
if(_6<_7){
|
||||
return -1;
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
},onChange:function(_8){
|
||||
},_onChangeActive:false,_handleOnChange:function(_9,_a){
|
||||
this._lastValue=_9;
|
||||
if(this._lastValueReported==undefined&&(_a===null||!this._onChangeActive)){
|
||||
this._resetValue=this._lastValueReported=_9;
|
||||
}
|
||||
if((this.intermediateChanges||_a||_a===undefined)&&((typeof _9!=typeof this._lastValueReported)||this.compare(_9,this._lastValueReported)!=0)){
|
||||
this._lastValueReported=_9;
|
||||
if(this._onChangeActive){
|
||||
if(this._onChangeHandle){
|
||||
clearTimeout(this._onChangeHandle);
|
||||
}
|
||||
this._onChangeHandle=setTimeout(dojo.hitch(this,function(){
|
||||
this._onChangeHandle=null;
|
||||
this.onChange(_9);
|
||||
}),0);
|
||||
}
|
||||
}
|
||||
},create:function(){
|
||||
this.inherited(arguments);
|
||||
this._onChangeActive=true;
|
||||
},destroy:function(){
|
||||
if(this._onChangeHandle){
|
||||
clearTimeout(this._onChangeHandle);
|
||||
this.onChange(this._lastValueReported);
|
||||
}
|
||||
this.inherited(arguments);
|
||||
},setValue:function(_b){
|
||||
dojo.deprecated("dijit.form._FormWidget:setValue("+_b+") is deprecated. Use set('value',"+_b+") instead.","","2.0");
|
||||
this.set("value",_b);
|
||||
},getValue:function(){
|
||||
dojo.deprecated(this.declaredClass+"::getValue() is deprecated. Use get('value') instead.","","2.0");
|
||||
return this.get("value");
|
||||
},_onMouseDown:function(e){
|
||||
if(!e.ctrlKey&&this.isFocusable()){
|
||||
var _c=this.connect(dojo.body(),"onmouseup",function(){
|
||||
if(this.isFocusable()){
|
||||
this.focus();
|
||||
}
|
||||
this.disconnect(_c);
|
||||
});
|
||||
}
|
||||
}});
|
||||
dojo.declare("dijit.form._FormValueWidget",dijit.form._FormWidget,{readOnly:false,attributeMap:dojo.delegate(dijit.form._FormWidget.prototype.attributeMap,{value:"",readOnly:"focusNode"}),_setReadOnlyAttr:function(_d){
|
||||
this.readOnly=_d;
|
||||
dojo.attr(this.focusNode,"readOnly",_d);
|
||||
dijit.setWaiState(this.focusNode,"readonly",_d);
|
||||
},postCreate:function(){
|
||||
this.inherited(arguments);
|
||||
if(dojo.isIE){
|
||||
this.connect(this.focusNode||this.domNode,"onkeydown",this._onKeyDown);
|
||||
}
|
||||
if(this._resetValue===undefined){
|
||||
this._resetValue=this.value;
|
||||
}
|
||||
},_setValueAttr:function(_e,_f){
|
||||
this.value=_e;
|
||||
this._handleOnChange(_e,_f);
|
||||
},_getValueAttr:function(){
|
||||
return this._lastValue;
|
||||
},undo:function(){
|
||||
this._setValueAttr(this._lastValueReported,false);
|
||||
},reset:function(){
|
||||
this._hasBeenBlurred=false;
|
||||
this._setValueAttr(this._resetValue,true);
|
||||
},_onKeyDown:function(e){
|
||||
if(e.keyCode==dojo.keys.ESCAPE&&!(e.ctrlKey||e.altKey||e.metaKey)){
|
||||
var te;
|
||||
if(dojo.isIE){
|
||||
e.preventDefault();
|
||||
te=document.createEventObject();
|
||||
te.keyCode=dojo.keys.ESCAPE;
|
||||
te.shiftKey=e.shiftKey;
|
||||
e.srcElement.fireEvent("onkeypress",te);
|
||||
}
|
||||
}
|
||||
},_layoutHackIE7:function(){
|
||||
if(dojo.isIE==7){
|
||||
var _10=this.domNode;
|
||||
var _11=_10.parentNode;
|
||||
var _12=_10.firstChild||_10;
|
||||
var _13=_12.style.filter;
|
||||
var _14=this;
|
||||
while(_11&&_11.clientHeight==0){
|
||||
(function ping(){
|
||||
var _15=_14.connect(_11,"onscroll",function(e){
|
||||
_14.disconnect(_15);
|
||||
_12.style.filter=(new Date()).getMilliseconds();
|
||||
setTimeout(function(){
|
||||
_12.style.filter=_13;
|
||||
},0);
|
||||
});
|
||||
})();
|
||||
_11=_11.parentNode;
|
||||
}
|
||||
}
|
||||
}});
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
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._Spinner"]){
|
||||
dojo._hasResource["dijit.form._Spinner"]=true;
|
||||
dojo.provide("dijit.form._Spinner");
|
||||
dojo.require("dijit.form.ValidationTextBox");
|
||||
dojo.declare("dijit.form._Spinner",dijit.form.RangeBoundTextBox,{defaultTimeout:500,minimumTimeout:10,timeoutChangeRate:0.9,smallDelta:1,largeDelta:10,templateString:dojo.cache("dijit.form","templates/Spinner.html","<div class=\"dijit dijitReset dijitInlineTable dijitLeft\"\n\tid=\"widget_${id}\" waiRole=\"presentation\"\n\t><div class=\"dijitReset dijitButtonNode dijitSpinnerButtonContainer\"\n\t\t><input class=\"dijitReset dijitInputField dijitSpinnerButtonInner\" type=\"text\" tabIndex=\"-1\" readOnly waiRole=\"presentation\"\n\t\t/><div class=\"dijitReset dijitLeft dijitButtonNode dijitArrowButton dijitUpArrowButton\"\n\t\t\tdojoAttachPoint=\"upArrowNode\"\n\t\t\t><div class=\"dijitArrowButtonInner\"\n\t\t\t\t><input class=\"dijitReset dijitInputField\" value=\"▲\" type=\"text\" tabIndex=\"-1\" readOnly waiRole=\"presentation\"\n\t\t\t\t\t${_buttonInputDisabled}\n\t\t\t/></div\n\t\t></div\n\t\t><div class=\"dijitReset dijitLeft dijitButtonNode dijitArrowButton dijitDownArrowButton\"\n\t\t\tdojoAttachPoint=\"downArrowNode\"\n\t\t\t><div class=\"dijitArrowButtonInner\"\n\t\t\t\t><input class=\"dijitReset dijitInputField\" value=\"▼\" type=\"text\" tabIndex=\"-1\" readOnly waiRole=\"presentation\"\n\t\t\t\t\t${_buttonInputDisabled}\n\t\t\t/></div\n\t\t></div\n\t></div\n\t><div class='dijitReset dijitValidationContainer'\n\t\t><input class=\"dijitReset dijitInputField dijitValidationIcon dijitValidationInner\" value=\"Χ \" type=\"text\" tabIndex=\"-1\" readOnly waiRole=\"presentation\"\n\t/></div\n\t><div class=\"dijitReset dijitInputField dijitInputContainer\"\n\t\t><input class='dijitReset dijitInputInner' dojoAttachPoint=\"textbox,focusNode\" type=\"${type}\" dojoAttachEvent=\"onkeypress:_onKeyPress\"\n\t\t\twaiRole=\"spinbutton\" autocomplete=\"off\" ${!nameAttrSetting}\n\t/></div\n></div>\n"),baseClass:"dijitTextBox dijitSpinner",cssStateNodes:{"upArrowNode":"dijitUpArrowButton","downArrowNode":"dijitDownArrowButton"},adjust:function(_1,_2){
|
||||
return _1;
|
||||
},_arrowPressed:function(_3,_4,_5){
|
||||
if(this.disabled||this.readOnly){
|
||||
return;
|
||||
}
|
||||
this._setValueAttr(this.adjust(this.get("value"),_4*_5),false);
|
||||
dijit.selectInputText(this.textbox,this.textbox.value.length);
|
||||
},_arrowReleased:function(_6){
|
||||
this._wheelTimer=null;
|
||||
if(this.disabled||this.readOnly){
|
||||
return;
|
||||
}
|
||||
},_typematicCallback:function(_7,_8,_9){
|
||||
var _a=this.smallDelta;
|
||||
if(_8==this.textbox){
|
||||
var k=dojo.keys;
|
||||
var _b=_9.charOrCode;
|
||||
_a=(_b==k.PAGE_UP||_b==k.PAGE_DOWN)?this.largeDelta:this.smallDelta;
|
||||
_8=(_b==k.UP_ARROW||_b==k.PAGE_UP)?this.upArrowNode:this.downArrowNode;
|
||||
}
|
||||
if(_7==-1){
|
||||
this._arrowReleased(_8);
|
||||
}else{
|
||||
this._arrowPressed(_8,(_8==this.upArrowNode)?1:-1,_a);
|
||||
}
|
||||
},_wheelTimer:null,_mouseWheeled:function(_c){
|
||||
dojo.stopEvent(_c);
|
||||
var _d=_c.detail?(_c.detail*-1):(_c.wheelDelta/120);
|
||||
if(_d!==0){
|
||||
var _e=this[(_d>0?"upArrowNode":"downArrowNode")];
|
||||
this._arrowPressed(_e,_d,this.smallDelta);
|
||||
if(!this._wheelTimer){
|
||||
clearTimeout(this._wheelTimer);
|
||||
}
|
||||
this._wheelTimer=setTimeout(dojo.hitch(this,"_arrowReleased",_e),50);
|
||||
}
|
||||
},postCreate:function(){
|
||||
this.inherited(arguments);
|
||||
this.connect(this.domNode,!dojo.isMozilla?"onmousewheel":"DOMMouseScroll","_mouseWheeled");
|
||||
this._connects.push(dijit.typematic.addListener(this.upArrowNode,this.textbox,{charOrCode:dojo.keys.UP_ARROW,ctrlKey:false,altKey:false,shiftKey:false,metaKey:false},this,"_typematicCallback",this.timeoutChangeRate,this.defaultTimeout,this.minimumTimeout));
|
||||
this._connects.push(dijit.typematic.addListener(this.downArrowNode,this.textbox,{charOrCode:dojo.keys.DOWN_ARROW,ctrlKey:false,altKey:false,shiftKey:false,metaKey:false},this,"_typematicCallback",this.timeoutChangeRate,this.defaultTimeout,this.minimumTimeout));
|
||||
this._connects.push(dijit.typematic.addListener(this.upArrowNode,this.textbox,{charOrCode:dojo.keys.PAGE_UP,ctrlKey:false,altKey:false,shiftKey:false,metaKey:false},this,"_typematicCallback",this.timeoutChangeRate,this.defaultTimeout,this.minimumTimeout));
|
||||
this._connects.push(dijit.typematic.addListener(this.downArrowNode,this.textbox,{charOrCode:dojo.keys.PAGE_DOWN,ctrlKey:false,altKey:false,shiftKey:false,metaKey:false},this,"_typematicCallback",this.timeoutChangeRate,this.defaultTimeout,this.minimumTimeout));
|
||||
}});
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
({"previousMessage":"Previous choices","nextMessage":"More choices"})
|
||||
@@ -0,0 +1 @@
|
||||
({"iframeEditTitle":"edit area","iframeFocusTitle":"edit area frame"})
|
||||
@@ -0,0 +1 @@
|
||||
({"previousMessage":"الاختيارات السابقة","nextMessage":"مزيد من الاختيارات"})
|
||||
@@ -0,0 +1 @@
|
||||
({"iframeEditTitle":"مساحة التحرير","iframeFocusTitle":"اطار مساحة التحرير"})
|
||||
@@ -0,0 +1 @@
|
||||
({"rangeMessage":"هذه القيمة ليس بالمدى الصحيح.","invalidMessage":"القيمة التي تم ادخالها غير صحيحة.","missingMessage":"يجب ادخال هذه القيمة."})
|
||||
@@ -0,0 +1 @@
|
||||
({"previousMessage":"Opcions anteriors","nextMessage":"Més opcions"})
|
||||
@@ -0,0 +1 @@
|
||||
({"iframeEditTitle":"àrea d'edició","iframeFocusTitle":"Marc de l'àrea d'edició"})
|
||||
@@ -0,0 +1 @@
|
||||
({"rangeMessage":"Aquest valor és fora de l'interval","invalidMessage":"El valor introduït no és vàlid","missingMessage":"Aquest valor és necessari"})
|
||||
@@ -0,0 +1 @@
|
||||
({"previousMessage":"Předchozí volby","nextMessage":"Další volby"})
|
||||
@@ -0,0 +1 @@
|
||||
({"iframeEditTitle":"oblast úprav","iframeFocusTitle":"rámec oblasti úprav"})
|
||||
@@ -0,0 +1 @@
|
||||
({"rangeMessage":"Tato hodnota je mimo rozsah.","invalidMessage":"Zadaná hodnota není platná.","missingMessage":"Tato hodnota je vyžadována."})
|
||||
@@ -0,0 +1 @@
|
||||
({"previousMessage":"Forrige valg","nextMessage":"Flere valg"})
|
||||
@@ -0,0 +1 @@
|
||||
({"iframeEditTitle":"redigeringsområde","iframeFocusTitle":"ramme om redigeringsområde"})
|
||||
@@ -0,0 +1 @@
|
||||
({"rangeMessage":"Værdien er uden for intervallet.","invalidMessage":"Den angivne værdi er ugyldig.","missingMessage":"Værdien er påkrævet."})
|
||||
@@ -0,0 +1 @@
|
||||
({"previousMessage":"Vorherige Auswahl","nextMessage":"Weitere Auswahlmöglichkeiten"})
|
||||
@@ -0,0 +1 @@
|
||||
({"iframeEditTitle":"Editierbereich","iframeFocusTitle":"Rahmen für Editierbereich"})
|
||||
@@ -0,0 +1 @@
|
||||
({"rangeMessage":"Dieser Wert liegt außerhalb des gültigen Bereichs. ","invalidMessage":"Der eingegebene Wert ist ungültig. ","missingMessage":"Dieser Wert ist erforderlich."})
|
||||
@@ -0,0 +1 @@
|
||||
({"previousMessage":"Προηγούμενες επιλογές","nextMessage":"Περισσότερες επιλογές"})
|
||||
@@ -0,0 +1 @@
|
||||
({"iframeEditTitle":"περιοχή επεξεργασίας","iframeFocusTitle":"πλαίσιο περιοχής επεξεργασίας"})
|
||||
@@ -0,0 +1 @@
|
||||
({"rangeMessage":"Η τιμή αυτή δεν ανήκει στο εύρος έγκυρων τιμών.","invalidMessage":"Η τιμή που καταχωρήσατε δεν είναι έγκυρη.","missingMessage":"Η τιμή αυτή πρέπει απαραίτητα να καθοριστεί."})
|
||||
@@ -0,0 +1 @@
|
||||
({"previousMessage":"Opciones anteriores","nextMessage":"Más opciones"})
|
||||
@@ -0,0 +1 @@
|
||||
({"iframeEditTitle":"área de edición","iframeFocusTitle":"marco del área de edición"})
|
||||
@@ -0,0 +1 @@
|
||||
({"rangeMessage":"Este valor está fuera del intervalo.","invalidMessage":"El valor especificado no es válido.","missingMessage":"Este valor es necesario."})
|
||||
@@ -0,0 +1 @@
|
||||
({"previousMessage":"Edelliset valinnat","nextMessage":"Lisää valintoja"})
|
||||
@@ -0,0 +1 @@
|
||||
({"iframeEditTitle":"muokkausalue","iframeFocusTitle":"muokkausalueen kehys"})
|
||||
@@ -0,0 +1 @@
|
||||
({"rangeMessage":"Tämä arvo on sallitun alueen ulkopuolella.","invalidMessage":"Annettu arvo ei kelpaa.","missingMessage":"Tämä arvo on pakollinen."})
|
||||
@@ -0,0 +1 @@
|
||||
({"previousMessage":"Choix précédents","nextMessage":"Plus de choix"})
|
||||
@@ -0,0 +1 @@
|
||||
({"iframeEditTitle":"zone d'édition","iframeFocusTitle":"cadre de la zone d'édition"})
|
||||
@@ -0,0 +1 @@
|
||||
({"rangeMessage":"Cette valeur n'est pas comprise dans la plage autorisée.","invalidMessage":"La valeur indiquée n'est pas correcte.","missingMessage":"Cette valeur est requise."})
|
||||
@@ -0,0 +1 @@
|
||||
({"previousMessage":"האפשרויות הקודמות","nextMessage":"אפשרויות נוספות"})
|
||||
@@ -0,0 +1 @@
|
||||
({"iframeEditTitle":"אזור עריכה","iframeFocusTitle":"מסגרת אזור עריכה"})
|
||||
@@ -0,0 +1 @@
|
||||
({"rangeMessage":"הערך מחוץ לטווח.","invalidMessage":"הערך שצוין אינו חוקי.","missingMessage":"זהו ערך דרוש."})
|
||||
@@ -0,0 +1 @@
|
||||
({"previousMessage":"Előző menüpontok","nextMessage":"További menüpontok"})
|
||||
@@ -0,0 +1 @@
|
||||
({"iframeEditTitle":"szerkesztési terület","iframeFocusTitle":"szerkesztési terület keret"})
|
||||
@@ -0,0 +1 @@
|
||||
({"rangeMessage":"Az érték kívül van a megengedett tartományon.","invalidMessage":"A megadott érték érvénytelen.","missingMessage":"Meg kell adni egy értéket."})
|
||||
@@ -0,0 +1 @@
|
||||
({"previousMessage":"Scelte precedenti","nextMessage":"Altre scelte"})
|
||||
@@ -0,0 +1 @@
|
||||
({"iframeEditTitle":"modifica area","iframeFocusTitle":"modifica frame area"})
|
||||
@@ -0,0 +1 @@
|
||||
({"rangeMessage":"Questo valore non è compreso nell'intervallo.","invalidMessage":"Il valore immesso non è valido.","missingMessage":"Questo valore è obbligatorio."})
|
||||
@@ -0,0 +1 @@
|
||||
({"previousMessage":"以前の選択項目","nextMessage":"追加の選択項目"})
|
||||
@@ -0,0 +1 @@
|
||||
({"iframeEditTitle":"編集域","iframeFocusTitle":"編集域フレーム"})
|
||||
@@ -0,0 +1 @@
|
||||
({"rangeMessage":"この値は範囲外です。","invalidMessage":"入力した値は無効です。","missingMessage":"この値は必須です。"})
|
||||
@@ -0,0 +1 @@
|
||||
({"previousMessage":"이전 선택사항","nextMessage":"기타 선택사항"})
|
||||
@@ -0,0 +1 @@
|
||||
({"iframeEditTitle":"편집 영역","iframeFocusTitle":"편집 영역 프레임"})
|
||||
@@ -0,0 +1 @@
|
||||
({"rangeMessage":"이 값은 범위를 벗어납니다.","invalidMessage":"입력된 값이 올바르지 않습니다.","missingMessage":"이 값은 필수입니다."})
|
||||
@@ -0,0 +1 @@
|
||||
({"previousMessage":"Tidligere valg","nextMessage":"Flere valg"})
|
||||
@@ -0,0 +1 @@
|
||||
({"iframeEditTitle":"redigeringsområde","iframeFocusTitle":"ramme for redigeringsområde"})
|
||||
@@ -0,0 +1 @@
|
||||
({"rangeMessage":"Denne verdien er utenfor gyldig område.","invalidMessage":"Den angitte verdien er ikke gyldig.","missingMessage":"Denne verdien er obligatorisk."})
|
||||
@@ -0,0 +1 @@
|
||||
({"previousMessage":"Eerdere opties","nextMessage":"Meer opties"})
|
||||
@@ -0,0 +1 @@
|
||||
({"iframeEditTitle":"veld bewerken","iframeFocusTitle":"veldkader bewerken"})
|
||||
@@ -0,0 +1 @@
|
||||
({"rangeMessage":"Deze waarde is niet toegestaan.","invalidMessage":"De opgegeven waarde is ongeldig.","missingMessage":"Deze waarde is verplicht."})
|
||||
@@ -0,0 +1 @@
|
||||
({"previousMessage":"Poprzednie wybory","nextMessage":"Więcej wyborów"})
|
||||
@@ -0,0 +1 @@
|
||||
({"iframeEditTitle":"Obszar edycji","iframeFocusTitle":"Ramka obszaru edycji"})
|
||||
@@ -0,0 +1 @@
|
||||
({"rangeMessage":"Ta wartość jest spoza zakresu.","invalidMessage":"Wprowadzona wartość jest niepoprawna.","missingMessage":"Ta wartość jest wymagana."})
|
||||
@@ -0,0 +1 @@
|
||||
({"previousMessage":"Opções anteriores","nextMessage":"Mais opções"})
|
||||
@@ -0,0 +1 @@
|
||||
({"iframeEditTitle":"área de edição","iframeFocusTitle":"painel da área de edição"})
|
||||
@@ -0,0 +1 @@
|
||||
({"rangeMessage":"Este valor encontra-se fora do intervalo.","invalidMessage":"O valor introduzido não é válido.","missingMessage":"Este valor é requerido."})
|
||||
@@ -0,0 +1 @@
|
||||
({"previousMessage":"Opções anteriores","nextMessage":"Mais opções"})
|
||||
@@ -0,0 +1 @@
|
||||
({"iframeEditTitle":"editar área","iframeFocusTitle":"editar quadro da área"})
|
||||
@@ -0,0 +1 @@
|
||||
({"rangeMessage":"Este valor está fora do intervalo. ","invalidMessage":"O valor inserido não é válido.","missingMessage":"Este valor é necessário."})
|
||||
@@ -0,0 +1 @@
|
||||
({"previousMessage":"Alegeri anterioare","nextMessage":"Mai multe alegeri"})
|
||||
@@ -0,0 +1 @@
|
||||
({"iframeEditTitle":"zonă de editare","iframeFocusTitle":"cadru zonă de editare"})
|
||||
@@ -0,0 +1 @@
|
||||
({"rangeMessage":"Această valoare este în afara intervalului. ","invalidMessage":"Valoarea introdusă nu este validă.","missingMessage":"Această valoare este necesară."})
|
||||
@@ -0,0 +1 @@
|
||||
({"previousMessage":"Предыдущие варианты","nextMessage":"Следующие варианты"})
|
||||
@@ -0,0 +1 @@
|
||||
({"iframeEditTitle":"область редактирования","iframeFocusTitle":"фрейм области редактирования"})
|
||||
@@ -0,0 +1 @@
|
||||
({"rangeMessage":"Это значение вне диапазона.","invalidMessage":"Указано недопустимое значение.","missingMessage":"Это обязательное значение."})
|
||||
@@ -0,0 +1 @@
|
||||
({"previousMessage":"Predchádzajúce voľby","nextMessage":"Ďalšie voľby"})
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user