1
0
Fork 0
mirror of https://github.com/Luzifer/qrdisplay.git synced 2024-10-18 06:34:22 +00:00
qrdisplay/application.coffee

19 lines
567 B
CoffeeScript
Raw Normal View History

2013-04-21 22:09:36 +00:00
$ ->
$('textarea').bind 'keyup', generateQRCode
$('#triggerCreate').bind 'click', generateQRCode
$(window).bind 'hashchange', ->
text = window.location.hash.substring 1
$('textarea').val text
generateQRCode()
2013-04-21 22:51:38 +00:00
$('a', '#download').bind 'click', ->
window.location.href = $('canvas', '#qrarea')[0].toDataURL('image/png').replace('image/png', 'image/octet-stream')
2013-04-21 22:09:36 +00:00
if window.location.hash
$(window).trigger 'hashchange'
generateQRCode()
generateQRCode = ->
text = $('textarea').val()
$('#qrarea').empty()
$('#qrarea').qrcode(text)