From c24aad3af4479f99dc85081bc887434a476e91a5 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Wed, 20 Jul 2011 03:35:21 +0000 Subject: [PATCH] Add incompatible version message to Firefox --- .../xpcom/connector/connector_firefox.js | 46 +++++++++++++++++++ .../content/zotero/xpcom/server_connector.js | 2 +- components/zotero-service.js | 1 + 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 chrome/content/zotero/xpcom/connector/connector_firefox.js diff --git a/chrome/content/zotero/xpcom/connector/connector_firefox.js b/chrome/content/zotero/xpcom/connector/connector_firefox.js new file mode 100644 index 000000000..37f320f43 --- /dev/null +++ b/chrome/content/zotero/xpcom/connector/connector_firefox.js @@ -0,0 +1,46 @@ +/* + ***** BEGIN LICENSE BLOCK ***** + + Copyright © 2011 Center for History and New Media + George Mason University, Fairfax, Virginia, USA + http://zotero.org + + This file is part of Zotero. + + Zotero is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Zotero is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with Zotero. If not, see . + + ***** END LICENSE BLOCK ***** +*/ + +Zotero.Connector_Browser = new function() { + var _incompatibleVersionMessageShown; + + /** + * Called if Zotero version is determined to be incompatible with Standalone + */ + this.onIncompatibleStandaloneVersion = function(zoteroVersion, standaloneVersion) { + if(_incompatibleVersionMessageShown) return; + var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]. + createInstance(Components.interfaces.nsIPromptService); + ps.alert(null, + Zotero.getString("connector.error.title"), + 'Zotero '+zoteroVersion+' is incompatible with the running '+ + 'version of Zotero Standalone'+(standaloneVersion ? " ("+standaloneVersion+")" : "")+ + '. Zotero Connector will continue to operate, but functionality that relies upon '+ + 'Zotero Standalone may be unavaliable.\n\n'+ + 'Please ensure that you have installed the latest version of these components. See '+ + 'http://www.zotero.org/support/standalone for more details.'); + _incompatibleVersionMessageShown = true; + } +} \ No newline at end of file diff --git a/chrome/content/zotero/xpcom/server_connector.js b/chrome/content/zotero/xpcom/server_connector.js index 93f41dd62..8414aa803 100755 --- a/chrome/content/zotero/xpcom/server_connector.js +++ b/chrome/content/zotero/xpcom/server_connector.js @@ -426,7 +426,7 @@ Zotero.Server.Connector.IncompatibleVersion.prototype = { Zotero.Integration.activate(); var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]. createInstance(Components.interfaces.nsIPromptService); - ps.confirm(null, + ps.alert(null, Zotero.getString("connector.error.title"), Zotero.getString("integration.error.incompatibleVersion2", ["Standalone "+Zotero.version, "Connector", "2.1.999"])); diff --git a/components/zotero-service.js b/components/zotero-service.js index 08a3e3e8b..d47b08629 100644 --- a/components/zotero-service.js +++ b/components/zotero-service.js @@ -110,6 +110,7 @@ const xpcomFilesConnector = [ 'connector/translate_item', 'connector/translator', 'connector/connector', + 'connector/connector_firefox', 'connector/cachedTypes', 'connector/repo', 'connector/typeSchemaData'