src/cm/media/js/lib/yui/yui_3.10.3/build/dd-plugin/dd-plugin-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-plugin/dd-plugin.js']) {
   __coverage__['build/dd-plugin/dd-plugin.js'] = {"path":"build/dd-plugin/dd-plugin.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},"b":{"1":[0,0],"2":[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],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":40}}},"2":{"name":"(anonymous_2)","line":17,"loc":{"start":{"line":17,"column":19},"end":{"line":17,"column":36}}},"3":{"name":"(anonymous_3)","line":74,"loc":{"start":{"line":74,"column":37},"end":{"line":74,"column":54}}},"4":{"name":"(anonymous_4)","line":88,"loc":{"start":{"line":88,"column":30},"end":{"line":88,"column":41}}},"5":{"name":"(anonymous_5)","line":109,"loc":{"start":{"line":109,"column":40},"end":{"line":109,"column":51}}},"6":{"name":"(anonymous_6)","line":110,"loc":{"start":{"line":110,"column":54},"end":{"line":110,"column":71}}},"7":{"name":"(anonymous_7)","line":120,"loc":{"start":{"line":120,"column":40},"end":{"line":120,"column":51}}},"8":{"name":"(anonymous_8)","line":137,"loc":{"start":{"line":137,"column":29},"end":{"line":137,"column":46}}},"9":{"name":"(anonymous_9)","line":156,"loc":{"start":{"line":156,"column":34},"end":{"line":156,"column":46}}},"10":{"name":"(anonymous_10)","line":188,"loc":{"start":{"line":188,"column":37},"end":{"line":188,"column":49}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":200,"column":82}},"2":{"start":{"line":17,"column":8},"end":{"line":30,"column":33}},"3":{"start":{"line":18,"column":16},"end":{"line":24,"column":17}},"4":{"start":{"line":19,"column":24},"end":{"line":19,"column":69}},"5":{"start":{"line":20,"column":24},"end":{"line":20,"column":52}},"6":{"start":{"line":22,"column":24},"end":{"line":22,"column":50}},"7":{"start":{"line":23,"column":24},"end":{"line":23,"column":46}},"8":{"start":{"line":25,"column":16},"end":{"line":25,"column":63}},"9":{"start":{"line":37,"column":8},"end":{"line":37,"column":32}},"10":{"start":{"line":44,"column":8},"end":{"line":44,"column":23}},"11":{"start":{"line":46,"column":8},"end":{"line":191,"column":11}},"12":{"start":{"line":75,"column":24},"end":{"line":75,"column":38}},"13":{"start":{"line":76,"column":24},"end":{"line":78,"column":25}},"14":{"start":{"line":77,"column":32},"end":{"line":77,"column":104}},"15":{"start":{"line":79,"column":24},"end":{"line":79,"column":33}},"16":{"start":{"line":89,"column":20},"end":{"line":102,"column":21}},"17":{"start":{"line":91,"column":24},"end":{"line":101,"column":25}},"18":{"start":{"line":93,"column":28},"end":{"line":96,"column":29}},"19":{"start":{"line":95,"column":32},"end":{"line":95,"column":62}},"20":{"start":{"line":98,"column":28},"end":{"line":100,"column":29}},"21":{"start":{"line":99,"column":32},"end":{"line":99,"column":62}},"22":{"start":{"line":110,"column":20},"end":{"line":112,"column":23}},"23":{"start":{"line":111,"column":24},"end":{"line":111,"column":40}},"24":{"start":{"line":113,"column":20},"end":{"line":113,"column":45}},"25":{"start":{"line":122,"column":24},"end":{"line":129,"column":25}},"26":{"start":{"line":125,"column":31},"end":{"line":125,"column":97}},"27":{"start":{"line":128,"column":31},"end":{"line":128,"column":104}},"28":{"start":{"line":139,"column":24},"end":{"line":139,"column":49}},"29":{"start":{"line":141,"column":24},"end":{"line":141,"column":53}},"30":{"start":{"line":143,"column":24},"end":{"line":143,"column":61}},"31":{"start":{"line":145,"column":24},"end":{"line":145,"column":54}},"32":{"start":{"line":159,"column":24},"end":{"line":163,"column":82}},"33":{"start":{"line":166,"column":25},"end":{"line":178,"column":26}},"34":{"start":{"line":167,"column":33},"end":{"line":167,"column":64}},"35":{"start":{"line":171,"column":30},"end":{"line":178,"column":26}},"36":{"start":{"line":172,"column":33},"end":{"line":172,"column":65}},"37":{"start":{"line":176,"column":30},"end":{"line":178,"column":26}},"38":{"start":{"line":177,"column":33},"end":{"line":177,"column":66}},"39":{"start":{"line":189,"column":24},"end":{"line":189,"column":64}},"40":{"start":{"line":193,"column":8},"end":{"line":193,"column":30}},"41":{"start":{"line":194,"column":8},"end":{"line":194,"column":29}}},"branchMap":{"1":{"line":18,"type":"if","locations":[{"start":{"line":18,"column":16},"end":{"line":18,"column":16}},{"start":{"line":18,"column":16},"end":{"line":18,"column":16}}]},"2":{"line":18,"type":"binary-expr","locations":[{"start":{"line":18,"column":20},"end":{"line":18,"column":28}},{"start":{"line":18,"column":32},"end":{"line":18,"column":63}}]},"3":{"line":76,"type":"if","locations":[{"start":{"line":76,"column":24},"end":{"line":76,"column":24}},{"start":{"line":76,"column":24},"end":{"line":76,"column":24}}]},"4":{"line":77,"type":"cond-expr","locations":[{"start":{"line":77,"column":91},"end":{"line":77,"column":95}},{"start":{"line":77,"column":98},"end":{"line":77,"column":103}}]},"5":{"line":77,"type":"binary-expr","locations":[{"start":{"line":77,"column":37},"end":{"line":77,"column":51}},{"start":{"line":77,"column":55},"end":{"line":77,"column":87}}]},"6":{"line":89,"type":"if","locations":[{"start":{"line":89,"column":20},"end":{"line":89,"column":20}},{"start":{"line":89,"column":20},"end":{"line":89,"column":20}}]},"7":{"line":91,"type":"if","locations":[{"start":{"line":91,"column":24},"end":{"line":91,"column":24}},{"start":{"line":91,"column":24},"end":{"line":91,"column":24}}]},"8":{"line":93,"type":"if","locations":[{"start":{"line":93,"column":28},"end":{"line":93,"column":28}},{"start":{"line":93,"column":28},"end":{"line":93,"column":28}}]},"9":{"line":98,"type":"if","locations":[{"start":{"line":98,"column":28},"end":{"line":98,"column":28}},{"start":{"line":98,"column":28},"end":{"line":98,"column":28}}]},"10":{"line":122,"type":"if","locations":[{"start":{"line":122,"column":24},"end":{"line":122,"column":24}},{"start":{"line":122,"column":24},"end":{"line":122,"column":24}}]},"11":{"line":159,"type":"binary-expr","locations":[{"start":{"line":159,"column":37},"end":{"line":159,"column":58}},{"start":{"line":159,"column":62},"end":{"line":159,"column":77}}]},"12":{"line":166,"type":"if","locations":[{"start":{"line":166,"column":25},"end":{"line":166,"column":25}},{"start":{"line":166,"column":25},"end":{"line":166,"column":25}}]},"13":{"line":166,"type":"binary-expr","locations":[{"start":{"line":166,"column":29},"end":{"line":166,"column":45}},{"start":{"line":166,"column":49},"end":{"line":166,"column":65}}]},"14":{"line":171,"type":"if","locations":[{"start":{"line":171,"column":30},"end":{"line":171,"column":30}},{"start":{"line":171,"column":30},"end":{"line":171,"column":30}}]},"15":{"line":176,"type":"if","locations":[{"start":{"line":176,"column":30},"end":{"line":176,"column":30}},{"start":{"line":176,"column":30},"end":{"line":176,"column":30}}]}},"code":["(function () { YUI.add('dd-plugin', function (Y, NAME) {","","","","       /**","        * Simple Drag plugin that can be attached to a Node or Widget via the plug method.","        * @module dd","        * @submodule dd-plugin","        */","       /**","        * Simple Drag plugin that can be attached to a Node or Widget via the plug method.","        * @class Drag","        * @extends DD.Drag","        * @constructor","        * @namespace Plugin","        */","        var Drag = function(config) {","                if (Y.Widget && config.host instanceof Y.Widget) {","                        config.node = config.host.get('boundingBox');","                        config.widget = config.host;","                } else {","                        config.node = config.host;","                        config.widget = false;","                }","                Drag.superclass.constructor.call(this, config);","        },","","        EV_START = 'drag:start',","        EV_DRAG = 'drag:drag',","        EV_DRAG_END = 'drag:end';","","        /**","        * dd-plugin","        * @property NAME","        * @type {String}","        */","        Drag.NAME = \"dd-plugin\";","","        /**","        * The Drag instance will be placed on the Node instance under the dd namespace. It can be accessed via Node.dd;","        * @property NS","        * @type {String}","        */","        Drag.NS = \"dd\";","","        Y.extend(Drag, Y.DD.Drag, {","","                _widgetHandles: null,","","                /**","                * refers to a Y.Widget if its the host, otherwise = false.","                *","                * @attribute _widget","                * @private","                */","                _widget: undefined,","","","                /**","                * refers to the [x,y] coordinate where the drag was stopped last","                *","                * @attribute _stoppedPosition","                * @private","                */","                _stoppedPosition: undefined,","","","                /**","                * Returns true if widget uses widgetPosition, otherwise returns false","                *","                * @method _usesWidgetPosition","                * @private","                */","                _usesWidgetPosition: function(widget) {","                        var r = false;","                        if (widget) {","                                r = (widget.hasImpl && widget.hasImpl(Y.WidgetPosition)) ? true : false;","                        }","                        return r;","                },","                /**","                * Attached to the `drag:start` event, it checks if this plugin needs","                * to attach or detach listeners for widgets. If `dd-proxy` is plugged","                * the default widget positioning should be ignored.","                * @method _checkEvents","                * @private","                */","                _checkEvents: function() {","                    if (this._widget) {","                        //It's a widget","                        if (this.proxy) {","                            //It's a proxy","                            if (this._widgetHandles.length > 0) {","                                //Remove Listeners","                                this._removeWidgetListeners();","                            }","                        } else {","                            if (this._widgetHandles.length === 0) {","                                this._attachWidgetListeners();","                            }","                        }","                    }","                },","                /**","                * Remove the attached widget listeners","                * @method _removeWidgetListeners","                * @private","                */","                _removeWidgetListeners: function() {","                    Y.Array.each(this._widgetHandles, function(handle) {","                        handle.detach();","                    });","                    this._widgetHandles = [];","                },","                /**","                * If this is a Widget, then attach the positioning listeners","                * @method _attachWidgetListeners","                * @private","                */","                _attachWidgetListeners: function() {","                        //if this thing is a widget, and it uses widgetposition...","                        if (this._usesWidgetPosition(this._widget)) {","","                               //set the x,y on the widget's ATTRS","                               this._widgetHandles.push(this.on(EV_DRAG, this._setWidgetCoords));","","                               //store the new position that the widget ends up on","                               this._widgetHandles.push(this.on(EV_DRAG_END, this._updateStopPosition));","                        }","                },","                /**","                * Sets up event listeners on drag events if interacting with a widget","                *","                * @method initializer","                * @protected","                */","                initializer: function(config) {","","                        this._widgetHandles = [];","","                        this._widget = config.widget;","","                        this.on(EV_START, this._checkEvents); //Always run, don't check","","                        this._attachWidgetListeners();","","                },","","                /**","                * Updates x,y or xy attributes on widget based on where the widget is dragged","                *","                * @method initializer","                * @param {EventFacade} e Event Facade","                * @private","                */","                _setWidgetCoords: function(e) {","","                        //get the last position where the widget was, or get the starting point","                        var nodeXY = this._stoppedPosition || e.target.nodeXY,","                         realXY = e.target.realXY,","","                         //amount moved = [(x2 - x1) , (y2 - y1)]","                         movedXY = [realXY[0] - nodeXY[0], realXY[1] - nodeXY[1]];","","                         //if both have changed..","                         if (movedXY[0] !== 0 && movedXY[1] !== 0) {","                                 this._widget.set('xy', realXY);","                         }","","                         //if only x is 0, set the Y","                         else if (movedXY[0] === 0) {","                                 this._widget.set('y',realXY[1]);","                         }","","                         //otherwise, y is 0, so set X","                         else if (movedXY[1] === 0){","                                 this._widget.set('x', realXY[0]);","                         }","                },","","                /**","                * Updates the last position where the widget was stopped.","                *","                * @method _updateStopPosition","                * @param {EventFacade} e Event Facade","                * @private","                */","                _updateStopPosition: function(e) {","                        this._stoppedPosition = e.target.realXY;","                }","        });","","        Y.namespace('Plugin');","        Y.Plugin.Drag = Drag;","","","","","","}, '3.10.3', {\"optional\": [\"dd-constrain\", \"dd-proxy\"], \"requires\": [\"dd-drag\"]});","","}());"]};
}
var __cov_9CTh$VNIxvJd2aMkmbBRWQ = __coverage__['build/dd-plugin/dd-plugin.js'];
__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['1']++;YUI.add('dd-plugin',function(Y,NAME){__cov_9CTh$VNIxvJd2aMkmbBRWQ.f['1']++;__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['2']++;var Drag=function(config){__cov_9CTh$VNIxvJd2aMkmbBRWQ.f['2']++;__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['3']++;if((__cov_9CTh$VNIxvJd2aMkmbBRWQ.b['2'][0]++,Y.Widget)&&(__cov_9CTh$VNIxvJd2aMkmbBRWQ.b['2'][1]++,config.host instanceof Y.Widget)){__cov_9CTh$VNIxvJd2aMkmbBRWQ.b['1'][0]++;__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['4']++;config.node=config.host.get('boundingBox');__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['5']++;config.widget=config.host;}else{__cov_9CTh$VNIxvJd2aMkmbBRWQ.b['1'][1]++;__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['6']++;config.node=config.host;__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['7']++;config.widget=false;}__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['8']++;Drag.superclass.constructor.call(this,config);},EV_START='drag:start',EV_DRAG='drag:drag',EV_DRAG_END='drag:end';__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['9']++;Drag.NAME='dd-plugin';__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['10']++;Drag.NS='dd';__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['11']++;Y.extend(Drag,Y.DD.Drag,{_widgetHandles:null,_widget:undefined,_stoppedPosition:undefined,_usesWidgetPosition:function(widget){__cov_9CTh$VNIxvJd2aMkmbBRWQ.f['3']++;__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['12']++;var r=false;__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['13']++;if(widget){__cov_9CTh$VNIxvJd2aMkmbBRWQ.b['3'][0]++;__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['14']++;r=(__cov_9CTh$VNIxvJd2aMkmbBRWQ.b['5'][0]++,widget.hasImpl)&&(__cov_9CTh$VNIxvJd2aMkmbBRWQ.b['5'][1]++,widget.hasImpl(Y.WidgetPosition))?(__cov_9CTh$VNIxvJd2aMkmbBRWQ.b['4'][0]++,true):(__cov_9CTh$VNIxvJd2aMkmbBRWQ.b['4'][1]++,false);}else{__cov_9CTh$VNIxvJd2aMkmbBRWQ.b['3'][1]++;}__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['15']++;return r;},_checkEvents:function(){__cov_9CTh$VNIxvJd2aMkmbBRWQ.f['4']++;__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['16']++;if(this._widget){__cov_9CTh$VNIxvJd2aMkmbBRWQ.b['6'][0]++;__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['17']++;if(this.proxy){__cov_9CTh$VNIxvJd2aMkmbBRWQ.b['7'][0]++;__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['18']++;if(this._widgetHandles.length>0){__cov_9CTh$VNIxvJd2aMkmbBRWQ.b['8'][0]++;__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['19']++;this._removeWidgetListeners();}else{__cov_9CTh$VNIxvJd2aMkmbBRWQ.b['8'][1]++;}}else{__cov_9CTh$VNIxvJd2aMkmbBRWQ.b['7'][1]++;__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['20']++;if(this._widgetHandles.length===0){__cov_9CTh$VNIxvJd2aMkmbBRWQ.b['9'][0]++;__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['21']++;this._attachWidgetListeners();}else{__cov_9CTh$VNIxvJd2aMkmbBRWQ.b['9'][1]++;}}}else{__cov_9CTh$VNIxvJd2aMkmbBRWQ.b['6'][1]++;}},_removeWidgetListeners:function(){__cov_9CTh$VNIxvJd2aMkmbBRWQ.f['5']++;__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['22']++;Y.Array.each(this._widgetHandles,function(handle){__cov_9CTh$VNIxvJd2aMkmbBRWQ.f['6']++;__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['23']++;handle.detach();});__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['24']++;this._widgetHandles=[];},_attachWidgetListeners:function(){__cov_9CTh$VNIxvJd2aMkmbBRWQ.f['7']++;__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['25']++;if(this._usesWidgetPosition(this._widget)){__cov_9CTh$VNIxvJd2aMkmbBRWQ.b['10'][0]++;__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['26']++;this._widgetHandles.push(this.on(EV_DRAG,this._setWidgetCoords));__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['27']++;this._widgetHandles.push(this.on(EV_DRAG_END,this._updateStopPosition));}else{__cov_9CTh$VNIxvJd2aMkmbBRWQ.b['10'][1]++;}},initializer:function(config){__cov_9CTh$VNIxvJd2aMkmbBRWQ.f['8']++;__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['28']++;this._widgetHandles=[];__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['29']++;this._widget=config.widget;__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['30']++;this.on(EV_START,this._checkEvents);__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['31']++;this._attachWidgetListeners();},_setWidgetCoords:function(e){__cov_9CTh$VNIxvJd2aMkmbBRWQ.f['9']++;__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['32']++;var nodeXY=(__cov_9CTh$VNIxvJd2aMkmbBRWQ.b['11'][0]++,this._stoppedPosition)||(__cov_9CTh$VNIxvJd2aMkmbBRWQ.b['11'][1]++,e.target.nodeXY),realXY=e.target.realXY,movedXY=[realXY[0]-nodeXY[0],realXY[1]-nodeXY[1]];__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['33']++;if((__cov_9CTh$VNIxvJd2aMkmbBRWQ.b['13'][0]++,movedXY[0]!==0)&&(__cov_9CTh$VNIxvJd2aMkmbBRWQ.b['13'][1]++,movedXY[1]!==0)){__cov_9CTh$VNIxvJd2aMkmbBRWQ.b['12'][0]++;__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['34']++;this._widget.set('xy',realXY);}else{__cov_9CTh$VNIxvJd2aMkmbBRWQ.b['12'][1]++;__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['35']++;if(movedXY[0]===0){__cov_9CTh$VNIxvJd2aMkmbBRWQ.b['14'][0]++;__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['36']++;this._widget.set('y',realXY[1]);}else{__cov_9CTh$VNIxvJd2aMkmbBRWQ.b['14'][1]++;__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['37']++;if(movedXY[1]===0){__cov_9CTh$VNIxvJd2aMkmbBRWQ.b['15'][0]++;__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['38']++;this._widget.set('x',realXY[0]);}else{__cov_9CTh$VNIxvJd2aMkmbBRWQ.b['15'][1]++;}}}},_updateStopPosition:function(e){__cov_9CTh$VNIxvJd2aMkmbBRWQ.f['10']++;__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['39']++;this._stoppedPosition=e.target.realXY;}});__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['40']++;Y.namespace('Plugin');__cov_9CTh$VNIxvJd2aMkmbBRWQ.s['41']++;Y.Plugin.Drag=Drag;},'3.10.3',{'optional':['dd-constrain','dd-proxy'],'requires':['dd-drag']});