OLD | NEW |
(Empty) | |
| 1 { |
| 2 {{DEBUG}} console.log('started hiding elements'); |
| 3 var selectors = JSON.parse({{BRIDGE}}.getElemhideSelectors()); |
| 4 {{DEBUG}} console.log('parsed selectors: ' + selectors.length); |
| 5 for (var i = 0; i < selectors.length; i++) |
| 6 { |
| 7 var selector = selectors[i]; |
| 8 if (selector[0] == '#') |
| 9 { |
| 10 var element = document.getElementById(selector.substr(1)); |
| 11 if (element != undefined) |
| 12 { |
| 13 {{DEBUG}} console.log('elem blocked ' + selector); |
| 14 element.style.display = 'none'; |
| 15 }; |
| 16 } |
| 17 else |
| 18 { |
| 19 var elements = document.getElementsByClassName(selector.substr(1)); |
| 20 for (var k=0; k < elements.length; k++) |
| 21 { |
| 22 {{DEBUG}} console.log('elem hidden ' + selector); |
| 23 elements[k].style.display = 'none'; |
| 24 } |
| 25 }; |
| 26 }; |
| 27 {{DEBUG}} console.log('finished hiding elements'); |
| 28 }; |
OLD | NEW |