jekyll-theme-mdui 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,8 +1,8 @@
1
- <script type="text/javascript">
2
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
3
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
4
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
5
- })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
6
- ga('create', '{{ site.google_analytics }}', 'auto');
7
- ga('send', 'pageview');
1
+ <script type="text/javascript">
2
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
3
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
4
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
5
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
6
+ ga('create', '{{ site.google_analytics }}', 'auto');
7
+ ga('send', 'pageview');
8
8
  </script>
@@ -1,12 +1,12 @@
1
- {% if site.disqus_shortname != "" %}
2
- <div class="mdui-divider"></div>
3
- {% if site.disqus_proxy == false %}
4
- <button id="load-disqus" class="mdui-btn mdui-btn-block mdui-center" onclick="disqus.load();" data="{{ site.disqus_shortname }}">阅读评论 「请确保 Disqus 可以正常加载」</button>
5
- <div id="disqus_thread"></div>
6
- {% endif %}
7
- {% if site.disqus_proxy %}
8
- <div class="mdui-divider"></div>
9
- <div id="disqusreadonly" style="padding-top: 16px;">
10
- </div>
11
- {% endif %}
1
+ {% if site.disqus_shortname != "" %}
2
+ <div class="mdui-divider"></div>
3
+ {% if site.disqus_proxy == false %}
4
+ <button id="load-disqus" class="mdui-btn mdui-btn-block mdui-center" onclick="disqus.load();" data="{{ site.disqus_shortname }}">阅读评论 「请确保 Disqus 可以正常加载」</button>
5
+ <div id="disqus_thread"></div>
6
+ {% endif %}
7
+ {% if site.disqus_proxy %}
8
+ <div class="mdui-divider"></div>
9
+ <div id="disqusreadonly" style="padding-top: 16px;">
10
+ </div>
11
+ {% endif %}
12
12
  {% endif %}
@@ -1,28 +1,28 @@
1
- <footer class="mdui-m-t-5">
2
- <div class="mdui-card">
3
- <div class="mdui-card-content mdui-shadow-0 mdui-p-a-5">
4
- <div class="mdui-container">
5
- <div class="mdui-row-sm-3">
6
- <div class="mdui-col">
7
- <div class="mdui-row">
8
- {% for sns in site.data.sns %}
9
- {% if sns.url != null %}
10
- <div class="mdui-col-xs-4 mdui-col-sm-3 mdui-col-md-2 ">
11
- <a href="{{sns.url}}"><div class="mdui-center k-footer-icon k-{{ sns.name }}"></div></a>
12
- </div>
13
- {% endif %}
14
- {% endfor %}
15
- </div>
16
- </div>
17
- <div class="mdui-col mdui-text-center" style="line-height:48px">
18
- Copyright ©<script>var fd=new Date;document.write("&nbsp;"+fd.getFullYear()+"&nbsp;")</script> {{site.title}}
19
- </div>
20
- <div class="mdui-col mdui-text-center mdui-typo">
21
- <div>Powered by <a href="https://jekyllrb.com">Jekyll</a></div>
22
- <div>Theme <a href="https://github.com/KeJunMao/jekyll-theme-mdui">jekyll-theme-mdui</a></div>
23
- </div>
24
- </div>
25
- </div>
26
- </div>
27
- </div>
1
+ <footer class="mdui-m-t-5">
2
+ <div class="mdui-card">
3
+ <div class="mdui-card-content mdui-shadow-0 mdui-p-a-5">
4
+ <div class="mdui-container">
5
+ <div class="mdui-row-sm-3">
6
+ <div class="mdui-col">
7
+ <div class="mdui-row">
8
+ {% for sns in site.data.sns %}
9
+ {% if sns.url != null %}
10
+ <div class="mdui-col-xs-4 mdui-col-sm-3 mdui-col-md-2 ">
11
+ <a href="{{sns.url}}"><div class="mdui-center k-footer-icon k-{{ sns.name }}"></div></a>
12
+ </div>
13
+ {% endif %}
14
+ {% endfor %}
15
+ </div>
16
+ </div>
17
+ <div class="mdui-col mdui-text-center" style="line-height:48px">
18
+ Copyright ©<script>var fd=new Date;document.write("&nbsp;"+fd.getFullYear()+"&nbsp;")</script> {{site.title}}
19
+ </div>
20
+ <div class="mdui-col mdui-text-center mdui-typo">
21
+ <div>Powered by <a href="https://jekyllrb.com">Jekyll</a></div>
22
+ <div>Theme <a href="https://github.com/KeJunMao/jekyll-theme-mdui">jekyll-theme-mdui</a></div>
23
+ </div>
24
+ </div>
25
+ </div>
26
+ </div>
27
+ </div>
28
28
  </footer>
