From b6955d743e3567b633c60d72c4a070cbe817b677 Mon Sep 17 00:00:00 2001 From: rolux Date: Sun, 14 Jul 2013 15:36:49 +0000 Subject: [PATCH] use UI.set({k: v}) --- static/js/pandora/allItems.js | 2 +- static/js/pandora/clipList.js | 4 ++-- static/js/pandora/clipsView.js | 2 +- static/js/pandora/editPanel.js | 27 +++++++++++++++------------ static/js/pandora/editor.js | 20 ++++++++++---------- static/js/pandora/filter.js | 2 +- static/js/pandora/findElement.js | 2 +- static/js/pandora/infoView.0xdb.js | 22 +++++++++++----------- static/js/pandora/mainMenu.js | 8 ++++---- static/js/pandora/namesDialog.js | 4 ++-- static/js/pandora/navigationView.js | 4 ++-- static/js/pandora/player.js | 24 ++++++++++++------------ static/js/pandora/sortMenu.js | 8 ++++---- static/js/pandora/timeline.js | 16 ++++++++-------- static/js/pandora/titlesDialog.js | 4 ++-- static/js/pandora/tv.js | 15 +++++++-------- 16 files changed, 83 insertions(+), 81 deletions(-) diff --git a/static/js/pandora/allItems.js b/static/js/pandora/allItems.js index 85ae0c3f..4ad1d911 100644 --- a/static/js/pandora/allItems.js +++ b/static/js/pandora/allItems.js @@ -15,7 +15,7 @@ pandora.ui.allItems = function() { click: function() { that.gainFocus(); if (pandora.user.ui.section == 'items') { - pandora.user.ui._list && pandora.UI.set('find', {conditions: [], operator: '&'}); + pandora.user.ui._list && pandora.UI.set({find: {conditions: [], operator: '&'}}); } else { pandora.UI.set(pandora.user.ui.section.slice(0, -1), ''); } diff --git a/static/js/pandora/clipList.js b/static/js/pandora/clipList.js index 1ec0cb1c..c03b04c2 100644 --- a/static/js/pandora/clipList.js +++ b/static/js/pandora/clipList.js @@ -238,11 +238,11 @@ pandora.ui.clipList = function(videoRatio) { }, 300); //*/ } - !ui.item && pandora.UI.set('listSelection', [item]); + !ui.item && pandora.UI.set({listSelection: [item]}); !isEmbed && pandora.$ui.mainMenu.enableItem('findsimilar'); } else { $('.OxSelectedVideo').removeClass('OxSelectedVideo'); - !ui.item && pandora.UI.set('listSelection', []); + !ui.item && pandora.UI.set({listSelection: []}); !isEmbed && pandora.$ui.mainMenu.disableItem('findsimilar'); } }, diff --git a/static/js/pandora/clipsView.js b/static/js/pandora/clipsView.js index f914237c..8cdf92f6 100644 --- a/static/js/pandora/clipsView.js +++ b/static/js/pandora/clipsView.js @@ -38,7 +38,7 @@ pandora.ui.clipsView = function(videoRatio) { .bindEvent({ submit: function(data) { $status.html(Ox._('Loading...')); - pandora.UI.set('itemFind', data.value); + pandora.UI.set({itemFind: data.value}); // since this is the only way itemFind can change, // there's no need for an event handler that.replaceElement(1, diff --git a/static/js/pandora/editPanel.js b/static/js/pandora/editPanel.js index 50aee4df..6d94bcb0 100644 --- a/static/js/pandora/editPanel.js +++ b/static/js/pandora/editPanel.js @@ -126,6 +126,9 @@ pandora.ui.editPanel = function() { }); }); }, + loop: function(data) { + pandora.UI.set({videoLoop: data.loop}); + }, move: function(data) { pandora.api.orderClips({ edit: edit.id, @@ -136,7 +139,7 @@ pandora.ui.editPanel = function() { }); }, muted: function(data) { - pandora.UI.set('videoMuted', data.muted); + pandora.UI.set({videoMuted: data.muted}); }, open: function(data) { pandora.UI.set(editPointsKey('clip'), data.ids[0]); @@ -180,19 +183,19 @@ pandora.ui.editPanel = function() { that.options({width: data.size}); }, resizeclips: function(data) { - pandora.UI.set('clipsSize', data.clipsSize); + pandora.UI.set({clipsSize: data.clipsSize}); }, resolution: function(data) { - pandora.UI.set('videoResolution', data.resolution); + pandora.UI.set({videoResolution: data.resolution}); }, scale: function(data) { - pandora.UI.set('videoScale', data.scale); + pandora.UI.set({videoScale: data.scale}); }, size: function(data) { - pandora.UI.set('clipSize', data.size); + pandora.UI.set({clipSize: data.size}); }, sort: function(data) { - pandora.UI.set('clipSort', data); + pandora.UI.set({clipSort: data}); var key = data[0].key; if (key == 'position') { key = 'in'; @@ -217,22 +220,22 @@ pandora.ui.editPanel = function() { } }, subtitles: function(data) { - pandora.UI.set('videoSubtitles', data.subtitles); + pandora.UI.set({videoSubtitles: data.subtitles}); }, timeline: function(data) { - pandora.UI.set('videoTimeline', data.timeline); + pandora.UI.set({videoTimeline: data.timeline}); }, toggleclips: function(data) { - pandora.UI.set('showClips', data.showClips); + pandora.UI.set({showClips: data.showClips}); }, toggletimeline: function(data) { - pandora.UI.set('showTimeline', data.showTimeline); + pandora.UI.set({showTimeline: data.showTimeline}); }, view: function(data) { - pandora.UI.set('clipView', data.view); + pandora.UI.set({clipView: data.view}); }, volume: function(data) { - pandora.UI.set('videoVolume', data.volume); + pandora.UI.set({videoVolume: data.volume}); }, pandora_showclips: function(data) { that.options({showClips: data.value}); diff --git a/static/js/pandora/editor.js b/static/js/pandora/editor.js index a3999034..7e89d8b3 100644 --- a/static/js/pandora/editor.js +++ b/static/js/pandora/editor.js @@ -163,7 +163,7 @@ pandora.ui.editor = function(data) { pandora.$ui.embedVideoDialog = pandora.ui.embedVideoDialog().open(); }, find: function(data) { - pandora.UI.set('itemFind', data.find); + pandora.UI.set({itemFind: data.find}); }, findannotations: function(data) { pandora.UI.set({ @@ -184,7 +184,7 @@ pandora.ui.editor = function(data) { ).open(); }, muted: function(data) { - pandora.UI.set('videoMuted', data.muted); + pandora.UI.set({videoMuted: data.muted}); }, playing: function(data) { pandora.UI.set( @@ -244,34 +244,34 @@ pandora.ui.editor = function(data) { that.options({height: data.size}); }, resizecalendar: function(data) { - pandora.UI.set('annotationsCalendarSize', data.size); + pandora.UI.set({annotationsCalendarSize: data.size}); }, resizemap: function(data) { - pandora.UI.set('annotationsMapSize', data.size); + pandora.UI.set({annotationsMapSize: data.size}); }, resolution: function(data) { - pandora.UI.set('videoResolution', data.resolution); + pandora.UI.set({videoResolution: data.resolution}); }, select: function(data) { pandora.UI.set('videoPoints.' + ui.item + '.annotation', data.id.split('/')[1]); }, subtitles: function(data) { - pandora.UI.set('videoSubtitles', data.subtitles); + pandora.UI.set({videoSubtitles: data.subtitles}); }, timeline: function(data) { - pandora.UI.set('videoTimeline', data.timeline); + pandora.UI.set({videoTimeline: data.timeline}); }, toggleannotations: function(data) { - pandora.UI.set('showAnnotations', data.showAnnotations); + pandora.UI.set({showAnnotations: data.showAnnotations}); }, togglecalendar: function(data) { - pandora.UI.set('showAnnotationsCalendar', !data.collapsed); + pandora.UI.set({showAnnotationsCalendar: !data.collapsed}); }, togglelayer: function(data) { pandora.UI.set('showLayers.' + data.layer, !data.collapsed); }, togglemap: function(data) { - pandora.UI.set('showAnnotationsMap', !data.collapsed); + pandora.UI.set({showAnnotationsMap: !data.collapsed}); }, togglesize: function(data) { pandora.UI.set({videoSize: data.size}); diff --git a/static/js/pandora/filter.js b/static/js/pandora/filter.js index 6f2e439c..d7d5536e 100644 --- a/static/js/pandora/filter.js +++ b/static/js/pandora/filter.js @@ -162,7 +162,7 @@ pandora.ui.filter = function(id) { } } } - pandora.UI.set('find', find); + pandora.UI.set({find: find}); pandora.$ui.filters.updateMenus(); }, sort: function(data) { diff --git a/static/js/pandora/findElement.js b/static/js/pandora/findElement.js index 9f3ee14f..4275c863 100644 --- a/static/js/pandora/findElement.js +++ b/static/js/pandora/findElement.js @@ -105,7 +105,7 @@ pandora.ui.findElement = function() { operator: '=' }] : [] ); - pandora.UI.set('find', {conditions: conditions, operator: '&'}); + pandora.UI.set({find: {conditions: conditions, operator: '&'}}); } }) ]), diff --git a/static/js/pandora/infoView.0xdb.js b/static/js/pandora/infoView.0xdb.js index e95979fd..29f90abe 100644 --- a/static/js/pandora/infoView.0xdb.js +++ b/static/js/pandora/infoView.0xdb.js @@ -569,10 +569,10 @@ pandora.ui.infoView = function(data) { .css({textAlign: 'right', cursor: 'pointer'}) .bind({ click: function() { - pandora.UI.set('listSort', [{ + pandora.UI.set({listSort: [{ key: key, operator: pandora.getSortOperator(key) - }]); + }]}); } }) ) @@ -596,10 +596,10 @@ pandora.ui.infoView = function(data) { ) .bind({ click: function() { - pandora.UI.set('listSort', [{ + pandora.UI.set({listSort: [{ key: key, operator: pandora.getSortOperator(key) - }]); + }]}); } }) ) @@ -618,10 +618,10 @@ pandora.ui.infoView = function(data) { .css({textAlign: 'right', cursor: 'pointer'}) .bind({ click: function() { - pandora.UI.set('listSort', [{ + pandora.UI.set({listSort: [{ key: key, operator: pandora.getSortOperator(key) - }]); + }]}); } }) ) @@ -643,10 +643,10 @@ pandora.ui.infoView = function(data) { .html(Ox.formatNumber(value, 3)) .bind({ click: function() { - pandora.UI.set('listSort', [{ + pandora.UI.set({listSort: [{ key: key, operator: pandora.getSortOperator(key) - }]); + }]}); } }) ) @@ -697,7 +697,7 @@ pandora.ui.infoView = function(data) { if (canEdit) { $icon.bindEvent({ doubleclick: function() { - pandora.UI.set('showIconBrowser', !ui.showIconBrowser); + pandora.UI.set({showIconBrowser: !ui.showIconBrowser}); $info.animate({ left: ui.showIconBrowser ? 0 : -listWidth + 'px' }, 250); @@ -1053,10 +1053,10 @@ pandora.ui.infoView = function(data) { }) .bind({ click: function() { - pandora.UI.set('listSort', [{ + pandora.UI.set({listSort: [{ key: 'rightslevel', operator: pandora.getSortOperator('rightslevel') - }]); + }]}); } }) .appendTo($rightsLevel); diff --git a/static/js/pandora/mainMenu.js b/static/js/pandora/mainMenu.js index 24b424a1..3f8b2816 100644 --- a/static/js/pandora/mainMenu.js +++ b/static/js/pandora/mainMenu.js @@ -230,7 +230,7 @@ pandora.ui.mainMenu = function() { var value = data.checked[0] ? data.checked[0].id : null; if (data.id == 'allitems') { if (data.checked) { - pandora.UI.set('find', {conditions: [], operator: '&'}); + pandora.UI.set({find: {conditions: [], operator: '&'}}); } else { that.checkItem('allitems'); } @@ -284,14 +284,14 @@ pandora.ui.mainMenu = function() { filters[index].sort[0].operator = operator; pandora.UI.set({filters: filters}); } else if (data.id == 'setlocale') { - pandora.UI.set('locale', value); + pandora.UI.set({locale: value}); pandora.setLocale(value, function() { pandora.$ui.appPanel.reload(); }); } else if (data.id == 'settheme') { var iframe, src; Ox.Theme(value); - pandora.UI.set('theme', value); + pandora.UI.set({theme: value}); iframe = Ox.UI.elements[$('#embed').data('oxid')]; if (iframe) { src = iframe.attr('src'); @@ -300,7 +300,7 @@ pandora.ui.mainMenu = function() { } } } else if (data.id == 'showsiteposters') { - pandora.UI.set('showSitePosters', data.checked) + pandora.UI.set({showSitePosters: data.checked}); } else if (Ox.startsWith(data.id, 'sortfilter')) { var filters = Ox.clone(ui.filters), id = data.id.replace('sortfilter', ''), diff --git a/static/js/pandora/namesDialog.js b/static/js/pandora/namesDialog.js index 94fafd82..257c8892 100644 --- a/static/js/pandora/namesDialog.js +++ b/static/js/pandora/namesDialog.js @@ -103,14 +103,14 @@ pandora.ui.namesDialog = function() { }).bindEvent({ click: function() { that.close(); - pandora.UI.set('find', { + pandora.UI.set({find: { conditions: [{ key: 'name', value: $list.value($list.options('selected'), 'name'), operator: '=' }], operator: '&' - }); + }}); pandora.$ui.findElement.updateElement(); } }), diff --git a/static/js/pandora/navigationView.js b/static/js/pandora/navigationView.js index a0f12a3b..4ed47d53 100644 --- a/static/js/pandora/navigationView.js +++ b/static/js/pandora/navigationView.js @@ -155,10 +155,10 @@ pandora.ui.navigationView = function(type, videoRatio) { }, selectplace: selectItem, togglecontrols: function(data) { - pandora.UI.set('showMapControls', data.visible); + pandora.UI.set({showMapControls: data.visible}); }, togglelabels: function(data) { - pandora.UI.set('showMapLabels', data.visible); + pandora.UI.set({showMapLabels: data.visible}); } }) ); diff --git a/static/js/pandora/player.js b/static/js/pandora/player.js index e8f9260c..146a7247 100644 --- a/static/js/pandora/player.js +++ b/static/js/pandora/player.js @@ -74,7 +74,7 @@ pandora.ui.player = function(data) { document.location.href = '/' + ui.item + '/torrent/'; }, find: function(data) { - pandora.UI.set('itemFind', data.find); + pandora.UI.set({itemFind: data.find}); }, info: function(data) { pandora.ui.annotationDialog( @@ -82,7 +82,7 @@ pandora.ui.player = function(data) { ).open(); }, muted: function(data) { - pandora.UI.set('videoMuted', data.muted); + pandora.UI.set({videoMuted: data.muted}); }, playing: function(data) { pandora.UI.set( @@ -97,43 +97,43 @@ pandora.ui.player = function(data) { ); }, resizeannotations: function(data) { - pandora.UI.set('annotationsSize', data.annotationsSize); + pandora.UI.set({annotationsSize: data.annotationsSize}); }, resizecalendar: function(data) { - pandora.UI.set('annotationsCalendarSize', data.size); + pandora.UI.set({annotationsCalendarSize: data.size}); }, resizemap: function(data) { - pandora.UI.set('annotationsMapSize', data.size); + pandora.UI.set({annotationsMapSize: data.size}); }, resolution: function(data) { - pandora.UI.set('videoResolution', data.resolution); + pandora.UI.set({videoResolution: data.resolution}); }, scale: function(data) { - pandora.UI.set('videoScale', data.scale); + pandora.UI.set({videoScale: data.scale}); }, select: function(data) { pandora.UI.set('videoPoints.' + ui.item + '.annotation', data.id.split('/')[1]); }, subtitles: function(data) { - pandora.UI.set('videoSubtitles', data.subtitles); + pandora.UI.set({videoSubtitles: data.subtitles}); }, toggleannotations: function(data) { - pandora.UI.set('showAnnotations', data.showAnnotations); + pandora.UI.set({showAnnotations: data.showAnnotations}); }, togglelayer: function(data) { pandora.UI.set('showLayers.' + data.layer, !data.collapsed); }, togglemap: function(data) { - pandora.UI.set('showAnnotationsMap', !data.collapsed); + pandora.UI.set({showAnnotationsMap: !data.collapsed}); }, togglesize: function(data) { pandora.UI.set({videoSize: data.size}); }, toggletimeline: function(data) { - pandora.UI.set('showTimeline', data.showTimeline); + pandora.UI.set({showTimeline: data.showTimeline}); }, volume: function(data) { - pandora.UI.set('videoVolume', data.volume); + pandora.UI.set({videoVolume: data.volume}); }, pandora_showannotations: function(data) { that.options({showAnnotations: data.value}); diff --git a/static/js/pandora/sortMenu.js b/static/js/pandora/sortMenu.js index 965ca7a0..1f428970 100644 --- a/static/js/pandora/sortMenu.js +++ b/static/js/pandora/sortMenu.js @@ -29,15 +29,15 @@ pandora.ui.sortMenu = function() { click: function(data) { if (data.checked) { if (['ascending', 'descending'].indexOf(data.id) > -1) { - pandora.UI.set('itemSort', [{ + pandora.UI.set({itemSort: [{ key: pandora.user.ui.itemSort[0].key, operator: data.id == 'ascending' ? '+' : '-' - }]); + }]}); } else { - pandora.UI.set('itemSort', [{ + pandora.UI.set({itemSort: [{ key: data.id, operator: pandora.getSortOperator(data.id) - }]); + }]}); } } }, diff --git a/static/js/pandora/timeline.js b/static/js/pandora/timeline.js index 2f2deff5..c8bec493 100644 --- a/static/js/pandora/timeline.js +++ b/static/js/pandora/timeline.js @@ -65,7 +65,7 @@ pandora.ui.timeline = function(data) { pandora.URL.push(pandora.site.cantPlay.link); }, follow: function(data) { - pandora.UI.set('followPlayer', data.follow); + pandora.UI.set({followPlayer: data.follow}); }, info: function(data) { pandora.ui.annotationDialog( @@ -73,7 +73,7 @@ pandora.ui.timeline = function(data) { ).open(); }, muted: function(data) { - pandora.UI.set('videoMuted', data.muted); + pandora.UI.set({videoMuted: data.muted}); }, playing: function(data) { pandora.UI.set( @@ -88,28 +88,28 @@ pandora.ui.timeline = function(data) { ); }, resizeannotations: function(data) { - pandora.UI.set('annotationsSize', data.annotationsSize); + pandora.UI.set({annotationsSize: data.annotationsSize}); }, resizecalendar: function(data) { - pandora.UI.set('annotationsCalendarSize', data.size); + pandora.UI.set({annotationsCalendarSize: data.size}); }, resizemap: function(data) { - pandora.UI.set('annotationsMapSize', data.size); + pandora.UI.set({annotationsMapSize: data.size}); }, select: function(data) { pandora.UI.set('videoPoints.' + pandora.user.ui.item + '.annotation', data.id.split('/')[1]); }, timeline: function(data) { - pandora.UI.set('videoTimeline', data.timeline); + pandora.UI.set({videoTimeline: data.timeline}); }, toggleannotations: function(data) { - pandora.UI.set('showAnnotations', data.showAnnotations); + pandora.UI.set({showAnnotations: data.showAnnotations}); }, togglelayer: function(data) { pandora.UI.set('showLayers.' + data.layer, !data.collapsed); }, togglemap: function(data) { - pandora.UI.set('showAnnotationsMap', !data.collapsed); + pandora.UI.set({showAnnotationsMap: !data.collapsed}); }, pandora_showannotations: function(data) { that.options({showAnnotations: data.value}); diff --git a/static/js/pandora/titlesDialog.js b/static/js/pandora/titlesDialog.js index 84ed5ba7..1a5bd2a3 100644 --- a/static/js/pandora/titlesDialog.js +++ b/static/js/pandora/titlesDialog.js @@ -92,14 +92,14 @@ pandora.ui.titlesDialog = function() { }).bindEvent({ click: function() { that.close(); - pandora.UI.set('find', { + pandora.UI.set({find: { conditions: [{ key: 'title', value: $list.value($list.options('selected'), 'title'), operator: '=' }], operator: '&' - }); + }}); pandora.$ui.findElement.updateElement(); } }), diff --git a/static/js/pandora/tv.js b/static/js/pandora/tv.js index 591f6d30..bb0aca12 100644 --- a/static/js/pandora/tv.js +++ b/static/js/pandora/tv.js @@ -94,8 +94,7 @@ pandora.ui.tv = function() { close: that.fadeOutScreen, ended: play, muted: function(data) { - Ox.print('!MUTED', !muted) - !muted && pandora.UI.set('videoMuted', data.muted); + !muted && pandora.UI.set({videoMuted: data.muted}); }, open: function() { var item = result.data.item, @@ -115,16 +114,16 @@ pandora.ui.tv = function() { pandora.UI.set(set); }, resolution: function(data) { - pandora.UI.set('videoResolution', data.resolution); + pandora.UI.set({videoResolution: data.resolution}); }, scale: function(data) { - pandora.UI.set('videoScale', data.scale); + pandora.UI.set({videoScale: data.scale}); }, subtitles: function(data) { - pandora.UI.set('videoSubtitles', data.subtitles); + pandora.UI.set({videoSubtitles: data.subtitles}); }, volume: function(data) { - pandora.UI.set('videoVolume', data.volume); + pandora.UI.set({videoVolume: data.volume}); }, zap: function(data) { if (!(data.direction == 0 && list == '')) { @@ -162,13 +161,13 @@ pandora.ui.tv = function() { that.animate({opacity: 0}, 500, function() { that.remove(); }); - pandora.UI.set('page', ''); + pandora.UI.set({page: ''}); return that; }; that.hideScreen = function() { that.remove(); - pandora.UI.set('page', ''); + pandora.UI.set({page: ''}); return that; };