Bug 6294 - OMP clean-up: introduce JavaScript framework
OMP clean-up: introduce JavaScript framework
Status: RESOLVED FIXED
Product: OMP
Classification: Unclassified
Component: User Interface
1.0
PC Linux
: P3 normal
Assigned To: PKP Support
Depends on:
Blocks:
  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:


Attachments

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:
https://github.com/pkp/pkp-lib/commit/79b83cde35ff06f63c9a9d875f32155c24b34f68

Standard widget library, see:
https://github.com/pkp/pkp-lib/commit/3a9d280d36fd9b6f940409fcc2a7d8ee3ff9e893

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:
https://github.com/pkp/pkp-lib/commit/5ea506aebabd004efbba78ebc914dc12dc241ac4

Improved event handling capabilities:
https://github.com/pkp/pkp-lib/commit/04ef1d644c2f56bfed1b68f167202a222455a1e6

Distinct externals for checking and compiling:
https://github.com/pkp/pkp-lib/commit/0ac1e96f3cca2ba9f5d4ee74ff531fed006cc1eb
Comment 5 jerico 2011-01-10 00:04:01 PST
Fixed a small compilation error:
https://github.com/pkp/pkp-lib/commit/6df738ef124c885c988cc67b769a2e5c297a24e7
Comment 7 jerico 2011-03-18 00:56:12 PDT
Fix a bug introduced by the OS-X version of buildjs.sh:
https://github.com/pkp/pkp-lib/commit/c003749be08ce83fe94a5834cfcc542841811e8b

Introduced an ajax link action request that does not break encapsulation:
https://github.com/pkp/pkp-lib/commit/ac97e2f252642a82331280f36f8de2e0f3494dd8