data/_includes/head.html CHANGED
@@ -1,32 +1,35 @@
1
- <head>
2
- <meta charset="utf-8">
3
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
4
- <meta name="viewport" content="width=device-width, initial-scale=1">
5
- <meta name="author" content="{{site.author}}">
6
- <link href="https://ooo.0o0.ooo/2017/05/27/59294212bc16e.png" rel="shortcut icon">
7
- <title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
8
- <meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
9
- <link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
10
- <link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}">
11
- <link rel="manifest" href="{{ "/manifest.json" | prepend: site.baseurl }}">
12
- <link rel="preload" href="//cdnjs.cloudflare.com/ajax/libs/mdui/0.2.1/css/mdui.min.css" as="style" onload="this.rel='stylesheet'">
13
- <link rel="preload" href="{{ "/assets/css/main.css" | prepend: site.baseurl }}" as="style" onload="this.rel='stylesheet'">
14
- <link rel="preload" href="https://cdnjs.cloudflare.com/ajax/libs/nprogress/0.2.0/nprogress.min.css" as="style" onload="this.rel='stylesheet'">
15
- <noscript><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/mdui/0.2.1/css/mdui.min.css"></noscript>
16
- <noscript><link rel="stylesheet" href="{{ "/assets/css/main.css" | prepend: site.baseurl }}"></noscript>
17
- <noscript><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/nprogress/0.2.0/nprogress.min.css"></noscript>
18
- {% if page.layout == "post" %}
19
- <link rel="preload" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/styles/default.min.css" as="style" onload="this.rel='stylesheet'">
20
- <noscript><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/styles/default.min.css"></noscript>
21
- {% endif %}
22
- {% if page.layout == "editor" %}
23
- <link rel="preload" href="{{ "/assets/css/pickerdata.css" | prepend: site.baseurl }}" as="style" onload="this.rel='stylesheet'">
24
- <noscript><link rel="stylesheet" href="{{ "/assets/css/pickerdata.css" | prepend: site.baseurl }}"></noscript>
25
- <link rel="preload" href="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css" as="style" onload="this.rel='stylesheet'">
26
- <noscript><link rel="stylesheet" href="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css"></noscript>
27
- {% endif %}
28
- <script>
29
- !function(a){"use strict";var b=function(b,c,d){function e(a){return h.body?a():void setTimeout(function(){e(a)})}function f(){i.addEventListener&&i.removeEventListener("load",f),i.media=d||"all"}var g,h=a.document,i=h.createElement("link");if(c)g=c;else{var j=(h.body||h.getElementsByTagName("head")[0]).childNodes;g=j[j.length-1]}var k=h.styleSheets;i.rel="stylesheet",i.href=b,i.media="only x",e(function(){g.parentNode.insertBefore(i,c?g:g.nextSibling)});var l=function(a){for(var b=i.href,c=k.length;c--;)if(k[c].href===b)return a();setTimeout(function(){l(a)})};return i.addEventListener&&i.addEventListener("load",f),i.onloadcssdefined=l,l(f),i};"undefined"!=typeof exports?exports.loadCSS=b:a.loadCSS=b}("undefined"!=typeof global?global:this);
30
- !function(a){if(a.loadCSS){var b=loadCSS.relpreload={};if(b.support=function(){try{return a.document.createElement("link").relList.supports("preload")}catch(b){return!1}},b.poly=function(){for(var b=a.document.getElementsByTagName("link"),c=0;c<b.length;c++){var d=b[c];"preload"===d.rel&&"style"===d.getAttribute("as")&&(a.loadCSS(d.href,d,d.getAttribute("media")),d.rel=null)}},!b.support()){b.poly();var c=a.setInterval(b.poly,300);a.addEventListener&&a.addEventListener("load",function(){b.poly(),a.clearInterval(c)}),a.attachEvent&&a.attachEvent("onload",function(){a.clearInterval(c)})}}}(this);
31
- </script>
32
- </head>
1
+ <head>
2
+ <meta charset="utf-8">
3
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
4
+ <meta name="viewport" content="width=device-width, initial-scale=1">
5
+ <meta name="author" content="{{site.author}}">
6
+ {% if page.layout =="post" %}
7
+ <meta name="keywords" content="{% for pagetag in page.tags %}{{pagetag}} {% endfor %}">
8
+ {% endif %}
9
+ <link href="https://ooo.0o0.ooo/2017/05/27/59294212bc16e.png" rel="shortcut icon">
10
+ <title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
11
+ <meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
12
+ <link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
13
+ <link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}">
14
+ <link rel="manifest" href="{{ "/manifest.json" | prepend: site.baseurl }}">
15
+ <link rel="preload" href="https://cdn.bootcss.com/mdui/0.2.1/css/mdui.min.css" as="style" onload="this.rel='stylesheet'">
16
+ <link rel="preload" href="{{ "/assets/css/main.css" | prepend: site.baseurl }}" as="style" onload="this.rel='stylesheet'">
17
+ <link rel="preload" href="https://cdn.bootcss.com/nprogress/0.2.0/nprogress.min.css" as="style" onload="this.rel='stylesheet'">
18
+ <noscript><link rel="stylesheet" href="https://cdn.bootcss.com/mdui/0.2.1/css/mdui.min.css"></noscript>
19
+ <noscript><link rel="stylesheet" href="{{ "/assets/css/main.css" | prepend: site.baseurl }}"></noscript>
20
+ <noscript><link rel="stylesheet" href="https://cdn.bootcss.com/nprogress/0.2.0/nprogress.min.css"></noscript>
21
+ {% if page.layout == "post" %}
22
+ <link rel="preload" href="https://cdn.bootcss.com/highlight.js/9.11.0/styles/default.min.css" as="style" onload="this.rel='stylesheet'">
23
+ <noscript><link rel="stylesheet" href="https://cdn.bootcss.com/highlight.js/9.11.0/styles/default.min.css"></noscript>
24
+ {% endif %}
25
+ {% if page.layout == "editor" %}
26
+ <link rel="preload" href="{{ "/assets/css/pickerdata.css" | prepend: site.baseurl }}" as="style" onload="this.rel='stylesheet'">
27
+ <noscript><link rel="stylesheet" href="{{ "/assets/css/pickerdata.css" | prepend: site.baseurl }}"></noscript>
28
+ <link rel="preload" href="https://cdn.bootcss.com/simplemde/1.11.2/simplemde.min.css" as="style" onload="this.rel='stylesheet'">
29
+ <noscript><link rel="stylesheet" href="https://cdn.bootcss.com/simplemde/1.11.2/simplemde.min.css"></noscript>
30
+ {% endif %}
31
+ <script>
32
+ !function(a){"use strict";var b=function(b,c,d){function e(a){return h.body?a():void setTimeout(function(){e(a)})}function f(){i.addEventListener&&i.removeEventListener("load",f),i.media=d||"all"}var g,h=a.document,i=h.createElement("link");if(c)g=c;else{var j=(h.body||h.getElementsByTagName("head")[0]).childNodes;g=j[j.length-1]}var k=h.styleSheets;i.rel="stylesheet",i.href=b,i.media="only x",e(function(){g.parentNode.insertBefore(i,c?g:g.nextSibling)});var l=function(a){for(var b=i.href,c=k.length;c--;)if(k[c].href===b)return a();setTimeout(function(){l(a)})};return i.addEventListener&&i.addEventListener("load",f),i.onloadcssdefined=l,l(f),i};"undefined"!=typeof exports?exports.loadCSS=b:a.loadCSS=b}("undefined"!=typeof global?global:this);
33
+ !function(a){if(a.loadCSS){var b=loadCSS.relpreload={};if(b.support=function(){try{return a.document.createElement("link").relList.supports("preload")}catch(b){return!1}},b.poly=function(){for(var b=a.document.getElementsByTagName("link"),c=0;c<b.length;c++){var d=b[c];"preload"===d.rel&&"style"===d.getAttribute("as")&&(a.loadCSS(d.href,d,d.getAttribute("media")),d.rel=null)}},!b.support()){b.poly();var c=a.setInterval(b.poly,300);a.addEventListener&&a.addEventListener("load",function(){b.poly(),a.clearInterval(c)}),a.attachEvent&&a.attachEvent("onload",function(){a.clearInterval(c)})}}}(this);
34
+ </script>
35
+ </head>
@@ -1,22 +1,22 @@
1
- <header mdui-headroom class="mdui-appbar mdui-shadow-0 mdui-appbar-fixed">
2
- <div class="mdui-toolbar">
3
- <a href="javascript:;" class="mdui-btn mdui-btn-icon mdui-hidden-sm-up" mdui-drawer="{target: '#k-menu'}"><i class="mdui-icon material-icons">&#xe5d2;</i></a>
4
- <a href="{{site.url}}" class="mdui-typo-title">{{site.title |upcase }}</a>
5
- <div class="mdui-toolbar-spacer"></div>
6
- <div class="mdui-hidden-xs-down">
7
- {% for menu in site.data.menus %}
8
- <a href="{{menu.url}}" class="mdui-btn {% if menu.url == page.url %}mdui-list-item-active{% endif %}">{{menu.name}}</a>
9
- {% endfor %}
10
- </div>
11
- </div>
12
- </header>
13
- <div class="mdui-drawer mdui-drawer-close" id="k-menu">
14
- <ul class="mdui-list">
15
- {% for menu in site.data.menus %}
16
- <a href="{{menu.url}}" class="mdui-list-item mdui-ripple {% if menu.url == page.url %}mdui-list-item-active{% endif %}">
17
- <i class="mdui-list-item-icon mdui-icon material-icons">{{menu.icon}}</i>
18
- <div class="mdui-list-item-content">{{menu.name}}</div>
19
- </a>
20
- {% endfor %}
21
- </ul>
1
+ <header mdui-headroom class="mdui-appbar mdui-shadow-0 mdui-appbar-fixed">
2
+ <div class="mdui-toolbar">
3
+ <a href="javascript:;" class="mdui-btn mdui-btn-icon mdui-hidden-sm-up" mdui-drawer="{target: '#k-menu'}"><i class="mdui-icon material-icons">&#xe5d2;</i></a>
4
+ <a href="{{site.url}}" class="mdui-typo-title">{{site.title |upcase }}</a>
5
+ <div class="mdui-toolbar-spacer"></div>
6
+ <div class="mdui-hidden-xs-down">
7
+ {% for menu in site.data.menus %}
8
+ <a href="{{menu.url}}" class="mdui-btn {% if menu.url == page.url %}mdui-list-item-active{% endif %}">{{menu.name}}</a>
9
+ {% endfor %}
10
+ </div>
11
+ </div>
12
+ </header>
13
+ <div class="mdui-drawer mdui-drawer-close" id="k-menu">
14
+ <ul class="mdui-list">
15
+ {% for menu in site.data.menus %}
16
+ <a href="{{menu.url}}" class="mdui-list-item mdui-ripple {% if menu.url == page.url %}mdui-list-item-active{% endif %}">
17
+ <i class="mdui-list-item-icon mdui-icon material-icons">{{menu.icon}}</i>
18
+ <div class="mdui-list-item-content">{{menu.name}}</div>
19
+ </a>
20
+ {% endfor %}
21
+ </ul>
22
22
  </div>
