LEFT | RIGHT |
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 29 matching lines...) Expand all Loading... |
40 { | 40 { |
41 if (typeof window.event !== "undefined" | 41 if (typeof window.event !== "undefined" |
42 && typeof window.event.cancelBubble !== "undefined") | 42 && typeof window.event.cancelBubble !== "undefined") |
43 window.event.cancelBubble = true; | 43 window.event.cancelBubble = true; |
44 else | 44 else |
45 event.stopPropagation(); | 45 event.stopPropagation(); |
46 } | 46 } |
47 | 47 |
48 function initLanguageSelection() | 48 function initLanguageSelection() |
49 { | 49 { |
50 var locale = document.getElementById("locale-selected"); | 50 var locale = document.getElementById("navbar-locale-selected"); |
51 | 51 |
52 // skip if page does not have language selection (EG: blog) | 52 // skip if page does not have language selection (EG: blog) |
53 if (!locale) | 53 if (!locale) |
54 return; | 54 return; |
55 | 55 |
56 locale.onclick = function() | 56 locale.onclick = function() |
57 { | 57 { |
58 toggleClass(document.getElementById("locale-menu"), "visible"); | 58 toggleClass(document.getElementById("navbar-locale-menu"), "visible"); |
59 }; | 59 }; |
60 } | 60 } |
61 | 61 |
62 function navigationClick(event) | 62 function navigationClick(event) |
63 { | 63 { |
64 toggleClass(document.getElementById("navbar-menu"), "visible"); | 64 toggleClass(document.getElementById("navbar-menu"), "visible"); |
65 } | 65 } |
66 | 66 |
67 function initMenu() | 67 function initMenu() |
68 { | 68 { |
69 document.getElementById("menu-toggle").onclick = navigationClick; | 69 document.getElementById("navbar-menu-toggle").onclick = navigationClick; |
70 } | 70 } |
71 | 71 |
72 function initFooterSection(section) | 72 function initFooterSection(section) |
73 { | 73 { |
74 var header = section.getElementsByTagName("h1")[0]; | 74 var header = section.getElementsByTagName("h1")[0]; |
75 header.onclick = function() | 75 header.onclick = function() |
76 { | 76 { |
77 toggleClass(section, "visible"); | 77 toggleClass(section, "visible"); |
78 }; | 78 }; |
79 } | 79 } |
80 | 80 |
81 function initFooter() | 81 function initFooter() |
82 { | 82 { |
83 var footerContent = document.getElementById("footer-content"); | 83 var footerContent = document.getElementById("footer-content"); |
84 var footerNav = footerContent.getElementsByTagName("nav")[0]; | 84 var footerNav = footerContent.getElementsByTagName("nav")[0]; |
85 var footerNavSections = footerNav.getElementsByTagName("section"); | 85 var footerNavSections = footerNav.getElementsByTagName("section"); |
86 | 86 |
87 for (var i = 0; i < footerNavSections.length; i++) | 87 for (var i = 0; i < footerNavSections.length; i++) |
88 { | 88 { |
89 var section = footerNavSections[i]; | 89 var section = footerNavSections[i]; |
90 initFooterSection(section); | 90 initFooterSection(section); |
91 } | 91 } |
92 } | 92 } |
93 | 93 |
94 initLanguageSelection(); | 94 initLanguageSelection(); |
95 initMenu(); | 95 initMenu(); |
96 initFooter(); | 96 initFooter(); |
97 })(); | 97 })(); |
LEFT | RIGHT |