diff --git a/chrome/content/zotero/xpcom/connector/cachedTypes.js b/chrome/content/zotero/xpcom/connector/cachedTypes.js index 740c59f5b..0c6b591f0 100644 --- a/chrome/content/zotero/xpcom/connector/cachedTypes.js +++ b/chrome/content/zotero/xpcom/connector/cachedTypes.js @@ -30,6 +30,7 @@ /** * @namespace */ +if(!Zotero.Connector) Zotero.Connector = {}; Zotero.Connector.Types = new function() { /** * Initializes types @@ -77,8 +78,10 @@ Zotero.ItemTypes = new function() { if(Zotero.isFx) { return "chrome://zotero/skin/"+Zotero.Connector.Types["itemTypes"][idOrName].icon; - } else { - return "images/"+Zotero.Connector.Types["itemTypes"][idOrName].icon; + } else if(Zotero.isChrome) { + return chrome.extension.getURL("images/"+Zotero.Connector.Types["itemTypes"][idOrName].icon); + } else if(Zotero.isSafari) { + return safari.extension.baseURI+"images/itemTypes/"+Zotero.Connector.Types["itemTypes"][idOrName].icon; } } } diff --git a/chrome/content/zotero/xpcom/connector/connector.js b/chrome/content/zotero/xpcom/connector/connector.js index bc28fa6a9..3d8a65d70 100644 --- a/chrome/content/zotero/xpcom/connector/connector.js +++ b/chrome/content/zotero/xpcom/connector/connector.js @@ -141,6 +141,26 @@ Zotero.Connector = new function() { }, {"Content-Type":"application/json"}); } + /** + * Gives callback an object containing schema and preferences from Zotero.Connector.data + */ + this.getSchemaAndPreferences = function(callback) { + if(Zotero.Connector.data) { + callback({"schema":Zotero.Connector.data["schema"], + "preferences":Zotero.Connector.data["preferences"]}); + return; + } + + this.getData(function(success) { + if(success) { + callback({"schema":Zotero.Connector.data["schema"], + "preferences":Zotero.Connector.data["preferences"]}); + return; + } + callback(false); + }); + } + /** * Sends the XHR to execute an RPC call. *