\n" //
- + "\t\t\t\t
%d
\n" //
- + "\t\t\t\t
\n", //
- disabledLeft, first, //
- disabledLeft, previous, //
- paragraph > 0 ? paragraph : chapter //
- ));
-
// List of chap/para links
-
- appendItemA(builder, 5, WebLibraryUrls.getViewUrl(luid, 0, null),
- "Description", paragraph == 0 && chapter == 0);
+ StringBuilder links = new StringBuilder();
+ links.append(getTemplate("viewer.link") //
+ .replace("${link}",
+ WebLibraryUrls.getViewUrl(luid, 0, null)) //
+ .replace("${class}",
+ paragraph == 0 && chapter == 0 ? "selected" : "") //
+ .replace("${name}", "Description") //
+ );
if (paragraph > 0) {
for (int i = 1; i <= chap.getParagraphs().size(); i++) {
- appendItemA(builder, 5,
- WebLibraryUrls.getViewUrl(luid, chapter, i),
- "Image " + i, paragraph == i);
+ links.append(getTemplate("viewer.link") //
+ .replace("${link}",
+ WebLibraryUrls.getViewUrl(luid, chapter, i)) //
+ .replace("${class}",
+ paragraph == i ? "selected" : "") //
+ .replace("${name}", "Image " + i) //
+ );
}
} else {
int i = 1;
@@ -741,52 +734,79 @@ abstract class WebLibraryServerHtml implements Runnable {
chapName += ": " + c.getName();
}
- appendItemA(builder, 5,
- WebLibraryUrls.getViewUrl(luid, i, null), chapName,
- chapter == i);
+ links.append(getTemplate("viewer.link") //
+ .replace("${link}",
+ WebLibraryUrls.getViewUrl(luid, i, null)) //
+ .replace("${class}", chapter == i ? "selected" : "") //
+ .replace("${name}", chapName) //
+ );
i++;
}
}
- builder.append(String.format("" //
- + "\t\t\t\t
\n" //
- + "\t\t\t