support importing on Windows and *NIX
This commit is contained in:
parent
498489f8c3
commit
50934eef0c
1 changed files with 21 additions and 2 deletions
|
@ -618,11 +618,30 @@ var Zotero = new function(){
|
||||||
// if standalone and no directory yet, check Firefox directory
|
// if standalone and no directory yet, check Firefox directory
|
||||||
// or if in Firefox and no directory yet, check standalone Zotero directory
|
// or if in Firefox and no directory yet, check standalone Zotero directory
|
||||||
if(!file.exists()) {
|
if(!file.exists()) {
|
||||||
|
if(Zotero.isStandalone) {
|
||||||
|
if(Zotero.isWin) {
|
||||||
|
var path = "../Mozilla/Firefox";
|
||||||
|
} else if(Zotero.isMac) {
|
||||||
|
var path = "../Firefox";
|
||||||
|
} else {
|
||||||
|
var path = "../.mozilla/firefox";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(Zotero.isWin) {
|
||||||
|
var path = "../../Zotero";
|
||||||
|
} else if(Zotero.isMac) {
|
||||||
|
var path = "../Zotero";
|
||||||
|
} else {
|
||||||
|
var path = "../../.zotero";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// get Firefox directory
|
// get Firefox directory
|
||||||
var prefDir = Components.classes["@mozilla.org/file/directory_service;1"]
|
var prefDir = Components.classes["@mozilla.org/file/directory_service;1"]
|
||||||
.getService(Components.interfaces.nsIProperties)
|
.getService(Components.interfaces.nsIProperties)
|
||||||
.get("DefProfRt", Components.interfaces.nsILocalFile).parent.parent;
|
.get("DefProfRt", Components.interfaces.nsILocalFile).parent
|
||||||
prefDir.append(Zotero.isStandalone ? "Firefox" : "Zotero");
|
.QueryInterface(Components.interfaces.nsILocalFile);
|
||||||
|
prefDir.appendRelativePath(path);
|
||||||
|
|
||||||
// get default profile
|
// get default profile
|
||||||
var defProfile = getDefaultProfile(prefDir);
|
var defProfile = getDefaultProfile(prefDir);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue