Index: lams_central/web/includes/javascript/authoring/authoringActivity.js =================================================================== diff -u -r248e47a1f8714d3e57be1e4dc12b4fae4f396cb3 -r1a329783c6ff3378add4b1279182e37698058230 --- lams_central/web/includes/javascript/authoring/authoringActivity.js (.../authoringActivity.js) (revision 248e47a1f8714d3e57be1e4dc12b4fae4f396cb3) +++ lams_central/web/includes/javascript/authoring/authoringActivity.js (.../authoringActivity.js) (revision 1a329783c6ff3378add4b1279182e37698058230) @@ -957,7 +957,7 @@ && toActivity instanceof ActivityDefs.BranchingEdgeActivity && fromActivity.isStart && !toActivity.isStart && fromActivity.branchingActivity != toActivity.branchingActivity) { - alert(LABELS.CROSS_BRANCHING_ERROR); + layout.infoDialog.data('show')(LABELS.CROSS_BRANCHING_ERROR); return; } @@ -971,15 +971,15 @@ // no transitions to/from support activities if (toActivity instanceof ActivityDefs.FloatingActivity || fromActivity instanceof ActivityDefs.FloatingActivity){ - alert(LABELS.SUPPORT_TRANSITION_ERROR); + layout.infoDialog.data('show')(LABELS.SUPPORT_TRANSITION_ERROR); return; } // only converge points are allowed to have few inbound transitions if (!redraw && toActivity.transitions.to.length > 0 && !(toActivity instanceof ActivityDefs.BranchingEdgeActivity && !toActivity.isStart)) { - alert(LABELS.TRANSITION_TO_EXISTS_ERROR); + layout.infoDialog.data('show')(LABELS.TRANSITION_TO_EXISTS_ERROR); return; } @@ -995,7 +995,7 @@ } if (toActivity == activity) { - alert(LABELS.CIRCULAR_SEQUENCE_ERROR); + layout.infoDialog.data('show')(LABELS.CIRCULAR_SEQUENCE_ERROR); return; } } while (activity); @@ -1103,7 +1103,7 @@ break; } // this branching's end does not match with own start, error - alert(LABELS.CROSS_BRANCHING_ERROR); + layout.infoDialog.data('show')(LABELS.CROSS_BRANCHING_ERROR); // remove the just added transition ActivityLib.removeTransition(transition); // tell the outer iteration loop to quit @@ -1148,7 +1148,7 @@ // put the activity back activity.parentActivity.childActivities = existingChildActivities; - alert(LABELS.LIVEEDIT_READONLY_MOVE_PARENT_ERROR); + layout.infoDialog.data('show')(LABELS.LIVEEDIT_READONLY_MOVE_PARENT_ERROR); return false; } @@ -1176,11 +1176,11 @@ if (activity instanceof ActivityDefs.GateActivity || activity instanceof ActivityDefs.GroupingActivity || activity instanceof ActivityDefs.BranchingEdgeActivity){ - alert(LABELS.ACTIVITY_IN_CONTAINER_ERROR); + layout.infoDialog.data('show')(LABELS.ACTIVITY_IN_CONTAINER_ERROR); return false; } if (activity.readOnly || container.readOnly) { - alert(LABELS.LIVEEDIT_READONLY_ACTIVITY_ERROR); + layout.infoDialog.data('show')(LABELS.LIVEEDIT_READONLY_ACTIVITY_ERROR); return false; } Index: lams_central/web/includes/javascript/authoring/authoringGeneral.js =================================================================== diff -u -r85a797cf037ac3f737eafa630456cd789dced1f0 -r1a329783c6ff3378add4b1279182e37698058230 --- lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision 85a797cf037ac3f737eafa630456cd789dced1f0) +++ lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision 1a329783c6ff3378add4b1279182e37698058230) @@ -990,8 +990,13 @@ 'of' : '#canvas' }, 'show' : function(html){ - $('.modal-body', layout.infoDialog).html(html); - layout.infoDialog.modal('show'); + var body = $('.modal-body', layout.infoDialog); + if (layout.infoDialog.hasClass('in')) { + body.html(body.html() + '

