Advertisement
johnburn

Untitled

Nov 23rd, 2011
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.55 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2.    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>Copy Paste Lover Generator</title>
  7. <link rel="stylesheet" href="stylesheet.css" type="text/css" charset="utf-8">
  8. <meta http-equiv="content-type" content="text-html; charset=utf-8">
  9. <script type="text/javascript">
  10.  var autori = new Array('');
  11.  var autocon = new Array('');
  12.  var original = new Array('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', ' ');
  13.  var concode = new Array('а', 'b', 'с', 'd', 'е', 'f', 'g', 'h', 'і', 'ј', 'k', 'l', 'm', 'n', 'о', 'р', 'q', 'r', 'ѕ', 't', 'u', 'v', 'w', 'x', 'у', 'z', ' ');
  14.  function translateText() {
  15.      var inputString = document.getElementById('input').value;
  16.      if (document.getElementById('conversionType').value == "e") {
  17.          for (i = 0; i < autori.length; ++i) inputString = inputString.replace(new RegExp(autori[i], "gi"), autocon[i]);
  18.         for (i = 0; i < original.length; ++i) inputString = inputString.replace(new RegExp(original[i], "gi"), concode[i]);
  19.     } else {
  20.         for (i = 0; i < concode.length; ++i) inputString = inputString.replace(new RegExp(RegExp.escape(concode[i]), "g"), original[i]);
  21.         for (i = 0; i < autocon.length; ++i) inputString = inputString.replace(new RegExp(RegExp.escape(autocon[i]), "g"), autori[i]);
  22.     }
  23.     document.getElementById('input').value = inputString;
  24. }
  25. RegExp.escape = function (text) {
  26.     if (!arguments.callee.sRE) {
  27.         var specials = ['/', '.', '*', '+', '?', '|', '$', '(', ')', '[', ']', '{', '}', '\\'];
  28.         arguments.callee.sRE = new RegExp('(\\' + specials.join('|\\') + ')', 'g');
  29.     }
  30.     return text.replace(arguments.callee.sRE, '\\$1');
  31. }
  32. </script>
  33.  
  34.  
  35. </head>
  36.  
  37. <body>
  38.  
  39. <div id="header">
  40.   <div align="center"><img src="images/logo.png" width="370" height="200" /></div>
  41. </div>
  42. <label for="input">
  43. </label>
  44. <div align="center">
  45.   <p><br />
  46.       <textarea id="input" name="input" rows="10" cols="80"
  47.    style="font-weight: bold;"></textarea>
  48.     <br />
  49.   </p>
  50.   <p>
  51.     <input type="submit" value="Convert"
  52.     onclick="translateText();" />
  53.     <select id="conversionType">
  54.       <option value="e">Convert</option>
  55.       <option value="3">Revert</option>
  56.           </select>
  57.     </p>
  58.   <p>&nbsp;</p>
  59. </div>
  60.  
  61. </body>
  62.  
  63. </html>
  64.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement