diff options
Diffstat (limited to 'parsers/BackButton.java')
-rw-r--r-- | parsers/BackButton.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/parsers/BackButton.java b/parsers/BackButton.java new file mode 100644 index 0000000..e20b640 --- /dev/null +++ b/parsers/BackButton.java @@ -0,0 +1,22 @@ +package scruf.parsers; + +import java.io.*; +import scruf.io.*; + +public class BackButton implements Parser { + // this method doesn't modify the filContent. + public String parse(String fileContent) { + StringBuilder button = new StringBuilder(); + button.append("\n<div class=\"back\">\n"); + button.append("<a href=\""); + if(PresentFile.file.getName().equals("index")) { + button.append("../\"> home "); + }else { + button.append("./\"> back "); + } + button.append("</a>\n"); + button.append("</div>"); + PresentFile.backButton = button.toString(); + return fileContent; + } +}
\ No newline at end of file |