Come here to get the Block functionality for Wrongplanet

Page 1 of 4 [ 60 posts ]  Go to page 1, 2, 3, 4  Next

The_Face_of_Boo
Veteran
Veteran

User avatar

Joined: 16 Jun 2010
Age: 38
Gender: Male
Posts: 30,298
Location: Beirut, Lebanon.

17 Sep 2020, 11:23 am

....for Chrome.

It doesn't only hide the blocked user's posts forever, but also hide any posts that contain quotes from the blocked user.

Demonstration: https://www.youtube.com/watch?v=B-zITW9 ... el=cupcake


And at the button you can find an unblock list; to unblock those that you may have accidentally blocked.

Code:
  // ==UserScript==
  // @name         Block people.
  // @namespace    https://wrongplanet.net
  // @version      0.1
  // @description  try to take over the world! Muhahaha
  // @author       The_Face_of_Boo
  // @match        https://wrongplanet.net/*
  // @grant    GM.getValue
  // @grant    GM.setValue
  // ==/UserScript==
  (async () => {

      'use strict';

      let stringBlockList = await GM.getValue('stringBlockList');
      let blockList = stringBlockList ? stringBlockList.split(',') : [];
      let blockDiv = document.createElement("div");
      let unblockButton = document.createElement("button");
      document.body.appendChild(blockDiv);
      document.body.appendChild(unblockButton);
      //Create and append select list
      var selectList = document.createElement("select");
      selectList.size = "5";
      selectList.id = "mySelect";
      unblockButton.innerText = 'Unblock';
      blockDiv.appendChild(selectList);
      unblockButton.addEventListener("click", unblockMe, false);

      //Create and append the options
      blockList.forEach(blockedUser => {
          var option = document.createElement("option");
          option.value = blockedUser;
          option.text = blockedUser;
          selectList.appendChild(option);
      })

      console.log(blockList);
      let elements = document.querySelectorAll('div.row');
      let blockButtonHtml = `<button class="myButton"  style='background:darkred'>Block</button>`;

      function blockMe(evt) {
          blockList.push(evt.currentTarget.user);
          GM.setValue('stringBlockList', blockList.toString());
          window.alert(evt.currentTarget.user + " is blocked");
          location.reload();
      }

      function unblockMe() {
          let select = document.getElementById("mySelect");
          let user = select.options[select.selectedIndex].value;

          let index = blockList.findIndex(e => e == user);
          let newlist = removeItemWithSlice(index, blockList);
          GM.setValue('stringBlockList', newlist.toString());
          window.alert(user + " is unblocked");
          location.reload();
      }


      function removeItemWithSlice(index, arr) {
          return [...arr.slice(0, index), ...arr.slice(index + 1)]
      }


      elements.forEach((element, index) => {
          let user = element.querySelector('.user-col').querySelector('p').querySelector('a').innerText;

          ///adding the block button for each post in page
          let buttonsRow = element.querySelector('.action-bar');
          buttonsRow.insertAdjacentHTML('beforeend', blockButtonHtml);
          let blockButton = buttonsRow.querySelector('.myButton');
          if (blockButton) {
              blockButton.addEventListener("click", blockMe, false);
              blockButton.user = user;
          }

          if (blockList.includes(user)) {
              elements[index].remove();
          }

          ///Removing posts with blocked people's quotes.
          let quoteElements = element.querySelectorAll('.quotetitle') || [];
          quoteElements.forEach(el => {
              let trimmed = el.textContent.trim();
              let replaced = trimmed.replace('wrote:', '').trim();
              if (blockList.includes(replaced)) {
                  elements[index].remove();
              }
          });
      });
  })();



That someone else's video shows how to add the script: https://www.youtube.com/watch?v=RpjvLpy ... nel=JayJay



The_Face_of_Boo
Veteran
Veteran

User avatar

Joined: 16 Jun 2010
Age: 38
Gender: Male
Posts: 30,298
Location: Beirut, Lebanon.

20 Sep 2020, 5:42 am

Note: you can remove

