From: Niki Roo Date: Thu, 21 May 2020 08:35:14 +0000 (+0200) Subject: weblib: do not allow click on last image X-Git-Url: http://git.nikiroo.be/?p=fanfix.git;a=commitdiff_plain;h=b8b60b3217e62f1896cc3a57763bddd147474695 weblib: do not allow click on last image --- diff --git a/src/be/nikiroo/fanfix/library/WebLibraryServerHtml.java b/src/be/nikiroo/fanfix/library/WebLibraryServerHtml.java index 5310c7c..524fea3 100644 --- a/src/be/nikiroo/fanfix/library/WebLibraryServerHtml.java +++ b/src/be/nikiroo/fanfix/library/WebLibraryServerHtml.java @@ -648,8 +648,10 @@ abstract class WebLibraryServerHtml implements Runnable { } viewerItem = templates.viewerImage(WebLibraryUrls - .getStoryUrl(luid, chapter, paragraph), next, - zoomStyle); + .getStoryUrl(luid, chapter, paragraph), // + disabledRight ? null : next, // + zoomStyle // + ); } else { viewerItem = templates.viewerText(null, new TextOutput(false).convert(para)); diff --git a/src/be/nikiroo/fanfix/library/web/templates/WebLibraryServerTemplates.java b/src/be/nikiroo/fanfix/library/web/templates/WebLibraryServerTemplates.java index 59e7020..cdc936a 100644 --- a/src/be/nikiroo/fanfix/library/web/templates/WebLibraryServerTemplates.java +++ b/src/be/nikiroo/fanfix/library/web/templates/WebLibraryServerTemplates.java @@ -137,11 +137,13 @@ public class WebLibraryServerTemplates { ; } + // href NULL means no forward link public Template viewerImage(String src, String href, String zoomStyle) { - return new Template(getClass(), "viewer.image.html") // - .set("src", src) // - .set("href", href) // - .set("zoomStyle", zoomStyle) // + return new Template(getClass(), + href == null ? "viewer.image.nolink.html" : "viewer.image.html") // + .set("src", src) // + .set("href", href) // + .set("zoomStyle", zoomStyle) // ; } diff --git a/src/be/nikiroo/fanfix/library/web/templates/viewer.image.nolink.html b/src/be/nikiroo/fanfix/library/web/templates/viewer.image.nolink.html new file mode 100644 index 0000000..64483c9 --- /dev/null +++ b/src/be/nikiroo/fanfix/library/web/templates/viewer.image.nolink.html @@ -0,0 +1,5 @@ +
+ +