summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@status.net>2009-12-23 15:42:37 -0500
committerSarven Capadisli <csarven@status.net>2009-12-23 15:42:37 -0500
commitbc4f1824eab81580fd862ad7f3c0d412868d7c68 (patch)
tree5f066a09b7bed4d8336c9a25b666de9641e14005 /js
parenteab6d1c95450cf9b209a0961ac325f2f9ce87d80 (diff)
Init UI for Repeat notice option confirmation dialog.
Diffstat (limited to 'js')
-rw-r--r--js/util.js36
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">&#215;</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() {