soocrate-core
Version:
this is the core of soocrate application
1,464 lines (1,463 loc) • 1.29 MB
JSON
{
"type": "File",
"start": 0,
"end": 6420,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 216,
"column": 22
}
},
"program": {
"type": "Program",
"start": 0,
"end": 6420,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 216,
"column": 22
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 0,
"end": 30,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 30
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 7,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 14
}
},
"local": {
"type": "Identifier",
"start": 7,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 14
},
"identifierName": "animals"
},
"name": "animals"
}
}
],
"source": {
"type": "StringLiteral",
"start": 20,
"end": 29,
"loc": {
"start": {
"line": 1,
"column": 20
},
"end": {
"line": 1,
"column": 29
}
},
"extra": {
"rawValue": "animals",
"raw": "'animals'"
},
"value": "animals"
}
},
{
"type": "ImportDeclaration",
"start": 32,
"end": 63,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 31
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 39,
"end": 43,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 11
}
},
"local": {
"type": "Identifier",
"start": 39,
"end": 43,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 11
},
"identifierName": "hash"
},
"name": "hash"
}
}
],
"source": {
"type": "StringLiteral",
"start": 49,
"end": 62,
"loc": {
"start": {
"line": 2,
"column": 17
},
"end": {
"line": 2,
"column": 30
}
},
"extra": {
"rawValue": "string-hash",
"raw": "'string-hash'"
},
"value": "string-hash"
},
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\r\n * Marker is class for managing the marker of one user,it includes the caret, avatar, and pseudo Names.\r\n ",
"start": 71,
"end": 184,
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 8,
"column": 3
}
}
}
]
},
{
"type": "Identifier",
"start": 188,
"end": 6394,
"loc": {
"start": {
"line": 10,
"column": 0
},
"end": {
"line": 214,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 194,
"end": 200,
"loc": {
"start": {
"line": 10,
"column": 6
},
"end": {
"line": 10,
"column": 12
},
"identifierName": "Marker"
},
"name": "Marker",
"leadingComments": null
},
"superClass": null,
"body": {
"type": "ClassBody",
"start": 201,
"end": 6394,
"loc": {
"start": {
"line": 10,
"column": 13
},
"end": {
"line": 214,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 922,
"end": 2873,
"loc": {
"start": {
"line": 21,
"column": 2
},
"end": {
"line": 97,
"column": 3
}
},
"static": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 922,
"end": 933,
"loc": {
"start": {
"line": 21,
"column": 2
},
"end": {
"line": 21,
"column": 13
},
"identifierName": "constructor"
},
"name": "constructor",
"leadingComments": null
},
"kind": "constructor",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 934,
"end": 940,
"loc": {
"start": {
"line": 21,
"column": 14
},
"end": {
"line": 21,
"column": 20
},
"identifierName": "origin"
},
"name": "origin"
},
{
"type": "AssignmentPattern",
"start": 942,
"end": 955,
"loc": {
"start": {
"line": 21,
"column": 22
},
"end": {
"line": 21,
"column": 35
}
},
"left": {
"type": "Identifier",
"start": 942,
"end": 950,
"loc": {
"start": {
"line": 21,
"column": 22
},
"end": {
"line": 21,
"column": 30
},
"identifierName": "lifeTime"
},
"name": "lifeTime"
},
"right": {
"type": "UnaryExpression",
"start": 953,
"end": 955,
"loc": {
"start": {
"line": 21,
"column": 33
},
"end": {
"line": 21,
"column": 35
}
},
"operator": "-",
"prefix": true,
"argument": {
"type": "NumericLiteral",
"start": 954,
"end": 955,
"loc": {
"start": {
"line": 21,
"column": 34
},
"end": {
"line": 21,
"column": 35
}
},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
},
"extra": {
"parenthesizedArgument": false
}
}
},
{
"type": "Identifier",
"start": 957,
"end": 962,
"loc": {
"start": {
"line": 21,
"column": 37
},
"end": {
"line": 21,
"column": 42
},
"identifierName": "range"
},
"name": "range"
},
{
"type": "Identifier",
"start": 964,
"end": 972,
"loc": {
"start": {
"line": 21,
"column": 44
},
"end": {
"line": 21,
"column": 52
},
"identifierName": "cursorsp"
},
"name": "cursorsp"
},
{
"type": "Identifier",
"start": 974,
"end": 980,
"loc": {
"start": {
"line": 21,
"column": 54
},
"end": {
"line": 21,
"column": 60
},
"identifierName": "cursor"
},
"name": "cursor"
},
{
"type": "AssignmentPattern",
"start": 982,
"end": 996,
"loc": {
"start": {
"line": 21,
"column": 62
},
"end": {
"line": 21,
"column": 76
}
},
"left": {
"type": "Identifier",
"start": 982,
"end": 988,
"loc": {
"start": {
"line": 21,
"column": 62
},
"end": {
"line": 21,
"column": 68
},
"identifierName": "isItME"
},
"name": "isItME"
},
"right": {
"type": "BooleanLiteral",
"start": 991,
"end": 996,
"loc": {
"start": {
"line": 21,
"column": 71
},
"end": {
"line": 21,
"column": 76
}
},
"value": false
}
}
],
"body": {
"type": "BlockStatement",
"start": 998,
"end": 2873,
"loc": {
"start": {
"line": 21,
"column": 78
},
"end": {
"line": 97,
"column": 3
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 1085,
"end": 1106,
"loc": {
"start": {
"line": 26,
"column": 4
},
"end": {
"line": 26,
"column": 25
}
},
"expression": {
"type": "AssignmentExpression",
"start": 1085,
"end": 1105,
"loc": {
"start": {
"line": 26,
"column": 4
},
"end": {
"line": 26,
"column": 24
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 1085,
"end": 1096,
"loc": {
"start": {
"line": 26,
"column": 4
},
"end": {
"line": 26,
"column": 15
}
},
"object": {
"type": "ThisExpression",
"start": 1085,
"end": 1089,
"loc": {
"start": {
"line": 26,
"column": 4
},
"end": {
"line": 26,
"column": 8
}
},
"leadingComments": null
},
"property": {
"type": "Identifier",
"start": 1090,
"end": 1096,
"loc": {
"start": {
"line": 26,
"column": 9
},
"end": {
"line": 26,
"column": 15
},
"identifierName": "origin"
},
"name": "origin"
},
"computed": false,
"leadingComments": null
},
"right": {
"type": "Identifier",
"start": 1099,
"end": 1105,
"loc": {
"start": {
"line": 26,
"column": 18
},
"end": {
"line": 26,
"column": 24
},
"identifierName": "origin"
},
"name": "origin"
},
"leadingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\r\n * origin the id of the the user\r\n * @type {[type]}\r\n ",
"start": 1005,
"end": 1079,
"loc": {
"start": {
"line": 22,
"column": 4
},
"end": {
"line": 25,
"column": 7
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\r\n * lifeTime After this time, if no ping or Caret position is received => \r\n * remove caret and avatar. if lifetime is -1 we don't add the avatar\r\n * @type {[type]}\r\n ",
"start": 1114,
"end": 1301,
"loc": {
"start": {
"line": 28,
"column": 4
},
"end": {
"line": 32,
"column": 7
}
}
}
]
},
{
"type": "ExpressionStatement",
"start": 1307,
"end": 1332,
"loc": {
"start": {
"line": 33,
"column": 4
},
"end": {
"line": 33,
"column": 29
}
},
"expression": {
"type": "AssignmentExpression",
"start": 1307,
"end": 1331,
"loc": {
"start": {
"line": 33,
"column": 4
},
"end": {
"line": 33,
"column": 28
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 1307,
"end": 1320,
"loc": {
"start": {
"line": 33,
"column": 4
},
"end": {
"line": 33,
"column": 17
}
},
"object": {
"type": "ThisExpression",
"start": 1307,
"end": 1311,
"loc": {
"start": {
"line": 33,
"column": 4
},
"end": {
"line": 33,
"column": 8
}
},
"leadingComments": null
},
"property": {
"type": "Identifier",
"start": 1312,
"end": 1320,
"loc": {
"start": {
"line": 33,
"column": 9
},
"end": {
"line": 33,
"column": 17
},
"identifierName": "lifeTime"
},
"name": "lifeTime"
},
"computed": false,
"leadingComments": null
},
"right": {
"type": "Identifier",
"start": 1323,
"end": 1331,
"loc": {
"start": {
"line": 33,
"column": 20
},
"end": {
"line": 33,
"column": 28
},
"identifierName": "lifeTime"
},
"name": "lifeTime"
},
"leadingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\r\n * lifeTime After this time, if no ping or Caret position is received => \r\n * remove caret and avatar. if lifetime is -1 we don't add the avatar\r\n * @type {[type]}\r\n ",
"start": 1114,
"end": 1301,
"loc": {
"start": {
"line": 28,
"column": 4
},
"end": {
"line": 32,
"column": 7
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\r\n * used to store last update time to detected outdated users\r\n * @type {Date}\r\n ",
"start": 1340,
"end": 1439,
"loc": {
"start": {
"line": 35,
"column": 4
},
"end": {
"line": 38,
"column": 7
}
}
}
]
},
{
"type": "ExpressionStatement",
"start": 1445,
"end": 1478,
"loc": {
"start": {
"line": 39,
"column": 4
},
"end": {
"line": 39,
"column": 37
}
},
"expression": {
"type": "AssignmentExpression",
"start": 1445,
"end": 1477,
"loc": {
"start": {
"line": 39,
"column": 4
},
"end": {
"line": 39,
"column": 36
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 1445,
"end": 1454,
"loc": {
"start": {
"line": 39,
"column": 4
},
"end": {
"line": 39,
"column": 13
}
},
"object": {
"type": "ThisExpression",
"start": 1445,
"end": 1449,
"loc": {
"start": {
"line": 39,
"column": 4
},
"end": {
"line": 39,
"column": 8
}
},
"leadingComments": null
},
"property": {
"type": "Identifier",
"start": 1450,
"end": 1454,
"loc": {
"start": {
"line": 39,
"column": 9
},
"end": {
"line": 39,
"column": 13
},
"identifierName": "time"
},
"name": "time"
},
"computed": false,
"leadingComments": null
},
"right": {
"type": "CallExpression",
"start": 1457,
"end": 1477,
"loc": {
"start": {
"line": 39,
"column": 16
},
"end": {
"line": 39,
"column": 36
}
},
"callee": {
"type": "MemberExpression",
"start": 1457,
"end": 1475,
"loc": {
"start": {
"line": 39,
"column": 16
},
"end": {
"line": 39,
"column": 34
}
},
"object": {
"type": "NewExpression",
"start": 1457,
"end": 1467,
"loc": {
"start": {
"line": 39,
"column": 16
},
"end": {
"line": 39,
"column": 26
}
},
"callee": {
"type": "Identifier",
"start": 1461,
"end": 1465,
"loc": {
"start": {
"line": 39,
"column": 20
},
"end": {
"line": 39,
"column": 24
},
"identifierName": "Date"
},
"name": "Date"
},
"arguments": []
},
"property": {
"type": "Identifier",
"start": 1468,
"end": 1475,
"loc": {
"start": {
"line": 39,
"column": 27
},
"end": {
"line": 39,
"column": 34
},
"identifierName": "getTime"
},
"name": "getTime"
},
"computed": false
},
"arguments": []
},
"leadingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\r\n * used to store last update time to detected outdated users\r\n * @type {Date}\r\n ",
"start": 1340,
"end": 1439,
"loc": {
"start": {
"line": 35,
"column": 4
},
"end": {
"line": 38,
"column": 7
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\r\n * color r,g,b\r\n * @type {String}\r\n ",
"start": 1486,
"end": 1541,
"loc": {
"start": {
"line": 41,
"column": 4
},
"end": {
"line": 44,
"column": 7
}
}
}
]
},
{
"type": "ExpressionStatement",
"start": 1547,
"end": 1587,
"loc": {
"start": {
"line": 45,
"column": 4
},
"end": {
"line": 45,
"column": 44
}
},
"expression": {
"type": "AssignmentExpression",
"start": 1547,
"end": 1586,
"loc": {
"start": {
"line": 45,
"column": 4
},
"end": {
"line": 45,
"column": 43
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 1547,
"end": 1557,
"loc": {
"start": {
"line": 45,
"column": 4
},
"end": {
"line": 45,
"column": 14
}
},
"object": {
"type": "ThisExpression",
"start": 1547,
"end": 1551,
"loc": {
"start": {
"line": 45,
"column": 4
},
"end": {
"line": 45,
"column": 8
}
},
"leadingComments": null
},
"property": {
"type": "Identifier",
"start": 1552,
"end": 1557,
"loc": {
"start": {
"line": 45,
"column": 9
},
"end": {
"line": 45,
"column": 14
},
"identifierName": "color"
},
"name": "color"
},
"computed": false,
"leadingComments": null
},
"right": {
"type": "CallExpression",
"start": 1560,
"end": 1586,
"loc": {
"start": {
"line": 45,
"column": 17
},
"end": {
"line": 45,
"column": 43
}
},
"callee": {
"type": "MemberExpression",
"start": 1560,
"end": 1573,
"loc": {
"start": {
"line": 45,
"column": 17
},
"end": {
"line": 45,
"column": 30
}
},
"object": {
"type": "ThisExpression",
"start": 1560,
"end": 1564,
"loc": {
"start": {
"line": 45,
"column": 17
},
"end": {
"line": 45,
"column": 21
}
}
},
"property": {
"type": "Identifier",
"start": 1565,
"end": 1573,
"loc": {
"start": {
"line": 45,
"column": 22
},
"end": {
"line": 45,
"column": 30
},
"identifierName": "getColor"
},
"name": "getColor"
},
"computed": false
},
"arguments": [
{
"type": "MemberExpression",
"start": 1574,
"end": 1585,
"loc": {
"start": {
"line": 45,
"column": 31
},
"end": {
"line": 45,
"column": 42
}
},
"object": {
"type": "ThisExpression",
"start": 1574,
"end": 1578,
"loc": {
"start": {
"line": 45,
"column": 31
},
"end": {
"line": 45,
"column": 35
}
}
},
"property": {
"type": "Identifier",
"start": 1579,
"end": 1585,
"loc": {
"start": {
"line": 45,
"column": 36
},
"end": {
"line": 45,
"column": 42
},
"identifierName": "origin"
},
"name": "origin"
},
"computed": false
}
]
},
"leadingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\r\n * color r,g,b\r\n * @type {String}\r\n ",
"start": 1486,
"end": 1541,
"loc": {
"start": {
"line": 41,
"column": 4
},
"end": {
"line": 44,
"column": 7
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\r\n * color rgb(r,g,b)\r\n * @type {String}\r\n ",
"start": 1595,
"end": 1655,
"loc": {
"start": {
"line": 47,
"column": 4
},
"end": {
"line": 50,
"column": 7
}
}
}
]
},
{
"type": "ExpressionStatement",
"start": 1661,
"end": 1703,
"loc": {
"start": {
"line": 51,
"column": 4
},
"end": {
"line": 51,
"column": 46
}
},
"expression": {
"type": "AssignmentExpression",
"start": 1661,
"end": 1702,
"loc": {
"start": {
"line": 51,
"column": 4
},
"end": {
"line": 51,
"column": 45
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 1661,
"end": 1674,
"loc": {
"start": {
"line": 51,
"column": 4
},
"end": {
"line": 51,
"column": 17
}
},
"object": {
"type": "ThisExpression",
"start": 1661,
"end": 1665,
"loc": {
"start": {
"line": 51,
"column": 4
},
"end": {
"line": 51,
"column": 8
}
},
"leadingComments": null
},
"property": {
"type": "Identifier",
"start": 1666,
"end": 1674,
"loc": {
"start": {
"line": 51,
"column": 9
},
"end": {
"line": 51,
"column": 17
},
"identifierName": "colorRGB"
},
"name": "colorRGB"
},
"computed": false,
"leadingComments": null
},
"right": {
"type": "BinaryExpression",
"start": 1677,
"end": 1702,
"loc": {
"start": {
"line": 51,
"column": 20
},
"end": {
"line": 51,
"column": 45
}
},
"left": {
"type": "BinaryExpression",
"start": 1677,
"end": 1696,
"loc": {
"start": {
"line": 51,
"column": 20
},
"end": {
"line": 51,
"column": 39
}
},
"left": {
"type": "StringLiteral",
"start": 1677,
"end": 1683,
"loc": {
"start": {
"line": 51,
"column": 20
},
"end": {
"line": 51,
"column": 26
}
},
"extra": {
"rawValue": "rgb(",
"raw": "'rgb('"
},
"value": "rgb("
},
"operator": "+",
"right": {
"type": "MemberExpression",
"start": 1686,
"end": 1696,
"loc": {
"start": {
"line": 51,
"column": 29
},
"end": {
"line": 51,
"column": 39
}
},
"object": {
"type": "ThisExpression",
"start": 1686,
"end": 1690,
"loc": {
"start": {
"line": 51,
"column": 29
},
"end": {
"line": 51,
"column": 33
}
}
},
"property": {
"type": "Identifier",
"start": 1691,
"end": 1696,
"loc": {
"start": {
"line": 51,
"column": 34
},
"end": {
"line": 51,
"column": 39
},
"identifierName": "color"
},
"name": "color"
},
"computed": false
}
},
"operator": "+",
"right": {
"type": "StringLiteral",
"start": 1699,
"end": 1702,
"loc": {
"start": {
"line": 51,
"column": 42
},
"end": {
"line": 51,
"column": 45
}
},
"extra": {
"rawValue": ")",
"raw": "')'"
},
"value": ")"
}
},
"leadingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\r\n * color rgb(r,g,b)\r\n * @type {String}\r\n ",
"start": 1595,
"end": 1655,
"loc": {
"start": {
"line": 47,
"column": 4
},
"end": {
"line": 50,
"column": 7
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\r\n * color rgba(r,g,b,0.5)\r\n * @type {String}\r\n ",
"start": 1711,
"end": 1777,
"loc": {
"start": {
"line": 53,
"column": 4
},
"end": {
"line": 56,
"column": 7
}
}
}
]
},
{
"type": "ExpressionStatement",
"start": 1783,
"end": 1836,
"loc": {
"start": {
"line": 57,
"column": 4
},
"end": {
"line": 57,
"column": 57
}
},
"expression": {
"type": "AssignmentExpression",
"start": 1783,
"end": 1835,
"loc": {
"start": {
"line": 57,
"column": 4
},
"end": {
"line": 57,
"column": 56
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 1783,
"end": 1801,
"loc": {
"start": {
"line": 57,
"column": 4
},
"end": {
"line": 57,
"column": 22
}
},
"object": {
"type": "ThisExpression",
"start": 1783,