|
|
Line 1: |
Line 1: |
| /* Any JavaScript here will be loaded for all users on every page load. */ | | /* Any JavaScript here will be loaded for all users on every page load. */ |
| /* Make the language and edition selectors work */
| |
| function showLanguage(event, language) {
| |
|
| |
| Â Â var i, langcontent, languagetab, newcontent;
| |
|
| |
| Â Â // Get all elements with class="language-content" and hide them
| |
| Â Â langcontent = document.getElementsByClassName("language-items");
| |
| Â Â for (i = 0; i < langcontent.length; i++) {
| |
| Â Â Â langcontent[i].style.display = "none";
| |
| Â Â }
| |
|
| |
| Â Â // Get all elements with class="tab-language" and remove the class "active"
| |
| Â Â languagetab = document.getElementsByClassName("tab-language");
| |
| Â Â for (i = 0; i < languagetab.length; i++) {
| |
| Â Â Â languagetab[i].className = languagetab[i].className.replace(" active", "");
| |
| Â Â }
| |
|
| |
| Â Â // Show the current content, and add an "active" class to the button that opened the tab
| |
| Â Â newcontent = document.getElementsByClassName("language-items" + " " + language);
| |
| Â Â for (i = 0; i < newcontent.length; i++) {
| |
| Â Â Â newcontent[i].style.display = "initial";
| |
| Â Â }
| |
| Â Â event.currentTarget.className += " active";
| |
| Â Â return;
| |
| }
| |
|
| |
| function showEdition(event, edition) {
| |
| Â Â return;
| |
| }
| |