From 94a861c285cbd6ec99cd3835b7677ef860dd304c Mon Sep 17 00:00:00 2001 From: echicken <> Date: Mon, 30 Sep 2013 18:43:04 +0000 Subject: [PATCH] DeDeuce it. Where is web_root_directory supposed to be coming from? (I don't see it here.) Current method assumes that there is a ../web/lib/ relative to (I gather) system.exec_dir. Is that bad? --- web/root/ecwebv3/forum-async.ssjs | 2 +- web/root/ecwebv3/pages/002-forum.ssjs | 2 +- web/root/ecwebv3/sidebar/002-whosOnline.ssjs | 36 ++++++++++---------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/web/root/ecwebv3/forum-async.ssjs b/web/root/ecwebv3/forum-async.ssjs index 055ae6b43e..f2c675b4f1 100644 --- a/web/root/ecwebv3/forum-async.ssjs +++ b/web/root/ecwebv3/forum-async.ssjs @@ -2,7 +2,7 @@ // echicken -at- bbs.electronicchicken.com load('webInit.ssjs'); -load(web_root_dir+"/../lib/forum.ssjs"); +load("../web/lib/forum.ssjs"); if(typeof http_request.query.postmessage != "undefined") { var x = postMessage( diff --git a/web/root/ecwebv3/pages/002-forum.ssjs b/web/root/ecwebv3/pages/002-forum.ssjs index 24585cb2ce..c69f287c7b 100644 --- a/web/root/ecwebv3/pages/002-forum.ssjs +++ b/web/root/ecwebv3/pages/002-forum.ssjs @@ -3,7 +3,7 @@ // echicken -at- bbs.electronicchicken.com load('webInit.ssjs'); -load(web_root_dir+"/../lib/forum.ssjs"); +load("../web/lib/forum.ssjs"); print("<span class='title'>Forum</span><br /><br />"); diff --git a/web/root/ecwebv3/sidebar/002-whosOnline.ssjs b/web/root/ecwebv3/sidebar/002-whosOnline.ssjs index 0e2e443443..c4a45a7dd6 100644 --- a/web/root/ecwebv3/sidebar/002-whosOnline.ssjs +++ b/web/root/ecwebv3/sidebar/002-whosOnline.ssjs @@ -3,30 +3,30 @@ var update = 30000; // Milliseconds between updates load("nodedefs.js"); if(http_request.query.hasOwnProperty("action") && http_request.query.action.toString() == "show") { - print("<b>Who's online</b><br><br>"); - print("<table border=0 cellpadding=0 cellspacing=0 class='font'>"); - for(n = 0; n < system.node_list.length; n++) { - if(system.node_list[n] === undefined) - continue; - print("<tr><td>Node " + (n + 1) + ": </td>"); - if(system.node_list[n].status == 3) - print("<td>" + system.username(system.node_list[n].useron) + "</td></tr><tr><td> </td><td style=font-style:italic;>" + NodeAction[system.node_list[n].action] + "</td></tr>"); - else if(system.node_list[n].status == 4) - print("<td style=font-style:italic;>" + NodeStatus[0] + "</td></tr>"); // Pretend to be WFC if in use but quiet - else - print("<td style=font-style:italic;>" + NodeStatus[system.node_list[n].status] + "</td></tr>"); - } - print("</table>"); + print("<b>Who's online</b><br><br>"); + print("<table border=0 cellpadding=0 cellspacing=0 class='font'>"); + for(n = 0; n < system.node_list.length; n++) { + if(system.node_list[n] === undefined) + continue; + print("<tr><td>Node " + (n + 1) + ": </td>"); + if(system.node_list[n].status == 3) + print("<td>" + system.username(system.node_list[n].useron) + "</td></tr><tr><td> </td><td style=font-style:italic;>" + NodeAction[system.node_list[n].action] + "</td></tr>"); + else if(system.node_list[n].status == 4) + print("<td style=font-style:italic;>" + NodeStatus[0] + "</td></tr>"); // Pretend to be WFC if in use but quiet + else + print("<td style=font-style:italic;>" + NodeStatus[system.node_list[n].status] + "</td></tr>"); + } + print("</table>"); } else { print("<div id='whosonline'></div>"); print("<script type='text/javascript'>"); print("function xhrwo() {"); - print("\tvar XMLReq = new XMLHttpRequest();"); - print("\tXMLReq.open('GET', './sidebar/002-whosOnline.ssjs?action=show', true);"); - print("\tXMLReq.send(null);"); - print("\tXMLReq.onreadystatechange = function() { if(XMLReq.readyState == 4) { document.getElementById('whosonline').innerHTML = XMLReq.responseText; } }"); + print("var XMLReq = new XMLHttpRequest();"); + print("XMLReq.open('GET', './sidebar/002-whosOnline.ssjs?action=show', true);"); + print("XMLReq.send(null);"); + print("XMLReq.onreadystatechange = function() { if(XMLReq.readyState == 4) { document.getElementById('whosonline').innerHTML = XMLReq.responseText; } }"); print("}"); print("setInterval('xhrwo()', " + update + ");"); print("xhrwo();"); -- GitLab