use UI.set({k: v})

This commit is contained in:
rolux 2013-07-14 15:36:49 +00:00
parent d41d290ba5
commit b6955d743e
16 changed files with 83 additions and 81 deletions

View file

@ -15,7 +15,7 @@ pandora.ui.allItems = function() {
click: function() { click: function() {
that.gainFocus(); that.gainFocus();
if (pandora.user.ui.section == 'items') { 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 { } else {
pandora.UI.set(pandora.user.ui.section.slice(0, -1), ''); pandora.UI.set(pandora.user.ui.section.slice(0, -1), '');
} }

View file

@ -238,11 +238,11 @@ pandora.ui.clipList = function(videoRatio) {
}, 300); }, 300);
//*/ //*/
} }
!ui.item && pandora.UI.set('listSelection', [item]); !ui.item && pandora.UI.set({listSelection: [item]});
!isEmbed && pandora.$ui.mainMenu.enableItem('findsimilar'); !isEmbed && pandora.$ui.mainMenu.enableItem('findsimilar');
} else { } else {
$('.OxSelectedVideo').removeClass('OxSelectedVideo'); $('.OxSelectedVideo').removeClass('OxSelectedVideo');
!ui.item && pandora.UI.set('listSelection', []); !ui.item && pandora.UI.set({listSelection: []});
!isEmbed && pandora.$ui.mainMenu.disableItem('findsimilar'); !isEmbed && pandora.$ui.mainMenu.disableItem('findsimilar');
} }
}, },

View file

