commit 4e0da80afce9f538306f79bfcf6ca55447e4d926
parent 4dcaf2907f183eec04a3be44a8bff638c35089a4
Author: Simon Kornblith <simon@simonster.com>
Date: Tue, 19 Jul 2011 22:21:19 +0000
Show incompatible version dialog in Standalone if connector is outdated
Diffstat:
2 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/chrome/content/zotero/xpcom/server_connector.js b/chrome/content/zotero/xpcom/server_connector.js
@@ -409,5 +409,26 @@ Zotero.Server.Connector.Ping.prototype = {
// XXX For compatibility with older connectors; to be removed
-Zotero.Server.Endpoints["/translate/list"] = Zotero.Server.Connector.GetTranslators;
-Zotero.Server.Endpoints["/translate/save"] = Zotero.Server.Connector.SavePage;
-\ No newline at end of file
+Zotero.Server.Connector.IncompatibleVersion = function() {};
+Zotero.Server.Connector.IncompatibleVersion._errorShown = false
+Zotero.Server.Endpoints["/translate/list"] = Zotero.Server.Connector.IncompatibleVersion;
+Zotero.Server.Endpoints["/translate/detect"] = Zotero.Server.Connector.IncompatibleVersion;
+Zotero.Server.Endpoints["/translate/save"] = Zotero.Server.Connector.IncompatibleVersion;
+Zotero.Server.Endpoints["/translate/select"] = Zotero.Server.Connector.IncompatibleVersion;
+Zotero.Server.Connector.IncompatibleVersion.prototype = {
+ "supportedMethods":["POST"],
+ "supportedDataTypes":["application/json"],
+
+ "init":function(postData, sendResponseCallback) {
+ sendResponseCallback(404);
+ if(Zotero.Server.Connector.IncompatibleVersion._errorShown) return;
+
+ var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].
+ createInstance(Components.interfaces.nsIPromptService);
+ ps.confirm(null,
+ Zotero.getString("connector.error.title"),
+ Zotero.getString("integration.error.incompatibleVersion2",
+ ["Standalone "+Zotero.version, "Connector", "2.1.999"]));
+ Zotero.Server.Connector.IncompatibleVersion._errorShown = true;
+ }
+};
+\ No newline at end of file
diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties
@@ -733,4 +733,5 @@ locate.manageLocateEngines = Manage Lookup Engines…
standalone.corruptInstallation = Your Zotero Standalone installation appears to be corrupted due to a failed auto-update. While Zotero may continue to function, to avoid potential bugs, please download the latest version of Zotero Standalone from http://zotero.org/support/standalone as soon as possible.
+connector.error.title = Zotero Connector Error
connector.standaloneOpen = Your database cannot be accessed because Zotero Standalone is currently open. Please view your items in Zotero Standalone.
\ No newline at end of file