Socket
Socket
Sign inDemoInstall

dojo

Package Overview
Dependencies
0
Maintainers
1
Versions
104
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.9.1 to 1.9.2

tests/_base/loader/mapping.html

55

_base/Color.js

@@ -11,13 +11,18 @@ define(["./kernel", "./lang", "./array", "./config"], function(dojo, lang, ArrayUtil, config){

// Work with a Color instance:
// | var c = new Color();
// | c.setColor([0,0,0]); // black
// | var hex = c.toHex(); // #000000
// | require(["dojo/_base/color"], function(Color){
// | var c = new Color();
// | c.setColor([0,0,0]); // black
// | var hex = c.toHex(); // #000000
// | });
//
// example:
// Work with a node's color:
// | var color = dojo.style("someNode", "backgroundColor");
// | var n = new Color(color);
// | // adjust the color some
// | n.r *= .5;
// | console.log(n.toString()); // rgb(128, 255, 255);
// |
// | require(["dojo/_base/color", "dojo/dom-style"], function(Color, domStyle){
// | var color = domStyle("someNode", "backgroundColor");
// | var n = new Color(color);
// | // adjust the color some
// | n.r *= .5;
// | console.log(n.toString()); // rgb(128, 255, 255);
// | });
if(color){ this.setColor(color); }

@@ -63,4 +68,6 @@ };

// example:
// | var c = new Color(); // no color
// | c.setColor("#ededed"); // greyish
// | require(["dojo/_base/color"], function(Color){
// | var c = new Color(); // no color
// | c.setColor("#ededed"); // greyish
// | });
if(lang.isString(color)){

@@ -88,4 +95,6 @@ Color.fromString(color, this);

// example:
// | var c = new Color("#000000");
// | console.log(c.toRgb()); // [0,0,0]
// | require(["dojo/_base/color"], function(Color){
// | var c = new Color("#000000");
// | console.log(c.toRgb()); // [0,0,0]
// | });
var t = this;

@@ -105,3 +114,5 @@ return [t.r, t.g, t.b]; // Array

// example:
// | console.log(new Color([0,0,0]).toHex()); // #000000
// | require(["dojo/_base/color"], function(Color){
// | console.log(new Color([0,0,0]).toHex()); // #000000
// | });
var arr = ArrayUtil.map(["r", "g", "b"], function(x){

@@ -117,4 +128,6 @@ var s = this[x].toString(16);

// example:
// | var c = new Color("#FFF").toCss();
// | console.log(c); // rgb('255','255','255')
// | require(["dojo/_base/color"], function(Color){
// | var c = new Color("#FFF").toCss();
// | console.log(c); // rgb('255','255','255')
// | });
var t = this, rgb = t.r + ", " + t.g + ", " + t.b;

@@ -169,6 +182,6 @@ return (includeAlpha ? "rgba(" + rgb + ", " + t.a : "rgb(" + rgb) + ")"; // String

// example:
// | var thing = dojo.colorFromHex("#ededed"); // grey, longhand
//
// example:
// | var thing = dojo.colorFromHex("#000"); // black, shorthand
// | require(["dojo/_base/color"], function(Color){
// | var thing = new Color().fromHex("#ededed"); // grey, longhand
// | var thing2 = new Color().fromHex("#000"); // black, shorthand
// | });
var t = obj || new Color(),

@@ -195,3 +208,5 @@ bits = (color.length == 4) ? 4 : 8,

// example:
// | var myColor = dojo.colorFromArray([237,237,237,0.5]); // grey, 50% alpha
// | require(["dojo/_base/color"], function(Color){
// | var myColor = new Color().fromArray([237,237,237,0.5]); // grey, 50% alpha
// | });
// returns:

@@ -198,0 +213,0 @@ // A Color object. If obj is passed, it will be the return value.

@@ -82,3 +82,3 @@ define(["../has", "./config", "require", "module"], function(has, config, require, module){

var rev = "$Rev: 43d05c6 $".match(/\d+/);
var rev = "$Rev: f774568 $".match(/[0-9a-f]{7,}/);
dojo.version = {

@@ -94,6 +94,6 @@ // summary:

// - flag: String: Descriptor flag. If total version is "1.2.0beta1", will be "beta1"
// - revision: Number: The SVN rev from which dojo was pulled
// - revision: Number: The Git rev from which dojo was pulled
major: 1, minor: 9, patch: 1, flag: "",
revision: rev ? +rev[0] : NaN,
major: 1, minor: 9, patch: 2, flag: "",
revision: rev ? rev[0] : NaN,
toString: function(){

@@ -100,0 +100,0 @@ var v = dojo.version;

@@ -69,5 +69,9 @@ define(["./kernel", "./lang", "../on"], function(dojo, lang, on){

// example:
// | dojo.addOnUnload(functionPointer)
// | dojo.addOnUnload(object, "functionName")
// | dojo.addOnUnload(object, function(){ /* ... */});
// | var afunc = function() {console.log("global function");};
// | require(["dojo/_base/unload"], function(unload) {
// | var foo = {unload: function(){ console.log("unloading...");}, data: "mydata"};
// | unload.addOnUnload(afunc);
// | unload.addOnUnload(foo, "unload");
// | unload.addOnUnload(foo, function(){console.log("", this.data);});
// | });

@@ -74,0 +78,0 @@ on(win, "beforeunload", lang.hitch(obj, functionName));

@@ -15,20 +15,25 @@ define(["./_base/kernel", "./_base/lang"], function(dojo, lang){

// | // create a new registry
// | var reg = new dojo.AdapterRegistry();
// | reg.register("handleString",
// | dojo.isString,
// | function(str){
// | // do something with the string here
// | }
// | );
// | reg.register("handleArr",
// | dojo.isArray,
// | function(arr){
// | // do something with the array here
// | }
// | );
// | require(["dojo/AdapterRegistry"],
// | function(AdapterRegistry){
// | var reg = new AdapterRegistry();
// | reg.register("handleString",
// | function(str){
// | return typeof val == "string"
// | },
// | function(str){
// | // do something with the string here
// | }
// | );
// | reg.register("handleArr",
// | dojo.isArray,
// | function(arr){
// | // do something with the array here
// | }
// | );
// |
// | // now we can pass reg.match() *either* an array or a string and
// | // the value we pass will get handled by the right function
// | reg.match("someValue"); // will call the first function
// | reg.match(["someValue"]); // will call the second
// | // now we can pass reg.match() *either* an array or a string and
// | // the value we pass will get handled by the right function
// | reg.match("someValue"); // will call the first function
// | reg.match(["someValue"]); // will call the second
// | });

@@ -35,0 +40,0 @@ this.pairs = [];

@@ -40,3 +40,3 @@ define(["../sniff", "../_base/kernel", "../_base/lang", "../dom"],

}
return " button textarea input select option ".indexOf(" " + t.tagName.toLowerCase() + " ") >= 0; // Boolean
return " a button textarea input select option ".indexOf(" " + t.tagName.toLowerCase() + " ") >= 0; // Boolean
};

@@ -43,0 +43,0 @@

@@ -16,3 +16,3 @@ define(["exports", "./sniff", "./_base/lang", "./dom", "./dom-style", "./dom-prop"],

// dojo.attr() should conform to http://www.w3.org/TR/DOM-Level-2-Core/
// dojo/dom-attr.get() should conform to http://www.w3.org/TR/DOM-Level-2-Core/

@@ -77,5 +77,8 @@ // attribute-related functions (to be obsolete soon)

// | // get the current value of the "foo" attribute on a node
// | dojo.getAttr(dojo.byId("nodeId"), "foo");
// | // or we can just pass the id:
// | dojo.getAttr("nodeId", "foo");
// | require(["dojo/dom-attr", "dojo/dom"], function(domAttr, dom){
// | domAttr.get(dom.byId("nodeId"), "foo");
// | // or we can just pass the id:
// | domAttr.get("nodeId", "foo");
// | });
// |

@@ -128,40 +131,16 @@ node = dom.byId(node);

// | // use attr() to set the tab index
// | dojo.setAttr("nodeId", "tabIndex", 3);
// | require(["dojo/dom-attr"], function(domAttr){
// | domAttr.set("nodeId", "tabIndex", 3);
// | });
//
// example:
// Set multiple values at once, including event handlers:
// | dojo.setAttr("formId", {
// | "foo": "bar",
// | "tabIndex": -1,
// | "method": "POST",
// | "onsubmit": function(e){
// | // stop submitting the form. Note that the IE behavior
// | // of returning true or false will have no effect here
// | // since our handler is connect()ed to the built-in
// | // onsubmit behavior and so we need to use
// | // dojo.stopEvent() to ensure that the submission
// | // doesn't proceed.
// | dojo.stopEvent(e);
// |
// | // submit the form with Ajax
// | dojo.xhrPost({ form: "formId" });
// | require(["dojo/dom-attr"],
// | function(domAttr){
// | domAttr.set("formId", {
// | "foo": "bar",
// | "tabIndex": -1,
// | "method": "POST"
// | }
// | });
//
// example:
// Style is s special case: Only set with an object hash of styles
// | dojo.setAttr("someNode",{
// | id:"bar",
// | style:{
// | width:"200px", height:"100px", color:"#000"
// | }
// | });
//
// example:
// Again, only set style as an object hash of styles:
// | var obj = { color:"#fff", backgroundColor:"#000" };
// | dojo.setAttr("someNode", "style", obj);
// |
// | // though shorter to use `dojo.style()` in this case:
// | dojo.setStyle("someNode", obj);

@@ -168,0 +147,0 @@ node = dom.byId(node);

@@ -85,3 +85,3 @@ define(["exports", "./_base/kernel", "./sniff", "./_base/window", "./dom", "./dom-attr"],

// optional document to use when creating DOM nodes, defaults to
// dojo.doc if not specified.
// dojo/_base/window.doc if not specified.
// returns:

@@ -91,3 +91,5 @@ // Document fragment, unless it's a single node in which case it returns the node itself

// Create a table row:
// | var tr = dojo.toDom("<tr><td>First!</td></tr>");
// | require(["dojo/dom-construct"], function(domConstruct){
// | var tr = domConstruct.toDom("<tr><td>First!</td></tr>");
// | });

@@ -163,15 +165,24 @@ doc = doc || win.doc;

//
// .place() is also a method of `dojo/NodeList`, allowing `dojo.query` node lookups.
// .place() is also a method of `dojo/NodeList`, allowing `dojo/query` node lookups.
// example:
// Place a node by string id as the last child of another node by string id:
// | dojo.place("someNode", "anotherNode");
// | require(["dojo/dom-construct"], function(domConstruct){
// | domConstruct.place("someNode", "anotherNode");
// | });
// example:
// Place a node by string id before another node by string id
// | dojo.place("someNode", "anotherNode", "before");
// | require(["dojo/dom-construct"], function(domConstruct){
// | domConstruct.place("someNode", "anotherNode", "before");
// | });
// example:
// Create a Node, and place it in the body element (last child):
// | dojo.place("<div></div>", dojo.body());
// | require(["dojo/dom-construct", "dojo/_base/window"
// | ], function(domConstruct, win){
// | domConstruct.place("<div></div>", win.body());
// | });
// example:
// Put a new LI as the first child of a list by id:
// | dojo.place("<li></li>", "someUl", "first");
// | require(["dojo/dom-construct"], function(domConstruct){
// | domConstruct.place("<li></li>", "someUl", "first");
// | });

@@ -249,11 +260,17 @@ refNode = dom.byId(refNode);

// Create a DIV:
// | var n = dojo.create("div");
// | require(["dojo/dom-construct"], function(domConstruct){
// | var n = domConstruct.create("div");
// | });
//
// example:
// Create a DIV with content:
// | var n = dojo.create("div", { innerHTML:"<p>hi</p>" });
// | require(["dojo/dom-construct"], function(domConstruct){
// | var n = domConstruct.create("div", { innerHTML:"<p>hi</p>" });
// | });
//
// example:
// Place a new DIV in the BODY, with no attributes set
// | var n = dojo.create("div", null, dojo.body());
// | require(["dojo/dom-construct"], function(domConstruct){
// | var n = domConstruct.create("div", null, dojo.body());
// | });
//

@@ -263,6 +280,9 @@ // example:

// node with id="someId":
// | var ul = dojo.create("ul", null, "someId", "first");
// | var items = ["one", "two", "three", "four"];
// | dojo.forEach(items, function(data){
// | dojo.create("li", { innerHTML: data }, ul);
// | require(["dojo/dom-construct", "dojo/_base/array"],
// | function(domConstruct, arrayUtil){
// | var ul = domConstruct.create("ul", null, "someId", "first");
// | var items = ["one", "two", "three", "four"];
// | arrayUtil.forEach(items, function(data){
// | domConstruct.create("li", { innerHTML: data }, ul);
// | });
// | });

@@ -272,10 +292,5 @@ //

// Create an anchor, with an href. Place in BODY:
// | dojo.create("a", { href:"foo.html", title:"Goto FOO!" }, dojo.body());
//
// example:
// Create a `dojo/NodeList()` from a new element (for syntactic sugar):
// | dojo.query(dojo.create('div'))
// | .addClass("newDiv")
// | .onclick(function(e){ console.log('clicked', e.target) })
// | .place("#someNode"); // redundant, but cleaner.
// | require(["dojo/dom-construct"], function(domConstruct){
// | domConstruct.create("a", { href:"foo.html", title:"Goto FOO!" }, dojo.body());
// | });

@@ -313,13 +328,11 @@ var doc = win.doc;

exports.empty = function empty(/*DOMNode|String*/ node){
// summary:
// safely removes all children of the node.
// node: DOMNode|String
// a reference to a DOM node or an id.
// example:
// Destroy node's children byId:
// | dojo.empty("someId");
//
// example:
// Destroy all nodes' children in a list by reference:
// | dojo.query(".someNode").forEach(dojo.empty);
// summary:
// safely removes all children of the node.
// node: DOMNode|String
// a reference to a DOM node or an id.
// example:
// Destroy node's children byId:
// | require(["dojo/dom-construct"], function(domConstruct){
// | domConstruct.empty("someId");
// | });

@@ -357,7 +370,5 @@ _empty(dom.byId(node));

// Destroy a node byId:
// | dojo.destroy("someId");
//
// example:
// Destroy all nodes in a list by reference:
// | dojo.query(".someNode").forEach(dojo.destroy);
// | require(["dojo/dom-construct"], function(domConstruct){
// | domConstruct.destroy("someId");
// | });

@@ -364,0 +375,0 @@ node = dom.byId(node);

@@ -52,4 +52,4 @@ define(["./sniff", "./_base/window","./dom", "./dom-style"],

// If this parameter is omitted, the functions will call
// dojo.getComputedStyle to get one. It is a better way, calling
// dojo.computedStyle once, and then pass the reference to this
// dojo/dom-style.getComputedStyle to get one. It is a better way, calling
// dojo/dom-style.getComputedStyle once, and then pass the reference to this
// computedStyle parameter. Wherever possible, reuse the returned

@@ -82,4 +82,4 @@ // object of dojo/dom-style.getComputedStyle().

// If this parameter is omitted, the functions will call
// dojo.getComputedStyle to get one. It is a better way, calling
// dojo.computedStyle once, and then pass the reference to this
// dojo/dom-style.getComputedStyle to get one. It is a better way, calling
// dojo/dom-style.getComputedStyle once, and then pass the reference to this
// computedStyle parameter. Wherever possible, reuse the returned

@@ -113,4 +113,4 @@ // object of dojo/dom-style.getComputedStyle().

// If this parameter is omitted, the functions will call
// dojo.getComputedStyle to get one. It is a better way, calling
// dojo.computedStyle once, and then pass the reference to this
// dojo/dom-style.getComputedStyle to get one. It is a better way, calling
// dojo/dom-style.getComputedStyle once, and then pass the reference to this
// computedStyle parameter. Wherever possible, reuse the returned

@@ -149,4 +149,4 @@ // object of dojo/dom-style.getComputedStyle().

// If this parameter is omitted, the functions will call
// dojo.getComputedStyle to get one. It is a better way, calling
// dojo.computedStyle once, and then pass the reference to this
// dojo/dom-style.getComputedStyle to get one. It is a better way, calling
// dojo/dom-style.getComputedStyle once, and then pass the reference to this
// computedStyle parameter. Wherever possible, reuse the returned

@@ -184,4 +184,4 @@ // object of dojo/dom-style.getComputedStyle().

// If this parameter is omitted, the functions will call
// dojo.getComputedStyle to get one. It is a better way, calling
// dojo.computedStyle once, and then pass the reference to this
// dojo/dom-style.getComputedStyle to get one. It is a better way, calling
// dojo/dom-style.getComputedStyle once, and then pass the reference to this
// computedStyle parameter. Wherever possible, reuse the returned

@@ -234,4 +234,4 @@ // object of dojo/dom-style.getComputedStyle().

// If this parameter is omitted, the functions will call
// dojo.getComputedStyle to get one. It is a better way, calling
// dojo.computedStyle once, and then pass the reference to this
// dojo/dom-style.getComputedStyle to get one. It is a better way, calling
// dojo/dom-style.getComputedStyle once, and then pass the reference to this
// computedStyle parameter. Wherever possible, reuse the returned

@@ -342,4 +342,4 @@ // object of dojo/dom-style.getComputedStyle().

// If this parameter is omitted, the functions will call
// dojo.getComputedStyle to get one. It is a better way, calling
// dojo.computedStyle once, and then pass the reference to this
// dojo/dom-style.getComputedStyle to get one. It is a better way, calling
// dojo/dom-style.getComputedStyle once, and then pass the reference to this
// computedStyle parameter. Wherever possible, reuse the returned

@@ -377,4 +377,4 @@ // object of dojo/dom-style.getComputedStyle().

// If this parameter is omitted, the functions will call
// dojo.getComputedStyle to get one. It is a better way, calling
// dojo.computedStyle once, and then pass the reference to this
// dojo/dom-style.getComputedStyle to get one. It is a better way, calling
// dojo/dom-style.getComputedStyle once, and then pass the reference to this
// computedStyle parameter. Wherever possible, reuse the returned

@@ -571,4 +571,4 @@ // object of dojo/dom-style.getComputedStyle().

// If this parameter is omitted, the functions will call
// dojo.getComputedStyle to get one. It is a better way, calling
// dojo.computedStyle once, and then pass the reference to this
// dojo/dom-style.getComputedStyle to get one. It is a better way, calling
// dojo/dom-style.getComputedStyle once, and then pass the reference to this
// computedStyle parameter. Wherever possible, reuse the returned

@@ -597,3 +597,3 @@ // object of dojo/dom-style.getComputedStyle().

// old IE version
// FIXME: scroll position query is duped from dojo.html to
// FIXME: scroll position query is duped from dojo/_base/html to
// avoid dependency on that entire module. Now that HTML is in

@@ -603,3 +603,3 @@ // Base, we should convert back to something similar there.

var doc = (se && se.ownerDocument) || document;
// DO NOT replace the following to use dojo.body(), in IE, document.documentElement should be used
// DO NOT replace the following to use dojo/_base/window.body(), in IE, document.documentElement should be used
// here rather than document.body

@@ -606,0 +606,0 @@ var docBody = has("quirks") ? doc.body : doc.documentElement;

@@ -45,5 +45,7 @@ define(["exports", "./_base/kernel", "./sniff", "./_base/lang", "./dom", "./dom-style", "./dom-construct", "./_base/connect"],

// | // get the current value of the "foo" property on a node
// | dojo.getProp(dojo.byId("nodeId"), "foo");
// | // or we can just pass the id:
// | dojo.getProp("nodeId", "foo");
// | require(["dojo/dom-prop", "dojo/dom"], function(domProp, dom){
// | domProp.get(dom.byId("nodeId"), "foo");
// | // or we can just pass the id:
// | domProp.get("nodeId", "foo");
// | });

@@ -82,41 +84,15 @@ node = dom.byId(node);

// | // use prop() to set the tab index
// | dojo.setProp("nodeId", "tabIndex", 3);
// |
// | require(["dojo/dom-prop"], function(domProp){
// | domProp.set("nodeId", "tabIndex", 3);
// | });
//
// example:
// Set multiple values at once, including event handlers:
// | dojo.setProp("formId", {
// | "foo": "bar",
// | "tabIndex": -1,
// | "method": "POST",
// | "onsubmit": function(e){
// | // stop submitting the form. Note that the IE behavior
// | // of returning true or false will have no effect here
// | // since our handler is connect()ed to the built-in
// | // onsubmit behavior and so we need to use
// | // dojo.stopEvent() to ensure that the submission
// | // doesn't proceed.
// | dojo.stopEvent(e);
// |
// | // submit the form with Ajax
// | dojo.xhrPost({ form: "formId" });
// | }
// | require(["dojo/dom-prop"], function(domProp){
// | domProp.set("formId", {
// | "foo": "bar",
// | "tabIndex": -1,
// | "method": "POST",
// | });
// | });
//
// example:
// Style is s special case: Only set with an object hash of styles
// | dojo.setProp("someNode",{
// | id:"bar",
// | style:{
// | width:"200px", height:"100px", color:"#000"
// | }
// | });
//
// example:
// Again, only set style as an object hash of styles:
// | var obj = { color:"#fff", backgroundColor:"#000" };
// | dojo.setProp("someNode", "style", obj);
// |
// | // though shorter to use `dojo.style()` in this case:
// | dojo.style("someNode", obj);

@@ -123,0 +99,0 @@ node = dom.byId(node);

@@ -69,3 +69,3 @@ define(["./sniff", "./dom"], function(has, dom){

//
// Use the dojo.style() method for more consistent (pixelized)
// Use the dojo/dom-style.get() method for more consistent (pixelized)
// return values.

@@ -77,8 +77,12 @@ //

// example:
// | dojo.getComputedStyle(dojo.byId('foo')).borderWidth;
// | require(["dojo/dom-style", "dojo/dom"], function(domStyle, dom){
// | domStyle.getComputedStyle(dom.byId('foo')).borderWidth;
// | });
//
// example:
// Reusing the returned object, avoiding multiple lookups:
// | var cs = dojo.getComputedStyle(dojo.byId("someNode"));
// | var w = cs.width, h = cs.height;
// | require(["dojo/dom-style", "dojo/dom"], function(domStyle, dom){
// | var cs = domStyle.getComputedStyle(dom.byId("someNode"));
// | var w = cs.width, h = cs.height;
// | });
return; // CSS2Properties

@@ -232,4 +236,4 @@ };

// "border" are not necessarily reflected as expected.
// If you want to get node dimensions, use `dojo.marginBox()`,
// `dojo.contentBox()` or `dojo.position()`.
// If you want to get node dimensions, use `dojo/dom-geometry.getMarginBox()`,
// `dojo/dom-geometry.getContentBox()` or `dojo/dom-geometry.getPosition()`.
// node: DOMNode|String

@@ -242,7 +246,11 @@ // id or reference to node to get style for

// the node:
// | dojo.getStyle("thinger");
// | require(["dojo/dom-style", "dojo/dom"], function(domStyle, dom){
// | domStyle.get("thinger");
// | });
// example:
// Passing a node and a style property returns the current
// normalized, computed value for that property:
// | dojo.getStyle("thinger", "opacity"); // 1 by default
// | require(["dojo/dom-style", "dojo/dom"], function(domStyle, dom){
// | domStyle.get("thinger", "opacity"); // 1 by default
// | });

@@ -276,10 +284,14 @@ var n = dom.byId(node), l = arguments.length, op = (name == "opacity");

// current display of the node and returns the new computed value
// | dojo.setStyle("thinger", "opacity", 0.5); // == 0.5
// | require(["dojo/dom-style"], function(domStyle){
// | domStyle.set("thinger", "opacity", 0.5); // == 0.5
// | });
//
// example:
// Passing a node, an object-style style property sets each of the values in turn and returns the computed style object of the node:
// | dojo.setStyle("thinger", {
// | "opacity": 0.5,
// | "border": "3px solid black",
// | "height": "300px"
// | require(["dojo/dom-style"], function(domStyle){
// | domStyle.set("thinger", {
// | "opacity": 0.5,
// | "border": "3px solid black",
// | "height": "300px"
// | });
// | });

@@ -290,5 +302,7 @@ //

// font-size becomes fontSize, and so on.
// | dojo.setStyle("thinger",{
// | fontSize:"14pt",
// | letterSpacing:"1.2em"
// | require(["dojo/dom-style", "dojo/dom"], function(domStyle, dom){
// | domStyle.set("thinger",{
// | fontSize:"14pt",
// | letterSpacing:"1.2em"
// | });
// | });

@@ -298,8 +312,11 @@ //

// dojo/NodeList implements .style() using the same syntax, omitting the "node" parameter, calling
// dojo.style() on every element of the list. See: `dojo.query()` and `dojo/NodeList`
// | dojo.query(".someClassName").style("visibility","hidden");
// | // or
// | dojo.query("#baz > div").style({
// | opacity:0.75,
// | fontSize:"13pt"
// dojo/dom-style.get() on every element of the list. See: `dojo/query` and `dojo/NodeList`
// | require(["dojo/dom-style", "dojo/query", "dojo/NodeList-dom"],
// | function(domStyle, query){
// | query(".someClassName").style("visibility","hidden");
// | // or
// | query("#baz > div").style({
// | opacity:0.75,
// | fontSize:"13pt"
// | });
// | });

@@ -306,0 +323,0 @@

@@ -59,29 +59,35 @@ define(["./sniff", "./_base/window"],

dom.byId = function(id, doc){
// summary:
// Returns DOM node with matching `id` attribute or falsy value (ex: null or undefined)
// if not found. If `id` is a DomNode, this function is a no-op.
//
// id: String|DOMNode
// A string to match an HTML id attribute or a reference to a DOM Node
//
// doc: Document?
// Document to work in. Defaults to the current value of
// dojo.doc. Can be used to retrieve
// node references from other documents.
//
// example:
// Look up a node by ID:
// | var n = dojo.byId("foo");
//
// example:
// Check if a node exists, and use it.
// | var n = dojo.byId("bar");
// | if(n){ doStuff() ... }
//
// example:
// Allow string or DomNode references to be passed to a custom function:
// | var foo = function(nodeOrId){
// | nodeOrId = dojo.byId(nodeOrId);
// | // ... more stuff
// | }
// summary:
// Returns DOM node with matching `id` attribute or falsy value (ex: null or undefined)
// if not found. If `id` is a DomNode, this function is a no-op.
//
// id: String|DOMNode
// A string to match an HTML id attribute or a reference to a DOM Node
//
// doc: Document?
// Document to work in. Defaults to the current value of
// dojo/_base/window.doc. Can be used to retrieve
// node references from other documents.
//
// example:
// Look up a node by ID:
// | require(["dojo/dom"], function(dom){
// | var n = dom.byId("foo");
// | });
//
// example:
// Check if a node exists, and use it.
// | require(["dojo/dom"], function(dom){
// | var n = dom.byId("bar");
// | if(n){ doStuff() ... }
// | });
//
// example:
// Allow string or DomNode references to be passed to a custom function:
// | require(["dojo/dom"], function(dom){
// | var foo = function(nodeOrId){
// | nodeOrId = dom.byId(nodeOrId);
// | // ... more stuff
// | }
// | });
};

@@ -100,3 +106,5 @@ =====*/

// Test is node id="bar" is a descendant of node id="foo"
// | if(dojo.isDescendant("bar", "foo")){ ... }
// | require(["dojo/dom"], function(dom){
// | if(dom.isDescendant("bar", "foo")){ ... }
// | });

@@ -154,6 +162,10 @@ try{

// Make the node id="bar" unselectable
// | dojo.setSelectable("bar");
// | require(["dojo/dom"], function(dom){
// | dom.setSelectable("bar");
// | });
// example:
// Make the node id="bar" selectable
// | dojo.setSelectable("bar", true);
// | require(["dojo/dom"], function(dom){
// | dom.setSelectable("bar", true);
// | });
};

@@ -160,0 +172,0 @@ =====*/

@@ -12,11 +12,12 @@ define(["./aspect", "./on"], function(aspect, on){

// for listening for events and emitting events:
//
// | define(["dojo/Evented"], function(Evented){
// | var EventedWidget = dojo.declare([Evented, dijit._Widget], {...});
// | widget = new EventedWidget();
// | widget.on("open", function(event){
// example:
// | define(["dojo/Evented", "dojo/_base/declare", "dojo/Stateful"
// | ], function(Evented, declare, Stateful){
// | var EventedStateful = declare([Evented, Stateful], {...});
// | var instance = new EventedStateful();
// | instance.on("open", function(event){
// | ... do something with event
// | });
// |
// | widget.emit("open", {name:"some event", ...});
// | instance.emit("open", {name:"some event", ...});
}

@@ -23,0 +24,0 @@ Evented.prototype = {

@@ -151,7 +151,7 @@ define([

// summary:
// Chain a list of `dojo.Animation`s to run in sequence
// Chain a list of `dojo/_base/fx.Animation`s to run in sequence
//
// description:
// Return a `dojo.Animation` which will play all passed
// `dojo.Animation` instances in sequence, firing its own
// Return a `dojo/_base/fx.Animation` which will play all passed
// `dojo/_base/fx.Animation` instances in sequence, firing its own
// synthesized events simulating a single animation. (eg:

@@ -163,6 +163,8 @@ // onEnd of this animation means the end of the chain,

// Once `node` is faded out, fade in `otherNode`
// | fx.chain([
// | dojo.fadeIn({ node:node }),
// | dojo.fadeOut({ node:otherNode })
// | ]).play();
// | require(["dojo/fx"], function(fx){
// | fx.chain([
// | fx.fadeIn({ node:node }),
// | fx.fadeOut({ node:otherNode })
// | ]).play();
// | });
//

@@ -248,7 +250,7 @@ return new _chain(animations); // dojo/_base/fx.Animation

// summary:
// Combine a list of `dojo.Animation`s to run in parallel
// Combine a list of `dojo/_base/fx.Animation`s to run in parallel
//
// description:
// Combine an array of `dojo.Animation`s to run in parallel,
// providing a new `dojo.Animation` instance encompasing each
// Combine an array of `dojo/_base/fx.Animation`s to run in parallel,
// providing a new `dojo/_base/fx.Animation` instance encompasing each
// animation, firing standard animation events.

@@ -258,17 +260,21 @@ //

// Fade out `node` while fading in `otherNode` simultaneously
// | fx.combine([
// | dojo.fadeIn({ node:node }),
// | dojo.fadeOut({ node:otherNode })
// | ]).play();
// | require(["dojo/fx"], function(fx){
// | fx.combine([
// | fx.fadeIn({ node:node }),
// | fx.fadeOut({ node:otherNode })
// | ]).play();
// | });
//
// example:
// When the longest animation ends, execute a function:
// | var anim = fx.combine([
// | dojo.fadeIn({ node: n, duration:700 }),
// | dojo.fadeOut({ node: otherNode, duration: 300 })
// | ]);
// | aspect.after(anim, "onEnd", function(){
// | // overall animation is done.
// | }, true);
// | anim.play(); // play the animation
// | require(["dojo/fx"], function(fx){
// | var anim = fx.combine([
// | fx.fadeIn({ node: n, duration:700 }),
// | fx.fadeOut({ node: otherNode, duration: 300 })
// | ]);
// | aspect.after(anim, "onEnd", function(){
// | // overall animation is done.
// | }, true);
// | anim.play(); // play the animation
// | });
//

@@ -289,9 +295,12 @@ return new _combine(animations); // dojo/_base/fx.Animation

// args: Object
// A hash-map of standard `dojo.Animation` constructor properties
// A hash-map of standard `dojo/_base/fx.Animation` constructor properties
// (such as easing: node: duration: and so on)
//
// example:
// | fx.wipeIn({
// | node:"someId"
// | }).play()
// | require(["dojo/fx"], function(fx){
// | fx.wipeIn({
// | node:"someId"
// | }).play()
// | });
var node = args.node = dom.byId(args.node), s = node.style, o;

@@ -344,7 +353,9 @@

// args: Object
// A hash-map of standard `dojo.Animation` constructor properties
// A hash-map of standard `dojo/_base/fx.Animation` constructor properties
// (such as easing: node: duration: and so on)
//
// example:
// | fx.wipeOut({ node:"someId" }).play()
// | require(["dojo/fx"], function(fx){
// | fx.wipeOut({ node:"someId" }).play()
// | });

@@ -387,3 +398,3 @@ var node = args.node = dom.byId(args.node), s = node.style, o;

// args: Object
// A hash-map of standard `dojo.Animation` constructor properties
// A hash-map of standard `dojo/_base/fx.Animation` constructor properties
// (such as easing: node: duration: and so on). Special args members

@@ -390,0 +401,0 @@ // are `top` and `left`, which indicate the new position to slide to.

@@ -161,3 +161,3 @@ define(["./_base/kernel", "require", "./_base/config", "./aspect", "./_base/lang", "./topic", "./domReady", "./sniff"],

if(config.useXDomain && !config.dojoBlankHtmlUrl){
console.warn("dojo.hash: When using cross-domain Dojo builds,"
console.warn("dojo/hash: When using cross-domain Dojo builds,"
+ " please save dojo/resources/blank.html to your domain and set djConfig.dojoBlankHtmlUrl"

@@ -199,3 +199,3 @@ + " to the path on your domain to blank.html");

ifrOffline = true;
console.error("dojo.hash: Error adding history entry. Server unreachable.");
console.error("dojo/hash: Error adding history entry. Server unreachable.");
}

@@ -202,0 +202,0 @@ }

@@ -6,8 +6,2 @@ define(["./_base/kernel", "./_base/lang", "./_base/array", "./_base/declare", "./dom", "./dom-construct", "./parser"],

var html = {
// summary:
// TODOC
};
lang.setObject("dojo.html", html);
// the parser might be needed..

@@ -18,59 +12,54 @@

html._secureForInnerHtml = function(/*String*/ cont){
var html = {
// summary:
// removes !DOCTYPE and title elements from the html string.
//
// khtml is picky about dom faults, you can't attach a style or `<title>` node as child of body
// must go into head, so we need to cut out those tags
// cont:
// An html string for insertion into the dom
//
return cont.replace(/(?:\s*<!DOCTYPE\s[^>]+>|<title[^>]*>[\s\S]*?<\/title>)/ig, ""); // String
};
// TODOC
html._emptyNode = domConstruct.empty;
/*=====
dojo.html._emptyNode = function(node){
// summary:
// Removes all child nodes from the given node. Deprecated, should use dojo/dom-constuct.empty() directly
// instead.
// node: DOMNode
// the parent element
};
=====*/
_secureForInnerHtml: function(/*String*/ cont){
// summary:
// removes !DOCTYPE and title elements from the html string.
//
// khtml is picky about dom faults, you can't attach a style or `<title>` node as child of body
// must go into head, so we need to cut out those tags
// cont:
// An html string for insertion into the dom
//
return cont.replace(/(?:\s*<!DOCTYPE\s[^>]+>|<title[^>]*>[\s\S]*?<\/title>)/ig, ""); // String
},
html._setNodeContent = function(/*DomNode*/ node, /*String|DomNode|NodeList*/ cont){
// summary:
// inserts the given content into the given node
// node:
// the parent element
// content:
// the content to be set on the parent element.
// This can be an html string, a node reference or a NodeList, dojo/NodeList, Array or other enumerable list of nodes
// Deprecated, should use dojo/dom-constuct.empty() directly, remove in 2.0.
_emptyNode: domConstruct.empty,
// always empty
domConstruct.empty(node);
_setNodeContent: function(/*DomNode*/ node, /*String|DomNode|NodeList*/ cont){
// summary:
// inserts the given content into the given node
// node:
// the parent element
// content:
// the content to be set on the parent element.
// This can be an html string, a node reference or a NodeList, dojo/NodeList, Array or other enumerable list of nodes
if(cont){
if(typeof cont == "string"){
cont = domConstruct.toDom(cont, node.ownerDocument);
}
if(!cont.nodeType && lang.isArrayLike(cont)){
// handle as enumerable, but it may shrink as we enumerate it
for(var startlen=cont.length, i=0; i<cont.length; i=startlen==cont.length ? i+1 : 0){
domConstruct.place( cont[i], node, "last");
// always empty
domConstruct.empty(node);
if(cont){
if(typeof cont == "string"){
cont = domConstruct.toDom(cont, node.ownerDocument);
}
}else{
// pass nodes, documentFragments and unknowns through to dojo.place
domConstruct.place(cont, node, "last");
if(!cont.nodeType && lang.isArrayLike(cont)){
// handle as enumerable, but it may shrink as we enumerate it
for(var startlen=cont.length, i=0; i<cont.length; i=startlen==cont.length ? i+1 : 0){
domConstruct.place( cont[i], node, "last");
}
}else{
// pass nodes, documentFragments and unknowns through to dojo.place
domConstruct.place(cont, node, "last");
}
}
}
// return DomNode
return node;
};
// return DomNode
return node;
},
// we wrap up the content-setting operation in a object
html._ContentSetter = declare("dojo.html._ContentSetter", null,
{
// we wrap up the content-setting operation in a object
_ContentSetter: declare("dojo.html._ContentSetter", null, {
// node: DomNode|String

@@ -193,3 +182,3 @@ // An node which will be the parent element that we set content into

// cleanly empty out existing content
// If there is a parse in progress, cancel it.

@@ -315,6 +304,6 @@ if(this.parseDeferred){

}).then(function(results){
return self.parseResults = results;
}, function(e){
self._onError('Content', e, "Error parsing in _ContentSetter#" + this.id);
});
return self.parseResults = results;
}, function(e){
self._onError('Content', e, "Error parsing in _ContentSetter#" + this.id);
});
}catch(e){

@@ -336,13 +325,16 @@ this._onError('Content', e, "Error parsing in _ContentSetter#" + this.id);

}
}); // end declare()
}), // end declare()
html.set = function(/*DomNode*/ node, /*String|DomNode|NodeList*/ cont, /*Object?*/ params){
set: function(/*DomNode*/ node, /*String|DomNode|NodeList*/ cont, /*Object?*/ params){
// summary:
// inserts (replaces) the given content into the given node. dojo.place(cont, node, "only")
// inserts (replaces) the given content into the given node. dojo/dom-construct.place(cont, node, "only")
// may be a better choice for simple HTML insertion.
// description:
// Unless you need to use the params capabilities of this method, you should use
// dojo.place(cont, node, "only"). dojo.place() has more robust support for injecting
// dojo/dom-construct.place(cont, node, "only"). dojo/dom-construct..place() has more robust support for injecting
// an HTML string into the DOM, but it only handles inserting an HTML string as DOM
// elements, or inserting a DOM node. dojo.place does not handle NodeList insertions
// elements, or inserting a DOM node. dojo/dom-construct..place does not handle NodeList insertions
// dojo/dom-construct.place(cont, node, "only"). dojo/dom-construct.place() has more robust support for injecting
// an HTML string into the DOM, but it only handles inserting an HTML string as DOM
// elements, or inserting a DOM node. dojo/dom-construct.place does not handle NodeList insertions
// or the other capabilities as defined by the params object for this method.

@@ -362,21 +354,23 @@ // node:

// | html.set(node, myNode.childNodes, {options});
if(undefined == cont){
console.warn("dojo.html.set: no cont argument provided, using empty string");
cont = "";
}
if(!params){
// simple and fast
return html._setNodeContent(node, cont, true);
}else{
// more options but slower
// note the arguments are reversed in order, to match the convention for instantiation via the parser
var op = new html._ContentSetter(lang.mixin(
if(undefined == cont){
console.warn("dojo.html.set: no cont argument provided, using empty string");
cont = "";
}
if(!params){
// simple and fast
return html._setNodeContent(node, cont, true);
}else{
// more options but slower
// note the arguments are reversed in order, to match the convention for instantiation via the parser
var op = new html._ContentSetter(lang.mixin(
params,
{ content: cont, node: node }
));
return op.set();
));
return op.set();
}
}
};
lang.setObject("dojo.html", html);
return html;
});

@@ -90,3 +90,3 @@ define(["./_base/kernel", "require", "./has", "./_base/array", "./_base/config", "./_base/lang", "./has!host-browser?./_base/xhr", "./json", "module"],

require([bundlePathAndName], function(root){
var current = lang.clone(root.root),
var current = lang.clone(root.root || root.ROOT),// 1.6 built bundle defined ROOT
availableLocales = getAvailableLocales(!root._v1x && root, locale, bundlePath, bundleName);

@@ -93,0 +93,0 @@ require(availableLocales, function(){

@@ -119,57 +119,63 @@ define([

data: function(key, value){
// summary:
// stash or get some arbitrary data on/from these nodes.
//
// description:
// Stash or get some arbitrary data on/from these nodes. This private _data function is
// exposed publicly on `dojo/NodeList`, eg: as the result of a `dojo.query` call.
// DIFFERS from jQuery.data in that when used as a getter, the entire list is ALWAYS
// returned. EVEN WHEN THE LIST IS length == 1.
//
// A single-node version of this function is provided as `dojo._nodeData`, which follows
// the same signature, though expects a String ID or DomNode reference in the first
// position, before key/value arguments.
//
// node: String|DomNode
// The node to associate data with
//
// key: Object|String?
// If an object, act as a setter and iterate over said object setting data items as defined.
// If a string, and `value` present, set the data for defined `key` to `value`
// If a string, and `value` absent, act as a getter, returning the data associated with said `key`
//
// value: Anything?
// The value to set for said `key`, provided `key` is a string (and not an object)
//
// example:
// Set a key `bar` to some data, then retrieve it.
// | dojo.query(".foo").data("bar", "touched");
// | var touched = dojo.query(".foo").data("bar");
// | if(touched[0] == "touched"){ alert('win'); }
//
// example:
// Get all the data items for a given node.
// | var list = dojo.query(".foo").data();
// | var first = list[0];
//
// example:
// Set the data to a complex hash. Overwrites existing keys with new value
// | dojo.query(".foo").data({ bar:"baz", foo:"bar" });
// Then get some random key:
// | dojo.query(".foo").data("foo"); // returns [`bar`]
//
// returns: Object|Anything|Nothing
// When used as a setter via `dojo/NodeList`, a NodeList instance is returned
// for further chaining. When used as a getter via `dojo/NodeList` an ARRAY
// of items is returned. The items in the array correspond to the elements
// in the original list. This is true even when the list length is 1, eg:
// when looking up a node by ID (#foo)
// summary:
// stash or get some arbitrary data on/from these nodes.
//
// description:
// Stash or get some arbitrary data on/from these nodes. This private _data function is
// exposed publicly on `dojo/NodeList`, eg: as the result of a `dojo/query` call.
// DIFFERS from jQuery.data in that when used as a getter, the entire list is ALWAYS
// returned. EVEN WHEN THE LIST IS length == 1.
//
// A single-node version of this function is provided as `dojo._nodeData`, which follows
// the same signature, though expects a String ID or DomNode reference in the first
// position, before key/value arguments.
//
// node: String|DomNode
// The node to associate data with
//
// key: Object|String?
// If an object, act as a setter and iterate over said object setting data items as defined.
// If a string, and `value` present, set the data for defined `key` to `value`
// If a string, and `value` absent, act as a getter, returning the data associated with said `key`
//
// value: Anything?
// The value to set for said `key`, provided `key` is a string (and not an object)
//
// example:
// Set a key `bar` to some data, then retrieve it.
// | require(["dojo/query", "dojo/NodeList-data"], function(query){
// | query(".foo").data("bar", "touched");
// | var touched = query(".foo").data("bar");
// | if(touched[0] == "touched"){ alert('win'); }
// | });
//
// example:
// Get all the data items for a given node.
// | require(["dojo/query", "dojo/NodeList-data"], function(query){
// | var list = query(".foo").data();
// | var first = list[0];
// | });
//
// example:
// Set the data to a complex hash. Overwrites existing keys with new value
// | require(["dojo/query", "dojo/NodeList-data"], function(query){
// | query(".foo").data({ bar:"baz", foo:"bar" });
// Then get some random key:
// | query(".foo").data("foo"); // returns [`bar`]
// | });
//
// returns: Object|Anything|Nothing
// When used as a setter via `dojo/NodeList`, a NodeList instance is returned
// for further chaining. When used as a getter via `dojo/NodeList` an ARRAY
// of items is returned. The items in the array correspond to the elements
// in the original list. This is true even when the list length is 1, eg:
// when looking up a node by ID (#foo)
},
removeData: function(key){
// summary:
// Remove the data associated with these nodes.
// key: String?
// If omitted, clean all data for this node.
// If passed, remove the data item found at `key`
// summary:
// Remove the data associated with these nodes.
// key: String?
// If omitted, clean all data for this node.
// If passed, remove the data item found at `key`
}

@@ -176,0 +182,0 @@ });

@@ -15,3 +15,3 @@ define(["./_base/kernel", "./query", "./_base/array", "./_base/lang", "./dom-class", "./dom-construct", "./dom-geometry", "./dom-attr", "./dom-style"], function(dojo, query, array, lang, domCls, domCtr, domGeom, domAttr, domStyle){

// summary:
// the guard function for dojo.attr() and dojo.style()
// the guard function for dojo/dom-attr() and dojo/dom-style()
return a.length == 1 && (typeof a[0] == "string"); // inline'd type check

@@ -28,3 +28,3 @@ };

};
// FIXME: should we move orphan() to dojo.html?
// FIXME: should we move orphan() to dojo/_base/html?

@@ -53,3 +53,3 @@ var NodeList = query.NodeList,

// "parse". If "template" is defined, then the template value is run through
// dojo.string.substitute (if dojo/string.substitute() has been dojo.required elsewhere),
// dojo/string.substitute (if dojo/string.substitute() has been required elsewhere),
// or if templateFunc is a function on the content, that function will be used to

@@ -59,3 +59,3 @@ // transform the template into a final string to be used for for passing to dojo/dom-construct.toDom().

// nodes are inserted into the DOM. At that point, the nodes will be parsed for widgets
// (if dojo.parser has been dojo.required elsewhere).
// (if dojo/parser has been required elsewhere).

@@ -157,3 +157,3 @@ //Wanted to just use a DocumentFragment, but for the array/NodeList

// Returns border-box objects (x/y/w/h) of all elements in a node list
// as an Array (*not* a NodeList). Acts like `dojo.position`, though
// as an Array (*not* a NodeList). Acts like `dojo/dom-geometry-position`, though
// assumes the node passed is each node in this list.

@@ -170,3 +170,3 @@

// gets or sets the DOM attribute for every element in the
// NodeList. See also `dojo.attr`
// NodeList. See also `dojo/dom-attr`
// property: String

@@ -181,10 +181,16 @@ // the attribute to get/set

// Make all nodes with a particular class focusable:
// | dojo.query(".focusable").attr("tabIndex", -1);
// | require(["dojo/query", "dojo/NodeList-dom"], function(query){
// | query(".focusable").attr("tabIndex", -1);
// | });
// example:
// Disable a group of buttons:
// | dojo.query("button.group").attr("disabled", true);
// | require(["dojo/query", "dojo/NodeList-dom"], function(query){
// | query("button.group").attr("disabled", true);
// | });
// example:
// innerHTML can be assigned or retrieved as well:
// | // get the innerHTML (as an array) for each list item
// | var ih = dojo.query("li.replaceable").attr("innerHTML");
// | require(["dojo/query", "dojo/NodeList-dom"], function(query){
// | var ih = query("li.replaceable").attr("innerHTML");
// | });
return; // dojo/NodeList|Array

@@ -315,3 +321,3 @@ },

// places elements of this node list relative to the first element matched
// by queryOrNode. Returns the original NodeList. See: `dojo.place`
// by queryOrNode. Returns the original NodeList. See: `dojo/dom-construct.place`
// queryOrNode:

@@ -387,6 +393,9 @@ // may be a string representing any valid CSS3 selector or a DOM node.

// If we are presented with the following definition for a NodeList:
// | var l = new NodeList(dojo.byId("foo"), dojo.byId("bar"));
// | require(["dojo/dom", "dojo/query", "dojo/NodeList-dom"
// | ], function(dom, query){
// | var l = new NodeList(dom.byId("foo"), dom.byId("bar"));
// it's possible to find all span elements under paragraphs
// contained by these elements with this sub-query:
// | var spans = l.query("p span");
// | var spans = l.query("p span");
// | });

@@ -417,10 +426,15 @@ // FIXME: probably slow

// "regular" JS filter syntax as exposed in dojo.filter:
// | dojo.query("*").filter(function(item){
// | // highlight every paragraph
// | return (item.nodeName == "p");
// | }).style("backgroundColor", "yellow");
// | require(["dojo/query", "dojo/NodeList-dom"
// | ], function(query){
// | query("*").filter(function(item){
// | // highlight every paragraph
// | return (item.nodeName == "p");
// | }).style("backgroundColor", "yellow");
// | });
// example:
// the same filtering using a CSS selector
// | dojo.query("*").filter("p").styles("backgroundColor", "yellow");
// the same filtering using a CSS selector
// | require(["dojo/query", "dojo/NodeList-dom"
// | ], function(query){
// | query("*").filter("p").styles("backgroundColor", "yellow");
// | });
var a = arguments, items = this, start = 0;

@@ -481,31 +495,46 @@ if(typeof filter == "string"){ // inline'd type check

// appends content to the end if the position is omitted
// | dojo.query("h3 > p").addContent("hey there!");
// | require(["dojo/query", "dojo/NodeList-dom"
// | ], function(query){
// | query("h3 > p").addContent("hey there!");
// | });
// example:
// add something to the front of each element that has a
// "thinger" property:
// | dojo.query("[thinger]").addContent("...", "first");
// | require(["dojo/query", "dojo/NodeList-dom"
// | ], function(query){
// | query("[thinger]").addContent("...", "first");
// | });
// example:
// adds a header before each element of the list
// | dojo.query(".note").addContent("<h4>NOTE:</h4>", "before");
// | require(["dojo/query", "dojo/NodeList-dom"
// | ], function(query){
// | query(".note").addContent("<h4>NOTE:</h4>", "before");
// | });
// example:
// add a clone of a DOM node to the end of every element in
// the list, removing it from its existing parent.
// | dojo.query(".note").addContent(dojo.byId("foo"));
// | require(["dojo/dom", "dojo/query", "dojo/NodeList-dom"
// | ], function(dom, query){
// | query(".note").addContent(dom.byId("foo"));
// | });
// example:
// Append nodes from a templatized string.
// | dojo.require("dojo.string");
// | dojo.query(".note").addContent({
// | template: '<b>${id}: </b><span>${name}</span>',
// | id: "user332",
// | name: "Mr. Anderson"
// | });
// | require(["dojo/string", "dojo/query", "dojo/NodeList-dom"
// | ], function(string, query){
// | query(".note").addContent({
// | template: '<b>${id}: </b><span>${name}</span>',
// | id: "user332",
// | name: "Mr. Anderson"
// | });
// | });
// example:
// Append nodes from a templatized string that also has widgets parsed.
// | dojo.require("dojo.string");
// | dojo.require("dojo.parser");
// | var notes = dojo.query(".note").addContent({
// | template: '<button dojoType="dijit/form/Button">${text}</button>',
// | parse: true,
// | text: "Send"
// | });
// | require(["dojo/string", "dojo/parser", "dojo/query", "dojo/NodeList-dom"
// | ], function(string, parser, query){
// | var notes = query(".note").addContent({
// | template: '<button dojoType="dijit/form/Button">${text}</button>',
// | parse: true,
// | text: "Send"
// | });
// | });
content = this._normalize(content, this[0]);

@@ -512,0 +541,0 @@ for(var i = 0, node; (node = this[i]); i++){

@@ -45,7 +45,13 @@ define(["./query", "./_base/lang", "./aspect", "./_base/fx", "./fx"],

// Fade in all tables with class "blah":
// | dojo.query("table.blah").wipeIn().play();
// | require(["dojo/query", "dojo/NodeList-fx"
// | ], function(query){
// | query("table.blah").wipeIn().play();
// | });
//
// example:
// Utilizing `auto` to get the NodeList back:
// | dojo.query(".titles").wipeIn({ auto:true }).onclick(someFunction);
// | require(["dojo/query", "dojo/NodeList-fx"
// | ], function(query){
// | query(".titles").wipeIn({ auto:true }).onclick(someFunction);
// | });
//

@@ -70,3 +76,6 @@ return this._anim(coreFx, "wipeIn", args); // dojo/_base/fx.Animation|dojo/NodeList

// Wipe out all tables with class "blah":
// | dojo.query("table.blah").wipeOut().play();
// | require(["dojo/query", "dojo/NodeList-fx"
// | ], function(query){
// | query("table.blah").wipeOut().play();
// | });
return this._anim(coreFx, "wipeOut", args); // dojo/_base/fx.Animation|dojo/NodeList

@@ -90,6 +99,9 @@ },

// | Move all tables with class "blah" to 300/300:
// | dojo.query("table.blah").slideTo({
// | left: 40,
// | top: 50
// | }).play();
// | require(["dojo/query", "dojo/NodeList-fx"
// | ], function(query){
// | query("table.blah").slideTo({
// | left: 40,
// | top: 50
// | }).play();
// | });
return this._anim(coreFx, "slideTo", args); // dojo/_base/fx.Animation|dojo/NodeList

@@ -114,3 +126,6 @@ },

// Fade in all tables with class "blah":
// | dojo.query("table.blah").fadeIn().play();
// | require(["dojo/query", "dojo/NodeList-fx"
// | ], function(query){
// | query("table.blah").fadeIn().play();
// | });
return this._anim(baseFx, "fadeIn", args); // dojo/_base/fx.Animation|dojo/NodeList

@@ -134,11 +149,20 @@ },

// Fade out all elements with class "zork":
// | dojo.query(".zork").fadeOut().play();
// | require(["dojo/query", "dojo/NodeList-fx"
// | ], function(query){
// | query(".zork").fadeOut().play();
// | });
// example:
// Fade them on a delay and do something at the end:
// | var fo = dojo.query(".zork").fadeOut();
// | aspect.after(fo, "onEnd", function(){ /*...*/ }, true);
// | fo.play();
// | require(["dojo/query", "dojo/aspect", "dojo/NodeList-fx"
// | ], function(query, aspect){
// | var fo = query(".zork").fadeOut();
// | aspect.after(fo, "onEnd", function(){ /*...*/ }, true);
// | fo.play();
// | });
// example:
// Using `auto`:
// | dojo.query("li").fadeOut({ auto:true }).filter(filterFn).forEach(doit);
// | require(["dojo/query", "dojo/NodeList-fx"
// | ], function(query){
// | query("li").fadeOut({ auto:true }).filter(filterFn).forEach(doit);
// | });
//

@@ -163,17 +187,23 @@ return this._anim(baseFx, "fadeOut", args); // dojo/_base/fx.Animation|dojo/NodeList

// example:
// | dojo.query(".zork").animateProperty({
// | duration: 500,
// | properties: {
// | color: { start: "black", end: "white" },
// | left: { end: 300 }
// | }
// | }).play();
// | require(["dojo/query", "dojo/NodeList-fx"
// | ], function(query){
// | query(".zork").animateProperty({
// | duration: 500,
// | properties: {
// | color: { start: "black", end: "white" },
// | left: { end: 300 }
// | }
// | }).play();
// | });
//
// example:
// | dojo.query(".grue").animateProperty({
// | auto:true,
// | properties: {
// | height:240
// | }
// | }).onclick(handler);
// | require(["dojo/query", "dojo/NodeList-fx"
// | ], function(query){
// | query(".grue").animateProperty({
// | auto:true,
// | properties: {
// | height:240
// | }
// | }).onclick(handler);
// | });
return this._anim(baseFx, "animateProperty", args); // dojo/_base/fx.Animation|dojo/NodeList

@@ -204,7 +234,13 @@ },

// Another way to fade out:
// | dojo.query(".thinger").anim({ opacity: 0 });
// | require(["dojo/query", "dojo/NodeList-fx"
// | ], function(query){
// | query(".thinger").anim({ opacity: 0 });
// | });
// example:
// animate all elements with the "thigner" class to a width of 500
// pixels over half a second
// | dojo.query(".thinger").anim({ width: 500 }, 700);
// | require(["dojo/query", "dojo/NodeList-fx"
// | ], function(query){
// | query(".thinger").anim({ width: 500 }, 700);
// | });
var canim = coreFx.combine(

@@ -211,0 +247,0 @@ this.map(function(item){

@@ -9,3 +9,3 @@ define(["./query", "./_base/lang", "./html"], function(query, lang, html){

// summary:
// Adds a chainable html method to dojo.query() / NodeList instances for setting/replacing node content
// Adds a chainable html method to dojo/query() / NodeList instances for setting/replacing node content
};

@@ -34,10 +34,13 @@ =====*/

// example:
// | query(".thingList").html("<li data-dojo-type='dojo/dnd/Moveable'>1</li><li data-dojo-type='dojo/dnd/Moveable'>2</li><li data-dojo-type='dojo/dnd/Moveable'>3</li>",
// | {
// | parseContent: true,
// | onBegin: function(){
// | this.content = this.content.replace(/([0-9])/g, this.id + ": $1");
// | this.inherited("onBegin", arguments);
// | }
// | }).removeClass("notdone").addClass("done");
// | require(["dojo/query", "dojo/NodeList-html"
// | ], function(query){
// | query(".thingList").html("<li data-dojo-type='dojo/dnd/Moveable'>1</li><li data-dojo-type='dojo/dnd/Moveable'>2</li><li data-dojo-type='dojo/dnd/Moveable'>3</li>",
// | {
// | parseContent: true,
// | onBegin: function(){
// | this.content = this.content.replace(/([0-9])/g, this.id + ": $1");
// | this.inherited("onBegin", arguments);
// | }
// | }).removeClass("notdone").addClass("done");
// | });

@@ -44,0 +47,0 @@ var dhs = new html._ContentSetter(params || {});

@@ -128,3 +128,6 @@ define(["./query", "./_base/lang", "./_base/array", "./dom-construct", "./NodeList-dom"], function(dquery, lang, array, construct){

// This code inserts `<p>Hello World</p>` into both divs:
// | dojo.query("div").innerHTML("<p>Hello World</p>");
// | require(["dojo/query", "dojo/NodeList-manipulate"
// | ], function(query){
// | query("div").innerHTML("<p>Hello World</p>");
// | });
// example:

@@ -135,3 +138,6 @@ // assume a DOM created by this markup:

// This code returns `<p>Hello Mars</p>`:
// | var message = dojo.query("div").innerHTML();
// | require(["dojo/query", "dojo/NodeList-manipulate"
// | ], function(query){
// | var message = query("div").innerHTML();
// | });
if(arguments.length){

@@ -175,3 +181,6 @@ return this.addContent(value, "only"); // dojo/NodeList

// This code inserts "Hello World" into both divs:
// | dojo.query("div").text("Hello World");
// | require(["dojo/query", "dojo/NodeList-manipulate"
// | ], function(query){
// | query("div").text("Hello World");
// | });
// example:

@@ -182,3 +191,6 @@ // assume a DOM created by this markup:

// This code returns "Hello Mars today":
// | var message = dojo.query("div").text();
// | require(["dojo/query", "dojo/NodeList-manipulate"
// | ], function(query){
// | var message = query("div").text();
// | });
// returns:

@@ -223,6 +235,9 @@ // if no value is passed, the result is String, the text value of the first node.

// This code gets and sets the values for the form fields above:
// | dojo.query('[type="text"]').val(); //gets value foo
// | dojo.query('[type="text"]').val("bar"); //sets the input's value to "bar"
// | dojo.query("select").val() //gets array value ["red", "yellow"]
// | dojo.query("select").val(["blue", "yellow"]) //Sets the blue and yellow options to selected.
// | require(["dojo/query", "dojo/NodeList-manipulate"
// | ], function(query){
// | query('[type="text"]').val(); //gets value foo
// | query('[type="text"]').val("bar"); //sets the input's value to "bar"
// | query("select").val() //gets array value ["red", "yellow"]
// | query("select").val(["blue", "yellow"]) //Sets the blue and yellow options to selected.
// | });

@@ -297,3 +312,6 @@ //Special work for input elements.

// Running this code:
// | dojo.query("div").append("<span>append</span>");
// | require(["dojo/query", "dojo/NodeList-manipulate"
// | ], function(query){
// | query("div").append("<span>append</span>");
// | });
// Results in this DOM structure:

@@ -322,3 +340,6 @@ // | <div id="foo"><p>Hello Mars</p><span>append</span></div>

// Running this code:
// | dojo.query("span").appendTo("p");
// | require(["dojo/query", "dojo/NodeList-manipulate"
// | ], function(query){
// | query("span").appendTo("p");
// | });
// Results in this DOM structure:

@@ -344,3 +365,6 @@ // | <p>Hello Mars<span>append</span></p>

// Running this code:
// | dojo.query("div").prepend("<span>prepend</span>");
// | require(["dojo/query", "dojo/NodeList-manipulate"
// | ], function(query){
// | query("div").prepend("<span>prepend</span>");
// | });
// Results in this DOM structure:

@@ -369,3 +393,6 @@ // | <div id="foo"><span>prepend</span><p>Hello Mars</p></div>

// Running this code:
// | dojo.query("span").prependTo("p");
// | require(["dojo/query", "dojo/NodeList-manipulate"
// | ], function(query){
// | query("span").prependTo("p");
// | });
// Results in this DOM structure:

@@ -392,3 +419,6 @@ // | <p><span>prepend</span>Hello Mars</p>

// Running this code:
// | dojo.query("div").after("<span>after</span>");
// | require(["dojo/query", "dojo/NodeList-manipulate"
// | ], function(query){
// | query("div").after("<span>after</span>");
// | });
// Results in this DOM structure:

@@ -417,3 +447,6 @@ // | <div id="foo"><p>Hello Mars</p></div><span>after</span>

// Running this code:
// | dojo.query("span").insertAfter("p");
// | require(["dojo/query", "dojo/NodeList-manipulate"
// | ], function(query){
// | query("span").insertAfter("p");
// | });
// Results in this DOM structure:

@@ -440,3 +473,6 @@ // | <p>Hello Mars</p><span>after</span>

// Running this code:
// | dojo.query("div").before("<span>before</span>");
// | require(["dojo/query", "dojo/NodeList-manipulate"
// | ], function(query){
// | query("div").before("<span>before</span>");
// | });
// Results in this DOM structure:

@@ -465,3 +501,6 @@ // | <span>before</span><div id="foo"><p>Hello Mars</p></div>

// Running this code:
// | dojo.query("span").insertBefore("p");
// | require(["dojo/query", "dojo/NodeList-manipulate"
// | ], function(query){
// | query("span").insertBefore("p");
// | });
// Results in this DOM structure:

@@ -505,3 +544,6 @@ // | <span>before</span><p>Hello Mars</p>

// Running this code:
// | dojo.query("b").wrap("<div><span></span></div>");
// | require(["dojo/query", "dojo/NodeList-manipulate"
// | ], function(query){
// | query("b").wrap("<div><span></span></div>");
// | });
// Results in this DOM structure:

@@ -546,3 +588,6 @@ // | <div><span><b>one</b></span></div>

// Running this code:
// | dojo.query(".red").wrapAll('<div class="allRed"></div>');
// | require(["dojo/query", "dojo/NodeList-manipulate"
// | ], function(query){
// | query(".red").wrapAll('<div class="allRed"></div>');
// | });
// Results in this DOM structure:

@@ -592,3 +637,6 @@ // | <div class="container">

// Running this code:
// | dojo.query(".red").wrapInner('<span class="special"></span>');
// | require(["dojo/query", "dojo/NodeList-manipulate"
// | ], function(query){
// | query(".red").wrapInner('<span class="special"></span>');
// | });
// Results in this DOM structure:

@@ -636,3 +684,6 @@ // | <div class="container">

// Running this code:
// | dojo.query(".red").replaceWith('<div class="green">Green</div>');
// | require(["dojo/query", "dojo/NodeList-manipulate"
// | ], function(query){
// | query(".red").replaceWith('<div class="green">Green</div>');
// | });
// Results in this DOM structure:

@@ -678,3 +729,6 @@ // | <div class="container">

// Running this code:
// | dojo.query(".red").replaceAll(".blue");
// | require(["dojo/query", "dojo/NodeList-manipulate"
// | ], function(query){
// | query(".red").replaceAll(".blue");
// | });
// Results in this DOM structure:

@@ -716,3 +770,6 @@ // | <div class="container">

// Running this code:
// | dojo.query(".red").clone().appendTo(".container");
// | require(["dojo/query", "dojo/NodeList-manipulate"
// | ], function(query){
// | query(".red").clone().appendTo(".container");
// | });
// Results in this DOM structure:

@@ -719,0 +776,0 @@ // | <div class="container">

@@ -9,3 +9,3 @@ define(["./query", "./_base/lang", "./_base/array"], function(dquery, lang, array){

// summary:
// Adds chainable methods to dojo.query() / NodeList instances for traversing the DOM
// Adds chainable methods to dojo/query() / NodeList instances for traversing the DOM
};

@@ -40,3 +40,3 @@ =====*/

for(var i = 0, node; node = nodes[i]; i++){
//Should be a faster way to do this. dojo.query has a private
//Should be a faster way to do this. dojo/query has a private
//_zip function that may be inspirational, but there are pathways

@@ -90,3 +90,6 @@ //in query that force nozip?

// Running this code:
// | dojo.query(".container").children();
// | require(["dojo/query", "dojo/NodeList-traverse"
// | ], function(query){
// | query(".container").children();
// | });
// returns the four divs that are children of the container div.

@@ -125,3 +128,6 @@ // Running this code:

// Running this code:
// | dojo.query(".red").closest(".container");
// | require(["dojo/query", "dojo/NodeList-traverse"
// | ], function(query){
// | query(".red").closest(".container");
// | });
// returns the div with class "container".

@@ -158,6 +164,9 @@ return this._getRelatedUniqueNodes(null, function(node, ary){

// Running this code:
// | dojo.query(".text").parent();
// | require(["dojo/query", "dojo/NodeList-traverse"
// | ], function(query){
// | query(".text").parent();
// | });
// returns the two divs with class "blue".
// Running this code:
// | dojo.query(".text").parent(".first");
// | query(".text").parent(".first");
// returns the one div with class "blue" and "first".

@@ -189,7 +198,10 @@ return this._getRelatedUniqueNodes(query, function(node, ary){

// Running this code:
// | dojo.query(".text").parents();
// | require(["dojo/query", "dojo/NodeList-traverse"
// | ], function(query){
// | query(".text").parents();
// | });
// returns the two divs with class "blue", the div with class "container",
// | the body element and the html element.
// Running this code:
// | dojo.query(".text").parents(".container");
// | query(".text").parents(".container");
// returns the one div with class "container".

@@ -227,7 +239,10 @@ return this._getRelatedUniqueNodes(query, function(node, ary){

// Running this code:
// | dojo.query(".first").siblings();
// | require(["dojo/query", "dojo/NodeList-traverse"
// | ], function(query){
// | query(".first").siblings();
// | });
// returns the two divs with class "red" and the other div
// | with class "blue" that does not have "first".
// Running this code:
// | dojo.query(".first").siblings(".red");
// | query(".first").siblings(".red");
// returns the two div with class "red".

@@ -267,3 +282,6 @@ return this._getRelatedUniqueNodes(query, function(node, ary){

// Running this code:
// | dojo.query(".first").next();
// | require(["dojo/query", "dojo/NodeList-traverse"
// | ], function(query){
// | query(".first").next();
// | });
// returns the div with class "red" and has innerHTML of "Red Two".

@@ -303,6 +321,9 @@ // Running this code:

// Running this code:
// | dojo.query(".first").nextAll();
// | require(["dojo/query", "dojo/NodeList-traverse"
// | ], function(query){
// | query(".first").nextAll();
// | });
// returns the two divs with class of "next".
// Running this code:
// | dojo.query(".first").nextAll(".red");
// | query(".first").nextAll(".red");
// returns the one div with class "red" and innerHTML "Red Two".

@@ -342,6 +363,9 @@ return this._getRelatedUniqueNodes(query, function(node, ary){

// Running this code:
// | dojo.query(".first").prev();
// | require(["dojo/query", "dojo/NodeList-traverse"
// | ], function(query){
// | query(".first").prev();
// | });
// returns the div with class "red" and has innerHTML of "Red One".
// Running this code:
// | dojo.query(".first").prev(".blue");
// | query(".first").prev(".blue");
// does not return any elements.

@@ -380,6 +404,9 @@ return this._getRelatedUniqueNodes(query, function(node, ary){

// Running this code:
// | dojo.query(".second").prevAll();
// | require(["dojo/query", "dojo/NodeList-traverse"
// | ], function(query){
// | query(".second").prevAll();
// | });
// returns the two divs with class of "prev".
// Running this code:
// | dojo.query(".first").prevAll(".red");
// | query(".first").prevAll(".red");
// returns the one div with class "red prev" and innerHTML "Red One".

@@ -414,3 +441,6 @@ return this._getRelatedUniqueNodes(query, function(node, ary){

// Running this code:
// | dojo.query(".second").prevAll().andSelf();
// | require(["dojo/query", "dojo/NodeList-traverse"
// | ], function(query){
// | query(".second").prevAll().andSelf();
// | });
// returns the two divs with class of "prev", as well as the div with class "second".

@@ -438,3 +468,6 @@ return this.concat(this._parent); // dojo/NodeList

// Running this code:
// | dojo.query(".blue").first();
// | require(["dojo/query", "dojo/NodeList-traverse"
// | ], function(query){
// | query(".blue").first();
// | });
// returns the div with class "blue" and "first".

@@ -461,3 +494,6 @@ return this._wrap(((this[0] && [this[0]]) || []), this); // dojo/NodeList

// Running this code:
// | dojo.query(".blue").last();
// | require(["dojo/query", "dojo/NodeList-traverse"
// | ], function(query){
// | query(".blue").last();
// | });
// returns the last div with class "blue",

@@ -484,3 +520,6 @@ return this._wrap((this.length ? [this[this.length - 1]] : []), this); // dojo/NodeList

// Running this code:
// | dojo.query(".interior").even();
// | require(["dojo/query", "dojo/NodeList-traverse"
// | ], function(query){
// | query(".interior").even();
// | });
// returns the two divs with class "blue"

@@ -509,3 +548,6 @@ return this.filter(function(item, i){

// Running this code:
// | dojo.query(".interior").odd();
// | require(["dojo/query", "dojo/NodeList-traverse"
// | ], function(query){
// | query(".interior").odd();
// | });
// returns the two divs with class "red"

@@ -512,0 +554,0 @@ return this.filter(function(item, i){

@@ -10,5 +10,22 @@ define(["./has!dom-addeventlistener?:./aspect", "./_base/kernel", "./sniff"], function(aspect, dojo, has){

has.add("event-focusin", function(global, doc, element){
// All browsers except firefox support focusin, but too hard to feature test webkit since element.onfocusin
// is undefined. Just return true for IE and use fallback path for other browsers.
return !!element.attachEvent;
return 'onfocusin' in element || (element.addEventListener && (function () {
var hasFocusInEvent = false;
function testFocus() {
hasFocusInEvent = true;
}
try {
var element = doc.createElement('input'),
activeElement = doc.activeElement;
element.style.position = 'fixed';
element.addEventListener('focusin', testFocus, false);
doc.body.appendChild(element);
element.focus();
doc.body.removeChild(element);
element.removeEventListener('focusin', testFocus, false);
activeElement.focus();
} catch (e) {}
return hasFocusInEvent;
})());
});

@@ -187,3 +204,3 @@ }

function select(eventTarget){
// see if we have a valid matchesTarget or default to dojo.query
// see if we have a valid matchesTarget or default to dojo/query
matchesTarget = matchesTarget && matchesTarget.matches ? matchesTarget : dojo.query;

@@ -256,13 +273,16 @@ // there is a selector, so make sure it matches

// To fire our own click event
// | on.emit(dojo.byId("button"), "click", {
// | cancelable: true,
// | bubbles: true,
// | screenX: 33,
// | screenY: 44
// | });
// | require(["dojo/on", "dojo/dom"
// | ], function(on, dom){
// | on.emit(dom.byId("button"), "click", {
// | cancelable: true,
// | bubbles: true,
// | screenX: 33,
// | screenY: 44
// | });
// We can also fire our own custom events:
// | on.emit(dojo.byId("slider"), "slide", {
// | cancelable: true,
// | bubbles: true,
// | direction: "left-to-right"
// | on.emit(dom.byId("slider"), "slide", {
// | cancelable: true,
// | bubbles: true,
// | direction: "left-to-right"
// | });
// | });

@@ -269,0 +289,0 @@ var args = slice.call(arguments, 2);

{
"name": "dojo",
"version":"1.9.1",
"version":"1.9.2",
"directories": {

@@ -5,0 +5,0 @@ "lib": "."

@@ -59,3 +59,3 @@ define(["./_base/kernel", "./has", "./dom", "./on", "./_base/array", "./_base/lang", "./selector/_loader", "./selector/_loader!default"],

// adapts a single node function to be used in the map-type
// actions. The return is a new array of values, as via `dojo.map`
// actions. The return is a new array of values, as via `dojo/_base/array.map`
// f: Function

@@ -107,3 +107,3 @@ // a function to adapt

// node manipulation. NodeLists are most often returned as the
// result of dojo.query() calls.
// result of dojo/query() calls.
// description:

@@ -113,3 +113,3 @@ // NodeList instances provide many utilities that reflect

// manipulation, and event handling. Instead of needing to dig up
// functions in the dojo.* namespace, NodeLists generally make the
// functions in the dojo package, NodeLists generally make the
// full power of Dojo available for DOM manipulation tasks in a

@@ -119,8 +119,14 @@ // simple, chainable way.

// create a node list from a node
// | new query.NodeList(dojo.byId("foo"));
// | require(["dojo/query", "dojo/dom"
// | ], function(query, dom){
// | query.NodeList(dom.byId("foo"));
// | });
// example:
// get a NodeList from a CSS query and iterate on it
// | var l = dojo.query(".thinger");
// | l.forEach(function(node, index, nodeList){
// | console.log(index, node.innerHTML);
// | require(["dojo/on", "dojo/dom"
// | ], function(on, dom){
// | var l = query(".thinger");
// | l.forEach(function(node, index, nodeList){
// | console.log(index, node.innerHTML);
// | });
// | });

@@ -130,54 +136,32 @@ // example:

// NodeList without needing to use dojo.* functions explicitly:
// | var l = dojo.query(".thinger");
// | // since NodeLists are real arrays, they have a length
// | // property that is both readable and writable and
// | // push/pop/shift/unshift methods
// | console.log(l.length);
// | l.push(dojo.create("span"));
// | require(["dojo/query", "dojo/dom-construct", "dojo/dom"
// | ], function(query, domConstruct, dom){
// | var l = query(".thinger");
// | // since NodeLists are real arrays, they have a length
// | // property that is both readable and writable and
// | // push/pop/shift/unshift methods
// | console.log(l.length);
// | l.push(domConstruct.create("span"));
// |
// | // dojo's normalized array methods work too:
// | console.log( l.indexOf(dojo.byId("foo")) );
// | // ...including the special "function as string" shorthand
// | console.log( l.every("item.nodeType == 1") );
// | // dojo's normalized array methods work too:
// | console.log( l.indexOf(dom.byId("foo")) );
// | // ...including the special "function as string" shorthand
// | console.log( l.every("item.nodeType == 1") );
// |
// | // NodeLists can be [..] indexed, or you can use the at()
// | // function to get specific items wrapped in a new NodeList:
// | var node = l[3]; // the 4th element
// | var newList = l.at(1, 3); // the 2nd and 4th elements
// | // NodeLists can be [..] indexed, or you can use the at()
// | // function to get specific items wrapped in a new NodeList:
// | var node = l[3]; // the 4th element
// | var newList = l.at(1, 3); // the 2nd and 4th elements
// | });
// example:
// the style functions you expect are all there too:
// | // style() as a getter...
// | var borders = dojo.query(".thinger").style("border");
// | // ...and as a setter:
// | dojo.query(".thinger").style("border", "1px solid black");
// | // class manipulation
// | dojo.query("li:nth-child(even)").addClass("even");
// | // even getting the coordinates of all the items
// | var coords = dojo.query(".thinger").coords();
// example:
// DOM manipulation functions from the dojo.* namespace area also available:
// | // remove all of the elements in the list from their
// | // parents (akin to "deleting" them from the document)
// | dojo.query(".thinger").orphan();
// | // place all elements in the list at the front of #foo
// | dojo.query(".thinger").place("foo", "first");
// example:
// Event handling couldn't be easier. `dojo.connect` is mapped in,
// and shortcut handlers are provided for most DOM events:
// | // like dojo.connect(), but with implicit scope
// | dojo.query("li").connect("onclick", console, "log");
// |
// | // many common event handlers are already available directly:
// | dojo.query("li").onclick(console, "log");
// | var toggleHovered = dojo.hitch(dojo, "toggleClass", "hovered");
// | dojo.query("p")
// | .onmouseenter(toggleHovered)
// | .onmouseleave(toggleHovered);
// example:
// chainability is a key advantage of NodeLists:
// | dojo.query(".thinger")
// | .onclick(function(e){ /* ... */ })
// | .at(1, 3, 8) // get a subset
// | .style("padding", "5px")
// | .forEach(console.log);
// | require(["dojo/query", "dojo/NodeList-dom"
// | ], function(query){
// | query(".thinger")
// | .onclick(function(e){ /* ... */ })
// | .at(1, 3, 8) // get a subset
// | .style("padding", "5px")
// | .forEach(console.log);
// | });
var isNew = this instanceof nl && has("array-extensible");

@@ -258,16 +242,18 @@ if(typeof array == "number"){

// the dojo/NodeList but allows access to the original NodeList by using this._stash:
// | dojo.extend(NodeList, {
// | third: function(){
// | var newNodeList = NodeList(this[2]);
// | return newNodeList._stash(this);
// | }
// | require(["dojo/query", "dojo/_base/lang", "dojo/NodeList", "dojo/NodeList-dom"
// | ], function(query, lang){
// | lang.extend(NodeList, {
// | third: function(){
// | var newNodeList = NodeList(this[2]);
// | return newNodeList._stash(this);
// | }
// | });
// | // then see how _stash applies a sub-list, to be .end()'ed out of
// | query(".foo")
// | .third()
// | .addClass("thirdFoo")
// | .end()
// | // access to the orig .foo list
// | .removeClass("foo")
// | });
// | // then see how _stash applies a sub-list, to be .end()'ed out of
// | dojo.query(".foo")
// | .third()
// | .addClass("thirdFoo")
// | .end()
// | // access to the orig .foo list
// | .removeClass("foo")
// |
//

@@ -281,9 +267,14 @@ this._parent = parent;

// Listen for events on the nodes in the NodeList. Basic usage is:
// | query(".my-class").on("click", listener);
// This supports event delegation by using selectors as the first argument with the event names as
// pseudo selectors. For example:
// | dojo.query("#my-list").on("li:click", listener);
// This will listen for click events within `<li>` elements that are inside the `#my-list` element.
// Because on supports CSS selector syntax, we can use comma-delimited events as well:
// | dojo.query("#my-list").on("li button:mouseover, li:click", listener);
//
// example:
// | require(["dojo/query"
// | ], function(query){
// | query(".my-class").on("click", listener);
// This supports event delegation by using selectors as the first argument with the event names as
// pseudo selectors. For example:
// | query("#my-list").on("li:click", listener);
// This will listen for click events within `<li>` elements that are inside the `#my-list` element.
// Because on supports CSS selector syntax, we can use comma-delimited events as well:
// | query("#my-list").on("li button:mouseover, li:click", listener);
// | });
var handles = this.map(function(node){

@@ -308,9 +299,12 @@ return on(node, eventName, listener); // TODO: apply to the NodeList so the same selector engine is used for matches

// example:
// | dojo.query("a")
// | .filter(".disabled")
// | // operate on the anchors that only have a disabled class
// | .style("color", "grey")
// | .end()
// | // jump back to the list of anchors
// | .style(...)
// | require(["dojo/query", "dojo/NodeList-dom"
// | ], function(query){
// | query("a")
// | .filter(".disabled")
// | // operate on the anchors that only have a disabled class
// | .style("color", "grey")
// | .end()
// | // jump back to the list of anchors
// | .style(...)
// | });
//

@@ -342,3 +336,3 @@ if(this._parent){

// This method behaves exactly like the Array.slice method
// with the caveat that it returns a dojo/NodeList and not a
// with the caveat that it returns a `dojo/NodeList` and not a
// raw Array. For more details, see Mozilla's [slice

@@ -365,3 +359,3 @@ // documentation](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/slice)

// This method behaves exactly like the Array.splice method
// with the caveat that it returns a dojo/NodeList and not a
// with the caveat that it returns a `dojo/NodeList` and not a
// raw Array. For more details, see Mozilla's [splice

@@ -388,3 +382,3 @@ // documentation](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/splice)

// summary:
// see dojo.indexOf(). The primary difference is that the acted-on
// see `dojo/_base/array.indexOf()`. The primary difference is that the acted-on
// array is implicitly this NodeList

@@ -406,3 +400,3 @@ // value: Object

// summary:
// see dojo.lastIndexOf(). The primary difference is that the
// see `dojo/_base/array.lastIndexOf()`. The primary difference is that the
// acted-on array is implicitly this NodeList

@@ -424,6 +418,6 @@ // description:

// summary:
// see `dojo.every()` and the [Array.every
// see `dojo/_base/array.every()` and the [Array.every
// docs](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/every).
// Takes the same structure of arguments and returns as
// dojo.every() with the caveat that the passed array is
// dojo/_base/array.every() with the caveat that the passed array is
// implicitly this NodeList

@@ -440,4 +434,4 @@ // callback: Function

// Takes the same structure of arguments and returns as
// `dojo.some()` with the caveat that the passed array is
// implicitly this NodeList. See `dojo.some()` and Mozilla's
// `dojo/_base/array.some()` with the caveat that the passed array is
// implicitly this NodeList. See `dojo/_base/array.some()` and Mozilla's
// [Array.some

@@ -485,3 +479,3 @@ // documentation](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some).

// summary:
// see dojo.map(). The primary difference is that the acted-on
// see `dojo/_base/array.map()`. The primary difference is that the acted-on
// array is implicitly this NodeList and the return is a

@@ -494,3 +488,3 @@ // NodeList (a subclass of Array)

// summary:
// see `dojo.forEach()`. The primary difference is that the acted-on
// see `dojo/_base/array.forEach()`. The primary difference is that the acted-on
// array is implicitly this NodeList. If you want the option to break out

@@ -505,3 +499,3 @@ // of the forEach loop, use every() or some() instead.

// "masks" the built-in javascript filter() method (supported
// in Dojo via `dojo.filter`) to support passing a simple
// in Dojo via `dojo/_base/array.filter`) to support passing a simple
// string filter in addition to supporting filtering function

@@ -512,10 +506,16 @@ // objects.

// example:
// "regular" JS filter syntax as exposed in dojo.filter:
// | dojo.query("*").filter(function(item){
// | // highlight every paragraph
// | return (item.nodeName == "p");
// | }).style("backgroundColor", "yellow");
// "regular" JS filter syntax as exposed in `dojo/_base/array.filter`:
// | require(["dojo/query", "dojo/NodeList-dom"
// | ], function(query){
// | query("*").filter(function(item){
// | // highlight every paragraph
// | return (item.nodeName == "p");
// | }).style("backgroundColor", "yellow");
// | });
// example:
// the same filtering using a CSS selector
// | dojo.query("*").filter("p").styles("backgroundColor", "yellow");
// | require(["dojo/query", "dojo/NodeList-dom"
// | ], function(query){
// | query("*").filter("p").styles("backgroundColor", "yellow");
// | });

@@ -560,7 +560,13 @@ var a = arguments, items = this, start = 0;

// Shorten the list to the first, second, and third elements
// | query("a").at(0, 1, 2).forEach(fn);
// | require(["dojo/query"
// | ], function(query){
// | query("a").at(0, 1, 2).forEach(fn);
// | });
//
// example:
// Retrieve the first and last elements of a unordered list:
// | query("ul > li").at(0, -1).forEach(cb);
// | require(["dojo/query"
// | ], function(query){
// | query("ul > li").at(0, -1).forEach(cb);
// | });
//

@@ -570,5 +576,8 @@ // example:

// the original list and continue chaining:
// | query("a").at(0).onclick(fn).end().forEach(function(n){
// | console.log(n); // all anchors on the page.
// | require(["dojo/query"
// | ], function(query){
// | query("a").at(0).onclick(fn).end().forEach(function(n){
// | console.log(n); // all anchors on the page.
// | })
// | });

@@ -640,18 +649,16 @@ var t = new this._NodeListCtor(0);

// which causes the form to be sent via Ajax instead:
// | require(["dojo/query"], function(query){
// | require(["dojo/query", "dojo/request", "dojo/dom-form", "dojo/dom-construct", "dojo/dom-style"
// | ], function(query, request, domForm, domConstruct, domStyle){
// | query("input[type='submit']").on("click", function(e){
// | dojo.stopEvent(e); // prevent sending the form
// | e.preventDefault(); // prevent sending the form
// | var btn = e.target;
// | dojo.xhrPost({
// | form: btn.form,
// | load: function(data){
// | // replace the form with the response
// | var div = dojo.doc.createElement("div");
// | dojo.place(div, btn.form, "after");
// | div.innerHTML = data;
// | dojo.style(btn.form, "display", "none");
// | }
// | request.post("http://example.com/", {
// | data: domForm.toObject(btn.form)
// | }).then(function(response){
// | // replace the form with the response
// | domConstruct.create(div, {innerHTML: response}, btn.form, "after");
// | domStyle.set(btn.form, "display", "none");
// | });
// | });
// | });
// | });
//

@@ -658,0 +665,0 @@ // description:

@@ -36,2 +36,3 @@ define(["./has"], function(has){

has.add("bb", (dua.indexOf("BlackBerry") >= 0 || dua.indexOf("BB10") >= 0) && parseFloat(dua.split("Version/")[1]) || undefined);
has.add("trident", parseFloat(dav.split("Trident/")[1]) || undefined);

@@ -49,3 +50,3 @@ has.add("svg", typeof SVGAngle !== "undefined");

// Mozilla and firefox
if(dua.indexOf("Gecko") >= 0 && !has("khtml") && !has("webkit")){
if(dua.indexOf("Gecko") >= 0 && !has("khtml") && !has("webkit") && !has("trident")){
has.add("mozilla", tv);

@@ -52,0 +53,0 @@ }

@@ -18,7 +18,9 @@ define(["./_base/declare", "./_base/lang", "./_base/array", "./when"], function(declare, lang, array, when){

// example:
// | var obj = new dojo.Stateful();
// | obj.watch("foo", function(){
// | console.log("foo changed to " + this.get("foo"));
// | require(["dojo/Stateful", function(Stateful) {
// | var obj = new Stateful();
// | obj.watch("foo", function(){
// | console.log("foo changed to " + this.get("foo"));
// | });
// | obj.set("foo","bar");
// | });
// | obj.set("foo","bar");

@@ -68,6 +70,8 @@ // _attrPairNames: Hash

// this just retrieves the object's property.
// For example:
// | stateful = new dojo.Stateful({foo: 3});
// | stateful.get("foo") // returns 3
// | stateful.foo // returns 3
// example:
// | require(["dojo/Stateful", function(Stateful) {
// | var stateful = new Stateful({foo: 3});
// | stateful.get("foo") // returns 3
// | stateful.foo // returns 3
// | });

@@ -88,14 +92,15 @@ return this._get(name, this._getAttrNames(name)); //Any

// the property. A programmatic setter may be defined in subclasses.
// For example:
// | stateful = new dojo.Stateful();
// | stateful.watch(function(name, oldValue, value){
// | // this will be called on the set below
// | }
// | stateful.set(foo, 5);
//
// example:
// | require(["dojo/Stateful", function(Stateful) {
// | var stateful = new Stateful();
// | stateful.watch(function(name, oldValue, value){
// | // this will be called on the set below
// | }
// | stateful.set(foo, 5);
// set() may also be called with a hash of name/value pairs, ex:
// | myObj.set({
// | foo: "Howdy",
// | bar: 3
// | })
// | stateful.set({
// | foo: "Howdy",
// | bar: 3
// | });
// | });
// This is equivalent to calling set(foo, "Howdy") and set(bar, 3)

@@ -102,0 +107,0 @@

@@ -91,2 +91,5 @@ define(["../../_base/array" /*=====, "../api/Store" =====*/], function(arrayUtil /*=====, Store =====*/){

var bValue = b[sort.attribute];
// valueOf enables proper comparison of dates
aValue = aValue != null ? aValue.valueOf() : aValue;
bValue = bValue != null ? bValue.valueOf() : bValue;
if (aValue != bValue){

@@ -93,0 +96,0 @@ return !!sort.descending == (aValue == null || aValue > bValue) ? -1 : 1;

@@ -155,3 +155,3 @@ define([

// This version of trim() was taken from [Steven Levithan's blog](http://blog.stevenlevithan.com/archives/faster-trim-javascript).
// The short yet performant version of this function is dojo.trim(),
// The short yet performant version of this function is dojo/_base/lang.trim(),
// which is part of Dojo base. Uses String.prototype.trim instead, if available.

@@ -158,0 +158,0 @@ return ""; // String

@@ -144,4 +144,5 @@ define([

doh.register("tests._base.loader.require-config", require.toUrl("./loader/config/test.html"), {async:1});
doh.register("tests._base.loader.mapping", require.toUrl("./loader/mapping.html"), {async:1});
}
});
define([
"doh",
"doh", "require",
"dojo/_base/declare", "dojo/Evented", "dojo/has", "dojo/on", "dojo/query", "dojo/topic"
], function(doh, declare, Evented, has, on, query, topic){
], function(doh, require, declare, Evented, has, on, query, topic){

@@ -289,2 +289,6 @@ doh.register("tests.on", [

]);
if(has("host-browser")){
doh.registerUrl("tests.on.event-focusin", require.toUrl("./event-focusin.html"), 30000);
}
});
define(["doh", "dojo/store/Memory"], function(doh, Memory){
var store = new Memory({
data: [
{id: 1, name: "one", prime: false, mappedTo: "E"},
{id: 2, name: "two", even: true, prime: true, mappedTo: "D"},
{id: 3, name: "three", prime: true, mappedTo: "C"},
{id: 4, name: "four", even: true, prime: false, mappedTo: null},
{id: 5, name: "five", prime: true, mappedTo: "A"}
{id: 1, name: "one", prime: false, mappedTo: "E", date: new Date(1970, 0, 1) },
{id: 2, name: "two", even: true, prime: true, mappedTo: "D", date: new Date(1980, 1, 2) },
{id: 3, name: "three", prime: true, mappedTo: "C", date: new Date(1990, 2, 3) },
{id: 4, name: "four", even: true, prime: false, mappedTo: null, date: new Date(1972, 3, 6, 12, 1) },
{id: 5, name: "five", prime: true, mappedTo: "A", date: new Date(1972, 3, 6, 6, 2) }
]

@@ -43,2 +43,6 @@ });

t.is(store.query(null, {sort:[{attribute:"mappedTo"}]})[4].name, "four");
t.is([ 1, 5, 4, 2, 3 ], store.query({}, { sort: [ { attribute: "date", descending: false } ] }).map(function (item) {
return item.id;
}));
},

@@ -45,0 +49,0 @@ function testQueryWithPaging(t){

@@ -82,2 +82,3 @@ define(["./_base/kernel", "require", "./has", "./has!host-browser?./request"], function(dojo, require, has, request){

// | //the value for the text variable.
// | //Note: This is pre-AMD, deprecated syntax
// | var text = dojo["cache"]("my.module", "template.html");

@@ -91,2 +92,3 @@ // example:

// | //text variable will contain just "<h1>Hello</h1>".
// | //Note: This is pre-AMD, deprecated syntax
// | var text = dojo["cache"]("my.module", "template.html", {sanitize: true});

@@ -98,2 +100,3 @@ // example:

// | //text variable will contain just "<h1>Hello</h1>".
// | //Note: This is pre-AMD, deprecated syntax
// | var text = dojo["cache"](new dojo._Url("my/module/template.html"), {sanitize: true});

@@ -100,0 +103,0 @@

@@ -11,3 +11,12 @@ define(["./_base/kernel", "./aspect", "./dom", "./dom-class", "./_base/lang", "./on", "./has", "./mouse", "./domReady", "./_base/window"],

var msPointer = navigator.msPointerEnabled;
var msPointer = navigator.pointerEnabled || navigator.msPointerEnabled,
pointer = (function () {
var pointer = {};
for (var type in { down: 1, move: 1, up: 1, cancel: 1, over: 1, out: 1 }) {
pointer[type] = !navigator.pointerEnabled ?
"MSPointer" + type.charAt(0).toUpperCase() + type.slice(1) :
"pointer" + type;
}
return pointer;
})();

@@ -55,3 +64,3 @@ // Click generation variables

do{
if(node.dojoClick){ return node.dojoClick; }
if(node.dojoClick !== undefined){ return node.dojoClick; }
}while(node = node.parentNode);

@@ -65,3 +74,5 @@ }

// was called in an event listener. Synthetic clicks are generated only if a node or one of its ancestors has
// its dojoClick property set to truthy.
// its dojoClick property set to truthy. If a node receives synthetic clicks because one of its ancestors has its
// dojoClick property set to truthy, you can disable synthetic clicks on this node by setting its own dojoClick property
// to falsy.

@@ -147,4 +158,4 @@ clickTracker = !e.target.disabled && marked(e.target); // click threshold = true, number or x/y object

domReady(function(){
win.doc.addEventListener("MSPointerDown", function(evt){
doClicks(evt, "MSPointerMove", "MSPointerUp");
win.doc.addEventListener(pointer.down, function(evt){
doClicks(evt, pointer.move, pointer.up);
}, true);

@@ -226,3 +237,7 @@ });

// drags over the specified node, regardless of which node the touch started on.
on.emit(newNode, "dojotouchmove", copyEventProps(evt));
if(!on.emit(newNode, "dojotouchmove", copyEventProps(evt))){
// emit returns false when synthetic event "dojotouchmove" is cancelled, so we prevent the
// default behavior of the underlying native event "touchmove".
evt.preventDefault();
}
}

@@ -248,10 +263,10 @@ });

var touch = {
press: dualEvent("mousedown", "touchstart", "MSPointerDown"),
move: dualEvent("mousemove", "dojotouchmove", "MSPointerMove"),
release: dualEvent("mouseup", "dojotouchend", "MSPointerUp"),
cancel: dualEvent(mouse.leave, "touchcancel", hasTouch?"MSPointerCancel":null),
over: dualEvent("mouseover", "dojotouchover", "MSPointerOver"),
out: dualEvent("mouseout", "dojotouchout", "MSPointerOut"),
enter: mouse._eventHandler(dualEvent("mouseover","dojotouchover", "MSPointerOver")),
leave: mouse._eventHandler(dualEvent("mouseout", "dojotouchout", "MSPointerOut"))
press: dualEvent("mousedown", "touchstart", pointer.down),
move: dualEvent("mousemove", "dojotouchmove", pointer.move),
release: dualEvent("mouseup", "dojotouchend", pointer.up),
cancel: dualEvent(mouse.leave, "touchcancel", hasTouch ? pointer.cancel : null),
over: dualEvent("mouseover", "dojotouchover", pointer.over),
out: dualEvent("mouseout", "dojotouchout", pointer.out),
enter: mouse._eventHandler(dualEvent("mouseover","dojotouchover", pointer.over)),
leave: mouse._eventHandler(dualEvent("mouseout", "dojotouchout", pointer.out))
};

@@ -265,9 +280,9 @@

// Based on http://dvcs.w3.org/hg/webevents/raw-file/tip/touchevents.html
// Also, if the dojoClick property is set to true on a DOM node, dojo/touch generates
// click events immediately for this node and its descendants, to avoid the
// delay before native browser click events, and regardless of whether evt.preventDefault()
// was called in a touch.press event listener.
// Also, if the dojoClick property is set to truthy on a DOM node, dojo/touch generates
// click events immediately for this node and its descendants (except for descendants that
// have a dojoClick property set to falsy), to avoid the delay before native browser click events,
// and regardless of whether evt.preventDefault() was called in a touch.press event listener.
//
// example:
// Used with dojo.on
// Used with dojo/on
// | define(["dojo/on", "dojo/touch"], function(on, touch){

@@ -293,3 +308,5 @@ // | on(node, touch.press, function(e){});

// | node.dojoClick = {x:50, y:5};
// example:
// Disable clicks without delay generated by dojo/touch on a node that has an ancestor with property dojoClick set to truthy
// | node.dojoClick = false;

@@ -296,0 +313,0 @@ press: function(node, listener){

@@ -137,3 +137,3 @@ define(["./_base/lang", "./sniff", "./_base/window", "./dom", "./dom-geometry", "./dom-style", "./dom-construct"],

if(node == body || node == html){ return; }
if(!(has("mozilla") || isIE || isWK || has("opera")) && ("scrollIntoView" in node)){
if(!(has("mozilla") || isIE || isWK || has("opera") || has("trident")) && ("scrollIntoView" in node)){
node.scrollIntoView(false); // short-circuit to native if possible

@@ -140,0 +140,0 @@ return;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc