From 2f01fe57a8d37767827d6db42850aef86a767c53 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 15 Nov 2010 10:39:52 +0300 Subject: add dijit/dojo stuff; initial ui mockup --- lib/dijit/form/Form.js | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 lib/dijit/form/Form.js (limited to 'lib/dijit/form/Form.js') diff --git a/lib/dijit/form/Form.js b/lib/dijit/form/Form.js new file mode 100644 index 000000000..618700b5d --- /dev/null +++ b/lib/dijit/form/Form.js @@ -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:"
",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(); +} +}}); +} -- cgit v1.2.3