67 Commits
dev ... master

Author SHA1 Message Date
Copilot
4079a64a88 修复 PHP 8.5 中 curl_close() 弃用警告 (#1924)
* Initial plan

* 移除 curl_close() 调用以修复 PHP 8.5 弃用警告

Co-authored-by: joyqi <59437+joyqi@users.noreply.github.com>

* 使用 PHP 版本检查兼容 PHP 7.4 的 curl_close 处理

Co-authored-by: joyqi <59437+joyqi@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: joyqi <59437+joyqi@users.noreply.github.com>
2025-11-27 11:37:42 +08:00
猫东东
9364388035 修复 PHP 8.4+ 中 PDO::MYSQL_ATTR_USE_BUFFERED_QUERY 的弃用警告 (#1922) 2025-11-27 09:05:18 +08:00
Luffy
7a3c86a110 Support connect to mysql using socket (#1749)
* Support connect to mysql using socket

* pgsql can also use unix_socket

fix Deprecated: pg_escape_string(): Automatic fetching of PostgreSQL connection

* Update install.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update var/Typecho/Db/Adapter/Mysqli.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix quoteValue method to correctly escape single quotes in strings

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-20 23:55:43 +08:00
Luffy
15967ea059 Fix login failed when username contains @ (#1894)
* Fix login failed when username contains @

* Update var/Widget/User.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-20 17:17:31 +08:00
Luffy
570f982709 Add 'NOT' to query keywords (#1903) 2025-11-19 22:28:13 +08:00
Luffy
6dbcdf7eae Fix explicitly declare nullable type for $rules parameter (#1908) 2025-08-08 12:09:21 +08:00
joyqi
5e7e10969e fix default theme's i18n problem https://github.com/typecho/languages/issues/49 2025-08-05 11:01:31 +08:00
joyqi
3d261e08b9 fix: don't send ping back to self 2025-08-01 18:04:18 +08:00
joyqi
546470b2de update hyperdown 2025-07-04 15:10:18 +08:00
joyqi
23cdc89441 fix #1882 (#1883) 2025-06-27 11:12:45 +08:00
Luffy
d9d0be334d Update canonical link condition (#1881) 2025-06-11 16:39:39 +08:00
joyqi
ba4e4134ad fix form validate error 2025-06-05 15:10:47 +08:00
joyqi
7ef2c08a96 fix validate error 2025-06-05 15:09:03 +08:00
joyqi
db8a3f7f3e fix nullable parameter error 2025-06-05 14:34:22 +08:00
joyqi
5ef475b73f feat: validate via regexp (#1877) 2025-05-12 23:40:38 +08:00
joyqi
917a763811 Feat/improve styles (#1868)
* improve css

* fix table

* fix write page

* improve header nav

* fix menu

* fix menu

* fix menu

* add flex grid system

* fix

* fix flex

* fix draft version

* using main html element to replace div

* improve css

* add input type number

* fix custom-fields

* fix screen
2025-05-09 16:12:56 +08:00
Robert Silén
50d572a0af Add MariaDB to README.md (#1827) 2025-02-19 10:50:05 +08:00
Luffy
752fc6b0ad Fix missing nameExists and mailExists (#1854) 2025-02-03 10:47:29 +08:00
Luffy
95f6e7b4f5 Remove debug output from category selection in Archive widget (#1852) 2025-02-03 10:40:12 +08:00
Pomelo_Official
67a830f86b fix typo "稍侯" to "稍候" (#1850)
fix typo "稍侯" to "稍候"
2025-01-31 13:35:15 +08:00
Luffy
8ff55f5266 Fix #1846 (#1847) 2025-01-14 21:56:48 +08:00
joyqi
8035b22347 fix #1843 (#1844)
* fix #1843
Remove categroy name-exists detecting

* detect category-exists only in the same level
2025-01-13 16:48:46 +08:00
joyqi
b989f24c5b Fix/1754 (#1842)
* add deprecated methods

* fix #1754
2025-01-11 17:51:29 +08:00
joyqi
23724c4193 fix #1830 (#1841) 2025-01-10 14:53:47 +08:00
joyqi
6ddf1c1a23 fix #1816 (#1839)
* fix #1816

* fix call stack

* fix typo error
2025-01-07 19:42:15 +08:00
Luffy
7d51b210c9 Fix manage comments failed (#1838) 2025-01-04 12:45:16 +08:00
Mr. Chip
91876b42aa Fix: fix preg_match parameter#2 $subject is null deprecated issue (#1798) 2024-09-23 10:49:47 +08:00
Luffy
5783cb0d01 fix sendPingHandle warning (#1808) 2024-09-23 10:48:19 +08:00
ZShijun
87d479dd57 Update Login.php (#1804)
修复勾选下次自动登录,但重启浏览器不生效的bug
2024-09-11 10:59:32 +08:00
Luffy
ef9ef2ce45 Require PHP 7.4.0 or higher (#1785) 2024-07-24 15:51:19 +08:00
陆之岇
31f5192c9d Fix timezone error in XmlRpc (#1758)
Signed-off-by: Kraity <kraity@krait.cn>
2024-06-20 11:22:51 +08:00
Luffy
4ce9cdefc2 Fix TypeError: Typed property Typecho\Feed::$subTitle must be string (#1779) 2024-06-12 10:47:06 +08:00
Luffy
0b0476e565 Fix missing WidgetException error message (#1730) 2024-04-19 12:11:39 +08:00
Fen
71c6381b15 fix: nav menu active style (#1752) 2024-03-29 11:38:30 +08:00
Fen
fa107ffa51 update picocss to 2.0 (#1751) 2024-03-28 15:37:19 +08:00
Luffy
d84e261f7b Fix missing get date (#1740) 2024-02-28 10:57:47 +08:00
Luffy
3933a23ad7 Fix assign null to property Widget\Archive::$archiveKeywords (#1738)
* Fix assign null to property Widget\Archive::$archiveKeywords

* Fix
2024-02-26 11:52:17 +08:00
fen
0a40b1e7ee improve: comment color 2024-01-29 16:32:38 +08:00
Lu Fei
bda7541682 Limit build execution (#1723) 2024-01-29 12:05:30 +08:00
joyqi
f3a5336c1a Remove comment link if status is not approved (#1712)
* remove comment link if status is not approved

* fix stack

* fix: remove link in admin panel when comment status is not approved

* fix: comments page nav

* fix comment redirect url

* fix comment anchor

* fix waiting comment display

* fix: convert waiting to unapproved
2024-01-25 14:24:47 +08:00
Lu Fei
d1e961af90 Upgrade actions/checkout to v4 (#1718) 2024-01-24 02:18:19 +08:00
joyqi
e3bdef645d fix: remove unnecessary DOCTYPE tags (#1715) 2024-01-23 18:30:17 +08:00
joyqi
de53b64880 fix: remove special chars (#1716) 2024-01-23 18:29:59 +08:00
joyqi
d0b62eabe9 fix: xmlrpc message args (#1714) 2024-01-22 14:36:10 +08:00
Fen
99ffd36648 Fix/classic22 (#1708)
* fix: use prefers-color-scheme control dark mode

* update color
2024-01-15 10:56:47 +08:00
电脑星人
4028d7d160 fix: getHeader for Content-Type & Content-Length (#1703)
* fix: Request::getHeader for Content-Type & Content-Length

* fix: get content-type through native api

---------

Co-authored-by: joyqi <joyqi@users.noreply.github.com>
2024-01-13 22:11:38 +08:00
joyqi
a30a6c122d fix: choose the correct key when setting widget value (#1702) 2024-01-10 15:37:05 +08:00
Fen
0d28025bf4 update issue template 2024-01-10 12:58:20 +08:00
Fen
8b75782619 update issue template (#1700) 2024-01-10 12:45:24 +08:00
Fen
c5ab9295f0 Fix/classic 22 (#1698)
* style: move customize color to theme.css
2024-01-09 16:33:40 +08:00
Lu Fei
c816efa26e fix trim error (#1697) 2024-01-09 14:56:25 +08:00
joyqi
7115a30301 fix attachment handle (#1696)
* fix #1694

* fix array dump

* add toColumn method
2024-01-09 14:31:15 +08:00
LibXZR
db5d8694c4 Fix unable to show attachment parent in manage-medias (#1693) 2024-01-08 22:56:39 +08:00
Fen
2051c040ec Fix/classic 22 (#1690)
* fix: auto dark mode

* improve: pagenav style, theme color

* improve: color schema name

* fix: icon color

* improve: page navigation style
2024-01-07 13:47:59 +08:00
joyqi
13282b5b84 fix undefined array key (#1688)
* fix undefined array key

* fix: change security email
2024-01-07 11:38:39 +08:00
Fen
af281422d3 update theme classic-22 color schema (#1689)
* fix: auto dark mode

* improve: pagenav style, theme color

* improve: color schema name

* fix: icon color
2024-01-07 00:39:10 +08:00
LibXZR
68026e0fbc Fix unable to preview revisions (#1687)
* Fix unable to preview revisions

* Improve revision preview fix

Co-authored-by: joyqi <joyqi@users.noreply.github.com>

---------

Co-authored-by: joyqi <joyqi@users.noreply.github.com>
2024-01-06 23:33:11 +08:00
joyqi
a9fa990124 replace str compare (#1685) 2024-01-06 12:20:41 +08:00
Lu Fei
9635a7a0ba Optimize applySlug (#1684)
* Optimize applySlug

* optimize code

* fix: more rigorous judgment

* improve slug generating

---------

Co-authored-by: joyqi <joyqi@segmentfault.com>
2024-01-05 15:55:34 +08:00
Lu Fei
9396eef2f9 Remove useless code (#1683) 2024-01-05 11:27:13 +08:00
Fen
cec6b9c62b update theme classic-22 (#1682)
* Add feed widget

* add feed render

* Add CommentPage widget

* New theme (#1390)

* 调整忽略目录

* add theme

* fix theme scss build

Co-authored-by: fen <f3nb0x@gmail.com>

* s/is_writeable/is_writable/g

* New upgrade method

* merge new fixes from master

* add pgsql ssl mode support (ref #1600) (#1623)

* Feat/code refactor (#1626)

* remove all magic methods, add type for class properties

* refactor codes

* fix all

* refactor code

* fix type

* fix all

* fix request is method

* fix all

* fix router

* fix get page

* fix 1.3.0 upgrade

* [feat] support high resolution avatar

* fix types in i18n component

* Implement Ctrl+S or Command+S for save draft (#1628)

* Implement Ctrl+S or Command+S for save draft

* rename

* add Typecho.savePost

* fix upload file size

* add new uploader

* replace new uploader

* fix textarea change

* fix preview

* refactor post edit

* fix issue

* fix page edit

---------

Co-authored-by: joyqi <joyqi@segmentfault.com>
Co-authored-by: joyqi <magike.net@gmail.com>

* fix #1632

* Add svg to image types

* Feat/tree pages (#1646)

* add tree trait

* finish category tree trait

* support select fields

* fix select fields

* refactor admin trait

* fix draft status

* Add new contents type "revision"

* minor refactor

* add more tree view abstracts

* add tree trait to pages

* get ready for tree view pages

* improve page edit

* fix revision

* fix slug

* add router params delegate

* fix params delegate

* fix

* fix

* fix all

* fix all

* fix tree

* fix page link

* fix feed

* fix page

* fix permalink

* fix permalink input

* fix offset query

* Support IDN (#1629)

* Support IDN

* use js

* Optimize code

* Optimize code

* fix URL script

* remove unnecessary use

---------

Co-authored-by: joyqi <joyqi@segmentfault.com>

* fix input element

* fix #1651, close #1653

* Use json instead of serialize (#1624)

* Use json instead of serialize

* Fix Upgrade code

* add tree trait

* finish category tree trait

* support select fields

* fix select fields

* refactor admin trait

* fix draft status

* Add new contents type "revision"

* minor refactor

* add more tree view abstracts

* add tree trait to pages

* get ready for tree view pages

* improve page edit

* fix revision

* fix slug

* add router params delegate

* fix params delegate

* fix

* fix

* fix all

* fix all

* fix tree

* fix page link

* fix feed

* fix page

* fix permalink

* fix permalink input

* fix offset query

* Fix typo

* remove proxy methods

* remove unnecessary useage

---------

Co-authored-by: joyqi <joyqi@segmentfault.com>
Co-authored-by: joyqi <magike.net@gmail.com>

* Fix Prevent XSS vulnerability in default theme (#1654)

* Fix Prevent XSS vulnerability in default theme

* Update var/Typecho/Db/Adapter/Pdo.php

* fix the getter

---------

Co-authored-by: joyqi <joyqi@segmentfault.com>

* add throwCallback to widget response

* fix: cut down fields when selecting recent posts

* fix typo errors

* fix typo errors

* fix http client cookie

* add throw finish

* fix theme lang

* fix default theme

* fix query

* add open graph and twitter card support
add canonical link

* fix canonical link meta

* fix theme classic-22

* remove unnecessary scss file when packaging

* init plugin signal

* improve: remove feather-icon js file

* fix: typo

* improve: post detail layout

* fix tags saving

* improve: nav search

* fix: theme screenshot

* fix: theme page layout

* remove php 7.2/7.3 env

* feat: pull request auto merge

* fix permission

* improve: comment style

* fix: search result

* improve: show site description in homepage title

---------

Co-authored-by: joyqi <magike.net@gmail.com>
Co-authored-by: joyqi <joyqi@users.noreply.github.com>
Co-authored-by: joyqi <joyqi@segmentfault.com>
Co-authored-by: Lu Fei <52o@qq52o.cn>
2024-01-05 00:11:38 +08:00
joyqi
f23e825b95 fix router 2024-01-04 23:13:16 +08:00
joyqi
1c3b86fc22 fix #1679 (#1680)
Detect the insertion point of reply form automatically.
2024-01-04 22:47:15 +08:00
Fen
540dbb3b21 Create SECURITY.md 2024-01-04 17:12:29 +08:00
joyqi
81ad2232bf fix #1671 (#1678) 2024-01-04 11:13:36 +08:00
Lu Fei
d520a556cf fix style error for code (#1677) 2024-01-02 13:47:29 +08:00
joyqi
77aebcbd0e fix #1674 (#1676) 2024-01-02 11:16:44 +08:00
146 changed files with 3606 additions and 3262 deletions

View File

@@ -1,14 +0,0 @@
### 1. 该问题的重现步骤是什么?
### 2. 你期待的结果是什么?实际看到的又是什么?
### 3. 问题出现的环境
- 操作系统版本:
- Apache/NGINX 版本:
- 数据库版本:
- PHP 版本:
- Typecho 版本:
- 浏览器版本:
[//]: # (如有图片请附上截图)

42
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,42 @@
---
name: 上报 BUG
about: 报告问题,帮助改进项目
title: ''
labels: bug
assignees: ''
---
## 描述这个 Bug
简明扼要地描述错误是什么。
### 复现方式
复现的步骤:
1. 前往 '...'
2. 点击 '....'
3. 滚动到 '....'
4. 看到错误
### 期望的结果
简明扼要地描述你期望看到的结果。
### 截图
如果可以的话,请添加截图或视频以帮助解释你的问题。
### 平台
- 操作系统版本:
- Apache/Nginx 版本:
- 数据库版本:
- PHP 版本:
- Typecho 版本:
- 浏览器版本:

5
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: 论坛支持
url: https://forum.typecho.org/
about: 交流使用心得,使用模板插件,寻求帮助等等

View File

@@ -0,0 +1,23 @@
---
name: 提改进建议
about: 提出改进建议,改进项目现有功能
title: ''
labels: enhancement
assignees: ''
---
## 你的改进是否与某个问题有关?请描述
简明扼要地描述问题产生的原因。例如:当 [...] 时,我总是很困惑。
## 描述你想要的解决方案
简明扼要地描述你希望的解决方案。
## 描述你考虑过的替代方案
简明扼要地描述你考虑过的任何替代解决方案或功能。

View File

@@ -0,0 +1,23 @@
---
name: 新功能提议
about: 为项目提出一个想法或可能的新功能
title: ''
labels: feature
assignees: ''
---
## 你的想法是否与某个问题有关?请描述
简明扼要地描述问题产生的原因。例如:当 [...] 时,我总是很困惑。
## 描述你想要的解决方案
简明扼要地描述你希望的解决方案。
## 描述你考虑过的替代方案
简明扼要地描述你考虑过的任何替代解决方案或功能。

View File

@@ -0,0 +1,7 @@
Fixes #
## Proposed Changes
-
-
-

View File

@@ -19,7 +19,7 @@ jobs:
php: ['7.4', '8.0', '8.1', '8.2']
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup PHP only
uses: shivammathur/setup-php@v2
with:
@@ -30,12 +30,12 @@ jobs:
build:
name: Typecho Build
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, 'skip ci') && github.event_name != 'pull_request' }}
if: ${{ !contains(github.event.head_commit.message, 'skip ci') && github.event_name != 'pull_request' && github.repository == 'typecho/typecho' }}
needs:
- php
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Build
run: |
mkdir build

View File

@@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Build
run: |
mkdir build

0
.gitmodules vendored
View File

View File

@@ -6,7 +6,7 @@ Typecho is released under the GNU General Public License 2.0.
## Main Features
* Multiple databases support (MySQL, SQLite, PostgreSQL)
* Multiple databases support (MariaDB, MySQL, SQLite, PostgreSQL)
* Markdown Support
* Plugin Support
* Theme Support
@@ -15,9 +15,9 @@ Typecho is released under the GNU General Public License 2.0.
## Requirements
* PHP 7.2.0 or higher
* Database (MySQL, SQLite, PostgreSQL)
* MySQL 5.5.3 or higher
* PHP 7.4.0 or higher
* Database (MariaDB, MySQL, SQLite, PostgreSQL)
* MariaDB or MySQL 5.5.3 or higher
* SQLite 3.7.11 or higher
* PostgreSQL 9.1 or higher

3
SECURITY.md Normal file
View File

@@ -0,0 +1,3 @@
# Security Policy
Vulnerabilities can be reported by emailing security@typecho.org

View File

@@ -10,7 +10,7 @@ $actionUrl = $security->getTokenUrl(
$backupFiles = \Widget\Backup::alloc()->listFiles();
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="main">
@@ -31,7 +31,7 @@ $backupFiles = \Widget\Backup::alloc()->listFiles();
<div id="backup-secondary" class="col-mb-12 col-tb-4" role="form">
<h3><?php _e('恢复数据'); ?></h3>
<ul class="typecho-option-tabs clearfix">
<ul class="typecho-option-tabs">
<li class="active w-50"><a href="#from-upload"><?php _e('上传'); ?></a></li>
<li class="w-50"><a href="#from-server"><?php _e('从服务器'); ?></a></li>
</ul>
@@ -79,7 +79,7 @@ $backupFiles = \Widget\Backup::alloc()->listFiles();
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -4,7 +4,7 @@ include 'header.php';
include 'menu.php';
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="form">
@@ -13,7 +13,7 @@ include 'menu.php';
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -25,31 +25,10 @@
if (head.length > 0) {
p.insertAfter(head);
offset = head.outerHeight();
} else {
p.prependTo(document.body);
}
function checkScroll () {
if ($(window).scrollTop() >= offset) {
p.css({
'position' : 'fixed',
'top' : 0
});
} else {
p.css({
'position' : 'absolute',
'top' : offset
});
}
}
$(window).scroll(function () {
checkScroll();
});
checkScroll();
p.slideDown(function () {
var t = $(this), color = '#C6D880';
@@ -75,50 +54,6 @@
}
})();
// 导航菜单 tab 聚焦时展开下拉菜单
const menuBar = $('.menu-bar').click(function () {
const nav = $(this).next('#typecho-nav-list');
if (!$(this).toggleClass('focus').hasClass('focus')) {
nav.removeClass('expanded noexpanded');
}
});
$('.main, .typecho-foot').on('click touchstart', function () {
if (menuBar.hasClass('focus')) {
menuBar.trigger('click');
}
});
$('#typecho-nav-list ul.root').each(function () {
const ul = $(this), nav = ul.parent();
let focused = false;
ul.on('click touchend', '.parent a', function (e) {
nav.removeClass('noexpanded').addClass('expanded');
if ($(window).width() < 576 && e.type == 'click') {
return false;
}
}).find('.child')
.append($('<li class="return"><a><?php _e('返回'); ?></a></li>').click(function () {
nav.removeClass('expanded').addClass('noexpanded');
return false;
}));
$('a', ul).focus(function () {
ul.addClass('expanded');
focused = true;
}).blur(function () {
focused = false;
setTimeout(function () {
if (!focused) {
ul.removeClass('expanded');
}
});
});
});
if ($('.typecho-login').length == 0) {
$('a').each(function () {
var t = $(this), href = t.attr('href');

View File

@@ -1,5 +1,5 @@
<?php if(!defined('__TYPECHO_ADMIN__')) exit; ?>
<div class="typecho-foot" role="contentinfo">
<footer class="typecho-foot" role="contentinfo">
<div class="copyright">
<a href="https://typecho.org" class="i-logo-s">Typecho</a>
<p><?php _e('由 <a href="https://typecho.org">%s</a> 强力驱动, 版本 %s', $options->software, $options->version); ?></p>
@@ -10,4 +10,4 @@
<a href="https://github.com/typecho/typecho/issues"><?php _e('报告错误'); ?></a> &bull;
<a href="https://typecho.org/download"><?php _e('资源下载'); ?></a>
</nav>
</div>
</footer>

File diff suppressed because one or more lines are too long

View File

@@ -11,6 +11,7 @@
html {
line-height: 1.15; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
-moz-text-size-adjust: 100%; /* 2 */
}
/* Sections

File diff suppressed because one or more lines are too long

View File

@@ -2,21 +2,10 @@
<script>
$(document).ready(function () {
// 自定义字段
$('#custom-field-expand').click(function() {
var btn = $('i', this);
if (btn.hasClass('i-caret-right')) {
btn.removeClass('i-caret-right').addClass('i-caret-down');
} else {
btn.removeClass('i-caret-down').addClass('i-caret-right');
}
$(this).parent().toggleClass('fold');
return false;
});
function attachDeleteEvent (el) {
$('button.btn-xs', el).click(function () {
if (confirm('<?php _e('确认要删除此字段吗?'); ?>')) {
$(this).parents('tr').fadeOut(function () {
$(this).parents('li').fadeOut(function () {
$(this).remove();
});
@@ -25,20 +14,21 @@ $(document).ready(function () {
});
}
$('#custom-field table tbody tr').each(function () {
$('#custom-field .fields .field').each(function () {
attachDeleteEvent(this);
});
$('#custom-field button.operate-add').click(function () {
var html = '<tr><td><input type="text" name="fieldNames[]" placeholder="<?php _e('字段名称'); ?>" pattern="^[_a-zA-Z][_a-zA-Z0-9]*$" oninput="this.reportValidity()" class="text-s w-100"></td>'
+ '<td><select name="fieldTypes[]" id="">'
var html = '<li class="field"><div class="field-name"><input type="text" name="fieldNames[]" placeholder="<?php _e('字段名称'); ?>" pattern="^[_a-zA-Z][_a-zA-Z0-9]*$" oninput="this.reportValidity()" class="text-s w-100">'
+ '<select name="fieldTypes[]" id="">'
+ '<option value="str"><?php _e('字符'); ?></option>'
+ '<option value="int"><?php _e('整数'); ?></option>'
+ '<option value="float"><?php _e('小数'); ?></option>'
+ '</select></td>'
+ '<td><textarea name="fieldValues[]" placeholder="<?php _e('字段值'); ?>" class="text-s w-100" rows="2"></textarea></td>'
+ '<td><button type="button" class="btn btn-xs"><?php _e('删除'); ?></button></td></tr>',
el = $(html).hide().appendTo('#custom-field table tbody').fadeIn();
+ '<option value="json"><?php _e('JSON 结构'); ?></option>'
+ '</select></div>'
+ '<div class="field-value"><textarea name="fieldValues[]" placeholder="<?php _e('字段值'); ?>" class="text-s w-100" rows="2"></textarea>'
+ '<button type="button" class="btn btn-xs"><?php _e('删除'); ?></button></div></li>',
el = $(html).hide().appendTo('#custom-field .fields').fadeIn();
attachDeleteEvent(el);
});

View File

@@ -3,32 +3,23 @@
$fields = isset($post) ? $post->getFieldItems() : $page->getFieldItems();
$defaultFields = isset($post) ? $post->getDefaultFieldItems() : $page->getDefaultFieldItems();
?>
<section id="custom-field"
class="typecho-post-option<?php if (empty($defaultFields) && empty($fields)): ?> fold<?php endif; ?>">
<label id="custom-field-expand" class="typecho-label"><a href="##"><i
class="i-caret-right"></i> <?php _e('自定义字段'); ?></a></label>
<table class="typecho-list-table mono">
<colgroup>
<col width="20%"/>
<col width="15%"/>
<col width="55%"/>
<col width="10%"/>
</colgroup>
<details id="custom-field"
class="typecho-post-option" <?php if (!empty($defaultFields) || !empty($fields)): ?>open<?php endif; ?>>
<summary><?php _e('自定义字段'); ?></summary>
<ul class="fields mono">
<?php foreach ($defaultFields as $field): ?>
<?php [$label, $input] = $field; ?>
<tr>
<td><?php $label->render(); ?></td>
<td colspan="3"><?php $input->render(); ?></td>
</tr>
<li class="field">
<div class="field-name"><?php $label->render(); ?></div>
<div class="field-value"><?php $input->render(); ?></div>
</li>
<?php endforeach; ?>
<?php foreach ($fields as $field): ?>
<tr>
<td>
<li class="field">
<div class="field-name">
<label for="fieldname" class="sr-only"><?php _e('字段名称'); ?></label>
<input type="text" name="fieldNames[]" value="<?php echo htmlspecialchars($field['name']); ?>"
id="fieldname" pattern="^[_a-zA-Z][_a-zA-Z0-9]*$" oninput="this.reportValidity()" class="text-s w-100">
</td>
<td>
<label for="fieldtype" class="sr-only"><?php _e('字段类型'); ?></label>
<select name="fieldTypes[]" id="fieldtype">
<option
@@ -40,45 +31,42 @@ $defaultFields = isset($post) ? $post->getDefaultFieldItems() : $page->getDefaul
<option
value="json"<?php if ('json' == $field['type']): ?> selected<?php endif; ?>><?php _e('JSON 结构'); ?></option>
</select>
</td>
<td>
</div>
<div class="field-value">
<label for="fieldvalue" class="sr-only"><?php _e('字段值'); ?></label>
<textarea name="fieldValues[]" id="fieldvalue" class="text-s w-100"
rows="2"><?php echo htmlspecialchars($field[($field['type'] == 'json' ? 'str' : $field['type']) . '_value']); ?></textarea>
</td>
<td>
<button type="button" class="btn btn-xs"><?php _e('删除'); ?></button>
</td>
</tr>
</div>
</li>
<?php endforeach; ?>
<?php if (empty($defaultFields) && empty($fields)): ?>
<tr>
<td>
<li class="field">
<div class="field-name">
<label for="fieldname" class="sr-only"><?php _e('字段名称'); ?></label>
<input type="text" name="fieldNames[]" placeholder="<?php _e('字段名称'); ?>" id="fieldname"
class="text-s w-100" pattern="^[_a-zA-Z][_a-zA-Z0-9]*$" oninput="this.reportValidity()">
</td>
<td>
<label for="fieldtype" class="sr-only"><?php _e('字段类型'); ?></label>
<select name="fieldTypes[]" id="fieldtype">
<option value="str"><?php _e('字符'); ?></option>
<option value="int"><?php _e('整数'); ?></option>
<option value="float"><?php _e('小数'); ?></option>
<option value="json"><?php _e('JSON 结构'); ?></option>
</select>
</td>
<td>
</div>
<div class="field-value">
<label for="fieldvalue" class="sr-only"><?php _e('字段值'); ?></label>
<textarea name="fieldValues[]" placeholder="<?php _e('字段值'); ?>" id="fieldvalue"
class="text-s w-100" rows="2"></textarea>
</td>
<td>
<button type="button" class="btn btn-xs"><?php _e('删除'); ?></button>
</td>
</tr>
</div>
</li>
<?php endif; ?>
</table>
<div class="description clearfix">
</ul>
<div class="add">
<button type="button" class="btn btn-xs operate-add"><?php _e('+添加字段'); ?></button>
<?php _e('自定义字段可以扩展你的模板功能, 使用方法参见 <a href="https://docs.typecho.org/help/custom-fields">帮助文档</a>'); ?>
<div class="description kit-hidden-mb">
<?php _e('自定义字段可以扩展你的模板功能, 使用方法参见 <a href="https://docs.typecho.org/help/custom-fields">帮助文档</a>'); ?>
</div>
</div>
</section>
</details>

View File

@@ -38,7 +38,7 @@ $(document).ready(function () {
preview = $('<div id="wmd-preview" class="wmd-hidetab" />').insertAfter('.editor');
let isFullScreen = false;
const options = {}, isMarkdown = <?php echo intval($content->isMarkdown || !$content->have()); ?>;
const options = {}, isMarkdown = <?php echo json_encode(!$content->have() || $content->isMarkdown); ?>;
options.strings = {
bold: '<?php _e('加粗'); ?> <strong> Ctrl+B',
@@ -214,7 +214,7 @@ $(document).ready(function () {
};
// 编辑预览切换
const edittab = $('.editor').prepend('<div class="wmd-edittab"><a href="#wmd-editarea" class="active"><?php _e('撰写'); ?></a><a href="#wmd-preview"><?php _e('预览'); ?></a></div>'),
const edittab = $('.editor').append('<div class="wmd-edittab"><a href="#wmd-editarea" class="active"><?php _e('撰写'); ?></a><a href="#wmd-preview"><?php _e('预览'); ?></a></div>'),
editarea = $(textarea.parent()).attr("id", "wmd-editarea");
$(".wmd-edittab a").click(function() {

View File

@@ -8,7 +8,7 @@ $header = '<link rel="stylesheet" href="' . $options->adminStaticUrl('css', 'nor
<link rel="stylesheet" href="' . $options->adminStaticUrl('css', 'style.css', true) . '">';
/** 注册一个初始化插件 */
$header = \Typecho\Plugin::factory('admin/header.php')->call('header', $header);
$header = \Typecho\Plugin::factory('admin/header.php')->filter('header', $header);
?><!DOCTYPE HTML>
<html>

View File

@@ -5,7 +5,7 @@ include 'menu.php';
$stat = \Widget\Stat::alloc();
?>
<div class="main">
<main class="main">
<div class="container typecho-dashboard">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main">
@@ -14,7 +14,7 @@ $stat = \Widget\Stat::alloc();
$stat->myPublishedPostsNum, $stat->myPublishedCommentsNum, $stat->categoriesNum); ?>
<br><?php _e('点击下面的链接快速开始:'); ?></p>
<ul id="start-link" class="clearfix">
<ul id="start-link">
<?php if ($user->pass('contributor', true)): ?>
<li><a href="<?php $options->adminUrl('write-post.php'); ?>"><?php _e('撰写新文章'); ?></a></li>
<?php if ($user->pass('editor', true) && 'on' == $request->get('__typecho_all_comments') && $stat->waitingCommentsNum > 0): ?>
@@ -102,7 +102,7 @@ $stat = \Widget\Stat::alloc();
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -6,7 +6,7 @@ include 'menu.php';
\Widget\Metas\Category\Admin::alloc()->to($categories);
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main manage-metas">
@@ -14,7 +14,7 @@ include 'menu.php';
<div class="col-mb-12" role="main">
<form method="post" name="manage_categories" class="operate-form">
<div class="typecho-list-operate clearfix">
<div class="typecho-list-operate">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
@@ -44,77 +44,74 @@ include 'menu.php';
</div>
</div>
<div class="typecho-table-wrap">
<table class="typecho-list-table">
<colgroup>
<col width="20" class="kit-hidden-mb"/>
<col width=""/>
<col width="15%" class="kit-hidden-mb"/>
<col width="25%"/>
<col width="15%"/>
<col width="10%" class="kit-hidden-mb"/>
</colgroup>
<thead>
<tr class="nodrag">
<th class="kit-hidden-mb"></th>
<th><?php _e('名称'); ?></th>
<th><?php _e('子分类'); ?></th>
<th class="kit-hidden-mb"><?php _e('缩略名'); ?></th>
<th></th>
<th class="kit-hidden-mb"><?php _e('文章数'); ?></th>
</tr>
</thead>
<tbody>
<?php if ($categories->have()): ?>
<?php while ($categories->next()): ?>
<tr id="mid-<?php $categories->theId(); ?>">
<td class="kit-hidden-mb"><input type="checkbox"
value="<?php $categories->mid(); ?>"
name="mid[]"/></td>
<td>
<a href="<?php $options->adminUrl('category.php?mid=' . $categories->mid); ?>"><?php $categories->name(); ?></a>
<a href="<?php $categories->permalink(); ?>"
title="<?php _e('浏览 %s', $categories->name); ?>"><i class="i-exlink"></i></a>
</td>
<td>
<table class="typecho-list-table">
<colgroup>
<col width="3%" class="kit-hidden-mb"/>
<col width=""/>
<col width="15%" class="kit-hidden-mb"/>
<col width="20%"/>
<col width="15%"/>
<col width="15%" class="kit-hidden-mb"/>
</colgroup>
<thead>
<tr class="nodrag">
<th class="kit-hidden-mb"></th>
<th><?php _e('名称'); ?></th>
<th><?php _e('子分类'); ?></th>
<th class="kit-hidden-mb"><?php _e('缩略名'); ?></th>
<th></th>
<th class="kit-hidden-mb"><?php _e('文章数'); ?></th>
</tr>
</thead>
<tbody>
<?php if ($categories->have()): ?>
<?php while ($categories->next()): ?>
<tr id="mid-<?php $categories->theId(); ?>">
<td class="kit-hidden-mb"><input type="checkbox"
value="<?php $categories->mid(); ?>"
name="mid[]"/></td>
<td>
<a href="<?php $options->adminUrl('category.php?mid=' . $categories->mid); ?>"><?php $categories->name(); ?></a>
<a href="<?php $categories->permalink(); ?>"
title="<?php _e('浏览 %s', $categories->name); ?>"><i class="i-exlink"></i></a>
</td>
<td>
<?php if (count($categories->children) > 0): ?>
<a href="<?php $options->adminUrl('manage-categories.php?parent=' . $categories->mid); ?>"><?php echo _n('一个分类', '%d个分类', count($categories->children)); ?></a>
<?php else: ?>
<a href="<?php $options->adminUrl('category.php?parent=' . $categories->mid); ?>"><?php echo _e('新增'); ?></a>
<?php endif; ?>
</td>
<td class="kit-hidden-mb"><?php $categories->slug(); ?></td>
<td>
<?php if ($options->defaultCategory == $categories->mid): ?>
<?php _e('默认'); ?>
<?php else: ?>
<a class="hidden-by-mouse"
href="<?php $security->index('/action/metas-category-edit?do=default&mid=' . $categories->mid); ?>"
title="<?php _e('设为默认'); ?>"><?php _e('默认'); ?></a>
<?php endif; ?>
</td>
<td class="kit-hidden-mb"><a
class="balloon-button left size-<?php echo \Typecho\Common::splitByCount($categories->count, 1, 10, 20, 50, 100); ?>"
href="<?php $options->adminUrl('manage-posts.php?category=' . $categories->mid); ?>"><?php $categories->count(); ?></a>
</td>
</tr>
<?php endwhile; ?>
<?php else: ?>
<tr>
<td colspan="6"><h6 class="typecho-list-table-title"><?php _e('没有任何分类'); ?></h6>
<?php if (count($categories->children) > 0): ?>
<a href="<?php $options->adminUrl('manage-categories.php?parent=' . $categories->mid); ?>"><?php echo _n('一个分类', '%d个分类', count($categories->children)); ?></a>
<?php else: ?>
<a href="<?php $options->adminUrl('category.php?parent=' . $categories->mid); ?>"><?php echo _e('新增'); ?></a>
<?php endif; ?>
</td>
<td class="kit-hidden-mb"><?php $categories->slug(); ?></td>
<td>
<?php if ($options->defaultCategory == $categories->mid): ?>
<?php _e('默认'); ?>
<?php else: ?>
<a class="hidden-by-mouse"
href="<?php $security->index('/action/metas-category-edit?do=default&mid=' . $categories->mid); ?>"
title="<?php _e('设为默认'); ?>"><?php _e('默认'); ?></a>
<?php endif; ?>
</td>
<td class="kit-hidden-mb"><a
class="balloon-button left size-<?php echo \Typecho\Common::splitByCount($categories->count, 1, 10, 20, 50, 100); ?>"
href="<?php $options->adminUrl('manage-posts.php?category=' . $categories->mid); ?>"><?php $categories->count(); ?></a>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
<?php endwhile; ?>
<?php else: ?>
<tr>
<td colspan="6" class="none"><?php _e('没有任何分类'); ?></td>
</tr>
<?php endif; ?>
</tbody>
</table>
</form>
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -7,18 +7,12 @@ $stat = \Widget\Stat::alloc();
$comments = \Widget\Comments\Admin::alloc();
$isAllComments = ('on' == $request->get('__typecho_all_comments') || 'on' == \Typecho\Cookie::get('__typecho_all_comments'));
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="main">
<div class="col-mb-12 typecho-list">
<div class="clearfix">
<ul class="typecho-option-tabs right">
<?php if($user->pass('editor', true) && !isset($request->cid)): ?>
<li class="<?php if($isAllComments): ?> current<?php endif; ?>"><a href="<?php echo $request->makeUriByRequest('__typecho_all_comments=on'); ?>"><?php _e('所有'); ?></a></li>
<li class="<?php if(!$isAllComments): ?> current<?php endif; ?>"><a href="<?php echo $request->makeUriByRequest('__typecho_all_comments=off'); ?>"><?php _e('我的'); ?></a></li>
<?php endif; ?>
</ul>
<div class="typecho-list-operate">
<ul class="typecho-option-tabs">
<li<?php if(!isset($request->status) || 'approved' == $request->get('status')): ?> class="current"<?php endif; ?>><a href="<?php $options->adminUrl('manage-comments.php'
. (isset($request->cid) ? '?cid=' . $request->filter('encode')->cid : '')); ?>"><?php _e('已通过'); ?></a></li>
@@ -43,50 +37,54 @@ $isAllComments = ('on' == $request->get('__typecho_all_comments') || 'on' == \Ty
<?php endif; ?>
</a></li>
</ul>
<?php if($user->pass('editor', true) && !isset($request->cid)): ?>
<ul class="typecho-option-tabs">
<li class="<?php if($isAllComments): ?> current<?php endif; ?>"><a href="<?php echo $request->makeUriByRequest('__typecho_all_comments=on'); ?>"><?php _e('所有'); ?></a></li>
<li class="<?php if(!$isAllComments): ?> current<?php endif; ?>"><a href="<?php echo $request->makeUriByRequest('__typecho_all_comments=off'); ?>"><?php _e('我的'); ?></a></li>
</ul>
<?php endif; ?>
</div>
<div class="typecho-list-operate clearfix">
<form method="get">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox" class="typecho-table-select-all" /></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a href="<?php $security->index('/action/comments-edit?do=approved'); ?>"><?php _e('通过'); ?></a></li>
<li><a href="<?php $security->index('/action/comments-edit?do=waiting'); ?>"><?php _e('待审核'); ?></a></li>
<li><a href="<?php $security->index('/action/comments-edit?do=spam'); ?>"><?php _e('标记垃圾'); ?></a></li>
<li><a lang="<?php _e('你确认要删除这些评论吗?'); ?>" href="<?php $security->index('/action/comments-edit?do=delete'); ?>"><?php _e('删除'); ?></a></li>
</ul>
<?php if('spam' == $request->get('status')): ?>
<button lang="<?php _e('你确认要删除所有垃圾评论吗?'); ?>" class="btn btn-s btn-warn btn-operate" href="<?php $security->index('/action/comments-edit?do=delete-spam'); ?>"><?php _e('删除所有垃圾评论'); ?></button>
<?php endif; ?>
</div>
<form method="get" class="typecho-list-operate">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox" class="typecho-table-select-all" /></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a href="<?php $security->index('/action/comments-edit?do=approved'); ?>"><?php _e('通过'); ?></a></li>
<li><a href="<?php $security->index('/action/comments-edit?do=waiting'); ?>"><?php _e('待审核'); ?></a></li>
<li><a href="<?php $security->index('/action/comments-edit?do=spam'); ?>"><?php _e('标记垃圾'); ?></a></li>
<li><a lang="<?php _e('你确认要删除这些评论吗?'); ?>" href="<?php $security->index('/action/comments-edit?do=delete'); ?>"><?php _e('删除'); ?></a></li>
</ul>
<?php if('spam' == $request->get('status')): ?>
<button lang="<?php _e('你确认要删除所有垃圾评论吗?'); ?>" class="btn btn-s btn-warn btn-operate" href="<?php $security->index('/action/comments-edit?do=delete-spam'); ?>"><?php _e('删除所有垃圾评论'); ?></button>
<?php endif; ?>
</div>
<div class="search" role="search">
<?php if ('' != $request->keywords || '' != $request->category): ?>
<a href="<?php $options->adminUrl('manage-comments.php'
. (isset($request->status) || isset($request->cid) ? '?' .
(isset($request->status) ? 'status=' . $request->filter('encode')->status : '') .
(isset($request->cid) ? (isset($request->status) ? '&' : '') . 'cid=' . $request->filter('encode')->cid : '') : '')); ?>"><?php _e('&laquo; 取消筛选'); ?></a>
<?php endif; ?>
<input type="text" class="text-s" placeholder="<?php _e('请输入关键字'); ?>" value="<?php echo $request->filter('html')->keywords; ?>"<?php if ('' == $request->keywords): ?> onclick="value='';name='keywords';" <?php else: ?> name="keywords"<?php endif; ?>/>
<?php if(isset($request->status)): ?>
<input type="hidden" value="<?php echo $request->filter('html')->status; ?>" name="status" />
<?php endif; ?>
<?php if(isset($request->cid)): ?>
<input type="hidden" value="<?php echo $request->filter('html')->cid; ?>" name="cid" />
<?php endif; ?>
<button type="submit" class="btn btn-s"><?php _e('筛选'); ?></button>
</div>
</form>
</div><!-- end .typecho-list-operate -->
</div>
<div class="search" role="search">
<?php if ('' != $request->keywords || '' != $request->category): ?>
<a href="<?php $options->adminUrl('manage-comments.php'
. (isset($request->status) || isset($request->cid) ? '?' .
(isset($request->status) ? 'status=' . $request->filter('encode')->status : '') .
(isset($request->cid) ? (isset($request->status) ? '&' : '') . 'cid=' . $request->filter('encode')->cid : '') : '')); ?>"><?php _e('&laquo; 取消筛选'); ?></a>
<?php endif; ?>
<input type="text" class="text-s" placeholder="<?php _e('请输入关键字'); ?>" value="<?php echo $request->filter('html')->keywords; ?>"<?php if ('' == $request->keywords): ?> onclick="value='';name='keywords';" <?php else: ?> name="keywords"<?php endif; ?>/>
<?php if(isset($request->status)): ?>
<input type="hidden" value="<?php echo $request->filter('html')->status; ?>" name="status" />
<?php endif; ?>
<?php if(isset($request->cid)): ?>
<input type="hidden" value="<?php echo $request->filter('html')->cid; ?>" name="cid" />
<?php endif; ?>
<button type="submit" class="btn btn-s"><?php _e('筛选'); ?></button>
</div>
</form>
<form method="post" name="manage_comments" class="operate-form">
<div class="typecho-table-wrap">
<table class="typecho-list-table">
<colgroup>
<col width="3%" class="kit-hidden-mb"/>
<col width="6%" class="kit-hidden-mb" />
<col width="6%" class="kit-hidden" />
<col width="20%"/>
<col width="71%"/>
</colgroup>
@@ -117,7 +115,7 @@ $isAllComments = ('on' == $request->get('__typecho_all_comments') || 'on' == \Ty
<td valign="top" class="kit-hidden-mb">
<input type="checkbox" value="<?php $comments->coid(); ?>" name="coid[]"/>
</td>
<td valign="top" class="kit-hidden-mb">
<td valign="top" class="kit-hidden">
<div class="comment-avatar">
<?php if ('comment' == $comments->type): ?>
<?php $comments->gravatar(40, null, true); ?>
@@ -175,46 +173,43 @@ $isAllComments = ('on' == $request->get('__typecho_all_comments') || 'on' == \Ty
<?php endwhile; ?>
<?php else: ?>
<tr>
<td colspan="4"><h6 class="typecho-list-table-title"><?php _e('没有评论') ?></h6></td>
<td colspan="4" class="none"><?php _e('没有评论') ?></td>
</tr>
<?php endif; ?>
</tbody>
</table><!-- end .typecho-list-table -->
</div><!-- end .typecho-table-wrap -->
<?php if(isset($request->cid)): ?>
<input type="hidden" value="<?php echo $request->filter('html')->cid; ?>" name="cid" />
<?php endif; ?>
</form><!-- end .operate-form -->
<div class="typecho-list-operate clearfix">
<form method="get">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox" class="typecho-table-select-all" /></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a href="<?php $security->index('/action/comments-edit?do=approved'); ?>"><?php _e('通过'); ?></a></li>
<li><a href="<?php $security->index('/action/comments-edit?do=waiting'); ?>"><?php _e('待审核'); ?></a></li>
<li><a href="<?php $security->index('/action/comments-edit?do=spam'); ?>"><?php _e('标记垃圾'); ?></a></li>
<li><a lang="<?php _e('你确认要删除这些评论吗?'); ?>" href="<?php $security->index('/action/comments-edit?do=delete'); ?>"><?php _e('删除'); ?></a></li>
</ul>
<?php if('spam' == $request->get('status')): ?>
<button lang="<?php _e('你确认要删除所有垃圾评论吗?'); ?>" class="btn btn-s btn-warn btn-operate" href="<?php $security->index('/action/comments-edit?do=delete-spam'); ?>"><?php _e('删除所有垃圾评论'); ?></button>
<?php endif; ?>
</div>
</div>
<?php if($comments->have()): ?>
<ul class="typecho-pager">
<?php $comments->pageNav(); ?>
<form method="get" class="typecho-list-operate">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox" class="typecho-table-select-all" /></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a href="<?php $security->index('/action/comments-edit?do=approved'); ?>"><?php _e('通过'); ?></a></li>
<li><a href="<?php $security->index('/action/comments-edit?do=waiting'); ?>"><?php _e('待审核'); ?></a></li>
<li><a href="<?php $security->index('/action/comments-edit?do=spam'); ?>"><?php _e('标记垃圾'); ?></a></li>
<li><a lang="<?php _e('你确认要删除这些评论吗?'); ?>" href="<?php $security->index('/action/comments-edit?do=delete'); ?>"><?php _e('删除'); ?></a></li>
</ul>
<?php if('spam' == $request->get('status')): ?>
<button lang="<?php _e('你确认要删除所有垃圾评论吗?'); ?>" class="btn btn-s btn-warn btn-operate" href="<?php $security->index('/action/comments-edit?do=delete-spam'); ?>"><?php _e('删除所有垃圾评论'); ?></button>
<?php endif; ?>
</form>
</div><!-- end .typecho-list-operate -->
</div>
</div>
<?php if($comments->have()): ?>
<ul class="typecho-pager">
<?php $comments->pageNav(); ?>
</ul>
<?php endif; ?>
</form>
</div><!-- end .typecho-list -->
</div><!-- end .typecho-page-main -->
</div>
</div>
</main>
<?php
include 'copyright.php';
include 'common-js.php';

View File

@@ -6,135 +6,128 @@ include 'menu.php';
$stat = \Widget\Stat::alloc();
$attachments = \Widget\Contents\Attachment\Admin::alloc();
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="main">
<div class="col-mb-12">
<div class="typecho-list-operate clearfix">
<form method="get">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i
class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i
class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a lang="<?php _e('你确认要删除这些文件吗?'); ?>"
href="<?php $security->index('/action/contents-attachment-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
</li>
</ul>
<button class="btn btn-s btn-warn btn-operate"
href="<?php $security->index('/action/contents-attachment-edit?do=clear'); ?>"
lang="<?php _e('您确认要清理未归档的文件吗?'); ?>"><?php _e('清理未归档文件'); ?></button>
</div>
</div>
<div class="search" role="search">
<?php if ('' != $request->keywords): ?>
<a href="<?php $options->adminUrl('manage-medias.php'); ?>"><?php _e('&laquo; 取消筛选'); ?></a>
<?php endif; ?>
<input type="text" class="text-s" placeholder="<?php _e('请输入关键字'); ?>"
value="<?php echo $request->filter('html')->keywords; ?>"<?php if ('' == $request->keywords): ?> onclick="value='';name='keywords';" <?php else: ?> name="keywords"<?php endif; ?>/>
<button type="submit" class="btn btn-s"><?php _e('筛选'); ?></button>
</div>
</form>
</div><!-- end .typecho-list-operate -->
<form method="post" name="manage_medias" class="operate-form">
<div class="typecho-table-wrap">
<table class="typecho-list-table draggable">
<colgroup>
<col width="20" class="kit-hidden-mb"/>
<col width="6%" class="kit-hidden-mb"/>
<col width="30%"/>
<col width="" class="kit-hidden-mb"/>
<col width="30%" class="kit-hidden-mb"/>
<col width="16%"/>
</colgroup>
<thead>
<tr>
<th class="kit-hidden-mb"></th>
<th class="kit-hidden-mb"></th>
<th><?php _e('文件名'); ?></th>
<th class="kit-hidden-mb"><?php _e('上传者'); ?></th>
<th class="kit-hidden-mb"><?php _e('所属文章'); ?></th>
<th><?php _e('发布日期'); ?></th>
</tr>
</thead>
<tbody>
<?php if ($attachments->have()): ?>
<?php while ($attachments->next()): ?>
<?php $mime = \Typecho\Common::mimeIconType($attachments->attachment->mime); ?>
<tr id="<?php $attachments->theId(); ?>">
<td class="kit-hidden-mb"><input type="checkbox"
value="<?php $attachments->cid(); ?>"
name="cid[]"/></td>
<td class="kit-hidden-mb"><a
href="<?php $options->adminUrl('manage-comments.php?cid=' . $attachments->cid); ?>"
class="balloon-button size-<?php echo \Typecho\Common::splitByCount($attachments->commentsNum, 1, 10, 20, 50, 100); ?>"><?php $attachments->commentsNum(); ?></a>
</td>
<td>
<i class="mime-<?php echo $mime; ?>"></i>
<a href="<?php $options->adminUrl('media.php?cid=' . $attachments->cid); ?>"><?php $attachments->title(); ?></a>
<a href="<?php $attachments->permalink(); ?>"
title="<?php _e('浏览 %s', $attachments->title); ?>"><i
class="i-exlink"></i></a>
</td>
<td class="kit-hidden-mb"><?php $attachments->author(); ?></td>
<td class="kit-hidden-mb">
<?php if ($attachments->parentPost->cid): ?>
<a href="<?php $options->adminUrl('write-' . (0 === strpos($attachments->parentPost->type, 'post') ? 'post' : 'page') . '.php?cid=' . $attachments->parentPost->cid); ?>"><?php $attachments->parentPost->title(); ?></a>
<?php else: ?>
<span class="description"><?php _e('未归档'); ?></span>
<?php endif; ?>
</td>
<td><?php $attachments->dateWord(); ?></td>
</tr>
<?php endwhile; ?>
<?php else: ?>
<tr>
<td colspan="6"><h6 class="typecho-list-table-title"><?php _e('没有任何文件'); ?></h6>
</td>
</tr>
<?php endif; ?>
</tbody>
</table><!-- end .typecho-list-table -->
</div><!-- end .typecho-table-wrap -->
</form><!-- end .operate-form -->
<div class="typecho-list-operate clearfix">
<form method="get">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i
class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i
class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a lang="<?php _e('你确认要删除这些文件吗?'); ?>"
href="<?php $security->index('/action/contents-attachment-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
</li>
</ul>
</div>
<form method="get" class="typecho-list-operate">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i
class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i
class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a lang="<?php _e('你确认要删除这些文件吗?'); ?>"
href="<?php $security->index('/action/contents-attachment-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
</li>
</ul>
<button class="btn btn-s btn-warn btn-operate"
href="<?php $security->index('/action/contents-attachment-edit?do=clear'); ?>"
lang="<?php _e('您确认要清理未归档的文件吗?'); ?>"><?php _e('清理未归档文件'); ?></button>
</div>
<?php if ($attachments->have()): ?>
<ul class="typecho-pager">
<?php $attachments->pageNav(); ?>
</ul>
</div>
<div class="search" role="search">
<?php if ('' != $request->keywords): ?>
<a href="<?php $options->adminUrl('manage-medias.php'); ?>"><?php _e('&laquo; 取消筛选'); ?></a>
<?php endif; ?>
</form>
</div><!-- end .typecho-list-operate -->
<input type="text" class="text-s" placeholder="<?php _e('请输入关键字'); ?>"
value="<?php echo $request->filter('html')->keywords; ?>"<?php if ('' == $request->keywords): ?> onclick="value='';name='keywords';" <?php else: ?> name="keywords"<?php endif; ?>/>
<button type="submit" class="btn btn-s"><?php _e('筛选'); ?></button>
</div>
</form>
<form method="post" name="manage_medias" class="operate-form">
<table class="typecho-list-table draggable">
<colgroup>
<col width="3%" class="kit-hidden-mb"/>
<col width="6%" class="kit-hidden-mb"/>
<col width="30%"/>
<col width="" class="kit-hidden-mb"/>
<col width="30%" class="kit-hidden-mb"/>
<col width="16%"/>
</colgroup>
<thead>
<tr>
<th class="kit-hidden-mb"></th>
<th class="kit-hidden-mb"></th>
<th><?php _e('文件名'); ?></th>
<th class="kit-hidden-mb"><?php _e('上传者'); ?></th>
<th class="kit-hidden-mb"><?php _e('所属文章'); ?></th>
<th><?php _e('发布日期'); ?></th>
</tr>
</thead>
<tbody>
<?php if ($attachments->have()): ?>
<?php while ($attachments->next()): ?>
<?php $mime = \Typecho\Common::mimeIconType($attachments->attachment->mime); ?>
<tr id="<?php $attachments->theId(); ?>">
<td class="kit-hidden-mb"><input type="checkbox"
value="<?php $attachments->cid(); ?>"
name="cid[]"/></td>
<td class="kit-hidden-mb"><a
href="<?php $options->adminUrl('manage-comments.php?cid=' . $attachments->cid); ?>"
class="balloon-button size-<?php echo \Typecho\Common::splitByCount($attachments->commentsNum, 1, 10, 20, 50, 100); ?>"><?php $attachments->commentsNum(); ?></a>
</td>
<td>
<i class="mime-<?php echo $mime; ?>"></i>
<a href="<?php $options->adminUrl('media.php?cid=' . $attachments->cid); ?>"><?php $attachments->title(); ?></a>
<a href="<?php $attachments->permalink(); ?>"
title="<?php _e('浏览 %s', $attachments->title); ?>"><i
class="i-exlink"></i></a>
</td>
<td class="kit-hidden-mb"><?php $attachments->author(); ?></td>
<td class="kit-hidden-mb">
<?php if ($attachments->parentPost->cid): ?>
<a href="<?php $options->adminUrl('write-' . (0 === strpos($attachments->parentPost->type, 'post') ? 'post' : 'page') . '.php?cid=' . $attachments->parentPost->cid); ?>"><?php $attachments->parentPost->title(); ?></a>
<?php else: ?>
<span class="description"><?php _e('未归档'); ?></span>
<?php endif; ?>
</td>
<td><?php $attachments->dateWord(); ?></td>
</tr>
<?php endwhile; ?>
<?php else: ?>
<tr>
<td colspan="6" class="none"><?php _e('没有任何文件'); ?></td>
</tr>
<?php endif; ?>
</tbody>
</table><!-- end .typecho-list-table -->
</form><!-- end .operate-form -->
<form method="get" class="typecho-list-operate">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i
class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i
class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a lang="<?php _e('你确认要删除这些文件吗?'); ?>"
href="<?php $security->index('/action/contents-attachment-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
</li>
</ul>
</div>
<button class="btn btn-s btn-warn btn-operate"
href="<?php $security->index('/action/contents-attachment-edit?do=clear'); ?>"
lang="<?php _e('您确认要清理未归档的文件吗?'); ?>"><?php _e('清理未归档文件'); ?></button>
</div>
<?php if ($attachments->have()): ?>
<ul class="typecho-pager">
<?php $attachments->pageNav(); ?>
</ul>
<?php endif; ?>
</form>
</div>
</div><!-- end .typecho-page-main -->
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -6,134 +6,129 @@ include 'menu.php';
$stat = \Widget\Stat::alloc();
$pages = \Widget\Contents\Page\Admin::alloc();
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="main">
<div class="col-mb-12 typecho-list">
<div class="typecho-list-operate clearfix">
<form method="get">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i
class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i
class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a lang="<?php _e('你确认要删除这些页面吗?'); ?>"
href="<?php $security->index('/action/contents-page-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
</li>
<li>
<a href="<?php $security->index('/action/contents-page-edit?do=mark&status=publish'); ?>"><?php _e('标记为<strong>%s</strong>', _t('公开')); ?></a>
</li>
<li>
<a href="<?php $security->index('/action/contents-page-edit?do=mark&status=hidden'); ?>"><?php _e('标记为<strong>%s</strong>', _t('隐藏')); ?></a>
</li>
</ul>
</div>
<form method="get" class="typecho-list-operate">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i
class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i
class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a lang="<?php _e('你确认要删除这些页面吗?'); ?>"
href="<?php $security->index('/action/contents-page-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
</li>
<li>
<a href="<?php $security->index('/action/contents-page-edit?do=mark&status=publish'); ?>"><?php _e('标记为<strong>%s</strong>', _t('公开')); ?></a>
</li>
<li>
<a href="<?php $security->index('/action/contents-page-edit?do=mark&status=hidden'); ?>"><?php _e('标记为<strong>%s</strong>', _t('隐藏')); ?></a>
</li>
</ul>
</div>
</div>
<div class="search" role="search">
<?php $pages->backLink(); ?>
<?php if ('' != $request->keywords): ?>
<a href="<?php $options->adminUrl('manage-pages.php'); ?>"><?php _e('&laquo; 取消筛选'); ?></a>
<?php endif; ?>
<input type="text" class="text-s" placeholder="<?php _e('请输入关键字'); ?>"
value="<?php echo $request->filter('html')->keywords; ?>" name="keywords"/>
<button type="submit" class="btn btn-s"><?php _e('筛选'); ?></button>
</div>
</form>
</div><!-- end .typecho-list-operate -->
<div class="search" role="search">
<?php $pages->backLink(); ?>
<?php if ('' != $request->keywords): ?>
<a href="<?php $options->adminUrl('manage-pages.php'); ?>"><?php _e('&laquo; 取消筛选'); ?></a>
<?php endif; ?>
<input type="text" class="text-s" placeholder="<?php _e('请输入关键字'); ?>"
value="<?php echo $request->filter('html')->keywords; ?>" name="keywords"/>
<button type="submit" class="btn btn-s"><?php _e('筛选'); ?></button>
</div>
</form>
<form method="post" name="manage_pages" class="operate-form">
<div class="typecho-table-wrap">
<table class="typecho-list-table">
<colgroup>
<col width="20" class="kit-hidden-mb"/>
<col width="6%" class="kit-hidden-mb"/>
<col width="30%"/>
<col width="30%"/>
<col width="" class="kit-hidden-mb"/>
<col width="16%"/>
</colgroup>
<thead>
<tr class="nodrag">
<th class="kit-hidden-mb"></th>
<th class="kit-hidden-mb"></th>
<th><?php _e('标题'); ?></th>
<th><?php _e('子页面'); ?></th>
<th class="kit-hidden-mb"><?php _e('作者'); ?></th>
<th><?php _e('日期'); ?></th>
</tr>
</thead>
<tbody>
<?php if ($pages->have()): ?>
<?php while ($pages->next()): ?>
<tr id="<?php $pages->theId(); ?>">
<td class="kit-hidden-mb"><input type="checkbox" value="<?php $pages->cid(); ?>"
name="cid[]"/></td>
<td class="kit-hidden-mb"><a
href="<?php $options->adminUrl('manage-comments.php?cid=' . $pages->cid); ?>"
class="balloon-button size-<?php echo \Typecho\Common::splitByCount($pages->commentsNum, 1, 10, 20, 50, 100); ?>"
title="<?php $pages->commentsNum(); ?> <?php _e('评论'); ?>"><?php $pages->commentsNum(); ?></a>
</td>
<td>
<a href="<?php $options->adminUrl('write-page.php?cid=' . $pages->cid); ?>"><?php $pages->title(); ?></a>
<?php
if ('page_draft' == $pages->type) {
echo '<em class="status">' . _t('草稿') . '</em>';
} elseif ($pages->revision) {
echo '<em class="status">' . _t('有修订版') . '</em>';
}
<table class="typecho-list-table">
<colgroup>
<col width="3%" class="kit-hidden-mb"/>
<col width="6%" class="kit-hidden-mb"/>
<col width="42%"/>
<col width="18%"/>
<col width="" class="kit-hidden-mb"/>
<col width="16%"/>
</colgroup>
<thead>
<tr class="nodrag">
<th class="kit-hidden-mb"></th>
<th class="kit-hidden-mb"></th>
<th><?php _e('标题'); ?></th>
<th><?php _e('子页面'); ?></th>
<th class="kit-hidden-mb"><?php _e('作者'); ?></th>
<th><?php _e('日期'); ?></th>
</tr>
</thead>
<tbody>
<?php if ($pages->have()): ?>
<?php while ($pages->next()): ?>
<tr id="<?php $pages->theId(); ?>">
<td class="kit-hidden-mb"><input type="checkbox" value="<?php $pages->cid(); ?>"
name="cid[]"/></td>
<td class="kit-hidden-mb"><a
href="<?php $options->adminUrl('manage-comments.php?cid=' . $pages->cid); ?>"
class="balloon-button size-<?php echo \Typecho\Common::splitByCount($pages->commentsNum, 1, 10, 20, 50, 100); ?>"
title="<?php $pages->commentsNum(); ?> <?php _e('评论'); ?>"><?php $pages->commentsNum(); ?></a>
</td>
<td>
<a href="<?php $options->adminUrl('write-page.php?cid=' . $pages->cid); ?>"><?php $pages->title(); ?></a>
<?php
if ('page_draft' == $pages->type) {
echo '<em class="status">' . _t('草稿') . '</em>';
} elseif ($pages->revision) {
echo '<em class="status">' . _t('有修订版') . '</em>';
}
if ('hidden' == $pages->status) {
echo '<em class="status">' . _t('隐藏') . '</em>';
}
?>
<a href="<?php $options->adminUrl('write-page.php?cid=' . $pages->cid); ?>"
title="<?php _e('编辑 %s', htmlspecialchars($pages->title)); ?>"><i
class="i-edit"></i></a>
<?php if ('page_draft' != $pages->type): ?>
<a href="<?php $pages->permalink(); ?>"
title="<?php _e('浏览 %s', htmlspecialchars($pages->title)); ?>"><i
class="i-exlink"></i></a>
<?php endif; ?>
</td>
<td>
<?php if (count($pages->children) > 0): ?>
<a href="<?php $options->adminUrl('manage-pages.php?parent=' . $pages->cid); ?>"><?php echo _n('一个页面', '%d个页面', count($pages->children)); ?></a>
<?php else: ?>
<a href="<?php $options->adminUrl('write-page.php?parent=' . $pages->cid); ?>"><?php echo _e('新增'); ?></a>
<?php endif; ?>
</td>
<td class="kit-hidden-mb"><?php $pages->author(); ?></td>
<td>
<?php if ('page_draft' == $pages->type || $pages->revision): ?>
<span class="description">
<?php $modifyDate = new \Typecho\Date($pages->revision ? $pages->revision['modified'] : $pages->modified); ?>
<?php _e('保存于 %s', $modifyDate->word()); ?>
</span>
<?php else: ?>
<?php $pages->dateWord(); ?>
<?php endif; ?>
</td>
</tr>
<?php endwhile; ?>
<?php else: ?>
<tr>
<td colspan="6"><h6 class="typecho-list-table-title"><?php _e('没有任何页面'); ?></h6>
if ('hidden' == $pages->status) {
echo '<em class="status">' . _t('隐藏') . '</em>';
}
?>
<a href="<?php $options->adminUrl('write-page.php?cid=' . $pages->cid); ?>"
title="<?php _e('编辑 %s', htmlspecialchars($pages->title)); ?>"><i
class="i-edit"></i></a>
<?php if ('page_draft' != $pages->type): ?>
<a href="<?php $pages->permalink(); ?>"
title="<?php _e('浏览 %s', htmlspecialchars($pages->title)); ?>"><i
class="i-exlink"></i></a>
<?php endif; ?>
</td>
<td>
<?php if (count($pages->children) > 0): ?>
<a href="<?php $options->adminUrl('manage-pages.php?parent=' . $pages->cid); ?>"><?php echo _n('一个页面', '%d个页面', count($pages->children)); ?></a>
<?php else: ?>
<a href="<?php $options->adminUrl('write-page.php?parent=' . $pages->cid); ?>"><?php echo _e('新增'); ?></a>
<?php endif; ?>
</td>
<td class="kit-hidden-mb"><?php $pages->author(); ?></td>
<td>
<?php if ('page_draft' == $pages->type || $pages->revision): ?>
<span class="description">
<?php $modifyDate = new \Typecho\Date($pages->revision ? $pages->revision['modified'] : $pages->modified); ?>
<?php _e('保存于 %s', $modifyDate->word()); ?>
</span>
<?php else: ?>
<?php $pages->dateWord(); ?>
<?php endif; ?>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div><!-- end .typecho-table-wrap -->
<?php endwhile; ?>
<?php else: ?>
<tr>
<td colspan="6" class="none"><?php _e('没有任何页面'); ?></td>
</tr>
<?php endif; ?>
</tbody>
</table>
</form><!-- end .operate-form -->
</div><!-- end .typecho-list -->
</div><!-- end .typecho-page-main -->
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -7,22 +7,12 @@ $stat = \Widget\Stat::alloc();
$posts = \Widget\Contents\Post\Admin::alloc();
$isAllPosts = ('on' == $request->get('__typecho_all_posts') || 'on' == \Typecho\Cookie::get('__typecho_all_posts'));
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="main">
<div class="col-mb-12 typecho-list">
<div class="clearfix">
<ul class="typecho-option-tabs right">
<?php if ($user->pass('editor', true) && !isset($request->uid)): ?>
<li class="<?php if ($isAllPosts): ?> current<?php endif; ?>"><a
href="<?php echo $request->makeUriByRequest('__typecho_all_posts=on&page=1'); ?>"><?php _e('所有'); ?></a>
</li>
<li class="<?php if (!$isAllPosts): ?> current<?php endif; ?>"><a
href="<?php echo $request->makeUriByRequest('__typecho_all_posts=off&page=1'); ?>"><?php _e('我的'); ?></a>
</li>
<?php endif; ?>
</ul>
<div class="typecho-list-operate">
<ul class="typecho-option-tabs">
<li<?php if (!isset($request->status) || 'all' == $request->get('status')): ?> class="current"<?php endif; ?>>
<a href="<?php $options->adminUrl('manage-posts.php'
@@ -51,205 +41,208 @@ $isAllPosts = ('on' == $request->get('__typecho_all_posts') || 'on' == \Typecho\
<?php endif; ?>
</a></li>
</ul>
<?php if ($user->pass('editor', true) && !isset($request->uid)): ?>
<ul class="typecho-option-tabs">
<li class="<?php if ($isAllPosts): ?> current<?php endif; ?>"><a
href="<?php echo $request->makeUriByRequest('__typecho_all_posts=on&page=1'); ?>"><?php _e('所有'); ?></a>
</li>
<li class="<?php if (!$isAllPosts): ?> current<?php endif; ?>"><a
href="<?php echo $request->makeUriByRequest('__typecho_all_posts=off&page=1'); ?>"><?php _e('我的'); ?></a>
</li>
</ul>
<?php endif; ?>
</div>
<div class="typecho-list-operate clearfix">
<form method="get">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i
class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i
class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a lang="<?php _e('你确认要删除这些文章吗?'); ?>"
href="<?php $security->index('/action/contents-post-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
<form method="get" class="typecho-list-operate">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i
class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i
class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a lang="<?php _e('你确认要删除这些文章吗?'); ?>"
href="<?php $security->index('/action/contents-post-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
</li>
<?php if ($user->pass('editor', true)): ?>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=publish'); ?>"><?php _e('标记为<strong>%s</strong>', _t('公开')); ?></a>
</li>
<?php if ($user->pass('editor', true)): ?>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=publish'); ?>"><?php _e('标记为<strong>%s</strong>', _t('公开')); ?></a>
</li>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=waiting'); ?>"><?php _e('标记为<strong>%s</strong>', _t('待审核')); ?></a>
</li>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=hidden'); ?>"><?php _e('标记为<strong>%s</strong>', _t('隐藏')); ?></a>
</li>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=private'); ?>"><?php _e('标记为<strong>%s</strong>', _t('私密')); ?></a>
</li>
<?php endif; ?>
</ul>
</div>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=waiting'); ?>"><?php _e('标记为<strong>%s</strong>', _t('待审核')); ?></a>
</li>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=hidden'); ?>"><?php _e('标记为<strong>%s</strong>', _t('隐藏')); ?></a>
</li>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=private'); ?>"><?php _e('标记为<strong>%s</strong>', _t('私密')); ?></a>
</li>
<?php endif; ?>
</ul>
</div>
<div class="search" role="search">
<?php if ('' != $request->keywords || '' != $request->category): ?>
<a href="<?php $options->adminUrl('manage-posts.php'
. (isset($request->status) || isset($request->uid) ? '?' .
(isset($request->status) ? 'status=' . $request->filter('encode')->status : '') .
(isset($request->uid) ? (isset($request->status) ? '&' : '') . 'uid=' . $request->filter('encode')->uid : '') : '')); ?>"><?php _e('&laquo; 取消筛选'); ?></a>
<?php endif; ?>
<input type="text" class="text-s" placeholder="<?php _e('请输入关键字'); ?>"
value="<?php echo $request->filter('html')->keywords; ?>" name="keywords"/>
<select name="category">
<option value=""><?php _e('所有分类'); ?></option>
<?php \Widget\Metas\Category\Rows::alloc()->to($category); ?>
<?php while ($category->next()): ?>
<option
value="<?php $category->mid(); ?>"<?php if ($request->get('category') == $category->mid): ?> selected="true"<?php endif; ?>><?php $category->name(); ?></option>
<?php endwhile; ?>
</select>
<button type="submit" class="btn btn-s"><?php _e('筛选'); ?></button>
<?php if (isset($request->uid)): ?>
<input type="hidden" value="<?php echo $request->filter('html')->uid; ?>"
name="uid"/>
<?php endif; ?>
<?php if (isset($request->status)): ?>
<input type="hidden" value="<?php echo $request->filter('html')->status; ?>"
name="status"/>
<?php endif; ?>
</div>
</form>
</div><!-- end .typecho-list-operate -->
</div>
<div class="search" role="search">
<?php if ('' != $request->keywords || '' != $request->category): ?>
<a href="<?php $options->adminUrl('manage-posts.php'
. (isset($request->status) || isset($request->uid) ? '?' .
(isset($request->status) ? 'status=' . $request->filter('encode')->status : '') .
(isset($request->uid) ? (isset($request->status) ? '&' : '') . 'uid=' . $request->filter('encode')->uid : '') : '')); ?>"><?php _e('&laquo; 取消筛选'); ?></a>
<?php endif; ?>
<input type="text" class="text-s" placeholder="<?php _e('请输入关键字'); ?>"
value="<?php echo $request->filter('html')->keywords; ?>" name="keywords"/>
<select name="category">
<option value=""><?php _e('所有分类'); ?></option>
<?php \Widget\Metas\Category\Rows::alloc()->to($category); ?>
<?php while ($category->next()): ?>
<option
value="<?php $category->mid(); ?>"<?php if ($request->get('category') == $category->mid): ?> selected="true"<?php endif; ?>><?php $category->name(); ?></option>
<?php endwhile; ?>
</select>
<button type="submit" class="btn btn-s"><?php _e('筛选'); ?></button>
<?php if (isset($request->uid)): ?>
<input type="hidden" value="<?php echo $request->filter('html')->uid; ?>"
name="uid"/>
<?php endif; ?>
<?php if (isset($request->status)): ?>
<input type="hidden" value="<?php echo $request->filter('html')->status; ?>"
name="status"/>
<?php endif; ?>
</div>
</form>
<form method="post" name="manage_posts" class="operate-form">
<div class="typecho-table-wrap">
<table class="typecho-list-table">
<colgroup>
<col width="20" class="kit-hidden-mb"/>
<col width="6%" class="kit-hidden-mb"/>
<col width="45%"/>
<col width="" class="kit-hidden-mb"/>
<col width="18%" class="kit-hidden-mb"/>
<col width="16%"/>
</colgroup>
<thead>
<tr>
<th class="kit-hidden-mb"></th>
<th class="kit-hidden-mb"></th>
<th><?php _e('标题'); ?></th>
<th class="kit-hidden-mb"><?php _e('作者'); ?></th>
<th class="kit-hidden-mb"><?php _e('分类'); ?></th>
<th><?php _e('日期'); ?></th>
</tr>
</thead>
<tbody>
<?php if ($posts->have()): ?>
<?php while ($posts->next()): ?>
<tr id="<?php $posts->theId(); ?>">
<td class="kit-hidden-mb"><input type="checkbox" value="<?php $posts->cid(); ?>"
name="cid[]"/></td>
<td class="kit-hidden-mb"><a
href="<?php $options->adminUrl('manage-comments.php?cid=' . ($posts->parentId ? $posts->parentId : $posts->cid)); ?>"
class="balloon-button size-<?php echo \Typecho\Common::splitByCount($posts->commentsNum, 1, 10, 20, 50, 100); ?>"
title="<?php $posts->commentsNum(); ?> <?php _e('评论'); ?>"><?php $posts->commentsNum(); ?></a>
</td>
<td>
<a href="<?php $options->adminUrl('write-post.php?cid=' . $posts->cid); ?>"><?php $posts->title(); ?></a>
<?php
if ('post_draft' == $posts->type) {
echo '<em class="status">' . _t('草稿') . '</em>';
} elseif ($posts->revision) {
echo '<em class="status">' . _t('有修订版') . '</em>';
}
<table class="typecho-list-table">
<colgroup>
<col width="3%" class="kit-hidden-mb"/>
<col width="6%" class="kit-hidden-mb"/>
<col width="45%"/>
<col width="" class="kit-hidden-mb"/>
<col width="18%" class="kit-hidden-mb"/>
<col width="16%"/>
</colgroup>
<thead>
<tr>
<th class="kit-hidden-mb"></th>
<th class="kit-hidden-mb"></th>
<th><?php _e('标题'); ?></th>
<th class="kit-hidden-mb"><?php _e('作者'); ?></th>
<th class="kit-hidden-mb"><?php _e('分类'); ?></th>
<th><?php _e('日期'); ?></th>
</tr>
</thead>
<tbody>
<?php if ($posts->have()): ?>
<?php while ($posts->next()): ?>
<tr id="<?php $posts->theId(); ?>">
<td class="kit-hidden-mb"><input type="checkbox" value="<?php $posts->cid(); ?>"
name="cid[]"/></td>
<td class="kit-hidden-mb"><a
href="<?php $options->adminUrl('manage-comments.php?cid=' . ($posts->parentId ? $posts->parentId : $posts->cid)); ?>"
class="balloon-button size-<?php echo \Typecho\Common::splitByCount($posts->commentsNum, 1, 10, 20, 50, 100); ?>"
title="<?php $posts->commentsNum(); ?> <?php _e('评论'); ?>"><?php $posts->commentsNum(); ?></a>
</td>
<td>
<a href="<?php $options->adminUrl('write-post.php?cid=' . $posts->cid); ?>"><?php $posts->title(); ?></a>
<?php
if ('post_draft' == $posts->type) {
echo '<em class="status">' . _t('草稿') . '</em>';
} elseif ($posts->revision) {
echo '<em class="status">' . _t('有修订版') . '</em>';
}
if ('hidden' == $posts->status) {
echo '<em class="status">' . _t('隐藏') . '</em>';
} elseif ('waiting' == $posts->status) {
echo '<em class="status">' . _t('待审核') . '</em>';
} elseif ('private' == $posts->status) {
echo '<em class="status">' . _t('私密') . '</em>';
} elseif ($posts->password) {
echo '<em class="status">' . _t('密码保护') . '</em>';
}
?>
<a href="<?php $options->adminUrl('write-post.php?cid=' . $posts->cid); ?>"
title="<?php _e('编辑 %s', htmlspecialchars($posts->title)); ?>"><i
class="i-edit"></i></a>
<?php if ('post_draft' != $posts->type): ?>
<a href="<?php $posts->permalink(); ?>"
title="<?php _e('浏览 %s', htmlspecialchars($posts->title)); ?>"><i
class="i-exlink"></i></a>
<?php endif; ?>
</td>
<td class="kit-hidden-mb"><a
href="<?php $options->adminUrl('manage-posts.php?__typecho_all_posts=off&uid=' . $posts->author->uid); ?>"><?php $posts->author(); ?></a>
</td>
<td class="kit-hidden-mb"><?php $categories = $posts->categories;
while ($categories->next()): ?>
<?php echo '<a href="';
$options->adminUrl('manage-posts.php?category=' . $categories->mid
. (isset($request->uid) ? '&uid=' . $request->filter('encode')->uid : '')
. (isset($request->status) ? '&status=' . $request->filter('encode')->status : ''));
echo '">' . $categories->name . '</a>' . ($categories->sequence < $categories->length - 1 ? ', ' : ''); ?>
<?php endwhile; ?>
</td>
<td>
<?php if ('post_draft' == $posts->type || $posts->revision): ?>
<span class="description">
<?php $modifyDate = new \Typecho\Date($posts->revision ? $posts->revision['modified'] : $posts->modified); ?>
<?php _e('保存于 %s', $modifyDate->word()); ?>
</span>
<?php else: ?>
<?php $posts->dateWord(); ?>
<?php endif; ?>
</td>
</tr>
<?php endwhile; ?>
<?php else: ?>
<tr>
<td colspan="6"><h6 class="typecho-list-table-title"><?php _e('没有任何文章'); ?></h6>
if ('hidden' == $posts->status) {
echo '<em class="status">' . _t('隐藏') . '</em>';
} elseif ('waiting' == $posts->status) {
echo '<em class="status">' . _t('待审核') . '</em>';
} elseif ('private' == $posts->status) {
echo '<em class="status">' . _t('私密') . '</em>';
} elseif ($posts->password) {
echo '<em class="status">' . _t('密码保护') . '</em>';
}
?>
<a href="<?php $options->adminUrl('write-post.php?cid=' . $posts->cid); ?>"
title="<?php _e('编辑 %s', htmlspecialchars($posts->title)); ?>"><i
class="i-edit"></i></a>
<?php if ('post_draft' != $posts->type): ?>
<a href="<?php $posts->permalink(); ?>"
title="<?php _e('浏览 %s', htmlspecialchars($posts->title)); ?>"><i
class="i-exlink"></i></a>
<?php endif; ?>
</td>
<td class="kit-hidden-mb"><a
href="<?php $options->adminUrl('manage-posts.php?__typecho_all_posts=off&uid=' . $posts->author->uid); ?>"><?php $posts->author(); ?></a>
</td>
<td class="kit-hidden-mb"><?php foreach($posts->categories as $index => $category): ?><!--
--><?php echo ($index > 0 ? ', ' : '') . '<a href="';
$options->adminUrl('manage-posts.php?category=' . $category['mid']
. (isset($request->uid) ? '&uid=' . $request->filter('encode')->uid : '')
. (isset($request->status) ? '&status=' . $request->filter('encode')->status : ''));
echo '">' . $category['name'] . '</a>'; ?><!--
--><?php endforeach; ?>
</td>
<td>
<?php if ('post_draft' == $posts->type || $posts->revision): ?>
<span class="description">
<?php $modifyDate = new \Typecho\Date($posts->revision ? $posts->revision['modified'] : $posts->modified); ?>
<?php _e('保存于 %s', $modifyDate->word()); ?>
</span>
<?php else: ?>
<?php $posts->dateWord(); ?>
<?php endif; ?>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
<?php endwhile; ?>
<?php else: ?>
<tr>
<td colspan="6" class="none"><?php _e('没有任何文章'); ?></td>
</tr>
<?php endif; ?>
</tbody>
</table>
</form><!-- end .operate-form -->
<div class="typecho-list-operate clearfix">
<form method="get">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i
class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i
class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a lang="<?php _e('你确认要删除这些文章吗?'); ?>"
href="<?php $security->index('/action/contents-post-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
<form method="get" class="typecho-list-operate">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i
class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i
class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a lang="<?php _e('你确认要删除这些文章吗?'); ?>"
href="<?php $security->index('/action/contents-post-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
</li>
<?php if ($user->pass('editor', true)): ?>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=publish'); ?>"><?php _e('标记为<strong>%s</strong>', _t('公开')); ?></a>
</li>
<?php if ($user->pass('editor', true)): ?>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=publish'); ?>"><?php _e('标记为<strong>%s</strong>', _t('公开')); ?></a>
</li>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=waiting'); ?>"><?php _e('标记为<strong>%s</strong>', _t('待审核')); ?></a>
</li>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=hidden'); ?>"><?php _e('标记为<strong>%s</strong>', _t('隐藏')); ?></a>
</li>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=private'); ?>"><?php _e('标记为<strong>%s</strong>', _t('私密')); ?></a>
</li>
<?php endif; ?>
</ul>
</div>
</div>
<?php if ($posts->have()): ?>
<ul class="typecho-pager">
<?php $posts->pageNav(); ?>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=waiting'); ?>"><?php _e('标记为<strong>%s</strong>', _t('待审核')); ?></a>
</li>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=hidden'); ?>"><?php _e('标记为<strong>%s</strong>', _t('隐藏')); ?></a>
</li>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=private'); ?>"><?php _e('标记为<strong>%s</strong>', _t('私密')); ?></a>
</li>
<?php endif; ?>
</ul>
<?php endif; ?>
</form>
</div><!-- end .typecho-list-operate -->
</div>
</div>
<?php if ($posts->have()): ?>
<ul class="typecho-pager">
<?php $posts->pageNav(); ?>
</ul>
<?php endif; ?>
</form>
</div><!-- end .typecho-list -->
</div><!-- end .typecho-page-main -->
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -6,7 +6,7 @@ include 'menu.php';
\Widget\Metas\Tag\Admin::alloc()->to($tags);
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main manage-metas">
@@ -14,7 +14,7 @@ include 'menu.php';
<div class="col-mb-12 col-tb-8" role="main">
<form method="post" name="manage_tags" class="operate-form">
<div class="typecho-list-operate clearfix">
<div class="typecho-list-operate">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
@@ -39,8 +39,8 @@ include 'menu.php';
</div>
</div>
<ul class="typecho-list-notable tag-list clearfix">
<?php if ($tags->have()): ?>
<?php if ($tags->have()): ?>
<ul class="typecho-list-notable tag-list">
<?php while ($tags->next()): ?>
<li class="size-<?php $tags->split(5, 10, 20, 30); ?>" id="<?php $tags->theId(); ?>">
<input type="checkbox" value="<?php $tags->mid(); ?>" name="mid[]"/>
@@ -51,10 +51,12 @@ include 'menu.php';
class="i-edit"></i></a>
</li>
<?php endwhile; ?>
<?php else: ?>
<h6 class="typecho-list-table-title"><?php _e('没有任何标签'); ?></h6>
<?php endif; ?>
</ul>
</ul>
<?php else: ?>
<ul class="tag-list">
<li class="none"><?php _e('没有任何标签'); ?></li>
</ul>
<?php endif; ?>
<input type="hidden" name="do" value="delete"/>
</form>
@@ -64,7 +66,7 @@ include 'menu.php';
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -5,131 +5,125 @@ include 'menu.php';
$users = \Widget\Users\Admin::alloc();
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="main">
<div class="col-mb-12 typecho-list">
<div class="typecho-list-operate clearfix">
<form method="get">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i
class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i
class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a lang="<?php _e('你确认要删除这些用户吗?'); ?>"
href="<?php $security->index('/action/users-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
</li>
</ul>
</div>
<form method="get" class="typecho-list-operate">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i
class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i
class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a lang="<?php _e('你确认要删除这些用户吗?'); ?>"
href="<?php $security->index('/action/users-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
</li>
</ul>
</div>
<div class="search" role="search">
<?php if ('' != $request->keywords): ?>
<a href="<?php $options->adminUrl('manage-users.php'); ?>"><?php _e('&laquo; 取消筛选'); ?></a>
<?php endif; ?>
<input type="text" class="text-s" placeholder="<?php _e('请输入关键字'); ?>"
value="<?php echo $request->filter('html')->keywords; ?>" name="keywords"/>
<button type="submit" class="btn btn-s"><?php _e('筛选'); ?></button>
</div>
</form>
</div><!-- end .typecho-list-operate -->
</div>
<div class="search" role="search">
<?php if ('' != $request->keywords): ?>
<a href="<?php $options->adminUrl('manage-users.php'); ?>"><?php _e('&laquo; 取消筛选'); ?></a>
<?php endif; ?>
<input type="text" class="text-s" placeholder="<?php _e('请输入关键字'); ?>"
value="<?php echo $request->filter('html')->keywords; ?>" name="keywords"/>
<button type="submit" class="btn btn-s"><?php _e('筛选'); ?></button>
</div>
</form>
<form method="post" name="manage_users" class="operate-form">
<div class="typecho-table-wrap">
<table class="typecho-list-table">
<colgroup>
<col width="20" class="kit-hidden-mb"/>
<col width="6%" class="kit-hidden-mb"/>
<col width="30%"/>
<col width="" class="kit-hidden-mb"/>
<col width="25%" class="kit-hidden-mb"/>
<col width="15%"/>
</colgroup>
<thead>
<tr>
<th class="kit-hidden-mb"></th>
<th class="kit-hidden-mb"></th>
<th><?php _e('用户名'); ?></th>
<th class="kit-hidden-mb"><?php _e('昵称'); ?></th>
<th class="kit-hidden-mb"><?php _e('电子邮件'); ?></th>
<th><?php _e('用户组'); ?></th>
<table class="typecho-list-table">
<colgroup>
<col width="3%" class="kit-hidden-mb"/>
<col width="6%" class="kit-hidden-mb"/>
<col width="30%"/>
<col width="" class="kit-hidden-mb"/>
<col width="25%" class="kit-hidden-mb"/>
<col width="15%"/>
</colgroup>
<thead>
<tr>
<th class="kit-hidden-mb"></th>
<th class="kit-hidden-mb"></th>
<th><?php _e('用户名'); ?></th>
<th class="kit-hidden-mb"><?php _e('昵称'); ?></th>
<th class="kit-hidden-mb"><?php _e('电子邮件'); ?></th>
<th><?php _e('用户组'); ?></th>
</tr>
</thead>
<tbody>
<?php while ($users->next()): ?>
<tr id="user-<?php $users->uid(); ?>">
<td class="kit-hidden-mb"><input type="checkbox" value="<?php $users->uid(); ?>"
name="uid[]"/></td>
<td class="kit-hidden-mb"><a
href="<?php $options->adminUrl('manage-posts.php?__typecho_all_posts=off&uid=' . $users->uid); ?>"
class="balloon-button left size-<?php echo \Typecho\Common::splitByCount($users->postsNum, 1, 10, 20, 50, 100); ?>"><?php $users->postsNum(); ?></a>
</td>
<td>
<a href="<?php $options->adminUrl('user.php?uid=' . $users->uid); ?>"><?php $users->name(); ?></a>
<a href="<?php $users->permalink(); ?>"
title="<?php _e('浏览 %s', $users->screenName); ?>"><i
class="i-exlink"></i></a>
</td>
<td class="kit-hidden-mb"><?php $users->screenName(); ?></td>
<td class="kit-hidden-mb"><?php if ($users->mail): ?><a
href="mailto:<?php $users->mail(); ?>"><?php $users->mail(); ?></a><?php else: _e('暂无'); endif; ?>
</td>
<td><?php switch ($users->group) {
case 'administrator':
_e('管理员');
break;
case 'editor':
_e('编辑');
break;
case 'contributor':
_e('贡献者');
break;
case 'subscriber':
_e('关注者');
break;
case 'visitor':
_e('访问者');
break;
default:
break;
} ?></td>
</tr>
</thead>
<tbody>
<?php while ($users->next()): ?>
<tr id="user-<?php $users->uid(); ?>">
<td class="kit-hidden-mb"><input type="checkbox" value="<?php $users->uid(); ?>"
name="uid[]"/></td>
<td class="kit-hidden-mb"><a
href="<?php $options->adminUrl('manage-posts.php?__typecho_all_posts=off&uid=' . $users->uid); ?>"
class="balloon-button left size-<?php echo \Typecho\Common::splitByCount($users->postsNum, 1, 10, 20, 50, 100); ?>"><?php $users->postsNum(); ?></a>
</td>
<td>
<a href="<?php $options->adminUrl('user.php?uid=' . $users->uid); ?>"><?php $users->name(); ?></a>
<a href="<?php $users->permalink(); ?>"
title="<?php _e('浏览 %s', $users->screenName); ?>"><i
class="i-exlink"></i></a>
</td>
<td class="kit-hidden-mb"><?php $users->screenName(); ?></td>
<td class="kit-hidden-mb"><?php if ($users->mail): ?><a
href="mailto:<?php $users->mail(); ?>"><?php $users->mail(); ?></a><?php else: _e('暂无'); endif; ?>
</td>
<td><?php switch ($users->group) {
case 'administrator':
_e('管理员');
break;
case 'editor':
_e('编辑');
break;
case 'contributor':
_e('贡献者');
break;
case 'subscriber':
_e('关注者');
break;
case 'visitor':
_e('访问者');
break;
default:
break;
} ?></td>
</tr>
<?php endwhile; ?>
</tbody>
</table><!-- end .typecho-list-table -->
</div><!-- end .typecho-table-wrap -->
<?php endwhile; ?>
</tbody>
</table><!-- end .typecho-list-table -->
</form><!-- end .operate-form -->
<div class="typecho-list-operate clearfix">
<form method="get">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i
class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i
class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a lang="<?php _e('你确认要删除这些用户吗?'); ?>"
href="<?php $security->index('/action/users-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
</li>
</ul>
</div>
</div>
<?php if ($users->have()): ?>
<ul class="typecho-pager">
<?php $users->pageNav(); ?>
<form method="get" class="typecho-list-operate">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i
class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i
class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a lang="<?php _e('你确认要删除这些用户吗?'); ?>"
href="<?php $security->index('/action/users-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
</li>
</ul>
<?php endif; ?>
</form>
</div><!-- end .typecho-list-operate -->
</div>
</div>
<?php if ($users->have()): ?>
<ul class="typecho-pager">
<?php $users->pageNav(); ?>
</ul>
<?php endif; ?>
</form>
</div><!-- end .typecho-list -->
</div><!-- end .typecho-page-main -->
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -6,7 +6,7 @@ include 'menu.php';
\Widget\Contents\Attachment\Edit::alloc()->prepare()->to($attachment);
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main">
@@ -40,7 +40,7 @@ include 'menu.php';
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -1,18 +1,22 @@
<?php if (!defined('__TYPECHO_ADMIN__')) exit; ?>
<div class="typecho-head-nav clearfix" role="navigation">
<button class="menu-bar"><?php _e('菜单'); ?></button>
<nav id="typecho-nav-list">
<?php $menu->output(); ?>
<header class="typecho-head-nav" role="navigation">
<nav>
<details class="menu-bar">
<summary><?php _e('菜单'); ?></summary>
</details>
<menu>
<?php $menu->output(); ?>
<li class="operate">
<?php \Typecho\Plugin::factory('admin/menu.php')->call('navBar'); ?><a title="<?php
if ($user->logged > 0) {
$logged = new \Typecho\Date($user->logged);
_e('最后登录: %s', $logged->word());
}
?>" href="<?php $options->adminUrl('profile.php'); ?>" class="author"><?php $user->screenName(); ?></a><a
class="exit" href="<?php $options->logoutUrl(); ?>"><?php _e('登出'); ?></a><a
href="<?php $options->siteUrl(); ?>"><?php _e('网站'); ?></a>
</li>
</menu>
</nav>
<div class="operate">
<?php \Typecho\Plugin::factory('admin/menu.php')->call('navBar'); ?><a title="<?php
if ($user->logged > 0) {
$logged = new \Typecho\Date($user->logged);
_e('最后登录: %s', $logged->word());
}
?>" href="<?php $options->adminUrl('profile.php'); ?>" class="author"><?php $user->screenName(); ?></a><a
class="exit" href="<?php $options->logoutUrl(); ?>"><?php _e('登出'); ?></a><a
href="<?php $options->siteUrl(); ?>"><?php _e('网站'); ?></a>
</div>
</div>
</header>

View File

@@ -4,7 +4,7 @@ include 'header.php';
include 'menu.php';
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="form">
@@ -13,7 +13,7 @@ include 'menu.php';
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -4,7 +4,7 @@ include 'header.php';
include 'menu.php';
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="form">
@@ -13,7 +13,7 @@ include 'menu.php';
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -4,7 +4,7 @@ include 'header.php';
include 'menu.php';
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="form">
@@ -13,7 +13,7 @@ include 'menu.php';
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -4,7 +4,7 @@ include 'header.php';
include 'menu.php';
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="form">
@@ -13,7 +13,7 @@ include 'menu.php';
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -4,7 +4,7 @@ include 'header.php';
include 'menu.php';
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="form">
@@ -13,7 +13,7 @@ include 'menu.php';
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -4,26 +4,17 @@ include 'header.php';
include 'menu.php';
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<?php include 'theme-tabs.php'; ?>
<div class="row typecho-page-main" role="main">
<div class="col-mb-12">
<ul class="typecho-option-tabs fix-tabs clearfix">
<li><a href="<?php $options->adminUrl('themes.php'); ?>"><?php _e('可以使用的外观'); ?></a></li>
<?php if (!defined('__TYPECHO_THEME_WRITEABLE__') || __TYPECHO_THEME_WRITEABLE__): ?>
<li><a href="<?php $options->adminUrl('theme-editor.php'); ?>"><?php _e('编辑当前外观'); ?></a></li>
<?php endif; ?>
<li class="current"><a
href="<?php $options->adminUrl('options-theme.php'); ?>"><?php _e('设置外观'); ?></a></li>
</ul>
</div>
<div class="col-mb-12 col-tb-8 col-tb-offset-2" role="form">
<?php \Widget\Themes\Config::alloc()->config()->render(); ?>
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -1,8 +1,9 @@
<?php if(!defined('__TYPECHO_ADMIN__')) exit; ?>
<?php if (!defined('__TYPECHO_ADMIN__')) exit; ?>
<div class="typecho-page-title">
<h2><?php echo $menu->title; ?><?php
<h2><?php echo $menu->title; ?></h2>
<?php
if (!empty($menu->addLink)) {
echo "<a href=\"{$menu->addLink}\">" . _t("新增") . "</a>";
}
?></h2>
?>
</div>

View File

@@ -3,7 +3,7 @@ include 'common.php';
include 'header.php';
include 'menu.php';
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="main">
@@ -11,120 +11,116 @@ include 'menu.php';
<?php \Widget\Plugins\Rows::allocWithAlias('activated', 'activated=1')->to($activatedPlugins); ?>
<?php if ($activatedPlugins->have() || !empty($activatedPlugins->activatedPlugins)): ?>
<h4 class="typecho-list-table-title"><?php _e('启用的插件'); ?></h4>
<div class="typecho-table-wrap">
<table class="typecho-list-table">
<colgroup>
<col width="25%"/>
<col width="45%"/>
<col width="8%" class="kit-hidden-mb"/>
<col width="10%" class="kit-hidden-mb"/>
<col width=""/>
</colgroup>
<thead>
<tr>
<th><?php _e('名称'); ?></th>
<th><?php _e('描述'); ?></th>
<th class="kit-hidden-mb"><?php _e('版本'); ?></th>
<th class="kit-hidden-mb"><?php _e('作'); ?></th>
<th><?php _e('操作'); ?></th>
<table class="typecho-list-table">
<colgroup>
<col width="25%"/>
<col width="45%"/>
<col width="8%" class="kit-hidden-mb"/>
<col width="10%" class="kit-hidden-mb"/>
<col width=""/>
</colgroup>
<thead>
<tr>
<th><?php _e('名称'); ?></th>
<th><?php _e('描述'); ?></th>
<th class="kit-hidden-mb"><?php _e('版本'); ?></th>
<th class="kit-hidden-mb"><?php _e('作者'); ?></th>
<th><?php _e('作'); ?></th>
</tr>
</thead>
<tbody>
<?php while ($activatedPlugins->next()): ?>
<tr id="plugin-<?php $activatedPlugins->name(); ?>">
<td><?php $activatedPlugins->title(); ?>
<?php if (!$activatedPlugins->dependence): ?>
<i class="i-delete"
title="<?php _e('%s 无法在此版本的typecho下正常工作', $activatedPlugins->title); ?>"></i>
<?php endif; ?>
</td>
<td><?php $activatedPlugins->description(); ?></td>
<td class="kit-hidden-mb"><?php $activatedPlugins->version(); ?></td>
<td class="kit-hidden-mb"><?php echo empty($activatedPlugins->homepage) ? $activatedPlugins->author : '<a href="' . $activatedPlugins->homepage
. '">' . $activatedPlugins->author . '</a>'; ?></td>
<td>
<?php if ($activatedPlugins->activate || $activatedPlugins->deactivate || $activatedPlugins->config || $activatedPlugins->personalConfig): ?>
<?php if ($activatedPlugins->config): ?>
<a href="<?php $options->adminUrl('options-plugin.php?config=' . $activatedPlugins->name); ?>"><?php _e('设置'); ?></a>
&bull;
<?php endif; ?>
<a lang="<?php _e('你确认要禁用插件 %s 吗?', $activatedPlugins->name); ?>"
href="<?php $security->index('/action/plugins-edit?deactivate=' . $activatedPlugins->name); ?>"><?php _e('禁用'); ?></a>
<?php else: ?>
<span class="important"><?php _e('即插即用'); ?></span>
<?php endif; ?>
</td>
</tr>
</thead>
<tbody>
<?php while ($activatedPlugins->next()): ?>
<tr id="plugin-<?php $activatedPlugins->name(); ?>">
<td><?php $activatedPlugins->title(); ?>
<?php if (!$activatedPlugins->dependence): ?>
<i class="i-delete"
title="<?php _e('%s 无法在此版本的typecho下正常工作', $activatedPlugins->title); ?>"></i>
<?php endif; ?>
</td>
<td><?php $activatedPlugins->description(); ?></td>
<td class="kit-hidden-mb"><?php $activatedPlugins->version(); ?></td>
<td class="kit-hidden-mb"><?php echo empty($activatedPlugins->homepage) ? $activatedPlugins->author : '<a href="' . $activatedPlugins->homepage
. '">' . $activatedPlugins->author . '</a>'; ?></td>
<td>
<?php if ($activatedPlugins->activate || $activatedPlugins->deactivate || $activatedPlugins->config || $activatedPlugins->personalConfig): ?>
<?php if ($activatedPlugins->config): ?>
<a href="<?php $options->adminUrl('options-plugin.php?config=' . $activatedPlugins->name); ?>"><?php _e('设置'); ?></a>
&bull;
<?php endif; ?>
<a lang="<?php _e('你确认要禁用插件 %s 吗?', $activatedPlugins->name); ?>"
href="<?php $security->index('/action/plugins-edit?deactivate=' . $activatedPlugins->name); ?>"><?php _e('禁用'); ?></a>
<?php else: ?>
<span class="important"><?php _e('即插即用'); ?></span>
<?php endif; ?>
<?php endwhile; ?>
<?php if (!empty($activatedPlugins->activatedPlugins)): ?>
<?php foreach ($activatedPlugins->activatedPlugins as $key => $val): ?>
<tr>
<td><?php echo $key; ?></td>
<td colspan="3"><span
class="warning"><?php _e('此插件文件已经损坏或者被不安全移除, 强烈建议你禁用它'); ?></span></td>
<td><a lang="<?php _e('你确认要禁用插件 %s 吗?', $key); ?>"
href="<?php $security->index('/action/plugins-edit?deactivate=' . $key); ?>"><?php _e('禁用'); ?></a>
</td>
</tr>
<?php endwhile; ?>
<?php endforeach; ?>
<?php endif; ?>
<?php if (!empty($activatedPlugins->activatedPlugins)): ?>
<?php foreach ($activatedPlugins->activatedPlugins as $key => $val): ?>
<tr>
<td><?php echo $key; ?></td>
<td colspan="3"><span
class="warning"><?php _e('此插件文件已经损坏或者被不安全移除, 强烈建议你禁用它'); ?></span></td>
<td><a lang="<?php _e('你确认要禁用插件 %s 吗?', $key); ?>"
href="<?php $security->index('/action/plugins-edit?deactivate=' . $key); ?>"><?php _e('禁用'); ?></a>
</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
</div>
</tbody>
</table>
<?php endif; ?>
<?php \Widget\Plugins\Rows::allocWithAlias('unactivated', 'activated=0')->to($deactivatedPlugins); ?>
<?php if ($deactivatedPlugins->have() || !$activatedPlugins->have()): ?>
<h4 class="typecho-list-table-title"><?php _e('禁用的插件'); ?></h4>
<div class="typecho-table-wrap">
<table class="typecho-list-table deactivate">
<colgroup>
<col width="25%"/>
<col width="45%"/>
<col width="8%" class="kit-hidden-mb"/>
<col width="10%" class="kit-hidden-mb"/>
<col width=""/>
</colgroup>
<thead>
<tr>
<th><?php _e('名称'); ?></th>
<th><?php _e('描述'); ?></th>
<th class="kit-hidden-mb"><?php _e('版本'); ?></th>
<th class="kit-hidden-mb"><?php _e('作'); ?></th>
<th class="typecho-radius-topright"><?php _e('操作'); ?></th>
</tr>
</thead>
<tbody>
<?php if ($deactivatedPlugins->have()): ?>
<?php while ($deactivatedPlugins->next()): ?>
<tr id="plugin-<?php $deactivatedPlugins->name(); ?>">
<td><?php $deactivatedPlugins->title(); ?></td>
<td><?php $deactivatedPlugins->description(); ?></td>
<td class="kit-hidden-mb"><?php $deactivatedPlugins->version(); ?></td>
<td class="kit-hidden-mb"><?php echo empty($deactivatedPlugins->homepage) ? $deactivatedPlugins->author : '<a href="' . $deactivatedPlugins->homepage
. '">' . $deactivatedPlugins->author . '</a>'; ?></td>
<td>
<a href="<?php $security->index('/action/plugins-edit?activate=' . $deactivatedPlugins->name); ?>"><?php _e('启用'); ?></a>
</td>
</tr>
<?php endwhile; ?>
<?php else: ?>
<tr>
<td colspan="5"><h6 class="typecho-list-table-title"><?php _e('没有安装插件'); ?></h6>
<table class="typecho-list-table deactivate">
<colgroup>
<col width="25%"/>
<col width="45%"/>
<col width="8%" class="kit-hidden-mb"/>
<col width="10%" class="kit-hidden-mb"/>
<col width=""/>
</colgroup>
<thead>
<tr>
<th><?php _e('名称'); ?></th>
<th><?php _e('描述'); ?></th>
<th class="kit-hidden-mb"><?php _e('版本'); ?></th>
<th class="kit-hidden-mb"><?php _e('作者'); ?></th>
<th class="typecho-radius-topright"><?php _e('作'); ?></th>
</tr>
</thead>
<tbody>
<?php if ($deactivatedPlugins->have()): ?>
<?php while ($deactivatedPlugins->next()): ?>
<tr id="plugin-<?php $deactivatedPlugins->name(); ?>">
<td><?php $deactivatedPlugins->title(); ?></td>
<td><?php $deactivatedPlugins->description(); ?></td>
<td class="kit-hidden-mb"><?php $deactivatedPlugins->version(); ?></td>
<td class="kit-hidden-mb"><?php echo empty($deactivatedPlugins->homepage) ? $deactivatedPlugins->author : '<a href="' . $deactivatedPlugins->homepage
. '">' . $deactivatedPlugins->author . '</a>'; ?></td>
<td>
<a href="<?php $security->index('/action/plugins-edit?activate=' . $deactivatedPlugins->name); ?>"><?php _e('启用'); ?></a>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
<?php endwhile; ?>
<?php else: ?>
<tr>
<td colspan="5"><h6 class="typecho-list-table-title"><?php _e('没有安装插件'); ?></h6>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
<?php endif; ?>
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -6,7 +6,7 @@ include 'menu.php';
$stat = \Widget\Stat::alloc();
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main">
@@ -51,7 +51,7 @@ $stat = \Widget\Stat::alloc();
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -583,44 +583,46 @@
parseBlockTable(block, key, line, state, lines) {
var align, aligns, head, j, len, matches, row, rows;
if (!!(matches = line.match(/^((?:(?:(?:\||\+)(?:[ :]*\-+[ :]*)(?:\||\+))|(?:(?:[ :]*\-+[ :]*)(?:\||\+)(?:[ :]*\-+[ :]*))|(?:(?:[ :]*\-+[ :]*)(?:\||\+))|(?:(?:\||\+)(?:[ :]*\-+[ :]*)))+)$/))) {
if (this.isBlock('table')) {
block[3][0].push(block[3][2]);
block[3][2] += 1;
this.setBlock(key, block[3]);
} else {
head = 0;
if ((block == null) || block[0] !== 'normal' || lines[block[2]].match(/^\s*$/)) {
this.startBlock('table', key);
if (!!(matches = line.match(/^\s*(\|?[ :]*-{2,}[ :]*(?:[\|\+][ :]*-{2,}[ :]*)*\|?)\s*$/))) {
if (matches[1].indexOf('|') >= 0 || matches[1].indexOf('+') >= 0) {
if (this.isBlock('table')) {
block[3][0].push(block[3][2]);
block[3][2] += 1;
this.setBlock(key, block[3]);
} else {
head = 1;
this.backBlock(1, 'table');
}
if (matches[1][0] === '|') {
matches[1] = matches[1].substring(1);
if (matches[1][matches[1].length - 1] === '|') {
matches[1] = matches[1].substring(0, matches[1].length - 1);
head = 0;
if ((block == null) || block[0] !== 'normal' || lines[block[2]].match(/^\s*$/)) {
this.startBlock('table', key);
} else {
head = 1;
this.backBlock(1, 'table');
}
}
rows = matches[1].split(/\+|\|/);
aligns = [];
for (j = 0, len = rows.length; j < len; j++) {
row = rows[j];
align = 'none';
if (!!(matches = row.match(/^\s*(:?)\-+(:?)\s*$/))) {
if (!!matches[1] && !!matches[2]) {
align = 'center';
} else if (!!matches[1]) {
align = 'left';
} else if (!!matches[2]) {
align = 'right';
if (matches[1][0] === '|') {
matches[1] = matches[1].substring(1);
if (matches[1][matches[1].length - 1] === '|') {
matches[1] = matches[1].substring(0, matches[1].length - 1);
}
}
aligns.push(align);
rows = matches[1].split(/\+|\|/);
aligns = [];
for (j = 0, len = rows.length; j < len; j++) {
row = rows[j];
align = 'none';
if (!!(matches = row.match(/^\s*(:?)\-+(:?)\s*$/))) {
if (!!matches[1] && !!matches[2]) {
align = 'center';
} else if (!!matches[1]) {
align = 'left';
} else if (!!matches[2]) {
align = 'right';
}
}
aligns.push(align);
}
this.setBlock(key, [[head], aligns, head + 1]);
}
this.setBlock(key, [[head], aligns, head + 1]);
return false;
}
return false;
}
return true;
}
@@ -649,7 +651,7 @@
}
parseBlockShr(block, key, line) {
if (!!(line.match(/^(\* *){3,}\s*$/))) {
if (!!(line.match(/^\*{3,}\s*$/))) {
this.startBlock('hr', key).endBlock();
return false;
}
@@ -657,7 +659,7 @@
}
parseBlockDhr(block, key, line) {
if (!!(line.match(/^(- *){3,}\s*$/))) {
if (!!(line.match(/^-{3,}\s*$/))) {
this.startBlock('hr', key).endBlock();
return false;
}

View File

@@ -2882,8 +2882,8 @@ else
text = text.replace(/^http:\/\/(https?|ftp):\/\//, '$1://');
// fix issue #552
if (!/^(?:https?|ftp):\/\//.test(text) && !/^[_a-z0-9-]+:/i.test(text))
text = 'http://' + text;
// if (!/^(?:https?|ftp):\/\//.test(text) && !/^[_a-z0-9-]+:/i.test(text))
// text = 'http://' + text;
}
dialog.parentNode.removeChild(dialog);

View File

@@ -378,7 +378,7 @@ function scrollableEditor(el, preview) {
// 表格选择插件
$.fn.tableSelectable = function (options) {
var table = this, s = $.extend({
const table = this, s = $.extend({
checkEl : null,
rowEl : null,
selectAllEl : null,
@@ -386,19 +386,13 @@ function scrollableEditor(el, preview) {
}, options);
function clickRow (t) {
var t = $(t), check = $(s.checkEl, t), checked = check.prop('checked');
const check = $(s.checkEl, t), checked = check.prop('checked');
if (!check.length) {
return;
}
check.prop('checked', !checked);
if (checked) {
t.removeClass('checked');
} else {
t.addClass('checked');
}
}
$(s.rowEl, this).each(function () {
@@ -406,9 +400,9 @@ function scrollableEditor(el, preview) {
clickRow($(this).parents(s.rowEl));
});
}).click(function (e) {
var target = $(e.toElement ? e.toElement : e.target),
const target = $(e.toElement ? e.toElement : e.target),
tagName = target.prop('tagName').toLowerCase();
if ($.inArray(tagName, ['input', 'textarea', 'a', 'button', 'i']) >= 0
&& 'checkbox' != target.attr('type')) {
e.stopPropagation();
@@ -418,27 +412,15 @@ function scrollableEditor(el, preview) {
});
$(s.selectAllEl).click(function () {
var t = $(this), checked = t.prop('checked');
if (checked) {
$(s.rowEl, table).each(function () {
var t = $(this), el = $(s.checkEl, this).prop('checked', true);
if (el.length > 0) {
t.addClass('checked');
}
});
} else {
$(s.rowEl, table).each(function () {
var t = $(this), el = $(s.checkEl, this).prop('checked', false);
if (el.length > 0) {
t.removeClass('checked');
}
});
}
const t = $(this), checked = t.prop('checked');
$(s.rowEl, table).each(function () {
$(s.checkEl, this).prop('checked', !!checked);
});
});
$(s.actionEl).click(function () {
var t = $(this), lang = t.attr('lang');
const t = $(this), lang = t.attr('lang');
if (!lang || confirm(lang)) {
table.parents('form').attr('action', t.attr('href')).submit();

View File

@@ -2,7 +2,7 @@
* Forms
*/
input[type=text], input[type=url], input[type=password], input[type=email],
input[type=text], input[type=url], input[type=password], input[type=email], input[type=number],
textarea {
background: #FFF;
border: 1px solid #D9D9D6;

View File

@@ -13,9 +13,12 @@ $color-nav-child-focus: #6DA1BB;
.typecho-head-nav {
padding: 0 10px;
background: $color-nav-bg;
position: relative;
position: sticky;
top: 0;
display: flex;
z-index: 100;
a, button.menu-bar {
a, .menu-bar summary {
padding: 0 20px;
height: 36px;
line-height: 36px;
@@ -28,192 +31,213 @@ $color-nav-child-focus: #6DA1BB;
}
}
button.menu-bar {
.menu-bar {
display: none;
}
#typecho-nav-list {
float: left;
menu {
margin: 0;
padding: 0;
list-style: none;
background: $color-nav-bg;
}
& > ul {
list-style: none;
margin: 0;
padding: 0;
nav {
width: 100%;
& > menu {
display: flex;
position: relative;
float: left;
width: 100%;
&:first-child {
border-left: $border-nav;
}
& > li {
.parent {
a {
display: inline-block;
border-right: $border-nav;
background: $color-nav-bg;
&:first-child {
border-left: $border-nav;
}
}
.child {
position: absolute;
list-style: none;
top: 36px;
display: none;
margin: 0;
padding: 0;
min-width: 160px;
max-width: 240px;
background: $color-nav-btn-hover;
z-index: 250;
> a {
display: block;
border-right: $border-nav;
li {
&.return {
display: none;
}
&:hover, &:focus {
background: $color-nav-btn-hover;
a {
overflow: hidden;
text-overflow : ellipsis;
white-space: nowrap;
display: block;
&:hover,
&:focus {
background: $color-nav-bg;
& + menu {
display: flex;
}
}
}
&.focus a {
color: $color-nav-child-focus;
&:not(.operate) {
&.focus > a {
background: $color-nav-btn-hover;
font-weight: bold;
}
&:hover > a {
background: $color-nav-btn-hover;
}
}
}
.parent a:hover,
&.focus .parent a,
&.root:hover .parent a {
background: $color-nav-btn-hover;
}
&:hover, &:focus-within, &:focus {
menu {
display: flex;
}
}
&.focus .parent a {
font-weight: bold;
}
&.root:hover .child, &.root.expanded .child {
display: block;
}
}
}
.operate {
float: right;
a {
display: inline-block;
margin-left: -1px;
border: $border-nav;
border-width: 0 1px;
&:hover {
background-color: $color-nav-btn-hover;
}
}
}
}
@media (max-width: $screen-phone - 1px) {
@keyframes out {
from {left: 0%;}
to {left: -100%;}
}
@keyframes in {
from {left: -100%;}
to {left: 0%;}
}
.typecho-head-nav {
padding: 0;
position: fixed;
bottom: 0;
width: 100%;
z-index: 10;
#typecho-nav-list {
display: none;
}
.operate {
a:last-child {
border-right-width: 0;
}
}
button.menu-bar {
display: inline-block;
border: none;
background: $color-nav-bg;
border-right: $border-nav;
&.focus {
color: $color-nav-text-hover;
& + #typecho-nav-list {
display: block;
float: none;
menu {
position: absolute;
bottom: 36px;
width: 100%;
& > ul {
float: none;
border-bottom: $border-nav;
position: static;
top: 36px;
display: none;
flex-flow: column;
min-width: 160px;
max-width: 240px;
background: $color-nav-btn-hover;
z-index: 250;
& > li {
a {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: block;
&:hover,
&:focus {
background: $color-nav-bg;
}
}
&.focus a {
color: $color-nav-child-focus;
font-weight: bold;
}
}
}
&.operate {
flex: 1;
display: flex;
justify-content: flex-end;
a {
&:hover {
background-color: $color-nav-btn-hover;
}
&:first-child {
border-left: none;
border-left: $border-nav;
}
.parent {
a {
display: block;
border: none;
background: $color-nav-btn-hover;
}
}
}
}
}
}
@include screen(phone, max) {
padding: 0;
flex-flow: column;
.menu-bar {
display: block;
font-size: 14px;
position: sticky;
top: 0;
background: $color-nav-bg;
z-index: 10;
summary {
cursor: pointer;
}
&[open] {
summary {
border-bottom: $border-nav;
}
& ~ menu {
display: flex;
}
}
}
nav {
overflow-y: auto;
width: 100vw;
position: fixed;
top: 0;
background: $color-nav-btn-hover;
&:has(.menu-bar[open]) {
width: 70vw;
height: 100%;
}
& > menu {
display: none;
flex-flow: column;
& > li {
&:first-child {
border: none;
}
> a {
border: none !important;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
&:not(.operate) {
&.focus > a {
background: $color-nav-bg;
}
.child {
position: absolute;
bottom: 0;
left: 100%;
top: auto;
z-index: 20;
width: 100%;
max-width: 100%;
min-width: auto;
li {
border-bottom: $border-nav;
&.return {
display: block;
text-align: center;
font-size: 12px;
&:hover > a {
background: $color-nav-bg;
}
a {
color: $color-nav-text-mute;
}
}
}
& > a {
pointer-events: auto;
cursor: pointer;
}
}
&.expanded {
animation: out .15s ease-out forwards;
menu {
position: static;
border: $border-nav;
border-width: 1px 0;
display: flex;
min-width: auto;
max-width: none;
}
&.noexpanded {
animation: in .15s ease-out forwards;
&.operate {
flex-flow: column;
justify-content: flex-start;
a {
background: $color-nav-btn-hover;
&:hover {
background: $color-nav-bg;
}
}
}
}
}
}
}
}
@include screen(phone, max) {
body {
padding-top: 36px;
&:has(.menu-bar[open]) {
overflow: hidden;
}
}
}

View File

@@ -30,6 +30,10 @@
}
.success a { color: #264409; }
.warning {
color: #B94A48;
}
// 气泡
.balloon {
@@ -47,3 +51,28 @@
border-radius: 20px;
}
/** 顶部消息样式 by 70 */
.popup {
display: none;
position: sticky;
margin: 0;
padding: 8px 0;
border: none;
width: 100%;
z-index: 10;
text-align: center;
border-radius: 0;
ul {
list-style: none;
margin: 0;
padding: 0;
text-align: center;
li {
display: inline-block;
margin-right: 10px;
}
}
}

View File

@@ -0,0 +1,61 @@
/**
* 典型配置选项
*/
.typecho-option {
list-style: none;
margin: 1em 0;
padding: 0;
&-submit li {
border-bottom: none;
}
label {
&.typecho-label {
display: block;
margin-bottom: .5em;
font-weight: bold;
}
&.required:after {
content: " *";
color: #B94A48;
}
}
span {
margin-right: 15px;
}
.description {
margin: .5em 0 0;
color: #999;
font-size: .92857em;
}
input.file {
width: 100%;
margin: .7em 0;
}
input.text {
width: 100%;
}
input.num {
width: 60px;
}
textarea {
width: 100%;
height: 100px;
}
.multiline {
display: block;
margin: .3em 0;
&.hidden {
display: none;
}
}
}

View File

@@ -3,34 +3,35 @@
*/
.typecho-pager {
display: flex;
align-items: center;
justify-content: flex-end;
list-style: none;
float: right;
margin: 0;
padding: 0;
line-height: 1;
text-align: center;
zoom: 1;
}
.typecho-pager li {
display: inline-block;
margin: 0 3px;
height: 28px;
line-height: 28px;
}
li {
margin: 0 3px;
height: 28px;
line-height: 28px;
.typecho-pager a {
display: block;
padding: 0 10px;
border-radius: 2px;
}
a {
display: block;
padding: 0 10px;
border-radius: 2px;
.typecho-pager a:hover {
text-decoration: none;
background: #E9E9E6;
}
&:hover {
text-decoration: none;
background: #E9E9E6;
}
}
.typecho-pager li.current a {
background: #E9E9E6;
color: #444;
&.current a {
background: #E9E9E6;
color: #444;
}
}
}

175
admin/src/scss/_table.scss Normal file
View File

@@ -0,0 +1,175 @@
/**
* 表格列表页
*/
/**
* 列表页选项
*/
.typecho-list .typecho-pager {
}
.typecho-list-operate {
display: flex;
margin: 1em 0;
& + .typecho-list-operate {
margin-top: 0;
}
input, button, select {
vertical-align: bottom;
}
input[type="checkbox"] {
vertical-align: text-top;
}
a:hover {
text-decoration: none;
}
> *:nth-child(2) {
flex: 1;
}
.operate, .search {
display: flex;
align-items: center;
}
.operate {
label {
display: flex;
}
> * {
margin-right: 5px;
}
}
> *:nth-child(2) {
justify-content: flex-end;
&.search > * {
margin-left: 5px;
}
}
@include screen(phone, max) {
& {
flex-flow: column;
> *:nth-child(2) {
margin-top: 10px;
justify-content: flex-start;
> *:first-child {
margin-left: 0;
}
}
}
}
}
.operate-delete, .operate-button-delete {
color: #B94A48;
}
.operate-edit {
color: #007700;
}
.operate-reply {
color: #545c30;
}
/**
* 列表表格
*/
/** 增加表格标题 by 70 */
.typecho-list-table-title {
margin: 1em 0;
color: #999;
text-align: center;
}
.typecho-list-table {
width: 100%;
border-collapse: separate;
border-spacing: 0;
background: #FFF;
table-layout: fixed;
border: 30px solid #FFF;
&.deactivate {
color: #999;
}
.right {
text-align: right;
}
th {
padding: 0 10px 10px;
border-bottom: 1px solid #F0F0EC;
text-align: left;
}
td {
padding: 10px;
border-top: 1px solid #F0F0EC;
word-break: break-all;
pre {
overflow: auto;
}
&.none {
color: #999;
text-align: center;
}
}
.status {
margin-left: 5px;
color: #999;
font-size: .92857em;
font-style: normal;
}
tbody tr {
&:hover {
background-color: #F6F6F3;
}
&:has(input[type="checkbox"]:checked) {
background-color: #FFF9E8;
}
}
tr td .hidden-by-mouse {
opacity: 0;
}
tr:hover td .hidden-by-mouse {
opacity: 1;
}
tr td:first-child input[type="checkbox"] {
display: block;
}
@include screen(phone, max) {
& {
border-width: 10px;
th {
padding: 0 5px 5px;
}
td {
padding: 5px;
}
}
}
}

50
admin/src/scss/_tabs.scss Normal file
View File

@@ -0,0 +1,50 @@
/**
* 标签页
*/
.typecho-option-tabs {
list-style: none;
margin: 0;
padding: 0;
font-size: 13px;
display: flex;
&.fix-tabs {
margin: 1em 0;
}
li {
&:first-child a {
border-radius: 2px 0 0 2px;
}
&:last-child a {
border-radius: 0 2px 2px 0;
}
&.current a, &.active a {
background-color: #E9E9E6;
}
a {
display: flex;
justify-content: center;
align-items: center;
margin-right: -1px;
border: 1px solid #D9D9D6;
padding: 0 15px;
height: 26px;
color: #666;
box-sizing: border-box;
> * {
margin: 0 3px;
}
&:hover {
background-color: #E9E9E6;
color: #666;
text-decoration: none;
}
}
}
}

70
admin/src/scss/_tags.scss Normal file
View File

@@ -0,0 +1,70 @@
/**
* 标签列表
*/
.tag-list {
list-style: none;
margin: 0;
padding: 20px;
background-color: #FFF;
display: flex;
flex-wrap: wrap;
.none {
color: #999;
width: 100%;
margin: 0;
text-align: center;
}
&.typecho-list-notable li {
margin: 0 5px 5px 0;
padding: 5px 5px 5px 10px;
cursor: pointer;
display: flex;
align-items: center;
.tag-edit-link {
margin-left: 3px;
visibility: hidden;
display: flex;
align-items: center;
}
&:hover {
background-color: #E9E9E6;
.tag-edit-link {
visibility: visible;
}
}
&:has(input[type="checkbox"]:checked) {
background-color: #FFFBCC;
}
&.size-5 {
font-size: 1em;
}
&.size-10 {
font-size: 1.2em;
}
&.size-20 {
font-size: 1.4em;
}
&.size-30 {
font-size: 1.6em;
}
&.size-0 {
font-size: 1.8em;
}
input {
display: none;
}
}
}

View File

@@ -11,3 +11,29 @@ $screen-phone: 576px;
$screen-tablet: 768px;
$screen-desktop: 992px;
$screen-wide: 1200px;
@function breakpoint($breakpoint) {
@if $breakpoint == 'phone' {
@return $screen-phone;
} @else if $breakpoint == 'tablet' {
@return $screen-tablet;
} @else if $breakpoint == 'desktop' {
@return $screen-desktop;
} @else if $breakpoint == 'wide' {
@return $screen-wide;
} @else {
@return $breakpoint;
}
}
@mixin screen($breakpoint, $type: min) {
@if $type == min {
@media (min-width: breakpoint($breakpoint)) {
@content;
}
} @else {
@media (max-width: breakpoint($breakpoint) - 1) {
@content;
}
}
}

212
admin/src/scss/_write.scss Normal file
View File

@@ -0,0 +1,212 @@
/**
* 编写页面
*/
.typecho-post-area {
.edit-draft-notice {
color: #999;
font-size: .92857em;
a {
color: #B94A48;
}
}
.typecho-label {
display: block;
margin: 1em 0 -0.5em;
font-weight: bold;
}
.submit {
display: flex;
justify-content: space-between;
#auto-save-message {
color: #999;
font-size: .92857em;
}
.left {
display: flex;
align-items: center;
> * {
margin-right: 8px;
}
}
.right {
display: flex;
align-items: center;
justify-content: flex-end;
> * {
margin-left: 8px;
}
}
}
input.title {
font-size: 1.17em;
font-weight: bold;
}
.url-slug {
margin-top: -0.5em;
color: #AAA;
font-size: .92857em;
word-break: break-word;
}
#slug {
padding: 2px;
border: none;
background: #FFFBCC;
color: #666;
}
#text {
resize: none;
}
.description {
margin-top: -0.5em;
color: #999;
font-size: .92857em;
}
/**
* 自定义字段
*/
#custom-field {
margin: 1em 0;
padding: 10px 15px;
background: #FFF;
summary {
font-weight: bold;
cursor: pointer;
&:hover {
color: #467B96;
}
&::marker {
color: #BBB;
}
}
.add {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 10px;
.description {
margin-top: 0;
}
}
p.description {
text-align: left;
}
.typecho-label {
margin: 0;
a {
display: block;
color: #444;
&:hover {
color: #467B96;
text-decoration: none;
}
}
}
.fields {
list-style: none;
margin: 10px 0 0 0;
padding: 0;
.field {
display: flex;
padding-bottom: 10px;
border-bottom: 1px solid #F0F0EC;
margin-bottom: 10px;
&:last-child {
margin-bottom: 0;
}
.field-name {
display: flex;
input[name="fieldNames[]"] {
height: 27px;
width: 150px;
margin-right: 10px;
}
}
.field-value {
margin-left: 10px;
flex: 1;
display: flex;
textarea[name="fieldValues[]"] {
flex: 1;
margin-right: 10px;
resize: none;
}
}
@include screen(phone, max) {
flex-flow: column;
.field-value {
margin-left: 0;
margin-top: 10px;
}
}
}
}
select { height: 27px; }
}
/**
* 侧边栏
*/
#edit-secondary {
margin-top: 1em;
.category-option ul {
list-style: none;
border: 1px solid #D9D9D6;
padding: 6px 12px;
max-height: 240px;
overflow: auto;
background-color: #FFF;
border-radius: 2px;
li {
margin: 3px 0;
}
}
#advance-panel {
summary {
line-height: 25px;
}
.visibility-option ul,
.allow-option ul {
list-style: none;
padding: 0;
}
}
}
}

View File

@@ -14,111 +14,121 @@
}
}
@media
(-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
@import "editor/*@2x.png";
@include all-editor-sprites();
#wmd-button-bar {
display: flex;
align-items: center;
@mixin editor-button-2x($name) {
&#wmd-#{$name}-button span {
@include editor-sprite(editor-#{$name})
@media
(-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
@import "editor/*@2x.png";
@include all-editor-sprites();
@mixin editor-button-2x($name) {
&#wmd-#{$name}-button span {
@include editor-sprite(editor-#{$name})
}
}
.wmd-button-row {
li {
@include editor-button-2x(bold);
@include editor-button-2x(italic);
@include editor-button-2x(link);
@include editor-button-2x(quote);
@include editor-button-2x(code);
@include editor-button-2x(image);
@include editor-button-2x(olist);
@include editor-button-2x(ulist);
@include editor-button-2x(heading);
@include editor-button-2x(hr);
@include editor-button-2x(more);
@include editor-button-2x(undo);
@include editor-button-2x(redo);
@include editor-button-2x(fullscreen);
@include editor-button-2x(exit-fullscreen);
}
}
}
.wmd-button-row {
flex: 1;
list-style: none;
margin: 0;
padding: 0;
height: 26px;
line-height: 1;
li {
@include editor-button-2x(bold);
@include editor-button-2x(italic);
@include editor-button-2x(link);
@include editor-button-2x(quote);
@include editor-button-2x(code);
@include editor-button-2x(image);
@include editor-button-2x(olist);
@include editor-button-2x(ulist);
@include editor-button-2x(heading);
@include editor-button-2x(hr);
@include editor-button-2x(more);
@include editor-button-2x(undo);
@include editor-button-2x(redo);
@include editor-button-2x(fullscreen);
@include editor-button-2x(exit-fullscreen);
display: inline-block;
margin-right: 4px;
padding: 3px;
cursor: pointer;
vertical-align: middle;
border-radius: 2px;
&:hover {
background-color: #E9E9E6;
}
&.wmd-spacer {
height: 20px;
margin: 0 10px 0 6px;
padding: 0;
width: 1px;
background: #E9E9E6;
cursor: default;
}
span {
display: block;
width: 20px;
height: 20px;
}
@include editor-button(bold);
@include editor-button(italic);
@include editor-button(link);
@include editor-button(quote);
@include editor-button(code);
@include editor-button(image);
@include editor-button(olist);
@include editor-button(ulist);
@include editor-button(heading);
@include editor-button(hr);
@include editor-button(more);
@include editor-button(undo);
@include editor-button(redo);
@include editor-button(fullscreen);
@include editor-button(exit-fullscreen);
}
}
}
.wmd-button-row {
list-style: none;
margin: 0;
padding: 0;
height: 26px;
line-height: 1;
// 撰写预览切换 tab
.wmd-edittab {
font-size: .92857em;
li {
display: inline-block;
margin-right: 4px;
padding: 3px;
cursor: pointer;
vertical-align: middle;
border-radius: 2px;
&:hover {
background-color: #E9E9E6;
}
&.wmd-spacer {
a {
display: inline-block;
padding: 0 8px;
margin-left: 5px;
height: 20px;
margin: 0 10px 0 6px;
padding: 0;
width: 1px;
background: #E9E9E6;
cursor: default;
}
span {
display: block;
width: 20px;
height: 20px;
}
line-height: 20px;
@include editor-button(bold);
@include editor-button(italic);
@include editor-button(link);
@include editor-button(quote);
@include editor-button(code);
@include editor-button(image);
@include editor-button(olist);
@include editor-button(ulist);
@include editor-button(heading);
@include editor-button(hr);
@include editor-button(more);
@include editor-button(undo);
@include editor-button(redo);
@include editor-button(fullscreen);
@include editor-button(exit-fullscreen);
&:hover {
text-decoration: none;
}
&.active {
background: #E9E9E6;
color: #999;
}
}
}
}
#btn-cancel-preview { display: none }
// 撰写预览切换 tab
.wmd-edittab {
float: right;
margin-top: 3px;
font-size: .92857em;
a {
display: inline-block;
padding: 0 8px;
margin-left: 5px;
height: 20px;
line-height: 20px;
&:hover {
text-decoration: none;
}
&.active {
background: #E9E9E6;
color: #999;
}
}
}
// 控制被隐藏的 tab全屏时显示
.wmd-hidetab {
display: none;
@@ -152,6 +162,24 @@
button { margin-right: 10px; }
}
#wmd-editarea {
/* 拖动调整 textarea 大小 */
.resize {
display: block;
margin: 2px auto 0;
padding: 2px 0;
border: 1px solid #D9D9D6;
border-width: 1px 0;
width: 60px;
cursor: row-resize;
i {
display: block;
height: 1px;
background-color: #D9D9D6;
}
}
}
/* 预览 */
#wmd-preview {
background: #FFF;
@@ -318,7 +346,7 @@
#btn-cancel-preview { display: inline-block }
}
@media (max-width: $screen-phone - 1px) {
@include screen(phone, max) {
#wmd-spacer2,
#wmd-olist-button,
#wmd-ulist-button,

View File

@@ -1,20 +1,17 @@
/*
* Bento Grid System
* Bento Grid System (Flexbox Version)
* Source: https://github.com/fenbox/bento
* Version: 1.2.8
* Update: 2013.11.25
* Version: 2.0.0
* Update: 2024.10.23
*/
@import "vars";
// Mixins
%box-sizing {
box-sizing: border-box;
}
// Container
.container {
margin-left: auto;
@@ -22,189 +19,161 @@
padding-left: $gutter-width / 2;
padding-right: $gutter-width / 2;
@extend %box-sizing;
display: flex;
flex-wrap: wrap;
}
// Column group
.row {
margin-right: $gutter-width / -2;
margin-left: $gutter-width / -2;
@extend .clearfix;
display: flex;
flex-wrap: wrap;
width: 100vw;
}
.row [class*="col-"] {
float: left;
min-height: 1px;
padding-right: $gutter-width / 2;
padding-left: $gutter-width / 2;
min-height: 1px;
flex-grow: 1;
@extend %box-sizing;
}
// Flex order replaces push and pull functionality
.row [class*="-push-"],
.row [class*="-pull-"] {
position: relative;
}
/*
* Mobile and up
*/
// Use flex-grow to simulate columns in mobile
@for $index from 1 through $columns {
.col-mb-#{$index} {
width: $column-width * $index;
flex: 0 0 $column-width * $index;
max-width: $column-width * $index;
}
}
/*
* Tablet and up
*/
@media (min-width: $screen-tablet) {
// Tablet and up
@include screen(tablet) {
.container {
max-width: $screen-tablet - ($gutter-width * 2);
}
// Colunms
@for $index from 1 through $columns {
.col-tb-#{$index} {
width: $column-width * $index;
flex: 0 0 $column-width * $index;
max-width: $column-width * $index;
}
}
// Offset
@for $index from 0 through $columns {
.col-tb-offset-#{$index} {
margin-left: $column-width * $index;
}
}
// Pull
@for $index from 0 through $columns {
.col-tb-pull-#{$index} {
right: $column-width * $index;
order: -$index;
}
}
// Push
@for $index from 0 through $columns {
.col-tb-push-#{$index} {
left: $column-width * $index;
order: $index;
}
}
}
/*
* Desktop and up
*/
@media (min-width: $screen-desktop) {
// Desktop and up
@include screen(desktop) {
.container {
max-width: $screen-desktop - ($gutter-width * 2);
}
// Colunms
@for $index from 1 through $columns {
.col-#{$index} {
width: $column-width * $index;
flex: 0 0 $column-width * $index;
max-width: $column-width * $index;
}
}
// Offset
@for $index from 0 through $columns {
.col-offset-#{$index} {
margin-left: $column-width * $index;
}
}
// Pull
@for $index from 0 through $columns {
.col-pull-#{$index} {
right: $column-width * $index;
order: -$index;
}
}
// Push
@for $index from 0 through $columns {
.col-push-#{$index} {
left: $column-width * $index;
order: $index;
}
}
}
/*
* Widescreen and up
*/
@media (min-width: $screen-wide) {
// Widescreen and up
@include screen(wide) {
.container {
max-width: $screen-wide - ($gutter-width * 2);
}
// Colunms
@for $index from 1 through $columns {
.col-wd-#{$index} {
width: $column-width * $index;
flex: 0 0 $column-width * $index;
max-width: $column-width * $index;
}
}
// Offset
@for $index from 0 through $columns {
.col-wd-offset-#{$index} {
margin-left: $column-width * $index;
}
}
// Pull
@for $index from 0 through $columns {
.col-wd-pull-#{$index} {
right: $column-width * $index;
order: -$index;
}
}
// Push
@for $index from 0 through $columns {
.col-wd-push-#{$index} {
left: $column-width * $index;
order: $index;
}
}
}
/*
* Responsive kit
*/
// Hidden in mobile and down
@media (max-width: $screen-phone - 1px) {
// Responsive kit
@include screen(phone, max) {
.kit-hidden-mb {
display: none;
}
}
// Hidden in tablet and down
@media (max-width: $screen-tablet - 1px) {
@include screen(tablet, max) {
.kit-hidden-tb {
display: none;
}
}
// Hidden in descktop and down
@media (max-width: $screen-desktop - 1px) {
@include screen(desktop, max) {
.kit-hidden {
display: none;
}
}
/*
* Clearfix
*/
// Clearfix
.clearfix {
zoom: 1;
&:before, &:after {
&:before,
&:after {
content: " ";
display: table;
}

View File

@@ -19,7 +19,7 @@ html {
}
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;
background: #F6F6F3;
color: #444;
font-size: 87.5%;
@@ -74,38 +74,15 @@ a.button:hover, a.balloon-button:hover {
@import "buttons";
@import "messages";
@import "pagenavi";
@import "table";
@import "tabs";
@import "tags";
@import "write";
@import "options";
@import "header";
@import "footer";
/** 顶部消息样式 by 70 */
.popup {
display: none;
position: absolute;
top: 0;
left: 0;
margin: 0;
padding: 8px 0;
border: none;
width: 100%;
z-index: 10;
text-align: center;
border-radius: 0;
}
.popup ul {
list-style: none;
margin: 0;
padding: 0;
text-align: center;
}
.popup ul li {
display: inline-block;
margin-right: 10px;
}
/**
* logo 的样式
*/
@@ -120,48 +97,6 @@ a.button:hover, a.balloon-button:hover {
background: transparent url(../img/ajax-loader.gif) no-repeat left center;
}
/**
* 典型配置选项
*/
.typecho-option {
list-style: none;
margin: 1em 0;
padding: 0;
&-submit li {
border-bottom: none;
}
label {
&.typecho-label {
display: block;
margin-bottom: .5em;
font-weight: bold;
}
&.required:after {
content: " *";
color: #B94A48;
}
}
span {
margin-right: 15px;
}
.description {
margin: .5em 0 0;
color: #999;
font-size: .92857em;
}
input.file {
width: 100%;
margin: .7em 0;
}
}
.front-archive {
padding-left: 1.5em;
}
@@ -200,12 +135,17 @@ a.button:hover, a.balloon-button:hover {
margin-bottom: 25px;
padding: 0 0 35px;
border-bottom: 1px solid #ECECEC;
display: flex;
flex-wrap: wrap;
li {
float: left;
margin-right: 1.5em;
}
.balloon {
margin-top: 2px;
display: flex;
align-items: center;
.balloon {
margin-left: 5px;
}
}
}
@@ -237,43 +177,55 @@ a.button:hover, a.balloon-button:hover {
display: table;
margin: 0 auto;
height: 100%;
}
.typecho-login {
display: table-cell;
padding: 30px 0 100px;
width: 280px;
text-align: center;
vertical-align: middle;
h1 {
margin: 0 0 1em;
.typecho-login {
display: table-cell;
padding: 30px 0 100px;
width: 280px;
text-align: center;
vertical-align: middle;
h1 {
margin: 0 0 1em;
}
.more-link {
margin-top: 2em;
color: #CCC;
a {
margin: 0 3px;
}
}
}
}
.typecho-login .more-link {
margin-top: 2em;
color: #CCC;
}
.typecho-login .more-link a { margin: 0 3px; }
/**
* 标题
*/
.typecho-page-title {
}
.typecho-page-title h2 {
width: 100%;
display: flex;
align-items: center;
margin: 25px 0 10px;
font-size: 1.28571em;
}
.typecho-page-title h2 a {
margin-left: 10px;
padding: 3px 8px;
background: #E9E9E6;
font-size: .8em;
border-radius: 2px;
}
.typecho-page-title h2 a:hover {
text-decoration: none;
h2 {
margin: 0;
font-size: 1.28571em;
}
a {
padding: 3px 8px;
margin-left: 8px;
background: #E9E9E6;
font-size: .8em;
font-weight: bold;
border-radius: 2px;
&:hover {
text-decoration: none;
}
}
}
/**
@@ -285,190 +237,16 @@ a.button:hover, a.balloon-button:hover {
* 主页主体
*/
.typecho-dashboard {
}
.typecho-dashboard ul {
list-style: none;
padding: 0;
}
.typecho-dashboard li {
margin-bottom: 5px;
}
ul {
list-style: none;
padding: 0;
/**
* 标签页
*/
.typecho-option-tabs {
list-style: none;
margin: 1em 0 0;
padding: 0;
font-size: 13px;
text-align: center;
&.fix-tabs {
margin-bottom: 1em;
}
}
.typecho-option-tabs a {
display: block;
margin-right: -1px;
border: 1px solid #D9D9D6;
padding: 0 15px;
height: 26px;
line-height: 26px;
color: #666;
box-sizing: border-box;
}
.typecho-option-tabs a:hover {
background-color: #E9E9E6;
color: #666;
text-decoration: none;
}
.typecho-option-tabs li {
float: left;
&:first-child a {
border-radius: 2px 0 0 2px;
}
&:last-child a {
border-radius: 0 2px 2px 0;
}
}
.typecho-option-tabs.right {
float: right;
}
.typecho-option-tabs li.current a,
.typecho-option-tabs li.active a {
background-color: #E9E9E6;
}
/**
* 表格列表页
*/
/**
* 列表页选项
*/
.typecho-list .typecho-pager {
}
.typecho-list-operate {
margin: 1em 0;
}
.typecho-list-operate input,
.typecho-list-operate button,
.typecho-list-operate select {
vertical-align: bottom;
}
.typecho-list-operate input[type="checkbox"] {
vertical-align: text-top;
}
@media (min-width: $screen-phone) {
.typecho-list-operate {
.operate {
float: left;
}
.search {
float: right;
li {
margin-bottom: 5px;
}
}
}
.typecho-list-operate span.operate-delete, a.operate-delete,
.typecho-list-operate span.operate-button-delete, a.operate-button-delete {
color: #B94A48;
}
a.operate-edit {
color: #007700;
}
a.operate-reply {
color: #545c30;
}
.typecho-list-operate a:hover {
text-decoration: none;
}
/**
* 列表表格
*/
/** 增加表格标题 by 70 */
.typecho-list-table-title {
margin: 1em 0;
color: #999;
text-align: center;
}
.typecho-table-wrap {
padding: 30px;
background: #FFF;
}
.typecho-list-table {
width: 100%;
border-collapse: collapse;
table-layout: fixed;
&.deactivate {
color: #999;
}
.right {
text-align: right;
}
th {
padding: 0 10px 10px;
border-bottom: 2px solid #F0F0EC;
text-align: left;
}
td {
padding: 10px;
border-top: 1px solid #F0F0EC;
word-break: break-all;
pre {
overflow: auto;
}
}
.status {
margin-left: 5px;
color: #999;
font-size: .92857em;
font-style: normal;
}
tbody tr:hover td {
background-color: #F6F6F3;
}
tbody tr.checked td {
background-color: #FFF9E8;
}
tr td .hidden-by-mouse {
opacity: 0;
}
tr:hover td .hidden-by-mouse {
opacity: 1;
}
}
.warning {
color: #B94A48;
}
/**
* 评论管理
*/
@@ -504,12 +282,13 @@ a.operate-reply {
max-width: 100%;
}
@media (max-width: $screen-phone - 1px) {
@include screen(phone, max) {
.comment-edit {
display: flex;
flex-direction: column;
width: 90vw;
}
.comment-edit td:first-child { display: none; }
}
@@ -521,295 +300,57 @@ a.operate-reply {
display: none;
}
/**
* 模板列表
*/
.typecho-theme-list {
}
img {
margin: 1em 0;
max-width: 100%;
max-height: 240px;
}
.typecho-theme-list .theme-item {
}
cite {
font-style: normal;
color: #999;
}
.typecho-theme-list td {
}
.typecho-theme-list img {
margin: 1em 0;
max-width: 100%;
max-height: 240px;
}
.typecho-theme-list cite {
font-style: normal;
color: #999;
}
.typecho-theme-list tbody tr.current td {
background-color: #FFF9E8;
}
/**
* 后台配置项
*/
.typecho-page-main .typecho-option input.text {
width: 100%;
}
.typecho-page-main .typecho-option input.num {
width: 40px;
}
.typecho-page-main .typecho-option textarea {
width: 100%;
height: 100px;
}
.typecho-page-main .typecho-option .multiline {
display: block;
margin: .3em 0;
&.hidden {
display: none;
tbody tr.current td {
background-color: #FFF9E8;
}
}
/**
* 编辑模板
*/
.typecho-select-theme {
height: 25px;
line-height: 25px;
margin: 15px 0px;
}
.typecho-select-theme h5 {
color: #E47E00;
font-weight: bold;
float: left;
font-size: 14px;
width: 120px;
margin-right: 10px;
}
.typecho-select-theme select {
width: 150px;
}
/**
* 编辑模板(编辑详情)
*/
.typecho-edit-theme ul {
list-style: none;
margin: 0;
padding: 0;
}
.typecho-edit-theme li {
padding: 3px 10px;
}
.typecho-edit-theme .current {
background-color: #E6E6E3;
}
.typecho-edit-theme .current a {
color: #444;
}
.typecho-edit-theme textarea {
font-size: .92857em;
line-height: 1.2;
height: 500px;
}
/**
* 编写页面
*/
.typecho-post-area .edit-draft-notice {
color: #999;
font-size: .92857em;
}
.typecho-post-area .edit-draft-notice a { color: #B94A48; }
.typecho-post-area .typecho-label {
display: block;
margin: 1em 0 -0.5em;
font-weight: bold;
}
.typecho-post-area #auto-save-message {
display: block;
margin-top: 0.5em;
color: #999;
font-size: .92857em;
}
.typecho-post-area .submit .right button {
margin-left: 5px;
}
.typecho-post-area .right {
float: right;
}
.typecho-post-area .left {
float: left;
}
.typecho-post-area input.text {
}
.typecho-post-area .out-date {
border: 1px solid #D3DBB3;
padding: 3px;
background: #fff;
}
.typecho-post-area input.title {
font-size: 1.17em;
font-weight: bold;
}
.typecho-post-area .url-slug {
margin-top: -0.5em;
color: #AAA;
font-size: .92857em;
word-break: break-word;
}
.typecho-post-area #slug {
padding: 2px;
border: none;
background: #FFFBCC;
color: #666;
}
.typecho-post-area #text {
resize: none;
}
#advance-panel {
display: none;
}
#custom-field {
margin: 1em 0;
padding: 10px 15px;
background: #FFF;
&.fold {
table, .description { display: none; }
}
.description {
margin-top: 10px;
text-align: right;
button {
float: left;
}
}
p.description {
text-align: left;
}
.typecho-label {
.typecho-edit-theme {
ul {
list-style: none;
margin: 0;
padding: 0;
li {
padding: 3px 10px;
}
}
.current {
background-color: #E6E6E3;
a {
display: block;
color: #444;
&:hover {
color: #467B96;
text-decoration: none;
}
}
}
table {
margin-top: 10px;
}
td {
padding: 10px 5px;
textarea {
font-size: .92857em;
border-bottom: 1px solid #F0F0EC;
vertical-align: top;
label {
font-size: 1em;
font-weight: normal;
}
line-height: 1.2;
height: 500px;
}
select { height: 27px; }
}
.typecho-post-area .is-draft {
background: #FFF1A8;
}
.typecho-post-option .description {
margin-top: -0.5em;
color: #999;
font-size: .92857em;
}
.category-option ul {
list-style: none;
border: 1px solid #D9D9D6;
padding: 6px 12px;
max-height: 240px;
overflow: auto;
background-color: #FFF;
border-radius: 2px;
}
.category-option li {
margin: 3px 0;
}
.visibility-option ul,
.allow-option ul {
list-style: none;
padding: 0;
}
/**
* 标签列表
*/
.typecho-page-main ul.tag-list {
list-style: none;
margin: 0;
padding: 20px;
background-color: #FFF;
}
.typecho-page-main ul.tag-list li {
display: inline-block;
margin: 0 0 5px 0;
padding: 5px 5px 5px 10px;
cursor: pointer;
}
.typecho-page-main ul.tag-list li:hover {
background-color: #E9E9E6;
}
.typecho-page-main ul.tag-list li input {
display: none;
}
.typecho-page-main ul.tag-list li.checked {
background-color: #FFFBCC;
}
.typecho-page-main ul.tag-list li.size-5 { font-size: 1em; }
.typecho-page-main ul.tag-list li.size-10 { font-size: 1.2em; }
.typecho-page-main ul.tag-list li.size-20 { font-size: 1.4em; }
.typecho-page-main ul.tag-list li.size-30 { font-size: 1.6em; }
.typecho-page-main ul.tag-list li.size-0 { font-size: 1.8em; }
.typecho-page-main .tag-edit-link { visibility: hidden; }
.typecho-page-main li:hover .tag-edit-link { visibility: visible; }
.typecho-attachment-photo {
border: 1px solid #E6E6E3;
max-width: 100%;
@@ -873,39 +414,12 @@ background: #FFF1A8;
*/
.edit-media button { margin-right: 6px; }
/* 拖动调整 textarea 大小 */
.resize {
display: block;
margin: 2px auto 0;
padding: 2px 0;
border: 1px solid #D9D9D6;
border-width: 1px 0;
width: 60px;
cursor: row-resize;
i {
display: block;
height: 1px;
background-color: #D9D9D6;
}
}
/* 拖动排序 */
.tDnD_whileDrag {
background-color: #FFFBCC;
}
@media (max-width: $screen-phone - 1px) {
.typecho-list-operate {
.search {
margin-top: 10px;
}
}
.typecho-table-wrap {
padding: 10px;
margin: 0 -10px;
}
@include screen(phone, max) {
.typecho-option-submit {
button[type="submit"] {
width: 100%;

View File

@@ -6,56 +6,39 @@ include 'menu.php';
\Widget\Themes\Files::alloc()->to($files);
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="main">
<div class="col-mb-12">
<ul class="typecho-option-tabs fix-tabs clearfix">
<li><a href="<?php $options->adminUrl('themes.php'); ?>"><?php _e('可以使用的外观'); ?></a></li>
<li class="current"><a href="<?php $options->adminUrl('theme-editor.php'); ?>">
<?php if ($options->theme == $files->theme): ?>
<?php _e('编辑当前外观'); ?>
<?php else: ?>
<?php _e('编辑%s外观', ' <cite>' . $files->theme . '</cite> '); ?>
<?php endif; ?>
</a></li>
<?php if (\Widget\Themes\Config::isExists()): ?>
<li><a href="<?php $options->adminUrl('options-theme.php'); ?>"><?php _e('设置外观'); ?></a></li>
<?php endif; ?>
</ul>
</div>
<div class="typecho-edit-theme">
<div class="col-mb-12 col-tb-8 col-9 content">
<form method="post" name="theme" id="theme"
action="<?php $security->index('/action/themes-edit'); ?>">
<label for="content" class="sr-only"><?php _e('编辑源码'); ?></label>
<textarea name="content" id="content" class="w-100 mono"
<?php if (!$files->currentIsWriteable()): ?>readonly<?php endif; ?>><?php echo $files->currentContent(); ?></textarea>
<p class="typecho-option typecho-option-submit">
<?php if ($files->currentIsWriteable()): ?>
<input type="hidden" name="theme" value="<?php echo $files->currentTheme(); ?>"/>
<input type="hidden" name="edit" value="<?php echo $files->currentFile(); ?>"/>
<button type="submit" class="btn primary"><?php _e('保存文件'); ?></button>
<?php else: ?>
<em><?php _e('此文件无法写入'); ?></em>
<?php endif; ?>
</p>
</form>
</div>
<ul class="col-mb-12 col-tb-4 col-3">
<li><strong>模板文件</strong></li>
<?php while ($files->next()): ?>
<li<?php if ($files->current): ?> class="current"<?php endif; ?>>
<a href="<?php $options->adminUrl('theme-editor.php?theme=' . $files->currentTheme() . '&file=' . $files->file); ?>"><?php $files->file(); ?></a>
</li>
<?php endwhile; ?>
</ul>
<?php include 'theme-tabs.php'; ?>
<div class="row typecho-page-main typecho-edit-theme" role="main">
<div class="col-mb-12 col-tb-8 col-9 content">
<form method="post" name="theme" id="theme"
action="<?php $security->index('/action/themes-edit'); ?>">
<label for="content" class="sr-only"><?php _e('编辑源码'); ?></label>
<textarea name="content" id="content" class="w-100 mono"
<?php if (!$files->currentIsWriteable()): ?>readonly<?php endif; ?>><?php echo $files->currentContent(); ?></textarea>
<p class="typecho-option typecho-option-submit">
<?php if ($files->currentIsWriteable()): ?>
<input type="hidden" name="theme" value="<?php echo $files->currentTheme(); ?>"/>
<input type="hidden" name="edit" value="<?php echo $files->currentFile(); ?>"/>
<button type="submit" class="btn primary"><?php _e('保存文件'); ?></button>
<?php else: ?>
<em><?php _e('此文件无法写入'); ?></em>
<?php endif; ?>
</p>
</form>
</div>
<ul class="col-mb-12 col-tb-4 col-3">
<li><strong>模板文件</strong></li>
<?php while ($files->next()): ?>
<li<?php if ($files->current): ?> class="current"<?php endif; ?>>
<a href="<?php $options->adminUrl('theme-editor.php?theme=' . $files->currentTheme() . '&file=' . $files->file); ?>"><?php $files->file(); ?></a>
</li>
<?php endwhile; ?>
</ul>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

16
admin/theme-tabs.php Normal file
View File

@@ -0,0 +1,16 @@
<?php if (!defined('__TYPECHO_ADMIN__')) exit; ?>
<ul class="typecho-option-tabs fix-tabs">
<li<?php if ($menu->getCurrentMenuUrl() === 'themes.php'): ?> class="current"<?php endif; ?>><a href="<?php $options->adminUrl('themes.php'); ?>"><?php _e('可以使用的外观'); ?></a></li>
<?php if (\Widget\Themes\Files::isWriteable()): ?>
<li<?php if ($menu->getCurrentMenuUrl() === 'theme-editor.php'): ?> class="current"<?php endif; ?>><a href="<?php $options->adminUrl('theme-editor.php'); ?>">
<?php if (!isset($files) || $options->theme == $files->theme): ?>
<?php _e('编辑当前外观'); ?>
<?php else: ?>
<?php _e('编辑%s外观', ' <cite>' . $files->theme . '</cite> '); ?>
<?php endif; ?>
</a></li>
<?php endif; ?>
<?php if (\Widget\Themes\Config::isExists()): ?>
<li<?php if ($menu->getCurrentMenuUrl() === 'options-theme.php'): ?> class="current"<?php endif; ?>><a href="<?php $options->adminUrl('options-theme.php'); ?>"><?php _e('设置外观'); ?></a></li>
<?php endif; ?>
</ul>

View File

@@ -4,79 +4,67 @@ include 'header.php';
include 'menu.php';
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<?php include 'theme-tabs.php'; ?>
<div class="row typecho-page-main" role="main">
<div class="col-mb-12">
<ul class="typecho-option-tabs fix-tabs clearfix">
<li class="current"><a href="<?php $options->adminUrl('themes.php'); ?>"><?php _e('可以使用的外观'); ?></a>
</li>
<?php if (\Widget\Themes\Files::isWriteable()): ?>
<li><a href="<?php $options->adminUrl('theme-editor.php'); ?>"><?php _e('编辑当前外观'); ?></a></li>
<table class="typecho-list-table typecho-theme-list">
<colgroup>
<col width="35%"/>
<col/>
</colgroup>
<thead>
<th><?php _e('截图'); ?></th>
<th><?php _e('详情'); ?></th>
</thead>
<tbody>
<?php if ($options->missingTheme): ?>
<tr id="theme-<?php $options->missingTheme; ?>" class="current">
<td colspan="2" class="warning">
<p><strong><?php _e('检测到您之前使用的 "%s" 外观文件不存在,您可以重新上传此外观或者启用其他外观。', $options->missingTheme); ?></strong></p>
<ul>
<li><?php _e('重新上传此外观后刷新当前页面,此提示将会消失。'); ?></li>
<li><?php _e('启用新外观后,当前外观的设置数据将被删除。'); ?></li>
</ul>
</td>
</tr>
<?php endif; ?>
<?php if (\Widget\Themes\Config::isExists()): ?>
<li><a href="<?php $options->adminUrl('options-theme.php'); ?>"><?php _e('设置外观'); ?></a></li>
<?php endif; ?>
</ul>
<div class="typecho-table-wrap">
<table class="typecho-list-table typecho-theme-list">
<colgroup>
<col width="35%"/>
<col/>
</colgroup>
<thead>
<th><?php _e('截图'); ?></th>
<th><?php _e('详情'); ?></th>
</thead>
<tbody>
<?php if ($options->missingTheme): ?>
<tr id="theme-<?php $options->missingTheme; ?>" class="current">
<td colspan="2" class="warning">
<p><strong><?php _e('检测到您之前使用的 "%s" 外观文件不存在,您可以重新上传此外观或者启用其他外观。', $options->missingTheme); ?></strong></p>
<ul>
<li><?php _e('重新上传此外观后刷新当前页面,此提示将会消失。'); ?></li>
<li><?php _e('启用新外观后,当前外观的设置数据将被删除。'); ?></li>
</ul>
</td>
</tr>
<?php endif; ?>
<?php \Widget\Themes\Rows::alloc()->to($themes); ?>
<?php while ($themes->next()): ?>
<tr id="theme-<?php $themes->name(); ?>"
class="<?php if ($themes->activated && !$options->missingTheme): ?>current<?php endif; ?>">
<td valign="top"><img src="<?php $themes->screen(); ?>"
alt="<?php $themes->name(); ?>"/></td>
<td valign="top">
<h3><?php '' != $themes->title ? $themes->title() : $themes->name(); ?></h3>
<cite>
<?php if ($themes->author): ?><?php _e('作者'); ?>: <?php if ($themes->homepage): ?><a href="<?php $themes->homepage() ?>"><?php endif; ?><?php $themes->author(); ?><?php if ($themes->homepage): ?></a><?php endif; ?> &nbsp;&nbsp;<?php endif; ?>
<?php if ($themes->version): ?><?php _e('版本'); ?>: <?php $themes->version() ?><?php endif; ?>
</cite>
<p><?php echo nl2br($themes->description); ?></p>
<?php if ($options->theme != $themes->name || $options->missingTheme): ?>
<p>
<?php if (\Widget\Themes\Files::isWriteable()): ?>
<a class="edit"
href="<?php $options->adminUrl('theme-editor.php?theme=' . $themes->name); ?>"><?php _e('编辑'); ?></a> &nbsp;
<?php endif; ?>
<a class="activate"
href="<?php $security->index('/action/themes-edit?change=' . $themes->name); ?>"><?php _e('启用'); ?></a>
</p>
<?php endif; ?>
</td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
<?php \Widget\Themes\Rows::alloc()->to($themes); ?>
<?php while ($themes->next()): ?>
<tr id="theme-<?php $themes->name(); ?>"
class="<?php if ($themes->activated && !$options->missingTheme): ?>current<?php endif; ?>">
<td valign="top"><img src="<?php $themes->screen(); ?>"
alt="<?php $themes->name(); ?>"/></td>
<td valign="top">
<h3><?php '' != $themes->title ? $themes->title() : $themes->name(); ?></h3>
<cite>
<?php if ($themes->author): ?><?php _e('作者'); ?>: <?php if ($themes->homepage): ?><a href="<?php $themes->homepage() ?>"><?php endif; ?><?php $themes->author(); ?><?php if ($themes->homepage): ?></a><?php endif; ?> &nbsp;&nbsp;<?php endif; ?>
<?php if ($themes->version): ?><?php _e('版本'); ?>: <?php $themes->version() ?><?php endif; ?>
</cite>
<p><?php echo nl2br($themes->description); ?></p>
<?php if ($options->theme != $themes->name || $options->missingTheme): ?>
<p>
<?php if (\Widget\Themes\Files::isWriteable()): ?>
<a class="edit"
href="<?php $options->adminUrl('theme-editor.php?theme=' . $themes->name); ?>"><?php _e('编辑'); ?></a> &nbsp;
<?php endif; ?>
<a class="activate"
href="<?php $security->index('/action/themes-edit?change=' . $themes->name); ?>"><?php _e('启用'); ?></a>
</p>
<?php endif; ?>
</td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -4,7 +4,7 @@ include 'header.php';
include 'menu.php';
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="main">
@@ -29,7 +29,7 @@ include 'menu.php';
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -4,7 +4,7 @@ include 'header.php';
include 'menu.php';
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="form">
@@ -13,7 +13,7 @@ include 'menu.php';
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -4,7 +4,7 @@ include 'header.php';
include 'menu.php';
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="main">
@@ -27,7 +27,7 @@ include 'menu.php';
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -79,6 +79,9 @@ $(document).ready(function() {
prePopulate : tagsPre,
onResult : function (result, query, val) {
// remove special chars
val = val.replace(/<|>|&|"|'/g, '');
if (!query) {
return result;
}
@@ -142,7 +145,7 @@ $(document).ready(function() {
idInput = $('input[name=cid]'),
draft = $('input[name=draft]'),
btnPreview = $('#btn-preview'),
autoSave = $('<span id="auto-save-message" class="left"></span>').prependTo('.submit');
autoSave = $('<span id="auto-save-message"></span>').prependTo('.left');
let cid = idInput.val(),
draftId = draft.length > 0 ? draft.val() : 0,
@@ -317,12 +320,6 @@ $(document).ready(function() {
return false;
});
// 高级选项控制
$('#advance-panel-btn').click(function() {
$('#advance-panel').toggle();
return false;
});
// 自动隐藏密码框
$('#visibility').change(function () {
const val = $(this).val(), password = $('#post-password');

View File

@@ -16,182 +16,187 @@ while ($parents->next()) {
$parentPages[$parents->cid] = str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $parents->levels) . $parents->title;
}
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main typecho-post-area" role="form">
<form action="<?php $security->index('/action/contents-page-edit'); ?>" method="post" name="write_page">
<div class="col-mb-12 col-tb-9" role="main">
<?php if ($page->draft): ?>
<?php if ($page->draft['cid'] != $page->cid): ?>
<?php $pageModifyDate = new \Typecho\Date($page->draft['modified']); ?>
<cite
class="edit-draft-notice"><?php _e('你正在编辑的是保存于 %s 的修订版, 你也可以 <a href="%s">删除它</a>', $pageModifyDate->word(),
$security->getIndex('/action/contents-page-edit?do=deleteDraft&cid=' . $page->cid)); ?></cite>
<?php else: ?>
<cite class="edit-draft-notice"><?php _e('当前正在编辑的是未发布的草稿'); ?></cite>
<?php endif; ?>
<input name="draft" type="hidden" value="<?php echo $page->draft['cid'] ?>"/>
<form class="row typecho-page-main typecho-post-area" action="<?php $security->index('/action/contents-page-edit'); ?>" method="post" name="write_page">
<div class="col-mb-12 col-tb-9" role="main">
<?php if ($page->draft): ?>
<?php if ($page->draft['cid'] != $page->cid): ?>
<?php $pageModifyDate = new \Typecho\Date($page->draft['modified']); ?>
<cite
class="edit-draft-notice"><?php _e('你正在编辑的是保存于 %s 的修订版, 你也可以 <a href="%s">删除它</a>', $pageModifyDate->word(),
$security->getIndex('/action/contents-page-edit?do=deleteDraft&cid=' . $page->cid)); ?></cite>
<?php else: ?>
<cite class="edit-draft-notice"><?php _e('当前正在编辑的是未发布的草稿'); ?></cite>
<?php endif; ?>
<input name="draft" type="hidden" value="<?php echo $page->draft['cid'] ?>"/>
<?php endif; ?>
<p class="title">
<label for="title" class="sr-only"><?php _e('标题'); ?></label>
<input type="text" id="title" name="title" autocomplete="off" value="<?php $page->title(); ?>"
placeholder="<?php _e('标题'); ?>" class="w-100 text title"/>
</p>
<?php $permalink = \Typecho\Common::url($options->routingTable['page']['url'], $options->index);
[$scheme, $permalink] = explode(':', $permalink, 2);
$permalink = ltrim($permalink, '/');
$permalink = preg_replace("/\[([_a-z0-9-]+)[^\]]*\]/i", "{\\1}", $permalink);
if ($page->have()) {
$permalink = str_replace('{cid}', $page->cid, $permalink);
}
$input = '<input type="text" id="slug" name="slug" autocomplete="off" value="' . htmlspecialchars($page->slug ?? '') . '" class="mono" />';
?>
<p class="mono url-slug">
<label for="slug" class="sr-only"><?php _e('网址缩略名'); ?></label>
<?php echo preg_replace_callback("/\{(slug|directory)\}/i", function ($matches) use ($input) {
if ($matches[1] == 'slug') {
return $input;
} else {
return '{directory/' . $input . '}';
}
}, $permalink); ?>
</p>
<p>
<label for="text" class="sr-only"><?php _e('页面内容'); ?></label>
<textarea style="height: <?php $options->editorSize(); ?>px" autocomplete="off" id="text"
name="text" class="w-100 mono"><?php echo htmlspecialchars($page->text); ?></textarea>
</p>
<p class="title">
<label for="title" class="sr-only"><?php _e('标题'); ?></label>
<input type="text" id="title" name="title" autocomplete="off" value="<?php $page->title(); ?>"
placeholder="<?php _e('标题'); ?>" class="w-100 text title"/>
</p>
<?php $permalink = \Typecho\Common::url($options->routingTable['page']['url'], $options->index);
[$scheme, $permalink] = explode(':', $permalink, 2);
$permalink = ltrim($permalink, '/');
$permalink = preg_replace("/\[([_a-z0-9-]+)[^\]]*\]/i", "{\\1}", $permalink);
if ($page->have()) {
$permalink = preg_replace_callback(
"/\{(cid)\}/i",
function ($matches) use ($page) {
$key = $matches[1];
return $page->getRouterParam($key);
},
$permalink
);
}
$input = '<input type="text" id="slug" name="slug" autocomplete="off" value="' . htmlspecialchars($page->slug ?? '') . '" class="mono" />';
?>
<p class="mono url-slug">
<label for="slug" class="sr-only"><?php _e('网址缩略名'); ?></label>
<?php echo preg_replace_callback("/\{(slug|directory)\}/i", function ($matches) use ($input) {
if ($matches[1] == 'slug') {
return $input;
} else {
return '{directory/' . $input . '}';
}
}, $permalink); ?>
</p>
<p>
<label for="text" class="sr-only"><?php _e('页面内容'); ?></label>
<textarea style="height: <?php $options->editorSize(); ?>px" autocomplete="off" id="text"
name="text" class="w-100 mono"><?php echo htmlspecialchars($page->text); ?></textarea>
</p>
<?php include 'custom-fields.php'; ?>
<p class="submit clearfix">
<span class="left">
<button type="button" id="btn-cancel-preview" class="btn"><i
class="i-caret-left"></i> <?php _e('取消预览'); ?></button>
</span>
<span class="right">
<input type="hidden" name="do" value="publish" />
<input type="hidden" name="cid" value="<?php $page->cid(); ?>"/>
<button type="button" id="btn-preview" class="btn"><i
class="i-exlink"></i> <?php _e('预览页面'); ?></button>
<button type="submit" name="do" value="save" id="btn-save"
class="btn"><?php _e('保存草稿'); ?></button>
<button type="submit" name="do" value="publish" class="btn primary"
id="btn-submit"><?php _e('发布页面'); ?></button>
<?php if ($options->markdown && (!$page->have() || $page->isMarkdown)): ?>
<input type="hidden" name="markdown" value="1"/>
<?php endif; ?>
</span>
</p>
<?php \Typecho\Plugin::factory('admin/write-page.php')->call('content', $page); ?>
</div>
<div id="edit-secondary" class="col-mb-12 col-tb-3" role="complementary">
<ul class="typecho-option-tabs clearfix">
<li class="active w-50"><a href="#tab-advance"><?php _e('选项'); ?></a></li>
<li class="w-50"><a href="#tab-files" id="tab-files-btn"><?php _e('附件'); ?></a></li>
</ul>
<div id="tab-advance" class="tab-content">
<section class="typecho-post-option" role="application">
<label for="date" class="typecho-label"><?php _e('发布日期'); ?></label>
<p><input class="typecho-date w-100" type="text" name="date" id="date" autocomplete="off"
value="<?php $page->have() && $page->created > 0 ? $page->date('Y-m-d H:i') : ''; ?>"/>
</p>
</section>
<section class="typecho-post-option">
<label for="order" class="typecho-label"><?php _e('页面顺序'); ?></label>
<p><input type="text" id="order" name="order" value="<?php $page->order(); ?>"
class="w-100"/></p>
<p class="description"><?php _e('为你的自定义页面设定一个序列值以后, 能够使得它们按此值从小到大排列'); ?></p>
</section>
<section class="typecho-post-option">
<label for="template" class="typecho-label"><?php _e('自定义模板'); ?></label>
<p>
<select name="template" id="template">
<option value=""><?php _e('不选择'); ?></option>
<?php $templates = $page->getTemplates();
foreach ($templates as $template => $name): ?>
<option
value="<?php echo $template; ?>"<?php if ($template == $page->template): ?> selected="true"<?php endif; ?>><?php echo $name; ?></option>
<?php endforeach; ?>
</select>
</p>
<p class="description"><?php _e('如果你为此页面选择了一个自定义模板, 系统将按照你选择的模板文件展现它'); ?></p>
</section>
<section class="typecho-post-option">
<label for="parent" class="typecho-label"><?php _e('父级页面'); ?></label>
<p>
<select name="parent" id="parent">
<?php foreach ($parentPages as $pageId => $pageTitle): ?>
<option
value="<?php echo $pageId; ?>"<?php if ($pageId == ($page->parent ?? $parentPageId)): ?> selected="true"<?php endif; ?>><?php echo $pageTitle; ?></option>
<?php endforeach; ?>
</select>
</p>
<p class="description"><?php _e('如果你设定了父级页面, 此页面将作为子页面呈现'); ?></p>
</section>
<?php \Typecho\Plugin::factory('admin/write-page.php')->call('option', $page); ?>
<button type="button" id="advance-panel-btn" class="btn btn-xs"><?php _e('高级选项'); ?> <i
class="i-caret-down"></i></button>
<div id="advance-panel">
<section class="typecho-post-option visibility-option">
<label for="visibility" class="typecho-label"><?php _e('公开度'); ?></label>
<p>
<select id="visibility" name="visibility">
<option
value="publish"<?php if ($page->status == 'publish' || !$page->status): ?> selected<?php endif; ?>><?php _e('公开'); ?></option>
<option
value="hidden"<?php if ($page->status == 'hidden'): ?> selected<?php endif; ?>><?php _e('隐藏'); ?></option>
</select>
</p>
</section>
<section class="typecho-post-option allow-option">
<label class="typecho-label"><?php _e('权限控制'); ?></label>
<ul>
<li><input id="allowComment" name="allowComment" type="checkbox" value="1"
<?php if ($page->allow('comment')): ?>checked="true"<?php endif; ?> />
<label for="allowComment"><?php _e('允许评论'); ?></label></li>
<li><input id="allowPing" name="allowPing" type="checkbox" value="1"
<?php if ($page->allow('ping')): ?>checked="true"<?php endif; ?> />
<label for="allowPing"><?php _e('允许被引用'); ?></label></li>
<li><input id="allowFeed" name="allowFeed" type="checkbox" value="1"
<?php if ($page->allow('feed')): ?>checked="true"<?php endif; ?> />
<label for="allowFeed"><?php _e('允许在聚合中出现'); ?></label></li>
</ul>
</section>
<?php \Typecho\Plugin::factory('admin/write-page.php')->call('advanceOption', $page); ?>
</div>
<?php if ($page->have()): ?>
<?php $modified = new \Typecho\Date($page->modified); ?>
<section class="typecho-post-option">
<p class="description">
<br>&mdash;<br>
<?php _e('本页面由 <a href="%s">%s</a> 创建',
\Typecho\Common::url('manage-pages.php?uid=' . $page->author->uid, $options->adminUrl), $page->author->screenName); ?>
<br>
<?php _e('最后更新于 %s', $modified->word()); ?>
</p>
</section>
<?php include 'custom-fields.php'; ?>
<p class="submit">
<span class="left">
<button type="button" id="btn-cancel-preview" class="btn"><i
class="i-caret-left"></i> <?php _e('取消预览'); ?></button>
</span>
<span class="right">
<input type="hidden" name="do" value="publish" />
<input type="hidden" name="cid" value="<?php $page->cid(); ?>"/>
<button type="button" id="btn-preview" class="btn"><i
class="i-exlink"></i> <?php _e('预览页面'); ?></button>
<button type="submit" name="do" value="save" id="btn-save"
class="btn"><?php _e('保存草稿'); ?></button>
<button type="submit" name="do" value="publish" class="btn primary"
id="btn-submit"><?php _e('发布页面'); ?></button>
<?php if ($options->markdown && (!$page->have() || $page->isMarkdown)): ?>
<input type="hidden" name="markdown" value="1"/>
<?php endif; ?>
</div><!-- end #tab-advance -->
</span>
</p>
<div id="tab-files" class="tab-content hidden">
<?php include 'file-upload.php'; ?>
</div><!-- end #tab-files -->
</div>
</form>
</div>
<?php \Typecho\Plugin::factory('admin/write-page.php')->call('content', $page); ?>
</div>
<div id="edit-secondary" class="col-mb-12 col-tb-3" role="complementary">
<ul class="typecho-option-tabs">
<li class="active w-50"><a href="#tab-advance"><?php _e('选项'); ?></a></li>
<li class="w-50"><a href="#tab-files" id="tab-files-btn"><?php _e('附件'); ?></a></li>
</ul>
<div id="tab-advance" class="tab-content">
<section class="typecho-post-option" role="application">
<label for="date" class="typecho-label"><?php _e('发布日期'); ?></label>
<p><input class="typecho-date w-100" type="text" name="date" id="date" autocomplete="off"
value="<?php $page->have() && $page->created > 0 ? $page->date('Y-m-d H:i') : ''; ?>"/>
</p>
</section>
<section class="typecho-post-option">
<label for="order" class="typecho-label"><?php _e('页面顺序'); ?></label>
<p><input type="number" id="order" name="order" value="<?php $page->order(); ?>"
class="w-100"/></p>
<p class="description"><?php _e('为你的自定义页面设定一个序列值以后, 能够使得它们按此值从小到大排列'); ?></p>
</section>
<section class="typecho-post-option">
<label for="template" class="typecho-label"><?php _e('自定义模板'); ?></label>
<p>
<select name="template" id="template">
<option value=""><?php _e('不选择'); ?></option>
<?php $templates = $page->getTemplates();
foreach ($templates as $template => $name): ?>
<option
value="<?php echo $template; ?>"<?php if ($template == $page->template): ?> selected="true"<?php endif; ?>><?php echo $name; ?></option>
<?php endforeach; ?>
</select>
</p>
<p class="description"><?php _e('如果你为此页面选择了一个自定义模板, 系统将按照你选择的模板文件展现它'); ?></p>
</section>
<section class="typecho-post-option">
<label for="parent" class="typecho-label"><?php _e('父级页面'); ?></label>
<p>
<select name="parent" id="parent">
<?php foreach ($parentPages as $pageId => $pageTitle): ?>
<option
value="<?php echo $pageId; ?>"<?php if ($pageId == ($page->parent ?? $parentPageId)): ?> selected="true"<?php endif; ?>><?php echo $pageTitle; ?></option>
<?php endforeach; ?>
</select>
</p>
<p class="description"><?php _e('如果你设定了父级页面, 此页面将作为子页面呈现'); ?></p>
</section>
<?php \Typecho\Plugin::factory('admin/write-page.php')->call('option', $page); ?>
<details id="advance-panel">
<summary class="btn btn-xs"><?php _e('高级选项'); ?> <i class="i-caret-down"></i></summary>
<section class="typecho-post-option visibility-option">
<label for="visibility" class="typecho-label"><?php _e('公开度'); ?></label>
<p>
<select id="visibility" name="visibility">
<option
value="publish"<?php if ($page->status == 'publish' || !$page->status): ?> selected<?php endif; ?>><?php _e('公开'); ?></option>
<option
value="hidden"<?php if ($page->status == 'hidden'): ?> selected<?php endif; ?>><?php _e('隐藏'); ?></option>
</select>
</p>
</section>
<section class="typecho-post-option allow-option">
<label class="typecho-label"><?php _e('权限控制'); ?></label>
<ul>
<li><input id="allowComment" name="allowComment" type="checkbox" value="1"
<?php if ($page->allow('comment')): ?>checked="true"<?php endif; ?> />
<label for="allowComment"><?php _e('允许评论'); ?></label></li>
<li><input id="allowPing" name="allowPing" type="checkbox" value="1"
<?php if ($page->allow('ping')): ?>checked="true"<?php endif; ?> />
<label for="allowPing"><?php _e('允许被引用'); ?></label></li>
<li><input id="allowFeed" name="allowFeed" type="checkbox" value="1"
<?php if ($page->allow('feed')): ?>checked="true"<?php endif; ?> />
<label for="allowFeed"><?php _e('允许在聚合中出现'); ?></label></li>
</ul>
</section>
<?php \Typecho\Plugin::factory('admin/write-page.php')->call('advanceOption', $page); ?>
</details>
<?php if ($page->have()): ?>
<?php $modified = new \Typecho\Date($page->modified); ?>
<section class="typecho-post-option">
<p class="description">
<br>&mdash;<br>
<?php _e('本页面由 <a href="%s">%s</a> 创建',
\Typecho\Common::url('manage-pages.php?uid=' . $page->author->uid, $options->adminUrl), $page->author->screenName); ?>
<br>
<?php _e('最后更新于 %s', $modified->word()); ?>
</p>
</section>
<?php endif; ?>
</div><!-- end #tab-advance -->
<div id="tab-files" class="tab-content hidden">
<?php include 'file-upload.php'; ?>
</div><!-- end #tab-files -->
</div>
</form>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -5,194 +5,195 @@ include 'menu.php';
$post = \Widget\Contents\Post\Edit::alloc()->prepare();
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main typecho-post-area" role="form">
<form action="<?php $security->index('/action/contents-post-edit'); ?>" method="post" name="write_post">
<div class="col-mb-12 col-tb-9" role="main">
<?php if ($post->draft): ?>
<?php if ($post->draft['cid'] != $post->cid): ?>
<?php $postModifyDate = new \Typecho\Date($post->draft['modified']); ?>
<cite
class="edit-draft-notice"><?php _e('你正在编辑的是保存于 %s 的修订版, 你也可以 <a href="%s">删除它</a>', $postModifyDate->word(),
$security->getIndex('/action/contents-post-edit?do=deleteDraft&cid=' . $post->cid)); ?></cite>
<?php else: ?>
<cite class="edit-draft-notice"><?php _e('当前正在编辑的是未发布的草稿'); ?></cite>
<?php endif; ?>
<input name="draft" type="hidden" value="<?php echo $post->draft['cid'] ?>"/>
<form class="row typecho-page-main typecho-post-area" action="<?php $security->index('/action/contents-post-edit'); ?>" method="post" name="write_post">
<div class="col-mb-12 col-tb-9" role="main">
<?php if ($post->draft): ?>
<?php if ($post->draft['cid'] != $post->cid): ?>
<?php $postModifyDate = new \Typecho\Date($post->draft['modified']); ?>
<cite
class="edit-draft-notice"><?php _e('你正在编辑的是保存于 %s 的修订版, 你也可以 <a href="%s">删除它</a>', $postModifyDate->word(),
$security->getIndex('/action/contents-post-edit?do=deleteDraft&cid=' . $post->cid)); ?></cite>
<?php else: ?>
<cite class="edit-draft-notice"><?php _e('当前正在编辑的是未发布的草稿'); ?></cite>
<?php endif; ?>
<input name="draft" type="hidden" value="<?php echo $post->draft['cid'] ?>"/>
<?php endif; ?>
<p class="title">
<label for="title" class="sr-only"><?php _e('标题'); ?></label>
<input type="text" id="title" name="title" autocomplete="off" value="<?php $post->title(); ?>"
placeholder="<?php _e('标题'); ?>" class="w-100 text title"/>
</p>
<?php $permalink = \Typecho\Common::url($options->routingTable['post']['url'], $options->index);
[$scheme, $permalink] = explode(':', $permalink, 2);
$permalink = ltrim($permalink, '/');
$permalink = preg_replace("/\[([_a-z0-9-]+)[^\]]*\]/i", "{\\1}", $permalink);
if ($post->have()) {
$permalink = str_replace([
'{cid}', '{category}', '{year}', '{month}', '{day}'
], [
$post->cid, $post->category, $post->year, $post->month, $post->day
], $permalink);
}
$input = '<input type="text" id="slug" name="slug" autocomplete="off" value="' . htmlspecialchars($post->slug ?? '') . '" class="mono" />';
?>
<p class="mono url-slug">
<label for="slug" class="sr-only"><?php _e('网址缩略名'); ?></label>
<?php echo preg_replace("/\{slug\}/i", $input, $permalink); ?>
</p>
<p>
<label for="text" class="sr-only"><?php _e('文章内容'); ?></label>
<textarea style="height: <?php $options->editorSize(); ?>px" autocomplete="off" id="text"
name="text" class="w-100 mono"><?php echo htmlspecialchars($post->text); ?></textarea>
</p>
<p class="title">
<label for="title" class="sr-only"><?php _e('标题'); ?></label>
<input type="text" id="title" name="title" autocomplete="off" value="<?php $post->title(); ?>"
placeholder="<?php _e('标题'); ?>" class="w-100 text title"/>
</p>
<?php $permalink = \Typecho\Common::url($options->routingTable['post']['url'], $options->index);
[$scheme, $permalink] = explode(':', $permalink, 2);
$permalink = ltrim($permalink, '/');
$permalink = preg_replace("/\[([_a-z0-9-]+)[^\]]*\]/i", "{\\1}", $permalink);
if ($post->have()) {
$permalink = preg_replace_callback(
"/\{(cid|category|year|month|day)\}/i",
function ($matches) use ($post) {
$key = $matches[1];
return $post->getRouterParam($key);
},
$permalink
);
}
$input = '<input type="text" id="slug" name="slug" autocomplete="off" value="' . htmlspecialchars($post->slug ?? '') . '" class="mono" />';
?>
<p class="mono url-slug">
<label for="slug" class="sr-only"><?php _e('网址缩略名'); ?></label>
<?php echo preg_replace("/\{slug\}/i", $input, $permalink); ?>
</p>
<p>
<label for="text" class="sr-only"><?php _e('文章内容'); ?></label>
<textarea style="height: <?php $options->editorSize(); ?>px" autocomplete="off" id="text"
name="text" class="w-100 mono"><?php echo htmlspecialchars($post->text); ?></textarea>
</p>
<?php include 'custom-fields.php'; ?>
<?php include 'custom-fields.php'; ?>
<p class="submit clearfix">
<span class="left">
<button type="button" id="btn-cancel-preview" class="btn"><i
class="i-caret-left"></i> <?php _e('取消预览'); ?></button>
</span>
<span class="right">
<input type="hidden" name="do" value="publish" />
<input type="hidden" name="cid" value="<?php $post->cid(); ?>"/>
<button type="button" id="btn-preview" class="btn"><i
class="i-exlink"></i> <?php _e('预览文章'); ?></button>
<button type="submit" name="do" value="save" id="btn-save"
class="btn"><?php _e('保存草稿'); ?></button>
<button type="submit" name="do" value="publish" class="btn primary"
id="btn-submit"><?php _e('发布文章'); ?></button>
<?php if ($options->markdown && (!$post->have() || $post->isMarkdown)): ?>
<input type="hidden" name="markdown" value="1"/>
<?php endif; ?>
</span>
</p>
<p class="submit">
<span class="left">
<button type="button" id="btn-cancel-preview" class="btn"><i
class="i-caret-left"></i> <?php _e('取消预览'); ?></button>
</span>
<span class="right">
<input type="hidden" name="do" value="publish" />
<input type="hidden" name="cid" value="<?php $post->cid(); ?>"/>
<button type="button" id="btn-preview" class="btn"><i
class="i-exlink"></i> <?php _e('预览文章'); ?></button>
<button type="submit" name="do" value="save" id="btn-save"
class="btn"><?php _e('保存草稿'); ?></button>
<button type="submit" name="do" value="publish" class="btn primary"
id="btn-submit"><?php _e('发布文章'); ?></button>
<?php if ($options->markdown && (!$post->have() || $post->isMarkdown)): ?>
<input type="hidden" name="markdown" value="1"/>
<?php endif; ?>
</span>
</p>
<?php \Typecho\Plugin::factory('admin/write-post.php')->call('content', $post); ?>
</div>
<?php \Typecho\Plugin::factory('admin/write-post.php')->call('content', $post); ?>
</div>
<div id="edit-secondary" class="col-mb-12 col-tb-3" role="complementary">
<ul class="typecho-option-tabs clearfix">
<li class="active w-50"><a href="#tab-advance"><?php _e('选项'); ?></a></li>
<li class="w-50"><a href="#tab-files" id="tab-files-btn"><?php _e('附件'); ?></a></li>
</ul>
<div id="edit-secondary" class="col-mb-12 col-tb-3" role="complementary">
<ul class="typecho-option-tabs">
<li class="active w-50"><a href="#tab-advance"><?php _e('选项'); ?></a></li>
<li class="w-50"><a href="#tab-files" id="tab-files-btn"><?php _e('附件'); ?></a></li>
</ul>
<div id="tab-advance" class="tab-content">
<section class="typecho-post-option" role="application">
<label for="date" class="typecho-label"><?php _e('发布日期'); ?></label>
<p><input class="typecho-date w-100" type="text" name="date" id="date" autocomplete="off"
value="<?php $post->have() && $post->created > 0 ? $post->date('Y-m-d H:i') : ''; ?>"/>
</p>
</section>
<div id="tab-advance" class="tab-content">
<section class="typecho-post-option" role="application">
<label for="date" class="typecho-label"><?php _e('发布日期'); ?></label>
<p><input class="typecho-date w-100" type="text" name="date" id="date" autocomplete="off"
value="<?php $post->have() && $post->created > 0 ? $post->date('Y-m-d H:i') : ''; ?>"/>
</p>
</section>
<section class="typecho-post-option category-option">
<label class="typecho-label"><?php _e('分类'); ?></label>
<?php \Widget\Metas\Category\Rows::alloc()->to($category); ?>
<section class="typecho-post-option category-option">
<label class="typecho-label"><?php _e('分类'); ?></label>
<?php \Widget\Metas\Category\Rows::alloc()->to($category); ?>
<ul>
<?php $categories = array_column($post->categories, 'mid'); ?>
<?php while ($category->next()): ?>
<li><?php echo str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $category->levels); ?><input
type="checkbox" id="category-<?php $category->mid(); ?>"
value="<?php $category->mid(); ?>" name="category[]"
<?php if (in_array($category->mid, $categories)): ?>checked="true"<?php endif; ?>/>
<label
for="category-<?php $category->mid(); ?>"><?php $category->name(); ?></label>
</li>
<?php endwhile; ?>
</ul>
</section>
<section class="typecho-post-option">
<label for="token-input-tags" class="typecho-label"><?php _e('标签'); ?></label>
<p><input id="tags" name="tags" type="text" value="<?php $post->have() ? $post->tags(',', false) : ''; ?>"
class="w-100 text"/></p>
</section>
<?php \Typecho\Plugin::factory('admin/write-post.php')->call('option', $post); ?>
<details id="advance-panel">
<summary class="btn btn-xs"><?php _e('高级选项'); ?> <i class="i-caret-down"></i></summary>
<?php if ($user->pass('editor', true)): ?>
<section class="typecho-post-option visibility-option">
<label for="visibility" class="typecho-label"><?php _e('公开度'); ?></label>
<p>
<select id="visibility" name="visibility">
<?php if ($user->pass('editor', true)): ?>
<option
value="publish"<?php if (($post->status == 'publish' && !$post->password) || !$post->status): ?> selected<?php endif; ?>><?php _e('公开'); ?></option>
<option
value="hidden"<?php if ($post->status == 'hidden'): ?> selected<?php endif; ?>><?php _e('隐藏'); ?></option>
<option
value="password"<?php if (strlen($post->password ?? '') > 0): ?> selected<?php endif; ?>><?php _e('密码保护'); ?></option>
<option
value="private"<?php if ($post->status == 'private'): ?> selected<?php endif; ?>><?php _e('私密'); ?></option>
<?php endif; ?>
<option
value="waiting"<?php if (!$user->pass('editor', true) || $post->status == 'waiting'): ?> selected<?php endif; ?>><?php _e('待审核'); ?></option>
</select>
</p>
<p id="post-password"<?php if (strlen($post->password ?? '') == 0): ?> class="hidden"<?php endif; ?>>
<label for="protect-pwd" class="sr-only">内容密码</label>
<input type="text" name="password" id="protect-pwd" class="text-s"
value="<?php $post->password(); ?>" size="16"
placeholder="<?php _e('内容密码'); ?>" autocomplete="off"/>
</p>
</section>
<?php endif; ?>
<section class="typecho-post-option allow-option">
<label class="typecho-label"><?php _e('权限控制'); ?></label>
<ul>
<?php $categories = $post->categories->toArray('mid'); ?>
<?php while ($category->next()): ?>
<li><?php echo str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $category->levels); ?><input
type="checkbox" id="category-<?php $category->mid(); ?>"
value="<?php $category->mid(); ?>" name="category[]"
<?php if (in_array($category->mid, $categories)): ?>checked="true"<?php endif; ?>/>
<label
for="category-<?php $category->mid(); ?>"><?php $category->name(); ?></label>
</li>
<?php endwhile; ?>
<li><input id="allowComment" name="allowComment" type="checkbox" value="1"
<?php if ($post->allow('comment')): ?>checked="true"<?php endif; ?> />
<label for="allowComment"><?php _e('允许评论'); ?></label></li>
<li><input id="allowPing" name="allowPing" type="checkbox" value="1"
<?php if ($post->allow('ping')): ?>checked="true"<?php endif; ?> />
<label for="allowPing"><?php _e('允许被引用'); ?></label></li>
<li><input id="allowFeed" name="allowFeed" type="checkbox" value="1"
<?php if ($post->allow('feed')): ?>checked="true"<?php endif; ?> />
<label for="allowFeed"><?php _e('允许在聚合中出现'); ?></label></li>
</ul>
</section>
<section class="typecho-post-option">
<label for="token-input-tags" class="typecho-label"><?php _e('标签'); ?></label>
<p><input id="tags" name="tags" type="text" value="<?php $post->have() ? $post->tags(',', false) : ''; ?>"
class="w-100 text"/></p>
<label for="trackback" class="typecho-label"><?php _e('引用通告'); ?></label>
<p><textarea id="trackback" class="w-100 mono" name="trackback" rows="2"></textarea></p>
<p class="description"><?php _e('每一行一个引用地址, 用回车隔开'); ?></p>
</section>
<?php \Typecho\Plugin::factory('admin/write-post.php')->call('option', $post); ?>
<?php \Typecho\Plugin::factory('admin/write-post.php')->call('advanceOption', $post); ?>
</details><!-- end #advance-panel -->
<button type="button" id="advance-panel-btn" class="btn btn-xs"><?php _e('高级选项'); ?> <i
class="i-caret-down"></i></button>
<div id="advance-panel">
<?php if ($user->pass('editor', true)): ?>
<section class="typecho-post-option visibility-option">
<label for="visibility" class="typecho-label"><?php _e('公开度'); ?></label>
<p>
<select id="visibility" name="visibility">
<?php if ($user->pass('editor', true)): ?>
<option
value="publish"<?php if (($post->status == 'publish' && !$post->password) || !$post->status): ?> selected<?php endif; ?>><?php _e('公开'); ?></option>
<option
value="hidden"<?php if ($post->status == 'hidden'): ?> selected<?php endif; ?>><?php _e('隐藏'); ?></option>
<option
value="password"<?php if (strlen($post->password ?? '') > 0): ?> selected<?php endif; ?>><?php _e('密码保护'); ?></option>
<option
value="private"<?php if ($post->status == 'private'): ?> selected<?php endif; ?>><?php _e('私密'); ?></option>
<?php endif; ?>
<option
value="waiting"<?php if (!$user->pass('editor', true) || $post->status == 'waiting'): ?> selected<?php endif; ?>><?php _e('待审核'); ?></option>
</select>
</p>
<p id="post-password"<?php if (strlen($post->password ?? '') == 0): ?> class="hidden"<?php endif; ?>>
<label for="protect-pwd" class="sr-only">内容密码</label>
<input type="text" name="password" id="protect-pwd" class="text-s"
value="<?php $post->password(); ?>" size="16"
placeholder="<?php _e('内容密码'); ?>" autocomplete="off"/>
</p>
</section>
<?php endif; ?>
<?php if ($post->have()): ?>
<?php $modified = new \Typecho\Date($post->modified); ?>
<section class="typecho-post-option">
<p class="description">
<br>&mdash;<br>
<?php _e('本文由 <a href="%s">%s</a> 撰写',
\Typecho\Common::url('manage-posts.php?uid=' . $post->author->uid, $options->adminUrl), $post->author->screenName); ?>
<br>
<?php _e('最后更新于 %s', $modified->word()); ?>
</p>
</section>
<?php endif; ?>
</div><!-- end #tab-advance -->
<section class="typecho-post-option allow-option">
<label class="typecho-label"><?php _e('权限控制'); ?></label>
<ul>
<li><input id="allowComment" name="allowComment" type="checkbox" value="1"
<?php if ($post->allow('comment')): ?>checked="true"<?php endif; ?> />
<label for="allowComment"><?php _e('允许评论'); ?></label></li>
<li><input id="allowPing" name="allowPing" type="checkbox" value="1"
<?php if ($post->allow('ping')): ?>checked="true"<?php endif; ?> />
<label for="allowPing"><?php _e('允许被引用'); ?></label></li>
<li><input id="allowFeed" name="allowFeed" type="checkbox" value="1"
<?php if ($post->allow('feed')): ?>checked="true"<?php endif; ?> />
<label for="allowFeed"><?php _e('允许在聚合中出现'); ?></label></li>
</ul>
</section>
<section class="typecho-post-option">
<label for="trackback" class="typecho-label"><?php _e('引用通告'); ?></label>
<p><textarea id="trackback" class="w-100 mono" name="trackback" rows="2"></textarea></p>
<p class="description"><?php _e('每一行一个引用地址, 用回车隔开'); ?></p>
</section>
<?php \Typecho\Plugin::factory('admin/write-post.php')->call('advanceOption', $post); ?>
</div><!-- end #advance-panel -->
<?php if ($post->have()): ?>
<?php $modified = new \Typecho\Date($post->modified); ?>
<section class="typecho-post-option">
<p class="description">
<br>&mdash;<br>
<?php _e('本文由 <a href="%s">%s</a> 撰写',
\Typecho\Common::url('manage-posts.php?uid=' . $post->author->uid, $options->adminUrl), $post->author->screenName); ?>
<br>
<?php _e('最后更新于 %s', $modified->word()); ?>
</p>
</section>
<?php endif; ?>
</div><!-- end #tab-advance -->
<div id="tab-files" class="tab-content hidden">
<?php include 'file-upload.php'; ?>
</div><!-- end #tab-files -->
</div>
</form>
</div>
<div id="tab-files" class="tab-content hidden">
<?php include 'file-upload.php'; ?>
</div><!-- end #tab-files -->
</div>
</form>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -1,52 +0,0 @@
Version 0.8.1/12.4.1
修复同级子目录下安装多个站点引起的登录失效
增加评论黑名单插件
修复评论接口重用导致启用评论验证插件后后台无法评论的bug
修正年份路由的bug
修正由于flash的cookie丢失bug导致的文件无法上传bug
增加对ini_get的判断
提交对Sina App Engine的兼容性判断
增加对Sina App Engine环境的支持
增加对ini_get的判断
修正新注册用户登录后跳转错误bug
修正对ssl的支持
fix issue 510
修复使用多层代理时, 获取ip地址错误
修正修改文章时上传控件无法载入的问题
修改后台错别字
修正错别字
兼容server不支持http 1.1的情况,典型问题如 sae环境404页面乱码
修正由于SAE更改常用导致的数据库信息无法自动读入的问题
增加上传插件接口
提交Sina App Engine专用的文件上传插件
使用SAE的Storage做持久化存储。
修正SaeUpload插件的说明地址
new version library
只是一些小修正
fix bug report on segmentfault
fix issue 536
fix Issue 541
fix Issue 544
fix Issue 544
fix Issue 540
fix Issue 537
fix Issue 529
fix Issue 532
fix issue 526
文章增加待审核功能下一步给文章增加private属性
更新后台表单样式, 新增文章预览功能
css细节微调
文章增加private属性显示
修正插件显示空白问题, 预览框box修正
修改预览内容样式,修改预览选项位置,高级选项->权限控制增加“允许游客访问”选项,用于私密浏览
fix Issue 545
实现文章公开度:公开、密码保护、私有、未审核
little change
实现功能1,当用户之前有审核通过的评论再次发评论会直接为通过审核可关闭2,未通过审核的评论评论作者可以在前台看到他人不可见3,隐藏功能;
修正后台修改或添加页面状态错误的问题;修正保存私密、审核日志时会新增一篇同样日志的问题
简单增强搜索功能 Issue 480
添加有密码和未发布图标
fix Issue 551
将文章管理页的公开度草稿等信息改为文字
接受插件返回的header

View File

@@ -17,10 +17,10 @@ if (!defined('__TYPECHO_ROOT_DIR__') && !@include_once 'config.inc.php') {
\Widget\Init::alloc();
/** 注册一个初始化插件 */
\Typecho\Plugin::factory('index.php')->begin();
\Typecho\Plugin::factory('index.php')->call('begin');
/** 开始路由分发 */
\Typecho\Router::dispatch();
/** 注册一个结束插件 */
\Typecho\Plugin::factory('index.php')->end();
\Typecho\Plugin::factory('index.php')->call('end');

View File

@@ -1064,7 +1064,11 @@ function install_step_2_perform()
// intval port number
if (isset($dbConfig['port'])) {
$dbConfig['port'] = intval($dbConfig['port']);
if (strpos($dbConfig['host'], '/') !== false && $type == 'Mysql') {
$dbConfig['port'] = null;
} else {
$dbConfig['port'] = intval($dbConfig['port']);
}
}
// bool ssl verify

View File

@@ -9,14 +9,14 @@
"version": "1.0.0",
"license": "GPL-2.0-only",
"dependencies": {
"@picocss/pico": "^1.5.0",
"@picocss/pico": "^2.0.6",
"chalk": "^4.0.0",
"node-sass": "^9.0.0",
"sprite-magic-importer": "^1.6.2",
"uglify-js": "^3.11.6"
},
"engines": {
"node": "16.x"
"node": "18.x"
}
},
"node_modules/@babel/code-frame": {
@@ -227,9 +227,12 @@
}
},
"node_modules/@picocss/pico": {
"version": "1.5.10",
"resolved": "https://registry.npmjs.org/@picocss/pico/-/pico-1.5.10.tgz",
"integrity": "sha512-+LafMsrwPxXQMk6sI///TmSInCwwZmq+K7SikyL3N/4GhhwzyPC+TQLUEqmrLyjluR+uIpFFcqjty30Rtr6GxQ=="
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/@picocss/pico/-/pico-2.0.6.tgz",
"integrity": "sha512-/d8qsykowelD6g8k8JYgmCagOIulCPHMEc2NC4u7OjmpQLmtSetLhEbt0j1n3fPNJVcrT84dRp0RfJBn3wJROA==",
"engines": {
"node": ">=18.19.0"
}
},
"node_modules/@sindresorhus/is": {
"version": "0.7.0",

View File

@@ -4,7 +4,7 @@
"description": "Typecho build tools",
"main": "build.js",
"engines": {
"node": "16.x"
"node": "18.x"
},
"scripts": {
"build_js": "node build.js js",
@@ -17,7 +17,7 @@
"author": "joyqi",
"license": "GPL-2.0-only",
"dependencies": {
"@picocss/pico": "^1.5.0",
"@picocss/pico": "^2.0.6",
"chalk": "^4.0.0",
"node-sass": "^9.0.0",
"sprite-magic-importer": "^1.6.2",

View File

@@ -12,7 +12,7 @@
<li>Доступ к текущей странице невозможен, возможно, у нее нет разрешения или она была удалена.</li>
<li>現在のページにアクセスできない、権限がない、または削除された可能性があります。</li>
</ul>
<p class="text-center"><a href="<?php $this->options->siteUrl(); ?>" role="button" class="secondary"><?php _e('回首页'); ?></a></p>
<p class="text-center"><a href="<?php $this->options->siteUrl(); ?>" role="button" class="outline"><?php _e('回首页'); ?></a></p>
</div>
</main>

View File

@@ -6,11 +6,11 @@
<?php $comments->listComments(array(
'commentStatus' => _t('你的评论正等待审核'),
'avatarSize' => 120,
'defaultAvatar' => 'monsterid'
'avatarSize' => 64,
'defaultAvatar' => 'identicon'
)); ?>
<?php $comments->pageNav('&laquo; 前一页', '后一页 &raquo;'); ?>
<nav><?php $comments->pageNav(_t('前一页'), _t('后一页'), 3, '...', array('wrapTag' => 'ul', 'itemTag' => 'li')); ?></nav>
<?php endif; ?>
@@ -23,7 +23,9 @@
<h5 id="response"><?php _e('你的评论'); ?></h5>
<form method="post" action="<?php $this->commentUrl() ?>" id="comment-form" role="form">
<textarea placeholder="<?php _e('评论内容...'); ?>" rows="4" cols="50" name="text" id="textarea" required><?php $this->remember('text'); ?></textarea>
<div class="grid">
<textarea placeholder="<?php _e('评论内容...'); ?>" rows="4" cols="300" name="text" id="textarea" required><?php $this->remember('text'); ?></textarea>
</div>
<?php if ($this->user->hasLogin()): ?>
<p>
<?php _e('登录身份:'); ?><a href="<?php $this->options->profileUrl(); ?>"><?php $this->user->screenName(); ?></a><span class="mx-2 text-muted">&middot;</span><a href="<?php $this->options->logoutUrl(); ?>"><?php _e('退出'); ?></a>
@@ -32,7 +34,7 @@
<div class="grid">
<input type="text" placeholder="<?php _e('名字'); ?>" name="author" id="author" value="<?php $this->remember('author'); ?>" required/>
<input type="email" placeholder="<?php _e('Email'); ?>" name="mail" id="mail" value="<?php $this->remember('mail'); ?>"<?php if ($this->options->commentsRequireMail): ?> required<?php endif; ?> />
<input type="url" placeholder="<?php _e('网站 http://'); ?><?php if (!($this->options->commentsRequireUrl)): ?><?php _e('(选填)'); ?><?php endif; ?>" name="url" id="url" placeholder="<?php _e('https://'); ?>" value="<?php $this->remember('url'); ?>"<?php if ($this->options->commentsRequireUrl): ?> required<?php endif; ?> />
<input type="url" placeholder="<?php _e('http://网站'); ?><?php if (!$this->options->commentsRequireUrl): ?><?php _e('(选填)'); ?><?php endif; ?>" name="url" id="url" value="<?php $this->remember('url'); ?>"<?php if ($this->options->commentsRequireUrl): ?> required<?php endif; ?> />
</div>
<?php endif; ?>
<button type="submit"><?php _e('提交评论'); ?></button>

View File

@@ -1,13 +1,13 @@
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<footer class="site-footer container-fluid">
<div class="d-flex justify-content-between container-inner">
<div class="d-flex justify-content-between">
<ul class="list-inline text-muted">
<li>&copy; <?php echo date('Y'); ?> <a href="<?php $this->options->siteUrl(); ?>"><?php $this->options->title(); ?></a></li>
<li><a href="<?php $this->options->feedUrl(); ?>"><?php _e('RSS'); ?></a></li>
</ul>
<ul class="list-inline text-muted">
<li>
<?php _e(' <a href="https://typecho.org">Typecho</a> 强力驱动'); ?>
<?php _e('Powered by <a href="https://typecho.org">Typecho</a>'); ?>
</li>
</ul>
</div>

View File

@@ -3,18 +3,30 @@ if (!defined('__TYPECHO_ROOT_DIR__')) exit;
function themeConfig($form)
{
$themeStyle = new \Typecho\Widget\Helper\Form\Element\Radio(
'themeStyle',
array(
'auto' => _t('自动'),
'light' => _t('浅色'),
'dark' => _t('深色')
),
'auto',
_t('外观风格')
$logoUrl = new \Typecho\Widget\Helper\Form\Element\Text(
'logoUrl',
null,
null,
_t('网站 Logo'),
_t('在这里填写图片 URL网站将显示 Logo')
);
$form->addInput($themeStyle);
$form->addInput($logoUrl->addRule('url', _t('请填写正确的 URL 地址')));
$colorSchema = new \Typecho\Widget\Helper\Form\Element\Select(
'colorSchema',
array(
null => _t('自动'),
'light' => _t('浅色'),
'dark' => _t('深色'),
'customize' => _t('自定义'),
),
null,
_t('外观风格'),
_t('如果选择了自定义,主题将使用 theme.css 的样式')
);
$form->addInput($colorSchema);
}
function postMeta(

View File

@@ -1,60 +1,60 @@
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<!DOCTYPE html>
<html lang="zh-Hans" data-theme="<?php $this->options->themeStyle(); ?>">
<html lang="zh-Hans"<?php if ($this->options->colorSchema): ?> data-theme="<?php $this->options->colorSchema(); ?>"<?php endif; ?>>
<head>
<meta charset="<?php $this->options->charset(); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php $this->archiveTitle('', '', ' - '); ?><?php $this->options->title(); ?></title>
<title><?php $this->archiveTitle('', '', ' | '); ?><?php $this->options->title(); ?><?php if ($this->is('index')): ?> | <?php $this->options->description() ?><?php endif; ?></title>
<link rel="stylesheet" href="<?php $this->options->themeUrl('static/css/style.css'); ?>">
<?php if ($this->options->colorSchema == 'customize'): ?>
<link rel="stylesheet" href="<?php $this->options->themeUrl('theme.css'); ?>">
<?php endif; ?>
<?php $this->header(); ?>
</head>
<body>
<header class="site-navbar container-fluid">
<div class="container-inner">
<nav>
<ul class="site-name">
<?php if ($this->options->logoUrl): ?>
<li><a href="<?php $this->options->siteUrl(); ?>" class="brand"><img src="<?php $this->options->logoUrl() ?>" alt="<?php $this->options->title() ?>"></a></li>
<?php else: ?>
<li>
<a href="<?php $this->options->siteUrl(); ?>" class="brand"><?php $this->options->title() ?></a>
</li>
<li class="desc"><?php $this->options->description() ?></li>
<?php endif; ?>
</ul>
<nav>
<ul class="site-name">
<?php if ($this->options->logoUrl): ?>
<li><a href="<?php $this->options->siteUrl(); ?>" class="brand"><img src="<?php $this->options->logoUrl() ?>" alt="<?php $this->options->title() ?>"></a></li>
<?php else: ?>
<li>
<a href="<?php $this->options->siteUrl(); ?>" class="brand"><?php $this->options->title() ?></a>
</li>
<li class="desc"><?php $this->options->description() ?></li>
<?php endif; ?>
</ul>
<ul>
<li>
<label for="nav-toggler" class="nav-toggler-btn"><img src="<?php $this->options->themeUrl('static/img/menu.svg'); ?>" alt="Menu"></label>
</li>
</ul>
</nav>
<ul>
<li>
<label for="nav-toggler" class="nav-toggler-btn">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="3" y1="12" x2="21" y2="12" /><line x1="3" y1="6" x2="21" y2="6" /><line x1="3" y1="18" x2="21" y2="18" /></svg>
</label>
</li>
</ul>
</nav>
<nav class="site-nav">
<input type="checkbox" id="nav-toggler">
<nav class="site-nav">
<input type="checkbox" id="nav-toggler">
<ul class="nav-menu">
<li>
<a href="<?php $this->options->siteUrl(); ?>"<?php if ($this->is('index')): ?> class="active"<?php endif; ?>><?php _e('首页'); ?></a>
</li>
<ul class="nav-menu">
<li>
<a href="<?php $this->options->siteUrl(); ?>"<?php if ($this->is('index')): ?> class="active"<?php endif; ?>><?php _e('首页'); ?></a>
</li>
<?php \Widget\Contents\Page\Rows::alloc()->to($pages); ?>
<?php while ($pages->next()): ?>
<li>
<a href="<?php $pages->permalink(); ?>"<?php if ($this->is('page', $pages->slug)): ?> class="active"<?php endif; ?>><?php $pages->title(); ?></a>
</li>
<?php endwhile; ?>
<li>
<form method="post" action="<?php $this->options->siteUrl(); ?>">
<input type="search" id="s" name="s">
</form>
</li>
</ul>
</nav>
</div>
<?php \Widget\Contents\Page\Rows::alloc()->to($pages); ?>
<?php while ($pages->next()): ?>
<li>
<a href="<?php $pages->permalink(); ?>"<?php if ($this->is('page', $pages->slug)): ?> class="active"<?php endif; ?>><?php $pages->title(); ?></a>
</li>
<?php endwhile; ?>
<li>
<form method="post" action="<?php $this->options->siteUrl(); ?>">
<input type="search" id="s" name="s">
</form>
</li>
</ul>
</nav>
</header>

View File

@@ -14,35 +14,31 @@ $this->need('header.php');
<main class="container">
<div class="container-thin">
<?php if (!($this->is('index')) and !($this->is('post'))): ?>
<h4 class="text-center text-muted">
<?php if (!($this->is('index')) && !($this->is('post'))): ?>
<h6 class="text-center text-muted">
<?php $this->archiveTitle([
'category' => _t('分类 %s 下的文章'),
'search' => _t('包含关键字 %s 的文章'),
'tag' => _t('标签 %s 下的文章'),
'author' => _t('%s 发布的文章')
], '', ''); ?>
</h4>
</h6>
<?php endif; ?>
<?php while ($this->next()): ?>
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
<?php postMeta($this); ?>
<div class="entry-content fmt" itemprop="articleBody">
<?php $this->content(_t('阅读全文')); ?>
</div>
</article>
<hr class="post-separator">
<?php endwhile; ?>
<?php while ($this->next()): ?>
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
<?php postMeta($this); ?>
<div class="entry-content fmt" itemprop="articleBody">
<?php $this->content(_t('阅读全文')); ?>
</div>
</article>
<hr class="post-separator">
<?php endwhile; ?>
<nav><?php $this->pageNav(_t('前一页'), _t('后一页'), 2, '...', array('wrapTag' => 'ul', 'itemTag' => 'li')); ?></nav>
</div>
<!-- <div class="text-center">
<a href="#">&laquo; Older Posts</a>
<span class="mx-2 text-muted">&middot;</span>
<a href="#">Newer Posts &raquo;</a>
</div> -->
<?php $this->pageNav('← ' . _t('前一页'), _t('后一页') . ' →'); ?>
</main>
<?php $this->need('footer.php'); ?>

View File

@@ -12,14 +12,12 @@
</div>
</article>
<div class="grid post-next">
<div>
<?php $this->thePrev('%s', _t('没有了')); ?>
</div>
<div class="text-end">
<?php $this->theNext('%s', _t('没有了')); ?> →
</div>
</div>
<nav class="post-nav">
<ul class="page-navigator">
<li class="prev"><?php $this->thePrev('%s', _t('没有了')); ?></li>
<li class="next"><?php $this->theNext('%s', _t('没有了')); ?></li>
</ul>
</nav>
<?php $this->need('comments.php'); ?>
</div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -13,32 +13,29 @@
<div class="text-center">
<?php \Widget\Metas\Category\Rows::alloc()->listCategories('wrapClass=list-inline'); ?>
</div>
<?php while ($this->next()): ?>
<hr class="post-separator">
<?php if ($this->have()): ?>
<?php while ($this->next()): ?>
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
<header class="entry-header text-center">
<h1 class="entry-title" itemprop="name headline"><a href="<?php $this->permalink() ?>" itemprop="url"><?php $this->title() ?></a></h1>
<ul class="entry-meta list-inline text-muted">
<li><i data-feather="calendar" class="is-sm me-2"></i><time datetime="<?php $this->date('c'); ?>" itemprop="datePublished"><?php $this->date(); ?></time></li>
<li><i data-feather="folder" class="is-sm me-2"></i><?php $this->category(', '); ?></li>
<li><i data-feather="message-circle" class="is-sm me-2"></i><a href="<?php $this->permalink() ?>#comments" itemprop="discussionUrl"><?php $this->commentsNum('暂无评论', '1 条评论', '%d 条评论'); ?></a></li>
</ul>
</header>
<?php postMeta($this); ?>
<div class="entry-content fmt" itemprop="articleBody">
<?php $this->content('阅读剩余部分'); ?>
<?php $this->content('阅读全文'); ?>
</div>
</article>
<hr class="post-separator">
<?php endwhile; ?>
<?php endwhile; ?>
<?php else: ?>
<article class="post">
<div class="entry-content fmt text-center" itemprop="articleBody">
<p><?php _e('没有找到内容'); ?></p>
</div>
</article>
<?php endif; ?>
</div>
<!-- <div class="text-center">
<a href="#">&laquo; Older Posts</a>
<span class="mx-2 text-muted">&middot;</span>
<a href="#">Newer Posts &raquo;</a>
</div> -->
<?php $this->pageNav('&laquo; 前一页', '后一页 &raquo;'); ?>
</main>

File diff suppressed because one or more lines are too long

View File

@@ -1,15 +0,0 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="#fff"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<line x1="3" y1="12" x2="21" y2="12" />
<line x1="3" y1="6" x2="21" y2="6" />
<line x1="3" y1="18" x2="21" y2="18" />
</svg>

Before

Width:  |  Height:  |  Size: 324 B

View File

@@ -1,14 +0,0 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="#fff"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<circle cx="11" cy="11" r="8" />
<line x1="21" y1="21" x2="16.65" y2="16.65" />
</svg>

Before

Width:  |  Height:  |  Size: 284 B

View File

@@ -1,105 +0,0 @@
/*!
* Pico.css (https://picocss.com)
* Licensed under MIT
*/
// Config
// $enable-responsive-typography: false;
// Grey
$grey-50: #f8fafc;
$grey-100: #f1f5f9;
$grey-200: #e2e8f0;
$grey-300: #cbd5e1;
$grey-400: #94a3b8;
$grey-500: #64748b;
$grey-600: #475569;
$grey-700: #334155;
$grey-800: #1e293b;
$grey-900: #0f172a;
// Blue
$primary-50: #E9F2FC;
$primary-100: #D1E5FB;
$primary-200: #9BCCFD;
$primary-300: #51B4FF;
$primary-400: #029AE8;
$primary-500: #017FC0;
$primary-600: #02659A;
$primary-700: #014C75;
$primary-800: #033452;
$primary-900: #061E2F;
// Amber
$amber-50: #fffbeb;
$amber-100: #fef3c7;
$amber-200: #fde68a;
$amber-300: #fcd34d;
$amber-400: #fbbf24;
$amber-500: #f59e0b;
$amber-600: #d97706;
$amber-700: #b45309;
$amber-800: #92400e;
$amber-900: #78350f;
// Green
$green-50: #f0fdf4;
$green-100: #dcfce7;
$green-200: #bbf7d0;
$green-300: #86efac;
$green-400: #4ade80;
$green-500: #22c55e;
$green-600: #16a34a;
$green-700: #15803d;
$green-800: #166534;
$green-900: #14532d;
// Red
$red-50: #fef2f2;
$red-100: #fee2e2;
$red-200: #fecaca;
$red-300: #fca5a5;
$red-400: #f87171;
$red-500: #ef4444;
$red-600: #dc2626;
$red-700: #b91c1c;
$red-800: #991b1b;
$red-900: #7f1d1d;
@import "../../../../../tools/node_modules/@picocss/pico/scss/variables";
// Theming
@import "../../../../../tools/node_modules/@picocss/pico/scss/themes/default";
// Layout
@import "../../../../../tools/node_modules/@picocss/pico/scss/layout/document"; // html
@import "../../../../../tools/node_modules/@picocss/pico/scss/layout/sectioning"; // body, header, main, footer
@import "../../../../../tools/node_modules/@picocss/pico/scss/layout/container"; // .container, .container-fluid
@import "../../../../../tools/node_modules/@picocss/pico/scss/layout/section"; // section
@import "../../../../../tools/node_modules/@picocss/pico/scss/layout/grid"; // .grid
// @import "../../../../../tools/node_modules/@picocss/pico/scss/layout/scroller"; // figure
// Content
@import "../../../../../tools/node_modules/@picocss/pico/scss/content/typography"; // a, headings, p, ul, blockquote, ...
@import "../../../../../tools/node_modules/@picocss/pico/scss/content/embedded"; // audio, canvas, iframe, img, svg, video
@import "../../../../../tools/node_modules/@picocss/pico/scss/content/button"; // button, a[role=button], type=button, type=submit ...
@import "../../../../../tools/node_modules/@picocss/pico/scss/content/form"; // input, select, textarea, label, fieldset, legend
// @import "../../../../../tools/node_modules/@picocss/pico/scss/content/form-checkbox-radio"; // type=checkbox, type=radio, role=switch
@import "../../../../../tools/node_modules/@picocss/pico/scss/content/form-alt-input-types"; // type=color, type=date, type=file, type=search, ...
@import "../../../../../tools/node_modules/@picocss/pico/scss/content/table"; // table, tr, td, ...
@import "../../../../../tools/node_modules/@picocss/pico/scss/content/code"; // pre, code, ...
@import "../../../../../tools/node_modules/@picocss/pico/scss/content/miscs"; // hr, template, [hidden], dialog, canvas
// Components
// @import "../../../../../tools/node_modules/@picocss/pico/scss/components/accordion"; // details, summary
// @import "../../../../../tools/node_modules/@picocss/pico/scss/components/card"; // article
// @import "../../../../../tools/node_modules/@picocss/pico/scss/components/modal"; // dialog
@import "../../../../../tools/node_modules/@picocss/pico/scss/components/nav"; // nav
// @import "../../../../../tools/node_modules/@picocss/pico/scss/components/progress"; // progress
// @import "../../../../../tools/node_modules/@picocss/pico/scss/components/dropdown"; // dropdown
// Utilities
// @import "../../../../../tools/node_modules/@picocss/pico/scss/utilities/loading"; // aria-busy=true
// @import "../../../../../tools/node_modules/@picocss/pico/scss/utilities/tooltip"; // data-tooltip
@import "../../../../../tools/node_modules/@picocss/pico/scss/utilities/accessibility"; // -ms-touch-action, aria-*
@import "../../../../../tools/node_modules/@picocss/pico/scss/utilities/reduce-motion"; // prefers-reduced-motion

View File

@@ -1,39 +1,66 @@
@import "pico";
@use "../../../../../tools/node_modules/@picocss/pico/scss" with (
$modules: (
// Layout
"layout/landmarks": false,
"layout/section": false,
// Forms
"forms/checkbox-radio-switch": false,
"forms/input-color": false,
"forms/input-date": false,
"forms/input-file": false,
"forms/input-range": false,
// Components
"components/accordion": false,
"components/card": false,
"components/dropdown": false,
"components/group": false,
"components/loading": false,
"components/modal": false,
"components/progress": false,
"components/tooltip": false,
)
);
// Global Set
:root {
--border-radius: 0.5rem;
--pico-border-radius: .5rem;
}
body {
cursor: auto;
margin: 0;
}
:not(.fmt a) {
text-decoration: none;
}
// button[type=submit],
// input[type=submit] {
// display: inline-block;
// width: auto !important;
// }
// Theme
[data-theme="light"],
:root:not([data-theme="dark"]) {
--primary: #{$primary-500};
--primary-hover: #{$primary-600};
--muted-border-color: #{$grey-200};
--pico-icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(50, 60, 68)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E")
}
[data-theme="dark"] {
--primary: #{$primary-500};
--primary-hover: #{$primary-400};
--muted-border-color: #{$grey-800};
.site-navbar {
background-color: #{$primary-600};
@media only screen and (prefers-color-scheme: dark) {
:root:not([data-theme]) {
--pico-icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(194, 199, 208)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E")
}
}
[data-theme="dark"] {
--pico-icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(194, 199, 208)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E")
}
// Content
h1, h2, h3, h4, h5 { line-height: 1.25; }
// h1 { --font-size: 2.5rem; }
// h2 { --font-size: 2rem; }
// h3 { --font-size: 1.75rem; }
// h4 { --font-size: 1.5rem; }
// h5 { --font-size: 1.25rem; }
h1, h2, h3, h4, h5 { line-height: 1.2; }
// Icon Size
.is-sm {
@@ -44,11 +71,11 @@ h1, h2, h3, h4, h5 { line-height: 1.25; }
// Utilities
.text-muted,
.text-muted a {
color: var(--muted-color);
color: var(--pico-secondary);
}
.text-muted a:hover {
color: var(--secondary-hover);
color: var(--pico-secondary-hover);
}
.text-center {
@@ -60,16 +87,16 @@ h1, h2, h3, h4, h5 { line-height: 1.25; }
}
.ms-2 {
margin-left: calc(var(--spacing) / 2);
margin-left: .5rem;
}
.me-2 {
margin-right: calc(var(--spacing) / 2);
margin-right: .5rem;
}
.mx-2 {
margin-left: calc(var(--spacing) / 2);
margin-right: calc(var(--spacing) / 2);
margin-left: .5rem;
margin-right: .5rem;
}
.list-inline {
@@ -81,29 +108,23 @@ h1, h2, h3, h4, h5 { line-height: 1.25; }
display: inline-block;
margin-bottom: 0;
&:not(:last-child) { margin-right: var(--spacing); }
&:not(:last-child) { margin-right: 1rem; }
}
svg { vertical-align: text-bottom; }
}
// Layout
.container-inner {
margin-left: auto;
margin-right: auto;
max-width: 84rem;
@if map-get($breakpoints, "lg") {
@media (min-width: map-get($breakpoints, "lg")) {
padding-left: calc(var(--spacing) * 1.5);
padding-right: calc(var(--spacing) * 1.5);
}
}
main.container {
padding-top: 4rem;
padding-bottom: 4rem;
}
.container-thin {
margin: 0 auto;
max-width: 46rem;
margin-left: auto;
margin-right: auto;
max-width: 40rem;
}
.d-flex {
@@ -128,13 +149,12 @@ h1, h2, h3, h4, h5 { line-height: 1.25; }
// Header & Navbar
.site-navbar {
padding-top: calc(var(--spacing) / 2);
padding-bottom: calc(var(--spacing) / 2);
background-color: var(--primary);
a {
color: rgba(255, 255, 255, 1.0);
// &:hover { text-decoration: underline; }
color: inherit;
&:focus {
background-color: var(--pico-text-selection-color);
}
}
.site-name {
@@ -144,16 +164,18 @@ h1, h2, h3, h4, h5 { line-height: 1.25; }
.brand {
font-size: 1.25rem;
font-weight: 700;
img {
max-height: 2rem;
}
}
.desc {
color: rgba(255, 255, 255, .75);
color: var(--pico-secondary);
display: none;
@if map-get($breakpoints, "sm") {
@media (min-width: map-get($breakpoints, "sm")) {
@media (min-width: 576px) {
display: inline-block;
}
}
}
}
@@ -169,18 +191,17 @@ h1, h2, h3, h4, h5 { line-height: 1.25; }
}
}
.nav-toggler-btn {
cursor: pointer;
}
// Dropdown Menu
.nav-menu {
display: none;
li {
display: block;
padding: calc(var(--spacing) * .5);
}
a {
margin: calc(var(--spacing) * -.5);
padding: calc(var(--spacing) * .5);
padding: .5rem;
}
form {
@@ -188,13 +209,7 @@ h1, h2, h3, h4, h5 { line-height: 1.25; }
input[type=search] {
height: 50px;
background-image: url("../img/search.svg");
background-size: auto;
color: rgb(255,255,255);
&:focus {
--form-element-focus-color: rgba(255,255,255,0.5);
}
&:not(:focus) {
padding: 0;
@@ -202,44 +217,38 @@ h1, h2, h3, h4, h5 { line-height: 1.25; }
width: 30px;
padding-inline-start: 0;
background-position: center center;
background-color: inherit;
color: transparent;
cursor: pointer;
}
}
}
}
.nav-toggler-btn {
margin: calc(var(--spacing) * -1) calc(var(--spacing) * -0.5);
padding: var(--spacing) calc(var(--spacing) * 0.5);
color: rgba(255, 255, 255, 1.0);
cursor: pointer;
}
@if map-get($breakpoints, "lg") {
@media (min-width: map-get($breakpoints, "lg")) {
.site-navbar .container-inner,
.site-nav { display: flex; }
.site-navbar .container-inner nav:first-child { flex-grow: 1; }
.nav-toggler-btn { display: none; }
.nav-menu {
display: flex !important;
li:not(:last-child) { margin-right: calc(var(--spacing) / 2); }
}
@media (min-width: 1024px) {
.site-navbar,
.site-nav { display: flex; }
.site-navbar nav:first-child { flex-grow: 1; }
.nav-toggler-btn { display: none; }
.nav-menu {
display: flex !important;
li:not(:last-child) { margin-right: .5rem; }
}
}
// Posts
.post-separator {
margin: var(--block-spacing-vertical) 0;
margin: 4rem 0;
}
.entry-header {
margin-bottom: calc(var(--spacing) * 2);
margin-bottom: 2rem;
}
.entry-title {
margin-bottom: var(--spacing);
margin-bottom: 1rem;
a { color: var(--h1-color); }
a { color: var(--pico-h2-color); }
}
.entry-meta {
@@ -273,87 +282,96 @@ h1, h2, h3, h4, h5 { line-height: 1.25; }
display: inline-block;
font-size: .875rem;
padding: 6px 16px;
border: 1px solid var(--muted-border-color);
color: var(--muted-color);
border: 1px solid var(--pico-muted-border-color);
color: var(--pico-muted-color);
border-radius: 100px;
text-decoration: none;
&:focus {
background-color: var(--pico-text-selection-color);
}
}
}
.post-next {
border-top: 1px solid var(--muted-border-color);
padding: calc(var(--spacing) * 1.5) 0;
margin: var(--block-spacing-vertical) 0;
.post-nav {
border-top: 1px solid var(--pico-muted-border-color);
margin: 4rem 0;
a {
color: var(--h5-color);
color: inherit;
}
}
// Format
.fmt {
line-height: 1.6;
pre, hr {
margin-bottom: var(--typography-spacing-vertical);
}
}
// Footer
.site-footer {
padding-bottom: calc(var(--block-spacing-vertical) / 2);
padding-bottom: 1rem;
}
// Comments
.comment-list {
list-style: none;
padding-left: calc(var(--spacing) * 4);
padding: 0;
}
.comment-body {
margin: calc(var(--spacing) * 1.5) 0;
margin: 1rem 0;
padding: 1rem;
border: 1px solid var(--pico-muted-border-color);
border-radius: var(--pico-border-radius);
}
.comment-by-author > .comment-author::after {
content: "OP";
margin-left: .25rem;
color: var(--muted-color);
padding: 0 .375rem;
border: 1px solid var(--muted-color);
color: var(--pico-muted-color);
padding: 1px .375rem;
border: 1px solid var(--pico-muted-color);
font-size: .75rem;
border-radius: var(--border-radius);
border-radius: 2rem;
}
.comment-author {
position: relative;
display: inline-block;
.avatar {
position: absolute;
width: calc(var(--spacing) * 3);
left: calc(var(--spacing) * -4);
border-radius: var(--border-radius);
margin-right: .25rem;
width: 2rem;
border-radius: 48px;
}
cite {
cite,
cite a {
font-style: normal;
font-weight: 700;
}
a {
color: var(--h5-color);
color: var(--pico-h2-color);
}
}
.comment-meta a,
.comment-reply a {
font-size: .875em;
color: var(--muted-color);
color: var(--pico-secondary);
&:hover { color: var(--secondary-hover); }
&:hover { color: var(--pico-secondary-hover); }
}
.comment-meta {
margin-bottom: calc(var(--spacing) / 2);
display: inline-block;
color: var(--pico-muted-color);
margin-left: .25rem;
&::before {
content: "·";
margin-right: .25rem;
}
}
.comment-content {
margin-top: 1rem;
}
.comment-reply:blank {
@@ -361,26 +379,29 @@ h1, h2, h3, h4, h5 { line-height: 1.25; }
}
.comment-awaiting-moderation {
margin-left: calc(var(--spacing) / 2);
margin-left: .5rem;
font-size: .875em;
color: var(--del-color);
color: var(--pico-del-color);
}
.comment-children {
margin: calc(var(--spacing) * 1.5) 0;
margin-bottom: -1rem;
}
#response {
margin-bottom: var(--spacing);
margin-bottom: 1rem;
}
#cancel-comment-reply-link {
font-size: .875em;
color: var(--del-color);
}
.comment-body .respond {
margin-top: var(--spacing);
.respond {
margin-top: 1.5rem;
.comment-body & {
margin-top: 1rem;
}
}
#comment-form textarea {
@@ -389,18 +410,32 @@ h1, h2, h3, h4, h5 { line-height: 1.25; }
// page nav
.page-navigator {
list-style: none;
padding: 0;
text-align: center;
margin: 0;
flex: 1;
li {
display: inline;
margin-left: calc(var(--spacing) / 2);
margin-right: calc(var(--spacing) / 2);
&.current a {
font-weight: 700;
color: var(--h5-color);
.current a {
text-decoration: underline;
color: inherit;
pointer-events: none;
}
a:focus {
background-color: var(--pico-text-selection-color);
}
.prev {
margin-right: auto;
a::before {
content: "";
margin-right: .25rem;
}
}
}
.next {
margin-left: auto;
text-align: right;
a::after {
content: "";
margin-left: .25rem;
}
}
}

View File

@@ -0,0 +1,30 @@
/*!
* This is an example of a color scheme
* You can define your color scheme below
*/
[data-theme="customize"] {
--pico-primary: #017FC0 !important;
--pico-primary-hover: #02659A !important;
--pico-background-color: #fffbeb !important;
--pico-muted-border-color: rgba(0, 0, 0, .1) !important;
--pico-form-element-border-color: rgba(0, 0, 0, .2) !important;
--pico-code-background-color: rgba(0, 0, 0, .05) !important;
}
.site-navbar {
background-color: var(--pico-primary);
}
.site-navbar a,
.site-navbar .nav-toggler-btn {
color: var(--pico-primary-inverse);
}
.site-navbar .desc {
color: rgba(255, 255, 255, .5);
}
.site-navbar input[type="search"]:not(:focus) {
--pico-icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
}

View File

@@ -54,7 +54,7 @@ function postMeta(
<?php if ($metaType == 'archive'): ?>
<li itemprop="interactionCount">
<a itemprop="discussionUrl"
href="<?php $archive->permalink() ?>#comments"><?php $archive->commentsNum('评论', '1 条评论', '%d 条评论'); ?></a>
href="<?php $archive->permalink() ?>#comments"><?php $archive->commentsNum(_t('暂无评论'), _t('1 条评论'), _t('%d 条评论')); ?></a>
</li>
<?php endif; ?>
</ul>

View File

@@ -13,7 +13,7 @@ $this->need('header.php');
?>
<div class="col-mb-12 col-8" id="main" role="main">
<?php if (!($this->is('index')) and !($this->is('post'))): ?>
<?php if (!($this->is('index')) && !($this->is('post'))): ?>
<h3 class="archive-title"><?php $this->archiveTitle([
'category' => _t('分类 %s 下的文章'),
'search' => _t('包含关键字 %s 的文章'),

View File

@@ -36,6 +36,7 @@ pre {
max-height: 400px;
}
pre code {
display: block;
padding: 3px;
color: #444;
}

View File

@@ -9,17 +9,19 @@ namespace IXR;
*/
class Date
{
private int $year;
private string $year;
private int $month;
private string $month;
private int $day;
private string $day;
private int $hour;
private string $hour;
private int $minute;
private string $minute;
private int $second;
private string $second;
private string $timezone;
/**
* @param int|string $time
@@ -39,12 +41,13 @@ class Date
*/
private function parseTimestamp(int $timestamp)
{
$this->year = intval(date('Y', $timestamp));
$this->month = intval(date('m', $timestamp));
$this->day = intval(date('d', $timestamp));
$this->hour = intval(date('H', $timestamp));
$this->minute = intval(date('i', $timestamp));
$this->second = intval(date('s', $timestamp));
$this->year = gmdate('Y', $timestamp);
$this->month = gmdate('m', $timestamp);
$this->day = gmdate('d', $timestamp);
$this->hour = gmdate('H', $timestamp);
$this->minute = gmdate('i', $timestamp);
$this->second = gmdate('s', $timestamp);
$this->timezone = '';
}
/**
@@ -58,6 +61,7 @@ class Date
$this->hour = substr($iso, 9, 2);
$this->minute = substr($iso, 12, 2);
$this->second = substr($iso, 15, 2);
$this->timezone = substr($iso, 17);
}
/**
@@ -65,7 +69,7 @@ class Date
*/
public function getIso(): string
{
return $this->year . $this->month . $this->day . 'T' . $this->hour . ':' . $this->minute . ':' . $this->second;
return $this->year . $this->month . $this->day . 'T' . $this->hour . ':' . $this->minute . ':' . $this->second . $this->timezone;
}
/**

View File

@@ -29,9 +29,9 @@ class Error
* 构造函数
*
* @param integer $code 错误代码
* @param string|null $message 错误消息
* @param string $message 错误消息
*/
public function __construct(int $code, ?string $message)
public function __construct(int $code, string $message)
{
$this->code = $code;
$this->message = $message;

View File

@@ -40,7 +40,7 @@ class Message
private array $currentStructName = []; // A stack as well
private string $currentTagContents;
private string $currentTagContents = '';
/**
* @param string $message
@@ -60,6 +60,25 @@ class Message
if (trim($this->message) == '') {
return false;
}
// remove the DOCTYPE, avoid using a regexp, so we can save memory
$count = 0;
while (true) {
// Fail if there is an endless loop
if ($count >= 10) {
return false;
}
$pos = strpos($this->message, '<!DOCTYPE');
if ($pos !== false) {
$this->message = substr($this->message, 0, $pos)
. substr($this->message, strpos($this->message, '>', $pos) + 1);
$count ++;
} else {
break;
}
}
$parser = xml_parser_create();
// Set XML parser to take the case of tags in to account
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, false);

View File

@@ -17,7 +17,7 @@ class Value
* @param mixed $data
* @param string|null $type
*/
public function __construct($data, ?string $type)
public function __construct($data, ?string $type = null)
{
$this->data = $data;
if (!$type) {

View File

@@ -236,6 +236,8 @@ namespace Typecho {
} elseif ($exception instanceof \Typecho\Db\Adapter\SQLException) {
$message = 'Database Query Error';
}
} elseif ($exception instanceof \Typecho\Widget\Exception) {
$message = $exception->getMessage();
} else {
$message = 'Server Error';
}
@@ -493,12 +495,12 @@ EOF;
* @access public
*
* @param string|null $str 需要生成缩略名的字符串
* @param string|null $default 默认的缩略名
* @param string $default 默认的缩略名
* @param integer $maxLength 缩略名最大长度
*
* @return string
*/
public static function slugName(?string $str, ?string $default = null, int $maxLength = 128): ?string
public static function slugName(?string $str, string $default = '', int $maxLength = 128): string
{
$str = trim($str ?? '');
@@ -677,6 +679,18 @@ EOF;
return $length < $iLength ? ($str . $trim) : $str;
}
/**
* 判断两个字符串是否为空并依次返回
*
* @param string|null $a
* @param string|null $b
* @return string|null
*/
public static function strBy(?string $a, ?string $b = null): ?string
{
return isset($a) && $a !== '' ? $a : $b;
}
/**
* 获取宽字符串长度函数
*

View File

@@ -5,6 +5,7 @@ namespace Typecho\Db\Adapter;
use Typecho\Config;
use Typecho\Db;
use Typecho\Db\Adapter;
use mysqli_sql_exception;
if (!defined('__TYPECHO_ROOT_DIR__')) {
exit;
@@ -49,26 +50,40 @@ class Mysqli implements Adapter
{
$mysqli = mysqli_init();
if ($mysqli) {
if (!empty($config->sslCa)) {
$mysqli->ssl_set(null, null, $config->sslCa, null, null);
try {
if (!empty($config->sslCa)) {
$mysqli->ssl_set(null, null, $config->sslCa, null, null);
if (isset($config->sslVerify)) {
$mysqli->options(MYSQLI_OPT_SSL_VERIFY_SERVER_CERT, $config->sslVerify);
if (isset($config->sslVerify)) {
$mysqli->options(MYSQLI_OPT_SSL_VERIFY_SERVER_CERT, $config->sslVerify);
}
}
}
$mysqli->real_connect(
$config->host,
$config->user,
$config->password,
$config->database,
(empty($config->port) ? null : $config->port)
);
$host = $config->host;
$port = empty($config->port) ? null : $config->port;
$socket = null;
if (strpos($host, '/') !== false) {
$socket = $host;
$host = 'localhost';
$port = null;
}
$this->dbLink = $mysqli;
$mysqli->real_connect(
$host,
$config->user,
$config->password,
$config->database,
$port,
$socket
);
if ($config->charset) {
$this->dbLink->query("SET NAMES '{$config->charset}'");
$this->dbLink = $mysqli;
if ($config->charset) {
$this->dbLink->query("SET NAMES '{$config->charset}'");
}
} catch (mysqli_sql_exception $e) {
throw new ConnectionException($e->getMessage(), $e->getCode());
}
return $this->dbLink;
@@ -106,8 +121,13 @@ class Mysqli implements Adapter
?string $action = null,
?string $table = null
) {
if ($resource = @$this->dbLink->query($query)) {
return $resource;
try {
if ($resource = $this->dbLink->query($query)) {
return $resource;
}
} catch (mysqli_sql_exception $e) {
/** 数据库异常 */
throw new SQLException($e->getMessage(), $e->getCode());
}
/** 数据库异常 */

View File

@@ -61,14 +61,26 @@ class Mysql extends Pdo
}
}
$dsn = !empty($config->dsn)
? $config->dsn
: (strpos($config->host, '/') !== false
? "mysql:dbname={$config->database};unix_socket={$config->host}"
: "mysql:dbname={$config->database};host={$config->host};port={$config->port}");
$pdo = new \PDO(
!empty($config->dsn)
? $config->dsn : "mysql:dbname={$config->database};host={$config->host};port={$config->port}",
$dsn,
$config->user,
$config->password,
$options
);
$pdo->setAttribute(\PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
if (class_exists('\Pdo\Mysql')) {
// 新版本写法
$pdo->setAttribute(\Pdo\Mysql::ATTR_USE_BUFFERED_QUERY, true);
} else {
// 兼容旧版本
$pdo->setAttribute(\PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
}
if ($config->charset) {
$pdo->exec("SET NAMES '{$config->charset}'");

View File

@@ -119,7 +119,7 @@ class Pgsql implements Adapter
/**
* @param resource $resource
* @return array|null
* @return array
*/
public function fetchAll($resource): array
{
@@ -146,6 +146,6 @@ class Pgsql implements Adapter
*/
public function quoteValue($string): string
{
return '\'' . pg_escape_string($string) . '\'';
return '\'' . str_replace('\'', '\'\'', $string) . '\'';
}
}

Some files were not shown because too many files have changed in this diff Show More