diff --git a/index.php b/index.php index 6c7a4655..7a1d6c18 100644 --- a/index.php +++ b/index.php @@ -76,8 +76,7 @@ html_export_var(array(
diff --git a/lang/ast.json b/lang/ast.json index 853b61fc..92ab783e 100644 --- a/lang/ast.json +++ b/lang/ast.json @@ -19,6 +19,7 @@ "images": "", "loading": "", "main:options": "Opciones", + "main:permalink": "", "more": "más", "more_categories": "Más categoríes", "more_categories_gitea": "", diff --git a/lang/ca.json b/lang/ca.json index bf4b9c52..bd8ed25c 100644 --- a/lang/ca.json +++ b/lang/ca.json @@ -19,6 +19,7 @@ "images": "", "loading": "", "main:options": "Opcions", + "main:permalink": "", "more": "més", "more_categories": "Més categories", "more_categories_gitea": "", diff --git a/lang/cs.json b/lang/cs.json index d8384f87..d498d933 100644 --- a/lang/cs.json +++ b/lang/cs.json @@ -19,6 +19,7 @@ "images": "", "loading": "", "main:options": "Nastavení", + "main:permalink": "", "more": "více", "more_categories": "Více kategorií", "more_categories_gitea": "", diff --git a/lang/da.json b/lang/da.json index 48c56170..00ddf730 100644 --- a/lang/da.json +++ b/lang/da.json @@ -19,6 +19,7 @@ "images": "", "loading": "", "main:options": "Indstillinger", + "main:permalink": "", "more": "mere", "more_categories": "Flere kategorier", "more_categories_gitea": "", diff --git a/lang/de.json b/lang/de.json index 5c392e81..4584dd53 100644 --- a/lang/de.json +++ b/lang/de.json @@ -22,6 +22,7 @@ "images": "Bilder", "loading": "Laden ...", "main:options": "Optionen", + "main:permalink": "", "more": "mehr", "more_categories": "Mehr Kategorien", "more_categories_gitea": "Erstelle und verbessere Kategorien hier!", diff --git a/lang/el.json b/lang/el.json index 853644bd..df6fb441 100644 --- a/lang/el.json +++ b/lang/el.json @@ -19,6 +19,7 @@ "images": "", "loading": "", "main:options": "Επιλογές", + "main:permalink": "", "more": "περισσότερα", "more_categories": "Περισσότερες κατηγορίες", "more_categories_gitea": "", diff --git a/lang/en.json b/lang/en.json index f1aa8ffc..e12e7304 100644 --- a/lang/en.json +++ b/lang/en.json @@ -22,6 +22,7 @@ "images": "Images", "loading": "Loading ...", "main:options": "Options", + "main:permalink": "Permalink", "more": "more", "more_categories": "More categories", "more_categories_gitea": "Create & improve categories yourself!", diff --git a/lang/es.json b/lang/es.json index 5995c5f3..2ecbd1ea 100644 --- a/lang/es.json +++ b/lang/es.json @@ -19,6 +19,7 @@ "images": "", "loading": "", "main:options": "Opciones", + "main:permalink": "", "more": "más", "more_categories": "Más categorías", "more_categories_gitea": "", diff --git a/lang/et.json b/lang/et.json index f77bd8fe..ed4e98e6 100644 --- a/lang/et.json +++ b/lang/et.json @@ -19,6 +19,7 @@ "images": "", "loading": "", "main:options": "Valikud", + "main:permalink": "", "more": "lisaks", "more_categories": "Rohkem kategooriaid", "more_categories_gitea": "", diff --git a/lang/fr.json b/lang/fr.json index 14111420..ba7ff99c 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -19,6 +19,7 @@ "images": "Images", "loading": "Chargement...", "main:options": "Options", + "main:permalink": "", "more": "plus", "more_categories": "Plus de catégories", "more_categories_gitea": "Créez et améliorez vous-mêmes les catégories !", diff --git a/lang/hu.json b/lang/hu.json index 6625e17b..70432f29 100644 --- a/lang/hu.json +++ b/lang/hu.json @@ -19,6 +19,7 @@ "images": "Képek", "loading": "Betöltés…", "main:options": "Beállítások", + "main:permalink": "", "more": "Több", "more_categories": "További kategóriák", "more_categories_gitea": "Hozzon létre új kategóriákat, vagy javítson a meglévőkön!", diff --git a/lang/it.json b/lang/it.json index 942d79b4..67316501 100644 --- a/lang/it.json +++ b/lang/it.json @@ -19,6 +19,7 @@ "images": "", "loading": "", "main:options": "Opzioni", + "main:permalink": "", "more": "altri", "more_categories": "Altre categorie", "more_categories_gitea": "", diff --git a/lang/ja.json b/lang/ja.json index 644f2154..0117028c 100644 --- a/lang/ja.json +++ b/lang/ja.json @@ -19,6 +19,7 @@ "images": "", "loading": "", "main:options": "オプション設定", + "main:permalink": "", "more": "もっと", "more_categories": "カテゴリを一覧から追加", "more_categories_gitea": "", diff --git a/lang/nl.json b/lang/nl.json index c28917af..65f2c2b2 100644 --- a/lang/nl.json +++ b/lang/nl.json @@ -19,6 +19,7 @@ "images": "", "loading": "", "main:options": "Opties", + "main:permalink": "", "more": "meer", "more_categories": "Meer categorieën", "more_categories_gitea": "", diff --git a/lang/pl.json b/lang/pl.json index bca42044..e4bf5142 100644 --- a/lang/pl.json +++ b/lang/pl.json @@ -19,6 +19,7 @@ "images": "", "loading": "", "main:options": "Opcje", + "main:permalink": "", "more": "więcej", "more_categories": "Więcej kategorii", "more_categories_gitea": "", diff --git a/lang/pt-br.json b/lang/pt-br.json index 5e78f5e8..26fecf3b 100644 --- a/lang/pt-br.json +++ b/lang/pt-br.json @@ -22,6 +22,7 @@ "images": "Imagens", "loading": "Carregando...", "main:options": "Opções", + "main:permalink": "", "more": "mais", "more_categories": "Mais categorias", "more_categories_gitea": "Criar & melhorar categorias você mesmo!", diff --git a/lang/pt.json b/lang/pt.json index d6013c78..a6eb1881 100644 --- a/lang/pt.json +++ b/lang/pt.json @@ -22,6 +22,7 @@ "images": "Imagens", "loading": "A carregar...", "main:options": "Opções", + "main:permalink": "", "more": "mais", "more_categories": "Mais categorias", "more_categories_gitea": "Criar & melhorar categorias você mesmo!", diff --git a/lang/ro.json b/lang/ro.json index 9af09630..98b3d7ca 100644 --- a/lang/ro.json +++ b/lang/ro.json @@ -19,6 +19,7 @@ "images": "", "loading": "", "main:options": "Optiuni", + "main:permalink": "", "more": "Mai mult", "more_categories": "Mai multe categorii", "more_categories_gitea": "", diff --git a/lang/ru.json b/lang/ru.json index 21289b33..cb557569 100644 --- a/lang/ru.json +++ b/lang/ru.json @@ -19,6 +19,7 @@ "images": "", "loading": "", "main:options": "Настройки", + "main:permalink": "", "more": "Ещё", "more_categories": "Больше категорий", "more_categories_gitea": "", diff --git a/lang/sr.json b/lang/sr.json index 16b558e0..409be7aa 100644 --- a/lang/sr.json +++ b/lang/sr.json @@ -19,6 +19,7 @@ "images": "", "loading": "", "main:options": "Опције", + "main:permalink": "", "more": "још", "more_categories": "Више категорија", "more_categories_gitea": "", diff --git a/lang/template.json b/lang/template.json index 707f8316..943a418d 100644 --- a/lang/template.json +++ b/lang/template.json @@ -19,6 +19,7 @@ "images": "", "loading": "", "main:options": "", + "main:permalink": "", "more": "", "more_categories": "", "more_categories_gitea": "", diff --git a/lang/uk.json b/lang/uk.json index a0fb3f96..58d5a1e7 100644 --- a/lang/uk.json +++ b/lang/uk.json @@ -19,6 +19,7 @@ "images": "", "loading": "", "main:options": "Налаштування", + "main:permalink": "", "more": "Ще", "more_categories": "Більше категорій", "more_categories_gitea": "", diff --git a/src/index.js b/src/index.js index eb60517f..f6e7dd1b 100644 --- a/src/index.js +++ b/src/index.js @@ -34,6 +34,7 @@ require('./categories') require('./wikipedia') require('./image') require('./addCategories') +require('./permalink') let exportAll = require('./exportAll') window.onload = function () { diff --git a/src/permalink.js b/src/permalink.js new file mode 100644 index 00000000..b1eb2831 --- /dev/null +++ b/src/permalink.js @@ -0,0 +1,16 @@ +let permalink + +register_hook('state-update', function (state, hash) { + permalink.href = hash +}) + +register_hook('init', function () { + let li = document.createElement('li') + + permalink = document.createElement('a') + li.appendChild(permalink) + permalink.innerHTML = 'Permalink' + + let menu = document.getElementById('menu') + menu.appendChild(li) +}) diff --git a/src/state.js b/src/state.js index fb19bc2d..d5a906b6 100644 --- a/src/state.js +++ b/src/state.js @@ -149,6 +149,8 @@ function update (state, push) { var newHash = '#' + stringify(state) + call_hooks('state-update', state, newHash) + if (push) { history.pushState(null, null, newHash) call_hooks('statePush', state, newHash) diff --git a/style.css b/style.css index 86ef8132..6d2ef829 100644 --- a/style.css +++ b/style.css @@ -136,13 +136,18 @@ a:active { } #menu li { display: inline-block; + margin: 1px 0; } #menu li::after { - content: ' |'; + content: '|'; + margin: 1px 0.25em; } #menu li:last-of-type::after { content: ''; } +#menu li:first-of-type { + margin-left: 0.25em; +} @media all and (max-height: 600px) { .tabs-section {