Browse Source

Fix scroll to issues with post-hover.js, clean up highlightReply

pull/40/head
8chan 10 years ago
committed by Fredrick Brennan
parent
commit
1d6f46d9bb
  1. 1
      js/post-hover.js
  2. 2
      stylesheets/style.css
  3. 4
      templates/main.js
  4. 12
      templates/post_reply.html
  5. 11
      templates/post_thread.html

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

2
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 {

4
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

12
templates/post_reply.html

@ -1,7 +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' %}
@ -10,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>
{% include 'post/fileinfo.html' %}
{% include 'post/post_controls.html' %}

11
templates/post_thread.html

@ -2,8 +2,9 @@
{# 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 %}
{% include 'post/fileinfo.html' %}
<div class="post op" {%if post.num_files > 1%}style='clear:both'{%endif%}><p class="intro"{% if not index %} id="{{ post.id }}"{% endif %}>
<div class="post op" {%if post.num_files > 1%}style='clear:both'{%endif%}><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' %}
@ -12,11 +13,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>

Loading…
Cancel
Save