diff --git a/chrome/content/zotero/xpcom/collectionTreeView.js b/chrome/content/zotero/xpcom/collectionTreeView.js index 4ccd1a26f9..2d6e4520b0 100644 --- a/chrome/content/zotero/xpcom/collectionTreeView.js +++ b/chrome/content/zotero/xpcom/collectionTreeView.js @@ -319,6 +319,7 @@ Zotero.CollectionTreeView.prototype.setHighlightedRows = function (ids) { this._treebox.invalidate(); for each(var id in ids) { + this.expandToCollection(id); this._highlightedRows[this._collectionRowMap[id]] = true; this._treebox.invalidateRow(this._collectionRowMap[id]); } @@ -468,6 +469,32 @@ Zotero.CollectionTreeView.prototype.expandAllRows = function(treebox) { } +Zotero.CollectionTreeView.prototype.expandToCollection = function(collectionID) { + var col = Zotero.Collections.get(collectionID); + if (!col) { + Zotero.debug("Cannot expand to nonexistent collection " + collectionID, 2); + return false; + } + var row = this._collectionRowMap[collectionID]; + if (row) { + return true; + } + var path = []; + var parent; + while (parent = col.getParent()) { + path.unshift(parent); + col = Zotero.Collections.get(parent); + } + for each(var id in path) { + row = this._collectionRowMap[id]; + if (!this.isContainerOpen(row)) { + this.toggleOpenState(row); + } + } + return true; +} + + Zotero.CollectionTreeView.prototype.collapseAllRows = function(treebox) { var view = treebox.view; treebox.beginUpdateBatch(); diff --git a/chrome/content/zotero/xpcom/db.js b/chrome/content/zotero/xpcom/db.js index b0fd3b7b87..c6d2713843 100644 --- a/chrome/content/zotero/xpcom/db.js +++ b/chrome/content/zotero/xpcom/db.js @@ -721,7 +721,15 @@ Zotero.DBConnection.prototype.backupDatabase = function (suffix) { // after deleting the old backup file var tmpFile = Zotero.getZoteroDatabase(this._dbName, 'tmp'); if (tmpFile.exists()) { - tmpFile.remove(null); + try { + tmpFile.remove(false); + } + catch (e) { + if (e.name == 'NS_ERROR_FILE_ACCESS_DENIED') { + alert("Cannot delete " + tmpFile.leafName); + } + throw (e); + } } try { diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js index c3d86790d4..16da290aa7 100644 --- a/chrome/content/zotero/xpcom/integration.js +++ b/chrome/content/zotero/xpcom/integration.js @@ -38,7 +38,7 @@ Zotero.Integration = new function() { this.handleEnvelope = handleEnvelope; this.__defineGetter__("usePopup", function () { - return !Zotero.isMac && !Zotero.Prefs.get("integration.realWindow"); + return Zotero.isWin && !Zotero.Prefs.get("integration.realWindow"); }); /* diff --git a/chrome/content/zotero/xpcom/itemTreeView.js b/chrome/content/zotero/xpcom/itemTreeView.js index bc00fdb9de..85dcabec90 100644 --- a/chrome/content/zotero/xpcom/itemTreeView.js +++ b/chrome/content/zotero/xpcom/itemTreeView.js @@ -608,31 +608,35 @@ Zotero.ItemTreeView.prototype.getCellText = function(row, column) } } - if(column.id == 'zotero-items-column-dateAdded' || column.id == 'zotero-items-column-dateModified') //this is not so much that we will use this format for date, but a simple template for later revisions. - { - // Format date as short date in proper locale order and locale time + switch (column.id) { + // Format dates as short dates in proper locale order and locale time // (e.g. "4/4/07 14:27:23") - var order = Zotero.Date.getLocaleDateOrder(); - var date = Zotero.Date.sqlToDate(val, true); - var parts = []; - for (var i=0; i<3; i++) { - switch (order[i]) { - case 'y': - parts.push(date.getFullYear().toString().substr(2)); - break; + case 'zotero-items-column-dateAdded': + case 'zotero-items-column-dateModified': + case 'zotero-items-column-accessDate': + if (val) { + var order = Zotero.Date.getLocaleDateOrder(); + var date = Zotero.Date.sqlToDate(val, true); + var parts = []; + for (var i=0; i<3; i++) { + switch (order[i]) { + case 'y': + parts.push(date.getFullYear().toString().substr(2)); + break; + + case 'm': + parts.push((date.getMonth() + 1)); + break; + + case 'd': + parts.push(date.getDate()); + break; + } - case 'm': - parts.push((date.getMonth() + 1)); - break; - - case 'd': - parts.push(date.getDate()); - break; + val = parts.join('/'); + val += ' ' + date.toLocaleTimeString(); + } } - - val = parts.join('/'); - val += ' ' + date.toLocaleTimeString(); - } } return val; diff --git a/chrome/content/zotero/xpcom/utilities.js b/chrome/content/zotero/xpcom/utilities.js index 13423eb9df..3e84aa4990 100644 --- a/chrome/content/zotero/xpcom/utilities.js +++ b/chrome/content/zotero/xpcom/utilities.js @@ -1267,7 +1267,6 @@ Zotero.Utilities.HTTP = new function() { var loadEvent = Zotero.isFx2 ? "load" : "pageshow"; var hiddenBrowser = Zotero.Browser.createHiddenBrowser(); - hiddenBrowser.docShell.allowImages = false; hiddenBrowser.addEventListener(loadEvent, onLoad, true); doLoad(); diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index 2561b1a921..5641a76138 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -595,6 +595,7 @@ var Zotero = new function(){ '[JavaScript Error: "this._uiElement is null', 'Error: a._updateVisibleText is not a function', '[JavaScript Error: "Warning: unrecognized command line flag ', + '[JavaScript Error: "Warning: unrecognized command line flag -foreground', 'LibX:', 'function skype_', '[JavaScript Error: "uncaught exception: Permission denied to call method Location.toString"]'