From bbe9546e47a1a1314d925f7ab66107ffe4b0f1d0 Mon Sep 17 00:00:00 2001 From: cleaner Date: Fri, 31 Jul 2020 12:55:33 +0200 Subject: [PATCH] Delete 'addons/ismitmlinkCR/localdb.js' --- addons/ismitmlinkCR/localdb.js | 67 ---------------------------------- 1 file changed, 67 deletions(-) delete mode 100644 addons/ismitmlinkCR/localdb.js diff --git a/addons/ismitmlinkCR/localdb.js b/addons/ismitmlinkCR/localdb.js deleted file mode 100644 index d23904c..0000000 --- a/addons/ismitmlinkCR/localdb.js +++ /dev/null @@ -1,67 +0,0 @@ -let irun = false; -document.addEventListener('DOMContentLoaded', () => { - chrome.storage.local.get(['mul'], g => { - let ul = g.mul || 'eo'; - fetch('i18n/' + ul + '.json', { - method: 'GET' - }).then(j => j.json()).then(j => { - document.querySelectorAll('span[tek]').forEach(x => { - x.innerText = j[x.getAttribute('tek')]; - }); - document.body.style.display = 'block'; - }); - }); -}); -document.getElementById('f').addEventListener('change', e => { - let ff = e.target.files[0]; - if (ff) { - let r = new FileReader(); - r.addEventListener('load', e => { - if (ff.size > 4) { - let g = e.target.result.replace(/(?:\r\n|\r|\n)/g, "\n").split("\n"); - if (g.length > 0) { - chrome.storage.local.get(['ldb'], gs => { - irun = true; - let cnt0, cnt1 = 0, - gc = 1, - db = JSON.parse(gs.ldb || '[]'); - cnt0 = db.length; - document.getElementById('pbr').max = g.length; - g.forEach(x => { - document.getElementById('pbr').value = gc; - gc++; - if (/^([0-9a-z.-]{4,400})\.([a-z]{2,40})$/.test(x) && !db.includes(x)) { - db.push(x); - } - }); - g = null; - cnt1 = db.length; - if (cnt1 != cnt0) { - chrome.storage.local.set({ - 'ldb': JSON.stringify(db) - }); - } - chrome.runtime.sendMessage('dbmode,rl', () => { - alert(document.querySelector('span[tek=opxdone]').innerText + "\n\n" + cnt0 + " -> " + cnt1); - location.reload(); - }); - }); - } - } - }); - r.readAsText(ff); - } -}); -document.getElementById('ldb_i').addEventListener('click', () => { - if (!irun) { - document.getElementById('f').click(); - } -}); -document.getElementById('ldb_c').addEventListener('click', () => { - if (!irun) { - chrome.runtime.sendMessage('dbmode,cl', () => { - alert(document.querySelector('span[tek=opxdone]').innerText); - location.reload(); - }); - } -}); \ No newline at end of file