From bbad12f7d46789f9f53eaeec4be76f67b60d7729 Mon Sep 17 00:00:00 2001 From: shooter Date: Sat, 3 Sep 2016 21:35:30 +0800 Subject: [PATCH] replace `console.error` by `throw Error` --- lib/simditor.js | 4 ++-- site/assets/scripts/simditor.js | 6 +++--- src/toolbar.coffee | 2 +- styles/simditor.css | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/simditor.js b/lib/simditor.js index 80bd66ba..ec04652a 100644 --- a/lib/simditor.js +++ b/lib/simditor.js @@ -1,7 +1,7 @@ /*! * Simditor v2.3.6 * http://simditor.tower.im/ -* 2015-12-21 +* 2016-09-03 */ (function (root, factory) { if (typeof define === 'function' && define.amd) { @@ -1979,7 +1979,7 @@ Toolbar = (function(superClass) { continue; } if (!this.constructor.buttons[name]) { - throw new Error("simditor: invalid toolbar button " + name); + console.error("simditor: invalid toolbar button " + name); continue; } this.buttons.push(new this.constructor.buttons[name]({ diff --git a/site/assets/scripts/simditor.js b/site/assets/scripts/simditor.js index 0e066624..e933a9b3 100644 --- a/site/assets/scripts/simditor.js +++ b/site/assets/scripts/simditor.js @@ -1974,7 +1974,7 @@ Toolbar = (function(superClass) { continue; } if (!this.constructor.buttons[name]) { - throw new Error("simditor: invalid toolbar button " + name); + console.error("simditor: invalid toolbar button " + name); continue; } this.buttons.push(new this.constructor.buttons[name]({ @@ -2679,8 +2679,8 @@ Simditor.i18n = { 'linkText': '链接文字', 'linkUrl': '链接地址', 'linkTarget': '打开方式', - 'openLinkInCurrentWindow': '在新窗口中打开', - 'openLinkInNewWindow': '在当前窗口中打开', + 'openLinkInCurrentWindow': '在当前窗口中打开', + 'openLinkInNewWindow': '在新窗口中打开', 'removeLink': '移除链接', 'ol': '有序列表', 'ul': '无序列表', diff --git a/src/toolbar.coffee b/src/toolbar.coffee index 9e649690..51d56258 100644 --- a/src/toolbar.coffee +++ b/src/toolbar.coffee @@ -90,7 +90,7 @@ class Toolbar extends SimpleModule continue unless @constructor.buttons[name] - throw new Error "simditor: invalid toolbar button #{name}" + console.error "simditor: invalid toolbar button #{name}" continue @buttons.push new @constructor.buttons[name] diff --git a/styles/simditor.css b/styles/simditor.css index 341ae827..e9065d73 100644 --- a/styles/simditor.css +++ b/styles/simditor.css @@ -1,7 +1,7 @@ /*! * Simditor v2.3.6 * http://simditor.tower.im/ -* 2015-12-21 +* 2016-09-03 */ @font-face { font-family: 'Simditor';