@ -38,7 +38,7 @@ pandora.ui.clipsView = function(videoRatio) {
.bindEvent({ .bindEvent({
submit: function(data) { submit: function(data) {
$status.html(Ox._('Loading...')); $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, // since this is the only way itemFind can change,
// there's no need for an event handler // there's no need for an event handler
that.replaceElement(1, that.replaceElement(1,

View file

@ -126,6 +126,9 @@ pandora.ui.editPanel = function() {
}); });
}); });
}, },
loop: function(data) {
pandora.UI.set({videoLoop: data.loop});
},
move: function(data) { move: function(data) {
pandora.api.orderClips({ pandora.api.orderClips({
edit: edit.id, edit: edit.id,
@ -136,7 +139,7 @@ pandora.ui.editPanel = function() {
}); });
}, },
muted: function(data) { muted: function(data) {
pandora.UI.set('videoMuted', data.muted); pandora.UI.set({videoMuted: data.muted});
}, },
open: function(data) { open: function(data) {
pandora.UI.set(editPointsKey('clip'), data.ids[0]); pandora.UI.set(editPointsKey('clip'), data.ids[0]);
@ -180,19 +183,19 @@ pandora.ui.editPanel = function() {
that.options({width: data.size}); that.options({width: data.size});
}, },
resizeclips: function(data) { resizeclips: function(data) {
pandora.UI.set('clipsSize', data.clipsSize); pandora.UI.set({clipsSize: data.clipsSize});
}, },
resolution: function(data) { resolution: function(data) {
pandora.UI.set('videoResolution', data.resolution); pandora.UI.set({videoResolution: data.resolution});
}, },
scale: function(data) { scale: function(data) {
pandora.UI.set('videoScale', data.scale); pandora.UI.set({videoScale: data.scale});
}, },
size: function(data) { size: function(data) {
pandora.UI.set('clipSize', data.size); pandora.UI.set({clipSize: data.size});
}, },
sort: function(data) { sort: function(data) {
pandora.UI.set('clipSort', data); pandora.UI.set({clipSort: data});
var key = data[0].key; var key = data[0].key;
if (key == 'position') { if (key == 'position') {
key = 'in'; key = 'in';
@ -217,22 +220,22 @@ pandora.ui.editPanel = function() {
} }
}, },
subtitles: function(data) { subtitles: function(data) {
pandora.UI.set('videoSubtitles', data.subtitles); pandora.UI.set({videoSubtitles: data.subtitles});
}, },
timeline: function(data) { timeline: function(data) {
pandora.UI.set('videoTimeline', data.timeline); pandora.UI.set({videoTimeline: data.timeline});
}, },
toggleclips: function(data) { toggleclips: function(data) {
pandora.UI.set('showClips', data.showClips); pandora.UI.set({showClips: data.showClips});
}, },
toggletimeline: function(data) { toggletimeline: function(data) {
pandora.UI.set('showTimeline', data.showTimeline); pandora.UI.set({showTimeline: data.showTimeline});
}, },
view: function(data) { view: function(data) {
pandora.UI.set('clipView', data.view); pandora.UI.set({clipView: data.view});
}, },
volume: function(data) { volume: function(data) {
pandora.UI.set('videoVolume', data.volume); pandora.UI.set({videoVolume: data.volume});
}, },
pandora_showclips: function(data) { pandora_showclips: function(data) {
that.options({showClips: data.value}); that.options({showClips: data.value});

View file

@ -163,7 +163,7 @@ pandora.ui.editor = function(data) {
pandora.$ui.embedVideoDialog = pandora.ui.embedVideoDialog().open(); pandora.$ui.embedVideoDialog = pandora.ui.embedVideoDialog().open();
}, },
find: function(data) { find: function(data) {
pandora.UI.set('itemFind', data.find); pandora.UI.set({itemFind: data.find});
}, },
findannotations: function(data) { findannotations: function(data) {
pandora.UI.set({ pandora.UI.set({
@ -184,7 +184,7 @@ pandora.ui.editor = function(data) {
).open(); ).open();
}, },
muted: function(data) { muted: function(data) {
pandora.UI.set('videoMuted', data.muted); pandora.UI.set({videoMuted: data.muted});
}, },
playing: function(data) { playing: function(data) {
pandora.UI.set( pandora.UI.set(
@ -244,34 +244,34 @@ pandora.ui.editor = function(data) {
that.options({height: data.size}); that.options({height: data.size});
}, },
resizecalendar: function(data) { resizecalendar: function(data) {
pandora.UI.set('annotationsCalendarSize', data.size); pandora.UI.set({annotationsCalendarSize: data.size});
}, },
resizemap: function(data) { resizemap: function(data) {
pandora.UI.set('annotationsMapSize', data.size); pandora.UI.set({annotationsMapSize: data.size});
}, },
resolution: function(data) { resolution: function(data) {
pandora.UI.set('videoResolution', data.resolution); pandora.UI.set({videoResolution: data.resolution});
}, },
select: function(data) { select: function(data) {
pandora.UI.set('videoPoints.' + ui.item + '.annotation', data.id.split('/')[1]); pandora.UI.set('videoPoints.' + ui.item + '.annotation', data.id.split('/')[1]);
}, },
subtitles: function(data) { subtitles: function(data) {
pandora.UI.set('videoSubtitles', data.subtitles); pandora.UI.set({videoSubtitles: data.subtitles});
}, },
timeline: function(data) { timeline: function(data) {
pandora.UI.set('videoTimeline', data.timeline); pandora.UI.set({videoTimeline: data.timeline});
}, },
toggleannotations: function(data) { toggleannotations: function(data) {
pandora.UI.set('showAnnotations', data.showAnnotations); pandora.UI.set({showAnnotations: data.showAnnotations});
}, },
togglecalendar: function(data) { togglecalendar: function(data) {
pandora.UI.set('showAnnotationsCalendar', !data.collapsed); pandora.UI.set({showAnnotationsCalendar: !data.collapsed});
}, },
togglelayer: function(data) { togglelayer: function(data) {
pandora.UI.set('showLayers.' + data.layer, !data.collapsed); pandora.UI.set('showLayers.' + data.layer, !data.collapsed);
}, },
togglemap: function(data) { togglemap: function(data) {
pandora.UI.set('showAnnotationsMap', !data.collapsed); pandora.UI.set({showAnnotationsMap: !data.collapsed});
}, },
togglesize: function(data) { togglesize: function(data) {
pandora.UI.set({videoSize: data.size}); pandora.UI.set({videoSize: data.size});

View file

@ -162,7 +162,7 @@ pandora.ui.filter = function(id) {
} }
} }
} }
pandora.UI.set('find', find); pandora.UI.set({find: find});
pandora.$ui.filters.updateMenus(); pandora.$ui.filters.updateMenus();
}, },
sort: function(data) { sort: function(data) {

View file

@ -105,7 +105,7 @@ pandora.ui.findElement = function() {
operator: '=' operator: '='
}] : [] }] : []
); );
pandora.UI.set('find', {conditions: conditions, operator: '&'}); pandora.UI.set({find: {conditions: conditions, operator: '&'}});
} }
}) })
]), ]),

