diff --git a/www/assets/js/address_qrcode.js b/www/assets/js/address_qrcode.js deleted file mode 100644 index 3d4bc17..0000000 --- a/www/assets/js/address_qrcode.js +++ /dev/null @@ -1,50 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - - -function showAddressQRCode() { - var fromqrstring = $("#addresscodeform #from_name").val() + "\t" - + $("#addresscodeform #from_company").val() + "\t" - + $("#addresscodeform #from_street1").val() + "\t" - + $("#addresscodeform #from_street2").val() + "\t" - + "\t" - + "\t" - + $("#addresscodeform #from_zip").val(); - - var toqrstring = $("#addresscodeform #to_name").val() + "\t" - + $("#addresscodeform #to_company").val() + "\t" - + $("#addresscodeform #to_street1").val() + "\t" - + $("#addresscodeform #to_street2").val() + "\t" - + $("#addresscodeform #to_city").val() + "\t" - + $("#addresscodeform #to_state").val() + "\t" - + $("#addresscodeform #to_zip").val() + "\t" - + $("#addresscodeform #to_country").val(); - - var canvas = document.createElement('canvas'); - - bwipjs.toCanvas(canvas, { - bcid: 'qrcode', // Barcode type - text: fromqrstring, // Text to encode - scale: 5, - includetext: false, // Show human-readable text - textxalign: 'center', // Always good to set this - eclevel: 'M' - }); - document.getElementById("addresscode-barcode-from").src = canvas.toDataURL('image/png'); - - canvas = document.createElement('canvas'); - bwipjs.toCanvas(canvas, { - bcid: 'qrcode', // Barcode type - text: toqrstring, // Text to encode - scale: 5, - includetext: false, // Show human-readable text - textxalign: 'center', // Always good to set this - eclevel: 'M' - }); - document.getElementById("addresscode-barcode-to").src = canvas.toDataURL('image/png'); - - app.popup.create({el: document.getElementById("qrCodePopup")}).open(); -} \ No newline at end of file diff --git a/www/assets/js/quicksend.js b/www/assets/js/quicksend.js new file mode 100644 index 0000000..403afc6 --- /dev/null +++ b/www/assets/js/quicksend.js @@ -0,0 +1,51 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + + +function showAddressQRCode() { + var content = "QSv1|tofrom" + + "|" + $("#addresscodeform #to_name").val() + + "|" + $("#addresscodeform #to_company").val() + + "|" + $("#addresscodeform #to_street1").val() + + "|" + $("#addresscodeform #to_street2").val() + + "|" + $("#addresscodeform #to_city").val() + + "|" + $("#addresscodeform #to_state").val() + + "|" + $("#addresscodeform #to_zip").val() + + "|" + $("#addresscodeform #to_country").val() + + "|" + $("#addresscodeform #to_phone").val() + + "|" // email + + "|" + $("#addresscodeform #from_name").val() + + "|" + $("#addresscodeform #from_company").val() + + "|" + $("#addresscodeform #from_street1").val() + + "|" + $("#addresscodeform #from_street2").val() + + "|" // city + + "|" // state + + "|" + $("#addresscodeform #from_zip").val() + + "|" // country + + "|" + $("#addresscodeform #from_phone").val() + + "|"; // email + + setStorage("quicksend_name", $("#addresscodeform #from_name").val()); + setStorage("quicksend_company", $("#addresscodeform #from_company").val()); + setStorage("quicksend_street1", $("#addresscodeform #from_street1").val()); + setStorage("quicksend_street2", $("#addresscodeform #from_street2").val()); + setStorage("quicksend_zip", $("#addresscodeform #from_zip").val()); + setStorage("quicksend_phone", $("#addresscodeform #from_phone").val()); + + var canvas = document.createElement('canvas'); + + bwipjs.toCanvas(canvas, { + bcid: 'pdf417', // Barcode type + text: content, // Text to encode + scale: 5, + includetext: false, // Show human-readable text + textxalign: 'center', // Always good to set this + eclevel: 'M' + }); + document.getElementById("addresscode-barcode").src = canvas.toDataURL('image/png'); + + app.popup.create({el: document.getElementById("qrCodePopup")}).open(); +} \ No newline at end of file diff --git a/www/index.html b/www/index.html index 4e3957a..27c03f8 100644 --- a/www/index.html +++ b/www/index.html @@ -71,7 +71,7 @@ - + diff --git a/www/pages/address_qrcode.html b/www/pages/quicksend.html similarity index 95% rename from www/pages/address_qrcode.html rename to www/pages/quicksend.html index c1910fc..369ffef 100644 --- a/www/pages/address_qrcode.html +++ b/www/pages/quicksend.html @@ -42,7 +42,7 @@