TinyMCE
官网:
官网 The Most Advanced WYSIWYG HTML Editor | Trusted Rich Text Editor | TinyMCE
中文文档 TinyMCE中文文档中文手册 (ax-z.cn)
github: Tiny (github.com)
其他资料
TinyMCE源码分析 static/js/tinymce at master · xunhanliu/static (github.com)
TinyMCE可执行命令Commands命令预览:
Commands Available for TinyMCE | Docs | TinyMCE
Command | Value | Description |
backcolor | A color code. | This command will set the background color of the document. 此命令将设置文档的背景颜色。 |
bold | If there is no selection, the insertion point will set bold for subsequently typed characters. If there is a selection and all of the characters are already bold, the bold will be removed. Otherwise, all selected characters will become bold. | |
contentReadOnly | This command will make the editor readonly(true)or editable(false). Anticipated usage is for temporarily disabling input while something else is occurring elsewhere in the web page. 此命令将使编辑器为readonly(true)或editable(false)。 预期的用法是在网页中其他地方发生其他情况时暂时禁用输入。 | |
copy | If there is a selection, this command will copy the selection to the clipboard. If there isn't a selection, nothing will happen. note: this command won't work without setting a pref or using signed JS. See: more about security preferences note: the shortcut key will automatically trigger this command (typically accel-C) with or without the signed JS or any code on the page to handle it. 如果有选择,此命令会将选择复制到剪贴板。 如果没有选择,则什么也不会发生。 注意:如果不设置首选项或使用签名的JS,此命令将不起作用。 请参阅:有关安全性首选项的更多信息 注意:无论是否带有签名的JS或页面上用于处理它的任何代码,快捷键都会自动触发此命令(通常为accel-C)。 | |
createlink | A URI. | This command will not do anything if no selection is made. If there is a selection, a link will be inserted around the selection with the url parameter as the href of the link. 如果没有选择,此命令将不执行任何操作。 如果存在选择,则将在选择周围插入一个链接,并使用url参数作为链接的href。 |
cut | If there is a selection, this command will copy the selection to the clipboard and remove the selection from the edit control. If there isn't a selection, nothing will happen. note: this command won't work without setting a pref or using signed JS. See: more about security preferences note: the shortcut key will automatically trigger this command (typically accel-X) with or without the signed JS or any code on the page to handle it. | |
decreasefontsize | This command will add a <small> tag around selection or at insertion point. | |
delete | This command will delete all text and objects that are selected. If no text is selected it deletes one character to the right. This is similar to the Delete button on the keyboard. | |
fontname | A font name | This command will set the font face for a selection or at the insertion point if there is no selection. The given string is such as would be used in the "face" attribute of the font tag, i.e., a comma-separated list of font names. |
fontsize | A number | This command will set the fontsize for a selection or at the insertion point if there is no selection. The given number is such as would be used in the "size" attribute of the font tag. |
forecolor | A color code | This command will set the text color of the selection or at the insertion point. |
formatblock | H1, H2, H3, H4, H5, H6, P, DIV, ADDRESS, BLOCKQUOTE (more?) | The selection surrounded by the given block element. |
heading | H1, H2, H3, H4, H5, H6 | Selected block will be formatted as the given type of heading. |
hilitecolor | A color code | This command will set the hilite color of the selection or at the insertion point. It only works with styleWithCSS enabled. |
increasefontsize | This command will add a <big> tag around selection or at insertion point. | |
indent | Indent the block where the caret is located. If the caret is inside a list, that item becomes a sub-item one level deeper. | |
insertbronreturn | true/false | Selects whether pressing return inside a paragraph creates another paragraph or just inserts a <br> tag. |
inserthorizontalrule | null/string (when string is the Line's id) | This command will insert a horizontal rule (line) at the insertion point. Does it delete the selection? Yes! |
inserthtml | A string. | This command will insert the given html into the <body> in place of the current selection or at the caret location. The given string is the HTML to insert. |
insertimage | A URI. | This command will insert an image (referenced by the given url) at the insertion point. |
insertorderedlist | Depends on the selection. If the caret is not inside a non-LI block, that block becomes the first LI and an OL. If the caret is inside a bulleted item, the bulleted item becomes a numbered item. | |
insertunorderedlist | Depends on the selection. If the caret is not inside a non-LI block, that block becomes the first LI and UL. If the caret is inside a numbered item, the numbered item becomes a bulleted item. | |
insertparagraph | Inserts a new paragraph. | |
italic | If there is no selection, the insertion point will set italic for subsequently typed characters. If there is a selection and all of the characters are already italic, the italic will be removed. Otherwise, all selected characters will become italic. | |
justifycenter | Center-aligns the current block. | |
justifyfull | Fully-justifies the current block. | |
justifyleft | Left-aligns the current block. | |
justifyright | Right aligns the current block. | |
outdent | Outdent the block where the caret is located. If the block is not indented prior to calling outdent, nothing will happen. If the caret is in a list item, the item will bump up a level in the list or break out of the list entirely. | |
paste | This command will paste the contents of the clipboard at the location of the caret. If there is a selection, it will be deleted prior to the insertion of the clipboard's contents. note: this command won't work without setting a pref or using signed JS. user_pref("capability.policy.policynames", "allowclipboard"); user_pref("capability.policy.allowclipboard.Clipboard.paste", "allAccess"); See: more about security preferences note: the shortcut key will automatically trigger this command (typically accel-V) with or without the signed JS or any code on the page to handle it. | |
redo | This command will redo the previous undo action. If undo was not the most recent action, this command will have no effect. note: the shortcut key will automatically trigger this command (typically accel-shift-Z) | |
removeformat | Removes inline formatting from the current selection. | |
selectall | This command will select all of the contents within the editable area. note: the shortcut key will automatically trigger this command (typically accel-A) | |
strikethrough | If there is no selection, the insertion point will set strikethrough for subsequently typed characters. If there is a selection and all of the characters are already striked, the strikethrough will be removed. Otherwise, all selected characters will have a line drawn through them. | |
styleWithCSS | This command is used for toggling the format of generated content. By default (at least today), this is true. An example of the differences is that the "bold" command will generate <b> if the styleWithCSS command is false and generate css style attribute if the styleWithCSS command is true. | |
subscript | If there is no selection, the insertion point will set subscript for subsequently typed characters. If there is a selection and all of the characters are already subscripted, the subscript will be removed. Otherwise, all selected characters will be drawn slightly lower than normal text. | |
superscript | If there is no selection, the insertion point will set superscript for subsequently typed characters. If there is a selection and all of the characters are already superscripted, the superscript will be removed. Otherwise, all selected characters will be drawn slightly higher than normal text. | |
underline | If there is no selection, the insertion point will set underline for subsequently typed characters. If there is a selection and all of the characters are already underlined, the underline will be removed. Otherwise, all selected characters will become underlined. | |
undo | This command will undo the previous action. If no action has occurred in the document, then this command will have no effect. note: the shortcut key will automatically trigger this command (typically accel-Z) | |
unlink | If the insertion point is within a link or if the current selection contains a link, the link will be removed and the text will remain. | |
Deprecated | ||
readonly | This command has been replaced with contentReadOnly. It takes the same values as contentReadOnly, but the meaning of true and false are inversed. | |
useCSS | This command has been replaced with styleWithCSS. It takes the same values as styleWithCSS, but the meaning of true and false are inversed. |