]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
fallback to newnotice on reply button, new button with mouseover
authorEvan Prodromou <evan@prodromou.name>
Wed, 9 Jul 2008 07:14:39 +0000 (03:14 -0400)
committerEvan Prodromou <evan@prodromou.name>
Wed, 9 Jul 2008 07:14:39 +0000 (03:14 -0400)
darcs-hash:20080709071439-84dde-f85f0e97f7c14bb77b7174f281e3e9f75c23cac1.gz

actions/newnotice.php
js/util.js
lib/stream.php

index 0045d6c745e01b087966e0000f6907897de1ab0c..a7a3f8362ca432e7a1f277097869cb03d524001b 100644 (file)
@@ -94,6 +94,13 @@ class NewnoticeAction extends Action {
 
        function show_form($msg=NULL) {
                $content = $this->trimmed('status_textarea');
+               if (!$content) {
+                       $replyto = $this->trimmed('replyto');
+                       $profile = Profile::staticGet('nickname', $replyto);
+                       if ($profile) {
+                               $content = "@$profile ";
+                       }
+               }
                common_show_header(_t('New notice'), NULL, $content,
                                   array($this, 'show_top'));
                if ($msg) {
index 50c311f993b558e420067552b540690c5c013ac8..d0116574bf2d93d3b6013a430d8a73c230af8853 100644 (file)
@@ -13,20 +13,23 @@ $(document).ready(function(){
                 counter.attr("class", "");
                 }
         }
-
+     
         if ($("#status_textarea").length) {
             $("#status_textarea").bind("keyup", counter);
             // run once in case there's something in there
                        counter();
         }
-
 });
 
-        function doreply(nick) {
-            rgx_username = /^[0-9a-zA-Z\-_.]*$/;
-            if (nick.match(rgx_username)) {
-              replyto = "@" + nick + " ";
-              document.getElementById("status_textarea").value=replyto; 
-              document.getElementById("status_textarea").focus();
-            }
-        }
+function doreply(nick) {
+     rgx_username = /^[0-9a-zA-Z\-_.]*$/;
+     if (nick.match(rgx_username)) {
+          replyto = "@" + nick + " ";
+          if ($("#status_textarea")) {
+               $("#status_textarea").value=replyto;
+               $("#status_textarea").focus();
+          }
+     }
+     return false;
+}
+
index bef3abff019ae790ee053cefb55bd1171d7d1827..8846920efd1808c486606afcfc1baa902fddce67 100644 (file)
@@ -86,7 +86,6 @@ class StreamAction extends Action {
                                                                  'href' => $noticeurl,
                                                                  'title' => common_exact_date($notice->created)),
                                           common_date_string($notice->created));
-               common_element('a', array('href' => "#", 'onclick' => 'javascript: doreply("'.$profile->nickname.'")', 'class' => 'replybutton'), 'reply');
                if ($replied_id) {
                        $replyurl = common_local_url('shownotice', array('notice' => $replied_id));
                        common_text('(');
@@ -95,6 +94,13 @@ class StreamAction extends Action {
                                                   _t(' in reply to...'));
                        common_text(')');
                }
+               common_element('a', 
+                                          array('href' => common_local_url('newnotice',
+                                                        array('replyto' => $profile->nickname)),
+                                                        'onclick' => 'doreply("'.$profile->nickname.'")',
+                             'title' => _t('reply'),
+                                                        'class' => 'replybutton'),
+                                          _t('↺'));
                common_element_end('p');
                common_element_end('li');
        }