editor i18n
This commit is contained in:
@ -902,6 +902,7 @@ var sharedUserInfos = json({{.sharedUserInfos}});
|
||||
var notes = json({{.notes}});
|
||||
var noteContentJson = json({{.noteContentJson}});
|
||||
var tagsJson = json({{.tagsJson}});
|
||||
LEA.locale = "{{.locale}}";
|
||||
</script>
|
||||
|
||||
<!-- 渲染view -->
|
||||
|
@ -902,6 +902,7 @@ var sharedUserInfos = json({{.sharedUserInfos}});
|
||||
var notes = json({{.notes}});
|
||||
var noteContentJson = json({{.noteContentJson}});
|
||||
var tagsJson = json({{.tagsJson}});
|
||||
LEA.locale = "{{.locale}}";
|
||||
</script>
|
||||
|
||||
<!-- 渲染view -->
|
||||
|
2
public/js/app/page-min.js
vendored
2
public/js/app/page-min.js
vendored
File diff suppressed because one or more lines are too long
@ -186,7 +186,7 @@ $(function() {
|
||||
// parentHeight: $("#content").height(),
|
||||
content_css : ["css/bootstrap.css", "css/editor.css"],
|
||||
skin : "custom",
|
||||
language: "zh_CN",
|
||||
language: LEA.locale, // 语言
|
||||
plugins : [
|
||||
"autolink link leanote_image lists charmap hr", "paste",
|
||||
"searchreplace leanote_nav leanote_code tabfocus",
|
||||
|
179
public/tinymce/langs/en.js
Normal file
179
public/tinymce/langs/en.js
Normal file
@ -0,0 +1,179 @@
|
||||
tinymce.addI18n('en',{
|
||||
"Cut": "Cut",
|
||||
"Header 2": "Header 2",
|
||||
"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.",
|
||||
"Div": "Div",
|
||||
"Paste": "Paste",
|
||||
"Close": "Close",
|
||||
"Font Family": "Font Family",
|
||||
"Pre": "Pre",
|
||||
"Align right": "Align right",
|
||||
"New document": "New document",
|
||||
"Blockquote": "Blockquote",
|
||||
"Numbered list": "Numbered list",
|
||||
"Increase indent": "Increase indent",
|
||||
"Formats": "Formats",
|
||||
"Headers": "Headers",
|
||||
"Select all": "Select all",
|
||||
"Header 3": "Header 3",
|
||||
"Blocks": "Blocks",
|
||||
"Undo": "Undo",
|
||||
"Strikethrough": "Strike-through",
|
||||
"Bullet list": "Bullet list",
|
||||
"Header 1": "Header 1",
|
||||
"Superscript": "Superscript",
|
||||
"Clear formatting": "Clear formatting",
|
||||
"Font Sizes": "Font Sizes",
|
||||
"Subscript": "Subscript",
|
||||
"Header 6": "Header 6",
|
||||
"Redo": "Redo",
|
||||
"Paragraph": "Paragraph",
|
||||
"Ok": "Ok",
|
||||
"Bold": "Bold",
|
||||
"Code": "Code",
|
||||
"Italic": "Italic",
|
||||
"Align center": "Align centre",
|
||||
"Header 5": "Header 5",
|
||||
"Decrease indent": "Decrease indent",
|
||||
"Header 4": "Header 4",
|
||||
"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.",
|
||||
"Underline": "Underline",
|
||||
"Cancel": "Cancel",
|
||||
"Justify": "Justify",
|
||||
"Inline": "Inline",
|
||||
"Copy": "Copy",
|
||||
"Align left": "Align left",
|
||||
"Visual aids": "Visual aids",
|
||||
"Lower Greek": "Lower Greek",
|
||||
"Square": "Square",
|
||||
"Default": "Default",
|
||||
"Lower Alpha": "Lower Alpha",
|
||||
"Circle": "Circle",
|
||||
"Disc": "Disc",
|
||||
"Upper Alpha": "Upper Alpha",
|
||||
"Upper Roman": "Upper Roman",
|
||||
"Lower Roman": "Lower Roman",
|
||||
"Name": "Name",
|
||||
"Anchor": "Anchor",
|
||||
"You have unsaved changes are you sure you want to navigate away?": "You have unsaved changes are you sure you want to navigate away?",
|
||||
"Restore last draft": "Restore last draft",
|
||||
"Special character": "Special character",
|
||||
"Source code": "Source code",
|
||||
"Right to left": "Right to left",
|
||||
"Left to right": "Left to right",
|
||||
"Emoticons": "Emoticons",
|
||||
"Robots": "Robots",
|
||||
"Document properties": "Document properties",
|
||||
"Title": "Title",
|
||||
"Keywords": "Keywords",
|
||||
"Encoding": "Encoding",
|
||||
"Description": "Description",
|
||||
"Author": "Author",
|
||||
"Fullscreen": "Full-screen",
|
||||
"Horizontal line": "Horizontal line",
|
||||
"Horizontal space": "Horizontal space",
|
||||
"Insert\/edit image": "Insert\/edit image",
|
||||
"General": "General",
|
||||
"Advanced": "Advanced",
|
||||
"Source": "Source",
|
||||
"Border": "Border",
|
||||
"Constrain proportions": "Constrain proportions",
|
||||
"Vertical space": "Vertical space",
|
||||
"Image description": "Image description",
|
||||
"Style": "Style",
|
||||
"Dimensions": "Dimensions",
|
||||
"Insert image": "Insert image",
|
||||
"Insert date\/time": "Insert date\/time",
|
||||
"Remove link": "Remove link",
|
||||
"Url": "URL",
|
||||
"Text to display": "Text to display",
|
||||
"Anchors": "Anchors",
|
||||
"Insert link": "Insert link",
|
||||
"New window": "New window",
|
||||
"None": "None",
|
||||
"The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?": "The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?",
|
||||
"Target": "Target",
|
||||
"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",
|
||||
"Insert\/edit link": "Insert\/edit link",
|
||||
"Insert\/edit video": "Insert\/edit video",
|
||||
"Poster": "Poster",
|
||||
"Alternative source": "Alternative source",
|
||||
"Paste your embed code below:": "Paste your embed code below:",
|
||||
"Insert video": "Insert video",
|
||||
"Embed": "Embed",
|
||||
"Nonbreaking space": "Non-breaking space",
|
||||
"Page break": "Page break",
|
||||
"Paste as text": "Paste as text",
|
||||
"Preview": "Preview",
|
||||
"Print": "Print",
|
||||
"Save": "Save",
|
||||
"Could not find the specified string.": "Could not find the specified string.",
|
||||
"Replace": "Replace",
|
||||
"Next": "Next",
|
||||
"Whole words": "Whole words",
|
||||
"Find and replace": "Find and replace",
|
||||
"Replace with": "Replace with",
|
||||
"Find": "Find",
|
||||
"Replace all": "Replace all",
|
||||
"Match case": "Match case",
|
||||
"Prev": "Prev",
|
||||
"Spellcheck": "Spell-check",
|
||||
"Finish": "Finish",
|
||||
"Ignore all": "Ignore all",
|
||||
"Ignore": "Ignore",
|
||||
"Insert row before": "Insert row before",
|
||||
"Rows": "Rows",
|
||||
"Height": "Height",
|
||||
"Paste row after": "Paste row after",
|
||||
"Alignment": "Alignment",
|
||||
"Column group": "Column group",
|
||||
"Row": "Row",
|
||||
"Insert column before": "Insert column before",
|
||||
"Split cell": "Split cell",
|
||||
"Cell padding": "Cell padding",
|
||||
"Cell spacing": "Cell spacing",
|
||||
"Row type": "Row type",
|
||||
"Insert table": "Insert table",
|
||||
"Body": "Body",
|
||||
"Caption": "Caption",
|
||||
"Footer": "Footer",
|
||||
"Delete row": "Delete row",
|
||||
"Paste row before": "Paste row before",
|
||||
"Scope": "Scope",
|
||||
"Delete table": "Delete table",
|
||||
"Header cell": "Header cell",
|
||||
"Column": "Column",
|
||||
"Cell": "Cell",
|
||||
"Header": "Header",
|
||||
"Cell type": "Cell type",
|
||||
"Copy row": "Copy row",
|
||||
"Row properties": "Row properties",
|
||||
"Table properties": "Table properties",
|
||||
"Row group": "Row group",
|
||||
"Right": "Right",
|
||||
"Insert column after": "Insert column after",
|
||||
"Cols": "Cols",
|
||||
"Insert row after": "Insert row after",
|
||||
"Width": "Width",
|
||||
"Cell properties": "Cell properties",
|
||||
"Left": "Left",
|
||||
"Cut row": "Cut row",
|
||||
"Delete column": "Delete column",
|
||||
"Center": "Centre",
|
||||
"Merge cells": "Merge cells",
|
||||
"Insert template": "Insert template",
|
||||
"Templates": "Templates",
|
||||
"Background color": "Background colour",
|
||||
"Text color": "Text colour",
|
||||
"Show blocks": "Show blocks",
|
||||
"Show invisible characters": "Show invisible characters",
|
||||
"Words: {0}": "Words: {0}",
|
||||
"Insert": "Insert",
|
||||
"File": "File",
|
||||
"Edit": "Edit",
|
||||
"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help",
|
||||
"Tools": "Tools",
|
||||
"View": "View",
|
||||
"Table": "Table",
|
||||
"Format": "Format"
|
||||
});
|
177
public/tinymce/langs/zh.js
Normal file
177
public/tinymce/langs/zh.js
Normal file
@ -0,0 +1,177 @@
|
||||
tinymce.addI18n('zh',{
|
||||
"Cut": "\u526a\u5207",
|
||||
"Header 2": "\u6807\u98982",
|
||||
"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "\u4f60\u7684\u6d4f\u89c8\u5668\u4e0d\u652f\u6301\u5bf9\u526a\u8d34\u677f\u7684\u8bbf\u95ee\uff0c\u8bf7\u4f7f\u7528Ctrl+X\/C\/V\u952e\u8fdb\u884c\u590d\u5236\u7c98\u8d34\u3002",
|
||||
"Div": "Div\u533a\u5757",
|
||||
"Paste": "\u7c98\u8d34",
|
||||
"Close": "\u5173\u95ed",
|
||||
"Font Family": "\u5b57\u4f53",
|
||||
"Pre": "\u9884\u683c\u5f0f\u6587\u672c",
|
||||
"Align right": "\u53f3\u5bf9\u9f50",
|
||||
"New document": "\u65b0\u6587\u6863",
|
||||
"Blockquote": "\u5f15\u7528",
|
||||
"Numbered list": "\u7f16\u53f7\u5217\u8868",
|
||||
"Increase indent": "\u589e\u52a0\u7f29\u8fdb",
|
||||
"Formats": "\u683c\u5f0f",
|
||||
"Headers": "\u6807\u9898",
|
||||
"Select all": "\u5168\u9009",
|
||||
"Header 3": "\u6807\u98983",
|
||||
"Blocks": "\u533a\u5757",
|
||||
"Undo": "\u64a4\u6d88",
|
||||
"Strikethrough": "\u5220\u9664\u7ebf",
|
||||
"Bullet list": "\u9879\u76ee\u7b26\u53f7",
|
||||
"Header 1": "\u6807\u98981",
|
||||
"Superscript": "\u4e0a\u6807",
|
||||
"Clear formatting": "\u6e05\u9664\u683c\u5f0f",
|
||||
"Font Sizes": "\u5b57\u53f7",
|
||||
"Subscript": "\u4e0b\u6807",
|
||||
"Header 6": "\u6807\u98986",
|
||||
"Redo": "\u91cd\u590d",
|
||||
"Paragraph": "\u6bb5\u843d",
|
||||
"Ok": "\u786e\u5b9a",
|
||||
"Bold": "\u7c97\u4f53",
|
||||
"Code": "\u4ee3\u7801",
|
||||
"Italic": "\u659c\u4f53",
|
||||
"Align center": "\u5c45\u4e2d",
|
||||
"Header 5": "\u6807\u98985",
|
||||
"Decrease indent": "\u51cf\u5c11\u7f29\u8fdb",
|
||||
"Header 4": "标题4",
|
||||
"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "\u5f53\u524d\u4e3a\u7eaf\u6587\u672c\u7c98\u8d34\u6a21\u5f0f\uff0c\u518d\u6b21\u70b9\u51fb\u53ef\u4ee5\u56de\u5230\u666e\u901a\u7c98\u8d34\u6a21\u5f0f\u3002",
|
||||
"Underline": "\u4e0b\u5212\u7ebf",
|
||||
"Cancel": "\u53d6\u6d88",
|
||||
"Justify": "\u4e24\u7aef\u5bf9\u9f50",
|
||||
"Inline": "\u6587\u672c",
|
||||
"Copy": "\u590d\u5236",
|
||||
"Align left": "\u5de6\u5bf9\u9f50",
|
||||
"Visual aids": "\u7f51\u683c\u7ebf",
|
||||
"Lower Greek": "\u5c0f\u5199\u5e0c\u814a\u5b57\u6bcd",
|
||||
"Square": "\u65b9\u5757",
|
||||
"Default": "\u9ed8\u8ba4",
|
||||
"Lower Alpha": "\u5c0f\u5199\u82f1\u6587\u5b57\u6bcd",
|
||||
"Circle": "\u7a7a\u5fc3\u5706",
|
||||
"Disc": "\u5b9e\u5fc3\u5706",
|
||||
"Upper Alpha": "\u5927\u5199\u82f1\u6587\u5b57\u6bcd",
|
||||
"Upper Roman": "\u5927\u5199\u7f57\u9a6c\u5b57\u6bcd",
|
||||
"Lower Roman": "\u5c0f\u5199\u7f57\u9a6c\u5b57\u6bcd",
|
||||
"Name": "\u540d\u79f0",
|
||||
"Anchor": "\u951a\u70b9",
|
||||
"You have unsaved changes are you sure you want to navigate away?": "\u4f60\u8fd8\u6709\u6587\u6863\u5c1a\u672a\u4fdd\u5b58\uff0c\u786e\u5b9a\u8981\u79bb\u5f00\uff1f",
|
||||
"Restore last draft": "\u6062\u590d\u4e0a\u6b21\u7684\u8349\u7a3f",
|
||||
"Special character": "\u7279\u6b8a\u7b26\u53f7",
|
||||
"Source code": "\u6e90\u4ee3\u7801",
|
||||
"Right to left": "\u4ece\u53f3\u5230\u5de6",
|
||||
"Left to right": "\u4ece\u5de6\u5230\u53f3",
|
||||
"Emoticons": "\u8868\u60c5",
|
||||
"Robots": "\u673a\u5668\u4eba",
|
||||
"Document properties": "\u6587\u6863\u5c5e\u6027",
|
||||
"Title": "\u6807\u9898",
|
||||
"Keywords": "\u5173\u952e\u8bcd",
|
||||
"Encoding": "\u7f16\u7801",
|
||||
"Description": "\u63cf\u8ff0",
|
||||
"Author": "\u4f5c\u8005",
|
||||
"Fullscreen": "\u5168\u5c4f",
|
||||
"Horizontal line": "\u6c34\u5e73\u5206\u5272\u7ebf",
|
||||
"Horizontal space": "\u6c34\u5e73\u8fb9\u8ddd",
|
||||
"Insert\/edit image": "上传/插入图片",
|
||||
"General": "\u666e\u901a",
|
||||
"Advanced": "\u9ad8\u7ea7",
|
||||
"Source": "\u5730\u5740",
|
||||
"Border": "\u8fb9\u6846",
|
||||
"Constrain proportions": "\u4fdd\u6301\u7eb5\u6a2a\u6bd4",
|
||||
"Vertical space": "\u5782\u76f4\u8fb9\u8ddd",
|
||||
"Image description": "\u56fe\u7247\u63cf\u8ff0",
|
||||
"Style": "\u6837\u5f0f",
|
||||
"Dimensions": "\u5927\u5c0f",
|
||||
"Insert image": "\u63d2\u5165\u56fe\u7247",
|
||||
"Insert date\/time": "\u63d2\u5165\u65e5\u671f\/\u65f6\u95f4",
|
||||
"Remove link": "\u5220\u9664\u94fe\u63a5",
|
||||
"Url": "\u5730\u5740",
|
||||
"Text to display": "\u663e\u793a\u6587\u5b57",
|
||||
"Anchors": "\u951a\u70b9",
|
||||
"Insert link": "\u63d2\u5165\u94fe\u63a5",
|
||||
"New window": "\u5728\u65b0\u7a97\u53e3\u6253\u5f00",
|
||||
"None": "\u65e0",
|
||||
"Target": "\u6253\u5f00\u65b9\u5f0f",
|
||||
"Insert\/edit link": "\u63d2\u5165\/\u7f16\u8f91\u94fe\u63a5",
|
||||
"Insert\/edit video": "\u63d2\u5165\/\u7f16\u8f91\u89c6\u9891",
|
||||
"Poster": "\u5c01\u9762",
|
||||
"Alternative source": "\u955c\u50cf",
|
||||
"Paste your embed code below:": "\u5c06\u5185\u5d4c\u4ee3\u7801\u7c98\u8d34\u5728\u4e0b\u9762:",
|
||||
"Insert video": "\u63d2\u5165\u89c6\u9891",
|
||||
"Embed": "\u5185\u5d4c",
|
||||
"Nonbreaking space": "\u4e0d\u95f4\u65ad\u7a7a\u683c",
|
||||
"Page break": "\u5206\u9875\u7b26",
|
||||
"Paste as text": "\u7c98\u8d34\u4e3a\u6587\u672c",
|
||||
"Preview": "\u9884\u89c8",
|
||||
"Print": "\u6253\u5370",
|
||||
"Save": "\u4fdd\u5b58",
|
||||
"Could not find the specified string.": "\u672a\u627e\u5230\u641c\u7d22\u5185\u5bb9.",
|
||||
"Replace": "\u66ff\u6362",
|
||||
"Next": "\u4e0b\u4e00\u4e2a",
|
||||
"Whole words": "\u5168\u5b57\u5339\u914d",
|
||||
"Find and replace": "\u67e5\u627e\u548c\u66ff\u6362",
|
||||
"Replace with": "\u66ff\u6362\u4e3a",
|
||||
"Find": "\u67e5\u627e",
|
||||
"Replace all": "\u5168\u90e8\u66ff\u6362",
|
||||
"Match case": "\u533a\u5206\u5927\u5c0f\u5199",
|
||||
"Prev": "\u4e0a\u4e00\u4e2a",
|
||||
"Spellcheck": "\u62fc\u5199\u68c0\u67e5",
|
||||
"Finish": "\u5b8c\u6210",
|
||||
"Ignore all": "\u5168\u90e8\u5ffd\u7565",
|
||||
"Ignore": "\u5ffd\u7565",
|
||||
"Insert row before": "\u5728\u4e0a\u65b9\u63d2\u5165",
|
||||
"Rows": "\u884c",
|
||||
"Height": "\u9ad8",
|
||||
"Paste row after": "\u7c98\u8d34\u5230\u4e0b\u65b9",
|
||||
"Alignment": "\u5bf9\u9f50\u65b9\u5f0f",
|
||||
"Column group": "\u5217\u7ec4",
|
||||
"Row": "\u884c",
|
||||
"Insert column before": "\u5728\u5de6\u4fa7\u63d2\u5165",
|
||||
"Split cell": "\u62c6\u5206\u5355\u5143\u683c",
|
||||
"Cell padding": "\u5355\u5143\u683c\u5185\u8fb9\u8ddd",
|
||||
"Cell spacing": "\u5355\u5143\u683c\u5916\u95f4\u8ddd",
|
||||
"Row type": "\u884c\u7c7b\u578b",
|
||||
"Insert table": "\u63d2\u5165\u8868\u683c",
|
||||
"Body": "\u8868\u4f53",
|
||||
"Caption": "\u6807\u9898",
|
||||
"Footer": "\u8868\u5c3e",
|
||||
"Delete row": "\u5220\u9664\u884c",
|
||||
"Paste row before": "\u7c98\u8d34\u5230\u4e0a\u65b9",
|
||||
"Scope": "\u8303\u56f4",
|
||||
"Delete table": "\u5220\u9664\u8868\u683c",
|
||||
"Header cell": "\u8868\u5934\u5355\u5143\u683c",
|
||||
"Column": "\u5217",
|
||||
"Cell": "\u5355\u5143\u683c",
|
||||
"Header": "\u8868\u5934",
|
||||
"Cell type": "\u5355\u5143\u683c\u7c7b\u578b",
|
||||
"Copy row": "\u590d\u5236\u884c",
|
||||
"Row properties": "\u884c\u5c5e\u6027",
|
||||
"Table properties": "\u8868\u683c\u5c5e\u6027",
|
||||
"Row group": "\u884c\u7ec4",
|
||||
"Right": "\u53f3\u5bf9\u9f50",
|
||||
"Insert column after": "\u5728\u53f3\u4fa7\u63d2\u5165",
|
||||
"Cols": "\u5217",
|
||||
"Insert row after": "\u5728\u4e0b\u65b9\u63d2\u5165",
|
||||
"Width": "\u5bbd",
|
||||
"Cell properties": "\u5355\u5143\u683c\u5c5e\u6027",
|
||||
"Left": "\u5de6\u5bf9\u9f50",
|
||||
"Cut row": "\u526a\u5207\u884c",
|
||||
"Delete column": "\u5220\u9664\u5217",
|
||||
"Center": "\u5c45\u4e2d",
|
||||
"Merge cells": "\u5408\u5e76\u5355\u5143\u683c",
|
||||
"Insert template": "\u63d2\u5165\u6a21\u677f",
|
||||
"Templates": "\u6a21\u677f",
|
||||
"Background color": "\u80cc\u666f\u8272",
|
||||
"Text color": "\u6587\u5b57\u989c\u8272",
|
||||
"Show blocks": "\u663e\u793a\u533a\u5757\u8fb9\u6846",
|
||||
"Show invisible characters": "\u663e\u793a\u4e0d\u53ef\u89c1\u5b57\u7b26",
|
||||
"Words: {0}": "\u5b57\u6570\uff1a{0}",
|
||||
"Insert": "\u63d2\u5165",
|
||||
"File": "\u6587\u4ef6",
|
||||
"Edit": "\u7f16\u8f91",
|
||||
"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "\u5728\u7f16\u8f91\u533a\u6309ALT-F9\u6253\u5f00\u83dc\u5355\uff0c\u6309ALT-F10\u6253\u5f00\u5de5\u5177\u680f\uff0c\u6309ALT-0\u67e5\u770b\u5e2e\u52a9",
|
||||
"Tools": "\u5de5\u5177",
|
||||
"View": "\u89c6\u56fe",
|
||||
"Table": "\u8868\u683c",
|
||||
"Format": "\u683c\u5f0f"
|
||||
});
|
8
public/tinymce/plugins/codemirror/langs/zh.js
Normal file
8
public/tinymce/plugins/codemirror/langs/zh.js
Normal file
@ -0,0 +1,8 @@
|
||||
tinymce.addI18n('zh',{
|
||||
'HTML source code': 'HTML源码',
|
||||
'Start search': '查找',
|
||||
'Find next': '下一个',
|
||||
'Find previous': '前一个',
|
||||
'Replace': '替换',
|
||||
'Replace all': '替换所有'
|
||||
});
|
4
public/tinymce/plugins/leanote_code/langs/en.js
Normal file
4
public/tinymce/plugins/leanote_code/langs/en.js
Normal file
@ -0,0 +1,4 @@
|
||||
tinymce.addI18n('en',{
|
||||
codeLang: "Language",
|
||||
toggleCode: "`ctrl+shift+c` toggle code"
|
||||
});
|
4
public/tinymce/plugins/leanote_code/langs/zh.js
Normal file
4
public/tinymce/plugins/leanote_code/langs/zh.js
Normal file
@ -0,0 +1,4 @@
|
||||
tinymce.addI18n('zh',{
|
||||
codeLang: "代码语言",
|
||||
toggleCode: "ctrl+shift+c 切换代码"
|
||||
});
|
@ -1,3 +1,9 @@
|
||||
/**
|
||||
* leanote code plugin
|
||||
*/
|
||||
|
||||
tinymce.PluginManager.requireLangPack('leanote_code');
|
||||
|
||||
tinymce.PluginManager.add('leanote_code', function(editor, url) {
|
||||
var ed = editor;
|
||||
|
||||
@ -75,8 +81,8 @@ tinymce.PluginManager.add('leanote_code', function(editor, url) {
|
||||
}
|
||||
return {
|
||||
type: 'listbox',
|
||||
text: "代码语言",
|
||||
tooltip: "ctrl+shift+c 切换代码",
|
||||
text: "codeLang",
|
||||
tooltip: "toggleCode",
|
||||
values: items,
|
||||
fixedWidth: true,
|
||||
onselect: function(e) {
|
||||
|
@ -1 +1 @@
|
||||
tinymce.PluginManager.add("leanote_code",function(t){function e(t){var e,o=n.selection.getNode(),r=n.selection.getContent(),a=n.selection.getBookmark();if("PRE"==o.nodeName)$(o).attr("class","brush:"+t);else{if("BODY"==o.nodeName)return;try{e=$(r).text()}catch(c){}e?n.insertContent('<pre class="brush:'+t+'"> '+e+"</pre>"):(e=$(o).text(),$(o).replaceWith('<pre class="brush:'+t+'"> '+e+"</pre>"))}n.selection.moveToBookmark(a)}function o(){return function(){var e=this;t.on("nodeChange",function(){var o=null;try{var n=t.selection.getNode();"PRE"==n.nodeName&&(o=$.trim($(n).attr("class").split(":")[1]))}catch(r){}e.value(o)})}}var n=t;t.addButton("leanote_code",function(){var t=["CSS:css","C/C++:cpp","C#:c#","Javascript:javascript","Java:java","PHP:php","Python:python","Shell:shell","Delphi:delphi","Golang:golang","Erlang:erlang","Groovy:groovy","ActionScript:actionScript"],n=[];for(var r in t){var a=t[r].split(":");n.push({text:a[0],value:a[1]})}return{type:"listbox",text:"代码语言",tooltip:"ctrl+shift+c 切换代码",values:n,fixedWidth:!0,onselect:function(t){t.control.settings.value&&e(t.control.settings.value)},onPostRender:o(n)}}),n.addCommand("toggleCode",function(){var t,e=n.selection.getNode(),o=n.selection.getContent(),r=n.selection.getBookmark();try{t=$.trim($(o).text())}catch(a){}t||(t=$.trim(o)),t?"PRE"==e.nodeName?$(e).replaceWith("<p>"+$(e).html()+"</p>"):n.insertContent("<pre>"+t+"</pre>"):$(e).replaceWith("PRE"==e.nodeName?"<p>"+$(e).html().replace(/\n/g,"<br />")+"</p>":"<pre>"+$(e).html()+"</pre>"),n.selection.moveToBookmark(r)}),n.addShortcut("ctrl+shift+c","","toggleCode"),n.addShortcut("command+shift+c","","toggleCode")});
|
||||
tinymce.PluginManager.requireLangPack("leanote_code"),tinymce.PluginManager.add("leanote_code",function(e){function t(e){var t,o=n.selection.getNode(),a=n.selection.getContent(),r=n.selection.getBookmark();if("PRE"==o.nodeName)$(o).attr("class","brush:"+e);else{if("BODY"==o.nodeName)return;try{t=$(a).text()}catch(c){}t?n.insertContent('<pre class="brush:'+e+'"> '+t+"</pre>"):(t=$(o).text(),$(o).replaceWith('<pre class="brush:'+e+'"> '+t+"</pre>"))}n.selection.moveToBookmark(r)}function o(){return function(){var t=this;e.on("nodeChange",function(){var o=null;try{var n=e.selection.getNode();"PRE"==n.nodeName&&(o=$.trim($(n).attr("class").split(":")[1]))}catch(a){}t.value(o)})}}var n=e;e.addButton("leanote_code",function(){var e=["CSS:css","C/C++:cpp","C#:c#","Javascript:javascript","Java:java","PHP:php","Python:python","Shell:shell","Delphi:delphi","Golang:golang","Erlang:erlang","Groovy:groovy","ActionScript:actionScript"],n=[];for(var a in e){var r=e[a].split(":");n.push({text:r[0],value:r[1]})}return{type:"listbox",text:"codeLang",tooltip:"toggleCode",values:n,fixedWidth:!0,onselect:function(e){e.control.settings.value&&t(e.control.settings.value)},onPostRender:o(n)}}),n.addCommand("toggleCode",function(){var e,t=n.selection.getNode(),o=n.selection.getContent(),a=n.selection.getBookmark();try{e=$.trim($(o).text())}catch(r){}e||(e=$.trim(o)),e?"PRE"==t.nodeName?$(t).replaceWith("<p>"+$(t).html()+"</p>"):n.insertContent("<pre>"+e+"</pre>"):$(t).replaceWith("PRE"==t.nodeName?"<p>"+$(t).html().replace(/\n/g,"<br />")+"</p>":"<pre>"+$(t).html()+"</pre>"),n.selection.moveToBookmark(a)}),n.addShortcut("ctrl+shift+c","","toggleCode"),n.addShortcut("command+shift+c","","toggleCode")});
|
Reference in New Issue
Block a user