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">
|
||||
<head>
|
||||
<title>Run JavaScript</title>
|
||||
<title data-l10n-id="runJS-title"></title>
|
||||
<link href="chrome://zotero-platform/content/zotero.css" rel="stylesheet"/>
|
||||
</head>
|
||||
<body>
|
||||
<nav>
|
||||
<button onclick="run()">Run</button>
|
||||
<button data-l10n-id="runJS-run" onclick="run()"></button>
|
||||
<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>
|
||||
|
||||
<main>
|
||||
<div class="textbox-container">
|
||||
<div class="textbox-header">
|
||||
<label class="textbox-label" for="editor-code">Code:</label>
|
||||
<label id="run-as-async-label" for="run-as-async">
|
||||
<label id="code-editor-label" data-l10n-id="runJS-editor-label" class="textbox-label"></label>
|
||||
<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()">
|
||||
Run as async function
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<iframe
|
||||
src="chrome://zotero/content/ace/ace.html"
|
||||
id="editor-code"
|
||||
class="editor-code"
|
||||
aria-labelledby="code-editor-label"
|
||||
></iframe>
|
||||
</div>
|
||||
|
||||
<div class="textbox-container">
|
||||
<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>
|
||||
<textarea id="result" readonly></textarea>
|
||||
<textarea id="result" readonly aria-disabled="true"></textarea>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue