📄 tinymce.js
字号:
tinyMCE_GZ.init(
{
plugins : "safari,pagebreak,layer,table,advhr,advimage,advlink,inlinepopups,insertdatetime,media,searchreplace,contextmenu,paste,directionality,noneditable,visualchars,nonbreaking,xhtmlxtras",
themes : "advanced",
languages : "en",
disk_cache : true,
debug : false
}, function() {
tinyMCE.init(
{
mode : "none",
language : "en",
theme : "advanced",
width : "100%",
height : 350,
convert_urls: false,
relative_urls: false, // True/False选项。如果设置成true,绝对路径将被转换成相对路径。默认值为true
remove_script_host: false,
document_base_url: _BASE_URL,
verify_css_classes: false,
verify_html: false,
auto_cleanup_word: true, // 如果启用,从MS office/Word粘贴的HTML将会自动被清理。此选项默认值为false。注意:此操作当前仅支持MSIE。
accessibility_warnings: false,
plugins : "safari,pagebreak,layer,table,advhr,advimage,advlink,inlinepopups,insertdatetime,media,searchreplace,contextmenu,paste,directionality,noneditable,visualchars,nonbreaking,xhtmlxtras",
// Theme options
theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,code,|,insertdate,inserttime,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,media,advhr,|,ltr,rtl",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,pagebreak",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
tab_focus : ":prev,:next",
//content_css : _MEDIA_DIR + "css/tinymce.css",
advimage_upload_enable: true,
advimage_upload_title: "Upload File",
advimage_upload_form: _ADMIN_DIR + "tinymce/form"
}
);
}
);
/**
* 动态装载 tinyMCE 编辑器
*/
$.fn.tinymce = function()
{
var button;
this.each(function() {
button = "<br /><a href=\"javascript:toggleEditor('"
+ this.id + "');\">Add/Remove editor</a>";
$(this).after(button);
});
};
function toggleEditor(id)
{
if (!tinyMCE.get(id))
{
$(document.getElementById(id))
.parents("div.qform-input-part:eq(0)").css({float: "none"});
tinyMCE.execCommand("mceAddControl", false, id);
}
else
{
$(document.getElementById(id))
.parents("div.qform-input-part:eq(0)").css({float: "right"});
tinyMCE.execCommand("mceRemoveControl", false, id);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -