From bc4f1824eab81580fd862ad7f3c0d412868d7c68 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Wed, 23 Dec 2009 15:42:37 -0500 Subject: Init UI for Repeat notice option confirmation dialog. --- js/util.js | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'js/util.js') diff --git a/js/util.js b/js/util.js index f60b5d313..9171c1e67 100644 --- a/js/util.js +++ b/js/util.js @@ -316,7 +316,41 @@ var SN = { // StatusNet }, NoticeRepeat: function() { - $('.form_repeat').each(function() { SN.U.FormXHR($(this)); }); + $('.form_repeat').each(function() { + SN.U.FormXHR($(this)); + SN.U.NoticeRepeatConfirmation($(this)); + }); + }, + + NoticeRepeatConfirmation: function(form) { + function NRC() { + form.closest('.notice-options').addClass('opaque'); + form.addClass('dialogbox'); + + form.append(''); + form.find('button.close').click(function(){ + $(this).remove(); + + form.closest('.notice-options').removeClass('opaque'); + form.removeClass('dialogbox'); + form.find('.submit_dialogbox').remove(); + form.find('.submit').show(); + + return false; + }); + }; + + form.find('.submit').bind('click', function(e) { + e.preventDefault(); + + var submit = form.find('.submit').clone(); + submit.addClass('submit_dialogbox'); + form.append(submit); + + $(this).hide(); + + NRC(); + }); }, NoticeAttachments: function() { -- cgit v1.2.3-54-g00ecf