Index: lams_central/conf/language/lams/ApplicationResources.properties =================================================================== RCS file: /usr/local/cvsroot/lams_central/conf/language/lams/ApplicationResources.properties,v diff -u -r1.138.2.7 -r1.138.2.8 --- lams_central/conf/language/lams/ApplicationResources.properties 9 Jan 2015 02:37:01 -0000 1.138.2.7 +++ lams_central/conf/language/lams/ApplicationResources.properties 27 May 2015 06:23:54 -0000 1.138.2.8 @@ -456,6 +456,7 @@ authoring.fla.gate.activity.label =STOP authoring.fla.branching.start.suffix =start authoring.fla.branching.end.suffix =end +authoring.fla.activity.dialog.title.suffix = Authoring authoring.fla.remove.activity.confirm =Are you sure you want to remove the whole branching activity? authoring.fla.branching.create.confirm =Transition from this activity already exists.\\nDo you want to create branching here? authoring.fla.transition.to.exists.error =Transition to this activity already exists. @@ -497,6 +498,7 @@ authoring.fla.preview.lesson.default.title =Preview authoring.fla.save.dialog.title =Save sequence authoring.fla.open.dialog.title =Open sequence +authoring.fla.import.dialog.title =Import Learning Design authoring.fla.import.part.dialog.title =Import activities authoring.fla.run.sequences.folder = authoring.fla.arrange.confirm =There are annotations on the canvas.\\n\ Index: lams_central/web/main.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/main.jsp,v diff -u -r1.77.2.11 -r1.77.2.12 --- lams_central/web/main.jsp 20 May 2015 09:03:50 -0000 1.77.2.11 +++ lams_central/web/main.jsp 27 May 2015 06:23:54 -0000 1.77.2.12 @@ -1,4 +1,6 @@ <%@ page contentType="text/html; charset=utf-8" language="java"%> +<%@ page import="org.lamsfoundation.lams.security.JspRedirectStrategy"%> +<%@ page import="org.lamsfoundation.lams.web.util.HttpSessionManager"%> <%@ page import="org.lamsfoundation.lams.util.Configuration"%> <%@ page import="org.lamsfoundation.lams.util.ConfigurationKeys"%> <%@ taglib uri="tags-lams" prefix="lams"%> @@ -7,6 +9,10 @@ <%@ taglib uri="tags-function" prefix="fn"%> <%@ taglib uri="tags-tiles" prefix="tiles" %> +<%-- If you change this file, remember to update the copy made for CNG-21 --%> + +<%JspRedirectStrategy.welcomePageStatusUpdate(request, response);%> +<%HttpSessionManager.getInstance().updateHttpSessionByLogin(request.getSession(),request.getRemoteUser());%> @@ -31,8 +37,9 @@ - + + + + @@ -60,6 +62,8 @@ BRANCHING_START_SUFFIX : '', BRANCHING_END_SUFFIX : '', + + ACTIVITY_DIALOG_TITLE_SUFFIX : '', REMOVE_ACTIVITY_CONFIRM : decoderDiv.html('').text(), @@ -150,6 +154,8 @@ SAVE_DIALOG_TITLE : '', OPEN_DIALOG_TITLE : '', + + IMPORT_DIALOG_TITLE : '', IMPORT_PART_DIALOG_TITLE : '', Index: lams_central/web/css/authoring.css =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/css/authoring.css,v diff -u -r1.30 -r1.30.2.1 --- lams_central/web/css/authoring.css 16 Jul 2014 20:17:06 -0000 1.30 +++ lams_central/web/css/authoring.css 27 May 2015 06:23:54 -0000 1.30.2.1 @@ -14,11 +14,22 @@ font-size: 12px !important; } +/* For jQuery Dialogextend */ +.ui-dialog .ui-dialog-titlebar-buttonpane a { + margin-right: 3px; +} + div.dialogContainer, .ldChoiceDependentCanvasElement, .dialog-no-title .ui-dialog-titlebar { display: none; } +.dialogContainer iframe { + width: 100%; + height: 99%; + border: none; +} + div.dialogTitle { padding: 5px 0px 5px 0px; font-weight: bold; @@ -134,7 +145,6 @@ div#ldStoreDialog div#ldStoreDialogCanvasDiv { overflow: auto; - /* height: 665px; */ } div#ldStoreDialog img#ldScreenshotLoading { @@ -269,7 +279,7 @@ div#toolbar { padding: 3px; - width: 1220px; + width: 1010px; height: 27px; } @@ -327,7 +337,6 @@ div.templateContainer { display: none; - height: 740px; overflow: auto; border: black thin solid; background-color: rgb(219, 230, 252); @@ -408,6 +417,5 @@ #canvas { overflow: auto; - height: 725px; vertical-align: top; } \ No newline at end of file Index: lams_central/web/css/index.css =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/css/index.css,v diff -u -r1.10.2.1 -r1.10.2.2 --- lams_central/web/css/index.css 20 May 2015 09:03:50 -0000 1.10.2.1 +++ lams_central/web/css/index.css 27 May 2015 06:23:54 -0000 1.10.2.2 @@ -28,7 +28,7 @@ .dialogContainer iframe { width: 100%; - height: 100%; + height: 99.5%; border: none; } Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `lams_central/web/includes/javascript/dialog.js'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_central/web/includes/javascript/groupDisplay.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/includes/javascript/groupDisplay.js,v diff -u -r1.37.2.3 -r1.37.2.4 --- lams_central/web/includes/javascript/groupDisplay.js 20 May 2015 09:03:50 -0000 1.37.2.3 +++ lams_central/web/includes/javascript/groupDisplay.js 27 May 2015 06:23:54 -0000 1.37.2.4 @@ -149,68 +149,7 @@ } -/** - * Checks if the dialog is already opened. - * If not, creates a new dialog with the given ID and init parameters. - */ -function showDialog(id, initParams, extraButtons) { - var dialog = $('#' + id); - if (dialog.length > 0) { - // is it open already? - dialog.dialog('moveToTop'); - return; - } - - // create a new dialog by cloning a template - dialog = $('#dialogContainer').clone(); - dialog.attr('id', id); - - // use initParams to overwrite default behaviour of the newly created dialog - dialog.dialog($.extend({ - 'autoOpen' : true, - 'modal' : false, - 'draggable' : true, - 'resizable' : false, - 'hide' : 'fold', - 'beforeClose' : function(){ - $('iframe', this).attr('src', null); - }, - 'close' : function() { - // completely delete the dialog - $(this).remove(); - } - }, initParams)); - - if (extraButtons) { - dialog.dialogExtend({ - "closable" : true, - "maximizable" : true, - "minimizable" : true, - "collapsable" : true, - "dblclick" : "collapse", - "minimizeLocation" : "right", - "icons" : { - "close" : "ui-icon-close", - "maximize" : "ui-icon-arrow-4-diag", - "minimize" : "ui-icon-minus", - "collapse" : "ui-icon-triangle-1-s", - "restore" : "ui-icon-newwin" - } - }); - } - - return dialog; -} - -/** - * Focuses on the dialog. Called from within the contained iframe. - */ -function moveDialogToTop(id) { - $('#' + id).dialog('moveToTop'); -} - - function showMonitorLessonDialog(lessonID) { var id = "dialogMonitorLesson" + lessonID, dialog = showDialog(id, { @@ -441,6 +380,7 @@ showDialog('dialogFlashlessAuthoring', { 'height' : 865, 'width' : 1280, + 'resizable' : true, 'title' : 'Authoring', 'open' : function() { var orgID = $(this).dialog('option', 'orgID'); Index: lams_central/web/includes/javascript/authoring/authoringActivity.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/includes/javascript/authoring/authoringActivity.js,v diff -u -r1.38.2.5 -r1.38.2.6 --- lams_central/web/includes/javascript/authoring/authoringActivity.js 31 Oct 2014 12:54:32 -0000 1.38.2.5 +++ lams_central/web/includes/javascript/authoring/authoringActivity.js 27 May 2015 06:23:54 -0000 1.38.2.6 @@ -1166,9 +1166,23 @@ } if (activity.authorURL) { - window.open(activity.authorURL, 'activityAuthoring' + activity.id, - "HEIGHT=800,WIDTH=1024,resizable=yes,scrollbars=yes,status=false," + - "menubar=no,toolbar=no"); + showDialog("dialogActivity" + activity.toolContentID, { + 'height' : 800, + 'width' : 1024, + 'resizable' : true, + 'title' : activity.title + LABELS.ACTIVITY_DIALOG_TITLE_SUFFIX, + 'open' : function() { + var dialog = $(this); + // load contents after opening the dialog + $('iframe', dialog).attr('src', activity.authorURL).load(function(){ + // override the close function so it works with the dialog, not window + this.contentWindow.closeWindow = function(){ + dialog.dialog('close'); + } + }); + } + }, true); + GeneralLib.setModified(true); } }, Index: lams_central/web/includes/javascript/authoring/authoringGeneral.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/includes/javascript/authoring/authoringGeneral.js,v diff -u -r1.51.2.10 -r1.51.2.11 --- lams_central/web/includes/javascript/authoring/authoringGeneral.js 4 May 2015 13:03:54 -0000 1.51.2.10 +++ lams_central/web/includes/javascript/authoring/authoringGeneral.js 27 May 2015 06:23:54 -0000 1.51.2.11 @@ -1965,7 +1965,14 @@ if (!paper) { return; } - + + var windowHeight = $(window).height(); + // height of window minus toolbar, padding... + $('.templateContainer').height(windowHeight - 81); + $('#canvas').height(windowHeight - 75) + // width of window minus templates on the left; minimum is toolbar width so it does not collapse + .width(Math.max($('#toolbar').width() - 160, $(window).width() - 170)); + if (!width || !height) { var width = 0, height = 0; @@ -1987,8 +1994,6 @@ height = Math.max(height + (isReadOnlyMode ? 20 : 50), canvas.height()) - 20; paper.setSize(width, height); - $('#templateContainer').height($('#ldDescriptionDiv').height() - + $('#canvas').height() - 10); if (!isReadOnlyMode){ if (layout.bin) { Index: lams_central/web/includes/javascript/authoring/authoringMenu.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/includes/javascript/authoring/authoringMenu.js,v diff -u -r1.34.2.1 -r1.34.2.2 --- lams_central/web/includes/javascript/authoring/authoringMenu.js 23 Oct 2014 13:18:12 -0000 1.34.2.1 +++ lams_central/web/includes/javascript/authoring/authoringMenu.js 27 May 2015 06:23:54 -0000 1.34.2.2 @@ -585,19 +585,33 @@ * Opens a pop up for importing LD. Loads the imported LD to canvas. */ importLearningDesign : function(){ - var importWindow = window.open(LAMS_URL + 'authoring/importToolContent.do?method=import','Import', - 'width=800,height=298,resize=yes,status=yes,scrollbar=no,menubar=no,toolbar=no'), + var dialog = showDialog("dialogImportLearningDesign", { + 'height' : 315, + 'width' : 850, + 'title' : LABELS.IMPORT_DIALOG_TITLE, + 'open' : function() { + var dialog = $(this); + // load contents after opening the dialog + $('iframe', dialog).attr('src', LAMS_URL + 'authoring/importToolContent.do?method=import').load(function(){ + // override the close function so it works with the dialog, not window + this.contentWindow.closeWin = function(){ + dialog.dialog('close'); + } + }); + }, + 'close' : function(){ + // stop checking in LD was imported + clearInterval(loadCheckInterval); + // completely delete the dialog + $(this).remove(); + } + }), currentLearningDesignID = null, regEx = /learningDesignID=(\d+)/g, // since window.onload does not really work after submitting a form inside the window, // this trick checks periodically for changes loadCheckInterval = setInterval(function(){ - if (!importWindow){ - // window was closed - clearInterval(loadCheckInterval); - return; - } - var body = $('body', importWindow.document).html(), + var body = $('body', $('iframe', dialog).contents()).html(), match = regEx.exec(body); // check if ID was found and it's not the same as previously set if (match && match[1] != currentLearningDesignID) { @@ -816,7 +830,7 @@ toggleDescriptionDiv: function() { $('#ldDescriptionDetails').slideToggle(function(){ $('#ldDescriptionHideTip').text($(this).is(':visible') ? '▲' : '▼'); - $('#templateContainer').height($('#ldDescriptionDiv').height() + $('#canvas').height() - 10); + $('.templateContainer').height($('#ldDescriptionDiv').height() + $('#canvas').height() - 10); }); }