Index: lams_central/web/includes/javascript/dialog.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/includes/javascript/dialog.js,v diff -u -r1.1.2.16 -r1.1.2.17 --- lams_central/web/includes/javascript/dialog.js 5 Nov 2016 11:59:01 -0000 1.1.2.16 +++ lams_central/web/includes/javascript/dialog.js 8 Nov 2016 12:50:38 -0000 1.1.2.17 @@ -250,4 +250,36 @@ */ function moveDialogToTop(id) { // $('#' + id).dialog('moveToTop'); +} + + +//used by both main.jsp and /lti/addlesson.jsp pages +function showAuthoringDialog(learningDesignID){ + showDialog('dialogAuthoring', { + 'height' : Math.max(300, $(window).height() - 30), + 'width' : Math.max(600, Math.min(1280, $(window).width() - 60)), + 'title' : LABELS.AUTHORING_TITLE, + 'beforeClose' : function(){ + // if LD was modified, ask the user if he really wants to exit + var innerLib = $('iframe', this)[0].contentWindow.GeneralLib, + // no innerLib means that an exception occured in Authoring + // and the interface is not usable anyway + canClose = !innerLib || innerLib.canClose() || confirm(LABELS.NAVIGATE_AWAY_CONFIRM); + if (canClose) { + $('iframe', this).attr('src', null); + } else { + return false; + } + }, + 'open' : function() { + var url = LAMS_URL + 'authoring/author.do?method=openAuthoring'; + + if (learningDesignID) { + url += '&learningDesignID=' + learningDesignID; + } + + // load contents after opening the dialog + $('iframe', this).attr('src', url); + } + }, true); } \ No newline at end of file