From f4d428cb165a1b571b080e071aecc07dacb9a6c2 Mon Sep 17 00:00:00 2001 From: Bogdan Abaev Date: Thu, 18 Apr 2024 14:59:08 -0400 Subject: [PATCH] vpat 37: run JS aria edits + localization (#4021) --- chrome/content/zotero/runJS.html | 19 ++++++++++--------- chrome/content/zotero/runJS.js | 5 +++-- chrome/locale/en-US/zotero/zotero.ftl | 11 +++++++++++ 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/chrome/content/zotero/runJS.html b/chrome/content/zotero/runJS.html index 5dc6935ab9..dce469c89a 100644 --- a/chrome/content/zotero/runJS.html +++ b/chrome/content/zotero/runJS.html @@ -1,36 +1,37 @@ - Run JavaScript +
- -
-
- +
diff --git a/chrome/content/zotero/runJS.js b/chrome/content/zotero/runJS.js index 2681b493c3..dfe8a8ccb9 100644 --- a/chrome/content/zotero/runJS.js +++ b/chrome/content/zotero/runJS.js @@ -1,8 +1,8 @@ function update() { var isAsync = document.getElementById('run-as-async').checked; var resultLabel = document.getElementById('result-label'); - var val = isAsync ? 'Return value' : 'Result'; - resultLabel.textContent = val + ':'; + var type = isAsync ? 'async' : 'none'; + resultLabel.setAttribute('data-l10n-args', `{"type":"${type}"}`); } async function run() { @@ -85,6 +85,7 @@ window.addEventListener("load", function (e) { return; } + MozXULElement.insertFTLIfNeeded("zotero.ftl"); var codeWin = document.getElementById("editor-code").contentWindow; codeEditor = codeWin.editor; var session = codeEditor.getSession(); diff --git a/chrome/locale/en-US/zotero/zotero.ftl b/chrome/locale/en-US/zotero/zotero.ftl index 0b67f5697b..24c27a66ea 100644 --- a/chrome/locale/en-US/zotero/zotero.ftl +++ b/chrome/locale/en-US/zotero/zotero.ftl @@ -10,6 +10,7 @@ general-add = Add general-remind-me-later = Remind Me Later general-choose-file = Choose File… general-open-settings = Open Settings +general-help = Help menu-file-show-in-finder = .label = Show in Finder @@ -257,6 +258,16 @@ rtfScan-complete-page = rtfScan-complete-page-description = Your document has now been scanned and processed. Please ensure that it is formatted correctly. +runJS-title = Run JavaScript +runJS-editor-label = Code: +runJS-run = Run +runJS-help = { general-help } +runJS-result = { + $type -> + [async] Return value: + *[other] Result: +} +runJS-run-async = Run as async function bibliography-style-label = Citation Style: bibliography-locale-label = Language: