1 parent
1a4fd54b68
commit
2542f6dcb6
4 files changed
+88
-5
No files matched your search
@@ -281,9 +281,56 @@ onMounted(() => {
|
||||
<template v-else-if="mode === 'read'">
|
||||
<div class="flex flex-wrap items-baseline justify-between gap-2 border-b border-solid border-surface-5 pb-2">
|
||||
<h1 class="m-0 text-2xl font-bold text-contrast">{{ page.title }}</h1>
|
||||
<span class="text-[11px] text-secondary">
|
||||
{{ formatMessage(messages.revision, { id: page.revisionId }) }}
|
||||
</span>
|
||||
<div class="flex flex-wrap items-center gap-1.5">
|
||||
<span class="text-[11px] text-secondary">
|
||||
{{ formatMessage(messages.revision, { id: page.revisionId }) }}
|
||||
</span>
|
||||
<button
|
||||
type="button"
|
||||
class="rounded-lg px-2.5 py-1 text-xs font-semibold disabled:opacity-50"
|
||||
:class="watching ? 'bg-brand text-contrast' : 'bg-button-bg text-secondary'"
|
||||
:disabled="watchBusy"
|
||||
@click="toggleWatch"
|
||||
>
|
||||
{{ formatMessage(watching ? messages.unwatch : messages.watch) }}
|
||||
</button>
|
||||
<button
|
||||
v-if="page.canEdit"
|
||||
type="button"
|
||||
class="rounded-lg bg-button-bg px-2.5 py-1 text-xs font-semibold text-secondary hover:brightness-110"
|
||||
@click="openMove"
|
||||
>
|
||||
{{ formatMessage(messages.move) }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="moving"
|
||||
class="flex flex-wrap items-center gap-2 rounded-lg border border-solid border-surface-5 bg-bg-raised p-2"
|
||||
>
|
||||
<input
|
||||
v-model="moveTarget"
|
||||
type="text"
|
||||
:placeholder="formatMessage(messages.moveTarget)"
|
||||
class="min-w-0 flex-1 rounded-lg border border-solid border-surface-5 bg-bg px-2 py-1 text-xs text-contrast outline-none focus:border-brand"
|
||||
@keyup.enter="confirmMove"
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
class="rounded-lg bg-brand px-2.5 py-1 text-xs font-semibold text-contrast disabled:opacity-50"
|
||||
:disabled="moveBusy"
|
||||
@click="confirmMove"
|
||||
>
|
||||
{{ formatMessage(messages.moveConfirm) }}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="rounded-lg bg-button-bg px-2.5 py-1 text-xs font-semibold text-secondary"
|
||||
@click="moving = false"
|
||||
>
|
||||
{{ formatMessage(messages.cancel) }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<p class="m-0 text-[11px] text-secondary">
|
||||
|
||||
@@ -2682,3 +2682,25 @@ export function skinSiteWikiCategory(
|
||||
if (before != null) query.set('before', String(before))
|
||||
return skinSiteRequest<SkinSiteWikiSearchPage>('wiki/category?' + query.toString())
|
||||
}
|
||||
// ─── Wiki: 移动 / 关注 / 设首页 ─────────────────────────────────────────
|
||||
|
||||
export function skinSiteWikiMove(data: {
|
||||
title: string
|
||||
targetTitle: string
|
||||
leaveRedirect?: boolean
|
||||
}): Promise<SkinSiteResponse<SkinSiteWikiPageDetail>> {
|
||||
return skinSiteRequest<SkinSiteWikiPageDetail>('wiki/move', {
|
||||
method: 'POST',
|
||||
body: data,
|
||||
})
|
||||
}
|
||||
|
||||
export function skinSiteWikiWatch(
|
||||
title: string,
|
||||
watched: boolean,
|
||||
): Promise<SkinSiteResponse<boolean>> {
|
||||
return skinSiteRequest<boolean>('wiki/watch', {
|
||||
method: 'POST',
|
||||
body: { title, watched },
|
||||
})
|
||||
}
|
||||
@@ -12458,5 +12458,12 @@
|
||||
"app.skin-site.wiki.browser.empty-list": {"message": "Nothing here yet."},
|
||||
"app.skin-site.wiki.browser.hint-search": {"message": "Type a keyword to search."},
|
||||
"app.skin-site.wiki.browser.hint-category": {"message": "Enter a category name to browse."},
|
||||
"app.skin-site.wiki.browser.by-author": {"message": "by {author}"}
|
||||
"app.skin-site.wiki.browser.by-author": {"message": "by {author}"},
|
||||
"app.skin-site.wiki.watch": {"message": "Watch"},
|
||||
"app.skin-site.wiki.unwatch": {"message": "Unwatch"},
|
||||
"app.skin-site.wiki.watch-done": {"message": "Watch state updated."},
|
||||
"app.skin-site.wiki.move": {"message": "Move"},
|
||||
"app.skin-site.wiki.move-target": {"message": "New title"},
|
||||
"app.skin-site.wiki.move-confirm": {"message": "Confirm move"},
|
||||
"app.skin-site.wiki.move-done": {"message": "Page moved to {title}."}
|
||||
}
|
||||
@@ -12289,5 +12289,12 @@
|
||||
"app.skin-site.wiki.browser.empty-list": {"message": "这里还没有内容。"},
|
||||
"app.skin-site.wiki.browser.hint-search": {"message": "输入关键词开始搜索。"},
|
||||
"app.skin-site.wiki.browser.hint-category": {"message": "输入分类名称开始浏览。"},
|
||||
"app.skin-site.wiki.browser.by-author": {"message": "由 {author} 编辑"}
|
||||
"app.skin-site.wiki.browser.by-author": {"message": "由 {author} 编辑"},
|
||||
"app.skin-site.wiki.watch": {"message": "关注"},
|
||||
"app.skin-site.wiki.unwatch": {"message": "取消关注"},
|
||||
"app.skin-site.wiki.watch-done": {"message": "关注状态已更新。"},
|
||||
"app.skin-site.wiki.move": {"message": "移动"},
|
||||
"app.skin-site.wiki.move-target": {"message": "新标题"},
|
||||
"app.skin-site.wiki.move-confirm": {"message": "确认移动"},
|
||||
"app.skin-site.wiki.move-done": {"message": "页面已移动到 {title}。"}
|
||||
}
|
||||
Reference in new issue
Block a user