http://git-wip-us.apache.org/repos/asf/cordova-android/blob/1d7ccaec/node_modules/plist/examples/browser/index.html ---------------------------------------------------------------------- diff --git a/node_modules/plist/examples/browser/index.html b/node_modules/plist/examples/browser/index.html new file mode 100644 index 0000000..8ce7d92 --- /dev/null +++ b/node_modules/plist/examples/browser/index.html @@ -0,0 +1,14 @@ +<!DOCTYPE html> +<html> + <head> + <title>plist.js browser example</title> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + </head> + <body> + <script src="../../dist/plist.js"></script> + <script> + // TODO: add <input type=file> drag and drop example + console.log(plist); + </script> + </body> +</html>
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/1d7ccaec/node_modules/plist/lib/build.js ---------------------------------------------------------------------- diff --git a/node_modules/plist/lib/build.js b/node_modules/plist/lib/build.js new file mode 100644 index 0000000..e2b9454 --- /dev/null +++ b/node_modules/plist/lib/build.js @@ -0,0 +1,138 @@ + +/** + * Module dependencies. + */ + +var base64 = require('base64-js'); +var xmlbuilder = require('xmlbuilder'); + +/** + * Module exports. + */ + +exports.build = build; + +/** + * Accepts a `Date` instance and returns an ISO date string. + * + * @param {Date} d - Date instance to serialize + * @returns {String} ISO date string representation of `d` + * @api private + */ + +function ISODateString(d){ + function pad(n){ + return n < 10 ? '0' + n : n; + } + return d.getUTCFullYear()+'-' + + pad(d.getUTCMonth()+1)+'-' + + pad(d.getUTCDate())+'T' + + pad(d.getUTCHours())+':' + + pad(d.getUTCMinutes())+':' + + pad(d.getUTCSeconds())+'Z'; +} + +/** + * Returns the internal "type" of `obj` via the + * `Object.prototype.toString()` trick. + * + * @param {Mixed} obj - any value + * @returns {String} the internal "type" name + * @api private + */ + +var toString = Object.prototype.toString; +function type (obj) { + var m = toString.call(obj).match(/\[object (.*)\]/); + return m ? m[1] : m; +} + +/** + * Generate an XML plist string from the input object `obj`. + * + * @param {Object} obj - the object to convert + * @param {Object} [opts] - optional options object + * @returns {String} converted plist XML string + * @api public + */ + +function build (obj, opts) { + var XMLHDR = { + version: '1.0', + encoding: 'UTF-8' + }; + + var XMLDTD = { + pubid: '-//Apple//DTD PLIST 1.0//EN', + sysid: 'http://www.apple.com/DTDs/PropertyList-1.0.dtd' + }; + + var doc = xmlbuilder.create('plist'); + + doc.dec(XMLHDR.version, XMLHDR.encoding, XMLHDR.standalone); + doc.dtd(XMLDTD.pubid, XMLDTD.sysid); + doc.att('version', '1.0'); + + walk_obj(obj, doc); + + if (!opts) opts = {}; + // default `pretty` to `true` + opts.pretty = opts.pretty !== false; + return doc.end(opts); +} + +/** + * depth first, recursive traversal of a javascript object. when complete, + * next_child contains a reference to the build XML object. + * + * @api private + */ + +function walk_obj(next, next_child) { + var tag_type, i, prop; + var name = type(next); + + if ('Undefined' == name) { + return; + } else if (Array.isArray(next)) { + next_child = next_child.ele('array'); + for (i = 0; i < next.length; i++) { + walk_obj(next[i], next_child); + } + + } else if (Buffer.isBuffer(next)) { + next_child.ele('data').raw(next.toString('base64')); + + } else if ('Object' == name) { + next_child = next_child.ele('dict'); + for (prop in next) { + if (next.hasOwnProperty(prop)) { + next_child.ele('key').txt(prop); + walk_obj(next[prop], next_child); + } + } + + } else if ('Number' == name) { + // detect if this is an integer or real + // TODO: add an ability to force one way or another via a "cast" + tag_type = (next % 1 === 0) ? 'integer' : 'real'; + next_child.ele(tag_type).txt(next.toString()); + + } else if ('Date' == name) { + next_child.ele('date').txt(ISODateString(new Date(next))); + + } else if ('Boolean' == name) { + next_child.ele(next ? 'true' : 'false'); + + } else if ('String' == name) { + next_child.ele('string').txt(next); + + } else if ('ArrayBuffer' == name) { + next_child.ele('data').raw(base64.fromByteArray(next)); + + } else if (next && next.buffer && 'ArrayBuffer' == type(next.buffer)) { + // a typed array + next_child.ele('data').raw(base64.fromByteArray(new Uint8Array(next.buffer), next_child)); + + } +} http://git-wip-us.apache.org/repos/asf/cordova-android/blob/1d7ccaec/node_modules/plist/lib/node.js ---------------------------------------------------------------------- diff --git a/node_modules/plist/lib/node.js b/node_modules/plist/lib/node.js new file mode 100644 index 0000000..ac18e32 --- /dev/null +++ b/node_modules/plist/lib/node.js @@ -0,0 +1,49 @@ +/** + * Module dependencies. + */ + +var fs = require('fs'); +var parse = require('./parse'); +var deprecate = require('util-deprecate'); + +/** + * Module exports. + */ + +exports.parseFile = deprecate(parseFile, '`parseFile()` is deprecated. ' + + 'Use `parseString()` instead.'); +exports.parseFileSync = deprecate(parseFileSync, '`parseFileSync()` is deprecated. ' + + 'Use `parseStringSync()` instead.'); + +/** + * Parses file `filename` as a .plist file. + * Invokes `fn` callback function when done. + * + * @param {String} filename - name of the file to read + * @param {Function} fn - callback function + * @api public + * @deprecated use parseString() instead + */ + +function parseFile (filename, fn) { + fs.readFile(filename, { encoding: 'utf8' }, onread); + function onread (err, inxml) { + if (err) return fn(err); + parse.parseString(inxml, fn); + } +} + +/** + * Parses file `filename` as a .plist file. + * Returns a when done. + * + * @param {String} filename - name of the file to read + * @param {Function} fn - callback function + * @api public + * @deprecated use parseStringSync() instead + */ + +function parseFileSync (filename) { + var inxml = fs.readFileSync(filename, 'utf8'); + return parse.parseStringSync(inxml); +} http://git-wip-us.apache.org/repos/asf/cordova-android/blob/1d7ccaec/node_modules/plist/lib/parse.js ---------------------------------------------------------------------- diff --git a/node_modules/plist/lib/parse.js b/node_modules/plist/lib/parse.js new file mode 100644 index 0000000..c154384 --- /dev/null +++ b/node_modules/plist/lib/parse.js @@ -0,0 +1,200 @@ + +/** + * Module dependencies. + */ + +var deprecate = require('util-deprecate'); +var DOMParser = require('xmldom').DOMParser; + +/** + * Module exports. + */ + +exports.parse = parse; +exports.parseString = deprecate(parseString, '`parseString()` is deprecated. ' + + 'It\'s not actually async. Use `parse()` instead.'); +exports.parseStringSync = deprecate(parseStringSync, '`parseStringSync()` is ' + + 'deprecated. Use `parse()` instead.'); + +/** + * We ignore raw text (usually whitespace), <!-- xml comments -->, + * and raw CDATA nodes. + * + * @param {Element} node + * @returns {Boolean} + * @api private + */ + +function shouldIgnoreNode (node) { + return node.nodeType === 3 // text + || node.nodeType === 8 // comment + || node.nodeType === 4; // cdata +} + + +/** + * Parses a Plist XML string. Returns an Object. + * + * @param {String} xml - the XML String to decode + * @returns {Mixed} the decoded value from the Plist XML + * @api public + */ + +function parse (xml) { + var doc = new DOMParser().parseFromString(xml); + if (doc.documentElement.nodeName !== 'plist') { + throw new Error('malformed document. First element should be <plist>'); + } + var plist = parsePlistXML(doc.documentElement); + + // the root <plist> node gets interpreted as an Array, + // so pull out the inner data first + if (plist.length == 1) plist = plist[0]; + + return plist; +} + +/** + * Parses a Plist XML string. Returns an Object. Takes a `callback` function. + * + * @param {String} xml - the XML String to decode + * @param {Function} callback - callback function + * @returns {Mixed} the decoded value from the Plist XML + * @api public + * @deprecated not actually async. use parse() instead + */ + +function parseString (xml, callback) { + var doc, error, plist; + try { + doc = new DOMParser().parseFromString(xml); + plist = parsePlistXML(doc.documentElement); + } catch(e) { + error = e; + } + callback(error, plist); +} + +/** + * Parses a Plist XML string. Returns an Object. + * + * @param {String} xml - the XML String to decode + * @param {Function} callback - callback function + * @returns {Mixed} the decoded value from the Plist XML + * @api public + * @deprecated use parse() instead + */ + +function parseStringSync (xml) { + var doc = new DOMParser().parseFromString(xml); + var plist; + if (doc.documentElement.nodeName !== 'plist') { + throw new Error('malformed document. First element should be <plist>'); + } + plist = parsePlistXML(doc.documentElement); + + // if the plist is an array with 1 element, pull it out of the array + if (plist.length == 1) { + plist = plist[0]; + } + return plist; +} + +/** + * Convert an XML based plist document into a JSON representation. + * + * @param {Object} xml_node - current XML node in the plist + * @returns {Mixed} built up JSON object + * @api private + */ + +function parsePlistXML (node) { + var i, new_obj, key, val, new_arr, res, d; + + if (!node) + return null; + + if (node.nodeName === 'plist') { + new_arr = []; + for (i=0; i < node.childNodes.length; i++) { + // ignore comment nodes (text) + if (!shouldIgnoreNode(node.childNodes[i])) { + new_arr.push( parsePlistXML(node.childNodes[i])); + } + } + return new_arr; + + } else if (node.nodeName === 'dict') { + new_obj = {}; + key = null; + for (i=0; i < node.childNodes.length; i++) { + // ignore comment nodes (text) + if (!shouldIgnoreNode(node.childNodes[i])) { + if (key === null) { + key = parsePlistXML(node.childNodes[i]); + } else { + new_obj[key] = parsePlistXML(node.childNodes[i]); + key = null; + } + } + } + return new_obj; + + } else if (node.nodeName === 'array') { + new_arr = []; + for (i=0; i < node.childNodes.length; i++) { + // ignore comment nodes (text) + if (!shouldIgnoreNode(node.childNodes[i])) { + res = parsePlistXML(node.childNodes[i]); + if (null != res) new_arr.push(res); + } + } + return new_arr; + + } else if (node.nodeName === '#text') { + // TODO: what should we do with text types? (CDATA sections) + + } else if (node.nodeName === 'key') { + return node.childNodes[0].nodeValue; + + } else if (node.nodeName === 'string') { + res = ''; + for (d=0; d < node.childNodes.length; d++) { + res += node.childNodes[d].nodeValue; + } + return res; + + } else if (node.nodeName === 'integer') { + // parse as base 10 integer + return parseInt(node.childNodes[0].nodeValue, 10); + + } else if (node.nodeName === 'real') { + res = ''; + for (d=0; d < node.childNodes.length; d++) { + if (node.childNodes[d].nodeType === 3) { + res += node.childNodes[d].nodeValue; + } + } + return parseFloat(res); + + } else if (node.nodeName === 'data') { + res = ''; + for (d=0; d < node.childNodes.length; d++) { + if (node.childNodes[d].nodeType === 3) { + res += node.childNodes[d].nodeValue.replace(/\s+/g, ''); + } + } + + // decode base64 data to a Buffer instance + return new Buffer(res, 'base64'); + + } else if (node.nodeName === 'date') { + return new Date(node.childNodes[0].nodeValue); + + } else if (node.nodeName === 'true') { + return true; + + } else if (node.nodeName === 'false') { + return false; + } +} http://git-wip-us.apache.org/repos/asf/cordova-android/blob/1d7ccaec/node_modules/plist/lib/plist.js ---------------------------------------------------------------------- diff --git a/node_modules/plist/lib/plist.js b/node_modules/plist/lib/plist.js new file mode 100644 index 0000000..00a4167 --- /dev/null +++ b/node_modules/plist/lib/plist.js @@ -0,0 +1,23 @@ + +var i; + +/** + * Parser functions. + */ + +var parserFunctions = require('./parse'); +for (i in parserFunctions) exports[i] = parserFunctions[i]; + +/** + * Builder functions. + */ + +var builderFunctions = require('./build'); +for (i in builderFunctions) exports[i] = builderFunctions[i]; + +/** + * Add Node.js-specific functions (they're deprecatedâ¦). + */ + +var nodeFunctions = require('./node'); +for (i in nodeFunctions) exports[i] = nodeFunctions[i]; http://git-wip-us.apache.org/repos/asf/cordova-android/blob/1d7ccaec/node_modules/plist/package.json ---------------------------------------------------------------------- diff --git a/node_modules/plist/package.json b/node_modules/plist/package.json new file mode 100644 index 0000000..dddb405 --- /dev/null +++ b/node_modules/plist/package.json @@ -0,0 +1,117 @@ +{ + "_args": [ + [ + "plist@^1.2.0", + "/Users/steveng/repo/cordova/cordova-android/node_modules/cordova-common" + ] + ], + "_from": "plist@>=1.2.0 <2.0.0", + "_id": "[email protected]", + "_inCache": true, + "_installable": true, + "_location": "/plist", + "_nodeVersion": "5.0.0", + "_npmUser": { + "email": "[email protected]", + "name": "mreinstein" + }, + "_npmVersion": "3.3.11", + "_phantomChildren": {}, + "_requested": { + "name": "plist", + "raw": "plist@^1.2.0", + "rawSpec": "^1.2.0", + "scope": null, + "spec": ">=1.2.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/cordova-common" + ], + "_resolved": "http://registry.npmjs.org/plist/-/plist-1.2.0.tgz", + "_shasum": "084b5093ddc92506e259f874b8d9b1afb8c79593", + "_shrinkwrap": null, + "_spec": "plist@^1.2.0", + "_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/cordova-common", + "author": { + "email": "[email protected]", + "name": "Nathan Rajlich" + }, + "bugs": { + "url": "https://github.com/TooTallNate/node-plist/issues" + }, + "contributors": [ + { + "name": "Hans Huebner", + "email": "[email protected]" + }, + { + "name": "Pierre Metrailler" + }, + { + "name": "Mike Reinstein", + "email": "[email protected]" + }, + { + "name": "Vladimir Tsvang" + }, + { + "name": "Mathieu D'Amours" + } + ], + "dependencies": { + "base64-js": "0.0.8", + "util-deprecate": "1.0.2", + "xmlbuilder": "4.0.0", + "xmldom": "0.1.x" + }, + "description": "Mac OS X Plist parser/builder for Node.js and browsers", + "devDependencies": { + "browserify": "12.0.1", + "mocha": "2.3.3", + "multiline": "1.0.2", + "zuul": "3.7.2" + }, + "directories": {}, + "dist": { + "shasum": "084b5093ddc92506e259f874b8d9b1afb8c79593", + "tarball": "http://registry.npmjs.org/plist/-/plist-1.2.0.tgz" + }, + "gitHead": "69520574f27864145192338b72e608fbe1bda6f7", + "homepage": "https://github.com/TooTallNate/node-plist#readme", + "keywords": [ + "apple", + "browser", + "mac", + "parser", + "plist", + "xml" + ], + "license": "MIT", + "main": "lib/plist.js", + "maintainers": [ + { + "name": "TooTallNate", + "email": "[email protected]" + }, + { + "name": "tootallnate", + "email": "[email protected]" + }, + { + "name": "mreinstein", + "email": "[email protected]" + } + ], + "name": "plist", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/node-plist.git" + }, + "scripts": { + "test": "make test" + }, + "version": "1.2.0" +} http://git-wip-us.apache.org/repos/asf/cordova-android/blob/1d7ccaec/node_modules/properties-parser/package.json ---------------------------------------------------------------------- diff --git a/node_modules/properties-parser/package.json b/node_modules/properties-parser/package.json index c74be98..b089b27 100644 --- a/node_modules/properties-parser/package.json +++ b/node_modules/properties-parser/package.json @@ -1,46 +1,73 @@ { - "name": "properties-parser", - "version": "0.2.3", + "_args": [ + [ + "properties-parser@^0.2.3", + "/Users/steveng/repo/cordova/cordova-android" + ] + ], + "_from": "properties-parser@>=0.2.3 <0.3.0", + "_id": "[email protected]", + "_inCache": true, + "_installable": true, + "_location": "/properties-parser", + "_npmUser": { + "email": "[email protected]", + "name": "xavi" + }, + "_npmVersion": "1.3.23", + "_phantomChildren": {}, + "_requested": { + "name": "properties-parser", + "raw": "properties-parser@^0.2.3", + "rawSpec": "^0.2.3", + "scope": null, + "spec": ">=0.2.3 <0.3.0", + "type": "range" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "http://registry.npmjs.org/properties-parser/-/properties-parser-0.2.3.tgz", + "_shasum": "f7591255f707abbff227c7b56b637dbb0373a10f", + "_shrinkwrap": null, + "_spec": "properties-parser@^0.2.3", + "_where": "/Users/steveng/repo/cordova/cordova-android", + "bugs": { + "url": "https://github.com/xavi-/node-properties-parser/issues" + }, + "dependencies": {}, "description": "A parser for .properties files written in javascript", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "f7591255f707abbff227c7b56b637dbb0373a10f", + "tarball": "http://registry.npmjs.org/properties-parser/-/properties-parser-0.2.3.tgz" + }, + "engines": { + "node": ">= 0.3.1" + }, + "homepage": "https://github.com/xavi-/node-properties-parser", "keywords": [ - "parser", ".properties", - "properties", - "java", + "actionscript", "file parser", - "actionscript" + "java", + "parser", + "properties" ], + "main": "./index.js", "maintainers": [ { "name": "xavi", "email": "[email protected]" } ], - "main": "./index.js", + "name": "properties-parser", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git+https://github.com/xavi-/node-properties-parser.git" }, - "engines": { - "node": ">= 0.3.1" - }, - "bugs": { - "url": "https://github.com/xavi-/node-properties-parser/issues" - }, - "homepage": "https://github.com/xavi-/node-properties-parser", - "_id": "[email protected]", - "dist": { - "shasum": "f7591255f707abbff227c7b56b637dbb0373a10f", - "tarball": "http://registry.npmjs.org/properties-parser/-/properties-parser-0.2.3.tgz" - }, - "_from": "properties-parser@>=0.2.3 <0.3.0", - "_npmVersion": "1.3.23", - "_npmUser": { - "name": "xavi", - "email": "[email protected]" - }, - "directories": {}, - "_shasum": "f7591255f707abbff227c7b56b637dbb0373a10f", - "_resolved": "http://registry.npmjs.org/properties-parser/-/properties-parser-0.2.3.tgz", - "readme": "ERROR: No README data found!" + "version": "0.2.3" } http://git-wip-us.apache.org/repos/asf/cordova-android/blob/1d7ccaec/node_modules/q/package.json ---------------------------------------------------------------------- diff --git a/node_modules/q/package.json b/node_modules/q/package.json index a576af9..40e4b1e 100644 --- a/node_modules/q/package.json +++ b/node_modules/q/package.json @@ -1,27 +1,47 @@ { - "name": "q", - "version": "1.4.1", - "description": "A library for promises (CommonJS/Promises/A,B,D)", - "homepage": "https://github.com/kriskowal/q", + "_args": [ + [ + "q@^1.4.1", + "/Users/steveng/repo/cordova/cordova-android" + ] + ], + "_from": "q@>=1.4.1 <2.0.0", + "_id": "[email protected]", + "_inCache": true, + "_installable": true, + "_location": "/q", + "_nodeVersion": "1.8.1", + "_npmUser": { + "email": "[email protected]", + "name": "kriskowal" + }, + "_npmVersion": "2.8.3", + "_phantomChildren": {}, + "_requested": { + "name": "q", + "raw": "q@^1.4.1", + "rawSpec": "^1.4.1", + "scope": null, + "spec": ">=1.4.1 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/", + "/cordova-common" + ], + "_resolved": "http://registry.npmjs.org/q/-/q-1.4.1.tgz", + "_shasum": "55705bcd93c5f3673530c2c2cbc0c2b3addc286e", + "_shrinkwrap": null, + "_spec": "q@^1.4.1", + "_where": "/Users/steveng/repo/cordova/cordova-android", "author": { - "name": "Kris Kowal", "email": "[email protected]", + "name": "Kris Kowal", "url": "https://github.com/kriskowal" }, - "keywords": [ - "q", - "promise", - "promises", - "promises-a", - "promises-aplus", - "deferred", - "future", - "async", - "flow control", - "fluent", - "browser", - "node" - ], + "bugs": { + "url": "http://github.com/kriskowal/q/issues" + }, "contributors": [ { "name": "Kris Kowal", @@ -39,28 +59,8 @@ "url": "http://domenicdenicola.com" } ], - "bugs": { - "url": "http://github.com/kriskowal/q/issues" - }, - "license": { - "type": "MIT", - "url": "http://github.com/kriskowal/q/raw/master/LICENSE" - }, - "main": "q.js", - "files": [ - "LICENSE", - "q.js", - "queue.js" - ], - "repository": { - "type": "git", - "url": "git://github.com/kriskowal/q.git" - }, - "engines": { - "node": ">=0.6.0", - "teleport": ">=0.2.0" - }, "dependencies": {}, + "description": "A library for promises (CommonJS/Promises/A,B,D)", "devDependencies": { "cover": "*", "grunt": "~0.4.1", @@ -72,35 +72,43 @@ "opener": "*", "promises-aplus-tests": "1.x" }, - "scripts": { - "test": "jasmine-node spec && promises-aplus-tests spec/aplus-adapter", - "test-browser": "opener spec/q-spec.html", - "benchmark": "matcha", - "lint": "jshint q.js", - "cover": "cover run jasmine-node spec && cover report html && opener cover_html/index.html", - "minify": "grunt", - "prepublish": "grunt" - }, - "overlay": { - "teleport": { - "dependencies": { - "system": ">=0.0.4" - } - } - }, "directories": { "test": "./spec" }, + "dist": { + "shasum": "55705bcd93c5f3673530c2c2cbc0c2b3addc286e", + "tarball": "http://registry.npmjs.org/q/-/q-1.4.1.tgz" + }, + "engines": { + "node": ">=0.6.0", + "teleport": ">=0.2.0" + }, + "files": [ + "LICENSE", + "q.js", + "queue.js" + ], "gitHead": "d373079d3620152e3d60e82f27265a09ee0e81bd", - "_id": "[email protected]", - "_shasum": "55705bcd93c5f3673530c2c2cbc0c2b3addc286e", - "_from": "q@>=1.4.1 <2.0.0", - "_npmVersion": "2.8.3", - "_nodeVersion": "1.8.1", - "_npmUser": { - "name": "kriskowal", - "email": "[email protected]" + "homepage": "https://github.com/kriskowal/q", + "keywords": [ + "async", + "browser", + "deferred", + "flow control", + "fluent", + "future", + "node", + "promise", + "promises", + "promises-a", + "promises-aplus", + "q" + ], + "license": { + "type": "MIT", + "url": "http://github.com/kriskowal/q/raw/master/LICENSE" }, + "main": "q.js", "maintainers": [ { "name": "kriskowal", @@ -111,10 +119,28 @@ "email": "[email protected]" } ], - "dist": { - "shasum": "55705bcd93c5f3673530c2c2cbc0c2b3addc286e", - "tarball": "http://registry.npmjs.org/q/-/q-1.4.1.tgz" + "name": "q", + "optionalDependencies": {}, + "overlay": { + "teleport": { + "dependencies": { + "system": ">=0.0.4" + } + } }, - "_resolved": "http://registry.npmjs.org/q/-/q-1.4.1.tgz", - "readme": "ERROR: No README data found!" + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/kriskowal/q.git" + }, + "scripts": { + "benchmark": "matcha", + "cover": "cover run jasmine-node spec && cover report html && opener cover_html/index.html", + "lint": "jshint q.js", + "minify": "grunt", + "prepublish": "grunt", + "test": "jasmine-node spec && promises-aplus-tests spec/aplus-adapter", + "test-browser": "opener spec/q-spec.html" + }, + "version": "1.4.1" } http://git-wip-us.apache.org/repos/asf/cordova-android/blob/1d7ccaec/node_modules/sax/AUTHORS ---------------------------------------------------------------------- diff --git a/node_modules/sax/AUTHORS b/node_modules/sax/AUTHORS new file mode 100644 index 0000000..26d8659 --- /dev/null +++ b/node_modules/sax/AUTHORS @@ -0,0 +1,9 @@ +# contributors sorted by whether or not they're me. +Isaac Z. Schlueter <[email protected]> +Stein Martin Hustad <[email protected]> +Mikeal Rogers <[email protected]> +Laurie Harper <[email protected]> +Jann Horn <[email protected]> +Elijah Insua <[email protected]> +Henry Rawas <[email protected]> +Justin Makeig <[email protected]> http://git-wip-us.apache.org/repos/asf/cordova-android/blob/1d7ccaec/node_modules/sax/LICENSE ---------------------------------------------------------------------- diff --git a/node_modules/sax/LICENSE b/node_modules/sax/LICENSE new file mode 100644 index 0000000..05a4010 --- /dev/null +++ b/node_modules/sax/LICENSE @@ -0,0 +1,23 @@ +Copyright 2009, 2010, 2011 Isaac Z. Schlueter. +All rights reserved. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. http://git-wip-us.apache.org/repos/asf/cordova-android/blob/1d7ccaec/node_modules/sax/README.md ---------------------------------------------------------------------- diff --git a/node_modules/sax/README.md b/node_modules/sax/README.md new file mode 100644 index 0000000..9c63dc4 --- /dev/null +++ b/node_modules/sax/README.md @@ -0,0 +1,213 @@ +# sax js + +A sax-style parser for XML and HTML. + +Designed with [node](http://nodejs.org/) in mind, but should work fine in +the browser or other CommonJS implementations. + +## What This Is + +* A very simple tool to parse through an XML string. +* A stepping stone to a streaming HTML parser. +* A handy way to deal with RSS and other mostly-ok-but-kinda-broken XML + docs. + +## What This Is (probably) Not + +* An HTML Parser - That's a fine goal, but this isn't it. It's just + XML. +* A DOM Builder - You can use it to build an object model out of XML, + but it doesn't do that out of the box. +* XSLT - No DOM = no querying. +* 100% Compliant with (some other SAX implementation) - Most SAX + implementations are in Java and do a lot more than this does. +* An XML Validator - It does a little validation when in strict mode, but + not much. +* A Schema-Aware XSD Thing - Schemas are an exercise in fetishistic + masochism. +* A DTD-aware Thing - Fetching DTDs is a much bigger job. + +## Regarding `<!DOCTYPE`s and `<!ENTITY`s + +The parser will handle the basic XML entities in text nodes and attribute +values: `& < > ' "`. It's possible to define additional +entities in XML by putting them in the DTD. This parser doesn't do anything +with that. If you want to listen to the `ondoctype` event, and then fetch +the doctypes, and read the entities and add them to `parser.ENTITIES`, then +be my guest. + +Unknown entities will fail in strict mode, and in loose mode, will pass +through unmolested. + +## Usage + + var sax = require("./lib/sax"), + strict = true, // set to false for html-mode + parser = sax.parser(strict); + + parser.onerror = function (e) { + // an error happened. + }; + parser.ontext = function (t) { + // got some text. t is the string of text. + }; + parser.onopentag = function (node) { + // opened a tag. node has "name" and "attributes" + }; + parser.onattribute = function (attr) { + // an attribute. attr has "name" and "value" + }; + parser.onend = function () { + // parser stream is done, and ready to have more stuff written to it. + }; + + parser.write('<xml>Hello, <who name="world">world</who>!</xml>').close(); + + // stream usage + // takes the same options as the parser + var saxStream = require("sax").createStream(strict, options) + saxStream.on("error", function (e) { + // unhandled errors will throw, since this is a proper node + // event emitter. + console.error("error!", e) + // clear the error + this._parser.error = null + this._parser.resume() + }) + saxStream.on("opentag", function (node) { + // same object as above + }) + // pipe is supported, and it's readable/writable + // same chunks coming in also go out. + fs.createReadStream("file.xml") + .pipe(saxStream) + .pipe(fs.createReadStream("file-copy.xml")) + + + +## Arguments + +Pass the following arguments to the parser function. All are optional. + +`strict` - Boolean. Whether or not to be a jerk. Default: `false`. + +`opt` - Object bag of settings regarding string formatting. All default to `false`. + +Settings supported: + +* `trim` - Boolean. Whether or not to trim text and comment nodes. +* `normalize` - Boolean. If true, then turn any whitespace into a single + space. +* `lowercasetags` - Boolean. If true, then lowercase tags in loose mode, + rather than uppercasing them. +* `xmlns` - Boolean. If true, then namespaces are supported. + +## Methods + +`write` - Write bytes onto the stream. You don't have to do this all at +once. You can keep writing as much as you want. + +`close` - Close the stream. Once closed, no more data may be written until +it is done processing the buffer, which is signaled by the `end` event. + +`resume` - To gracefully handle errors, assign a listener to the `error` +event. Then, when the error is taken care of, you can call `resume` to +continue parsing. Otherwise, the parser will not continue while in an error +state. + +## Members + +At all times, the parser object will have the following members: + +`line`, `column`, `position` - Indications of the position in the XML +document where the parser currently is looking. + +`startTagPosition` - Indicates the position where the current tag starts. + +`closed` - Boolean indicating whether or not the parser can be written to. +If it's `true`, then wait for the `ready` event to write again. + +`strict` - Boolean indicating whether or not the parser is a jerk. + +`opt` - Any options passed into the constructor. + +`tag` - The current tag being dealt with. + +And a bunch of other stuff that you probably shouldn't touch. + +## Events + +All events emit with a single argument. To listen to an event, assign a +function to `on<eventname>`. Functions get executed in the this-context of +the parser object. The list of supported events are also in the exported +`EVENTS` array. + +When using the stream interface, assign handlers using the EventEmitter +`on` function in the normal fashion. + +`error` - Indication that something bad happened. The error will be hanging +out on `parser.error`, and must be deleted before parsing can continue. By +listening to this event, you can keep an eye on that kind of stuff. Note: +this happens *much* more in strict mode. Argument: instance of `Error`. + +`text` - Text node. Argument: string of text. + +`doctype` - The `<!DOCTYPE` declaration. Argument: doctype string. + +`processinginstruction` - Stuff like `<?xml foo="blerg" ?>`. Argument: +object with `name` and `body` members. Attributes are not parsed, as +processing instructions have implementation dependent semantics. + +`sgmldeclaration` - Random SGML declarations. Stuff like `<!ENTITY p>` +would trigger this kind of event. This is a weird thing to support, so it +might go away at some point. SAX isn't intended to be used to parse SGML, +after all. + +`opentag` - An opening tag. Argument: object with `name` and `attributes`. +In non-strict mode, tag names are uppercased, unless the `lowercasetags` +option is set. If the `xmlns` option is set, then it will contain +namespace binding information on the `ns` member, and will have a +`local`, `prefix`, and `uri` member. + +`closetag` - A closing tag. In loose mode, tags are auto-closed if their +parent closes. In strict mode, well-formedness is enforced. Note that +self-closing tags will have `closeTag` emitted immediately after `openTag`. +Argument: tag name. + +`attribute` - An attribute node. Argument: object with `name` and `value`, +and also namespace information if the `xmlns` option flag is set. + +`comment` - A comment node. Argument: the string of the comment. + +`opencdata` - The opening tag of a `<![CDATA[` block. + +`cdata` - The text of a `<![CDATA[` block. Since `<![CDATA[` blocks can get +quite large, this event may fire multiple times for a single block, if it +is broken up into multiple `write()`s. Argument: the string of random +character data. + +`closecdata` - The closing tag (`]]>`) of a `<![CDATA[` block. + +`opennamespace` - If the `xmlns` option is set, then this event will +signal the start of a new namespace binding. + +`closenamespace` - If the `xmlns` option is set, then this event will +signal the end of a namespace binding. + +`end` - Indication that the closed stream has ended. + +`ready` - Indication that the stream has reset, and is ready to be written +to. + +`noscript` - In non-strict mode, `<script>` tags trigger a `"script"` +event, and their contents are not checked for special xml characters. +If you pass `noscript: true`, then this behavior is suppressed. + +## Reporting Problems + +It's best to write a failing test if you find an issue. I will always +accept pull requests with failing tests if they demonstrate intended +behavior, but it is very hard to figure out what issue you're describing +without a test. Writing a test is also the best way for you yourself +to figure out if you really understand the issue you think you have with +sax-js. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
