try to make replies point to the clicked-on notice
darcs-hash:20081020170245-5ed1f-b84f63d9d9b589bd18f97924db547e348beb6647.gz
This commit is contained in:
parent
b2f0ad1ccc
commit
f2e3021b59
|
@ -58,8 +58,10 @@ class NewnoticeAction extends Action {
|
||||||
$cmd->execute(new WebChannel());
|
$cmd->execute(new WebChannel());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$replyto = $this->trimmed('inreplyto');
|
||||||
|
|
||||||
$notice = Notice::saveNew($user->id, $content, 'web');
|
$notice = Notice::saveNew($user->id, $content, 'web', $replyto);
|
||||||
|
|
||||||
if (is_string($notice)) {
|
if (is_string($notice)) {
|
||||||
$this->show_form($notice);
|
$this->show_form($notice);
|
||||||
|
|
|
@ -88,7 +88,7 @@ $(document).ready(function(){
|
||||||
$("form.disfavor").each(addAjaxHidden);
|
$("form.disfavor").each(addAjaxHidden);
|
||||||
});
|
});
|
||||||
|
|
||||||
function doreply(nick) {
|
function doreply(nick,id) {
|
||||||
rgx_username = /^[0-9a-zA-Z\-_.]*$/;
|
rgx_username = /^[0-9a-zA-Z\-_.]*$/;
|
||||||
if (nick.match(rgx_username)) {
|
if (nick.match(rgx_username)) {
|
||||||
replyto = "@" + nick + " ";
|
replyto = "@" + nick + " ";
|
||||||
|
@ -97,6 +97,9 @@ function doreply(nick) {
|
||||||
$("#status_textarea").focus();
|
$("#status_textarea").focus();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (id) {
|
||||||
|
$("#inreplyto").val(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,7 +87,7 @@ class StreamAction extends PersonalAction {
|
||||||
common_element_start('a',
|
common_element_start('a',
|
||||||
array('href' => common_local_url('newnotice',
|
array('href' => common_local_url('newnotice',
|
||||||
array('replyto' => $profile->nickname)),
|
array('replyto' => $profile->nickname)),
|
||||||
'onclick' => 'return doreply("'.$profile->nickname.'");',
|
'onclick' => 'return doreply("'.$profile->nickname.'", '.$notice->id.');',
|
||||||
'title' => _('reply'),
|
'title' => _('reply'),
|
||||||
'class' => 'replybutton'));
|
'class' => 'replybutton'));
|
||||||
common_raw('→');
|
common_raw('→');
|
||||||
|
|
|
@ -1298,6 +1298,8 @@ function common_notice_form($action=NULL, $content=NULL) {
|
||||||
if ($action) {
|
if ($action) {
|
||||||
common_hidden('returnto', $action);
|
common_hidden('returnto', $action);
|
||||||
}
|
}
|
||||||
|
# set by JavaScript
|
||||||
|
common_hidden('inreplyto', 'false');
|
||||||
common_element('input', array('id' => 'status_submit',
|
common_element('input', array('id' => 'status_submit',
|
||||||
'name' => 'status_submit',
|
'name' => 'status_submit',
|
||||||
'type' => 'submit',
|
'type' => 'submit',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user