comparison lib/js/urweb.js @ 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
comparison
equal deleted inserted replaced
1037:83d8ddd09d95 1038:dcc6093e9575
485 } 485 }
486 486
487 function ts(x) { return x.toString() } 487 function ts(x) { return x.toString() }
488 function bs(b) { return (b ? "True" : "False") } 488 function bs(b) { return (b ? "True" : "False") }
489 489
490 function sub(s, i) { return s[i]; } 490 function sub(s, i) { return s.charAt(i); }
491 function suf(s, i) { return s.substring(i); } 491 function suf(s, i) { return s.substring(i); }
492 function slen(s) { return s.length; } 492 function slen(s) { return s.length; }
493 function sidx(s, ch) { 493 function sidx(s, ch) {
494 var r = s.indexOf(ch); 494 var r = s.indexOf(ch);
495 if (r == -1) 495 if (r == -1)
497 else 497 else
498 return r; 498 return r;
499 } 499 }
500 function sspn(s, chs) { 500 function sspn(s, chs) {
501 for (var i = 0; i < s.length; ++i) 501 for (var i = 0; i < s.length; ++i)
502 if (chs.indexOf(s[i]) != -1) 502 if (chs.indexOf(s.charAt(i)) != -1)
503 return i; 503 return i;
504 504
505 return null; 505 return null;
506 } 506 }
507 function schr(s, ch) { 507 function schr(s, ch) {
548 } 548 }
549 549
550 function uf(s) { 550 function uf(s) {
551 if (s.length == 0) 551 if (s.length == 0)
552 return "_"; 552 return "_";
553 return (s[0] == '_' ? "_" : "") 553 return (s.charAt(0) == '_' ? "_" : "")
554 + escape(s).replace(new RegExp ("/", "g"), "%2F").replace(new RegExp ("\\+", "g"), "%2B"); 554 + escape(s).replace(new RegExp ("/", "g"), "%2F").replace(new RegExp ("\\+", "g"), "%2B");
555 } 555 }
556 556
557 function uu(s) { 557 function uu(s) {
558 if (s.length > 0 && s[0] == '_') 558 if (s.length > 0 && s.charAt(0) == '_') {
559 s = s.substring(1); 559 s = s.substring(1);
560 else if (s.length >= 3 && s[0] == '%' && s[1] == '5' && (s[2] == 'f' || s[2] == 'F')) 560 } else if (s.length >= 3 && s.charAt(0) == '%' && s.charAt(1) == '5' && (s.charAt(2) == 'f' || s.charAt(2) == 'F'))
561 s = s.substring(3); 561 s = s.substring(3);
562 return unescape(s.replace(new RegExp ("\\+", "g"), " ")); 562 return unescape(s.replace(new RegExp ("\\+", "g"), " "));
563 } 563 }
564 564
565 function ub(b) { 565 function ub(b) {
655 655
656 requestUri(xhr, uri, needsSig); 656 requestUri(xhr, uri, needsSig);
657 } 657 }
658 658
659 function path_join(s1, s2) { 659 function path_join(s1, s2) {
660 if (s1.length > 0 && s1[s1.length-1] == '/') 660 if (s1.length > 0 && s1.charAt(s1.length-1) == '/')
661 return s1 + s2; 661 return s1 + s2;
662 else 662 else
663 return s1 + "/" + s2; 663 return s1 + "/" + s2;
664 } 664 }
665 665
751 } catch (v) { 751 } catch (v) {
752 doExn(v); 752 doExn(v);
753 } 753 }
754 } 754 }
755 } 755 }
756
757 xhr.abort();
756 758
757 connect(); 759 connect();
758 } 760 }
759 else { 761 else {
760 try { 762 try {