From ea5d2a2b4dd06ea72794c7b8ffe1034e0bad14f8 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 9 Aug 2013 12:49:34 +0000 Subject: [PATCH] feature(menu, dom) add zipFile --- lib/client/dom.js | 13 +++++++++++++ lib/client/menu.js | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/client/dom.js b/lib/client/dom.js index 07f8e3f3..f40e496a 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -1048,6 +1048,19 @@ var CloudCmd, Util, DOM, CloudFunc; RESTfull.save(lDir + lName + lType, null, CloudCmd.refresh); }; + /** + * zip file + * + */ + this.zipFile = function(){ + var lName = Cmd.getCurrentName(), + lDir = Cmd.getCurrentDirPath(), + lQuery = '?zip'; + + if (lName && lName !== '..') + RESTfull.save(lDir + lName, null, CloudCmd.refresh, lQuery); + }; + /** * delete currentfile, prompt before it diff --git a/lib/client/menu.js b/lib/client/menu.js index 945cc392..878b8746 100644 --- a/lib/client/menu.js +++ b/lib/client/menu.js @@ -173,7 +173,8 @@ var CloudCmd, Util, DOM, CloudFunc, $; 'Rename' : function(){ setTimeout( Util.retExec(DOM.renameCurrent), 100); }, - 'Delete' : Util.retExec(DOM.promptDeleteSelected) + 'Delete' : Util.retExec(DOM.promptDeleteSelected), + 'Zip file' : DOM.zipFile }; if (UploadToItemNames.length)