Quote:
style='background:darkred'>Block</button>`
from code if the red color annoys you.


_________________
Come here to get the Block functionality for Wrongplanet:
viewtopic.php?f=13&t=390645


League_Girl
Veteran
Veteran

User avatar

Joined: 4 Feb 2010
Gender: Female
Posts: 25,688
Location: Pacific Northwest

22 Sep 2020, 12:28 am

Well this was easier than I thought. All I did was I copied and pasted the code when adding a new script and went to file and selected save and done. That simple.

Thank you, I have been wanting this feature.


_________________
Son: Diagnosed w/anxiety and ADHD. Also academic delayed.

Daughter: NT, no diagnoses.


League_Girl
Veteran
Veteran

User avatar

Joined: 4 Feb 2010
Gender: Female
Posts: 25,688
Location: Pacific Northwest

22 Sep 2020, 1:19 am

Just a warning when you use this block button, when you block people, threads may not always make sense because you would have no way of seeing the ignored content and there would be no hint they had posted in it and you won't see their quotes either and you would only see the user's post but not the ignored content they quoted. There will be no option given to viewed the ignored content like other forums do.

Just pros and cons to blocking people. Threads may not make sense and it will look like some users are talking to themselves or having an argument with themselves.


_________________
Son: Diagnosed w/anxiety and ADHD. Also academic delayed.

Daughter: NT, no diagnoses.


Pepe
Veteran
Veteran

User avatar

Joined: 11 Jun 2013
Gender: Male
Posts: 13,692
Location: Australia

22 Sep 2020, 2:13 am

League_Girl wrote:
Well this was easier than I thought. All I did was I copied and pasted the code when adding a new script and went to file and selected save and done. That simple.

Thank you, I have been wanting this feature.


Testing, testing, testing. :mrgreen:


_________________
Laughter is the best medicine. Age-appropriate behaviour is an arbitrary NT social construct.
Don't tell me white lies. Gaslight me at your peril. Don't give me your bad attitude. Hypnosis, psychosis. Tomarto, tomayto. "Go after people and not institutions; people hurt faster than institutions." I didn't say that. Honey badger.
If I'm so bad, pass me by. ;)


And one more thing,


"A stranger is a friend gang-stalker you haven't met yet." Humour is not meant to be taken seriously, yet many on the left pervert its intent.
Truth may be inconvenient but it is never politically incorrect...The Oracle of Truth has spoken...8)


THERE WILL BE NO COUP IN AMERICA!


Pepe
Veteran
Veteran

User avatar

Joined: 11 Jun 2013
Gender: Male
Posts: 13,692
Location: Australia

22 Sep 2020, 2:16 am

League_Girl wrote:
Just a warning when you use this block button, when you block people, threads may not always make sense because you would have no way of seeing the ignored content and there would be no hint they had posted in it and you won't see their quotes either and you would only see the user's post but not the ignored content they quoted. There will be no option given to viewed the ignored content like other forums do.

Just pros and cons to blocking people. Threads may not make sense and it will look like some users are talking to themselves or having an argument with themselves.


I'd want the option to read the entire post.

I just scroll down posts from people I am not interested in.
Can someone explain why that isn't good enough? Seriously? :scratch:


_________________
Laughter is the best medicine. Age-appropriate behaviour is an arbitrary NT social construct.
Don't tell me white lies. Gaslight me at your peril. Don't give me your bad attitude. Hypnosis, psychosis. Tomarto, tomayto. "Go after people and not institutions; people hurt faster than institutions." I didn't say that. Honey badger.
If I'm so bad, pass me by. ;)


And one more thing,


"A stranger is a friend gang-stalker you haven't met yet." Humour is not meant to be taken seriously, yet many on the left pervert its intent.
Truth may be inconvenient but it is never politically incorrect...The Oracle of Truth has spoken...8)


THERE WILL BE NO COUP IN AMERICA!


League_Girl
Veteran
Veteran

User avatar

Joined: 4 Feb 2010
Gender: Female
Posts: 25,688
Location: Pacific Northwest

22 Sep 2020, 2:38 am

Pepe wrote:
League_Girl wrote:
Just a warning when you use this block button, when you block people, threads may not always make sense because you would have no way of seeing the ignored content and there would be no hint they had posted in it and you won't see their quotes either and you would only see the user's post but not the ignored content they quoted. There will be no option given to viewed the ignored content like other forums do.

Just pros and cons to blocking people. Threads may not make sense and it will look like some users are talking to themselves or having an argument with themselves.


I'd want the option to read the entire post.

I just scroll down posts from people I am not interested in.
Can someone explain why that isn't good enough? Seriously? :scratch:



Some members here have OCD and they cannot skip over posts from a user because they cannot fight that compulsion to read it.

But this is just a heads up for anyone if they want to use this block feature.


_________________
Son: Diagnosed w/anxiety and ADHD. Also academic delayed.

Daughter: NT, no diagnoses.


Joe90
Veteran
Veteran

User avatar

Joined: 23 Feb 2010
Gender: Female
Posts: 19,241
Location: South-East England

22 Sep 2020, 2:19 pm

I bet most people have blocked me and that is why my posts often don't get read.... 8O


_________________
Female
Aged 30
On antidepressants
Diagnosed with AS, ADHD and anxiety disorder
Empathy score: 61 out of a possible 80. (High)


Lunella
Veteran
Veteran

User avatar

Joined: 2 Mar 2016
Gender: Female
Posts: 917
Location: West Yorkshire, UK

22 Sep 2020, 2:22 pm

I think you can get like addon packs for these type of forums, might be worth the admins getting some so we have more functionality.


_________________
Learning is the key to everything ♡ ♡ ♡
The GYM Thread


kraftiekortie
Veteran
Veteran

User avatar

Joined: 4 Feb 2014
Gender: Male
Posts: 73,396
Location: Queens, NYC

22 Sep 2020, 6:41 pm

I doubt that anybody has blocked Joe (Is she kidding?)



VegetableMan
Veteran
Veteran

Joined: 11 Jun 2014
Gender: Male
Posts: 3,685
Location: Illinois

22 Sep 2020, 6:47 pm

I would never want to block anyone. I'm up for all feedback on my content -- even death threats if worded nicely.


_________________
Democrats and Republicans calling each other out for being corrupt is like the Lucchese crime family pointing fingers at the Gambino crime family for being crooks and murderers.


Joe90
Veteran
Veteran

User avatar

Joined: 23 Feb 2010
Gender: Female
Posts: 19,241
Location: South-East England

22 Sep 2020, 7:14 pm

kraftiekortie wrote:
I doubt that anybody has blocked Joe (Is she kidding?)


Well people have often blocked me for no reason on Facebook. I only block someone if they are a threat to my privacy or keep harassing and bullying me, but otherwise I don't go around blocking people.
But the mods on WP deals with bullying and harassment rather efficiently so I don't really see a reason or any point in blocking people here. Some people just use block features to be petty, spiteful or childish.


_________________
Female
Aged 30
On antidepressants
Diagnosed with AS, ADHD and anxiety disorder
Empathy score: 61 out of a possible 80. (High)


Pepe
Veteran
Veteran

User avatar

Joined: 11 Jun 2013
Gender: Male
Posts: 13,692
Location: Australia

22 Sep 2020, 9:54 pm

League_Girl wrote:
Pepe wrote:
League_Girl wrote:
Just a warning when you use this block button, when you block people, threads may not always make sense because you would have no way of seeing the ignored content and there would be no hint they had posted in it and you won't see their quotes either and you would only see the user's post but not the ignored content they quoted. There will be no option given to viewed the ignored content like other forums do.

Just pros and cons to blocking people. Threads may not make sense and it will look like some users are talking to themselves or having an argument with themselves.


I'd want the option to read the entire post.

I just scroll down posts from people I am not interested in.
Can someone explain why that isn't good enough? Seriously? :scratch:



Some members here have OCD and they cannot skip over posts from a user because they cannot fight that compulsion to read it.

But this is just a heads up for anyone if they want to use this block feature.


How many is "some"? :scratch:


_________________
Laughter is the best medicine. Age-appropriate behaviour is an arbitrary NT social construct.
Don't tell me white lies. Gaslight me at your peril. Don't give me your bad attitude. Hypnosis, psychosis. Tomarto, tomayto. "Go after people and not institutions; people hurt faster than institutions." I didn't say that. Honey badger.
If I'm so bad, pass me by. ;)


And one more thing,


"A stranger is a friend gang-stalker you haven't met yet." Humour is not meant to be taken seriously, yet many on the left pervert its intent.
Truth may be inconvenient but it is never politically incorrect...The Oracle of Truth has spoken...8)


THERE WILL BE NO COUP IN AMERICA!


Pepe
Veteran
Veteran

User avatar

Joined: 11 Jun 2013
Gender: Male
Posts: 13,692
Location: Australia

22 Sep 2020, 9:55 pm

Joe90 wrote:
I bet most people have blocked me and that is why my posts often don't get read.... 8O

I've blocked you, hence my not replying to this post. :mrgreen:


Lunella wrote:
I think you can get like addon packs for these type of forums, might be worth the admins getting some so we have more functionality.


Until then, you're stuck with me. :mrgreen:


_________________
Laughter is the best medicine. Age-appropriate behaviour is an arbitrary NT social construct.
Don't tell me white lies. Gaslight me at your peril. Don't give me your bad attitude. Hypnosis, psychosis. Tomarto, tomayto. "Go after people and not institutions; people hurt faster than institutions." I didn't say that. Honey badger.
If I'm so bad, pass me by. ;)


And one more thing,


"A stranger is a friend gang-stalker you haven't met yet." Humour is not meant to be taken seriously, yet many on the left pervert its intent.
Truth may be inconvenient but it is never politically incorrect...The Oracle of Truth has spoken...8)


THERE WILL BE NO COUP IN AMERICA!


Lunella
Veteran
Veteran

User avatar

Joined: 2 Mar 2016
Gender: Female
Posts: 917
Location: West Yorkshire, UK

22 Sep 2020, 10:18 pm

Pepe wrote:
Lunella wrote:
I think you can get like addon packs for these type of forums, might be worth the admins getting some so we have more functionality.


Until then, you're stuck with me. :mrgreen:


You're like the little adorable forum pet, who would block you *pat pat* ♡ ♡


_________________
Learning is the key to everything ♡ ♡ ♡
The GYM Thread


bcousins
Veteran
Veteran

User avatar

Joined: 1 May 2011
Age: 25
Gender: Male
Posts: 801
Location: On a failed Tangara set at Blacktown

23 Sep 2020, 9:29 pm

Lunella wrote:
I think you can get like addon packs for these type of forums, might be worth the admins getting some so we have more functionality.


You can - but some websites are more customised behind the scenes than others, and sometimes addons don't play as nice.


_________________
Want another alternative to WrongPlanet?
https://aspergers.network/forums/ <- New Version Coming (hopefully) soon.