Happy Mistake? Javascript scripts come preloaded with jQuery

General discussion about the Genesis Web Client located at https://www.genesismud.org/play/

Moderator: Eowul

Forum rules
- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.
Post Reply
User avatar
Vlek
Wanderer
Posts: 71
Joined: 06 Apr 2014 07:40
Contact:

Happy Mistake? Javascript scripts come preloaded with jQuery

Post by Vlek » 23 May 2015 02:02

It appears that whatever is loaded by the window is also loaded within scripts as well. I know this might be a no brainer to some, but I wanted to share this in case anyone wanted to use jQuery that didn't want to load it themselves. There're a lot of stack overflow answers for basic scripting topics that are in jQuery that one or two people might've overlooked because they thought they couldn't readily use it.

As a side note, this also means that one can modify the client itself using scripts within aliases or triggers. I will definitely be exploring this to see if I can't add some of the features I requested and fix some of the bugs that I have found.

User avatar
cotillion
Site Admin
Posts: 350
Joined: 04 Mar 2010 01:14

Re: Happy Mistake? Javascript scripts come preloaded with jQ

Post by cotillion » 23 May 2015 11:09

You can use whatever javascript you want in the client.
If you break something you have to fix it yourself. :)

User avatar
Vlek
Wanderer
Posts: 71
Joined: 06 Apr 2014 07:40
Contact:

Re: Happy Mistake? Javascript scripts come preloaded with jQ

Post by Vlek » 23 May 2015 13:16

One thing that really has been bugging me is the fact that the whole alias and trigger divs will scroll based on how many you have in your selection list. I've come up with a pretty simple solution. I had a trigger already made for finding obvious exits that checks whether a function is defined in my userdata since functions seem to never save into userdata between game saves. If it's not defined, then I haven't loaded anything, so it also loads up this jQuery css changing bit to fix it:

Code: Select all

$('.content').css("overflow", "hidden");
$('.selection').css("overflow", "auto");
Now everything has its own scrollbar where it seems fitting that there should be one! Yes, in big scripts it'll make a U-shaped scrollbar outline of the script area, but it still feels right.

User avatar
cotillion
Site Admin
Posts: 350
Joined: 04 Mar 2010 01:14

Re: Happy Mistake? Javascript scripts come preloaded with jQ

Post by cotillion » 23 May 2015 13:33

That should be fixed in the next release.

User avatar
Vlek
Wanderer
Posts: 71
Joined: 06 Apr 2014 07:40
Contact:

Re: Happy Mistake? Javascript scripts come preloaded with jQ

Post by Vlek » 24 May 2015 02:13

Cool! Is there any way I can help?

Post Reply
http://tworzymyatmosfere.pl/przescieradla-jedwabne-z-gumka/