' + html); + } else { + body.html(html); + layout.infoDialog.modal('show'); + } } } }).click(function(){ @@ -1604,7 +1609,7 @@ success : function(response) { if (!response) { if (!isReadOnlyMode) { - alert(LABELS.SEQUENCE_LOAD_ERROR); + layout.infoDialog.data('show')(LABELS.SEQUENCE_LOAD_ERROR); } return; } @@ -2177,7 +2182,7 @@ if (weightsSum != null && weightsSum != 100) { if (displayErrors) { - alert(LABELS.WEIGHTS_SUM_ERROR); + layout.infoDialog.data('show')(LABELS.WEIGHTS_SUM_ERROR); } return false; } @@ -2249,7 +2254,7 @@ // the branch is shared between two branchings // it should have been detected when adding a transition if (displayErrors) { - alert(LABELS.CROSS_BRANCHING_ERROR); + layout.infoDialog.data('show')(LABELS.CROSS_BRANCHING_ERROR); } return false; } @@ -2267,7 +2272,7 @@ if (error) { if (displayErrors) { - alert(branchingActivity.title + LABELS.END_MATCH_ERROR); + layout.infoDialog.data('show')(branchingActivity.title + LABELS.END_MATCH_ERROR); } return false; } @@ -2524,7 +2529,7 @@ if (error) { if (displayErrors) { - alert(error); + layout.infoDialog.data('show')(error); } return false; } @@ -2669,7 +2674,7 @@ // check if there were any validation errors if (layout.ld.invalid) { - var message = LABELS.SEQUENCE_VALIDATION_ISSUES + '\n'; + var message = LABELS.SEQUENCE_VALIDATION_ISSUES + '
'; $.each(response.validation, function() { var uiid = this.UIID, title = ''; @@ -2681,10 +2686,10 @@ } }); } - message += title + this.message + '\n'; + message += title + this.message + '
'; }); - alert(message); + layout.infoDialog.data('show')(message); } // if save (even partially) was successful @@ -2731,7 +2736,7 @@ // create the updated LD image var svgSaveSuccessful = GeneralLib.saveLearningDesignImage(); if (!svgSaveSuccessful) { - alert(LABELS.SVG_SAVE_ERROR); + layout.infoDialog.data('show')(LABELS.SVG_SAVE_ERROR); return; } @@ -2740,8 +2745,10 @@ // close the Live Edit dialog if (GeneralLib.checkTBLGrouping()) { - alert(LABELS.LIVEEDIT_SAVE_SUCCESSFUL); - window.parent.closeDialog('dialogAuthoring'); + layout.infoDialog.data('show')(LABELS.LIVEEDIT_SAVE_SUCCESSFUL); + layout.infoDialog.one('click', function(){ + window.parent.closeDialog('dialogAuthoring'); + }); } else { layout.infoDialog.data('show')(LABELS.SAVE_SUCCESSFUL_CHECK_GROUPING); } @@ -2754,12 +2761,12 @@ var svgSaveSuccessful = GeneralLib.saveLearningDesignImage(); if (!svgSaveSuccessful) { - alert(LABELS.SVG_SAVE_ERROR); + layout.infoDialog.data('show')(LABELS.SVG_SAVE_ERROR); } if (!layout.ld.invalid) { if (GeneralLib.checkTBLGrouping()) { - alert(LABELS.SAVE_SUCCESSFUL); + layout.infoDialog.data('show')(LABELS.SAVE_SUCCESSFUL); } else { layout.infoDialog.data('show')(LABELS.SAVE_SUCCESSFUL_CHECK_GROUPING); } @@ -2770,7 +2777,7 @@ } }, error : function(){ - alert(LABELS.SEQUENCE_SAVE_ERROR); + layout.infoDialog.data('show')(LABELS.SEQUENCE_SAVE_ERROR); } }); return result; Index: lams_central/web/includes/javascript/authoring/authoringHandler.js =================================================================== diff -u -r784fd323a58e84e5d935014177523105f1e99b84 -r1a329783c6ff3378add4b1279182e37698058230 --- lams_central/web/includes/javascript/authoring/authoringHandler.js (.../authoringHandler.js) (revision 784fd323a58e84e5d935014177523105f1e99b84) +++ lams_central/web/includes/javascript/authoring/authoringHandler.js (.../authoringHandler.js) (revision 1a329783c6ff3378add4b1279182e37698058230) @@ -320,7 +320,7 @@ if (tapLength < HandlerActivityLib.tapTimeout && tapLength > 0) { event.preventDefault(); if (activity.readOnly) { - alert(LABELS.LIVEEDIT_READONLY_ACTIVITY_ERROR); + layout.infoDialog.data('show')(LABELS.LIVEEDIT_READONLY_ACTIVITY_ERROR); } else { ActivityLib.openActivityAuthoring(activity); } @@ -356,16 +356,16 @@ // check if the activity or its parent are read-only if (activity.readOnly) { canRemove = false; - alert(LABELS.LIVEEDIT_REMOVE_ACTIVITY_ERROR); + layout.infoDialog.data('show')(LABELS.LIVEEDIT_REMOVE_ACTIVITY_ERROR); } else if (activity.branchingActivity){ if (activity.branchingActivity.readOnly) { canRemove = false; - alert(LABELS.LIVEEDIT_REMOVE_ACTIVITY_ERROR); + layout.infoDialog.data('show')(LABELS.LIVEEDIT_REMOVE_ACTIVITY_ERROR); } } else if (activity.parentActivity && activity.parentActivity.readOnly){ canRemove = false; - alert(LABELS.LIVEEDIT_REMOVE_PARENT_ERROR); + layout.infoDialog.data('show')(LABELS.LIVEEDIT_REMOVE_PARENT_ERROR); } if (canRemove) { @@ -450,13 +450,13 @@ var canRemove = true; if (container.readOnly) { canRemove = false; - alert(LABELS.LIVEEDIT_REMOVE_ACTIVITY_ERROR); + layout.infoDialog.data('show')(LABELS.LIVEEDIT_REMOVE_ACTIVITY_ERROR); } else if (container.childActivities){ // if any of the child activities is read-only, the parent activity can not be removed $.each(container.childActivities, function(){ if (this.readOnly) { canRemove = false; - alert(LABELS.LIVEEDIT_REMOVE_CHILD_ERROR); + layout.infoDialog.data('show')(LABELS.LIVEEDIT_REMOVE_CHILD_ERROR); return false; } }); @@ -672,7 +672,7 @@ */ drawTransitionStartHandler : function(activity, event, x, y) { if (activity.fromTransition && !(activity instanceof ActivityDefs.BranchingEdgeActivity)) { - alert(LABELS.TRANSITION_FROM_EXISTS_ERROR); + layout.infoDialog.data('show')(LABELS.TRANSITION_FROM_EXISTS_ERROR); } HandlerLib.resetCanvasMode(); @@ -761,7 +761,7 @@ var mouseupHandler = function(event){ if (HandlerLib.isElemenentBinned(event)) { if (transition.toActivity.readOnly || transition.fromActivity.readOnly) { - alert(LABELS.LIVEEDIT_REMOVE_TRANSITION_ERROR); + layout.infoDialog.data('show')(LABELS.LIVEEDIT_REMOVE_TRANSITION_ERROR); // just draw it again in the original place transition.draw(); } else { Index: lams_central/web/includes/javascript/authoring/authoringMenu.js =================================================================== diff -u -r7b42f38a8e33a8823bc93a5e797ab50db4600385 -r1a329783c6ff3378add4b1279182e37698058230 --- lams_central/web/includes/javascript/authoring/authoringMenu.js (.../authoringMenu.js) (revision 7b42f38a8e33a8823bc93a5e797ab50db4600385) +++ lams_central/web/includes/javascript/authoring/authoringMenu.js (.../authoringMenu.js) (revision 1a329783c6ff3378add4b1279182e37698058230) @@ -515,7 +515,7 @@ dataType : 'text', success : function(lessonID) { if (!lessonID) { - alert(LABELS.PREVIEW_ERROR); + layout.infoDialog.data('show')(LABELS.PREVIEW_ERROR); previewButton.button('reset'); return; } @@ -563,7 +563,7 @@ } // only tool activities can be copied (todo?) if (!(activity instanceof ActivityDefs.ToolActivity)) { - alert(LABELS.PASTE_ERROR); + layout.infoDialog.data('show')(LABELS.PASTE_ERROR); return; } Index: lams_central/web/includes/javascript/authoring/authoringProperty.js =================================================================== diff -u -rb97b1cb641605fec844ccd19ca53a0ac5e53e7e3 -r1a329783c6ff3378add4b1279182e37698058230 --- lams_central/web/includes/javascript/authoring/authoringProperty.js (.../authoringProperty.js) (revision b97b1cb641605fec844ccd19ca53a0ac5e53e7e3) +++ lams_central/web/includes/javascript/authoring/authoringProperty.js (.../authoringProperty.js) (revision 1a329783c6ff3378add4b1279182e37698058230) @@ -72,7 +72,7 @@ branchingActivity.title = newTitle; redrawNeeded = true; } else { - alert(LABELS.TITLE_VALIDATION_ERROR); + layout.infoDialog.data('show')(LABELS.TITLE_VALIDATION_ERROR); $('.propertiesContentFieldTitle', content).val(branchingActivity.title); } } @@ -204,7 +204,7 @@ activity.title = newTitle; redrawNeeded = true; } else { - alert(LABELS.TITLE_VALIDATION_ERROR); + layout.infoDialog.data('show')(LABELS.TITLE_VALIDATION_ERROR); $('.propertiesContentFieldTitle', content).val(activity.title); } } @@ -313,7 +313,7 @@ activity.title = newTitle; redrawNeeded = true; } else { - alert(LABELS.TITLE_VALIDATION_ERROR); + layout.infoDialog.data('show')(LABELS.TITLE_VALIDATION_ERROR); $('.propertiesContentFieldTitle', content).val(activity.title); } } @@ -440,7 +440,7 @@ label.title = newTitle; redrawNeeded = true; } else { - alert(LABELS.TITLE_VALIDATION_ERROR); + layout.infoDialog.data('show')(LABELS.TITLE_VALIDATION_ERROR); $('.propertiesContentFieldTitle', content).val(label.title); } } @@ -504,7 +504,7 @@ ActivityLib.addSelectEffect(activity, true); GeneralLib.setModified(true); } else { - alert(LABELS.TITLE_VALIDATION_ERROR); + layout.infoDialog.data('show')(LABELS.TITLE_VALIDATION_ERROR); $('.propertiesContentFieldTitle', content).val(activity.title); } } @@ -573,7 +573,7 @@ activity.title = newTitle; redrawNeeded = true; } else { - alert(LABELS.TITLE_VALIDATION_ERROR); + layout.infoDialog.data('show')(LABELS.TITLE_VALIDATION_ERROR); $('.propertiesContentFieldTitle', content).val(activity.title); } } @@ -641,7 +641,7 @@ region.title = newTitle; redrawNeeded = true; } else { - alert(LABELS.TITLE_VALIDATION_ERROR); + layout.infoDialog.data('show')(LABELS.TITLE_VALIDATION_ERROR); $('.propertiesContentFieldTitle', content).val(region.title); } } @@ -694,7 +694,7 @@ activity.title = newTitle; redrawNeeded = true; } else { - alert(LABELS.TITLE_VALIDATION_ERROR); + layout.infoDialog.data('show')(LABELS.TITLE_VALIDATION_ERROR); $('.propertiesContentFieldTitle', content).val(activity.title); } } @@ -774,7 +774,7 @@ } redrawNeeded = true; } else { - alert(LABELS.TITLE_VALIDATION_ERROR); + layout.infoDialog.data('show')(LABELS.TITLE_VALIDATION_ERROR); $('.propertiesContentFieldTitle', content).val(transition.title); } } @@ -852,7 +852,7 @@ }); if (error) { - alert(error); + layout.infoDialog.data('show')(error); return; } @@ -1277,7 +1277,7 @@ || (typeof condition.endValue == 'undefined' && (typeof existingCondition.endValue == 'undefined' || existingCondition.endValue >= condition.startValue)) || (!(condition.startValue > existingCondition.endValue) && !(condition.endValue < existingCondition.startValue))) { - alert(LABELS.RANGE_CONDITION_ADD_START_ERROR); + layout.infoDialog.data('show')(LABELS.RANGE_CONDITION_ADD_START_ERROR); condition = null; return false; } @@ -1286,7 +1286,7 @@ || (typeof condition.startValue == 'undefined' && (typeof existingCondition.startValue == 'undefined' || existingCondition.startValue <= condition.endValue)) || (!(condition.endValue < existingCondition.startValue) && !(condition.startValue > existingCondition.endValue))) { - alert(LABELS.RANGE_CONDITION_ADD_END_ERROR); + layout.infoDialog.data('show')(LABELS.RANGE_CONDITION_ADD_END_ERROR); condition = null; return false; } @@ -1917,7 +1917,7 @@ + ', '; }); message = message.substring(0, message.length - 2); - alert(message); + layout.infoDialog.data('show')(message); } } }; \ No newline at end of file