跟香港

This commit is contained in:
杜恒 2021-04-22 16:30:13 +08:00
parent 593e236a02
commit 5a0250e586
16 changed files with 89 additions and 17 deletions

File diff suppressed because one or more lines are too long

View File

@ -2255,7 +2255,7 @@
padding: 12px;
border: 1px solid var(--classB);
border-left-width: 4px;
border-radius: 4px;
border-radius: var(--radius-inner);
color: var(--routine);
*:last-child {
margin-bottom: 0 !important;
@ -2268,7 +2268,7 @@
background: var(--background);
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
border: 1px solid var(--classC);
border-radius: 4px;
border-radius: var(--radius-inner);
.heads {
width: 100%;
overflow-x: auto;
@ -2316,6 +2316,23 @@
}
}
}
&-card_list {
display: block;
border: 1px solid var(--classC);
border-radius: var(--radius-inner);
overflow: hidden;
.item {
padding: 12px 15px;
border-bottom: 1px solid var(--classC);
&:last-child {
border-bottom: none;
}
*:last-child {
margin-bottom: 0 !important;
}
}
}
/* 以下未测试 */
&-protected {

View File

@ -315,6 +315,28 @@ document.addEventListener('DOMContentLoaded', () => {
}
}
window.customElements.define('joe-tabs', JoeTabs);
class JoeCardList extends HTMLElement {
constructor() {
super();
const _temp = this.querySelector('._temp');
let _innerHTML = _temp.innerHTML.trim().replace(/^(<br>)|(<br>)$/g, '');
let content = '';
_innerHTML.replace(/{card-list-item}([\s\S]*?){\/card-list-item}/g, function ($0, $1) {
content += `<div class="item">${$1.trim().replace(/^(<br>)|(<br>)$/g, '')}</div>`;
});
let htmlStr = `<span class="joe_detail__article-card_list">${content}</span>`;
if (this.querySelector('._content')) {
this.querySelector('._content').innerHTML = htmlStr;
} else {
const span = document.createElement('span');
span.className = '_content';
span.style.display = 'block';
span.innerHTML = htmlStr;
this.appendChild(span);
}
}
}
window.customElements.define('joe-card-list', JoeCardList);
$('.joe_detail__article p:empty').remove();
/*

File diff suppressed because one or more lines are too long

View File

@ -50,7 +50,7 @@ class Editor
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-tomorrow.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="<?php Helper::options()->themeUrl('typecho/write/css/joe.write.min.css?v=2021042215') ?>">
<link rel="stylesheet" href="<?php Helper::options()->themeUrl('typecho/write/css/joe.write.min.css?v=2021042216') ?>">
<script>
window.JoeConfig = {
uploadAPI: '<?php Helper::security()->index('/action/upload'); ?>',
@ -65,9 +65,9 @@ class Editor
</script>
<script src="https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/typecho-joe-next@6.2.4/plugin/prism/prism.min.js"></script>
<script src="<?php Helper::options()->themeUrl('typecho/write/js/joe.parse.min.js?v=2021042215') ?>"></script>
<script src="<?php Helper::options()->themeUrl('typecho/write/js/joe.write.chunk.js?v=2021042215') ?>"></script>
<script src="<?php Helper::options()->themeUrl('assets/js/joe.short.min.js?v=2021042215') ?>"></script>
<script src="<?php Helper::options()->themeUrl('typecho/write/js/joe.parse.min.js?v=2021042216') ?>"></script>
<script src="<?php Helper::options()->themeUrl('typecho/write/js/joe.write.chunk.js?v=2021042216') ?>"></script>
<script src="<?php Helper::options()->themeUrl('assets/js/joe.short.min.js?v=2021042216') ?>"></script>
<?php
}
}

View File

@ -2,7 +2,7 @@
/* 获取主题当前版本号 */
function _getVersion()
{
return "6.5.6";
return "6.5.7";
};
/* 判断是否是手机 */

View File

@ -61,6 +61,9 @@ function _parseContent($post, $login)
if (strpos($content, '{tabs') !== false) {
$content = preg_replace('/{tabs}([\s\S]*?){\/tabs}/', '<section style="margin-bottom: 15px"><joe-tabs><span class="_temp" style="display: none">$1</span></joe-tabs></section>', $content);
}
if (strpos($content, '{card-list') !== false) {
$content = preg_replace('/{card-list}([\s\S]*?){\/card-list}/', '<section style="margin-bottom: 15px"><joe-card-list><span class="_temp" style="display: none">$1</span></joe-card-list></section>', $content);
}

View File

@ -1,6 +1,6 @@
{
"name": "typecho-joe-next",
"version": "6.5.6",
"version": "6.5.7",
"description": "A Theme Of Typecho",
"main": "index.php",
"keywords": [

View File

@ -18,7 +18,7 @@
<?php endif; ?>
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/joe.mode.min.css'); ?>">
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/joe.normalize.min.css'); ?>">
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/joe.global.min.css?v=2021042215'); ?>">
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/joe.global.min.css?v=2021042216'); ?>">
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/joe.responsive.min.css'); ?>">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/typecho-joe-next@6.0.0/plugin/qmsg/qmsg.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
@ -40,6 +40,6 @@
<?php if ($this->options->JCursorEffects && $this->options->JCursorEffects !== 'off') : ?>
<script src="<?php $this->options->themeUrl('assets/cursor/' . $this->options->JCursorEffects); ?>" async></script>
<?php endif; ?>
<script src="<?php $this->options->themeUrl('assets/js/joe.global.min.js?v=2021042215'); ?>"></script>
<script src="<?php $this->options->themeUrl('assets/js/joe.short.min.js?v=2021042215'); ?>"></script>
<script src="<?php $this->options->themeUrl('assets/js/joe.global.min.js?v=2021042216'); ?>"></script>
<script src="<?php $this->options->themeUrl('assets/js/joe.short.min.js?v=2021042216'); ?>"></script>
<?php $this->options->JCustomHeadEnd() ?>

File diff suppressed because one or more lines are too long

View File

@ -994,6 +994,22 @@ body.fullscreen {
}
}
}
.joe_detail__article-card_list {
display: block;
border: 1px solid #ebeef5;
border-radius: 4px;
overflow: hidden;
.item {
padding: 12px 15px;
border-bottom: 1px solid #ebeef5;
&:last-child {
border-bottom: none;
}
*:last-child {
margin-bottom: 0 !important;
}
}
}
@media (max-width: 768px) {
.cm-modal__wrapper {

View File

@ -725,4 +725,9 @@ export default class JoeAction {
this._replaceSelection(cm, str);
cm.focus();
}
handleCardList(cm) {
const str = `${this._getLineCh(cm) ? '\n\n' : '\n'}{card-list}\n{card-list-item}\n 列表一内容\n{/card-list-item}\n{card-list-item}\n 列表二内容\n{/card-list-item}\n{/card-list}\n\n`;
this._replaceSelection(cm, str);
cm.focus();
}
}

View File

@ -33,6 +33,7 @@ export default function createPreviewHtml(str) {
str = str.replace(/{card-default([^}]*)}([\s\S]*?){\/card-default}/g, '<section style="margin-bottom: 15px"><joe-card-default $1><span class="_temp" style="display: none">$2</span></joe-card-default></section>');
str = str.replace(/{callout([^}]*)}([\s\S]*?){\/callout}/g, '<section style="margin-bottom: 15px"><joe-callout $1><span class="_temp" style="display: none">$2</span></joe-callout></section>');
str = str.replace(/{tabs}([\s\S]*?){\/tabs}/g, '<section style="margin-bottom: 15px"><joe-tabs><span class="_temp" style="display: none">$1</span></joe-tabs></section>');
str = str.replace(/{card-list}([\s\S]*?){\/card-list}/g, '<section style="margin-bottom: 15px"><joe-card-list><span class="_temp" style="display: none">$1</span></joe-card-list></section>');
$('.cm-preview-content').html(str);
$('.cm-preview-content p:empty').remove();

View File

@ -190,6 +190,11 @@ export default [
title: '标签页',
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M904 788c4.31 0 7.853 2.735 8 6.12v63.548c0 3.412-3.455 6.216-7.732 6.33L904 864H120c-4.31 0-7.853-2.735-8-6.12v-63.548c0-3.412 3.455-6.216 7.732-6.33L120 788h784zm0-192c4.31 0 7.853 2.735 8 6.12v63.548c0 3.412-3.455 6.216-7.732 6.33L904 672H120c-4.31 0-7.853-2.735-8-6.12v-63.548c0-3.412 3.455-6.216 7.732-6.33L120 596h784zm-8-436c8.837 0 16 7.163 16 16v288c0 8.837-7.163 16-16 16H608c-8.837 0-16-7.163-16-16V176c0-8.837 7.163-16 16-16h288zm-384 0c8.695 0 15.828 7.03 16 15.686V464c0 8.695-7.03 15.828-15.686 16H128c-8.695 0-15.828-7.03-16-15.686V176c0-8.695 7.03-15.828 15.686-16H512zm-56 72H184v176h272V232z"/></svg>'
},
{
type: 'card-list',
title: '卡片列表',
innerHTML: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M359.79 156.52L189.31 330.2a68.454 68.454 0 0 0-19.6 47.95v444.68c0 37.8 30.65 68.45 68.46 68.45h547.66c37.81 0 68.46-30.65 68.46-68.45V200.77c0-37.8-30.65-68.45-68.46-68.45h-.67l-377.19 3.7a68.458 68.458 0 0 0-48.18 20.5zm-48.86-47.95a136.921 136.921 0 0 1 96.37-41l377.19-3.7c.67-.01.67-.01 1.34-.01 75.62 0 136.92 61.29 136.92 136.9v622.06c0 75.61-61.3 136.9-136.92 136.9H238.17c-75.62 0-136.92-61.29-136.92-136.9V378.15c0-35.86 14.08-70.3 39.2-95.89l170.48-173.69z"/><path d="M683.04 353.45v34.12c0 9.42-7.66 17.06-17.1 17.06H358.07c-9.45 0-17.1-7.64-17.1-17.06v-34.12c0-9.42 7.66-17.06 17.1-17.06h307.86c9.45 0 17.11 7.64 17.11 17.06zm0 171.47v34.12c0 9.42-7.66 17.06-17.1 17.06H358.07c-9.45 0-17.1-7.64-17.1-17.06v-34.12c0-9.42 7.66-17.06 17.1-17.06h307.86c9.45 0 17.11 7.64 17.11 17.06zM545.68 695.96v34.12c0 9.42-7.64 17.06-17.06 17.06h-170.6c-9.42 0-17.06-7.64-17.06-17.06v-34.12c0-9.42 7.64-17.06 17.06-17.06h170.6c9.42 0 17.06 7.63 17.06 17.06z"/></svg>'
},
/* --------------------------- 短代码结束 --------------------------- */
{
type: 'clean',

File diff suppressed because one or more lines are too long

View File

@ -315,6 +315,9 @@ class Joe extends JoeAction {
case 'tabs':
super.handleTabs(this.cm);
break;
case 'card-list':
super.handleCardList(this.cm);
break;
case 'preview':
el.toggleClass('active');
if (el.hasClass('active')) window.JoeConfig.canPreview = true;