OLD | NEW |
1 "use strict"; | 1 "use strict"; |
2 | 2 |
3 (function() | 3 (function() |
4 { | 4 { |
5 function escapeRegExp(string) | 5 function escapeRegExp(string) |
6 { | 6 { |
7 return string.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); | 7 return string.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); |
8 } | 8 } |
9 | 9 |
10 function hasClass(element, className) | 10 function hasClass(element, className) |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 element = element.parentElement; | 90 element = element.parentElement; |
91 } | 91 } |
92 } | 92 } |
93 | 93 |
94 function initMenu() | 94 function initMenu() |
95 { | 95 { |
96 if ("querySelector" in document) | 96 if ("querySelector" in document) |
97 document.querySelector("header nav").onclick = navigationClick; | 97 document.querySelector("header nav").onclick = navigationClick; |
98 } | 98 } |
99 | 99 |
100 function initFooterSection(section) | |
101 { | |
102 var header = section.getElementsByTagName("h1")[0]; | |
103 header.onclick = function() | |
104 { | |
105 toggleClass(section, "visible"); | |
106 }; | |
107 } | |
108 | |
109 function initFooter() | |
110 { | |
111 var footerContent = document.getElementById("footer-content"); | |
112 var footerNav = footerContent.getElementsByTagName("nav")[0]; | |
113 var footerNavSections = footerNav.getElementsByTagName("section"); | |
114 | |
115 for (var i = 0; i < footerNavSections.length; i++) | |
116 { | |
117 var section = footerNavSections[i]; | |
118 initFooterSection(section); | |
119 } | |
120 } | |
121 | |
122 initLanguageSelection(); | 100 initLanguageSelection(); |
123 initMenu(); | 101 initMenu(); |
124 initFooter(); | |
125 })(); | 102 })(); |
OLD | NEW |