From cd046433dab9411a9ab72140bb85c8b01578521c Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Thu, 30 Jun 2011 23:10:00 +0000 Subject: [PATCH] Don't run translator tester without Zotero Standalone --- .../tools/testTranslators/testTranslators.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/tools/testTranslators/testTranslators.js b/chrome/content/zotero/tools/testTranslators/testTranslators.js index 0d21c2f28..8227583ac 100644 --- a/chrome/content/zotero/tools/testTranslators/testTranslators.js +++ b/chrome/content/zotero/tools/testTranslators/testTranslators.js @@ -205,10 +205,25 @@ TranslatorTestView.prototype.runTests = function(doneCallback) { */ function load(event) { if(window.chrome || window.safari) { - // initialize + // initialize injection Zotero.initInject(); + // make sure that connector is online + Zotero.Connector.checkIsOnline(function(status) { + if(status) { + init(); + } else { + document.body.textContent = "To avoid excessive repo requests, the translator tester may only be used when Zotero Standalone is running."; + } + }); + } else { + init(); } - +} + +/** + * Builds translator display and retrieves translators + */ +function init() { // create translator box translatorBox = document.createElement("div"); translatorBox.id = "translator-box";