a:45:{s:9:"#provides";s:18:"dojo.dnd.Container";s:9:"#resource";s:16:"dnd/Container.js";s:9:"#requires";a:2:{i:0;a:2:{i:0;s:6:"common";i:1;s:15:"dojo.dnd.common";}i:1;a:2:{i:0;s:6:"common";i:1;s:11:"dojo.parser";}}s:18:"dojo.dnd.Container";a:5:{s:4:"type";s:8:"Function";s:7:"summary";s:30:"a constructor of the Container";s:10:"parameters";a:2:{s:4:"node";a:2:{s:4:"type";s:4:"Node";s:7:"summary";s:43:"node or node's id to build the container on";}s:6:"params";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:48:"a dict of parameters, recognized parameters are:";}}s:6:"source";s:808:" this.node = dojo.byId(node); if(!params){ params = {}; } this.creator = params.creator || null; this.skipForm = params.skipForm; this.parent = params.dropParent && dojo.byId(params.dropParent); // class-specific variables this.map = {}; this.current = null; // states this.containerState = ""; dojo.addClass(this.node, "dojoDndContainer"); // mark up children if(!(params && params._skipStartup)){ this.startup(); } // set up events this.events = [ dojo.connect(this.node, "onmouseover", this, "onMouseOver"), dojo.connect(this.node, "onmouseout", this, "onMouseOut"), // cancel text selection and text dragging dojo.connect(this.node, "ondragstart", this, "onSelectStart"), dojo.connect(this.node, "onselectstart", this, "onSelectStart") ];";s:9:"classlike";b:1;}s:27:"dojo.dnd.Container.skipForm";a:4:{s:9:"prototype";s:18:"dojo.dnd.Container";s:8:"instance";s:18:"dojo.dnd.Container";s:4:"type";s:7:"Boolean";s:7:"summary";s:318:"don't start the drag operation, if clicked on form elements dropParent: Node: node or node's id to use as the parent node for dropped items (must be underneath the 'node' parameter in the DOM) _skipStartup: Boolean: skip startup(), which collects children, for deferred initialization (this is used in the markup mode)";}s:26:"dojo.dnd.Container.creator";a:5:{s:9:"prototype";s:18:"dojo.dnd.Container";s:4:"type";s:8:"Function";s:6:"source";s:21:"} ";s:8:"instance";s:18:"dojo.dnd.Container";s:7:"summary";s:131:"a creator function, which takes a data item, and returns an object like that: {node: newNode, data: usedData, type: arrayOfStrings}";}s:26:"dojo.dnd.Container.getItem";a:6:{s:9:"prototype";s:18:"dojo.dnd.Container";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:3:"key";a:1:{s:4:"type";s:6:"String";}}s:6:"source";s:33:" return this.map[key]; // Object";s:7:"summary";s:35:"returns a data item by its key (id)";s:7:"returns";s:6:"Object";}s:26:"dojo.dnd.Container.setItem";a:5:{s:9:"prototype";s:18:"dojo.dnd.Container";s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:3:"key";a:1:{s:4:"type";s:6:"String";}s:4:"data";a:1:{s:4:"type";s:6:"Object";}}s:6:"source";s:23:" this.map[key] = data;";s:7:"summary";s:40:"associates a data item with its key (id)";}s:26:"dojo.dnd.Container.delItem";a:5:{s:9:"prototype";s:18:"dojo.dnd.Container";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:3:"key";a:1:{s:4:"type";s:6:"String";}}s:6:"source";s:23:" delete this.map[key];";s:7:"summary";s:48:"removes a data item from the map by its key (id)";}s:29:"dojo.dnd.Container.forInItems";a:6:{s:9:"prototype";s:18:"dojo.dnd.Container";s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:1:"f";a:1:{s:4:"type";s:8:"Function";}s:1:"o";a:2:{s:8:"optional";b:1;s:4:"type";s:6:"Object";}}s:6:"source";s:165:" o = o || dojo.global; var m = this.map, e = dojo.dnd._empty; for(var i in m){ if(i in e){ continue; } f.call(o, m[i], i, this); } return o; // Object";s:7:"summary";s:113:"iterates over a data map skipping members, which are present in the empty object (IE and/or 3rd-party libraries).";s:7:"returns";s:6:"Object";}s:29:"dojo.dnd.Container.clearItems";a:4:{s:9:"prototype";s:18:"dojo.dnd.Container";s:4:"type";s:8:"Function";s:6:"source";s:16:" this.map = {};";s:7:"summary";s:35:"removes all data items from the map";}s:30:"dojo.dnd.Container.getAllNodes";a:5:{s:9:"prototype";s:18:"dojo.dnd.Container";s:4:"type";s:8:"Function";s:6:"source";s:63:" return dojo.query("> .dojoDndItem", this.parent); // NodeList";s:7:"summary";s:50:"returns a list (an array) of all valid child nodes";s:7:"returns";s:8:"NodeList";}s:23:"dojo.dnd.Container.sync";a:5:{s:9:"prototype";s:18:"dojo.dnd.Container";s:4:"type";s:8:"Function";s:6:"source";s:474:" var map = {}; this.getAllNodes().forEach(function(node){ if(node.id){ var item = this.getItem(node.id); if(item){ map[node.id] = item; return; } }else{ node.id = dojo.dnd.getUniqueId(); } var type = node.getAttribute("dndType"), data = node.getAttribute("dndData"); map[node.id] = { data: data || node.innerHTML, type: type ? type.split(/\s*,\s*/) : ["text"] }; }, this); this.map = map; return this; // self";s:7:"summary";s:40:"synch up the node list with the data map";s:7:"returns";s:4:"self";}s:30:"dojo.dnd.Container.insertNodes";a:6:{s:9:"prototype";s:18:"dojo.dnd.Container";s:4:"type";s:8:"Function";s:10:"parameters";a:3:{s:4:"data";a:2:{s:4:"type";s:5:"Array";s:7:"summary";s:71:"a list of data items, which should be processed by the creator function";}s:6:"before";a:2:{s:4:"type";s:7:"Boolean";s:7:"summary";s:65:"insert before the anchor, if true, and after the anchor otherwise";}s:6:"anchor";a:2:{s:4:"type";s:4:"Node";s:7:"summary";s:50:"the anchor node to be used as a point of insertion";}}s:6:"source";s:627:" if(!this.parent.firstChild){ anchor = null; }else if(before){ if(!anchor){ anchor = this.parent.firstChild; } }else{ if(anchor){ anchor = anchor.nextSibling; } } if(anchor){ for(var i = 0; i < data.length; ++i){ var t = this._normalizedCreator(data[i]); this.setItem(t.node.id, {data: t.data, type: t.type}); this.parent.insertBefore(t.node, anchor); } }else{ for(var i = 0; i < data.length; ++i){ var t = this._normalizedCreator(data[i]); this.setItem(t.node.id, {data: t.data, type: t.type}); this.parent.appendChild(t.node); } } return this; // self";s:7:"summary";s:57:"inserts an array of new nodes before/after an anchor node";s:7:"returns";s:4:"self";}s:26:"dojo.dnd.Container.destroy";a:4:{s:9:"prototype";s:18:"dojo.dnd.Container";s:4:"type";s:8:"Function";s:6:"source";s:115:" dojo.forEach(this.events, dojo.disconnect); this.clearItems(); this.node = this.parent = this.current = null;";s:7:"summary";s:43:"prepares the object to be garbage-collected";}s:32:"dojo.dnd.Container.markupFactory";a:5:{s:9:"prototype";s:18:"dojo.dnd.Container";s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:6:"params";a:1:{s:4:"type";s:0:"";}s:4:"node";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:76:" params._skipStartup = true; return new dojo.dnd.Container(node, params);";s:7:"summary";s:0:"";}s:26:"dojo.dnd.Container.startup";a:4:{s:9:"prototype";s:18:"dojo.dnd.Container";s:4:"type";s:8:"Function";s:6:"source";s:378:" if(!this.parent){ // use the standard algorithm, if not assigned this.parent = this.node; if(this.parent.tagName.toLowerCase() == "table"){ var c = this.parent.getElementsByTagName("tbody"); if(c && c.length){ this.parent = c[0]; } } } this.defaultCreator = dojo.dnd._defaultCreator(this.parent); // process specially marked children this.sync();";s:7:"summary";s:76:"collects valid child items and populate the map set up the real parent node";}s:30:"dojo.dnd.Container.onMouseOver";a:5:{s:9:"prototype";s:18:"dojo.dnd.Container";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:2:{s:4:"type";s:5:"Event";s:7:"summary";s:11:"mouse event";}}s:6:"source";s:413:" var n = e.relatedTarget; while(n){ if(n == this.node){ break; } try{ n = n.parentNode; }catch(x){ n = null; } } if(!n){ this._changeState("Container", "Over"); this.onOverEvent(); } n = this._getChildByEvent(e); if(this.current == n){ return; } if(this.current){ this._removeItemClass(this.current, "Over"); } if(n){ this._addItemClass(n, "Over"); } this.current = n;";s:7:"summary";s:31:"event processor for onmouseover";}s:29:"dojo.dnd.Container.onMouseOut";a:5:{s:9:"prototype";s:18:"dojo.dnd.Container";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:2:{s:4:"type";s:5:"Event";s:7:"summary";s:11:"mouse event";}}s:6:"source";s:290:" for(var n = e.relatedTarget; n;){ if(n == this.node){ return; } try{ n = n.parentNode; }catch(x){ n = null; } } if(this.current){ this._removeItemClass(this.current, "Over"); this.current = null; } this._changeState("Container", ""); this.onOutEvent();";s:7:"summary";s:30:"event processor for onmouseout";}s:32:"dojo.dnd.Container.onSelectStart";a:5:{s:9:"prototype";s:18:"dojo.dnd.Container";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:2:{s:4:"type";s:5:"Event";s:7:"summary";s:11:"mouse event";}}s:6:"source";s:77:" if(!this.skipForm || !dojo.dnd.isFormElement(e)){ dojo.stopEvent(e); }";s:7:"summary";s:49:"event processor for onselectevent and ondragevent";}s:30:"dojo.dnd.Container.onOverEvent";a:4:{s:9:"prototype";s:18:"dojo.dnd.Container";s:4:"type";s:8:"Function";s:6:"source";s:76:" // summary: this function is called once, when mouse is over our container";s:7:"summary";s:62:"this function is called once, when mouse is over our container";}s:29:"dojo.dnd.Container.onOutEvent";a:4:{s:9:"prototype";s:18:"dojo.dnd.Container";s:4:"type";s:8:"Function";s:6:"source";s:78:" // summary: this function is called once, when mouse is out of our container";s:7:"summary";s:64:"this function is called once, when mouse is out of our container";}s:31:"dojo.dnd.Container._changeState";a:6:{s:9:"prototype";s:18:"dojo.dnd.Container";s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:4:"type";a:2:{s:4:"type";s:6:"String";s:7:"summary";s:29:"a name of the state to change";}s:8:"newState";a:2:{s:4:"type";s:6:"String";s:7:"summary";s:9:"new state";}}s:6:"source";s:278:" var prefix = "dojoDnd" + type; var state = type.toLowerCase() + "State"; //dojo.replaceClass(this.node, prefix + newState, prefix + this[state]); dojo.removeClass(this.node, prefix + this[state]); dojo.addClass(this.node, prefix + newState); this[state] = newState;";s:7:"summary";s:40:"changes a named state to new state value";s:7:"private";b:1;}s:32:"dojo.dnd.Container._addItemClass";a:6:{s:9:"prototype";s:18:"dojo.dnd.Container";s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:4:"node";a:2:{s:4:"type";s:4:"Node";s:7:"summary";s:6:"a node";}s:4:"type";a:2:{s:4:"type";s:6:"String";s:7:"summary";s:34:"a variable suffix for a class name";}}s:6:"source";s:44:" dojo.addClass(node, "dojoDndItem" + type);";s:7:"summary";s:48:"adds a class with prefix "dojoDndItem"";s:7:"private";b:1;}s:35:"dojo.dnd.Container._removeItemClass";a:6:{s:9:"prototype";s:18:"dojo.dnd.Container";s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:4:"node";a:2:{s:4:"type";s:4:"Node";s:7:"summary";s:6:"a node";}s:4:"type";a:2:{s:4:"type";s:6:"String";s:7:"summary";s:34:"a variable suffix for a class name";}}s:6:"source";s:47:" dojo.removeClass(node, "dojoDndItem" + type);";s:7:"summary";s:51:"removes a class with prefix "dojoDndItem"";s:7:"private";b:1;}s:35:"dojo.dnd.Container._getChildByEvent";a:6:{s:9:"prototype";s:18:"dojo.dnd.Container";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:2:{s:4:"type";s:5:"Event";s:7:"summary";s:13:"a mouse event";}}s:6:"source";s:229:" var node = e.target; if(node){ for(var parent = node.parentNode; parent; node = parent, parent = node.parentNode){ if(parent == this.parent && dojo.hasClass(node, "dojoDndItem")){ return node; } } } return null;";s:7:"summary";s:61:"gets a child, which is under the mouse at the moment, or null";s:7:"private";b:1;}s:37:"dojo.dnd.Container._normalizedCreator";a:6:{s:9:"prototype";s:18:"dojo.dnd.Container";s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:4:"item";a:1:{s:4:"type";s:0:"";}s:4:"hint";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:229:" var t = (this.creator || this.defaultCreator).call(this, item, hint); if(!dojo.isArray(t.type)){ t.type = ["text"]; } if(!t.node.id){ t.node.id = dojo.dnd.getUniqueId(); } dojo.addClass(t.node, "dojoDndItem"); return t;";s:7:"summary";s:75:"adds all necessary data to the output of the user-supplied creator function";s:7:"private";b:1;}s:22:"dojo.dnd.Container.map";a:2:{s:8:"instance";s:18:"dojo.dnd.Container";s:7:"summary";s:0:"";}s:23:"dojo.dnd.Container.node";a:3:{s:8:"instance";s:18:"dojo.dnd.Container";s:4:"type";s:4:"Node";s:7:"summary";s:43:"node or node's id to build the container on";}s:25:"dojo.dnd.Container.parent";a:2:{s:8:"instance";s:18:"dojo.dnd.Container";s:7:"summary";s:0:"";}s:33:"dojo.dnd.Container.defaultCreator";a:2:{s:8:"instance";s:18:"dojo.dnd.Container";s:7:"summary";s:0:"";}s:26:"dojo.dnd.Container.current";a:2:{s:8:"instance";s:18:"dojo.dnd.Container";s:7:"summary";s:0:"";}s:33:"dojo.dnd.Container.containerState";a:2:{s:8:"instance";s:18:"dojo.dnd.Container";s:7:"summary";s:0:"";}s:25:"dojo.dnd.Container.events";a:2:{s:8:"instance";s:18:"dojo.dnd.Container";s:7:"summary";s:0:"";}s:29:"dojo.dnd._defaultCreatorNodes";a:3:{s:4:"type";s:6:"Object";s:7:"private";b:1;s:7:"summary";s:0:"";}s:32:"dojo.dnd._defaultCreatorNodes.ul";a:2:{s:14:"private_parent";b:1;s:7:"summary";s:0:"";}s:32:"dojo.dnd._defaultCreatorNodes.ol";a:2:{s:14:"private_parent";b:1;s:7:"summary";s:0:"";}s:33:"dojo.dnd._defaultCreatorNodes.div";a:2:{s:14:"private_parent";b:1;s:7:"summary";s:0:"";}s:31:"dojo.dnd._defaultCreatorNodes.p";a:2:{s:14:"private_parent";b:1;s:7:"summary";s:0:"";}s:20:"dojo.dnd._createNode";a:6:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:3:"tag";a:2:{s:4:"type";s:6:"String";s:7:"summary";s:28:"a tag name or empty for SPAN";}}s:6:"source";s:135:" if(!tag){ return dojo.dnd._createSpan; } return function(text){ // Function return dojo.create(tag, {innerHTML: text}); // Node };";s:7:"summary";s:112:"returns a function, which creates an element of given tag (SPAN by default) and sets its innerHTML to given text";s:7:"returns";s:13:"Function|Node";s:7:"private";b:1;}s:20:"dojo.dnd._createTrTd";a:6:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"text";a:2:{s:4:"type";s:6:"String";s:7:"summary";s:13:"a text for TD";}}s:6:"source";s:91:" var tr = dojo.create("tr"); dojo.create("td", {innerHTML: text}, tr); return tr; // Node";s:7:"summary";s:63:"creates a TR/TD structure with given text as an innerHTML of TD";s:7:"returns";s:4:"Node";s:7:"private";b:1;}s:20:"dojo.dnd._createSpan";a:6:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"text";a:2:{s:4:"type";s:6:"String";s:7:"summary";s:15:"a text for SPAN";}}s:6:"source";s:55:" return dojo.create("span", {innerHTML: text}); // Node";s:7:"summary";s:55:"creates a SPAN element with given text as its innerHTML";s:7:"returns";s:4:"Node";s:7:"private";b:1;}s:24:"dojo.dnd._defaultCreator";a:6:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"node";a:2:{s:4:"type";s:4:"Node";s:7:"summary";s:16:"a container node";}}s:6:"source";s:885:" var tag = node.tagName.toLowerCase(); var c = tag == "tbody" || tag == "thead" ? dojo.dnd._createTrTd : dojo.dnd._createNode(dojo.dnd._defaultCreatorNodes[tag]); return function(item, hint){ // Function var isObj = item && dojo.isObject(item), data, type, n; if(isObj && item.tagName && item.nodeType && item.getAttribute){ // process a DOM node data = item.getAttribute("dndData") || item.innerHTML; type = item.getAttribute("dndType"); type = type ? type.split(/\s*,\s*/) : ["text"]; n = item; // this node is going to be moved rather than copied }else{ // process a DnD item object or a string data = (isObj && item.data) ? item.data : item; type = (isObj && item.type) ? item.type : ["text"]; n = (hint == "avatar" ? dojo.dnd._createSpan : c)(String(data)); } n.id = dojo.dnd.getUniqueId(); return {node: n, data: data, type: type}; };";s:7:"summary";s:64:"takes a parent node, and returns an appropriate creator function";s:7:"returns";s:8:"Function";s:7:"private";b:1;}s:8:"dojo.dnd";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}s:4:"dojo";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}}