]>
git.wh0rd.org - tt-rss.git/blob - lib/dijit/form/_FormWidget.js.uncompressed.js
1 define("dijit/form/_FormWidget", [
2 "dojo/_base/declare", // declare
3 "dojo/has", // has("dijit-legacy-requires")
4 "dojo/_base/kernel", // kernel.deprecated
10 ], function(declare
, has
, kernel
, ready
, _Widget
, _CssStateMixin
, _TemplatedMixin
, _FormWidgetMixin
){
14 // dijit/form/_FormWidget
16 // Back compat w/1.6, remove for 2.0
17 if(has("dijit-legacy-requires")){
19 var requires
= ["dijit/form/_FormValueWidget"];
20 require(requires
); // use indirection so modules not rolled into a build
24 return declare("dijit.form._FormWidget", [_Widget
, _TemplatedMixin
, _CssStateMixin
, _FormWidgetMixin
], {
26 // Base class for widgets corresponding to native HTML elements such as `<checkbox>` or `<button>`,
27 // which can be children of a `<form>` node or a `dijit/form/Form` widget.
30 // Represents a single HTML element.
31 // All these widgets should have these attributes just like native HTML input elements.
32 // You can set them during widget construction or afterwards, via `dijit/_WidgetBase.set()`.
34 // They also share some common methods.
36 setDisabled: function(/*Boolean*/ disabled
){
38 // Deprecated. Use set('disabled', ...) instead.
39 kernel
.deprecated("setDisabled("+disabled
+") is deprecated. Use set('disabled',"+disabled
+") instead.", "", "2.0");
40 this.set('disabled', disabled
);
43 setValue: function(/*String*/ value
){
45 // Deprecated. Use set('value', ...) instead.
46 kernel
.deprecated("dijit.form._FormWidget:setValue("+value
+") is deprecated. Use set('value',"+value
+") instead.", "", "2.0");
47 this.set('value', value
);
52 // Deprecated. Use get('value') instead.
53 kernel
.deprecated(this.declaredClass
+"::getValue() is deprecated. Use get('value') instead.", "", "2.0");
54 return this.get('value');
57 postMixInProperties: function(){
58 // Setup name=foo string to be referenced from the template (but only if a name has been specified)
59 // Unfortunately we can't use _setNameAttr to set the name due to IE limitations, see #8484, #8660.
60 // Regarding escaping, see heading "Attribute values" in
61 // http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.3.2
62 this.nameAttrSetting
= this.name
? ('name="' + this.name
.replace(/"/g, ""
;") + '"') : '';
63 this.inherited(arguments);
66 // Override automatic assigning type --> focusNode, it causes exception on IE.
67 // Instead, type must be specified as ${type} in the template, as part of the original DOM