Index: lams_central/web/images/authoring_bin.svg
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/images/authoring_bin.svg,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/images/authoring_bin.svg 22 Jun 2015 02:01:29 -0000 1.1
@@ -0,0 +1,158 @@
+
+
+
\ No newline at end of file
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.65 -r1.66
--- lams_central/web/includes/javascript/authoring/authoringGeneral.js 19 Jun 2015 17:51:25 -0000 1.65
+++ lams_central/web/includes/javascript/authoring/authoringGeneral.js 22 Jun 2015 02:01:29 -0000 1.66
@@ -45,7 +45,9 @@
// list of all dialogs, so they can be easily closed all at once
'dialogs' : [],
// stores precached tool images so they can be used in exported SVG
- 'iconLib' : {},
+ 'iconLib' : {
+ 'bin' : 'images/authoring_bin.svg'
+ },
// icons for special activities
'toolMetadata': {
'gate' : {
@@ -82,7 +84,11 @@
'groupingEffectPadding' : 5,
'selectEffectPadding' : 7,
- 'supportsDownloadAttribute' : typeof $('')[0].download != 'undefined'
+ 'supportsDownloadAttribute' : typeof $('')[0].download != 'undefined',
+
+ // when mouse hovers over rubbish bin
+ 'binGlowWidth' : 10,
+ 'binGlowOpacity' : 1
},
'colors' : {
@@ -95,8 +101,10 @@
'annotationPalette' : ['FFFF00', '00FFFF', '8A2BE2', '7FFF00', '6495ED',
'FFF8DC', 'FF8C00', '00BFFF', 'DCDCDC', 'ADD8E6', '20B2AA',
'B0C4DE', 'FFE4E1', 'FF4500', 'EE82EE'],
- // when mouse hover rubbish bin
- 'binActive' : 'red',
+
+ // when mouse hovers over rubbish bin
+ 'binGlow' : 'red',
+
'branchingEdgeStart' : 'green',
'branchingEdgeEnd' : 'red',
// highlight branching edges on mouse hover
@@ -1998,7 +2006,7 @@
}
// draw rubbish bin on canvas
- layout.bin = paper.path(Raphael.format('M {0} {1} h -50 l 10 50 h 30 z', width - 5, height - 50));
+ layout.bin = paper.image(LAMS_URL + layout.iconLib.bin, width - 55, height - 55, 48, 48);
// so it can be found when SVG code gets cloned
$(layout.bin.node).attr('id', 'rubbishBin');
Index: lams_central/web/includes/javascript/authoring/authoringHandler.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/includes/javascript/authoring/authoringHandler.js,v
diff -u -r1.19 -r1.20
--- lams_central/web/includes/javascript/authoring/authoringHandler.js 22 Jun 2015 01:25:30 -0000 1.19
+++ lams_central/web/includes/javascript/authoring/authoringHandler.js 22 Jun 2015 02:01:29 -0000 1.20
@@ -80,7 +80,10 @@
items.isDragged = false;
items.unmouseup();
HandlerLib.resetCanvasMode(true);
- layout.bin.attr('fill', 'transparent');
+ if (layout.bin.glowEffect) {
+ layout.bin.glowEffect.remove();
+ layout.bin.glowEffect = null;
+ }
// do whetver needs to be done with the dragged elements
mouseupHandler(mouseupEvent);
@@ -113,9 +116,17 @@
// highlight rubbish bin if dragged elements are over it
if (HandlerLib.isElemenentBinned(event)) {
- layout.bin.attr('fill', layout.colors.binActive);
- } else {
- layout.bin.attr('fill', 'transparent');
+ if (!layout.bin.glowEffect) {
+ layout.bin.glowEffect = layout.bin.glow({
+ 'width' : layout.conf.binGlowWidth,
+ 'opacity' : layout.conf.binGlowOpacity,
+ 'color' : layout.colors.binGlow,
+ 'offsety' : 2
+ });
+ }
+ } else if (layout.bin.glowEffect){
+ layout.bin.glowEffect.remove();
+ layout.bin.glowEffect = null;
}
},