(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.AdvListPlugin",{init:function(b,c){var d=this;d.editor=b;function e(g){var f=[];a(g.split(/,/),function(h){f.push({title:"advlist."+(h=="default"?"def":h.replace(/-/g,"_")),styles:{listStyleType:h=="default"?"":h}})});return f}d.numlist=b.getParam("advlist_number_styles")||e("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");d.bullist=b.getParam("advlist_bullet_styles")||e("default,circle,disc,square")},createControl:function(b,d){var e=this,c,g;if(b=="numlist"||b=="bullist"){if(e[b][0].title=="advlist.def"){g=e[b][0]}function h(i,k){var j=true;a(k.styles,function(m,l){if(e.editor.dom.getStyle(i,l)!=m){j=false;return false}});return j}function f(){var k,i=e.editor,l=i.dom,j=i.selection;k=l.getParent(j.getNode(),"ol,ul");if(!k||k.nodeName==(b=="bullist"?"OL":"UL")||h(k,g)){i.execCommand(b=="bullist"?"InsertUnorderedList":"InsertOrderedList")}if(g){k=l.getParent(j.getNode(),"ol,ul");if(k){l.setStyles(k,g.styles);k.removeAttribute("_mce_style")}}}c=d.createSplitButton(b,{title:"advanced."+b+"_desc","class":"mce_"+b,onclick:function(){f()}});c.onRenderMenu.add(function(i,j){j.onShowMenu.add(function(){var m=e.editor.dom,l=m.getParent(e.editor.selection.getNode(),"ol,ul"),k;if(l||g){k=e[b];a(j.items,function(o){var n=true;o.setSelected(0);if(l&&!o.isDisabled()){a(k,function(p){if(p.id==o.id){if(!h(l,p)){n=false;return false}}});if(n){o.setSelected(1)}}});if(!l){j.items[g.id].setSelected(1)}}});j.add({id:e.editor.dom.uniqueId(),title:"advlist.types","class":"mceMenuItemTitle"}).setDisabled(1);a(e[b],function(k){k.id=e.editor.dom.uniqueId();j.add({id:k.id,title:k.title,onclick:function(){g=k;f()}})})});return c}},getInfo:function(){return{longname:"Advanced lists",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlist",tinymce.plugins.AdvListPlugin)})();