mirror of
https://github.com/Luzifer/qrdisplay.git
synced 2024-12-22 12:21:18 +00:00
Accepting URI encoded data in hash
This commit is contained in:
parent
f308662370
commit
fcafcb1b66
2 changed files with 6 additions and 3 deletions
|
@ -3,7 +3,7 @@ $ ->
|
|||
$('#triggerCreate').bind 'click', generateQRCode
|
||||
$(window).bind 'hashchange', ->
|
||||
text = window.location.hash.substring 1
|
||||
$('textarea').val text
|
||||
$('textarea').val decodeURIComponent(text)
|
||||
generateQRCode()
|
||||
$('a', '#download').bind 'click', ->
|
||||
window.location.href = $('canvas', '#qrarea')[0].toDataURL('image/png').replace('image/png', 'image/octet-stream')
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// Generated by CoffeeScript 1.6.3
|
||||
(function() {
|
||||
var generateQRCode;
|
||||
|
||||
|
@ -7,13 +8,15 @@
|
|||
$(window).bind('hashchange', function() {
|
||||
var text;
|
||||
text = window.location.hash.substring(1);
|
||||
$('textarea').val(text);
|
||||
$('textarea').val(decodeURIComponent(text));
|
||||
return generateQRCode();
|
||||
});
|
||||
$('a', '#download').bind('click', function() {
|
||||
return window.location.href = $('canvas', '#qrarea')[0].toDataURL('image/png').replace('image/png', 'image/octet-stream');
|
||||
});
|
||||
if (window.location.hash) $(window).trigger('hashchange');
|
||||
if (window.location.hash) {
|
||||
$(window).trigger('hashchange');
|
||||
}
|
||||
return generateQRCode();
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue