summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author8chan <admin@8chan.co>2014-06-12 15:36:01 +0000
committerczaks <marcin@6irc.net>2014-06-21 20:34:09 +0200
commit8d8563a20d6907cd106176704a404e3d2ff10763 (patch)
tree055e566233afc02594ee1e8fc2ab1a0b19fa2c36
parent73177fcffc040d1c225782fe85f09576a39f6890 (diff)
Fix scroll to issues with post-hover.js, clean up highlightReply
Conflicts: templates/post_reply.html templates/post_thread.html
-rw-r--r--js/post-hover.js1
-rw-r--r--stylesheets/style.css2
-rw-r--r--templates/main.js4
-rw-r--r--templates/post_reply.html13
-rw-r--r--templates/post_thread.html11
5 files changed, 15 insertions, 16 deletions
diff --git a/js/post-hover.js b/js/post-hover.js
index 4a86cba0..2808b8e7 100644
--- a/js/post-hover.js
+++ b/js/post-hover.js
@@ -66,6 +66,7 @@ onready(function(){
var $newPost = $post.clone();
$newPost.find('>.reply, >br').remove();
$newPost.find('span.mentioned').remove();
+ $newPost.find('a.post_anchor').remove();
$newPost
.attr('id', 'post-hover-' + id)
diff --git a/stylesheets/style.css b/stylesheets/style.css
index b167dbb0..e7114bc6 100644
--- a/stylesheets/style.css
+++ b/stylesheets/style.css
@@ -25,7 +25,7 @@ a.post_no {
p.intro a.post_no {
color: inherit;
}
-p.intro a.post_no, p.intro a.email {
+p.intro a.post_no, p.intro a.email, p.intro a.post_anchor {
margin: 0;
}
p.intro a.email span.name {
diff --git a/templates/main.js b/templates/main.js
index 7796565c..294a752d 100644
--- a/templates/main.js
+++ b/templates/main.js
@@ -155,7 +155,7 @@ function highlightReply(id) {
if (post)
post.className += ' highlighted';
}
- return false;
+ return true;
}
function generatePassword() {
@@ -187,6 +187,8 @@ function dopost(form) {
function citeReply(id, with_link) {
var textarea = document.getElementById('body');
+
+ if (!textarea) return false;
if (document.selection) {
// IE
diff --git a/templates/post_reply.html b/templates/post_reply.html
index 90ac5065..c2254844 100644
--- a/templates/post_reply.html
+++ b/templates/post_reply.html
@@ -1,8 +1,8 @@
{% filter remove_whitespace %}
{# tabs and new lines will be ignored #}
<div class="post reply" id="reply_{{ post.id }}">
-
-<p class="intro"{% if not index %} id="{{ post.id }}"{% endif %}>
+<p class="intro">
+ {% if not index %}<a id="{{ post.id }}" class="post_anchor"></a>{% endif %}
<input type="checkbox" class="delete" name="delete_{{ post.id }}" id="delete_{{ post.id }}" />
<label for="delete_{{ post.id }}">
{% include 'post/subject.html' %}
@@ -11,12 +11,9 @@
{% include 'post/flag.html' %}
{% include 'post/time.html' %}
</label>
- {% include 'post/poster_id.html' %}
-
- <a class="post_no" onclick="return document.querySelectorAll('div.banner').length ? highlightReply({{ post.id }}) : true;" href="{{ post.link }}">No.</a>
- <a class="post_no" onclick="return document.querySelectorAll('div.banner').length ? citeReply({{ post.id }}) : true;" href="{{ post.link('q') }}">
- {{ post.id }}
- </a>
+ {% include 'post/poster_id.html' %}&nbsp;
+ <a class="post_no" id="post_no_{{ post.id }}" onclick="highlightReply({{ post.id }})" href="{{ post.link }}">No.</a>
+ <a class="post_no" onclick="citeReply({{ post.id }})" href="{{ post.link('q') }}">{{ post.id }}</a>
</p>
{% if post.embed %}
{{ post.embed }}
diff --git a/templates/post_thread.html b/templates/post_thread.html
index f74427e4..61d09636 100644
--- a/templates/post_thread.html
+++ b/templates/post_thread.html
@@ -2,6 +2,7 @@
{# tabs and new lines will be ignored #}
<div id="thread_{{ post.id }}" data-board="{{ board.uri }}">
+{% if not index %}<a id="{{ post.id }}" class="post_anchor"></a>{% endif %}
{% if post.embed %}
{{ post.embed }}
@@ -33,7 +34,7 @@
</span></p>
{% include "post/image.html" %}
{% endif %}
-<div class="post op"><p class="intro"{% if not index %} id="{{ post.id }}"{% endif %}>
+<div class="post op"><p class="intro">
<input type="checkbox" class="delete" name="delete_{{ post.id }}" id="delete_{{ post.id }}" />
<label for="delete_{{ post.id }}">
{% include 'post/subject.html' %}
@@ -42,11 +43,9 @@
{% include 'post/flag.html' %}
{% include 'post/time.html' %}
</label>
- {% include 'post/poster_id.html' %}
- <a class="post_no" onclick="return document.querySelectorAll('div.banner').length ? highlightReply({{ post.id }}) : true;" href="{{ post.link }}">No.</a>
- <a class="post_no" onclick="return document.querySelectorAll('div.banner').length ? citeReply({{ post.id }}) : true;" href="{{ post.link('q') }}">
- {{ post.id }}
- </a>
+ {% include 'post/poster_id.html' %}&nbsp;
+ <a class="post_no" id="post_no_{{ post.id }}" onclick="highlightReply({{ post.id }})" href="{{ post.link }}">No.</a>
+ <a class="post_no" onclick="citeReply({{ post.id }})" href="{{ post.link('q') }}">{{ post.id }}</a>
{% if post.sticky %}
{% if config.font_awesome %}
<i class="fa fa-thumb-tack"></i>