NOBUG: Fixed file access permissions
[moodle.git] / lib / yuilib / 3.13.0 / editor-lists / editor-lists-coverage.js
blob26e03c8707b1c94d5cf2826a929941a0c212df36
1 /*
2 YUI 3.13.0 (build 508226d)
3 Copyright 2013 Yahoo! Inc. All rights reserved.
4 Licensed under the BSD License.
5 http://yuilibrary.com/license/
6 */
8 if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }
9 if (!__coverage__['build/editor-lists/editor-lists.js']) {
10    __coverage__['build/editor-lists/editor-lists.js'] = {"path":"build/editor-lists/editor-lists.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},"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]},"f":{"1":0,"2":0,"3":0,"4":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":43}}},"2":{"name":"(anonymous_2)","line":15,"loc":{"start":{"line":15,"column":22},"end":{"line":15,"column":33}}},"3":{"name":"(anonymous_3)","line":26,"loc":{"start":{"line":26,"column":23},"end":{"line":26,"column":35}}},"4":{"name":"(anonymous_4)","line":75,"loc":{"start":{"line":75,"column":21},"end":{"line":75,"column":32}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":122,"column":44}},"2":{"start":{"line":15,"column":4},"end":{"line":17,"column":54}},"3":{"start":{"line":16,"column":8},"end":{"line":16,"column":66}},"4":{"start":{"line":19,"column":4},"end":{"line":114,"column":7}},"5":{"start":{"line":27,"column":12},"end":{"line":28,"column":73}},"6":{"start":{"line":30,"column":12},"end":{"line":73,"column":13}},"7":{"start":{"line":31,"column":16},"end":{"line":61,"column":17}},"8":{"start":{"line":32,"column":20},"end":{"line":32,"column":42}},"9":{"start":{"line":33,"column":20},"end":{"line":33,"column":39}},"10":{"start":{"line":34,"column":20},"end":{"line":34,"column":39}},"11":{"start":{"line":35,"column":20},"end":{"line":35,"column":51}},"12":{"start":{"line":36,"column":20},"end":{"line":36,"column":53}},"13":{"start":{"line":37,"column":20},"end":{"line":37,"column":29}},"14":{"start":{"line":39,"column":20},"end":{"line":41,"column":21}},"15":{"start":{"line":40,"column":24},"end":{"line":40,"column":33}},"16":{"start":{"line":43,"column":20},"end":{"line":45,"column":21}},"17":{"start":{"line":44,"column":24},"end":{"line":44,"column":45}},"18":{"start":{"line":46,"column":20},"end":{"line":60,"column":21}},"19":{"start":{"line":47,"column":24},"end":{"line":51,"column":25}},"20":{"start":{"line":48,"column":28},"end":{"line":48,"column":64}},"21":{"start":{"line":49,"column":28},"end":{"line":49,"column":41}},"22":{"start":{"line":50,"column":28},"end":{"line":50,"column":44}},"23":{"start":{"line":54,"column":24},"end":{"line":59,"column":25}},"24":{"start":{"line":55,"column":28},"end":{"line":55,"column":86}},"25":{"start":{"line":56,"column":28},"end":{"line":56,"column":60}},"26":{"start":{"line":57,"column":28},"end":{"line":57,"column":47}},"27":{"start":{"line":58,"column":28},"end":{"line":58,"column":41}},"28":{"start":{"line":62,"column":16},"end":{"line":72,"column":17}},"29":{"start":{"line":63,"column":20},"end":{"line":65,"column":21}},"30":{"start":{"line":64,"column":24},"end":{"line":64,"column":45}},"31":{"start":{"line":66,"column":20},"end":{"line":66,"column":56}},"32":{"start":{"line":67,"column":20},"end":{"line":69,"column":21}},"33":{"start":{"line":68,"column":24},"end":{"line":68,"column":81}},"34":{"start":{"line":71,"column":20},"end":{"line":71,"column":80}},"35":{"start":{"line":76,"column":12},"end":{"line":76,"column":78}},"36":{"start":{"line":116,"column":4},"end":{"line":116,"column":26}},"37":{"start":{"line":118,"column":4},"end":{"line":118,"column":39}}},"branchMap":{"1":{"line":30,"type":"if","locations":[{"start":{"line":30,"column":12},"end":{"line":30,"column":12}},{"start":{"line":30,"column":12},"end":{"line":30,"column":12}}]},"2":{"line":31,"type":"if","locations":[{"start":{"line":31,"column":16},"end":{"line":31,"column":16}},{"start":{"line":31,"column":16},"end":{"line":31,"column":16}}]},"3":{"line":39,"type":"if","locations":[{"start":{"line":39,"column":20},"end":{"line":39,"column":20}},{"start":{"line":39,"column":20},"end":{"line":39,"column":20}}]},"4":{"line":43,"type":"if","locations":[{"start":{"line":43,"column":20},"end":{"line":43,"column":20}},{"start":{"line":43,"column":20},"end":{"line":43,"column":20}}]},"5":{"line":46,"type":"if","locations":[{"start":{"line":46,"column":20},"end":{"line":46,"column":20}},{"start":{"line":46,"column":20},"end":{"line":46,"column":20}}]},"6":{"line":47,"type":"if","locations":[{"start":{"line":47,"column":24},"end":{"line":47,"column":24}},{"start":{"line":47,"column":24},"end":{"line":47,"column":24}}]},"7":{"line":54,"type":"if","locations":[{"start":{"line":54,"column":24},"end":{"line":54,"column":24}},{"start":{"line":54,"column":24},"end":{"line":54,"column":24}}]},"8":{"line":62,"type":"if","locations":[{"start":{"line":62,"column":16},"end":{"line":62,"column":16}},{"start":{"line":62,"column":16},"end":{"line":62,"column":16}}]},"9":{"line":63,"type":"if","locations":[{"start":{"line":63,"column":20},"end":{"line":63,"column":20}},{"start":{"line":63,"column":20},"end":{"line":63,"column":20}}]},"10":{"line":67,"type":"if","locations":[{"start":{"line":67,"column":20},"end":{"line":67,"column":20}},{"start":{"line":67,"column":20},"end":{"line":67,"column":20}}]}},"code":["(function () { YUI.add('editor-lists', function (Y, NAME) {","","","    /**","     * Handles list manipulation inside the Editor. Adds keyboard manipulation and execCommand support.","     * Adds overrides for the <a href=\"Plugin.ExecCommand.html#method_COMMANDS.insertorderedlist\">insertorderedlist</a>","     * and <a href=\"Plugin.ExecCommand.html#method_COMMANDS.insertunorderedlist\">insertunorderedlist</a> execCommands.","     * @class Plugin.EditorLists","     * @constructor","     * @extends Base","     * @module editor","     * @submodule editor-lists","     */","","    var EditorLists = function() {","        EditorLists.superclass.constructor.apply(this, arguments);","    }, LI = 'li', OL = 'ol', UL = 'ul', HOST = 'host';","","    Y.extend(EditorLists, Y.Base, {","        /**","        * Listener for host's nodeChange event and captures the tabkey interaction only when inside a list node.","        * @private","        * @method _onNodeChange","        * @param {Event} e The Event facade passed from the host.","        */","        _onNodeChange: function(e) {","            var inst = this.get(HOST).getInstance(), li,","                newList, sTab, par, moved = false, tag, focusEnd = false;","","            if (e.changedType === 'tab') {","                if (e.changedNode.test(LI + ', ' + LI + ' *')) {","                    e.changedEvent.halt();","                    e.preventDefault();","                    li = e.changedNode;","                    sTab = e.changedEvent.shiftKey;","                    par = li.ancestor(OL + ',' + UL);","                    tag = UL;","","                    if (par.get('tagName').toLowerCase() === OL) {","                        tag = OL;","                    }","","                    if (!li.test(LI)) {","                        li = li.ancestor(LI);","                    }","                    if (sTab) {","                        if (li.ancestor(LI)) {","                            li.ancestor(LI).insert(li, 'after');","                            moved = true;","                            focusEnd = true;","                        }","                    } else {","                        //li.setStyle('border', '1px solid red');","                        if (li.previous(LI)) {","                            newList = inst.Node.create('<' + tag + '></' + tag + '>');","                            li.previous(LI).append(newList);","                            newList.append(li);","                            moved = true;","                        }","                    }","                }","                if (moved) {","                    if (!li.test(LI)) {","                        li = li.ancestor(LI);","                    }","                    li.all(EditorLists.REMOVE).remove();","                    if (Y.UA.ie) {","                        li = li.append(EditorLists.NON).one(EditorLists.NON_SEL);","                    }","                    //Selection here..","                    (new inst.EditorSelection()).selectNode(li, true, focusEnd);","                }","            }","        },","        initializer: function() {","            this.get(HOST).on('nodeChange', Y.bind(this._onNodeChange, this));","        }","    }, {","        /**","        * The non element placeholder, used for positioning the cursor and filling empty items","        * @property REMOVE","        * @static","        */","        NON: '<span class=\"yui-non\">&nbsp;</span>',","        /**","        * The selector query to get all non elements","        * @property NONSEL","        * @static","        */","        NON_SEL: 'span.yui-non',","        /**","        * The items to removed from a list when a list item is moved, currently removes BR nodes","        * @property REMOVE","        * @static","        */","        REMOVE: 'br',","        /**","        * editorLists","        * @property NAME","        * @static","        */","        NAME: 'editorLists',","        /**","        * lists","        * @property NS","        * @static","        */","        NS: 'lists',","        ATTRS: {","            host: {","                value: false","            }","        }","    });","","    Y.namespace('Plugin');","","    Y.Plugin.EditorLists = EditorLists;","","","","}, '3.13.0', {\"requires\": [\"editor-base\"]});","","}());"]};
12 var __cov_gFg8Zr3_59eTo1gkSPw5HA = __coverage__['build/editor-lists/editor-lists.js'];
13 __cov_gFg8Zr3_59eTo1gkSPw5HA.s['1']++;YUI.add('editor-lists',function(Y,NAME){__cov_gFg8Zr3_59eTo1gkSPw5HA.f['1']++;__cov_gFg8Zr3_59eTo1gkSPw5HA.s['2']++;var EditorLists=function(){__cov_gFg8Zr3_59eTo1gkSPw5HA.f['2']++;__cov_gFg8Zr3_59eTo1gkSPw5HA.s['3']++;EditorLists.superclass.constructor.apply(this,arguments);},LI='li',OL='ol',UL='ul',HOST='host';__cov_gFg8Zr3_59eTo1gkSPw5HA.s['4']++;Y.extend(EditorLists,Y.Base,{_onNodeChange:function(e){__cov_gFg8Zr3_59eTo1gkSPw5HA.f['3']++;__cov_gFg8Zr3_59eTo1gkSPw5HA.s['5']++;var inst=this.get(HOST).getInstance(),li,newList,sTab,par,moved=false,tag,focusEnd=false;__cov_gFg8Zr3_59eTo1gkSPw5HA.s['6']++;if(e.changedType==='tab'){__cov_gFg8Zr3_59eTo1gkSPw5HA.b['1'][0]++;__cov_gFg8Zr3_59eTo1gkSPw5HA.s['7']++;if(e.changedNode.test(LI+', '+LI+' *')){__cov_gFg8Zr3_59eTo1gkSPw5HA.b['2'][0]++;__cov_gFg8Zr3_59eTo1gkSPw5HA.s['8']++;e.changedEvent.halt();__cov_gFg8Zr3_59eTo1gkSPw5HA.s['9']++;e.preventDefault();__cov_gFg8Zr3_59eTo1gkSPw5HA.s['10']++;li=e.changedNode;__cov_gFg8Zr3_59eTo1gkSPw5HA.s['11']++;sTab=e.changedEvent.shiftKey;__cov_gFg8Zr3_59eTo1gkSPw5HA.s['12']++;par=li.ancestor(OL+','+UL);__cov_gFg8Zr3_59eTo1gkSPw5HA.s['13']++;tag=UL;__cov_gFg8Zr3_59eTo1gkSPw5HA.s['14']++;if(par.get('tagName').toLowerCase()===OL){__cov_gFg8Zr3_59eTo1gkSPw5HA.b['3'][0]++;__cov_gFg8Zr3_59eTo1gkSPw5HA.s['15']++;tag=OL;}else{__cov_gFg8Zr3_59eTo1gkSPw5HA.b['3'][1]++;}__cov_gFg8Zr3_59eTo1gkSPw5HA.s['16']++;if(!li.test(LI)){__cov_gFg8Zr3_59eTo1gkSPw5HA.b['4'][0]++;__cov_gFg8Zr3_59eTo1gkSPw5HA.s['17']++;li=li.ancestor(LI);}else{__cov_gFg8Zr3_59eTo1gkSPw5HA.b['4'][1]++;}__cov_gFg8Zr3_59eTo1gkSPw5HA.s['18']++;if(sTab){__cov_gFg8Zr3_59eTo1gkSPw5HA.b['5'][0]++;__cov_gFg8Zr3_59eTo1gkSPw5HA.s['19']++;if(li.ancestor(LI)){__cov_gFg8Zr3_59eTo1gkSPw5HA.b['6'][0]++;__cov_gFg8Zr3_59eTo1gkSPw5HA.s['20']++;li.ancestor(LI).insert(li,'after');__cov_gFg8Zr3_59eTo1gkSPw5HA.s['21']++;moved=true;__cov_gFg8Zr3_59eTo1gkSPw5HA.s['22']++;focusEnd=true;}else{__cov_gFg8Zr3_59eTo1gkSPw5HA.b['6'][1]++;}}else{__cov_gFg8Zr3_59eTo1gkSPw5HA.b['5'][1]++;__cov_gFg8Zr3_59eTo1gkSPw5HA.s['23']++;if(li.previous(LI)){__cov_gFg8Zr3_59eTo1gkSPw5HA.b['7'][0]++;__cov_gFg8Zr3_59eTo1gkSPw5HA.s['24']++;newList=inst.Node.create('<'+tag+'></'+tag+'>');__cov_gFg8Zr3_59eTo1gkSPw5HA.s['25']++;li.previous(LI).append(newList);__cov_gFg8Zr3_59eTo1gkSPw5HA.s['26']++;newList.append(li);__cov_gFg8Zr3_59eTo1gkSPw5HA.s['27']++;moved=true;}else{__cov_gFg8Zr3_59eTo1gkSPw5HA.b['7'][1]++;}}}else{__cov_gFg8Zr3_59eTo1gkSPw5HA.b['2'][1]++;}__cov_gFg8Zr3_59eTo1gkSPw5HA.s['28']++;if(moved){__cov_gFg8Zr3_59eTo1gkSPw5HA.b['8'][0]++;__cov_gFg8Zr3_59eTo1gkSPw5HA.s['29']++;if(!li.test(LI)){__cov_gFg8Zr3_59eTo1gkSPw5HA.b['9'][0]++;__cov_gFg8Zr3_59eTo1gkSPw5HA.s['30']++;li=li.ancestor(LI);}else{__cov_gFg8Zr3_59eTo1gkSPw5HA.b['9'][1]++;}__cov_gFg8Zr3_59eTo1gkSPw5HA.s['31']++;li.all(EditorLists.REMOVE).remove();__cov_gFg8Zr3_59eTo1gkSPw5HA.s['32']++;if(Y.UA.ie){__cov_gFg8Zr3_59eTo1gkSPw5HA.b['10'][0]++;__cov_gFg8Zr3_59eTo1gkSPw5HA.s['33']++;li=li.append(EditorLists.NON).one(EditorLists.NON_SEL);}else{__cov_gFg8Zr3_59eTo1gkSPw5HA.b['10'][1]++;}__cov_gFg8Zr3_59eTo1gkSPw5HA.s['34']++;new inst.EditorSelection().selectNode(li,true,focusEnd);}else{__cov_gFg8Zr3_59eTo1gkSPw5HA.b['8'][1]++;}}else{__cov_gFg8Zr3_59eTo1gkSPw5HA.b['1'][1]++;}},initializer:function(){__cov_gFg8Zr3_59eTo1gkSPw5HA.f['4']++;__cov_gFg8Zr3_59eTo1gkSPw5HA.s['35']++;this.get(HOST).on('nodeChange',Y.bind(this._onNodeChange,this));}},{NON:'<span class="yui-non">&nbsp;</span>',NON_SEL:'span.yui-non',REMOVE:'br',NAME:'editorLists',NS:'lists',ATTRS:{host:{value:false}}});__cov_gFg8Zr3_59eTo1gkSPw5HA.s['36']++;Y.namespace('Plugin');__cov_gFg8Zr3_59eTo1gkSPw5HA.s['37']++;Y.Plugin.EditorLists=EditorLists;},'3.13.0',{'requires':['editor-base']});