[
https://issues.apache.org/jira/browse/CB-8448?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14348404#comment-14348404
]
Axel Nennker commented on CB-8448:
----------------------------------
Although PR #172 was merged I would like to keep this issue open because #172
was only a first step.
#172 implements what I need in one project but does not add full support for
activities in a Cordoba app's manifest.webapp.
> Add support for "activities" field in FirefoxOS manifest.webapp
> ---------------------------------------------------------------
>
> Key: CB-8448
> URL: https://issues.apache.org/jira/browse/CB-8448
> Project: Apache Cordova
> Issue Type: Bug
> Components: FirefoxOS
> Reporter: Axel Nennker
>
> FirefoxOS manifest files allow a richer set of fields than currently
> supported by firefoxos_parser.js
> https://github.com/apache/cordova-lib/blob/master/cordova-lib/src/cordova/metadata/firefoxos_parser.js
> E.g.: "activities"
> https://developer.mozilla.org/de/Apps/Manifest#activities
> This is needed to e.g. open files of a defined mime type.
> Extend syntax of plugin.xml like e.g.:
> <platform name="firefoxos">
> <config-file target="config.xml" parent="/*">
> <activities>
> <activity name="open" href="./import.html"
> disposition="inline">
> <filter type="application/wallet-import" />
> </activity>
> </activities>
> </config-file>
> </platform>
> This results e.g. in
> "activities": {
> "open": {
> "href": "./import.html",
> "disposition": "inline",
> "filters": {
> "type": "application/wallet-import"
> }
> }
> },
> Lines needed for this in firefoxos_parser.js:
> var activitiesNodes = config.doc.findall('activities');
> activitiesNodes.forEach(function(activitiesNode) {
> var activityNodes = activitiesNode.findall('activity');
> if (activityNodes.length) {
> var activities = {};
> activityNodes.forEach(function (node) {
> var name = node.attrib.name;
> var href = node.attrib.href;
> if (name && href) {
> events.emit('verbose', 'activity name='+name+'
> href='+href);
> activities[name] = {};
> activities[name].href = href;
> var disposition = node.attrib.disposition;
> if (disposition) {
> activities[name].disposition = disposition;
> }
> activities[name].filters = {};
> var filterNodes = node.findall('filter');
> filterNodes.forEach(function(filter) {
> var type = filter.attrib.type;
> if (type) {
> activities[name].filters.type = type;
> }
> });
> } else {
> events.emit('warn', 'activity without name='+name+'or
> href='+href);
> }
> });
> manifest.activities = activities;
> }
> });
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]