pbar
Version:
Tiny progress bar widget in css and js es5
1,307 lines (1,306 loc) • 602 kB
JSON
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "Literal",
"value": "use strict",
"raw": "'use strict'",
"range": [
2,
14
],
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 12
}
}
},
"range": [
2,
15
],
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 13
}
},
"trailingComments": [
{
"type": "Block",
"value": "*******\r\n *\r\n * Progress Bar\r\n *\r\n ",
"range": [
19,
59
],
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 8,
"column": 3
}
}
}
]
},
{
"type": "Identifier",
"id": {
"type": "Identifier",
"name": "pbar",
"range": [
69,
73
],
"loc": {
"start": {
"line": 10,
"column": 6
},
"end": {
"line": 10,
"column": 10
}
}
},
"superClass": null,
"body": {
"type": "ClassBody",
"body": [
{
"type": "MethodDefinition",
"key": {
"type": "Identifier",
"name": "constructor",
"range": [
85,
96
],
"loc": {
"start": {
"line": 14,
"column": 2
},
"end": {
"line": 14,
"column": 13
}
}
},
"value": {
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "opts",
"range": [
97,
101
],
"loc": {
"start": {
"line": 14,
"column": 14
},
"end": {
"line": 14,
"column": 18
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "Identifier",
"name": "opts",
"range": [
112,
116
],
"loc": {
"start": {
"line": 16,
"column": 4
},
"end": {
"line": 16,
"column": 8
}
}
},
"right": {
"type": "LogicalExpression",
"operator": "||",
"left": {
"type": "Identifier",
"name": "opts",
"range": [
119,
123
],
"loc": {
"start": {
"line": 16,
"column": 11
},
"end": {
"line": 16,
"column": 15
}
}
},
"right": {
"type": "ObjectExpression",
"properties": [],
"range": [
127,
129
],
"loc": {
"start": {
"line": 16,
"column": 19
},
"end": {
"line": 16,
"column": 21
}
}
},
"range": [
119,
129
],
"loc": {
"start": {
"line": 16,
"column": 11
},
"end": {
"line": 16,
"column": 21
}
}
},
"range": [
112,
129
],
"loc": {
"start": {
"line": 16,
"column": 4
},
"end": {
"line": 16,
"column": 21
}
}
},
"range": [
112,
130
],
"loc": {
"start": {
"line": 16,
"column": 4
},
"end": {
"line": 16,
"column": 22
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "defaults",
"range": [
142,
150
],
"loc": {
"start": {
"line": 18,
"column": 8
},
"end": {
"line": 18,
"column": 16
}
}
},
"init": {
"type": "ObjectExpression",
"properties": [
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "color",
"range": [
162,
167
],
"loc": {
"start": {
"line": 19,
"column": 6
},
"end": {
"line": 19,
"column": 11
}
}
},
"value": {
"type": "Literal",
"value": "#40B3CC",
"raw": "'#40B3CC'",
"range": [
175,
184
],
"loc": {
"start": {
"line": 19,
"column": 19
},
"end": {
"line": 19,
"column": 28
}
}
},
"kind": "init",
"method": false,
"shorthand": false,
"computed": false,
"range": [
162,
184
],
"loc": {
"start": {
"line": 19,
"column": 6
},
"end": {
"line": 19,
"column": 28
}
}
},
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "background",
"range": [
193,
203
],
"loc": {
"start": {
"line": 20,
"column": 6
},
"end": {
"line": 20,
"column": 16
}
}
},
"value": {
"type": "Literal",
"value": "transparent",
"raw": "'transparent'",
"range": [
206,
219
],
"loc": {
"start": {
"line": 20,
"column": 19
},
"end": {
"line": 20,
"column": 32
}
}
},
"kind": "init",
"method": false,
"shorthand": false,
"computed": false,
"range": [
193,
219
],
"loc": {
"start": {
"line": 20,
"column": 6
},
"end": {
"line": 20,
"column": 32
}
}
},
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "border",
"range": [
228,
234
],
"loc": {
"start": {
"line": 21,
"column": 6
},
"end": {
"line": 21,
"column": 12
}
}
},
"value": {
"type": "Literal",
"value": "0 solid transparent",
"raw": "'0 solid transparent'",
"range": [
241,
262
],
"loc": {
"start": {
"line": 21,
"column": 19
},
"end": {
"line": 21,
"column": 40
}
}
},
"kind": "init",
"method": false,
"shorthand": false,
"computed": false,
"range": [
228,
262
],
"loc": {
"start": {
"line": 21,
"column": 6
},
"end": {
"line": 21,
"column": 40
}
}
},
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "height",
"range": [
271,
277
],
"loc": {
"start": {
"line": 22,
"column": 6
},
"end": {
"line": 22,
"column": 12
}
}
},
"value": {
"type": "Literal",
"value": "4px",
"raw": "'4px'",
"range": [
284,
289
],
"loc": {
"start": {
"line": 22,
"column": 19
},
"end": {
"line": 22,
"column": 24
}
}
},
"kind": "init",
"method": false,
"shorthand": false,
"computed": false,
"range": [
271,
289
],
"loc": {
"start": {
"line": 22,
"column": 6
},
"end": {
"line": 22,
"column": 24
}
}
},
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "position",
"range": [
298,
306
],
"loc": {
"start": {
"line": 23,
"column": 6
},
"end": {
"line": 23,
"column": 14
}
}
},
"value": {
"type": "ConditionalExpression",
"test": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "opts",
"range": [
311,
315
],
"loc": {
"start": {
"line": 23,
"column": 19
},
"end": {
"line": 23,
"column": 23
}
}
},
"property": {
"type": "Identifier",
"name": "target",
"range": [
316,
322
],
"loc": {
"start": {
"line": 23,
"column": 24
},
"end": {
"line": 23,
"column": 30
}
}
},
"range": [
311,
322
],
"loc": {
"start": {
"line": 23,
"column": 19
},
"end": {
"line": 23,
"column": 30
}
}
},
"consequent": {
"type": "Literal",
"value": "absolute",
"raw": "'absolute'",
"range": [
324,
334
],
"loc": {
"start": {
"line": 23,
"column": 32
},
"end": {
"line": 23,
"column": 42
}
}
},
"alternate": {
"type": "Literal",
"value": "fixed",
"raw": "'fixed'",
"range": [
337,
344
],
"loc": {
"start": {
"line": 23,
"column": 45
},
"end": {
"line": 23,
"column": 52
}
}
},
"range": [
311,
344
],
"loc": {
"start": {
"line": 23,
"column": 19
},
"end": {
"line": 23,
"column": 52
}
}
},
"kind": "init",
"method": false,
"shorthand": false,
"computed": false,
"range": [
298,
344
],
"loc": {
"start": {
"line": 23,
"column": 6
},
"end": {
"line": 23,
"column": 52
}
}
},
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "target",
"range": [
353,
359
],
"loc": {
"start": {
"line": 24,
"column": 6
},
"end": {
"line": 24,
"column": 12
}
}
},
"value": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "document",
"range": [
366,
374
],
"loc": {
"start": {
"line": 24,
"column": 19
},
"end": {
"line": 24,
"column": 27
}
}
},
"property": {
"type": "Identifier",
"name": "body",
"range": [
375,
379
],
"loc": {
"start": {
"line": 24,
"column": 28
},
"end": {
"line": 24,
"column": 32
}
}
},
"range": [
366,
379
],
"loc": {
"start": {
"line": 24,
"column": 19
},
"end": {
"line": 24,
"column": 32
}
}
},
"kind": "init",
"method": false,
"shorthand": false,
"computed": false,
"range": [
353,
379
],
"loc": {
"start": {
"line": 24,
"column": 6
},
"end": {
"line": 24,
"column": 32
}
}
},
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "transition",
"range": [
388,
398
],
"loc": {
"start": {
"line": 25,
"column": 6
},
"end": {
"line": 25,
"column": 16
}
}
},
"value": {
"type": "Literal",
"value": "0.35s",
"raw": "'0.35s'",
"range": [
401,
408
],
"loc": {
"start": {
"line": 25,
"column": 19
},
"end": {
"line": 25,
"column": 26
}
}
},
"kind": "init",
"method": false,
"shorthand": false,
"computed": false,
"range": [
388,
408
],
"loc": {
"start": {
"line": 25,
"column": 6
},
"end": {
"line": 25,
"column": 26
}
}
},
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "value",
"range": [
417,
422
],
"loc": {
"start": {
"line": 26,
"column": 6
},
"end": {
"line": 26,
"column": 11
}
}
},
"value": {
"type": "Literal",
"value": "50%",
"raw": "'50%'",
"range": [
430,
435
],
"loc": {
"start": {
"line": 26,
"column": 19
},
"end": {
"line": 26,
"column": 24
}
}
},
"kind": "init",
"method": false,
"shorthand": false,
"computed": false,
"range": [
417,
435
],
"loc": {
"start": {
"line": 26,
"column": 6
},
"end": {
"line": 26,
"column": 24
}
}
}
],
"range": [
153,
442
],
"loc": {
"start": {
"line": 18,
"column": 19
},
"end": {
"line": 27,
"column": 5
}
}
},
"range": [
142,
442
],
"loc": {
"start": {
"line": 18,
"column": 8
},
"end": {
"line": 27,
"column": 5
}
}
}
],
"kind": "let",
"range": [
138,
443
],
"loc": {
"start": {
"line": 18,
"column": 4
},
"end": {
"line": 27,
"column": 6
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
451,
455
],
"loc": {
"start": {
"line": 29,
"column": 4
},
"end": {
"line": 29,
"column": 8
}
}
},
"property": {
"type": "Identifier",
"name": "opts",
"range": [
456,
460
],
"loc": {
"start": {
"line": 29,
"column": 9
},
"end": {
"line": 29,
"column": 13
}
}
},
"range": [
451,
460
],
"loc": {
"start": {
"line": 29,
"column": 4
},
"end": {
"line": 29,
"column": 13
}
}
},
"right": {
"type": "ObjectExpression",
"properties": [],
"range": [
463,
465
],
"loc": {
"start": {
"line": 29,
"column": 16
},
"end": {
"line": 29,
"column": 18
}
}
},
"range": [
451,
465
],
"loc": {
"start": {
"line": 29,
"column": 4
},
"end": {
"line": 29,
"column": 18
}
}
},
"range": [
451,
466
],
"loc": {
"start": {
"line": 29,
"column": 4
},
"end": {
"line": 29,
"column": 19
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "Object",
"range": [
472,
478
],
"loc": {
"start": {
"line": 30,
"column": 4
},
"end": {
"line": 30,
"column": 10
}
}
},
"property": {
"type": "Identifier",
"name": "keys",
"range": [
479,
483
],
"loc": {
"start": {
"line": 30,
"column": 11
},
"end": {
"line": 30,
"column": 15
}
}
},
"range": [
472,
483
],
"loc": {
"start": {
"line": 30,
"column": 4
},
"end": {
"line": 30,
"column": 15
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "defaults",
"range": [
484,
492
],
"loc": {
"start": {
"line": 30,
"column": 16
},
"end": {
"line": 30,
"column": 24
}
}
}
],
"range": [
472,
493
],
"loc": {
"start": {
"line": 30,
"column": 4
},
"end": {
"line": 30,
"column": 25
}
}
},
"property": {
"type": "Identifier",
"name": "map",
"range": [
494,
497
],
"loc": {
"start": {
"line": 30,
"column": 26
},
"end": {
"line": 30,
"column": 29
}
}
},
"range": [
472,
497
],
"loc": {
"start": {
"line": 30,
"column": 4
},
"end": {
"line": 30,
"column": 29
}
}
},
"arguments": [
{
"type": "ArrowFunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "key",
"range": [
498,
501
],
"loc": {
"start": {
"line": 30,
"column": 30
},
"end": {
"line": 30,
"column": 33
}
}
}
],
"body": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "MemberExpression",
"computed": true,
"object": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
505,
509
],
"loc": {
"start": {
"line": 30,
"column": 37
},
"end": {
"line": 30,
"column": 41
}
}
},
"property": {
"type": "Identifier",
"name": "opts",
"range": [
510,
514
],
"loc": {
"start": {
"line": 30,
"column": 42
},
"end": {
"line": 30,
"column": 46
}
}
},
"range": [
505,
514
],
"loc": {
"start": {
"line": 30,
"column": 37
},
"end": {
"line": 30,
"column": 46
}
}
},
"property": {
"type": "Identifier",
"name": "key",
"range": [
515,
518
],
"loc": {
"start": {
"line": 30,
"column": 47
},
"end": {
"line": 30,
"column": 50
}
}
},
"range": [
505,
519
],
"loc": {
"start": {
"line": 30,
"column": 37
},
"end": {
"line": 30,
"column": 51
}
}
},
"right": {
"type": "LogicalExpression",
"operator": "||",
"left": {
"type": "MemberExpression",
"computed": true,
"object": {
"type": "Identifier",
"name": "opts",
"range": [
522,
526
],
"loc": {
"start": {
"line": 30,
"column": 54
},
"end": {
"line": 30,
"column": 58
}
}
},
"property": {
"type": "Identifier",
"name": "key",
"range": [
527,
530
],
"loc": {
"start": {
"line": 30,
"column": 59
},
"end": {
"line": 30,
"column": 62
}
}
},
"range": [
522,
531
],
"loc": {
"start": {
"line": 30,
"column": 54
},
"end": {
"line": 30,
"column": 63