data/_includes/main.html CHANGED
@@ -1,6 +1,6 @@
1
- <main>
2
- {{content}}
3
- <button id="toTop" style="display:none;z-index: 1;" mdui-headroom="{unpinnedClass:'k-mdui-headroom-unpinned-top'}" class="mdui-fab mdui-color-white mdui-fab-fixed mdui-ripple"><i class="mdui-icon material-icons">expand_less</i></button>
4
- </main>
5
-
6
-
1
+ <main>
2
+ {{content}}
3
+ <button id="toTop" style="display:none;z-index: 1;" mdui-headroom="{unpinnedClass:'k-mdui-headroom-unpinned-top'}" class="mdui-fab mdui-color-white mdui-fab-fixed mdui-ripple"><i class="mdui-icon material-icons">expand_less</i></button>
4
+ </main>
5
+
6
+
data/_includes/note.html CHANGED
@@ -1,6 +1,6 @@
1
- <div class="mdui-card mdui-shadow-0 mdui-color-blue" style="margin:12px 0px; ">
2
- <div class="mdui-card-content">
3
- <p><b>NOTE: </b></p>
4
- <p>{{include.content}}</p>
5
- </div>
1
+ <div class="mdui-card mdui-shadow-0 mdui-color-blue" style="margin:12px 0px; ">
2
+ <div class="mdui-card-content">
3
+ <p><b>NOTE: </b></p>
4
+ <p>{{include.content}}</p>
5
+ </div>
6
6
  </div>
