From 0c8fa3d288cad378abcc6c38fa687d5706e80c44 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Tue, 29 Sep 2020 20:04:01 +0200 Subject: [PATCH] Convert webbuild.js.inc into canonically include script webbuild-2.js --- header-webbuild-status.php | 5 +---- header-webbuild.php | 8 ++------ webbuild.js.inc => scripts/webbuild/webbuild-2.js | 4 +--- scripts/webbuild/webbuild.js | 6 ++---- 4 files changed, 6 insertions(+), 17 deletions(-) rename webbuild.js.inc => scripts/webbuild/webbuild-2.js (99%) diff --git a/header-webbuild-status.php b/header-webbuild-status.php index 75279d7..2a2c12c 100644 --- a/header-webbuild-status.php +++ b/header-webbuild-status.php @@ -54,13 +54,10 @@ print '' . PHP_EOL; # webbuild print ''; +print ''; # distroquery print '' . PHP_EOL; -$file = fopen(get_stylesheet_directory() . "/webbuild.js.inc", "r"); -print fread($file, 20000); -fclose($file); - # webbuild css print ''; diff --git a/header-webbuild.php b/header-webbuild.php index ec44459..339756e 100644 --- a/header-webbuild.php +++ b/header-webbuild.php @@ -85,13 +85,9 @@ print '' . PHP_EOL; print '' . PHP_EOL; print '' . PHP_EOL; +# webbuild js print '' . PHP_EOL; - -$file = fopen(get_stylesheet_directory() . "/webbuild.js.inc", "r"); -print fread($file, 20000); -fclose($file); - - +print '' . PHP_EOL; # webbuild css print ''; diff --git a/webbuild.js.inc b/scripts/webbuild/webbuild-2.js similarity index 99% rename from webbuild.js.inc rename to scripts/webbuild/webbuild-2.js index 6f482eb..246484b 100644 --- a/webbuild.js.inc +++ b/scripts/webbuild/webbuild-2.js @@ -1,5 +1,3 @@ - diff --git a/scripts/webbuild/webbuild.js b/scripts/webbuild/webbuild.js index 38f2e60..c91dbe5 100644 --- a/scripts/webbuild/webbuild.js +++ b/scripts/webbuild/webbuild.js @@ -160,12 +160,10 @@ function replaceHTML(el, html) { function getDownload(request) { if (host != undefined) { - webbuildhost=host; + var url = "/cgi-bin/webbuild-" + host + ".cgi"; } else { - alert("ERROR: webbuildhost is undefined!"); - return; + var url = "/cgi-bin/webbuild"; } - var url = "/cgi-bin/webbuild-" + webbuildhost + ".cgi"; if (request != "") request=request+"&USER="+user+"&USER_EMAIL="+user_email+"&SECRET="+encodeURIComponent(secret);