pandora/static/js/makeListPrivateDialog.js

42 lines
1.3 KiB
JavaScript
Raw Normal View History

2014-02-10 08:28:35 +00:00
// vim: et:ts=4:sw=4:sts=4:ft=javascript
2011-12-18 09:30:35 +00:00
'use strict';
pandora.ui.makeListPrivateDialog = function(name, subscribers, callback) {
2014-02-10 08:28:35 +00:00
var ui = pandora.user.ui,
folderItem = ui.section == 'item' ? 'List' : 'Edit',
that = pandora.ui.iconDialog({
2011-12-18 09:30:35 +00:00
buttons: [
Ox.Button({
id: 'keep',
2014-02-10 08:28:35 +00:00
title: Ox._('Keep {0} Public', [folderItem])
2011-12-18 09:30:35 +00:00
}).bindEvent({
click: function() {
that.close();
callback(false);
}
}),
Ox.Button({
id: 'make',
2014-02-10 08:28:35 +00:00
title: Ox._('Make {0} Private', [folderItem])
2011-12-18 09:30:35 +00:00
}).bindEvent({
click: function() {
that.close();
callback(true);
}
})
],
2014-02-10 08:28:35 +00:00
content: Ox._('Are you sure you want to make the {0} "{1}" private and lose its {2}?', [
folderItem.toLowerCase(),
name,
subscribers == 1 ? Ox._('subscriber') : Ox._('{0} subscribers', [subscribers])
]),
keys: {enter: 'make', escape: 'keep'},
2014-02-10 08:28:35 +00:00
title: Ox._('Make {0} Private', [folderItem])
2013-03-03 05:34:44 +00:00
});
2011-12-18 09:30:35 +00:00
return that;
2013-05-09 10:13:58 +00:00
};