From 9e8ff264065a11e8157f56c71df415f4b2a01beb Mon Sep 17 00:00:00 2001 From: WuHuan Date: Sat, 18 Jul 2015 14:31:11 +0800 Subject: [PATCH 01/17] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9C=AA=E5=AE=9E?= =?UTF-8?q?=E6=97=B6=E9=A2=84=E8=A7=88=E4=B8=8D=E8=83=BD=E5=85=A8=E5=B1=8F?= =?UTF-8?q?=E9=A2=84=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- editormd.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/editormd.js b/editormd.js index 1f18a474..b901a8bb 100644 --- a/editormd.js +++ b/editormd.js @@ -1965,14 +1965,15 @@ save : function() { - if (timer === null) + var _this = this; + var state = this.state; + var settings = this.settings; + + if (timer === null && !(!settings.watch && state.preview)) { return this; } - var _this = this; - var state = this.state; - var settings = this.settings; var cm = this.cm; var cmValue = cm.getValue(); var previewContainer = this.previewContainer; From 92cb53dc89aaaa03236d441c56c2d6a97643e5fb Mon Sep 17 00:00:00 2001 From: junjie Date: Sun, 6 Dec 2015 19:08:47 +0800 Subject: [PATCH 02/17] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=85=A8=E5=B1=8F?= =?UTF-8?q?=E4=B9=8B=E5=90=8E=E8=83=8C=E6=99=AF=E5=86=85=E5=AE=B9=E9=87=8D?= =?UTF-8?q?=E5=8F=A0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 由于preview没有指定z-index,在全屏之后可能会发生背景内容重叠的现象。 --- scss/editormd.codemirror.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scss/editormd.codemirror.scss b/scss/editormd.codemirror.scss index ad400b02..493399b8 100644 --- a/scss/editormd.codemirror.scss +++ b/scss/editormd.codemirror.scss @@ -18,6 +18,7 @@ line-height: 1.6; display: none; background: #fff; + z-index:10; } .editormd { @@ -86,4 +87,4 @@ background-position: right; background-repeat: no-repeat; } -} \ No newline at end of file +} From fb9859f5d41e131c9a5c1195f0b6719e0f88c289 Mon Sep 17 00:00:00 2001 From: Frank Liu Date: Wed, 6 Jan 2016 16:55:16 +0800 Subject: [PATCH 03/17] =?UTF-8?q?=E8=B7=A8=E5=9F=9F=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=97=B6=EF=BC=8C=E4=B8=8D=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E5=9B=BE=E7=89=87=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/image-dialog/image-dialog.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/plugins/image-dialog/image-dialog.js b/plugins/image-dialog/image-dialog.js index 0be6d698..b4eca95c 100644 --- a/plugins/image-dialog/image-dialog.js +++ b/plugins/image-dialog/image-dialog.js @@ -134,14 +134,14 @@ if (fileName === "") { alert(imageLang.uploadFileEmpty); - + return false; } - + if (!isImage.test(fileName)) { alert(imageLang.formatNotAllowed + settings.imageFormats.join(", ")); - + return false; } @@ -152,7 +152,7 @@ var uploadIframe = document.getElementById(iframeName); uploadIframe.onload = function() { - + loading(false); var body = (uploadIframe.contentWindow ? uploadIframe.contentWindow : uploadIframe.contentDocument).document.body; @@ -160,13 +160,16 @@ json = (typeof JSON.parse !== "undefined") ? JSON.parse(json) : eval("(" + json + ")"); - if (json.success === 1) - { - dialog.find("[data-url]").val(json.url); - } - else + if(!settings.crossDomainUpload) { - alert(json.message); + if (json.success === 1) + { + dialog.find("[data-url]").val(json.url); + } + else + { + alert(json.message); + } } return false; From 98d5467124bd63eec773c93b49eee2b7e2e10400 Mon Sep 17 00:00:00 2001 From: canon4ever Date: Thu, 24 Mar 2016 00:05:50 +0800 Subject: [PATCH 04/17] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=90=8D=EF=BC=8C=E4=BC=9A=E5=AF=BC=E8=87=B4=E6=97=A0?= =?UTF-8?q?=E6=89=A9=E5=B1=95=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复了该问题 --- examples/php/editormd.uploader.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/php/editormd.uploader.class.php b/examples/php/editormd.uploader.class.php index 1cebe8ed..ed8624af 100644 --- a/examples/php/editormd.uploader.class.php +++ b/examples/php/editormd.uploader.class.php @@ -252,7 +252,7 @@ private function randomFileName() private function setSeveName() { - $this->saveName = $this->randomFileName(); + $this->saveName = $this->randomFileName().".".$this->fileExt; if($this->saveName == '') //如果没生成随机文件名,就保留原文件名 { From a8b8ae2ad759026635ab3b801e79d098f5735fd5 Mon Sep 17 00:00:00 2001 From: mrjlynch Date: Mon, 11 Apr 2016 19:53:17 +1000 Subject: [PATCH 05/17] Added support for Mac keyboard shortcuts support for Ctrl or Cmd is PC or MAC --- src/editormd.js | 77 +++++++++++++++++++++++++------------------------ 1 file changed, 40 insertions(+), 37 deletions(-) diff --git a/src/editormd.js b/src/editormd.js index 95c65b42..7bffb7f9 100644 --- a/src/editormd.js +++ b/src/editormd.js @@ -3170,17 +3170,20 @@ } }; + var isMac = navigator.platform.toUpperCase().indexOf('MAC')>=0; + var key = isMac ? "Cmd" : "Ctrl"; + editormd.keyMaps = { - "Ctrl-1" : "h1", - "Ctrl-2" : "h2", - "Ctrl-3" : "h3", - "Ctrl-4" : "h4", - "Ctrl-5" : "h5", - "Ctrl-6" : "h6", - "Ctrl-B" : "bold", // if this is string == editormd.toolbarHandlers.xxxx - "Ctrl-D" : "datetime", - - "Ctrl-E" : function() { // emoji + [key + "-1"] : "h1", + [key + "-2"] : "h2", + [key + "-3"] : "h3", + [key + "-4"] : "h4", + [key + "-5"] : "h5", + [key + "-6"] : "h6", + [key + "-B"] : "bold", // if this is string == editormd.toolbarHandlers.xxxx + [key + "-D"] : "datetime", + + [key + "Ctrl-E"] : function() { // emoji var cm = this.cm; var cursor = cm.getCursor(); var selection = cm.getSelection(); @@ -3197,10 +3200,10 @@ cm.setCursor(cursor.line, cursor.ch + 1); } }, - "Ctrl-Alt-G" : "goto-line", - "Ctrl-H" : "hr", - "Ctrl-I" : "italic", - "Ctrl-K" : "code", + [key + "-Alt-G"] : "goto-line", + [key + "-H"] : "hr", + [key + "-I"] : "italic", + [key + "-K"] : "code", "Ctrl-L" : function() { var cm = this.cm; @@ -3215,7 +3218,7 @@ cm.setCursor(cursor.line, cursor.ch + 1); } }, - "Ctrl-U" : "list-ul", + [key + "-U"] : "list-ul", "Shift-Ctrl-A" : function() { var cm = this.cm; @@ -3235,10 +3238,10 @@ } }, - "Shift-Ctrl-C" : "code", - "Shift-Ctrl-Q" : "quote", - "Shift-Ctrl-S" : "del", - "Shift-Ctrl-K" : "tex", // KaTeX + ["Shift" + key + "-C"] : "code", + ["Shift" + key + "Q"] : "quote", + ["Shift" + key + "S"] : "del", + ["Shift" + key + "K"] : "tex", // KaTeX "Shift-Alt-C" : function() { var cm = this.cm; @@ -3252,16 +3255,16 @@ } }, - "Shift-Ctrl-Alt-C" : "code-block", - "Shift-Ctrl-H" : "html-entities", - "Shift-Alt-H" : "help", - "Shift-Ctrl-E" : "emoji", - "Shift-Ctrl-U" : "uppercase", - "Shift-Alt-U" : "ucwords", - "Shift-Ctrl-Alt-U" : "ucfirst", - "Shift-Alt-L" : "lowercase", + ["Shift-" + key + "-Alt-C"] : "code-block", + ["Shift-" + key + "-H"] : "html-entities", + "Shift-Alt-H" : "help", + ["Shift-" + key + "-E"] : "emoji", + ["Shift-" + key + "-U"] : "uppercase", + "Shift-Alt-U" : "ucwords", + ["Shift-" + key + "-Alt-U"] : "ucfirst", + "Shift-Alt-L" : "lowercase", - "Shift-Ctrl-I" : function() { + ["Shift-" + key + "-I"] : function() { var cm = this.cm; var cursor = cm.getCursor(); var selection = cm.getSelection(); @@ -3275,15 +3278,15 @@ } }, - "Shift-Ctrl-Alt-I" : "image", - "Shift-Ctrl-L" : "link", - "Shift-Ctrl-O" : "list-ol", - "Shift-Ctrl-P" : "preformatted-text", - "Shift-Ctrl-T" : "table", - "Shift-Alt-P" : "pagebreak", - "F9" : "watch", - "F10" : "preview", - "F11" : "fullscreen", + ["Shift-" + key + "-Alt-I"] : "image", + ["Shift-" + key + "-L"] : "link", + ["Shift-" + key + "-O"] : "list-ol", + ["Shift-" + key + "-P"] : "preformatted-text", + ["Shift-" + key + "-T"] : "table", + "Shift-Alt-P" : "pagebreak", + "F9" : "watch", + "F10" : "preview", + "F11" : "fullscreen", }; /** From a32feec01efba7a02234abf1b6d9a9424697f6da Mon Sep 17 00:00:00 2001 From: Viky-zhang Date: Sun, 24 Apr 2016 21:39:45 +0800 Subject: [PATCH 06/17] fix RequireJs submodule relative path For situation of `baseUrl` is not to `editor.md/lib`. --- editormd.amd.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/editormd.amd.js b/editormd.amd.js index 3bc46875..daf4994a 100644 --- a/editormd.amd.js +++ b/editormd.amd.js @@ -22,14 +22,14 @@ { if (define.amd) // for Require.js { - var cmModePath = "codemirror/mode/"; - var cmAddonPath = "codemirror/addon/"; + var cmModePath = "./lib/codemirror/mode/"; + var cmAddonPath = "./lib/codemirror/addon/"; var codeMirrorModules = [ "jquery", "marked", "prettify", "katex", "raphael", "underscore", "flowchart", "jqueryflowchart", "sequenceDiagram", - "codemirror/lib/codemirror", + "./lib/codemirror/lib/codemirror", cmModePath + "css/css", cmModePath + "sass/sass", cmModePath + "shell/shell", From 763863abecde970fe2d2094ef63d037a535789b8 Mon Sep 17 00:00:00 2001 From: wky <1107879044@qq.com> Date: Sat, 14 May 2016 19:35:21 +0800 Subject: [PATCH 07/17] =?UTF-8?q?=E7=8E=B0=E5=9C=A8=E7=B1=BB=E4=BC=BCx:x:x?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E9=97=B4=E6=A0=BC=E5=BC=8F=E4=B9=9F=E4=B8=8D?= =?UTF-8?q?=E4=BC=9A=E8=A2=AB=E8=A7=A3=E6=9E=90=E4=B8=BAemoji?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/editormd.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/editormd.js b/src/editormd.js index 95c65b42..c53d991b 100644 --- a/src/editormd.js +++ b/src/editormd.js @@ -3343,7 +3343,7 @@ email : /(\w+)@(\w+)\.(\w+)\.?(\w+)?/g, emailLink : /(mailto:)?([\w\.\_]+)@(\w+)\.(\w+)\.?(\w+)?/g, emoji : /:([\w\+-]+):/g, - emojiDatetime : /(\d{2}:\d{2}:\d{2})/g, + emojiDatetime : /(\d{1,2}:\d{1,2}:\d{1,2})/g, twemoji : /:(tw-([\w]+)-?(\w+)?):/g, fontAwesome : /:(fa-([\w]+)(-(\w+)){0,}):/g, editormdLogo : /:(editormd-logo-?(\w+)?):/g, From f96ace3f0227f6b997dff3180c9708bd15ee6d24 Mon Sep 17 00:00:00 2001 From: comdeng Date: Mon, 5 Sep 2016 21:16:30 +0800 Subject: [PATCH 08/17] =?UTF-8?q?bugfixed:=E5=9B=BE=E7=89=87=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E4=B8=BA=E5=A4=A7=E5=86=99=E6=97=B6=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/image-dialog/image-dialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/image-dialog/image-dialog.js b/plugins/image-dialog/image-dialog.js index b4eca95c..68da8927 100644 --- a/plugins/image-dialog/image-dialog.js +++ b/plugins/image-dialog/image-dialog.js @@ -129,7 +129,7 @@ fileInput.bind("change", function() { var fileName = fileInput.val(); - var isImage = new RegExp("(\\.(" + settings.imageFormats.join("|") + "))$"); // /(\.(webp|jpg|jpeg|gif|bmp|png))$/ + var isImage = new RegExp("(\\.(" + settings.imageFormats.join("|") + "))$", "i"); // /(\.(webp|jpg|jpeg|gif|bmp|png))$/ if (fileName === "") { From 013d3d493bee708c202a40e984477194d26ee888 Mon Sep 17 00:00:00 2001 From: Moon Rae Joo Date: Tue, 13 Sep 2016 01:57:20 +0800 Subject: [PATCH 09/17] Update editormd.logo.scss --- scss/editormd.logo.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scss/editormd.logo.scss b/scss/editormd.logo.scss index 7f4c3b84..51d1c586 100644 --- a/scss/editormd.logo.scss +++ b/scss/editormd.logo.scss @@ -6,7 +6,7 @@ @font-face { font-family: 'editormd-logo'; src:url('../fonts/editormd-logo.eot?-5y8q6h'); - src:url('.../fonts/editormd-logo.eot?#iefix-5y8q6h') format('embedded-opentype'), + src:url('../fonts/editormd-logo.eot?#iefix-5y8q6h') format('embedded-opentype'), url('../fonts/editormd-logo.woff?-5y8q6h') format('woff'), url('../fonts/editormd-logo.ttf?-5y8q6h') format('truetype'), url('../fonts/editormd-logo.svg?-5y8q6h#icomoon') format('svg'); @@ -86,4 +86,4 @@ #{$prefix}logo-color { color: $mainColor; -} \ No newline at end of file +} From b769e1a327b6e00a5e48bfd63d39f913eb8dd95e Mon Sep 17 00:00:00 2001 From: Moon Rae Joo Date: Tue, 13 Sep 2016 01:58:02 +0800 Subject: [PATCH 10/17] Update editormd.css --- css/editormd.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css/editormd.css b/css/editormd.css index 7698a7a7..5905b808 100644 --- a/css/editormd.css +++ b/css/editormd.css @@ -3081,7 +3081,7 @@ @font-face { font-family: 'editormd-logo'; src: url("../fonts/editormd-logo.eot?-5y8q6h"); - src: url(".../fonts/editormd-logo.eot?#iefix-5y8q6h") format("embedded-opentype"), url("../fonts/editormd-logo.woff?-5y8q6h") format("woff"), url("../fonts/editormd-logo.ttf?-5y8q6h") format("truetype"), url("../fonts/editormd-logo.svg?-5y8q6h#icomoon") format("svg"); + src: url("../fonts/editormd-logo.eot?#iefix-5y8q6h") format("embedded-opentype"), url("../fonts/editormd-logo.woff?-5y8q6h") format("woff"), url("../fonts/editormd-logo.ttf?-5y8q6h") format("truetype"), url("../fonts/editormd-logo.svg?-5y8q6h#icomoon") format("svg"); font-weight: normal; font-style: normal; } From 78e6cef6a48df349d8fa355964f9bf6f21ac99b5 Mon Sep 17 00:00:00 2001 From: mirrores Date: Fri, 21 Oct 2016 22:40:31 +0800 Subject: [PATCH 11/17] release bug upload pic remove dialog --- plugins/image-dialog/image-dialog.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/image-dialog/image-dialog.js b/plugins/image-dialog/image-dialog.js index b4eca95c..26027e3b 100644 --- a/plugins/image-dialog/image-dialog.js +++ b/plugins/image-dialog/image-dialog.js @@ -108,12 +108,18 @@ this.hide().lockScreen(false).hideMask(); + //删除对话框 + this.remove(); + return false; }], cancel : [lang.buttons.cancel, function() { this.hide().lockScreen(false).hideMask(); + //删除对话框 + this.remove(); + return false; }] } From 486f14fc08b9c1b4b36f518394077e1537609d2b Mon Sep 17 00:00:00 2001 From: cheenwe Date: Thu, 28 Dec 2017 10:41:57 +0800 Subject: [PATCH 12/17] fixed emoji url --- editormd.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editormd.js b/editormd.js index b901a8bb..7c7e6fad 100644 --- a/editormd.js +++ b/editormd.js @@ -3365,7 +3365,7 @@ // Emoji graphics files url path editormd.emoji = { - path : "http://www.emoji-cheat-sheet.com/graphics/emojis/", + path : "https://www.webpagefx.com/tools/emoji-cheat-sheet/graphics/emojis/", ext : ".png" }; From 4e30e39b9bfe4ec84ce082187d7cefd2e69890d6 Mon Sep 17 00:00:00 2001 From: canon4ever Date: Thu, 24 Mar 2016 00:05:50 +0800 Subject: [PATCH 13/17] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=90=8D=EF=BC=8C=E4=BC=9A=E5=AF=BC=E8=87=B4=E6=97=A0?= =?UTF-8?q?=E6=89=A9=E5=B1=95=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复了该问题 --- examples/php/editormd.uploader.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/php/editormd.uploader.class.php b/examples/php/editormd.uploader.class.php index 1cebe8ed..ed8624af 100644 --- a/examples/php/editormd.uploader.class.php +++ b/examples/php/editormd.uploader.class.php @@ -252,7 +252,7 @@ private function randomFileName() private function setSeveName() { - $this->saveName = $this->randomFileName(); + $this->saveName = $this->randomFileName().".".$this->fileExt; if($this->saveName == '') //如果没生成随机文件名,就保留原文件名 { From fa9376483e18550258da0d1d5003ea0663cb19d4 Mon Sep 17 00:00:00 2001 From: Yuri Date: Sun, 1 Apr 2018 21:51:36 +0300 Subject: [PATCH 14/17] plugins localization --- languages/en.js | 6 ++++-- languages/zh-tw.js | 8 +++++--- plugins/code-block-dialog/code-block-dialog.js | 2 +- .../preformatted-text-dialog/preformatted-text-dialog.js | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/languages/en.js b/languages/en.js index 0120a46e..8ee2c854 100644 --- a/languages/en.js +++ b/languages/en.js @@ -77,7 +77,8 @@ }, preformattedText : { title : "Preformatted text / Codes", - emptyAlert : "Error: Please fill in the Preformatted text or content of the codes." + emptyAlert : "Error: Please fill in the Preformatted text or content of the codes.", + placeholder : "coding now...." }, codeBlock : { title : "Code block", @@ -85,7 +86,8 @@ selectDefaultText : "select a code language...", otherLanguage : "Other languages", unselectedLanguageAlert : "Error: Please select the code language.", - codeEmptyAlert : "Error: Please fill in the code content." + codeEmptyAlert : "Error: Please fill in the code content.", + placeholder : "coding now...." }, htmlEntities : { title : "HTML Entities" diff --git a/languages/zh-tw.js b/languages/zh-tw.js index c92d2711..68da83f1 100644 --- a/languages/zh-tw.js +++ b/languages/zh-tw.js @@ -77,7 +77,8 @@ }, preformattedText : { title : "添加預格式文本或代碼塊", - emptyAlert : "錯誤:請填寫預格式文本或代碼的內容。" + emptyAlert : "錯誤:請填寫預格式文本或代碼的內容。", + placeholder : "coding now...." }, codeBlock : { title : "添加代碼塊", @@ -85,7 +86,8 @@ selectDefaultText : "請語言代碼語言", otherLanguage : "其他語言", unselectedLanguageAlert : "錯誤:請選擇代碼所屬的語言類型。", - codeEmptyAlert : "錯誤:請填寫代碼內容。" + codeEmptyAlert : "錯誤:請填寫代碼內容。", + placeholder: : "coding now...." }, htmlEntities : { title : "HTML實體字符" @@ -124,4 +126,4 @@ factory(window.editormd); } -})(); \ No newline at end of file +})(); diff --git a/plugins/code-block-dialog/code-block-dialog.js b/plugins/code-block-dialog/code-block-dialog.js index 0e89e37f..4ecb997d 100644 --- a/plugins/code-block-dialog/code-block-dialog.js +++ b/plugins/code-block-dialog/code-block-dialog.js @@ -85,7 +85,7 @@ var dialogHTML = "
" + dialogLang.selectLabel + "" + "
" + - ""; + ""; dialog = this.createDialog({ name : dialogName, diff --git a/plugins/preformatted-text-dialog/preformatted-text-dialog.js b/plugins/preformatted-text-dialog/preformatted-text-dialog.js index e19bbd54..97a272b8 100644 --- a/plugins/preformatted-text-dialog/preformatted-text-dialog.js +++ b/plugins/preformatted-text-dialog/preformatted-text-dialog.js @@ -41,7 +41,7 @@ } else { - var dialogContent = ""; + var dialogContent = ""; dialog = this.createDialog({ name : dialogName, From 85350aa4435a4d171450bb433d4f47270a01ec60 Mon Sep 17 00:00:00 2001 From: Franck Deroche Date: Thu, 26 Jul 2018 22:56:21 +0200 Subject: [PATCH 15/17] Handle two editors with different toolbars on the same page --- editormd.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editormd.js b/editormd.js index b901a8bb..d0c5d5d5 100644 --- a/editormd.js +++ b/editormd.js @@ -365,7 +365,7 @@ var _this = this; var classPrefix = this.classPrefix = editormd.classPrefix; - var settings = this.settings = $.extend(true, editormd.defaults, options); + var settings = this.settings = $.extend(true, {}, editormd.defaults, options); id = (typeof id === "object") ? settings.id : id; From 6e2bfa89b7dffe81f20c45b83d44685c4d195155 Mon Sep 17 00:00:00 2001 From: Steven Date: Tue, 11 Dec 2018 13:01:02 -0500 Subject: [PATCH 16/17] Fix url to marked repo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 48444f17..8958a57d 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ Using modular script loader : #### Dependents - [CodeMirror](http://codemirror.net/ "CodeMirror") -- [marked](https://github.com/chjj/marked "marked") +- [marked](https://github.com/markedjs/marked "marked") - [jQuery](http://jquery.com/ "jQuery") - [FontAwesome](http://fontawesome.io/ "FontAwesome") - [github-markdown.css](https://github.com/sindresorhus/github-markdown-css "github-markdown.css") From 0e76f96d476397c5a9e64388a36e2ed74183d11e Mon Sep 17 00:00:00 2001 From: pandao <272383090@qq.com> Date: Wed, 8 May 2019 01:18:20 +0800 Subject: [PATCH 17/17] Update README.md --- README.md | 211 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 180 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 8958a57d..74221419 100644 --- a/README.md +++ b/README.md @@ -40,59 +40,208 @@ - 支持 AMD / CMD 模块化加载(支持 [Require.js](https://pandao.github.io/editor.md/examples/use-requirejs.html) & [Sea.js](https://pandao.github.io/editor.md/examples/use-seajs.html)),并且支持[自定义扩展插件](https://pandao.github.io/editor.md/examples/define-plugin.html); - 兼容主流的浏览器(IE8+)和 [Zepto.js](https://pandao.github.io/editor.md/examples/use-zepto.html),且支持 iPad 等平板设备; -#### Examples +#### Download & install + +Download: -[https://pandao.github.io/editor.md/examples/index.html](https://pandao.github.io/editor.md/examples/index.html) +[Github download](https://github.com/pandao/editor.md/archive/master.zip) -#### Download & install +NPM install : -[Github download](https://github.com/pandao/editor.md/archive/master.zip) +```bash +npm install editor.md +``` Bower install : -```shell +```bash bower install editor.md ``` -#### Usages - -HTML: +#### Usages + +##### Create a Markdown editor ```html - -
+ +
+
-``` - -> Tip: Editor.md can auto append ` +
+ + + + + +``` + +> See the full example: [http://editor.md.ipandao.com/examples/html-preview-markdown-to-html.html](http://editor.md.ipandao.com/examples/html-preview-markdown-to-html.html) + +##### HTML to Markdown? + +Sorry, Editor.md not support HTML to Markdown parsing, Maybe In the future. + +#### Examples + +[https://pandao.github.io/editor.md/examples/index.html](https://pandao.github.io/editor.md/examples/index.html) + +#### Options + +Editor.md options and default values: + +```javascript +{ + mode : "gfm", // gfm or markdown + name : "", // Form element name for post + value : "", // value for CodeMirror, if mode not gfm/markdown + theme : "", // Editor.md self themes, before v1.5.0 is CodeMirror theme, default empty + editorTheme : "default", // Editor area, this is CodeMirror theme at v1.5.0 + previewTheme : "", // Preview area theme, default empty + markdown : "", // Markdown source code + appendMarkdown : "", // if in init textarea value not empty, append markdown to textarea + width : "100%", + height : "100%", + path : "./lib/", // Dependents module file directory + pluginPath : "", // If this empty, default use settings.path + "../plugins/" + delay : 300, // Delay parse markdown to html, Uint : ms + autoLoadModules : true, // Automatic load dependent module files + watch : true, + placeholder : "Enjoy Markdown! coding now...", + gotoLine : true, // Enable / disable goto a line + codeFold : false, + autoHeight : false, + autoFocus : true, // Enable / disable auto focus editor left input area + autoCloseTags : true, + searchReplace : true, // Enable / disable (CodeMirror) search and replace function + syncScrolling : true, // options: true | false | "single", default true + readOnly : false, // Enable / disable readonly mode + tabSize : 4, + indentUnit : 4, + lineNumbers : true, // Display editor line numbers + lineWrapping : true, + autoCloseBrackets : true, + showTrailingSpace : true, + matchBrackets : true, + indentWithTabs : true, + styleSelectedText : true, + matchWordHighlight : true, // options: true, false, "onselected" + styleActiveLine : true, // Highlight the current line + dialogLockScreen : true, + dialogShowMask : true, + dialogDraggable : true, + dialogMaskBgColor : "#fff", + dialogMaskOpacity : 0.1, + fontSize : "13px", + saveHTMLToTextarea : false, // If enable, Editor will create a