mirror of
https://github.com/ivabus/www
synced 2024-11-26 11:55:06 +03:00
This should work once the Belarusian translation uploaded
Future maintenance will simply be adding new entries to the `versions` array.
This commit is contained in:
parent
941315f7a8
commit
d535481a98
2 changed files with 22 additions and 15 deletions
|
@ -10,4 +10,5 @@ exclude = [
|
||||||
"https://www.clarity.ms/tag/",
|
"https://www.clarity.ms/tag/",
|
||||||
"https://www.googletagmanager.com/gtm.js",
|
"https://www.googletagmanager.com/gtm.js",
|
||||||
".*/mailto:.*@.*",
|
".*/mailto:.*@.*",
|
||||||
|
"https://tea.xyz/tea.white-paper",
|
||||||
]
|
]
|
||||||
|
|
|
@ -79,23 +79,29 @@
|
||||||
<button class="btn btn-secondary dropdown-toggle languages" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
<button class="btn btn-secondary dropdown-toggle languages" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||||
Choose a Language
|
Choose a Language
|
||||||
</button>
|
</button>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu" id="language-selector"></ul>
|
||||||
<li><a class="dropdown-item" onclick="go('')">English</a></li>
|
|
||||||
<li><a class="dropdown-item" onclick="go('')">Belarusian</a></li>
|
|
||||||
<li><a class="dropdown-item" onclick="go('')">German</a></li>
|
|
||||||
<li><a class="dropdown-item" onclick="go('')">Indonesian</a></li>
|
|
||||||
<li><a class="dropdown-item" onclick="go('')">Korean</a></li>
|
|
||||||
<li><a class="dropdown-item" onclick="go('')">Spanish</a></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function go(loc) {
|
const versions = [
|
||||||
document.getElementById('wp-iframe').src = loc;
|
['English', ''],
|
||||||
document.getElementById('mobile-wp-download').href = loc;
|
['беларускі', '_be']
|
||||||
|
];
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
|
for (const lang of versions) {
|
||||||
|
|
||||||
|
$('#language-selector').append("<li><a class=\"dropdown-item\" onclick=\"go(\'" + lang[1] + "')\">" + lang[0] + "</a></li>");
|
||||||
|
}
|
||||||
|
}, false);
|
||||||
|
|
||||||
|
function go(suffix) {
|
||||||
|
const url = 'https://tea.xyz/tea.white-paper' + suffix + '.pdf';
|
||||||
|
document.getElementById('wp-iframe').setAttribute('src', url + '#toolbar=0&navpanes=0&view=fitH');
|
||||||
|
document.getElementById('mobile-wp-download').setAttribute('href', url);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue