1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-08-04 12:16:22 -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_VERBOSE=2
GOCHAN_VERBOSITY=0 # This is set by "make release/debug/verbose" 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) GOCHAN_BUILDTIME=$(shell date +%y%m%d.%H%M)
ifeq ($(GOOS), windows) ifeq ($(GOOS), windows)
GOCHAN_BIN=gochan.exe GOCHAN_BIN=gochan.exe

View file

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

View file

@ -7,6 +7,6 @@
<h1>404: File not found</h1> <h1>404: File not found</h1>
<img src="/error/lol 404.gif" border="0" alt=""> <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> <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> </body>
</html> </html>

View file

@ -7,6 +7,6 @@
<h1>500: Internal Server error</h1> <h1>500: Internal Server error</h1>
<img src="/error/derpy server.gif" border="0" alt=""> <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> <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> </body>
</html> </html>

View file

@ -75,7 +75,7 @@ function prepareThumbnails() {
var thumb_height = thumb.attr("height"); var thumb_height = thumb.attr("height");
var file_info_elem = a.prevAll(".file-info:first"); var file_info_elem = a.prevAll(".file-info:first");
var uploadURL = file_info_elem.children("a:first")[0].href; var uploadURL = file_info_elem.children("a:first")[0].href;
var viewBtn = a.nextAll("span.post-links:first");
if(thumb.attr("src") == thumbURL) { if(thumb.attr("src") == thumbURL) {
// Expanding thumbnail // Expanding thumbnail
if(uploadURL.indexOf(".webm") > 0) { if(uploadURL.indexOf(".webm") > 0) {
@ -87,12 +87,7 @@ function prepareThumbnails() {
autoplay: true, autoplay: true,
controls: true, controls: true,
loop: true loop: true
}).click(function(e) { }).insertAfter(file_info_elem);
e.preventDefault();
if(this.pause) this.pause();
this.removeAttribute("src");
this.remove();
}).insertAfter(a);
var close_video_btn = $jq("<a />") var close_video_btn = $jq("<a />")
.prop("href", "javascript:;") .prop("href", "javascript:;")
@ -103,15 +98,15 @@ function prepareThumbnails() {
}).css({ }).css({
"padding-left": "8px" "padding-left": "8px"
}) })
.text("[Close]") .html("[Close]<br />")
.insertAfter(file_info_elem); .insertAfter(file_info_elem);
} else { } else {
thumb.attr({ thumb.attr({
src: uploadURL, src: uploadURL,
alt: thumbURL alt: thumbURL
}); })
thumb.removeAttr("width"); .removeAttr("width")
thumb.removeAttr("height"); .removeAttr("height");
} }
} else { } else {
// Shrinking back to thumbnail // Shrinking back to thumbnail

View file

@ -211,7 +211,6 @@ func buildBoardPages(board *BoardsTable) (html string) {
boardinfo_i = append(boardinfo_i, board) boardinfo_i = append(boardinfo_i, board)
// Open board.html for writing to the first page. // 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) 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 { if err != nil {
errortext = "Failed opening /" + board.Dir + "/board.html: " + err.Error() errortext = "Failed opening /" + board.Dir + "/board.html: " + err.Error()
@ -1340,7 +1339,7 @@ func formatMessage(post *PostTable) {
message := post.MessageHTML message := post.MessageHTML
// prepare each line to be formatted // prepare each line to be formatted
postLines := strings.Split(message, "\r\n") postLines := strings.Split(message, "\\r\\n")
for i, line := range postLines { for i, line := range postLines {
trimmedLine := strings.TrimSpace(line) trimmedLine := strings.TrimSpace(line)
//lineWords := regexp.MustCompile("\\s").Split(trimmedLine, -1) //lineWords := regexp.MustCompile("\\s").Split(trimmedLine, -1)

View file

@ -69,15 +69,13 @@
{{end}} {{end}}
</div> </div>
{{range $reply_num,$reply := $thread.BoardReplies}} {{range $reply_num,$reply := $thread.BoardReplies}}
<div class="reply-container"> <div class="reply-container" id="replycontainer{{$reply.ID}}">
<div class="reply" id="{{$reply.ID}}"> <a class="anchor" id="{{$reply.ID}}"></a>
<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> <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 /> {{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}} <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}}
{{if stringNeq $reply.MessageHTML ""}}
<div class="post-text">{{$reply.MessageHTML}}</div> <div class="post-text">{{$reply.MessageHTML}}</div>
{{end}}
</div> </div>
</div> </div>