diff --git a/.github/DISCUSSION_TEMPLATE/note-templates.yml b/.github/DISCUSSION_TEMPLATE/note-templates.yml
index 68bd5b8..29f9b1f 100644
--- a/.github/DISCUSSION_TEMPLATE/note-templates.yml
+++ b/.github/DISCUSSION_TEMPLATE/note-templates.yml
@@ -31,7 +31,7 @@ body:
id: bn_version
attributes:
label: Test on Better Notes version
- description: Please provide the Better Notes version you are using here. You can find this in the menu -> Edit -> Settings -> Better Notes.
+ description: Please provide the Better Notes version you are using here. You can find this in the Settings -> Better Notes.
placeholder: e.g. 1.0.4
validations:
required: true
diff --git a/addon/chrome/content/templateEditor.xhtml b/addon/chrome/content/templateEditor.xhtml
index f5483e7..ef91b7c 100644
--- a/addon/chrome/content/templateEditor.xhtml
+++ b/addon/chrome/content/templateEditor.xhtml
@@ -150,6 +150,7 @@
+
-
-
diff --git a/addon/locale/en-US/templateEditor.ftl b/addon/locale/en-US/templateEditor.ftl
index ae6f2e2..3cdcd2a 100644
--- a/addon/locale/en-US/templateEditor.ftl
+++ b/addon/locale/en-US/templateEditor.ftl
@@ -26,6 +26,9 @@ delete =
.label = Delete
reset =
.label = Reset
+share =
+ .label = Share
+ .tooltiptext = Copy template share code to clipboard
more =
.label = More Templates
.title = Get more templates online
@@ -36,8 +39,6 @@ importClipboard =
.label = Import template: from template share code in clipboard
importNote =
.label = Import template: from existing note
-share =
- .label = Copy template share code to clipboard
backup =
.label = Export backup file
restore =
diff --git a/addon/locale/it-IT/templateEditor.ftl b/addon/locale/it-IT/templateEditor.ftl
index 03cb3be..6aaee10 100644
--- a/addon/locale/it-IT/templateEditor.ftl
+++ b/addon/locale/it-IT/templateEditor.ftl
@@ -26,6 +26,9 @@ delete =
.label = Elimina
reset =
.label = Ripristina
+share =
+ .label = Share
+ .tooltiptext = Copia codice di condivisione template negli appunti
more =
.label = Altri Template
.title = Ottieni altri template online
@@ -36,8 +39,6 @@ importClipboard =
.label = Importa template: da il codice di condivisione template negli appunti
importNote =
.label = Importa template: da nota esistente
-share =
- .label = Copia codice di condivisione template negli appunti
backup =
.label = Esporta file di backup
restore =
diff --git a/addon/locale/ru-RU/templateEditor.ftl b/addon/locale/ru-RU/templateEditor.ftl
index 1508a00..4f4fcaf 100644
--- a/addon/locale/ru-RU/templateEditor.ftl
+++ b/addon/locale/ru-RU/templateEditor.ftl
@@ -26,6 +26,9 @@ delete =
.label = Удалить
reset =
.label = Сброс
+share =
+ .label = Share
+ .tooltiptext = Copy template share code to clipboard
more =
.label = Больше шаблонов
.title = Get more templates online
@@ -36,8 +39,6 @@ importClipboard =
.label = Import template: from template share code in clipboard
importNote =
.label = Import template: from existing note
-share =
- .label = Copy template share code to clipboard
backup =
.label = Export backup file
restore =
diff --git a/addon/locale/tr-TR/templateEditor.ftl b/addon/locale/tr-TR/templateEditor.ftl
index 9a8307f..e8118cd 100644
--- a/addon/locale/tr-TR/templateEditor.ftl
+++ b/addon/locale/tr-TR/templateEditor.ftl
@@ -26,6 +26,9 @@ delete =
.label = Sil
reset =
.label = Sıfırla
+share =
+ .label = Share
+ .tooltiptext = Şablon paylaşım kodunu panoya kopyala
more =
.label = Daha Fazla Şablon
.title = Daha Fazla Çevrimiçi Şablon Bul
@@ -36,8 +39,6 @@ importClipboard =
.label = Şablonu İçe Aktar: panodaki şablon paylaşım kodu ile
importNote =
.label = Şablonu İçe Aktar: var olan bir nottan
-share =
- .label = Şablon paylaşım kodunu panoya kopyala
backup =
.label = Yedek dosyasını dışa aktar
restore =
diff --git a/addon/locale/zh-CN/templateEditor.ftl b/addon/locale/zh-CN/templateEditor.ftl
index e0711c3..04e10dd 100644
--- a/addon/locale/zh-CN/templateEditor.ftl
+++ b/addon/locale/zh-CN/templateEditor.ftl
@@ -26,6 +26,9 @@ delete =
.label = 删除
reset =
.label = 重置
+share =
+ .label = 分享
+ .tooltiptext = 复制模板分享代码到剪贴板
more =
.label = 更多模板
@@ -35,8 +38,6 @@ importClipboard =
.label = 导入笔记模板: 剪贴板中的模板分享代码
importNote =
.label = 导入笔记模板: 从现有笔记
-share =
- .label = 复制模板分享代码到剪贴板
backup =
.label = 导出模板备份文件
restore =
diff --git a/src/modules/template/editorWindow.ts b/src/modules/template/editorWindow.ts
index 9a5ce5f..a40897c 100644
--- a/src/modules/template/editorWindow.ts
+++ b/src/modules/template/editorWindow.ts
@@ -1,5 +1,5 @@
import YAML = require("yamljs");
-import { config } from "../../../package.json";
+import { config, version } from "../../../package.json";
import { showHint } from "../../utils/hint";
import { itemPicker } from "../../utils/itemPicker";
import { getString } from "../../utils/locale";
@@ -163,6 +163,11 @@ export async function showTemplateEditor() {
?.addEventListener("click", (ev) => {
resetSelectedTemplate();
});
+ _window.document
+ .querySelector("#share")
+ ?.addEventListener("click", (ev) => {
+ shareSelectedTemplate();
+ });
_window.document
.querySelector("#importClipboard")
?.addEventListener("click", (ev) => {
@@ -173,11 +178,6 @@ export async function showTemplateEditor() {
?.addEventListener("click", (ev) => {
importNoteTemplate();
});
- _window.document
- .querySelector("#share")
- ?.addEventListener("click", (ev) => {
- shareSelectedTemplate();
- });
_window.document
.querySelector("#backup")
?.addEventListener("click", (ev) => {
@@ -286,6 +286,7 @@ function updateEditor() {
const saveTemplate = win?.document.getElementById("save") as XUL.Button;
const deleteTemplate = win?.document.getElementById("delete") as XUL.Button;
const resetTemplate = win?.document.getElementById("reset") as XUL.Button;
+ const shareTemplate = win?.document.getElementById("share") as XUL.Button;
const formats = win?.document.getElementById(
"formats-container",
) as HTMLDivElement;
@@ -301,6 +302,7 @@ function updateEditor() {
saveTemplate.setAttribute("disabled", "true");
deleteTemplate.setAttribute("disabled", "true");
deleteTemplate.hidden = false;
+ shareTemplate.setAttribute("disabled", "true");
resetTemplate.hidden = true;
formats.hidden = true;
snippets.hidden = true;
@@ -323,6 +325,7 @@ function updateEditor() {
editor.hidden = false;
saveTemplate.removeAttribute("disabled");
deleteTemplate.removeAttribute("disabled");
+ shareTemplate.removeAttribute("disabled");
formats.hidden = false;
snippets.hidden = false;
updateSnippets(
@@ -620,9 +623,12 @@ function shareSelectedTemplate() {
const content = addon.api.template.getTemplateText(name);
const yaml = `# This template is specifically for importing/sharing, using better
# notes 'import from clipboard': copy the content and
-# goto Zotero menu bar, click Edit->New Template from Clipboard.
+# goto Zotero menu bar, click Tools->New Template from Clipboard.
# Do not copy-paste this to better notes template editor directly.
name: "${name}"
+zoteroVersion: "${Zotero.version}"
+pluginVersion: "${version}"
+savedAt: "${new Date().toISOString()}"
content: |-
${content
.split("\n")
@@ -631,7 +637,7 @@ ${content
`;
new ztoolkit.Clipboard().addText(yaml, "text/plain").copy();
showHint(
- `Template ${name} is copied to clipboard. To import it, goto Zotero menu bar, click Edit->New Template from Clipboard. `,
+ `Template ${name} is copied to clipboard. To import it, goto Zotero menu->Tools->New Template from Clipboard. `,
);
}