Skip to content

Commit

Permalink
Taking care of standalone notes [again]
Browse files Browse the repository at this point in the history
  • Loading branch information
frianasoa committed Dec 12, 2023
1 parent 5a17a56 commit c72faa2
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 12 deletions.
2 changes: 1 addition & 1 deletion content/notes/notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ Notes = {
$('#zn-body-wrapper').animate({
scrollTop: Zotero.ZeNotes.Prefs.get("scrolltop", 0),
scrollLeft: Zotero.ZeNotes.Prefs.get("scrollleft", 0),
}, 500);
}, 200);

$("#zn-body-wrapper").bind('scroll', function() {
Zotero.ZeNotes.Prefs.set("scrolltop", $('#zn-body-wrapper').scrollTop());
Expand Down
11 changes: 10 additions & 1 deletion core/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,16 @@ Data = {

notetags(item){
var taglist = [];
notes = item.getNotes();
var notes = [];
if(![NOTE_LABEL].includes(item.itemType))
{
notes = item.getNotes();
}
else
{
notes.push(item.id)
}

if(notes.length>0)
{
for(j in notes)
Expand Down
22 changes: 20 additions & 2 deletions core/format.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,16 @@ Format = {

async itemnotes(item)
{
var allnotes = item.getNotes().map(function(id){return Zotero.Items.get(id);});
var allnotes = [];
if(![NOTE_LABEL].includes(item.itemType))
{
allnotes = item.getNotes().map(function(id){return Zotero.Items.get(id);});
}
else
{
allnotes.push(item);
}

try {
var pdfids = item.getAttachments();
for(let id of pdfids)
Expand Down Expand Up @@ -78,7 +87,16 @@ Format = {
itemtags(item)
{
var alltags = []
var noteids = item.getNotes();
var noteids = [];
if(![NOTE_LABEL].includes(item.itemType))
{
noteids = item.getNotes();
}
else
{
noteids.push(item.id);
}

var pdfids = [];
try {
pdfids = item.getAttachments();
Expand Down
2 changes: 1 addition & 1 deletion install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Description about="urn:mozilla:install-manifest">
<em:id>[email protected]</em:id>
<em:name>ZeNotes</em:name>
<em:version>0.5.4</em:version>
<em:version>0.5.5</em:version>
<em:multiprocessCompatible>true</em:multiprocessCompatible>
<em:updateURL>https://raw.githubusercontent.com/frianasoa/zenotes/main/zenote-update.json</em:updateURL>
<em:homepageURL>https://github.com/frianasoa/zenotes</em:homepageURL>
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Ze Notes",
"version": "0.5.4",
"version": "0.5.5",
"description": "Advanced notes manager",
"homepage_url": "https://github.com/frianasoa/zenotes",
"author": "Fanantenana Rianasoa Andriariniaina",
Expand Down
6 changes: 3 additions & 3 deletions zenote-update.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"[email protected]": {
"updates": [
{
"version": "0.5.4",
"update_link": "https://github.com/frianasoa/Ze-Notes/releases/download/v0.5.4/zenotes-v0.5.4.xpi",
"update_hash": "sha256:4788467da70c6f91f610bffae63cd1fc78ac53ff2a9ee976938e105ee2d41040",
"version": "0.5.5",
"update_link": "https://github.com/frianasoa/Ze-Notes/releases/download/v0.5.5/zenotes-v0.5.5.xpi",
"update_hash": "sha256:b1306c9915d54eefff7487d735ce1e08cfe6459e4c9f929b0877d7ef47bddc36",
"applications": {
"gecko": {
"strict_min_version": "60.0"
Expand Down
6 changes: 3 additions & 3 deletions zenote-update.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<rdf:Seq>
<rdf:li>
<rdf:Description>
<ns1:version>0.5.4</ns1:version>
<ns1:version>0.5.5</ns1:version>
<ns1:targetApplication>
<rdf:Description>
<ns1:id>[email protected]</ns1:id>
<ns1:minVersion>5.0.0</ns1:minVersion>
<ns1:maxVersion>6.*</ns1:maxVersion>
<ns1:updateLink>https://github.com/frianasoa/Ze-Notes/releases/download/v0.5.4/zenotes-v0.5.4.xpi</ns1:updateLink>
<ns1:updateLink>https://github.com/frianasoa/Ze-Notes/releases/download/v0.5.5/zenotes-v0.5.5.xpi</ns1:updateLink>
</rdf:Description>
</ns1:targetApplication>

Expand All @@ -20,7 +20,7 @@
<ns1:id>[email protected]</ns1:id>
<ns1:minVersion>4.999</ns1:minVersion>
<ns1:maxVersion>6.*</ns1:maxVersion>
<ns1:updateLink>https://github.com/frianasoa/Ze-Notes/releases/download/v0.5.4/zenotes-v0.5.4.xpi</ns1:updateLink>
<ns1:updateLink>https://github.com/frianasoa/Ze-Notes/releases/download/v0.5.5/zenotes-v0.5.5.xpi</ns1:updateLink>
</rdf:Description>
</ns1:targetApplication>

Expand Down

0 comments on commit c72faa2

Please sign in to comment.