0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00
ghost/core/client
Gabor Javorszky 6c99b67ab3 Added client side validation
Closes #581.

* Basically adds the client side of node validator, that we're already using
* Validator is plonked onto `Ghost.Validator`
* Usage is identical as to https://github.com/chriso/node-validator
* Has sanitizing values et al
* `Ghost.Validator.error` is redefined, it populates Ghost.Validator._errors (Array)
* `Ghost.Validator.handleErrors` is supposed to print out the multiple error messages, if there are multiple (this is broken due to how notifications are presented `.html` instead of `.append`), and also apply class to element
* The ajax calls are wrapped in an if to prevent network traffic if something's not right on client side
* Added validation to general settings and user settings screens.
* On validation error, optionally adds `.input-error` to whatever element you reference, see below (if `el` exists on the error object). This is the only place where usage is different to the original implementation. Redeclared `error()` function in `init.js`
* Usage: `Ghost.Validate.check(valueToCheck, {message: "the error message", el: $('#the element')}).isEmail()`
* The element above will receive the `.input-error` class. `isEmail()` is one of the stuff you can check against.
2013-09-14 10:52:27 +01:00
..
assets Added client side validation 2013-09-14 10:52:27 +01:00
helpers rename helpers paginate -> pagination, dateFormat -> date 2013-08-22 20:42:54 +01:00
models Fix for image upload with clean database 2013-09-11 16:45:59 +00:00
tpl Added client side validation 2013-09-14 10:52:27 +01:00
views Added client side validation 2013-09-14 10:52:27 +01:00
init.js Added client side validation 2013-09-14 10:52:27 +01:00
markdown-actions.js Shortcut for italic inserts _ instead of * 2013-09-07 16:38:04 +01:00
mobile-interactions.js Removed swiping from Mobile Interactions 2013-08-19 16:13:47 +01:00
router.js Merge pull request #686 from matthojo/Sign-up-screen-UI 2013-09-12 06:25:27 -07:00
toggle.js App restructure - closes #245 2013-07-11 20:23:34 +01:00