From f20f442b43c66fc88145fdf176acb5756f950b24 Mon Sep 17 00:00:00 2001 From: Jeremy Mahieu Date: Sun, 15 Dec 2019 03:31:46 +0100 Subject: [PATCH] Make js ES5 compliant so it would pass tests --- js/glowingbear.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/js/glowingbear.js b/js/glowingbear.js index eb80eb5..58f6d14 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -662,26 +662,26 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', //There can be a combination of host, port and path //If host is specified here the dedicated port field is disabled - let parts; + var parts; //host - const regexHost = /^([^:\/]*|\[.*\])$/; - const regexHostPort = /^([^:]*|\[.*\]):(\d+)$/; - const regexHostPortPath = /^([^:]*|\[.*\]):(\d*)\/(.+)$/; - if(parts = regexHost.exec(settings.host)) + var regexHost = /^([^:\/]*|\[.*\])$/; + var regexHostPort = /^([^:]*|\[.*\]):(\d+)$/; + var regexHostPortPath = /^([^:]*|\[.*\]):(\d*)\/(.+)$/; + if((parts = regexHost.exec(settings.host)) !== null) { settings.hostOnly = parts[1]; $rootScope.portDisabled = false; } //host:port - else if(parts = regexHostPort.exec(settings.host)) + else if((parts = regexHostPort.exec(settings.host)) !== null) { settings.hostOnly = parts[1]; settings.port = parts[2]; $rootScope.portDisabled = true; } //host:port/path - else if(parts = regexHostPortPath.exec(settings.host)) + else if((parts = regexHostPortPath.exec(settings.host)) !== null) { settings.hostOnly = parts[1]; settings.port = parts[2];