Using util.js to set onclick reply anchor
This commit is contained in:
parent
cf387ad4ab
commit
0daf242100
18
js/util.js
18
js/util.js
|
@ -176,6 +176,7 @@ $(document).ready(function(){
|
||||||
counter();
|
counter();
|
||||||
$("#notices_primary .notice:first").css({display:"none"});
|
$("#notices_primary .notice:first").css({display:"none"});
|
||||||
$("#notices_primary .notice:first").fadeIn(2500);
|
$("#notices_primary .notice:first").fadeIn(2500);
|
||||||
|
NoticeHover();
|
||||||
}
|
}
|
||||||
$("#notice_action-submit").removeAttr("disabled");
|
$("#notice_action-submit").removeAttr("disabled");
|
||||||
$("#notice_action-submit").removeClass("disabled");
|
$("#notice_action-submit").removeClass("disabled");
|
||||||
|
@ -184,6 +185,19 @@ $(document).ready(function(){
|
||||||
$("#form_notice").ajaxForm(PostNotice);
|
$("#form_notice").ajaxForm(PostNotice);
|
||||||
$("#form_notice").each(addAjaxHidden);
|
$("#form_notice").each(addAjaxHidden);
|
||||||
|
|
||||||
|
NoticeHover();
|
||||||
|
|
||||||
|
$('#content .notice').each(function() {
|
||||||
|
var notice = $(this);
|
||||||
|
$('.notice_reply', $(this)).click(function() {
|
||||||
|
var nickname = ($('.author .nickname', notice).length > 0) ? $('.author .nickname', notice) : $('.author .nickname');
|
||||||
|
NoticeReply(nickname.text(), $('.notice_id', notice).text());
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function NoticeHover() {
|
||||||
$("#content .notice").hover(
|
$("#content .notice").hover(
|
||||||
function () {
|
function () {
|
||||||
$(this).addClass('hover');
|
$(this).addClass('hover');
|
||||||
|
@ -192,9 +206,9 @@ $(document).ready(function(){
|
||||||
$(this).removeClass('hover');
|
$(this).removeClass('hover');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
}
|
||||||
|
|
||||||
function doreply(nick,id) {
|
function NoticeReply(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 + " ";
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
* @category UI
|
* @category UI
|
||||||
* @package Laconica
|
* @package Laconica
|
||||||
* @author Evan Prodromou <evan@controlyourself.ca>
|
* @author Evan Prodromou <evan@controlyourself.ca>
|
||||||
|
* @author Sarven Capadisli <csarven@controlyourself.ca>
|
||||||
* @copyright 2008 Control Yourself, Inc.
|
* @copyright 2008 Control Yourself, Inc.
|
||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
||||||
* @link http://laconi.ca/
|
* @link http://laconi.ca/
|
||||||
|
@ -440,8 +441,11 @@ class NoticeListItem extends Widget
|
||||||
$this->out->elementStart('dl', 'notice_reply');
|
$this->out->elementStart('dl', 'notice_reply');
|
||||||
$this->out->element('dt', null, _('Reply to this notice'));
|
$this->out->element('dt', null, _('Reply to this notice'));
|
||||||
$this->out->elementStart('dd');
|
$this->out->elementStart('dd');
|
||||||
$this->out->element('a', array('href' => $reply_url,
|
$this->out->elementStart('a', array('href' => $reply_url,
|
||||||
'title' => _('Reply to this notice')), _('Reply'));
|
'title' => _('Reply to this notice')));
|
||||||
|
$this->out->text(_('Reply'));
|
||||||
|
$this->out->element('span', 'notice_id', $this->notice->id);
|
||||||
|
$this->out->elementEnd('a');
|
||||||
$this->out->elementEnd('dd');
|
$this->out->elementEnd('dd');
|
||||||
$this->out->elementEnd('dl');
|
$this->out->elementEnd('dl');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user