Skip to content

Commit

Permalink
Improving author column rendering. Added a clone "source".
Browse files Browse the repository at this point in the history
  • Loading branch information
frianasoa committed Jan 4, 2024
1 parent 4ec9d18 commit 168fb87
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 28 deletions.
2 changes: 1 addition & 1 deletion content/settings/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Zotero_Preferences.ZeNotes = {
}
this.savevalues = [];
this.tableutils = Zotero_Preferences.ZNTable;
this.defaulthiddentags = ["Id", "itemid", "key", "filekey"];
this.defaulthiddentags = ["Id", "itemid", "key", "filekey", "source"];
},

async currentcollection()
Expand Down
33 changes: 14 additions & 19 deletions core/format.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,11 @@ Format = {
}
return {
data: itemlist,
columns: ["id", "itemid", "key", "title", "date", "journal", "author", "creators", "filekey"],
columns: ["id", "itemid", "key", "title", "date", "journal", "author", "source", "creators", "filekey"],
tagged_items: Object.values(tagged_items),
}
},



async itemnotes(item)
{
var allnotes = [];
Expand Down Expand Up @@ -261,6 +260,7 @@ Format = {
date: Format.year(item),
journal: this.xmlescape(item.getField("publicationTitle")),
author: Format.creatorshort(item)+" ("+Format.year(item)+")",
source: Format.creatorshort(item)+" ("+Format.year(item)+")",
creators: Format.creators(item),
filenames: filenames,
filekey: Format.filekey(item),
Expand All @@ -270,7 +270,16 @@ Format = {
},

year(item) {
var y = item.getField("date", true).substr(0, 4);
var date;
for(type of ["date", "issueDate", "dateEnacted", "dateDecided"])
{
date = item.getField(type, true);
if(date)
{
break;
}
}
var y = date.substr(0, 4);
return y;
},

Expand Down Expand Up @@ -299,21 +308,7 @@ Format = {
},

creatorshort(item) {
var creators = item.getCreatorsJSON();
var author = "";
if(creators.length==1)
{
author = creators[0].lastName;
}
else if(creators.length==2)
{
author = creators[0].lastName+" and "+creators[1].lastName;
}
else if(creators.length>0)
{
author = creators[0].lastName+" et al."
}
return author;
return Zotero.Items.getFirstCreatorFromData(item.itemTypeID, item.getCreators());
},

creators(item) {
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.7.5</em:version>
<em:version>0.7.6</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.7.5",
"version": "0.7.6",
"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.7.5",
"update_link": "https://github.com/frianasoa/Ze-Notes/releases/download/v0.7.5/zenotes-v0.7.5.xpi",
"update_hash": "sha256:bf8cebdaa6720a60c5a053e30d8f38a81668b7e1b5eaab472853a056dd6a9cb6",
"version": "0.7.6",
"update_link": "https://github.com/frianasoa/Ze-Notes/releases/download/v0.7.6/zenotes-v0.7.6.xpi",
"update_hash": "sha256:ef93bfe98a558526fdfeec367276eb8590070a95ab309606531a7a0694501ce7",
"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.7.5</ns1:version>
<ns1:version>0.7.6</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.7.5/zenotes-v0.7.5.xpi</ns1:updateLink>
<ns1:updateLink>https://github.com/frianasoa/Ze-Notes/releases/download/v0.7.6/zenotes-v0.7.6.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.7.5/zenotes-v0.7.5.xpi</ns1:updateLink>
<ns1:updateLink>https://github.com/frianasoa/Ze-Notes/releases/download/v0.7.6/zenotes-v0.7.6.xpi</ns1:updateLink>
</rdf:Description>
</ns1:targetApplication>

Expand Down

0 comments on commit 168fb87

Please sign in to comment.