2009-11-01 16:48:45 +00:00
|
|
|
YAHOO.util.Event.onDOMReady(init);
|
2009-07-24 02:44:44 +00:00
|
|
|
function init() {
|
|
|
|
var select_all = document.getElementById('comment_select_all');
|
|
|
|
select_all.onclick = function() {
|
|
|
|
var comments = document.getElementsByName('comments');
|
|
|
|
var checked = false;
|
|
|
|
for (var i in comments) {
|
|
|
|
if (comments[i].checked) {
|
|
|
|
checked=true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (var i in comments) {
|
|
|
|
comments[i].checked = !checked;
|
|
|
|
}
|
|
|
|
this.checked = !checked;
|
|
|
|
}
|
|
|
|
var comments_delete = document.getElementById('comments_delete');
|
|
|
|
comments_delete.onclick = function() {
|
|
|
|
delete_comments();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function delete_comments() {
|
2010-01-21 22:19:46 +00:00
|
|
|
var url = M.cfg.wwwroot + '/comment/index.php';
|
2009-07-24 02:44:44 +00:00
|
|
|
var cb = {
|
|
|
|
success:function(o) {
|
|
|
|
if (o.responseText == 'yes') {
|
|
|
|
location.reload();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var comments = document.getElementsByName('comments');
|
|
|
|
var list = '';
|
|
|
|
for (var i in comments) {
|
|
|
|
if (comments[i].checked) {
|
|
|
|
list += (comments[i].value + '-');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var data = {
|
|
|
|
'commentids': list,
|
2010-01-21 22:19:46 +00:00
|
|
|
'sesskey': M.cfg.sesskey
|
2009-07-24 02:44:44 +00:00
|
|
|
}
|
|
|
|
var trans = YAHOO.util.Connect.asyncRequest('POST',
|
|
|
|
url+'?action=delete', cb, build_querystring(data));
|
|
|
|
}
|