Squashed commit of the following:

commit 81e9041e19344df18d8e91a31edb69ea0bce6bf7
Author: Paulo Gustavo Veiga <pveiga@wisemapping.com>
Date:   Sun Dec 5 14:35:11 2021 -0800

    Fix serialization bug

commit 290223f15aa3902ef3291e0f392a92d04e9ccd0e
Author: Paulo Gustavo Veiga <pveiga@wisemapping.com>
Date:   Sun Dec 5 09:36:59 2021 -0800

    Fix serialization bug

commit 3c1a2e37cf7be34780b760eb6f2fd3e3ac577ed1
Author: Paulo Gustavo Veiga <pveiga@wisemapping.com>
Date:   Sun Dec 5 09:24:13 2021 -0800

    Fix missing references

commit 98a7fd3e1659eb32cee43144da4a10b98cfcfed0
Author: Paulo Gustavo Veiga <pveiga@wisemapping.com>
Date:   Sun Dec 5 09:08:38 2021 -0800

    Fix compile

commit 9f5146b353f0fdb34a5b83db6d120bc09a96a073
Merge: 218e074 d3dc44c
Author: Paulo Gustavo Veiga <pveiga@wisemapping.com>
Date:   Sun Dec 5 09:03:17 2021 -0800

    Merge branch 'develop' into feature/mindplot_tests_playground

commit 218e074b7330d0a02ac7afee0b644737f3bb6b03
Author: Paulo Gustavo Veiga <pveiga@wisemapping.com>
Date:   Sat Dec 4 17:46:22 2021 -0800

    Add jquery missing dependency

commit c01a748a84a2359dcf1a49d9593369c9fefe1e76
Author: Paulo Gustavo Veiga <pveiga@wisemapping.com>
Date:   Sat Dec 4 17:41:47 2021 -0800

    Remove undercore

commit d680b063b819563f4fae38571055aad4c55180b7
Author: Paulo Gustavo Veiga <pveiga@wisemapping.com>
Date:   Sat Dec 4 17:36:58 2021 -0800

    Add missing dependencies

commit be9aa21245e84c97fa9fe3545299c6bb01772ef1
Author: Paulo Gustavo Veiga <pveiga@wisemapping.com>
Date:   Sat Dec 4 17:25:23 2021 -0800

    Fix missign dependencies.

commit 2472fa453c43b64286552edb7120d4d2c395eba4
Author: Paulo Gustavo Veiga <pveiga@wisemapping.com>
Date:   Sat Dec 4 17:08:48 2021 -0800

    Fix compilation

commit a013d07dc15a3bddda1e42cad373abbdfc525c74
Merge: f2ac8fe a81e984
Author: Paulo Gustavo Veiga <pveiga@wisemapping.com>
Date:   Sat Dec 4 16:57:19 2021 -0800

    Merge branch 'develop' into feature/mindplot_tests_playground

commit f2ac8fe17de071a09f80a20f49eb42c66b5f2f2b
Author: Paulo Gustavo Veiga <pveiga@wisemapping.com>
Date:   Thu Dec 2 18:59:03 2021 -0800

    Hack: Add declaration of designer as global variable.

commit 432167acbb055fba19f1e8469db4ffe8ad7793b7
Author: Paulo Gustavo Veiga <pveiga@wisemapping.com>
Date:   Thu Dec 2 18:51:13 2021 -0800

    Hack the initialization of extended hotkey pluggin.

commit 794db35e88f6bd232094b4f104c8fe6a8fab34be
Author: Paulo Gustavo Veiga <pveiga@wisemapping.com>
Date:   Thu Dec 2 17:57:21 2021 -0800

    Add keyboard function

commit e47a48d51f1af0ebde4ebea07cb467a8e5a7a372
Author: Matias Arriola <matias.arriola@gmail.com>
Date:   Thu Dec 2 14:50:43 2021 -0300

    Fix editor snapshot

commit 9bf8baef1216352ed1f9dde4658c479c0044b093
Author: Matias Arriola <matias.arriola@gmail.com>
Date:   Thu Dec 2 13:14:13 2021 -0300

    Add editor test to mindplot playground

    Add missing imports and fix BootstrapDialog references

commit b2dcc3034fc638f58cdb59e96ab7d6e2435f634a
Author: Matias Arriola <matias.arriola@gmail.com>
Date:   Thu Dec 2 11:56:10 2021 -0300

    Add embedded test to mindplot playground

commit 08b514e1aa7b51c4df56b2b3cb7f28c191adeae7
Author: Matias Arriola <matias.arriola@gmail.com>
Date:   Thu Dec 2 10:27:31 2021 -0300

    Fix mindplot layout test

    Upgrade raphael to avoid error
    Load raphael from context-loader
