Discuss Scratch

__init__
Scratcher
1000+ posts

I made a userscript that removes every nav link and adds "Discuss"


// ==UserScript==
// @name        Scratch Discuss Link Adder
// @namespace   __init__.scratchdiscuss
// @description The only link you need
// @include     https://scratch.mit.edu/*
// @version     1
// @grant       none
// ==/UserScript==
window.addEventListener('load', function() {
    if (document.getElementsByClassName("site-nav")[0]) {
        // Old site
        nav = document.getElementsByClassName("site-nav")[0];
        nav.innerHTML = "<li><a href=\"/discuss/\">Discuss</a></li>";
    } else {
        // New site
        for (i of [
            document.getElementsByClassName("create")[0],
            document.getElementsByClassName("explore")[0],
            document.getElementsByClassName("about")[0]
          ]) {
          i.remove();
        }
        
        tips = document.getElementsByClassName("tips")[0];
        tips.innerHTML = "<a href=\"/discuss/\"><span>Discuss</span></a>";
    }
}, false);
install

Last edited by __init__ (July 7, 2017 22:19:01)

SimpleScratch
Scratcher
100+ posts

I made a userscript that removes every nav link and adds "Discuss"

Doesn't work for me in Chrome/Win10
MegaApuTurkUltra
Scratcher
1000+ posts

I made a userscript that removes every nav link and adds "Discuss"

+1

^ it's joke
this is also joke:
ae2d2bcb-e9e3-4f9c-a847-290d71bd8bfd 222ec087-6694-42cf-8c41-064e9066f004
aWFtbml0cm9jaXBoZXI=80d463228430e6da3d72d989f4a27aca 80d463228430e6da3d72d989f4a27aca : 228430e6da3d72d989f4a27aca bf97b44a7fbd33db070f6ade2b7dc549 Vm0wd2QyVkZOVWRpUm1SWFYwZG9WbFl3WkRSV1ZsbDNXa1JTVjFadGVG
__init__
Scratcher
1000+ posts

I made a userscript that removes every nav link and adds "Discuss"

SimpleScratch wrote:

Doesn't work for me in Chrome/Win10
Are you getting any error messages in the console? (Press F12 and click on Console)
Blaze349
Scratcher
1000+ posts

I made a userscript that removes every nav link and adds "Discuss"

Precisely what I needed.
Jonathan50
Scratcher
1000+ posts

I made a userscript that removes every nav link and adds "Discuss"

You should at least spare Create.
__init__
Scratcher
1000+ posts

I made a userscript that removes every nav link and adds "Discuss"

Jonathan50 wrote:

You should at least spare Create.
Just go to My Stuff and click New Project. It's not that hard
SimpleScratch
Scratcher
100+ posts

I made a userscript that removes every nav link and adds "Discuss"

Are you getting any error messages in the console? (Press F12 and click on Console)
I don't get that far
Chrome won't let me install it - it says
Apps, extensions and user scripts cannot be added from this website
Calculator54
New to Scratch
8 posts

I made a userscript that removes every nav link and adds "Discuss"

It looks cool! But I use Midori web browser and it does not support user scripts.
herohamp
Scratcher
1000+ posts

I made a userscript that removes every nav link and adds "Discuss"

Jonathan50 wrote:

You should at least spare Create.
I only use scratch for AT

GUYS IF 7Snails get 200 followers he said he would delete his account! https://scratch.mit.edu/users/7Snails/
https://hampton.pw/ My Site
http://blobby.ga my game server that I run
MegaApuTurkUltra
Scratcher
1000+ posts

I made a userscript that removes every nav link and adds "Discuss"

SimpleScratch wrote:

Are you getting any error messages in the console? (Press F12 and click on Console)
I don't get that far
Chrome won't let me install it - it says
Apps, extensions and user scripts cannot be added from this website
Install tampermonkey first

^ it's joke
this is also joke:
ae2d2bcb-e9e3-4f9c-a847-290d71bd8bfd 222ec087-6694-42cf-8c41-064e9066f004
aWFtbml0cm9jaXBoZXI=80d463228430e6da3d72d989f4a27aca 80d463228430e6da3d72d989f4a27aca : 228430e6da3d72d989f4a27aca bf97b44a7fbd33db070f6ade2b7dc549 Vm0wd2QyVkZOVWRpUm1SWFYwZG9WbFl3WkRSV1ZsbDNXa1JTVjFadGVG
SimpleScratch
Scratcher
100+ posts

I made a userscript that removes every nav link and adds "Discuss"

Install tampermonkey first

Is that safe for an old codger like me to use?
MegaApuTurkUltra
Scratcher
1000+ posts

I made a userscript that removes every nav link and adds "Discuss"

SimpleScratch wrote:

Install tampermonkey first

Is that safe for an old codger like me to use?
Just don't go around installing random userscripts without reading the source first. Otherwise yes

Last edited by MegaApuTurkUltra (July 7, 2017 21:11:07)


^ it's joke
this is also joke:
ae2d2bcb-e9e3-4f9c-a847-290d71bd8bfd 222ec087-6694-42cf-8c41-064e9066f004
aWFtbml0cm9jaXBoZXI=80d463228430e6da3d72d989f4a27aca 80d463228430e6da3d72d989f4a27aca : 228430e6da3d72d989f4a27aca bf97b44a7fbd33db070f6ade2b7dc549 Vm0wd2QyVkZOVWRpUm1SWFYwZG9WbFl3WkRSV1ZsbDNXa1JTVjFadGVG
__init__
Scratcher
1000+ posts

I made a userscript that removes every nav link and adds "Discuss"

For some reason, with the userscript enabled, the post editor buttons and the message count disappears. This doesn't happen when I run the code from the JavaScript console. Any idea why?

Do I need to somehow load the userscript at a different time?
SimpleScratch
Scratcher
100+ posts

I made a userscript that removes every nav link and adds "Discuss"

Just don't go around installing random userscripts without reading the source first. Otherwise yes

Thanks
SimpleScratch
Scratcher
100+ posts

I made a userscript that removes every nav link and adds "Discuss"

Ok - all working

… but bit of an overkill I see

How do I remove it when I want to see the original site?
__init__
Scratcher
1000+ posts

I made a userscript that removes every nav link and adds "Discuss"

SimpleScratch wrote:

Ok - all working

… but bit of an overkill I see

How do I remove it when I want to see the original site?
There should be a menu in the top right hand corner where you can disable userscripts?

I'm not entirely sure how it works on Chrome, as I use Firefox personally
__init__
Scratcher
1000+ posts

I made a userscript that removes every nav link and adds "Discuss"

__init__ wrote:

For some reason, with the userscript enabled, the post editor buttons and the message count disappears. This doesn't happen when I run the code from the JavaScript console. Any idea why?

Do I need to somehow load the userscript at a different time?
Making the script run after page load fixed it. It works now
SimpleScratch
Scratcher
100+ posts

I made a userscript that removes every nav link and adds "Discuss"

There should be a menu in the top right hand corner where you can disable userscripts?
Yep - got it
Imagine if these forums die - information like this would not get shared out amongst us!
DatOneLefty
Scratcher
1000+ posts

I made a userscript that removes every nav link and adds "Discuss"

change it so it replaces everything with discuss instead of removing everything and only having discuss


Some stats
PowerEdge R710 x2 Intel Xeon X5650s (12 cores @ 2.66 GHz), 40 GB of RAM, 9.5 TB of storage
The system is running Proxmox with multiple Ubuntu 16.04.3 Server VMs

Check out my GitHub

Posts: bf97b44a7fbd33db070f6ade2b7dc549

Powered by DjangoBB

Standard | Mobile