pandora/static/js/annotationDialog.js

47 lines
1.7 KiB
JavaScript
Raw Normal View History

2012-02-01 18:08:03 +00:00
// vim: et:ts=4:sw=4:sts=4:ft=javascript
2012-02-03 09:15:38 +00:00
'use strict';
2012-02-01 18:08:03 +00:00
pandora.ui.annotationDialog = function(layer) {
var isEditor = pandora.user.ui.itemView == 'editor',
2013-03-03 05:34:44 +00:00
that = pandora.ui.iconDialog({
2012-05-24 08:22:56 +00:00
buttons: [].concat(
isEditor ? [
2013-05-09 10:13:58 +00:00
Ox.Button({title: Ox._('Sign Up...')}).bindEvent({
click: function() {
2013-03-03 05:34:44 +00:00
that.close();
pandora.$ui.accountDialog = pandora.ui.accountDialog('signup').open();
}
}),
2013-05-09 10:13:58 +00:00
Ox.Button({title: Ox._('Sign In...')}).bindEvent({
click: function() {
2013-03-03 05:34:44 +00:00
that.close();
pandora.$ui.accountDialog = pandora.ui.accountDialog('signin').open();
}
})
] : [
2013-05-09 10:13:58 +00:00
Ox.Button({title: Ox._('Switch to Editor')}).bindEvent({
click: function() {
2013-03-03 05:34:44 +00:00
that.close();
pandora.UI.set({itemView: 'editor'});
}
})
],
[
{},
2013-05-09 10:13:58 +00:00
Ox.Button({title: Ox._('Not Now')}).bindEvent({
click: function() {
2013-03-03 05:34:44 +00:00
that.close();
}
})
]
2012-02-01 18:08:03 +00:00
),
content: Ox._('To add or edit {0}, ' + (
2013-03-03 05:34:44 +00:00
isEditor
? 'please sign up or sign in.'
2013-07-23 07:19:58 +00:00
: 'just switch to the editor.'
), [layer.toLowerCase()]),
title: Ox.toTitleCase(layer)
});
2013-03-03 05:34:44 +00:00
return that;
2012-02-03 09:15:38 +00:00
};