From 871a275090125e0a1e9a43ba49371945c632f84f Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 2 Aug 2019 07:00:06 -0400 Subject: [PATCH] Add Help button to Run JavaScript window to open documentation --- chrome/content/zotero/runJS.html | 3 ++- chrome/content/zotero/runJS.js | 4 ++++ chrome/skin/default/zotero/runJS.css | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/runJS.html b/chrome/content/zotero/runJS.html index cae1491507..f135d819c1 100644 --- a/chrome/content/zotero/runJS.html +++ b/chrome/content/zotero/runJS.html @@ -6,7 +6,8 @@
diff --git a/chrome/content/zotero/runJS.js b/chrome/content/zotero/runJS.js index 04eb32a817..ea621115c4 100644 --- a/chrome/content/zotero/runJS.js +++ b/chrome/content/zotero/runJS.js @@ -32,6 +32,10 @@ async function run() { resultTextbox.textContent = typeof result == 'string' ? result : Zotero.Utilities.varDump(result); } +function openHelp() { + Zotero.launchURL("https://www.zotero.org/support/dev/client_coding/javascript_api"); +} + function handleInput() { // eslint-disable-line no-unused-vars var checkbox = document.getElementById('run-as-async'); var isAsync = checkbox.checked; diff --git a/chrome/skin/default/zotero/runJS.css b/chrome/skin/default/zotero/runJS.css index 8fc6b41f4c..4c008bb164 100644 --- a/chrome/skin/default/zotero/runJS.css +++ b/chrome/skin/default/zotero/runJS.css @@ -13,6 +13,10 @@ button { font-size: 15px; } +#help-button { + margin-left: 15px; +} + #run-label { margin-left: 2px; font-size: 12px;