UNPKG

soocrate-core

Version:

this is the core of soocrate application

1,466 lines (1,465 loc) 165 kB
{ "type": "File", "start": 0, "end": 511, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 23, "column": 22 } }, "program": { "type": "Program", "start": 0, "end": 511, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 23, "column": 22 } }, "sourceType": "module", "body": [ { "type": "Identifier", "start": 0, "end": 482, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 20, "column": 1 } }, "id": { "type": "Identifier", "start": 9, "end": 15, "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 15 }, "identifierName": "Editor" }, "name": "Editor" }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 16, "end": 18, "loc": { "start": { "line": 1, "column": 16 }, "end": { "line": 1, "column": 18 }, "identifierName": "id" }, "name": "id" }, { "type": "Identifier", "start": 20, "end": 29, "loc": { "start": { "line": 1, "column": 20 }, "end": { "line": 1, "column": 29 }, "identifierName": "sessionID" }, "name": "sessionID" } ], "body": { "type": "BlockStatement", "start": 31, "end": 482, "loc": { "start": { "line": 1, "column": 31 }, "end": { "line": 20, "column": 1 } }, "body": [ { "type": "ExpressionStatement", "start": 35, "end": 79, "loc": { "start": { "line": 2, "column": 1 }, "end": { "line": 2, "column": 45 } }, "expression": { "type": "CallExpression", "start": 35, "end": 78, "loc": { "start": { "line": 2, "column": 1 }, "end": { "line": 2, "column": 44 } }, "callee": { "type": "MemberExpression", "start": 35, "end": 57, "loc": { "start": { "line": 2, "column": 1 }, "end": { "line": 2, "column": 23 } }, "object": { "type": "CallExpression", "start": 35, "end": 52, "loc": { "start": { "line": 2, "column": 1 }, "end": { "line": 2, "column": 18 } }, "callee": { "type": "Identifier", "start": 35, "end": 41, "loc": { "start": { "line": 2, "column": 1 }, "end": { "line": 2, "column": 7 }, "identifierName": "jQuery" }, "name": "jQuery" }, "arguments": [ { "type": "StringLiteral", "start": 42, "end": 51, "loc": { "start": { "line": 2, "column": 8 }, "end": { "line": 2, "column": 17 } }, "extra": { "rawValue": "#editor", "raw": "\"#editor\"" }, "value": "#editor" } ] }, "property": { "type": "Identifier", "start": 53, "end": 57, "loc": { "start": { "line": 2, "column": 19 }, "end": { "line": 2, "column": 23 }, "identifierName": "attr" }, "name": "attr" }, "computed": false }, "arguments": [ { "type": "StringLiteral", "start": 58, "end": 62, "loc": { "start": { "line": 2, "column": 24 }, "end": { "line": 2, "column": 28 } }, "extra": { "rawValue": "id", "raw": "'id'" }, "value": "id" }, { "type": "BinaryExpression", "start": 64, "end": 77, "loc": { "start": { "line": 2, "column": 30 }, "end": { "line": 2, "column": 43 } }, "left": { "type": "StringLiteral", "start": 64, "end": 72, "loc": { "start": { "line": 2, "column": 30 }, "end": { "line": 2, "column": 38 } }, "extra": { "rawValue": "crate-", "raw": "'crate-'" }, "value": "crate-" }, "operator": "+", "right": { "type": "Identifier", "start": 75, "end": 77, "loc": { "start": { "line": 2, "column": 41 }, "end": { "line": 2, "column": 43 }, "identifierName": "id" }, "name": "id" } } ] } }, { "type": "ExpressionStatement", "start": 82, "end": 102, "loc": { "start": { "line": 3, "column": 1 }, "end": { "line": 3, "column": 21 } }, "expression": { "type": "AssignmentExpression", "start": 82, "end": 101, "loc": { "start": { "line": 3, "column": 1 }, "end": { "line": 3, "column": 20 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 82, "end": 93, "loc": { "start": { "line": 3, "column": 1 }, "end": { "line": 3, "column": 12 } }, "object": { "type": "ThisExpression", "start": 82, "end": 86, "loc": { "start": { "line": 3, "column": 1 }, "end": { "line": 3, "column": 5 } } }, "property": { "type": "Identifier", "start": 87, "end": 93, "loc": { "start": { "line": 3, "column": 6 }, "end": { "line": 3, "column": 12 }, "identifierName": "editor" }, "name": "editor" }, "computed": false }, "right": { "type": "Identifier", "start": 96, "end": 101, "loc": { "start": { "line": 3, "column": 15 }, "end": { "line": 3, "column": 20 }, "identifierName": "quill" }, "name": "quill" } }, "trailingComments": [ { "type": "CommentLine", "value": " Initilise the the editor content ", "start": 107, "end": 143, "loc": { "start": { "line": 5, "column": 1 }, "end": { "line": 5, "column": 37 } } }, { "type": "CommentLine", "value": "this.editor.setText('');", "start": 146, "end": 172, "loc": { "start": { "line": 6, "column": 1 }, "end": { "line": 6, "column": 27 } } } ] }, { "type": "IfStatement", "start": 175, "end": 349, "loc": { "start": { "line": 7, "column": 1 }, "end": { "line": 11, "column": 2 } }, "test": { "type": "CallExpression", "start": 179, "end": 211, "loc": { "start": { "line": 7, "column": 5 }, "end": { "line": 7, "column": 37 } }, "callee": { "type": "MemberExpression", "start": 179, "end": 188, "loc": { "start": { "line": 7, "column": 5 }, "end": { "line": 7, "column": 14 } }, "object": { "type": "Identifier", "start": 179, "end": 184, "loc": { "start": { "line": 7, "column": 5 }, "end": { "line": 7, "column": 10 }, "identifierName": "store" }, "name": "store", "leadingComments": null }, "property": { "type": "Identifier", "start": 185, "end": 188, "loc": { "start": { "line": 7, "column": 11 }, "end": { "line": 7, "column": 14 }, "identifierName": "get" }, "name": "get" }, "computed": false, "leadingComments": null }, "arguments": [ { "type": "BinaryExpression", "start": 189, "end": 210, "loc": { "start": { "line": 7, "column": 15 }, "end": { "line": 7, "column": 36 } }, "left": { "type": "StringLiteral", "start": 189, "end": 198, "loc": { "start": { "line": 7, "column": 15 }, "end": { "line": 7, "column": 24 } }, "extra": { "rawValue": "CRATE2-", "raw": "\"CRATE2-\"" }, "value": "CRATE2-" }, "operator": "+", "right": { "type": "Identifier", "start": 201, "end": 210, "loc": { "start": { "line": 7, "column": 27 }, "end": { "line": 7, "column": 36 }, "identifierName": "sessionID" }, "name": "sessionID" } } ], "leadingComments": null }, "consequent": { "type": "BlockStatement", "start": 213, "end": 349, "loc": { "start": { "line": 7, "column": 39 }, "end": { "line": 11, "column": 2 } }, "body": [ { "type": "VariableDeclaration", "start": 218, "end": 261, "loc": { "start": { "line": 8, "column": 2 }, "end": { "line": 8, "column": 45 } }, "declarations": [ { "type": "VariableDeclarator", "start": 222, "end": 260, "loc": { "start": { "line": 8, "column": 6 }, "end": { "line": 8, "column": 44 } }, "id": { "type": "Identifier", "start": 222, "end": 225, "loc": { "start": { "line": 8, "column": 6 }, "end": { "line": 8, "column": 9 }, "identifierName": "doc" }, "name": "doc" }, "init": { "type": "CallExpression", "start": 228, "end": 260, "loc": { "start": { "line": 8, "column": 12 }, "end": { "line": 8, "column": 44 } }, "callee": { "type": "MemberExpression", "start": 228, "end": 237, "loc": { "start": { "line": 8, "column": 12 }, "end": { "line": 8, "column": 21 } }, "object": { "type": "Identifier", "start": 228, "end": 233, "loc": { "start": { "line": 8, "column": 12 }, "end": { "line": 8, "column": 17 }, "identifierName": "store" }, "name": "store" }, "property": { "type": "Identifier", "start": 234, "end": 237, "loc": { "start": { "line": 8, "column": 18 }, "end": { "line": 8, "column": 21 }, "identifierName": "get" }, "name": "get" }, "computed": false }, "arguments": [ { "type": "BinaryExpression", "start": 238, "end": 259, "loc": { "start": { "line": 8, "column": 22 }, "end": { "line": 8, "column": 43 } }, "left": { "type": "StringLiteral", "start": 238, "end": 247, "loc": { "start": { "line": 8, "column": 22 }, "end": { "line": 8, "column": 31 } }, "extra": { "rawValue": "CRATE2-", "raw": "\"CRATE2-\"" }, "value": "CRATE2-" }, "operator": "+", "right": { "type": "Identifier", "start": 250, "end": 259, "loc": { "start": { "line": 8, "column": 34 }, "end": { "line": 8, "column": 43 }, "identifierName": "sessionID" }, "name": "sessionID" } } ] } } ], "kind": "var" }, { "type": "ExpressionStatement", "start": 265, "end": 308, "loc": { "start": { "line": 9, "column": 2 }, "end": { "line": 9, "column": 45 } }, "expression": { "type": "CallExpression", "start": 265, "end": 307, "loc": { "start": { "line": 9, "column": 2 }, "end": { "line": 9, "column": 44 } }, "callee": { "type": "MemberExpression", "start": 265, "end": 288, "loc": { "start": { "line": 9, "column": 2 }, "end": { "line": 9, "column": 25 } }, "object": { "type": "MemberExpression", "start": 265, "end": 276, "loc": { "start": { "line": 9, "column": 2 }, "end": { "line": 9, "column": 13 } }, "object": { "type": "ThisExpression", "start": 265, "end": 269, "loc": { "start": { "line": 9, "column": 2 }, "end": { "line": 9, "column": 6 } } }, "property": { "type": "Identifier", "start": 270, "end": 276, "loc": { "start": { "line": 9, "column": 7 }, "end": { "line": 9, "column": 13 }, "identifierName": "editor" }, "name": "editor" }, "computed": false }, "property": { "type": "Identifier", "start": 277, "end": 288, "loc": { "start": { "line": 9, "column": 14 }, "end": { "line": 9, "column": 25 }, "identifierName": "setContents" }, "name": "setContents" }, "computed": false }, "arguments": [ { "type": "MemberExpression", "start": 289, "end": 298, "loc": { "start": { "line": 9, "column": 26 }, "end": { "line": 9, "column": 35 } }, "object": { "type": "Identifier", "start": 289, "end": 292, "loc": { "start": { "line": 9, "column": 26 }, "end": { "line": 9, "column": 29 }, "identifierName": "doc" }, "name": "doc" }, "property": { "type": "Identifier", "start": 293, "end": 298, "loc": { "start": { "line": 9, "column": 30 }, "end": { "line": 9, "column": 35 }, "identifierName": "delta" }, "name": "delta" }, "computed": false }, { "type": "StringLiteral", "start": 300, "end": 306, "loc": { "start": { "line": 9, "column": 37 }, "end": { "line": 9, "column": 43 } }, "extra": { "rawValue": "user", "raw": "\"user\"" }, "value": "user" } ] } }, { "type": "ExpressionStatement", "start": 312, "end": 345, "loc": { "start": { "line": 10, "column": 2 }, "end": { "line": 10, "column": 35 } }, "expression": { "type": "CallExpression", "start": 312, "end": 344, "loc": { "start": { "line": 10, "column": 2 }, "end": { "line": 10, "column": 34 } }, "callee": { "type": "MemberExpression", "start": 312, "end": 333, "loc": { "start": { "line": 10, "column": 2 }, "end": { "line": 10, "column": 23 } }, "object": { "type": "CallExpression", "start": 312, "end": 328, "loc": { "start": { "line": 10, "column": 2 }, "end": { "line": 10, "column": 18 } }, "callee": { "type": "Identifier", "start": 312, "end": 318, "loc": { "start": { "line": 10, "column": 2 }, "end": { "line": 10, "column": 8 }, "identifierName": "jQuery" }, "name": "jQuery" }, "arguments": [ { "type": "StringLiteral", "start": 319, "end": 327, "loc": { "start": { "line": 10, "column": 9 }, "end": { "line": 10, "column": 17 } }, "extra": { "rawValue": "#title", "raw": "\"#title\"" }, "value": "#title" } ] }, "property": { "type": "Identifier", "start": 329, "end": 333, "loc": { "start": { "line": 10, "column": 19 }, "end": { "line": 10, "column": 23 }, "identifierName": "text" }, "name": "text" }, "computed": false }, "arguments": [ { "type": "MemberExpression", "start": 334, "end": 343, "loc": { "start": { "line": 10, "column": 24 }, "end": { "line": 10, "column": 33 } }, "object": { "type": "Identifier", "start": 334, "end": 337, "loc": { "start": { "line": 10, "column": 24 }, "end": { "line": 10, "column": 27 }, "identifierName": "doc" }, "name": "doc" }, "property": { "type": "Identifier", "start": 338, "end": 343, "loc": { "start": { "line": 10, "column": 28 }, "end": { "line": 10, "column": 33 }, "identifierName": "title" }, "name": "title" }, "computed": false } ] } } ], "directives": [], "trailingComments": null }, "alternate": null, "leadingComments": [ { "type": "CommentLine", "value": " Initilise the the editor content ", "start": 107, "end": 143, "loc": { "start": { "line": 5, "column": 1 }, "end": { "line": 5, "column": 37 } } }, { "type": "CommentLine", "value": "this.editor.setText('');", "start": 146, "end": 172, "loc": { "start": { "line": 6, "column": 1 }, "end": { "line": 6, "column": 27 } } } ], "trailingComments": [ { "type": "CommentLine", "value": " make title editable", "start": 356, "end": 378, "loc": { "start": { "line": 14, "column": 1 }, "end": { "line": 14, "column": 23 } } } ] }, { "type": "ExpressionStatement", "start": 381, "end": 475, "loc": { "start": { "line": 15, "column": 1 }, "end": { "line": 17, "column": 4 } }, "expression": { "type": "CallExpression", "start": 381, "end": 474, "loc": { "start": { "line": 15, "column": 1 }, "end": { "line": 17, "column": 3 } }, "callee": { "type": "MemberExpression", "start": 381, "end": 403, "loc": { "start": { "line": 15, "column": 1 }, "end": { "line": 15, "column": 23 } }, "object": { "type": "CallExpression", "start": 381, "end": 397, "loc": { "start": { "line": 15, "column": 1 }, "end": { "line": 15, "column": 17 } }, "callee": { "type": "Identifier", "start": 381, "end": 387, "loc": { "start": { "line": 15, "column": 1 }, "end": { "line": 15, "column": 7 }, "identifierName": "jQuery" }, "name": "jQuery", "leadingComments": null }, "arguments": [ { "type": "StringLiteral", "start": 388, "end": 396, "loc": { "start": { "line": 15, "column": 8 }, "end": { "line": 15, "column": 16 } }, "extra": { "rawValue": "#title", "raw": "'#title'" }, "value": "#title" } ], "leadingComments": null }, "property": { "type": "Identifier", "start": 398, "end": 403, "loc": { "start": { "line": 15, "column": 18 }, "end": { "line": 15, "column": 23 }, "identifierName": "click" }, "name": "click" }, "computed": false, "leadingComments": null }, "arguments": [ { "type": "FunctionExpression", "start": 404, "end": 473, "loc": { "start": { "line": 15, "column": 24 }, "end": { "line": 17, "column": 2 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 415, "end": 473, "loc": { "start": { "line": 15, "column": 35 }, "end": { "line": 17, "column": 2 } }, "body": [ { "type": "ExpressionStatement", "start": 420, "end": 469, "loc": { "start": { "line": 16, "column": 2 }, "end": { "line": 16, "column": 51 } }, "expression": { "type": "CallExpression", "start": 420, "end": 468, "loc": { "start": { "line": 16, "column": 2 }, "end": { "line": 16, "column": 50 } }, "callee": { "type": "MemberExpression", "start": 420, "end": 441, "loc": { "start": { "line": 16, "column": 2 }, "end": { "line": 16, "column": 23 } }, "object": { "type": "CallExpression", "start": 420, "end": 436, "loc": { "start": { "line": 16, "column": 2 }, "end": { "line": 16, "column": 18 } }, "callee": { "type": "Identifier", "start": 420, "end": 426, "loc": { "start": { "line": 16, "column": 2 }, "end": { "line": 16, "column": 8 }, "identifierName": "jQuery" }, "name": "jQuery" }, "arguments": [ { "type": "StringLiteral", "start": 427, "end": 435, "loc": { "start": { "line": 16, "column": 9 }, "end": { "line": 16, "column": 17 } }, "extra": { "rawValue": "#title", "raw": "'#title'" }, "value": "#title" } ] }, "property": { "type": "Identifier", "start": 437, "end": 441, "loc": { "start": { "line": 16, "column": 19 }, "end": { "line": 16, "column": 23 }, "identifierName": "attr" }, "name": "attr" }, "computed": false }, "arguments": [ { "type": "StringLiteral", "start": 442, "end": 459, "loc": { "start": { "line": 16, "column": 24 }, "end": { "line": 16, "column": 41 } }, "extra": { "rawValue": "contenteditable", "raw": "'contenteditable'" }, "value": "contenteditable" }, { "type": "StringLiteral", "start": 461, "end": 467, "loc": { "start": { "line": 16,