whisper.cat/weboasis/text/js/extract-column.js
2023-10-05 23:28:32 +11:00

1 line
4.5 KiB
JavaScript

var _$_c3b5=["\x23\x69\x6E\x70\x75\x74\x5F\x6F\x75\x74\x70\x75\x74","\x74\x61\x5F\x65\x78\x61\x6D\x70\x6C\x65\x73","\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","\x41\x31\u2014\x42\x31\u2014\x43\x31\u2014\x44\x31\x0A\x41\x32\u2014\x42\x32\u2014\x43\x32\u2014\x44\x32\x0A\x41\x33\u2014\x42\x33\u2014\x43\x33\u2014\x44\x33\x0A\x41\x34\u2014\x42\x34\u2014\x43\x34\u2014\x44\x34\x0A\x41\x35\u2014\x42\x35\u2014\x43\x35\u2014\x44\x35","\x32","\x23\x63\x6F\x6C\x4E\x75\x6D","\u2014","\x23\x64\x65\x6C\x69\x6D\x69\x74\x53\x74\x72","\x0A","\x45\x78\x74\x72\x61\x63\x74\x65\x64\x20\x63\x6F\x6C\x75\x6D\x6E\x20","\x23\x65\x78\x74\x72\x61\x63\x74\x54\x65\x78\x74","\x2E\x63\x6C\x69\x70\x62\x6F\x61\x72\x64","\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=$(_$_c3b5[0]),examples=JSON.parse(localStorage.getItem(_$_c3b5[1]));function loadText(){var b=$(_$_c3b5[3])[_$_c3b5[2]](0).files[0],d= new FileReader;d.onload= function(b){var d=b.target.result;area.val(d)},d.readAsText(b,_$_c3b5[4])}function saveText(b,d){var g=navigator.userAgent.match(/MSIE\s([\d.]+)/),a=navigator.userAgent.match(/Trident\/7.0/)&& navigator.userAgent.match(/rv:11/),f=navigator.userAgent.match(/Edge/g),c=g?g[1]:a?11:f?12:-1;if(g&& c< 10){console.log(_$_c3b5[5])}else {d= (d= document.getElementById(_$_c3b5[7]).value).replace(/\r?\n/g,_$_c3b5[6]);var h= new Blob([d],{type:_$_c3b5[8]});if(_$_c3b5[9]!= (b= prompt(_$_c3b5[10],_$_c3b5[11])+ _$_c3b5[12])){if(c> -1){window.navigator.msSaveBlob(h,b)}else {var j=document.createElement(_$_c3b5[13]);j.download= b,j.href= window.URL.createObjectURL(h),j.onclick= function(b){document.body.removeChild(b.target)},j.style.display= _$_c3b5[14],document.body.appendChild(j),j.click()}}}}function printTextArea(){childWindow= window.open(_$_c3b5[15],_$_c3b5[16],_$_c3b5[17]),childWindow.document.open(),childWindow.document.write(_$_c3b5[18]),childWindow.document.write(document.getElementById(_$_c3b5[7]).value.replace(/\n/gi,_$_c3b5[19])),childWindow.document.write(_$_c3b5[20]),childWindow.print(),childWindow.document.close(),childWindow.close()}1== examples&& (area.val(_$_c3b5[21]),$(_$_c3b5[23]).val(_$_c3b5[22]),$(_$_c3b5[25]).val(_$_c3b5[24])),$(_$_c3b5[28]).click(function(){Remember();for(var b=area.val().replace(/\r\n|\r|\n/gm,_$_c3b5[26]).split(_$_c3b5[26]),d=$(_$_c3b5[25]).val(),g=$(_$_c3b5[23]).val()- 1,a= new Array,f=( new Array,_$_c3b5[15]),c=0;c< b.length;c++){f= null!= (f= b[c].split(d)[g])?f:_$_c3b5[15],a[c]= f};b= a.join(_$_c3b5[26]),area.val(b),Toast(_$_c3b5[27]+ (g+ 1)),Remember()}),$(_$_c3b5[29]).click(function(){Clipboard(area)}),$(_$_c3b5[30]).click(function(){area.val(_$_c3b5[15]),Remember()}),$(_$_c3b5[3]).on(_$_c3b5[31],function(){loadText()}),$(_$_c3b5[32]).click(function(){saveText()}),$(_$_c3b5[33]).click(function(){printTextArea()}),$(_$_c3b5[34]).click(function(){var b=History.undo();void(0)!== b&& area.val(b)}),$(_$_c3b5[35]).click(function(){var b=History.redo();void(0)!== b&& area.val(b)}),$(_$_c3b5[36]).click(function(){Clipboard(area)}),$(_$_c3b5[37]).click(function(){area.select().focus()});var History=function(){var b=[],d=0;return {remember:function(g){b[d- 1]!== g&& (b.splice(d,10),b.push(g),b.splice(0,b.length- 10),d= b.length)},undo:function(){if(d> 1){return b[--d- 1]}},redo:function(){if(d< b.length){return b[d++]}}}}();function Remember(){var b=area.val();History.remember(b)}Remember()