From 501ce9a842b1ae344dd98bc6d24659018aaf9571 Mon Sep 17 00:00:00 2001
From: shenyu <448766534@qq.com>
Date: Thu, 11 Mar 2021 14:12:21 +0800
Subject: [PATCH] :bug: fix: share
---
source-src/js/share.js | 7 +++----
source/dist/main.js | 2 +-
source/dist/report.html | 2 +-
3 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/source-src/js/share.js b/source-src/js/share.js
index 16a72b0..64e1a42 100644
--- a/source-src/js/share.js
+++ b/source-src/js/share.js
@@ -1,10 +1,9 @@
function generate(url, opts) {
var url = url.replace(/<%-sUrl%>/g, encodeURIComponent(opts.sUrl))
- .replace(/<%-sTitle%>/g, opts.sTitle)
- .replace(/<%-sDesc%>/g, opts.sDesc)
+ .replace(/<%-sTitle%>/g, encodeURIComponent(opts.sTitle))
+ .replace(/<%-sDesc%>/g, encodeURIComponent(opts.sDesc))
.replace(/<%-sPic%>/g, encodeURIComponent(opts.sPic));
-
window.open(url);
}
@@ -30,7 +29,7 @@ function handleClick(type, opts) {
} else if (type === 'facebook') {
generate('https://www.facebook.com/sharer/sharer.php?u=<%-sUrl%>', opts)
} else if (type === 'twitter') {
- generate('https://twitter.com/intent/tweet?text=<%-sTitle%>&url=<%-sUrl%>&via=<%-config.url%>', opts)
+ generate('https://twitter.com/intent/tweet?text=<%-sTitle%>&url=<%-sUrl%>', opts)
} else if (type === 'google') {
generate('https://plus.google.com/share?url=<%-sUrl%>', opts)
} else if (type === 'weixin') {
diff --git a/source/dist/main.js b/source/dist/main.js
index 26e2e15..cf30fc3 100644
--- a/source/dist/main.js
+++ b/source/dist/main.js
@@ -3,7 +3,7 @@ parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcel
},{}],"jSg4":[function(require,module,exports) {
!function(e){var o=e(".search-form-wrap"),a=!1;e(".nav-item-search").click(function(){var s;a||(a=!0,o.addClass("on"),s=function(){e(".local-search-input").focus()},setTimeout(function(){a=!1,s&&s()},200))}),e(document).mouseup(function(a){var s=e(".local-search");s.is(a.target)||0!==s.has(a.target).length||o.removeClass("on")}),e(".local-search").size()&&e.getScript("/js/search.js",function(){searchFunc("/search.xml","local-search-input","local-search-result")});var s;e(".share-outer").click(function(){return e(".share-wrap").fadeToggle()}),e("img.lazy").lazyload({effect:"fadeIn"}),e("#gallery").justifiedGallery({rowHeight:200,margins:5}),e(document).ready(function(e){e(".anchor").click(function(o){o.preventDefault(),e("main").animate({scrollTop:e(".cover").height()},"smooth")})}),(s=e("#totop")).hide(),e(".content").scroll(function(){e(".content").scrollTop()>1e3?e(s).stop().fadeTo(200,.6):e(s).stop().fadeTo(200,0)}),e(s).click(function(){return e(".content").animate({scrollTop:0},1e3),!1});var n=e(".content"),r=e(".sidebar");e(".navbar-toggle").on("click",function(){e(".content,.sidebar").addClass("anim"),n.toggleClass("on"),r.toggleClass("on")}),e("#reward-btn").click(function(){e("#reward").fadeIn(150),e("#mask").fadeIn(150)}),e("#reward .close, #mask").click(function(){e("#mask").fadeOut(100),e("#reward").fadeOut(100)}),1==sessionStorage.getItem("darkmode")?(e("body").addClass("darkmode"),e("#todark i").removeClass("ri-moon-line").addClass("ri-sun-line")):(e("body").removeClass("darkmode"),e("#todark i").removeClass("ri-sun-line").addClass("ri-moon-line")),e("#todark").click(function(){1==sessionStorage.getItem("darkmode")?(e("body").removeClass("darkmode"),e("#todark i").removeClass("ri-sun-line").addClass("ri-moon-line"),sessionStorage.removeItem("darkmode")):(e("body").addClass("darkmode"),e("#todark i").removeClass("ri-moon-line").addClass("ri-sun-line"),sessionStorage.setItem("darkmode",1))});console.log("%c%s%c%s%c%s","background-color: #49b1f5; color: #fff; padding: 8px; font-size: 14px;","主题不错?⭐star 支持一下 ->","background-color: #ffbca2; padding: 8px; font-size: 14px;","https://github.com/Shen-Yu/hexo-theme-ayer","background-color: #eaf8ff;","\n\n _ __ _______ _____ \n / \\ \\ \\ / / ____| _ \\ \n / _ \\ \\ V /| _| | |_) | \n / ___ \\ | | | |___| _ < \n /_/ \\_\\ _| |_____|_| \\__\\ \n"),document.write('