UNPKG

soocrate-core

Version:

this is the core of soocrate application

1,450 lines (1,449 loc) 772 kB
{ "type": "File", "start": 0, "end": 2851, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 78, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 2851, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 78, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 23, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 23 } }, "specifiers": [], "source": { "type": "StringLiteral", "start": 7, "end": 22, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 22 } }, "extra": { "rawValue": "jquery-qrcode", "raw": "'jquery-qrcode'" }, "value": "jquery-qrcode" } }, { "type": "Identifier", "start": 27, "end": 2481, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 66, "column": 1 } }, "id": { "type": "Identifier", "start": 36, "end": 48, "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 21 }, "identifierName": "StatesHeader" }, "name": "StatesHeader" }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 49, "end": 54, "loc": { "start": { "line": 3, "column": 22 }, "end": { "line": 3, "column": 27 }, "identifierName": "model" }, "name": "model" }, { "type": "Identifier", "start": 56, "end": 66, "loc": { "start": { "line": 3, "column": 29 }, "end": { "line": 3, "column": 39 }, "identifierName": "statesView" }, "name": "statesView" }, { "type": "Identifier", "start": 68, "end": 76, "loc": { "start": { "line": 3, "column": 41 }, "end": { "line": 3, "column": 49 }, "identifierName": "linkView" }, "name": "linkView" }, { "type": "Identifier", "start": 78, "end": 87, "loc": { "start": { "line": 3, "column": 51 }, "end": { "line": 3, "column": 60 }, "identifierName": "shareView" }, "name": "shareView" } ], "body": { "type": "BlockStatement", "start": 88, "end": 2481, "loc": { "start": { "line": 3, "column": 61 }, "end": { "line": 66, "column": 1 } }, "body": [ { "type": "VariableDeclaration", "start": 95, "end": 111, "loc": { "start": { "line": 4, "column": 4 }, "end": { "line": 4, "column": 20 } }, "declarations": [ { "type": "VariableDeclarator", "start": 99, "end": 110, "loc": { "start": { "line": 4, "column": 8 }, "end": { "line": 4, "column": 19 } }, "id": { "type": "Identifier", "start": 99, "end": 103, "loc": { "start": { "line": 4, "column": 8 }, "end": { "line": 4, "column": 12 }, "identifierName": "self" }, "name": "self" }, "init": { "type": "ThisExpression", "start": 106, "end": 110, "loc": { "start": { "line": 4, "column": 15 }, "end": { "line": 4, "column": 19 } } } } ], "kind": "var" }, { "type": "ExpressionStatement", "start": 117, "end": 136, "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 5, "column": 23 } }, "expression": { "type": "AssignmentExpression", "start": 117, "end": 135, "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 5, "column": 22 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 117, "end": 127, "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 5, "column": 14 } }, "object": { "type": "ThisExpression", "start": 117, "end": 121, "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 5, "column": 8 } } }, "property": { "type": "Identifier", "start": 122, "end": 127, "loc": { "start": { "line": 5, "column": 9 }, "end": { "line": 5, "column": 14 }, "identifierName": "model" }, "name": "model" }, "computed": false }, "right": { "type": "Identifier", "start": 130, "end": 135, "loc": { "start": { "line": 5, "column": 17 }, "end": { "line": 5, "column": 22 }, "identifierName": "model" }, "name": "model" } } }, { "type": "ExpressionStatement", "start": 142, "end": 171, "loc": { "start": { "line": 6, "column": 4 }, "end": { "line": 6, "column": 33 } }, "expression": { "type": "AssignmentExpression", "start": 142, "end": 170, "loc": { "start": { "line": 6, "column": 4 }, "end": { "line": 6, "column": 32 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 142, "end": 157, "loc": { "start": { "line": 6, "column": 4 }, "end": { "line": 6, "column": 19 } }, "object": { "type": "ThisExpression", "start": 142, "end": 146, "loc": { "start": { "line": 6, "column": 4 }, "end": { "line": 6, "column": 8 } } }, "property": { "type": "Identifier", "start": 147, "end": 157, "loc": { "start": { "line": 6, "column": 9 }, "end": { "line": 6, "column": 19 }, "identifierName": "statesView" }, "name": "statesView" }, "computed": false }, "right": { "type": "Identifier", "start": 160, "end": 170, "loc": { "start": { "line": 6, "column": 22 }, "end": { "line": 6, "column": 32 }, "identifierName": "statesView" }, "name": "statesView" } } }, { "type": "ExpressionStatement", "start": 179, "end": 245, "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 8, "column": 70 } }, "expression": { "type": "AssignmentExpression", "start": 179, "end": 244, "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 8, "column": 69 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 179, "end": 200, "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 8, "column": 25 } }, "object": { "type": "ThisExpression", "start": 179, "end": 183, "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 8, "column": 8 } } }, "property": { "type": "Identifier", "start": 184, "end": 200, "loc": { "start": { "line": 8, "column": 9 }, "end": { "line": 8, "column": 25 }, "identifierName": "startSharingText" }, "name": "startSharingText" }, "computed": false }, "right": { "type": "StringLiteral", "start": 203, "end": 244, "loc": { "start": { "line": 8, "column": 28 }, "end": { "line": 8, "column": 69 } }, "extra": { "rawValue": "<i class=\"fa fa-link fa-2x ficon2\"></i>", "raw": "'<i class=\"fa fa-link fa-2x ficon2\"></i>'" }, "value": "<i class=\"fa fa-link fa-2x ficon2\"></i>" } } }, { "type": "ExpressionStatement", "start": 251, "end": 294, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 47 } }, "expression": { "type": "AssignmentExpression", "start": 251, "end": 293, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 46 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 251, "end": 275, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 28 } }, "object": { "type": "ThisExpression", "start": 251, "end": 255, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 8 } } }, "property": { "type": "Identifier", "start": 256, "end": 275, "loc": { "start": { "line": 9, "column": 9 }, "end": { "line": 9, "column": 28 }, "identifierName": "startSharingTooltip" }, "name": "startSharingTooltip" }, "computed": false }, "right": { "type": "StringLiteral", "start": 278, "end": 293, "loc": { "start": { "line": 9, "column": 31 }, "end": { "line": 9, "column": 46 } }, "extra": { "rawValue": "start sharing", "raw": "'start sharing'" }, "value": "start sharing" } } }, { "type": "ExpressionStatement", "start": 300, "end": 367, "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 71 } }, "expression": { "type": "AssignmentExpression", "start": 300, "end": 366, "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 70 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 300, "end": 320, "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 24 } }, "object": { "type": "ThisExpression", "start": 300, "end": 304, "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 8 } } }, "property": { "type": "Identifier", "start": 305, "end": 320, "loc": { "start": { "line": 10, "column": 9 }, "end": { "line": 10, "column": 24 }, "identifierName": "stopSharingText" }, "name": "stopSharingText" }, "computed": false }, "right": { "type": "StringLiteral", "start": 323, "end": 366, "loc": { "start": { "line": 10, "column": 27 }, "end": { "line": 10, "column": 70 } }, "extra": { "rawValue": "<i class=\"fa fa-unlink fa-2x ficon2\"></i>", "raw": "'<i class=\"fa fa-unlink fa-2x ficon2\"></i>'" }, "value": "<i class=\"fa fa-unlink fa-2x ficon2\"></i>" } } }, { "type": "ExpressionStatement", "start": 373, "end": 414, "loc": { "start": { "line": 11, "column": 4 }, "end": { "line": 11, "column": 45 } }, "expression": { "type": "AssignmentExpression", "start": 373, "end": 413, "loc": { "start": { "line": 11, "column": 4 }, "end": { "line": 11, "column": 44 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 373, "end": 396, "loc": { "start": { "line": 11, "column": 4 }, "end": { "line": 11, "column": 27 } }, "object": { "type": "ThisExpression", "start": 373, "end": 377, "loc": { "start": { "line": 11, "column": 4 }, "end": { "line": 11, "column": 8 } } }, "property": { "type": "Identifier", "start": 378, "end": 396, "loc": { "start": { "line": 11, "column": 9 }, "end": { "line": 11, "column": 27 }, "identifierName": "stopSharingTooltip" }, "name": "stopSharingTooltip" }, "computed": false }, "right": { "type": "StringLiteral", "start": 399, "end": 413, "loc": { "start": { "line": 11, "column": 30 }, "end": { "line": 11, "column": 44 } }, "extra": { "rawValue": "stop sharing", "raw": "'stop sharing'" }, "value": "stop sharing" } } }, { "type": "ExpressionStatement", "start": 428, "end": 768, "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 20, "column": 7 } }, "expression": { "type": "CallExpression", "start": 428, "end": 767, "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 20, "column": 6 } }, "callee": { "type": "MemberExpression", "start": 428, "end": 440, "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 14, "column": 16 } }, "object": { "type": "MemberExpression", "start": 428, "end": 437, "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 14, "column": 13 } }, "object": { "type": "Identifier", "start": 428, "end": 433, "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 14, "column": 9 }, "identifierName": "model" }, "name": "model" }, "property": { "type": "Identifier", "start": 434, "end": 437, "loc": { "start": { "line": 14, "column": 10 }, "end": { "line": 14, "column": 13 }, "identifierName": "rps" }, "name": "rps" }, "computed": false }, "property": { "type": "Identifier", "start": 438, "end": 440, "loc": { "start": { "line": 14, "column": 14 }, "end": { "line": 14, "column": 16 }, "identifierName": "on" }, "name": "on" }, "computed": false }, "arguments": [ { "type": "StringLiteral", "start": 441, "end": 454, "loc": { "start": { "line": 14, "column": 17 }, "end": { "line": 14, "column": 30 } }, "extra": { "rawValue": "statechange", "raw": "\"statechange\"" }, "value": "statechange" }, { "type": "FunctionExpression", "start": 456, "end": 766, "loc": { "start": { "line": 14, "column": 32 }, "end": { "line": 20, "column": 5 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 465, "end": 470, "loc": { "start": { "line": 14, "column": 41 }, "end": { "line": 14, "column": 46 }, "identifierName": "state" }, "name": "state" } ], "body": { "type": "BlockStatement", "start": 471, "end": 766, "loc": { "start": { "line": 14, "column": 47 }, "end": { "line": 20, "column": 5 } }, "body": [ { "type": "SwitchStatement", "start": 482, "end": 758, "loc": { "start": { "line": 15, "column": 8 }, "end": { "line": 19, "column": 9 } }, "discriminant": { "type": "Identifier", "start": 490, "end": 495, "loc": { "start": { "line": 15, "column": 16 }, "end": { "line": 15, "column": 21 }, "identifierName": "state" }, "name": "state" }, "cases": [ { "type": "SwitchCase", "start": 507, "end": 572, "loc": { "start": { "line": 16, "column": 8 }, "end": { "line": 16, "column": 73 } }, "consequent": [ { "type": "ExpressionStatement", "start": 525, "end": 565, "loc": { "start": { "line": 16, "column": 26 }, "end": { "line": 16, "column": 66 } }, "expression": { "type": "CallExpression", "start": 525, "end": 564, "loc": { "start": { "line": 16, "column": 26 }, "end": { "line": 16, "column": 65 } }, "callee": { "type": "MemberExpression", "start": 525, "end": 551, "loc": { "start": { "line": 16, "column": 26 }, "end": { "line": 16, "column": 52 } }, "object": { "type": "Identifier", "start": 525, "end": 535, "loc": { "start": { "line": 16, "column": 26 }, "end": { "line": 16, "column": 36 }, "identifierName": "statesView" }, "name": "statesView" }, "property": { "type": "Identifier", "start": 536, "end": 551, "loc": { "start": { "line": 16, "column": 37 }, "end": { "line": 16, "column": 52 }, "identifierName": "setNetworkState" }, "name": "setNetworkState" }, "computed": false }, "arguments": [ { "type": "StringLiteral", "start": 552, "end": 563, "loc": { "start": { "line": 16, "column": 53 }, "end": { "line": 16, "column": 64 } }, "extra": { "rawValue": "connected", "raw": "'connected'" }, "value": "connected" } ] } }, { "type": "BreakStatement", "start": 566, "end": 572, "loc": { "start": { "line": 16, "column": 67 }, "end": { "line": 16, "column": 73 } }, "label": null } ], "test": { "type": "StringLiteral", "start": 512, "end": 523, "loc": { "start": { "line": 16, "column": 13 }, "end": { "line": 16, "column": 24 } }, "extra": { "rawValue": "connected", "raw": "'connected'" }, "value": "connected" } }, { "type": "SwitchCase", "start": 582, "end": 666, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 92 } }, "consequent": [ { "type": "ExpressionStatement", "start": 610, "end": 659, "loc": { "start": { "line": 17, "column": 36 }, "end": { "line": 17, "column": 85 } }, "expression": { "type": "CallExpression", "start": 610, "end": 658, "loc": { "start": { "line": 17, "column": 36 }, "end": { "line": 17, "column": 84 } }, "callee": { "type": "MemberExpression", "start": 610, "end": 636, "loc": { "start": { "line": 17, "column": 36 }, "end": { "line": 17, "column": 62 } }, "object": { "type": "Identifier", "start": 610, "end": 620, "loc": { "start": { "line": 17, "column": 36 }, "end": { "line": 17, "column": 46 }, "identifierName": "statesView" }, "name": "statesView" }, "property": { "type": "Identifier", "start": 621, "end": 636, "loc": { "start": { "line": 17, "column": 47 }, "end": { "line": 17, "column": 62 }, "identifierName": "setNetworkState" }, "name": "setNetworkState" }, "computed": false }, "arguments": [ { "type": "StringLiteral", "start": 637, "end": 657, "loc": { "start": { "line": 17, "column": 63 }, "end": { "line": 17, "column": 83 } }, "extra": { "rawValue": "partiallyConnected", "raw": "'partiallyConnected'" }, "value": "partiallyConnected" } ] } }, { "type": "BreakStatement", "start": 660, "end": 666, "loc": { "start": { "line": 17, "column": 86 }, "end": { "line": 17, "column": 92 } }, "label": null } ], "test": { "type": "StringLiteral", "start": 587, "end": 608, "loc": { "start": { "line": 17, "column": 13 }, "end": { "line": 17, "column": 34 } }, "extra": { "rawValue": "partially connected", "raw": "'partially connected'" }, "value": "partially connected" } }, { "type": "SwitchCase", "start": 676, "end": 747, "loc": { "start": { "line": 18, "column": 8 }, "end": { "line": 18, "column": 79 } }, "consequent": [ { "type": "ExpressionStatement", "start": 697, "end": 740, "loc": { "start": { "line": 18, "column": 29 }, "end": { "line": 18, "column": 72 } }, "expression": { "type": "CallExpression", "start": 697, "end": 739, "loc": { "start": { "line": 18, "column": 29 }, "end": { "line": 18, "column": 71 } }, "callee": { "type": "MemberExpression", "start": 697, "end": 723, "loc": { "start": { "line": 18, "column": 29 }, "end": { "line": 18, "column": 55 } }, "object": { "type": "Identifier", "start": 697, "end": 707, "loc": { "start": { "line": 18, "column": 29 }, "end": { "line": 18, "column": 39 }, "identifierName": "statesView" }, "name": "statesView" }, "property": { "type": "Identifier", "start": 708, "end": 723, "loc": { "start": { "line": 18, "column": 40 }, "end": { "line": 18,