This commit is contained in:
Paulo Gustavo Veiga 2021-12-05 15:50:37 -08:00
parent 830fbdaebc
commit 6ba917cf32
6 changed files with 19 additions and 18 deletions

View File

@ -798,7 +798,7 @@ class Designer extends Events {
const targetTopic = dmodel.findTopicById(targetTopicId); const targetTopic = dmodel.findTopicById(targetTopicId);
$assert( $assert(
targetTopic, targetTopic,
`targetTopic could not be found:${targetTopicId}${dmodel `targetTopic could not be found:${targetTopicId},${dmodel
.getTopics() .getTopics()
.map((e) => e.getId())}`, .map((e) => e.getId())}`,
); );

View File

@ -53,7 +53,7 @@ XMLSerializerFactory.getSerializerFromDocument = function (domDocument) {
* @param {String} version the version name * @param {String} version the version name
* @return serializer * @return serializer
*/ */
XMLSerializerFactory.getSerializer = function (version) { XMLSerializerFactory.getSerializer = function getSerializer(version) {
if (!$defined(version)) { if (!$defined(version)) {
version = ModelCodeName.BETA; version = ModelCodeName.BETA;
} }

View File

@ -55,7 +55,7 @@ class XMLSerializer_Beta {
const parent = topic.getParent(); const parent = topic.getParent();
if (parent == null || parent.getType() === INodeModel.CENTRAL_TOPIC_TYPE) { if (parent == null || parent.getType() === INodeModel.CENTRAL_TOPIC_TYPE) {
const pos = topic.getPosition(); const pos = topic.getPosition();
parentTopic.setAttribute('position', `${pos.x}${pos.y}`); parentTopic.setAttribute('position', `${pos.x},${pos.y}`);
} else { } else {
const order = topic.getOrder(); const order = topic.getOrder();
parentTopic.setAttribute('order', order); parentTopic.setAttribute('order', order);

View File

@ -63,7 +63,7 @@ class XMLSerializer_Pela {
&& mindmap.findNodeById(relationship.getToNode()) !== null && mindmap.findNodeById(relationship.getToNode()) !== null
) { ) {
// Isolated relationships are not persisted .... // Isolated relationships are not persisted ....
const relationDom = this._relationshipToXML(document, relationship); const relationDom = XMLSerializer_Pela._relationshipToXML(document, relationship);
mapElem.appendChild(relationDom); mapElem.appendChild(relationDom);
} }
} }
@ -80,7 +80,7 @@ class XMLSerializer_Pela {
parentTopic.setAttribute('central', 'true'); parentTopic.setAttribute('central', 'true');
} else { } else {
const pos = topic.getPosition(); const pos = topic.getPosition();
parentTopic.setAttribute('position', `${pos.x}${pos.y}`); parentTopic.setAttribute('position', `${pos.x},${pos.y}`);
const order = topic.getOrder(); const order = topic.getOrder();
if (typeof order === 'number' && Number.isFinite(order)) { parentTopic.setAttribute('order', order); } if (typeof order === 'number' && Number.isFinite(order)) { parentTopic.setAttribute('order', order); }
@ -98,7 +98,7 @@ class XMLSerializer_Pela {
if (shape === TopicShape.IMAGE) { if (shape === TopicShape.IMAGE) {
parentTopic.setAttribute( parentTopic.setAttribute(
'image', 'image',
`${topic.getImageSize().width}${topic.getImageSize().height `${topic.getImageSize().width},${topic.getImageSize().height
}:${topic.getImageUrl()}`, }:${topic.getImageUrl()}`,
); );
} }
@ -196,7 +196,7 @@ class XMLSerializer_Pela {
} }
} }
_relationshipToXML(document, relationship) { static _relationshipToXML(document, relationship) {
const result = document.createElement('relationship'); const result = document.createElement('relationship');
result.setAttribute('srcTopicId', relationship.getFromNode()); result.setAttribute('srcTopicId', relationship.getFromNode());
result.setAttribute('destTopicId', relationship.getToNode()); result.setAttribute('destTopicId', relationship.getToNode());
@ -208,14 +208,14 @@ class XMLSerializer_Pela {
const srcPoint = relationship.getSrcCtrlPoint(); const srcPoint = relationship.getSrcCtrlPoint();
result.setAttribute( result.setAttribute(
'srcCtrlPoint', 'srcCtrlPoint',
`${Math.round(srcPoint.x)}${Math.round(srcPoint.y)}`, `${Math.round(srcPoint.x)},${Math.round(srcPoint.y)}`,
); );
} }
if ($defined(relationship.getDestCtrlPoint())) { if ($defined(relationship.getDestCtrlPoint())) {
const destPoint = relationship.getDestCtrlPoint(); const destPoint = relationship.getDestCtrlPoint();
result.setAttribute( result.setAttribute(
'destCtrlPoint', 'destCtrlPoint',
`${Math.round(destPoint.x)}${Math.round(destPoint.y)}`, `${Math.round(destPoint.x)},${Math.round(destPoint.y)}`,
); );
} }
} }
@ -260,7 +260,7 @@ class XMLSerializer_Pela {
break; break;
} }
case 'relationship': { case 'relationship': {
const relationship = this._deserializeRelationship(child, mindmap); const relationship = XMLSerializer_Pela._deserializeRelationship(child, mindmap);
if (relationship != null) { if (relationship != null) {
mindmap.addRelationship(relationship); mindmap.addRelationship(relationship);
} }
@ -392,7 +392,7 @@ class XMLSerializer_Pela {
} }
// Has text node ?. // Has text node ?.
const textAttr = this._deserializeTextAttr(child); const textAttr = XMLSerializer_Pela._deserializeTextAttr(child);
if (textAttr) { if (textAttr) {
attributes.text = textAttr; attributes.text = textAttr;
} }
@ -402,7 +402,7 @@ class XMLSerializer_Pela {
const feature = TopicFeature.createModel(featureType, attributes); const feature = TopicFeature.createModel(featureType, attributes);
topic.addFeature(feature); topic.addFeature(feature);
} else if (child.tagName === 'text') { } else if (child.tagName === 'text') {
const nodeText = this._deserializeNodeText(child); const nodeText = XMLSerializer_Pela._deserializeNodeText(child);
topic.setText(nodeText); topic.setText(nodeText);
} }
} }
@ -410,7 +410,7 @@ class XMLSerializer_Pela {
return topic; return topic;
} }
_deserializeTextAttr(domElem) { static _deserializeTextAttr(domElem) {
let value = domElem.getAttribute('text'); let value = domElem.getAttribute('text');
if (!$defined(value)) { if (!$defined(value)) {
const children = domElem.childNodes; const children = domElem.childNodes;
@ -433,7 +433,7 @@ class XMLSerializer_Pela {
return value; return value;
} }
_deserializeNodeText(domElem) { static _deserializeNodeText(domElem) {
const children = domElem.childNodes; const children = domElem.childNodes;
let value = null; let value = null;
for (let i = 0; i < children.length; i++) { for (let i = 0; i < children.length; i++) {
@ -445,7 +445,7 @@ class XMLSerializer_Pela {
return value; return value;
} }
_deserializeRelationship(domElement, mindmap) { static _deserializeRelationship(domElement, mindmap) {
const srcId = domElement.getAttribute('srcTopicId'); const srcId = domElement.getAttribute('srcTopicId');
const destId = domElement.getAttribute('destTopicId'); const destId = domElement.getAttribute('destTopicId');
const lineType = domElement.getAttribute('lineType'); const lineType = domElement.getAttribute('lineType');
@ -485,6 +485,7 @@ class XMLSerializer_Pela {
* @param in The String whose non-valid characters we want to remove. * @param in The String whose non-valid characters we want to remove.
* @return The in String, stripped of non-valid characters. * @return The in String, stripped of non-valid characters.
*/ */
// eslint-disable-next-line class-methods-use-this
rmXmlInv(str) { rmXmlInv(str) {
if (str == null || str === undefined) return null; if (str == null || str === undefined) return null;

View File

@ -259,7 +259,7 @@ const TestSuite = new Class({
console.log( console.log(
`\tUpdated nodes: {id:${event.getId() `\tUpdated nodes: {id:${event.getId()
}, order: ${event.getOrder() }, order: ${event.getOrder()
}${posStr },${posStr
}}`, }}`,
); );
events.push(event); events.push(event);

View File

@ -112,12 +112,12 @@ class ElementPeer {
setSize(width, height) { setSize(width, height) {
if ($defined(width) && this._size.width !== parseInt(width, 10)) { if ($defined(width) && this._size.width !== parseInt(width, 10)) {
this._size.width = parseInt(width, 10); this._size.width = parseInt(width, 10);
this._native.setAttribute('width', parseInt(width, 10)); this._native.setAttribute('width', this._size.width);
} }
if ($defined(height) && this._size.height !== parseInt(height, 10)) { if ($defined(height) && this._size.height !== parseInt(height, 10)) {
this._size.height = parseInt(height, 10); this._size.height = parseInt(height, 10);
this._native.setAttribute('height', parseInt(height, 10)); this._native.setAttribute('height', this._size.height);
} }
EventUtils.broadcastChangeEvent(this, 'strokeStyle'); EventUtils.broadcastChangeEvent(this, 'strokeStyle');