]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'master' of ../trunk
authorsarven <csarven@plantard.controlezvous.ca>
Wed, 21 Jan 2009 05:26:56 +0000 (05:26 +0000)
committersarven <csarven@plantard.controlezvous.ca>
Wed, 21 Jan 2009 05:26:56 +0000 (05:26 +0000)
actions/subscribe.php
actions/unsubscribe.php
js/util.js
lib/messageform.php
theme/base/css/display.css

index b6f03f0f133c70ae2beba9384ab793680c9c4699..171332734e6d9bd8c4421b5568e185e251d072f2 100644 (file)
@@ -64,12 +64,13 @@ class SubscribeAction extends Action
         }
 
         if ($this->boolean('ajax')) {
-            common_start_html('text/xml;charset=utf-8', true);
+            $this->startHTML('text/xml;charset=utf-8', true);
             $this->elementStart('head');
             $this->element('title', null, _('Subscribed'));
             $this->elementEnd('head');
             $this->elementStart('body');
-            common_unsubscribe_form($other->getProfile());
+            $unsubscribe = new UnsubscribeForm($this, $other->getProfile());
+            $unsubscribe->show();
             $this->elementEnd('body');
             $this->elementEnd('html');
         } else {
index 32511a4b49c0f81cc05efe0d000d6a6bd06093d8..f9dd6f821246c721ca5d6a7f140cc64b2b88ffc4 100644 (file)
@@ -66,12 +66,13 @@ class UnsubscribeAction extends Action
         }
 
         if ($this->boolean('ajax')) {
-            common_start_html('text/xml;charset=utf-8', true);
+            $this->startHTML('text/xml;charset=utf-8', true);
             $this->elementStart('head');
             $this->element('title', null, _('Unsubscribed'));
             $this->elementEnd('head');
             $this->elementStart('body');
-            common_subscribe_form($other);
+            $subscribe = new SubscribeForm($this, $other);
+            $subscribe->show();
             $this->elementEnd('body');
             $this->elementEnd('html');
         } else {
index 0a03b86c23e2f8a53a264c4706e52dac4994baea..d98b63dd790bf44480b7ee9ef2f94f7aeb8a64b0 100644 (file)
@@ -98,8 +98,8 @@ $(document).ready(function(){
        $("#nudge").each(addAjaxHidden);
 
        var Subscribe = { dataType: 'xml',
-                                         beforeSubmit: function(formData, jqForm, options) { $("form.subscribe input[type=submit]").attr("disabled", "disabled");
-                                                                                                                                             $("form.subscribe input[type=submit]").addClass("disabled");
+                                         beforeSubmit: function(formData, jqForm, options) { $(".form_user_subscribe input[type=submit]").attr("disabled", "disabled");
+                                                                                                                                             $(".form_user_subscribe input[type=submit]").addClass("disabled");
                                                                                                                                            },
                                          success: function(xml) { var form_unsubscribe = document._importNode($('form', xml).get(0), true);
                                                                                           var form_unsubscribe_id = form_unsubscribe.id;
@@ -107,14 +107,14 @@ $(document).ready(function(){
                                                                                           $("form#"+form_subscribe_id).replaceWith(form_unsubscribe);
                                                                                           $("form#"+form_unsubscribe_id).ajaxForm(UnSubscribe).each(addAjaxHidden);
                                                                                           $("dd.subscribers").text(parseInt($("dd.subscribers").text())+1);
-                                                                                          $("form.subscribe input[type=submit]").removeAttr("disabled");
-                                                                                          $("form.subscribe input[type=submit]").removeClass("disabled");
+                                                                                          $(".form_user_subscribe input[type=submit]").removeAttr("disabled");
+                                                                                          $(".form_user_subscribe input[type=submit]").removeClass("disabled");
                                                                                     }
                                        };
 
        var UnSubscribe = { dataType: 'xml',
-                                               beforeSubmit: function(formData, jqForm, options) { $("form.unsubscribe input[type=submit]").attr("disabled", "disabled");
-                                                                                                                                                   $("form.unsubscribe input[type=submit]").addClass("disabled");
+                                               beforeSubmit: function(formData, jqForm, options) { $(".form_user_unsubscribe input[type=submit]").attr("disabled", "disabled");
+                                                                                                                                                   $(".form_user_unsubscribe input[type=submit]").addClass("disabled");
                                                                                                                                                  },
                                            success: function(xml) { var form_subscribe = document._importNode($('form', xml).get(0), true);
                                                                                                 var form_subscribe_id = form_subscribe.id;
@@ -124,15 +124,15 @@ $(document).ready(function(){
                                                                                                 $("#profile_send_a_new_message").remove();
                                                                                                 $("#profile_nudge").remove();
                                                                                             $("dd.subscribers").text(parseInt($("dd.subscribers").text())-1);
-                                                                                                $("form.unsubscribe input[type=submit]").removeAttr("disabled");
-                                                                                                $("form.unsubscribe input[type=submit]").removeClass("disabled");
+                                                                                                $(".form_user_unsubscribe input[type=submit]").removeAttr("disabled");
+                                                                                                $(".form_user_unsubscribe input[type=submit]").removeClass("disabled");
                                                                                           }
                                          };
 
-       $("form.subscribe").ajaxForm(Subscribe);
-       $("form.unsubscribe").ajaxForm(UnSubscribe);
-       $("form.subscribe").each(addAjaxHidden);
-       $("form.unsubscribe").each(addAjaxHidden);
+       $(".form_user_subscribe").ajaxForm(Subscribe);
+       $(".form_user_unsubscribe").ajaxForm(UnSubscribe);
+       $(".form_user_subscribe").each(addAjaxHidden);
+       $(".form_user_unsubscribe").each(addAjaxHidden);
 
 
        var PostNotice = { dataType: 'xml',
index eca39cc064de98445961e7a7eb137d69f8707623..61d3d75af26face5c970bb7e0d78b73d3f847567 100644 (file)
@@ -85,7 +85,7 @@ class MessageForm extends Form
 
     function id()
     {
-        return 'message_form';
+        return 'form_notice';
     }
 
     /**
@@ -99,6 +99,18 @@ class MessageForm extends Form
         return common_local_url('newmessage');
     }
 
+
+    /**
+     * Legend of the Form
+     *
+     * @return void
+     */
+    function formLegend()
+    {
+        $this->out->element('legend', null, _('Send a direct notice'));
+    }
+
+
     /**
      * Data elements
      *
@@ -122,18 +134,20 @@ class MessageForm extends Form
         $mutual_users->free();
         unset($mutual_users);
 
+        $this->out->elementStart('ul', 'form_data');
+        $this->out->elementStart('li', array('id' => 'notice_to'));
         $this->out->dropdown('to', _('To'), $mutual, null, false,
                              $this->to->id);
+        $this->out->elementEnd('li');
 
-        $this->out->elementStart('p');
-
-        $this->out->element('textarea', array('id' => 'message_content',
-                                              'cols' => 60,
-                                              'rows' => 3,
+        $this->out->elementStart('li', array('id' => 'notice_text'));
+        $this->out->element('textarea', array('id' => 'notice_data-text',
+                                              'cols' => 35,
+                                              'rows' => 4,
                                               'name' => 'content'),
                             ($this->content) ? $this->content : '');
-
-        $this->out->elementEnd('p');
+        $this->out->elementEnd('li');
+        $this->out->elementEnd('ul');
     }
 
     /**
@@ -144,9 +158,14 @@ class MessageForm extends Form
 
     function formActions()
     {
-        $this->out->element('input', array('id' => 'message_send',
+        $this->out->elementStart('ul', 'form_actions');
+        $this->out->elementStart('li', array('id' => 'notice_submit'));
+        $this->out->element('input', array('id' => 'notice_action-submit',
+                                           'class' => 'submit',
                                            'name' => 'message_send',
                                            'type' => 'submit',
                                            'value' => _('Send')));
+        $this->out->elementEnd('li');
+        $this->out->elementEnd('ul');
     }
-}
\ No newline at end of file
+}
index d2480be14aa436491b650ee5380d8c7abb78cd55..5b17fa53a57b1a8e77e5bf8851a89b5b529a4ab1 100644 (file)
@@ -482,6 +482,20 @@ padding:8px;
 #form_notice li {
 margin-bottom:0;
 }
+
+#form_notice #notice_to {
+margin-bottom:7px;
+}
+
+#notice_to label {
+float:left;
+margin-right:18px;
+margin-top:11px;
+}
+#notice_to select {
+float:left;
+}
+
 /*end FORM NOTICE*/