Merge revisions from branch
This commit is contained in:
parent
f10f0bc0d7
commit
8512ba8d39
|
@ -319,6 +319,7 @@ Zotero.CollectionTreeView.prototype.setHighlightedRows = function (ids) {
|
||||||
this._treebox.invalidate();
|
this._treebox.invalidate();
|
||||||
|
|
||||||
for each(var id in ids) {
|
for each(var id in ids) {
|
||||||
|
this.expandToCollection(id);
|
||||||
this._highlightedRows[this._collectionRowMap[id]] = true;
|
this._highlightedRows[this._collectionRowMap[id]] = true;
|
||||||
this._treebox.invalidateRow(this._collectionRowMap[id]);
|
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) {
|
Zotero.CollectionTreeView.prototype.collapseAllRows = function(treebox) {
|
||||||
var view = treebox.view;
|
var view = treebox.view;
|
||||||
treebox.beginUpdateBatch();
|
treebox.beginUpdateBatch();
|
||||||
|
|
|
@ -721,7 +721,15 @@ Zotero.DBConnection.prototype.backupDatabase = function (suffix) {
|
||||||
// after deleting the old backup file
|
// after deleting the old backup file
|
||||||
var tmpFile = Zotero.getZoteroDatabase(this._dbName, 'tmp');
|
var tmpFile = Zotero.getZoteroDatabase(this._dbName, 'tmp');
|
||||||
if (tmpFile.exists()) {
|
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 {
|
try {
|
||||||
|
|
|
@ -38,7 +38,7 @@ Zotero.Integration = new function() {
|
||||||
this.handleEnvelope = handleEnvelope;
|
this.handleEnvelope = handleEnvelope;
|
||||||
|
|
||||||
this.__defineGetter__("usePopup", function () {
|
this.__defineGetter__("usePopup", function () {
|
||||||
return !Zotero.isMac && !Zotero.Prefs.get("integration.realWindow");
|
return Zotero.isWin && !Zotero.Prefs.get("integration.realWindow");
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -608,10 +608,13 @@ 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.
|
switch (column.id) {
|
||||||
{
|
// Format dates as short dates in proper locale order and locale time
|
||||||
// Format date as short date in proper locale order and locale time
|
|
||||||
// (e.g. "4/4/07 14:27:23")
|
// (e.g. "4/4/07 14:27:23")
|
||||||
|
case 'zotero-items-column-dateAdded':
|
||||||
|
case 'zotero-items-column-dateModified':
|
||||||
|
case 'zotero-items-column-accessDate':
|
||||||
|
if (val) {
|
||||||
var order = Zotero.Date.getLocaleDateOrder();
|
var order = Zotero.Date.getLocaleDateOrder();
|
||||||
var date = Zotero.Date.sqlToDate(val, true);
|
var date = Zotero.Date.sqlToDate(val, true);
|
||||||
var parts = [];
|
var parts = [];
|
||||||
|
@ -634,6 +637,7 @@ Zotero.ItemTreeView.prototype.getCellText = function(row, column)
|
||||||
val += ' ' + date.toLocaleTimeString();
|
val += ' ' + date.toLocaleTimeString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1267,7 +1267,6 @@ Zotero.Utilities.HTTP = new function() {
|
||||||
var loadEvent = Zotero.isFx2 ? "load" : "pageshow";
|
var loadEvent = Zotero.isFx2 ? "load" : "pageshow";
|
||||||
|
|
||||||
var hiddenBrowser = Zotero.Browser.createHiddenBrowser();
|
var hiddenBrowser = Zotero.Browser.createHiddenBrowser();
|
||||||
hiddenBrowser.docShell.allowImages = false;
|
|
||||||
hiddenBrowser.addEventListener(loadEvent, onLoad, true);
|
hiddenBrowser.addEventListener(loadEvent, onLoad, true);
|
||||||
|
|
||||||
doLoad();
|
doLoad();
|
||||||
|
|
|
@ -595,6 +595,7 @@ var Zotero = new function(){
|
||||||
'[JavaScript Error: "this._uiElement is null',
|
'[JavaScript Error: "this._uiElement is null',
|
||||||
'Error: a._updateVisibleText is not a function',
|
'Error: a._updateVisibleText is not a function',
|
||||||
'[JavaScript Error: "Warning: unrecognized command line flag ',
|
'[JavaScript Error: "Warning: unrecognized command line flag ',
|
||||||
|
'[JavaScript Error: "Warning: unrecognized command line flag -foreground',
|
||||||
'LibX:',
|
'LibX:',
|
||||||
'function skype_',
|
'function skype_',
|
||||||
'[JavaScript Error: "uncaught exception: Permission denied to call method Location.toString"]'
|
'[JavaScript Error: "uncaught exception: Permission denied to call method Location.toString"]'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user