diff --git a/bootstrap.js b/bootstrap.js
index 25e7335..e40ae76 100644
--- a/bootstrap.js
+++ b/bootstrap.js
@@ -7,6 +7,7 @@ var Zotero_File_Exporter;
var Zotero_File_Interface;
var ZoteroPane_Local;
var Zotero_File_Interface;
+var FilePicker;
var fflate;
var ZeNotes;
var setImmediate = function(){};
@@ -253,6 +254,7 @@ async function startup({ id, version, resourceURI, rootURI = resourceURI.spec })
Services.scriptloader.loadSubScript(rootURI + 'lib/fflate/index.js');
Services.scriptloader.loadSubScript(rootURI + 'lib/CryptoJS 3.1.2/aes.js');
+ Services.scriptloader.loadSubScript(rootURI + 'core/filepicker6.js');
Services.scriptloader.loadSubScript(rootURI + 'core/settings.js');
Services.scriptloader.loadSubScript(rootURI + 'core/dropbox.js');
Services.scriptloader.loadSubScript(rootURI + 'core/zenotes.js');
@@ -282,6 +284,7 @@ async function startup({ id, version, resourceURI, rootURI = resourceURI.spec })
Zotero_File_Interface = Zotero.getMainWindow().Zotero_File_Interface;
ZoteroPane_Local = Zotero.getMainWindow().ZoteroPane_Local;
Zotero_File_Interface = Zotero.getMainWindow().Zotero_File_Interface;
+ FilePicker = Zotero.getMainWindow().FilePicker;
Menu.addToAllWindows();
ZeNotes.Prefs = Prefs;
ZeNotes.Database = Database;
diff --git a/content/settings/preferences.js b/content/settings/preferences.js
index ba36a4b..5eef009 100644
--- a/content/settings/preferences.js
+++ b/content/settings/preferences.js
@@ -588,7 +588,7 @@ Zotero_Preferences.ZeNotes = {
var isdark = Zotero.Prefs.get('general.theme')=="dark" || window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
if (isdark) {
- var filename = "chrome://ze-notes/content/settings/preferences-dark.css";
+ var filename = "chrome://zenotes/content/settings/preferences-dark.css";
var pi = document.createProcessingInstruction(
'xml-stylesheet',
`type="text/css" href="${filename}"`
diff --git a/content/settings/preferences.xul b/content/settings/preferences.xul
index c2f5dc9..a58c19e 100644
--- a/content/settings/preferences.xul
+++ b/content/settings/preferences.xul
@@ -18,7 +18,7 @@
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core/filepicker6.js b/core/filepicker6.js
new file mode 100644
index 0000000..9bce7b0
--- /dev/null
+++ b/core/filepicker6.js
@@ -0,0 +1,28 @@
+function FilePicker6()
+{
+ this.defaultExtension = "";
+ this.returnOK = 0;
+ this.returnReplace = 2;
+ this.nsIFilePicker = Components.interfaces.nsIFilePicker;
+ this.fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(this.nsIFilePicker);
+ this.modeSave = this.nsIFilePicker.modeSave;
+ this.modeOpen = this.nsIFilePicker.modeOpen;
+}
+
+FilePicker6.prototype.init = function(w, title, mode) {
+ return this.fp.init(w, title, mode);
+};
+
+FilePicker6.prototype.appendFilter = function(filter, extension) {
+ return this.fp.appendFilter(filter, extension);
+};
+
+FilePicker6.prototype.show = function() {
+ var wm = this;
+ return new Promise(function(resolve, reject) {
+ wm.fp.open(function(result) {
+ wm.file = wm.fp.file.path;
+ resolve(result);
+ });
+ });
+};
\ No newline at end of file
diff --git a/core/io.js b/core/io.js
index 2f447e9..4ddb6f9 100644
--- a/core/io.js
+++ b/core/io.js
@@ -1,9 +1,11 @@
-var { OS } = ChromeUtils.importESModule("chrome://zotero/content/osfile.mjs");
-var { FilePicker } = ChromeUtils.importESModule('chrome://zotero/content/modules/filePicker.mjs');
-
Io = {
async savedialog(title, filter, extension, defaultstring, contents)
{
+ if(!FilePicker)
+ {
+ FilePicker = FilePicker6;
+ }
+
let fp = new FilePicker();
fp.init(window, title, fp.modeSave);
fp.appendFilter(filter, extension);
@@ -17,6 +19,11 @@ Io = {
},
async loaddialog(title, filter, extension, defaultstring)
{
+ if(!FilePicker)
+ {
+ FilePicker = FilePicker6;
+ }
+
let fp = new FilePicker();
fp.init(window, title, fp.modeOpen);
fp.appendFilter(filter, extension);
@@ -28,4 +35,4 @@ Io = {
return await Zotero.File.getContentsAsync("file:///"+outputFile);
}
}
-}
\ No newline at end of file
+}
diff --git a/core/settings.js b/core/settings.js
index 3448136..e0ae4e0 100644
--- a/core/settings.js
+++ b/core/settings.js
@@ -4,8 +4,8 @@ Settings = {
var znpref = win.document.createElement("prefpane");
znpref.setAttribute("id", "zotero-prefpane-zenotes");
znpref.setAttribute("label", "Ze Notes");
- znpref.setAttribute("image", "chrome://ze-notes/content/images/zenotes-settings.png");
- znpref.setAttribute("src", "chrome://ze-notes/content/settings/preferences6.xul");
+ znpref.setAttribute("image", "chrome://zenotes/content/images/zenotes-settings.png");
+ znpref.setAttribute("src", "chrome://zenotes/content/settings/preferences6.xul");
prefwindow.addPane(znpref);
},
inject(){
diff --git a/core/ui.js b/core/ui.js
index 3dccd84..e46d8d9 100644
--- a/core/ui.js
+++ b/core/ui.js
@@ -26,7 +26,7 @@ Ui = {
{
Zotero.ZeNotes.collection = "All documents";
}
- var url = "chrome://ze-notes/content/settings/preferences.xul";
+ var url = "chrome://zenotes/content/settings/preferences.xul";
var io = {collection: Zotero.ZeNotes.collection};
var name = "settingswin";
let width = Zotero.ZeNotes.Prefs.get("prefs-window-width", "775");
diff --git a/core/zenotes.js b/core/zenotes.js
index 18e33a2..74a381f 100644
--- a/core/zenotes.js
+++ b/core/zenotes.js
@@ -62,7 +62,7 @@ ZeNotes = {
// Use strings from zenotes.properties (legacy properties format) in Zotero 6
else {
let stringBundle = Services.strings.createBundle(
- 'chrome://ze-notes/locale/zenotes.properties'
+ 'chrome://zenotes/locale/zenotes.properties'
);
}
},
diff --git a/install.rdf b/install.rdf
index 72af4d9..6543576 100644
--- a/install.rdf
+++ b/install.rdf
@@ -5,7 +5,7 @@
zenotes@alefa.net
ZeNotes
- 0.9.5
+ 0.9.6
true
https://github.com/frianasoa/Ze-Notes/releases/download/release/zenotes-update.rdf
https://github.com/frianasoa/zenotes
diff --git a/manifest.json b/manifest.json
index ecc0276..371f300 100644
--- a/manifest.json
+++ b/manifest.json
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Ze Notes",
- "version": "0.9.5",
+ "version": "0.9.6",
"description": "Advanced notes manager",
"author": "Fanantenana Rianasoa Andriariniaina",
"homepage_url": "https://github.com/frianasoa/zenotes",
diff --git a/zenotes-update.json b/zenotes-update.json
index 8bf8cb3..7fb0317 100644
--- a/zenotes-update.json
+++ b/zenotes-update.json
@@ -3,9 +3,9 @@
"zenotes@alefa.net": {
"updates": [
{
- "version": "0.9.5",
- "update_link": "https://github.com/frianasoa/Ze-Notes/releases/download/v0.9.5/zenotes-v0.9.5.xpi",
- "update_hash": "sha512:7e1c7631c12b5dd9c1649527d4f1673baf03efe47529af97a29f3b0297771cf90a2587e14a8a7eccd7647ab90dec89363814ad7d9a83575a1021d16714b57dc0",
+ "version": "0.9.6",
+ "update_link": "https://github.com/frianasoa/Ze-Notes/releases/download/v0.9.6/zenotes-v0.9.6.xpi",
+ "update_hash": "sha512:747e0346ddfe9e9e150580de58992708f06ffc2ab90d64f1523c068be8d3df56c9d5ce8b869321f49c9770c631d138c658a8b15385940fb695d373e4a2801696",
"applications": {
"gecko": {
"strict_min_version": "6.0",
diff --git a/zenotes-update.rdf b/zenotes-update.rdf
index f9211fe..598fb27 100644
--- a/zenotes-update.rdf
+++ b/zenotes-update.rdf
@@ -5,13 +5,13 @@
- 0.9.5
+ 0.9.6
zotero@chnm.gmu.edu
5.0.0
6.*
- https://github.com/frianasoa/Ze-Notes/releases/download/v0.9.5/zenotes-v0.9.5.xpi
+ https://github.com/frianasoa/Ze-Notes/releases/download/v0.9.6/zenotes-v0.9.6.xpi
@@ -20,7 +20,7 @@
juris-m@juris-m.github.io
4.999
6.*
- https://github.com/frianasoa/Ze-Notes/releases/download/v0.9.5/zenotes-v0.9.5.xpi
+ https://github.com/frianasoa/Ze-Notes/releases/download/v0.9.6/zenotes-v0.9.6.xpi