Index: openacs-4/packages/xotcl-core/tcl/03-doc-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/03-doc-procs.tcl,v diff -u -r1.22.2.2 -r1.22.2.3 --- openacs-4/packages/xotcl-core/tcl/03-doc-procs.tcl 6 Sep 2019 13:50:29 -0000 1.22.2.2 +++ openacs-4/packages/xotcl-core/tcl/03-doc-procs.tcl 21 Nov 2019 09:09:08 -0000 1.22.2.3 @@ -121,36 +121,30 @@ # it multiple times). # if {$::__form_id eq "1"} { - # - # jquery is just needed for the used ajax call - # - template::head::add_javascript -src //code.jquery.com/jquery-1.12.4.min.js - security::csp::require script-src code.jquery.com template::add_body_script -script { function ajax_submit(form) { - //console.log(form); - $.ajax({ - type: "POST", - url: "/xotcl/admin/toggle-debug", - data: $(form).serialize(), - success: function(msg) {}, - error: function(){alert("failure");} - }); + var xhr = new XMLHttpRequest(); + xhr.open('POST', '/xotcl/admin/toggle-debug', true); + xhr.onreadystatechange = function() { + if (this.readyState == 4) { + if (this.status != 200) { + alert('AJAX submit unexpected response: ' + this.status); + } + } + } + xhr.send(new FormData(form)); }; } } # - # Add the required js and CSS. We use here bootstrap + titatoggle. + # Add the required js and CSS. We use here bootstrap + titatoggle, + # and assume, we have bootstrap3 installed # - template::head::add_css -href https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css - template::head::add_javascript -src https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js -order 1 + #template::head::add_css -href urn:ad:css:bootstrap3 + #template::head::add_javascript -src urn:ad:js:bootstrap3 - security::csp::require style-src maxcdn.bootstrapcdn.com - security::csp::require script-src maxcdn.bootstrapcdn.com - security::csp::require font-src maxcdn.bootstrapcdn.com - template::head::add_css -href "/resources/xotcl-core/titatoggle/titatoggle-dist.css" # # Return an HTML snippet with a form and the computed form-ID