更新
This commit is contained in:
parent
e740c4070c
commit
c83154befb
2
assets/css/joe.global.min.css
vendored
2
assets/css/joe.global.min.css
vendored
File diff suppressed because one or more lines are too long
@ -1673,8 +1673,6 @@
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
code[class*='language-'] {
|
code[class*='language-'] {
|
||||||
display: block;
|
display: block;
|
||||||
max-height: 500px;
|
|
||||||
overflow-y: auto;
|
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
@ -2251,6 +2249,70 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
&__leaving {
|
||||||
|
padding-top: 15px;
|
||||||
|
&-none {
|
||||||
|
padding: 15px 0;
|
||||||
|
text-align: center;
|
||||||
|
user-select: none;
|
||||||
|
color: var(--minor);
|
||||||
|
}
|
||||||
|
&-list {
|
||||||
|
position: relative;
|
||||||
|
height: 500px;
|
||||||
|
.item {
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
width: 200px;
|
||||||
|
min-height: 140px;
|
||||||
|
overflow: hidden;
|
||||||
|
box-shadow: 0 2px 10px 1px rgba(0, 0, 0, 0.2);
|
||||||
|
user-select: none;
|
||||||
|
opacity: 0.88;
|
||||||
|
.user {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 10px;
|
||||||
|
color: rgba(255, 255, 255, 1);
|
||||||
|
border-bottom: 1px dashed rgba(255, 255, 255, 0.85);
|
||||||
|
height: 40px;
|
||||||
|
cursor: move;
|
||||||
|
.avatar {
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
.nickname {
|
||||||
|
min-width: 0;
|
||||||
|
flex: 1;
|
||||||
|
margin: 0 5px;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
a {
|
||||||
|
color: rgba(255, 255, 255, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.date {
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.wrapper {
|
||||||
|
padding: 10px;
|
||||||
|
.content {
|
||||||
|
max-height: 140px;
|
||||||
|
overflow-y: auto;
|
||||||
|
word-break: break-all;
|
||||||
|
line-height: 24px;
|
||||||
|
color: #fff;
|
||||||
|
.draw_image {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.joe_footer {
|
.joe_footer {
|
||||||
|
2
assets/css/joe.responsive.min.css
vendored
2
assets/css/joe.responsive.min.css
vendored
File diff suppressed because one or more lines are too long
@ -55,10 +55,10 @@ html {
|
|||||||
height: 500px;
|
height: 500px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pre[class*='language-'] {
|
|
||||||
code[class*='language-'] {
|
|
||||||
max-height: 450px;
|
|
||||||
}
|
}
|
||||||
|
&__leaving {
|
||||||
|
&-list {
|
||||||
|
height: 450px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -104,10 +104,10 @@ html {
|
|||||||
grid-template-columns: repeat(5, 1fr);
|
grid-template-columns: repeat(5, 1fr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pre[class*='language-'] {
|
|
||||||
code[class*='language-'] {
|
|
||||||
max-height: 430px;
|
|
||||||
}
|
}
|
||||||
|
&__leaving {
|
||||||
|
&-list {
|
||||||
|
height: 400px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -255,10 +255,10 @@ html {
|
|||||||
grid-template-columns: repeat(5, 1fr);
|
grid-template-columns: repeat(5, 1fr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pre[class*='language-'] {
|
|
||||||
code[class*='language-'] {
|
|
||||||
max-height: 400px;
|
|
||||||
}
|
}
|
||||||
|
&__leaving {
|
||||||
|
&-list {
|
||||||
|
height: 350px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -537,6 +537,31 @@ html {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
&__leaving {
|
||||||
|
&-list {
|
||||||
|
height: 300px;
|
||||||
|
.item {
|
||||||
|
font-size: 12px;
|
||||||
|
width: 160px;
|
||||||
|
min-height: unset;
|
||||||
|
.user {
|
||||||
|
padding: 0 8px;
|
||||||
|
height: 35px;
|
||||||
|
.avatar {
|
||||||
|
width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.wrapper {
|
||||||
|
padding: 8px;
|
||||||
|
.content {
|
||||||
|
max-height: 109px;
|
||||||
|
line-height: 18px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
&__copyright {
|
&__copyright {
|
||||||
.content {
|
.content {
|
||||||
.item {
|
.item {
|
||||||
|
107
assets/js/joe.leaving.js
Normal file
107
assets/js/joe.leaving.js
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
const encryption = str => window.btoa(unescape(encodeURIComponent(str)));
|
||||||
|
const decrypt = str => decodeURIComponent(escape(window.atob(str)));
|
||||||
|
|
||||||
|
/* 当前页的CID */
|
||||||
|
const cid = $('.joe_detail').attr('data-cid');
|
||||||
|
|
||||||
|
/* 获取本篇文章百度收录情况 */
|
||||||
|
{
|
||||||
|
$.ajax({
|
||||||
|
url: Joe.BASE_API,
|
||||||
|
type: 'POST',
|
||||||
|
data: { routeType: 'baidu_record', site: window.location.href },
|
||||||
|
success(res) {
|
||||||
|
if (res.data && res.data === '已收录') {
|
||||||
|
$('#Joe_Baidu_Record').css('color', '#67C23A');
|
||||||
|
$('#Joe_Baidu_Record').html('已收录');
|
||||||
|
} else {
|
||||||
|
/* 如果填写了Token,则自动推送给百度 */
|
||||||
|
if (Joe.BAIDU_PUSH) {
|
||||||
|
$('#Joe_Baidu_Record').html('<span style="color: #E6A23C">未收录,推送中...</span>');
|
||||||
|
const _timer = setTimeout(function () {
|
||||||
|
$.ajax({
|
||||||
|
url: Joe.BASE_API,
|
||||||
|
type: 'POST',
|
||||||
|
data: {
|
||||||
|
routeType: 'baidu_push',
|
||||||
|
domain: encodeURI(window.location.hostname),
|
||||||
|
url: encodeURI(window.location.href)
|
||||||
|
},
|
||||||
|
success(res) {
|
||||||
|
if (res.error) {
|
||||||
|
$('#Joe_Baidu_Record').html('<span style="color: #F56C6C">推送失败,请检查!</span>');
|
||||||
|
} else {
|
||||||
|
$('#Joe_Baidu_Record').html('<span style="color: #67C23A">推送成功!</span>');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
clearTimeout(_timer);
|
||||||
|
}, 1000);
|
||||||
|
} else {
|
||||||
|
const url = `https://ziyuan.baidu.com/linksubmit/url?sitename=${encodeURI(window.location.href)}`;
|
||||||
|
$('#Joe_Baidu_Record').html(`<a target="_blank" href="${url}" rel="noopener noreferrer nofollow" style="color: #F56C6C">未收录,提交收录</a>`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 激活浏览功能 */
|
||||||
|
{
|
||||||
|
let viewsArr = localStorage.getItem(encryption('views')) ? JSON.parse(decrypt(localStorage.getItem(encryption('views')))) : [];
|
||||||
|
const flag = viewsArr.includes(cid);
|
||||||
|
if (!flag) {
|
||||||
|
$.ajax({
|
||||||
|
url: Joe.BASE_API,
|
||||||
|
type: 'POST',
|
||||||
|
data: { routeType: 'handle_views', cid },
|
||||||
|
success(res) {
|
||||||
|
if (res.code !== 1) return;
|
||||||
|
$('#Joe_Article_Views').html(`${res.data.views} 阅读`);
|
||||||
|
viewsArr.push(cid);
|
||||||
|
const name = encryption('views');
|
||||||
|
const val = encryption(JSON.stringify(viewsArr));
|
||||||
|
localStorage.setItem(name, val);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 激活随机样式 */
|
||||||
|
{
|
||||||
|
let _index = 100;
|
||||||
|
const colors = ['#F8D800', '#0396FF', '#EA5455', '#7367F0', '#32CCBC', '#F6416C', '#28C76F', '#9F44D3', '#F55555', '#736EFE', '#E96D71', '#DE4313', '#D939CD', '#4C83FF', '#F072B6', '#C346C2', '#5961F9', '#FD6585', '#465EFB', '#FFC600', '#FA742B', '#5151E5', '#BB4E75', '#FF52E5', '#49C628', '#00EAFF', '#F067B4', '#F067B4', '#ff9a9e', '#00f2fe', '#4facfe', '#f093fb', '#6fa3ef', '#bc99c4', '#46c47c', '#f9bb3c', '#e8583d', '#f68e5f'];
|
||||||
|
const random = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min;
|
||||||
|
const maxWidth = $('.joe_detail__leaving-list').width();
|
||||||
|
const maxHeight = $('.joe_detail__leaving-list').height();
|
||||||
|
const radius1 = ['20px 300px', '20px 400px', '20px 500px', '30px 300px', '30px 400px', '30px 500px', '40px 300px', '40px 400px', '40px 500px'];
|
||||||
|
const radius2 = ['300px 20px', '400px 20px', '500px 20px', '300px 30px', '400px 30px', '500px 30px', '300px 40px', '400px 40px', '500px 40px'];
|
||||||
|
$('.joe_detail__leaving-list .item').each((index, item) => {
|
||||||
|
const zIndex = random(1, 99);
|
||||||
|
const background = colors[random(0, colors.length - 1)];
|
||||||
|
const width = Math.ceil($(item).width());
|
||||||
|
const height = Math.ceil($(item).height());
|
||||||
|
const top = random(0, maxHeight - height);
|
||||||
|
const left = random(0, maxWidth - width);
|
||||||
|
$(item).css({
|
||||||
|
display: 'block',
|
||||||
|
zIndex,
|
||||||
|
background,
|
||||||
|
top,
|
||||||
|
left,
|
||||||
|
borderTopLeftRadius: radius2[random(0, radius2.length - 1)],
|
||||||
|
borderTopRightRadius: radius1[random(0, radius1.length - 1)],
|
||||||
|
borderBottomLeftRadius: radius1[random(0, radius1.length - 1)],
|
||||||
|
borderBottomRightRadius: radius1[random(0, radius1.length - 1)]
|
||||||
|
});
|
||||||
|
$(item).draggabilly({ containment: true });
|
||||||
|
$(item).on('dragStart', e => {
|
||||||
|
_index++;
|
||||||
|
$(item).css({
|
||||||
|
zIndex: _index,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
1
assets/js/joe.leaving.min.js
vendored
Normal file
1
assets/js/joe.leaving.min.js
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
document.addEventListener("DOMContentLoaded",()=>{const e=e=>window.btoa(unescape(encodeURIComponent(e))),o=e=>decodeURIComponent(escape(window.atob(e))),t=$(".joe_detail").attr("data-cid");$.ajax({url:Joe.BASE_API,type:"POST",data:{routeType:"baidu_record",site:window.location.href},success(e){if(e.data&&"已收录"===e.data)$("#Joe_Baidu_Record").css("color","#67C23A"),$("#Joe_Baidu_Record").html("已收录");else if(Joe.BAIDU_PUSH){$("#Joe_Baidu_Record").html('<span style="color: #E6A23C">未收录,推送中...</span>');const e=setTimeout(function(){$.ajax({url:Joe.BASE_API,type:"POST",data:{routeType:"baidu_push",domain:encodeURI(window.location.hostname),url:encodeURI(window.location.href)},success(e){e.error?$("#Joe_Baidu_Record").html('<span style="color: #F56C6C">推送失败,请检查!</span>'):$("#Joe_Baidu_Record").html('<span style="color: #67C23A">推送成功!</span>')}}),clearTimeout(e)},1e3)}else{const e=`https://ziyuan.baidu.com/linksubmit/url?sitename=${encodeURI(window.location.href)}`;$("#Joe_Baidu_Record").html(`<a target="_blank" href="${e}" rel="noopener noreferrer nofollow" style="color: #F56C6C">未收录,提交收录</a>`)}}});{let a=localStorage.getItem(e("views"))?JSON.parse(o(localStorage.getItem(e("views")))):[];const i=a.includes(t);i||$.ajax({url:Joe.BASE_API,type:"POST",data:{routeType:"handle_views",cid:t},success(o){if(1!==o.code)return;$("#Joe_Article_Views").html(`${o.data.views} 阅读`),a.push(t);const i=e("views"),n=e(JSON.stringify(a));localStorage.setItem(i,n)}})}{let e=100;const o=["#F8D800","#0396FF","#EA5455","#7367F0","#32CCBC","#F6416C","#28C76F","#9F44D3","#F55555","#736EFE","#E96D71","#DE4313","#D939CD","#4C83FF","#F072B6","#C346C2","#5961F9","#FD6585","#465EFB","#FFC600","#FA742B","#5151E5","#BB4E75","#FF52E5","#49C628","#00EAFF","#F067B4","#F067B4","#ff9a9e","#00f2fe","#4facfe","#f093fb","#6fa3ef","#bc99c4","#46c47c","#f9bb3c","#e8583d","#f68e5f"],t=(e,o)=>Math.floor(Math.random()*(o-e+1))+e,a=$(".joe_detail__leaving-list").width(),i=$(".joe_detail__leaving-list").height(),n=["20px 300px","20px 400px","20px 500px","30px 300px","30px 400px","30px 500px","40px 300px","40px 400px","40px 500px"],d=["300px 20px","400px 20px","500px 20px","300px 30px","400px 30px","500px 30px","300px 40px","400px 40px","500px 40px"];$(".joe_detail__leaving-list .item").each((l,c)=>{const s=t(1,99),p=o[t(0,o.length-1)],r=Math.ceil($(c).width()),x=Math.ceil($(c).height()),u=t(0,i-x),h=t(0,a-r);$(c).css({display:"block",zIndex:s,background:p,top:u,left:h,borderTopLeftRadius:d[t(0,d.length-1)],borderTopRightRadius:n[t(0,n.length-1)],borderBottomLeftRadius:n[t(0,n.length-1)],borderBottomRightRadius:n[t(0,n.length-1)]}),$(c).draggabilly({containment:!0}),$(c).on("dragStart",o=>{e++,$(c).css({zIndex:e})})})}});
|
341
assets/js/joe.short.js
Normal file
341
assets/js/joe.short.js
Normal file
@ -0,0 +1,341 @@
|
|||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* *
|
||||||
|
* 开放类组件
|
||||||
|
* *
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* 便条按钮 */
|
||||||
|
class JoeAnote extends HTMLElement {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.options = {
|
||||||
|
icon: this.getAttribute('icon') || 'fa-download',
|
||||||
|
href: this.getAttribute('href') || '#',
|
||||||
|
type: /^secondary$|^success$|^warning$|^error$|^info$/.test(this.getAttribute('type')) ? this.getAttribute('type') : 'secondary',
|
||||||
|
content: this.innerHTML.trim().replace(/^(<br>)|(<br>)$/g, '') || '标签按钮'
|
||||||
|
};
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
get template() {
|
||||||
|
return `
|
||||||
|
<a class="joe_detail__article-anote ${this.options.type}" href="${this.options.href}" target="_blank" rel="noopener noreferrer nofollow">
|
||||||
|
<span class="icon"><i class="fa ${this.options.icon}"></i></span><span class="content">${this.options.content}</span>
|
||||||
|
</a>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
render() {
|
||||||
|
this.innerHTML = this.template;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
window.customElements.define('joe-anote', JoeAnote);
|
||||||
|
/* 多彩按钮 */
|
||||||
|
class JoeAbtn extends HTMLElement {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.options = {
|
||||||
|
icon: this.getAttribute('icon') || '',
|
||||||
|
color: this.getAttribute('color') || '#ff6800',
|
||||||
|
href: this.getAttribute('href') || '#',
|
||||||
|
radius: this.getAttribute('radius') || '17.5px',
|
||||||
|
content: this.innerHTML.trim().replace(/^(<br>)|(<br>)$/g, '') || '多彩按钮'
|
||||||
|
};
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
get template() {
|
||||||
|
return `
|
||||||
|
<a class="joe_detail__article-abtn" style="background: ${this.options.color}; border-radius: ${this.options.radius}" href="${this.options.href}" target="_blank" rel="noopener noreferrer nofollow">
|
||||||
|
<span class="icon"><i class="${this.options.icon} fa"></i></span><span class="content">${this.options.content}</span>
|
||||||
|
</a>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
render() {
|
||||||
|
this.innerHTML = this.template;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
window.customElements.define('joe-abtn', JoeAbtn);
|
||||||
|
/* Dplayer */
|
||||||
|
class JoeDplayer extends HTMLElement {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.options = {
|
||||||
|
src: this.getAttribute('src'),
|
||||||
|
player: this.getAttribute('player')
|
||||||
|
};
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
get template() {
|
||||||
|
return `
|
||||||
|
<iframe class="joe_detail__article-player" allowfullscreen="true" src="${this.options.player + this.options.src}"></iframe>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
render() {
|
||||||
|
if (this.options.src) this.innerHTML = this.template;
|
||||||
|
else this.innerHTML = '播放地址未填写!';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
window.customElements.define('joe-dplayer', JoeDplayer);
|
||||||
|
/* BiliBili */
|
||||||
|
class JoeBilibili extends HTMLElement {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.options = {
|
||||||
|
bvid: this.getAttribute('bvid')
|
||||||
|
};
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
get template() {
|
||||||
|
return `
|
||||||
|
<iframe class="joe_detail__article-player" allowfullscreen="true" src="//player.bilibili.com/player.html?bvid=${this.options.bvid}"></iframe>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
render() {
|
||||||
|
if (this.options.bvid) this.innerHTML = this.template;
|
||||||
|
else this.innerHTML = 'Bvid未填写!';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
window.customElements.define('joe-bilibili', JoeBilibili);
|
||||||
|
/* 居中标题 */
|
||||||
|
class JoeMtitle extends HTMLElement {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.options = {
|
||||||
|
content: this.innerHTML.trim().replace(/^(<br>)|(<br>)$/g, '') || '居中标题'
|
||||||
|
};
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
get template() {
|
||||||
|
return `
|
||||||
|
<div class="joe_detail__article-mtitle">
|
||||||
|
<span class="text">${this.options.content}</span>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
render() {
|
||||||
|
this.innerHTML = this.template;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
window.customElements.define('joe-mtitle', JoeMtitle);
|
||||||
|
/* 点击复制 */
|
||||||
|
class JoeCopy extends HTMLElement {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.options = {
|
||||||
|
text: this.getAttribute('text') || '默认文本',
|
||||||
|
content: this.innerHTML.trim().replace(/^(<br>)|(<br>)$/g, '') || '点击复制'
|
||||||
|
};
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
get template() {
|
||||||
|
return `<span class="joe_detail__article-copy">${this.options.content}</span>`;
|
||||||
|
}
|
||||||
|
render() {
|
||||||
|
this.innerHTML = this.template;
|
||||||
|
this.event();
|
||||||
|
}
|
||||||
|
event() {
|
||||||
|
this.$copy = this.querySelector('.joe_detail__article-copy');
|
||||||
|
new ClipboardJS(this.$copy, { text: () => this.options.text }).on('success', () => Qmsg.success('复制成功!'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
window.customElements.define('joe-copy', JoeCopy);
|
||||||
|
/* 消息提示 */
|
||||||
|
class JoeMessage extends HTMLElement {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.options = {
|
||||||
|
type: /^success$|^info$|^warning$|^error$/.test(this.getAttribute('type')) ? this.getAttribute('type') : 'info',
|
||||||
|
content: this.innerHTML.trim().replace(/^(<br>)|(<br>)$/g, '') || '提示内容'
|
||||||
|
};
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
get template() {
|
||||||
|
return `
|
||||||
|
<div class="joe_detail__article-message ${this.options.type}">
|
||||||
|
<div class="icon"></div>
|
||||||
|
<div class="content">${this.options.content}</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
render() {
|
||||||
|
this.innerHTML = this.template;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
window.customElements.define('joe-message', JoeMessage);
|
||||||
|
/* 默认卡片 */
|
||||||
|
class JoeCard extends HTMLElement {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.options = {
|
||||||
|
width: this.getAttribute('width') || '100%',
|
||||||
|
label: this.getAttribute('label') || '默认标题',
|
||||||
|
content: this.innerHTML.trim().replace(/^(<br>)|(<br>)$/g, '') || '默认内容'
|
||||||
|
};
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
get template() {
|
||||||
|
return `
|
||||||
|
<div class="joe_detail__article-card" style="width: ${this.options.width}">
|
||||||
|
<div class="title">${this.options.label}</div>
|
||||||
|
<div class="content">${this.options.content}</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
render() {
|
||||||
|
this.innerHTML = this.template;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
window.customElements.define('joe-card', JoeCard);
|
||||||
|
/* 回复可见 - 显示状态 */
|
||||||
|
class JoeShow extends HTMLElement {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.options = {
|
||||||
|
content: this.innerHTML.trim().replace(/^(<br>)|(<br>)$/g, '') || '默认隐藏的内容'
|
||||||
|
};
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
render() {
|
||||||
|
this.innerHTML = this.options.content;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
window.customElements.define('joe-show', JoeShow);
|
||||||
|
/* 时间轴 */
|
||||||
|
class JoeTimeline extends HTMLElement {
|
||||||
|
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* *
|
||||||
|
* 私有化组件
|
||||||
|
* *
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* 网易云音乐 - 单首 */
|
||||||
|
class JoeMusic extends HTMLElement {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.options = {
|
||||||
|
id: this.getAttribute('id'),
|
||||||
|
width: this.getAttribute('width') || '100%',
|
||||||
|
height: this.getAttribute('height') || '86px',
|
||||||
|
autoplay: this.getAttribute('autoplay') ? 1 : 0
|
||||||
|
};
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
get template() {
|
||||||
|
return `
|
||||||
|
<style>
|
||||||
|
.container {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.container iframe {
|
||||||
|
display: block;
|
||||||
|
margin: 0 auto;
|
||||||
|
border: none;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div class="container">
|
||||||
|
<iframe src="//music.163.com/outchain/player?type=2&id=${this.options.id}&auto=${this.options.autoplay}&height=66" width="${this.options.width}" height="${this.options.height}"></iframe>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
render() {
|
||||||
|
this.innerHTML = '';
|
||||||
|
this._shadowRoot = this.attachShadow({ mode: 'closed' });
|
||||||
|
if (this.options.id) this._shadowRoot.innerHTML = this.template;
|
||||||
|
else this._shadowRoot.innerHTML = '网易云歌曲ID未填写!';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
window.customElements.define('joe-music', JoeMusic);
|
||||||
|
/* 网易云音乐 - 歌单 */
|
||||||
|
class JoeMlist extends HTMLElement {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.options = {
|
||||||
|
id: this.getAttribute('id'),
|
||||||
|
width: this.getAttribute('width') || '100%',
|
||||||
|
height: this.getAttribute('height') || '450px',
|
||||||
|
autoplay: this.getAttribute('autoplay') ? 1 : 0
|
||||||
|
};
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
get template() {
|
||||||
|
return `
|
||||||
|
<style>
|
||||||
|
.container {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.container iframe {
|
||||||
|
display: block;
|
||||||
|
margin: 0 auto;
|
||||||
|
border: none;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div class="container">
|
||||||
|
<iframe src="//music.163.com/outchain/player?type=0&id=${this.options.id}&auto=${this.options.autoplay}&height=430" width="${this.options.width}" height="${this.options.height}"></iframe>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
render() {
|
||||||
|
this.innerHTML = '';
|
||||||
|
this._shadowRoot = this.attachShadow({ mode: 'closed' });
|
||||||
|
if (this.options.id) this._shadowRoot.innerHTML = this.template;
|
||||||
|
else this._shadowRoot.innerHTML = '网易云歌单ID未填写!';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
window.customElements.define('joe-mlist', JoeMlist);
|
||||||
|
/* 回复可见 - 隐藏状态 */
|
||||||
|
class JoeHide extends HTMLElement {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
get template() {
|
||||||
|
return `
|
||||||
|
<style>
|
||||||
|
.container {
|
||||||
|
background: repeating-linear-gradient(145deg, var(--classD), var(--classD) 15px, var(--background) 0, var(--background) 25px);
|
||||||
|
padding: 15px 0;
|
||||||
|
text-align: center;
|
||||||
|
position: relative;
|
||||||
|
user-select: none;
|
||||||
|
line-height: normal;
|
||||||
|
}
|
||||||
|
.container i {
|
||||||
|
position: relative;
|
||||||
|
font-style: normal;
|
||||||
|
cursor: pointer;
|
||||||
|
color: var(--theme);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div class="container">
|
||||||
|
此处内容作者设置了 <i>回复</i> 可见
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
render() {
|
||||||
|
this.innerHTML = '';
|
||||||
|
this._shadowRoot = this.attachShadow({ mode: 'closed' });
|
||||||
|
this._shadowRoot.innerHTML = this.template;
|
||||||
|
this.event();
|
||||||
|
}
|
||||||
|
event() {
|
||||||
|
this.$button = this._shadowRoot.querySelector('i');
|
||||||
|
this.$button.addEventListener('click', () => {
|
||||||
|
const top = $('.joe_comment').offset().top - $('.joe_header').height() - 15;
|
||||||
|
window.scrollTo({ top, behavior: 'smooth' });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
window.customElements.define('joe-hide', JoeHide);
|
||||||
|
});
|
7
assets/js/joe.short.min.js
vendored
7
assets/js/joe.short.min.js
vendored
File diff suppressed because one or more lines are too long
@ -3,7 +3,7 @@
|
|||||||
/* 获取主题当前版本号 */
|
/* 获取主题当前版本号 */
|
||||||
function _getVersion()
|
function _getVersion()
|
||||||
{
|
{
|
||||||
return "5.5.6";
|
return "5.5.7";
|
||||||
};
|
};
|
||||||
|
|
||||||
/* 判断是否是手机 */
|
/* 判断是否是手机 */
|
||||||
|
@ -8,7 +8,11 @@ function _parseCommentReply($text)
|
|||||||
{
|
{
|
||||||
$text = _parseReply($text);
|
$text = _parseReply($text);
|
||||||
$text = preg_replace('/\{!{(.*?)\}!}/', '<img class="lazyload draw_image" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="$1" onerror="javascript: this.src=\'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\';" alt="画图"/>', $text);
|
$text = preg_replace('/\{!{(.*?)\}!}/', '<img class="lazyload draw_image" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="$1" onerror="javascript: this.src=\'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\';" alt="画图"/>', $text);
|
||||||
|
if (strip_tags($text)) {
|
||||||
echo $text;
|
echo $text;
|
||||||
|
} else {
|
||||||
|
echo "该回复疑似异常,已被系统拦截!";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 过滤表情 */
|
/* 过滤表情 */
|
||||||
@ -31,11 +35,24 @@ function _parseReply($text)
|
|||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 格式化留言回复 */
|
||||||
|
function _parseLeavingReply($text)
|
||||||
|
{
|
||||||
|
$text = _parseReply($text);
|
||||||
|
$text = preg_replace('/\{!\{(.*?)\}!\}/', '<img class="draw_image" src="$1" alt="画图"/>', $text);
|
||||||
|
$text = strip_tags($text);
|
||||||
|
if (!$text) $text = "该回复疑似异常,已被系统拦截!";
|
||||||
|
echo $text;
|
||||||
|
}
|
||||||
|
|
||||||
/* 格式化侧边栏回复 */
|
/* 格式化侧边栏回复 */
|
||||||
function _parseAsideReply($text, $type = true)
|
function _parseAsideReply($text, $type = true)
|
||||||
{
|
{
|
||||||
if ($type) echo _parseReply(preg_replace('~{!{.*~', '# 图片回复', strip_tags($text)));
|
$text = preg_replace('~{!{.*~', '# 图片回复', $text);
|
||||||
else echo preg_replace('~{!{.*~', '# 图片回复', strip_tags($text));
|
$text = strip_tags($text);
|
||||||
|
if (!$text) $text = "该回复疑似异常,已被系统拦截!";
|
||||||
|
if ($type) echo _parseReply($text);
|
||||||
|
else echo $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 过滤侧边栏最新回复的跳转链接 */
|
/* 过滤侧边栏最新回复的跳转链接 */
|
||||||
|
@ -66,5 +66,10 @@ function _parseContent($post, $login)
|
|||||||
$content = preg_replace('/{abtn(.*)}/SU', '<joe-abtn $1>', $content);
|
$content = preg_replace('/{abtn(.*)}/SU', '<joe-abtn $1>', $content);
|
||||||
$content = preg_replace('/{\/abtn}/SU', '</joe-abtn>', $content);
|
$content = preg_replace('/{\/abtn}/SU', '</joe-abtn>', $content);
|
||||||
}
|
}
|
||||||
|
/* 多彩按钮 */
|
||||||
|
if (strpos($content, '{timeline') !== false) {
|
||||||
|
$content = strtr($content, array("{timeline}" => '<joe-timeline>', "{/timeline}" => '</joe-timeline>'));
|
||||||
|
$content = strtr($content, array("{timeline-item}" => '<joe-timeline-item>', "{/timeline-item}" => '</joe-timeline-item>'));
|
||||||
|
}
|
||||||
echo $content;
|
echo $content;
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
<div class="joe_container">
|
<div class="joe_container">
|
||||||
<div class="joe_main">
|
<div class="joe_main">
|
||||||
<div class="joe_detail" data-cid="<?php echo $this->cid ?>">
|
<div class="joe_detail" data-cid="<?php echo $this->cid ?>">
|
||||||
|
<?php $this->need('public/batten.php'); ?>
|
||||||
<?php $this->need('public/article.php'); ?>
|
<?php $this->need('public/article.php'); ?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
57
leaving.php
Normal file
57
leaving.php
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 留言
|
||||||
|
*
|
||||||
|
* @package custom
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh-CN">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<?php $this->need('public/include.php'); ?>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/draggabilly@2.3.0/dist/draggabilly.pkgd.js"></script>
|
||||||
|
<script src="<?php $this->options->themeUrl('assets/js/joe.leaving.min.js'); ?>"></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="Joe">
|
||||||
|
<?php $this->need('public/header.php'); ?>
|
||||||
|
<div class="joe_container">
|
||||||
|
<div class="joe_main">
|
||||||
|
<div class="joe_detail" data-cid="<?php echo $this->cid ?>">
|
||||||
|
<?php $this->need('public/batten.php'); ?>
|
||||||
|
<div class="joe_detail__leaving">
|
||||||
|
<?php $this->comments()->to($comments); ?>
|
||||||
|
<?php if ($comments->have()) : ?>
|
||||||
|
<ul class="joe_detail__leaving-list">
|
||||||
|
<?php while ($comments->next()) : ?>
|
||||||
|
<li class="item">
|
||||||
|
<div class="user">
|
||||||
|
<img class="avatar lazyload" src="<?php _getAvatarLazyload(); ?>" data-src="<?php _getAvatarByMail($comments->mail) ?>" onerror="javascript: this.src = '<?php _getAvatarLazyload(); ?>'" alt="用户头像" />
|
||||||
|
<div class="nickname"><?php $comments->author(); ?></div>
|
||||||
|
<div class="date"><?php $comments->date('Y/m/d'); ?></div>
|
||||||
|
</div>
|
||||||
|
<div class="wrapper">
|
||||||
|
<div class="content"><?php _parseLeavingReply($comments->content); ?></div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<?php endwhile; ?>
|
||||||
|
</ul>
|
||||||
|
<?php else : ?>
|
||||||
|
<div class="joe_detail__leaving-none">暂无留言,期待第一个脚印。</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php $this->need('public/comment.php'); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php $this->need('public/footer.php'); ?>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
1
page.php
1
page.php
@ -16,6 +16,7 @@
|
|||||||
<div class="joe_container">
|
<div class="joe_container">
|
||||||
<div class="joe_main">
|
<div class="joe_main">
|
||||||
<div class="joe_detail" data-cid="<?php echo $this->cid ?>">
|
<div class="joe_detail" data-cid="<?php echo $this->cid ?>">
|
||||||
|
<?php $this->need('public/batten.php'); ?>
|
||||||
<?php $this->need('public/article.php'); ?>
|
<?php $this->need('public/article.php'); ?>
|
||||||
<?php $this->need('public/handle.php'); ?>
|
<?php $this->need('public/handle.php'); ?>
|
||||||
<?php $this->need('public/copyright.php'); ?>
|
<?php $this->need('public/copyright.php'); ?>
|
||||||
|
1
post.php
1
post.php
@ -35,6 +35,7 @@
|
|||||||
<div class="joe_container">
|
<div class="joe_container">
|
||||||
<div class="joe_main joe_post">
|
<div class="joe_main joe_post">
|
||||||
<div class="joe_detail" data-cid="<?php echo $this->cid ?>">
|
<div class="joe_detail" data-cid="<?php echo $this->cid ?>">
|
||||||
|
<?php $this->need('public/batten.php'); ?>
|
||||||
<?php $this->need('public/article.php'); ?>
|
<?php $this->need('public/article.php'); ?>
|
||||||
<?php $this->need('public/handle.php'); ?>
|
<?php $this->need('public/handle.php'); ?>
|
||||||
<?php $this->need('public/copyright.php'); ?>
|
<?php $this->need('public/copyright.php'); ?>
|
||||||
|
@ -1,44 +1,3 @@
|
|||||||
<?php if (sizeof($this->categories) > 0 || $this->user->uid == $this->authorId) : ?>
|
|
||||||
<div class="joe_detail__category">
|
|
||||||
<?php if (sizeof($this->categories) > 0) : ?>
|
|
||||||
<?php foreach (array_slice($this->categories, 0, 5) as $key => $item) : ?>
|
|
||||||
<a href="<?php echo $item['permalink']; ?>" class="item item-<?php echo $key ?>" title="<?php echo $item['name']; ?>"><?php echo $item['name']; ?></a>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php if ($this->user->uid == $this->authorId) : ?>
|
|
||||||
<?php if ($this->is('post')) : ?>
|
|
||||||
<a class="edit" target="_blank" rel="noopener noreferrer" href="<?php $this->options->adminUrl(); ?>write-post.php?cid=<?php echo $this->cid; ?>">编辑文章</a>
|
|
||||||
<?php else : ?>
|
|
||||||
<a class="edit" target="_blank" rel="noopener noreferrer" href="<?php $this->options->adminUrl(); ?>write-page.php?cid=<?php echo $this->cid; ?>">编辑页面</a>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<h1 class="joe_detail__title"><?php $this->title() ?></h1>
|
|
||||||
<div class="joe_detail__count">
|
|
||||||
<div class="joe_detail__count-information">
|
|
||||||
<img width="35" height="35" class="avatar lazyload" src="<?php _getAvatarLazyload(); ?>" data-src="<?php _getAvatarByMail($this->author->mail) ?>" onerror="javascript: this.src = '<?php _getAvatarLazyload(); ?>'" alt="<?php $this->author(); ?>" />
|
|
||||||
<div class="meta">
|
|
||||||
<div class="author">
|
|
||||||
<a class="link" href="<?php $this->author->permalink(); ?>" title="<?php $this->author(); ?>"><?php $this->author(); ?></a>
|
|
||||||
</div>
|
|
||||||
<div class="item">
|
|
||||||
<span class="text"><?php $this->date('Y-m-d'); ?></span>
|
|
||||||
<span class="line">/</span>
|
|
||||||
<span class="text"><?php $this->commentsNum('%d'); ?> 评论</span>
|
|
||||||
<span class="line">/</span>
|
|
||||||
<span class="text" id="Joe_Article_Views"><?php _getViews($this); ?> 阅读</span>
|
|
||||||
<span class="line">/</span>
|
|
||||||
<span class="text" id="Joe_Baidu_Record">正在检测是否收录...</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<time class="joe_detail__count-created" datetime="<?php $this->date('m/d'); ?>"><?php $this->date('m/d'); ?></time>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="joe_detail__article">
|
<div class="joe_detail__article">
|
||||||
<?php if (!$this->hidden && $this->fields->video) : ?>
|
<?php if (!$this->hidden && $this->fields->video) : ?>
|
||||||
<div class="joe_detail__article-video">
|
<div class="joe_detail__article-video">
|
||||||
@ -64,7 +23,10 @@
|
|||||||
<?php if ($this->hidden) : ?>
|
<?php if ($this->hidden) : ?>
|
||||||
<form class="joe_detail__article-protected" action="<?php echo Typecho_Widget::widget('Widget_Security')->getTokenUrl($this->permalink); ?>">
|
<form class="joe_detail__article-protected" action="<?php echo Typecho_Widget::widget('Widget_Security')->getTokenUrl($this->permalink); ?>">
|
||||||
<div class="contain">
|
<div class="contain">
|
||||||
<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M812.631 664.064H373.54a79.027 79.027 0 0 0-78.956 79.099v196.966h518.047a79.027 79.027 0 0 0 78.95-79.099V743.183a79.027 79.027 0 0 0-78.95-79.119z" fill="#F4CA1C"/><path d="M812.974 382.976h-32.369V313.37a272.256 272.256 0 1 0-544.512 0v69.606h-25.062A113.915 113.915 0 0 0 97.28 496.773v367.33A113.915 113.915 0 0 0 211.031 977.92h601.943A113.91 113.91 0 0 0 926.72 864.102V496.773a113.91 113.91 0 0 0-113.746-113.797zM305.715 313.37a202.634 202.634 0 1 1 405.269 0v69.606H305.715V313.37zm551.373 550.732a44.186 44.186 0 0 1-44.124 44.155H211.03a44.196 44.196 0 0 1-44.119-44.155V496.773a44.196 44.196 0 0 1 44.119-44.165h601.943a44.186 44.186 0 0 1 44.124 44.16v367.334zM525.373 554.138a62.7 62.7 0 0 0-34.816 114.82v103.46a34.816 34.816 0 1 0 69.632 0v-103.46a62.7 62.7 0 0 0-34.805-114.82z" fill="#595BB3"/></svg>
|
<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20">
|
||||||
|
<path d="M812.631 664.064H373.54a79.027 79.027 0 0 0-78.956 79.099v196.966h518.047a79.027 79.027 0 0 0 78.95-79.099V743.183a79.027 79.027 0 0 0-78.95-79.119z" fill="#F4CA1C" />
|
||||||
|
<path d="M812.974 382.976h-32.369V313.37a272.256 272.256 0 1 0-544.512 0v69.606h-25.062A113.915 113.915 0 0 0 97.28 496.773v367.33A113.915 113.915 0 0 0 211.031 977.92h601.943A113.91 113.91 0 0 0 926.72 864.102V496.773a113.91 113.91 0 0 0-113.746-113.797zM305.715 313.37a202.634 202.634 0 1 1 405.269 0v69.606H305.715V313.37zm551.373 550.732a44.186 44.186 0 0 1-44.124 44.155H211.03a44.196 44.196 0 0 1-44.119-44.155V496.773a44.196 44.196 0 0 1 44.119-44.165h601.943a44.186 44.186 0 0 1 44.124 44.16v367.334zM525.373 554.138a62.7 62.7 0 0 0-34.816 114.82v103.46a34.816 34.816 0 1 0 69.632 0v-103.46a62.7 62.7 0 0 0-34.805-114.82z" fill="#595BB3" />
|
||||||
|
</svg>
|
||||||
<input class="password" type="password" placeholder="请输入访问密码...">
|
<input class="password" type="password" placeholder="请输入访问密码...">
|
||||||
<button class="submit" type="submit">确定</button>
|
<button class="submit" type="submit">确定</button>
|
||||||
</div>
|
</div>
|
||||||
|
38
public/batten.php
Normal file
38
public/batten.php
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
<?php if (sizeof($this->categories) > 0 || $this->user->uid == $this->authorId) : ?>
|
||||||
|
<div class="joe_detail__category">
|
||||||
|
<?php if (sizeof($this->categories) > 0) : ?>
|
||||||
|
<?php foreach (array_slice($this->categories, 0, 5) as $key => $item) : ?>
|
||||||
|
<a href="<?php echo $item['permalink']; ?>" class="item item-<?php echo $key ?>" title="<?php echo $item['name']; ?>"><?php echo $item['name']; ?></a>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php if ($this->user->uid == $this->authorId) : ?>
|
||||||
|
<?php if ($this->is('post')) : ?>
|
||||||
|
<a class="edit" target="_blank" rel="noopener noreferrer" href="<?php $this->options->adminUrl(); ?>write-post.php?cid=<?php echo $this->cid; ?>">编辑文章</a>
|
||||||
|
<?php else : ?>
|
||||||
|
<a class="edit" target="_blank" rel="noopener noreferrer" href="<?php $this->options->adminUrl(); ?>write-page.php?cid=<?php echo $this->cid; ?>">编辑页面</a>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<h1 class="joe_detail__title"><?php $this->title() ?></h1>
|
||||||
|
<div class="joe_detail__count">
|
||||||
|
<div class="joe_detail__count-information">
|
||||||
|
<img width="35" height="35" class="avatar lazyload" src="<?php _getAvatarLazyload(); ?>" data-src="<?php _getAvatarByMail($this->author->mail) ?>" onerror="javascript: this.src = '<?php _getAvatarLazyload(); ?>'" alt="<?php $this->author(); ?>" />
|
||||||
|
<div class="meta">
|
||||||
|
<div class="author">
|
||||||
|
<a class="link" href="<?php $this->author->permalink(); ?>" title="<?php $this->author(); ?>"><?php $this->author(); ?></a>
|
||||||
|
</div>
|
||||||
|
<div class="item">
|
||||||
|
<span class="text"><?php $this->date('Y-m-d'); ?></span>
|
||||||
|
<span class="line">/</span>
|
||||||
|
<span class="text"><?php $this->commentsNum('%d'); ?> 评论</span>
|
||||||
|
<span class="line">/</span>
|
||||||
|
<span class="text" id="Joe_Article_Views"><?php _getViews($this); ?> 阅读</span>
|
||||||
|
<span class="line">/</span>
|
||||||
|
<span class="text" id="Joe_Baidu_Record">正在检测是否收录...</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<time class="joe_detail__count-created" datetime="<?php $this->date('m/d'); ?>"><?php $this->date('m/d'); ?></time>
|
||||||
|
</div>
|
BIN
screenshot.png
BIN
screenshot.png
Binary file not shown.
Before Width: | Height: | Size: 291 KiB After Width: | Height: | Size: 158 KiB |
@ -103,12 +103,12 @@ $(function () {
|
|||||||
title: '多彩按钮',
|
title: '多彩按钮',
|
||||||
id: 'wmd-abtn-button',
|
id: 'wmd-abtn-button',
|
||||||
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M360 651c-74.1 0-134.3-60.3-134.3-134.3 0-74.1 60.3-134.3 134.3-134.3s134.3 60.3 134.3 134.3c0 74-60.2 134.3-134.3 134.3zm0-204.6c-38.8 0-70.3 31.5-70.3 70.3S321.2 587 360 587s70.3-31.5 70.3-70.3-31.5-70.3-70.3-70.3z" fill="#9b9b9b"/><path d="M666.9 778.9H360c-70 0-135.9-27.3-185.4-76.8S97.8 586.7 97.8 516.7s27.3-135.9 76.8-185.4S290 254.5 360 254.5h306.9c70 0 135.9 27.3 185.4 76.8s76.8 115.4 76.8 185.4-27.3 135.9-76.8 185.4-115.3 76.8-185.4 76.8zM360 318.5c-109.3 0-198.2 88.9-198.2 198.2S250.7 714.9 360 714.9h306.9c109.3 0 198.2-88.9 198.2-198.2s-88.9-198.2-198.2-198.2H360z" fill="#9b9b9b"/></svg>'
|
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M360 651c-74.1 0-134.3-60.3-134.3-134.3 0-74.1 60.3-134.3 134.3-134.3s134.3 60.3 134.3 134.3c0 74-60.2 134.3-134.3 134.3zm0-204.6c-38.8 0-70.3 31.5-70.3 70.3S321.2 587 360 587s70.3-31.5 70.3-70.3-31.5-70.3-70.3-70.3z" fill="#9b9b9b"/><path d="M666.9 778.9H360c-70 0-135.9-27.3-185.4-76.8S97.8 586.7 97.8 516.7s27.3-135.9 76.8-185.4S290 254.5 360 254.5h306.9c70 0 135.9 27.3 185.4 76.8s76.8 115.4 76.8 185.4-27.3 135.9-76.8 185.4-115.3 76.8-185.4 76.8zM360 318.5c-109.3 0-198.2 88.9-198.2 198.2S250.7 714.9 360 714.9h306.9c109.3 0 198.2-88.9 198.2-198.2s-88.9-198.2-198.2-198.2H360z" fill="#9b9b9b"/></svg>'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '时间轴',
|
||||||
|
id: 'wmd-timeline-button',
|
||||||
|
svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="10" height="10"><path d="M312.584 565.872V444.936c33.752-14.064 56.248-45 56.248-81.56s-22.504-67.504-56.248-78.752V138.376c0-16.872-11.248-28.128-28.128-28.128s-28.128 11.248-28.128 28.128v146.248c-33.752 11.248-56.248 42.184-56.248 78.752s22.504 67.504 56.248 78.752v120.936c-33.752 11.248-56.248 42.184-56.248 78.752s22.504 67.504 56.248 78.752v149.064c0 16.872 11.248 28.128 28.128 28.128s28.128-11.248 28.128-28.128V723.376c33.752-11.248 56.248-42.184 56.248-78.752s-22.496-67.496-56.248-78.752zm-28.128-230.624c16.872 0 28.128 11.248 28.128 28.128s-11.248 28.128-28.128 28.128-28.128-11.248-28.128-28.128 11.256-28.128 28.128-28.128zm0 337.504c-16.872 0-28.128-11.248-28.128-28.128s11.248-28.128 28.128-28.128 28.128 11.248 28.128 28.128-11.248 28.128-28.128 28.128zm476.416 8H489.656c-16.952 0-33.904 11.248-33.904 28.128s13.56 28.128 33.904 28.128H760.88c16.952 0 33.904-11.248 33.904-28.128s-13.56-28.128-33.912-28.128zM828.696 287h-339.04c-16.952 0-33.904 11.248-33.904 28.128s13.56 28.128 33.904 28.128h339.04c16.944 0 33.896-11.248 33.896-28.128S849.032 287 828.696 287zm-67.824 168.752c16.952 0 33.904-11.248 33.904-28.128s-13.552-28.128-33.904-28.128H489.656c-16.952 0-33.904 11.248-33.904 28.128s13.56 28.128 33.904 28.128h271.216zm67.824 112.496h-339.04c-16.952 0-33.904 11.248-33.904 28.128s13.56 28.128 33.904 28.128h339.04c16.944 0 33.896-11.248 33.896-28.128s-13.56-28.128-33.896-28.128z" fill="#9b9b9b"/></svg>'
|
||||||
}
|
}
|
||||||
// {
|
|
||||||
// title: '时间轴',
|
|
||||||
// id: 'wmd-timeline-button',
|
|
||||||
// svg: '<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="10" height="10"><path d="M312.584 565.872V444.936c33.752-14.064 56.248-45 56.248-81.56s-22.504-67.504-56.248-78.752V138.376c0-16.872-11.248-28.128-28.128-28.128s-28.128 11.248-28.128 28.128v146.248c-33.752 11.248-56.248 42.184-56.248 78.752s22.504 67.504 56.248 78.752v120.936c-33.752 11.248-56.248 42.184-56.248 78.752s22.504 67.504 56.248 78.752v149.064c0 16.872 11.248 28.128 28.128 28.128s28.128-11.248 28.128-28.128V723.376c33.752-11.248 56.248-42.184 56.248-78.752s-22.496-67.496-56.248-78.752zm-28.128-230.624c16.872 0 28.128 11.248 28.128 28.128s-11.248 28.128-28.128 28.128-28.128-11.248-28.128-28.128 11.256-28.128 28.128-28.128zm0 337.504c-16.872 0-28.128-11.248-28.128-28.128s11.248-28.128 28.128-28.128 28.128 11.248 28.128 28.128-11.248 28.128-28.128 28.128zm476.416 8H489.656c-16.952 0-33.904 11.248-33.904 28.128s13.56 28.128 33.904 28.128H760.88c16.952 0 33.904-11.248 33.904-28.128s-13.56-28.128-33.912-28.128zM828.696 287h-339.04c-16.952 0-33.904 11.248-33.904 28.128s13.56 28.128 33.904 28.128h339.04c16.944 0 33.896-11.248 33.896-28.128S849.032 287 828.696 287zm-67.824 168.752c16.952 0 33.904-11.248 33.904-28.128s-13.552-28.128-33.904-28.128H489.656c-16.952 0-33.904 11.248-33.904 28.128s13.56 28.128 33.904 28.128h271.216zm67.824 112.496h-339.04c-16.952 0-33.904 11.248-33.904 28.128s13.56 28.128 33.904 28.128h339.04c16.944 0 33.896-11.248 33.896-28.128s-13.56-28.128-33.896-28.128z" fill="#9b9b9b"/></svg>'
|
|
||||||
// }
|
|
||||||
];
|
];
|
||||||
|
|
||||||
/* 用于设置插入到文章的短代码内容 */
|
/* 用于设置插入到文章的短代码内容 */
|
||||||
@ -172,6 +172,9 @@ $(function () {
|
|||||||
case 'wmd-abtn-button':
|
case 'wmd-abtn-button':
|
||||||
str = `{abtn icon="Font Awesome图标" color="颜色值" href="跳转地址" radius="圆角(最大17.5px)"}${$('#text').selectionRange() ? $('#text').selectionRange() : '多彩按钮'}{/abtn}`;
|
str = `{abtn icon="Font Awesome图标" color="颜色值" href="跳转地址" radius="圆角(最大17.5px)"}${$('#text').selectionRange() ? $('#text').selectionRange() : '多彩按钮'}{/abtn}`;
|
||||||
break;
|
break;
|
||||||
|
case 'wmd-timeline-button':
|
||||||
|
str = `\n{timeline}\n {timeline-item}时间轴内容{/timeline-item}\n {timeline-item}时间轴内容{/timeline-item}\n{/timeline}\n`;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
2
typecho/editor/js/joe.editor.min.js
vendored
2
typecho/editor/js/joe.editor.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user