| 342 | return; |
| 343 | } |
| 344 | function enableGroupSelection(selector) { |
| 345 | var lastcheck = null; // no checkboxes clicked yet |
| 346 | // get desired checkboxes |
| 347 | var checkboxes = document.querySelectorAll(selector); |
| 348 | // loop over checkboxes to add event listener |
| 349 | Array.prototype.forEach.call(checkboxes, function (cbx, idx) { |
| 350 | cbx.addEventListener('click', function (evt) { |
| 351 | // test for shift key, not first checkbox, and not same checkbox |
| 352 | if (evt.shiftKey && null !== lastcheck && idx !== lastcheck) { |
| 353 | // get range of checks between last-checkbox and shift-checkbox |
| 354 | // Math.min/max does our sorting for us |
| 355 | Array.prototype.slice.call(checkboxes, Math.min(lastcheck, idx), Math.max(lastcheck, idx)) |
| 356 | // and loop over each |
| 357 | .forEach(function (ccbx) { |
| 358 | ccbx.checked = true; |
| 359 | }); |
| 360 | } |
| 361 | lastcheck = idx; // set this checkbox as last-checked for later |
| 362 | }); |
| 363 | }); |
| 364 | } |
| 365 | function searchInMapping() { |
| 366 | var searchValue = document.getElementById("searchMapping").value; |
| 367 | var trs = document.getElementById("content_table").getElementsByTagName("TR"); |