]> BookStack Code Mirror - hacks/commitdiff
Re-tested and updated iframe hack
authorDan Brown <redacted>
Mon, 22 Apr 2024 16:11:27 +0000 (17:11 +0100)
committerDan Brown <redacted>
Mon, 22 Apr 2024 16:11:27 +0000 (17:11 +0100)
content/iframe-specific-tweaks/index.md
content/iframe-specific-tweaks/layouts/parts/base-body-start.blade.php

index 2072a6fb67be6e8de98b2fa6b1f0450cd71f6008..c5527d98e5c0cba6acb9314b13c977206d7328b9 100644 (file)
@@ -2,8 +2,8 @@
 title = "IFrame Specific Tweaks"
 author = "@vincent @ssddanbrown"
 date = 2023-03-20T00:00:00Z
-updated = 2023-03-27T00:00:00Z
-tested = "v23.02.2"
+updated = 2024-04-22T00:00:00Z
+tested = "v24.02.3"
 +++
 
 This hack will add custom styles & scripts, hiding many parts of the interface while adding additional light/dark mode control,
@@ -13,8 +13,8 @@ This can be useful if you use BookStack as a knowledge base, and you want to int
 
 #### Considerations
 
-- The forced dark/light mode control works via JavaScript, so will not run where a user has
-JavaScript disabled although this is relatively rare.
+- The forced dark/light mode control works via JavaScript, so will not run where a user has JavaScript disabled although this is relatively rare.
+- This specific example will only affect the loaded page view, not subsequent clicks to other parts of the application within the iframe.
 
 #### Usage
 
index ad640f9a3f321d00c27a2b12823cb630a6b50067..a9d8c7cbf9e3ee00a30c8445a5af8679c2d3eee9 100644 (file)
@@ -25,7 +25,7 @@
     </style>
 
     <!-- Add a script to control dark-mode via JavaScript -->
-    <!-- if there's also a 'theme' query paramter -->
+    <!-- if there's also a 'theme' query parameter -->
     @if(request()->query('theme'))
         <script nonce="{{ $cspNonce }}">
             // Use JavaScript to toggle the 'dark-mode' class on the HTML element to enable/disable
@@ -33,4 +33,4 @@
             document.documentElement.classList.toggle('dark-mode', {{ request()->query('theme') === 'dark' ? 'true' : 'false' }});
         </script>
     @endif
-@endif
\ No newline at end of file
+@endif