Index: openacs-4/packages/xooauth/tcl/lti-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xooauth/tcl/Attic/lti-procs.tcl,v diff -u -N -r1.1.2.2 -r1.1.2.3 --- openacs-4/packages/xooauth/tcl/lti-procs.tcl 19 Apr 2021 17:07:32 -0000 1.1.2.2 +++ openacs-4/packages/xooauth/tcl/lti-procs.tcl 25 May 2021 14:29:35 -0000 1.1.2.3 @@ -238,6 +238,7 @@ {-height 700} {-sandbox "allow-same-origin allow-scripts allow-forms allow-top-navigation allow-popups allow-popups-to-escape-sandbox allow-downloads"} {-style "min-width:100%;width:100%;min-height:100%;"} + {-auto_launch_p 0} } { # # Set per-call parameters @@ -295,9 +296,14 @@ # trouble. However, we might need a configuration option # to allow opening up in _parent frames. # - set target [expr { ${:launch_presentation_document_target} eq "iframe" - ? "ltiframe${:oauth_nonce}" - : "_blank" }] + if { ${:launch_presentation_document_target} eq "iframe"} { + set iframe_name "ltiframe${:oauth_nonce}" + set target "ltiframe${:oauth_nonce}" + } else { + set iframe_name "" + set target "_blank" + } + set form_name ltiform_${:oauth_nonce} set wrapper_id ltiLaunchFormSubmitArea_${:oauth_nonce} @@ -331,6 +337,13 @@ } + # auto launch + if {$auto_launch_p} { + template::add_body_handler \ + -event onload \ + -script [subst -nocommands {document.getElementById('$form_name').submit();}] + } + set html [$lti asHTML] $lti delete @@ -339,7 +352,7 @@ set html "" } - return [list HTML $html form_name $form_name] + return [list HTML $html form_name $form_name iframe_name $iframe_name] } }