Merge branch '3.0'

Conflicts:
	chrome/content/zotero/xpcom/storage/webdav.js
	chrome/content/zotero/zoteroPane.js
	chrome/skin/default/zotero/preferences.css
This commit is contained in:
Dan Stillman 2011-12-17 16:25:58 -05:00
commit 059460a5d2
14 changed files with 119 additions and 43 deletions

View File

@ -254,9 +254,8 @@
<label value="George Mason University"/>
<label value="Fairfax, VA, USA"/>
</vbox>
<label class="subhead" value="&zotero.directors;"/>
<label class="subhead" value="&zotero.director;"/>
<vbox class="subcontent">
<label value="Dan Cohen"/>
<label value="Sean Takats"/>
</vbox>
<label class="subhead" value="&zotero.developers;"/>
@ -264,16 +263,12 @@
<label value="Dan Stillman"/>
<label value="Simon Kornblith"/>
<label value="Faolan Cheslack-Postava"/>
<label value="Fred Gibbs"/>
</vbox>
<label class="subhead" value="Community Support:"/><!-- TODO: localize -->
<vbox class="subcontent">
<label value="Debbie Maron"/>
</vbox>
<label class="subhead" value="&zotero.about.localizations;"/>
<vbox class="subcontent">
<vbox id="zotero-translators-list"/>
</vbox>
<label class="text-link" href="http://www.zotero.org/support/credits_and_acknowledgments" value="&zotero.moreCreditsAndAcknowledgements;"/>
</vbox>
<vbox id="column2">
<label class="subhead" value="Citation &amp; Bibliography Processing"/>
@ -292,10 +287,6 @@
<label class="text-link" href="http://www.dbai.tuwien.ac.at/user/pollak/webpagedump/" value="WebPageDump (snapshot code)"/>
<label class="text-link" href="http://www.foolabs.com/xpdf/" value="Xpdf (pdftotext)"/>
</vbox>
<label class="subhead" value="&zotero.executiveProducer;"/>
<vbox class="subcontent">
<label value="Roy Rosenzweig"/>
</vbox>
<label class="subhead" value="&zotero.thanks;"/>
<vbox class="subcontent">
<label class="text-link" href="http://www.mellon.org/" value="Andrew W. Mellon Foundation"/>

View File

