You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by za...@apache.org on 2015/04/01 16:23:14 UTC
[47/52] [abbrv] [partial] cordova-firefoxos git commit: CB-4548
Install new node-firefox-* dependencies in node_modules
http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/.gitmodules
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/.gitmodules b/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/.gitmodules
new file mode 100644
index 0000000..15339d4
--- /dev/null
+++ b/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "src/test/tests"]
+ path = src/test/tests
+ url = git://github.com/lloyd/JSONSelectTests
http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/.npmignore b/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/.npmignore
new file mode 100644
index 0000000..0e2021f
--- /dev/null
+++ b/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/.npmignore
@@ -0,0 +1,5 @@
+*~
+\#*\#
+.DS_Store
+/src/dist
+
http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/JSONSelect.md
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/JSONSelect.md b/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/JSONSelect.md
new file mode 100644
index 0000000..bdd8580
--- /dev/null
+++ b/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/JSONSelect.md
@@ -0,0 +1,214 @@
+**WARNING**: This document is a work in progress, just like JSONSelect itself.
+View or contribute to the latest version [on github](http://github.com/lloyd/JSONSelect/blob/master/JSONSelect.md)
+
+# JSONSelect
+
+ 1. [introduction](#introduction)
+ 1. [levels](#levels)
+ 1. [language overview](#overview)
+ 1. [grouping](#grouping)
+ 1. [selectors](#selectors)
+ 1. [pseudo classes](#pseudo)
+ 1. [expressions](#expressions)
+ 1. [combinators](#combinators)
+ 1. [grammar](#grammar)
+ 1. [conformance tests](#tests)
+ 1. [references](#references)
+
+## Introduction<a name="introduction"></a>
+
+JSONSelect defines a language very similar in syntax and structure to
+[CSS3 Selectors](http://www.w3.org/TR/css3-selectors/). JSONSelect
+expressions are patterns which can be matched against JSON documents.
+
+Potential applications of JSONSelect include:
+
+ * Simplified programmatic matching of nodes within JSON documents.
+ * Stream filtering, allowing efficient and incremental matching of documents.
+ * As a query language for a document database.
+
+## Levels<a name="levels"></a>
+
+The specification of JSONSelect is broken into three levels. Higher
+levels include more powerful constructs, and are likewise more
+complicated to implement and use.
+
+**JSONSelect Level 1** is a small subset of CSS3. Every feature is
+derived from a CSS construct that directly maps to JSON. A level 1
+implementation is not particularly complicated while providing basic
+querying features.
+
+**JSONSelect Level 2** builds upon Level 1 adapting more complex CSS
+constructs which allow expressions to include constraints such as
+patterns that match against values, and those which consider a node's
+siblings. Level 2 is still a direct adaptation of CSS, but includes
+constructs whose semantic meaning is significantly changed.
+
+**JSONSelect Level 3** adds constructs which do not necessarily have a
+direct analog in CSS, and are added to increase the power and convenience
+of the selector language. These include aliases, wholly new pseudo
+class functions, and more blue sky dreaming.
+
+## Language Overview<a name="overview"></a>
+
+<table>
+<tr><th>pattern</th><th>meaning</th><th>level</th></tr>
+<tr><td>*</td><td>Any node</td><td>1</td></tr>
+<tr><td>T</td><td>A node of type T, where T is one string, number, object, array, boolean, or null</td><td>1</td></tr>
+<tr><td>T.key</td><td>A node of type T which is the child of an object and is the value its parents key property</td><td>1</td></tr>
+<tr><td>T."complex key"</td><td>Same as previous, but with property name specified as a JSON string</td><td>1</td></tr>
+<tr><td>T:root</td><td>A node of type T which is the root of the JSON document</td><td>1</td></tr>
+<tr><td>T:nth-child(n)</td><td>A node of type T which is the nth child of an array parent</td><td>1</td></tr>
+<tr><td>T:nth-last-child(n)</td><td>A node of type T which is the nth child of an array parent counting from the end</td><td>2</td></tr>
+<tr><td>T:first-child</td><td>A node of type T which is the first child of an array parent (equivalent to T:nth-child(1)</td><td>1</td></tr>
+<tr><td>T:last-child</td><td>A node of type T which is the last child of an array parent (equivalent to T:nth-last-child(1)</td><td>2</td></tr>
+<tr><td>T:only-child</td><td>A node of type T which is the only child of an array parent</td><td>2</td></tr>
+<tr><td>T:empty</td><td>A node of type T which is an array or object with no child</td><td>2</td></tr>
+<tr><td>T U</td><td>A node of type U with an ancestor of type T</td><td>1</td></tr>
+<tr><td>T > U</td><td>A node of type U with a parent of type T</td><td>1</td></tr>
+<tr><td>T ~ U</td><td>A node of type U with a sibling of type T</td><td>2</td></tr>
+<tr><td>S1, S2</td><td>Any node which matches either selector S1 or S2</td><td>1</td></tr>
+<tr><td>T:has(S)</td><td>A node of type T which has a child node satisfying the selector S</td><td>3</td></tr>
+<tr><td>T:expr(E)</td><td>A node of type T with a value that satisfies the expression E</td><td>3</td></tr>
+<tr><td>T:val(V)</td><td>A node of type T with a value that is equal to V</td><td>3</td></tr>
+<tr><td>T:contains(S)</td><td>A node of type T with a string value contains the substring S</td><td>3</td></tr>
+</table>
+
+## Grouping<a name="grouping"></a>
+
+## Selectors<a name="selectors"></a>
+
+## Pseudo Classes<a name="pseudo"></a>
+
+## Expressions<a name="expressions"></a>
+
+## Combinators<a name="combinators"></a>
+
+## Grammar<a name="grammar"></a>
+
+(Adapted from [CSS3](http://www.w3.org/TR/css3-selectors/#descendant-combinators) and
+ [json.org](http://json.org/))
+
+ selectors_group
+ : selector [ `,` selector ]*
+ ;
+
+ selector
+ : simple_selector_sequence [ combinator simple_selector_sequence ]*
+ ;
+
+ combinator
+ : `>` | \s+
+ ;
+
+ simple_selector_sequence
+ /* why allow multiple HASH entities in the grammar? */
+ : [ type_selector | universal ]
+ [ class | pseudo ]*
+ | [ class | pseudo ]+
+ ;
+
+ type_selector
+ : `object` | `array` | `number` | `string` | `boolean` | `null`
+ ;
+
+ universal
+ : '*'
+ ;
+
+ class
+ : `.` name
+ | `.` json_string
+ ;
+
+ pseudo
+ /* Note that pseudo-elements are restricted to one per selector and */
+ /* occur only in the last simple_selector_sequence. */
+ : `:` pseudo_class_name
+ | `:` nth_function_name `(` nth_expression `)`
+ | `:has` `(` selectors_group `)`
+ | `:expr` `(` expr `)`
+ | `:contains` `(` json_string `)`
+ | `:val` `(` val `)`
+ ;
+
+ pseudo_class_name
+ : `root` | `first-child` | `last-child` | `only-child`
+
+ nth_function_name
+ : `nth-child` | `nth-last-child`
+
+ nth_expression
+ /* expression is and of the form "an+b" */
+ : TODO
+ ;
+
+ expr
+ : expr binop expr
+ | '(' expr ')'
+ | val
+ ;
+
+ binop
+ : '*' | '/' | '%' | '+' | '-' | '<=' | '>=' | '$='
+ | '^=' | '*=' | '>' | '<' | '=' | '!=' | '&&' | '||'
+ ;
+
+ val
+ : json_number | json_string | 'true' | 'false' | 'null' | 'x'
+ ;
+
+ json_string
+ : `"` json_chars* `"`
+ ;
+
+ json_chars
+ : any-Unicode-character-except-"-or-\-or-control-character
+ | `\"`
+ | `\\`
+ | `\/`
+ | `\b`
+ | `\f`
+ | `\n`
+ | `\r`
+ | `\t`
+ | \u four-hex-digits
+ ;
+
+ name
+ : nmstart nmchar*
+ ;
+
+ nmstart
+ : escape | [_a-zA-Z] | nonascii
+ ;
+
+ nmchar
+ : [_a-zA-Z0-9-]
+ | escape
+ | nonascii
+ ;
+
+ escape
+ : \\[^\r\n\f0-9a-fA-F]
+ ;
+
+ nonascii
+ : [^\0-0177]
+ ;
+
+## Conformance Tests<a name="tests"></a>
+
+See [https://github.com/lloyd/JSONSelectTests](https://github.com/lloyd/JSONSelectTests)
+
+## References<a name="references"></a>
+
+In no particular order.
+
+ * [http://json.org/](http://json.org/)
+ * [http://www.w3.org/TR/css3-selectors/](http://www.w3.org/TR/css3-selectors/)
+ * [http://ejohn.org/blog/selectors-that-people-actually-use/](http://ejohn.org/blog/selectors-that-people-actually-use/)
+ * [http://shauninman.com/archive/2008/05/05/css\_qualified\_selectors]( * http://shauninman.com/archive/2008/05/05/css_qualified_selectors)
+ * [http://snook.ca/archives/html\_and\_css/css-parent-selectors](http://snook.ca/archives/html_and_css/css-parent-selectors)
+ * [http://remysharp.com/2010/10/11/css-parent-selector/](http://remysharp.com/2010/10/11/css-parent-selector/)
+ * [https://github.com/jquery/sizzle/wiki/Sizzle-Home](https://github.com/jquery/sizzle/wiki/Sizzle-Home)
http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/README.md
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/README.md b/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/README.md
new file mode 100644
index 0000000..00a573e
--- /dev/null
+++ b/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/README.md
@@ -0,0 +1,33 @@
+JSONSelect is *EXPERIMENTAL*, *ALPHA*, etc.
+
+JSONSelect defines a selector language similar to CSS intended for
+JSON documents. For an introduction to the project see
+[jsonselect.org](http://jsonselect.org) or the [documentation](https://github.com/lloyd/JSONSelect/blob/master/JSONSelect.md).
+
+## Project Overview
+
+JSONSelect is an attempt to create a selector language similar to
+CSS for JSON objects. A couple key goals of the project's include:
+
+ * **intuitive** - JSONSelect is meant to *feel like* CSS, meaning a developers with an understanding of CSS can probably guess most of the syntax.
+ * **expressive** - As JSONSelect evolves, it will include more of the most popular constructs from the CSS spec and popular implementations (like [sizzle](http://sizzlejs.com/)). A successful result will be a good balance of simplicity and power.
+ * **language independence** - The project will avoid features which are unnecessarily tied to a particular implementation language.
+ * **incremental adoption** - JSONSelect features are broken in to conformance levels, to make it easier to build basic support and to allow incremental stabilization of the language.
+ * **efficient** - As many constructs of the language as possible will be able to be evaluated in a single document traversal. This allows for efficient stream filtering.
+
+JSONSelect should make common operations easy, complex operations possible,
+but haughtily ignore weird shit.
+
+## What's Here
+
+This repository is the home to many things related to JSONSelect:
+
+ * [Documentation](https://github.com/lloyd/JSONSelect/blob/master/JSONSelect.md) which describes the language
+ * The [jsonselect.org](http://jsonselect.org) [site source](https://github.com/lloyd/JSONSelect/blob/master/site/)
+ * A [reference implementation](https://github.com/lloyd/JSONSelect/blob/master/src/jsonselect.js) in JavaScript
+
+## Related projects
+
+Conformance tests are broken out into a [separate
+repository](https://github.com/lloyd/JSONSelectTests) and may be used
+by other implementations.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/package.json
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/package.json b/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/package.json
new file mode 100644
index 0000000..fae9d34
--- /dev/null
+++ b/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/package.json
@@ -0,0 +1,49 @@
+{
+ "author": {
+ "name": "Lloyd Hilaiel",
+ "email": "lloyd@hilaiel.com",
+ "url": "http://trickyco.de"
+ },
+ "name": "JSONSelect",
+ "description": "CSS-like selectors for JSON",
+ "version": "0.2.1",
+ "homepage": "http://jsonselect.org",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/lloyd/JSONSelect.git"
+ },
+ "main": "src/jsonselect",
+ "engines": {
+ "node": ">=0.4.7"
+ },
+ "dependencies": {},
+ "devDependencies": {},
+ "files": [
+ "src/jsonselect.js",
+ "src/test/run.js",
+ "src/test/tests",
+ "tests",
+ "README.md",
+ "JSONSelect.md",
+ "package.json",
+ "LICENSE"
+ ],
+ "_id": "JSONSelect@0.2.1",
+ "_engineSupported": true,
+ "_npmVersion": "1.0.6",
+ "_nodeVersion": "v0.4.7",
+ "_defaultsLoaded": true,
+ "dist": {
+ "shasum": "415418a526d33fe31d74b4defa3c836d485ec203",
+ "tarball": "http://registry.npmjs.org/JSONSelect/-/JSONSelect-0.2.1.tgz"
+ },
+ "scripts": {},
+ "directories": {},
+ "_shasum": "415418a526d33fe31d74b4defa3c836d485ec203",
+ "_from": "JSONSelect@0.2.1",
+ "_resolved": "https://registry.npmjs.org/JSONSelect/-/JSONSelect-0.2.1.tgz",
+ "bugs": {
+ "url": "https://github.com/lloyd/JSONSelect/issues"
+ },
+ "readme": "ERROR: No README data found!"
+}
http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/site/css/droid_sans.css
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/site/css/droid_sans.css b/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/site/css/droid_sans.css
new file mode 100644
index 0000000..0826445
--- /dev/null
+++ b/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/site/css/droid_sans.css
@@ -0,0 +1,6 @@
+@font-face {
+ font-family: 'Droid Sans';
+ font-style: normal;
+ font-weight: normal;
+ src: local('Droid Sans'), local('DroidSans'), url('droid_sans.tt') format('truetype');
+}
http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/site/css/droid_sans.tt
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/site/css/droid_sans.tt b/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/site/css/droid_sans.tt
new file mode 100644
index 0000000..efd1f8b
Binary files /dev/null and b/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/site/css/droid_sans.tt differ
http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/site/css/style.css
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/site/css/style.css b/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/site/css/style.css
new file mode 100644
index 0000000..b4fbaa6
--- /dev/null
+++ b/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/site/css/style.css
@@ -0,0 +1,209 @@
+body {
+ background-color: #191919;
+ color: #a1a1a1;
+ font-family: 'Droid Sans', arial, serif;
+ font-size: 14px;
+}
+
+#header {
+ position: fixed;
+ background-color: #191919;
+ opacity: .7;
+ color: #ccc;
+ width: 100%;
+ top: 0px;
+ left: 0px;
+ margin: 0px;
+ padding: 4px 10px 4px 10px;
+}
+
+#main {
+ margin-top: 100px;
+}
+
+#header b {
+ font-weight: bold;
+ color: #fff;
+}
+
+a {
+ color: #999;
+ text-decoration: underline;
+}
+
+a:hover {
+ color: #fff;
+}
+
+#header .title {
+ font-size: 400%;
+}
+
+#header .subtitle {
+ font-size: 150%;
+ margin-left: 1em;
+ font-style: italic;
+}
+
+#header .nav {
+ float: right;
+ margin-right: 100px;
+}
+
+div.content {
+ max-width: 850px;
+ min-width: 675px;
+ margin: auto;
+}
+
+div#tryit {
+ min-width: 825px;
+}
+
+#splash {
+ max-width: 700px;
+}
+
+.json {
+ background-color: #333;
+ padding: .5em 1em .5em 1em;
+ border: 3px solid #444;
+ border-radius: 1em;
+ -moz-border-radius: 1em;
+ -webkit-border-radius: 1em;
+}
+
+#splash .sample {
+ width: 250px;
+ float: right;
+ margin-left: 1em;
+ margin-top: 3em;
+ font-size: 90%;
+}
+
+#doc {
+ margin-top: 140px;
+}
+
+#doc table {
+ width: 100%;
+}
+
+#doc table th {
+ background-color: #aaa;
+ color: #333;
+ padding: 10px;
+}
+
+#doc table tr td:first-child {
+ font-family: "andale mono",monospace;
+}
+
+#doc table td {
+ padding-top: 3px;
+}
+
+#splash .sample tt {
+ font-size: 90%;
+ padding: 0 .2em 0 .2em;
+}
+
+#splash .sample pre {
+ border-top: 1px dashed #aaa;
+ padding-top: 1em;
+}
+
+#splash .pitch {
+ padding-top: 2em;
+ font-size: 170%;
+}
+
+.selected {
+ opacity: .7;
+ padding: 8px;
+ margin: -10px;
+ background-color: #fff475;
+ color: #000;
+ border: 2px solid white;
+ border-radius: 4px;
+ -moz-border-radius: 4px;
+ -webkit-border-radius: 4px;
+}
+
+div.current input, div.selector, pre, code, tt {
+ font-family: "andale mono",monospace;
+ font-size: .9em;
+}
+
+div.current {
+ width: 100%;
+ padding: 1em;
+}
+
+div.current input {
+ color: #fff;
+ font-size: 110%;
+ background-color: #333;
+ border: 1px solid #444;
+ padding: 8px;
+ width: 400px;
+ margin-left: 1em;
+ margin-right: 1em;
+ border-radius: 4px;
+ -moz-border-radius: 4px;
+ -webkit-border-radius: 4px;
+}
+
+pre.doc {
+ float: right;
+ padding: 1em 3em 1em 3em;
+ padding-right: 160px;
+ font-size: 90%;
+}
+
+.selectors {
+ margin: 1em;
+ background-color: #444;
+ width: 300px;
+ padding: 8px;
+ border-radius: 4px;
+ -moz-border-radius: 4px;
+ -webkit-border-radius: 4px;
+
+}
+.selectors .selector {
+ background-color: #333;
+ padding: .4em;
+ margin: 1px;
+ cursor: pointer;
+}
+
+.selectors .selector.inuse {
+ border: 1px solid #9f9;
+ margin: -1px;
+ margin-left: 0px;
+}
+
+.results.error {
+ color: #f99;
+}
+
+.results {
+ color: #9f9;
+ font-size: 90%;
+ width: 300px;
+}
+
+#cred, #code {
+ padding-top: 2em;
+}
+
+p.psst {
+ margin-top: 4em;
+ font-size: .9em;
+}
+
+p.item {
+ margin-top: 2em;
+ margin-left: 1em;
+}
http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/site/index.html
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/site/index.html b/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/site/index.html
new file mode 100644
index 0000000..984e184
--- /dev/null
+++ b/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/site/index.html
@@ -0,0 +1,139 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title> JSONSelect </title>
+ <link href='css/droid_sans.css' rel='stylesheet' type='text/css'>
+ <link href='css/style.css' type='text/css' rel='stylesheet'>
+ </head>
+ <body>
+ <div id="header">
+ <div class="content">
+ <div class="title">json<b>:</b>select<b>()</b></div>
+ <div class="nav"> <a href="#overview">Overview</a> | <a href="#tryit">Try It!</a> | <a href="#docs">Docs</a> | <a href="#code">Code</a> | <a href="mailto:jsonselect@librelist.com">Contact</a> | <a href="#cred">Credit</a> </div>
+ <div class="subtitle">CSS-like selectors for JSON.</div>
+ </div>
+ </div>
+ <div id="main">
+ <div style="display: none" id="splash" class="content">
+ <div class="sample json">
+ <tt>".author .drinkPref :first-child"</tt>
+ <pre>{
+ "author": {
+ "name": {
+ "first": "Lloyd",
+ "last": "Hilaiel"
+ },
+ "drinkPref": [
+ <span class="selected">"whiskey"</span>,
+ "beer",
+ "wine"
+ ],
+ },
+ "thing": "JSONSelect site",
+ "license": "<a href="http://creativecommons.org/licenses/by-sa/3.0/us/">(cc) BY-SA</a>"
+}</pre></div>
+ <div class="pitch">
+ <p>JSONSelect is an <i>experimental</i> selector language for JSON.</p>
+ <p>It makes it easy to access data in complex JSON documents.</p>
+ <p>It <i>feels like</i> CSS.</p>
+ <p>Why not <a href="#tryit">give it a try</a>?
+ </div>
+ </div>
+ <div id="tryit" style="display: none" class="content">
+ <div class="current"> Current Selector (click to edit): <input type="text"></input><span class="results"></span></div>
+ <pre class="doc json">
+{
+ "name": {
+ "first": "Lloyd",
+ "last": "Hilaiel"
+ },
+ "favoriteColor": "yellow",
+ "languagesSpoken": [
+ {
+ "lang": "Bulgarian",
+ "level": "advanced"
+ },
+ {
+ "lang": "English",
+ "level": "native",
+ "preferred": true
+ },
+ {
+ "lang": "Spanish",
+ "level": "beginner"
+ }
+ ],
+ "seatingPreference": [
+ "window",
+ "aisle"
+ ],
+ "drinkPreference": [
+ "whiskey",
+ "beer",
+ "wine"
+ ],
+ "weight": 172
+}
+ </pre>
+ <div class="selectors">
+ <div class="title"> Choose A Selector... </div>
+ <div class="selector">.languagesSpoken .lang</div>
+ <div class="selector">.drinkPreference :first-child</div>
+ <div class="selector">."weight"</div>
+ <div class="selector">.lang</div>
+ <div class="selector">.favoriteColor</div>
+ <div class="selector">string.favoriteColor</div>
+ <div class="selector">string:last-child</div>
+ <div class="selector">string:nth-child(-n+2)</div>
+ <div class="selector">string:nth-child(odd)</div>
+ <div class="selector">string:nth-last-child(1)</div>
+ <div class="selector">:root</div>
+ <div class="selector">number</div>
+ <div class="selector">:has(:root > .preferred)</div>
+ <div class="selector">.preferred ~ .lang</div>
+ <div class="selector">:has(.lang:val("Spanish")) > .level</div>
+ <div class="selector">.lang:val("Bulgarian") ~ .level</div>
+ <div class="selector">.seatingPreference :nth-child(1)</div>
+ <div class="selector">.weight:expr(x<180) ~ .name .first</div>
+ </div>
+ </div>
+ <div style="display: none" id="cred" class="content">
+ <p>JSONSelect is dedicated to sad code everywhere that looks like this:</p>
+ <pre class="json">if (foo && foo.bar && foo.bar.baz && foo.bar.baz.length > 2)
+ return foo.bar.baz[2];
+return undefined;</pre>
+ <p><a href="http://trickyco.de/">Lloyd Hilaiel</a> started it, and is surrounded by many <a href="https://github.com/lloyd/JSONSelect/contributors">awesome contributors</a>.</p>
+ <p><a href="http://blog.mozilla.com/dherman/">Dave Herman</a> provided the name, and lots of encouragement.</p>
+ <p><a href="http://open-mike.org/">Mike Hanson</a> gave deep feedback and ideas.</p>
+ <p><a href="http://ejohn.org/">John Resig</a> unwittingly contributed his <a href="http://ejohn.org/blog/selectors-that-people-actually-use/">design thoughts</a>.</p>
+ <p>The jsonselect.org site design was inspired by <a href="http://www.stephenwildish.co.uk/">Stephen Wildish</a>.</p>
+ <p><a href="http://json.org/">JSON</a> and <a href="http://www.w3.org/TR/css3-selectors/">CSS3 Selectors</a> are the prerequisites to JSONSelect's existence, so thanks to you guys too.</p>
+ <p></p>
+ </div>
+ <div style="display: none" id="doc" class="content">
+ Loading documentation...
+ </div>
+ <div style="display: none" id="code" class="content">
+ <p>Several different implementations of JSONSelect are available:</p>
+ <p class="item"><b>JavaScript:</b> Get it <a href="js/jsonselect.js">documented</a>, or <a href="js/jsonselect.min.js">minified</a> (<i>2.9k</i> minified and gzipped).
+ The code is <a href="https://github.com/lloyd/JSONSelect">on github</a>.</p>
+ <p class="item"><b>node.js:</b> <tt>npm install JSONSelect</tt></p>
+ <p class="item"><b>ruby:</b> A gem by <a href="https://github.com/fd">Simon Menke</a>: <a href="https://github.com/fd/json_select">https://github.com/fd/json_select</a></p>
+ <p class="psst">
+ Something missing from this list? Please, <a href="https://github.com/lloyd/JSONSelect/issues">tell me about it</a>.
+ </p>
+ </div>
+
+ </div>
+
+
+<a href="https://github.com/lloyd/JSONSelect"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://d3nwyuy0nl342s.cloudfront.net/img/4c7dc970b89fd04b81c8e221ba88ff99a06c6b61/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f77686974655f6666666666662e706e67" alt="Fork me on GitHub"></a>
+ </body>
+ <script src="js/json2.js"></script>
+ <script src="js/showdown.js"></script>
+ <script src="js/jquery-1.6.1.min.js"></script>
+ <script src="js/jquery.ba-hashchange.min.js"></script>
+ <script src="js/jsonselect.js"></script>
+ <script src="js/nav.js"></script>
+ <script src="js/demo.js"></script>
+</html>
http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/b2b43200/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/site/js/demo.js
----------------------------------------------------------------------
diff --git a/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/site/js/demo.js b/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/site/js/demo.js
new file mode 100644
index 0000000..7462cf9
--- /dev/null
+++ b/node_modules/node-firefox-connect/node_modules/firefox-client/node_modules/js-select/node_modules/JSONSelect/site/js/demo.js
@@ -0,0 +1,64 @@
+window.jsel = JSONSelect;
+
+$(document).ready(function() {
+ var theDoc = JSON.parse($("pre.doc").text());
+
+ function highlightMatches(ar) {
+ // first calculate match offsets
+ var wrk = [];
+ var html = $.trim(JSON.stringify(theDoc, undefined, 4));
+ var ss = "<span class=\"selected\">";
+ var es = "</span>";
+ for (var i = 0; i < ar.length; i++) {
+ var found = $.trim(JSON.stringify(ar[i], undefined, 4));
+ // turn the string into a regex to handle indentation
+ found = found.replace(/[-[\]{}()*+?.,\\^$|#]/g, "\\$&").replace(/\s+/gm, "\\s*");
+ var re = new RegExp(found, "m");
+ var m = re.exec(html);
+ if (!m) continue;
+ wrk.push({ off: m.index, typ: "s" });
+ wrk.push({ off: m[0].length+m.index, typ: "e" });
+ }
+ // sort by offset
+ wrk = wrk.sort(function(a,b) { return a.off - b.off; });
+
+ // now start injecting spans into the text
+ var cur = 0;
+ var cons = 0;
+ for (var i = 0; i < wrk.length; i++) {
+ var diff = wrk[i].off - cons;
+ cons = wrk[i].off;
+ var tag = (wrk[i].typ == 's' ? ss : es);
+ cur += diff;
+ html = html.substr(0, cur) + tag + html.substr(cur);
+ cur += tag.length;
+ }
+ return html;
+ }
+
+ // when a selector is chosen, update the text box
+ $(".selectors .selector").click(function() {
+ $(".current input").val($(this).text()).keyup();
+ });
+
+ var lastSel;
+ $(".current input").keyup(function () {
+ try {
+ var sel = $(".current input").val()
+ if (lastSel === $.trim(sel)) return;
+ lastSel = $.trim(sel);
+ var ar = jsel.match(sel, theDoc);
+ $(".current .results").text(ar.length + " match" + (ar.length == 1 ? "" : "es"))
+ .removeClass("error");
+ $("pre.doc").html(highlightMatches(ar));
+ $("pre.doc .selected").hide().fadeIn(700);
+ } catch(e) {
+ $(".current .results").text(e.toString()).addClass("error");
+ $("pre.doc").text($.trim(JSON.stringify(theDoc, undefined, 4)));
+ }
+ $(".selectors .selector").removeClass("inuse");
+ $(".selectors div.selector").each(function() {
+ if ($(this).text() === sel) $(this).addClass("inuse");
+ });
+ });
+});
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org