use same code path for document.title and item title in toolbar

This commit is contained in:
rolux 2013-08-03 17:38:33 +00:00
parent d73dc8eb52
commit acd70661d9
2 changed files with 14 additions and 18 deletions

View file

@ -34,13 +34,7 @@ pandora.ui.item = function() {
} }
pandora.$ui.itemTitle pandora.$ui.itemTitle
.options({ .options({title: '<b>' + pandora.getItemTitle(result.data) + '</b>'})
title: '<b>' + result.data.title
+ (Ox.len(result.data.director)
? ' (' + result.data.director.join(', ') + ')'
: '')
+ (result.data.year ? ' ' + result.data.year : '') + '</b>'
})
.show(); .show();
// fixme: layers have value, subtitles has text? // fixme: layers have value, subtitles has text?

View file

@ -822,17 +822,7 @@ pandora.getClipVideos = function(clip, resolution) {
pandora.getDocumentTitle = function(itemData) { pandora.getDocumentTitle = function(itemData) {
var parts = [pandora.site.site.name]; var parts = [pandora.site.site.name];
if (itemData) { if (itemData) {
itemTitles[pandora.user.ui.item] = Ox.decodeHTMLEntities( itemTitles[pandora.user.ui.item] = Ox.decodeHTMLEntities(pandora.getItemTitle(itemData));
(itemData.title || Ox._('Untitled')) + (
Ox.len(itemData.director) || itemData.year
? ' (' + (
Ox.len(itemData.director)
? itemData.director
: [Ox._('Unknown Director')]
).join(', ') + ')'
: ''
) + (itemData.year ? ' ' + itemData.year : '')
);
} }
if (pandora.user.ui.section == 'items') { if (pandora.user.ui.section == 'items') {
if (!pandora.user.ui.item) { if (!pandora.user.ui.item) {
@ -1120,6 +1110,18 @@ pandora.getItemIdAndPosition = function() {
return ret; return ret;
} }
pandora.getItemTitle = function(itemData) {
return (itemData.title || Ox._('Untitled')) + (
Ox.len(itemData.director) || itemData.year
? ' (' + (
Ox.len(itemData.director)
? itemData.director
: [Ox._('Unknown Director')]
).join(', ') + ')'
: ''
) + (itemData.year ? ' ' + itemData.year : '')
};
pandora.getLargeClipTimelineURL = function(item, inPoint, outPoint, type, callback) { pandora.getLargeClipTimelineURL = function(item, inPoint, outPoint, type, callback) {
var fps = 25, var fps = 25,
width = Math.floor((outPoint - inPoint) * fps), width = Math.floor((outPoint - inPoint) * fps),