add URL to api of where to fetch the file
| | |
| | | $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'); |
| | |
| | | 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 |
| | | } |
| | |
| | | $this->da = $da; |
| | | } |
| | | |
| | | function get() |
| | | { |
| | | return array(); |
| | | } |
| | | |
| | | function getFiles() |
| | | { |
| | | $ret = array(); |
| | |
| | | |
| | | foreach( $files as $item) { |
| | | $ret[] = array( |
| | | 'url' => '/files/' . $item['id'], |
| | | 'path' => $item['path'] . '/' . $item['name'], |
| | | 'timestamp' => $item['timestamp'], |
| | | 'size' => $item['size'], |