Skip to content

Commit

Permalink
MDL-21944, remve ### link target
Browse files Browse the repository at this point in the history
  • Loading branch information
Dongsheng Cai committed Apr 7, 2010
1 parent 98da602 commit 1150c1b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
14 changes: 9 additions & 5 deletions comment/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ M.core_comment = {
return false;
}, this);
CommentHelper.confirmoverlay = new Y.Overlay({
bodyContent: '<a href="###" id="confirmdelete-'+this.client_id+'">'+M.str.moodle.sure+'</a> <a href="###" id="canceldelete-'+this.client_id+'">'+M.str.moodle.cancel+'</a>',
bodyContent: '<a href="#" id="confirmdelete-'+this.client_id+'">'+M.str.moodle.sure+'</a> <a href="#" id="canceldelete-'+this.client_id+'">'+M.str.moodle.cancel+'</a>',
visible: false
});
CommentHelper.confirmoverlay.render(document.body);
Expand Down Expand Up @@ -168,7 +168,7 @@ bodyContent: '<a href="###" id="confirmdelete-'+this.client_id+'">'+M.str.moodle
var val = template.get('innerHTML');
val = val.replace('___name___', list[i].username);
if (list[i]['delete']||newcmt) {
list[i].content = '<div class="comment-delete"><a href="###" id ="comment-delete-'+this.client_id+'-'+list[i].id+'" title="'+M.str.moodle.deletecomment+'"><img src="'+M.util.image_url('t/delete', 'core')+'" /></a></div>' + list[i].content;
list[i].content = '<div class="comment-delete"><a href="#" id ="comment-delete-'+this.client_id+'-'+list[i].id+'" title="'+M.str.moodle.deletecomment+'"><img src="'+M.util.image_url('t/delete', 'core')+'" /></a></div>' + list[i].content;
}
val = val.replace('___time___', list[i].time);
val = val.replace('___picture___', list[i].avatar);
Expand Down Expand Up @@ -262,6 +262,7 @@ bodyContent: '<a href="###" id="confirmdelete-'+this.client_id+'">'+M.str.moodle
Y.Event.purgeElement('#'+theid, false, 'click');
}
node.on('click', function(e, node) {
e.preventDefault();
var width = CommentHelper.confirmoverlay.bodyNode.getStyle('width');
var re = new RegExp("(\\d+).*", "i");
var result = width.match(re);
Expand All @@ -274,11 +275,13 @@ bodyContent: '<a href="###" id="confirmdelete-'+this.client_id+'">'+M.str.moodle
CommentHelper.confirmoverlay.set('visible', true);
// XXX: YUI3 bug, a temp workaround in firefox, still have problem on webkit
CommentHelper.confirmoverlay.bodyNode.setStyle('visibility', 'visible');
Y.one('#canceldelete-'+scope.client_id).on('click', function() {
Y.one('#canceldelete-'+scope.client_id).on('click', function(e) {
e.preventDefault();
scope.cancel_delete();
});
Y.Event.purgeElement('#confirmdelete-'+scope.client_id, false, 'click');
Y.one('#confirmdelete-'+scope.client_id).on('click', function() {
Y.one('#confirmdelete-'+scope.client_id).on('click', function(e) {
e.preventDefault();
if (commentid[1]) {
scope.dodelete(commentid[1]);
}
Expand All @@ -298,6 +301,7 @@ bodyContent: '<a href="###" id="confirmdelete-'+this.client_id+'">'+M.str.moodle
Y.all('#comment-pagination-'+this.client_id+' a').each(
function(node, id) {
node.on('click', function(e, node) {
e.preventDefault();
var id = node.get('id');
var re = new RegExp("comment-page-"+this.client_id+"-(\\d+)", "i");
var result = id.match(re);
Expand Down Expand Up @@ -367,7 +371,7 @@ bodyContent: '<a href="###" id="confirmdelete-'+this.client_id+'">'+M.str.moodle
},
init_admin: function(Y) {
var select_all = Y.one('#comment_select_all');
select_all.on('click', function() {
select_all.on('click', function(e) {
var comments = document.getElementsByName('comments');
var checked = false;
for (var i in comments) {
Expand Down
8 changes: 4 additions & 4 deletions comment/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,12 @@ public function output($return = true) {
<textarea name="content" rows="2" id="dlg-content-{$this->cid}"></textarea>
</div>
<div class="fd" id="comment-action-{$this->cid}">
<a href="###" id="comment-action-post-{$this->cid}"> {$strsubmit} </a>
<a href="#" id="comment-action-post-{$this->cid}"> {$strsubmit} </a>
EOD;
if ($this->env != 'block_comments') {
$html .= <<<EOD
<span> | </span>
<a href="###" id="comment-action-cancel-{$this->cid}"> {$strcancel} </a>
<a href="#" id="comment-action-cancel-{$this->cid}"> {$strcancel} </a>
EOD;
}

Expand Down Expand Up @@ -449,7 +449,7 @@ public function get_pagination($page = 0) {
} else {
$class = 'pageno';
}
$str .= '<a href="###" class="'.$class.'" id="comment-page-'.$this->cid.'-'.$p.'">'.($p+1).'</a> ';
$str .= '<a href="#" class="'.$class.'" id="comment-page-'.$this->cid.'-'.$p.'">'.($p+1).'</a> ';
}
$str .= '</div>';
}
Expand Down Expand Up @@ -594,7 +594,7 @@ public function print_comment($cmt, $nonjs = true) {
$replacements = array();

if (!empty($cmt->delete) && empty($nonjs)) {
$cmt->content = '<div class="comment-delete"><a href="###" id ="comment-delete-'.$this->cid.'-'.$cmt->id.'"><img src="'.$OUTPUT->pix_url('t/delete').'" /></a></div>' . $cmt->content;
$cmt->content = '<div class="comment-delete"><a href="#" id ="comment-delete-'.$this->cid.'-'.$cmt->id.'"><img src="'.$OUTPUT->pix_url('t/delete').'" /></a></div>' . $cmt->content;
// add the button
}
$patterns[] = '___picture___';
Expand Down

0 comments on commit 1150c1b

Please sign in to comment.