|
18 | 18 | <script type="text/javascript" src="../../../scripts/owlCarousel/owlCarousel.js"></script> |
19 | 19 | <script type="text/javascript" src="../../../scripts/buildfire/components/carousel/carousel.js"></script> |
20 | 20 | <script type="text/javascript" src="../../../scripts/buildfire/components/pluginInstance/sortableList.js"></script> |
| 21 | + <script type="text/javascript" src="./js/qrcode.min.js"></script> |
21 | 22 | <script type="text/javascript" src="../js/shared.js"></script> |
22 | 23 | </head> |
23 | 24 | <body ng-controller="sharePluginCtrl" data-ng-cloak> |
|
33 | 34 | <div class="text-center padded padding-bottom-zero clearfix"> |
34 | 35 | <p>Scan to share with QR Code.</p> |
35 | 36 | <div class="qr-holder margin-top-ten" style="max-width:190px; margin:0 auto;"> |
36 | | - <img ng-src="{{qrCodeUrl}}"/> |
| 37 | + <div class="qrcodeContainer flex flex-justify-center" id="qrcodeContainer"></div> |
37 | 38 | <div class="margin-top-fifteen"> |
38 | 39 | <a class="btn btn-primary stretch" disabled="disabled" data-ng-click="share();" data-ng-disabled="disableShare">Share the App Via...</a> |
39 | 40 | </div> |
|
44 | 45 | </div> |
45 | 46 | <script> |
46 | 47 | var sharePluginApp = angular.module('sharePlugin', []); |
47 | | - var qrGeneratorUrl = 'https://chart.googleapis.com/chart?chs=180x180&cht=qr&chl='; |
48 | 48 | var shareUrl = 'http://[appHost]/api/promoProxy/[appId]/'; |
49 | 49 | sharePluginApp.controller('sharePluginCtrl', ['$scope', '$sce', function ($scope, $sce) { |
50 | 50 | var view = null; |
|
69 | 69 | } |
70 | 70 | else { |
71 | 71 | $scope.shareUrl = shareUrl.replace('[appHost]', context.cpDomain).replace('[appId]', context.appId); |
72 | | - $scope.qrCodeUrl = qrGeneratorUrl + $scope.shareUrl; |
| 72 | + // Generate QR Code using qrcodejs library |
| 73 | + const qrcode = new QRCode("qrcodeContainer", { |
| 74 | + text: $scope.shareUrl, |
| 75 | + width: 170, |
| 76 | + height: 170, |
| 77 | + correctLevel : QRCode.CorrectLevel.H, |
| 78 | + }); |
73 | 79 | } |
74 | 80 | }); |
75 | 81 |
|
|
0 commit comments