Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
decker-production
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
HCI-Development
decker-production
Commits
be85184b
Commit
be85184b
authored
7 years ago
by
Henrik Tramberend
Browse files
Options
Downloads
Patches
Plain Diff
First stab at embedded iframes
parent
146cfc99
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Filter.hs
+11
-1
11 additions, 1 deletion
src/Filter.hs
test/decks/iframe-deck.md
+19
-0
19 additions, 0 deletions
test/decks/iframe-deck.md
with
30 additions
and
1 deletion
src/Filter.hs
+
11
−
1
View file @
be85184b
...
...
@@ -37,7 +37,7 @@ import Text.Blaze (customAttribute)
import
Text.Blaze.Html.Renderer.String
import
Text.Blaze.Html5
as
H
((
!
),
audio
,
div
,
figure
,
iframe
,
img
,
p
,
stringTag
,
toValue
,
video
)
video
,
iframe
)
import
Text.Blaze.Html5.Attributes
as
A
(
alt
,
class_
,
height
,
id
,
src
,
style
,
title
,
width
)
import
Text.Pandoc
...
...
@@ -266,11 +266,13 @@ setSlideBackground slide@((Header 1 (headerId, headerClasses, headerAttributes)
transform
(
"loop"
,
value
)
=
(
"data-background-video-loop"
,
value
)
transform
(
"muted"
,
value
)
=
(
"data-background-video-muted"
,
value
)
transform
(
"color"
,
value
)
=
(
"data-background-color"
,
value
)
transform
(
"interactive"
,
value
)
=
(
"data-background-interactive"
,
value
)
transform
kv
=
kv
srcAttribute
src
=
case
classifyFilePath
src
of
VideoMedia
->
(
"data-background-video"
,
src
)
AudioMedia
->
(
"data-background-audio"
,
src
)
IframeMedia
->
(
"data-background-iframe"
,
src
)
ImageMedia
->
(
"data-background-image"
,
src
)
setSlideBackground
slide
=
slide
...
...
@@ -399,6 +401,10 @@ videoExtensions =
audioExtensions
::
[
String
]
audioExtensions
=
[
".mp3"
,
".ogg"
,
".wav"
]
-- | File extensions that signify iframe content.
iframeExtensions
::
[
String
]
iframeExtensions
=
[
".html"
,
".html"
,
".pdf"
]
data
Disposition
=
Deck
|
Page
...
...
@@ -409,6 +415,7 @@ data MediaType
=
ImageMedia
|
AudioMedia
|
VideoMedia
|
IframeMedia
classifyFilePath
::
FilePath
->
MediaType
classifyFilePath
name
=
...
...
@@ -417,6 +424,8 @@ classifyFilePath name =
|
ext
`
elem
`
videoExtensions
->
VideoMedia
ext
|
ext
`
elem
`
audioExtensions
->
AudioMedia
ext
|
ext
`
elem
`
iframeExtensions
->
IframeMedia
_
->
ImageMedia
-- Renders an image with a video reference to a video tag in raw HTML. Faithfully
...
...
@@ -429,6 +438,7 @@ renderImageAudioVideoTag disposition (Image (ident, cls, values) inlines (url, t
case
classifyFilePath
url
of
VideoMedia
->
mediaTag
(
video
"Browser does not support video."
)
AudioMedia
->
mediaTag
(
audio
"Browser does not support audio."
)
IframeMedia
->
mediaTag
(
iframe
"Browser does not support iframe."
)
ImageMedia
->
mediaTag
img
appendAttr
element
(
key
,
value
)
=
element
!
customAttribute
(
stringTag
key
)
(
toValue
value
)
...
...
This diff is collapsed.
Click to expand it.
test/decks/iframe-deck.md
0 → 100644
+
19
−
0
View file @
be85184b
---
history
:
True
---
# Iframes
## Some slides with iframes
1.
Iframe embedded in slide
2.
Iframe as background
3.
Iframe as background with interaction
# Iframe showing `heise.de`

{width="100%" height="500px"}
# 
# {interactive="1"}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment