Scrape progress indicators for Safari and Chrome

This commit is contained in:
Simon Kornblith 2011-06-14 07:44:51 +00:00
parent 6d03286488
commit 8fe64c6d9a
2 changed files with 25 additions and 2 deletions

View file

@ -30,6 +30,7 @@
/** /**
* @namespace * @namespace
*/ */
if(!Zotero.Connector) Zotero.Connector = {};
Zotero.Connector.Types = new function() { Zotero.Connector.Types = new function() {
/** /**
* Initializes types * Initializes types
@ -77,8 +78,10 @@ Zotero.ItemTypes = new function() {
if(Zotero.isFx) { if(Zotero.isFx) {
return "chrome://zotero/skin/"+Zotero.Connector.Types["itemTypes"][idOrName].icon; return "chrome://zotero/skin/"+Zotero.Connector.Types["itemTypes"][idOrName].icon;
} else { } else if(Zotero.isChrome) {
return "images/"+Zotero.Connector.Types["itemTypes"][idOrName].icon; 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;
} }
} }
} }

View file

@ -141,6 +141,26 @@ Zotero.Connector = new function() {
}, {"Content-Type":"application/json"}); }, {"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. * Sends the XHR to execute an RPC call.
* *