remove abstracted data layer calls

This commit is contained in:
Simon Kornblith 2010-11-05 03:10:56 +00:00
parent 925bc7ca5b
commit 3c28e25eab

View file

@ -513,15 +513,11 @@ Zotero.Utilities = {
* @type Boolean * @type Boolean
*/ */
"itemTypeExists":function(type) { "itemTypeExists":function(type) {
if(Zotero.isConnector) {
return !!Zotero.Connector.Data.itemTypes[type];
} else {
if(Zotero.ItemTypes.getID(type)) { if(Zotero.ItemTypes.getID(type)) {
return true; return true;
} else { } else {
return false; return false;
} }
}
}, },
/** /**
@ -531,16 +527,12 @@ Zotero.Utilities = {
* @return {String[]} Creator types * @return {String[]} Creator types
*/ */
"getCreatorsForType":function(type) { "getCreatorsForType":function(type) {
if(Zotero.isConnector) {
return Zotero.Connector.Data.itemTypes[type].creatorTypes.slice(0);
} else {
var types = Zotero.CreatorTypes.getTypesForItemType(Zotero.ItemTypes.getID(type)); var types = Zotero.CreatorTypes.getTypesForItemType(Zotero.ItemTypes.getID(type));
var cleanTypes = new Array(); var cleanTypes = new Array();
for(var i=0; i<types.length; i++) { for(var i=0; i<types.length; i++) {
cleanTypes.push(types[i].name); cleanTypes.push(types[i].name);
} }
return cleanTypes; return cleanTypes;
}
}, },
/** /**
@ -550,11 +542,7 @@ Zotero.Utilities = {
* @return {String[]} Creator types * @return {String[]} Creator types
*/ */
"fieldIsValidForType":function(field, type) { "fieldIsValidForType":function(field, type) {
if(Zotero.isConnector) {
return Zotero.Connector.Data.itemTypes[type].fields.slice(0);
} else {
return Zotero.ItemFields.isValidForType(field, Zotero.ItemTypes.getID(type)); return Zotero.ItemFields.isValidForType(field, Zotero.ItemTypes.getID(type));
}
}, },
/** /**
@ -565,17 +553,13 @@ Zotero.Utilities = {
* @type Boolean * @type Boolean
*/ */
"getLocalizedCreatorType":function(type) { "getLocalizedCreatorType":function(type) {
if(Zotero.isConnector) {
return Zotero.Connector.Data.creatorTypes[type].localizedString;
} else {
try { try {
return Zotero.getString("creatorTypes."+type); return Zotero.CreatorTypes.getLocalizedString(type);
} catch(e) { } catch(e) {
return false; return false;
} }
} }
} }
}
/** /**
* @class All functions accessible from within Zotero.Utilities namespace inside sandboxed * @class All functions accessible from within Zotero.Utilities namespace inside sandboxed