Index: lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/service/MindmapService.java
===================================================================
diff -u -r471b903caa3365758fbdec0a22440b1b0b3f2947 -r1e5b385c02e618c2bbaafb6321e1bbf78473cd2b
--- lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/service/MindmapService.java (.../MindmapService.java) (revision 471b903caa3365758fbdec0a22440b1b0b3f2947)
+++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/service/MindmapService.java (.../MindmapService.java) (revision 1e5b385c02e618c2bbaafb6321e1bbf78473cd2b)
@@ -88,6 +88,7 @@
*/
public class MindmapService implements ToolSessionManager, ToolContentManager, IMindmapService, ToolRestManager {
+ private static final int NODE_TEXT_LENGTH = 100; // node_text column in the database is varchar(100)
private static Logger logger = Logger.getLogger(MindmapService.class.getName());
private final XStream xstream = new XStream(new SunUnsafeReflectionProvider());
@@ -845,6 +846,9 @@
@Override
public void saveOrUpdateMindmapNode(MindmapNode mindmapNode) {
+ if (mindmapNode.getText() != null && mindmapNode.getText().length() > NODE_TEXT_LENGTH) {
+ mindmapNode.setText(mindmapNode.getText().substring(0, NODE_TEXT_LENGTH));
+ }
mindmapNodeDAO.saveOrUpdate(mindmapNode);
}
Index: lams_tool_mindmap/web/common/mapjs.jsp
===================================================================
diff -u -r6904f3515317ff2162766f1beee8a2bc88f38235 -r1e5b385c02e618c2bbaafb6321e1bbf78473cd2b
--- lams_tool_mindmap/web/common/mapjs.jsp (.../mapjs.jsp) (revision 6904f3515317ff2162766f1beee8a2bc88f38235)
+++ lams_tool_mindmap/web/common/mapjs.jsp (.../mapjs.jsp) (revision 1e5b385c02e618c2bbaafb6321e1bbf78473cd2b)
@@ -111,9 +111,11 @@
if ( idea.creator ) {
labelMap[idea.id] = idea.creator;
}
- if ( idea.ideas ) {
- Object.values(idea.ideas).forEach(addLabel);
- }
+ if ( idea.ideas ) {
+ Object.keys(idea.ideas).forEach(function(key) {
+ addLabel(idea.ideas[key]);
+ });
+ }
};
addLabel(idea);
return labelMap;
@@ -225,7 +227,7 @@
// Cannot use the standard function as that would be picked up by the onIdeaChangedLAMS listener
// Return all the elements for which a truth test fails.
function customRemoveSubIdea(subIdeaId) {
- parent = contentAggregate.findParent(subIdeaId) || contentAggregate,
+ const parent = contentAggregate.findParent(subIdeaId) || contentAggregate,
oldRank = parent && parent.findChildRankById(subIdeaId),
oldIdea = parent && parent.ideas[oldRank],
oldLinks = contentAggregate.links,
@@ -234,7 +236,8 @@
if (!oldRank) {
return false;
}
- oldIdea.traverse((traversed)=> removedNodeIds[traversed.id] = true);
+ // LAMS Modification comment out => entries so that it will work on IE11. These features are not being used.
+ // oldIdea.traverse((traversed)=> removedNodeIds[traversed.id] = true);
delete parent.ideas[oldRank];
contentAggregate.links = _.reject(contentAggregate.links, function (link) {
Index: lams_tool_mindmap/web/includes/javascript/mapjs/main.js
===================================================================
diff -u -rfbba41ca7139d9e3cfb25defb4daa15dabe93f2e -r1e5b385c02e618c2bbaafb6321e1bbf78473cd2b
--- lams_tool_mindmap/web/includes/javascript/mapjs/main.js (.../main.js) (revision fbba41ca7139d9e3cfb25defb4daa15dabe93f2e)
+++ lams_tool_mindmap/web/includes/javascript/mapjs/main.js (.../main.js) (revision 1e5b385c02e618c2bbaafb6321e1bbf78473cd2b)
@@ -12339,6 +12339,13 @@
$(this).on('drag', drag);
}
}).on('mm:start-dragging-shadow', function (event) {
+ // LAMS Modification IE11 does not support the remove() needed at the end of the drag, so don't start the drag.
+ if ( typeof this.remove != "function" ) {
+ event.stopPropagation();
+ event.stopImmediatePropagation();
+ return;
+ }
+
const target = $(event.relatedTarget),
clone = function () {
const result = target.clone().addClass('drag-shadow').appendTo(container).offset(target.offset()).data(target.data()).attr('mapjs-drag-role', 'shadow'),
@@ -12358,7 +12365,10 @@
left: currentDragObject.css('left')
};
currentDragObject.on('mm:stop-dragging mm:cancel-dragging', function (e) {
- this.remove();
+ // LAMS Modification IE11 does not support the remove() needed at the end of the drag, so avoid rather than throwing error
+ if ( typeof this.remove === "function" ) {
+ this.remove();
+ }
e.stopPropagation();
e.stopImmediatePropagation();
const evt = $.Event(e.type, {
@@ -15460,7 +15470,8 @@
/*global require, module */
const Theme = __webpack_require__ (6),
_ = __webpack_require__(0),
- lineStyles = __webpack_require__(38),
+// LAMS Modification comment out => entries so that it will work on IE11. See module 38
+// lineStyles = __webpack_require__(38),
nodeConnectionPointX = __webpack_require__(33),
appendUnderLine = function (connectorCurve, calculatedConnector, position) {
'use strict';
@@ -15689,8 +15700,9 @@
lineStyle = linkAttr.lineStyle || linkTheme.line.lineStyle,
lineProps = {
color: linkAttr.color || linkTheme.line.color,
- strokes: lineStyles.strokes(lineStyle, width),
- linecap: lineStyles.linecap(lineStyle, width),
+// LAMS Modification comment out => entries so that it will work on IE11. See module 38
+// strokes: lineStyles.strokes(lineStyle, width),
+// linecap: lineStyles.linecap(lineStyle, width),
width: width
};
@@ -16690,35 +16702,37 @@
/***/ }),
+// LAMS Modification comment out => entries so that it will work on IE11.
+// These features are not being used. Once we no longer support IE11 they can be uncommented.
/* 38 */
/***/ (function(module, exports) {
/*global module*/
module.exports = {
- strokes: (name, width) => {
- 'use strict';
- if (!name || name === 'solid') {
- return '';
- }
- const multipleWidth = Math.max(width || 1, 1) * 4;
- if (name === 'dashed') {
- return [multipleWidth, multipleWidth].join(', ');
- } else {
- return [1, multipleWidth].join(', ');
- }
- },
- linecap: (name) => {
- 'use strict';
- if (!name || name === 'solid') {
- return 'square';
- }
- if (name === 'dotted') {
- return 'round';
- }
- return '';
- }
-
+// strokes: (name, width) => {
+// 'use strict';
+// if (!name || name === 'solid') {
+// return '';
+// }
+// const multipleWidth = Math.max(width || 1, 1) * 4;
+// if (name === 'dashed') {
+// return [multipleWidth, multipleWidth].join(', ');
+// } else {
+// return [1, multipleWidth].join(', ');
+// }
+// },
+// linecap: (name) => {
+// 'use strict';
+// if (!name || name === 'solid') {
+// return 'square';
+// }
+// if (name === 'dotted') {
+// return 'round';
+// }
+// return '';
+// }
+//
};
@@ -18093,8 +18107,12 @@
if (originalTitle === title) {
return false;
}
- idea.title = title;
- appendChange('initialiseTitle', [ideaId, title], function () {
+ // LAMS Modification - LDEV-4656 Restrict to 100 chars if not already specified so that it fits in the database node_text field (NODE_TEXT_LENGTH)
+// idea.title = title;
+ var trimmedTitle = ( title && title.length > 100 ) ? title.substring(0,100) : title;
+ idea.title = trimmedTitle;
+
+ appendChange('initialiseTitle', [ideaId, trimmedTitle], function () {
idea.title = originalTitle;
}, originSession);
return true;
@@ -18111,8 +18129,12 @@
if (originalTitle === title) {
return false;
}
- idea.title = title;
- logChange('updateTitle', [ideaId, title], function () {
+ // LAMS Modification - LDEV-4656 Restrict to 100 chars if not already specified so that it fits in the database node_text field (NODE_TEXT_LENGTH)
+// idea.title = title;
+ var trimmedTitle = ( title && title.length > 100 ) ? title.substring(0,100) : title;
+ idea.title = trimmedTitle;
+
+ logChange('updateTitle', [ideaId, trimmedTitle], function () {
idea.title = originalTitle;
}, originSession);
return true;
@@ -18171,7 +18193,9 @@
if (!oldRank) {
return false;
}
- oldIdea.traverse((traversed)=> removedNodeIds[traversed.id] = true);
+
+// LAMS Modification comment out => entries so that it will work on IE11. These features are not being used.
+// oldIdea.traverse((traversed)=> removedNodeIds[traversed.id] = true);
delete parent.ideas[oldRank];
contentAggregate.links = _.reject(contentAggregate.links, function (link) {
@@ -18612,7 +18636,13 @@
},
trimLines = function (nodeTitle) {
'use strict';
- return nodeTitle.replace(/\r/g, '').split('\n').map(line => line.trim()).join('\n');
+// LAMS Modification comment out => entries so that it will work on IE11. This feature would be nice to have but we can live without it.
+// return nodeTitle.replace(/\r/g, '').split('\n').map(line => line.trim()).join('\n');
+ var lc, lines = nodeTitle.replace(/\r/g, '').split('\n');
+ for (lc = 0; lc < lines.length; lc++) {
+ lines[lc] = lines[lc].trim();
+ }
+ return lines.join('\n');
};
module.exports = function (nodeTitle, maxUrlLength) {
'use strict';
@@ -18700,9 +18730,23 @@
},
toRemove = filterClasses(domElement.classList),
toAdd = classList && classList.length && filterClasses(classList);
- domElement.classList.remove.apply(domElement.classList, toRemove);
+
+// LAMS Modification rewrite to avoid apply() entries so that it will work on IE11.
+// domElement.classList.remove.apply(domElement.classList, toRemove);
+// if (toAdd && toAdd.length) {
+// domElement.classList.add.apply(domElement.classList, toAdd);
+// }
+ if ( toRemove.length ) {
+ var len = toRemove.length;
+ for (var i = 0; i < len; i++) {
+ domElement.classList.remove(toRemove[i]);
+ }
+ }
if (toAdd && toAdd.length) {
- domElement.classList.add.apply(domElement.classList, toAdd);
+ var len = toAdd.length;
+ for (var i = 0; i < len; i++) {
+ domElement.classList.add(toAdd[i]);
+ }
}
return this;
};
Index: lams_tool_mindmap/web/pages/learning/mindmap.jsp
===================================================================
diff -u -r6904f3515317ff2162766f1beee8a2bc88f38235 -r1e5b385c02e618c2bbaafb6321e1bbf78473cd2b
--- lams_tool_mindmap/web/pages/learning/mindmap.jsp (.../mindmap.jsp) (revision 6904f3515317ff2162766f1beee8a2bc88f38235)
+++ lams_tool_mindmap/web/pages/learning/mindmap.jsp (.../mindmap.jsp) (revision 1e5b385c02e618c2bbaafb6321e1bbf78473cd2b)
@@ -1,9 +1,9 @@
<%@ include file="/common/taglibs.jsp"%>
-
-
-
+
+
+