feature(rest) add unzip

This commit is contained in:
coderaiser 2014-03-25 04:05:13 -04:00
parent 83aa10660c
commit 41654e09d3
12 changed files with 66 additions and 4 deletions

View file

@ -602,6 +602,23 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
RESTful.zip(fileFrom, CloudCmd.refresh);
};
/**
* unzip file
*
*/
this.unzipFile = function() {
var RESTful = DOM.RESTful,
name = Cmd.getCurrentName(),
dir = Cmd.getCurrentDirPath(),
path = dir + name,
fileFrom = {
from : path
};
if (name && name !== '..')
RESTful.unzip(fileFrom, CloudCmd.refresh);
};
/**
* prompt and delete current file or selected files

View file

@ -189,7 +189,8 @@ var CloudCmd, Util, DOM, CloudFunc, $;
},
'Delete' : DOM.promptDelete,
'(Un)Select All': DOM.toggleAllSelectedFiles,
'Zip file' : DOM.zipFile
'Zip file' : DOM.zipFile,
'Unzip file' : DOM.unzipFile
};
if (UploadToItemNames.length)

View file

@ -62,6 +62,15 @@ var Util, DOM, CloudFunc, CloudCmd;
});
};
this.unzip = function(data, callback) {
sendRequest({
method : 'PUT',
url : '/unzip',
data : data,
callback : callback
});
};
this.mv = function(data, callback) {
sendRequest({
method : 'PUT',