fx140: Fix Mendeley import

'else' branch is untested.
This commit is contained in:
Abe Jellinek 2025-07-02 11:33:46 -04:00 • committed by Dan Stillman
parent e6aba9b879
commit e81f5d96f1
2 changed files with 7 additions and 16 deletions

View file

@ -703,27 +703,20 @@ var Zotero_File_Interface = new function () {
var _getMendeleyTranslation = async function () {
let Zotero_Import_Mendeley;
if (true) {
Cu.import("chrome://zotero/content/import/mendeley/mendeleyImport.js");
({ Zotero_Import_Mendeley } = ChromeUtils.importESModule("chrome://zotero/content/import/mendeley/mendeleyImport.js"));
}
// TEMP: Load uncached from ~/zotero-client for development
else {
ChromeUtils.importESModule("resource://gre/modules/FileUtils.sys.mjs");
const { FileUtils } = ChromeUtils.importESModule("resource://gre/modules/FileUtils.sys.mjs");
let file = FileUtils.getDir("Home", []);
file = OS.Path.join(
file.path,
'zotero-client', 'chrome', 'content', 'zotero', 'import', 'mendeley', 'mendeleyImport.js'
);
let fileURI = OS.Path.toFileURI(file);
let xmlhttp = await Zotero.HTTP.request(
'GET',
fileURI,
{
noCache: true,
responseType: 'text'
}
);
eval(xmlhttp.response);
({ Zotero_Import_Mendeley } = ChromeUtils.importESModule(fileURI));
}
return new Zotero_Import_Mendeley();
};

View file

@ -1,8 +1,6 @@
/* global mendeleyDBMaps:false, mendeleyOnlineMappings:false, mendeleyAPIUtils:false, PathUtils: false */
var EXPORTED_SYMBOLS = ["Zotero_Import_Mendeley"];
/* global mendeleyDBMaps:false, mendeleyOnlineMappings:false, mendeleyAPIUtils:false */
import { OS } from "chrome://zotero/content/osfile.mjs";
var { OS } = ChromeUtils.importESModule("chrome://zotero/content/osfile.mjs");
Services.scriptloader.loadSubScript("chrome://zotero/content/include.js");
Services.scriptloader.loadSubScript("chrome://zotero/content/import/mendeley/mendeleyOnlineMappings.js");
Services.scriptloader.loadSubScript("chrome://zotero/content/import/mendeley/mendeleyAPIUtils.js");
@ -24,7 +22,7 @@ colorMap.set('#d3c2ff', '#a28ae5');
colorMap.set('rgb(220, 255, 176)', '#5fb236');
colorMap.set('#dcffb0', '#5fb236');
var Zotero_Import_Mendeley = function () {
export var Zotero_Import_Mendeley = function () {
this.createNewCollection = null;
this.linkFiles = null;
this.newItems = [];