summaryrefslogtreecommitdiff
path: root/scripts/globalElements.js
blob: 05b2f71e19751b199868b75974ebb8753869bc82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// DEPENDENCIES:
// * /scripts/global.js
// * /scripts/sidebar.js
function updateGlobalElements() {
	if (isLangIndonesia()) {
		try {
			document.getElementById("lang-switcher-text").innerHTML = "Read in Indonesia";
		} catch {
			console.log("lang switcher button not found, moving on...")
		}
		document.getElementById("link-author").innerHTML = "Tentang Penulis";   
		document.getElementById("link-school").innerHTML = "Tentang Sekolah";   
		document.getElementById("link-lessons").innerHTML = "Mata Pelajaran";   
		document.getElementById("toc-title").innerHTML = "Daftar Isi"
	} else {
		try {
			document.getElementById("lang-switcher-text").innerHTML = "Read in Indonesia";
		} catch {
			console.log("lang switcher button not found, moving on...")
		}
	}

	if (isSidebarOpen() && document.body.clientWidth >= 1000) {
		openSidebar(false);
	} else {
		closeSidebar(false);
	}
}