| 
									
										
										
										
											2021-01-22 12:06:20 -07:00
										 |  |  | /* | 
					
						
							|  |  |  |  * 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 getAddressQRCode() { | 
					
						
							|  |  |  |     var qrstring = $("#addresscodeform #name").val() + "\t" | 
					
						
							|  |  |  |             + $("#addresscodeform #company").val() + "\t" | 
					
						
							|  |  |  |             + $("#addresscodeform #street1").val() + "\t" | 
					
						
							|  |  |  |             + $("#addresscodeform #street2").val() + "\t" | 
					
						
							|  |  |  |             + $("#addresscodeform #city").val() + "\t" | 
					
						
							|  |  |  |             + $("#addresscodeform #state").val() + "\t" | 
					
						
							|  |  |  |             + $("#addresscodeform #zip").val(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     var canvas = document.createElement('canvas'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     bwipjs.toCanvas(canvas, { | 
					
						
							|  |  |  |         bcid: 'qrcode', // Barcode type
 | 
					
						
							|  |  |  |         text: qrstring, // Text to encode
 | 
					
						
							|  |  |  |         scale: 5, // 3x scaling factor
 | 
					
						
							|  |  |  |         includetext: false, // Show human-readable text
 | 
					
						
							|  |  |  |         textxalign: 'center', // Always good to set this
 | 
					
						
							| 
									
										
										
										
											2021-01-22 13:21:22 -07:00
										 |  |  |         eclevel: 'M' | 
					
						
							| 
									
										
										
										
											2021-01-22 12:06:20 -07:00
										 |  |  |     }); | 
					
						
							|  |  |  |     document.getElementById("addresscode-barcode").src = canvas.toDataURL('image/png'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     app.popup.create({el: document.getElementById("addresscode-popup")}).open(); | 
					
						
							|  |  |  | } |