UNPKG

rizzo-next

Version:

The next generation of Lonely Planet's style guide and pattern library.

888 lines 28.6 kB
{ "type": "Program", "start": 0, "end": 400, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 19, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ClassDeclaration", "start": 181, "end": 332, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 16, "column": 1 } }, "id": { "type": "Identifier", "start": 187, "end": 202, "loc": { "start": { "line": 8, "column": 6 }, "end": { "line": 8, "column": 21 } }, "name": "$ImagePreloader", "leadingComments": null }, "superClass": null, "body": { "type": "ClassBody", "start": 203, "end": 332, "loc": { "start": { "line": 8, "column": 22 }, "end": { "line": 16, "column": 1 } }, "body": [ { "type": "MethodDefinition", "start": 207, "end": 330, "loc": { "start": { "line": 9, "column": 2 }, "end": { "line": 15, "column": 3 } }, "computed": false, "key": { "type": "Identifier", "start": 207, "end": 218, "loc": { "start": { "line": 9, "column": 2 }, "end": { "line": 9, "column": 13 } }, "name": "constructor" }, "static": false, "kind": "constructor", "value": { "type": "FunctionExpression", "start": 218, "end": 330, "loc": { "start": { "line": 9, "column": 13 }, "end": { "line": 15, "column": 3 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "ObjectPattern", "start": 219, "end": 225, "loc": { "start": { "line": 9, "column": 14 }, "end": { "line": 9, "column": 20 } }, "properties": [ { "type": "Property", "start": 221, "end": 223, "loc": { "start": { "line": 9, "column": 16 }, "end": { "line": 9, "column": 18 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 221, "end": 223, "loc": { "start": { "line": 9, "column": 16 }, "end": { "line": 9, "column": 18 } }, "name": "el" }, "kind": "init", "value": { "type": "Identifier", "start": 221, "end": 223, "loc": { "start": { "line": 9, "column": 16 }, "end": { "line": 9, "column": 18 } }, "name": "el" } } ] } ], "body": { "type": "BlockStatement", "start": 227, "end": 330, "loc": { "start": { "line": 9, "column": 22 }, "end": { "line": 15, "column": 3 } }, "body": [ { "type": "VariableDeclaration", "start": 233, "end": 275, "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 46 } }, "declarations": [ { "type": "VariableDeclarator", "start": 237, "end": 274, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 45 } }, "id": { "type": "Identifier", "start": 237, "end": 240, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 11 } }, "name": "url" }, "init": { "type": "LogicalExpression", "start": 243, "end": 274, "loc": { "start": { "line": 10, "column": 14 }, "end": { "line": 10, "column": 45 } }, "left": { "type": "CallExpression", "start": 243, "end": 264, "loc": { "start": { "line": 10, "column": 14 }, "end": { "line": 10, "column": 35 } }, "callee": { "type": "MemberExpression", "start": 243, "end": 253, "loc": { "start": { "line": 10, "column": 14 }, "end": { "line": 10, "column": 24 } }, "object": { "type": "CallExpression", "start": 243, "end": 248, "loc": { "start": { "line": 10, "column": 14 }, "end": { "line": 10, "column": 19 } }, "callee": { "type": "Identifier", "start": 243, "end": 244, "loc": { "start": { "line": 10, "column": 14 }, "end": { "line": 10, "column": 15 } }, "name": "$" }, "arguments": [ { "type": "Identifier", "start": 245, "end": 247, "loc": { "start": { "line": 10, "column": 16 }, "end": { "line": 10, "column": 18 } }, "name": "el" } ] }, "property": { "type": "Identifier", "start": 249, "end": 253, "loc": { "start": { "line": 10, "column": 20 }, "end": { "line": 10, "column": 24 } }, "name": "data" }, "computed": false }, "arguments": [ { "type": "Literal", "start": 254, "end": 263, "loc": { "start": { "line": 10, "column": 25 }, "end": { "line": 10, "column": 34 } }, "value": "preload", "rawValue": "preload", "raw": "\"preload\"" } ] }, "operator": "||", "right": { "type": "MemberExpression", "start": 268, "end": 274, "loc": { "start": { "line": 10, "column": 39 }, "end": { "line": 10, "column": 45 } }, "object": { "type": "Identifier", "start": 268, "end": 270, "loc": { "start": { "line": 10, "column": 39 }, "end": { "line": 10, "column": 41 } }, "name": "el" }, "property": { "type": "Identifier", "start": 271, "end": 274, "loc": { "start": { "line": 10, "column": 42 }, "end": { "line": 10, "column": 45 } }, "name": "src" }, "computed": false } } } ], "kind": "let" }, { "type": "IfStatement", "start": 281, "end": 326, "loc": { "start": { "line": 12, "column": 4 }, "end": { "line": 14, "column": 5 } }, "test": { "type": "Identifier", "start": 285, "end": 288, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 11 } }, "name": "url" }, "consequent": { "type": "BlockStatement", "start": 290, "end": 326, "loc": { "start": { "line": 12, "column": 13 }, "end": { "line": 14, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 298, "end": 320, "loc": { "start": { "line": 13, "column": 6 }, "end": { "line": 13, "column": 28 } }, "expression": { "type": "AssignmentExpression", "start": 298, "end": 319, "loc": { "start": { "line": 13, "column": 6 }, "end": { "line": 13, "column": 27 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 298, "end": 313, "loc": { "start": { "line": 13, "column": 6 }, "end": { "line": 13, "column": 21 } }, "object": { "type": "NewExpression", "start": 298, "end": 309, "loc": { "start": { "line": 13, "column": 6 }, "end": { "line": 13, "column": 17 } }, "callee": { "type": "Identifier", "start": 302, "end": 307, "loc": { "start": { "line": 13, "column": 10 }, "end": { "line": 13, "column": 15 } }, "name": "Image" }, "arguments": [] }, "property": { "type": "Identifier", "start": 310, "end": 313, "loc": { "start": { "line": 13, "column": 18 }, "end": { "line": 13, "column": 21 } }, "name": "src" }, "computed": false }, "right": { "type": "Identifier", "start": 316, "end": 319, "loc": { "start": { "line": 13, "column": 24 }, "end": { "line": 13, "column": 27 } }, "name": "url" } } } ] }, "alternate": null } ] } } } ] }, "leadingComments": [ { "type": "Block", "value": "*\n * Preload images with jQuery\n * @example\n * <img data-preload src=\"foo.jpg\" />\n * @example\n * <div data-preload=\"foo.jpg\" style=\"background-image: url(foo.jpg)\"></div>\n ", "start": 0, "end": 180, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 7, "column": 3 } }, "range": [ 0, 180 ] } ] }, { "type": "ExpressionStatement", "start": 334, "end": 399, "loc": { "start": { "line": 18, "column": 0 }, "end": { "line": 18, "column": 65 } }, "expression": { "type": "CallExpression", "start": 334, "end": 398, "loc": { "start": { "line": 18, "column": 0 }, "end": { "line": 18, "column": 64 } }, "callee": { "type": "MemberExpression", "start": 334, "end": 358, "loc": { "start": { "line": 18, "column": 0 }, "end": { "line": 18, "column": 24 } }, "object": { "type": "CallExpression", "start": 334, "end": 353, "loc": { "start": { "line": 18, "column": 0 }, "end": { "line": 18, "column": 19 } }, "callee": { "type": "Identifier", "start": 334, "end": 335, "loc": { "start": { "line": 18, "column": 0 }, "end": { "line": 18, "column": 1 } }, "name": "$" }, "arguments": [ { "type": "Literal", "start": 336, "end": 352, "loc": { "start": { "line": 18, "column": 2 }, "end": { "line": 18, "column": 18 } }, "value": "[data-preload]", "rawValue": "[data-preload]", "raw": "\"[data-preload]\"" } ] }, "property": { "type": "Identifier", "start": 354, "end": 358, "loc": { "start": { "line": 18, "column": 20 }, "end": { "line": 18, "column": 24 } }, "name": "each" }, "computed": false }, "arguments": [ { "type": "ArrowFunctionExpression", "start": 359, "end": 397, "loc": { "start": { "line": 18, "column": 25 }, "end": { "line": 18, "column": 63 } }, "id": null, "generator": false, "expression": true, "async": false, "params": [ { "type": "Identifier", "start": 360, "end": 361, "loc": { "start": { "line": 18, "column": 26 }, "end": { "line": 18, "column": 27 } }, "name": "i" }, { "type": "Identifier", "start": 363, "end": 365, "loc": { "start": { "line": 18, "column": 29 }, "end": { "line": 18, "column": 31 } }, "name": "el" } ], "body": { "type": "NewExpression", "start": 370, "end": 397, "loc": { "start": { "line": 18, "column": 36 }, "end": { "line": 18, "column": 63 } }, "callee": { "type": "Identifier", "start": 374, "end": 389, "loc": { "start": { "line": 18, "column": 40 }, "end": { "line": 18, "column": 55 } }, "name": "$ImagePreloader" }, "arguments": [ { "type": "ObjectExpression", "start": 390, "end": 396, "loc": { "start": { "line": 18, "column": 56 }, "end": { "line": 18, "column": 62 } }, "properties": [ { "type": "Property", "start": 392, "end": 394, "loc": { "start": { "line": 18, "column": 58 }, "end": { "line": 18, "column": 60 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 392, "end": 394, "loc": { "start": { "line": 18, "column": 58 }, "end": { "line": 18, "column": 60 } }, "name": "el" }, "kind": "init", "value": { "type": "Identifier", "start": 392, "end": 394, "loc": { "start": { "line": 18, "column": 58 }, "end": { "line": 18, "column": 60 } }, "name": "el" } } ] } ] } } ] } } ] }