qr_seed_mag.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko" lang="ko">
  3. <head>
  4. <title>QR Magstripe test with seed (prototype, not for general use)</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  6. <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" />
  7. <script type="text/javascript" src="jquery.min.js"></script>
  8. <script type="text/javascript" src="qrcode.js"></script>
  9. </head>
  10. <body>
  11. <input id="text" type="text" value="test" style="width:80%" />
  12. <br />
  13. <div id='seed'></div>
  14. <div id='clear_text'></div>
  15. <div id="qrcode" style="width:100px; height:100px; margin-top:15px;"></div>
  16. <script type="text/javascript">
  17. var seed = [
  18. "Eghahb3t", "sheiMu5e", "aPeeD9IP", "Daeno6xo", "OB4Ahpha", "Eevoo7ph", "Ow0ongea", "Phiinah2",
  19. "kohF2Tho", "ru1UPeix", "Thae3Eil", "ko6ahj0U", "Eivoo0Do", "Jai2hua0", "Rah3she0", "Sho3pifu",
  20. "Ri7Aoqu2", "Deep8Goh", "Gohv8gaz", "Iefoo9oh", "oeChoo2A", "ue9Xaeg0", "Naesoh9d", "ieng3Aid",
  21. "aegh9ooC", "aiJee4wi", "aiV3EeDa", "Ko3leida", "oYa6Nahh", "ee0EeG7I", "reiCah0e", "yes1geeM",
  22. "aiYoo0ho", "ahSh0hee", "juaPi4uv", "Niexuen2", "eiN6aePo", "xagh6Ooh", "Que6Mee3", "Boo8ahSh",
  23. "buj5Iej3", "oe3mieX8", "iiYaid1u", "ooj9Beex", "phai9Gei", "Shaiz4ce", "ahGaegh0", "cee0Ceew",
  24. "Taen3dah", "EirohTh0", "Ethooge7", "DohRu2ei", "ahBahk2n", "eirae8Ei", "Chae7caa", "Wee7Ahch",
  25. "ooshooY6", "xiep3ooM", "wa1Aic6W", "vou3iiNg", "ie1Ahnie", "Aechi6id", "Eihae7ho", "Aez0rai1",
  26. "Awai4bei", "sie8Eic0", "baetoo0S", "nahX8mee", "US7geeci", "Dopeet4E", "GeeQuo4k", "UuGh2kee",
  27. "phah0Aem", "Ue9quae5", "SieM3quo", "Oosh9Lao", "Oo1au3ah", "quaet4uS", "Nahshae9", "OhKeech8",
  28. "eRib1eij", "AeW2ap2v", "nah0Unay", "ieWoh6vo", "Yei8ooLi", "OhShaen7", "Hi9maeg9", "Xeizoo7O",
  29. "ahGhohn6", "Eagh2rog", "roW3vaeg", "ue6aeThe", "ieY1pu4b", "rooRoov1", "uiZ5thuG", "yegh2Oe9",
  30. "ohR1aese", "guNg2nu9", "maetiW7o", "Vau9oogh", "atuM7poh", "eeTh5ahr", "Ireph7ui", "hieNgou5",
  31. "eTeepho8", "ZuHochu5", "culoo6Ek", "tuSh1quu", "zo8ua3Ai", "Ookeeth2", "ahc1ahVe", "eeV0ooke",
  32. "xai0ai6H", "wohN7hai", "ith5Oor9", "uu9geQui", "AhHohsi4", "Fi6eiGho", "thahz8Ji", "Peimoo3p",
  33. "dah1TeBi", "rie8paeG", "Ou2eichu", "apae1IeK", "Aofai2nu", "HeiRoh7e", "Phi0Eaha", "Hebae5qu",
  34. "ce8Ibah5", "ohTa6dei", "aiX2sie0", "nohY4wae", "xaeWoh4a", "ohNush0r", "Mia6ooga", "Haebi0ie",
  35. "aC5lei2e", "pahYee7I", "deeth9Wa", "aip5Aiyi", "cahCi2Vu", "uBainae4", "aeje8eeL", "ceing6Ii",
  36. "ia0Zoh3l", "pie7XohY", "quoh6aCh", "nieta4In", "Noejie8o", "lei0AKai", "macaHoo0", "eo0quo6A",
  37. "jaey4UoX", "AhD0gac1", "Atom4aeG", "moo0Oque", "Eequu7Ah", "Fu5eivie", "euPh7ge2", "ohc4Wiev"
  38. ];
  39. var qrcode = new QRCode(document.getElementById("qrcode"), {
  40. width : 400,
  41. height : 400
  42. });
  43. function makeCode () {
  44. var elText = document.getElementById("text");
  45. if (!elText.value) {
  46. alert("Input a text");
  47. elText.focus();
  48. return;
  49. }
  50. var seed_idx = Math.floor(Math.random()*seed.length);
  51. var clear_text= "%" + seed[seed_idx] + "@" + elText.value;
  52. qrcode.makeCode(clear_text)
  53. var disp_seed = document.getElementById("seed");
  54. disp_seed.innerHTML = "seed[" + seed_idx + "]: " + seed[seed_idx];
  55. var disp_text = document.getElementById("clear_text");
  56. disp_text.innerHTML = clear_text;
  57. }
  58. makeCode();
  59. $("#text").
  60. on("blur", function () { makeCode(); }).
  61. on("keydown", function (e) { if (e.keyCode == 13) { makeCode(); } });
  62. </script>
  63. </body>
  64. </html>