mirror of https://github.com/jkjoy/sunpeiwen.git
501 lines
33 KiB
HTML
501 lines
33 KiB
HTML
|
|
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
|
|
<link rel="icon" href="/img/logo.png">
|
|
|
|
|
|
<meta name="author" content="浪子">
|
|
|
|
|
|
<meta name="subtitle" content="一个分享自己生活的博客">
|
|
|
|
|
|
<meta name="description" content="曾梦想仗剑走天涯;因太胖放弃原计划.">
|
|
|
|
|
|
<meta name="keywords" content=",DIY,黑苹果,分享,自由">
|
|
|
|
|
|
<link rel="alternate" href="/atom.xml " title="提剑追梦" type="application/atom+xml">
|
|
|
|
|
|
|
|
|
|
<title>给Memos添加Twikoo评论 | 提剑追梦</title>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="/css/style.css" >
|
|
<link rel="stylesheet" href="/css/partial/dark.css" >
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="/css/partial/highlight/atom-one-light.css">
|
|
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css">
|
|
|
|
<link rel="stylesheet" href="https://cdnjs.sgcd.net/lxgw-wenkai-screen-webfont/lxgwwenkaigbscreen.css">
|
|
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css">
|
|
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/a2396837/CDN@latest/css/iconfont.css">
|
|
|
|
|
|
|
|
|
|
<script src="/js/todark.js"></script>
|
|
|
|
<meta name="generator" content="Hexo 6.3.0"></head>
|
|
</html>
|
|
|
|
<div class="nav index" style="height: 60px;">
|
|
<div class="title animated fadeInDown">
|
|
<div class="layui-container">
|
|
<div class="nav-title"><a href="/" title="提剑追梦">提剑追梦</a></div>
|
|
<div class="nav-list">
|
|
<button> <span class=""></span><span style="display: block;"></span><span class=""></span> </button>
|
|
<ul class="layui-nav" lay-filter="">
|
|
|
|
|
|
|
|
|
|
|
|
<li class="layui-nav-item">
|
|
<a href="/search/ ">
|
|
<i class=" fas fa-search-plus " style="color: rgb(3 169 244);"></i>
|
|
<span class="layui-nav-item-name">搜索</span>
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="layui-nav-item">
|
|
<a href="/ ">
|
|
<i class=" fab fa-fort-awesome " style="color: rgb(255 107 107);"></i>
|
|
<span class="layui-nav-item-name">首页</span>
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="layui-nav-item">
|
|
<a href="/archives/ ">
|
|
<i class=" fas fa-archive " style="color: rgb(10 189 227);"></i>
|
|
<span class="layui-nav-item-name">归档</span>
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="layui-nav-item">
|
|
<a href="/tags/ ">
|
|
<i class=" fas fa-hashtag " style="color: rgb(254 202 87);"></i>
|
|
<span class="layui-nav-item-name">标签</span>
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="layui-nav-item">
|
|
<a href="/fcircle/ ">
|
|
<i class=" fas fa-heart " style="color: rgb(29 209 161);"></i>
|
|
<span class="layui-nav-item-name">朋友圈</span>
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="layui-nav-item">
|
|
<a href="/links/ ">
|
|
<i class=" fab fa-weixin " style="color: hsl(152deg 73% 45%);"></i>
|
|
<span class="layui-nav-item-name">友链</span>
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="layui-nav-item">
|
|
<a href="/memos/ ">
|
|
<i class=" fas fa-coffee " style="color:#31c7c1;"></i>
|
|
<span class="layui-nav-item-name">说说</span>
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="layui-nav-item">
|
|
<a href="/about/ ">
|
|
<i class=" fab fa-grav " style="color: rgb(154 106 247);"></i>
|
|
<span class="layui-nav-item-name">关于</span>
|
|
</a>
|
|
</li>
|
|
|
|
|
|
<li class="layui-nav-item" id="btn-toggle-dark">🌙</li>
|
|
|
|
<span class="layui-nav-bar" style="left: 342px; top: 78px; width: 0px; opacity: 0;"></span>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<header class="header">
|
|
|
|
<div class="logo">
|
|
<a href="/"><img src="https://img.imsun.org/avatar.jpg" onerror=this.onerror=null,this.src="/img/loading.gif"></a>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="motto">
|
|
<span>曾梦想仗剑走天涯</span>
|
|
</div>
|
|
|
|
|
|
<div class="social">
|
|
|
|
<a class="social-icon" href="https://github.com/jkjoy" target="_blank" title="Github">
|
|
<i class="iconfont icon-GitHub" aria-hidden="true"></i>
|
|
</a>
|
|
|
|
<a class="social-icon" href="mailto:jkjoy@163.com" target="_blank" title="Email">
|
|
<i class="iconfont icon-email" aria-hidden="true"></i>
|
|
</a>
|
|
|
|
<a class="social-icon" href="/atom.xml" target="_blank" title="rss">
|
|
<i class="iconfont icon-rss" aria-hidden="true"></i>
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</header>
|
|
|
|
|
|
<article id="post">
|
|
<div class="post-title">给Memos添加Twikoo评论</div>
|
|
|
|
<div class="post-meta">
|
|
|
|
|
|
<div class="post-meta-item date">
|
|
<span title="发表于 2023.06.13"><i class="far fa-calendar-alt"></i> 2023.06.13</span>
|
|
</div>
|
|
<div class="post-meta-item updated">
|
|
<span title="更新于 2024.05.12"><i class="far fa-calendar-check"></i> 2024.05.12</span>
|
|
</div>
|
|
|
|
|
|
<div class="post-meta-item categories">
|
|
|
|
<i class="fas fa-inbox article-meta__icon"></i> <a href="/categories/%E5%88%86%E4%BA%AB/">分享</a>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="post-meta-item wordcount">
|
|
|
|
<i class="fas fa-pencil-alt"></i> <span class="post-count">1k 字</span>
|
|
|
|
|
|
<i class="far fa-clock"></i> <span class="post-count">5 分钟</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="content">
|
|
<blockquote><h3>自动摘要</h3>
|
|
|
|
...
|
|
</blockquote>
|
|
<div><p>代码来自于@<a target="_blank" rel="noopener" href="https://immmmm.com/memos-with-twikoo/">林木木</a></p>
|
|
<p>2023.10.23更新脚本以适用于memos v0.16.1</p>
|
|
<h2 id="自定义脚本"><a href="#自定义脚本" class="headerlink" title="自定义脚本"></a>自定义脚本</h2><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br></pre></td><td class="code"><pre><span class="line">// Memos v0.16.1 单条页面插入 Twikoo 评论</span><br><span class="line">var twikooENV = 'https://你的.com/'</span><br><span class="line">function addTwikooJS() { </span><br><span class="line"> var memosTwikoo = document.createElement("script");</span><br><span class="line"> memosTwikoo.src = `https://cdn.staticfile.org/twikoo/1.6.22/twikoo.all.min.js`;</span><br><span class="line"> var tws = document.getElementsByTagName("script")[0];</span><br><span class="line"> tws.parentNode.insertBefore(memosTwikoo, tws);</span><br><span class="line">};</span><br><span class="line">function startTwikoo() {</span><br><span class="line"> startTW = setInterval(function(){</span><br><span class="line"> var nowHref = window.location.href;</span><br><span class="line"> var twikooDom = document.querySelector('#twikoo') || '';</span><br><span class="line"> if( nowHref.replace(/^.*\/(m)\/.*$/,'$1') == "m"){</span><br><span class="line"> if(!twikooDom){</span><br><span class="line"> addTwikooJS()</span><br><span class="line"> setTimeout(function() {</span><br><span class="line"> var memoTw = document.querySelector('.gap-2') || '';</span><br><span class="line"> memoTw.insertAdjacentHTML('afterend', '<div id="mtcomment"></div>');</span><br><span class="line"> twikoo.init({</span><br><span class="line"> envId: twikooENV,</span><br><span class="line"> el: '#mtcomment',</span><br><span class="line"> path: nowHref.replace(/^.*=?(http.*\/m\/[0-9]+).*$/,'$1'),</span><br><span class="line"> onCommentLoaded: function () {</span><br><span class="line"> startTwikoo();</span><br><span class="line"> }</span><br><span class="line"> })</span><br><span class="line"> }, 1500)</span><br><span class="line"> }else{</span><br><span class="line"> clearInterval(startTW)</span><br><span class="line"> }</span><br><span class="line"> }</span><br><span class="line"> }, 2000)</span><br><span class="line">}</span><br><span class="line">startTwikoo();</span><br></pre></td></tr></table></figure>
|
|
|
|
<p>2023.10.17更新脚本</p>
|
|
<h2 id="自定义脚本-1"><a href="#自定义脚本-1" class="headerlink" title="自定义脚本"></a>自定义脚本</h2><p>适用于0.16版本</p>
|
|
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br></pre></td><td class="code"><pre><span class="line">//Memos v0.16 添加 Twikoo 评论 v2023.10.06</span><br><span class="line">var twikooENV = '' //你的 https://xxxx/</span><br><span class="line">function addTwikooJS() { </span><br><span class="line"> var memosTwikoo = document.createElement("script");</span><br><span class="line"> memosTwikoo.src = `https://cdn.staticfile.org/twikoo/1.6.22/twikoo.all.min.js`;</span><br><span class="line"> var tws = document.getElementsByTagName("script")[0];</span><br><span class="line"> tws.parentNode.insertBefore(memosTwikoo, tws);</span><br><span class="line">};</span><br><span class="line">function startTwikoo() {</span><br><span class="line"> startTW = setInterval(function(){ //定时执行 1秒/次</span><br><span class="line"> var nowHref = window.location.href;</span><br><span class="line"> var twikooDom = document.querySelector('#twikoo') || '';</span><br><span class="line"> if( nowHref.replace(/^.*\/(m)\/.*$/,'$1') == "m"){//单条页面</span><br><span class="line"> if(!twikooDom){</span><br><span class="line"> //console.log('评论未加载');</span><br><span class="line"> addTwikooJS() //加载评论 js</span><br><span class="line"> setTimeout(function() { //延迟 1秒 执行</span><br><span class="line"> var memoTw = document.querySelector('.resource-wrapper') || '';</span><br><span class="line"> memoTw.insertAdjacentHTML('afterend', '<div id="mtcomment"></div>');</span><br><span class="line"> twikoo.init({</span><br><span class="line"> envId: twikooENV,</span><br><span class="line"> el: '#mtcomment',</span><br><span class="line"> path: nowHref.replace(/^.*=?(http.*\/m\/[0-9]+).*$/,'$1'), //v2023.08.09 正则更新</span><br><span class="line"> onCommentLoaded: function () {</span><br><span class="line"> startTwikoo()</span><br><span class="line"> //console.log('再次开启定时执行');</span><br><span class="line"> }</span><br><span class="line"> })</span><br><span class="line"> }, 900)</span><br><span class="line"> }else{</span><br><span class="line"> //console.log('清除定时执行');</span><br><span class="line"> clearInterval(startTW)</span><br><span class="line"> }</span><br><span class="line"> }</span><br><span class="line"> }, 2000)</span><br><span class="line">}</span><br><span class="line">startTwikoo();</span><br></pre></td></tr></table></figure>
|
|
|
|
<p>由于官方已经有评论图标所以CSS不再添加图标</p>
|
|
<p>2023.9.26 更新.memos升级0.15.1版本后以下无法使用</p>
|
|
<h2 id="自定义脚本-2"><a href="#自定义脚本-2" class="headerlink" title="自定义脚本"></a>自定义脚本</h2><figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//添加 twikoo 评论 v2023.06.10</span></span><br><span class="line">var twikooENV = 'https<span class="punctuation">:</span><span class="comment">//twikoo.jiong.us/'</span></span><br><span class="line">function addTwikooJS() <span class="punctuation">{</span> </span><br><span class="line"> var memosTwikoo = document.createElement(<span class="string">"script"</span>);</span><br><span class="line"> memosTwikoo.src = `https<span class="punctuation">:</span><span class="comment">//cdn.staticfile.org/twikoo/1.6.16/twikoo.all.min.js`;</span></span><br><span class="line"> var tws = document.getElementsByTagName(<span class="string">"script"</span>)<span class="punctuation">[</span><span class="number">0</span><span class="punctuation">]</span>;</span><br><span class="line"> tws.parentNode.insertBefore(memosTwikoo<span class="punctuation">,</span> tws);</span><br><span class="line"><span class="punctuation">}</span>;</span><br><span class="line">function addComIcon()<span class="punctuation">{</span></span><br><span class="line"> var memoTwIcons = document.querySelectorAll('.time-text') || '';</span><br><span class="line"> if(memoTwIcons)<span class="punctuation">{</span></span><br><span class="line"> for(var i=<span class="number">0</span>;i < memoTwIcons.length;i++)<span class="punctuation">{</span></span><br><span class="line"> <span class="comment">//if(memoTwIcon[i].hasChildNodes == false){</span></span><br><span class="line"> memoTwIcons<span class="punctuation">[</span>i<span class="punctuation">]</span>.insertAdjacentHTML('afterbegin'<span class="punctuation">,</span> '<div class=<span class="string">"twicon"</span>><svg class=<span class="string">"icon"</span> viewBox=<span class="string">"0 0 1024 1024"</span> xmlns=<span class="string">"http://www.w3.org/2000/svg"</span> width=<span class="string">"16"</span> height=<span class="string">"16"</span>><path d=<span class="string">"M896 138.667H128c-38.4 0-64 25.6-64 64v544c0 38.4 25.6 64 64 64h128v128c83.2 0 166.4-44.8 256-128h384c38.4 0 64-25.6 64-64v-544c0-38.4-25.6-64-64-64zm0 608H486.4l-19.2 19.2c-51.2 51.2-102.4 83.2-147.2 96v-115.2H128v-544h768v544z"</span> fill=<span class="string">"#8a8a8a"</span>/><path d=<span class="string">"M256 477.867a64 64 0 1 0 128 0 64 64 0 1 0-128 0zM448 477.867a64 64 0 1 0 128 0 64 64 0 1 0-128 0zM640 477.867a64 64 0 1 0 128 0 64 64 0 1 0-128 0z"</span> fill=<span class="string">"#8a8a8a"</span>/></svg></div>');</span><br><span class="line"> <span class="comment">//}</span></span><br><span class="line"> <span class="punctuation">}</span></span><br><span class="line"> <span class="punctuation">}</span></span><br><span class="line"><span class="punctuation">}</span>;</span><br><span class="line">function startTwikoo() <span class="punctuation">{</span></span><br><span class="line"> start = setInterval(function()<span class="punctuation">{</span></span><br><span class="line"> var twikooDom = document.getElementById('twikoo') || '';</span><br><span class="line"> var memoTw = document.querySelector('.memo-wrapper') || '';</span><br><span class="line"> var memoLoading = document.querySelector('.action-button-container') || '';</span><br><span class="line"> var memoLoadingA = document.querySelector('.action-button-container a') || '';</span><br><span class="line"> var memoTwIcons = document.querySelectorAll('.time-text .twicon') || '';</span><br><span class="line"> var nowHref = window.location.href;</span><br><span class="line"> if( nowHref.replace(/^.*\/(m)\/.*$/<span class="punctuation">,</span>'$<span class="number">1</span>') == <span class="string">"m"</span> && memoLoadingA)<span class="punctuation">{</span></span><br><span class="line"> memoLoading.innerHTML = <span class="string">"评论加载中……"</span></span><br><span class="line"> <span class="punctuation">}</span></span><br><span class="line"> if( nowHref.replace(/^.*\/(m)\/.*$/<span class="punctuation">,</span>'$<span class="number">1</span>') == <span class="string">"m"</span> && !twikooDom)<span class="punctuation">{</span></span><br><span class="line"> addTwikooJS()</span><br><span class="line"> if(memoTw)<span class="punctuation">{</span></span><br><span class="line"> clearInterval(start)</span><br><span class="line"> memoTw.insertAdjacentHTML('afterend'<span class="punctuation">,</span> '<div id=<span class="string">"mtcomment"</span>></div>');</span><br><span class="line"> setTimeout(function() <span class="punctuation">{</span></span><br><span class="line"> twikoo.init(<span class="punctuation">{</span></span><br><span class="line"> envId<span class="punctuation">:</span> twikooENV<span class="punctuation">,</span></span><br><span class="line"> el<span class="punctuation">:</span> '#mtcomment'<span class="punctuation">,</span></span><br><span class="line"> path<span class="punctuation">:</span> nowHref.replace(/^(.*\/m\/<span class="punctuation">[</span><span class="number">0</span><span class="number">-9</span><span class="punctuation">]</span>+).*$/<span class="punctuation">,</span>'$<span class="number">1</span>')<span class="punctuation">,</span></span><br><span class="line"> onCommentLoaded<span class="punctuation">:</span> function () <span class="punctuation">{</span></span><br><span class="line"> <span class="comment">//console.log('评论加载完成');</span></span><br><span class="line"> memoLoading.innerHTML = ''</span><br><span class="line"> startTwikoo()</span><br><span class="line"> <span class="punctuation">}</span></span><br><span class="line"> <span class="punctuation">}</span>)</span><br><span class="line"> <span class="punctuation">}</span><span class="punctuation">,</span> <span class="number">1000</span>)</span><br><span class="line"> <span class="punctuation">}</span></span><br><span class="line"> <span class="punctuation">}</span></span><br><span class="line"> if(nowHref.replace(/^.*\/(explore).*$/<span class="punctuation">,</span>'$<span class="number">1</span>') == <span class="string">"explore"</span> || nowHref.replace(/^.*\/(u).*$/<span class="punctuation">,</span>'$<span class="number">1</span>') == <span class="string">"u"</span>)<span class="punctuation">{</span></span><br><span class="line"> memoTwIcons.forEach(memoTwIcon => <span class="punctuation">{</span>memoTwIcon.remove();<span class="punctuation">}</span>);</span><br><span class="line"> addComIcon()</span><br><span class="line"> <span class="comment">//console.log('图标添加成功');</span></span><br><span class="line"> <span class="punctuation">}</span></span><br><span class="line"> <span class="comment">//console.log(window.location.href);</span></span><br><span class="line"> <span class="punctuation">}</span><span class="punctuation">,</span> <span class="number">1000</span>)</span><br><span class="line"><span class="punctuation">}</span></span><br><span class="line">startTwikoo();</span><br></pre></td></tr></table></figure>
|
|
|
|
<h2 id="自定义样式"><a href="#自定义样式" class="headerlink" title="自定义样式"></a>自定义样式</h2><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">#twikoo{padding: 1rem;background-color: rgb(63,63,70);margin: 1rem 0;border-radius: .5rem;color: #fff !important;}</span><br><span class="line">.twicon{position: absolute;right: 1rem;}</span><br><span class="line">.btns-container.space-x-2{margin-right:1.5rem;}</span><br><span class="line">.action-button-container{color: #e5e7eb;}</span><br><span class="line">.action-button-container a{display:none !important;}</span><br></pre></td></tr></table></figure></div>
|
|
|
|
<div class="post-copyright">
|
|
<div class="copyright-item">
|
|
<span> 作者: 浪子</span>
|
|
</div>
|
|
<div class="copyright-item">
|
|
<span> 链接: <a href="https://blog.jkjoy.cn/posts/507a5d86.html">https://blog.jkjoy.cn/posts/507a5d86.html</a></span>
|
|
</div>
|
|
<div class="copyright-item">
|
|
<span> 声明: 本博客所有文章除特别声明外,均采用许可协议 <a target="_blank" rel="noopener" href="http://creativecommons.org/licenses/by-nc/4.0/">CC-BY-NC-4.0</a> 转载请注明出处!</span>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="share-reward">
|
|
<div class="share">
|
|
|
|
<div class="social-share" data-sites="wechat,weibo,qq"></div>
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css">
|
|
<script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js"></script>
|
|
|
|
|
|
</div>
|
|
<div class="reward">
|
|
|
|
<div style="padding: 10px 0; margin-left: 20px; width: 90%; text-align: center;">
|
|
<div class="reward-content">
|
|
<ul id="donateBox" class="list pos-a">
|
|
|
|
<li id="PayPal"><a href="https://paypal.me/jkjoy" target="_blank" title="贝宝">贝宝</a></li>
|
|
|
|
|
|
<li id="AliPay" title="支付宝"><img data-img="https://blogcdn.loliko.cn/ali.png" onerror=this.onerror=null,this.src="/img/loading.gif"></img></li>
|
|
|
|
|
|
<li id="WeChat" title="微信"><img date-img="https://blogcdn.loliko.cn/wx.png" onerror=this.onerror=null,this.src="/img/loading.gif"></img></li>
|
|
|
|
</ul>
|
|
<div id="QRBox" class="pos-f left-100">
|
|
<div id="MainBox"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="post_tags">
|
|
|
|
<i class="fas fa-tag"></i> <a href="/tags/Memos/" class="tag">Memos</a>
|
|
|
|
<i class="fas fa-tag"></i> <a href="/tags/Twikoo/" class="tag">Twikoo</a>
|
|
|
|
</div>
|
|
<div class="post-nav">
|
|
|
|
<div class="post-nav-prev post-nav-item">
|
|
<a href="/posts/8828c81e.html" >给Memos添加Artalk评论<i class="fa fa-chevron-left"></i></a>
|
|
</div>
|
|
|
|
|
|
<div class="post-nav-next post-nav-item">
|
|
<a href="/posts/6d58ffa9.html" >使用cloudflare Tunnels实现内网穿透<i class="fa fa-chevron-right"></i></a>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3><i class="far fa-comment"></i> 评论</h3>
|
|
<div id="tcomment"></div>
|
|
<script src="https://cdn.staticfile.org/twikoo/1.6.32/twikoo.all.min.js"></script>
|
|
<script>
|
|
twikoo.init({
|
|
envId: 'https://t.jkjoy.cn',
|
|
el: '#tcomment',
|
|
})
|
|
</script>
|
|
|
|
|
|
</article>
|
|
|
|
|
|
<a id="gotop" href="javascript:" title="返回顶部"><i class="fa fa-arrow-up"></i></a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div id="bottom-outer">
|
|
<div id="bottom-inner">
|
|
© 2020 <i class="fa fa-heart" id="heart"></i> 浪子
|
|
<br>
|
|
Powered by
|
|
<a target="_blank" rel="noopener" href="http://hexo.io">hexo</a> | Theme is <a target="_blank" rel="noopener" href="https://github.com/a2396837/hexo-theme-blank/">blank</a>
|
|
|
|
<div class="icp-info">
|
|
|
|
<a href="" target="_blank"> </a>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/layui-src@2.5.5/dist/layui.min.js"></script>
|
|
|
|
|
|
|
|
|
|
<script src="/js/script.js"></script>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js"></script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
window.lazyLoadOptions = {
|
|
elements_selector: 'img',
|
|
threshold: 0
|
|
}
|
|
</script>
|
|
<script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js"></script>
|
|
|
|
|
|
|
|
<script>
|
|
var images = $('img').not('.nav-logo img').not('.card img').not($('a>img')).not('.reward-content img')
|
|
images.each(function (i, o) {
|
|
var lazyloadSrc = $(o).attr('data-src') ? $(o).attr('data-src') : $(o).attr('src')
|
|
$(o).wrap(`<a href="${lazyloadSrc}" data-fancybox="group" data-caption="${$(o).attr('alt')}" class="fancybox"></a>`)
|
|
})
|
|
</script>
|
|
<script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js"></script>
|
|
<script>
|
|
$().fancybox({
|
|
selector: '[data-fancybox]',
|
|
loop: true,
|
|
transitionEffect: 'slide',
|
|
protect: true,
|
|
buttons: ['slideShow', 'fullScreen', 'thumbs', 'close']
|
|
})
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
jQuery(document).ready(function () {
|
|
var QRBox = $('#QRBox');
|
|
var MainBox = $('#MainBox');
|
|
var AliPayQR = 'https://blogcdn.loliko.cn/ali.png';
|
|
var WeChanQR = 'https://blogcdn.loliko.cn/wx.png';
|
|
|
|
function showQR(QR) {
|
|
if (QR) {
|
|
MainBox.css('background-image', 'url(' + QR + ')');
|
|
}
|
|
$('#donateBox').addClass('blur');
|
|
QRBox.fadeIn(300, function (argument) {
|
|
MainBox.addClass('showQR');
|
|
});
|
|
}
|
|
|
|
$('#donateBox>li').click(function (event) {
|
|
var thisID = $(this).attr('id');
|
|
if (thisID === 'AliPay') {
|
|
showQR(AliPayQR);
|
|
} else if (thisID === 'WeChat') {
|
|
showQR(WeChanQR);
|
|
}
|
|
});
|
|
|
|
MainBox.click(function (event) {
|
|
MainBox.removeClass('showQR').addClass('hideQR');
|
|
setTimeout(function (a) {
|
|
QRBox.fadeOut(300, function (argument) {
|
|
MainBox.removeClass('hideQR');
|
|
});
|
|
$('#DonateText,#donateBox,#github').removeClass('blur');
|
|
}, 600);
|
|
|
|
});
|
|
});
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module" defer></script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.4/dist/clipboard.min.js"></script>
|
|
<script>
|
|
!function (e, t, a) {
|
|
var initCopyCode = function(){
|
|
var copyHtml = '';
|
|
copyHtml += '<button class="btn-copy" data-clipboard-snippet="">';
|
|
copyHtml += ' <i class="fa fa-clipboard"></i><span>复制</span>';
|
|
copyHtml += '</button>';
|
|
$(".highlight .code pre").before(copyHtml);
|
|
new ClipboardJS('.btn-copy', {
|
|
target: function(trigger) {
|
|
return trigger.nextElementSibling;
|
|
}
|
|
});
|
|
}
|
|
initCopyCode();
|
|
}(window, document);
|
|
</script>
|
|
|
|
|
|
<script>
|
|
var btntop = $('#gotop');
|
|
btntop.on('click', function (e) {
|
|
e.preventDefault();
|
|
$('html, body').animate({ scrollTop: 0 }, '300');
|
|
});
|
|
|
|
var $table = $('.content table').not($('figure.highlight > table'))
|
|
$table.each(function () {
|
|
$(this).wrap('<div class="table-wrap"></div>')
|
|
})
|
|
</script>
|
|
|
|
|
|
|
|
</html> |