summaryrefslogtreecommitdiff
path: root/lib/dojo/dnd
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-12-04 16:23:37 +0300
committerAndrew Dolgov <[email protected]>2018-12-04 16:23:37 +0300
commitf097f3383632a93dd1c2b21ed9cf568dc9f3ce38 (patch)
tree19381c741e4acf2fff0ed6b7abd4430170662b98 /lib/dojo/dnd
parented1bd992d79e012afd8b9f4dfcf75542aed67cf3 (diff)
update dojo to 1.14.2
Diffstat (limited to 'lib/dojo/dnd')
-rw-r--r--lib/dojo/dnd/Container.js2
-rw-r--r--lib/dojo/dnd/Moveable.js2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/dojo/dnd/Container.js b/lib/dojo/dnd/Container.js
index 1f55b575a..e05aa598e 100644
--- a/lib/dojo/dnd/Container.js
+++ b/lib/dojo/dnd/Container.js
@@ -5,4 +5,4 @@
*/
//>>built
-define("dojo/dnd/Container",["../_base/array","../_base/declare","../_base/kernel","../_base/lang","../_base/window","../dom","../dom-class","../dom-construct","../Evented","../has","../on","../query","../touch","./common"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,_a,on,_b,_c,_d){var _e=_2("dojo.dnd.Container",_9,{skipForm:false,allowNested:false,constructor:function(_f,_10){this.node=_6.byId(_f);if(!_10){_10={};}this.creator=_10.creator||null;this.skipForm=_10.skipForm;this.parent=_10.dropParent&&_6.byId(_10.dropParent);this.map={};this.current=null;this.containerState="";_7.add(this.node,"dojoDndContainer");if(!(_10&&_10._skipStartup)){this.startup();}this.events=[on(this.node,_c.over,_4.hitch(this,"onMouseOver")),on(this.node,_c.out,_4.hitch(this,"onMouseOut")),on(this.node,"dragstart",_4.hitch(this,"onSelectStart")),on(this.node,"selectstart",_4.hitch(this,"onSelectStart"))];},creator:function(){},getItem:function(key){return this.map[key];},setItem:function(key,_11){this.map[key]=_11;},delItem:function(key){delete this.map[key];},forInItems:function(f,o){o=o||_3.global;var m=this.map,e=_d._empty;for(var i in m){if(i in e){continue;}f.call(o,m[i],i,this);}return o;},clearItems:function(){this.map={};},getAllNodes:function(){return _b((this.allowNested?"":"> ")+".dojoDndItem",this.parent);},sync:function(){var map={};this.getAllNodes().forEach(function(_12){if(_12.id){var _13=this.getItem(_12.id);if(_13){map[_12.id]=_13;return;}}else{_12.id=_d.getUniqueId();}var _14=_12.getAttribute("dndType"),_15=_12.getAttribute("dndData");map[_12.id]={data:_15||_12.innerHTML,type:_14?_14.split(/\s*,\s*/):["text"]};},this);this.map=map;return this;},insertNodes:function(_16,_17,_18){if(!this.parent.firstChild){_18=null;}else{if(_17){if(!_18){_18=this.parent.firstChild;}}else{if(_18){_18=_18.nextSibling;}}}var i,t;if(_18){for(i=0;i<_16.length;++i){t=this._normalizedCreator(_16[i]);this.setItem(t.node.id,{data:t.data,type:t.type});_18.parentNode.insertBefore(t.node,_18);}}else{for(i=0;i<_16.length;++i){t=this._normalizedCreator(_16[i]);this.setItem(t.node.id,{data:t.data,type:t.type});this.parent.appendChild(t.node);}}return this;},destroy:function(){_1.forEach(this.events,function(_19){_19.remove();});this.clearItems();this.node=this.parent=this.current=null;},markupFactory:function(_1a,_1b,_1c){_1a._skipStartup=true;return new _1c(_1b,_1a);},startup:function(){if(!this.parent){this.parent=this.node;if(this.parent.tagName.toLowerCase()=="table"){var c=this.parent.getElementsByTagName("tbody");if(c&&c.length){this.parent=c[0];}}}this.defaultCreator=_d._defaultCreator(this.parent);this.sync();},onMouseOver:function(e){var n=e.relatedTarget;while(n){if(n==this.node){break;}try{n=n.parentNode;}catch(x){n=null;}}if(!n){this._changeState("Container","Over");this.onOverEvent();}n=this._getChildByEvent(e);if(this.current==n){return;}if(this.current){this._removeItemClass(this.current,"Over");}if(n){this._addItemClass(n,"Over");}this.current=n;},onMouseOut:function(e){for(var n=e.relatedTarget;n;){if(n==this.node){return;}try{n=n.parentNode;}catch(x){n=null;}}if(this.current){this._removeItemClass(this.current,"Over");this.current=null;}this._changeState("Container","");this.onOutEvent();},onSelectStart:function(e){if(!this.skipForm||!_d.isFormElement(e)){e.stopPropagation();e.preventDefault();}},onOverEvent:function(){},onOutEvent:function(){},_changeState:function(_1d,_1e){var _1f="dojoDnd"+_1d;var _20=_1d.toLowerCase()+"State";_7.replace(this.node,_1f+_1e,_1f+this[_20]);this[_20]=_1e;},_addItemClass:function(_21,_22){_7.add(_21,"dojoDndItem"+_22);},_removeItemClass:function(_23,_24){_7.remove(_23,"dojoDndItem"+_24);},_getChildByEvent:function(e){var _25=e.target;if(_25){for(var _26=_25.parentNode;_26;_25=_26,_26=_25.parentNode){if((_26==this.parent||this.allowNested)&&_7.contains(_25,"dojoDndItem")){return _25;}}}return null;},_normalizedCreator:function(_27,_28){var t=(this.creator||this.defaultCreator).call(this,_27,_28);if(!_4.isArray(t.type)){t.type=["text"];}if(!t.node.id){t.node.id=_d.getUniqueId();}_7.add(t.node,"dojoDndItem");return t;}});_d._createNode=function(tag){if(!tag){return _d._createSpan;}return function(_29){return _8.create(tag,{innerHTML:_29});};};_d._createTrTd=function(_2a){var tr=_8.create("tr");_8.create("td",{innerHTML:_2a},tr);return tr;};_d._createSpan=function(_2b){return _8.create("span",{innerHTML:_2b});};_d._defaultCreatorNodes={ul:"li",ol:"li",div:"div",p:"div"};_d._defaultCreator=function(_2c){var tag=_2c.tagName.toLowerCase();var c=tag=="tbody"||tag=="thead"?_d._createTrTd:_d._createNode(_d._defaultCreatorNodes[tag]);return function(_2d,_2e){var _2f=_2d&&_4.isObject(_2d),_30,_31,n;if(_2f&&_2d.tagName&&_2d.nodeType&&_2d.getAttribute){_30=_2d.getAttribute("dndData")||_2d.innerHTML;_31=_2d.getAttribute("dndType");_31=_31?_31.split(/\s*,\s*/):["text"];n=_2d;}else{_30=(_2f&&_2d.data)?_2d.data:_2d;_31=(_2f&&_2d.type)?_2d.type:["text"];n=(_2e=="avatar"?_d._createSpan:c)(String(_30));}if(!n.id){n.id=_d.getUniqueId();}return {node:n,data:_30,type:_31};};};return _e;}); \ No newline at end of file
+define("dojo/dnd/Container",["../_base/array","../_base/declare","../_base/kernel","../_base/lang","../_base/window","../dom","../dom-class","../dom-construct","../Evented","../has","../on","../query","../touch","./common"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,_a,on,_b,_c,_d){var _e=_2("dojo.dnd.Container",_9,{skipForm:false,allowNested:false,constructor:function(_f,_10){this.node=_6.byId(_f);if(!_10){_10={};}this.creator=_10.creator||null;this.skipForm=_10.skipForm;this.parent=_10.dropParent&&_6.byId(_10.dropParent);this.map={};this.current=null;this.containerState="";_7.add(this.node,"dojoDndContainer");if(!(_10&&_10._skipStartup)){this.startup();}this.events=[on(this.node,_c.over,_4.hitch(this,"onMouseOver")),on(this.node,_c.out,_4.hitch(this,"onMouseOut")),on(this.node,"dragstart",_4.hitch(this,"onSelectStart")),on(this.node,"selectstart",_4.hitch(this,"onSelectStart"))];},creator:function(){},getItem:function(key){return this.map[key];},setItem:function(key,_11){this.map[key]=_11;},delItem:function(key){delete this.map[key];},forInItems:function(f,o){o=o||_3.global;var m=this.map,e=_d._empty;for(var i in m){if(i in e){continue;}f.call(o,m[i],i,this);}return o;},clearItems:function(){this.map={};},getAllNodes:function(){return _b((this.allowNested?"":"> ")+".dojoDndItem",this.parent);},sync:function(){var map={};this.getAllNodes().forEach(function(_12){if(_12.id){var _13=this.getItem(_12.id);if(_13){map[_12.id]=_13;return;}}else{_12.id=_d.getUniqueId();}var _14=_12.getAttribute("dndType"),_15=_12.getAttribute("dndData");map[_12.id]={data:_15||_12.innerHTML,type:_14?_14.split(/\s*,\s*/):["text"]};},this);this.map=map;return this;},insertNodes:function(_16,_17,_18){if(!this.parent.firstChild){_18=null;}else{if(_17){if(!_18){_18=this.parent.firstChild;}}else{if(_18){_18=_18.nextSibling;}}}var i,t;if(_18){for(i=0;i<_16.length;++i){t=this._normalizedCreator(_16[i]);this.setItem(t.node.id,{data:t.data,type:t.type});_18.parentNode.insertBefore(t.node,_18);}}else{for(i=0;i<_16.length;++i){t=this._normalizedCreator(_16[i]);this.setItem(t.node.id,{data:t.data,type:t.type});this.parent.appendChild(t.node);}}return this;},destroy:function(){_1.forEach(this.events,function(_19){_19.remove();});this.clearItems();this.node=this.parent=this.current=null;},markupFactory:function(_1a,_1b,_1c){_1a._skipStartup=true;return new _1c(_1b,_1a);},startup:function(){if(!this.parent){this.parent=this.node;if(this.parent.tagName.toLowerCase()=="table"){var c=this.parent.getElementsByTagName("tbody");if(c&&c.length){this.parent=c[0];}}}this.defaultCreator=_d._defaultCreator(this.parent);this.sync();},onMouseOver:function(e){var n=e.relatedTarget;while(n){if(n==this.node){break;}try{n=n.parentNode;}catch(x){n=null;}}if(!n){this._changeState("Container","Over");this.onOverEvent();}n=this._getChildByEvent(e);if(this.current==n){return;}if(this.current){this._removeItemClass(this.current,"Over");}if(n){this._addItemClass(n,"Over");}this.current=n;},onMouseOut:function(e){for(var n=e.relatedTarget;n;){if(n==this.node){return;}try{n=n.parentNode;}catch(x){n=null;}}if(this.current){this._removeItemClass(this.current,"Over");this.current=null;}this._changeState("Container","");this.onOutEvent();},onSelectStart:function(e){if(!this.withHandles&&(!this.skipForm||!_d.isFormElement(e))){e.stopPropagation();e.preventDefault();}},onOverEvent:function(){},onOutEvent:function(){},_changeState:function(_1d,_1e){var _1f="dojoDnd"+_1d;var _20=_1d.toLowerCase()+"State";_7.replace(this.node,_1f+_1e,_1f+this[_20]);this[_20]=_1e;},_addItemClass:function(_21,_22){_7.add(_21,"dojoDndItem"+_22);},_removeItemClass:function(_23,_24){_7.remove(_23,"dojoDndItem"+_24);},_getChildByEvent:function(e){var _25=e.target;if(_25){for(var _26=_25.parentNode;_26;_25=_26,_26=_25.parentNode){if((_26==this.parent||this.allowNested)&&_7.contains(_25,"dojoDndItem")){return _25;}}}return null;},_normalizedCreator:function(_27,_28){var t=(this.creator||this.defaultCreator).call(this,_27,_28);if(!_4.isArray(t.type)){t.type=["text"];}if(!t.node.id){t.node.id=_d.getUniqueId();}_7.add(t.node,"dojoDndItem");return t;}});_d._createNode=function(tag){if(!tag){return _d._createSpan;}return function(_29){return _8.create(tag,{innerHTML:_29});};};_d._createTrTd=function(_2a){var tr=_8.create("tr");_8.create("td",{innerHTML:_2a},tr);return tr;};_d._createSpan=function(_2b){return _8.create("span",{innerHTML:_2b});};_d._defaultCreatorNodes={ul:"li",ol:"li",div:"div",p:"div"};_d._defaultCreator=function(_2c){var tag=_2c.tagName.toLowerCase();var c=tag=="tbody"||tag=="thead"?_d._createTrTd:_d._createNode(_d._defaultCreatorNodes[tag]);return function(_2d,_2e){var _2f=_2d&&_4.isObject(_2d),_30,_31,n;if(_2f&&_2d.tagName&&_2d.nodeType&&_2d.getAttribute){_30=_2d.getAttribute("dndData")||_2d.innerHTML;_31=_2d.getAttribute("dndType");_31=_31?_31.split(/\s*,\s*/):["text"];n=_2d;}else{_30=(_2f&&_2d.data)?_2d.data:_2d;_31=(_2f&&_2d.type)?_2d.type:["text"];n=(_2e=="avatar"?_d._createSpan:c)(String(_30));}if(!n.id){n.id=_d.getUniqueId();}return {node:n,data:_30,type:_31};};};return _e;}); \ No newline at end of file
diff --git a/lib/dojo/dnd/Moveable.js b/lib/dojo/dnd/Moveable.js
index a9ef5b73e..9738301dc 100644
--- a/lib/dojo/dnd/Moveable.js
+++ b/lib/dojo/dnd/Moveable.js
@@ -5,4 +5,4 @@
*/
//>>built
-define("dojo/dnd/Moveable",["../_base/array","../_base/declare","../_base/lang","../dom","../dom-class","../Evented","../on","../topic","../touch","./common","./Mover","../_base/window"],function(_1,_2,_3,_4,_5,_6,on,_7,_8,_9,_a,_b){var _c=_2("dojo.dnd.Moveable",[_6],{handle:"",delay:0,skip:false,constructor:function(_d,_e){this.node=_4.byId(_d);if(!_e){_e={};}this.handle=_e.handle?_4.byId(_e.handle):null;if(!this.handle){this.handle=this.node;}this.delay=_e.delay>0?_e.delay:0;this.skip=_e.skip;this.mover=_e.mover?_e.mover:_a;this.events=[on(this.handle,_8.press,_3.hitch(this,"onMouseDown")),on(this.handle,"dragstart",_3.hitch(this,"onSelectStart")),on(this.handle,"selectstart",_3.hitch(this,"onSelectStart"))];},markupFactory:function(_f,_10,_11){return new _11(_10,_f);},destroy:function(){_1.forEach(this.events,function(_12){_12.remove();});this.events=this.node=this.handle=null;},onMouseDown:function(e){if(this.skip&&_9.isFormElement(e)){return;}if(this.delay){this.events.push(on(this.handle,_8.move,_3.hitch(this,"onMouseMove")),on(this.handle.ownerDocument,_8.release,_3.hitch(this,"onMouseUp")));this._lastX=e.pageX;this._lastY=e.pageY;}else{this.onDragDetected(e);}e.stopPropagation();e.preventDefault();},onMouseMove:function(e){if(Math.abs(e.pageX-this._lastX)>this.delay||Math.abs(e.pageY-this._lastY)>this.delay){this.onMouseUp(e);this.onDragDetected(e);}e.stopPropagation();e.preventDefault();},onMouseUp:function(e){for(var i=0;i<2;++i){this.events.pop().remove();}e.stopPropagation();e.preventDefault();},onSelectStart:function(e){if(!this.skip||!_9.isFormElement(e)){e.stopPropagation();e.preventDefault();}},onDragDetected:function(e){new this.mover(this.node,e,this);},onMoveStart:function(_13){_7.publish("/dnd/move/start",_13);_5.add(_b.body(),"dojoMove");_5.add(this.node,"dojoMoveItem");},onMoveStop:function(_14){_7.publish("/dnd/move/stop",_14);_5.remove(_b.body(),"dojoMove");_5.remove(this.node,"dojoMoveItem");},onFirstMove:function(){},onMove:function(_15,_16){this.onMoving(_15,_16);var s=_15.node.style;s.left=_16.l+"px";s.top=_16.t+"px";this.onMoved(_15,_16);},onMoving:function(){},onMoved:function(){}});return _c;}); \ No newline at end of file
+define("dojo/dnd/Moveable",["../_base/array","../_base/declare","../_base/lang","../dom","../dom-class","../Evented","../has","../on","../topic","../touch","./common","./Mover","../_base/window"],function(_1,_2,_3,_4,_5,_6,_7,on,_8,_9,_a,_b,_c){var _d;var _e=function(){};function _f(){if("touchAction" in document.body.style){_d="touchAction";}else{if("msTouchAction" in document.body.style){_d="msTouchAction";}}_e=function _e(_10,_11){_10.style[_d]=_11;};_e(arguments[0],arguments[1]);};if(_7("touch-action")){_e=_f;}var _12=_2("dojo.dnd.Moveable",[_6],{handle:"",delay:0,skip:false,constructor:function(_13,_14){this.node=_4.byId(_13);_e(this.node,"none");if(!_14){_14={};}this.handle=_14.handle?_4.byId(_14.handle):null;if(!this.handle){this.handle=this.node;}this.delay=_14.delay>0?_14.delay:0;this.skip=_14.skip;this.mover=_14.mover?_14.mover:_b;this.events=[on(this.handle,_9.press,_3.hitch(this,"onMouseDown")),on(this.handle,"dragstart",_3.hitch(this,"onSelectStart")),on(this.handle,"selectstart",_3.hitch(this,"onSelectStart"))];},markupFactory:function(_15,_16,_17){return new _17(_16,_15);},destroy:function(){_1.forEach(this.events,function(_18){_18.remove();});_e(this.node,"");this.events=this.node=this.handle=null;},onMouseDown:function(e){if(this.skip&&_a.isFormElement(e)){return;}if(this.delay){this.events.push(on(this.handle,_9.move,_3.hitch(this,"onMouseMove")),on(this.handle.ownerDocument,_9.release,_3.hitch(this,"onMouseUp")));this._lastX=e.pageX;this._lastY=e.pageY;}else{this.onDragDetected(e);}e.stopPropagation();e.preventDefault();},onMouseMove:function(e){if(Math.abs(e.pageX-this._lastX)>this.delay||Math.abs(e.pageY-this._lastY)>this.delay){this.onMouseUp(e);this.onDragDetected(e);}e.stopPropagation();e.preventDefault();},onMouseUp:function(e){for(var i=0;i<2;++i){this.events.pop().remove();}e.stopPropagation();e.preventDefault();},onSelectStart:function(e){if(!this.skip||!_a.isFormElement(e)){e.stopPropagation();e.preventDefault();}},onDragDetected:function(e){new this.mover(this.node,e,this);},onMoveStart:function(_19){_8.publish("/dnd/move/start",_19);_5.add(_c.body(),"dojoMove");_5.add(this.node,"dojoMoveItem");},onMoveStop:function(_1a){_8.publish("/dnd/move/stop",_1a);_5.remove(_c.body(),"dojoMove");_5.remove(this.node,"dojoMoveItem");},onFirstMove:function(){},onMove:function(_1b,_1c){this.onMoving(_1b,_1c);var s=_1b.node.style;s.left=_1c.l+"px";s.top=_1c.t+"px";this.onMoved(_1b,_1c);},onMoving:function(){},onMoved:function(){}});return _12;}); \ No newline at end of file