View file

@ -569,10 +569,10 @@ pandora.ui.infoView = function(data) {
.css({textAlign: 'right', cursor: 'pointer'}) .css({textAlign: 'right', cursor: 'pointer'})
.bind({ .bind({
click: function() { click: function() {
pandora.UI.set('listSort', [{ pandora.UI.set({listSort: [{
key: key, key: key,
operator: pandora.getSortOperator(key) operator: pandora.getSortOperator(key)
}]); }]});
} }
}) })
) )
@ -596,10 +596,10 @@ pandora.ui.infoView = function(data) {
) )
.bind({ .bind({
click: function() { click: function() {
pandora.UI.set('listSort', [{ pandora.UI.set({listSort: [{
key: key, key: key,
operator: pandora.getSortOperator(key) operator: pandora.getSortOperator(key)
}]); }]});
} }
}) })
) )
@ -618,10 +618,10 @@ pandora.ui.infoView = function(data) {
.css({textAlign: 'right', cursor: 'pointer'}) .css({textAlign: 'right', cursor: 'pointer'})
.bind({ .bind({
click: function() { click: function() {
pandora.UI.set('listSort', [{ pandora.UI.set({listSort: [{
key: key, key: key,
operator: pandora.getSortOperator(key) operator: pandora.getSortOperator(key)
}]); }]});
} }
}) })
) )
@ -643,10 +643,10 @@ pandora.ui.infoView = function(data) {
.html(Ox.formatNumber(value, 3)) .html(Ox.formatNumber(value, 3))
.bind({ .bind({
click: function() { click: function() {
pandora.UI.set('listSort', [{ pandora.UI.set({listSort: [{
key: key, key: key,
operator: pandora.getSortOperator(key) operator: pandora.getSortOperator(key)
}]); }]});
} }
}) })
) )
@ -697,7 +697,7 @@ pandora.ui.infoView = function(data) {
if (canEdit) { if (canEdit) {
$icon.bindEvent({ $icon.bindEvent({
doubleclick: function() { doubleclick: function() {
pandora.UI.set('showIconBrowser', !ui.showIconBrowser); pandora.UI.set({showIconBrowser: !ui.showIconBrowser});
$info.animate({ $info.animate({
left: ui.showIconBrowser ? 0 : -listWidth + 'px' left: ui.showIconBrowser ? 0 : -listWidth + 'px'
}, 250); }, 250);
@ -1053,10 +1053,10 @@ pandora.ui.infoView = function(data) {
}) })
.bind({ .bind({
click: function() { click: function() {
pandora.UI.set('listSort', [{ pandora.UI.set({listSort: [{
key: 'rightslevel', key: 'rightslevel',
operator: pandora.getSortOperator('rightslevel') operator: pandora.getSortOperator('rightslevel')
}]); }]});
} }
}) })
.appendTo($rightsLevel); .appendTo($rightsLevel);

View file

@ -230,7 +230,7 @@ pandora.ui.mainMenu = function() {
var value = data.checked[0] ? data.checked[0].id : null; var value = data.checked[0] ? data.checked[0].id : null;
if (data.id == 'allitems') { if (data.id == 'allitems') {
if (data.checked) { if (data.checked) {
pandora.UI.set('find', {conditions: [], operator: '&'}); pandora.UI.set({find: {conditions: [], operator: '&'}});
} else { } else {
that.checkItem('allitems'); that.checkItem('allitems');
} }
@ -284,14 +284,14 @@ pandora.ui.mainMenu = function() {
filters[index].sort[0].operator = operator; filters[index].sort[0].operator = operator;
pandora.UI.set({filters: filters}); pandora.UI.set({filters: filters});
} else if (data.id == 'setlocale') { } else if (data.id == 'setlocale') {
pandora.UI.set('locale', value); pandora.UI.set({locale: value});
pandora.setLocale(value, function() { pandora.setLocale(value, function() {
pandora.$ui.appPanel.reload(); pandora.$ui.appPanel.reload();
}); });
} else if (data.id == 'settheme') { } else if (data.id == 'settheme') {
var iframe, src; var iframe, src;
Ox.Theme(value); Ox.Theme(value);
pandora.UI.set('theme', value); pandora.UI.set({theme: value});
iframe = Ox.UI.elements[$('#embed').data('oxid')]; iframe = Ox.UI.elements[$('#embed').data('oxid')];
if (iframe) { if (iframe) {
src = iframe.attr('src'); src = iframe.attr('src');
@ -300,7 +300,7 @@ pandora.ui.mainMenu = function() {
} }
} }
} else if (data.id == 'showsiteposters') { } else if (data.id == 'showsiteposters') {
pandora.UI.set('showSitePosters', data.checked) pandora.UI.set({showSitePosters: data.checked});
} else if (Ox.startsWith(data.id, 'sortfilter')) { } else if (Ox.startsWith(data.id, 'sortfilter')) {
var filters = Ox.clone(ui.filters), var filters = Ox.clone(ui.filters),
id = data.id.replace('sortfilter', ''), id = data.id.replace('sortfilter', ''),

View file

@ -103,14 +103,14 @@ pandora.ui.namesDialog = function() {
}).bindEvent({ }).bindEvent({
click: function() { click: function() {
that.close(); that.close();
pandora.UI.set('find', { pandora.UI.set({find: {
conditions: [{ conditions: [{
key: 'name', key: 'name',
value: $list.value($list.options('selected'), 'name'), value: $list.value($list.options('selected'), 'name'),
operator: '=' operator: '='
}], }],
operator: '&' operator: '&'
}); }});
pandora.$ui.findElement.updateElement(); pandora.$ui.findElement.updateElement();
} }
}), }),

View file

@ -155,10 +155,10 @@ pandora.ui.navigationView = function(type, videoRatio) {
}, },
selectplace: selectItem, selectplace: selectItem,
togglecontrols: function(data) { togglecontrols: function(data) {
pandora.UI.set('showMapControls', data.visible); pandora.UI.set({showMapControls: data.visible});
}, },
togglelabels: function(data) { togglelabels: function(data) {
pandora.UI.set('showMapLabels', data.visible); pandora.UI.set({showMapLabels: data.visible});
} }
}) })
); );

