- if (para.getType() == ParagraphType.IMAGE) {
- String zoomStyle = "max-width: 100%;";
- disabledZoomWidth = " disabled='disabled'";
- String zoomOption = cookies.get("zoom");
- if (zoomOption != null && !zoomOption.isEmpty()) {
- if (zoomOption.equals("real")) {
- zoomStyle = "";
- disabledZoomWidth = "";
- disabledZoomReal = " disabled='disabled'";
- } else if (zoomOption.equals("width")) {
- zoomStyle = "max-width: 100%;";
- } else if (zoomOption.equals("height")) {
- // see height of navbar + optionbar
- zoomStyle = "max-height: calc(100% - 128px);";
- disabledZoomWidth = "";
- disabledZoomHeight = " disabled='disabled'";
- }
- }
- content = String.format("" //
- + "<a class='viewer link' href='%s'>" //
- + "<img class='viewer img' style='%s' src='%s'/>"
- + "</a>", //
- next, //
- zoomStyle, //
- getStoryUrl(luid, chapter, paragraph));
- } else {
- content = para.getContent();
+ String javascript = "document.getElementById(\"previous\").click(); return false;";
+ content.append(String.format("" //
+ + "<a class='viewer link' oncontextmenu='%s' href='%s'>"
+ + "<img class='viewer img' style='%s' src='%s'/>"
+ + "</a>", //
+ javascript, //
+ next, //
+ zoomStyle, //
+ getStoryUrl(luid, chapter, paragraph)));
+ } else {
+ content.append(String.format("" //
+ + "<div class='viewer text'>%s</div>", //
+ para.getContent()));
+ }
+ }
+
+ builder.append(String.format("" //
+ + "<div class='bar navbar'>\n" //
+ + "\t<a%s class='button first' href='%s'><<</a>\n"//
+ + "\t<a%s id='previous' class='button previous' href='%s'><</a>\n" //
+ + "\t<div class='gotobox itemsbox'>\n" //
+ + "\t\t<div class='button goto'>%d</div>\n" //
+ + "\t\t<div class='items goto'>\n", //
+ disabledLeft, first, //
+ disabledLeft, previous, //
+ paragraph > 0 ? paragraph : chapter //
+ ));
+
+ // List of chap/para links
+
+ appendItemA(builder, 3, getViewUrl(luid, 0, null), "Description",
+ paragraph == 0 && chapter == 0);
+ if (paragraph > 0) {
+ for (int i = 1; i <= chap.getParagraphs().size(); i++) {
+ appendItemA(builder, 3, getViewUrl(luid, chapter, i),
+ "Image " + i, paragraph == i);
+ }
+ } else {
+ int i = 1;
+ for (Chapter c : story.getChapters()) {
+ String chapName = "Chapter " + c.getNumber();
+ if (c.getName() != null && !c.getName().isEmpty()) {
+ chapName += ": " + c.getName();