diff options
Diffstat (limited to 'js/util.js')
-rw-r--r-- | js/util.js | 36 |
1 files changed, 35 insertions, 1 deletions
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('<button class="close">×</button>'); + 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() { |