From b8b60b3217e62f1896cc3a57763bddd147474695 Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Thu, 21 May 2020 10:35:14 +0200 Subject: [PATCH] weblib: do not allow click on last image --- .../nikiroo/fanfix/library/WebLibraryServerHtml.java | 6 ++++-- .../web/templates/WebLibraryServerTemplates.java | 10 ++++++---- .../library/web/templates/viewer.image.nolink.html | 5 +++++ 3 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 src/be/nikiroo/fanfix/library/web/templates/viewer.image.nolink.html 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 @@ +
+ +
-- 2.27.0