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.23 -r1.11.2.24 --- openacs-4/packages/xowiki/tcl/bootstrap-procs.tcl 1 Apr 2022 13:47:51 -0000 1.11.2.23 +++ openacs-4/packages/xowiki/tcl/bootstrap-procs.tcl 3 Apr 2022 14:42:50 -0000 1.11.2.24 @@ -294,7 +294,7 @@ } } - BootstrapNavbarModeButton ad_instproc render {} {doku} { + BootstrapNavbarModeButton instproc render {} { html::li { html::form -class "form" -method "POST" -action ${:href} { html::div -class "checkbox ${:CSSclass}" { @@ -318,7 +318,7 @@ {label:required} } - BootstrapCollapseButton instproc init {} { + BootstrapCollapseButton instproc render {} { switch [::xowiki::CSS toolkit] { "bootstrap" { template::add_script -src urn:ad:js:bootstrap3 @@ -599,6 +599,132 @@ Class create BootstrapTableRenderer::BulkAction -superclass TABLE::BulkAction } +namespace eval ::xowiki::bootstrap { + + ad_proc ::xowiki::bootstrap::card { + -title:required + -body:required + } { + } { + return [ns_trim -delimiter | [subst { + |
+ |
$title
+ |
$body
+ |
+ }]] + } + + ad_proc ::xowiki::bootstrap::icon { + -name:required + -style + -CSSclass + } { + } { + # + set name [xowiki::CSS class $name] + set styleAtt [expr {[info exists style] ? "style='$style'" : ""}] + set CSSclass [expr {[info exists CSSclass] ? " $CSSclass" : ""}] + switch [::xowiki::CSS toolkit] { + "bootstrap" { + return [subst {}] + } + default { + return [subst {}] + } + } + } + + + ad_proc ::xowiki::bootstrap::modal_dialog { + -id:required + -title:required + {-subtitle ""} + -body:required + } { + Generic modal dialog wrapper. + @param id + @param title HTML markup for the modal title (can contain tags) + @param subtitle HTML markup for the modal subtitle (can contain tags) + @param body HTML markup for the modal body (can contain tags) + + @return HTML markup + } { + if {$subtitle ne ""} { + set subtitle [subst {}] + } + if {[::xowiki::CSS toolkit] eq "bootstrap5"} { + set data_attribute "data-bs" + ::security::csp::require img-src data: + set close_button_label "" + set before_close "" + set after_close "" + } else { + set data_attribute "data" + set close_button_label {} + set before_close "" + set after_close "" + } + + return [ns_trim -delimiter | [subst { + | + }]] + } + + + + ad_proc ::xowiki::bootstrap::modal_dialog_popup_button { + -target:required + -label:required + {-title ""} + {-CSSclass ""} + } { + Generic modal dialog wrapper. + @param target ID of the target modal dialog + @param title title for the anchor (help popup), plain text + @param label HTML markup for the modal popup label (can contain tags) + + @return HTML markup + } { + if {[::xowiki::CSS toolkit] eq "bootstrap5"} { + set data_attribute "data-bs" + } else { + set data_attribute "data" + } + return [ns_trim -delimiter | [subst { + | + | $label + | + }]] + } +} + + + ::xo::library source_dependent #