| OLD | NEW |
| 1 "use strict"; | 1 "use strict"; |
| 2 | 2 |
| 3 function addListener(element, eventType, callback, propagate) | |
| 4 { | |
| 5 if (element.addEventListener) | |
| 6 { | |
| 7 element.addEventListener(eventType, callback, propagate); | |
| 8 } | |
| 9 else | |
| 10 { | |
| 11 element.attachEvent("on" + eventType, callback); | |
| 12 } | |
| 13 } | |
| 14 | |
| 15 (function() | 3 (function() |
| 16 { | 4 { |
| 17 function init() | 5 function init() |
| 18 { | 6 { |
| 19 var manageButton = document.getElementById("manageExceptions"); | 7 var manageButton = document.getElementById("manageExceptions"); |
| 20 addListener(manageButton, "click", toggleManage, false); | 8 manageButton.addEventListener("click", toggleManage, false); |
| 21 } | 9 } |
| 22 | 10 |
| 23 function toggleManage(ev) | 11 function toggleManage(ev) |
| 24 { | 12 { |
| 25 var exceptions = document.getElementById("exceptions"); | 13 var exceptions = document.getElementById("exceptions"); |
| 26 | 14 |
| 27 if (exceptions.getAttribute("class")) | 15 if (exceptions.getAttribute("class")) |
| 28 exceptions.removeAttribute("class"); | 16 exceptions.removeAttribute("class"); |
| 29 else | 17 else |
| 30 exceptions.setAttribute("class", "visible"); | 18 exceptions.setAttribute("class", "visible"); |
| 31 | 19 |
| 32 // IE6-only | 20 // IE6-only |
| 33 if (exceptions.getAttribute("className")) | 21 if (exceptions.getAttribute("className")) |
| 34 exceptions.removeAttribute("className"); | 22 exceptions.removeAttribute("className"); |
| 35 else | 23 else |
| 36 exceptions.setAttribute("className", "visible"); | 24 exceptions.setAttribute("className", "visible"); |
| 37 } | 25 } |
| 38 | 26 |
| 39 init(); | 27 init(); |
| 40 })(); | 28 })(); |
| OLD | NEW |