兼容性调整
This commit is contained in:
parent
e7c6945df4
commit
9fa331206c
@ -11,9 +11,6 @@
|
||||
<div class="article-entry" itemprop="articleBody">
|
||||
<% if (post.excerpt && index){ %>
|
||||
<%- post.excerpt %>
|
||||
<% if (theme.excerpt_link) { %>
|
||||
<a class="article-more-a" href="<%- url_for(post.path) %>#more"><%= theme.excerpt_link %> >></a>
|
||||
<% } %>
|
||||
<% } else { %>
|
||||
<%- post.content %>
|
||||
<% } %>
|
||||
@ -78,24 +75,7 @@
|
||||
<% } %>
|
||||
<%- partial('_partial/aside') %>
|
||||
|
||||
|
||||
<% if (!index && post.comments){ %>
|
||||
<% if (theme.duoshuo){ %>
|
||||
<%- partial('post/duoshuo', {
|
||||
key: post.slug,
|
||||
title: post.title,
|
||||
url: config.url+url_for(post.path)
|
||||
}) %>
|
||||
<% } %>
|
||||
|
||||
<% if (theme.wangyiyun){ %>
|
||||
<%- partial('post/wangyiyun', {
|
||||
key: post.slug,
|
||||
title: post.title,
|
||||
url: config.url+url_for(post.path)
|
||||
}) %>
|
||||
<% } %>
|
||||
|
||||
<% if (theme.changyan_appid && theme.changyan_conf){ %>
|
||||
<%- partial('post/changyan', {
|
||||
key: post.slug,
|
||||
|
||||
@ -15,12 +15,8 @@
|
||||
<% if (theme.subtitle){ %>
|
||||
<p class="header-subtitle"><i class="icon icon-quo-left"></i><%=theme.subtitle%><i class="icon icon-quo-right"></i></p>
|
||||
<% } %>
|
||||
<% var count = 0%>
|
||||
<% for (var i in theme.menu){ %>
|
||||
<% count++ %>
|
||||
<% } %>
|
||||
<% var ulWidth = count > 2 ? '70%' : '50%' %>
|
||||
|
||||
<% var count = Object.keys(theme.menu).length
|
||||
var ulWidth = count > 2 ? '70%' : '50%' %>
|
||||
<nav class="header-nav">
|
||||
<div class="social">
|
||||
<% for (var i in theme.subnav){ %>
|
||||
|
||||
@ -1,10 +0,0 @@
|
||||
<div id="cloud-tie-wrapper" class="cloud-tie-wrapper"></div>
|
||||
<script>
|
||||
var cloudTieConfig = {
|
||||
url: "<%=url%>",
|
||||
sourceId: "<%=key%>",
|
||||
productKey: "<%=theme.wangyiyun%>",
|
||||
target: "cloud-tie-wrapper"
|
||||
};
|
||||
</script>
|
||||
<script src="//img1.cache.netease.com/f2e/tie/yun/sdk/loader.js"></script>
|
||||
@ -1 +1 @@
|
||||
<%- js('js/mobile.04379a910e1ff32f2a41.js') %> <%- js('js/slider.a725c75e59c2eeae98e0.js') %> <%- js('js/main.254cebd259c4777bdd2e.js') %>
|
||||
<%- js('js/mobile.ea63a7925e7ff5c87e64.js') %> <%- js('js/slider.6142a9af4c6883a7d429.js') %> <%- js('js/main.361198a3fa95601c34df.js') %>
|
||||
@ -121,7 +121,7 @@
|
||||
<%if(hasAboutme){%>
|
||||
<section class="tools-section tools-section-me" v-show="aboutme">
|
||||
<%if(theme.aboutme){%>
|
||||
<div class="aboutme-wrap" id="js-aboutme"><%=theme.aboutme%></div>
|
||||
<div class="aboutme-wrap" id="js-aboutme"><%-theme.aboutme%></div>
|
||||
<%}%>
|
||||
</section>
|
||||
<%}%>
|
||||
|
||||
@ -89,7 +89,4 @@ function init() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module.exports = {
|
||||
init: init
|
||||
}
|
||||
export default { init }
|
||||
@ -1,4 +1,4 @@
|
||||
var browser = {
|
||||
export default {
|
||||
versions: function() {
|
||||
var u = window.navigator.userAgent;
|
||||
return {
|
||||
@ -16,5 +16,3 @@ var browser = {
|
||||
};
|
||||
}()
|
||||
}
|
||||
|
||||
module.exports = browser
|
||||
@ -21,19 +21,10 @@ function init() {
|
||||
// 目录序号
|
||||
if (yiliaConfig && yiliaConfig.toc_hide_index) {
|
||||
let $a = document.querySelectorAll(('.toc-number'))
|
||||
$a.forEach(($em) => {
|
||||
Array.prototype.forEach.call($a, function($em){
|
||||
$em.style.display = 'none';
|
||||
})
|
||||
}
|
||||
|
||||
// about me 转义
|
||||
var $aboutme = document.querySelector('#js-aboutme')
|
||||
if ($aboutme && $aboutme.length !== 0) {
|
||||
$aboutme.innerHTML = $aboutme.innerText
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
init: init
|
||||
}
|
||||
export default { init }
|
||||
@ -1,7 +1,5 @@
|
||||
// 样式
|
||||
import '../css/main.scss'
|
||||
// 上报
|
||||
// import './report'
|
||||
// 图片查看器
|
||||
import Viewer from './viewer'
|
||||
// 分享
|
||||
@ -9,9 +7,9 @@ import Share from './share'
|
||||
// 边缘
|
||||
import Aside from './aside'
|
||||
|
||||
import {addLoadEvent} from './util'
|
||||
import Util from './util'
|
||||
|
||||
addLoadEvent(function() {
|
||||
Util.addLoadEvent(function() {
|
||||
Share.init()
|
||||
Viewer.init()
|
||||
Aside.init()
|
||||
|
||||
@ -6,7 +6,7 @@ import Browser from './browser'
|
||||
// fix hexo 不支持的配置
|
||||
import Fix from './fix'
|
||||
|
||||
import {addLoadEvent} from './util'
|
||||
import Util from './util'
|
||||
|
||||
function isPathMatch(path, href) {
|
||||
let reg = /\/|index.html/g
|
||||
@ -16,13 +16,11 @@ function isPathMatch(path, href) {
|
||||
function tabActive() {
|
||||
let $tabs = document.querySelectorAll('.js-header-menu li a')
|
||||
let path = window.location.pathname
|
||||
|
||||
for (var i = 0, len = $tabs.length; i < len; i++) {
|
||||
let $tab = $tabs[i]
|
||||
Array.prototype.forEach.call($tabs, function($tab, i){
|
||||
if (isPathMatch(path, $tab.getAttribute('href'))) {
|
||||
addClass($tab, 'active')
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function getElementLeft(element) {
|
||||
@ -99,6 +97,6 @@ function init() {
|
||||
|
||||
init();
|
||||
|
||||
addLoadEvent(function() {
|
||||
Util.addLoadEvent(function() {
|
||||
Fix.init()
|
||||
})
|
||||
@ -57,8 +57,7 @@ let init = function() {
|
||||
if ((sPic !== '') && !/^(http:|https:)?\/\//.test(sPic)) {
|
||||
sPic = window.location.origin + sPic
|
||||
}
|
||||
|
||||
$sns.forEach(($em) => {
|
||||
Array.prototype.forEach.call($sns, ($em) => {
|
||||
$em.onclick = (e) => {
|
||||
let type = $em.getAttribute('data-type')
|
||||
handleClick(type, {
|
||||
@ -69,11 +68,8 @@ let init = function() {
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
document.querySelector('.mask').onclick = hideWX
|
||||
document.querySelector('.js-modal-close').onclick = hideWX
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
init: init
|
||||
}
|
||||
export default { init }
|
||||
@ -15,7 +15,7 @@ function fixzero(str) {
|
||||
|
||||
function setScrollZero() {
|
||||
let $sct = document.querySelectorAll('.tools-section')
|
||||
$sct.forEach((em) => {
|
||||
Array.prototype.forEach.call($sct, (em) => {
|
||||
em.scrollTop = 0
|
||||
})
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
var e = function() {
|
||||
const Util = (function(){
|
||||
function r(e, r, n) {
|
||||
return r || n ? String.fromCharCode(r || n) : u[e] || e
|
||||
}
|
||||
@ -74,7 +74,7 @@ var e = function() {
|
||||
},
|
||||
addLoadEvent: function(func){
|
||||
var oldonload = window.onload;
|
||||
if (typeof window.onload!="function") {
|
||||
if (typeof window.onload !== "function") {
|
||||
window.onload = func;
|
||||
} else {
|
||||
window.onload = function() {
|
||||
@ -84,6 +84,6 @@ var e = function() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}();
|
||||
})();
|
||||
|
||||
module.exports = e
|
||||
export default Util
|
||||
@ -10,14 +10,12 @@ window.PhotoSwipeUI_Default = PhotoSwipeUI_Default
|
||||
function init() {
|
||||
let pswpElement = document.querySelectorAll('.pswp')[0];
|
||||
let $imgArr = document.querySelectorAll(('.article-entry img:not(.reward-img)'))
|
||||
|
||||
$imgArr.forEach(($em, i) => {
|
||||
Array.prototype.forEach.call($imgArr, ($em, i) => {
|
||||
$em.onclick = () => {
|
||||
// slider展开状态
|
||||
// todo: 这样不好,后面改成状态
|
||||
if (document.querySelector('.left-col.show')) return
|
||||
let items = []
|
||||
$imgArr.forEach(($em2, i2) => {
|
||||
Array.prototype.forEach.call($imgArr, ($em2, i2) => {
|
||||
let img = $em2.getAttribute('data-idx', i2)
|
||||
let src = $em2.getAttribute('data-target') || $em2.getAttribute('src')
|
||||
let title = $em2.getAttribute('alt')
|
||||
@ -40,6 +38,4 @@ function init() {
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
init: init
|
||||
}
|
||||
export default { init }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user