Skip to content

Commit

Permalink
make qrcode page large
Browse files Browse the repository at this point in the history
  • Loading branch information
codeskyblue committed May 22, 2017
1 parent ea3d3fd commit caef8c0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
8 changes: 8 additions & 0 deletions res/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,11 @@ div.dropzone {
.qrcode-title {
font-size: 0.8em;
}

.clearfix::after {
clear: both;
}

#qrcodeCanvas {
padding-right: 20px;
}
11 changes: 8 additions & 3 deletions res/index.tmpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ <h3 class="panel-title" style="font-weight: normal">
<div class="col-md-12" id="content">
<!-- Small qrcode modal -->
<div id="qrcode-modal" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-sm">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
Expand All @@ -174,8 +174,13 @@ <h4 class="modal-title">
<a style="font-size: 0.6em" href="#" id="qrcode-link">[view]</a>
</h4>
</div>
<div class="modal-body">
<div id="qrcodeCanvas"></div>
<div class="modal-body clearfix">
<div id="qrcodeCanvas" class="pull-left"></div>
<div id="qrcodeRight" class="pull-left">
<p>
<a href="#">下载链接</a>
</p>
</div>
</div>
</div>
</div>
Expand Down
12 changes: 7 additions & 5 deletions res/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,15 @@ var vm = new Vue({
}
return encodeURI(urlPath);
},
genQrcode: function(text, title) {
var urlPath = this.genInstallURL(text);
$("#qrcode-title").html(title || text);
$("#qrcode-link").attr("href", urlPath);
genQrcode: function(name, title) {
var installURL = this.genInstallURL(name);
$("#qrcode-title").html(title || name);
$("#qrcode-link").attr("href", installURL);
$('#qrcodeCanvas').empty().qrcode({
text: urlPath
text: installURL
});
console.log(name, location.origin, this.genDownloadURL(name));
$("#qrcodeRight a").attr("href", location.origin + encodeURI(pathJoin([location.pathname, name])));
$("#qrcode-modal").modal("show");
},
genDownloadURL: function(f) {
Expand Down

0 comments on commit caef8c0

Please sign in to comment.