You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ka...@apache.org on 2015/03/17 23:06:22 UTC
cordova-lib git commit: Add addElement() to ConfigParser
Repository: cordova-lib
Updated Branches:
refs/heads/master 57d32188f -> 3a788c1bd
Add addElement() to ConfigParser
To easily manipulate the ConfigParser object from downstream tools.
Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/3a788c1b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/3a788c1b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/3a788c1b
Branch: refs/heads/master
Commit: 3a788c1bdbadbf312ccf75b743861d060a845476
Parents: 57d3218
Author: Mark Koudritsky <ka...@gmail.com>
Authored: Tue Mar 17 17:59:23 2015 -0400
Committer: Mark Koudritsky <ka...@gmail.com>
Committed: Tue Mar 17 17:59:23 2015 -0400
----------------------------------------------------------------------
cordova-lib/src/configparser/ConfigParser.js | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/3a788c1b/cordova-lib/src/configparser/ConfigParser.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/configparser/ConfigParser.js b/cordova-lib/src/configparser/ConfigParser.js
index ee85c99..2bce391 100644
--- a/cordova-lib/src/configparser/ConfigParser.js
+++ b/cordova-lib/src/configparser/ConfigParser.js
@@ -388,7 +388,16 @@ ConfigParser.prototype = {
}
}
},
-
+
+ // Add any element to the root
+ addElement: function(name, attributes) {
+ var el = et.Element(name);
+ for (var a in attributes) {
+ el.attrib[a] = attributes[a];
+ }
+ this.doc.getroot().append(el);
+ },
+
/**
* Adds an engine. Does not check for duplicates.
* @param {String} name the engine name
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org