diff --git a/editormd.js b/editormd.js index dd99aebe..3d61e099 100644 --- a/editormd.js +++ b/editormd.js @@ -2,12 +2,12 @@ * Editor.md * * @file editormd.js - * @version v1.7.9 + * @version v1.7.10 * @description Open source online markdown editor. * @license MIT License * @author Pandao * {@link https://github.com/pandao/editor.md} - * @updateTime 2022-07-25 + * @updateTime 2022-09-09 */ ;(function(factory) { @@ -59,7 +59,7 @@ }; editormd.title = editormd.$name = "Editor.md"; - editormd.version = "1.7.9"; + editormd.version = "1.7.10"; editormd.homePage = "https://pandao.github.io/editor.md/"; editormd.classPrefix = "editormd-"; @@ -2655,7 +2655,7 @@ * @returns {editormd} 返回editormd的实例对象 */ - executePlugin : function(name, path, customPlugin = false) { + executePlugin : function(name, path, customPlugin = false, optionalParams= {}) { var _this = this; var cm = this.cm; var settings = this.settings; @@ -2680,12 +2680,12 @@ { editormd.loadPlugin(path, function() { editormd.loadPlugins[name] = _this[name]; - _this[name](cm); + _this[name](cm, optionalParams); }, "head", (customPlugin ? _this.author_ide_version : editormd.version) ); } else { - $.proxy(editormd.loadPlugins[name], this)(cm); + $.proxy(editormd.loadPlugins[name], this)(cm, optionalParams); } return this; @@ -4108,6 +4108,7 @@ backgroundColor : "#fff", opacity : 0.1 }, + removeDialogOnClose: false, lockScreen : true, footer : true, buttons : false @@ -4208,6 +4209,7 @@ dialog.find("." + classPrefix + "dialog-close").bind(mouseOrTouch("click", "touchend"), function() { dialog.hide().lockScreen(false).hideMask(); + if (options.removeDialogOnClose) dialog.remove() }); if (typeof options.buttons === "object") diff --git a/package-lock.json b/package-lock.json index 34cceb8d..b08d6c10 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@ibm-skills-network/editor.md", - "version": "1.7.9", + "version": "1.7.10", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@ibm-skills-network/editor.md", - "version": "1.7.9", + "version": "1.7.10", "license": "MIT", "devDependencies": { "dateformatter": "0.1.0", diff --git a/package.json b/package.json index 099e1829..10a72291 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ibm-skills-network/editor.md", - "version": "1.7.9", + "version": "1.7.10", "description": "Open source online markdown editor.", "directories": { "doc": "docs", diff --git a/src/editormd.js b/src/editormd.js index 5c537d14..fd97db8e 100644 --- a/src/editormd.js +++ b/src/editormd.js @@ -47,7 +47,7 @@ }; editormd.title = editormd.$name = "Editor.md"; - editormd.version = "1.7.9"; + editormd.version = "1.7.10"; editormd.homePage = "https://pandao.github.io/editor.md/"; editormd.classPrefix = "editormd-"; @@ -2643,7 +2643,7 @@ * @returns {editormd} 返回editormd的实例对象 */ - executePlugin : function(name, path, customPlugin = false) { + executePlugin : function(name, path, customPlugin = false, optionalParams= {}) { var _this = this; var cm = this.cm; var settings = this.settings; @@ -2668,12 +2668,12 @@ { editormd.loadPlugin(path, function() { editormd.loadPlugins[name] = _this[name]; - _this[name](cm); + _this[name](cm, optionalParams); }, "head", (customPlugin ? _this.author_ide_version : editormd.version) ); } else { - $.proxy(editormd.loadPlugins[name], this)(cm); + $.proxy(editormd.loadPlugins[name], this)(cm, optionalParams); } return this; @@ -4096,6 +4096,7 @@ backgroundColor : "#fff", opacity : 0.1 }, + removeDialogOnClose: false, lockScreen : true, footer : true, buttons : false @@ -4196,6 +4197,7 @@ dialog.find("." + classPrefix + "dialog-close").bind(mouseOrTouch("click", "touchend"), function() { dialog.hide().lockScreen(false).hideMask(); + if (options.removeDialogOnClose) dialog.remove() }); if (typeof options.buttons === "object")