User:Alexis Jazz/AJSJSMangler-mangled.js

window.AJSJSM={};var mw=window.mw;var AJSJSM=window.AJSJSM;$('body').append(' A J\' s J S M a n g l e r If you think this comes with any warranty you\'re an idiot. BEGONE    Remove comments  Remove some whitespace   Remove some newlines   Remove some more whitespace   Abbreviate some camelCase functions (very risky, variable names must be unique (or the same position perhaps also works), can\'t recycle the same name for different functions)   ALL OF THE ABOVE, YOLO! MANGLE  Log to console ');$('#AJSJSMall').on('change',function{$('#removecomments')[0].checked=$('#AJSJSMall')[0].checked;$('#AJSJSMclearwhitespace')[0].checked=$('#AJSJSMall')[0].checked;$('#AJSJSMclearnewlines')[0].checked=$('#AJSJSMall')[0].checked;$('#AJSJSMtrimplusisetc')[0].checked=$('#AJSJSMall')[0].checked;$('#AJSJSMabbrfunc')[0].checked=$('#AJSJSMall')[0].checked;});mw.util.addCSS('.AJSJSMletter{float:left;transition:all .5s ease-in;}.crooked{transform:rotate(1.5deg)}#unmangledSource,#mangledSource{width:49%;display:unset;margin:0.5%');$('.AJSJSMletter').on('click',function{AJSJSM.AC;});AJSJSM.AB=function(text){return text.replace(/\$/g,'$$$$');};AJSJSM.AC=function(degrees){for(AJSJSM.warpTitleInt=0;AJSJSM.warpTitleInt<$('.AJSJSMletter').length;AJSJSM.warpTitleInt++){if(typeof degrees=='undefined'){AJSJSM.AD=(Math.floor(Math.random* 60)-30).toString;}else{AJSJSM.AD=degrees;}$('.AJSJSMletter')[AJSJSM.warpTitleInt].style='transform:rotate('+AJSJSM.AD+'deg)';}};$('#mangle').on('click',function{$('#mangle').addClass('crooked');jQuery(document).ready(function{AJSJSM.AM;});});var DelayedWarp=setInterval(function{clearInterval(DelayedWarp);AJSJSM.AC;},50);AJSJSM.AE=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];AJSJSM.AF=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9'];AJSJSM.AG=0;AJSJSM.AH=function{if(AJSJSM.AG<1612){AJSJSM.AI=AJSJSM.AG /62;AJSJSM.AI=Math.floor(AJSJSM.AI);AJSJSM.AJ=AJSJSM.AI *62;AJSJSM.AJ=AJSJSM.AG - AJSJSM.AJ;AJSJSM.AK=AJSJSM.AE[AJSJSM.AI]+AJSJSM.AF[AJSJSM.AJ];}else if(AJSJSM.AG<99944){AJSJSM.AI=AJSJSM.AG /62/ 62;AJSJSM.AI=Math.floor(AJSJSM.AI);AJSJSM.AJ=AJSJSM.AI *62* 62;AJSJSM.AJ=Math.floor((AJSJSM.AG - AJSJSM.AJ)/ 62);AJSJSM.AL=AJSJSM.AI *62* 62;AJSJSM.AL=AJSJSM.AL+(AJSJSM.AJ *62);AJSJSM.AL=Math.floor(AJSJSM.AG - AJSJSM.AL);AJSJSM.AK=AJSJSM.AE[AJSJSM.AI]+AJSJSM.AF[AJSJSM.AJ]+AJSJSM.AF[AJSJSM.AL];}else{window.alert('fuck no');}AJSJSM.AG++;return AJSJSM.AK;};AJSJSM.AM=function{if($('#unmangledSource')[0].value==''){$('#unmangledSource')[0].value='window.myScript = {};\nvar myScript = window.myScript;\nmyScript.testString1 = \'str1\';\nmyScript.testString2 = \'str2\';\nmyScript.doThing = function(firstNote,secondNote) {\n	$(\'#firstHeading\').prepend(myScript.testString1);\n	window.alert(myScript.testString2);\n	console.log(firstNote);\n	console.log(secondNote);\n};\nmyScript.doThing(\'Note 1\'.replace(/Note 1/g,\'Note 1 (replaced)\'),\'Note 2\');';}AJSJSM.AN=$('#unmangledSource')[0].value;AJSJSM.AO=AJSJSM.AN.match(/(^|\n)([ \t]*)window\.([^\s=]*)[\s]*=[\s]*\{\}/);if(AJSJSM.AO&&AJSJSM.AO[3]){AJSJSM.AO=AJSJSM.AO[3];}else{return;} AJSJSM.AP=new RegExp('([ \n\t])'+AJSJSM.AO+'\\.([A-Za-z0-9_]*)(?![A-Za-z0-9_])(\.|[\t\n ]?\(|[\t\n ]?\)|[\t\n ]?=|[\t\n ]?\\+|,|\[|[\t\n ]*\]|;|[\t\n ]?[<>]|[\t\n ]*\}|[\t\n ]?\!| \-|[\t\n ]?&&|[\t\n ]?\|\||[\t\n ]?\\*|[\t\n ]?\/)','g');	AJSJSM.AQ=[];AJSJSM.AR=AJSJSM.AN.match(AJSJSM.AP);if(! AJSJSM.AR){return;}if(AJSJSM.AN.match(/start[ ]unmangled source/)){AJSJSM.AN=AJSJSM.AN.replace(/[^]*start[ ]unmangled source.*[\n]?/,).replace(/[\n]?.*end[ ]unmangled source[^]*/,);}AJSJSM.AN=AJSJSM.AN.replace(new RegExp('.*'+AJSJSM.AO+'\.debug.*','g'),'').replace(/\n\n/g,'\n').replace(/\n\n/g,'\n');AJSJSM.AS=AJSJSM.AN.match(/(^|[;\n\t\{\}\,])[\t ]*\/\/.*/g); AJSJSM.AN=AJSJSM.AN.replace(/(^|[;\n\t\{\}\,])[\t ]*\/\/.*/g,'$1');AJSJSM.AT=AJSJSM.AN.match(/(^|\n|\t| )\/[\\*](([^\\*]|[\\*][^\/])*)\*\//g); AJSJSM.AN=AJSJSM.AN.replace(/(^|\n|\t| )\/[\\*](([^\\*]|[\\*][^\/])*)\*\//g,'$1');AJSJSM.AU=AJSJSM.AN.match(/[^\\]\'(([^\n\'\\]|\\.)*)(?!\\)\'/g);AJSJSM.AN=AJSJSM.AN.replace(/([^\\])\'(([^\n\'\\]|\\.)*)(?!\\)\'/g,'$1\'AJSJSM'+'SINGLEQUOTESTRING\'');AJSJSM.AV=AJSJSM.AN.match(/[^\\]"(([^\n"\\]|\\.)*)(?!\\)"/g);AJSJSM.AN=AJSJSM.AN.replace(/([^\\])"(([^\n"\\]|\\.)*)(?!\\)"/g,'$1"AJSJSM'+'DOUBLEQUOTESTRING"');AJSJSM.AW=AJSJSM.AN.match(/(\.replace\(|\.match\\/(([^\\\/\n]|\\.)*)\//g);AJSJSM.AN=AJSJSM.AN.replace(/(\.replace\(|\.match\\/(([^\\\/\n]|\\.)*)\//g,'$1/AJSJSM'+'REGEXP/');for(AJSJSM.namesArrInt=0;AJSJSM.namesArrInt<AJSJSM.AR.length;AJSJSM.namesArrInt++){ AJSJSM.AX=AJSJSM.AR[AJSJSM.namesArrInt].match(new RegExp('[^]*'+AJSJSM.AO+'\.([A-Za-z0-9_]+)[^]*'));if(AJSJSM.AX&&AJSJSM.AX[1]){AJSJSM.AX=AJSJSM.AX[1];}if(AJSJSM.AQ.indexOf(AJSJSM.AX)==-1&&AJSJSM.AX){AJSJSM.AQ.push(AJSJSM.AX);AJSJSM.AY=AJSJSM.AH;AJSJSM.AN=AJSJSM.AN.replace(new RegExp('([^\.A-Za-z0-9_])'+AJSJSM.AO+'\.'+AJSJSM.AX+'([^A-Za-z0-9_])','g'),'$1'+AJSJSM.AO+'.'+AJSJSM.AY+'$2');}}if($('#AJSJSMclearwhitespace')[0].checked){AJSJSM.AN=AJSJSM.AN.replace(/\n[ \t]*/g,'\n').replace(/[\t ]*(if|else|else if|while|for)[\t ]*(\(|\{)[\t ]*/g,'$1$2').replace(/[ ]?\)[ ]?\{\n/g,'){\n').replace(/[ ]?(\))?[ ]?(&&|==|!=|\|\|)[ ]?(\?[ ]?/g,'$1$2$3').replace(new RegExp(mw.util.escapeRegExp(AJSJSM.AO)+'(\.[A-Za-z0-9]*)[ ]?=[ ]?','g'),AJSJSM.AO+'$1=').replace(/',[\t]*'/g,'\',\).replace(/ + /g,'+').replace(/\] \)/,'])');}if($('#AJSJSMtrimplusisetc')[0].checked){AJSJSM.AN=AJSJSM.AN.replace(/([^A-Za-z]) ([^A-Za-z])/g,'$1$2');AJSJSM.AN=AJSJSM.AN.replace(/[ \n\t]*\},[ ]?\{[ \n\t]*/g,'},{');AJSJSM.AN=AJSJSM.AN.replace(/[ \n\t]*([\+=])[ \n\t]*/g,'$1');AJSJSM.AN=AJSJSM.AN.replace(/[ \n\t]*\}[ \n\t]*\,[ \n\t]*\{[ \n\t]*/g,'},{');AJSJSM.AN=AJSJSM.AN.replace(/\'\, /g,'\',');AJSJSM.AN=AJSJSM.AN.replace(/\)\{ /g,'){');AJSJSM.AN=AJSJSM.AN.replace(/,([a-z]*): /g,',$1:');AJSJSM.AN=AJSJSM.AN.replace(/,[ \n\t]*([a-z]*):[ \n\t]*/g,',$1:');AJSJSM.AN=AJSJSM.AN.replace(/\{[ \n\t]*([a-z]*):[ \n\t]*/g,'{$1:');AJSJSM.AN=AJSJSM.AN.replace(/, /g,',');AJSJSM.AN=AJSJSM.AN.replace(/[ ]?function[ ]?/g,'function');AJSJSM.AN=AJSJSM.AN.replace(/\['/g,'[\);AJSJSM.AN=AJSJSM.AN.replace(/[ ]?<[ ]?/g,'<');AJSJSM.AN=AJSJSM.AN.replace(/[ ]?>[ ]?/g,'>');AJSJSM.AN=AJSJSM.AN.replace(/function\([ ]?([^ \)]*)[ ]?\)/g,'function($1)');AJSJSM.AN=AJSJSM.AN.replace(/\[[ ]?([A-Za-z0-9\.]*)[ ]?\]/g,'[$1]');AJSJSM.AN=AJSJSM.AN.replace(/: \[/g,':['); }if($('#AJSJSMabbrfunc')[0].checked){AJSJSM.AZ=[]; AJSJSM.Aa=AJSJSM.AN.match(/function[ ]?\([ ]?([a-z][A-Za-z0-9]*[A-Z][A-Za-z0-9]*)/g);if(AJSJSM.Aa){for(AJSJSM.funcArrInt=0;AJSJSM.funcArrInt<AJSJSM.Aa.length;AJSJSM.funcArrInt++){if(! AJSJSM.AZ.includes(AJSJSM.Aa[AJSJSM.funcArrInt])){AJSJSM.Ab=AJSJSM.Aa[AJSJSM.funcArrInt].replace(/function[ ]?\([ ]?/,);AJSJSM.AZ.push(AJSJSM.Ab);AJSJSM.AN=AJSJSM.AN.replace(new RegExp('([^A-Z-a-z0-9])'+AJSJSM.Ab+'([^A-Z-a-z0-9])','g'),'$1a$2');}}} AJSJSM.Aa=AJSJSM.AN.match(/function[ ]?\([ ]?[A-Za-z0-9]*,[ ]?([a-z][A-Za-z0-9]*[A-Z][A-Za-z0-9]*)/g);if(AJSJSM.Aa){for(AJSJSM.funcArrInt=0;AJSJSM.funcArrInt<AJSJSM.Aa.length;AJSJSM.funcArrInt++){if(! AJSJSM.AZ.includes(AJSJSM.Aa[AJSJSM.funcArrInt])){AJSJSM.Ab=AJSJSM.Aa[AJSJSM.funcArrInt].replace(/function[ ]?\([ ]?[A-Za-z0-9]*,[ ]?/,);AJSJSM.AZ.push(AJSJSM.Ab);AJSJSM.AN=AJSJSM.AN.replace(new RegExp('([^A-Z-a-z0-9])'+AJSJSM.Ab+'([^A-Z-a-z0-9])','g'),'$1b$2');}}} AJSJSM.Aa=AJSJSM.AN.match(/function[ ]?\([ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?([a-z][A-Za-z0-9]*[A-Z][A-Za-z0-9]*)/g);if(AJSJSM.Aa){for(AJSJSM.funcArrInt=0;AJSJSM.funcArrInt<AJSJSM.Aa.length;AJSJSM.funcArrInt++){if(! AJSJSM.AZ.includes(AJSJSM.Aa[AJSJSM.funcArrInt])){AJSJSM.Ab=AJSJSM.Aa[AJSJSM.funcArrInt].replace(/function[ ]?\([ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?/,);AJSJSM.AZ.push(AJSJSM.Ab);AJSJSM.AN=AJSJSM.AN.replace(new RegExp('([^A-Z-a-z0-9])'+AJSJSM.Ab+'([^A-Z-a-z0-9])','g'),'$1c$2');}}} AJSJSM.Aa=AJSJSM.AN.match(/function[ ]?\([ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?([a-z][A-Za-z0-9]*[A-Z][A-Za-z0-9]*)/g);if(AJSJSM.Aa){for(AJSJSM.funcArrInt=0;AJSJSM.funcArrInt<AJSJSM.Aa.length;AJSJSM.funcArrInt++){if(! AJSJSM.AZ.includes(AJSJSM.Aa[AJSJSM.funcArrInt])){AJSJSM.Ab=AJSJSM.Aa[AJSJSM.funcArrInt].replace(/function[ ]?\([ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?/,);AJSJSM.AZ.push(AJSJSM.Ab);AJSJSM.AN=AJSJSM.AN.replace(new RegExp('([^A-Z-a-z0-9])'+AJSJSM.Ab+'([^A-Z-a-z0-9])','g'),'$1d$2');}}} AJSJSM.Aa=AJSJSM.AN.match(/function[ ]?\([ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?([a-z][A-Za-z0-9]*[A-Z][A-Za-z0-9]*)/g);if(AJSJSM.Aa){for(AJSJSM.funcArrInt=0;AJSJSM.funcArrInt<AJSJSM.Aa.length;AJSJSM.funcArrInt++){if(! AJSJSM.AZ.includes(AJSJSM.Aa[AJSJSM.funcArrInt])){AJSJSM.Ab=AJSJSM.Aa[AJSJSM.funcArrInt].replace(/function[ ]?\([ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?/,);AJSJSM.AZ.push(AJSJSM.Ab);AJSJSM.AN=AJSJSM.AN.replace(new RegExp('([^A-Z-a-z0-9])'+AJSJSM.Ab+'([^A-Z-a-z0-9])','g'),'$1e$2');}}} AJSJSM.Aa=AJSJSM.AN.match(/function[ ]?\([ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?([a-z][A-Za-z0-9]*[A-Z][A-Za-z0-9]*)/g);if(AJSJSM.Aa){for(AJSJSM.funcArrInt=0;AJSJSM.funcArrInt<AJSJSM.Aa.length;AJSJSM.funcArrInt++){if(! AJSJSM.AZ.includes(AJSJSM.Aa[AJSJSM.funcArrInt])){AJSJSM.Ab=AJSJSM.Aa[AJSJSM.funcArrInt].replace(/function[ ]?\([ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?/,);AJSJSM.AZ.push(AJSJSM.Ab);AJSJSM.AN=AJSJSM.AN.replace(new RegExp('([^A-Z-a-z0-9])'+AJSJSM.Ab+'([^A-Z-a-z0-9])','g'),'$1f$2');}}} AJSJSM.Aa=AJSJSM.AN.match(/function[ ]?\([ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?([a-z][A-Za-z0-9]*[A-Z][A-Za-z0-9]*)/g);if(AJSJSM.Aa){for(AJSJSM.funcArrInt=0;AJSJSM.funcArrInt<AJSJSM.Aa.length;AJSJSM.funcArrInt++){if(! AJSJSM.AZ.includes(AJSJSM.Aa[AJSJSM.funcArrInt])){AJSJSM.Ab=AJSJSM.Aa[AJSJSM.funcArrInt].replace(/function[ ]?\([ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?/,);AJSJSM.AZ.push(AJSJSM.Ab);AJSJSM.AN=AJSJSM.AN.replace(new RegExp('([^A-Z-a-z0-9])'+AJSJSM.Ab+'([^A-Z-a-z0-9])','g'),'$1g$2');}}} AJSJSM.Aa=AJSJSM.AN.match(/function[ ]?\([ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?([a-z][A-Za-z0-9]*[A-Z][A-Za-z0-9]*)/g);if(AJSJSM.Aa){for(AJSJSM.funcArrInt=0;AJSJSM.funcArrInt<AJSJSM.Aa.length;AJSJSM.funcArrInt++){if(! AJSJSM.AZ.includes(AJSJSM.Aa[AJSJSM.funcArrInt])){AJSJSM.Ab=AJSJSM.Aa[AJSJSM.funcArrInt].replace(/function[ ]?\([ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?[A-Za-z0-9]*,[ ]?/,);AJSJSM.AZ.push(AJSJSM.Ab);AJSJSM.AN=AJSJSM.AN.replace(new RegExp('([^A-Z-a-z0-9])'+AJSJSM.Ab+'([^A-Z-a-z0-9])','g'),'$1h$2');}}}}AJSJSM.AW[0].replace(/^\.(replace|match)\(/,);if(AJSJSM.AW){for(AJSJSM.regExpsInt=0;AJSJSM.regExpsInt<AJSJSM.AW.length;AJSJSM.regExpsInt++){AJSJSM.AN=AJSJSM.AN.replace(/\/[A]JSJSMREGEXP\//,AJSJSM.AB(AJSJSM.AW[AJSJSM.regExpsInt].replace(/^\.(replace|match)\(/,)));}}	if(AJSJSM.AV){for(AJSJSM.doubleQuoteStringsInt=0;AJSJSM.doubleQuoteStringsInt<AJSJSM.AV.length;AJSJSM.doubleQuoteStringsInt++){AJSJSM.AN=AJSJSM.AN.replace(/"[A]JSJSMDOUBLEQUOTESTRING"/,'"'+AJSJSM.AB(AJSJSM.AV[AJSJSM.doubleQuoteStringsInt].slice(2).slice(0,-1))+'"');}}if(AJSJSM.AU){for(AJSJSM.singleQuoteStringsInt=0;AJSJSM.singleQuoteStringsInt<AJSJSM.AU.length;AJSJSM.singleQuoteStringsInt++){AJSJSM.AN=AJSJSM.AN.replace(/'[A]JSJSMSINGLEQUOTESTRING'/,'\+AJSJSM.AB(AJSJSM.AU[AJSJSM.singleQuoteStringsInt].slice(2).slice(0,-1))+'\);}}if($('#AJSJSMclearnewlines')[0].checked){AJSJSM.AN=AJSJSM.AN.replace(/([;\{\}\,])\n/g,'$1').replace(/[\n]{2,}/g,'\n').replace(/'[ ]?\+[ ]?\n[ ]?'/g,);}if($('#removecomments')[0].checked){AJSJSM.AN=AJSJSM.AN.replace(/[A]JSJSMSINGLELINECOMMENT/g,).replace(/[A]JSJSMMULTILINECOMMENT/g,'');}else{if(AJSJSM.AT){for(AJSJSM.multiLineCmtInt=0;AJSJSM.multiLineCmtInt<AJSJSM.AT.length;AJSJSM.multiLineCmtInt++){AJSJSM.AN=AJSJSM.AN.replace(/\([A]JSJSMMULTILINECOMMENT\)/,AJSJSM.AB(AJSJSM.AT[AJSJSM.multiLineCmtInt]));}}if(AJSJSM.AS){for(AJSJSM.singleLineCmtInt=0;AJSJSM.singleLineCmtInt<AJSJSM.AS.length;AJSJSM.singleLineCmtInt++){AJSJSM.AN=AJSJSM.AN.replace(/\([A]JSJSMSINGLELINECOMMENT\)/,AJSJSM.AB(AJSJSM.AS[AJSJSM.singleLineCmtInt]));}}}$('#mangledSource')[0].value=AJSJSM.AN.trim;$('#mangle').removeClass('crooked');AJSJSM.AC;};