1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-08-03 07:36:23 -07:00

Fix text appearing outside replies with images

This commit is contained in:
Joshua Merrell 2018-02-03 12:43:12 -08:00
parent faa313d301
commit c8aa02b420
7 changed files with 19 additions and 27 deletions

View file

@ -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

View file

@ -1,6 +1,6 @@
#!/usr/bin/env bash
VERSION=1.8.1
VERSION=1.8.2
GOOS_ORIG=$GOOS
function copyStuff {

View file

@ -7,6 +7,6 @@
<h1>404: File not found</h1>
<img src="/error/lol 404.gif" border="0" alt="">
<p>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 <a href="/site">here</a></p>
<hr><address>http://gochan.org powered by Gochan v1.8.1</address>
<hr><address>http://gochan.org powered by Gochan v1.8.2</address>
</body>
</html>

View file

@ -7,6 +7,6 @@
<h1>500: Internal Server error</h1>
<img src="/error/derpy server.gif" border="0" alt="">
<p>The server encountered an error while trying to serve the page, and we apologize for the inconvenience. The <a href="https://en.wikipedia.org/wiki/Idiot">system administrator</a> will try to fix things as soon has he/she/it can.</p>
<hr><address>http://gochan.org powered by Gochan v1.8.1</address>
<hr><address>http://gochan.org powered by Gochan v1.8.2</address>
</body>
</html>

View file

@ -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("<a />")
.prop("href", "javascript:;")
@ -103,15 +98,15 @@ function prepareThumbnails() {
}).css({
"padding-left": "8px"
})
.text("[Close]")
.html("[Close]<br />")
.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

View file

@ -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)

View file

@ -69,17 +69,15 @@
{{end}}
</div>
{{range $reply_num,$reply := $thread.BoardReplies}}
<div class="reply-container">
<div class="reply" id="{{$reply.ID}}">
<div><input type="checkbox" id="check{{$reply.ID}}" name="check{{$reply.ID}}" /> <label class="post-info" for="check{{$reply.ID}}"> <span class="subject">{{$reply.Subject}}</span> <span class="postername">{{if stringNeq $reply.Email ""}}<a href="mailto:{{$reply.Email}}">{{end}}{{if stringNeq $reply.Name ""}}{{$reply.Name}}{{else}}{{if stringEq $reply.Tripcode ""}}{{$board.Anonymous}}{{end}}{{end}}{{if stringNeq $reply.Email ""}}</a>{{end}}</span>{{if stringNeq $reply.Tripcode ""}}<span class="tripcode">!{{$reply.Tripcode}}</span>{{end}} {{formatTimestamp $reply.Timestamp}} </label><a href="/{{$board.Dir}}/res/{{$op.ID}}.html#{{$reply.ID}}">No.</a> <a href="javascript:quote({{$reply.ID}})" class="backlink-clink">{{$reply.ID}}</a> <span class="post-links"><span class="thread-ddown">[<a href="javascript:void(0)">&#9660;</a>]</span></span></div>
{{if stringNeq $reply.Filename ""}}<span class="file-info">File: <a href="src/{{$reply.Filename}}" target="_blank">{{$reply.Filename}}</a> - ({{formatFilesize $reply.Filesize}} , {{$reply.ImageW}}x{{$reply.ImageH}}, {{$reply.FilenameOriginal}})</span><br />
<a class="upload-container" href="{{$config.SiteWebfolder}}{{$board.Dir}}/src/{{$reply.Filename}}"><img src="{{$config.SiteWebfolder}}{{$board.Dir}}/thumb/{{imageToThumbnailPath $reply.Filename}}" width="{{$reply.ThumbW}}" height="{{$reply.ThumbH}}" class="thumbnail" /></a></div>{{end}}
{{if stringNeq $reply.MessageHTML ""}}
<div class="post-text">{{$reply.MessageHTML}}</div>
{{end}}
</div>
<div class="reply-container" id="replycontainer{{$reply.ID}}">
<a class="anchor" id="{{$reply.ID}}"></a>
<div class="reply" id="reply{{$reply.ID}}">
<input type="checkbox" id="check{{$reply.ID}}" name="check{{$reply.ID}}" /> <label class="post-info" for="check{{$reply.ID}}"> <span class="subject">{{$reply.Subject}}</span> <span class="postername">{{if stringNeq $reply.Email ""}}<a href="mailto:{{$reply.Email}}">{{end}}{{if stringNeq $reply.Name ""}}{{$reply.Name}}{{else}}{{if stringEq $reply.Tripcode ""}}{{$board.Anonymous}}{{end}}{{end}}{{if stringNeq $reply.Email ""}}</a>{{end}}</span>{{if stringNeq $reply.Tripcode ""}}<span class="tripcode">!{{$reply.Tripcode}}</span>{{end}} {{formatTimestamp $reply.Timestamp}} </label><a href="/{{$board.Dir}}/res/{{$op.ID}}.html#{{$reply.ID}}">No.</a> <a href="javascript:quote({{$reply.ID}})" class="backlink-click">{{$reply.ID}}</a> <span class="post-links"><span class="thread-ddown">[<a href="javascript:void(0)">&#9660;</a>]</span></span><br />
{{if stringNeq $reply.Filename ""}}<span class="file-info">File: <a href="src/{{$reply.Filename}}" target="_blank">{{$reply.Filename}}</a> - ({{formatFilesize $reply.Filesize}} , {{$reply.ImageW}}x{{$reply.ImageH}}, {{$reply.FilenameOriginal}})</span><br />
<a class="upload-container" href="{{$config.SiteWebfolder}}{{$board.Dir}}/src/{{$reply.Filename}}"><img src="{{$config.SiteWebfolder}}{{$board.Dir}}/thumb/{{imageToThumbnailPath $reply.Filename}}" width="{{$reply.ThumbW}}" height="{{$reply.ThumbH}}" class="thumbnail" /></a>{{end}}
<div class="post-text">{{$reply.MessageHTML}}</div>
</div>
</div>
{{end}}
</div>