Don't run translator tester without Zotero Standalone

This commit is contained in:
Simon Kornblith 2011-06-30 23:10:00 +00:00
parent ca1e3f8647
commit cd046433da

View file

@ -205,10 +205,25 @@ TranslatorTestView.prototype.runTests = function(doneCallback) {
*/ */
function load(event) { function load(event) {
if(window.chrome || window.safari) { if(window.chrome || window.safari) {
// initialize // initialize injection
Zotero.initInject(); 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 // create translator box
translatorBox = document.createElement("div"); translatorBox = document.createElement("div");
translatorBox.id = "translator-box"; translatorBox.id = "translator-box";