diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/GroupTable.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/GroupTable.java index 76a0cfb23a..de840813b6 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/GroupTable.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/GroupTable.java @@ -29,6 +29,7 @@ import com.google.gerrit.common.PageLinks; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.user.client.History; +import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.Anchor; import com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter; import com.google.gwt.user.client.ui.HTMLTable.Cell; @@ -77,7 +78,12 @@ public class GroupTable extends NavigationTable { @Override protected void onOpenRow(final int row) { - History.newItem(Dispatcher.toGroup(getRowItem(row).getGroupId())); + GroupInfo groupInfo = getRowItem(row); + if (isInteralGroup(groupInfo)) { + History.newItem(Dispatcher.toGroup(groupInfo.getGroupId())); + } else if (groupInfo.url() != null) { + Window.open(groupInfo.url(), "_self", null); + } } public void display(GroupMap groups, String toHighlight) { @@ -108,7 +114,7 @@ public class GroupTable extends NavigationTable { void populate(final int row, final GroupInfo k, final String toHighlight) { if (k.url() != null) { - if (k.url().startsWith("#" + PageLinks.ADMIN_GROUPS)) { + if (isInteralGroup(k)) { table.setWidget(row, 1, new HighlightingInlineHyperlink(k.name(), Dispatcher.toGroup(k.getGroupId()), toHighlight)); } else { @@ -133,4 +139,9 @@ public class GroupTable extends NavigationTable { setRowItem(row, k); } + + private boolean isInteralGroup(final GroupInfo groupInfo) { + return groupInfo != null + && groupInfo.url().startsWith("#" + PageLinks.ADMIN_GROUPS); + } } diff --git a/gerrit-prettify/src/main/java/com/google/gerrit/prettify/client/ClientSideFormatter.java b/gerrit-prettify/src/main/java/com/google/gerrit/prettify/client/ClientSideFormatter.java index 9f76a4730e..8e7c699159 100644 --- a/gerrit-prettify/src/main/java/com/google/gerrit/prettify/client/ClientSideFormatter.java +++ b/gerrit-prettify/src/main/java/com/google/gerrit/prettify/client/ClientSideFormatter.java @@ -60,13 +60,12 @@ public class ClientSideFormatter extends PrettyFormatter { @Override protected String prettify(String html, String type) { - return go(prettify.getContext(), html, type, diffPrefs.getTabSize()); + return go(prettify.getContext(), html, type); } private static native String go(JavaScriptObject ctx, String srcText, - String srcType, int tabSize) + String srcType) /*-{ - ctx.PR_TAB_WIDTH = tabSize; return ctx.prettyPrintOne(srcText, srcType); }-*/; } diff --git a/gerrit-prettify/src/main/java/com/google/gerrit/prettify/client/PrettyFormatter.java b/gerrit-prettify/src/main/java/com/google/gerrit/prettify/client/PrettyFormatter.java index d9d43a83f3..a84af5ee02 100644 --- a/gerrit-prettify/src/main/java/com/google/gerrit/prettify/client/PrettyFormatter.java +++ b/gerrit-prettify/src/main/java/com/google/gerrit/prettify/client/PrettyFormatter.java @@ -129,6 +129,7 @@ public abstract class PrettyFormatter implements SparseHtmlFile { String html = toHTML(src); + html = expandTabs(html); if (diffPrefs.isSyntaxHighlighting() && getFileType() != null && src.isWholeFile()) { // The prettify parsers don't like ' as an entity for the @@ -149,8 +150,6 @@ public abstract class PrettyFormatter implements SparseHtmlFile { html = html.replaceAll("(\r)?\n", " $1\n"); html = prettify(html, getFileType()); html = html.replaceAll(" (\r)?\n", "$1\n"); - } else { - html = expandTabs(html); } int pos = 0; diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/project/DashboardsCollection.java b/gerrit-server/src/main/java/com/google/gerrit/server/project/DashboardsCollection.java index a50e71c0fd..6e5ef65464 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/project/DashboardsCollection.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/DashboardsCollection.java @@ -160,7 +160,8 @@ class DashboardsCollection implements DashboardInfo info = new DashboardInfo(refName, path); info.project = project; info.definingProject = definingProject.getName(); - info.title = replace(project, config.getString("dashboard", null, "title")); + String query = config.getString("dashboard", null, "title"); + info.title = replace(project, query == null ? info.path : query); info.description = replace(project, config.getString("dashboard", null, "description")); info.foreach = config.getString("dashboard", null, "foreach");