Skip to content

Commit

Permalink
Merge branch 'master' into dev-rich-text-formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
domiden committed Mar 30, 2022
2 parents 53e9e5b + 3bda9b2 commit 1ad9508
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
22 changes: 14 additions & 8 deletions chrome/content/zotfile/zotfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -911,18 +911,21 @@ Zotero.ZotFile = new function() {
win.ZoteroPane.itemsView.selectItems(selection);
}
// update links to attachment file in notes
Zotero.Items.get(item.getNotes()).forEach(note => {
var notes = Zotero.Items.get(item.getNotes());
for (let note of notes) {
var content = note.getNote();
content = content.replace(new RegExp('open-pdf/([\\w\\W\\d]{1,10})_' + att.key, 'g'), 'open-pdf/$1_' + attNew.key);
note.setNote(content);
note.saveTx();
});
yield note.saveTx();
}
// transfer various attachment data
//
// should stay in sync with Zotero.Attachments.convertLinkedFileToStoredFile()
if (this.isZotero6OrLater) {
// move child annotations and embedded-image attachments
yield Zotero.Items.moveChildItems(att, attNew);
yield Zotero.DB.executeTransaction(async function () {
await Zotero.Items.moveChildItems(att, attNew);
});
// copy relations pointing to the old item
yield Zotero.Relations.copyObjectSubjectRelations(att, attNew);
// transfer full-text item index
Expand Down Expand Up @@ -975,18 +978,21 @@ Zotero.ZotFile = new function() {
win.ZoteroPane.itemsView.selectItems(selection);
}
// update links to attachment file in notes
Zotero.Items.get(item.getNotes()).forEach(note => {
var notes = Zotero.Items.get(item.getNotes());
for (let note of notes) {
var content = note.getNote();
content = content.replace(new RegExp('open-pdf/([\\w\\W\\d]{1,10})_' + att.key, 'g'), 'open-pdf/$1_' + attNew.key);
note.setNote(content);
note.saveTx();
});
yield note.saveTx();
}
// transfer various attachment data
//
// should stay in sync with Zotero.Attachments.convertLinkedFileToStoredFile()
if (this.isZotero6OrLater) {
// move child annotations and embedded-image attachments
yield Zotero.Items.moveChildItems(att, attNew);
yield Zotero.DB.executeTransaction(async function () {
await Zotero.Items.moveChildItems(att, attNew);
});
// copy relations pointing to the old item
yield Zotero.Relations.copyObjectSubjectRelations(att, attNew);
// transfer full-text item index
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>ZotFile</em:name>
<em:version>5.1.0.9000</em:version>
<em:version>5.1.1.9000</em:version>
<em:type>2</em:type>
<em:multiprocessCompatible>true</em:multiprocessCompatible>
<em:creator>Joscha Legewie</em:creator>
Expand Down
6 changes: 3 additions & 3 deletions zotfile-update.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<rdf:Seq>
<rdf:li>
<rdf:Description>
<em:version>5.1.0</em:version>
<em:version>5.1.1</em:version>
<em:targetApplication>
<rdf:Description>
<em:id>[email protected]</em:id>
<em:minVersion>5.0.0</em:minVersion>
<em:maxVersion>6.*</em:maxVersion>
<em:updateLink>https://github.com/jlegewie/zotfile/releases/download/v5.1.0/zotfile-5.1.0-fx.xpi</em:updateLink>
<em:updateLink>https://github.com/jlegewie/zotfile/releases/download/v5.1.1/zotfile-5.1.1-fx.xpi</em:updateLink>
</rdf:Description>
</em:targetApplication>

Expand All @@ -21,7 +21,7 @@
<em:id>[email protected]</em:id>
<em:minVersion>4.999</em:minVersion>
<em:maxVersion>6.*</em:maxVersion>
<em:updateLink>https://github.com/jlegewie/zotfile/releases/download/v5.1.0/zotfile-5.1.0-fx.xpi</em:updateLink>
<em:updateLink>https://github.com/jlegewie/zotfile/releases/download/v5.1.1/zotfile-5.1.1-fx.xpi</em:updateLink>
</rdf:Description>
</em:targetApplication>

Expand Down

0 comments on commit 1ad9508

Please sign in to comment.