Revision bd187dfb
b/src/gr/grnet/pithos/web/client/FolderContextMenu.java | ||
---|---|---|
98 | 98 |
|
99 | 99 |
if (!folder.isInTrash()) { |
100 | 100 |
if (canWrite) { |
101 |
MenuItem newFolder = new MenuItem("<span id = 'folderContextMenu.newFolder'>" + AbstractImagePrototype.create(newImages.folderNew()).getHTML() + " New Folder</span>", true, new NewFolderCommand(app, this, folder, images));
|
|
101 |
MenuItem newFolder = new MenuItem("<span id = 'folderContextMenu.newFolder'>" + AbstractImagePrototype.create(newImages.folderNew()).getHTML() + " New Folder</span>", true, new NewFolderCommand(app, this, folder)); |
|
102 | 102 |
contextMenu.addItem(newFolder); |
103 | 103 |
|
104 | 104 |
if (isFolderTreeSelected && !folder.isContainer()) { |
b/src/gr/grnet/pithos/web/client/Pithos.java | ||
---|---|---|
34 | 34 |
*/ |
35 | 35 |
package gr.grnet.pithos.web.client; |
36 | 36 |
|
37 |
import gr.grnet.pithos.web.client.commands.NewFolderCommand; |
|
37 | 38 |
import gr.grnet.pithos.web.client.commands.UploadFileCommand; |
38 | 39 |
import gr.grnet.pithos.web.client.foldertree.AccountResource; |
39 | 40 |
import gr.grnet.pithos.web.client.foldertree.File; |
... | ... | |
68 | 69 |
import com.google.gwt.core.client.GWT; |
69 | 70 |
import com.google.gwt.core.client.Scheduler; |
70 | 71 |
import com.google.gwt.core.client.Scheduler.ScheduledCommand; |
72 |
import com.google.gwt.dom.client.Style.Display; |
|
71 | 73 |
import com.google.gwt.event.dom.client.ClickEvent; |
72 | 74 |
import com.google.gwt.event.dom.client.ClickHandler; |
73 | 75 |
import com.google.gwt.event.logical.shared.ResizeEvent; |
... | ... | |
92 | 94 |
import com.google.gwt.user.client.History; |
93 | 95 |
import com.google.gwt.user.client.Window; |
94 | 96 |
import com.google.gwt.user.client.ui.AbstractImagePrototype; |
97 |
import com.google.gwt.user.client.ui.Anchor; |
|
95 | 98 |
import com.google.gwt.user.client.ui.Button; |
96 | 99 |
import com.google.gwt.user.client.ui.Composite; |
100 |
import com.google.gwt.user.client.ui.FlowPanel; |
|
97 | 101 |
import com.google.gwt.user.client.ui.HTML; |
102 |
import com.google.gwt.user.client.ui.HTMLPanel; |
|
98 | 103 |
import com.google.gwt.user.client.ui.HasHorizontalAlignment; |
99 | 104 |
import com.google.gwt.user.client.ui.HasVerticalAlignment; |
100 | 105 |
import com.google.gwt.user.client.ui.HorizontalPanel; |
... | ... | |
270 | 275 |
|
271 | 276 |
private HTML numOfFiles; |
272 | 277 |
|
273 |
private Image refreshButton;
|
|
278 |
private Anchor refreshButton;
|
|
274 | 279 |
|
275 |
private Image toolsButton;
|
|
280 |
private Anchor toolsButton;
|
|
276 | 281 |
|
277 | 282 |
@Override |
278 | 283 |
public void onModuleLoad() { |
... | ... | |
312 | 317 |
header.add(upload); |
313 | 318 |
header.setCellHorizontalAlignment(upload, HasHorizontalAlignment.ALIGN_LEFT); |
314 | 319 |
header.setCellVerticalAlignment(upload, HasVerticalAlignment.ALIGN_MIDDLE); |
315 |
// header.setCellWidth(upload, "146px"); |
|
316 | 320 |
|
317 | 321 |
messagePanel.setVisible(false); |
318 | 322 |
header.add(messagePanel); |
319 | 323 |
header.setCellHorizontalAlignment(messagePanel, HasHorizontalAlignment.ALIGN_CENTER); |
320 | 324 |
header.setCellVerticalAlignment(messagePanel, HasVerticalAlignment.ALIGN_MIDDLE); |
321 |
|
|
322 |
refreshButton = new Image(images.refresh()); |
|
323 |
refreshButton.addStyleName("pithos-toolsButton"); |
|
324 |
refreshButton.setWidth("32px"); |
|
325 |
refreshButton.setHeight("32px"); |
|
325 |
|
|
326 |
FlowPanel toolbar = new FlowPanel(); |
|
327 |
toolbar.getElement().setId("toolbar"); |
|
328 |
toolbar.addStyleName("clearfix"); |
|
329 |
toolbar.getElement().getStyle().setDisplay(Display.BLOCK); |
|
330 |
|
|
331 |
Anchor newFolderButton = new Anchor("<span class='ico'></span><span class='title'>New folder</span>", true); |
|
332 |
newFolderButton.getElement().setId("newfolder-button"); |
|
333 |
newFolderButton.addStyleName("pithos-toolbarItem"); |
|
334 |
newFolderButton.addClickHandler(new ClickHandler() { |
|
335 |
|
|
336 |
@Override |
|
337 |
public void onClick(@SuppressWarnings("unused") ClickEvent event) { |
|
338 |
Folder folder = getSelectedTree().getSelection(); |
|
339 |
if (folder != null) { |
|
340 |
Boolean[] permissions = folder.getPermissions().get(getUsername()); |
|
341 |
boolean canWrite = folder.getOwner().equals(getUsername()) || (permissions!= null && permissions[1] != null && permissions[1]); |
|
342 |
|
|
343 |
if (!folder.isInTrash() && canWrite) |
|
344 |
new NewFolderCommand(Pithos.this, null, folder).execute(); |
|
345 |
} |
|
346 |
} |
|
347 |
}); |
|
348 |
toolbar.add(newFolderButton); |
|
349 |
|
|
350 |
refreshButton = new Anchor("<span class='ico'></span><span class='title'>Refresh</span>", true); |
|
351 |
refreshButton.getElement().setId("refresh-button"); |
|
352 |
refreshButton.addStyleName("pithos-toolbarItem"); |
|
326 | 353 |
refreshButton.addClickHandler(new ClickHandler() { |
327 | 354 |
|
328 | 355 |
@Override |
... | ... | |
341 | 368 |
}); |
342 | 369 |
} |
343 | 370 |
}); |
344 |
header.add(refreshButton); |
|
345 |
header.setCellHorizontalAlignment(refreshButton, HasHorizontalAlignment.ALIGN_CENTER); |
|
346 |
header.setCellVerticalAlignment(refreshButton, HasVerticalAlignment.ALIGN_MIDDLE); |
|
347 |
header.setCellWidth(refreshButton, "40px"); |
|
371 |
toolbar.add(refreshButton); |
|
348 | 372 |
|
349 |
toolsButton = new Image(images.tools()); |
|
350 |
toolsButton.addStyleName("pithos-toolsButton"); |
|
373 |
toolsButton = new Anchor("<span class='ico'></span><span class='title'>More...</span>", true); |
|
374 |
toolsButton.getElement().setId("tools-button"); |
|
375 |
toolsButton.addStyleName("pithos-toolbarItem"); |
|
351 | 376 |
toolsButton.addClickHandler(new ClickHandler() { |
352 | 377 |
|
353 | 378 |
@Override |
... | ... | |
359 | 384 |
} |
360 | 385 |
} |
361 | 386 |
}); |
362 |
header.add(toolsButton); |
|
363 |
header.setCellHorizontalAlignment(toolsButton, HasHorizontalAlignment.ALIGN_CENTER); |
|
364 |
header.setCellVerticalAlignment(toolsButton, HasVerticalAlignment.ALIGN_MIDDLE); |
|
365 |
header.setCellWidth(toolsButton, "40px"); |
|
366 |
|
|
387 |
toolbar.add(toolsButton); |
|
388 |
|
|
389 |
header.add(toolbar); |
|
390 |
header.setCellHorizontalAlignment(toolbar, HasHorizontalAlignment.ALIGN_CENTER); |
|
391 |
header.setCellVerticalAlignment(toolbar, HasVerticalAlignment.ALIGN_MIDDLE); |
|
392 |
// header.setCellWidth(toolbar, "40px"); |
|
393 |
|
|
367 | 394 |
HorizontalPanel folderStatistics = new HorizontalPanel(); |
368 | 395 |
folderStatistics.addStyleName("pithos-folderStatistics"); |
369 | 396 |
numOfFiles = new HTML(); |
b/src/gr/grnet/pithos/web/client/ToolsMenu.java | ||
---|---|---|
104 | 104 |
|
105 | 105 |
if (!folder.isInTrash()) { |
106 | 106 |
if (canWrite) { |
107 |
MenuItem newFolder = new MenuItem("<span id = 'folderContextMenu.newFolder'>" + AbstractImagePrototype.create(newImages.folderNew()).getHTML() + " New Folder</span>", true, new NewFolderCommand(app, this, folder, images)); |
|
108 |
contextMenu.addItem(newFolder); |
|
109 | 107 |
|
110 | 108 |
if (isFolderTreeSelected) { |
111 | 109 |
MenuItem cut = null; |
b/src/gr/grnet/pithos/web/client/commands/NewFolderCommand.java | ||
---|---|---|
50 | 50 |
private PopupPanel containerPanel; |
51 | 51 |
|
52 | 52 |
private Folder folder; |
53 |
final Images images; |
|
54 | 53 |
|
55 | 54 |
private Pithos app; |
56 | 55 |
|
... | ... | |
58 | 57 |
* @param aContainerPanel |
59 | 58 |
* @param newImages the images of the new folder dialog |
60 | 59 |
*/ |
61 |
public NewFolderCommand(Pithos _app, PopupPanel aContainerPanel, Folder folder, final Images newImages){
|
|
60 |
public NewFolderCommand(Pithos _app, PopupPanel aContainerPanel, Folder folder){ |
|
62 | 61 |
app = _app; |
63 | 62 |
containerPanel = aContainerPanel; |
64 |
images=newImages; |
|
65 | 63 |
this.folder = folder; |
66 | 64 |
} |
67 | 65 |
|
b/src/gr/grnet/pithos/web/public/pithos.css | ||
---|---|---|
399 | 399 |
height: 32px; |
400 | 400 |
padding: 5px 15px; |
401 | 401 |
margin-right: 10px; |
402 |
margin-left: 10px; |
|
402 | 403 |
} |
403 | 404 |
|
404 | 405 |
.grnet-sign { |
... | ... | |
433 | 434 |
margin: 10px; |
434 | 435 |
} |
435 | 436 |
|
436 |
.pithos-toolsButton { |
|
437 |
background-color: #FF7F2A !important; |
|
438 |
background-position: 9px 7px !important; |
|
437 |
.clearfix { |
|
438 |
display: block; |
|
439 |
width: auto; |
|
440 |
zoom: 1; |
|
441 |
} |
|
442 |
|
|
443 |
div#toolbar { |
|
444 |
clear: both; |
|
445 |
color: white; |
|
446 |
float: right; |
|
447 |
/* position: absolute; |
|
448 |
right: 15px; |
|
449 |
top: 15px;*/ |
|
450 |
} |
|
451 |
|
|
452 |
div#toolbar a { |
|
453 |
display: block; |
|
454 |
float: left; |
|
455 |
} |
|
456 |
|
|
457 |
.pithos-toolbarItem { |
|
458 |
text-decoration: none; |
|
459 |
font-size: 0.8em; |
|
460 |
padding: 4px; |
|
461 |
padding-right: 8px; |
|
462 |
color: white; |
|
463 |
margin-left: 5px; |
|
464 |
background-repeat: no-repeat; |
|
465 |
background-color: #A1C8DB; |
|
466 |
} |
|
467 |
|
|
468 |
.pithos-toolbarItem:HOVER { |
|
469 |
background-color: #74aec9; |
|
470 |
} |
|
471 |
|
|
472 |
|
|
473 |
.pithos-toolbarItem span { |
|
474 |
float: left; |
|
475 |
} |
|
476 |
.pithos-toolbarItem span.ico { |
|
477 |
width: 16px; |
|
478 |
height: 16px; |
|
479 |
margin-right: 5px; |
|
480 |
background-repeat: no-repeat; |
|
481 |
/* background-position: -36px 0;*/ |
|
482 |
} |
|
483 |
|
|
484 |
#tools-button span.ico { |
|
485 |
background-image: url(images/advancedsettings.png); |
|
486 |
} |
|
487 |
|
|
488 |
#refresh-button span.ico { |
|
489 |
background-image: url(images/refresh.png); |
|
439 | 490 |
} |
440 | 491 |
|
441 |
.pithos-toolsButton:hover {
|
|
442 |
background-color: #F95 !important;
|
|
492 |
#newFolder-button span.ico {
|
|
493 |
background-image: url(images/folder_new.png);
|
|
443 | 494 |
} |
444 | 495 |
|
445 | 496 |
/*move background from inner to centerinner to wrap action buttons too*/ |
446 | 497 |
.dialogMiddleCenterInner.dialogContent { |
447 |
background: url(https://pithos.dev.grnet.gr/ui/images/white50.png);
|
|
498 |
background: url(images/white50.png); |
|
448 | 499 |
margin: 7px; |
449 | 500 |
padding: 15px; |
450 | 501 |
/*border: 1px solid #aaa;*/ |
Also available in: Unified diff