https links

This commit is contained in:
antelle 2021-02-26 18:54:55 +01:00
parent 44e053af01
commit c65d546218
No known key found for this signature in database
GPG Key ID: 63C9777AAB7C563C
2 changed files with 86 additions and 82 deletions

View File

@ -8,7 +8,7 @@ If you would like to open an issue, please do it in the [KeeWeb repo](https://gi
## Translations ## Translations
You can add or edit translations [here](http://keeweb.oneskyapp.com/), they will be imported automatically. You can add or edit translations [here](https://keeweb.oneskyapp.com/), they will be imported automatically.
## Scripts ## Scripts

View File

@ -1,23 +1,24 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8" />
<title>KeeWeb translations</title> <title>KeeWeb translations</title>
<link rel="shortcut icon" href="/favicon.png" /> <link rel="shortcut icon" href="/favicon.png" />
<script> <script>
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function () {
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
xhr.responseType = 'json'; xhr.responseType = 'json';
xhr.open('GET', 'meta.json?_=' + Date.now(), true); xhr.open('GET', 'meta.json?_=' + Date.now(), true);
xhr.send(); xhr.send();
xhr.onload = function() { xhr.onload = function () {
var languages = xhr.response; var languages = xhr.response;
var table = document.getElementById('list-languages'); var table = document.getElementById('list-languages');
Object.keys(languages).forEach(function(lang) { Object.keys(languages).forEach(function (lang) {
var langData = languages[lang]; var langData = languages[lang];
var url = 'https://plugins.keeweb.info/translations/' + lang; var url = 'https://plugins.keeweb.info/translations/' + lang;
var row = table.insertRow(); var row = table.insertRow();
row.insertCell().innerHTML = '<a href="javascript:showLanguage(\'' + lang + '\');">' + lang + '</a>'; row.insertCell().innerHTML =
'<a href="javascript:showLanguage(\'' + lang + '\');">' + lang + '</a>';
row.insertCell().innerHTML = langData.name; row.insertCell().innerHTML = langData.name;
row.insertCell().innerHTML = langData.nameEn; row.insertCell().innerHTML = langData.nameEn;
row.insertCell().innerHTML = langData.version; row.insertCell().innerHTML = langData.version;
@ -37,7 +38,7 @@
xhr.responseType = 'json'; xhr.responseType = 'json';
xhr.open('GET', lang + '/' + lang + '.json', true); xhr.open('GET', lang + '/' + lang + '.json', true);
xhr.send(); xhr.send();
xhr.onload = function() { xhr.onload = function () {
document.getElementById('lang-data').style.display = 'block'; document.getElementById('lang-data').style.display = 'block';
document.getElementById('lang-name').innerHTML = lang; document.getElementById('lang-name').innerHTML = lang;
var data = xhr.response; var data = xhr.response;
@ -45,7 +46,7 @@
while (table.rows.length > 1) { while (table.rows.length > 1) {
table.deleteRow(1); table.deleteRow(1);
} }
Object.keys(data).forEach(function(item) { Object.keys(data).forEach(function (item) {
var row = table.insertRow(); var row = table.insertRow();
row.insertCell().innerHTML = item; row.insertCell().innerHTML = item;
row.insertCell().innerHTML = data[item]; row.insertCell().innerHTML = data[item];
@ -56,15 +57,18 @@
</script> </script>
<style> <style>
body { body {
font-family: -apple-system, "BlinkMacSystemFont", "Helvetica Neue", "Helvetica", "Roboto", "Arial", sans-serif;; font-family: -apple-system, 'BlinkMacSystemFont', 'Helvetica Neue', 'Helvetica',
'Roboto', 'Arial', sans-serif;
font-size: 14px; font-size: 14px;
} }
</style> </style>
</head> </head>
<body> <body>
<h1>KeeWeb translations</h1> <h1>KeeWeb translations</h1>
<p>This site contains translations for <a href="https://keeweb.info">KeeWeb</a>. <p>
You can add or edit translations at <a href="http://keeweb.oneskyapp.com/">OneSky</a>.</p> This site contains translations for <a href="https://keeweb.info">KeeWeb</a>. You can
add or edit translations at <a href="https://keeweb.oneskyapp.com/">OneSky</a>.
</p>
<p>Language list</p> <p>Language list</p>
<table id="list-languages" cellpadding="5" cellspacing="0" border="1"> <table id="list-languages" cellpadding="5" cellspacing="0" border="1">
<tr> <tr>
@ -76,7 +80,7 @@
<th>Plugin URL</th> <th>Plugin URL</th>
</tr> </tr>
</table> </table>
<div id="lang-data" style="display: none;"> <div id="lang-data" style="display: none">
<p>Language: <span id="lang-name"></span></p> <p>Language: <span id="lang-name"></span></p>
<table id="lang-table" cellpadding="5" cellspacing="0" border="1"> <table id="lang-table" cellpadding="5" cellspacing="0" border="1">
<tr> <tr>
@ -85,5 +89,5 @@
</tr> </tr>
</table> </table>
</div> </div>
</body> </body>
</html> </html>