diff options
Diffstat (limited to 'public/media/js/user.js')
| -rw-r--r-- | public/media/js/user.js | 86 |
1 files changed, 4 insertions, 82 deletions
diff --git a/public/media/js/user.js b/public/media/js/user.js index 15c3075..26f4e80 100644 --- a/public/media/js/user.js +++ b/public/media/js/user.js @@ -21,89 +21,11 @@ $(document).ready(function(){ }); function checkAllCheckBoxes(exceptions) { - var elements = document.getElementsByTagName('input'); - if(!elements) { - return; - } - var countElements = elements.length; - var countExceptions; - if(exceptions) { - countExceptions = exceptions.length; - } else { - countExceptions = 0; - } - var foundException = false; - if(!countElements) { - if(elements.getAttribute('type') == 'checkbox') { - for(var j = 0; j < countExceptions; j++) { - if(elements.getAttribute('name') == exceptions[j]) { - foundException = true - break; - } - } - if(!foundException) { - elements.checked = true; - } - foundException = false; - } - } else { - for(var i = 0; i < countElements; i++) { - if(elements[i].getAttribute('type') == 'checkbox') { - for(var j = 0; j < countExceptions; j++) { - if(elements[i].getAttribute('name') == exceptions[j]) { - foundException = true - break; - } - } - if(!foundException) { - elements[i].checked = true; - } - foundException = false; - } - } - } + $('input:checkbox').attr('checked','checked'); + return; } function uncheckAllCheckBoxes(exceptions) { - var elements = document.getElementsByTagName('input'); - if(!elements) { - return; - } - var countElements = elements.length; - var countExceptions; - if(exceptions) { - countExceptions = exceptions.length; - } else { - countExceptions = 0; - } - var foundException = false; - if(!countElements) { - if(elements.getAttribute('type') == 'checkbox') { - for(var j = 0; j < countExceptions; j++) { - if(elements.getAttribute('name') == exceptions[j]) { - foundException = true - break; - } - } - if(!foundException) { - elements.checked = false; - } - foundException = false; - } - } else { - for(var i = 0; i < countElements; i++) { - if(elements[i].getAttribute('type') == 'checkbox') { - for(var j = 0; j < countExceptions; j++) { - if(elements[i].getAttribute('name') == exceptions[j]) { - foundException = true - break; - } - } - if(!foundException) { - elements[i].checked = false; - } - foundException = false; - } - } - } + $('input:checkbox').attr('checked',''); + return; } |
