jQuery dropped from QuestJS

I have made the decision to remove jQuery from QuestJS.

What prompted me to do so was a warning in the console about some code in it. The warning does not matter, but it made me re-evaluate whether we need it. As a general principle, I want to keep dependencies to a minimum (Awesome fonts being the only one left now).

jQuery at one time was an excellent tool for handling the interface, but JavaScript and HTML have come a long way, and now you just do not need it for most things.

So what changes do I need to do?

If you were using $.extend to merge objects/dictionaries, this should be changed to Object.assign. Where I was using that was to extend templates, and if you followed the docs, you will be too.

There is a function that can be used to ask for text input. It was previously "askQuestion"; it is now "askText" and there is an "askDiag" function that does it through a dialog.

If you have custom stuff going on the the UI, you may have further changes. jQuery commands nearly always start with a dollar sign, so should be obvious.

Also, afterFinish and afterTurn are now an array of functions, not a single function, so libraries can add to them.

Is Everything Updated?

No... I have yet to do the RPG library and sliders.

I have done starting dialogs, item links, menus, text input. Have I missed anything?

But I really need jQuery!

You can edit index.html and add these lines at line 13.

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>

I would advise not to, but there may be things that you still need it for.

Well played, sir.

I decided to stop adding jQuery-dependent code a few months ago, anyway (just to see if I could do it).

So, you'll hear no complaints out of me*.

* You'll hear no complaints out of me concerning the lack of jQuery in QuestJS.

This topic is now closed. Topics are closed after 60 days of inactivity.