src/cm/media/js/lib/yui/yui_3.10.3/build/dd-ddm-base/dd-ddm-base-coverage.js
author gibus
Tue, 16 Jul 2013 14:29:46 +0200
changeset 525 89ef5ed3c48b
permissions -rw-r--r--
Upgrades to yui 3.10.3

/*
YUI 3.10.3 (build 2fb5187)
Copyright 2013 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/

if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }
if (!__coverage__['build/dd-ddm-base/dd-ddm-base.js']) {
   __coverage__['build/dd-ddm-base/dd-ddm-base.js'] = {"path":"build/dd-ddm-base/dd-ddm-base.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0},"b":{"1":[0,0],"2":[0,0,0,0,0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0],"18":[0,0],"19":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":42}}},"2":{"name":"(anonymous_2)","line":17,"loc":{"start":{"line":17,"column":18},"end":{"line":17,"column":29}}},"3":{"name":"(anonymous_3)","line":64,"loc":{"start":{"line":64,"column":20},"end":{"line":64,"column":35}}},"4":{"name":"(anonymous_4)","line":73,"loc":{"start":{"line":73,"column":19},"end":{"line":73,"column":30}}},"5":{"name":"(anonymous_5)","line":87,"loc":{"start":{"line":87,"column":22},"end":{"line":87,"column":37}}},"6":{"name":"(anonymous_6)","line":110,"loc":{"start":{"line":110,"column":26},"end":{"line":110,"column":37}}},"7":{"name":"(anonymous_7)","line":130,"loc":{"start":{"line":130,"column":18},"end":{"line":130,"column":30}}},"8":{"name":"(anonymous_8)","line":147,"loc":{"start":{"line":147,"column":20},"end":{"line":147,"column":32}}},"9":{"name":"(anonymous_9)","line":149,"loc":{"start":{"line":149,"column":38},"end":{"line":149,"column":50}}},"10":{"name":"(anonymous_10)","line":161,"loc":{"start":{"line":161,"column":25},"end":{"line":161,"column":36}}},"11":{"name":"(anonymous_11)","line":174,"loc":{"start":{"line":174,"column":16},"end":{"line":174,"column":27}}},"12":{"name":"(anonymous_12)","line":187,"loc":{"start":{"line":187,"column":20},"end":{"line":187,"column":31}}},"13":{"name":"(anonymous_13)","line":193,"loc":{"start":{"line":193,"column":18},"end":{"line":193,"column":29}}},"14":{"name":"(anonymous_14)","line":194,"loc":{"start":{"line":194,"column":19},"end":{"line":194,"column":30}}},"15":{"name":"(anonymous_15)","line":200,"loc":{"start":{"line":200,"column":14},"end":{"line":200,"column":25}}},"16":{"name":"(anonymous_16)","line":215,"loc":{"start":{"line":215,"column":18},"end":{"line":215,"column":29}}},"17":{"name":"(anonymous_17)","line":235,"loc":{"start":{"line":235,"column":18},"end":{"line":235,"column":31}}},"18":{"name":"(anonymous_18)","line":246,"loc":{"start":{"line":246,"column":15},"end":{"line":246,"column":28}}},"19":{"name":"(anonymous_19)","line":261,"loc":{"start":{"line":261,"column":26},"end":{"line":261,"column":43}}},"20":{"name":"(anonymous_20)","line":283,"loc":{"start":{"line":283,"column":17},"end":{"line":283,"column":32}}},"21":{"name":"(anonymous_21)","line":287,"loc":{"start":{"line":287,"column":42},"end":{"line":287,"column":54}}},"22":{"name":"(anonymous_22)","line":302,"loc":{"start":{"line":302,"column":22},"end":{"line":302,"column":39}}},"23":{"name":"(anonymous_23)","line":318,"loc":{"start":{"line":318,"column":17},"end":{"line":318,"column":29}}},"24":{"name":"(anonymous_24)","line":340,"loc":{"start":{"line":340,"column":18},"end":{"line":340,"column":35}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":375,"column":81}},"2":{"start":{"line":17,"column":4},"end":{"line":19,"column":6}},"3":{"start":{"line":18,"column":8},"end":{"line":18,"column":62}},"4":{"start":{"line":21,"column":4},"end":{"line":21,"column":25}},"5":{"start":{"line":23,"column":4},"end":{"line":70,"column":6}},"6":{"start":{"line":65,"column":16},"end":{"line":65,"column":40}},"7":{"start":{"line":66,"column":16},"end":{"line":66,"column":28}},"8":{"start":{"line":72,"column":4},"end":{"line":356,"column":7}},"9":{"start":{"line":88,"column":12},"end":{"line":90,"column":13}},"10":{"start":{"line":89,"column":16},"end":{"line":89,"column":48}},"11":{"start":{"line":91,"column":12},"end":{"line":101,"column":13}},"12":{"start":{"line":94,"column":20},"end":{"line":94,"column":29}},"13":{"start":{"line":97,"column":20},"end":{"line":97,"column":29}},"14":{"start":{"line":100,"column":20},"end":{"line":100,"column":29}},"15":{"start":{"line":102,"column":12},"end":{"line":102,"column":21}},"16":{"start":{"line":131,"column":12},"end":{"line":133,"column":13}},"17":{"start":{"line":132,"column":16},"end":{"line":132,"column":29}},"18":{"start":{"line":135,"column":12},"end":{"line":137,"column":13}},"19":{"start":{"line":136,"column":16},"end":{"line":136,"column":39}},"20":{"start":{"line":138,"column":12},"end":{"line":138,"column":32}},"21":{"start":{"line":139,"column":12},"end":{"line":139,"column":24}},"22":{"start":{"line":148,"column":12},"end":{"line":148,"column":25}},"23":{"start":{"line":149,"column":12},"end":{"line":153,"column":15}},"24":{"start":{"line":150,"column":16},"end":{"line":152,"column":17}},"25":{"start":{"line":151,"column":20},"end":{"line":151,"column":40}},"26":{"start":{"line":154,"column":12},"end":{"line":154,"column":30}},"27":{"start":{"line":162,"column":12},"end":{"line":162,"column":29}},"28":{"start":{"line":163,"column":12},"end":{"line":163,"column":32}},"29":{"start":{"line":165,"column":12},"end":{"line":165,"column":42}},"30":{"start":{"line":166,"column":12},"end":{"line":166,"column":99}},"31":{"start":{"line":167,"column":12},"end":{"line":167,"column":55}},"32":{"start":{"line":175,"column":12},"end":{"line":175,"column":35}},"33":{"start":{"line":176,"column":12},"end":{"line":176,"column":30}},"34":{"start":{"line":201,"column":12},"end":{"line":207,"column":13}},"35":{"start":{"line":202,"column":16},"end":{"line":202,"column":39}},"36":{"start":{"line":203,"column":16},"end":{"line":203,"column":32}},"37":{"start":{"line":204,"column":16},"end":{"line":204,"column":37}},"38":{"start":{"line":205,"column":16},"end":{"line":205,"column":58}},"39":{"start":{"line":206,"column":16},"end":{"line":206,"column":39}},"40":{"start":{"line":216,"column":12},"end":{"line":218,"column":13}},"41":{"start":{"line":217,"column":16},"end":{"line":217,"column":28}},"42":{"start":{"line":219,"column":12},"end":{"line":219,"column":24}},"43":{"start":{"line":236,"column":12},"end":{"line":238,"column":13}},"44":{"start":{"line":237,"column":16},"end":{"line":237,"column":31}},"45":{"start":{"line":247,"column":12},"end":{"line":250,"column":13}},"46":{"start":{"line":248,"column":16},"end":{"line":248,"column":64}},"47":{"start":{"line":249,"column":16},"end":{"line":249,"column":33}},"48":{"start":{"line":262,"column":12},"end":{"line":262,"column":38}},"49":{"start":{"line":264,"column":12},"end":{"line":268,"column":13}},"50":{"start":{"line":265,"column":24},"end":{"line":265,"column":50}},"51":{"start":{"line":265,"column":51},"end":{"line":265,"column":57}},"52":{"start":{"line":266,"column":24},"end":{"line":266,"column":36}},"53":{"start":{"line":266,"column":37},"end":{"line":266,"column":49}},"54":{"start":{"line":266,"column":50},"end":{"line":266,"column":56}},"55":{"start":{"line":267,"column":24},"end":{"line":267,"column":36}},"56":{"start":{"line":267,"column":37},"end":{"line":267,"column":43}},"57":{"start":{"line":270,"column":12},"end":{"line":275,"column":14}},"58":{"start":{"line":284,"column":12},"end":{"line":285,"column":32}},"59":{"start":{"line":286,"column":12},"end":{"line":292,"column":13}},"60":{"start":{"line":287,"column":16},"end":{"line":291,"column":19}},"61":{"start":{"line":288,"column":20},"end":{"line":290,"column":21}},"62":{"start":{"line":289,"column":24},"end":{"line":289,"column":33}},"63":{"start":{"line":293,"column":12},"end":{"line":293,"column":24}},"64":{"start":{"line":303,"column":12},"end":{"line":303,"column":38}},"65":{"start":{"line":304,"column":12},"end":{"line":304,"column":38}},"66":{"start":{"line":305,"column":12},"end":{"line":306,"column":33}},"67":{"start":{"line":308,"column":12},"end":{"line":308,"column":26}},"68":{"start":{"line":309,"column":12},"end":{"line":309,"column":26}},"69":{"start":{"line":310,"column":12},"end":{"line":310,"column":22}},"70":{"start":{"line":319,"column":12},"end":{"line":321,"column":13}},"71":{"start":{"line":320,"column":16},"end":{"line":320,"column":25}},"72":{"start":{"line":322,"column":12},"end":{"line":330,"column":13}},"73":{"start":{"line":323,"column":16},"end":{"line":327,"column":17}},"74":{"start":{"line":324,"column":20},"end":{"line":324,"column":45}},"75":{"start":{"line":326,"column":20},"end":{"line":326,"column":38}},"76":{"start":{"line":329,"column":16},"end":{"line":329,"column":29}},"77":{"start":{"line":331,"column":12},"end":{"line":331,"column":21}},"78":{"start":{"line":341,"column":12},"end":{"line":341,"column":38}},"79":{"start":{"line":342,"column":12},"end":{"line":342,"column":38}},"80":{"start":{"line":343,"column":12},"end":{"line":344,"column":42}},"81":{"start":{"line":346,"column":12},"end":{"line":353,"column":13}},"82":{"start":{"line":347,"column":16},"end":{"line":347,"column":39}},"83":{"start":{"line":348,"column":19},"end":{"line":353,"column":13}},"84":{"start":{"line":349,"column":16},"end":{"line":349,"column":39}},"85":{"start":{"line":351,"column":16},"end":{"line":351,"column":58}},"86":{"start":{"line":352,"column":16},"end":{"line":352,"column":38}},"87":{"start":{"line":354,"column":12},"end":{"line":354,"column":22}},"88":{"start":{"line":358,"column":4},"end":{"line":358,"column":22}},"89":{"start":{"line":359,"column":4},"end":{"line":359,"column":29}}},"branchMap":{"1":{"line":88,"type":"if","locations":[{"start":{"line":88,"column":12},"end":{"line":88,"column":12}},{"start":{"line":88,"column":12},"end":{"line":88,"column":12}}]},"2":{"line":91,"type":"switch","locations":[{"start":{"line":92,"column":16},"end":{"line":92,"column":23}},{"start":{"line":93,"column":16},"end":{"line":94,"column":29}},{"start":{"line":95,"column":16},"end":{"line":95,"column":23}},{"start":{"line":96,"column":16},"end":{"line":97,"column":29}},{"start":{"line":98,"column":16},"end":{"line":98,"column":23}},{"start":{"line":99,"column":16},"end":{"line":100,"column":29}}]},"3":{"line":131,"type":"if","locations":[{"start":{"line":131,"column":12},"end":{"line":131,"column":12}},{"start":{"line":131,"column":12},"end":{"line":131,"column":12}}]},"4":{"line":135,"type":"if","locations":[{"start":{"line":135,"column":12},"end":{"line":135,"column":12}},{"start":{"line":135,"column":12},"end":{"line":135,"column":12}}]},"5":{"line":150,"type":"if","locations":[{"start":{"line":150,"column":16},"end":{"line":150,"column":16}},{"start":{"line":150,"column":16},"end":{"line":150,"column":16}}]},"6":{"line":201,"type":"if","locations":[{"start":{"line":201,"column":12},"end":{"line":201,"column":12}},{"start":{"line":201,"column":12},"end":{"line":201,"column":12}}]},"7":{"line":216,"type":"if","locations":[{"start":{"line":216,"column":12},"end":{"line":216,"column":12}},{"start":{"line":216,"column":12},"end":{"line":216,"column":12}}]},"8":{"line":236,"type":"if","locations":[{"start":{"line":236,"column":12},"end":{"line":236,"column":12}},{"start":{"line":236,"column":12},"end":{"line":236,"column":12}}]},"9":{"line":247,"type":"if","locations":[{"start":{"line":247,"column":12},"end":{"line":247,"column":12}},{"start":{"line":247,"column":12},"end":{"line":247,"column":12}}]},"10":{"line":264,"type":"switch","locations":[{"start":{"line":265,"column":16},"end":{"line":265,"column":57}},{"start":{"line":266,"column":16},"end":{"line":266,"column":56}},{"start":{"line":267,"column":16},"end":{"line":267,"column":43}}]},"11":{"line":286,"type":"if","locations":[{"start":{"line":286,"column":12},"end":{"line":286,"column":12}},{"start":{"line":286,"column":12},"end":{"line":286,"column":12}}]},"12":{"line":288,"type":"if","locations":[{"start":{"line":288,"column":20},"end":{"line":288,"column":20}},{"start":{"line":288,"column":20},"end":{"line":288,"column":20}}]},"13":{"line":319,"type":"if","locations":[{"start":{"line":319,"column":12},"end":{"line":319,"column":12}},{"start":{"line":319,"column":12},"end":{"line":319,"column":12}}]},"14":{"line":322,"type":"if","locations":[{"start":{"line":322,"column":12},"end":{"line":322,"column":12}},{"start":{"line":322,"column":12},"end":{"line":322,"column":12}}]},"15":{"line":322,"type":"binary-expr","locations":[{"start":{"line":322,"column":16},"end":{"line":322,"column":17}},{"start":{"line":322,"column":21},"end":{"line":322,"column":26}}]},"16":{"line":323,"type":"if","locations":[{"start":{"line":323,"column":16},"end":{"line":323,"column":16}},{"start":{"line":323,"column":16},"end":{"line":323,"column":16}}]},"17":{"line":323,"type":"binary-expr","locations":[{"start":{"line":323,"column":20},"end":{"line":323,"column":28}},{"start":{"line":323,"column":33},"end":{"line":323,"column":54}}]},"18":{"line":346,"type":"if","locations":[{"start":{"line":346,"column":12},"end":{"line":346,"column":12}},{"start":{"line":346,"column":12},"end":{"line":346,"column":12}}]},"19":{"line":348,"type":"if","locations":[{"start":{"line":348,"column":19},"end":{"line":348,"column":19}},{"start":{"line":348,"column":19},"end":{"line":348,"column":19}}]}},"code":["(function () { YUI.add('dd-ddm-base', function (Y, NAME) {","","","    /**","     * Provides the base Drag Drop Manger required for making a Node draggable.","     * @module dd","     * @submodule dd-ddm-base","     */","     /**","     * Provides the base Drag Drop Manger required for making a Node draggable.","     * @class DDM","     * @extends Base","     * @constructor","     * @namespace DD","     */","","    var DDMBase = function() {","        DDMBase.superclass.constructor.apply(this, arguments);","    };","","    DDMBase.NAME = 'ddm';","","    DDMBase.ATTRS = {","        /**","        * The cursor to apply when dragging, if shimmed the shim will get the cursor.","        * @attribute dragCursor","        * @type String","        */","        dragCursor: {","            value: 'move'","        },","        /**","        * The number of pixels to move to start a drag operation, default is 3.","        * @attribute clickPixelThresh","        * @type Number","        */","        clickPixelThresh: {","            value: 3","        },","        /**","        * The number of milliseconds a mousedown has to pass to start a drag operation, default is 1000.","        * @attribute clickTimeThresh","        * @type Number","        */","        clickTimeThresh: {","            value: 1000","        },","        /**","        * The number of milliseconds to throttle the mousemove event. Default: 150","        * @attribute throttleTime","        * @type Number","        */","        throttleTime: {","            //value: 150","            value: -1","        },","        /**","        * This attribute only works if the dd-drop module is active. It will set the dragMode (point, intersect, strict) of all future Drag instances.","        * @attribute dragMode","        * @type String","        */","        dragMode: {","            value: 'point',","            setter: function(mode) {","                this._setDragMode(mode);","                return mode;","            }","        }","","    };","","    Y.extend(DDMBase, Y.Base, {","        _createPG: function() {},","        /**","        * flag set when we activate our first drag, so DDM can start listening for events.","        * @property _active","        * @type {Boolean}","        */","        _active: null,","        /**","        * Handler for dragMode attribute setter.","        * @private","        * @method _setDragMode","        * @param String/Number The Number value or the String for the DragMode to default all future drag instances to.","        * @return Number The Mode to be set","        */","        _setDragMode: function(mode) {","            if (mode === null) {","                mode = Y.DD.DDM.get('dragMode');","            }","            switch (mode) {","                case 1:","                case 'intersect':","                    return 1;","                case 2:","                case 'strict':","                    return 2;","                case 0:","                case 'point':","                    return 0;","            }","            return 0;","        },","        /**","        * The PREFIX to attach to all DD CSS class names","        * @property CSS_PREFIX","        * @type {String}","        */","        CSS_PREFIX: Y.ClassNameManager.getClassName('dd'),","        _activateTargets: function() {},","        /**","        * Holder for all registered drag elements.","        * @private","        * @property _drags","        * @type {Array}","        */","        _drags: [],","        /**","        * A reference to the currently active draggable object.","        * @property activeDrag","        * @type {Drag}","        */","        activeDrag: false,","        /**","        * Adds a reference to the drag object to the DDM._drags array, called in the constructor of Drag.","        * @private","        * @method _regDrag","        * @param {Drag} d The Drag object","        */","        _regDrag: function(d) {","            if (this.getDrag(d.get('node'))) {","                return false;","            }","","            if (!this._active) {","                this._setupListeners();","            }","            this._drags.push(d);","            return true;","        },","        /**","        * Remove this drag object from the DDM._drags array.","        * @private","        * @method _unregDrag","        * @param {Drag} d The drag object.","        */","        _unregDrag: function(d) {","            var tmp = [];","            Y.Array.each(this._drags, function(n) {","                if (n !== d) {","                    tmp[tmp.length] = n;","                }","            });","            this._drags = tmp;","        },","        /**","        * Add the document listeners.","        * @private","        * @method _setupListeners","        */","        _setupListeners: function() {","            this._createPG();","            this._active = true;","","            var doc = Y.one(Y.config.doc);","            doc.on('mousemove', Y.throttle(Y.bind(this._docMove, this), this.get('throttleTime')));","            doc.on('mouseup', Y.bind(this._end, this));","        },","        /**","        * Internal method used by Drag to signal the start of a drag operation","        * @private","        * @method _start","        */","        _start: function() {","            this.fire('ddm:start');","            this._startDrag();","        },","        /**","        * Factory method to be overwritten by other DDM's","        * @private","        * @method _startDrag","        * @param {Number} x The x position of the drag element","        * @param {Number} y The y position of the drag element","        * @param {Number} w The width of the drag element","        * @param {Number} h The height of the drag element","        */","        _startDrag: function() {},","        /**","        * Factory method to be overwritten by other DDM's","        * @private","        * @method _endDrag","        */","        _endDrag: function() {},","        _dropMove: function() {},","        /**","        * Internal method used by Drag to signal the end of a drag operation","        * @private","        * @method _end","        */","        _end: function() {","            if (this.activeDrag) {","                this._shimming = false;","                this._endDrag();","                this.fire('ddm:end');","                this.activeDrag.end.call(this.activeDrag);","                this.activeDrag = null;","            }","        },","        /**","        * Method will forcefully stop a drag operation. For example calling this from inside an ESC keypress handler will stop this drag.","        * @method stopDrag","        * @return {Self}","        * @chainable","        */","        stopDrag: function() {","            if (this.activeDrag) {","                this._end();","            }","            return this;","        },","        /**","        * Set to true when drag starts and useShim is true. Used in pairing with _docMove","        * @private","        * @property _shimming","        * @see _docMove","        * @type {Boolean}","        */","        _shimming: false,","        /**","        * Internal listener for the mousemove on Document. Checks if the shim is in place to only call _move once per mouse move","        * @private","        * @method _docMove","        * @param {Event.Facade} ev The Dom mousemove Event","        */","        _docMove: function(ev) {","            if (!this._shimming) {","                this._move(ev);","            }","        },","        /**","        * Internal listener for the mousemove DOM event to pass to the Drag's move method.","        * @private","        * @method _move","        * @param {Event.Facade} ev The Dom mousemove Event","        */","        _move: function(ev) {","            if (this.activeDrag) {","                this.activeDrag._move.call(this.activeDrag, ev);","                this._dropMove();","            }","        },","        /**","        * //TODO Private, rename??...","        * Helper method to use to set the gutter from the attribute setter.","        * CSS style string for gutter: '5 0' (sets top and bottom to 5px, left and right to 0px), '1 2 3 4' (top 1px, right 2px, bottom 3px, left 4px)","        * @private","        * @method cssSizestoObject","        * @param {String} gutter CSS style string for gutter","        * @return {Object} The gutter Object Literal.","        */","        cssSizestoObject: function(gutter) {","            var x = gutter.split(' ');","","            switch (x.length) {","                case 1: x[1] = x[2] = x[3] = x[0]; break;","                case 2: x[2] = x[0]; x[3] = x[1]; break;","                case 3: x[3] = x[1]; break;","            }","","            return {","                top   : parseInt(x[0],10),","                right : parseInt(x[1],10),","                bottom: parseInt(x[2],10),","                left  : parseInt(x[3],10)","            };","        },","        /**","        * Get a valid Drag instance back from a Node or a selector string, false otherwise","        * @method getDrag","        * @param {String/Object} node The Node instance or Selector string to check for a valid Drag Object","        * @return {Object}","        */","        getDrag: function(node) {","            var drag = false,","                n = Y.one(node);","            if (n instanceof Y.Node) {","                Y.Array.each(this._drags, function(v) {","                    if (n.compareTo(v.get('node'))) {","                        drag = v;","                    }","                });","            }","            return drag;","        },","        /**","        * Swap the position of 2 nodes based on their CSS positioning.","        * @method swapPosition","        * @param {Node} n1 The first node to swap","        * @param {Node} n2 The first node to swap","        * @return {Node}","        */","        swapPosition: function(n1, n2) {","            n1 = Y.DD.DDM.getNode(n1);","            n2 = Y.DD.DDM.getNode(n2);","            var xy1 = n1.getXY(),","                xy2 = n2.getXY();","","            n1.setXY(xy2);","            n2.setXY(xy1);","            return n1;","        },","        /**","        * Return a node instance from the given node, selector string or Y.Base extended object.","        * @method getNode","        * @param {Node/Object/String} n The node to resolve.","        * @return {Node}","        */","        getNode: function(n) {","            if (n instanceof Y.Node) {","                return n;","            }","            if (n && n.get) {","                if (Y.Widget && (n instanceof Y.Widget)) {","                    n = n.get('boundingBox');","                } else {","                    n = n.get('node');","                }","            } else {","                n = Y.one(n);","            }","            return n;","        },","        /**","        * Swap the position of 2 nodes based on their DOM location.","        * @method swapNode","        * @param {Node} n1 The first node to swap","        * @param {Node} n2 The first node to swap","        * @return {Node}","        */","        swapNode: function(n1, n2) {","            n1 = Y.DD.DDM.getNode(n1);","            n2 = Y.DD.DDM.getNode(n2);","            var p = n2.get('parentNode'),","                s = n2.get('nextSibling');","","            if (s === n1) {","                p.insertBefore(n1, n2);","            } else if (n2 === n1.get('nextSibling')) {","                p.insertBefore(n2, n1);","            } else {","                n1.get('parentNode').replaceChild(n2, n1);","                p.insertBefore(n1, s);","            }","            return n1;","        }","    });","","    Y.namespace('DD');","    Y.DD.DDM = new DDMBase();","","    /**","    * Fires from the DDM before all drag events fire.","    * @event ddm:start","    * @type {CustomEvent}","    */","    /**","    * Fires from the DDM after the DDM finishes, before the drag end events.","    * @event ddm:end","    * @type {CustomEvent}","    */","","","","","}, '3.10.3', {\"requires\": [\"node\", \"base\", \"yui-throttle\", \"classnamemanager\"]});","","}());"]};
}
var __cov_nNXhio9FCl2e2x8wKKTbLw = __coverage__['build/dd-ddm-base/dd-ddm-base.js'];
__cov_nNXhio9FCl2e2x8wKKTbLw.s['1']++;YUI.add('dd-ddm-base',function(Y,NAME){__cov_nNXhio9FCl2e2x8wKKTbLw.f['1']++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['2']++;var DDMBase=function(){__cov_nNXhio9FCl2e2x8wKKTbLw.f['2']++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['3']++;DDMBase.superclass.constructor.apply(this,arguments);};__cov_nNXhio9FCl2e2x8wKKTbLw.s['4']++;DDMBase.NAME='ddm';__cov_nNXhio9FCl2e2x8wKKTbLw.s['5']++;DDMBase.ATTRS={dragCursor:{value:'move'},clickPixelThresh:{value:3},clickTimeThresh:{value:1000},throttleTime:{value:-1},dragMode:{value:'point',setter:function(mode){__cov_nNXhio9FCl2e2x8wKKTbLw.f['3']++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['6']++;this._setDragMode(mode);__cov_nNXhio9FCl2e2x8wKKTbLw.s['7']++;return mode;}}};__cov_nNXhio9FCl2e2x8wKKTbLw.s['8']++;Y.extend(DDMBase,Y.Base,{_createPG:function(){__cov_nNXhio9FCl2e2x8wKKTbLw.f['4']++;},_active:null,_setDragMode:function(mode){__cov_nNXhio9FCl2e2x8wKKTbLw.f['5']++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['9']++;if(mode===null){__cov_nNXhio9FCl2e2x8wKKTbLw.b['1'][0]++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['10']++;mode=Y.DD.DDM.get('dragMode');}else{__cov_nNXhio9FCl2e2x8wKKTbLw.b['1'][1]++;}__cov_nNXhio9FCl2e2x8wKKTbLw.s['11']++;switch(mode){case 1:__cov_nNXhio9FCl2e2x8wKKTbLw.b['2'][0]++;case'intersect':__cov_nNXhio9FCl2e2x8wKKTbLw.b['2'][1]++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['12']++;return 1;case 2:__cov_nNXhio9FCl2e2x8wKKTbLw.b['2'][2]++;case'strict':__cov_nNXhio9FCl2e2x8wKKTbLw.b['2'][3]++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['13']++;return 2;case 0:__cov_nNXhio9FCl2e2x8wKKTbLw.b['2'][4]++;case'point':__cov_nNXhio9FCl2e2x8wKKTbLw.b['2'][5]++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['14']++;return 0;}__cov_nNXhio9FCl2e2x8wKKTbLw.s['15']++;return 0;},CSS_PREFIX:Y.ClassNameManager.getClassName('dd'),_activateTargets:function(){__cov_nNXhio9FCl2e2x8wKKTbLw.f['6']++;},_drags:[],activeDrag:false,_regDrag:function(d){__cov_nNXhio9FCl2e2x8wKKTbLw.f['7']++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['16']++;if(this.getDrag(d.get('node'))){__cov_nNXhio9FCl2e2x8wKKTbLw.b['3'][0]++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['17']++;return false;}else{__cov_nNXhio9FCl2e2x8wKKTbLw.b['3'][1]++;}__cov_nNXhio9FCl2e2x8wKKTbLw.s['18']++;if(!this._active){__cov_nNXhio9FCl2e2x8wKKTbLw.b['4'][0]++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['19']++;this._setupListeners();}else{__cov_nNXhio9FCl2e2x8wKKTbLw.b['4'][1]++;}__cov_nNXhio9FCl2e2x8wKKTbLw.s['20']++;this._drags.push(d);__cov_nNXhio9FCl2e2x8wKKTbLw.s['21']++;return true;},_unregDrag:function(d){__cov_nNXhio9FCl2e2x8wKKTbLw.f['8']++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['22']++;var tmp=[];__cov_nNXhio9FCl2e2x8wKKTbLw.s['23']++;Y.Array.each(this._drags,function(n){__cov_nNXhio9FCl2e2x8wKKTbLw.f['9']++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['24']++;if(n!==d){__cov_nNXhio9FCl2e2x8wKKTbLw.b['5'][0]++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['25']++;tmp[tmp.length]=n;}else{__cov_nNXhio9FCl2e2x8wKKTbLw.b['5'][1]++;}});__cov_nNXhio9FCl2e2x8wKKTbLw.s['26']++;this._drags=tmp;},_setupListeners:function(){__cov_nNXhio9FCl2e2x8wKKTbLw.f['10']++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['27']++;this._createPG();__cov_nNXhio9FCl2e2x8wKKTbLw.s['28']++;this._active=true;__cov_nNXhio9FCl2e2x8wKKTbLw.s['29']++;var doc=Y.one(Y.config.doc);__cov_nNXhio9FCl2e2x8wKKTbLw.s['30']++;doc.on('mousemove',Y.throttle(Y.bind(this._docMove,this),this.get('throttleTime')));__cov_nNXhio9FCl2e2x8wKKTbLw.s['31']++;doc.on('mouseup',Y.bind(this._end,this));},_start:function(){__cov_nNXhio9FCl2e2x8wKKTbLw.f['11']++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['32']++;this.fire('ddm:start');__cov_nNXhio9FCl2e2x8wKKTbLw.s['33']++;this._startDrag();},_startDrag:function(){__cov_nNXhio9FCl2e2x8wKKTbLw.f['12']++;},_endDrag:function(){__cov_nNXhio9FCl2e2x8wKKTbLw.f['13']++;},_dropMove:function(){__cov_nNXhio9FCl2e2x8wKKTbLw.f['14']++;},_end:function(){__cov_nNXhio9FCl2e2x8wKKTbLw.f['15']++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['34']++;if(this.activeDrag){__cov_nNXhio9FCl2e2x8wKKTbLw.b['6'][0]++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['35']++;this._shimming=false;__cov_nNXhio9FCl2e2x8wKKTbLw.s['36']++;this._endDrag();__cov_nNXhio9FCl2e2x8wKKTbLw.s['37']++;this.fire('ddm:end');__cov_nNXhio9FCl2e2x8wKKTbLw.s['38']++;this.activeDrag.end.call(this.activeDrag);__cov_nNXhio9FCl2e2x8wKKTbLw.s['39']++;this.activeDrag=null;}else{__cov_nNXhio9FCl2e2x8wKKTbLw.b['6'][1]++;}},stopDrag:function(){__cov_nNXhio9FCl2e2x8wKKTbLw.f['16']++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['40']++;if(this.activeDrag){__cov_nNXhio9FCl2e2x8wKKTbLw.b['7'][0]++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['41']++;this._end();}else{__cov_nNXhio9FCl2e2x8wKKTbLw.b['7'][1]++;}__cov_nNXhio9FCl2e2x8wKKTbLw.s['42']++;return this;},_shimming:false,_docMove:function(ev){__cov_nNXhio9FCl2e2x8wKKTbLw.f['17']++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['43']++;if(!this._shimming){__cov_nNXhio9FCl2e2x8wKKTbLw.b['8'][0]++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['44']++;this._move(ev);}else{__cov_nNXhio9FCl2e2x8wKKTbLw.b['8'][1]++;}},_move:function(ev){__cov_nNXhio9FCl2e2x8wKKTbLw.f['18']++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['45']++;if(this.activeDrag){__cov_nNXhio9FCl2e2x8wKKTbLw.b['9'][0]++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['46']++;this.activeDrag._move.call(this.activeDrag,ev);__cov_nNXhio9FCl2e2x8wKKTbLw.s['47']++;this._dropMove();}else{__cov_nNXhio9FCl2e2x8wKKTbLw.b['9'][1]++;}},cssSizestoObject:function(gutter){__cov_nNXhio9FCl2e2x8wKKTbLw.f['19']++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['48']++;var x=gutter.split(' ');__cov_nNXhio9FCl2e2x8wKKTbLw.s['49']++;switch(x.length){case 1:__cov_nNXhio9FCl2e2x8wKKTbLw.b['10'][0]++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['50']++;x[1]=x[2]=x[3]=x[0];__cov_nNXhio9FCl2e2x8wKKTbLw.s['51']++;break;case 2:__cov_nNXhio9FCl2e2x8wKKTbLw.b['10'][1]++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['52']++;x[2]=x[0];__cov_nNXhio9FCl2e2x8wKKTbLw.s['53']++;x[3]=x[1];__cov_nNXhio9FCl2e2x8wKKTbLw.s['54']++;break;case 3:__cov_nNXhio9FCl2e2x8wKKTbLw.b['10'][2]++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['55']++;x[3]=x[1];__cov_nNXhio9FCl2e2x8wKKTbLw.s['56']++;break;}__cov_nNXhio9FCl2e2x8wKKTbLw.s['57']++;return{top:parseInt(x[0],10),right:parseInt(x[1],10),bottom:parseInt(x[2],10),left:parseInt(x[3],10)};},getDrag:function(node){__cov_nNXhio9FCl2e2x8wKKTbLw.f['20']++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['58']++;var drag=false,n=Y.one(node);__cov_nNXhio9FCl2e2x8wKKTbLw.s['59']++;if(n instanceof Y.Node){__cov_nNXhio9FCl2e2x8wKKTbLw.b['11'][0]++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['60']++;Y.Array.each(this._drags,function(v){__cov_nNXhio9FCl2e2x8wKKTbLw.f['21']++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['61']++;if(n.compareTo(v.get('node'))){__cov_nNXhio9FCl2e2x8wKKTbLw.b['12'][0]++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['62']++;drag=v;}else{__cov_nNXhio9FCl2e2x8wKKTbLw.b['12'][1]++;}});}else{__cov_nNXhio9FCl2e2x8wKKTbLw.b['11'][1]++;}__cov_nNXhio9FCl2e2x8wKKTbLw.s['63']++;return drag;},swapPosition:function(n1,n2){__cov_nNXhio9FCl2e2x8wKKTbLw.f['22']++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['64']++;n1=Y.DD.DDM.getNode(n1);__cov_nNXhio9FCl2e2x8wKKTbLw.s['65']++;n2=Y.DD.DDM.getNode(n2);__cov_nNXhio9FCl2e2x8wKKTbLw.s['66']++;var xy1=n1.getXY(),xy2=n2.getXY();__cov_nNXhio9FCl2e2x8wKKTbLw.s['67']++;n1.setXY(xy2);__cov_nNXhio9FCl2e2x8wKKTbLw.s['68']++;n2.setXY(xy1);__cov_nNXhio9FCl2e2x8wKKTbLw.s['69']++;return n1;},getNode:function(n){__cov_nNXhio9FCl2e2x8wKKTbLw.f['23']++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['70']++;if(n instanceof Y.Node){__cov_nNXhio9FCl2e2x8wKKTbLw.b['13'][0]++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['71']++;return n;}else{__cov_nNXhio9FCl2e2x8wKKTbLw.b['13'][1]++;}__cov_nNXhio9FCl2e2x8wKKTbLw.s['72']++;if((__cov_nNXhio9FCl2e2x8wKKTbLw.b['15'][0]++,n)&&(__cov_nNXhio9FCl2e2x8wKKTbLw.b['15'][1]++,n.get)){__cov_nNXhio9FCl2e2x8wKKTbLw.b['14'][0]++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['73']++;if((__cov_nNXhio9FCl2e2x8wKKTbLw.b['17'][0]++,Y.Widget)&&(__cov_nNXhio9FCl2e2x8wKKTbLw.b['17'][1]++,n instanceof Y.Widget)){__cov_nNXhio9FCl2e2x8wKKTbLw.b['16'][0]++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['74']++;n=n.get('boundingBox');}else{__cov_nNXhio9FCl2e2x8wKKTbLw.b['16'][1]++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['75']++;n=n.get('node');}}else{__cov_nNXhio9FCl2e2x8wKKTbLw.b['14'][1]++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['76']++;n=Y.one(n);}__cov_nNXhio9FCl2e2x8wKKTbLw.s['77']++;return n;},swapNode:function(n1,n2){__cov_nNXhio9FCl2e2x8wKKTbLw.f['24']++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['78']++;n1=Y.DD.DDM.getNode(n1);__cov_nNXhio9FCl2e2x8wKKTbLw.s['79']++;n2=Y.DD.DDM.getNode(n2);__cov_nNXhio9FCl2e2x8wKKTbLw.s['80']++;var p=n2.get('parentNode'),s=n2.get('nextSibling');__cov_nNXhio9FCl2e2x8wKKTbLw.s['81']++;if(s===n1){__cov_nNXhio9FCl2e2x8wKKTbLw.b['18'][0]++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['82']++;p.insertBefore(n1,n2);}else{__cov_nNXhio9FCl2e2x8wKKTbLw.b['18'][1]++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['83']++;if(n2===n1.get('nextSibling')){__cov_nNXhio9FCl2e2x8wKKTbLw.b['19'][0]++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['84']++;p.insertBefore(n2,n1);}else{__cov_nNXhio9FCl2e2x8wKKTbLw.b['19'][1]++;__cov_nNXhio9FCl2e2x8wKKTbLw.s['85']++;n1.get('parentNode').replaceChild(n2,n1);__cov_nNXhio9FCl2e2x8wKKTbLw.s['86']++;p.insertBefore(n1,s);}}__cov_nNXhio9FCl2e2x8wKKTbLw.s['87']++;return n1;}});__cov_nNXhio9FCl2e2x8wKKTbLw.s['88']++;Y.namespace('DD');__cov_nNXhio9FCl2e2x8wKKTbLw.s['89']++;Y.DD.DDM=new DDMBase();},'3.10.3',{'requires':['node','base','yui-throttle','classnamemanager']});