diff options
author | Denis Redozubov <denis.redozubov@gmail.com> | 2018-08-22 15:11:32 +0300 |
---|---|---|
committer | Denis Redozubov <denis.redozubov@gmail.com> | 2018-08-22 15:14:21 +0300 |
commit | eb86dffeeec897d17905f3adff84e6acfd018330 (patch) | |
tree | 91e346a00ab96ec247af14529fc1d26c9c3a4ae0 /src | |
parent | 0e41b2ab9485f46c4303be46d41e39203eeb7138 (diff) |
Rough same page anchors
Diffstat (limited to 'src')
-rw-r--r-- | src/c/urweb.c | 4 | ||||
-rw-r--r-- | src/settings.sml | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/c/urweb.c b/src/c/urweb.c index e7efae38..ce6f4dfb 100644 --- a/src/c/urweb.c +++ b/src/c/urweb.c @@ -4407,6 +4407,10 @@ uw_Basis_string uw_Basis_currentUrl(uw_context ctx) { return ctx->current_url; } +uw_Basis_string uw_Basis_anchorUrl(uw_context ctx, uw_Basis_string s) { + return uw_Basis_strcat(ctx, uw_Basis_strcat(ctx, ctx->current_url, "#"), s); +} + void uw_set_currentUrl(uw_context ctx, char *s) { ctx->current_url = s; } diff --git a/src/settings.sml b/src/settings.sml index cfbe98a5..c023a851 100644 --- a/src/settings.sml +++ b/src/settings.sml @@ -321,6 +321,7 @@ val jsFuncsBase = basisM [("alert", "alert"), ("ord", "ord"), ("checkUrl", "checkUrl"), + ("anchorUrl", "anchorUrl"), ("bless", "bless"), ("blessData", "blessData"), |