emscripten Humble Cloud interface
Edward Rudd
2014-08-20 e891f9c1774de7035c502542d92a513587d71081

add URL to api of where to fetch the file

2 files modified
13 ■■■■■ changed files
client/library/humble_cloud.js 7 ●●●●● patch | view | raw | blame | history
server/src/RestAPI/Storage.php 6 ●●●● patch | view | raw | blame | history
client/library/humble_cloud.js
@@ -3,7 +3,7 @@
    $HUMBLE_CLOUD__postset: 'HUMBLE_CLOUD.staticInit()',
    $HUMBLE_CLOUD: {
        applicationToken: '__NOTOKEN__',
        remoteAPIEndpoint: 'http://asmjs.brigadoon.outoforder.cc/cloud/',
        remoteAPIEndpoint: 'http://asmjs.brigadoon.outoforder.cc/cloud',
        staticInit: function() {
            console.log('Humble Cloud Init');
@@ -45,14 +45,15 @@
          xhr.send(null);
        },
        getRemoteSet: function(mount, callback) {
          var url = mount.type.remoteAPIEndpoint + 'storage/files';
          HUMBLE_CLOUD.xhrLoad(url, function(data) {
          var url = mount.type.remoteAPIEndpoint + '/storage/files';
          mount.type.xhrLoad(url, function(data) {
            var entries = {},
                json = JSON.parse(data);
            for(var k in json.data) {
              var f = json.data[k];
              var absolute = PATH.join2(mount.mountpoint, f.path);
              entries[absolute] = {
                url: (f.url.substr(0, 1) == '/') ? mount.type.remoteAPIEndpoint + f.url : f.url,
                timestamp: new Date(parseInt(f.timestamp)),
                size: f.size
              }
server/src/RestAPI/Storage.php
@@ -10,11 +10,6 @@
        $this->da = $da;
    }
    function get()
    {
      return array();
    }
    function getFiles()
    {
        $ret = array();
@@ -23,6 +18,7 @@
        foreach( $files as $item) {
            $ret[] = array(
                'url' => '/files/' . $item['id'],
                'path' => $item['path'] . '/' . $item['name'],
                'timestamp' => $item['timestamp'],
                'size' => $item['size'],