From f0cfe83e3725f9a3928da97a6e3085e79cb25309 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 18 Mar 2013 10:26:24 +0400 Subject: upgrade dojo to 1.8.3 (refs #570) --- lib/dojo/_base/NodeList.js.uncompressed.js | 110 +++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 lib/dojo/_base/NodeList.js.uncompressed.js (limited to 'lib/dojo/_base/NodeList.js.uncompressed.js') diff --git a/lib/dojo/_base/NodeList.js.uncompressed.js b/lib/dojo/_base/NodeList.js.uncompressed.js new file mode 100644 index 000000000..f9e9070f1 --- /dev/null +++ b/lib/dojo/_base/NodeList.js.uncompressed.js @@ -0,0 +1,110 @@ +define("dojo/_base/NodeList", ["./kernel", "../query", "./array", "./html", "../NodeList-dom"], function(dojo, query, array){ + // module: + // dojo/_base/NodeList + + /*===== + return { + // summary: + // This module extends dojo/NodeList with the legacy connect(), coords(), + // blur(), focus(), change(), click(), error(), keydown(), keypress(), + // keyup(), load(), mousedown(), mouseenter(), mouseleave(), mousemove(), + // mouseout(), mouseover(), mouseup(), and submit() methods. + }; + =====*/ + + var NodeList = query.NodeList, + nlp = NodeList.prototype; + + nlp.connect = NodeList._adaptAsForEach(function(){ + // don't bind early to dojo.connect since we no longer explicitly depend on it + return dojo.connect.apply(this, arguments); + }); + /*===== + nlp.connect = function(methodName, objOrFunc, funcName){ + // summary: + // Attach event handlers to every item of the NodeList. Uses dojo.connect() + // so event properties are normalized. + // + // Application must manually require() "dojo/_base/connect" before using this method. + // methodName: String + // the name of the method to attach to. For DOM events, this should be + // the lower-case name of the event + // objOrFunc: Object|Function|String + // if 2 arguments are passed (methodName, objOrFunc), objOrFunc should + // reference a function or be the name of the function in the global + // namespace to attach. If 3 arguments are provided + // (methodName, objOrFunc, funcName), objOrFunc must be the scope to + // locate the bound function in + // funcName: String? + // optional. A string naming the function in objOrFunc to bind to the + // event. May also be a function reference. + // example: + // add an onclick handler to every button on the page + // | query("div:nth-child(odd)").connect("onclick", function(e){ + // | console.log("clicked!"); + // | }); + // example: + // attach foo.bar() to every odd div's onmouseover + // | query("div:nth-child(odd)").connect("onmouseover", foo, "bar"); + + return null; // NodeList + }; + =====*/ + + nlp.coords = NodeList._adaptAsMap(dojo.coords); + /*===== + nlp.coords = function(){ + // summary: + // Deprecated: Use position() for border-box x/y/w/h + // or marginBox() for margin-box w/h/l/t. + // Returns the box objects of all elements in a node list as + // an Array (*not* a NodeList). Acts like `domGeom.coords`, though assumes + // the node passed is each node in this list. + + return []; // Array + }; + =====*/ + + NodeList.events = [ + // summary: + // list of all DOM events used in NodeList + "blur", "focus", "change", "click", "error", "keydown", "keypress", + "keyup", "load", "mousedown", "mouseenter", "mouseleave", "mousemove", + "mouseout", "mouseover", "mouseup", "submit" + ]; + + // FIXME: pseudo-doc the above automatically generated on-event functions + + // syntactic sugar for DOM events + array.forEach(NodeList.events, function(evt){ + var _oe = "on" + evt; + nlp[_oe] = function(a, b){ + return this.connect(_oe, a, b); + }; + // FIXME: should these events trigger publishes? + /* + return (a ? this.connect(_oe, a, b) : + this.forEach(function(n){ + // FIXME: + // listeners get buried by + // addEventListener and can't be dug back + // out to be triggered externally. + // see: + // http://developer.mozilla.org/en/docs/DOM:element + + console.log(n, evt, _oe); + + // FIXME: need synthetic event support! + var _e = { target: n, faux: true, type: evt }; + // dojo._event_listener._synthesizeEvent({}, { target: n, faux: true, type: evt }); + try{ n[evt](_e); }catch(e){ console.log(e); } + try{ n[_oe](_e); }catch(e){ console.log(e); } + }) + ); + */ + } + ); + + dojo.NodeList = NodeList; + return NodeList; +}); -- cgit v1.2.3