From 2e815bc23ed973bb0399a6bd7d030b63116a8c9c Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Fri, 8 Jan 2021 10:10:47 -0600 Subject: [PATCH] eslint --- web/js/logger.js | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/web/js/logger.js b/web/js/logger.js index 325eda3c8..f131ca35f 100644 --- a/web/js/logger.js +++ b/web/js/logger.js @@ -126,19 +126,21 @@ https://stackoverflow.com/a/11219680 function browserInfo() { var browser = {}; - var nVer = navigator.appVersion; var nAgt = navigator.userAgent; - var browserName = navigator.appName; - var fullVersion = ''+parseFloat(navigator.appVersion); - var majorVersion = parseInt(navigator.appVersion,10); - var nameOffset,verOffset,ix; + var browserName = navigator.appName; + var fullVersion = ''+parseFloat(navigator.appVersion); + var majorVersion = parseInt(navigator.appVersion, 10); + var nameOffset; + var verOffset; + var ix; // In Opera, the true version is after "Opera" or after "Version" if ((verOffset=nAgt.indexOf("Opera")) != -1) { - browserName = "Opera"; - fullVersion = nAgt.substring(verOffset+6); - if ((verOffset=nAgt.indexOf("Version")) != -1) - fullVersion = nAgt.substring(verOffset+8); + browserName = "Opera"; + fullVersion = nAgt.substring(verOffset+6); + if ((verOffset=nAgt.indexOf("Version")) != -1) { + fullVersion = nAgt.substring(verOffset+8); + } } // In MSIE, the true version is after "MSIE" in userAgent @@ -157,8 +159,9 @@ function browserInfo() { else if ((verOffset=nAgt.indexOf("Safari")) != -1) { browserName = "Safari"; fullVersion = nAgt.substring(verOffset+7); - if ((verOffset=nAgt.indexOf("Version")) != -1) + if ((verOffset=nAgt.indexOf("Version")) != -1) { fullVersion = nAgt.substring(verOffset+8); + } } // In Firefox, the true version is after "Firefox" @@ -177,15 +180,17 @@ function browserInfo() { } // trim the fullVersion string at semicolon/space if present - if ((ix=fullVersion.indexOf(";")) != -1) - fullVersion=fullVersion.substring(0,ix); - if ((ix=fullVersion.indexOf(" ")) != -1) - fullVersion=fullVersion.substring(0,ix); + if ((ix=fullVersion.indexOf(";")) != -1) { + fullVersion=fullVersion.substring(0,ix); + } + if ((ix=fullVersion.indexOf(" ")) != -1) { + fullVersion=fullVersion.substring(0,ix); + } - majorVersion = parseInt(''+fullVersion,10); + var majorVersion = parseInt(''+fullVersion,10); if (isNaN(majorVersion)) { - fullVersion = ''+parseFloat(navigator.appVersion); - majorVersion = parseInt(navigator.appVersion,10); + fullVersion = ''+parseFloat(navigator.appVersion); + majorVersion = parseInt(navigator.appVersion,10); } // OSName variable is set as follows: