Browse Source

添加弹出层控件,显示全局二维码

ecd\tbw_1357250783514014 4 years ago
parent
commit
67d27025e4

+ 2 - 2
book.toml

@@ -7,9 +7,9 @@ title = "教理部口袋书学习手册范例"
 
 
 [output.html]
-additional-js = ["theme/myjs/mermaid.min.js", "theme/myjs/mermaid-init.js","theme/myjs/jquery-1.12.3.min.js","theme/myjs/lrc.js","theme/myjs/nosleep.js","theme/myjs/social-share.min.js"]
+additional-js = ["theme/myjs/mermaid.min.js", "theme/myjs/mermaid-init.js","theme/myjs/jquery-1.12.3.min.js","theme/myjs/lrc.js","theme/myjs/nosleep.js","theme/myjs/social-share.min.js","theme/myplugin/layer/layer.js"]
 mathjax-support = true
-additional-css = ["theme/fonts/tai-tham-kh-new-v3.ttf","theme/mycss/font.css","theme/mycss/lrc.css","theme/mycss/share.min.css","theme/fonts/iconfont.ttf","theme/fonts/iconfont.woff"] 
+additional-css = ["theme/fonts/tai-tham-kh-new-v3.ttf","theme/mycss/font.css","theme/mycss/lrc.css","theme/mycss/share.min.css","theme/fonts/iconfont.ttf","theme/fonts/iconfont.woff","theme/myplugin/layer/theme/default/layer.css","theme/myplugin/layer/theme/default/icon.png"] 
 
 [output.html.fold]
 enable = true

+ 13 - 3
theme/index.hbs

@@ -139,7 +139,7 @@
 
                     <div class="right-buttons">
 						<a href="https://github.com/iapt-platform/pali-handbook" target="_blank"><i class="fa fa-github"></i></a>
-						<a href="https://gitee.com/bhikkhu-kosalla/pali-handbook" target="_blank">码云GITEE</a>
+						<a href="https://gitee.com/bhikkhu-kosalla/pali-handbook" target="_blank"></a>
 
                         {{#if print_enable}}
                         <a href="{{ path_to_root }}print.html" title="Print this book" aria-label="Print this book">
@@ -156,7 +156,7 @@
                             <i id="git-edit-button" class="fa fa-edit"></i>
                         </a>
                         {{/if}}
-
+						<a href="javascript:openQrcode()" ><i class="fa fa-qrcode" aria-hidden="true"></i></a>
                     </div>
                 </div>
 
@@ -309,6 +309,16 @@
         </script>
         {{/if}}
         {{/if}}
-
+		<div id="qrcode"></div>
+		<script>
+		new QRCode(document.getElementById("qrcode"), location.href);  // 设置要生成二维码的链接
+		function openQrcode(){
+			layer.open({
+			  type: 1,
+			  title: false,
+			  content: $('#qrcode') //这里content是一个DOM,注意:最好该元素要存放在body最外层,否则可能被其它的相对元素所影响
+			});
+		}
+		</script>
     </body>
 </html>

File diff suppressed because it is too large
+ 0 - 0
theme/myjs/jquery.share.min.js


File diff suppressed because it is too large
+ 1 - 0
theme/myplugin/layer/layer.js


File diff suppressed because it is too large
+ 1 - 0
theme/myplugin/layer/mobile/layer.js


File diff suppressed because it is too large
+ 0 - 0
theme/myplugin/layer/mobile/need/layer.css


BIN
theme/myplugin/layer/theme/default/icon-ext.png


BIN
theme/myplugin/layer/theme/default/icon.png


File diff suppressed because it is too large
+ 0 - 0
theme/myplugin/layer/theme/default/layer.css


BIN
theme/myplugin/layer/theme/default/loading-0.gif


BIN
theme/myplugin/layer/theme/default/loading-1.gif


BIN
theme/myplugin/layer/theme/default/loading-2.gif


Some files were not shown because too many files changed in this diff