cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Axel Nennker (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CB-8448) Add support for "activities" field in FirefoxOS manifest.webapp
Date Mon, 09 Feb 2015 22:44:34 GMT
Axel Nennker created CB-8448:
--------------------------------

             Summary: 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: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message