View file

@ -74,7 +74,7 @@ pandora.ui.player = function(data) {
document.location.href = '/' + ui.item + '/torrent/'; document.location.href = '/' + ui.item + '/torrent/';
}, },
find: function(data) { find: function(data) {
pandora.UI.set('itemFind', data.find); pandora.UI.set({itemFind: data.find});
}, },
info: function(data) { info: function(data) {
pandora.ui.annotationDialog( pandora.ui.annotationDialog(
@ -82,7 +82,7 @@ pandora.ui.player = function(data) {
).open(); ).open();
}, },
muted: function(data) { muted: function(data) {
pandora.UI.set('videoMuted', data.muted); pandora.UI.set({videoMuted: data.muted});
}, },
playing: function(data) { playing: function(data) {
pandora.UI.set( pandora.UI.set(
@ -97,43 +97,43 @@ pandora.ui.player = function(data) {
); );
}, },
resizeannotations: function(data) { resizeannotations: function(data) {
pandora.UI.set('annotationsSize', data.annotationsSize); pandora.UI.set({annotationsSize: data.annotationsSize});
}, },
resizecalendar: function(data) { resizecalendar: function(data) {
pandora.UI.set('annotationsCalendarSize', data.size); pandora.UI.set({annotationsCalendarSize: data.size});
}, },
resizemap: function(data) { resizemap: function(data) {
pandora.UI.set('annotationsMapSize', data.size); pandora.UI.set({annotationsMapSize: data.size});
}, },
resolution: function(data) { resolution: function(data) {
pandora.UI.set('videoResolution', data.resolution); pandora.UI.set({videoResolution: data.resolution});
}, },
scale: function(data) { scale: function(data) {
pandora.UI.set('videoScale', data.scale); pandora.UI.set({videoScale: data.scale});
}, },
select: function(data) { select: function(data) {
pandora.UI.set('videoPoints.' + ui.item + '.annotation', data.id.split('/')[1]); pandora.UI.set('videoPoints.' + ui.item + '.annotation', data.id.split('/')[1]);
}, },
subtitles: function(data) { subtitles: function(data) {
pandora.UI.set('videoSubtitles', data.subtitles); pandora.UI.set({videoSubtitles: data.subtitles});
}, },
toggleannotations: function(data) { toggleannotations: function(data) {
pandora.UI.set('showAnnotations', data.showAnnotations); pandora.UI.set({showAnnotations: data.showAnnotations});
}, },
togglelayer: function(data) { togglelayer: function(data) {
pandora.UI.set('showLayers.' + data.layer, !data.collapsed); pandora.UI.set('showLayers.' + data.layer, !data.collapsed);
}, },
togglemap: function(data) { togglemap: function(data) {
pandora.UI.set('showAnnotationsMap', !data.collapsed); pandora.UI.set({showAnnotationsMap: !data.collapsed});
}, },
togglesize: function(data) { togglesize: function(data) {
pandora.UI.set({videoSize: data.size}); pandora.UI.set({videoSize: data.size});
}, },
toggletimeline: function(data) { toggletimeline: function(data) {
pandora.UI.set('showTimeline', data.showTimeline); pandora.UI.set({showTimeline: data.showTimeline});
}, },
volume: function(data) { volume: function(data) {
pandora.UI.set('videoVolume', data.volume); pandora.UI.set({videoVolume: data.volume});
}, },
pandora_showannotations: function(data) { pandora_showannotations: function(data) {
that.options({showAnnotations: data.value}); that.options({showAnnotations: data.value});

View file

@ -29,15 +29,15 @@ pandora.ui.sortMenu = function() {
click: function(data) { click: function(data) {
if (data.checked) { if (data.checked) {
if (['ascending', 'descending'].indexOf(data.id) > -1) { if (['ascending', 'descending'].indexOf(data.id) > -1) {
pandora.UI.set('itemSort', [{ pandora.UI.set({itemSort: [{
key: pandora.user.ui.itemSort[0].key, key: pandora.user.ui.itemSort[0].key,
operator: data.id == 'ascending' ? '+' : '-' operator: data.id == 'ascending' ? '+' : '-'
}]); }]});
} else { } else {
pandora.UI.set('itemSort', [{ pandora.UI.set({itemSort: [{
key: data.id, key: data.id,
operator: pandora.getSortOperator(data.id) operator: pandora.getSortOperator(data.id)
}]); }]});
} }
} }
}, },

View file

@ -65,7 +65,7 @@ pandora.ui.timeline = function(data) {
pandora.URL.push(pandora.site.cantPlay.link); pandora.URL.push(pandora.site.cantPlay.link);
}, },
follow: function(data) { follow: function(data) {
pandora.UI.set('followPlayer', data.follow); pandora.UI.set({followPlayer: data.follow});
}, },
info: function(data) { info: function(data) {
pandora.ui.annotationDialog( pandora.ui.annotationDialog(
@ -73,7 +73,7 @@ pandora.ui.timeline = function(data) {
).open(); ).open();
}, },
muted: function(data) { muted: function(data) {
pandora.UI.set('videoMuted', data.muted); pandora.UI.set({videoMuted: data.muted});
}, },
playing: function(data) { playing: function(data) {
pandora.UI.set( pandora.UI.set(
@ -88,28 +88,28 @@ pandora.ui.timeline = function(data) {
); );
}, },
resizeannotations: function(data) { resizeannotations: function(data) {
pandora.UI.set('annotationsSize', data.annotationsSize); pandora.UI.set({annotationsSize: data.annotationsSize});
}, },
resizecalendar: function(data) { resizecalendar: function(data) {
pandora.UI.set('annotationsCalendarSize', data.size); pandora.UI.set({annotationsCalendarSize: data.size});
}, },
resizemap: function(data) { resizemap: function(data) {
pandora.UI.set('annotationsMapSize', data.size); pandora.UI.set({annotationsMapSize: data.size});
}, },
select: function(data) { select: function(data) {
pandora.UI.set('videoPoints.' + pandora.user.ui.item + '.annotation', data.id.split('/')[1]); pandora.UI.set('videoPoints.' + pandora.user.ui.item + '.annotation', data.id.split('/')[1]);
}, },
timeline: function(data) { timeline: function(data) {
pandora.UI.set('videoTimeline', data.timeline); pandora.UI.set({videoTimeline: data.timeline});
}, },
toggleannotations: function(data) { toggleannotations: function(data) {
pandora.UI.set('showAnnotations', data.showAnnotations); pandora.UI.set({showAnnotations: data.showAnnotations});
}, },
togglelayer: function(data) { togglelayer: function(data) {
pandora.UI.set('showLayers.' + data.layer, !data.collapsed); pandora.UI.set('showLayers.' + data.layer, !data.collapsed);
}, },
togglemap: function(data) { togglemap: function(data) {
pandora.UI.set('showAnnotationsMap', !data.collapsed); pandora.UI.set({showAnnotationsMap: !data.collapsed});
}, },
pandora_showannotations: function(data) { pandora_showannotations: function(data) {
that.options({showAnnotations: data.value}); that.options({showAnnotations: data.value});

View file

@ -92,14 +92,14 @@ pandora.ui.titlesDialog = function() {
}).bindEvent({ }).bindEvent({
click: function() { click: function() {
that.close(); that.close();
pandora.UI.set('find', { pandora.UI.set({find: {
conditions: [{ conditions: [{
key: 'title', key: 'title',
value: $list.value($list.options('selected'), 'title'), value: $list.value($list.options('selected'), 'title'),
operator: '=' operator: '='
}], }],
operator: '&' operator: '&'
}); }});
pandora.$ui.findElement.updateElement(); pandora.$ui.findElement.updateElement();
} }
}), }),

View file

@ -94,8 +94,7 @@ pandora.ui.tv = function() {
close: that.fadeOutScreen, close: that.fadeOutScreen,
ended: play, ended: play,
muted: function(data) { muted: function(data) {
Ox.print('!MUTED', !muted) !muted && pandora.UI.set({videoMuted: data.muted});
!muted && pandora.UI.set('videoMuted', data.muted);
}, },
open: function() { open: function() {
var item = result.data.item, var item = result.data.item,
@ -115,16 +114,16 @@ pandora.ui.tv = function() {
pandora.UI.set(set); pandora.UI.set(set);
}, },
resolution: function(data) { resolution: function(data) {
pandora.UI.set('videoResolution', data.resolution); pandora.UI.set({videoResolution: data.resolution});
}, },
scale: function(data) { scale: function(data) {
pandora.UI.set('videoScale', data.scale); pandora.UI.set({videoScale: data.scale});
}, },
subtitles: function(data) { subtitles: function(data) {
pandora.UI.set('videoSubtitles', data.subtitles); pandora.UI.set({videoSubtitles: data.subtitles});
}, },
volume: function(data) { volume: function(data) {
pandora.UI.set('videoVolume', data.volume); pandora.UI.set({videoVolume: data.volume});
}, },
zap: function(data) { zap: function(data) {
if (!(data.direction == 0 && list == '')) { if (!(data.direction == 0 && list == '')) {
@ -162,13 +161,13 @@ pandora.ui.tv = function() {
that.animate({opacity: 0}, 500, function() { that.animate({opacity: 0}, 500, function() {
that.remove(); that.remove();
}); });
pandora.UI.set('page', ''); pandora.UI.set({page: ''});
return that; return that;
}; };
that.hideScreen = function() { that.hideScreen = function() {
that.remove(); that.remove();
pandora.UI.set('page', ''); pandora.UI.set({page: ''});
return that; return that;
}; };