Index: lams_central/web/authoring/authoring.jsp =================================================================== diff -u -rafc23c933fe5ce406a5112d67c95581b0b9ac3ce -r3da98a1b1c7bcd2df24329ed436a4b6b8cdf5ca8 --- lams_central/web/authoring/authoring.jsp (.../authoring.jsp) (revision afc23c933fe5ce406a5112d67c95581b0b9ac3ce) +++ lams_central/web/authoring/authoring.jsp (.../authoring.jsp) (revision 3da98a1b1c7bcd2df24329ed436a4b6b8cdf5ca8) @@ -394,7 +394,6 @@ @@ -517,6 +516,24 @@ + +
+
+
+
+ +
+
+ +
+
+
+
Index: lams_central/web/css/_authoring_base.scss =================================================================== diff -u -rafc23c933fe5ce406a5112d67c95581b0b9ac3ce -r3da98a1b1c7bcd2df24329ed436a4b6b8cdf5ca8 --- lams_central/web/css/_authoring_base.scss (.../_authoring_base.scss) (revision afc23c933fe5ce406a5112d67c95581b0b9ac3ce) +++ lams_central/web/css/_authoring_base.scss (.../_authoring_base.scss) (revision 3da98a1b1c7bcd2df24329ed436a4b6b8cdf5ca8) @@ -625,6 +625,11 @@ border-radius: 15px; } +table#authoringTable img.template-drag-helper { + width: 40px; + height: 40px; +} + td#canvasContainerCell { vertical-align: top; } Index: lams_central/web/images/gateClosed.png =================================================================== diff -u -r40c0555670eae84b4e4f27c79fb96ba95e87edbe -r3da98a1b1c7bcd2df24329ed436a4b6b8cdf5ca8 Binary files differ Index: lams_central/web/includes/javascript/authoring/authoringActivity.js =================================================================== diff -u -rafc23c933fe5ce406a5112d67c95581b0b9ac3ce -r3da98a1b1c7bcd2df24329ed436a4b6b8cdf5ca8 --- lams_central/web/includes/javascript/authoring/authoringActivity.js (.../authoringActivity.js) (revision afc23c933fe5ce406a5112d67c95581b0b9ac3ce) +++ lams_central/web/includes/javascript/authoring/authoringActivity.js (.../authoringActivity.js) (revision 3da98a1b1c7bcd2df24329ed436a4b6b8cdf5ca8) @@ -45,7 +45,8 @@ 'Chat and Scribe' : 5, 'Forum and Scribe' : 5, - 'grouping' : 1 + 'grouping' : 1, + 'gate' : 1 }, ActivityDefs = { @@ -449,7 +450,7 @@ y = GeneralLib.snapToGrid(y) - layout.snapToGrid.offset * 2; // create activity SVG elements - var shape = ActivityLib.getActivityIcon('gateClosed'); + var shape = ActivityLib.getActivityIcon('gate'); shape.select('svg').attr({ 'x' : x, 'y' : y, Index: lams_central/web/includes/javascript/authoring/authoringGeneral.js =================================================================== diff -u -rafc23c933fe5ce406a5112d67c95581b0b9ac3ce -r3da98a1b1c7bcd2df24329ed436a4b6b8cdf5ca8 --- lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision afc23c933fe5ce406a5112d67c95581b0b9ac3ce) +++ lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision 3da98a1b1c7bcd2df24329ed436a4b6b8cdf5ca8) @@ -34,10 +34,6 @@ 'dialogs' : [], // for storing icons and other activity metadata 'toolMetadata': { - 'gateClosed' : { - 'iconPath' : 'images/svg/gateClosed.svg', - 'cursorPath' : 'images/gateClosed.png' - }, 'branchingStart' : { 'iconPath' : 'images/svg/branchingStart.svg' }, @@ -215,7 +211,7 @@ layout.initWindowHeight = $(window).height(); $('.template', templateContainerCell).each(function(){ - var learningLibraryID = $(this).attr('learningLibraryId'), + let learningLibraryID = $(this).attr('learningLibraryId'), activityCategoryID = layout.toolMetadata[learningLibraryID].activityCategoryID; $('#collapse-tool-category-' + activityCategoryID, templateContainerCell).append(this); @@ -228,9 +224,20 @@ 'scroll' : false, 'scope' : 'template', 'helper' : function(){ + let helper = null; // build a simple helper - return $(this).clone().addClass('template-drag-helper'); - } + if (learningLibraryID == 'gate'){ + helper = $('img', this).clone(); + } else { + helper = $(this).clone(); + } + + return helper.addClass('template-drag-helper'); + }, + 'cursorAt' : isNaN(+learningLibraryID) ? { + 'right' : 20, + 'bottom': 45 + } : false }); }); @@ -256,6 +263,8 @@ if (activityCategoryID === 1) { if (learningLibraryID == 'grouping'){ activity = new ActivityDefs.GroupingActivity(null, null, x, y) + } else if (learningLibraryID == 'gate'){ + activity = new ActivityDefs.GateActivity(null, null, x - 10, y + 20); } } else if (activityCategoryID === 5) { // construct child activities out of previously referenced HTML templates Index: lams_central/web/includes/javascript/authoring/authoringMenu.js =================================================================== diff -u -rafc23c933fe5ce406a5112d67c95581b0b9ac3ce -r3da98a1b1c7bcd2df24329ed436a4b6b8cdf5ca8 --- lams_central/web/includes/javascript/authoring/authoringMenu.js (.../authoringMenu.js) (revision afc23c933fe5ce406a5112d67c95581b0b9ac3ce) +++ lams_central/web/includes/javascript/authoring/authoringMenu.js (.../authoringMenu.js) (revision 3da98a1b1c7bcd2df24329ed436a4b6b8cdf5ca8) @@ -118,27 +118,6 @@ /** - * Creates a new gate activity. - */ - addGate : function() { - HandlerLib.resetCanvasMode(); - - canvas.css('cursor', 'url("' + LAMS_URL + layout.toolMetadata.gateClosed.cursorPath + '"), move').click(function(event){ - // pageX and pageY tell event coordinates relative to the whole page - // we need relative to canvas - var translatedEvent = GeneralLib.translateEventOnCanvas(event), - x = translatedEvent[0], - y = translatedEvent[1] + 2; - - layout.activities.push(new ActivityDefs.GateActivity(null, null, x, y)); - - GeneralLib.setModified(true); - HandlerLib.resetCanvasMode(true); - }); - }, - - - /** * Creates a new optional activity. */ addOptionalActivity : function() {