VuFind

Javascript Cleanup/Reorganization

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.1
  • Component/s: User Interface
  • Labels:
    None

Description

Right now, VuFind is using an old version of YUI. Javascript files are scattered in a lot of different locations. Some redundant and unused functions exist. We should try to reorganize to minimize redundancy, and where possible, use centralized library-agnostic support functions to make upgrading (or even switching to a different library) easier.

Activity

Hide
Demian Katz added a comment -
More use of JSON in preference to XML would probably be a good goal during refactoring as well.
Show
Demian Katz added a comment - More use of JSON in preference to XML would probably be a good goal during refactoring as well.
Hide
Demian Katz added a comment -
As of r3046, we have upgraded to the latest version of the YUI 2 library. Over the past few months, much of the redundancy and unused functionality has also been cleaned up.

I still think a major reorganization may be in order; while the idea of centralized, library-agnostic support functions probably isn't practical, it may make sense to tie Javascript code more closely to themes so that different themes can implement different libraries without as much code floating around in VuFind's core. Feel free to comment here if you have thoughts/opinions on this.
Show
Demian Katz added a comment - As of r3046, we have upgraded to the latest version of the YUI 2 library. Over the past few months, much of the redundancy and unused functionality has also been cleaned up. I still think a major reorganization may be in order; while the idea of centralized, library-agnostic support functions probably isn't practical, it may make sense to tie Javascript code more closely to themes so that different themes can implement different libraries without as much code floating around in VuFind's core. Feel free to comment here if you have thoughts/opinions on this.
Hide
Demian Katz added a comment -
The new blueprint theme (see VUFIND-353) has completely self-contained Javascript, loaded via a {js} custom Smarty function. It also uses JSON instead of XML for all of its AJAX handling. I will work on converting the existing themes to share as much of this infrastructure as possible.
Show
Demian Katz added a comment - The new blueprint theme (see VUFIND-353) has completely self-contained Javascript, loaded via a {js} custom Smarty function. It also uses JSON instead of XML for all of its AJAX handling. I will work on converting the existing themes to share as much of this infrastructure as possible.
Hide
Demian Katz added a comment -
As of r3569, all XML AJAX responses have been replaced with JSON.
Show
Demian Katz added a comment - As of r3569, all XML AJAX responses have been replaced with JSON.
Hide
Demian Katz added a comment -
As of r3590, all library-specific (YUI or jQuery) Javascript files have been moved inside their related themes. For the moment, this means that only the library-agnostic, generic rc4.js library remains in the root web/js folder. This admittedly has the downside of increasing redundancy -- the YUI code is now duplicated inside the classic and default themes -- but this is a small price to pay for better organization, especially since it is likely that at least one of the YUI themes will be deprecated sooner or later.
Show
Demian Katz added a comment - As of r3590, all library-specific (YUI or jQuery) Javascript files have been moved inside their related themes. For the moment, this means that only the library-agnostic, generic rc4.js library remains in the root web/js folder. This admittedly has the downside of increasing redundancy -- the YUI code is now duplicated inside the classic and default themes -- but this is a small price to pay for better organization, especially since it is likely that at least one of the YUI themes will be deprecated sooner or later.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: