Index: lams_central/web/authoring/authoring.jsp =================================================================== diff -u -ref32c5d5a859467fe2a98b31251041d4e0c0582c -r0549136389d906a0aa8837ffc15f8d57bc45d5b6 --- lams_central/web/authoring/authoring.jsp (.../authoring.jsp) (revision ef32c5d5a859467fe2a98b31251041d4e0c0582c) +++ lams_central/web/authoring/authoring.jsp (.../authoring.jsp) (revision 0549136389d906a0aa8837ffc15f8d57bc45d5b6) @@ -143,6 +143,9 @@ TEMPLATES : decoderDiv.html('').text(), LIVE_EDIT_SAVE : decoderDiv.html('').text(), + + NAVIGATE_AWAY_CONFIRM : decoderDiv.html('').text(), + // HandlerLib @@ -277,6 +280,7 @@ canSetReadOnly = ${canSetReadOnly}, isReadOnlyMode = false, activitiesOnlySelectable = false, + isLtiContentSelection = ${param.ltiContentSelection eq 'true'}, initContentFolderID = '${contentFolderID}', initLearningDesignID = '${param.learningDesignID}', initAccess = ${access}, Index: lams_central/web/includes/javascript/authoring/authoringGeneral.js =================================================================== diff -u -r507491f25e30e20b4f09c7ad059fb29ee7318673 -r0549136389d906a0aa8837ffc15f8d57bc45d5b6 --- lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision 507491f25e30e20b4f09c7ad059fb29ee7318673) +++ lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision 0549136389d906a0aa8837ffc15f8d57bc45d5b6) @@ -8,6 +8,23 @@ */ $(document).ready(function() { GeneralInitLib.initAll(); + + // we display authoring in separate window if LAMS acts as a LTI 1.3 Tool + if (isLtiContentSelection) { + window.onbeforeunload = function(e) { + if (window.opener && typeof window.opener.refreshSeqList === 'function') { + window.opener.refreshSeqList(); + } + + if (!GeneralLib.canClose()) { + e.preventDefault(); + e.returnValue = LABELS.NAVIGATE_AWAY_CONFIRM; + return LABELS.NAVIGATE_AWAY_CONFIRM; + } + + delete e['returnValue']; + } + } }); Index: lams_central/web/includes/javascript/learning-design-treeview.js =================================================================== diff -u -rb4dd2f1d602d62bc4c65971ad9711d48c3a771b9 -r0549136389d906a0aa8837ffc15f8d57bc45d5b6 --- lams_central/web/includes/javascript/learning-design-treeview.js (.../learning-design-treeview.js) (revision b4dd2f1d602d62bc4c65971ad9711d48c3a771b9) +++ lams_central/web/includes/javascript/learning-design-treeview.js (.../learning-design-treeview.js) (revision 0549136389d906a0aa8837ffc15f8d57bc45d5b6) @@ -10,6 +10,7 @@ ldTree : null, // can be i18n LABEL_RUN_SEQUENCES_FOLDER : 'Run sequences', + FOLDER_CONTENTS_FETCH_URL = LAMS_URL + 'home/getFolderContents.do', /** @@ -57,7 +58,7 @@ result = []; $.ajax({ - url : LAMS_URL + 'home/getFolderContents.do', + url : FOLDER_CONTENTS_FETCH_URL, data : { 'folderID' : folderID, 'allowInvalidDesigns' : allowInvalidDesigns