We are moving to Git Issues for bug tracking in future releases. During transition, content will be in both tools. If you'd like to file a new bug, please create an issue.

Bug 6294 - OMP clean-up: introduce JavaScript framework
OMP clean-up: introduce JavaScript framework
Product: OMP
Classification: Unclassified
Component: User Interface
PC Linux
: P3 normal
Assigned To: PKP Support
Depends on:
  Show dependency treegraph
Reported: 2010-12-08 11:52 PST by jerico
Modified: 2011-03-18 00:56 PDT (History)
0 users

See Also:
Version Reported In:
Also Affects:


Note You need to log in before you can comment on or make changes to this bug.
Description jerico 2010-12-08 11:52:19 PST
We currently have several different approaches to handle forms. The ones I could identify are:
- ad-hoc form handling in the templates
- several methods in modal.js
- jquery's form plugin (look out for ajaxForm() and ajaxSubmit())

The same is true for modal handling:
- ad-hoc modals
- different modal types created via the functions in modal.js

Both, form handling code and modal handling code seems repetitive and inconsistent (e.g. sometimes client-side validation is integrated, sometimes not). I think there's quite some potential for refactoring here. I propose that we divide the existing approaches into smaller standardized building blocks (function-based or object-oriented) and then re-assemble them into larger units to avoid code duplication and present a more consistent and easier to use interface to client code.

This also includes better standardization of LinkActions. The different link action types and modes are not very well thought out and grew quite wildly.

I think that we should create a close link between standard UI design elements and standardized implementation alternatives. We also should decide whether we want to use the form plug-in either everywhere or nowhere. Same for the validation plug-in.
Comment 1 jerico 2010-12-25 23:16:03 PST
Basic infrastructure, see:

Standard widget library, see:

Reference implementation, see commits in bug #6125

Please see the full documentation here: http://pkp.sfu.ca/wiki/index.php?title=JavaScript_coding_conventions
Comment 2 jerico 2010-12-27 21:33:45 PST
bug fixes and improvements: https://github.com/pkp/pkp-lib/commit/a0cd22de80a865aa0704e3d4a78fa958cb2216f3
Comment 4 jerico 2011-01-10 00:01:15 PST
Remote operations for confirmation modal:

Improved event handling capabilities:

Distinct externals for checking and compiling:
Comment 5 jerico 2011-01-10 00:04:01 PST
Fixed a small compilation error:
Comment 7 jerico 2011-03-18 00:56:12 PDT
Fix a bug introduced by the OS-X version of buildjs.sh:

Introduced an ajax link action request that does not break encapsulation: