»
EnglishFrenchVietnamese

Print - Message Transformer script - JavaScriptBank.com

Full version: jsB@nk » Text » Message Transformer script
URL: https://www.javascriptbank.com/message-transformer-script.html

Message Transformer script © JavaScriptBank.comTransform your text messages in a variety of ways, such as into 'all caps', 'pig Latin', or even 'encrypted form', using this fun script!

Full version: jsB@nk » Text » Message Transformer script
URL: https://www.javascriptbank.com/message-transformer-script.html



JavaScript
<script type="text/javascript">// Message Transformer script- By ViruSoft.net (http://www.virusoft.net)// Visit JavaScript Kit (http://www.javascriptkit.com)// for free JavaScript tutorials and scripts// This notice must stay intact for usefunction remember(){originalText = "";originalText = document.textConvForm.textConvArea.value;}function convert2ALLCAPS(){original = document.textConvForm.textConvArea.value;ALLCAPS = original.toUpperCase();document.textConvForm.textConvArea.value = ALLCAPS;}function convert2nocaps(){original = document.textConvForm.textConvArea.value;nocaps = original.toLowerCase();document.textConvForm.textConvArea.value = nocaps;}function convert2Hacker(){original = document.textConvForm.textConvArea.value;normal = ["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"];hacker = ["@","ß","¢","Ð","€","ƒ","ç","|¬","¡","¿","/<","|","^^","ñ","¤","þ","¶","®","§","†","ü",">","%%%","×","¥","Ž"];haxored = original;for (i = 0; i < normal.length; i++){haxored = haxored.replace(RegExp(normal[i],"gi"),hacker[i]);}haxored = haxored.replace(/%%%/gi,"vv");document.textConvForm.textConvArea.value = haxored;}function convert2PigLatin(){original = document.textConvForm.textConvArea.value;noriginal = original;noriginal = noriginal.replace(/\"/gi,"");working = new Array;working = noriginal.split(" ");for (i = 0; i < working.length; i++){firstChar = working[i].charAt(0);secondChar = working[i].charAt(1);thirdChar = working[i].charAt(2);wordLength = working[i].length;punctuation = ["!","?",";",":",".",","];upCaseLet = ["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"];if (firstChar == "a" || firstChar == "e" || firstChar == "i" || firstChar == "o" || firstChar == "u" || firstChar == "y" || firstChar == "A" || firstChar == "E" || firstChar == "I" || firstChar == "O" || firstChar == "U" || firstChar == "Y"){working[i]=working[i]+"way";}else if (firstChar == "q" || firstChar == "Q" && secondChar == "u" || secondChar == "U"){newWord="";for (l = 1; l < working[i].length; l++){newWord=newWord+working[i].charAt(l+1);}working[i]=newWord+firstChar+secondChar+"ay";}else if(isNaN(working[i])){if (secondChar != "a" && secondChar != "e" && secondChar != "i" && secondChar != "o" && secondChar != "u" && secondChar != "A" && secondChar != "E" && secondChar != "I" && secondChar != "O" && secondChar != "U"){if (thirdChar != "a" && thirdChar != "e" && thirdChar != "i" && thirdChar != "o" && thirdChar != "u" && thirdChar != "A" && thirdChar != "E" && thirdChar != "I" && thirdChar != "O" && thirdChar != "U"){newWord="";for (m = 2; m < working[i].length; m++){newWord=newWord+working[i].charAt(m+1);}working[i]=newWord+firstChar+secondChar+thirdChar+"ay";}else{newWord="";for (k = 1; k < working[i].length; k++){newWord=newWord+working[i].charAt(k+1);}working[i]=newWord+firstChar+secondChar+"ay";}}else{newWord="";for (j = 0; j < working[i].length; j++){newWord=newWord+working[i].charAt(j+1);}working[i]=newWord+firstChar+"ay";}}for (q = 0; q < punctuation.length; q++){if(working[i].indexOf(punctuation[q])!= -1){working[i] = working[i].replace(/\!/gi,"");working[i] = working[i].replace(/\?/gi,"");working[i] = working[i].replace(/\;/gi,"");working[i] = working[i].replace(/\:/gi,"");working[i] = working[i].replace(/\./gi,"");working[i] = working[i].replace(/\,/gi,"");if(punctuation[q] == ","){working[i] = working[i]+"%%%";}else{working[i] = working[i]+punctuation[q];}}}for (n = 0; n < upCaseLet.length; n++){if(working[i].indexOf(upCaseLet[n])!= -1){working[i] = working[i].toLowerCase();newWord="";for (o = 0; o < working[i].length; o++){newWord=newWord+working[i].charAt(o+1);}working[i] = working[i].charAt(0).toUpperCase()+newWord;}}}working = working.toString();working = working.replace(/,/gi," ");pigLatin = working.replace(/%%%/gi,",");document.textConvForm.textConvArea.value = pigLatin;}function convert2drawkcaB(){original = document.textConvForm.textConvArea.value;drawkcabWork = original.split("");drawkcabWork = drawkcabWork.reverse();drawkcab = "";for (i = 0; i < drawkcabWork.length; i++){drawkcab = drawkcab+drawkcabWork[i];}document.textConvForm.textConvArea.value = drawkcab;}function reSet(){document.textConvForm.textConvArea.value = originalText;}function copy(){copied = document.textConvForm.textConvArea.createTextRange();copied.execCommand("Copy");}function clearBox(){document.textConvForm.textConvArea.value = "";document.textConvForm.textConvArea.focus();}</script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<table cellpadding=2 cellspacing=1 bgColor=777777><tr><td><form name="textConvForm"><textarea name="textConvArea" rows=10 cols=30 wrap=soft>JavaScriptBank.com - Bank of over 2000+ free JavaScripts</textarea></td><td><input type="button" value="All Caps" onClick="remember();convert2ALLCAPS()"><br><input type="button" value="No Caps" onClick="remember();convert2nocaps()"><br><input type="button" value="Hackerize" onClick="remember();convert2Hacker()"><br><input type="button" value="Pig Latin" onClick="remember();convert2PigLatin()"><br><input type="button" value="Backward" onClick="remember();convert2drawkcaB()"><br><input type="button" value="Undo (Once)" onClick="reSet()"><br><input type="button" value="Copy" onClick="copy()"> <input type="button" value="Clear" onClick="remember();clearBox()"></td></tr></form></table><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->