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 30 matching lines...) Expand all Loading... |
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 language = document.getElementById("language"); | 50 var language = document.getElementById("language"); |
| 51 |
| 52 // skip if page does not have language selection (EG: blog) |
| 53 if (!language) |
| 54 return; |
| 55 |
51 var languageSelection = language.getElementsByTagName("ul")[0]; | 56 var languageSelection = language.getElementsByTagName("ul")[0]; |
52 | 57 |
53 document.documentElement.onclick = function() | 58 document.documentElement.onclick = function() |
54 { | 59 { |
55 removeClass(languageSelection, "visible"); | 60 removeClass(languageSelection, "visible"); |
56 }; | 61 }; |
57 | 62 |
58 language.onclick = function(event) | 63 language.onclick = function(event) |
59 { | 64 { |
60 if (hasClass(languageSelection, "visible")) | 65 if (hasClass(languageSelection, "visible")) |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 { | 116 { |
112 var section = footerNavSections[i]; | 117 var section = footerNavSections[i]; |
113 initFooterSection(section); | 118 initFooterSection(section); |
114 } | 119 } |
115 } | 120 } |
116 | 121 |
117 initLanguageSelection(); | 122 initLanguageSelection(); |
118 initMenu(); | 123 initMenu(); |
119 initFooter(); | 124 initFooter(); |
120 })(); | 125 })(); |
OLD | NEW |