File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 51
51
<input type="button" id="expand" value="还原短址" class="am-btn am-btn-default am-btn-sm am-fr">
52
52
</div>
53
53
</form>
54
+ <div id="qrcode" class="am-hide am-center am-img-thumbnail am-img-responsive" style="width: 206px;height: 206px"></div>
54
55
<hr>
55
56
<p>© <?= date ('Y ' ) ?> <a href="https://github.com/takashiki/ourls" target="_blank">Ourls</a> . Licensed under MIT license.</p>
56
57
</div>
66
67
<![endif]-->
67
68
<script src="//cdn.bootcss.com/amazeui/2.5.2/js/amazeui.min.js"></script>
68
69
<script src="//cdn.bootcss.com/validator/4.0.5/validator.min.js"></script>
70
+ <script src="//cdn.bootcss.com/jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
69
71
<script src="js/index.js"></script>
70
72
<?php if (!empty (Flight::get ('flight.settings ' )['external_js ' ])): ?>
71
73
<script src="<?= Flight::get ('flight.settings ' )['external_js ' ] ?> "></script>
Original file line number Diff line number Diff line change @@ -7,6 +7,13 @@ $('#shorten').click(function() {
7
7
function ( data ) {
8
8
if ( data . status == 1 ) {
9
9
$ ( '#url' ) . val ( data . s_url ) ;
10
+ var qrcode = $ ( '#qrcode' ) ;
11
+ qrcode . qrcode ( {
12
+ width : 200 ,
13
+ height : 200 ,
14
+ text : "data.s_url"
15
+ } ) ;
16
+ qrcode . removeClass ( 'am-hide' ) ;
10
17
} else {
11
18
alert ( data . msg ) ;
12
19
}
@@ -24,6 +31,9 @@ $('#expand').click(function() {
24
31
function ( data ) {
25
32
if ( data . status == 1 ) {
26
33
$ ( '#url' ) . val ( data . url ) ;
34
+ var qrcode = $ ( '#qrcode' ) ;
35
+ qrcode . addClass ( 'am-hide' ) ;
36
+ qrcode . html ( '' ) ;
27
37
} else {
28
38
alert ( data . msg ) ;
29
39
}
You can’t perform that action at this time.
0 commit comments