Index: lams_central/web/includes/javascript/authoring/authoringActivity.js =================================================================== diff -u -rdb8d5783fabce3070377df165b401f6426fd5ca2 -r6a11f142b15097c8def383a567ba3d794f326037 --- lams_central/web/includes/javascript/authoring/authoringActivity.js (.../authoringActivity.js) (revision db8d5783fabce3070377df165b401f6426fd5ca2) +++ lams_central/web/includes/javascript/authoring/authoringActivity.js (.../authoringActivity.js) (revision 6a11f142b15097c8def383a567ba3d794f326037) @@ -685,28 +685,48 @@ } // create activity SVG elements - var shape = paper.rect(x, y, 125, 50, 5, 5) + var curve = layout.conf.activityBorderCurve, + width = layout.conf.activityWidth, + height = layout.conf.activityHeight, + bannerWidth = layout.conf.activityBannerWidth, + bannerPath = 'M ' + (x + curve) + ' ' + (y + height) + ' q ' + -curve + ' 0 ' + -curve + ' ' + -curve + + ' v ' + (-height + 2 * curve) + ' q 0 ' + -curve + ' ' + curve + ' ' + -curve, + shapePath = bannerPath + ' h ' + (width - 2 * curve) + ' q ' + curve + ' 0 ' + curve + ' ' + curve + + ' v ' + (height - 2 * curve) + ' q 0 ' + curve + ' ' + -curve + ' ' + curve + ' z', + shape = paper.path(shapePath) // activity colour depends on its category ID .attr({ - 'stroke' : this.requireGrouping ? - layout.colors.activityRequireGrouping - : layout.colors.toolActivityBorder[layout.toolMetadata[this.learningLibraryID].activityCategoryID], - 'stroke-width' : this.requireGrouping ? '4' : '2', - 'stroke-linejoin' : 'round', - 'fill' : '#fff' // layout.colors.activity[layout.toolMetadata[this.learningLibraryID].activityCategoryID] + 'stroke' : 'none', + 'fill' : '#fff' }), + shapeBorder = paper.path(shapePath) + // activity colour depends on its category ID + .attr({ + 'stroke' : this.requireGrouping + ? layout.colors.activityRequireGrouping + : '#000', + 'stroke-width' : this.requireGrouping ? 3 : 1, + 'fill' : 'none' + }), // check for icon in the library - imageData = ActivityIcons[this.learningLibraryID], + imageData = null, // ActivityIcons[this.learningLibraryID], icon = imageData ? paper.image(imageData, x + 5, y + 3, 20, 20) : null, - label = paper.text(x + 30, y + 15, ActivityLib.shortenActivityTitle(this.title)) + label = paper.text(x + 30, y + 18, ActivityLib.shortenActivityTitle(this.title)) .attr(layout.defaultTextAttributes) .attr({ 'id' : 'toolActivityTitle', 'fill' : layout.colors.activityText, 'text-anchor' : 'start' }); - this.items = paper.g(shape, label); + bannerPath += ' h ' + bannerWidth + ' v ' + height + ' z'; + var banner = paper.path(bannerPath) + .attr({ + 'stroke' : 'none', + 'fill' : layout.colors.activity[layout.toolMetadata[this.learningLibraryID].activityCategoryID] + }); + this.items = paper.g(shape, banner, shapeBorder, label); + if (icon) { this.items.add(icon); } Index: lams_central/web/includes/javascript/authoring/authoringGeneral.js =================================================================== diff -u -rdb8d5783fabce3070377df165b401f6426fd5ca2 -r6a11f142b15097c8def383a567ba3d794f326037 --- lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision db8d5783fabce3070377df165b401f6426fd5ca2) +++ lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision 6a11f142b15097c8def383a567ba3d794f326037) @@ -76,14 +76,19 @@ // will be initialised when paper gets created 'readOnlyFilter' : null, + 'activityWidth' : 200, + 'activityHeight' : 80, + 'activityBorderCurve' : 5, + 'activityBannerWidth' : 10, + // the bigger this number, the larger bezier curves will be 'transitionCurve' : 15, 'transitionCircleRadius' : 5, 'transitionArrowLength' : 5, // snapping grid step when dragging an activity 'snapGridX' : 100, - 'snapGridY' : 100 + 'snapGridY' : 150 }, 'colors' : { @@ -132,7 +137,7 @@ 'defaultTextAttributes' : { 'text-anchor' : 'middle', - 'font-size' : 10, + 'font-size' : 12, 'font-family' : 'sans-serif' } },