@@ -1,256 +1,256 @@
1
- <script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
2
- <script src="//cdnjs.cloudflare.com/ajax/libs/mdui/0.2.1/js/mdui.min.js"></script>
3
- <script src="https://cdnjs.cloudflare.com/ajax/libs/nprogress/0.2.0/nprogress.min.js"></script>
4
- <script src="{{ "/assets/js/jquery.scrollToTop.js" | prepend: site.baseurl }}"></script>
5
- {% if page.layout =='search' %}
6
- <script src="{{ "/assets/js/jquery.typeahead.min.js" | prepend: site.baseurl }}"></script>
7
- {% endif %}
8
- {% if page.layout =='editor' %}
9
- <script src="{{ "/assets/js/pickerdata.js" | prepend: site.baseurl }}"></script>
10
- <script src="{{ "/assets/js/chips.js" | prepend: site.baseurl }}"></script>
11
- <script src="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></script>
12
- <script>
13
- $(function(){
14
- $('.datepicker').pickadate({
15
- selectMonths: true,
16
- selectYears: 15
17
- });
18
-
19
- $('input:radio[name="group1"]').on("click",function(){
20
- var categories = $('input:radio[name="group1"]:checked').val();
21
- if (categories ==="radio_custom"){
22
-
23
- }
24
- });
25
- $('.chips').material_chip();
26
- $('.chips-initial').material_chip({
27
- data: [],
28
- });
29
- $('.chips-placeholder').material_chip({
30
- placeholder: 'Enter a tag',
31
- secondaryPlaceholder: '+Tag',
32
- });
33
- $("#imgurl").blur(function(){
34
- var text = $("#imgurl").val().toLowerCase();
35
- if (text.indexOf("jpg") >= 0 || text.indexOf("jpeg") >= 0 || text.indexOf("png") >= 0 || text.indexOf("gif") >= 0 || text.indexOf("svg") >= 0 || text.indexOf("webp") >= 0){
36
- $("#img").attr('src',$("#imgurl").val());
37
- }
38
- });
39
- var simplemde = new SimpleMDE({
40
- autosave: {
41
- enabled: true,
42
- unique_id: "newposts",
43
- }
44
- });
45
- function k_getDate(e,t){
46
- var date = new Date(e);
47
- var Y = date.getFullYear() + '-';
48
- var M = date.getMonth()+1 + '-';
49
- var D = date.getDate();
50
- if(t=== true){
51
- var h = date.getHours() + ':';
52
- var m = date.getMinutes() + ':';
53
- var s = date.getSeconds() + ' +0800';
54
- return Y+M+D+' '+h+m+s;
55
- }else{
56
- return Y+M+D;
57
- }
58
- };
59
- function k_getCategores(e){
60
- if (e.val() == "radio_custom"){
61
- return $("input[name='radio_custom']").val();
62
- }else{
63
- return e.val();
64
- }
65
- }
66
- function k_getTags(e){
67
- var tags = "";
68
- for (x in e){
69
- tags += e[x].tag+" ";
70
- }
71
- return tags;
72
- }
73
- function k_getFiletitle(e){
74
- var title = e.toLowerCase().split(" ");
75
- var newtitle = "";
76
- for (x in title){
77
- if (parseInt(x)+1 == title.length){
78
- newtitle += title[x];
79
- }else{
80
- newtitle += title[x]+"-";
81
- }
82
- }
83
- return newtitle;
84
- }
85
- var textFile = null,
86
- makeTextFile = function (text) {
87
- var data = new Blob([text], {
88
- type: 'text/plain'
89
- });
90
- if (textFile !== null) {
91
- window.URL.revokeObjectURL(textFile);
92
- }
93
-
94
- textFile = window.URL.createObjectURL(data);
95
-
96
- return textFile;
97
- };
98
- var create = document.getElementById('create');
99
- create.addEventListener('click', function () {
100
- var filename,filecontent,title,date,categories,tags,img;
101
- img = $('input[name=img]').val();
102
- tags = k_getTags($('.chips-initial').material_chip('data'));
103
- categories = k_getCategores($("input[name='group1']:checked"));
104
- date = k_getDate($('input[name=date]').val(),true);
105
- title = $('input[name=title]').val();
106
- filecontent = "---\nlayout: post\ntitle: "+title+"\ndate: "+date+"\ncategories: "+categories+"\ntags: "+tags+"\nimg: "+img+"\n---\n"+simplemde.value();
107
- title = k_getFiletitle(title);
108
- filename = k_getDate($('input[name=date]').val(),false)+'-'+title+'.markdown';
109
- $("#downloadlink").attr("download",filename);
110
- var link = document.getElementById('downloadlink');
111
- link.href = makeTextFile(filecontent);
112
- link.style.display = 'block';
113
- }, false);
114
- $("#downloadlink").click(function(){
115
- $(this).hide();
116
- })
117
- });
118
- </script>
119
- {% endif %}
120
- <script type="text/javascript">
121
- NProgress.configure({
122
- showSpinner: true
123
- });
124
- NProgress.start();
125
- setTimeout(function() {
126
- NProgress.done();
127
- },200);
128
- var disqus = {
129
- load : function disqus(){
130
- var disqus_shortname = $("#load-disqus").attr("data");
131
- if(typeof DISQUS !== 'object') {
132
- (function () {
133
- var s = document.createElement('script'); s.async = true;
134
- s.type = 'text/javascript';
135
- s.src = '//' + disqus_shortname + '.disqus.com/embed.js';
136
- (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
137
- }());
138
- $('#load-disqus').remove();
139
- }
140
- }
141
- }
142
- </script>
143
- <script>
144
- $(function(){
145
- if ('serviceWorker' in navigator) {
146
- navigator.serviceWorker.register("{{ "/sw.js" | relative_url }}").then(function() {
147
- console.log("Service Worker Registered");
148
- });
149
- }
150
- Array.prototype.forEach.call(document.querySelectorAll(".mdui-card-media"), function(a) {
151
- var b = a.querySelector("a");
152
- if (!b) {
153
- return
154
- }
155
- var c = b.getAttribute("href");
156
- if (!c) {
157
- return
158
- }
159
- a.addEventListener("click", function() {
160
- location.href = c
161
- })
162
- });
163
-
164
- $("#toTop").scrollToTop();
165
- {% if page.layout =='search' %}
166
- var names = new Array();
167
- var urls = new Array();
168
- $.getJSON("/search.json").done(function(data){
169
- for (var index in data){
170
- var item = data[index];
171
- names[index] = item.title;
172
- urls[names[index]] = item.url
173
- }
174
- $.typeahead({
175
- input: '.js-typeahead-country_v1',
176
- order: "desc",
177
- source: {
178
- data: names
179
- },
180
- selector: {
181
- container: "typeahead__container",
182
- result: " mdui-card k-search-card",
183
- list: "mdui-list",
184
- item: "mdui-list-item"
185
- },
186
- callback: {
187
- onClick: function (node,a,item,event){
188
- window.location.href = urls[item.display];
189
- },
190
- }
191
- });
192
- });
193
- {% endif %}
194
- });
195
- </script>
196
-
197
- {% if page.layout == "tags" %}
198
- <script>
199
-
200
- $(function(){
201
- var tagid;
202
- $(".k-tagcloud").on("click",function(e){
203
- var $this = $(this);
204
- tagid = $this.attr("id");
205
- if(tagid!=null){
206
- $.ajax({
207
- type: "GET",
208
- url:"/tags.json",
209
- dataType:"json",
210
- success: function(data){
211
- var content = "<ul class='mdui-list'>";
212
- $.each(data,function(i,n){
213
- if(n.id === tagid){
214
- var posts = n.post;
215
- $.each(posts,function(i,n){
216
- content+="<li class='mdui-list-item mdui-ripple'><a href='"+n.url+"'><div class='mdui-list-item-content'><div class='mdui-list-item-title mdui-list-item-one-line'>"+n.title+"</div><div class='mdui-list-item-text mdui-list-item-one-line'>"+n.excerpt+"</div>
217
- </div></li>";
218
- });
219
- }
220
- });
221
- content += "</ul>";
222
- $('#taglist').html(content)
223
- }
224
- })
225
- }
226
- });
227
-
228
- })
229
- </script>
230
- {% endif %}
231
-
232
- {% if page.layout == "post" %}
233
- <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/highlight.min.js"></script>
234
- <script src="{{ "/assets/js/toc.min.js" | prepend: site.baseurl }}"></script>
235
- <script src="{{ "/assets/js/pushpin.js" | prepend: site.baseurl }}"></script>
236
- <script>
237
- $(function(){
238
- $("div.k-page-col").css('margin',0);
239
- hljs.initHighlightingOnLoad();
240
- $('#toc').toc({
241
- 'selectors': 'h2',
242
- 'prefix': 'toc',
243
- 'highlightOffset': 64
244
- });
245
- $("#toc").find("ul").fadeIn(1000);
246
- var tocBottom = $('.mdui-card-content').offset().top + $('.mdui-card-content').height() - $('#toc-card').height();
247
- var tocOffset = $('.k-post-media').offset().top;
248
- var tocTop = $('.mdui-card-header').offset().top;
249
- $('#toc-card').pushpin({
250
- top: tocTop,
251
- bottom: 99999,
252
- offset: tocOffset
253
- });
254
- })
255
- </script>
256
- {% endif %}
1
+ <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
2
+ <script src="https://cdn.bootcss.com/mdui/0.2.1/js/mdui.min.js"></script>
3
+ <script src="https://cdn.bootcss.com/nprogress/0.2.0/nprogress.min.js"></script>
4
+ <script src="{{ "/assets/js/jquery.scrollToTop.js" | prepend: site.baseurl }}"></script>
5
+ {% if page.layout =='search' %}
6
+ <script src="{{ "/assets/js/jquery.typeahead.min.js" | prepend: site.baseurl }}"></script>
7
+ {% endif %}
8
+ {% if page.layout =='editor' %}
9
+ <script src="{{ "/assets/js/pickerdata.js" | prepend: site.baseurl }}"></script>
10
+ <script src="{{ "/assets/js/chips.js" | prepend: site.baseurl }}"></script>
11
+ <script src="https://cdn.bootcss.com/simplemde/1.11.2/simplemde.min.js"></script>
12
+ <script>
13
+ $(function(){
14
+ $('.datepicker').pickadate({
15
+ selectMonths: true,
16
+ selectYears: 15
17
+ });
18
+
19
+ $('input:radio[name="group1"]').on("click",function(){
20
+ var categories = $('input:radio[name="group1"]:checked').val();
21
+ if (categories ==="radio_custom"){
22
+
23
+ }
24
+ });
25
+ $('.chips').material_chip();
26
+ $('.chips-initial').material_chip({
27
+ data: [],
28
+ });
29
+ $('.chips-placeholder').material_chip({
30
+ placeholder: 'Enter a tag',
31
+ secondaryPlaceholder: '+Tag',
32
+ });
33
+ $("#imgurl").blur(function(){
34
+ var text = $("#imgurl").val().toLowerCase();
35
+ if (text.indexOf("jpg") >= 0 || text.indexOf("jpeg") >= 0 || text.indexOf("png") >= 0 || text.indexOf("gif") >= 0 || text.indexOf("svg") >= 0 || text.indexOf("webp") >= 0){
36
+ $("#img").attr('src',$("#imgurl").val());
37
+ }
38
+ });
39
+ var simplemde = new SimpleMDE({
40
+ autosave: {
41
+ enabled: true,
42
+ unique_id: "newposts",
43
+ }
44
+ });
45
+ function k_getDate(e,t){
46
+ var date = new Date(e);
47
+ var Y = date.getFullYear() + '-';
48
+ var M = date.getMonth()+1 + '-';
49
+ var D = date.getDate();
50
+ if(t=== true){
51
+ var h = date.getHours() + ':';
52
+ var m = date.getMinutes() + ':';
53
+ var s = date.getSeconds() + ' +0800';
54
+ return Y+M+D+' '+h+m+s;
55
+ }else{
56
+ return Y+M+D;
57
+ }
58
+ };
59
+ function k_getCategores(e){
60
+ if (e.val() == "radio_custom"){
61
+ return $("input[name='radio_custom']").val();
62
+ }else{
63
+ return e.val();
64
+ }
65
+ }
66
+ function k_getTags(e){
67
+ var tags = "";
68
+ for (x in e){
69
+ tags += e[x].tag+" ";
70
+ }
71
+ return tags;
72
+ }
73
+ function k_getFiletitle(e){
74
+ var title = e.toLowerCase().split(" ");
75
+ var newtitle = "";
76
+ for (x in title){
77
+ if (parseInt(x)+1 == title.length){
78
+ newtitle += title[x];
79
+ }else{
80
+ newtitle += title[x]+"-";
81
+ }
82
+ }
83
+ return newtitle;
84
+ }
85
+ var textFile = null,
86
+ makeTextFile = function (text) {
87
+ var data = new Blob([text], {
88
+ type: 'text/plain'
89
+ });
90
+ if (textFile !== null) {
91
+ window.URL.revokeObjectURL(textFile);
92
+ }
93
+
94
+ textFile = window.URL.createObjectURL(data);
95
+
96
+ return textFile;
97
+ };
98
+ var create = document.getElementById('create');
99
+ create.addEventListener('click', function () {
100
+ var filename,filecontent,title,date,categories,tags,img;
101
+ img = $('input[name=img]').val();
102
+ tags = k_getTags($('.chips-initial').material_chip('data'));
103
+ categories = k_getCategores($("input[name='group1']:checked"));
104
+ date = k_getDate($('input[name=date]').val(),true);
105
+ title = $('input[name=title]').val();
106
+ filecontent = "---\nlayout: post\ntitle: "+title+"\ndate: "+date+"\ncategories: "+categories+"\ntags: "+tags+"\nimg: "+img+"\n---\n"+simplemde.value();
107
+ title = k_getFiletitle(title);
108
+ filename = k_getDate($('input[name=date]').val(),false)+'-'+title+'.markdown';
109
+ $("#downloadlink").attr("download",filename);
110
+ var link = document.getElementById('downloadlink');
111
+ link.href = makeTextFile(filecontent);
112
+ link.style.display = 'block';
113
+ }, false);
114
+ $("#downloadlink").click(function(){
115
+ $(this).hide();
116
+ })
117
+ });
118
+ </script>
119
+ {% endif %}
120
+ <script type="text/javascript">
121
+ NProgress.configure({
122
+ showSpinner: true
123
+ });
124
+ NProgress.start();
125
+ setTimeout(function() {
126
+ NProgress.done();
127
+ },200);
128
+ var disqus = {
129
+ load : function disqus(){
130
+ var disqus_shortname = $("#load-disqus").attr("data");
131
+ if(typeof DISQUS !== 'object') {
132
+ (function () {
133
+ var s = document.createElement('script'); s.async = true;
134
+ s.type = 'text/javascript';
135
+ s.src = '//' + disqus_shortname + '.disqus.com/embed.js';
136
+ (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
137
+ }());
138
+ $('#load-disqus').remove();
139
+ }
140
+ }
141
+ }
142
+ </script>
143
+ <script>
144
+ $(function(){
145
+ if ('serviceWorker' in navigator) {
146
+ navigator.serviceWorker.register("{{ "/sw.js" | relative_url }}").then(function() {
147
+ console.log("Service Worker Registered");
148
+ });
149
+ }
150
+ Array.prototype.forEach.call(document.querySelectorAll(".mdui-card-media"), function(a) {
151
+ var b = a.querySelector("a");
152
+ if (!b) {
153
+ return
154
+ }
155
+ var c = b.getAttribute("href");
156
+ if (!c) {
157
+ return
158
+ }
159
+ a.addEventListener("click", function() {
160
+ location.href = c
161
+ })
162
+ });
163
+
164
+ $("#toTop").scrollToTop();
165
+ {% if page.layout =='search' %}
166
+ var names = new Array();
167
+ var urls = new Array();
168
+ $.getJSON("/search.json").done(function(data){
169
+ for (var index in data){
170
+ var item = data[index];
171
+ names[index] = item.title;
172
+ urls[names[index]] = item.url
173
+ }
174
+ $.typeahead({
175
+ input: '.js-typeahead-country_v1',
176
+ order: "desc",
177
+ source: {
178
+ data: names
179
+ },
180
+ selector: {
181
+ container: "typeahead__container",
182
+ result: " mdui-card k-search-card",
183
+ list: "mdui-list",
184
+ item: "mdui-list-item"
185
+ },
186
+ callback: {
187
+ onClick: function (node,a,item,event){
188
+ window.location.href = urls[item.display];
189
+ },
190
+ }
191
+ });
192
+ });
193
+ {% endif %}
194
+ });
195
+ </script>
196
+
197
+ {% if page.layout == "tags" %}
198
+ <script>
199
+
200
+ $(function(){
201
+ var tagid;
202
+ $(".k-tagcloud").on("click",function(e){
203
+ var $this = $(this);
204
+ tagid = $this.attr("id");
205
+ if(tagid!=null){
206
+ $.ajax({
207
+ type: "GET",
208
+ url:"/tags.json",
209
+ dataType:"json",
210
+ success: function(data){
211
+ var content = "<ul class='mdui-list'>";
212
+ $.each(data,function(i,n){
213
+ if(n.id === tagid){
214
+ var posts = n.post;
215
+ $.each(posts,function(i,n){
216
+ content+="<li class='mdui-list-item mdui-ripple'><a href='"+n.url+"'><div class='mdui-list-item-content'><div class='mdui-list-item-title mdui-list-item-one-line'>"+n.title+"</div><div class='mdui-list-item-text mdui-list-item-one-line'>"+n.excerpt+"</div>
217
+ </div></li>";
218
+ });
219
+ }
220
+ });
221
+ content += "</ul>";
222
+ $('#taglist').html(content)
223
+ }
224
+ })
225
+ }
226
+ });
227
+
228
+ })
229
+ </script>
230
+ {% endif %}
231
+
232
+ {% if page.layout == "post" %}
233
+ <script src="https://cdn.bootcss.com/highlight.js/9.11.0/highlight.min.js"></script>
234
+ <script src="{{ "/assets/js/toc.min.js" | prepend: site.baseurl }}"></script>
235
+ <script src="{{ "/assets/js/pushpin.js" | prepend: site.baseurl }}"></script>
236
+ <script>
237
+ $(function(){
238
+ $("div.k-page-col").css('margin',0);
239
+ hljs.initHighlightingOnLoad();
240
+ $('#toc').toc({
241
+ 'selectors': 'h2',
242
+ 'prefix': 'toc',
243
+ 'highlightOffset': 64
244
+ });
245
+ $("#toc").find("ul").fadeIn(1000);
246
+ var tocBottom = $('.mdui-card-content').offset().top + $('.mdui-card-content').height() - $('#toc-card').height();
247
+ var tocOffset = $('.k-post-media').offset().top;
248
+ var tocTop = $('.mdui-card-header').offset().top;
249
+ $('#toc-card').pushpin({
250
+ top: tocTop,
251
+ bottom: 99999,
252
+ offset: tocOffset
253
+ });
254
+ })
255
+ </script>
256
+ {% endif %}