New more better quick send
parent
f25a2a07db
commit
35fbcca41b
@ -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();
|
||||
}
|
@ -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();
|
||||
}
|
Loading…
Reference in New Issue