clean up ui settings on load; make show/hide video timeline work via menu and keyboard
This commit is contained in:
parent
49d13a1a78
commit
8caa57d33e
4 changed files with 28 additions and 5 deletions
|
@ -616,7 +616,6 @@
|
||||||
"showAnnotations": true,
|
"showAnnotations": true,
|
||||||
"showBrowser": true,
|
"showBrowser": true,
|
||||||
"showCalendarControls": true, // fixme: should be false
|
"showCalendarControls": true, // fixme: should be false
|
||||||
"showControls": true,
|
|
||||||
"showFlags": true,
|
"showFlags": true,
|
||||||
"showGroups": true,
|
"showGroups": true,
|
||||||
"showHome": true,
|
"showHome": true,
|
||||||
|
@ -634,6 +633,7 @@
|
||||||
},
|
},
|
||||||
"showSidebar": true,
|
"showSidebar": true,
|
||||||
"showSitePosters": false,
|
"showSitePosters": false,
|
||||||
|
"showTimeline": true,
|
||||||
"sidebarSize": 256,
|
"sidebarSize": 256,
|
||||||
"theme": "modern",
|
"theme": "modern",
|
||||||
"videoPoints": {},
|
"videoPoints": {},
|
||||||
|
|
|
@ -204,9 +204,16 @@ appPanel
|
||||||
user: data.user
|
user: data.user
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// make sure all valid ui settings are present
|
||||||
pandora.user.ui = Ox.extend(
|
pandora.user.ui = Ox.extend(
|
||||||
Ox.clone(pandora.site.user.ui), pandora.user.ui
|
Ox.clone(pandora.site.user.ui), pandora.user.ui
|
||||||
);
|
);
|
||||||
|
// make sure no invalid ui settings are present
|
||||||
|
Object.keys(pandora.user.ui).forEach(function(key) {
|
||||||
|
if (Ox.isUndefined(pandora.site.user.ui[key])) {
|
||||||
|
delete pandora.user.ui[key];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
Ox.extend(pandora.site, {
|
Ox.extend(pandora.site, {
|
||||||
clipKeys: Ox.map(data.site.clipKeys, function(key) {
|
clipKeys: Ox.map(data.site.clipKeys, function(key) {
|
||||||
|
|
|
@ -173,7 +173,7 @@ pandora.ui.item = function() {
|
||||||
position: pandora.user.ui.videoPoints[pandora.user.ui.item].position,
|
position: pandora.user.ui.videoPoints[pandora.user.ui.item].position,
|
||||||
scaleToFill: pandora.user.ui.videoScale == 'fill',
|
scaleToFill: pandora.user.ui.videoScale == 'fill',
|
||||||
showAnnotations: pandora.user.ui.showAnnotations,
|
showAnnotations: pandora.user.ui.showAnnotations,
|
||||||
showControls: pandora.user.ui.showControls,
|
showTimeline: pandora.user.ui.showTimeline,
|
||||||
subtitles: subtitles,
|
subtitles: subtitles,
|
||||||
tooltips: true,
|
tooltips: true,
|
||||||
timeline: '/' + pandora.user.ui.item + '/timeline16p.png',
|
timeline: '/' + pandora.user.ui.item + '/timeline16p.png',
|
||||||
|
@ -205,14 +205,17 @@ pandora.ui.item = function() {
|
||||||
toggleannotations: function(data) {
|
toggleannotations: function(data) {
|
||||||
pandora.UI.set('showAnnotations', data.showAnnotations);
|
pandora.UI.set('showAnnotations', data.showAnnotations);
|
||||||
},
|
},
|
||||||
togglecontrols: function(data) {
|
toggletimeline: function(data) {
|
||||||
pandora.UI.set('showControls', data.showControls);
|
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) {
|
||||||
pandora.$ui.player.options({showAnnotations: data.value});
|
pandora.$ui.player.options({showAnnotations: data.value});
|
||||||
|
},
|
||||||
|
pandora_showtimeline: function(data) {
|
||||||
|
pandora.$ui.player.options({showTimeline: data.value});
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
@ -100,6 +100,7 @@ pandora.ui.mainMenu = function() {
|
||||||
{ id: 'showgroups', title: (ui.showGroups ? 'Hide' : 'Show') + ' Groups', disabled: !!ui.item, keyboard: 'shift g' },
|
{ id: 'showgroups', title: (ui.showGroups ? 'Hide' : 'Show') + ' Groups', disabled: !!ui.item, keyboard: 'shift g' },
|
||||||
{ id: 'showbrowser', title: (ui.showBrowser ? 'Hide' : 'Show') + ' ' + pandora.site.itemName.singular + ' Browser', disabled: !ui.item, keyboard: 'shift b' },
|
{ id: 'showbrowser', title: (ui.showBrowser ? 'Hide' : 'Show') + ' ' + pandora.site.itemName.singular + ' Browser', disabled: !ui.item, keyboard: 'shift b' },
|
||||||
{ id: 'showannotations', title: (ui.showAnnotations ? 'Hide' : 'Show') + ' Annotations', disabled: !ui.item || ['timeline', 'video'].indexOf(ui.itemView) == -1, keyboard: 'shift a' },
|
{ id: 'showannotations', title: (ui.showAnnotations ? 'Hide' : 'Show') + ' Annotations', disabled: !ui.item || ['timeline', 'video'].indexOf(ui.itemView) == -1, keyboard: 'shift a' },
|
||||||
|
{ id: 'showtimeline', title: (ui.showTimeline ? 'Hide' : 'Show') + ' Timeline', disabled: !ui.item || ui.itemView != 'video', keyboard: 'shift t' },
|
||||||
{},
|
{},
|
||||||
{ id: 'theme', title: 'Theme', items: [
|
{ id: 'theme', title: 'Theme', items: [
|
||||||
{ group: 'settheme', min: 1, max: 1, items: [
|
{ group: 'settheme', min: 1, max: 1, items: [
|
||||||
|
@ -241,6 +242,8 @@ pandora.ui.mainMenu = function() {
|
||||||
pandora.UI.set({showBrowser: !ui.showBrowser});
|
pandora.UI.set({showBrowser: !ui.showBrowser});
|
||||||
} else if (data.id == 'showannotations') {
|
} else if (data.id == 'showannotations') {
|
||||||
pandora.UI.set({showAnnotations: !ui.showAnnotations});
|
pandora.UI.set({showAnnotations: !ui.showAnnotations});
|
||||||
|
} else if (data.id == 'showtimeline') {
|
||||||
|
pandora.UI.set({showTimeline: !ui.showTimeline});
|
||||||
} else if (data.id == 'titles') {
|
} else if (data.id == 'titles') {
|
||||||
(pandora.$ui.titlesDialog || (
|
(pandora.$ui.titlesDialog || (
|
||||||
pandora.$ui.titlesDialog = pandora.ui.titlesDialog()
|
pandora.$ui.titlesDialog = pandora.ui.titlesDialog()
|
||||||
|
@ -305,7 +308,7 @@ pandora.ui.mainMenu = function() {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
key_shift_a: function() {
|
key_shift_a: function() {
|
||||||
ui.item && ['video', 'timeline'].indexOf(ui.view) > -1
|
ui.item && ['video', 'timeline'].indexOf(ui.itemView) > -1
|
||||||
&& pandora.UI.set({showAnnotations: !ui.showAnnotations});
|
&& pandora.UI.set({showAnnotations: !ui.showAnnotations});
|
||||||
},
|
},
|
||||||
key_shift_b: function() {
|
key_shift_b: function() {
|
||||||
|
@ -320,6 +323,10 @@ pandora.ui.mainMenu = function() {
|
||||||
key_shift_s: function() {
|
key_shift_s: function() {
|
||||||
pandora.UI.set({showSidebar: !ui.showSidebar});
|
pandora.UI.set({showSidebar: !ui.showSidebar});
|
||||||
},
|
},
|
||||||
|
key_shift_t: function() {
|
||||||
|
ui.item && ui.itemView == 'video'
|
||||||
|
&& pandora.UI.set({showTimeline: !ui.showTimeline});
|
||||||
|
},
|
||||||
pandora_find: function() {
|
pandora_find: function() {
|
||||||
var action = ui._list
|
var action = ui._list
|
||||||
&& pandora.getListData(ui._list).user == pandora.user.username
|
&& pandora.getListData(ui._list).user == pandora.user.username
|
||||||
|
@ -350,6 +357,9 @@ pandora.ui.mainMenu = function() {
|
||||||
if (isVideoView != wasVideoView) {
|
if (isVideoView != wasVideoView) {
|
||||||
that[isVideoView ? 'enableItem' : 'disableItem']('showannotations');
|
that[isVideoView ? 'enableItem' : 'disableItem']('showannotations');
|
||||||
}
|
}
|
||||||
|
if ((data.value == 'video') != (data.previousValue == 'video')) {
|
||||||
|
that[data.value == 'video' ? 'enableItem' : 'disableItem']('showtimeline');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
pandora_listselection: function(data) {
|
pandora_listselection: function(data) {
|
||||||
that[data.value.length ? 'enableItem' : 'disableItem']('newlistfromselection');
|
that[data.value.length ? 'enableItem' : 'disableItem']('newlistfromselection');
|
||||||
|
@ -375,6 +385,9 @@ pandora.ui.mainMenu = function() {
|
||||||
pandora_showsidebar: function(data) {
|
pandora_showsidebar: function(data) {
|
||||||
that.setItemTitle('showsidebar', (data.value ? 'Hide' : 'Show') + ' Sidebar');
|
that.setItemTitle('showsidebar', (data.value ? 'Hide' : 'Show') + ' Sidebar');
|
||||||
that[data.value ? 'enableItem' : 'disableItem']('showinfo');
|
that[data.value ? 'enableItem' : 'disableItem']('showinfo');
|
||||||
|
},
|
||||||
|
pandora_showtimeline: function(data) {
|
||||||
|
that.setItemTitle('showtimeline', (data.value ? 'Hide' : 'Show') + ' Timeline');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue