From: Niki Roo
Date: Fri, 15 May 2020 16:38:08 +0000 (+0200)
Subject: fix html indentation
X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=9a705a5aa74f35f9dfece944f3d8d965270b21f2;p=nikiroo-utils.git
fix html indentation
---
diff --git a/src/be/nikiroo/fanfix/library/WebLibraryServerHtml.java b/src/be/nikiroo/fanfix/library/WebLibraryServerHtml.java
index 8895fb8..1ec3b1f 100644
--- a/src/be/nikiroo/fanfix/library/WebLibraryServerHtml.java
+++ b/src/be/nikiroo/fanfix/library/WebLibraryServerHtml.java
@@ -315,23 +315,25 @@ abstract class WebLibraryServerHtml implements Runnable {
appendPreHtml(builder, true);
if (login.isBadLogin()) {
- builder.append("Bad login or password
");
+ builder.append(
+ "\t\tBad login or password
");
} else if (login.isBadCookie()) {
- builder.append("Your session timed out
");
+ builder.append(
+ "\t\tYour session timed out
");
}
if (WebLibraryUrls.LOGOUT_URL.equals(uri)) {
uri = WebLibraryUrls.INDEX_URL;
}
+ builder.append("\t\t\n");
+ "\t\t\tYou must be logged into the system to see the stories.
");
+ builder.append("\t\t\t\n");
+ builder.append("\t\t\t\n");
+ builder.append("\t\t\t\n");
+ builder.append("\t\t\n");
appendPostHtml(builder);
@@ -369,42 +371,42 @@ abstract class WebLibraryServerHtml implements Runnable {
// TODO: javascript in realtime, using visible=false + hide [submit]
- builder.append("\n");
- builder.append("\t");
+ builder.append("\t\t
\n");
for (MetaData meta : result.getMetas()) {
if (!filter.isEmpty() && !meta.getTitle().toLowerCase()
.contains(filter.toLowerCase())) {
@@ -478,7 +481,7 @@ abstract class WebLibraryServerHtml implements Runnable {
continue;
}
- builder.append("
");
+ builder.append("\t\t\t
");
builder.append("
");
- desc.append(story.getMeta().getTitle());
- desc.append("\n");
- desc.append("\n");
- desc.append("\t
\n");
- desc.append("\t\t\n");
- desc.append("\t\n");
- desc.append("\t
\n");
+ desc.append("\t\t\t")
+ .append(story.getMeta().getTitle())
+ .append("
\n");
+ desc.append("\t\t\t\n");
+ desc.append(
+ "\t\t\t\t
\n");
+ desc.append("\t\t\t\t\t\n");
+ desc.append("\t\t\t\t\n");
+ desc.append("\t\t\t\t
\n");
Map details = BasicLibrary
.getMetaDesc(story.getMeta());
for (String key : details.keySet()) {
- appendTableRow(desc, 2, key, details.get(key));
+ appendTableRow(desc, 5, key, details.get(key));
}
- desc.append("\t
\n");
- desc.append("
\n");
- desc.append("Description
\n");
+ desc.append("\t\t\t\t
\n");
+ desc.append("\t\t\t
\n");
+ desc.append("\t\t\tDescription
\n");
}
- content.append("\n");
+ content.append("\t\t
\n");
content.append(desc);
- String description = new TextOutput(false).convert(chap,
- chapter > 0);
- content.append(chap.getParagraphs().size() <= 0
- ? "No content provided."
- : description);
- content.append("
\n");
+ if (chap.getParagraphs().size() <= 0) {
+ content.append("\t\t\tNo content provided.\n");
+ } else {
+ content.append(
+ "\t\t\t\n"); //
+ content.append("\t\t\t").append(
+ new TextOutput(false).convert(chap, chapter > 0))
+ .append("\n");
+ }
+ content.append("\t\t
\n");
if (chapter <= 0)
disabledLeft = " disabled='disbaled'";
@@ -691,9 +700,9 @@ abstract class WebLibraryServerHtml implements Runnable {
String javascript = "document.getElementById(\"previous\").click(); return false;";
content.append(String.format("" //
- + ""
- + ""
- + "", //
+ + "\t\t
\n"
+ + "\t\t\t\n"
+ + "\t\t\n", //
javascript, //
next, //
zoomStyle, //
@@ -701,18 +710,20 @@ abstract class WebLibraryServerHtml implements Runnable {
paragraph)));
} else {
content.append(String.format("" //
- + "
%s
", //
+ + "\t\t
" //
+ + "\t\t\t%s\n" //
+ + "\t\t
\n", //
para.getContent()));
}
}
builder.append(String.format("" //
- + "
\n" //
- + "\t
<<\n"//
- + "\t
<\n" //
- + "\t
\n" //
- + "\t\t
%d
\n" //
- + "\t\t
\n", //
+ + "\t\t
\n" //
+ + "\t\t\t
<<\n"//
+ + "\t\t\t
<\n" //
+ + "\t\t\t
\n" //
+ + "\t\t\t\t
%d
\n" //
+ + "\t\t\t\t
\n", //
disabledLeft, first, //
disabledLeft, previous, //
paragraph > 0 ? paragraph : chapter //
@@ -720,11 +731,11 @@ abstract class WebLibraryServerHtml implements Runnable {
// List of chap/para links
- appendItemA(builder, 3, WebLibraryUrls.getViewUrl(luid, 0, null),
+ appendItemA(builder, 5, WebLibraryUrls.getViewUrl(luid, 0, null),
"Description", paragraph == 0 && chapter == 0);
if (paragraph > 0) {
for (int i = 1; i <= chap.getParagraphs().size(); i++) {
- appendItemA(builder, 3,
+ appendItemA(builder, 5,
WebLibraryUrls.getViewUrl(luid, chapter, i),
"Image " + i, paragraph == i);
}
@@ -736,7 +747,7 @@ abstract class WebLibraryServerHtml implements Runnable {
chapName += ": " + c.getName();
}
- appendItemA(builder, 3,
+ appendItemA(builder, 5,
WebLibraryUrls.getViewUrl(luid, i, null), chapName,
chapter == i);
@@ -745,32 +756,31 @@ abstract class WebLibraryServerHtml implements Runnable {
}
builder.append(String.format("" //
- + "\t\t
\n" //
- + "\t
\n" //
- + "\t
>\n" //
- + "\t
>>\n"//
- + "
\n", //
+ + "\t\t\t\t
\n" //
+ + "\t\t\t
\n" //
+ + "\t\t\t
>\n" //
+ + "\t\t\t
>>\n"//
+ + "\t\t
\n", //
disabledRight, next, //
disabledRight, last //
));
builder.append(content);
- builder.append("
0) {
- builder.append("s4");
+ builder.append(" s4");
} else {
- builder.append("s1");
+ builder.append(" s1");
}
builder.append("'>\n");
- builder.append("
BACK\n");
+ builder.append("\t\t\t
BACK\n");
if (paragraph > 0) {
builder.append(String.format("" //
- + "\t
REAL\n"//
- + "\t
WIDTH\n"//
- + "\t
HEIGHT\n"//
- + "
\n", //
+ + "\t\t\t
REAL\n"//
+ + "\t\t\t
WIDTH\n"//
+ + "\t\t\t
HEIGHT\n", //
disabledZoomReal,
uri + "?optionName=zoom&optionValue=real", //
disabledZoomWidth,
@@ -780,6 +790,8 @@ abstract class WebLibraryServerHtml implements Runnable {
));
}
+ builder.append("\t\t
\n");
+
appendPostHtml(builder);
return NanoHTTPD.newFixedLengthResponse(Status.OK,
NanoHTTPD.MIME_HTML, builder.toString());
@@ -826,15 +838,15 @@ abstract class WebLibraryServerHtml implements Runnable {
getContentOf("index.pre.html").replace("favicon.ico", favicon));
if (banner) {
- builder.append("
\n");
- builder.append("\t
\n");
+ builder.append("\t\t\t
\n");
- builder.append("\t
Fanfix
\n");
- builder.append("\t
") //
+ builder.append("\t\t\tFanfix
\n");
+ builder.append("\t\t\t") //
.append(Version.getCurrentVersion()) //
.append("
\n");
- builder.append("
\n");
+ builder.append("\t\t
\n");
}
}
diff --git a/src/be/nikiroo/fanfix/library/web/index.post.html b/src/be/nikiroo/fanfix/library/web/index.post.html
index d4e0905..52ba19e 100644
--- a/src/be/nikiroo/fanfix/library/web/index.post.html
+++ b/src/be/nikiroo/fanfix/library/web/index.post.html
@@ -1,2 +1,2 @@
-
+
-