首页
时间轴
留言
壁纸
统计
个人导航
友情链接
订阅&采集
执念图床
联系方式
Search
1
本站同款主题全量文件----持续更新
18,378 阅读
2
Typecho博客Joe主题实现友链自动检测
4,495 阅读
3
Typecho博客Joe主题实现打赏设置
4,427 阅读
4
执念采集系统使用教程——为网站添加采集功能
4,173 阅读
5
执念订阅系统使用教程---为自己网站加上订阅功能
3,618 阅读
个人感想
编程相关
网站优化
技术分享
精品源码
文章推广
登录
/
注册
Search
标签搜索
执念博客
原创
执念
zhinianblog
zhinianboke
zhinian
Typecho
Joe
资源
js
源码
插件
wordpress
java
宝塔面板
Typecho插件
青龙面板
主题
宝塔
技巧
执念博客
累计撰写
149
篇文章
累计收到
9,752
条评论
今日撰写
1
篇文章
首页
栏目
个人感想
编程相关
网站优化
技术分享
精品源码
文章推广
页面
时间轴
留言
壁纸
统计
个人导航
友情链接
用户登录
登录
注册
搜索到
1
篇与
版权
的结果
2021-05-19
Typecho的Joe主题编辑器加入转载地址展示
0.成品图1.修改copyright.php文件,新增代码,文件路径:①第一段,新增,最上方 <?php $content = $this->content; $content = _parseReply($content); $isContain = 0; if(strpos($content, 'custom-copyright') !== false) { $isContain = 1; } ?> <style> .custom-copyright{ display: none; } </style> ②第二段,新增,中间 <div class="item custom-copyright"> <svg t="1622634042051" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9170" width="20" height="20"><path d="M512 1024C229.230021 1024 0 794.769979 0 512S229.230021 0 512 0s512 229.230021 512 512-229.230021 512-512 512z m248.300679-758.012243l-2.297023-2.297023c-52.932428-52.921694-139.621434-52.921694-192.554935 0L442.70504 386.411874c-52.932428 52.921694-52.932428 139.5946 0 192.516294l2.297023 2.297023c4.36327 4.361124 9.070021 8.379841 13.892696 12.054004l44.896067-44.88748c-5.28208-3.098834-10.219606-6.772998-14.697727-11.248973l-2.297024-2.297023c-28.704201-28.698834-28.704201-75.536637 0-104.236545l122.744755-122.718994c28.705275-28.699908 75.551665-28.699908 104.256939 0l2.297023 2.29595c28.705275 28.698834 28.705275 75.536637 0 104.235472l-55.459153 55.448419c9.64535 23.763455 14.238323 49.133753 13.778919 74.50405l85.886121-85.868947c52.932428-52.921694 52.932428-139.5946 0-192.516294zM578.882013 442.776956c-4.36327-4.362197-9.070021-8.380914-13.892696-12.054004l-44.894994 44.886406c5.281006 3.098834 10.218532 6.772998 14.696654 11.248973l2.297023 2.297023c28.704201 28.698834 28.704201 75.536637 0 104.236545L414.344319 716.110893c-28.705275 28.699908-75.551665 28.699908-104.25694 0l-2.297023-2.29595c-28.705275-28.698834-28.705275-75.536637 0-104.235471l55.574005-55.44842c-9.64535-23.763455-14.238323-49.133753-13.778919-74.50405l-85.886121 85.868948c-52.932428 52.921694-52.932428 139.5946 0 192.516293l2.297023 2.297023c52.932428 52.921694 139.621434 52.921694 192.554935 0l122.743681-122.720067c52.932428-52.921694 52.932428-139.5946 0-192.516293l-2.411874-2.297023z" fill="#F7A349" p-id="9171"></path></svg> <span class="custom-copyright-title">文章转载:</span> <span class="text"> <a class="link custom-copyright-href" href="" target="_blank" rel="noopener noreferrer"></a> </span> </div> ③第三段,新增,最下方 <script> var isContain = <?php echo $isContain ?>; if(isContain) { $('.custom-copyright').css({ 'display': 'block' }); var title = $('#custom-copyright').attr('data-title'); var href = $('#custom-copyright').attr('data-href'); $('.custom-copyright-title').text(title + ':'); $('.custom-copyright-href').text(href); $('.custom-copyright-href').attr('href', href); } </script>2.新建custom.js文件,将以下代码防在文件内,文件路径:usr/themes/Joe-master/assets/jsdocument.addEventListener('DOMContentLoaded', () => { var copyright = '<div class="cm-tools-item" title="版权"><svg t="1622610141615" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2895" width="20" height="20"><path d="M515.52 722.259c-109.945 0-199.476-89.467-199.476-199.476s89.467-199.475 199.476-199.475 199.475 89.466 199.475 199.475S625.465 722.26 515.52 722.26z m0-339.883c-77.435 0-140.407 62.972-140.407 140.471 0 77.435 62.972 140.408 140.407 140.408s140.407-62.973 140.407-140.408c0-77.499-62.972-140.47-140.407-140.47z m29.054 229.874h-18.687c-49.34 0-89.466-40.126-89.466-89.403 0-49.34 40.125-89.466 89.466-89.466h18.751c16.319 0 29.502 13.183 29.502 29.502s-13.183 29.502-29.502 29.502h-18.75c-16.768 0-30.399 13.631-30.399 30.462 0 16.767 13.631 30.398 30.398 30.398h18.751c16.319 0 29.502 13.184 29.502 29.503s-13.247 29.502-29.566 29.502z m-29.054 411.686c-4.16 0-8.32-0.896-12.223-2.688L302.22 929.606c-137.08-62.46-222.194-181.109-222.194-309.549v-434.66c0-8.832 3.968-17.152 10.751-22.783 6.784-5.632 15.743-7.872 24.383-6.208 26.11 5.12 52.924 7.68 79.739 7.68 88.634 0 175.093-28.67 237.297-78.587l64.764-52.03c10.815-8.703 26.174-8.703 36.926 0L598.65 85.5c62.204 49.98 148.662 78.587 237.297 78.587 26.814 0 53.628-2.56 79.739-7.68 8.64-1.728 17.599 0.576 24.382 6.208 6.784 5.631 10.752 13.951 10.752 22.782v434.661c0 128.44-85.115 247.089-222.195 309.549l-201.075 91.642c-3.712 1.792-7.871 2.688-12.031 2.688zM139.03 219.89v400.167c0 105.082 71.932 203.124 187.637 255.856l188.788 86.075 188.788-86.075C820.013 823.117 891.88 725.075 891.88 620.057V219.89a478.563 478.563 0 0 1-55.868 3.264c-103.29 0-200.692-32.51-274.287-91.642L515.52 94.33l-46.333 37.182c-73.532 59.068-170.934 91.642-274.223 91.642-18.751 0-37.438-1.088-55.933-3.264z" fill="" p-id="2896"></path></svg></div>'; $(".cm-tools").append(copyright); $(".cm-tools .cm-tools-item").click(function(){ if($(this).attr("title") == '版权') { var copyright_txt = '插入版权'; var copyright_body = '<div class="fitem"><label>版权名称</label><input autocomplete="off" name="copyright_title" placeholder="请输入版权名称"></div>'; copyright_body += '<div class="fitem"><label>版权地址</label><input autocomplete="off" name="copyright_url" placeholder="请输入版权地址"></div>'; $(".cm-modal__wrapper-header .cm-modal__wrapper-header--text").html(copyright_txt); $(".cm-modal__wrapper-bodyer").html(copyright_body); $('.cm-modal').addClass('active'); $(".cm-modal__wrapper-footer--confirm").attr('style', 'display: none'); $(".cm-modal__wrapper-footer").removeAttr('style'); var copyright_button = '<div class="cm-modal__wrapper-footer--confirm custom_button">确认</div>'; $('.custom_button').remove(); $(".cm-modal__wrapper-footer").append(copyright_button); $(".custom_button").click(function(){ var copyright_title = $( ".fitem input[name='copyright_title']").val(); var copyright_url = $( ".fitem input[name='copyright_url']").val(); var text= "<span><</span>div id='custom-copyright' data-title='" + copyright_title + "' data-href='" + copyright_url + "'><span><</span>/div>"; $(".cm-mainer .cm-scroller .cm-content").append('<br>!!!<br>'); $(".cm-mainer .cm-scroller .cm-content").append(text); $(".cm-mainer .cm-scroller .cm-content").append('<br>!!!<br>'); $('.cm-modal').removeClass('active'); }); } else { $(".cm-modal__wrapper-footer--confirm").removeAttr('style'); $('.custom_button').remove(); } }); });4.修改factory.php文件,新增以下代码,文件路径:usr/themes/Joe-master/core{tabs}{tabs-pane label="代码"}<script src="<?php Helper::options()->themeUrl('assets/js/custom.js?v=20210602') ?>" type="module"></script>{/tabs-pane}{tabs-pane label="代码位置图片"}{/tabs-pane}{/tabs}下载地址如下:隐藏内容,请前往内页查看详情
2021年05月19日
496 阅读
16 评论
5 点赞