From 7bef83241716af5b27964ccdb76401a3b2a983c9 Mon Sep 17 00:00:00 2001 From: Joey Kimsey Date: Wed, 11 Dec 2024 07:50:14 -0500 Subject: [PATCH] Bootstrap 5 cont --- app/css/main.css | 4 ++ app/js/main.js | 26 ++++++++---- app/plugins/blog/templates/blog.inc.php | 1 + app/plugins/blog/templates/blog.tpl | 50 +----------------------- app/plugins/blog/views/about.html | 2 +- app/plugins/blog/views/largeFeature.html | 7 ++++ app/plugins/blog/views/sidebar.html | 2 +- app/plugins/blog/views/smallFeature.html | 31 +++++++++++++++ app/plugins/comments/views/create.html | 18 +++++---- app/plugins/comments/views/list.html | 10 ++--- app/views/nav/usercp.html | 2 +- 11 files changed, 83 insertions(+), 70 deletions(-) create mode 100644 app/plugins/blog/views/largeFeature.html create mode 100644 app/plugins/blog/views/smallFeature.html diff --git a/app/css/main.css b/app/css/main.css index 78a4f5e..74e1631 100644 --- a/app/css/main.css +++ b/app/css/main.css @@ -10,7 +10,11 @@ */ + +.context-main-bg { + background-color: #f7f7f7; +} /* Base styles for the switch container */ .material-switch { position: relative; diff --git a/app/js/main.js b/app/js/main.js index 377b259..a41ce06 100644 --- a/app/js/main.js +++ b/app/js/main.js @@ -86,22 +86,34 @@ $(document).ready(function() { // with the dynamic footer, you need to adjust the content padding to make sure the footer doesn't overlap the content document.addEventListener('DOMContentLoaded', function () { const toggleButton = document.getElementById('dark-mode-toggle'); + const enableButton = document.getElementById('dark-mode-toggle-button'); const darkModeStylesheet = document.getElementById('dark-mode-stylesheet'); - console.error( 'DOMContentLoaded'); // Check if dark mode is saved in localStorage if (localStorage.getItem('darkMode') === 'enabled') { darkModeStylesheet.disabled = false; toggleButton.checked = true; - console.error( 'darkMode enabled'); - } else { - - console.error( 'darkMode disabled'); + if ( enableButton ) { + enableButton.innerText = 'Disable Now'; + } + } + + if ( enableButton ) { + enableButton.addEventListener('click', function () { + if (darkModeStylesheet.disabled) { + darkModeStylesheet.disabled = false; + localStorage.setItem('darkMode', 'enabled'); + enableButton.innerText = 'Disable Now'; + } else { + darkModeStylesheet.disabled = true; + localStorage.setItem('darkMode', 'disabled'); + enableButton.innerText = 'Enable Now'; + } + }); } toggleButton.addEventListener('click', function () { - console.error( 'addEventListener'); if (darkModeStylesheet.disabled) { darkModeStylesheet.disabled = false; localStorage.setItem('darkMode', 'enabled'); @@ -110,4 +122,4 @@ $(document).ready(function() { localStorage.setItem('darkMode', 'disabled'); } }); - }); \ No newline at end of file + }); diff --git a/app/plugins/blog/templates/blog.inc.php b/app/plugins/blog/templates/blog.inc.php index 35c19b6..714bf5f 100644 --- a/app/plugins/blog/templates/blog.inc.php +++ b/app/plugins/blog/templates/blog.inc.php @@ -30,6 +30,7 @@ class BlogLoader extends DefaultLoader { Components::set('SIDEBAR', Views::simpleView('blog.sidebar', $posts->recent(5))); Components::set('SIDEBAR2', Views::simpleView('blog.sidebar2', $posts->archive())); Components::set('SIDEBARABOUT', Views::simpleView('blog.about')); + Components::set('BLOGFEATURES', ''); Navigation::setCrumbComponent( 'BLOG_BREADCRUMBS', Input::get( 'url' ) ); Components::set( 'BLOG_TEMPLATE_URL', Template::parse( '{ROOT_URL}app/plugins/comments/' ) ); $this->addCss( '' ); diff --git a/app/plugins/blog/templates/blog.tpl b/app/plugins/blog/templates/blog.tpl index c404cf9..1444ac6 100644 --- a/app/plugins/blog/templates/blog.tpl +++ b/app/plugins/blog/templates/blog.tpl @@ -74,57 +74,11 @@
-
-
-

Title of a longer featured blog post

-

Multiple lines of text that form the lede, informing new readers quickly and efficiently about what’s most interesting in this post’s contents.

-

Continue reading...

-
-
-
-
-
-
- World -

Featured post

-
Nov 12
-

This is a wider card with supporting text below as a natural lead-in to additional content.

- Continue reading -
-
- PlaceholderThumbnail -
-
-
-
-
-
- Design -

Post title

-
Nov 11
-

This is a wider card with supporting text below as a natural lead-in to additional content.

- Continue reading -
-
- PlaceholderThumbnail -
-
-
-
+ {BLOGFEATURES}
- - - - - - -
- - -

{SITENAME} Blog

@@ -136,7 +90,7 @@
-
+
{SIDEBARABOUT}
diff --git a/app/plugins/blog/views/about.html b/app/plugins/blog/views/about.html index 12777ba..ccd8d95 100644 --- a/app/plugins/blog/views/about.html +++ b/app/plugins/blog/views/about.html @@ -1,4 +1,4 @@ -
+

About

The blog is mostly here to serve ass a simple way to link to long-form content on the site. There won't be any breaking news or tell-all stories here. Just good ole fashioned boring crap no one wants to read. diff --git a/app/plugins/blog/views/largeFeature.html b/app/plugins/blog/views/largeFeature.html new file mode 100644 index 0000000..e533c50 --- /dev/null +++ b/app/plugins/blog/views/largeFeature.html @@ -0,0 +1,7 @@ +

+
+

Title of a longer featured blog post

+

Multiple lines of text that form the lede, informing new readers quickly and efficiently about what’s most interesting in this post’s contents.

+

Continue reading...

+
+
\ No newline at end of file diff --git a/app/plugins/blog/views/sidebar.html b/app/plugins/blog/views/sidebar.html index d10de0b..07ca483 100644 --- a/app/plugins/blog/views/sidebar.html +++ b/app/plugins/blog/views/sidebar.html @@ -1,4 +1,4 @@ -
+

Recent Posts

diff --git a/app/plugins/blog/views/smallFeature.html b/app/plugins/blog/views/smallFeature.html new file mode 100644 index 0000000..14eaaf0 --- /dev/null +++ b/app/plugins/blog/views/smallFeature.html @@ -0,0 +1,31 @@ + +
+
+
+
+ World +

Featured post

+
Nov 12
+

This is a wider card with supporting text below as a natural lead-in to additional content.

+ Continue reading +
+
+ PlaceholderThumbnail +
+
+
+
+
+
+ Design +

Post title

+
Nov 11
+

This is a wider card with supporting text below as a natural lead-in to additional content.

+ Continue reading +
+
+ PlaceholderThumbnail +
+
+
+
\ No newline at end of file diff --git a/app/plugins/comments/views/create.html b/app/plugins/comments/views/create.html index 098552a..0cc13a5 100644 --- a/app/plugins/comments/views/create.html +++ b/app/plugins/comments/views/create.html @@ -1,10 +1,14 @@ -
-
-
- -
+ +
+
- + - \ No newline at end of file + diff --git a/app/plugins/comments/views/list.html b/app/plugins/comments/views/list.html index cfb4e58..2a4777d 100644 --- a/app/plugins/comments/views/list.html +++ b/app/plugins/comments/views/list.html @@ -1,10 +1,10 @@ -
-
- -

Comments

+
+
+ + Comments {count}
-
+
    {LOOP}
  • diff --git a/app/views/nav/usercp.html b/app/views/nav/usercp.html index a9dd2e2..7bf679f 100644 --- a/app/views/nav/usercp.html +++ b/app/views/nav/usercp.html @@ -1,5 +1,5 @@ \ No newline at end of file