From 4ccebc413371df189a8d3a4561d8fc1dc312df3a Mon Sep 17 00:00:00 2001 From: craftxbox Date: Thu, 15 Aug 2019 19:46:02 -0230 Subject: [PATCH] h --- goon/browserassets/js/browserOutput.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/goon/browserassets/js/browserOutput.js b/goon/browserassets/js/browserOutput.js index 8d8e20d25e5..962809eae68 100644 --- a/goon/browserassets/js/browserOutput.js +++ b/goon/browserassets/js/browserOutput.js @@ -41,7 +41,7 @@ var opts = { 'suppressOptionsClose': false, //Whether or not we should be hiding the suboptions menu 'highlightTerms': [], 'highlightLimit': 5, - 'highlightEscapeRegex':true, + 'highlightRegexEnable':false, 'highlightColor': '#FFFF00', //The color of the highlighted message 'pingDisabled': false, //Has the user disabled the ping counter @@ -161,7 +161,7 @@ function highlightTerms(el) { for (var i = 0; i < opts.highlightTerms.length; i++) { //Each highlight term if(opts.highlightTerms[i]) { var rexp = new RegExp("("+opts.highlightTerms[i]+")","gmi") - if(opts.highlightEscapeRegex){ + if(!opts.highlightRegexEnable){ rexp = new RegExp("("+opts.highlightTerms[i].replace(new RegExp("([^a-zA-Z0-9])","gmi"),"\\$1")+")","gmi") } el.innerHTML = el.innerHTML.replace(rexp,"$1") @@ -573,7 +573,7 @@ $(function() { 'spingDisabled': getCookie('pingdisabled'), 'shighlightTerms': getCookie('highlightterms'), 'shighlightColor': getCookie('highlightcolor'), - 'shighlightEscapeRegex': getCookie('highlightescaperegex'), + 'shighlightRegexEnable': getCookie('highlightregexenable'), 'shideSpam': getCookie('hidespam'), 'darkChat': getCookie('darkChat'), }; @@ -611,9 +611,9 @@ $(function() { opts.highlightColor = savedConfig.shighlightColor; internalOutput('Loaded highlight color of: '+savedConfig.shighlightColor+'', 'internal'); } - if (savedConfig.shighlightEscapeRegex) { - opts.highlightEscapeRegex = savedConfig.shighlightEscapeRegex; - internalOutput('Loaded highlight regex enable of: '+savedConfig.shighlightEscapeRegex+'', 'internal'); + if (savedConfig.shighlightRegexEnable) { + opts.highlightRegexEnable = savedConfig.shighlightRegexEnable; + internalOutput('Loaded highlight regex enable of: '+savedConfig.shighlightRegexEnable+'', 'internal'); } if (savedConfig.shideSpam) { opts.hideSpam = $.parseJSON(savedConfig.shideSpam); @@ -979,7 +979,7 @@ $(function() { var popupContent = '
String Highlighting
' + '
' + '
Choose up to '+opts.highlightLimit+' strings that will highlight the line when they appear in chat.
'+ - 'Regex Enabled'+ + 'Enable Regex'+ '
See here for details
' + '
' + termInputs + @@ -989,6 +989,7 @@ $(function() { '
' + '
'; createPopup(popupContent, 250); + document.querySelector(".popup #highlightRegexEnable").checked = opts.highlightRegexEnable; }); $('body').on('keyup', '#highlightColor', function() { var color = $('#highlightColor').val(); @@ -1017,7 +1018,7 @@ $(function() { } var color = $('#highlightColor').val(); - opts.highlightEscapeRegex = !(document.getElementById('highlightregexenable').checked) + opts.highlightRegexEnable = document.querySelector("#highlightRegexEnable").checked color = color.trim(); if (color == '' || color.charAt(0) != '#') { opts.highlightColor = '#FFFF00'; @@ -1027,7 +1028,7 @@ $(function() { var $popup = $('#highlightPopup').closest('.popup'); $popup.remove(); - setCookie('highlightescaperegex', opts.highlightEscapeRegex,365) + setCookie('highlightregexenable', opts.highlightRegexEnable,365) setCookie('highlightterms', JSON.stringify(opts.highlightTerms), 365); setCookie('highlightcolor', opts.highlightColor, 365); });