📄 editor_template.js
字号:
(function(n){var o=n.DOM,i=n.dom.Event,k=n.extend,m=n.each,j=n.util.Cookie,l,p=n.explode;n.ThemeManager.requireLangPack("advanced");n.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(d,c){var b=this,a,e,f;b.editor=d;b.url=c;b.onResolveName=new n.util.Dispatcher(this);b.settings=a=k({theme_advanced_path:true,theme_advanced_toolbar_location:"bottom",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",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;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",readonly:d.settings.readonly},d.settings);if(!a.font_size_style_values){a.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(n.is(a.theme_advanced_font_sizes,"string")){a.font_size_style_values=n.explode(a.font_size_style_values);a.font_size_classes=n.explode(a.font_size_classes||"");f={};d.settings.theme_advanced_font_sizes=a.theme_advanced_font_sizes;m(d.getParam("theme_advanced_font_sizes","","hash"),function(g,h){var r;if(h==g&&g>=1&&g<=7){h=g+" ("+b.sizes[g-1]+"pt)";if(d.settings.convert_fonts_to_spans){r=a.font_size_classes[g-1];g=a.font_size_style_values[g-1]||(b.sizes[g-1]+"pt")}}if(/^\s*\./.test(g)){r=g.replace(/\./g,"")}f[h]=r?{"class":r}:{fontSize:g}});a.theme_advanced_font_sizes=f}if((e=a.theme_advanced_path_location)&&e!="none"){a.theme_advanced_statusbar_location=a.theme_advanced_path_location}if(a.theme_advanced_statusbar_location=="none"){a.theme_advanced_statusbar_location=0}d.onInit.add(function(){d.onNodeChange.add(b._nodeChanged,b);if(d.settings.content_css!==false){d.dom.loadCSS(d.baseURI.toAbsolute("themes/advanced/skins/"+d.settings.skin+"/content.css"))}});d.onSetProgressState.add(function(v,x,u){var h,g=v.id,w;if(x){b.progressTimer=setTimeout(function(){h=v.getContainer();h=h.insertBefore(o.create("DIV",{style:"position:relative"}),h.firstChild);w=o.get(v.id+"_tbl");o.add(h,"div",{id:g+"_blocker","class":"mceBlocker",style:{width:w.clientWidth+2,height:w.clientHeight+2}});o.add(h,"div",{id:g+"_progress","class":"mceProgress",style:{left:w.clientWidth/2,top:w.clientHeight/2}})},u||0)}else{o.remove(g+"_blocker");o.remove(g+"_progress");clearTimeout(b.progressTimer)}});o.loadCSS(a.editor_css?d.documentBaseURI.toAbsolute(a.editor_css):c+"/skins/"+d.settings.skin+"/ui.css");if(a.skin_variant){o.loadCSS(c+"/skins/"+d.settings.skin+"/ui_"+a.skin_variant+".css")}},createControl:function(a,d){var c,b;if(b=d.createControl(a)){return b}switch(a){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((c=this.controls[a])){return d.createButton(a,{title:"advanced."+c[0],cmd:c[1],ui:c[2],value:c[3]})}},execCommand:function(b,c,a){var d=this["_"+b];if(d){d.call(this,c,a);return true}return false},_importClasses:function(b){var c=this.editor,a=c.controlManager.get("styleselect");if(a.getLength()==0){m(c.dom.getClasses(),function(d){a.add(d["class"],d["class"])})}},_createStyleSelect:function(a){var d=this,e=d.editor,c=e.controlManager,b=c.createListBox("styleselect",{title:"advanced.style_select",onselect:function(f){if(b.selectedValue===f){e.execCommand("mceSetStyleInfo",0,{command:"removeformat"});b.select();return false}else{e.execCommand("mceSetCSSClass",0,f)}}});if(b){m(e.getParam("theme_advanced_styles","","hash"),function(f,g){if(f){b.add(d.editor.translate(g),f)}});b.onPostRender.add(function(g,f){if(!b.NativeListBox){i.add(f.id+"_text","focus",d._importClasses,d);i.add(f.id+"_text","mousedown",d._importClasses,d);i.add(f.id+"_open","focus",d._importClasses,d);i.add(f.id+"_open","mousedown",d._importClasses,d)}else{i.add(f.id,"focus",d._importClasses,d)}})}return b},_createFontSelect:function(){var a,b=this,c=b.editor;a=c.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",cmd:"FontName"});if(a){m(c.getParam("theme_advanced_fonts",b.settings.theme_advanced_fonts,"hash"),function(d,e){a.add(c.translate(e),d,{style:d.indexOf("dings")==-1?"font-family:"+d:""})})}return a},_createFontSizeSelect:function(){var a=this,c=a.editor,e,b=0,d=[];e=c.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(f){if(f.fontSize){c.execCommand("FontSize",false,f.fontSize)}else{m(a.settings.theme_advanced_font_sizes,function(g,h){if(g["class"]){d.push(g["class"])}});c.editorCommands._applyInlineStyle("span",{"class":f["class"]},{check_classes:d})}}});if(e){m(a.settings.theme_advanced_font_sizes,function(h,f){var g=h.fontSize;if(g>=1&&g<=7){g=a.sizes[parseInt(g)-1]+"pt"}e.add(f,h,{style:"font-size:"+g,"class":"mceFontSize"+(b++)+(" "+(h["class"]||""))})})}return e},_createBlockFormats:function(){var a,c={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"},b=this;a=b.editor.controlManager.createListBox("formatselect",{title:"advanced.block",cmd:"FormatBlock"});if(a){m(b.editor.getParam("theme_advanced_blockformats",b.settings.theme_advanced_blockformats,"hash"),function(d,e){a.add(b.editor.translate(e!=d?e:c[d]),d,{"class":"mce_formatPreview mce_"+d})})}return a},_createForeColorMenu:function(){var a,d=this,c=d.settings,b={},e;if(c.theme_advanced_more_colors){b.more_colors_func=function(){d._mceColorPicker(0,{color:a.value,func:function(f){a.setColor(f)}})}}if(e=c.theme_advanced_text_colors){b.colors=e}if(c.theme_advanced_default_foreground_color){b.default_color=c.theme_advanced_default_foreground_color}b.title="advanced.forecolor_desc";b.cmd="ForeColor";b.scope=this;a=d.editor.controlManager.createColorSplitButton("forecolor",b);return a},_createBackColorMenu:function(){var a,d=this,c=d.settings,b={},e;if(c.theme_advanced_more_colors){b.more_colors_func=function(){d._mceColorPicker(0,{color:a.value,func:function(f){a.setColor(f)}})}}if(e=c.theme_advanced_background_colors){b.colors=e}if(c.theme_advanced_default_background_color){b.default_color=c.theme_advanced_default_background_color}b.title="advanced.backcolor_desc";b.cmd="HiliteColor";b.scope=this;a=d.editor.controlManager.createColorSplitButton("backcolor",b);return a},renderUI:function(e){var c,d,b,s=this,a=s.editor,h=s.settings,t,f,g;c=f=o.create("span",{id:a.id+"_parent","class":"mceEditor "+a.settings.skin+"Skin"+(h.skin_variant?" "+a.settings.skin+"Skin"+s._ufirst(h.skin_variant):"")});if(!o.boxModel){c=o.add(c,"div",{"class":"mceOldBoxModel"})}c=t=o.add(c,"table",{id:a.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});c=b=o.add(c,"tbody");switch((h.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":d=s._rowLayout(h,b,e);break;case"customlayout":d=a.execCallback("theme_advanced_custom_layout",h,b,e,f);break;default:d=s._simpleLayout(h,b,e,f)}c=e.targetNode;g=o.stdMode?t.getElementsByTagName("tr"):t.rows;o.addClass(g[0],"mceFirst");o.addClass(g[g.length-1],"mceLast");m(o.select("tr",b),function(q){o.addClass(q.firstChild,"mceFirst");o.addClass(q.childNodes[q.childNodes.length-1],"mceLast")});if(o.get(h.theme_advanced_toolbar_container)){o.get(h.theme_advanced_toolbar_container).appendChild(f)}else{o.insertAfter(f,c)}i.add(a.id+"_path_row","click",function(q){q=q.target;if(q.nodeName=="A"){s._sel(q.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return i.cancel(q)}});if(!a.getParam("accessibility_focus")){i.add(o.add(f,"a",{href:"#"},"<!-- IE -->"),"focus",function(){tinyMCE.get(a.id).focus()})}if(h.theme_advanced_toolbar_location=="external"){e.deltaHeight=0}s.deltaHeight=e.deltaHeight;e.targetNode=null;return{iframeContainer:d,editorContainer:a.id+"_parent",sizeContainer:t,deltaHeight:e.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:n.majorVersion+"."+n.minorVersion}},resizeBy:function(c,b){var a=o.get(this.editor.id+"_tbl");this.resizeTo(a.clientWidth+c,a.clientHeight+b)},resizeTo:function(e,b){var d=this.editor,c=d.settings,g=o.get(d.id+"_tbl"),f=o.get(d.id+"_ifr"),a;e=Math.max(c.theme_advanced_resizing_min_width||100,e);b=Math.max(c.theme_advanced_resizing_min_height||100,b);e=Math.min(c.theme_advanced_resizing_max_width||65535,e);b=Math.min(c.theme_advanced_resizing_max_height||65535,b);a=g.clientHeight-f.clientHeight;o.setStyle(f,"height",b-a);o.setStyles(g,{width:e,height:b})},destroy:function(){var a=this.editor.id;i.clear(a+"_resize");i.clear(a+"_path_row");i.clear(a+"_external_close")},_simpleLayout:function(h,a,e,g){var s=this,A=s.editor,z=h.theme_advanced_toolbar_location,c=h.theme_advanced_statusbar_location,d,f,b,t;if(h.readonly){d=o.add(a,"tr");d=f=o.add(d,"td",{"class":"mceIframeContainer"});return f}if(z=="top"){s._addToolbars(a,e)}if(z=="external"){d=t=o.create("div",{style:"position:relative"});d=o.add(d,"div",{id:A.id+"_external","class":"mceExternalToolbar"});o.add(d,"a",{id:A.id+"_external_close",href:"javascript:;","class":"mceExternalClose"});d=o.add(d,"table",{id:A.id+"_tblext",cellSpacing:0,cellPadding:0});b=o.add(d,"tbody");if(g.firstChild.className=="mceOldBoxModel"){g.firstChild.appendChild(t)}else{g.insertBefore(t,g.firstChild)}s._addToolbars(b,e);A.onMouseUp.add(function(){var q=o.get(A.id+"_external");o.show(q);o.hide(l);var r=i.add(A.id+"_external_close","click",function(){o.hide(A.id+"_external");i.remove(A.id+"_external_close","click",r)});o.show(q);o.setStyle(q,"top",0-o.getRect(A.id+"_tblext").h-1);o.hide(q);o.show(q);q.style.filter="";l=A.id+"_external";q=null})}if(c=="top"){s._addStatusBar(a,e)}if(!h.theme_advanced_toolbar_container){d=o.add(a,"tr");d=f=o.add(d,"td",{"class":"mceIframeContainer"})}if(z=="bottom"){s._addToolbars(a,e)}if(c=="bottom"){s._addStatusBar(a,e)}return f},_rowLayout:function(t,d,f){var y=this,c=y.editor,z,s,h=c.controlManager,e,g,a,b;z=t.theme_advanced_containers_default_class||"";s=t.theme_advanced_containers_default_align||"center";m(p(t.theme_advanced_containers||""),function(q,r){var u=t["theme_advanced_container_"+q]||"";switch(u.toLowerCase()){case"mceeditor":e=o.add(d,"tr");e=g=o.add(e,"td",{"class":"mceIframeContainer"});break;case"mceelementpath":y._addStatusBar(d,f);break;default:b=(t["theme_advanced_container_"+q+"_align"]||s).toLowerCase();b="mce"+y._ufirst(b);e=o.add(o.add(d,"tr"),"td",{"class":"mceToolbar "+(t["theme_advanced_container_"+q+"_class"]||z)+" "+b||s});a=h.createToolbar("toolbar"+r);y._addControls(u,a);o.setHTML(e,a.renderHTML());f.deltaHeight-=t.theme_advanced_row_height}});return g},_addControls:function(d,e){var c=this,b=c.settings,a,f=c.editor.controlManager;if(b.theme_advanced_disable&&!c._disabled){a={};m(p(b.theme_advanced_disable),function(g){a[g]=1});c._disabled=a}else{a=c._disabled}m(p(d),function(g){var h;if(a&&a[g]){return}if(g=="tablecontrols"){m(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(r){r=c.createControl(r,f);if(r){e.add(r)}});return}h=c.createControl(g,f);if(h){e.add(h)}})},_addToolbars:function(B,g){var s=this,c,e,a=s.editor,d=s.settings,t,h=a.controlManager,C,f,b=[],v;v=d.theme_advanced_toolbar_align.toLowerCase();v="mce"+s._ufirst(v);f=o.add(o.add(B,"tr"),"td",{"class":"mceToolbar "+v});if(!a.getParam("accessibility_focus")){b.push(o.createHTML("a",{href:"#",onfocus:"tinyMCE.get('"+a.id+"').focus();"},"<!-- IE -->"))}b.push(o.createHTML("a",{href:"#",accesskey:"q",title:a.getLang("advanced.toolbar_focus")},"<!-- IE -->"));for(c=1;(t=d["theme_advanced_buttons"+c]);c++){e=h.createToolbar("toolbar"+c,{"class":"mceToolbarRow"+c});if(d["theme_advanced_buttons"+c+"_add"]){t+=","+d["theme_advanced_buttons"+c+"_add"]}if(d["theme_advanced_buttons"+c+"_add_before"]){t=d["theme_advanced_buttons"+c+"_add_before"]+","+t}s._addControls(t,e);b.push(e.renderHTML());g.deltaHeight-=d.theme_advanced_row_height}b.push(o.createHTML("a",{href:"#",accesskey:"z",title:a.getLang("advanced.toolbar_focus"),onfocus:"tinyMCE.getInstanceById('"+a.id+"').focus();"},"<!-- IE -->"));o.setHTML(f,b.join(""))},_addStatusBar:function(c,f){var e,r=this,b=r.editor,h=r.settings,g,a,s,d;e=o.add(c,"tr");e=d=o.add(e,"td",{"class":"mceStatusbar"});e=o.add(e,"div",{id:b.id+"_path_row"},h.theme_advanced_path?b.translate("advanced.path")+": ":" ");o.add(e,"a",{href:"#",accesskey:"x"});if(h.theme_advanced_resizing){o.add(d,"a",{id:b.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize"});if(h.theme_advanced_resizing_use_cookie){b.onPostRender.add(function(){var t=j.getHash("TinyMCE_"+b.id+"_size"),q=o.get(b.id+"_tbl");if(!t){return}if(h.theme_advanced_resize_horizontal){q.style.width=Math.max(10,t.cw)+"px"}q.style.height=Math.max(10,t.ch)+"px";o.get(b.id+"_ifr").style.height=Math.max(10,parseInt(t.ch)+r.deltaHeight)+"px"})}b.onPostRender.add(function(){i.add(b.id+"_resize","mousedown",function(q){var B,u,A,v,C,w;B=o.get(b.id+"_tbl");A=B.clientWidth;v=B.clientHeight;miw=h.theme_advanced_resizing_min_width||100;mih=h.theme_advanced_resizing_min_height||100;maw=h.theme_advanced_resizing_max_width||65535;mah=h.theme_advanced_resizing_max_height||65535;u=o.add(o.get(b.id+"_parent"),"div",{"class":"mcePlaceHolder"});o.setStyles(u,{width:A,height:v});o.hide(B);o.show(u);g={x:q.screenX,y:q.screenY,w:A,h:v,dx:null,dy:null};a=i.add(o.doc,"mousemove",function(y){var x,t;g.dx=y.screenX-g.x;g.dy=y.screenY-g.y;x=Math.max(miw,g.w+g.dx);t=Math.max(mih,g.h+g.dy);x=Math.min(maw,x);t=Math.min(mah,t);if(h.theme_advanced_resize_horizontal){u.style.width=x+"px"}u.style.height=t+"px";return i.cancel(y)});s=i.add(o.doc,"mouseup",function(x){var t;i.remove(o.doc,"mousemove",a);i.remove(o.doc,"mouseup",s);B.style.display="";o.remove(u);if(g.dx===null){return}t=o.get(b.id+"_ifr");if(h.theme_advanced_resize_horizontal){B.style.width=Math.max(10,g.w+g.dx)+"px"}B.style.height=Math.max(10,g.h+g.dy)+"px";t.style.height=Math.max(10,t.clientHeight+g.dy)+"px";if(h.theme_advanced_resizing_use_cookie){j.setHash("TinyMCE_"+b.id+"_size",{cw:g.w+g.dx,ch:g.h+g.dy})}});return i.cancel(q)})})}f.deltaHeight-=21;e=c=null},_nodeChanged:function(e,B,f,b){var t=this,h,a=0,v,d,s=t.settings,A,g,c;if(s.readonly){return}n.each(t.stateControls,function(q){B.setActive(q,e.queryCommandState(t.controls[q][1]))});B.setActive("visualaid",e.hasVisual);B.setDisabled("undo",!e.undoManager.hasUndo()&&!e.typing);B.setDisabled("redo",!e.undoManager.hasRedo());B.setDisabled("outdent",!e.queryCommandState("Outdent"));h=o.getParent(f,"A");if(d=B.get("link")){if(!h||!h.name){d.setDisabled(!h&&b);d.setActive(!!h)}}if(d=B.get("unlink")){d.setDisabled(!h&&b);d.setActive(!!h&&!h.name)}if(d=B.get("anchor")){d.setActive(!!h&&h.name);if(n.isWebKit){h=o.getParent(f,"IMG");d.setActive(!!h&&o.getAttrib(h,"mce_name")=="a")}}h=o.getParent(f,"IMG");if(d=B.get("image")){d.setActive(!!h&&f.className.indexOf("mceItem")==-1)}if(d=B.get("styleselect")){if(f.className){t._importClasses();d.select(f.className)}else{d.select()}}if(d=B.get("formatselect")){h=o.getParent(f,o.isBlock);if(h){d.select(h.nodeName.toLowerCase())}}if(e.settings.convert_fonts_to_spans){e.dom.getParent(f,function(q){if(q.nodeName==="SPAN"){if(!A&&q.className){A=q.className}if(!g&&q.style.fontSize){g=q.style.fontSize}if(!c&&q.style.fontFamily){c=q.style.fontFamily.replace(/[\"\']+/g,"").replace(/^([^,]+).*/,"$1").toLowerCase()}}return false});if(d=B.get("fontselect")){d.select(function(q){return q.replace(/^([^,]+).*/,"$1").toLowerCase()==c})}if(d=B.get("fontsizeselect")){d.select(function(q){if(q.fontSize&&q.fontSize===g){return true}if(q["class"]&&q["class"]===A){return true}})}}else{if(d=B.get("fontselect")){d.select(e.queryCommandValue("FontName"))}if(d=B.get("fontsizeselect")){v=e.queryCommandValue("FontSize");d.select(function(q){return q.fontSize==v})}}if(s.theme_advanced_path&&s.theme_advanced_statusbar_location){h=o.get(e.id+"_path")||o.add(e.id+"_path_row","span",{id:e.id+"_path"});o.setHTML(h,"");e.dom.getParent(f,function(q){var x=q.nodeName.toLowerCase(),w,r,u="";if(q.nodeType!=1||q.nodeName==="BR"||(o.hasClass(q,"mceItemHidden")||o.hasClass(q,"mceItemRemoved"))){return}if(v=o.getAttrib(q,"mce_name")){x=v}if(n.isIE&&q.scopeName!=="HTML"){x=q.scopeName+":"+x}x=x.replace(/mce\:/g,"");switch(x){case"b":x="strong";break;case"i":x="em";break;case"img":if(v=o.getAttrib(q,"src")){u+="src: "+v+" "}break;case"a":if(v=o.getAttrib(q,"name")){u+="name: "+v+" ";x+="#"+v}if(v=o.getAttrib(q,"href")){u+="href: "+v+" "}break;case"font":if(s.convert_fonts_to_spans){x="span"}if(v=o.getAttrib(q,"face")){u+="font: "+v+" "}if(v=o.getAttrib(q,"size")){u+="size: "+v+" "}if(v=o.getAttrib(q,"color")){u+="color: "+v+" "}break;case"span":if(v=o.getAttrib(q,"style")){u+="style: "+v+" "}break}if(v=o.getAttrib(q,"id")){u+="id: "+v+" "}if(v=q.className){v=v.replace(/(webkit-[\w\-]+|Apple-[\w\-]+|mceItem\w+|mceVisualAid)/g,"");if(v&&v.indexOf("mceItem")==-1){u+="class: "+v+" ";if(o.isBlock(q)||x=="img"||x=="span"){x+="."+v}}}x=x.replace(/(html:)/g,"");x={name:x,node:q,title:u};t.onResolveName.dispatch(t,x);u=x.title;x=x.name;r=o.create("a",{href:"javascript:;",onmousedown:"return false;",title:u,"class":"mcePath_"+(a++)},x);if(h.hasChildNodes()){h.insertBefore(o.doc.createTextNode(" \u00bb "),h.firstChild);h.insertBefore(r,h.firstChild)}else{h.appendChild(r)}},e.getBody())}},_sel:function(a){this.editor.execCommand("mceSelectNodeDepth",false,a)},_mceInsertAnchor:function(a,b){var c=this.editor;c.windowManager.open({url:n.baseURL+"/themes/advanced/anchor.htm",width:320+parseInt(c.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(c.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var a=this.editor;a.windowManager.open({url:n.baseURL+"/themes/advanced/charmap.htm",width:550+parseInt(a.getLang("advanced.charmap_delta_width",0)),height:250+parseInt(a.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var a=this.editor;a.windowManager.open({url:n.baseURL+"/themes/advanced/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(a,b){var c=this.editor;b=b||{};c.windowManager.open({url:n.baseURL+"/themes/advanced/color_picker.htm",width:375+parseInt(c.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(c.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:b.color,func:b.func,theme_url:this.url})},_mceCodeEditor:function(b,a){var c=this.editor;c.windowManager.open({url:n.baseURL+"/themes/advanced/source_editor.htm",width:parseInt(c.getParam("theme_advanced_source_editor_width",720)),height:parseInt(c.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(b,a){var c=this.editor;if(c.dom.getAttrib(c.selection.getNode(),"class").indexOf("mceItem")!=-1){return}c.windowManager.open({url:n.baseURL+"/themes/advanced/image.htm",width:355+parseInt(c.getLang("advanced.image_delta_width",0)),height:275+parseInt(c.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(b,a){var c=this.editor;c.windowManager.open({url:n.baseURL+"/themes/advanced/link.htm",width:310+parseInt(c.getLang("advanced.link_delta_width",0)),height:200+parseInt(c.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var a=this.editor;a.windowManager.confirm("advanced.newdocument",function(b){if(b){a.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var a=this;this._mceColorPicker(0,{color:a.fgColor,func:function(b){a.fgColor=b;a.editor.execCommand("ForeColor",false,b)}})},_mceBackColor:function(){var a=this;this._mceColorPicker(0,{color:a.bgColor,func:function(b){a.bgColor=b;a.editor.execCommand("HiliteColor",false,b)}})},_ufirst:function(a){return a.substring(0,1).toUpperCase()+a.substring(1)}});n.ThemeManager.add("advanced",n.themes.AdvancedTheme)}(tinymce));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -