From 9e3060a6f77b774ea63784e493807f70a8e2f04b Mon Sep 17 00:00:00 2001 From: cpradio Date: Fri, 19 Sep 2014 22:47:27 -0400 Subject: [PATCH] FIX: Opera Improvements (v12) Fix issues with Opera 12 and its ability to utilize Discourse Composer window https://meta.discourse.org/t/support-for-opera/20218 --- app/assets/javascripts/discourse/lib/Markdown.Editor.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/discourse/lib/Markdown.Editor.js b/app/assets/javascripts/discourse/lib/Markdown.Editor.js index c6dbcd279c4..2eb1e9d6d26 100644 --- a/app/assets/javascripts/discourse/lib/Markdown.Editor.js +++ b/app/assets/javascripts/discourse/lib/Markdown.Editor.js @@ -43,8 +43,7 @@ // Used to work around some browser bugs where we can't use feature testing. uaSniffed = { isIE: /msie/.test(nav.userAgent.toLowerCase()), - isIE_5or6: /msie 6/.test(nav.userAgent.toLowerCase()) || /msie 5/.test(nav.userAgent.toLowerCase()), - isOpera: /opera/.test(nav.userAgent.toLowerCase()) + isIE_5or6: /msie 6/.test(nav.userAgent.toLowerCase()) || /msie 5/.test(nav.userAgent.toLowerCase()) }; var defaultsStrings = { @@ -743,7 +742,7 @@ return; } - if (inputArea.selectionStart !== undefined && !uaSniffed.isOpera) { + if (inputArea.selectionStart !== undefined) { inputArea.focus(); inputArea.selectionStart = stateObj.start; @@ -1325,10 +1324,6 @@ makeSpritedButtonRow(); var keyEvent = "keydown"; - if (uaSniffed.isOpera) { - keyEvent = "keypress"; - } - util.addEvent(inputBox, keyEvent, function (key) { // Check to see if we have a button key and, if so execute the callback.