whisper.cat/weboasis/text/js/difference-checker.js

1 line
2.8 KiB
JavaScript
Raw Normal View History

2023-10-05 23:28:32 +11:00
var _$_e28a=["\x23\x69\x6E\x70\x75\x74\x5F\x6F\x75\x74\x70\x75\x74","\x74\x61\x5F\x65\x78\x61\x6D\x70\x6C\x65\x73","\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x62\x61\x73\x65\x54\x65\x78\x74","\x6E\x65\x77\x54\x65\x78\x74","\x64\x69\x66\x66\x6F\x75\x74\x70\x75\x74","","\x43\x6F\x6C\x75\x6D\x6E\x20\x41","\x43\x6F\x6C\x75\x6D\x6E\x20\x42","\x67\x65\x74","\x23\x75\x70\x6C\x6F\x61\x64\x5F\x63\x6F\x6C\x41","\x23\x62\x61\x73\x65\x54\x65\x78\x74","\x55\x54\x46\x2D\x38","\x23\x75\x70\x6C\x6F\x61\x64\x5F\x63\x6F\x6C\x42","\x23\x6E\x65\x77\x54\x65\x78\x74","\x41\x70\x70\x6C\x65\x0A\x42\x61\x6E\x61\x6E\x61\x0A\x42\x69\x6C\x62\x65\x72\x72\x79\x0A\x42\x6C\x61\x63\x6B\x62\x65\x72\x72\x79\x0A\x43\x68\x65\x72\x72\x79\x0A\x4C\x65\x6D\x6F\x6E\x0A\x4C\x69\x6D\x65","\x41\x70\x70\x6C\x65\x0A\x41\x76\x6F\x63\x61\x64\x6F\x0A\x42\x61\x6E\x61\x6E\x61\x0A\x42\x6C\x61\x63\x6B\x62\x65\x72\x72\x79\x0A\x42\x6C\x75\x65\x62\x65\x72\x72\x79\x0A\x43\x68\x65\x72\x72\x79\x0A\x4C\x65\x6D\x6F\x6E\x73\x0A\x4C\x69\x6D\x65","\x23\x73\x65\x74\x74\x69\x6E\x67\x73","\x23\x64\x69\x66\x66\x69\x6E\x70\x75\x74\x2C\x20\x2E\x69\x6E\x70\x75\x74\x5F\x62\x74\x6E","\x23\x64\x69\x66\x66\x6F\x75\x74\x70\x75\x74\x2C\x20\x2E\x6F\x75\x74\x70\x75\x74\x5F\x62\x74\x6E","\x23\x63\x6F\x6D\x70\x61\x72\x65\x54\x65\x78\x74","\x23\x67\x6F\x42\x61\x63\x6B","\x23\x62\x61\x73\x65\x54\x65\x78\x74\x2C\x20\x23\x6E\x65\x77\x54\x65\x78\x74","\x2E\x64\x69\x66\x66","\x23\x63\x6C\x65\x61\x72\x41\x6C\x6C","\x23\x72\x65\x73\x65\x74\x41\x6C\x6C"];var area=$(_$_e28a[0]),examples=JSON.parse(localStorage.getItem(_$_e28a[1]));function diffUsingJS(a){_$_e28a[2];var f=function(a){return document.getElementById(a)},g=difflib.stringAsLines(f(_$_e28a[3]).value),c=difflib.stringAsLines(f(_$_e28a[4]).value),b= new difflib.SequenceMatcher(g,c).get_opcodes(),d=f(_$_e28a[5]);d.innerHTML= _$_e28a[6],d.appendChild(diffview.buildView({baseTextLines:g,newTextLines:c,opcodes:b,baseTextName:_$_e28a[7],newTextName:_$_e28a[8],viewType:a}))}function loadTextA(){var a=$(_$_e28a[10])[_$_e28a[9]](0).files[0],f= new FileReader;f.onload= function(a){var f=a.target.result;$(_$_e28a[11]).val(f)},f.readAsText(a,_$_e28a[12])}function loadTextB(){var a=$(_$_e28a[13])[_$_e28a[9]](0).files[0],f= new FileReader;f.onload= function(a){var f=a.target.result;$(_$_e28a[14]).val(f)},f.readAsText(a,_$_e28a[12])}1== examples&& ($(_$_e28a[11]).val(_$_e28a[15]),$(_$_e28a[14]).val(_$_e28a[16])),$(_$_e28a[20]).click(function(){var a=$(_$_e28a[17]).val();1== a?diffUsingJS(0):2== a&& diffUsingJS(1),$(_$_e28a[18]).hide(),$(_$_e28a[19]).show()}),$(_$_e28a[21]).click(function(){$(_$_e28a[19]).hide(),$(_$_e28a[18]).show()}),$(_$_e28a[24]).click(function(){$(_$_e28a[22]).val(_$_e28a[6]),$(_$_e28a[23]).hide()}),$(_$_e28a[25]).click(function(){$(_$_e28a[19]).hide(),$(_$_e28a[18]).show(),$(_$_e28a[22]).val(_$_e28a[6])})