Manage your users' cloud services from your application.
$ npm i
$ npm run build
This will compile the JS files from src/
with ReactJS and Babel. The generated files will go in dist/
.
You can serve dist
on http://localhost:6805
with
$ npm start
And then access the demo app on http://localhost:6805/cloud-explorer/
This is what is done on heroku here: a live demo
For a complete example see the dist folder.
On the client side, the HTML:
<iframe id="ceIFrame" class="container" src="/cloud-explorer/cloud-explorer.html" />
And the Javascript:
const ce = document.querySelector('#ceIFrame').contentWindow.ce;
ce.openFile(['.jpg', '.jpeg', '.png', '.gif'])
.then(fileInfo => {
if(fileInfo) alert('you chose:' + fileInfo.path);
else alert('you canceled');
})
.catch(e => alert('an error occured: ' + e.message));
Please feel free to ask in the issues, and contribute docs in the wiki.
For now, the best way to know the API is to take a look at the App
class which exposes all CE methods here.