]> git.wh0rd.org - tt-rss.git/blob - lib/dijit/form/_FormWidget.js.uncompressed.js
upgrade dojo to 1.8.3 (refs #570)
[tt-rss.git] / 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
5 "dojo/ready",
6 "../_Widget",
7 "../_CssStateMixin",
8 "../_TemplatedMixin",
9 "./_FormWidgetMixin"
10 ], function(declare, has, kernel, ready, _Widget, _CssStateMixin, _TemplatedMixin, _FormWidgetMixin){
11
12
13 // module:
14 // dijit/form/_FormWidget
15
16 // Back compat w/1.6, remove for 2.0
17 if(has("dijit-legacy-requires")){
18 ready(0, function(){
19 var requires = ["dijit/form/_FormValueWidget"];
20 require(requires); // use indirection so modules not rolled into a build
21 });
22 }
23
24 return declare("dijit.form._FormWidget", [_Widget, _TemplatedMixin, _CssStateMixin, _FormWidgetMixin], {
25 // summary:
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.
28 //
29 // description:
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()`.
33 //
34 // They also share some common methods.
35
36 setDisabled: function(/*Boolean*/ disabled){
37 // summary:
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);
41 },
42
43 setValue: function(/*String*/ value){
44 // summary:
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);
48 },
49
50 getValue: function(){
51 // summary:
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');
55 },
56
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, "&quot;") + '"') : '';
63 this.inherited(arguments);
64 },
65
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
68 _setTypeAttr: null
69 });
70
71 });