- Update file mod time when renaming so that new names sync
- Display file timestamp in conflict resolution box
This commit is contained in:
parent
c122764d7f
commit
5b7923c71d
3 changed files with 12 additions and 0 deletions
|
@ -51,6 +51,8 @@
|
||||||
<property name="mode" onget="return this._mode;">
|
<property name="mode" onget="return this._mode;">
|
||||||
<setter>
|
<setter>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
|
Zotero.debug("Setting mode to '" + val + "'");
|
||||||
|
|
||||||
this.editable = false;
|
this.editable = false;
|
||||||
this.displayGoButtons = false;
|
this.displayGoButtons = false;
|
||||||
this.displayURL = false;
|
this.displayURL = false;
|
||||||
|
@ -72,6 +74,7 @@
|
||||||
this.displayPages = true;
|
this.displayPages = true;
|
||||||
this.displayIndexed = true;
|
this.displayIndexed = true;
|
||||||
this.displayNote = true;
|
this.displayNote = true;
|
||||||
|
this.displayDateModified = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'edit':
|
case 'edit':
|
||||||
|
@ -84,6 +87,7 @@
|
||||||
this.displayPages = true;
|
this.displayPages = true;
|
||||||
this.displayIndexed = true;
|
this.displayIndexed = true;
|
||||||
this.displayNote = true;
|
this.displayNote = true;
|
||||||
|
this.displayDateModified = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'merge':
|
case 'merge':
|
||||||
|
@ -92,13 +96,16 @@
|
||||||
this.displayAccessed = true;
|
this.displayAccessed = true;
|
||||||
this.displayNote = true;
|
this.displayNote = true;
|
||||||
this.displayButton = true;
|
this.displayButton = true;
|
||||||
|
this.displayDateModified = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'mergeedit':
|
case 'mergeedit':
|
||||||
|
this.editable = true;
|
||||||
this.displayURL = true;
|
this.displayURL = true;
|
||||||
this.displayFileName = true;
|
this.displayFileName = true;
|
||||||
this.displayAccessed = true;
|
this.displayAccessed = true;
|
||||||
this.displayNote = true;
|
this.displayNote = true;
|
||||||
|
this.displayDateModified = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -965,6 +965,9 @@ Zotero.Attachments = new function(){
|
||||||
|
|
||||||
|
|
||||||
function getStorageDirectory(itemID) {
|
function getStorageDirectory(itemID) {
|
||||||
|
if (!itemID) {
|
||||||
|
throw ("itemID not provided in Zotero.Attachments.getStorageDirectory()");
|
||||||
|
}
|
||||||
var item = Zotero.Items.get(itemID);
|
var item = Zotero.Items.get(itemID);
|
||||||
if (!item) {
|
if (!item) {
|
||||||
throw ("Item " + itemID + " not found in Zotero.Attachments.getStorageDirectory()");
|
throw ("Item " + itemID + " not found in Zotero.Attachments.getStorageDirectory()");
|
||||||
|
|
|
@ -2531,6 +2531,8 @@ Zotero.Item.prototype.renameAttachmentFile = function(newName, overwrite) {
|
||||||
}
|
}
|
||||||
|
|
||||||
file.moveTo(null, newName);
|
file.moveTo(null, newName);
|
||||||
|
// Update mod time so the file syncs
|
||||||
|
file.lastModifiedTime = new Date();
|
||||||
this.relinkAttachmentFile(file);
|
this.relinkAttachmentFile(file);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue