getSpan gets type now

This commit is contained in:
j 2013-03-02 13:00:17 +00:00
parent d6861f9171
commit f8830119e0

View file

@ -690,6 +690,9 @@ pandora.getItemByIdOrTitle = function(type, str, callback) {
}); });
} }
}); });
} else if (type == 'text') {
// /number is page for pdf or percent for html
callback(str.replace(/\/\d+$/, ''));
} else { } else {
callback(str); callback(str);
} }
@ -793,12 +796,12 @@ pandora.getListData = function(list) {
return data; return data;
}; };
pandora.getMetadataByIdOrName = function(item, view, str, callback) { pandora.getMetadataByIdOrName = function(type, item, view, str, callback) {
// For a given item (or none) and a given view (or any), this takes a string // For a given item (or none) and a given view (or any), this takes a string
// and checks if it's an annotation/event/place id or an event/place name, // and checks if it's an annotation/event/place id or an event/place name,
// and returns the id (or none) and the view (or none) // and returns the id (or none) and the view (or none)
// fixme: "subtitles:23" is still missing // fixme: "subtitles:23" is still missing
Ox.Log('URL', 'getMetadataByIdOrName', item, view, str); if (type == pandora.site.itemName.plural.toLowerCase()) {
var isName = str[0] == '@', var isName = str[0] == '@',
canBeAnnotation = ( canBeAnnotation = (
!view || Ox.contains(['player', 'editor', 'timeline'], view) !view || Ox.contains(['player', 'editor', 'timeline'], view)
@ -829,6 +832,10 @@ pandora.getMetadataByIdOrName = function(item, view, str, callback) {
}); });
} }
}); });
} else if (type == 'text') {
callback();
}
function getId(type, callback) { function getId(type, callback) {
if (type) { if (type) {
pandora.api['find' + Ox.toTitleCase(type + 's')](Ox.extend({ pandora.api['find' + Ox.toTitleCase(type + 's')](Ox.extend({