summaryrefslogtreecommitdiff
path: root/lib/js/urweb.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/js/urweb.js')
-rw-r--r--lib/js/urweb.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js
index 9f3c332f..71a1a53d 100644
--- a/lib/js/urweb.js
+++ b/lib/js/urweb.js
@@ -487,7 +487,7 @@ function eh(x) {
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 sidx(s, ch) {
}
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 pflo(s) {
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 rc(prefix, uri, parse, k, needsSig) {
}
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 @@ function listener() {
}
}
+ xhr.abort();
+
connect();
}
else {