From 102e411ccfc62fefe6205a2b54f67da64b29f878 Mon Sep 17 00:00:00 2001 From: NateN1222 Date: Wed, 30 Aug 2017 13:57:57 -0500 Subject: Made the blacklist/whitelist/forget preference buttons in the GUI work --- contact_finder.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'contact_finder.js') diff --git a/contact_finder.js b/contact_finder.js index 4c7c74e..f26ef61 100644 --- a/contact_finder.js +++ b/contact_finder.js @@ -13,6 +13,8 @@ //Copyright (C) 2011, 2012, 2014 Loic J. Duros //Copyright (C) 2014, 2015 Nik Nyby +console.log("contact_finder.js"); + // email address regexp var reEmail = /^mailto\:(admin|feedback|webmaster|info|contact|support|comments|team|help)\@[a-z0-9.\-]+\.[a-z]{2,4}$/i; @@ -107,10 +109,12 @@ function new_debug_button(name_text,callback){ var to_insert = '
'; document.body.insertAdjacentHTML('afterbegin', to_insert); } - var button_html = '
'; - document.getElementById("abc123_main_div").insertAdjacentHTML('afterbegin', button_html); - document.getElementById("abc123_button_"+button_i).addEventListener("click",callback); - button_i = button_i + 1; + if(document.getElementById("abc123_button_"+button_i) === undefined){ + var button_html = '
'; + document.getElementById("abc123_main_div").insertAdjacentHTML('afterbegin', button_html); + document.getElementById("abc123_button_"+button_i).addEventListener("click",callback); + button_i = button_i + 1; + } } /** * returns input with all elements not of type string removed -- cgit v1.2.3