Pārlūkot izejas kodu

testing qr generator for new PIU

clementinecomputing 4 gadi atpakaļ
vecāks
revīzija
00581abec8

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 2 - 0
server/qr_generator/jquery.min.js


+ 81 - 0
server/qr_generator/qr_seed_mag.html

@@ -0,0 +1,81 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko" lang="ko">
+  <head>
+    <title>Cross-Browser QRCode generator for Javascript</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" />
+    <script type="text/javascript" src="jquery.min.js"></script>
+    <script type="text/javascript" src="qrcode.js"></script>
+  </head>
+
+  <body>
+    <input id="text" type="text" value="test" style="width:80%" />
+    <br />
+    <div id='seed'></div>
+    <div id='clear_text'></div>
+    <div id="qrcode" style="width:100px; height:100px; margin-top:15px;"></div>
+
+    <script type="text/javascript">
+
+      var seed = [
+        "Eghahb3t", "sheiMu5e", "aPeeD9IP", "Daeno6xo", "OB4Ahpha", "Eevoo7ph", "Ow0ongea", "Phiinah2",
+        "kohF2Tho", "ru1UPeix", "Thae3Eil", "ko6ahj0U", "Eivoo0Do", "Jai2hua0", "Rah3she0", "Sho3pifu",
+        "Ri7Aoqu2", "Deep8Goh", "Gohv8gaz", "Iefoo9oh", "oeChoo2A", "ue9Xaeg0", "Naesoh9d", "ieng3Aid",
+        "aegh9ooC", "aiJee4wi", "aiV3EeDa", "Ko3leida", "oYa6Nahh", "ee0EeG7I", "reiCah0e", "yes1geeM",
+        "aiYoo0ho", "ahSh0hee", "juaPi4uv", "Niexuen2", "eiN6aePo", "xagh6Ooh", "Que6Mee3", "Boo8ahSh",
+        "buj5Iej3", "oe3mieX8", "iiYaid1u", "ooj9Beex", "phai9Gei", "Shaiz4ce", "ahGaegh0", "cee0Ceew",
+        "Taen3dah", "EirohTh0", "Ethooge7", "DohRu2ei", "ahBahk2n", "eirae8Ei", "Chae7caa", "Wee7Ahch",
+        "ooshooY6", "xiep3ooM", "wa1Aic6W", "vou3iiNg", "ie1Ahnie", "Aechi6id", "Eihae7ho", "Aez0rai1",
+        "Awai4bei", "sie8Eic0", "baetoo0S", "nahX8mee", "US7geeci", "Dopeet4E", "GeeQuo4k", "UuGh2kee",
+        "phah0Aem", "Ue9quae5", "SieM3quo", "Oosh9Lao", "Oo1au3ah", "quaet4uS", "Nahshae9", "OhKeech8",
+        "eRib1eij", "AeW2ap2v", "nah0Unay", "ieWoh6vo", "Yei8ooLi", "OhShaen7", "Hi9maeg9", "Xeizoo7O",
+        "ahGhohn6", "Eagh2rog", "roW3vaeg", "ue6aeThe", "ieY1pu4b", "rooRoov1", "uiZ5thuG", "yegh2Oe9",
+        "ohR1aese", "guNg2nu9", "maetiW7o", "Vau9oogh", "atuM7poh", "eeTh5ahr", "Ireph7ui", "hieNgou5",
+        "eTeepho8", "ZuHochu5", "culoo6Ek", "tuSh1quu", "zo8ua3Ai", "Ookeeth2", "ahc1ahVe", "eeV0ooke",
+        "xai0ai6H", "wohN7hai", "ith5Oor9", "uu9geQui", "AhHohsi4", "Fi6eiGho", "thahz8Ji", "Peimoo3p",
+        "dah1TeBi", "rie8paeG", "Ou2eichu", "apae1IeK", "Aofai2nu", "HeiRoh7e", "Phi0Eaha", "Hebae5qu",
+        "ce8Ibah5", "ohTa6dei", "aiX2sie0", "nohY4wae", "xaeWoh4a", "ohNush0r", "Mia6ooga", "Haebi0ie",
+        "aC5lei2e", "pahYee7I", "deeth9Wa", "aip5Aiyi", "cahCi2Vu", "uBainae4", "aeje8eeL", "ceing6Ii",
+        "ia0Zoh3l", "pie7XohY", "quoh6aCh", "nieta4In", "Noejie8o", "lei0AKai", "macaHoo0", "eo0quo6A",
+        "jaey4UoX", "AhD0gac1", "Atom4aeG", "moo0Oque", "Eequu7Ah", "Fu5eivie", "euPh7ge2", "ohc4Wiev"
+      ];
+
+
+      var qrcode = new QRCode(document.getElementById("qrcode"), {
+        width : 400,
+        height : 400
+      });
+
+      function makeCode () {		
+        var elText = document.getElementById("text");
+        
+        if (!elText.value) {
+          alert("Input a text");
+          elText.focus();
+          return;
+        }
+
+        var seed_idx = Math.floor(Math.random()*seed.length);
+
+        var clear_text= "%" + seed[seed_idx] + "@" + elText.value;
+        
+        qrcode.makeCode(clear_text)
+
+        var disp_seed = document.getElementById("seed");
+        disp_seed.innerHTML = "seed[" + seed_idx + "]: " + seed[seed_idx];
+
+        var disp_text = document.getElementById("clear_text");
+        disp_text.innerHTML = clear_text;
+
+      }
+
+      makeCode();
+
+      $("#text").
+        on("blur", function () { makeCode(); }).
+        on("keydown", function (e) { if (e.keyCode == 13) { makeCode(); } });
+
+    </script>
+  </body>
+
+</html>

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 614 - 0
server/qr_generator/qrcode.js