diff options
author | Patrick Hurst <phurst@mit.edu> | 2014-01-18 18:26:24 -0500 |
---|---|---|
committer | Patrick Hurst <phurst@mit.edu> | 2014-01-18 18:26:24 -0500 |
commit | 4caa5f98146d40715a96aeab6c4ff65e7a0f38b6 (patch) | |
tree | 96e059e285d059c3c9373fdb081041a72121d767 /src/settings.sml | |
parent | 1ce3acd70b3527add32015267cc916e920661dbb (diff) | |
parent | 6787b686afe5fd3e65b3d377d4c363b4cd086dad (diff) |
Merge in upstream changes.
Diffstat (limited to 'src/settings.sml')
-rw-r--r-- | src/settings.sml | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/settings.sml b/src/settings.sml index 948906ed..93f54427 100644 --- a/src/settings.sml +++ b/src/settings.sml @@ -187,7 +187,10 @@ val benignBase = basis ["get_cookie", "preventDefault", "stopPropagation", "fresh", - "giveFocus"] + "giveFocus", + "currentUrlHasPost", + "currentUrlHasQueryString", + "currentUrl"] val benign = ref benignBase fun setBenignEffectful ls = benign := S.addList (benignBase, ls) @@ -299,8 +302,10 @@ val jsFuncsBase = basisM [("alert", "alert"), ("isblank", "isBlank"), ("isspace", "isSpace"), ("isxdigit", "isXdigit"), + ("isprint", "isPrint"), ("tolower", "toLower"), ("toupper", "toUpper"), + ("ord", "ord"), ("checkUrl", "checkUrl"), ("bless", "bless"), @@ -691,4 +696,28 @@ val timeFormat = ref "%c" fun setTimeFormat v = timeFormat := v fun getTimeFormat () = !timeFormat +fun lowercase s = + case s of + "" => "" + | _ => str (Char.toLower (String.sub (s, 0))) ^ String.extract (s, 1, NONE) + +fun capitalize s = + case s of + "" => "" + | _ => str (Char.toUpper (String.sub (s, 0))) ^ String.extract (s, 1, NONE) + +val mangle = ref true +fun setMangleSql x = mangle := x +fun mangleSqlTable s = if !mangle then "uw_" ^ capitalize s + else if #name (currentDbms ()) = "mysql" then capitalize s + else lowercase s +fun mangleSql s = if !mangle then "uw_" ^ s + else if #name (currentDbms ()) = "mysql" then lowercase s + else lowercase s +fun mangleSqlCatalog s = if !mangle then "uw_" ^ s else lowercase s + +val html5 = ref false +fun setIsHtml5 b = html5 := b +fun getIsHtml5 () = !html5 + end |