1
0
mirror of https://github.com/cydrobolt/polr.git synced 2024-11-12 21:22:28 +01:00
polr/public/js/shorten_result.js

29 lines
587 B
JavaScript
Raw Normal View History

var original_link;
function select_text() {
$('.result-box').focus().select();
}
$('.result-box').click(select_text);
$('.result-box').change(function () {
$(this).val(original_link);
});
2017-10-22 03:01:49 +02:00
2017-10-22 04:01:15 +02:00
$('#generate-qr-code').click(function () {
var container = $('.qr-code-container');
2017-10-22 03:01:49 +02:00
container.empty();
new QRCode(container.get(0), {
text: original_link,
2017-10-22 03:01:49 +02:00
width: 280,
height: 280
});
2017-10-22 03:05:13 +02:00
container.find('img').attr('alt', original_link);
2017-10-22 03:01:49 +02:00
container.show();
});
$(function () {
original_link = $('.result-box').val();
select_text();
});