whisper.cat/weboasis/text/js/center-text.js

1 line
4.8 KiB
JavaScript
Raw Normal View History

2023-10-05 23:28:32 +11:00
var _$_6cb9=["\x23\x69\x6E\x70\x75\x74\x5F\x6F\x75\x74\x70\x75\x74","\x74\x61\x5F\x65\x78\x61\x6D\x70\x6C\x65\x73","\x23\x73\x65\x74\x74\x69\x6E\x67\x73","\x23\x70\x61\x64\x43\x68\x61\x72","\x23\x70\x61\x64\x4C\x65\x6E\x67\x74\x68","\x0A","","\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\x20\x73\x74\x79\x6C\x65\x3D\x22\x66\x6F\x6E\x74\x2D\x66\x61\x6D\x69\x6C\x79\x3A\x20\x43\x6F\x6E\x73\x6F\x6C\x61\x73\x2C\x20\x43\x6F\x75\x72\x69\x65\x72\x2C\x20\x4D\x6F\x6E\x61\x63\x6F\x6F\x2C\x20\x6D\x6F\x6E\x6F\x73\x70\x61\x63\x65\x3B\x6C\x69\x6E\x65\x2D\x68\x65\x69\x67\x68\x74\x3A\x31\x2E\x35\x3B\x77\x68\x69\x74\x65\x2D\x73\x70\x61\x63\x65\x3A\x70\x72\x65\x22\x3E","\x3C\x62\x72\x3E","\x3C\x2F\x62\x6F\x64\x79\x3E\x3C\x2F\x68\x74\x6D\x6C\x3E","\x48\x69\x0A\x48\x65\x6C\x6C\x6F\x0A\x57\x65\x6C\x63\x6F\x6D\x65\x21","\x23\x63\x65\x6E\x74\x65\x72\x54\x65\x78\x74","\x20","\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=$(_$_6cb9[0]),examples=JSON.parse(localStorage.getItem(_$_6cb9[1]));function padLines(){$(_$_6cb9[2]).val();var a,b=$(_$_6cb9[3]).val(),c=$(_$_6cb9[4]).val();isNaN(c)?c= 0:c*= 1;var g,d,f,h=area.val().replace(/\r\n|\r|\n/gm,_$_6cb9[5]).split(_$_6cb9[5]);h.length> 1&& _$_6cb9[6]== h[h.length- 1]&& h.splice(-1,1);for(a= 0;a< h.length;a++){if(h[a]= h[a].trim(),h[a].length< c){for(d= Math.floor((c- h[a].length)/ 2),f= _$_6cb9[6],g= 0;g< d;g++){f+= b};h[a]= f+ h[a],h[a]= h[a].rpad(c,b)}};h= h.join(_$_6cb9[5]),area.val(h)}function loadText(){var a=$(_$_6cb9[8])[_$_6cb9[7]](0).files[0],b= new FileReader;b.onload= function(a){var b=a.target.result;area.val(b)},b.readAsText(a,_$_6cb9[9])}function saveText(a,b){var c=navigator.userAgent.match(/MSIE\s([\d.]+)/),g=navigator.userAgent.match(/Trident\/7.0/)&& navigator.userAgent.match(/rv:11/),d=navigator.userAgent.match(/Edge/g),f=c?c[1]:g?11:d?12:-1;if(c&& f< 10){console.log(_$_6cb9[10])}else {b= (b= document.getElementById(_$_6cb9[12]).value).replace(/\r?\n/g,_$_6cb9[11]);var h= new Blob([b],{type:_$_6cb9[13]});if(_$_6cb9[14]!= (a= prompt(_$_6cb9[15],_$_6cb9[16])+ _$_6cb9[17])){if(f> -1){window.navigator.msSaveBlob(h,a)}else {var j=document.createElement(_$_6cb9[18]);j.download= a,j.href= window.URL.createObjectURL(h),j.onclick= function(a){document.body.removeChild(a.target)},j.style.display= _$_6cb9[19],document.body.appendChild(j),j.click()}}}}function printTextArea(){childWindow= window.open(_$_6cb9[6],_$_6cb9[20],_$_6cb9[21]),childWindow.document.open(),childWindow.document.write(_$_6cb9[22]),childWindow.document.write(document.getElementById(_$_6cb9[12]).value.replace(/\n/gi,_$_6cb9[23])),childWindow.document.write(_$_6cb9[24]),childWindow.print(),childWindow.document.close(),childWindow.close()}1== examples&& area.val(_$_6cb9[25]),$(_$_6cb9[26]).click(function(){Remember();area.val().replace(/\r\n|\r|\n/gm,_$_6cb9[5]);padLines(),Remember()}),String.prototype.rpad= function(a,b){if(void(0)=== b){b= _$_6cb9[27]};for(var c=this;c.length< a;){