From 7cac637c36781db19f7b314ad0131232bfa1409b Mon Sep 17 00:00:00 2001 From: TheHowl Date: Wed, 24 Sep 2014 23:07:36 +0200 Subject: [PATCH 1/7] oh hey look I just fixed #8 search.php It was just a typo, an horrible typo. --- search.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/search.php b/search.php index 394aa3ff..71f4ae5e 100644 --- a/search.php +++ b/search.php @@ -15,7 +15,7 @@ $boards = listBoards(TRUE); } - $body = Element('search_form.html', Array('boards' => $boards, 'board' => isset($_GET['board']) ? $_GET['board'] : false, 'search' => isset($_GET['search']) ? str_replace('"', '"', utf8tohtml($_GET['search'])) : false)); + $body = Element('search_form.html', Array('boards' => $boards, 'b' => isset($_GET['board']) ? $_GET['board'] : false, 'search' => isset($_GET['search']) ? str_replace('"', '"', utf8tohtml($_GET['search'])) : false)); if(isset($_GET['search']) && !empty($_GET['search']) && isset($_GET['board']) && in_array($_GET['board'], $boards)) { $phrase = $_GET['search']; From 5d8d20fcc5c8a2364d51158813f439eff4de3cc8 Mon Sep 17 00:00:00 2001 From: 8chan Date: Wed, 24 Sep 2014 21:29:12 +0000 Subject: [PATCH 2/7] Add timer to auto reload js Conflicts: js/auto-reload.js --- js/auto-reload.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/js/auto-reload.js b/js/auto-reload.js index 4a872024..886f32e6 100644 --- a/js/auto-reload.js +++ b/js/auto-reload.js @@ -8,6 +8,7 @@ * Copyright (c) 2012 Michael Save * Copyright (c) 2013-2014 Marcin Ɓabanowski * Copyright (c) 2013 undido + * Copyright (c) 2014 Fredrick Brennan * * Usage: * $config['additional_javascript'][] = 'js/jquery.min.js'; @@ -27,6 +28,8 @@ $(document).ready(function(){ var poll_interval; + // Add an update link + $('.boardlist.bottom').prev().after("["+_("Update thread")+"] ()"); // Grab the settings var settings = new script_settings('auto-reload'); @@ -37,6 +40,7 @@ $(document).ready(function(){ // number of ms to wait before reloading var poll_interval_delay = poll_interval_mindelay_bottom; + var poll_current_time = poll_interval_delay; var end_of_page = false; @@ -68,6 +72,14 @@ $(document).ready(function(){ window_active = false; }); + var timer_update = function() { + $('#update_secs').text(poll_current_time/1000); + } + + var decrement_timer = function() { + poll_current_time = poll_current_time - 1000; + } + var recheck_activated = function() { if (new_posts && window_active && $(window).scrollTop() + $(window).height() >= @@ -115,6 +127,7 @@ $(document).ready(function(){ } poll_interval = setTimeout(poll, poll_interval_delay); + poll_current_time = poll_interval_delay; }; $(window).scroll(function() { @@ -128,9 +141,15 @@ $(document).ready(function(){ clearTimeout(poll_interval); poll_interval = setTimeout(poll, poll_interval_shortdelay); + poll_current_time = poll_interval_shortdelay; end_of_page = true; }).trigger('scroll'); - poll_interval = setTimeout(poll, poll_interval_delay); + $('#update_thread').on('click', poll); + setInterval(timer_update, 1000); + setInterval(decrement_timer, 1000); + + poll_interval = setInterval(poll, poll_interval_delay); + timer_update(); }); From ed5272f17d22be01770361c3950fe5fbc32cfb7f Mon Sep 17 00:00:00 2001 From: czaks Date: Thu, 25 Sep 2014 06:31:40 +0200 Subject: [PATCH 3/7] auto-reload.js: don`t scroll up --- js/auto-reload.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/auto-reload.js b/js/auto-reload.js index 886f32e6..1f4d11fe 100644 --- a/js/auto-reload.js +++ b/js/auto-reload.js @@ -128,6 +128,8 @@ $(document).ready(function(){ poll_interval = setTimeout(poll, poll_interval_delay); poll_current_time = poll_interval_delay; + + return false; }; $(window).scroll(function() { From dbaeb395acf6ad1e95f7623c2853d9d702920bb5 Mon Sep 17 00:00:00 2001 From: czaks Date: Thu, 25 Sep 2014 06:32:53 +0200 Subject: [PATCH 4/7] auto-reload.js: it`s actually setTimeout, not setInterval, right? --- js/auto-reload.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/auto-reload.js b/js/auto-reload.js index 1f4d11fe..87e332df 100644 --- a/js/auto-reload.js +++ b/js/auto-reload.js @@ -151,7 +151,7 @@ $(document).ready(function(){ setInterval(timer_update, 1000); setInterval(decrement_timer, 1000); - poll_interval = setInterval(poll, poll_interval_delay); + poll_interval = setTimeout(poll, poll_interval_delay); timer_update(); }); From e81d016ffac5a5e7f73a9aafe35a221397b51a51 Mon Sep 17 00:00:00 2001 From: 8chan Date: Sat, 19 Apr 2014 20:02:39 +0000 Subject: [PATCH 5/7] Attempt to fix scroll to anchor issue --- templates/main.js | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/main.js b/templates/main.js index 97f1135f..9286d201 100644 --- a/templates/main.js +++ b/templates/main.js @@ -154,6 +154,7 @@ function highlightReply(id) { var post = document.getElementById('reply_'+id); if (post) post.className += ' highlighted'; + window.location.hash = id; } return true; } From f71cdcaa812353ff7ca8414adec9dbecc1dcf1a6 Mon Sep 17 00:00:00 2001 From: Zealotux Date: Fri, 26 Sep 2014 02:19:49 +0200 Subject: [PATCH 6/7] Update style.css Added "cursor" to "options_tab_icon" according to https://github.com/ctrlcctrlv/8chan/issues/80 --- stylesheets/style.css | 1 + 1 file changed, 1 insertion(+) diff --git a/stylesheets/style.css b/stylesheets/style.css index eea2fb0d..2ac1f180 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -685,6 +685,7 @@ form.ban-appeal textarea { .options_tab_icon { padding: 5px; color: black; + cursor: pointer; } .options_tab_icon.active { color: red; From ba515c5f0519ae89b0876e4291061ecf2ffa6967 Mon Sep 17 00:00:00 2001 From: czaks Date: Fri, 26 Sep 2014 12:56:05 +0200 Subject: [PATCH 7/7] post-hover.js: show a popup preview if a reply is only partially on screen; fixes ctrlcctrlv#84 --- js/post-hover.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/post-hover.js b/js/post-hover.js index 2808b8e7..0becfb70 100644 --- a/js/post-hover.js +++ b/js/post-hover.js @@ -58,8 +58,8 @@ onready(function(){ // link links to itself or to op; ignore } else if($post.is(':visible') && - $post.offset().top + $post.height() >= $(window).scrollTop() && - $post.offset().top <= $(window).scrollTop() + $(window).height()) { + $post.offset().top >= $(window).scrollTop() && + $post.offset().top + $post.height() <= $(window).scrollTop() + $(window).height()) { // post is in view $post.addClass('highlighted'); } else {