UNPKG

rizzo-next

Version:

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

1,362 lines (1,361 loc) 67.9 kB
{ "type": "Program", "start": 0, "end": 2209, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 12, "column": 0 } }, "sourceType": "module", "body": [ { "type": "Identifier", "start": 0, "end": 2174, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 9, "column": 1 } }, "id": { "type": "Identifier", "start": 6, "end": 16, "loc": { "start": { "line": 1, "column": 6 }, "end": { "line": 1, "column": 16 } }, "name": "MobileUtil" }, "superClass": null, "body": { "type": "ClassBody", "start": 17, "end": 2174, "loc": { "start": { "line": 1, "column": 17 }, "end": { "line": 9, "column": 1 } }, "body": [ { "type": "MethodDefinition", "start": 21, "end": 126, "loc": { "start": { "line": 2, "column": 2 }, "end": { "line": 4, "column": 3 } }, "computed": false, "key": { "type": "Identifier", "start": 21, "end": 29, "loc": { "start": { "line": 2, "column": 2 }, "end": { "line": 2, "column": 10 } }, "name": "isMobile" }, "static": false, "kind": "method", "value": { "type": "FunctionExpression", "start": 29, "end": 126, "loc": { "start": { "line": 2, "column": 10 }, "end": { "line": 4, "column": 3 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 32, "end": 126, "loc": { "start": { "line": 2, "column": 13 }, "end": { "line": 4, "column": 3 } }, "body": [ { "type": "ReturnStatement", "start": 38, "end": 122, "loc": { "start": { "line": 3, "column": 4 }, "end": { "line": 3, "column": 88 } }, "argument": { "type": "CallExpression", "start": 45, "end": 121, "loc": { "start": { "line": 3, "column": 11 }, "end": { "line": 3, "column": 87 } }, "callee": { "type": "MemberExpression", "start": 45, "end": 64, "loc": { "start": { "line": 3, "column": 11 }, "end": { "line": 3, "column": 30 } }, "object": { "type": "ThisExpression", "start": 45, "end": 49, "loc": { "start": { "line": 3, "column": 11 }, "end": { "line": 3, "column": 15 } } }, "property": { "type": "Identifier", "start": 50, "end": 64, "loc": { "start": { "line": 3, "column": 16 }, "end": { "line": 3, "column": 30 } }, "name": "checkUserAgent" }, "computed": false }, "arguments": [ { "type": "LogicalExpression", "start": 65, "end": 120, "loc": { "start": { "line": 3, "column": 31 }, "end": { "line": 3, "column": 86 } }, "left": { "type": "LogicalExpression", "start": 65, "end": 104, "loc": { "start": { "line": 3, "column": 31 }, "end": { "line": 3, "column": 70 } }, "left": { "type": "MemberExpression", "start": 65, "end": 84, "loc": { "start": { "line": 3, "column": 31 }, "end": { "line": 3, "column": 50 } }, "object": { "type": "Identifier", "start": 65, "end": 74, "loc": { "start": { "line": 3, "column": 31 }, "end": { "line": 3, "column": 40 } }, "name": "navigator" }, "property": { "type": "Identifier", "start": 75, "end": 84, "loc": { "start": { "line": 3, "column": 41 }, "end": { "line": 3, "column": 50 } }, "name": "userAgent" }, "computed": false }, "operator": "||", "right": { "type": "MemberExpression", "start": 88, "end": 104, "loc": { "start": { "line": 3, "column": 54 }, "end": { "line": 3, "column": 70 } }, "object": { "type": "Identifier", "start": 88, "end": 97, "loc": { "start": { "line": 3, "column": 54 }, "end": { "line": 3, "column": 63 } }, "name": "navigator" }, "property": { "type": "Identifier", "start": 98, "end": 104, "loc": { "start": { "line": 3, "column": 64 }, "end": { "line": 3, "column": 70 } }, "name": "vendor" }, "computed": false } }, "operator": "||", "right": { "type": "MemberExpression", "start": 108, "end": 120, "loc": { "start": { "line": 3, "column": 74 }, "end": { "line": 3, "column": 86 } }, "object": { "type": "Identifier", "start": 108, "end": 114, "loc": { "start": { "line": 3, "column": 74 }, "end": { "line": 3, "column": 80 } }, "name": "window" }, "property": { "type": "Identifier", "start": 115, "end": 120, "loc": { "start": { "line": 3, "column": 81 }, "end": { "line": 3, "column": 86 } }, "name": "opera" }, "computed": false } } ] } } ], "trailingComments": null }, "trailingComments": null }, "trailingComments": [ { "type": "Block", "value": "* source http://detectmobilebrowsers.com *", "start": 129, "end": 175, "loc": { "start": { "line": 5, "column": 2 }, "end": { "line": 5, "column": 48 } }, "range": [ 129, 175 ] } ] }, { "type": "MethodDefinition", "start": 178, "end": 2172, "loc": { "start": { "line": 6, "column": 2 }, "end": { "line": 8, "column": 3 } }, "computed": false, "key": { "type": "Identifier", "start": 178, "end": 192, "loc": { "start": { "line": 6, "column": 2 }, "end": { "line": 6, "column": 16 } }, "name": "checkUserAgent", "leadingComments": null }, "static": false, "kind": "method", "value": { "type": "FunctionExpression", "start": 192, "end": 2172, "loc": { "start": { "line": 6, "column": 16 }, "end": { "line": 8, "column": 3 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 193, "end": 194, "loc": { "start": { "line": 6, "column": 17 }, "end": { "line": 6, "column": 18 } }, "name": "a" } ], "body": { "type": "BlockStatement", "start": 195, "end": 2172, "loc": { "start": { "line": 6, "column": 19 }, "end": { "line": 8, "column": 3 } }, "body": [ { "type": "ReturnStatement", "start": 201, "end": 2168, "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 1971 } }, "argument": { "type": "LogicalExpression", "start": 209, "end": 2166, "loc": { "start": { "line": 7, "column": 12 }, "end": { "line": 7, "column": 1969 } }, "left": { "type": "CallExpression", "start": 209, "end": 531, "loc": { "start": { "line": 7, "column": 12 }, "end": { "line": 7, "column": 334 } }, "callee": { "type": "MemberExpression", "start": 209, "end": 528, "loc": { "start": { "line": 7, "column": 12 }, "end": { "line": 7, "column": 331 } }, "object": { "type": "Literal", "start": 209, "end": 523, "loc": { "start": { "line": 7, "column": 12 }, "end": { "line": 7, "column": 326 } }, "value": {}, "rawValue": {}, "raw": "/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i", "regex": { "pattern": "(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino", "flags": "i" } }, "property": { "type": "Identifier", "start": 524, "end": 528, "loc": { "start": { "line": 7, "column": 327 }, "end": { "line": 7, "column": 331 } }, "name": "test" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 529, "end": 530, "loc": { "start": { "line": 7, "column": 332 }, "end": { "line": 7, "column": 333 } }, "name": "a" } ] }, "operator": "||", "right": { "type": "CallExpression", "start": 535, "end": 2166, "loc": { "start": { "line": 7, "column": 338 }, "end": { "line": 7, "column": 1969 } }, "callee": { "type": "MemberExpression", "start": 535, "end": 2149, "loc": { "start": { "line": 7, "column": 338 }, "end": { "line": 7, "column": 1952 } }, "object": { "type": "Literal", "start": 535, "end": 2144, "loc": { "start": { "line": 7, "column": 338 }, "end": { "line": 7, "column": 1947 } }, "value": {}, "rawValue": {}, "raw": "/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i", "regex": { "pattern": "1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-", "flags": "i" } }, "property": { "type": "Identifier", "start": 2145, "end": 2149, "loc": { "start": { "line": 7, "column": 1948 }, "end": { "line": 7, "column": 1952 } }, "name": "test" }, "computed": false }, "arguments": [ { "type": "CallExpression", "start": 2151, "end": 2165, "loc": { "start": { "line": 7, "column": 1954 }, "end": { "line": 7, "column": 1968 } }, "callee": { "type": "MemberExpression", "start": 2151, "end": 2159, "loc": { "start": { "line": 7, "column": 1954 }, "end": { "line": 7, "column": 1962 } }, "object": { "type": "Identifier", "start": 2151, "end": 2152, "loc": { "start": { "line": 7, "column": 1954 }, "end": { "line": 7, "column": 1955 } }, "name": "a" }, "property": { "type": "Identifier", "start": 2153, "end": 2159, "loc": { "start": { "line": 7, "column": 1956 }, "end": { "line": 7, "column": 1962 } }, "name": "substr" }, "computed": false }, "arguments": [ { "type": "Literal", "start": 2160, "end": 2161, "loc": { "start": { "line": 7, "column": 1963 }, "end": { "line": 7, "column": 1964 } }, "value": 0, "rawValue": 0, "raw": "0" }, { "type": "Literal", "start": 2163, "end": 2164, "loc": { "start": { "line": 7, "column": 1966 }, "end": { "line": 7, "column": 1967 } }, "value": 4, "rawValue": 4, "raw": "4" } ] } ] }, "parenthesizedExpression": true } } ] } }, "leadingComments": [ { "type": "Block", "value": "* source http://detectmobilebrowsers.com *", "start": 129, "end": 175, "loc": { "start": { "line": 5, "column": 2 }, "end": { "line": 5, "column": 48 } }, "range": [ 129, 175 ] } ] } ] }, "name": "_", "leadingComments": [], "trailingComments": [] }, { "type": "Identifier", "start": 2176, "end": 2208, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 11, "column": 32 } }, "declaration": { "type": "NewExpression", "start": 2191, "end": 2207, "loc": { "start": { "line": 11, "column": 15 }, "end": { "line": 11, "column": 31 } }, "callee": { "type": "Identifier", "start": 2195, "end": 2205, "loc": { "start": { "line": 11, "column": 19 }, "end": { "line": 11, "column": 29 } }, "name": "MobileUtil" }, "arguments": [] }, "name": "_", "leadingComments": [], "trailingComments": [] }, { "type": "ExportDefaultDeclaration", "start": 2176, "end": 2208, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 11, "column": 32 } }, "declaration": { "type": "ClassDeclaration", "start": 0, "end": 2174, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 9, "column": 1 } }, "id": { "type": "Identifier", "start": 6, "end": 16, "loc": { "start": { "line": 1, "column": 6 }, "end": { "line": 1, "column": 16 } }, "name": "MobileUtil" }, "superClass": null, "body": { "type": "ClassBody", "start": 17, "end": 2174, "loc": { "start": { "line": 1, "column": 17 }, "end": { "line": 9, "column": 1 } }, "body": [ { "type": "MethodDefinition", "start": 21, "end": 126, "loc": { "start": { "line": 2, "column": 2 }, "end": { "line": 4, "column": 3 } }, "computed": false, "key": { "type": "Identifier", "start": 21, "end": 29, "loc": { "start": { "line": 2, "column": 2 }, "end": { "line": 2, "column": 10 } }, "name": "isMobile" }, "static": false, "kind": "method", "value": { "type": "FunctionExpression", "start": 29, "end": 126, "loc": { "start": { "line": 2, "column": 10 }, "end": { "line": 4, "column": 3 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 32, "end": 126, "loc": { "start": { "line": 2, "column": 13 }, "end": { "line": 4, "column": 3 } }, "body": [ { "type": "ReturnStatement", "start": 38, "end": 122, "loc": { "start": { "line": 3, "column": 4 }, "end": { "line": 3, "column": 88 } }, "argument": { "type": "CallExpression", "start": 45, "end": 121, "loc": { "start": { "line": 3, "column": 11 }, "end": { "line": 3, "column": 87 } }, "callee": { "type": "MemberExpression", "start": 45, "end": 64, "loc": { "start": { "line": 3, "column": 11 }, "end": { "line": 3, "column": 30 } }, "object": { "type": "ThisExpression", "start": 45, "end": 49, "loc": { "start": { "line": 3, "column": 11 }, "end": { "line": 3, "column": 15 } } }, "property": { "type": "Identifier", "start": 50, "end": 64, "loc": { "start": { "line": 3, "column": 16 }, "end": { "line": 3, "column": 30 } }, "name": "checkUserAgent" }, "computed": false }, "arguments": [ { "type": "LogicalExpression", "start": 65, "end": 120, "loc": { "start": { "line": 3, "column": 31 }, "end": { "line": 3, "column": 86 } }, "left": { "type": "LogicalExpression", "start": 65, "end": 104, "loc": { "start": { "line": 3, "column": 31 }, "end": { "line": 3, "column": 70 } }, "left": { "type": "MemberExpression", "start": 65, "end": 84, "loc": { "start": { "line": 3, "column": 31 }, "end": { "line": 3, "column": 50 } }, "object": { "type": "Identifier", "start": 65, "end": 74, "loc": { "start": { "line": 3, "column": 31 }, "end": { "line": 3, "column": 40 } }, "name": "navigator" }, "property": { "type": "Identifier", "start": 75, "end": 84, "loc": { "start": { "line": 3, "column": 41 }, "end": { "line": 3, "column": 50 } }, "name": "userAgent" }, "computed": false }, "operator": "||", "right": { "type": "MemberExpression", "start": 88, "end": 104, "loc": { "start": { "line": 3, "column": 54 }, "end": { "line": 3, "column": 70 } }, "object": { "type": "Identifier", "start": 88, "end": 97, "loc": { "start": { "line": 3, "column": 54 }, "end": { "line": 3, "column": 63 } }, "name": "navigator" }, "property": { "type": "Identifier", "start": 98, "end": 104, "loc": { "start": { "line": 3, "column": 64 }, "end": { "line": 3, "column": 70 } }, "name": "vendor" }, "computed": false } }, "operator": "||", "right": { "type": "MemberExpression", "start": 108, "end": 120, "loc": { "start": { "line": 3, "column": 74 }, "end": { "line": 3, "column": 86 } }, "object": { "type": "Identifier", "start": 108, "end": 114, "loc": { "start": { "line": 3, "column": 74 }, "end": { "line": 3, "column": 80 } }, "name": "window" }, "property": { "type": "Identifier", "start": 115, "end": 120, "loc": { "start": { "line": 3, "column": 81 }, "end": { "line": 3, "column": 86 } }, "name": "opera" }, "computed": false } } ] } } ], "trailingComments": null }, "trailingComments": null }, "trailingComments": [ { "type": "Block", "value": "* source http://detectmobilebrowsers.com *", "start": 129, "end": 175, "loc": { "start": { "line": 5, "column": 2 }, "end": { "line": 5, "column": 48 } }, "range": [ 129, 175 ] } ] }, { "type": "MethodDefinition", "start": 178, "end": 2172, "loc": { "start": { "line": 6, "column": 2 }, "end": { "line": 8, "column": 3 } }, "computed": false, "key": { "type": "Identifier", "start": 178, "end": 192, "loc": { "start": { "line": 6, "column": 2 }, "end": { "line": 6, "column": 16 } }, "name": "checkUserAgent", "leadingComments": null }, "static": false, "kind": "method", "value": { "type": "FunctionExpression", "start": 192, "end": 2172, "loc": { "start": { "line": 6, "column": 16 }, "end": { "line": 8, "column": 3 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 193, "end": 194, "loc": { "start": { "line": 6, "column": 17 }, "end": { "line": 6, "column": 18 } }, "name": "a" } ], "body": { "type": "BlockStatement", "start": 195, "end": 2172, "loc": { "start": { "line": 6, "column": 19 }, "end": { "line": 8,