Skip to content

Commit 675256a

Browse files
author
svuillet
committed
add share link to clipboard
1 parent ee091f0 commit 675256a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

mobile-war/src/main/java/org/silverpeas/mobile/client/apps/documents/DocumentsApp.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import org.silverpeas.mobile.client.apps.navigation.events.app.external.NavigationEventHandler;
4747
import org.silverpeas.mobile.client.apps.navigation.events.app.external.NavigationShowContentEvent;
4848
import org.silverpeas.mobile.client.common.EventBus;
49+
import org.silverpeas.mobile.client.common.Html5Utils;
4950
import org.silverpeas.mobile.client.common.Notification;
5051
import org.silverpeas.mobile.client.common.ServicesLocator;
5152
import org.silverpeas.mobile.client.common.app.App;
@@ -322,6 +323,7 @@ public void attempt() {
322323
public void onSuccess(Method method, TicketDTO dto) {
323324
super.onSuccess(method, dto);
324325
Snackbar.showWithCloseButton(dto.getUrl(), Snackbar.INFO);
326+
Html5Utils.copyInClipboard(dto.getUrl());
325327
}
326328
};
327329
action.attempt();

mobile-war/src/main/java/org/silverpeas/mobile/client/common/Html5Utils.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,4 +224,8 @@ public static native void share(String title, String text, String url) /*-{
224224
$wnd.navigator.share(shareData);
225225
}-*/;
226226

227+
public static native void copyInClipboard(String text) /*-{
228+
$wnd.navigator.clipboard.writeText(text);
229+
}-*/;
230+
227231
}

0 commit comments

Comments
 (0)