1/** 2 * exValidation 3 * 4 * @version : 1.2.5 5 * @author : nori ([email protected]) 6 * @copyright : 5509 (http://5509.me/) 7 * @license : The MIT License 8 * @link : http://5509.me/log/exvalidation 9 * @modified : 2011-08-14 01:52 10 */ 11;(function($) { 12 // Extend validation rules 13 $.exValidationRules = $.extend($.exValidationRules, { 14 chkrequired: [ 15 "å ¥åãã¦ãã ãã", 16 function(txt, t) { 17 if ( $(t).hasClass("chkgroup") ) { 18 var flag = 0; 19 $("input,select",t).each(function() { 20 if ( $(this).val().length > 0 ) flag++; 21 }); 22 if ( txt && flag === $("input,select", t).length ) { 23 if ( /^[ ã\r\n\t]+$/.test(txt) ) { 24 return false; 25 } else { 26 return true; 27 } 28 } 29 } else { 30 if ( txt && txt.length>0 ) { 31 if ( /^[ ã\r\n\t]+$/.test(txt) ) { 32 return false; 33 } else { 34 return true; 35 } 36 } 37 } 38 } 39 ], 40 chkselect: [ 41 "鏿ãã¦ãã ãã", 42 function(txt, t) { 43 if ( txt && txt.length>0 ) { 44 if ( /^[ ã\r\n\t]+$/.test(txt) ) { 45 return false; 46 } else { 47 return true; 48 } 49 } 50 } 51 ], 52 chkretype: [ 53 "å ¥åå 容ãç°ãªãã¾ã", 54 function(txt, t) { 55 var elm = $("#" + $(t).attr("class").split("retype\-")[1].split(/\b/)[0]); 56 if ( elm.hasClass("chkgroup") ) { 57 var chktxt = $("input", elm), txt = $("input", t); 58 for ( var i = 0, flag = false; i < chktxt.length; i++ ) { 59 if ( chktxt[i].value === txt[i].value ) flag = true; 60 else flag = false; 61 } 62 if ( flag ) return true; 63 } else { 64 return elm.val() == txt; 65 } 66 } 67 ], 68 chkemail: [ 69 "æ£ããã¡ã¼ã«ã¢ãã¬ã¹ã®å½¢å¼ãå ¥åãã¦ãã ãã", 70 /^(?:[^\@]+?@[A-Za-z0-9_\.\-]+\.+[A-Za-z\.\-\_]+)*$/ 71 ], 72 chkhankaku: [ 73 "å ¨è§æåã¯ä½¿ç¨ã§ãã¾ãã", 74 /^(?:[a-zA-Z0-9@\;\:\[\]\{\}\|\^\=\/\!\*\`\"\#\$\+\%\&\'\(\)\,\.\-\_\?\\\s]*)*$/ 75 ], //" 76 chkzenkaku: [ 77 "å ¨è§æåã§å ¥åãã¦ãã ãã", 78 /^(?:[^a-zA-Z0-9@\;\:\[\]\{\}\|\^\=\/\!\*\"\#\$\+\%\&\'\(\)\,\.\-\_\?\\\s]+)*$/ 79 ], //" 80 chkhiragana: [ 81 "ã²ãããªã§å ¥åãã¦ãã ãã", 82 /^(?:[ã-ã]+)*$/ 83 ], 84 chkkatakana: [ 85 "ã«ã¿ã«ãã§å ¥åãã¦ãã ãã", 86 /^(?:[ã¡-ã¾]+)*$/ 87 ], 88 chkfurigana: [ 89 "ãµãããªã¯ã²ãããªãå ¨è§æ°åã¨ããã¼ãï¼ï¼ãå©ç¨ã§ãã¾ã", 90 /^(?:[ã-ãï¼-ï¼ã¼ï½ï¼ï¼\(\)\d ã]+)*$/ 91 ], 92 chknochar: [ 93 "è±æ°åã§å ¥åãã¦ãã ãã", 94 /^(?:[a-zA-Z0-9]+)*$/ 95 ], 96 chknocaps: [ 97 "è±æ°å(å°æåã®ã¿)ã§å ¥åãã¦ãã ãã", 98 /^(?:[a-z0-9]+)*$/ 99 ], 100 chknumonly: [ 101 "åè§æ°åã®ã¿ã§å ¥åãã¦ãã ãã", 102 /^(?:[0-9]+)*$/ 103 ], 104 chkmin: [ 105 "æå以ä¸ã§å ¥åãã¦ãã ãã", 106 function(txt, t) { 107 if ( txt.length === 0 ) return true; 108 var length = $(t).attr("class").match(/min(\d+)/) ? RegExp.$1 : null; 109 return txt.length >= length; 110 } 111 ], 112 chkmax: [ 113 "æå以å ã§å ¥åãã¦ãã ãã", 114 function(txt, t) { 115 var length = $(t).attr("class").match(/max(\d+)/) ? RegExp.$1 : null; 116 return txt.length <= length; 117 } 118 ], 119 chkradio: [ 120 "鏿ãã¦ãã ãã", 121 function(txt, t) { 122 return $("input:checked",t).length>0; 123 } 124 ], 125 chkcheckbox: [ 126 "鏿ãã¦ãã ãã", 127 function(txt, t) { 128 return $("input:checked",t).length>0; 129 } 130 ], 131 chkurl: [ 132 "æ£ããURLã®å½¢å¼ãå ¥åãã¦ãã ãã", 133 /^(?:http(s)?\:\/\/[^\/]*)*$/ 134 ], 135 chktel: [ 136 "æ£ããé»è©±çªå·ãå ¥åãã¦ãã ãã", 137 /^(?:\(?\d+\)?\-?\d+\-?\d+)*$/ 138 ], 139 chkfax: [ 140 "æ£ãããã¡ãã¯ã¹çªå·ãå ¥åãã¦ãã ãã", 141 /^(?:\(?\d+\)?\-?\d+\-?\d+)*$/ 142 ], 143 chkzip: [ 144 "åè§ã§æ£ããéµä¾¿çªå·ã®å½¢å¼ãå ¥åãã¦ãã ãã", 145 /^(?:\d{3}\-\d{4})*$/ 146 ], 147 chkfile: [ 148 "ãã¡ã¤ã«ã鏿ãã¦ãã ãã", 149 function(txt, t) { 150 if ( txt && txt.length>0 ) { 151 if ( /^[ ã\r\n\t]+$/.test(txt) ) { 152 return false; 153 } else { 154 return true; 155 } 156 } 157 } 158 ] 159 }); 160})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.