From c1033dc72156b57350108ed056a432505fa799a3 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 26 Jul 2016 12:48:51 +0200 Subject: [PATCH] Revert "Work-around for Firefox... again" This reverts commit 263e497c6d3b4d62cdd42df6df32bb9f146650b2. --- .../js/3rdParty/redactor/plugins/wbbcode.js | 2 -- .../3rdParty/redactor/plugins/wmonkeypatch.js | 36 ++----------------- 2 files changed, 2 insertions(+), 36 deletions(-) diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js index 202b4cbb0f..1fd74f4229 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js @@ -1985,8 +1985,6 @@ RedactorPlugins.wbbcode = function() { * @param object data */ _keyupCallback: function(data) { - this.keydown.woltlabIsEnter = false; - switch (data.event.which) { case $.ui.keyCode.BACKSPACE: case $.ui.keyCode.DELETE: diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js index 2e10f1d447..539be732ef 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js @@ -873,7 +873,6 @@ RedactorPlugins.wmonkeypatch = function() { */ keydown: function() { this.keydown.enterWithinBlockquote = false; - this.keydown.woltlabIsEnter = false; // keydown.onTab var $mpOnTab = this.keydown.onTab; @@ -902,8 +901,6 @@ RedactorPlugins.wmonkeypatch = function() { // keydown.setupBuffer var $mpSetupBuffer = this.keydown.setupBuffer; this.keydown.setupBuffer = (function(e, key) { - this.keydown.woltlabIsEnter = (key == this.keyCode.ENTER && !e.shiftKey && !e.ctrlKey && !e.metaKey); - // undo if (this.keydown.ctrl && key === 89 && !e.shiftKey && !e.altKey && this.opts.rebuffer.length !== 0) { e.preventDefault(); @@ -1315,24 +1312,6 @@ RedactorPlugins.wmonkeypatch = function() { fixApple = true; } else { - // Removing the marker without moving the selection first causes Firefox - // to move the selection somewhere else. Unfortunately the predicted new - // location is sometimes completely off, messing up everything. - if (this.keydown.woltlabIsEnter && this.utils.browser('mozilla')) { - $node = null; - - var text = document.createTextNode("\u200B"); - if (marker.nextSibling) marker.parentNode.insertBefore(text, marker.nextSibling); - else marker.parentNode.appendChild(text); - - this.selection.implicitRange = document.createRange(); - this.selection.implicitRange.setStartAfter(text); - this.selection.implicitRange.setEndAfter(text); - - getSelection().removeAllRanges(); - getSelection().addRange(this.selection.implicitRange); - } - marker.parentNode.removeChild(marker); } @@ -1344,7 +1323,7 @@ RedactorPlugins.wmonkeypatch = function() { getSelection().removeAllRanges(); getSelection().addRange(this.selection.implicitRange); } - else if (!this.utils.browser('mozilla')) { + else { this.selection.implicitRange = null; } @@ -1362,18 +1341,7 @@ RedactorPlugins.wmonkeypatch = function() { // selection.removeMarkers this.selection.removeMarkers = (function() { - var func = (function() { - this.$editor.find('span.redactor-selection-marker').each($removeEmptyTextNodes); - }).bind(this); - - if (this.keydown.woltlabIsEnter && this.utils.browser('mozilla')) { - // slightly delay removal to give Firefox some time to accept - // the new caret position - setTimeout(func, 1); - } - else { - func(); - } + this.$editor.find('span.redactor-selection-marker').each($removeEmptyTextNodes); }).bind(this); // selection.removeNodesMarkers -- 2.20.1