diff --git a/basiclti/basiclti-docs/resources/docs/sakai-api-test/resize.htm b/basiclti/basiclti-docs/resources/docs/sakai-api-test/resize.htm index 26633f3d192d..3b0a98cac68c 100644 --- a/basiclti/basiclti-docs/resources/docs/sakai-api-test/resize.htm +++ b/basiclti/basiclti-docs/resources/docs/sakai-api-test/resize.htm @@ -22,6 +22,14 @@

Testing lti.frameResize

height: num }), "*"); } +function ref() { + console.log("Refresh"); + parent.postMessage(JSON.stringify({ + subject: "lti.pageRefresh" + }), "*"); +}
+
+ diff --git a/basiclti/basiclti-portlet/src/java/org/sakaiproject/portlets/IMSBLTIPortlet.java b/basiclti/basiclti-portlet/src/java/org/sakaiproject/portlets/IMSBLTIPortlet.java index d62c09d9e50e..2fa5453d9654 100644 --- a/basiclti/basiclti-portlet/src/java/org/sakaiproject/portlets/IMSBLTIPortlet.java +++ b/basiclti/basiclti-portlet/src/java/org/sakaiproject/portlets/IMSBLTIPortlet.java @@ -282,11 +282,14 @@ public void doView(RenderRequest request, RenderResponse response) text.append(" if ( message.subject == 'lti.frameResize' ) {\n"); text.append(" var height = message.height;\n"); text.append(" document.getElementById(idval).height = height;\n"); - text.append(" console.log('Reveived lti.frameResize height='+height);\n"); + text.append(" window.console && console.log('Received lti.frameResize height='+height);\n"); + text.append(" }\n"); + text.append(" else if ( message.subject == 'lti.pageRefresh' ) {\n"); + text.append(" location.reload(true);\n"); text.append(" }\n"); text.append(" } catch (error) {\n"); - text.append(" console.log('lti.frameResize of '+idval+' failed height='+height);\n"); - text.append(" console.log(e.data);\n"); + text.append(" window.console && console.log('lti.frameResize of '+idval+' failed height='+height);\n"); + text.append(" window.console && console.log(e.data);\n"); text.append(" }\n"); text.append("});\n"); text.append("\n"); diff --git a/lessonbuilder/tool/src/webapp/templates/ShowItem.html b/lessonbuilder/tool/src/webapp/templates/ShowItem.html index 035b501f49bb..b948c0d82690 100644 --- a/lessonbuilder/tool/src/webapp/templates/ShowItem.html +++ b/lessonbuilder/tool/src/webapp/templates/ShowItem.html @@ -198,6 +198,9 @@ document.getElementById(idval).height = height; console.log('Reveived lti.frameResize height='+height); } + else if ( message.subject == 'lti.pageRefresh' ) { + location.reload(true); + } } catch (error) { console.log('lti.frameResize of '+idval+' failed height='+height); console.log(e.data);