UNPKG

soocrate-core

Version:

this is the core of soocrate application

1,449 lines (1,448 loc) 3.87 MB
{ "type": "File", "start": 0, "end": 15865, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 592, "column": 31 } }, "program": { "type": "Program", "start": 0, "end": 15865, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 592, "column": 31 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 2, "end": 40, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 38 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 9, "end": 15, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 13 } }, "local": { "type": "Identifier", "start": 9, "end": 15, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 13 }, "identifierName": "Marker" }, "name": "Marker" } } ], "source": { "type": "StringLiteral", "start": 21, "end": 40, "loc": { "start": { "line": 2, "column": 19 }, "end": { "line": 2, "column": 38 } }, "extra": { "rawValue": "../view/marker.js", "raw": "'../view/marker.js'" }, "value": "../view/marker.js" } }, { "type": "ExpressionStatement", "start": 44, "end": 66, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 22 } }, "expression": { "type": "AssignmentExpression", "start": 44, "end": 66, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 22 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 44, "end": 57, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 13 } }, "object": { "type": "Identifier", "start": 44, "end": 50, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 6 }, "identifierName": "window" }, "name": "window" }, "property": { "type": "Identifier", "start": 51, "end": 57, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 13 }, "identifierName": "Marker" }, "name": "Marker" }, "computed": false }, "right": { "type": "Identifier", "start": 60, "end": 66, "loc": { "start": { "line": 4, "column": 16 }, "end": { "line": 4, "column": 22 }, "identifierName": "Marker" }, "name": "Marker", "leadingComments": null, "trailingComments": null }, "trailingComments": null }, "trailingComments": [ { "type": "CommentBlock", "value": "*\r\n * EditorController this the link between the core functions and the interface.\r\n ", "start": 70, "end": 163, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 8, "column": 5 } } } ] }, { "type": "Identifier", "start": 167, "end": 15830, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 590, "column": 1 } }, "id": { "type": "Identifier", "start": 173, "end": 189, "loc": { "start": { "line": 10, "column": 6 }, "end": { "line": 10, "column": 22 }, "identifierName": "EditorController" }, "name": "EditorController", "leadingComments": null }, "superClass": null, "body": { "type": "ClassBody", "start": 190, "end": 15830, "loc": { "start": { "line": 10, "column": 23 }, "end": { "line": 590, "column": 1 } }, "body": [ { "type": "ClassMethod", "start": 393, "end": 2495, "loc": { "start": { "line": 18, "column": 2 }, "end": { "line": 105, "column": 3 } }, "static": false, "computed": false, "key": { "type": "Identifier", "start": 393, "end": 404, "loc": { "start": { "line": 18, "column": 2 }, "end": { "line": 18, "column": 13 }, "identifierName": "constructor" }, "name": "constructor", "leadingComments": null }, "kind": "constructor", "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 405, "end": 410, "loc": { "start": { "line": 18, "column": 14 }, "end": { "line": 18, "column": 19 }, "identifierName": "model" }, "name": "model" }, { "type": "Identifier", "start": 412, "end": 421, "loc": { "start": { "line": 18, "column": 21 }, "end": { "line": 18, "column": 30 }, "identifierName": "sessionID" }, "name": "sessionID" } ], "body": { "type": "BlockStatement", "start": 423, "end": 2495, "loc": { "start": { "line": 18, "column": 32 }, "end": { "line": 105, "column": 3 } }, "body": [ { "type": "ExpressionStatement", "start": 550, "end": 568, "loc": { "start": { "line": 25, "column": 4 }, "end": { "line": 25, "column": 22 } }, "expression": { "type": "AssignmentExpression", "start": 550, "end": 568, "loc": { "start": { "line": 25, "column": 4 }, "end": { "line": 25, "column": 22 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 550, "end": 560, "loc": { "start": { "line": 25, "column": 4 }, "end": { "line": 25, "column": 14 } }, "object": { "type": "ThisExpression", "start": 550, "end": 554, "loc": { "start": { "line": 25, "column": 4 }, "end": { "line": 25, "column": 8 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 555, "end": 560, "loc": { "start": { "line": 25, "column": 9 }, "end": { "line": 25, "column": 14 }, "identifierName": "model" }, "name": "model" }, "computed": false, "leadingComments": null }, "right": { "type": "Identifier", "start": 563, "end": 568, "loc": { "start": { "line": 25, "column": 17 }, "end": { "line": 25, "column": 22 }, "identifierName": "model" }, "name": "model", "leadingComments": null, "trailingComments": null }, "leadingComments": null, "trailingComments": null }, "leadingComments": [ { "type": "CommentBlock", "value": "*\r\n * this is the object that contains all proprieties of a document.\r\n * @type {[doc]}\r\n ", "start": 438, "end": 544, "loc": { "start": { "line": 21, "column": 4 }, "end": { "line": 24, "column": 7 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "*\r\n * markers contains all marks of the users: carets, avatars...\r\n * @type {Marker[]}\r\n ", "start": 575, "end": 677, "loc": { "start": { "line": 27, "column": 3 }, "end": { "line": 30, "column": 6 } } } ] }, { "type": "ExpressionStatement", "start": 683, "end": 699, "loc": { "start": { "line": 31, "column": 4 }, "end": { "line": 31, "column": 20 } }, "expression": { "type": "AssignmentExpression", "start": 683, "end": 699, "loc": { "start": { "line": 31, "column": 4 }, "end": { "line": 31, "column": 20 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 683, "end": 695, "loc": { "start": { "line": 31, "column": 4 }, "end": { "line": 31, "column": 16 } }, "object": { "type": "ThisExpression", "start": 683, "end": 687, "loc": { "start": { "line": 31, "column": 4 }, "end": { "line": 31, "column": 8 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 688, "end": 695, "loc": { "start": { "line": 31, "column": 9 }, "end": { "line": 31, "column": 16 }, "identifierName": "markers" }, "name": "markers" }, "computed": false, "leadingComments": null }, "right": { "type": "ObjectExpression", "start": 697, "end": 699, "loc": { "start": { "line": 31, "column": 18 }, "end": { "line": 31, "column": 20 } }, "properties": [], "leadingComments": null, "trailingComments": null }, "leadingComments": null, "trailingComments": null }, "leadingComments": [ { "type": "CommentBlock", "value": "*\r\n * markers contains all marks of the users: carets, avatars...\r\n * @type {Marker[]}\r\n ", "start": 575, "end": 677, "loc": { "start": { "line": 27, "column": 3 }, "end": { "line": 30, "column": 6 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "*\r\n * startimer A timer used for sending pings\r\n * @type {Timer}\r\n ", "start": 705, "end": 788, "loc": { "start": { "line": 32, "column": 4 }, "end": { "line": 35, "column": 7 } } } ] }, { "type": "ExpressionStatement", "start": 794, "end": 813, "loc": { "start": { "line": 36, "column": 4 }, "end": { "line": 36, "column": 23 } }, "expression": { "type": "AssignmentExpression", "start": 794, "end": 813, "loc": { "start": { "line": 36, "column": 4 }, "end": { "line": 36, "column": 23 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 794, "end": 809, "loc": { "start": { "line": 36, "column": 4 }, "end": { "line": 36, "column": 19 } }, "object": { "type": "ThisExpression", "start": 794, "end": 798, "loc": { "start": { "line": 36, "column": 4 }, "end": { "line": 36, "column": 8 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 799, "end": 809, "loc": { "start": { "line": 36, "column": 9 }, "end": { "line": 36, "column": 19 }, "identifierName": "startTimer" }, "name": "startTimer" }, "computed": false, "leadingComments": null }, "right": { "type": "ObjectExpression", "start": 811, "end": 813, "loc": { "start": { "line": 36, "column": 21 }, "end": { "line": 36, "column": 23 } }, "properties": [], "leadingComments": null, "trailingComments": null }, "leadingComments": null, "trailingComments": null }, "leadingComments": [ { "type": "CommentBlock", "value": "*\r\n * startimer A timer used for sending pings\r\n * @type {Timer}\r\n ", "start": 705, "end": 788, "loc": { "start": { "line": 32, "column": 4 }, "end": { "line": 35, "column": 7 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "*\r\n * ViewEditor the used editor, here it is Quill editor \r\n * @see https://quilljs.com/\r\n * @type {Quill}\r\n ", "start": 819, "end": 951, "loc": { "start": { "line": 37, "column": 4 }, "end": { "line": 41, "column": 7 } } } ] }, { "type": "ExpressionStatement", "start": 957, "end": 977, "loc": { "start": { "line": 42, "column": 4 }, "end": { "line": 42, "column": 24 } }, "expression": { "type": "AssignmentExpression", "start": 957, "end": 976, "loc": { "start": { "line": 42, "column": 4 }, "end": { "line": 42, "column": 23 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 957, "end": 972, "loc": { "start": { "line": 42, "column": 4 }, "end": { "line": 42, "column": 19 } }, "object": { "type": "ThisExpression", "start": 957, "end": 961, "loc": { "start": { "line": 42, "column": 4 }, "end": { "line": 42, "column": 8 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 962, "end": 972, "loc": { "start": { "line": 42, "column": 9 }, "end": { "line": 42, "column": 19 }, "identifierName": "viewEditor" }, "name": "viewEditor" }, "computed": false, "leadingComments": null }, "right": { "type": "ObjectExpression", "start": 974, "end": 976, "loc": { "start": { "line": 42, "column": 21 }, "end": { "line": 42, "column": 23 } }, "properties": [] }, "leadingComments": null }, "leadingComments": [ { "type": "CommentBlock", "value": "*\r\n * ViewEditor the used editor, here it is Quill editor \r\n * @see https://quilljs.com/\r\n * @type {Quill}\r\n ", "start": 819, "end": 951, "loc": { "start": { "line": 37, "column": 4 }, "end": { "line": 41, "column": 7 } } } ] }, { "type": "ExpressionStatement", "start": 987, "end": 1006, "loc": { "start": { "line": 45, "column": 4 }, "end": { "line": 45, "column": 23 } }, "expression": { "type": "CallExpression", "start": 987, "end": 1006, "loc": { "start": { "line": 45, "column": 4 }, "end": { "line": 45, "column": 23 } }, "callee": { "type": "MemberExpression", "start": 987, "end": 1004, "loc": { "start": { "line": 45, "column": 4 }, "end": { "line": 45, "column": 21 } }, "object": { "type": "ThisExpression", "start": 987, "end": 991, "loc": { "start": { "line": 45, "column": 4 }, "end": { "line": 45, "column": 8 } } }, "property": { "type": "Identifier", "start": 992, "end": 1004, "loc": { "start": { "line": 45, "column": 9 }, "end": { "line": 45, "column": 21 }, "identifierName": "loadDocument" }, "name": "loadDocument" }, "computed": false }, "arguments": [] } }, { "type": "VariableDeclaration", "start": 1014, "end": 1060, "loc": { "start": { "line": 47, "column": 4 }, "end": { "line": 47, "column": 50 } }, "declarations": [ { "type": "VariableDeclarator", "start": 1018, "end": 1060, "loc": { "start": { "line": 47, "column": 8 }, "end": { "line": 47, "column": 50 } }, "id": { "type": "Identifier", "start": 1018, "end": 1028, "loc": { "start": { "line": 47, "column": 8 }, "end": { "line": 47, "column": 18 }, "identifierName": "commentOpt" }, "name": "commentOpt" }, "init": { "type": "MemberExpression", "start": 1031, "end": 1060, "loc": { "start": { "line": 47, "column": 21 }, "end": { "line": 47, "column": 50 } }, "object": { "type": "MemberExpression", "start": 1031, "end": 1052, "loc": { "start": { "line": 47, "column": 21 }, "end": { "line": 47, "column": 42 } }, "object": { "type": "MemberExpression", "start": 1031, "end": 1044, "loc": { "start": { "line": 47, "column": 21 }, "end": { "line": 47, "column": 34 } }, "object": { "type": "Identifier", "start": 1031, "end": 1036, "loc": { "start": { "line": 47, "column": 21 }, "end": { "line": 47, "column": 26 }, "identifierName": "quill" }, "name": "quill" }, "property": { "type": "Identifier", "start": 1037, "end": 1044, "loc": { "start": { "line": 47, "column": 27 }, "end": { "line": 47, "column": 34 }, "identifierName": "options" }, "name": "options" }, "computed": false }, "property": { "type": "Identifier", "start": 1045, "end": 1052, "loc": { "start": { "line": 47, "column": 35 }, "end": { "line": 47, "column": 42 }, "identifierName": "modules" }, "name": "modules" }, "computed": false }, "property": { "type": "Identifier", "start": 1053, "end": 1060, "loc": { "start": { "line": 47, "column": 43 }, "end": { "line": 47, "column": 50 }, "identifierName": "comment" }, "name": "comment" }, "computed": false } } ], "kind": "let" }, { "type": "ExpressionStatement", "start": 1068, "end": 1117, "loc": { "start": { "line": 49, "column": 4 }, "end": { "line": 49, "column": 53 } }, "expression": { "type": "AssignmentExpression", "start": 1068, "end": 1117, "loc": { "start": { "line": 49, "column": 4 }, "end": { "line": 49, "column": 53 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 1068, "end": 1091, "loc": { "start": { "line": 49, "column": 4 }, "end": { "line": 49, "column": 27 } }, "object": { "type": "Identifier", "start": 1068, "end": 1078, "loc": { "start": { "line": 49, "column": 4 }, "end": { "line": 49, "column": 14 }, "identifierName": "commentOpt" }, "name": "commentOpt" }, "property": { "type": "Identifier", "start": 1079, "end": 1091, "loc": { "start": { "line": 49, "column": 15 }, "end": { "line": 49, "column": 27 }, "identifierName": "commentAddOn" }, "name": "commentAddOn" }, "computed": false }, "right": { "type": "MemberExpression", "start": 1094, "end": 1117, "loc": { "start": { "line": 49, "column": 30 }, "end": { "line": 49, "column": 53 } }, "object": { "type": "MemberExpression", "start": 1094, "end": 1110, "loc": { "start": { "line": 49, "column": 30 }, "end": { "line": 49, "column": 46 } }, "object": { "type": "MemberExpression", "start": 1094, "end": 1106, "loc": { "start": { "line": 49, "column": 30 }, "end": { "line": 49, "column": 42 } }, "object": { "type": "ThisExpression", "start": 1094, "end": 1098, "loc": { "start": { "line": 49, "column": 30 }, "end": { "line": 49, "column": 34 } } }, "property": { "type": "Identifier", "start": 1099, "end": 1106, "loc": { "start": { "line": 49, "column": 35 }, "end": { "line": 49, "column": 42 }, "identifierName": "markers" }, "name": "markers" }, "computed": false }, "property": { "type": "Identifier", "start": 1107, "end": 1109, "loc": { "start": { "line": 49, "column": 43 }, "end": { "line": 49, "column": 45 }, "identifierName": "id" }, "name": "id" }, "computed": true }, "property": { "type": "Identifier", "start": 1111, "end": 1117, "loc": { "start": { "line": 49, "column": 47 }, "end": { "line": 49, "column": 53 }, "identifierName": "animal" }, "name": "animal" }, "computed": false } } }, { "type": "ExpressionStatement", "start": 1123, "end": 1166, "loc": { "start": { "line": 50, "column": 4 }, "end": { "line": 50, "column": 47 } }, "expression": { "type": "AssignmentExpression", "start": 1123, "end": 1166, "loc": { "start": { "line": 50, "column": 4 }, "end": { "line": 50, "column": 47 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 1123, "end": 1149, "loc": { "start": { "line": 50, "column": 4 }, "end": { "line": 50, "column": 30 } }, "object": { "type": "Identifier", "start": 1123, "end": 1133, "loc": { "start": { "line": 50, "column": 4 }, "end": { "line": 50, "column": 14 }, "identifierName": "commentOpt" }, "name": "commentOpt" }, "property": { "type": "Identifier", "start": 1134, "end": 1149, "loc": { "start": { "line": 50, "column": 15 }, "end": { "line": 50, "column": 30 }, "identifierName": "commentAuthorId" }, "name": "commentAuthorId" }, "computed": false }, "right": { "type": "MemberExpression", "start": 1152, "end": 1166, "loc": { "start": { "line": 50, "column": 33 }, "end": { "line": 50, "column": 47 } }, "object": { "type": "MemberExpression", "start": 1152, "end": 1162, "loc": { "start": { "line": 50, "column": 33 }, "end": { "line": 50, "column": 43 } }, "object": { "type": "ThisExpression", "start": 1152, "end": 1156, "loc": { "start": { "line": 50, "column": 33 }, "end": { "line": 50, "column": 37 } } }, "property": { "type": "Identifier",