2
1
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2023-12-13 21:00:40 +01:00
Ghost/core/server/views
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
..
partials Removed unused user menu items and linked "Help / Support" to the right place 2013-09-10 15:05:42 +01:00
content.hbs Temporarily remove unused Post Menu options 2013-09-10 13:53:01 +01:00
debug.hbs Data models import, export, and reset for 002 2013-08-05 13:56:30 +01:00
default.hbs Added client side validation 2013-09-14 10:52:27 +01:00
editor.hbs Added post-settings menu with edit permalink field 2013-09-13 12:36:38 -05:00
forgotten.hbs Improved Auth screen markup and validation checks 2013-09-12 09:59:58 +01:00
login.hbs Center login form with CSS instead of JS 2013-09-08 17:12:25 +02:00
settings.hbs Backbone template cleanup 2013-08-03 16:37:06 +01:00
signup.hbs Improved Auth screen markup and validation checks 2013-09-12 09:59:58 +01:00