# HG changeset patch # User Adam Chlipala # Date 1446405429 18000 # Node ID 43393a4a66cec8e2bb0eceb01bb244610aea43fa # Parent 61866c765485800fb0ed2446f181e84501e6fd05 JavaScript versions of a few more functions diff -r 61866c765485 -r 43393a4a66ce lib/js/urweb.js --- a/lib/js/urweb.js Sun Nov 01 12:23:44 2015 -0500 +++ b/lib/js/urweb.js Sun Nov 01 14:17:09 2015 -0500 @@ -1475,6 +1475,14 @@ return ((str1 == str2) ? 0 : ((str1 > str2) ? 1 : -1)); } +function chr(n) { + return String.fromCharCode(n); +} + +function htmlifySpecialChar(ch) { + return "&#" + ch.charCodeAt(0) + ";"; +} + // Remote calls diff -r 61866c765485 -r 43393a4a66ce src/settings.sml --- a/src/settings.sml Sun Nov 01 12:23:44 2015 -0500 +++ b/src/settings.sml Sun Nov 01 14:17:09 2015 -0500 @@ -376,7 +376,10 @@ ("atom", "atom"), ("css_url", "css_url"), ("property", "property"), - ("giveFocus", "giveFocus")] + ("giveFocus", "giveFocus"), + + ("htmlifySpecialChar", "htmlifySpecialChar"), + ("chr", "chr")] val jsFuncs = ref jsFuncsBase fun setJsFuncs ls = jsFuncs := foldl (fn ((k, v), m) => M.insert (m, k, v)) jsFuncsBase ls fun jsFunc x = M.find (!jsFuncs, x)