Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
privatestoragemobile
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PrivateStorage
privatestoragemobile
Commits
d1461e7a
Commit
d1461e7a
authored
1 year ago
by
Jean-Paul Calderone
Browse files
Options
Downloads
Patches
Plain Diff
take a stab at the Haskell side w/ jsaddle-dom (but probably wrong)
parent
e253aec1
No related branches found
No related tags found
1 merge request
!41
Add a tech demo button showing browser history integration
Pipeline
#4135
failed
1 year ago
Stage: lint
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
obelisk/frontend/frontend.cabal
+1
-0
1 addition, 0 deletions
obelisk/frontend/frontend.cabal
obelisk/frontend/src/Pages/TechDemo.hs
+21
-0
21 additions, 0 deletions
obelisk/frontend/src/Pages/TechDemo.hs
with
22 additions
and
0 deletions
obelisk/frontend/frontend.cabal
+
1
−
0
View file @
d1461e7a
...
...
@@ -28,6 +28,7 @@ library
, base32
, cereal
, ghc-prim
, jsaddle-dom
if os(android)
-- Pull in the Android implementation of some platform-specific modules.
...
...
This diff is collapsed.
Click to expand it.
obelisk/frontend/src/Pages/TechDemo.hs
+
21
−
0
View file @
d1461e7a
...
...
@@ -6,6 +6,9 @@
module
Pages.TechDemo
(
techDemoPage
)
where
import
JSDOM
import
JSDOM.Generated.History
import
JSDOM.Generated.Window
import
qualified
Data.ByteString.Lazy
as
LBS
import
qualified
Data.Text
as
T
import
qualified
Data.Text.IO
as
T
...
...
@@ -110,6 +113,24 @@ techDemoPage = prerender_ (pure ()) $ do
jump
"magic-folder list"
(
FrontendRoute_MagicFolders
:/
()
)
jump
"file browser"
(
FrontendRoute_FileBrowser
:/
[
"foo"
,
"bar"
])
-- Demo jsaddle-dom-based back / forward navigation
windowM
<-
currentWindow
historyM
<-
getHistory
<$>
windowM
case
historyM
of
-- No Window ... no navigation.
Nothing
->
blank
Just
history
->
navigationButtons
history
navigationButtons
::
History
->
m
()
navigationButtons
history
=
do
b
<-
button
"Back"
b'
<-
widgetHold
blank
$
ffor
b
(
\
()
->
back
history
)
dyn_
b'
f
<-
button
"Forward"
f'
<-
widgetHold
blank
$
ffor
f
(
\
()
->
forward
history
)
dyn_
f'
jump
::
(
DomBuilder
t
m
,
SetRoute
t
r
m
)
=>
T
.
Text
->
r
->
m
()
jump
label
route
=
do
b
<-
button
$
"Jump to "
<>
label
...
...
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