editor-lists-min.js revision aa2ac226ad6e45232f8416eecc99d2165ce74d03
781e495b446a0ea73ac21ece6fa0a2a907da6062Dav GlassYUI.add("editor-lists",function(f){var e=function(){e.superclass.constructor.apply(this,arguments);},b="li",c="ol",d="ul",a="host";f.extend(e,f.Base,{_onNodeChange:function(l){var j=this.get(a).getInstance(),g,o,p,h,i,m,n=false,q,k=false;if(f.UA.ie&&l.changedType==="enter"){if(l.changedNode.test(b+", "+b+" *")){l.changedEvent.halt();l.preventDefault();o=l.changedNode;p=j.Node.create("<"+b+">"+e.NON+"</"+b+">");if(!o.test(b)){o=o.ancestor(b);}o.insert(p,"after");g=new j.Selection();g.selectNode(p.get("firstChild"),true,false);}}if(l.changedType==="tab"){if(l.changedNode.test(b+", "+b+" *")){l.changedEvent.halt();l.preventDefault();o=l.changedNode;i=l.changedEvent.shiftKey;m=o.ancestor(c+","+d);q=d;if(m.get("tagName").toLowerCase()===c){q=c;}if(!o.test(b)){o=o.ancestor(b);}if(i){if(o.ancestor(b)){o.ancestor(b).insert(o,"after");n=true;k=true;}}else{if(o.previous(b)){h=j.Node.create("<"+q+"></"+q+">");o.previous(b).append(h);h.append(o);n=true;}}}if(n){if(!o.test(b)){o=o.ancestor(b);}o.all(e.REMOVE).remove();if(f.UA.ie){o=o.append(e.NON).one(e.NON_SEL);}(new j.Selection()).selectNode(o,true,k);}}},initializer:function(){this.get(a).on("nodeChange",f.bind(this._onNodeChange,this));}},{NON:'<span class="yui-non"> </span>',NON_SEL:"span.yui-non",REMOVE:"br",NAME:"editorLists",NS:"lists",ATTRS:{host:{value:false}}});f.namespace("Plugin");f.Plugin.EditorLists=e;f.mix(f.Plugin.ExecCommand.COMMANDS,{insertunorderedlist:function(i){var h=this.get("host").getInstance(),g;this.get("host")._execCommand(i,"");},insertorderedlist:function(i){var h=this.get("host").getInstance(),g;this.get("host")._execCommand(i,"");}});},"@VERSION@",{skinnable:false,requires:["editor-base"]});