]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
try to make replies point to the clicked-on notice
authorEvan Prodromou <evan@controlyourself.ca>
Mon, 20 Oct 2008 17:02:45 +0000 (13:02 -0400)
committerEvan Prodromou <evan@controlyourself.ca>
Mon, 20 Oct 2008 17:02:45 +0000 (13:02 -0400)
darcs-hash:20081020170245-5ed1f-b84f63d9d9b589bd18f97924db547e348beb6647.gz

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

index e80c03031d9b65ef596b46dc5d12761ac4655c39..ac630eed0c28d60d8a8f391baa15cdbd6f782735 100644 (file)
@@ -58,8 +58,10 @@ class NewnoticeAction extends Action {
                        $cmd->execute(new WebChannel());
                        return;
                }
+
+               $replyto = $this->trimmed('inreplyto');
                
-               $notice = Notice::saveNew($user->id, $content, 'web');
+               $notice = Notice::saveNew($user->id, $content, 'web', $replyto);
                
                if (is_string($notice)) {
                        $this->show_form($notice);
index fe3ed74dc2d42d1d5dca52151d78fbc59e7c196f..0055c35dfade85bc35f7d495926eb6d372307213 100644 (file)
@@ -88,7 +88,7 @@ $(document).ready(function(){
      $("form.disfavor").each(addAjaxHidden);
 });
 
-function doreply(nick) {
+function doreply(nick,id) {
      rgx_username = /^[0-9a-zA-Z\-_.]*$/;
      if (nick.match(rgx_username)) {
           replyto = "@" + nick + " ";
@@ -97,6 +97,9 @@ function doreply(nick) {
                $("#status_textarea").focus();
                           return false;
                  }
+          if (id) {
+               $("#inreplyto").val(id);
+          }
      }
      return true;
 }
index 8a2c1e9b08f9b7d481747033a811d2f4c5b20898..ea452096cc937a42b0f14a862b977295b558b221 100644 (file)
@@ -87,7 +87,7 @@ class StreamAction extends PersonalAction {
                common_element_start('a',
                                                         array('href' => common_local_url('newnotice',
                                                                                                                          array('replyto' => $profile->nickname)),
-                                                                  'onclick' => 'return doreply("'.$profile->nickname.'");',
+                                                                  'onclick' => 'return doreply("'.$profile->nickname.'", '.$notice->id.');',
                                                                   'title' => _('reply'),
                                                                   'class' => 'replybutton'));
                common_raw('&rarr;');
index bb5da1396552356a6c73dfb8d29e14482dadec26..6e9e4533cf3e36c594bfa3bf7d93954368c48f05 100644 (file)
@@ -1298,6 +1298,8 @@ function common_notice_form($action=NULL, $content=NULL) {
        if ($action) {
                common_hidden('returnto', $action);
        }
+       # set by JavaScript
+       common_hidden('inreplyto', 'false');
        common_element('input', array('id' => 'status_submit',
                                                                  'name' => 'status_submit',
                                                                  'type' => 'submit',