From c8aa02b4206bb8676e8445860bbd4f5d133c0450 Mon Sep 17 00:00:00 2001 From: Joshua Merrell Date: Sat, 3 Feb 2018 12:43:12 -0800 Subject: [PATCH] Fix text appearing outside replies with images --- Makefile | 2 +- dist.sh | 2 +- html/error/404.html | 2 +- html/error/500.html | 2 +- html/javascript/gochan.js | 17 ++++++----------- src/posting.go | 3 +-- templates/img_boardpage.html | 18 ++++++++---------- 7 files changed, 19 insertions(+), 27 deletions(-) diff --git a/Makefile b/Makefile index f5bcb33a..07f96ae3 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ GOCHAN_DEBUG=1 GOCHAN_VERBOSE=2 GOCHAN_VERBOSITY=0 # This is set by "make release/debug/verbose" -GOCHAN_VERSION=1.8.1 +GOCHAN_VERSION=1.8.2 GOCHAN_BUILDTIME=$(shell date +%y%m%d.%H%M) ifeq ($(GOOS), windows) GOCHAN_BIN=gochan.exe diff --git a/dist.sh b/dist.sh index 8a8299ff..9deeb16c 100755 --- a/dist.sh +++ b/dist.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -VERSION=1.8.1 +VERSION=1.8.2 GOOS_ORIG=$GOOS function copyStuff { diff --git a/html/error/404.html b/html/error/404.html index 622b6201..9faaa198 100755 --- a/html/error/404.html +++ b/html/error/404.html @@ -7,6 +7,6 @@

404: File not found

The requested file could not be found on this server. Are you just typing random stuff in the address bar? If you followed a link from this site here, then post here

-
http://gochan.org powered by Gochan v1.8.1
+
http://gochan.org powered by Gochan v1.8.2
diff --git a/html/error/500.html b/html/error/500.html index 9a838d01..2844924c 100755 --- a/html/error/500.html +++ b/html/error/500.html @@ -7,6 +7,6 @@

500: Internal Server error

The server encountered an error while trying to serve the page, and we apologize for the inconvenience. The system administrator will try to fix things as soon has he/she/it can.

-
http://gochan.org powered by Gochan v1.8.1
+
http://gochan.org powered by Gochan v1.8.2
diff --git a/html/javascript/gochan.js b/html/javascript/gochan.js index 5a39c71c..e68f3d24 100644 --- a/html/javascript/gochan.js +++ b/html/javascript/gochan.js @@ -75,7 +75,7 @@ function prepareThumbnails() { var thumb_height = thumb.attr("height"); var file_info_elem = a.prevAll(".file-info:first"); var uploadURL = file_info_elem.children("a:first")[0].href; - + var viewBtn = a.nextAll("span.post-links:first"); if(thumb.attr("src") == thumbURL) { // Expanding thumbnail if(uploadURL.indexOf(".webm") > 0) { @@ -87,12 +87,7 @@ function prepareThumbnails() { autoplay: true, controls: true, loop: true - }).click(function(e) { - e.preventDefault(); - if(this.pause) this.pause(); - this.removeAttribute("src"); - this.remove(); - }).insertAfter(a); + }).insertAfter(file_info_elem); var close_video_btn = $jq("") .prop("href", "javascript:;") @@ -103,15 +98,15 @@ function prepareThumbnails() { }).css({ "padding-left": "8px" }) - .text("[Close]") + .html("[Close]
") .insertAfter(file_info_elem); } else { thumb.attr({ src: uploadURL, alt: thumbURL - }); - thumb.removeAttr("width"); - thumb.removeAttr("height"); + }) + .removeAttr("width") + .removeAttr("height"); } } else { // Shrinking back to thumbnail diff --git a/src/posting.go b/src/posting.go index ef7a5bf6..e2d22c18 100755 --- a/src/posting.go +++ b/src/posting.go @@ -211,7 +211,6 @@ func buildBoardPages(board *BoardsTable) (html string) { boardinfo_i = append(boardinfo_i, board) // Open board.html for writing to the first page. - printf(1, "Current page: %s/%d\n", board.Dir, board.CurrentPage) board_page_file, err := os.OpenFile(path.Join(config.DocumentRoot, board.Dir, "board.html"), os.O_CREATE|os.O_RDWR|os.O_TRUNC, 0777) if err != nil { errortext = "Failed opening /" + board.Dir + "/board.html: " + err.Error() @@ -1340,7 +1339,7 @@ func formatMessage(post *PostTable) { message := post.MessageHTML // prepare each line to be formatted - postLines := strings.Split(message, "\r\n") + postLines := strings.Split(message, "\\r\\n") for i, line := range postLines { trimmedLine := strings.TrimSpace(line) //lineWords := regexp.MustCompile("\\s").Split(trimmedLine, -1) diff --git a/templates/img_boardpage.html b/templates/img_boardpage.html index 8f89ae0d..da36020d 100755 --- a/templates/img_boardpage.html +++ b/templates/img_boardpage.html @@ -69,17 +69,15 @@ {{end}} {{range $reply_num,$reply := $thread.BoardReplies}} -
-
-
{{end}}{{if stringNeq $reply.Name ""}}{{$reply.Name}}{{else}}{{if stringEq $reply.Tripcode ""}}{{$board.Anonymous}}{{end}}{{end}}{{if stringNeq $reply.Email ""}}{{end}}{{if stringNeq $reply.Tripcode ""}}!{{$reply.Tripcode}}{{end}} {{formatTimestamp $reply.Timestamp}} No. {{$reply.ID}} []
- {{if stringNeq $reply.Filename ""}}File: {{$reply.Filename}} - ({{formatFilesize $reply.Filesize}} , {{$reply.ImageW}}x{{$reply.ImageH}}, {{$reply.FilenameOriginal}})
-
{{end}} - - {{if stringNeq $reply.MessageHTML ""}} -
{{$reply.MessageHTML}}
- {{end}} -
+
+ +
+ No. {{$reply.ID}} []
+ {{if stringNeq $reply.Filename ""}}File: {{$reply.Filename}} - ({{formatFilesize $reply.Filesize}} , {{$reply.ImageW}}x{{$reply.ImageH}}, {{$reply.FilenameOriginal}})
+ {{end}} +
{{$reply.MessageHTML}}
+
{{end}}