- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::xowiki::BootstrapNavbarModeButton
::xowiki::BootstrapNavbarModeButton create ... \
[ -CSSclass (default "checkbox-slider--b-flat") ] \
[ -button button ] \
[ -href (default "#") ] \
[ -on:boolean (default "false") ] \
[ -spanStyle (default "padding-left: 6px; padding-right: 6px;") ]
Class Relations
::xo::tdom::Class create ::xowiki::BootstrapNavbarModeButton \ -superclass ::xowiki::MenuItemMethods (to be applied on instances)
CSSclass (setter)
button (setter)
href (setter)
js (scripted)
# # In the current implementation, the page refreshes itself after # successful mode change. This could be made configurable. # html::script -type "text/javascript" -nonce [security::csp::nonce] { html::t { function mode_button_ajax_submit(form) { $.ajax({ type: "POST", url: $(form).attr('action'), data: $(form).serialize(), success: function(msg) { location.reload(true); }, error: function(){alert("failure");} }); }; } html t [subst { document.getElementById('${:id}').addEventListener('click', function (event) { mode_button_ajax_submit(this.form); }); }] }on (setter)
render (scripted)
html::li { html::form -class "form" -method "POST" -action ${:href} { 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::span -style ${:spanStyle} {html::t ${:text}} html::input -name "modebutton" -type "hidden" -value "${:button}" } } } :js }spanStyle (setter)
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables