From 2ac6b70a1cb7b5dd6054d673e41c0bd339f25d14 Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Tue, 4 Apr 2017 17:08:23 +0100 Subject: [PATCH] Use workaround from Ace's commits. --- services/web/public/js/ace-1.2.5/ace.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/services/web/public/js/ace-1.2.5/ace.js b/services/web/public/js/ace-1.2.5/ace.js index 1a030a42b4..0c6b9cbbfb 100644 --- a/services/web/public/js/ace-1.2.5/ace.js +++ b/services/web/public/js/ace-1.2.5/ace.js @@ -1350,11 +1350,6 @@ if (typeof navigator != "object") var os = (navigator.platform.match(/mac|win|linux/i) || ["other"])[0].toLowerCase(); var ua = navigator.userAgent; - -var safariRegex = /version\/([\w\.]+).+?(mobile\s?safari|safari)/i; -var safariResult = ua.match(safariRegex); -var safariVersion = safariResult ? parseFloat(safariResult[1]) : 0; - exports.isWin = (os == "win"); exports.isMac = (os == "mac"); exports.isLinux = (os == "linux"); @@ -1371,8 +1366,6 @@ exports.isWebKit = parseFloat(ua.split("WebKit/")[1]) || undefined; exports.isChrome = parseFloat(ua.split(" Chrome/")[1]) || undefined; -exports.isSafari = safariVersion || undefined; - exports.isAIR = ua.indexOf("AdobeAIR") >= 0; exports.isIPad = ua.indexOf("iPad") >= 0; @@ -2290,9 +2283,13 @@ var TextInput = function(parentNode, host) { if (e.type == "compositionend" && c.range) { host.selection.setRange(c.range); } - // WORKAROUND: Accent keys and Korean keys don't work in Chrome >53. - // https://github.com/ajaxorg/ace/issues/3045 - if (useragent.isChrome >= 53 || useragent.isSafari >= 10.1) onInput(); + var needsOnInput = + (!!useragent.isChrome && useragent.isChrome >= 53) || + (!!useragent.isWebKit && useragent.isWebKit >= 603); + + if (needsOnInput) { + onInput(); + } };