diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/Home.gwt.xml b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/Home.gwt.xml index 7f6b8a383dd..e8cbf3ce13f 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/Home.gwt.xml +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/Home.gwt.xml @@ -2,5 +2,6 @@ + diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/HomeBase.gwt.xml b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/HomeBase.gwt.xml index 222dead5057..65e9866b218 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/HomeBase.gwt.xml +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/HomeBase.gwt.xml @@ -22,7 +22,7 @@ - + @@ -38,10 +38,10 @@ - + - + diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/footer/Footer.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/footer/Footer.java index 61793f4f590..c3b5bfaf345 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/footer/Footer.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/footer/Footer.java @@ -22,6 +22,7 @@ import com.sap.sailing.gwt.home.shared.SwitchingEntryPoint; import com.sap.sailing.gwt.home.shared.app.PlaceNavigation; import com.sap.sailing.gwt.ui.client.StringMessages; import com.sap.sse.gwt.client.controls.languageselect.LanguageSelector; +import com.sap.sse.gwt.qualtrics.Qualtrics; import com.sap.sse.gwt.shared.ClientConfiguration; import com.sap.sse.gwt.shared.DebugConstants; @@ -32,7 +33,7 @@ public class Footer extends Composite { } @UiField AnchorElement whatsNewAnchor; - @UiField AnchorElement sapJobsAnchor; + @UiField AnchorElement supportAnchor; @UiField AnchorElement feedbackAnchor; @UiField LanguageSelector languageSelector; @UiField DivElement copyrightDiv; @@ -59,23 +60,29 @@ public class Footer extends Composite { } } }); - + Event.sinkEvents(feedbackAnchor, Event.ONCLICK); + Event.setEventListener(feedbackAnchor, event->{ + if (Event.ONCLICK == event.getTypeInt()) { + event.preventDefault(); + event.stopPropagation(); + Qualtrics.triggerIntercepts(); + } + }); if (!ClientConfiguration.getInstance().isBrandingActive()) { copyrightDiv.getStyle().setDisplay(NONE); languageSelector.setLabelText(StringMessages.INSTANCE.whitelabelFooterLanguage()); - sapJobsAnchor.getStyle().setDisplay(Display.NONE); + supportAnchor.getStyle().setDisplay(Display.NONE); feedbackAnchor.getStyle().setDisplay(Display.NONE); whatsNewAnchor.getStyle().setDisplay(Display.NONE); imprintAnchorLink.getStyle().setDisplay(Display.NONE); privacyAnchorLink.getStyle().setDisplay(Display.NONE); } copyrightDiv.setAttribute(DebugConstants.DEBUG_ID_ATTRIBUTE, "copyrightDiv"); - sapJobsAnchor.setAttribute(DEBUG_ID_ATTRIBUTE, "sapJobsAnchor"); + supportAnchor.setAttribute(DEBUG_ID_ATTRIBUTE, "feedbackAnchor"); feedbackAnchor.setAttribute(DEBUG_ID_ATTRIBUTE, "feedbackAnchor"); whatsNewAnchor.setAttribute(DEBUG_ID_ATTRIBUTE, "whatsNewAnchor"); imprintAnchorLink.setAttribute(DEBUG_ID_ATTRIBUTE, "imprintAnchorLink"); privacyAnchorLink.setAttribute(DEBUG_ID_ATTRIBUTE, "privacyAnchorLink"); languageSelector.getElement().setAttribute(DEBUG_ID_ATTRIBUTE, "languageSelector"); } - } diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/footer/Footer.ui.xml b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/footer/Footer.ui.xml index 214c3c2790c..5d4f6da2da0 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/footer/Footer.ui.xml +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/footer/Footer.ui.xml @@ -20,10 +20,10 @@ - - - - + + + + { + if (Event.ONCLICK == event.getTypeInt()) { + event.preventDefault(); + event.stopPropagation(); + Qualtrics.triggerIntercepts(); + } + }); if (!ClientConfiguration.getInstance().isBrandingActive()) { copyrightDiv.getStyle().setDisplay(NONE); languageSelector.setLabelText(StringMessages.INSTANCE.whitelabelFooterLanguage()); - sapJobsAnchor.getStyle().setDisplay(Display.NONE); + supportAnchor.getStyle().setDisplay(Display.NONE); feedbackAnchor.getStyle().setDisplay(Display.NONE); whatsNewLinkUi.getElement().getStyle().setDisplay(Display.NONE); imprintAnchorLink.getStyle().setDisplay(Display.NONE); @@ -74,5 +80,4 @@ public class Footer extends Composite { void onWhatsNew(ClickEvent e) { placeNavigator.getWhatsNewNavigation(WhatsNewPlace.WhatsNewNavigationTabs.SailingAnalytics).goToPlace(); } - } diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/footer/Footer.ui.xml b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/footer/Footer.ui.xml index cef813fba90..75156622dd3 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/footer/Footer.ui.xml +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/footer/Footer.ui.xml @@ -24,16 +24,14 @@ title="{i18n.footerPrivacy}"> - | - - -

- + + + + - | Desktop diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/footer/FooterResources.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/footer/FooterResources.java index 2bfb85990a4..e42e7afadff 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/footer/FooterResources.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/footer/FooterResources.java @@ -14,6 +14,5 @@ public interface FooterResources extends ClientBundle { String sitefooter(); String sitefooter_language(); String sitefooter_links(); - } } diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/SwitchingEntryPoint.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/SwitchingEntryPoint.java index 7b26afed818..db6527ca6d5 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/SwitchingEntryPoint.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/SwitchingEntryPoint.java @@ -49,10 +49,8 @@ public class SwitchingEntryPoint implements EntryPoint { public void onModuleLoad() { Document.get().getElementById("loading").removeFromParent(); LOG.info("Start switching entry point"); - SharedResources.INSTANCE.mediaCss().ensureInjected(); SharedResources.INSTANCE.mainCss().ensureInjected(); - String hash = Window.Location.getHash(); if (hash != null && hash.startsWith("#")) { hash = hash.substring(1); @@ -150,5 +148,4 @@ public class SwitchingEntryPoint implements EntryPoint { } }); } - } diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/regattaoverview/SourceRegattaOverview.gwt.xml b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/regattaoverview/SourceRegattaOverview.gwt.xml index e4d19b7f767..1fa10716683 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/regattaoverview/SourceRegattaOverview.gwt.xml +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/regattaoverview/SourceRegattaOverview.gwt.xml @@ -2,10 +2,6 @@ - - - - diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.java index fd30727f640..cf2f0a6121a 100755 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.java @@ -1709,6 +1709,7 @@ public interface StringMessages extends com.sap.sse.gwt.client.StringMessages, String footerLegal(); String footerPrivacy(); String footerFeedback(); + String footerSupport(); String headerLogo(); String headerSearchPlaceholder(); String mainEventShowAll(); diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.properties b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.properties index 3f43738511a..6282f110213 100755 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.properties +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.properties @@ -1712,6 +1712,7 @@ footerLanguage=SAP Sailing in footerLegal=Legal Disclosure footerPrivacy=Privacy footerFeedback=Feedback +footerSupport=Support headerLogo=Sailing Analytics headerSearchPlaceholder=Search mainEventShowAll=Show All Events diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages_de.properties b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages_de.properties index 7b249e5a36d..876c3fd3c85 100755 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages_de.properties +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages_de.properties @@ -1696,6 +1696,7 @@ footerLanguage=SAP Sailing in footerLegal=Impressum footerPrivacy=Datenschutz footerFeedback=Feedback +footerSupport=Support headerLogo=Sailing Analytics headerSearchPlaceholder=Suche mainEventShowAll=Zeige alle Veranstaltungen diff --git a/java/com.sap.sse.gwt/META-INF/MANIFEST.MF b/java/com.sap.sse.gwt/META-INF/MANIFEST.MF index 1b3bae5feba..2d1738c5868 100644 --- a/java/com.sap.sse.gwt/META-INF/MANIFEST.MF +++ b/java/com.sap.sse.gwt/META-INF/MANIFEST.MF @@ -68,6 +68,7 @@ Export-Package: com.google.gwt.user.client.rpc.core.java.util, com.sap.sse.gwt.dispatch.shared.commands, com.sap.sse.gwt.dispatch.shared.exceptions, com.sap.sse.gwt.linker, + com.sap.sse.gwt.qualtrics, com.sap.sse.gwt.resources, com.sap.sse.gwt.server, com.sap.sse.gwt.server.filestorage, diff --git a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/Qualtrics.gwt.xml b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/Qualtrics.gwt.xml new file mode 100755 index 00000000000..effb810c694 --- /dev/null +++ b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/Qualtrics.gwt.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/qualtrics/Qualtrics.java b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/qualtrics/Qualtrics.java new file mode 100755 index 00000000000..9e57d0275e2 --- /dev/null +++ b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/qualtrics/Qualtrics.java @@ -0,0 +1,45 @@ +package com.sap.sse.gwt.qualtrics; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.core.client.ScriptInjector; +import com.google.gwt.dom.client.DivElement; +import com.google.gwt.dom.client.Document; + +/** + * Convenience class to inject Qualtrics script content. To use a Qualtrics survey in your entry point, inherit the + * {@code com.sap.sse.gwt.Qualtrics} module which has an entry point that injects the script code needed. Then, + * if your Qualtrics "Intercept" is setup of for an explicit JavaScript trigger, establish + */ +public final class Qualtrics { + public static QualtricsRessource QUALTRICS_RESSOURCES = GWT.create(QualtricsRessource.class); + + private static boolean isInjected = false; + + protected Qualtrics() { + } + + /** + * inject minimal js required for Qualtrics survey + */ + public static void ensureInjected() { + if (!isInjected) { + ScriptInjector.fromString(QUALTRICS_RESSOURCES.qualtricsLoadingCode().getText()).setWindow(ScriptInjector.TOP_WINDOW).inject(); + // Now produce the following div: + //
+ final DivElement div = Document.get().createDivElement(); + div.setId("ZN_7WmsxxHQyCeUivX"); + div.setInnerHTML(""); + isInjected = true; + } + } + + /** + * Use this, e.g., in your "onclick" handler for your anchor, link or button to trigger the Qualtrics Intercepts + * loaded for your page that are configured for explicit JavaScript invocation. + */ + public static native void triggerIntercepts() /*-{ + $wnd.QSI.API.unload(); + $wnd.QSI.API.load(); + $wnd.QSI.API.run(); + }-*/; +} diff --git a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/qualtrics/QualtricsInjectingEntryPoint.java b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/qualtrics/QualtricsInjectingEntryPoint.java new file mode 100755 index 00000000000..cc65772ee56 --- /dev/null +++ b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/qualtrics/QualtricsInjectingEntryPoint.java @@ -0,0 +1,12 @@ +package com.sap.sse.gwt.qualtrics; + +import com.google.gwt.core.client.EntryPoint; +import com.google.gwt.core.client.GWT; + +public class QualtricsInjectingEntryPoint implements EntryPoint { + @Override + public void onModuleLoad() { + GWT.log("Inject Qualtrics"); + Qualtrics.ensureInjected(); + } +} diff --git a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/qualtrics/QualtricsRessource.java b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/qualtrics/QualtricsRessource.java new file mode 100755 index 00000000000..7a48fb47f20 --- /dev/null +++ b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/qualtrics/QualtricsRessource.java @@ -0,0 +1,9 @@ +package com.sap.sse.gwt.qualtrics; + +import com.google.gwt.resources.client.ClientBundle; +import com.google.gwt.resources.client.TextResource; + +public interface QualtricsRessource extends ClientBundle { + @Source("resources/qualtrics.js") + TextResource qualtricsLoadingCode(); +} diff --git a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/qualtrics/resources/qualtrics.js b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/qualtrics/resources/qualtrics.js new file mode 100755 index 00000000000..e30f1df53b6 --- /dev/null +++ b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/qualtrics/resources/qualtrics.js @@ -0,0 +1,9 @@ +/* BEGIN QUALTRICS WEBSITE FEEDBACK SNIPPET */ +(function(){var g=function(e,h,f,g){ +this.get=function(a){for(var a=a+"=",c=document.cookie.split(";"),b=0,e=c.length;b=e/100?0:100),a=[h,e,0],this.set(f,a.join(":"));else return!0;var c=a[1];if(100==c)return!0;switch(a[0]){case "v":return!1;case "r":return c=a[2]%Math.floor(100/c),a[2]++,this.set(f,a.join(":")),!c}return!0}; +this.go=function(){if(this.check()){var a=document.createElement("script");a.type="text/javascript";a.src=g;document.body&&document.body.appendChild(a)}}; +this.start=function(){var t=this;"complete"!==document.readyState?window.addEventListener?window.addEventListener("load",function(){t.go()},!1):window.attachEvent&&window.attachEvent("onload",function(){t.go()}):t.go()};}; +try{(new g(100,"r","QSI_S_ZN_7WmsxxHQyCeUivX","https://zn7wmsxxhqyceuivx-sapdemo.siteintercept.qualtrics.com/SIE/?Q_ZID=ZN_7WmsxxHQyCeUivX")).start()}catch(i){}})(); +/* END WEBSITE FEEDBACK SNIPPET */ \ No newline at end of file diff --git a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/resources/Highcharts.java b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/resources/Highcharts.java index d9e342a4809..80220006ad8 100644 --- a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/resources/Highcharts.java +++ b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/resources/Highcharts.java @@ -4,7 +4,7 @@ import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.ScriptInjector; /** - * Convinience class to inject common control css content + * Convenience class to inject common control css content * * @author pgtaboada *