@ -328,11 +328,9 @@ Zotero.Attachments = new function(){
// if it fails
//
// TODO: index later
var timer = Components.classes["@mozilla.org/timer;1"].
createInstance(Components.interfaces.nsITimer);
timer.initWithCallback({notify: function() {
setTimeout(function() {
Zotero.Fulltext.indexItems([itemID]);
}}, 1000, Components.interfaces.nsITimer.TYPE_ONE_SHOT);
}, 1000);
}
catch (e) {
// Clean up
@ -612,10 +610,9 @@ Zotero.Attachments = new function(){
// we'll index it later if it fails
//
// TODO: index later
var timer = Components.classes["@mozilla.org/timer;1"].
createInstance(Components.interfaces.nsITimer);
timer.initWithCallback({notify: f}, 1000,
Components.interfaces.nsITimer.TYPE_ONE_SHOT);
setTimeout(function () {
f();
}, 1000);
}
catch (e) {
// Clean up
@ -652,10 +649,9 @@ Zotero.Attachments = new function(){
Zotero.Notifier.trigger('add', 'item', itemID);
// Wait a second before indexing (see note above)
var timer = Components.classes["@mozilla.org/timer;1"].
createInstance(Components.interfaces.nsITimer);
timer.initWithCallback({notify: f}, 1000,
Components.interfaces.nsITimer.TYPE_ONE_SHOT);
setTimeout(function () {
f();
}, 1000);
}
// Caution: Take care using this itemID. The notifier may not yet have been called,

View File

@ -1366,7 +1366,8 @@ Zotero.Integration.Fields.prototype.addEditCitation = function(field, callback)
if(!session.bibliographyHasChanged) {
for(var i=0, n=citation.citationItems.length; i<n; i++) {
if(session.citationsByItemID[citation.citationItems[i].itemID].length == 1) {
if(session.citationsByItemID[citation.citationItems[i].itemID] &&
session.citationsByItemID[citation.citationItems[i].itemID].length == 1) {
session.bibliographyHasChanged = true;
break;
}

View File

@ -2148,7 +2148,7 @@ Zotero.SearchConditions = new function(){
doesNotContain: true
},
table: 'itemData',
field: 'STRFTIME("%Y", SUBSTR(value, 1, 10))',
field: 'SUBSTR(value, 1, 4)',
special: true
},

View File

@ -615,15 +615,37 @@ Zotero.Sync.Storage.Module.WebDAV = (function () {
var msg = Zotero.getString('sync.storage.error.webdav.sslCertificateError', host)
+ " " + Zotero.getString('sync.storage.error.webdav.loadURLForMoreInfo');
var e = new Zotero.Error(
msg,
0,
{
dialogText: msg,
dialogButtonText: Zotero.getString('sync.storage.error.webdav.loadURL'),
dialogButtonCallback: function () {
var zp = Zotero.getActiveZoteroPane();
zp.loadURI(channel.URI.spec, { shiftKey: true });
}
}
);
Zotero.Sync.Storage.EventManager.error(msg);
Zotero.Sync.Storage.EventManager.error(e);
}
else if ((secInfo.securityState & Ci.nsIWebProgressListener.STATE_IS_BROKEN) == Ci.nsIWebProgressListener.STATE_IS_BROKEN) {
var msg = Zotero.localeJoin([
Zotero.getString('sync.storage.error.webdav.sslConnectionError', host),
Zotero.getString('sync.storage.error.webdav.loadURLForMoreInfo')
]);
Zotero.Sync.Storage.EventManager.error(msg);
var msg = Zotero.getString('sync.storage.error.webdav.sslConnectionError', host) +
Zotero.getString('sync.storage.error.webdav.loadURLForMoreInfo');
var e = new Zotero.Error(
msg,
0,
{
dialogText: msg,
dialogButtonText: Zotero.getString('sync.storage.error.webdav.loadURL'),
dialogButtonCallback: function () {
var zp = Zotero.getActiveZoteroPane();
zp.loadURI(channel.URI.spec, { shiftKey: true });
}
}
);
Zotero.Sync.Storage.EventManager.error(e);
}
}
}

View File

@ -3328,6 +3328,8 @@ Zotero.Sync.Server.Data = new function() {
var xmlDeletedNode = doc.createElement('deleted');
var inserted = false;
var defaultLibraryID = Zotero.libraryID;
for each(var syncObject in Zotero.Sync.syncObjects) {
var Type = syncObject.singular; // 'Item'
var Types = syncObject.plural; // 'Items'
@ -3352,7 +3354,7 @@ Zotero.Sync.Server.Data = new function() {
}
var n = doc.createElement(type);
n.setAttribute('libraryID', parseInt(libraryID) ? parseInt(libraryID) : Zotero.libraryID);
n.setAttribute('libraryID', parseInt(libraryID) ? parseInt(libraryID) : defaultLibraryID);
n.setAttribute('key', key);
xmlDeletedObjectsNode.appendChild(n);
}

View File

@ -102,6 +102,62 @@ Zotero.Utilities.Internal = {
ascii.push(String.fromCharCode(tens + (tens > 9 ? 87 : 48)) + String.fromCharCode(ones + (ones > 9 ? 87 : 48)));
}
return ascii.join('');
},
/**
* Display a prompt from an error with custom buttons and a callback
*/
"errorPrompt":function(title, e) {
var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
var message, buttonText, buttonCallback;
if (e.data) {
if (e.data.dialogText) {
message = e.data.dialogText;
}
if (typeof e.data.dialogButtonText != 'undefined') {
buttonText = e.data.dialogButtonText;
buttonCallback = e.data.dialogButtonCallback;
}
}
if (!message) {
if (e.message) {
message = e.message;
}
else {
message = e;
}
}
if (typeof buttonText == 'undefined') {
buttonText = Zotero.getString('errorReport.reportError');
buttonCallback = function () {
win.ZoteroPane.reportErrors();
}
}
// If secondary button is explicitly null, just use an alert
else if (buttonText === null) {
ps.alert(null, title, message);
return;
}
var buttonFlags = ps.BUTTON_POS_0 * ps.BUTTON_TITLE_OK
+ ps.BUTTON_POS_1 * ps.BUTTON_TITLE_IS_STRING;
var index = ps.confirmEx(
null,
title,
message,
buttonFlags,
"",
buttonText,
"", null, {}
);
if (index == 1) {
setTimeout(function () { buttonCallback(); }, 1);
}
}
}

View File

@ -2643,7 +2643,7 @@ var ZoteroPane = new function()
* (e.g. meta-click == new background tab, meta-shift-click == new front tab,
* shift-click == new window, no modifier == frontmost tab
*/
function loadURI(uris, event, data) {
function loadURI(uris, event) {
if(typeof uris === "string") {
uris = [uris];
}
@ -3377,18 +3377,24 @@ var ZoteroPane = new function()
if (!externalViewer) {
var url = 'zotero://attachment/' + itemID + '/';
this.loadURI(url, event, { attachmentID: itemID});
this.loadURI(url, event);
}
else {
// Some platforms don't have nsILocalFile.launch, so we just load it and
// Some platforms don't have nsILocalFile.launch, so we just
// let the Firefox external helper app window handle it
try {
file.launch();
}
catch (e) {
Zotero.debug("launch() not supported -- passing file to loadURI()");
var fileURL = item.getLocalFileURL();
this.loadURI(fileURL);
Zotero.debug("launch() not supported -- passing file to loadUrl()");
var uri = Components.classes["@mozilla.org/network/standard-url;1"].
createInstance(Components.interfaces.nsIURI);
uri.spec = attachment.getLocalFileURL();
var nsIEPS = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"].
getService(Components.interfaces.nsIExternalProtocolService);
nsIEPS.loadUrl(uri);
}
}
}

View File

@ -1,5 +1,6 @@
<!ENTITY zotero.version "version">
<!ENTITY zotero.createdby "Created By:">
<!ENTITY zotero.director "Director:">
<!ENTITY zotero.directors "Directors:">
<!ENTITY zotero.developers "Developers:">
<!ENTITY zotero.alumni "Alumni:">
@ -7,4 +8,5 @@
<!ENTITY zotero.about.additionalSoftware "Third-Party Software and Standards:">
<!ENTITY zotero.executiveProducer "Executive Producer:">
<!ENTITY zotero.thanks "Special Thanks:">
<!ENTITY zotero.about.close "Close">
<!ENTITY zotero.about.close "Close">
<!ENTITY zotero.moreCreditsAndAcknowledgements "More Credits &amp; Acknowledgements">

View File

@ -163,7 +163,7 @@
<!ENTITY zotero.preferences.locate.description "Description">
<!ENTITY zotero.preferences.locate.name "Name">
<!ENTITY zotero.preferences.locate.locateEnginedescription "A Lookup Engine extends the capability of the Locate drop down in the Info pane. By enabling Lookup Engines in the list below they will be added to the drop down and can be used to locate resources from your library on the web.">
<!ENTITY zotero.preferences.locate.addDescription "To add a Lookup Engine that is not on the list, visit the desired search engine in your browser and select 'Add' from the Firefox Search Bar. When you reopen this preference pane you will have the option to enable the new Lookup Engine.">
<!ENTITY zotero.preferences.locate.addDescription "To add a Lookup Engine that is not on the list, visit the desired search engine in your browser and select &#34;Add&#34; from Zotero's Locate menu.">
<!ENTITY zotero.preferences.locate.restoreDefaults "Restore Defaults">
<!ENTITY zotero.preferences.charset "Character Encoding">

View File

@ -681,6 +681,7 @@ sync.storage.error.webdav.insufficientSpace = A file upload failed due to insuf
sync.storage.error.webdav.sslCertificateError = SSL certificate error connecting to %S.
sync.storage.error.webdav.sslConnectionError = SSL connection error connecting to %S.
sync.storage.error.webdav.loadURLForMoreInfo = Load your WebDAV URL in the browser for more information.
sync.storage.error.webdav.loadURL = Load WebDAV URL
sync.storage.error.zfs.personalQuotaReached1 = You have reached your Zotero File Storage quota. Some files were not uploaded. Other Zotero data will continue to sync to the server.
sync.storage.error.zfs.personalQuotaReached2 = See your zotero.org account settings for additional storage options.
sync.storage.error.zfs.groupQuotaReached1 = The group '%S' has reached its Zotero File Storage quota. Some files were not uploaded. Other Zotero data will continue to sync to the server.

View File

@ -37,7 +37,7 @@ dialog
#zotero-translators-list {
margin: .3em 0;
height: 7.3em;
height: 9em;
overflow: -moz-scrollbars-vertical;
}

View File

@ -22,7 +22,7 @@ radio[pane]
}
/* Links within messages */
description label[class=zotero-text-link], label label[class=zotero-text-link]
description label[class=zotero-text-link], label[class=zotero-text-link]
{
margin: 0;
}

View File

@ -76,7 +76,6 @@ const xpcomFilesLocal = [
'data/relations',
'data/tag',
'data/tags',
'date',
'db',
'duplicates',
'enstyle',