Spade
Mini Shell
| Directory:~$ /home/lmsyaran/public_html/joomla4/ |
| [Home] [System Details] [Kill Me] |
index.html000064400000000047151164633620006551
0ustar00<html><head></head><body></body></html>tree/ForestStoreModel.js000064400000004731151164633620011315
0ustar00/*
Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dijit.tree.ForestStoreModel"]){
dojo._hasResource["dijit.tree.ForestStoreModel"]=true;
dojo.provide("dijit.tree.ForestStoreModel");
dojo.require("dijit.tree.TreeStoreModel");
dojo.declare("dijit.tree.ForestStoreModel",dijit.tree.TreeStoreModel,{rootId:"$root$",rootLabel:"ROOT",query:null,constructor:function(_1){
this.root={store:this,root:true,id:_1.rootId,label:_1.rootLabel,children:_1.rootChildren};
},mayHaveChildren:function(_2){
return _2===this.root||this.inherited(arguments);
},getChildren:function(_3,_4,_5){
if(_3===this.root){
if(this.root.children){
_4(this.root.children);
}else{
this.store.fetch({query:this.query,onComplete:dojo.hitch(this,function(_6){
this.root.children=_6;
_4(_6);
}),onError:_5});
}
}else{
this.inherited(arguments);
}
},isItem:function(_7){
return (_7===this.root)?true:this.inherited(arguments);
},fetchItemByIdentity:function(_8){
if(_8.identity==this.root.id){
var _9=_8.scope?_8.scope:dojo.global;
if(_8.onItem){
_8.onItem.call(_9,this.root);
}
}else{
this.inherited(arguments);
}
},getIdentity:function(_a){
return (_a===this.root)?this.root.id:this.inherited(arguments);
},getLabel:function(_b){
return (_b===this.root)?this.root.label:this.inherited(arguments);
},newItem:function(_c,_d,_e){
if(_d===this.root){
this.onNewRootItem(_c);
return this.store.newItem(_c);
}else{
return this.inherited(arguments);
}
},onNewRootItem:function(_f){
},pasteItem:function(_10,_11,_12,_13,_14){
if(_11===this.root){
if(!_13){
this.onLeaveRoot(_10);
}
}
dijit.tree.TreeStoreModel.prototype.pasteItem.call(this,_10,_11===this.root?null:_11,_12===this.root?null:_12,_13,_14);
if(_12===this.root){
this.onAddToRoot(_10);
}
},onAddToRoot:function(_15){
},onLeaveRoot:function(_16){
},_requeryTop:function(){
var _17=this.root.children||[];
this.store.fetch({query:this.query,onComplete:dojo.hitch(this,function(_18){
this.root.children=_18;
if(_17.length!=_18.length||dojo.some(_17,function(_19,idx){
return _18[idx]!=_19;
})){
this.onChildrenChange(this.root,_18);
}
})});
},onNewItem:function(_1a,_1b){
this._requeryTop();
this.inherited(arguments);
},onDeleteItem:function(_1c){
if(dojo.indexOf(this.root.children,_1c)!=-1){
this._requeryTop();
}
this.inherited(arguments);
},onSetItem:function(_1d,_1e,_1f,_20){
this._requeryTop();
this.inherited(arguments);
}});
}
tree/index.html000064400000000047151164633620007510
0ustar00<html><head></head><body></body></html>tree/TreeStoreModel.js000064400000007622151164633620010754
0ustar00/*
Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dijit.tree.TreeStoreModel"]){
dojo._hasResource["dijit.tree.TreeStoreModel"]=true;
dojo.provide("dijit.tree.TreeStoreModel");
dojo.declare("dijit.tree.TreeStoreModel",null,{store:null,childrenAttrs:["children"],newItemIdAttr:"id",labelAttr:"",root:null,query:null,deferItemLoadingUntilExpand:false,constructor:function(_1){
dojo.mixin(this,_1);
this.connects=[];
var _2=this.store;
if(!_2.getFeatures()["dojo.data.api.Identity"]){
throw new Error("dijit.Tree: store must support
dojo.data.Identity");
}
if(_2.getFeatures()["dojo.data.api.Notification"]){
this.connects=this.connects.concat([dojo.connect(_2,"onNew",this,"onNewItem"),dojo.connect(_2,"onDelete",this,"onDeleteItem"),dojo.connect(_2,"onSet",this,"onSetItem")]);
}
},destroy:function(){
dojo.forEach(this.connects,dojo.disconnect);
},getRoot:function(_3,_4){
if(this.root){
_3(this.root);
}else{
this.store.fetch({query:this.query,onComplete:dojo.hitch(this,function(_5){
if(_5.length!=1){
throw new Error(this.declaredClass+": query
"+dojo.toJson(this.query)+" returned "+_5.length+"
items, but must return exactly one item");
}
this.root=_5[0];
_3(this.root);
}),onError:_4});
}
},mayHaveChildren:function(_6){
return dojo.some(this.childrenAttrs,function(_7){
return this.store.hasAttribute(_6,_7);
},this);
},getChildren:function(_8,_9,_a){
var _b=this.store;
if(!_b.isItemLoaded(_8)){
var _c=dojo.hitch(this,arguments.callee);
_b.loadItem({item:_8,onItem:function(_d){
_c(_d,_9,_a);
},onError:_a});
return;
}
var _e=[];
for(var i=0;i<this.childrenAttrs.length;i++){
var _f=_b.getValues(_8,this.childrenAttrs[i]);
_e=_e.concat(_f);
}
var _10=0;
if(!this.deferItemLoadingUntilExpand){
dojo.forEach(_e,function(_11){
if(!_b.isItemLoaded(_11)){
_10++;
}
});
}
if(_10==0){
_9(_e);
}else{
dojo.forEach(_e,function(_12,idx){
if(!_b.isItemLoaded(_12)){
_b.loadItem({item:_12,onItem:function(_13){
_e[idx]=_13;
if(--_10==0){
_9(_e);
}
},onError:_a});
}
});
}
},isItem:function(_14){
return this.store.isItem(_14);
},fetchItemByIdentity:function(_15){
this.store.fetchItemByIdentity(_15);
},getIdentity:function(_16){
return this.store.getIdentity(_16);
},getLabel:function(_17){
if(this.labelAttr){
return this.store.getValue(_17,this.labelAttr);
}else{
return this.store.getLabel(_17);
}
},newItem:function(_18,_19,_1a){
var _1b={parent:_19,attribute:this.childrenAttrs[0]},_1c;
if(this.newItemIdAttr&&_18[this.newItemIdAttr]){
this.fetchItemByIdentity({identity:_18[this.newItemIdAttr],scope:this,onItem:function(_1d){
if(_1d){
this.pasteItem(_1d,null,_19,true,_1a);
}else{
_1c=this.store.newItem(_18,_1b);
if(_1c&&(_1a!=undefined)){
this.pasteItem(_1c,_19,_19,false,_1a);
}
}
}});
}else{
_1c=this.store.newItem(_18,_1b);
if(_1c&&(_1a!=undefined)){
this.pasteItem(_1c,_19,_19,false,_1a);
}
}
},pasteItem:function(_1e,_1f,_20,_21,_22){
var _23=this.store,_24=this.childrenAttrs[0];
if(_1f){
dojo.forEach(this.childrenAttrs,function(_25){
if(_23.containsValue(_1f,_25,_1e)){
if(!_21){
var _26=dojo.filter(_23.getValues(_1f,_25),function(x){
return x!=_1e;
});
_23.setValues(_1f,_25,_26);
}
_24=_25;
}
});
}
if(_20){
if(typeof _22=="number"){
var _27=_23.getValues(_20,_24).slice();
_27.splice(_22,0,_1e);
_23.setValues(_20,_24,_27);
}else{
_23.setValues(_20,_24,_23.getValues(_20,_24).concat(_1e));
}
}
},onChange:function(_28){
},onChildrenChange:function(_29,_2a){
},onDelete:function(_2b,_2c){
},onNewItem:function(_2d,_2e){
if(!_2e){
return;
}
this.getChildren(_2e.item,dojo.hitch(this,function(_2f){
this.onChildrenChange(_2e.item,_2f);
}));
},onDeleteItem:function(_30){
this.onDelete(_30);
},onSetItem:function(_31,_32,_33,_34){
if(dojo.indexOf(this.childrenAttrs,_32)!=-1){
this.getChildren(_31,dojo.hitch(this,function(_35){
this.onChildrenChange(_31,_35);
}));
}else{
this.onChange(_31);
}
}});
}
tree/_dndContainer.js000064400000004421151164633620010620 0ustar00/*
Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dijit.tree._dndContainer"]){
dojo._hasResource["dijit.tree._dndContainer"]=true;
dojo.provide("dijit.tree._dndContainer");
dojo.require("dojo.dnd.common");
dojo.require("dojo.dnd.Container");
dojo.getObject("tree",true,dojo);
dijit.tree._compareNodes=function(n1,n2){
if(n1===n2){
return 0;
}
if("sourceIndex" in document.documentElement){
return n1.sourceIndex-n2.sourceIndex;
}else{
if("compareDocumentPosition" in document.documentElement){
return n1.compareDocumentPosition(n2)&2?1:-1;
}else{
if(document.createRange){
var r1=doc.createRange();
r1.setStartBefore(n1);
var r2=doc.createRange();
r2.setStartBefore(n2);
return r1.compareBoundaryPoints(r1.END_TO_END,r2);
}else{
throw Error("dijit.tree._compareNodes don't know how to compare
two different nodes in this browser");
}
}
}
};
dojo.declare("dijit.tree._dndContainer",null,{constructor:function(_1,_2){
this.tree=_1;
this.node=_1.domNode;
dojo.mixin(this,_2);
this.map={};
this.current=null;
this.containerState="";
dojo.addClass(this.node,"dojoDndContainer");
this.events=[dojo.connect(this.node,"onmouseenter",this,"onOverEvent"),dojo.connect(this.node,"onmouseleave",this,"onOutEvent"),dojo.connect(this.tree,"_onNodeMouseEnter",this,"onMouseOver"),dojo.connect(this.tree,"_onNodeMouseLeave",this,"onMouseOut"),dojo.connect(this.node,"ondragstart",dojo,"stopEvent"),dojo.connect(this.node,"onselectstart",dojo,"stopEvent")];
},getItem:function(_3){
var _4=this.selection[_3],_5={data:_4,type:["treeNode"]};
return _5;
},destroy:function(){
dojo.forEach(this.events,dojo.disconnect);
this.node=this.parent=null;
},onMouseOver:function(_6,_7){
this.current=_6;
},onMouseOut:function(_8,_9){
this.current=null;
},_changeState:function(_a,_b){
var _c="dojoDnd"+_a;
var _d=_a.toLowerCase()+"State";
dojo.replaceClass(this.node,_c+_b,_c+this[_d]);
this[_d]=_b;
},_addItemClass:function(_e,_f){
dojo.addClass(_e,"dojoDndItem"+_f);
},_removeItemClass:function(_10,_11){
dojo.removeClass(_10,"dojoDndItem"+_11);
},onOverEvent:function(){
this._changeState("Container","Over");
},onOutEvent:function(){
this._changeState("Container","");
}});
}
tree/_dndSelector.js000064400000021042151164633620010454 0ustar00/*
Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dijit.tree._dndSelector"]){ //_hasResource
checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit.tree._dndSelector"] = true;
dojo.provide("dijit.tree._dndSelector");
dojo.require("dojo.dnd.common");
dojo.require("dijit.tree._dndContainer");
dojo.declare("dijit.tree._dndSelector",
dijit.tree._dndContainer,
{
// summary:
// This is a base class for `dijit.tree.dndSource` , and isn't
meant to be used directly.
// It's based on `dojo.dnd.Selector`.
// tags:
// protected
/*=====
// selection: Hash<String, DomNode>
// (id, DomNode) map for every TreeNode that's currently selected.
// The DOMNode is the TreeNode.rowNode.
selection: {},
=====*/
constructor: function(tree, params){
// summary:
// Initialization
// tags:
// private
this.selection={};
this.anchor = null;
dijit.setWaiState(this.tree.domNode, "multiselect",
!this.singular);
this.events.push(
dojo.connect(this.tree.domNode, "onmousedown",
this,"onMouseDown"),
dojo.connect(this.tree.domNode, "onmouseup",
this,"onMouseUp"),
dojo.connect(this.tree.domNode, "onmousemove",
this,"onMouseMove")
);
},
// singular: Boolean
// Allows selection of only one element, if true.
// Tree hasn't been tested in singular=true mode, unclear if it
works.
singular: false,
// methods
getSelectedTreeNodes: function(){
// summary:
// Returns a list of selected node(s).
// Used by dndSource on the start of a drag.
// tags:
// protected
var nodes=[], sel = this.selection;
for(var i in sel){
nodes.push(sel[i]);
}
return nodes;
},
selectNone: function(){
// summary:
// Unselects all items
// tags:
// private
this.setSelection([]);
return this; // self
},
destroy: function(){
// summary:
// Prepares the object to be garbage-collected
this.inherited(arguments);
this.selection = this.anchor = null;
},
addTreeNode: function(/*dijit._TreeNode*/node, /*Boolean?*/isAnchor){
// summary
// add node to current selection
// node: Node
// node to add
// isAnchor: Boolean
// Whether the node should become anchor.
this.setSelection(this.getSelectedTreeNodes().concat( [node] ));
if(isAnchor){ this.anchor = node; }
return node;
},
removeTreeNode: function(/*dijit._TreeNode*/node){
// summary
// remove node from current selection
// node: Node
// node to remove
this.setSelection(this._setDifference(this.getSelectedTreeNodes(),
[node]))
return node;
},
isTreeNodeSelected: function(/*dijit._TreeNode*/node){
// summary
// return true if node is currently selected
// node: Node
// the node to check whether it's in the current selection
return node.id && !!this.selection[node.id];
},
setSelection: function(/*dijit._treeNode[]*/ newSelection){
// summary
// set the list of selected nodes to be exactly newSelection. All
changes to the
// selection should be passed through this function, which ensures
that derived
// attributes are kept up to date. Anchor will be deleted if it has
been removed
// from the selection, but no new anchor will be added by this
function.
// newSelection: Node[]
// list of tree nodes to make selected
var oldSelection = this.getSelectedTreeNodes();
dojo.forEach(this._setDifference(oldSelection, newSelection),
dojo.hitch(this, function(node){
node.setSelected(false);
if(this.anchor == node){
delete this.anchor;
}
delete this.selection[node.id];
}));
dojo.forEach(this._setDifference(newSelection, oldSelection),
dojo.hitch(this, function(node){
node.setSelected(true);
this.selection[node.id] = node;
}));
this._updateSelectionProperties();
},
_setDifference: function(xs,ys){
// summary
// Returns a copy of xs which lacks any objects
// occurring in ys. Checks for membership by
// modifying and then reading the object, so it will
// not properly handle sets of numbers or strings.
dojo.forEach(ys, function(y){ y.__exclude__ = true; });
var ret = dojo.filter(xs, function(x){ return !x.__exclude__; });
// clean up after ourselves.
dojo.forEach(ys, function(y){ delete y['__exclude__'] });
return ret;
},
_updateSelectionProperties: function() {
// summary
// Update the following tree properties from the current selection:
// path[s], selectedItem[s], selectedNode[s]
var selected = this.getSelectedTreeNodes();
var paths = [], nodes = [];
dojo.forEach(selected, function(node) {
nodes.push(node);
paths.push(node.getTreePath());
});
var items = dojo.map(nodes,function(node) { return node.item; });
this.tree._set("paths", paths);
this.tree._set("path", paths[0] || []);
this.tree._set("selectedNodes", nodes);
this.tree._set("selectedNode", nodes[0] || null);
this.tree._set("selectedItems", items);
this.tree._set("selectedItem", items[0] || null);
},
// mouse events
onMouseDown: function(e){
// summary:
// Event processor for onmousedown
// e: Event
// mouse event
// tags:
// protected
// ignore click on expando node
if(!this.current || this.tree.isExpandoNode( e.target, this.current)){
return; }
if(e.button == dojo.mouseButtons.RIGHT){ return; } // ignore right-click
dojo.stopEvent(e);
var treeNode = this.current,
copy = dojo.isCopyKey(e), id = treeNode.id;
// if shift key is not pressed, and the node is already in the
selection,
// delay deselection until onmouseup so in the case of DND, deselection
// will be canceled by onmousemove.
if(!this.singular && !e.shiftKey && this.selection[id]){
this._doDeselect = true;
return;
}else{
this._doDeselect = false;
}
this.userSelect(treeNode, copy, e.shiftKey);
},
onMouseUp: function(e){
// summary:
// Event processor for onmouseup
// e: Event
// mouse event
// tags:
// protected
// _doDeselect is the flag to indicate that the user wants to either
ctrl+click on
// a already selected item (to deselect the item), or click on a not-yet
selected item
// (which should remove all current selection, and add the clicked
item). This can not
// be done in onMouseDown, because the user may start a drag after
mousedown. By moving
// the deselection logic here, the user can drags an already selected
item.
if(!this._doDeselect){ return; }
this._doDeselect = false;
this.userSelect(this.current, dojo.isCopyKey( e ), e.shiftKey);
},
onMouseMove: function(e){
// summary
// event processor for onmousemove
// e: Event
// mouse event
this._doDeselect = false;
},
userSelect: function(node, multi, range){
// summary:
// Add or remove the given node from selection, responding
// to a user action such as a click or keypress.
// multi: Boolean
// Indicates whether this is meant to be a multi-select action (e.g.
ctrl-click)
// range: Boolean
// Indicates whether this is meant to be a ranged action (e.g.
shift-click)
// tags:
// protected
if(this.singular){
if(this.anchor == node && multi){
this.selectNone();
}else{
this.setSelection([node]);
this.anchor = node;
}
}else{
if(range && this.anchor){
var cr = dijit.tree._compareNodes(this.anchor.rowNode, node.rowNode),
begin, end, anchor = this.anchor;
if(cr < 0){ //current is after anchor
begin = anchor;
end = node;
}else{ //current is before anchor
begin = node;
end = anchor;
}
nodes = [];
//add everything betweeen begin and end inclusively
while(begin != end) {
nodes.push(begin)
begin = this.tree._getNextNode(begin);
}
nodes.push(end)
this.setSelection(nodes);
}else{
if( this.selection[ node.id ] && multi ) {
this.removeTreeNode( node );
} else if(multi) {
this.addTreeNode(node, true);
} else {
this.setSelection([node]);
this.anchor = node;
}
}
}
},
forInSelectedItems: function(/*Function*/ f, /*Object?*/ o){
// summary:
// Iterates over selected items;
// see `dojo.dnd.Container.forInItems()` for details
o = o || dojo.global;
for(var id in this.selection){
// console.log("selected item id: " + id);
f.call(o, this.getItem(id), id, this);
}
}
});
}
Tree.js000064400000143211151164633620006012 0ustar00/*
Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dijit.Tree"]){ //_hasResource checks added
by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit.Tree"] = true;
dojo.provide("dijit.Tree");
dojo.require("dojo.fx");
dojo.require("dojo.DeferredList");
dojo.require("dijit._Widget");
dojo.require("dijit._Templated");
dojo.require("dijit._Container");
dojo.require("dijit._Contained");
dojo.require("dijit._CssStateMixin");
dojo.require("dojo.cookie");
dojo.require("dijit.tree.TreeStoreModel");
dojo.require("dijit.tree.ForestStoreModel");
dojo.require("dijit.tree._dndSelector");
dojo.declare(
"dijit._TreeNode",
[dijit._Widget, dijit._Templated, dijit._Container, dijit._Contained,
dijit._CssStateMixin],
{
// summary:
// Single node within a tree. This class is used internally
// by Tree and should not be accessed directly.
// tags:
// private
// item: [const] dojo.data.Item
// the dojo.data entry this tree represents
item: null,
// isTreeNode: [protected] Boolean
// Indicates that this is a TreeNode. Used by `dijit.Tree` only,
// should not be accessed directly.
isTreeNode: true,
// label: String
// Text of this tree node
label: "",
// isExpandable: [private] Boolean
// This node has children, so show the expando node (+ sign)
isExpandable: null,
// isExpanded: [readonly] Boolean
// This node is currently expanded (ie, opened)
isExpanded: false,
// state: [private] String
// Dynamic loading-related stuff.
// When an empty folder node appears, it is "UNCHECKED" first,
// then after dojo.data query it becomes "LOADING" and, finally
"LOADED"
state: "UNCHECKED",
templateString: dojo.cache("dijit",
"templates/TreeNode.html", "<div
class=\"dijitTreeNode\"
role=\"presentation\"\n\t><div
dojoAttachPoint=\"rowNode\" class=\"dijitTreeRow\"
role=\"presentation\"
dojoAttachEvent=\"onmouseenter:_onMouseEnter,
onmouseleave:_onMouseLeave, onclick:_onClick,
ondblclick:_onDblClick\"\n\t\t><img
src=\"${_blankGif}\" alt=\"\"
dojoAttachPoint=\"expandoNode\"
class=\"dijitTreeExpando\"
role=\"presentation\"\n\t\t/><span
dojoAttachPoint=\"expandoNodeText\"
class=\"dijitExpandoText\"
role=\"presentation\"\n\t\t></span\n\t\t><span
dojoAttachPoint=\"contentNode\"\n\t\t\tclass=\"dijitTreeContent\"
role=\"presentation\">\n\t\t\t<img
src=\"${_blankGif}\" alt=\"\"
dojoAttachPoint=\"iconNode\" class=\"dijitIcon
dijitTreeIcon\" role=\"presentation\"\n\t\t\t/><span
dojoAttachPoint=\"labelNode\" class=\"dijitTreeLabel\"
role=\"treeitem\" tabindex=\"-1\"
aria-selected=\"false\"
dojoAttachEvent=\"onfocus:_onLabelFocus\"></span>\n\t\t</span\n\t></div>\n\t<div
dojoAttachPoint=\"containerNode\"
class=\"dijitTreeContainer\" role=\"presentation\"
style=\"display: none;\"></div>\n</div>\n"),
baseClass: "dijitTreeNode",
// For hover effect for tree node, and focus effect for label
cssStateNodes: {
rowNode: "dijitTreeRow",
labelNode: "dijitTreeLabel"
},
attributeMap: dojo.delegate(dijit._Widget.prototype.attributeMap, {
label: {node: "labelNode", type: "innerText"},
tooltip: {node: "rowNode", type: "attribute",
attribute: "title"}
}),
buildRendering: function(){
this.inherited(arguments);
// set expand icon for leaf
this._setExpando();
// set icon and label class based on item
this._updateItemClasses(this.item);
if(this.isExpandable){
dijit.setWaiState(this.labelNode, "expanded",
this.isExpanded);
}
//aria-selected should be false on all selectable elements.
this.setSelected(false);
},
_setIndentAttr: function(indent){
// summary:
// Tell this node how many levels it should be indented
// description:
// 0 for top level nodes, 1 for their children, 2 for their
// grandchildren, etc.
// Math.max() is to prevent negative padding on hidden root node (when
indent == -1)
var pixels = (Math.max(indent, 0) * this.tree._nodePixelIndent) +
"px";
dojo.style(this.domNode, "backgroundPosition", pixels + "
0px");
dojo.style(this.rowNode, this.isLeftToRight() ? "paddingLeft" :
"paddingRight", pixels);
dojo.forEach(this.getChildren(), function(child){
child.set("indent", indent+1);
});
this._set("indent", indent);
},
markProcessing: function(){
// summary:
// Visually denote that tree is loading data, etc.
// tags:
// private
this.state = "LOADING";
this._setExpando(true);
},
unmarkProcessing: function(){
// summary:
// Clear markup from markProcessing() call
// tags:
// private
this._setExpando(false);
},
_updateItemClasses: function(item){
// summary:
// Set appropriate CSS classes for icon and label dom node
// (used to allow for item updates to change respective CSS)
// tags:
// private
var tree = this.tree, model = tree.model;
if(tree._v10Compat && item === model.root){
// For back-compat with 1.0, need to use null to specify root item
(TODO: remove in 2.0)
item = null;
}
this._applyClassAndStyle(item, "icon", "Icon");
this._applyClassAndStyle(item, "label", "Label");
this._applyClassAndStyle(item, "row", "Row");
},
_applyClassAndStyle: function(item, lower, upper){
// summary:
// Set the appropriate CSS classes and styles for labels, icons and
rows.
//
// item:
// The data item.
//
// lower:
// The lower case attribute to use, e.g. 'icon',
'label' or 'row'.
//
// upper:
// The upper case attribute to use, e.g. 'Icon',
'Label' or 'Row'.
//
// tags:
// private
var clsName = "_" + lower + "Class";
var nodeName = lower + "Node";
var oldCls = this[clsName];
this[clsName] = this.tree["get" + upper +
"Class"](item, this.isExpanded);
dojo.replaceClass(this[nodeName], this[clsName] || "", oldCls
|| "");
dojo.style(this[nodeName], this.tree["get" + upper +
"Style"](item, this.isExpanded) || {});
},
_updateLayout: function(){
// summary:
// Set appropriate CSS classes for this.domNode
// tags:
// private
var parent = this.getParent();
if(!parent || parent.rowNode.style.display == "none"){
/* if we are hiding the root node then make every first level child look
like a root node */
dojo.addClass(this.domNode, "dijitTreeIsRoot");
}else{
dojo.toggleClass(this.domNode, "dijitTreeIsLast",
!this.getNextSibling());
}
},
_setExpando: function(/*Boolean*/ processing){
// summary:
// Set the right image for the expando node
// tags:
// private
var styles = ["dijitTreeExpandoLoading",
"dijitTreeExpandoOpened",
"dijitTreeExpandoClosed",
"dijitTreeExpandoLeaf"],
_a11yStates = ["*","-","+","*"],
idx = processing ? 0 : (this.isExpandable ? (this.isExpanded ? 1 : 2) :
3);
// apply the appropriate class to the expando node
dojo.replaceClass(this.expandoNode, styles[idx], styles);
// provide a non-image based indicator for images-off mode
this.expandoNodeText.innerHTML = _a11yStates[idx];
},
expand: function(){
// summary:
// Show my children
// returns:
// Deferred that fires when expansion is complete
// If there's already an expand in progress or we are already
expanded, just return
if(this._expandDeferred){
return this._expandDeferred; // dojo.Deferred
}
// cancel in progress collapse operation
this._wipeOut && this._wipeOut.stop();
// All the state information for when a node is expanded, maybe this
should be
// set when the animation completes instead
this.isExpanded = true;
dijit.setWaiState(this.labelNode, "expanded",
"true");
if(this.tree.showRoot || this !== this.tree.rootNode){
dijit.setWaiRole(this.containerNode, "group");
}
dojo.addClass(this.contentNode,'dijitTreeContentExpanded');
this._setExpando();
this._updateItemClasses(this.item);
if(this == this.tree.rootNode){
dijit.setWaiState(this.tree.domNode, "expanded",
"true");
}
var def,
wipeIn = dojo.fx.wipeIn({
node: this.containerNode, duration: dijit.defaultDuration,
onEnd: function(){
def.callback(true);
}
});
// Deferred that fires when expand is complete
def = (this._expandDeferred = new dojo.Deferred(function(){
// Canceller
wipeIn.stop();
}));
wipeIn.play();
return def; // dojo.Deferred
},
collapse: function(){
// summary:
// Collapse this node (if it's expanded)
if(!this.isExpanded){ return; }
// cancel in progress expand operation
if(this._expandDeferred){
this._expandDeferred.cancel();
delete this._expandDeferred;
}
this.isExpanded = false;
dijit.setWaiState(this.labelNode, "expanded",
"false");
if(this == this.tree.rootNode){
dijit.setWaiState(this.tree.domNode, "expanded",
"false");
}
dojo.removeClass(this.contentNode,'dijitTreeContentExpanded');
this._setExpando();
this._updateItemClasses(this.item);
if(!this._wipeOut){
this._wipeOut = dojo.fx.wipeOut({
node: this.containerNode, duration: dijit.defaultDuration
});
}
this._wipeOut.play();
},
// indent: Integer
// Levels from this node to the root node
indent: 0,
setChildItems: function(/* Object[] */ items){
// summary:
// Sets the child items of this node, removing/adding nodes
// from current children to match specified items[] array.
// Also, if this.persist == true, expands any children that were
previously
// opened.
// returns:
// Deferred object that fires after all previously opened children
// have been expanded again (or fires instantly if there are no such
children).
var tree = this.tree,
model = tree.model,
defs = []; // list of deferreds that need to fire before I am complete
// Orphan all my existing children.
// If items contains some of the same items as before then we will
reattach them.
// Don't call this.removeChild() because that will collapse the tree
etc.
dojo.forEach(this.getChildren(), function(child){
dijit._Container.prototype.removeChild.call(this, child);
}, this);
this.state = "LOADED";
if(items && items.length > 0){
this.isExpandable = true;
// Create _TreeNode widget for each specified tree node, unless one
already
// exists and isn't being used (presumably it's from a DnD
move and was recently
// released
dojo.forEach(items, function(item){
var id = model.getIdentity(item),
existingNodes = tree._itemNodesMap[id],
node;
if(existingNodes){
for(var i=0;i<existingNodes.length;i++){
if(existingNodes[i] && !existingNodes[i].getParent()){
node = existingNodes[i];
node.set('indent', this.indent+1);
break;
}
}
}
if(!node){
node = this.tree._createTreeNode({
item: item,
tree: tree,
isExpandable: model.mayHaveChildren(item),
label: tree.getLabel(item),
tooltip: tree.getTooltip(item),
dir: tree.dir,
lang: tree.lang,
indent: this.indent + 1
});
if(existingNodes){
existingNodes.push(node);
}else{
tree._itemNodesMap[id] = [node];
}
}
this.addChild(node);
// If node was previously opened then open it again now (this may
trigger
// more data store accesses, recursively)
if(this.tree.autoExpand || this.tree._state(item)){
defs.push(tree._expandNode(node));
}
}, this);
// note that updateLayout() needs to be called on each child after
// _all_ the children exist
dojo.forEach(this.getChildren(), function(child, idx){
child._updateLayout();
});
}else{
this.isExpandable=false;
}
if(this._setExpando){
// change expando to/from dot or + icon, as appropriate
this._setExpando(false);
}
// Set leaf icon or folder icon, as appropriate
this._updateItemClasses(this.item);
// On initial tree show, make the selected TreeNode as either the root
node of the tree,
// or the first child, if the root node is hidden
if(this == tree.rootNode){
var fc = this.tree.showRoot ? this : this.getChildren()[0];
if(fc){
fc.setFocusable(true);
tree.lastFocused = fc;
}else{
// fallback: no nodes in tree so focus on Tree <div> itself
tree.domNode.setAttribute("tabIndex", "0");
}
}
return new dojo.DeferredList(defs); // dojo.Deferred
},
getTreePath: function(){
var node = this;
var path = [];
while(node && node !== this.tree.rootNode){
path.unshift(node.item);
node = node.getParent();
}
path.unshift(this.tree.rootNode.item);
return path;
},
getIdentity: function() {
return this.tree.model.getIdentity(this.item);
},
removeChild: function(/* treeNode */ node){
this.inherited(arguments);
var children = this.getChildren();
if(children.length == 0){
this.isExpandable = false;
this.collapse();
}
dojo.forEach(children, function(child){
child._updateLayout();
});
},
makeExpandable: function(){
// summary:
// if this node wasn't already showing the expando node,
// turn it into one and call _setExpando()
// TODO: hmm this isn't called from anywhere, maybe should remove it
for 2.0
this.isExpandable = true;
this._setExpando(false);
},
_onLabelFocus: function(evt){
// summary:
// Called when this row is focused (possibly programatically)
// Note that we aren't using _onFocus() builtin to dijit
// because it's called when focus is moved to a descendant
TreeNode.
// tags:
// private
this.tree._onNodeFocus(this);
},
setSelected: function(/*Boolean*/ selected){
// summary:
// A Tree has a (single) currently selected node.
// Mark that this node is/isn't that currently selected node.
// description:
// In particular, setting a node as selected involves setting tabIndex
// so that when user tabs to the tree, focus will go to that node
(only).
dijit.setWaiState(this.labelNode, "selected", selected);
dojo.toggleClass(this.rowNode, "dijitTreeRowSelected",
selected);
},
setFocusable: function(/*Boolean*/ selected){
// summary:
// A Tree has a (single) node that's focusable.
// Mark that this node is/isn't that currently focsuable node.
// description:
// In particular, setting a node as selected involves setting tabIndex
// so that when user tabs to the tree, focus will go to that node
(only).
this.labelNode.setAttribute("tabIndex", selected ?
"0" : "-1");
},
_onClick: function(evt){
// summary:
// Handler for onclick event on a node
// tags:
// private
this.tree._onClick(this, evt);
},
_onDblClick: function(evt){
// summary:
// Handler for ondblclick event on a node
// tags:
// private
this.tree._onDblClick(this, evt);
},
_onMouseEnter: function(evt){
// summary:
// Handler for onmouseenter event on a node
// tags:
// private
this.tree._onNodeMouseEnter(this, evt);
},
_onMouseLeave: function(evt){
// summary:
// Handler for onmouseenter event on a node
// tags:
// private
this.tree._onNodeMouseLeave(this, evt);
}
});
dojo.declare(
"dijit.Tree",
[dijit._Widget, dijit._Templated],
{
// summary:
// This widget displays hierarchical data from a store.
// store: [deprecated] String||dojo.data.Store
// Deprecated. Use "model" parameter instead.
// The store to get data to display in the tree.
store: null,
// model: dijit.Tree.model
// Interface to read tree data, get notifications of changes to tree
data,
// and for handling drop operations (i.e drag and drop onto the tree)
model: null,
// query: [deprecated] anything
// Deprecated. User should specify query to the model directly instead.
// Specifies datastore query to return the root item or top items for the
tree.
query: null,
// label: [deprecated] String
// Deprecated. Use dijit.tree.ForestStoreModel directly instead.
// Used in conjunction with query parameter.
// If a query is specified (rather than a root node id), and a label is
also specified,
// then a fake root node is created and displayed, with this label.
label: "",
// showRoot: [const] Boolean
// Should the root node be displayed, or hidden?
showRoot: true,
// childrenAttr: [deprecated] String[]
// Deprecated. This information should be specified in the model.
// One ore more attributes that holds children of a tree node
childrenAttr: ["children"],
// paths: String[][] or Item[][]
// Full paths from rootNode to selected nodes expressed as array of items
or array of ids.
// Since setting the paths may be asynchronous (because ofwaiting on
dojo.data), set("paths", ...)
// returns a Deferred to indicate when the set is complete.
paths: [],
// path: String[] or Item[]
// Backward compatible singular variant of paths.
path: [],
// selectedItems: [readonly] Item[]
// The currently selected items in this tree.
// This property can only be set (via set('selectedItems',
...)) when that item is already
// visible in the tree. (I.e. the tree has already been expanded to
show that node.)
// Should generally use `paths` attribute to set the selected items
instead.
selectedItems: null,
// selectedItem: [readonly] Item
// Backward compatible singular variant of selectedItems.
selectedItem: null,
// openOnClick: Boolean
// If true, clicking a folder node's label will open it, rather than
calling onClick()
openOnClick: false,
// openOnDblClick: Boolean
// If true, double-clicking a folder node's label will open it,
rather than calling onDblClick()
openOnDblClick: false,
templateString: dojo.cache("dijit",
"templates/Tree.html", "<div class=\"dijitTree
dijitTreeContainer\"
role=\"tree\"\n\tdojoAttachEvent=\"onkeypress:_onKeyPress\">\n\t<div
class=\"dijitInline dijitTreeIndent\" style=\"position:
absolute; top: -9999px\"
dojoAttachPoint=\"indentDetector\"></div>\n</div>\n"),
// persist: Boolean
// Enables/disables use of cookies for state saving.
persist: true,
// autoExpand: Boolean
// Fully expand the tree on load. Overrides `persist`.
autoExpand: false,
// dndController: [protected] String
// Class name to use as as the dnd controller. Specifying this class
enables DnD.
// Generally you should specify this as "dijit.tree.dndSource".
// Default of "dijit.tree._dndSelector" handles selection
only (no actual DnD).
dndController: "dijit.tree._dndSelector",
// parameters to pull off of the tree and pass on to the dndController as
its params
dndParams:
["onDndDrop","itemCreator","onDndCancel","checkAcceptance",
"checkItemAcceptance", "dragThreshold",
"betweenThreshold"],
//declare the above items so they can be pulled from the tree's
markup
// onDndDrop: [protected] Function
// Parameter to dndController, see `dijit.tree.dndSource.onDndDrop`.
// Generally this doesn't need to be set.
onDndDrop: null,
/*=====
itemCreator: function(nodes, target, source){
// summary:
// Returns objects passed to `Tree.model.newItem()` based on DnD nodes
// dropped onto the tree. Developer must override this method to
enable
// dropping from external sources onto this Tree, unless the
Tree.model's items
// happen to look like {id: 123, name: "Apple" } with no other
attributes.
// description:
// For each node in nodes[], which came from source, create a hash of
name/value
// pairs to be passed to Tree.model.newItem(). Returns array of those
hashes.
// nodes: DomNode[]
// The DOMNodes dragged from the source container
// target: DomNode
// The target TreeNode.rowNode
// source: dojo.dnd.Source
// The source container the nodes were dragged from, perhaps another
Tree or a plain dojo.dnd.Source
// returns: Object[]
// Array of name/value hashes for each new item to be added to the Tree,
like:
// | [
// | { id: 123, label: "apple", foo: "bar" },
// | { id: 456, label: "pear", zaz: "bam" }
// | ]
// tags:
// extension
return [{}];
},
=====*/
itemCreator: null,
// onDndCancel: [protected] Function
// Parameter to dndController, see `dijit.tree.dndSource.onDndCancel`.
// Generally this doesn't need to be set.
onDndCancel: null,
/*=====
checkAcceptance: function(source, nodes){
// summary:
// Checks if the Tree itself can accept nodes from this source
// source: dijit.tree._dndSource
// The source which provides items
// nodes: DOMNode[]
// Array of DOM nodes corresponding to nodes being dropped, dijitTreeRow
nodes if
// source is a dijit.Tree.
// tags:
// extension
return true; // Boolean
},
=====*/
checkAcceptance: null,
/*=====
checkItemAcceptance: function(target, source, position){
// summary:
// Stub function to be overridden if one wants to check for the ability
to drop at the node/item level
// description:
// In the base case, this is called to check if target can become a
child of source.
// When betweenThreshold is set, position="before" or
"after" means that we
// are asking if the source node can be dropped before/after the target
node.
// target: DOMNode
// The dijitTreeRoot DOM node inside of the TreeNode that we are
dropping on to
// Use dijit.getEnclosingWidget(target) to get the TreeNode.
// source: dijit.tree.dndSource
// The (set of) nodes we are dropping
// position: String
// "over", "before", or "after"
// tags:
// extension
return true; // Boolean
},
=====*/
checkItemAcceptance: null,
// dragThreshold: Integer
// Number of pixels mouse moves before it's considered the start of
a drag operation
dragThreshold: 5,
// betweenThreshold: Integer
// Set to a positive value to allow drag and drop "between"
nodes.
//
// If during DnD mouse is over a (target) node but less than
betweenThreshold
// pixels from the bottom edge, dropping the the dragged node will make
it
// the next sibling of the target node, rather than the child.
//
// Similarly, if mouse is over a target node but less that
betweenThreshold
// pixels from the top edge, dropping the dragged node will make it
// the target node's previous sibling rather than the target
node's child.
betweenThreshold: 0,
// _nodePixelIndent: Integer
// Number of pixels to indent tree nodes (relative to parent node).
// Default is 19 but can be overridden by setting CSS class
dijitTreeIndent
// and calling resize() or startup() on tree after it's in the DOM.
_nodePixelIndent: 19,
_publish: function(/*String*/ topicName, /*Object*/ message){
// summary:
// Publish a message for this widget/topic
dojo.publish(this.id, [dojo.mixin({tree: this, event: topicName}, message
|| {})]);
},
postMixInProperties: function(){
this.tree = this;
if(this.autoExpand){
// There's little point in saving opened/closed state of nodes for
a Tree
// that initially opens all it's nodes.
this.persist = false;
}
this._itemNodesMap={};
if(!this.cookieName){
this.cookieName = this.id + "SaveStateCookie";
}
this._loadDeferred = new dojo.Deferred();
this.inherited(arguments);
},
postCreate: function(){
this._initState();
// Create glue between store and Tree, if not specified directly by user
if(!this.model){
this._store2model();
}
// monitor changes to items
this.connect(this.model, "onChange",
"_onItemChange");
this.connect(this.model, "onChildrenChange",
"_onItemChildrenChange");
this.connect(this.model, "onDelete",
"_onItemDelete");
this._load();
this.inherited(arguments);
if(this.dndController){
if(dojo.isString(this.dndController)){
this.dndController = dojo.getObject(this.dndController);
}
var params={};
for(var i=0; i<this.dndParams.length;i++){
if(this[this.dndParams[i]]){
params[this.dndParams[i]] = this[this.dndParams[i]];
}
}
this.dndController = new this.dndController(this, params);
}
},
_store2model: function(){
// summary:
// User specified a store&query rather than model, so create model
from store/query
this._v10Compat = true;
dojo.deprecated("Tree: from version 2.0, should specify a model
object rather than a store/query");
var modelParams = {
id: this.id + "_ForestStoreModel",
store: this.store,
query: this.query,
childrenAttrs: this.childrenAttr
};
// Only override the model's mayHaveChildren() method if the user
has specified an override
if(this.params.mayHaveChildren){
modelParams.mayHaveChildren = dojo.hitch(this,
"mayHaveChildren");
}
if(this.params.getItemChildren){
modelParams.getChildren = dojo.hitch(this, function(item, onComplete,
onError){
this.getItemChildren((this._v10Compat && item ===
this.model.root) ? null : item, onComplete, onError);
});
}
this.model = new dijit.tree.ForestStoreModel(modelParams);
// For backwards compatibility, the visibility of the root node is
controlled by
// whether or not the user has specified a label
this.showRoot = Boolean(this.label);
},
onLoad: function(){
// summary:
// Called when tree finishes loading and expanding.
// description:
// If persist == true the loading may encompass many levels of fetches
// from the data store, each asynchronous. Waits for all to finish.
// tags:
// callback
},
_load: function(){
// summary:
// Initial load of the tree.
// Load root node (possibly hidden) and it's children.
this.model.getRoot(
dojo.hitch(this, function(item){
var rn = (this.rootNode = this.tree._createTreeNode({
item: item,
tree: this,
isExpandable: true,
label: this.label || this.getLabel(item),
indent: this.showRoot ? 0 : -1
}));
if(!this.showRoot){
rn.rowNode.style.display="none";
// if root is not visible, move tree role to the invisible
// root node's containerNode, see #12135
dijit.setWaiRole(this.domNode, 'presentation');
dijit.setWaiRole(rn.labelNode, 'presentation');
dijit.setWaiRole(rn.containerNode, 'tree');
}
this.domNode.appendChild(rn.domNode);
var identity = this.model.getIdentity(item);
if(this._itemNodesMap[identity]){
this._itemNodesMap[identity].push(rn);
}else{
this._itemNodesMap[identity] = [rn];
}
rn._updateLayout(); // sets "dijitTreeIsRoot" CSS classname
// load top level children and then fire onLoad() event
this._expandNode(rn).addCallback(dojo.hitch(this, function(){
this._loadDeferred.callback(true);
this.onLoad();
}));
}),
function(err){
console.error(this, ": error loading root: ", err);
}
);
},
getNodesByItem: function(/*dojo.data.Item or id*/ item){
// summary:
// Returns all tree nodes that refer to an item
// returns:
// Array of tree nodes that refer to passed item
if(!item){ return []; }
var identity = dojo.isString(item) ? item : this.model.getIdentity(item);
// return a copy so widget don't get messed up by changes to
returned array
return [].concat(this._itemNodesMap[identity]);
},
_setSelectedItemAttr: function(/*dojo.data.Item or id*/ item){
this.set('selectedItems', [item]);
},
_setSelectedItemsAttr: function(/*dojo.data.Items or ids*/ items){
// summary:
// Select tree nodes related to passed items.
// WARNING: if model use multi-parented items or desired tree node
isn't already loaded
// behavior is undefined. Use set('paths', ...) instead.
var tree = this;
this._loadDeferred.addCallback( dojo.hitch(this, function(){
var identities = dojo.map(items, function(item){
return (!item || dojo.isString(item)) ? item :
tree.model.getIdentity(item);
});
var nodes = [];
dojo.forEach(identities, function(id){
nodes = nodes.concat(tree._itemNodesMap[id] || []);
});
this.set('selectedNodes', nodes);
}));
},
_setPathAttr: function(/*Item[] || String[]*/ path){
// summary:
// Singular variant of _setPathsAttr
if(path.length) {
return this.set("paths", [path]);
} else {
//Empty list is interpreted as "select nothing"
return this.set("paths", []);
}
},
_setPathsAttr: function(/*Item[][] || String[][]*/ paths){
// summary:
// Select the tree nodes identified by passed paths.
// paths:
// Array of arrays of items or item id's
// returns:
// Deferred to indicate when the set is complete
var tree = this;
// We may need to wait for some nodes to expand, so setting
// each path will involve a Deferred. We bring those deferreds
// together witha DeferredList.
return new dojo.DeferredList(dojo.map(paths, function(path){
var d = new dojo.Deferred();
// normalize path to use identity
path = dojo.map(path, function(item){
return dojo.isString(item) ? item : tree.model.getIdentity(item);
});
if(path.length){
// Wait for the tree to load, if it hasn't already.
tree._loadDeferred.addCallback(function(){ selectPath(path,
[tree.rootNode], d); });
}else{
d.errback("Empty path");
}
return d;
})).addCallback(setNodes);
function selectPath(path, nodes, def){
// Traverse path; the next path component should be among
"nodes".
var nextPath = path.shift();
var nextNode = dojo.filter(nodes, function(node){
return node.getIdentity() == nextPath;
})[0];
if(!!nextNode){
if(path.length){
tree._expandNode(nextNode).addCallback(function(){ selectPath(path,
nextNode.getChildren(), def); });
}else{
//Successfully reached the end of this path
def.callback(nextNode);
}
} else {
def.errback("Could not expand path at " + nextPath);
}
}
function setNodes(newNodes){
//After all expansion is finished, set the selection to
//the set of nodes successfully found.
tree.set("selectedNodes", dojo.map(
dojo.filter(newNodes,function(x){return x[0];}),
function(x){return x[1];}));
}
},
_setSelectedNodeAttr: function(node){
this.set('selectedNodes', [node]);
},
_setSelectedNodesAttr: function(nodes){
this._loadDeferred.addCallback( dojo.hitch(this, function(){
this.dndController.setSelection(nodes);
}));
},
////////////// Data store related functions //////////////////////
// These just get passed to the model; they are here for back-compat
mayHaveChildren: function(/*dojo.data.Item*/ item){
// summary:
// Deprecated. This should be specified on the model itself.
//
// Overridable function to tell if an item has or may have children.
// Controls whether or not +/- expando icon is shown.
// (For efficiency reasons we may not want to check if an element
actually
// has children until user clicks the expando node)
// tags:
// deprecated
},
getItemChildren: function(/*dojo.data.Item*/ parentItem,
/*function(items)*/ onComplete){
// summary:
// Deprecated. This should be specified on the model itself.
//
// Overridable function that return array of child items of given
parent item,
// or if parentItem==null then return top items in tree
// tags:
// deprecated
},
///////////////////////////////////////////////////////
// Functions for converting an item to a TreeNode
getLabel: function(/*dojo.data.Item*/ item){
// summary:
// Overridable function to get the label for a tree node (given the
item)
// tags:
// extension
return this.model.getLabel(item); // String
},
getIconClass: function(/*dojo.data.Item*/ item, /*Boolean*/ opened){
// summary:
// Overridable function to return CSS class name to display icon
// tags:
// extension
return (!item || this.model.mayHaveChildren(item)) ? (opened ?
"dijitFolderOpened" : "dijitFolderClosed") :
"dijitLeaf"
},
getLabelClass: function(/*dojo.data.Item*/ item, /*Boolean*/ opened){
// summary:
// Overridable function to return CSS class name to display label
// tags:
// extension
},
getRowClass: function(/*dojo.data.Item*/ item, /*Boolean*/ opened){
// summary:
// Overridable function to return CSS class name to display row
// tags:
// extension
},
getIconStyle: function(/*dojo.data.Item*/ item, /*Boolean*/ opened){
// summary:
// Overridable function to return CSS styles to display icon
// returns:
// Object suitable for input to dojo.style() like {backgroundImage:
"url(...)"}
// tags:
// extension
},
getLabelStyle: function(/*dojo.data.Item*/ item, /*Boolean*/ opened){
// summary:
// Overridable function to return CSS styles to display label
// returns:
// Object suitable for input to dojo.style() like {color:
"red", background: "green"}
// tags:
// extension
},
getRowStyle: function(/*dojo.data.Item*/ item, /*Boolean*/ opened){
// summary:
// Overridable function to return CSS styles to display row
// returns:
// Object suitable for input to dojo.style() like {background-color:
"#bbb"}
// tags:
// extension
},
getTooltip: function(/*dojo.data.Item*/ item){
// summary:
// Overridable function to get the tooltip for a tree node (given the
item)
// tags:
// extension
return ""; // String
},
/////////// Keyboard and Mouse handlers ////////////////////
_onKeyPress: function(/*Event*/ e){
// summary:
// Translates keypress events into commands for the controller
if(e.altKey){ return; }
var dk = dojo.keys;
var treeNode = dijit.getEnclosingWidget(e.target);
if(!treeNode){ return; }
var key = e.charOrCode;
if(typeof key == "string" && key != " "){ //
handle printables (letter navigation)
// Check for key navigation.
if(!e.altKey && !e.ctrlKey && !e.shiftKey &&
!e.metaKey){
this._onLetterKeyNav( { node: treeNode, key: key.toLowerCase() } );
dojo.stopEvent(e);
}
}else{ // handle non-printables (arrow keys)
// clear record of recent printables (being saved for multi-char letter
navigation),
// because "a", down-arrow, "b" shouldn't
search for "ab"
if(this._curSearch){
clearTimeout(this._curSearch.timer);
delete this._curSearch;
}
var map = this._keyHandlerMap;
if(!map){
// setup table mapping keys to events
map = {};
map[dk.ENTER]="_onEnterKey";
//On WebKit based browsers, the combination ctrl-enter
//does not get passed through. To allow accessible
//multi-select on those browsers, the space key is
//also used for selection.
map[dk.SPACE]= map[" "] = "_onEnterKey";
map[this.isLeftToRight() ? dk.LEFT_ARROW :
dk.RIGHT_ARROW]="_onLeftArrow";
map[this.isLeftToRight() ? dk.RIGHT_ARROW :
dk.LEFT_ARROW]="_onRightArrow";
map[dk.UP_ARROW]="_onUpArrow";
map[dk.DOWN_ARROW]="_onDownArrow";
map[dk.HOME]="_onHomeKey";
map[dk.END]="_onEndKey";
this._keyHandlerMap = map;
}
if(this._keyHandlerMap[key]){
this[this._keyHandlerMap[key]]( { node: treeNode, item: treeNode.item,
evt: e } );
dojo.stopEvent(e);
}
}
},
_onEnterKey: function(/*Object*/ message){
this._publish("execute", { item: message.item, node:
message.node } );
this.dndController.userSelect(message.node, dojo.isCopyKey( message.evt
), message.evt.shiftKey);
this.onClick(message.item, message.node, message.evt);
},
_onDownArrow: function(/*Object*/ message){
// summary:
// down arrow pressed; get next visible node, set focus there
var node = this._getNextNode(message.node);
if(node && node.isTreeNode){
this.focusNode(node);
}
},
_onUpArrow: function(/*Object*/ message){
// summary:
// Up arrow pressed; move to previous visible node
var node = message.node;
// if younger siblings
var previousSibling = node.getPreviousSibling();
if(previousSibling){
node = previousSibling;
// if the previous node is expanded, dive in deep
while(node.isExpandable && node.isExpanded &&
node.hasChildren()){
// move to the last child
var children = node.getChildren();
node = children[children.length-1];
}
}else{
// if this is the first child, return the parent
// unless the parent is the root of a tree with a hidden root
var parent = node.getParent();
if(!(!this.showRoot && parent === this.rootNode)){
node = parent;
}
}
if(node && node.isTreeNode){
this.focusNode(node);
}
},
_onRightArrow: function(/*Object*/ message){
// summary:
// Right arrow pressed; go to child node
var node = message.node;
// if not expanded, expand, else move to 1st child
if(node.isExpandable && !node.isExpanded){
this._expandNode(node);
}else if(node.hasChildren()){
node = node.getChildren()[0];
if(node && node.isTreeNode){
this.focusNode(node);
}
}
},
_onLeftArrow: function(/*Object*/ message){
// summary:
// Left arrow pressed.
// If not collapsed, collapse, else move to parent.
var node = message.node;
if(node.isExpandable && node.isExpanded){
this._collapseNode(node);
}else{
var parent = node.getParent();
if(parent && parent.isTreeNode && !(!this.showRoot
&& parent === this.rootNode)){
this.focusNode(parent);
}
}
},
_onHomeKey: function(){
// summary:
// Home key pressed; get first visible node, and set focus there
var node = this._getRootOrFirstNode();
if(node){
this.focusNode(node);
}
},
_onEndKey: function(/*Object*/ message){
// summary:
// End key pressed; go to last visible node.
var node = this.rootNode;
while(node.isExpanded){
var c = node.getChildren();
node = c[c.length - 1];
}
if(node && node.isTreeNode){
this.focusNode(node);
}
},
// multiCharSearchDuration: Number
// If multiple characters are typed where each keystroke happens within
// multiCharSearchDuration of the previous keystroke,
// search for nodes matching all the keystrokes.
//
// For example, typing "ab" will search for entries starting
with
// "ab" unless the delay between "a" and
"b" is greater than multiCharSearchDuration.
multiCharSearchDuration: 250,
_onLetterKeyNav: function(message){
// summary:
// Called when user presses a prinatable key; search for node starting
with recently typed letters.
// message: Object
// Like { node: TreeNode, key: 'a' } where key is the key the
user pressed.
// Branch depending on whether this key starts a new search, or modifies
an existing search
var cs = this._curSearch;
if(cs){
// We are continuing a search. Ex: user has pressed 'a', and
now has pressed
// 'b', so we want to search for nodes starting
w/"ab".
cs.pattern = cs.pattern + message.key;
clearTimeout(cs.timer);
}else{
// We are starting a new search
cs = this._curSearch = {
pattern: message.key,
startNode: message.node
};
}
// set/reset timer to forget recent keystrokes
var self = this;
cs.timer = setTimeout(function(){
delete self._curSearch;
}, this.multiCharSearchDuration);
// Navigate to TreeNode matching keystrokes [entered so far].
var node = cs.startNode;
do{
node = this._getNextNode(node);
//check for last node, jump to first node if necessary
if(!node){
node = this._getRootOrFirstNode();
}
}while(node !== cs.startNode &&
(node.label.toLowerCase().substr(0, cs.pattern.length) != cs.pattern));
if(node && node.isTreeNode){
// no need to set focus if back where we started
if(node !== cs.startNode){
this.focusNode(node);
}
}
},
isExpandoNode: function(node, widget){
// summary:
// check whether a dom node is the expandoNode for a particular TreeNode
widget
return dojo.isDescendant(node, widget.expandoNode);
},
_onClick: function(/*TreeNode*/ nodeWidget, /*Event*/ e){
// summary:
// Translates click events into commands for the controller to process
var domElement = e.target,
isExpandoClick = this.isExpandoNode(domElement, nodeWidget);
if( (this.openOnClick && nodeWidget.isExpandable) ||
isExpandoClick ){
// expando node was clicked, or label of a folder node was clicked; open
it
if(nodeWidget.isExpandable){
this._onExpandoClick({node:nodeWidget});
}
}else{
this._publish("execute", { item: nodeWidget.item, node:
nodeWidget, evt: e } );
this.onClick(nodeWidget.item, nodeWidget, e);
this.focusNode(nodeWidget);
}
dojo.stopEvent(e);
},
_onDblClick: function(/*TreeNode*/ nodeWidget, /*Event*/ e){
// summary:
// Translates double-click events into commands for the controller to
process
var domElement = e.target,
isExpandoClick = (domElement == nodeWidget.expandoNode || domElement ==
nodeWidget.expandoNodeText);
if( (this.openOnDblClick && nodeWidget.isExpandable)
||isExpandoClick ){
// expando node was clicked, or label of a folder node was clicked; open
it
if(nodeWidget.isExpandable){
this._onExpandoClick({node:nodeWidget});
}
}else{
this._publish("execute", { item: nodeWidget.item, node:
nodeWidget, evt: e } );
this.onDblClick(nodeWidget.item, nodeWidget, e);
this.focusNode(nodeWidget);
}
dojo.stopEvent(e);
},
_onExpandoClick: function(/*Object*/ message){
// summary:
// User clicked the +/- icon; expand or collapse my children.
var node = message.node;
// If we are collapsing, we might be hiding the currently focused node.
// Also, clicking the expando node might have erased focus from the
current node.
// For simplicity's sake just focus on the node with the expando.
this.focusNode(node);
if(node.isExpanded){
this._collapseNode(node);
}else{
this._expandNode(node);
}
},
onClick: function(/* dojo.data */ item, /*TreeNode*/ node, /*Event*/ evt){
// summary:
// Callback when a tree node is clicked
// tags:
// callback
},
onDblClick: function(/* dojo.data */ item, /*TreeNode*/ node, /*Event*/
evt){
// summary:
// Callback when a tree node is double-clicked
// tags:
// callback
},
onOpen: function(/* dojo.data */ item, /*TreeNode*/ node){
// summary:
// Callback when a node is opened
// tags:
// callback
},
onClose: function(/* dojo.data */ item, /*TreeNode*/ node){
// summary:
// Callback when a node is closed
// tags:
// callback
},
_getNextNode: function(node){
// summary:
// Get next visible node
if(node.isExpandable && node.isExpanded &&
node.hasChildren()){
// if this is an expanded node, get the first child
return node.getChildren()[0]; // _TreeNode
}else{
// find a parent node with a sibling
while(node && node.isTreeNode){
var returnNode = node.getNextSibling();
if(returnNode){
return returnNode; // _TreeNode
}
node = node.getParent();
}
return null;
}
},
_getRootOrFirstNode: function(){
// summary:
// Get first visible node
return this.showRoot ? this.rootNode : this.rootNode.getChildren()[0];
},
_collapseNode: function(/*_TreeNode*/ node){
// summary:
// Called when the user has requested to collapse the node
if(node._expandNodeDeferred){
delete node._expandNodeDeferred;
}
if(node.isExpandable){
if(node.state == "LOADING"){
// ignore clicks while we are in the process of loading data
return;
}
node.collapse();
this.onClose(node.item, node);
if(node.item){
this._state(node.item,false);
this._saveState();
}
}
},
_expandNode: function(/*_TreeNode*/ node, /*Boolean?*/ recursive){
// summary:
// Called when the user has requested to expand the node
// recursive:
// Internal flag used when _expandNode() calls itself, don't set.
// returns:
// Deferred that fires when the node is loaded and opened and (if
persist=true) all it's descendants
// that were previously opened too
if(node._expandNodeDeferred && !recursive){
// there's already an expand in progress (or completed), so just
return
return node._expandNodeDeferred; // dojo.Deferred
}
var model = this.model,
item = node.item,
_this = this;
switch(node.state){
case "UNCHECKED":
// need to load all the children, and then expand
node.markProcessing();
// Setup deferred to signal when the load and expand are finished.
// Save that deferred in this._expandDeferred as a flag that operation
is in progress.
var def = (node._expandNodeDeferred = new dojo.Deferred());
// Get the children
model.getChildren(
item,
function(items){
node.unmarkProcessing();
// Display the children and also start expanding any children that
were previously expanded
// (if this.persist == true). The returned Deferred will fire when
those expansions finish.
var scid = node.setChildItems(items);
// Call _expandNode() again but this time it will just to do the
animation (default branch).
// The returned Deferred will fire when the animation completes.
// TODO: seems like I can avoid recursion and just use a deferred to
sequence the events?
var ed = _this._expandNode(node, true);
// After the above two tasks (setChildItems() and recursive
_expandNode()) finish,
// signal that I am done.
scid.addCallback(function(){
ed.addCallback(function(){
def.callback();
})
});
},
function(err){
console.error(_this, ": error loading root children: ",
err);
}
);
break;
default: // "LOADED"
// data is already loaded; just expand node
def = (node._expandNodeDeferred = node.expand());
this.onOpen(node.item, node);
if(item){
this._state(item, true);
this._saveState();
}
}
return def; // dojo.Deferred
},
////////////////// Miscellaneous functions ////////////////
focusNode: function(/* _tree.Node */ node){
// summary:
// Focus on the specified node (which must be visible)
// tags:
// protected
// set focus so that the label will be voiced using screen readers
dijit.focus(node.labelNode);
},
_onNodeFocus: function(/*dijit._Widget*/ node){
// summary:
// Called when a TreeNode gets focus, either by user clicking
// it, or programatically by arrow key handling code.
// description:
// It marks that the current node is the selected one, and the
previously
// selected node no longer is.
if(node && node != this.lastFocused){
if(this.lastFocused && !this.lastFocused._destroyed){
// mark that the previously focsable node is no longer focusable
this.lastFocused.setFocusable(false);
}
// mark that the new node is the currently selected one
node.setFocusable(true);
this.lastFocused = node;
}
},
_onNodeMouseEnter: function(/*dijit._Widget*/ node){
// summary:
// Called when mouse is over a node (onmouseenter event),
// this is monitored by the DND code
},
_onNodeMouseLeave: function(/*dijit._Widget*/ node){
// summary:
// Called when mouse leaves a node (onmouseleave event),
// this is monitored by the DND code
},
//////////////// Events from the model //////////////////////////
_onItemChange: function(/*Item*/ item){
// summary:
// Processes notification of a change to an item's scalar values
like label
var model = this.model,
identity = model.getIdentity(item),
nodes = this._itemNodesMap[identity];
if(nodes){
var label = this.getLabel(item),
tooltip = this.getTooltip(item);
dojo.forEach(nodes, function(node){
node.set({
item: item, // theoretically could be new JS Object representing same
item
label: label,
tooltip: tooltip
});
node._updateItemClasses(item);
});
}
},
_onItemChildrenChange: function(/*dojo.data.Item*/ parent,
/*dojo.data.Item[]*/ newChildrenList){
// summary:
// Processes notification of a change to an item's children
var model = this.model,
identity = model.getIdentity(parent),
parentNodes = this._itemNodesMap[identity];
if(parentNodes){
dojo.forEach(parentNodes,function(parentNode){
parentNode.setChildItems(newChildrenList);
});
}
},
_onItemDelete: function(/*Item*/ item){
// summary:
// Processes notification of a deletion of an item
var model = this.model,
identity = model.getIdentity(item),
nodes = this._itemNodesMap[identity];
if(nodes){
dojo.forEach(nodes,function(node){
// Remove node from set of selected nodes (if it's selected)
this.dndController.removeTreeNode(node);
var parent = node.getParent();
if(parent){
// if node has not already been orphaned from a _onSetItem(parent,
"children", ..) call...
parent.removeChild(node);
}
node.destroyRecursive();
}, this);
delete this._itemNodesMap[identity];
}
},
/////////////// Miscellaneous funcs
_initState: function(){
// summary:
// Load in which nodes should be opened automatically
if(this.persist){
var cookie = dojo.cookie(this.cookieName);
this._openedItemIds = {};
if(cookie){
dojo.forEach(cookie.split(','), function(item){
this._openedItemIds[item] = true;
}, this);
}
}
},
_state: function(item,expanded){
// summary:
// Query or set expanded state for an item,
if(!this.persist){
return false;
}
var id=this.model.getIdentity(item);
if(arguments.length === 1){
return this._openedItemIds[id];
}
if(expanded){
this._openedItemIds[id] = true;
}else{
delete this._openedItemIds[id];
}
},
_saveState: function(){
// summary:
// Create and save a cookie with the currently expanded nodes
identifiers
if(!this.persist){
return;
}
var ary = [];
for(var id in this._openedItemIds){
ary.push(id);
}
dojo.cookie(this.cookieName, ary.join(","), {expires:365});
},
destroy: function(){
if(this._curSearch){
clearTimeout(this._curSearch.timer);
delete this._curSearch;
}
if(this.rootNode){
this.rootNode.destroyRecursive();
}
if(this.dndController && !dojo.isString(this.dndController)){
this.dndController.destroy();
}
this.rootNode = null;
this.inherited(arguments);
},
destroyRecursive: function(){
// A tree is treated as a leaf, not as a node with children (like a
grid),
// but defining destroyRecursive for back-compat.
this.destroy();
},
resize: function(changeSize){
if(changeSize){
dojo.marginBox(this.domNode, changeSize);
}
// The only JS sizing involved w/tree is the indentation, which is
specified
// in CSS and read in through this dummy indentDetector node (tree must
be
// visible and attached to the DOM to read this)
this._nodePixelIndent = dojo._getMarginSize(this.tree.indentDetector).w;
if(this.tree.rootNode){
// If tree has already loaded, then reset indent for all the nodes
this.tree.rootNode.set('indent', this.showRoot ? 0 : -1);
}
},
_createTreeNode: function(/*Object*/ args){
// summary:
// creates a TreeNode
// description:
// Developers can override this method to define their own TreeNode
class;
// However it will probably be removed in a future release in favor of a
way
// of just specifying a widget for the label, rather than one that
contains
// the children too.
return new dijit._TreeNode(args);
}
});
// For back-compat. TODO: remove in 2.0
}
_base/focus.js000064400000015116151164633630007306 0ustar00/*
Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dijit._base.focus"]){
dojo._hasResource["dijit._base.focus"]=true;
dojo.provide("dijit._base.focus");
dojo.require("dojo.window");
dojo.require("dijit._base.manager");
dojo.mixin(dijit,{_curFocus:null,_prevFocus:null,isCollapsed:function(){
return dijit.getBookmark().isCollapsed;
},getBookmark:function(){
var bm,rg,tg,_1=dojo.doc.selection,cf=dijit._curFocus;
if(dojo.global.getSelection){
_1=dojo.global.getSelection();
if(_1){
if(_1.isCollapsed){
tg=cf?cf.tagName:"";
if(tg){
tg=tg.toLowerCase();
if(tg=="textarea"||(tg=="input"&&(!cf.type||cf.type.toLowerCase()=="text"))){
_1={start:cf.selectionStart,end:cf.selectionEnd,node:cf,pRange:true};
return {isCollapsed:(_1.end<=_1.start),mark:_1};
}
}
bm={isCollapsed:true};
if(_1.rangeCount){
bm.mark=_1.getRangeAt(0).cloneRange();
}
}else{
rg=_1.getRangeAt(0);
bm={isCollapsed:false,mark:rg.cloneRange()};
}
}
}else{
if(_1){
tg=cf?cf.tagName:"";
tg=tg.toLowerCase();
if(cf&&tg&&(tg=="button"||tg=="textarea"||tg=="input")){
if(_1.type&&_1.type.toLowerCase()=="none"){
return {isCollapsed:true,mark:null};
}else{
rg=_1.createRange();
return
{isCollapsed:rg.text&&rg.text.length?false:true,mark:{range:rg,pRange:true}};
}
}
bm={};
try{
rg=_1.createRange();
bm.isCollapsed=!(_1.type=="Text"?rg.htmlText.length:rg.length);
}
catch(e){
bm.isCollapsed=true;
return bm;
}
if(_1.type.toUpperCase()=="CONTROL"){
if(rg.length){
bm.mark=[];
var i=0,_2=rg.length;
while(i<_2){
bm.mark.push(rg.item(i++));
}
}else{
bm.isCollapsed=true;
bm.mark=null;
}
}else{
bm.mark=rg.getBookmark();
}
}else{
console.warn("No idea how to store the current selection for this
browser!");
}
}
return bm;
},moveToBookmark:function(_3){
var _4=dojo.doc,_5=_3.mark;
if(_5){
if(dojo.global.getSelection){
var _6=dojo.global.getSelection();
if(_6&&_6.removeAllRanges){
if(_5.pRange){
var r=_5;
var n=r.node;
n.selectionStart=r.start;
n.selectionEnd=r.end;
}else{
_6.removeAllRanges();
_6.addRange(_5);
}
}else{
console.warn("No idea how to restore selection for this
browser!");
}
}else{
if(_4.selection&&_5){
var rg;
if(_5.pRange){
rg=_5.range;
}else{
if(dojo.isArray(_5)){
rg=_4.body.createControlRange();
dojo.forEach(_5,function(n){
rg.addElement(n);
});
}else{
rg=_4.body.createTextRange();
rg.moveToBookmark(_5);
}
}
rg.select();
}
}
}
},getFocus:function(_7,_8){
var
_9=!dijit._curFocus||(_7&&dojo.isDescendant(dijit._curFocus,_7.domNode))?dijit._prevFocus:dijit._curFocus;
return
{node:_9,bookmark:(_9==dijit._curFocus)&&dojo.withGlobal(_8||dojo.global,dijit.getBookmark),openedForWindow:_8};
},focus:function(_a){
if(!_a){
return;
}
var _b="node" in
_a?_a.node:_a,_c=_a.bookmark,_d=_a.openedForWindow,_e=_c?_c.isCollapsed:false;
if(_b){
var _f=(_b.tagName.toLowerCase()=="iframe")?_b.contentWindow:_b;
if(_f&&_f.focus){
try{
_f.focus();
}
catch(e){
}
}
dijit._onFocusNode(_b);
}
if(_c&&dojo.withGlobal(_d||dojo.global,dijit.isCollapsed)&&!_e){
if(_d){
_d.focus();
}
try{
dojo.withGlobal(_d||dojo.global,dijit.moveToBookmark,null,[_c]);
}
catch(e2){
}
}
},_activeStack:[],registerIframe:function(_10){
return dijit.registerWin(_10.contentWindow,_10);
},unregisterIframe:function(_11){
dijit.unregisterWin(_11);
},registerWin:function(_12,_13){
var _14=function(evt){
dijit._justMouseDowned=true;
setTimeout(function(){
dijit._justMouseDowned=false;
},0);
if(dojo.isIE&&evt&&evt.srcElement&&evt.srcElement.parentNode==null){
return;
}
dijit._onTouchNode(_13||evt.target||evt.srcElement,"mouse");
};
var doc=dojo.isIE?_12.document.documentElement:_12.document;
if(doc){
if(dojo.isIE){
_12.document.body.attachEvent("onmousedown",_14);
var _15=function(evt){
if(evt.srcElement.tagName.toLowerCase()!="#document"&&dijit.isTabNavigable(evt.srcElement)){
dijit._onFocusNode(_13||evt.srcElement);
}else{
dijit._onTouchNode(_13||evt.srcElement);
}
};
doc.attachEvent("onactivate",_15);
var _16=function(evt){
dijit._onBlurNode(_13||evt.srcElement);
};
doc.attachEvent("ondeactivate",_16);
return function(){
_12.document.detachEvent("onmousedown",_14);
doc.detachEvent("onactivate",_15);
doc.detachEvent("ondeactivate",_16);
doc=null;
};
}else{
doc.body.addEventListener("mousedown",_14,true);
var _17=function(evt){
dijit._onFocusNode(_13||evt.target);
};
doc.addEventListener("focus",_17,true);
var _18=function(evt){
dijit._onBlurNode(_13||evt.target);
};
doc.addEventListener("blur",_18,true);
return function(){
doc.body.removeEventListener("mousedown",_14,true);
doc.removeEventListener("focus",_17,true);
doc.removeEventListener("blur",_18,true);
doc=null;
};
}
}
},unregisterWin:function(_19){
_19&&_19();
},_onBlurNode:function(_1a){
dijit._prevFocus=dijit._curFocus;
dijit._curFocus=null;
if(dijit._justMouseDowned){
return;
}
if(dijit._clearActiveWidgetsTimer){
clearTimeout(dijit._clearActiveWidgetsTimer);
}
dijit._clearActiveWidgetsTimer=setTimeout(function(){
delete dijit._clearActiveWidgetsTimer;
dijit._setStack([]);
dijit._prevFocus=null;
},100);
},_onTouchNode:function(_1b,by){
if(dijit._clearActiveWidgetsTimer){
clearTimeout(dijit._clearActiveWidgetsTimer);
delete dijit._clearActiveWidgetsTimer;
}
var _1c=[];
try{
while(_1b){
var _1d=dojo.attr(_1b,"dijitPopupParent");
if(_1d){
_1b=dijit.byId(_1d).domNode;
}else{
if(_1b.tagName&&_1b.tagName.toLowerCase()=="body"){
if(_1b===dojo.body()){
break;
}
_1b=dojo.window.get(_1b.ownerDocument).frameElement;
}else{
var
id=_1b.getAttribute&&_1b.getAttribute("widgetId"),_1e=id&&dijit.byId(id);
if(_1e&&!(by=="mouse"&&_1e.get("disabled"))){
_1c.unshift(id);
}
_1b=_1b.parentNode;
}
}
}
}
catch(e){
}
dijit._setStack(_1c,by);
},_onFocusNode:function(_1f){
if(!_1f){
return;
}
if(_1f.nodeType==9){
return;
}
dijit._onTouchNode(_1f);
if(_1f==dijit._curFocus){
return;
}
if(dijit._curFocus){
dijit._prevFocus=dijit._curFocus;
}
dijit._curFocus=_1f;
dojo.publish("focusNode",[_1f]);
},_setStack:function(_20,by){
var _21=dijit._activeStack;
dijit._activeStack=_20;
for(var _22=0;_22<Math.min(_21.length,_20.length);_22++){
if(_21[_22]!=_20[_22]){
break;
}
}
var _23;
for(var i=_21.length-1;i>=_22;i--){
_23=dijit.byId(_21[i]);
if(_23){
_23._focused=false;
_23.set("focused",false);
_23._hasBeenBlurred=true;
if(_23._onBlur){
_23._onBlur(by);
}
dojo.publish("widgetBlur",[_23,by]);
}
}
for(i=_22;i<_20.length;i++){
_23=dijit.byId(_20[i]);
if(_23){
_23._focused=true;
_23.set("focused",true);
if(_23._onFocus){
_23._onFocus(by);
}
dojo.publish("widgetFocus",[_23,by]);
}
}
}});
dojo.addOnLoad(function(){
var _24=dijit.registerWin(window);
if(dojo.isIE){
dojo.addOnWindowUnload(function(){
dijit.unregisterWin(_24);
_24=null;
});
}
});
}
_base/index.html000064400000000047151164633630007623
0ustar00<html><head></head><body></body></html>_base/manager.js000064400000011707151164633630007603
0ustar00/*
Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dijit._base.manager"]){
dojo._hasResource["dijit._base.manager"]=true;
dojo.provide("dijit._base.manager");
dojo.declare("dijit.WidgetSet",null,{constructor:function(){
this._hash={};
this.length=0;
},add:function(_1){
if(this._hash[_1.id]){
throw new Error("Tried to register widget with id=="+_1.id+"
but that id is already registered");
}
this._hash[_1.id]=_1;
this.length++;
},remove:function(id){
if(this._hash[id]){
delete this._hash[id];
this.length--;
}
},forEach:function(_2,_3){
_3=_3||dojo.global;
var i=0,id;
for(id in this._hash){
_2.call(_3,this._hash[id],i++,this._hash);
}
return this;
},filter:function(_4,_5){
_5=_5||dojo.global;
var _6=new dijit.WidgetSet(),i=0,id;
for(id in this._hash){
var w=this._hash[id];
if(_4.call(_5,w,i++,this._hash)){
_6.add(w);
}
}
return _6;
},byId:function(id){
return this._hash[id];
},byClass:function(_7){
var _8=new dijit.WidgetSet(),id,_9;
for(id in this._hash){
_9=this._hash[id];
if(_9.declaredClass==_7){
_8.add(_9);
}
}
return _8;
},toArray:function(){
var ar=[];
for(var id in this._hash){
ar.push(this._hash[id]);
}
return ar;
},map:function(_a,_b){
return dojo.map(this.toArray(),_a,_b);
},every:function(_c,_d){
_d=_d||dojo.global;
var x=0,i;
for(i in this._hash){
if(!_c.call(_d,this._hash[i],x++,this._hash)){
return false;
}
}
return true;
},some:function(_e,_f){
_f=_f||dojo.global;
var x=0,i;
for(i in this._hash){
if(_e.call(_f,this._hash[i],x++,this._hash)){
return true;
}
}
return false;
}});
(function(){
dijit.registry=new dijit.WidgetSet();
var _10=dijit.registry._hash,_11=dojo.attr,_12=dojo.hasAttr,_13=dojo.style;
dijit.byId=function(id){
return typeof id=="string"?_10[id]:id;
};
var _14={};
dijit.getUniqueId=function(_15){
var id;
do{
id=_15+"_"+(_15 in _14?++_14[_15]:_14[_15]=0);
}while(_10[id]);
return
dijit._scopeName=="dijit"?id:dijit._scopeName+"_"+id;
};
dijit.findWidgets=function(_16){
var _17=[];
function _18(_19){
for(var _1a=_19.firstChild;_1a;_1a=_1a.nextSibling){
if(_1a.nodeType==1){
var _1b=_1a.getAttribute("widgetId");
if(_1b){
var _1c=_10[_1b];
if(_1c){
_17.push(_1c);
}
}else{
_18(_1a);
}
}
}
};
_18(_16);
return _17;
};
dijit._destroyAll=function(){
dijit._curFocus=null;
dijit._prevFocus=null;
dijit._activeStack=[];
dojo.forEach(dijit.findWidgets(dojo.body()),function(_1d){
if(!_1d._destroyed){
if(_1d.destroyRecursive){
_1d.destroyRecursive();
}else{
if(_1d.destroy){
_1d.destroy();
}
}
}
});
};
if(dojo.isIE){
dojo.addOnWindowUnload(function(){
dijit._destroyAll();
});
}
dijit.byNode=function(_1e){
return _10[_1e.getAttribute("widgetId")];
};
dijit.getEnclosingWidget=function(_1f){
while(_1f){
var id=_1f.getAttribute&&_1f.getAttribute("widgetId");
if(id){
return _10[id];
}
_1f=_1f.parentNode;
}
return null;
};
var _20=(dijit._isElementShown=function(_21){
var s=_13(_21);
return
(s.visibility!="hidden")&&(s.visibility!="collapsed")&&(s.display!="none")&&(_11(_21,"type")!="hidden");
});
dijit.hasDefaultTabStop=function(_22){
switch(_22.nodeName.toLowerCase()){
case "a":
return _12(_22,"href");
case "area":
case "button":
case "input":
case "object":
case "select":
case "textarea":
return true;
case "iframe":
var _23;
try{
var _24=_22.contentDocument;
if("designMode" in _24&&_24.designMode=="on"){
return true;
}
_23=_24.body;
}
catch(e1){
try{
_23=_22.contentWindow.document.body;
}
catch(e2){
return false;
}
}
return
_23.contentEditable=="true"||(_23.firstChild&&_23.firstChild.contentEditable=="true");
default:
return _22.contentEditable=="true";
}
};
var _25=(dijit.isTabNavigable=function(_26){
if(_11(_26,"disabled")){
return false;
}else{
if(_12(_26,"tabIndex")){
return _11(_26,"tabIndex")>=0;
}else{
return dijit.hasDefaultTabStop(_26);
}
}
});
dijit._getTabNavigable=function(_27){
var _28,_29,_2a,_2b,_2c,_2d,_2e={};
function _2f(_30){
return
_30&&_30.tagName.toLowerCase()=="input"&&_30.type&&_30.type.toLowerCase()=="radio"&&_30.name&&_30.name.toLowerCase();
};
var _31=function(_32){
dojo.query("> *",_32).forEach(function(_33){
if((dojo.isIE&&_33.scopeName!=="HTML")||!_20(_33)){
return;
}
if(_25(_33)){
var _34=_11(_33,"tabIndex");
if(!_12(_33,"tabIndex")||_34==0){
if(!_28){
_28=_33;
}
_29=_33;
}else{
if(_34>0){
if(!_2a||_34<_2b){
_2b=_34;
_2a=_33;
}
if(!_2c||_34>=_2d){
_2d=_34;
_2c=_33;
}
}
}
var rn=_2f(_33);
if(dojo.attr(_33,"checked")&&rn){
_2e[rn]=_33;
}
}
if(_33.nodeName.toUpperCase()!="SELECT"){
_31(_33);
}
});
};
if(_20(_27)){
_31(_27);
}
function rs(_35){
return _2e[_2f(_35)]||_35;
};
return {first:rs(_28),last:rs(_29),lowest:rs(_2a),highest:rs(_2c)};
};
dijit.getFirstInTabbingOrder=function(_36){
var _37=dijit._getTabNavigable(dojo.byId(_36));
return _37.lowest?_37.lowest:_37.first;
};
dijit.getLastInTabbingOrder=function(_38){
var _39=dijit._getTabNavigable(dojo.byId(_38));
return _39.last?_39.last:_39.highest;
};
dijit.defaultDuration=dojo.config["defaultDuration"]||200;
})();
}
_base/place.js000064400000006772151164633630007263 0ustar00/*
Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dijit._base.place"]){
dojo._hasResource["dijit._base.place"]=true;
dojo.provide("dijit._base.place");
dojo.require("dojo.window");
dojo.require("dojo.AdapterRegistry");
dijit.getViewport=function(){
return dojo.window.getBox();
};
dijit.placeOnScreen=function(_1,_2,_3,_4){
var _5=dojo.map(_3,function(_6){
var c={corner:_6,pos:{x:_2.x,y:_2.y}};
if(_4){
c.pos.x+=_6.charAt(1)=="L"?_4.x:-_4.x;
c.pos.y+=_6.charAt(0)=="T"?_4.y:-_4.y;
}
return c;
});
return dijit._place(_1,_5);
};
dijit._place=function(_7,_8,_9,_a){
var _b=dojo.window.getBox();
if(!_7.parentNode||String(_7.parentNode.tagName).toLowerCase()!="body"){
dojo.body().appendChild(_7);
}
var _c=null;
dojo.some(_8,function(_d){
var _e=_d.corner;
var _f=_d.pos;
var _10=0;
var
_11={w:_e.charAt(1)=="L"?(_b.l+_b.w)-_f.x:_f.x-_b.l,h:_e.charAt(1)=="T"?(_b.t+_b.h)-_f.y:_f.y-_b.t};
if(_9){
var res=_9(_7,_d.aroundCorner,_e,_11,_a);
_10=typeof res=="undefined"?0:res;
}
var _12=_7.style;
var _13=_12.display;
var _14=_12.visibility;
_12.visibility="hidden";
_12.display="";
var mb=dojo.marginBox(_7);
_12.display=_13;
_12.visibility=_14;
var
_15=Math.max(_b.l,_e.charAt(1)=="L"?_f.x:(_f.x-mb.w)),_16=Math.max(_b.t,_e.charAt(0)=="T"?_f.y:(_f.y-mb.h)),_17=Math.min(_b.l+_b.w,_e.charAt(1)=="L"?(_15+mb.w):_f.x),_18=Math.min(_b.t+_b.h,_e.charAt(0)=="T"?(_16+mb.h):_f.y),_19=_17-_15,_1a=_18-_16;
_10+=(mb.w-_19)+(mb.h-_1a);
if(_c==null||_10<_c.overflow){
_c={corner:_e,aroundCorner:_d.aroundCorner,x:_15,y:_16,w:_19,h:_1a,overflow:_10,spaceAvailable:_11};
}
return !_10;
});
if(_c.overflow&&_9){
_9(_7,_c.aroundCorner,_c.corner,_c.spaceAvailable,_a);
}
var l=dojo._isBodyLtr(),s=_7.style;
s.top=_c.y+"px";
s[l?"left":"right"]=(l?_c.x:_b.w-_c.x-_c.w)+"px";
return _c;
};
dijit.placeOnScreenAroundNode=function(_1b,_1c,_1d,_1e){
_1c=dojo.byId(_1c);
var _1f=dojo.position(_1c,true);
return dijit._placeOnScreenAroundRect(_1b,_1f.x,_1f.y,_1f.w,_1f.h,_1d,_1e);
};
dijit.placeOnScreenAroundRectangle=function(_20,_21,_22,_23){
return
dijit._placeOnScreenAroundRect(_20,_21.x,_21.y,_21.width,_21.height,_22,_23);
};
dijit._placeOnScreenAroundRect=function(_24,x,y,_25,_26,_27,_28){
var _29=[];
for(var _2a in _27){
_29.push({aroundCorner:_2a,corner:_27[_2a],pos:{x:x+(_2a.charAt(1)=="L"?0:_25),y:y+(_2a.charAt(0)=="T"?0:_26)}});
}
return dijit._place(_24,_29,_28,{w:_25,h:_26});
};
dijit.placementRegistry=new dojo.AdapterRegistry();
dijit.placementRegistry.register("node",function(n,x){
return typeof x=="object"&&typeof
x.offsetWidth!="undefined"&&typeof
x.offsetHeight!="undefined";
},dijit.placeOnScreenAroundNode);
dijit.placementRegistry.register("rect",function(n,x){
return typeof x=="object"&&"x" in
x&&"y" in x&&"width" in
x&&"height" in x;
},dijit.placeOnScreenAroundRectangle);
dijit.placeOnScreenAroundElement=function(_2b,_2c,_2d,_2e){
return
dijit.placementRegistry.match.apply(dijit.placementRegistry,arguments);
};
dijit.getPopupAroundAlignment=function(_2f,_30){
var _31={};
dojo.forEach(_2f,function(pos){
switch(pos){
case "after":
_31[_30?"BR":"BL"]=_30?"BL":"BR";
break;
case "before":
_31[_30?"BL":"BR"]=_30?"BR":"BL";
break;
case "below-alt":
_30=!_30;
case "below":
_31[_30?"BL":"BR"]=_30?"TL":"TR";
_31[_30?"BR":"BL"]=_30?"TR":"TL";
break;
case "above-alt":
_30=!_30;
case "above":
default:
_31[_30?"TL":"TR"]=_30?"BL":"BR";
_31[_30?"TR":"TL"]=_30?"BR":"BL";
break;
}
});
return _31;
};
}
_base/popup.js000064400000011211151164633630007322 0ustar00/*
Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dijit._base.popup"]){
dojo._hasResource["dijit._base.popup"]=true;
dojo.provide("dijit._base.popup");
dojo.require("dijit._base.focus");
dojo.require("dijit._base.place");
dojo.require("dijit._base.window");
dijit.popup={_stack:[],_beginZIndex:1000,_idGen:1,_createWrapper:function(_1){
var
_2=_1.declaredClass?_1._popupWrapper:(_1.parentNode&&dojo.hasClass(_1.parentNode,"dijitPopup")),_3=_1.domNode||_1;
if(!_2){
_2=dojo.create("div",{"class":"dijitPopup",style:{display:"none"},role:"presentation"},dojo.body());
_2.appendChild(_3);
var s=_3.style;
s.display="";
s.visibility="";
s.position="";
s.top="0px";
if(_1.declaredClass){
_1._popupWrapper=_2;
dojo.connect(_1,"destroy",function(){
dojo.destroy(_2);
delete _1._popupWrapper;
});
}
}
return _2;
},moveOffScreen:function(_4){
var _5=this._createWrapper(_4);
dojo.style(_5,{visibility:"hidden",top:"-9999px",display:""});
},hide:function(_6){
var _7=this._createWrapper(_6);
dojo.style(_7,"display","none");
},getTopPopup:function(){
var _8=this._stack;
for(var
pi=_8.length-1;pi>0&&_8[pi].parent===_8[pi-1].widget;pi--){
}
return _8[pi];
},open:function(_9){
var
_a=this._stack,_b=_9.popup,_c=_9.orient||((_9.parent?_9.parent.isLeftToRight():dojo._isBodyLtr())?{"BL":"TL","BR":"TR","TL":"BL","TR":"BR"}:{"BR":"TR","BL":"TL","TR":"BR","TL":"BL"}),_d=_9.around,id=(_9.around&&_9.around.id)?(_9.around.id+"_dropdown"):("popup_"+this._idGen++);
while(_a.length&&(!_9.parent||!dojo.isDescendant(_9.parent.domNode,_a[_a.length-1].widget.domNode))){
dijit.popup.close(_a[_a.length-1].widget);
}
var _e=this._createWrapper(_b);
dojo.attr(_e,{id:id,style:{zIndex:this._beginZIndex+_a.length},"class":"dijitPopup
"+(_b.baseClass||_b["class"]||"").split("
")[0]+"Popup",dijitPopupParent:_9.parent?_9.parent.id:""});
if(dojo.isIE||dojo.isMoz){
if(!_b.bgIframe){
_b.bgIframe=new dijit.BackgroundIframe(_e);
}
}
var
_f=_d?dijit.placeOnScreenAroundElement(_e,_d,_c,_b.orient?dojo.hitch(_b,"orient"):null):dijit.placeOnScreen(_e,_9,_c=="R"?["TR","BR","TL","BL"]:["TL","BL","TR","BR"],_9.padding);
_e.style.display="";
_e.style.visibility="visible";
_b.domNode.style.visibility="visible";
var _10=[];
_10.push(dojo.connect(_e,"onkeypress",this,function(evt){
if(evt.charOrCode==dojo.keys.ESCAPE&&_9.onCancel){
dojo.stopEvent(evt);
_9.onCancel();
}else{
if(evt.charOrCode===dojo.keys.TAB){
dojo.stopEvent(evt);
var _11=this.getTopPopup();
if(_11&&_11.onCancel){
_11.onCancel();
}
}
}
}));
if(_b.onCancel){
_10.push(dojo.connect(_b,"onCancel",_9.onCancel));
}
_10.push(dojo.connect(_b,_b.onExecute?"onExecute":"onChange",this,function(){
var _12=this.getTopPopup();
if(_12&&_12.onExecute){
_12.onExecute();
}
}));
_a.push({widget:_b,parent:_9.parent,onExecute:_9.onExecute,onCancel:_9.onCancel,onClose:_9.onClose,handlers:_10});
if(_b.onOpen){
_b.onOpen(_f);
}
return _f;
},close:function(_13){
var _14=this._stack;
while((_13&&dojo.some(_14,function(_15){
return _15.widget==_13;
}))||(!_13&&_14.length)){
var top=_14.pop(),_16=top.widget,_17=top.onClose;
if(_16.onClose){
_16.onClose();
}
dojo.forEach(top.handlers,dojo.disconnect);
if(_16&&_16.domNode){
this.hide(_16);
}
if(_17){
_17();
}
}
}};
dijit._frames=new function(){
var _18=[];
this.pop=function(){
var _19;
if(_18.length){
_19=_18.pop();
_19.style.display="";
}else{
if(dojo.isIE<9){
var
_1a=dojo.config["dojoBlankHtmlUrl"]||(dojo.moduleUrl("dojo","resources/blank.html")+"")||"javascript:\"\"";
var _1b="<iframe src='"+_1a+"'"+"
style='position: absolute; left: 0px; top: 0px;"+"z-index:
-1; filter:Alpha(Opacity=\"0\");'>";
_19=dojo.doc.createElement(_1b);
}else{
_19=dojo.create("iframe");
_19.src="javascript:\"\"";
_19.className="dijitBackgroundIframe";
dojo.style(_19,"opacity",0.1);
}
_19.tabIndex=-1;
dijit.setWaiRole(_19,"presentation");
}
return _19;
};
this.push=function(_1c){
_1c.style.display="none";
_18.push(_1c);
};
}();
dijit.BackgroundIframe=function(_1d){
if(!_1d.id){
throw new Error("no id");
}
if(dojo.isIE||dojo.isMoz){
var _1e=(this.iframe=dijit._frames.pop());
_1d.appendChild(_1e);
if(dojo.isIE<7||dojo.isQuirks){
this.resize(_1d);
this._conn=dojo.connect(_1d,"onresize",this,function(){
this.resize(_1d);
});
}else{
dojo.style(_1e,{width:"100%",height:"100%"});
}
}
};
dojo.extend(dijit.BackgroundIframe,{resize:function(_1f){
if(this.iframe){
dojo.style(this.iframe,{width:_1f.offsetWidth+"px",height:_1f.offsetHeight+"px"});
}
},destroy:function(){
if(this._conn){
dojo.disconnect(this._conn);
this._conn=null;
}
if(this.iframe){
dijit._frames.push(this.iframe);
delete this.iframe;
}
}});
}
_base/scroll.js000064400000000660151164633630007463 0ustar00/*
Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dijit._base.scroll"]){
dojo._hasResource["dijit._base.scroll"]=true;
dojo.provide("dijit._base.scroll");
dojo.require("dojo.window");
dijit.scrollIntoView=function(_1,_2){
dojo.window.scrollIntoView(_1,_2);
};
}
_base/sniff.js000064400000000540151164633630007267 0ustar00/*
Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dijit._base.sniff"]){
dojo._hasResource["dijit._base.sniff"]=true;
dojo.provide("dijit._base.sniff");
dojo.require("dojo.uacss");
}
_base/typematic.js000064400000005715151164633630010172 0ustar00/*
Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dijit._base.typematic"]){
dojo._hasResource["dijit._base.typematic"]=true;
dojo.provide("dijit._base.typematic");
dijit.typematic={_fireEventAndReload:function(){
this._timer=null;
this._callback(++this._count,this._node,this._evt);
this._currentTimeout=Math.max(this._currentTimeout<0?this._initialDelay:(this._subsequentDelay>1?this._subsequentDelay:Math.round(this._currentTimeout*this._subsequentDelay)),this._minDelay);
this._timer=setTimeout(dojo.hitch(this,"_fireEventAndReload"),this._currentTimeout);
},trigger:function(_1,_2,_3,_4,_5,_6,_7,_8){
if(_5!=this._obj){
this.stop();
this._initialDelay=_7||500;
this._subsequentDelay=_6||0.9;
this._minDelay=_8||10;
this._obj=_5;
this._evt=_1;
this._node=_3;
this._currentTimeout=-1;
this._count=-1;
this._callback=dojo.hitch(_2,_4);
this._fireEventAndReload();
this._evt=dojo.mixin({faux:true},_1);
}
},stop:function(){
if(this._timer){
clearTimeout(this._timer);
this._timer=null;
}
if(this._obj){
this._callback(-1,this._node,this._evt);
this._obj=null;
}
},addKeyListener:function(_9,_a,_b,_c,_d,_e,_f){
if(_a.keyCode){
_a.charOrCode=_a.keyCode;
dojo.deprecated("keyCode attribute parameter for
dijit.typematic.addKeyListener is deprecated. Use charOrCode
instead.","","2.0");
}else{
if(_a.charCode){
_a.charOrCode=String.fromCharCode(_a.charCode);
dojo.deprecated("charCode attribute parameter for
dijit.typematic.addKeyListener is deprecated. Use charOrCode
instead.","","2.0");
}
}
return [dojo.connect(_9,"onkeypress",this,function(evt){
if(evt.charOrCode==_a.charOrCode&&(_a.ctrlKey===undefined||_a.ctrlKey==evt.ctrlKey)&&(_a.altKey===undefined||_a.altKey==evt.altKey)&&(_a.metaKey===undefined||_a.metaKey==(evt.metaKey||false))&&(_a.shiftKey===undefined||_a.shiftKey==evt.shiftKey)){
dojo.stopEvent(evt);
dijit.typematic.trigger(evt,_b,_9,_c,_a,_d,_e,_f);
}else{
if(dijit.typematic._obj==_a){
dijit.typematic.stop();
}
}
}),dojo.connect(_9,"onkeyup",this,function(evt){
if(dijit.typematic._obj==_a){
dijit.typematic.stop();
}
})];
},addMouseListener:function(_10,_11,_12,_13,_14,_15){
var dc=dojo.connect;
return [dc(_10,"mousedown",this,function(evt){
dojo.stopEvent(evt);
dijit.typematic.trigger(evt,_11,_10,_12,_10,_13,_14,_15);
}),dc(_10,"mouseup",this,function(evt){
dojo.stopEvent(evt);
dijit.typematic.stop();
}),dc(_10,"mouseout",this,function(evt){
dojo.stopEvent(evt);
dijit.typematic.stop();
}),dc(_10,"mousemove",this,function(evt){
evt.preventDefault();
}),dc(_10,"dblclick",this,function(evt){
dojo.stopEvent(evt);
if(dojo.isIE){
dijit.typematic.trigger(evt,_11,_10,_12,_10,_13,_14,_15);
setTimeout(dojo.hitch(this,dijit.typematic.stop),50);
}
})];
},addListener:function(_16,_17,_18,_19,_1a,_1b,_1c,_1d){
return
this.addKeyListener(_17,_18,_19,_1a,_1b,_1c,_1d).concat(this.addMouseListener(_16,_19,_1a,_1b,_1c,_1d));
}};
}
_base/wai.js000064400000003421151164633630006743 0ustar00/*
Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dijit._base.wai"]){
dojo._hasResource["dijit._base.wai"]=true;
dojo.provide("dijit._base.wai");
dijit.wai={onload:function(){
var
_1=dojo.create("div",{id:"a11yTestNode",style:{cssText:"border:
1px solid;"+"border-color:red green;"+"position:
absolute;"+"height: 5px;"+"top:
-999px;"+"background-image:
url(\""+(dojo.config.blankGif||dojo.moduleUrl("dojo","resources/blank.gif"))+"\");"}},dojo.body());
var cs=dojo.getComputedStyle(_1);
if(cs){
var _2=cs.backgroundImage;
var
_3=(cs.borderTopColor==cs.borderRightColor)||(_2!=null&&(_2=="none"||_2=="url(invalid-url:)"));
dojo[_3?"addClass":"removeClass"](dojo.body(),"dijit_a11y");
if(dojo.isIE){
_1.outerHTML="";
}else{
dojo.body().removeChild(_1);
}
}
}};
if(dojo.isIE||dojo.isMoz){
dojo._loaders.unshift(dijit.wai.onload);
}
dojo.mixin(dijit,{hasWaiRole:function(_4,_5){
var _6=this.getWaiRole(_4);
return _5?(_6.indexOf(_5)>-1):(_6.length>0);
},getWaiRole:function(_7){
return
dojo.trim((dojo.attr(_7,"role")||"").replace("wairole:",""));
},setWaiRole:function(_8,_9){
dojo.attr(_8,"role",_9);
},removeWaiRole:function(_a,_b){
var _c=dojo.attr(_a,"role");
if(!_c){
return;
}
if(_b){
var t=dojo.trim((" "+_c+" ").replace("
"+_b+" "," "));
dojo.attr(_a,"role",t);
}else{
_a.removeAttribute("role");
}
},hasWaiState:function(_d,_e){
return
_d.hasAttribute?_d.hasAttribute("aria-"+_e):!!_d.getAttribute("aria-"+_e);
},getWaiState:function(_f,_10){
return _f.getAttribute("aria-"+_10)||"";
},setWaiState:function(_11,_12,_13){
_11.setAttribute("aria-"+_12,_13);
},removeWaiState:function(_14,_15){
_14.removeAttribute("aria-"+_15);
}});
}
_base/window.js000064400000000651151164633630007474 0ustar00/*
Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dijit._base.window"]){
dojo._hasResource["dijit._base.window"]=true;
dojo.provide("dijit._base.window");
dojo.require("dojo.window");
dijit.getDocumentWindow=function(_1){
return dojo.window.get(_1);
};
}
_base.js000064400000001163151164633630006164 0ustar00/*
Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dijit._base"]){
dojo._hasResource["dijit._base"]=true;
dojo.provide("dijit._base");
dojo.require("dijit._base.focus");
dojo.require("dijit._base.manager");
dojo.require("dijit._base.place");
dojo.require("dijit._base.popup");
dojo.require("dijit._base.scroll");
dojo.require("dijit._base.sniff");
dojo.require("dijit._base.typematic");
dojo.require("dijit._base.wai");
dojo.require("dijit._base.window");
}
_Contained.js000064400000001546151164633630007163 0ustar00/*
Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dijit._Contained"]){
dojo._hasResource["dijit._Contained"]=true;
dojo.provide("dijit._Contained");
dojo.declare("dijit._Contained",null,{getParent:function(){
var _1=dijit.getEnclosingWidget(this.domNode.parentNode);
return _1&&_1.isContainer?_1:null;
},_getSibling:function(_2){
var _3=this.domNode;
do{
_3=_3[_2+"Sibling"];
}while(_3&&_3.nodeType!=1);
return _3&&dijit.byNode(_3);
},getPreviousSibling:function(){
return this._getSibling("previous");
},getNextSibling:function(){
return this._getSibling("next");
},getIndexInParent:function(){
var p=this.getParent();
if(!p||!p.getIndexOfChild){
return -1;
}
return p.getIndexOfChild(this);
}});
}
_Container.js000064400000002726151164633630007202 0ustar00/*
Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dijit._Container"]){
dojo._hasResource["dijit._Container"]=true;
dojo.provide("dijit._Container");
dojo.declare("dijit._Container",null,{isContainer:true,buildRendering:function(){
this.inherited(arguments);
if(!this.containerNode){
this.containerNode=this.domNode;
}
},addChild:function(_1,_2){
var _3=this.containerNode;
if(_2&&typeof _2=="number"){
var _4=this.getChildren();
if(_4&&_4.length>=_2){
_3=_4[_2-1].domNode;
_2="after";
}
}
dojo.place(_1.domNode,_3,_2);
if(this._started&&!_1._started){
_1.startup();
}
},removeChild:function(_5){
if(typeof _5=="number"){
_5=this.getChildren()[_5];
}
if(_5){
var _6=_5.domNode;
if(_6&&_6.parentNode){
_6.parentNode.removeChild(_6);
}
}
},hasChildren:function(){
return this.getChildren().length>0;
},destroyDescendants:function(_7){
dojo.forEach(this.getChildren(),function(_8){
_8.destroyRecursive(_7);
});
},_getSiblingOfChild:function(_9,_a){
var
_b=_9.domNode,_c=(_a>0?"nextSibling":"previousSibling");
do{
_b=_b[_c];
}while(_b&&(_b.nodeType!=1||!dijit.byNode(_b)));
return _b&&dijit.byNode(_b);
},getIndexOfChild:function(_d){
return dojo.indexOf(this.getChildren(),_d);
},startup:function(){
if(this._started){
return;
}
dojo.forEach(this.getChildren(),function(_e){
_e.startup();
});
this.inherited(arguments);
}});
}
_CssStateMixin.js000064400000005521151164633630010012 0ustar00/*
Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dijit._CssStateMixin"]){
dojo._hasResource["dijit._CssStateMixin"]=true;
dojo.provide("dijit._CssStateMixin");
dojo.declare("dijit._CssStateMixin",[],{cssStateNodes:{},hovering:false,active:false,_applyAttributes:function(){
this.inherited(arguments);
dojo.forEach(["onmouseenter","onmouseleave","onmousedown"],function(e){
this.connect(this.domNode,e,"_cssMouseEvent");
},this);
dojo.forEach(["disabled","readOnly","checked","selected","focused","state","hovering","active"],function(_1){
this.watch(_1,dojo.hitch(this,"_setStateClass"));
},this);
for(var ap in this.cssStateNodes){
this._trackMouseState(this[ap],this.cssStateNodes[ap]);
}
this._setStateClass();
},_cssMouseEvent:function(_2){
if(!this.disabled){
switch(_2.type){
case "mouseenter":
case "mouseover":
this._set("hovering",true);
this._set("active",this._mouseDown);
break;
case "mouseleave":
case "mouseout":
this._set("hovering",false);
this._set("active",false);
break;
case "mousedown":
this._set("active",true);
this._mouseDown=true;
var _3=this.connect(dojo.body(),"onmouseup",function(){
this._mouseDown=false;
this._set("active",false);
this.disconnect(_3);
});
break;
}
}
},_setStateClass:function(){
var _4=this.baseClass.split(" ");
function _5(_6){
_4=_4.concat(dojo.map(_4,function(c){
return c+_6;
}),"dijit"+_6);
};
if(!this.isLeftToRight()){
_5("Rtl");
}
if(this.checked){
_5("Checked");
}
if(this.state){
_5(this.state);
}
if(this.selected){
_5("Selected");
}
if(this.disabled){
_5("Disabled");
}else{
if(this.readOnly){
_5("ReadOnly");
}else{
if(this.active){
_5("Active");
}else{
if(this.hovering){
_5("Hover");
}
}
}
}
if(this._focused){
_5("Focused");
}
var tn=this.stateNode||this.domNode,_7={};
dojo.forEach(tn.className.split(" "),function(c){
_7[c]=true;
});
if("_stateClasses" in this){
dojo.forEach(this._stateClasses,function(c){
delete _7[c];
});
}
dojo.forEach(_4,function(c){
_7[c]=true;
});
var _8=[];
for(var c in _7){
_8.push(c);
}
tn.className=_8.join(" ");
this._stateClasses=_4;
},_trackMouseState:function(_9,_a){
var _b=false,_c=false,_d=false;
var _e=this,cn=dojo.hitch(this,"connect",_9);
function _f(){
var _10=("disabled" in
_e&&_e.disabled)||("readonly" in
_e&&_e.readonly);
dojo.toggleClass(_9,_a+"Hover",_b&&!_c&&!_10);
dojo.toggleClass(_9,_a+"Active",_c&&!_10);
dojo.toggleClass(_9,_a+"Focused",_d&&!_10);
};
cn("onmouseenter",function(){
_b=true;
_f();
});
cn("onmouseleave",function(){
_b=false;
_c=false;
_f();
});
cn("onmousedown",function(){
_c=true;
_f();
});
cn("onmouseup",function(){
_c=false;
_f();
});
cn("onfocus",function(){
_d=true;
_f();
});
cn("onblur",function(){
_d=false;
_f();
});
this.watch("disabled",_f);
this.watch("readOnly",_f);
}});
}
_Templated.js000064400000010234151164633630007170 0ustar00/*
Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dijit._Templated"]){
dojo._hasResource["dijit._Templated"]=true;
dojo.provide("dijit._Templated");
dojo.require("dijit._Widget");
dojo.require("dojo.string");
dojo.require("dojo.parser");
dojo.require("dojo.cache");
dojo.declare("dijit._Templated",null,{templateString:null,templatePath:null,widgetsInTemplate:false,_skipNodeCache:false,_earlyTemplatedStartup:false,constructor:function(){
this._attachPoints=[];
this._attachEvents=[];
},_stringRepl:function(_1){
var _2=this.declaredClass,_3=this;
return dojo.string.substitute(_1,this,function(_4,_5){
if(_5.charAt(0)=="!"){
_4=dojo.getObject(_5.substr(1),false,_3);
}
if(typeof _4=="undefined"){
throw new Error(_2+" template:"+_5);
}
if(_4==null){
return "";
}
return
_5.charAt(0)=="!"?_4:_4.toString().replace(/"/g,""");
},this);
},buildRendering:function(){
var
_6=dijit._Templated.getCachedTemplate(this.templatePath,this.templateString,this._skipNodeCache);
var _7;
if(dojo.isString(_6)){
_7=dojo._toDom(this._stringRepl(_6));
if(_7.nodeType!=1){
throw new Error("Invalid template: "+_6);
}
}else{
_7=_6.cloneNode(true);
}
this.domNode=_7;
this.inherited(arguments);
this._attachTemplateNodes(_7);
if(this.widgetsInTemplate){
var
cw=(this._startupWidgets=dojo.parser.parse(_7,{noStart:!this._earlyTemplatedStartup,template:true,inherited:{dir:this.dir,lang:this.lang},propsThis:this,scope:"dojo"}));
this._supportingWidgets=dijit.findWidgets(_7);
this._attachTemplateNodes(cw,function(n,p){
return n[p];
});
}
this._fillContent(this.srcNodeRef);
},_fillContent:function(_8){
var _9=this.containerNode;
if(_8&&_9){
while(_8.hasChildNodes()){
_9.appendChild(_8.firstChild);
}
}
},_attachTemplateNodes:function(_a,_b){
_b=_b||function(n,p){
return n.getAttribute(p);
};
var
_c=dojo.isArray(_a)?_a:(_a.all||_a.getElementsByTagName("*"));
var x=dojo.isArray(_a)?0:-1;
for(;x<_c.length;x++){
var _d=(x==-1)?_a:_c[x];
if(this.widgetsInTemplate&&(_b(_d,"dojoType")||_b(_d,"data-dojo-type"))){
continue;
}
var
_e=_b(_d,"dojoAttachPoint")||_b(_d,"data-dojo-attach-point");
if(_e){
var _f,_10=_e.split(/\s*,\s*/);
while((_f=_10.shift())){
if(dojo.isArray(this[_f])){
this[_f].push(_d);
}else{
this[_f]=_d;
}
this._attachPoints.push(_f);
}
}
var
_11=_b(_d,"dojoAttachEvent")||_b(_d,"data-dojo-attach-event");
if(_11){
var _12,_13=_11.split(/\s*,\s*/);
var _14=dojo.trim;
while((_12=_13.shift())){
if(_12){
var _15=null;
if(_12.indexOf(":")!=-1){
var _16=_12.split(":");
_12=_14(_16[0]);
_15=_14(_16[1]);
}else{
_12=_14(_12);
}
if(!_15){
_15=_12;
}
this._attachEvents.push(this.connect(_d,_12,_15));
}
}
}
var _17=_b(_d,"waiRole");
if(_17){
dijit.setWaiRole(_d,_17);
}
var _18=_b(_d,"waiState");
if(_18){
dojo.forEach(_18.split(/\s*,\s*/),function(_19){
if(_19.indexOf("-")!=-1){
var _1a=_19.split("-");
dijit.setWaiState(_d,_1a[0],_1a[1]);
}
});
}
}
},startup:function(){
dojo.forEach(this._startupWidgets,function(w){
if(w&&!w._started&&w.startup){
w.startup();
}
});
this.inherited(arguments);
},destroyRendering:function(){
dojo.forEach(this._attachPoints,function(_1b){
delete this[_1b];
},this);
this._attachPoints=[];
dojo.forEach(this._attachEvents,this.disconnect,this);
this._attachEvents=[];
this.inherited(arguments);
}});
dijit._Templated._templateCache={};
dijit._Templated.getCachedTemplate=function(_1c,_1d,_1e){
var _1f=dijit._Templated._templateCache;
var key=_1d||_1c;
var _20=_1f[key];
if(_20){
try{
if(!_20.ownerDocument||_20.ownerDocument==dojo.doc){
return _20;
}
}
catch(e){
}
dojo.destroy(_20);
}
if(!_1d){
_1d=dojo.cache(_1c,{sanitize:true});
}
_1d=dojo.string.trim(_1d);
if(_1e||_1d.match(/\$\{([^\}]+)\}/g)){
return (_1f[key]=_1d);
}else{
var _21=dojo._toDom(_1d);
if(_21.nodeType!=1){
throw new Error("Invalid template: "+_1d);
}
return (_1f[key]=_21);
}
};
if(dojo.isIE){
dojo.addOnWindowUnload(function(){
var _22=dijit._Templated._templateCache;
for(var key in _22){
var _23=_22[key];
if(typeof _23=="object"){
dojo.destroy(_23);
}
delete _22[key];
}
});
}
dojo.extend(dijit._Widget,{dojoAttachEvent:"",dojoAttachPoint:"",waiRole:"",waiState:""});
}
_Widget.js000064400000007553151164633630006506 0ustar00/*
Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dijit._Widget"]){
dojo._hasResource["dijit._Widget"]=true;
dojo.provide("dijit._Widget");
dojo.require("dijit._WidgetBase");
dojo.require("dijit._base");
dojo.connect(dojo,"_connect",function(_1,_2){
if(_1&&dojo.isFunction(_1._onConnect)){
_1._onConnect(_2);
}
});
dijit._connectOnUseEventHandler=function(_3){
};
dijit._lastKeyDownNode=null;
if(dojo.isIE){
(function(){
var _4=function(_5){
dijit._lastKeyDownNode=_5.srcElement;
};
dojo.doc.attachEvent("onkeydown",_4);
dojo.addOnWindowUnload(function(){
dojo.doc.detachEvent("onkeydown",_4);
});
})();
}else{
dojo.doc.addEventListener("keydown",function(_6){
dijit._lastKeyDownNode=_6.target;
},true);
}
(function(){
dojo.declare("dijit._Widget",dijit._WidgetBase,{_deferredConnects:{onClick:"",onDblClick:"",onKeyDown:"",onKeyPress:"",onKeyUp:"",onMouseMove:"",onMouseDown:"",onMouseOut:"",onMouseOver:"",onMouseLeave:"",onMouseEnter:"",onMouseUp:""},onClick:dijit._connectOnUseEventHandler,onDblClick:dijit._connectOnUseEventHandler,onKeyDown:dijit._connectOnUseEventHandler,onKeyPress:dijit._connectOnUseEventHandler,onKeyUp:dijit._connectOnUseEventHandler,onMouseDown:dijit._connectOnUseEventHandler,onMouseMove:dijit._connectOnUseEventHandler,onMouseOut:dijit._connectOnUseEventHandler,onMouseOver:dijit._connectOnUseEventHandler,onMouseLeave:dijit._connectOnUseEventHandler,onMouseEnter:dijit._connectOnUseEventHandler,onMouseUp:dijit._connectOnUseEventHandler,create:function(_7,_8){
this._deferredConnects=dojo.clone(this._deferredConnects);
for(var _9 in this.attributeMap){
delete this._deferredConnects[_9];
}
for(_9 in this._deferredConnects){
if(this[_9]!==dijit._connectOnUseEventHandler){
delete this._deferredConnects[_9];
}
}
this.inherited(arguments);
if(this.domNode){
for(_9 in this.params){
this._onConnect(_9);
}
}
},_onConnect:function(_a){
if(_a in this._deferredConnects){
var _b=this[this._deferredConnects[_a]||"domNode"];
this.connect(_b,_a.toLowerCase(),_a);
delete this._deferredConnects[_a];
}
},focused:false,isFocusable:function(){
return
this.focus&&(dojo.style(this.domNode,"display")!="none");
},onFocus:function(){
},onBlur:function(){
},_onFocus:function(e){
this.onFocus();
},_onBlur:function(){
this.onBlur();
},setAttribute:function(_c,_d){
dojo.deprecated(this.declaredClass+"::setAttribute(attr, value) is
deprecated. Use set() instead.","","2.0");
this.set(_c,_d);
},attr:function(_e,_f){
if(dojo.config.isDebug){
var
_10=arguments.callee._ach||(arguments.callee._ach={}),_11=(arguments.callee.caller||"unknown
caller").toString();
if(!_10[_11]){
dojo.deprecated(this.declaredClass+"::attr() is deprecated. Use get()
or set() instead, called from "+_11,"","2.0");
_10[_11]=true;
}
}
var _12=arguments.length;
if(_12>=2||typeof _e==="object"){
return this.set.apply(this,arguments);
}else{
return this.get(_e);
}
},nodesWithKeyClick:["input","button"],connect:function(obj,_13,_14){
var
d=dojo,dc=d._connect,_15=this.inherited(arguments,[obj,_13=="ondijitclick"?"onclick":_13,_14]);
if(_13=="ondijitclick"){
if(d.indexOf(this.nodesWithKeyClick,obj.nodeName.toLowerCase())==-1){
var m=d.hitch(this,_14);
_15.push(dc(obj,"onkeydown",this,function(e){
if((e.keyCode==d.keys.ENTER||e.keyCode==d.keys.SPACE)&&!e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey){
dijit._lastKeyDownNode=e.target;
if(!("openDropDown" in this&&obj==this._buttonNode)){
e.preventDefault();
}
}
}),dc(obj,"onkeyup",this,function(e){
if((e.keyCode==d.keys.ENTER||e.keyCode==d.keys.SPACE)&&e.target==dijit._lastKeyDownNode&&!e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey){
dijit._lastKeyDownNode=null;
return m(e);
}
}));
}
}
return _15;
},_onShow:function(){
this.onShow();
},onShow:function(){
},onHide:function(){
},onClose:function(){
return true;
}});
})();
}
_WidgetBase.js000064400000014471151164633630007276 0ustar00/*
Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dijit._WidgetBase"]){
dojo._hasResource["dijit._WidgetBase"]=true;
dojo.provide("dijit._WidgetBase");
dojo.require("dijit._base.manager");
dojo.require("dojo.Stateful");
(function(){
dojo.declare("dijit._WidgetBase",dojo.Stateful,{id:"",lang:"",dir:"","class":"",style:"",title:"",tooltip:"",baseClass:"",srcNodeRef:null,domNode:null,containerNode:null,attributeMap:{id:"",dir:"",lang:"","class":"",style:"",title:""},_blankGif:(dojo.config.blankGif||dojo.moduleUrl("dojo","resources/blank.gif")).toString(),postscript:function(_1,_2){
this.create(_1,_2);
},create:function(_3,_4){
this.srcNodeRef=dojo.byId(_4);
this._connects=[];
this._subscribes=[];
if(this.srcNodeRef&&(typeof
this.srcNodeRef.id=="string")){
this.id=this.srcNodeRef.id;
}
if(_3){
this.params=_3;
dojo._mixin(this,_3);
}
this.postMixInProperties();
if(!this.id){
this.id=dijit.getUniqueId(this.declaredClass.replace(/\./g,"_"));
}
dijit.registry.add(this);
this.buildRendering();
if(this.domNode){
this._applyAttributes();
var _5=this.srcNodeRef;
if(_5&&_5.parentNode&&this.domNode!==_5){
_5.parentNode.replaceChild(this.domNode,_5);
}
}
if(this.domNode){
this.domNode.setAttribute("widgetId",this.id);
}
this.postCreate();
if(this.srcNodeRef&&!this.srcNodeRef.parentNode){
delete this.srcNodeRef;
}
this._created=true;
},_applyAttributes:function(){
var _6=function(_7,_8){
if((_8.params&&_7 in _8.params)||_8[_7]){
_8.set(_7,_8[_7]);
}
};
for(var _9 in this.attributeMap){
_6(_9,this);
}
dojo.forEach(this._getSetterAttributes(),function(a){
if(!(a in this.attributeMap)){
_6(a,this);
}
},this);
},_getSetterAttributes:function(){
var _a=this.constructor;
if(!_a._setterAttrs){
var r=(_a._setterAttrs=[]),_b,_c=_a.prototype;
for(var _d in _c){
if(dojo.isFunction(_c[_d])&&(_b=_d.match(/^_set([a-zA-Z]*)Attr$/))&&_b[1]){
r.push(_b[1].charAt(0).toLowerCase()+_b[1].substr(1));
}
}
}
return _a._setterAttrs;
},postMixInProperties:function(){
},buildRendering:function(){
if(!this.domNode){
this.domNode=this.srcNodeRef||dojo.create("div");
}
if(this.baseClass){
var _e=this.baseClass.split(" ");
if(!this.isLeftToRight()){
_e=_e.concat(dojo.map(_e,function(_f){
return _f+"Rtl";
}));
}
dojo.addClass(this.domNode,_e);
}
},postCreate:function(){
},startup:function(){
this._started=true;
},destroyRecursive:function(_10){
this._beingDestroyed=true;
this.destroyDescendants(_10);
this.destroy(_10);
},destroy:function(_11){
this._beingDestroyed=true;
this.uninitialize();
var d=dojo,dfe=d.forEach,dun=d.unsubscribe;
dfe(this._connects,function(_12){
dfe(_12,d.disconnect);
});
dfe(this._subscribes,function(_13){
dun(_13);
});
dfe(this._supportingWidgets||[],function(w){
if(w.destroyRecursive){
w.destroyRecursive();
}else{
if(w.destroy){
w.destroy();
}
}
});
this.destroyRendering(_11);
dijit.registry.remove(this.id);
this._destroyed=true;
},destroyRendering:function(_14){
if(this.bgIframe){
this.bgIframe.destroy(_14);
delete this.bgIframe;
}
if(this.domNode){
if(_14){
dojo.removeAttr(this.domNode,"widgetId");
}else{
dojo.destroy(this.domNode);
}
delete this.domNode;
}
if(this.srcNodeRef){
if(!_14){
dojo.destroy(this.srcNodeRef);
}
delete this.srcNodeRef;
}
},destroyDescendants:function(_15){
dojo.forEach(this.getChildren(),function(_16){
if(_16.destroyRecursive){
_16.destroyRecursive(_15);
}
});
},uninitialize:function(){
return false;
},_setClassAttr:function(_17){
var _18=this[this.attributeMap["class"]||"domNode"];
dojo.replaceClass(_18,_17,this["class"]);
this._set("class",_17);
},_setStyleAttr:function(_19){
var _1a=this[this.attributeMap.style||"domNode"];
if(dojo.isObject(_19)){
dojo.style(_1a,_19);
}else{
if(_1a.style.cssText){
_1a.style.cssText+="; "+_19;
}else{
_1a.style.cssText=_19;
}
}
this._set("style",_19);
},_attrToDom:function(_1b,_1c){
var _1d=this.attributeMap[_1b];
dojo.forEach(dojo.isArray(_1d)?_1d:[_1d],function(_1e){
var _1f=this[_1e.node||_1e||"domNode"];
var _20=_1e.type||"attribute";
switch(_20){
case "attribute":
if(dojo.isFunction(_1c)){
_1c=dojo.hitch(this,_1c);
}
var
_21=_1e.attribute?_1e.attribute:(/^on[A-Z][a-zA-Z]*$/.test(_1b)?_1b.toLowerCase():_1b);
dojo.attr(_1f,_21,_1c);
break;
case "innerText":
_1f.innerHTML="";
_1f.appendChild(dojo.doc.createTextNode(_1c));
break;
case "innerHTML":
_1f.innerHTML=_1c;
break;
case "class":
dojo.replaceClass(_1f,_1c,this[_1b]);
break;
}
},this);
},get:function(_22){
var _23=this._getAttrNames(_22);
return this[_23.g]?this[_23.g]():this[_22];
},set:function(_24,_25){
if(typeof _24==="object"){
for(var x in _24){
this.set(x,_24[x]);
}
return this;
}
var _26=this._getAttrNames(_24);
if(this[_26.s]){
var _27=this[_26.s].apply(this,Array.prototype.slice.call(arguments,1));
}else{
if(_24 in this.attributeMap){
this._attrToDom(_24,_25);
}
this._set(_24,_25);
}
return _27||this;
},_attrPairNames:{},_getAttrNames:function(_28){
var apn=this._attrPairNames;
if(apn[_28]){
return apn[_28];
}
var uc=_28.charAt(0).toUpperCase()+_28.substr(1);
return
(apn[_28]={n:_28+"Node",s:"_set"+uc+"Attr",g:"_get"+uc+"Attr"});
},_set:function(_29,_2a){
var _2b=this[_29];
this[_29]=_2a;
if(this._watchCallbacks&&this._created&&_2a!==_2b){
this._watchCallbacks(_29,_2b,_2a);
}
},toString:function(){
return "[Widget "+this.declaredClass+",
"+(this.id||"NO ID")+"]";
},getDescendants:function(){
return
this.containerNode?dojo.query("[widgetId]",this.containerNode).map(dijit.byNode):[];
},getChildren:function(){
return this.containerNode?dijit.findWidgets(this.containerNode):[];
},connect:function(obj,_2c,_2d){
var _2e=[dojo._connect(obj,_2c,this,_2d)];
this._connects.push(_2e);
return _2e;
},disconnect:function(_2f){
for(var i=0;i<this._connects.length;i++){
if(this._connects[i]==_2f){
dojo.forEach(_2f,dojo.disconnect);
this._connects.splice(i,1);
return;
}
}
},subscribe:function(_30,_31){
var _32=dojo.subscribe(_30,this,_31);
this._subscribes.push(_32);
return _32;
},unsubscribe:function(_33){
for(var i=0;i<this._subscribes.length;i++){
if(this._subscribes[i]==_33){
dojo.unsubscribe(_33);
this._subscribes.splice(i,1);
return;
}
}
},isLeftToRight:function(){
return this.dir?(this.dir=="ltr"):dojo._isBodyLtr();
},placeAt:function(_34,_35){
if(_34.declaredClass&&_34.addChild){
_34.addChild(this,_35);
}else{
dojo.place(this.domNode,_34,_35);
}
return this;
}});
})();
}