feature(cloudcmd) pack -> extract

This commit is contained in:
coderaiser 2015-07-03 09:11:30 -04:00
parent cc8693be60
commit 4365d70411
7 changed files with 18 additions and 14 deletions

View file

@ -229,7 +229,7 @@ Right mouse click button shows context menu with items:
- Rename
- Delete
- Pack
- Unpack
- Extract
- Upload to (Dropbox, Github, GDrive, FilePicker)
- Download
- Cut

View file

@ -93,7 +93,7 @@
content : '\e813 ';
}
.icon-unpack::before {
.icon-extract::before {
font-family : 'Fontello';
content : '\e814 ';
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Before After
Before After

View file

@ -478,8 +478,8 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
Dialog.alert('No files selected!');
} else {
switch(operation) {
case 'unpack':
op = RESTful.unpack;
case 'extract':
op = RESTful.extract;
fileFrom = {
from : path,
@ -492,7 +492,11 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
case 'pack':
op = RESTful.pack;
name += '.tar.gz';
if (names.lengh > 1)
name = Info.dir;
else
name += '.tar.gz';
fileFrom = {
from : dirPath,
@ -518,7 +522,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
* zip file
*
*/
this.pack = function() {
this.pack = function() {
twopack('pack');
};
@ -526,8 +530,8 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
* unzip file
*
*/
this.unpack = function() {
twopack('unpack');
this.unpack = function() {
twopack('extract');
};
/**

View file

@ -172,7 +172,7 @@ var CloudCmd, Util, DOM, CloudFunc, MenuIO;
},
'Delete' : Operation.show.bind(null, 'delete'),
'Pack' : DOM.pack,
'Unpack' : DOM.unpack,
'Extract' : DOM.extract,
'Upload To' : {},
'Download' : download,
'Cut' : Buffer.cut,

View file

@ -104,10 +104,10 @@ var Util, DOM, CloudFunc, CloudCmd;
});
};
this.unpack = function(data, callback) {
this.extract = function(data, callback) {
sendRequest({
method : 'PUT',
url : '/unpack',
url : '/extract',
data : data,
callback : callback
});

View file

@ -243,11 +243,11 @@
pack(files.from, files.to, files.names, callback);
break;
case 'unpack':
case 'extract':
if (!files.from)
callback(body);
else
unpack(files.from, files.to, callback);
extract(files.from, files.to, callback);
break;
@ -290,7 +290,7 @@
operation('pack', from, to, names, fn);
}
function unpack(from, to, fn) {
function extract(from, to, fn) {
from = root(from);
if (to)