Changeset 14401
- Timestamp:
- 08/18/12 12:22:25 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/www/smartfact/index.js
r14208 r14401 35 35 xmlLoad.onload = function() 36 36 { 37 if (xmlLoad.status==401) 38 login(""); 39 37 40 if (xmlLoad.status!=200) 38 41 { … … 40 43 //return; 41 44 } 42 if (xmlLoad.responseText.length>0) 43 alert(xmlLoad.responseText); 45 46 if (xmlLoad.status==200) 47 login(xmlLoad.responseText); 44 48 }; 45 49 xmlLoad.send(null); … … 88 92 } 89 93 94 function login(user) 95 { 96 var z = $("body").visiblePage; 97 var l = $("login"+z); 98 99 $("body").user = user; 100 101 if (l) 102 { 103 l.setAttribute("style", "background-position:-"+(user?"720":"755")+"px 50%;"); 104 l.alt = user; 105 } 106 } 107 90 108 function onresize() 91 109 { … … 153 171 xmlCmd.onload = function () 154 172 { 173 if (xmlCmd.status==401) 174 login(""); 175 155 176 if (xmlCmd.status!=200) 156 177 { … … 166 187 167 188 var txt = xmlCmd.responseText.split('\n'); 168 switch (txt[0]) 189 190 login(txt[0]); 191 192 switch (txt[1]) 169 193 { 170 194 case "1": alert("dimctrl unreachable."); break; … … 172 196 default: alert("Return code '"+txt[0]+"' unknown."); break; 173 197 } 174 if (txt.length> 1)198 if (txt.length>2) 175 199 alert(xmlCmd.responseText); 176 200 }; … … 251 275 var htd4 = $new("td"); 252 276 var htd5 = $new("td"); 277 var htd6 = $new("td"); 253 278 htd0.setAttribute("class", "tcell1"); 254 279 htd1.setAttribute("class", "tcell2"); … … 259 284 htd4.setAttribute("width", "1px"); 260 285 htd5.setAttribute("width", "1px"); 286 htd6.setAttribute("width", "1px"); 287 hhtr.appendChild(htd6); 261 288 hhtr.appendChild(htd4); 262 289 hhtr.appendChild(htd3); … … 266 293 hhtr.appendChild(htd5); 267 294 295 var div0 = $new("div"); 268 296 var div1 = $new("div"); 269 297 var div2 = $new("div"); … … 271 299 var div4 = $new("div"); 272 300 var div5 = $new("div"); 301 div0.id = "login"+z; 302 div0.alt = $("body").user; 273 303 div4.id = "warn"+z; 274 304 div5.id = "speaker"+z; 305 div0.setAttribute("class", "icon_login"); 275 306 div2.setAttribute("class", "icon_white"); 276 307 div4.setAttribute("class", "icon_color"); 277 308 div5.setAttribute("class", "icon_color"); 309 div0.setAttribute("style", "background-position:-"+($("body").user?"720":"755")+"px 50%;"); 278 310 div2.setAttribute("style", "background-position:-396px 50%;"); 279 div4.setAttribute("style", "background-position:-12px -1 2px;display:none;");311 div4.setAttribute("style", "background-position:-12px -13px;display:none;"); 280 312 div5.setAttribute("style", "background-position:-189px -57px;"); 313 div0.onclick = function () { sendCommand("logout"); }; 281 314 div2.onclick = function () { this.style.backgroundColor='rgba(0,0,0,0.77)'; loadPage(fname, z, -dz); }; 282 315 div4.onclick = function () { this.style.backgroundColor='rgba(0,0,0,0.77)'; loadPage('error', z, +1); }; … … 328 361 htd0.appendChild(sp2); 329 362 363 htd6.appendChild(div0); // Login 330 364 htd1.appendChild(div1); 331 365 if (dz!=0/* && z+dz!=0*/) … … 333 367 htd3.appendChild(div3); // home 334 368 htd4.appendChild(div4); // Warning 335 htd5.appendChild(div5); // Warning369 htd5.appendChild(div5); // Speaker 336 370 337 371 // ================================================================== … … 916 950 if (xmlText.status!=200) 917 951 { 918 alert("ERROR[ 1] - HTTP request '"+fname+".data': "+xmlText.statusText+" ["+xmlText.status+"]");952 alert("ERROR[2] - HTTP request '"+fname+".data': "+xmlText.statusText+" ["+xmlText.status+"]"); 919 953 timeoutText = setTimeout(refresh_text, 10000); 920 954 return; … … 1081 1115 if (xmlGfx.status!=200) 1082 1116 { 1083 alert("ERROR[ 2] - Request '"+fname+"': "+xmlGfx.statusText+" ["+xmlGfx.status+"]");1117 alert("ERROR[3] - Request '"+fname+"': "+xmlGfx.statusText+" ["+xmlGfx.status+"]"); 1084 1118 timeoutGraphics = setTimeout(refresh_graphics, 10000); 1085 1119 //****** invalidate ******
Note:
See TracChangeset
for help on using the changeset viewer.