1/*! 2 * exchecker-ja 3 * 4 * @version : 1.1 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 : 2012-04-09 16: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 chkfutureday: [ 41 "ã¯ãªãã¯ãã¦æ¥ä»ã鏿ãã¦ãã ãã", 42 function(txt, t) { 43 var curDate = new Date(); 44 var year = curDate.getFullYear(); 45 var month = curDate.getMonth()+1; 46 var day = curDate.getDate(); 47 if ( $(t).hasClass("chkgroup") ) { 48 var flag = 0; 49 50 $("input,select",t).each(function() { 51 if ( $(this).val().length > 0 ) flag++; 52 if ($(this).attr('data-role')=='year') { 53 year = parseInt($(this).val()); 54 } else if ($(this).attr('data-role')=='month') { 55 month = parseInt($(this).val()); 56 } else if ($(this).attr('data-role')=='day') { 57 day = parseInt($(this).val()); 58 } 59 }); 60 if ( txt && flag === $("input,select", t).length ) { 61 var chkDate = new Date(year, month - 1, day); 62 if (curDate.getTime() >= chkDate.getTime()) { 63 return false; 64 } else { 65 return true; 66 } 67 } 68 } else { 69 if ( txt && txt.length>0 ) { 70 var time = Date.parse(txt); 71 var chkDate = new Date(); 72 chkDate.setTime(time); 73 if (curDate.getTime() >= chkDate.getTime()) { 74 return false; 75 } else { 76 return true; 77 } 78 } 79 } 80 } 81 ], 82 chkselect: [ 83 "鏿ãã¦ãã ãã", 84 function(txt, t) { 85 if ( txt && txt.length>0 ) { 86 if ( /^[ ã\r\n\t]+$/.test(txt) ) { 87 return false; 88 } else { 89 return true; 90 } 91 } 92 } 93 ], 94 chkretype: [ 95 "å ¥åå 容ãç°ãªãã¾ã", 96 function(txt, t) { 97 var elm = $("#" + $(t).attr("class").split("retype\-")[1].split(/\b/)[0]); 98 if ( elm.hasClass("chkgroup") ) { 99 var chktxt = $("input", elm), txt = $("input", t); 100 for ( var i = 0, flag = false; i < chktxt.length; i++ ) { 101 if ( chktxt[i].value === txt[i].value ) { 102 flag = true; 103 } else { 104 flag = false; 105 break; 106 } 107 } 108 if ( flag ) return true; 109 } else { 110 return elm.val() == txt; 111 } 112 } 113 ], 114 chkemail: [ 115 "ã¡ã¼ã«ã¢ãã¬ã¹ã®æ¸å¼ãééã£ã¦ãã¾ã", 116 /^(?:[^\@]+?@[A-Za-z0-9_\.\-]+\.+[A-Za-z\.\-\_]+)*$/ 117 ], 118 chkhankaku: [ 119 "å ¨è§æåã¯ä½¿ç¨ã§ãã¾ãã", 120 /^(?:[a-zA-Z0-9@\<\>\;\:\[\]\{\}\|\^\=\/\!\*\`\"\#\$\+\%\&\'\(\)\,\.\-\_\?\\\s]*)*$/ 121 ], //" 122 chkzenkaku: [ 123 "å ¨è§æåã§å ¥åãã¦ãã ãã", 124 /^(?:[^a-zA-Z0-9@\<\>\;\:\[\]\{\}\|\^\=\/\!\*\"\#\$\+\%\&\'\(\)\,\.\-\_\?\\\s]+)*$/ 125 ], 126 chkhiragana: [ 127 "ã²ãããªã§å ¥åãã¦ãã ãã", 128 /^(?:[ã-ã]+)*$/ 129 ], 130 chkkatakana: [ 131 "ã«ã¿ã«ãã§å ¥åãã¦ãã ãã", 132 /^(?:[ã¡-ã¾]+)*$/ 133 ], 134 chkfurigana: [ 135 "ãµãããªã¯ã²ãããªãå ¨è§æ°åã¨ããã¼ãï¼ï¼ãå©ç¨ã§ãã¾ã", 136 /^(?:[ã-ãï¼-ï¼ã¼ï½ï¼ï¼\(\)\d ã]+)*$/ 137 ], 138 chknochar: [ 139 "è±æ°åã§å ¥åãã¦ãã ãã", 140 /^(?:[a-zA-Z0-9]+)*$/ 141 ], 142 chknocaps: [ 143 "è±æ°å(å°æåã®ã¿)ã§å ¥åãã¦ãã ãã", 144 /^(?:[a-z0-9]+)*$/ 145 ], 146 chknumonly: [ 147 "åè§æ°åã®ã¿ã§å ¥åãã¦ãã ãã", 148 /^(?:[0-9]+)*$/ 149 ], 150 chkmin: [ 151 "æå以ä¸ã§å ¥åãã¦ãã ãã", 152 function(txt, t) { 153 if ( txt.length === 0 ) return true; 154 var length = $(t).attr("class").match(/min(\d+)/) ? RegExp.$1 : null; 155 return txt.length >= length; 156 } 157 ], 158 chkmax: [ 159 "æå以å ã§å ¥åãã¦ãã ãã", 160 function(txt, t) { 161 var length = $(t).attr("class").match(/max(\d+)/) ? RegExp.$1 : null; 162 return txt.length <= length; 163 } 164 ], 165 chkradio: [ 166 "鏿ãã¦ãã ãã", 167 function(txt, t) { 168 return $("input:checked",t).length>0; 169 } 170 ], 171 chkcheckbox: [ 172 "鏿ãã¦ãã ãã", 173 function(txt, t) { 174 return $("input:checked",t).length>0; 175 } 176 ], 177 chkzip: [ 178 "æ£ããéµä¾¿çªå·ã®å½¢å¼ãå ¥åãã¦ãã ãã", 179 ///^(?:\d{3}-?\d{4}$|^\d{3}-?\d{2}$|^\d{3}$)*$/ 180 function(txt, t) { 181 txt = txt.replace(/[ã¼ â ï¼ -]/g,''); 182 txt = txt.replace(/[A-Zï½-ï½ï¼-ï¼]/g,function(s){return String.fromCharCode(s.charCodeAt(0)-0xFEE0)}); 183 if ( /^(?:\d{3}-?\d{4}$|^\d{3}-?\d{2}$|^\d{3}$)*$/.test(txt) ) { 184 return true; 185 } else { 186 return false; 187 } 188 } 189 ], 190 chkurl: [ 191 "æ£ããURLã®å½¢å¼ãå ¥åãã¦ãã ãã", 192 /^(?:(?:ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)*$/ 193 ], 194 chktel: [ 195 "æ£ããé»è©±çªå·ãå ¥åãã¦ãã ãã", 196 ///^(?:\(?\d+\)?\-?\d+\-?\d+)*$/ 197 function(txt, t) { 198 txt = txt.replace(/[ã¼ â ï¼ -]/g,''); 199 txt = txt.replace(/[A-Zï½-ï½ï¼-ï¼ ã¼ â ï¼]/g,function(s){return String.fromCharCode(s.charCodeAt(0)-0xFEE0)}); 200 if ( /^(?:\(?\d+\)?\-?\d+\-?\d+)*$/.test(txt) ) { 201 return true; 202 } else { 203 return false; 204 } 205 } 206 ], 207 chkfax: [ 208 "æ£ãããã¡ãã¯ã¹çªå·ãå ¥åãã¦ãã ãã", 209 /^(?:\(?\d+\)?\-?\d+\-?\d+)*$/ 210 ], 211 chkfile: [ 212 "ãã¡ã¤ã«ã鏿ãã¦ãã ãã", 213 function(txt, t) { 214 if ( txt && txt.length>0 ) { 215 if ( /^[ ã\r\n\t]+$/.test(txt) ) { 216 return false; 217 } else { 218 return true; 219 } 220 } 221 } 222 ] 223 }); 224})(jQuery); 225
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.