www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 8fe64c6d9ac544253ee7cb05ddd6763a8cbd1615
parent 6d032864880c754f63c59174131bc0ae7e169639
Author: Simon Kornblith <simon@simonster.com>
Date:   Tue, 14 Jun 2011 07:44:51 +0000

Scrape progress indicators for Safari and Chrome


Diffstat:
Mchrome/content/zotero/xpcom/connector/cachedTypes.js | 7+++++--
Mchrome/content/zotero/xpcom/connector/connector.js | 20++++++++++++++++++++
2 files changed, 25 insertions(+), 2 deletions(-)

diff --git 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 @@ -142,6 +142,26 @@ Zotero.Connector = new function() { } /** + * 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. * * @param {String} method RPC method. See documentation above.