a:21:{s:9:"#provides";s:29:"dojox.form.manager._NodeMixin";s:9:"#resource";s:26:"form/manager/_NodeMixin.js";s:9:"#requires";a:1:{i:0;a:2:{i:0;s:6:"common";i:1;s:25:"dojox.form.manager._Mixin";}}s:29:"dojox.form.manager._NodeMixin";a:4:{s:4:"type";s:8:"Function";s:7:"summary";s:58:"Mixin to orchestrate dynamic forms (works with DOM nodes).";s:11:"description";s:263:"This mixin provideas a foundation for an enhanced form functionality: unified access to individual form elements, unified "onchange" event processing, and general event processing. It complements dojox.form.manager._Mixin extending the functionality to DOM nodes.";s:9:"classlike";b:1;}s:37:"dojox.form.manager._NodeMixin.destroy";a:4:{s:9:"prototype";s:29:"dojox.form.manager._NodeMixin";s:4:"type";s:8:"Function";s:6:"source";s:165:" for(var name in this.formNodes){ dojo.forEach(this.formNodes[name].connections, dojo.disconnect); } this.formNodes = {}; this.inherited(arguments);";s:7:"summary";s:41:"Called when the widget is being destroyed";}s:42:"dojox.form.manager._NodeMixin.registerNode";a:7:{s:9:"prototype";s:29:"dojox.form.manager._NodeMixin";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"node";a:2:{s:4:"type";s:11:"String|Node";s:7:"summary";s:17:"A node, or its id";}}s:6:"source";s:216:" if(typeof node == "string"){ node = dojo.byId(node); } var name = registerNode.call(this, node); if(name){ connectNode.call(this, name, getObserversFromNode.call(this, name)); } return this;";s:7:"summary";s:37:"Register a node with the form manager";s:14:"return_summary";s:20:"Object: Returns self";s:6:"chains";a:1:{s:4:"call";a:2:{i:0;s:12:"registerNode";i:1;s:11:"connectNode";}}}s:44:"dojox.form.manager._NodeMixin.unregisterNode";a:6:{s:9:"prototype";s:29:"dojox.form.manager._NodeMixin";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"name";a:2:{s:4:"type";s:6:"String";s:7:"summary";s:25:"Name of the to unregister";}}s:6:"source";s:159:" if(name in this.formNodes){ dojo.forEach(this.formNodes[name].connections, this.disconnect, this); delete this.formNodes[name]; } return this;";s:7:"summary";s:79:"Removes the node by name from internal tables unregistering connected observers";s:14:"return_summary";s:20:"Object: Returns self";}s:53:"dojox.form.manager._NodeMixin.registerNodeDescendants";a:7:{s:9:"prototype";s:29:"dojox.form.manager._NodeMixin";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"node";a:2:{s:4:"type";s:11:"String|Node";s:7:"summary";s:42:"A widget, or its widgetId, or its DOM node";}}s:6:"source";s:360:" if(typeof node == "string"){ node = dojo.byId(node); } dojo.query("input, select, textarea, button", node). map(function(n){ return registerNode.call(this, n, node); }, this). forEach(function(name){ if(name){ connectNode.call(this, name, getObserversFromNode.call(this, name)); } }, this); return this;";s:7:"summary";s:62:"Register node's descendants (form nodes) with the form manager";s:14:"return_summary";s:20:"Object: Returns self";s:6:"chains";a:1:{s:4:"call";a:2:{i:0;s:12:"registerNode";i:1;s:11:"connectNode";}}}s:55:"dojox.form.manager._NodeMixin.unregisterNodeDescendants";a:6:{s:9:"prototype";s:29:"dojox.form.manager._NodeMixin";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"node";a:2:{s:4:"type";s:11:"String|Node";s:7:"summary";s:42:"A widget, or its widgetId, or its DOM node";}}s:6:"source";s:302:" if(typeof node == "string"){ node = dojo.byId(node); } dojo.query("input, select, textarea, button", node). map(function(n){ return dojo.attr(node, "name") || null; }). forEach(function(name){ if(name){ this.unregisterNode(name); } }, this); return this;";s:7:"summary";s:64:"Unregister node's descendants (form nodes) with the form manager";s:14:"return_summary";s:20:"Object: Returns self";}s:43:"dojox.form.manager._NodeMixin.formNodeValue";a:7:{s:9:"prototype";s:29:"dojox.form.manager._NodeMixin";s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:4:"elem";a:2:{s:4:"type";s:17:"String|Node|Array";s:7:"summary";s:55:"Form element's name, DOM node, or array or radio nodes.";}s:5:"value";a:3:{s:4:"type";s:6:"Object";s:8:"optional";b:1;s:7:"summary";s:27:"Optional. The value to set.";}}s:6:"source";s:2349:" var isSetter = arguments.length == 2 && value !== undefined, result; if(typeof elem == "string"){ elem = this.formNodes[elem]; if(elem){ elem = elem.node; } } if(!elem){ return null; // Object } if(dojo.isArray(elem)){ // input/radio array if(isSetter){ dojo.forEach(elem, function(node){ node.checked = ""; }); dojo.forEach(elem, function(node){ node.checked = node.value === value ? "checked" : ""; }); return this; // self } // getter dojo.some(elem, function(node){ if(node.checked){ result = node; return true; } return false; }); return result ? result.value : ""; // String } // all other elements switch(elem.tagName.toLowerCase()){ case "select": if(elem.multiple){ // multiple is allowed if(isSetter){ if(dojo.isArray(value)){ var dict = {}; dojo.forEach(value, function(v){ dict[v] = 1; }); dojo.query("> option", elem).forEach(function(opt){ opt.selected = opt.value in dict; }); return this; // self } // singular property dojo.query("> option", elem).forEach(function(opt){ opt.selected = opt.value === value; }); return this; // self } // getter var result = dojo.query("> option", elem).filter(function(opt){ return opt.selected; }).map(function(opt){ return opt.value; }); return result.length == 1 ? result[0] : result; // Object } // singular if(isSetter){ dojo.query("> option", elem).forEach(function(opt){ opt.selected = opt.value === value; }); return this; // self } // getter return elem.value || ""; // String case "button": if(isSetter){ elem.innerHTML = "" + value; return this; } // getter return elem.innerHTML; case "input": if(elem.type.toLowerCase() == "checkbox"){ // input/checkbox element if(isSetter){ elem.checked = value ? "checked" : ""; return this; } // getter return Boolean(elem.checked); } } // the rest of inputs if(isSetter){ elem.value = "" + value; return this; } // getter return elem.value;";s:7:"summary";s:34:"Set or get a form element by name.";s:14:"return_summary";s:121:"Object: For a getter it returns the value, for a setter it returns self. If the elem is not valid, null will be returned.";s:7:"returns";s:18:"Object|self|String";}s:46:"dojox.form.manager._NodeMixin.inspectFormNodes";a:6:{s:9:"prototype";s:29:"dojox.form.manager._NodeMixin";s:4:"type";s:8:"Function";s:10:"parameters";a:3:{s:9:"inspector";a:2:{s:4:"type";s:8:"Function";s:7:"summary";s:229:"A function to be called on a form element. Takes three arguments: a name, a node or an array of nodes, and a supplied value. Runs in the context of the form manager. Returns a value that will be collected and returned as a state.";}s:5:"state";a:3:{s:4:"type";s:6:"Object";s:8:"optional";b:1;s:7:"summary";s:225:"Optional. If a name-value dictionary --- only listed names will be processed. If an array, all names in the array will be processed with defaultValue. If omitted or null, all form elements will be processed with defaultValue.";}s:12:"defaultValue";a:3:{s:4:"type";s:6:"Object";s:8:"optional";b:1;s:7:"summary";s:47:"Optional. The default state (true, if omitted).";}}s:6:"source";s:613:" var name, result = {}; if(state){ if(dojo.isArray(state)){ dojo.forEach(state, function(name){ if(name in this.formNodes){ result[name] = inspector.call(this, name, this.formNodes[name].node, defaultValue); } }, this); }else{ for(name in state){ if(name in this.formNodes){ result[name] = inspector.call(this, name, this.formNodes[name].node, state[name]); } } } }else{ for(name in this.formNodes){ result[name] = inspector.call(this, name, this.formNodes[name].node, defaultValue); } } return result; // Object";s:7:"summary";s:80:"Run an inspector function on controlled form elements returning a result object.";s:7:"returns";s:6:"Object";}s:39:"dojox.form.manager._NodeMixin.formNodes";a:2:{s:8:"instance";s:29:"dojox.form.manager._NodeMixin";s:7:"summary";s:0:"";}s:2:"aa";a:1:{s:7:"summary";s:0:"";}s:4:"keys";a:1:{s:7:"summary";s:0:"";}s:2:"ce";a:1:{s:7:"summary";s:0:"";}s:12:"registerNode";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:4:"node";a:1:{s:4:"type";s:0:"";}s:9:"groupNode";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:831:" var name = dojo.attr(node, "name"); groupNode = groupNode || this.domNode; if(name && !(name in this.formWidgets)){ // verify that it is not part of any widget for(var n = node; n && n !== groupNode; n = n.parentNode){ if(dojo.attr(n, "widgetId") && dijit.byNode(n) instanceof dijit.form._FormWidget){ // this is a child of some widget --- bail out return null; } } // register the node if(node.tagName.toLowerCase() == "input" && node.type.toLowerCase() == "radio"){ var a = this.formNodes[name]; a = a && a.node; if(a && dojo.isArray(a)){ a.push(node); }else{ this.formNodes[name] = {node: [node], connections: []}; } }else{ this.formNodes[name] = {node: node, connections: []}; } }else{ name = null; } return name;";s:7:"summary";s:0:"";}s:20:"getObserversFromNode";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"name";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:359:" var observers = {}; aa(function(_, n){ var o = dojo.attr(n, "observer"); if(o && typeof o == "string"){ dojo.forEach(o.split(","), function(o){ o = dojo.trim(o); if(o && dojo.isFunction(this[o])){ observers[o] = 1; } }, this); } }).call(this, null, this.formNodes[name].node); return keys(observers);";s:7:"summary";s:0:"";}s:11:"connectNode";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:4:"name";a:1:{s:4:"type";s:0:"";}s:9:"observers";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:535:" var t = this.formNodes[name], c = t.connections; if(c.length){ dojo.forEach(c, dojo.disconnect); c = t.connections = []; } aa(function(_, n){ // the next line is a crude workaround for dijit.form.Button that fires onClick instead of onChange var eventName = ce(n); dojo.forEach(observers, function(o){ c.push(dojo.connect(n, eventName, this, function(evt){ if(this.watch){ this[o](this.formNodeValue(name), name, n, evt); } })); }, this); }).call(this, null, t.node);";s:7:"summary";s:0:"";}s:18:"dojox.form.manager";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}s:10:"dojox.form";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}s:5:"dojox";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}}