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() {
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), '');
}

View file

@ -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');
}
},

View file

@ -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,

View file

@ -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});

View file

@ -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});

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();
},
sort: function(data) {

View file

@ -105,7 +105,7 @@ pandora.ui.findElement = function() {
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'})
.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);

View file

@ -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', ''),

View file

@ -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();
}
}),

View file

@ -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});
}
})
);

View file

@ -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});

View file

@ -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)
}]);
}]});
}
}
},

View file

@ -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});

View file

@ -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();
}
}),

View file

@ -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;
};