make annotation folder info buttons functional in player and timeline views, fixes #607

This commit is contained in:
rolux 2012-04-22 11:13:42 +00:00
parent baa48c2bf7
commit 778c98625a
4 changed files with 67 additions and 38 deletions

View file

@ -2,8 +2,10 @@
'use strict';
pandora.ui.annotationDialog = function(layer) {
var $dialog = Ox.Dialog({
buttons: [
var isEditor = pandora.user.ui.itemView == 'editor',
$dialog = Ox.Dialog({
buttons: Ox.merge(
isEditor ? [
Ox.Button({title: 'Sign Up...'}).bindEvent({
click: function() {
$dialog.close();
@ -15,14 +17,24 @@ pandora.ui.annotationDialog = function(layer) {
$dialog.close();
pandora.$ui.accountDialog = pandora.ui.accountDialog('signin').open();
}
}),
})
] : [
Ox.Button({title: 'Switch to Editor'}).bindEvent({
click: function() {
$dialog.close();
pandora.UI.set({itemView: 'editor'});
}
})
],
[
{},
Ox.Button({title: 'Not Now'}).bindEvent({
click: function() {
$dialog.close();
}
})
],
]
),
content: Ox.Element()
.append(
$('<img>')
@ -32,7 +44,12 @@ pandora.ui.annotationDialog = function(layer) {
.append(
$('<div>')
.css({position: 'absolute', left: '96px', top: '16px', width: '192px'})
.html('To add or edit ' + layer + ', please sign up or sign in.')
.html(
'To add or edit ' + layer + ', ' + (
isEditor ? 'please sign up or sign in.'
: 'just switch to the editor.'
)
)
),
fixedSize: true,
height: 128,

View file

@ -171,7 +171,9 @@ pandora.ui.editor = function(data) {
pandora.ui.importAnnotations().open();
},
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) {
pandora.UI.set('videoMuted', data.muted);

View file

@ -75,6 +75,11 @@ pandora.ui.player = function(data) {
find: function(data) {
pandora.UI.set('itemFind', data.find);
},
info: function(data) {
pandora.ui.annotationDialog(
Ox.getObjectById(pandora.site.layers, data.layer).title
).open();
},
muted: function(data) {
pandora.UI.set('videoMuted', data.muted);
},

View file

@ -67,6 +67,11 @@ pandora.ui.timeline = function(data) {
follow: function(data) {
pandora.UI.set('followPlayer', data.follow);
},
info: function(data) {
pandora.ui.annotationDialog(
Ox.getObjectById(pandora.site.layers, data.layer).title
).open();
},
muted: function(data) {
pandora.UI.set('videoMuted', data.muted);
},