update: prefs

This commit is contained in:
windingwind 2024-04-07 23:17:33 +08:00
parent 2fe1d0453d
commit 65cdddf792
17 changed files with 93 additions and 53 deletions

View File

@ -6,35 +6,43 @@
onload="Zotero.__addonInstance__.hooks.onPrefsEvent('load', {window})"
>
<groupbox>
<label><html:h2 data-l10n-id="workspace-title"></html:h2></label>
<hbox>
<label><html:h2 data-l10n-id="basic-title"></html:h2></label>
<checkbox
data-l10n-id="basic-openNote-takeover"
native="true"
preference="__prefsPrefix__.openNote.takeover"
/>
<checkbox
data-l10n-id="basic-related-takeover"
native="true"
preference="__prefsPrefix__.related.takeover"
/>
</groupbox>
<groupbox>
<label><html:h2 data-l10n-id="editor-title"></html:h2></label>
<hbox align="center">
<html:label
for="__addonRef__-workspace-expandLevel"
data-l10n-id="workspace-expandLevel-label"
for="__addonRef__-editor-expandLevel"
data-l10n-id="editor-expandLevel-label"
></html:label>
<html:input
type="number"
min="1"
max="6"
step="1"
id="__addonRef__-workspace-expandLevel"
id="__addonRef__-editor-expandLevel"
preference="__prefsPrefix__.workspace.outline.expandLevel"
></html:input>
</hbox>
<checkbox
data-l10n-id="workspace-keepLinks"
data-l10n-id="editor-keepLinks"
native="true"
preference="__prefsPrefix__.workspace.outline.keepLinks"
/>
<checkbox
data-l10n-id="workspace-autoUpdateRelatedNotes"
native="true"
preference="__prefsPrefix__.workspace.autoUpdateRelatedNotes"
/>
</groupbox>
<groupbox>
<label><html:h2 data-l10n-id="sync-title"></html:h2></label>
<hbox>
<hbox align="center">
<html:label
for="__addonRef__-sync-period"
data-l10n-id="sync-period-label"
@ -49,7 +57,7 @@
preference="__prefsPrefix__.syncPeriodSeconds"
></html:input>
</hbox>
<hbox>
<hbox align="center">
<html:label
for="__addonRef__-sync-attachmentFolder"
data-l10n-id="sync-attachmentFolder-label"
@ -59,7 +67,7 @@
preference="__prefsPrefix__.syncAttachmentFolder"
></html:input>
</hbox>
<hbox>
<hbox align="center">
<button
onclick="Zotero.__addonInstance__.hooks.onShowSyncManager()"
data-l10n-id="sync-manager"
@ -68,7 +76,7 @@
</groupbox>
<groupbox>
<label><html:h2 data-l10n-id="template-title"></html:h2></label>
<hbox>
<hbox align="center">
<button
onclick="Zotero.__addonInstance__.hooks.onShowTemplateEditor()"
data-l10n-id="template-editor"

View File

@ -1,4 +1,4 @@
pref-title = BNotes
pref-title = Better Notes
menuItem-exportNote = Export Note

View File

@ -1,9 +1,14 @@
workspace-title = Workspace
workspace-expandLevel-label = Outline expand to heading level
workspace-keepLinks =
basic-title = Basic
basic-openNote-takeover =
.label = Take over opening note
basic-related-takeover =
.label = Take over note relation
editor-title = Note Editor
editor-expandLevel-label = Outline expand to heading level
editor-keepLinks =
.label = Show note links in outline
workspace-autoUpdateRelatedNotes =
.label = Automatically update related
sync-title = Sync
sync-period-label = Auto-sync period (seconds)
sync-attachmentFolder-label = Attachment folder

View File

@ -1,4 +1,4 @@
pref-title = BNotes
pref-title = Better Notes
menuItem-exportNote = Esporta nota

View File

@ -1,9 +1,14 @@
workspace-title = Spazio di lavoro
workspace-expandLevel-label = Espansione dello schema al livello delle intestazioni
workspace-keepLinks =
basic-title = Basic
basic-openNote-takeover =
.label = Take over opening note
basic-related-takeover =
.label = Take over note relation
editor-title = Note Editor
editor-expandLevel-label = Espansione dello schema al livello delle intestazioni
editor-keepLinks =
.label = Mostra i collegamenti delle note nello schema
workspace-autoUpdateRelatedNotes =
.label = Aggiorna automaticamente le note correlate
sync-title = Sincronizzazione
sync-period-label = Intervallo della sincronizzazione automatica (secondi)
sync-attachmentFolder-label = Cartella degli allegati

View File

@ -1,4 +1,4 @@
pref-title=BNotes
pref-title=Better Notes
menuItem-exportNote=Экспорт заметки

View File

@ -1,9 +1,14 @@
workspace-title = Рабочее пространство
workspace-expandLevel-label = Outline расширить до уровня заголовка
workspace-keepLinks =
basic-title = Basic
basic-openNote-takeover =
.label = Take over opening note
basic-related-takeover =
.label = Take over note relation
editor-title = Note Editor
editor-expandLevel-label = Outline расширить до уровня заголовка
editor-keepLinks =
.label = Сохранить ссылки
workspace-autoUpdateRelatedNotes =
.label = Автообновление связанных заметок
sync-title = Синк
sync-period-label = Авто-синк период (сек)
sync-attachmentFolder-label = Attachment folder

