Fix getTranslatorCode bugs

- /connector/getTranslatorCode used to respond with empty content
- CodeGetter froze connectors by issuing hundreds of simultanious XHR
  requests
This commit is contained in:
Adomas Venčkauskas 2016-09-18 12:24:55 +03:00
parent 38df733a37
commit e83bbbad4e
9 changed files with 95 additions and 43 deletions

View file

@ -1,26 +1,6 @@
new function() {
Components.utils.import("resource://gre/modules/osfile.jsm");
/**
* Build a dummy translator that can be passed to Zotero.Translate
*/
function buildDummyTranslator(translatorType, code) {
let info = {
"translatorID":"dummy-translator",
"translatorType":1, // import
"label":"Dummy Translator",
"creator":"Simon Kornblith",
"target":"",
"priority":100,
"browserSupport":"g",
"inRepository":false,
"lastUpdated":"0000-00-00 00:00:00",
};
let translator = new Zotero.Translator(info);
translator.code = code;
return translator;
}
/**
* Create a new translator that saves the specified items
* @param {String} translatorType - "import" or "web"