Browse Source

Add nosleep setting for galleria

pull/520/head
Markus Blöchl 2 years ago
parent
commit
31d097b850
  1. 1
      src/sigal/settings.py
  2. 5
      src/sigal/templates/sigal.conf.py
  3. 2
      src/sigal/themes/default/static/NoSleep.min.js
  4. 12
      src/sigal/themes/galleria/templates/album_items.html

1
src/sigal/settings.py

@ -59,6 +59,7 @@ _DEFAULT_CONFIG = {
"medias_sort_reverse": False,
"mp4_options": ["-crf", "23", "-strict", "-2"],
"mp4_options_second_pass": None,
"nosleep": False,
"orig_dir": "original",
"orig_link": False,
"rel_link": False,

5
src/sigal/templates/sigal.conf.py

@ -231,6 +231,11 @@ ignore_files = []
# links = [('Example link', 'http://example.org'),
# ('Another link', 'http://example.org')]
# Include NoSleep.js to prevent devices like tablets from
# falling asleep during slideshows.
# This option only has an effect on the galleria theme for now.
# nosleep = False
# Google Analytics tracking code (UA-xxxx-x)
# google_analytics = ''

2
src/sigal/themes/default/static/NoSleep.min.js vendored

File diff suppressed because one or more lines are too long

12
src/sigal/themes/galleria/templates/album_items.html

@ -44,6 +44,9 @@
<script src="{{ theme.url }}/galleria.min.js"></script>
<script src="{{ theme.url }}/themes/{{ settings.galleria_theme }}/galleria.{{ settings.galleria_theme }}.min.js"></script>
<script src="{{ theme.url }}/plugins/history/galleria.history.min.js"></script>
{% if settings.nosleep %}
<script src="{{ theme.url }}/NoSleep.min.js"></script>
{% endif %}
<script>
var data = [
{% for media in album.medias -%}
@ -90,6 +93,15 @@
});
$('.icons').appendTo(this.$('container'));
{% if settings.nosleep %}
var nosleep = new NoSleep();
document.addEventListener('click', function enableNoSleep() {
document.removeEventListener('click', enableNoSleep, false);
nosleep.enable();
}, false);
{% endif %}
});
Galleria.configure({

Loading…
Cancel
Save