From 8b3161a3f47cd554cb6880ffef00814301e4fd63 Mon Sep 17 00:00:00 2001 From: Thorsten von Eicken Date: Sun, 14 Jun 2015 19:09:44 -0700 Subject: [PATCH] fix IE issues --- html/140medley.min.js | 7 +++++-- html/head.tpl | 1 + html/ui.js | 9 +++++---- html/wifi/wifi.tpl | 23 ++++++++++++++++++++--- user/cgi.c | 2 +- 5 files changed, 32 insertions(+), 10 deletions(-) diff --git a/html/140medley.min.js b/html/140medley.min.js index ff21073..78e620a 100644 --- a/html/140medley.min.js +++ b/html/140medley.min.js @@ -1,2 +1,5 @@ -var t=function(a,b){return function(c,d){return a.replace(/#{([^}]*)}/g,function(a,f){return Function("x","with(x)return "+f).call(c,d||b||{})})}},s=function(a,b){return b?{get:function(c){return a[c]&&b.parse(a[c])},set:function(c,d){a[c]=b.stringify(d)}}:{}}(this.localStorage||{},JSON),b=function(a,b,c,d){c=c||document;d=c[b="on"+b];a=c[b]=function(e){d=d&&d(e=e||c.event);return(a=a&&b(e))?b:d};c=this},m=function(a,b,c){b=document;c=b.createElement("p");c.innerHTML=a;for(a=b.createDocumentFragment();b= -c.firstChild;)a.appendChild(b);return a},$=function(a,b){a=a.match(/^(\W)?(.*)/);return(b||document)["getElement"+(a[1]?a[1]=="#"?"ById":"sByClassName":"sByTagName")](a[2])},j=function(a){for(a=0;a<4;a++)try{return a?new ActiveXObject([,"Msxml2","Msxml3","Microsoft"][a]+".XMLHTTP"):new XMLHttpRequest}catch(b){}}; +var b=function(a,b,c,d){c=c||document;d=c[b="on"+b];a=c[b]=function(e){d=d&&d(e=e||c.event);return(a=a&&b(e))?b:d};c=this}, +m=function(a,b,c){b=document;c=b.createElement("p");c.innerHTML=a;for(a=b.createDocumentFragment();b= +c.firstChild;)a.appendChild(b);return a}, +$=function(a,b){a=a.match(/^(\W)?(.*)/);return(b||document)["getElement"+(a[1]?a[1]=="#"?"ById":"sByClassName":"sByTagName")](a[2])}, +j=function(a){for(a=0;a<4;a++)try{return a?new ActiveXObject([,"Msxml2","Msxml3","Microsoft"][a]+".XMLHTTP"):new XMLHttpRequest}catch(b){}}; diff --git a/html/head.tpl b/html/head.tpl index 2983132..17de31f 100644 --- a/html/head.tpl +++ b/html/head.tpl @@ -1,3 +1,4 @@ + ESP Link diff --git a/html/ui.js b/html/ui.js index 488e2c7..9054512 100644 --- a/html/ui.js +++ b/html/ui.js @@ -68,11 +68,12 @@ function showNotification(text) { function ajaxReq(method, url, ok_cb, err_cb) { var xhr = j(); - xhr.open(method, url); + xhr.open(method, url, true); var timeout = setTimeout(function() { xhr.abort(); console.log("XHR abort:", method, url); - err_cb(599, "Request timeout"); + xhr.status = 599; + xhr.responseText = "request time-out"; }, 9000); xhr.onreadystatechange = function() { if (xhr.readyState != 4) { return; } @@ -81,7 +82,7 @@ function ajaxReq(method, url, ok_cb, err_cb) { console.log("XHR done:", method, url, "->", xhr.status); ok_cb(xhr.responseText); } else { - console.log("XHR ERR :", method, url, "->", xhr.status, xhr.responseText); + console.log("XHR ERR :", method, url, "->", xhr.status, xhr.responseText, xhr); err_cb(xhr.status, xhr.responseText); } } @@ -116,7 +117,7 @@ function ajaxSpin(method, url, ok_cb, err_cb) { ok_cb(resp); }, function(status, statusText) { $("#spinner").setAttribute('hidden', ''); - showWarning("Error: " + statusText); + //showWarning("Error: " + statusText); err_cb(status, statusText); }); } diff --git a/html/wifi/wifi.tpl b/html/wifi/wifi.tpl index b0531d6..2173999 100644 --- a/html/wifi/wifi.tpl +++ b/html/wifi/wifi.tpl @@ -40,6 +40,7 @@