Index: lams_central/web/author2.jsp
===================================================================
diff -u -r1c59101cfa996a1cfdf296191fa297e60b70218f -r606ff1b9f1cfb78e79cc6f592a695402dcda1391
--- lams_central/web/author2.jsp (.../author2.jsp) (revision 1c59101cfa996a1cfdf296191fa297e60b70218f)
+++ lams_central/web/author2.jsp (.../author2.jsp) (revision 606ff1b9f1cfb78e79cc6f592a695402dcda1391)
@@ -132,7 +132,9 @@
-
Index: lams_central/web/includes/javascript/authoring/authoringActivity.js
===================================================================
diff -u -r8a39e73cf38d5f62bf4be88f765da4a23da49fff -r606ff1b9f1cfb78e79cc6f592a695402dcda1391
--- lams_central/web/includes/javascript/authoring/authoringActivity.js (.../authoringActivity.js) (revision 8a39e73cf38d5f62bf4be88f765da4a23da49fff)
+++ lams_central/web/includes/javascript/authoring/authoringActivity.js (.../authoringActivity.js) (revision 606ff1b9f1cfb78e79cc6f592a695402dcda1391)
@@ -30,12 +30,13 @@
/**
* Constructor for a Tool Activity.
*/
- ToolActivity : function(id, uiid, toolContentID, toolID, authorURL,
+ ToolActivity : function(id, uiid, toolContentID, toolID, learningLibraryID, authorURL,
x, y, title, supportsOutputs) {
this.id = +id;
this.uiid = +uiid || ++layout.ld.maxUIID;
this.toolContentID = toolContentID;
this.toolID = +toolID;
+ this.learningLibraryID = +learningLibraryID;
this.authorURL = authorURL;
this.title = title;
this.supportsOutputs = supportsOutputs;
@@ -282,10 +283,10 @@
paper.setStart();
var shape = paper.path(Raphael.format('M {0} {1}' + layout.defs.activity, x, y))
.attr({
- 'fill' : layout.colors.activity[layout.toolMetadata[this.toolID].activityCategoryID]
+ 'fill' : layout.colors.activity[layout.toolMetadata[this.learningLibraryID].activityCategoryID]
});
// check for icon in the library
- paper.image(layout.toolMetadata[this.toolID].iconPath, x + 47, y + 2, 30, 30);
+ paper.image(layout.toolMetadata[this.learningLibraryID].iconPath, x + 47, y + 2, 30, 30);
paper.text(x + 62, y + 40, ActivityLib.shortenActivityTitle(this.title))
.attr({
'fill' : layout.colors.activityText
@@ -815,12 +816,7 @@
layout.items.selectedObject = object;
// show the properties dialog for the selected object
if (object.loadPropertiesDialogContent) {
- object.loadPropertiesDialogContent();
- var dialog = layout.items.propertiesDialog;
- dialog.children().detach();
- dialog.append(object.propertiesContent);
- dialog.dialog('open');
- dialog.find('input').blur();
+ PropertyLib.openPropertiesDialog(object);
}
}
}
Index: lams_central/web/includes/javascript/authoring/authoringGeneral.js
===================================================================
diff -u -r88f629dd528a870fc56df3bf006cabecf23c6359 -r606ff1b9f1cfb78e79cc6f592a695402dcda1391
--- lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision 88f629dd528a870fc56df3bf006cabecf23c6359)
+++ lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision 606ff1b9f1cfb78e79cc6f592a695402dcda1391)
@@ -182,6 +182,7 @@
// calculate the position and create an instance of the tool activity
var learningLibraryID = +draggable.draggable.attr('learningLibraryId'),
+ toolID = +draggable.draggable.attr('toolId'),
activityCategoryID = +draggable.draggable.attr('activityCategoryId'),
x = draggable.offset.left + canvas.scrollLeft() - canvas.offset().left,
y = draggable.offset.top + canvas.scrollTop() - canvas.offset().top,
@@ -195,18 +196,19 @@
// construct child activities out of previously referenced HTML templates
var childActivities = [];
layout.toolMetadata[learningLibraryID].parallelChildActivities.each(function(){
- var toolActivityLibraryID = +$(this).attr('learningLibraryId'),
+ var childLearningLibraryID = +$(this).attr('learningLibraryId'),
+ childToolID = +$(this).attr('toolId'),
toolLabel = $('div', this).text(),
childActivity = new ActivityLib.ToolActivity(null, null, null,
- toolActivityLibraryID, null, x, y, toolLabel);
+ childToolID, childLearningLibraryID, null, x, y, toolLabel);
layout.activities.push(childActivity);
childActivities.push(childActivity);
});
activity = new ActivityLib.ParallelActivity(null, null, learningLibraryID, x, y, label, childActivities);
} else {
- activity = new ActivityLib.ToolActivity(null, null, null, learningLibraryID, null, x, y, label);
+ activity = new ActivityLib.ToolActivity(null, null, null, toolID, learningLibraryID, null, x, y, label);
}
layout.activities.push(activity);
@@ -466,6 +468,7 @@
activityData.activityUIID,
activityData.toolContentID,
activityData.toolID,
+ activityData.learningLibraryID,
LAMS_URL + activityData.authoringURL
+ '?toolContentID=' + activityData.toolContentID
+ '&contentFolderID=' + layout.ld.contentFolderID,
@@ -914,21 +917,19 @@
x = activityBox ? parseInt(activityBox.x) : null,
y = activityBox ? parseInt(activityBox.y) : null,
activityTypeID = null,
- toolID = activity.toolID,
- learningLibraryID = toolID ? toolID : activity.learningLibraryID,
activityCategoryID = activity instanceof ActivityLib.ToolActivity ?
- layout.toolMetadata[learningLibraryID].activityCategoryID :
+ layout.toolMetadata[activity.learningLibraryID].activityCategoryID :
activity instanceof ActivityLib.ParallelActivity ? 5 : 1,
iconPath = null,
isGrouped = activity.grouping ? true : false,
parentActivityID = activity.parentActivity ? activity.parentActivity.id : null;
- if (toolID) {
+ if (activity.toolID) {
activityTypeID = 1;
// find out what is the icon for tool acitivty
- var templateIcon = $('.template[learningLibraryId=' + learningLibraryID +'] img');
+ var templateIcon = $('.template[learningLibraryId=' + activity.learningLibraryID +'] img');
if (templateIcon.width() > 0) {
- iconPath = layout.toolMetadata[learningLibraryID].iconPath;
+ iconPath = layout.toolMetadata[activity.learningLibraryID].iconPath;
}
}
// translate activity type to back-end understandable
@@ -1019,8 +1020,8 @@
activities.push({
'activityID' : activity.id,
'activityUIID' : activity.uiid,
- 'toolID' : toolID,
- 'learningLibraryID' : learningLibraryID,
+ 'toolID' : activity.toolID,
+ 'learningLibraryID' : activity.learningLibraryID,
'toolContentID' : activity.toolContentID,
'stopAfterActivity' : false,
'groupingSupportType' : 2,
Index: lams_central/web/includes/javascript/authoring/authoringProperty.js
===================================================================
diff -u -re54062fd58a594bde5209040129894c75a8ac377 -r606ff1b9f1cfb78e79cc6f592a695402dcda1391
--- lams_central/web/includes/javascript/authoring/authoringProperty.js (.../authoringProperty.js) (revision e54062fd58a594bde5209040129894c75a8ac377)
+++ lams_central/web/includes/javascript/authoring/authoringProperty.js (.../authoringProperty.js) (revision 606ff1b9f1cfb78e79cc6f592a695402dcda1391)
@@ -157,7 +157,26 @@
layout.dialogs.push(gtbDialog);
},
+ openPropertiesDialog : function(object) {
+ object.loadPropertiesDialogContent();
+ var dialog = layout.items.propertiesDialog;
+ dialog.children().detach();
+ dialog.append(object.propertiesContent);
+ dialog.dialog('open');
+ dialog.find('input').blur();
+ var box = object.items.getBBox(),
+ x = box.x2 + canvas.offset().left + 5,
+ y = box.y + canvas.offset().top;
+ dialog.dialog('option', 'position', [x, y]);
+ if (dialog.offset().left < box.x2 + canvas.offset().left) {
+ // if dialog covers the activity (too close to right border),
+ // move it to the other side
+ x = box.x + canvas.offset().left - dialog.width() - 35;
+ dialog.dialog('option', 'position', [x, y]);
+ }
+ },
+
/**
* Properties dialog content for transitions.
*/
@@ -743,7 +762,8 @@
var emptyOption = $(''),
inputDropdown = $('.propertiesContentFieldInput', content).empty().append(emptyOption);
$.each(layout.activities, function(){
- if (this instanceof ActivityLib.ToolActivity && layout.toolMetadata[this.toolID].supportsOutputs) {
+ if (this instanceof ActivityLib.ToolActivity
+ && layout.toolMetadata[this.learningLibraryID].supportsOutputs) {
var option = $('').text(this.title)
.appendTo(inputDropdown)
// store reference to grouping object
|