PHP Classes

File: htdocs/class/xoopseditor/tinymce/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js

Recommend this page to a friend!
  Classes of Michael Beck   Xoops 2.5   htdocs/class/xoopseditor/tinymce/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js   Download  
File: htdocs/class/xoopseditor/tinymce/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Xoops 2.5
Modular content management publication system
Author: By
Last change: Merge pull request #543 from geekwright/changelog2510

Bump version, changelog
Date: 7 years ago
Size: 27,246 bytes
 

Contents

Class file image Download
(function(i){var k=i.DOM,h=i.dom.Event,c=i.extend,f=i.each,a=i.util.Cookie,e,d=i.explode;var g=function(m,n){var o=n.theme_advanced_default_font_size;var l=n.theme_advanced_default_font_family;if(o){m.style.fontSize=o}if(l){m.style.fontFamily=l}};var j=function(m){var n=m.theme_advanced_default_font_size;var l=m.theme_advanced_default_font_family;return !!(n||l)};function b(r,o){var m,n,q=r.dom,l="",p,t;previewStyles=r.settings.preview_styles;if(previewStyles===false){return""}if(!previewStyles){previewStyles="font-family font-size font-weight text-decoration text-transform color background-color"}function s(u){return u.replace(/%(\w+)/g,"")}m=o.block||o.inline||"span";n=q.create(m);f(o.styles,function(v,u){v=s(v);if(v){q.setStyle(n,u,v)}});f(o.attributes,function(v,u){v=s(v);if(v){q.setAttrib(n,u,v)}});f(o.classes,function(u){u=s(u);if(!q.hasClass(n,u)){q.addClass(n,u)}});q.setStyles(n,{position:"absolute",left:-65535});r.getBody().appendChild(n);p=q.getStyle(r.getBody(),"fontSize",true);p=/px$/.test(p)?parseInt(p,10):0;f(previewStyles.split(" "),function(u){var v=q.getStyle(n,u,true);if(u=="background-color"&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(v)){v=q.getStyle(r.getBody(),u,true);if(q.toHex(v).toLowerCase()=="#ffffff"){return}}if(u=="font-size"){if(/em|%$/.test(v)){if(p===0){return}v=parseFloat(v,10)/(/%$/.test(v)?100:1);v=(v*p)+"px"}}l+=u+":"+v+";"});q.remove(n);return l}i.ThemeManager.requireLangPack("advanced");i.create("tinymce.themes.AdvancedTheme",{sizes:[8,10,12,14,18,24,36],controls:{bold:["bold_desc","Bold"],italic:["italic_desc","Italic"],underline:["underline_desc","Underline"],strikethrough:["striketrough_desc","Strikethrough"],justifyleft:["justifyleft_desc","JustifyLeft"],justifycenter:["justifycenter_desc","JustifyCenter"],justifyright:["justifyright_desc","JustifyRight"],justifyfull:["justifyfull_desc","JustifyFull"],bullist:["bullist_desc","InsertUnorderedList"],numlist:["numlist_desc","InsertOrderedList"],outdent:["outdent_desc","Outdent"],indent:["indent_desc","Indent"],cut:["cut_desc","Cut"],copy:["copy_desc","Copy"],paste:["paste_desc","Paste"],undo:["undo_desc","Undo"],redo:["redo_desc","Redo"],link:["link_desc","mceLink"],unlink:["unlink_desc","unlink"],image:["image_desc","mceImage"],cleanup:["cleanup_desc","mceCleanup"],help:["help_desc","mceHelp"],code:["code_desc","mceCodeEditor"],hr:["hr_desc","InsertHorizontalRule"],removeformat:["removeformat_desc","RemoveFormat"],sub:["sub_desc","subscript"],sup:["sup_desc","superscript"],forecolor:["forecolor_desc","ForeColor"],forecolorpicker:["forecolor_desc","mceForeColor"],backcolor:["backcolor_desc","HiliteColor"],backcolorpicker:["backcolor_desc","mceBackColor"],charmap:["charmap_desc","mceCharMap"],visualaid:["visualaid_desc","mceToggleVisualAid"],anchor:["anchor_desc","mceInsertAnchor"],newdocument:["newdocument_desc","mceNewDocument"],blockquote:["blockquote_desc","mceBlockQuote"]},stateControls:["bold","italic","underline","strikethrough","bullist","numlist","justifyleft","justifycenter","justifyright","justifyfull","sub","sup","blockquote"],init:function(m,n){var p=this,q,l,r;p.editor=m;p.url=n;p.onResolveName=new i.util.Dispatcher(this);q=m.settings;m.forcedHighContrastMode=m.settings.detect_highcontrast&&p._isHighContrast();m.settings.skin=m.forcedHighContrastMode?"highcontrast":m.settings.skin;if(!q.theme_advanced_buttons1){q=c({theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap"},q)}p.settings=q=c({theme_advanced_path:true,theme_advanced_toolbar_location:"top",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"left",theme_advanced_statusbar_location:"bottom",theme_advanced_fonts:"Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",theme_advanced_font_selector:"span",theme_advanced_show_current_color:0,readonly:m.settings.readonly},q);if(!q.font_size_style_values){q.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(i.is(q.theme_advanced_font_sizes,"string")){q.font_size_style_values=i.explode(q.font_size_style_values);q.font_size_classes=i.explode(q.font_size_classes||"");r={};m.settings.theme_advanced_font_sizes=q.theme_advanced_font_sizes;f(m.getParam("theme_advanced_font_sizes","","hash"),function(t,s){var o;if(s==t&&t>=1&&t<=7){s=t+" ("+p.sizes[t-1]+"pt)";o=q.font_size_classes[t-1];t=q.font_size_style_values[t-1]||(p.sizes[t-1]+"pt")}if(/^\s*\./.test(t)){o=t.replace(/\./g,"")}r[s]=o?{"class":o}:{fontSize:t}});q.theme_advanced_font_sizes=r}if((l=q.theme_advanced_path_location)&&l!="none"){q.theme_advanced_statusbar_location=q.theme_advanced_path_location}if(q.theme_advanced_statusbar_location=="none"){q.theme_advanced_statusbar_location=0}if(m.settings.content_css!==false){m.contentCSS.push(m.baseURI.toAbsolute(n+"/skins/"+m.settings.skin+"/content.css"))}m.onInit.add(function(){if(!m.settings.readonly){m.onNodeChange.add(p._nodeChanged,p);m.onKeyUp.add(p._updateUndoStatus,p);m.onMouseUp.add(p._updateUndoStatus,p);m.dom.bind(m.dom.getRoot(),"dragend",function(){p._updateUndoStatus(m)})}g(m.getBody(),m.settings)});m.onSetProgressState.add(function(t,o,u){var v,w=t.id,s;if(o){p.progressTimer=setTimeout(function(){v=t.getContainer();v=v.insertBefore(k.create("DIV",{style:"position:relative"}),v.firstChild);s=k.get(t.id+"_tbl");k.add(v,"div",{id:w+"_blocker","class":"mceBlocker",style:{width:s.clientWidth+2,height:s.clientHeight+2}});k.add(v,"div",{id:w+"_progress","class":"mceProgress",style:{left:s.clientWidth/2,top:s.clientHeight/2}})},u||0)}else{k.remove(w+"_blocker");k.remove(w+"_progress");clearTimeout(p.progressTimer)}});k.loadCSS(q.editor_css?m.documentBaseURI.toAbsolute(q.editor_css):n+"/skins/"+m.settings.skin+"/ui.css");if(q.skin_variant){k.loadCSS(n+"/skins/"+m.settings.skin+"/ui_"+q.skin_variant+".css")}},_isHighContrast:function(){var l,m=k.add(k.getRoot(),"div",{style:"background-color: rgb(171,239,86);"});l=(k.getStyle(m,"background-color",true)+"").toLowerCase().replace(/ /g,"");k.remove(m);return l!="rgb(171,239,86)"&&l!="#abef56"},createControl:function(p,l){var m,o;if(o=l.createControl(p)){return o}switch(p){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((m=this.controls[p])){return l.createButton(p,{title:"advanced."+m[0],cmd:m[1],ui:m[2],value:m[3]})}},execCommand:function(n,m,o){var l=this["_"+n];if(l){l.call(this,m,o);return true}return false},_importClasses:function(n){var l=this.editor,m=l.controlManager.get("styleselect");if(m.getLength()==0){f(l.dom.getClasses(),function(s,p){var r="style_"+p,q;q={inline:"span",attributes:{"class":s["class"]},selector:"*"};l.formatter.register(r,q);m.add(s["class"],r,{style:function(){return b(l,q)}})})}},_createStyleSelect:function(q){var o=this,l=o.editor,m=l.controlManager,p;p=m.createListBox("styleselect",{title:"advanced.style_select",onselect:function(s){var t,n=[],r;f(p.items,function(u){n.push(u.value)});l.focus();l.undoManager.add();t=l.formatter.matchAll(n);i.each(t,function(u){if(!s||u==s){if(u){l.formatter.remove(u)}r=true}});if(!r){l.formatter.apply(s)}l.undoManager.add();l.nodeChanged();return false}});l.onPreInit.add(function(){var r=0,n=l.getParam("style_formats");if(n){f(n,function(s){var t,u=0;f(s,function(){u++});if(u>1){t=s.name=s.name||"style_"+(r++);l.formatter.register(t,s);p.add(s.title,t,{style:function(){return b(l,s)}})}else{p.add(s.title)}})}else{f(l.getParam("theme_advanced_styles","","hash"),function(v,u){var t,s;if(v){t="style_"+(r++);s={inline:"span",classes:v,selector:"*"};l.formatter.register(t,s);p.add(o.editor.translate(u),t,{style:function(){return b(l,s)}})}})}});if(p.getLength()==0){p.onPostRender.add(function(r,s){if(!p.NativeListBox){h.add(s.id+"_text","focus",o._importClasses,o);h.add(s.id+"_text","mousedown",o._importClasses,o);h.add(s.id+"_open","focus",o._importClasses,o);h.add(s.id+"_open","mousedown",o._importClasses,o)}else{h.add(s.id,"focus",o._importClasses,o)}})}return p},_createFontSelect:function(){var n,m=this,l=m.editor;n=l.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",onselect:function(o){var p=n.items[n.selectedIndex];if(!o&&p){l.execCommand("FontName",false,p.value);return}l.execCommand("FontName",false,o);n.select(function(q){return o==q});if(p&&p.value==o){n.select(null)}return false}});if(n){f(l.getParam("theme_advanced_fonts",m.settings.theme_advanced_fonts,"hash"),function(p,o){n.add(l.translate(o),p,{style:p.indexOf("dings")==-1?"font-family:"+p:""})})}return n},_createFontSizeSelect:function(){var o=this,m=o.editor,p,n=0,l=[];p=m.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(q){var r=p.items[p.selectedIndex];if(!q&&r){r=r.value;if(r["class"]){m.formatter.toggle("fontsize_class",{value:r["class"]});m.undoManager.add();m.nodeChanged()}else{m.execCommand("FontSize",false,r.fontSize)}return}if(q["class"]){m.focus();m.undoManager.add();m.formatter.toggle("fontsize_class",{value:q["class"]});m.undoManager.add();m.nodeChanged()}else{m.execCommand("FontSize",false,q.fontSize)}p.select(function(s){return q==s});if(r&&(r.value.fontSize==q.fontSize||r.value["class"]&&r.value["class"]==q["class"])){p.select(null)}return false}});if(p){f(o.settings.theme_advanced_font_sizes,function(r,q){var s=r.fontSize;if(s>=1&&s<=7){s=o.sizes[parseInt(s)-1]+"pt"}p.add(q,r,{style:"font-size:"+s,"class":"mceFontSize"+(n++)+(" "+(r["class"]||""))})})}return p},_createBlockFormats:function(){var n,l={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},m=this;n=m.editor.controlManager.createListBox("formatselect",{title:"advanced.block",onselect:function(o){m.editor.execCommand("FormatBlock",false,o);return false}});if(n){f(m.editor.getParam("theme_advanced_blockformats",m.settings.theme_advanced_blockformats,"hash"),function(p,o){n.add(m.editor.translate(o!=p?o:l[p]),p,{"class":"mce_formatPreview mce_"+p,style:function(){return b(m.editor,{block:p})}})})}return n},_createForeColorMenu:function(){var q,m=this,n=m.settings,p={},l;if(n.theme_advanced_more_colors){p.more_colors_func=function(){m._mceColorPicker(0,{color:q.value,func:function(o){q.setColor(o)}})}}if(l=n.theme_advanced_text_colors){p.colors=l}if(n.theme_advanced_default_foreground_color){p.default_color=n.theme_advanced_default_foreground_color}p.title="advanced.forecolor_desc";p.cmd="ForeColor";p.scope=this;q=m.editor.controlManager.createColorSplitButton("forecolor",p);return q},_createBackColorMenu:function(){var q,m=this,n=m.settings,p={},l;if(n.theme_advanced_more_colors){p.more_colors_func=function(){m._mceColorPicker(0,{color:q.value,func:function(o){q.setColor(o)}})}}if(l=n.theme_advanced_background_colors){p.colors=l}if(n.theme_advanced_default_background_color){p.default_color=n.theme_advanced_default_background_color}p.title="advanced.backcolor_desc";p.cmd="HiliteColor";p.scope=this;q=m.editor.controlManager.createColorSplitButton("backcolor",p);return q},renderUI:function(q){var u,r,v,y=this,w=y.editor,z=y.settings,x,m,l;if(w.settings){w.settings.aria_label=z.aria_label+w.getLang("advanced.help_shortcut")}u=m=k.create("span",{role:"application","aria-labelledby":w.id+"_voice",id:w.id+"_parent","class":"mceEditor "+w.settings.skin+"Skin"+(z.skin_variant?" "+w.settings.skin+"Skin"+y._ufirst(z.skin_variant):"")+(w.settings.directionality=="rtl"?" mceRtl":"")});k.add(u,"span",{"class":"mceVoiceLabel",style:"display:none;",id:w.id+"_voice"},z.aria_label);if(!k.boxModel){u=k.add(u,"div",{"class":"mceOldBoxModel"})}u=x=k.add(u,"table",{role:"presentation",id:w.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});u=v=k.add(u,"tbody");switch((z.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":r=y._rowLayout(z,v,q);break;case"customlayout":r=w.execCallback("theme_advanced_custom_layout",z,v,q,m);break;default:r=y._simpleLayout(z,v,q,m)}u=q.targetNode;l=x.rows;k.addClass(l[0],"mceFirst");k.addClass(l[l.length-1],"mceLast");f(k.select("tr",v),function(o){k.addClass(o.firstChild,"mceFirst");k.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(k.get(z.theme_advanced_toolbar_container)){k.get(z.theme_advanced_toolbar_container).appendChild(m)}else{k.insertAfter(m,u)}h.add(w.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){y._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return false}});if(!w.getParam("accessibility_focus")){h.add(k.add(m,"a",{href:"#"},"<!-- IE -->"),"focus",function(){tinyMCE.get(w.id).focus()})}if(z.theme_advanced_toolbar_location=="external"){q.deltaHeight=0}y.deltaHeight=q.deltaHeight;q.targetNode=null;w.onKeyDown.add(function(p,n){var s=121,o=122;if(n.altKey){if(n.keyCode===s){if(i.isWebKit){window.focus()}y.toolbarGroup.focus();return h.cancel(n)}else{if(n.keyCode===o){k.get(p.id+"_path_row").focus();return h.cancel(n)}}}});w.addShortcut("alt+0","","mceShortcuts",y);return{iframeContainer:r,editorContainer:w.id+"_parent",sizeContainer:x,deltaHeight:q.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:i.majorVersion+"."+i.minorVersion}},resizeBy:function(l,m){var n=k.get(this.editor.id+"_ifr");this.resizeTo(n.clientWidth+l,n.clientHeight+m)},resizeTo:function(l,p,n){var m=this.editor,o=this.settings,q=k.get(m.id+"_tbl"),r=k.get(m.id+"_ifr");l=Math.max(o.theme_advanced_resizing_min_width||100,l);p=Math.max(o.theme_advanced_resizing_min_height||100,p);l=Math.min(o.theme_advanced_resizing_max_width||65535,l);p=Math.min(o.theme_advanced_resizing_max_height||65535,p);k.setStyle(q,"height","");k.setStyle(r,"height",p);if(o.theme_advanced_resize_horizontal){k.setStyle(q,"width","");k.setStyle(r,"width",l);if(l<q.clientWidth){l=q.clientWidth;k.setStyle(r,"width",q.clientWidth)}}if(n&&o.theme_advanced_resizing_use_cookie){a.setHash("TinyMCE_"+m.id+"_size",{cw:l,ch:p})}},destroy:function(){var l=this.editor.id;h.clear(l+"_resize");h.clear(l+"_path_row");h.clear(l+"_external_close")},_simpleLayout:function(B,w,q,l){var A=this,x=A.editor,y=B.theme_advanced_toolbar_location,u=B.theme_advanced_statusbar_location,r,m,v,z;if(B.readonly){r=k.add(w,"tr");r=m=k.add(r,"td",{"class":"mceIframeContainer"});return m}if(y=="top"){A._addToolbars(w,q)}if(y=="external"){r=z=k.create("div",{style:"position:relative"});r=k.add(r,"div",{id:x.id+"_external","class":"mceExternalToolbar"});k.add(r,"a",{id:x.id+"_external_close",href:"javascript:;","class":"mceExternalClose"});r=k.add(r,"table",{id:x.id+"_tblext",cellSpacing:0,cellPadding:0});v=k.add(r,"tbody");if(l.firstChild.className=="mceOldBoxModel"){l.firstChild.appendChild(z)}else{l.insertBefore(z,l.firstChild)}A._addToolbars(v,q);x.onMouseUp.add(function(){var o=k.get(x.id+"_external");k.show(o);k.hide(e);var n=h.add(x.id+"_external_close","click",function(){k.hide(x.id+"_external");h.remove(x.id+"_external_close","click",n);return false});k.show(o);k.setStyle(o,"top",0-k.getRect(x.id+"_tblext").h-1);k.hide(o);k.show(o);o.style.filter="";e=x.id+"_external";o=null})}if(u=="top"){A._addStatusBar(w,q)}if(!B.theme_advanced_toolbar_container){r=k.add(w,"tr");r=m=k.add(r,"td",{"class":"mceIframeContainer"})}if(y=="bottom"){A._addToolbars(w,q)}if(u=="bottom"){A._addStatusBar(w,q)}return m},_rowLayout:function(z,r,p){var y=this,u=y.editor,x,A,l=u.controlManager,q,m,w,v;x=z.theme_advanced_containers_default_class||"";A=z.theme_advanced_containers_default_align||"center";f(d(z.theme_advanced_containers||""),function(s,o){var n=z["theme_advanced_container_"+s]||"";switch(s.toLowerCase()){case"mceeditor":q=k.add(r,"tr");q=m=k.add(q,"td",{"class":"mceIframeContainer"});break;case"mceelementpath":y._addStatusBar(r,p);break;default:v=(z["theme_advanced_container_"+s+"_align"]||A).toLowerCase();v="mce"+y._ufirst(v);q=k.add(k.add(r,"tr"),"td",{"class":"mceToolbar "+(z["theme_advanced_container_"+s+"_class"]||x)+" "+v||A});w=l.createToolbar("toolbar"+o);y._addControls(n,w);k.setHTML(q,w.renderHTML());p.deltaHeight-=z.theme_advanced_row_height}});return m},_addControls:function(m,l){var n=this,o=n.settings,p,q=n.editor.controlManager;if(o.theme_advanced_disable&&!n._disabled){p={};f(d(o.theme_advanced_disable),function(r){p[r]=1});n._disabled=p}else{p=n._disabled}f(d(m),function(s){var r;if(p&&p[s]){return}if(s=="tablecontrols"){f(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(t){t=n.createControl(t,q);if(t){l.add(t)}});return}r=n.createControl(s,q);if(r){l.add(r)}})},_addToolbars:function(A,m){var D=this,u,r,x=D.editor,E=D.settings,C,l=x.controlManager,y,p,w=[],B,z,q=false;z=l.createToolbarGroup("toolbargroup",{name:x.getLang("advanced.toolbar"),tab_focus_toolbar:x.getParam("theme_advanced_tab_focus_toolbar")});D.toolbarGroup=z;B=E.theme_advanced_toolbar_align.toLowerCase();B="mce"+D._ufirst(B);p=k.add(k.add(A,"tr",{role:"presentation"}),"td",{"class":"mceToolbar "+B,role:"toolbar"});for(u=1;(C=E["theme_advanced_buttons"+u]);u++){q=true;r=l.createToolbar("toolbar"+u,{"class":"mceToolbarRow"+u});if(E["theme_advanced_buttons"+u+"_add"]){C+=","+E["theme_advanced_buttons"+u+"_add"]}if(E["theme_advanced_buttons"+u+"_add_before"]){C=E["theme_advanced_buttons"+u+"_add_before"]+","+C}D._addControls(C,r);z.add(r);m.deltaHeight-=E.theme_advanced_row_height}if(!q){m.deltaHeight-=E.theme_advanced_row_height}w.push(z.renderHTML());w.push(k.createHTML("a",{href:"#",accesskey:"z",title:x.getLang("advanced.toolbar_focus"),onfocus:"tinyMCE.getInstanceById('"+x.id+"').focus();"},"<!-- IE -->"));k.setHTML(p,w.join(""))},_addStatusBar:function(u,m){var p,y=this,v=y.editor,z=y.settings,l,w,x,q;p=k.add(u,"tr");p=q=k.add(p,"td",{"class":"mceStatusbar"});p=k.add(p,"div",{id:v.id+"_path_row",role:"group","aria-labelledby":v.id+"_path_voice"});if(z.theme_advanced_path){k.add(p,"span",{id:v.id+"_path_voice"},v.translate("advanced.path"));k.add(p,"span",{},": ")}else{k.add(p,"span",{},"&#160;")}if(z.theme_advanced_resizing){k.add(q,"a",{id:v.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize",tabIndex:"-1"});if(z.theme_advanced_resizing_use_cookie){v.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+v.id+"_size"),r=k.get(v.id+"_tbl");if(!n){return}y.resizeTo(n.cw,n.ch)})}v.onPostRender.add(function(){h.add(v.id+"_resize","click",function(n){n.preventDefault()});h.add(v.id+"_resize","mousedown",function(G){var t,r,s,o,F,C,D,I,n,H,A;function B(J){J.preventDefault();n=D+(J.screenX-F);H=I+(J.screenY-C);y.resizeTo(n,H)}function E(J){h.remove(k.doc,"mousemove",t);h.remove(v.getDoc(),"mousemove",r);h.remove(k.doc,"mouseup",s);h.remove(v.getDoc(),"mouseup",o);n=D+(J.screenX-F);H=I+(J.screenY-C);y.resizeTo(n,H,true);v.nodeChanged()}G.preventDefault();F=G.screenX;C=G.screenY;A=k.get(y.editor.id+"_ifr");D=n=A.clientWidth;I=H=A.clientHeight;t=h.add(k.doc,"mousemove",B);r=h.add(v.getDoc(),"mousemove",B);s=h.add(k.doc,"mouseup",E);o=h.add(v.getDoc(),"mouseup",E)})})}m.deltaHeight-=21;p=u=null},_updateUndoStatus:function(m){var l=m.controlManager,n=m.undoManager;l.setDisabled("undo",!n.hasUndo()&&!n.typing);l.setDisabled("redo",!n.hasRedo())},_nodeChanged:function(u,z,I,y,J){var D=this,H,K=0,C,L,E=D.settings,B,q,A,G,r,o,m;i.each(D.stateControls,function(n){z.setActive(n,u.queryCommandState(D.controls[n][1]))});var x=function(t,n){var p,t,s=n;if(typeof(n)=="string"){s=function(v){return v.nodeName==n}}for(p=0;p<t.length;p++){if(s(t[p])){return t[p]}}};function w(n){return x(J.parents,n)}function l(n){return x([].concat(J.parents).concat([u.getBody()]),n)}z.setActive("visualaid",u.hasVisual);D._updateUndoStatus(u);z.setDisabled("outdent",!u.queryCommandState("Outdent"));H=w("A");if(L=z.get("link")){L.setDisabled((!H&&y)||(H&&!H.href));L.setActive(!!H&&(!H.name&&!H.id))}if(L=z.get("unlink")){L.setDisabled(!H&&y);L.setActive(!!H&&!H.name&&!H.id)}if(L=z.get("anchor")){L.setActive(!y&&!!H&&(H.name||(H.id&&!H.href)))}H=w("IMG");if(L=z.get("image")){L.setActive(!y&&!!H&&I.className.indexOf("mceItem")==-1)}if(L=z.get("styleselect")){D._importClasses();o=[];f(L.items,function(n){o.push(n.value)});m=u.formatter.matchAll(o);L.select(m[0]);i.each(m,function(p,n){if(n>0){L.mark(p)}})}if(L=z.get("formatselect")){H=w(u.dom.isBlock);if(H){L.select(H.nodeName.toLowerCase())}}l(function(s){var p;if(s.nodeName==="SPAN"){if(!B&&s.className){B=s.className}}p=u.dom.is(s,E.theme_advanced_font_selector);if(p||j(u.settings)){if(!q&&s.style.fontSize){q=s.style.fontSize}if(!A&&s.style.fontFamily){A=s.style.fontFamily.replace(/[\"\']+/g,"").replace(/^([^,]+).*/,"$1").toLowerCase()}if(!G&&s.style.color){G=s.style.color}if(!r&&s.style.backgroundColor){r=s.style.backgroundColor}}return false});if(L=z.get("fontselect")){L.select(function(n){return n.replace(/^([^,]+).*/,"$1").toLowerCase()==A})}if(L=z.get("fontsizeselect")){if(E.theme_advanced_runtime_fontsize&&!q&&!B){q=u.dom.getStyle(I,"fontSize",true)}L.select(function(n){if(n.fontSize&&n.fontSize===q){return true}if(n["class"]&&n["class"]===B){return true}})}if(E.theme_advanced_show_current_color){function F(p,n){if(L=z.get(p)){if(!n){n=L.settings.default_color}if(n!==L.value){L.displayColor(n)}}}F("forecolor",G);F("backcolor",r)}if(E.theme_advanced_show_current_color){function F(p,n){if(L=z.get(p)){if(!n){n=L.settings.default_color}if(n!==L.value){L.displayColor(n)}}}F("forecolor",G);F("backcolor",r)}if(E.theme_advanced_path&&E.theme_advanced_statusbar_location){H=k.get(u.id+"_path")||k.add(u.id+"_path_row","span",{id:u.id+"_path"});if(D.statusKeyboardNavigation){D.statusKeyboardNavigation.destroy();D.statusKeyboardNavigation=null}k.setHTML(H,"");w(function(M){var p=M.nodeName.toLowerCase(),s,v,t="";if(M.nodeType!=1||p==="br"||M.getAttribute("data-mce-bogus")||k.hasClass(M,"mceItemHidden")||k.hasClass(M,"mceItemRemoved")){return}if(i.isIE&&M.scopeName!=="HTML"&&M.scopeName){p=M.scopeName+":"+p}p=p.replace(/mce\:/g,"");switch(p){case"b":p="strong";break;case"i":p="em";break;case"img":if(C=k.getAttrib(M,"src")){t+="src: "+C+" "}break;case"a":if(C=k.getAttrib(M,"name")){t+="name: "+C+" ";p+="#"+C}if(C=k.getAttrib(M,"href")){t+="href: "+C+" "}break;case"font":if(C=k.getAttrib(M,"face")){t+="font: "+C+" "}if(C=k.getAttrib(M,"size")){t+="size: "+C+" "}if(C=k.getAttrib(M,"color")){t+="color: "+C+" "}break;case"span":if(C=k.getAttrib(M,"style")){t+="style: "+C+" "}break}if(C=k.getAttrib(M,"id")){t+="id: "+C+" "}if(C=M.className){C=C.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g,"");if(C){t+="class: "+C+" ";if(u.dom.isBlock(M)||p=="img"||p=="span"){p+="."+C}}}p=p.replace(/(html:)/g,"");p={name:p,node:M,title:t};D.onResolveName.dispatch(D,p);t=p.title;p=p.name;v=k.create("a",{href:"javascript:;",role:"button",onmousedown:"return false;",title:t,"class":"mcePath_"+(K++)},p);if(H.hasChildNodes()){H.insertBefore(k.create("span",{"aria-hidden":"true"},"\u00a0\u00bb "),H.firstChild);H.insertBefore(v,H.firstChild)}else{H.appendChild(v)}},u.getBody());if(k.select("a",H).length>0){D.statusKeyboardNavigation=new i.ui.KeyboardNavigation({root:u.id+"_path_row",items:k.select("a",H),excludeFromTabOrder:true,onCancel:function(){u.focus()}},k)}}},_sel:function(l){this.editor.execCommand("mceSelectNodeDepth",false,l)},_mceInsertAnchor:function(n,m){var l=this.editor;l.windowManager.open({url:this.url+"/anchor.htm",width:320+parseInt(l.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(l.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var l=this.editor;l.windowManager.open({url:this.url+"/charmap.htm",width:550+parseInt(l.getLang("advanced.charmap_delta_width",0)),height:265+parseInt(l.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var l=this.editor;l.windowManager.open({url:this.url+"/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceShortcuts:function(){var l=this.editor;l.windowManager.open({url:this.url+"/shortcuts.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(n,m){var l=this.editor;m=m||{};l.windowManager.open({url:this.url+"/color_picker.htm",width:375+parseInt(l.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(l.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:m.color,func:m.func,theme_url:this.url})},_mceCodeEditor:function(m,n){var l=this.editor;l.windowManager.open({url:this.url+"/source_editor.htm",width:parseInt(l.getParam("theme_advanced_source_editor_width",720)),height:parseInt(l.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(m,n){var l=this.editor;if(l.dom.getAttrib(l.selection.getNode(),"class","").indexOf("mceItem")!=-1){return}l.windowManager.open({url:this.url+"/image.htm",width:355+parseInt(l.getLang("advanced.image_delta_width",0)),height:275+parseInt(l.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(m,n){var l=this.editor;l.windowManager.open({url:this.url+"/link.htm",width:310+parseInt(l.getLang("advanced.link_delta_width",0)),height:200+parseInt(l.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var l=this.editor;l.windowManager.confirm("advanced.newdocument",function(m){if(m){l.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var l=this;this._mceColorPicker(0,{color:l.fgColor,func:function(m){l.fgColor=m;l.editor.execCommand("ForeColor",false,m)}})},_mceBackColor:function(){var l=this;this._mceColorPicker(0,{color:l.bgColor,func:function(m){l.bgColor=m;l.editor.execCommand("HiliteColor",false,m)}})},_ufirst:function(l){return l.substring(0,1).toUpperCase()+l.substring(1)}});i.ThemeManager.add("advanced",i.themes.AdvancedTheme)}(tinymce));