Picture of Misha G
jQuery Update v2.2.3 to v3.3.1
by Misha G - Monday, 26 March 2018, 8:35 PM
 

Hi,

My current build has jQuery 2.2.3 and I wish to upgrade it to 3.3.1.

I've added the jquery-3.3.1.min.js into the core libraries folder: "\adapt_framework\src\core\js\libraries", but it didn't seem to have added the file into my course. My second attempt was to go inside the course's folder: "\adapt_authoring\temp\#Adapt#\adapt_framework\courses\#Course#\build\libraries" and place the jQuery file inside. My third attempt was to rename the file into jquery.v331.js, since I wasn't sure if the extra dots were affecting the file not appearing.

Every time I preview the course and look inside the inspect element, I can't find the 3.3.1 version in the head tag.

Since I wasn't in charge of setting up adapt, I was wondering if there was a specific file that I had to edit for the new jQuery version to appear?

Thank you :)


Picture of Matt Leathes
Re: jQuery Update v2.2.3 to v3.3.1
by Matt Leathes - Tuesday, 27 March 2018, 9:11 AM
 

Hi Misha

Yes, it's here.

Since I don't really use the authoring tool I'm not even going to attempt to explain how you might get that changed properly in an authoring tool install.

What I can tell you is that jQueryv3 breaks old versions of the Slider plugin so you need to make sure you're using the very latest version of that if you need it in your course.

Also the latest version of the framework (v3.0.0) already has jQuery v3.3.1 - but you can't use it with the authoring tool yet. I'm sure an update to the authoring tool will follow soon though.

Picture of Misha G
Re: jQuery Update v2.2.3 to v3.3.1
by Misha G - Tuesday, 27 March 2018, 4:09 PM
 

Hi Matt,

Thanks for your reply!

I've been doing trials and error for about 2hours and i'm starting to go crazy.

Every changes that i've made seems to never show up the jQuery 3.3.1 file in the developer tool under Source. Here were my steps:

  1. under "/adaptlearning/adapt_authoring/adapt_framework/src/core/js/scriptLoader.js", I've changed the jquery.v2.js to the jquery.v3 file.

  2. I realised that there was a temp folder and that a scriptLoader.js file was under the same path structure as the adapt_framework. I've modified the jquery.v2.js as well.

  3. Inside that same scriptLoader.js, I realised that other files in the "libraries" folder were declared. I've gave it a shot and declared the jquery.v3 file and load it in the LoadFoundationLibraries function.

  4. under "/adaptlearning/adapt_authoring/grunt/config/copy.js", I realised that the jquery.v2.js file was declared, So I tried to declare the jquery v3 file.

  5. I then went directly to the course's folder and under "\build\adapt\js\scriptLoader.js", i've added the same lines of jquery like the other script.Loader.js. In that same course, i've added respectfully the jquery.v3.js file under "\build\libraries".

Image references linked

I have no idea what i'm doing wrong and what other file is preventing to load jquery.v331.js.

Is there an easy way to load jquery.v2.js and jquery.v3.js?

Thanks a lot.

 





Picture of Matt Leathes
Re: jQuery Update v2.2.3 to v3.3.1
by Matt Leathes - Wednesday, 28 March 2018, 4:28 PM
 

Well you're certainly right about needing to update the Grunt 'copy' task - apologies I'd forgotten this was referenced in there.

You really shouldn't need to amend anything in scriptLoader.js except that line in the loadJQuery function though.

Is there an easy way to load jquery.v2.js and jquery.v3.js?

I'm not sure loading both is a good idea... why do you want to do that?

As to how you make all this work in the authoring tool install... that I can't help you with as I just don't know the underlying structure of the authoring tool well enough to be able guide you accurately - sorry.

Picture of Misha G
Re: jQuery Update v2.2.3 to v3.3.1
by Misha G - Thursday, 29 March 2018, 3:11 PM
 

Thanks for the reply Matt. 

I'm not sure loading both is a good idea... why do you want to do that?

I was using a jQuery version 3 syntax and I was curious about how to update the jQuery versions for the future as well as how to add new libraries to adapt without using cdn.

I've modified my code to work with 2.4, so it works for now.

Thanks.

Picture of Matt Leathes
Re: jQuery Update v2.2.3 to v3.3.1
by Matt Leathes - Tuesday, 3 April 2018, 1:53 PM
 

If you want to include a library it's best to add a 'libraries' folder to your plugin - have a look at either the media or trickle plugins for some examples.

As I've mentioned, Adapt Framework v3.0.0 includes the very latest version of JQuery - and the next version of the Authoring tool will include support for Adapt v3.