(function(tinymce){tinymce.onAddEditor.addToTop(function(tinymce,editor){editor.settings.inline_styles=false;});tinymce.create('tinymce.plugins.LegacyOutput',{init:function(editor){editor.onInit.add(function(){var alignElements='p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img',fontSizes=tinymce.explode(editor.settings.font_size_style_values),schema=editor.schema;editor.formatter.register({alignleft:{selector:alignElements,attributes:{align:'left'}},aligncenter:{selector:alignElements,attributes:{align:'center'}},alignright:{selector:alignElements,attributes:{align:'right'}},alignfull:{selector:alignElements,attributes:{align:'justify'}},bold:[{inline:'b',remove:'all'},{inline:'strong',remove:'all'},{inline:'span',styles:{fontWeight:'bold'}}],italic:[{inline:'i',remove:'all'},{inline:'em',remove:'all'},{inline:'span',styles:{fontStyle:'italic'}}],underline:[{inline:'u',remove:'all'},{inline:'span',styles:{textDecoration:'underline'},exact:true}],strikethrough:[{inline:'strike',remove:'all'},{inline:'span',styles:{textDecoration:'line-through'},exact:true}],fontname:{inline:'font',attributes:{face:'%value'}},fontsize:{inline:'font',attributes:{size:function(vars){return tinymce.inArray(fontSizes,vars.value)+1;}}},forecolor:{inline:'font',styles:{color:'%value'}},hilitecolor:{inline:'font',styles:{backgroundColor:'%value'}}});tinymce.each('b,i,u,strike'.split(','),function(name){schema.addValidElements(name+'[*]');});if(!schema.getElementRule("font"))
schema.addValidElements("font[face|size|color|style]");tinymce.each(alignElements.split(','),function(name){var rule=schema.getElementRule(name),found;if(rule){if(!rule.attributes.align){rule.attributes.align={};rule.attributesOrder.push('align');}}});editor.onNodeChange.add(function(editor,control_manager){var control,fontElm,fontName,fontSize;fontElm=editor.dom.getParent(editor.selection.getNode(),'font');if(fontElm){fontName=fontElm.face;fontSize=fontElm.size;}
if(control=control_manager.get('fontselect')){control.select(function(value){return value==fontName;});}
if(control=control_manager.get('fontsizeselect')){control.select(function(value){var index=tinymce.inArray(fontSizes,value.fontSize);return index+1==fontSize;});}});});},getInfo:function(){return{longname:'LegacyOutput',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/legacyoutput',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('legacyoutput',tinymce.plugins.LegacyOutput);})(tinymce);