diff --git a/chrome/content/zotero/xpcom/file.js b/chrome/content/zotero/xpcom/file.js index 83940dcf10..42e82e54ed 100644 --- a/chrome/content/zotero/xpcom/file.js +++ b/chrome/content/zotero/xpcom/file.js @@ -107,11 +107,11 @@ Zotero.File = new function(){ } var dir = OS.Path.dirname(file); - while (dir && !await OS.File.exists(dir)) { + while (dir && dir != '/' && !await OS.File.exists(dir)) { dir = OS.Path.dirname(dir); } - return dir || false; + return (dir && dir != '/') ? dir : false; } diff --git a/chrome/content/zotero/xpcom/translation/translator.js b/chrome/content/zotero/xpcom/translation/translator.js index c7418dd2fb..5ad6388b7d 100644 --- a/chrome/content/zotero/xpcom/translation/translator.js +++ b/chrome/content/zotero/xpcom/translation/translator.js @@ -215,4 +215,7 @@ Zotero.Translator.replaceDeprecatedStatements = function(code) { Zotero.Translator.RUN_MODE_IN_BROWSER = 1; Zotero.Translator.RUN_MODE_ZOTERO_STANDALONE = 2; -Zotero.Translator.RUN_MODE_ZOTERO_SERVER = 4; \ No newline at end of file +Zotero.Translator.RUN_MODE_ZOTERO_SERVER = 4; +Zotero.Translator.TRANSLATOR_TYPES = TRANSLATOR_TYPES; +Zotero.Translator.TRANSLATOR_OPTIONAL_PROPERTIES = TRANSLATOR_OPTIONAL_PROPERTIES; +Zotero.Translator.TRANSLATOR_REQUIRED_PROPERTIES = TRANSLATOR_REQUIRED_PROPERTIES; diff --git a/chrome/content/zotero/xpcom/translation/translators.js b/chrome/content/zotero/xpcom/translation/translators.js index 60fbf167d2..3936466127 100644 --- a/chrome/content/zotero/xpcom/translation/translators.js +++ b/chrome/content/zotero/xpcom/translation/translators.js @@ -181,10 +181,10 @@ Zotero.Translators = new function() { // add to cache _translators[translator.translatorID] = translator; - for (let type in TRANSLATOR_TYPES) { - if (translator.translatorType & TRANSLATOR_TYPES[type]) { + for (let type in Zotero.Translator.TRANSLATOR_TYPES) { + if (translator.translatorType & Zotero.Translator.TRANSLATOR_TYPES[type]) { _cache[type].push(translator); - if ((translator.translatorType & TRANSLATOR_TYPES.web) && translator.targetAll) { + if ((translator.translatorType & Zotero.Translator.TRANSLATOR_TYPES.web) && translator.targetAll) { _cache.webWithTargetAll.push(translator); } } @@ -193,8 +193,8 @@ Zotero.Translators = new function() { if (!dbCacheEntry) { yield Zotero.Translators.cacheInDB( fileName, - translator.serialize(TRANSLATOR_REQUIRED_PROPERTIES. - concat(TRANSLATOR_OPTIONAL_PROPERTIES)), + translator.serialize(Zotero.Translator.TRANSLATOR_REQUIRED_PROPERTIES. + concat(Zotero.Translator.TRANSLATOR_OPTIONAL_PROPERTIES)), lastModifiedTime ); }