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) {
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;
+}
+
'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('(');
_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');
}