diff options
author | rsiddharth <rsiddharth@ninthfloor.org> | 2012-06-23 22:44:40 +0530 |
---|---|---|
committer | rsiddharth <rsiddharth@ninthfloor.org> | 2012-06-23 22:44:40 +0530 |
commit | 8bcd7f58acd38f5d5e1731f89be4a10a79d0fdb7 (patch) | |
tree | 6c1d4dfc97d77230ecf95d4e0f8b4fe1cde5b739 /parsers/BackButton.java |
scruf is "bzr"ed now.
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 |