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) {
|
2012-04-22 11:13:42 +00:00
|
|
|
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(
|
2012-04-22 11:13:42 +00:00
|
|
|
isEditor ? [
|
2013-05-09 10:13:58 +00:00
|
|
|
Ox.Button({title: Ox._('Sign Up...')}).bindEvent({
|
2012-04-22 11:13:42 +00:00
|
|
|
click: function() {
|
2013-03-03 05:34:44 +00:00
|
|
|
that.close();
|
2012-04-22 11:13:42 +00:00
|
|
|
pandora.$ui.accountDialog = pandora.ui.accountDialog('signup').open();
|
|
|
|
}
|
|
|
|
}),
|
2013-05-09 10:13:58 +00:00
|
|
|
Ox.Button({title: Ox._('Sign In...')}).bindEvent({
|
2012-04-22 11:13:42 +00:00
|
|
|
click: function() {
|
2013-03-03 05:34:44 +00:00
|
|
|
that.close();
|
2012-04-22 11:13:42 +00:00
|
|
|
pandora.$ui.accountDialog = pandora.ui.accountDialog('signin').open();
|
|
|
|
}
|
|
|
|
})
|
|
|
|
] : [
|
2013-05-09 10:13:58 +00:00
|
|
|
Ox.Button({title: Ox._('Switch to Editor')}).bindEvent({
|
2012-04-22 11:13:42 +00:00
|
|
|
click: function() {
|
2013-03-03 05:34:44 +00:00
|
|
|
that.close();
|
2012-04-22 11:13:42 +00:00
|
|
|
pandora.UI.set({itemView: 'editor'});
|
|
|
|
}
|
|
|
|
})
|
|
|
|
],
|
|
|
|
[
|
|
|
|
{},
|
2013-05-09 10:13:58 +00:00
|
|
|
Ox.Button({title: Ox._('Not Now')}).bindEvent({
|
2012-04-22 11:13:42 +00:00
|
|
|
click: function() {
|
2013-03-03 05:34:44 +00:00
|
|
|
that.close();
|
2012-04-22 11:13:42 +00:00
|
|
|
}
|
|
|
|
})
|
|
|
|
]
|
2012-02-01 18:08:03 +00:00
|
|
|
),
|
2013-08-08 13:04:51 +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()]),
|
2012-04-22 11:13:42 +00:00
|
|
|
title: Ox.toTitleCase(layer)
|
|
|
|
});
|
2013-03-03 05:34:44 +00:00
|
|
|
return that;
|
2012-02-03 09:15:38 +00:00
|
|
|
};
|