replybutton.darc

Add a simple reply button to notices

darcs-hash:20080708112016-f7d30-321142883159fa91338754140ac4ea37e54bb746.gz
This commit is contained in:
mike 2008-07-08 07:20:16 -04:00
parent 99eaec8c89
commit 606297e453
5 changed files with 19 additions and 2 deletions

View File

@ -19,5 +19,14 @@ $(document).ready(function(){
// 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();
}
}

View File

@ -19,7 +19,7 @@
if (!defined('LACONICA')) { exit(1); }
require_once('XMPPHP/XMPP.php');
require_once('xmpp.php');
function jabber_valid_base_jid($jid) {
# Cheap but effective

View File

@ -86,6 +86,7 @@ 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('(');

View File

@ -568,4 +568,7 @@ input#openid_url {
}
/* ===== End Forms Styling ===== */
.replybutton {
margin-left: 55%;
}

View File

@ -595,3 +595,7 @@ input#openid_url {
}
/* ===== End Forms Styling ===== */
.replybutton {
margin-left: 55%;
}