-
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1716 from UlrichB22/slideshow
Add SlideShow macro and view
- Loading branch information
Showing
6 changed files
with
228 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright: 2024 MoinMoin:UlrichB | ||
# License: GNU GPL v2 (or any later version), see LICENSE.txt for details. | ||
|
||
""" | ||
Create link to start a SlideShow for the current item | ||
""" | ||
|
||
from moin.i18n import _ | ||
from moin.utils.tree import moin_page, xlink | ||
from moin.macros._base import MacroInlineBase | ||
|
||
|
||
class Macro(MacroInlineBase): | ||
def macro(self, content, arguments, page_url, alternative): | ||
attrib = {moin_page.class_: "fa-regular fa-circle-play"} | ||
children = [moin_page.span(attrib=attrib), _(" Start SlideShow")] | ||
result = moin_page.a(attrib={xlink.href: f"/+slideshow{page_url.path}"}, children=children) | ||
return result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/* projection.css - MoinMoin Slide Styles | ||
Copyright (c) 2003 by Juergen Hermann | ||
Copyright (c) 2024 by MoinMoin project | ||
*/ | ||
|
||
html { line-height: 1.8em; } | ||
|
||
body, b, em, a, span, div, p, td { font-size: 18pt; } | ||
|
||
h1 { font-size: 24pt; padding-top: 24px; color: #33F; text-align: left; } | ||
h2 { font-size: 22pt; padding-top: 24px; color: #33F; } | ||
h3 { font-size: 20pt; } | ||
h4 { font-size: 18pt; } | ||
h5 { font-size: 16pt; } | ||
h6 { font-size: 14pt; } | ||
|
||
tt, pre { font-size: 14pt; } | ||
sup, sub { font-size: 10pt; } | ||
|
||
#moin-content-data { padding-left: 50px; margin: 0 2%; } | ||
|
||
@media print { | ||
h1 { padding-top: 50px; } | ||
h2 { page-break-before: always; padding-top: 50px; } | ||
h3, h4 { page-break-after: avoid; } | ||
pre, blockquote { page-break-inside: avoid; } | ||
} | ||
|
||
* {box-sizing:border-box} | ||
|
||
/* Slideshow container */ | ||
.slideshow-container { | ||
max-width: 1000px; | ||
position: relative; | ||
margin: auto; | ||
} | ||
|
||
/* navigation container */ | ||
.navi-container { | ||
position: fixed; | ||
bottom: 15px; | ||
text-align: center; | ||
margin: 0; | ||
left: 50%; | ||
} | ||
|
||
/* Next and previous slide button */ | ||
.prev, .next { | ||
cursor: pointer; | ||
position: fixed; | ||
top: 50%; | ||
width: auto; | ||
padding: 0 20px 40% 20px; | ||
color: lightgray; | ||
font-weight: bold; | ||
font-size: 18px; | ||
transition: 0.6s ease; | ||
border-radius: 0 3px 3px 0; | ||
user-select: none; | ||
} | ||
|
||
/* Move the "next" button to the right */ | ||
.next { | ||
right: 0; | ||
border-radius: 3px 0 0 3px; | ||
} | ||
|
||
a.prev:hover, a.next:hover { | ||
color: darkgray; | ||
text-decoration: none; | ||
font-size: 24px; | ||
} | ||
|
||
/* navigation */ | ||
a.slide-nav, .slide-nav { | ||
font-size: 18px; | ||
padding: 0 7px; | ||
color: lightgray; | ||
text-align: center; | ||
cursor: pointer; | ||
display: inline-block; | ||
transition: 0.6s ease; | ||
} | ||
|
||
.active, .slide-nav:hover { | ||
color: darkgray; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{% extends "base.html" %} | ||
{% block layout %} | ||
|
||
{% if data_rendered %} | ||
<link media="all" rel="stylesheet" href="{{ url_for('static', filename='css/projection.css') }}"> | ||
<div><span id="Start"></span></div> | ||
<div id="moin-content-data"> | ||
{{ data_rendered }} | ||
</div> | ||
<div><span id="End"></span></div> | ||
{% endif %} | ||
|
||
<!-- Next and previous buttons --> | ||
<a class="prev" onclick="prevSlide()">❮</a> | ||
<a class="next" onclick="nextSlide()">❯</a> | ||
|
||
<!-- navigation to first or last slide or exit slideshow --> | ||
<div class="navi-container"> | ||
<span class="slide-nav" onclick="showSlide(1)" title="First slide"><i class="fa-solid fa-backward-fast"></i></span> | ||
<span class="slide-nav"><a class="slide-nav" title="Exit slideshow" href="/{{full_name}}"> | ||
<i class="fa-solid fa-right-from-bracket"></i></a></span> | ||
<span class="slide-nav" onclick="lastSlide()" title="Last slide"><i class="fa-solid fa-forward-fast"></i></span> | ||
</div> | ||
|
||
<script> | ||
let slideNo = 1; | ||
let slides = document.getElementsByClassName("moin-slides"); | ||
showSlide(slideNo); | ||
|
||
function nextSlide() { | ||
if (slideNo < slides.length) { | ||
showSlide(slideNo += 1); | ||
} | ||
} | ||
|
||
function prevSlide() { | ||
if (slideNo > 1) { | ||
showSlide(slideNo -= 1); | ||
} | ||
} | ||
|
||
function lastSlide() { | ||
showSlide(slides.length); | ||
} | ||
|
||
function showSlide(n) { | ||
let i; | ||
slideNo = n; | ||
for (i = 0; i < slides.length; i++) { | ||
slides[i].style.display = "none"; | ||
} | ||
slides[slideNo - 1].style.display = "block"; | ||
} | ||
</script> | ||
{% endblock %} |