fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix global map
[wolnelektury.git]
/
src
/
wolnelektury
/
static
/
js
/
book_text
/
references.js
diff --git
a/src/wolnelektury/static/js/book_text/references.js
b/src/wolnelektury/static/js/book_text/references.js
index
ee7e2bd
..
805f24d
100644
(file)
--- a/
src/wolnelektury/static/js/book_text/references.js
+++ b/
src/wolnelektury/static/js/book_text/references.js
@@
-21,7
+21,7
@@
if (map_enabled) return;
map = L.map('reference-map').setView([0, 0], 11);
if (map_enabled) return;
map = L.map('reference-map').setView([0, 0], 11);
- L.tileLayer('https://tile.thunderforest.com/
cycle
/{z}/{x}/{y}.png?apikey=a8a97f0ae5134403ac38c1a075b03e15', {
+ L.tileLayer('https://tile.thunderforest.com/
neighbourhood
/{z}/{x}/{y}.png?apikey=a8a97f0ae5134403ac38c1a075b03e15', {
attribution: 'Maps © <a href="http://www.thunderforest.com">Thunderforest</a>, Data © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap contributors</a>'
}).addTo(map);
marker = L.circleMarker([0,0]);
attribution: 'Maps © <a href="http://www.thunderforest.com">Thunderforest</a>, Data © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap contributors</a>'
}).addTo(map);
marker = L.circleMarker([0,0]);
@@
-49,8
+49,12
@@
$this.addClass('interesting');
ref = interestingReferences[uri];
$this.addClass('interesting');
ref = interestingReferences[uri];
- $this.attr('href', ref.wikipedia_link);
- $this.attr('target', '_blank');
+ if (ref.wikipedia_link) {
+ $this.attr('href', ref.wikipedia_link);
+ $this.attr('target', '_blank');
+ } else {
+ $this.removeAttr('href')
+ }
}
});
}
});
@@
-104,8
+108,14
@@
}
$("#reference-link").text(ref.label);
}
$("#reference-link").text(ref.label);
- $("#reference-link").attr('href', ref.wikipedia_link);
+ if (ref.wikipedia_link) {
+ $("#reference-link").attr('href', ref.wikipedia_link);
+ } else {
+ $('#reference-link').removeAttr('href');
+ }
+ $("#reference-print").attr('href', '/mapa/ulotka/' + ref.id);
+
_paq.push(['trackEvent', 'html', 'reference']);
});
_paq.push(['trackEvent', 'html', 'reference']);
});
@@
-610,6
+620,7
@@
$('a.anchor').on('click', function(e) {
// Workaround for bad TOC markers.
if ($(this).closest('#toc').length) return;
$('a.anchor').on('click', function(e) {
// Workaround for bad TOC markers.
if ($(this).closest('#toc').length) return;
+ if ($(this).closest('.toc').length) return;
if ($(this).closest('#wltoc').length) return;
e.preventDefault();
if ($(this).closest('#wltoc').length) return;
e.preventDefault();