remove abstracted data layer calls
This commit is contained in:
parent
925bc7ca5b
commit
3c28e25eab
1 changed files with 13 additions and 29 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue