Browse Source

adds contains rule for form validation, updates example

Former-commit-id: fcb132facf
Former-commit-id: 603bb6e0ea
pull/258/head
jlukic 11 years ago
parent
commit
33b7f45966
8 changed files with 22 additions and 4 deletions
  1. 3
      build/minified/modules/behavior/form.js
  2. 3
      build/uncompressed/modules/behavior/form.js
  3. 6
      node/src/documents/modules/form.html
  4. 2
      node/src/files/javascript/validate-form.js
  5. 3
      node/src/files/release/less/modules/behavior/form.js
  6. 3
      node/src/files/release/minified/modules/behavior/form.js
  7. 3
      node/src/files/release/uncompressed/modules/behavior/form.js
  8. 3
      src/modules/behavior/form.js

3
build/minified/modules/behavior/form.js

@ -658,6 +658,9 @@ $.fn.form.settings = {
not: function(value, notValue) {
return (value != notValue);
},
contains: function(value, text) {
return (value.search(text) !== -1);
},
is: function(value, text) {
return (value == text);
},

3
build/uncompressed/modules/behavior/form.js

@ -658,6 +658,9 @@ $.fn.form.settings = {
not: function(value, notValue) {
return (value != notValue);
},
contains: function(value, text) {
return (value.search(text) !== -1);
},
is: function(value, text) {
return (value == text);
},

6
node/src/documents/modules/form.html

@ -168,7 +168,7 @@ type : 'UI Behavior'
prompt: 'You must have a dog to add'
},
{
type: 'is[fluffy]',
type: 'contains[fluffy]',
prompt: 'I only want you to add fluffy dogs!'
},
{
@ -281,8 +281,8 @@ type : 'UI Behavior'
<h3 class="ui header">
Validation Rules
<div class="sub header">Validation rules are a set of conditions required to validate a field</div>
<div class="ui info segment">Validation rules are found in <code>settings.rules</code></div>
</h3>
<div class="ui info message">Validation rules are found in <code>settings.rules</code></div>
<table class="ui teal celled definition table segment">
<thead>
<th class="four wide">Name</th>
@ -375,7 +375,7 @@ type : 'UI Behavior'
Templates
<div class="sub header">Templates are used to construct elements</div>
</h3>
<div class="ui info segment">Templates are found in <code>settings.template</code></div>
<div class="ui info message">Templates are found in <code>settings.template</code></div>
<table class="ui celled definition table segment">
<thead>
<th class="four wide">Template</th>

2
node/src/files/javascript/validate-form.js

@ -119,7 +119,7 @@ semantic.validateForm.ready = function() {
prompt: 'You must have a dog to add'
},
{
type: 'is[fluffy]',
type: 'contains[fluffy]',
prompt: 'I only want you to add fluffy dogs!'
},
{

3
node/src/files/release/less/modules/behavior/form.js

@ -658,6 +658,9 @@ $.fn.form.settings = {
not: function(value, notValue) {
return (value != notValue);
},
contains: function(value, text) {
return (value.search(text) !== -1);
},
is: function(value, text) {
return (value == text);
},

3
node/src/files/release/minified/modules/behavior/form.js

@ -658,6 +658,9 @@ $.fn.form.settings = {
not: function(value, notValue) {
return (value != notValue);
},
contains: function(value, text) {
return (value.search(text) !== -1);
},
is: function(value, text) {
return (value == text);
},

3
node/src/files/release/uncompressed/modules/behavior/form.js

@ -658,6 +658,9 @@ $.fn.form.settings = {
not: function(value, notValue) {
return (value != notValue);
},
contains: function(value, text) {
return (value.search(text) !== -1);
},
is: function(value, text) {
return (value == text);
},

3
src/modules/behavior/form.js

@ -658,6 +658,9 @@ $.fn.form.settings = {
not: function(value, notValue) {
return (value != notValue);
},
contains: function(value, text) {
return (value.search(text) !== -1);
},
is: function(value, text) {
return (value == text);
},

Loading…
Cancel
Save