File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed
Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 1+ // TODO: append license comment to min.js file
2+
13function loadConfig ( path ) {
24 var glob = require ( 'glob' ) ;
35 var object = { } ;
Original file line number Diff line number Diff line change 5555 $ ( '#form-tags-3' ) . tagsInput ( {
5656 'minChars' : 2 ,
5757 'maxChars' : 10 ,
58- 'limit' : 5
58+ 'limit' : 5 ,
59+ 'validationPattern' : new RegExp ( '^[a-zA-Z]+$' )
5960 } ) ;
6061 } ) ;
6162 </ script >
Original file line number Diff line number Diff line change 110110 minChars : 0 ,
111111 maxChars : null ,
112112 limit : null ,
113+ validationPattern : null ,
113114 width : 'auto' ,
114115 height : 'auto' ,
115116 autocomplete : { selectFirst : false } ,
196197 unique : settings . unique ,
197198 minChars : settings . minChars ,
198199 maxChars : settings . maxChars ,
199- limit : settings . limit
200+ limit : settings . limit ,
201+ validationPattern : settings . validationPattern
200202 } ) ;
201203 }
202204 } ) ;
208210 unique : settings . unique ,
209211 minChars : settings . minChars ,
210212 maxChars : settings . maxChars ,
211- limit : settings . limit
213+ limit : settings . limit ,
214+ validationPattern : settings . validationPattern
212215 } ) ;
213216
214217 return false ;
221224 unique : settings . unique ,
222225 minChars : settings . minChars ,
223226 maxChars : settings . maxChars ,
224- limit : settings . limit
227+ limit : settings . limit ,
228+ validationPattern : settings . validationPattern
225229 } ) ;
226230
227231 return false ;
238242 unique : settings . unique ,
239243 minChars : settings . minChars ,
240244 maxChars : settings . maxChars ,
241- limit : settings . limit
245+ limit : settings . limit ,
246+ validationPattern : settings . validationPattern
242247 } ) ;
243248
244249 return false ;
286291 callback : false ,
287292 minChars : 0 ,
288293 maxChars : null ,
289- limit : null
294+ limit : null ,
295+ validationPattern : null
290296 } ) ;
291297 }
292298
303309 if ( value . length < options . minChars ) result = false ;
304310 if ( options . maxChars !== null && value . length > options . maxChars ) result = false ;
305311 if ( options . limit !== null && tagslist . length >= options . limit ) result = false ;
312+ if ( options . validationPattern !== null && ! options . validationPattern . test ( value ) ) result = false ;
306313
307314 return result ;
308315 } ;
You can’t perform that action at this time.
0 commit comments