From 9ba4ccaa9c93f89ad4d1162498858798bf7247b7 Mon Sep 17 00:00:00 2001 From: tenox Date: Sun, 21 Aug 2016 02:11:47 -0700 Subject: more JS dependency fixes --- dir.c | 17 ++++++++++------- wfm.c | 4 +++- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/dir.c b/dir.c index bcbe75e..cc67708 100644 --- a/dir.c +++ b/dir.c @@ -113,8 +113,9 @@ void dirlist(void) { " else {\n" " cbGroup.checked = checkAllState.checked;\n" " }\n" - "}\n" - "\n" + "}\n"); + + if(js>=2) fprintf(cgiOut, "function xmlhttpPost(strURL) {\n" " var xmlHttpReq = false;\n" " var self = this;\n" @@ -140,12 +141,14 @@ void dirlist(void) { "\n" "function start() {\n" " setInterval('xmlhttpPost(\"%s?ea=upstat&upload_id=%s\");', 250);\n" - "}\n" - "\n" - "//-->\n" - "\n", + "}\n", cgiScriptName, "1234"); + if(js) fprintf(cgiOut, + "//-->\n" + "\n"); + + fprintf(cgiOut, "