!function(){var e=tinymce.each;tinymce.create("tinymce.plugins.AdvListPlugin",{init:function(t,i){var n=this;function o(t){var i=[];return e(t.split(/,/),(function(e){i.push({title:"advlist."+("default"==e?"def":e.replace(/-/g,"_")),styles:{listStyleType:"default"==e?"":e}})})),i}n.editor=t,n.numlist=t.getParam("advlist_number_styles")||o("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman"),n.bullist=t.getParam("advlist_bullet_styles")||o("default,circle,disc,square"),tinymce.isIE&&/MSIE [2-7]/.test(navigator.userAgent)&&(n.isIE7=!0)},createControl:function(t,i){var n,o,l=this,s=l.editor;if("numlist"==t||"bullist"==t){function r(t,i){var n=!0;return e(i.styles,(function(e,i){if(s.dom.getStyle(t,i)!=e)return n=!1,!1})),n}function d(){var e,i=s.dom,n=s.selection;(e=i.getParent(n.getNode(),"ol,ul"))&&e.nodeName!=("bullist"==t?"OL":"UL")&&!r(e,o)||s.execCommand("bullist"==t?"InsertUnorderedList":"InsertOrderedList"),o&&(e=i.getParent(n.getNode(),"ol,ul"))&&(i.setStyles(e,o.styles),e.removeAttribute("data-mce-style")),s.focus()}return"advlist.def"==l[t][0].title&&(o=l[t][0]),(n=i.createSplitButton(t,{title:"advanced."+t+"_desc",class:"mce_"+t,onclick:function(){d()}})).onRenderMenu.add((function(i,n){n.onHideMenu.add((function(){l.bookmark&&(s.selection.moveToBookmark(l.bookmark),l.bookmark=0)})),n.onShowMenu.add((function(){var i,d=s.dom.getParent(s.selection.getNode(),"ol,ul");(d||o)&&(i=l[t],e(n.items,(function(t){var n=!0;t.setSelected(0),d&&!t.isDisabled()&&(e(i,(function(e){if(e.id==t.id&&!r(d,e))return n=!1,!1})),n&&t.setSelected(1))})),d||n.items[o.id].setSelected(1)),s.focus(),tinymce.isIE&&(l.bookmark=s.selection.getBookmark(1))})),n.add({id:s.dom.uniqueId(),title:"advlist.types",class:"mceMenuItemTitle",titleItem:!0}).setDisabled(1),e(l[t],(function(e){l.isIE7&&"lower-greek"==e.styles.listStyleType||(e.id=s.dom.uniqueId(),n.add({id:e.id,title:e.title,onclick:function(){o=e,d()}}))}))})),n}},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)}();
