From 8942dc3632db93f7d7400bf8257b0b89da7eec54 Mon Sep 17 00:00:00 2001 From: sthag Date: Sat, 17 May 2025 13:04:31 +0200 Subject: [PATCH] refactor: Move script parts around - Run setup function in global script - Move common script assets to hippie main template - Remove unused scrcipt from components page --- source/code/hippie/global.js | 2 +- source/screens/demo/basics.njk | 5 ----- source/screens/demo/components.njk | 13 ------------- source/screens/demo/examples/card.njk | 5 ----- source/screens/demo/index.njk | 6 ------ source/screens/demo/introduction.njk | 5 ----- source/screens/demo/layouts.njk | 5 ----- source/templates/demo/_main.njk | 17 ++++++----------- source/templates/hippie/_default.njk | 4 +++- source/templates/hippie/_main.njk | 7 +++++++ 10 files changed, 17 insertions(+), 52 deletions(-) diff --git a/source/code/hippie/global.js b/source/code/hippie/global.js index ef61ad7..0b05906 100644 --- a/source/code/hippie/global.js +++ b/source/code/hippie/global.js @@ -1,3 +1,3 @@ // Setup // ----------------------------------------------------------------------------- -// setup(); +setup(); diff --git a/source/screens/demo/basics.njk b/source/screens/demo/basics.njk index 566d527..8206a8c 100644 --- a/source/screens/demo/basics.njk +++ b/source/screens/demo/basics.njk @@ -872,11 +872,6 @@ tags: {% block script %} {{ super() }} - {# #} - - - - - {# #} - - - - {{ log.asset(true) }} {{ log.log('Assets loaded.', assetsLoaded) }} - {% endblock %} \ No newline at end of file diff --git a/source/screens/demo/examples/card.njk b/source/screens/demo/examples/card.njk index 353fed9..ee7011a 100644 --- a/source/screens/demo/examples/card.njk +++ b/source/screens/demo/examples/card.njk @@ -59,11 +59,6 @@ tags: {% block script %} {{ super() }} - {# #} - - - - #} - - - - diff --git a/source/screens/demo/introduction.njk b/source/screens/demo/introduction.njk index 3d82d76..792967e 100644 --- a/source/screens/demo/introduction.njk +++ b/source/screens/demo/introduction.njk @@ -32,11 +32,6 @@ tags: {% block script %} {{ super() }} - {# #} - - - - - {# #} - - - - {{ log.asset(true) }} {{ log.log('Assets loaded.', assetsLoaded) }} -{% endblock %} diff --git a/source/templates/hippie/_default.njk b/source/templates/hippie/_default.njk index 2fcbcd1..8756e7f 100644 --- a/source/templates/hippie/_default.njk +++ b/source/templates/hippie/_default.njk @@ -1,5 +1,7 @@ -{% import "hippie/macros/_log.njk" as log %} +{# {% if hippie.debugMode %} #} + {% import "hippie/macros/_log.njk" as log %} +{# {% endif %} #} diff --git a/source/templates/hippie/_main.njk b/source/templates/hippie/_main.njk index 9a76aad..b7d305a 100644 --- a/source/templates/hippie/_main.njk +++ b/source/templates/hippie/_main.njk @@ -41,6 +41,13 @@ {% block script %} {{ log.log('BODY :: Loading script assets...') }} + {# #} + + {# // TODO: Remove dependecy to jQuery; at least maek it optional #} + + + + {% endblock %} {{ log.log('BODY end :: Page script might still be loading.') }}