MegaScratchUserscript / Mega-Scratch-Userscript

A mega userscript for Scratch containing a lot of useful features (eventually, hopefully...)
http://scratch.mit.edu/discuss/topic/57450/
Apache License 2.0
18 stars 6 forks source link

Modularization #2

Closed MegaApuTurkUltra closed 10 years ago

MegaApuTurkUltra commented 10 years ago

As I said on the forum topic, I think we should modularize this for development. This will make the code easier to understand (not so much scrolling!) and will enable us to be able to work on different things at the same time without having to git pull all the time. Then for the release, we can put all the code together.

MegaApuTurkUltra commented 10 years ago

See my new idea for an outline: http://scratch.mit.edu/discuss/topic/57450/?page=1#post-487136

MegaApuTurkUltra commented 10 years ago

I'm hoping base.user.js can eventually manage the settings GUI to enable and disable features, and act as a loader for the parts of the script needed.

PullJosh commented 10 years ago

If it could do all that, I would (be impressed, but also) be willing to say it's the best option there is.

matthewr6 commented 10 years ago

Anyone willing to comment out what things do?

(as said I've never done userscripts although I'm familiar with JS)

Also, how do I run the script(s)?

MegaApuTurkUltra commented 10 years ago

You'll need Greasemonkey (FF) or Tampermonkey (Chrome), then just install them on the extension options page

PullJosh commented 10 years ago

Once you install a userscript manager (one of the ones MegaApuTurkUltra mentioned above), just click the "raw" button on any userscript in this repo. Your manager should open a page or popup or something allowing you to install the userscript. Just click "yes" or "install" or whatever and it should start working immediately. :)

matthewr6 commented 10 years ago

How do I create a userscript? I know how to work with jQuery (and all Scratch pages load it) but do I need any special setup?

PullJosh commented 10 years ago

Not really. Just write a regular js file, and then save it with the extension .user.js The only difference is that you have to add a "Metadata Block" to the top of your code. See the userscripts in the "originals" folder, or go here.

PullJosh commented 10 years ago

Whoops, just realized I forgot the metadata block in my own scripts. :3 I'll add them in tomorrow... I have quite a lot of homework tonight.

matthewr6 commented 10 years ago

yay first userscript!

$('<li><a href="//wiki.scratch.mit.edu">Wiki</a></li>').insertBefore('.site-nav .last');

:P

Any ideas on extensions? I know that one's already been made.

PullJosh commented 10 years ago

I was gonna say "I already made that", except then I saw that you saw that I did it. :P

matthewr6 commented 10 years ago

Yeah :P Gotta love instant chat!

matthewr6 commented 10 years ago

crap closed

djdolphin commented 10 years ago

See my suggestion here: https://github.com/MegaScratchUserscript/Mega-Scratch-Userscript/issues/4#issuecomment-59137698

PullJosh commented 10 years ago

Yes, do see it. I'm getting very excited about the idea of having readable code. Possibly overkill, but still, it's quite exciting. xD

matthewr6 commented 10 years ago

See it +1

MegaApuTurkUltra commented 10 years ago

Yep I think readable code is a good thing. In the spirit of open source we should make this easy to fork, should anyone want to. Also we each should be able to read everyone's code. So, make sure your var names are descriptive and add plenty of comments!

I'm closing this because it seems modularization is what we will do.