~aleteoryx/webjrnl

1a5ca374bf2739960e77accca94885fc44db8a40 — Aleteoryx 22 days ago a71a7b3
compat testing
4 files changed, 21 insertions(+), 9 deletions(-)

M README.md
M jrnl.go
M parse.go
M template/save.html
M README.md => README.md +17 -0
@@ 130,4 130,21 @@ connection.
the contents of the database are stored in plaintext.


## compatibility

works, no notes:

- any modern web browser probably. works in librewolf
- lynx
- w3m
- MSIE 6
- k-meleon

works with caveats:

- links2: textareas start scrolled to the bottom, so the year pages are
  a bit annoying.
- netsurf: textareas with a lot of data in them are laggy to edit, so
  the year pages are annoying to work with
- plan 9 mothra: textareas are buggy, which makes any editing besides
  entry creation a chore

M jrnl.go => jrnl.go +2 -7
@@ 7,11 7,6 @@ import "os"

var proxied bool = false

func fatal(err error) {
	fmt.Fprintln(os.Stderr, "fatal:", err)
	os.Exit(2)
}

func usage() {
	fmt.Fprintln(os.Stderr, "usage: jrnl [-proxied] addr [mtpt]")
	os.Exit(1)


@@ 69,14 64,14 @@ func main() {
	}

	addr := os.Args[0]
	if len(os.Args) == 3 {
	if len(os.Args) > 1 {
		Mtpt = os.Args[1]
	} else {
		Mtpt = "."
	}

	if err := MountDB(); err != nil {
		fatal(err)
		log.Fatal(err)
	}

	http.HandleFunc("/{$}", Redirect("/dash", 301))

M parse.go => parse.go +1 -1
@@ 7,7 7,7 @@ const HeadFormat = "> 2006-01-02"

func NextLine(s string) (line, rest string) {
	line, rest, _ = strings.Cut(s, "\n")
	if line[len(line) - 1] == '\r' {
	if len(line) > 0 && line[len(line) - 1] == '\r' {
		line = line[:len(line) - 1]
	}
	return

M template/save.html => template/save.html +1 -1
@@ 2,6 2,6 @@
	<p>This is a full backup of your jrnl, including every version of every entry.
	   Modification dates are not preserved.</p>
	<textarea name="text" cols="72" rows="24">{{ .Jrnl.GetBackup }}</textarea>
	<form method="GET"><button name="download">Download!</button></form>
	<form method="GET"><button name="download" type="submit">Download!</button></form>
{{template "foot" .}}