summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2020-01-15 12:12:32 -0500
committerGravatar GitHub <noreply@github.com>2020-01-15 12:12:32 -0500
commit026883de8a8c80a1dc5fa3e51a95e951db4b2b6a (patch)
treecf4b600a783fb5bc87f83b98ffaed589aecae145 /lib
parent5cce43a484bdde0053820b8ae408bcba830b25ba (diff)
parenteb86dffeeec897d17905f3adff84e6acfd018330 (diff)
Merge pull request #136 from dredozubov/anchor-links
Same page link anchors
Diffstat (limited to 'lib')
-rw-r--r--lib/js/urweb.js4
-rw-r--r--lib/ur/basis.urs1
2 files changed, 5 insertions, 0 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js
index 59e5ad2c..cb582788 100644
--- a/lib/js/urweb.js
+++ b/lib/js/urweb.js
@@ -3385,5 +3385,9 @@ function giveFocus(id) {
er("Tried to give focus to ID not used in document: " + id);
}
+function anchorUrl(id) {
+ return "#" + id;
+}
+
// App-specific code
diff --git a/lib/ur/basis.urs b/lib/ur/basis.urs
index dda48d2b..9d6e56d5 100644
--- a/lib/ur/basis.urs
+++ b/lib/ur/basis.urs
@@ -816,6 +816,7 @@ type id
val fresh : transaction id
val giveFocus : id -> transaction unit
val show_id : show id
+val anchorUrl : id -> url
val dyn : ctx ::: {Unit} -> use ::: {Type} -> bind ::: {Type} -> [ctx ~ [Dyn]] => unit
-> tag [Signal = signal (xml ([Dyn] ++ ctx) use bind)] ([Dyn] ++ ctx) [] use bind