Index: lams_central/web/includes/javascript/dialog.js =================================================================== diff -u -r1ea4aaf03ba7f6c4fa2719d88983efc63f100d80 -r34350886b13d64af5e221ee22f3fc14ff251139b --- lams_central/web/includes/javascript/dialog.js (.../dialog.js) (revision 1ea4aaf03ba7f6c4fa2719d88983efc63f100d80) +++ lams_central/web/includes/javascript/dialog.js (.../dialog.js) (revision 34350886b13d64af5e221ee22f3fc14ff251139b) @@ -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 Index: lams_central/web/includes/javascript/main.js =================================================================== diff -u -r1ea4aaf03ba7f6c4fa2719d88983efc63f100d80 -r34350886b13d64af5e221ee22f3fc14ff251139b --- lams_central/web/includes/javascript/main.js (.../main.js) (revision 1ea4aaf03ba7f6c4fa2719d88983efc63f100d80) +++ lams_central/web/includes/javascript/main.js (.../main.js) (revision 34350886b13d64af5e221ee22f3fc14ff251139b) @@ -649,38 +649,6 @@ } -//used in main.jsp and /lti/addlesson.jsp -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); -} - - function removeLesson(lessonID) { if (confirm(LABELS.REMOVE_LESSON_CONFIRM1)) { if (confirm(LABELS.REMOVE_LESSON_CONFIRM2)) { Index: lams_central/web/lti/addLesson.jsp =================================================================== diff -u -ra54189e50c13e0f6856534766d79189c576011a4 -r34350886b13d64af5e221ee22f3fc14ff251139b --- lams_central/web/lti/addLesson.jsp (.../addLesson.jsp) (revision a54189e50c13e0f6856534766d79189c576011a4) +++ lams_central/web/lti/addLesson.jsp (.../addLesson.jsp) (revision 34350886b13d64af5e221ee22f3fc14ff251139b) @@ -49,13 +49,12 @@ - -