From 33f55824d81e105e8010e59cc10480a2ee96b1bd Mon Sep 17 00:00:00 2001 From: Kumi Date: Mon, 5 Aug 2024 12:10:33 +0200 Subject: [PATCH] fix: ensure conditional loading of jQuery & Bootstrap Enhanced global.js and script.js to conditionally load jQuery and Bootstrap only if they are not already present. This change improves loading efficiency and reduces redundant script execution. Additionally, fixed a bug in renderer.php by removing duplicate Bootstrap loading, which also reduces external dependency. A new .gitignore file was added to ignore backup files with a .bak extension, helping to keep the repository clean. Ensured error logging only displays error messages for better clarity. --- .gitignore | 1 + classes/output/renderer.php | 2 +- global.js | 161 ++++++++++++++++++++++++------------ script.js | 52 ++++++------ 4 files changed, 132 insertions(+), 84 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7664704 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.bak \ No newline at end of file diff --git a/classes/output/renderer.php b/classes/output/renderer.php index e75440d..fa91bf8 100644 --- a/classes/output/renderer.php +++ b/classes/output/renderer.php @@ -11,7 +11,7 @@ class renderer extends plugin_renderer_base { private static $modals_rendered = false; public function render_activity($activity_id) { - $script = ""; + $script = "