incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filip Maj <...@adobe.com>
Subject More issue gardening discussion: app root path
Date Mon, 11 Jun 2012 23:54:37 GMT
Reference issue: https://issues.apache.org/jira/browse/CB-285

TL;DR: how can I reference in-app (inside the www folder) resources in a
cross-platform way? For example, packaged .mp3 file, for use in Media.

Some contributors recommend parsing location.href, but this is brittle and
does not work on all platforms.

My proposal: add a new constant to the LocalFileSystem object [1]
representing the application root (e.g. APPLICATION). Users could then:

function onSuccess(fileSystem) {
    console.log(fileSystem.name);
}

// request the file system of the app package www folder
window.requestFileSystem(LocalFileSystem.APPLICATION, 0, onSuccess,
onError);


Thoughts?

[1] 
http://docs.phonegap.com/en/1.8.0/cordova_file_file.md.html#LocalFileSystem


Mime
View raw message