Implemented download (with the authentication passed as parameter):
authorChristos Stathis <chstath@ebs.gr>
Fri, 8 Jul 2011 08:41:08 +0000 (11:41 +0300)
committerChristos Stathis <chstath@ebs.gr>
Fri, 8 Jul 2011 08:41:08 +0000 (11:41 +0300)
web_client/src/gr/grnet/pithos/web/client/FileContextMenu.java
web_client/src/gr/grnet/pithos/web/client/FileMenu.java

index 9191f1e..7c562f8 100644 (file)
@@ -171,25 +171,13 @@ public class FileContextMenu extends PopupPanel {
                        propItem = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + "&nbsp;Properties</span>", true, new PropertiesCommand(this, images, 0));
             contextMenu.addItem(propItem);
 
-
-                       String[] link = {"", ""};
-                       gss.getTopPanel().getFileMenu().createDownloadLink(link, false);
-               // The command that does some validation before downloading a file.
-            Command downloadCmd = new Command() {
-
+                       downloadItem = new MenuItem("<span><a class='hidden-link' href='" + GSS.get().getApiPath() + GSS.get().getUsername() + selectedFiles.get(0).getUri() + "?X-Auth-Token=" + GSS.get().getToken() + "' target='_blank'>" + AbstractImagePrototype.create(newImages.download()).getHTML() + " Download</a></span>", true, new Command() {
                 @Override
                 public void execute() {
-                    hide();
-                    GSS.get().getTopPanel().getFileMenu().preDownloadCheck();
                 }
-            };
-                       downloadItem = new MenuItem("<span>" + link[0] + AbstractImagePrototype.create(newImages.download()).getHTML() + " Download" + link[1] + "</span>", true, downloadCmd);
+            });
                        contextMenu.addItem(downloadItem);
                        
-                       gss.getTopPanel().getFileMenu().createDownloadLink(link, true);
-                       saveAsItem = new MenuItem("<span>" + link[0] + AbstractImagePrototype.create(newImages.download()).getHTML() + " Save As" + link[1] + "</span>", true, downloadCmd);
-                       contextMenu.addItem(saveAsItem);
-
             final Command unselectAllCommand = new Command() {
 
                 @Override
index 0ffdd70..66d151d 100644 (file)
@@ -151,7 +151,7 @@ public class FileMenu extends PopupPanel implements ClickHandler {
        void createDownloadLink(String[] link, boolean forceDownload) {
                String downloadURL = getDownloadURL();
                if (!downloadURL.isEmpty()) {
-                       link[0] = "<a id ='topMenu.file.download' class='hidden-link' href='" + downloadURL
+                       link[0] = "<a class='hidden-link' href='" + downloadURL
                                        + (forceDownload ? "&dl=1" : "") + "' target='_blank'>";
                        link[1] = "</a>";
                }