同步插件源代码并补齐标准项目文件
This commit is contained in:
716
assets/admin.css
Normal file
716
assets/admin.css
Normal file
File diff suppressed because it is too large
Load Diff
1137
assets/admin.js
Normal file
1137
assets/admin.js
Normal file
File diff suppressed because it is too large
Load Diff
185
assets/card.css
Normal file
185
assets/card.css
Normal file
@@ -0,0 +1,185 @@
|
||||
/*
|
||||
* NiceQuote 2.5 卡片样式
|
||||
*
|
||||
* 三种使用场景共用一份:
|
||||
* 1. 内嵌模式(inline):卡片直接写在正文里,字号、字体、行高全部继承站点主题;
|
||||
* 2. iframe 模式:body.nq-standalone 下的独立文档,需要自带字体与配色;
|
||||
* 3. 后台预览:同样走 iframe。
|
||||
*
|
||||
* 卡片均为「标题 + 摘要 + 日期」三行结构,不显示左侧缩略图。
|
||||
*
|
||||
* 所有类名都以 nq- 开头,不会和主题的 .quote / .card 撞车。
|
||||
*/
|
||||
.nq-card {
|
||||
--nq-bg: rgba(127, 127, 127, .07);
|
||||
--nq-line: rgba(127, 127, 127, .26);
|
||||
--nq-thumb: rgba(127, 127, 127, .14);
|
||||
--nq-muted: rgba(127, 127, 127, .95);
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
box-sizing: border-box;
|
||||
margin: 1.1em 0;
|
||||
padding: 12px 14px;
|
||||
border: 1px solid var(--nq-line);
|
||||
border-radius: var(--nq-radius, 10px);
|
||||
background: var(--nq-bg);
|
||||
color: inherit;
|
||||
font-size: inherit;
|
||||
line-height: 1.5;
|
||||
text-decoration: none;
|
||||
transition: border-color .18s ease, background .18s ease;
|
||||
}
|
||||
.nq-card:hover,
|
||||
.nq-card:focus-visible {
|
||||
border-color: var(--nq-accent, #c0580c);
|
||||
outline: none;
|
||||
}
|
||||
/* 外部链接卡片没有缩略图,回到单列三行 */
|
||||
.nq-card.nq-url {
|
||||
display: block;
|
||||
}
|
||||
/* 用户引用靠左:主题常给引用块设 text-align 居中,这里强制回左对齐 */
|
||||
.nq-card.nq-user {
|
||||
text-align: left;
|
||||
}
|
||||
.nq-body {
|
||||
flex: 1 1 auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 3px;
|
||||
min-width: 0;
|
||||
}
|
||||
.nq-url .nq-body {
|
||||
gap: 4px;
|
||||
}
|
||||
.nq-title {
|
||||
display: block;
|
||||
color: var(--nq-accent, #c0580c);
|
||||
font-weight: 500;
|
||||
overflow: hidden;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 1;
|
||||
line-clamp: 1;
|
||||
word-break: break-word;
|
||||
}
|
||||
/* 外部链接没有缩略图占位,标题给两行 */
|
||||
.nq-url .nq-title {
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
}
|
||||
.nq-desc {
|
||||
display: -webkit-box;
|
||||
overflow: hidden;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
font-size: .92em;
|
||||
opacity: .82;
|
||||
word-break: break-word;
|
||||
}
|
||||
.nq-meta {
|
||||
overflow: hidden;
|
||||
color: var(--nq-muted);
|
||||
font-size: .8em;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.nq-missing {
|
||||
display: inline-block;
|
||||
padding: 2px 8px;
|
||||
border: 1px dashed var(--nq-line, rgba(127, 127, 127, .4));
|
||||
border-radius: 6px;
|
||||
opacity: .7;
|
||||
font-size: .9em;
|
||||
}
|
||||
/* ---------- 连续多张引用:并作一条纵向列表 ---------- */
|
||||
/* 不加序号、不加「引用 N 篇」标题,只留卡片之间的间距 */
|
||||
.nq-list {
|
||||
--nq-line: rgba(127, 127, 127, .26);
|
||||
--nq-muted: rgba(127, 127, 127, .95);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
margin: 1.2em 0;
|
||||
padding: 0;
|
||||
font-size: inherit;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.nq-list .nq-card {
|
||||
margin: 0;
|
||||
}
|
||||
.nq-list .nq-frame {
|
||||
margin: 0;
|
||||
}
|
||||
/* 明确指定配色时,卡片自己扛起背景与文字色 */
|
||||
.nq-card.nq-skin-dark {
|
||||
--nq-bg: rgba(24, 24, 24, .92);
|
||||
--nq-line: rgba(255, 255, 255, .16);
|
||||
--nq-thumb: rgba(255, 255, 255, .1);
|
||||
--nq-muted: rgba(255, 255, 255, .62);
|
||||
color: #e4e4e4;
|
||||
}
|
||||
.nq-card.nq-skin-light {
|
||||
--nq-bg: rgba(255, 255, 255, .94);
|
||||
--nq-line: rgba(0, 0, 0, .12);
|
||||
--nq-thumb: rgba(0, 0, 0, .06);
|
||||
--nq-muted: rgba(0, 0, 0, .55);
|
||||
color: #333;
|
||||
}
|
||||
/* iframe 独立文档 */
|
||||
body.nq-standalone {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
background: transparent;
|
||||
color: #333;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
|
||||
"Hiragino Sans GB", "Microsoft YaHei", sans-serif;
|
||||
font-size: 15px;
|
||||
line-height: 1.5;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
body.nq-standalone .nq-card {
|
||||
margin: 0;
|
||||
}
|
||||
body.nq-standalone[data-skin="auto"] {
|
||||
--nq-bg: #fff;
|
||||
--nq-line: rgba(0, 0, 0, .12);
|
||||
--nq-thumb: rgba(0, 0, 0, .06);
|
||||
--nq-muted: rgba(0, 0, 0, .55);
|
||||
background: #fff;
|
||||
}
|
||||
body.nq-standalone[data-skin="dark"] {
|
||||
--nq-bg: #191919;
|
||||
--nq-line: rgba(255, 255, 255, .16);
|
||||
--nq-thumb: rgba(255, 255, 255, .1);
|
||||
--nq-muted: rgba(255, 255, 255, .62);
|
||||
background: #191919;
|
||||
color: #e4e4e4;
|
||||
}
|
||||
body.nq-standalone[data-skin="light"] {
|
||||
--nq-bg: #fff;
|
||||
--nq-line: rgba(0, 0, 0, .12);
|
||||
--nq-muted: rgba(0, 0, 0, .55);
|
||||
background: #fff;
|
||||
color: #333;
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
body.nq-standalone[data-skin="auto"] {
|
||||
--nq-bg: #191919;
|
||||
--nq-line: rgba(255, 255, 255, .16);
|
||||
--nq-thumb: rgba(255, 255, 255, .1);
|
||||
--nq-muted: rgba(255, 255, 255, .62);
|
||||
background: #191919;
|
||||
color: #e4e4e4;
|
||||
}
|
||||
}
|
||||
@media (max-width: 480px) {
|
||||
.nq-card {
|
||||
gap: 10px;
|
||||
padding: 10px 12px;
|
||||
}
|
||||
}
|
||||
598
assets/manage.css
Normal file
598
assets/manage.css
Normal file
File diff suppressed because it is too large
Load Diff
77
assets/manage.js
Normal file
77
assets/manage.js
Normal file
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* NiceQuote 后台「引用管理」
|
||||
*
|
||||
* 只做两件事:危险操作二次确认、深色模式跟随。
|
||||
* 其余(筛选、分页、修改、删除)都是普通链接 / 表单 + 302,不依赖脚本。
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
/* ---------- 深色跟随 ----------
|
||||
* NewAdmin 的 .dark 加在 #newadmin 上,而面板页的内容不在它的子树里,
|
||||
* 光靠 CSS 祖先选择器吃不到,这里读一次类名把 .nq-dark 补到 .nq-adm 上。 */
|
||||
(function () {
|
||||
var root = document.querySelector('.nq-adm');
|
||||
|
||||
if (!root) {
|
||||
return;
|
||||
}
|
||||
|
||||
function isDark() {
|
||||
var admin = document.getElementById('newadmin');
|
||||
|
||||
if (admin && /(^|\s)dark(\s|$)/.test(admin.className)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (document.documentElement.classList.contains('dark')
|
||||
|| document.body.classList.contains('dark')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (admin) {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
return window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function sync() {
|
||||
root.classList.toggle('nq-dark', isDark());
|
||||
}
|
||||
|
||||
sync();
|
||||
|
||||
var admin = document.getElementById('newadmin');
|
||||
|
||||
if (admin && window.MutationObserver) {
|
||||
new MutationObserver(sync).observe(admin, { attributes: true, attributeFilter: ['class'] });
|
||||
}
|
||||
|
||||
try {
|
||||
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', sync);
|
||||
} catch (e) {
|
||||
// 老浏览器没有 addEventListener,忽略
|
||||
}
|
||||
})();
|
||||
|
||||
/* ---------- 危险操作二次确认 ---------- */
|
||||
|
||||
document.addEventListener('submit', function (event) {
|
||||
var form = event.target;
|
||||
|
||||
if (!form || form.tagName !== 'FORM') {
|
||||
return;
|
||||
}
|
||||
|
||||
var message = form.getAttribute('data-confirm');
|
||||
|
||||
if (message && !window.confirm(message)) {
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
})();
|
||||
Reference in New Issue
Block a user