From 8726cb3361eccf36a30fcbc47b41e93e763e3e42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BB=93=E5=8F=91=E5=8F=97=E9=95=BF=E7=94=9F?= Date: Sun, 27 May 2018 21:05:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9C=8B=E6=9D=BF=E5=A8=98=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layout/_partial/post/category.ejs | 4 ---- .../layout/_partial/post/gallery.ejs | 4 ---- themes/hexo-theme-xups/source/js/banner-girl.js | 10 +++++++--- themes/hexo-theme-xups/source/js/main.js | 15 +++++++-------- 4 files changed, 14 insertions(+), 19 deletions(-) delete mode 100644 themes/hexo-theme-xups/layout/_partial/post/category.ejs delete mode 100644 themes/hexo-theme-xups/layout/_partial/post/gallery.ejs diff --git a/themes/hexo-theme-xups/layout/_partial/post/category.ejs b/themes/hexo-theme-xups/layout/_partial/post/category.ejs deleted file mode 100644 index fb72431..0000000 --- a/themes/hexo-theme-xups/layout/_partial/post/category.ejs +++ /dev/null @@ -1,4 +0,0 @@ - -<% if (post.categories && post.categories.length) { %> - -<% } %> \ No newline at end of file diff --git a/themes/hexo-theme-xups/layout/_partial/post/gallery.ejs b/themes/hexo-theme-xups/layout/_partial/post/gallery.ejs deleted file mode 100644 index c526461..0000000 --- a/themes/hexo-theme-xups/layout/_partial/post/gallery.ejs +++ /dev/null @@ -1,4 +0,0 @@ -<% if (post.photos && post.photos.length) { %> - - -<% } %> \ No newline at end of file diff --git a/themes/hexo-theme-xups/source/js/banner-girl.js b/themes/hexo-theme-xups/source/js/banner-girl.js index 020aba0..fc0c58e 100644 --- a/themes/hexo-theme-xups/source/js/banner-girl.js +++ b/themes/hexo-theme-xups/source/js/banner-girl.js @@ -39,7 +39,7 @@ var tipTimer = undefined; /** * 显示消息 * @param {Object} text 消息内容(如果是数组则显示其中的随机一个元素) - * @param {Numer} timeout 消失的延迟时间 + * @param {Number} timeout 消失的延迟时间 */ function showMessage(text, timeout){ if(tipTimer) { @@ -60,7 +60,11 @@ function hideMessage(timeout){ tips.style.opacity = 0; }, timeout || 5000); } -var text; +var text, productHref = [ + 'https://www.colorfulsweet.site/', + 'https://sookie2010.coding.me/', + 'https://sookie2010.github.io/' + ]; if(document.referrer){ var referrer = document.createElement('a'); referrer.href = document.referrer; @@ -74,7 +78,7 @@ if(document.referrer){ text = 'Hello! 来自 谷歌搜索 的朋友
欢迎阅读『' + document.title.split(' - ')[0] + '』'; } }else { - if (window.location.href == 'https://www.colorfulsweet.site/') { //如果是主页 + if (productHref.indexOf(window.location.href) !== -1) { //如果是主页 var now = new Date().getHours(); if (now > 23 || now <= 5) { text = '你是夜猫子呀?这么晚还不睡觉,明天起的来吗'; diff --git a/themes/hexo-theme-xups/source/js/main.js b/themes/hexo-theme-xups/source/js/main.js index 7531279..fd0f4a7 100644 --- a/themes/hexo-theme-xups/source/js/main.js +++ b/themes/hexo-theme-xups/source/js/main.js @@ -15,7 +15,7 @@ require.config({ } }); require(['polyfill', 'local-search']); -require(['echo', 'bannerGirl'],function(echo, bannerGirl){ +require(['echo'],function(echo, bannerGirl){ function deepCopy(c, p) {  var c = c || {};  for (var i in p) { @@ -28,7 +28,6 @@ require(['echo', 'bannerGirl'],function(echo, bannerGirl){  }  return c; } - (function(){ var JELON = window.JELON || {}; JELON = deepCopy(JELON, { name: 'JELON', @@ -58,7 +57,6 @@ require(['echo', 'bannerGirl'],function(echo, bannerGirl){ } else { $menu.className = $menu.className.replace(/\s*hidden\s*/, ''); } - }; }, backToTop: function() { @@ -90,9 +88,10 @@ require(['echo', 'bannerGirl'],function(echo, bannerGirl){ */ JELON.init(); window.JELON = JELON; - })(); - // 在PC端加载看板娘 - if(!/Android|webOS|iPhone|iPad|BlackBerry/i.test(navigator.userAgent)) { +}); +if(!/Android|webOS|iPhone|iPad|BlackBerry/i.test(navigator.userAgent)) { + // 只在PC端加载看板娘 + require(['bannerGirl'], function(bannerGirl){ bannerGirl.init('/resource/model.json'); - } -}); \ No newline at end of file + }); +} \ No newline at end of file