X-Git-Url: http://git.nikiroo.be/?p=fanfix.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Flibrary%2FWebLibraryServerHtml.java;h=3dbc4aee399a7f10aecbfd6425703d0c350e75fe;hp=42ebead137c05e8189fec17a9d57d4da91e4858a;hb=bc846414b1020989242698aace37106cd33c9e4c;hpb=074a83257de30c3cd7409b0840ab6f27ed0e93b5 diff --git a/src/be/nikiroo/fanfix/library/WebLibraryServerHtml.java b/src/be/nikiroo/fanfix/library/WebLibraryServerHtml.java index 42ebead..3dbc4ae 100644 --- a/src/be/nikiroo/fanfix/library/WebLibraryServerHtml.java +++ b/src/be/nikiroo/fanfix/library/WebLibraryServerHtml.java @@ -16,7 +16,6 @@ import javax.net.ssl.SSLServerSocketFactory; import be.nikiroo.fanfix.Instance; import be.nikiroo.fanfix.bundles.Config; -import be.nikiroo.fanfix.bundles.UiConfig; import be.nikiroo.fanfix.data.Chapter; import be.nikiroo.fanfix.data.MetaData; import be.nikiroo.fanfix.data.Paragraph; @@ -248,6 +247,12 @@ abstract class WebLibraryServerHtml implements Runnable { mimeType = "text/html"; } else if (uri.endsWith(".js")) { mimeType = "text/javascript"; + } else if (uri.endsWith(".png")) { + mimeType = "image/png"; + } else if (uri.endsWith(".ico")) { + mimeType = "image/x-icon"; + } else if (uri.endsWith(".java")) { + mimeType = "text/plain"; } rep = newChunkedResponse(Status.OK, mimeType, in); @@ -327,7 +332,8 @@ abstract class WebLibraryServerHtml implements Runnable { content.add(templates.login(uri)); return NanoHTTPD.newChunkedResponse(Status.FORBIDDEN, - NanoHTTPD.MIME_HTML, templates.index(true, content).read()); + NanoHTTPD.MIME_HTML, + templates.index(true, false, content).read()); } private Response root(IHTTPSession session, Map cookies, @@ -470,7 +476,7 @@ abstract class WebLibraryServerHtml implements Runnable { booklines.add(0, templates.browser(browser, filter, selects)); return newInputStreamResponse(NanoHTTPD.MIME_HTML, - templates.index(true, booklines).read()); + templates.index(true, false, booklines).read()); } private Response getViewer(Map cookies, String uri, @@ -543,14 +549,14 @@ abstract class WebLibraryServerHtml implements Runnable { String first, previous, next, last; - String viewer = ""; - - String disabledLeft = ""; - String disabledRight = ""; - String disabledZoomReal = ""; - String disabledZoomWidth = ""; - String disabledZoomHeight = ""; + boolean disabledLeft = false; + boolean disabledRight = false; + boolean disabledZoomReal = false; + boolean disabledZoomWidth = false; + boolean disabledZoomWidthLimited = false; + boolean disabledZoomHeight = false; + Template viewerItem = null; if (paragraph <= 0) { first = WebLibraryUrls.getViewUrl(luid, 0, null); previous = WebLibraryUrls.getViewUrl(luid, @@ -561,42 +567,37 @@ abstract class WebLibraryServerHtml implements Runnable { last = WebLibraryUrls.getViewUrl(luid, story.getChapters().size(), null); - String desc = ""; + Template desc = null; if (chapter <= 0) { - StringBuilder desclines = new StringBuilder(); + List