build custom layer of Dojo to speed up loading of tt-rss (refs #293)

master
Andrew Dolgov 14 years ago
parent cfad9259a6
commit a089699c89

@ -0,0 +1,5 @@
dijit
dojo
dojox
release
util

@ -0,0 +1,41 @@
dependencies = {
layers: [
{
name: "tt-rss-layer.js",
resourceName: "tt-rss-layer",
dependencies: [
"dojo.parser",
"dijit.dijit",
"dojo.NodeList-fx",
"dijit.ColorPalette",
"dijit.Dialog",
"dijit.form.Button",
"dijit.form.CheckBox",
"dijit.form.DropDownButton",
"dijit.form.FilteringSelect",
"dijit.form.Form",
"dijit.form.RadioButton",
"dijit.form.Select",
"dijit.form.SimpleTextarea",
"dijit.form.TextBox",
"dijit.form.ValidationTextBox",
"dijit.InlineEditBox",
"dijit.layout.AccordionContainer",
"dijit.layout.BorderContainer",
"dijit.layout.ContentPane",
"dijit.layout.TabContainer",
"dijit.Menu",
"dijit.ProgressBar",
"dijit.ProgressBar",
"dijit.Toolbar",
"dijit.Tree",
"dijit.tree.dndSource",
"dojo.data.ItemFileWriteStore",
"dojo.parser",
]
}
],
prefixes: [
[ "dijit", "../dijit" ]
]
}

@ -0,0 +1,23 @@
#!/bin/sh
# This script rebuilds customized layer of Dojo for tt-rss
# Place unpacked Dojo source release in this directory and run this script.
# It will automatically replace previous build of Dojo in ../dojo
# Dojo requires Java runtime to build. Further information on rebuilding Dojo
# is available here: http://dojotoolkit.org/reference-guide/build/index.html
if [ -d util/buildscripts/ ]; then
pushd util/buildscripts
./build.sh profileFile=../../profile.js action=clean,release version=1.5.0 releaseName=
popd
if [ -d release/dojo ]; then
rm -rf ../dojo
cp -r release/dojo ..
else
echo $0: ERROR: Dojo build seems to have failed.
fi
else
echo $0: ERROR: Please unpack Dojo source release into current directory.
fi

@ -5,35 +5,102 @@
*/
if(!dojo._hasResource["dojo.AdapterRegistry"]){
dojo._hasResource["dojo.AdapterRegistry"]=true;
if(!dojo._hasResource["dojo.AdapterRegistry"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.AdapterRegistry"] = true;
dojo.provide("dojo.AdapterRegistry");
dojo.AdapterRegistry=function(_1){
this.pairs=[];
this.returnWrappers=_1||false;
};
dojo.extend(dojo.AdapterRegistry,{register:function(_2,_3,_4,_5,_6){
this.pairs[((_6)?"unshift":"push")]([_2,_3,_4,_5]);
},match:function(){
for(var i=0;i<this.pairs.length;i++){
var _7=this.pairs[i];
if(_7[1].apply(this,arguments)){
if((_7[3])||(this.returnWrappers)){
return _7[2];
}else{
return _7[2].apply(this,arguments);
}
}
}
throw new Error("No match found");
},unregister:function(_8){
for(var i=0;i<this.pairs.length;i++){
var _9=this.pairs[i];
if(_9[0]==_8){
this.pairs.splice(i,1);
return true;
}
dojo.AdapterRegistry = function(/*Boolean?*/ returnWrappers){
// summary:
// A registry to make contextual calling/searching easier.
// description:
// Objects of this class keep list of arrays in the form [name, check,
// wrap, directReturn] that are used to determine what the contextual
// result of a set of checked arguments is. All check/wrap functions
// in this registry should be of the same arity.
// example:
// | // 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
// | }
// | );
// |
// | // 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
this.pairs = [];
this.returnWrappers = returnWrappers || false; // Boolean
}
return false;
}});
dojo.extend(dojo.AdapterRegistry, {
register: function(/*String*/ name, /*Function*/ check, /*Function*/ wrap, /*Boolean?*/ directReturn, /*Boolean?*/ override){
// summary:
// register a check function to determine if the wrap function or
// object gets selected
// name:
// a way to identify this matcher.
// check:
// a function that arguments are passed to from the adapter's
// match() function. The check function should return true if the
// given arguments are appropriate for the wrap function.
// directReturn:
// If directReturn is true, the value passed in for wrap will be
// returned instead of being called. Alternately, the
// AdapterRegistry can be set globally to "return not call" using
// the returnWrappers property. Either way, this behavior allows
// the registry to act as a "search" function instead of a
// function interception library.
// override:
// If override is given and true, the check function will be given
// highest priority. Otherwise, it will be the lowest priority
// adapter.
this.pairs[((override) ? "unshift" : "push")]([name, check, wrap, directReturn]);
},
match: function(/* ... */){
// summary:
// Find an adapter for the given arguments. If no suitable adapter
// is found, throws an exception. match() accepts any number of
// arguments, all of which are passed to all matching functions
// from the registered pairs.
for(var i = 0; i < this.pairs.length; i++){
var pair = this.pairs[i];
if(pair[1].apply(this, arguments)){
if((pair[3])||(this.returnWrappers)){
return pair[2];
}else{
return pair[2].apply(this, arguments);
}
}
}
throw new Error("No match found");
},
unregister: function(name){
// summary: Remove a named adapter from the registry
// FIXME: this is kind of a dumb way to handle this. On a large
// registry this will be slow-ish and we can use the name as a lookup
// should we choose to trade memory for speed.
for(var i = 0; i < this.pairs.length; i++){
var pair = this.pairs[i];
if(pair[0] == name){
this.pairs.splice(i, 1);
return true;
}
}
return false;
}
});
}

@ -5,54 +5,79 @@
*/
if(!dojo._hasResource["dojo.DeferredList"]){
dojo._hasResource["dojo.DeferredList"]=true;
if(!dojo._hasResource["dojo.DeferredList"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.DeferredList"] = true;
dojo.provide("dojo.DeferredList");
dojo.DeferredList=function(_1,_2,_3,_4,_5){
var _6=[];
dojo.Deferred.call(this);
var _7=this;
if(_1.length===0&&!_2){
this.resolve([0,[]]);
}
var _8=0;
dojo.forEach(_1,function(_9,i){
_9.then(function(_a){
if(_2){
_7.resolve([i,_a]);
}else{
_b(true,_a);
}
},function(_c){
if(_3){
_7.reject(_c);
}else{
_b(false,_c);
}
if(_4){
return null;
}
throw _c;
});
function _b(_d,_e){
_6[i]=[_d,_e];
_8++;
if(_8===_1.length){
_7.resolve(_6);
}
};
});
dojo.DeferredList = function(/*Array*/ list, /*Boolean?*/ fireOnOneCallback, /*Boolean?*/ fireOnOneErrback, /*Boolean?*/ consumeErrors, /*Function?*/ canceller){
// summary:
// Provides event handling for a group of Deferred objects.
// description:
// DeferredList takes an array of existing deferreds and returns a new deferred of its own
// this new deferred will typically have its callback fired when all of the deferreds in
// the given list have fired their own deferreds. The parameters `fireOnOneCallback` and
// fireOnOneErrback, will fire before all the deferreds as appropriate
//
// list:
// The list of deferreds to be synchronizied with this DeferredList
// fireOnOneCallback:
// Will cause the DeferredLists callback to be fired as soon as any
// of the deferreds in its list have been fired instead of waiting until
// the entire list has finished
// fireonOneErrback:
// Will cause the errback to fire upon any of the deferreds errback
// canceller:
// A deferred canceller function, see dojo.Deferred
var resultList = [];
dojo.Deferred.call(this);
var self = this;
if(list.length === 0 && !fireOnOneCallback){
this.resolve([0, []]);
}
var finished = 0;
dojo.forEach(list, function(item, i){
item.then(function(result){
if(fireOnOneCallback){
self.resolve([i, result]);
}else{
addResult(true, result);
}
},function(error){
if(fireOnOneErrback){
self.reject(error);
}else{
addResult(false, error);
}
if(consumeErrors){
return null;
}
throw error;
});
function addResult(succeeded, result){
resultList[i] = [succeeded, result];
finished++;
if(finished === list.length){
self.resolve(resultList);
}
}
});
};
dojo.DeferredList.prototype=new dojo.Deferred();
dojo.DeferredList.prototype.gatherResults=function(_f){
var d=new dojo.DeferredList(_f,false,true,false);
d.addCallback(function(_10){
var ret=[];
dojo.forEach(_10,function(_11){
ret.push(_11[1]);
});
return ret;
});
return d;
dojo.DeferredList.prototype = new dojo.Deferred();
dojo.DeferredList.prototype.gatherResults= function(deferredList){
// summary:
// Gathers the results of the deferreds for packaging
// as the parameters to the Deferred Lists' callback
var d = new dojo.DeferredList(deferredList, false, true, false);
d.addCallback(function(results){
var ret = [];
dojo.forEach(results, function(result){
ret.push(result[1]);
});
return ret;
});
return d;
};
}

@ -5,37 +5,214 @@
*/
if(!dojo._hasResource["dojo.NodeList-fx"]){
dojo._hasResource["dojo.NodeList-fx"]=true;
if(!dojo._hasResource["dojo.NodeList-fx"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.NodeList-fx"] = true;
dojo.provide("dojo.NodeList-fx");
dojo.require("dojo.fx");
dojo.extend(dojo.NodeList,{_anim:function(_1,_2,_3){
_3=_3||{};
var a=dojo.fx.combine(this.map(function(_4){
var _5={node:_4};
dojo.mixin(_5,_3);
return _1[_2](_5);
}));
return _3.auto?a.play()&&this:a;
},wipeIn:function(_6){
return this._anim(dojo.fx,"wipeIn",_6);
},wipeOut:function(_7){
return this._anim(dojo.fx,"wipeOut",_7);
},slideTo:function(_8){
return this._anim(dojo.fx,"slideTo",_8);
},fadeIn:function(_9){
return this._anim(dojo,"fadeIn",_9);
},fadeOut:function(_a){
return this._anim(dojo,"fadeOut",_a);
},animateProperty:function(_b){
return this._anim(dojo,"animateProperty",_b);
},anim:function(_c,_d,_e,_f,_10){
var _11=dojo.fx.combine(this.map(function(_12){
return dojo.animateProperty({node:_12,properties:_c,duration:_d||350,easing:_e});
}));
if(_f){
dojo.connect(_11,"onEnd",_f);
}
return _11.play(_10||0);
}});
/*=====
dojo["NodeList-fx"] = {
// summary: Adds dojo.fx animation support to dojo.query()
};
=====*/
dojo.extend(dojo.NodeList, {
_anim: function(obj, method, args){
args = args||{};
var a = dojo.fx.combine(
this.map(function(item){
var tmpArgs = { node: item };
dojo.mixin(tmpArgs, args);
return obj[method](tmpArgs);
})
);
return args.auto ? a.play() && this : a; // dojo.Animation|dojo.NodeList
},
wipeIn: function(args){
// summary:
// wipe in all elements of this NodeList via `dojo.fx.wipeIn`
//
// args: Object?
// Additional dojo.Animation arguments to mix into this set with the addition of
// an `auto` parameter.
//
// returns: dojo.Animation|dojo.NodeList
// A special args member `auto` can be passed to automatically play the animation.
// If args.auto is present, the original dojo.NodeList will be returned for further
// chaining. Otherwise the dojo.Animation instance is returned and must be .play()'ed
//
// example:
// Fade in all tables with class "blah":
// | dojo.query("table.blah").wipeIn().play();
//
// example:
// Utilizing `auto` to get the NodeList back:
// | dojo.query(".titles").wipeIn({ auto:true }).onclick(someFunction);
//
return this._anim(dojo.fx, "wipeIn", args); // dojo.Animation|dojo.NodeList
},
wipeOut: function(args){
// summary:
// wipe out all elements of this NodeList via `dojo.fx.wipeOut`
//
// args: Object?
// Additional dojo.Animation arguments to mix into this set with the addition of
// an `auto` parameter.
//
// returns: dojo.Animation|dojo.NodeList
// A special args member `auto` can be passed to automatically play the animation.
// If args.auto is present, the original dojo.NodeList will be returned for further
// chaining. Otherwise the dojo.Animation instance is returned and must be .play()'ed
//
// example:
// Wipe out all tables with class "blah":
// | dojo.query("table.blah").wipeOut().play();
return this._anim(dojo.fx, "wipeOut", args); // dojo.Animation|dojo.NodeList
},
slideTo: function(args){
// summary:
// slide all elements of the node list to the specified place via `dojo.fx.slideTo`
//
// args: Object?
// Additional dojo.Animation arguments to mix into this set with the addition of
// an `auto` parameter.
//
// returns: dojo.Animation|dojo.NodeList
// A special args member `auto` can be passed to automatically play the animation.
// If args.auto is present, the original dojo.NodeList will be returned for further
// chaining. Otherwise the dojo.Animation instance is returned and must be .play()'ed
//
// example:
// | Move all tables with class "blah" to 300/300:
// | dojo.query("table.blah").slideTo({
// | left: 40,
// | top: 50
// | }).play();
return this._anim(dojo.fx, "slideTo", args); // dojo.Animation|dojo.NodeList
},
fadeIn: function(args){
// summary:
// fade in all elements of this NodeList via `dojo.fadeIn`
//
// args: Object?
// Additional dojo.Animation arguments to mix into this set with the addition of
// an `auto` parameter.
//
// returns: dojo.Animation|dojo.NodeList
// A special args member `auto` can be passed to automatically play the animation.
// If args.auto is present, the original dojo.NodeList will be returned for further
// chaining. Otherwise the dojo.Animation instance is returned and must be .play()'ed
//
// example:
// Fade in all tables with class "blah":
// | dojo.query("table.blah").fadeIn().play();
return this._anim(dojo, "fadeIn", args); // dojo.Animation|dojo.NodeList
},
fadeOut: function(args){
// summary:
// fade out all elements of this NodeList via `dojo.fadeOut`
//
// args: Object?
// Additional dojo.Animation arguments to mix into this set with the addition of
// an `auto` parameter.
//
// returns: dojo.Animation|dojo.NodeList
// A special args member `auto` can be passed to automatically play the animation.
// If args.auto is present, the original dojo.NodeList will be returned for further
// chaining. Otherwise the dojo.Animation instance is returned and must be .play()'ed
//
// example:
// Fade out all elements with class "zork":
// | dojo.query(".zork").fadeOut().play();
// example:
// Fade them on a delay and do something at the end:
// | var fo = dojo.query(".zork").fadeOut();
// | dojo.connect(fo, "onEnd", function(){ /*...*/ });
// | fo.play();
// example:
// Using `auto`:
// | dojo.query("li").fadeOut({ auto:true }).filter(filterFn).forEach(doit);
//
return this._anim(dojo, "fadeOut", args); // dojo.Animation|dojo.NodeList
},
animateProperty: function(args){
// summary:
// Animate all elements of this NodeList across the properties specified.
// syntax identical to `dojo.animateProperty`
//
// returns: dojo.Animation|dojo.NodeList
// A special args member `auto` can be passed to automatically play the animation.
// If args.auto is present, the original dojo.NodeList will be returned for further
// chaining. Otherwise the dojo.Animation instance is returned and must be .play()'ed
//
// example:
// | dojo.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);
return this._anim(dojo, "animateProperty", args); // dojo.Animation|dojo.NodeList
},
anim: function( /*Object*/ properties,
/*Integer?*/ duration,
/*Function?*/ easing,
/*Function?*/ onEnd,
/*Integer?*/ delay){
// summary:
// Animate one or more CSS properties for all nodes in this list.
// The returned animation object will already be playing when it
// is returned. See the docs for `dojo.anim` for full details.
// properties: Object
// the properties to animate. does NOT support the `auto` parameter like other
// NodeList-fx methods.
// duration: Integer?
// Optional. The time to run the animations for
// easing: Function?
// Optional. The easing function to use.
// onEnd: Function?
// A function to be called when the animation ends
// delay:
// how long to delay playing the returned animation
// example:
// Another way to fade out:
// | dojo.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);
var canim = dojo.fx.combine(
this.map(function(item){
return dojo.animateProperty({
node: item,
properties: properties,
duration: duration||350,
easing: easing
});
})
);
if(onEnd){
dojo.connect(canim, "onEnd", onEnd);
}
return canim.play(delay||0); // dojo.Animation
}
});
}

@ -5,17 +5,45 @@
*/
if(!dojo._hasResource["dojo.NodeList-html"]){
dojo._hasResource["dojo.NodeList-html"]=true;
if(!dojo._hasResource["dojo.NodeList-html"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.NodeList-html"] = true;
dojo.provide("dojo.NodeList-html");
dojo.require("dojo.html");
dojo.extend(dojo.NodeList,{html:function(_1,_2){
var _3=new dojo.html._ContentSetter(_2||{});
this.forEach(function(_4){
_3.node=_4;
_3.set(_1);
_3.tearDown();
/*=====
dojo["NodeList-html"] = {
// summary: Adds a chainable html method to dojo.query() / Nodelist instances for setting/replacing node content
};
=====*/
dojo.extend(dojo.NodeList, {
html: function(content, /* Object? */params){
// summary:
// see `dojo.html.set()`. Set the content of all elements of this NodeList
//
// description:
// Based around `dojo.html.set()`, set the content of the Elements in a
// NodeList to the given content (string/node/nodelist), with optional arguments
// to further tune the set content behavior.
//
// example:
// | dojo.query(".thingList").html("<li dojoType='dojo.dnd.Moveable'>1</li><li dojoType='dojo.dnd.Moveable'>2</li><li dojoType='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");
var dhs = new dojo.html._ContentSetter(params || {});
this.forEach(function(elm){
dhs.node = elm;
dhs.set(content);
dhs.tearDown();
});
return this; // dojo.NodeList
}
});
return this;
}});
}

@ -5,208 +5,727 @@
*/
if(!dojo._hasResource["dojo.NodeList-manipulate"]){
dojo._hasResource["dojo.NodeList-manipulate"]=true;
if(!dojo._hasResource["dojo.NodeList-manipulate"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.NodeList-manipulate"] = true;
dojo.provide("dojo.NodeList-manipulate");
(function(){
function _1(_2){
var _3="",ch=_2.childNodes;
for(var i=0,n;n=ch[i];i++){
if(n.nodeType!=8){
if(n.nodeType==1){
_3+=_1(n);
}else{
_3+=n.nodeValue;
}
}
}
return _3;
};
function _4(_5){
while(_5.childNodes[0]&&_5.childNodes[0].nodeType==1){
_5=_5.childNodes[0];
}
return _5;
};
function _6(_7,_8){
if(typeof _7=="string"){
_7=dojo._toDom(_7,(_8&&_8.ownerDocument));
if(_7.nodeType==11){
_7=_7.childNodes[0];
}
}else{
if(_7.nodeType==1&&_7.parentNode){
_7=_7.cloneNode(false);
}
}
return _7;
/*=====
dojo["NodeList-manipulate"] = {
// summary: Adds a chainable methods to dojo.query() / Nodelist instances for manipulating HTML
// and DOM nodes and their properties.
};
dojo.extend(dojo.NodeList,{_placeMultiple:function(_9,_a){
var _b=typeof _9=="string"||_9.nodeType?dojo.query(_9):_9;
var _c=[];
for(var i=0;i<_b.length;i++){
var _d=_b[i];
var _e=this.length;
for(var j=_e-1,_f;_f=this[j];j--){
if(i>0){
_f=this._cloneNode(_f);
_c.unshift(_f);
}
if(j==_e-1){
dojo.place(_f,_d,_a);
}else{
_d.parentNode.insertBefore(_f,_d);
}
_d=_f;
}
}
if(_c.length){
_c.unshift(0);
_c.unshift(this.length-1);
Array.prototype.splice.apply(this,_c);
}
return this;
},innerHTML:function(_10){
if(arguments.length){
return this.addContent(_10,"only");
}else{
return this[0].innerHTML;
}
},text:function(_11){
if(arguments.length){
for(var i=0,_12;_12=this[i];i++){
if(_12.nodeType==1){
dojo.empty(_12);
_12.appendChild(_12.ownerDocument.createTextNode(_11));
}
}
return this;
}else{
var _13="";
for(i=0;_12=this[i];i++){
_13+=_1(_12);
}
return _13;
}
},val:function(_14){
if(arguments.length){
var _15=dojo.isArray(_14);
for(var _16=0,_17;_17=this[_16];_16++){
var _18=_17.nodeName.toUpperCase();
var _19=_17.type;
var _1a=_15?_14[_16]:_14;
if(_18=="SELECT"){
var _1b=_17.options;
for(var i=0;i<_1b.length;i++){
var opt=_1b[i];
if(_17.multiple){
opt.selected=(dojo.indexOf(_14,opt.value)!=-1);
}else{
opt.selected=(opt.value==_1a);
}
}
}else{
if(_19=="checkbox"||_19=="radio"){
_17.checked=(_17.value==_1a);
}else{
_17.value=_1a;
}
}
}
return this;
}else{
_17=this[0];
if(!_17||_17.nodeType!=1){
return undefined;
}
_14=_17.value||"";
if(_17.nodeName.toUpperCase()=="SELECT"&&_17.multiple){
_14=[];
_1b=_17.options;
for(i=0;i<_1b.length;i++){
opt=_1b[i];
if(opt.selected){
_14.push(opt.value);
}
}
if(!_14.length){
_14=null;
}
}
return _14;
}
},append:function(_1c){
return this.addContent(_1c,"last");
},appendTo:function(_1d){
return this._placeMultiple(_1d,"last");
},prepend:function(_1e){
return this.addContent(_1e,"first");
},prependTo:function(_1f){
return this._placeMultiple(_1f,"first");
},after:function(_20){
return this.addContent(_20,"after");
},insertAfter:function(_21){
return this._placeMultiple(_21,"after");
},before:function(_22){
return this.addContent(_22,"before");
},insertBefore:function(_23){
return this._placeMultiple(_23,"before");
},remove:dojo.NodeList.prototype.orphan,wrap:function(_24){
if(this[0]){
_24=_6(_24,this[0]);
for(var i=0,_25;_25=this[i];i++){
var _26=this._cloneNode(_24);
if(_25.parentNode){
_25.parentNode.replaceChild(_26,_25);
}
var _27=_4(_26);
_27.appendChild(_25);
}
}
return this;
},wrapAll:function(_28){
if(this[0]){
_28=_6(_28,this[0]);
this[0].parentNode.replaceChild(_28,this[0]);
var _29=_4(_28);
for(var i=0,_2a;_2a=this[i];i++){
_29.appendChild(_2a);
}
}
return this;
},wrapInner:function(_2b){
if(this[0]){
_2b=_6(_2b,this[0]);
for(var i=0;i<this.length;i++){
var _2c=this._cloneNode(_2b);
this._wrap(dojo._toArray(this[i].childNodes),null,this._NodeListCtor).wrapAll(_2c);
}
}
return this;
},replaceWith:function(_2d){
_2d=this._normalize(_2d,this[0]);
for(var i=0,_2e;_2e=this[i];i++){
this._place(_2d,_2e,"before",i>0);
_2e.parentNode.removeChild(_2e);
}
return this;
},replaceAll:function(_2f){
var nl=dojo.query(_2f);
var _30=this._normalize(this,this[0]);
for(var i=0,_31;_31=nl[i];i++){
this._place(_30,_31,"before",i>0);
_31.parentNode.removeChild(_31);
}
return this;
},clone:function(){
var ary=[];
for(var i=0;i<this.length;i++){
ary.push(this._cloneNode(this[i]));
}
return this._wrap(ary,this,this._NodeListCtor);
}});
if(!dojo.NodeList.prototype.html){
dojo.NodeList.prototype.html=dojo.NodeList.prototype.innerHTML;
}
=====*/
//TODO: add a way to parse for widgets in the injected markup?
(function(){
function getText(/*DOMNode*/node){
// summary:
// recursion method for text() to use. Gets text value for a node.
// description:
// Juse uses nodedValue so things like <br/> tags do not end up in
// the text as any sort of line return.
var text = "", ch = node.childNodes;
for(var i = 0, n; n = ch[i]; i++){
//Skip comments.
if(n.nodeType != 8){
if(n.nodeType == 1){
text += getText(n);
}else{
text += n.nodeValue;
}
}
}
return text;
}
function getWrapInsertion(/*DOMNode*/node){
// summary:
// finds the innermost element to use for wrap insertion.
//Make it easy, assume single nesting, no siblings.
while(node.childNodes[0] && node.childNodes[0].nodeType == 1){
node = node.childNodes[0];
}
return node; //DOMNode
}
function makeWrapNode(/*DOMNode||String*/html, /*DOMNode*/refNode){
// summary:
// convert HTML into nodes if it is not already a node.
if(typeof html == "string"){
html = dojo._toDom(html, (refNode && refNode.ownerDocument));
if(html.nodeType == 11){
//DocumentFragment cannot handle cloneNode, so choose first child.
html = html.childNodes[0];
}
}else if(html.nodeType == 1 && html.parentNode){
//This element is already in the DOM clone it, but not its children.
html = html.cloneNode(false);
}
return html; /*DOMNode*/
}
dojo.extend(dojo.NodeList, {
_placeMultiple: function(/*String||Node||NodeList*/query, /*String*/position){
// summary:
// private method for inserting queried nodes into all nodes in this NodeList
// at different positions. Differs from NodeList.place because it will clone
// the nodes in this NodeList if the query matches more than one element.
var nl2 = typeof query == "string" || query.nodeType ? dojo.query(query) : query;
var toAdd = [];
for(var i = 0; i < nl2.length; i++){
//Go backwards in DOM to make dom insertions easier via insertBefore
var refNode = nl2[i];
var length = this.length;
for(var j = length - 1, item; item = this[j]; j--){
if(i > 0){
//Need to clone the item. This also means
//it needs to be added to the current NodeList
//so it can also be the target of other chaining operations.
item = this._cloneNode(item);
toAdd.unshift(item);
}
if(j == length - 1){
dojo.place(item, refNode, position);
}else{
refNode.parentNode.insertBefore(item, refNode);
}
refNode = item;
}
}
if(toAdd.length){
//Add the toAdd items to the current NodeList. Build up list of args
//to pass to splice.
toAdd.unshift(0);
toAdd.unshift(this.length - 1);
Array.prototype.splice.apply(this, toAdd);
}
return this; //dojo.NodeList
},
innerHTML: function(/*String?||DOMNode?|NodeList?*/value){
// summary:
// allows setting the innerHTML of each node in the NodeList,
// if there is a value passed in, otherwise, reads the innerHTML value of the first node.
// description:
// This method is simpler than the dojo.NodeList.html() method provided by
// `dojo.NodeList-html`. This method just does proper innerHTML insertion of HTML fragments,
// and it allows for the innerHTML to be read for the first node in the node list.
// Since dojo.NodeList-html already took the "html" name, this method is called
// "innerHTML". However, if dojo.NodeList-html has not been loaded yet, this
// module will define an "html" method that can be used instead. Be careful if you
// are working in an environment where it is possible that dojo.NodeList-html could
// have been loaded, since its definition of "html" will take precedence.
// The nodes represented by the value argument will be cloned if more than one
// node is in this NodeList. The nodes in this NodeList are returned in the "set"
// usage of this method, not the HTML that was inserted.
// returns:
// if no value is passed, the result is String, the innerHTML of the first node.
// If a value is passed, the return is this dojo.NodeList
// example:
// assume a DOM created by this markup:
// | <div id="foo"></div>
// | <div id="bar"></div>
// This code inserts <p>Hello World</p> into both divs:
// | dojo.query("div").innerHTML("<p>Hello World</p>");
// example:
// assume a DOM created by this markup:
// | <div id="foo"><p>Hello Mars</p></div>
// | <div id="bar"><p>Hello World</p></div>
// This code returns "<p>Hello Mars</p>":
// | var message = dojo.query("div").innerHTML();
if(arguments.length){
return this.addContent(value, "only"); //dojo.NodeList
}else{
return this[0].innerHTML; //String
}
},
/*=====
html: function(value){
// summary:
// see the information for "innerHTML". "html" is an alias for "innerHTML", but is
// only defined if dojo.NodeList-html has not been loaded.
// description:
// An alias for the "innerHTML" method, but only defined if there is not an existing
// "html" method on dojo.NodeList. Be careful if you are working in an environment
// where it is possible that dojo.NodeList-html could have been loaded, since its
// definition of "html" will take precedence. If you are not sure if dojo.NodeList-html
// could be loaded, use the "innerHTML" method.
// value: String?||DOMNode?||NodeList?
// optional. The HTML fragment to use as innerHTML. If value is not passed, then the innerHTML
// of the first element in this NodeList is returned.
// returns:
// if no value is passed, the result is String, the innerHTML of the first node.
// If a value is passed, the return is this dojo.NodeList
return; // dojo.NodeList
return; // String
},
=====*/
text: function(/*String*/value){
// summary:
// allows setting the text value of each node in the NodeList,
// if there is a value passed in, otherwise, returns the text value for all the
// nodes in the NodeList in one string.
// example:
// assume a DOM created by this markup:
// | <div id="foo"></div>
// | <div id="bar"></div>
// This code inserts "Hello World" into both divs:
// | dojo.query("div").text("Hello World");
// example:
// assume a DOM created by this markup:
// | <div id="foo"><p>Hello Mars <span>today</span></p></div>
// | <div id="bar"><p>Hello World</p></div>
// This code returns "Hello Mars today":
// | var message = dojo.query("div").text();
// returns:
// if no value is passed, the result is String, the text value of the first node.
// If a value is passed, the return is this dojo.NodeList
if(arguments.length){
for(var i = 0, node; node = this[i]; i++){
if(node.nodeType == 1){
dojo.empty(node);
node.appendChild(node.ownerDocument.createTextNode(value));
}
}
return this; //dojo.NodeList
}else{
var result = "";
for(i = 0; node = this[i]; i++){
result += getText(node);
}
return result; //String
}
},
val: function(/*String||Array*/value){
// summary:
// If a value is passed, allows seting the value property of form elements in this
// NodeList, or properly selecting/checking the right value for radio/checkbox/select
// elements. If no value is passed, the value of the first node in this NodeList
// is returned.
// returns:
// if no value is passed, the result is String or an Array, for the value of the
// first node.
// If a value is passed, the return is this dojo.NodeList
// example:
// assume a DOM created by this markup:
// | <input type="text" value="foo">
// | <select multiple>
// | <option value="red" selected>Red</option>
// | <option value="blue">Blue</option>
// | <option value="yellow" selected>Yellow</option>
// | </select>
// 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.
//Special work for input elements.
if(arguments.length){
var isArray = dojo.isArray(value);
for(var index = 0, node; node = this[index]; index++){
var name = node.nodeName.toUpperCase();
var type = node.type;
var newValue = isArray ? value[index] : value;
if(name == "SELECT"){
var opts = node.options;
for(var i = 0; i < opts.length; i++){
var opt = opts[i];
if(node.multiple){
opt.selected = (dojo.indexOf(value, opt.value) != -1);
}else{
opt.selected = (opt.value == newValue);
}
}
}else if(type == "checkbox" || type == "radio"){
node.checked = (node.value == newValue);
}else{
node.value = newValue;
}
}
return this; //dojo.NodeList
}else{
//node already declared above.
node = this[0];
if(!node || node.nodeType != 1){
return undefined;
}
value = node.value || "";
if(node.nodeName.toUpperCase() == "SELECT" && node.multiple){
//A multivalued selectbox. Do the pain.
value = [];
//opts declared above in if block.
opts = node.options;
//i declared above in if block;
for(i = 0; i < opts.length; i++){
//opt declared above in if block
opt = opts[i];
if(opt.selected){
value.push(opt.value);
}
}
if(!value.length){
value = null;
}
}
return value; //String||Array
}
},
append: function(/*String||DOMNode||NodeList*/content){
// summary:
// appends the content to every node in the NodeList.
// description:
// The content will be cloned if the length of NodeList
// is greater than 1. Only the DOM nodes are cloned, not
// any attached event handlers.
// returns:
// dojo.NodeList, the nodes currently in this NodeList will be returned,
// not the appended content.
// example:
// assume a DOM created by this markup:
// | <div id="foo"><p>Hello Mars</p></div>
// | <div id="bar"><p>Hello World</p></div>
// Running this code:
// | dojo.query("div").append("<span>append</span>");
// Results in this DOM structure:
// | <div id="foo"><p>Hello Mars</p><span>append</span></div>
// | <div id="bar"><p>Hello World</p><span>append</span></div>
return this.addContent(content, "last"); //dojo.NodeList
},
appendTo: function(/*String*/query){
// summary:
// appends nodes in this NodeList to the nodes matched by
// the query passed to appendTo.
// description:
// The nodes in this NodeList will be cloned if the query
// matches more than one element. Only the DOM nodes are cloned, not
// any attached event handlers.
// returns:
// dojo.NodeList, the nodes currently in this NodeList will be returned,
// not the matched nodes from the query.
// example:
// assume a DOM created by this markup:
// | <span>append</span>
// | <p>Hello Mars</p>
// | <p>Hello World</p>
// Running this code:
// | dojo.query("span").appendTo("p");
// Results in this DOM structure:
// | <p>Hello Mars<span>append</span></p>
// | <p>Hello World<span>append</span></p>
return this._placeMultiple(query, "last"); //dojo.NodeList
},
prepend: function(/*String||DOMNode||NodeList*/content){
// summary:
// prepends the content to every node in the NodeList.
// description:
// The content will be cloned if the length of NodeList
// is greater than 1. Only the DOM nodes are cloned, not
// any attached event handlers.
// returns:
// dojo.NodeList, the nodes currently in this NodeList will be returned,
// not the appended content.
// assume a DOM created by this markup:
// | <div id="foo"><p>Hello Mars</p></div>
// | <div id="bar"><p>Hello World</p></div>
// Running this code:
// | dojo.query("div").prepend("<span>prepend</span>");
// Results in this DOM structure:
// | <div id="foo"><span>prepend</span><p>Hello Mars</p></div>
// | <div id="bar"><span>prepend</span><p>Hello World</p></div>
return this.addContent(content, "first"); //dojo.NodeList
},
prependTo: function(/*String*/query){
// summary:
// prepends nodes in this NodeList to the nodes matched by
// the query passed to prependTo.
// description:
// The nodes in this NodeList will be cloned if the query
// matches more than one element. Only the DOM nodes are cloned, not
// any attached event handlers.
// returns:
// dojo.NodeList, the nodes currently in this NodeList will be returned,
// not the matched nodes from the query.
// example:
// assume a DOM created by this markup:
// | <span>prepend</span>
// | <p>Hello Mars</p>
// | <p>Hello World</p>
// Running this code:
// | dojo.query("span").prependTo("p");
// Results in this DOM structure:
// | <p><span>prepend</span>Hello Mars</p>
// | <p><span>prepend</span>Hello World</p>
return this._placeMultiple(query, "first"); //dojo.NodeList
},
after: function(/*String||Element||NodeList*/content){
// summary:
// Places the content after every node in the NodeList.
// description:
// The content will be cloned if the length of NodeList
// is greater than 1. Only the DOM nodes are cloned, not
// any attached event handlers.
// returns:
// dojo.NodeList, the nodes currently in this NodeList will be returned,
// not the appended content.
// example:
// assume a DOM created by this markup:
// | <div id="foo"><p>Hello Mars</p></div>
// | <div id="bar"><p>Hello World</p></div>
// Running this code:
// | dojo.query("div").after("<span>after</span>");
// Results in this DOM structure:
// | <div id="foo"><p>Hello Mars</p></div><span>after</span>
// | <div id="bar"><p>Hello World</p></div><span>after</span>
return this.addContent(content, "after"); //dojo.NodeList
},
insertAfter: function(/*String*/query){
// summary:
// The nodes in this NodeList will be placed after the nodes
// matched by the query passed to insertAfter.
// description:
// The nodes in this NodeList will be cloned if the query
// matches more than one element. Only the DOM nodes are cloned, not
// any attached event handlers.
// returns:
// dojo.NodeList, the nodes currently in this NodeList will be returned,
// not the matched nodes from the query.
// example:
// assume a DOM created by this markup:
// | <span>after</span>
// | <p>Hello Mars</p>
// | <p>Hello World</p>
// Running this code:
// | dojo.query("span").insertAfter("p");
// Results in this DOM structure:
// | <p>Hello Mars</p><span>after</span>
// | <p>Hello World</p><span>after</span>
return this._placeMultiple(query, "after"); //dojo.NodeList
},
before: function(/*String||DOMNode||NodeList*/content){
// summary:
// Places the content before every node in the NodeList.
// description:
// The content will be cloned if the length of NodeList
// is greater than 1. Only the DOM nodes are cloned, not
// any attached event handlers.
// returns:
// dojo.NodeList, the nodes currently in this NodeList will be returned,
// not the appended content.
// example:
// assume a DOM created by this markup:
// | <div id="foo"><p>Hello Mars</p></div>
// | <div id="bar"><p>Hello World</p></div>
// Running this code:
// | dojo.query("div").before("<span>before</span>");
// Results in this DOM structure:
// | <span>before</span><div id="foo"><p>Hello Mars</p></div>
// | <span>before</span><div id="bar"><p>Hello World</p></div>
return this.addContent(content, "before"); //dojo.NodeList
},
insertBefore: function(/*String*/query){
// summary:
// The nodes in this NodeList will be placed after the nodes
// matched by the query passed to insertAfter.
// description:
// The nodes in this NodeList will be cloned if the query
// matches more than one element. Only the DOM nodes are cloned, not
// any attached event handlers.
// returns:
// dojo.NodeList, the nodes currently in this NodeList will be returned,
// not the matched nodes from the query.
// example:
// assume a DOM created by this markup:
// | <span>before</span>
// | <p>Hello Mars</p>
// | <p>Hello World</p>
// Running this code:
// | dojo.query("span").insertBefore("p");
// Results in this DOM structure:
// | <span>before</span><p>Hello Mars</p>
// | <span>before</span><p>Hello World</p>
return this._placeMultiple(query, "before"); //dojo.NodeList
},
/*=====
remove: function(simpleFilter){
// summary:
// alias for dojo.NodeList's orphan method. Removes elements
// in this list that match the simple filter from their parents
// and returns them as a new NodeList.
// simpleFilter: String
// single-expression CSS rule. For example, ".thinger" or
// "#someId[attrName='value']" but not "div > span". In short,
// anything which does not invoke a descent to evaluate but
// can instead be used to test a single node is acceptable.
// returns:
// dojo.NodeList
return; // dojo.NodeList
},
=====*/
remove: dojo.NodeList.prototype.orphan,
wrap: function(/*String||DOMNode*/html){
// summary:
// Wrap each node in the NodeList with html passed to wrap.
// description:
// html will be cloned if the NodeList has more than one
// element. Only DOM nodes are cloned, not any attached
// event handlers.
// returns:
// dojo.NodeList, the nodes in the current NodeList will be returned,
// not the nodes from html argument.
// example:
// assume a DOM created by this markup:
// | <b>one</b>
// | <b>two</b>
// Running this code:
// | dojo.query("b").wrap("<div><span></span></div>");
// Results in this DOM structure:
// | <div><span><b>one</b></span></div>
// | <div><span><b>two</b></span></div>
if(this[0]){
html = makeWrapNode(html, this[0]);
//Now cycle through the elements and do the insertion.
for(var i = 0, node; node = this[i]; i++){
//Always clone because if html is used to hold one of
//the "this" nodes, then on the clone of html it will contain
//that "this" node, and that would be bad.
var clone = this._cloneNode(html);
if(node.parentNode){
node.parentNode.replaceChild(clone, node);
}
//Find deepest element and insert old node in it.
var insertion = getWrapInsertion(clone);
insertion.appendChild(node);
}
}
return this; //dojo.NodeList
},
wrapAll: function(/*String||DOMNode*/html){
// summary:
// Insert html where the first node in this NodeList lives, then place all
// nodes in this NodeList as the child of the html.
// returns:
// dojo.NodeList, the nodes in the current NodeList will be returned,
// not the nodes from html argument.
// example:
// assume a DOM created by this markup:
// | <div class="container">
// | <div class="red">Red One</div>
// | <div class="blue">Blue One</div>
// | <div class="red">Red Two</div>
// | <div class="blue">Blue Two</div>
// | </div>
// Running this code:
// | dojo.query(".red").wrapAll('<div class="allRed"></div>');
// Results in this DOM structure:
// | <div class="container">
// | <div class="allRed">
// | <div class="red">Red One</div>
// | <div class="red">Red Two</div>
// | </div>
// | <div class="blue">Blue One</div>
// | <div class="blue">Blue Two</div>
// | </div>
if(this[0]){
html = makeWrapNode(html, this[0]);
//Place the wrap HTML in place of the first node.
this[0].parentNode.replaceChild(html, this[0]);
//Now cycle through the elements and move them inside
//the wrap.
var insertion = getWrapInsertion(html);
for(var i = 0, node; node = this[i]; i++){
insertion.appendChild(node);
}
}
return this; //dojo.NodeList
},
wrapInner: function(/*String||DOMNode*/html){
// summary:
// For each node in the NodeList, wrap all its children with the passed in html.
// description:
// html will be cloned if the NodeList has more than one
// element. Only DOM nodes are cloned, not any attached
// event handlers.
// returns:
// dojo.NodeList, the nodes in the current NodeList will be returned,
// not the nodes from html argument.
// example:
// assume a DOM created by this markup:
// | <div class="container">
// | <div class="red">Red One</div>
// | <div class="blue">Blue One</div>
// | <div class="red">Red Two</div>
// | <div class="blue">Blue Two</div>
// | </div>
// Running this code:
// | dojo.query(".red").wrapInner('<span class="special"></span>');
// Results in this DOM structure:
// | <div class="container">
// | <div class="red"><span class="special">Red One</span></div>
// | <div class="blue">Blue One</div>
// | <div class="red"><span class="special">Red Two</span></div>
// | <div class="blue">Blue Two</div>
// | </div>
if(this[0]){
html = makeWrapNode(html, this[0]);
for(var i = 0; i < this.length; i++){
//Always clone because if html is used to hold one of
//the "this" nodes, then on the clone of html it will contain
//that "this" node, and that would be bad.
var clone = this._cloneNode(html);
//Need to convert the childNodes to an array since wrapAll modifies the
//DOM and can change the live childNodes NodeList.
this._wrap(dojo._toArray(this[i].childNodes), null, this._NodeListCtor).wrapAll(clone);
}
}
return this; //dojo.NodeList
},
replaceWith: function(/*String||DOMNode||NodeList*/content){
// summary:
// Replaces each node in ths NodeList with the content passed to replaceWith.
// description:
// The content will be cloned if the length of NodeList
// is greater than 1. Only the DOM nodes are cloned, not
// any attached event handlers.
// returns:
// The nodes currently in this NodeList will be returned, not the replacing content.
// Note that the returned nodes have been removed from the DOM.
// example:
// assume a DOM created by this markup:
// | <div class="container">
// | <div class="red">Red One</div>
// | <div class="blue">Blue One</div>
// | <div class="red">Red Two</div>
// | <div class="blue">Blue Two</div>
// | </div>
// Running this code:
// | dojo.query(".red").replaceWith('<div class="green">Green</div>');
// Results in this DOM structure:
// | <div class="container">
// | <div class="green">Green</div>
// | <div class="blue">Blue One</div>
// | <div class="green">Green</div>
// | <div class="blue">Blue Two</div>
// | </div>
content = this._normalize(content, this[0]);
for(var i = 0, node; node = this[i]; i++){
this._place(content, node, "before", i > 0);
node.parentNode.removeChild(node);
}
return this; //dojo.NodeList
},
replaceAll: function(/*String*/query){
// summary:
// replaces nodes matched by the query passed to replaceAll with the nodes
// in this NodeList.
// description:
// The nodes in this NodeList will be cloned if the query
// matches more than one element. Only the DOM nodes are cloned, not
// any attached event handlers.
// returns:
// The nodes currently in this NodeList will be returned, not the matched nodes
// from the query. The nodes currently in this NodeLIst could have
// been cloned, so the returned NodeList will include the cloned nodes.
// example:
// assume a DOM created by this markup:
// | <div class="container">
// | <div class="spacer">___</div>
// | <div class="red">Red One</div>
// | <div class="spacer">___</div>
// | <div class="blue">Blue One</div>
// | <div class="spacer">___</div>
// | <div class="red">Red Two</div>
// | <div class="spacer">___</div>
// | <div class="blue">Blue Two</div>
// | </div>
// Running this code:
// | dojo.query(".red").replaceAll(".blue");
// Results in this DOM structure:
// | <div class="container">
// | <div class="spacer">___</div>
// | <div class="spacer">___</div>
// | <div class="red">Red One</div>
// | <div class="red">Red Two</div>
// | <div class="spacer">___</div>
// | <div class="spacer">___</div>
// | <div class="red">Red One</div>
// | <div class="red">Red Two</div>
// | </div>
var nl = dojo.query(query);
var content = this._normalize(this, this[0]);
for(var i = 0, node; node = nl[i]; i++){
this._place(content, node, "before", i > 0);
node.parentNode.removeChild(node);
}
return this; //dojo.NodeList
},
clone: function(){
// summary:
// Clones all the nodes in this NodeList and returns them as a new NodeList.
// description:
// Only the DOM nodes are cloned, not any attached event handlers.
// returns:
// dojo.NodeList, a cloned set of the original nodes.
// example:
// assume a DOM created by this markup:
// | <div class="container">
// | <div class="red">Red One</div>
// | <div class="blue">Blue One</div>
// | <div class="red">Red Two</div>
// | <div class="blue">Blue Two</div>
// | </div>
// Running this code:
// | dojo.query(".red").clone().appendTo(".container");
// Results in this DOM structure:
// | <div class="container">
// | <div class="red">Red One</div>
// | <div class="blue">Blue One</div>
// | <div class="red">Red Two</div>
// | <div class="blue">Blue Two</div>
// | <div class="red">Red One</div>
// | <div class="red">Red Two</div>
// | </div>
//TODO: need option to clone events?
var ary = [];
for(var i = 0; i < this.length; i++){
ary.push(this._cloneNode(this[i]));
}
return this._wrap(ary, this, this._NodeListCtor); //dojo.NodeList
}
});
//set up html method if one does not exist
if(!dojo.NodeList.prototype.html){
dojo.NodeList.prototype.html = dojo.NodeList.prototype.innerHTML;
}
})();
}

@ -5,127 +5,513 @@
*/
if(!dojo._hasResource["dojo.NodeList-traverse"]){
dojo._hasResource["dojo.NodeList-traverse"]=true;
if(!dojo._hasResource["dojo.NodeList-traverse"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.NodeList-traverse"] = true;
dojo.provide("dojo.NodeList-traverse");
dojo.extend(dojo.NodeList,{_buildArrayFromCallback:function(_1){
var _2=[];
for(var i=0;i<this.length;i++){
var _3=_1.call(this[i],this[i],_2);
if(_3){
_2=_2.concat(_3);
}
}
return _2;
},_filterQueryResult:function(_4,_5){
var _6=dojo.filter(_4,function(_7){
return dojo.query(_5,_7.parentNode).indexOf(_7)!=-1;
});
var _8=this._wrap(_6);
return _8;
},_getUniqueAsNodeList:function(_9){
var _a=[];
for(var i=0,_b;_b=_9[i];i++){
if(_b.nodeType==1&&dojo.indexOf(_a,_b)==-1){
_a.push(_b);
}
}
return this._wrap(_a,null,this._NodeListCtor);
},_getUniqueNodeListWithParent:function(_c,_d){
var _e=this._getUniqueAsNodeList(_c);
_e=(_d?this._filterQueryResult(_e,_d):_e);
return _e._stash(this);
},_getRelatedUniqueNodes:function(_f,_10){
return this._getUniqueNodeListWithParent(this._buildArrayFromCallback(_10),_f);
},children:function(_11){
return this._getRelatedUniqueNodes(_11,function(_12,ary){
return dojo._toArray(_12.childNodes);
});
},closest:function(_13){
var _14=this;
return this._getRelatedUniqueNodes(_13,function(_15,ary){
do{
if(_14._filterQueryResult([_15],_13).length){
return _15;
}
}while((_15=_15.parentNode)&&_15.nodeType==1);
return null;
});
},parent:function(_16){
return this._getRelatedUniqueNodes(_16,function(_17,ary){
return _17.parentNode;
});
},parents:function(_18){
return this._getRelatedUniqueNodes(_18,function(_19,ary){
var _1a=[];
while(_19.parentNode){
_19=_19.parentNode;
_1a.push(_19);
}
return _1a;
});
},siblings:function(_1b){
return this._getRelatedUniqueNodes(_1b,function(_1c,ary){
var _1d=[];
var _1e=(_1c.parentNode&&_1c.parentNode.childNodes);
for(var i=0;i<_1e.length;i++){
if(_1e[i]!=_1c){
_1d.push(_1e[i]);
}
}
return _1d;
});
},next:function(_1f){
return this._getRelatedUniqueNodes(_1f,function(_20,ary){
var _21=_20.nextSibling;
while(_21&&_21.nodeType!=1){
_21=_21.nextSibling;
}
return _21;
});
},nextAll:function(_22){
return this._getRelatedUniqueNodes(_22,function(_23,ary){
var _24=[];
var _25=_23;
while((_25=_25.nextSibling)){
if(_25.nodeType==1){
_24.push(_25);
}
}
return _24;
});
},prev:function(_26){
return this._getRelatedUniqueNodes(_26,function(_27,ary){
var _28=_27.previousSibling;
while(_28&&_28.nodeType!=1){
_28=_28.previousSibling;
}
return _28;
});
},prevAll:function(_29){
return this._getRelatedUniqueNodes(_29,function(_2a,ary){
var _2b=[];
var _2c=_2a;
while((_2c=_2c.previousSibling)){
if(_2c.nodeType==1){
_2b.push(_2c);
}
}
return _2b;
});
},andSelf:function(){
return this.concat(this._parent);
},first:function(){
return this._wrap(((this[0]&&[this[0]])||[]),this);
},last:function(){
return this._wrap((this.length?[this[this.length-1]]:[]),this);
},even:function(){
return this.filter(function(_2d,i){
return i%2!=0;
});
},odd:function(){
return this.filter(function(_2e,i){
return i%2==0;
/*=====
dojo["NodeList-traverse"] = {
// summary: Adds a chainable methods to dojo.query() / Nodelist instances for traversing the DOM
};
=====*/
dojo.extend(dojo.NodeList, {
_buildArrayFromCallback: function(/*Function*/callback){
// summary:
// builds a new array of possibly differing size based on the input list.
// Since the returned array is likely of different size than the input array,
// the array's map function cannot be used.
var ary = [];
for(var i = 0; i < this.length; i++){
var items = callback.call(this[i], this[i], ary);
if(items){
ary = ary.concat(items);
}
}
return ary;
},
_filterQueryResult: function(nodeList, query){
// summmary:
// Replacement for dojo._filterQueryResult that does a full
// query. Slower, but allows for more types of queries.
var filter = dojo.filter(nodeList, function(node){
return dojo.query(query, node.parentNode).indexOf(node) != -1;
});
var result = this._wrap(filter);
return result;
},
_getUniqueAsNodeList: function(nodes){
// summary:
// given a list of nodes, make sure only unique
// elements are returned as our NodeList object.
// Does not call _stash().
var ary = [];
//Using for loop for better speed.
for(var i = 0, node; node = nodes[i]; i++){
//Should be a faster way to do this. dojo.query has a private
//_zip function that may be inspirational, but there are pathways
//in query that force nozip?
if(node.nodeType == 1 && dojo.indexOf(ary, node) == -1){
ary.push(node);
}
}
return this._wrap(ary, null, this._NodeListCtor); //dojo.NodeList
},
_getUniqueNodeListWithParent: function(nodes, query){
// summary:
// gets unique element nodes, filters them further
// with an optional query and then calls _stash to track parent NodeList.
var ary = this._getUniqueAsNodeList(nodes);
ary = (query ? this._filterQueryResult(ary, query) : ary);
return ary._stash(this); //dojo.NodeList
},
_getRelatedUniqueNodes: function(/*String?*/query, /*Function*/callback){
// summary:
// cycles over all the nodes and calls a callback
// to collect nodes for a possible inclusion in a result.
// The callback will get two args: callback(node, ary),
// where ary is the array being used to collect the nodes.
return this._getUniqueNodeListWithParent(this._buildArrayFromCallback(callback), query); //dojo.NodeList
},
children: function(/*String?*/query){
// summary:
// Returns all immediate child elements for nodes in this dojo.NodeList.
// Optionally takes a query to filter the child elements.
// description:
// .end() can be used on the returned dojo.NodeList to get back to the
// original dojo.NodeList.
// query:
// a CSS selector.
// returns:
// dojo.NodeList, all immediate child elements for the nodes in this dojo.NodeList.
// example:
// assume a DOM created by this markup:
// | <div class="container">
// | <div class="red">Red One</div>
// | Some Text
// | <div class="blue">Blue One</div>
// | <div class="red">Red Two</div>
// | <div class="blue">Blue Two</div>
// | </div>
// Running this code:
// | dojo.query(".container").children();
// returns the four divs that are children of the container div.
// Running this code:
// | dojo.query(".container").children(".red");
// returns the two divs that have the class "red".
return this._getRelatedUniqueNodes(query, function(node, ary){
return dojo._toArray(node.childNodes);
}); //dojo.NodeList
},
closest: function(/*String*/query){
// summary:
// Returns closest parent that matches query, including current node in this
// dojo.NodeList if it matches the query.
// description:
// .end() can be used on the returned dojo.NodeList to get back to the
// original dojo.NodeList.
// query:
// a CSS selector.
// returns:
// dojo.NodeList, the closest parent that matches the query, including the current
// node in this dojo.NodeList if it matches the query.
// example:
// assume a DOM created by this markup:
// | <div class="container">
// | <div class="red">Red One</div>
// | Some Text
// | <div class="blue">Blue One</div>
// | <div class="red">Red Two</div>
// | <div class="blue">Blue Two</div>
// | </div>
// Running this code:
// | dojo.query(".red").closest(".container");
// returns the div with class "container".
var self = this;
return this._getRelatedUniqueNodes(query, function(node, ary){
do{
if(self._filterQueryResult([node], query).length){
return node;
}
}while((node = node.parentNode) && node.nodeType == 1);
return null; //To make rhino strict checking happy.
}); //dojo.NodeList
},
parent: function(/*String?*/query){
// summary:
// Returns immediate parent elements for nodes in this dojo.NodeList.
// Optionally takes a query to filter the parent elements.
// description:
// .end() can be used on the returned dojo.NodeList to get back to the
// original dojo.NodeList.
// query:
// a CSS selector.
// returns:
// dojo.NodeList, immediate parent elements for nodes in this dojo.NodeList.
// example:
// assume a DOM created by this markup:
// | <div class="container">
// | <div class="red">Red One</div>
// | <div class="blue first"><span class="text">Blue One</span></div>
// | <div class="red">Red Two</div>
// | <div class="blue"><span class="text">Blue Two</span></div>
// | </div>
// Running this code:
// | dojo.query(".text").parent();
// returns the two divs with class "blue".
// Running this code:
// | dojo.query(".text").parent(".first");
// returns the one div with class "blue" and "first".
return this._getRelatedUniqueNodes(query, function(node, ary){
return node.parentNode;
}); //dojo.NodeList
},
parents: function(/*String?*/query){
// summary:
// Returns all parent elements for nodes in this dojo.NodeList.
// Optionally takes a query to filter the child elements.
// description:
// .end() can be used on the returned dojo.NodeList to get back to the
// original dojo.NodeList.
// query:
// a CSS selector.
// returns:
// dojo.NodeList, all parent elements for nodes in this dojo.NodeList.
// example:
// assume a DOM created by this markup:
// | <div class="container">
// | <div class="red">Red One</div>
// | <div class="blue first"><span class="text">Blue One</span></div>
// | <div class="red">Red Two</div>
// | <div class="blue"><span class="text">Blue Two</span></div>
// | </div>
// Running this code:
// | dojo.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");
// returns the one div with class "container".
return this._getRelatedUniqueNodes(query, function(node, ary){
var pary = []
while(node.parentNode){
node = node.parentNode;
pary.push(node);
}
return pary;
}); //dojo.NodeList
},
siblings: function(/*String?*/query){
// summary:
// Returns all sibling elements for nodes in this dojo.NodeList.
// Optionally takes a query to filter the sibling elements.
// description:
// .end() can be used on the returned dojo.NodeList to get back to the
// original dojo.NodeList.
// query:
// a CSS selector.
// returns:
// dojo.NodeList, all sibling elements for nodes in this dojo.NodeList.
// example:
// assume a DOM created by this markup:
// | <div class="container">
// | <div class="red">Red One</div>
// | Some Text
// | <div class="blue first">Blue One</div>
// | <div class="red">Red Two</div>
// | <div class="blue">Blue Two</div>
// | </div>
// Running this code:
// | dojo.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");
// returns the two div with class "red".
return this._getRelatedUniqueNodes(query, function(node, ary){
var pary = []
var nodes = (node.parentNode && node.parentNode.childNodes);
for(var i = 0; i < nodes.length; i++){
if(nodes[i] != node){
pary.push(nodes[i]);
}
}
return pary;
}); //dojo.NodeList
},
next: function(/*String?*/query){
// summary:
// Returns the next element for nodes in this dojo.NodeList.
// Optionally takes a query to filter the next elements.
// description:
// .end() can be used on the returned dojo.NodeList to get back to the
// original dojo.NodeList.
// query:
// a CSS selector.
// returns:
// dojo.NodeList, the next element for nodes in this dojo.NodeList.
// example:
// assume a DOM created by this markup:
// | <div class="container">
// | <div class="red">Red One</div>
// | Some Text
// | <div class="blue first">Blue One</div>
// | <div class="red">Red Two</div>
// | <div class="blue last">Blue Two</div>
// | </div>
// Running this code:
// | dojo.query(".first").next();
// returns the div with class "red" and has innerHTML of "Red Two".
// Running this code:
// | dojo.query(".last").next(".red");
// does not return any elements.
return this._getRelatedUniqueNodes(query, function(node, ary){
var next = node.nextSibling;
while(next && next.nodeType != 1){
next = next.nextSibling;
}
return next;
}); //dojo.NodeList
},
nextAll: function(/*String?*/query){
// summary:
// Returns all sibling elements that come after the nodes in this dojo.NodeList.
// Optionally takes a query to filter the sibling elements.
// description:
// .end() can be used on the returned dojo.NodeList to get back to the
// original dojo.NodeList.
// query:
// a CSS selector.
// returns:
// dojo.NodeList, all sibling elements that come after the nodes in this dojo.NodeList.
// example:
// assume a DOM created by this markup:
// | <div class="container">
// | <div class="red">Red One</div>
// | Some Text
// | <div class="blue first">Blue One</div>
// | <div class="red next">Red Two</div>
// | <div class="blue next">Blue Two</div>
// | </div>
// Running this code:
// | dojo.query(".first").nextAll();
// returns the two divs with class of "next".
// Running this code:
// | dojo.query(".first").nextAll(".red");
// returns the one div with class "red" and innerHTML "Red Two".
return this._getRelatedUniqueNodes(query, function(node, ary){
var pary = []
var next = node;
while((next = next.nextSibling)){
if(next.nodeType == 1){
pary.push(next);
}
}
return pary;
}); //dojo.NodeList
},
prev: function(/*String?*/query){
// summary:
// Returns the previous element for nodes in this dojo.NodeList.
// Optionally takes a query to filter the previous elements.
// description:
// .end() can be used on the returned dojo.NodeList to get back to the
// original dojo.NodeList.
// query:
// a CSS selector.
// returns:
// dojo.NodeList, the previous element for nodes in this dojo.NodeList.
// example:
// assume a DOM created by this markup:
// | <div class="container">
// | <div class="red">Red One</div>
// | Some Text
// | <div class="blue first">Blue One</div>
// | <div class="red">Red Two</div>
// | <div class="blue">Blue Two</div>
// | </div>
// Running this code:
// | dojo.query(".first").prev();
// returns the div with class "red" and has innerHTML of "Red One".
// Running this code:
// | dojo.query(".first").prev(".blue");
// does not return any elements.
return this._getRelatedUniqueNodes(query, function(node, ary){
var prev = node.previousSibling;
while(prev && prev.nodeType != 1){
prev = prev.previousSibling;
}
return prev;
}); //dojo.NodeList
},
prevAll: function(/*String?*/query){
// summary:
// Returns all sibling elements that come before the nodes in this dojo.NodeList.
// Optionally takes a query to filter the sibling elements.
// description:
// The returned nodes will be in reverse DOM order -- the first node in the list will
// be the node closest to the original node/NodeList.
// .end() can be used on the returned dojo.NodeList to get back to the
// original dojo.NodeList.
// query:
// a CSS selector.
// returns:
// dojo.NodeList, all sibling elements that come before the nodes in this dojo.NodeList.
// example:
// assume a DOM created by this markup:
// | <div class="container">
// | <div class="red prev">Red One</div>
// | Some Text
// | <div class="blue prev">Blue One</div>
// | <div class="red second">Red Two</div>
// | <div class="blue">Blue Two</div>
// | </div>
// Running this code:
// | dojo.query(".second").prevAll();
// returns the two divs with class of "prev".
// Running this code:
// | dojo.query(".first").prevAll(".red");
// returns the one div with class "red prev" and innerHTML "Red One".
return this._getRelatedUniqueNodes(query, function(node, ary){
var pary = []
var prev = node;
while((prev = prev.previousSibling)){
if(prev.nodeType == 1){
pary.push(prev);
}
}
return pary;
}); //dojo.NodeList
},
andSelf: function(){
// summary:
// Adds the nodes from the previous dojo.NodeList to the current dojo.NodeList.
// description:
// .end() can be used on the returned dojo.NodeList to get back to the
// original dojo.NodeList.
// returns:
// dojo.NodeList
// example:
// assume a DOM created by this markup:
// | <div class="container">
// | <div class="red prev">Red One</div>
// | Some Text
// | <div class="blue prev">Blue One</div>
// | <div class="red second">Red Two</div>
// | <div class="blue">Blue Two</div>
// | </div>
// Running this code:
// | dojo.query(".second").prevAll().andSelf();
// returns the two divs with class of "prev", as well as the div with class "second".
return this.concat(this._parent);
},
//Alternate methods for the :first/:last/:even/:odd pseudos.
first: function(){
// summary:
// Returns the first node in this dojo.NodeList as a dojo.NodeList.
// description:
// .end() can be used on the returned dojo.NodeList to get back to the
// original dojo.NodeList.
// returns:
// dojo.NodeList, with the first node in this dojo.NodeList
// example:
// assume a DOM created by this markup:
// | <div class="container">
// | <div class="red">Red One</div>
// | <div class="blue first">Blue One</div>
// | <div class="red">Red Two</div>
// | <div class="blue last">Blue Two</div>
// | </div>
// Running this code:
// | dojo.query(".blue").first();
// returns the div with class "blue" and "first".
return this._wrap(((this[0] && [this[0]]) || []), this); //dojo.NodeList
},
last: function(){
// summary:
// Returns the last node in this dojo.NodeList as a dojo.NodeList.
// description:
// .end() can be used on the returned dojo.NodeList to get back to the
// original dojo.NodeList.
// returns:
// dojo.NodeList, with the last node in this dojo.NodeList
// example:
// assume a DOM created by this markup:
// | <div class="container">
// | <div class="red">Red One</div>
// | <div class="blue first">Blue One</div>
// | <div class="red">Red Two</div>
// | <div class="blue last">Blue Two</div>
// | </div>
// Running this code:
// | dojo.query(".blue").last();
// returns the last div with class "blue",
return this._wrap((this.length ? [this[this.length - 1]] : []), this); //dojo.NodeList
},
even: function(){
// summary:
// Returns the even nodes in this dojo.NodeList as a dojo.NodeList.
// description:
// .end() can be used on the returned dojo.NodeList to get back to the
// original dojo.NodeList.
// returns:
// dojo.NodeList, with the even nodes in this dojo.NodeList
// example:
// assume a DOM created by this markup:
// | <div class="container">
// | <div class="interior red">Red One</div>
// | <div class="interior blue">Blue One</div>
// | <div class="interior red">Red Two</div>
// | <div class="interior blue">Blue Two</div>
// | </div>
// Running this code:
// | dojo.query(".interior").even();
// returns the two divs with class "blue"
return this.filter(function(item, i){
return i % 2 != 0;
}); //dojo.NodeList
},
odd: function(){
// summary:
// Returns the odd nodes in this dojo.NodeList as a dojo.NodeList.
// description:
// .end() can be used on the returned dojo.NodeList to get back to the
// original dojo.NodeList.
// returns:
// dojo.NodeList, with the odd nodes in this dojo.NodeList
// example:
// assume a DOM created by this markup:
// | <div class="container">
// | <div class="interior red">Red One</div>
// | <div class="interior blue">Blue One</div>
// | <div class="interior red">Red Two</div>
// | <div class="interior blue">Blue Two</div>
// | </div>
// Running this code:
// | dojo.query(".interior").odd();
// returns the two divs with class "red"
return this.filter(function(item, i){
return i % 2 == 0;
}); //dojo.NodeList
}
});
}});
}

@ -5,151 +5,197 @@
*/
/*******************************************************************************
* OpenAjax.js
*
* Reference implementation of the OpenAjax Hub, as specified by OpenAjax Alliance.
* Specification is under development at:
*
* http://www.openajax.org/member/wiki/OpenAjax_Hub_Specification
*
* Copyright 2006-2007 OpenAjax Alliance
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless
* required by applicable law or agreed to in writing, software distributed
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
******************************************************************************/
// prevent re-definition of the OpenAjax object
if(!window["OpenAjax"]){
OpenAjax=new function(){
var t=true;
var f=false;
var g=window;
var _1;
var _2="org.openajax.hub.";
var h={};
this.hub=h;
h.implementer="http://openajax.org";
h.implVersion="0.6";
h.specVersion="0.6";
h.implExtraData={};
var _1={};
h.libraries=_1;
h.registerLibrary=function(_3,_4,_5,_6){
_1[_3]={prefix:_3,namespaceURI:_4,version:_5,extraData:_6};
this.publish(_2+"registerLibrary",_1[_3]);
};
h.unregisterLibrary=function(_7){
this.publish(_2+"unregisterLibrary",_1[_7]);
delete _1[_7];
};
h._subscriptions={c:{},s:[]};
h._cleanup=[];
h._subIndex=0;
h._pubDepth=0;
h.subscribe=function(_8,_9,_a,_b,_c){
if(!_a){
_a=window;
}
var _d=_8+"."+this._subIndex;
var _e={scope:_a,cb:_9,fcb:_c,data:_b,sid:this._subIndex++,hdl:_d};
var _f=_8.split(".");
this._subscribe(this._subscriptions,_f,0,_e);
return _d;
};
h.publish=function(_10,_11){
var _12=_10.split(".");
this._pubDepth++;
this._publish(this._subscriptions,_12,0,_10,_11);
this._pubDepth--;
if((this._cleanup.length>0)&&(this._pubDepth==0)){
for(var i=0;i<this._cleanup.length;i++){
this.unsubscribe(this._cleanup[i].hdl);
}
delete (this._cleanup);
this._cleanup=[];
}
};
h.unsubscribe=function(sub){
var _13=sub.split(".");
var sid=_13.pop();
this._unsubscribe(this._subscriptions,_13,0,sid);
};
h._subscribe=function(_14,_15,_16,sub){
var _17=_15[_16];
if(_16==_15.length){
_14.s.push(sub);
}else{
if(typeof _14.c=="undefined"){
_14.c={};
}
if(typeof _14.c[_17]=="undefined"){
_14.c[_17]={c:{},s:[]};
this._subscribe(_14.c[_17],_15,_16+1,sub);
}else{
this._subscribe(_14.c[_17],_15,_16+1,sub);
}
}
};
h._publish=function(_18,_19,_1a,_1b,msg){
if(typeof _18!="undefined"){
var _1c;
if(_1a==_19.length){
_1c=_18;
}else{
this._publish(_18.c[_19[_1a]],_19,_1a+1,_1b,msg);
this._publish(_18.c["*"],_19,_1a+1,_1b,msg);
_1c=_18.c["**"];
}
if(typeof _1c!="undefined"){
var _1d=_1c.s;
var max=_1d.length;
for(var i=0;i<max;i++){
if(_1d[i].cb){
var sc=_1d[i].scope;
var cb=_1d[i].cb;
var fcb=_1d[i].fcb;
var d=_1d[i].data;
if(typeof cb=="string"){
cb=sc[cb];
}
if(typeof fcb=="string"){
fcb=sc[fcb];
}
if((!fcb)||(fcb.call(sc,_1b,msg,d))){
cb.call(sc,_1b,msg,d);
}
}
}
}
}
};
h._unsubscribe=function(_1e,_1f,_20,sid){
if(typeof _1e!="undefined"){
if(_20<_1f.length){
var _21=_1e.c[_1f[_20]];
this._unsubscribe(_21,_1f,_20+1,sid);
if(_21.s.length==0){
for(var x in _21.c){
return;
}
delete _1e.c[_1f[_20]];
}
return;
}else{
var _22=_1e.s;
var max=_22.length;
for(var i=0;i<max;i++){
if(sid==_22[i].sid){
if(this._pubDepth>0){
_22[i].cb=null;
this._cleanup.push(_22[i]);
}else{
_22.splice(i,1);
}
return;
}
}
}
}
};
h.reinit=function(){
for(var lib in OpenAjax.hub.libraries){
delete OpenAjax.hub.libraries[lib];
}
OpenAjax.hub.registerLibrary("OpenAjax","http://openajax.org/hub","0.6",{});
delete OpenAjax._subscriptions;
OpenAjax._subscriptions={c:{},s:[]};
delete OpenAjax._cleanup;
OpenAjax._cleanup=[];
OpenAjax._subIndex=0;
OpenAjax._pubDepth=0;
};
};
OpenAjax.hub.registerLibrary("OpenAjax","http://openajax.org/hub","0.6",{});
OpenAjax = new function(){
// summary: the OpenAjax hub
// description: see http://www.openajax.org/member/wiki/OpenAjax_Hub_Specification
var t = true;
var f = false;
var g = window;
var libs;
var ooh = "org.openajax.hub.";
var h = {};
this.hub = h;
h.implementer = "http://openajax.org";
h.implVersion = "0.6";
h.specVersion = "0.6";
h.implExtraData = {};
var libs = {};
h.libraries = libs;
h.registerLibrary = function(prefix, nsURL, version, extra){
libs[prefix] = {
prefix: prefix,
namespaceURI: nsURL,
version: version,
extraData: extra
};
this.publish(ooh+"registerLibrary", libs[prefix]);
}
h.unregisterLibrary = function(prefix){
this.publish(ooh+"unregisterLibrary", libs[prefix]);
delete libs[prefix];
}
h._subscriptions = { c:{}, s:[] };
h._cleanup = [];
h._subIndex = 0;
h._pubDepth = 0;
h.subscribe = function(name, callback, scope, subscriberData, filter){
if(!scope){
scope = window;
}
var handle = name + "." + this._subIndex;
var sub = { scope: scope, cb: callback, fcb: filter, data: subscriberData, sid: this._subIndex++, hdl: handle };
var path = name.split(".");
this._subscribe(this._subscriptions, path, 0, sub);
return handle;
}
h.publish = function(name, message){
var path = name.split(".");
this._pubDepth++;
this._publish(this._subscriptions, path, 0, name, message);
this._pubDepth--;
if((this._cleanup.length > 0) && (this._pubDepth == 0)){
for(var i = 0; i < this._cleanup.length; i++){
this.unsubscribe(this._cleanup[i].hdl);
}
delete(this._cleanup);
this._cleanup = [];
}
}
h.unsubscribe = function(sub){
var path = sub.split(".");
var sid = path.pop();
this._unsubscribe(this._subscriptions, path, 0, sid);
}
h._subscribe = function(tree, path, index, sub){
var token = path[index];
if(index == path.length){
tree.s.push(sub);
}else{
if(typeof tree.c == "undefined"){
tree.c = {};
}
if(typeof tree.c[token] == "undefined"){
tree.c[token] = { c: {}, s: [] };
this._subscribe(tree.c[token], path, index + 1, sub);
}else{
this._subscribe( tree.c[token], path, index + 1, sub);
}
}
}
h._publish = function(tree, path, index, name, msg){
if(typeof tree != "undefined"){
var node;
if(index == path.length) {
node = tree;
}else{
this._publish(tree.c[path[index]], path, index + 1, name, msg);
this._publish(tree.c["*"], path, index + 1, name, msg);
node = tree.c["**"];
}
if(typeof node != "undefined"){
var callbacks = node.s;
var max = callbacks.length;
for(var i = 0; i < max; i++){
if(callbacks[i].cb){
var sc = callbacks[i].scope;
var cb = callbacks[i].cb;
var fcb = callbacks[i].fcb;
var d = callbacks[i].data;
if(typeof cb == "string"){
// get a function object
cb = sc[cb];
}
if(typeof fcb == "string"){
// get a function object
fcb = sc[fcb];
}
if((!fcb) ||
(fcb.call(sc, name, msg, d))) {
cb.call(sc, name, msg, d);
}
}
}
}
}
}
h._unsubscribe = function(tree, path, index, sid) {
if(typeof tree != "undefined") {
if(index < path.length) {
var childNode = tree.c[path[index]];
this._unsubscribe(childNode, path, index + 1, sid);
if(childNode.s.length == 0) {
for(var x in childNode.c)
return;
delete tree.c[path[index]];
}
return;
}
else {
var callbacks = tree.s;
var max = callbacks.length;
for(var i = 0; i < max; i++)
if(sid == callbacks[i].sid) {
if(this._pubDepth > 0) {
callbacks[i].cb = null;
this._cleanup.push(callbacks[i]);
}
else
callbacks.splice(i, 1);
return;
}
}
}
}
// The following function is provided for automatic testing purposes.
// It is not expected to be deployed in run-time OpenAjax Hub implementations.
h.reinit = function()
{
for (var lib in OpenAjax.hub.libraries) {
delete OpenAjax.hub.libraries[lib];
}
OpenAjax.hub.registerLibrary("OpenAjax", "http://openajax.org/hub", "0.6", {});
delete OpenAjax._subscriptions;
OpenAjax._subscriptions = {c:{},s:[]};
delete OpenAjax._cleanup;
OpenAjax._cleanup = [];
OpenAjax._subIndex = 0;
OpenAjax._pubDepth = 0;
}
};
// Register the OpenAjax Hub itself as a library.
OpenAjax.hub.registerLibrary("OpenAjax", "http://openajax.org/hub", "0.6", {});
}

@ -5,60 +5,130 @@
*/
if(!dojo._hasResource["dojo.Stateful"]){
dojo._hasResource["dojo.Stateful"]=true;
if(!dojo._hasResource["dojo.Stateful"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.Stateful"] = true;
dojo.provide("dojo.Stateful");
dojo.declare("dojo.Stateful",null,{postscript:function(_1){
if(_1){
dojo.mixin(this,_1);
}
},get:function(_2){
return this[_2];
},set:function(_3,_4){
if(typeof _3==="object"){
for(var x in _3){
this.set(x,_3[x]);
}
return this;
}
var _5=this[_3];
this[_3]=_4;
if(this._watchCallbacks){
this._watchCallbacks(_3,_5,_4);
}
return this;
},watch:function(_6,_7){
var _8=this._watchCallbacks;
if(!_8){
var _9=this;
_8=this._watchCallbacks=function(_a,_b,_c,_d){
var _e=function(_f){
for(var i=0,l=_f&&_f.length;i<l;i++){
try{
_f[i].call(_9,_a,_b,_c);
}
catch(e){
console.error(e);
}
}
};
_e(_8[_a]);
if(!_d){
_e(_8["*"]);
}
};
}
if(!_7&&typeof _6==="function"){
_7=_6;
_6="*";
}
var _10=_8[_6];
if(typeof _10!=="object"){
_10=_8[_6]=[];
}
_10.push(_7);
return {unwatch:function(){
_10.splice(dojo.indexOf(_10,_7),1);
}};
}});
dojo.declare("dojo.Stateful", null, {
// summary:
// Base class for objects that provide named properties with optional getter/setter
// control and the ability to watch for property changes
// example:
// | var obj = new dojo.Stateful();
// | obj.watch("foo", function(){
// | console.log("foo changed to " + this.get("foo"));
// | });
// | obj.set("foo","bar");
postscript: function(mixin){
if(mixin){
dojo.mixin(this, mixin);
}
},
get: function(/*String*/name){
// summary:
// Get a property on a Stateful instance.
// name:
// The property to get.
// description:
// Get a named property on a Stateful object. The property may
// potentially be retrieved via a getter method in subclasses. In the base class
// this just retrieves the object's property.
// For example:
// | stateful = new dojo.Stateful({foo: 3});
// | stateful.get("foo") // returns 3
// | stateful.foo // returns 3
return this[name];
},
set: function(/*String*/name, /*Object*/value){
// summary:
// Set a property on a Stateful instance
// name:
// The property to set.
// value:
// The value to set in the property.
// description:
// Sets named properties on a stateful object and notifies any watchers of
// 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);
//
// set() may also be called with a hash of name/value pairs, ex:
// | myObj.set({
// | foo: "Howdy",
// | bar: 3
// | })
// This is equivalent to calling set(foo, "Howdy") and set(bar, 3)
if(typeof name === "object"){
for(var x in name){
this.set(x, name[x]);
}
return this;
}
var oldValue = this[name];
this[name] = value;
if(this._watchCallbacks){
this._watchCallbacks(name, oldValue, value);
}
return this;
},
watch: function(/*String?*/name, /*Function*/callback){
// summary:
// Watches a property for changes
// name:
// Indicates the property to watch. This is optional (the callback may be the
// only parameter), and if omitted, all the properties will be watched
// returns:
// An object handle for the watch. The unwatch method of this object
// can be used to discontinue watching this property:
// | var watchHandle = obj.watch("foo", callback);
// | watchHandle.unwatch(); // callback won't be called now
// callback:
// The function to execute when the property changes. This will be called after
// the property has been changed. The callback will be called with the |this|
// set to the instance, the first argument as the name of the property, the
// second argument as the old value and the third argument as the new value.
var callbacks = this._watchCallbacks;
if(!callbacks){
var self = this;
callbacks = this._watchCallbacks = function(name, oldValue, value, ignoreCatchall){
var notify = function(propertyCallbacks){
for(var i = 0, l = propertyCallbacks && propertyCallbacks.length; i < l; i++){
try{
propertyCallbacks[i].call(self, name, oldValue, value);
}catch(e){
console.error(e);
}
}
};
notify(callbacks[name]);
if(!ignoreCatchall){
notify(callbacks["*"]); // the catch-all
}
}; // we use a function instead of an object so it will be ignored by JSON conversion
}
if(!callback && typeof name === "function"){
callback = name;
name = "*";
}
var propertyCallbacks = callbacks[name];
if(typeof propertyCallbacks !== "object"){
propertyCallbacks = callbacks[name] = [];
}
propertyCallbacks.push(callback);
return {
unwatch: function(){
propertyCallbacks.splice(dojo.indexOf(propertyCallbacks, callback), 1);
}
};
}
});
}

@ -5,8 +5,8 @@
*/
if(!dojo._hasResource["dojo._base"]){
dojo._hasResource["dojo._base"]=true;
if(!dojo._hasResource["dojo._base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo._base"] = true;
dojo.provide("dojo._base");
dojo.require("dojo._base.lang");
dojo.require("dojo._base.array");
@ -15,5 +15,6 @@ dojo.require("dojo._base.connect");
dojo.require("dojo._base.Deferred");
dojo.require("dojo._base.json");
dojo.require("dojo._base.Color");
dojo.requireIf(dojo.isBrowser,"dojo._base.browser");
dojo.requireIf(dojo.isBrowser, "dojo._base.browser");
}

@ -5,98 +5,223 @@
*/
if(!dojo._hasResource["dojo._base.Color"]){
dojo._hasResource["dojo._base.Color"]=true;
if(!dojo._hasResource["dojo._base.Color"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo._base.Color"] = true;
dojo.provide("dojo._base.Color");
dojo.require("dojo._base.array");
dojo.require("dojo._base.lang");
(function(){
var d=dojo;
dojo.Color=function(_1){
if(_1){
this.setColor(_1);
}
};
dojo.Color.named={black:[0,0,0],silver:[192,192,192],gray:[128,128,128],white:[255,255,255],maroon:[128,0,0],red:[255,0,0],purple:[128,0,128],fuchsia:[255,0,255],green:[0,128,0],lime:[0,255,0],olive:[128,128,0],yellow:[255,255,0],navy:[0,0,128],blue:[0,0,255],teal:[0,128,128],aqua:[0,255,255],transparent:d.config.transparentColor||[255,255,255]};
dojo.extend(dojo.Color,{r:255,g:255,b:255,a:1,_set:function(r,g,b,a){
var t=this;
t.r=r;
t.g=g;
t.b=b;
t.a=a;
},setColor:function(_2){
if(d.isString(_2)){
d.colorFromString(_2,this);
}else{
if(d.isArray(_2)){
d.colorFromArray(_2,this);
}else{
this._set(_2.r,_2.g,_2.b,_2.a);
if(!(_2 instanceof d.Color)){
this.sanitize();
}
}
}
return this;
},sanitize:function(){
return this;
},toRgb:function(){
var t=this;
return [t.r,t.g,t.b];
},toRgba:function(){
var t=this;
return [t.r,t.g,t.b,t.a];
},toHex:function(){
var _3=d.map(["r","g","b"],function(x){
var s=this[x].toString(16);
return s.length<2?"0"+s:s;
},this);
return "#"+_3.join("");
},toCss:function(_4){
var t=this,_5=t.r+", "+t.g+", "+t.b;
return (_4?"rgba("+_5+", "+t.a:"rgb("+_5)+")";
},toString:function(){
return this.toCss(true);
}});
dojo.blendColors=function(_6,_7,_8,_9){
var t=_9||new d.Color();
d.forEach(["r","g","b","a"],function(x){
t[x]=_6[x]+(_7[x]-_6[x])*_8;
if(x!="a"){
t[x]=Math.round(t[x]);
}
});
return t.sanitize();
};
dojo.colorFromRgb=function(_a,_b){
var m=_a.toLowerCase().match(/^rgba?\(([\s\.,0-9]+)\)/);
return m&&dojo.colorFromArray(m[1].split(/\s*,\s*/),_b);
};
dojo.colorFromHex=function(_c,_d){
var t=_d||new d.Color(),_e=(_c.length==4)?4:8,_f=(1<<_e)-1;
_c=Number("0x"+_c.substr(1));
if(isNaN(_c)){
return null;
}
d.forEach(["b","g","r"],function(x){
var c=_c&_f;
_c>>=_e;
t[x]=_e==4?17*c:c;
});
t.a=1;
return t;
};
dojo.colorFromArray=function(a,obj){
var t=obj||new d.Color();
t._set(Number(a[0]),Number(a[1]),Number(a[2]),Number(a[3]));
if(isNaN(t.a)){
t.a=1;
}
return t.sanitize();
};
dojo.colorFromString=function(str,obj){
var a=d.Color.named[str];
return a&&d.colorFromArray(a,obj)||d.colorFromRgb(str,obj)||d.colorFromHex(str,obj);
};
var d = dojo;
dojo.Color = function(/*Array|String|Object*/ color){
// summary:
// Takes a named string, hex string, array of rgb or rgba values,
// an object with r, g, b, and a properties, or another `dojo.Color` object
// and creates a new Color instance to work from.
//
// example:
// Work with a Color instance:
// | var c = new dojo.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 dojo.Color(color);
// | // adjust the color some
// | n.r *= .5;
// | console.log(n.toString()); // rgb(128, 255, 255);
if(color){ this.setColor(color); }
};
// FIXME:
// there's got to be a more space-efficient way to encode or discover
// these!! Use hex?
dojo.Color.named = {
black: [0,0,0],
silver: [192,192,192],
gray: [128,128,128],
white: [255,255,255],
maroon: [128,0,0],
red: [255,0,0],
purple: [128,0,128],
fuchsia: [255,0,255],
green: [0,128,0],
lime: [0,255,0],
olive: [128,128,0],
yellow: [255,255,0],
navy: [0,0,128],
blue: [0,0,255],
teal: [0,128,128],
aqua: [0,255,255],
transparent: d.config.transparentColor || [255,255,255]
};
dojo.extend(dojo.Color, {
r: 255, g: 255, b: 255, a: 1,
_set: function(r, g, b, a){
var t = this; t.r = r; t.g = g; t.b = b; t.a = a;
},
setColor: function(/*Array|String|Object*/ color){
// summary:
// Takes a named string, hex string, array of rgb or rgba values,
// an object with r, g, b, and a properties, or another `dojo.Color` object
// and sets this color instance to that value.
//
// example:
// | var c = new dojo.Color(); // no color
// | c.setColor("#ededed"); // greyish
if(d.isString(color)){
d.colorFromString(color, this);
}else if(d.isArray(color)){
d.colorFromArray(color, this);
}else{
this._set(color.r, color.g, color.b, color.a);
if(!(color instanceof d.Color)){ this.sanitize(); }
}
return this; // dojo.Color
},
sanitize: function(){
// summary:
// Ensures the object has correct attributes
// description:
// the default implementation does nothing, include dojo.colors to
// augment it with real checks
return this; // dojo.Color
},
toRgb: function(){
// summary:
// Returns 3 component array of rgb values
// example:
// | var c = new dojo.Color("#000000");
// | console.log(c.toRgb()); // [0,0,0]
var t = this;
return [t.r, t.g, t.b]; // Array
},
toRgba: function(){
// summary:
// Returns a 4 component array of rgba values from the color
// represented by this object.
var t = this;
return [t.r, t.g, t.b, t.a]; // Array
},
toHex: function(){
// summary:
// Returns a CSS color string in hexadecimal representation
// example:
// | console.log(new dojo.Color([0,0,0]).toHex()); // #000000
var arr = d.map(["r", "g", "b"], function(x){
var s = this[x].toString(16);
return s.length < 2 ? "0" + s : s;
}, this);
return "#" + arr.join(""); // String
},
toCss: function(/*Boolean?*/ includeAlpha){
// summary:
// Returns a css color string in rgb(a) representation
// example:
// | var c = new dojo.Color("#FFF").toCss();
// | console.log(c); // rgb('255','255','255')
var t = this, rgb = t.r + ", " + t.g + ", " + t.b;
return (includeAlpha ? "rgba(" + rgb + ", " + t.a : "rgb(" + rgb) + ")"; // String
},
toString: function(){
// summary:
// Returns a visual representation of the color
return this.toCss(true); // String
}
});
dojo.blendColors = function(
/*dojo.Color*/ start,
/*dojo.Color*/ end,
/*Number*/ weight,
/*dojo.Color?*/ obj
){
// summary:
// Blend colors end and start with weight from 0 to 1, 0.5 being a 50/50 blend,
// can reuse a previously allocated dojo.Color object for the result
var t = obj || new d.Color();
d.forEach(["r", "g", "b", "a"], function(x){
t[x] = start[x] + (end[x] - start[x]) * weight;
if(x != "a"){ t[x] = Math.round(t[x]); }
});
return t.sanitize(); // dojo.Color
};
dojo.colorFromRgb = function(/*String*/ color, /*dojo.Color?*/ obj){
// summary:
// Returns a `dojo.Color` instance from a string of the form
// "rgb(...)" or "rgba(...)". Optionally accepts a `dojo.Color`
// object to update with the parsed value and return instead of
// creating a new object.
// returns:
// A dojo.Color object. If obj is passed, it will be the return value.
var m = color.toLowerCase().match(/^rgba?\(([\s\.,0-9]+)\)/);
return m && dojo.colorFromArray(m[1].split(/\s*,\s*/), obj); // dojo.Color
};
dojo.colorFromHex = function(/*String*/ color, /*dojo.Color?*/ obj){
// summary:
// Converts a hex string with a '#' prefix to a color object.
// Supports 12-bit #rgb shorthand. Optionally accepts a
// `dojo.Color` object to update with the parsed value.
//
// returns:
// A dojo.Color object. If obj is passed, it will be the return value.
//
// example:
// | var thing = dojo.colorFromHex("#ededed"); // grey, longhand
//
// example:
// | var thing = dojo.colorFromHex("#000"); // black, shorthand
var t = obj || new d.Color(),
bits = (color.length == 4) ? 4 : 8,
mask = (1 << bits) - 1;
color = Number("0x" + color.substr(1));
if(isNaN(color)){
return null; // dojo.Color
}
d.forEach(["b", "g", "r"], function(x){
var c = color & mask;
color >>= bits;
t[x] = bits == 4 ? 17 * c : c;
});
t.a = 1;
return t; // dojo.Color
};
dojo.colorFromArray = function(/*Array*/ a, /*dojo.Color?*/ obj){
// summary:
// Builds a `dojo.Color` from a 3 or 4 element array, mapping each
// element in sequence to the rgb(a) values of the color.
// example:
// | var myColor = dojo.colorFromArray([237,237,237,0.5]); // grey, 50% alpha
// returns:
// A dojo.Color object. If obj is passed, it will be the return value.
var t = obj || new d.Color();
t._set(Number(a[0]), Number(a[1]), Number(a[2]), Number(a[3]));
if(isNaN(t.a)){ t.a = 1; }
return t.sanitize(); // dojo.Color
};
dojo.colorFromString = function(/*String*/ str, /*dojo.Color?*/ obj){
// summary:
// Parses `str` for a color value. Accepts hex, rgb, and rgba
// style color values.
// description:
// Acceptable input values for str may include arrays of any form
// accepted by dojo.colorFromArray, hex strings such as "#aaaaaa", or
// rgb or rgba strings such as "rgb(133, 200, 16)" or "rgba(10, 10,
// 10, 50)"
// returns:
// A dojo.Color object. If obj is passed, it will be the return value.
var a = d.Color.named[str];
return a && d.colorFromArray(a, obj) || d.colorFromRgb(str, obj) || d.colorFromHex(str, obj);
};
})();
}

@ -5,126 +5,338 @@
*/
if(!dojo._hasResource["dojo._base.Deferred"]){
dojo._hasResource["dojo._base.Deferred"]=true;
if(!dojo._hasResource["dojo._base.Deferred"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo._base.Deferred"] = true;
dojo.provide("dojo._base.Deferred");
dojo.require("dojo._base.lang");
(function(){
var _1=function(){
};
var _2=Object.freeze||function(){
};
dojo.Deferred=function(_3){
var _4,_5,_6,_7,_8;
var _9=this.promise={};
function _a(_b){
if(_5){
throw new Error("This deferred has already been resolved");
}
_4=_b;
_5=true;
_c();
};
function _c(){
var _d;
while(!_d&&_8){
var _e=_8;
_8=_8.next;
if(_d=(_e.progress==_1)){
_5=false;
}
var _f=(_6?_e.error:_e.resolved);
if(_f){
try{
var _10=_f(_4);
if(_10&&typeof _10.then==="function"){
_10.then(dojo.hitch(_e.deferred,"resolve"),dojo.hitch(_e.deferred,"reject"));
continue;
}
var _11=_d&&_10===undefined;
_e.deferred[_11&&_6?"reject":"resolve"](_11?_4:_10);
}
catch(e){
_e.deferred.reject(e);
}
}else{
if(_6){
_e.deferred.reject(_4);
}else{
_e.deferred.resolve(_4);
}
}
}
};
this.resolve=this.callback=function(_12){
this.fired=0;
this.results=[_12,null];
_a(_12);
};
this.reject=this.errback=function(_13){
_6=true;
this.fired=1;
_a(_13);
this.results=[null,_13];
if(!_13||_13.log!==false){
(dojo.config.deferredOnError||function(x){
console.error(x);
})(_13);
}
};
this.progress=function(_14){
var _15=_8;
while(_15){
var _16=_15.progress;
_16&&_16(_14);
_15=_15.next;
}
};
this.addCallbacks=function(_17,_18){
this.then(_17,_18,_1);
return this;
};
this.then=_9.then=function(_19,_1a,_1b){
var _1c=_1b==_1?this:new dojo.Deferred(_9.cancel);
var _1d={resolved:_19,error:_1a,progress:_1b,deferred:_1c};
if(_8){
_7=_7.next=_1d;
}else{
_8=_7=_1d;
}
if(_5){
_c();
}
return _1c.promise;
};
var _1e=this;
this.cancel=_9.cancel=function(){
if(!_5){
var _1f=_3&&_3(_1e);
if(!_5){
if(!(_1f instanceof Error)){
_1f=new Error(_1f);
}
_1f.log=false;
_1e.reject(_1f);
}
}
};
_2(_9);
};
dojo.extend(dojo.Deferred,{addCallback:function(_20){
return this.addCallbacks(dojo.hitch.apply(dojo,arguments));
},addErrback:function(_21){
return this.addCallbacks(null,dojo.hitch.apply(dojo,arguments));
},addBoth:function(_22){
var _23=dojo.hitch.apply(dojo,arguments);
return this.addCallbacks(_23,_23);
},fired:-1});
var mutator = function(){};
var freeze = Object.freeze || function(){};
// A deferred provides an API for creating and resolving a promise.
dojo.Deferred = function(/*Function?*/canceller){
// summary:
// Deferreds provide a generic means for encapsulating an asynchronous
// operation and notifying users of the completion and result of the operation.
// description:
// The dojo.Deferred API is based on the concept of promises that provide a
// generic interface into the eventual completion of an asynchronous action.
// The motivation for promises fundamentally is about creating a
// separation of concerns that allows one to achieve the same type of
// call patterns and logical data flow in asynchronous code as can be
// achieved in synchronous code. Promises allows one
// to be able to call a function purely with arguments needed for
// execution, without conflating the call with concerns of whether it is
// sync or async. One shouldn't need to alter a call's arguments if the
// implementation switches from sync to async (or vice versa). By having
// async functions return promises, the concerns of making the call are
// separated from the concerns of asynchronous interaction (which are
// handled by the promise).
//
// The dojo.Deferred is a type of promise that provides methods for fulfilling the
// promise with a successful result or an error. The most important method for
// working with Dojo's promises is the then() method, which follows the
// CommonJS proposed promise API. An example of using a Dojo promise:
//
// | var resultingPromise = someAsyncOperation.then(function(result){
// | ... handle result ...
// | },
// | function(error){
// | ... handle error ...
// | });
//
// The .then() call returns a new promise that represents the result of the
// execution of the callback. The callbacks will never affect the original promises value.
//
// The dojo.Deferred instances also provide the following functions for backwards compatibility:
//
// * addCallback(handler)
// * addErrback(handler)
// * callback(result)
// * errback(result)
//
// Callbacks are allowed to return promisesthemselves, so
// you can build complicated sequences of events with ease.
//
// The creator of the Deferred may specify a canceller. The canceller
// is a function that will be called if Deferred.cancel is called
// before the Deferred fires. You can use this to implement clean
// aborting of an XMLHttpRequest, etc. Note that cancel will fire the
// deferred with a CancelledError (unless your canceller returns
// another kind of error), so the errbacks should be prepared to
// handle that error for cancellable Deferreds.
// example:
// | var deferred = new dojo.Deferred();
// | setTimeout(function(){ deferred.callback({success: true}); }, 1000);
// | return deferred;
// example:
// Deferred objects are often used when making code asynchronous. It
// may be easiest to write functions in a synchronous manner and then
// split code using a deferred to trigger a response to a long-lived
// operation. For example, instead of register a callback function to
// denote when a rendering operation completes, the function can
// simply return a deferred:
//
// | // callback style:
// | function renderLotsOfData(data, callback){
// | var success = false
// | try{
// | for(var x in data){
// | renderDataitem(data[x]);
// | }
// | success = true;
// | }catch(e){ }
// | if(callback){
// | callback(success);
// | }
// | }
//
// | // using callback style
// | renderLotsOfData(someDataObj, function(success){
// | // handles success or failure
// | if(!success){
// | promptUserToRecover();
// | }
// | });
// | // NOTE: no way to add another callback here!!
// example:
// Using a Deferred doesn't simplify the sending code any, but it
// provides a standard interface for callers and senders alike,
// providing both with a simple way to service multiple callbacks for
// an operation and freeing both sides from worrying about details
// such as "did this get called already?". With Deferreds, new
// callbacks can be added at any time.
//
// | // Deferred style:
// | function renderLotsOfData(data){
// | var d = new dojo.Deferred();
// | try{
// | for(var x in data){
// | renderDataitem(data[x]);
// | }
// | d.callback(true);
// | }catch(e){
// | d.errback(new Error("rendering failed"));
// | }
// | return d;
// | }
//
// | // using Deferred style
// | renderLotsOfData(someDataObj).then(null, function(){
// | promptUserToRecover();
// | });
// | // NOTE: addErrback and addCallback both return the Deferred
// | // again, so we could chain adding callbacks or save the
// | // deferred for later should we need to be notified again.
// example:
// In this example, renderLotsOfData is syncrhonous and so both
// versions are pretty artificial. Putting the data display on a
// timeout helps show why Deferreds rock:
//
// | // Deferred style and async func
// | function renderLotsOfData(data){
// | var d = new dojo.Deferred();
// | setTimeout(function(){
// | try{
// | for(var x in data){
// | renderDataitem(data[x]);
// | }
// | d.callback(true);
// | }catch(e){
// | d.errback(new Error("rendering failed"));
// | }
// | }, 100);
// | return d;
// | }
//
// | // using Deferred style
// | renderLotsOfData(someDataObj).then(null, function(){
// | promptUserToRecover();
// | });
//
// Note that the caller doesn't have to change his code at all to
// handle the asynchronous case.
var result, finished, isError, head, nextListener;
var promise = this.promise = {};
function complete(value){
if(finished){
throw new Error("This deferred has already been resolved");
}
result = value;
finished = true;
notify();
}
function notify(){
var mutated;
while(!mutated && nextListener){
var listener = nextListener;
nextListener = nextListener.next;
if(mutated = (listener.progress == mutator)){ // assignment and check
finished = false;
}
var func = (isError ? listener.error : listener.resolved);
if (func) {
try {
var newResult = func(result);
if (newResult && typeof newResult.then === "function") {
newResult.then(dojo.hitch(listener.deferred, "resolve"), dojo.hitch(listener.deferred, "reject"));
continue;
}
var unchanged = mutated && newResult === undefined;
listener.deferred[unchanged && isError ? "reject" : "resolve"](unchanged ? result : newResult);
}
catch (e) {
listener.deferred.reject(e);
}
}else {
if(isError){
listener.deferred.reject(result);
}else{
listener.deferred.resolve(result);
}
}
}
}
// calling resolve will resolve the promise
this.resolve = this.callback = function(value){
// summary:
// Fulfills the Deferred instance successfully with the provide value
this.fired = 0;
this.results = [value, null];
complete(value);
};
// calling error will indicate that the promise failed
this.reject = this.errback = function(error){
// summary:
// Fulfills the Deferred instance as an error with the provided error
isError = true;
this.fired = 1;
complete(error);
this.results = [null, error];
if(!error || error.log !== false){
(dojo.config.deferredOnError || function(x){ console.error(x); })(error);
}
};
// call progress to provide updates on the progress on the completion of the promise
this.progress = function(update){
// summary
// Send progress events to all listeners
var listener = nextListener;
while(listener){
var progress = listener.progress;
progress && progress(update);
listener = listener.next;
}
};
this.addCallbacks = function(/*Function?*/callback, /*Function?*/errback){
this.then(callback, errback, mutator);
return this;
};
// provide the implementation of the promise
this.then = promise.then = function(/*Function?*/resolvedCallback, /*Function?*/errorCallback, /*Function?*/progressCallback){
// summary
// Adds a fulfilledHandler, errorHandler, and progressHandler to be called for
// completion of a promise. The fulfilledHandler is called when the promise
// is fulfilled. The errorHandler is called when a promise fails. The
// progressHandler is called for progress events. All arguments are optional
// and non-function values are ignored. The progressHandler is not only an
// optional argument, but progress events are purely optional. Promise
// providers are not required to ever create progress events.
//
// This function will return a new promise that is fulfilled when the given
// fulfilledHandler or errorHandler callback is finished. This allows promise
// operations to be chained together. The value returned from the callback
// handler is the fulfillment value for the returned promise. If the callback
// throws an error, the returned promise will be moved to failed state.
//
// example:
// An example of using a CommonJS compliant promise:
// | asyncComputeTheAnswerToEverything().
// | then(addTwo).
// | then(printResult, onError);
// | >44
//
var returnDeferred = progressCallback == mutator ? this : new dojo.Deferred(promise.cancel);
var listener = {
resolved: resolvedCallback,
error: errorCallback,
progress: progressCallback,
deferred: returnDeferred
};
if(nextListener){
head = head.next = listener;
}
else{
nextListener = head = listener;
}
if(finished){
notify();
}
return returnDeferred.promise;
};
var deferred = this;
this.cancel = promise.cancel = function () {
// summary:
// Cancels the asynchronous operation
if(!finished){
var error = canceller && canceller(deferred);
if(!finished){
if (!(error instanceof Error)) {
error = new Error(error);
}
error.log = false;
deferred.reject(error);
}
}
}
freeze(promise);
};
dojo.extend(dojo.Deferred, {
addCallback: function (/*Function*/callback) {
return this.addCallbacks(dojo.hitch.apply(dojo, arguments));
},
addErrback: function (/*Function*/errback) {
return this.addCallbacks(null, dojo.hitch.apply(dojo, arguments));
},
addBoth: function (/*Function*/callback) {
var enclosed = dojo.hitch.apply(dojo, arguments);
return this.addCallbacks(enclosed, enclosed);
},
fired: -1
});
})();
dojo.when=function(_24,_25,_26,_27){
if(_24&&typeof _24.then==="function"){
return _24.then(_25,_26,_27);
}
return _25(_24);
dojo.when = function(promiseOrValue, /*Function?*/callback, /*Function?*/errback, /*Function?*/progressHandler){
// summary:
// This provides normalization between normal synchronous values and
// asynchronous promises, so you can interact with them in a common way
// example:
// | function printFirstAndList(items){
// | dojo.when(findFirst(items), console.log);
// | dojo.when(findLast(items), console.log);
// | }
// | function findFirst(items){
// | return dojo.when(items, function(items){
// | return items[0];
// | });
// | }
// | function findLast(items){
// | return dojo.when(items, function(items){
// | return items[items.length];
// | });
// | }
// And now all three of his functions can be used sync or async.
// | printFirstAndLast([1,2,3,4]) will work just as well as
// | printFirstAndLast(dojo.xhrGet(...));
if(promiseOrValue && typeof promiseOrValue.then === "function"){
return promiseOrValue.then(callback, errback, progressHandler);
}
return callback(promiseOrValue);
};
}

File diff suppressed because it is too large Load Diff

@ -5,116 +5,500 @@
*/
(function(){
if(typeof this["loadFirebugConsole"]=="function"){
this["loadFirebugConsole"]();
}else{
this.console=this.console||{};
var cn=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","profile","profileEnd","time","timeEnd","trace","warn","log"];
var i=0,tn;
while((tn=cn[i++])){
if(!console[tn]){
(function(){
var _1=tn+"";
console[_1]=("log" in console)?function(){
var a=Array.apply({},arguments);
a.unshift(_1+":");
console["log"](a.join(" "));
}:function(){
};
console[_1]._fake=true;
})();
}
}
}
if(typeof dojo=="undefined"){
dojo={_scopeName:"dojo",_scopePrefix:"",_scopePrefixArgs:"",_scopeSuffix:"",_scopeMap:{},_scopeMapRev:{}};
}
var d=dojo;
if(typeof dijit=="undefined"){
dijit={_scopeName:"dijit"};
}
if(typeof dojox=="undefined"){
dojox={_scopeName:"dojox"};
}
if(!d._scopeArgs){
d._scopeArgs=[dojo,dijit,dojox];
}
d.global=this;
d.config={isDebug:false,debugAtAllCosts:false};
if(typeof djConfig!="undefined"){
for(var _2 in djConfig){
d.config[_2]=djConfig[_2];
}
}
dojo.locale=d.config.locale;
var _3="$Rev: 22487 $".match(/\d+/);
dojo.version={major:1,minor:5,patch:0,flag:"",revision:_3?+_3[0]:NaN,toString:function(){
with(d.version){
return major+"."+minor+"."+patch+flag+" ("+revision+")";
}
}};
if(typeof OpenAjax!="undefined"){
OpenAjax.hub.registerLibrary(dojo._scopeName,"http://dojotoolkit.org",d.version.toString());
}
var _4,_5,_6={};
for(var i in {toString:1}){
_4=[];
break;
}
dojo._extraNames=_4=_4||["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"];
_5=_4.length;
dojo._mixin=function(_7,_8){
var _9,s,i;
for(_9 in _8){
s=_8[_9];
if(!(_9 in _7)||(_7[_9]!==s&&(!(_9 in _6)||_6[_9]!==s))){
_7[_9]=s;
}
}
if(_5&&_8){
for(i=0;i<_5;++i){
_9=_4[i];
s=_8[_9];
if(!(_9 in _7)||(_7[_9]!==s&&(!(_9 in _6)||_6[_9]!==s))){
_7[_9]=s;
}
}
}
return _7;
};
dojo.mixin=function(_a,_b){
if(!_a){
_a={};
}
for(var i=1,l=arguments.length;i<l;i++){
d._mixin(_a,arguments[i]);
}
return _a;
};
dojo._getProp=function(_c,_d,_e){
var _f=_e||d.global;
for(var i=0,p;_f&&(p=_c[i]);i++){
if(i==0&&d._scopeMap[p]){
p=d._scopeMap[p];
/*=====
// note:
// 'djConfig' does not exist under 'dojo.*' so that it can be set before the
// 'dojo' variable exists.
// note:
// Setting any of these variables *after* the library has loaded does
// nothing at all.
djConfig = {
// summary:
// Application code can set the global 'djConfig' prior to loading
// the library to override certain global settings for how dojo works.
//
// isDebug: Boolean
// Defaults to `false`. If set to `true`, ensures that Dojo provides
// extended debugging feedback via Firebug. If Firebug is not available
// on your platform, setting `isDebug` to `true` will force Dojo to
// pull in (and display) the version of Firebug Lite which is
// integrated into the Dojo distribution, thereby always providing a
// debugging/logging console when `isDebug` is enabled. Note that
// Firebug's `console.*` methods are ALWAYS defined by Dojo. If
// `isDebug` is false and you are on a platform without Firebug, these
// methods will be defined as no-ops.
isDebug: false,
// debugAtAllCosts: Boolean
// Defaults to `false`. If set to `true`, this triggers an alternate
// mode of the package system in which dependencies are detected and
// only then are resources evaluated in dependency order via
// `<script>` tag inclusion. This may double-request resources and
// cause problems with scripts which expect `dojo.require()` to
// preform synchronously. `debugAtAllCosts` can be an invaluable
// debugging aid, but when using it, ensure that all code which
// depends on Dojo modules is wrapped in `dojo.addOnLoad()` handlers.
// Due to the somewhat unpredictable side-effects of using
// `debugAtAllCosts`, it is strongly recommended that you enable this
// flag as a last resort. `debugAtAllCosts` has no effect when loading
// resources across domains. For usage information, see the
// [Dojo Book](http://dojotoolkit.org/book/book-dojo/part-4-meta-dojo-making-your-dojo-code-run-faster-and-better/debugging-facilities/deb)
debugAtAllCosts: false,
// locale: String
// The locale to assume for loading localized resources in this page,
// specified according to [RFC 3066](http://www.ietf.org/rfc/rfc3066.txt).
// Must be specified entirely in lowercase, e.g. `en-us` and `zh-cn`.
// See the documentation for `dojo.i18n` and `dojo.requireLocalization`
// for details on loading localized resources. If no locale is specified,
// Dojo assumes the locale of the user agent, according to `navigator.userLanguage`
// or `navigator.language` properties.
locale: undefined,
// extraLocale: Array
// No default value. Specifies additional locales whose
// resources should also be loaded alongside the default locale when
// calls to `dojo.requireLocalization()` are processed.
extraLocale: undefined,
// baseUrl: String
// The directory in which `dojo.js` is located. Under normal
// conditions, Dojo auto-detects the correct location from which it
// was loaded. You may need to manually configure `baseUrl` in cases
// where you have renamed `dojo.js` or in which `<base>` tags confuse
// some browsers (e.g. IE 6). The variable `dojo.baseUrl` is assigned
// either the value of `djConfig.baseUrl` if one is provided or the
// auto-detected root if not. Other modules are located relative to
// this path. The path should end in a slash.
baseUrl: undefined,
// modulePaths: Object
// A map of module names to paths relative to `dojo.baseUrl`. The
// key/value pairs correspond directly to the arguments which
// `dojo.registerModulePath` accepts. Specifiying
// `djConfig.modulePaths = { "foo": "../../bar" }` is the equivalent
// of calling `dojo.registerModulePath("foo", "../../bar");`. Multiple
// modules may be configured via `djConfig.modulePaths`.
modulePaths: {},
// afterOnLoad: Boolean
// Indicates Dojo was added to the page after the page load. In this case
// Dojo will not wait for the page DOMContentLoad/load events and fire
// its dojo.addOnLoad callbacks after making sure all outstanding
// dojo.required modules have loaded. Only works with a built dojo.js,
// it does not work the dojo.js directly from source control.
afterOnLoad: false,
// addOnLoad: Function or Array
// Adds a callback via dojo.addOnLoad. Useful when Dojo is added after
// the page loads and djConfig.afterOnLoad is true. Supports the same
// arguments as dojo.addOnLoad. When using a function reference, use
// `djConfig.addOnLoad = function(){};`. For object with function name use
// `djConfig.addOnLoad = [myObject, "functionName"];` and for object with
// function reference use
// `djConfig.addOnLoad = [myObject, function(){}];`
addOnLoad: null,
// require: Array
// An array of module names to be loaded immediately after dojo.js has been included
// in a page.
require: [],
// defaultDuration: Array
// Default duration, in milliseconds, for wipe and fade animations within dijits.
// Assigned to dijit.defaultDuration.
defaultDuration: 200,
// dojoBlankHtmlUrl: String
// Used by some modules to configure an empty iframe. Used by dojo.io.iframe and
// dojo.back, and dijit popup support in IE where an iframe is needed to make sure native
// controls do not bleed through the popups. Normally this configuration variable
// does not need to be set, except when using cross-domain/CDN Dojo builds.
// Save dojo/resources/blank.html to your domain and set `djConfig.dojoBlankHtmlUrl`
// to the path on your domain your copy of blank.html.
dojoBlankHtmlUrl: undefined,
// ioPublish: Boolean?
// Set this to true to enable publishing of topics for the different phases of
// IO operations. Publishing is done via dojo.publish. See dojo.__IoPublish for a list
// of topics that are published.
ioPublish: false,
// useCustomLogger: Anything?
// If set to a value that evaluates to true such as a string or array and
// isDebug is true and Firebug is not available or running, then it bypasses
// the creation of Firebug Lite allowing you to define your own console object.
useCustomLogger: undefined,
// transparentColor: Array
// Array containing the r, g, b components used as transparent color in dojo.Color;
// if undefined, [255,255,255] (white) will be used.
transparentColor: undefined,
// skipIeDomLoaded: Boolean
// For IE only, skip the DOMContentLoaded hack used. Sometimes it can cause an Operation
// Aborted error if the rest of the page triggers script defers before the DOM is ready.
// If this is config value is set to true, then dojo.addOnLoad callbacks will not be
// triggered until the page load event, which is after images and iframes load. If you
// want to trigger the callbacks sooner, you can put a script block in the bottom of
// your HTML that calls dojo._loadInit();. If you are using multiversion support, change
// "dojo." to the appropriate scope name for dojo.
skipIeDomLoaded: false
}
_f=(p in _f?_f[p]:(_d?_f[p]={}:undefined));
=====*/
(function(){
// firebug stubs
if(typeof this["loadFirebugConsole"] == "function"){
// for Firebug 1.2
this["loadFirebugConsole"]();
}else{
this.console = this.console || {};
// Be careful to leave 'log' always at the end
var cn = [
"assert", "count", "debug", "dir", "dirxml", "error", "group",
"groupEnd", "info", "profile", "profileEnd", "time", "timeEnd",
"trace", "warn", "log"
];
var i=0, tn;
while((tn=cn[i++])){
if(!console[tn]){
(function(){
var tcn = tn+"";
console[tcn] = ('log' in console) ? function(){
var a = Array.apply({}, arguments);
a.unshift(tcn+":");
console["log"](a.join(" "));
} : function(){}
console[tcn]._fake = true;
})();
}
}
}
//TODOC: HOW TO DOC THIS?
// dojo is the root variable of (almost all) our public symbols -- make sure it is defined.
if(typeof dojo == "undefined"){
dojo = {
_scopeName: "dojo",
_scopePrefix: "",
_scopePrefixArgs: "",
_scopeSuffix: "",
_scopeMap: {},
_scopeMapRev: {}
};
}
var d = dojo;
//Need placeholders for dijit and dojox for scoping code.
if(typeof dijit == "undefined"){
dijit = {_scopeName: "dijit"};
}
if(typeof dojox == "undefined"){
dojox = {_scopeName: "dojox"};
}
if(!d._scopeArgs){
d._scopeArgs = [dojo, dijit, dojox];
}
/*=====
dojo.global = {
// summary:
// Alias for the global scope
// (e.g. the window object in a browser).
// description:
// Refer to 'dojo.global' rather than referring to window to ensure your
// code runs correctly in contexts other than web browsers (e.g. Rhino on a server).
}
return _f;
};
dojo.setObject=function(_10,_11,_12){
var _13=_10.split("."),p=_13.pop(),obj=d._getProp(_13,true,_12);
return obj&&p?(obj[p]=_11):undefined;
};
dojo.getObject=function(_14,_15,_16){
return d._getProp(_14.split("."),_15,_16);
};
dojo.exists=function(_17,obj){
return !!d.getObject(_17,false,obj);
};
dojo["eval"]=function(_18){
return d.global.eval?d.global.eval(_18):eval(_18);
};
d.deprecated=d.experimental=function(){
};
=====*/
d.global = this;
d.config =/*===== djConfig = =====*/{
isDebug: false,
debugAtAllCosts: false
};
if(typeof djConfig != "undefined"){
for(var opt in djConfig){
d.config[opt] = djConfig[opt];
}
}
/*=====
// Override locale setting, if specified
dojo.locale = {
// summary: the locale as defined by Dojo (read-only)
};
=====*/
dojo.locale = d.config.locale;
var rev = "$Rev: 22487 $".match(/\d+/);
/*=====
dojo.version = function(){
// summary:
// Version number of the Dojo Toolkit
// major: Integer
// Major version. If total version is "1.2.0beta1", will be 1
// minor: Integer
// Minor version. If total version is "1.2.0beta1", will be 2
// patch: Integer
// Patch version. If total version is "1.2.0beta1", will be 0
// flag: String
// Descriptor flag. If total version is "1.2.0beta1", will be "beta1"
// revision: Number
// The SVN rev from which dojo was pulled
this.major = 0;
this.minor = 0;
this.patch = 0;
this.flag = "";
this.revision = 0;
}
=====*/
dojo.version = {
major: 1, minor: 5, patch: 0, flag: "",
revision: rev ? +rev[0] : NaN,
toString: function(){
with(d.version){
return major + "." + minor + "." + patch + flag + " (" + revision + ")"; // String
}
}
}
// Register with the OpenAjax hub
if(typeof OpenAjax != "undefined"){
OpenAjax.hub.registerLibrary(dojo._scopeName, "http://dojotoolkit.org", d.version.toString());
}
var extraNames, extraLen, empty = {};
for(var i in {toString: 1}){ extraNames = []; break; }
dojo._extraNames = extraNames = extraNames || ["hasOwnProperty", "valueOf", "isPrototypeOf",
"propertyIsEnumerable", "toLocaleString", "toString", "constructor"];
extraLen = extraNames.length;
dojo._mixin = function(/*Object*/ target, /*Object*/ source){
// summary:
// Adds all properties and methods of source to target. This addition
// is "prototype extension safe", so that instances of objects
// will not pass along prototype defaults.
var name, s, i;
for(name in source){
// the "tobj" condition avoid copying properties in "source"
// inherited from Object.prototype. For example, if target has a custom
// toString() method, don't overwrite it with the toString() method
// that source inherited from Object.prototype
s = source[name];
if(!(name in target) || (target[name] !== s && (!(name in empty) || empty[name] !== s))){
target[name] = s;
}
}
// IE doesn't recognize some custom functions in for..in
if(extraLen && source){
for(i = 0; i < extraLen; ++i){
name = extraNames[i];
s = source[name];
if(!(name in target) || (target[name] !== s && (!(name in empty) || empty[name] !== s))){
target[name] = s;
}
}
}
return target; // Object
}
dojo.mixin = function(/*Object*/obj, /*Object...*/props){
// summary:
// Adds all properties and methods of props to obj and returns the
// (now modified) obj.
// description:
// `dojo.mixin` can mix multiple source objects into a
// destination object which is then returned. Unlike regular
// `for...in` iteration, `dojo.mixin` is also smart about avoiding
// extensions which other toolkits may unwisely add to the root
// object prototype
// obj:
// The object to mix properties into. Also the return value.
// props:
// One or more objects whose values are successively copied into
// obj. If more than one of these objects contain the same value,
// the one specified last in the function call will "win".
// example:
// make a shallow copy of an object
// | var copy = dojo.mixin({}, source);
// example:
// many class constructors often take an object which specifies
// values to be configured on the object. In this case, it is
// often simplest to call `dojo.mixin` on the `this` object:
// | dojo.declare("acme.Base", null, {
// | constructor: function(properties){
// | // property configuration:
// | dojo.mixin(this, properties);
// |
// | console.log(this.quip);
// | // ...
// | },
// | quip: "I wasn't born yesterday, you know - I've seen movies.",
// | // ...
// | });
// |
// | // create an instance of the class and configure it
// | var b = new acme.Base({quip: "That's what it does!" });
// example:
// copy in properties from multiple objects
// | var flattened = dojo.mixin(
// | {
// | name: "Frylock",
// | braces: true
// | },
// | {
// | name: "Carl Brutanananadilewski"
// | }
// | );
// |
// | // will print "Carl Brutanananadilewski"
// | console.log(flattened.name);
// | // will print "true"
// | console.log(flattened.braces);
if(!obj){ obj = {}; }
for(var i=1, l=arguments.length; i<l; i++){
d._mixin(obj, arguments[i]);
}
return obj; // Object
}
dojo._getProp = function(/*Array*/parts, /*Boolean*/create, /*Object*/context){
var obj=context || d.global;
for(var i=0, p; obj && (p=parts[i]); i++){
if(i == 0 && d._scopeMap[p]){
p = d._scopeMap[p];
}
obj = (p in obj ? obj[p] : (create ? obj[p]={} : undefined));
}
return obj; // mixed
}
dojo.setObject = function(/*String*/name, /*Object*/value, /*Object?*/context){
// summary:
// Set a property from a dot-separated string, such as "A.B.C"
// description:
// Useful for longer api chains where you have to test each object in
// the chain, or when you have an object reference in string format.
// Objects are created as needed along `path`. Returns the passed
// value if setting is successful or `undefined` if not.
// name:
// Path to a property, in the form "A.B.C".
// context:
// Optional. Object to use as root of path. Defaults to
// `dojo.global`.
// example:
// set the value of `foo.bar.baz`, regardless of whether
// intermediate objects already exist:
// | dojo.setObject("foo.bar.baz", value);
// example:
// without `dojo.setObject`, we often see code like this:
// | // ensure that intermediate objects are available
// | if(!obj["parent"]){ obj.parent = {}; }
// | if(!obj.parent["child"]){ obj.parent.child= {}; }
// | // now we can safely set the property
// | obj.parent.child.prop = "some value";
// wheras with `dojo.setObject`, we can shorten that to:
// | dojo.setObject("parent.child.prop", "some value", obj);
var parts=name.split("."), p=parts.pop(), obj=d._getProp(parts, true, context);
return obj && p ? (obj[p]=value) : undefined; // Object
}
dojo.getObject = function(/*String*/name, /*Boolean?*/create, /*Object?*/context){
// summary:
// Get a property from a dot-separated string, such as "A.B.C"
// description:
// Useful for longer api chains where you have to test each object in
// the chain, or when you have an object reference in string format.
// name:
// Path to an property, in the form "A.B.C".
// create:
// Optional. Defaults to `false`. If `true`, Objects will be
// created at any point along the 'path' that is undefined.
// context:
// Optional. Object to use as root of path. Defaults to
// 'dojo.global'. Null may be passed.
return d._getProp(name.split("."), create, context); // Object
}
dojo.exists = function(/*String*/name, /*Object?*/obj){
// summary:
// determine if an object supports a given method
// description:
// useful for longer api chains where you have to test each object in
// the chain. Useful only for object and method detection.
// Not useful for testing generic properties on an object.
// In particular, dojo.exists("foo.bar") when foo.bar = ""
// will return false. Use ("bar" in foo) to test for those cases.
// name:
// Path to an object, in the form "A.B.C".
// obj:
// Object to use as root of path. Defaults to
// 'dojo.global'. Null may be passed.
// example:
// | // define an object
// | var foo = {
// | bar: { }
// | };
// |
// | // search the global scope
// | dojo.exists("foo.bar"); // true
// | dojo.exists("foo.bar.baz"); // false
// |
// | // search from a particular scope
// | dojo.exists("bar", foo); // true
// | dojo.exists("bar.baz", foo); // false
return !!d.getObject(name, false, obj); // Boolean
}
dojo["eval"] = function(/*String*/ scriptFragment){
// summary:
// A legacy method created for use exclusively by internal Dojo methods. Do not use
// this method directly, the behavior of this eval will differ from the normal
// browser eval.
// description:
// Placed in a separate function to minimize size of trapped
// exceptions. Calling eval() directly from some other scope may
// complicate tracebacks on some platforms.
// returns:
// The result of the evaluation. Often `undefined`
return d.global.eval ? d.global.eval(scriptFragment) : eval(scriptFragment); // Object
}
/*=====
dojo.deprecated = function(behaviour, extra, removal){
// summary:
// Log a debug message to indicate that a behavior has been
// deprecated.
// behaviour: String
// The API or behavior being deprecated. Usually in the form
// of "myApp.someFunction()".
// extra: String?
// Text to append to the message. Often provides advice on a
// new function or facility to achieve the same goal during
// the deprecation period.
// removal: String?
// Text to indicate when in the future the behavior will be
// removed. Usually a version number.
// example:
// | dojo.deprecated("myApp.getTemp()", "use myApp.getLocaleTemp() instead", "1.0");
}
dojo.experimental = function(moduleName, extra){
// summary: Marks code as experimental.
// description:
// This can be used to mark a function, file, or module as
// experimental. Experimental code is not ready to be used, and the
// APIs are subject to change without notice. Experimental code may be
// completed deleted without going through the normal deprecation
// process.
// moduleName: String
// The name of a module, or the name of a module file or a specific
// function
// extra: String?
// some additional message for the user
// example:
// | dojo.experimental("dojo.data.Result");
// example:
// | dojo.experimental("dojo.weather.toKelvin()", "PENDING approval from NOAA");
}
=====*/
//Real functions declared in dojo._firebug.firebug.
d.deprecated = d.experimental = function(){};
})();
// vim:ai:ts=4:noet

@ -5,240 +5,470 @@
*/
if(typeof window!="undefined"){
dojo.isBrowser=true;
dojo._name="browser";
(function(){
var d=dojo;
if(document&&document.getElementsByTagName){
var _1=document.getElementsByTagName("script");
var _2=/dojo(\.xd)?\.js(\W|$)/i;
for(var i=0;i<_1.length;i++){
var _3=_1[i].getAttribute("src");
if(!_3){
continue;
}
var m=_3.match(_2);
if(m){
if(!d.config.baseUrl){
d.config.baseUrl=_3.substring(0,m.index);
}
var _4=_1[i].getAttribute("djConfig");
if(_4){
var _5=eval("({ "+_4+" })");
for(var x in _5){
dojo.config[x]=_5[x];
}
}
break;
}
}
}
d.baseUrl=d.config.baseUrl;
var n=navigator;
var _6=n.userAgent,_7=n.appVersion,tv=parseFloat(_7);
if(_6.indexOf("Opera")>=0){
d.isOpera=tv;
}
if(_6.indexOf("AdobeAIR")>=0){
d.isAIR=1;
}
d.isKhtml=(_7.indexOf("Konqueror")>=0)?tv:0;
d.isWebKit=parseFloat(_6.split("WebKit/")[1])||undefined;
d.isChrome=parseFloat(_6.split("Chrome/")[1])||undefined;
d.isMac=_7.indexOf("Macintosh")>=0;
var _8=Math.max(_7.indexOf("WebKit"),_7.indexOf("Safari"),0);
if(_8&&!dojo.isChrome){
d.isSafari=parseFloat(_7.split("Version/")[1]);
if(!d.isSafari||parseFloat(_7.substr(_8+7))<=419.3){
d.isSafari=2;
}
}
if(_6.indexOf("Gecko")>=0&&!d.isKhtml&&!d.isWebKit){
d.isMozilla=d.isMoz=tv;
}
if(d.isMoz){
d.isFF=parseFloat(_6.split("Firefox/")[1]||_6.split("Minefield/")[1])||undefined;
}
if(document.all&&!d.isOpera){
d.isIE=parseFloat(_7.split("MSIE ")[1])||undefined;
var _9=document.documentMode;
if(_9&&_9!=5&&Math.floor(d.isIE)!=_9){
d.isIE=_9;
}
}
if(dojo.isIE&&window.location.protocol==="file:"){
dojo.config.ieForceActiveXXhr=true;
}
d.isQuirks=document.compatMode=="BackCompat";
d.locale=dojo.config.locale||(d.isIE?n.userLanguage:n.language).toLowerCase();
d._XMLHTTP_PROGIDS=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];
d._xhrObj=function(){
var _a,_b;
if(!dojo.isIE||!dojo.config.ieForceActiveXXhr){
try{
_a=new XMLHttpRequest();
}
catch(e){
}
}
if(!_a){
for(var i=0;i<3;++i){
var _c=d._XMLHTTP_PROGIDS[i];
try{
_a=new ActiveXObject(_c);
}
catch(e){
_b=e;
}
if(_a){
d._XMLHTTP_PROGIDS=[_c];
break;
}
}
}
if(!_a){
throw new Error("XMLHTTP not available: "+_b);
}
return _a;
};
d._isDocumentOk=function(_d){
var _e=_d.status||0,lp=location.protocol;
return (_e>=200&&_e<300)||_e==304||_e==1223||(!_e&&(lp=="file:"||lp=="chrome:"||lp=="chrome-extension:"||lp=="app:"));
};
var _f=window.location+"";
var _10=document.getElementsByTagName("base");
var _11=(_10&&_10.length>0);
d._getText=function(uri,_12){
var _13=d._xhrObj();
if(!_11&&dojo._Url){
uri=(new dojo._Url(_f,uri)).toString();
}
if(d.config.cacheBust){
uri+="";
uri+=(uri.indexOf("?")==-1?"?":"&")+String(d.config.cacheBust).replace(/\W+/g,"");
}
_13.open("GET",uri,false);
try{
_13.send(null);
if(!d._isDocumentOk(_13)){
var err=Error("Unable to load "+uri+" status:"+_13.status);
err.status=_13.status;
err.responseText=_13.responseText;
throw err;
}
}
catch(e){
if(_12){
return null;
}
throw e;
}
return _13.responseText;
};
var _14=window;
var _15=function(_16,fp){
var _17=_14.attachEvent||_14.addEventListener;
_16=_14.attachEvent?_16:_16.substring(2);
_17(_16,function(){
fp.apply(_14,arguments);
},false);
/*=====
dojo.isBrowser = {
// example:
// | if(dojo.isBrowser){ ... }
};
d._windowUnloaders=[];
d.windowUnloaded=function(){
var mll=d._windowUnloaders;
while(mll.length){
(mll.pop())();
}
d=null;
};
var _18=0;
d.addOnWindowUnload=function(obj,_19){
d._onto(d._windowUnloaders,obj,_19);
if(!_18){
_18=1;
_15("onunload",d.windowUnloaded);
}
dojo.isFF = {
// example:
// | if(dojo.isFF > 1){ ... }
};
var _1a=0;
d.addOnUnload=function(obj,_1b){
d._onto(d._unloaders,obj,_1b);
if(!_1a){
_1a=1;
_15("onbeforeunload",dojo.unloaded);
}
dojo.isIE = {
// example:
// | if(dojo.isIE > 6){
// | // we are IE7
// | }
};
})();
dojo._initFired=false;
dojo._loadInit=function(e){
if(dojo._scrollIntervalId){
clearInterval(dojo._scrollIntervalId);
dojo._scrollIntervalId=0;
}
if(!dojo._initFired){
dojo._initFired=true;
if(!dojo.config.afterOnLoad&&window.detachEvent){
window.detachEvent("onload",dojo._loadInit);
}
if(dojo._inFlightCount==0){
dojo._modulesLoaded();
}
}
dojo.isSafari = {
// example:
// | if(dojo.isSafari){ ... }
// example:
// Detect iPhone:
// | if(dojo.isSafari && navigator.userAgent.indexOf("iPhone") != -1){
// | // we are iPhone. Note, iPod touch reports "iPod" above and fails this test.
// | }
};
if(!dojo.config.afterOnLoad){
if(document.addEventListener){
document.addEventListener("DOMContentLoaded",dojo._loadInit,false);
window.addEventListener("load",dojo._loadInit,false);
}else{
if(window.attachEvent){
window.attachEvent("onload",dojo._loadInit);
if(!dojo.config.skipIeDomLoaded&&self===self.top){
dojo._scrollIntervalId=setInterval(function(){
try{
if(document.body){
document.documentElement.doScroll("left");
dojo._loadInit();
}
}
catch(e){
}
},30);
}
}
}
}
if(dojo.isIE){
try{
(function(){
document.namespaces.add("v","urn:schemas-microsoft-com:vml");
var _1c=["*","group","roundrect","oval","shape","rect","imagedata","path","textpath","text"],i=0,l=1,s=document.createStyleSheet();
if(dojo.isIE>=8){
i=1;
l=_1c.length;
}
for(;i<l;++i){
s.addRule("v\\:"+_1c[i],"behavior:url(#default#VML); display:inline-block");
}
})();
}
catch(e){
}
}
}
dojo = {
// isBrowser: Boolean
// True if the client is a web-browser
isBrowser: true,
// isFF: Number | undefined
// Version as a Number if client is FireFox. undefined otherwise. Corresponds to
// major detected FireFox version (1.5, 2, 3, etc.)
isFF: 2,
// isIE: Number | undefined
// Version as a Number if client is MSIE(PC). undefined otherwise. Corresponds to
// major detected IE version (6, 7, 8, etc.)
isIE: 6,
// isKhtml: Number | undefined
// Version as a Number if client is a KHTML browser. undefined otherwise. Corresponds to major
// detected version.
isKhtml: 0,
// isWebKit: Number | undefined
// Version as a Number if client is a WebKit-derived browser (Konqueror,
// Safari, Chrome, etc.). undefined otherwise.
isWebKit: 0,
// isMozilla: Number | undefined
// Version as a Number if client is a Mozilla-based browser (Firefox,
// SeaMonkey). undefined otherwise. Corresponds to major detected version.
isMozilla: 0,
// isOpera: Number | undefined
// Version as a Number if client is Opera. undefined otherwise. Corresponds to
// major detected version.
isOpera: 0,
// isSafari: Number | undefined
// Version as a Number if client is Safari or iPhone. undefined otherwise.
isSafari: 0,
// isChrome: Number | undefined
// Version as a Number if client is Chrome browser. undefined otherwise.
isChrome: 0
// isMac: Boolean
// True if the client runs on Mac
}
=====*/
if(typeof window != 'undefined'){
dojo.isBrowser = true;
dojo._name = "browser";
// attempt to figure out the path to dojo if it isn't set in the config
(function(){
var d = dojo;
// this is a scope protection closure. We set browser versions and grab
// the URL we were loaded from here.
// grab the node we were loaded from
if(document && document.getElementsByTagName){
var scripts = document.getElementsByTagName("script");
var rePkg = /dojo(\.xd)?\.js(\W|$)/i;
for(var i = 0; i < scripts.length; i++){
var src = scripts[i].getAttribute("src");
if(!src){ continue; }
var m = src.match(rePkg);
if(m){
// find out where we came from
if(!d.config.baseUrl){
d.config.baseUrl = src.substring(0, m.index);
}
// and find out if we need to modify our behavior
var cfg = scripts[i].getAttribute("djConfig");
if(cfg){
var cfgo = eval("({ "+cfg+" })");
for(var x in cfgo){
dojo.config[x] = cfgo[x];
}
}
break; // "first Dojo wins"
}
}
}
d.baseUrl = d.config.baseUrl;
// fill in the rendering support information in dojo.render.*
var n = navigator;
var dua = n.userAgent,
dav = n.appVersion,
tv = parseFloat(dav);
if(dua.indexOf("Opera") >= 0){ d.isOpera = tv; }
if(dua.indexOf("AdobeAIR") >= 0){ d.isAIR = 1; }
d.isKhtml = (dav.indexOf("Konqueror") >= 0) ? tv : 0;
d.isWebKit = parseFloat(dua.split("WebKit/")[1]) || undefined;
d.isChrome = parseFloat(dua.split("Chrome/")[1]) || undefined;
d.isMac = dav.indexOf("Macintosh") >= 0;
// safari detection derived from:
// http://developer.apple.com/internet/safari/faq.html#anchor2
// http://developer.apple.com/internet/safari/uamatrix.html
var index = Math.max(dav.indexOf("WebKit"), dav.indexOf("Safari"), 0);
if(index && !dojo.isChrome){
// try to grab the explicit Safari version first. If we don't get
// one, look for less than 419.3 as the indication that we're on something
// "Safari 2-ish".
d.isSafari = parseFloat(dav.split("Version/")[1]);
if(!d.isSafari || parseFloat(dav.substr(index + 7)) <= 419.3){
d.isSafari = 2;
}
}
if(dua.indexOf("Gecko") >= 0 && !d.isKhtml && !d.isWebKit){ d.isMozilla = d.isMoz = tv; }
if(d.isMoz){
//We really need to get away from this. Consider a sane isGecko approach for the future.
d.isFF = parseFloat(dua.split("Firefox/")[1] || dua.split("Minefield/")[1]) || undefined;
}
if(document.all && !d.isOpera){
d.isIE = parseFloat(dav.split("MSIE ")[1]) || undefined;
//In cases where the page has an HTTP header or META tag with
//X-UA-Compatible, then it is in emulation mode.
//Make sure isIE reflects the desired version.
//document.documentMode of 5 means quirks mode.
//Only switch the value if documentMode's major version
//is different from isIE's major version.
var mode = document.documentMode;
if(mode && mode != 5 && Math.floor(d.isIE) != mode){
d.isIE = mode;
}
}
//Workaround to get local file loads of dojo to work on IE 7
//by forcing to not use native xhr.
if(dojo.isIE && window.location.protocol === "file:"){
dojo.config.ieForceActiveXXhr=true;
}
d.isQuirks = document.compatMode == "BackCompat";
// TODO: is the HTML LANG attribute relevant?
d.locale = dojo.config.locale || (d.isIE ? n.userLanguage : n.language).toLowerCase();
// These are in order of decreasing likelihood; this will change in time.
d._XMLHTTP_PROGIDS = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'];
d._xhrObj = function(){
// summary:
// does the work of portably generating a new XMLHTTPRequest object.
var http, last_e;
if(!dojo.isIE || !dojo.config.ieForceActiveXXhr){
try{ http = new XMLHttpRequest(); }catch(e){}
}
if(!http){
for(var i=0; i<3; ++i){
var progid = d._XMLHTTP_PROGIDS[i];
try{
http = new ActiveXObject(progid);
}catch(e){
last_e = e;
}
if(http){
d._XMLHTTP_PROGIDS = [progid]; // so faster next time
break;
}
}
}
if(!http){
throw new Error("XMLHTTP not available: "+last_e);
}
return http; // XMLHTTPRequest instance
}
d._isDocumentOk = function(http){
var stat = http.status || 0,
lp = location.protocol;
return (stat >= 200 && stat < 300) || // Boolean
stat == 304 || // allow any 2XX response code
stat == 1223 || // get it out of the cache
// Internet Explorer mangled the status code OR we're Titanium/browser chrome/chrome extension requesting a local file
(!stat && (lp == "file:" || lp == "chrome:" || lp == "chrome-extension:" || lp == "app:") );
}
//See if base tag is in use.
//This is to fix http://trac.dojotoolkit.org/ticket/3973,
//but really, we need to find out how to get rid of the dojo._Url reference
//below and still have DOH work with the dojo.i18n test following some other
//test that uses the test frame to load a document (trac #2757).
//Opera still has problems, but perhaps a larger issue of base tag support
//with XHR requests (hasBase is true, but the request is still made to document
//path, not base path).
var owloc = window.location+"";
var base = document.getElementsByTagName("base");
var hasBase = (base && base.length > 0);
d._getText = function(/*URI*/ uri, /*Boolean*/ fail_ok){
// summary: Read the contents of the specified uri and return those contents.
// uri:
// A relative or absolute uri. If absolute, it still must be in
// the same "domain" as we are.
// fail_ok:
// Default false. If fail_ok and loading fails, return null
// instead of throwing.
// returns: The response text. null is returned when there is a
// failure and failure is okay (an exception otherwise)
// NOTE: must be declared before scope switches ie. this._xhrObj()
var http = d._xhrObj();
if(!hasBase && dojo._Url){
uri = (new dojo._Url(owloc, uri)).toString();
}
if(d.config.cacheBust){
//Make sure we have a string before string methods are used on uri
uri += "";
uri += (uri.indexOf("?") == -1 ? "?" : "&") + String(d.config.cacheBust).replace(/\W+/g,"");
}
http.open('GET', uri, false);
try{
http.send(null);
if(!d._isDocumentOk(http)){
var err = Error("Unable to load "+uri+" status:"+ http.status);
err.status = http.status;
err.responseText = http.responseText;
throw err;
}
}catch(e){
if(fail_ok){ return null; } // null
// rethrow the exception
throw e;
}
return http.responseText; // String
}
var _w = window;
var _handleNodeEvent = function(/*String*/evtName, /*Function*/fp){
// summary:
// non-destructively adds the specified function to the node's
// evtName handler.
// evtName: should be in the form "onclick" for "onclick" handlers.
// Make sure you pass in the "on" part.
var _a = _w.attachEvent || _w.addEventListener;
evtName = _w.attachEvent ? evtName : evtName.substring(2);
_a(evtName, function(){
fp.apply(_w, arguments);
}, false);
};
d._windowUnloaders = [];
d.windowUnloaded = function(){
// summary:
// signal fired by impending window destruction. You may use
// dojo.addOnWindowUnload() to register a listener for this
// event. NOTE: if you wish to dojo.connect() to this method
// to perform page/application cleanup, be aware that this
// event WILL NOT fire if no handler has been registered with
// dojo.addOnWindowUnload. This behavior started in Dojo 1.3.
// Previous versions always triggered dojo.windowUnloaded. See
// dojo.addOnWindowUnload for more info.
var mll = d._windowUnloaders;
while(mll.length){
(mll.pop())();
}
d = null;
};
var _onWindowUnloadAttached = 0;
d.addOnWindowUnload = function(/*Object?|Function?*/obj, /*String|Function?*/functionName){
// summary:
// registers a function to be triggered when window.onunload
// fires.
// description:
// The first time that addOnWindowUnload is called Dojo
// will register a page listener to trigger your unload
// handler with. Note that registering these handlers may
// destory "fastback" page caching in browsers that support
// it. Be careful trying to modify the DOM or access
// JavaScript properties during this phase of page unloading:
// they may not always be available. Consider
// dojo.addOnUnload() if you need to modify the DOM or do
// heavy JavaScript work since it fires at the eqivalent of
// the page's "onbeforeunload" event.
// example:
// | dojo.addOnWindowUnload(functionPointer)
// | dojo.addOnWindowUnload(object, "functionName");
// | dojo.addOnWindowUnload(object, function(){ /* ... */});
d._onto(d._windowUnloaders, obj, functionName);
if(!_onWindowUnloadAttached){
_onWindowUnloadAttached = 1;
_handleNodeEvent("onunload", d.windowUnloaded);
}
};
var _onUnloadAttached = 0;
d.addOnUnload = function(/*Object?|Function?*/obj, /*String|Function?*/functionName){
// summary:
// registers a function to be triggered when the page unloads.
// description:
// The first time that addOnUnload is called Dojo will
// register a page listener to trigger your unload handler
// with.
//
// In a browser enviroment, the functions will be triggered
// during the window.onbeforeunload event. Be careful of doing
// too much work in an unload handler. onbeforeunload can be
// triggered if a link to download a file is clicked, or if
// the link is a javascript: link. In these cases, the
// onbeforeunload event fires, but the document is not
// actually destroyed. So be careful about doing destructive
// operations in a dojo.addOnUnload callback.
//
// Further note that calling dojo.addOnUnload will prevent
// browsers from using a "fast back" cache to make page
// loading via back button instantaneous.
// example:
// | dojo.addOnUnload(functionPointer)
// | dojo.addOnUnload(object, "functionName")
// | dojo.addOnUnload(object, function(){ /* ... */});
d._onto(d._unloaders, obj, functionName);
if(!_onUnloadAttached){
_onUnloadAttached = 1;
_handleNodeEvent("onbeforeunload", dojo.unloaded);
}
};
})();
//START DOMContentLoaded
dojo._initFired = false;
dojo._loadInit = function(e){
if(dojo._scrollIntervalId){
clearInterval(dojo._scrollIntervalId);
dojo._scrollIntervalId = 0;
}
if(!dojo._initFired){
dojo._initFired = true;
//Help out IE to avoid memory leak.
if(!dojo.config.afterOnLoad && window.detachEvent){
window.detachEvent("onload", dojo._loadInit);
}
if(dojo._inFlightCount == 0){
dojo._modulesLoaded();
}
}
}
if(!dojo.config.afterOnLoad){
if(document.addEventListener){
//Standards. Hooray! Assumption here that if standards based,
//it knows about DOMContentLoaded. It is OK if it does not, the fall through
//to window onload should be good enough.
document.addEventListener("DOMContentLoaded", dojo._loadInit, false);
window.addEventListener("load", dojo._loadInit, false);
}else if(window.attachEvent){
window.attachEvent("onload", dojo._loadInit);
//DOMContentLoaded approximation. Diego Perini found this MSDN article
//that indicates doScroll is available after DOM ready, so do a setTimeout
//to check when it is available.
//http://msdn.microsoft.com/en-us/library/ms531426.aspx
if(!dojo.config.skipIeDomLoaded && self === self.top){
dojo._scrollIntervalId = setInterval(function (){
try{
//When dojo is loaded into an iframe in an IE HTML Application
//(HTA), such as in a selenium test, javascript in the iframe
//can't see anything outside of it, so self===self.top is true,
//but the iframe is not the top window and doScroll will be
//available before document.body is set. Test document.body
//before trying the doScroll trick
if(document.body){
document.documentElement.doScroll("left");
dojo._loadInit();
}
}catch (e){}
}, 30);
}
}
}
if(dojo.isIE){
try{
(function(){
document.namespaces.add("v", "urn:schemas-microsoft-com:vml");
var vmlElems = ["*", "group", "roundrect", "oval", "shape", "rect", "imagedata", "path", "textpath", "text"],
i = 0, l = 1, s = document.createStyleSheet();
if(dojo.isIE >= 8){
i = 1;
l = vmlElems.length;
}
for(; i < l; ++i){
s.addRule("v\\:" + vmlElems[i], "behavior:url(#default#VML); display:inline-block");
}
})();
}catch(e){}
}
//END DOMContentLoaded
/*
OpenAjax.subscribe("OpenAjax", "onload", function(){
if(dojo._inFlightCount == 0){
dojo._modulesLoaded();
}
});
OpenAjax.subscribe("OpenAjax", "onunload", function(){
dojo.unloaded();
});
*/
} //if (typeof window != 'undefined')
//Register any module paths set up in djConfig. Need to do this
//in the hostenvs since hostenv_browser can read djConfig from a
//script tag's attribute.
(function(){
var mp=dojo.config["modulePaths"];
if(mp){
for(var _1d in mp){
dojo.registerModulePath(_1d,mp[_1d]);
}
}
var mp = dojo.config["modulePaths"];
if(mp){
for(var param in mp){
dojo.registerModulePath(param, mp[param]);
}
}
})();
//Load debug code if necessary.
if(dojo.config.isDebug){
dojo.require("dojo._firebug.firebug");
dojo.require("dojo._firebug.firebug");
}
if(dojo.config.debugAtAllCosts){
dojo.config.useXDomain=true;
dojo.require("dojo._base._loader.loader_xd");
dojo.require("dojo._base._loader.loader_debug");
dojo.require("dojo.i18n");
dojo.config.useXDomain = true;
dojo.require("dojo._base._loader.loader_xd");
dojo.require("dojo._base._loader.loader_debug");
dojo.require("dojo.i18n");
}

@ -5,171 +5,334 @@
*/
if(typeof window!="undefined"){
dojo.isBrowser=true;
dojo._name="browser";
(function(){
var d=dojo;
d.baseUrl=d.config.baseUrl;
var n=navigator;
var _1=n.userAgent;
var _2=n.appVersion;
var tv=parseFloat(_2);
d.isMozilla=d.isMoz=tv;
if(d.isMoz){
d.isFF=parseFloat(_1.split("Firefox/")[1])||undefined;
}
d.isQuirks=document.compatMode=="BackCompat";
d.locale=dojo.config.locale||n.language.toLowerCase();
d._xhrObj=function(){
return new XMLHttpRequest();
};
var _3=d._loadUri;
d._loadUri=function(_4,cb){
var _5=["file:","chrome:","resource:"].some(function(_6){
return String(_4).indexOf(_6)==0;
});
if(_5){
var l=Components.classes["@mozilla.org/moz/jssubscript-loader;1"].getService(Components.interfaces.mozIJSSubScriptLoader);
var _7=l.loadSubScript(_4,d.global);
if(cb){
cb(_7);
}
return true;
}else{
return _3.apply(d,arguments);
}
};
d._isDocumentOk=function(_8){
var _9=_8.status||0;
return (_9>=200&&_9<300)||_9==304||_9==1223||(!_9&&(location.protocol=="file:"||location.protocol=="chrome:"));
};
var _a=false;
d._getText=function(_b,_c){
var _d=d._xhrObj();
if(!_a&&dojo._Url){
_b=(new dojo._Url(_b)).toString();
}
if(d.config.cacheBust){
_b+="";
_b+=(_b.indexOf("?")==-1?"?":"&")+String(d.config.cacheBust).replace(/\W+/g,"");
}
var _e=["file:","chrome:","resource:"].some(function(_f){
return String(_b).indexOf(_f)==0;
});
if(_e){
var _10=Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);
var _11=Components.classes["@mozilla.org/scriptableinputstream;1"].getService(Components.interfaces.nsIScriptableInputStream);
var _12=_10.newChannel(_b,null,null);
var _13=_12.open();
_11.init(_13);
var str=_11.read(_13.available());
_11.close();
_13.close();
return str;
}else{
_d.open("GET",_b,false);
try{
_d.send(null);
if(!d._isDocumentOk(_d)){
var err=Error("Unable to load "+_b+" status:"+_d.status);
err.status=_d.status;
err.responseText=_d.responseText;
throw err;
}
}
catch(e){
if(_c){
return null;
}
throw e;
}
return _d.responseText;
}
};
d._windowUnloaders=[];
d.windowUnloaded=function(){
var mll=d._windowUnloaders;
while(mll.length){
(mll.pop())();
}
};
d.addOnWindowUnload=function(obj,_14){
d._onto(d._windowUnloaders,obj,_14);
};
var _15=[];
var _16=null;
dojo._defaultContext=[window,document];
dojo.pushContext=function(g,d){
var old=[dojo.global,dojo.doc];
_15.push(old);
var n;
if(!g&&!d){
n=dojo._defaultContext;
}else{
n=[g,d];
if(!d&&dojo.isString(g)){
var t=document.getElementById(g);
if(t.contentDocument){
n=[t.contentWindow,t.contentDocument];
}
}
}
_16=n;
dojo.setContext.apply(dojo,n);
return old;
};
dojo.popContext=function(){
var oc=_16;
if(!_15.length){
return oc;
}
dojo.setContext.apply(dojo,_15.pop());
return oc;
};
dojo._inContext=function(g,d,f){
var a=dojo._toArray(arguments);
f=a.pop();
if(a.length==1){
d=null;
}
dojo.pushContext(g,d);
var r=f();
dojo.popContext();
return r;
};
})();
dojo._initFired=false;
dojo._loadInit=function(e){
dojo._initFired=true;
var _17=(e&&e.type)?e.type.toLowerCase():"load";
if(arguments.callee.initialized||(_17!="domcontentloaded"&&_17!="load")){
return;
}
arguments.callee.initialized=true;
if(dojo._inFlightCount==0){
dojo._modulesLoaded();
}
};
if(!dojo.config.afterOnLoad){
window.addEventListener("DOMContentLoaded",function(e){
dojo._loadInit(e);
},false);
}
}
// a host environment specifically built for Mozilla extensions, but derived
// from the browser host environment
if(typeof window != 'undefined'){
dojo.isBrowser = true;
dojo._name = "browser";
// FIXME: PORTME
// http://developer.mozilla.org/en/mozIJSSubScriptLoader
// attempt to figure out the path to dojo if it isn't set in the config
(function(){
var d = dojo;
// this is a scope protection closure. We set browser versions and grab
// the URL we were loaded from here.
// FIXME: need to probably use a different reference to "document" to get the hosting XUL environment
d.baseUrl = d.config.baseUrl;
// fill in the rendering support information in dojo.render.*
var n = navigator;
var dua = n.userAgent;
var dav = n.appVersion;
var tv = parseFloat(dav);
d.isMozilla = d.isMoz = tv;
if(d.isMoz){
d.isFF = parseFloat(dua.split("Firefox/")[1]) || undefined;
}
// FIXME
d.isQuirks = document.compatMode == "BackCompat";
// FIXME
// TODO: is the HTML LANG attribute relevant?
d.locale = dojo.config.locale || n.language.toLowerCase();
d._xhrObj = function(){
return new XMLHttpRequest();
}
// monkey-patch _loadUri to handle file://, chrome://, and resource:// url's
var oldLoadUri = d._loadUri;
d._loadUri = function(uri, cb){
var handleLocal = ["file:", "chrome:", "resource:"].some(function(prefix){
return String(uri).indexOf(prefix) == 0;
});
if(handleLocal){
// see:
// http://developer.mozilla.org/en/mozIJSSubScriptLoader
var l = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
var value = l.loadSubScript(uri, d.global)
if(cb){ cb(value); }
return true;
}else{
// otherwise, call the pre-existing version
return oldLoadUri.apply(d, arguments);
}
}
// FIXME: PORTME
d._isDocumentOk = function(http){
var stat = http.status || 0;
return (stat >= 200 && stat < 300) || // Boolean
stat == 304 || // allow any 2XX response code
stat == 1223 || // get it out of the cache
(!stat && (location.protocol=="file:" || location.protocol=="chrome:") );
}
// FIXME: PORTME
// var owloc = window.location+"";
// var base = document.getElementsByTagName("base");
// var hasBase = (base && base.length > 0);
var hasBase = false;
d._getText = function(/*URI*/ uri, /*Boolean*/ fail_ok){
// summary: Read the contents of the specified uri and return those contents.
// uri:
// A relative or absolute uri. If absolute, it still must be in
// the same "domain" as we are.
// fail_ok:
// Default false. If fail_ok and loading fails, return null
// instead of throwing.
// returns: The response text. null is returned when there is a
// failure and failure is okay (an exception otherwise)
// alert("_getText: " + uri);
// NOTE: must be declared before scope switches ie. this._xhrObj()
var http = d._xhrObj();
if(!hasBase && dojo._Url){
uri = (new dojo._Url(uri)).toString();
}
if(d.config.cacheBust){
//Make sure we have a string before string methods are used on uri
uri += "";
uri += (uri.indexOf("?") == -1 ? "?" : "&") + String(d.config.cacheBust).replace(/\W+/g,"");
}
var handleLocal = ["file:", "chrome:", "resource:"].some(function(prefix){
return String(uri).indexOf(prefix) == 0;
});
if(handleLocal){
// see:
// http://forums.mozillazine.org/viewtopic.php?p=921150#921150
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
var scriptableStream=Components
.classes["@mozilla.org/scriptableinputstream;1"]
.getService(Components.interfaces.nsIScriptableInputStream);
var channel = ioService.newChannel(uri, null, null);
var input = channel.open();
scriptableStream.init(input);
var str = scriptableStream.read(input.available());
scriptableStream.close();
input.close();
return str;
}else{
http.open('GET', uri, false);
try{
http.send(null);
// alert(http);
if(!d._isDocumentOk(http)){
var err = Error("Unable to load "+uri+" status:"+ http.status);
err.status = http.status;
err.responseText = http.responseText;
throw err;
}
}catch(e){
if(fail_ok){ return null; } // null
// rethrow the exception
throw e;
}
return http.responseText; // String
}
}
d._windowUnloaders = [];
// FIXME: PORTME
d.windowUnloaded = function(){
// summary:
// signal fired by impending window destruction. You may use
// dojo.addOnWIndowUnload() or dojo.connect() to this method to perform
// page/application cleanup methods. See dojo.addOnWindowUnload for more info.
var mll = d._windowUnloaders;
while(mll.length){
(mll.pop())();
}
}
// FIXME: PORTME
d.addOnWindowUnload = function(/*Object?*/obj, /*String|Function?*/functionName){
// summary:
// registers a function to be triggered when window.onunload fires.
// Be careful trying to modify the DOM or access JavaScript properties
// during this phase of page unloading: they may not always be available.
// Consider dojo.addOnUnload() if you need to modify the DOM or do heavy
// JavaScript work.
// example:
// | dojo.addOnWindowUnload(functionPointer)
// | dojo.addOnWindowUnload(object, "functionName")
// | dojo.addOnWindowUnload(object, function(){ /* ... */});
d._onto(d._windowUnloaders, obj, functionName);
}
// XUL specific APIs
var contexts = [];
var current = null;
dojo._defaultContext = [ window, document ];
dojo.pushContext = function(/*Object|String?*/g, /*MDocumentElement?*/d){
// summary:
// causes subsequent calls to Dojo methods to assume the
// passed object and, optionally, document as the default
// scopes to use. A 2-element array of the previous global and
// document are returned.
// description:
// dojo.pushContext treats contexts as a stack. The
// auto-detected contexts which are initially provided using
// dojo.setContext() require authors to keep state in order to
// "return" to a previous context, whereas the
// dojo.pushContext and dojo.popContext methods provide a more
// natural way to augment blocks of code to ensure that they
// execute in a different window or frame without issue. If
// called without any arguments, the default context (the
// context when Dojo is first loaded) is instead pushed into
// the stack. If only a single string is passed, a node in the
// intitial context's document is looked up and its
// contextWindow and contextDocument properties are used as
// the context to push. This means that iframes can be given
// an ID and code can be executed in the scope of the iframe's
// document in subsequent calls easily.
// g:
// The global context. If a string, the id of the frame to
// search for a context and document.
// d:
// The document element to execute subsequent code with.
var old = [dojo.global, dojo.doc];
contexts.push(old);
var n;
if(!g && !d){
n = dojo._defaultContext;
}else{
n = [ g, d ];
if(!d && dojo.isString(g)){
var t = document.getElementById(g);
if(t.contentDocument){
n = [t.contentWindow, t.contentDocument];
}
}
}
current = n;
dojo.setContext.apply(dojo, n);
return old; // Array
};
dojo.popContext = function(){
// summary:
// If the context stack contains elements, ensure that
// subsequent code executes in the *previous* context to the
// current context. The current context set ([global,
// document]) is returned.
var oc = current;
if(!contexts.length){
return oc;
}
dojo.setContext.apply(dojo, contexts.pop());
return oc;
};
// FIXME:
// don't really like the current arguments and order to
// _inContext, so don't make it public until it's right!
dojo._inContext = function(g, d, f){
var a = dojo._toArray(arguments);
f = a.pop();
if(a.length == 1){
d = null;
}
dojo.pushContext(g, d);
var r = f();
dojo.popContext();
return r;
};
})();
dojo._initFired = false;
// BEGIN DOMContentLoaded, from Dean Edwards (http://dean.edwards.name/weblog/2006/06/again/)
dojo._loadInit = function(e){
dojo._initFired = true;
// allow multiple calls, only first one will take effect
// A bug in khtml calls events callbacks for document for event which isnt supported
// for example a created contextmenu event calls DOMContentLoaded, workaround
var type = (e && e.type) ? e.type.toLowerCase() : "load";
if(arguments.callee.initialized || (type != "domcontentloaded" && type != "load")){ return; }
arguments.callee.initialized = true;
if(dojo._inFlightCount == 0){
dojo._modulesLoaded();
}
}
/*
(function(){
var _w = window;
var _handleNodeEvent = function(evtName, fp){
// summary:
// non-destructively adds the specified function to the node's
// evtName handler.
// evtName: should be in the form "onclick" for "onclick" handlers.
// Make sure you pass in the "on" part.
var oldHandler = _w[evtName] || function(){};
_w[evtName] = function(){
fp.apply(_w, arguments);
oldHandler.apply(_w, arguments);
};
};
// FIXME: PORT
// FIXME: dojo.unloaded requires dojo scope, so using anon function wrapper.
_handleNodeEvent("onbeforeunload", function() { dojo.unloaded(); });
_handleNodeEvent("onunload", function() { dojo.windowUnloaded(); });
})();
*/
// FIXME: PORTME
// this event fires a lot, namely for all plugin XUL overlays and for
// all iframes (in addition to window navigations). We only want
// Dojo's to fire once..but we might care if pages navigate. We'll
// probably need an extension-specific API
if(!dojo.config.afterOnLoad){
window.addEventListener("DOMContentLoaded",function(e){
dojo._loadInit(e);
// console.log("DOM content loaded", e);
}, false);
}
} //if (typeof window != 'undefined')
//Register any module paths set up in djConfig. Need to do this
//in the hostenvs since hostenv_browser can read djConfig from a
//script tag's attribute.
(function(){
var mp=dojo.config["modulePaths"];
if(mp){
for(var _18 in mp){
dojo.registerModulePath(_18,mp[_18]);
}
}
var mp = dojo.config["modulePaths"];
if(mp){
for(var param in mp){
dojo.registerModulePath(param, mp[param]);
}
}
})();
//Load debug code if necessary.
if(dojo.config.isDebug){
console.log=function(m){
var s=Components.classes["@mozilla.org/consoleservice;1"].getService(Components.interfaces.nsIConsoleService);
s.logStringMessage(m);
};
console.debug=function(){
};
// logging stub for extension logging
console.log = function(m){
var s = Components.classes["@mozilla.org/consoleservice;1"].getService(
Components.interfaces.nsIConsoleService
);
s.logStringMessage(m);
}
console.debug = function(){
console.log(dojo._toArray(arguments).join(" "));
}
// FIXME: what about the rest of the console.* methods? And is there any way to reach into firebug and log into it directly?
}

@ -5,149 +5,204 @@
*/
/*
* Rhino host environment
*/
if(dojo.config["baseUrl"]){
dojo.baseUrl=dojo.config["baseUrl"];
dojo.baseUrl = dojo.config["baseUrl"];
}else{
dojo.baseUrl="./";
dojo.baseUrl = "./";
}
dojo.locale=dojo.locale||String(java.util.Locale.getDefault().toString().replace("_","-").toLowerCase());
dojo._name="rhino";
dojo.isRhino=true;
if(typeof print=="function"){
console.debug=print;
dojo.locale = dojo.locale || String(java.util.Locale.getDefault().toString().replace('_','-').toLowerCase());
dojo._name = 'rhino';
dojo.isRhino = true;
if(typeof print == "function"){
console.debug = print;
}
if(!("byId" in dojo)){
dojo.byId=function(id,_1){
if(id&&(typeof id=="string"||id instanceof String)){
if(!_1){
_1=document;
}
return _1.getElementById(id);
}
return id;
};
}
dojo._isLocalUrl=function(_2){
var _3=(new java.io.File(_2)).exists();
if(!_3){
var _4;
try{
_4=(new java.net.URL(_2)).openStream();
_4.close();
}
finally{
if(_4&&_4.close){
_4.close();
}
}
}
return _3;
};
dojo._loadUri=function(_5,cb){
try{
var _6;
try{
_6=dojo._isLocalUrl(_5);
}
catch(e){
return false;
}
if(cb){
var _7=(_6?readText:readUri)(_5,"UTF-8");
if(!eval("''").length){
_7=String(_7).replace(/[\u200E\u200F\u202A-\u202E]/g,function(_8){
return "\\u"+_8.charCodeAt(0).toString(16);
});
}
cb(eval("("+_7+")"));
}else{
load(_5);
}
return true;
}
catch(e){
return false;
}
};
dojo.exit=function(_9){
quit(_9);
};
function readText(_a,_b){
_b=_b||"utf-8";
var jf=new java.io.File(_a);
var is=new java.io.FileInputStream(jf);
return dj_readInputStream(is,_b);
};
function readUri(_c,_d){
var _e=(new java.net.URL(_c)).openConnection();
_d=_d||_e.getContentEncoding()||"utf-8";
var is=_e.getInputStream();
return dj_readInputStream(is,_d);
};
function dj_readInputStream(is,_f){
var _10=new java.io.BufferedReader(new java.io.InputStreamReader(is,_f));
try{
var sb=new java.lang.StringBuffer();
var _11="";
while((_11=_10.readLine())!==null){
sb.append(_11);
sb.append(java.lang.System.getProperty("line.separator"));
}
return sb.toString();
}
finally{
_10.close();
dojo.byId = function(id, doc){
if(id && (typeof id == "string" || id instanceof String)){
if(!doc){ doc = document; }
return doc.getElementById(id);
}
return id; // assume it's a node
}
}
};
dojo._getText=function(uri,_12){
try{
var _13=dojo._isLocalUrl(uri);
var _14=(_13?readText:readUri)(uri,"UTF-8");
if(_14!==null){
_14+="";
dojo._isLocalUrl = function(/*String*/ uri) {
// summary:
// determines if URI is local or not.
var local = (new java.io.File(uri)).exists();
if(!local){
var stream;
//Try remote URL. Allow this method to throw,
//but still do cleanup.
try{
// try it as a file first, URL second
stream = (new java.net.URL(uri)).openStream();
// close the stream so we don't leak resources
stream.close();
}finally{
if(stream && stream.close){
stream.close();
}
}
}
return local;
}
return _14;
// see comments in spidermonkey loadUri
dojo._loadUri = function(uri, cb){
try{
var local;
try{
local = dojo._isLocalUrl(uri);
}catch(e){
// no debug output; this failure just means the uri was not found.
return false;
}
//FIXME: Use Rhino 1.6 native readFile/readUrl if available?
if(cb){
var contents = (local ? readText : readUri)(uri, "UTF-8");
// patch up the input to eval until https://bugzilla.mozilla.org/show_bug.cgi?id=471005 is fixed.
if(!eval("'\u200f'").length){
contents = String(contents).replace(/[\u200E\u200F\u202A-\u202E]/g, function(match){
return "\\u" + match.charCodeAt(0).toString(16);
})
}
cb(eval('('+contents+')'));
}else{
load(uri);
}
return true;
}catch(e){
console.debug("rhino load('" + uri + "') failed. Exception: " + e);
return false;
}
}
catch(e){
if(_12){
return null;
}else{
throw e;
dojo.exit = function(exitcode){
quit(exitcode);
}
// reading a file from disk in Java is a humiliating experience by any measure.
// Lets avoid that and just get the freaking text
function readText(path, encoding){
encoding = encoding || "utf-8";
// NOTE: we intentionally avoid handling exceptions, since the caller will
// want to know
var jf = new java.io.File(path);
var is = new java.io.FileInputStream(jf);
return dj_readInputStream(is, encoding);
}
};
dojo.doc=typeof document!="undefined"?document:null;
dojo.body=function(){
return document.body;
};
if(typeof setTimeout=="undefined"||typeof clearTimeout=="undefined"){
dojo._timeouts=[];
clearTimeout=function(idx){
if(!dojo._timeouts[idx]){
return;
function readUri(uri, encoding){
var conn = (new java.net.URL(uri)).openConnection();
encoding = encoding || conn.getContentEncoding() || "utf-8";
var is = conn.getInputStream();
return dj_readInputStream(is, encoding);
}
dojo._timeouts[idx].stop();
};
setTimeout=function(_15,_16){
var def={sleepTime:_16,hasSlept:false,run:function(){
if(!this.hasSlept){
this.hasSlept=true;
java.lang.Thread.currentThread().sleep(this.sleepTime);
function dj_readInputStream(is, encoding){
var input = new java.io.BufferedReader(new java.io.InputStreamReader(is, encoding));
try {
var sb = new java.lang.StringBuffer();
var line = "";
while((line = input.readLine()) !== null){
sb.append(line);
sb.append(java.lang.System.getProperty("line.separator"));
}
return sb.toString();
} finally {
input.close();
}
}
try{
_15();
dojo._getText = function(/*URI*/ uri, /*Boolean*/ fail_ok){
// summary: Read the contents of the specified uri and return those contents.
// uri:
// A relative or absolute uri.
// fail_ok:
// Default false. If fail_ok and loading fails, return null
// instead of throwing.
// returns: The response text. null is returned when there is a
// failure and failure is okay (an exception otherwise)
try{
var local = dojo._isLocalUrl(uri);
var text = (local ? readText : readUri)(uri, "UTF-8");
if(text !== null){
//Force JavaScript string.
text += "";
}
return text;
}catch(e){
if(fail_ok){
return null;
}else{
throw e;
}
}
}
catch(e){
// summary:
// return the document object associated with the dojo.global
dojo.doc = typeof document != "undefined" ? document : null;
dojo.body = function(){
return document.body;
}
}};
var _17=new java.lang.Runnable(def);
var _18=new java.lang.Thread(_17);
_18.start();
return dojo._timeouts.push(_18)-1;
};
// Supply setTimeout/clearTimeout implementations if they aren't already there
// Note: this assumes that we define both if one is not provided... there might
// be a better way to do this if there is a use case where one is defined but
// not the other
if(typeof setTimeout == "undefined" || typeof clearTimeout == "undefined"){
dojo._timeouts = [];
clearTimeout = function(idx){
if(!dojo._timeouts[idx]){ return; }
dojo._timeouts[idx].stop();
}
setTimeout = function(func, delay){
// summary: provides timed callbacks using Java threads
var def={
sleepTime:delay,
hasSlept:false,
run:function(){
if(!this.hasSlept){
this.hasSlept=true;
java.lang.Thread.currentThread().sleep(this.sleepTime);
}
try{
func();
}catch(e){
console.debug("Error running setTimeout thread:" + e);
}
}
};
var runnable = new java.lang.Runnable(def);
var thread = new java.lang.Thread(runnable);
thread.start();
return dojo._timeouts.push(thread)-1;
}
}
//Register any module paths set up in djConfig. Need to do this
//in the hostenvs since hostenv_browser can read djConfig from a
//script tag's attribute.
if(dojo.config["modulePaths"]){
for(var param in dojo.config["modulePaths"]){
dojo.registerModulePath(param,dojo.config["modulePaths"][param]);
}
for(var param in dojo.config["modulePaths"]){
dojo.registerModulePath(param, dojo.config["modulePaths"][param]);
}
}

@ -5,46 +5,83 @@
*/
/*
* SpiderMonkey host environment
*/
if(dojo.config["baseUrl"]){
dojo.baseUrl=dojo.config["baseUrl"];
dojo.baseUrl = dojo.config["baseUrl"];
}else{
dojo.baseUrl="./";
dojo.baseUrl = "./";
}
dojo._name="spidermonkey";
dojo.isSpidermonkey=true;
dojo.exit=function(_1){
quit(_1);
dojo._name = 'spidermonkey';
/*=====
dojo.isSpidermonkey = {
// summary: Detect spidermonkey
};
if(typeof print=="function"){
console.debug=print;
}
if(typeof line2pc=="undefined"){
throw new Error("attempt to use SpiderMonkey host environment when no 'line2pc' global");
=====*/
dojo.isSpidermonkey = true;
dojo.exit = function(exitcode){
quit(exitcode);
}
dojo._spidermonkeyCurrentFile=function(_2){
var s="";
try{
throw Error("whatever");
if(typeof print == "function"){
console.debug = print;
}
catch(e){
s=e.stack;
if(typeof line2pc == 'undefined'){
throw new Error("attempt to use SpiderMonkey host environment when no 'line2pc' global");
}
var _3=s.match(/[^@]*\.js/gi);
if(!_3){
throw Error("could not parse stack string: '"+s+"'");
dojo._spidermonkeyCurrentFile = function(depth){
//
// This is a hack that determines the current script file by parsing a
// generated stack trace (relying on the non-standard "stack" member variable
// of the SpiderMonkey Error object).
//
// If param depth is passed in, it'll return the script file which is that far down
// the stack, but that does require that you know how deep your stack is when you are
// calling.
//
var s = '';
try{
throw Error("whatever");
}catch(e){
s = e.stack;
}
// lines are like: bu_getCurrentScriptURI_spidermonkey("ScriptLoader.js")@burst/Runtime.js:101
var matches = s.match(/[^@]*\.js/gi);
if(!matches){
throw Error("could not parse stack string: '" + s + "'");
}
var fname = (typeof depth != 'undefined' && depth) ? matches[depth + 1] : matches[matches.length - 1];
if(!fname){
throw Error("could not find file name in stack string '" + s + "'");
}
//print("SpiderMonkeyRuntime got fname '" + fname + "' from stack string '" + s + "'");
return fname;
}
var _4=(typeof _2!="undefined"&&_2)?_3[_2+1]:_3[_3.length-1];
if(!_4){
throw Error("could not find file name in stack string '"+s+"'");
// print(dojo._spidermonkeyCurrentFile(0));
dojo._loadUri = function(uri){
// spidermonkey load() evaluates the contents into the global scope (which
// is what we want).
// TODO: sigh, load() does not return a useful value.
// Perhaps it is returning the value of the last thing evaluated?
var ok = load(uri);
// console.log("spidermonkey load(", uri, ") returned ", ok);
return 1;
}
return _4;
};
dojo._loadUri=function(_5){
var ok=load(_5);
return 1;
};
//Register any module paths set up in djConfig. Need to do this
//in the hostenvs since hostenv_browser can read djConfig from a
//script tag's attribute.
if(dojo.config["modulePaths"]){
for(var param in dojo.config["modulePaths"]){
dojo.registerModulePath(param,dojo.config["modulePaths"][param]);
}
for(var param in dojo.config["modulePaths"]){
dojo.registerModulePath(param, dojo.config["modulePaths"][param]);
}
}

File diff suppressed because it is too large Load Diff

@ -5,55 +5,82 @@
*/
if(!dojo._hasResource["dojo._base._loader.loader_debug"]){
dojo._hasResource["dojo._base._loader.loader_debug"]=true;
if(!dojo._hasResource["dojo._base._loader.loader_debug"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo._base._loader.loader_debug"] = true;
dojo.provide("dojo._base._loader.loader_debug");
dojo.nonDebugProvide=dojo.provide;
dojo.provide=function(_1){
var _2=dojo["_xdDebugQueue"];
if(_2&&_2.length>0&&_1==_2["currentResourceName"]){
if(dojo.isAIR){
window.setTimeout(function(){
dojo._xdDebugFileLoaded(_1);
},1);
}else{
window.setTimeout(dojo._scopeName+"._xdDebugFileLoaded('"+_1+"')",1);
}
}
return dojo.nonDebugProvide.apply(dojo,arguments);
};
dojo._xdDebugFileLoaded=function(_3){
if(!dojo._xdDebugScopeChecked){
if(dojo._scopeName!="dojo"){
window.dojo=window[dojo.config.scopeMap[0][1]];
window.dijit=window[dojo.config.scopeMap[1][1]];
window.dojox=window[dojo.config.scopeMap[2][1]];
}
dojo._xdDebugScopeChecked=true;
}
var _4=dojo._xdDebugQueue;
if(_3&&_3==_4.currentResourceName){
_4.shift();
}
if(_4.length==0){
dojo._xdWatchInFlight();
}
if(_4.length==0){
_4.currentResourceName=null;
for(var _5 in dojo._xdInFlight){
if(dojo._xdInFlight[_5]===true){
return;
}
}
dojo._xdNotifyLoaded();
}else{
if(_3==_4.currentResourceName){
_4.currentResourceName=_4[0].resourceName;
var _6=document.createElement("script");
_6.type="text/javascript";
_6.src=_4[0].resourcePath;
document.getElementsByTagName("head")[0].appendChild(_6);
//Override dojo.provide, so we can trigger the next
//script tag for the next local module. We can only add one
//at a time because there are browsers that execute script tags
//in the order that the code is received, and not in the DOM order.
dojo.nonDebugProvide = dojo.provide;
dojo.provide = function(resourceName){
var dbgQueue = dojo["_xdDebugQueue"];
if(dbgQueue && dbgQueue.length > 0 && resourceName == dbgQueue["currentResourceName"]){
//Set a timeout so the module can be executed into existence. Normally the
//dojo.provide call in a module is the first line. Don't want to risk attaching
//another script tag until the current one finishes executing.
if(dojo.isAIR){
window.setTimeout(function(){dojo._xdDebugFileLoaded(resourceName);}, 1);
}else{
window.setTimeout(dojo._scopeName + "._xdDebugFileLoaded('" + resourceName + "')", 1);
}
}
return dojo.nonDebugProvide.apply(dojo, arguments);
}
dojo._xdDebugFileLoaded = function(resourceName){
if(!dojo._xdDebugScopeChecked){
//If using a scoped dojo, we need to expose dojo as a real global
//for the debugAtAllCosts stuff to work.
if(dojo._scopeName != "dojo"){
window.dojo = window[dojo.config.scopeMap[0][1]];
window.dijit = window[dojo.config.scopeMap[1][1]];
window.dojox = window[dojo.config.scopeMap[2][1]];
}
dojo._xdDebugScopeChecked = true;
}
var dbgQueue = dojo._xdDebugQueue;
if(resourceName && resourceName == dbgQueue.currentResourceName){
dbgQueue.shift();
}
if(dbgQueue.length == 0){
//Check for more modules that need debug loading.
//dojo._xdWatchInFlight will add more things to the debug
//queue if they just recently loaded but it was not detected
//between the dojo._xdWatchInFlight intervals.
dojo._xdWatchInFlight();
}
if(dbgQueue.length == 0){
dbgQueue.currentResourceName = null;
//Make sure nothing else is in flight.
//If something is still in flight, then it still
//needs to be added to debug queue after it loads.
for(var param in dojo._xdInFlight){
if(dojo._xdInFlight[param] === true){
return;
}
}
dojo._xdNotifyLoaded();
}else{
if(resourceName == dbgQueue.currentResourceName){
dbgQueue.currentResourceName = dbgQueue[0].resourceName;
var element = document.createElement("script");
element.type = "text/javascript";
element.src = dbgQueue[0].resourcePath;
document.getElementsByTagName("head")[0].appendChild(element);
}
}
}
};
}

File diff suppressed because it is too large Load Diff

@ -5,75 +5,258 @@
*/
if(!dojo._hasResource["dojo._base.array"]){
dojo._hasResource["dojo._base.array"]=true;
if(!dojo._hasResource["dojo._base.array"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo._base.array"] = true;
dojo.require("dojo._base.lang");
dojo.provide("dojo._base.array");
(function(){
var _1=function(_2,_3,cb){
return [(typeof _2=="string")?_2.split(""):_2,_3||dojo.global,(typeof cb=="string")?new Function("item","index","array",cb):cb];
};
var _4=function(_5,_6,_7,_8){
var _9=_1(_6,_8,_7);
_6=_9[0];
for(var i=0,l=_6.length;i<l;++i){
var _a=!!_9[2].call(_9[1],_6[i],i,_6);
if(_5^_a){
return _a;
}
}
return _5;
};
dojo.mixin(dojo,{indexOf:function(_b,_c,_d,_e){
var _f=1,end=_b.length||0,i=0;
if(_e){
i=end-1;
_f=end=-1;
}
if(_d!=undefined){
i=_d;
}
if((_e&&i>end)||i<end){
for(;i!=end;i+=_f){
if(_b[i]==_c){
return i;
}
}
}
return -1;
},lastIndexOf:function(_10,_11,_12){
return dojo.indexOf(_10,_11,_12,true);
},forEach:function(arr,_13,_14){
if(!arr||!arr.length){
return;
}
var _15=_1(arr,_14,_13);
arr=_15[0];
for(var i=0,l=arr.length;i<l;++i){
_15[2].call(_15[1],arr[i],i,arr);
}
},every:function(arr,_16,_17){
return _4(true,arr,_16,_17);
},some:function(arr,_18,_19){
return _4(false,arr,_18,_19);
},map:function(arr,_1a,_1b){
var _1c=_1(arr,_1b,_1a);
arr=_1c[0];
var _1d=(arguments[3]?(new arguments[3]()):[]);
for(var i=0,l=arr.length;i<l;++i){
_1d.push(_1c[2].call(_1c[1],arr[i],i,arr));
}
return _1d;
},filter:function(arr,_1e,_1f){
var _20=_1(arr,_1f,_1e);
arr=_20[0];
var _21=[];
for(var i=0,l=arr.length;i<l;++i){
if(_20[2].call(_20[1],arr[i],i,arr)){
_21.push(arr[i]);
}
}
return _21;
}});
var _getParts = function(arr, obj, cb){
return [
(typeof arr == "string") ? arr.split("") : arr,
obj || dojo.global,
// FIXME: cache the anonymous functions we create here?
(typeof cb == "string") ? new Function("item", "index", "array", cb) : cb
];
};
var everyOrSome = function(/*Boolean*/every, /*Array|String*/arr, /*Function|String*/callback, /*Object?*/thisObject){
var _p = _getParts(arr, thisObject, callback); arr = _p[0];
for(var i=0,l=arr.length; i<l; ++i){
var result = !!_p[2].call(_p[1], arr[i], i, arr);
if(every ^ result){
return result; // Boolean
}
}
return every; // Boolean
};
dojo.mixin(dojo, {
indexOf: function( /*Array*/ array,
/*Object*/ value,
/*Integer?*/ fromIndex,
/*Boolean?*/ findLast){
// summary:
// locates the first index of the provided value in the
// passed array. If the value is not found, -1 is returned.
// description:
// This method corresponds to the JavaScript 1.6 Array.indexOf method, with one difference: when
// run over sparse arrays, the Dojo function invokes the callback for every index whereas JavaScript
// 1.6's indexOf skips the holes in the sparse array.
// For details on this method, see:
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/indexOf
var step = 1, end = array.length || 0, i = 0;
if(findLast){
i = end - 1;
step = end = -1;
}
if(fromIndex != undefined){ i = fromIndex; }
if((findLast && i > end) || i < end){
for(; i != end; i += step){
if(array[i] == value){ return i; }
}
}
return -1; // Number
},
lastIndexOf: function(/*Array*/array, /*Object*/value, /*Integer?*/fromIndex){
// summary:
// locates the last index of the provided value in the passed
// array. If the value is not found, -1 is returned.
// description:
// This method corresponds to the JavaScript 1.6 Array.lastIndexOf method, with one difference: when
// run over sparse arrays, the Dojo function invokes the callback for every index whereas JavaScript
// 1.6's lastIndexOf skips the holes in the sparse array.
// For details on this method, see:
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/lastIndexOf
return dojo.indexOf(array, value, fromIndex, true); // Number
},
forEach: function(/*Array|String*/arr, /*Function|String*/callback, /*Object?*/thisObject){
// summary:
// for every item in arr, callback is invoked. Return values are ignored.
// If you want to break out of the loop, consider using dojo.every() or dojo.some().
// forEach does not allow breaking out of the loop over the items in arr.
// arr:
// the array to iterate over. If a string, operates on individual characters.
// callback:
// a function is invoked with three arguments: item, index, and array
// thisObject:
// may be used to scope the call to callback
// description:
// This function corresponds to the JavaScript 1.6 Array.forEach() method, with one difference: when
// run over sparse arrays, this implemenation passes the "holes" in the sparse array to
// the callback function with a value of undefined. JavaScript 1.6's forEach skips the holes in the sparse array.
// For more details, see:
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/forEach
// example:
// | // log out all members of the array:
// | dojo.forEach(
// | [ "thinger", "blah", "howdy", 10 ],
// | function(item){
// | console.log(item);
// | }
// | );
// example:
// | // log out the members and their indexes
// | dojo.forEach(
// | [ "thinger", "blah", "howdy", 10 ],
// | function(item, idx, arr){
// | console.log(item, "at index:", idx);
// | }
// | );
// example:
// | // use a scoped object member as the callback
// |
// | var obj = {
// | prefix: "logged via obj.callback:",
// | callback: function(item){
// | console.log(this.prefix, item);
// | }
// | };
// |
// | // specifying the scope function executes the callback in that scope
// | dojo.forEach(
// | [ "thinger", "blah", "howdy", 10 ],
// | obj.callback,
// | obj
// | );
// |
// | // alternately, we can accomplish the same thing with dojo.hitch()
// | dojo.forEach(
// | [ "thinger", "blah", "howdy", 10 ],
// | dojo.hitch(obj, "callback")
// | );
// match the behavior of the built-in forEach WRT empty arrs
if(!arr || !arr.length){ return; }
// FIXME: there are several ways of handilng thisObject. Is
// dojo.global always the default context?
var _p = _getParts(arr, thisObject, callback); arr = _p[0];
for(var i=0,l=arr.length; i<l; ++i){
_p[2].call(_p[1], arr[i], i, arr);
}
},
every: function(/*Array|String*/arr, /*Function|String*/callback, /*Object?*/thisObject){
// summary:
// Determines whether or not every item in arr satisfies the
// condition implemented by callback.
// arr:
// the array to iterate on. If a string, operates on individual characters.
// callback:
// a function is invoked with three arguments: item, index,
// and array and returns true if the condition is met.
// thisObject:
// may be used to scope the call to callback
// description:
// This function corresponds to the JavaScript 1.6 Array.every() method, with one difference: when
// run over sparse arrays, this implemenation passes the "holes" in the sparse array to
// the callback function with a value of undefined. JavaScript 1.6's every skips the holes in the sparse array.
// For more details, see:
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/every
// example:
// | // returns false
// | dojo.every([1, 2, 3, 4], function(item){ return item>1; });
// example:
// | // returns true
// | dojo.every([1, 2, 3, 4], function(item){ return item>0; });
return everyOrSome(true, arr, callback, thisObject); // Boolean
},
some: function(/*Array|String*/arr, /*Function|String*/callback, /*Object?*/thisObject){
// summary:
// Determines whether or not any item in arr satisfies the
// condition implemented by callback.
// arr:
// the array to iterate over. If a string, operates on individual characters.
// callback:
// a function is invoked with three arguments: item, index,
// and array and returns true if the condition is met.
// thisObject:
// may be used to scope the call to callback
// description:
// This function corresponds to the JavaScript 1.6 Array.some() method, with one difference: when
// run over sparse arrays, this implemenation passes the "holes" in the sparse array to
// the callback function with a value of undefined. JavaScript 1.6's some skips the holes in the sparse array.
// For more details, see:
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/some
// example:
// | // is true
// | dojo.some([1, 2, 3, 4], function(item){ return item>1; });
// example:
// | // is false
// | dojo.some([1, 2, 3, 4], function(item){ return item<1; });
return everyOrSome(false, arr, callback, thisObject); // Boolean
},
map: function(/*Array|String*/arr, /*Function|String*/callback, /*Function?*/thisObject){
// summary:
// applies callback to each element of arr and returns
// an Array with the results
// arr:
// the array to iterate on. If a string, operates on
// individual characters.
// callback:
// a function is invoked with three arguments, (item, index,
// array), and returns a value
// thisObject:
// may be used to scope the call to callback
// description:
// This function corresponds to the JavaScript 1.6 Array.map() method, with one difference: when
// run over sparse arrays, this implemenation passes the "holes" in the sparse array to
// the callback function with a value of undefined. JavaScript 1.6's map skips the holes in the sparse array.
// For more details, see:
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/map
// example:
// | // returns [2, 3, 4, 5]
// | dojo.map([1, 2, 3, 4], function(item){ return item+1 });
var _p = _getParts(arr, thisObject, callback); arr = _p[0];
var outArr = (arguments[3] ? (new arguments[3]()) : []);
for(var i=0,l=arr.length; i<l; ++i){
outArr.push(_p[2].call(_p[1], arr[i], i, arr));
}
return outArr; // Array
},
filter: function(/*Array*/arr, /*Function|String*/callback, /*Object?*/thisObject){
// summary:
// Returns a new Array with those items from arr that match the
// condition implemented by callback.
// arr:
// the array to iterate over.
// callback:
// a function that is invoked with three arguments (item,
// index, array). The return of this function is expected to
// be a boolean which determines whether the passed-in item
// will be included in the returned array.
// thisObject:
// may be used to scope the call to callback
// description:
// This function corresponds to the JavaScript 1.6 Array.filter() method, with one difference: when
// run over sparse arrays, this implemenation passes the "holes" in the sparse array to
// the callback function with a value of undefined. JavaScript 1.6's filter skips the holes in the sparse array.
// For more details, see:
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/filter
// example:
// | // returns [2, 3, 4]
// | dojo.filter([1, 2, 3, 4], function(item){ return item>1; });
var _p = _getParts(arr, thisObject, callback); arr = _p[0];
var outArr = [];
for(var i=0,l=arr.length; i<l; ++i){
if(_p[2].call(_p[1], arr[i], i, arr)){
outArr.push(arr[i]);
}
}
return outArr; // Array
}
});
})();
/*
*/
}

@ -5,9 +5,10 @@
*/
if(!dojo._hasResource["dojo._base.browser"]){
dojo._hasResource["dojo._base.browser"]=true;
if(!dojo._hasResource["dojo._base.browser"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo._base.browser"] = true;
dojo.provide("dojo._base.browser");
dojo.require("dojo._base.window");
dojo.require("dojo._base.connect");
dojo.require("dojo._base.event");
@ -16,7 +17,13 @@ dojo.require("dojo._base.NodeList");
dojo.require("dojo._base.query");
dojo.require("dojo._base.xhr");
dojo.require("dojo._base.fx");
dojo.forEach(dojo.config.require,function(i){
dojo["require"](i);
//Need this to be the last code segment in base, so do not place any
//dojo.requireIf calls in this file. Otherwise, due to how the build system
//puts all requireIf dependencies after the current file, the require calls
//could be called before all of base is defined.
dojo.forEach(dojo.config.require, function(i){
dojo["require"](i);
});
}

@ -5,81 +5,306 @@
*/
if(!dojo._hasResource["dojo._base.connect"]){
dojo._hasResource["dojo._base.connect"]=true;
if(!dojo._hasResource["dojo._base.connect"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo._base.connect"] = true;
dojo.provide("dojo._base.connect");
dojo.require("dojo._base.lang");
dojo._listener={getDispatcher:function(){
return function(){
var ap=Array.prototype,c=arguments.callee,ls=c._listeners,t=c.target;
var r=t&&t.apply(this,arguments);
var i,_1;
_1=[].concat(ls);
for(i in _1){
if(!(i in ap)){
_1[i].apply(this,arguments);
}
}
return r;
// this file courtesy of the TurboAjax Group, licensed under a Dojo CLA
// low-level delegation machinery
dojo._listener = {
// create a dispatcher function
getDispatcher: function(){
// following comments pulled out-of-line to prevent cloning them
// in the returned function.
// - indices (i) that are really in the array of listeners (ls) will
// not be in Array.prototype. This is the 'sparse array' trick
// that keeps us safe from libs that take liberties with built-in
// objects
// - listener is invoked with current scope (this)
return function(){
var ap=Array.prototype, c=arguments.callee, ls=c._listeners, t=c.target;
// return value comes from original target function
var r = t && t.apply(this, arguments);
// make local copy of listener array so it is immutable during processing
var i, lls;
lls = [].concat(ls);
// invoke listeners after target function
for(i in lls){
if(!(i in ap)){
lls[i].apply(this, arguments);
}
}
// return value comes from original target function
return r;
};
},
// add a listener to an object
add: function(/*Object*/ source, /*String*/ method, /*Function*/ listener){
// Whenever 'method' is invoked, 'listener' will have the same scope.
// Trying to supporting a context object for the listener led to
// complexity.
// Non trivial to provide 'once' functionality here
// because listener could be the result of a dojo.hitch call,
// in which case two references to the same hitch target would not
// be equivalent.
source = source || dojo.global;
// The source method is either null, a dispatcher, or some other function
var f = source[method];
// Ensure a dispatcher
if(!f || !f._listeners){
var d = dojo._listener.getDispatcher();
// original target function is special
d.target = f;
// dispatcher holds a list of listeners
d._listeners = [];
// redirect source to dispatcher
f = source[method] = d;
}
// The contract is that a handle is returned that can
// identify this listener for disconnect.
//
// The type of the handle is private. Here is it implemented as Integer.
// DOM event code has this same contract but handle is Function
// in non-IE browsers.
//
// We could have separate lists of before and after listeners.
return f._listeners.push(listener); /*Handle*/
},
// remove a listener from an object
remove: function(/*Object*/ source, /*String*/ method, /*Handle*/ handle){
var f = (source || dojo.global)[method];
// remember that handle is the index+1 (0 is not a valid handle)
if(f && f._listeners && handle--){
delete f._listeners[handle];
}
}
};
},add:function(_2,_3,_4){
_2=_2||dojo.global;
var f=_2[_3];
if(!f||!f._listeners){
var d=dojo._listener.getDispatcher();
d.target=f;
d._listeners=[];
f=_2[_3]=d;
// Multiple delegation for arbitrary methods.
// This unit knows nothing about DOM, but we include DOM aware documentation
// and dontFix argument here to help the autodocs. Actual DOM aware code is in
// event.js.
dojo.connect = function(/*Object|null*/ obj,
/*String*/ event,
/*Object|null*/ context,
/*String|Function*/ method,
/*Boolean?*/ dontFix){
// summary:
// `dojo.connect` is the core event handling and delegation method in
// Dojo. It allows one function to "listen in" on the execution of
// any other, triggering the second whenever the first is called. Many
// listeners may be attached to a function, and source functions may
// be either regular function calls or DOM events.
//
// description:
// Connects listeners to actions, so that after event fires, a
// listener is called with the same arguments passed to the original
// function.
//
// Since `dojo.connect` allows the source of events to be either a
// "regular" JavaScript function or a DOM event, it provides a uniform
// interface for listening to all the types of events that an
// application is likely to deal with though a single, unified
// interface. DOM programmers may want to think of it as
// "addEventListener for everything and anything".
//
// When setting up a connection, the `event` parameter must be a
// string that is the name of the method/event to be listened for. If
// `obj` is null, `dojo.global` is assumed, meaning that connections
// to global methods are supported but also that you may inadvertently
// connect to a global by passing an incorrect object name or invalid
// reference.
//
// `dojo.connect` generally is forgiving. If you pass the name of a
// function or method that does not yet exist on `obj`, connect will
// not fail, but will instead set up a stub method. Similarly, null
// arguments may simply be omitted such that fewer than 4 arguments
// may be required to set up a connection See the examples for details.
//
// The return value is a handle that is needed to
// remove this connection with `dojo.disconnect`.
//
// obj:
// The source object for the event function.
// Defaults to `dojo.global` if null.
// If obj is a DOM node, the connection is delegated
// to the DOM event manager (unless dontFix is true).
//
// event:
// String name of the event function in obj.
// I.e. identifies a property `obj[event]`.
//
// context:
// The object that method will receive as "this".
//
// If context is null and method is a function, then method
// inherits the context of event.
//
// If method is a string then context must be the source
// object object for method (context[method]). If context is null,
// dojo.global is used.
//
// method:
// A function reference, or name of a function in context.
// The function identified by method fires after event does.
// method receives the same arguments as the event.
// See context argument comments for information on method's scope.
//
// dontFix:
// If obj is a DOM node, set dontFix to true to prevent delegation
// of this connection to the DOM event manager.
//
// example:
// When obj.onchange(), do ui.update():
// | dojo.connect(obj, "onchange", ui, "update");
// | dojo.connect(obj, "onchange", ui, ui.update); // same
//
// example:
// Using return value for disconnect:
// | var link = dojo.connect(obj, "onchange", ui, "update");
// | ...
// | dojo.disconnect(link);
//
// example:
// When onglobalevent executes, watcher.handler is invoked:
// | dojo.connect(null, "onglobalevent", watcher, "handler");
//
// example:
// When ob.onCustomEvent executes, customEventHandler is invoked:
// | dojo.connect(ob, "onCustomEvent", null, "customEventHandler");
// | dojo.connect(ob, "onCustomEvent", "customEventHandler"); // same
//
// example:
// When ob.onCustomEvent executes, customEventHandler is invoked
// with the same scope (this):
// | dojo.connect(ob, "onCustomEvent", null, customEventHandler);
// | dojo.connect(ob, "onCustomEvent", customEventHandler); // same
//
// example:
// When globalEvent executes, globalHandler is invoked
// with the same scope (this):
// | dojo.connect(null, "globalEvent", null, globalHandler);
// | dojo.connect("globalEvent", globalHandler); // same
// normalize arguments
var a=arguments, args=[], i=0;
// if a[0] is a String, obj was omitted
args.push(dojo.isString(a[0]) ? null : a[i++], a[i++]);
// if the arg-after-next is a String or Function, context was NOT omitted
var a1 = a[i+1];
args.push(dojo.isString(a1)||dojo.isFunction(a1) ? a[i++] : null, a[i++]);
// absorb any additional arguments
for(var l=a.length; i<l; i++){ args.push(a[i]); }
// do the actual work
return dojo._connect.apply(this, args); /*Handle*/
}
return f._listeners.push(_4);
},remove:function(_5,_6,_7){
var f=(_5||dojo.global)[_6];
if(f&&f._listeners&&_7--){
delete f._listeners[_7];
// used by non-browser hostenvs. always overriden by event.js
dojo._connect = function(obj, event, context, method){
var l=dojo._listener, h=l.add(obj, event, dojo.hitch(context, method));
return [obj, event, h, l]; // Handle
}
}};
dojo.connect=function(_8,_9,_a,_b,_c){
var a=arguments,_d=[],i=0;
_d.push(dojo.isString(a[0])?null:a[i++],a[i++]);
var a1=a[i+1];
_d.push(dojo.isString(a1)||dojo.isFunction(a1)?a[i++]:null,a[i++]);
for(var l=a.length;i<l;i++){
_d.push(a[i]);
dojo.disconnect = function(/*Handle*/ handle){
// summary:
// Remove a link created by dojo.connect.
// description:
// Removes the connection between event and the method referenced by handle.
// handle:
// the return value of the dojo.connect call that created the connection.
if(handle && handle[0] !== undefined){
dojo._disconnect.apply(this, handle);
// let's not keep this reference
delete handle[0];
}
}
return dojo._connect.apply(this,_d);
};
dojo._connect=function(_e,_f,_10,_11){
var l=dojo._listener,h=l.add(_e,_f,dojo.hitch(_10,_11));
return [_e,_f,h,l];
};
dojo.disconnect=function(_12){
if(_12&&_12[0]!==undefined){
dojo._disconnect.apply(this,_12);
delete _12[0];
dojo._disconnect = function(obj, event, handle, listener){
listener.remove(obj, event, handle);
}
};
dojo._disconnect=function(obj,_13,_14,_15){
_15.remove(obj,_13,_14);
};
dojo._topics={};
dojo.subscribe=function(_16,_17,_18){
return [_16,dojo._listener.add(dojo._topics,_16,dojo.hitch(_17,_18))];
};
dojo.unsubscribe=function(_19){
if(_19){
dojo._listener.remove(dojo._topics,_19[0],_19[1]);
// topic publish/subscribe
dojo._topics = {};
dojo.subscribe = function(/*String*/ topic, /*Object|null*/ context, /*String|Function*/ method){
// summary:
// Attach a listener to a named topic. The listener function is invoked whenever the
// named topic is published (see: dojo.publish).
// Returns a handle which is needed to unsubscribe this listener.
// context:
// Scope in which method will be invoked, or null for default scope.
// method:
// The name of a function in context, or a function reference. This is the function that
// is invoked when topic is published.
// example:
// | dojo.subscribe("alerts", null, function(caption, message){ alert(caption + "\n" + message); });
// | dojo.publish("alerts", [ "read this", "hello world" ]);
// support for 2 argument invocation (omitting context) depends on hitch
return [topic, dojo._listener.add(dojo._topics, topic, dojo.hitch(context, method))]; /*Handle*/
}
};
dojo.publish=function(_1a,_1b){
var f=dojo._topics[_1a];
if(f){
f.apply(this,_1b||[]);
dojo.unsubscribe = function(/*Handle*/ handle){
// summary:
// Remove a topic listener.
// handle:
// The handle returned from a call to subscribe.
// example:
// | var alerter = dojo.subscribe("alerts", null, function(caption, message){ alert(caption + "\n" + message); };
// | ...
// | dojo.unsubscribe(alerter);
if(handle){
dojo._listener.remove(dojo._topics, handle[0], handle[1]);
}
}
dojo.publish = function(/*String*/ topic, /*Array*/ args){
// summary:
// Invoke all listener method subscribed to topic.
// topic:
// The name of the topic to publish.
// args:
// An array of arguments. The arguments will be applied
// to each topic subscriber (as first class parameters, via apply).
// example:
// | dojo.subscribe("alerts", null, function(caption, message){ alert(caption + "\n" + message); };
// | dojo.publish("alerts", [ "read this", "hello world" ]);
// Note that args is an array, which is more efficient vs variable length
// argument list. Ideally, var args would be implemented via Array
// throughout the APIs.
var f = dojo._topics[topic];
if(f){
f.apply(this, args||[]);
}
}
dojo.connectPublisher = function( /*String*/ topic,
/*Object|null*/ obj,
/*String*/ event){
// summary:
// Ensure that every time obj.event() is called, a message is published
// on the topic. Returns a handle which can be passed to
// dojo.disconnect() to disable subsequent automatic publication on
// the topic.
// topic:
// The name of the topic to publish.
// obj:
// The source object for the event function. Defaults to dojo.global
// if null.
// event:
// The name of the event function in obj.
// I.e. identifies a property obj[event].
// example:
// | dojo.connectPublisher("/ajax/start", dojo, "xhrGet");
var pf = function(){ dojo.publish(topic, arguments); }
return event ? dojo.connect(obj, event, pf) : dojo.connect(obj, pf); //Handle
};
dojo.connectPublisher=function(_1c,obj,_1d){
var pf=function(){
dojo.publish(_1c,arguments);
};
return _1d?dojo.connect(obj,_1d,pf):dojo.connect(obj,pf);
};
}

File diff suppressed because it is too large Load Diff

@ -5,355 +5,641 @@
*/
if(!dojo._hasResource["dojo._base.event"]){
dojo._hasResource["dojo._base.event"]=true;
if(!dojo._hasResource["dojo._base.event"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo._base.event"] = true;
dojo.provide("dojo._base.event");
dojo.require("dojo._base.connect");
// this file courtesy of the TurboAjax Group, licensed under a Dojo CLA
(function(){
var _1=(dojo._event_listener={add:function(_2,_3,fp){
if(!_2){
return;
}
_3=_1._normalizeEventName(_3);
fp=_1._fixCallback(_3,fp);
var _4=_3;
if(!dojo.isIE&&(_3=="mouseenter"||_3=="mouseleave")){
var _5=fp;
_3=(_3=="mouseenter")?"mouseover":"mouseout";
fp=function(e){
if(!dojo.isDescendant(e.relatedTarget,_2)){
return _5.call(this,e);
}
};
}
_2.addEventListener(_3,fp,false);
return fp;
},remove:function(_6,_7,_8){
if(_6){
_7=_1._normalizeEventName(_7);
if(!dojo.isIE&&(_7=="mouseenter"||_7=="mouseleave")){
_7=(_7=="mouseenter")?"mouseover":"mouseout";
}
_6.removeEventListener(_7,_8,false);
}
},_normalizeEventName:function(_9){
return _9.slice(0,2)=="on"?_9.slice(2):_9;
},_fixCallback:function(_a,fp){
return _a!="keypress"?fp:function(e){
return fp.call(this,_1._fixEvent(e,this));
};
},_fixEvent:function(_b,_c){
switch(_b.type){
case "keypress":
_1._setKeyChar(_b);
break;
}
return _b;
},_setKeyChar:function(_d){
_d.keyChar=_d.charCode?String.fromCharCode(_d.charCode):"";
_d.charOrCode=_d.keyChar||_d.keyCode;
},_punctMap:{106:42,111:47,186:59,187:43,188:44,189:45,190:46,191:47,192:96,219:91,220:92,221:93,222:39}});
dojo.fixEvent=function(_e,_f){
return _1._fixEvent(_e,_f);
};
dojo.stopEvent=function(evt){
evt.preventDefault();
evt.stopPropagation();
};
var _10=dojo._listener;
dojo._connect=function(obj,_11,_12,_13,_14){
var _15=obj&&(obj.nodeType||obj.attachEvent||obj.addEventListener);
var lid=_15?(_14?2:1):0,l=[dojo._listener,_1,_10][lid];
var h=l.add(obj,_11,dojo.hitch(_12,_13));
return [obj,_11,h,lid];
};
dojo._disconnect=function(obj,_16,_17,_18){
([dojo._listener,_1,_10][_18]).remove(obj,_16,_17);
};
dojo.keys={BACKSPACE:8,TAB:9,CLEAR:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,META:dojo.isSafari?91:224,PAUSE:19,CAPS_LOCK:20,ESCAPE:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT_ARROW:37,UP_ARROW:38,RIGHT_ARROW:39,DOWN_ARROW:40,INSERT:45,DELETE:46,HELP:47,LEFT_WINDOW:91,RIGHT_WINDOW:92,SELECT:93,NUMPAD_0:96,NUMPAD_1:97,NUMPAD_2:98,NUMPAD_3:99,NUMPAD_4:100,NUMPAD_5:101,NUMPAD_6:102,NUMPAD_7:103,NUMPAD_8:104,NUMPAD_9:105,NUMPAD_MULTIPLY:106,NUMPAD_PLUS:107,NUMPAD_ENTER:108,NUMPAD_MINUS:109,NUMPAD_PERIOD:110,NUMPAD_DIVIDE:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,F13:124,F14:125,F15:126,NUM_LOCK:144,SCROLL_LOCK:145,copyKey:dojo.isMac&&!dojo.isAIR?(dojo.isSafari?91:224):17};
var _19=dojo.isMac?"metaKey":"ctrlKey";
dojo.isCopyKey=function(e){
return e[_19];
};
if(dojo.isIE){
dojo.mouseButtons={LEFT:1,MIDDLE:4,RIGHT:2,isButton:function(e,_1a){
return e.button&_1a;
},isLeft:function(e){
return e.button&1;
},isMiddle:function(e){
return e.button&4;
},isRight:function(e){
return e.button&2;
}};
}else{
dojo.mouseButtons={LEFT:0,MIDDLE:1,RIGHT:2,isButton:function(e,_1b){
return e.button==_1b;
},isLeft:function(e){
return e.button==0;
},isMiddle:function(e){
return e.button==1;
},isRight:function(e){
return e.button==2;
}};
}
if(dojo.isIE){
var _1c=function(e,_1d){
try{
return (e.keyCode=_1d);
}
catch(e){
return 0;
}
};
var iel=dojo._listener;
var _1e=(dojo._ieListenersName="_"+dojo._scopeName+"_listeners");
if(!dojo.config._allow_leaks){
_10=iel=dojo._ie_listener={handlers:[],add:function(_1f,_20,_21){
_1f=_1f||dojo.global;
var f=_1f[_20];
if(!f||!f[_1e]){
var d=dojo._getIeDispatcher();
d.target=f&&(ieh.push(f)-1);
d[_1e]=[];
f=_1f[_20]=d;
}
return f[_1e].push(ieh.push(_21)-1);
},remove:function(_22,_23,_24){
var f=(_22||dojo.global)[_23],l=f&&f[_1e];
if(f&&l&&_24--){
delete ieh[l[_24]];
delete l[_24];
}
}};
var ieh=iel.handlers;
}
dojo.mixin(_1,{add:function(_25,_26,fp){
if(!_25){
return;
}
_26=_1._normalizeEventName(_26);
if(_26=="onkeypress"){
var kd=_25.onkeydown;
if(!kd||!kd[_1e]||!kd._stealthKeydownHandle){
var h=_1.add(_25,"onkeydown",_1._stealthKeyDown);
kd=_25.onkeydown;
kd._stealthKeydownHandle=h;
kd._stealthKeydownRefs=1;
}else{
kd._stealthKeydownRefs++;
}
}
return iel.add(_25,_26,_1._fixCallback(fp));
},remove:function(_27,_28,_29){
_28=_1._normalizeEventName(_28);
iel.remove(_27,_28,_29);
if(_28=="onkeypress"){
var kd=_27.onkeydown;
if(--kd._stealthKeydownRefs<=0){
iel.remove(_27,"onkeydown",kd._stealthKeydownHandle);
delete kd._stealthKeydownHandle;
}
}
},_normalizeEventName:function(_2a){
return _2a.slice(0,2)!="on"?"on"+_2a:_2a;
},_nop:function(){
},_fixEvent:function(evt,_2b){
if(!evt){
var w=_2b&&(_2b.ownerDocument||_2b.document||_2b).parentWindow||window;
evt=w.event;
}
if(!evt){
return (evt);
}
evt.target=evt.srcElement;
evt.currentTarget=(_2b||evt.srcElement);
evt.layerX=evt.offsetX;
evt.layerY=evt.offsetY;
var se=evt.srcElement,doc=(se&&se.ownerDocument)||document;
var _2c=((dojo.isIE<6)||(doc["compatMode"]=="BackCompat"))?doc.body:doc.documentElement;
var _2d=dojo._getIeDocumentElementOffset();
evt.pageX=evt.clientX+dojo._fixIeBiDiScrollLeft(_2c.scrollLeft||0)-_2d.x;
evt.pageY=evt.clientY+(_2c.scrollTop||0)-_2d.y;
if(evt.type=="mouseover"){
evt.relatedTarget=evt.fromElement;
}
if(evt.type=="mouseout"){
evt.relatedTarget=evt.toElement;
}
evt.stopPropagation=_1._stopPropagation;
evt.preventDefault=_1._preventDefault;
return _1._fixKeys(evt);
},_fixKeys:function(evt){
switch(evt.type){
case "keypress":
var c=("charCode" in evt?evt.charCode:evt.keyCode);
if(c==10){
c=0;
evt.keyCode=13;
}else{
if(c==13||c==27){
c=0;
}else{
if(c==3){
c=99;
}
}
}
evt.charCode=c;
_1._setKeyChar(evt);
break;
}
return evt;
},_stealthKeyDown:function(evt){
var kp=evt.currentTarget.onkeypress;
if(!kp||!kp[_1e]){
return;
}
var k=evt.keyCode;
var _2e=k!=13&&k!=32&&k!=27&&(k<48||k>90)&&(k<96||k>111)&&(k<186||k>192)&&(k<219||k>222);
if(_2e||evt.ctrlKey){
var c=_2e?0:k;
if(evt.ctrlKey){
if(k==3||k==13){
return;
}else{
if(c>95&&c<106){
c-=48;
}else{
if((!evt.shiftKey)&&(c>=65&&c<=90)){
c+=32;
}else{
c=_1._punctMap[c]||c;
}
}
}
}
var _2f=_1._synthesizeEvent(evt,{type:"keypress",faux:true,charCode:c});
kp.call(evt.currentTarget,_2f);
evt.cancelBubble=_2f.cancelBubble;
evt.returnValue=_2f.returnValue;
_1c(evt,_2f.keyCode);
}
},_stopPropagation:function(){
this.cancelBubble=true;
},_preventDefault:function(){
this.bubbledKeyCode=this.keyCode;
if(this.ctrlKey){
_1c(this,0);
}
this.returnValue=false;
}});
dojo.stopEvent=function(evt){
evt=evt||window.event;
_1._stopPropagation.call(evt);
_1._preventDefault.call(evt);
};
}
_1._synthesizeEvent=function(evt,_30){
var _31=dojo.mixin({},evt,_30);
_1._setKeyChar(_31);
_31.preventDefault=function(){
evt.preventDefault();
};
_31.stopPropagation=function(){
evt.stopPropagation();
};
return _31;
};
if(dojo.isOpera){
dojo.mixin(_1,{_fixEvent:function(evt,_32){
switch(evt.type){
case "keypress":
var c=evt.which;
if(c==3){
c=99;
}
c=c<41&&!evt.shiftKey?0:c;
if(evt.ctrlKey&&!evt.shiftKey&&c>=65&&c<=90){
c+=32;
}
return _1._synthesizeEvent(evt,{charCode:c});
}
return evt;
}});
}
if(dojo.isWebKit){
_1._add=_1.add;
_1._remove=_1.remove;
dojo.mixin(_1,{add:function(_33,_34,fp){
if(!_33){
return;
}
var _35=_1._add(_33,_34,fp);
if(_1._normalizeEventName(_34)=="keypress"){
_35._stealthKeyDownHandle=_1._add(_33,"keydown",function(evt){
var k=evt.keyCode;
var _36=k!=13&&k!=32&&(k<48||k>90)&&(k<96||k>111)&&(k<186||k>192)&&(k<219||k>222);
if(_36||evt.ctrlKey){
var c=_36?0:k;
if(evt.ctrlKey){
if(k==3||k==13){
return;
}else{
if(c>95&&c<106){
c-=48;
}else{
if(!evt.shiftKey&&c>=65&&c<=90){
c+=32;
}else{
c=_1._punctMap[c]||c;
}
}
}
}
var _37=_1._synthesizeEvent(evt,{type:"keypress",faux:true,charCode:c});
fp.call(evt.currentTarget,_37);
}
});
}
return _35;
},remove:function(_38,_39,_3a){
if(_38){
if(_3a._stealthKeyDownHandle){
_1._remove(_38,"keydown",_3a._stealthKeyDownHandle);
}
_1._remove(_38,_39,_3a);
}
},_fixEvent:function(evt,_3b){
switch(evt.type){
case "keypress":
if(evt.faux){
return evt;
}
var c=evt.charCode;
c=c>=32?c:0;
return _1._synthesizeEvent(evt,{charCode:c,faux:true});
}
return evt;
}});
}
})();
// DOM event listener machinery
var del = (dojo._event_listener = {
add: function(/*DOMNode*/ node, /*String*/ name, /*Function*/ fp){
if(!node){return;}
name = del._normalizeEventName(name);
fp = del._fixCallback(name, fp);
var oname = name;
if(
!dojo.isIE &&
(name == "mouseenter" || name == "mouseleave")
){
var ofp = fp;
//oname = name;
name = (name == "mouseenter") ? "mouseover" : "mouseout";
fp = function(e){
if(!dojo.isDescendant(e.relatedTarget, node)){
// e.type = oname; // FIXME: doesn't take? SJM: event.type is generally immutable.
return ofp.call(this, e);
}
}
}
node.addEventListener(name, fp, false);
return fp; /*Handle*/
},
remove: function(/*DOMNode*/ node, /*String*/ event, /*Handle*/ handle){
// summary:
// clobbers the listener from the node
// node:
// DOM node to attach the event to
// event:
// the name of the handler to remove the function from
// handle:
// the handle returned from add
if(node){
event = del._normalizeEventName(event);
if(!dojo.isIE && (event == "mouseenter" || event == "mouseleave")){
event = (event == "mouseenter") ? "mouseover" : "mouseout";
}
node.removeEventListener(event, handle, false);
}
},
_normalizeEventName: function(/*String*/ name){
// Generally, name should be lower case, unless it is special
// somehow (e.g. a Mozilla DOM event).
// Remove 'on'.
return name.slice(0,2) =="on" ? name.slice(2) : name;
},
_fixCallback: function(/*String*/ name, fp){
// By default, we only invoke _fixEvent for 'keypress'
// If code is added to _fixEvent for other events, we have
// to revisit this optimization.
// This also applies to _fixEvent overrides for Safari and Opera
// below.
return name != "keypress" ? fp : function(e){ return fp.call(this, del._fixEvent(e, this)); };
},
_fixEvent: function(evt, sender){
// _fixCallback only attaches us to keypress.
// Switch on evt.type anyway because we might
// be called directly from dojo.fixEvent.
switch(evt.type){
case "keypress":
del._setKeyChar(evt);
break;
}
return evt;
},
_setKeyChar: function(evt){
evt.keyChar = evt.charCode ? String.fromCharCode(evt.charCode) : '';
evt.charOrCode = evt.keyChar || evt.keyCode;
},
// For IE and Safari: some ctrl-key combinations (mostly w/punctuation) do not emit a char code in IE
// we map those virtual key codes to ascii here
// not valid for all (non-US) keyboards, so maybe we shouldn't bother
_punctMap: {
106:42,
111:47,
186:59,
187:43,
188:44,
189:45,
190:46,
191:47,
192:96,
219:91,
220:92,
221:93,
222:39
}
});
// DOM events
dojo.fixEvent = function(/*Event*/ evt, /*DOMNode*/ sender){
// summary:
// normalizes properties on the event object including event
// bubbling methods, keystroke normalization, and x/y positions
// evt: Event
// native event object
// sender: DOMNode
// node to treat as "currentTarget"
return del._fixEvent(evt, sender);
}
dojo.stopEvent = function(/*Event*/ evt){
// summary:
// prevents propagation and clobbers the default action of the
// passed event
// evt: Event
// The event object. If omitted, window.event is used on IE.
evt.preventDefault();
evt.stopPropagation();
// NOTE: below, this method is overridden for IE
}
// the default listener to use on dontFix nodes, overriden for IE
var node_listener = dojo._listener;
// Unify connect and event listeners
dojo._connect = function(obj, event, context, method, dontFix){
// FIXME: need a more strict test
var isNode = obj && (obj.nodeType||obj.attachEvent||obj.addEventListener);
// choose one of three listener options: raw (connect.js), DOM event on a Node, custom event on a Node
// we need the third option to provide leak prevention on broken browsers (IE)
var lid = isNode ? (dontFix ? 2 : 1) : 0, l = [dojo._listener, del, node_listener][lid];
// create a listener
var h = l.add(obj, event, dojo.hitch(context, method));
// formerly, the disconnect package contained "l" directly, but if client code
// leaks the disconnect package (by connecting it to a node), referencing "l"
// compounds the problem.
// instead we return a listener id, which requires custom _disconnect below.
// return disconnect package
return [ obj, event, h, lid ];
}
dojo._disconnect = function(obj, event, handle, listener){
([dojo._listener, del, node_listener][listener]).remove(obj, event, handle);
}
// Constants
// Public: client code should test
// keyCode against these named constants, as the
// actual codes can vary by browser.
dojo.keys = {
// summary:
// Definitions for common key values
BACKSPACE: 8,
TAB: 9,
CLEAR: 12,
ENTER: 13,
SHIFT: 16,
CTRL: 17,
ALT: 18,
META: dojo.isSafari ? 91 : 224, // the apple key on macs
PAUSE: 19,
CAPS_LOCK: 20,
ESCAPE: 27,
SPACE: 32,
PAGE_UP: 33,
PAGE_DOWN: 34,
END: 35,
HOME: 36,
LEFT_ARROW: 37,
UP_ARROW: 38,
RIGHT_ARROW: 39,
DOWN_ARROW: 40,
INSERT: 45,
DELETE: 46,
HELP: 47,
LEFT_WINDOW: 91,
RIGHT_WINDOW: 92,
SELECT: 93,
NUMPAD_0: 96,
NUMPAD_1: 97,
NUMPAD_2: 98,
NUMPAD_3: 99,
NUMPAD_4: 100,
NUMPAD_5: 101,
NUMPAD_6: 102,
NUMPAD_7: 103,
NUMPAD_8: 104,
NUMPAD_9: 105,
NUMPAD_MULTIPLY: 106,
NUMPAD_PLUS: 107,
NUMPAD_ENTER: 108,
NUMPAD_MINUS: 109,
NUMPAD_PERIOD: 110,
NUMPAD_DIVIDE: 111,
F1: 112,
F2: 113,
F3: 114,
F4: 115,
F5: 116,
F6: 117,
F7: 118,
F8: 119,
F9: 120,
F10: 121,
F11: 122,
F12: 123,
F13: 124,
F14: 125,
F15: 126,
NUM_LOCK: 144,
SCROLL_LOCK: 145,
// virtual key mapping
copyKey: dojo.isMac && !dojo.isAIR ? (dojo.isSafari ? 91 : 224 ) : 17
};
var evtCopyKey = dojo.isMac ? "metaKey" : "ctrlKey";
dojo.isCopyKey = function(e){
// summary:
// Checks an event for the copy key (meta on Mac, and ctrl anywhere else)
// e: Event
// Event object to examine
return e[evtCopyKey]; // Boolean
};
// Public: decoding mouse buttons from events
/*=====
dojo.mouseButtons = {
// LEFT: Number
// Numeric value of the left mouse button for the platform.
LEFT: 0,
// MIDDLE: Number
// Numeric value of the middle mouse button for the platform.
MIDDLE: 1,
// RIGHT: Number
// Numeric value of the right mouse button for the platform.
RIGHT: 2,
isButton: function(e, button){
// summary:
// Checks an event object for a pressed button
// e: Event
// Event object to examine
// button: Number
// The button value (example: dojo.mouseButton.LEFT)
return e.button == button; // Boolean
},
isLeft: function(e){
// summary:
// Checks an event object for the pressed left button
// e: Event
// Event object to examine
return e.button == 0; // Boolean
},
isMiddle: function(e){
// summary:
// Checks an event object for the pressed middle button
// e: Event
// Event object to examine
return e.button == 1; // Boolean
},
isRight: function(e){
// summary:
// Checks an event object for the pressed right button
// e: Event
// Event object to examine
return e.button == 2; // Boolean
}
};
=====*/
if(dojo.isIE){
dojo.mouseButtons = {
LEFT: 1,
MIDDLE: 4,
RIGHT: 2,
// helper functions
isButton: function(e, button){ return e.button & button; },
isLeft: function(e){ return e.button & 1; },
isMiddle: function(e){ return e.button & 4; },
isRight: function(e){ return e.button & 2; }
};
}else{
dojo.mouseButtons = {
LEFT: 0,
MIDDLE: 1,
RIGHT: 2,
// helper functions
isButton: function(e, button){ return e.button == button; },
isLeft: function(e){ return e.button == 0; },
isMiddle: function(e){ return e.button == 1; },
isRight: function(e){ return e.button == 2; }
};
}
// IE event normalization
if(dojo.isIE){
var _trySetKeyCode = function(e, code){
try{
// squelch errors when keyCode is read-only
// (e.g. if keyCode is ctrl or shift)
return (e.keyCode = code);
}catch(e){
return 0;
}
}
// by default, use the standard listener
var iel = dojo._listener;
var listenersName = (dojo._ieListenersName = "_" + dojo._scopeName + "_listeners");
// dispatcher tracking property
if(!dojo.config._allow_leaks){
// custom listener that handles leak protection for DOM events
node_listener = iel = dojo._ie_listener = {
// support handler indirection: event handler functions are
// referenced here. Event dispatchers hold only indices.
handlers: [],
// add a listener to an object
add: function(/*Object*/ source, /*String*/ method, /*Function*/ listener){
source = source || dojo.global;
var f = source[method];
if(!f||!f[listenersName]){
var d = dojo._getIeDispatcher();
// original target function is special
d.target = f && (ieh.push(f) - 1);
// dispatcher holds a list of indices into handlers table
d[listenersName] = [];
// redirect source to dispatcher
f = source[method] = d;
}
return f[listenersName].push(ieh.push(listener) - 1) ; /*Handle*/
},
// remove a listener from an object
remove: function(/*Object*/ source, /*String*/ method, /*Handle*/ handle){
var f = (source||dojo.global)[method], l = f && f[listenersName];
if(f && l && handle--){
delete ieh[l[handle]];
delete l[handle];
}
}
};
// alias used above
var ieh = iel.handlers;
}
dojo.mixin(del, {
add: function(/*DOMNode*/ node, /*String*/ event, /*Function*/ fp){
if(!node){return;} // undefined
event = del._normalizeEventName(event);
if(event=="onkeypress"){
// we need to listen to onkeydown to synthesize
// keypress events that otherwise won't fire
// on IE
var kd = node.onkeydown;
if(!kd || !kd[listenersName] || !kd._stealthKeydownHandle){
var h = del.add(node, "onkeydown", del._stealthKeyDown);
kd = node.onkeydown;
kd._stealthKeydownHandle = h;
kd._stealthKeydownRefs = 1;
}else{
kd._stealthKeydownRefs++;
}
}
return iel.add(node, event, del._fixCallback(fp));
},
remove: function(/*DOMNode*/ node, /*String*/ event, /*Handle*/ handle){
event = del._normalizeEventName(event);
iel.remove(node, event, handle);
if(event=="onkeypress"){
var kd = node.onkeydown;
if(--kd._stealthKeydownRefs <= 0){
iel.remove(node, "onkeydown", kd._stealthKeydownHandle);
delete kd._stealthKeydownHandle;
}
}
},
_normalizeEventName: function(/*String*/ eventName){
// Generally, eventName should be lower case, unless it is
// special somehow (e.g. a Mozilla event)
// ensure 'on'
return eventName.slice(0,2) != "on" ? "on" + eventName : eventName;
},
_nop: function(){},
_fixEvent: function(/*Event*/ evt, /*DOMNode*/ sender){
// summary:
// normalizes properties on the event object including event
// bubbling methods, keystroke normalization, and x/y positions
// evt:
// native event object
// sender:
// node to treat as "currentTarget"
if(!evt){
var w = sender && (sender.ownerDocument || sender.document || sender).parentWindow || window;
evt = w.event;
}
if(!evt){return(evt);}
evt.target = evt.srcElement;
evt.currentTarget = (sender || evt.srcElement);
evt.layerX = evt.offsetX;
evt.layerY = evt.offsetY;
// FIXME: scroll position query is duped from dojo.html to
// avoid dependency on that entire module. Now that HTML is in
// Base, we should convert back to something similar there.
var se = evt.srcElement, doc = (se && se.ownerDocument) || document;
// DO NOT replace the following to use dojo.body(), in IE, document.documentElement should be used
// here rather than document.body
var docBody = ((dojo.isIE < 6) || (doc["compatMode"] == "BackCompat")) ? doc.body : doc.documentElement;
var offset = dojo._getIeDocumentElementOffset();
evt.pageX = evt.clientX + dojo._fixIeBiDiScrollLeft(docBody.scrollLeft || 0) - offset.x;
evt.pageY = evt.clientY + (docBody.scrollTop || 0) - offset.y;
if(evt.type == "mouseover"){
evt.relatedTarget = evt.fromElement;
}
if(evt.type == "mouseout"){
evt.relatedTarget = evt.toElement;
}
evt.stopPropagation = del._stopPropagation;
evt.preventDefault = del._preventDefault;
return del._fixKeys(evt);
},
_fixKeys: function(evt){
switch(evt.type){
case "keypress":
var c = ("charCode" in evt ? evt.charCode : evt.keyCode);
if (c==10){
// CTRL-ENTER is CTRL-ASCII(10) on IE, but CTRL-ENTER on Mozilla
c=0;
evt.keyCode = 13;
}else if(c==13||c==27){
c=0; // Mozilla considers ENTER and ESC non-printable
}else if(c==3){
c=99; // Mozilla maps CTRL-BREAK to CTRL-c
}
// Mozilla sets keyCode to 0 when there is a charCode
// but that stops the event on IE.
evt.charCode = c;
del._setKeyChar(evt);
break;
}
return evt;
},
_stealthKeyDown: function(evt){
// IE doesn't fire keypress for most non-printable characters.
// other browsers do, we simulate it here.
var kp = evt.currentTarget.onkeypress;
// only works if kp exists and is a dispatcher
if(!kp || !kp[listenersName]){ return; }
// munge key/charCode
var k=evt.keyCode;
// These are Windows Virtual Key Codes
// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI/WindowsUserInterface/UserInput/VirtualKeyCodes.asp
var unprintable = k!=13 && k!=32 && k!=27 && (k<48||k>90) && (k<96||k>111) && (k<186||k>192) && (k<219||k>222);
// synthesize keypress for most unprintables and CTRL-keys
if(unprintable||evt.ctrlKey){
var c = unprintable ? 0 : k;
if(evt.ctrlKey){
if(k==3 || k==13){
return; // IE will post CTRL-BREAK, CTRL-ENTER as keypress natively
}else if(c>95 && c<106){
c -= 48; // map CTRL-[numpad 0-9] to ASCII
}else if((!evt.shiftKey)&&(c>=65&&c<=90)){
c += 32; // map CTRL-[A-Z] to lowercase
}else{
c = del._punctMap[c] || c; // map other problematic CTRL combinations to ASCII
}
}
// simulate a keypress event
var faux = del._synthesizeEvent(evt, {type: 'keypress', faux: true, charCode: c});
kp.call(evt.currentTarget, faux);
evt.cancelBubble = faux.cancelBubble;
evt.returnValue = faux.returnValue;
_trySetKeyCode(evt, faux.keyCode);
}
},
// Called in Event scope
_stopPropagation: function(){
this.cancelBubble = true;
},
_preventDefault: function(){
// Setting keyCode to 0 is the only way to prevent certain keypresses (namely
// ctrl-combinations that correspond to menu accelerator keys).
// Otoh, it prevents upstream listeners from getting this information
// Try to split the difference here by clobbering keyCode only for ctrl
// combinations. If you still need to access the key upstream, bubbledKeyCode is
// provided as a workaround.
this.bubbledKeyCode = this.keyCode;
if(this.ctrlKey){_trySetKeyCode(this, 0);}
this.returnValue = false;
}
});
// override stopEvent for IE
dojo.stopEvent = function(evt){
evt = evt || window.event;
del._stopPropagation.call(evt);
del._preventDefault.call(evt);
}
}
del._synthesizeEvent = function(evt, props){
var faux = dojo.mixin({}, evt, props);
del._setKeyChar(faux);
// FIXME: would prefer to use dojo.hitch: dojo.hitch(evt, evt.preventDefault);
// but it throws an error when preventDefault is invoked on Safari
// does Event.preventDefault not support "apply" on Safari?
faux.preventDefault = function(){ evt.preventDefault(); };
faux.stopPropagation = function(){ evt.stopPropagation(); };
return faux;
}
// Opera event normalization
if(dojo.isOpera){
dojo.mixin(del, {
_fixEvent: function(evt, sender){
switch(evt.type){
case "keypress":
var c = evt.which;
if(c==3){
c=99; // Mozilla maps CTRL-BREAK to CTRL-c
}
// can't trap some keys at all, like INSERT and DELETE
// there is no differentiating info between DELETE and ".", or INSERT and "-"
c = c<41 && !evt.shiftKey ? 0 : c;
if(evt.ctrlKey && !evt.shiftKey && c>=65 && c<=90){
// lowercase CTRL-[A-Z] keys
c += 32;
}
return del._synthesizeEvent(evt, { charCode: c });
}
return evt;
}
});
}
// Webkit event normalization
if(dojo.isWebKit){
del._add = del.add;
del._remove = del.remove;
dojo.mixin(del, {
add: function(/*DOMNode*/ node, /*String*/ event, /*Function*/ fp){
if(!node){return;} // undefined
var handle = del._add(node, event, fp);
if(del._normalizeEventName(event) == "keypress"){
// we need to listen to onkeydown to synthesize
// keypress events that otherwise won't fire
// in Safari 3.1+: https://lists.webkit.org/pipermail/webkit-dev/2007-December/002992.html
handle._stealthKeyDownHandle = del._add(node, "keydown", function(evt){
//A variation on the IE _stealthKeydown function
//Synthesize an onkeypress event, but only for unprintable characters.
var k=evt.keyCode;
// These are Windows Virtual Key Codes
// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI/WindowsUserInterface/UserInput/VirtualKeyCodes.asp
var unprintable = k!=13 && k!=32 && (k<48 || k>90) && (k<96 || k>111) && (k<186 || k>192) && (k<219 || k>222);
// synthesize keypress for most unprintables and CTRL-keys
if(unprintable || evt.ctrlKey){
var c = unprintable ? 0 : k;
if(evt.ctrlKey){
if(k==3 || k==13){
return; // IE will post CTRL-BREAK, CTRL-ENTER as keypress natively
}else if(c>95 && c<106){
c -= 48; // map CTRL-[numpad 0-9] to ASCII
}else if(!evt.shiftKey && c>=65 && c<=90){
c += 32; // map CTRL-[A-Z] to lowercase
}else{
c = del._punctMap[c] || c; // map other problematic CTRL combinations to ASCII
}
}
// simulate a keypress event
var faux = del._synthesizeEvent(evt, {type: 'keypress', faux: true, charCode: c});
fp.call(evt.currentTarget, faux);
}
});
}
return handle; /*Handle*/
},
remove: function(/*DOMNode*/ node, /*String*/ event, /*Handle*/ handle){
if(node){
if(handle._stealthKeyDownHandle){
del._remove(node, "keydown", handle._stealthKeyDownHandle);
}
del._remove(node, event, handle);
}
},
_fixEvent: function(evt, sender){
switch(evt.type){
case "keypress":
if(evt.faux){ return evt; }
var c = evt.charCode;
c = c>=32 ? c : 0;
return del._synthesizeEvent(evt, {charCode: c, faux: true});
}
return evt;
}
});
}
})();
if(dojo.isIE){
dojo._ieDispatcher=function(_3c,_3d){
var ap=Array.prototype,h=dojo._ie_listener.handlers,c=_3c.callee,ls=c[dojo._ieListenersName],t=h[c.target];
var r=t&&t.apply(_3d,_3c);
var lls=[].concat(ls);
for(var i in lls){
var f=h[lls[i]];
if(!(i in ap)&&f){
f.apply(_3d,_3c);
}
}
return r;
};
dojo._getIeDispatcher=function(){
return new Function(dojo._scopeName+"._ieDispatcher(arguments, this)");
};
dojo._event_listener._fixCallback=function(fp){
var f=dojo._event_listener._fixEvent;
return function(e){
return fp.call(this,f(e,this));
};
};
// keep this out of the closure
// closing over 'iel' or 'ieh' b0rks leak prevention
// ls[i] is an index into the master handler array
dojo._ieDispatcher = function(args, sender){
var ap = Array.prototype,
h = dojo._ie_listener.handlers,
c = args.callee,
ls = c[dojo._ieListenersName],
t = h[c.target];
// return value comes from original target function
var r = t && t.apply(sender, args);
// make local copy of listener array so it's immutable during processing
var lls = [].concat(ls);
// invoke listeners after target function
for(var i in lls){
var f = h[lls[i]];
if(!(i in ap) && f){
f.apply(sender, args);
}
}
return r;
}
dojo._getIeDispatcher = function(){
// ensure the returned function closes over nothing ("new Function" apparently doesn't close)
return new Function(dojo._scopeName + "._ieDispatcher(arguments, this)"); // function
}
// keep this out of the closure to reduce RAM allocation
dojo._event_listener._fixCallback = function(fp){
var f = dojo._event_listener._fixEvent;
return function(e){ return fp.call(this, f(e, this)); };
}
}
}

@ -5,298 +5,665 @@
*/
if(!dojo._hasResource["dojo._base.fx"]){
dojo._hasResource["dojo._base.fx"]=true;
if(!dojo._hasResource["dojo._base.fx"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo._base.fx"] = true;
dojo.provide("dojo._base.fx");
dojo.require("dojo._base.Color");
dojo.require("dojo._base.connect");
dojo.require("dojo._base.lang");
dojo.require("dojo._base.html");
/*
Animation loosely package based on Dan Pupius' work, contributed under CLA:
http://pupius.co.uk/js/Toolkit.Drawing.js
*/
(function(){
var d=dojo;
var _1=d._mixin;
dojo._Line=function(_2,_3){
this.start=_2;
this.end=_3;
};
dojo._Line.prototype.getValue=function(n){
return ((this.end-this.start)*n)+this.start;
};
dojo.Animation=function(_4){
_1(this,_4);
if(d.isArray(this.curve)){
this.curve=new d._Line(this.curve[0],this.curve[1]);
}
};
d._Animation=d.Animation;
d.extend(dojo.Animation,{duration:350,repeat:0,rate:20,_percent:0,_startRepeatCount:0,_getStep:function(){
var _5=this._percent,_6=this.easing;
return _6?_6(_5):_5;
},_fire:function(_7,_8){
var a=_8||[];
if(this[_7]){
if(d.config.debugAtAllCosts){
this[_7].apply(this,a);
}else{
try{
this[_7].apply(this,a);
}
catch(e){
console.error("exception in animation handler for:",_7);
console.error(e);
}
}
}
return this;
},play:function(_9,_a){
var _b=this;
if(_b._delayTimer){
_b._clearTimer();
}
if(_a){
_b._stopTimer();
_b._active=_b._paused=false;
_b._percent=0;
}else{
if(_b._active&&!_b._paused){
return _b;
}
}
_b._fire("beforeBegin",[_b.node]);
var de=_9||_b.delay,_c=dojo.hitch(_b,"_play",_a);
if(de>0){
_b._delayTimer=setTimeout(_c,de);
return _b;
}
_c();
return _b;
},_play:function(_d){
var _e=this;
if(_e._delayTimer){
_e._clearTimer();
}
_e._startTime=new Date().valueOf();
if(_e._paused){
_e._startTime-=_e.duration*_e._percent;
}
_e._active=true;
_e._paused=false;
var _f=_e.curve.getValue(_e._getStep());
if(!_e._percent){
if(!_e._startRepeatCount){
_e._startRepeatCount=_e.repeat;
}
_e._fire("onBegin",[_f]);
}
_e._fire("onPlay",[_f]);
_e._cycle();
return _e;
},pause:function(){
var _10=this;
if(_10._delayTimer){
_10._clearTimer();
}
_10._stopTimer();
if(!_10._active){
return _10;
}
_10._paused=true;
_10._fire("onPause",[_10.curve.getValue(_10._getStep())]);
return _10;
},gotoPercent:function(_11,_12){
var _13=this;
_13._stopTimer();
_13._active=_13._paused=true;
_13._percent=_11;
if(_12){
_13.play();
}
return _13;
},stop:function(_14){
var _15=this;
if(_15._delayTimer){
_15._clearTimer();
}
if(!_15._timer){
return _15;
}
_15._stopTimer();
if(_14){
_15._percent=1;
}
_15._fire("onStop",[_15.curve.getValue(_15._getStep())]);
_15._active=_15._paused=false;
return _15;
},status:function(){
if(this._active){
return this._paused?"paused":"playing";
}
return "stopped";
},_cycle:function(){
var _16=this;
if(_16._active){
var _17=new Date().valueOf();
var _18=(_17-_16._startTime)/(_16.duration);
if(_18>=1){
_18=1;
}
_16._percent=_18;
if(_16.easing){
_18=_16.easing(_18);
}
_16._fire("onAnimate",[_16.curve.getValue(_18)]);
if(_16._percent<1){
_16._startTimer();
}else{
_16._active=false;
if(_16.repeat>0){
_16.repeat--;
_16.play(null,true);
}else{
if(_16.repeat==-1){
_16.play(null,true);
}else{
if(_16._startRepeatCount){
_16.repeat=_16._startRepeatCount;
_16._startRepeatCount=0;
}
}
}
_16._percent=0;
_16._fire("onEnd",[_16.node]);
!_16.repeat&&_16._stopTimer();
}
}
return _16;
},_clearTimer:function(){
clearTimeout(this._delayTimer);
delete this._delayTimer;
}});
var ctr=0,_19=null,_1a={run:function(){
}};
d.extend(d.Animation,{_startTimer:function(){
if(!this._timer){
this._timer=d.connect(_1a,"run",this,"_cycle");
ctr++;
}
if(!_19){
_19=setInterval(d.hitch(_1a,"run"),this.rate);
}
},_stopTimer:function(){
if(this._timer){
d.disconnect(this._timer);
this._timer=null;
ctr--;
}
if(ctr<=0){
clearInterval(_19);
_19=null;
ctr=0;
}
}});
var _1b=d.isIE?function(_1c){
var ns=_1c.style;
if(!ns.width.length&&d.style(_1c,"width")=="auto"){
ns.width="auto";
}
}:function(){
};
dojo._fade=function(_1d){
_1d.node=d.byId(_1d.node);
var _1e=_1({properties:{}},_1d),_1f=(_1e.properties.opacity={});
_1f.start=!("start" in _1e)?function(){
return +d.style(_1e.node,"opacity")||0;
}:_1e.start;
_1f.end=_1e.end;
var _20=d.animateProperty(_1e);
d.connect(_20,"beforeBegin",d.partial(_1b,_1e.node));
return _20;
};
dojo.fadeIn=function(_21){
return d._fade(_1({end:1},_21));
};
dojo.fadeOut=function(_22){
return d._fade(_1({end:0},_22));
};
dojo._defaultEasing=function(n){
return 0.5+((Math.sin((n+1.5)*Math.PI))/2);
};
var _23=function(_24){
this._properties=_24;
for(var p in _24){
var _25=_24[p];
if(_25.start instanceof d.Color){
_25.tempColor=new d.Color();
}
}
};
_23.prototype.getValue=function(r){
var ret={};
for(var p in this._properties){
var _26=this._properties[p],_27=_26.start;
if(_27 instanceof d.Color){
ret[p]=d.blendColors(_27,_26.end,r,_26.tempColor).toCss();
}else{
if(!d.isArray(_27)){
ret[p]=((_26.end-_27)*r)+_27+(p!="opacity"?_26.units||"px":0);
}
}
}
return ret;
};
dojo.animateProperty=function(_28){
var n=_28.node=d.byId(_28.node);
if(!_28.easing){
_28.easing=d._defaultEasing;
}
var _29=new d.Animation(_28);
d.connect(_29,"beforeBegin",_29,function(){
var pm={};
for(var p in this.properties){
if(p=="width"||p=="height"){
this.node.display="block";
}
var _2a=this.properties[p];
if(d.isFunction(_2a)){
_2a=_2a(n);
}
_2a=pm[p]=_1({},(d.isObject(_2a)?_2a:{end:_2a}));
if(d.isFunction(_2a.start)){
_2a.start=_2a.start(n);
}
if(d.isFunction(_2a.end)){
_2a.end=_2a.end(n);
}
var _2b=(p.toLowerCase().indexOf("color")>=0);
function _2c(_2d,p){
var v={height:_2d.offsetHeight,width:_2d.offsetWidth}[p];
if(v!==undefined){
return v;
}
v=d.style(_2d,p);
return (p=="opacity")?+v:(_2b?v:parseFloat(v));
};
if(!("end" in _2a)){
_2a.end=_2c(n,p);
}else{
if(!("start" in _2a)){
_2a.start=_2c(n,p);
}
}
if(_2b){
_2a.start=new d.Color(_2a.start);
_2a.end=new d.Color(_2a.end);
}else{
_2a.start=(p=="opacity")?+_2a.start:parseFloat(_2a.start);
}
}
this.curve=new _23(pm);
});
d.connect(_29,"onAnimate",d.hitch(d,"style",_29.node));
return _29;
};
dojo.anim=function(_2e,_2f,_30,_31,_32,_33){
return d.animateProperty({node:_2e,duration:_30||d.Animation.prototype.duration,properties:_2f,easing:_31,onEnd:_32}).play(_33||0);
};
var d = dojo;
var _mixin = d._mixin;
dojo._Line = function(/*int*/ start, /*int*/ end){
// summary:
// dojo._Line is the object used to generate values from a start value
// to an end value
// start: int
// Beginning value for range
// end: int
// Ending value for range
this.start = start;
this.end = end;
};
dojo._Line.prototype.getValue = function(/*float*/ n){
// summary: Returns the point on the line
// n: a floating point number greater than 0 and less than 1
return ((this.end - this.start) * n) + this.start; // Decimal
};
dojo.Animation = function(args){
// summary:
// A generic animation class that fires callbacks into its handlers
// object at various states.
// description:
// A generic animation class that fires callbacks into its handlers
// object at various states. Nearly all dojo animation functions
// return an instance of this method, usually without calling the
// .play() method beforehand. Therefore, you will likely need to
// call .play() on instances of `dojo.Animation` when one is
// returned.
// args: Object
// The 'magic argument', mixing all the properties into this
// animation instance.
_mixin(this, args);
if(d.isArray(this.curve)){
this.curve = new d._Line(this.curve[0], this.curve[1]);
}
};
// Alias to drop come 2.0:
d._Animation = d.Animation;
d.extend(dojo.Animation, {
// duration: Integer
// The time in milliseonds the animation will take to run
duration: 350,
/*=====
// curve: dojo._Line|Array
// A two element array of start and end values, or a `dojo._Line` instance to be
// used in the Animation.
curve: null,
// easing: Function?
// A Function to adjust the acceleration (or deceleration) of the progress
// across a dojo._Line
easing: null,
=====*/
// repeat: Integer?
// The number of times to loop the animation
repeat: 0,
// rate: Integer?
// the time in milliseconds to wait before advancing to next frame
// (used as a fps timer: 1000/rate = fps)
rate: 20 /* 50 fps */,
/*=====
// delay: Integer?
// The time in milliseconds to wait before starting animation after it
// has been .play()'ed
delay: null,
// beforeBegin: Event?
// Synthetic event fired before a dojo.Animation begins playing (synchronous)
beforeBegin: null,
// onBegin: Event?
// Synthetic event fired as a dojo.Animation begins playing (useful?)
onBegin: null,
// onAnimate: Event?
// Synthetic event fired at each interval of a `dojo.Animation`
onAnimate: null,
// onEnd: Event?
// Synthetic event fired after the final frame of a `dojo.Animation`
onEnd: null,
// onPlay: Event?
// Synthetic event fired any time a `dojo.Animation` is play()'ed
onPlay: null,
// onPause: Event?
// Synthetic event fired when a `dojo.Animation` is paused
onPause: null,
// onStop: Event
// Synthetic event fires when a `dojo.Animation` is stopped
onStop: null,
=====*/
_percent: 0,
_startRepeatCount: 0,
_getStep: function(){
var _p = this._percent,
_e = this.easing
;
return _e ? _e(_p) : _p;
},
_fire: function(/*Event*/ evt, /*Array?*/ args){
// summary:
// Convenience function. Fire event "evt" and pass it the
// arguments specified in "args".
// description:
// Convenience function. Fire event "evt" and pass it the
// arguments specified in "args".
// Fires the callback in the scope of the `dojo.Animation`
// instance.
// evt:
// The event to fire.
// args:
// The arguments to pass to the event.
var a = args||[];
if(this[evt]){
if(d.config.debugAtAllCosts){
this[evt].apply(this, a);
}else{
try{
this[evt].apply(this, a);
}catch(e){
// squelch and log because we shouldn't allow exceptions in
// synthetic event handlers to cause the internal timer to run
// amuck, potentially pegging the CPU. I'm not a fan of this
// squelch, but hopefully logging will make it clear what's
// going on
console.error("exception in animation handler for:", evt);
console.error(e);
}
}
}
return this; // dojo.Animation
},
play: function(/*int?*/ delay, /*Boolean?*/ gotoStart){
// summary:
// Start the animation.
// delay:
// How many milliseconds to delay before starting.
// gotoStart:
// If true, starts the animation from the beginning; otherwise,
// starts it from its current position.
// returns: dojo.Animation
// The instance to allow chaining.
var _t = this;
if(_t._delayTimer){ _t._clearTimer(); }
if(gotoStart){
_t._stopTimer();
_t._active = _t._paused = false;
_t._percent = 0;
}else if(_t._active && !_t._paused){
return _t;
}
_t._fire("beforeBegin", [_t.node]);
var de = delay || _t.delay,
_p = dojo.hitch(_t, "_play", gotoStart);
if(de > 0){
_t._delayTimer = setTimeout(_p, de);
return _t;
}
_p();
return _t;
},
_play: function(gotoStart){
var _t = this;
if(_t._delayTimer){ _t._clearTimer(); }
_t._startTime = new Date().valueOf();
if(_t._paused){
_t._startTime -= _t.duration * _t._percent;
}
_t._active = true;
_t._paused = false;
var value = _t.curve.getValue(_t._getStep());
if(!_t._percent){
if(!_t._startRepeatCount){
_t._startRepeatCount = _t.repeat;
}
_t._fire("onBegin", [value]);
}
_t._fire("onPlay", [value]);
_t._cycle();
return _t; // dojo.Animation
},
pause: function(){
// summary: Pauses a running animation.
var _t = this;
if(_t._delayTimer){ _t._clearTimer(); }
_t._stopTimer();
if(!_t._active){ return _t; /*dojo.Animation*/ }
_t._paused = true;
_t._fire("onPause", [_t.curve.getValue(_t._getStep())]);
return _t; // dojo.Animation
},
gotoPercent: function(/*Decimal*/ percent, /*Boolean?*/ andPlay){
// summary:
// Sets the progress of the animation.
// percent:
// A percentage in decimal notation (between and including 0.0 and 1.0).
// andPlay:
// If true, play the animation after setting the progress.
var _t = this;
_t._stopTimer();
_t._active = _t._paused = true;
_t._percent = percent;
if(andPlay){ _t.play(); }
return _t; // dojo.Animation
},
stop: function(/*boolean?*/ gotoEnd){
// summary: Stops a running animation.
// gotoEnd: If true, the animation will end.
var _t = this;
if(_t._delayTimer){ _t._clearTimer(); }
if(!_t._timer){ return _t; /* dojo.Animation */ }
_t._stopTimer();
if(gotoEnd){
_t._percent = 1;
}
_t._fire("onStop", [_t.curve.getValue(_t._getStep())]);
_t._active = _t._paused = false;
return _t; // dojo.Animation
},
status: function(){
// summary:
// Returns a string token representation of the status of
// the animation, one of: "paused", "playing", "stopped"
if(this._active){
return this._paused ? "paused" : "playing"; // String
}
return "stopped"; // String
},
_cycle: function(){
var _t = this;
if(_t._active){
var curr = new Date().valueOf();
var step = (curr - _t._startTime) / (_t.duration);
if(step >= 1){
step = 1;
}
_t._percent = step;
// Perform easing
if(_t.easing){
step = _t.easing(step);
}
_t._fire("onAnimate", [_t.curve.getValue(step)]);
if(_t._percent < 1){
_t._startTimer();
}else{
_t._active = false;
if(_t.repeat > 0){
_t.repeat--;
_t.play(null, true);
}else if(_t.repeat == -1){
_t.play(null, true);
}else{
if(_t._startRepeatCount){
_t.repeat = _t._startRepeatCount;
_t._startRepeatCount = 0;
}
}
_t._percent = 0;
_t._fire("onEnd", [_t.node]);
!_t.repeat && _t._stopTimer();
}
}
return _t; // dojo.Animation
},
_clearTimer: function(){
// summary: Clear the play delay timer
clearTimeout(this._delayTimer);
delete this._delayTimer;
}
});
// the local timer, stubbed into all Animation instances
var ctr = 0,
timer = null,
runner = {
run: function(){}
};
d.extend(d.Animation, {
_startTimer: function(){
if(!this._timer){
this._timer = d.connect(runner, "run", this, "_cycle");
ctr++;
}
if(!timer){
timer = setInterval(d.hitch(runner, "run"), this.rate);
}
},
_stopTimer: function(){
if(this._timer){
d.disconnect(this._timer);
this._timer = null;
ctr--;
}
if(ctr <= 0){
clearInterval(timer);
timer = null;
ctr = 0;
}
}
});
var _makeFadeable =
d.isIE ? function(node){
// only set the zoom if the "tickle" value would be the same as the
// default
var ns = node.style;
// don't set the width to auto if it didn't already cascade that way.
// We don't want to f anyones designs
if(!ns.width.length && d.style(node, "width") == "auto"){
ns.width = "auto";
}
} :
function(){};
dojo._fade = function(/*Object*/ args){
// summary:
// Returns an animation that will fade the node defined by
// args.node from the start to end values passed (args.start
// args.end) (end is mandatory, start is optional)
args.node = d.byId(args.node);
var fArgs = _mixin({ properties: {} }, args),
props = (fArgs.properties.opacity = {});
props.start = !("start" in fArgs) ?
function(){
return +d.style(fArgs.node, "opacity")||0;
} : fArgs.start;
props.end = fArgs.end;
var anim = d.animateProperty(fArgs);
d.connect(anim, "beforeBegin", d.partial(_makeFadeable, fArgs.node));
return anim; // dojo.Animation
};
/*=====
dojo.__FadeArgs = function(node, duration, easing){
// node: DOMNode|String
// The node referenced in the animation
// duration: Integer?
// Duration of the animation in milliseconds.
// easing: Function?
// An easing function.
this.node = node;
this.duration = duration;
this.easing = easing;
}
=====*/
dojo.fadeIn = function(/*dojo.__FadeArgs*/ args){
// summary:
// Returns an animation that will fade node defined in 'args' from
// its current opacity to fully opaque.
return d._fade(_mixin({ end: 1 }, args)); // dojo.Animation
};
dojo.fadeOut = function(/*dojo.__FadeArgs*/ args){
// summary:
// Returns an animation that will fade node defined in 'args'
// from its current opacity to fully transparent.
return d._fade(_mixin({ end: 0 }, args)); // dojo.Animation
};
dojo._defaultEasing = function(/*Decimal?*/ n){
// summary: The default easing function for dojo.Animation(s)
return 0.5 + ((Math.sin((n + 1.5) * Math.PI)) / 2);
};
var PropLine = function(properties){
// PropLine is an internal class which is used to model the values of
// an a group of CSS properties across an animation lifecycle. In
// particular, the "getValue" function handles getting interpolated
// values between start and end for a particular CSS value.
this._properties = properties;
for(var p in properties){
var prop = properties[p];
if(prop.start instanceof d.Color){
// create a reusable temp color object to keep intermediate results
prop.tempColor = new d.Color();
}
}
};
PropLine.prototype.getValue = function(r){
var ret = {};
for(var p in this._properties){
var prop = this._properties[p],
start = prop.start;
if(start instanceof d.Color){
ret[p] = d.blendColors(start, prop.end, r, prop.tempColor).toCss();
}else if(!d.isArray(start)){
ret[p] = ((prop.end - start) * r) + start + (p != "opacity" ? prop.units || "px" : 0);
}
}
return ret;
};
/*=====
dojo.declare("dojo.__AnimArgs", [dojo.__FadeArgs], {
// Properties: Object?
// A hash map of style properties to Objects describing the transition,
// such as the properties of dojo._Line with an additional 'units' property
properties: {}
//TODOC: add event callbacks
});
=====*/
dojo.animateProperty = function(/*dojo.__AnimArgs*/ args){
// summary:
// Returns an animation that will transition the properties of
// node defined in `args` depending how they are defined in
// `args.properties`
//
// description:
// `dojo.animateProperty` is the foundation of most `dojo.fx`
// animations. It takes an object of "properties" corresponding to
// style properties, and animates them in parallel over a set
// duration.
//
// example:
// A simple animation that changes the width of the specified node.
// | dojo.animateProperty({
// | node: "nodeId",
// | properties: { width: 400 },
// | }).play();
// Dojo figures out the start value for the width and converts the
// integer specified for the width to the more expressive but
// verbose form `{ width: { end: '400', units: 'px' } }` which you
// can also specify directly. Defaults to 'px' if ommitted.
//
// example:
// Animate width, height, and padding over 2 seconds... the
// pedantic way:
// | dojo.animateProperty({ node: node, duration:2000,
// | properties: {
// | width: { start: '200', end: '400', units:"px" },
// | height: { start:'200', end: '400', units:"px" },
// | paddingTop: { start:'5', end:'50', units:"px" }
// | }
// | }).play();
// Note 'paddingTop' is used over 'padding-top'. Multi-name CSS properties
// are written using "mixed case", as the hyphen is illegal as an object key.
//
// example:
// Plug in a different easing function and register a callback for
// when the animation ends. Easing functions accept values between
// zero and one and return a value on that basis. In this case, an
// exponential-in curve.
// | dojo.animateProperty({
// | node: "nodeId",
// | // dojo figures out the start value
// | properties: { width: { end: 400 } },
// | easing: function(n){
// | return (n==0) ? 0 : Math.pow(2, 10 * (n - 1));
// | },
// | onEnd: function(node){
// | // called when the animation finishes. The animation
// | // target is passed to this function
// | }
// | }).play(500); // delay playing half a second
//
// example:
// Like all `dojo.Animation`s, animateProperty returns a handle to the
// Animation instance, which fires the events common to Dojo FX. Use `dojo.connect`
// to access these events outside of the Animation definiton:
// | var anim = dojo.animateProperty({
// | node:"someId",
// | properties:{
// | width:400, height:500
// | }
// | });
// | dojo.connect(anim,"onEnd", function(){
// | console.log("animation ended");
// | });
// | // play the animation now:
// | anim.play();
//
// example:
// Each property can be a function whose return value is substituted along.
// Additionally, each measurement (eg: start, end) can be a function. The node
// reference is passed direcly to callbacks.
// | dojo.animateProperty({
// | node:"mine",
// | properties:{
// | height:function(node){
// | // shrink this node by 50%
// | return dojo.position(node).h / 2
// | },
// | width:{
// | start:function(node){ return 100; },
// | end:function(node){ return 200; }
// | }
// | }
// | }).play();
//
var n = args.node = d.byId(args.node);
if(!args.easing){ args.easing = d._defaultEasing; }
var anim = new d.Animation(args);
d.connect(anim, "beforeBegin", anim, function(){
var pm = {};
for(var p in this.properties){
// Make shallow copy of properties into pm because we overwrite
// some values below. In particular if start/end are functions
// we don't want to overwrite them or the functions won't be
// called if the animation is reused.
if(p == "width" || p == "height"){
this.node.display = "block";
}
var prop = this.properties[p];
if(d.isFunction(prop)){
prop = prop(n);
}
prop = pm[p] = _mixin({}, (d.isObject(prop) ? prop: { end: prop }));
if(d.isFunction(prop.start)){
prop.start = prop.start(n);
}
if(d.isFunction(prop.end)){
prop.end = prop.end(n);
}
var isColor = (p.toLowerCase().indexOf("color") >= 0);
function getStyle(node, p){
// dojo.style(node, "height") can return "auto" or "" on IE; this is more reliable:
var v = { height: node.offsetHeight, width: node.offsetWidth }[p];
if(v !== undefined){ return v; }
v = d.style(node, p);
return (p == "opacity") ? +v : (isColor ? v : parseFloat(v));
}
if(!("end" in prop)){
prop.end = getStyle(n, p);
}else if(!("start" in prop)){
prop.start = getStyle(n, p);
}
if(isColor){
prop.start = new d.Color(prop.start);
prop.end = new d.Color(prop.end);
}else{
prop.start = (p == "opacity") ? +prop.start : parseFloat(prop.start);
}
}
this.curve = new PropLine(pm);
});
d.connect(anim, "onAnimate", d.hitch(d, "style", anim.node));
return anim; // dojo.Animation
};
dojo.anim = function( /*DOMNode|String*/ node,
/*Object*/ properties,
/*Integer?*/ duration,
/*Function?*/ easing,
/*Function?*/ onEnd,
/*Integer?*/ delay){
// summary:
// A simpler interface to `dojo.animateProperty()`, also returns
// an instance of `dojo.Animation` but begins the animation
// immediately, unlike nearly every other Dojo animation API.
// description:
// `dojo.anim` is a simpler (but somewhat less powerful) version
// of `dojo.animateProperty`. It uses defaults for many basic properties
// and allows for positional parameters to be used in place of the
// packed "property bag" which is used for other Dojo animation
// methods.
//
// The `dojo.Animation` object returned from `dojo.anim` will be
// already playing when it is returned from this function, so
// calling play() on it again is (usually) a no-op.
// node:
// a DOM node or the id of a node to animate CSS properties on
// duration:
// The number of milliseconds over which the animation
// should run. Defaults to the global animation default duration
// (350ms).
// easing:
// An easing function over which to calculate acceleration
// and deceleration of the animation through its duration.
// A default easing algorithm is provided, but you may
// plug in any you wish. A large selection of easing algorithms
// are available in `dojo.fx.easing`.
// onEnd:
// A function to be called when the animation finishes
// running.
// delay:
// The number of milliseconds to delay beginning the
// animation by. The default is 0.
// example:
// Fade out a node
// | dojo.anim("id", { opacity: 0 });
// example:
// Fade out a node over a full second
// | dojo.anim("id", { opacity: 0 }, 1000);
return d.animateProperty({ // dojo.Animation
node: node,
duration: duration || d.Animation.prototype.duration,
properties: properties,
easing: easing,
onEnd: onEnd
}).play(delay || 0);
};
})();
}

File diff suppressed because it is too large Load Diff

@ -5,77 +5,150 @@
*/
if(!dojo._hasResource["dojo._base.json"]){
dojo._hasResource["dojo._base.json"]=true;
if(!dojo._hasResource["dojo._base.json"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo._base.json"] = true;
dojo.provide("dojo._base.json");
dojo.fromJson=function(_1){
return eval("("+_1+")");
};
dojo._escapeString=function(_2){
return ("\""+_2.replace(/(["\\])/g,"\\$1")+"\"").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r");
};
dojo.toJsonIndentStr="\t";
dojo.toJson=function(it,_3,_4){
if(it===undefined){
return "undefined";
}
var _5=typeof it;
if(_5=="number"||_5=="boolean"){
return it+"";
}
if(it===null){
return "null";
}
if(dojo.isString(it)){
return dojo._escapeString(it);
}
var _6=arguments.callee;
var _7;
_4=_4||"";
var _8=_3?_4+dojo.toJsonIndentStr:"";
var tf=it.__json__||it.json;
if(dojo.isFunction(tf)){
_7=tf.call(it);
if(it!==_7){
return _6(_7,_3,_8);
}
}
if(it.nodeType&&it.cloneNode){
throw new Error("Can't serialize DOM nodes");
}
var _9=_3?" ":"";
var _a=_3?"\n":"";
if(dojo.isArray(it)){
var _b=dojo.map(it,function(_c){
var _d=_6(_c,_3,_8);
if(typeof _d!="string"){
_d="undefined";
}
return _a+_8+_d;
});
return "["+_b.join(","+_9)+_a+_4+"]";
}
if(_5=="function"){
return null;
}
var _e=[],_f;
for(_f in it){
var _10,val;
if(typeof _f=="number"){
_10="\""+_f+"\"";
}else{
if(typeof _f=="string"){
_10=dojo._escapeString(_f);
}else{
continue;
}
dojo.fromJson = function(/*String*/ json){
// summary:
// Parses a [JSON](http://json.org) string to return a JavaScript object.
// description:
// Throws for invalid JSON strings, but it does not use a strict JSON parser. It
// delegates to eval(). The content passed to this method must therefore come
// from a trusted source.
// json:
// a string literal of a JSON item, for instance:
// `'{ "foo": [ "bar", 1, { "baz": "thud" } ] }'`
return eval("(" + json + ")"); // Object
}
val=_6(it[_f],_3,_8);
if(typeof val!="string"){
continue;
dojo._escapeString = function(/*String*/str){
//summary:
// Adds escape sequences for non-visual characters, double quote and
// backslash and surrounds with double quotes to form a valid string
// literal.
return ('"' + str.replace(/(["\\])/g, '\\$1') + '"').
replace(/[\f]/g, "\\f").replace(/[\b]/g, "\\b").replace(/[\n]/g, "\\n").
replace(/[\t]/g, "\\t").replace(/[\r]/g, "\\r"); // string
}
_e.push(_a+_8+_10+":"+_9+val);
dojo.toJsonIndentStr = "\t";
dojo.toJson = function(/*Object*/ it, /*Boolean?*/ prettyPrint, /*String?*/ _indentStr){
// summary:
// Returns a [JSON](http://json.org) serialization of an object.
// description:
// Returns a [JSON](http://json.org) serialization of an object.
// Note that this doesn't check for infinite recursion, so don't do that!
// it:
// an object to be serialized. Objects may define their own
// serialization via a special "__json__" or "json" function
// property. If a specialized serializer has been defined, it will
// be used as a fallback.
// prettyPrint:
// if true, we indent objects and arrays to make the output prettier.
// The variable `dojo.toJsonIndentStr` is used as the indent string --
// to use something other than the default (tab), change that variable
// before calling dojo.toJson().
// _indentStr:
// private variable for recursive calls when pretty printing, do not use.
// example:
// simple serialization of a trivial object
// | var jsonStr = dojo.toJson({ howdy: "stranger!", isStrange: true });
// | doh.is('{"howdy":"stranger!","isStrange":true}', jsonStr);
// example:
// a custom serializer for an objects of a particular class:
// | dojo.declare("Furby", null, {
// | furbies: "are strange",
// | furbyCount: 10,
// | __json__: function(){
// | },
// | });
if(it === undefined){
return "undefined";
}
var objtype = typeof it;
if(objtype == "number" || objtype == "boolean"){
return it + "";
}
if(it === null){
return "null";
}
if(dojo.isString(it)){
return dojo._escapeString(it);
}
// recurse
var recurse = arguments.callee;
// short-circuit for objects that support "json" serialization
// if they return "self" then just pass-through...
var newObj;
_indentStr = _indentStr || "";
var nextIndent = prettyPrint ? _indentStr + dojo.toJsonIndentStr : "";
var tf = it.__json__||it.json;
if(dojo.isFunction(tf)){
newObj = tf.call(it);
if(it !== newObj){
return recurse(newObj, prettyPrint, nextIndent);
}
}
if(it.nodeType && it.cloneNode){ // isNode
// we can't seriailize DOM nodes as regular objects because they have cycles
// DOM nodes could be serialized with something like outerHTML, but
// that can be provided by users in the form of .json or .__json__ function.
throw new Error("Can't serialize DOM nodes");
}
var sep = prettyPrint ? " " : "";
var newLine = prettyPrint ? "\n" : "";
// array
if(dojo.isArray(it)){
var res = dojo.map(it, function(obj){
var val = recurse(obj, prettyPrint, nextIndent);
if(typeof val != "string"){
val = "undefined";
}
return newLine + nextIndent + val;
});
return "[" + res.join("," + sep) + newLine + _indentStr + "]";
}
/*
// look in the registry
try {
window.o = it;
newObj = dojo.json.jsonRegistry.match(it);
return recurse(newObj, prettyPrint, nextIndent);
}catch(e){
// console.log(e);
}
// it's a function with no adapter, skip it
*/
if(objtype == "function"){
return null; // null
}
// generic object code path
var output = [], key;
for(key in it){
var keyStr, val;
if(typeof key == "number"){
keyStr = '"' + key + '"';
}else if(typeof key == "string"){
keyStr = dojo._escapeString(key);
}else{
// skip non-string or number keys
continue;
}
val = recurse(it[key], prettyPrint, nextIndent);
if(typeof val != "string"){
// skip non-serializable values
continue;
}
// FIXME: use += on Moz!!
// MOW NOTE: using += is a pain because you have to account for the dangling comma...
output.push(newLine + nextIndent + keyStr + ":" + sep + val);
}
return "{" + output.join("," + sep) + newLine + _indentStr + "}"; // String
}
return "{"+_e.join(","+_9)+_a+_4+"}";
};
}

@ -5,144 +5,388 @@
*/
if(!dojo._hasResource["dojo._base.lang"]){
dojo._hasResource["dojo._base.lang"]=true;
if(!dojo._hasResource["dojo._base.lang"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo._base.lang"] = true;
dojo.provide("dojo._base.lang");
(function(){
var d=dojo,_1=Object.prototype.toString;
dojo.isString=function(it){
return (typeof it=="string"||it instanceof String);
};
dojo.isArray=function(it){
return it&&(it instanceof Array||typeof it=="array");
};
dojo.isFunction=function(it){
return _1.call(it)==="[object Function]";
};
dojo.isObject=function(it){
return it!==undefined&&(it===null||typeof it=="object"||d.isArray(it)||d.isFunction(it));
};
dojo.isArrayLike=function(it){
return it&&it!==undefined&&!d.isString(it)&&!d.isFunction(it)&&!(it.tagName&&it.tagName.toLowerCase()=="form")&&(d.isArray(it)||isFinite(it.length));
};
dojo.isAlien=function(it){
return it&&!d.isFunction(it)&&/\{\s*\[native code\]\s*\}/.test(String(it));
};
dojo.extend=function(_2,_3){
for(var i=1,l=arguments.length;i<l;i++){
d._mixin(_2.prototype,arguments[i]);
}
return _2;
};
dojo._hitchArgs=function(_4,_5){
var _6=d._toArray(arguments,2);
var _7=d.isString(_5);
return function(){
var _8=d._toArray(arguments);
var f=_7?(_4||d.global)[_5]:_5;
return f&&f.apply(_4||this,_6.concat(_8));
};
};
dojo.hitch=function(_9,_a){
if(arguments.length>2){
return d._hitchArgs.apply(d,arguments);
}
if(!_a){
_a=_9;
_9=null;
}
if(d.isString(_a)){
_9=_9||d.global;
if(!_9[_a]){
throw (["dojo.hitch: scope[\"",_a,"\"] is null (scope=\"",_9,"\")"].join(""));
}
return function(){
return _9[_a].apply(_9,arguments||[]);
};
}
return !_9?_a:function(){
return _a.apply(_9,arguments||[]);
};
};
dojo.delegate=dojo._delegate=(function(){
function _b(){
};
return function(_c,_d){
_b.prototype=_c;
var _e=new _b();
_b.prototype=null;
if(_d){
d._mixin(_e,_d);
}
return _e;
};
})();
var _f=function(obj,_10,_11){
return (_11||[]).concat(Array.prototype.slice.call(obj,_10||0));
};
var _12=function(obj,_13,_14){
var arr=_14||[];
for(var x=_13||0;x<obj.length;x++){
arr.push(obj[x]);
}
return arr;
};
dojo._toArray=d.isIE?function(obj){
return ((obj.item)?_12:_f).apply(this,arguments);
}:_f;
dojo.partial=function(_15){
var arr=[null];
return d.hitch.apply(d,arr.concat(d._toArray(arguments)));
};
var _16=d._extraNames,_17=_16.length,_18={};
dojo.clone=function(o){
if(!o||typeof o!="object"||d.isFunction(o)){
return o;
}
if(o.nodeType&&"cloneNode" in o){
return o.cloneNode(true);
}
if(o instanceof Date){
return new Date(o.getTime());
}
var r,i,l,s,_19;
if(d.isArray(o)){
r=[];
for(i=0,l=o.length;i<l;++i){
if(i in o){
r.push(d.clone(o[i]));
}
}
}else{
r=o.constructor?new o.constructor():{};
}
for(_19 in o){
s=o[_19];
if(!(_19 in r)||(r[_19]!==s&&(!(_19 in _18)||_18[_19]!==s))){
r[_19]=d.clone(s);
}
}
if(_17){
for(i=0;i<_17;++i){
_19=_16[i];
s=o[_19];
if(!(_19 in r)||(r[_19]!==s&&(!(_19 in _18)||_18[_19]!==s))){
r[_19]=s;
}
}
}
return r;
};
dojo.trim=String.prototype.trim?function(str){
return str.trim();
}:function(str){
return str.replace(/^\s\s*/,"").replace(/\s\s*$/,"");
};
var _1a=/\{([^\}]+)\}/g;
dojo.replace=function(_1b,map,_1c){
return _1b.replace(_1c||_1a,d.isFunction(map)?map:function(_1d,k){
return d.getObject(k,false,map);
});
};
var d = dojo, opts = Object.prototype.toString;
// Crockford (ish) functions
dojo.isString = function(/*anything*/ it){
// summary:
// Return true if it is a String
return (typeof it == "string" || it instanceof String); // Boolean
}
dojo.isArray = function(/*anything*/ it){
// summary:
// Return true if it is an Array.
// Does not work on Arrays created in other windows.
return it && (it instanceof Array || typeof it == "array"); // Boolean
}
dojo.isFunction = function(/*anything*/ it){
// summary:
// Return true if it is a Function
return opts.call(it) === "[object Function]";
};
dojo.isObject = function(/*anything*/ it){
// summary:
// Returns true if it is a JavaScript object (or an Array, a Function
// or null)
return it !== undefined &&
(it === null || typeof it == "object" || d.isArray(it) || d.isFunction(it)); // Boolean
}
dojo.isArrayLike = function(/*anything*/ it){
// summary:
// similar to dojo.isArray() but more permissive
// description:
// Doesn't strongly test for "arrayness". Instead, settles for "isn't
// a string or number and has a length property". Arguments objects
// and DOM collections will return true when passed to
// dojo.isArrayLike(), but will return false when passed to
// dojo.isArray().
// returns:
// If it walks like a duck and quacks like a duck, return `true`
return it && it !== undefined && // Boolean
// keep out built-in constructors (Number, String, ...) which have length
// properties
!d.isString(it) && !d.isFunction(it) &&
!(it.tagName && it.tagName.toLowerCase() == 'form') &&
(d.isArray(it) || isFinite(it.length));
}
dojo.isAlien = function(/*anything*/ it){
// summary:
// Returns true if it is a built-in function or some other kind of
// oddball that *should* report as a function but doesn't
return it && !d.isFunction(it) && /\{\s*\[native code\]\s*\}/.test(String(it)); // Boolean
}
dojo.extend = function(/*Object*/ constructor, /*Object...*/ props){
// summary:
// Adds all properties and methods of props to constructor's
// prototype, making them available to all instances created with
// constructor.
for(var i=1, l=arguments.length; i<l; i++){
d._mixin(constructor.prototype, arguments[i]);
}
return constructor; // Object
}
dojo._hitchArgs = function(scope, method /*,...*/){
var pre = d._toArray(arguments, 2);
var named = d.isString(method);
return function(){
// arrayify arguments
var args = d._toArray(arguments);
// locate our method
var f = named ? (scope||d.global)[method] : method;
// invoke with collected args
return f && f.apply(scope || this, pre.concat(args)); // mixed
} // Function
}
dojo.hitch = function(/*Object*/scope, /*Function|String*/method /*,...*/){
// summary:
// Returns a function that will only ever execute in the a given scope.
// This allows for easy use of object member functions
// in callbacks and other places in which the "this" keyword may
// otherwise not reference the expected scope.
// Any number of default positional arguments may be passed as parameters
// beyond "method".
// Each of these values will be used to "placehold" (similar to curry)
// for the hitched function.
// scope:
// The scope to use when method executes. If method is a string,
// scope is also the object containing method.
// method:
// A function to be hitched to scope, or the name of the method in
// scope to be hitched.
// example:
// | dojo.hitch(foo, "bar")();
// runs foo.bar() in the scope of foo
// example:
// | dojo.hitch(foo, myFunction);
// returns a function that runs myFunction in the scope of foo
// example:
// Expansion on the default positional arguments passed along from
// hitch. Passed args are mixed first, additional args after.
// | var foo = { bar: function(a, b, c){ console.log(a, b, c); } };
// | var fn = dojo.hitch(foo, "bar", 1, 2);
// | fn(3); // logs "1, 2, 3"
// example:
// | var foo = { bar: 2 };
// | dojo.hitch(foo, function(){ this.bar = 10; })();
// execute an anonymous function in scope of foo
if(arguments.length > 2){
return d._hitchArgs.apply(d, arguments); // Function
}
if(!method){
method = scope;
scope = null;
}
if(d.isString(method)){
scope = scope || d.global;
if(!scope[method]){ throw(['dojo.hitch: scope["', method, '"] is null (scope="', scope, '")'].join('')); }
return function(){ return scope[method].apply(scope, arguments || []); }; // Function
}
return !scope ? method : function(){ return method.apply(scope, arguments || []); }; // Function
}
/*=====
dojo.delegate = function(obj, props){
// summary:
// Returns a new object which "looks" to obj for properties which it
// does not have a value for. Optionally takes a bag of properties to
// seed the returned object with initially.
// description:
// This is a small implementaton of the Boodman/Crockford delegation
// pattern in JavaScript. An intermediate object constructor mediates
// the prototype chain for the returned object, using it to delegate
// down to obj for property lookup when object-local lookup fails.
// This can be thought of similarly to ES4's "wrap", save that it does
// not act on types but rather on pure objects.
// obj:
// The object to delegate to for properties not found directly on the
// return object or in props.
// props:
// an object containing properties to assign to the returned object
// returns:
// an Object of anonymous type
// example:
// | var foo = { bar: "baz" };
// | var thinger = dojo.delegate(foo, { thud: "xyzzy"});
// | thinger.bar == "baz"; // delegated to foo
// | foo.thud == undefined; // by definition
// | thinger.thud == "xyzzy"; // mixed in from props
// | foo.bar = "thonk";
// | thinger.bar == "thonk"; // still delegated to foo's bar
}
=====*/
dojo.delegate = dojo._delegate = (function(){
// boodman/crockford delegation w/ cornford optimization
function TMP(){}
return function(obj, props){
TMP.prototype = obj;
var tmp = new TMP();
TMP.prototype = null;
if(props){
d._mixin(tmp, props);
}
return tmp; // Object
}
})();
/*=====
dojo._toArray = function(obj, offset, startWith){
// summary:
// Converts an array-like object (i.e. arguments, DOMCollection) to an
// array. Returns a new Array with the elements of obj.
// obj: Object
// the object to "arrayify". We expect the object to have, at a
// minimum, a length property which corresponds to integer-indexed
// properties.
// offset: Number?
// the location in obj to start iterating from. Defaults to 0.
// Optional.
// startWith: Array?
// An array to pack with the properties of obj. If provided,
// properties in obj are appended at the end of startWith and
// startWith is the returned array.
}
=====*/
var efficient = function(obj, offset, startWith){
return (startWith||[]).concat(Array.prototype.slice.call(obj, offset||0));
};
var slow = function(obj, offset, startWith){
var arr = startWith||[];
for(var x = offset || 0; x < obj.length; x++){
arr.push(obj[x]);
}
return arr;
};
dojo._toArray =
d.isIE ? function(obj){
return ((obj.item) ? slow : efficient).apply(this, arguments);
} :
efficient;
dojo.partial = function(/*Function|String*/method /*, ...*/){
// summary:
// similar to hitch() except that the scope object is left to be
// whatever the execution context eventually becomes.
// description:
// Calling dojo.partial is the functional equivalent of calling:
// | dojo.hitch(null, funcName, ...);
var arr = [ null ];
return d.hitch.apply(d, arr.concat(d._toArray(arguments))); // Function
}
var extraNames = d._extraNames, extraLen = extraNames.length, empty = {};
dojo.clone = function(/*anything*/ o){
// summary:
// Clones objects (including DOM nodes) and all children.
// Warning: do not clone cyclic structures.
if(!o || typeof o != "object" || d.isFunction(o)){
// null, undefined, any non-object, or function
return o; // anything
}
if(o.nodeType && "cloneNode" in o){
// DOM Node
return o.cloneNode(true); // Node
}
if(o instanceof Date){
// Date
return new Date(o.getTime()); // Date
}
var r, i, l, s, name;
if(d.isArray(o)){
// array
r = [];
for(i = 0, l = o.length; i < l; ++i){
if(i in o){
r.push(d.clone(o[i]));
}
}
// we don't clone functions for performance reasons
// }else if(d.isFunction(o)){
// // function
// r = function(){ return o.apply(this, arguments); };
}else{
// generic objects
r = o.constructor ? new o.constructor() : {};
}
for(name in o){
// the "tobj" condition avoid copying properties in "source"
// inherited from Object.prototype. For example, if target has a custom
// toString() method, don't overwrite it with the toString() method
// that source inherited from Object.prototype
s = o[name];
if(!(name in r) || (r[name] !== s && (!(name in empty) || empty[name] !== s))){
r[name] = d.clone(s);
}
}
// IE doesn't recognize some custom functions in for..in
if(extraLen){
for(i = 0; i < extraLen; ++i){
name = extraNames[i];
s = o[name];
if(!(name in r) || (r[name] !== s && (!(name in empty) || empty[name] !== s))){
r[name] = s; // functions only, we don't clone them
}
}
}
return r; // Object
}
/*=====
dojo.trim = function(str){
// summary:
// Trims whitespace from both sides of the string
// str: String
// String to be trimmed
// returns: String
// Returns the trimmed string
// description:
// This version of trim() was selected for inclusion into the base due
// to its compact size and relatively good performance
// (see [Steven Levithan's blog](http://blog.stevenlevithan.com/archives/faster-trim-javascript)
// Uses String.prototype.trim instead, if available.
// The fastest but longest version of this function is located at
// dojo.string.trim()
return ""; // String
}
=====*/
dojo.trim = String.prototype.trim ?
function(str){ return str.trim(); } :
function(str){ return str.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); };
/*=====
dojo.replace = function(tmpl, map, pattern){
// summary:
// Performs parameterized substitutions on a string. Throws an
// exception if any parameter is unmatched.
// tmpl: String
// String to be used as a template.
// map: Object|Function
// If an object, it is used as a dictionary to look up substitutions.
// If a function, it is called for every substitution with following
// parameters: a whole match, a name, an offset, and the whole template
// string (see https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/replace
// for more details).
// pattern: RegEx?
// Optional regular expression objects that overrides the default pattern.
// Must be global and match one item. The default is: /\{([^\}]+)\}/g,
// which matches patterns like that: "{xxx}", where "xxx" is any sequence
// of characters, which doesn't include "}".
// returns: String
// Returns the substituted string.
// example:
// | // uses a dictionary for substitutions:
// | dojo.replace("Hello, {name.first} {name.last} AKA {nick}!",
// | {
// | nick: "Bob",
// | name: {
// | first: "Robert",
// | middle: "X",
// | last: "Cringely"
// | }
// | });
// | // returns: Hello, Robert Cringely AKA Bob!
// example:
// | // uses an array for substitutions:
// | dojo.replace("Hello, {0} {2}!",
// | ["Robert", "X", "Cringely"]);
// | // returns: Hello, Robert Cringely!
// example:
// | // uses a function for substitutions:
// | function sum(a){
// | var t = 0;
// | dojo.forEach(a, function(x){ t += x; });
// | return t;
// | }
// | dojo.replace(
// | "{count} payments averaging {avg} USD per payment.",
// | dojo.hitch(
// | { payments: [11, 16, 12] },
// | function(_, key){
// | switch(key){
// | case "count": return this.payments.length;
// | case "min": return Math.min.apply(Math, this.payments);
// | case "max": return Math.max.apply(Math, this.payments);
// | case "sum": return sum(this.payments);
// | case "avg": return sum(this.payments) / this.payments.length;
// | }
// | }
// | )
// | );
// | // prints: 3 payments averaging 13 USD per payment.
// example:
// | // uses an alternative PHP-like pattern for substitutions:
// | dojo.replace("Hello, ${0} ${2}!",
// | ["Robert", "X", "Cringely"], /\$\{([^\}]+)\}/g);
// | // returns: Hello, Robert Cringely!
return ""; // String
}
=====*/
var _pattern = /\{([^\}]+)\}/g;
dojo.replace = function(tmpl, map, pattern){
return tmpl.replace(pattern || _pattern, d.isFunction(map) ?
map : function(_, k){ return d.getObject(k, false, map); });
};
})();
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -5,45 +5,104 @@
*/
if(!dojo._hasResource["dojo._base.window"]){
dojo._hasResource["dojo._base.window"]=true;
if(!dojo._hasResource["dojo._base.window"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo._base.window"] = true;
dojo.provide("dojo._base.window");
dojo.doc=window["document"]||null;
dojo.body=function(){
return dojo.doc.body||dojo.doc.getElementsByTagName("body")[0];
};
dojo.setContext=function(_1,_2){
dojo.global=_1;
dojo.doc=_2;
};
dojo.withGlobal=function(_3,_4,_5,_6){
var _7=dojo.global;
try{
dojo.global=_3;
return dojo.withDoc.call(null,_3.document,_4,_5,_6);
/*=====
dojo.doc = {
// summary:
// Alias for the current document. 'dojo.doc' can be modified
// for temporary context shifting. Also see dojo.withDoc().
// description:
// Refer to dojo.doc rather
// than referring to 'window.document' to ensure your code runs
// correctly in managed contexts.
// example:
// | n.appendChild(dojo.doc.createElement('div'));
}
finally{
dojo.global=_7;
=====*/
dojo.doc = window["document"] || null;
dojo.body = function(){
// summary:
// Return the body element of the document
// return the body object associated with dojo.doc
// example:
// | dojo.body().appendChild(dojo.doc.createElement('div'));
// Note: document.body is not defined for a strict xhtml document
// Would like to memoize this, but dojo.doc can change vi dojo.withDoc().
return dojo.doc.body || dojo.doc.getElementsByTagName("body")[0]; // Node
}
dojo.setContext = function(/*Object*/globalObject, /*DocumentElement*/globalDocument){
// summary:
// changes the behavior of many core Dojo functions that deal with
// namespace and DOM lookup, changing them to work in a new global
// context (e.g., an iframe). The varibles dojo.global and dojo.doc
// are modified as a result of calling this function and the result of
// `dojo.body()` likewise differs.
dojo.global = globalObject;
dojo.doc = globalDocument;
};
dojo.withDoc=function(_8,_9,_a,_b){
var _c=dojo.doc,_d=dojo._bodyLtr,_e=dojo.isQuirks;
try{
dojo.doc=_8;
delete dojo._bodyLtr;
dojo.isQuirks=dojo.doc.compatMode=="BackCompat";
if(_a&&typeof _9=="string"){
_9=_a[_9];
}
return _9.apply(_a,_b||[]);
}
finally{
dojo.doc=_c;
delete dojo._bodyLtr;
if(_d!==undefined){
dojo._bodyLtr=_d;
}
dojo.isQuirks=_e;
dojo.withGlobal = function( /*Object*/globalObject,
/*Function*/callback,
/*Object?*/thisObject,
/*Array?*/cbArguments){
// summary:
// Invoke callback with globalObject as dojo.global and
// globalObject.document as dojo.doc.
// description:
// Invoke callback with globalObject as dojo.global and
// globalObject.document as dojo.doc. If provided, globalObject
// will be executed in the context of object thisObject
// When callback() returns or throws an error, the dojo.global
// and dojo.doc will be restored to its previous state.
var oldGlob = dojo.global;
try{
dojo.global = globalObject;
return dojo.withDoc.call(null, globalObject.document, callback, thisObject, cbArguments);
}finally{
dojo.global = oldGlob;
}
}
dojo.withDoc = function( /*DocumentElement*/documentObject,
/*Function*/callback,
/*Object?*/thisObject,
/*Array?*/cbArguments){
// summary:
// Invoke callback with documentObject as dojo.doc.
// description:
// Invoke callback with documentObject as dojo.doc. If provided,
// callback will be executed in the context of object thisObject
// When callback() returns or throws an error, the dojo.doc will
// be restored to its previous state.
var oldDoc = dojo.doc,
oldLtr = dojo._bodyLtr,
oldQ = dojo.isQuirks;
try{
dojo.doc = documentObject;
delete dojo._bodyLtr; // uncache
dojo.isQuirks = dojo.doc.compatMode == "BackCompat"; // no need to check for QuirksMode which was Opera 7 only
if(thisObject && typeof callback == "string"){
callback = thisObject[callback];
}
return callback.apply(thisObject, cbArguments || []);
}finally{
dojo.doc = oldDoc;
delete dojo._bodyLtr; // in case it was undefined originally, and set to true/false by the alternate document
if(oldLtr !== undefined){ dojo._bodyLtr = oldLtr; }
dojo.isQuirks = oldQ;
}
};
}

File diff suppressed because it is too large Load Diff

@ -25,6 +25,7 @@
background:#f0f0f0;
}
.firebug #firebugLog, .firebug #objectLog {
overflow: auto;
position: absolute;
@ -171,6 +172,8 @@
.firebug .propertyName {
font-weight: bold;
}
/* tabs */
#firebugToolbar ul.tabs{
margin:0 !important;
padding:0;

File diff suppressed because it is too large Load Diff

@ -5,254 +5,406 @@
*/
if(!dojo._hasResource["dojo.back"]){
dojo._hasResource["dojo.back"]=true;
if(!dojo._hasResource["dojo.back"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.back"] = true;
dojo.provide("dojo.back");
(function(){
var _1=dojo.back;
function _2(){
var h=window.location.hash;
if(h.charAt(0)=="#"){
h=h.substring(1);
}
return dojo.isMozilla?h:decodeURIComponent(h);
};
function _3(h){
if(!h){
h="";
}
window.location.hash=encodeURIComponent(h);
_4=history.length;
};
if(dojo.exists("tests.back-hash")){
_1.getHash=_2;
_1.setHash=_3;
}
var _5=(typeof (window)!=="undefined")?window.location.href:"";
var _6=(typeof (window)!=="undefined")?_2():"";
var _7=null;
var _8=null;
var _9=null;
var _a=null;
var _b=[];
var _c=[];
var _d=false;
var _e=false;
var _4;
function _f(){
var _10=_c.pop();
if(!_10){
return;
}
var _11=_c[_c.length-1];
if(!_11&&_c.length==0){
_11=_7;
}
if(_11){
if(_11.kwArgs["back"]){
_11.kwArgs["back"]();
}else{
if(_11.kwArgs["backButton"]){
_11.kwArgs["backButton"]();
}else{
if(_11.kwArgs["handle"]){
_11.kwArgs.handle("back");
}
}
}
}
_b.push(_10);
};
_1.goBack=_f;
function _12(){
var _13=_b.pop();
if(!_13){
return;
}
if(_13.kwArgs["forward"]){
_13.kwArgs.forward();
}else{
if(_13.kwArgs["forwardButton"]){
_13.kwArgs.forwardButton();
}else{
if(_13.kwArgs["handle"]){
_13.kwArgs.handle("forward");
}
}
}
_c.push(_13);
};
_1.goForward=_12;
function _14(url,_15,_16){
return {"url":url,"kwArgs":_15,"urlHash":_16};
};
function _17(url){
var _18=url.split("?");
if(_18.length<2){
return null;
}else{
return _18[1];
}
};
function _19(){
var url=(dojo.config["dojoIframeHistoryUrl"]||dojo.moduleUrl("dojo","resources/iframe_history.html"))+"?"+(new Date()).getTime();
_d=true;
if(_a){
dojo.isWebKit?_a.location=url:window.frames[_a.name].location=url;
}else{
}
return url;
};
function _1a(){
if(!_e){
var hsl=_c.length;
var _1b=_2();
if((_1b===_6||window.location.href==_5)&&(hsl==1)){
_f();
return;
}
if(_b.length>0){
if(_b[_b.length-1].urlHash===_1b){
_12();
return;
}
}
if((hsl>=2)&&(_c[hsl-2])){
if(_c[hsl-2].urlHash===_1b){
_f();
return;
}
}
if(dojo.isSafari&&dojo.isSafari<3){
var _1c=history.length;
if(_1c>_4){
_12();
}else{
if(_1c<_4){
_f();
}
}
_4=_1c;
}
}
};
_1.init=function(){
if(dojo.byId("dj_history")){
return;
}
var src=dojo.config["dojoIframeHistoryUrl"]||dojo.moduleUrl("dojo","resources/iframe_history.html");
if(dojo._postLoad){
console.error("dojo.back.init() must be called before the DOM has loaded. "+"If using xdomain loading or djConfig.debugAtAllCosts, include dojo.back "+"in a build layer.");
}else{
document.write("<iframe style=\"border:0;width:1px;height:1px;position:absolute;visibility:hidden;bottom:0;right:0;\" name=\"dj_history\" id=\"dj_history\" src=\""+src+"\"></iframe>");
}
};
_1.setInitialState=function(_1d){
_7=_14(_5,_1d,_6);
};
_1.addToHistory=function(_1e){
_b=[];
var _1f=null;
var url=null;
if(!_a){
if(dojo.config["useXDomain"]&&!dojo.config["dojoIframeHistoryUrl"]){
console.warn("dojo.back: When using cross-domain Dojo builds,"+" please save iframe_history.html to your domain and set djConfig.dojoIframeHistoryUrl"+" to the path on your domain to iframe_history.html");
}
_a=window.frames["dj_history"];
}
if(!_9){
_9=dojo.create("a",{style:{display:"none"}},dojo.body());
}
if(_1e["changeUrl"]){
_1f=""+((_1e["changeUrl"]!==true)?_1e["changeUrl"]:(new Date()).getTime());
if(_c.length==0&&_7.urlHash==_1f){
_7=_14(url,_1e,_1f);
return;
}else{
if(_c.length>0&&_c[_c.length-1].urlHash==_1f){
_c[_c.length-1]=_14(url,_1e,_1f);
return;
}
}
_e=true;
setTimeout(function(){
_3(_1f);
_e=false;
},1);
_9.href=_1f;
if(dojo.isIE){
url=_19();
var _20=_1e["back"]||_1e["backButton"]||_1e["handle"];
var tcb=function(_21){
if(_2()!=""){
setTimeout(function(){
_3(_1f);
},1);
}
_20.apply(this,[_21]);
};
if(_1e["back"]){
_1e.back=tcb;
}else{
if(_1e["backButton"]){
_1e.backButton=tcb;
}else{
if(_1e["handle"]){
_1e.handle=tcb;
}
}
}
var _22=_1e["forward"]||_1e["forwardButton"]||_1e["handle"];
var tfw=function(_23){
if(_2()!=""){
_3(_1f);
}
if(_22){
_22.apply(this,[_23]);
}
};
if(_1e["forward"]){
_1e.forward=tfw;
}else{
if(_1e["forwardButton"]){
_1e.forwardButton=tfw;
}else{
if(_1e["handle"]){
_1e.handle=tfw;
}
}
}
}else{
if(!dojo.isIE){
if(!_8){
_8=setInterval(_1a,200);
}
}
}
}else{
url=_19();
}
_c.push(_14(url,_1e,_1f));
};
_1._iframeLoaded=function(evt,_24){
var _25=_17(_24.href);
if(_25==null){
if(_c.length==1){
_f();
}
return;
}
if(_d){
_d=false;
return;
}
if(_c.length>=2&&_25==_17(_c[_c.length-2].url)){
_f();
}else{
if(_b.length>0&&_25==_17(_b[_b.length-1].url)){
_12();
}
/*=====
dojo.back = {
// summary: Browser history management resources
}
};
})();
=====*/
(function(){
var back = dojo.back;
// everyone deals with encoding the hash slightly differently
function getHash(){
var h = window.location.hash;
if(h.charAt(0) == "#"){ h = h.substring(1); }
return dojo.isMozilla ? h : decodeURIComponent(h);
}
function setHash(h){
if(!h){ h = ""; }
window.location.hash = encodeURIComponent(h);
historyCounter = history.length;
}
// if we're in the test for these methods, expose them on dojo.back. ok'd with alex.
if(dojo.exists("tests.back-hash")){
back.getHash = getHash;
back.setHash = setHash;
}
var initialHref = (typeof(window) !== "undefined") ? window.location.href : "";
var initialHash = (typeof(window) !== "undefined") ? getHash() : "";
var initialState = null;
var locationTimer = null;
var bookmarkAnchor = null;
var historyIframe = null;
var forwardStack = [];
var historyStack = [];
var moveForward = false;
var changingUrl = false;
var historyCounter;
function handleBackButton(){
//summary: private method. Do not call this directly.
//The "current" page is always at the top of the history stack.
var current = historyStack.pop();
if(!current){ return; }
var last = historyStack[historyStack.length-1];
if(!last && historyStack.length == 0){
last = initialState;
}
if(last){
if(last.kwArgs["back"]){
last.kwArgs["back"]();
}else if(last.kwArgs["backButton"]){
last.kwArgs["backButton"]();
}else if(last.kwArgs["handle"]){
last.kwArgs.handle("back");
}
}
forwardStack.push(current);
}
back.goBack = handleBackButton;
function handleForwardButton(){
//summary: private method. Do not call this directly.
var last = forwardStack.pop();
if(!last){ return; }
if(last.kwArgs["forward"]){
last.kwArgs.forward();
}else if(last.kwArgs["forwardButton"]){
last.kwArgs.forwardButton();
}else if(last.kwArgs["handle"]){
last.kwArgs.handle("forward");
}
historyStack.push(last);
}
back.goForward = handleForwardButton;
function createState(url, args, hash){
//summary: private method. Do not call this directly.
return {"url": url, "kwArgs": args, "urlHash": hash}; //Object
}
function getUrlQuery(url){
//summary: private method. Do not call this directly.
var segments = url.split("?");
if(segments.length < 2){
return null; //null
}
else{
return segments[1]; //String
}
}
function loadIframeHistory(){
//summary: private method. Do not call this directly.
var url = (dojo.config["dojoIframeHistoryUrl"] || dojo.moduleUrl("dojo", "resources/iframe_history.html")) + "?" + (new Date()).getTime();
moveForward = true;
if(historyIframe){
dojo.isWebKit ? historyIframe.location = url : window.frames[historyIframe.name].location = url;
}else{
//console.warn("dojo.back: Not initialised. You need to call dojo.back.init() from a <script> block that lives inside the <body> tag.");
}
return url; //String
}
function checkLocation(){
if(!changingUrl){
var hsl = historyStack.length;
var hash = getHash();
if((hash === initialHash||window.location.href == initialHref)&&(hsl == 1)){
// FIXME: could this ever be a forward button?
// we can't clear it because we still need to check for forwards. Ugg.
// clearInterval(this.locationTimer);
handleBackButton();
return;
}
// first check to see if we could have gone forward. We always halt on
// a no-hash item.
if(forwardStack.length > 0){
if(forwardStack[forwardStack.length-1].urlHash === hash){
handleForwardButton();
return;
}
}
// ok, that didn't work, try someplace back in the history stack
if((hsl >= 2)&&(historyStack[hsl-2])){
if(historyStack[hsl-2].urlHash === hash){
handleBackButton();
return;
}
}
if(dojo.isSafari && dojo.isSafari < 3){
var hisLen = history.length;
if(hisLen > historyCounter) handleForwardButton();
else if(hisLen < historyCounter) handleBackButton();
historyCounter = hisLen;
}
}
};
back.init = function(){
//summary: Initializes the undo stack. This must be called from a <script>
// block that lives inside the <body> tag to prevent bugs on IE.
// description:
// Only call this method before the page's DOM is finished loading. Otherwise
// it will not work. Be careful with xdomain loading or djConfig.debugAtAllCosts scenarios,
// in order for this method to work, dojo.back will need to be part of a build layer.
if(dojo.byId("dj_history")){ return; } // prevent reinit
var src = dojo.config["dojoIframeHistoryUrl"] || dojo.moduleUrl("dojo", "resources/iframe_history.html");
if (dojo._postLoad) {
console.error("dojo.back.init() must be called before the DOM has loaded. "
+ "If using xdomain loading or djConfig.debugAtAllCosts, include dojo.back "
+ "in a build layer.");
} else {
document.write('<iframe style="border:0;width:1px;height:1px;position:absolute;visibility:hidden;bottom:0;right:0;" name="dj_history" id="dj_history" src="' + src + '"></iframe>');
}
};
back.setInitialState = function(/*Object*/args){
//summary:
// Sets the state object and back callback for the very first page
// that is loaded.
//description:
// It is recommended that you call this method as part of an event
// listener that is registered via dojo.addOnLoad().
//args: Object
// See the addToHistory() function for the list of valid args properties.
initialState = createState(initialHref, args, initialHash);
};
//FIXME: Make these doc comments not be awful. At least they're not wrong.
//FIXME: Would like to support arbitrary back/forward jumps. Have to rework iframeLoaded among other things.
//FIXME: is there a slight race condition in moz using change URL with the timer check and when
// the hash gets set? I think I have seen a back/forward call in quick succession, but not consistent.
/*=====
dojo.__backArgs = function(kwArgs){
// back: Function?
// A function to be called when this state is reached via the user
// clicking the back button.
// forward: Function?
// Upon return to this state from the "back, forward" combination
// of navigation steps, this function will be called. Somewhat
// analgous to the semantic of an "onRedo" event handler.
// changeUrl: Boolean?|String?
// Boolean indicating whether or not to create a unique hash for
// this state. If a string is passed instead, it is used as the
// hash.
}
=====*/
back.addToHistory = function(/*dojo.__backArgs*/ args){
// summary:
// adds a state object (args) to the history list.
// description:
// To support getting back button notifications, the object
// argument should implement a function called either "back",
// "backButton", or "handle". The string "back" will be passed as
// the first and only argument to this callback.
//
// To support getting forward button notifications, the object
// argument should implement a function called either "forward",
// "forwardButton", or "handle". The string "forward" will be
// passed as the first and only argument to this callback.
//
// If you want the browser location string to change, define "changeUrl" on the object. If the
// value of "changeUrl" is true, then a unique number will be appended to the URL as a fragment
// identifier (http://some.domain.com/path#uniquenumber). If it is any other value that does
// not evaluate to false, that value will be used as the fragment identifier. For example,
// if changeUrl: 'page1', then the URL will look like: http://some.domain.com/path#page1
//
// There are problems with using dojo.back with semantically-named fragment identifiers
// ("hash values" on an URL). In most browsers it will be hard for dojo.back to know
// distinguish a back from a forward event in those cases. For back/forward support to
// work best, the fragment ID should always be a unique value (something using new Date().getTime()
// for example). If you want to detect hash changes using semantic fragment IDs, then
// consider using dojo.hash instead (in Dojo 1.4+).
//
// example:
// | dojo.back.addToHistory({
// | back: function(){ console.log('back pressed'); },
// | forward: function(){ console.log('forward pressed'); },
// | changeUrl: true
// | });
// BROWSER NOTES:
// Safari 1.2:
// back button "works" fine, however it's not possible to actually
// DETECT that you've moved backwards by inspecting window.location.
// Unless there is some other means of locating.
// FIXME: perhaps we can poll on history.length?
// Safari 2.0.3+ (and probably 1.3.2+):
// works fine, except when changeUrl is used. When changeUrl is used,
// Safari jumps all the way back to whatever page was shown before
// the page that uses dojo.undo.browser support.
// IE 5.5 SP2:
// back button behavior is macro. It does not move back to the
// previous hash value, but to the last full page load. This suggests
// that the iframe is the correct way to capture the back button in
// these cases.
// Don't test this page using local disk for MSIE. MSIE will not create
// a history list for iframe_history.html if served from a file: URL.
// The XML served back from the XHR tests will also not be properly
// created if served from local disk. Serve the test pages from a web
// server to test in that browser.
// IE 6.0:
// same behavior as IE 5.5 SP2
// Firefox 1.0+:
// the back button will return us to the previous hash on the same
// page, thereby not requiring an iframe hack, although we do then
// need to run a timer to detect inter-page movement.
//If addToHistory is called, then that means we prune the
//forward stack -- the user went back, then wanted to
//start a new forward path.
forwardStack = [];
var hash = null;
var url = null;
if(!historyIframe){
if(dojo.config["useXDomain"] && !dojo.config["dojoIframeHistoryUrl"]){
console.warn("dojo.back: When using cross-domain Dojo builds,"
+ " please save iframe_history.html to your domain and set djConfig.dojoIframeHistoryUrl"
+ " to the path on your domain to iframe_history.html");
}
historyIframe = window.frames["dj_history"];
}
if(!bookmarkAnchor){
bookmarkAnchor = dojo.create("a", {style: {display: "none"}}, dojo.body());
}
if(args["changeUrl"]){
hash = ""+ ((args["changeUrl"]!==true) ? args["changeUrl"] : (new Date()).getTime());
//If the current hash matches the new one, just replace the history object with
//this new one. It doesn't make sense to track different state objects for the same
//logical URL. This matches the browser behavior of only putting in one history
//item no matter how many times you click on the same #hash link, at least in Firefox
//and Safari, and there is no reliable way in those browsers to know if a #hash link
//has been clicked on multiple times. So making this the standard behavior in all browsers
//so that dojo.back's behavior is the same in all browsers.
if(historyStack.length == 0 && initialState.urlHash == hash){
initialState = createState(url, args, hash);
return;
}else if(historyStack.length > 0 && historyStack[historyStack.length - 1].urlHash == hash){
historyStack[historyStack.length - 1] = createState(url, args, hash);
return;
}
changingUrl = true;
setTimeout(function() {
setHash(hash);
changingUrl = false;
}, 1);
bookmarkAnchor.href = hash;
if(dojo.isIE){
url = loadIframeHistory();
var oldCB = args["back"]||args["backButton"]||args["handle"];
//The function takes handleName as a parameter, in case the
//callback we are overriding was "handle". In that case,
//we will need to pass the handle name to handle.
var tcb = function(handleName){
if(getHash() != ""){
setTimeout(function() { setHash(hash); }, 1);
}
//Use apply to set "this" to args, and to try to avoid memory leaks.
oldCB.apply(this, [handleName]);
};
//Set interceptor function in the right place.
if(args["back"]){
args.back = tcb;
}else if(args["backButton"]){
args.backButton = tcb;
}else if(args["handle"]){
args.handle = tcb;
}
var oldFW = args["forward"]||args["forwardButton"]||args["handle"];
//The function takes handleName as a parameter, in case the
//callback we are overriding was "handle". In that case,
//we will need to pass the handle name to handle.
var tfw = function(handleName){
if(getHash() != ""){
setHash(hash);
}
if(oldFW){ // we might not actually have one
//Use apply to set "this" to args, and to try to avoid memory leaks.
oldFW.apply(this, [handleName]);
}
};
//Set interceptor function in the right place.
if(args["forward"]){
args.forward = tfw;
}else if(args["forwardButton"]){
args.forwardButton = tfw;
}else if(args["handle"]){
args.handle = tfw;
}
}else if(!dojo.isIE){
// start the timer
if(!locationTimer){
locationTimer = setInterval(checkLocation, 200);
}
}
}else{
url = loadIframeHistory();
}
historyStack.push(createState(url, args, hash));
};
back._iframeLoaded = function(evt, ifrLoc){
//summary:
// private method. Do not call this directly.
var query = getUrlQuery(ifrLoc.href);
if(query == null){
// alert("iframeLoaded");
// we hit the end of the history, so we should go back
if(historyStack.length == 1){
handleBackButton();
}
return;
}
if(moveForward){
// we were expecting it, so it's not either a forward or backward movement
moveForward = false;
return;
}
//Check the back stack first, since it is more likely.
//Note that only one step back or forward is supported.
if(historyStack.length >= 2 && query == getUrlQuery(historyStack[historyStack.length-2].url)){
handleBackButton();
}else if(forwardStack.length > 0 && query == getUrlQuery(forwardStack[forwardStack.length-1].url)){
handleForwardButton();
}
};
})();
}

@ -5,90 +5,246 @@
*/
if(!dojo._hasResource["dojo.behavior"]){
dojo._hasResource["dojo.behavior"]=true;
if(!dojo._hasResource["dojo.behavior"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.behavior"] = true;
dojo.provide("dojo.behavior");
dojo.behavior=new function(){
function _1(_2,_3){
if(!_2[_3]){
_2[_3]=[];
}
return _2[_3];
};
var _4=0;
function _5(_6,_7,_8){
var _9={};
for(var x in _6){
if(typeof _9[x]=="undefined"){
if(!_8){
_7(_6[x],x);
}else{
_8.call(_7,_6[x],x);
}
}
}
};
this._behaviors={};
this.add=function(_a){
var _b={};
_5(_a,this,function(_c,_d){
var _e=_1(this._behaviors,_d);
if(typeof _e["id"]!="number"){
_e.id=_4++;
}
var _f=[];
_e.push(_f);
if((dojo.isString(_c))||(dojo.isFunction(_c))){
_c={found:_c};
}
_5(_c,function(_10,_11){
_1(_f,_11).push(_10);
});
});
};
var _12=function(_13,_14,_15){
if(dojo.isString(_14)){
if(_15=="found"){
dojo.publish(_14,[_13]);
}else{
dojo.connect(_13,_15,function(){
dojo.publish(_14,arguments);
});
}
}else{
if(dojo.isFunction(_14)){
if(_15=="found"){
_14(_13);
}else{
dojo.connect(_13,_15,_14);
}
}
}
};
this.apply=function(){
_5(this._behaviors,function(_16,id){
dojo.query(id).forEach(function(_17){
var _18=0;
var bid="_dj_behavior_"+_16.id;
if(typeof _17[bid]=="number"){
_18=_17[bid];
if(_18==(_16.length)){
return;
}
}
for(var x=_18,_19;_19=_16[x];x++){
_5(_19,function(_1a,_1b){
if(dojo.isArray(_1a)){
dojo.forEach(_1a,function(_1c){
_12(_17,_1c,_1b);
});
}
});
dojo.behavior = new function(){
// summary:
// Utility for unobtrusive/progressive event binding, DOM traversal,
// and manipulation.
//
// description:
//
// A very simple, lightweight mechanism for applying code to
// existing documents, based around `dojo.query` (CSS3 selectors) for node selection,
// and a simple two-command API: `dojo.behavior.add()` and `dojo.behavior.apply()`;
//
// Behaviors apply to a given page, and are registered following the syntax
// options described by `dojo.behavior.add` to match nodes to actions, or "behaviors".
//
// Added behaviors are applied to the current DOM when .apply() is called,
// matching only new nodes found since .apply() was last called.
//
function arrIn(obj, name){
if(!obj[name]){ obj[name] = []; }
return obj[name];
}
var _inc = 0;
function forIn(obj, scope, func){
var tmpObj = {};
for(var x in obj){
if(typeof tmpObj[x] == "undefined"){
if(!func){
scope(obj[x], x);
}else{
func.call(scope, obj[x], x);
}
}
}
}
// FIXME: need a better test so we don't exclude nightly Safari's!
this._behaviors = {};
this.add = function(/* Object */behaviorObj){
// summary:
// Add the specified behavior to the list of behaviors, ignoring existing
// matches.
//
// description:
// Add the specified behavior to the list of behaviors which will
// be applied the next time apply() is called. Calls to add() for
// an already existing behavior do not replace the previous rules,
// but are instead additive. New nodes which match the rule will
// have all add()-ed behaviors applied to them when matched.
//
// The "found" method is a generalized handler that's called as soon
// as the node matches the selector. Rules for values that follow also
// apply to the "found" key.
//
// The "on*" handlers are attached with `dojo.connect()`, using the
// matching node
//
// If the value corresponding to the ID key is a function and not a
// list, it's treated as though it was the value of "found".
//
// dojo.behavior.add() can be called any number of times before
// the DOM is ready. `dojo.behavior.apply()` is called automatically
// by `dojo.addOnLoad`, though can be called to re-apply previously added
// behaviors anytime the DOM changes.
//
// There are a variety of formats permitted in the behaviorObject
//
// example:
// Simple list of properties. "found" is special. "Found" is assumed if
// no property object for a given selector, and property is a function.
//
// | dojo.behavior.add({
// | "#id": {
// | "found": function(element){
// | // node match found
// | },
// | "onclick": function(evt){
// | // register onclick handler for found node
// | }
// | },
// | "#otherid": function(element){
// | // assumes "found" with this syntax
// | }
// | });
//
// example:
// If property is a string, a dojo.publish will be issued on the channel:
//
// | dojo.behavior.add({
// | // dojo.publish() whenever class="noclick" found on anchors
// | "a.noclick": "/got/newAnchor",
// | "div.wrapper": {
// | "onclick": "/node/wasClicked"
// | }
// | });
// | dojo.subscribe("/got/newAnchor", function(node){
// | // handle node finding when dojo.behavior.apply() is called,
// | // provided a newly matched node is found.
// | });
//
// example:
// Scoping can be accomplished by passing an object as a property to
// a connection handle (on*):
//
// | dojo.behavior.add({
// | "#id": {
// | // like calling dojo.hitch(foo,"bar"). execute foo.bar() in scope of foo
// | "onmouseenter": { targetObj: foo, targetFunc: "bar" },
// | "onmouseleave": { targetObj: foo, targetFunc: "baz" }
// | }
// | });
//
// example:
// Bahaviors match on CSS3 Selectors, powered by dojo.query. Example selectors:
//
// | dojo.behavior.add({
// | // match all direct descendants
// | "#id4 > *": function(element){
// | // ...
// | },
// |
// | // match the first child node that's an element
// | "#id4 > :first-child": { ... },
// |
// | // match the last child node that's an element
// | "#id4 > :last-child": { ... },
// |
// | // all elements of type tagname
// | "tagname": {
// | // ...
// | },
// |
// | "tagname1 tagname2 tagname3": {
// | // ...
// | },
// |
// | ".classname": {
// | // ...
// | },
// |
// | "tagname.classname": {
// | // ...
// | }
// | });
//
var tmpObj = {};
forIn(behaviorObj, this, function(behavior, name){
var tBehavior = arrIn(this._behaviors, name);
if(typeof tBehavior["id"] != "number"){
tBehavior.id = _inc++;
}
var cversion = [];
tBehavior.push(cversion);
if((dojo.isString(behavior))||(dojo.isFunction(behavior))){
behavior = { found: behavior };
}
forIn(behavior, function(rule, ruleName){
arrIn(cversion, ruleName).push(rule);
});
});
}
var _applyToNode = function(node, action, ruleSetName){
if(dojo.isString(action)){
if(ruleSetName == "found"){
dojo.publish(action, [ node ]);
}else{
dojo.connect(node, ruleSetName, function(){
dojo.publish(action, arguments);
});
}
}else if(dojo.isFunction(action)){
if(ruleSetName == "found"){
action(node);
}else{
dojo.connect(node, ruleSetName, action);
}
}
}
this.apply = function(){
// summary:
// Applies all currently registered behaviors to the document.
//
// description:
// Applies all currently registered behaviors to the document,
// taking care to ensure that only incremental updates are made
// since the last time add() or apply() were called.
//
// If new matching nodes have been added, all rules in a behavior will be
// applied to that node. For previously matched nodes, only
// behaviors which have been added since the last call to apply()
// will be added to the nodes.
//
// apply() is called once automatically by `dojo.addOnLoad`, so
// registering behaviors with `dojo.behavior.add` before the DOM is
// ready is acceptable, provided the dojo.behavior module is ready.
//
// Calling appy() manually after manipulating the DOM is required
// to rescan the DOM and apply newly .add()ed behaviors, or to match
// nodes that match existing behaviors when those nodes are added to
// the DOM.
//
forIn(this._behaviors, function(tBehavior, id){
dojo.query(id).forEach(
function(elem){
var runFrom = 0;
var bid = "_dj_behavior_"+tBehavior.id;
if(typeof elem[bid] == "number"){
runFrom = elem[bid];
if(runFrom == (tBehavior.length)){
return;
}
}
// run through the versions, applying newer rules at each step
for(var x=runFrom, tver; tver = tBehavior[x]; x++){
forIn(tver, function(ruleSet, ruleSetName){
if(dojo.isArray(ruleSet)){
dojo.forEach(ruleSet, function(action){
_applyToNode(elem, action, ruleSetName);
});
}
});
}
// ensure that re-application only adds new rules to the node
elem[bid] = tBehavior.length;
}
);
});
}
}
_17[bid]=_16.length;
});
});
};
};
dojo.addOnLoad(dojo.behavior,"apply");
dojo.addOnLoad(dojo.behavior, "apply");
}

@ -5,324 +5,119 @@ dojo.js:
./../../dojo/_base/_loader/bootstrap.js
./../../dojo/_base/_loader/loader.js
./../../dojo/_base/_loader/hostenv_browser.js
./../../release/dojo-release-1.5.0/dojo/_base/lang.js
./../../release/dojo-release-1.5.0/dojo/_base/array.js
./../../release/dojo-release-1.5.0/dojo/_base/declare.js
./../../release/dojo-release-1.5.0/dojo/_base/connect.js
./../../release/dojo-release-1.5.0/dojo/_base/Deferred.js
./../../release/dojo-release-1.5.0/dojo/_base/json.js
./../../release/dojo-release-1.5.0/dojo/_base/Color.js
./../../release/dojo-release-1.5.0/dojo/_base.js
./../../release/dojo-release-1.5.0/dojo/_base/window.js
./../../release/dojo-release-1.5.0/dojo/_base/event.js
./../../release/dojo-release-1.5.0/dojo/_base/html.js
./../../release/dojo-release-1.5.0/dojo/_base/NodeList.js
./../../release/dojo-release-1.5.0/dojo/_base/query.js
./../../release/dojo-release-1.5.0/dojo/_base/xhr.js
./../../release/dojo-release-1.5.0/dojo/_base/fx.js
./../../release/dojo-release-1.5.0/dojo/_base/browser.js
./../../release/dojo/_base/lang.js
./../../release/dojo/_base/array.js
./../../release/dojo/_base/declare.js
./../../release/dojo/_base/connect.js
./../../release/dojo/_base/Deferred.js
./../../release/dojo/_base/json.js
./../../release/dojo/_base/Color.js
./../../release/dojo/_base.js
./../../release/dojo/_base/window.js
./../../release/dojo/_base/event.js
./../../release/dojo/_base/html.js
./../../release/dojo/_base/NodeList.js
./../../release/dojo/_base/query.js
./../../release/dojo/_base/xhr.js
./../../release/dojo/_base/fx.js
./../../release/dojo/_base/browser.js
./jslib/dojoGuardEnd.jsfrag
../dijit/dijit.js:
./../../release/dojo-release-1.5.0/dojo/window.js
./../../release/dojo-release-1.5.0/dijit/_base/manager.js
./../../release/dojo-release-1.5.0/dijit/_base/focus.js
./../../release/dojo-release-1.5.0/dojo/AdapterRegistry.js
./../../release/dojo-release-1.5.0/dijit/_base/place.js
./../../release/dojo-release-1.5.0/dijit/_base/window.js
./../../release/dojo-release-1.5.0/dijit/_base/popup.js
./../../release/dojo-release-1.5.0/dijit/_base/scroll.js
./../../release/dojo-release-1.5.0/dojo/uacss.js
./../../release/dojo-release-1.5.0/dijit/_base/sniff.js
./../../release/dojo-release-1.5.0/dijit/_base/typematic.js
./../../release/dojo-release-1.5.0/dijit/_base/wai.js
./../../release/dojo-release-1.5.0/dijit/_base.js
./../../release/dojo-release-1.5.0/dojo/date/stamp.js
./../../release/dojo-release-1.5.0/dojo/parser.js
./../../release/dojo-release-1.5.0/dijit/_Widget.js
./../../release/dojo-release-1.5.0/dojo/string.js
./../../release/dojo-release-1.5.0/dojo/cache.js
./../../release/dojo-release-1.5.0/dijit/_Templated.js
./../../release/dojo-release-1.5.0/dijit/_Container.js
./../../release/dojo-release-1.5.0/dijit/_Contained.js
./../../release/dojo-release-1.5.0/dijit/layout/_LayoutWidget.js
./../../release/dojo-release-1.5.0/dijit/_CssStateMixin.js
./../../release/dojo-release-1.5.0/dijit/form/_FormWidget.js
./../../release/dojo-release-1.5.0/dijit/dijit.js
../dijit/dijit-all.js:
./../../release/dojo-release-1.5.0/dojo/colors.js
./../../release/dojo-release-1.5.0/dojo/i18n.js
./../../release/dojo-release-1.5.0/dijit/_PaletteMixin.js
./../../release/dojo-release-1.5.0/dijit/ColorPalette.js
./../../release/dojo-release-1.5.0/dijit/Declaration.js
./../../release/dojo-release-1.5.0/dojo/dnd/common.js
./../../release/dojo-release-1.5.0/dojo/dnd/autoscroll.js
./../../release/dojo-release-1.5.0/dojo/dnd/Mover.js
./../../release/dojo-release-1.5.0/dojo/dnd/Moveable.js
./../../release/dojo-release-1.5.0/dojo/dnd/move.js
./../../release/dojo-release-1.5.0/dojo/dnd/TimedMoveable.js
./../../release/dojo-release-1.5.0/dojo/fx/Toggler.js
./../../release/dojo-release-1.5.0/dojo/fx.js
./../../release/dojo-release-1.5.0/dijit/form/_FormMixin.js
./../../release/dojo-release-1.5.0/dijit/_DialogMixin.js
./../../release/dojo-release-1.5.0/dijit/DialogUnderlay.js
./../../release/dojo-release-1.5.0/dojo/html.js
./../../release/dojo-release-1.5.0/dijit/layout/ContentPane.js
./../../release/dojo-release-1.5.0/dijit/TooltipDialog.js
./../../release/dojo-release-1.5.0/dijit/Dialog.js
./../../release/dojo-release-1.5.0/dijit/_editor/selection.js
./../../release/dojo-release-1.5.0/dijit/_editor/range.js
./../../release/dojo-release-1.5.0/dijit/_editor/html.js
./../../release/dojo-release-1.5.0/dijit/_editor/RichText.js
./../../release/dojo-release-1.5.0/dijit/_KeyNavContainer.js
./../../release/dojo-release-1.5.0/dijit/ToolbarSeparator.js
./../../release/dojo-release-1.5.0/dijit/Toolbar.js
./../../release/dojo-release-1.5.0/dijit/_HasDropDown.js
./../../release/dojo-release-1.5.0/dijit/form/Button.js
./../../release/dojo-release-1.5.0/dijit/_editor/_Plugin.js
./../../release/dojo-release-1.5.0/dijit/_editor/plugins/EnterKeyHandling.js
./../../release/dojo-release-1.5.0/dijit/Editor.js
./../../release/dojo-release-1.5.0/dojo/regexp.js
./../../release/dojo-release-1.5.0/dojo/data/util/sorter.js
./../../release/dojo-release-1.5.0/dojo/data/util/simpleFetch.js
./../../release/dojo-release-1.5.0/dojo/data/util/filter.js
./../../release/dojo-release-1.5.0/dijit/form/TextBox.js
./../../release/dojo-release-1.5.0/dijit/Tooltip.js
./../../release/dojo-release-1.5.0/dijit/form/ValidationTextBox.js
./../../release/dojo-release-1.5.0/dijit/form/ComboBox.js
./../../release/dojo-release-1.5.0/dijit/form/FilteringSelect.js
./../../release/dojo-release-1.5.0/dojo/data/ItemFileReadStore.js
./../../release/dojo-release-1.5.0/dijit/_editor/plugins/FontChoice.js
./../../release/dojo-release-1.5.0/dijit/form/_FormSelectWidget.js
./../../release/dojo-release-1.5.0/dijit/MenuItem.js
./../../release/dojo-release-1.5.0/dijit/PopupMenuItem.js
./../../release/dojo-release-1.5.0/dijit/CheckedMenuItem.js
./../../release/dojo-release-1.5.0/dijit/MenuSeparator.js
./../../release/dojo-release-1.5.0/dijit/Menu.js
./../../release/dojo-release-1.5.0/dijit/form/Select.js
./../../release/dojo-release-1.5.0/dijit/_editor/plugins/LinkDialog.js
./../../release/dojo-release-1.5.0/dijit/MenuBar.js
./../../release/dojo-release-1.5.0/dijit/MenuBarItem.js
./../../release/dojo-release-1.5.0/dijit/PopupMenuBarItem.js
./../../release/dojo-release-1.5.0/dojo/number.js
./../../release/dojo-release-1.5.0/dijit/ProgressBar.js
./../../release/dojo-release-1.5.0/dijit/TitlePane.js
./../../release/dojo-release-1.5.0/dojo/DeferredList.js
./../../release/dojo-release-1.5.0/dojo/cookie.js
./../../release/dojo-release-1.5.0/dijit/tree/TreeStoreModel.js
./../../release/dojo-release-1.5.0/dijit/tree/ForestStoreModel.js
./../../release/dojo-release-1.5.0/dijit/Tree.js
./../../release/dojo-release-1.5.0/dijit/InlineEditBox.js
./../../release/dojo-release-1.5.0/dijit/form/Form.js
./../../release/dojo-release-1.5.0/dijit/form/DropDownButton.js
./../../release/dojo-release-1.5.0/dijit/form/ComboButton.js
./../../release/dojo-release-1.5.0/dijit/form/ToggleButton.js
./../../release/dojo-release-1.5.0/dijit/form/CheckBox.js
./../../release/dojo-release-1.5.0/dijit/form/RadioButton.js
./../../release/dojo-release-1.5.0/dojo/cldr/monetary.js
./../../release/dojo-release-1.5.0/dojo/currency.js
./../../release/dojo-release-1.5.0/dijit/form/NumberTextBox.js
./../../release/dojo-release-1.5.0/dijit/form/CurrencyTextBox.js
./../../release/dojo-release-1.5.0/dojo/cldr/supplemental.js
./../../release/dojo-release-1.5.0/dojo/date.js
./../../release/dojo-release-1.5.0/dojo/date/locale.js
./../../release/dojo-release-1.5.0/dijit/Calendar.js
./../../release/dojo-release-1.5.0/dijit/form/_DateTimeTextBox.js
./../../release/dojo-release-1.5.0/dijit/form/DateTextBox.js
./../../release/dojo-release-1.5.0/dijit/form/_Spinner.js
./../../release/dojo-release-1.5.0/dijit/form/NumberSpinner.js
./../../release/dojo-release-1.5.0/dijit/form/MultiSelect.js
./../../release/dojo-release-1.5.0/dijit/form/HorizontalSlider.js
./../../release/dojo-release-1.5.0/dijit/form/VerticalSlider.js
./../../release/dojo-release-1.5.0/dijit/form/HorizontalRule.js
./../../release/dojo-release-1.5.0/dijit/form/VerticalRule.js
./../../release/dojo-release-1.5.0/dijit/form/HorizontalRuleLabels.js
./../../release/dojo-release-1.5.0/dijit/form/VerticalRuleLabels.js
./../../release/dojo-release-1.5.0/dijit/form/SimpleTextarea.js
./../../release/dojo-release-1.5.0/dijit/form/Textarea.js
./../../release/dojo-release-1.5.0/dijit/layout/StackController.js
./../../release/dojo-release-1.5.0/dijit/layout/StackContainer.js
./../../release/dojo-release-1.5.0/dijit/layout/AccordionPane.js
./../../release/dojo-release-1.5.0/dijit/layout/AccordionContainer.js
./../../release/dojo-release-1.5.0/dijit/layout/BorderContainer.js
./../../release/dojo-release-1.5.0/dijit/layout/LayoutContainer.js
./../../release/dojo-release-1.5.0/dijit/layout/LinkPane.js
./../../release/dojo-release-1.5.0/dijit/layout/SplitContainer.js
./../../release/dojo-release-1.5.0/dijit/layout/_TabContainerBase.js
./../../release/dojo-release-1.5.0/dijit/layout/TabController.js
./../../release/dojo-release-1.5.0/dijit/layout/ScrollingTabController.js
./../../release/dojo-release-1.5.0/dijit/layout/TabContainer.js
./../../release/dojo-release-1.5.0/dijit/dijit-all.js
../dojox/grid/DataGrid.js:
./../../release/dojo-release-1.5.0/dojo/window.js
./../../release/dojo-release-1.5.0/dijit/_base/manager.js
./../../release/dojo-release-1.5.0/dijit/_base/focus.js
./../../release/dojo-release-1.5.0/dojo/AdapterRegistry.js
./../../release/dojo-release-1.5.0/dijit/_base/place.js
./../../release/dojo-release-1.5.0/dijit/_base/window.js
./../../release/dojo-release-1.5.0/dijit/_base/popup.js
./../../release/dojo-release-1.5.0/dijit/_base/scroll.js
./../../release/dojo-release-1.5.0/dojo/uacss.js
./../../release/dojo-release-1.5.0/dijit/_base/sniff.js
./../../release/dojo-release-1.5.0/dijit/_base/typematic.js
./../../release/dojo-release-1.5.0/dijit/_base/wai.js
./../../release/dojo-release-1.5.0/dijit/_base.js
./../../release/dojo-release-1.5.0/dojo/date/stamp.js
./../../release/dojo-release-1.5.0/dojo/parser.js
./../../release/dojo-release-1.5.0/dijit/_Widget.js
./../../release/dojo-release-1.5.0/dojo/string.js
./../../release/dojo-release-1.5.0/dojo/cache.js
./../../release/dojo-release-1.5.0/dijit/_Templated.js
./../../release/dojo-release-1.5.0/dijit/_Container.js
./../../release/dojo-release-1.5.0/dijit/_Contained.js
./../../release/dojo-release-1.5.0/dijit/layout/_LayoutWidget.js
./../../release/dojo-release-1.5.0/dijit/_CssStateMixin.js
./../../release/dojo-release-1.5.0/dijit/form/_FormWidget.js
./../../release/dojo-release-1.5.0/dijit/dijit.js
./../../release/dojo-release-1.5.0/dijit/_KeyNavContainer.js
./../../release/dojo-release-1.5.0/dijit/MenuItem.js
./../../release/dojo-release-1.5.0/dijit/PopupMenuItem.js
./../../release/dojo-release-1.5.0/dijit/CheckedMenuItem.js
./../../release/dojo-release-1.5.0/dijit/MenuSeparator.js
./../../release/dojo-release-1.5.0/dijit/Menu.js
./../../release/dojo-release-1.5.0/dojox/html/metrics.js
./../../release/dojo-release-1.5.0/dojox/grid/util.js
./../../release/dojo-release-1.5.0/dojox/grid/_Scroller.js
./../../release/dojo-release-1.5.0/dojox/grid/cells/_base.js
./../../release/dojo-release-1.5.0/dojox/grid/cells.js
./../../release/dojo-release-1.5.0/dojo/dnd/common.js
./../../release/dojo-release-1.5.0/dojo/dnd/autoscroll.js
./../../release/dojo-release-1.5.0/dojo/dnd/Mover.js
./../../release/dojo-release-1.5.0/dojo/dnd/Moveable.js
./../../release/dojo-release-1.5.0/dojox/grid/_Builder.js
./../../release/dojo-release-1.5.0/dojo/dnd/Container.js
./../../release/dojo-release-1.5.0/dojo/dnd/Selector.js
./../../release/dojo-release-1.5.0/dojo/dnd/Avatar.js
./../../release/dojo-release-1.5.0/dojo/dnd/Manager.js
./../../release/dojo-release-1.5.0/dojo/dnd/Source.js
./../../release/dojo-release-1.5.0/dojox/grid/_View.js
./../../release/dojo-release-1.5.0/dojox/grid/_RowSelector.js
./../../release/dojo-release-1.5.0/dojox/grid/_Layout.js
./../../release/dojo-release-1.5.0/dojox/grid/_ViewManager.js
./../../release/dojo-release-1.5.0/dojox/grid/_RowManager.js
./../../release/dojo-release-1.5.0/dojox/grid/_FocusManager.js
./../../release/dojo-release-1.5.0/dojox/grid/_EditManager.js
./../../release/dojo-release-1.5.0/dojox/grid/Selection.js
./../../release/dojo-release-1.5.0/dojox/grid/_Events.js
./../../release/dojo-release-1.5.0/dojo/i18n.js
./../../release/dojo-release-1.5.0/dojox/grid/_Grid.js
./../../release/dojo-release-1.5.0/dojox/grid/DataSelection.js
./../../release/dojo-release-1.5.0/dojox/grid/DataGrid.js
../dojox/gfx.js:
./../../release/dojo-release-1.5.0/dojox/gfx/matrix.js
./../../release/dojo-release-1.5.0/dojox/gfx/_base.js
./../../release/dojo-release-1.5.0/dojox/gfx.js
../dojox/charting/widget/Chart2D.js:
./../../release/dojo-release-1.5.0/dojo/window.js
./../../release/dojo-release-1.5.0/dijit/_base/manager.js
./../../release/dojo-release-1.5.0/dijit/_base/focus.js
./../../release/dojo-release-1.5.0/dojo/AdapterRegistry.js
./../../release/dojo-release-1.5.0/dijit/_base/place.js
./../../release/dojo-release-1.5.0/dijit/_base/window.js
./../../release/dojo-release-1.5.0/dijit/_base/popup.js
./../../release/dojo-release-1.5.0/dijit/_base/scroll.js
./../../release/dojo-release-1.5.0/dojo/uacss.js
./../../release/dojo-release-1.5.0/dijit/_base/sniff.js
./../../release/dojo-release-1.5.0/dijit/_base/typematic.js
./../../release/dojo-release-1.5.0/dijit/_base/wai.js
./../../release/dojo-release-1.5.0/dijit/_base.js
./../../release/dojo-release-1.5.0/dijit/_Widget.js
./../../release/dojo-release-1.5.0/dojox/gfx/matrix.js
./../../release/dojo-release-1.5.0/dojox/gfx/_base.js
./../../release/dojo-release-1.5.0/dojox/gfx.js
./../../release/dojo-release-1.5.0/dojox/lang/functional/lambda.js
./../../release/dojo-release-1.5.0/dojox/lang/functional/array.js
./../../release/dojo-release-1.5.0/dojox/lang/functional/object.js
./../../release/dojo-release-1.5.0/dojox/lang/functional.js
./../../release/dojo-release-1.5.0/dojox/lang/functional/fold.js
./../../release/dojo-release-1.5.0/dojox/lang/functional/reversed.js
./../../release/dojo-release-1.5.0/dojo/colors.js
./../../release/dojo-release-1.5.0/dojox/color/_base.js
./../../release/dojo-release-1.5.0/dojox/color.js
./../../release/dojo-release-1.5.0/dojox/color/Palette.js
./../../release/dojo-release-1.5.0/dojox/lang/utils.js
./../../release/dojo-release-1.5.0/dojox/gfx/gradutils.js
./../../release/dojo-release-1.5.0/dojox/charting/Theme.js
./../../release/dojo-release-1.5.0/dojox/charting/Element.js
./../../release/dojo-release-1.5.0/dojox/charting/Series.js
./../../release/dojo-release-1.5.0/dojox/charting/scaler/common.js
./../../release/dojo-release-1.5.0/dojox/charting/scaler/linear.js
./../../release/dojo-release-1.5.0/dojox/charting/axis2d/common.js
./../../release/dojo-release-1.5.0/dojox/charting/axis2d/Base.js
./../../release/dojo-release-1.5.0/dojo/string.js
./../../release/dojo-release-1.5.0/dojox/charting/axis2d/Invisible.js
./../../release/dojo-release-1.5.0/dojox/charting/axis2d/Default.js
./../../release/dojo-release-1.5.0/dojox/charting/plot2d/common.js
./../../release/dojo-release-1.5.0/dojox/charting/scaler/primitive.js
./../../release/dojo-release-1.5.0/dojox/charting/plot2d/_PlotEvents.js
./../../release/dojo-release-1.5.0/dojox/charting/plot2d/Base.js
./../../release/dojo-release-1.5.0/dojox/gfx/fx.js
./../../release/dojo-release-1.5.0/dojox/charting/plot2d/Default.js
./../../release/dojo-release-1.5.0/dojox/charting/plot2d/Lines.js
./../../release/dojo-release-1.5.0/dojox/charting/plot2d/Areas.js
./../../release/dojo-release-1.5.0/dojox/charting/plot2d/Markers.js
./../../release/dojo-release-1.5.0/dojox/charting/plot2d/MarkersOnly.js
./../../release/dojo-release-1.5.0/dojox/charting/plot2d/Scatter.js
./../../release/dojo-release-1.5.0/dojox/lang/functional/sequence.js
./../../release/dojo-release-1.5.0/dojox/charting/plot2d/Stacked.js
./../../release/dojo-release-1.5.0/dojox/charting/plot2d/StackedLines.js
./../../release/dojo-release-1.5.0/dojox/charting/plot2d/StackedAreas.js
./../../release/dojo-release-1.5.0/dojox/charting/plot2d/Columns.js
./../../release/dojo-release-1.5.0/dojox/charting/plot2d/StackedColumns.js
./../../release/dojo-release-1.5.0/dojox/charting/plot2d/ClusteredColumns.js
./../../release/dojo-release-1.5.0/dojox/charting/plot2d/Bars.js
./../../release/dojo-release-1.5.0/dojox/charting/plot2d/StackedBars.js
./../../release/dojo-release-1.5.0/dojox/charting/plot2d/ClusteredBars.js
./../../release/dojo-release-1.5.0/dojox/charting/plot2d/Grid.js
./../../release/dojo-release-1.5.0/dojo/i18n.js
./../../release/dojo-release-1.5.0/dojo/regexp.js
./../../release/dojo-release-1.5.0/dojo/number.js
./../../release/dojo-release-1.5.0/dojox/charting/plot2d/Pie.js
./../../release/dojo-release-1.5.0/dojox/charting/plot2d/Bubble.js
./../../release/dojo-release-1.5.0/dojox/charting/plot2d/Candlesticks.js
./../../release/dojo-release-1.5.0/dojox/charting/plot2d/OHLC.js
./../../release/dojo-release-1.5.0/dojox/charting/Chart2D.js
./../../release/dojo-release-1.5.0/dojo/fx/easing.js
./../../release/dojo-release-1.5.0/dojox/charting/action2d/Base.js
./../../release/dojo-release-1.5.0/dojox/charting/action2d/Highlight.js
./../../release/dojo-release-1.5.0/dojo/fx/Toggler.js
./../../release/dojo-release-1.5.0/dojo/fx.js
./../../release/dojo-release-1.5.0/dojox/charting/action2d/Magnify.js
./../../release/dojo-release-1.5.0/dojox/lang/functional/scan.js
./../../release/dojo-release-1.5.0/dojox/charting/action2d/MoveSlice.js
./../../release/dojo-release-1.5.0/dojox/charting/action2d/Shake.js
./../../release/dojo-release-1.5.0/dojo/date/stamp.js
./../../release/dojo-release-1.5.0/dojo/parser.js
./../../release/dojo-release-1.5.0/dojo/cache.js
./../../release/dojo-release-1.5.0/dijit/_Templated.js
./../../release/dojo-release-1.5.0/dijit/Tooltip.js
./../../release/dojo-release-1.5.0/dojox/charting/action2d/Tooltip.js
./../../release/dojo-release-1.5.0/dojox/charting/widget/Chart2D.js
./../../release/dojo-release-1.5.0/dojox/charting/themes/ET/greys.js
./../../release/dojo-release-1.5.0/dojox/charting/widget/Sparkline.js
./../../release/dojo-release-1.5.0/dojox/charting/widget/Legend.js
../dojox/dtl.js:
./../../release/dojo-release-1.5.0/dojox/string/Builder.js
./../../release/dojo-release-1.5.0/dojox/string/tokenize.js
./../../release/dojo-release-1.5.0/dojox/dtl/_base.js
./../../release/dojo-release-1.5.0/dojox/dtl.js
./../../release/dojo-release-1.5.0/dojox/dtl/Context.js
./../../release/dojo-release-1.5.0/dojox/dtl/tag/logic.js
./../../release/dojo-release-1.5.0/dojox/dtl/tag/loop.js
./../../release/dojo-release-1.5.0/dojo/date.js
./../../release/dojo-release-1.5.0/dojox/date/php.js
./../../release/dojo-release-1.5.0/dojox/dtl/utils/date.js
./../../release/dojo-release-1.5.0/dojox/dtl/tag/date.js
./../../release/dojo-release-1.5.0/dojox/dtl/tag/loader.js
./../../release/dojo-release-1.5.0/dojox/dtl/tag/misc.js
./../../release/dojo-release-1.5.0/dojox/dtl/ext-dojo/NodeList.js
tt-rss-layer.js:
./../../release/dojo/date/stamp.js
./../../release/dojo/parser.js
./../../release/dojo/window.js
./../../release/dijit/_base/manager.js
./../../release/dijit/_base/focus.js
./../../release/dojo/AdapterRegistry.js
./../../release/dijit/_base/place.js
./../../release/dijit/_base/window.js
./../../release/dijit/_base/popup.js
./../../release/dijit/_base/scroll.js
./../../release/dojo/uacss.js
./../../release/dijit/_base/sniff.js
./../../release/dijit/_base/typematic.js
./../../release/dijit/_base/wai.js
./../../release/dijit/_base.js
./../../release/dijit/_Widget.js
./../../release/dojo/string.js
./../../release/dojo/cache.js
./../../release/dijit/_Templated.js
./../../release/dijit/_Container.js
./../../release/dijit/_Contained.js
./../../release/dijit/layout/_LayoutWidget.js
./../../release/dijit/_CssStateMixin.js
./../../release/dijit/form/_FormWidget.js
./../../release/dijit/dijit.js
./../../release/dojo/fx/Toggler.js
./../../release/dojo/fx.js
./../../release/dojo/NodeList-fx.js
./../../release/dojo/colors.js
./../../release/dojo/i18n.js
./../../release/dijit/_PaletteMixin.js
./../../release/dijit/ColorPalette.js
./../../release/dojo/dnd/common.js
./../../release/dojo/dnd/autoscroll.js
./../../release/dojo/dnd/Mover.js
./../../release/dojo/dnd/Moveable.js
./../../release/dojo/dnd/move.js
./../../release/dojo/dnd/TimedMoveable.js
./../../release/dijit/form/_FormMixin.js
./../../release/dijit/_DialogMixin.js
./../../release/dijit/DialogUnderlay.js
./../../release/dojo/html.js
./../../release/dijit/layout/ContentPane.js
./../../release/dijit/TooltipDialog.js
./../../release/dijit/Dialog.js
./../../release/dijit/_HasDropDown.js
./../../release/dijit/form/Button.js
./../../release/dijit/form/ToggleButton.js
./../../release/dijit/form/CheckBox.js
./../../release/dijit/form/DropDownButton.js
./../../release/dojo/regexp.js
./../../release/dojo/data/util/sorter.js
./../../release/dojo/data/util/simpleFetch.js
./../../release/dojo/data/util/filter.js
./../../release/dijit/form/TextBox.js
./../../release/dijit/Tooltip.js
./../../release/dijit/form/ValidationTextBox.js
./../../release/dijit/form/ComboBox.js
./../../release/dijit/form/FilteringSelect.js
./../../release/dijit/form/Form.js
./../../release/dijit/form/RadioButton.js
./../../release/dijit/form/_FormSelectWidget.js
./../../release/dijit/_KeyNavContainer.js
./../../release/dijit/MenuItem.js
./../../release/dijit/PopupMenuItem.js
./../../release/dijit/CheckedMenuItem.js
./../../release/dijit/MenuSeparator.js
./../../release/dijit/Menu.js
./../../release/dijit/form/Select.js
./../../release/dijit/form/SimpleTextarea.js
./../../release/dijit/InlineEditBox.js
./../../release/dojo/cookie.js
./../../release/dijit/layout/StackController.js
./../../release/dijit/layout/StackContainer.js
./../../release/dijit/layout/AccordionPane.js
./../../release/dijit/layout/AccordionContainer.js
./../../release/dijit/layout/BorderContainer.js
./../../release/dijit/layout/_TabContainerBase.js
./../../release/dijit/layout/TabController.js
./../../release/dijit/layout/ScrollingTabController.js
./../../release/dijit/layout/TabContainer.js
./../../release/dojo/number.js
./../../release/dijit/ProgressBar.js
./../../release/dijit/ToolbarSeparator.js
./../../release/dijit/Toolbar.js
./../../release/dojo/DeferredList.js
./../../release/dijit/tree/TreeStoreModel.js
./../../release/dijit/tree/ForestStoreModel.js
./../../release/dijit/Tree.js
./../../release/dojo/dnd/Container.js
./../../release/dijit/tree/_dndContainer.js
./../../release/dijit/tree/_dndSelector.js
./../../release/dojo/dnd/Avatar.js
./../../release/dojo/dnd/Manager.js
./../../release/dijit/tree/dndSource.js
./../../release/dojo/data/ItemFileReadStore.js
./../../release/dojo/data/ItemFileWriteStore.js

@ -5,50 +5,123 @@
*/
if(!dojo._hasResource["dojo.cache"]){
dojo._hasResource["dojo.cache"]=true;
if(!dojo._hasResource["dojo.cache"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.cache"] = true;
dojo.provide("dojo.cache");
(function(){
var _1={};
dojo.cache=function(_2,_3,_4){
if(typeof _2=="string"){
var _5=dojo.moduleUrl(_2,_3);
}else{
_5=_2;
_4=_3;
}
var _6=_5.toString();
var _7=_4;
if(_4!=undefined&&!dojo.isString(_4)){
_7=("value" in _4?_4.value:undefined);
}
var _8=_4&&_4.sanitize?true:false;
if(typeof _7=="string"){
_7=_1[_6]=_8?dojo.cache._sanitize(_7):_7;
}else{
if(_7===null){
delete _1[_6];
}else{
if(!(_6 in _1)){
_7=dojo._getText(_6);
_1[_6]=_8?dojo.cache._sanitize(_7):_7;
}
_7=_1[_6];
}
}
return _7;
};
dojo.cache._sanitize=function(_9){
if(_9){
_9=_9.replace(/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,"");
var _a=_9.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);
if(_a){
_9=_a[1];
}
}else{
_9="";
}
return _9;
/*=====
dojo.cache = {
// summary:
// A way to cache string content that is fetchable via `dojo.moduleUrl`.
};
=====*/
(function(){
var cache = {};
dojo.cache = function(/*String||Object*/module, /*String*/url, /*String||Object?*/value){
// summary:
// A getter and setter for storing the string content associated with the
// module and url arguments.
// description:
// module and url are used to call `dojo.moduleUrl()` to generate a module URL.
// If value is specified, the cache value for the moduleUrl will be set to
// that value. Otherwise, dojo.cache will fetch the moduleUrl and store it
// in its internal cache and return that cached value for the URL. To clear
// a cache value pass null for value. Since XMLHttpRequest (XHR) is used to fetch the
// the URL contents, only modules on the same domain of the page can use this capability.
// The build system can inline the cache values though, to allow for xdomain hosting.
// module: String||Object
// If a String, the module name to use for the base part of the URL, similar to module argument
// to `dojo.moduleUrl`. If an Object, something that has a .toString() method that
// generates a valid path for the cache item. For example, a dojo._Url object.
// url: String
// The rest of the path to append to the path derived from the module argument. If
// module is an object, then this second argument should be the "value" argument instead.
// value: String||Object?
// If a String, the value to use in the cache for the module/url combination.
// If an Object, it can have two properties: value and sanitize. The value property
// should be the value to use in the cache, and sanitize can be set to true or false,
// to indicate if XML declarations should be removed from the value and if the HTML
// inside a body tag in the value should be extracted as the real value. The value argument
// or the value property on the value argument are usually only used by the build system
// as it inlines cache content.
// example:
// To ask dojo.cache to fetch content and store it in the cache (the dojo["cache"] style
// of call is used to avoid an issue with the build system erroneously trying to intern
// this example. To get the build system to intern your dojo.cache calls, use the
// "dojo.cache" style of call):
// | //If template.html contains "<h1>Hello</h1>" that will be
// | //the value for the text variable.
// | var text = dojo["cache"]("my.module", "template.html");
// example:
// To ask dojo.cache to fetch content and store it in the cache, and sanitize the input
// (the dojo["cache"] style of call is used to avoid an issue with the build system
// erroneously trying to intern this example. To get the build system to intern your
// dojo.cache calls, use the "dojo.cache" style of call):
// | //If template.html contains "<html><body><h1>Hello</h1></body></html>", the
// | //text variable will contain just "<h1>Hello</h1>".
// | var text = dojo["cache"]("my.module", "template.html", {sanitize: true});
// example:
// Same example as previous, but demostrates how an object can be passed in as
// the first argument, then the value argument can then be the second argument.
// | //If template.html contains "<html><body><h1>Hello</h1></body></html>", the
// | //text variable will contain just "<h1>Hello</h1>".
// | var text = dojo["cache"](new dojo._Url("my/module/template.html"), {sanitize: true});
//Module could be a string, or an object that has a toString() method
//that will return a useful path. If it is an object, then the "url" argument
//will actually be the value argument.
if(typeof module == "string"){
var pathObj = dojo.moduleUrl(module, url);
}else{
pathObj = module;
value = url;
}
var key = pathObj.toString();
var val = value;
if(value != undefined && !dojo.isString(value)){
val = ("value" in value ? value.value : undefined);
}
var sanitize = value && value.sanitize ? true : false;
if(typeof val == "string"){
//We have a string, set cache value
val = cache[key] = sanitize ? dojo.cache._sanitize(val) : val;
}else if(val === null){
//Remove cached value
delete cache[key];
}else{
//Allow cache values to be empty strings. If key property does
//not exist, fetch it.
if(!(key in cache)){
val = dojo._getText(key);
cache[key] = sanitize ? dojo.cache._sanitize(val) : val;
}
val = cache[key];
}
return val; //String
};
dojo.cache._sanitize = function(/*String*/val){
// summary:
// Strips <?xml ...?> declarations so that external SVG and XML
// documents can be added to a document without worry. Also, if the string
// is an HTML document, only the part inside the body tag is returned.
// description:
// Copied from dijit._Templated._sanitizeTemplateString.
if(val){
val = val.replace(/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im, "");
var matches = val.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);
if(matches){
val = matches[1];
}
}else{
val = "";
}
return val; //String
};
})();
}

@ -5,19 +5,33 @@
*/
if(!dojo._hasResource["dojo.cldr.monetary"]){
dojo._hasResource["dojo.cldr.monetary"]=true;
if(!dojo._hasResource["dojo.cldr.monetary"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.cldr.monetary"] = true;
dojo.provide("dojo.cldr.monetary");
dojo.cldr.monetary.getData=function(_1){
var _2={ADP:0,AFN:0,ALL:0,AMD:0,BHD:3,BIF:0,BYR:0,CLF:0,CLP:0,COP:0,CRC:0,DJF:0,ESP:0,GNF:0,GYD:0,HUF:0,IDR:0,IQD:0,IRR:3,ISK:0,ITL:0,JOD:3,JPY:0,KMF:0,KPW:0,KRW:0,KWD:3,LAK:0,LBP:0,LUF:0,LYD:3,MGA:0,MGF:0,MMK:0,MNT:0,MRO:0,MUR:0,OMR:3,PKR:0,PYG:0,RSD:0,RWF:0,SLL:0,SOS:0,STD:0,SYP:0,TMM:0,TND:3,TRL:0,TZS:0,UGX:0,UZS:0,VND:0,VUV:0,XAF:0,XOF:0,XPF:0,YER:0,ZMK:0,ZWD:0};
var _3={CHF:5};
var _4=_2[_1],_5=_3[_1];
if(typeof _4=="undefined"){
_4=2;
}
if(typeof _5=="undefined"){
_5=0;
}
return {places:_4,round:_5};
dojo.cldr.monetary.getData = function(/*String*/code){
// summary: A mapping of currency code to currency-specific formatting information. Returns a unique object with properties: places, round.
// code: an [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code
// from http://www.unicode.org/cldr/data/common/supplemental/supplementalData.xml:supplementalData/currencyData/fractions
var placesData = {
ADP:0,AFN:0,ALL:0,AMD:0,BHD:3,BIF:0,BYR:0,CLF:0,CLP:0,
COP:0,CRC:0,DJF:0,ESP:0,GNF:0,GYD:0,HUF:0,IDR:0,IQD:0,
IRR:3,ISK:0,ITL:0,JOD:3,JPY:0,KMF:0,KPW:0,KRW:0,KWD:3,
LAK:0,LBP:0,LUF:0,LYD:3,MGA:0,MGF:0,MMK:0,MNT:0,MRO:0,
MUR:0,OMR:3,PKR:0,PYG:0,RSD:0,RWF:0,SLL:0,SOS:0,STD:0,
SYP:0,TMM:0,TND:3,TRL:0,TZS:0,UGX:0,UZS:0,VND:0,VUV:0,
XAF:0,XOF:0,XPF:0,YER:0,ZMK:0,ZWD:0
};
var roundingData = {CHF:5};
var places = placesData[code], round = roundingData[code];
if(typeof places == "undefined"){ places = 2; }
if(typeof round == "undefined"){ round = 0; }
return {places: places, round: round}; // Object
};
}

@ -5,41 +5,77 @@
*/
if(!dojo._hasResource["dojo.cldr.supplemental"]){
dojo._hasResource["dojo.cldr.supplemental"]=true;
if(!dojo._hasResource["dojo.cldr.supplemental"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.cldr.supplemental"] = true;
dojo.provide("dojo.cldr.supplemental");
dojo.require("dojo.i18n");
dojo.cldr.supplemental.getFirstDayOfWeek=function(_1){
var _2={mv:5,af:6,bh:6,dj:6,dz:6,eg:6,er:6,et:6,iq:6,ir:6,jo:6,ke:6,kw:6,ly:6,ma:6,om:6,qa:6,sa:6,sd:6,so:6,tn:6,ye:6,ar:0,as:0,az:0,bw:0,ca:0,cn:0,fo:0,ge:0,gl:0,gu:0,hk:0,ie:0,il:0,"in":0,is:0,jm:0,jp:0,kg:0,kr:0,la:0,mh:0,mn:0,mo:0,mp:0,mt:0,nz:0,ph:0,pk:0,sg:0,sy:0,th:0,tt:0,tw:0,um:0,us:0,uz:0,vi:0,zw:0};
var _3=dojo.cldr.supplemental._region(_1);
var _4=_2[_3];
return (_4===undefined)?1:_4;
};
dojo.cldr.supplemental._region=function(_5){
_5=dojo.i18n.normalizeLocale(_5);
var _6=_5.split("-");
var _7=_6[1];
if(!_7){
_7={de:"de",en:"us",es:"es",fi:"fi",fr:"fr",he:"il",hu:"hu",it:"it",ja:"jp",ko:"kr",nl:"nl",pt:"br",sv:"se",zh:"cn"}[_6[0]];
}else{
if(_7.length==4){
_7=_6[2];
}
}
return _7;
dojo.cldr.supplemental.getFirstDayOfWeek = function(/*String?*/locale){
// summary: Returns a zero-based index for first day of the week
// description:
// Returns a zero-based index for first day of the week, as used by the local (Gregorian) calendar.
// e.g. Sunday (returns 0), or Monday (returns 1)
// from http://www.unicode.org/cldr/data/common/supplemental/supplementalData.xml:supplementalData/weekData/firstDay
var firstDay = {/*default is 1=Monday*/
mv:5,
af:6,bh:6,dj:6,dz:6,eg:6,er:6,et:6,iq:6,ir:6,jo:6,ke:6,kw:6,
ly:6,ma:6,om:6,qa:6,sa:6,sd:6,so:6,tn:6,ye:6,
ar:0,as:0,az:0,bw:0,ca:0,cn:0,fo:0,ge:0,gl:0,gu:0,hk:0,ie:0,
il:0,'in':0,is:0,jm:0,jp:0,kg:0,kr:0,la:0,mh:0,mn:0,mo:0,mp:0,
mt:0,nz:0,ph:0,pk:0,sg:0,sy:0,th:0,tt:0,tw:0,um:0,us:0,uz:0,
vi:0,zw:0
// variant. do not use? gb:0,
};
var country = dojo.cldr.supplemental._region(locale);
var dow = firstDay[country];
return (dow === undefined) ? 1 : dow; /*Number*/
};
dojo.cldr.supplemental.getWeekend=function(_8){
var _9={"in":0,af:4,dz:4,ir:4,om:4,sa:4,ye:4,ae:5,bh:5,eg:5,il:5,iq:5,jo:5,kw:5,ly:5,ma:5,qa:5,sd:5,sy:5,tn:5};
var _a={af:5,dz:5,ir:5,om:5,sa:5,ye:5,ae:6,bh:5,eg:6,il:6,iq:6,jo:6,kw:6,ly:6,ma:6,qa:6,sd:6,sy:6,tn:6};
var _b=dojo.cldr.supplemental._region(_8);
var _c=_9[_b];
var _d=_a[_b];
if(_c===undefined){
_c=6;
}
if(_d===undefined){
_d=0;
dojo.cldr.supplemental._region = function(/*String?*/locale){
locale = dojo.i18n.normalizeLocale(locale);
var tags = locale.split('-');
var region = tags[1];
if(!region){
// IE often gives language only (#2269)
// Arbitrary mappings of language-only locales to a country:
region = {de:"de", en:"us", es:"es", fi:"fi", fr:"fr", he:"il", hu:"hu", it:"it",
ja:"jp", ko:"kr", nl:"nl", pt:"br", sv:"se", zh:"cn"}[tags[0]];
}else if(region.length == 4){
// The ISO 3166 country code is usually in the second position, unless a
// 4-letter script is given. See http://www.ietf.org/rfc/rfc4646.txt
region = tags[2];
}
return region;
}
return {start:_c,end:_d};
dojo.cldr.supplemental.getWeekend = function(/*String?*/locale){
// summary: Returns a hash containing the start and end days of the weekend
// description:
// Returns a hash containing the start and end days of the weekend according to local custom using locale,
// or by default in the user's locale.
// e.g. {start:6, end:0}
// from http://www.unicode.org/cldr/data/common/supplemental/supplementalData.xml:supplementalData/weekData/weekend{Start,End}
var weekendStart = {/*default is 6=Saturday*/
'in':0,
af:4,dz:4,ir:4,om:4,sa:4,ye:4,
ae:5,bh:5,eg:5,il:5,iq:5,jo:5,kw:5,ly:5,ma:5,qa:5,sd:5,sy:5,tn:5
};
var weekendEnd = {/*default is 0=Sunday*/
af:5,dz:5,ir:5,om:5,sa:5,ye:5,
ae:6,bh:5,eg:6,il:6,iq:6,jo:6,kw:6,ly:6,ma:6,qa:6,sd:6,sy:6,tn:6
};
var country = dojo.cldr.supplemental._region(locale);
var start = weekendStart[country];
var end = weekendEnd[country];
if(start === undefined){start=6;}
if(end === undefined){end=0;}
return {start:start, end:end}; /*Object {start,end}*/
};
}

@ -5,72 +5,232 @@
*/
if(!dojo._hasResource["dojo.colors"]){
dojo._hasResource["dojo.colors"]=true;
if(!dojo._hasResource["dojo.colors"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.colors"] = true;
dojo.provide("dojo.colors");
(function(){
var _1=function(m1,m2,h){
if(h<0){
++h;
}
if(h>1){
--h;
}
var h6=6*h;
if(h6<1){
return m1+(m2-m1)*h6;
}
if(2*h<1){
return m2;
}
if(3*h<2){
return m1+(m2-m1)*(2/3-h)*6;
}
return m1;
};
dojo.colorFromRgb=function(_2,_3){
var m=_2.toLowerCase().match(/^(rgba?|hsla?)\(([\s\.\-,%0-9]+)\)/);
if(m){
var c=m[2].split(/\s*,\s*/),l=c.length,t=m[1],a;
if((t=="rgb"&&l==3)||(t=="rgba"&&l==4)){
var r=c[0];
if(r.charAt(r.length-1)=="%"){
a=dojo.map(c,function(x){
return parseFloat(x)*2.56;
});
if(l==4){
a[3]=c[3];
}
return dojo.colorFromArray(a,_3);
}
return dojo.colorFromArray(c,_3);
}
if((t=="hsl"&&l==3)||(t=="hsla"&&l==4)){
var H=((parseFloat(c[0])%360)+360)%360/360,S=parseFloat(c[1])/100,L=parseFloat(c[2])/100,m2=L<=0.5?L*(S+1):L+S-L*S,m1=2*L-m2;
a=[_1(m1,m2,H+1/3)*256,_1(m1,m2,H)*256,_1(m1,m2,H-1/3)*256,1];
if(l==4){
a[3]=c[3];
}
return dojo.colorFromArray(a,_3);
}
//TODO: this module appears to break naming conventions
/*=====
dojo.colors = {
// summary: Color utilities
}
return null;
};
var _4=function(c,_5,_6){
c=Number(c);
return isNaN(c)?_6:c<_5?_5:c>_6?_6:c;
};
dojo.Color.prototype.sanitize=function(){
var t=this;
t.r=Math.round(_4(t.r,0,255));
t.g=Math.round(_4(t.g,0,255));
t.b=Math.round(_4(t.b,0,255));
t.a=_4(t.a,0,1);
return this;
};
=====*/
(function(){
// this is a standard conversion prescribed by the CSS3 Color Module
var hue2rgb = function(m1, m2, h){
if(h < 0){ ++h; }
if(h > 1){ --h; }
var h6 = 6 * h;
if(h6 < 1){ return m1 + (m2 - m1) * h6; }
if(2 * h < 1){ return m2; }
if(3 * h < 2){ return m1 + (m2 - m1) * (2 / 3 - h) * 6; }
return m1;
};
dojo.colorFromRgb = function(/*String*/ color, /*dojo.Color?*/ obj){
// summary:
// get rgb(a) array from css-style color declarations
// description:
// this function can handle all 4 CSS3 Color Module formats: rgb,
// rgba, hsl, hsla, including rgb(a) with percentage values.
var m = color.toLowerCase().match(/^(rgba?|hsla?)\(([\s\.\-,%0-9]+)\)/);
if(m){
var c = m[2].split(/\s*,\s*/), l = c.length, t = m[1], a;
if((t == "rgb" && l == 3) || (t == "rgba" && l == 4)){
var r = c[0];
if(r.charAt(r.length - 1) == "%"){
// 3 rgb percentage values
a = dojo.map(c, function(x){
return parseFloat(x) * 2.56;
});
if(l == 4){ a[3] = c[3]; }
return dojo.colorFromArray(a, obj); // dojo.Color
}
return dojo.colorFromArray(c, obj); // dojo.Color
}
if((t == "hsl" && l == 3) || (t == "hsla" && l == 4)){
// normalize hsl values
var H = ((parseFloat(c[0]) % 360) + 360) % 360 / 360,
S = parseFloat(c[1]) / 100,
L = parseFloat(c[2]) / 100,
// calculate rgb according to the algorithm
// recommended by the CSS3 Color Module
m2 = L <= 0.5 ? L * (S + 1) : L + S - L * S,
m1 = 2 * L - m2;
a = [
hue2rgb(m1, m2, H + 1 / 3) * 256,
hue2rgb(m1, m2, H) * 256,
hue2rgb(m1, m2, H - 1 / 3) * 256,
1
];
if(l == 4){ a[3] = c[3]; }
return dojo.colorFromArray(a, obj); // dojo.Color
}
}
return null; // dojo.Color
};
var confine = function(c, low, high){
// summary:
// sanitize a color component by making sure it is a number,
// and clamping it to valid values
c = Number(c);
return isNaN(c) ? high : c < low ? low : c > high ? high : c; // Number
};
dojo.Color.prototype.sanitize = function(){
// summary: makes sure that the object has correct attributes
var t = this;
t.r = Math.round(confine(t.r, 0, 255));
t.g = Math.round(confine(t.g, 0, 255));
t.b = Math.round(confine(t.b, 0, 255));
t.a = confine(t.a, 0, 1);
return this; // dojo.Color
};
})();
dojo.colors.makeGrey=function(g,a){
return dojo.colorFromArray([g,g,g,a]);
dojo.colors.makeGrey = function(/*Number*/ g, /*Number?*/ a){
// summary: creates a greyscale color with an optional alpha
return dojo.colorFromArray([g, g, g, a]);
};
dojo.mixin(dojo.Color.named,{aliceblue:[240,248,255],antiquewhite:[250,235,215],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],blanchedalmond:[255,235,205],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],oldlace:[253,245,230],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],thistle:[216,191,216],tomato:[255,99,71],transparent:[0,0,0,0],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],whitesmoke:[245,245,245],yellowgreen:[154,205,50]});
// mixin all CSS3 named colors not already in _base, along with SVG 1.0 variant spellings
dojo.mixin(dojo.Color.named, {
aliceblue: [240,248,255],
antiquewhite: [250,235,215],
aquamarine: [127,255,212],
azure: [240,255,255],
beige: [245,245,220],
bisque: [255,228,196],
blanchedalmond: [255,235,205],
blueviolet: [138,43,226],
brown: [165,42,42],
burlywood: [222,184,135],
cadetblue: [95,158,160],
chartreuse: [127,255,0],
chocolate: [210,105,30],
coral: [255,127,80],
cornflowerblue: [100,149,237],
cornsilk: [255,248,220],
crimson: [220,20,60],
cyan: [0,255,255],
darkblue: [0,0,139],
darkcyan: [0,139,139],
darkgoldenrod: [184,134,11],
darkgray: [169,169,169],
darkgreen: [0,100,0],
darkgrey: [169,169,169],
darkkhaki: [189,183,107],
darkmagenta: [139,0,139],
darkolivegreen: [85,107,47],
darkorange: [255,140,0],
darkorchid: [153,50,204],
darkred: [139,0,0],
darksalmon: [233,150,122],
darkseagreen: [143,188,143],
darkslateblue: [72,61,139],
darkslategray: [47,79,79],
darkslategrey: [47,79,79],
darkturquoise: [0,206,209],
darkviolet: [148,0,211],
deeppink: [255,20,147],
deepskyblue: [0,191,255],
dimgray: [105,105,105],
dimgrey: [105,105,105],
dodgerblue: [30,144,255],
firebrick: [178,34,34],
floralwhite: [255,250,240],
forestgreen: [34,139,34],
gainsboro: [220,220,220],
ghostwhite: [248,248,255],
gold: [255,215,0],
goldenrod: [218,165,32],
greenyellow: [173,255,47],
grey: [128,128,128],
honeydew: [240,255,240],
hotpink: [255,105,180],
indianred: [205,92,92],
indigo: [75,0,130],
ivory: [255,255,240],
khaki: [240,230,140],
lavender: [230,230,250],
lavenderblush: [255,240,245],
lawngreen: [124,252,0],
lemonchiffon: [255,250,205],
lightblue: [173,216,230],
lightcoral: [240,128,128],
lightcyan: [224,255,255],
lightgoldenrodyellow: [250,250,210],
lightgray: [211,211,211],
lightgreen: [144,238,144],
lightgrey: [211,211,211],
lightpink: [255,182,193],
lightsalmon: [255,160,122],
lightseagreen: [32,178,170],
lightskyblue: [135,206,250],
lightslategray: [119,136,153],
lightslategrey: [119,136,153],
lightsteelblue: [176,196,222],
lightyellow: [255,255,224],
limegreen: [50,205,50],
linen: [250,240,230],
magenta: [255,0,255],
mediumaquamarine: [102,205,170],
mediumblue: [0,0,205],
mediumorchid: [186,85,211],
mediumpurple: [147,112,219],
mediumseagreen: [60,179,113],
mediumslateblue: [123,104,238],
mediumspringgreen: [0,250,154],
mediumturquoise: [72,209,204],
mediumvioletred: [199,21,133],
midnightblue: [25,25,112],
mintcream: [245,255,250],
mistyrose: [255,228,225],
moccasin: [255,228,181],
navajowhite: [255,222,173],
oldlace: [253,245,230],
olivedrab: [107,142,35],
orange: [255,165,0],
orangered: [255,69,0],
orchid: [218,112,214],
palegoldenrod: [238,232,170],
palegreen: [152,251,152],
paleturquoise: [175,238,238],
palevioletred: [219,112,147],
papayawhip: [255,239,213],
peachpuff: [255,218,185],
peru: [205,133,63],
pink: [255,192,203],
plum: [221,160,221],
powderblue: [176,224,230],
rosybrown: [188,143,143],
royalblue: [65,105,225],
saddlebrown: [139,69,19],
salmon: [250,128,114],
sandybrown: [244,164,96],
seagreen: [46,139,87],
seashell: [255,245,238],
sienna: [160,82,45],
skyblue: [135,206,235],
slateblue: [106,90,205],
slategray: [112,128,144],
slategrey: [112,128,144],
snow: [255,250,250],
springgreen: [0,255,127],
steelblue: [70,130,180],
tan: [210,180,140],
thistle: [216,191,216],
tomato: [255,99,71],
transparent: [0, 0, 0, 0],
turquoise: [64,224,208],
violet: [238,130,238],
wheat: [245,222,179],
whitesmoke: [245,245,245],
yellowgreen: [154,205,50]
});
}

@ -5,46 +5,98 @@
*/
if(!dojo._hasResource["dojo.cookie"]){
dojo._hasResource["dojo.cookie"]=true;
if(!dojo._hasResource["dojo.cookie"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.cookie"] = true;
dojo.provide("dojo.cookie");
dojo.require("dojo.regexp");
dojo.cookie=function(_1,_2,_3){
var c=document.cookie;
if(arguments.length==1){
var _4=c.match(new RegExp("(?:^|; )"+dojo.regexp.escapeString(_1)+"=([^;]*)"));
return _4?decodeURIComponent(_4[1]):undefined;
}else{
_3=_3||{};
var _5=_3.expires;
if(typeof _5=="number"){
var d=new Date();
d.setTime(d.getTime()+_5*24*60*60*1000);
_5=_3.expires=d;
}
if(_5&&_5.toUTCString){
_3.expires=_5.toUTCString();
}
_2=encodeURIComponent(_2);
var _6=_1+"="+_2,_7;
for(_7 in _3){
_6+="; "+_7;
var _8=_3[_7];
if(_8!==true){
_6+="="+_8;
}
}
document.cookie=_6;
/*=====
dojo.__cookieProps = function(){
// expires: Date|String|Number?
// If a number, the number of days from today at which the cookie
// will expire. If a date, the date past which the cookie will expire.
// If expires is in the past, the cookie will be deleted.
// If expires is omitted or is 0, the cookie will expire when the browser closes. << FIXME: 0 seems to disappear right away? FF3.
// path: String?
// The path to use for the cookie.
// domain: String?
// The domain to use for the cookie.
// secure: Boolean?
// Whether to only send the cookie on secure connections
this.expires = expires;
this.path = path;
this.domain = domain;
this.secure = secure;
}
=====*/
dojo.cookie = function(/*String*/name, /*String?*/value, /*dojo.__cookieProps?*/props){
// summary:
// Get or set a cookie.
// description:
// If one argument is passed, returns the value of the cookie
// For two or more arguments, acts as a setter.
// name:
// Name of the cookie
// value:
// Value for the cookie
// props:
// Properties for the cookie
// example:
// set a cookie with the JSON-serialized contents of an object which
// will expire 5 days from now:
// | dojo.cookie("configObj", dojo.toJson(config), { expires: 5 });
//
// example:
// de-serialize a cookie back into a JavaScript object:
// | var config = dojo.fromJson(dojo.cookie("configObj"));
//
// example:
// delete a cookie:
// | dojo.cookie("configObj", null, {expires: -1});
var c = document.cookie;
if(arguments.length == 1){
var matches = c.match(new RegExp("(?:^|; )" + dojo.regexp.escapeString(name) + "=([^;]*)"));
return matches ? decodeURIComponent(matches[1]) : undefined; // String or undefined
}else{
props = props || {};
// FIXME: expires=0 seems to disappear right away, not on close? (FF3) Change docs?
var exp = props.expires;
if(typeof exp == "number"){
var d = new Date();
d.setTime(d.getTime() + exp*24*60*60*1000);
exp = props.expires = d;
}
if(exp && exp.toUTCString){ props.expires = exp.toUTCString(); }
value = encodeURIComponent(value);
var updatedCookie = name + "=" + value, propName;
for(propName in props){
updatedCookie += "; " + propName;
var propValue = props[propName];
if(propValue !== true){ updatedCookie += "=" + propValue; }
}
document.cookie = updatedCookie;
}
};
dojo.cookie.isSupported=function(){
if(!("cookieEnabled" in navigator)){
this("__djCookieTest__","CookiesAllowed");
navigator.cookieEnabled=this("__djCookieTest__")=="CookiesAllowed";
if(navigator.cookieEnabled){
this("__djCookieTest__","",{expires:-1});
}
}
return navigator.cookieEnabled;
dojo.cookie.isSupported = function(){
// summary:
// Use to determine if the current browser supports cookies or not.
//
// Returns true if user allows cookies.
// Returns false if user doesn't allow cookies.
if(!("cookieEnabled" in navigator)){
this("__djCookieTest__", "CookiesAllowed");
navigator.cookieEnabled = this("__djCookieTest__") == "CookiesAllowed";
if(navigator.cookieEnabled){
this("__djCookieTest__", "", {expires: -1});
}
}
return navigator.cookieEnabled;
};
}

@ -5,32 +5,135 @@
*/
if(!dojo._hasResource["dojo.currency"]){
dojo._hasResource["dojo.currency"]=true;
if(!dojo._hasResource["dojo.currency"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.currency"] = true;
dojo.provide("dojo.currency");
dojo.require("dojo.number");
dojo.require("dojo.i18n");
dojo.requireLocalization("dojo.cldr","currency",null,"ROOT,ar,ca,cs,da,de,el,en,en-au,en-ca,es,fi,fr,he,hu,it,ja,ko,nb,nl,pl,pt,ru,sk,sl,sv,th,tr,zh,zh-tw");
dojo.requireLocalization("dojo.cldr", "currency", null, "ROOT,ar,ca,cs,da,de,el,en,en-au,en-ca,es,fi,fr,he,hu,it,ja,ko,nb,nl,pl,pt,ru,sk,sl,sv,th,tr,zh,zh-tw");
dojo.require("dojo.cldr.monetary");
dojo.currency._mixInDefaults=function(_1){
_1=_1||{};
_1.type="currency";
var _2=dojo.i18n.getLocalization("dojo.cldr","currency",_1.locale)||{};
var _3=_1.currency;
var _4=dojo.cldr.monetary.getData(_3);
dojo.forEach(["displayName","symbol","group","decimal"],function(_5){
_4[_5]=_2[_3+"_"+_5];
/*=====
dojo.currency = {
// summary: localized formatting and parsing routines for currencies
//
// description: extends dojo.number to provide culturally-appropriate formatting of values
// in various world currencies, including use of a currency symbol. The currencies are specified
// by a three-letter international symbol in all uppercase, and support for the currencies is
// provided by the data in `dojo.cldr`. The scripts generating dojo.cldr specify which
// currency support is included. A fixed number of decimal places is determined based
// on the currency type and is not determined by the 'pattern' argument. The fractional
// portion is optional, by default, and variable length decimals are not supported.
}
=====*/
dojo.currency._mixInDefaults = function(options){
options = options || {};
options.type = "currency";
// Get locale-dependent currency data, like the symbol
var bundle = dojo.i18n.getLocalization("dojo.cldr", "currency", options.locale) || {};
// Mixin locale-independent currency data, like # of places
var iso = options.currency;
var data = dojo.cldr.monetary.getData(iso);
dojo.forEach(["displayName","symbol","group","decimal"], function(prop){
data[prop] = bundle[iso+"_"+prop];
});
data.fractional = [true, false];
// Mixin with provided options
return dojo.mixin(data, options);
}
/*=====
dojo.declare("dojo.currency.__FormatOptions", [dojo.number.__FormatOptions], {
// type: String?
// Should not be set. Value is assumed to be "currency".
// symbol: String?
// localized currency symbol. The default will be looked up in table of supported currencies in `dojo.cldr`
// A [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code will be used if not found.
// currency: String?
// an [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code, a three letter sequence like "USD".
// For use with dojo.currency only.
// places: Number?
// number of decimal places to show. Default is defined based on which currency is used.
type: "",
symbol: "",
currency: "",
places: ""
});
_4.fractional=[true,false];
return dojo.mixin(_4,_1);
};
dojo.currency.format=function(_6,_7){
return dojo.number.format(_6,dojo.currency._mixInDefaults(_7));
};
dojo.currency.regexp=function(_8){
return dojo.number.regexp(dojo.currency._mixInDefaults(_8));
};
dojo.currency.parse=function(_9,_a){
return dojo.number.parse(_9,dojo.currency._mixInDefaults(_a));
};
=====*/
dojo.currency.format = function(/*Number*/value, /*dojo.currency.__FormatOptions?*/options){
// summary:
// Format a Number as a currency, using locale-specific settings
//
// description:
// Create a string from a Number using a known, localized pattern.
// [Formatting patterns](http://www.unicode.org/reports/tr35/#Number_Elements)
// appropriate to the locale are chosen from the [CLDR](http://unicode.org/cldr)
// as well as the appropriate symbols and delimiters and number of decimal places.
//
// value:
// the number to be formatted.
return dojo.number.format(value, dojo.currency._mixInDefaults(options));
}
dojo.currency.regexp = function(/*dojo.number.__RegexpOptions?*/options){
//
// summary:
// Builds the regular needed to parse a currency value
//
// description:
// Returns regular expression with positive and negative match, group and decimal separators
// Note: the options.places default, the number of decimal places to accept, is defined by the currency type.
return dojo.number.regexp(dojo.currency._mixInDefaults(options)); // String
}
/*=====
dojo.declare("dojo.currency.__ParseOptions", [dojo.number.__ParseOptions], {
// type: String?
// Should not be set. Value is assumed to be currency.
// currency: String?
// an [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code, a three letter sequence like "USD".
// For use with dojo.currency only.
// symbol: String?
// localized currency symbol. The default will be looked up in table of supported currencies in `dojo.cldr`
// A [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code will be used if not found.
// places: Number?
// fixed number of decimal places to accept. The default is determined based on which currency is used.
// fractional: Boolean?|Array?
// Whether to include the fractional portion, where the number of decimal places are implied by the currency
// or explicit 'places' parameter. The value [true,false] makes the fractional portion optional.
// By default for currencies, it the fractional portion is optional.
type: "",
currency: "",
symbol: "",
places: "",
fractional: ""
});
=====*/
dojo.currency.parse = function(/*String*/expression, /*dojo.currency.__ParseOptions?*/options){
//
// summary:
// Convert a properly formatted currency string to a primitive Number,
// using locale-specific settings.
//
// description:
// Create a Number from a string using a known, localized pattern.
// [Formatting patterns](http://www.unicode.org/reports/tr35/#Number_Format_Patterns)
// are chosen appropriate to the locale, as well as the appropriate symbols and delimiters
// and number of decimal places.
//
// expression: A string representation of a currency value
return dojo.number.parse(expression, dojo.currency._mixInDefaults(options));
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -5,22 +5,110 @@
*/
if(!dojo._hasResource["dojo.data.api.Identity"]){
dojo._hasResource["dojo.data.api.Identity"]=true;
if(!dojo._hasResource["dojo.data.api.Identity"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.data.api.Identity"] = true;
dojo.provide("dojo.data.api.Identity");
dojo.require("dojo.data.api.Read");
dojo.declare("dojo.data.api.Identity",dojo.data.api.Read,{getFeatures:function(){
return {"dojo.data.api.Read":true,"dojo.data.api.Identity":true};
},getIdentity:function(_1){
throw new Error("Unimplemented API: dojo.data.api.Identity.getIdentity");
var _2=null;
return _2;
},getIdentityAttributes:function(_3){
throw new Error("Unimplemented API: dojo.data.api.Identity.getIdentityAttributes");
return null;
},fetchItemByIdentity:function(_4){
if(!this.isItemLoaded(_4.item)){
throw new Error("Unimplemented API: dojo.data.api.Identity.fetchItemByIdentity");
}
}});
dojo.declare("dojo.data.api.Identity", dojo.data.api.Read, {
// summary:
// This is an abstract API that data provider implementations conform to.
// This file defines methods signatures and intentionally leaves all the
// methods unimplemented.
getFeatures: function(){
// summary:
// See dojo.data.api.Read.getFeatures()
return {
'dojo.data.api.Read': true,
'dojo.data.api.Identity': true
};
},
getIdentity: function(/* item */ item){
// summary:
// Returns a unique identifier for an item. The return value will be
// either a string or something that has a toString() method (such as,
// for example, a dojox.uuid.Uuid object).
// item:
// The item from the store from which to obtain its identifier.
// exceptions:
// Conforming implementations may throw an exception or return null if
// item is not an item.
// example:
// | var itemId = store.getIdentity(kermit);
// | assert(kermit === store.findByIdentity(store.getIdentity(kermit)));
throw new Error('Unimplemented API: dojo.data.api.Identity.getIdentity');
var itemIdentityString = null;
return itemIdentityString; // string
},
getIdentityAttributes: function(/* item */ item){
// summary:
// Returns an array of attribute names that are used to generate the identity.
// For most stores, this is a single attribute, but for some complex stores
// such as RDB backed stores that use compound (multi-attribute) identifiers
// it can be more than one. If the identity is not composed of attributes
// on the item, it will return null. This function is intended to identify
// the attributes that comprise the identity so that so that during a render
// of all attributes, the UI can hide the the identity information if it
// chooses.
// item:
// The item from the store from which to obtain the array of public attributes that
// compose the identifier, if any.
// example:
// | var itemId = store.getIdentity(kermit);
// | var identifiers = store.getIdentityAttributes(itemId);
// | assert(typeof identifiers === "array" || identifiers === null);
throw new Error('Unimplemented API: dojo.data.api.Identity.getIdentityAttributes');
return null; // string
},
fetchItemByIdentity: function(/* object */ keywordArgs){
// summary:
// Given the identity of an item, this method returns the item that has
// that identity through the onItem callback. Conforming implementations
// should return null if there is no item with the given identity.
// Implementations of fetchItemByIdentity() may sometimes return an item
// from a local cache and may sometimes fetch an item from a remote server,
//
// keywordArgs:
// An anonymous object that defines the item to locate and callbacks to invoke when the
// item has been located and load has completed. The format of the object is as follows:
// {
// identity: string|object,
// onItem: Function,
// onError: Function,
// scope: object
// }
// The *identity* parameter.
// The identity parameter is the identity of the item you wish to locate and load
// This attribute is required. It should be a string or an object that toString()
// can be called on.
//
// The *onItem* parameter.
// Function(item)
// The onItem parameter is the callback to invoke when the item has been loaded. It takes only one
// parameter, the item located, or null if none found.
//
// The *onError* parameter.
// Function(error)
// The onError parameter is the callback to invoke when the item load encountered an error. It takes only one
// parameter, the error object
//
// The *scope* parameter.
// If a scope object is provided, all of the callback functions (onItem,
// onError, etc) will be invoked in the context of the scope object.
// In the body of the callback function, the value of the "this"
// keyword will be the scope object. If no scope object is provided,
// the callback functions will be called in the context of dojo.global.
// For example, onItem.call(scope, item, request) vs.
// onItem.call(dojo.global, item, request)
if(!this.isItemLoaded(keywordArgs.item)){
throw new Error('Unimplemented API: dojo.data.api.Identity.fetchItemByIdentity');
}
}
});
}

@ -5,17 +5,122 @@
*/
if(!dojo._hasResource["dojo.data.api.Notification"]){
dojo._hasResource["dojo.data.api.Notification"]=true;
if(!dojo._hasResource["dojo.data.api.Notification"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.data.api.Notification"] = true;
dojo.provide("dojo.data.api.Notification");
dojo.require("dojo.data.api.Read");
dojo.declare("dojo.data.api.Notification",dojo.data.api.Read,{getFeatures:function(){
return {"dojo.data.api.Read":true,"dojo.data.api.Notification":true};
},onSet:function(_1,_2,_3,_4){
throw new Error("Unimplemented API: dojo.data.api.Notification.onSet");
},onNew:function(_5,_6){
throw new Error("Unimplemented API: dojo.data.api.Notification.onNew");
},onDelete:function(_7){
throw new Error("Unimplemented API: dojo.data.api.Notification.onDelete");
}});
dojo.declare("dojo.data.api.Notification", dojo.data.api.Read, {
// summary:
// This is an abstract API that data provider implementations conform to.
// This file defines functions signatures and intentionally leaves all the
// functions unimplemented.
//
// description:
// This API defines a set of APIs that all datastores that conform to the
// Notifications API must implement. In general, most stores will implement
// these APIs as no-op functions for users who wish to monitor them to be able
// to connect to then via dojo.connect(). For non-users of dojo.connect,
// they should be able to just replace the function on the store to obtain
// notifications. Both read-only and read-write stores may implement
// this feature. In the case of a read-only store, this feature makes sense if
// the store itself does internal polling to a back-end server and periodically updates
// its cache of items (deletes, adds, and updates).
//
// example:
//
// | function onSet(item, attribute, oldValue, newValue) {
// | //Do something with the information...
// | };
// | var store = new some.newStore();
// | dojo.connect(store, "onSet", onSet);
getFeatures: function(){
// summary:
// See dojo.data.api.Read.getFeatures()
return {
'dojo.data.api.Read': true,
'dojo.data.api.Notification': true
};
},
onSet: function(/* item */ item,
/* attribute-name-string */ attribute,
/* object | array */ oldValue,
/* object | array */ newValue){
// summary:
// This function is called any time an item is modified via setValue, setValues, unsetAttribute, etc.
// description:
// This function is called any time an item is modified via setValue, setValues, unsetAttribute, etc.
// Its purpose is to provide a hook point for those who wish to monitor actions on items in the store
// in a simple manner. The general expected usage is to dojo.connect() to the store's
// implementation and be called after the store function is called.
//
// item:
// The item being modified.
// attribute:
// The attribute being changed represented as a string name.
// oldValue:
// The old value of the attribute. In the case of single value calls, such as setValue, unsetAttribute, etc,
// this value will be generally be an atomic value of some sort (string, int, etc, object). In the case of
// multi-valued attributes, it will be an array.
// newValue:
// The new value of the attribute. In the case of single value calls, such as setValue, this value will be
// generally be an atomic value of some sort (string, int, etc, object). In the case of multi-valued attributes,
// it will be an array. In the case of unsetAttribute, the new value will be 'undefined'.
//
// returns:
// Nothing.
throw new Error('Unimplemented API: dojo.data.api.Notification.onSet');
},
onNew: function(/* item */ newItem, /*object?*/ parentInfo){
// summary:
// This function is called any time a new item is created in the store.
// It is called immediately after the store newItem processing has completed.
// description:
// This function is called any time a new item is created in the store.
// It is called immediately after the store newItem processing has completed.
//
// newItem:
// The item created.
// parentInfo:
// An optional javascript object that is passed when the item created was placed in the store
// hierarchy as a value f another item's attribute, instead of a root level item. Note that if this
// function is invoked with a value for parentInfo, then onSet is not invoked stating the attribute of
// the parent item was modified. This is to avoid getting two notification events occurring when a new item
// with a parent is created. The structure passed in is as follows:
// {
// item: someItem, //The parent item
// attribute: "attribute-name-string", //The attribute the new item was assigned to.
// oldValue: something //Whatever was the previous value for the attribute.
// //If it is a single-value attribute only, then this value will be a single value.
// //If it was a multi-valued attribute, then this will be an array of all the values minues the new one.
// newValue: something //The new value of the attribute. In the case of single value calls, such as setValue, this value will be
// //generally be an atomic value of some sort (string, int, etc, object). In the case of multi-valued attributes,
// //it will be an array.
// }
//
// returns:
// Nothing.
throw new Error('Unimplemented API: dojo.data.api.Notification.onNew');
},
onDelete: function(/* item */ deletedItem){
// summary:
// This function is called any time an item is deleted from the store.
// It is called immediately after the store deleteItem processing has completed.
// description:
// This function is called any time an item is deleted from the store.
// It is called immediately after the store deleteItem processing has completed.
//
// deletedItem:
// The item deleted.
//
// returns:
// Nothing.
throw new Error('Unimplemented API: dojo.data.api.Notification.onDelete');
}
});
}

@ -5,51 +5,509 @@
*/
if(!dojo._hasResource["dojo.data.api.Read"]){
dojo._hasResource["dojo.data.api.Read"]=true;
if(!dojo._hasResource["dojo.data.api.Read"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.data.api.Read"] = true;
dojo.provide("dojo.data.api.Read");
dojo.require("dojo.data.api.Request");
dojo.declare("dojo.data.api.Read",null,{getValue:function(_1,_2,_3){
var _4=null;
throw new Error("Unimplemented API: dojo.data.api.Read.getValue");
return _4;
},getValues:function(_5,_6){
var _7=[];
throw new Error("Unimplemented API: dojo.data.api.Read.getValues");
return _7;
},getAttributes:function(_8){
var _9=[];
throw new Error("Unimplemented API: dojo.data.api.Read.getAttributes");
return _9;
},hasAttribute:function(_a,_b){
throw new Error("Unimplemented API: dojo.data.api.Read.hasAttribute");
return false;
},containsValue:function(_c,_d,_e){
throw new Error("Unimplemented API: dojo.data.api.Read.containsValue");
return false;
},isItem:function(_f){
throw new Error("Unimplemented API: dojo.data.api.Read.isItem");
return false;
},isItemLoaded:function(_10){
throw new Error("Unimplemented API: dojo.data.api.Read.isItemLoaded");
return false;
},loadItem:function(_11){
if(!this.isItemLoaded(_11.item)){
throw new Error("Unimplemented API: dojo.data.api.Read.loadItem");
}
},fetch:function(_12){
var _13=null;
throw new Error("Unimplemented API: dojo.data.api.Read.fetch");
return _13;
},getFeatures:function(){
return {"dojo.data.api.Read":true};
},close:function(_14){
throw new Error("Unimplemented API: dojo.data.api.Read.close");
},getLabel:function(_15){
throw new Error("Unimplemented API: dojo.data.api.Read.getLabel");
return undefined;
},getLabelAttributes:function(_16){
throw new Error("Unimplemented API: dojo.data.api.Read.getLabelAttributes");
return null;
}});
dojo.declare("dojo.data.api.Read", null, {
// summary:
// This is an abstract API that data provider implementations conform to.
// This file defines methods signatures and intentionally leaves all the
// methods unimplemented. For more information on the dojo.data APIs,
// please visit: http://www.dojotoolkit.org/node/98
getValue: function( /* item */ item,
/* attribute-name-string */ attribute,
/* value? */ defaultValue){
// summary:
// Returns a single attribute value.
// Returns defaultValue if and only if *item* does not have a value for *attribute*.
// Returns null if and only if null was explicitly set as the attribute value.
// Returns undefined if and only if the item does not have a value for the
// given attribute (which is the same as saying the item does not have the attribute).
// description:
// Saying that an "item x does not have a value for an attribute y"
// is identical to saying that an "item x does not have attribute y".
// It is an oxymoron to say "that attribute is present but has no values"
// or "the item has that attribute but does not have any attribute values".
// If store.hasAttribute(item, attribute) returns false, then
// store.getValue(item, attribute) will return undefined.
//
// item:
// The item to access values on.
// attribute:
// The attribute to access represented as a string.
// defaultValue:
// Optional. A default value to use for the getValue return in the attribute does not exist or has no value.
//
// exceptions:
// Throws an exception if *item* is not an item, or *attribute* is not a string
// example:
// | var darthVader = store.getValue(lukeSkywalker, "father");
var attributeValue = null;
throw new Error('Unimplemented API: dojo.data.api.Read.getValue');
return attributeValue; // a literal, an item, null, or undefined (never an array)
},
getValues: function(/* item */ item,
/* attribute-name-string */ attribute){
// summary:
// This getValues() method works just like the getValue() method, but getValues()
// always returns an array rather than a single attribute value. The array
// may be empty, may contain a single attribute value, or may contain
// many attribute values.
// If the item does not have a value for the given attribute, then getValues()
// will return an empty array: []. (So, if store.hasAttribute(item, attribute)
// has a return of false, then store.getValues(item, attribute) will return [].)
//
// item:
// The item to access values on.
// attribute:
// The attribute to access represented as a string.
//
// exceptions:
// Throws an exception if *item* is not an item, or *attribute* is not a string
// example:
// | var friendsOfLuke = store.getValues(lukeSkywalker, "friends");
var array = [];
throw new Error('Unimplemented API: dojo.data.api.Read.getValues');
return array; // an array that may contain literals and items
},
getAttributes: function(/* item */ item){
// summary:
// Returns an array with all the attributes that this item has. This
// method will always return an array; if the item has no attributes
// at all, getAttributes() will return an empty array: [].
//
// item:
// The item to access attributes on.
//
// exceptions:
// Throws an exception if *item* is not an item, or *attribute* is not a string
// example:
// | var array = store.getAttributes(kermit);
var array = [];
throw new Error('Unimplemented API: dojo.data.api.Read.getAttributes');
return array; // array
},
hasAttribute: function( /* item */ item,
/* attribute-name-string */ attribute){
// summary:
// Returns true if the given *item* has a value for the given *attribute*.
//
// item:
// The item to access attributes on.
// attribute:
// The attribute to access represented as a string.
//
// exceptions:
// Throws an exception if *item* is not an item, or *attribute* is not a string
// example:
// | var trueOrFalse = store.hasAttribute(kermit, "color");
throw new Error('Unimplemented API: dojo.data.api.Read.hasAttribute');
return false; // boolean
},
containsValue: function(/* item */ item,
/* attribute-name-string */ attribute,
/* anything */ value){
// summary:
// Returns true if the given *value* is one of the values that getValues()
// would return.
//
// item:
// The item to access values on.
// attribute:
// The attribute to access represented as a string.
// value:
// The value to match as a value for the attribute.
//
// exceptions:
// Throws an exception if *item* is not an item, or *attribute* is not a string
// example:
// | var trueOrFalse = store.containsValue(kermit, "color", "green");
throw new Error('Unimplemented API: dojo.data.api.Read.containsValue');
return false; // boolean
},
isItem: function(/* anything */ something){
// summary:
// Returns true if *something* is an item and came from the store instance.
// Returns false if *something* is a literal, an item from another store instance,
// or is any object other than an item.
//
// something:
// Can be anything.
//
// example:
// | var yes = store.isItem(store.newItem());
// | var no = store.isItem("green");
throw new Error('Unimplemented API: dojo.data.api.Read.isItem');
return false; // boolean
},
isItemLoaded: function(/* anything */ something){
// summary:
// Returns false if isItem(something) is false. Returns false if
// if isItem(something) is true but the the item is not yet loaded
// in local memory (for example, if the item has not yet been read
// from the server).
//
// something:
// Can be anything.
//
// example:
// | var yes = store.isItemLoaded(store.newItem());
// | var no = store.isItemLoaded("green");
throw new Error('Unimplemented API: dojo.data.api.Read.isItemLoaded');
return false; // boolean
},
loadItem: function(/* object */ keywordArgs){
// summary:
// Given an item, this method loads the item so that a subsequent call
// to store.isItemLoaded(item) will return true. If a call to
// isItemLoaded() returns true before loadItem() is even called,
// then loadItem() need not do any work at all and will not even invoke
// the callback handlers. So, before invoking this method, check that
// the item has not already been loaded.
// keywordArgs:
// An anonymous object that defines the item to load and callbacks to invoke when the
// load has completed. The format of the object is as follows:
// {
// item: object,
// onItem: Function,
// onError: Function,
// scope: object
// }
// The *item* parameter.
// The item parameter is an object that represents the item in question that should be
// contained by the store. This attribute is required.
// The *onItem* parameter.
// Function(item)
// The onItem parameter is the callback to invoke when the item has been loaded. It takes only one
// parameter, the fully loaded item.
//
// The *onError* parameter.
// Function(error)
// The onError parameter is the callback to invoke when the item load encountered an error. It takes only one
// parameter, the error object
//
// The *scope* parameter.
// If a scope object is provided, all of the callback functions (onItem,
// onError, etc) will be invoked in the context of the scope object.
// In the body of the callback function, the value of the "this"
// keyword will be the scope object. If no scope object is provided,
// the callback functions will be called in the context of dojo.global().
// For example, onItem.call(scope, item, request) vs.
// onItem.call(dojo.global(), item, request)
if(!this.isItemLoaded(keywordArgs.item)){
throw new Error('Unimplemented API: dojo.data.api.Read.loadItem');
}
},
fetch: function(/* Object */ keywordArgs){
// summary:
// Given a query and set of defined options, such as a start and count of items to return,
// this method executes the query and makes the results available as data items.
// The format and expectations of stores is that they operate in a generally asynchronous
// manner, therefore callbacks are always used to return items located by the fetch parameters.
//
// description:
// A Request object will always be returned and is returned immediately.
// The basic request is nothing more than the keyword args passed to fetch and
// an additional function attached, abort(). The returned request object may then be used
// to cancel a fetch. All data items returns are passed through the callbacks defined in the
// fetch parameters and are not present on the 'request' object.
//
// This does not mean that custom stores can not add methods and properties to the request object
// returned, only that the API does not require it. For more info about the Request API,
// see dojo.data.api.Request
//
// keywordArgs:
// The keywordArgs parameter may either be an instance of
// conforming to dojo.data.api.Request or may be a simple anonymous object
// that may contain any of the following:
// {
// query: query-object or query-string,
// queryOptions: object,
// onBegin: Function,
// onItem: Function,
// onComplete: Function,
// onError: Function,
// scope: object,
// start: int
// count: int
// sort: array
// }
// All implementations should accept keywordArgs objects with any of
// the 9 standard properties: query, onBegin, onItem, onComplete, onError
// scope, sort, start, and count. Some implementations may accept additional
// properties in the keywordArgs object as valid parameters, such as
// {includeOutliers:true}.
//
// The *query* parameter.
// The query may be optional in some data store implementations.
// The dojo.data.api.Read API does not specify the syntax or semantics
// of the query itself -- each different data store implementation
// may have its own notion of what a query should look like.
// However, as of dojo 0.9, 1.0, and 1.1, all the provided datastores in dojo.data
// and dojox.data support an object structure query, where the object is a set of
// name/value parameters such as { attrFoo: valueBar, attrFoo1: valueBar1}. Most of the
// dijit widgets, such as ComboBox assume this to be the case when working with a datastore
// when they dynamically update the query. Therefore, for maximum compatibility with dijit
// widgets the recommended query parameter is a key/value object. That does not mean that the
// the datastore may not take alternative query forms, such as a simple string, a Date, a number,
// or a mix of such. Ultimately, The dojo.data.api.Read API is agnostic about what the query
// format.
// Further note: In general for query objects that accept strings as attribute
// value matches, the store should also support basic filtering capability, such as *
// (match any character) and ? (match single character). An example query that is a query object
// would be like: { attrFoo: "value*"}. Which generally means match all items where they have
// an attribute named attrFoo, with a value that starts with 'value'.
//
// The *queryOptions* parameter
// The queryOptions parameter is an optional parameter used to specify optiosn that may modify
// the query in some fashion, such as doing a case insensitive search, or doing a deep search
// where all items in a hierarchical representation of data are scanned instead of just the root
// items. It currently defines two options that all datastores should attempt to honor if possible:
// {
// ignoreCase: boolean, //Whether or not the query should match case sensitively or not. Default behaviour is false.
// deep: boolean //Whether or not a fetch should do a deep search of items and all child
// //items instead of just root-level items in a datastore. Default is false.
// }
//
// The *onBegin* parameter.
// function(size, request);
// If an onBegin callback function is provided, the callback function
// will be called just once, before the first onItem callback is called.
// The onBegin callback function will be passed two arguments, the
// the total number of items identified and the Request object. If the total number is
// unknown, then size will be -1. Note that size is not necessarily the size of the
// collection of items returned from the query, as the request may have specified to return only a
// subset of the total set of items through the use of the start and count parameters.
//
// The *onItem* parameter.
// function(item, request);
// If an onItem callback function is provided, the callback function
// will be called as each item in the result is received. The callback
// function will be passed two arguments: the item itself, and the
// Request object.
//
// The *onComplete* parameter.
// function(items, request);
//
// If an onComplete callback function is provided, the callback function
// will be called just once, after the last onItem callback is called.
// Note that if the onItem callback is not present, then onComplete will be passed
// an array containing all items which matched the query and the request object.
// If the onItem callback is present, then onComplete is called as:
// onComplete(null, request).
//
// The *onError* parameter.
// function(errorData, request);
// If an onError callback function is provided, the callback function
// will be called if there is any sort of error while attempting to
// execute the query.
// The onError callback function will be passed two arguments:
// an Error object and the Request object.
//
// The *scope* parameter.
// If a scope object is provided, all of the callback functions (onItem,
// onComplete, onError, etc) will be invoked in the context of the scope
// object. In the body of the callback function, the value of the "this"
// keyword will be the scope object. If no scope object is provided,
// the callback functions will be called in the context of dojo.global().
// For example, onItem.call(scope, item, request) vs.
// onItem.call(dojo.global(), item, request)
//
// The *start* parameter.
// If a start parameter is specified, this is a indication to the datastore to
// only start returning items once the start number of items have been located and
// skipped. When this parameter is paired withh 'count', the store should be able
// to page across queries with millions of hits by only returning subsets of the
// hits for each query
//
// The *count* parameter.
// If a count parameter is specified, this is a indication to the datastore to
// only return up to that many items. This allows a fetch call that may have
// millions of item matches to be paired down to something reasonable.
//
// The *sort* parameter.
// If a sort parameter is specified, this is a indication to the datastore to
// sort the items in some manner before returning the items. The array is an array of
// javascript objects that must conform to the following format to be applied to the
// fetching of items:
// {
// attribute: attribute || attribute-name-string,
// descending: true|false; // Optional. Default is false.
// }
// Note that when comparing attributes, if an item contains no value for the attribute
// (undefined), then it the default ascending sort logic should push it to the bottom
// of the list. In the descending order case, it such items should appear at the top of the list.
//
// returns:
// The fetch() method will return a javascript object conforming to the API
// defined in dojo.data.api.Request. In general, it will be the keywordArgs
// object returned with the required functions in Request.js attached.
// Its general purpose is to provide a convenient way for a caller to abort an
// ongoing fetch.
//
// The Request object may also have additional properties when it is returned
// such as request.store property, which is a pointer to the datastore object that
// fetch() is a method of.
//
// exceptions:
// Throws an exception if the query is not valid, or if the query
// is required but was not supplied.
//
// example:
// Fetch all books identified by the query and call 'showBooks' when complete
// | var request = store.fetch({query:"all books", onComplete: showBooks});
// example:
// Fetch all items in the story and call 'showEverything' when complete.
// | var request = store.fetch(onComplete: showEverything);
// example:
// Fetch only 10 books that match the query 'all books', starting at the fifth book found during the search.
// This demonstrates how paging can be done for specific queries.
// | var request = store.fetch({query:"all books", start: 4, count: 10, onComplete: showBooks});
// example:
// Fetch all items that match the query, calling 'callback' each time an item is located.
// | var request = store.fetch({query:"foo/bar", onItem:callback});
// example:
// Fetch the first 100 books by author King, call showKing when up to 100 items have been located.
// | var request = store.fetch({query:{author:"King"}, start: 0, count:100, onComplete: showKing});
// example:
// Locate the books written by Author King, sort it on title and publisher, then return the first 100 items from the sorted items.
// | var request = store.fetch({query:{author:"King"}, sort: [{ attribute: "title", descending: true}, {attribute: "publisher"}], ,start: 0, count:100, onComplete: 'showKing'});
// example:
// Fetch the first 100 books by authors starting with the name King, then call showKing when up to 100 items have been located.
// | var request = store.fetch({query:{author:"King*"}, start: 0, count:100, onComplete: showKing});
// example:
// Fetch the first 100 books by authors ending with 'ing', but only have one character before it (King, Bing, Ling, Sing, etc.), then call showBooks when up to 100 items have been located.
// | var request = store.fetch({query:{author:"?ing"}, start: 0, count:100, onComplete: showBooks});
// example:
// Fetch the first 100 books by author King, where the name may appear as King, king, KING, kInG, and so on, then call showKing when up to 100 items have been located.
// | var request = store.fetch({query:{author:"King"}, queryOptions:(ignoreCase: true}, start: 0, count:100, onComplete: showKing});
// example:
// Paging
// | var store = new dojo.data.LargeRdbmsStore({url:"jdbc:odbc:foobar"});
// | var fetchArgs = {
// | query: {type:"employees", name:"Hillary *"}, // string matching
// | sort: [{attribute:"department", descending:true}],
// | start: 0,
// | count: 20,
// | scope: displayer,
// | onBegin: showThrobber,
// | onItem: displayItem,
// | onComplete: stopThrobber,
// | onError: handleFetchError,
// | };
// | store.fetch(fetchArgs);
// | ...
// and then when the user presses the "Next Page" button...
// | fetchArgs.start += 20;
// | store.fetch(fetchArgs); // get the next 20 items
var request = null;
throw new Error('Unimplemented API: dojo.data.api.Read.fetch');
return request; // an object conforming to the dojo.data.api.Request API
},
getFeatures: function(){
// summary:
// The getFeatures() method returns an simple keyword values object
// that specifies what interface features the datastore implements.
// A simple CsvStore may be read-only, and the only feature it
// implements will be the 'dojo.data.api.Read' interface, so the
// getFeatures() method will return an object like this one:
// {'dojo.data.api.Read': true}.
// A more sophisticated datastore might implement a variety of
// interface features, like 'dojo.data.api.Read', 'dojo.data.api.Write',
// 'dojo.data.api.Identity', and 'dojo.data.api.Attribution'.
return {
'dojo.data.api.Read': true
};
},
close: function(/*dojo.data.api.Request || keywordArgs || null */ request){
// summary:
// The close() method is intended for instructing the store to 'close' out
// any information associated with a particular request.
//
// description:
// The close() method is intended for instructing the store to 'close' out
// any information associated with a particular request. In general, this API
// expects to recieve as a parameter a request object returned from a fetch.
// It will then close out anything associated with that request, such as
// clearing any internal datastore caches and closing any 'open' connections.
// For some store implementations, this call may be a no-op.
//
// request:
// An instance of a request for the store to use to identify what to close out.
// If no request is passed, then the store should clear all internal caches (if any)
// and close out all 'open' connections. It does not render the store unusable from
// there on, it merely cleans out any current data and resets the store to initial
// state.
//
// example:
// | var request = store.fetch({onComplete: doSomething});
// | ...
// | store.close(request);
throw new Error('Unimplemented API: dojo.data.api.Read.close');
},
getLabel: function(/* item */ item){
// summary:
// Method to inspect the item and return a user-readable 'label' for the item
// that provides a general/adequate description of what the item is.
//
// description:
// Method to inspect the item and return a user-readable 'label' for the item
// that provides a general/adequate description of what the item is. In general
// most labels will be a specific attribute value or collection of the attribute
// values that combine to label the item in some manner. For example for an item
// that represents a person it may return the label as: "firstname lastlame" where
// the firstname and lastname are attributes on the item. If the store is unable
// to determine an adequate human readable label, it should return undefined. Users that wish
// to customize how a store instance labels items should replace the getLabel() function on
// their instance of the store, or extend the store and replace the function in
// the extension class.
//
// item:
// The item to return the label for.
//
// returns:
// A user-readable string representing the item or undefined if no user-readable label can
// be generated.
throw new Error('Unimplemented API: dojo.data.api.Read.getLabel');
return undefined;
},
getLabelAttributes: function(/* item */ item){
// summary:
// Method to inspect the item and return an array of what attributes of the item were used
// to generate its label, if any.
//
// description:
// Method to inspect the item and return an array of what attributes of the item were used
// to generate its label, if any. This function is to assist UI developers in knowing what
// attributes can be ignored out of the attributes an item has when displaying it, in cases
// where the UI is using the label as an overall identifer should they wish to hide
// redundant information.
//
// item:
// The item to return the list of label attributes for.
//
// returns:
// An array of attribute names that were used to generate the label, or null if public attributes
// were not used to generate the label.
throw new Error('Unimplemented API: dojo.data.api.Read.getLabelAttributes');
return null;
}
});
}

@ -5,10 +5,35 @@
*/
if(!dojo._hasResource["dojo.data.api.Request"]){
dojo._hasResource["dojo.data.api.Request"]=true;
if(!dojo._hasResource["dojo.data.api.Request"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.data.api.Request"] = true;
dojo.provide("dojo.data.api.Request");
dojo.declare("dojo.data.api.Request",null,{abort:function(){
throw new Error("Unimplemented API: dojo.data.api.Request.abort");
}});
dojo.declare("dojo.data.api.Request", null, {
// summary:
// This class defines out the semantics of what a 'Request' object looks like
// when returned from a fetch() method. In general, a request object is
// nothing more than the original keywordArgs from fetch with an abort function
// attached to it to allow users to abort a particular request if they so choose.
// No other functions are required on a general Request object return. That does not
// inhibit other store implementations from adding extentions to it, of course.
//
// This is an abstract API that data provider implementations conform to.
// This file defines methods signatures and intentionally leaves all the
// methods unimplemented.
//
// For more details on fetch, see dojo.data.api.Read.fetch().
abort: function(){
// summary:
// This function is a hook point for stores to provide as a way for
// a fetch to be halted mid-processing.
// description:
// This function is a hook point for stores to provide as a way for
// a fetch to be halted mid-processing. For more details on the fetch() api,
// please see dojo.data.api.Read.fetch().
throw new Error('Unimplemented API: dojo.data.api.Request.abort');
}
});
}

@ -5,35 +5,229 @@
*/
if(!dojo._hasResource["dojo.data.api.Write"]){
dojo._hasResource["dojo.data.api.Write"]=true;
if(!dojo._hasResource["dojo.data.api.Write"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.data.api.Write"] = true;
dojo.provide("dojo.data.api.Write");
dojo.require("dojo.data.api.Read");
dojo.declare("dojo.data.api.Write",dojo.data.api.Read,{getFeatures:function(){
return {"dojo.data.api.Read":true,"dojo.data.api.Write":true};
},newItem:function(_1,_2){
var _3;
throw new Error("Unimplemented API: dojo.data.api.Write.newItem");
return _3;
},deleteItem:function(_4){
throw new Error("Unimplemented API: dojo.data.api.Write.deleteItem");
return false;
},setValue:function(_5,_6,_7){
throw new Error("Unimplemented API: dojo.data.api.Write.setValue");
return false;
},setValues:function(_8,_9,_a){
throw new Error("Unimplemented API: dojo.data.api.Write.setValues");
return false;
},unsetAttribute:function(_b,_c){
throw new Error("Unimplemented API: dojo.data.api.Write.clear");
return false;
},save:function(_d){
throw new Error("Unimplemented API: dojo.data.api.Write.save");
},revert:function(){
throw new Error("Unimplemented API: dojo.data.api.Write.revert");
return false;
},isDirty:function(_e){
throw new Error("Unimplemented API: dojo.data.api.Write.isDirty");
return false;
}});
dojo.declare("dojo.data.api.Write", dojo.data.api.Read, {
// summary:
// This is an abstract API that data provider implementations conform to.
// This file defines function signatures and intentionally leaves all the
// functionss unimplemented.
getFeatures: function(){
// summary:
// See dojo.data.api.Read.getFeatures()
return {
'dojo.data.api.Read': true,
'dojo.data.api.Write': true
};
},
newItem: function(/* Object? */ keywordArgs, /*Object?*/ parentInfo){
// summary:
// Returns a newly created item. Sets the attributes of the new
// item based on the *keywordArgs* provided. In general, the attribute
// names in the keywords become the attributes in the new item and as for
// the attribute values in keywordArgs, they become the values of the attributes
// in the new item. In addition, for stores that support hierarchical item
// creation, an optional second parameter is accepted that defines what item is the parent
// of the new item and what attribute of that item should the new item be assigned to.
// In general, this will assume that the attribute targetted is multi-valued and a new item
// is appended onto the list of values for that attribute.
//
// keywordArgs:
// A javascript object defining the initial content of the item as a set of JavaScript 'property name: value' pairs.
// parentInfo:
// An optional javascript object defining what item is the parent of this item (in a hierarchical store. Not all stores do hierarchical items),
// and what attribute of that parent to assign the new item to. If this is present, and the attribute specified
// is a multi-valued attribute, it will append this item into the array of values for that attribute. The structure
// of the object is as follows:
// {
// parent: someItem,
// attribute: "attribute-name-string"
// }
//
// exceptions:
// Throws an exception if *keywordArgs* is a string or a number or
// anything other than a simple anonymous object.
// Throws an exception if the item in parentInfo is not an item from the store
// or if the attribute isn't an attribute name string.
// example:
// | var kermit = store.newItem({name: "Kermit", color:[blue, green]});
var newItem;
throw new Error('Unimplemented API: dojo.data.api.Write.newItem');
return newItem; // item
},
deleteItem: function(/* item */ item){
// summary:
// Deletes an item from the store.
//
// item:
// The item to delete.
//
// exceptions:
// Throws an exception if the argument *item* is not an item
// (if store.isItem(item) returns false).
// example:
// | var success = store.deleteItem(kermit);
throw new Error('Unimplemented API: dojo.data.api.Write.deleteItem');
return false; // boolean
},
setValue: function( /* item */ item,
/* string */ attribute,
/* almost anything */ value){
// summary:
// Sets the value of an attribute on an item.
// Replaces any previous value or values.
//
// item:
// The item to modify.
// attribute:
// The attribute of the item to change represented as a string name.
// value:
// The value to assign to the item.
//
// exceptions:
// Throws an exception if *item* is not an item, or if *attribute*
// is neither an attribute object or a string.
// Throws an exception if *value* is undefined.
// example:
// | var success = store.set(kermit, "color", "green");
throw new Error('Unimplemented API: dojo.data.api.Write.setValue');
return false; // boolean
},
setValues: function(/* item */ item,
/* string */ attribute,
/* array */ values){
// summary:
// Adds each value in the *values* array as a value of the given
// attribute on the given item.
// Replaces any previous value or values.
// Calling store.setValues(x, y, []) (with *values* as an empty array) has
// the same effect as calling store.unsetAttribute(x, y).
//
// item:
// The item to modify.
// attribute:
// The attribute of the item to change represented as a string name.
// values:
// An array of values to assign to the attribute..
//
// exceptions:
// Throws an exception if *values* is not an array, if *item* is not an
// item, or if *attribute* is neither an attribute object or a string.
// example:
// | var success = store.setValues(kermit, "color", ["green", "aqua"]);
// | success = store.setValues(kermit, "color", []);
// | if (success) {assert(!store.hasAttribute(kermit, "color"));}
throw new Error('Unimplemented API: dojo.data.api.Write.setValues');
return false; // boolean
},
unsetAttribute: function( /* item */ item,
/* string */ attribute){
// summary:
// Deletes all the values of an attribute on an item.
//
// item:
// The item to modify.
// attribute:
// The attribute of the item to unset represented as a string.
//
// exceptions:
// Throws an exception if *item* is not an item, or if *attribute*
// is neither an attribute object or a string.
// example:
// | var success = store.unsetAttribute(kermit, "color");
// | if (success) {assert(!store.hasAttribute(kermit, "color"));}
throw new Error('Unimplemented API: dojo.data.api.Write.clear');
return false; // boolean
},
save: function(/* object */ keywordArgs){
// summary:
// Saves to the server all the changes that have been made locally.
// The save operation may take some time and is generally performed
// in an asynchronous fashion. The outcome of the save action is
// is passed into the set of supported callbacks for the save.
//
// keywordArgs:
// {
// onComplete: function
// onError: function
// scope: object
// }
//
// The *onComplete* parameter.
// function();
//
// If an onComplete callback function is provided, the callback function
// will be called just once, after the save has completed. No parameters
// are generally passed to the onComplete.
//
// The *onError* parameter.
// function(errorData);
//
// If an onError callback function is provided, the callback function
// will be called if there is any sort of error while attempting to
// execute the save. The onError function will be based one parameter, the
// error.
//
// The *scope* parameter.
// If a scope object is provided, all of the callback function (
// onComplete, onError, etc) will be invoked in the context of the scope
// object. In the body of the callback function, the value of the "this"
// keyword will be the scope object. If no scope object is provided,
// the callback functions will be called in the context of dojo.global.
// For example, onComplete.call(scope) vs.
// onComplete.call(dojo.global)
//
// returns:
// Nothing. Since the saves are generally asynchronous, there is
// no need to return anything. All results are passed via callbacks.
// example:
// | store.save({onComplete: onSave});
// | store.save({scope: fooObj, onComplete: onSave, onError: saveFailed});
throw new Error('Unimplemented API: dojo.data.api.Write.save');
},
revert: function(){
// summary:
// Discards any unsaved changes.
// description:
// Discards any unsaved changes.
//
// example:
// | var success = store.revert();
throw new Error('Unimplemented API: dojo.data.api.Write.revert');
return false; // boolean
},
isDirty: function(/* item? */ item){
// summary:
// Given an item, isDirty() returns true if the item has been modified
// since the last save(). If isDirty() is called with no *item* argument,
// then this function returns true if any item has been modified since
// the last save().
//
// item:
// The item to check.
//
// exceptions:
// Throws an exception if isDirty() is passed an argument and the
// argument is not an item.
// example:
// | var trueOrFalse = store.isDirty(kermit); // true if kermit is dirty
// | var trueOrFalse = store.isDirty(); // true if any item is dirty
throw new Error('Unimplemented API: dojo.data.api.Write.isDirty');
return false; // boolean
}
});
}

@ -5,48 +5,72 @@
*/
if(!dojo._hasResource["dojo.data.util.filter"]){
dojo._hasResource["dojo.data.util.filter"]=true;
if(!dojo._hasResource["dojo.data.util.filter"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.data.util.filter"] = true;
dojo.provide("dojo.data.util.filter");
dojo.data.util.filter.patternToRegExp=function(_1,_2){
var _3="^";
var c=null;
for(var i=0;i<_1.length;i++){
c=_1.charAt(i);
switch(c){
case "\\":
_3+=c;
i++;
_3+=_1.charAt(i);
break;
case "*":
_3+=".*";
break;
case "?":
_3+=".";
break;
case "$":
case "^":
case "/":
case "+":
case ".":
case "|":
case "(":
case ")":
case "{":
case "}":
case "[":
case "]":
_3+="\\";
default:
_3+=c;
}
}
_3+="$";
if(_2){
return new RegExp(_3,"mi");
}else{
return new RegExp(_3,"m");
}
dojo.data.util.filter.patternToRegExp = function(/*String*/pattern, /*boolean?*/ ignoreCase){
// summary:
// Helper function to convert a simple pattern to a regular expression for matching.
// description:
// Returns a regular expression object that conforms to the defined conversion rules.
// For example:
// ca* -> /^ca.*$/
// *ca* -> /^.*ca.*$/
// *c\*a* -> /^.*c\*a.*$/
// *c\*a?* -> /^.*c\*a..*$/
// and so on.
//
// pattern: string
// A simple matching pattern to convert that follows basic rules:
// * Means match anything, so ca* means match anything starting with ca
// ? Means match single character. So, b?b will match to bob and bab, and so on.
// \ is an escape character. So for example, \* means do not treat * as a match, but literal character *.
// To use a \ as a character in the string, it must be escaped. So in the pattern it should be
// represented by \\ to be treated as an ordinary \ character instead of an escape.
//
// ignoreCase:
// An optional flag to indicate if the pattern matching should be treated as case-sensitive or not when comparing
// By default, it is assumed case sensitive.
var rxp = "^";
var c = null;
for(var i = 0; i < pattern.length; i++){
c = pattern.charAt(i);
switch(c){
case '\\':
rxp += c;
i++;
rxp += pattern.charAt(i);
break;
case '*':
rxp += ".*"; break;
case '?':
rxp += "."; break;
case '$':
case '^':
case '/':
case '+':
case '.':
case '|':
case '(':
case ')':
case '{':
case '}':
case '[':
case ']':
rxp += "\\"; //fallthrough
default:
rxp += c;
}
}
rxp += "$";
if(ignoreCase){
return new RegExp(rxp,"mi"); //RegExp
}else{
return new RegExp(rxp,"m"); //RegExp
}
};
}

@ -5,60 +5,93 @@
*/
if(!dojo._hasResource["dojo.data.util.simpleFetch"]){
dojo._hasResource["dojo.data.util.simpleFetch"]=true;
if(!dojo._hasResource["dojo.data.util.simpleFetch"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.data.util.simpleFetch"] = true;
dojo.provide("dojo.data.util.simpleFetch");
dojo.require("dojo.data.util.sorter");
dojo.data.util.simpleFetch.fetch=function(_1){
_1=_1||{};
if(!_1.store){
_1.store=this;
}
var _2=this;
var _3=function(_4,_5){
if(_5.onError){
var _6=_5.scope||dojo.global;
_5.onError.call(_6,_4,_5);
}
};
var _7=function(_8,_9){
var _a=_9.abort||null;
var _b=false;
var _c=_9.start?_9.start:0;
var _d=(_9.count&&(_9.count!==Infinity))?(_c+_9.count):_8.length;
_9.abort=function(){
_b=true;
if(_a){
_a.call(_9);
}
};
var _e=_9.scope||dojo.global;
if(!_9.store){
_9.store=_2;
}
if(_9.onBegin){
_9.onBegin.call(_e,_8.length,_9);
}
if(_9.sort){
_8.sort(dojo.data.util.sorter.createSortFunction(_9.sort,_2));
}
if(_9.onItem){
for(var i=_c;(i<_8.length)&&(i<_d);++i){
var _f=_8[i];
if(!_b){
_9.onItem.call(_e,_f,_9);
}
}
}
if(_9.onComplete&&!_b){
var _10=null;
if(!_9.onItem){
_10=_8.slice(_c,_d);
}
_9.onComplete.call(_e,_10,_9);
}
};
this._fetchItems(_1,_7,_3);
return _1;
dojo.data.util.simpleFetch.fetch = function(/* Object? */ request){
// summary:
// The simpleFetch mixin is designed to serve as a set of function(s) that can
// be mixed into other datastore implementations to accelerate their development.
// The simpleFetch mixin should work well for any datastore that can respond to a _fetchItems()
// call by returning an array of all the found items that matched the query. The simpleFetch mixin
// is not designed to work for datastores that respond to a fetch() call by incrementally
// loading items, or sequentially loading partial batches of the result
// set. For datastores that mixin simpleFetch, simpleFetch
// implements a fetch method that automatically handles eight of the fetch()
// arguments -- onBegin, onItem, onComplete, onError, start, count, sort and scope
// The class mixing in simpleFetch should not implement fetch(),
// but should instead implement a _fetchItems() method. The _fetchItems()
// method takes three arguments, the keywordArgs object that was passed
// to fetch(), a callback function to be called when the result array is
// available, and an error callback to be called if something goes wrong.
// The _fetchItems() method should ignore any keywordArgs parameters for
// start, count, onBegin, onItem, onComplete, onError, sort, and scope.
// The _fetchItems() method needs to correctly handle any other keywordArgs
// parameters, including the query parameter and any optional parameters
// (such as includeChildren). The _fetchItems() method should create an array of
// result items and pass it to the fetchHandler along with the original request object
// -- or, the _fetchItems() method may, if it wants to, create an new request object
// with other specifics about the request that are specific to the datastore and pass
// that as the request object to the handler.
//
// For more information on this specific function, see dojo.data.api.Read.fetch()
request = request || {};
if(!request.store){
request.store = this;
}
var self = this;
var _errorHandler = function(errorData, requestObject){
if(requestObject.onError){
var scope = requestObject.scope || dojo.global;
requestObject.onError.call(scope, errorData, requestObject);
}
};
var _fetchHandler = function(items, requestObject){
var oldAbortFunction = requestObject.abort || null;
var aborted = false;
var startIndex = requestObject.start?requestObject.start:0;
var endIndex = (requestObject.count && (requestObject.count !== Infinity))?(startIndex + requestObject.count):items.length;
requestObject.abort = function(){
aborted = true;
if(oldAbortFunction){
oldAbortFunction.call(requestObject);
}
};
var scope = requestObject.scope || dojo.global;
if(!requestObject.store){
requestObject.store = self;
}
if(requestObject.onBegin){
requestObject.onBegin.call(scope, items.length, requestObject);
}
if(requestObject.sort){
items.sort(dojo.data.util.sorter.createSortFunction(requestObject.sort, self));
}
if(requestObject.onItem){
for(var i = startIndex; (i < items.length) && (i < endIndex); ++i){
var item = items[i];
if(!aborted){
requestObject.onItem.call(scope, item, requestObject);
}
}
}
if(requestObject.onComplete && !aborted){
var subset = null;
if(!requestObject.onItem){
subset = items.slice(startIndex, endIndex);
}
requestObject.onComplete.call(scope, subset, requestObject);
}
};
this._fetchItems(request, _fetchHandler, _errorHandler);
return request; // Object
};
}

@ -5,62 +5,98 @@
*/
if(!dojo._hasResource["dojo.data.util.sorter"]){
dojo._hasResource["dojo.data.util.sorter"]=true;
if(!dojo._hasResource["dojo.data.util.sorter"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.data.util.sorter"] = true;
dojo.provide("dojo.data.util.sorter");
dojo.data.util.sorter.basicComparator=function(a,b){
var r=-1;
if(a===null){
a=undefined;
}
if(b===null){
b=undefined;
}
if(a==b){
r=0;
}else{
if(a>b||a==null){
r=1;
}
}
return r;
};
dojo.data.util.sorter.createSortFunction=function(_1,_2){
var _3=[];
function _4(_5,_6,_7,s){
return function(_8,_9){
var a=s.getValue(_8,_5);
var b=s.getValue(_9,_5);
return _6*_7(a,b);
};
};
var _a;
var _b=_2.comparatorMap;
var bc=dojo.data.util.sorter.basicComparator;
for(var i=0;i<_1.length;i++){
_a=_1[i];
var _c=_a.attribute;
if(_c){
var _d=(_a.descending)?-1:1;
var _e=bc;
if(_b){
if(typeof _c!=="string"&&("toString" in _c)){
_c=_c.toString();
}
_e=_b[_c]||bc;
}
_3.push(_4(_c,_d,_e,_2));
}
}
return function(_f,_10){
var i=0;
while(i<_3.length){
var ret=_3[i++](_f,_10);
if(ret!==0){
return ret;
}
}
return 0;
dojo.data.util.sorter.basicComparator = function( /*anything*/ a,
/*anything*/ b){
// summary:
// Basic comparision function that compares if an item is greater or less than another item
// description:
// returns 1 if a > b, -1 if a < b, 0 if equal.
// 'null' values (null, undefined) are treated as larger values so that they're pushed to the end of the list.
// And compared to each other, null is equivalent to undefined.
//null is a problematic compare, so if null, we set to undefined.
//Makes the check logic simple, compact, and consistent
//And (null == undefined) === true, so the check later against null
//works for undefined and is less bytes.
var r = -1;
if(a === null){
a = undefined;
}
if(b === null){
b = undefined;
}
if(a == b){
r = 0;
}else if(a > b || a == null){
r = 1;
}
return r; //int {-1,0,1}
};
dojo.data.util.sorter.createSortFunction = function( /* attributes array */sortSpec,
/*dojo.data.core.Read*/ store){
// summary:
// Helper function to generate the sorting function based off the list of sort attributes.
// description:
// The sort function creation will look for a property on the store called 'comparatorMap'. If it exists
// it will look in the mapping for comparisons function for the attributes. If one is found, it will
// use it instead of the basic comparator, which is typically used for strings, ints, booleans, and dates.
// Returns the sorting function for this particular list of attributes and sorting directions.
//
// sortSpec: array
// A JS object that array that defines out what attribute names to sort on and whether it should be descenting or asending.
// The objects should be formatted as follows:
// {
// attribute: "attributeName-string" || attribute,
// descending: true|false; // Default is false.
// }
// store: object
// The datastore object to look up item values from.
//
var sortFunctions=[];
function createSortFunction(attr, dir, comp, s){
//Passing in comp and s (comparator and store), makes this
//function much faster.
return function(itemA, itemB){
var a = s.getValue(itemA, attr);
var b = s.getValue(itemB, attr);
return dir * comp(a,b); //int
};
}
var sortAttribute;
var map = store.comparatorMap;
var bc = dojo.data.util.sorter.basicComparator;
for(var i = 0; i < sortSpec.length; i++){
sortAttribute = sortSpec[i];
var attr = sortAttribute.attribute;
if(attr){
var dir = (sortAttribute.descending) ? -1 : 1;
var comp = bc;
if(map){
if(typeof attr !== "string" && ("toString" in attr)){
attr = attr.toString();
}
comp = map[attr] || bc;
}
sortFunctions.push(createSortFunction(attr,
dir, comp, store));
}
}
return function(rowA, rowB){
var i=0;
while(i < sortFunctions.length){
var ret = sortFunctions[i++](rowA, rowB);
if(ret !== 0){
return ret;//int
}
}
return 0; //int
}; // Function
};
}

@ -5,209 +5,345 @@
*/
if(!dojo._hasResource["dojo.date"]){
dojo._hasResource["dojo.date"]=true;
if(!dojo._hasResource["dojo.date"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.date"] = true;
dojo.provide("dojo.date");
dojo.date.getDaysInMonth=function(_1){
var _2=_1.getMonth();
var _3=[31,28,31,30,31,30,31,31,30,31,30,31];
if(_2==1&&dojo.date.isLeapYear(_1)){
return 29;
}
return _3[_2];
};
dojo.date.isLeapYear=function(_4){
var _5=_4.getFullYear();
return !(_5%400)||(!(_5%4)&&!!(_5%100));
};
dojo.date.getTimezoneName=function(_6){
var _7=_6.toString();
var tz="";
var _8;
var _9=_7.indexOf("(");
if(_9>-1){
tz=_7.substring(++_9,_7.indexOf(")"));
}else{
var _a=/([A-Z\/]+) \d{4}$/;
if((_8=_7.match(_a))){
tz=_8[1];
}else{
_7=_6.toLocaleString();
_a=/ ([A-Z\/]+)$/;
if((_8=_7.match(_a))){
tz=_8[1];
}
}
}
return (tz=="AM"||tz=="PM")?"":tz;
};
dojo.date.compare=function(_b,_c,_d){
_b=new Date(+_b);
_c=new Date(+(_c||new Date()));
if(_d=="date"){
_b.setHours(0,0,0,0);
_c.setHours(0,0,0,0);
}else{
if(_d=="time"){
_b.setFullYear(0,0,0);
_c.setFullYear(0,0,0);
/*=====
dojo.date = {
// summary: Date manipulation utilities
}
=====*/
dojo.date.getDaysInMonth = function(/*Date*/dateObject){
// summary:
// Returns the number of days in the month used by dateObject
var month = dateObject.getMonth();
var days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
if(month == 1 && dojo.date.isLeapYear(dateObject)){ return 29; } // Number
return days[month]; // Number
}
if(_b>_c){
return 1;
dojo.date.isLeapYear = function(/*Date*/dateObject){
// summary:
// Determines if the year of the dateObject is a leap year
// description:
// Leap years are years with an additional day YYYY-02-29, where the
// year number is a multiple of four with the following exception: If
// a year is a multiple of 100, then it is only a leap year if it is
// also a multiple of 400. For example, 1900 was not a leap year, but
// 2000 is one.
var year = dateObject.getFullYear();
return !(year%400) || (!(year%4) && !!(year%100)); // Boolean
}
if(_b<_c){
return -1;
// FIXME: This is not localized
dojo.date.getTimezoneName = function(/*Date*/dateObject){
// summary:
// Get the user's time zone as provided by the browser
// dateObject:
// Needed because the timezone may vary with time (daylight savings)
// description:
// Try to get time zone info from toString or toLocaleString method of
// the Date object -- UTC offset is not a time zone. See
// http://www.twinsun.com/tz/tz-link.htm Note: results may be
// inconsistent across browsers.
var str = dateObject.toString(); // Start looking in toString
var tz = ''; // The result -- return empty string if nothing found
var match;
// First look for something in parentheses -- fast lookup, no regex
var pos = str.indexOf('(');
if(pos > -1){
tz = str.substring(++pos, str.indexOf(')'));
}else{
// If at first you don't succeed ...
// If IE knows about the TZ, it appears before the year
// Capital letters or slash before a 4-digit year
// at the end of string
var pat = /([A-Z\/]+) \d{4}$/;
if((match = str.match(pat))){
tz = match[1];
}else{
// Some browsers (e.g. Safari) glue the TZ on the end
// of toLocaleString instead of putting it in toString
str = dateObject.toLocaleString();
// Capital letters or slash -- end of string,
// after space
pat = / ([A-Z\/]+)$/;
if((match = str.match(pat))){
tz = match[1];
}
}
}
// Make sure it doesn't somehow end up return AM or PM
return (tz == 'AM' || tz == 'PM') ? '' : tz; // String
}
return 0;
// Utility methods to do arithmetic calculations with Dates
dojo.date.compare = function(/*Date*/date1, /*Date?*/date2, /*String?*/portion){
// summary:
// Compare two date objects by date, time, or both.
// description:
// Returns 0 if equal, positive if a > b, else negative.
// date1:
// Date object
// date2:
// Date object. If not specified, the current Date is used.
// portion:
// A string indicating the "date" or "time" portion of a Date object.
// Compares both "date" and "time" by default. One of the following:
// "date", "time", "datetime"
// Extra step required in copy for IE - see #3112
date1 = new Date(+date1);
date2 = new Date(+(date2 || new Date()));
if(portion == "date"){
// Ignore times and compare dates.
date1.setHours(0, 0, 0, 0);
date2.setHours(0, 0, 0, 0);
}else if(portion == "time"){
// Ignore dates and compare times.
date1.setFullYear(0, 0, 0);
date2.setFullYear(0, 0, 0);
}
if(date1 > date2){ return 1; } // int
if(date1 < date2){ return -1; } // int
return 0; // int
};
dojo.date.add=function(_e,_f,_10){
var sum=new Date(+_e);
var _11=false;
var _12="Date";
switch(_f){
case "day":
break;
case "weekday":
var _13,_14;
var mod=_10%5;
if(!mod){
_13=(_10>0)?5:-5;
_14=(_10>0)?((_10-5)/5):((_10+5)/5);
}else{
_13=mod;
_14=parseInt(_10/5);
}
var _15=_e.getDay();
var adj=0;
if(_15==6&&_10>0){
adj=1;
}else{
if(_15==0&&_10<0){
adj=-1;
}
}
var _16=_15+_13;
if(_16==0||_16==6){
adj=(_10>0)?2:-2;
}
_10=(7*_14)+_13+adj;
break;
case "year":
_12="FullYear";
_11=true;
break;
case "week":
_10*=7;
break;
case "quarter":
_10*=3;
case "month":
_11=true;
_12="Month";
break;
default:
_12="UTC"+_f.charAt(0).toUpperCase()+_f.substring(1)+"s";
}
if(_12){
sum["set"+_12](sum["get"+_12]()+_10);
}
if(_11&&(sum.getDate()<_e.getDate())){
sum.setDate(0);
}
return sum;
dojo.date.add = function(/*Date*/date, /*String*/interval, /*int*/amount){
// summary:
// Add to a Date in intervals of different size, from milliseconds to years
// date: Date
// Date object to start with
// interval:
// A string representing the interval. One of the following:
// "year", "month", "day", "hour", "minute", "second",
// "millisecond", "quarter", "week", "weekday"
// amount:
// How much to add to the date.
var sum = new Date(+date); // convert to Number before copying to accomodate IE (#3112)
var fixOvershoot = false;
var property = "Date";
switch(interval){
case "day":
break;
case "weekday":
//i18n FIXME: assumes Saturday/Sunday weekend, but this is not always true. see dojo.cldr.supplemental
// Divide the increment time span into weekspans plus leftover days
// e.g., 8 days is one 5-day weekspan / and two leftover days
// Can't have zero leftover days, so numbers divisible by 5 get
// a days value of 5, and the remaining days make up the number of weeks
var days, weeks;
var mod = amount % 5;
if(!mod){
days = (amount > 0) ? 5 : -5;
weeks = (amount > 0) ? ((amount-5)/5) : ((amount+5)/5);
}else{
days = mod;
weeks = parseInt(amount/5);
}
// Get weekday value for orig date param
var strt = date.getDay();
// Orig date is Sat / positive incrementer
// Jump over Sun
var adj = 0;
if(strt == 6 && amount > 0){
adj = 1;
}else if(strt == 0 && amount < 0){
// Orig date is Sun / negative incrementer
// Jump back over Sat
adj = -1;
}
// Get weekday val for the new date
var trgt = strt + days;
// New date is on Sat or Sun
if(trgt == 0 || trgt == 6){
adj = (amount > 0) ? 2 : -2;
}
// Increment by number of weeks plus leftover days plus
// weekend adjustments
amount = (7 * weeks) + days + adj;
break;
case "year":
property = "FullYear";
// Keep increment/decrement from 2/29 out of March
fixOvershoot = true;
break;
case "week":
amount *= 7;
break;
case "quarter":
// Naive quarter is just three months
amount *= 3;
// fallthrough...
case "month":
// Reset to last day of month if you overshoot
fixOvershoot = true;
property = "Month";
break;
// case "hour":
// case "minute":
// case "second":
// case "millisecond":
default:
property = "UTC"+interval.charAt(0).toUpperCase() + interval.substring(1) + "s";
}
if(property){
sum["set"+property](sum["get"+property]()+amount);
}
if(fixOvershoot && (sum.getDate() < date.getDate())){
sum.setDate(0);
}
return sum; // Date
};
dojo.date.difference=function(_17,_18,_19){
_18=_18||new Date();
_19=_19||"day";
var _1a=_18.getFullYear()-_17.getFullYear();
var _1b=1;
switch(_19){
case "quarter":
var m1=_17.getMonth();
var m2=_18.getMonth();
var q1=Math.floor(m1/3)+1;
var q2=Math.floor(m2/3)+1;
q2+=(_1a*4);
_1b=q2-q1;
break;
case "weekday":
var _1c=Math.round(dojo.date.difference(_17,_18,"day"));
var _1d=parseInt(dojo.date.difference(_17,_18,"week"));
var mod=_1c%7;
if(mod==0){
_1c=_1d*5;
}else{
var adj=0;
var _1e=_17.getDay();
var _1f=_18.getDay();
_1d=parseInt(_1c/7);
mod=_1c%7;
var _20=new Date(_17);
_20.setDate(_20.getDate()+(_1d*7));
var _21=_20.getDay();
if(_1c>0){
switch(true){
case _1e==6:
adj=-1;
break;
case _1e==0:
adj=0;
break;
case _1f==6:
adj=-1;
break;
case _1f==0:
adj=-2;
break;
case (_21+mod)>5:
adj=-2;
}
}else{
if(_1c<0){
switch(true){
case _1e==6:
adj=0;
break;
case _1e==0:
adj=1;
break;
case _1f==6:
adj=2;
break;
case _1f==0:
adj=1;
break;
case (_21+mod)<0:
adj=2;
}
}
}
_1c+=adj;
_1c-=(_1d*2);
}
_1b=_1c;
break;
case "year":
_1b=_1a;
break;
case "month":
_1b=(_18.getMonth()-_17.getMonth())+(_1a*12);
break;
case "week":
_1b=parseInt(dojo.date.difference(_17,_18,"day")/7);
break;
case "day":
_1b/=24;
case "hour":
_1b/=60;
case "minute":
_1b/=60;
case "second":
_1b/=1000;
case "millisecond":
_1b*=_18.getTime()-_17.getTime();
}
return Math.round(_1b);
dojo.date.difference = function(/*Date*/date1, /*Date?*/date2, /*String?*/interval){
// summary:
// Get the difference in a specific unit of time (e.g., number of
// months, weeks, days, etc.) between two dates, rounded to the
// nearest integer.
// date1:
// Date object
// date2:
// Date object. If not specified, the current Date is used.
// interval:
// A string representing the interval. One of the following:
// "year", "month", "day", "hour", "minute", "second",
// "millisecond", "quarter", "week", "weekday"
// Defaults to "day".
date2 = date2 || new Date();
interval = interval || "day";
var yearDiff = date2.getFullYear() - date1.getFullYear();
var delta = 1; // Integer return value
switch(interval){
case "quarter":
var m1 = date1.getMonth();
var m2 = date2.getMonth();
// Figure out which quarter the months are in
var q1 = Math.floor(m1/3) + 1;
var q2 = Math.floor(m2/3) + 1;
// Add quarters for any year difference between the dates
q2 += (yearDiff * 4);
delta = q2 - q1;
break;
case "weekday":
var days = Math.round(dojo.date.difference(date1, date2, "day"));
var weeks = parseInt(dojo.date.difference(date1, date2, "week"));
var mod = days % 7;
// Even number of weeks
if(mod == 0){
days = weeks*5;
}else{
// Weeks plus spare change (< 7 days)
var adj = 0;
var aDay = date1.getDay();
var bDay = date2.getDay();
weeks = parseInt(days/7);
mod = days % 7;
// Mark the date advanced by the number of
// round weeks (may be zero)
var dtMark = new Date(date1);
dtMark.setDate(dtMark.getDate()+(weeks*7));
var dayMark = dtMark.getDay();
// Spare change days -- 6 or less
if(days > 0){
switch(true){
// Range starts on Sat
case aDay == 6:
adj = -1;
break;
// Range starts on Sun
case aDay == 0:
adj = 0;
break;
// Range ends on Sat
case bDay == 6:
adj = -1;
break;
// Range ends on Sun
case bDay == 0:
adj = -2;
break;
// Range contains weekend
case (dayMark + mod) > 5:
adj = -2;
}
}else if(days < 0){
switch(true){
// Range starts on Sat
case aDay == 6:
adj = 0;
break;
// Range starts on Sun
case aDay == 0:
adj = 1;
break;
// Range ends on Sat
case bDay == 6:
adj = 2;
break;
// Range ends on Sun
case bDay == 0:
adj = 1;
break;
// Range contains weekend
case (dayMark + mod) < 0:
adj = 2;
}
}
days += adj;
days -= (weeks*2);
}
delta = days;
break;
case "year":
delta = yearDiff;
break;
case "month":
delta = (date2.getMonth() - date1.getMonth()) + (yearDiff * 12);
break;
case "week":
// Truncate instead of rounding
// Don't use Math.floor -- value may be negative
delta = parseInt(dojo.date.difference(date1, date2, "day")/7);
break;
case "day":
delta /= 24;
// fallthrough
case "hour":
delta /= 60;
// fallthrough
case "minute":
delta /= 60;
// fallthrough
case "second":
delta /= 1000;
// fallthrough
case "millisecond":
delta *= date2.getTime() - date1.getTime();
}
// Round for fractional values and DST leaps
return Math.round(delta); // Number (integer)
};
}

File diff suppressed because it is too large Load Diff

@ -5,78 +5,144 @@
*/
if(!dojo._hasResource["dojo.date.stamp"]){
dojo._hasResource["dojo.date.stamp"]=true;
if(!dojo._hasResource["dojo.date.stamp"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.date.stamp"] = true;
dojo.provide("dojo.date.stamp");
dojo.date.stamp.fromISOString=function(_1,_2){
if(!dojo.date.stamp._isoRegExp){
dojo.date.stamp._isoRegExp=/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/;
}
var _3=dojo.date.stamp._isoRegExp.exec(_1),_4=null;
if(_3){
_3.shift();
if(_3[1]){
_3[1]--;
}
if(_3[6]){
_3[6]*=1000;
}
if(_2){
_2=new Date(_2);
dojo.forEach(dojo.map(["FullYear","Month","Date","Hours","Minutes","Seconds","Milliseconds"],function(_5){
return _2["get"+_5]();
}),function(_6,_7){
_3[_7]=_3[_7]||_6;
});
}
_4=new Date(_3[0]||1970,_3[1]||0,_3[2]||1,_3[3]||0,_3[4]||0,_3[5]||0,_3[6]||0);
if(_3[0]<100){
_4.setFullYear(_3[0]||1970);
}
var _8=0,_9=_3[7]&&_3[7].charAt(0);
if(_9!="Z"){
_8=((_3[8]||0)*60)+(Number(_3[9])||0);
if(_9!="-"){
_8*=-1;
}
}
if(_9){
_8-=_4.getTimezoneOffset();
}
if(_8){
_4.setTime(_4.getTime()+_8*60000);
}
}
return _4;
};
dojo.date.stamp.toISOString=function(_a,_b){
var _c=function(n){
return (n<10)?"0"+n:n;
};
_b=_b||{};
var _d=[],_e=_b.zulu?"getUTC":"get",_f="";
if(_b.selector!="time"){
var _10=_a[_e+"FullYear"]();
_f=["0000".substr((_10+"").length)+_10,_c(_a[_e+"Month"]()+1),_c(_a[_e+"Date"]())].join("-");
}
_d.push(_f);
if(_b.selector!="date"){
var _11=[_c(_a[_e+"Hours"]()),_c(_a[_e+"Minutes"]()),_c(_a[_e+"Seconds"]())].join(":");
var _12=_a[_e+"Milliseconds"]();
if(_b.milliseconds){
_11+="."+(_12<100?"0":"")+_c(_12);
}
if(_b.zulu){
_11+="Z";
}else{
if(_b.selector!="time"){
var _13=_a.getTimezoneOffset();
var _14=Math.abs(_13);
_11+=(_13>0?"-":"+")+_c(Math.floor(_14/60))+":"+_c(_14%60);
}
// Methods to convert dates to or from a wire (string) format using well-known conventions
dojo.date.stamp.fromISOString = function(/*String*/formattedString, /*Number?*/defaultTime){
// summary:
// Returns a Date object given a string formatted according to a subset of the ISO-8601 standard.
//
// description:
// Accepts a string formatted according to a profile of ISO8601 as defined by
// [RFC3339](http://www.ietf.org/rfc/rfc3339.txt), except that partial input is allowed.
// Can also process dates as specified [by the W3C](http://www.w3.org/TR/NOTE-datetime)
// The following combinations are valid:
//
// * dates only
// | * yyyy
// | * yyyy-MM
// | * yyyy-MM-dd
// * times only, with an optional time zone appended
// | * THH:mm
// | * THH:mm:ss
// | * THH:mm:ss.SSS
// * and "datetimes" which could be any combination of the above
//
// timezones may be specified as Z (for UTC) or +/- followed by a time expression HH:mm
// Assumes the local time zone if not specified. Does not validate. Improperly formatted
// input may return null. Arguments which are out of bounds will be handled
// by the Date constructor (e.g. January 32nd typically gets resolved to February 1st)
// Only years between 100 and 9999 are supported.
//
// formattedString:
// A string such as 2005-06-30T08:05:00-07:00 or 2005-06-30 or T08:05:00
//
// defaultTime:
// Used for defaults for fields omitted in the formattedString.
// Uses 1970-01-01T00:00:00.0Z by default.
if(!dojo.date.stamp._isoRegExp){
dojo.date.stamp._isoRegExp =
//TODO: could be more restrictive and check for 00-59, etc.
/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/;
}
var match = dojo.date.stamp._isoRegExp.exec(formattedString),
result = null;
if(match){
match.shift();
if(match[1]){match[1]--;} // Javascript Date months are 0-based
if(match[6]){match[6] *= 1000;} // Javascript Date expects fractional seconds as milliseconds
if(defaultTime){
// mix in defaultTime. Relatively expensive, so use || operators for the fast path of defaultTime === 0
defaultTime = new Date(defaultTime);
dojo.forEach(dojo.map(["FullYear", "Month", "Date", "Hours", "Minutes", "Seconds", "Milliseconds"], function(prop){
return defaultTime["get" + prop]();
}), function(value, index){
match[index] = match[index] || value;
});
}
result = new Date(match[0]||1970, match[1]||0, match[2]||1, match[3]||0, match[4]||0, match[5]||0, match[6]||0); //TODO: UTC defaults
if(match[0] < 100){
result.setFullYear(match[0] || 1970);
}
var offset = 0,
zoneSign = match[7] && match[7].charAt(0);
if(zoneSign != 'Z'){
offset = ((match[8] || 0) * 60) + (Number(match[9]) || 0);
if(zoneSign != '-'){ offset *= -1; }
}
if(zoneSign){
offset -= result.getTimezoneOffset();
}
if(offset){
result.setTime(result.getTime() + offset * 60000);
}
}
return result; // Date or null
}
_d.push(_11);
/*=====
dojo.date.stamp.__Options = function(){
// selector: String
// "date" or "time" for partial formatting of the Date object.
// Both date and time will be formatted by default.
// zulu: Boolean
// if true, UTC/GMT is used for a timezone
// milliseconds: Boolean
// if true, output milliseconds
this.selector = selector;
this.zulu = zulu;
this.milliseconds = milliseconds;
}
=====*/
dojo.date.stamp.toISOString = function(/*Date*/dateObject, /*dojo.date.stamp.__Options?*/options){
// summary:
// Format a Date object as a string according a subset of the ISO-8601 standard
//
// description:
// When options.selector is omitted, output follows [RFC3339](http://www.ietf.org/rfc/rfc3339.txt)
// The local time zone is included as an offset from GMT, except when selector=='time' (time without a date)
// Does not check bounds. Only years between 100 and 9999 are supported.
//
// dateObject:
// A Date object
var _ = function(n){ return (n < 10) ? "0" + n : n; };
options = options || {};
var formattedDate = [],
getter = options.zulu ? "getUTC" : "get",
date = "";
if(options.selector != "time"){
var year = dateObject[getter+"FullYear"]();
date = ["0000".substr((year+"").length)+year, _(dateObject[getter+"Month"]()+1), _(dateObject[getter+"Date"]())].join('-');
}
formattedDate.push(date);
if(options.selector != "date"){
var time = [_(dateObject[getter+"Hours"]()), _(dateObject[getter+"Minutes"]()), _(dateObject[getter+"Seconds"]())].join(':');
var millis = dateObject[getter+"Milliseconds"]();
if(options.milliseconds){
time += "."+ (millis < 100 ? "0" : "") + _(millis);
}
if(options.zulu){
time += "Z";
}else if(options.selector != "time"){
var timezoneOffset = dateObject.getTimezoneOffset();
var absOffset = Math.abs(timezoneOffset);
time += (timezoneOffset > 0 ? "-" : "+") +
_(Math.floor(absOffset/60)) + ":" + _(absOffset%60);
}
formattedDate.push(time);
}
return formattedDate.join('T'); // String
}
return _d.join("T");
};
}

@ -5,60 +5,112 @@
*/
if(!dojo._hasResource["dojo.dnd.Avatar"]){
dojo._hasResource["dojo.dnd.Avatar"]=true;
if(!dojo._hasResource["dojo.dnd.Avatar"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.dnd.Avatar"] = true;
dojo.provide("dojo.dnd.Avatar");
dojo.require("dojo.dnd.common");
dojo.declare("dojo.dnd.Avatar",null,{constructor:function(_1){
this.manager=_1;
this.construct();
},construct:function(){
this.isA11y=dojo.hasClass(dojo.body(),"dijit_a11y");
var a=dojo.create("table",{"class":"dojoDndAvatar",style:{position:"absolute",zIndex:"1999",margin:"0px"}}),_2=this.manager.source,_3,b=dojo.create("tbody",null,a),tr=dojo.create("tr",null,b),td=dojo.create("td",null,tr),_4=this.isA11y?dojo.create("span",{id:"a11yIcon",innerHTML:this.manager.copy?"+":"<"},td):null,_5=dojo.create("span",{innerHTML:_2.generateText?this._generateText():""},td),k=Math.min(5,this.manager.nodes.length),i=0;
dojo.attr(tr,{"class":"dojoDndAvatarHeader",style:{opacity:0.9}});
for(;i<k;++i){
if(_2.creator){
_3=_2._normalizedCreator(_2.getItem(this.manager.nodes[i].id).data,"avatar").node;
}else{
_3=this.manager.nodes[i].cloneNode(true);
if(_3.tagName.toLowerCase()=="tr"){
var _6=dojo.create("table"),_7=dojo.create("tbody",null,_6);
_7.appendChild(_3);
_3=_6;
}
}
_3.id="";
tr=dojo.create("tr",null,b);
td=dojo.create("td",null,tr);
td.appendChild(_3);
dojo.attr(tr,{"class":"dojoDndAvatarItem",style:{opacity:(9-i)/10}});
}
this.node=a;
},destroy:function(){
dojo.destroy(this.node);
this.node=false;
},update:function(){
dojo[(this.manager.canDropFlag?"add":"remove")+"Class"](this.node,"dojoDndAvatarCanDrop");
if(this.isA11y){
var _8=dojo.byId("a11yIcon");
var _9="+";
if(this.manager.canDropFlag&&!this.manager.copy){
_9="< ";
}else{
if(!this.manager.canDropFlag&&!this.manager.copy){
_9="o";
}else{
if(!this.manager.canDropFlag){
_9="x";
}
}
}
_8.innerHTML=_9;
}
dojo.query(("tr.dojoDndAvatarHeader td span"+(this.isA11y?" span":"")),this.node).forEach(function(_a){
_a.innerHTML=this._generateText();
},this);
},_generateText:function(){
return this.manager.nodes.length.toString();
}});
dojo.declare("dojo.dnd.Avatar", null, {
// summary:
// Object that represents transferred DnD items visually
// manager: Object
// a DnD manager object
constructor: function(manager){
this.manager = manager;
this.construct();
},
// methods
construct: function(){
// summary:
// constructor function;
// it is separate so it can be (dynamically) overwritten in case of need
this.isA11y = dojo.hasClass(dojo.body(),"dijit_a11y");
var a = dojo.create("table", {
"class": "dojoDndAvatar",
style: {
position: "absolute",
zIndex: "1999",
margin: "0px"
}
}),
source = this.manager.source, node,
b = dojo.create("tbody", null, a),
tr = dojo.create("tr", null, b),
td = dojo.create("td", null, tr),
icon = this.isA11y ? dojo.create("span", {
id : "a11yIcon",
innerHTML : this.manager.copy ? '+' : "<"
}, td) : null,
span = dojo.create("span", {
innerHTML: source.generateText ? this._generateText() : ""
}, td),
k = Math.min(5, this.manager.nodes.length), i = 0;
// we have to set the opacity on IE only after the node is live
dojo.attr(tr, {
"class": "dojoDndAvatarHeader",
style: {opacity: 0.9}
});
for(; i < k; ++i){
if(source.creator){
// create an avatar representation of the node
node = source._normalizedCreator(source.getItem(this.manager.nodes[i].id).data, "avatar").node;
}else{
// or just clone the node and hope it works
node = this.manager.nodes[i].cloneNode(true);
if(node.tagName.toLowerCase() == "tr"){
// insert extra table nodes
var table = dojo.create("table"),
tbody = dojo.create("tbody", null, table);
tbody.appendChild(node);
node = table;
}
}
node.id = "";
tr = dojo.create("tr", null, b);
td = dojo.create("td", null, tr);
td.appendChild(node);
dojo.attr(tr, {
"class": "dojoDndAvatarItem",
style: {opacity: (9 - i) / 10}
});
}
this.node = a;
},
destroy: function(){
// summary:
// destructor for the avatar; called to remove all references so it can be garbage-collected
dojo.destroy(this.node);
this.node = false;
},
update: function(){
// summary:
// updates the avatar to reflect the current DnD state
dojo[(this.manager.canDropFlag ? "add" : "remove") + "Class"](this.node, "dojoDndAvatarCanDrop");
if (this.isA11y){
var icon = dojo.byId("a11yIcon");
var text = '+'; // assume canDrop && copy
if (this.manager.canDropFlag && !this.manager.copy) {
text = '< '; // canDrop && move
}else if (!this.manager.canDropFlag && !this.manager.copy) {
text = "o"; //!canDrop && move
}else if(!this.manager.canDropFlag){
text = 'x'; // !canDrop && copy
}
icon.innerHTML=text;
}
// replace text
dojo.query(("tr.dojoDndAvatarHeader td span" +(this.isA11y ? " span" : "")), this.node).forEach(
function(node){
node.innerHTML = this._generateText();
}, this);
},
_generateText: function(){
// summary: generates a proper text to reflect copying or moving of items
return this.manager.nodes.length.toString();
}
});
}

@ -5,231 +5,435 @@
*/
if(!dojo._hasResource["dojo.dnd.Container"]){
dojo._hasResource["dojo.dnd.Container"]=true;
if(!dojo._hasResource["dojo.dnd.Container"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.dnd.Container"] = true;
dojo.provide("dojo.dnd.Container");
dojo.require("dojo.dnd.common");
dojo.require("dojo.parser");
dojo.declare("dojo.dnd.Container",null,{skipForm:false,constructor:function(_1,_2){
this.node=dojo.byId(_1);
if(!_2){
_2={};
}
this.creator=_2.creator||null;
this.skipForm=_2.skipForm;
this.parent=_2.dropParent&&dojo.byId(_2.dropParent);
this.map={};
this.current=null;
this.containerState="";
dojo.addClass(this.node,"dojoDndContainer");
if(!(_2&&_2._skipStartup)){
this.startup();
}
this.events=[dojo.connect(this.node,"onmouseover",this,"onMouseOver"),dojo.connect(this.node,"onmouseout",this,"onMouseOut"),dojo.connect(this.node,"ondragstart",this,"onSelectStart"),dojo.connect(this.node,"onselectstart",this,"onSelectStart")];
},creator:function(){
},getItem:function(_3){
return this.map[_3];
},setItem:function(_4,_5){
this.map[_4]=_5;
},delItem:function(_6){
delete this.map[_6];
},forInItems:function(f,o){
o=o||dojo.global;
var m=this.map,e=dojo.dnd._empty;
for(var i in m){
if(i in e){
continue;
}
f.call(o,m[i],i,this);
}
return o;
},clearItems:function(){
this.map={};
},getAllNodes:function(){
return dojo.query("> .dojoDndItem",this.parent);
},sync:function(){
var _7={};
this.getAllNodes().forEach(function(_8){
if(_8.id){
var _9=this.getItem(_8.id);
if(_9){
_7[_8.id]=_9;
return;
}
}else{
_8.id=dojo.dnd.getUniqueId();
}
var _a=_8.getAttribute("dndType"),_b=_8.getAttribute("dndData");
_7[_8.id]={data:_b||_8.innerHTML,type:_a?_a.split(/\s*,\s*/):["text"]};
},this);
this.map=_7;
return this;
},insertNodes:function(_c,_d,_e){
if(!this.parent.firstChild){
_e=null;
}else{
if(_d){
if(!_e){
_e=this.parent.firstChild;
}
}else{
if(_e){
_e=_e.nextSibling;
}
}
}
if(_e){
for(var i=0;i<_c.length;++i){
var t=this._normalizedCreator(_c[i]);
this.setItem(t.node.id,{data:t.data,type:t.type});
this.parent.insertBefore(t.node,_e);
}
}else{
for(var i=0;i<_c.length;++i){
var t=this._normalizedCreator(_c[i]);
this.setItem(t.node.id,{data:t.data,type:t.type});
this.parent.appendChild(t.node);
}
}
return this;
},destroy:function(){
dojo.forEach(this.events,dojo.disconnect);
this.clearItems();
this.node=this.parent=this.current=null;
},markupFactory:function(_f,_10){
_f._skipStartup=true;
return new dojo.dnd.Container(_10,_f);
},startup:function(){
if(!this.parent){
this.parent=this.node;
if(this.parent.tagName.toLowerCase()=="table"){
var c=this.parent.getElementsByTagName("tbody");
if(c&&c.length){
this.parent=c[0];
}
}
}
this.defaultCreator=dojo.dnd._defaultCreator(this.parent);
this.sync();
},onMouseOver:function(e){
var n=e.relatedTarget;
while(n){
if(n==this.node){
break;
}
try{
n=n.parentNode;
}
catch(x){
n=null;
}
}
if(!n){
this._changeState("Container","Over");
this.onOverEvent();
}
n=this._getChildByEvent(e);
if(this.current==n){
return;
}
if(this.current){
this._removeItemClass(this.current,"Over");
}
if(n){
this._addItemClass(n,"Over");
}
this.current=n;
},onMouseOut:function(e){
for(var n=e.relatedTarget;n;){
if(n==this.node){
return;
}
try{
n=n.parentNode;
}
catch(x){
n=null;
}
}
if(this.current){
this._removeItemClass(this.current,"Over");
this.current=null;
}
this._changeState("Container","");
this.onOutEvent();
},onSelectStart:function(e){
if(!this.skipForm||!dojo.dnd.isFormElement(e)){
dojo.stopEvent(e);
}
},onOverEvent:function(){
},onOutEvent:function(){
},_changeState:function(_11,_12){
var _13="dojoDnd"+_11;
var _14=_11.toLowerCase()+"State";
dojo.removeClass(this.node,_13+this[_14]);
dojo.addClass(this.node,_13+_12);
this[_14]=_12;
},_addItemClass:function(_15,_16){
dojo.addClass(_15,"dojoDndItem"+_16);
},_removeItemClass:function(_17,_18){
dojo.removeClass(_17,"dojoDndItem"+_18);
},_getChildByEvent:function(e){
var _19=e.target;
if(_19){
for(var _1a=_19.parentNode;_1a;_19=_1a,_1a=_19.parentNode){
if(_1a==this.parent&&dojo.hasClass(_19,"dojoDndItem")){
return _19;
}
}
}
return null;
},_normalizedCreator:function(_1b,_1c){
var t=(this.creator||this.defaultCreator).call(this,_1b,_1c);
if(!dojo.isArray(t.type)){
t.type=["text"];
}
if(!t.node.id){
t.node.id=dojo.dnd.getUniqueId();
}
dojo.addClass(t.node,"dojoDndItem");
return t;
}});
dojo.dnd._createNode=function(tag){
if(!tag){
return dojo.dnd._createSpan;
/*
Container states:
"" - normal state
"Over" - mouse over a container
Container item states:
"" - normal state
"Over" - mouse over a container item
*/
/*=====
dojo.declare("dojo.dnd.__ContainerArgs", [], {
creator: function(){
// summary:
// a creator function, which takes a data item, and returns an object like that:
// {node: newNode, data: usedData, type: arrayOfStrings}
},
// skipForm: Boolean
// don't start the drag operation, if clicked on form elements
skipForm: false,
// dropParent: Node||String
// node or node's id to use as the parent node for dropped items
// (must be underneath the 'node' parameter in the DOM)
dropParent: null,
// _skipStartup: Boolean
// skip startup(), which collects children, for deferred initialization
// (this is used in the markup mode)
_skipStartup: false
});
dojo.dnd.Item = function(){
// summary:
// Represents (one of) the source node(s) being dragged.
// Contains (at least) the "type" and "data" attributes.
// type: String[]
// Type(s) of this item, by default this is ["text"]
// data: Object
// Logical representation of the object being dragged.
// If the drag object's type is "text" then data is a String,
// if it's another type then data could be a different Object,
// perhaps a name/value hash.
this.type = type;
this.data = data;
}
return function(_1d){
return dojo.create(tag,{innerHTML:_1d});
};
};
dojo.dnd._createTrTd=function(_1e){
var tr=dojo.create("tr");
dojo.create("td",{innerHTML:_1e},tr);
return tr;
=====*/
dojo.declare("dojo.dnd.Container", null, {
// summary:
// a Container object, which knows when mouse hovers over it,
// and over which element it hovers
// object attributes (for markup)
skipForm: false,
/*=====
// current: DomNode
// The DOM node the mouse is currently hovered over
current: null,
// map: Hash<String, dojo.dnd.Item>
// Map from an item's id (which is also the DOMNode's id) to
// the dojo.dnd.Item itself.
map: {},
=====*/
constructor: function(node, params){
// summary:
// a constructor of the Container
// node: Node
// node or node's id to build the container on
// params: dojo.dnd.__ContainerArgs
// a dictionary of parameters
this.node = dojo.byId(node);
if(!params){ params = {}; }
this.creator = params.creator || null;
this.skipForm = params.skipForm;
this.parent = params.dropParent && dojo.byId(params.dropParent);
// class-specific variables
this.map = {};
this.current = null;
// states
this.containerState = "";
dojo.addClass(this.node, "dojoDndContainer");
// mark up children
if(!(params && params._skipStartup)){
this.startup();
}
// set up events
this.events = [
dojo.connect(this.node, "onmouseover", this, "onMouseOver"),
dojo.connect(this.node, "onmouseout", this, "onMouseOut"),
// cancel text selection and text dragging
dojo.connect(this.node, "ondragstart", this, "onSelectStart"),
dojo.connect(this.node, "onselectstart", this, "onSelectStart")
];
},
// object attributes (for markup)
creator: function(){
// summary:
// creator function, dummy at the moment
},
// abstract access to the map
getItem: function(/*String*/ key){
// summary:
// returns a data item by its key (id)
return this.map[key]; // dojo.dnd.Item
},
setItem: function(/*String*/ key, /*dojo.dnd.Item*/ data){
// summary:
// associates a data item with its key (id)
this.map[key] = data;
},
delItem: function(/*String*/ key){
// summary:
// removes a data item from the map by its key (id)
delete this.map[key];
},
forInItems: function(/*Function*/ f, /*Object?*/ o){
// summary:
// iterates over a data map skipping members that
// are present in the empty object (IE and/or 3rd-party libraries).
o = o || dojo.global;
var m = this.map, e = dojo.dnd._empty;
for(var i in m){
if(i in e){ continue; }
f.call(o, m[i], i, this);
}
return o; // Object
},
clearItems: function(){
// summary:
// removes all data items from the map
this.map = {};
},
// methods
getAllNodes: function(){
// summary:
// returns a list (an array) of all valid child nodes
return dojo.query("> .dojoDndItem", this.parent); // NodeList
},
sync: function(){
// summary:
// sync up the node list with the data map
var map = {};
this.getAllNodes().forEach(function(node){
if(node.id){
var item = this.getItem(node.id);
if(item){
map[node.id] = item;
return;
}
}else{
node.id = dojo.dnd.getUniqueId();
}
var type = node.getAttribute("dndType"),
data = node.getAttribute("dndData");
map[node.id] = {
data: data || node.innerHTML,
type: type ? type.split(/\s*,\s*/) : ["text"]
};
}, this);
this.map = map;
return this; // self
},
insertNodes: function(data, before, anchor){
// summary:
// inserts an array of new nodes before/after an anchor node
// data: Array
// a list of data items, which should be processed by the creator function
// before: Boolean
// insert before the anchor, if true, and after the anchor otherwise
// anchor: Node
// the anchor node to be used as a point of insertion
if(!this.parent.firstChild){
anchor = null;
}else if(before){
if(!anchor){
anchor = this.parent.firstChild;
}
}else{
if(anchor){
anchor = anchor.nextSibling;
}
}
if(anchor){
for(var i = 0; i < data.length; ++i){
var t = this._normalizedCreator(data[i]);
this.setItem(t.node.id, {data: t.data, type: t.type});
this.parent.insertBefore(t.node, anchor);
}
}else{
for(var i = 0; i < data.length; ++i){
var t = this._normalizedCreator(data[i]);
this.setItem(t.node.id, {data: t.data, type: t.type});
this.parent.appendChild(t.node);
}
}
return this; // self
},
destroy: function(){
// summary:
// prepares this object to be garbage-collected
dojo.forEach(this.events, dojo.disconnect);
this.clearItems();
this.node = this.parent = this.current = null;
},
// markup methods
markupFactory: function(params, node){
params._skipStartup = true;
return new dojo.dnd.Container(node, params);
},
startup: function(){
// summary:
// collects valid child items and populate the map
// set up the real parent node
if(!this.parent){
// use the standard algorithm, if not assigned
this.parent = this.node;
if(this.parent.tagName.toLowerCase() == "table"){
var c = this.parent.getElementsByTagName("tbody");
if(c && c.length){ this.parent = c[0]; }
}
}
this.defaultCreator = dojo.dnd._defaultCreator(this.parent);
// process specially marked children
this.sync();
},
// mouse events
onMouseOver: function(e){
// summary:
// event processor for onmouseover
// e: Event
// mouse event
var n = e.relatedTarget;
while(n){
if(n == this.node){ break; }
try{
n = n.parentNode;
}catch(x){
n = null;
}
}
if(!n){
this._changeState("Container", "Over");
this.onOverEvent();
}
n = this._getChildByEvent(e);
if(this.current == n){ return; }
if(this.current){ this._removeItemClass(this.current, "Over"); }
if(n){ this._addItemClass(n, "Over"); }
this.current = n;
},
onMouseOut: function(e){
// summary:
// event processor for onmouseout
// e: Event
// mouse event
for(var n = e.relatedTarget; n;){
if(n == this.node){ return; }
try{
n = n.parentNode;
}catch(x){
n = null;
}
}
if(this.current){
this._removeItemClass(this.current, "Over");
this.current = null;
}
this._changeState("Container", "");
this.onOutEvent();
},
onSelectStart: function(e){
// summary:
// event processor for onselectevent and ondragevent
// e: Event
// mouse event
if(!this.skipForm || !dojo.dnd.isFormElement(e)){
dojo.stopEvent(e);
}
},
// utilities
onOverEvent: function(){
// summary:
// this function is called once, when mouse is over our container
},
onOutEvent: function(){
// summary:
// this function is called once, when mouse is out of our container
},
_changeState: function(type, newState){
// summary:
// changes a named state to new state value
// type: String
// a name of the state to change
// newState: String
// new state
var prefix = "dojoDnd" + type;
var state = type.toLowerCase() + "State";
//dojo.replaceClass(this.node, prefix + newState, prefix + this[state]);
dojo.removeClass(this.node, prefix + this[state]);
dojo.addClass(this.node, prefix + newState);
this[state] = newState;
},
_addItemClass: function(node, type){
// summary:
// adds a class with prefix "dojoDndItem"
// node: Node
// a node
// type: String
// a variable suffix for a class name
dojo.addClass(node, "dojoDndItem" + type);
},
_removeItemClass: function(node, type){
// summary:
// removes a class with prefix "dojoDndItem"
// node: Node
// a node
// type: String
// a variable suffix for a class name
dojo.removeClass(node, "dojoDndItem" + type);
},
_getChildByEvent: function(e){
// summary:
// gets a child, which is under the mouse at the moment, or null
// e: Event
// a mouse event
var node = e.target;
if(node){
for(var parent = node.parentNode; parent; node = parent, parent = node.parentNode){
if(parent == this.parent && dojo.hasClass(node, "dojoDndItem")){ return node; }
}
}
return null;
},
_normalizedCreator: function(/*dojo.dnd.Item*/ item, /*String*/ hint){
// summary:
// adds all necessary data to the output of the user-supplied creator function
var t = (this.creator || this.defaultCreator).call(this, item, hint);
if(!dojo.isArray(t.type)){ t.type = ["text"]; }
if(!t.node.id){ t.node.id = dojo.dnd.getUniqueId(); }
dojo.addClass(t.node, "dojoDndItem");
return t;
}
});
dojo.dnd._createNode = function(tag){
// summary:
// returns a function, which creates an element of given tag
// (SPAN by default) and sets its innerHTML to given text
// tag: String
// a tag name or empty for SPAN
if(!tag){ return dojo.dnd._createSpan; }
return function(text){ // Function
return dojo.create(tag, {innerHTML: text}); // Node
};
};
dojo.dnd._createSpan=function(_1f){
return dojo.create("span",{innerHTML:_1f});
dojo.dnd._createTrTd = function(text){
// summary:
// creates a TR/TD structure with given text as an innerHTML of TD
// text: String
// a text for TD
var tr = dojo.create("tr");
dojo.create("td", {innerHTML: text}, tr);
return tr; // Node
};
dojo.dnd._defaultCreatorNodes={ul:"li",ol:"li",div:"div",p:"div"};
dojo.dnd._defaultCreator=function(_20){
var tag=_20.tagName.toLowerCase();
var c=tag=="tbody"||tag=="thead"?dojo.dnd._createTrTd:dojo.dnd._createNode(dojo.dnd._defaultCreatorNodes[tag]);
return function(_21,_22){
var _23=_21&&dojo.isObject(_21),_24,_25,n;
if(_23&&_21.tagName&&_21.nodeType&&_21.getAttribute){
_24=_21.getAttribute("dndData")||_21.innerHTML;
_25=_21.getAttribute("dndType");
_25=_25?_25.split(/\s*,\s*/):["text"];
n=_21;
}else{
_24=(_23&&_21.data)?_21.data:_21;
_25=(_23&&_21.type)?_21.type:["text"];
n=(_22=="avatar"?dojo.dnd._createSpan:c)(String(_24));
}
if(!n.id){
n.id=dojo.dnd.getUniqueId();
}
return {node:n,data:_24,type:_25};
dojo.dnd._createSpan = function(text){
// summary:
// creates a SPAN element with given text as its innerHTML
// text: String
// a text for SPAN
return dojo.create("span", {innerHTML: text}); // Node
};
// dojo.dnd._defaultCreatorNodes: Object
// a dictionary that maps container tag names to child tag names
dojo.dnd._defaultCreatorNodes = {ul: "li", ol: "li", div: "div", p: "div"};
dojo.dnd._defaultCreator = function(node){
// summary:
// takes a parent node, and returns an appropriate creator function
// node: Node
// a container node
var tag = node.tagName.toLowerCase();
var c = tag == "tbody" || tag == "thead" ? dojo.dnd._createTrTd :
dojo.dnd._createNode(dojo.dnd._defaultCreatorNodes[tag]);
return function(item, hint){ // Function
var isObj = item && dojo.isObject(item), data, type, n;
if(isObj && item.tagName && item.nodeType && item.getAttribute){
// process a DOM node
data = item.getAttribute("dndData") || item.innerHTML;
type = item.getAttribute("dndType");
type = type ? type.split(/\s*,\s*/) : ["text"];
n = item; // this node is going to be moved rather than copied
}else{
// process a DnD item object or a string
data = (isObj && item.data) ? item.data : item;
type = (isObj && item.type) ? item.type : ["text"];
n = (hint == "avatar" ? dojo.dnd._createSpan : c)(String(data));
}
if(!n.id){
n.id = dojo.dnd.getUniqueId();
}
return {node: n, data: data, type: type};
};
};
}

@ -5,124 +5,216 @@
*/
if(!dojo._hasResource["dojo.dnd.Manager"]){
dojo._hasResource["dojo.dnd.Manager"]=true;
if(!dojo._hasResource["dojo.dnd.Manager"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.dnd.Manager"] = true;
dojo.provide("dojo.dnd.Manager");
dojo.require("dojo.dnd.common");
dojo.require("dojo.dnd.autoscroll");
dojo.require("dojo.dnd.Avatar");
dojo.declare("dojo.dnd.Manager",null,{constructor:function(){
this.avatar=null;
this.source=null;
this.nodes=[];
this.copy=true;
this.target=null;
this.canDropFlag=false;
this.events=[];
},OFFSET_X:16,OFFSET_Y:16,overSource:function(_1){
if(this.avatar){
this.target=(_1&&_1.targetState!="Disabled")?_1:null;
this.canDropFlag=Boolean(this.target);
this.avatar.update();
}
dojo.publish("/dnd/source/over",[_1]);
},outSource:function(_2){
if(this.avatar){
if(this.target==_2){
this.target=null;
this.canDropFlag=false;
this.avatar.update();
dojo.publish("/dnd/source/over",[null]);
}
}else{
dojo.publish("/dnd/source/over",[null]);
}
},startDrag:function(_3,_4,_5){
this.source=_3;
this.nodes=_4;
this.copy=Boolean(_5);
this.avatar=this.makeAvatar();
dojo.body().appendChild(this.avatar.node);
dojo.publish("/dnd/start",[_3,_4,this.copy]);
this.events=[dojo.connect(dojo.doc,"onmousemove",this,"onMouseMove"),dojo.connect(dojo.doc,"onmouseup",this,"onMouseUp"),dojo.connect(dojo.doc,"onkeydown",this,"onKeyDown"),dojo.connect(dojo.doc,"onkeyup",this,"onKeyUp"),dojo.connect(dojo.doc,"ondragstart",dojo.stopEvent),dojo.connect(dojo.body(),"onselectstart",dojo.stopEvent)];
var c="dojoDnd"+(_5?"Copy":"Move");
dojo.addClass(dojo.body(),c);
},canDrop:function(_6){
var _7=Boolean(this.target&&_6);
if(this.canDropFlag!=_7){
this.canDropFlag=_7;
this.avatar.update();
}
},stopDrag:function(){
dojo.removeClass(dojo.body(),"dojoDndCopy");
dojo.removeClass(dojo.body(),"dojoDndMove");
dojo.forEach(this.events,dojo.disconnect);
this.events=[];
this.avatar.destroy();
this.avatar=null;
this.source=this.target=null;
this.nodes=[];
},makeAvatar:function(){
return new dojo.dnd.Avatar(this);
},updateAvatar:function(){
this.avatar.update();
},onMouseMove:function(e){
var a=this.avatar;
if(a){
dojo.dnd.autoScrollNodes(e);
var s=a.node.style;
s.left=(e.pageX+this.OFFSET_X)+"px";
s.top=(e.pageY+this.OFFSET_Y)+"px";
var _8=Boolean(this.source.copyState(dojo.isCopyKey(e)));
if(this.copy!=_8){
this._setCopyStatus(_8);
}
}
},onMouseUp:function(e){
if(this.avatar){
if(this.target&&this.canDropFlag){
var _9=Boolean(this.source.copyState(dojo.isCopyKey(e))),_a=[this.source,this.nodes,_9,this.target,e];
dojo.publish("/dnd/drop/before",_a);
dojo.publish("/dnd/drop",_a);
}else{
dojo.publish("/dnd/cancel");
}
this.stopDrag();
}
},onKeyDown:function(e){
if(this.avatar){
switch(e.keyCode){
case dojo.keys.CTRL:
var _b=Boolean(this.source.copyState(true));
if(this.copy!=_b){
this._setCopyStatus(_b);
}
break;
case dojo.keys.ESCAPE:
dojo.publish("/dnd/cancel");
this.stopDrag();
break;
}
}
},onKeyUp:function(e){
if(this.avatar&&e.keyCode==dojo.keys.CTRL){
var _c=Boolean(this.source.copyState(false));
if(this.copy!=_c){
this._setCopyStatus(_c);
}
}
},_setCopyStatus:function(_d){
this.copy=_d;
this.source._markDndStatus(this.copy);
this.updateAvatar();
dojo.removeClass(dojo.body(),"dojoDnd"+(this.copy?"Move":"Copy"));
dojo.addClass(dojo.body(),"dojoDnd"+(this.copy?"Copy":"Move"));
}});
dojo.dnd._manager=null;
dojo.dnd.manager=function(){
if(!dojo.dnd._manager){
dojo.dnd._manager=new dojo.dnd.Manager();
}
return dojo.dnd._manager;
dojo.declare("dojo.dnd.Manager", null, {
// summary:
// the manager of DnD operations (usually a singleton)
constructor: function(){
this.avatar = null;
this.source = null;
this.nodes = [];
this.copy = true;
this.target = null;
this.canDropFlag = false;
this.events = [];
},
// avatar's offset from the mouse
OFFSET_X: 16,
OFFSET_Y: 16,
// methods
overSource: function(source){
// summary:
// called when a source detected a mouse-over condition
// source: Object
// the reporter
if(this.avatar){
this.target = (source && source.targetState != "Disabled") ? source : null;
this.canDropFlag = Boolean(this.target);
this.avatar.update();
}
dojo.publish("/dnd/source/over", [source]);
},
outSource: function(source){
// summary:
// called when a source detected a mouse-out condition
// source: Object
// the reporter
if(this.avatar){
if(this.target == source){
this.target = null;
this.canDropFlag = false;
this.avatar.update();
dojo.publish("/dnd/source/over", [null]);
}
}else{
dojo.publish("/dnd/source/over", [null]);
}
},
startDrag: function(source, nodes, copy){
// summary:
// called to initiate the DnD operation
// source: Object
// the source which provides items
// nodes: Array
// the list of transferred items
// copy: Boolean
// copy items, if true, move items otherwise
this.source = source;
this.nodes = nodes;
this.copy = Boolean(copy); // normalizing to true boolean
this.avatar = this.makeAvatar();
dojo.body().appendChild(this.avatar.node);
dojo.publish("/dnd/start", [source, nodes, this.copy]);
this.events = [
dojo.connect(dojo.doc, "onmousemove", this, "onMouseMove"),
dojo.connect(dojo.doc, "onmouseup", this, "onMouseUp"),
dojo.connect(dojo.doc, "onkeydown", this, "onKeyDown"),
dojo.connect(dojo.doc, "onkeyup", this, "onKeyUp"),
// cancel text selection and text dragging
dojo.connect(dojo.doc, "ondragstart", dojo.stopEvent),
dojo.connect(dojo.body(), "onselectstart", dojo.stopEvent)
];
var c = "dojoDnd" + (copy ? "Copy" : "Move");
dojo.addClass(dojo.body(), c);
},
canDrop: function(flag){
// summary:
// called to notify if the current target can accept items
var canDropFlag = Boolean(this.target && flag);
if(this.canDropFlag != canDropFlag){
this.canDropFlag = canDropFlag;
this.avatar.update();
}
},
stopDrag: function(){
// summary:
// stop the DnD in progress
dojo.removeClass(dojo.body(), "dojoDndCopy");
dojo.removeClass(dojo.body(), "dojoDndMove");
dojo.forEach(this.events, dojo.disconnect);
this.events = [];
this.avatar.destroy();
this.avatar = null;
this.source = this.target = null;
this.nodes = [];
},
makeAvatar: function(){
// summary:
// makes the avatar; it is separate to be overwritten dynamically, if needed
return new dojo.dnd.Avatar(this);
},
updateAvatar: function(){
// summary:
// updates the avatar; it is separate to be overwritten dynamically, if needed
this.avatar.update();
},
// mouse event processors
onMouseMove: function(e){
// summary:
// event processor for onmousemove
// e: Event
// mouse event
var a = this.avatar;
if(a){
dojo.dnd.autoScrollNodes(e);
//dojo.dnd.autoScroll(e);
var s = a.node.style;
s.left = (e.pageX + this.OFFSET_X) + "px";
s.top = (e.pageY + this.OFFSET_Y) + "px";
var copy = Boolean(this.source.copyState(dojo.isCopyKey(e)));
if(this.copy != copy){
this._setCopyStatus(copy);
}
}
},
onMouseUp: function(e){
// summary:
// event processor for onmouseup
// e: Event
// mouse event
if(this.avatar){
if(this.target && this.canDropFlag){
var copy = Boolean(this.source.copyState(dojo.isCopyKey(e))),
params = [this.source, this.nodes, copy, this.target, e];
dojo.publish("/dnd/drop/before", params);
dojo.publish("/dnd/drop", params);
}else{
dojo.publish("/dnd/cancel");
}
this.stopDrag();
}
},
// keyboard event processors
onKeyDown: function(e){
// summary:
// event processor for onkeydown:
// watching for CTRL for copy/move status, watching for ESCAPE to cancel the drag
// e: Event
// keyboard event
if(this.avatar){
switch(e.keyCode){
case dojo.keys.CTRL:
var copy = Boolean(this.source.copyState(true));
if(this.copy != copy){
this._setCopyStatus(copy);
}
break;
case dojo.keys.ESCAPE:
dojo.publish("/dnd/cancel");
this.stopDrag();
break;
}
}
},
onKeyUp: function(e){
// summary:
// event processor for onkeyup, watching for CTRL for copy/move status
// e: Event
// keyboard event
if(this.avatar && e.keyCode == dojo.keys.CTRL){
var copy = Boolean(this.source.copyState(false));
if(this.copy != copy){
this._setCopyStatus(copy);
}
}
},
// utilities
_setCopyStatus: function(copy){
// summary:
// changes the copy status
// copy: Boolean
// the copy status
this.copy = copy;
this.source._markDndStatus(this.copy);
this.updateAvatar();
dojo.removeClass(dojo.body(), "dojoDnd" + (this.copy ? "Move" : "Copy"));
dojo.addClass(dojo.body(), "dojoDnd" + (this.copy ? "Copy" : "Move"));
}
});
// dojo.dnd._manager:
// The manager singleton variable. Can be overwritten if needed.
dojo.dnd._manager = null;
dojo.dnd.manager = function(){
// summary:
// Returns the current DnD manager. Creates one if it is not created yet.
if(!dojo.dnd._manager){
dojo.dnd._manager = new dojo.dnd.Manager();
}
return dojo.dnd._manager; // Object
};
}

@ -5,73 +5,174 @@
*/
if(!dojo._hasResource["dojo.dnd.Moveable"]){
dojo._hasResource["dojo.dnd.Moveable"]=true;
if(!dojo._hasResource["dojo.dnd.Moveable"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.dnd.Moveable"] = true;
dojo.provide("dojo.dnd.Moveable");
dojo.require("dojo.dnd.Mover");
dojo.declare("dojo.dnd.Moveable",null,{handle:"",delay:0,skip:false,constructor:function(_1,_2){
this.node=dojo.byId(_1);
if(!_2){
_2={};
}
this.handle=_2.handle?dojo.byId(_2.handle):null;
if(!this.handle){
this.handle=this.node;
}
this.delay=_2.delay>0?_2.delay:0;
this.skip=_2.skip;
this.mover=_2.mover?_2.mover:dojo.dnd.Mover;
this.events=[dojo.connect(this.handle,"onmousedown",this,"onMouseDown"),dojo.connect(this.handle,"ondragstart",this,"onSelectStart"),dojo.connect(this.handle,"onselectstart",this,"onSelectStart")];
},markupFactory:function(_3,_4){
return new dojo.dnd.Moveable(_4,_3);
},destroy:function(){
dojo.forEach(this.events,dojo.disconnect);
this.events=this.node=this.handle=null;
},onMouseDown:function(e){
if(this.skip&&dojo.dnd.isFormElement(e)){
return;
}
if(this.delay){
this.events.push(dojo.connect(this.handle,"onmousemove",this,"onMouseMove"),dojo.connect(this.handle,"onmouseup",this,"onMouseUp"));
this._lastX=e.pageX;
this._lastY=e.pageY;
}else{
this.onDragDetected(e);
}
dojo.stopEvent(e);
},onMouseMove:function(e){
if(Math.abs(e.pageX-this._lastX)>this.delay||Math.abs(e.pageY-this._lastY)>this.delay){
this.onMouseUp(e);
this.onDragDetected(e);
}
dojo.stopEvent(e);
},onMouseUp:function(e){
for(var i=0;i<2;++i){
dojo.disconnect(this.events.pop());
}
dojo.stopEvent(e);
},onSelectStart:function(e){
if(!this.skip||!dojo.dnd.isFormElement(e)){
dojo.stopEvent(e);
}
},onDragDetected:function(e){
new this.mover(this.node,e,this);
},onMoveStart:function(_5){
dojo.publish("/dnd/move/start",[_5]);
dojo.addClass(dojo.body(),"dojoMove");
dojo.addClass(this.node,"dojoMoveItem");
},onMoveStop:function(_6){
dojo.publish("/dnd/move/stop",[_6]);
dojo.removeClass(dojo.body(),"dojoMove");
dojo.removeClass(this.node,"dojoMoveItem");
},onFirstMove:function(_7,e){
},onMove:function(_8,_9,e){
this.onMoving(_8,_9);
var s=_8.node.style;
s.left=_9.l+"px";
s.top=_9.t+"px";
this.onMoved(_8,_9);
},onMoving:function(_a,_b){
},onMoved:function(_c,_d){
}});
/*=====
dojo.declare("dojo.dnd.__MoveableArgs", [], {
// handle: Node||String
// A node (or node's id), which is used as a mouse handle.
// If omitted, the node itself is used as a handle.
handle: null,
// delay: Number
// delay move by this number of pixels
delay: 0,
// skip: Boolean
// skip move of form elements
skip: false,
// mover: Object
// a constructor of custom Mover
mover: dojo.dnd.Mover
});
=====*/
dojo.declare("dojo.dnd.Moveable", null, {
// object attributes (for markup)
handle: "",
delay: 0,
skip: false,
constructor: function(node, params){
// summary:
// an object, which makes a node moveable
// node: Node
// a node (or node's id) to be moved
// params: dojo.dnd.__MoveableArgs?
// optional parameters
this.node = dojo.byId(node);
if(!params){ params = {}; }
this.handle = params.handle ? dojo.byId(params.handle) : null;
if(!this.handle){ this.handle = this.node; }
this.delay = params.delay > 0 ? params.delay : 0;
this.skip = params.skip;
this.mover = params.mover ? params.mover : dojo.dnd.Mover;
this.events = [
dojo.connect(this.handle, "onmousedown", this, "onMouseDown"),
// cancel text selection and text dragging
dojo.connect(this.handle, "ondragstart", this, "onSelectStart"),
dojo.connect(this.handle, "onselectstart", this, "onSelectStart")
];
},
// markup methods
markupFactory: function(params, node){
return new dojo.dnd.Moveable(node, params);
},
// methods
destroy: function(){
// summary:
// stops watching for possible move, deletes all references, so the object can be garbage-collected
dojo.forEach(this.events, dojo.disconnect);
this.events = this.node = this.handle = null;
},
// mouse event processors
onMouseDown: function(e){
// summary:
// event processor for onmousedown, creates a Mover for the node
// e: Event
// mouse event
if(this.skip && dojo.dnd.isFormElement(e)){ return; }
if(this.delay){
this.events.push(
dojo.connect(this.handle, "onmousemove", this, "onMouseMove"),
dojo.connect(this.handle, "onmouseup", this, "onMouseUp")
);
this._lastX = e.pageX;
this._lastY = e.pageY;
}else{
this.onDragDetected(e);
}
dojo.stopEvent(e);
},
onMouseMove: function(e){
// summary:
// event processor for onmousemove, used only for delayed drags
// e: Event
// mouse event
if(Math.abs(e.pageX - this._lastX) > this.delay || Math.abs(e.pageY - this._lastY) > this.delay){
this.onMouseUp(e);
this.onDragDetected(e);
}
dojo.stopEvent(e);
},
onMouseUp: function(e){
// summary:
// event processor for onmouseup, used only for delayed drags
// e: Event
// mouse event
for(var i = 0; i < 2; ++i){
dojo.disconnect(this.events.pop());
}
dojo.stopEvent(e);
},
onSelectStart: function(e){
// summary:
// event processor for onselectevent and ondragevent
// e: Event
// mouse event
if(!this.skip || !dojo.dnd.isFormElement(e)){
dojo.stopEvent(e);
}
},
// local events
onDragDetected: function(/* Event */ e){
// summary:
// called when the drag is detected;
// responsible for creation of the mover
new this.mover(this.node, e, this);
},
onMoveStart: function(/* dojo.dnd.Mover */ mover){
// summary:
// called before every move operation
dojo.publish("/dnd/move/start", [mover]);
dojo.addClass(dojo.body(), "dojoMove");
dojo.addClass(this.node, "dojoMoveItem");
},
onMoveStop: function(/* dojo.dnd.Mover */ mover){
// summary:
// called after every move operation
dojo.publish("/dnd/move/stop", [mover]);
dojo.removeClass(dojo.body(), "dojoMove");
dojo.removeClass(this.node, "dojoMoveItem");
},
onFirstMove: function(/* dojo.dnd.Mover */ mover, /* Event */ e){
// summary:
// called during the very first move notification;
// can be used to initialize coordinates, can be overwritten.
// default implementation does nothing
},
onMove: function(/* dojo.dnd.Mover */ mover, /* Object */ leftTop, /* Event */ e){
// summary:
// called during every move notification;
// should actually move the node; can be overwritten.
this.onMoving(mover, leftTop);
var s = mover.node.style;
s.left = leftTop.l + "px";
s.top = leftTop.t + "px";
this.onMoved(mover, leftTop);
},
onMoving: function(/* dojo.dnd.Mover */ mover, /* Object */ leftTop){
// summary:
// called before every incremental move; can be overwritten.
// default implementation does nothing
},
onMoved: function(/* dojo.dnd.Mover */ mover, /* Object */ leftTop){
// summary:
// called after every incremental move; can be overwritten.
// default implementation does nothing
}
});
}

@ -5,61 +5,113 @@
*/
if(!dojo._hasResource["dojo.dnd.Mover"]){
dojo._hasResource["dojo.dnd.Mover"]=true;
if(!dojo._hasResource["dojo.dnd.Mover"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.dnd.Mover"] = true;
dojo.provide("dojo.dnd.Mover");
dojo.require("dojo.dnd.common");
dojo.require("dojo.dnd.autoscroll");
dojo.declare("dojo.dnd.Mover",null,{constructor:function(_1,e,_2){
this.node=dojo.byId(_1);
this.marginBox={l:e.pageX,t:e.pageY};
this.mouseButton=e.button;
var h=this.host=_2,d=_1.ownerDocument,_3=dojo.connect(d,"onmousemove",this,"onFirstMove");
this.events=[dojo.connect(d,"onmousemove",this,"onMouseMove"),dojo.connect(d,"onmouseup",this,"onMouseUp"),dojo.connect(d,"ondragstart",dojo.stopEvent),dojo.connect(d.body,"onselectstart",dojo.stopEvent),_3];
if(h&&h.onMoveStart){
h.onMoveStart(this);
}
},onMouseMove:function(e){
dojo.dnd.autoScroll(e);
var m=this.marginBox;
this.host.onMove(this,{l:m.l+e.pageX,t:m.t+e.pageY},e);
dojo.stopEvent(e);
},onMouseUp:function(e){
if(dojo.isWebKit&&dojo.isMac&&this.mouseButton==2?e.button==0:this.mouseButton==e.button){
this.destroy();
}
dojo.stopEvent(e);
},onFirstMove:function(e){
var s=this.node.style,l,t,h=this.host;
switch(s.position){
case "relative":
case "absolute":
l=Math.round(parseFloat(s.left))||0;
t=Math.round(parseFloat(s.top))||0;
break;
default:
s.position="absolute";
var m=dojo.marginBox(this.node);
var b=dojo.doc.body;
var bs=dojo.getComputedStyle(b);
var bm=dojo._getMarginBox(b,bs);
var bc=dojo._getContentBox(b,bs);
l=m.l-(bc.l-bm.l);
t=m.t-(bc.t-bm.t);
break;
}
this.marginBox.l=l-this.marginBox.l;
this.marginBox.t=t-this.marginBox.t;
if(h&&h.onFirstMove){
h.onFirstMove(this,e);
}
dojo.disconnect(this.events.pop());
},destroy:function(){
dojo.forEach(this.events,dojo.disconnect);
var h=this.host;
if(h&&h.onMoveStop){
h.onMoveStop(this);
}
this.events=this.node=this.host=null;
}});
dojo.declare("dojo.dnd.Mover", null, {
constructor: function(node, e, host){
// summary:
// an object, which makes a node follow the mouse.
// Used as a default mover, and as a base class for custom movers.
// node: Node
// a node (or node's id) to be moved
// e: Event
// a mouse event, which started the move;
// only pageX and pageY properties are used
// host: Object?
// object which implements the functionality of the move,
// and defines proper events (onMoveStart and onMoveStop)
this.node = dojo.byId(node);
this.marginBox = {l: e.pageX, t: e.pageY};
this.mouseButton = e.button;
var h = this.host = host, d = node.ownerDocument,
firstEvent = dojo.connect(d, "onmousemove", this, "onFirstMove");
this.events = [
dojo.connect(d, "onmousemove", this, "onMouseMove"),
dojo.connect(d, "onmouseup", this, "onMouseUp"),
// cancel text selection and text dragging
dojo.connect(d, "ondragstart", dojo.stopEvent),
dojo.connect(d.body, "onselectstart", dojo.stopEvent),
firstEvent
];
// notify that the move has started
if(h && h.onMoveStart){
h.onMoveStart(this);
}
},
// mouse event processors
onMouseMove: function(e){
// summary:
// event processor for onmousemove
// e: Event
// mouse event
dojo.dnd.autoScroll(e);
var m = this.marginBox;
this.host.onMove(this, {l: m.l + e.pageX, t: m.t + e.pageY}, e);
dojo.stopEvent(e);
},
onMouseUp: function(e){
if(dojo.isWebKit && dojo.isMac && this.mouseButton == 2 ?
e.button == 0 : this.mouseButton == e.button){
this.destroy();
}
dojo.stopEvent(e);
},
// utilities
onFirstMove: function(e){
// summary:
// makes the node absolute; it is meant to be called only once.
// relative and absolutely positioned nodes are assumed to use pixel units
var s = this.node.style, l, t, h = this.host;
switch(s.position){
case "relative":
case "absolute":
// assume that left and top values are in pixels already
l = Math.round(parseFloat(s.left)) || 0;
t = Math.round(parseFloat(s.top)) || 0;
break;
default:
s.position = "absolute"; // enforcing the absolute mode
var m = dojo.marginBox(this.node);
// event.pageX/pageY (which we used to generate the initial
// margin box) includes padding and margin set on the body.
// However, setting the node's position to absolute and then
// doing dojo.marginBox on it *doesn't* take that additional
// space into account - so we need to subtract the combined
// padding and margin. We use getComputedStyle and
// _getMarginBox/_getContentBox to avoid the extra lookup of
// the computed style.
var b = dojo.doc.body;
var bs = dojo.getComputedStyle(b);
var bm = dojo._getMarginBox(b, bs);
var bc = dojo._getContentBox(b, bs);
l = m.l - (bc.l - bm.l);
t = m.t - (bc.t - bm.t);
break;
}
this.marginBox.l = l - this.marginBox.l;
this.marginBox.t = t - this.marginBox.t;
if(h && h.onFirstMove){
h.onFirstMove(this, e);
}
dojo.disconnect(this.events.pop());
},
destroy: function(){
// summary:
// stops the move, deletes all references, so the object can be garbage-collected
dojo.forEach(this.events, dojo.disconnect);
// undo global settings
var h = this.host;
if(h && h.onMoveStop){
h.onMoveStop(this);
}
// destroy objects
this.events = this.node = this.host = null;
}
});
}

@ -5,235 +5,332 @@
*/
if(!dojo._hasResource["dojo.dnd.Selector"]){
dojo._hasResource["dojo.dnd.Selector"]=true;
if(!dojo._hasResource["dojo.dnd.Selector"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.dnd.Selector"] = true;
dojo.provide("dojo.dnd.Selector");
dojo.require("dojo.dnd.common");
dojo.require("dojo.dnd.Container");
dojo.declare("dojo.dnd.Selector",dojo.dnd.Container,{constructor:function(_1,_2){
if(!_2){
_2={};
}
this.singular=_2.singular;
this.autoSync=_2.autoSync;
this.selection={};
this.anchor=null;
this.simpleSelection=false;
this.events.push(dojo.connect(this.node,"onmousedown",this,"onMouseDown"),dojo.connect(this.node,"onmouseup",this,"onMouseUp"));
},singular:false,getSelectedNodes:function(){
var t=new dojo.NodeList();
var e=dojo.dnd._empty;
for(var i in this.selection){
if(i in e){
continue;
}
t.push(dojo.byId(i));
}
return t;
},selectNone:function(){
return this._removeSelection()._removeAnchor();
},selectAll:function(){
this.forInItems(function(_3,id){
this._addItemClass(dojo.byId(id),"Selected");
this.selection[id]=1;
},this);
return this._removeAnchor();
},deleteSelectedNodes:function(){
var e=dojo.dnd._empty;
for(var i in this.selection){
if(i in e){
continue;
}
var n=dojo.byId(i);
this.delItem(i);
dojo.destroy(n);
}
this.anchor=null;
this.selection={};
return this;
},forInSelectedItems:function(f,o){
o=o||dojo.global;
var s=this.selection,e=dojo.dnd._empty;
for(var i in s){
if(i in e){
continue;
}
f.call(o,this.getItem(i),i,this);
}
},sync:function(){
dojo.dnd.Selector.superclass.sync.call(this);
if(this.anchor){
if(!this.getItem(this.anchor.id)){
this.anchor=null;
}
}
var t=[],e=dojo.dnd._empty;
for(var i in this.selection){
if(i in e){
continue;
}
if(!this.getItem(i)){
t.push(i);
}
}
dojo.forEach(t,function(i){
delete this.selection[i];
},this);
return this;
},insertNodes:function(_4,_5,_6,_7){
var _8=this._normalizedCreator;
this._normalizedCreator=function(_9,_a){
var t=_8.call(this,_9,_a);
if(_4){
if(!this.anchor){
this.anchor=t.node;
this._removeItemClass(t.node,"Selected");
this._addItemClass(this.anchor,"Anchor");
}else{
if(this.anchor!=t.node){
this._removeItemClass(t.node,"Anchor");
this._addItemClass(t.node,"Selected");
}
}
this.selection[t.node.id]=1;
}else{
this._removeItemClass(t.node,"Selected");
this._removeItemClass(t.node,"Anchor");
}
return t;
};
dojo.dnd.Selector.superclass.insertNodes.call(this,_5,_6,_7);
this._normalizedCreator=_8;
return this;
},destroy:function(){
dojo.dnd.Selector.superclass.destroy.call(this);
this.selection=this.anchor=null;
},markupFactory:function(_b,_c){
_b._skipStartup=true;
return new dojo.dnd.Selector(_c,_b);
},onMouseDown:function(e){
if(this.autoSync){
this.sync();
}
if(!this.current){
return;
}
if(!this.singular&&!dojo.isCopyKey(e)&&!e.shiftKey&&(this.current.id in this.selection)){
this.simpleSelection=true;
if(e.button===dojo.mouseButtons.LEFT){
dojo.stopEvent(e);
}
return;
}
if(!this.singular&&e.shiftKey){
if(!dojo.isCopyKey(e)){
this._removeSelection();
}
var c=this.getAllNodes();
if(c.length){
if(!this.anchor){
this.anchor=c[0];
this._addItemClass(this.anchor,"Anchor");
}
this.selection[this.anchor.id]=1;
if(this.anchor!=this.current){
var i=0;
for(;i<c.length;++i){
var _d=c[i];
if(_d==this.anchor||_d==this.current){
break;
}
}
for(++i;i<c.length;++i){
var _d=c[i];
if(_d==this.anchor||_d==this.current){
break;
}
this._addItemClass(_d,"Selected");
this.selection[_d.id]=1;
}
this._addItemClass(this.current,"Selected");
this.selection[this.current.id]=1;
}
}
}else{
if(this.singular){
if(this.anchor==this.current){
if(dojo.isCopyKey(e)){
this.selectNone();
}
}else{
this.selectNone();
this.anchor=this.current;
this._addItemClass(this.anchor,"Anchor");
this.selection[this.current.id]=1;
}
}else{
if(dojo.isCopyKey(e)){
if(this.anchor==this.current){
delete this.selection[this.anchor.id];
this._removeAnchor();
}else{
if(this.current.id in this.selection){
this._removeItemClass(this.current,"Selected");
delete this.selection[this.current.id];
}else{
if(this.anchor){
this._removeItemClass(this.anchor,"Anchor");
this._addItemClass(this.anchor,"Selected");
}
this.anchor=this.current;
this._addItemClass(this.current,"Anchor");
this.selection[this.current.id]=1;
}
}
}else{
if(!(this.current.id in this.selection)){
this.selectNone();
this.anchor=this.current;
this._addItemClass(this.current,"Anchor");
this.selection[this.current.id]=1;
}
}
}
}
dojo.stopEvent(e);
},onMouseUp:function(e){
if(!this.simpleSelection){
return;
}
this.simpleSelection=false;
this.selectNone();
if(this.current){
this.anchor=this.current;
this._addItemClass(this.anchor,"Anchor");
this.selection[this.current.id]=1;
}
},onMouseMove:function(e){
this.simpleSelection=false;
},onOverEvent:function(){
this.onmousemoveEvent=dojo.connect(this.node,"onmousemove",this,"onMouseMove");
},onOutEvent:function(){
dojo.disconnect(this.onmousemoveEvent);
delete this.onmousemoveEvent;
},_removeSelection:function(){
var e=dojo.dnd._empty;
for(var i in this.selection){
if(i in e){
continue;
}
var _e=dojo.byId(i);
if(_e){
this._removeItemClass(_e,"Selected");
}
}
this.selection={};
return this;
},_removeAnchor:function(){
if(this.anchor){
this._removeItemClass(this.anchor,"Anchor");
this.anchor=null;
}
return this;
}});
/*
Container item states:
"" - an item is not selected
"Selected" - an item is selected
"Anchor" - an item is selected, and is an anchor for a "shift" selection
*/
/*=====
dojo.declare("dojo.dnd.__SelectorArgs", [dojo.dnd.__ContainerArgs], {
// singular: Boolean
// allows selection of only one element, if true
singular: false,
// autoSync: Boolean
// autosynchronizes the source with its list of DnD nodes,
autoSync: false
});
=====*/
dojo.declare("dojo.dnd.Selector", dojo.dnd.Container, {
// summary:
// a Selector object, which knows how to select its children
/*=====
// selection: Set<String>
// The set of id's that are currently selected, such that this.selection[id] == 1
// if the node w/that id is selected. Can iterate over selected node's id's like:
// | for(var id in this.selection)
selection: {},
=====*/
constructor: function(node, params){
// summary:
// constructor of the Selector
// node: Node||String
// node or node's id to build the selector on
// params: dojo.dnd.__SelectorArgs?
// a dictionary of parameters
if(!params){ params = {}; }
this.singular = params.singular;
this.autoSync = params.autoSync;
// class-specific variables
this.selection = {};
this.anchor = null;
this.simpleSelection = false;
// set up events
this.events.push(
dojo.connect(this.node, "onmousedown", this, "onMouseDown"),
dojo.connect(this.node, "onmouseup", this, "onMouseUp"));
},
// object attributes (for markup)
singular: false, // is singular property
// methods
getSelectedNodes: function(){
// summary:
// returns a list (an array) of selected nodes
var t = new dojo.NodeList();
var e = dojo.dnd._empty;
for(var i in this.selection){
if(i in e){ continue; }
t.push(dojo.byId(i));
}
return t; // NodeList
},
selectNone: function(){
// summary:
// unselects all items
return this._removeSelection()._removeAnchor(); // self
},
selectAll: function(){
// summary:
// selects all items
this.forInItems(function(data, id){
this._addItemClass(dojo.byId(id), "Selected");
this.selection[id] = 1;
}, this);
return this._removeAnchor(); // self
},
deleteSelectedNodes: function(){
// summary:
// deletes all selected items
var e = dojo.dnd._empty;
for(var i in this.selection){
if(i in e){ continue; }
var n = dojo.byId(i);
this.delItem(i);
dojo.destroy(n);
}
this.anchor = null;
this.selection = {};
return this; // self
},
forInSelectedItems: function(/*Function*/ f, /*Object?*/ o){
// summary:
// iterates over selected items;
// see `dojo.dnd.Container.forInItems()` for details
o = o || dojo.global;
var s = this.selection, e = dojo.dnd._empty;
for(var i in s){
if(i in e){ continue; }
f.call(o, this.getItem(i), i, this);
}
},
sync: function(){
// summary:
// sync up the node list with the data map
dojo.dnd.Selector.superclass.sync.call(this);
// fix the anchor
if(this.anchor){
if(!this.getItem(this.anchor.id)){
this.anchor = null;
}
}
// fix the selection
var t = [], e = dojo.dnd._empty;
for(var i in this.selection){
if(i in e){ continue; }
if(!this.getItem(i)){
t.push(i);
}
}
dojo.forEach(t, function(i){
delete this.selection[i];
}, this);
return this; // self
},
insertNodes: function(addSelected, data, before, anchor){
// summary:
// inserts new data items (see `dojo.dnd.Container.insertNodes()` method for details)
// addSelected: Boolean
// all new nodes will be added to selected items, if true, no selection change otherwise
// data: Array
// a list of data items, which should be processed by the creator function
// before: Boolean
// insert before the anchor, if true, and after the anchor otherwise
// anchor: Node
// the anchor node to be used as a point of insertion
var oldCreator = this._normalizedCreator;
this._normalizedCreator = function(item, hint){
var t = oldCreator.call(this, item, hint);
if(addSelected){
if(!this.anchor){
this.anchor = t.node;
this._removeItemClass(t.node, "Selected");
this._addItemClass(this.anchor, "Anchor");
}else if(this.anchor != t.node){
this._removeItemClass(t.node, "Anchor");
this._addItemClass(t.node, "Selected");
}
this.selection[t.node.id] = 1;
}else{
this._removeItemClass(t.node, "Selected");
this._removeItemClass(t.node, "Anchor");
}
return t;
};
dojo.dnd.Selector.superclass.insertNodes.call(this, data, before, anchor);
this._normalizedCreator = oldCreator;
return this; // self
},
destroy: function(){
// summary:
// prepares the object to be garbage-collected
dojo.dnd.Selector.superclass.destroy.call(this);
this.selection = this.anchor = null;
},
// markup methods
markupFactory: function(params, node){
params._skipStartup = true;
return new dojo.dnd.Selector(node, params);
},
// mouse events
onMouseDown: function(e){
// summary:
// event processor for onmousedown
// e: Event
// mouse event
if(this.autoSync){ this.sync(); }
if(!this.current){ return; }
if(!this.singular && !dojo.isCopyKey(e) && !e.shiftKey && (this.current.id in this.selection)){
this.simpleSelection = true;
if(e.button === dojo.mouseButtons.LEFT){
// accept the left button and stop the event
// for IE we don't stop event when multiple buttons are pressed
dojo.stopEvent(e);
}
return;
}
if(!this.singular && e.shiftKey){
if(!dojo.isCopyKey(e)){
this._removeSelection();
}
var c = this.getAllNodes();
if(c.length){
if(!this.anchor){
this.anchor = c[0];
this._addItemClass(this.anchor, "Anchor");
}
this.selection[this.anchor.id] = 1;
if(this.anchor != this.current){
var i = 0;
for(; i < c.length; ++i){
var node = c[i];
if(node == this.anchor || node == this.current){ break; }
}
for(++i; i < c.length; ++i){
var node = c[i];
if(node == this.anchor || node == this.current){ break; }
this._addItemClass(node, "Selected");
this.selection[node.id] = 1;
}
this._addItemClass(this.current, "Selected");
this.selection[this.current.id] = 1;
}
}
}else{
if(this.singular){
if(this.anchor == this.current){
if(dojo.isCopyKey(e)){
this.selectNone();
}
}else{
this.selectNone();
this.anchor = this.current;
this._addItemClass(this.anchor, "Anchor");
this.selection[this.current.id] = 1;
}
}else{
if(dojo.isCopyKey(e)){
if(this.anchor == this.current){
delete this.selection[this.anchor.id];
this._removeAnchor();
}else{
if(this.current.id in this.selection){
this._removeItemClass(this.current, "Selected");
delete this.selection[this.current.id];
}else{
if(this.anchor){
this._removeItemClass(this.anchor, "Anchor");
this._addItemClass(this.anchor, "Selected");
}
this.anchor = this.current;
this._addItemClass(this.current, "Anchor");
this.selection[this.current.id] = 1;
}
}
}else{
if(!(this.current.id in this.selection)){
this.selectNone();
this.anchor = this.current;
this._addItemClass(this.current, "Anchor");
this.selection[this.current.id] = 1;
}
}
}
}
dojo.stopEvent(e);
},
onMouseUp: function(e){
// summary:
// event processor for onmouseup
// e: Event
// mouse event
if(!this.simpleSelection){ return; }
this.simpleSelection = false;
this.selectNone();
if(this.current){
this.anchor = this.current;
this._addItemClass(this.anchor, "Anchor");
this.selection[this.current.id] = 1;
}
},
onMouseMove: function(e){
// summary
// event processor for onmousemove
// e: Event
// mouse event
this.simpleSelection = false;
},
// utilities
onOverEvent: function(){
// summary:
// this function is called once, when mouse is over our container
this.onmousemoveEvent = dojo.connect(this.node, "onmousemove", this, "onMouseMove");
},
onOutEvent: function(){
// summary:
// this function is called once, when mouse is out of our container
dojo.disconnect(this.onmousemoveEvent);
delete this.onmousemoveEvent;
},
_removeSelection: function(){
// summary:
// unselects all items
var e = dojo.dnd._empty;
for(var i in this.selection){
if(i in e){ continue; }
var node = dojo.byId(i);
if(node){ this._removeItemClass(node, "Selected"); }
}
this.selection = {};
return this; // self
},
_removeAnchor: function(){
if(this.anchor){
this._removeItemClass(this.anchor, "Anchor");
this.anchor = null;
}
return this; // self
}
});
}

@ -5,294 +5,545 @@
*/
if(!dojo._hasResource["dojo.dnd.Source"]){
dojo._hasResource["dojo.dnd.Source"]=true;
if(!dojo._hasResource["dojo.dnd.Source"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.dnd.Source"] = true;
dojo.provide("dojo.dnd.Source");
dojo.require("dojo.dnd.Selector");
dojo.require("dojo.dnd.Manager");
dojo.declare("dojo.dnd.Source",dojo.dnd.Selector,{isSource:true,horizontal:false,copyOnly:false,selfCopy:false,selfAccept:true,skipForm:false,withHandles:false,autoSync:false,delay:0,accept:["text"],generateText:true,constructor:function(_1,_2){
dojo.mixin(this,dojo.mixin({},_2));
var _3=this.accept;
if(_3.length){
this.accept={};
for(var i=0;i<_3.length;++i){
this.accept[_3[i]]=1;
}
}
this.isDragging=false;
this.mouseDown=false;
this.targetAnchor=null;
this.targetBox=null;
this.before=true;
this._lastX=0;
this._lastY=0;
this.sourceState="";
if(this.isSource){
dojo.addClass(this.node,"dojoDndSource");
}
this.targetState="";
if(this.accept){
dojo.addClass(this.node,"dojoDndTarget");
}
if(this.horizontal){
dojo.addClass(this.node,"dojoDndHorizontal");
}
this.topics=[dojo.subscribe("/dnd/source/over",this,"onDndSourceOver"),dojo.subscribe("/dnd/start",this,"onDndStart"),dojo.subscribe("/dnd/drop",this,"onDndDrop"),dojo.subscribe("/dnd/cancel",this,"onDndCancel")];
},checkAcceptance:function(_4,_5){
if(this==_4){
return !this.copyOnly||this.selfAccept;
}
for(var i=0;i<_5.length;++i){
var _6=_4.getItem(_5[i].id).type;
var _7=false;
for(var j=0;j<_6.length;++j){
if(_6[j] in this.accept){
_7=true;
break;
}
}
if(!_7){
return false;
}
}
return true;
},copyState:function(_8,_9){
if(_8){
return true;
}
if(arguments.length<2){
_9=this==dojo.dnd.manager().target;
}
if(_9){
if(this.copyOnly){
return this.selfCopy;
}
}else{
return this.copyOnly;
}
return false;
},destroy:function(){
dojo.dnd.Source.superclass.destroy.call(this);
dojo.forEach(this.topics,dojo.unsubscribe);
this.targetAnchor=null;
},markupFactory:function(_a,_b){
_a._skipStartup=true;
return new dojo.dnd.Source(_b,_a);
},onMouseMove:function(e){
if(this.isDragging&&this.targetState=="Disabled"){
return;
}
dojo.dnd.Source.superclass.onMouseMove.call(this,e);
var m=dojo.dnd.manager();
if(!this.isDragging){
if(this.mouseDown&&this.isSource&&(Math.abs(e.pageX-this._lastX)>this.delay||Math.abs(e.pageY-this._lastY)>this.delay)){
var _c=this.getSelectedNodes();
if(_c.length){
m.startDrag(this,_c,this.copyState(dojo.isCopyKey(e),true));
}
}
}
if(this.isDragging){
var _d=false;
if(this.current){
if(!this.targetBox||this.targetAnchor!=this.current){
this.targetBox=dojo.position(this.current,true);
}
if(this.horizontal){
_d=(e.pageX-this.targetBox.x)<(this.targetBox.w/2);
}else{
_d=(e.pageY-this.targetBox.y)<(this.targetBox.h/2);
}
}
if(this.current!=this.targetAnchor||_d!=this.before){
this._markTargetAnchor(_d);
m.canDrop(!this.current||m.source!=this||!(this.current.id in this.selection));
}
}
},onMouseDown:function(e){
if(!this.mouseDown&&this._legalMouseDown(e)&&(!this.skipForm||!dojo.dnd.isFormElement(e))){
this.mouseDown=true;
this._lastX=e.pageX;
this._lastY=e.pageY;
dojo.dnd.Source.superclass.onMouseDown.call(this,e);
}
},onMouseUp:function(e){
if(this.mouseDown){
this.mouseDown=false;
dojo.dnd.Source.superclass.onMouseUp.call(this,e);
}
},onDndSourceOver:function(_e){
if(this!=_e){
this.mouseDown=false;
if(this.targetAnchor){
this._unmarkTargetAnchor();
}
}else{
if(this.isDragging){
var m=dojo.dnd.manager();
m.canDrop(this.targetState!="Disabled"&&(!this.current||m.source!=this||!(this.current.id in this.selection)));
}
}
},onDndStart:function(_f,_10,_11){
if(this.autoSync){
this.sync();
}
if(this.isSource){
this._changeState("Source",this==_f?(_11?"Copied":"Moved"):"");
}
var _12=this.accept&&this.checkAcceptance(_f,_10);
this._changeState("Target",_12?"":"Disabled");
if(this==_f){
dojo.dnd.manager().overSource(this);
}
this.isDragging=true;
},onDndDrop:function(_13,_14,_15,_16){
if(this==_16){
this.onDrop(_13,_14,_15);
}
this.onDndCancel();
},onDndCancel:function(){
if(this.targetAnchor){
this._unmarkTargetAnchor();
this.targetAnchor=null;
}
this.before=true;
this.isDragging=false;
this.mouseDown=false;
this._changeState("Source","");
this._changeState("Target","");
},onDrop:function(_17,_18,_19){
if(this!=_17){
this.onDropExternal(_17,_18,_19);
}else{
this.onDropInternal(_18,_19);
}
},onDropExternal:function(_1a,_1b,_1c){
var _1d=this._normalizedCreator;
if(this.creator){
this._normalizedCreator=function(_1e,_1f){
return _1d.call(this,_1a.getItem(_1e.id).data,_1f);
};
}else{
if(_1c){
this._normalizedCreator=function(_20,_21){
var t=_1a.getItem(_20.id);
var n=_20.cloneNode(true);
n.id=dojo.dnd.getUniqueId();
return {node:n,data:t.data,type:t.type};
};
}else{
this._normalizedCreator=function(_22,_23){
var t=_1a.getItem(_22.id);
_1a.delItem(_22.id);
return {node:_22,data:t.data,type:t.type};
};
}
}
this.selectNone();
if(!_1c&&!this.creator){
_1a.selectNone();
}
this.insertNodes(true,_1b,this.before,this.current);
if(!_1c&&this.creator){
_1a.deleteSelectedNodes();
}
this._normalizedCreator=_1d;
},onDropInternal:function(_24,_25){
var _26=this._normalizedCreator;
if(this.current&&this.current.id in this.selection){
return;
}
if(_25){
if(this.creator){
this._normalizedCreator=function(_27,_28){
return _26.call(this,this.getItem(_27.id).data,_28);
};
}else{
this._normalizedCreator=function(_29,_2a){
var t=this.getItem(_29.id);
var n=_29.cloneNode(true);
n.id=dojo.dnd.getUniqueId();
return {node:n,data:t.data,type:t.type};
};
}
}else{
if(!this.current){
return;
}
this._normalizedCreator=function(_2b,_2c){
var t=this.getItem(_2b.id);
return {node:_2b,data:t.data,type:t.type};
};
}
this._removeSelection();
this.insertNodes(true,_24,this.before,this.current);
this._normalizedCreator=_26;
},onDraggingOver:function(){
},onDraggingOut:function(){
},onOverEvent:function(){
dojo.dnd.Source.superclass.onOverEvent.call(this);
dojo.dnd.manager().overSource(this);
if(this.isDragging&&this.targetState!="Disabled"){
this.onDraggingOver();
}
},onOutEvent:function(){
dojo.dnd.Source.superclass.onOutEvent.call(this);
dojo.dnd.manager().outSource(this);
if(this.isDragging&&this.targetState!="Disabled"){
this.onDraggingOut();
}
},_markTargetAnchor:function(_2d){
if(this.current==this.targetAnchor&&this.before==_2d){
return;
}
if(this.targetAnchor){
this._removeItemClass(this.targetAnchor,this.before?"Before":"After");
}
this.targetAnchor=this.current;
this.targetBox=null;
this.before=_2d;
if(this.targetAnchor){
this._addItemClass(this.targetAnchor,this.before?"Before":"After");
}
},_unmarkTargetAnchor:function(){
if(!this.targetAnchor){
return;
}
this._removeItemClass(this.targetAnchor,this.before?"Before":"After");
this.targetAnchor=null;
this.targetBox=null;
this.before=true;
},_markDndStatus:function(_2e){
this._changeState("Source",_2e?"Copied":"Moved");
},_legalMouseDown:function(e){
if(!dojo.mouseButtons.isLeft(e)){
return false;
}
if(!this.withHandles){
return true;
}
for(var _2f=e.target;_2f&&_2f!==this.node;_2f=_2f.parentNode){
if(dojo.hasClass(_2f,"dojoDndHandle")){
return true;
}
if(dojo.hasClass(_2f,"dojoDndItem")||dojo.hasClass(_2f,"dojoDndIgnore")){
break;
}
}
return false;
}});
dojo.declare("dojo.dnd.Target",dojo.dnd.Source,{constructor:function(_30,_31){
this.isSource=false;
dojo.removeClass(this.node,"dojoDndSource");
},markupFactory:function(_32,_33){
_32._skipStartup=true;
return new dojo.dnd.Target(_33,_32);
}});
dojo.declare("dojo.dnd.AutoSource",dojo.dnd.Source,{constructor:function(_34,_35){
this.autoSync=true;
},markupFactory:function(_36,_37){
_36._skipStartup=true;
return new dojo.dnd.AutoSource(_37,_36);
}});
/*
Container property:
"Horizontal"- if this is the horizontal container
Source states:
"" - normal state
"Moved" - this source is being moved
"Copied" - this source is being copied
Target states:
"" - normal state
"Disabled" - the target cannot accept an avatar
Target anchor state:
"" - item is not selected
"Before" - insert point is before the anchor
"After" - insert point is after the anchor
*/
/*=====
dojo.dnd.__SourceArgs = function(){
// summary:
// a dict of parameters for DnD Source configuration. Note that any
// property on Source elements may be configured, but this is the
// short-list
// isSource: Boolean?
// can be used as a DnD source. Defaults to true.
// accept: Array?
// list of accepted types (text strings) for a target; defaults to
// ["text"]
// autoSync: Boolean
// if true refreshes the node list on every operation; false by default
// copyOnly: Boolean?
// copy items, if true, use a state of Ctrl key otherwise,
// see selfCopy and selfAccept for more details
// delay: Number
// the move delay in pixels before detecting a drag; 0 by default
// horizontal: Boolean?
// a horizontal container, if true, vertical otherwise or when omitted
// selfCopy: Boolean?
// copy items by default when dropping on itself,
// false by default, works only if copyOnly is true
// selfAccept: Boolean?
// accept its own items when copyOnly is true,
// true by default, works only if copyOnly is true
// withHandles: Boolean?
// allows dragging only by handles, false by default
// generateText: Boolean?
// generate text node for drag and drop, true by default
this.isSource = isSource;
this.accept = accept;
this.autoSync = autoSync;
this.copyOnly = copyOnly;
this.delay = delay;
this.horizontal = horizontal;
this.selfCopy = selfCopy;
this.selfAccept = selfAccept;
this.withHandles = withHandles;
this.generateText = true;
}
=====*/
dojo.declare("dojo.dnd.Source", dojo.dnd.Selector, {
// summary:
// a Source object, which can be used as a DnD source, or a DnD target
// object attributes (for markup)
isSource: true,
horizontal: false,
copyOnly: false,
selfCopy: false,
selfAccept: true,
skipForm: false,
withHandles: false,
autoSync: false,
delay: 0, // pixels
accept: ["text"],
generateText: true,
constructor: function(/*DOMNode|String*/node, /*dojo.dnd.__SourceArgs?*/params){
// summary:
// a constructor of the Source
// node:
// node or node's id to build the source on
// params:
// any property of this class may be configured via the params
// object which is mixed-in to the `dojo.dnd.Source` instance
dojo.mixin(this, dojo.mixin({}, params));
var type = this.accept;
if(type.length){
this.accept = {};
for(var i = 0; i < type.length; ++i){
this.accept[type[i]] = 1;
}
}
// class-specific variables
this.isDragging = false;
this.mouseDown = false;
this.targetAnchor = null;
this.targetBox = null;
this.before = true;
this._lastX = 0;
this._lastY = 0;
// states
this.sourceState = "";
if(this.isSource){
dojo.addClass(this.node, "dojoDndSource");
}
this.targetState = "";
if(this.accept){
dojo.addClass(this.node, "dojoDndTarget");
}
if(this.horizontal){
dojo.addClass(this.node, "dojoDndHorizontal");
}
// set up events
this.topics = [
dojo.subscribe("/dnd/source/over", this, "onDndSourceOver"),
dojo.subscribe("/dnd/start", this, "onDndStart"),
dojo.subscribe("/dnd/drop", this, "onDndDrop"),
dojo.subscribe("/dnd/cancel", this, "onDndCancel")
];
},
// methods
checkAcceptance: function(source, nodes){
// summary:
// checks if the target can accept nodes from this source
// source: Object
// the source which provides items
// nodes: Array
// the list of transferred items
if(this == source){
return !this.copyOnly || this.selfAccept;
}
for(var i = 0; i < nodes.length; ++i){
var type = source.getItem(nodes[i].id).type;
// type instanceof Array
var flag = false;
for(var j = 0; j < type.length; ++j){
if(type[j] in this.accept){
flag = true;
break;
}
}
if(!flag){
return false; // Boolean
}
}
return true; // Boolean
},
copyState: function(keyPressed, self){
// summary:
// Returns true if we need to copy items, false to move.
// It is separated to be overwritten dynamically, if needed.
// keyPressed: Boolean
// the "copy" key was pressed
// self: Boolean?
// optional flag that means that we are about to drop on itself
if(keyPressed){ return true; }
if(arguments.length < 2){
self = this == dojo.dnd.manager().target;
}
if(self){
if(this.copyOnly){
return this.selfCopy;
}
}else{
return this.copyOnly;
}
return false; // Boolean
},
destroy: function(){
// summary:
// prepares the object to be garbage-collected
dojo.dnd.Source.superclass.destroy.call(this);
dojo.forEach(this.topics, dojo.unsubscribe);
this.targetAnchor = null;
},
// markup methods
markupFactory: function(params, node){
params._skipStartup = true;
return new dojo.dnd.Source(node, params);
},
// mouse event processors
onMouseMove: function(e){
// summary:
// event processor for onmousemove
// e: Event
// mouse event
if(this.isDragging && this.targetState == "Disabled"){ return; }
dojo.dnd.Source.superclass.onMouseMove.call(this, e);
var m = dojo.dnd.manager();
if(!this.isDragging){
if(this.mouseDown && this.isSource &&
(Math.abs(e.pageX - this._lastX) > this.delay || Math.abs(e.pageY - this._lastY) > this.delay)){
var nodes = this.getSelectedNodes();
if(nodes.length){
m.startDrag(this, nodes, this.copyState(dojo.isCopyKey(e), true));
}
}
}
if(this.isDragging){
// calculate before/after
var before = false;
if(this.current){
if(!this.targetBox || this.targetAnchor != this.current){
this.targetBox = dojo.position(this.current, true);
}
if(this.horizontal){
before = (e.pageX - this.targetBox.x) < (this.targetBox.w / 2);
}else{
before = (e.pageY - this.targetBox.y) < (this.targetBox.h / 2);
}
}
if(this.current != this.targetAnchor || before != this.before){
this._markTargetAnchor(before);
m.canDrop(!this.current || m.source != this || !(this.current.id in this.selection));
}
}
},
onMouseDown: function(e){
// summary:
// event processor for onmousedown
// e: Event
// mouse event
if(!this.mouseDown && this._legalMouseDown(e) && (!this.skipForm || !dojo.dnd.isFormElement(e))){
this.mouseDown = true;
this._lastX = e.pageX;
this._lastY = e.pageY;
dojo.dnd.Source.superclass.onMouseDown.call(this, e);
}
},
onMouseUp: function(e){
// summary:
// event processor for onmouseup
// e: Event
// mouse event
if(this.mouseDown){
this.mouseDown = false;
dojo.dnd.Source.superclass.onMouseUp.call(this, e);
}
},
// topic event processors
onDndSourceOver: function(source){
// summary:
// topic event processor for /dnd/source/over, called when detected a current source
// source: Object
// the source which has the mouse over it
if(this != source){
this.mouseDown = false;
if(this.targetAnchor){
this._unmarkTargetAnchor();
}
}else if(this.isDragging){
var m = dojo.dnd.manager();
m.canDrop(this.targetState != "Disabled" && (!this.current || m.source != this || !(this.current.id in this.selection)));
}
},
onDndStart: function(source, nodes, copy){
// summary:
// topic event processor for /dnd/start, called to initiate the DnD operation
// source: Object
// the source which provides items
// nodes: Array
// the list of transferred items
// copy: Boolean
// copy items, if true, move items otherwise
if(this.autoSync){ this.sync(); }
if(this.isSource){
this._changeState("Source", this == source ? (copy ? "Copied" : "Moved") : "");
}
var accepted = this.accept && this.checkAcceptance(source, nodes);
this._changeState("Target", accepted ? "" : "Disabled");
if(this == source){
dojo.dnd.manager().overSource(this);
}
this.isDragging = true;
},
onDndDrop: function(source, nodes, copy, target){
// summary:
// topic event processor for /dnd/drop, called to finish the DnD operation
// source: Object
// the source which provides items
// nodes: Array
// the list of transferred items
// copy: Boolean
// copy items, if true, move items otherwise
// target: Object
// the target which accepts items
if(this == target){
// this one is for us => move nodes!
this.onDrop(source, nodes, copy);
}
this.onDndCancel();
},
onDndCancel: function(){
// summary:
// topic event processor for /dnd/cancel, called to cancel the DnD operation
if(this.targetAnchor){
this._unmarkTargetAnchor();
this.targetAnchor = null;
}
this.before = true;
this.isDragging = false;
this.mouseDown = false;
this._changeState("Source", "");
this._changeState("Target", "");
},
// local events
onDrop: function(source, nodes, copy){
// summary:
// called only on the current target, when drop is performed
// source: Object
// the source which provides items
// nodes: Array
// the list of transferred items
// copy: Boolean
// copy items, if true, move items otherwise
if(this != source){
this.onDropExternal(source, nodes, copy);
}else{
this.onDropInternal(nodes, copy);
}
},
onDropExternal: function(source, nodes, copy){
// summary:
// called only on the current target, when drop is performed
// from an external source
// source: Object
// the source which provides items
// nodes: Array
// the list of transferred items
// copy: Boolean
// copy items, if true, move items otherwise
var oldCreator = this._normalizedCreator;
// transferring nodes from the source to the target
if(this.creator){
// use defined creator
this._normalizedCreator = function(node, hint){
return oldCreator.call(this, source.getItem(node.id).data, hint);
};
}else{
// we have no creator defined => move/clone nodes
if(copy){
// clone nodes
this._normalizedCreator = function(node, hint){
var t = source.getItem(node.id);
var n = node.cloneNode(true);
n.id = dojo.dnd.getUniqueId();
return {node: n, data: t.data, type: t.type};
};
}else{
// move nodes
this._normalizedCreator = function(node, hint){
var t = source.getItem(node.id);
source.delItem(node.id);
return {node: node, data: t.data, type: t.type};
};
}
}
this.selectNone();
if(!copy && !this.creator){
source.selectNone();
}
this.insertNodes(true, nodes, this.before, this.current);
if(!copy && this.creator){
source.deleteSelectedNodes();
}
this._normalizedCreator = oldCreator;
},
onDropInternal: function(nodes, copy){
// summary:
// called only on the current target, when drop is performed
// from the same target/source
// nodes: Array
// the list of transferred items
// copy: Boolean
// copy items, if true, move items otherwise
var oldCreator = this._normalizedCreator;
// transferring nodes within the single source
if(this.current && this.current.id in this.selection){
// do nothing
return;
}
if(copy){
if(this.creator){
// create new copies of data items
this._normalizedCreator = function(node, hint){
return oldCreator.call(this, this.getItem(node.id).data, hint);
};
}else{
// clone nodes
this._normalizedCreator = function(node, hint){
var t = this.getItem(node.id);
var n = node.cloneNode(true);
n.id = dojo.dnd.getUniqueId();
return {node: n, data: t.data, type: t.type};
};
}
}else{
// move nodes
if(!this.current){
// do nothing
return;
}
this._normalizedCreator = function(node, hint){
var t = this.getItem(node.id);
return {node: node, data: t.data, type: t.type};
};
}
this._removeSelection();
this.insertNodes(true, nodes, this.before, this.current);
this._normalizedCreator = oldCreator;
},
onDraggingOver: function(){
// summary:
// called during the active DnD operation, when items
// are dragged over this target, and it is not disabled
},
onDraggingOut: function(){
// summary:
// called during the active DnD operation, when items
// are dragged away from this target, and it is not disabled
},
// utilities
onOverEvent: function(){
// summary:
// this function is called once, when mouse is over our container
dojo.dnd.Source.superclass.onOverEvent.call(this);
dojo.dnd.manager().overSource(this);
if(this.isDragging && this.targetState != "Disabled"){
this.onDraggingOver();
}
},
onOutEvent: function(){
// summary:
// this function is called once, when mouse is out of our container
dojo.dnd.Source.superclass.onOutEvent.call(this);
dojo.dnd.manager().outSource(this);
if(this.isDragging && this.targetState != "Disabled"){
this.onDraggingOut();
}
},
_markTargetAnchor: function(before){
// summary:
// assigns a class to the current target anchor based on "before" status
// before: Boolean
// insert before, if true, after otherwise
if(this.current == this.targetAnchor && this.before == before){ return; }
if(this.targetAnchor){
this._removeItemClass(this.targetAnchor, this.before ? "Before" : "After");
}
this.targetAnchor = this.current;
this.targetBox = null;
this.before = before;
if(this.targetAnchor){
this._addItemClass(this.targetAnchor, this.before ? "Before" : "After");
}
},
_unmarkTargetAnchor: function(){
// summary:
// removes a class of the current target anchor based on "before" status
if(!this.targetAnchor){ return; }
this._removeItemClass(this.targetAnchor, this.before ? "Before" : "After");
this.targetAnchor = null;
this.targetBox = null;
this.before = true;
},
_markDndStatus: function(copy){
// summary:
// changes source's state based on "copy" status
this._changeState("Source", copy ? "Copied" : "Moved");
},
_legalMouseDown: function(e){
// summary:
// checks if user clicked on "approved" items
// e: Event
// mouse event
// accept only the left mouse button
if(!dojo.mouseButtons.isLeft(e)){ return false; }
if(!this.withHandles){ return true; }
// check for handles
for(var node = e.target; node && node !== this.node; node = node.parentNode){
if(dojo.hasClass(node, "dojoDndHandle")){ return true; }
if(dojo.hasClass(node, "dojoDndItem") || dojo.hasClass(node, "dojoDndIgnore")){ break; }
}
return false; // Boolean
}
});
dojo.declare("dojo.dnd.Target", dojo.dnd.Source, {
// summary: a Target object, which can be used as a DnD target
constructor: function(node, params){
// summary:
// a constructor of the Target --- see the `dojo.dnd.Source.constructor` for details
this.isSource = false;
dojo.removeClass(this.node, "dojoDndSource");
},
// markup methods
markupFactory: function(params, node){
params._skipStartup = true;
return new dojo.dnd.Target(node, params);
}
});
dojo.declare("dojo.dnd.AutoSource", dojo.dnd.Source, {
// summary:
// a source that syncs its DnD nodes by default
constructor: function(node, params){
// summary:
// constructor of the AutoSource --- see the Source constructor for details
this.autoSync = true;
},
// markup methods
markupFactory: function(params, node){
params._skipStartup = true;
return new dojo.dnd.AutoSource(node, params);
}
});
}

@ -5,36 +5,77 @@
*/
if(!dojo._hasResource["dojo.dnd.TimedMoveable"]){
dojo._hasResource["dojo.dnd.TimedMoveable"]=true;
if(!dojo._hasResource["dojo.dnd.TimedMoveable"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.dnd.TimedMoveable"] = true;
dojo.provide("dojo.dnd.TimedMoveable");
dojo.require("dojo.dnd.Moveable");
/*=====
dojo.declare("dojo.dnd.__TimedMoveableArgs", [dojo.dnd.__MoveableArgs], {
// timeout: Number
// delay move by this number of ms,
// accumulating position changes during the timeout
timeout: 0
});
=====*/
(function(){
var _1=dojo.dnd.Moveable.prototype.onMove;
dojo.declare("dojo.dnd.TimedMoveable",dojo.dnd.Moveable,{timeout:40,constructor:function(_2,_3){
if(!_3){
_3={};
}
if(_3.timeout&&typeof _3.timeout=="number"&&_3.timeout>=0){
this.timeout=_3.timeout;
}
},markupFactory:function(_4,_5){
return new dojo.dnd.TimedMoveable(_5,_4);
},onMoveStop:function(_6){
if(_6._timer){
clearTimeout(_6._timer);
_1.call(this,_6,_6._leftTop);
}
dojo.dnd.Moveable.prototype.onMoveStop.apply(this,arguments);
},onMove:function(_7,_8){
_7._leftTop=_8;
if(!_7._timer){
var _9=this;
_7._timer=setTimeout(function(){
_7._timer=null;
_1.call(_9,_7,_7._leftTop);
},this.timeout);
}
}});
// precalculate long expressions
var oldOnMove = dojo.dnd.Moveable.prototype.onMove;
dojo.declare("dojo.dnd.TimedMoveable", dojo.dnd.Moveable, {
// summary:
// A specialized version of Moveable to support an FPS throttling.
// This class puts an upper restriction on FPS, which may reduce
// the CPU load. The additional parameter "timeout" regulates
// the delay before actually moving the moveable object.
// object attributes (for markup)
timeout: 40, // in ms, 40ms corresponds to 25 fps
constructor: function(node, params){
// summary:
// an object that makes a node moveable with a timer
// node: Node||String
// a node (or node's id) to be moved
// params: dojo.dnd.__TimedMoveableArgs
// object with additional parameters.
// sanitize parameters
if(!params){ params = {}; }
if(params.timeout && typeof params.timeout == "number" && params.timeout >= 0){
this.timeout = params.timeout;
}
},
// markup methods
markupFactory: function(params, node){
return new dojo.dnd.TimedMoveable(node, params);
},
onMoveStop: function(/* dojo.dnd.Mover */ mover){
if(mover._timer){
// stop timer
clearTimeout(mover._timer)
// reflect the last received position
oldOnMove.call(this, mover, mover._leftTop)
}
dojo.dnd.Moveable.prototype.onMoveStop.apply(this, arguments);
},
onMove: function(/* dojo.dnd.Mover */ mover, /* Object */ leftTop){
mover._leftTop = leftTop;
if(!mover._timer){
var _t = this; // to avoid using dojo.hitch()
mover._timer = setTimeout(function(){
// we don't have any pending requests
mover._timer = null;
// reflect the last received position
oldOnMove.call(_t, mover, mover._leftTop);
}, this.timeout);
}
}
});
})();
}

@ -5,95 +5,112 @@
*/
if(!dojo._hasResource["dojo.dnd.autoscroll"]){
dojo._hasResource["dojo.dnd.autoscroll"]=true;
if(!dojo._hasResource["dojo.dnd.autoscroll"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.dnd.autoscroll"] = true;
dojo.provide("dojo.dnd.autoscroll");
dojo.dnd.getViewport=function(){
var d=dojo.doc,dd=d.documentElement,w=window,b=dojo.body();
if(dojo.isMozilla){
return {w:dd.clientWidth,h:w.innerHeight};
}else{
if(!dojo.isOpera&&w.innerWidth){
return {w:w.innerWidth,h:w.innerHeight};
}else{
if(!dojo.isOpera&&dd&&dd.clientWidth){
return {w:dd.clientWidth,h:dd.clientHeight};
}else{
if(b.clientWidth){
return {w:b.clientWidth,h:b.clientHeight};
}
}
}
}
return null;
dojo.dnd.getViewport = function(){
// summary:
// Returns a viewport size (visible part of the window)
// TODO: remove this when getViewport() moved to dojo core, see #7028
// FIXME: need more docs!!
var d = dojo.doc, dd = d.documentElement, w = window, b = dojo.body();
if(dojo.isMozilla){
return {w: dd.clientWidth, h: w.innerHeight}; // Object
}else if(!dojo.isOpera && w.innerWidth){
return {w: w.innerWidth, h: w.innerHeight}; // Object
}else if (!dojo.isOpera && dd && dd.clientWidth){
return {w: dd.clientWidth, h: dd.clientHeight}; // Object
}else if (b.clientWidth){
return {w: b.clientWidth, h: b.clientHeight}; // Object
}
return null; // Object
};
dojo.dnd.V_TRIGGER_AUTOSCROLL=32;
dojo.dnd.H_TRIGGER_AUTOSCROLL=32;
dojo.dnd.V_AUTOSCROLL_VALUE=16;
dojo.dnd.H_AUTOSCROLL_VALUE=16;
dojo.dnd.autoScroll=function(e){
var v=dojo.dnd.getViewport(),dx=0,dy=0;
if(e.clientX<dojo.dnd.H_TRIGGER_AUTOSCROLL){
dx=-dojo.dnd.H_AUTOSCROLL_VALUE;
}else{
if(e.clientX>v.w-dojo.dnd.H_TRIGGER_AUTOSCROLL){
dx=dojo.dnd.H_AUTOSCROLL_VALUE;
}
}
if(e.clientY<dojo.dnd.V_TRIGGER_AUTOSCROLL){
dy=-dojo.dnd.V_AUTOSCROLL_VALUE;
}else{
if(e.clientY>v.h-dojo.dnd.V_TRIGGER_AUTOSCROLL){
dy=dojo.dnd.V_AUTOSCROLL_VALUE;
}
}
window.scrollBy(dx,dy);
dojo.dnd.V_TRIGGER_AUTOSCROLL = 32;
dojo.dnd.H_TRIGGER_AUTOSCROLL = 32;
dojo.dnd.V_AUTOSCROLL_VALUE = 16;
dojo.dnd.H_AUTOSCROLL_VALUE = 16;
dojo.dnd.autoScroll = function(e){
// summary:
// a handler for onmousemove event, which scrolls the window, if
// necesary
// e: Event
// onmousemove event
// FIXME: needs more docs!
var v = dojo.dnd.getViewport(), dx = 0, dy = 0;
if(e.clientX < dojo.dnd.H_TRIGGER_AUTOSCROLL){
dx = -dojo.dnd.H_AUTOSCROLL_VALUE;
}else if(e.clientX > v.w - dojo.dnd.H_TRIGGER_AUTOSCROLL){
dx = dojo.dnd.H_AUTOSCROLL_VALUE;
}
if(e.clientY < dojo.dnd.V_TRIGGER_AUTOSCROLL){
dy = -dojo.dnd.V_AUTOSCROLL_VALUE;
}else if(e.clientY > v.h - dojo.dnd.V_TRIGGER_AUTOSCROLL){
dy = dojo.dnd.V_AUTOSCROLL_VALUE;
}
window.scrollBy(dx, dy);
};
dojo.dnd._validNodes={"div":1,"p":1,"td":1};
dojo.dnd._validOverflow={"auto":1,"scroll":1};
dojo.dnd.autoScrollNodes=function(e){
for(var n=e.target;n;){
if(n.nodeType==1&&(n.tagName.toLowerCase() in dojo.dnd._validNodes)){
var s=dojo.getComputedStyle(n);
if(s.overflow.toLowerCase() in dojo.dnd._validOverflow){
var b=dojo._getContentBox(n,s),t=dojo.position(n,true);
var w=Math.min(dojo.dnd.H_TRIGGER_AUTOSCROLL,b.w/2),h=Math.min(dojo.dnd.V_TRIGGER_AUTOSCROLL,b.h/2),rx=e.pageX-t.x,ry=e.pageY-t.y,dx=0,dy=0;
if(dojo.isWebKit||dojo.isOpera){
rx+=dojo.body().scrollLeft,ry+=dojo.body().scrollTop;
}
if(rx>0&&rx<b.w){
if(rx<w){
dx=-w;
}else{
if(rx>b.w-w){
dx=w;
}
}
}
if(ry>0&&ry<b.h){
if(ry<h){
dy=-h;
}else{
if(ry>b.h-h){
dy=h;
}
}
}
var _1=n.scrollLeft,_2=n.scrollTop;
n.scrollLeft=n.scrollLeft+dx;
n.scrollTop=n.scrollTop+dy;
if(_1!=n.scrollLeft||_2!=n.scrollTop){
return;
}
}
}
try{
n=n.parentNode;
}
catch(x){
n=null;
}
}
dojo.dnd.autoScroll(e);
dojo.dnd._validNodes = {"div": 1, "p": 1, "td": 1};
dojo.dnd._validOverflow = {"auto": 1, "scroll": 1};
dojo.dnd.autoScrollNodes = function(e){
// summary:
// a handler for onmousemove event, which scrolls the first avaialble
// Dom element, it falls back to dojo.dnd.autoScroll()
// e: Event
// onmousemove event
// FIXME: needs more docs!
for(var n = e.target; n;){
if(n.nodeType == 1 && (n.tagName.toLowerCase() in dojo.dnd._validNodes)){
var s = dojo.getComputedStyle(n);
if(s.overflow.toLowerCase() in dojo.dnd._validOverflow){
var b = dojo._getContentBox(n, s), t = dojo.position(n, true);
//console.log(b.l, b.t, t.x, t.y, n.scrollLeft, n.scrollTop);
var w = Math.min(dojo.dnd.H_TRIGGER_AUTOSCROLL, b.w / 2),
h = Math.min(dojo.dnd.V_TRIGGER_AUTOSCROLL, b.h / 2),
rx = e.pageX - t.x, ry = e.pageY - t.y, dx = 0, dy = 0;
if(dojo.isWebKit || dojo.isOpera){
// FIXME: this code should not be here, it should be taken into account
// either by the event fixing code, or the dojo.position()
// FIXME: this code doesn't work on Opera 9.5 Beta
rx += dojo.body().scrollLeft, ry += dojo.body().scrollTop;
}
if(rx > 0 && rx < b.w){
if(rx < w){
dx = -w;
}else if(rx > b.w - w){
dx = w;
}
}
//console.log("ry =", ry, "b.h =", b.h, "h =", h);
if(ry > 0 && ry < b.h){
if(ry < h){
dy = -h;
}else if(ry > b.h - h){
dy = h;
}
}
var oldLeft = n.scrollLeft, oldTop = n.scrollTop;
n.scrollLeft = n.scrollLeft + dx;
n.scrollTop = n.scrollTop + dy;
if(oldLeft != n.scrollLeft || oldTop != n.scrollTop){ return; }
}
}
try{
n = n.parentNode;
}catch(x){
n = null;
}
}
dojo.dnd.autoScroll(e);
};
}

@ -5,24 +5,33 @@
*/
if(!dojo._hasResource["dojo.dnd.common"]){
dojo._hasResource["dojo.dnd.common"]=true;
if(!dojo._hasResource["dojo.dnd.common"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.dnd.common"] = true;
dojo.provide("dojo.dnd.common");
dojo.dnd.getCopyKeyState=dojo.isCopyKey;
dojo.dnd._uniqueId=0;
dojo.dnd.getUniqueId=function(){
var id;
do{
id=dojo._scopeName+"Unique"+(++dojo.dnd._uniqueId);
}while(dojo.byId(id));
return id;
dojo.dnd.getCopyKeyState = dojo.isCopyKey;
dojo.dnd._uniqueId = 0;
dojo.dnd.getUniqueId = function(){
// summary:
// returns a unique string for use with any DOM element
var id;
do{
id = dojo._scopeName + "Unique" + (++dojo.dnd._uniqueId);
}while(dojo.byId(id));
return id;
};
dojo.dnd._empty={};
dojo.dnd.isFormElement=function(e){
var t=e.target;
if(t.nodeType==3){
t=t.parentNode;
}
return " button textarea input select option ".indexOf(" "+t.tagName.toLowerCase()+" ")>=0;
dojo.dnd._empty = {};
dojo.dnd.isFormElement = function(/*Event*/ e){
// summary:
// returns true if user clicked on a form element
var t = e.target;
if(t.nodeType == 3 /*TEXT_NODE*/){
t = t.parentNode;
}
return " button textarea input select option ".indexOf(" " + t.tagName.toLowerCase() + " ") >= 0; // Boolean
};
}

@ -5,121 +5,250 @@
*/
if(!dojo._hasResource["dojo.dnd.move"]){
dojo._hasResource["dojo.dnd.move"]=true;
if(!dojo._hasResource["dojo.dnd.move"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.dnd.move"] = true;
dojo.provide("dojo.dnd.move");
dojo.require("dojo.dnd.Mover");
dojo.require("dojo.dnd.Moveable");
dojo.declare("dojo.dnd.move.constrainedMoveable",dojo.dnd.Moveable,{constraints:function(){
},within:false,markupFactory:function(_1,_2){
return new dojo.dnd.move.constrainedMoveable(_2,_1);
},constructor:function(_3,_4){
if(!_4){
_4={};
}
this.constraints=_4.constraints;
this.within=_4.within;
},onFirstMove:function(_5){
var c=this.constraintBox=this.constraints.call(this,_5);
c.r=c.l+c.w;
c.b=c.t+c.h;
if(this.within){
var mb=dojo.marginBox(_5.node);
c.r-=mb.w;
c.b-=mb.h;
}
},onMove:function(_6,_7){
var c=this.constraintBox,s=_6.node.style;
s.left=(_7.l<c.l?c.l:c.r<_7.l?c.r:_7.l)+"px";
s.top=(_7.t<c.t?c.t:c.b<_7.t?c.b:_7.t)+"px";
}});
dojo.declare("dojo.dnd.move.boxConstrainedMoveable",dojo.dnd.move.constrainedMoveable,{box:{},markupFactory:function(_8,_9){
return new dojo.dnd.move.boxConstrainedMoveable(_9,_8);
},constructor:function(_a,_b){
var _c=_b&&_b.box;
this.constraints=function(){
return _c;
};
}});
dojo.declare("dojo.dnd.move.parentConstrainedMoveable",dojo.dnd.move.constrainedMoveable,{area:"content",markupFactory:function(_d,_e){
return new dojo.dnd.move.parentConstrainedMoveable(_e,_d);
},constructor:function(_f,_10){
var _11=_10&&_10.area;
this.constraints=function(){
var n=this.node.parentNode,s=dojo.getComputedStyle(n),mb=dojo._getMarginBox(n,s);
if(_11=="margin"){
return mb;
}
var t=dojo._getMarginExtents(n,s);
mb.l+=t.l,mb.t+=t.t,mb.w-=t.w,mb.h-=t.h;
if(_11=="border"){
return mb;
}
t=dojo._getBorderExtents(n,s);
mb.l+=t.l,mb.t+=t.t,mb.w-=t.w,mb.h-=t.h;
if(_11=="padding"){
return mb;
}
t=dojo._getPadExtents(n,s);
mb.l+=t.l,mb.t+=t.t,mb.w-=t.w,mb.h-=t.h;
return mb;
};
}});
dojo.dnd.move.constrainedMover=function(fun,_12){
dojo.deprecated("dojo.dnd.move.constrainedMover, use dojo.dnd.move.constrainedMoveable instead");
var _13=function(_14,e,_15){
dojo.dnd.Mover.call(this,_14,e,_15);
};
dojo.extend(_13,dojo.dnd.Mover.prototype);
dojo.extend(_13,{onMouseMove:function(e){
dojo.dnd.autoScroll(e);
var m=this.marginBox,c=this.constraintBox,l=m.l+e.pageX,t=m.t+e.pageY;
l=l<c.l?c.l:c.r<l?c.r:l;
t=t<c.t?c.t:c.b<t?c.b:t;
this.host.onMove(this,{l:l,t:t});
},onFirstMove:function(){
dojo.dnd.Mover.prototype.onFirstMove.call(this);
var c=this.constraintBox=fun.call(this);
c.r=c.l+c.w;
c.b=c.t+c.h;
if(_12){
var mb=dojo.marginBox(this.node);
c.r-=mb.w;
c.b-=mb.h;
}
}});
return _13;
};
dojo.dnd.move.boxConstrainedMover=function(box,_16){
dojo.deprecated("dojo.dnd.move.boxConstrainedMover, use dojo.dnd.move.boxConstrainedMoveable instead");
return dojo.dnd.move.constrainedMover(function(){
return box;
},_16);
/*=====
dojo.declare("dojo.dnd.move.__constrainedMoveableArgs", [dojo.dnd.__MoveableArgs], {
// constraints: Function
// Calculates a constraint box.
// It is called in a context of the moveable object.
constraints: function(){},
// within: Boolean
// restrict move within boundaries.
within: false
});
=====*/
dojo.declare("dojo.dnd.move.constrainedMoveable", dojo.dnd.Moveable, {
// object attributes (for markup)
constraints: function(){},
within: false,
// markup methods
markupFactory: function(params, node){
return new dojo.dnd.move.constrainedMoveable(node, params);
},
constructor: function(node, params){
// summary:
// an object that makes a node moveable
// node: Node
// a node (or node's id) to be moved
// params: dojo.dnd.move.__constrainedMoveableArgs?
// an optional object with additional parameters;
// the rest is passed to the base class
if(!params){ params = {}; }
this.constraints = params.constraints;
this.within = params.within;
},
onFirstMove: function(/* dojo.dnd.Mover */ mover){
// summary:
// called during the very first move notification;
// can be used to initialize coordinates, can be overwritten.
var c = this.constraintBox = this.constraints.call(this, mover);
c.r = c.l + c.w;
c.b = c.t + c.h;
if(this.within){
var mb = dojo.marginBox(mover.node);
c.r -= mb.w;
c.b -= mb.h;
}
},
onMove: function(/* dojo.dnd.Mover */ mover, /* Object */ leftTop){
// summary:
// called during every move notification;
// should actually move the node; can be overwritten.
var c = this.constraintBox, s = mover.node.style;
s.left = (leftTop.l < c.l ? c.l : c.r < leftTop.l ? c.r : leftTop.l) + "px";
s.top = (leftTop.t < c.t ? c.t : c.b < leftTop.t ? c.b : leftTop.t) + "px";
}
});
/*=====
dojo.declare("dojo.dnd.move.__boxConstrainedMoveableArgs", [dojo.dnd.move.__constrainedMoveableArgs], {
// box: Object
// a constraint box
box: {}
});
=====*/
dojo.declare("dojo.dnd.move.boxConstrainedMoveable", dojo.dnd.move.constrainedMoveable, {
// box:
// object attributes (for markup)
box: {},
// markup methods
markupFactory: function(params, node){
return new dojo.dnd.move.boxConstrainedMoveable(node, params);
},
constructor: function(node, params){
// summary:
// an object, which makes a node moveable
// node: Node
// a node (or node's id) to be moved
// params: dojo.dnd.move.__boxConstrainedMoveableArgs?
// an optional object with parameters
var box = params && params.box;
this.constraints = function(){ return box; };
}
});
/*=====
dojo.declare("dojo.dnd.move.__parentConstrainedMoveableArgs", [dojo.dnd.move.__constrainedMoveableArgs], {
// area: String
// A parent's area to restrict the move.
// Can be "margin", "border", "padding", or "content".
area: ""
});
=====*/
dojo.declare("dojo.dnd.move.parentConstrainedMoveable", dojo.dnd.move.constrainedMoveable, {
// area:
// object attributes (for markup)
area: "content",
// markup methods
markupFactory: function(params, node){
return new dojo.dnd.move.parentConstrainedMoveable(node, params);
},
constructor: function(node, params){
// summary:
// an object, which makes a node moveable
// node: Node
// a node (or node's id) to be moved
// params: dojo.dnd.move.__parentConstrainedMoveableArgs?
// an optional object with parameters
var area = params && params.area;
this.constraints = function(){
var n = this.node.parentNode,
s = dojo.getComputedStyle(n),
mb = dojo._getMarginBox(n, s);
if(area == "margin"){
return mb; // Object
}
var t = dojo._getMarginExtents(n, s);
mb.l += t.l, mb.t += t.t, mb.w -= t.w, mb.h -= t.h;
if(area == "border"){
return mb; // Object
}
t = dojo._getBorderExtents(n, s);
mb.l += t.l, mb.t += t.t, mb.w -= t.w, mb.h -= t.h;
if(area == "padding"){
return mb; // Object
}
t = dojo._getPadExtents(n, s);
mb.l += t.l, mb.t += t.t, mb.w -= t.w, mb.h -= t.h;
return mb; // Object
};
}
});
// WARNING: below are obsolete objects, instead of custom movers use custom moveables (above)
dojo.dnd.move.constrainedMover = function(fun, within){
// summary:
// returns a constrained version of dojo.dnd.Mover
// description:
// this function produces n object, which will put a constraint on
// the margin box of dragged object in absolute coordinates
// fun: Function
// called on drag, and returns a constraint box
// within: Boolean
// if true, constraints the whole dragged object withtin the rectangle,
// otherwise the constraint is applied to the left-top corner
dojo.deprecated("dojo.dnd.move.constrainedMover, use dojo.dnd.move.constrainedMoveable instead");
var mover = function(node, e, notifier){
dojo.dnd.Mover.call(this, node, e, notifier);
};
dojo.extend(mover, dojo.dnd.Mover.prototype);
dojo.extend(mover, {
onMouseMove: function(e){
// summary: event processor for onmousemove
// e: Event: mouse event
dojo.dnd.autoScroll(e);
var m = this.marginBox, c = this.constraintBox,
l = m.l + e.pageX, t = m.t + e.pageY;
l = l < c.l ? c.l : c.r < l ? c.r : l;
t = t < c.t ? c.t : c.b < t ? c.b : t;
this.host.onMove(this, {l: l, t: t});
},
onFirstMove: function(){
// summary: called once to initialize things; it is meant to be called only once
dojo.dnd.Mover.prototype.onFirstMove.call(this);
var c = this.constraintBox = fun.call(this);
c.r = c.l + c.w;
c.b = c.t + c.h;
if(within){
var mb = dojo.marginBox(this.node);
c.r -= mb.w;
c.b -= mb.h;
}
}
});
return mover; // Object
};
dojo.dnd.move.parentConstrainedMover=function(_17,_18){
dojo.deprecated("dojo.dnd.move.parentConstrainedMover, use dojo.dnd.move.parentConstrainedMoveable instead");
var fun=function(){
var n=this.node.parentNode,s=dojo.getComputedStyle(n),mb=dojo._getMarginBox(n,s);
if(_17=="margin"){
return mb;
}
var t=dojo._getMarginExtents(n,s);
mb.l+=t.l,mb.t+=t.t,mb.w-=t.w,mb.h-=t.h;
if(_17=="border"){
return mb;
}
t=dojo._getBorderExtents(n,s);
mb.l+=t.l,mb.t+=t.t,mb.w-=t.w,mb.h-=t.h;
if(_17=="padding"){
return mb;
}
t=dojo._getPadExtents(n,s);
mb.l+=t.l,mb.t+=t.t,mb.w-=t.w,mb.h-=t.h;
return mb;
dojo.dnd.move.boxConstrainedMover = function(box, within){
// summary:
// a specialization of dojo.dnd.constrainedMover, which constrains to the specified box
// box: Object
// a constraint box (l, t, w, h)
// within: Boolean
// if true, constraints the whole dragged object withtin the rectangle,
// otherwise the constraint is applied to the left-top corner
dojo.deprecated("dojo.dnd.move.boxConstrainedMover, use dojo.dnd.move.boxConstrainedMoveable instead");
return dojo.dnd.move.constrainedMover(function(){ return box; }, within); // Object
};
return dojo.dnd.move.constrainedMover(fun,_18);
dojo.dnd.move.parentConstrainedMover = function(area, within){
// summary:
// a specialization of dojo.dnd.constrainedMover, which constrains to the parent node
// area: String
// "margin" to constrain within the parent's margin box, "border" for the border box,
// "padding" for the padding box, and "content" for the content box; "content" is the default value.
// within: Boolean
// if true, constraints the whole dragged object within the rectangle,
// otherwise the constraint is applied to the left-top corner
dojo.deprecated("dojo.dnd.move.parentConstrainedMover, use dojo.dnd.move.parentConstrainedMoveable instead");
var fun = function(){
var n = this.node.parentNode,
s = dojo.getComputedStyle(n),
mb = dojo._getMarginBox(n, s);
if(area == "margin"){
return mb; // Object
}
var t = dojo._getMarginExtents(n, s);
mb.l += t.l, mb.t += t.t, mb.w -= t.w, mb.h -= t.h;
if(area == "border"){
return mb; // Object
}
t = dojo._getBorderExtents(n, s);
mb.l += t.l, mb.t += t.t, mb.w -= t.w, mb.h -= t.h;
if(area == "padding"){
return mb; // Object
}
t = dojo._getPadExtents(n, s);
mb.l += t.l, mb.t += t.t, mb.w -= t.w, mb.h -= t.h;
return mb; // Object
};
return dojo.dnd.move.constrainedMover(fun, within); // Object
};
dojo.dnd.constrainedMover=dojo.dnd.move.constrainedMover;
dojo.dnd.boxConstrainedMover=dojo.dnd.move.boxConstrainedMover;
dojo.dnd.parentConstrainedMover=dojo.dnd.move.parentConstrainedMover;
// patching functions one level up for compatibility
dojo.dnd.constrainedMover = dojo.dnd.move.constrainedMover;
dojo.dnd.boxConstrainedMover = dojo.dnd.move.boxConstrainedMover;
dojo.dnd.parentConstrainedMover = dojo.dnd.move.parentConstrainedMover;
}

@ -5,248 +5,400 @@
*/
if(!dojo._hasResource["dojo.fx"]){
dojo._hasResource["dojo.fx"]=true;
if(!dojo._hasResource["dojo.fx"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.fx"] = true;
dojo.provide("dojo.fx");
dojo.require("dojo.fx.Toggler");
(function(){
var d=dojo,_1={_fire:function(_2,_3){
if(this[_2]){
this[_2].apply(this,_3||[]);
}
return this;
}};
var _4=function(_5){
this._index=-1;
this._animations=_5||[];
this._current=this._onAnimateCtx=this._onEndCtx=null;
this.duration=0;
d.forEach(this._animations,function(a){
this.duration+=a.duration;
if(a.delay){
this.duration+=a.delay;
}
},this);
};
d.extend(_4,{_onAnimate:function(){
this._fire("onAnimate",arguments);
},_onEnd:function(){
d.disconnect(this._onAnimateCtx);
d.disconnect(this._onEndCtx);
this._onAnimateCtx=this._onEndCtx=null;
if(this._index+1==this._animations.length){
this._fire("onEnd");
}else{
this._current=this._animations[++this._index];
this._onAnimateCtx=d.connect(this._current,"onAnimate",this,"_onAnimate");
this._onEndCtx=d.connect(this._current,"onEnd",this,"_onEnd");
this._current.play(0,true);
}
},play:function(_6,_7){
if(!this._current){
this._current=this._animations[this._index=0];
}
if(!_7&&this._current.status()=="playing"){
return this;
}
var _8=d.connect(this._current,"beforeBegin",this,function(){
this._fire("beforeBegin");
}),_9=d.connect(this._current,"onBegin",this,function(_a){
this._fire("onBegin",arguments);
}),_b=d.connect(this._current,"onPlay",this,function(_c){
this._fire("onPlay",arguments);
d.disconnect(_8);
d.disconnect(_9);
d.disconnect(_b);
});
if(this._onAnimateCtx){
d.disconnect(this._onAnimateCtx);
}
this._onAnimateCtx=d.connect(this._current,"onAnimate",this,"_onAnimate");
if(this._onEndCtx){
d.disconnect(this._onEndCtx);
}
this._onEndCtx=d.connect(this._current,"onEnd",this,"_onEnd");
this._current.play.apply(this._current,arguments);
return this;
},pause:function(){
if(this._current){
var e=d.connect(this._current,"onPause",this,function(_d){
this._fire("onPause",arguments);
d.disconnect(e);
});
this._current.pause();
}
return this;
},gotoPercent:function(_e,_f){
this.pause();
var _10=this.duration*_e;
this._current=null;
d.some(this._animations,function(a){
if(a.duration<=_10){
this._current=a;
return true;
}
_10-=a.duration;
return false;
});
if(this._current){
this._current.gotoPercent(_10/this._current.duration,_f);
}
return this;
},stop:function(_11){
if(this._current){
if(_11){
for(;this._index+1<this._animations.length;++this._index){
this._animations[this._index].stop(true);
}
this._current=this._animations[this._index];
}
var e=d.connect(this._current,"onStop",this,function(arg){
this._fire("onStop",arguments);
d.disconnect(e);
});
this._current.stop();
}
return this;
},status:function(){
return this._current?this._current.status():"stopped";
},destroy:function(){
if(this._onAnimateCtx){
d.disconnect(this._onAnimateCtx);
}
if(this._onEndCtx){
d.disconnect(this._onEndCtx);
}
}});
d.extend(_4,_1);
dojo.fx.chain=function(_12){
return new _4(_12);
};
var _13=function(_14){
this._animations=_14||[];
this._connects=[];
this._finished=0;
this.duration=0;
d.forEach(_14,function(a){
var _15=a.duration;
if(a.delay){
_15+=a.delay;
}
if(this.duration<_15){
this.duration=_15;
}
this._connects.push(d.connect(a,"onEnd",this,"_onEnd"));
},this);
this._pseudoAnimation=new d.Animation({curve:[0,1],duration:this.duration});
var _16=this;
d.forEach(["beforeBegin","onBegin","onPlay","onAnimate","onPause","onStop","onEnd"],function(evt){
_16._connects.push(d.connect(_16._pseudoAnimation,evt,function(){
_16._fire(evt,arguments);
}));
});
};
d.extend(_13,{_doAction:function(_17,_18){
d.forEach(this._animations,function(a){
a[_17].apply(a,_18);
});
return this;
},_onEnd:function(){
if(++this._finished>this._animations.length){
this._fire("onEnd");
}
},_call:function(_19,_1a){
var t=this._pseudoAnimation;
t[_19].apply(t,_1a);
},play:function(_1b,_1c){
this._finished=0;
this._doAction("play",arguments);
this._call("play",arguments);
return this;
},pause:function(){
this._doAction("pause",arguments);
this._call("pause",arguments);
return this;
},gotoPercent:function(_1d,_1e){
var ms=this.duration*_1d;
d.forEach(this._animations,function(a){
a.gotoPercent(a.duration<ms?1:(ms/a.duration),_1e);
});
this._call("gotoPercent",arguments);
return this;
},stop:function(_1f){
this._doAction("stop",arguments);
this._call("stop",arguments);
return this;
},status:function(){
return this._pseudoAnimation.status();
},destroy:function(){
d.forEach(this._connects,dojo.disconnect);
}});
d.extend(_13,_1);
dojo.fx.combine=function(_20){
return new _13(_20);
};
dojo.fx.wipeIn=function(_21){
var _22=_21.node=d.byId(_21.node),s=_22.style,o;
var _23=d.animateProperty(d.mixin({properties:{height:{start:function(){
o=s.overflow;
s.overflow="hidden";
if(s.visibility=="hidden"||s.display=="none"){
s.height="1px";
s.display="";
s.visibility="";
return 1;
}else{
var _24=d.style(_22,"height");
return Math.max(_24,1);
}
},end:function(){
return _22.scrollHeight;
}}}},_21));
d.connect(_23,"onEnd",function(){
s.height="auto";
s.overflow=o;
});
return _23;
};
dojo.fx.wipeOut=function(_25){
var _26=_25.node=d.byId(_25.node),s=_26.style,o;
var _27=d.animateProperty(d.mixin({properties:{height:{end:1}}},_25));
d.connect(_27,"beforeBegin",function(){
o=s.overflow;
s.overflow="hidden";
s.display="";
});
d.connect(_27,"onEnd",function(){
s.overflow=o;
s.height="auto";
s.display="none";
});
return _27;
};
dojo.fx.slideTo=function(_28){
var _29=_28.node=d.byId(_28.node),top=null,_2a=null;
var _2b=(function(n){
return function(){
var cs=d.getComputedStyle(n);
var pos=cs.position;
top=(pos=="absolute"?n.offsetTop:parseInt(cs.top)||0);
_2a=(pos=="absolute"?n.offsetLeft:parseInt(cs.left)||0);
if(pos!="absolute"&&pos!="relative"){
var ret=d.position(n,true);
top=ret.y;
_2a=ret.x;
n.style.position="absolute";
n.style.top=top+"px";
n.style.left=_2a+"px";
}
};
})(_29);
_2b();
var _2c=d.animateProperty(d.mixin({properties:{top:_28.top||0,left:_28.left||0}},_28));
d.connect(_2c,"beforeBegin",_2c,_2b);
return _2c;
dojo.require("dojo.fx.Toggler"); // FIXME: remove this back-compat require in 2.0
/*=====
dojo.fx = {
// summary: Effects library on top of Base animations
};
=====*/
(function(){
var d = dojo,
_baseObj = {
_fire: function(evt, args){
if(this[evt]){
this[evt].apply(this, args||[]);
}
return this;
}
};
var _chain = function(animations){
this._index = -1;
this._animations = animations||[];
this._current = this._onAnimateCtx = this._onEndCtx = null;
this.duration = 0;
d.forEach(this._animations, function(a){
this.duration += a.duration;
if(a.delay){ this.duration += a.delay; }
}, this);
};
d.extend(_chain, {
_onAnimate: function(){
this._fire("onAnimate", arguments);
},
_onEnd: function(){
d.disconnect(this._onAnimateCtx);
d.disconnect(this._onEndCtx);
this._onAnimateCtx = this._onEndCtx = null;
if(this._index + 1 == this._animations.length){
this._fire("onEnd");
}else{
// switch animations
this._current = this._animations[++this._index];
this._onAnimateCtx = d.connect(this._current, "onAnimate", this, "_onAnimate");
this._onEndCtx = d.connect(this._current, "onEnd", this, "_onEnd");
this._current.play(0, true);
}
},
play: function(/*int?*/ delay, /*Boolean?*/ gotoStart){
if(!this._current){ this._current = this._animations[this._index = 0]; }
if(!gotoStart && this._current.status() == "playing"){ return this; }
var beforeBegin = d.connect(this._current, "beforeBegin", this, function(){
this._fire("beforeBegin");
}),
onBegin = d.connect(this._current, "onBegin", this, function(arg){
this._fire("onBegin", arguments);
}),
onPlay = d.connect(this._current, "onPlay", this, function(arg){
this._fire("onPlay", arguments);
d.disconnect(beforeBegin);
d.disconnect(onBegin);
d.disconnect(onPlay);
});
if(this._onAnimateCtx){
d.disconnect(this._onAnimateCtx);
}
this._onAnimateCtx = d.connect(this._current, "onAnimate", this, "_onAnimate");
if(this._onEndCtx){
d.disconnect(this._onEndCtx);
}
this._onEndCtx = d.connect(this._current, "onEnd", this, "_onEnd");
this._current.play.apply(this._current, arguments);
return this;
},
pause: function(){
if(this._current){
var e = d.connect(this._current, "onPause", this, function(arg){
this._fire("onPause", arguments);
d.disconnect(e);
});
this._current.pause();
}
return this;
},
gotoPercent: function(/*Decimal*/percent, /*Boolean?*/ andPlay){
this.pause();
var offset = this.duration * percent;
this._current = null;
d.some(this._animations, function(a){
if(a.duration <= offset){
this._current = a;
return true;
}
offset -= a.duration;
return false;
});
if(this._current){
this._current.gotoPercent(offset / this._current.duration, andPlay);
}
return this;
},
stop: function(/*boolean?*/ gotoEnd){
if(this._current){
if(gotoEnd){
for(; this._index + 1 < this._animations.length; ++this._index){
this._animations[this._index].stop(true);
}
this._current = this._animations[this._index];
}
var e = d.connect(this._current, "onStop", this, function(arg){
this._fire("onStop", arguments);
d.disconnect(e);
});
this._current.stop();
}
return this;
},
status: function(){
return this._current ? this._current.status() : "stopped";
},
destroy: function(){
if(this._onAnimateCtx){ d.disconnect(this._onAnimateCtx); }
if(this._onEndCtx){ d.disconnect(this._onEndCtx); }
}
});
d.extend(_chain, _baseObj);
dojo.fx.chain = function(/*dojo.Animation[]*/ animations){
// summary:
// Chain a list of `dojo.Animation`s to run in sequence
//
// description:
// Return a `dojo.Animation` which will play all passed
// `dojo.Animation` instances in sequence, firing its own
// synthesized events simulating a single animation. (eg:
// onEnd of this animation means the end of the chain,
// not the individual animations within)
//
// example:
// Once `node` is faded out, fade in `otherNode`
// | dojo.fx.chain([
// | dojo.fadeIn({ node:node }),
// | dojo.fadeOut({ node:otherNode })
// | ]).play();
//
return new _chain(animations) // dojo.Animation
};
var _combine = function(animations){
this._animations = animations||[];
this._connects = [];
this._finished = 0;
this.duration = 0;
d.forEach(animations, function(a){
var duration = a.duration;
if(a.delay){ duration += a.delay; }
if(this.duration < duration){ this.duration = duration; }
this._connects.push(d.connect(a, "onEnd", this, "_onEnd"));
}, this);
this._pseudoAnimation = new d.Animation({curve: [0, 1], duration: this.duration});
var self = this;
d.forEach(["beforeBegin", "onBegin", "onPlay", "onAnimate", "onPause", "onStop", "onEnd"],
function(evt){
self._connects.push(d.connect(self._pseudoAnimation, evt,
function(){ self._fire(evt, arguments); }
));
}
);
};
d.extend(_combine, {
_doAction: function(action, args){
d.forEach(this._animations, function(a){
a[action].apply(a, args);
});
return this;
},
_onEnd: function(){
if(++this._finished > this._animations.length){
this._fire("onEnd");
}
},
_call: function(action, args){
var t = this._pseudoAnimation;
t[action].apply(t, args);
},
play: function(/*int?*/ delay, /*Boolean?*/ gotoStart){
this._finished = 0;
this._doAction("play", arguments);
this._call("play", arguments);
return this;
},
pause: function(){
this._doAction("pause", arguments);
this._call("pause", arguments);
return this;
},
gotoPercent: function(/*Decimal*/percent, /*Boolean?*/ andPlay){
var ms = this.duration * percent;
d.forEach(this._animations, function(a){
a.gotoPercent(a.duration < ms ? 1 : (ms / a.duration), andPlay);
});
this._call("gotoPercent", arguments);
return this;
},
stop: function(/*boolean?*/ gotoEnd){
this._doAction("stop", arguments);
this._call("stop", arguments);
return this;
},
status: function(){
return this._pseudoAnimation.status();
},
destroy: function(){
d.forEach(this._connects, dojo.disconnect);
}
});
d.extend(_combine, _baseObj);
dojo.fx.combine = function(/*dojo.Animation[]*/ animations){
// summary:
// Combine a list of `dojo.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
// animation, firing standard animation events.
//
// example:
// Fade out `node` while fading in `otherNode` simultaneously
// | dojo.fx.combine([
// | dojo.fadeIn({ node:node }),
// | dojo.fadeOut({ node:otherNode })
// | ]).play();
//
// example:
// When the longest animation ends, execute a function:
// | var anim = dojo.fx.combine([
// | dojo.fadeIn({ node: n, duration:700 }),
// | dojo.fadeOut({ node: otherNode, duration: 300 })
// | ]);
// | dojo.connect(anim, "onEnd", function(){
// | // overall animation is done.
// | });
// | anim.play(); // play the animation
//
return new _combine(animations); // dojo.Animation
};
dojo.fx.wipeIn = function(/*Object*/ args){
// summary:
// Expand a node to it's natural height.
//
// description:
// Returns an animation that will expand the
// node defined in 'args' object from it's current height to
// it's natural height (with no scrollbar).
// Node must have no margin/border/padding.
//
// args: Object
// A hash-map of standard `dojo.Animation` constructor properties
// (such as easing: node: duration: and so on)
//
// example:
// | dojo.fx.wipeIn({
// | node:"someId"
// | }).play()
var node = args.node = d.byId(args.node), s = node.style, o;
var anim = d.animateProperty(d.mixin({
properties: {
height: {
// wrapped in functions so we wait till the last second to query (in case value has changed)
start: function(){
// start at current [computed] height, but use 1px rather than 0
// because 0 causes IE to display the whole panel
o = s.overflow;
s.overflow = "hidden";
if(s.visibility == "hidden" || s.display == "none"){
s.height = "1px";
s.display = "";
s.visibility = "";
return 1;
}else{
var height = d.style(node, "height");
return Math.max(height, 1);
}
},
end: function(){
return node.scrollHeight;
}
}
}
}, args));
d.connect(anim, "onEnd", function(){
s.height = "auto";
s.overflow = o;
});
return anim; // dojo.Animation
}
dojo.fx.wipeOut = function(/*Object*/ args){
// summary:
// Shrink a node to nothing and hide it.
//
// description:
// Returns an animation that will shrink node defined in "args"
// from it's current height to 1px, and then hide it.
//
// args: Object
// A hash-map of standard `dojo.Animation` constructor properties
// (such as easing: node: duration: and so on)
//
// example:
// | dojo.fx.wipeOut({ node:"someId" }).play()
var node = args.node = d.byId(args.node), s = node.style, o;
var anim = d.animateProperty(d.mixin({
properties: {
height: {
end: 1 // 0 causes IE to display the whole panel
}
}
}, args));
d.connect(anim, "beforeBegin", function(){
o = s.overflow;
s.overflow = "hidden";
s.display = "";
});
d.connect(anim, "onEnd", function(){
s.overflow = o;
s.height = "auto";
s.display = "none";
});
return anim; // dojo.Animation
}
dojo.fx.slideTo = function(/*Object*/ args){
// summary:
// Slide a node to a new top/left position
//
// description:
// Returns an animation that will slide "node"
// defined in args Object from its current position to
// the position defined by (args.left, args.top).
//
// args: Object
// A hash-map of standard `dojo.Animation` constructor properties
// (such as easing: node: duration: and so on). Special args members
// are `top` and `left`, which indicate the new position to slide to.
//
// example:
// | dojo.fx.slideTo({ node: node, left:"40", top:"50", units:"px" }).play()
var node = args.node = d.byId(args.node),
top = null, left = null;
var init = (function(n){
return function(){
var cs = d.getComputedStyle(n);
var pos = cs.position;
top = (pos == 'absolute' ? n.offsetTop : parseInt(cs.top) || 0);
left = (pos == 'absolute' ? n.offsetLeft : parseInt(cs.left) || 0);
if(pos != 'absolute' && pos != 'relative'){
var ret = d.position(n, true);
top = ret.y;
left = ret.x;
n.style.position="absolute";
n.style.top=top+"px";
n.style.left=left+"px";
}
};
})(node);
init();
var anim = d.animateProperty(d.mixin({
properties: {
top: args.top || 0,
left: args.left || 0
}
}, args));
d.connect(anim, "beforeBegin", anim, init);
return anim; // dojo.Animation
}
})();
}

@ -5,26 +5,103 @@
*/
if(!dojo._hasResource["dojo.fx.Toggler"]){
dojo._hasResource["dojo.fx.Toggler"]=true;
if(!dojo._hasResource["dojo.fx.Toggler"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.fx.Toggler"] = true;
dojo.provide("dojo.fx.Toggler");
dojo.declare("dojo.fx.Toggler",null,{node:null,showFunc:dojo.fadeIn,hideFunc:dojo.fadeOut,showDuration:200,hideDuration:200,constructor:function(_1){
var _2=this;
dojo.mixin(_2,_1);
_2.node=_1.node;
_2._showArgs=dojo.mixin({},_1);
_2._showArgs.node=_2.node;
_2._showArgs.duration=_2.showDuration;
_2.showAnim=_2.showFunc(_2._showArgs);
_2._hideArgs=dojo.mixin({},_1);
_2._hideArgs.node=_2.node;
_2._hideArgs.duration=_2.hideDuration;
_2.hideAnim=_2.hideFunc(_2._hideArgs);
dojo.connect(_2.showAnim,"beforeBegin",dojo.hitch(_2.hideAnim,"stop",true));
dojo.connect(_2.hideAnim,"beforeBegin",dojo.hitch(_2.showAnim,"stop",true));
},show:function(_3){
return this.showAnim.play(_3||0);
},hide:function(_4){
return this.hideAnim.play(_4||0);
}});
dojo.declare("dojo.fx.Toggler", null, {
// summary:
// A simple `dojo.Animation` toggler API.
//
// description:
// class constructor for an animation toggler. It accepts a packed
// set of arguments about what type of animation to use in each
// direction, duration, etc. All available members are mixed into
// these animations from the constructor (for example, `node`,
// `showDuration`, `hideDuration`).
//
// example:
// | var t = new dojo.fx.Toggler({
// | node: "nodeId",
// | showDuration: 500,
// | // hideDuration will default to "200"
// | showFunc: dojo.fx.wipeIn,
// | // hideFunc will default to "fadeOut"
// | });
// | t.show(100); // delay showing for 100ms
// | // ...time passes...
// | t.hide();
// node: DomNode
// the node to target for the showing and hiding animations
node: null,
// showFunc: Function
// The function that returns the `dojo.Animation` to show the node
showFunc: dojo.fadeIn,
// hideFunc: Function
// The function that returns the `dojo.Animation` to hide the node
hideFunc: dojo.fadeOut,
// showDuration:
// Time in milliseconds to run the show Animation
showDuration: 200,
// hideDuration:
// Time in milliseconds to run the hide Animation
hideDuration: 200,
// FIXME: need a policy for where the toggler should "be" the next
// time show/hide are called if we're stopped somewhere in the
// middle.
// FIXME: also would be nice to specify individual showArgs/hideArgs mixed into
// each animation individually.
// FIXME: also would be nice to have events from the animations exposed/bridged
/*=====
_showArgs: null,
_showAnim: null,
_hideArgs: null,
_hideAnim: null,
_isShowing: false,
_isHiding: false,
=====*/
constructor: function(args){
var _t = this;
dojo.mixin(_t, args);
_t.node = args.node;
_t._showArgs = dojo.mixin({}, args);
_t._showArgs.node = _t.node;
_t._showArgs.duration = _t.showDuration;
_t.showAnim = _t.showFunc(_t._showArgs);
_t._hideArgs = dojo.mixin({}, args);
_t._hideArgs.node = _t.node;
_t._hideArgs.duration = _t.hideDuration;
_t.hideAnim = _t.hideFunc(_t._hideArgs);
dojo.connect(_t.showAnim, "beforeBegin", dojo.hitch(_t.hideAnim, "stop", true));
dojo.connect(_t.hideAnim, "beforeBegin", dojo.hitch(_t.showAnim, "stop", true));
},
show: function(delay){
// summary: Toggle the node to showing
// delay: Integer?
// Ammount of time to stall playing the show animation
return this.showAnim.play(delay || 0);
},
hide: function(delay){
// summary: Toggle the node to hidden
// delay: Integer?
// Ammount of time to stall playing the hide animation
return this.hideAnim.play(delay || 0);
}
});
}

@ -5,162 +5,282 @@
*/
if(!dojo._hasResource["dojo.fx.easing"]){
dojo._hasResource["dojo.fx.easing"]=true;
if(!dojo._hasResource["dojo.fx.easing"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.fx.easing"] = true;
dojo.provide("dojo.fx.easing");
dojo.fx.easing={linear:function(n){
return n;
},quadIn:function(n){
return Math.pow(n,2);
},quadOut:function(n){
return n*(n-2)*-1;
},quadInOut:function(n){
n=n*2;
if(n<1){
return Math.pow(n,2)/2;
}
return -1*((--n)*(n-2)-1)/2;
},cubicIn:function(n){
return Math.pow(n,3);
},cubicOut:function(n){
return Math.pow(n-1,3)+1;
},cubicInOut:function(n){
n=n*2;
if(n<1){
return Math.pow(n,3)/2;
}
n-=2;
return (Math.pow(n,3)+2)/2;
},quartIn:function(n){
return Math.pow(n,4);
},quartOut:function(n){
return -1*(Math.pow(n-1,4)-1);
},quartInOut:function(n){
n=n*2;
if(n<1){
return Math.pow(n,4)/2;
}
n-=2;
return -1/2*(Math.pow(n,4)-2);
},quintIn:function(n){
return Math.pow(n,5);
},quintOut:function(n){
return Math.pow(n-1,5)+1;
},quintInOut:function(n){
n=n*2;
if(n<1){
return Math.pow(n,5)/2;
}
n-=2;
return (Math.pow(n,5)+2)/2;
},sineIn:function(n){
return -1*Math.cos(n*(Math.PI/2))+1;
},sineOut:function(n){
return Math.sin(n*(Math.PI/2));
},sineInOut:function(n){
return -1*(Math.cos(Math.PI*n)-1)/2;
},expoIn:function(n){
return (n==0)?0:Math.pow(2,10*(n-1));
},expoOut:function(n){
return (n==1)?1:(-1*Math.pow(2,-10*n)+1);
},expoInOut:function(n){
if(n==0){
return 0;
}
if(n==1){
return 1;
}
n=n*2;
if(n<1){
return Math.pow(2,10*(n-1))/2;
}
--n;
return (-1*Math.pow(2,-10*n)+2)/2;
},circIn:function(n){
return -1*(Math.sqrt(1-Math.pow(n,2))-1);
},circOut:function(n){
n=n-1;
return Math.sqrt(1-Math.pow(n,2));
},circInOut:function(n){
n=n*2;
if(n<1){
return -1/2*(Math.sqrt(1-Math.pow(n,2))-1);
}
n-=2;
return 1/2*(Math.sqrt(1-Math.pow(n,2))+1);
},backIn:function(n){
var s=1.70158;
return Math.pow(n,2)*((s+1)*n-s);
},backOut:function(n){
n=n-1;
var s=1.70158;
return Math.pow(n,2)*((s+1)*n+s)+1;
},backInOut:function(n){
var s=1.70158*1.525;
n=n*2;
if(n<1){
return (Math.pow(n,2)*((s+1)*n-s))/2;
}
n-=2;
return (Math.pow(n,2)*((s+1)*n+s)+2)/2;
},elasticIn:function(n){
if(n==0||n==1){
return n;
}
var p=0.3;
var s=p/4;
n=n-1;
return -1*Math.pow(2,10*n)*Math.sin((n-s)*(2*Math.PI)/p);
},elasticOut:function(n){
if(n==0||n==1){
return n;
}
var p=0.3;
var s=p/4;
return Math.pow(2,-10*n)*Math.sin((n-s)*(2*Math.PI)/p)+1;
},elasticInOut:function(n){
if(n==0){
return 0;
}
n=n*2;
if(n==2){
return 1;
}
var p=0.3*1.5;
var s=p/4;
if(n<1){
n-=1;
return -0.5*(Math.pow(2,10*n)*Math.sin((n-s)*(2*Math.PI)/p));
}
n-=1;
return 0.5*(Math.pow(2,-10*n)*Math.sin((n-s)*(2*Math.PI)/p))+1;
},bounceIn:function(n){
return (1-dojo.fx.easing.bounceOut(1-n));
},bounceOut:function(n){
var s=7.5625;
var p=2.75;
var l;
if(n<(1/p)){
l=s*Math.pow(n,2);
}else{
if(n<(2/p)){
n-=(1.5/p);
l=s*Math.pow(n,2)+0.75;
}else{
if(n<(2.5/p)){
n-=(2.25/p);
l=s*Math.pow(n,2)+0.9375;
}else{
n-=(2.625/p);
l=s*Math.pow(n,2)+0.984375;
}
}
}
return l;
},bounceInOut:function(n){
if(n<0.5){
return dojo.fx.easing.bounceIn(n*2)/2;
}
return (dojo.fx.easing.bounceOut(n*2-1)/2)+0.5;
}};
dojo.fx.easing = {
// summary:
// Collection of easing functions to use beyond the default
// `dojo._defaultEasing` function.
//
// description:
//
// Easing functions are used to manipulate the iteration through
// an `dojo.Animation`s _Line. _Line being the properties of an Animation,
// and the easing function progresses through that Line determing
// how quickly (or slowly) it should go. Or more accurately: modify
// the value of the _Line based on the percentage of animation completed.
//
// All functions follow a simple naming convention of "ease type" + "when".
// If the name of the function ends in Out, the easing described appears
// towards the end of the animation. "In" means during the beginning,
// and InOut means both ranges of the Animation will applied, both
// beginning and end.
//
// One does not call the easing function directly, it must be passed to
// the `easing` property of an animation.
//
// example:
// | dojo.require("dojo.fx.easing");
// | var anim = dojo.fadeOut({
// | node: 'node',
// | duration: 2000,
// | // note there is no ()
// | easing: dojo.fx.easing.quadIn
// | }).play();
//
linear: function(/* Decimal? */n){
// summary: A linear easing function
return n;
},
quadIn: function(/* Decimal? */n){
return Math.pow(n, 2);
},
quadOut: function(/* Decimal? */n){
return n * (n - 2) * -1;
},
quadInOut: function(/* Decimal? */n){
n = n * 2;
if(n < 1){ return Math.pow(n, 2) / 2; }
return -1 * ((--n) * (n - 2) - 1) / 2;
},
cubicIn: function(/* Decimal? */n){
return Math.pow(n, 3);
},
cubicOut: function(/* Decimal? */n){
return Math.pow(n - 1, 3) + 1;
},
cubicInOut: function(/* Decimal? */n){
n = n * 2;
if(n < 1){ return Math.pow(n, 3) / 2; }
n -= 2;
return (Math.pow(n, 3) + 2) / 2;
},
quartIn: function(/* Decimal? */n){
return Math.pow(n, 4);
},
quartOut: function(/* Decimal? */n){
return -1 * (Math.pow(n - 1, 4) - 1);
},
quartInOut: function(/* Decimal? */n){
n = n * 2;
if(n < 1){ return Math.pow(n, 4) / 2; }
n -= 2;
return -1 / 2 * (Math.pow(n, 4) - 2);
},
quintIn: function(/* Decimal? */n){
return Math.pow(n, 5);
},
quintOut: function(/* Decimal? */n){
return Math.pow(n - 1, 5) + 1;
},
quintInOut: function(/* Decimal? */n){
n = n * 2;
if(n < 1){ return Math.pow(n, 5) / 2; };
n -= 2;
return (Math.pow(n, 5) + 2) / 2;
},
sineIn: function(/* Decimal? */n){
return -1 * Math.cos(n * (Math.PI / 2)) + 1;
},
sineOut: function(/* Decimal? */n){
return Math.sin(n * (Math.PI / 2));
},
sineInOut: function(/* Decimal? */n){
return -1 * (Math.cos(Math.PI * n) - 1) / 2;
},
expoIn: function(/* Decimal? */n){
return (n == 0) ? 0 : Math.pow(2, 10 * (n - 1));
},
expoOut: function(/* Decimal? */n){
return (n == 1) ? 1 : (-1 * Math.pow(2, -10 * n) + 1);
},
expoInOut: function(/* Decimal? */n){
if(n == 0){ return 0; }
if(n == 1){ return 1; }
n = n * 2;
if(n < 1){ return Math.pow(2, 10 * (n - 1)) / 2; }
--n;
return (-1 * Math.pow(2, -10 * n) + 2) / 2;
},
circIn: function(/* Decimal? */n){
return -1 * (Math.sqrt(1 - Math.pow(n, 2)) - 1);
},
circOut: function(/* Decimal? */n){
n = n - 1;
return Math.sqrt(1 - Math.pow(n, 2));
},
circInOut: function(/* Decimal? */n){
n = n * 2;
if(n < 1){ return -1 / 2 * (Math.sqrt(1 - Math.pow(n, 2)) - 1); }
n -= 2;
return 1 / 2 * (Math.sqrt(1 - Math.pow(n, 2)) + 1);
},
backIn: function(/* Decimal? */n){
// summary:
// An easing function that starts away from the target,
// and quickly accelerates towards the end value.
//
// Use caution when the easing will cause values to become
// negative as some properties cannot be set to negative values.
var s = 1.70158;
return Math.pow(n, 2) * ((s + 1) * n - s);
},
backOut: function(/* Decimal? */n){
// summary:
// An easing function that pops past the range briefly, and slowly comes back.
//
// description:
// An easing function that pops past the range briefly, and slowly comes back.
//
// Use caution when the easing will cause values to become negative as some
// properties cannot be set to negative values.
n = n - 1;
var s = 1.70158;
return Math.pow(n, 2) * ((s + 1) * n + s) + 1;
},
backInOut: function(/* Decimal? */n){
// summary:
// An easing function combining the effects of `backIn` and `backOut`
//
// description:
// An easing function combining the effects of `backIn` and `backOut`.
// Use caution when the easing will cause values to become negative
// as some properties cannot be set to negative values.
var s = 1.70158 * 1.525;
n = n * 2;
if(n < 1){ return (Math.pow(n, 2) * ((s + 1) * n - s)) / 2; }
n-=2;
return (Math.pow(n, 2) * ((s + 1) * n + s) + 2) / 2;
},
elasticIn: function(/* Decimal? */n){
// summary:
// An easing function the elastically snaps from the start value
//
// description:
// An easing function the elastically snaps from the start value
//
// Use caution when the elasticity will cause values to become negative
// as some properties cannot be set to negative values.
if(n == 0 || n == 1){ return n; }
var p = .3;
var s = p / 4;
n = n - 1;
return -1 * Math.pow(2, 10 * n) * Math.sin((n - s) * (2 * Math.PI) / p);
},
elasticOut: function(/* Decimal? */n){
// summary:
// An easing function that elasticly snaps around the target value,
// near the end of the Animation
//
// description:
// An easing function that elasticly snaps around the target value,
// near the end of the Animation
//
// Use caution when the elasticity will cause values to become
// negative as some properties cannot be set to negative values.
if(n==0 || n == 1){ return n; }
var p = .3;
var s = p / 4;
return Math.pow(2, -10 * n) * Math.sin((n - s) * (2 * Math.PI) / p) + 1;
},
elasticInOut: function(/* Decimal? */n){
// summary:
// An easing function that elasticly snaps around the value, near
// the beginning and end of the Animation.
//
// description:
// An easing function that elasticly snaps around the value, near
// the beginning and end of the Animation.
//
// Use caution when the elasticity will cause values to become
// negative as some properties cannot be set to negative values.
if(n == 0) return 0;
n = n * 2;
if(n == 2) return 1;
var p = .3 * 1.5;
var s = p / 4;
if(n < 1){
n -= 1;
return -.5 * (Math.pow(2, 10 * n) * Math.sin((n - s) * (2 * Math.PI) / p));
}
n -= 1;
return .5 * (Math.pow(2, -10 * n) * Math.sin((n - s) * (2 * Math.PI) / p)) + 1;
},
bounceIn: function(/* Decimal? */n){
// summary:
// An easing function that 'bounces' near the beginning of an Animation
return (1 - dojo.fx.easing.bounceOut(1 - n)); // Decimal
},
bounceOut: function(/* Decimal? */n){
// summary:
// An easing function that 'bounces' near the end of an Animation
var s = 7.5625;
var p = 2.75;
var l;
if(n < (1 / p)){
l = s * Math.pow(n, 2);
}else if(n < (2 / p)){
n -= (1.5 / p);
l = s * Math.pow(n, 2) + .75;
}else if(n < (2.5 / p)){
n -= (2.25 / p);
l = s * Math.pow(n, 2) + .9375;
}else{
n -= (2.625 / p);
l = s * Math.pow(n, 2) + .984375;
}
return l;
},
bounceInOut: function(/* Decimal? */n){
// summary:
// An easing function that 'bounces' at the beginning and end of the Animation
if(n < 0.5){ return dojo.fx.easing.bounceIn(n * 2) / 2; }
return (dojo.fx.easing.bounceOut(n * 2 - 1) / 2) + 0.5; // Decimal
}
};
}

@ -5,41 +5,59 @@
*/
if(!dojo._hasResource["dojo.gears"]){
dojo._hasResource["dojo.gears"]=true;
if(!dojo._hasResource["dojo.gears"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.gears"] = true;
dojo.provide("dojo.gears");
dojo.gears._gearsObject=function(){
var _1;
var _2;
var _3=dojo.getObject("google.gears");
if(_3){
return _3;
}
if(typeof GearsFactory!="undefined"){
_1=new GearsFactory();
}else{
if(dojo.isIE){
try{
_1=new ActiveXObject("Gears.Factory");
}
catch(e){
}
}else{
if(navigator.mimeTypes["application/x-googlegears"]){
_1=document.createElement("object");
_1.setAttribute("type","application/x-googlegears");
_1.setAttribute("width",0);
_1.setAttribute("height",0);
_1.style.display="none";
document.documentElement.appendChild(_1);
}
}
}
if(!_1){
return null;
}
dojo.setObject("google.gears.factory",_1);
return dojo.getObject("google.gears");
dojo.gears._gearsObject = function(){
// summary:
// factory method to get a Google Gears plugin instance to
// expose in the browser runtime environment, if present
var factory;
var results;
var gearsObj = dojo.getObject("google.gears");
if(gearsObj){ return gearsObj; } // already defined elsewhere
if(typeof GearsFactory != "undefined"){ // Firefox
factory = new GearsFactory();
}else{
if(dojo.isIE){
// IE
try{
factory = new ActiveXObject("Gears.Factory");
}catch(e){
// ok to squelch; there's no gears factory. move on.
}
}else if(navigator.mimeTypes["application/x-googlegears"]){
// Safari?
factory = document.createElement("object");
factory.setAttribute("type", "application/x-googlegears");
factory.setAttribute("width", 0);
factory.setAttribute("height", 0);
factory.style.display = "none";
document.documentElement.appendChild(factory);
}
}
// still nothing?
if(!factory){ return null; }
// define the global objects now; don't overwrite them though if they
// were somehow set internally by the Gears plugin, which is on their
// dev roadmap for the future
dojo.setObject("google.gears.factory", factory);
return dojo.getObject("google.gears");
};
dojo.gears.available=(!!dojo.gears._gearsObject())||0;
/*=====
dojo.gears.available = {
// summary: True if client is using Google Gears
};
=====*/
// see if we have Google Gears installed, and if
// so, make it available in the runtime environment
// and in the Google standard 'google.gears' global object
dojo.gears.available = (!!dojo.gears._gearsObject())||0;
}

@ -5,133 +5,235 @@
*/
if(!dojo._hasResource["dojo.hash"]){
dojo._hasResource["dojo.hash"]=true;
if(!dojo._hasResource["dojo.hash"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.hash"] = true;
dojo.provide("dojo.hash");
//TODOC: where does this go?
// summary:
// Methods for monitoring and updating the hash in the browser URL.
//
// example:
// dojo.subscribe("/dojo/hashchange", context, callback);
//
// function callback (hashValue){
// // do something based on the hash value.
// }
(function(){
dojo.hash=function(_1,_2){
if(!arguments.length){
return _3();
}
if(_1.charAt(0)=="#"){
_1=_1.substring(1);
}
if(_2){
_4(_1);
}else{
location.href="#"+_1;
}
return _1;
};
var _5=null,_6=null,_7=dojo.config.hashPollFrequency||100;
function _8(_9,_a){
var i=_9.indexOf(_a);
return (i>=0)?_9.substring(i+1):"";
};
function _3(){
return _8(location.href,"#");
};
function _b(){
dojo.publish("/dojo/hashchange",[_3()]);
};
function _c(){
if(_3()===_5){
return;
}
_5=_3();
_b();
};
function _4(_d){
if(_6){
if(_6.isTransitioning()){
setTimeout(dojo.hitch(null,_4,_d),_7);
return;
}
var _e=_6.iframe.location.href;
var _f=_e.indexOf("?");
_6.iframe.location.replace(_e.substring(0,_f)+"?"+_d);
return;
}
location.replace("#"+_d);
_c();
};
function _10(){
var ifr=document.createElement("iframe"),_11="dojo-hash-iframe",_12=dojo.config.dojoBlankHtmlUrl||dojo.moduleUrl("dojo","resources/blank.html");
ifr.id=_11;
ifr.src=_12+"?"+_3();
ifr.style.display="none";
document.body.appendChild(ifr);
this.iframe=dojo.global[_11];
var _13,_14,_15,_16,_17,_18=this.iframe.location;
function _19(){
_5=_3();
_13=_17?_5:_8(_18.href,"?");
_14=false;
_15=null;
};
this.isTransitioning=function(){
return _14;
};
this.pollLocation=function(){
if(!_17){
try{
var _1a=_8(_18.href,"?");
if(document.title!=_16){
_16=this.iframe.document.title=document.title;
}
}
catch(e){
_17=true;
console.error("dojo.hash: Error adding history entry. Server unreachable.");
}
}
var _1b=_3();
if(_14&&_5===_1b){
if(_17||_1a===_15){
_19();
_b();
}else{
setTimeout(dojo.hitch(this,this.pollLocation),0);
return;
}
}else{
if(_5===_1b&&(_17||_13===_1a)){
}else{
if(_5!==_1b){
_5=_1b;
_14=true;
_15=_1b;
ifr.src=_12+"?"+_15;
_17=false;
setTimeout(dojo.hitch(this,this.pollLocation),0);
return;
}else{
if(!_17){
location.href="#"+_18.search.substring(1);
_19();
_b();
}
}
}
}
setTimeout(dojo.hitch(this,this.pollLocation),_7);
};
_19();
setTimeout(dojo.hitch(this,this.pollLocation),_7);
};
dojo.addOnLoad(function(){
if("onhashchange" in dojo.global&&(!dojo.isIE||(dojo.isIE>=8&&document.compatMode!="BackCompat"))){
dojo.connect(dojo.global,"onhashchange",_b);
}else{
if(document.addEventListener){
_5=_3();
setInterval(_c,_7);
}else{
if(document.attachEvent){
_6=new _10();
}
}
}
});
dojo.hash = function(/* String? */ hash, /* Boolean? */ replace){
// summary:
// Gets or sets the hash string.
// description:
// Handles getting and setting of location.hash.
// - If no arguments are passed, acts as a getter.
// - If a string is passed, acts as a setter.
// hash:
// String: the hash is set - #string.
// replace:
// Boolean: If true, updates the hash value in the current history
// state instead of creating a new history state.
// returns:
// when used as a getter, returns the current hash string.
// when used as a setter, returns the new hash string.
// getter
if(!arguments.length){
return _getHash();
}
// setter
if(hash.charAt(0) == "#"){
hash = hash.substring(1);
}
if(replace){
_replace(hash);
}else{
location.href = "#" + hash;
}
return hash; // String
}
// Global vars
var _recentHash = null,
_ieUriMonitor = null,
_pollFrequency = dojo.config.hashPollFrequency || 100;
//Internal functions
function _getSegment(str, delimiter){
var i = str.indexOf(delimiter);
return (i >= 0) ? str.substring(i+1) : "";
}
function _getHash(){
return _getSegment(location.href, "#");
}
function _dispatchEvent(){
dojo.publish("/dojo/hashchange", [_getHash()]);
}
function _pollLocation(){
if(_getHash() === _recentHash){
return;
}
_recentHash = _getHash();
_dispatchEvent();
}
function _replace(hash){
if(_ieUriMonitor){
if(_ieUriMonitor.isTransitioning()){
setTimeout(dojo.hitch(null,_replace,hash), _pollFrequency);
return;
}
var href = _ieUriMonitor.iframe.location.href;
var index = href.indexOf('?');
// main frame will detect and update itself
_ieUriMonitor.iframe.location.replace(href.substring(0, index) + "?" + hash);
return;
}
location.replace("#"+hash);
_pollLocation();
}
function IEUriMonitor(){
// summary:
// Determine if the browser's URI has changed or if the user has pressed the
// back or forward button. If so, call _dispatchEvent.
//
// description:
// IE doesn't add changes to the URI's hash into the history unless the hash
// value corresponds to an actual named anchor in the document. To get around
// this IE difference, we use a background IFrame to maintain a back-forward
// history, by updating the IFrame's query string to correspond to the
// value of the main browser location's hash value.
//
// E.g. if the value of the browser window's location changes to
//
// #action=someAction
//
// ... then we'd update the IFrame's source to:
//
// ?action=someAction
//
// This design leads to a somewhat complex state machine, which is
// described below:
//
// s1: Stable state - neither the window's location has changed nor
// has the IFrame's location. Note that this is the 99.9% case, so
// we optimize for it.
// Transitions: s1, s2, s3
// s2: Window's location changed - when a user clicks a hyperlink or
// code programmatically changes the window's URI.
// Transitions: s4
// s3: Iframe's location changed as a result of user pressing back or
// forward - when the user presses back or forward, the location of
// the background's iframe changes to the previous or next value in
// its history.
// Transitions: s1
// s4: IEUriMonitor has programmatically changed the location of the
// background iframe, but it's location hasn't yet changed. In this
// case we do nothing because we need to wait for the iframe's
// location to reflect its actual state.
// Transitions: s4, s5
// s5: IEUriMonitor has programmatically changed the location of the
// background iframe, and the iframe's location has caught up with
// reality. In this case we need to transition to s1.
// Transitions: s1
//
// The hashchange event is always dispatched on the transition back to s1.
//
// create and append iframe
var ifr = document.createElement("iframe"),
IFRAME_ID = "dojo-hash-iframe",
ifrSrc = dojo.config.dojoBlankHtmlUrl || dojo.moduleUrl("dojo", "resources/blank.html");
ifr.id = IFRAME_ID;
ifr.src = ifrSrc + "?" + _getHash();
ifr.style.display = "none";
document.body.appendChild(ifr);
this.iframe = dojo.global[IFRAME_ID];
var recentIframeQuery, transitioning, expectedIFrameQuery, docTitle, ifrOffline,
iframeLoc = this.iframe.location;
function resetState(){
_recentHash = _getHash();
recentIframeQuery = ifrOffline ? _recentHash : _getSegment(iframeLoc.href, "?");
transitioning = false;
expectedIFrameQuery = null;
}
this.isTransitioning = function(){
return transitioning;
}
this.pollLocation = function(){
if(!ifrOffline) {
try{
//see if we can access the iframe's location without a permission denied error
var iframeSearch = _getSegment(iframeLoc.href, "?");
//good, the iframe is same origin (no thrown exception)
if(document.title != docTitle){ //sync title of main window with title of iframe.
docTitle = this.iframe.document.title = document.title;
}
}catch(e){
//permission denied - server cannot be reached.
ifrOffline = true;
console.error("dojo.hash: Error adding history entry. Server unreachable.");
}
}
var hash = _getHash();
if(transitioning && _recentHash === hash){
// we're in an iframe transition (s4 or s5)
if(ifrOffline || iframeSearch === expectedIFrameQuery){
// s5 (iframe caught up to main window or iframe offline), transition back to s1
resetState();
_dispatchEvent();
}else{
// s4 (waiting for iframe to catch up to main window)
setTimeout(dojo.hitch(this,this.pollLocation),0);
return;
}
}else if(_recentHash === hash && (ifrOffline || recentIframeQuery === iframeSearch)){
// we're in stable state (s1, iframe query == main window hash), do nothing
}else{
// the user has initiated a URL change somehow.
// sync iframe query <-> main window hash
if(_recentHash !== hash){
// s2 (main window location changed), set iframe url and transition to s4
_recentHash = hash;
transitioning = true;
expectedIFrameQuery = hash;
ifr.src = ifrSrc + "?" + expectedIFrameQuery;
ifrOffline = false; //we're updating the iframe src - set offline to false so we can check again on next poll.
setTimeout(dojo.hitch(this,this.pollLocation),0); //yielded transition to s4 while iframe reloads.
return;
}else if(!ifrOffline){
// s3 (iframe location changed via back/forward button), set main window url and transition to s1.
location.href = "#" + iframeLoc.search.substring(1);
resetState();
_dispatchEvent();
}
}
setTimeout(dojo.hitch(this,this.pollLocation), _pollFrequency);
}
resetState(); // initialize state (transition to s1)
setTimeout(dojo.hitch(this,this.pollLocation), _pollFrequency);
}
dojo.addOnLoad(function(){
if("onhashchange" in dojo.global && (!dojo.isIE || (dojo.isIE >= 8 && document.compatMode != "BackCompat"))){ //need this IE browser test because "onhashchange" exists in IE8 in IE7 mode
dojo.connect(dojo.global,"onhashchange",_dispatchEvent);
}else{
if(document.addEventListener){ // Non-IE
_recentHash = _getHash();
setInterval(_pollLocation, _pollFrequency); //Poll the window location for changes
}else if(document.attachEvent){ // IE7-
//Use hidden iframe in versions of IE that don't have onhashchange event
_ieUriMonitor = new IEUriMonitor();
}
// else non-supported browser, do nothing.
}
});
})();
}

@ -5,141 +5,327 @@
*/
if(!dojo._hasResource["dojo.html"]){
dojo._hasResource["dojo.html"]=true;
if(!dojo._hasResource["dojo.html"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.html"] = true;
dojo.provide("dojo.html");
// the parser might be needed..
dojo.require("dojo.parser");
(function(){
var _1=0,d=dojo;
dojo.html._secureForInnerHtml=function(_2){
return _2.replace(/(?:\s*<!DOCTYPE\s[^>]+>|<title[^>]*>[\s\S]*?<\/title>)/ig,"");
};
dojo.html._emptyNode=dojo.empty;
dojo.html._setNodeContent=function(_3,_4){
d.empty(_3);
if(_4){
if(typeof _4=="string"){
_4=d._toDom(_4,_3.ownerDocument);
}
if(!_4.nodeType&&d.isArrayLike(_4)){
for(var _5=_4.length,i=0;i<_4.length;i=_5==_4.length?i+1:0){
d.place(_4[i],_3,"last");
}
}else{
d.place(_4,_3,"last");
}
}
return _3;
};
dojo.declare("dojo.html._ContentSetter",null,{node:"",content:"",id:"",cleanContent:false,extractContent:false,parseContent:false,constructor:function(_6,_7){
dojo.mixin(this,_6||{});
_7=this.node=dojo.byId(this.node||_7);
if(!this.id){
this.id=["Setter",(_7)?_7.id||_7.tagName:"",_1++].join("_");
}
},set:function(_8,_9){
if(undefined!==_8){
this.content=_8;
}
if(_9){
this._mixin(_9);
}
this.onBegin();
this.setContent();
this.onEnd();
return this.node;
},setContent:function(){
var _a=this.node;
if(!_a){
throw new Error(this.declaredClass+": setContent given no node");
}
try{
_a=dojo.html._setNodeContent(_a,this.content);
}
catch(e){
var _b=this.onContentError(e);
try{
_a.innerHTML=_b;
}
catch(e){
console.error("Fatal "+this.declaredClass+".setContent could not change content due to "+e.message,e);
}
}
this.node=_a;
},empty:function(){
if(this.parseResults&&this.parseResults.length){
dojo.forEach(this.parseResults,function(w){
if(w.destroy){
w.destroy();
}
});
delete this.parseResults;
}
dojo.html._emptyNode(this.node);
},onBegin:function(){
var _c=this.content;
if(dojo.isString(_c)){
if(this.cleanContent){
_c=dojo.html._secureForInnerHtml(_c);
}
if(this.extractContent){
var _d=_c.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);
if(_d){
_c=_d[1];
}
}
}
this.empty();
this.content=_c;
return this.node;
},onEnd:function(){
if(this.parseContent){
this._parse();
}
return this.node;
},tearDown:function(){
delete this.parseResults;
delete this.node;
delete this.content;
},onContentError:function(_e){
return "Error occured setting content: "+_e;
},_mixin:function(_f){
var _10={},key;
for(key in _f){
if(key in _10){
continue;
}
this[key]=_f[key];
}
},_parse:function(){
var _11=this.node;
try{
this.parseResults=dojo.parser.parse({rootNode:_11,dir:this.dir,lang:this.lang});
}
catch(e){
this._onError("Content",e,"Error parsing in _ContentSetter#"+this.id);
}
},_onError:function(_12,err,_13){
var _14=this["on"+_12+"Error"].call(this,err);
if(_13){
console.error(_13,err);
}else{
if(_14){
dojo.html._setNodeContent(this.node,_14,true);
}
}
}});
dojo.html.set=function(_15,_16,_17){
if(undefined==_16){
console.warn("dojo.html.set: no cont argument provided, using empty string");
_16="";
}
if(!_17){
return dojo.html._setNodeContent(_15,_16,true);
}else{
var op=new dojo.html._ContentSetter(dojo.mixin(_17,{content:_16,node:_15}));
return op.set();
}
};
(function(){ // private scope, sort of a namespace
// idCounter is incremented with each instantiation to allow asignment of a unique id for tracking, logging purposes
var idCounter = 0,
d = dojo;
dojo.html._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
};
/*====
dojo.html._emptyNode = function(node){
// summary:
// removes all child nodes from the given node
// node: DOMNode
// the parent element
};
=====*/
dojo.html._emptyNode = dojo.empty;
dojo.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
// always empty
d.empty(node);
if(cont) {
if(typeof cont == "string") {
cont = d._toDom(cont, node.ownerDocument);
}
if(!cont.nodeType && d.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) {
d.place( cont[i], node, "last");
}
} else {
// pass nodes, documentFragments and unknowns through to dojo.place
d.place(cont, node, "last");
}
}
// return DomNode
return node;
};
// we wrap up the content-setting operation in a object
dojo.declare("dojo.html._ContentSetter", null,
{
// node: DomNode|String
// An node which will be the parent element that we set content into
node: "",
// content: String|DomNode|DomNode[]
// The content to be placed in the node. Can be an HTML string, a node reference, or a enumerable list of nodes
content: "",
// id: String?
// Usually only used internally, and auto-generated with each instance
id: "",
// cleanContent: Boolean
// Should the content be treated as a full html document,
// and the real content stripped of <html>, <body> wrapper before injection
cleanContent: false,
// extractContent: Boolean
// Should the content be treated as a full html document, and the real content stripped of <html>, <body> wrapper before injection
extractContent: false,
// parseContent: Boolean
// Should the node by passed to the parser after the new content is set
parseContent: false,
// lifecyle methods
constructor: function(/* Object */params, /* String|DomNode */node){
// summary:
// Provides a configurable, extensible object to wrap the setting on content on a node
// call the set() method to actually set the content..
// the original params are mixed directly into the instance "this"
dojo.mixin(this, params || {});
// give precedence to params.node vs. the node argument
// and ensure its a node, not an id string
node = this.node = dojo.byId( this.node || node );
if(!this.id){
this.id = [
"Setter",
(node) ? node.id || node.tagName : "",
idCounter++
].join("_");
}
},
set: function(/* String|DomNode|NodeList? */ cont, /* Object? */ params){
// summary:
// front-end to the set-content sequence
// cont:
// An html string, node or enumerable list of nodes for insertion into the dom
// If not provided, the object's content property will be used
if(undefined !== cont){
this.content = cont;
}
// in the re-use scenario, set needs to be able to mixin new configuration
if(params){
this._mixin(params);
}
this.onBegin();
this.setContent();
this.onEnd();
return this.node;
},
setContent: function(){
// summary:
// sets the content on the node
var node = this.node;
if(!node) {
// can't proceed
throw new Error(this.declaredClass + ": setContent given no node");
}
try{
node = dojo.html._setNodeContent(node, this.content);
}catch(e){
// check if a domfault occurs when we are appending this.errorMessage
// like for instance if domNode is a UL and we try append a DIV
// FIXME: need to allow the user to provide a content error message string
var errMess = this.onContentError(e);
try{
node.innerHTML = errMess;
}catch(e){
console.error('Fatal ' + this.declaredClass + '.setContent could not change content due to '+e.message, e);
}
}
// always put back the node for the next method
this.node = node; // DomNode
},
empty: function() {
// summary
// cleanly empty out existing content
// destroy any widgets from a previous run
// NOTE: if you dont want this you'll need to empty
// the parseResults array property yourself to avoid bad things happenning
if(this.parseResults && this.parseResults.length) {
dojo.forEach(this.parseResults, function(w) {
if(w.destroy){
w.destroy();
}
});
delete this.parseResults;
}
// this is fast, but if you know its already empty or safe, you could
// override empty to skip this step
dojo.html._emptyNode(this.node);
},
onBegin: function(){
// summary
// Called after instantiation, but before set();
// It allows modification of any of the object properties
// - including the node and content provided - before the set operation actually takes place
// This default implementation checks for cleanContent and extractContent flags to
// optionally pre-process html string content
var cont = this.content;
if(dojo.isString(cont)){
if(this.cleanContent){
cont = dojo.html._secureForInnerHtml(cont);
}
if(this.extractContent){
var match = cont.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);
if(match){ cont = match[1]; }
}
}
// clean out the node and any cruft associated with it - like widgets
this.empty();
this.content = cont;
return this.node; /* DomNode */
},
onEnd: function(){
// summary
// Called after set(), when the new content has been pushed into the node
// It provides an opportunity for post-processing before handing back the node to the caller
// This default implementation checks a parseContent flag to optionally run the dojo parser over the new content
if(this.parseContent){
// populates this.parseResults if you need those..
this._parse();
}
return this.node; /* DomNode */
},
tearDown: function(){
// summary
// manually reset the Setter instance if its being re-used for example for another set()
// description
// tearDown() is not called automatically.
// In normal use, the Setter instance properties are simply allowed to fall out of scope
// but the tearDown method can be called to explicitly reset this instance.
delete this.parseResults;
delete this.node;
delete this.content;
},
onContentError: function(err){
return "Error occured setting content: " + err;
},
_mixin: function(params){
// mix properties/methods into the instance
// TODO: the intention with tearDown is to put the Setter's state
// back to that of the original constructor (vs. deleting/resetting everything regardless of ctor params)
// so we could do something here to move the original properties aside for later restoration
var empty = {}, key;
for(key in params){
if(key in empty){ continue; }
// TODO: here's our opportunity to mask the properties we dont consider configurable/overridable
// .. but history shows we'll almost always guess wrong
this[key] = params[key];
}
},
_parse: function(){
// summary:
// runs the dojo parser over the node contents, storing any results in this.parseResults
// Any errors resulting from parsing are passed to _onError for handling
var rootNode = this.node;
try{
// store the results (widgets, whatever) for potential retrieval
this.parseResults = dojo.parser.parse({
rootNode: rootNode,
dir: this.dir,
lang: this.lang
});
}catch(e){
this._onError('Content', e, "Error parsing in _ContentSetter#"+this.id);
}
},
_onError: function(type, err, consoleText){
// summary:
// shows user the string that is returned by on[type]Error
// overide/implement on[type]Error and return your own string to customize
var errText = this['on' + type + 'Error'].call(this, err);
if(consoleText){
console.error(consoleText, err);
}else if(errText){ // a empty string won't change current content
dojo.html._setNodeContent(this.node, errText, true);
}
}
}); // end dojo.declare()
dojo.html.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")
// 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
// 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
// or the other capabilities as defined by the params object for this method.
// node:
// the parent element that will receive the content
// cont:
// 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
// params:
// Optional flags/properties to configure the content-setting. See dojo.html._ContentSetter
// example:
// A safe string/node/nodelist content replacement/injection with hooks for extension
// Example Usage:
// dojo.html.set(node, "some string");
// dojo.html.set(node, contentNode, {options});
// dojo.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 dojo.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 dojo.html._ContentSetter(dojo.mixin(
params,
{ content: cont, node: node }
));
return op.set();
}
};
})();
}

@ -5,167 +5,254 @@
*/
if(!dojo._hasResource["dojo.i18n"]){
dojo._hasResource["dojo.i18n"]=true;
if(!dojo._hasResource["dojo.i18n"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.i18n"] = true;
dojo.provide("dojo.i18n");
dojo.i18n.getLocalization=function(_1,_2,_3){
_3=dojo.i18n.normalizeLocale(_3);
var _4=_3.split("-");
var _5=[_1,"nls",_2].join(".");
var _6=dojo._loadedModules[_5];
if(_6){
var _7;
for(var i=_4.length;i>0;i--){
var _8=_4.slice(0,i).join("_");
if(_6[_8]){
_7=_6[_8];
break;
}
}
if(!_7){
_7=_6.ROOT;
}
if(_7){
var _9=function(){
};
_9.prototype=_7;
return new _9();
}
}
throw new Error("Bundle not found: "+_2+" in "+_1+" , locale="+_3);
/*=====
dojo.i18n = {
// summary: Utility classes to enable loading of resources for internationalization (i18n)
};
dojo.i18n.normalizeLocale=function(_a){
var _b=_a?_a.toLowerCase():dojo.locale;
if(_b=="root"){
_b="ROOT";
}
return _b;
=====*/
dojo.i18n.getLocalization = function(/*String*/packageName, /*String*/bundleName, /*String?*/locale){
// summary:
// Returns an Object containing the localization for a given resource
// bundle in a package, matching the specified locale.
// description:
// Returns a hash containing name/value pairs in its prototypesuch
// that values can be easily overridden. Throws an exception if the
// bundle is not found. Bundle must have already been loaded by
// `dojo.requireLocalization()` or by a build optimization step. NOTE:
// try not to call this method as part of an object property
// definition (`var foo = { bar: dojo.i18n.getLocalization() }`). In
// some loading situations, the bundle may not be available in time
// for the object definition. Instead, call this method inside a
// function that is run after all modules load or the page loads (like
// in `dojo.addOnLoad()`), or in a widget lifecycle method.
// packageName:
// package which is associated with this resource
// bundleName:
// the base filename of the resource bundle (without the ".js" suffix)
// locale:
// the variant to load (optional). By default, the locale defined by
// the host environment: dojo.locale
locale = dojo.i18n.normalizeLocale(locale);
// look for nearest locale match
var elements = locale.split('-');
var module = [packageName,"nls",bundleName].join('.');
var bundle = dojo._loadedModules[module];
if(bundle){
var localization;
for(var i = elements.length; i > 0; i--){
var loc = elements.slice(0, i).join('_');
if(bundle[loc]){
localization = bundle[loc];
break;
}
}
if(!localization){
localization = bundle.ROOT;
}
// make a singleton prototype so that the caller won't accidentally change the values globally
if(localization){
var clazz = function(){};
clazz.prototype = localization;
return new clazz(); // Object
}
}
throw new Error("Bundle not found: " + bundleName + " in " + packageName+" , locale=" + locale);
};
dojo.i18n._requireLocalization=function(_c,_d,_e,_f){
var _10=dojo.i18n.normalizeLocale(_e);
var _11=[_c,"nls",_d].join(".");
var _12="";
if(_f){
var _13=_f.split(",");
for(var i=0;i<_13.length;i++){
if(_10["indexOf"](_13[i])==0){
if(_13[i].length>_12.length){
_12=_13[i];
}
}
}
if(!_12){
_12="ROOT";
}
}
var _14=_f?_12:_10;
var _15=dojo._loadedModules[_11];
var _16=null;
if(_15){
if(dojo.config.localizationComplete&&_15._built){
return;
}
var _17=_14.replace(/-/g,"_");
var _18=_11+"."+_17;
_16=dojo._loadedModules[_18];
}
if(!_16){
_15=dojo["provide"](_11);
var _19=dojo._getModuleSymbols(_c);
var _1a=_19.concat("nls").join("/");
var _1b;
dojo.i18n._searchLocalePath(_14,_f,function(loc){
var _1c=loc.replace(/-/g,"_");
var _1d=_11+"."+_1c;
var _1e=false;
if(!dojo._loadedModules[_1d]){
dojo["provide"](_1d);
var _1f=[_1a];
if(loc!="ROOT"){
_1f.push(loc);
}
_1f.push(_d);
var _20=_1f.join("/")+".js";
_1e=dojo._loadPath(_20,null,function(_21){
var _22=function(){
dojo.i18n.normalizeLocale = function(/*String?*/locale){
// summary:
// Returns canonical form of locale, as used by Dojo.
//
// description:
// All variants are case-insensitive and are separated by '-' as specified in [RFC 3066](http://www.ietf.org/rfc/rfc3066.txt).
// If no locale is specified, the dojo.locale is returned. dojo.locale is defined by
// the user agent's locale unless overridden by djConfig.
var result = locale ? locale.toLowerCase() : dojo.locale;
if(result == "root"){
result = "ROOT";
}
return result; // String
};
_22.prototype=_1b;
_15[_1c]=new _22();
for(var j in _21){
_15[_1c][j]=_21[j];
}
});
}else{
_1e=true;
}
if(_1e&&_15[_1c]){
_1b=_15[_1c];
}else{
_15[_1c]=_1b;
}
if(_f){
return true;
}
});
}
if(_f&&_10!=_12){
_15[_10.replace(/-/g,"_")]=_15[_12.replace(/-/g,"_")];
}
dojo.i18n._requireLocalization = function(/*String*/moduleName, /*String*/bundleName, /*String?*/locale, /*String?*/availableFlatLocales){
// summary:
// See dojo.requireLocalization()
// description:
// Called by the bootstrap, but factored out so that it is only
// included in the build when needed.
var targetLocale = dojo.i18n.normalizeLocale(locale);
var bundlePackage = [moduleName, "nls", bundleName].join(".");
// NOTE:
// When loading these resources, the packaging does not match what is
// on disk. This is an implementation detail, as this is just a
// private data structure to hold the loaded resources. e.g.
// `tests/hello/nls/en-us/salutations.js` is loaded as the object
// `tests.hello.nls.salutations.en_us={...}` The structure on disk is
// intended to be most convenient for developers and translators, but
// in memory it is more logical and efficient to store in a different
// order. Locales cannot use dashes, since the resulting path will
// not evaluate as valid JS, so we translate them to underscores.
//Find the best-match locale to load if we have available flat locales.
var bestLocale = "";
if(availableFlatLocales){
var flatLocales = availableFlatLocales.split(",");
for(var i = 0; i < flatLocales.length; i++){
//Locale must match from start of string.
//Using ["indexOf"] so customBase builds do not see
//this as a dojo._base.array dependency.
if(targetLocale["indexOf"](flatLocales[i]) == 0){
if(flatLocales[i].length > bestLocale.length){
bestLocale = flatLocales[i];
}
}
}
if(!bestLocale){
bestLocale = "ROOT";
}
}
//See if the desired locale is already loaded.
var tempLocale = availableFlatLocales ? bestLocale : targetLocale;
var bundle = dojo._loadedModules[bundlePackage];
var localizedBundle = null;
if(bundle){
if(dojo.config.localizationComplete && bundle._built){return;}
var jsLoc = tempLocale.replace(/-/g, '_');
var translationPackage = bundlePackage+"."+jsLoc;
localizedBundle = dojo._loadedModules[translationPackage];
}
if(!localizedBundle){
bundle = dojo["provide"](bundlePackage);
var syms = dojo._getModuleSymbols(moduleName);
var modpath = syms.concat("nls").join("/");
var parent;
dojo.i18n._searchLocalePath(tempLocale, availableFlatLocales, function(loc){
var jsLoc = loc.replace(/-/g, '_');
var translationPackage = bundlePackage + "." + jsLoc;
var loaded = false;
if(!dojo._loadedModules[translationPackage]){
// Mark loaded whether it's found or not, so that further load attempts will not be made
dojo["provide"](translationPackage);
var module = [modpath];
if(loc != "ROOT"){module.push(loc);}
module.push(bundleName);
var filespec = module.join("/") + '.js';
loaded = dojo._loadPath(filespec, null, function(hash){
// Use singleton with prototype to point to parent bundle, then mix-in result from loadPath
var clazz = function(){};
clazz.prototype = parent;
bundle[jsLoc] = new clazz();
for(var j in hash){ bundle[jsLoc][j] = hash[j]; }
});
}else{
loaded = true;
}
if(loaded && bundle[jsLoc]){
parent = bundle[jsLoc];
}else{
bundle[jsLoc] = parent;
}
if(availableFlatLocales){
//Stop the locale path searching if we know the availableFlatLocales, since
//the first call to this function will load the only bundle that is needed.
return true;
}
});
}
//Save the best locale bundle as the target locale bundle when we know the
//the available bundles.
if(availableFlatLocales && targetLocale != bestLocale){
bundle[targetLocale.replace(/-/g, '_')] = bundle[bestLocale.replace(/-/g, '_')];
}
};
(function(){
var _23=dojo.config.extraLocale;
if(_23){
if(!_23 instanceof Array){
_23=[_23];
}
var req=dojo.i18n._requireLocalization;
dojo.i18n._requireLocalization=function(m,b,_24,_25){
req(m,b,_24,_25);
if(_24){
return;
}
for(var i=0;i<_23.length;i++){
req(m,b,_23[i],_25);
}
};
}
// If other locales are used, dojo.requireLocalization should load them as
// well, by default.
//
// Override dojo.requireLocalization to do load the default bundle, then
// iterate through the extraLocale list and load those translations as
// well, unless a particular locale was requested.
var extra = dojo.config.extraLocale;
if(extra){
if(!extra instanceof Array){
extra = [extra];
}
var req = dojo.i18n._requireLocalization;
dojo.i18n._requireLocalization = function(m, b, locale, availableFlatLocales){
req(m,b,locale, availableFlatLocales);
if(locale){return;}
for(var i=0; i<extra.length; i++){
req(m,b,extra[i], availableFlatLocales);
}
};
}
})();
dojo.i18n._searchLocalePath=function(_26,_27,_28){
_26=dojo.i18n.normalizeLocale(_26);
var _29=_26.split("-");
var _2a=[];
for(var i=_29.length;i>0;i--){
_2a.push(_29.slice(0,i).join("-"));
}
_2a.push(false);
if(_27){
_2a.reverse();
}
for(var j=_2a.length-1;j>=0;j--){
var loc=_2a[j]||"ROOT";
var _2b=_28(loc);
if(_2b){
break;
}
}
};
dojo.i18n._preloadLocalizations=function(_2c,_2d){
function _2e(_2f){
_2f=dojo.i18n.normalizeLocale(_2f);
dojo.i18n._searchLocalePath(_2f,true,function(loc){
for(var i=0;i<_2d.length;i++){
if(_2d[i]==loc){
dojo["require"](_2c+"_"+loc);
return true;
}
}
return false;
});
dojo.i18n._searchLocalePath = function(/*String*/locale, /*Boolean*/down, /*Function*/searchFunc){
// summary:
// A helper method to assist in searching for locale-based resources.
// Will iterate through the variants of a particular locale, either up
// or down, executing a callback function. For example, "en-us" and
// true will try "en-us" followed by "en" and finally "ROOT".
locale = dojo.i18n.normalizeLocale(locale);
var elements = locale.split('-');
var searchlist = [];
for(var i = elements.length; i > 0; i--){
searchlist.push(elements.slice(0, i).join('-'));
}
searchlist.push(false);
if(down){searchlist.reverse();}
for(var j = searchlist.length - 1; j >= 0; j--){
var loc = searchlist[j] || "ROOT";
var stop = searchFunc(loc);
if(stop){ break; }
}
};
_2e();
var _30=dojo.config.extraLocale||[];
for(var i=0;i<_30.length;i++){
_2e(_30[i]);
}
dojo.i18n._preloadLocalizations = function(/*String*/bundlePrefix, /*Array*/localesGenerated){
// summary:
// Load built, flattened resource bundles, if available for all
// locales used in the page. Only called by built layer files.
function preload(locale){
locale = dojo.i18n.normalizeLocale(locale);
dojo.i18n._searchLocalePath(locale, true, function(loc){
for(var i=0; i<localesGenerated.length;i++){
if(localesGenerated[i] == loc){
dojo["require"](bundlePrefix+"_"+loc);
return true; // Boolean
}
}
return false; // Boolean
});
}
preload();
var extra = dojo.config.extraLocale||[];
for(var i=0; i<extra.length; i++){
preload(extra[i]);
}
};
}

@ -5,261 +5,407 @@
*/
if(!dojo._hasResource["dojo.io.iframe"]){
dojo._hasResource["dojo.io.iframe"]=true;
if(!dojo._hasResource["dojo.io.iframe"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.io.iframe"] = true;
dojo.provide("dojo.io.iframe");
dojo.io.iframe={create:function(_1,_2,_3){
if(window[_1]){
return window[_1];
}
if(window.frames[_1]){
return window.frames[_1];
}
var _4=null;
var _5=_3;
if(!_5){
if(dojo.config["useXDomain"]&&!dojo.config["dojoBlankHtmlUrl"]){
console.warn("dojo.io.iframe.create: When using cross-domain Dojo builds,"+" please save dojo/resources/blank.html to your domain and set djConfig.dojoBlankHtmlUrl"+" to the path on your domain to blank.html");
}
_5=(dojo.config["dojoBlankHtmlUrl"]||dojo.moduleUrl("dojo","resources/blank.html"));
}
var _6=dojo.isIE?"<iframe name=\""+_1+"\" src=\""+_5+"\" onload=\""+_2+"\">":"iframe";
_4=dojo.doc.createElement(_6);
with(_4){
name=_1;
setAttribute("name",_1);
id=_1;
}
dojo.body().appendChild(_4);
window[_1]=_4;
with(_4.style){
if(!(dojo.isSafari<3)){
position="absolute";
}
left=top="1px";
height=width="1px";
visibility="hidden";
}
if(!dojo.isIE){
this.setSrc(_4,_5,true);
_4.onload=new Function(_2);
}
return _4;
},setSrc:function(_7,_8,_9){
try{
if(!_9){
if(dojo.isWebKit){
_7.location=_8;
}else{
frames[_7.name].location=_8;
}
}else{
var _a;
if(dojo.isIE||dojo.isWebKit>521){
_a=_7.contentWindow.document;
}else{
if(dojo.isSafari){
_a=_7.document;
}else{
_a=_7.contentWindow;
}
}
if(!_a){
_7.location=_8;
return;
}else{
_a.location.replace(_8);
}
}
}
catch(e){
}
},doc:function(_b){
var _c=_b.contentDocument||(((_b.name)&&(_b.document)&&(dojo.doc.getElementsByTagName("iframe")[_b.name].contentWindow)&&(dojo.doc.getElementsByTagName("iframe")[_b.name].contentWindow.document)))||((_b.name)&&(dojo.doc.frames[_b.name])&&(dojo.doc.frames[_b.name].document))||null;
return _c;
},send:function(_d){
if(!this["_frame"]){
this._frame=this.create(this._iframeName,dojo._scopeName+".io.iframe._iframeOnload();");
}
var _e=dojo._ioSetArgs(_d,function(_f){
_f.canceled=true;
_f.ioArgs._callNext();
},function(dfd){
var _10=null;
try{
var _11=dfd.ioArgs;
var dii=dojo.io.iframe;
var ifd=dii.doc(dii._frame);
var _12=_11.handleAs;
_10=ifd;
if(_12!="html"){
if(_12=="xml"){
if(dojo.isIE){
dojo.query("a",dii._frame.contentWindow.document.documentElement).orphan();
var _13=(dii._frame.contentWindow.document).documentElement.innerText;
_13=_13.replace(/>\s+</g,"><");
_13=dojo.trim(_13);
var _14={responseText:_13};
_10=dojo._contentHandlers["xml"](_14);
}
}else{
_10=ifd.getElementsByTagName("textarea")[0].value;
if(_12=="json"){
_10=dojo.fromJson(_10);
}else{
if(_12=="javascript"){
_10=dojo.eval(_10);
}
}
}
}
}
catch(e){
_10=e;
}
finally{
_11._callNext();
}
return _10;
},function(_15,dfd){
dfd.ioArgs._hasError=true;
dfd.ioArgs._callNext();
return _15;
});
_e.ioArgs._callNext=function(){
if(!this["_calledNext"]){
this._calledNext=true;
dojo.io.iframe._currentDfd=null;
dojo.io.iframe._fireNextRequest();
}
};
this._dfdQueue.push(_e);
this._fireNextRequest();
dojo._ioWatch(_e,function(dfd){
return !dfd.ioArgs["_hasError"];
},function(dfd){
return (!!dfd.ioArgs["_finished"]);
},function(dfd){
if(dfd.ioArgs._finished){
dfd.callback(dfd);
}else{
dfd.errback(new Error("Invalid dojo.io.iframe request state"));
}
/*=====
dojo.declare("dojo.io.iframe.__ioArgs", dojo.__IoArgs, {
constructor: function(){
// summary:
// All the properties described in the dojo.__ioArgs type, apply
// to this type. The following additional properties are allowed
// for dojo.io.iframe.send():
// method: String?
// The HTTP method to use. "GET" or "POST" are the only supported
// values. It will try to read the value from the form node's
// method, then try this argument. If neither one exists, then it
// defaults to POST.
// handleAs: String?
// Specifies what format the result data should be given to the
// load/handle callback. Valid values are: text, html, xml, json,
// javascript. IMPORTANT: For all values EXCEPT html and xml, The
// server response should be an HTML file with a textarea element.
// The response data should be inside the textarea element. Using an
// HTML document the only reliable, cross-browser way this
// transport can know when the response has loaded. For the html
// handleAs value, just return a normal HTML document. NOTE: xml
// is now supported with this transport (as of 1.1+); a known issue
// is if the XML document in question is malformed, Internet Explorer
// will throw an uncatchable error.
// content: Object?
// If "form" is one of the other args properties, then the content
// object properties become hidden form form elements. For
// instance, a content object of {name1 : "value1"} is converted
// to a hidden form element with a name of "name1" and a value of
// "value1". If there is not a "form" property, then the content
// object is converted into a name=value&name=value string, by
// using dojo.objectToQuery().
this.method = method;
this.handleAs = handleAs;
this.content = content;
}
});
return _e;
},_currentDfd:null,_dfdQueue:[],_iframeName:dojo._scopeName+"IoIframe",_fireNextRequest:function(){
try{
if((this._currentDfd)||(this._dfdQueue.length==0)){
return;
}
do{
var dfd=this._currentDfd=this._dfdQueue.shift();
}while(dfd&&dfd.canceled&&this._dfdQueue.length);
if(!dfd||dfd.canceled){
this._currentDfd=null;
return;
}
var _16=dfd.ioArgs;
var _17=_16.args;
_16._contentToClean=[];
var fn=dojo.byId(_17["form"]);
var _18=_17["content"]||{};
if(fn){
if(_18){
var _19=function(_1a,_1b){
var tn;
if(dojo.isIE){
tn=dojo.doc.createElement("<input type='hidden' name='"+_1a+"'>");
}else{
tn=dojo.doc.createElement("input");
tn.type="hidden";
tn.name=_1a;
}
tn.value=_1b;
fn.appendChild(tn);
_16._contentToClean.push(_1a);
};
for(var x in _18){
var val=_18[x];
if(dojo.isArray(val)&&val.length>1){
var i;
for(i=0;i<val.length;i++){
_19(x,val[i]);
}
}else{
if(!fn[x]){
_19(x,val);
}else{
fn[x].value=val;
}
}
}
}
var _1c=fn.getAttributeNode("action");
var _1d=fn.getAttributeNode("method");
var _1e=fn.getAttributeNode("target");
if(_17["url"]){
_16._originalAction=_1c?_1c.value:null;
if(_1c){
_1c.value=_17.url;
}else{
fn.setAttribute("action",_17.url);
}
}
if(!_1d||!_1d.value){
if(_1d){
_1d.value=(_17["method"])?_17["method"]:"post";
}else{
fn.setAttribute("method",(_17["method"])?_17["method"]:"post");
}
}
_16._originalTarget=_1e?_1e.value:null;
if(_1e){
_1e.value=this._iframeName;
}else{
fn.setAttribute("target",this._iframeName);
}
fn.target=this._iframeName;
dojo._ioNotifyStart(dfd);
fn.submit();
}else{
var _1f=_17.url+(_17.url.indexOf("?")>-1?"&":"?")+_16.query;
dojo._ioNotifyStart(dfd);
this.setSrc(this._frame,_1f,true);
}
}
catch(e){
dfd.errback(e);
}
},_iframeOnload:function(){
var dfd=this._currentDfd;
if(!dfd){
this._fireNextRequest();
return;
}
var _20=dfd.ioArgs;
var _21=_20.args;
var _22=dojo.byId(_21.form);
if(_22){
var _23=_20._contentToClean;
for(var i=0;i<_23.length;i++){
var key=_23[i];
for(var j=0;j<_22.childNodes.length;j++){
var _24=_22.childNodes[j];
if(_24.name==key){
dojo.destroy(_24);
break;
}
}
}
if(_20["_originalAction"]){
_22.setAttribute("action",_20._originalAction);
}
if(_20["_originalTarget"]){
_22.setAttribute("target",_20._originalTarget);
_22.target=_20._originalTarget;
}
=====*/
dojo.io.iframe = {
// summary:
// Sends an Ajax I/O call using and Iframe (for instance, to upload files)
create: function(/*String*/fname, /*String*/onloadstr, /*String?*/uri){
// summary:
// Creates a hidden iframe in the page. Used mostly for IO
// transports. You do not need to call this to start a
// dojo.io.iframe request. Just call send().
// fname: String
// The name of the iframe. Used for the name attribute on the
// iframe.
// onloadstr: String
// A string of JavaScript that will be executed when the content
// in the iframe loads.
// uri: String
// The value of the src attribute on the iframe element. If a
// value is not given, then dojo/resources/blank.html will be
// used.
if(window[fname]){ return window[fname]; }
if(window.frames[fname]){ return window.frames[fname]; }
var cframe = null;
var turi = uri;
if(!turi){
if(dojo.config["useXDomain"] && !dojo.config["dojoBlankHtmlUrl"]){
console.warn("dojo.io.iframe.create: When using cross-domain Dojo builds,"
+ " please save dojo/resources/blank.html to your domain and set djConfig.dojoBlankHtmlUrl"
+ " to the path on your domain to blank.html");
}
turi = (dojo.config["dojoBlankHtmlUrl"]||dojo.moduleUrl("dojo", "resources/blank.html"));
}
var ifrstr = dojo.isIE ? '<iframe name="'+fname+'" src="'+turi+'" onload="'+onloadstr+'">' : 'iframe';
cframe = dojo.doc.createElement(ifrstr);
with(cframe){
name = fname;
setAttribute("name", fname);
id = fname;
}
dojo.body().appendChild(cframe);
window[fname] = cframe;
with(cframe.style){
if(!(dojo.isSafari < 3)){
//We can't change the src in Safari 2.0.3 if absolute position. Bizarro.
position = "absolute";
}
left = top = "1px";
height = width = "1px";
visibility = "hidden";
}
if(!dojo.isIE){
this.setSrc(cframe, turi, true);
cframe.onload = new Function(onloadstr);
}
return cframe;
},
setSrc: function(/*DOMNode*/iframe, /*String*/src, /*Boolean*/replace){
//summary:
// Sets the URL that is loaded in an IFrame. The replace parameter
// indicates whether location.replace() should be used when
// changing the location of the iframe.
try{
if(!replace){
if(dojo.isWebKit){
iframe.location = src;
}else{
frames[iframe.name].location = src;
}
}else{
// Fun with DOM 0 incompatibilities!
var idoc;
//WebKit > 521 corresponds with Safari 3, which started with 522 WebKit version.
if(dojo.isIE || dojo.isWebKit > 521){
idoc = iframe.contentWindow.document;
}else if(dojo.isSafari){
idoc = iframe.document;
}else{ // if(d.isMozilla){
idoc = iframe.contentWindow;
}
//For Safari (at least 2.0.3) and Opera, if the iframe
//has just been created but it doesn't have content
//yet, then iframe.document may be null. In that case,
//use iframe.location and return.
if(!idoc){
iframe.location = src;
return;
}else{
idoc.location.replace(src);
}
}
}catch(e){
console.log("dojo.io.iframe.setSrc: ", e);
}
},
doc: function(/*DOMNode*/iframeNode){
//summary: Returns the document object associated with the iframe DOM Node argument.
var doc = iframeNode.contentDocument || // W3
(
(
(iframeNode.name) && (iframeNode.document) &&
(dojo.doc.getElementsByTagName("iframe")[iframeNode.name].contentWindow) &&
(dojo.doc.getElementsByTagName("iframe")[iframeNode.name].contentWindow.document)
)
) || // IE
(
(iframeNode.name)&&(dojo.doc.frames[iframeNode.name])&&
(dojo.doc.frames[iframeNode.name].document)
) || null;
return doc;
},
send: function(/*dojo.io.iframe.__ioArgs*/args){
//summary:
// Function that sends the request to the server.
// This transport can only process one send() request at a time, so if send() is called
//multiple times, it will queue up the calls and only process one at a time.
if(!this["_frame"]){
this._frame = this.create(this._iframeName, dojo._scopeName + ".io.iframe._iframeOnload();");
}
//Set up the deferred.
var dfd = dojo._ioSetArgs(
args,
function(/*Deferred*/dfd){
//summary: canceller function for dojo._ioSetArgs call.
dfd.canceled = true;
dfd.ioArgs._callNext();
},
function(/*Deferred*/dfd){
//summary: okHandler function for dojo._ioSetArgs call.
var value = null;
try{
var ioArgs = dfd.ioArgs;
var dii = dojo.io.iframe;
var ifd = dii.doc(dii._frame);
var handleAs = ioArgs.handleAs;
//Assign correct value based on handleAs value.
value = ifd; //html
if(handleAs != "html"){
if(handleAs == "xml"){
// FF, Saf 3+ and Opera all seem to be fine with ifd being xml. We have to
// do it manually for IE. Refs #6334.
if(dojo.isIE){
dojo.query("a", dii._frame.contentWindow.document.documentElement).orphan();
var xmlText=(dii._frame.contentWindow.document).documentElement.innerText;
xmlText=xmlText.replace(/>\s+</g, "><");
xmlText=dojo.trim(xmlText);
//Reusing some code in base dojo for handling XML content. Simpler and keeps
//Core from duplicating the effort needed to locate the XML Parser on IE.
var fauxXhr = { responseText: xmlText };
value = dojo._contentHandlers["xml"](fauxXhr); // DOMDocument
}
}else{
value = ifd.getElementsByTagName("textarea")[0].value; //text
if(handleAs == "json"){
value = dojo.fromJson(value); //json
}else if(handleAs == "javascript"){
value = dojo.eval(value); //javascript
}
}
}
}catch(e){
value = e;
}finally{
ioArgs._callNext();
}
return value;
},
function(/*Error*/error, /*Deferred*/dfd){
//summary: errHandler function for dojo._ioSetArgs call.
dfd.ioArgs._hasError = true;
dfd.ioArgs._callNext();
return error;
}
);
//Set up a function that will fire the next iframe request. Make sure it only
//happens once per deferred.
dfd.ioArgs._callNext = function(){
if(!this["_calledNext"]){
this._calledNext = true;
dojo.io.iframe._currentDfd = null;
dojo.io.iframe._fireNextRequest();
}
}
this._dfdQueue.push(dfd);
this._fireNextRequest();
//Add it the IO watch queue, to get things like timeout support.
dojo._ioWatch(
dfd,
function(/*Deferred*/dfd){
//validCheck
return !dfd.ioArgs["_hasError"];
},
function(dfd){
//ioCheck
return (!!dfd.ioArgs["_finished"]);
},
function(dfd){
//resHandle
if(dfd.ioArgs._finished){
dfd.callback(dfd);
}else{
dfd.errback(new Error("Invalid dojo.io.iframe request state"));
}
}
);
return dfd;
},
_currentDfd: null,
_dfdQueue: [],
_iframeName: dojo._scopeName + "IoIframe",
_fireNextRequest: function(){
//summary: Internal method used to fire the next request in the bind queue.
try{
if((this._currentDfd)||(this._dfdQueue.length == 0)){ return; }
//Find next deferred, skip the canceled ones.
do{
var dfd = this._currentDfd = this._dfdQueue.shift();
} while(dfd && dfd.canceled && this._dfdQueue.length);
//If no more dfds, cancel.
if(!dfd || dfd.canceled){
this._currentDfd = null;
return;
}
var ioArgs = dfd.ioArgs;
var args = ioArgs.args;
ioArgs._contentToClean = [];
var fn = dojo.byId(args["form"]);
var content = args["content"] || {};
if(fn){
if(content){
// if we have things in content, we need to add them to the form
// before submission
var pHandler = function(name, value) {
var tn;
if(dojo.isIE){
tn = dojo.doc.createElement("<input type='hidden' name='"+name+"'>");
}else{
tn = dojo.doc.createElement("input");
tn.type = "hidden";
tn.name = name;
}
tn.value = value;
fn.appendChild(tn);
ioArgs._contentToClean.push(name);
};
for(var x in content){
var val = content[x];
if(dojo.isArray(val) && val.length > 1){
var i;
for (i = 0; i < val.length; i++) {
pHandler(x,val[i]);
}
}else{
if(!fn[x]){
pHandler(x,val);
}else{
fn[x].value = val;
}
}
}
}
//IE requires going through getAttributeNode instead of just getAttribute in some form cases,
//so use it for all. See #2844
var actnNode = fn.getAttributeNode("action");
var mthdNode = fn.getAttributeNode("method");
var trgtNode = fn.getAttributeNode("target");
if(args["url"]){
ioArgs._originalAction = actnNode ? actnNode.value : null;
if(actnNode){
actnNode.value = args.url;
}else{
fn.setAttribute("action",args.url);
}
}
if(!mthdNode || !mthdNode.value){
if(mthdNode){
mthdNode.value= (args["method"]) ? args["method"] : "post";
}else{
fn.setAttribute("method", (args["method"]) ? args["method"] : "post");
}
}
ioArgs._originalTarget = trgtNode ? trgtNode.value: null;
if(trgtNode){
trgtNode.value = this._iframeName;
}else{
fn.setAttribute("target", this._iframeName);
}
fn.target = this._iframeName;
dojo._ioNotifyStart(dfd);
fn.submit();
}else{
// otherwise we post a GET string by changing URL location for the
// iframe
var tmpUrl = args.url + (args.url.indexOf("?") > -1 ? "&" : "?") + ioArgs.query;
dojo._ioNotifyStart(dfd);
this.setSrc(this._frame, tmpUrl, true);
}
}catch(e){
dfd.errback(e);
}
},
_iframeOnload: function(){
var dfd = this._currentDfd;
if(!dfd){
this._fireNextRequest();
return;
}
var ioArgs = dfd.ioArgs;
var args = ioArgs.args;
var fNode = dojo.byId(args.form);
if(fNode){
// remove all the hidden content inputs
var toClean = ioArgs._contentToClean;
for(var i = 0; i < toClean.length; i++) {
var key = toClean[i];
//Need to cycle over all nodes since we may have added
//an array value which means that more than one node could
//have the same .name value.
for(var j = 0; j < fNode.childNodes.length; j++){
var chNode = fNode.childNodes[j];
if(chNode.name == key){
dojo.destroy(chNode);
break;
}
}
}
// restore original action + target
if(ioArgs["_originalAction"]){
fNode.setAttribute("action", ioArgs._originalAction);
}
if(ioArgs["_originalTarget"]){
fNode.setAttribute("target", ioArgs._originalTarget);
fNode.target = ioArgs._originalTarget;
}
}
ioArgs._finished = true;
}
}
_20._finished=true;
}};
}

@ -5,114 +5,256 @@
*/
if(!dojo._hasResource["dojo.io.script"]){
dojo._hasResource["dojo.io.script"]=true;
if(!dojo._hasResource["dojo.io.script"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.io.script"] = true;
dojo.provide("dojo.io.script");
(function(){
var _1=dojo.isIE?"onreadystatechange":"load",_2=/complete|loaded/;
dojo.io.script={get:function(_3){
var _4=this._makeScriptDeferred(_3);
var _5=_4.ioArgs;
dojo._ioAddQueryToUrl(_5);
dojo._ioNotifyStart(_4);
if(this._canAttach(_5)){
var _6=this.attach(_5.id,_5.url,_3.frameDoc);
if(!_5.jsonp&&!_5.args.checkString){
var _7=dojo.connect(_6,_1,function(_8){
if(_8.type=="load"||_2.test(_6.readyState)){
dojo.disconnect(_7);
_5.scriptLoaded=_8;
}
/*=====
dojo.declare("dojo.io.script.__ioArgs", dojo.__IoArgs, {
constructor: function(){
// summary:
// All the properties described in the dojo.__ioArgs type, apply to this
// type as well, EXCEPT "handleAs". It is not applicable to
// dojo.io.script.get() calls, since it is implied by the usage of
// "jsonp" (response will be a JSONP call returning JSON)
// or the response is pure JavaScript defined in
// the body of the script that was attached.
// callbackParamName: String
// Deprecated as of Dojo 1.4 in favor of "jsonp", but still supported for
// legacy code. See notes for jsonp property.
// jsonp: String
// The URL parameter name that indicates the JSONP callback string.
// For instance, when using Yahoo JSONP calls it is normally,
// jsonp: "callback". For AOL JSONP calls it is normally
// jsonp: "c".
// checkString: String
// A string of JavaScript that when evaluated like so:
// "typeof(" + checkString + ") != 'undefined'"
// being true means that the script fetched has been loaded.
// Do not use this if doing a JSONP type of call (use callbackParamName instead).
// frameDoc: Document
// The Document object for a child iframe. If this is passed in, the script
// will be attached to that document. This can be helpful in some comet long-polling
// scenarios with Firefox and Opera.
this.callbackParamName = callbackParamName;
this.jsonp = jsonp;
this.checkString = checkString;
this.frameDoc = frameDoc;
}
});
}
}
dojo._ioWatch(_4,this._validCheck,this._ioCheck,this._resHandle);
return _4;
},attach:function(id,_9,_a){
var _b=(_a||dojo.doc);
var _c=_b.createElement("script");
_c.type="text/javascript";
_c.src=_9;
_c.id=id;
_c.charset="utf-8";
return _b.getElementsByTagName("head")[0].appendChild(_c);
},remove:function(id,_d){
dojo.destroy(dojo.byId(id,_d));
if(this["jsonp_"+id]){
delete this["jsonp_"+id];
}
},_makeScriptDeferred:function(_e){
var _f=dojo._ioSetArgs(_e,this._deferredCancel,this._deferredOk,this._deferredError);
var _10=_f.ioArgs;
_10.id=dojo._scopeName+"IoScript"+(this._counter++);
_10.canDelete=false;
_10.jsonp=_e.callbackParamName||_e.jsonp;
if(_10.jsonp){
_10.query=_10.query||"";
if(_10.query.length>0){
_10.query+="&";
}
_10.query+=_10.jsonp+"="+(_e.frameDoc?"parent.":"")+dojo._scopeName+".io.script.jsonp_"+_10.id+"._jsonpCallback";
_10.frameDoc=_e.frameDoc;
_10.canDelete=true;
_f._jsonpCallback=this._jsonpCallback;
this["jsonp_"+_10.id]=_f;
}
return _f;
},_deferredCancel:function(dfd){
dfd.canceled=true;
if(dfd.ioArgs.canDelete){
dojo.io.script._addDeadScript(dfd.ioArgs);
}
},_deferredOk:function(dfd){
var _11=dfd.ioArgs;
if(_11.canDelete){
dojo.io.script._addDeadScript(_11);
}
return _11.json||_11.scriptLoaded||_11;
},_deferredError:function(_12,dfd){
if(dfd.ioArgs.canDelete){
if(_12.dojoType=="timeout"){
dojo.io.script.remove(dfd.ioArgs.id,dfd.ioArgs.frameDoc);
}else{
dojo.io.script._addDeadScript(dfd.ioArgs);
}
}
return _12;
},_deadScripts:[],_counter:1,_addDeadScript:function(_13){
dojo.io.script._deadScripts.push({id:_13.id,frameDoc:_13.frameDoc});
_13.frameDoc=null;
},_validCheck:function(dfd){
var _14=dojo.io.script;
var _15=_14._deadScripts;
if(_15&&_15.length>0){
for(var i=0;i<_15.length;i++){
_14.remove(_15[i].id,_15[i].frameDoc);
_15[i].frameDoc=null;
}
dojo.io.script._deadScripts=[];
}
return true;
},_ioCheck:function(dfd){
var _16=dfd.ioArgs;
if(_16.json||(_16.scriptLoaded&&!_16.args.checkString)){
return true;
}
var _17=_16.args.checkString;
if(_17&&eval("typeof("+_17+") != 'undefined'")){
return true;
}
return false;
},_resHandle:function(dfd){
if(dojo.io.script._ioCheck(dfd)){
dfd.callback(dfd);
}else{
dfd.errback(new Error("inconceivable dojo.io.script._resHandle error"));
}
},_canAttach:function(_18){
return true;
},_jsonpCallback:function(_19){
this.ioArgs.json=_19;
}};
=====*/
;(function(){
var loadEvent = dojo.isIE ? "onreadystatechange" : "load",
readyRegExp = /complete|loaded/;
dojo.io.script = {
get: function(/*dojo.io.script.__ioArgs*/args){
// summary:
// sends a get request using a dynamically created script tag.
var dfd = this._makeScriptDeferred(args);
var ioArgs = dfd.ioArgs;
dojo._ioAddQueryToUrl(ioArgs);
dojo._ioNotifyStart(dfd);
if(this._canAttach(ioArgs)){
var node = this.attach(ioArgs.id, ioArgs.url, args.frameDoc);
//If not a jsonp callback or a polling checkString case, bind
//to load event on the script tag.
if(!ioArgs.jsonp && !ioArgs.args.checkString){
var handle = dojo.connect(node, loadEvent, function(evt){
if(evt.type == "load" || readyRegExp.test(node.readyState)){
dojo.disconnect(handle);
ioArgs.scriptLoaded = evt;
}
});
}
}
dojo._ioWatch(dfd, this._validCheck, this._ioCheck, this._resHandle);
return dfd;
},
attach: function(/*String*/id, /*String*/url, /*Document?*/frameDocument){
// summary:
// creates a new <script> tag pointing to the specified URL and
// adds it to the document.
// description:
// Attaches the script element to the DOM. Use this method if you
// just want to attach a script to the DOM and do not care when or
// if it loads.
var doc = (frameDocument || dojo.doc);
var element = doc.createElement("script");
element.type = "text/javascript";
element.src = url;
element.id = id;
element.charset = "utf-8";
return doc.getElementsByTagName("head")[0].appendChild(element);
},
remove: function(/*String*/id, /*Document?*/frameDocument){
//summary: removes the script element with the given id, from the given frameDocument.
//If no frameDocument is passed, the current document is used.
dojo.destroy(dojo.byId(id, frameDocument));
//Remove the jsonp callback on dojo.io.script, if it exists.
if(this["jsonp_" + id]){
delete this["jsonp_" + id];
}
},
_makeScriptDeferred: function(/*Object*/args){
//summary:
// sets up a Deferred object for an IO request.
var dfd = dojo._ioSetArgs(args, this._deferredCancel, this._deferredOk, this._deferredError);
var ioArgs = dfd.ioArgs;
ioArgs.id = dojo._scopeName + "IoScript" + (this._counter++);
ioArgs.canDelete = false;
//Special setup for jsonp case
ioArgs.jsonp = args.callbackParamName || args.jsonp;
if(ioArgs.jsonp){
//Add the jsonp parameter.
ioArgs.query = ioArgs.query || "";
if(ioArgs.query.length > 0){
ioArgs.query += "&";
}
ioArgs.query += ioArgs.jsonp
+ "="
+ (args.frameDoc ? "parent." : "")
+ dojo._scopeName + ".io.script.jsonp_" + ioArgs.id + "._jsonpCallback";
ioArgs.frameDoc = args.frameDoc;
//Setup the Deferred to have the jsonp callback.
ioArgs.canDelete = true;
dfd._jsonpCallback = this._jsonpCallback;
this["jsonp_" + ioArgs.id] = dfd;
}
return dfd; // dojo.Deferred
},
_deferredCancel: function(/*Deferred*/dfd){
//summary: canceller function for dojo._ioSetArgs call.
//DO NOT use "this" and expect it to be dojo.io.script.
dfd.canceled = true;
if(dfd.ioArgs.canDelete){
dojo.io.script._addDeadScript(dfd.ioArgs);
}
},
_deferredOk: function(/*Deferred*/dfd){
//summary: okHandler function for dojo._ioSetArgs call.
//DO NOT use "this" and expect it to be dojo.io.script.
var ioArgs = dfd.ioArgs;
//Add script to list of things that can be removed.
if(ioArgs.canDelete){
dojo.io.script._addDeadScript(ioArgs);
}
//Favor JSONP responses, script load events then lastly ioArgs.
//The ioArgs are goofy, but cannot return the dfd since that stops
//the callback chain in Deferred. The return value is not that important
//in that case, probably a checkString case.
return ioArgs.json || ioArgs.scriptLoaded || ioArgs;
},
_deferredError: function(/*Error*/error, /*Deferred*/dfd){
//summary: errHandler function for dojo._ioSetArgs call.
if(dfd.ioArgs.canDelete){
//DO NOT use "this" and expect it to be dojo.io.script.
if(error.dojoType == "timeout"){
//For timeouts, remove the script element immediately to
//avoid a response from it coming back later and causing trouble.
dojo.io.script.remove(dfd.ioArgs.id, dfd.ioArgs.frameDoc);
}else{
dojo.io.script._addDeadScript(dfd.ioArgs);
}
}
console.log("dojo.io.script error", error);
return error;
},
_deadScripts: [],
_counter: 1,
_addDeadScript: function(/*Object*/ioArgs){
//summary: sets up an entry in the deadScripts array.
dojo.io.script._deadScripts.push({id: ioArgs.id, frameDoc: ioArgs.frameDoc});
//Being extra paranoid about leaks:
ioArgs.frameDoc = null;
},
_validCheck: function(/*Deferred*/dfd){
//summary: inflight check function to see if dfd is still valid.
//Do script cleanup here. We wait for one inflight pass
//to make sure we don't get any weird things by trying to remove a script
//tag that is part of the call chain (IE 6 has been known to
//crash in that case).
var _self = dojo.io.script;
var deadScripts = _self._deadScripts;
if(deadScripts && deadScripts.length > 0){
for(var i = 0; i < deadScripts.length; i++){
//Remove the script tag
_self.remove(deadScripts[i].id, deadScripts[i].frameDoc);
deadScripts[i].frameDoc = null;
}
dojo.io.script._deadScripts = [];
}
return true;
},
_ioCheck: function(/*Deferred*/dfd){
//summary: inflight check function to see if IO finished.
var ioArgs = dfd.ioArgs;
//Check for finished jsonp
if(ioArgs.json || (ioArgs.scriptLoaded && !ioArgs.args.checkString)){
return true;
}
//Check for finished "checkString" case.
var checkString = ioArgs.args.checkString;
if(checkString && eval("typeof(" + checkString + ") != 'undefined'")){
return true;
}
return false;
},
_resHandle: function(/*Deferred*/dfd){
//summary: inflight function to handle a completed response.
if(dojo.io.script._ioCheck(dfd)){
dfd.callback(dfd);
}else{
//This path should never happen since the only way we can get
//to _resHandle is if _ioCheck is true.
dfd.errback(new Error("inconceivable dojo.io.script._resHandle error"));
}
},
_canAttach: function(/*Object*/ioArgs){
//summary: A method that can be overridden by other modules
//to control when the script attachment occurs.
return true;
},
_jsonpCallback: function(/*JSON Object*/json){
//summary:
// generic handler for jsonp callback. A pointer to this function
// is used for all jsonp callbacks. NOTE: the "this" in this
// function will be the Deferred object that represents the script
// request.
this.ioArgs.json = json;
}
}
})();
}

@ -5,15 +5,18 @@
*/
if(!dojo._hasResource["dojo.jaxer"]){
dojo._hasResource["dojo.jaxer"]=true;
if(!dojo._hasResource["dojo.jaxer"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.jaxer"] = true;
dojo.provide("dojo.jaxer");
if(typeof print=="function"){
console.debug=Jaxer.Log.debug;
console.warn=Jaxer.Log.warn;
console.error=Jaxer.Log.error;
console.info=Jaxer.Log.info;
console.log=Jaxer.Log.warn;
if(typeof print == "function"){
console.debug = Jaxer.Log.debug;
console.warn = Jaxer.Log.warn;
console.error = Jaxer.Log.error;
console.info = Jaxer.Log.info;
console.log = Jaxer.Log.warn;
}
onserverload=dojo._loadInit;
onserverload = dojo._loadInit;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save