Index: lams_central/conf/language/lams/ApplicationResources.properties
===================================================================
diff -u -ra2b7fcb20543d3f2433c4055cafa3037ef1b8dd0 -r7e4e5c5afea0404304cf2f15fbfa79488fd1e92d
--- lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision a2b7fcb20543d3f2433c4055cafa3037ef1b8dd0)
+++ lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 7e4e5c5afea0404304cf2f15fbfa79488fd1e92d)
@@ -629,6 +629,8 @@
authoring.fla.liveedit.readonly.remove.parent.error = The activity can not be removed. Its parent activity is read-only.
authoring.fla.liveedit.readonly.remove.child.error = The activity can not be removed. It has read-only child activities.
authoring.fla.liveedit.readonly.remove.transition.error = The transition can not be removed. It is read-only.
+authoring.fla.remove.button.confirm = Are you sure you want to remove this item?
+authoring.fla.remove.button.tip = Remove this item
ckeditor.math.math = Math
ckeditor.math.functions = Functions
ckeditor.math.greek = Greek
Index: lams_central/web/authoring/authoring.jsp
===================================================================
diff -u -r0549136389d906a0aa8837ffc15f8d57bc45d5b6 -r7e4e5c5afea0404304cf2f15fbfa79488fd1e92d
--- lams_central/web/authoring/authoring.jsp (.../authoring.jsp) (revision 0549136389d906a0aa8837ffc15f8d57bc45d5b6)
+++ lams_central/web/authoring/authoring.jsp (.../authoring.jsp) (revision 7e4e5c5afea0404304cf2f15fbfa79488fd1e92d)
@@ -19,12 +19,6 @@
-
-
-
-
-
-
+
+
+
+
+
+
<%-- "loading..." screen, gets removed on page full load --%>
Index: lams_central/web/css/_authoring_base.scss
===================================================================
diff -u -raf4b359779b642ad672cdc433fae524530a0191b -r7e4e5c5afea0404304cf2f15fbfa79488fd1e92d
--- lams_central/web/css/_authoring_base.scss (.../_authoring_base.scss) (revision af4b359779b642ad672cdc433fae524530a0191b)
+++ lams_central/web/css/_authoring_base.scss (.../_authoring_base.scss) (revision 7e4e5c5afea0404304cf2f15fbfa79488fd1e92d)
@@ -109,6 +109,17 @@
padding: 5px;
}
+div.propertiesDialogContainer .dialogContents .propertyBinContainer {
+ text-align: right;
+}
+
+div.propertiesDialogContainer .dialogContents .propertyBinButton {
+ width: 30px;
+ height: 30px;
+ margin: 10px;
+ cursor: pointer;
+}
+
input[name="propertiesContentFieldGroupDivide"] {
margin-right: 10px;
}
Index: lams_central/web/includes/javascript/authoring/authoringActivity.js
===================================================================
diff -u -r6fe1288c9b40b22c78cf5459b7dc0e2a0ef0a930 -r7e4e5c5afea0404304cf2f15fbfa79488fd1e92d
--- lams_central/web/includes/javascript/authoring/authoringActivity.js (.../authoringActivity.js) (revision 6fe1288c9b40b22c78cf5459b7dc0e2a0ef0a930)
+++ lams_central/web/includes/javascript/authoring/authoringActivity.js (.../authoringActivity.js) (revision 7e4e5c5afea0404304cf2f15fbfa79488fd1e92d)
@@ -1776,7 +1776,23 @@
GeneralLib.setModified(true);
},
+ /**
+ * Deletes an item (activity, annotation etc.) as a result of user pressing a button on properties box
+ */
+ removeItemWithButton : function(item) {
+ if ((item instanceof ActivityDefs.BranchingEdgeActivity) || confirm(LABELS.REMOVE_BUTTON_CONFIRM)) {
+ ActivityLib.removeSelectEffect(item);
+ if (item instanceof DecorationDefs.Label) {
+ DecorationLib.removeLabel(item);
+ } else if (item instanceof DecorationDefs.Region) {
+ DecorationLib.removeRegion(item);
+ } else {
+ ActivityLib.removeActivity(item);
+ }
+ }
+ },
+
/**
* Deselects an activity/transition/annotation
*/
@@ -1860,7 +1876,7 @@
/**
* Removes the given transition.
*/
- removeTransition : function(transition, redraw) {
+ removeTransition : function(transition) {
// find the transition and remove it
var transitions = transition.fromActivity.transitions.from;
transitions.splice(transitions.indexOf(transition), 1);
Index: lams_central/web/includes/javascript/authoring/authoringGeneral.js
===================================================================
diff -u -ra96cfaeee7a22aa19b988c92963a5197c8bc57b0 -r7e4e5c5afea0404304cf2f15fbfa79488fd1e92d
--- lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision a96cfaeee7a22aa19b988c92963a5197c8bc57b0)
+++ lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision 7e4e5c5afea0404304cf2f15fbfa79488fd1e92d)
@@ -55,7 +55,11 @@
'iconPath' : 'images/svg/branchingEnd.svg'
},
'bin' : {
- 'iconPath' : 'images/svg/authoringBin.svg'
+ 'iconPath' : 'images/svg/authoringBin.svg',
+ 'propertyButton' : $('').addClass('propertyBinContainer')
+ .append($('
![]()
').attr('src', LAMS_URL + 'images/svg/authoringBin.svg')
+ .attr('title', LABELS.REMOVE_BUTTON_TOOLTIP)
+ .addClass('propertyBinButton'))
}
},
Index: lams_central/web/includes/javascript/authoring/authoringProperty.js
===================================================================
diff -u -ref32c5d5a859467fe2a98b31251041d4e0c0582c -r7e4e5c5afea0404304cf2f15fbfa79488fd1e92d
--- lams_central/web/includes/javascript/authoring/authoringProperty.js (.../authoringProperty.js) (revision ef32c5d5a859467fe2a98b31251041d4e0c0582c)
+++ lams_central/web/includes/javascript/authoring/authoringProperty.js (.../authoringProperty.js) (revision 7e4e5c5afea0404304cf2f15fbfa79488fd1e92d)
@@ -42,6 +42,9 @@
if (!content) {
// first run, create the content
content = activity.propertiesContent = $('#propertiesContentBranching').clone().attr('id', null)
+ .append(layout.toolMetadata.bin.propertyButton.clone().click(function(){
+ ActivityLib.removeItemWithButton(activity);
+ }))
.show().data('parentObject', activity);
// extra buttons for group/input based branching
$('.propertiesContentFieldMatchGroups', content).button().click(function(){
@@ -171,6 +174,9 @@
if (!content) {
// first run, create the content
content = activity.propertiesContent = $('#propertiesContentGate').clone().attr('id', null)
+ .append(layout.toolMetadata.bin.propertyButton.clone().click(function(){
+ ActivityLib.removeItemWithButton(activity);
+ }))
.show().data('parentObject', activity);
$('.propertiesContentFieldTitle', content).val(activity.title);
if (activity.gateType == 'system') {
@@ -400,6 +406,9 @@
// first run, create the content
content = activity.propertiesContent = $('#propertiesContentGrouping').clone().attr('id', null)
+ .append(layout.toolMetadata.bin.propertyButton.clone().click(function(){
+ ActivityLib.removeItemWithButton(activity);
+ }))
.show().data('parentObject', activity);
// init widgets
@@ -443,6 +452,9 @@
if (!content) {
// first run, create the content
content = label.propertiesContent = $('#propertiesContentLabel').clone().attr('id', null)
+ .append(layout.toolMetadata.bin.propertyButton.clone().click(function(){
+ ActivityLib.removeItemWithButton(label);
+ }))
.show().data('parentObject', label);
$('.propertiesContentFieldTitle', content).val(label.title);
var color = label.items.shape.attr('fill');
@@ -521,6 +533,9 @@
if (!content) {
// first run, create the content
content = activity.propertiesContent = $('#propertiesContentOptionalActivity').clone().attr('id', null)
+ .append(layout.toolMetadata.bin.propertyButton.clone().click(function(){
+ ActivityLib.removeItemWithButton(activity);
+ }))
.show().data('parentObject', activity);
$('.propertiesContentFieldTitle', content).val(activity.title);
@@ -592,6 +607,9 @@
if (!content) {
// first run, create the content
content = activity.propertiesContent = $('#propertiesContentParallel').clone().attr('id', null)
+ .append(layout.toolMetadata.bin.propertyButton.clone().click(function(){
+ ActivityLib.removeItemWithButton(activity);
+ }))
.show().data('parentObject', activity);
$('.propertiesContentFieldTitle', content).val(activity.title);
@@ -646,6 +664,9 @@
if (!content) {
// first run, create the content
content = region.propertiesContent = $('#propertiesContentRegion').clone().attr('id', null)
+ .append(layout.toolMetadata.bin.propertyButton.clone().click(function(){
+ ActivityLib.removeItemWithButton(region);
+ }))
.show().data('parentObject', region);
$('.propertiesContentFieldTitle', content).val(region.title);
@@ -705,6 +726,9 @@
if (!content) {
// first run, create the content
content = activity.propertiesContent = $('#propertiesContentTool').clone().attr('id', null)
+ .append(layout.toolMetadata.bin.propertyButton.clone().click(function(){
+ ActivityLib.removeItemWithButton(activity);
+ }))
.show().data('parentObject', activity);
$('.propertiesContentFieldTitle', content).val(activity.title);
if (activity.parentActivity && (activity.parentActivity instanceof ActivityDefs.ParallelActivity)) {