[TikiWiki-commits] [Git][tikiwiki/tiki][27.x] [FIX] cookies: Update modal mode cookie consent for bootstrap 5

"Jonny Bradley \(@jonnybradley\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <69badb4146186_3b18d21010063@gitlab-sidekiq-low-urgency-cpu-bound-v2-8944c9df9-jbxll.mail>

Jonny Bradley pushed to branch 27.x at Tiki Wiki CMS Groupware / Tiki


Commits:
97279be6 by Jonny Bradley at 2026-03-18T16:43:24+00:00
[FIX] cookies: Update modal mode cookie consent for bootstrap 5
---
* [FIX] cookies: Update modal mode cookie consent for bootstrap 5 and to evade browser "shields"
Not relevant for 27+ as the code is comepletely different now

See merge request tikiwiki/tiki!9785

- - - - -


1 changed file:

- templates/cookie_consent.tpl


Changes:

=====================================
templates/cookie_consent.tpl
=====================================
@@ -1,13 +1,7 @@
 {strip}
     {if $prefs.cookie_consent_mode eq 'dialog'}
-        <div class="modal" tabindex="-1" role="dialog" id="{$prefs.cookie_consent_dom_id}">
-            <div class="modal-dialog" role="document">
-                <div class="modal-content">
-                    <div class="modal-header">
-                        <h5 class="modal-title">{tr}Cookie Consent{/tr}</h5>
-                    </div>
-                    <div class="modal-body">
-            {else}
+        <div class="modal-body" id="{$prefs.cookie_consent_dom_id}">
+    {else}
         <div id="{$prefs.cookie_consent_dom_id}" class="alert alert-primary col-sm-8 mx-auto" role="alert"
             {if $prefs.javascript_enabled eq 'y' and not empty($prefs.cookie_consent_mode)}
                 style="display:none;" class="{$prefs.cookie_consent_mode}"
@@ -40,9 +34,6 @@
                 </div>
             </div>
         </form>
-    {if $prefs.cookie_consent_mode eq 'dialog'}
-        </div></div></div>
-    {/if}
     </div>
     {jq}
         function setConsentCookies() {
@@ -58,6 +49,7 @@
                 }
             }
             $(document).trigger("cookies.consent.agree");
+            {{if $prefs.cookie_consent_mode eq 'dialog'}$.closeModal();{/if}}
         }
         $("#cookie_consent_button").on("click", function(){
             if ($("input[name=cookie_consent_checkbox]:checked").length || $("input[name=cookie_consent_checkbox]:hidden").val() || jqueryTiki.cookie_consent_analytics) {
@@ -91,7 +83,19 @@
         {/jq}
     {elseif $prefs.cookie_consent_mode eq 'dialog'}
         {jq}
-            setTimeout(function () {$("#{{$prefs.cookie_consent_dom_id}}").modal({{if $prefs.cookie_consent_disable neq 'y'}}{backdrop: "static",keyboard:false,}{{/if}});}, 500);
+            setTimeout(function () {
+                $.openModal(
+                    {
+                        {{if $prefs.cookie_consent_disable neq 'y'}}backdrop: "static",
+                        keyboard:false,{{/if}}
+                        title: "{tr}Cookie Consent{/tr}",
+                        open: function () {
+                            $(this).find(".modal-body").replaceWith($("#{{$prefs.cookie_consent_dom_id}}").removeAttr("id"));
+                            $(this).find(".modal-footer").empty().hide()
+                        }
+                    }
+                );
+            }, 500);
         {/jq}
     {/if}
 {/strip}



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/97279be60a5fed4de0132689cf4f0e8723da4d9f

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/97279be60a5fed4de0132689cf4f0e8723da4d9f
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.