From 9adae80d3d4d7e58fd06e5ef315078a37ac44fe3 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 20 Jan 2012 23:40:25 +0530 Subject: [PATCH] info view/clips annotations --- static/js/pandora/clipList.js | 10 +- static/js/pandora/clipsView.js | 5 +- static/js/pandora/infoView.js | 10 +- static/js/pandora/infoView.padma.js | 436 ++++++++++++++++++---------- static/js/pandora/item.js | 10 +- static/js/pandora/itemClips.js | 34 ++- static/js/pandora/menu.js | 11 +- static/js/pandora/utils.js | 16 +- 8 files changed, 334 insertions(+), 198 deletions(-) diff --git a/static/js/pandora/clipList.js b/static/js/pandora/clipList.js index 5fb2dc3e..801f21f9 100644 --- a/static/js/pandora/clipList.js +++ b/static/js/pandora/clipList.js @@ -7,7 +7,6 @@ pandora.ui.clipList = function(videoRatio) { var ui = pandora.user.ui, fixedRatio = !ui.item ? 16/9 : videoRatio, isClipView = !ui.item ? ui.listView == 'clip' : ui.itemView == 'clips', - textKey = pandora.getClipTextKey(), that = Ox.IconList({ fixedRatio: fixedRatio, item: function(data, sort, size) { @@ -22,7 +21,9 @@ pandora.ui.clipList = function(videoRatio) { width = fixedRatio > 1 ? size : Math.round(size * fixedRatio); height = fixedRatio > 1 ? Math.round(size / fixedRatio) : size; } - title = data[textKey] ? data[textKey][0].value : ''; + title = data.annotations ? data.annotations.map(function(annotation) { + return Ox.stripTags(annotation.value); + }).join('; ') : '', url = '/' + data.id.split('/')[0] + '/' + height + 'p' + data['in'] + '.jpg'; sortKey = sort[0].key; if (['text', 'position', 'duration'].indexOf(sortKey) > -1) { @@ -80,7 +81,7 @@ pandora.ui.clipList = function(videoRatio) { }, data), callback); }, keys: Ox.merge( - ['id', 'in', 'out', textKey], + ['annotations', 'id', 'in', 'out'], !ui.item ? ['videoRatio'] : [] ), max: 1, @@ -102,7 +103,8 @@ pandora.ui.clipList = function(videoRatio) { points = { annotation: that.value(id, 'annotations')[0].id.split('/')[1], 'in': that.value(id, 'in'), - out: that.value(id, 'out') + out: that.value(id, 'out'), + position: that.value(id, 'in') }, set = { item: item, diff --git a/static/js/pandora/clipsView.js b/static/js/pandora/clipsView.js index 7cf69258..d7e7cfa1 100644 --- a/static/js/pandora/clipsView.js +++ b/static/js/pandora/clipsView.js @@ -4,8 +4,7 @@ pandora.ui.clipsView = function(videoRatio) { - var textKey = pandora.getClipTextKey(), - that = Ox.SplitPanel({ + var that = Ox.SplitPanel({ elements: [ { element: Ox.Bar({size: 24}) @@ -27,7 +26,7 @@ pandora.ui.clipsView = function(videoRatio) { .bindEvent({ submit: function(data) { pandora.UI.set('itemFind', data.value ? { - conditions: [{key: textKey, value: data.value, operator: '='}], + conditions: [{key: 'annotations', value: data.value, operator: '='}], operator: '&' } : pandora.site.user.ui.itemFind); // since this is the only way itemFind can change, diff --git a/static/js/pandora/infoView.js b/static/js/pandora/infoView.js index 881d5ba7..9b3f83b6 100644 --- a/static/js/pandora/infoView.js +++ b/static/js/pandora/infoView.js @@ -88,7 +88,8 @@ pandora.ui.infoView = function(data) { $reflectionIcon = $('') .attr({ src: '/' + data.id + '/' + ( - ui.icons == 'posters' ? 'poster' : 'icon' + ui.icons == 'posters' + ? (ui.showSitePoster ? 'siteposter' : 'poster') : 'icon' ) + '512.jpg?' + uid }) .css({ @@ -116,7 +117,6 @@ pandora.ui.infoView = function(data) { left: margin + (iconSize == 256 ? 256 : iconWidth) + margin + 'px', top: margin + 'px', right: margin + statisticsWidth + margin + 'px', - //background: 'green' }) .bindEvent(canEdit && !isEditable ? { doubleclick: reloadMetadata @@ -136,7 +136,7 @@ pandora.ui.infoView = function(data) { $browserImages = []; - pandora.createLinks($text); + pandora.createLinks($text); // FIXME: this is wrong for editables that already have clickLink // Title ------------------------------------------------------------------- @@ -211,7 +211,8 @@ pandora.ui.infoView = function(data) { var $div = $('