View File

@ -1,4 +1,4 @@
pref-title = BNotes
pref-title = Better Notes
menuItem-exportNote = Notu Dışa Aktar

View File

@ -1,9 +1,14 @@
workspace-title = Çalışma Alanı
workspace-expandLevel-label = Anahat başlık seviyesine genişletildi
workspace-keepLinks =
basic-title = Basic
basic-openNote-takeover =
.label = Take over opening note
basic-related-takeover =
.label = Take over note relation
editor-title = Note Editor
editor-expandLevel-label = Anahat başlık seviyesine genişletildi
editor-keepLinks =
.label = Not linklerini anahatta göster
workspace-autoUpdateRelatedNotes =
.label = Alakalı olanları otomatik güncelle
sync-title = Senkronize Et
sync-period-label = Oto-Senkronize aralığı (saniye)
sync-attachmentFolder-label = Ek Klasörü

View File

@ -1,4 +1,4 @@
pref-title=BNotes
pref-title=Better Notes
menuItem-exportNote=导出笔记
@ -60,9 +60,9 @@ workspace-emptyWorkspaceGuideCreate = 创建新笔记
editor-toolbar-settings-openAsTab = 在标签页中打开
editor-toolbar-settings-openAsWindow = 在窗口中打开
editor-toolbar-settings-showInLibrary = 在文库中显示
editor-toolbar-settings-insertTemplate=插入模板到光标行
editor-toolbar-settings-copyLink=复制当前行({ $line })笔记链接
editor-toolbar-settings-copyLinkAtSection=复制当前节({ $section })笔记链接
editor-toolbar-settings-insertTemplate=插入模板
editor-toolbar-settings-copyLink=复制行(L{ $line })
editor-toolbar-settings-copyLinkAtSection=复制节(Sec. { $section })
editor-toolbar-settings-openParent=打开附件
editor-toolbar-settings-export=导出当前笔记...
editor-toolbar-settings-refreshSyncing=立即同步

View File

@ -1,9 +1,14 @@
workspace-title = 工作区
workspace-expandLevel-label = 大纲展开至标题层级
workspace-keepLinks =
basic-title = 基本
basic-openNote-takeover =
.label = 接管打开笔记
basic-related-takeover =
.label = 接管笔记关联
editor-title = 笔记编辑器
editor-expandLevel-label = 大纲展开至标题层级
editor-keepLinks =
.label = 在大纲中显示笔记链接
workspace-autoUpdateRelatedNotes =
.label = 自动更新"相关"
sync-title = 同步
sync-period-label = 自动同步周期 (秒)
sync-attachmentFolder-label = 附件文件夹

View File

@ -27,4 +27,6 @@ pref("__prefsPrefix__.OCRMathpix.APIKey", "");
pref("__prefsPrefix__.workspace.outline.expandLevel", 2);
pref("__prefsPrefix__.workspace.outline.keepLinks", true);
pref("__prefsPrefix__.workspace.autoUpdateRelatedNotes", false);
pref("__prefsPrefix__.openNote.takeover", true);
pref("__prefsPrefix__.related.takeover", true);

View File

@ -169,7 +169,7 @@ export class OutlinePane extends PluginCEBase {
if (event === "modify" && type === "item") {
if ((ids as number[]).includes(this.item.id)) {
this.updateOutline();
if (getPref("workspace.autoUpdateRelatedNotes")) {
if (getPref("related.takeover")) {
this._addon.api.related.updateRelatedNotes(this.item.id);
}
}

View File

@ -81,7 +81,7 @@ export class NoteRelatedBox extends RelatedBox {
if (
this.editable &&
(!relatedItem.isNote() ||
!getPref("workspace.autoUpdateRelatedNotes"))
!getPref("related.takeover"))
) {
const remove = document.createXULElement("toolbarbutton");
remove.addEventListener("command", () => this._handleRemove(id));

View File

@ -38,6 +38,7 @@ import { patchViewItems } from "./modules/viewItems";
import { onUpdateRelated } from "./modules/relatedNotes";
import { getFocusedWindow } from "./utils/window";
import { registerNoteRelation } from "./modules/workspace/relation";
import { getPref } from "./utils/prefs";
async function onStartup() {
await Promise.all([
@ -157,6 +158,10 @@ function onOpenNote(
sectionName?: string;
} = {},
) {
if (!getPref("openNote.takeover")) {
ZoteroPane.openNoteWindow(noteId);
return;
}
let { workspaceUID } = options;
const noteItem = Zotero.Items.get(noteId);
if (!noteItem?.isNote()) {

View File

@ -8,7 +8,7 @@ function onUpdateRelated(
skipActive: true,
},
) {
if (!getPref("workspace.autoUpdateRelatedNotes")) {
if (!getPref("related.takeover")) {
return;
}
if (skipActive) {

View File

@ -69,7 +69,7 @@ export async function showSyncInfo(noteId: number) {
addon.hooks.onShowExportNoteOptions([noteId]);
},
})
.addButton(getString("export.cancel"), "cancel")
.addButton(getString("syncInfo.cancel"), "cancel")
.open(getString("export.title"), {
resizable: true,
centerscreen: true,