summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2014-06-14 18:34:09 +0200
committerczaks <marcin@6irc.net>2014-06-14 18:34:09 +0200
commita4dc0d03b75b92155d6c2573278c16d5c781af1c (patch)
tree255ed69e4ba16961bfdee15532a8b0d14c186e82 /templates
parentb12612ac576f0bb2c4f82e55d0596d40db77150d (diff)
parent91570ef083c20e779596583def6f9a7ce6a751bd (diff)
Merge branch 'master' of github.com:vichan-devel/Tinyboard
Diffstat (limited to 'templates')
-rw-r--r--templates/main.js4
-rw-r--r--templates/post_reply.html12
-rw-r--r--templates/post_thread.html11
-rw-r--r--templates/themes/catalog/theme.php7
4 files changed, 20 insertions, 14 deletions
diff --git a/templates/main.js b/templates/main.js
index 231b8043..f7b99a42 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 8ef3c1e8..8c182ad4 100644
--- a/templates/post_reply.html
+++ b/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' %}
diff --git a/templates/post_thread.html b/templates/post_thread.html
index 335c1713..c246a16c 100644
--- a/templates/post_thread.html
+++ b/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>
diff --git a/templates/themes/catalog/theme.php b/templates/themes/catalog/theme.php
index cf2095d0..0a95c8df 100644
--- a/templates/themes/catalog/theme.php
+++ b/templates/themes/catalog/theme.php
@@ -60,6 +60,13 @@
$recent_posts[] = $post;
}
+ $required_scripts = array('js/jquery.mixitup.min.js', 'js/jquery.tooltipster.min.js', 'js/catalog.js');
+
+ foreach($required_scripts as $i => $s) {
+ if (!in_array($s, $config['additional_javascript']))
+ $config['additional_javascript'][] = $s;
+ }
+
file_write($config['dir']['home'] . $board_name . '/catalog.html', Element('themes/catalog/catalog.html', Array(
'settings' => $settings,
'config' => $config,