reduced style errors

This commit is contained in:
Kai Boernert committed 2017-03-20 11:18:23 +01:00
1 parent 9fed845f7d
commit 4b3a078e38
7 files changed
+50 -30

No files matched your search

@@ -56,7 +56,7 @@
class="{local_res.css.sitefooter_links_link} {res.mediaCss.showonsmall} {res.mediaCss.hideonmedium} {res.mediaCss.hideonlarge}">
Mobile
</a>
<a href="{releaseNotesNavigation.getTargetUrl}" class="{local_res.css.sitefooter_links_link}">
<a href="{releaseNotesNavigation.getSafeTargetUrl}" class="{local_res.css.sitefooter_links_link}">
<ui:text from='{i18n.whatsNew}' />
</a>
</div>
@@ -9,6 +9,8 @@ import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.safehtml.client.SafeHtmlTemplates;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.safehtml.shared.SafeUri;
import com.google.gwt.safehtml.shared.UriUtils;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.PopupPanel.PositionCallback;
@@ -30,7 +32,7 @@ public class RaceviewerLaunchPadCell<T extends RaceMetadataDTO<?>> extends Abstr
SafeHtml raceviewerLaunchPad(String styleNames, String iconStyleNames, String text);
@Template("<a href=\"{4}\" target=\"_blank\" class=\"{0}\"><div>{2}</div><div class=\"{1}\"><img src=\"images/home/{3}.svg\"/></div></a> ")
SafeHtml standaloneButton(String styleNames, String iconStyleNames, String text, String icon, String link);
SafeHtml standaloneButton(String styleNames, String iconStyleNames, String text, String icon, SafeUri safeUri);
}
private static final CellTemplates TEMPLATE = GWT.create(CellTemplates.class);
@@ -81,7 +83,8 @@ public class RaceviewerLaunchPadCell<T extends RaceMetadataDTO<?>> extends Abstr
if (data.hasValidTrackingData()) {
if (renderAsDirectLinkButton(data)) {
sb.append(TEMPLATE.standaloneButton(plannedStyleNames, iconStyleNames, I18N.watchLive(),
"launch-play", presenter.getRaceViewerURL(data, RaceBoardModes.PLAYER.name())));
"launch-play",
UriUtils.fromString(presenter.getRaceViewerURL(data, RaceBoardModes.PLAYER.name()))));
} else {
String styleNames = data.isFinished() ? analyzeStyleNames : liveStyleNames;
sb.append(TEMPLATE.raceviewerLaunchPad(styleNames, iconStyleNames, I18N.raceDetailsToShow()));
@@ -4,6 +4,8 @@ import com.google.gwt.dom.client.AnchorElement;
import com.google.gwt.http.client.UrlBuilder;
import com.google.gwt.place.shared.Place;
import com.google.gwt.place.shared.PlaceHistoryMapper;
import com.google.gwt.safehtml.shared.SafeUri;
import com.google.gwt.safehtml.shared.UriUtils;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.EventListener;
@@ -41,6 +43,10 @@ public class PlaceNavigation<T extends Place> {
return buildPlaceUrl();
}
public SafeUri getSafeTargetUrl() {
return UriUtils.fromString(getTargetUrl());
}
public String getHistoryUrl() {
String placeUrl = buildPlaceUrl();
if (placeUrl.startsWith("#")) {
@@ -1,5 +1,3 @@
@CHARSET "ISO-8859-1";
.cellTableWidget {
margin: 0;
table-layout: auto;
@@ -17,6 +17,8 @@ import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat;
import com.google.gwt.safehtml.client.SafeHtmlTemplates;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.safehtml.shared.SafeUri;
import com.google.gwt.safehtml.shared.UriUtils;
import com.google.gwt.user.cellview.client.CellTable;
import com.google.gwt.user.cellview.client.Column;
import com.google.gwt.user.cellview.client.ColumnSortEvent;
@@ -61,7 +63,7 @@ public class LeaderboardGroupOverviewPanel extends FormPanel {
interface AnchorTemplates extends SafeHtmlTemplates {
@SafeHtmlTemplates.Template("<a href=\"{0}\">{1}</a>")
SafeHtml anchor(String url, String displayName);
SafeHtml anchor(SafeUri url, String displayName);
}
public static final String STYLE_NAME_PREFIX = "groupOverviewPanel-";
@@ -233,7 +235,7 @@ public class LeaderboardGroupOverviewPanel extends FormPanel {
(showRaceDetails ? "showRaceDetails=true&" : "") +
"leaderboardGroupName=" + group.getName() + "&root=overview"
+ (debugParam != null && !debugParam.isEmpty() ? "&gwt.codesvr=" + debugParam : ""));
return ANCHORTEMPLATE.anchor(link, group.getName());
return ANCHORTEMPLATE.anchor(UriUtils.fromString(link), group.getName());
}
};
groupsNameColumn.setSortable(true);
@@ -362,7 +364,7 @@ public class LeaderboardGroupOverviewPanel extends FormPanel {
+ (showRaceDetails ? "&showRaceDetails=true" : "")
+ "&leaderboardGroupName=" + selectedGroup.getName() + "&root=overview"
+ (debugParam != null && !debugParam.isEmpty() ? "&gwt.codesvr=" + debugParam : ""));
return ANCHORTEMPLATE.anchor(link, leaderboard.name);
return ANCHORTEMPLATE.anchor(UriUtils.fromString(link), leaderboard.name);
}
};
@@ -456,7 +458,7 @@ public class LeaderboardGroupOverviewPanel extends FormPanel {
+ raceId.getRegattaName() + "&leaderboardGroupName=" + selectedGroup.getName()
+ "&root=overview"
+ (debugParam != null && !debugParam.isEmpty() ? "&gwt.codesvr=" + debugParam : ""));
name = ANCHORTEMPLATE.anchor(link, raceDisplayName);
name = ANCHORTEMPLATE.anchor(UriUtils.fromString(link), raceDisplayName);
} else {
name = new SafeHtmlBuilder().appendHtmlConstant(raceDisplayName).toSafeHtml();
}
@@ -8,9 +8,13 @@ import java.util.Map;
import com.google.gwt.cell.client.SafeHtmlCell;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Style.FontWeight;
import com.google.gwt.safecss.shared.SafeStyles;
import com.google.gwt.safecss.shared.SafeStylesUtils;
import com.google.gwt.safehtml.client.SafeHtmlTemplates;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.safehtml.shared.SafeUri;
import com.google.gwt.safehtml.shared.UriUtils;
import com.google.gwt.user.cellview.client.CellTable;
import com.google.gwt.user.cellview.client.Column;
import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -54,26 +58,26 @@ public class LeaderboardGroupPanel extends SimplePanel implements HasWelcomeWidg
interface AnchorTemplates extends SafeHtmlTemplates {
@SafeHtmlTemplates.Template("<a class=\"{2}\" href=\"{0}\">{1}</a>")
SafeHtml anchor(String url, String displayName, String styleClass);
SafeHtml anchor(SafeUri url, String displayName, SafeStyles styleClass);
@SafeHtmlTemplates.Template("<a target=\"{3}\" class=\"{2}\" href=\"{0}\">{1}</a>")
SafeHtml anchorWithTarget(String url, String displayName, String styleClass, String target);
SafeHtml anchorWithTarget(SafeUri url, String displayName, SafeStyles styleClass, String target);
}
interface TextWithClassTemplate extends SafeHtmlTemplates {
@SafeHtmlTemplates.Template("<div class=\"{1}\">{0}</div>")
SafeHtml textWithClass(String text, String styleClass);
SafeHtml textWithClass(String text, SafeStyles styleClass);
@SafeHtmlTemplates.Template("<div class=\"{2}\" style=\"min-width:{1}px;\">{0}</div>")
SafeHtml textWithClass(String text, int widthInPx, String styleClass);
SafeHtml textWithClass(String text, int widthInPx, SafeStyles styleClass);
}
interface ColorBoxTemplate extends SafeHtmlTemplates {
@SafeHtmlTemplates.Template("<div class=\"{1}\" style=\"background:{0};\">&nbsp;</div>")
SafeHtml colorBox(String htmlColor, String styleClass);
SafeHtml colorBox(String htmlColor, SafeStyles styleClass);
@SafeHtmlTemplates.Template("<div class=\"{0}\">&nbsp;</div>")
SafeHtml nocolorBox(String styleClass);
SafeHtml nocolorBox(SafeStyles styleClass);
}
private static final AnchorTemplates ANCHORTEMPLATE = GWT.create(AnchorTemplates.class);
@@ -221,7 +225,7 @@ public class LeaderboardGroupPanel extends SimplePanel implements HasWelcomeWidg
public SafeHtml getValue(StrippedLeaderboardDTO strippedLeaderboardDTO) {
String text = strippedLeaderboardDTO.displayName != null ? strippedLeaderboardDTO.displayName : strippedLeaderboardDTO.name;
SafeHtmlBuilder b = new SafeHtmlBuilder();
b.append(TEXTTEMPLATE.textWithClass(text, STYLE_BOATCLASS));
b.append(TEXTTEMPLATE.textWithClass(text, SafeStylesUtils.fromTrustedString(STYLE_BOATCLASS)));
return b.toSafeHtml();
}
};
@@ -232,7 +236,8 @@ public class LeaderboardGroupPanel extends SimplePanel implements HasWelcomeWidg
@Override
public SafeHtml getValue(StrippedLeaderboardDTO leaderboard) {
String link = EntryPointLinkFactory.createLeaderboardLink(createLeaderboardLinkParameters(leaderboard));
return getAnchor(link, stringMessages.leaderboard(), STYLE_ACTIVE_LEADERBOARD);
return getAnchor(link, stringMessages.leaderboard(),
SafeStylesUtils.fromTrustedString(STYLE_ACTIVE_LEADERBOARD));
}
};
@@ -331,7 +336,8 @@ public class LeaderboardGroupPanel extends SimplePanel implements HasWelcomeWidg
for (SeriesDTO series : regatta.series) {
// render the series name
if (!LeaderboardNameConstants.DEFAULT_SERIES_NAME.equals(series.getName())) {
seriesGrid.setHTML(seriesRow, 0, TEXTTEMPLATE.textWithClass(series.getName(), 50, STYLE_TABLE_TEXT));
seriesGrid.setHTML(seriesRow, 0, TEXTTEMPLATE.textWithClass(series.getName(), 50,
SafeStylesUtils.fromTrustedString(STYLE_TABLE_TEXT)));
}
seriesGridFormatter.setVerticalAlignment(seriesRow, 0, HasVerticalAlignment.ALIGN_MIDDLE);
int numberOfFleets = series.getFleets().size();
@@ -343,10 +349,12 @@ public class LeaderboardGroupPanel extends SimplePanel implements HasWelcomeWidg
for(FleetDTO fleet: series.getFleets()) {
Color color = fleet.getColor();
if(color != null) {
fleetsGrid.setHTML(fleetRow, 0, COLORBOXTEMPLATE.colorBox(color.getAsHtml(), STYLE_COLORBOX));
fleetsGrid.setHTML(fleetRow, 0, COLORBOXTEMPLATE.colorBox(color.getAsHtml(),
SafeStylesUtils.fromTrustedString(STYLE_COLORBOX)));
fleetGridsFormatter.setVerticalAlignment(fleetRow, 0, HasVerticalAlignment.ALIGN_MIDDLE);
}
fleetsGrid.setHTML(fleetRow, 1, TEXTTEMPLATE.textWithClass(fleet.getName(), 50, STYLE_TABLE_TEXT));
fleetsGrid.setHTML(fleetRow, 1, TEXTTEMPLATE.textWithClass(fleet.getName(), 50,
SafeStylesUtils.fromTrustedString(STYLE_TABLE_TEXT)));
fleetGridsFormatter.setVerticalAlignment(fleetRow, 1, HasVerticalAlignment.ALIGN_MIDDLE);
List<RaceColumnDTO> raceColumnsOfSeries = getRacesOfFleet(leaderboard, series, fleet);
fleetsGrid.setHTML(fleetRow, 2, renderRacesToHTml(leaderboard.name, raceColumnsOfSeries, fleet));
@@ -361,7 +369,8 @@ public class LeaderboardGroupPanel extends SimplePanel implements HasWelcomeWidg
if (!LeaderboardNameConstants.DEFAULT_FLEET_NAME.equals(fleet.getName())) {
Grid fleetsGrid = new Grid(1, 2);
CellFormatter fleetGridsFormatter = fleetsGrid.getCellFormatter();
fleetsGrid.setHTML(0, 0, TEXTTEMPLATE.textWithClass(displayName, 50, STYLE_TABLE_TEXT));
fleetsGrid.setHTML(0, 0, TEXTTEMPLATE.textWithClass(displayName, 50,
SafeStylesUtils.fromTrustedString(STYLE_TABLE_TEXT)));
fleetGridsFormatter.setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_MIDDLE);
fleetsGrid.setHTML(0, 1, renderRacesToHTml(leaderboard.name, raceColumnsOfSeries, fleet));
seriesGrid.setWidget(seriesRow, 1, fleetsGrid);
@@ -409,14 +418,16 @@ public class LeaderboardGroupPanel extends SimplePanel implements HasWelcomeWidg
RegattaAndRaceIdentifier raceIdentifier = race.getRaceIdentifier();
String link = EntryPointLinkFactory.createRaceBoardLink(createRaceBoardLinkParameters(leaderboardName, raceIdentifier));
if (isLive) {
b.append(getAnchor(link, raceColumnName, STYLE_LIVE_RACE));
b.append(getAnchor(link, raceColumnName, SafeStylesUtils.fromTrustedString(STYLE_LIVE_RACE)));
} else if (race.trackedRace.hasGPSData && race.trackedRace.hasWindData) {
b.append(getAnchor(link, raceColumnName, STYLE_ACTIVE_RACE));
b.append(getAnchor(link, raceColumnName, SafeStylesUtils.fromTrustedString(STYLE_ACTIVE_RACE)));
} else {
b.append(TEXTTEMPLATE.textWithClass(raceColumnName, STYLE_INACTIVE_RACE));
b.append(TEXTTEMPLATE.textWithClass(raceColumnName,
SafeStylesUtils.fromTrustedString(STYLE_INACTIVE_RACE)));
}
} else {
b.append(TEXTTEMPLATE.textWithClass(raceColumnName, STYLE_INACTIVE_RACE));
b.append(
TEXTTEMPLATE.textWithClass(raceColumnName, SafeStylesUtils.fromTrustedString(STYLE_INACTIVE_RACE)));
}
}
@@ -440,11 +451,11 @@ public class LeaderboardGroupPanel extends SimplePanel implements HasWelcomeWidg
return linkParams;
}
private SafeHtml getAnchor(String link, String linkText, String style) {
private SafeHtml getAnchor(String link, String linkText, SafeStyles style) {
if (isEmbedded) {
return ANCHORTEMPLATE.anchorWithTarget(link, linkText, style, "_blank");
return ANCHORTEMPLATE.anchorWithTarget(UriUtils.fromString(link), linkText, style, "_blank");
} else {
return ANCHORTEMPLATE.anchor(link, linkText, style);
return ANCHORTEMPLATE.anchor(UriUtils.fromString(link), linkText, style);
}
}
@@ -23,7 +23,7 @@ body {
background-color: #333333;
border-bottom: 4px solid #f0ab00;
color: white;
position: relative
position: relative;
}
.registrationform_header_appname {
@@ -32,7 +32,7 @@ body {
margin: 0;
position: absolute;
top: 50%;
transform: translate(0, -50%)
transform: translate(0, -50%);
}
.registrationform_content {