upload requested files

This commit is contained in:
j 2010-09-17 23:06:01 +02:00
commit 8535f961ec
3 changed files with 28 additions and 5 deletions

View file

@ -191,6 +191,20 @@ app.afterLaunch.push(function() {
}
);
},
uploadFile: function(oshash) {
Ox.print('upload file', oshash);
var url = app.local.absolute_url('/api/');
app.local.upload({
url: url,
data: {action: 'upload', oshash: oshash},
oshash: oshash,
action: 'file'
},
function(result) {
Ox.print(result);
}
);
},
cancel: function(oshash) {
Ox.print('this function needs to be implemented: cancel ', oshash);
},
@ -251,6 +265,7 @@ app.afterLaunch.push(function() {
}, function(result) {
var videos = {};
function parseResult(result) {
//extract and upload requested videos
$.each(result.data.data, function(i, oshash) {
$.each(folder_ids, function(i, ids) {
if($.inArray(oshash, ids) > -1) {
@ -293,6 +308,10 @@ app.afterLaunch.push(function() {
}
});
});
//upload requested files
$.each(result.data.file, function(i, oshash) {
app.local.uploadFile(oshash);
});
};
if (result.data.info.length>0) {
var post = {'info': {}};