Update included jQuery to 1.4

Bug #588645 reported by Douglas Cerna
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
CanDo
Fix Released
High
Gediminas Paulauskas
SchoolTool
Fix Released
High
Gediminas Paulauskas

Bug Description

CanDo was just moved to SchoolTool 1.4. Now, when you see the person view, the Sections and Groups widgets are not displayed correctly. These widgets should display trees grouped by school year.

The problem is simple: JSTree needs jQuery 1.4, but SchoolTool already has its own version of jQuery, 1.1.3

The solution: adjust scripts and plugins that need jQuery 1.4 to use the jQuery.noConflict(true) feature in jQuery. This makes possible to use several jQuery versions without clashes.

I tested the solution modifying the schooltool-1.4 egg in CanDo and it works, the widgets are displayed correctly again. CanDo also uses some other old jQuery plugins and this solution doesn't conflict with them.

Related branches

Changed in schooltool:
assignee: nobody → Douglas Cerna (replaceafill)
Revision history for this message
Tom Hoffman (tom-hoffman) wrote :

Presumably we'll eventually catch up and use jQuery 1.4 in SchoolTool? Do we get ours from a .deb?

Revision history for this message
Douglas Cerna (replaceafill) wrote :

No, it's added as a **file resource** in SchoolTool.

The 'jquery.min.js' is added to a directory; then it's registered using:

  <resource
      name="jquery14.js"
      file="resources/jstree/jquery.min.js"
      layer=".skin.IBasicPersonLayer" />

And then it's available for using in templates like:

    <script type="text/javascript"
            tal:attributes="src context/++resource++jquery14.js"></script>

which becomes:

    <script type="text/javascript"
            src="http://acc.candoskills.org:60020/@@/jquery14.js"></script>

in the user's browser.

Changed in schooltool:
status: New → Fix Committed
Revision history for this message
Gediminas Paulauskas (menesis) wrote :

Do we really need the old jQuery version? What plugins are used by CanDo or are there many scripts in it? Where in the interface I can see them to test if anything breaks?

We should upgrade jQuery in SchoolTool instead and not add workarounds like jQuery14.

Revision history for this message
Tom Hoffman (tom-hoffman) wrote :

I'm ok with correctly fixing this problem AFTER we get Welsh's fixes deployed.

Revision history for this message
Douglas Cerna (replaceafill) wrote :

In CanDo I've seen the plugins being used in the TreeView of Competencies, which I don't know if it's useful to the users, and I've seen jQuery code in the section-gradebook.js file, although again I don't know how it's used or it'll break with a new version of jQuery.

I also wonder if the Gradebook or the Journal use jQuery.

Changed in schooltool:
milestone: none → 1.4.1
importance: Undecided → High
Revision history for this message
Gediminas Paulauskas (menesis) wrote :

jsTree is registered only for IBasicPersonLayer, but INewCanDoLayer does not extend it, so resources are not picked up. INewCanDoSkin does, and that's the only difference between skin and layer. I suggest making the skin a BBB alias for the layer, as SchoolTool has done in 1.4. After that, the trees are displayed correctly even with schooltool 1.4.0.

Changed in cando:
assignee: nobody → Gediminas Paulauskas (menesis)
importance: Undecided → High
milestone: none → 2010.06.1
status: New → Confirmed
Revision history for this message
Gediminas Paulauskas (menesis) wrote :
Changed in cando:
status: Confirmed → Fix Committed
Changed in schooltool:
milestone: 1.4.1 → 1.4.2
Changed in cando:
status: Fix Committed → Fix Released
Changed in schooltool:
milestone: 1.4.2 → next
Changed in schooltool:
assignee: Douglas Cerna (replaceafill) → Gediminas Paulauskas (menesis)
milestone: next → 1.6.0
Revision history for this message
Gediminas Paulauskas (menesis) wrote :

Since the bug was reported, jQuery 1.5 was released, and is the version packaged for Ubuntu http://packages.ubuntu.com/natty/libjs-jquery . To match this, the included jQuery was upgraded to 1.5. No other changes were required.

summary: - JSTree/jQuery 1.4 break widgets in CanDo
+ Update included jQuery to 1.4
Changed in schooltool:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.