You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2015/05/12 23:13:57 UTC
[1/2] cordova-windows git commit: CB-8946: Added the
"WindowsToastCapable" preference to indicate that the app can support toasts.
This is to support the Local Notifications plugin.
Repository: cordova-windows
Updated Branches:
refs/heads/master 76b129eaa -> e5f54f2ef
CB-8946: Added the "WindowsToastCapable" preference to indicate that the
app can support toasts. This is to support the Local Notifications
plugin.
Project: http://git-wip-us.apache.org/repos/asf/cordova-windows/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-windows/commit/5f72b571
Tree: http://git-wip-us.apache.org/repos/asf/cordova-windows/tree/5f72b571
Diff: http://git-wip-us.apache.org/repos/asf/cordova-windows/diff/5f72b571
Branch: refs/heads/master
Commit: 5f72b571ebabd1924049f544fc6bfe4a554ae4fc
Parents: 973b45a
Author: Rob Paveza <Ro...@microsoft.com>
Authored: Tue May 5 10:40:27 2015 -0700
Committer: Rob Paveza <Ro...@microsoft.com>
Committed: Tue May 5 10:40:27 2015 -0700
----------------------------------------------------------------------
template/cordova/lib/prepare.js | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/5f72b571/template/cordova/lib/prepare.js
----------------------------------------------------------------------
diff --git a/template/cordova/lib/prepare.js b/template/cordova/lib/prepare.js
index 7bec13d..d884cb7 100644
--- a/template/cordova/lib/prepare.js
+++ b/template/cordova/lib/prepare.js
@@ -86,6 +86,7 @@ function updateManifestFile (config, manifestPath, namespacePrefix) {
sortCapabilities(manifest);
applyAccessRules(config, manifest);
applyBackgroundColor(config, manifest, namespacePrefix);
+ applyToastCapability(config, manifest, namespacePrefix);
//Write out manifest
@@ -386,3 +387,24 @@ function applyBackgroundColor (config, manifest, xmlnsPrefix) {
visualElems.attrib.BackgroundColor = refineColor(bgColor);
}
}
+
+/**
+ * Applies the ToastCapable attribute to the VisualElements tag
+ * @param config {ConfigParser} The configuration reader
+ * @param manifest {et.ElementTree} The manifest file
+ * @namespacePrefix {String} The XML namespace for the VisualElements tag, in the form 'm2:'
+ */
+function applyToastCapability(config, manifest, namespacePrefix) {
+ var isToastCapable = config.getPreference('WindowsToastCapable');
+ isToastCapable = (isToastCapable && isToastCapable.toString().toLowerCase() === 'true');
+
+ var visualElementsName = './/' + namespacePrefix + 'VisualElements';
+ var visualElems = manifest.find(visualElementsName);
+
+ if (isToastCapable) {
+ visualElems.attrib.ToastCapable = 'true';
+ }
+ else {
+ delete visualElems.attrib.ToastCapable;
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[2/2] cordova-windows git commit: Merge branch 'CB-8946' of
https://github.com/MSOpenTech/cordova-windows
Posted by pu...@apache.org.
Merge branch 'CB-8946' of https://github.com/MSOpenTech/cordova-windows
Project: http://git-wip-us.apache.org/repos/asf/cordova-windows/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-windows/commit/e5f54f2e
Tree: http://git-wip-us.apache.org/repos/asf/cordova-windows/tree/e5f54f2e
Diff: http://git-wip-us.apache.org/repos/asf/cordova-windows/diff/e5f54f2e
Branch: refs/heads/master
Commit: e5f54f2eff8b0c2aa5016b02b0be2b4e3fa372b6
Parents: 76b129e 5f72b57
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Tue May 12 14:13:42 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Tue May 12 14:13:42 2015 -0700
----------------------------------------------------------------------
template/cordova/lib/prepare.js | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/e5f54f2e/template/cordova/lib/prepare.js
----------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org