vpat 37: run JS aria edits + localization (#4021)
This commit is contained in:
parent
338afc2b80
commit
f4d428cb16
3 changed files with 24 additions and 11 deletions
|
@ -1,36 +1,37 @@
|
||||||
<html id="run-js">
|
<html id="run-js">
|
||||||
<head>
|
<head>
|
||||||
<title>Run JavaScript</title>
|
<title data-l10n-id="runJS-title"></title>
|
||||||
<link href="chrome://zotero-platform/content/zotero.css" rel="stylesheet"/>
|
<link href="chrome://zotero-platform/content/zotero.css" rel="stylesheet"/>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<nav>
|
<nav>
|
||||||
<button onclick="run()">Run</button>
|
<button data-l10n-id="runJS-run" onclick="run()"></button>
|
||||||
<span id="run-label"></span>
|
<span id="run-label"></span>
|
||||||
<button id="help-button" onclick="openHelp()">Help</button>
|
<button data-l10n-id="runJS-help" id="help-button" onclick="openHelp()"></button>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
<div class="textbox-container">
|
<div class="textbox-container">
|
||||||
<div class="textbox-header">
|
<div class="textbox-header">
|
||||||
<label class="textbox-label" for="editor-code">Code:</label>
|
<label id="code-editor-label" data-l10n-id="runJS-editor-label" class="textbox-label"></label>
|
||||||
<label id="run-as-async-label" for="run-as-async">
|
<div>
|
||||||
|
<label id="run-as-async-label" data-l10n-id="runJS-run-async" for="run-as-async"></label>
|
||||||
<input id="run-as-async" type="checkbox" onclick="update()">
|
<input id="run-as-async" type="checkbox" onclick="update()">
|
||||||
Run as async function
|
</div>
|
||||||
</label>
|
|
||||||
</div>
|
</div>
|
||||||
<iframe
|
<iframe
|
||||||
src="chrome://zotero/content/ace/ace.html"
|
src="chrome://zotero/content/ace/ace.html"
|
||||||
id="editor-code"
|
id="editor-code"
|
||||||
class="editor-code"
|
class="editor-code"
|
||||||
|
aria-labelledby="code-editor-label"
|
||||||
></iframe>
|
></iframe>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="textbox-container">
|
<div class="textbox-container">
|
||||||
<div class="textbox-header">
|
<div class="textbox-header">
|
||||||
<label id="result-label" class="textbox-label" for="result"/>
|
<label id="result-label" class="textbox-label" for="result" data-l10n-id="runJS-result"/>
|
||||||
</div>
|
</div>
|
||||||
<textarea id="result" readonly></textarea>
|
<textarea id="result" readonly aria-disabled="true"></textarea>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
function update() {
|
function update() {
|
||||||
var isAsync = document.getElementById('run-as-async').checked;
|
var isAsync = document.getElementById('run-as-async').checked;
|
||||||
var resultLabel = document.getElementById('result-label');
|
var resultLabel = document.getElementById('result-label');
|
||||||
var val = isAsync ? 'Return value' : 'Result';
|
var type = isAsync ? 'async' : 'none';
|
||||||
resultLabel.textContent = val + ':';
|
resultLabel.setAttribute('data-l10n-args', `{"type":"${type}"}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
|
@ -85,6 +85,7 @@ window.addEventListener("load", function (e) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MozXULElement.insertFTLIfNeeded("zotero.ftl");
|
||||||
var codeWin = document.getElementById("editor-code").contentWindow;
|
var codeWin = document.getElementById("editor-code").contentWindow;
|
||||||
codeEditor = codeWin.editor;
|
codeEditor = codeWin.editor;
|
||||||
var session = codeEditor.getSession();
|
var session = codeEditor.getSession();
|
||||||
|
|
|
@ -10,6 +10,7 @@ general-add = Add
|
||||||
general-remind-me-later = Remind Me Later
|
general-remind-me-later = Remind Me Later
|
||||||
general-choose-file = Choose File…
|
general-choose-file = Choose File…
|
||||||
general-open-settings = Open Settings
|
general-open-settings = Open Settings
|
||||||
|
general-help = Help
|
||||||
|
|
||||||
menu-file-show-in-finder =
|
menu-file-show-in-finder =
|
||||||
.label = 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.
|
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-style-label = Citation Style:
|
||||||
bibliography-locale-label = Language:
|
bibliography-locale-label = Language:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue