From fb9464437e68c13474409c969f934afe13768649 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Wed, 24 Jul 2024 14:32:34 +0200 Subject: Remove link to "Contents" from the help table of contect sidebar. Changes the element where the jQuery.toc plugin looks for headings to only include the actual help contents, not the toc itself. --- view/tpl/help.tpl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/view/tpl/help.tpl b/view/tpl/help.tpl index 68e1c6694..ce3f46fdb 100644 --- a/view/tpl/help.tpl +++ b/view/tpl/help.tpl @@ -7,7 +7,7 @@ {{$module->missing_translation_message()}} {{/if}} -
+

@@ -15,6 +15,8 @@

- {{$module->render_content()}} +
+ {{$module->render_content()}} +
-- cgit v1.2.3 From 26ce231951e62f1912d457c8f6e6b0f2092173f1 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Wed, 24 Jul 2024 15:32:16 +0200 Subject: Use html details element for toc on top of help pages. This allows us to get rid of some more unneccessary JavaScript that just implements stuff that web browsers now do anyways. --- view/css/mod_help.css | 9 ++++++++- view/js/mod_help.js | 11 ----------- view/tpl/help.tpl | 11 ++++------- 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/view/css/mod_help.css b/view/css/mod_help.css index 3c3bc195f..ef40552d4 100644 --- a/view/css/mod_help.css +++ b/view/css/mod_help.css @@ -15,6 +15,14 @@ list-style-type: none; } +#doco-top-toc-wrapper { + margin-bottom: 1em; +} + +#doco-top-toc-wrapper > summary { + font-size: large; +} + .toc-content li, #doco-top-toc li { padding: 3px 0px; @@ -23,4 +31,3 @@ #doco-side-toc li { padding-left: 20px; } - diff --git a/view/js/mod_help.js b/view/js/mod_help.js index abd0d1194..8308f23ec 100644 --- a/view/js/mod_help.js +++ b/view/js/mod_help.js @@ -1,14 +1,3 @@ -function docoTocToggle() { - if ($('#doco-top-toc').is(':visible')) { - $('#doco-toc-toggle').removeClass('bi-gear').addClass('bi-caret-right'); - } else { - $('#doco-toc-toggle').removeClass('bi-caret-right').addClass('bi-caret-down'); - } - $('#doco-top-toc').toggle(); - - return false; -} - toc = {}; // Generate the table of contents in the side nav menu (see view/tpl/help.tpl) $(document).ready(function () { diff --git a/view/tpl/help.tpl b/view/tpl/help.tpl index ce3f46fdb..8b7669c75 100644 --- a/view/tpl/help.tpl +++ b/view/tpl/help.tpl @@ -8,13 +8,10 @@ {{/if}}
-

- - - {{$module->get_toc_heading()}} - -

- +
+ {{$module->get_toc_heading()}} +
    +
    {{$module->render_content()}}
    -- cgit v1.2.3 From 25d9d3ba1b6eed803c838f8cbfb67fb9b60e9185 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Wed, 24 Jul 2024 18:06:39 +0200 Subject: Move some help related styling from redbasic to module css. --- view/css/mod_help.css | 14 ++++++++++++++ view/theme/redbasic/css/style.css | 14 -------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/view/css/mod_help.css b/view/css/mod_help.css index ef40552d4..df24e7c5e 100644 --- a/view/css/mod_help.css +++ b/view/css/mod_help.css @@ -11,6 +11,10 @@ padding-bottom: 0.3em; } +#doco-content img { + width: 100%; +} + #region_1 .widget ul ul { list-style-type: none; } @@ -31,3 +35,13 @@ #doco-side-toc li { padding-left: 20px; } + +.selected-doco-nav { + font-weight: bold; + text-shadow: 2px 2px 3px lightgray; +} + +#help-content pre code { + overflow-x: auto; + white-space: pre; +} diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index ec8ce42b3..6e6e19532 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -150,20 +150,6 @@ input[type=text], textarea { color: var(--bs-body-color); } -.selected-doco-nav { - font-weight: bold; - text-shadow: 2px 2px 3px lightgray; -} - -#doco-content img { - width: 100%; -} - -#help-content pre code { - overflow-x: auto; - white-space: pre; -} - .heart { color: #FF0000; } -- cgit v1.2.3 From 8ae9df3bb7ab76bf8c1f864ac6c4869366e8b497 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Wed, 24 Jul 2024 18:10:26 +0200 Subject: Replace drop shadow in help toc with brighter color. The drop shadow looked terrible in dark mode. While that could be fixed, I think it looks better with just using the link hover color and making the selected item bold. --- view/css/mod_help.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/view/css/mod_help.css b/view/css/mod_help.css index df24e7c5e..d596048c9 100644 --- a/view/css/mod_help.css +++ b/view/css/mod_help.css @@ -36,9 +36,9 @@ padding-left: 20px; } -.selected-doco-nav { +.selected-doco-nav > a { font-weight: bold; - text-shadow: 2px 2px 3px lightgray; + color: var(--bs-link-hover-color); } #help-content pre code { -- cgit v1.2.3 From 4daa03f025505fc6f98f6a169cf743df1b958741 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sun, 29 Sep 2024 14:09:41 +0200 Subject: Help: Drop language specifier in URL when redirecting This finally fixes the help for languages other than english. --- Zotlabs/Module/Help.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Module/Help.php b/Zotlabs/Module/Help.php index cacc81607..fc0ef2708 100644 --- a/Zotlabs/Module/Help.php +++ b/Zotlabs/Module/Help.php @@ -30,7 +30,7 @@ class Help extends \Zotlabs\Web\Controller { $this->determine_help_language(); if (empty($_REQUEST['search']) && argc() === 1) { - goaway("/help/{$this->lang['language']}/about/about"); + goaway("/help/about/about"); killme(); } } @@ -155,7 +155,7 @@ class Help extends \Zotlabs\Web\Controller { } if (empty($args)) { - goaway("/help/{$this->lang['language']}/about/about"); + goaway("/help/about/about"); } // Keep the first remaining arg as the heading slug -- cgit v1.2.3 From 5b93aa1148d647026b309e4f9e0eeca4f09d53ee Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sun, 29 Sep 2024 14:28:17 +0200 Subject: Tests: Unbreak help test. --- tests/unit/Module/HelpTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/Module/HelpTest.php b/tests/unit/Module/HelpTest.php index 2c1d31570..1feef26a8 100644 --- a/tests/unit/Module/HelpTest.php +++ b/tests/unit/Module/HelpTest.php @@ -81,8 +81,8 @@ class HelpTest extends \Zotlabs\Tests\Unit\Module\TestCase { $this->get('help'); } - public function test_getting_locale_with_no_topic_should_redirect_to_about_page_for_locale(): void { - $this->expectRedirectTo('help/de/about/about'); + public function test_getting_locale_with_no_topic_should_redirect_to_about_page(): void { + $this->expectRedirectTo('help/about/about'); $this->get('help/de'); } -- cgit v1.2.3