1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-12 10:00:49 +01:00

Merge branch 'master' of github.com:vichan-devel/Tinyboard

This commit is contained in:
czaks 2014-06-14 18:34:09 +02:00
commit a4dc0d03b7
9 changed files with 33 additions and 20 deletions

View File

@ -48,7 +48,8 @@ onready(function(){
delete this.style.filter; delete this.style.filter;
} }
} else { } else {
this.parentNode.style.width = (parseInt(this.dataset.width)+40)+'px'; if (~this.parentNode.className.indexOf('multifile'))
this.parentNode.style.width = (parseInt(this.dataset.width)+40)+'px';
this.childNodes[0].src = this.dataset.src; this.childNodes[0].src = this.dataset.src;
this.childNodes[0].style.width = this.dataset.width; this.childNodes[0].style.width = this.dataset.width;
this.childNodes[0].style.height = this.dataset.height; this.childNodes[0].style.height = this.dataset.height;

View File

@ -14,12 +14,11 @@ function multi_image() {
$(document).on('click', 'a.add_image', function(e) { $(document).on('click', 'a.add_image', function(e) {
e.preventDefault(); e.preventDefault();
$('#upload_url').remove();
var images_len = $('form:not([id="quick-reply"]) [type=file]').length; var images_len = $('form:not([id="quick-reply"]) [type=file]').length;
if (!(images_len >= max_images)) { if (!(images_len >= max_images)) {
$('.add_image').after('<br/><input type="file" name="file'+(images_len+1)+'" id="upload_file'+(images_len+1)+'">'); $('.add_image').after('<br class="file_separator"/><input type="file" name="file'+(images_len+1)+'" id="upload_file'+(images_len+1)+'">');
if (typeof setup_form !== 'undefined') setup_form($('form[name="post"]')); if (typeof setup_form !== 'undefined') setup_form($('form[name="post"]'));
} }
}) })

View File

@ -66,6 +66,7 @@ onready(function(){
var $newPost = $post.clone(); var $newPost = $post.clone();
$newPost.find('>.reply, >br').remove(); $newPost.find('>.reply, >br').remove();
$newPost.find('span.mentioned').remove(); $newPost.find('span.mentioned').remove();
$newPost.find('a.post_anchor').remove();
$newPost $newPost
.attr('id', 'post-hover-' + id) .attr('id', 'post-hover-' + id)

View File

@ -20,11 +20,16 @@ $(function(){
var disable_all = function() { var disable_all = function() {
$("#upload").hide(); $("#upload").hide();
$("#upload_file").hide(); $("[id^=upload_file]").hide();
$(".file_separator").hide();
$("#upload_url").hide(); $("#upload_url").hide();
$("#upload_embed").hide(); $("#upload_embed").hide();
$(".add_image").hide(); $(".add_image").hide();
$('[id^=upload_file]').each(function(i, v) {
$(v).val('');
});
if (enabled_oekaki) { if (enabled_oekaki) {
if (window.oekaki.initialized) { if (window.oekaki.initialized) {
window.oekaki.deinit(); window.oekaki.deinit();
@ -35,7 +40,8 @@ $(function(){
enable_file = function() { enable_file = function() {
disable_all(); disable_all();
$("#upload").show(); $("#upload").show();
$("#upload_file").show(); $(".file_separator").show();
$("[id^=upload_file]").show();
$(".add_image").show(); $(".add_image").show();
}; };

View File

@ -25,7 +25,7 @@ a.post_no {
p.intro a.post_no { p.intro a.post_no {
color: inherit; 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; margin: 0;
} }
p.intro a.email span.name { p.intro a.email span.name {

View File

@ -155,7 +155,7 @@ function highlightReply(id) {
if (post) if (post)
post.className += ' highlighted'; post.className += ' highlighted';
} }
return false; return true;
} }
function generatePassword() { function generatePassword() {
@ -188,6 +188,8 @@ function dopost(form) {
function citeReply(id, with_link) { function citeReply(id, with_link) {
var textarea = document.getElementById('body'); var textarea = document.getElementById('body');
if (!textarea) return false;
if (document.selection) { if (document.selection) {
// IE // IE
textarea.focus(); textarea.focus();

View File

@ -1,7 +1,8 @@
{% filter remove_whitespace %} {% filter remove_whitespace %}
{# tabs and new lines will be ignored #} {# tabs and new lines will be ignored #}
<div class="post reply" id="reply_{{ post.id }}"> <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 }}" /> <input type="checkbox" class="delete" name="delete_{{ post.id }}" id="delete_{{ post.id }}" />
<label for="delete_{{ post.id }}"> <label for="delete_{{ post.id }}">
{% include 'post/subject.html' %} {% include 'post/subject.html' %}
@ -10,12 +11,9 @@
{% include 'post/flag.html' %} {% include 'post/flag.html' %}
{% include 'post/time.html' %} {% include 'post/time.html' %}
</label> </label>
{% include 'post/poster_id.html' %} {% 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="return document.querySelectorAll('div.banner').length ? highlightReply({{ post.id }}) : true;" href="{{ post.link }}">No.</a> <a class="post_no" onclick="citeReply({{ post.id }})" href="{{ post.link('q') }}">{{ post.id }}</a>
<a class="post_no" onclick="return document.querySelectorAll('div.banner').length ? citeReply({{ post.id }}) : true;" href="{{ post.link('q') }}">
{{ post.id }}
</a>
</p> </p>
{% include 'post/fileinfo.html' %} {% include 'post/fileinfo.html' %}
{% include 'post/post_controls.html' %} {% include 'post/post_controls.html' %}

View File

@ -2,8 +2,9 @@
{# tabs and new lines will be ignored #} {# tabs and new lines will be ignored #}
<div id="thread_{{ post.id }}" data-board="{{ board.uri }}"> <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' %} {% 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 }}" /> <input type="checkbox" class="delete" name="delete_{{ post.id }}" id="delete_{{ post.id }}" />
<label for="delete_{{ post.id }}"> <label for="delete_{{ post.id }}">
{% include 'post/subject.html' %} {% include 'post/subject.html' %}
@ -12,11 +13,9 @@
{% include 'post/flag.html' %} {% include 'post/flag.html' %}
{% include 'post/time.html' %} {% include 'post/time.html' %}
</label> </label>
{% include 'post/poster_id.html' %} {% include 'post/poster_id.html' %}&nbsp;
<a class="post_no" onclick="return document.querySelectorAll('div.banner').length ? highlightReply({{ post.id }}) : true;" href="{{ post.link }}">No.</a> <a class="post_no" id="post_no_{{ post.id }}" onclick="highlightReply({{ post.id }})" href="{{ post.link }}">No.</a>
<a class="post_no" onclick="return document.querySelectorAll('div.banner').length ? citeReply({{ post.id }}) : true;" href="{{ post.link('q') }}"> <a class="post_no" onclick="citeReply({{ post.id }})" href="{{ post.link('q') }}">{{ post.id }}</a>
{{ post.id }}
</a>
{% if post.sticky %} {% if post.sticky %}
{% if config.font_awesome %} {% if config.font_awesome %}
<i class="fa fa-thumb-tack"></i> <i class="fa fa-thumb-tack"></i>

View File

@ -60,6 +60,13 @@
$recent_posts[] = $post; $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( file_write($config['dir']['home'] . $board_name . '/catalog.html', Element('themes/catalog/catalog.html', Array(
'settings' => $settings, 'settings' => $settings,
'config' => $config, 'config' => $config,