Created
June 17, 2012 11:32
-
-
Save lvbreda/2944278 to your computer and use it in GitHub Desktop.
QrCode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
<title>qrcode</title> | |
</head> | |
<body> | |
{{> qrcode}} | |
{{> image}} | |
</body> | |
<template name="qrcode"> | |
<h2>QR CODE</h2> | |
<input type="text" name="code" id="code" value="Enter data here..." /> | |
<input type="button" class="gen" value="Generate"> | |
</template> | |
<template name="image"> | |
<img src="http://chart.apis.google.com/chart?cht=qr&chs=500x500&choe=UTF-8&chld=H&chl={{content}}"> | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Meteor.is_client) { | |
Template.qrcode.events = { | |
'click input.gen': function () { | |
Session.set("data", code.value); | |
} | |
}; | |
Template.image.content = function(){ | |
return Session.get("data"); | |
}; | |
} | |
if (Meteor.is_server) { | |
Meteor.startup(function () { | |
// code to run on server at startup | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment