Skip to content

Commit

Permalink
测试二维码代码
Browse files Browse the repository at this point in the history
  • Loading branch information
ldjking committed Jun 4, 2015
1 parent 3593c39 commit d063657
Show file tree
Hide file tree
Showing 41 changed files with 6,200 additions and 451 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -31,3 +31,5 @@
# Debug files
*.dSYM/
node_modules/
# 系统配置文件
sysconf/
1,447 changes: 996 additions & 451 deletions npm-debug.log

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/qrcode/jquery-qrcode-master/.gitignore
@@ -0,0 +1 @@
bower_components
20 changes: 20 additions & 0 deletions test/qrcode/jquery-qrcode-master/MIT-LICENSE.txt
@@ -0,0 +1,20 @@
Copyright (c) 2011 Jerome Etienne, http://jetienne.com

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 changes: 32 additions & 0 deletions test/qrcode/jquery-qrcode-master/Makefile
@@ -0,0 +1,32 @@
PROJECT_NAME=jquery-qrcode

all:

server:
python -m SimpleHTTPServer

build: minify

minify:
echo > /tmp/jquery.qrcode.tmp.js
head -2 src/jquery.qrcode.js >> /tmp/jquery.qrcode.tmp.js
cat src/qrcode.js >> /tmp/jquery.qrcode.tmp.js
tail -n +3 src/jquery.qrcode.js >> /tmp/jquery.qrcode.tmp.js
curl --data-urlencode "js_code@/tmp/jquery.qrcode.tmp.js" \
-d "output_format=text&output_info=compiled_code&compilation_level=SIMPLE_OPTIMIZATIONS" \
http://closure-compiler.appspot.com/compile \
> jquery.qrcode.min.js

homepage_build:
pandoc -A ~/.pandoc.header.html -s README.md -o index.html
sed -i "s/github.com\/you/github.com\/jeromeetienne\/$(PROJECT_NAME)/g" index.html

#################################################################################
# deploy #
#################################################################################

deploy: build
# assume there is something to commit
# use "git diff --exit-code HEAD" to know if there is something to commit
# so two lines: one if no commit, one if something to commit
git commit -a -m "New deploy" && git push -f origin HEAD:gh-pages && git reset HEAD~
41 changes: 41 additions & 0 deletions test/qrcode/jquery-qrcode-master/README.md
@@ -0,0 +1,41 @@
# jquery.qrcode.js

<a href='http://jeromeetienne.github.com/jquery-qrcode'>jquery.qrcode.js</a>
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 <a href='http://www.d-project.com/qrcode/index.html'>library</a>
which build qrcode in various language. <a href='http://jeromeetienne.github.com/jquery-qrcode'>jquery.qrcode.js</a> wraps
it to make it easy to include in your own code.

Show, dont tell, here is a <a href='https://github.com/jeromeetienne/jquery-qrcode/blob/master/examples/basic.html'>example</a>

## How to Use It

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>

Then create a DOM element which gonna contains the generated qrcode image. Lets say
a div

<div id="qrcode"></div>

Then you add the *qrcode* in this container by

jquery('#qrcode').qrcode("this plugin is great");

This is it. see it <a href='examples/basic.html'>live</a>.

You can set the height and width of the generated qrcode:

jquery('#qrcode').qrcode({width: 64,height: 64,text: "size doesn't matter"});


## Conclusion
<a href='http://jeromeetienne.github.com/jquery-qrcode'>jquery.qrcode.js</a> is available on github
<a href='https://github.com/jeromeetienne/jquery-qrcode'>here</a>
under <a href='https://github.com/jeromeetienne/jquery-qrcode/blob/master/MIT-LICENSE.txt'>MIT license</a>.
If you hit bugs, fill issues on github.
Feel free to fork, modify and have fun with it :)
26 changes: 26 additions & 0 deletions test/qrcode/jquery-qrcode-master/bower.json
@@ -0,0 +1,26 @@
{
"name": "jquery-qrcode",
"version": "1.0.0",
"homepage": "http://www.d-project.com/",
"authors": [
"jeromeetienne"
],
"description": "It allow you to easily add qrcode to your webpages. It is standalone, less than 4k after minify+gzip, no image download",
"main": "jquery.qrcode.min.js",
"keywords": [
"QR",
"jQuery",
"standalone"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"jquery": "~1.9"
}
}
29 changes: 29 additions & 0 deletions test/qrcode/jquery-qrcode-master/examples/basic.html
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<title>basic example</title>
</head>
<body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>

<!--<script type="text/javascript" src="../jquery.qrcode.min.js"></script>
--><script type="text/javascript" src="../src/jquery.qrcode.js"></script>
<script type="text/javascript" src="../src/qrcode.js"></script>

<p>Render in table</p>
<div id="qrcodeTable"></div>
<p>Render in canvas</p>
<div id="qrcodeCanvas"></div>
<script>
//jQuery('#qrcode').qrcode("this plugin is great");
jQuery('#qrcodeTable').qrcode({
render : "table",
text : "http://jetienne.com"
});
jQuery('#qrcodeCanvas').qrcode({
text : "http://jetienne.com"
});
</script>

</body>
</html>
24 changes: 24 additions & 0 deletions test/qrcode/jquery-qrcode-master/examples/demo.html
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<title>Demo page</title>

</head>
<body>
<p>
TODO make a nice looking pure client qrcode generator
even allow download of the image
</p>

<div id="output"></div>

<script src="../src/jquery/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="../jquery.qrcode.min.js"></script>
<script>
jQuery(function(){
jQuery('#output').qrcode("http://m.nongfadai.com");
})
</script>

</body>
</html>
191 changes: 191 additions & 0 deletions test/qrcode/jquery-qrcode-master/index.html
@@ -0,0 +1,191 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />
<meta name="date" content="" />
</head>
<body>
<div id="jquery.qrcode.js"
>
<h1
>jquery.qrcode.js</h1
>
<p
>
<a href='http://jeromeetienne.github.com/jquery-qrcode'>jquery.qrcode.js</a>
is <em
>jquery plugin for a pure browser qrcode generation</em
>. 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
<a href='http://www.d-project.com/qrcode/index.html'>library</a>
which build qrcode in various language.
<a href='http://jeromeetienne.github.com/jquery-qrcode'>jquery.qrcode.js</a>
wraps it to make it easy to include in your own code.</p
>
<p
>Show, dont tell, here is a
<a href='examples/basic.html'>example</a>
</p
>
<div id="how-to-use-it"
>
<h2
>How to Use It</h2
>
<p
>Let me walk you thru it. First include it in your webpage with the usual script tag</p
>
<pre
><code
>&lt;script type=&quot;text/javascript&quot; src=&quot;jquery.qrcode.min.js&quot;&gt;&lt;/script&gt;
</code
></pre
>
<p
>Then create a DOM element which gonna contains the generated qrcode image. Lets say a div</p
>
<pre
><code
>&lt;div id=&quot;qrcode&quot;&gt;&lt;/div&gt;
</code
></pre
>
<p
>Then you add the <em
>qrcode</em
> in this container by</p
>
<pre
><code
>jquery('#qrcode').qrcode(&quot;this plugin is great&quot;);
</code
></pre
>
<p
>This is it. see it
<a href='examples/basic.html'>live</a>
.</p
>
</div
>
<div id="conclusion"
>
<h2
>Conclusion</h2
>
<p
>
<a href='http://jeromeetienne.github.com/jquery-qrcode'>jquery.qrcode.js</a>
is available on github
<a href='https://github.com/jeromeetienne/jquery-qrcode'>here</a>
under
<a href='https://github.com/jeromeetienne/jquery-qrcode/blob/master/MIT-LICENSE.txt'>MIT license</a>
. If you hit bugs, fill issues on github. Feel free to fork, modify and have fun with it :)</p
>
</div
>
</div
>
<style>
body {
margin: auto;
padding-right: 1em;
padding-left: 1em;
max-width: 44em;
border-left: 1px solid #eee;
border-right: 1px solid #eee;
font-family : Verdana, sans-serif;
font-size : 100%;
line-height : 140%;
color : #eee;
background-color : #22252a;
}
pre {
border : 1px dotted gray;
background-color : #444a50;
color : #1111111;
padding : 0.5em;
}
code {
font-family : monospace;
}
a {
text-decoration : none;
color : lightSteelBlue;
}
a:hover {
text-decoration : underline;
}
h1, h2, h3, h4, h5 { font-family: verdana;
font-weight: bold;
border-bottom: 1px dotted #eee;
color: lightSteelBlue; }
h1 {
color : #cd5;
font-size : 130%;
}
h1:nth-child(1) {
font-size : 300%;
text-align : center;
height : 1em;
}
h2 {
font-size : 110%;
}

h3 {
font-size : 95%;
}

h4 {
font-size : 90%;
font-style : italic;
}

h5 {
font-size : 90%;
font-style : italic;
}

h1.title {
font-size : 200%;
font-weight : bold;
padding-top : 0.2em;
padding-bottom : 0.2em;
text-align : left;
border : none;
}

dt code {
font-weight : bold;
}
dd p {
margin-top : 0;
}
img {
/* border-color : white;
border-style : solid;
*/}

#footer {
padding-top : 1em;
font-size : 70%;
color : gray;
text-align : center;
}

</style>
<!-- follow me on twitter -->
<a href="http://www.twitter.com/jerome_etienne">
<img style="position: absolute; bottom: 10px; right: 10px; border: 0;" src="https://twitter-badges.s3.amazonaws.com/follow_me-c.png" alt="Follow jerome_etienne on Twitter"/>
</a>
<!-- github ribbon -->
<a href="https://github.com/jeromeetienne/jquery-qrcode"><img style="position: absolute; top: 0; left: 0; border: 0;" src="https://assets0.github.com/img/ce742187c818c67d98af16f96ed21c00160c234a?repo=&url=http%3A%2F%2Fs3.amazonaws.com%2Fgithub%2Fribbons%2Fforkme_left_gray_6d6d6d.png&path=" alt="Fork me on GitHub"></a>
<!-- twitter share + facebook like -->
<div style="position: absolute; top: 10px; right: 10px; border: 0;">
<a href="http://twitter.com/share" class="twitter-share-button" data-count="none" data-via="jerome_etienne">Tweet</a>
<script type="text/javascript" src="https://platform.twitter.com/widgets.js"></script>
</div>
</body>
</html>

0 comments on commit d063657

Please sign in to comment.