Official Everybody Edits Forums

Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?

You are not logged in.

#1 2016-06-25 22:15:02, last edited by Koya (2016-10-02 19:20:39)

Koya
Fabulous Member
From: The island with those Brits
Joined: 2015-02-18
Posts: 6,310

[script] Removing the read notice on a post I don't want to read

If you've ever wanted to mark a single thread as read or a whole forum without visiting it, I have the solution

This also works for reading the whole forum (i.e. Forum Games) without entering it.
This does remove the read notice so if you refresh it is gone and not just simply removing styling.

Poen3c.gif
webm with cursor: https://i.koya.io/Cjnk3d.webm

Made this after stumbling on Gosha's post: http://forums.everybodyedits.com/viewto … 01#p576001

As HG has completely missed the point: you can mark something as read without going on it and you can mark individual ones as read, there are buttons already to mark all as read but that isn't always needed and it is at the bottom.
So to re-iterate: mark a forum as read from /index.php and mark a topic as read from /viewforum.php

You will need a plugin which allows you to run jQuery (I was lazy and made this in jQuery) - for Chrome you can do this with Styler

So you know I'm not just scamming you and getting woots I have explained what everything does on each line.
Just paste this in when on http://forums.everybodyedits.com/; if you have the options ensure this is allowed for /viewforum.php and /index.php (no need to worry for Styler viewers)

$(document).ready(function() { /*When the page loads*/
   if (window.location.pathname == "/viewforum.php") { /*This is to read topics*/
      var done = false;
      $("tr").hover(function() { /*Hovering an entry initialises the process*/
         if (!done) {done = true; /*Only do this one*/
            $(".icon-new").each(function(e) { /*Go through all icons which say they are new*/
               $(this).attr("rem", $(this).parent().find('.tclcon .newtext >a').attr('href')); /*The icon will now have the link of what I want the option to read*/
               $(this).attr("style", "cursor: pointer"); /*Add the pointer cursor so you know you can click it*/
            });
         }
      });
      $(".icon-new").click(function() { /*If/when you click on an icon*/
         $(this).removeClass("icon-new"); /*Remove styling*/
         $(this).parent().parent().removeClass("inew"); /*Remove styling*/
         $(this).parent().find("strong").attr("style", "font-weight:normal"); /*Remove bold text for title*/
         $("body").append('<iframe src="' + $(this).attr('rem') + '" frameborder="0" style="display:none"></iframe>'); /*Create an invisible iframe to the location of the topic*/
         $(this).attr("style", ""); /*Remove pointer*/
      });
      $("iframe").on("load", function() { /*As soon as the iframe loads*/
         $(this).remove(); /*Remove iframe*/
      });
   } else if (window.location.pathname == "/index.php") { /*This is to read forums*/
      var done = false;
      $("tr").hover(function() { /*Hovering an entry initialises the process*/
         if (!done) {done = true; /*Only do this one*/
            $(".icon-new").each(function(e) { /*Go through all icons which say they are new*/
               $(this).attr("rem", $(this).parent().find('.tclcon .newtext >a').attr('href').split('=')[2]); /*The icon will now have the ID of the forum to read*/
               $(this).attr("style", "cursor: pointer"); /*Add the pointer cursor so you know you can click it*/
            });
         }
      });
      $(".icon-new").click(function() { /*If/when you click on an icon*/
         $(this).removeClass("icon-new"); /*Remove styling*/
         $(this).parent().parent().removeClass("inew"); /*Remove styling*/
         $(this).parent().find("strong").attr("style", "font-weight:normal"); /*Remove bold text for title*/
         $("body").append('<iframe src="http://forums.everybodyedits.com/misc.php?action=markforumread&fid=' + $(this).attr('rem') + '" frameborder="0" style="display:none"></iframe>'); /*Create an invisible iframe to the location of remove forum read page*/
         $(this).attr("style", ""); /*Remove pointer*/
      });
      $("iframe").on("load", function() { /*As soon as the iframe loads*/
         $(this).remove(); /*Remove iframe*/
      });
   }
});

If you want to see it coloured go here: codepen

Edit: forgot to mention, it doesn't add a view to the topic being skipped so the view number should become accurate to people who care or the title is click-baity enough.


Po9cnQh.png

PLNQVL8.png
Thank you eleizibeth ^

1SYOldu.png

I stack my signatures rather than delete them so I don't lose them
giphy.gif

WfSi4mm.png

Offline

Wooted by: (4)

#2 2016-06-25 22:16:18, last edited by drunkbnu (2016-06-25 22:16:24)

drunkbnu
Formerly HG
Joined: 2017-08-16
Posts: 2,306

Re: [script] Removing the read notice on a post I don't want to read

There are the "Mark topics as read" and the "Mark forums as read" buttons.

Offline

#3 2016-06-25 22:17:03

Koya
Fabulous Member
From: The island with those Brits
Joined: 2015-02-18
Posts: 6,310

Re: [script] Removing the read notice on a post I don't want to read

HG wrote:

Thereare the "Mark topics as read" and the "Mark forums as read" buttons.

Not for single topics and you have to enter the forum to mark it as read, I can mark Forum Games as read from /index.php


Po9cnQh.png

PLNQVL8.png
Thank you eleizibeth ^

1SYOldu.png

I stack my signatures rather than delete them so I don't lose them
giphy.gif

WfSi4mm.png

Offline

#4 2016-06-26 12:37:41

Gosha
Member
From: Russia
Joined: 2015-03-15
Posts: 6,211

Re: [script] Removing the read notice on a post I don't want to read

Offline

#5 2016-06-26 12:42:05

Koya
Fabulous Member
From: The island with those Brits
Joined: 2015-02-18
Posts: 6,310

Re: [script] Removing the read notice on a post I don't want to read

I made this in response to Diff not adding it.


Po9cnQh.png

PLNQVL8.png
Thank you eleizibeth ^

1SYOldu.png

I stack my signatures rather than delete them so I don't lose them
giphy.gif

WfSi4mm.png

Offline

#6 2016-06-26 20:42:40

AlphaJon
Member
From: Who knows
Joined: 2015-07-21
Posts: 1,297

Re: [script] Removing the read notice on a post I don't want to read

Looks nice, but I only have one question:
Why hidden iframes and not just plain AJAX requests? These are much easier to handle if you ask me.

Offline

#7 2016-06-26 21:36:13

Koya
Fabulous Member
From: The island with those Brits
Joined: 2015-02-18
Posts: 6,310

Re: [script] Removing the read notice on a post I don't want to read

AlphaJon wrote:

Looks nice, but I only have one question:
Why hidden iframes and not just plain AJAX requests? These are much easier to handle if you ask me.

Because on my tests it didn't always work (I have no idea why), the iframes do.


Po9cnQh.png

PLNQVL8.png
Thank you eleizibeth ^

1SYOldu.png

I stack my signatures rather than delete them so I don't lose them
giphy.gif

WfSi4mm.png

Offline

Koya1466973373609820

Board footer

Powered by FluxBB

[ Started around 1738446674.2811 - Generated in 0.070 seconds, 11 queries executed - Memory usage: 1.48 MiB (Peak: 1.63 MiB) ]