From 2569e589c76d2c67de1b9ef8ae4f01924ba8f2cf Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 18 Dec 2011 09:30:35 +0000 Subject: [PATCH] add makeListPrivateDialog.js --- static/js/pandora/makeListPrivateDialog.js | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 static/js/pandora/makeListPrivateDialog.js diff --git a/static/js/pandora/makeListPrivateDialog.js b/static/js/pandora/makeListPrivateDialog.js new file mode 100644 index 00000000..73250190 --- /dev/null +++ b/static/js/pandora/makeListPrivateDialog.js @@ -0,0 +1,50 @@ +'use strict'; + +pandora.ui.makeListPrivateDialog = function(name, subscribers, callback) { + + var that = Ox.Dialog({ + buttons: [ + Ox.Button({ + id: 'keep', + title: 'Keep List Public' + }).bindEvent({ + click: function() { + that.close(); + callback(false); + } + }), + Ox.Button({ + id: 'make', + title: 'Make List Private' + }).bindEvent({ + click: function() { + that.close(); + callback(true); + } + }) + ], + content: Ox.Element() + .append( + $('') + .attr({src: '/static/png/icon64.png'}) + .css({position: 'absolute', left: '16px', top: '16px', width: '64px', height: '64px'}) + ) + .append( + $('
') + .css({position: 'absolute', left: '96px', top: '16px', width: '192px'}) + .html( + 'Are you sure you want to make the list "' + + name + '" private and lose its ' + + (subscribers == 1 ? 'subscriber' : subscribers + ' subscribers') + + '?' + ) + ), + height: 128, + keys: {enter: 'make', escape: 'keep'}, + title: 'Make List Private', + width: 304 + }) + + return that; + +}; \ No newline at end of file