update document.title for items

This commit is contained in:
rolux 2013-08-03 17:18:21 +00:00
parent caadee8ad9
commit d5e36b6296

View file

@ -819,27 +819,35 @@ pandora.getClipVideos = function(clip, resolution) {
(function() { (function() {
var itemTitles = {}; var itemTitles = {};
pandora.getDocumentTitle = function(itemTitle) { pandora.getDocumentTitle = function(itemData) {
Ox.Log('', 'ITEM TITLES', itemTitles)
if (itemTitle) {
itemTitles[pandora.user.ui.item] = itemTitle
}
var parts = [pandora.site.site.name]; var parts = [pandora.site.site.name];
if (itemData) {
itemTitles[pandora.user.ui.item] = Ox.decodeHTMLEntities(
(itemData.title || Ox._('Untitled')) + (
itemData.director || itemData.year
? ' (' + (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) {
pandora.user.ui._list && parts.push(Ox._('List {0}', [pandora.user.ui._list])); pandora.user.ui._list && parts.push(Ox._('List') + ' ' + pandora.user.ui._list);
parts.push(Ox._(Ox.toTitleCase(pandora.user.ui.listView) + ' View')); parts.push(Ox._(Ox.toTitleCase(pandora.user.ui.listView) + ' View'));
} else { } else {
parts.push(itemTitles[pandora.user.ui.item] || pandora.user.ui.item); parts.push(itemTitles[pandora.user.ui.item] || pandora.user.ui.item);
parts.push(Ox._(Ox.toTitleCase(pandora.user.ui.itemView) + ' View')); parts.push(Ox._(Ox.toTitleCase(pandora.user.ui.itemView) + ' View'));
} }
} else if (pandora.user.ui.section == 'edits') {
parts.push(pandora.user.ui.edit ? Ox._('Edit{noun}', {noun: ''}) + ' ' + pandora.user.ui.edit : Ox._('Edits'));
} else if (pandora.user.ui.section == 'texts') { } else if (pandora.user.ui.section == 'texts') {
parts.push(pandora.user.ui.text ? pandora.user.ui.text : Ox._('Texts')); parts.push(pandora.user.ui.text ? Ox._('Text') + ' ' + pandora.user.ui.text : Ox._('Texts'));
} }
return parts.join(' '); return parts.join(' ');
}; };
}()); }());
pandora.getEditTooltip = function(title) { pandora.getEditTooltip = function(title) {
return function(e) { return function(e) {
var $target = $(e.target); var $target = $(e.target);