From c9a8095b5a0865493094e42f2eeaf5be257f0ae7 Mon Sep 17 00:00:00 2001 From: Git Date: Sun, 11 Aug 2013 08:00:48 +0000 Subject: [PATCH] Empty commit --- sections/torrents/notify.php | 2 +- static/functions/global.js | 21 ++++++++++++--------- static/functions/notifications.js | 25 ------------------------- 3 files changed, 13 insertions(+), 35 deletions(-) diff --git a/sections/torrents/notify.php b/sections/torrents/notify.php index c8a04bc5..51515049 100644 --- a/sections/torrents/notify.php +++ b/sections/torrents/notify.php @@ -228,7 +228,7 @@ function header_link($SortKey, $DefaultWay = 'desc') {
- + diff --git a/static/functions/global.js b/static/functions/global.js index 389c96db..c8003f56 100644 --- a/static/functions/global.js +++ b/static/functions/global.js @@ -1,13 +1,16 @@ -function toggleChecks(formElem,masterElem) { - if (masterElem.checked) { - checked = true; +/** + * Check or uncheck checkboxes in formElem + * If masterElem is false, toggle each box, otherwise use masterElem's status on all boxes + * If elemSelector is false, act on all checkboxes in formElem + */ +function toggleChecks(formElem, masterElem, elemSelector) { + elemSelector = elemSelector || 'input:checkbox'; + if (masterElem) { + $('#'+formElem+' '+elemSelector).prop('checked', masterElem.checked); } else { - checked = false; - } - for (s = 0; s < $('#'+formElem).raw().elements.length; s++) { - if ($('#'+formElem).raw().elements[s].type == "checkbox") { - $('#'+formElem).raw().elements[s].checked=checked; - } + $('#'+formElem+' '+elemSelector).each(function() { + this.checked = !this.checked; + }) } } diff --git a/static/functions/notifications.js b/static/functions/notifications.js index b05a2dfe..7c8b826d 100644 --- a/static/functions/notifications.js +++ b/static/functions/notifications.js @@ -23,28 +23,3 @@ function clearSelected(filterId) { } }); } - -function toggleBoxes(filterId, value) { - var filterForm = $('#notificationform_' + filterId); - var checkBoxes = $('.notify_box_' + filterId, filterForm); - for (var i = checkBoxes.length - 1; i >= 0; i--) { - $(checkBoxes[i]).prop('checked', value); - } -} - -/* Remove these */ -function GroupClear(form) { - for (var i = 0; i < form.elements.length; i++ ) { - if (form.elements[i].type == 'checkbox' && form.elements[i].name != 'toggle') { - if (form.elements[i].checked == true) { - Clear(form.elements[i].value); - } - } - } -} - -function SuperGroupClear() { - for (var i = 0; i < document.forms.length; i++ ) { - GroupClear(document.forms[i]); - } -}
NameYear' : ''?> Files