From 62c44dd77e47c908361a87332182f2e2465972c0 Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Fri, 13 Jan 2017 17:07:36 +0200 Subject: Support for HTML5 push/replaceState for proper deep linking features (#8116) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added support for HTML5 push/replaceState for proper deep linkin features * Automated test script now works at least on chrome * Uses html5 push/popstate to implement uri fragment feature * fire legacy fragment change events also via popstate events rpc calls * send new fragments via pushstate mechanism * formatting * Formatting and adding test and workaround for IE bug * Formatting and depracated UriFragmentListener * Aligned naming in the new API * Ignored IE due to web driver bug Tested a workaround with javascript based window.location.href fetch, but that don’t seem to work stable enough. --- shared/src/main/java/com/vaadin/shared/ui/ui/UIConstants.java | 5 ++++- shared/src/main/java/com/vaadin/shared/ui/ui/UIServerRpc.java | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'shared/src') diff --git a/shared/src/main/java/com/vaadin/shared/ui/ui/UIConstants.java b/shared/src/main/java/com/vaadin/shared/ui/ui/UIConstants.java index 17d28cb5eb..086164e750 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/ui/UIConstants.java +++ b/shared/src/main/java/com/vaadin/shared/ui/ui/UIConstants.java @@ -28,7 +28,10 @@ public class UIConstants implements Serializable { public static final String NOTIFICATION_HTML_CONTENT_NOT_ALLOWED = "useplain"; @Deprecated - public static final String LOCATION_VARIABLE = "location"; + public static final String ATTRIBUTE_PUSH_STATE = "ps"; + + @Deprecated + public static final String ATTRIBUTE_REPLACE_STATE = "rs"; @Deprecated public static final String ATTRIBUTE_NOTIFICATION_STYLE = "style"; diff --git a/shared/src/main/java/com/vaadin/shared/ui/ui/UIServerRpc.java b/shared/src/main/java/com/vaadin/shared/ui/ui/UIServerRpc.java index e6c7beb3e7..15391dc023 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/ui/UIServerRpc.java +++ b/shared/src/main/java/com/vaadin/shared/ui/ui/UIServerRpc.java @@ -35,6 +35,8 @@ public interface UIServerRpc extends ClickRpc, ServerRpc { * should always be called to ensure the message is flushed right away. */ public void poll(); + + public void popstate(String uri); @NoLoadingIndicator public void acknowledge(); -- cgit v1.2.3