forked from 0x2620/pandora
make annotation folder info buttons functional in player and timeline views, fixes #607
This commit is contained in:
parent
baa48c2bf7
commit
778c98625a
4 changed files with 67 additions and 38 deletions
|
@ -2,43 +2,60 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
pandora.ui.annotationDialog = function(layer) {
|
pandora.ui.annotationDialog = function(layer) {
|
||||||
var $dialog = Ox.Dialog({
|
var isEditor = pandora.user.ui.itemView == 'editor',
|
||||||
buttons: [
|
$dialog = Ox.Dialog({
|
||||||
Ox.Button({title: 'Sign Up...'}).bindEvent({
|
buttons: Ox.merge(
|
||||||
click: function() {
|
isEditor ? [
|
||||||
$dialog.close();
|
Ox.Button({title: 'Sign Up...'}).bindEvent({
|
||||||
pandora.$ui.accountDialog = pandora.ui.accountDialog('signup').open();
|
click: function() {
|
||||||
}
|
$dialog.close();
|
||||||
}),
|
pandora.$ui.accountDialog = pandora.ui.accountDialog('signup').open();
|
||||||
Ox.Button({title: 'Sign In...'}).bindEvent({
|
}
|
||||||
click: function() {
|
}),
|
||||||
$dialog.close();
|
Ox.Button({title: 'Sign In...'}).bindEvent({
|
||||||
pandora.$ui.accountDialog = pandora.ui.accountDialog('signin').open();
|
click: function() {
|
||||||
}
|
$dialog.close();
|
||||||
}),
|
pandora.$ui.accountDialog = pandora.ui.accountDialog('signin').open();
|
||||||
{},
|
}
|
||||||
Ox.Button({title: 'Not Now'}).bindEvent({
|
})
|
||||||
click: function() {
|
] : [
|
||||||
$dialog.close();
|
Ox.Button({title: 'Switch to Editor'}).bindEvent({
|
||||||
}
|
click: function() {
|
||||||
})
|
$dialog.close();
|
||||||
],
|
pandora.UI.set({itemView: 'editor'});
|
||||||
content: Ox.Element()
|
}
|
||||||
.append(
|
})
|
||||||
$('<img>')
|
],
|
||||||
.attr({src: '/static/png/icon.png'})
|
[
|
||||||
.css({position: 'absolute', left: '16px', top: '16px', width: '64px', height: '64px'})
|
{},
|
||||||
)
|
Ox.Button({title: 'Not Now'}).bindEvent({
|
||||||
.append(
|
click: function() {
|
||||||
$('<div>')
|
$dialog.close();
|
||||||
.css({position: 'absolute', left: '96px', top: '16px', width: '192px'})
|
}
|
||||||
.html('To add or edit ' + layer + ', please sign up or sign in.')
|
})
|
||||||
|
]
|
||||||
),
|
),
|
||||||
fixedSize: true,
|
content: Ox.Element()
|
||||||
height: 128,
|
.append(
|
||||||
removeOnClose: true,
|
$('<img>')
|
||||||
width: 304,
|
.attr({src: '/static/png/icon.png'})
|
||||||
title: Ox.toTitleCase(layer)
|
.css({position: 'absolute', left: '16px', top: '16px', width: '64px', height: '64px'})
|
||||||
});
|
)
|
||||||
|
.append(
|
||||||
|
$('<div>')
|
||||||
|
.css({position: 'absolute', left: '96px', top: '16px', width: '192px'})
|
||||||
|
.html(
|
||||||
|
'To add or edit ' + layer + ', ' + (
|
||||||
|
isEditor ? 'please sign up or sign in.'
|
||||||
|
: 'just switch to the editor.'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
fixedSize: true,
|
||||||
|
height: 128,
|
||||||
|
removeOnClose: true,
|
||||||
|
width: 304,
|
||||||
|
title: Ox.toTitleCase(layer)
|
||||||
|
});
|
||||||
return $dialog;
|
return $dialog;
|
||||||
};
|
};
|
||||||
|
|
|
@ -171,7 +171,9 @@ pandora.ui.editor = function(data) {
|
||||||
pandora.ui.importAnnotations().open();
|
pandora.ui.importAnnotations().open();
|
||||||
},
|
},
|
||||||
info: function(data) {
|
info: function(data) {
|
||||||
pandora.ui.annotationDialog(Ox.getObjectById(pandora.site.layers, data.layer).title).open();
|
pandora.ui.annotationDialog(
|
||||||
|
Ox.getObjectById(pandora.site.layers, data.layer).title
|
||||||
|
).open();
|
||||||
},
|
},
|
||||||
muted: function(data) {
|
muted: function(data) {
|
||||||
pandora.UI.set('videoMuted', data.muted);
|
pandora.UI.set('videoMuted', data.muted);
|
||||||
|
|
|
@ -75,6 +75,11 @@ pandora.ui.player = function(data) {
|
||||||
find: function(data) {
|
find: function(data) {
|
||||||
pandora.UI.set('itemFind', data.find);
|
pandora.UI.set('itemFind', data.find);
|
||||||
},
|
},
|
||||||
|
info: function(data) {
|
||||||
|
pandora.ui.annotationDialog(
|
||||||
|
Ox.getObjectById(pandora.site.layers, data.layer).title
|
||||||
|
).open();
|
||||||
|
},
|
||||||
muted: function(data) {
|
muted: function(data) {
|
||||||
pandora.UI.set('videoMuted', data.muted);
|
pandora.UI.set('videoMuted', data.muted);
|
||||||
},
|
},
|
||||||
|
|
|
@ -67,6 +67,11 @@ pandora.ui.timeline = function(data) {
|
||||||
follow: function(data) {
|
follow: function(data) {
|
||||||
pandora.UI.set('followPlayer', data.follow);
|
pandora.UI.set('followPlayer', data.follow);
|
||||||
},
|
},
|
||||||
|
info: function(data) {
|
||||||
|
pandora.ui.annotationDialog(
|
||||||
|
Ox.getObjectById(pandora.site.layers, data.layer).title
|
||||||
|
).open();
|
||||||
|
},
|
||||||
muted: function(data) {
|
muted: function(data) {
|
||||||
pandora.UI.set('videoMuted', data.muted);
|
pandora.UI.set('videoMuted', data.muted);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue