changeset 1038:dcc6093e9575

Get message-passing working in IE6
author Adam Chlipala <adamc@hcoop.net>
date Sat, 21 Nov 2009 15:48:08 -0500
parents 83d8ddd09d95
children 8932f855fa85
files lib/js/urweb.js src/c/urweb.c src/cjr_print.sml
diffstat 3 files changed, 18 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/lib/js/urweb.js	Sat Nov 21 14:29:35 2009 -0500
+++ b/lib/js/urweb.js	Sat Nov 21 15:48:08 2009 -0500
@@ -487,7 +487,7 @@
 function ts(x) { return x.toString() }
 function bs(b) { return (b ? "True" : "False") }
 
-function sub(s, i) { return s[i]; }
+function sub(s, i) { return s.charAt(i); }
 function suf(s, i) { return s.substring(i); }
 function slen(s) { return s.length; }
 function sidx(s, ch) {
@@ -499,7 +499,7 @@
 }
 function sspn(s, chs) {
   for (var i = 0; i < s.length; ++i)
-    if (chs.indexOf(s[i]) != -1)
+    if (chs.indexOf(s.charAt(i)) != -1)
       return i;
 
   return null;
@@ -550,14 +550,14 @@
 function uf(s) {
   if (s.length == 0)
     return "_";
-  return (s[0] == '_' ? "_" : "")
+  return (s.charAt(0) == '_' ? "_" : "")
         + escape(s).replace(new RegExp ("/", "g"), "%2F").replace(new RegExp ("\\+", "g"), "%2B");
 }
 
 function uu(s) {
-  if (s.length > 0 && s[0] == '_')
+  if (s.length > 0 && s.charAt(0) == '_') {
     s = s.substring(1);
-  else if (s.length >= 3 && s[0] == '%' && s[1] == '5' && (s[2] == 'f' || s[2] == 'F'))
+  } else if (s.length >= 3 && s.charAt(0) == '%' && s.charAt(1) == '5' && (s.charAt(2) == 'f' || s.charAt(2) == 'F'))
     s = s.substring(3);
   return unescape(s.replace(new RegExp ("\\+", "g"), " "));
 }
@@ -657,7 +657,7 @@
 }
 
 function path_join(s1, s2) {
-  if (s1.length > 0 && s1[s1.length-1] == '/')
+  if (s1.length > 0 && s1.charAt(s1.length-1) == '/')
     return s1 + s2;
   else
     return s1 + "/" + s2;
@@ -754,6 +754,8 @@
           }
         }
 
+        xhr.abort();
+
         connect();
       }
       else {
--- a/src/c/urweb.c	Sat Nov 21 14:29:35 2009 -0500
+++ b/src/c/urweb.c	Sat Nov 21 15:48:08 2009 -0500
@@ -672,6 +672,8 @@
 }
 
 int uw_set_input(uw_context ctx, const char *name, char *value) {
+  printf("Input name %s\n", name);
+
   if (!strcasecmp(name, ".b")) {
     int n = uw_input_num(value);
     input *inps;
@@ -760,6 +762,8 @@
     int n = uw_input_num(name);
 
     if (n < 0) {
+      if (!strcmp(name, "null"))
+        return 0;
       uw_set_error(ctx, "Bad input name %s", name);
       return -1;
     }
--- a/src/cjr_print.sml	Sat Nov 21 14:29:35 2009 -0500
+++ b/src/cjr_print.sml	Sat Nov 21 15:48:08 2009 -0500
@@ -2575,16 +2575,16 @@
                                     end,
                                     string "\");",
                                     newline,
-                                    string "uw_set_needs_push(ctx, ",
-                                    string (case side of
-                                                ServerAndPullAndPush => "1"
-                                              | _ => "0"),
-                                    string ");",
-                                    newline,
                                     string "uw_set_url_prefix(ctx, \"",
                                     string (Settings.getUrlPrefix ()),
                                     string "\");",
                                     newline]),
+                     string "uw_set_needs_push(ctx, ",
+                     string (case side of
+                                 ServerAndPullAndPush => "1"
+                               | _ => "0"),
+                     string ");",
+                     newline,
                      string "uw_set_needs_sig(ctx, ",
                      string (if couldWrite ek then
                                  "1"