')
.css({marginBottom: '4px'})
@@ -349,18 +483,18 @@ pandora.ui.infoView = function(data) {
}
})
)
- .appendTo($statistics);
+ .appendTo($right);
}
- $('
').css({height: '16px'}).appendTo($statistics);
+ $('
').css({height: '16px'}).appendTo($right);
function editMetadata(key, value) {
if (value != data[key]) {
var edit = {id: data.id};
if (key == 'title') {
edit[key] = value;
- } else if(listKeys.indexOf(key) > -1) {
+ } else if (listKeys.indexOf(key) > -1) {
edit[key] = value ? value.split(', ') : [];
} else {
edit[key] = value;
@@ -368,7 +502,7 @@ pandora.ui.infoView = function(data) {
pandora.api.edit(edit, function(result) {
data[key] = value;
descriptions[key] && descriptions[key].options({
- value: result.data[key+'description']
+ value: result.data[key + 'description']
});
Ox.Request.clearCache(); // fixme: too much? can change filter/list etc
@@ -565,7 +699,10 @@ pandora.ui.infoView = function(data) {
width: iconSize + 'px',
height: iconSize / 2 + 'px'
}, 250);
- $text.animate({
+ $data.animate({
+ top: margin + iconHeight + margin + 'px'
+ }, 250);
+ $center.animate({
left: margin + (iconSize == 256 ? 256 : iconWidth) + margin + 'px',
}, 250);
pandora.UI.set({infoIconSize: iconSize});
@@ -573,9 +710,8 @@ pandora.ui.infoView = function(data) {
that.reload = function() {
var src = src = '/' + data.id + '/' + (
- ui.icons == 'posters'
- ? (ui.showSitePoster ? 'siteposter' : 'poster') : 'icon'
- ) + '512.jpg?' + Ox.uid()
+ ui.icons == 'posters' ? 'poster' : 'icon'
+ ) + '512.jpg?' + Ox.uid();
$icon.attr({src: src});
$reflectionIcon.attr({src: src});
iconSize = iconSize == 256 ? 512 : 256;
@@ -586,9 +722,7 @@ pandora.ui.infoView = function(data) {
};
that.resize = function() {
- var height = pandora.$ui.contentPanel.size(1);
- $list && $list.css({height: height + 'px'});
- $data.css({height: height + 'px'});
+
};
that.bindEvent({
diff --git a/static/js/pandora/item.js b/static/js/pandora/item.js
index f3a7b53b..2ab7d3af 100644
--- a/static/js/pandora/item.js
+++ b/static/js/pandora/item.js
@@ -167,11 +167,8 @@ pandora.ui.item = function() {
pandora.UI.set({annotationsSort: data.sort});
},
find: function(data) {
- var textKey = Ox.getObjectById(pandora.site.layers, 'subtitles')
- ? 'subtitles'
- : 'annotations';
pandora.UI.set('itemFind', data.find ? {
- conditions: [{key: textKey, value: data.find, operator: '='}],
+ conditions: [{key: 'annotations', value: data.find, operator: '='}],
operator: '&'
} : pandora.site.user.ui.itemFind);
},
@@ -319,11 +316,8 @@ pandora.ui.item = function() {
});
},
find: function(data) {
- var textKey = Ox.getObjectById(pandora.site.layers, 'subtitles')
- ? 'subtitles'
- : 'annotations';
pandora.UI.set('itemFind', data.find ? {
- conditions: [{key: textKey, value: data.find, operator: '='}],
+ conditions: [{key: 'annotations', value: data.find, operator: '='}],
operator: '&'
} : pandora.site.user.ui.itemFind);
},
diff --git a/static/js/pandora/itemClips.js b/static/js/pandora/itemClips.js
index 27b80aa3..1a231ef8 100644
--- a/static/js/pandora/itemClips.js
+++ b/static/js/pandora/itemClips.js
@@ -3,7 +3,6 @@
pandora.ui.itemClips = function(options) {
var self = {},
- textKey = pandora.getClipTextKey(),
that = Ox.Element()
.css({
height: '192px',
@@ -27,20 +26,24 @@ pandora.ui.itemClips = function(options) {
self.options.clips.forEach(function(clip, i) {
Ox.Log('', 'CLIP', clip)
- var id = self.options.id + '/' + clip['in'],
- title = Ox.map(clip.annotations, function(annotation) {
- if(textKey == 'subtitles') {
- return annotation.layer == 'subtitles' ? annotation.value : 0;
- }
- return annotation.value;
+ var annotations = clip.annotations.sort(function(a, b) {
+ var layerA = pandora.site.clipLayers.indexOf(a.layer),
+ layerB = pandora.site.clipLayers.indexOf(b.layer);
+ return layerA < layerB ? -1
+ : layerA > layerB ? 1
+ : a.value < b.value ? -1
+ : a.value > b.value ? 1
+ : 0;
}),
url = '/' + self.options.id + '/' + self.height + 'p' + clip['in'] + '.jpg',
$item = Ox.IconItem({
imageHeight: self.height,
imageWidth: self.width,
- id: id,
+ id: clip.id,
info: Ox.formatDuration(clip['in']) + ' - ' + Ox.formatDuration(clip.out),
- title: title[0] || '',
+ title: annotations.map(function(annotation) {
+ return Ox.stripTags(annotation.value);
+ }).join('; '),
url: url,
})
.addClass('OxInfoIcon')
@@ -50,13 +53,15 @@ pandora.ui.itemClips = function(options) {
: i == self.options.clips.length - 1 ? '2px -2px 2px 2px'
: '2px'
})
- .data({'in': clip['in'], out: clip.out});
+ .data(Ox.extend(annotations.length ? {
+ annotation: annotations[0].id.split('/')[1],
+ } : {}, {'in': clip['in'], out: clip.out}));
$item.$element.find('.OxTarget').addClass('OxSpecialTarget');
that.append($item);
});
function doubleclick(data) {
- var $item, $target = $(data.target), item, points, set;
+ var $item, $target = $(data.target), annotation, item, points, set;
if ($target.parent().parent().is('.OxSpecialTarget')) {
// for videos, the click registers deeper inside
$target = $target.parent().parent();
@@ -64,13 +69,16 @@ pandora.ui.itemClips = function(options) {
if ($target.is('.OxSpecialTarget')) {
$item = $target.parent().parent();
item = self.options.id;
+ annotation = $item.data('annotation');
points = [$item.data('in'), $item.data('out')];
set = {};
- set['videoPoints.' + item] = {
+ set['videoPoints.' + item] = Ox.extend(annotation ? {
+ annotation: annotation
+ } : {}, {
'in': points[0],
out: points[1],
position: points[0]
- };
+ });
pandora.UI.set(set);
}
}
diff --git a/static/js/pandora/menu.js b/static/js/pandora/menu.js
index df62f546..b570a5f3 100644
--- a/static/js/pandora/menu.js
+++ b/static/js/pandora/menu.js
@@ -226,10 +226,13 @@ pandora.ui.mainMenu = function() {
}
},
click: function(data) {
- if ([
- 'home', 'about', 'news', 'tour', 'faq', 'terms', 'rights', 'contact', 'software',
- 'signup', 'signin', 'signout', 'preferences', 'tv', 'help'
- ].indexOf(data.id) > -1) {
+ if (Ox.merge(
+ ['home', 'software'],
+ pandora.site.sitePages.map(function(page) {
+ return page.id;
+ }),
+ ['signup', 'signin', 'signout', 'preferences', 'tv', 'help']
+ ).indexOf(data.id) > 1) {
pandora.UI.set({page: data.id});
} else if ([
'newlist', 'newlistfromselection', 'newsmartlist', 'newsmartlistfromresults'
diff --git a/static/js/pandora/utils.js b/static/js/pandora/utils.js
index b480668e..460d3c59 100644
--- a/static/js/pandora/utils.js
+++ b/static/js/pandora/utils.js
@@ -247,7 +247,7 @@ pandora.enableDragAndDrop = function($list, canMove) {
},
draganddroppause: function(data) {
var event = data._event, scroll,
- $parent, $grandparent, $panel, $bar, title;
+ $parent, $grandparent, $panel, title;
// fixme: should be named showLists in the user ui prefs!
if (!pandora.user.ui.showSidebar) {
if (event.clientX < 16 && event.clientY >= 44
@@ -261,10 +261,12 @@ pandora.enableDragAndDrop = function($list, canMove) {
$panel = $parent.is('.OxCollapsePanel') ? $parent
: $grandparent.is('.OxCollapsePanel') ? $grandparent : null;
if ($panel) {
- $bar = $panel.children('.OxBar');
- title = $bar.children('.OxTitle')
+ title = $panel.children('.OxBar').children('.OxTitle')
.html().split(' ')[0].toLowerCase();
- !pandora.user.ui.showFolder.items[title] && $bar.trigger('dblclick');
+ // !pandora.user.ui.showFolder.items[title] && $bar.trigger('dblclick');
+ if (!pandora.user.ui.showFolder.items[title]) {
+ Ox.UI.elements[$panel.data('oxid')].options({collapsed: false});
+ }
}
if (!scrollInterval) {
//Ox.Log('', 'AT TOP', isAtListsTop(event), 'AT BOTTOM', isAtListsBottom(event))
@@ -496,12 +498,6 @@ pandora.getClipsQuery = function() {
return clipsQuery;
};
-pandora.getClipTextKey = function() {
- return Ox.getObjectById(pandora.site.layers, 'subtitles')
- ? 'subtitles'
- : 'annotations';
-};
-
(function() {
var itemTitles = {};
pandora.getDocumentTitle = function(itemTitle) {