You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by db...@apache.org on 2015/12/18 12:16:10 UTC
[13/13] cordova-ubuntu git commit: adding missing node_modules
adding missing node_modules
(cherry picked from commit 2e019a849a75ade3af9fb3db3ef7c6a6dca47475)
Project: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/commit/ad0cc0bd
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/tree/ad0cc0bd
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/diff/ad0cc0bd
Branch: refs/heads/master
Commit: ad0cc0bdf987a3438702948d48436330f803167d
Parents: 3ff56dd
Author: David Barth <da...@canonical.com>
Authored: Fri Dec 18 12:14:16 2015 +0100
Committer: David Barth <da...@canonical.com>
Committed: Fri Dec 18 12:15:24 2015 +0100
----------------------------------------------------------------------
node_modules/.bin/shjs | 1 +
node_modules/colors/MIT-LICENSE.txt | 22 +
node_modules/colors/ReadMe.md | 77 +
node_modules/colors/colors.js | 342 +
node_modules/colors/example.html | 76 +
node_modules/colors/example.js | 77 +
node_modules/colors/package.json | 46 +
node_modules/colors/test.js | 70 +
node_modules/colors/themes/winston-dark.js | 12 +
node_modules/colors/themes/winston-light.js | 12 +
node_modules/elementtree/.npmignore | 1 +
node_modules/elementtree/.travis.yml | 10 +
node_modules/elementtree/CHANGES.md | 39 +
node_modules/elementtree/LICENSE.txt | 203 +
node_modules/elementtree/Makefile | 21 +
node_modules/elementtree/NOTICE | 5 +
node_modules/elementtree/README.md | 141 +
node_modules/elementtree/lib/constants.js | 20 +
node_modules/elementtree/lib/elementpath.js | 343 +
node_modules/elementtree/lib/elementtree.js | 611 ++
node_modules/elementtree/lib/errors.js | 31 +
node_modules/elementtree/lib/parser.js | 33 +
node_modules/elementtree/lib/parsers/index.js | 1 +
node_modules/elementtree/lib/parsers/sax.js | 56 +
node_modules/elementtree/lib/sprintf.js | 86 +
node_modules/elementtree/lib/treebuilder.js | 60 +
node_modules/elementtree/lib/utils.js | 72 +
.../elementtree/node_modules/sax/AUTHORS | 9 +
.../elementtree/node_modules/sax/LICENSE | 23 +
.../elementtree/node_modules/sax/README.md | 213 +
.../sax/examples/big-not-pretty.xml | 8002 ++++++++++++++++++
.../node_modules/sax/examples/example.js | 41 +
.../node_modules/sax/examples/get-products.js | 58 +
.../node_modules/sax/examples/hello-world.js | 4 +
.../node_modules/sax/examples/not-pretty.xml | 8 +
.../node_modules/sax/examples/pretty-print.js | 74 +
.../node_modules/sax/examples/shopping.xml | 2 +
.../node_modules/sax/examples/strict.dtd | 870 ++
.../node_modules/sax/examples/switch-bench.js | 45 +
.../node_modules/sax/examples/test.html | 15 +
.../node_modules/sax/examples/test.xml | 1254 +++
.../elementtree/node_modules/sax/lib/sax.js | 1006 +++
.../elementtree/node_modules/sax/package.json | 89 +
.../node_modules/sax/test/buffer-overrun.js | 25 +
.../node_modules/sax/test/cdata-chunked.js | 11 +
.../node_modules/sax/test/cdata-end-split.js | 15 +
.../node_modules/sax/test/cdata-fake-end.js | 28 +
.../node_modules/sax/test/cdata-multiple.js | 15 +
.../elementtree/node_modules/sax/test/cdata.js | 10 +
.../elementtree/node_modules/sax/test/index.js | 86 +
.../node_modules/sax/test/issue-23.js | 43 +
.../node_modules/sax/test/issue-30.js | 24 +
.../node_modules/sax/test/issue-35.js | 15 +
.../node_modules/sax/test/issue-47.js | 13 +
.../node_modules/sax/test/issue-49.js | 31 +
.../node_modules/sax/test/parser-position.js | 28 +
.../elementtree/node_modules/sax/test/script.js | 12 +
.../sax/test/self-closing-child-strict.js | 40 +
.../node_modules/sax/test/self-closing-child.js | 40 +
.../node_modules/sax/test/self-closing-tag.js | 25 +
.../node_modules/sax/test/stray-ending.js | 17 +
.../sax/test/trailing-non-whitespace.js | 17 +
.../node_modules/sax/test/unquoted.js | 17 +
.../node_modules/sax/test/xmlns-issue-41.js | 67 +
.../node_modules/sax/test/xmlns-rebinding.js | 59 +
.../node_modules/sax/test/xmlns-strict.js | 71 +
.../node_modules/sax/test/xmlns-unbound.js | 15 +
.../test/xmlns-xml-default-prefix-attribute.js | 35 +
.../sax/test/xmlns-xml-default-prefix.js | 20 +
.../sax/test/xmlns-xml-default-redefine.js | 40 +
node_modules/elementtree/package.json | 75 +
node_modules/elementtree/tests/data/xml1.xml | 17 +
node_modules/elementtree/tests/data/xml2.xml | 14 +
node_modules/elementtree/tests/test-simple.js | 339 +
node_modules/optimist/.travis.yml | 4 +
node_modules/optimist/LICENSE | 21 +
node_modules/optimist/example/bool.js | 10 +
node_modules/optimist/example/boolean_double.js | 7 +
node_modules/optimist/example/boolean_single.js | 7 +
node_modules/optimist/example/default_hash.js | 8 +
.../optimist/example/default_singles.js | 7 +
node_modules/optimist/example/divide.js | 8 +
node_modules/optimist/example/line_count.js | 20 +
.../optimist/example/line_count_options.js | 29 +
.../optimist/example/line_count_wrap.js | 29 +
node_modules/optimist/example/nonopt.js | 4 +
node_modules/optimist/example/reflect.js | 2 +
node_modules/optimist/example/short.js | 3 +
node_modules/optimist/example/string.js | 11 +
node_modules/optimist/example/usage-options.js | 19 +
node_modules/optimist/example/xup.js | 10 +
node_modules/optimist/index.js | 343 +
.../optimist/node_modules/minimist/.travis.yml | 4 +
.../optimist/node_modules/minimist/LICENSE | 18 +
.../node_modules/minimist/example/parse.js | 2 +
.../optimist/node_modules/minimist/index.js | 187 +
.../optimist/node_modules/minimist/package.json | 67 +
.../node_modules/minimist/readme.markdown | 73 +
.../optimist/node_modules/minimist/test/bool.js | 119 +
.../optimist/node_modules/minimist/test/dash.js | 24 +
.../node_modules/minimist/test/default_bool.js | 20 +
.../node_modules/minimist/test/dotted.js | 22 +
.../optimist/node_modules/minimist/test/long.js | 31 +
.../optimist/node_modules/minimist/test/num.js | 36 +
.../node_modules/minimist/test/parse.js | 197 +
.../minimist/test/parse_modified.js | 9 +
.../node_modules/minimist/test/short.js | 67 +
.../node_modules/minimist/test/whitespace.js | 8 +
.../optimist/node_modules/wordwrap/LICENSE | 18 +
.../node_modules/wordwrap/README.markdown | 70 +
.../node_modules/wordwrap/example/center.js | 10 +
.../node_modules/wordwrap/example/meat.js | 3 +
.../optimist/node_modules/wordwrap/index.js | 76 +
.../optimist/node_modules/wordwrap/package.json | 63 +
.../node_modules/wordwrap/test/break.js | 30 +
.../node_modules/wordwrap/test/idleness.txt | 63 +
.../optimist/node_modules/wordwrap/test/wrap.js | 31 +
node_modules/optimist/package.json | 64 +
node_modules/optimist/readme.markdown | 500 ++
node_modules/optimist/test/_.js | 71 +
node_modules/optimist/test/_/argv.js | 2 +
node_modules/optimist/test/_/bin.js | 3 +
node_modules/optimist/test/dash.js | 31 +
node_modules/optimist/test/parse.js | 446 +
node_modules/optimist/test/parse_modified.js | 14 +
node_modules/optimist/test/short.js | 16 +
node_modules/optimist/test/usage.js | 292 +
node_modules/optimist/test/whitespace.js | 8 +
node_modules/q/LICENSE | 18 +
node_modules/q/README.md | 916 ++
node_modules/q/node_modules/asap/CHANGES.md | 64 +
node_modules/q/node_modules/asap/LICENSE.md | 21 +
node_modules/q/node_modules/asap/README.md | 237 +
node_modules/q/node_modules/asap/asap.js | 65 +
.../q/node_modules/asap/browser-asap.js | 66 +
node_modules/q/node_modules/asap/browser-raw.js | 220 +
node_modules/q/node_modules/asap/package.json | 85 +
node_modules/q/node_modules/asap/raw.js | 101 +
.../q/node_modules/pop-iterate/.npmignore | 1 +
.../q/node_modules/pop-iterate/README.md | 82 +
.../node_modules/pop-iterate/array-iterator.js | 23 +
.../q/node_modules/pop-iterate/iteration.js | 18 +
.../node_modules/pop-iterate/object-iterator.js | 20 +
.../q/node_modules/pop-iterate/package.json | 55 +
.../q/node_modules/pop-iterate/pop-iterate.js | 22 +
.../pop-iterate/test/pop-iterate-test.js | 72 +
node_modules/q/node_modules/weak-map/README.md | 129 +
.../q/node_modules/weak-map/package.json | 61 +
.../q/node_modules/weak-map/weak-map.js | 685 ++
node_modules/q/package.json | 130 +
node_modules/q/q.js | 1802 ++++
node_modules/q/queue.js | 25 +
node_modules/shelljs/.documentup.json | 6 +
node_modules/shelljs/.jshintrc | 7 +
node_modules/shelljs/.npmignore | 2 +
node_modules/shelljs/.travis.yml | 5 +
node_modules/shelljs/LICENSE | 26 +
node_modules/shelljs/README.md | 552 ++
node_modules/shelljs/bin/shjs | 51 +
node_modules/shelljs/global.js | 3 +
node_modules/shelljs/make.js | 47 +
node_modules/shelljs/package.json | 61 +
node_modules/shelljs/scripts/generate-docs.js | 21 +
node_modules/shelljs/scripts/run-tests.js | 50 +
node_modules/shelljs/shell.js | 153 +
node_modules/shelljs/src/cat.js | 43 +
node_modules/shelljs/src/cd.js | 19 +
node_modules/shelljs/src/chmod.js | 208 +
node_modules/shelljs/src/common.js | 189 +
node_modules/shelljs/src/cp.js | 200 +
node_modules/shelljs/src/dirs.js | 191 +
node_modules/shelljs/src/echo.js | 20 +
node_modules/shelljs/src/error.js | 10 +
node_modules/shelljs/src/exec.js | 181 +
node_modules/shelljs/src/find.js | 51 +
node_modules/shelljs/src/grep.js | 52 +
node_modules/shelljs/src/ls.js | 126 +
node_modules/shelljs/src/mkdir.js | 68 +
node_modules/shelljs/src/mv.js | 80 +
node_modules/shelljs/src/popd.js | 1 +
node_modules/shelljs/src/pushd.js | 1 +
node_modules/shelljs/src/pwd.js | 11 +
node_modules/shelljs/src/rm.js | 145 +
node_modules/shelljs/src/sed.js | 43 +
node_modules/shelljs/src/tempdir.js | 56 +
node_modules/shelljs/src/test.js | 85 +
node_modules/shelljs/src/to.js | 29 +
node_modules/shelljs/src/toEnd.js | 29 +
node_modules/shelljs/src/which.js | 79 +
189 files changed, 26501 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/ad0cc0bd/node_modules/.bin/shjs
----------------------------------------------------------------------
diff --git a/node_modules/.bin/shjs b/node_modules/.bin/shjs
new file mode 120000
index 0000000..a044997
--- /dev/null
+++ b/node_modules/.bin/shjs
@@ -0,0 +1 @@
+../shelljs/bin/shjs
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/ad0cc0bd/node_modules/colors/MIT-LICENSE.txt
----------------------------------------------------------------------
diff --git a/node_modules/colors/MIT-LICENSE.txt b/node_modules/colors/MIT-LICENSE.txt
new file mode 100644
index 0000000..7dca107
--- /dev/null
+++ b/node_modules/colors/MIT-LICENSE.txt
@@ -0,0 +1,22 @@
+Copyright (c) 2010
+
+Marak Squires
+Alexis Sellier (cloudhead)
+
+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.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/ad0cc0bd/node_modules/colors/ReadMe.md
----------------------------------------------------------------------
diff --git a/node_modules/colors/ReadMe.md b/node_modules/colors/ReadMe.md
new file mode 100644
index 0000000..0eda52d
--- /dev/null
+++ b/node_modules/colors/ReadMe.md
@@ -0,0 +1,77 @@
+# colors.js - get color and style in your node.js console ( and browser ) like what
+
+<img src="http://i.imgur.com/goJdO.png" border = "0"/>
+
+
+## Installation
+
+ npm install colors
+
+## colors and styles!
+
+- bold
+- italic
+- underline
+- inverse
+- yellow
+- cyan
+- white
+- magenta
+- green
+- red
+- grey
+- blue
+- rainbow
+- zebra
+- random
+
+## Usage
+
+``` js
+var colors = require('./colors');
+
+console.log('hello'.green); // outputs green text
+console.log('i like cake and pies'.underline.red) // outputs red underlined text
+console.log('inverse the color'.inverse); // inverses the color
+console.log('OMG Rainbows!'.rainbow); // rainbow (ignores spaces)
+```
+
+# Creating Custom themes
+
+```js
+
+var colors = require('colors');
+
+colors.setTheme({
+ silly: 'rainbow',
+ input: 'grey',
+ verbose: 'cyan',
+ prompt: 'grey',
+ info: 'green',
+ data: 'grey',
+ help: 'cyan',
+ warn: 'yellow',
+ debug: 'blue',
+ error: 'red'
+});
+
+// outputs red text
+console.log("this is an error".error);
+
+// outputs yellow text
+console.log("this is a warning".warn);
+```
+
+
+### Contributors
+
+Marak (Marak Squires)
+Alexis Sellier (cloudhead)
+mmalecki (Maciej Małecki)
+nicoreed (Nico Reed)
+morganrallen (Morgan Allen)
+JustinCampbell (Justin Campbell)
+ded (Dustin Diaz)
+
+
+#### , Marak Squires , Justin Campbell, Dustin Diaz (@ded)
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/ad0cc0bd/node_modules/colors/colors.js
----------------------------------------------------------------------
diff --git a/node_modules/colors/colors.js b/node_modules/colors/colors.js
new file mode 100644
index 0000000..7a537d8
--- /dev/null
+++ b/node_modules/colors/colors.js
@@ -0,0 +1,342 @@
+/*
+colors.js
+
+Copyright (c) 2010
+
+Marak Squires
+Alexis Sellier (cloudhead)
+
+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.
+
+*/
+
+var isHeadless = false;
+
+if (typeof module !== 'undefined') {
+ isHeadless = true;
+}
+
+if (!isHeadless) {
+ var exports = {};
+ var module = {};
+ var colors = exports;
+ exports.mode = "browser";
+} else {
+ exports.mode = "console";
+}
+
+//
+// Prototypes the string object to have additional method calls that add terminal colors
+//
+var addProperty = function (color, func) {
+ exports[color] = function (str) {
+ return func.apply(str);
+ };
+ String.prototype.__defineGetter__(color, func);
+};
+
+function stylize(str, style) {
+
+ var styles;
+
+ if (exports.mode === 'console') {
+ styles = {
+ //styles
+ 'bold' : ['\x1B[1m', '\x1B[22m'],
+ 'italic' : ['\x1B[3m', '\x1B[23m'],
+ 'underline' : ['\x1B[4m', '\x1B[24m'],
+ 'inverse' : ['\x1B[7m', '\x1B[27m'],
+ 'strikethrough' : ['\x1B[9m', '\x1B[29m'],
+ //text colors
+ //grayscale
+ 'white' : ['\x1B[37m', '\x1B[39m'],
+ 'grey' : ['\x1B[90m', '\x1B[39m'],
+ 'black' : ['\x1B[30m', '\x1B[39m'],
+ //colors
+ 'blue' : ['\x1B[34m', '\x1B[39m'],
+ 'cyan' : ['\x1B[36m', '\x1B[39m'],
+ 'green' : ['\x1B[32m', '\x1B[39m'],
+ 'magenta' : ['\x1B[35m', '\x1B[39m'],
+ 'red' : ['\x1B[31m', '\x1B[39m'],
+ 'yellow' : ['\x1B[33m', '\x1B[39m'],
+ //background colors
+ //grayscale
+ 'whiteBG' : ['\x1B[47m', '\x1B[49m'],
+ 'greyBG' : ['\x1B[49;5;8m', '\x1B[49m'],
+ 'blackBG' : ['\x1B[40m', '\x1B[49m'],
+ //colors
+ 'blueBG' : ['\x1B[44m', '\x1B[49m'],
+ 'cyanBG' : ['\x1B[46m', '\x1B[49m'],
+ 'greenBG' : ['\x1B[42m', '\x1B[49m'],
+ 'magentaBG' : ['\x1B[45m', '\x1B[49m'],
+ 'redBG' : ['\x1B[41m', '\x1B[49m'],
+ 'yellowBG' : ['\x1B[43m', '\x1B[49m']
+ };
+ } else if (exports.mode === 'browser') {
+ styles = {
+ //styles
+ 'bold' : ['<b>', '</b>'],
+ 'italic' : ['<i>', '</i>'],
+ 'underline' : ['<u>', '</u>'],
+ 'inverse' : ['<span style="background-color:black;color:white;">', '</span>'],
+ 'strikethrough' : ['<del>', '</del>'],
+ //text colors
+ //grayscale
+ 'white' : ['<span style="color:white;">', '</span>'],
+ 'grey' : ['<span style="color:gray;">', '</span>'],
+ 'black' : ['<span style="color:black;">', '</span>'],
+ //colors
+ 'blue' : ['<span style="color:blue;">', '</span>'],
+ 'cyan' : ['<span style="color:cyan;">', '</span>'],
+ 'green' : ['<span style="color:green;">', '</span>'],
+ 'magenta' : ['<span style="color:magenta;">', '</span>'],
+ 'red' : ['<span style="color:red;">', '</span>'],
+ 'yellow' : ['<span style="color:yellow;">', '</span>'],
+ //background colors
+ //grayscale
+ 'whiteBG' : ['<span style="background-color:white;">', '</span>'],
+ 'greyBG' : ['<span style="background-color:gray;">', '</span>'],
+ 'blackBG' : ['<span style="background-color:black;">', '</span>'],
+ //colors
+ 'blueBG' : ['<span style="background-color:blue;">', '</span>'],
+ 'cyanBG' : ['<span style="background-color:cyan;">', '</span>'],
+ 'greenBG' : ['<span style="background-color:green;">', '</span>'],
+ 'magentaBG' : ['<span style="background-color:magenta;">', '</span>'],
+ 'redBG' : ['<span style="background-color:red;">', '</span>'],
+ 'yellowBG' : ['<span style="background-color:yellow;">', '</span>']
+ };
+ } else if (exports.mode === 'none') {
+ return str + '';
+ } else {
+ console.log('unsupported mode, try "browser", "console" or "none"');
+ }
+ return styles[style][0] + str + styles[style][1];
+}
+
+function applyTheme(theme) {
+
+ //
+ // Remark: This is a list of methods that exist
+ // on String that you should not overwrite.
+ //
+ var stringPrototypeBlacklist = [
+ '__defineGetter__', '__defineSetter__', '__lookupGetter__', '__lookupSetter__', 'charAt', 'constructor',
+ 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf', 'charCodeAt',
+ 'indexOf', 'lastIndexof', 'length', 'localeCompare', 'match', 'replace', 'search', 'slice', 'split', 'substring',
+ 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toUpperCase', 'trim', 'trimLeft', 'trimRight'
+ ];
+
+ Object.keys(theme).forEach(function (prop) {
+ if (stringPrototypeBlacklist.indexOf(prop) !== -1) {
+ console.log('warn: '.red + ('String.prototype' + prop).magenta + ' is probably something you don\'t want to override. Ignoring style name');
+ }
+ else {
+ if (typeof(theme[prop]) === 'string') {
+ addProperty(prop, function () {
+ return exports[theme[prop]](this);
+ });
+ }
+ else {
+ addProperty(prop, function () {
+ var ret = this;
+ for (var t = 0; t < theme[prop].length; t++) {
+ ret = exports[theme[prop][t]](ret);
+ }
+ return ret;
+ });
+ }
+ }
+ });
+}
+
+
+//
+// Iterate through all default styles and colors
+//
+var x = ['bold', 'underline', 'strikethrough', 'italic', 'inverse', 'grey', 'black', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta', 'greyBG', 'blackBG', 'yellowBG', 'redBG', 'greenBG', 'blueBG', 'whiteBG', 'cyanBG', 'magentaBG'];
+x.forEach(function (style) {
+
+ // __defineGetter__ at the least works in more browsers
+ // http://robertnyman.com/javascript/javascript-getters-setters.html
+ // Object.defineProperty only works in Chrome
+ addProperty(style, function () {
+ return stylize(this, style);
+ });
+});
+
+function sequencer(map) {
+ return function () {
+ if (!isHeadless) {
+ return this.replace(/( )/, '$1');
+ }
+ var exploded = this.split(""), i = 0;
+ exploded = exploded.map(map);
+ return exploded.join("");
+ };
+}
+
+var rainbowMap = (function () {
+ var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta']; //RoY G BiV
+ return function (letter, i, exploded) {
+ if (letter === " ") {
+ return letter;
+ } else {
+ return stylize(letter, rainbowColors[i++ % rainbowColors.length]);
+ }
+ };
+})();
+
+exports.themes = {};
+
+exports.addSequencer = function (name, map) {
+ addProperty(name, sequencer(map));
+};
+
+exports.addSequencer('rainbow', rainbowMap);
+exports.addSequencer('zebra', function (letter, i, exploded) {
+ return i % 2 === 0 ? letter : letter.inverse;
+});
+
+exports.setTheme = function (theme) {
+ if (typeof theme === 'string') {
+ try {
+ exports.themes[theme] = require(theme);
+ applyTheme(exports.themes[theme]);
+ return exports.themes[theme];
+ } catch (err) {
+ console.log(err);
+ return err;
+ }
+ } else {
+ applyTheme(theme);
+ }
+};
+
+
+addProperty('stripColors', function () {
+ return ("" + this).replace(/\x1B\[\d+m/g, '');
+});
+
+// please no
+function zalgo(text, options) {
+ var soul = {
+ "up" : [
+ '̍', '̎', '̄', '̅',
+ '̿', '̑', '̆', '̐',
+ '͒', '͗', '͑', '̇',
+ '̈', '̊', '͂', '̓',
+ '̈', '͊', '͋', '͌',
+ '̃', '̂', '̌', '͐',
+ '̀', '́', '̋', '̏',
+ '̒', '̓', '̔', '̽',
+ '̉', 'ͣ', 'ͤ', 'ͥ',
+ 'ͦ', 'ͧ', 'ͨ', 'ͩ',
+ 'ͪ', 'ͫ', 'ͬ', 'ͭ',
+ 'ͮ', 'ͯ', '̾', '͛',
+ '͆', '̚'
+ ],
+ "down" : [
+ '̖', '̗', '̘', '̙',
+ '̜', '̝', '̞', '̟',
+ '̠', '̤', '̥', '̦',
+ '̩', '̪', '̫', '̬',
+ '̭', '̮', '̯', '̰',
+ '̱', '̲', '̳', '̹',
+ '̺', '̻', '̼', 'ͅ',
+ '͇', '͈', '͉', '͍',
+ '͎', '͓', '͔', '͕',
+ '͖', '͙', '͚', '̣'
+ ],
+ "mid" : [
+ '̕', '̛', '̀', '́',
+ '͘', '̡', '̢', '̧',
+ '̨', '̴', '̵', '̶',
+ '͜', '͝', '͞',
+ '͟', '͠', '͢', '̸',
+ '̷', '͡', ' ҉'
+ ]
+ },
+ all = [].concat(soul.up, soul.down, soul.mid),
+ zalgo = {};
+
+ function randomNumber(range) {
+ var r = Math.floor(Math.random() * range);
+ return r;
+ }
+
+ function is_char(character) {
+ var bool = false;
+ all.filter(function (i) {
+ bool = (i === character);
+ });
+ return bool;
+ }
+
+ function heComes(text, options) {
+ var result = '', counts, l;
+ options = options || {};
+ options["up"] = options["up"] || true;
+ options["mid"] = options["mid"] || true;
+ options["down"] = options["down"] || true;
+ options["size"] = options["size"] || "maxi";
+ text = text.split('');
+ for (l in text) {
+ if (is_char(l)) {
+ continue;
+ }
+ result = result + text[l];
+ counts = {"up" : 0, "down" : 0, "mid" : 0};
+ switch (options.size) {
+ case 'mini':
+ counts.up = randomNumber(8);
+ counts.min = randomNumber(2);
+ counts.down = randomNumber(8);
+ break;
+ case 'maxi':
+ counts.up = randomNumber(16) + 3;
+ counts.min = randomNumber(4) + 1;
+ counts.down = randomNumber(64) + 3;
+ break;
+ default:
+ counts.up = randomNumber(8) + 1;
+ counts.mid = randomNumber(6) / 2;
+ counts.down = randomNumber(8) + 1;
+ break;
+ }
+
+ var arr = ["up", "mid", "down"];
+ for (var d in arr) {
+ var index = arr[d];
+ for (var i = 0 ; i <= counts[index]; i++) {
+ if (options[index]) {
+ result = result + soul[index][randomNumber(soul[index].length)];
+ }
+ }
+ }
+ }
+ return result;
+ }
+ return heComes(text);
+}
+
+
+// don't summon zalgo
+addProperty('zalgo', function () {
+ return zalgo(this);
+});
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/ad0cc0bd/node_modules/colors/example.html
----------------------------------------------------------------------
diff --git a/node_modules/colors/example.html b/node_modules/colors/example.html
new file mode 100644
index 0000000..7a2ae60
--- /dev/null
+++ b/node_modules/colors/example.html
@@ -0,0 +1,76 @@
+<!DOCTYPE HTML>
+<html lang="en-us">
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+ <title>Colors Example</title>
+ <script src="colors.js"></script>
+ </head>
+ <body>
+ <script>
+
+ var test = colors.red("hopefully colorless output");
+
+ document.write('Rainbows are fun!'.rainbow + '<br/>');
+ document.write('So '.italic + 'are'.underline + ' styles! '.bold + 'inverse'.inverse); // styles not widely supported
+ document.write('Chains are also cool.'.bold.italic.underline.red); // styles not widely supported
+ //document.write('zalgo time!'.zalgo);
+ document.write(test.stripColors);
+ document.write("a".grey + " b".black);
+
+ document.write("Zebras are so fun!".zebra);
+
+ document.write(colors.rainbow('Rainbows are fun!'));
+ document.write("This is " + "not".strikethrough + " fun.");
+
+ document.write(colors.italic('So ') + colors.underline('are') + colors.bold(' styles! ') + colors.inverse('inverse')); // styles not widely supported
+ document.write(colors.bold(colors.italic(colors.underline(colors.red('Chains are also cool.'))))); // styles not widely supported
+ //document.write(colors.zalgo('zalgo time!'));
+ document.write(colors.stripColors(test));
+ document.write(colors.grey("a") + colors.black(" b"));
+
+ colors.addSequencer("america", function(letter, i, exploded) {
+ if(letter === " ") return letter;
+ switch(i%3) {
+ case 0: return letter.red;
+ case 1: return letter.white;
+ case 2: return letter.blue;
+ }
+ });
+
+ colors.addSequencer("random", (function() {
+ var available = ['bold', 'underline', 'italic', 'inverse', 'grey', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta'];
+
+ return function(letter, i, exploded) {
+ return letter === " " ? letter : letter[available[Math.round(Math.random() * (available.length - 1))]];
+ };
+ })());
+
+ document.write("AMERICA! F--K YEAH!".america);
+ document.write("So apparently I've been to Mars, with all the little green men. But you know, I don't recall.".random);
+
+ //
+ // Custom themes
+ //
+
+ colors.setTheme({
+ silly: 'rainbow',
+ input: 'grey',
+ verbose: 'cyan',
+ prompt: 'grey',
+ info: 'green',
+ data: 'grey',
+ help: 'cyan',
+ warn: 'yellow',
+ debug: 'blue',
+ error: 'red'
+ });
+
+ // outputs red text
+ document.write("this is an error".error);
+
+ // outputs yellow text
+ document.write("this is a warning".warn);
+
+ </script>
+ </body>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/ad0cc0bd/node_modules/colors/example.js
----------------------------------------------------------------------
diff --git a/node_modules/colors/example.js b/node_modules/colors/example.js
new file mode 100644
index 0000000..b1e03a4
--- /dev/null
+++ b/node_modules/colors/example.js
@@ -0,0 +1,77 @@
+var colors = require('./colors');
+
+//colors.mode = "browser";
+
+var test = colors.red("hopefully colorless output");
+console.log('Rainbows are fun!'.rainbow);
+console.log('So '.italic + 'are'.underline + ' styles! '.bold + 'inverse'.inverse); // styles not widely supported
+console.log('Chains are also cool.'.bold.italic.underline.red); // styles not widely supported
+//console.log('zalgo time!'.zalgo);
+console.log(test.stripColors);
+console.log("a".grey + " b".black);
+console.log("Zebras are so fun!".zebra);
+console.log('background color attack!'.black.whiteBG)
+
+//
+// Remark: .strikethrough may not work with Mac OS Terminal App
+//
+console.log("This is " + "not".strikethrough + " fun.");
+console.log(colors.rainbow('Rainbows are fun!'));
+console.log(colors.italic('So ') + colors.underline('are') + colors.bold(' styles! ') + colors.inverse('inverse')); // styles not widely supported
+console.log(colors.bold(colors.italic(colors.underline(colors.red('Chains are also cool.'))))); // styles not widely supported
+//console.log(colors.zalgo('zalgo time!'));
+console.log(colors.stripColors(test));
+console.log(colors.grey("a") + colors.black(" b"));
+
+colors.addSequencer("america", function(letter, i, exploded) {
+ if(letter === " ") return letter;
+ switch(i%3) {
+ case 0: return letter.red;
+ case 1: return letter.white;
+ case 2: return letter.blue;
+ }
+});
+
+colors.addSequencer("random", (function() {
+ var available = ['bold', 'underline', 'italic', 'inverse', 'grey', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta'];
+
+ return function(letter, i, exploded) {
+ return letter === " " ? letter : letter[available[Math.round(Math.random() * (available.length - 1))]];
+ };
+})());
+
+console.log("AMERICA! F--K YEAH!".america);
+console.log("So apparently I've been to Mars, with all the little green men. But you know, I don't recall.".random);
+
+//
+// Custom themes
+//
+
+// Load theme with JSON literal
+colors.setTheme({
+ silly: 'rainbow',
+ input: 'grey',
+ verbose: 'cyan',
+ prompt: 'grey',
+ info: 'green',
+ data: 'grey',
+ help: 'cyan',
+ warn: 'yellow',
+ debug: 'blue',
+ error: 'red'
+});
+
+// outputs red text
+console.log("this is an error".error);
+
+// outputs yellow text
+console.log("this is a warning".warn);
+
+// outputs grey text
+console.log("this is an input".input);
+
+// Load a theme from file
+colors.setTheme('./themes/winston-dark.js');
+
+console.log("this is an input".input);
+
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/ad0cc0bd/node_modules/colors/package.json
----------------------------------------------------------------------
diff --git a/node_modules/colors/package.json b/node_modules/colors/package.json
new file mode 100644
index 0000000..3b15773
--- /dev/null
+++ b/node_modules/colors/package.json
@@ -0,0 +1,46 @@
+{
+ "name": "colors",
+ "description": "get colors in your node.js console like what",
+ "version": "0.6.2",
+ "author": {
+ "name": "Marak Squires"
+ },
+ "homepage": "https://github.com/Marak/colors.js",
+ "bugs": {
+ "url": "https://github.com/Marak/colors.js/issues"
+ },
+ "keywords": [
+ "ansi",
+ "terminal",
+ "colors"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git+ssh://git@github.com/Marak/colors.js.git"
+ },
+ "engines": {
+ "node": ">=0.1.90"
+ },
+ "main": "colors",
+ "_id": "colors@0.6.2",
+ "dist": {
+ "shasum": "2423fe6678ac0c5dae8852e5d0e5be08c997abcc",
+ "tarball": "http://registry.npmjs.org/colors/-/colors-0.6.2.tgz"
+ },
+ "_from": "colors@0.6.2",
+ "_npmVersion": "1.2.30",
+ "_npmUser": {
+ "name": "marak",
+ "email": "marak.squires@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "marak",
+ "email": "marak.squires@gmail.com"
+ }
+ ],
+ "directories": {},
+ "_shasum": "2423fe6678ac0c5dae8852e5d0e5be08c997abcc",
+ "_resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz",
+ "readme": "ERROR: No README data found!"
+}
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/ad0cc0bd/node_modules/colors/test.js
----------------------------------------------------------------------
diff --git a/node_modules/colors/test.js b/node_modules/colors/test.js
new file mode 100644
index 0000000..c32417d
--- /dev/null
+++ b/node_modules/colors/test.js
@@ -0,0 +1,70 @@
+var assert = require('assert'),
+ colors = require('./colors');
+
+var s = 'string';
+
+function a(s, code) {
+ return '\x1B[' + code.toString() + 'm' + s + '\x1B[39m';
+}
+
+function aE(s, color, code) {
+ assert.equal(s[color], a(s, code));
+ assert.equal(colors[color](s), a(s, code));
+ assert.equal(s[color], colors[color](s));
+ assert.equal(s[color].stripColors, s);
+ assert.equal(s[color].stripColors, colors.stripColors(s));
+}
+
+function h(s, color) {
+ return '<span style="color:' + color + ';">' + s + '</span>';
+}
+
+var stylesColors = ['white', 'black', 'blue', 'cyan', 'green', 'magenta', 'red', 'yellow'];
+var stylesAll = stylesColors.concat(['bold', 'italic', 'underline', 'inverse', 'rainbow']);
+
+colors.mode = 'console';
+assert.equal(s.bold, '\x1B[1m' + s + '\x1B[22m');
+assert.equal(s.italic, '\x1B[3m' + s + '\x1B[23m');
+assert.equal(s.underline, '\x1B[4m' + s + '\x1B[24m');
+assert.equal(s.strikethrough, '\x1B[9m' + s + '\x1B[29m');
+assert.equal(s.inverse, '\x1B[7m' + s + '\x1B[27m');
+assert.ok(s.rainbow);
+aE(s, 'white', 37);
+aE(s, 'grey', 90);
+aE(s, 'black', 30);
+aE(s, 'blue', 34);
+aE(s, 'cyan', 36);
+aE(s, 'green', 32);
+aE(s, 'magenta', 35);
+aE(s, 'red', 31);
+aE(s, 'yellow', 33);
+assert.equal(s, 'string');
+
+colors.setTheme({error:'red'});
+
+assert.equal(typeof("astring".red),'string');
+assert.equal(typeof("astring".error),'string');
+
+colors.mode = 'browser';
+assert.equal(s.bold, '<b>' + s + '</b>');
+assert.equal(s.italic, '<i>' + s + '</i>');
+assert.equal(s.underline, '<u>' + s + '</u>');
+assert.equal(s.strikethrough, '<del>' + s + '</del>');
+assert.equal(s.inverse, '<span style="background-color:black;color:white;">' + s + '</span>');
+assert.ok(s.rainbow);
+stylesColors.forEach(function (color) {
+ assert.equal(s[color], h(s, color));
+ assert.equal(colors[color](s), h(s, color));
+});
+
+assert.equal(typeof("astring".red),'string');
+assert.equal(typeof("astring".error),'string');
+
+colors.mode = 'none';
+stylesAll.forEach(function (style) {
+ assert.equal(s[style], s);
+ assert.equal(colors[style](s), s);
+});
+
+assert.equal(typeof("astring".red),'string');
+assert.equal(typeof("astring".error),'string');
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/ad0cc0bd/node_modules/colors/themes/winston-dark.js
----------------------------------------------------------------------
diff --git a/node_modules/colors/themes/winston-dark.js b/node_modules/colors/themes/winston-dark.js
new file mode 100644
index 0000000..49a905b
--- /dev/null
+++ b/node_modules/colors/themes/winston-dark.js
@@ -0,0 +1,12 @@
+module['exports'] = {
+ silly: 'rainbow',
+ input: 'black',
+ verbose: 'cyan',
+ prompt: 'grey',
+ info: 'green',
+ data: 'grey',
+ help: 'cyan',
+ warn: 'yellow',
+ debug: 'blue',
+ error: 'red'
+};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/ad0cc0bd/node_modules/colors/themes/winston-light.js
----------------------------------------------------------------------
diff --git a/node_modules/colors/themes/winston-light.js b/node_modules/colors/themes/winston-light.js
new file mode 100644
index 0000000..571972c
--- /dev/null
+++ b/node_modules/colors/themes/winston-light.js
@@ -0,0 +1,12 @@
+module['exports'] = {
+ silly: 'rainbow',
+ input: 'grey',
+ verbose: 'cyan',
+ prompt: 'grey',
+ info: 'green',
+ data: 'grey',
+ help: 'cyan',
+ warn: 'yellow',
+ debug: 'blue',
+ error: 'red'
+};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/ad0cc0bd/node_modules/elementtree/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/.npmignore b/node_modules/elementtree/.npmignore
new file mode 100644
index 0000000..3c3629e
--- /dev/null
+++ b/node_modules/elementtree/.npmignore
@@ -0,0 +1 @@
+node_modules
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/ad0cc0bd/node_modules/elementtree/.travis.yml
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/.travis.yml b/node_modules/elementtree/.travis.yml
new file mode 100644
index 0000000..6f27c96
--- /dev/null
+++ b/node_modules/elementtree/.travis.yml
@@ -0,0 +1,10 @@
+language: node_js
+
+node_js:
+ - 0.6
+
+script: make test
+
+notifications:
+ email:
+ - tomaz+travisci@tomaz.me
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/ad0cc0bd/node_modules/elementtree/CHANGES.md
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/CHANGES.md b/node_modules/elementtree/CHANGES.md
new file mode 100644
index 0000000..50d415d
--- /dev/null
+++ b/node_modules/elementtree/CHANGES.md
@@ -0,0 +1,39 @@
+elementtree v0.1.6 (in development)
+
+* Add support for CData elements. (#14)
+ [hermannpencole]
+
+elementtree v0.1.5 - 2012-11-14
+
+* Fix a bug in the find() and findtext() method which could manifest itself
+ under some conditions.
+ [metagriffin]
+
+elementtree v0.1.4 - 2012-10-15
+
+* Allow user to use namespaced attributes when using find* functions.
+ [Andrew Lunny]
+
+elementtree v0.1.3 - 2012-09-21
+
+* Improve the output of text content in the tags (strip unnecessary line break
+ characters).
+
+[Darryl Pogue]
+
+elementtree v0.1.2 - 2012-09-04
+
+ * Allow user to pass 'indent' option to ElementTree.write method. If this
+ option is specified (e.g. {'indent': 4}). XML will be pretty printed.
+ [Darryl Pogue, Tomaz Muraus]
+
+ * Bump sax dependency version.
+
+elementtree v0.1.1 - 2011-09-23
+
+ * Improve special character escaping.
+ [Ryan Phillips]
+
+elementtree v0.1.0 - 2011-09-05
+
+ * Initial release.
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/ad0cc0bd/node_modules/elementtree/LICENSE.txt
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/LICENSE.txt b/node_modules/elementtree/LICENSE.txt
new file mode 100644
index 0000000..6b0b127
--- /dev/null
+++ b/node_modules/elementtree/LICENSE.txt
@@ -0,0 +1,203 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/ad0cc0bd/node_modules/elementtree/Makefile
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/Makefile b/node_modules/elementtree/Makefile
new file mode 100755
index 0000000..ab7c4e0
--- /dev/null
+++ b/node_modules/elementtree/Makefile
@@ -0,0 +1,21 @@
+TESTS := \
+ tests/test-simple.js
+
+
+
+PATH := ./node_modules/.bin:$(PATH)
+
+WHISKEY := $(shell bash -c 'PATH=$(PATH) type -p whiskey')
+
+default: test
+
+test:
+ NODE_PATH=`pwd`/lib/ ${WHISKEY} --scope-leaks --sequential --real-time --tests "${TESTS}"
+
+tap:
+ NODE_PATH=`pwd`/lib/ ${WHISKEY} --test-reporter tap --sequential --real-time --tests "${TESTS}"
+
+coverage:
+ NODE_PATH=`pwd`/lib/ ${WHISKEY} --sequential --coverage --coverage-reporter html --coverage-dir coverage_html --tests "${TESTS}"
+
+.PHONY: default test coverage tap scope
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/ad0cc0bd/node_modules/elementtree/NOTICE
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/NOTICE b/node_modules/elementtree/NOTICE
new file mode 100644
index 0000000..28ad70a
--- /dev/null
+++ b/node_modules/elementtree/NOTICE
@@ -0,0 +1,5 @@
+node-elementtree
+Copyright (c) 2011, Rackspace, Inc.
+
+The ElementTree toolkit is Copyright (c) 1999-2007 by Fredrik Lundh
+
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/ad0cc0bd/node_modules/elementtree/README.md
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/README.md b/node_modules/elementtree/README.md
new file mode 100644
index 0000000..738420c
--- /dev/null
+++ b/node_modules/elementtree/README.md
@@ -0,0 +1,141 @@
+node-elementtree
+====================
+
+node-elementtree is a [Node.js](http://nodejs.org) XML parser and serializer based upon the [Python ElementTree v1.3](http://effbot.org/zone/element-index.htm) module.
+
+Installation
+====================
+
+ $ npm install elementtree
+
+Using the library
+====================
+
+For the usage refer to the Python ElementTree library documentation - [http://effbot.org/zone/element-index.htm#usage](http://effbot.org/zone/element-index.htm#usage).
+
+Supported XPath expressions in `find`, `findall` and `findtext` methods are listed on [http://effbot.org/zone/element-xpath.htm](http://effbot.org/zone/element-xpath.htm).
+
+Example 1 – Creating An XML Document
+====================
+
+This example shows how to build a valid XML document that can be published to
+Atom Hopper. Atom Hopper is used internally as a bridge from products all the
+way to collecting revenue, called “Usage.” MaaS and other products send similar
+events to it every time user performs an action on a resource
+(e.g. creates,updates or deletes). Below is an example of leveraging the API
+to create a new XML document.
+
+```javascript
+var et = require('elementtree');
+var XML = et.XML;
+var ElementTree = et.ElementTree;
+var element = et.Element;
+var subElement = et.SubElement;
+
+var date, root, tenantId, serviceName, eventType, usageId, dataCenter, region,
+checks, resourceId, category, startTime, resourceName, etree, xml;
+
+date = new Date();
+
+root = element('entry');
+root.set('xmlns', 'http://www.w3.org/2005/Atom');
+
+tenantId = subElement(root, 'TenantId');
+tenantId.text = '12345';
+
+serviceName = subElement(root, 'ServiceName');
+serviceName.text = 'MaaS';
+
+resourceId = subElement(root, 'ResourceID');
+resourceId.text = 'enAAAA';
+
+usageId = subElement(root, 'UsageID');
+usageId.text = '550e8400-e29b-41d4-a716-446655440000';
+
+eventType = subElement(root, 'EventType');
+eventType.text = 'create';
+
+category = subElement(root, 'category');
+category.set('term', 'monitoring.entity.create');
+
+dataCenter = subElement(root, 'DataCenter');
+dataCenter.text = 'global';
+
+region = subElement(root, 'Region');
+region.text = 'global';
+
+startTime = subElement(root, 'StartTime');
+startTime.text = date;
+
+resourceName = subElement(root, 'ResourceName');
+resourceName.text = 'entity';
+
+etree = new ElementTree(root);
+xml = etree.write({'xml_declaration': false});
+console.log(xml);
+```
+
+As you can see, both et.Element and et.SubElement are factory methods which
+return a new instance of Element and SubElement class, respectively.
+When you create a new element (tag) you can use set method to set an attribute.
+To set the tag value, assign a value to the .text attribute.
+
+This example would output a document that looks like this:
+
+```xml
+<entry xmlns="http://www.w3.org/2005/Atom">
+ <TenantId>12345</TenantId>
+ <ServiceName>MaaS</ServiceName>
+ <ResourceID>enAAAA</ResourceID>
+ <UsageID>550e8400-e29b-41d4-a716-446655440000</UsageID>
+ <EventType>create</EventType>
+ <category term="monitoring.entity.create"/>
+ <DataCenter>global</DataCenter>
+ <Region>global</Region>
+ <StartTime>Sun Apr 29 2012 16:37:32 GMT-0700 (PDT)</StartTime>
+ <ResourceName>entity</ResourceName>
+</entry>
+```
+
+Example 2 – Parsing An XML Document
+====================
+
+This example shows how to parse an XML document and use simple XPath selectors.
+For demonstration purposes, we will use the XML document located at
+https://gist.github.com/2554343.
+
+Behind the scenes, node-elementtree uses Isaac’s sax library for parsing XML,
+but the library has a concept of “parsers,” which means it’s pretty simple to
+add support for a different parser.
+
+```javascript
+var fs = require('fs');
+
+var et = require('elementtree');
+
+var XML = et.XML;
+var ElementTree = et.ElementTree;
+var element = et.Element;
+var subElement = et.SubElement;
+
+var data, etree;
+
+data = fs.readFileSync('document.xml').toString();
+etree = et.parse(data);
+
+console.log(etree.findall('./entry/TenantId').length); // 2
+console.log(etree.findtext('./entry/ServiceName')); // MaaS
+console.log(etree.findall('./entry/category')[0].get('term')); // monitoring.entity.create
+console.log(etree.findall('*/category/[@term="monitoring.entity.update"]').length); // 1
+```
+
+Build status
+====================
+
+[![Build Status](https://secure.travis-ci.org/racker/node-elementtree.png)](http://travis-ci.org/racker/node-elementtree)
+
+
+License
+====================
+
+node-elementtree is distributed under the [Apache license](http://www.apache.org/licenses/LICENSE-2.0.html).
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/ad0cc0bd/node_modules/elementtree/lib/constants.js
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/lib/constants.js b/node_modules/elementtree/lib/constants.js
new file mode 100644
index 0000000..b057faf
--- /dev/null
+++ b/node_modules/elementtree/lib/constants.js
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2011 Rackspace
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+var DEFAULT_PARSER = 'sax';
+
+exports.DEFAULT_PARSER = DEFAULT_PARSER;
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/ad0cc0bd/node_modules/elementtree/lib/elementpath.js
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/lib/elementpath.js b/node_modules/elementtree/lib/elementpath.js
new file mode 100644
index 0000000..2e93f47
--- /dev/null
+++ b/node_modules/elementtree/lib/elementpath.js
@@ -0,0 +1,343 @@
+/**
+ * Copyright 2011 Rackspace
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+var sprintf = require('./sprintf').sprintf;
+
+var utils = require('./utils');
+var SyntaxError = require('./errors').SyntaxError;
+
+var _cache = {};
+
+var RE = new RegExp(
+ "(" +
+ "'[^']*'|\"[^\"]*\"|" +
+ "::|" +
+ "//?|" +
+ "\\.\\.|" +
+ "\\(\\)|" +
+ "[/.*:\\[\\]\\(\\)@=])|" +
+ "((?:\\{[^}]+\\})?[^/\\[\\]\\(\\)@=\\s]+)|" +
+ "\\s+", 'g'
+);
+
+var xpath_tokenizer = utils.findall.bind(null, RE);
+
+function prepare_tag(next, token) {
+ var tag = token[0];
+
+ function select(context, result) {
+ var i, len, elem, rv = [];
+
+ for (i = 0, len = result.length; i < len; i++) {
+ elem = result[i];
+ elem._children.forEach(function(e) {
+ if (e.tag === tag) {
+ rv.push(e);
+ }
+ });
+ }
+
+ return rv;
+ }
+
+ return select;
+}
+
+function prepare_star(next, token) {
+ function select(context, result) {
+ var i, len, elem, rv = [];
+
+ for (i = 0, len = result.length; i < len; i++) {
+ elem = result[i];
+ elem._children.forEach(function(e) {
+ rv.push(e);
+ });
+ }
+
+ return rv;
+ }
+
+ return select;
+}
+
+function prepare_dot(next, token) {
+ function select(context, result) {
+ var i, len, elem, rv = [];
+
+ for (i = 0, len = result.length; i < len; i++) {
+ elem = result[i];
+ rv.push(elem);
+ }
+
+ return rv;
+ }
+
+ return select;
+}
+
+function prepare_iter(next, token) {
+ var tag;
+ token = next();
+
+ if (token[1] === '*') {
+ tag = '*';
+ }
+ else if (!token[1]) {
+ tag = token[0] || '';
+ }
+ else {
+ throw new SyntaxError(token);
+ }
+
+ function select(context, result) {
+ var i, len, elem, rv = [];
+
+ for (i = 0, len = result.length; i < len; i++) {
+ elem = result[i];
+ elem.iter(tag, function(e) {
+ if (e !== elem) {
+ rv.push(e);
+ }
+ });
+ }
+
+ return rv;
+ }
+
+ return select;
+}
+
+function prepare_dot_dot(next, token) {
+ function select(context, result) {
+ var i, len, elem, rv = [], parent_map = context.parent_map;
+
+ if (!parent_map) {
+ context.parent_map = parent_map = {};
+
+ context.root.iter(null, function(p) {
+ p._children.forEach(function(e) {
+ parent_map[e] = p;
+ });
+ });
+ }
+
+ for (i = 0, len = result.length; i < len; i++) {
+ elem = result[i];
+
+ if (parent_map.hasOwnProperty(elem)) {
+ rv.push(parent_map[elem]);
+ }
+ }
+
+ return rv;
+ }
+
+ return select;
+}
+
+
+function prepare_predicate(next, token) {
+ var tag, key, value, select;
+ token = next();
+
+ if (token[1] === '@') {
+ // attribute
+ token = next();
+
+ if (token[1]) {
+ throw new SyntaxError(token, 'Invalid attribute predicate');
+ }
+
+ key = token[0];
+ token = next();
+
+ if (token[1] === ']') {
+ select = function(context, result) {
+ var i, len, elem, rv = [];
+
+ for (i = 0, len = result.length; i < len; i++) {
+ elem = result[i];
+
+ if (elem.get(key)) {
+ rv.push(elem);
+ }
+ }
+
+ return rv;
+ };
+ }
+ else if (token[1] === '=') {
+ value = next()[1];
+
+ if (value[0] === '"' || value[value.length - 1] === '\'') {
+ value = value.slice(1, value.length - 1);
+ }
+ else {
+ throw new SyntaxError(token, 'Ivalid comparison target');
+ }
+
+ token = next();
+ select = function(context, result) {
+ var i, len, elem, rv = [];
+
+ for (i = 0, len = result.length; i < len; i++) {
+ elem = result[i];
+
+ if (elem.get(key) === value) {
+ rv.push(elem);
+ }
+ }
+
+ return rv;
+ };
+ }
+
+ if (token[1] !== ']') {
+ throw new SyntaxError(token, 'Invalid attribute predicate');
+ }
+ }
+ else if (!token[1]) {
+ tag = token[0] || '';
+ token = next();
+
+ if (token[1] !== ']') {
+ throw new SyntaxError(token, 'Invalid node predicate');
+ }
+
+ select = function(context, result) {
+ var i, len, elem, rv = [];
+
+ for (i = 0, len = result.length; i < len; i++) {
+ elem = result[i];
+
+ if (elem.find(tag)) {
+ rv.push(elem);
+ }
+ }
+
+ return rv;
+ };
+ }
+ else {
+ throw new SyntaxError(null, 'Invalid predicate');
+ }
+
+ return select;
+}
+
+
+
+var ops = {
+ "": prepare_tag,
+ "*": prepare_star,
+ ".": prepare_dot,
+ "..": prepare_dot_dot,
+ "//": prepare_iter,
+ "[": prepare_predicate,
+};
+
+function _SelectorContext(root) {
+ this.parent_map = null;
+ this.root = root;
+}
+
+function findall(elem, path) {
+ var selector, result, i, len, token, value, select, context;
+
+ if (_cache.hasOwnProperty(path)) {
+ selector = _cache[path];
+ }
+ else {
+ // TODO: Use smarter cache purging approach
+ if (Object.keys(_cache).length > 100) {
+ _cache = {};
+ }
+
+ if (path.charAt(0) === '/') {
+ throw new SyntaxError(null, 'Cannot use absolute path on element');
+ }
+
+ result = xpath_tokenizer(path);
+ selector = [];
+
+ function getToken() {
+ return result.shift();
+ }
+
+ token = getToken();
+ while (true) {
+ var c = token[1] || '';
+ value = ops[c](getToken, token);
+
+ if (!value) {
+ throw new SyntaxError(null, sprintf('Invalid path: %s', path));
+ }
+
+ selector.push(value);
+ token = getToken();
+
+ if (!token) {
+ break;
+ }
+ else if (token[1] === '/') {
+ token = getToken();
+ }
+
+ if (!token) {
+ break;
+ }
+ }
+
+ _cache[path] = selector;
+ }
+
+ // Execute slector pattern
+ result = [elem];
+ context = new _SelectorContext(elem);
+
+ for (i = 0, len = selector.length; i < len; i++) {
+ select = selector[i];
+ result = select(context, result);
+ }
+
+ return result || [];
+}
+
+function find(element, path) {
+ var resultElements = findall(element, path);
+
+ if (resultElements && resultElements.length > 0) {
+ return resultElements[0];
+ }
+
+ return null;
+}
+
+function findtext(element, path, defvalue) {
+ var resultElements = findall(element, path);
+
+ if (resultElements && resultElements.length > 0) {
+ return resultElements[0].text;
+ }
+
+ return defvalue;
+}
+
+
+exports.find = find;
+exports.findall = findall;
+exports.findtext = findtext;
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/ad0cc0bd/node_modules/elementtree/lib/elementtree.js
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/lib/elementtree.js b/node_modules/elementtree/lib/elementtree.js
new file mode 100644
index 0000000..61d9276
--- /dev/null
+++ b/node_modules/elementtree/lib/elementtree.js
@@ -0,0 +1,611 @@
+/**
+ * Copyright 2011 Rackspace
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+var sprintf = require('./sprintf').sprintf;
+
+var utils = require('./utils');
+var ElementPath = require('./elementpath');
+var TreeBuilder = require('./treebuilder').TreeBuilder;
+var get_parser = require('./parser').get_parser;
+var constants = require('./constants');
+
+var element_ids = 0;
+
+function Element(tag, attrib)
+{
+ this._id = element_ids++;
+ this.tag = tag;
+ this.attrib = {};
+ this.text = null;
+ this.tail = null;
+ this._children = [];
+
+ if (attrib) {
+ this.attrib = utils.merge(this.attrib, attrib);
+ }
+}
+
+Element.prototype.toString = function()
+{
+ return sprintf("<Element %s at %s>", this.tag, this._id);
+};
+
+Element.prototype.makeelement = function(tag, attrib)
+{
+ return new Element(tag, attrib);
+};
+
+Element.prototype.len = function()
+{
+ return this._children.length;
+};
+
+Element.prototype.getItem = function(index)
+{
+ return this._children[index];
+};
+
+Element.prototype.setItem = function(index, element)
+{
+ this._children[index] = element;
+};
+
+Element.prototype.delItem = function(index)
+{
+ this._children.splice(index, 1);
+};
+
+Element.prototype.getSlice = function(start, stop)
+{
+ return this._children.slice(start, stop);
+};
+
+Element.prototype.setSlice = function(start, stop, elements)
+{
+ var i;
+ var k = 0;
+ for (i = start; i < stop; i++, k++) {
+ this._children[i] = elements[k];
+ }
+};
+
+Element.prototype.delSlice = function(start, stop)
+{
+ this._children.splice(start, stop - start);
+};
+
+Element.prototype.append = function(element)
+{
+ this._children.push(element);
+};
+
+Element.prototype.extend = function(elements)
+{
+ this._children.concat(elements);
+};
+
+Element.prototype.insert = function(index, element)
+{
+ this._children[index] = element;
+};
+
+Element.prototype.remove = function(element)
+{
+ this._children = this._children.filter(function(e) {
+ /* TODO: is this the right way to do this? */
+ if (e._id === element._id) {
+ return false;
+ }
+ return true;
+ });
+};
+
+Element.prototype.getchildren = function() {
+ return this._children;
+};
+
+Element.prototype.find = function(path)
+{
+ return ElementPath.find(this, path);
+};
+
+Element.prototype.findtext = function(path, defvalue)
+{
+ return ElementPath.findtext(this, path, defvalue);
+};
+
+Element.prototype.findall = function(path, defvalue)
+{
+ return ElementPath.findall(this, path, defvalue);
+};
+
+Element.prototype.clear = function()
+{
+ this.attrib = {};
+ this._children = [];
+ this.text = null;
+ this.tail = null;
+};
+
+Element.prototype.get = function(key, defvalue)
+{
+ if (this.attrib[key] !== undefined) {
+ return this.attrib[key];
+ }
+ else {
+ return defvalue;
+ }
+};
+
+Element.prototype.set = function(key, value)
+{
+ this.attrib[key] = value;
+};
+
+Element.prototype.keys = function()
+{
+ return Object.keys(this.attrib);
+};
+
+Element.prototype.items = function()
+{
+ return utils.items(this.attrib);
+};
+
+/*
+ * In python this uses a generator, but in v8 we don't have em,
+ * so we use a callback instead.
+ **/
+Element.prototype.iter = function(tag, callback)
+{
+ var self = this;
+ var i, child;
+
+ if (tag === "*") {
+ tag = null;
+ }
+
+ if (tag === null || this.tag === tag) {
+ callback(self);
+ }
+
+ for (i = 0; i < this._children.length; i++) {
+ child = this._children[i];
+ child.iter(tag, function(e) {
+ callback(e);
+ });
+ }
+};
+
+Element.prototype.itertext = function(callback)
+{
+ this.iter(null, function(e) {
+ if (e.text) {
+ callback(e.text);
+ }
+
+ if (e.tail) {
+ callback(e.tail);
+ }
+ });
+};
+
+
+function SubElement(parent, tag, attrib) {
+ var element = parent.makeelement(tag, attrib);
+ parent.append(element);
+ return element;
+}
+
+function Comment(text) {
+ var element = new Element(Comment);
+ if (text) {
+ element.text = text;
+ }
+ return element;
+}
+
+function CData(text) {
+ var element = new Element(CData);
+ if (text) {
+ element.text = text;
+ }
+ return element;
+}
+
+function ProcessingInstruction(target, text)
+{
+ var element = new Element(ProcessingInstruction);
+ element.text = target;
+ if (text) {
+ element.text = element.text + " " + text;
+ }
+ return element;
+}
+
+function QName(text_or_uri, tag)
+{
+ if (tag) {
+ text_or_uri = sprintf("{%s}%s", text_or_uri, tag);
+ }
+ this.text = text_or_uri;
+}
+
+QName.prototype.toString = function() {
+ return this.text;
+};
+
+function ElementTree(element)
+{
+ this._root = element;
+}
+
+ElementTree.prototype.getroot = function() {
+ return this._root;
+};
+
+ElementTree.prototype._setroot = function(element) {
+ this._root = element;
+};
+
+ElementTree.prototype.parse = function(source, parser) {
+ if (!parser) {
+ parser = get_parser(constants.DEFAULT_PARSER);
+ parser = new parser.XMLParser(new TreeBuilder());
+ }
+
+ parser.feed(source);
+ this._root = parser.close();
+ return this._root;
+};
+
+ElementTree.prototype.iter = function(tag, callback) {
+ this._root.iter(tag, callback);
+};
+
+ElementTree.prototype.find = function(path) {
+ return this._root.find(path);
+};
+
+ElementTree.prototype.findtext = function(path, defvalue) {
+ return this._root.findtext(path, defvalue);
+};
+
+ElementTree.prototype.findall = function(path) {
+ return this._root.findall(path);
+};
+
+/**
+ * Unlike ElementTree, we don't write to a file, we return you a string.
+ */
+ElementTree.prototype.write = function(options) {
+ var sb = [];
+ options = utils.merge({
+ encoding: 'utf-8',
+ xml_declaration: null,
+ default_namespace: null,
+ method: 'xml'}, options);
+
+ if (options.xml_declaration !== false) {
+ sb.push("<?xml version='1.0' encoding='"+options.encoding +"'?>\n");
+ }
+
+ if (options.method === "text") {
+ _serialize_text(sb, self._root, encoding);
+ }
+ else {
+ var qnames, namespaces, indent, indent_string;
+ var x = _namespaces(this._root, options.encoding, options.default_namespace);
+ qnames = x[0];
+ namespaces = x[1];
+
+ if (options.hasOwnProperty('indent')) {
+ indent = 0;
+ indent_string = new Array(options.indent + 1).join(' ');
+ }
+ else {
+ indent = false;
+ }
+
+ if (options.method === "xml") {
+ _serialize_xml(function(data) {
+ sb.push(data);
+ }, this._root, options.encoding, qnames, namespaces, indent, indent_string);
+ }
+ else {
+ /* TODO: html */
+ throw new Error("unknown serialization method "+ options.method);
+ }
+ }
+
+ return sb.join("");
+};
+
+var _namespace_map = {
+ /* "well-known" namespace prefixes */
+ "http://www.w3.org/XML/1998/namespace": "xml",
+ "http://www.w3.org/1999/xhtml": "html",
+ "http://www.w3.org/1999/02/22-rdf-syntax-ns#": "rdf",
+ "http://schemas.xmlsoap.org/wsdl/": "wsdl",
+ /* xml schema */
+ "http://www.w3.org/2001/XMLSchema": "xs",
+ "http://www.w3.org/2001/XMLSchema-instance": "xsi",
+ /* dublic core */
+ "http://purl.org/dc/elements/1.1/": "dc",
+};
+
+function register_namespace(prefix, uri) {
+ if (/ns\d+$/.test(prefix)) {
+ throw new Error('Prefix format reserved for internal use');
+ }
+
+ if (_namespace_map.hasOwnProperty(uri) && _namespace_map[uri] === prefix) {
+ delete _namespace_map[uri];
+ }
+
+ _namespace_map[uri] = prefix;
+}
+
+
+function _escape(text, encoding, isAttribute, isText) {
+ if (text) {
+ text = text.toString();
+ text = text.replace(/&/g, '&');
+ text = text.replace(/</g, '<');
+ text = text.replace(/>/g, '>');
+ if (!isText) {
+ text = text.replace(/\n/g, '
');
+ text = text.replace(/\r/g, '
');
+ }
+ if (isAttribute) {
+ text = text.replace(/"/g, '"');
+ }
+ }
+ return text;
+}
+
+/* TODO: benchmark single regex */
+function _escape_attrib(text, encoding) {
+ return _escape(text, encoding, true);
+}
+
+function _escape_cdata(text, encoding) {
+ return _escape(text, encoding, false);
+}
+
+function _escape_text(text, encoding) {
+ return _escape(text, encoding, false, true);
+}
+
+function _namespaces(elem, encoding, default_namespace) {
+ var qnames = {};
+ var namespaces = {};
+
+ if (default_namespace) {
+ namespaces[default_namespace] = "";
+ }
+
+ function encode(text) {
+ return text;
+ }
+
+ function add_qname(qname) {
+ if (qname[0] === "{") {
+ var tmp = qname.substring(1).split("}", 2);
+ var uri = tmp[0];
+ var tag = tmp[1];
+ var prefix = namespaces[uri];
+
+ if (prefix === undefined) {
+ prefix = _namespace_map[uri];
+ if (prefix === undefined) {
+ prefix = "ns" + Object.keys(namespaces).length;
+ }
+ if (prefix !== "xml") {
+ namespaces[uri] = prefix;
+ }
+ }
+
+ if (prefix) {
+ qnames[qname] = sprintf("%s:%s", prefix, tag);
+ }
+ else {
+ qnames[qname] = tag;
+ }
+ }
+ else {
+ if (default_namespace) {
+ throw new Error('cannot use non-qualified names with default_namespace option');
+ }
+
+ qnames[qname] = qname;
+ }
+ }
+
+
+ elem.iter(null, function(e) {
+ var i;
+ var tag = e.tag;
+ var text = e.text;
+ var items = e.items();
+
+ if (tag instanceof QName && qnames[tag.text] === undefined) {
+ add_qname(tag.text);
+ }
+ else if (typeof(tag) === "string") {
+ add_qname(tag);
+ }
+ else if (tag !== null && tag !== Comment && tag !== CData && tag !== ProcessingInstruction) {
+ throw new Error('Invalid tag type for serialization: '+ tag);
+ }
+
+ if (text instanceof QName && qnames[text.text] === undefined) {
+ add_qname(text.text);
+ }
+
+ items.forEach(function(item) {
+ var key = item[0],
+ value = item[1];
+ if (key instanceof QName) {
+ key = key.text;
+ }
+
+ if (qnames[key] === undefined) {
+ add_qname(key);
+ }
+
+ if (value instanceof QName && qnames[value.text] === undefined) {
+ add_qname(value.text);
+ }
+ });
+ });
+ return [qnames, namespaces];
+}
+
+function _serialize_xml(write, elem, encoding, qnames, namespaces, indent, indent_string) {
+ var tag = elem.tag;
+ var text = elem.text;
+ var items;
+ var i;
+
+ var newlines = indent || (indent === 0);
+ write(Array(indent + 1).join(indent_string));
+
+ if (tag === Comment) {
+ write(sprintf("<!--%s-->", _escape_cdata(text, encoding)));
+ }
+ else if (tag === ProcessingInstruction) {
+ write(sprintf("<?%s?>", _escape_cdata(text, encoding)));
+ }
+ else if (tag === CData) {
+ text = text || '';
+ write(sprintf("<![CDATA[%s]]>", text));
+ }
+ else {
+ tag = qnames[tag];
+ if (tag === undefined) {
+ if (text) {
+ write(_escape_text(text, encoding));
+ }
+ elem.iter(function(e) {
+ _serialize_xml(write, e, encoding, qnames, null, newlines ? indent + 1 : false, indent_string);
+ });
+ }
+ else {
+ write("<" + tag);
+ items = elem.items();
+
+ if (items || namespaces) {
+ items.sort(); // lexical order
+
+ items.forEach(function(item) {
+ var k = item[0],
+ v = item[1];
+
+ if (k instanceof QName) {
+ k = k.text;
+ }
+
+ if (v instanceof QName) {
+ v = qnames[v.text];
+ }
+ else {
+ v = _escape_attrib(v, encoding);
+ }
+ write(sprintf(" %s=\"%s\"", qnames[k], v));
+ });
+
+ if (namespaces) {
+ items = utils.items(namespaces);
+ items.sort(function(a, b) { return a[1] < b[1]; });
+
+ items.forEach(function(item) {
+ var k = item[1],
+ v = item[0];
+
+ if (k) {
+ k = ':' + k;
+ }
+
+ write(sprintf(" xmlns%s=\"%s\"", k, _escape_attrib(v, encoding)));
+ });
+ }
+ }
+
+ if (text || elem.len()) {
+ if (text && text.toString().match(/^\s*$/)) {
+ text = null;
+ }
+
+ write(">");
+ if (!text && newlines) {
+ write("\n");
+ }
+
+ if (text) {
+ write(_escape_text(text, encoding));
+ }
+ elem._children.forEach(function(e) {
+ _serialize_xml(write, e, encoding, qnames, null, newlines ? indent + 1 : false, indent_string);
+ });
+
+ if (!text && indent) {
+ write(Array(indent + 1).join(indent_string));
+ }
+ write("</" + tag + ">");
+ }
+ else {
+ write(" />");
+ }
+ }
+ }
+
+ if (newlines) {
+ write("\n");
+ }
+}
+
+function parse(source, parser) {
+ var tree = new ElementTree();
+ tree.parse(source, parser);
+ return tree;
+}
+
+function tostring(element, options) {
+ return new ElementTree(element).write(options);
+}
+
+exports.PI = ProcessingInstruction;
+exports.Comment = Comment;
+exports.CData = CData;
+exports.ProcessingInstruction = ProcessingInstruction;
+exports.SubElement = SubElement;
+exports.QName = QName;
+exports.ElementTree = ElementTree;
+exports.ElementPath = ElementPath;
+exports.Element = function(tag, attrib) {
+ return new Element(tag, attrib);
+};
+
+exports.XML = function(data) {
+ var et = new ElementTree();
+ return et.parse(data);
+};
+
+exports.parse = parse;
+exports.register_namespace = register_namespace;
+exports.tostring = tostring;
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/ad0cc0bd/node_modules/elementtree/lib/errors.js
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/lib/errors.js b/node_modules/elementtree/lib/errors.js
new file mode 100644
index 0000000..e8742be
--- /dev/null
+++ b/node_modules/elementtree/lib/errors.js
@@ -0,0 +1,31 @@
+/**
+ * Copyright 2011 Rackspace
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+var util = require('util');
+
+var sprintf = require('./sprintf').sprintf;
+
+function SyntaxError(token, msg) {
+ msg = msg || sprintf('Syntax Error at token %s', token.toString());
+ this.token = token;
+ this.message = msg;
+ Error.call(this, msg);
+}
+
+util.inherits(SyntaxError, Error);
+
+exports.SyntaxError = SyntaxError;
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/ad0cc0bd/node_modules/elementtree/lib/parser.js
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/lib/parser.js b/node_modules/elementtree/lib/parser.js
new file mode 100644
index 0000000..7307ee4
--- /dev/null
+++ b/node_modules/elementtree/lib/parser.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2011 Rackspace
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/* TODO: support node-expat C++ module optionally */
+
+var util = require('util');
+var parsers = require('./parsers/index');
+
+function get_parser(name) {
+ if (name === 'sax') {
+ return parsers.sax;
+ }
+ else {
+ throw new Error('Invalid parser: ' + name);
+ }
+}
+
+
+exports.get_parser = get_parser;
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/ad0cc0bd/node_modules/elementtree/lib/parsers/index.js
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/lib/parsers/index.js b/node_modules/elementtree/lib/parsers/index.js
new file mode 100644
index 0000000..5eac5c8
--- /dev/null
+++ b/node_modules/elementtree/lib/parsers/index.js
@@ -0,0 +1 @@
+exports.sax = require('./sax');
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/ad0cc0bd/node_modules/elementtree/lib/parsers/sax.js
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/lib/parsers/sax.js b/node_modules/elementtree/lib/parsers/sax.js
new file mode 100644
index 0000000..69b0a59
--- /dev/null
+++ b/node_modules/elementtree/lib/parsers/sax.js
@@ -0,0 +1,56 @@
+var util = require('util');
+
+var sax = require('sax');
+
+var TreeBuilder = require('./../treebuilder').TreeBuilder;
+
+function XMLParser(target) {
+ this.parser = sax.parser(true);
+
+ this.target = (target) ? target : new TreeBuilder();
+
+ this.parser.onopentag = this._handleOpenTag.bind(this);
+ this.parser.ontext = this._handleText.bind(this);
+ this.parser.oncdata = this._handleCdata.bind(this);
+ this.parser.ondoctype = this._handleDoctype.bind(this);
+ this.parser.oncomment = this._handleComment.bind(this);
+ this.parser.onclosetag = this._handleCloseTag.bind(this);
+ this.parser.onerror = this._handleError.bind(this);
+}
+
+XMLParser.prototype._handleOpenTag = function(tag) {
+ this.target.start(tag.name, tag.attributes);
+};
+
+XMLParser.prototype._handleText = function(text) {
+ this.target.data(text);
+};
+
+XMLParser.prototype._handleCdata = function(text) {
+ this.target.data(text);
+};
+
+XMLParser.prototype._handleDoctype = function(text) {
+};
+
+XMLParser.prototype._handleComment = function(comment) {
+};
+
+XMLParser.prototype._handleCloseTag = function(tag) {
+ this.target.end(tag);
+};
+
+XMLParser.prototype._handleError = function(err) {
+ throw err;
+};
+
+XMLParser.prototype.feed = function(chunk) {
+ this.parser.write(chunk);
+};
+
+XMLParser.prototype.close = function() {
+ this.parser.close();
+ return this.target.close();
+};
+
+exports.XMLParser = XMLParser;
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/ad0cc0bd/node_modules/elementtree/lib/sprintf.js
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/lib/sprintf.js b/node_modules/elementtree/lib/sprintf.js
new file mode 100644
index 0000000..f802c1b
--- /dev/null
+++ b/node_modules/elementtree/lib/sprintf.js
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2011 Rackspace
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+var cache = {};
+
+
+// Do any others need escaping?
+var TO_ESCAPE = {
+ '\'': '\\\'',
+ '\n': '\\n'
+};
+
+
+function populate(formatter) {
+ var i, type,
+ key = formatter,
+ prev = 0,
+ arg = 1,
+ builder = 'return \'';
+
+ for (i = 0; i < formatter.length; i++) {
+ if (formatter[i] === '%') {
+ type = formatter[i + 1];
+
+ switch (type) {
+ case 's':
+ builder += formatter.slice(prev, i) + '\' + arguments[' + arg + '] + \'';
+ prev = i + 2;
+ arg++;
+ break;
+ case 'j':
+ builder += formatter.slice(prev, i) + '\' + JSON.stringify(arguments[' + arg + ']) + \'';
+ prev = i + 2;
+ arg++;
+ break;
+ case '%':
+ builder += formatter.slice(prev, i + 1);
+ prev = i + 2;
+ i++;
+ break;
+ }
+
+
+ } else if (TO_ESCAPE[formatter[i]]) {
+ builder += formatter.slice(prev, i) + TO_ESCAPE[formatter[i]];
+ prev = i + 1;
+ }
+ }
+
+ builder += formatter.slice(prev) + '\';';
+ cache[key] = new Function(builder);
+}
+
+
+/**
+ * A fast version of sprintf(), which currently only supports the %s and %j.
+ * This caches a formatting function for each format string that is used, so
+ * you should only use this sprintf() will be called many times with a single
+ * format string and a limited number of format strings will ever be used (in
+ * general this means that format strings should be string literals).
+ *
+ * @param {String} formatter A format string.
+ * @param {...String} var_args Values that will be formatted by %s and %j.
+ * @return {String} The formatted output.
+ */
+exports.sprintf = function(formatter, var_args) {
+ if (!cache[formatter]) {
+ populate(formatter);
+ }
+
+ return cache[formatter].apply(null, arguments);
+};
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org