2013-02-15 08:00:35 +00:00
|
|
|
function clearItem(torrentId) {
|
|
|
|
ajax.get("?action=notify_clear_item&torrentid=" + torrentId + "&auth=" + authkey, function() {
|
|
|
|
$("#torrent" + torrentId).remove();
|
|
|
|
});
|
2012-02-09 08:00:20 +00:00
|
|
|
}
|
|
|
|
|
2013-02-15 08:00:35 +00:00
|
|
|
function clearSelected(filterId) {
|
|
|
|
var checkBoxes, checkedBoxes = [];
|
|
|
|
if (filterId) {
|
2013-06-28 08:01:04 +00:00
|
|
|
var filterForm = $('#notificationform_' + filterId);
|
|
|
|
checkBoxes = $('.notify_box_' + filterId, filterForm);
|
2013-02-15 08:00:35 +00:00
|
|
|
} else {
|
2013-06-27 08:01:06 +00:00
|
|
|
checkBoxes = $('.notify_box');
|
2013-02-15 08:00:35 +00:00
|
|
|
}
|
|
|
|
for (var i = checkBoxes.length - 1; i >= 0; i--) {
|
|
|
|
if (checkBoxes[i].checked) {
|
|
|
|
checkedBoxes.push(checkBoxes[i].value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ajax.get("?action=notify_clear_items&torrentids=" + checkedBoxes.join(',') + "&auth=" + authkey, function() {
|
|
|
|
for (var i = checkedBoxes.length - 1; i >= 0; i--) {
|
|
|
|
$('#torrent' + checkedBoxes[i]).remove();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function toggleBoxes(filterId, value) {
|
2013-06-28 08:01:04 +00:00
|
|
|
var filterForm = $('#notificationform_' + filterId);
|
|
|
|
var checkBoxes = $('.notify_box_' + filterId, filterForm);
|
2013-02-15 08:00:35 +00:00
|
|
|
for (var i = checkBoxes.length - 1; i >= 0; i--) {
|
2013-06-27 08:01:06 +00:00
|
|
|
$(checkBoxes[i]).prop('checked', value);
|
2012-02-09 08:00:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-02-15 08:00:35 +00:00
|
|
|
/* Remove these */
|
|
|
|
function GroupClear(form) {
|
2012-02-09 08:00:20 +00:00
|
|
|
for (var i = 0; i < form.elements.length; i++ ) {
|
2013-02-15 08:00:35 +00:00
|
|
|
if (form.elements[i].type == 'checkbox' && form.elements[i].name != 'toggle') {
|
|
|
|
if (form.elements[i].checked == true) {
|
|
|
|
Clear(form.elements[i].value);
|
|
|
|
}
|
|
|
|
}
|
2012-02-09 08:00:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function SuperGroupClear() {
|
|
|
|
for (var i = 0; i < document.forms.length; i++ ) {
|
2013-02-15 08:00:35 +00:00
|
|
|
GroupClear(document.forms[i]);
|
2012-02-09 08:00:20 +00:00
|
|
|
}
|
2013-02-15 08:00:35 +00:00
|
|
|
}
|