(function(){tinymce.PluginManager.requireLangPack('liststyle');tinymce.create('tinymce.plugins.ListStylePlugin',{init:function(ed,url){ed.addCommand('mceListStyle',function(ui,v){var listStyleType='',listStart,isIE=tinyMCE.isIE;var listNode=ed.plugins.liststyle._findList(ed,ed.selection.getNode());if(listNode){listStyleType=listNode.style.listStyleType;if(listNode.nodeName.toLowerCase()=='ol'){listStart=parseInt(listNode.start);if(listStart<1){listStart=1}ed.windowManager.open({file:url+'/liststyle_ol.htm',width:340+parseInt(ed.getLang('liststyle.delta_width',0)),height:300+(isIE?40:0)+parseInt(ed.getLang('liststyle.delta_height',0)),inline:1},{plugin_url:url,listStyleType:listStyleType,listNode:listNode,listStart:listStart,classAttr:listNode.className,isIE:isIE})}else{ed.windowManager.open({file:url+'/liststyle_ul.htm',width:340+parseInt(ed.getLang('liststyle.delta_width',0)),height:300+(isIE?40:0)+parseInt(ed.getLang('liststyle.delta_height',0)),inline:1},{plugin_url:url,listStyleType:listStyleType,listNode:listNode,classAttr:listNode.className,isIE:isIE})}}});ed.onInit.add(function(){if(ed&&ed.plugins.contextmenu){ed.plugins.contextmenu.onContextMenu.add(function(th,m,e){if(ed.plugins.liststyle._findList(ed,ed.selection.getNode())){m.add({title:'liststyle.desc',cmd:'mceListStyle',icon:'liststyle',ui:true})}})}});ed.addButton('liststyle',{title:'liststyle.desc',cmd:'mceListStyle',image:url+'/img/liststyle.gif'});ed.onNodeChange.add(function(ed,cm,node){cm.setDisabled('liststyle',ed.plugins.liststyle._findList(ed,node)==null)})},_isList:function(node){if(node==null)return null;return node.nodeName=='OL'||node.nodeName=='UL'},_findList:function(ed,node){if(ed.plugins.liststyle._isList(node)){return node}return ed.dom.getParent(node,ed.plugins.liststyle._isList)},getInfo:function(){return{longname:'ListStyle',author:'PolicyPoint Technologies Pty. Ltd.',authorurl:'http://policypoint.net/',infourl:'http://policypoint.net/tinymce/docs/plugin_liststyle.html',version:"3.1-alfa"}}});tinymce.PluginManager.add('liststyle',tinymce.plugins.ListStylePlugin)})();
