Infinitechan+ 8chan enhancer (Minimal Ver)

Minimal Version

  1. // ==UserScript==
  2. // @name Infinitechan+ 8chan enhancer (Minimal Ver)
  3. // @include https://8chan.co/*
  4. // @include http://h.8chan.co/*
  5. // @include http://8ch.net/*
  6. // @include https://8ch.net/*
  7. // @description Minimal Version
  8. // @namespace DrChloe
  9. // @version 0.0.1
  10. // ==/UserScript==
  11.  
  12. document.getElementById("8ch-top-ads").style.display = 'none';
  13. document.getElementById("new-bottom-ads").style.display = 'none';
  14.  
  15. darkarrow = 'https://i.imgur.com/V3gNmWg.png';
  16. lightarrow = 'https://i.imgur.com/OQss0hl.png';
  17. function newarrows(){
  18. $('body').append("<div class='circle' style='position:fixed;right:15%;bottom:10%;'><font size='30'><a class='upa' alt='Scroll Up' style='text-decoration: none;display:block;color:black;' href='javascript:window.scrollTo(0,0);'><img class='uparrow arr' src='"+darkarrow+"'></a><a class='downa' style='text-decoration: none;color:black !important;' href='javascript:window.scrollTo(0,900000000);'><img class='downarrow arr' style='-moz-transform: scaleY(-1);-o-transform: scaleY(-1);-webkit-transform: scaleY(-1);transform: scaleY(-1);filter: FlipV;-ms-filter: \"FlipV\";' src='"+darkarrow+"'></a></div>");
  19. };
  20. $(document).on('mouseenter', ".arr", function() {
  21. $(this).attr('src', lightarrow);
  22. });
  23.  
  24. $(document).on('mouseleave', ".arr", function() {
  25. $(this).attr('src', darkarrow);
  26. });
  27.  
  28. $(window).scroll(function() {
  29. if($(window).scrollTop() + $(window).height() > $(document).height() - 100) {
  30. $('.downa').hide();
  31. } else {$('.downa').show();};
  32.  
  33. if ($(window).scrollTop() - 100 <= 0) {
  34. $('.upa').hide();
  35. } else {$('.upa').show();};
  36. });
  37. newarrows();
  38. function loop(){
  39. $('.reply').not('.processed').each(function(){
  40. $(this).find('a[onclick*="highlightReply"]').not('.named').not('.post_no').each(function() {
  41. $(this).addClass('named');
  42. data = $(this).attr('onclick');
  43. data = data.split("'")[1]
  44. naje = $('#'+data+'').parent().find('.name:first').text();
  45. trip = $('#'+data+'').parent().find('.trip:first').text();
  46. nametrip = ' - '+ naje + trip +'';
  47. $(this).append(nametrip);
  48. });
  49. $(this).addClass('processed');
  50. });
  51. };
  52.  
  53. loop();
  54.  
  55. $(document).on('ajax_after_post, new_post', function (e, post) {
  56. loop();
  57. });