whisper.cat/weboasis/text/js/remove-duplicate-lines.js
2023-10-05 23:28:32 +11:00

1 line
6.0 KiB
JavaScript

var _$_b3b9=["\x23\x69\x6E\x70\x75\x74\x5F\x6F\x75\x74\x70\x75\x74","\x74\x61\x5F\x65\x78\x61\x6D\x70\x6C\x65\x73","\x54\x68\x65\x20\x71\x75\x69\x63\x6B\x20\x62\x72\x6F\x77\x6E\x20\x66\x6F\x78\x20\x6A\x75\x6D\x70\x73\x20\x6F\x76\x65\x72\x20\x74\x68\x65\x20\x6C\x61\x7A\x79\x20\x64\x6F\x67\x2E\x0A\x54\x68\x65\x20\x71\x75\x69\x63\x6B\x20\x62\x72\x6F\x77\x6E\x20\x66\x6F\x78\x20\x6A\x75\x6D\x70\x73\x20\x6F\x76\x65\x72\x20\x74\x68\x65\x20\x6C\x61\x7A\x79\x20\x64\x6F\x67\x2E\x0A\x54\x68\x65\x20\x71\x75\x69\x63\x6B\x20\x62\x72\x6F\x77\x6E\x20\x66\x6F\x78\x20\x6A\x75\x6D\x70\x73\x20\x6F\x76\x65\x72\x20\x74\x68\x65\x20\x6C\x61\x7A\x79\x20\x64\x6F\x67\x2E\x0A\x54\x68\x65\x20\x71\x75\x69\x63\x6B\x20\x62\x72\x6F\x77\x6E\x20\x66\x6F\x78\x20\x6A\x75\x6D\x70\x73\x20\x6F\x76\x65\x72\x20\x74\x68\x65\x20\x6C\x61\x7A\x79\x20\x64\x6F\x67\x2E\x0A\x54\x68\x65\x20\x71\x75\x69\x63\x6B\x20\x62\x72\x6F\x77\x6E\x20\x66\x6F\x78\x20\x6A\x75\x6D\x70\x73\x20\x6F\x76\x65\x72\x20\x74\x68\x65\x20\x6C\x61\x7A\x79\x20\x64\x6F\x67\x2E\x0A\x54\x68\x65\x20\x71\x75\x69\x63\x6B\x20\x62\x72\x6F\x77\x6E\x20\x66\x6F\x78\x20\x6A\x75\x6D\x70\x73\x20\x6F\x76\x65\x72\x20\x74\x68\x65\x20\x6C\x61\x7A\x79\x20\x64\x6F\x67\x2E\x0A\x54\x68\x65\x20\x71\x75\x69\x63\x6B\x20\x62\x72\x6F\x77\x6E\x20\x66\x6F\x78\x20\x6A\x75\x6D\x70\x73\x20\x6F\x76\x65\x72\x20\x74\x68\x65\x20\x6C\x61\x7A\x79\x20\x64\x6F\x67\x2E","\x0A","\x63\x68\x65\x63\x6B\x65\x64","\x23\x63\x61\x73\x65\x53\x65\x6E","\x20\x64\x75\x70\x6C\x69\x63\x61\x74\x65\x73\x20\x72\x65\x6D\x6F\x76\x65\x64","\x44\x75\x70\x6C\x69\x63\x61\x74\x65\x73\x20\x72\x65\x6D\x6F\x76\x65\x64\x3A\x20","\x23\x69\x6E\x73\x74\x61\x6E\x63\x65\x73","\x23\x72\x65\x6D\x6F\x76\x65\x44\x75\x70","\x2E\x63\x6C\x69\x70\x62\x6F\x61\x72\x64","\x44\x75\x70\x6C\x69\x63\x61\x74\x65\x73\x20\x72\x65\x6D\x6F\x76\x65\x64\x3A\x20\x30","\x67\x65\x74","\x23\x66\x69\x6C\x65\x5F\x75\x70\x6C\x6F\x61\x64","\x55\x54\x46\x2D\x38","\x4E\x6F\x20\x62\x6C\x6F\x62\x73\x20\x6F\x6E\x20\x49\x45\x20\x76\x65\x72\x3C\x31\x30","\x0D\x0A","\x69\x6E\x70\x75\x74\x5F\x6F\x75\x74\x70\x75\x74","\x74\x65\x78\x74\x2F\x70\x6C\x61\x69\x6E","\x6E\x75\x6C\x6C\x2E\x74\x78\x74","\x46\x69\x6C\x65\x20\x6E\x61\x6D\x65\x3A","\x4E\x65\x77\x20\x44\x6F\x63\x75\x6D\x65\x6E\x74","\x2E\x74\x78\x74","\x61","\x6E\x6F\x6E\x65","","\x63\x68\x69\x6C\x64\x57\x69\x6E\x64\x6F\x77","\x6C\x6F\x63\x61\x74\x69\x6F\x6E\x3D\x79\x65\x73\x2C\x20\x6D\x65\x6E\x75\x62\x61\x72\x3D\x79\x65\x73\x2C\x20\x74\x6F\x6F\x6C\x62\x61\x72\x3D\x79\x65\x73","\x3C\x68\x74\x6D\x6C\x3E\x3C\x68\x65\x61\x64\x3E\x3C\x2F\x68\x65\x61\x64\x3E\x3C\x62\x6F\x64\x79\x3E","\x3C\x62\x72\x3E","\x3C\x2F\x62\x6F\x64\x79\x3E\x3C\x2F\x68\x74\x6D\x6C\x3E","\x23\x63\x6C\x65\x61\x72\x41\x6C\x6C\x2C\x20\x23\x65\x64\x69\x74\x5F\x64\x65\x6C\x65\x74\x65\x2C\x20\x23\x66\x69\x6C\x65\x5F\x6E\x65\x77","\x63\x68\x61\x6E\x67\x65","\x23\x66\x69\x6C\x65\x5F\x64\x6F\x77\x6E\x6C\x6F\x61\x64","\x23\x66\x69\x6C\x65\x5F\x70\x72\x69\x6E\x74","\x23\x65\x64\x69\x74\x5F\x75\x6E\x64\x6F","\x23\x65\x64\x69\x74\x5F\x72\x65\x64\x6F","\x23\x65\x64\x69\x74\x5F\x63\x6F\x70\x79","\x23\x65\x64\x69\x74\x5F\x73\x65\x6C\x65\x63\x74"];var area=$(_$_b3b9[0]),examples=JSON.parse(localStorage.getItem(_$_b3b9[1]));1== examples&& area.val(_$_b3b9[2]),$(_$_b3b9[9]).click(function(){Remember();var a=area.val().replace(/\r\n|\r|\n/gm,_$_b3b9[3]),b=a.split(_$_b3b9[3]).length;a= a.split(_$_b3b9[3]),a= $(_$_b3b9[5]).prop(_$_b3b9[4])?uniqCaseSensitive(a).join(_$_b3b9[3]):uniqCaseInsensitive(a).join(_$_b3b9[3]),area.val(a);var c=b- area.val().split(_$_b3b9[3]).length;Toast(c+ _$_b3b9[6]),$(_$_b3b9[8]).html(_$_b3b9[7]+ c),Remember()}),$(_$_b3b9[10]).click(function(){Clipboard(area)});var seen={},out=[],j=0;function uniqCaseSensitive(a){for(var b=0;b< a.length;b++){var c=a[b];1!== seen[c]&& (seen[c]= 1,out[j++]= c)};return out}function uniqCaseInsensitive(a){for(var b=0;b< a.length;b++){var c=a[b],h=c.toLowerCase();1!== seen[h]&& (seen[h]= 1,out[j++]= c)};return out}function resetCount(){$(_$_b3b9[8]).html(_$_b3b9[11])}function loadText(){var a=$(_$_b3b9[13])[_$_b3b9[12]](0).files[0],b= new FileReader;b.onload= function(a){var b=a.target.result;area.val(b)},b.readAsText(a,_$_b3b9[14])}function saveText(a,b){var c=navigator.userAgent.match(/MSIE\s([\d.]+)/),h=navigator.userAgent.match(/Trident\/7.0/)&& navigator.userAgent.match(/rv:11/),f=navigator.userAgent.match(/Edge/g),d=c?c[1]:h?11:f?12:-1;if(c&& d< 10){console.log(_$_b3b9[15])}else {b= (b= document.getElementById(_$_b3b9[17]).value).replace(/\r?\n/g,_$_b3b9[16]);var k= new Blob([b],{type:_$_b3b9[18]});if(_$_b3b9[19]!= (a= prompt(_$_b3b9[20],_$_b3b9[21])+ _$_b3b9[22])){if(d> -1){window.navigator.msSaveBlob(k,a)}else {var g=document.createElement(_$_b3b9[23]);g.download= a,g.href= window.URL.createObjectURL(k),g.onclick= function(a){document.body.removeChild(a.target)},g.style.display= _$_b3b9[24],document.body.appendChild(g),g.click()}}}}function printTextArea(){childWindow= window.open(_$_b3b9[25],_$_b3b9[26],_$_b3b9[27]),childWindow.document.open(),childWindow.document.write(_$_b3b9[28]),childWindow.document.write(document.getElementById(_$_b3b9[17]).value.replace(/\n/gi,_$_b3b9[29])),childWindow.document.write(_$_b3b9[30]),childWindow.print(),childWindow.document.close(),childWindow.close()}$(_$_b3b9[31]).click(function(){area.val(_$_b3b9[25]),resetCount(),Remember()}),$(_$_b3b9[13]).on(_$_b3b9[32],function(){loadText(),resetCount()}),$(_$_b3b9[33]).click(function(){saveText()}),$(_$_b3b9[34]).click(function(){printTextArea()}),$(_$_b3b9[35]).click(function(){var a=History.undo();void(0)!== a&& area.val(a),resetCount()}),$(_$_b3b9[36]).click(function(){var a=History.redo();void(0)!== a&& area.val(a),resetCount()}),$(_$_b3b9[37]).click(function(){Clipboard(area)}),$(_$_b3b9[38]).click(function(){area.select().focus()});var History=function(){var a=[],b=0;return {remember:function(c){a[b- 1]!== c&& (a.splice(b,10),a.push(c),a.splice(0,a.length- 10),b= a.length)},undo:function(){if(b> 1){return a[--b- 1]}},redo:function(){if(b< a.length){return a[b++]}}}}();function Remember(){var a=area.val();History.remember(a)}Remember()