Merge revisions from branch

This commit is contained in:
Dan Stillman 2008-12-29 07:57:20 +00:00
parent f10f0bc0d7
commit 8512ba8d39
6 changed files with 64 additions and 25 deletions

View file

@ -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();

View file

@ -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 {

View file

@ -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");
});
/*

View file

@ -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;

View file

@ -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();

View file

@ -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"]'