From 4085e992ec0bae7251b9a702c2b7bf1c6f4fb316 Mon Sep 17 00:00:00 2001 From: Bob Czarnecki Date: Wed, 5 Feb 2014 12:31:20 -0500 Subject: [PATCH 1/3] Handle paste exceptions --- src/plugins/common/paste/lib/paste-plugin.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plugins/common/paste/lib/paste-plugin.js b/src/plugins/common/paste/lib/paste-plugin.js index 387a339a23..69a9afa323 100755 --- a/src/plugins/common/paste/lib/paste-plugin.js +++ b/src/plugins/common/paste/lib/paste-plugin.js @@ -65,7 +65,7 @@ define([ * @type {boolean} * @const */ - var IS_IE = !!$.browser.msie; + var IS_IE = !!Aloha.browser.msie; /** * Matches as string consisting of a single white space character. @@ -344,7 +344,13 @@ define([ // that the pasted content has been inserted into the paste div before // we attempt to retrieve it. window.setTimeout(function () { - paste($CLIPBOARD, range, onInsert); + try { + paste($CLIPBOARD, range, onInsert); + } catch (e) { + if (console && console.error) { + console.error('Aloha Error (This is Generally Benign):', e); + } + } Aloha.activeEditable.smartContentChange($event); }, 10); } From 07c85fd6c7c25309376adf678fa7daaa95190e91 Mon Sep 17 00:00:00 2001 From: Bob Czarnecki Date: Wed, 5 Feb 2014 16:47:18 -0500 Subject: [PATCH 2/3] guide --- build/ctct-paste-errors-changelog.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 build/ctct-paste-errors-changelog.md diff --git a/build/ctct-paste-errors-changelog.md b/build/ctct-paste-errors-changelog.md new file mode 100644 index 0000000000..eda0bc38c6 --- /dev/null +++ b/build/ctct-paste-errors-changelog.md @@ -0,0 +1,2 @@ +- **BUGFIX**: Paste Plugin + Add an exception handler for the paste() call and only write to console.error if it exists \ No newline at end of file From 3d21a54d100b7fa0a4d266251936c3f22e68bbdd Mon Sep 17 00:00:00 2001 From: Bob Czarnecki Date: Thu, 6 Feb 2014 15:44:54 -0500 Subject: [PATCH 3/3] Remove Aloha.browser for PR --- src/plugins/common/paste/lib/paste-plugin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/common/paste/lib/paste-plugin.js b/src/plugins/common/paste/lib/paste-plugin.js index 69a9afa323..14c3eab5b8 100755 --- a/src/plugins/common/paste/lib/paste-plugin.js +++ b/src/plugins/common/paste/lib/paste-plugin.js @@ -65,7 +65,7 @@ define([ * @type {boolean} * @const */ - var IS_IE = !!Aloha.browser.msie; + var IS_IE = !!$.browser.msie; /** * Matches as string consisting of a single white space character.