diff --git a/jssrc/utils.js b/jssrc/utils.js index aa09f9e..9b53a5b 100755 --- a/jssrc/utils.js +++ b/jssrc/utils.js @@ -72,42 +72,6 @@ Math.log10 = Math.log10 || function (x) { return Math.log(x) / Math.LN10 } -/** - * Perform a substitution in the given string. - * - * Arguments - array or list of replacements. - * Arguments numeric keys will replace {0}, {1} etc. - * Named keys also work, ie. {foo: "bar"} -> replaces {foo} with bar. - * - * Braces are added to keys if missing. - * - * @returns {String} result - */ -String.prototype.format = function () { - let out = this - let repl = arguments - - if (arguments.length == 1 && (Array.isArray(arguments[0]) || typeof arguments[0] == 'object')) { - repl = arguments[0] - } - - for (let ph in repl) { - if (repl.hasOwnProperty(ph)) { - const ph_orig = ph - - if (!ph.match(/^\{.*\}$/)) { - ph = '{' + ph + '}' - } - - // replace all occurrences - const pattern = new RegExp(rgxe(ph), 'g') - out = out.replace(pattern, repl[ph_orig]) - } - } - - return out -} - /** HTML escape */ function e (str) { return $.htmlEscape(str) diff --git a/jssrc/wifi.js b/jssrc/wifi.js index cab085b..3669241 100644 --- a/jssrc/wifi.js +++ b/jssrc/wifi.js @@ -82,10 +82,11 @@ } let inner = mk('div') + let escapedSSID = $.htmlEscape(ap.essid) $(inner).addClass('inner') - .htmlAppend('