Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permalink #74

Merged
merged 3 commits into from Dec 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions index.php
Expand Up @@ -73,8 +73,7 @@
</div>
<div id='footer'>
<ul id='menu'>
<li><a target='_blank' href='https://github.com/plepe/openstreetbrowser'>Code</a></li>
</ul>
<li><a target='_blank' href='https://github.com/plepe/openstreetbrowser'>Code</a></li></ul>
</div>
</div>
<div id='loadingIndicator'>
Expand Down
1 change: 1 addition & 0 deletions lang/ast.json
Expand Up @@ -18,6 +18,7 @@
"images": "",
"loading": "",
"main:options": "Opciones",
"main:permalink": "",
"more": "más",
"more_categories": "Más categoríes",
"more_categories_gitea": "",
Expand Down
1 change: 1 addition & 0 deletions lang/ca.json
Expand Up @@ -18,6 +18,7 @@
"images": "",
"loading": "",
"main:options": "Opcions",
"main:permalink": "",
"more": "més",
"more_categories": "Més categories",
"more_categories_gitea": "",
Expand Down
1 change: 1 addition & 0 deletions lang/cs.json
Expand Up @@ -18,6 +18,7 @@
"images": "",
"loading": "",
"main:options": "Nastavení",
"main:permalink": "",
"more": "více",
"more_categories": "Více kategorií",
"more_categories_gitea": "",
Expand Down
1 change: 1 addition & 0 deletions lang/da.json
Expand Up @@ -18,6 +18,7 @@
"images": "",
"loading": "",
"main:options": "Indstillinger",
"main:permalink": "",
"more": "mere",
"more_categories": "Flere kategorier",
"more_categories_gitea": "",
Expand Down
1 change: 1 addition & 0 deletions lang/de.json
Expand Up @@ -21,6 +21,7 @@
"images": "Bilder",
"loading": "Laden ...",
"main:options": "Optionen",
"main:permalink": "",
"more": "mehr",
"more_categories": "Mehr Kategorien",
"more_categories_gitea": "Erstelle und verbessere Kategorien hier!",
Expand Down
1 change: 1 addition & 0 deletions lang/el.json
Expand Up @@ -18,6 +18,7 @@
"images": "",
"loading": "",
"main:options": "Επιλογές",
"main:permalink": "",
"more": "περισσότερα",
"more_categories": "Περισσότερες κατηγορίες",
"more_categories_gitea": "",
Expand Down
1 change: 1 addition & 0 deletions lang/en.json
Expand Up @@ -21,6 +21,7 @@
"images": "Images",
"loading": "Loading ...",
"main:options": "Options",
"main:permalink": "Permalink",
"more": "more",
"more_categories": "More categories",
"more_categories_gitea": "Create &amp; improve categories yourself!",
Expand Down
1 change: 1 addition & 0 deletions lang/es.json
Expand Up @@ -18,6 +18,7 @@
"images": "",
"loading": "",
"main:options": "Opciones",
"main:permalink": "",
"more": "más",
"more_categories": "Más categorías",
"more_categories_gitea": "",
Expand Down
1 change: 1 addition & 0 deletions lang/et.json
Expand Up @@ -18,6 +18,7 @@
"images": "",
"loading": "",
"main:options": "Valikud",
"main:permalink": "",
"more": "lisaks",
"more_categories": "Rohkem kategooriaid",
"more_categories_gitea": "",
Expand Down
1 change: 1 addition & 0 deletions lang/fr.json
Expand Up @@ -18,6 +18,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 !",
Expand Down
1 change: 1 addition & 0 deletions lang/hu.json
Expand Up @@ -18,6 +18,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!",
Expand Down
1 change: 1 addition & 0 deletions lang/it.json
Expand Up @@ -18,6 +18,7 @@
"images": "",
"loading": "",
"main:options": "Opzioni",
"main:permalink": "",
"more": "altri",
"more_categories": "Altre categorie",
"more_categories_gitea": "",
Expand Down
1 change: 1 addition & 0 deletions lang/ja.json
Expand Up @@ -18,6 +18,7 @@
"images": "",
"loading": "",
"main:options": "オプション設定",
"main:permalink": "",
"more": "もっと",
"more_categories": "カテゴリを一覧から追加",
"more_categories_gitea": "",
Expand Down
1 change: 1 addition & 0 deletions lang/nl.json
Expand Up @@ -18,6 +18,7 @@
"images": "",
"loading": "",
"main:options": "Opties",
"main:permalink": "",
"more": "meer",
"more_categories": "Meer categorieën",
"more_categories_gitea": "",
Expand Down
1 change: 1 addition & 0 deletions lang/pl.json
Expand Up @@ -18,6 +18,7 @@
"images": "",
"loading": "",
"main:options": "Opcje",
"main:permalink": "",
"more": "więcej",
"more_categories": "Więcej kategorii",
"more_categories_gitea": "",
Expand Down
1 change: 1 addition & 0 deletions lang/pt-br.json
Expand Up @@ -21,6 +21,7 @@
"images": "Imagens",
"loading": "Carregando...",
"main:options": "Opções",
"main:permalink": "",
"more": "mais",
"more_categories": "Mais categorias",
"more_categories_gitea": "Criar &amp; melhorar categorias você mesmo!",
Expand Down
1 change: 1 addition & 0 deletions lang/pt.json
Expand Up @@ -21,6 +21,7 @@
"images": "Imagens",
"loading": "A carregar...",
"main:options": "Opções",
"main:permalink": "",
"more": "mais",
"more_categories": "Mais categorias",
"more_categories_gitea": "Criar &amp; melhorar categorias você mesmo!",
Expand Down
1 change: 1 addition & 0 deletions lang/ro.json
Expand Up @@ -18,6 +18,7 @@
"images": "",
"loading": "",
"main:options": "Optiuni",
"main:permalink": "",
"more": "Mai mult",
"more_categories": "Mai multe categorii",
"more_categories_gitea": "",
Expand Down
1 change: 1 addition & 0 deletions lang/ru.json
Expand Up @@ -18,6 +18,7 @@
"images": "",
"loading": "",
"main:options": "Настройки",
"main:permalink": "",
"more": "Ещё",
"more_categories": "Больше категорий",
"more_categories_gitea": "",
Expand Down
1 change: 1 addition & 0 deletions lang/sr.json
Expand Up @@ -18,6 +18,7 @@
"images": "",
"loading": "",
"main:options": "Опције",
"main:permalink": "",
"more": "још",
"more_categories": "Више категорија",
"more_categories_gitea": "",
Expand Down
1 change: 1 addition & 0 deletions lang/template.json
Expand Up @@ -18,6 +18,7 @@
"images": "",
"loading": "",
"main:options": "",
"main:permalink": "",
"more": "",
"more_categories": "",
"more_categories_gitea": "",
Expand Down
1 change: 1 addition & 0 deletions lang/uk.json
Expand Up @@ -18,6 +18,7 @@
"images": "",
"loading": "",
"main:options": "Налаштування",
"main:permalink": "",
"more": "Ще",
"more_categories": "Більше категорій",
"more_categories_gitea": "",
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Expand Up @@ -33,6 +33,7 @@ require('./categories')
require('./wikipedia')
require('./image')
require('./addCategories')
require('./permalink')
let exportAll = require('./exportAll')

window.onload = function () {
Expand Down
16 changes: 16 additions & 0 deletions 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)
})
2 changes: 2 additions & 0 deletions src/state.js
Expand Up @@ -144,6 +144,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)
Expand Down
7 changes: 6 additions & 1 deletion style.css
Expand Up @@ -139,13 +139,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: 400px) {
#sidebar {
Expand Down