diff --git a/pandora/0xdb.json b/pandora/0xdb.json index 2c05f3bfb..0635e285d 100644 --- a/pandora/0xdb.json +++ b/pandora/0xdb.json @@ -504,7 +504,7 @@ "icons": "posters", "infoIconSize": 256, "item": "", - "itemView": "timeline", + "itemView": "info", "list": "", "listQuery": {"conditions": [], "operator": ""}, "lists": { diff --git a/static/js/pandora.js b/static/js/pandora.js index bd43a1aae..6b8ad218e 100644 --- a/static/js/pandora.js +++ b/static/js/pandora.js @@ -162,8 +162,6 @@ Ox.load('Geo', function() { height: pandora.$ui.contentPanel.size(1), width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1 }); - //pandora.user.ui.itemView == 'frames' && pandora.$ui.item.resize(); - //pandora.user.ui.itemView == 'posters' && pandora.$ui.item.resize(); } } diff --git a/static/js/pandora/URL.js b/static/js/pandora/URL.js index fa029e136..7f63533c5 100644 --- a/static/js/pandora/URL.js +++ b/static/js/pandora/URL.js @@ -104,9 +104,11 @@ pandora.URL = (function() { } else if (pandora.user.ui.sitePage != oldUserUI.sitePage) { pandora.$ui.mainPanel.replaceElement(1, pandora.$ui.rightPanel = pandora.ui.rightPanel()); } else if (!pandora.user.ui.item || !oldUserUI.item) { + // list to list, list to item, item to list pandora.$ui.leftPanel.replaceElement(2, pandora.$ui.info = pandora.ui.info()); pandora.$ui.mainPanel.replaceElement(1, pandora.$ui.rightPanel = pandora.ui.rightPanel()); } else { + // item to items pandora.$ui.leftPanel.replaceElement(2, pandora.$ui.info = pandora.ui.info()); pandora.$ui.contentPanel.replaceElement(1, pandora.ui.item()); } @@ -115,11 +117,12 @@ pandora.URL = (function() { oldUserUI.item && ['player', 'timeline'].indexOf(oldUserUI.itemView) > -1 ) { - pandora.UI.set( + var $item = pandora.$ui[ + oldUserUI.itemView == 'player' ? 'player' : 'editor' + ]; + $item && pandora.UI.set( 'videoPosition|' + oldUserUI.item, - pandora.$ui[ - oldUserUI.itemView == 'player' ? 'player' : 'editor' - ].options('position') + $item.options('position') ); } } diff --git a/static/js/pandora/ui/browser.js b/static/js/pandora/ui/browser.js index 3066df95c..6dee507bf 100644 --- a/static/js/pandora/ui/browser.js +++ b/static/js/pandora/ui/browser.js @@ -56,7 +56,6 @@ pandora.ui.browser = function() { }; }, items: function(data, callback) { - //Ox.print('data, pandora.Query.toObject', data, pandora.Query.toObject()) pandora.api.find($.extend(data, { query: pandora.Query.toObject() }), callback); @@ -75,6 +74,7 @@ pandora.ui.browser = function() { that.scrollToSelection(); }, select: function(event, data) { + pandora.UI.set('lists|' + pandora.user.ui.list + '|selected', data.ids); pandora.URL.set(data.ids[0]); }, toggle: function(event, data) { diff --git a/static/js/pandora/ui/contentPanel.js b/static/js/pandora/ui/contentPanel.js index 2502f471c..90b4f5b05 100644 --- a/static/js/pandora/ui/contentPanel.js +++ b/static/js/pandora/ui/contentPanel.js @@ -11,7 +11,7 @@ pandora.ui.contentPanel = function() { size: pandora.user.ui.groupsSize }, { - element: pandora.$ui.list = pandora.ui.list(pandora.user.ui.lists[pandora.user.ui.list].listView) + element: pandora.$ui.list = pandora.ui.list() } ] : [ { @@ -21,7 +21,7 @@ pandora.ui.contentPanel = function() { size: 112 + Ox.UI.SCROLLBAR_SIZE }, { - element: pandora.$ui.item = pandora.ui.item(pandora.user.ui.item, pandora.user.ui.itemView) + element: pandora.$ui.item = pandora.ui.item() } ], orientation: 'vertical' diff --git a/static/js/pandora/ui/infoView.js b/static/js/pandora/ui/infoView.js index 6e9a164bd..aa09c21bd 100644 --- a/static/js/pandora/ui/infoView.js +++ b/static/js/pandora/ui/infoView.js @@ -14,6 +14,7 @@ pandora.ui.infoView = function(data) { iconWidth = iconRatio > 1 ? iconSize : Math.round(iconSize * iconRatio), iconHeight = iconRatio < 1 ? iconSize : Math.round(iconSize / iconRatio), iconLeft = iconSize == 256 ? Math.floor((iconSize - iconWidth) / 2) : 0, + borderRadius = pandora.user.ui.icons == 'posters' ? 0 : iconSize / 8, edit = false, that = Ox.Element(), uid = Ox.uid(), @@ -47,6 +48,7 @@ pandora.ui.infoView = function(data) { top: margin + 'px', width: iconWidth + 'px', height: iconHeight + 'px', + borderRadius: borderRadius + 'px', cursor: 'pointer' }) .bindEvent({ @@ -74,7 +76,8 @@ pandora.ui.infoView = function(data) { position: 'absolute', left: iconLeft + 'px', width: iconWidth + 'px', - height: iconHeight + 'px' + height: iconHeight + 'px', + borderRadius: borderRadius + 'px' }) .appendTo($reflection), $reflectionGradient = $('
') @@ -462,10 +465,12 @@ pandora.ui.infoView = function(data) { iconWidth = iconRatio > 1 ? iconSize : Math.round(iconSize * iconRatio); iconHeight = iconRatio < 1 ? iconSize : Math.round(iconSize / iconRatio); iconLeft = iconSize == 256 ? Math.floor((iconSize - iconWidth) / 2) : 0, + borderRadius = pandora.user.ui.icons == 'posters' ? 0 : iconSize / 8; $icon.animate({ left: margin + iconLeft + 'px', width: iconWidth + 'px', - height: iconHeight + 'px' + height: iconHeight + 'px', + borderRadius: borderRadius + 'px' }, 250); $reflection.animate({ top: margin + iconHeight + 'px', @@ -476,6 +481,7 @@ pandora.ui.infoView = function(data) { left: iconLeft + 'px', width: iconWidth + 'px', height: iconHeight + 'px', + borderRadius: borderRadius + 'px' }, 250); $reflectionGradient.animate({ width: iconSize + 'px', @@ -495,7 +501,7 @@ pandora.ui.infoView = function(data) { $reflectionIcon.attr({src: src}); iconSize = iconSize == 256 ? 512 : 256; iconRatio = pandora.user.ui.icons == 'posters' - ? data.poster.width / data.poster.height : 1, + ? data.poster.width / data.poster.height : 1; toggleIconSize(); pandora.user.level == 'admin' && $list.replaceWith($list = renderList()); }; diff --git a/static/js/pandora/ui/list.js b/static/js/pandora/ui/list.js index f5d9c329b..44ae09491 100644 --- a/static/js/pandora/ui/list.js +++ b/static/js/pandora/ui/list.js @@ -1,8 +1,9 @@ // vim: et:ts=4:sw=4:sts=4:ft=javascript -pandora.ui.list = function(view) { // fixme: remove view argument +pandora.ui.list = function() { // fixme: remove view argument var that, $map, - preview = false; + view = pandora.user.ui.lists[pandora.user.ui.list].listView, + preview = false //Ox.print('constructList', view); if (view == 'list') { /* @@ -72,6 +73,7 @@ pandora.ui.list = function(view) { // fixme: remove view argument } }); } else if (view == 'icons') { + //alert(JSON.stringify(pandora.user.ui.lists[pandora.user.ui.list].selected)) that = Ox.IconList({ defaultRatio: pandora.user.ui.icons == 'posters' ? 5/8 : 1, id: 'list', @@ -97,6 +99,7 @@ pandora.ui.list = function(view) { // fixme: remove view argument }), callback); }, keys: ['director', 'id', 'poster', 'title', 'year'], + selected: pandora.user.ui.lists[pandora.user.ui.list].selected, size: 128, sort: pandora.user.ui.lists[pandora.user.ui.list].sort, unique: 'id' @@ -410,7 +413,7 @@ pandora.ui.list = function(view) { // fixme: remove view argument }, select: function(event, data) { var $still, $timeline; - pandora.user.selectedMovies = data.ids; + pandora.user.ui.lists[pandora.user.ui.list].selected = data.ids; if (data.ids.length) { pandora.$ui.mainMenu.enableItem('copy'); pandora.$ui.mainMenu.enableItem('openmovie'); diff --git a/static/js/pandora/ui/rightPanel.js b/static/js/pandora/ui/rightPanel.js index 1bc25114b..026433ea5 100644 --- a/static/js/pandora/ui/rightPanel.js +++ b/static/js/pandora/ui/rightPanel.js @@ -1,4 +1,5 @@ // vim: et:ts=4:sw=4:sts=4:ft=javascript + pandora.ui.rightPanel = function() { var that; if (pandora.user.ui.section == 'site') { @@ -10,8 +11,7 @@ pandora.ui.rightPanel = function() { } }); } else { - that = Ox.Element() - .css({padding: '8px'}); + that = Ox.Element().css({padding: '8px'}); pandora.api.getPage(pandora.user.ui.sitePage, function(result) { that.html(result.data.body).css({overflowY: 'auto'}); }); @@ -36,7 +36,6 @@ pandora.ui.rightPanel = function() { }) .bindEvent({ resize: function(event, data) { - //Ox.print('???? resize rightPanel', event, data) if (!pandora.user.ui.item) { pandora.resizeGroups(data); pandora.$ui.list.size();