i18n + bootstrap prompt + compare and check rules#2
i18n + bootstrap prompt + compare and check rules#2janez89 wants to merge 13 commits intojpillora:gh-pagesfrom
Conversation
|
Hi Janez, Thanks for the PR! However, I'm actually half way through refactoring the rule system. Have a look through this directory structure: https://github.com/jpillora/verifyjs/tree/866e3e7177766c8e24225109f20927a9cafe3348/src/rules/core This branch, along with an upgrade to the website, will allow you to pick and choose validation modules and compile a custom version using only the rules that you need. For example Also, each rule will be preceeded by a simple documentation DSL, utilising dox to both generate the web page documentation and the module choosing tool, and to provide simple tests: $.verify.addFieldRules({
/**
* Ensures a valid email address
* @name email
* @type field
*
* @valid dev@jpillora.com
* @invalid devjpillora.com
* @invalid dev@jpillora.c
*/
email: {
regex: /^(([^<>()\[\]\\.,;:\s@\"]+(\.[^<>()\[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
message: "Invalid email address"
},Also languages will can be simply applied using $.verify.updateRules({
email: {
message: "Adresse email invalide"
},The testing suite will run each I'll definitely add a hungarian language file and your added rules, and a rule to do simple async Will leave this open so it's not forgotten 👍 Comments and suggestions welcome! |
|
Also, RE: Bootstrap, see http://notifyjs.com. Bootstrap is the default style and I'll be swapping over to that style with the refactor. |
|
Thanks for your response. I was thinking during the bootstrap: http://i.imgur.com/01TOOar.png I'm glad that I could contribute to the development. |
|
Ah yes, you can achieve what you're after with http://verifyjs.com/#how-to-option |
|
The problem is that everyone's layout and class names could be quite different, so we can't really hard code specifically: sibling |
|
Okey. You're right. |
added i18n support
Use of other languages:
added prompt for bootstrap form
http://getbootstrap.com/2.3.2/base-css.html#forms
added compare rule
usage: compare(jQuerySelector field, Label)
added check rule
usage: check(url, Error message)
Important: The response should be a json object and must include a field 'err' or 'error'.
{ err: false} OR { error: false }
added compare tests