diff options
author | overint <emcmahonzx@gmail.com> | 2017-10-22 04:01:49 +0300 |
---|---|---|
committer | overint <emcmahonzx@gmail.com> | 2017-10-22 04:01:49 +0300 |
commit | 162f468b1c54b1675b5a9e0ddedf8e9c7f1addb4 (patch) | |
tree | 07a61da0873632cdd29607f88fc7508e89a8c254 /public | |
parent | 4e3c6b5af5426de248bcf78780f54dd51e2c6957 (diff) |
#347 Add button to generate QR code
Diffstat (limited to 'public')
-rw-r--r-- | public/css/shorten_result.css | 11 | ||||
-rw-r--r-- | public/js/shorten_result.js | 12 |
2 files changed, 23 insertions, 0 deletions
diff --git a/public/css/shorten_result.css b/public/css/shorten_result.css index a8e89b8..39db788 100644 --- a/public/css/shorten_result.css +++ b/public/css/shorten_result.css @@ -12,3 +12,14 @@ .content-div { text-align: center; } + +.qrCodeContainer { + display: none; + width: 300px; + height: 300px; + padding: 10px; + margin: 20px auto 0 auto; + background-color: white; + border: 1px #b7b7b7 solid; + border-radius: 7px; +} diff --git a/public/js/shorten_result.js b/public/js/shorten_result.js index 5c6f4a3..02cda0d 100644 --- a/public/js/shorten_result.js +++ b/public/js/shorten_result.js @@ -9,6 +9,18 @@ $('.result-box').change(function () { $(this).val(original_link); }); + +$('#generateQRCode').click(function () { + var container = $('.qrCodeContainer'); + container.empty(); + new QRCode(container.get(0), { + text: $('.result-box').val(), + width: 280, + height: 280 + }); + container.show(); +}); + $(function () { original_link = $('.result-box').val(); select_text(); |