├── .gitignore ├── MIT-LICENSE.txt ├── Makefile ├── README.md ├── bower.json ├── examples ├── basic.html └── demo.html ├── index.html ├── jquery.qrcode.min.js └── src ├── jquery.qrcode.js └── qrcode.js /.gitignore: -------------------------------------------------------------------------------- 1 | bower_components 2 | -------------------------------------------------------------------------------- /MIT-LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 Jerome Etienne, http://jetienne.com 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | PROJECT_NAME=jquery-qrcode 2 | 3 | all: 4 | 5 | server: 6 | python -m SimpleHTTPServer 7 | 8 | build: minify 9 | 10 | minify: 11 | echo > /tmp/jquery.qrcode.tmp.js 12 | head -2 src/jquery.qrcode.js >> /tmp/jquery.qrcode.tmp.js 13 | cat src/qrcode.js >> /tmp/jquery.qrcode.tmp.js 14 | tail -n +3 src/jquery.qrcode.js >> /tmp/jquery.qrcode.tmp.js 15 | curl --data-urlencode "js_code@/tmp/jquery.qrcode.tmp.js" \ 16 | -d "output_format=text&output_info=compiled_code&compilation_level=SIMPLE_OPTIMIZATIONS" \ 17 | http://closure-compiler.appspot.com/compile \ 18 | > jquery.qrcode.min.js 19 | 20 | homepage_build: 21 | pandoc -A ~/.pandoc.header.html -s README.md -o index.html 22 | sed -i "s/github.com\/you/github.com\/jeromeetienne\/$(PROJECT_NAME)/g" index.html 23 | 24 | ################################################################################# 25 | # deploy # 26 | ################################################################################# 27 | 28 | deploy: build 29 | # assume there is something to commit 30 | # use "git diff --exit-code HEAD" to know if there is something to commit 31 | # so two lines: one if no commit, one if something to commit 32 | git commit -a -m "New deploy" && git push -f origin HEAD:gh-pages && git reset HEAD~ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # jquery.qrcode.js 2 | 3 | jquery.qrcode.js 4 | is *jquery plugin for a pure browser qrcode generation*. 5 | It allow you to easily add qrcode to your webpages. 6 | It is standalone, less than 4k after minify+gzip, no image download. 7 | It doesnt rely on external services which go on and off, or add latency while loading. 8 | It is based on a library 9 | which build qrcode in various language. jquery.qrcode.js wraps 10 | it to make it easy to include in your own code. 11 | 12 | Show, don't tell, here is a example 13 | 14 | ## How to Use It 15 | 16 | Let me walk you thru it. First include it in your webpage with the usual script tag 17 | 18 | 19 | 20 | Then create a DOM element which gonna contains the generated qrcode image. Lets say 21 | a div 22 | 23 |
24 | 25 | Then you add the *qrcode* in this container by 26 | 27 | jquery('#qrcode').qrcode("this plugin is great"); 28 | 29 | This is it. see it live. 30 | 31 | You can set the height and width of the generated qrcode: 32 | 33 | jquery('#qrcode').qrcode({width: 64,height: 64,text: "size doesn't matter"}); 34 | 35 | 36 | ## Conclusion 37 | jquery.qrcode.js is available on github 38 | here 39 | under MIT license. 40 | If you hit bugs, fill issues on github. 41 | Feel free to fork, modify and have fun with it :) 42 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-qrcode", 3 | "version": "1.0.0", 4 | "homepage": "http://www.d-project.com/", 5 | "authors": [ 6 | "jeromeetienne" 7 | ], 8 | "description": "It allow you to easily add qrcode to your webpages. It is standalone, less than 4k after minify+gzip, no image download", 9 | "main": "jquery.qrcode.min.js", 10 | "keywords": [ 11 | "QR", 12 | "jQuery", 13 | "standalone" 14 | ], 15 | "license": "MIT", 16 | "ignore": [ 17 | "**/.*", 18 | "node_modules", 19 | "bower_components", 20 | "test", 21 | "tests" 22 | ], 23 | "dependencies": { 24 | "jquery": "~1.9" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /examples/basic.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Render in table
14 | 15 |Render in canvas
16 | 17 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /examples/demo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |9 | TODO make a nice looking pure client qrcode generator 10 | even allow download of the image 11 |
12 | 13 | 14 | 15 | 16 | 17 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |jquery.qrcode.js is jquery plugin for a pure browser qrcode generation. It allow you to easily add qrcode to your webpages. It is standalone, less than 4k after minify+gzip, no image download. It doesnt rely on external services which go on and off, or add latency while loading. It is based on a library which build qrcode in various language. jquery.qrcode.js wraps it to make it easy to include in your own code.
Show, dont tell, here is a example
Let me walk you thru it. First include it in your webpage with the usual script tag
<script type="text/javascript" src="jquery.qrcode.min.js"></script>
27 |
Then create a DOM element which gonna contains the generated qrcode image. Lets say a div
<div id="qrcode"></div>
34 |
Then you add the qrcode in this container by
jquery('#qrcode').qrcode("this plugin is great");
43 |
This is it. see it live.
jquery.qrcode.js is available on github here under MIT license. If you hit bugs, fill issues on github. Feel free to fork, modify and have fun with it :)