linny-r 1.2.1 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/console.js +139 -7
- package/package.json +2 -2
- package/server.js +15 -11
- package/static/images/paperclip.png +0 -0
- package/static/images/paste.png +0 -0
- package/static/index.html +40 -8
- package/static/linny-r.css +97 -19
- package/static/scripts/linny-r-ctrl.js +22 -4
- package/static/scripts/linny-r-gui.js +723 -140
- package/static/scripts/linny-r-model.js +185 -29
- package/static/scripts/linny-r-utils.js +49 -11
- package/static/scripts/linny-r-vm.js +32 -20
@@ -12,7 +12,7 @@ file all have their graphical extensions in file linny-r-gui.js.
|
|
12
12
|
*/
|
13
13
|
|
14
14
|
/*
|
15
|
-
Copyright (c) 2017-
|
15
|
+
Copyright (c) 2017-2023 Delft University of Technology
|
16
16
|
|
17
17
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
18
18
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -290,15 +290,32 @@ class Controller {
|
|
290
290
|
validName(name) {
|
291
291
|
// Returns TRUE if `name` is a valid Linny-R entity name. These names
|
292
292
|
// must not be empty strings, may not contain brackets, backslashes or
|
293
|
-
// vertical bars,
|
294
|
-
//
|
293
|
+
// vertical bars, may not end with a colon, and must start with an
|
294
|
+
// underscore, a letter or a digit. This is enforced mainly to
|
295
|
+
// preclude parsing issues with variable names
|
295
296
|
// NOTE: normalize to also accept letters with accents
|
296
297
|
if(name === this.TOP_CLUSTER_NAME) return true;
|
297
298
|
name = name.normalize('NFKD').trim();
|
298
|
-
return name && !name.match(/\[\\\|\]/) &&
|
299
|
+
return name && !name.match(/\[\\\|\]/) && !name.endsWith(':') &&
|
299
300
|
(name.startsWith(this.BLACK_BOX) || name[0].match(/[\w]/));
|
300
301
|
}
|
301
302
|
|
303
|
+
prefixesAndName(name) {
|
304
|
+
// Returns name split exclusively at '[non-space]: [non-space]'
|
305
|
+
const
|
306
|
+
s = name.split(this.PREFIXER),
|
307
|
+
pan = [s[0]];
|
308
|
+
for(let i = 1; i < s.length; i++) {
|
309
|
+
const j = pan.length - 1;
|
310
|
+
if(s[i].startsWith(' ') || (i > 0 && pan[j].endsWith(' '))) {
|
311
|
+
pan[j] += s[i];
|
312
|
+
} else {
|
313
|
+
pan.push(s[i]);
|
314
|
+
}
|
315
|
+
}
|
316
|
+
return pan;
|
317
|
+
}
|
318
|
+
|
302
319
|
nameToID(name) {
|
303
320
|
// Returns a name in lower case with link arrow replaced by three
|
304
321
|
// underscores, constraint link arrow by four underscores, and spaces
|
@@ -466,6 +483,7 @@ class Controller {
|
|
466
483
|
rotatingIcon() {}
|
467
484
|
setProgressNeedle() {}
|
468
485
|
updateTimeStep() {}
|
486
|
+
updateIssuePanel() {}
|
469
487
|
updateDraggableDialogs() {}
|
470
488
|
logHeapSize() {}
|
471
489
|
|