I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit a975dc44 authored by zzz's avatar zzz
Browse files

Summary bar: linkify news headings, remove 'show news' link

parent b875e284
No related branches found
No related tags found
No related merge requests found
...@@ -607,6 +607,7 @@ public class SummaryBarRenderer { ...@@ -607,6 +607,7 @@ public class SummaryBarRenderer {
if (newsContent != "") { if (newsContent != "") {
buf.append("<ul>\n"); buf.append("<ul>\n");
// Parse news content for headings. // Parse news content for headings.
boolean foundEntry = false;
int start = newsContent.indexOf("<h3>"); int start = newsContent.indexOf("<h3>");
while (start >= 0) { while (start >= 0) {
// Add offset to start: // Add offset to start:
...@@ -622,16 +623,19 @@ public class SummaryBarRenderer { ...@@ -622,16 +623,19 @@ public class SummaryBarRenderer {
int end = newsContent.indexOf("</h3>"); int end = newsContent.indexOf("</h3>");
if (end >= 0) { if (end >= 0) {
String heading = newsContent.substring(0, end); String heading = newsContent.substring(0, end);
buf.append("<li>") buf.append("<li><a href=\"/?news=1&amp;consoleNonce=")
.append(consoleNonce)
.append("\">")
.append(heading) .append(heading)
.append("</li>\n"); .append("</a></li>\n");
foundEntry = true;
} }
start = newsContent.indexOf("<h3>"); start = newsContent.indexOf("<h3>");
} }
buf.append("</ul>\n"); buf.append("</ul>\n");
// Set up string containing <a> to show news. // Set up string containing <a> to show news.
String requestURI = _helper.getRequestURI(); String requestURI = _helper.getRequestURI();
if (requestURI.contains("/home")) { if (requestURI.contains("/home") && !foundEntry) {
buf.append("<a href=\"/?news=1&amp;consoleNonce=") buf.append("<a href=\"/?news=1&amp;consoleNonce=")
.append(consoleNonce) .append(consoleNonce)
.append("\">") .append("\">")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment