Index: openacs-4/packages/xowiki/tcl/bootstrap-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/bootstrap-procs.tcl,v diff -u -N -r1.11.2.24 -r1.11.2.25 --- openacs-4/packages/xowiki/tcl/bootstrap-procs.tcl 3 Apr 2022 14:42:50 -0000 1.11.2.24 +++ openacs-4/packages/xowiki/tcl/bootstrap-procs.tcl 13 Apr 2022 16:13:14 -0000 1.11.2.25 @@ -28,7 +28,7 @@ {autorender false} {menubar} {containerClass "container-fluid px-0"} - {navbarClass "navbar navbar-default navbar-static-top mx-2 p-0"} + {navbarClass "navbar navbar-expand-lg navbar-default navbar-static-top mx-2 p-0"} } BootstrapNavbar instproc init {} { @@ -45,7 +45,7 @@ # # Render the pull down menus # - html::div -class [:containerClass] { + html::div -class ${:containerClass} { set rightMenuEntries {} foreach entry [:children] { if {[$entry istype ::xowiki::BootstrapNavbarDropdownMenu]} { @@ -85,18 +85,23 @@ html::ul -class "nav navbar-nav px-3" { html::li -class "nav-item dropdown" { set class "nav-link dropdown-toggle" - if {[:brand]} {lappend class "navbar-brand"} - html::a -href "\#" -class $class -data-toggle "dropdown" { - html::t [:text] - html::b -class "caret" + if {${:brand}} { + lappend class "navbar-brand" } + set data_attribute [expr {[::xowiki::CSS toolkit] eq "bootstrap5" ? "data-bs" : "data"}] + html::a -href "\#" -class $class -$data_attribute-toggle "dropdown" { + html::t ${:text} + if {[xowiki::CSS toolkit] eq "bootstrap"} { + html::b -class "caret" + } + } html::ul -class "dropdown-menu" { foreach dropdownmenuitem [:children] { if {[$dropdownmenuitem set group] ne "" && [$dropdownmenuitem set group] ne $group } { if {$group ne " "} { - html::li -class "divider" + html::li -class "divider dropdown-divider" } set group [$dropdownmenuitem set group] } @@ -119,7 +124,8 @@ BootstrapNavbarDropdownMenuItem ad_instproc render {} {doku} { html::li -class [expr {${:href} eq "" ? "nav-item disabled": "nav-item"}] { - html::a [:get_attributes target href title id] { + set :CSSclass dropdown-item + html::a [:get_attributes target href title id {CSSclass class}] { html::t ${:text} } } @@ -287,7 +293,7 @@ }; } html t [subst { - document.getElementById('[:id]').addEventListener('click', function (event) { + document.getElementById('${:id}').addEventListener('click', function (event) { mode_button_ajax_submit(this.form); }); }] @@ -300,7 +306,7 @@ html::div -class "checkbox ${:CSSclass}" { html::label -class "checkbox-inline" { set checked [expr {${:on} ? {-checked true} : ""}] - html::input -id [:id] -class "debug form-control" -name "debug" -type "checkbox" {*}$checked + html::input -id ${:id} -class "debug form-control" -name "debug" -type "checkbox" {*}$checked html::span -style ${:spanStyle} {html::t ${:text}} html::input -name "modebutton" -type "hidden" -value "${:button}" } @@ -575,8 +581,10 @@ -id $id \ -script "[$line set $__name.onclick];" } - # Default class is from the field definition. To it we - # append the class coming from the line. + # + # The default class is from the field definition. Append to this value + # the class coming from the entry line. + # set CSSclass ${:CSSclass} if {[$line exists $__name.CSSclass]} { set lineCSSclass [$line set $__name.CSSclass] @@ -639,7 +647,7 @@ -id:required -title:required {-subtitle ""} - -body:required + -body:required } { Generic modal dialog wrapper. @param id @@ -695,7 +703,7 @@ } - + ad_proc ::xowiki::bootstrap::modal_dialog_popup_button { -target:required -label:required