Commit dd138084 authored by Van's avatar Van

💄 #47

parent b58eff0f
...@@ -106,8 +106,5 @@ No Result, Return to <a href="${servePath}">Index</a> or <a href="https://hacpai ...@@ -106,8 +106,5 @@ No Result, Return to <a href="${servePath}">Index</a> or <a href="https://hacpai
Powered by <a href="https://b3log.org" target="_blank">B3log 开源</a> • Solo ${version} Powered by <a href="https://b3log.org" target="_blank">B3log 开源</a> • Solo ${version}
</div> </div>
</div> </div>
<script type="text/javascript" src="${staticServePath}/js/lib/jquery/jquery.min.js" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
<#include 'label.ftl'/>
</body> </body>
</html> </html>
...@@ -27,8 +27,6 @@ import '../lib/jquery/jquery.bowknot.min' ...@@ -27,8 +27,6 @@ import '../lib/jquery/jquery.bowknot.min'
* @version 1.4.0.1, Jan 13, 2020 * @version 1.4.0.1, Jan 13, 2020
*/ */
window.$ = $
Util.init()
window.htmlDecode = function (code) { window.htmlDecode = function (code) {
var div = document.createElement('div') var div = document.createElement('div')
div.innerHTML = decodeURIComponent(code) div.innerHTML = decodeURIComponent(code)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -303,3 +303,7 @@ window.Util = { ...@@ -303,3 +303,7 @@ window.Util = {
})) }))
}, },
} }
$(document).ready(function () {
Util.init()
})
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -1351,7 +1351,8 @@ input[type=text]:focus { ...@@ -1351,7 +1351,8 @@ input[type=text]:focus {
line-height: 21px; line-height: 21px;
font-size: 12px; font-size: 12px;
display: inline-block; display: inline-block;
margin-right: 5px; } margin-right: 5px;
margin-top: 5px; }
.search__articles .tag:hover { .search__articles .tag:hover {
color: #000; color: #000;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
......
...@@ -255,6 +255,7 @@ input[type=text]:focus { ...@@ -255,6 +255,7 @@ input[type=text]:focus {
font-size: 12px; font-size: 12px;
display: inline-block; display: inline-block;
margin-right: 5px; margin-right: 5px;
margin-top: 5px;
&:hover { &:hover {
color: #000; color: #000;
......
...@@ -97,6 +97,5 @@ window.Skin = { ...@@ -97,6 +97,5 @@ window.Skin = {
} }
$(document).ready(function () { $(document).ready(function () {
Util.init()
Skin.init() Skin.init()
}) })
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
Theme ${skinDirName} by <a rel="friend" href="http://vanessa.b3log.org" target="_blank">Vanessa</a>. Theme ${skinDirName} by <a rel="friend" href="http://vanessa.b3log.org" target="_blank">Vanessa</a>.
</div> </div>
<#include "../../common-template/label.ftl"> <#include "../../common-template/label.ftl">
<script src="${staticServePath}/skin/${skinDirName}/js/common.min.js?${staticResourceVersion}"></script> <script type="text/javascript" src="${staticServePath}/js/common.min.js?${staticResourceVersion}" charset="utf-8"></script>
<script type="text/javascript"> <script type="text/javascript">
// init brush // init brush
var buildBrush = function () { var buildBrush = function () {
...@@ -76,5 +76,4 @@ ...@@ -76,5 +76,4 @@
}); });
}); });
</script> </script>
<script type="text/javascript" src="${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
${plugins} ${plugins}
...@@ -30,10 +30,9 @@ ...@@ -30,10 +30,9 @@
<div><em>All rights reserved.</em></div> <div><em>All rights reserved.</em></div>
</div> </div>
<script type="text/javascript" src="${staticServePath}/js/lib/jquery/jquery.min.js" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/skins/${skinDirName}/js/bootstrap${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
<#include "../../common-template/label.ftl"> <#include "../../common-template/label.ftl">
<script type="text/javascript" src="${staticServePath}/js/common.min.js?${staticResourceVersion}" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/skins/${skinDirName}/js/bootstrap.min.js?${staticResourceVersion}" charset="utf-8"></script>
<script> <script>
Util.setTopBar() Util.setTopBar()
</script> </script>
......
This diff is collapsed.
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
<#if commentable> <#if commentable>
<div class="wrapper"> <div class="wrapper">
<div id="vcomment" <div id="vcomment"
style=" margin-bottom: 40px; margin-top: 80px; style=" margin-bottom: 40px; margin-top: 80px;
border: 1px solid rgba(255,255,255,0.8); border: 1px solid rgba(255,255,255,0.8);
border-radius: 5px; border-radius: 5px;
background: rgba(255,255,255,0.9); background: rgba(255,255,255,0.9);
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
<#if pjax><!---- pjax {#pjax} end ----></#if> <#if pjax><!---- pjax {#pjax} end ----></#if>
</div> </div>
<script type="text/javascript" <script type="text/javascript"
src="${staticServePath}/skins/${skinDirName}/js/TweenMax${miniPostfix}.js?${staticResourceVersion}" src="${staticServePath}/skins/${skinDirName}/js/TweenMax.min.js?${staticResourceVersion}"
charset="utf-8"></script> charset="utf-8"></script>
<#include "footer.ftl"> <#include "footer.ftl">
<#if article?? && article.articleToC?? && article.articleToC?size &gt; 0> <#if article?? && article.articleToC?? && article.articleToC?size &gt; 0>
......
...@@ -35,16 +35,11 @@ ...@@ -35,16 +35,11 @@
<svg class="side__top" id="sideTop" version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"> <svg class="side__top" id="sideTop" version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
<path d="M26.562 13.958c0 0.72 0.583 1.303 1.303 1.303s1.303-0.583 1.303-1.303v0c0-0.72-0.583-1.303-1.303-1.303s-1.303 0.583-1.303 1.303v0zM23.305 10.7c0 0 0 0 0 0 0 0.72 0.583 1.303 1.303 1.303s1.303-0.583 1.303-1.303c0-0 0-0 0-0v0c0-0 0-0 0-0 0-0.72-0.583-1.303-1.303-1.303s-1.303 0.583-1.303 1.303c0 0 0 0 0 0v0zM20.022 7.417c0 0 0 0 0 0 0 0.72 0.583 1.303 1.303 1.303s1.303-0.583 1.303-1.303c0-0 0-0 0-0v0c0-0 0-0 0-0 0-0.72-0.583-1.303-1.303-1.303s-1.303 0.583-1.303 1.303c0 0 0 0 0 0v0zM29.67 0h-27.339c-0.677 0-1.228 0.551-1.228 1.228s0.551 1.228 1.228 1.228h11.151l-10.725 10.725c-0.476 0.476-0.476 1.253 0 1.729 0.226 0.226 0.551 0.351 0.852 0.351s0.626-0.125 0.852-0.351l10.074-10.074v25.936c0 0.677 0.551 1.228 1.228 1.228s1.228-0.551 1.228-1.228v-26.011c0.476 0.426 1.203 0.426 1.679-0.050s0.476-1.253 0-1.729l-0.576-0.576h11.577c0.677 0 1.228-0.551 1.228-1.228 0-0.626-0.551-1.178-1.228-1.178z"></path> <path d="M26.562 13.958c0 0.72 0.583 1.303 1.303 1.303s1.303-0.583 1.303-1.303v0c0-0.72-0.583-1.303-1.303-1.303s-1.303 0.583-1.303 1.303v0zM23.305 10.7c0 0 0 0 0 0 0 0.72 0.583 1.303 1.303 1.303s1.303-0.583 1.303-1.303c0-0 0-0 0-0v0c0-0 0-0 0-0 0-0.72-0.583-1.303-1.303-1.303s-1.303 0.583-1.303 1.303c0 0 0 0 0 0v0zM20.022 7.417c0 0 0 0 0 0 0 0.72 0.583 1.303 1.303 1.303s1.303-0.583 1.303-1.303c0-0 0-0 0-0v0c0-0 0-0 0-0 0-0.72-0.583-1.303-1.303-1.303s-1.303 0.583-1.303 1.303c0 0 0 0 0 0v0zM29.67 0h-27.339c-0.677 0-1.228 0.551-1.228 1.228s0.551 1.228 1.228 1.228h11.151l-10.725 10.725c-0.476 0.476-0.476 1.253 0 1.729 0.226 0.226 0.551 0.351 0.852 0.351s0.626-0.125 0.852-0.351l10.074-10.074v25.936c0 0.677 0.551 1.228 1.228 1.228s1.228-0.551 1.228-1.228v-26.011c0.476 0.426 1.203 0.426 1.679-0.050s0.476-1.253 0-1.729l-0.576-0.576h11.577c0.677 0 1.228-0.551 1.228-1.228 0-0.626-0.551-1.178-1.228-1.178z"></path>
</svg> </svg>
<script type="text/javascript" src="${staticServePath}/js/lib/compress/pjax.min.js" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}"
charset="utf-8"></script>
<script type="text/javascript" <script type="text/javascript"
src="${staticServePath}/skins/${skinDirName}/js/circleMagic${miniPostfix}.js?${staticResourceVersion}" src="${staticServePath}/skins/${skinDirName}/js/circleMagic.min.js?${staticResourceVersion}"
charset="utf-8"></script> charset="utf-8"></script>
<#include "../../common-template/label.ftl">
<script type="text/javascript" <script type="text/javascript"
src="${staticServePath}/skins/${skinDirName}/js/common${miniPostfix}.js?${staticResourceVersion}" src="${staticServePath}/skins/${skinDirName}/js/common.min.js?${staticResourceVersion}"
charset="utf-8"></script> charset="utf-8"></script>
<#include "../../common-template/label.ftl">
${plugins} ${plugins}
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
...@@ -49,11 +49,8 @@ ...@@ -49,11 +49,8 @@
</div> </div>
</footer> </footer>
<script type="text/javascript" src="${staticServePath}/js/lib/compress/pjax.min.js" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}"
charset="utf-8"></script>
<#include "../../common-template/label.ftl"> <#include "../../common-template/label.ftl">
<script type="text/javascript" <script type="text/javascript"
src="${staticServePath}/skins/${skinDirName}/js/common${miniPostfix}.js?${staticResourceVersion}" src="${staticServePath}/skins/${skinDirName}/js/common.min.js?${staticResourceVersion}"
charset="utf-8"></script> charset="utf-8"></script>
${plugins} ${plugins}
...@@ -43,9 +43,8 @@ ...@@ -43,9 +43,8 @@
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<script type="text/javascript" src="${staticServePath}/js/lib/jquery/jquery.min.js" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
<#include "../../common-template/label.ftl"> <#include "../../common-template/label.ftl">
<script type="text/javascript" src="${staticServePath}/js/common.min.js?${staticResourceVersion}" charset="utf-8"></script>
<script type="text/javascript"> <script type="text/javascript">
maxLength =10; maxLength =10;
......
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
by <a rel="friend" href="http://vanessa.b3log.org" target="_blank">Vanessa</a>. by <a rel="friend" href="http://vanessa.b3log.org" target="_blank">Vanessa</a>.
</span> </span>
</footer> </footer>
<script type="text/javascript" src="${staticServePath}/js/lib/jquery/jquery.min.js" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/skins/${skinDirName}/js/${skinDirName}${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
<#include "../../common-template/label.ftl"> <#include "../../common-template/label.ftl">
<script src="${staticServePath}/skins/${skinDirName}/js/common.min.js?${staticResourceVersion}"></script>
${plugins} ${plugins}
...@@ -108,7 +108,7 @@ var Finding = { ...@@ -108,7 +108,7 @@ var Finding = {
$.ajax({ $.ajax({
method: 'GET', method: 'GET',
url: Label.staticServePath + url: Label.staticServePath +
'/js/lib/jquery.qrcode.min.js', '/js/lib/jquery.qrcode.min.js',
dataType: 'script', dataType: 'script',
cache: true, cache: true,
success: function () { success: function () {
...@@ -130,4 +130,4 @@ var Finding = { ...@@ -130,4 +130,4 @@ var Finding = {
} }
}; };
Finding.init(); Finding.init();
\ No newline at end of file
...@@ -38,8 +38,6 @@ ...@@ -38,8 +38,6 @@
</footer> </footer>
<div class="icon-up" onclick="Util.goTop()"></div> <div class="icon-up" onclick="Util.goTop()"></div>
<script type="text/javascript" src="${staticServePath}/js/lib/compress/pjax.min.js" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
<#include "../../common-template/label.ftl"> <#include "../../common-template/label.ftl">
<script type="text/javascript" src="${staticServePath}/skins/${skinDirName}/js/common${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script> <script type="text/javascript" src="${staticServePath}/skins/${skinDirName}/js/common.min.js?${staticResourceVersion}" charset="utf-8"></script>
${plugins} ${plugins}
...@@ -43,11 +43,8 @@ ...@@ -43,11 +43,8 @@
</footer> </footer>
</div> </div>
<script type="text/javascript" src="${staticServePath}/js/lib/compress/pjax.min.js" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}"
charset="utf-8"></script>
<#include "../../common-template/label.ftl"> <#include "../../common-template/label.ftl">
<script type="text/javascript" <script type="text/javascript"
src="${staticServePath}/skins/${skinDirName}/js/common${miniPostfix}.js?${staticResourceVersion}" src="${staticServePath}/skins/${skinDirName}/js/common.min.js?${staticResourceVersion}"
charset="utf-8"></script> charset="utf-8"></script>
${plugins} ${plugins}
...@@ -29,8 +29,6 @@ ...@@ -29,8 +29,6 @@
</div> </div>
</div> </div>
<div id="goTop" onclick="goTop()">TOP</div> <div id="goTop" onclick="goTop()">TOP</div>
<script type="text/javascript" src="${staticServePath}/js/lib/jquery/jquery.min.js" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/skins/${skinDirName}/js/${skinDirName}${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
<#include "../../common-template/label.ftl"> <#include "../../common-template/label.ftl">
<script src="${staticServePath}/skins/${skinDirName}/js/common.min.js?${staticResourceVersion}"></script>
${plugins} ${plugins}
...@@ -83,13 +83,10 @@ ...@@ -83,13 +83,10 @@
</div> </div>
</div> </div>
</footer> </footer>
<script type="text/javascript" src="${staticServePath}/js/lib/compress/pjax.min.js" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}"
charset="utf-8"></script> charset="utf-8"></script>
<#include "../../common-template/label.ftl"> <#include "../../common-template/label.ftl">
<script type="text/javascript" src="${staticServePath}/skins/${skinDirName}/js/headroom${miniPostfix}.js" <script type="text/javascript" src="${staticServePath}/skins/${skinDirName}/js/headroom.min.js"></script>
charset="utf-8"></script>
<script type="text/javascript" <script type="text/javascript"
src="${staticServePath}/skins/${skinDirName}/js/common${miniPostfix}.js?${staticResourceVersion}" src="${staticServePath}/skins/${skinDirName}/js/common.min.js?${staticResourceVersion}"
charset="utf-8"></script> charset="utf-8"></script>
${plugins} ${plugins}
/*
* Solo - A small and beautiful blogging system written in Java.
* Copyright (c) 2010-present, b3log.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
!function(a,b){"use strict";"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?module.exports=b():a.Headroom=b()}(this,function(){"use strict";function a(a){this.callback=a,this.ticking=!1}function b(a){return a&&"undefined"!=typeof window&&(a===window||a.nodeType)}function c(a){if(arguments.length<=0)throw new Error("Missing arguments in extend function");var d,e,f=a||{};for(e=1;e<arguments.length;e++){var g=arguments[e]||{};for(d in g)"object"!=typeof f[d]||b(f[d])?f[d]=f[d]||g[d]:f[d]=c(f[d],g[d])}return f}function d(a){return a===Object(a)?a:{down:a,up:a}}function e(a,b){b=c(b,e.options),this.lastKnownScrollY=0,this.elem=a,this.tolerance=d(b.tolerance),this.classes=b.classes,this.offset=b.offset,this.scroller=b.scroller,this.initialised=!1,this.onPin=b.onPin,this.onUnpin=b.onUnpin,this.onTop=b.onTop,this.onNotTop=b.onNotTop,this.onBottom=b.onBottom,this.onNotBottom=b.onNotBottom}var f={bind:!!function(){}.bind,classList:"classList"in document.documentElement,rAF:!!(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame)};return window.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame,a.prototype={constructor:a,update:function(){this.callback&&this.callback(),this.ticking=!1},requestTick:function(){this.ticking||(requestAnimationFrame(this.rafCallback||(this.rafCallback=this.update.bind(this))),this.ticking=!0)},handleEvent:function(){this.requestTick()}},e.prototype={constructor:e,init:function(){if(e.cutsTheMustard)return this.debouncer=new a(this.update.bind(this)),this.elem.classList.add(this.classes.initial),setTimeout(this.attachEvent.bind(this),100),this},destroy:function(){var a=this.classes;this.initialised=!1;for(var b in a)a.hasOwnProperty(b)&&this.elem.classList.remove(a[b]);this.scroller.removeEventListener("scroll",this.debouncer,!1)},attachEvent:function(){this.initialised||(this.lastKnownScrollY=this.getScrollY(),this.initialised=!0,this.scroller.addEventListener("scroll",this.debouncer,!1),this.debouncer.handleEvent())},unpin:function(){var a=this.elem.classList,b=this.classes;!a.contains(b.pinned)&&a.contains(b.unpinned)||(a.add(b.unpinned),a.remove(b.pinned),this.onUnpin&&this.onUnpin.call(this))},pin:function(){var a=this.elem.classList,b=this.classes;a.contains(b.unpinned)&&(a.remove(b.unpinned),a.add(b.pinned),this.onPin&&this.onPin.call(this))},top:function(){var a=this.elem.classList,b=this.classes;a.contains(b.top)||(a.add(b.top),a.remove(b.notTop),this.onTop&&this.onTop.call(this))},notTop:function(){var a=this.elem.classList,b=this.classes;a.contains(b.notTop)||(a.add(b.notTop),a.remove(b.top),this.onNotTop&&this.onNotTop.call(this))},bottom:function(){var a=this.elem.classList,b=this.classes;a.contains(b.bottom)||(a.add(b.bottom),a.remove(b.notBottom),this.onBottom&&this.onBottom.call(this))},notBottom:function(){var a=this.elem.classList,b=this.classes;a.contains(b.notBottom)||(a.add(b.notBottom),a.remove(b.bottom),this.onNotBottom&&this.onNotBottom.call(this))},getScrollY:function(){return void 0!==this.scroller.pageYOffset?this.scroller.pageYOffset:void 0!==this.scroller.scrollTop?this.scroller.scrollTop:(document.documentElement||document.body.parentNode||document.body).scrollTop},getViewportHeight:function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight},getElementPhysicalHeight:function(a){return Math.max(a.offsetHeight,a.clientHeight)},getScrollerPhysicalHeight:function(){return this.scroller===window||this.scroller===document.body?this.getViewportHeight():this.getElementPhysicalHeight(this.scroller)},getDocumentHeight:function(){var a=document.body,b=document.documentElement;return Math.max(a.scrollHeight,b.scrollHeight,a.offsetHeight,b.offsetHeight,a.clientHeight,b.clientHeight)},getElementHeight:function(a){return Math.max(a.scrollHeight,a.offsetHeight,a.clientHeight)},getScrollerHeight:function(){return this.scroller===window||this.scroller===document.body?this.getDocumentHeight():this.getElementHeight(this.scroller)},isOutOfBounds:function(a){var b=a<0,c=a+this.getScrollerPhysicalHeight()>this.getScrollerHeight();return b||c},toleranceExceeded:function(a,b){return Math.abs(a-this.lastKnownScrollY)>=this.tolerance[b]},shouldUnpin:function(a,b){var c=a>this.lastKnownScrollY,d=a>=this.offset;return c&&d&&b},shouldPin:function(a,b){var c=a<this.lastKnownScrollY,d=a<=this.offset;return c&&b||d},update:function(){var a=this.getScrollY(),b=a>this.lastKnownScrollY?"down":"up",c=this.toleranceExceeded(a,b);this.isOutOfBounds(a)||(a<=this.offset?this.top():this.notTop(),a+this.getViewportHeight()>=this.getScrollerHeight()?this.bottom():this.notBottom(),this.shouldUnpin(a,c)?this.unpin():this.shouldPin(a,c)&&this.pin(),this.lastKnownScrollY=a)}},e.options={tolerance:{up:0,down:0},offset:0,scroller:window,classes:{pinned:"headroom--pinned",unpinned:"headroom--unpinned",top:"headroom--top",notTop:"headroom--not-top",bottom:"headroom--bottom",notBottom:"headroom--not-bottom",initial:"headroom"}},e.cutsTheMustard="undefined"!=typeof f&&f.rAF&&f.bind&&f.classList,e});
\ No newline at end of file
...@@ -27,9 +27,8 @@ ...@@ -27,9 +27,8 @@
<span onclick="Util.goTop();">${goTopLabel}</span> <span onclick="Util.goTop();">${goTopLabel}</span>
</div> </div>
</div> </div>
<script type="text/javascript" src="${staticServePath}/js/lib/jquery/jquery.min.js" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
<#include "../../common-template/label.ftl"> <#include "../../common-template/label.ftl">
<script type="text/javascript" src="${staticServePath}/js/common.min.js?${staticResourceVersion}" charset="utf-8"></script>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function () { $(document).ready(function () {
Util.setTopBar() Util.setTopBar()
......
...@@ -25,9 +25,8 @@ ...@@ -25,9 +25,8 @@
<div class="right goTop"> <div class="right goTop">
<span onclick="Util.goTop();">${goTopLabel}</span> <span onclick="Util.goTop();">${goTopLabel}</span>
</div> </div>
<script type="text/javascript" src="${staticServePath}/js/lib/jquery/jquery.min.js" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
<#include "../../common-template/label.ftl"> <#include "../../common-template/label.ftl">
<script type="text/javascript" src="${staticServePath}/js/common.min.js?${staticResourceVersion}" charset="utf-8"></script>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function () { $(document).ready(function () {
Util.setTopBar() Util.setTopBar()
......
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
--> -->
<script type="text/javascript" src="${staticServePath}/js/lib/jquery/jquery.min.js" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/skins/${skinDirName}/js/${skinDirName}${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
<#include "../../common-template/label.ftl"> <#include "../../common-template/label.ftl">
<script src="${staticServePath}/skins/${skinDirName}/js/common.min.js?${staticResourceVersion}"></script>
${plugins} ${plugins}
/*
* Solo - A small and beautiful blogging system written in Java.
* Copyright (c) 2010-present, b3log.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* @fileoverview metro-hot js.
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @version 1.1.0.0, Feb 27, 2019
*/
window.MetroHot = {
headerH: $("#header").height() + 30 + ($("#header > div").get(1) ? 30 : 0),
responsiveType: "large",
goTranslate: function() {
window.open("http://translate.google.com/translate?sl=auto&tl=auto&u=" + location.href);
},
init: function() {
// logout
var logoutHref = "";
$("#admin a").each(function() {
if ($(this).attr("href").indexOf("/logout") > -1) {
logoutHref = $(this).attr("href");
}
});
$("#logout, .logout").attr("href", logoutHref);
// 头部标题点击事件
$(".header .title, .navigation").mouseover(function() {
$(".navigation").show();
}).mouseout(function() {
$(".navigation").hide();
});
$(".header .title").click(function() {
window.location.href = Label.servePath;
});
if ($("#dynamic").length === 1) {
// 滚动处理
$(window).scroll(function() {
var y = $(window).scrollTop();
if (y > MetroHot.headerH) {
$("#goTop").fadeIn("slow");
} else {
$("#goTop").hide();
}
}).click(function(event) {
if (event.target.className === "title" || event.target.parentElement.className === "title") {
return;
}
$(".navigation").slideUp();
});
$("body").css("min-height", "inherit");
return;
}
// 滚动处理
$(window).scroll(function() {
var y = $(window).scrollTop();
if (y > MetroHot.headerH) {
$("#goTop").fadeIn("slow");
} else {
$("#goTop").hide();
}
}).click(function(event) {
if (event.target.className === "title" || event.target.parentElement.className === "title") {
return;
}
$(".navigation").slideUp();
}).resize(function() {
var windowW = window.innerWidth,
type = "large";
if (windowW > 460 && windowW <= 860) {
type = "mid";
} else if (window < 460) {
type = "small";
}
if (MetroHot.responsiveType !== type) {
$(window).scroll();
MetroHot.responsiveType === type;
}
});
$(window).scroll();
},
/**
* @description 计算图片 margin-top
* @param {BOM} it 图片元素
*/
loadImg: function(it) {
it.style.marginTop = ("margin-top", (220 - it.height) / 2 + "px");
},
/**
* @description 分享按钮
*/
share: function() {
var $this = $('.share .text')
var $qrCode = $this.find('.icon-wechat')
var shareURL = $qrCode.data('url')
var avatarURL = $qrCode.data('avatar')
var title = encodeURIComponent($qrCode.data('title') + ' - ' +
$qrCode.data('blogtitle')),
url = encodeURIComponent(shareURL)
var urls = {}
urls.weibo = 'http://v.t.sina.com.cn/share/share.php?title=' +
title + '&url=' + url + '&pic=' + avatarURL
urls.qqz = 'https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='
+ url + '&sharesource=qzone&title=' + title + '&pics=' + avatarURL
urls.twitter = 'https://twitter.com/intent/tweet?status=' + title + ' ' +
url
$this.find('span').click(function () {
var key = $(this).data('type')
if (!key) {
return
}
if (key === 'wechat') {
if ($qrCode.find('canvas').length === 0) {
$.ajax({
method: 'GET',
url: Label.staticServePath +
'/js/lib/jquery.qrcode.min.js',
dataType: 'script',
cache: true,
success: function () {
$qrCode.qrcode({
width: 111,
height: 111,
text: shareURL,
})
},
})
} else {
$qrCode.find('canvas').slideToggle()
}
return false
}
window.open(urls[key], '_blank', 'top=100,left=200,width=648,height=618')
})
},
/*
* @description 加载随机文章
*/
loadRandomArticles: function() {
// getRandomArticles
$.ajax({
url: Label.servePath + "/articles/random",
type: "POST",
success: function(result, textStatus) {
var randomArticles = result.randomArticles;
if (!randomArticles || 0 === randomArticles.length) {
$("#randomArticles").remove();
return;
}
var listHtml = "";
for (var i = 0; i < randomArticles.length && i < 5; i++) {
var article = randomArticles[i];
var title = article.articleTitle;
var randomArticleLiHtml = "<li>" + "<a rel='nofollow' title='" + title + "' href='" + Label.servePath +
article.articlePermalink + "'>" + title + "</a></li>";
listHtml += randomArticleLiHtml;
}
var randomArticleListHtml = "<ul>" + listHtml + "</ul>";
$("#randomArticles .text").append(randomArticleListHtml);
}
});
},
/*
* @description 加载相关文章
* @param {String} id 文章 id
*/
loadRelevantArticles: function(id) {
$.ajax({
url: Label.servePath + "/article/id/" + id + "/relevant/articles",
type: "GET",
success: function(data, textStatus) {
var articles = data.relevantArticles;
if (!articles || 0 === articles.length) {
$("#relevantArticles").remove();
return;
}
var listHtml = "";
for (var i = 0; i < articles.length && i < 5; i++) {
var article = articles[i];
var title = article.articleTitle;
var articleLiHtml = "<li>"
+ "<a rel='nofollow' title='" + title + "' href='"
+ Label.servePath + article.articlePermalink + "'>"
+ title + "</a></li>";
listHtml += articleLiHtml;
}
var relevantArticleListHtml = "<ul>"
+ listHtml + "</ul>";
$("#relevantArticles .text").append(relevantArticleListHtml);
},
error: function() {
$("#relevantArticles").remove();
}
});
},
/*
* @description 加载站外相关文章
* @param {String} tags 文章 tags
*/
loadExternalRelevantArticles: function(tags) {
var tips = this.tips;
try {
$.ajax({
url: "http://rhythm.b3log.org:80/get-articles-by-tags.do?tags=" + tags
+ "&blogHost=" + tips.blogHost + "&paginationPageSize=" + tips.externalRelevantArticlesDisplayCount,
type: "GET",
cache: true,
dataType: "jsonp",
error: function() {
$("#externalRelevantArticles").remove();
},
success: function(data, textStatus) {
var articles = data.articles;
if (!articles || 0 === articles.length) {
$("#externalRelevantArticles").remove();
return;
}
var listHtml = "";
for (var i = 0; i < articles.length && i < 5; i++) {
var article = articles[i];
var title = article.articleTitle;
var articleLiHtml = "<li>"
+ "<a rel='nofollow' title='" + title + "' target='_blank' href='" + article.articlePermalink + "'>"
+ title + "</a></li>";
listHtml += articleLiHtml;
}
var randomArticleListHtml = "<ul>" + listHtml + "</ul>";
$("#externalRelevantArticles .text").append(randomArticleListHtml);
}
});
} catch (e) {
// 忽略相关文章加载异常:load script error
$("#externalRelevantArticles").remove();
}
},
goCmt: function() {
$("html, body").animate({
scrollTop: $(".comment-disabled").get(0).offsetTop
});
}
};
(function() {
MetroHot.init();
if ($(".article-header").length > 0) {
MetroHot.share();
}
})();
/*
* Solo - A small and beautiful blogging system written in Java.
* Copyright (c) 2010-present, b3log.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* @fileoverview metro-hot js.
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @version 1.1.0.0, Feb 27, 2019
*/
var MetroHot = {
headerH: $("#header").height() + 30 + ($("#header > div").get(1) ? 30 : 0),
responsiveType: "large",
goTranslate: function() {
window.open("http://translate.google.com/translate?sl=auto&tl=auto&u=" + location.href);
},
init: function() {
// logout
var logoutHref = "";
$("#admin a").each(function() {
if ($(this).attr("href").indexOf("/logout") > -1) {
logoutHref = $(this).attr("href");
}
});
$("#logout, .logout").attr("href", logoutHref);
// 头部标题点击事件
$(".header .title, .navigation").mouseover(function() {
$(".navigation").show();
}).mouseout(function() {
$(".navigation").hide();
});
$(".header .title").click(function() {
window.location.href = Label.servePath;
});
if ($("#dynamic").length === 1) {
// 滚动处理
$(window).scroll(function() {
var y = $(window).scrollTop();
if (y > MetroHot.headerH) {
$("#goTop").fadeIn("slow");
} else {
$("#goTop").hide();
}
}).click(function(event) {
if (event.target.className === "title" || event.target.parentElement.className === "title") {
return;
}
$(".navigation").slideUp();
});
$("body").css("min-height", "inherit");
return;
}
// 滚动处理
$(window).scroll(function() {
var y = $(window).scrollTop();
if (y > MetroHot.headerH) {
$("#goTop").fadeIn("slow");
} else {
$("#goTop").hide();
}
}).click(function(event) {
if (event.target.className === "title" || event.target.parentElement.className === "title") {
return;
}
$(".navigation").slideUp();
}).resize(function() {
var windowW = window.innerWidth,
type = "large";
if (windowW > 460 && windowW <= 860) {
type = "mid";
} else if (window < 460) {
type = "small";
}
if (MetroHot.responsiveType !== type) {
$(window).scroll();
MetroHot.responsiveType === type;
}
});
$(window).scroll();
},
/**
* @description 计算图片 margin-top
* @param {BOM} it 图片元素
*/
loadImg: function(it) {
it.style.marginTop = ("margin-top", (220 - it.height) / 2 + "px");
},
/**
* @description 分享按钮
*/
share: function() {
var $this = $('.share .text')
var $qrCode = $this.find('.icon-wechat')
var shareURL = $qrCode.data('url')
var avatarURL = $qrCode.data('avatar')
var title = encodeURIComponent($qrCode.data('title') + ' - ' +
$qrCode.data('blogtitle')),
url = encodeURIComponent(shareURL)
var urls = {}
urls.weibo = 'http://v.t.sina.com.cn/share/share.php?title=' +
title + '&url=' + url + '&pic=' + avatarURL
urls.qqz = 'https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='
+ url + '&sharesource=qzone&title=' + title + '&pics=' + avatarURL
urls.twitter = 'https://twitter.com/intent/tweet?status=' + title + ' ' +
url
$this.find('span').click(function () {
var key = $(this).data('type')
if (!key) {
return
}
if (key === 'wechat') {
if ($qrCode.find('canvas').length === 0) {
$.ajax({
method: 'GET',
url: Label.staticServePath +
'/js/lib/jquery.qrcode.min.js',
dataType: 'script',
cache: true,
success: function () {
$qrCode.qrcode({
width: 111,
height: 111,
text: shareURL,
})
},
})
} else {
$qrCode.find('canvas').slideToggle()
}
return false
}
window.open(urls[key], '_blank', 'top=100,left=200,width=648,height=618')
})
},
/*
* @description 加载随机文章
*/
loadRandomArticles: function() {
// getRandomArticles
$.ajax({
url: Label.servePath + "/articles/random",
type: "POST",
success: function(result, textStatus) {
var randomArticles = result.randomArticles;
if (!randomArticles || 0 === randomArticles.length) {
$("#randomArticles").remove();
return;
}
var listHtml = "";
for (var i = 0; i < randomArticles.length && i < 5; i++) {
var article = randomArticles[i];
var title = article.articleTitle;
var randomArticleLiHtml = "<li>" + "<a rel='nofollow' title='" + title + "' href='" + Label.servePath +
article.articlePermalink + "'>" + title + "</a></li>";
listHtml += randomArticleLiHtml;
}
var randomArticleListHtml = "<ul>" + listHtml + "</ul>";
$("#randomArticles .text").append(randomArticleListHtml);
}
});
},
/*
* @description 加载相关文章
* @param {String} id 文章 id
*/
loadRelevantArticles: function(id) {
$.ajax({
url: Label.servePath + "/article/id/" + id + "/relevant/articles",
type: "GET",
success: function(data, textStatus) {
var articles = data.relevantArticles;
if (!articles || 0 === articles.length) {
$("#relevantArticles").remove();
return;
}
var listHtml = "";
for (var i = 0; i < articles.length && i < 5; i++) {
var article = articles[i];
var title = article.articleTitle;
var articleLiHtml = "<li>"
+ "<a rel='nofollow' title='" + title + "' href='"
+ Label.servePath + article.articlePermalink + "'>"
+ title + "</a></li>";
listHtml += articleLiHtml;
}
var relevantArticleListHtml = "<ul>"
+ listHtml + "</ul>";
$("#relevantArticles .text").append(relevantArticleListHtml);
},
error: function() {
$("#relevantArticles").remove();
}
});
},
/*
* @description 加载站外相关文章
* @param {String} tags 文章 tags
*/
loadExternalRelevantArticles: function(tags) {
var tips = this.tips;
try {
$.ajax({
url: "http://rhythm.b3log.org:80/get-articles-by-tags.do?tags=" + tags
+ "&blogHost=" + tips.blogHost + "&paginationPageSize=" + tips.externalRelevantArticlesDisplayCount,
type: "GET",
cache: true,
dataType: "jsonp",
error: function() {
$("#externalRelevantArticles").remove();
},
success: function(data, textStatus) {
var articles = data.articles;
if (!articles || 0 === articles.length) {
$("#externalRelevantArticles").remove();
return;
}
var listHtml = "";
for (var i = 0; i < articles.length && i < 5; i++) {
var article = articles[i];
var title = article.articleTitle;
var articleLiHtml = "<li>"
+ "<a rel='nofollow' title='" + title + "' target='_blank' href='" + article.articlePermalink + "'>"
+ title + "</a></li>";
listHtml += articleLiHtml;
}
var randomArticleListHtml = "<ul>" + listHtml + "</ul>";
$("#externalRelevantArticles .text").append(randomArticleListHtml);
}
});
} catch (e) {
// 忽略相关文章加载异常:load script error
$("#externalRelevantArticles").remove();
}
},
goCmt: function() {
$("html, body").animate({
scrollTop: $(".comment-disabled").get(0).offsetTop
});
}
};
(function() {
MetroHot.init();
if ($(".article-header").length > 0) {
MetroHot.share();
}
})();
...@@ -46,4 +46,4 @@ ...@@ -46,4 +46,4 @@
</#if> </#if>
<span id="goTop" onclick="Util.goTop();" data-ico="&#xe042;" class="side-tile"></span> <span id="goTop" onclick="Util.goTop();" data-ico="&#xe042;" class="side-tile"></span>
<span id="goCmt" onclick="MetroHot.goCmt();" data-ico="&#x005b;" class="side-tile"></span> <span id="goCmt" onclick="MetroHot.goCmt();" data-ico="&#x005b;" class="side-tile"></span>
</#macro> </#macro>
\ No newline at end of file
...@@ -43,13 +43,8 @@ ...@@ -43,13 +43,8 @@
</footer> </footer>
<div class="back-to-top" onclick="Util.goTop()"></div> <div class="back-to-top" onclick="Util.goTop()"></div>
<script type="text/javascript" src="${staticServePath}/js/lib/jquery/jquery.min.js" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}"
charset="utf-8"></script>
<script type="text/javascript"
src="${staticServePath}/skins/${skinDirName}/js/${skinDirName}${miniPostfix}.js?${staticResourceVersion}"
charset="utf-8"></script>
<#include "../../common-template/label.ftl"> <#include "../../common-template/label.ftl">
<script src="${staticServePath}/skins/${skinDirName}/js/common.min.js?${staticResourceVersion}"></script>
<script type="text/javascript"> <script type="text/javascript">
Label.tocLabel = "${tocLabel}" Label.tocLabel = "${tocLabel}"
Label.siteViewLabel = "${siteViewLabel}" Label.siteViewLabel = "${siteViewLabel}"
......
...@@ -135,4 +135,4 @@ var NexT = { ...@@ -135,4 +135,4 @@ var NexT = {
$(window).scroll(); $(window).scroll();
} }
}; };
NexT.init(); NexT.init();
\ No newline at end of file
...@@ -34,8 +34,6 @@ ...@@ -34,8 +34,6 @@
</footer> </footer>
<div class="icon-up" onclick="Util.goTop()"></div> <div class="icon-up" onclick="Util.goTop()"></div>
<script type="text/javascript" src="${staticServePath}/js/lib/compress/pjax.min.js" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
<#include "../../common-template/label.ftl"> <#include "../../common-template/label.ftl">
<script type="text/javascript" src="${staticServePath}/skins/${skinDirName}/js/common${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script> <script type="text/javascript" src="${staticServePath}/skins/${skinDirName}/js/common.min.js?${staticResourceVersion}" charset="utf-8"></script>
${plugins} ${plugins}
...@@ -23,9 +23,8 @@ ...@@ -23,9 +23,8 @@
Theme ${skinDirName} by <a href="http://vanessa.b3log.org" target="_blank">Vanessa</a>. Theme ${skinDirName} by <a href="http://vanessa.b3log.org" target="_blank">Vanessa</a>.
<div onclick="Util.goTop();">${goTopLabel}</div> <div onclick="Util.goTop();">${goTopLabel}</div>
</footer> </footer>
<script type="text/javascript" src="${staticServePath}/js/lib/jquery/jquery.min.js" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
<#include "../../common-template/label.ftl"> <#include "../../common-template/label.ftl">
<script type="text/javascript" src="${staticServePath}/js/common.min.js?${staticResourceVersion}" charset="utf-8"></script>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function () { $(document).ready(function () {
Util.setTopBar() Util.setTopBar()
......
...@@ -48,10 +48,8 @@ ...@@ -48,10 +48,8 @@
</div> </div>
</div> </div>
<div class="ico-top none" onclick="Util.goTop()" title="TOP"></div> <div class="ico-top none" onclick="Util.goTop()" title="TOP"></div>
<script type="text/javascript" src="${staticServePath}/js/lib/jquery/jquery.min.js" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/skins/${skinDirName}/js/${skinDirName}${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
<#include "../../common-template/label.ftl"> <#include "../../common-template/label.ftl">
<script src="${staticServePath}/skins/${skinDirName}/js/common.min.js?${staticResourceVersion}"></script>
<script type="text/javascript"> <script type="text/javascript">
Label.localeString = "${localeString}" Label.localeString = "${localeString}"
Label.yearLabel = "${yearLabel}" Label.yearLabel = "${yearLabel}"
......
This diff is collapsed.
This diff is collapsed.
...@@ -23,9 +23,8 @@ Theme ${skinDirName} ...@@ -23,9 +23,8 @@ Theme ${skinDirName}
by <a rel="friend" href="http://vanessa.b3log.org" target="_blank">Vanessa</a>. by <a rel="friend" href="http://vanessa.b3log.org" target="_blank">Vanessa</a>.
<div class='goTopIcon' onclick='Util.goTop();'></div> <div class='goTopIcon' onclick='Util.goTop();'></div>
<div class='goBottomIcon' onclick='Util.goBottom();'></div> <div class='goBottomIcon' onclick='Util.goBottom();'></div>
<script type="text/javascript" src="${staticServePath}/js/lib/jquery/jquery.min.js" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
<#include "../../common-template/label.ftl"> <#include "../../common-template/label.ftl">
<script type="text/javascript" src="${staticServePath}/js/common.min.js?${staticResourceVersion}" charset="utf-8"></script>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function () { $(document).ready(function () {
Util.setTopBar() Util.setTopBar()
......
...@@ -43,10 +43,6 @@ ...@@ -43,10 +43,6 @@
</div> </div>
<span onclick="Util.goTop()" class="icon-goup"></span> <span onclick="Util.goTop()" class="icon-goup"></span>
</footer> </footer>
<script type="text/javascript" src="${staticServePath}/js/lib/jquery/jquery.min.js" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/skins/${skinDirName}/js/${skinDirName}${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
<#include "../../common-template/label.ftl"> <#include "../../common-template/label.ftl">
<script src="${staticServePath}/skins/${skinDirName}/js/common.min.js?${staticResourceVersion}"></script>
${plugins} ${plugins}
/*
* Solo - A small and beautiful blogging system written in Java.
* Copyright (c) 2010-present, b3log.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* @fileoverview util and every page should be used.
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @version 1.3.0.0, Feb 27, 2019
*/
/**
* @description yilia 皮肤脚本
* @static
*/
var Yilia = {
/**
* @description 页面初始化
*/
init: function () {
Util.killIE();
this._initToc();
this.resetTags();
$(window).scroll(function () {
if ($("article").length > 0 && $("article.post").length === 0) {
$("article:not(.show)").each(function () {
if ($(this).offset().top <= $(window).scrollTop() + $(window).height() - $(this).height() / 7) {
$(this).addClass("show");
}
});
}
if ($(window).scrollTop() > $(window).height()) {
$(".icon-goup").show();
} else {
$(".icon-goup").hide();
}
if ($("article.post").length === 1) {
$("article.post").addClass('show');
}
});
$(window).scroll();
},
_initToc: function () {
if ($('.article__toc li').length === 0) {
return false;
}
$('.side .toc-btn').show();
},
resetTags: function () {
$("a.tag").each(function (i) {
$(this).addClass("color" + Math.ceil(Math.random() * 4));
});
},
share: function () {
var $this = $('.share .fn-right')
var $qrCode = $this.find('.icon-wechat')
var shareURL = $qrCode.data('url')
var avatarURL = $qrCode.data('avatar')
var title = encodeURIComponent($qrCode.data('title') + ' - ' +
$qrCode.data('blogtitle')),
url = encodeURIComponent(shareURL)
var urls = {}
urls.weibo = 'http://v.t.sina.com.cn/share/share.php?title=' +
title + '&url=' + url + '&pic=' + avatarURL
urls.qqz = 'https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='
+ url + '&sharesource=qzone&title=' + title + '&pics=' + avatarURL
urls.twitter = 'https://twitter.com/intent/tweet?status=' + title + ' ' +
url
$this.find('span').click(function () {
var key = $(this).data('type')
if (!key) {
return
}
if (key === 'wechat') {
if ($qrCode.find('canvas').length === 0) {
$.ajax({
method: 'GET',
url: Label.staticServePath +
'/js/lib/jquery.qrcode.min.js',
dataType: 'script',
cache: true,
success: function () {
$qrCode.qrcode({
width: 128,
height: 128,
text: shareURL,
})
},
})
} else {
$qrCode.find('canvas').slideToggle()
}
return false
}
window.open(urls[key], '_blank', 'top=100,left=200,width=648,height=618')
})
}
};
Yilia.init();
/*
* Solo - A small and beautiful blogging system written in Java.
* Copyright (c) 2010-present, b3log.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* @fileoverview util and every page should be used.
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @version 1.3.0.0, Feb 27, 2019
*/
/**
* @description yilia 皮肤脚本
* @static
*/
var Yilia = {
/**
* @description 页面初始化
*/
init: function () {
Util.killIE();
this._initToc();
this.resetTags();
$(window).scroll(function () {
if ($("article").length > 0 && $("article.post").length === 0) {
$("article:not(.show)").each(function () {
if ($(this).offset().top <= $(window).scrollTop() + $(window).height() - $(this).height() / 7) {
$(this).addClass("show");
}
});
}
if ($(window).scrollTop() > $(window).height()) {
$(".icon-goup").show();
} else {
$(".icon-goup").hide();
}
if ($("article.post").length === 1) {
$("article.post").addClass('show');
}
});
$(window).scroll();
},
_initToc: function () {
if ($('.article__toc li').length === 0) {
return false;
}
$('.side .toc-btn').show();
},
resetTags: function () {
$("a.tag").each(function (i) {
$(this).addClass("color" + Math.ceil(Math.random() * 4));
});
},
share: function () {
var $this = $('.share .fn-right')
var $qrCode = $this.find('.icon-wechat')
var shareURL = $qrCode.data('url')
var avatarURL = $qrCode.data('avatar')
var title = encodeURIComponent($qrCode.data('title') + ' - ' +
$qrCode.data('blogtitle')),
url = encodeURIComponent(shareURL)
var urls = {}
urls.weibo = 'http://v.t.sina.com.cn/share/share.php?title=' +
title + '&url=' + url + '&pic=' + avatarURL
urls.qqz = 'https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='
+ url + '&sharesource=qzone&title=' + title + '&pics=' + avatarURL
urls.twitter = 'https://twitter.com/intent/tweet?status=' + title + ' ' +
url
$this.find('span').click(function () {
var key = $(this).data('type')
if (!key) {
return
}
if (key === 'wechat') {
if ($qrCode.find('canvas').length === 0) {
$.ajax({
method: 'GET',
url: Label.staticServePath +
'/js/lib/jquery.qrcode.min.js',
dataType: 'script',
cache: true,
success: function () {
$qrCode.qrcode({
width: 128,
height: 128,
text: shareURL,
})
},
})
} else {
$qrCode.find('canvas').slideToggle()
}
return false
}
window.open(urls[key], '_blank', 'top=100,left=200,width=648,height=618')
})
}
};
Yilia.init();
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment