From eddaa672ef7692f67ffa4598536b859fc6d3f341 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 18 Jan 2012 03:37:54 -0500 Subject: [PATCH] Provide link to cert override docs in Standalone Verify Server The button wasn't opening the WebDAV URL within Standalone, and XULRunner doesn't provide the whitelist interface anyway. Documentation page still needed --- chrome/content/zotero/xpcom/storage/webdav.js | 32 ++++++++++++++----- chrome/locale/en-US/zotero/zotero.properties | 2 ++ 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/chrome/content/zotero/xpcom/storage/webdav.js b/chrome/content/zotero/xpcom/storage/webdav.js index 692fc3307..8efdff489 100644 --- a/chrome/content/zotero/xpcom/storage/webdav.js +++ b/chrome/content/zotero/xpcom/storage/webdav.js @@ -1655,18 +1655,34 @@ Zotero.Sync.Storage.Session.WebDAV.prototype._checkResponse = function (req, obj Zotero.debug(e); } - var msg = Zotero.getString('sync.storage.error.webdav.sslCertificateError', host) - + " " + Zotero.getString('sync.storage.error.webdav.loadURLForMoreInfo'); + var msg = Zotero.getString('sync.storage.error.webdav.sslCertificateError', host); + // In Standalone, provide cert_override.txt instructions and a + // button to open the Zotero profile directory + if (Zotero.isStandalone) { + msg += "\n\n" + Zotero.getString('sync.storage.error.webdav.seeCertOverrideDocumentation'); + var buttonText = Zotero.getString('general.openDocumentation'); + var func = function () { + var zp = Zotero.getActiveZoteroPane(); + zp.loadURI("http://www.zotero.org/support/kb/cert_override", { shiftKey: true }); + }; + } + // In Firefox display a button to load the WebDAV URL + else { + msg += "\n\n" + Zotero.getString('sync.storage.error.webdav.loadURLForMoreInfo'); + var buttonText = Zotero.getString('sync.storage.error.webdav.loadURL'); + var func = function () { + var zp = Zotero.getActiveZoteroPane(); + zp.loadURI(channel.URI.spec, { shiftKey: true }); + }; + } + 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 }); - } + dialogButtonText: buttonText, + dialogButtonCallback: func } ); @@ -1675,7 +1691,7 @@ Zotero.Sync.Storage.Session.WebDAV.prototype._checkResponse = function (req, obj } else if ((secInfo.securityState & Ci.nsIWebProgressListener.STATE_IS_BROKEN) == Ci.nsIWebProgressListener.STATE_IS_BROKEN) { var msg = Zotero.getString('sync.storage.error.webdav.sslConnectionError', host) + - Zotero.getString('sync.storage.error.webdav.loadURLForMoreInfo'); + "\n\n" + Zotero.getString('sync.storage.error.webdav.loadURLForMoreInfo'); var e = new Zotero.Error( msg, 0, diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties index abe84e4c1..110b292df 100644 --- a/chrome/locale/en-US/zotero/zotero.properties +++ b/chrome/locale/en-US/zotero/zotero.properties @@ -34,6 +34,7 @@ general.seeForMoreInformation = See %S for more information. general.enable = Enable general.disable = Disable general.remove = Remove +general.openDocumentation = Open Documentation general.operationInProgress = A Zotero operation is currently in progress. general.operationInProgress.waitUntilFinished = Please wait until it has finished. @@ -686,6 +687,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.seeCertOverrideDocumentation = See the certificate override documentation 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.