Just include jQuery in the samigo header and remove it everywhere else
Description
Attachments
- 05 Dec 2014, 10:13 PM
- 27 Nov 2014, 08:21 AM
depends on
incorporates
is depended on by
relates to
Activity
Sam Ottenhoff February 12, 2015 at 9:44 AM
tablesorter.com points to an unmaintained version by Github user christianbach. The code was forked and is being maintained here:
Charles R Severance December 6, 2014 at 9:05 AM
Raul and Sam, I just switched Samigo to use the exact approach for including JQuery as prescribed by the portal (and controlled by the portal) in https://sakaiproject.atlassian.net/browse/SAK-2447#icft=SAK-2447 / r315941 and the tablesorter error seems to have diappeared. Lets keep our eyes out for it. I htink it had to do with the way the portal was messing with jQuery before and after the Samigo head/body includes were done that might have tweaked the jQuery Samigo is using in small way. Now with the Portal namespacing its jQuery https://sakaiproject.atlassian.net/browse/SAK-28162#icft=SAK-28162 and the includeLatestJQuery() communitcating with the portal code - I think things are on the same page.
Charles R Severance December 5, 2014 at 10:13 PMEdited
Sam - Looking at Raul's issue, I am guessing the you switched all the versions of jQuery to 1.9.1 at this time - but it turns out that tablesorter is not happy with 1.9.1 - I checked and there is no upgrade to tablesorter and from this https://github.com/christianbach/tablesorter/blob/master/jquery-latest.js it looks like it prefers 1.4 I tried to fix it by adding jquery-migrate-1.2.1.min.js to header.inc and that seemed not to fix it. So I add this image in hopes that someone else can figure this out.
Matthew Jones November 27, 2014 at 8:21 AM
Screenshot of what we saw when merged into 10.x and attached to lessons. Some of it's blurred to protect the question but it basically put the answers all underneath the radio buttons. This looked like a javascript error.
Raúl Sánchez Vegas November 25, 2014 at 3:34 AMEdited
This error: "Uncaught TypeError: Cannot read property 'type' of undefined jquery.tablesorter-2.0.3.min.js:2" didn't happen this morning before the nightly(trunk) rebuilt at 10 a.m.
After the nightly(trunk) rebuilt at 10 a.m. this error happens again.
At 11 a.m. this error doesn't happen. It is a random error.
Samigo at the moment has random jQuery problems in some places because of how it embeds and includes sub pages. Because authoring.js introduced a requirement on jQuery (SAM-2288) unless jQuery is always loaded first the pages without it fail. If you load it up on the sub pages (mostly the question types) then you'll get an error because you might load it twice (From the work on SAM-2235).
I think there's two ways to go with this
1) Put in in more jsp files and include some check to see if jQuery is defined and/or do a noConflict to unload if necessary?
2) Remove the script tag for jquery everywhere and put it in only in the header.inc that's so it's always included by default for every page only once
3) Just remove the requirement on jQuery from authoring.js (see Comment #1 below)
I think option #1 is easiest. Option #2 seems like it would work but would require a little testing. Some errors are SAM-1817 (rich text problem), and when editing a question in a question pool it has some problems. It's hard to test at the moment as there's some other errors with Samigo on trunk.