From 1d6f46d9bbcf84368be9cd3920e034387da27514 Mon Sep 17 00:00:00 2001 From: 8chan Date: Thu, 12 Jun 2014 15:36:01 +0000 Subject: [PATCH 1/4] Fix scroll to issues with post-hover.js, clean up highlightReply --- js/post-hover.js | 1 + stylesheets/style.css | 2 +- templates/main.js | 4 +++- templates/post_reply.html | 12 +++++------- templates/post_thread.html | 11 +++++------ 5 files changed, 15 insertions(+), 15 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 664bf717..20d895ae 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 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 #}
-

+

+ {% if not index %}{% endif %} - {% include 'post/poster_id.html' %} - - No. - - {{ post.id }} - + {% include 'post/poster_id.html' %}  + No. + {{ post.id }}

{% 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 #}
+{% if not index %}{% endif %} {% include 'post/fileinfo.html' %} -
1%}style='clear:both'{%endif%}>

+

1%}style='clear:both'{%endif%}>

- {% include 'post/poster_id.html' %} - No. - - {{ post.id }} - + {% include 'post/poster_id.html' %}  + No. + {{ post.id }} {% if post.sticky %} {% if config.font_awesome %} From e856917b00b6ede3b5e163b38d4b85780d45664e Mon Sep 17 00:00:00 2001 From: 8chan Date: Thu, 12 Jun 2014 17:26:21 +0000 Subject: [PATCH 2/4] Add scripts to catalog page --- templates/themes/catalog/theme.php | 7 +++++++ 1 file changed, 7 insertions(+) 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, From a9765f6c4a8397dae58b0cda0052be8b7f3d0f24 Mon Sep 17 00:00:00 2001 From: 8chan Date: Thu, 12 Jun 2014 17:48:31 +0000 Subject: [PATCH 3/4] Fix issue #61 --- js/inline-expanding.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/inline-expanding.js b/js/inline-expanding.js index 5bbfa0a0..4cf5a82d 100644 --- a/js/inline-expanding.js +++ b/js/inline-expanding.js @@ -48,7 +48,8 @@ onready(function(){ delete this.style.filter; } } 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].style.width = this.dataset.width; this.childNodes[0].style.height = this.dataset.height; From 91570ef083c20e779596583def6f9a7ce6a751bd Mon Sep 17 00:00:00 2001 From: 8chan Date: Thu, 12 Jun 2014 18:01:16 +0000 Subject: [PATCH 4/4] Fix issue #57 --- js/multi-image.js | 3 +-- js/upload-selection.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/js/multi-image.js b/js/multi-image.js index 5866e2e4..32d1f256 100644 --- a/js/multi-image.js +++ b/js/multi-image.js @@ -14,12 +14,11 @@ function multi_image() { $(document).on('click', 'a.add_image', function(e) { e.preventDefault(); - $('#upload_url').remove(); var images_len = $('form:not([id="quick-reply"]) [type=file]').length; if (!(images_len >= max_images)) { - $('.add_image').after('
'); + $('.add_image').after('
'); if (typeof setup_form !== 'undefined') setup_form($('form[name="post"]')); } }) diff --git a/js/upload-selection.js b/js/upload-selection.js index 80dd0eaf..e2032748 100644 --- a/js/upload-selection.js +++ b/js/upload-selection.js @@ -20,11 +20,16 @@ $(function(){ var disable_all = function() { $("#upload").hide(); - $("#upload_file").hide(); + $("[id^=upload_file]").hide(); + $(".file_separator").hide(); $("#upload_url").hide(); $("#upload_embed").hide(); $(".add_image").hide(); + $('[id^=upload_file]').each(function(i, v) { + $(v).val(''); + }); + if (enabled_oekaki) { if (window.oekaki.initialized) { window.oekaki.deinit(); @@ -35,7 +40,8 @@ $(function(){ enable_file = function() { disable_all(); $("#upload").show(); - $("#upload_file").show(); + $(".file_separator").show(); + $("[id^=upload_file]").show(); $(".add_image").show(); };