parent
5d6756d7bc
commit
ae6056eddc
|
@ -118,6 +118,9 @@ public class DialogShareableLink extends Composite {
|
||||||
@UiField
|
@UiField
|
||||||
Button privateLongLinkCopyButton;
|
Button privateLongLinkCopyButton;
|
||||||
|
|
||||||
|
@UiField
|
||||||
|
Button publicLinkCopyButton;
|
||||||
|
|
||||||
@UiField
|
@UiField
|
||||||
Button publicLongLinkCopyButton;
|
Button publicLongLinkCopyButton;
|
||||||
|
|
||||||
|
@ -189,6 +192,7 @@ public class DialogShareableLink extends Composite {
|
||||||
|
|
||||||
textPrivateLink.setId(Random.nextInt()+Random.nextInt()+"");
|
textPrivateLink.setId(Random.nextInt()+Random.nextInt()+"");
|
||||||
textPrivateLongLink.setId(Random.nextInt()+Random.nextInt()+"");
|
textPrivateLongLink.setId(Random.nextInt()+Random.nextInt()+"");
|
||||||
|
textPublicLink.setId(Random.nextInt()+Random.nextInt()+"");
|
||||||
textPublicLongLink.setId(Random.nextInt()+Random.nextInt()+"");
|
textPublicLongLink.setId(Random.nextInt()+Random.nextInt()+"");
|
||||||
|
|
||||||
modalBox.add(this);
|
modalBox.add(this);
|
||||||
|
@ -248,6 +252,7 @@ public class DialogShareableLink extends Composite {
|
||||||
textPublicLongLink.setText("Not available");
|
textPublicLongLink.setText("Not available");
|
||||||
showPublicLongLinkButton.setText("Not available");
|
showPublicLongLinkButton.setText("Not available");
|
||||||
showPublicLongLinkButton.addStyleName("href-disabled");
|
showPublicLongLinkButton.addStyleName("href-disabled");
|
||||||
|
publicLongLinkCopyButton.setEnabled(false);
|
||||||
// showPublicLongLinkButton.setVisible(false);
|
// showPublicLongLinkButton.setVisible(false);
|
||||||
disableTextBox(textPublicLongLink);
|
disableTextBox(textPublicLongLink);
|
||||||
}
|
}
|
||||||
|
@ -313,6 +318,34 @@ public class DialogShareableLink extends Composite {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
publicLinkCopyButton.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(ClickEvent event) {
|
||||||
|
final Element elem = event.getRelativeElement();
|
||||||
|
Tooltip.changeVisibility(elem, VisibilityChange.TOGGLE.get());
|
||||||
|
Timer timer = new Timer() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Tooltip.changeVisibility(elem, VisibilityChange.HIDE.get());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
timer.schedule(1000);
|
||||||
|
copyToClipboard(textPublicLink.getId());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
publicLinkCopyButton.addMouseOverHandler(new MouseOverHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onMouseOver(MouseOverEvent event) {
|
||||||
|
final Element elem = event.getRelativeElement();
|
||||||
|
elem.setTitle("Copy");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
publicLongLinkCopyButton.addClickHandler(new ClickHandler() {
|
publicLongLinkCopyButton.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -678,6 +711,7 @@ public class DialogShareableLink extends Composite {
|
||||||
// showPublicLongLinkButton.addStyleName("href-disabled");
|
// showPublicLongLinkButton.addStyleName("href-disabled");
|
||||||
showPublicLongLinkButton.setVisible(false);
|
showPublicLongLinkButton.setVisible(false);
|
||||||
textPublicLink.setText("You are not authorized");
|
textPublicLink.setText("You are not authorized");
|
||||||
|
publicLinkCopyButton.setEnabled(false);
|
||||||
disableTextBox(textPublicLink);
|
disableTextBox(textPublicLink);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -163,11 +163,16 @@
|
||||||
addStyleNames="my-prepend-width">
|
addStyleNames="my-prepend-width">
|
||||||
<b:TextBox ui:field="textPublicLink" readOnly="true">
|
<b:TextBox ui:field="textPublicLink" readOnly="true">
|
||||||
</b:TextBox>
|
</b:TextBox>
|
||||||
|
<b:Tooltip text='Copied to clipboard' trigger="MANUAL">
|
||||||
|
<b:Button icon="COPY"
|
||||||
|
ui:field="publicLinkCopyButton" type="PRIMARY"></b:Button>
|
||||||
|
</b:Tooltip>
|
||||||
</b:InputAddOn>
|
</b:InputAddOn>
|
||||||
<b:Button ui:field="showPublicLongLinkButton" type="LINK" addStyleNames="margin-left-5">Show as Long URL</b:Button>
|
<b:Button ui:field="showPublicLongLinkButton" type="LINK"
|
||||||
|
addStyleNames="margin-left-5">Show as Long URL</b:Button>
|
||||||
</b:Controls>
|
</b:Controls>
|
||||||
</b:ControlGroup>
|
</b:ControlGroup>
|
||||||
|
|
||||||
<b:ControlGroup addStyleNames="my-control-group"
|
<b:ControlGroup addStyleNames="my-control-group"
|
||||||
ui:field="cgPublicLongLink" visible="false">
|
ui:field="cgPublicLongLink" visible="false">
|
||||||
<b:ControlLabel></b:ControlLabel>
|
<b:ControlLabel></b:ControlLabel>
|
||||||
|
|
Loading…
Reference in New Issue