|
52 | 52 |
|
53 | 53 | {% if page.section-type == "index" %} |
54 | 54 |
|
55 | | -<!-- Collapse navbar when navbar-brand is clicked --> |
56 | | - |
57 | | -<script> |
58 | | - $(function () { |
59 | | - $(".navbar-brand").click(function () { |
60 | | - $(".collapse.in") && |
61 | | - $(".collapse.in").animate({ height: "1px" }, 500, function () { |
62 | | - $(".collapse.in").removeClass("in"); |
63 | | - }); |
| 55 | + <!-- Collapse navbar when navbar-brand is clicked --> |
| 56 | + |
| 57 | + <script> |
| 58 | + $(function () { |
| 59 | + $(".navbar-brand").click(function () { |
| 60 | + $(".collapse.in") && |
| 61 | + $(".collapse.in").animate({ height: "1px" }, 500, function () { |
| 62 | + $(".collapse.in").removeClass("in"); |
| 63 | + }); |
| 64 | + }); |
64 | 65 | }); |
65 | | - }); |
66 | | -</script> |
| 66 | + </script> |
67 | 67 |
|
68 | | -{% if site.dynamic-typing %} |
| 68 | + {% if site.dynamic-typing %} |
69 | 69 |
|
70 | | -<!-- Dynamic Typing Start --> |
| 70 | + <!-- Dynamic Typing Start --> |
71 | 71 |
|
72 | | -<script |
73 | | - type="text/javascript" |
74 | | - src="https://cdnjs.cloudflare.com/ajax/libs/typed.js/1.1.7/typed.min.js" |
75 | | -></script> |
| 72 | + <script |
| 73 | + type="text/javascript" |
| 74 | + src="https://cdnjs.cloudflare.com/ajax/libs/typed.js/1.1.7/typed.min.js" |
| 75 | + ></script> |
| 76 | + |
| 77 | + <script type="text/javascript"> |
76 | 78 |
|
77 | | -<script type="text/javascript"> |
| 79 | + var myQuotes = new Array(); |
| 80 | + {% for line in site.lines %} |
| 81 | + myQuotes.push("{{ line.text }}"); |
| 82 | + {% endfor %} |
78 | 83 |
|
79 | | - var myQuotes = new Array(); |
80 | | - {% for line in site.lines %} |
81 | | - myQuotes.push("{{ line.text }}"); |
82 | | - {% endfor %} |
| 84 | + function shuffle(array) { |
| 85 | + var currentIndex = array.length, temporaryValue, randomIndex ; |
83 | 86 |
|
84 | | - function shuffle(array) { |
85 | | - var currentIndex = array.length, temporaryValue, randomIndex ; |
| 87 | + // While there remain elements to shuffle... |
| 88 | + while (0 !== currentIndex) { |
86 | 89 |
|
87 | | - // While there remain elements to shuffle... |
88 | | - while (0 !== currentIndex) { |
| 90 | + // Pick a remaining element... |
| 91 | + randomIndex = Math.floor(Math.random() * currentIndex); |
| 92 | + currentIndex -= 1; |
89 | 93 |
|
90 | | - // Pick a remaining element... |
91 | | - randomIndex = Math.floor(Math.random() * currentIndex); |
92 | | - currentIndex -= 1; |
| 94 | + // And swap it with the current element. |
| 95 | + temporaryValue = array[currentIndex]; |
| 96 | + array[currentIndex] = array[randomIndex]; |
| 97 | + array[randomIndex] = temporaryValue; |
| 98 | + } |
93 | 99 |
|
94 | | - // And swap it with the current element. |
95 | | - temporaryValue = array[currentIndex]; |
96 | | - array[currentIndex] = array[randomIndex]; |
97 | | - array[randomIndex] = temporaryValue; |
| 100 | + return array; |
98 | 101 | } |
99 | 102 |
|
100 | | - return array; |
101 | | - } |
| 103 | + {% if site.shuffle %} |
| 104 | + shuffle(myQuotes) |
| 105 | + {% endif %} |
| 106 | + |
| 107 | + $(".intro-text").typed({ |
| 108 | + strings: myQuotes, |
| 109 | + typeSpeed: {{ site.type-speed }}, |
| 110 | + backDelay: {{ site.delete-delay }}, |
| 111 | + startDelay: {{ site.start-delay }}, |
| 112 | + loop: {{ site..loop }}, |
| 113 | + loopCount: {{ site.loop-count }}, |
| 114 | + cursorChar: "|" |
| 115 | + }); |
| 116 | + </script> |
| 117 | + |
| 118 | + <!-- Dynamic Typing End --> |
102 | 119 |
|
103 | | - {% if site.shuffle %} |
104 | | - shuffle(myQuotes) |
105 | 120 | {% endif %} |
106 | 121 |
|
107 | | - $(".intro-text").typed({ |
108 | | - strings: myQuotes, |
109 | | - typeSpeed: {{ site.type-speed }}, |
110 | | - backDelay: {{ site.delete-delay }}, |
111 | | - startDelay: {{ site.start-delay }}, |
112 | | - loop: {{ site..loop }}, |
113 | | - loopCount: {{ site.loop-count }}, |
114 | | - cursorChar: "|" |
115 | | - }); |
116 | | -</script> |
| 122 | +{% endif %} |
117 | 123 |
|
118 | | -<!-- Dynamic Typing End --> |
| 124 | +{% if site.disqus-shortname %} |
119 | 125 |
|
120 | | -{% endif %} {% endif %} {% if site.disqus-shortname %} {% if page.has-comments |
121 | | -%} |
| 126 | + {% if page.has-comments %} |
122 | 127 |
|
123 | | -<!-- Comments Counter Start --> |
| 128 | + <!-- Comments Counter Start --> |
124 | 129 |
|
125 | | -<script type="text/javascript"> |
126 | | - var disqus_shortname = "{{ site.disqus-shortname }}"; |
| 130 | + <script type="text/javascript"> |
| 131 | + var disqus_shortname = "{{ site.disqus-shortname }}"; |
127 | 132 |
|
128 | | - (function () { |
129 | | - var s = document.createElement("script"); |
130 | | - s.async = true; |
131 | | - s.type = "text/javascript"; |
132 | | - s.src = "//" + disqus_shortname + ".disqus.com/count.js"; |
133 | | - ( |
134 | | - document.getElementsByTagName("HEAD")[0] || |
135 | | - document.getElementsByTagName("BODY")[0] |
136 | | - ).appendChild(s); |
137 | | - })(); |
138 | | -</script> |
| 133 | + (function () { |
| 134 | + var s = document.createElement("script"); |
| 135 | + s.async = true; |
| 136 | + s.type = "text/javascript"; |
| 137 | + s.src = "//" + disqus_shortname + ".disqus.com/count.js"; |
| 138 | + ( |
| 139 | + document.getElementsByTagName("HEAD")[0] || |
| 140 | + document.getElementsByTagName("BODY")[0] |
| 141 | + ).appendChild(s); |
| 142 | + })(); |
| 143 | + </script> |
139 | 144 |
|
140 | | -<!-- Comments Counter End --> |
| 145 | + <!-- Comments Counter End --> |
141 | 146 |
|
142 | | -{% endif %} {% if page.section-type == "post" %} |
| 147 | + {% endif %} |
143 | 148 |
|
144 | | -<!-- Disqus Comments --> |
| 149 | + {% if page.section-type == "post" %} |
145 | 150 |
|
146 | | -<script type="text/javascript"> |
147 | | - var disqus_shortname = "{{ site.disqus-shortname }}"; |
148 | | - (function () { |
149 | | - var dsq = document.createElement("script"); |
150 | | - dsq.type = "text/javascript"; |
151 | | - dsq.async = true; |
152 | | - dsq.src = "//" + disqus_shortname + ".disqus.com/embed.js"; |
153 | | - ( |
154 | | - document.getElementsByTagName("head")[0] || |
155 | | - document.getElementsByTagName("body")[0] |
156 | | - ).appendChild(dsq); |
157 | | - })(); |
158 | | -</script> |
| 151 | + <!-- Disqus Comments --> |
| 152 | + |
| 153 | + <script type="text/javascript"> |
| 154 | + var disqus_shortname = "{{ site.disqus-shortname }}"; |
| 155 | + (function () { |
| 156 | + var dsq = document.createElement("script"); |
| 157 | + dsq.type = "text/javascript"; |
| 158 | + dsq.async = true; |
| 159 | + dsq.src = "//" + disqus_shortname + ".disqus.com/embed.js"; |
| 160 | + ( |
| 161 | + document.getElementsByTagName("head")[0] || |
| 162 | + document.getElementsByTagName("body")[0] |
| 163 | + ).appendChild(dsq); |
| 164 | + })(); |
| 165 | + </script> |
159 | 166 |
|
160 | | -<!-- Share buttons Start --> |
161 | | -<script src="https://cdnjs.cloudflare.com/ajax/libs/rrssb/1.14.0/js/rrssb.min.js"></script> |
| 167 | + <!-- Share buttons Start --> |
| 168 | + <script src="https://cdnjs.cloudflare.com/ajax/libs/rrssb/1.14.0/js/rrssb.min.js"></script> |
| 169 | + |
| 170 | + {% endif %} |
162 | 171 |
|
163 | | -{% endif %} {% endif %} |
| 172 | +{% endif %} |
164 | 173 |
|
165 | 174 | <!-- Javascript End --> |
0 commit comments