From 1354d17270961fff662d40f90521223f8fd0d73b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 14 Aug 2012 18:59:10 +0400 Subject: update dojo to 1.7.3 --- lib/dojo/dnd/Avatar.js | 112 +------------------------------------------------ 1 file changed, 2 insertions(+), 110 deletions(-) (limited to 'lib/dojo/dnd/Avatar.js') diff --git a/lib/dojo/dnd/Avatar.js b/lib/dojo/dnd/Avatar.js index 8f43801b3..51003b9eb 100644 --- a/lib/dojo/dnd/Avatar.js +++ b/lib/dojo/dnd/Avatar.js @@ -4,113 +4,5 @@ see: http://dojotoolkit.org/license for details */ - -if(!dojo._hasResource["dojo.dnd.Avatar"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["dojo.dnd.Avatar"] = true; -dojo.provide("dojo.dnd.Avatar"); -dojo.require("dojo.dnd.common"); - - -dojo.declare("dojo.dnd.Avatar", null, { - // summary: - // Object that represents transferred DnD items visually - // manager: Object - // a DnD manager object - - constructor: function(manager){ - this.manager = manager; - this.construct(); - }, - - // methods - construct: function(){ - // summary: - // constructor function; - // it is separate so it can be (dynamically) overwritten in case of need - this.isA11y = dojo.hasClass(dojo.body(),"dijit_a11y"); - var a = dojo.create("table", { - "class": "dojoDndAvatar", - style: { - position: "absolute", - zIndex: "1999", - margin: "0px" - } - }), - source = this.manager.source, node, - b = dojo.create("tbody", null, a), - tr = dojo.create("tr", null, b), - td = dojo.create("td", null, tr), - icon = this.isA11y ? dojo.create("span", { - id : "a11yIcon", - innerHTML : this.manager.copy ? '+' : "<" - }, td) : null, - span = dojo.create("span", { - innerHTML: source.generateText ? this._generateText() : "" - }, td), - k = Math.min(5, this.manager.nodes.length), i = 0; - // we have to set the opacity on IE only after the node is live - dojo.attr(tr, { - "class": "dojoDndAvatarHeader", - style: {opacity: 0.9} - }); - for(; i < k; ++i){ - if(source.creator){ - // create an avatar representation of the node - node = source._normalizedCreator(source.getItem(this.manager.nodes[i].id).data, "avatar").node; - }else{ - // or just clone the node and hope it works - node = this.manager.nodes[i].cloneNode(true); - if(node.tagName.toLowerCase() == "tr"){ - // insert extra table nodes - var table = dojo.create("table"), - tbody = dojo.create("tbody", null, table); - tbody.appendChild(node); - node = table; - } - } - node.id = ""; - tr = dojo.create("tr", null, b); - td = dojo.create("td", null, tr); - td.appendChild(node); - dojo.attr(tr, { - "class": "dojoDndAvatarItem", - style: {opacity: (9 - i) / 10} - }); - } - this.node = a; - }, - destroy: function(){ - // summary: - // destructor for the avatar; called to remove all references so it can be garbage-collected - dojo.destroy(this.node); - this.node = false; - }, - update: function(){ - // summary: - // updates the avatar to reflect the current DnD state - dojo[(this.manager.canDropFlag ? "add" : "remove") + "Class"](this.node, "dojoDndAvatarCanDrop"); - if (this.isA11y){ - var icon = dojo.byId("a11yIcon"); - var text = '+'; // assume canDrop && copy - if (this.manager.canDropFlag && !this.manager.copy) { - text = '< '; // canDrop && move - }else if (!this.manager.canDropFlag && !this.manager.copy) { - text = "o"; //!canDrop && move - }else if(!this.manager.canDropFlag){ - text = 'x'; // !canDrop && copy - } - icon.innerHTML=text; - } - // replace text - dojo.query(("tr.dojoDndAvatarHeader td span" +(this.isA11y ? " span" : "")), this.node).forEach( - function(node){ - node.innerHTML = this._generateText(); - }, this); - }, - _generateText: function(){ - // summary: generates a proper text to reflect copying or moving of items - return this.manager.nodes.length.toString(); - } -}); - -} +//>>built +define("dojo/dnd/Avatar",["../main","./common"],function(_1){_1.declare("dojo.dnd.Avatar",null,{constructor:function(_2){this.manager=_2;this.construct();},construct:function(){this.isA11y=_1.hasClass(_1.body(),"dijit_a11y");var a=_1.create("table",{"class":"dojoDndAvatar",style:{position:"absolute",zIndex:"1999",margin:"0px"}}),_3=this.manager.source,_4,b=_1.create("tbody",null,a),tr=_1.create("tr",null,b),td=_1.create("td",null,tr),_5=this.isA11y?_1.create("span",{id:"a11yIcon",innerHTML:this.manager.copy?"+":"<"},td):null,_6=_1.create("span",{innerHTML:_3.generateText?this._generateText():""},td),k=Math.min(5,this.manager.nodes.length),i=0;_1.attr(tr,{"class":"dojoDndAvatarHeader",style:{opacity:0.9}});for(;i