Commit e44c10c794e303ed2fb6c49447d9a0594b386cdc
Merge branch 'minhang' of 192.168.168.201:panzhaov5/bsth_control into minhang
Showing
43 changed files
with
4011 additions
and
785 deletions
Too many changes to show.
To preserve performance only 43 of 127 files are displayed.
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
| 1 | -package com.bsth.controller.realcontrol; | |
| 2 | - | |
| 3 | -import java.io.ByteArrayOutputStream; | |
| 4 | -import java.io.IOException; | |
| 5 | -import java.io.InputStream; | |
| 6 | -import java.io.OutputStream; | |
| 7 | -import java.net.HttpURLConnection; | |
| 8 | -import java.net.URL; | |
| 9 | -import java.util.ArrayList; | |
| 10 | -import java.util.Collection; | |
| 11 | -import java.util.HashMap; | |
| 12 | -import java.util.List; | |
| 13 | -import java.util.Map; | |
| 14 | - | |
| 15 | -import org.apache.commons.io.IOUtils; | |
| 16 | -import org.apache.commons.lang3.StringEscapeUtils; | |
| 17 | -import org.joda.time.format.DateTimeFormat; | |
| 18 | -import org.joda.time.format.DateTimeFormatter; | |
| 19 | -import org.springframework.beans.factory.annotation.Autowired; | |
| 20 | -import org.springframework.web.bind.annotation.PathVariable; | |
| 21 | -import org.springframework.web.bind.annotation.RequestMapping; | |
| 22 | -import org.springframework.web.bind.annotation.RequestMethod; | |
| 23 | -import org.springframework.web.bind.annotation.RequestParam; | |
| 24 | -import org.springframework.web.bind.annotation.RestController; | |
| 25 | - | |
| 26 | -import com.alibaba.fastjson.JSONArray; | |
| 27 | -import com.bsth.common.ResponseCode; | |
| 28 | -import com.bsth.controller.BaseController; | |
| 29 | -import com.bsth.controller.realcontrol.dto.ChangePersonCar; | |
| 30 | -import com.bsth.controller.realcontrol.dto.DfsjChange; | |
| 31 | -import com.bsth.data.BasicData; | |
| 32 | -import com.bsth.data.schedule.DayOfSchedule; | |
| 33 | -import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto; | |
| 34 | -import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 35 | -import com.bsth.entity.schedule.SchedulePlanInfo; | |
| 36 | -import com.bsth.entity.sys.SysUser; | |
| 37 | -import com.bsth.security.util.SecurityUtils; | |
| 38 | -import com.bsth.service.realcontrol.ScheduleRealInfoService; | |
| 39 | -import com.bsth.util.ConfigUtil; | |
| 40 | -import com.fasterxml.jackson.databind.ObjectMapper; | |
| 41 | - | |
| 42 | -@RestController | |
| 43 | -@RequestMapping("/realSchedule") | |
| 44 | -public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, Long> { | |
| 45 | - | |
| 46 | - @Autowired | |
| 47 | - ScheduleRealInfoService scheduleRealInfoService; | |
| 48 | - | |
| 49 | - @Autowired | |
| 50 | - DayOfSchedule dayOfSchedule; | |
| 51 | - | |
| 52 | - @RequestMapping(value = "check_fgs_ascription", method = RequestMethod.POST) | |
| 53 | - public Map<String, Object> checkPCFgsAscription(@RequestParam Long schId, String jGh, String sGh, String nbbm){ | |
| 54 | - return scheduleRealInfoService.checkPCFgsAscription(schId, jGh, sGh, nbbm); | |
| 55 | - } | |
| 56 | - | |
| 57 | - @RequestMapping(value = "/lines") | |
| 58 | - public Map<String, Collection<ScheduleRealInfo>> findByLines(@RequestParam String lines) { | |
| 59 | - return scheduleRealInfoService.findByLines(lines); | |
| 60 | - } | |
| 61 | - | |
| 62 | - @RequestMapping(value = "/car") | |
| 63 | - public List<ScheduleRealInfo> findByCar(String nbbm){ | |
| 64 | - return dayOfSchedule.findByNbbm(nbbm); | |
| 65 | - } | |
| 66 | - | |
| 67 | - /** | |
| 68 | - * | |
| 69 | - * @Title: outgoAdjust @Description: TODO(待发调整) @param @param id | |
| 70 | - * 主键 @param @param remarks 备注 @param @param dfsj 待发时间(HH:mm) @throws | |
| 71 | - */ | |
| 72 | - @RequestMapping(value = "/outgoAdjust", method = RequestMethod.POST) | |
| 73 | - public Map<String, Object> outgoAdjust(@RequestParam Long id, @RequestParam String remarks, | |
| 74 | - @RequestParam String dfsj,String bcType, | |
| 75 | - @RequestParam(defaultValue = "") String opType) { | |
| 76 | - return scheduleRealInfoService.outgoAdjust(id, remarks, dfsj, bcType, opType, null); | |
| 77 | - } | |
| 78 | - | |
| 79 | - /** | |
| 80 | - * | |
| 81 | - * @Title: destroy @Description: TODO(销毁,烂班) @param @param idsStr 要烂掉的班次ID ,分隔 | |
| 82 | - */ | |
| 83 | - @RequestMapping(value = "/destroy", method = RequestMethod.POST) | |
| 84 | - public Map<String, Object> destroy(@RequestParam String idsStr | |
| 85 | - /*, @RequestParam(defaultValue = "-1") int spaceAdjust*/, | |
| 86 | - @RequestParam String remarks, @RequestParam String adjustExps/*, @RequestParam(defaultValue = "0") int spaceNum*/) { | |
| 87 | - return scheduleRealInfoService.destroy(idsStr, remarks, adjustExps, null); | |
| 88 | - } | |
| 89 | - | |
| 90 | - /** | |
| 91 | - * | |
| 92 | - * @Title: carDeviceMapp @Description: TODO(获取车辆自编号和设备号对照,从缓存取) @throws | |
| 93 | - */ | |
| 94 | - @RequestMapping(value = "/carDeviceMapp", method = RequestMethod.GET) | |
| 95 | - public Map<String, String> carDeviceMapp() { | |
| 96 | - return BasicData.deviceId2NbbmMap.inverse(); | |
| 97 | - } | |
| 98 | - | |
| 99 | - /** | |
| 100 | - * | |
| 101 | - * @Title: findPersionByLine @Description: TODO(根据线路主键获取驾驶员) @param @param | |
| 102 | - * lineId @throws | |
| 103 | - */ | |
| 104 | - @RequestMapping(value = "/driver", method = RequestMethod.GET) | |
| 105 | - public List<Map<String, String>> findDriverByLine(@RequestParam String lineCode) { | |
| 106 | - return scheduleRealInfoService.findDriverByLine(lineCode); | |
| 107 | - } | |
| 108 | - | |
| 109 | - /** | |
| 110 | - * | |
| 111 | - * @Title: findPersionByLine @Description: TODO(根据线路主键获取售票员) @param @param | |
| 112 | - * lineId @throws | |
| 113 | - */ | |
| 114 | - @RequestMapping(value = "/conductor", method = RequestMethod.GET) | |
| 115 | - public List<Map<String, String>> findConductorByLine(@RequestParam String lineCode) { | |
| 116 | - return scheduleRealInfoService.findConductorByLine(lineCode); | |
| 117 | - } | |
| 118 | - | |
| 119 | - /** | |
| 120 | - * | |
| 121 | - * @Title: findPersionByLine @Description: TODO(根据线路主键获取车辆) @param @param | |
| 122 | - * lineId @throws | |
| 123 | - */ | |
| 124 | - @RequestMapping(value = "/cars", method = RequestMethod.GET) | |
| 125 | - public List<Map<String, String>> findCarByLine(@RequestParam String lineCode) { | |
| 126 | - return scheduleRealInfoService.findCarByLine(lineCode); | |
| 127 | - } | |
| 128 | - | |
| 129 | - /** | |
| 130 | - * | |
| 131 | - * @Title: sreachNbbm @Description: TODO(搜索车辆内部编码) @throws | |
| 132 | - */ | |
| 133 | - @RequestMapping(value = "/sreachVehic", method = RequestMethod.GET) | |
| 134 | - public List<Map<String, String>> sreachVehic(@RequestParam String nbbm) { | |
| 135 | - return scheduleRealInfoService.sreachVehic(nbbm); | |
| 136 | - } | |
| 137 | - /** | |
| 138 | - * | |
| 139 | - * @Title: realOutAdjust | |
| 140 | - * @Description: TODO(实发调整) | |
| 141 | - * @param @param id 班次ID | |
| 142 | - * @param @param fcsjActual 实际发车时间 HH:mm | |
| 143 | - * @param @param remarks 备注 | |
| 144 | - * @throws | |
| 145 | - */ | |
| 146 | - @RequestMapping(value = "/realOutAdjust", method = RequestMethod.POST) | |
| 147 | - public Map<String, Object> realOutAdjust(@RequestParam Long id, @RequestParam String fcsjActual, | |
| 148 | - @RequestParam String remarks) { | |
| 149 | - return scheduleRealInfoService.realOutAdjust(id, fcsjActual, remarks); | |
| 150 | - } | |
| 151 | - | |
| 152 | - /** | |
| 153 | - * | |
| 154 | - * @Title: revokeDestroy | |
| 155 | - * @Description: TODO(撤销烂班) | |
| 156 | - * @param @param id | |
| 157 | - * @throws | |
| 158 | - */ | |
| 159 | - @RequestMapping(value = "/revokeDestroy", method = RequestMethod.POST) | |
| 160 | - public Map<String, Object> revokeDestroy(@RequestParam Long id){ | |
| 161 | - return scheduleRealInfoService.revokeDestroy(id); | |
| 162 | - } | |
| 163 | - | |
| 164 | - /** | |
| 165 | - * | |
| 166 | - * @Title: revokeRealOutgo | |
| 167 | - * @Description: TODO(撤销实发) | |
| 168 | - * @param @param id | |
| 169 | - * @throws | |
| 170 | - */ | |
| 171 | - @RequestMapping(value = "/revokeRealOutgo", method = RequestMethod.POST) | |
| 172 | - public Map<String, Object> revokeRealOutgo(@RequestParam Long id){ | |
| 173 | - return scheduleRealInfoService.revokeRealOutgo(id); | |
| 174 | - } | |
| 175 | - | |
| 176 | - /** | |
| 177 | - * 撤销执行 | |
| 178 | - * @param id | |
| 179 | - * @return | |
| 180 | - */ | |
| 181 | - @RequestMapping(value = "/revokeRealArrive", method = RequestMethod.POST) | |
| 182 | - public Map<String, Object> revokeRealArrive(@RequestParam Long id){ | |
| 183 | - return scheduleRealInfoService.revokeRealArrive(id); | |
| 184 | - } | |
| 185 | - | |
| 186 | - /** | |
| 187 | - * | |
| 188 | - * @Title: spaceAdjust | |
| 189 | - * @Description: TODO(间隔调整) | |
| 190 | - * @param @param ids 要调整的班次数组ID | |
| 191 | - * @param @param space 间隔 | |
| 192 | - * @throws | |
| 193 | - */ | |
| 194 | - @RequestMapping(value = "/spaceAdjust", method = RequestMethod.POST) | |
| 195 | - public Map<String, Object> spaceAdjust(Long[] ids, Integer space){ | |
| 196 | - return scheduleRealInfoService.spaceAdjust(ids, space); | |
| 197 | - } | |
| 198 | - | |
| 199 | - /** | |
| 200 | - * | |
| 201 | - * @Title: schInfoFineTune | |
| 202 | - * @Description: TODO(发车信息微调) | |
| 203 | - * @param @param map | |
| 204 | - * @throws | |
| 205 | - */ | |
| 206 | - @RequestMapping(value = "/schInfoFineTune", method = RequestMethod.POST) | |
| 207 | - public Map<String, Object> schInfoFineTune(@RequestParam Map<String, String> map){ | |
| 208 | - return scheduleRealInfoService.schInfoFineTune(map); | |
| 209 | - } | |
| 210 | - | |
| 211 | - /** | |
| 212 | - * | |
| 213 | - * @Title: outgoAdjustAll | |
| 214 | - * @Description: TODO(批量待发调整) | |
| 215 | - * @param @param list | |
| 216 | - * @throws | |
| 217 | - */ | |
| 218 | - @RequestMapping(value = "/outgoAdjustAll", method = RequestMethod.POST) | |
| 219 | - public Map<String, Object> outgoAdjustAll(@RequestParam String params){ | |
| 220 | - //反转义 | |
| 221 | - params = StringEscapeUtils.unescapeHtml4(params); | |
| 222 | - return scheduleRealInfoService.outgoAdjustAll(params); | |
| 223 | - } | |
| 224 | - | |
| 225 | - /** | |
| 226 | - * | |
| 227 | - * @Title: findByLineAndUpDown | |
| 228 | - * @Description: TODO(根据线路和走向获取班次) | |
| 229 | - * @param @param line | |
| 230 | - * @param @param upDown | |
| 231 | - */ | |
| 232 | - @RequestMapping(value = "/findByLineAndUpDown") | |
| 233 | - public List<ScheduleRealInfo> findByLineAndUpDown(@RequestParam String line,@RequestParam Integer upDown){ | |
| 234 | - return dayOfSchedule.findByLineAndUpDown(line, upDown); | |
| 235 | - } | |
| 236 | - | |
| 237 | - /** | |
| 238 | - * | |
| 239 | - * @Title: findRouteByLine | |
| 240 | - * @Description: TODO(获取线路的站点,路段路由) | |
| 241 | - * @param @param lineCode | |
| 242 | - * @throws | |
| 243 | - */ | |
| 244 | - @RequestMapping(value = "/findRouteByLine") | |
| 245 | - public Map<String, Object> findRouteByLine(@RequestParam String lineCode){ | |
| 246 | - return scheduleRealInfoService.findRouteByLine(lineCode); | |
| 247 | - } | |
| 248 | - | |
| 249 | - /** | |
| 250 | - * | |
| 251 | - * @Title: removeChildTask | |
| 252 | - * @Description: TODO(删除子任务) | |
| 253 | - * @param @param taskId 子任务ID | |
| 254 | - * @throws | |
| 255 | - */ | |
| 256 | - @RequestMapping(value = "/childTask/{taskId}", method = RequestMethod.DELETE) | |
| 257 | - public Map<String, Object> removeChildTask(@PathVariable("taskId") Long taskId){ | |
| 258 | - return scheduleRealInfoService.removeChildTask(taskId); | |
| 259 | - } | |
| 260 | - | |
| 261 | - /** | |
| 262 | - * | |
| 263 | - * @Title: findByLineCode | |
| 264 | - * @Description: TODO(根据线路获取班次信息) | |
| 265 | - * @param @param lineCode | |
| 266 | - */ | |
| 267 | - @RequestMapping(value = "/lineCode/{lineCode}") | |
| 268 | - public List<ScheduleRealInfo> findByLineCode(@PathVariable("lineCode") String lineCode){ | |
| 269 | - return dayOfSchedule.findByLineCode(lineCode); | |
| 270 | - } | |
| 271 | - | |
| 272 | - @RequestMapping(value = "/queryUserInfo") | |
| 273 | - public List<ScheduleRealInfo> queryUserInfo(@RequestParam String line, | |
| 274 | - @RequestParam String date,@RequestParam String state) { | |
| 275 | - return scheduleRealInfoService.queryUserInfo(line, date,state); | |
| 276 | - } | |
| 277 | - | |
| 278 | - @RequestMapping(value = "/queryUserInfoPx") | |
| 279 | - public List<ScheduleRealInfo> queryUserInfoPx(@RequestParam String line, | |
| 280 | - @RequestParam String date,@RequestParam String state,@RequestParam String type) { | |
| 281 | - return scheduleRealInfoService.queryUserInfoPx(line, date,state,type); | |
| 282 | - } | |
| 283 | - | |
| 284 | - @RequestMapping(value = "/exportWaybill",method = RequestMethod.GET) | |
| 285 | - public List<ScheduleRealInfo> exportWaybill(@RequestParam String jName, @RequestParam String clZbh, | |
| 286 | - @RequestParam String lpName,@RequestParam String date,@RequestParam String line) { | |
| 287 | - return scheduleRealInfoService.exportWaybill(jName, clZbh, lpName,date,line); | |
| 288 | - } | |
| 289 | - | |
| 290 | - @RequestMapping(value = "/exportWaybillQp",method = RequestMethod.GET) | |
| 291 | - public List<ScheduleRealInfo> exportWaybillQp(@RequestParam String clZbh | |
| 292 | - ,@RequestParam String date,@RequestParam String line) { | |
| 293 | - return scheduleRealInfoService.exportWaybillQp( clZbh, date,line); | |
| 294 | - } | |
| 295 | - | |
| 296 | - | |
| 297 | - @RequestMapping(value = "/dailyInfo") | |
| 298 | - public List<Map<String, Object>> dailyInfo(@RequestParam String line, @RequestParam String date,@RequestParam String type) { | |
| 299 | - return scheduleRealInfoService.dailyInfo(line, date, type); | |
| 300 | - } | |
| 301 | - | |
| 302 | - @RequestMapping(value = "/historyMessage") | |
| 303 | - public List<Object[]> historyMessage(@RequestParam String line, @RequestParam String date, | |
| 304 | - @RequestParam String code, @RequestParam String type) { | |
| 305 | - return scheduleRealInfoService.historyMessage(line, date, code, type); | |
| 306 | - } | |
| 307 | - | |
| 308 | - @RequestMapping(value="/findLine") | |
| 309 | - public List<Map<String,String>> findLine(@RequestParam String line){ | |
| 310 | - return scheduleRealInfoService.findLine(line); | |
| 311 | - } | |
| 312 | - | |
| 313 | - @RequestMapping(value="/findKMBC",method = RequestMethod.GET) | |
| 314 | - public Map<String,Object> findKMBC(@RequestParam String jGh,@RequestParam String clZbh,@RequestParam String lpName | |
| 315 | - ,@RequestParam String date,@RequestParam String line){ | |
| 316 | - return scheduleRealInfoService.findKMBC(jGh, clZbh,lpName,date,line); | |
| 317 | - } | |
| 318 | - | |
| 319 | - /** | |
| 320 | - * 路单公里统计 (闵行审计专用) | |
| 321 | - * @param jGh | |
| 322 | - * @param clZbh | |
| 323 | - * @param lpName | |
| 324 | - * @param date | |
| 325 | - * @param line | |
| 326 | - * @return | |
| 327 | - */ | |
| 328 | - @RequestMapping(value="/findKMBC_mh_2",method = RequestMethod.GET) | |
| 329 | - public Map<String,Object> findKMBC_mh_2(@RequestParam String jGh,@RequestParam String clZbh,@RequestParam String lpName | |
| 330 | - ,@RequestParam String date,@RequestParam String line){ | |
| 331 | - return scheduleRealInfoService.findKMBC_mh_2(jGh, clZbh,lpName,date,line); | |
| 332 | - } | |
| 333 | - | |
| 334 | - @RequestMapping(value="/findKMBCQp",method = RequestMethod.GET) | |
| 335 | - public Map<String,Object> findKMBCQp(@RequestParam String clZbh | |
| 336 | - ,@RequestParam String date,@RequestParam String line){ | |
| 337 | - return scheduleRealInfoService.findKMBCQp(clZbh,date,line); | |
| 338 | - } | |
| 339 | - | |
| 340 | - @RequestMapping(value="/findLpName") | |
| 341 | - public List<Map<String,String>> findLpName(@RequestParam String lpName){ | |
| 342 | - return scheduleRealInfoService.findLpName(lpName); | |
| 343 | - } | |
| 344 | - | |
| 345 | - @RequestMapping(value = "/account") | |
| 346 | - public List<Map<String,Object>> account(@RequestParam String line, @RequestParam String date, | |
| 347 | - @RequestParam String code,@RequestParam String xlName, @RequestParam String type) { | |
| 348 | - return scheduleRealInfoService.account(line, date, code, xlName, type); | |
| 349 | - } | |
| 350 | - | |
| 351 | - @RequestMapping(value = "/accountPx") | |
| 352 | - public List<Map<String,Object>> accountPx(@RequestParam String line, @RequestParam String date, | |
| 353 | - @RequestParam String code,@RequestParam String xlName, @RequestParam String px) { | |
| 354 | - return scheduleRealInfoService.accountPx(line, date, code, xlName, px); | |
| 355 | - } | |
| 356 | - | |
| 357 | - @RequestMapping(value = "/correctForm") | |
| 358 | - public List<SchEditInfoDto> correctForm(@RequestParam String line, @RequestParam String date, | |
| 359 | - @RequestParam String endDate, | |
| 360 | - @RequestParam String lpName, @RequestParam String code, | |
| 361 | - @RequestParam String type,@RequestParam String changType) { | |
| 362 | - return scheduleRealInfoService.correctForm(line, date, endDate, lpName, code, type,changType); | |
| 363 | - } | |
| 364 | - /** | |
| 365 | - * @Title queryListWaybill | |
| 366 | - * @Description 查询行车路单列表 | |
| 367 | - * @param jName 驾驶员名字 | |
| 368 | - * @param clZbh 车辆自编号(内部编号) | |
| 369 | - * @param lpName 路牌 | |
| 370 | - * @return | |
| 371 | - */ | |
| 372 | - @RequestMapping(value="/queryListWaybill",method = RequestMethod.GET) | |
| 373 | - public List<ScheduleRealInfo> queryListWaybill(@RequestParam String jName,@RequestParam String clZbh,@RequestParam String lpName | |
| 374 | - ,@RequestParam String date,@RequestParam String line){ | |
| 375 | - return scheduleRealInfoService.queryListWaybill(jName, clZbh,lpName,date,line); | |
| 376 | - } | |
| 377 | - | |
| 378 | - /** | |
| 379 | - * @Title queryListWaybill | |
| 380 | - * @Description 查询行车路单列表(闵行审计专用路单) | |
| 381 | - * @param jName 驾驶员名字 | |
| 382 | - * @param clZbh 车辆自编号(内部编号) | |
| 383 | - * @param lpName 路牌 | |
| 384 | - * @return | |
| 385 | - */ | |
| 386 | - @RequestMapping(value="/queryListWaybill_mh_2",method = RequestMethod.GET) | |
| 387 | - public List<ScheduleRealInfo> queryListWaybill_mh_2(@RequestParam String jName,@RequestParam String clZbh,@RequestParam String lpName | |
| 388 | - ,@RequestParam String date,@RequestParam String line){ | |
| 389 | - return scheduleRealInfoService.queryListWaybill2(jName, clZbh,lpName,date,line); | |
| 390 | - } | |
| 391 | - | |
| 392 | - @RequestMapping(value="/queryListWaybillQp",method = RequestMethod.GET) | |
| 393 | - public List<ScheduleRealInfo> queryListWaybillQp(@RequestParam String clZbh, | |
| 394 | - @RequestParam String date,@RequestParam String line){ | |
| 395 | - return scheduleRealInfoService.queryListWaybillQp(clZbh,date,line); | |
| 396 | - } | |
| 397 | - | |
| 398 | - @RequestMapping(value="/statisticsDaily") | |
| 399 | - public List<Map<String,Object>> statisticsDaily(@RequestParam String line, @RequestParam String date, | |
| 400 | - @RequestParam String xlName, @RequestParam String type){ | |
| 401 | - return scheduleRealInfoService.statisticsDaily(line, date, xlName, type); | |
| 402 | - } | |
| 403 | - | |
| 404 | - @RequestMapping(value="/statisticsDaily_mh_2") | |
| 405 | - public List<Map<String,Object>> statisticsDaily_mh_2(@RequestParam String line, @RequestParam String date, | |
| 406 | - @RequestParam String xlName, @RequestParam String type){ | |
| 407 | - return scheduleRealInfoService.statisticsDaily_mh_2(line, date, xlName, type); | |
| 408 | - } | |
| 409 | - | |
| 410 | - @RequestMapping(value="/statisticsDailyTj") | |
| 411 | - public List<Map<String,Object>> statisticsDailyTj(@RequestParam Map<String, Object> map){ | |
| 412 | - String gsdm=""; | |
| 413 | - if(map.get("gsdm")!=null){ | |
| 414 | - gsdm=map.get("gsdm").toString(); | |
| 415 | - } | |
| 416 | - String fgsdm=""; | |
| 417 | - if(map.get("fgsdm")!=null){ | |
| 418 | - fgsdm=map.get("fgsdm").toString(); | |
| 419 | - } | |
| 420 | - String line=""; | |
| 421 | - if(map.get("line")!=null){ | |
| 422 | - line=map.get("line").toString(); | |
| 423 | - } | |
| 424 | - String date=""; | |
| 425 | - if(map.get("date")!=null){ | |
| 426 | - date=map.get("date").toString(); | |
| 427 | - } | |
| 428 | - String date2=""; | |
| 429 | - if(map.get("date2")!=null){ | |
| 430 | - date2=map.get("date2").toString(); | |
| 431 | - } | |
| 432 | - String xlName=""; | |
| 433 | - if(map.get("xlName")!=null){ | |
| 434 | - xlName=map.get("xlName").toString(); | |
| 435 | - } | |
| 436 | - String type=""; | |
| 437 | - if(map.get("type")!=null){ | |
| 438 | - type=map.get("type").toString(); | |
| 439 | - } | |
| 440 | - String nature="0"; | |
| 441 | - if(map.get("nature")!=null){ | |
| 442 | - nature=map.get("nature").toString(); | |
| 443 | - } | |
| 444 | - return scheduleRealInfoService.statisticsDailyTj(gsdm,fgsdm,line, date,date2, xlName, type,nature); | |
| 445 | - } | |
| 446 | - | |
| 447 | - /* | |
| 448 | - * 公里修正报表 | |
| 449 | - */ | |
| 450 | - @RequestMapping(value="/mileageReportTj") | |
| 451 | - public List<Map<String,Object>> mileageReport(@RequestParam Map<String, Object> map){ | |
| 452 | - String gsdm=""; | |
| 453 | - if(map.get("gsdm")!=null){ | |
| 454 | - gsdm=map.get("gsdm").toString(); | |
| 455 | - } | |
| 456 | - String fgsdm=""; | |
| 457 | - if(map.get("fgsdm")!=null){ | |
| 458 | - fgsdm=map.get("fgsdm").toString(); | |
| 459 | - } | |
| 460 | - String line=""; | |
| 461 | - if(map.get("line")!=null){ | |
| 462 | - line=map.get("line").toString(); | |
| 463 | - } | |
| 464 | - String date=""; | |
| 465 | - if(map.get("date")!=null){ | |
| 466 | - date=map.get("date").toString(); | |
| 467 | - } | |
| 468 | - String date2=""; | |
| 469 | - if(map.get("date2")!=null){ | |
| 470 | - date2=map.get("date2").toString(); | |
| 471 | - } | |
| 472 | - String xlName=""; | |
| 473 | - if(map.get("xlName")!=null){ | |
| 474 | - xlName=map.get("xlName").toString(); | |
| 475 | - } | |
| 476 | - return scheduleRealInfoService.mileageReport(gsdm,fgsdm,line, date,date2); | |
| 477 | - } | |
| 478 | - | |
| 479 | - /* | |
| 480 | - * 班次修正报表 | |
| 481 | - */ | |
| 482 | - @RequestMapping(value="/scheduleCorrectionReport") | |
| 483 | - public List<Map<String,Object>> scheduleCorrectionReport(@RequestParam Map<String, Object> map){ | |
| 484 | - String gsdm=""; | |
| 485 | - if(map.get("gsdm")!=null){ | |
| 486 | - gsdm=map.get("gsdm").toString(); | |
| 487 | - } | |
| 488 | - String fgsdm=""; | |
| 489 | - if(map.get("fgsdm")!=null){ | |
| 490 | - fgsdm=map.get("fgsdm").toString(); | |
| 491 | - } | |
| 492 | - String line=""; | |
| 493 | - if(map.get("line")!=null){ | |
| 494 | - line=map.get("line").toString(); | |
| 495 | - } | |
| 496 | - String date=""; | |
| 497 | - if(map.get("date")!=null){ | |
| 498 | - date=map.get("date").toString(); | |
| 499 | - } | |
| 500 | - String date2=""; | |
| 501 | - if(map.get("date2")!=null){ | |
| 502 | - date2=map.get("date2").toString(); | |
| 503 | - } | |
| 504 | - String xlName=""; | |
| 505 | - if(map.get("xlName")!=null){ | |
| 506 | - xlName=map.get("xlName").toString(); | |
| 507 | - } | |
| 508 | - return scheduleRealInfoService.scheduleCorrectionReport(gsdm,fgsdm,line, date,date2); | |
| 509 | - } | |
| 510 | - | |
| 511 | - @RequestMapping(value="/MapById",method = RequestMethod.GET) | |
| 512 | - public Map<String, Object> MapById(@RequestParam("id") Long id){ | |
| 513 | - return scheduleRealInfoService.MapById(id); | |
| 514 | - } | |
| 515 | - | |
| 516 | - @RequestMapping(value="/MapByIdQp",method = RequestMethod.GET) | |
| 517 | - public Map<String, Object> MapByIdQp(@RequestParam("id") Long id){ | |
| 518 | - return scheduleRealInfoService.MapByIdQp(id); | |
| 519 | - } | |
| 520 | - | |
| 521 | - /** | |
| 522 | - * @Title: scheduleDaily | |
| 523 | - * @Description: TODO(调度日报表) | |
| 524 | - * @param line 线路 | |
| 525 | - * @param date 时间 | |
| 526 | - * @return | |
| 527 | - */ | |
| 528 | - @RequestMapping(value="/scheduleDaily") | |
| 529 | - public Map<String,Object> scheduleDaily(@RequestParam String line,@RequestParam String date){ | |
| 530 | - return scheduleRealInfoService.scheduleDaily(line,date); | |
| 531 | - } | |
| 532 | - | |
| 533 | - @RequestMapping(value="/realScheduleList") | |
| 534 | - public List<ScheduleRealInfo> realScheduleList(@RequestParam String line,@RequestParam String date){ | |
| 535 | - return scheduleRealInfoService.realScheduleList(line,date); | |
| 536 | - } | |
| 537 | - | |
| 538 | - @RequestMapping(value="/realScheduleList_zrw") | |
| 539 | - public List<ScheduleRealInfo> realScheduleList_zrw(@RequestParam String line,@RequestParam String date){ | |
| 540 | - return scheduleRealInfoService.realScheduleList_zrw(line,date); | |
| 541 | - } | |
| 542 | - | |
| 543 | - @RequestMapping(value="/realScheduleList_mh_2") | |
| 544 | - public List<ScheduleRealInfo> realScheduleList_mh_2(@RequestParam String line,@RequestParam String date){ | |
| 545 | - return scheduleRealInfoService.realScheduleList_mh_2(line,date); | |
| 546 | - } | |
| 547 | - | |
| 548 | - @RequestMapping(value="/realScheduleListQp") | |
| 549 | - public List<ScheduleRealInfo> realScheduleListQp(@RequestParam String line,@RequestParam String date){ | |
| 550 | - return scheduleRealInfoService.realScheduleListQp(line,date); | |
| 551 | - } | |
| 552 | - | |
| 553 | - @RequestMapping(value="/multi_tzrc", method=RequestMethod.POST) | |
| 554 | - public Map<String, Object> multi_tzrc(@RequestParam String cpcsJson){ | |
| 555 | - cpcsJson = StringEscapeUtils.unescapeHtml4(cpcsJson); | |
| 556 | - List<ChangePersonCar> cpcs = JSONArray.parseArray(cpcsJson, ChangePersonCar.class); | |
| 557 | - return scheduleRealInfoService.multi_tzrc(cpcs, null); | |
| 558 | - } | |
| 559 | - | |
| 560 | - @RequestMapping(value="/multi_dftz", method=RequestMethod.POST) | |
| 561 | - public Map<String, Object> multi_dftz(@RequestParam String dcsJson){ | |
| 562 | - dcsJson = StringEscapeUtils.unescapeHtml4(dcsJson); | |
| 563 | - List<DfsjChange> dfsjcs = JSONArray.parseArray(dcsJson, DfsjChange.class); | |
| 564 | - return scheduleRealInfoService.multi_dftz(dfsjcs); | |
| 565 | - } | |
| 566 | - | |
| 567 | - @RequestMapping(value="/changeBcType/{id}", method=RequestMethod.POST) | |
| 568 | - public Map<String, Object> changeBcType(@PathVariable("id") Long id, String bcType, String remarks, String majorStationName){ | |
| 569 | - return scheduleRealInfoService.changeBcType(id, bcType, remarks, majorStationName); | |
| 570 | - } | |
| 571 | - | |
| 572 | - @RequestMapping(value="/history", method=RequestMethod.POST) | |
| 573 | - public Map<String,Object> historySave(ScheduleRealInfo sch){ | |
| 574 | - return scheduleRealInfoService.historySave(sch); | |
| 575 | - } | |
| 576 | - | |
| 577 | - | |
| 578 | - private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd"); | |
| 579 | - private final static long ONE_DAY = 1000 * 60 * 60 * 24; | |
| 580 | - /** | |
| 581 | - * 获取可编辑的历史班次日期 | |
| 582 | - * @return | |
| 583 | - */ | |
| 584 | - @RequestMapping("dateArray") | |
| 585 | - public List<String> dateArray(@RequestParam(defaultValue = "0") int c){ | |
| 586 | - List<String> rs = new ArrayList<>(); | |
| 587 | - | |
| 588 | - long t = System.currentTimeMillis(); | |
| 589 | - if(c != 1) | |
| 590 | - t -= (ONE_DAY + (1000 * 60 * 60 * 6)); | |
| 591 | - for(int i = 0; i < 3; i ++){ | |
| 592 | - rs.add(fmtyyyyMMdd.print(t)); | |
| 593 | - t -= ONE_DAY; | |
| 594 | - } | |
| 595 | - return rs; | |
| 596 | - } | |
| 597 | - | |
| 598 | - @RequestMapping(value = "svgAttr", method = RequestMethod.POST) | |
| 599 | - public Map<String, Object> svgAttr(@RequestParam String jsonStr){ | |
| 600 | - return scheduleRealInfoService.svgAttr(jsonStr); | |
| 601 | - } | |
| 602 | - | |
| 603 | - @RequestMapping(value = "svgAttr", method = RequestMethod.GET) | |
| 604 | - public Map<String, Object> findSvgAttr(@RequestParam String idx){ | |
| 605 | - return scheduleRealInfoService.findSvgAttr(idx); | |
| 606 | - } | |
| 607 | - | |
| 608 | - @RequestMapping(value = "addRemarks", method = RequestMethod.POST) | |
| 609 | - public Map<String, Object> addRemarks(@RequestParam Long id, @RequestParam String remarks){ | |
| 610 | - return scheduleRealInfoService.addRemarks(id, remarks); | |
| 611 | - } | |
| 612 | - | |
| 613 | - @RequestMapping(value = "scheduleDailyQp", method = RequestMethod.GET) | |
| 614 | - public List<Map<String, Object>> scheduleDailyQp(@RequestParam String line,@RequestParam String date){ | |
| 615 | - return scheduleRealInfoService.scheduleDailyQp(line,date); | |
| 616 | - } | |
| 617 | - | |
| 618 | - @RequestMapping(value = "scheduleDailyExport", method = RequestMethod.GET) | |
| 619 | - public List<Map<String, Object>> scheduleDailyExport(@RequestParam Map<String, Object> map){ | |
| 620 | - return scheduleRealInfoService.scheduleDailyExport(map); | |
| 621 | - } | |
| 622 | - | |
| 623 | - @RequestMapping(value = "exportWaybillMore", method = RequestMethod.GET) | |
| 624 | - public Map<String, Object> exportWaybillMore(@RequestParam Map<String, Object> map){ | |
| 625 | - return scheduleRealInfoService.exportWaybillMore(map); | |
| 626 | - } | |
| 627 | - | |
| 628 | - /** | |
| 629 | - * 获取当日计划排班 , 从计划表抓取数据 | |
| 630 | - * @return | |
| 631 | - */ | |
| 632 | - @RequestMapping(value = "currSchedulePlanByLineCode", method = RequestMethod.GET) | |
| 633 | - public List<SchedulePlanInfo> currentSchedulePlan(@RequestParam String lineCode){ | |
| 634 | - return scheduleRealInfoService.currentSchedulePlan(lineCode); | |
| 635 | - } | |
| 636 | - | |
| 637 | - @RequestMapping(value = "lpChangeMulti", method = RequestMethod.POST) | |
| 638 | - public Map<String, Object> lpChangeMulti(@RequestParam String leftIdx, @RequestParam String rightIdx,@RequestParam int type){ | |
| 639 | - return scheduleRealInfoService.lpChangeMulti(leftIdx, rightIdx, type); | |
| 640 | - } | |
| 641 | - | |
| 642 | - /** | |
| 643 | - * 删除当日实际排班 | |
| 644 | - * @return | |
| 645 | - */ | |
| 646 | - @RequestMapping(value = "deleteRealSchedule", method = RequestMethod.POST) | |
| 647 | - public Map<String, Object> deleteRealSchedule(@RequestParam String lineCode){ | |
| 648 | - return dayOfSchedule.deleteRealSchedule(lineCode); | |
| 649 | - } | |
| 650 | - | |
| 651 | - /** | |
| 652 | - * 从计划表重新加载当日排班 | |
| 653 | - * @param lineCode | |
| 654 | - * @return | |
| 655 | - */ | |
| 656 | - @RequestMapping(value = "reLoadRealSchedule", method = RequestMethod.POST) | |
| 657 | - public Map<String, Object> reLoadRealSchedule(@RequestParam String lineCode){ | |
| 658 | - Map<String, Object> rs = new HashMap<>(); | |
| 659 | - List<ScheduleRealInfo> list = dayOfSchedule.findByLineCode(lineCode); | |
| 660 | - if(list != null && list.size() > 0){ | |
| 661 | - rs.put("status", ResponseCode.ERROR); | |
| 662 | - rs.put("msg", "失败," + list.get(0).getXlName() + "当日存在实际排班,无法重新加载。"); | |
| 663 | - return rs; | |
| 664 | - } | |
| 665 | - | |
| 666 | - int code = dayOfSchedule.reloadSch(lineCode); | |
| 667 | - | |
| 668 | - //重新按公司编码索引数据 | |
| 669 | - dayOfSchedule.groupByGsbm(); | |
| 670 | - rs.put("status", code==0? ResponseCode.SUCCESS: ResponseCode.ERROR); | |
| 671 | - return rs; | |
| 672 | - } | |
| 673 | - | |
| 674 | - /** | |
| 675 | - * 误点调整 | |
| 676 | - * @param idx | |
| 677 | - * @param minute | |
| 678 | - * @return | |
| 679 | - */ | |
| 680 | - @RequestMapping(value = "lateAdjust", method = RequestMethod.POST) | |
| 681 | - public Map<String, Object> lateAdjust(@RequestParam String idx,@RequestParam float minute ){ | |
| 682 | - return scheduleRealInfoService.lateAdjust(idx, minute); | |
| 683 | - } | |
| 684 | - | |
| 685 | - /** | |
| 686 | - * 获取所有应发未到的班次 | |
| 687 | - * @param idx | |
| 688 | - * @return | |
| 689 | - */ | |
| 690 | - @RequestMapping(value = "allLate2") | |
| 691 | - public List<ScheduleRealInfo> allLate2(@RequestParam String idx){ | |
| 692 | - return scheduleRealInfoService.allLate2(idx); | |
| 693 | - } | |
| 694 | - | |
| 695 | - /** | |
| 696 | - * 添加一个临加到历史库 | |
| 697 | - * @param sch | |
| 698 | - * @return | |
| 699 | - */ | |
| 700 | - @RequestMapping(value = "history/add", method = RequestMethod.POST) | |
| 701 | - public Map<String, Object> addToHistory(ScheduleRealInfo sch){ | |
| 702 | - return scheduleRealInfoService.addToHistory(sch); | |
| 703 | - } | |
| 704 | - | |
| 705 | - /** | |
| 706 | - * 从历史库里删除临加班次 | |
| 707 | - * @param sch | |
| 708 | - * @return | |
| 709 | - */ | |
| 710 | - @RequestMapping(value = "history/{id}", method = RequestMethod.DELETE) | |
| 711 | - public Map<String, Object> deleteToHistory(@PathVariable("id") Long id){ | |
| 712 | - return scheduleRealInfoService.deleteToHistory(id); | |
| 713 | - } | |
| 714 | - | |
| 715 | - /** | |
| 716 | - * 从历史库里删除临加班次 | |
| 717 | - * @param sch | |
| 718 | - * @return | |
| 719 | - */ | |
| 720 | - @RequestMapping(value = "wxsb", method = RequestMethod.POST) | |
| 721 | - public Map<String, Object> deleteToHistory(@RequestParam Map<String, Object> param){ | |
| 722 | - SysUser user = SecurityUtils.getCurrentUser(); | |
| 723 | - String uname = user.getUserName(); | |
| 724 | - StringBuilder url = new StringBuilder(ConfigUtil.get("http.report.url")); | |
| 725 | - url.append("?nbbm=").append(param.get("nbbm")).append("&bxy=").append(uname).append("&bxbm=").append(param.get("bxType")); | |
| 726 | - // 分公司保存格式 分公司编码_公司编码 | |
| 727 | - String val = BasicData.nbbm2FgsCompanyCodeMap.get(param.get("nbbm")); | |
| 728 | - String[] arr = val.split("_"); | |
| 729 | - if (!"22".equals(arr[1])) { | |
| 730 | - Map<String, Object> res = new HashMap<String, Object>(); | |
| 731 | - res.put("status", ResponseCode.ERROR); | |
| 732 | - res.put("msg", "除金高公司外暂未开通此功能"); | |
| 733 | - | |
| 734 | - return res; | |
| 735 | - } | |
| 736 | - url.append("&fgs=").append(arr[0]); | |
| 737 | - | |
| 738 | - return request(url.toString()); | |
| 739 | - } | |
| 740 | - | |
| 741 | - @SuppressWarnings("unchecked") | |
| 742 | - private static Map<String, Object> request(String url) { | |
| 743 | - Map<String, Object> res = new HashMap<String, Object>(); | |
| 744 | - res.put("status", ResponseCode.SUCCESS); | |
| 745 | - InputStream in = null; | |
| 746 | - HttpURLConnection con = null; | |
| 747 | - try { | |
| 748 | - con = (HttpURLConnection)new URL(url).openConnection(); | |
| 749 | - con.setRequestMethod("POST"); | |
| 750 | - con.setRequestProperty("keep-alive", "true"); | |
| 751 | - con.setRequestProperty("accept", "application/json"); | |
| 752 | - con.setRequestProperty("content-type", "application/json"); | |
| 753 | - con.setDoInput(true); | |
| 754 | - con.setReadTimeout(2500); | |
| 755 | - con.setConnectTimeout(2500); | |
| 756 | - | |
| 757 | - con.connect(); | |
| 758 | - if (con.getResponseCode() == 200) { | |
| 759 | - in = con.getInputStream(); | |
| 760 | - ByteArrayOutputStream bout = new ByteArrayOutputStream(); | |
| 761 | - IOUtils.copy(in, bout); bout.close(); | |
| 762 | - Map<String, Object> response = new ObjectMapper().readValue(bout.toByteArray(), Map.class); | |
| 763 | - if (!"报修成功".equals(response.get("msg"))) { | |
| 764 | - res.put("status", ResponseCode.ERROR); | |
| 765 | - res.putAll(response); | |
| 766 | - } | |
| 767 | - } | |
| 768 | - } catch (IOException e) { | |
| 769 | - // TODO Auto-generated catch block | |
| 770 | - res.put("status", ResponseCode.ERROR); | |
| 771 | - res.put("msg", "调用上报接口异常"); | |
| 772 | - } finally { | |
| 773 | - try { | |
| 774 | - if (in != null) in.close(); | |
| 775 | - if (con != null) con.disconnect(); | |
| 776 | - } catch (IOException e) { | |
| 777 | - // TODO Auto-generated catch block | |
| 778 | - e.printStackTrace(); | |
| 779 | - } | |
| 780 | - } | |
| 781 | - | |
| 782 | - return res; | |
| 783 | - } | |
| 784 | -} | |
| 1 | +package com.bsth.controller.realcontrol; | |
| 2 | + | |
| 3 | +import java.io.ByteArrayOutputStream; | |
| 4 | +import java.io.IOException; | |
| 5 | +import java.io.InputStream; | |
| 6 | +import java.io.OutputStream; | |
| 7 | +import java.net.HttpURLConnection; | |
| 8 | +import java.net.URL; | |
| 9 | +import java.util.ArrayList; | |
| 10 | +import java.util.Collection; | |
| 11 | +import java.util.HashMap; | |
| 12 | +import java.util.List; | |
| 13 | +import java.util.Map; | |
| 14 | + | |
| 15 | +import org.apache.commons.io.IOUtils; | |
| 16 | +import org.apache.commons.lang3.StringEscapeUtils; | |
| 17 | +import org.joda.time.format.DateTimeFormat; | |
| 18 | +import org.joda.time.format.DateTimeFormatter; | |
| 19 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 20 | +import org.springframework.web.bind.annotation.PathVariable; | |
| 21 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 22 | +import org.springframework.web.bind.annotation.RequestMethod; | |
| 23 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 24 | +import org.springframework.web.bind.annotation.RestController; | |
| 25 | + | |
| 26 | +import com.alibaba.fastjson.JSONArray; | |
| 27 | +import com.bsth.common.ResponseCode; | |
| 28 | +import com.bsth.controller.BaseController; | |
| 29 | +import com.bsth.controller.realcontrol.dto.ChangePersonCar; | |
| 30 | +import com.bsth.controller.realcontrol.dto.DfsjChange; | |
| 31 | +import com.bsth.data.BasicData; | |
| 32 | +import com.bsth.data.schedule.DayOfSchedule; | |
| 33 | +import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto; | |
| 34 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 35 | +import com.bsth.entity.schedule.SchedulePlanInfo; | |
| 36 | +import com.bsth.entity.sys.SysUser; | |
| 37 | +import com.bsth.security.util.SecurityUtils; | |
| 38 | +import com.bsth.service.realcontrol.ScheduleRealInfoService; | |
| 39 | +import com.bsth.util.ConfigUtil; | |
| 40 | +import com.fasterxml.jackson.databind.ObjectMapper; | |
| 41 | + | |
| 42 | +@RestController | |
| 43 | +@RequestMapping("/realSchedule") | |
| 44 | +public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, Long> { | |
| 45 | + | |
| 46 | + @Autowired | |
| 47 | + ScheduleRealInfoService scheduleRealInfoService; | |
| 48 | + | |
| 49 | + @Autowired | |
| 50 | + DayOfSchedule dayOfSchedule; | |
| 51 | + //待发时间调整时间 | |
| 52 | + public static Long dfsj= 0L; | |
| 53 | + //待发时间调整 | |
| 54 | + public Long dfsj(Long sj){ | |
| 55 | + dfsj = sj; | |
| 56 | + return dfsj; | |
| 57 | + } | |
| 58 | + | |
| 59 | + @RequestMapping(value = "check_fgs_ascription", method = RequestMethod.POST) | |
| 60 | + public Map<String, Object> checkPCFgsAscription(@RequestParam Long schId, String jGh, String sGh, String nbbm){ | |
| 61 | + return scheduleRealInfoService.checkPCFgsAscription(schId, jGh, sGh, nbbm); | |
| 62 | + } | |
| 63 | + | |
| 64 | + @RequestMapping(value = "/lines") | |
| 65 | + public Map<String, Collection<ScheduleRealInfo>> findByLines(@RequestParam String lines) { | |
| 66 | + return scheduleRealInfoService.findByLines(lines); | |
| 67 | + } | |
| 68 | + | |
| 69 | + @RequestMapping(value = "/car") | |
| 70 | + public List<ScheduleRealInfo> findByCar(String nbbm){ | |
| 71 | + return dayOfSchedule.findByNbbm(nbbm); | |
| 72 | + } | |
| 73 | + | |
| 74 | + /** | |
| 75 | + * | |
| 76 | + * @Title: outgoAdjust @Description: TODO(待发调整) @param @param id | |
| 77 | + * 主键 @param @param remarks 备注 @param @param dfsj 待发时间(HH:mm) @throws | |
| 78 | + */ | |
| 79 | + @RequestMapping(value = "/outgoAdjust", method = RequestMethod.POST) | |
| 80 | + public Map<String, Object> outgoAdjust(@RequestParam Long id, @RequestParam String remarks, | |
| 81 | + @RequestParam String dfsj,String bcType, | |
| 82 | + @RequestParam(defaultValue = "") String opType) { | |
| 83 | + return scheduleRealInfoService.outgoAdjust(id, remarks, dfsj, bcType, opType, null); | |
| 84 | + } | |
| 85 | + | |
| 86 | + | |
| 87 | + /** | |
| 88 | + * | |
| 89 | + * @Title: outgoAdjust @Description: TODO(待发调整锁定待发) | |
| 90 | + * | |
| 91 | + */ | |
| 92 | + @RequestMapping(value = "/outgoAdjusttwo", method = RequestMethod.POST) | |
| 93 | + public Map<String, Object> outgoAdjusttow(@RequestParam String dfsj) { | |
| 94 | + return scheduleRealInfoService.outgoAdjusttwo(dfsj); | |
| 95 | + } | |
| 96 | + /** | |
| 97 | + * | |
| 98 | + * @Title: outgoAdjust @Description: TODO(待发时间定义) | |
| 99 | + * | |
| 100 | + */ | |
| 101 | + @RequestMapping(value = "/outgoAdjusttwodfsj", method = RequestMethod.POST) | |
| 102 | + public Long outgoAdjusttowdfsj(@RequestParam Long dfsj) { | |
| 103 | + return dfsj(dfsj); | |
| 104 | + } | |
| 105 | + | |
| 106 | + /** | |
| 107 | + * | |
| 108 | + * @Title: outgoAdjust @Description: TODO(待发时间查询) | |
| 109 | + * | |
| 110 | + */ | |
| 111 | + @RequestMapping(value = "/outgoAdjusttwoxc", method = RequestMethod.POST) | |
| 112 | + public Long outgoAdjusttowdfsjxc() { | |
| 113 | + return dfsj; | |
| 114 | + } | |
| 115 | + | |
| 116 | + | |
| 117 | + /** | |
| 118 | + * | |
| 119 | + * @Title: destroy @Description: TODO(销毁,烂班) @param @param idsStr 要烂掉的班次ID ,分隔 | |
| 120 | + */ | |
| 121 | + @RequestMapping(value = "/destroy", method = RequestMethod.POST) | |
| 122 | + public Map<String, Object> destroy(@RequestParam String idsStr | |
| 123 | + /*, @RequestParam(defaultValue = "-1") int spaceAdjust*/, | |
| 124 | + @RequestParam String remarks, @RequestParam String adjustExps/*, @RequestParam(defaultValue = "0") int spaceNum*/) { | |
| 125 | + return scheduleRealInfoService.destroy(idsStr, remarks, adjustExps, null); | |
| 126 | + } | |
| 127 | + | |
| 128 | + /** | |
| 129 | + * | |
| 130 | + * @Title: carDeviceMapp @Description: TODO(获取车辆自编号和设备号对照,从缓存取) @throws | |
| 131 | + */ | |
| 132 | + @RequestMapping(value = "/carDeviceMapp", method = RequestMethod.GET) | |
| 133 | + public Map<String, String> carDeviceMapp() { | |
| 134 | + return BasicData.deviceId2NbbmMap.inverse(); | |
| 135 | + } | |
| 136 | + | |
| 137 | + /** | |
| 138 | + * | |
| 139 | + * @Title: findPersionByLine @Description: TODO(根据线路主键获取驾驶员) @param @param | |
| 140 | + * lineId @throws | |
| 141 | + */ | |
| 142 | + @RequestMapping(value = "/driver", method = RequestMethod.GET) | |
| 143 | + public List<Map<String, String>> findDriverByLine(@RequestParam String lineCode) { | |
| 144 | + return scheduleRealInfoService.findDriverByLine(lineCode); | |
| 145 | + } | |
| 146 | + | |
| 147 | + /** | |
| 148 | + * | |
| 149 | + * @Title: findPersionByLine @Description: TODO(根据线路主键获取售票员) @param @param | |
| 150 | + * lineId @throws | |
| 151 | + */ | |
| 152 | + @RequestMapping(value = "/conductor", method = RequestMethod.GET) | |
| 153 | + public List<Map<String, String>> findConductorByLine(@RequestParam String lineCode) { | |
| 154 | + return scheduleRealInfoService.findConductorByLine(lineCode); | |
| 155 | + } | |
| 156 | + | |
| 157 | + /** | |
| 158 | + * | |
| 159 | + * @Title: findPersionByLine @Description: TODO(根据线路主键获取车辆) @param @param | |
| 160 | + * lineId @throws | |
| 161 | + */ | |
| 162 | + @RequestMapping(value = "/cars", method = RequestMethod.GET) | |
| 163 | + public List<Map<String, String>> findCarByLine(@RequestParam String lineCode) { | |
| 164 | + return scheduleRealInfoService.findCarByLine(lineCode); | |
| 165 | + } | |
| 166 | + | |
| 167 | + /** | |
| 168 | + * | |
| 169 | + * @Title: sreachNbbm @Description: TODO(搜索车辆内部编码) @throws | |
| 170 | + */ | |
| 171 | + @RequestMapping(value = "/sreachVehic", method = RequestMethod.GET) | |
| 172 | + public List<Map<String, String>> sreachVehic(@RequestParam String nbbm) { | |
| 173 | + return scheduleRealInfoService.sreachVehic(nbbm); | |
| 174 | + } | |
| 175 | + /** | |
| 176 | + * | |
| 177 | + * @Title: realOutAdjust | |
| 178 | + * @Description: TODO(实发调整) | |
| 179 | + * @param @param id 班次ID | |
| 180 | + * @param @param fcsjActual 实际发车时间 HH:mm | |
| 181 | + * @param @param remarks 备注 | |
| 182 | + * @throws | |
| 183 | + */ | |
| 184 | + @RequestMapping(value = "/realOutAdjust", method = RequestMethod.POST) | |
| 185 | + public Map<String, Object> realOutAdjust(@RequestParam Long id, @RequestParam String fcsjActual, | |
| 186 | + @RequestParam String remarks) { | |
| 187 | + return scheduleRealInfoService.realOutAdjust(id, fcsjActual, remarks); | |
| 188 | + } | |
| 189 | + | |
| 190 | + /** | |
| 191 | + * | |
| 192 | + * @Title: revokeDestroy | |
| 193 | + * @Description: TODO(撤销烂班) | |
| 194 | + * @param @param id | |
| 195 | + * @throws | |
| 196 | + */ | |
| 197 | + @RequestMapping(value = "/revokeDestroy", method = RequestMethod.POST) | |
| 198 | + public Map<String, Object> revokeDestroy(@RequestParam Long id){ | |
| 199 | + return scheduleRealInfoService.revokeDestroy(id); | |
| 200 | + } | |
| 201 | + | |
| 202 | + /** | |
| 203 | + * | |
| 204 | + * @Title: revokeRealOutgo | |
| 205 | + * @Description: TODO(撤销实发) | |
| 206 | + * @param @param id | |
| 207 | + * @throws | |
| 208 | + */ | |
| 209 | + @RequestMapping(value = "/revokeRealOutgo", method = RequestMethod.POST) | |
| 210 | + public Map<String, Object> revokeRealOutgo(@RequestParam Long id){ | |
| 211 | + return scheduleRealInfoService.revokeRealOutgo(id); | |
| 212 | + } | |
| 213 | + | |
| 214 | + /** | |
| 215 | + * 撤销执行 | |
| 216 | + * @param id | |
| 217 | + * @return | |
| 218 | + */ | |
| 219 | + @RequestMapping(value = "/revokeRealArrive", method = RequestMethod.POST) | |
| 220 | + public Map<String, Object> revokeRealArrive(@RequestParam Long id){ | |
| 221 | + return scheduleRealInfoService.revokeRealArrive(id); | |
| 222 | + } | |
| 223 | + | |
| 224 | + /** | |
| 225 | + * | |
| 226 | + * @Title: spaceAdjust | |
| 227 | + * @Description: TODO(间隔调整) | |
| 228 | + * @param @param ids 要调整的班次数组ID | |
| 229 | + * @param @param space 间隔 | |
| 230 | + * @throws | |
| 231 | + */ | |
| 232 | + @RequestMapping(value = "/spaceAdjust", method = RequestMethod.POST) | |
| 233 | + public Map<String, Object> spaceAdjust(Long[] ids, Integer space){ | |
| 234 | + return scheduleRealInfoService.spaceAdjust(ids, space); | |
| 235 | + } | |
| 236 | + | |
| 237 | + /** | |
| 238 | + * | |
| 239 | + * @Title: schInfoFineTune | |
| 240 | + * @Description: TODO(发车信息微调) | |
| 241 | + * @param @param map | |
| 242 | + * @throws | |
| 243 | + */ | |
| 244 | + @RequestMapping(value = "/schInfoFineTune", method = RequestMethod.POST) | |
| 245 | + public Map<String, Object> schInfoFineTune(@RequestParam Map<String, String> map){ | |
| 246 | + return scheduleRealInfoService.schInfoFineTune(map); | |
| 247 | + } | |
| 248 | + | |
| 249 | + /** | |
| 250 | + * | |
| 251 | + * @Title: outgoAdjustAll | |
| 252 | + * @Description: TODO(批量待发调整) | |
| 253 | + * @param @param list | |
| 254 | + * @throws | |
| 255 | + */ | |
| 256 | + @RequestMapping(value = "/outgoAdjustAll", method = RequestMethod.POST) | |
| 257 | + public Map<String, Object> outgoAdjustAll(@RequestParam String params){ | |
| 258 | + //反转义 | |
| 259 | + params = StringEscapeUtils.unescapeHtml4(params); | |
| 260 | + return scheduleRealInfoService.outgoAdjustAll(params); | |
| 261 | + } | |
| 262 | + | |
| 263 | + /** | |
| 264 | + * | |
| 265 | + * @Title: findByLineAndUpDown | |
| 266 | + * @Description: TODO(根据线路和走向获取班次) | |
| 267 | + * @param @param line | |
| 268 | + * @param @param upDown | |
| 269 | + */ | |
| 270 | + @RequestMapping(value = "/findByLineAndUpDown") | |
| 271 | + public List<ScheduleRealInfo> findByLineAndUpDown(@RequestParam String line,@RequestParam Integer upDown){ | |
| 272 | + return dayOfSchedule.findByLineAndUpDown(line, upDown); | |
| 273 | + } | |
| 274 | + | |
| 275 | + /** | |
| 276 | + * | |
| 277 | + * @Title: findRouteByLine | |
| 278 | + * @Description: TODO(获取线路的站点,路段路由) | |
| 279 | + * @param @param lineCode | |
| 280 | + * @throws | |
| 281 | + */ | |
| 282 | + @RequestMapping(value = "/findRouteByLine") | |
| 283 | + public Map<String, Object> findRouteByLine(@RequestParam String lineCode){ | |
| 284 | + return scheduleRealInfoService.findRouteByLine(lineCode); | |
| 285 | + } | |
| 286 | + | |
| 287 | + /** | |
| 288 | + * | |
| 289 | + * @Title: removeChildTask | |
| 290 | + * @Description: TODO(删除子任务) | |
| 291 | + * @param @param taskId 子任务ID | |
| 292 | + * @throws | |
| 293 | + */ | |
| 294 | + @RequestMapping(value = "/childTask/{taskId}", method = RequestMethod.DELETE) | |
| 295 | + public Map<String, Object> removeChildTask(@PathVariable("taskId") Long taskId){ | |
| 296 | + return scheduleRealInfoService.removeChildTask(taskId); | |
| 297 | + } | |
| 298 | + | |
| 299 | + /** | |
| 300 | + * | |
| 301 | + * @Title: findByLineCode | |
| 302 | + * @Description: TODO(根据线路获取班次信息) | |
| 303 | + * @param @param lineCode | |
| 304 | + */ | |
| 305 | + @RequestMapping(value = "/lineCode/{lineCode}") | |
| 306 | + public List<ScheduleRealInfo> findByLineCode(@PathVariable("lineCode") String lineCode){ | |
| 307 | + return dayOfSchedule.findByLineCode(lineCode); | |
| 308 | + } | |
| 309 | + | |
| 310 | + @RequestMapping(value = "/queryUserInfo") | |
| 311 | + public List<ScheduleRealInfo> queryUserInfo(@RequestParam String line, | |
| 312 | + @RequestParam String date,@RequestParam String state) { | |
| 313 | + return scheduleRealInfoService.queryUserInfo(line, date,state); | |
| 314 | + } | |
| 315 | + | |
| 316 | + @RequestMapping(value = "/queryUserInfoPx") | |
| 317 | + public List<ScheduleRealInfo> queryUserInfoPx(@RequestParam String line, | |
| 318 | + @RequestParam String date,@RequestParam String state,@RequestParam String type) { | |
| 319 | + return scheduleRealInfoService.queryUserInfoPx(line, date,state,type); | |
| 320 | + } | |
| 321 | + | |
| 322 | + @RequestMapping(value = "/exportWaybill",method = RequestMethod.GET) | |
| 323 | + public List<ScheduleRealInfo> exportWaybill(@RequestParam String jName, @RequestParam String clZbh, | |
| 324 | + @RequestParam String lpName,@RequestParam String date,@RequestParam String line) { | |
| 325 | + return scheduleRealInfoService.exportWaybill(jName, clZbh, lpName,date,line); | |
| 326 | + } | |
| 327 | + | |
| 328 | + @RequestMapping(value = "/exportWaybillQp",method = RequestMethod.GET) | |
| 329 | + public List<ScheduleRealInfo> exportWaybillQp(@RequestParam String clZbh | |
| 330 | + ,@RequestParam String date,@RequestParam String line) { | |
| 331 | + return scheduleRealInfoService.exportWaybillQp( clZbh, date,line); | |
| 332 | + } | |
| 333 | + | |
| 334 | + | |
| 335 | + @RequestMapping(value = "/dailyInfo") | |
| 336 | + public List<Map<String, Object>> dailyInfo(@RequestParam String line, @RequestParam String date,@RequestParam String type) { | |
| 337 | + return scheduleRealInfoService.dailyInfo(line, date, type); | |
| 338 | + } | |
| 339 | + | |
| 340 | + @RequestMapping(value = "/historyMessage") | |
| 341 | + public List<Object[]> historyMessage(@RequestParam String line, @RequestParam String date, | |
| 342 | + @RequestParam String code, @RequestParam String type) { | |
| 343 | + return scheduleRealInfoService.historyMessage(line, date, code, type); | |
| 344 | + } | |
| 345 | + | |
| 346 | + @RequestMapping(value="/findLine") | |
| 347 | + public List<Map<String,String>> findLine(@RequestParam String line){ | |
| 348 | + return scheduleRealInfoService.findLine(line); | |
| 349 | + } | |
| 350 | + | |
| 351 | + @RequestMapping(value="/findKMBC",method = RequestMethod.GET) | |
| 352 | + public Map<String,Object> findKMBC(@RequestParam String jGh,@RequestParam String clZbh,@RequestParam String lpName | |
| 353 | + ,@RequestParam String date,@RequestParam String line){ | |
| 354 | + return scheduleRealInfoService.findKMBC(jGh, clZbh,lpName,date,line); | |
| 355 | + } | |
| 356 | + | |
| 357 | + /** | |
| 358 | + * 路单公里统计 (闵行审计专用) | |
| 359 | + * @param jGh | |
| 360 | + * @param clZbh | |
| 361 | + * @param lpName | |
| 362 | + * @param date | |
| 363 | + * @param line | |
| 364 | + * @return | |
| 365 | + */ | |
| 366 | + @RequestMapping(value="/findKMBC_mh_2",method = RequestMethod.GET) | |
| 367 | + public Map<String,Object> findKMBC_mh_2(@RequestParam String jGh,@RequestParam String clZbh,@RequestParam String lpName | |
| 368 | + ,@RequestParam String date,@RequestParam String line){ | |
| 369 | + return scheduleRealInfoService.findKMBC_mh_2(jGh, clZbh,lpName,date,line); | |
| 370 | + } | |
| 371 | + | |
| 372 | + @RequestMapping(value="/findKMBCQp",method = RequestMethod.GET) | |
| 373 | + public Map<String,Object> findKMBCQp(@RequestParam String clZbh | |
| 374 | + ,@RequestParam String date,@RequestParam String line){ | |
| 375 | + return scheduleRealInfoService.findKMBCQp(clZbh,date,line); | |
| 376 | + } | |
| 377 | + | |
| 378 | + @RequestMapping(value="/findLpName") | |
| 379 | + public List<Map<String,String>> findLpName(@RequestParam String lpName){ | |
| 380 | + return scheduleRealInfoService.findLpName(lpName); | |
| 381 | + } | |
| 382 | + | |
| 383 | + @RequestMapping(value = "/account") | |
| 384 | + public List<Map<String,Object>> account(@RequestParam String line, @RequestParam String date, | |
| 385 | + @RequestParam String code,@RequestParam String xlName, @RequestParam String type) { | |
| 386 | + return scheduleRealInfoService.account(line, date, code, xlName, type); | |
| 387 | + } | |
| 388 | + | |
| 389 | + @RequestMapping(value = "/accountPx") | |
| 390 | + public List<Map<String,Object>> accountPx(@RequestParam String line, @RequestParam String date, | |
| 391 | + @RequestParam String code,@RequestParam String xlName, @RequestParam String px) { | |
| 392 | + return scheduleRealInfoService.accountPx(line, date, code, xlName, px); | |
| 393 | + } | |
| 394 | + | |
| 395 | + @RequestMapping(value = "/correctForm") | |
| 396 | + public List<SchEditInfoDto> correctForm(@RequestParam String line, @RequestParam String date, | |
| 397 | + @RequestParam String endDate, | |
| 398 | + @RequestParam String lpName, @RequestParam String code, | |
| 399 | + @RequestParam String type,@RequestParam String changType) { | |
| 400 | + return scheduleRealInfoService.correctForm(line, date, endDate, lpName, code, type,changType); | |
| 401 | + } | |
| 402 | + /** | |
| 403 | + * @Title queryListWaybill | |
| 404 | + * @Description 查询行车路单列表 | |
| 405 | + * @param jName 驾驶员名字 | |
| 406 | + * @param clZbh 车辆自编号(内部编号) | |
| 407 | + * @param lpName 路牌 | |
| 408 | + * @return | |
| 409 | + */ | |
| 410 | + @RequestMapping(value="/queryListWaybill",method = RequestMethod.GET) | |
| 411 | + public List<ScheduleRealInfo> queryListWaybill(@RequestParam String jName,@RequestParam String clZbh,@RequestParam String lpName | |
| 412 | + ,@RequestParam String date,@RequestParam String line){ | |
| 413 | + return scheduleRealInfoService.queryListWaybill(jName, clZbh,lpName,date,line); | |
| 414 | + } | |
| 415 | + | |
| 416 | + /** | |
| 417 | + * @Title queryListWaybill | |
| 418 | + * @Description 查询行车路单列表(闵行审计专用路单) | |
| 419 | + * @param jName 驾驶员名字 | |
| 420 | + * @param clZbh 车辆自编号(内部编号) | |
| 421 | + * @param lpName 路牌 | |
| 422 | + * @return | |
| 423 | + */ | |
| 424 | + @RequestMapping(value="/queryListWaybill_mh_2",method = RequestMethod.GET) | |
| 425 | + public List<ScheduleRealInfo> queryListWaybill_mh_2(@RequestParam String jName,@RequestParam String clZbh,@RequestParam String lpName | |
| 426 | + ,@RequestParam String date,@RequestParam String line){ | |
| 427 | + return scheduleRealInfoService.queryListWaybill2(jName, clZbh,lpName,date,line); | |
| 428 | + } | |
| 429 | + | |
| 430 | + @RequestMapping(value="/queryListWaybillQp",method = RequestMethod.GET) | |
| 431 | + public List<ScheduleRealInfo> queryListWaybillQp(@RequestParam String clZbh, | |
| 432 | + @RequestParam String date,@RequestParam String line){ | |
| 433 | + return scheduleRealInfoService.queryListWaybillQp(clZbh,date,line); | |
| 434 | + } | |
| 435 | + | |
| 436 | + @RequestMapping(value="/statisticsDaily") | |
| 437 | + public List<Map<String,Object>> statisticsDaily(@RequestParam String line, @RequestParam String date, | |
| 438 | + @RequestParam String xlName, @RequestParam String type){ | |
| 439 | + return scheduleRealInfoService.statisticsDaily(line, date, xlName, type); | |
| 440 | + } | |
| 441 | + | |
| 442 | + @RequestMapping(value="/statisticsDaily_mh_2") | |
| 443 | + public List<Map<String,Object>> statisticsDaily_mh_2(@RequestParam String line, @RequestParam String date, | |
| 444 | + @RequestParam String xlName, @RequestParam String type){ | |
| 445 | + return scheduleRealInfoService.statisticsDaily_mh_2(line, date, xlName, type); | |
| 446 | + } | |
| 447 | + | |
| 448 | + @RequestMapping(value="/statisticsDailyTj") | |
| 449 | + public List<Map<String,Object>> statisticsDailyTj(@RequestParam Map<String, Object> map){ | |
| 450 | + String gsdm=""; | |
| 451 | + if(map.get("gsdm")!=null){ | |
| 452 | + gsdm=map.get("gsdm").toString(); | |
| 453 | + } | |
| 454 | + String fgsdm=""; | |
| 455 | + if(map.get("fgsdm")!=null){ | |
| 456 | + fgsdm=map.get("fgsdm").toString(); | |
| 457 | + } | |
| 458 | + String line=""; | |
| 459 | + if(map.get("line")!=null){ | |
| 460 | + line=map.get("line").toString(); | |
| 461 | + } | |
| 462 | + String date=""; | |
| 463 | + if(map.get("date")!=null){ | |
| 464 | + date=map.get("date").toString(); | |
| 465 | + } | |
| 466 | + String date2=""; | |
| 467 | + if(map.get("date2")!=null){ | |
| 468 | + date2=map.get("date2").toString(); | |
| 469 | + } | |
| 470 | + String xlName=""; | |
| 471 | + if(map.get("xlName")!=null){ | |
| 472 | + xlName=map.get("xlName").toString(); | |
| 473 | + } | |
| 474 | + String type=""; | |
| 475 | + if(map.get("type")!=null){ | |
| 476 | + type=map.get("type").toString(); | |
| 477 | + } | |
| 478 | + String nature="0"; | |
| 479 | + if(map.get("nature")!=null){ | |
| 480 | + nature=map.get("nature").toString(); | |
| 481 | + } | |
| 482 | + return scheduleRealInfoService.statisticsDailyTj(gsdm,fgsdm,line, date,date2, xlName, type,nature); | |
| 483 | + } | |
| 484 | + | |
| 485 | + /* | |
| 486 | + * 公里修正报表 | |
| 487 | + */ | |
| 488 | + @RequestMapping(value="/mileageReportTj") | |
| 489 | + public List<Map<String,Object>> mileageReport(@RequestParam Map<String, Object> map){ | |
| 490 | + String gsdm=""; | |
| 491 | + if(map.get("gsdm")!=null){ | |
| 492 | + gsdm=map.get("gsdm").toString(); | |
| 493 | + } | |
| 494 | + String fgsdm=""; | |
| 495 | + if(map.get("fgsdm")!=null){ | |
| 496 | + fgsdm=map.get("fgsdm").toString(); | |
| 497 | + } | |
| 498 | + String line=""; | |
| 499 | + if(map.get("line")!=null){ | |
| 500 | + line=map.get("line").toString(); | |
| 501 | + } | |
| 502 | + String date=""; | |
| 503 | + if(map.get("date")!=null){ | |
| 504 | + date=map.get("date").toString(); | |
| 505 | + } | |
| 506 | + String date2=""; | |
| 507 | + if(map.get("date2")!=null){ | |
| 508 | + date2=map.get("date2").toString(); | |
| 509 | + } | |
| 510 | + String xlName=""; | |
| 511 | + if(map.get("xlName")!=null){ | |
| 512 | + xlName=map.get("xlName").toString(); | |
| 513 | + } | |
| 514 | + return scheduleRealInfoService.mileageReport(gsdm,fgsdm,line, date,date2); | |
| 515 | + } | |
| 516 | + | |
| 517 | + /* | |
| 518 | + * 班次修正报表 | |
| 519 | + */ | |
| 520 | + @RequestMapping(value="/scheduleCorrectionReport") | |
| 521 | + public List<Map<String,Object>> scheduleCorrectionReport(@RequestParam Map<String, Object> map){ | |
| 522 | + String gsdm=""; | |
| 523 | + if(map.get("gsdm")!=null){ | |
| 524 | + gsdm=map.get("gsdm").toString(); | |
| 525 | + } | |
| 526 | + String fgsdm=""; | |
| 527 | + if(map.get("fgsdm")!=null){ | |
| 528 | + fgsdm=map.get("fgsdm").toString(); | |
| 529 | + } | |
| 530 | + String line=""; | |
| 531 | + if(map.get("line")!=null){ | |
| 532 | + line=map.get("line").toString(); | |
| 533 | + } | |
| 534 | + String date=""; | |
| 535 | + if(map.get("date")!=null){ | |
| 536 | + date=map.get("date").toString(); | |
| 537 | + } | |
| 538 | + String date2=""; | |
| 539 | + if(map.get("date2")!=null){ | |
| 540 | + date2=map.get("date2").toString(); | |
| 541 | + } | |
| 542 | + String xlName=""; | |
| 543 | + if(map.get("xlName")!=null){ | |
| 544 | + xlName=map.get("xlName").toString(); | |
| 545 | + } | |
| 546 | + return scheduleRealInfoService.scheduleCorrectionReport(gsdm,fgsdm,line, date,date2); | |
| 547 | + } | |
| 548 | + | |
| 549 | + @RequestMapping(value="/MapById",method = RequestMethod.GET) | |
| 550 | + public Map<String, Object> MapById(@RequestParam("id") Long id){ | |
| 551 | + return scheduleRealInfoService.MapById(id); | |
| 552 | + } | |
| 553 | + | |
| 554 | + @RequestMapping(value="/MapByIdQp",method = RequestMethod.GET) | |
| 555 | + public Map<String, Object> MapByIdQp(@RequestParam("id") Long id){ | |
| 556 | + return scheduleRealInfoService.MapByIdQp(id); | |
| 557 | + } | |
| 558 | + | |
| 559 | + /** | |
| 560 | + * @Title: scheduleDaily | |
| 561 | + * @Description: TODO(调度日报表) | |
| 562 | + * @param line 线路 | |
| 563 | + * @param date 时间 | |
| 564 | + * @return | |
| 565 | + */ | |
| 566 | + @RequestMapping(value="/scheduleDaily") | |
| 567 | + public Map<String,Object> scheduleDaily(@RequestParam String line,@RequestParam String date){ | |
| 568 | + return scheduleRealInfoService.scheduleDaily(line,date); | |
| 569 | + } | |
| 570 | + | |
| 571 | + @RequestMapping(value="/realScheduleList") | |
| 572 | + public List<ScheduleRealInfo> realScheduleList(@RequestParam String line,@RequestParam String date){ | |
| 573 | + return scheduleRealInfoService.realScheduleList(line,date); | |
| 574 | + } | |
| 575 | + | |
| 576 | + @RequestMapping(value="/realScheduleList_zrw") | |
| 577 | + public List<ScheduleRealInfo> realScheduleList_zrw(@RequestParam String line,@RequestParam String date){ | |
| 578 | + return scheduleRealInfoService.realScheduleList_zrw(line,date); | |
| 579 | + } | |
| 580 | + | |
| 581 | + @RequestMapping(value="/realScheduleList_mh_2") | |
| 582 | + public List<ScheduleRealInfo> realScheduleList_mh_2(@RequestParam String line,@RequestParam String date){ | |
| 583 | + return scheduleRealInfoService.realScheduleList_mh_2(line,date); | |
| 584 | + } | |
| 585 | + | |
| 586 | + @RequestMapping(value="/realScheduleListQp") | |
| 587 | + public List<ScheduleRealInfo> realScheduleListQp(@RequestParam String line,@RequestParam String date){ | |
| 588 | + return scheduleRealInfoService.realScheduleListQp(line,date); | |
| 589 | + } | |
| 590 | + | |
| 591 | + @RequestMapping(value="/multi_tzrc", method=RequestMethod.POST) | |
| 592 | + public Map<String, Object> multi_tzrc(@RequestParam String cpcsJson){ | |
| 593 | + cpcsJson = StringEscapeUtils.unescapeHtml4(cpcsJson); | |
| 594 | + List<ChangePersonCar> cpcs = JSONArray.parseArray(cpcsJson, ChangePersonCar.class); | |
| 595 | + return scheduleRealInfoService.multi_tzrc(cpcs, null); | |
| 596 | + } | |
| 597 | + | |
| 598 | + @RequestMapping(value="/multi_dftz", method=RequestMethod.POST) | |
| 599 | + public Map<String, Object> multi_dftz(@RequestParam String dcsJson){ | |
| 600 | + dcsJson = StringEscapeUtils.unescapeHtml4(dcsJson); | |
| 601 | + List<DfsjChange> dfsjcs = JSONArray.parseArray(dcsJson, DfsjChange.class); | |
| 602 | + return scheduleRealInfoService.multi_dftz(dfsjcs); | |
| 603 | + } | |
| 604 | + | |
| 605 | + @RequestMapping(value="/changeBcType/{id}", method=RequestMethod.POST) | |
| 606 | + public Map<String, Object> changeBcType(@PathVariable("id") Long id, String bcType, String remarks, String majorStationName){ | |
| 607 | + return scheduleRealInfoService.changeBcType(id, bcType, remarks, majorStationName); | |
| 608 | + } | |
| 609 | + | |
| 610 | + @RequestMapping(value="/history", method=RequestMethod.POST) | |
| 611 | + public Map<String,Object> historySave(ScheduleRealInfo sch){ | |
| 612 | + return scheduleRealInfoService.historySave(sch); | |
| 613 | + } | |
| 614 | + | |
| 615 | + | |
| 616 | + private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd"); | |
| 617 | + private final static long ONE_DAY = 1000 * 60 * 60 * 24; | |
| 618 | + /** | |
| 619 | + * 获取可编辑的历史班次日期 | |
| 620 | + * @return | |
| 621 | + */ | |
| 622 | + @RequestMapping("dateArray") | |
| 623 | + public List<String> dateArray(@RequestParam(defaultValue = "0") int c){ | |
| 624 | + List<String> rs = new ArrayList<>(); | |
| 625 | + | |
| 626 | + long t = System.currentTimeMillis(); | |
| 627 | + if(c != 1) | |
| 628 | + t -= (ONE_DAY + (1000 * 60 * 60 * 6)); | |
| 629 | + for(int i = 0; i < 4; i ++){ | |
| 630 | + rs.add(fmtyyyyMMdd.print(t)); | |
| 631 | + t -= ONE_DAY; | |
| 632 | + } | |
| 633 | + return rs; | |
| 634 | + } | |
| 635 | + | |
| 636 | + @RequestMapping(value = "svgAttr", method = RequestMethod.POST) | |
| 637 | + public Map<String, Object> svgAttr(@RequestParam String jsonStr){ | |
| 638 | + return scheduleRealInfoService.svgAttr(jsonStr); | |
| 639 | + } | |
| 640 | + | |
| 641 | + @RequestMapping(value = "svgAttr", method = RequestMethod.GET) | |
| 642 | + public Map<String, Object> findSvgAttr(@RequestParam String idx){ | |
| 643 | + return scheduleRealInfoService.findSvgAttr(idx); | |
| 644 | + } | |
| 645 | + | |
| 646 | + @RequestMapping(value = "addRemarks", method = RequestMethod.POST) | |
| 647 | + public Map<String, Object> addRemarks(@RequestParam Long id, @RequestParam String remarks){ | |
| 648 | + return scheduleRealInfoService.addRemarks(id, remarks); | |
| 649 | + } | |
| 650 | + | |
| 651 | + @RequestMapping(value = "scheduleDailyQp", method = RequestMethod.GET) | |
| 652 | + public List<Map<String, Object>> scheduleDailyQp(@RequestParam String line,@RequestParam String date){ | |
| 653 | + return scheduleRealInfoService.scheduleDailyQp(line,date); | |
| 654 | + } | |
| 655 | + | |
| 656 | + @RequestMapping(value = "scheduleDailyExport", method = RequestMethod.GET) | |
| 657 | + public List<Map<String, Object>> scheduleDailyExport(@RequestParam Map<String, Object> map){ | |
| 658 | + return scheduleRealInfoService.scheduleDailyExport(map); | |
| 659 | + } | |
| 660 | + | |
| 661 | + @RequestMapping(value = "exportWaybillMore", method = RequestMethod.GET) | |
| 662 | + public Map<String, Object> exportWaybillMore(@RequestParam Map<String, Object> map){ | |
| 663 | + return scheduleRealInfoService.exportWaybillMore(map); | |
| 664 | + } | |
| 665 | + | |
| 666 | + /** | |
| 667 | + * 获取当日计划排班 , 从计划表抓取数据 | |
| 668 | + * @return | |
| 669 | + */ | |
| 670 | + @RequestMapping(value = "currSchedulePlanByLineCode", method = RequestMethod.GET) | |
| 671 | + public List<SchedulePlanInfo> currentSchedulePlan(@RequestParam String lineCode){ | |
| 672 | + return scheduleRealInfoService.currentSchedulePlan(lineCode); | |
| 673 | + } | |
| 674 | + | |
| 675 | + @RequestMapping(value = "lpChangeMulti", method = RequestMethod.POST) | |
| 676 | + public Map<String, Object> lpChangeMulti(@RequestParam String leftIdx, @RequestParam String rightIdx,@RequestParam int type){ | |
| 677 | + return scheduleRealInfoService.lpChangeMulti(leftIdx, rightIdx, type); | |
| 678 | + } | |
| 679 | + | |
| 680 | + /** | |
| 681 | + * 删除当日实际排班 | |
| 682 | + * @return | |
| 683 | + */ | |
| 684 | + @RequestMapping(value = "deleteRealSchedule", method = RequestMethod.POST) | |
| 685 | + public Map<String, Object> deleteRealSchedule(@RequestParam String lineCode){ | |
| 686 | + return dayOfSchedule.deleteRealSchedule(lineCode); | |
| 687 | + } | |
| 688 | + | |
| 689 | + /** | |
| 690 | + * 从计划表重新加载当日排班 | |
| 691 | + * @param lineCode | |
| 692 | + * @return | |
| 693 | + */ | |
| 694 | + @RequestMapping(value = "reLoadRealSchedule", method = RequestMethod.POST) | |
| 695 | + public Map<String, Object> reLoadRealSchedule(@RequestParam String lineCode){ | |
| 696 | + Map<String, Object> rs = new HashMap<>(); | |
| 697 | + List<ScheduleRealInfo> list = dayOfSchedule.findByLineCode(lineCode); | |
| 698 | + if(list != null && list.size() > 0){ | |
| 699 | + rs.put("status", ResponseCode.ERROR); | |
| 700 | + rs.put("msg", "失败," + list.get(0).getXlName() + "当日存在实际排班,无法重新加载。"); | |
| 701 | + return rs; | |
| 702 | + } | |
| 703 | + | |
| 704 | + int code = dayOfSchedule.reloadSch(lineCode); | |
| 705 | + | |
| 706 | + //重新按公司编码索引数据 | |
| 707 | + dayOfSchedule.groupByGsbm(); | |
| 708 | + rs.put("status", code==0? ResponseCode.SUCCESS: ResponseCode.ERROR); | |
| 709 | + return rs; | |
| 710 | + } | |
| 711 | + | |
| 712 | + /** | |
| 713 | + * 误点调整 | |
| 714 | + * @param idx | |
| 715 | + * @param minute | |
| 716 | + * @return | |
| 717 | + */ | |
| 718 | + @RequestMapping(value = "lateAdjust", method = RequestMethod.POST) | |
| 719 | + public Map<String, Object> lateAdjust(@RequestParam String idx,@RequestParam float minute ){ | |
| 720 | + return scheduleRealInfoService.lateAdjust(idx, minute); | |
| 721 | + } | |
| 722 | + | |
| 723 | + /** | |
| 724 | + * 获取所有应发未到的班次 | |
| 725 | + * @param idx | |
| 726 | + * @return | |
| 727 | + */ | |
| 728 | + @RequestMapping(value = "allLate2") | |
| 729 | + public List<ScheduleRealInfo> allLate2(@RequestParam String idx){ | |
| 730 | + return scheduleRealInfoService.allLate2(idx); | |
| 731 | + } | |
| 732 | + | |
| 733 | + /** | |
| 734 | + * 添加一个临加到历史库 | |
| 735 | + * @param sch | |
| 736 | + * @return | |
| 737 | + */ | |
| 738 | + @RequestMapping(value = "history/add", method = RequestMethod.POST) | |
| 739 | + public Map<String, Object> addToHistory(ScheduleRealInfo sch){ | |
| 740 | + return scheduleRealInfoService.addToHistory(sch); | |
| 741 | + } | |
| 742 | + | |
| 743 | + /** | |
| 744 | + * 从历史库里删除临加班次 | |
| 745 | + * @param sch | |
| 746 | + * @return | |
| 747 | + */ | |
| 748 | + @RequestMapping(value = "history/{id}", method = RequestMethod.DELETE) | |
| 749 | + public Map<String, Object> deleteToHistory(@PathVariable("id") Long id){ | |
| 750 | + return scheduleRealInfoService.deleteToHistory(id); | |
| 751 | + } | |
| 752 | + | |
| 753 | + /** | |
| 754 | + * 从历史库里删除临加班次 | |
| 755 | + * @param sch | |
| 756 | + * @return | |
| 757 | + */ | |
| 758 | + @RequestMapping(value = "wxsb", method = RequestMethod.POST) | |
| 759 | + public Map<String, Object> deleteToHistory(@RequestParam Map<String, Object> param){ | |
| 760 | + SysUser user = SecurityUtils.getCurrentUser(); | |
| 761 | + String uname = user.getUserName(); | |
| 762 | + StringBuilder url = new StringBuilder(ConfigUtil.get("http.report.url")); | |
| 763 | + url.append("?nbbm=").append(param.get("nbbm")).append("&bxy=").append(uname).append("&bxbm=").append(param.get("bxType")); | |
| 764 | + // 分公司保存格式 分公司编码_公司编码 | |
| 765 | + String val = BasicData.nbbm2FgsCompanyCodeMap.get(param.get("nbbm")); | |
| 766 | + String[] arr = val.split("_"); | |
| 767 | + if (!"22".equals(arr[1])) { | |
| 768 | + Map<String, Object> res = new HashMap<String, Object>(); | |
| 769 | + res.put("status", ResponseCode.ERROR); | |
| 770 | + res.put("msg", "除金高公司外暂未开通此功能"); | |
| 771 | + | |
| 772 | + return res; | |
| 773 | + } | |
| 774 | + url.append("&fgs=").append(arr[0]); | |
| 775 | + | |
| 776 | + return request(url.toString()); | |
| 777 | + } | |
| 778 | + | |
| 779 | + @SuppressWarnings("unchecked") | |
| 780 | + private static Map<String, Object> request(String url) { | |
| 781 | + Map<String, Object> res = new HashMap<String, Object>(); | |
| 782 | + res.put("status", ResponseCode.SUCCESS); | |
| 783 | + InputStream in = null; | |
| 784 | + HttpURLConnection con = null; | |
| 785 | + try { | |
| 786 | + con = (HttpURLConnection)new URL(url).openConnection(); | |
| 787 | + con.setRequestMethod("POST"); | |
| 788 | + con.setRequestProperty("keep-alive", "true"); | |
| 789 | + con.setRequestProperty("accept", "application/json"); | |
| 790 | + con.setRequestProperty("content-type", "application/json"); | |
| 791 | + con.setDoInput(true); | |
| 792 | + con.setReadTimeout(2500); | |
| 793 | + con.setConnectTimeout(2500); | |
| 794 | + | |
| 795 | + con.connect(); | |
| 796 | + if (con.getResponseCode() == 200) { | |
| 797 | + in = con.getInputStream(); | |
| 798 | + ByteArrayOutputStream bout = new ByteArrayOutputStream(); | |
| 799 | + IOUtils.copy(in, bout); bout.close(); | |
| 800 | + Map<String, Object> response = new ObjectMapper().readValue(bout.toByteArray(), Map.class); | |
| 801 | + if (!"报修成功".equals(response.get("msg"))) { | |
| 802 | + res.put("status", ResponseCode.ERROR); | |
| 803 | + res.putAll(response); | |
| 804 | + } | |
| 805 | + } | |
| 806 | + } catch (IOException e) { | |
| 807 | + // TODO Auto-generated catch block | |
| 808 | + res.put("status", ResponseCode.ERROR); | |
| 809 | + res.put("msg", "调用上报接口异常"); | |
| 810 | + } finally { | |
| 811 | + try { | |
| 812 | + if (in != null) in.close(); | |
| 813 | + if (con != null) con.disconnect(); | |
| 814 | + } catch (IOException e) { | |
| 815 | + // TODO Auto-generated catch block | |
| 816 | + e.printStackTrace(); | |
| 817 | + } | |
| 818 | + } | |
| 819 | + | |
| 820 | + return res; | |
| 821 | + } | |
| 822 | +} | ... | ... |
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
| ... | ... | @@ -21,6 +21,8 @@ public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, L |
| 21 | 21 | |
| 22 | 22 | Map<String, Object> outgoAdjust(Long id, String remarks, String dfsj, String bcType, String opType,String userId); |
| 23 | 23 | |
| 24 | + Map<String, Object> outgoAdjusttwo(String dfsj); | |
| 25 | + | |
| 24 | 26 | Map<String, Object> destroy(String idsStr/*, int spaceAdjust*/, String remarks, String reason/*, int spaceNum*/, String userId); |
| 25 | 27 | |
| 26 | 28 | List<Map<String, String>> findDriverByLine(String lineCode); | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray; |
| 5 | 5 | import com.alibaba.fastjson.JSONObject; |
| 6 | 6 | import com.bsth.common.Constants; |
| 7 | 7 | import com.bsth.common.ResponseCode; |
| 8 | +import com.bsth.controller.realcontrol.ScheduleRealInfoController; | |
| 8 | 9 | import com.bsth.controller.realcontrol.dto.ChangePersonCar; |
| 9 | 10 | import com.bsth.controller.realcontrol.dto.DfsjChange; |
| 10 | 11 | import com.bsth.controller.realcontrol.dto.LpData; |
| ... | ... | @@ -329,6 +330,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 329 | 330 | map.put("t", schedule); |
| 330 | 331 | return map; |
| 331 | 332 | } |
| 333 | + Date date = new Date(); | |
| 334 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |
| 335 | + String year = sdf.format(date); | |
| 336 | + String d1 =year+" "+ schedule.getDfsj() ; | |
| 337 | + SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm"); | |
| 338 | + String d2 = sd.format(date); | |
| 339 | + if(Long.parseLong(dateToStamp(d1)) + ScheduleRealInfoController.dfsj * 1000 * 60 < Long.parseLong(dateToStamp(d2)) ){ | |
| 340 | + map.put("status", ResponseCode.SUCCESS); | |
| 341 | + map.put("flag", "4009"); | |
| 342 | + map.put("t", schedule); | |
| 343 | + return map; | |
| 344 | + } | |
| 332 | 345 | |
| 333 | 346 | LineConfig config = lineConfigData.get(schedule.getXlBm()); |
| 334 | 347 | //小于线路开始运营时间,则默认跨过24点 |
| ... | ... | @@ -403,6 +416,37 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 403 | 416 | return map; |
| 404 | 417 | } |
| 405 | 418 | |
| 419 | + | |
| 420 | + | |
| 421 | + @Override | |
| 422 | + public Map<String, Object> outgoAdjusttwo(String dfsj) { | |
| 423 | + Map<String, Object> map = new HashMap<>(); | |
| 424 | + try { | |
| 425 | + Date date = new Date(); | |
| 426 | + SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm"); | |
| 427 | + String d2 = sd.format(date); | |
| 428 | + if(Long.parseLong(dfsj) + ScheduleRealInfoController.dfsj * 1000 * 60 < Long.parseLong(dateToStamp(d2))){ | |
| 429 | + map.put("status", ResponseCode.SUCCESS); | |
| 430 | + map.put("flag", "4009"); | |
| 431 | + return map; | |
| 432 | + } | |
| 433 | + }catch (Exception e) { | |
| 434 | + logger.error("", e); | |
| 435 | + map.put("status", ResponseCode.ERROR); | |
| 436 | + } | |
| 437 | + return map; | |
| 438 | + } | |
| 439 | + | |
| 440 | + public static String dateToStamp(String s) throws ParseException { | |
| 441 | + String res; | |
| 442 | + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm"); | |
| 443 | + Date date = simpleDateFormat.parse(s); | |
| 444 | + long ts = date.getTime(); | |
| 445 | + res = String.valueOf(ts); | |
| 446 | + return res; | |
| 447 | + } | |
| 448 | + | |
| 449 | + | |
| 406 | 450 | @Override |
| 407 | 451 | public Map<String, Object> destroy(String idsStr, String remarks, String reason, String userId) { |
| 408 | 452 | ... | ... |
src/main/resources/static/pages/home.html
| ... | ... | @@ -59,7 +59,7 @@ |
| 59 | 59 | } |
| 60 | 60 | </style> |
| 61 | 61 | <div class="system_change_log"> |
| 62 | - <h2 style="text-indent: 35px;margin: 10px 0 5px;">2018-08-23 更新说明 Changelog</h2> | |
| 62 | + <!--<h2 style="text-indent: 35px;margin: 10px 0 5px;">2018-08-23 更新说明 Changelog</h2> | |
| 63 | 63 | <br><br> |
| 64 | 64 | <ul > |
| 65 | 65 | <li class="sub_title"><h6>计划调度</h6></li> |
| ... | ... | @@ -81,4 +81,12 @@ |
| 81 | 81 | <li><span class="label s_c_change">修复</span>1、车辆设备管理,只有新增,没有修改、作废,启用日期使用保存的时间。</li> |
| 82 | 82 | <li><span class="label s_c_change">修复</span>2、线路相关问题优化(站点缓冲区修改多边形中心点可拖动,可以修改为圆形、修改后定位、线路文件上传可填写版本)。</li> |
| 83 | 83 | </ul> |
| 84 | +--> | |
| 85 | + | |
| 86 | + <h2 style="text-indent: 35px;margin: 10px 0 5px;">2020-08-24 更新说明 Changelog</h2> | |
| 87 | + <br><br> | |
| 88 | + <ul > | |
| 89 | + <li class="sub_title"><h6>线调</h6></li> | |
| 90 | + <li><span class="label s_c_change">修改</span>1、线调,时间超出待发时候后,锁定待发,禁止修改待发时间。</li> | |
| 91 | + </ul> | |
| 84 | 92 | </div> | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/README.md
0 → 100644
| 1 | +[jQuery Validation Plugin](http://jqueryvalidation.org/) - Form validation made easy | |
| 2 | +================================ | |
| 3 | + | |
| 4 | +[](http://travis-ci.org/jzaefferer/jquery-validation) | |
| 5 | +[](https://david-dm.org/jzaefferer/jquery-validation#info=devDependencies) | |
| 6 | + | |
| 7 | +The jQuery Validation Plugin provides drop-in validation for your existing forms, while making all kinds of customizations to fit your application really easy. | |
| 8 | + | |
| 9 | +## [Help the project](http://pledgie.com/campaigns/18159) | |
| 10 | + | |
| 11 | +[](http://pledgie.com/campaigns/18159) | |
| 12 | + | |
| 13 | +This project is looking for help! [You can donate to the ongoing pledgie campaign](http://pledgie.com/campaigns/18159) | |
| 14 | +and help spread the word. If you've used the plugin, or plan to use, consider a donation - any amount will help. | |
| 15 | + | |
| 16 | +You can find the plan for how to spend the money on the [pledgie page](http://pledgie.com/campaigns/18159). | |
| 17 | + | |
| 18 | +## Getting Started | |
| 19 | + | |
| 20 | +### Downloading the prebuilt files | |
| 21 | + | |
| 22 | +Prebuilt files can be downloaded from http://jqueryvalidation.org/ | |
| 23 | + | |
| 24 | +### Downloading the latest changes | |
| 25 | + | |
| 26 | +The unreleased development files can be obtained by: | |
| 27 | + | |
| 28 | + 1. [Downloading](https://github.com/jzaefferer/jquery-validation/archive/master.zip) or Forking this repository | |
| 29 | + 2. [Setup the build](CONTRIBUTING.md#build-setup) | |
| 30 | + 3. Run `grunt` to create the built files in the "dist" directory | |
| 31 | + | |
| 32 | +### Including it on your page | |
| 33 | + | |
| 34 | +Include jQuery and the plugin on a page. Then select a form to validate and call the `validate` method. | |
| 35 | + | |
| 36 | +```html | |
| 37 | +<form> | |
| 38 | + <input required> | |
| 39 | +</form> | |
| 40 | +<script src="jquery.js"></script> | |
| 41 | +<script src="jquery.validate.js"></script> | |
| 42 | +<script> | |
| 43 | +$("form").validate(); | |
| 44 | +</script> | |
| 45 | +``` | |
| 46 | + | |
| 47 | +Alternatively include jQuery and the plugin via requirejs in your module. | |
| 48 | + | |
| 49 | +```js | |
| 50 | +define(["jquery", "jquery.validate"], function( $ ) { | |
| 51 | + $("form").validate(); | |
| 52 | +}); | |
| 53 | +``` | |
| 54 | + | |
| 55 | +For more information on how to setup a rules and customizations, [check the documentation](http://jqueryvalidation.org/documentation/). | |
| 56 | + | |
| 57 | +## Reporting issues and contributing code | |
| 58 | + | |
| 59 | +See the [Contributing Guidelines](CONTRIBUTING.md) for details. | |
| 60 | + | |
| 61 | +**IMPORTANT NOTE ABOUT EMAIL VALIDATION**. As of version 1.12.0 this plugin is using the same regular expression that the [HTML5 specification suggests for browsers to use](https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address). We will follow their lead and use the same check. If you think the specification is wrong, please report the issue to them. If you have different requirements, consider [using a custom method](http://jqueryvalidation.org/jQuery.validator.addMethod/). | |
| 62 | + | |
| 63 | +## License | |
| 64 | +Copyright © Jörn Zaefferer<br> | |
| 65 | +Licensed under the MIT license. | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/additional-methods.js
0 → 100644
| 1 | +/*! | |
| 2 | + * jQuery Validation Plugin v1.14.0 | |
| 3 | + * | |
| 4 | + * http://jqueryvalidation.org/ | |
| 5 | + * | |
| 6 | + * Copyright (c) 2015 Jörn Zaefferer | |
| 7 | + * Released under the MIT license | |
| 8 | + */ | |
| 9 | +(function( factory ) { | |
| 10 | + if ( typeof define === "function" && define.amd ) { | |
| 11 | + define( ["jquery", "./jquery.validate"], factory ); | |
| 12 | + } else { | |
| 13 | + factory( jQuery ); | |
| 14 | + } | |
| 15 | +}(function( $ ) { | |
| 16 | + | |
| 17 | +(function() { | |
| 18 | + | |
| 19 | + function stripHtml(value) { | |
| 20 | + // remove html tags and space chars | |
| 21 | + return value.replace(/<.[^<>]*?>/g, " ").replace(/ | /gi, " ") | |
| 22 | + // remove punctuation | |
| 23 | + .replace(/[.(),;:!?%#$'\"_+=\/\-“”’]*/g, ""); | |
| 24 | + } | |
| 25 | + | |
| 26 | + $.validator.addMethod("maxWords", function(value, element, params) { | |
| 27 | + return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length <= params; | |
| 28 | + }, $.validator.format("Please enter {0} words or less.")); | |
| 29 | + | |
| 30 | + $.validator.addMethod("minWords", function(value, element, params) { | |
| 31 | + return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length >= params; | |
| 32 | + }, $.validator.format("Please enter at least {0} words.")); | |
| 33 | + | |
| 34 | + $.validator.addMethod("rangeWords", function(value, element, params) { | |
| 35 | + var valueStripped = stripHtml(value), | |
| 36 | + regex = /\b\w+\b/g; | |
| 37 | + return this.optional(element) || valueStripped.match(regex).length >= params[0] && valueStripped.match(regex).length <= params[1]; | |
| 38 | + }, $.validator.format("Please enter between {0} and {1} words.")); | |
| 39 | + $.validator.addMethod("passwordRule", function(value, element, param) { | |
| 40 | + var length = value.length; | |
| 41 | + var letter=/^.*[a-zA-Z]+.*$/; | |
| 42 | + var num=/^.*[0-9]+.*$/; | |
| 43 | + var symbol=/^.*([^a-zA-Z0-9])+.*$/; | |
| 44 | + return length>10&& letter.test(value)&& num.test(value)&&symbol.test(value); | |
| 45 | + }, $.validator.format("请确保输入的值包含字母、数字、特殊符号")); | |
| 46 | +}()); | |
| 47 | + | |
| 48 | +// Accept a value from a file input based on a required mimetype | |
| 49 | +$.validator.addMethod("accept", function(value, element, param) { | |
| 50 | + // Split mime on commas in case we have multiple types we can accept | |
| 51 | + var typeParam = typeof param === "string" ? param.replace(/\s/g, "").replace(/,/g, "|") : "image/*", | |
| 52 | + optionalValue = this.optional(element), | |
| 53 | + i, file; | |
| 54 | + | |
| 55 | + // Element is optional | |
| 56 | + if (optionalValue) { | |
| 57 | + return optionalValue; | |
| 58 | + } | |
| 59 | + | |
| 60 | + if ($(element).attr("type") === "file") { | |
| 61 | + // If we are using a wildcard, make it regex friendly | |
| 62 | + typeParam = typeParam.replace(/\*/g, ".*"); | |
| 63 | + | |
| 64 | + // Check if the element has a FileList before checking each file | |
| 65 | + if (element.files && element.files.length) { | |
| 66 | + for (i = 0; i < element.files.length; i++) { | |
| 67 | + file = element.files[i]; | |
| 68 | + | |
| 69 | + // Grab the mimetype from the loaded file, verify it matches | |
| 70 | + if (!file.type.match(new RegExp( "\\.?(" + typeParam + ")$", "i"))) { | |
| 71 | + return false; | |
| 72 | + } | |
| 73 | + } | |
| 74 | + } | |
| 75 | + } | |
| 76 | + | |
| 77 | + // Either return true because we've validated each file, or because the | |
| 78 | + // browser does not support element.files and the FileList feature | |
| 79 | + return true; | |
| 80 | +}, $.validator.format("Please enter a value with a valid mimetype.")); | |
| 81 | + | |
| 82 | +$.validator.addMethod("alphanumeric", function(value, element) { | |
| 83 | + return this.optional(element) || /^\w+$/i.test(value); | |
| 84 | +}, "Letters, numbers, and underscores only please"); | |
| 85 | + | |
| 86 | +/* | |
| 87 | + * Dutch bank account numbers (not 'giro' numbers) have 9 digits | |
| 88 | + * and pass the '11 check'. | |
| 89 | + * We accept the notation with spaces, as that is common. | |
| 90 | + * acceptable: 123456789 or 12 34 56 789 | |
| 91 | + */ | |
| 92 | +$.validator.addMethod("bankaccountNL", function(value, element) { | |
| 93 | + if (this.optional(element)) { | |
| 94 | + return true; | |
| 95 | + } | |
| 96 | + if (!(/^[0-9]{9}|([0-9]{2} ){3}[0-9]{3}$/.test(value))) { | |
| 97 | + return false; | |
| 98 | + } | |
| 99 | + // now '11 check' | |
| 100 | + var account = value.replace(/ /g, ""), // remove spaces | |
| 101 | + sum = 0, | |
| 102 | + len = account.length, | |
| 103 | + pos, factor, digit; | |
| 104 | + for ( pos = 0; pos < len; pos++ ) { | |
| 105 | + factor = len - pos; | |
| 106 | + digit = account.substring(pos, pos + 1); | |
| 107 | + sum = sum + factor * digit; | |
| 108 | + } | |
| 109 | + return sum % 11 === 0; | |
| 110 | +}, "Please specify a valid bank account number"); | |
| 111 | + | |
| 112 | +$.validator.addMethod("bankorgiroaccountNL", function(value, element) { | |
| 113 | + return this.optional(element) || | |
| 114 | + ($.validator.methods.bankaccountNL.call(this, value, element)) || | |
| 115 | + ($.validator.methods.giroaccountNL.call(this, value, element)); | |
| 116 | +}, "Please specify a valid bank or giro account number"); | |
| 117 | + | |
| 118 | +/** | |
| 119 | + * BIC is the business identifier code (ISO 9362). This BIC check is not a guarantee for authenticity. | |
| 120 | + * | |
| 121 | + * BIC pattern: BBBBCCLLbbb (8 or 11 characters long; bbb is optional) | |
| 122 | + * | |
| 123 | + * BIC definition in detail: | |
| 124 | + * - First 4 characters - bank code (only letters) | |
| 125 | + * - Next 2 characters - ISO 3166-1 alpha-2 country code (only letters) | |
| 126 | + * - Next 2 characters - location code (letters and digits) | |
| 127 | + * a. shall not start with '0' or '1' | |
| 128 | + * b. second character must be a letter ('O' is not allowed) or one of the following digits ('0' for test (therefore not allowed), '1' for passive participant and '2' for active participant) | |
| 129 | + * - Last 3 characters - branch code, optional (shall not start with 'X' except in case of 'XXX' for primary office) (letters and digits) | |
| 130 | + */ | |
| 131 | +$.validator.addMethod("bic", function(value, element) { | |
| 132 | + return this.optional( element ) || /^([A-Z]{6}[A-Z2-9][A-NP-Z1-2])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test( value ); | |
| 133 | +}, "Please specify a valid BIC code"); | |
| 134 | + | |
| 135 | +/* | |
| 136 | + * Código de identificación fiscal ( CIF ) is the tax identification code for Spanish legal entities | |
| 137 | + * Further rules can be found in Spanish on http://es.wikipedia.org/wiki/C%C3%B3digo_de_identificaci%C3%B3n_fiscal | |
| 138 | + */ | |
| 139 | +$.validator.addMethod( "cifES", function( value ) { | |
| 140 | + "use strict"; | |
| 141 | + | |
| 142 | + var num = [], | |
| 143 | + controlDigit, sum, i, count, tmp, secondDigit; | |
| 144 | + | |
| 145 | + value = value.toUpperCase(); | |
| 146 | + | |
| 147 | + // Quick format test | |
| 148 | + if ( !value.match( "((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)" ) ) { | |
| 149 | + return false; | |
| 150 | + } | |
| 151 | + | |
| 152 | + for ( i = 0; i < 9; i++ ) { | |
| 153 | + num[ i ] = parseInt( value.charAt( i ), 10 ); | |
| 154 | + } | |
| 155 | + | |
| 156 | + // Algorithm for checking CIF codes | |
| 157 | + sum = num[ 2 ] + num[ 4 ] + num[ 6 ]; | |
| 158 | + for ( count = 1; count < 8; count += 2 ) { | |
| 159 | + tmp = ( 2 * num[ count ] ).toString(); | |
| 160 | + secondDigit = tmp.charAt( 1 ); | |
| 161 | + | |
| 162 | + sum += parseInt( tmp.charAt( 0 ), 10 ) + ( secondDigit === "" ? 0 : parseInt( secondDigit, 10 ) ); | |
| 163 | + } | |
| 164 | + | |
| 165 | + /* The first (position 1) is a letter following the following criteria: | |
| 166 | + * A. Corporations | |
| 167 | + * B. LLCs | |
| 168 | + * C. General partnerships | |
| 169 | + * D. Companies limited partnerships | |
| 170 | + * E. Communities of goods | |
| 171 | + * F. Cooperative Societies | |
| 172 | + * G. Associations | |
| 173 | + * H. Communities of homeowners in horizontal property regime | |
| 174 | + * J. Civil Societies | |
| 175 | + * K. Old format | |
| 176 | + * L. Old format | |
| 177 | + * M. Old format | |
| 178 | + * N. Nonresident entities | |
| 179 | + * P. Local authorities | |
| 180 | + * Q. Autonomous bodies, state or not, and the like, and congregations and religious institutions | |
| 181 | + * R. Congregations and religious institutions (since 2008 ORDER EHA/451/2008) | |
| 182 | + * S. Organs of State Administration and regions | |
| 183 | + * V. Agrarian Transformation | |
| 184 | + * W. Permanent establishments of non-resident in Spain | |
| 185 | + */ | |
| 186 | + if ( /^[ABCDEFGHJNPQRSUVW]{1}/.test( value ) ) { | |
| 187 | + sum += ""; | |
| 188 | + controlDigit = 10 - parseInt( sum.charAt( sum.length - 1 ), 10 ); | |
| 189 | + value += controlDigit; | |
| 190 | + return ( num[ 8 ].toString() === String.fromCharCode( 64 + controlDigit ) || num[ 8 ].toString() === value.charAt( value.length - 1 ) ); | |
| 191 | + } | |
| 192 | + | |
| 193 | + return false; | |
| 194 | + | |
| 195 | +}, "Please specify a valid CIF number." ); | |
| 196 | + | |
| 197 | +/* | |
| 198 | + * Brazillian CPF number (Cadastrado de Pessoas Físicas) is the equivalent of a Brazilian tax registration number. | |
| 199 | + * CPF numbers have 11 digits in total: 9 numbers followed by 2 check numbers that are being used for validation. | |
| 200 | + */ | |
| 201 | +$.validator.addMethod("cpfBR", function(value) { | |
| 202 | + // Removing special characters from value | |
| 203 | + value = value.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g, ""); | |
| 204 | + | |
| 205 | + // Checking value to have 11 digits only | |
| 206 | + if (value.length !== 11) { | |
| 207 | + return false; | |
| 208 | + } | |
| 209 | + | |
| 210 | + var sum = 0, | |
| 211 | + firstCN, secondCN, checkResult, i; | |
| 212 | + | |
| 213 | + firstCN = parseInt(value.substring(9, 10), 10); | |
| 214 | + secondCN = parseInt(value.substring(10, 11), 10); | |
| 215 | + | |
| 216 | + checkResult = function(sum, cn) { | |
| 217 | + var result = (sum * 10) % 11; | |
| 218 | + if ((result === 10) || (result === 11)) {result = 0;} | |
| 219 | + return (result === cn); | |
| 220 | + }; | |
| 221 | + | |
| 222 | + // Checking for dump data | |
| 223 | + if (value === "" || | |
| 224 | + value === "00000000000" || | |
| 225 | + value === "11111111111" || | |
| 226 | + value === "22222222222" || | |
| 227 | + value === "33333333333" || | |
| 228 | + value === "44444444444" || | |
| 229 | + value === "55555555555" || | |
| 230 | + value === "66666666666" || | |
| 231 | + value === "77777777777" || | |
| 232 | + value === "88888888888" || | |
| 233 | + value === "99999999999" | |
| 234 | + ) { | |
| 235 | + return false; | |
| 236 | + } | |
| 237 | + | |
| 238 | + // Step 1 - using first Check Number: | |
| 239 | + for ( i = 1; i <= 9; i++ ) { | |
| 240 | + sum = sum + parseInt(value.substring(i - 1, i), 10) * (11 - i); | |
| 241 | + } | |
| 242 | + | |
| 243 | + // If first Check Number (CN) is valid, move to Step 2 - using second Check Number: | |
| 244 | + if ( checkResult(sum, firstCN) ) { | |
| 245 | + sum = 0; | |
| 246 | + for ( i = 1; i <= 10; i++ ) { | |
| 247 | + sum = sum + parseInt(value.substring(i - 1, i), 10) * (12 - i); | |
| 248 | + } | |
| 249 | + return checkResult(sum, secondCN); | |
| 250 | + } | |
| 251 | + return false; | |
| 252 | + | |
| 253 | +}, "Please specify a valid CPF number"); | |
| 254 | + | |
| 255 | +/* NOTICE: Modified version of Castle.Components.Validator.CreditCardValidator | |
| 256 | + * Redistributed under the the Apache License 2.0 at http://www.apache.org/licenses/LICENSE-2.0 | |
| 257 | + * Valid Types: mastercard, visa, amex, dinersclub, enroute, discover, jcb, unknown, all (overrides all other settings) | |
| 258 | + */ | |
| 259 | +$.validator.addMethod("creditcardtypes", function(value, element, param) { | |
| 260 | + if (/[^0-9\-]+/.test(value)) { | |
| 261 | + return false; | |
| 262 | + } | |
| 263 | + | |
| 264 | + value = value.replace(/\D/g, ""); | |
| 265 | + | |
| 266 | + var validTypes = 0x0000; | |
| 267 | + | |
| 268 | + if (param.mastercard) { | |
| 269 | + validTypes |= 0x0001; | |
| 270 | + } | |
| 271 | + if (param.visa) { | |
| 272 | + validTypes |= 0x0002; | |
| 273 | + } | |
| 274 | + if (param.amex) { | |
| 275 | + validTypes |= 0x0004; | |
| 276 | + } | |
| 277 | + if (param.dinersclub) { | |
| 278 | + validTypes |= 0x0008; | |
| 279 | + } | |
| 280 | + if (param.enroute) { | |
| 281 | + validTypes |= 0x0010; | |
| 282 | + } | |
| 283 | + if (param.discover) { | |
| 284 | + validTypes |= 0x0020; | |
| 285 | + } | |
| 286 | + if (param.jcb) { | |
| 287 | + validTypes |= 0x0040; | |
| 288 | + } | |
| 289 | + if (param.unknown) { | |
| 290 | + validTypes |= 0x0080; | |
| 291 | + } | |
| 292 | + if (param.all) { | |
| 293 | + validTypes = 0x0001 | 0x0002 | 0x0004 | 0x0008 | 0x0010 | 0x0020 | 0x0040 | 0x0080; | |
| 294 | + } | |
| 295 | + if (validTypes & 0x0001 && /^(5[12345])/.test(value)) { //mastercard | |
| 296 | + return value.length === 16; | |
| 297 | + } | |
| 298 | + if (validTypes & 0x0002 && /^(4)/.test(value)) { //visa | |
| 299 | + return value.length === 16; | |
| 300 | + } | |
| 301 | + if (validTypes & 0x0004 && /^(3[47])/.test(value)) { //amex | |
| 302 | + return value.length === 15; | |
| 303 | + } | |
| 304 | + if (validTypes & 0x0008 && /^(3(0[012345]|[68]))/.test(value)) { //dinersclub | |
| 305 | + return value.length === 14; | |
| 306 | + } | |
| 307 | + if (validTypes & 0x0010 && /^(2(014|149))/.test(value)) { //enroute | |
| 308 | + return value.length === 15; | |
| 309 | + } | |
| 310 | + if (validTypes & 0x0020 && /^(6011)/.test(value)) { //discover | |
| 311 | + return value.length === 16; | |
| 312 | + } | |
| 313 | + if (validTypes & 0x0040 && /^(3)/.test(value)) { //jcb | |
| 314 | + return value.length === 16; | |
| 315 | + } | |
| 316 | + if (validTypes & 0x0040 && /^(2131|1800)/.test(value)) { //jcb | |
| 317 | + return value.length === 15; | |
| 318 | + } | |
| 319 | + if (validTypes & 0x0080) { //unknown | |
| 320 | + return true; | |
| 321 | + } | |
| 322 | + return false; | |
| 323 | +}, "Please enter a valid credit card number."); | |
| 324 | + | |
| 325 | +/** | |
| 326 | + * Validates currencies with any given symbols by @jameslouiz | |
| 327 | + * Symbols can be optional or required. Symbols required by default | |
| 328 | + * | |
| 329 | + * Usage examples: | |
| 330 | + * currency: ["£", false] - Use false for soft currency validation | |
| 331 | + * currency: ["$", false] | |
| 332 | + * currency: ["RM", false] - also works with text based symbols such as "RM" - Malaysia Ringgit etc | |
| 333 | + * | |
| 334 | + * <input class="currencyInput" name="currencyInput"> | |
| 335 | + * | |
| 336 | + * Soft symbol checking | |
| 337 | + * currencyInput: { | |
| 338 | + * currency: ["$", false] | |
| 339 | + * } | |
| 340 | + * | |
| 341 | + * Strict symbol checking (default) | |
| 342 | + * currencyInput: { | |
| 343 | + * currency: "$" | |
| 344 | + * //OR | |
| 345 | + * currency: ["$", true] | |
| 346 | + * } | |
| 347 | + * | |
| 348 | + * Multiple Symbols | |
| 349 | + * currencyInput: { | |
| 350 | + * currency: "$,£,¢" | |
| 351 | + * } | |
| 352 | + */ | |
| 353 | +$.validator.addMethod("currency", function(value, element, param) { | |
| 354 | + var isParamString = typeof param === "string", | |
| 355 | + symbol = isParamString ? param : param[0], | |
| 356 | + soft = isParamString ? true : param[1], | |
| 357 | + regex; | |
| 358 | + | |
| 359 | + symbol = symbol.replace(/,/g, ""); | |
| 360 | + symbol = soft ? symbol + "]" : symbol + "]?"; | |
| 361 | + regex = "^[" + symbol + "([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$"; | |
| 362 | + regex = new RegExp(regex); | |
| 363 | + return this.optional(element) || regex.test(value); | |
| 364 | + | |
| 365 | +}, "Please specify a valid currency"); | |
| 366 | + | |
| 367 | +$.validator.addMethod("dateFA", function(value, element) { | |
| 368 | + return this.optional(element) || /^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test(value); | |
| 369 | +}, $.validator.messages.date); | |
| 370 | + | |
| 371 | +/** | |
| 372 | + * Return true, if the value is a valid date, also making this formal check dd/mm/yyyy. | |
| 373 | + * | |
| 374 | + * @example $.validator.methods.date("01/01/1900") | |
| 375 | + * @result true | |
| 376 | + * | |
| 377 | + * @example $.validator.methods.date("01/13/1990") | |
| 378 | + * @result false | |
| 379 | + * | |
| 380 | + * @example $.validator.methods.date("01.01.1900") | |
| 381 | + * @result false | |
| 382 | + * | |
| 383 | + * @example <input name="pippo" class="{dateITA:true}" /> | |
| 384 | + * @desc Declares an optional input element whose value must be a valid date. | |
| 385 | + * | |
| 386 | + * @name $.validator.methods.dateITA | |
| 387 | + * @type Boolean | |
| 388 | + * @cat Plugins/Validate/Methods | |
| 389 | + */ | |
| 390 | +$.validator.addMethod("dateITA", function(value, element) { | |
| 391 | + var check = false, | |
| 392 | + re = /^\d{1,2}\/\d{1,2}\/\d{4}$/, | |
| 393 | + adata, gg, mm, aaaa, xdata; | |
| 394 | + if ( re.test(value)) { | |
| 395 | + adata = value.split("/"); | |
| 396 | + gg = parseInt(adata[0], 10); | |
| 397 | + mm = parseInt(adata[1], 10); | |
| 398 | + aaaa = parseInt(adata[2], 10); | |
| 399 | + xdata = new Date(Date.UTC(aaaa, mm - 1, gg, 12, 0, 0, 0)); | |
| 400 | + if ( ( xdata.getUTCFullYear() === aaaa ) && ( xdata.getUTCMonth () === mm - 1 ) && ( xdata.getUTCDate() === gg ) ) { | |
| 401 | + check = true; | |
| 402 | + } else { | |
| 403 | + check = false; | |
| 404 | + } | |
| 405 | + } else { | |
| 406 | + check = false; | |
| 407 | + } | |
| 408 | + return this.optional(element) || check; | |
| 409 | +}, $.validator.messages.date); | |
| 410 | + | |
| 411 | +$.validator.addMethod("dateNL", function(value, element) { | |
| 412 | + return this.optional(element) || /^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(value); | |
| 413 | +}, $.validator.messages.date); | |
| 414 | + | |
| 415 | +// Older "accept" file extension method. Old docs: http://docs.jquery.com/Plugins/Validation/Methods/accept | |
| 416 | +$.validator.addMethod("extension", function(value, element, param) { | |
| 417 | + param = typeof param === "string" ? param.replace(/,/g, "|") : "png|jpe?g|gif"; | |
| 418 | + return this.optional(element) || value.match(new RegExp("\\.(" + param + ")$", "i")); | |
| 419 | +}, $.validator.format("Please enter a value with a valid extension.")); | |
| 420 | + | |
| 421 | +/** | |
| 422 | + * Dutch giro account numbers (not bank numbers) have max 7 digits | |
| 423 | + */ | |
| 424 | +$.validator.addMethod("giroaccountNL", function(value, element) { | |
| 425 | + return this.optional(element) || /^[0-9]{1,7}$/.test(value); | |
| 426 | +}, "Please specify a valid giro account number"); | |
| 427 | + | |
| 428 | +/** | |
| 429 | + * IBAN is the international bank account number. | |
| 430 | + * It has a country - specific format, that is checked here too | |
| 431 | + */ | |
| 432 | +$.validator.addMethod("iban", function(value, element) { | |
| 433 | + // some quick simple tests to prevent needless work | |
| 434 | + if (this.optional(element)) { | |
| 435 | + return true; | |
| 436 | + } | |
| 437 | + | |
| 438 | + // remove spaces and to upper case | |
| 439 | + var iban = value.replace(/ /g, "").toUpperCase(), | |
| 440 | + ibancheckdigits = "", | |
| 441 | + leadingZeroes = true, | |
| 442 | + cRest = "", | |
| 443 | + cOperator = "", | |
| 444 | + countrycode, ibancheck, charAt, cChar, bbanpattern, bbancountrypatterns, ibanregexp, i, p; | |
| 445 | + | |
| 446 | + // check the country code and find the country specific format | |
| 447 | + countrycode = iban.substring(0, 2); | |
| 448 | + bbancountrypatterns = { | |
| 449 | + "AL": "\\d{8}[\\dA-Z]{16}", | |
| 450 | + "AD": "\\d{8}[\\dA-Z]{12}", | |
| 451 | + "AT": "\\d{16}", | |
| 452 | + "AZ": "[\\dA-Z]{4}\\d{20}", | |
| 453 | + "BE": "\\d{12}", | |
| 454 | + "BH": "[A-Z]{4}[\\dA-Z]{14}", | |
| 455 | + "BA": "\\d{16}", | |
| 456 | + "BR": "\\d{23}[A-Z][\\dA-Z]", | |
| 457 | + "BG": "[A-Z]{4}\\d{6}[\\dA-Z]{8}", | |
| 458 | + "CR": "\\d{17}", | |
| 459 | + "HR": "\\d{17}", | |
| 460 | + "CY": "\\d{8}[\\dA-Z]{16}", | |
| 461 | + "CZ": "\\d{20}", | |
| 462 | + "DK": "\\d{14}", | |
| 463 | + "DO": "[A-Z]{4}\\d{20}", | |
| 464 | + "EE": "\\d{16}", | |
| 465 | + "FO": "\\d{14}", | |
| 466 | + "FI": "\\d{14}", | |
| 467 | + "FR": "\\d{10}[\\dA-Z]{11}\\d{2}", | |
| 468 | + "GE": "[\\dA-Z]{2}\\d{16}", | |
| 469 | + "DE": "\\d{18}", | |
| 470 | + "GI": "[A-Z]{4}[\\dA-Z]{15}", | |
| 471 | + "GR": "\\d{7}[\\dA-Z]{16}", | |
| 472 | + "GL": "\\d{14}", | |
| 473 | + "GT": "[\\dA-Z]{4}[\\dA-Z]{20}", | |
| 474 | + "HU": "\\d{24}", | |
| 475 | + "IS": "\\d{22}", | |
| 476 | + "IE": "[\\dA-Z]{4}\\d{14}", | |
| 477 | + "IL": "\\d{19}", | |
| 478 | + "IT": "[A-Z]\\d{10}[\\dA-Z]{12}", | |
| 479 | + "KZ": "\\d{3}[\\dA-Z]{13}", | |
| 480 | + "KW": "[A-Z]{4}[\\dA-Z]{22}", | |
| 481 | + "LV": "[A-Z]{4}[\\dA-Z]{13}", | |
| 482 | + "LB": "\\d{4}[\\dA-Z]{20}", | |
| 483 | + "LI": "\\d{5}[\\dA-Z]{12}", | |
| 484 | + "LT": "\\d{16}", | |
| 485 | + "LU": "\\d{3}[\\dA-Z]{13}", | |
| 486 | + "MK": "\\d{3}[\\dA-Z]{10}\\d{2}", | |
| 487 | + "MT": "[A-Z]{4}\\d{5}[\\dA-Z]{18}", | |
| 488 | + "MR": "\\d{23}", | |
| 489 | + "MU": "[A-Z]{4}\\d{19}[A-Z]{3}", | |
| 490 | + "MC": "\\d{10}[\\dA-Z]{11}\\d{2}", | |
| 491 | + "MD": "[\\dA-Z]{2}\\d{18}", | |
| 492 | + "ME": "\\d{18}", | |
| 493 | + "NL": "[A-Z]{4}\\d{10}", | |
| 494 | + "NO": "\\d{11}", | |
| 495 | + "PK": "[\\dA-Z]{4}\\d{16}", | |
| 496 | + "PS": "[\\dA-Z]{4}\\d{21}", | |
| 497 | + "PL": "\\d{24}", | |
| 498 | + "PT": "\\d{21}", | |
| 499 | + "RO": "[A-Z]{4}[\\dA-Z]{16}", | |
| 500 | + "SM": "[A-Z]\\d{10}[\\dA-Z]{12}", | |
| 501 | + "SA": "\\d{2}[\\dA-Z]{18}", | |
| 502 | + "RS": "\\d{18}", | |
| 503 | + "SK": "\\d{20}", | |
| 504 | + "SI": "\\d{15}", | |
| 505 | + "ES": "\\d{20}", | |
| 506 | + "SE": "\\d{20}", | |
| 507 | + "CH": "\\d{5}[\\dA-Z]{12}", | |
| 508 | + "TN": "\\d{20}", | |
| 509 | + "TR": "\\d{5}[\\dA-Z]{17}", | |
| 510 | + "AE": "\\d{3}\\d{16}", | |
| 511 | + "GB": "[A-Z]{4}\\d{14}", | |
| 512 | + "VG": "[\\dA-Z]{4}\\d{16}" | |
| 513 | + }; | |
| 514 | + | |
| 515 | + bbanpattern = bbancountrypatterns[countrycode]; | |
| 516 | + // As new countries will start using IBAN in the | |
| 517 | + // future, we only check if the countrycode is known. | |
| 518 | + // This prevents false negatives, while almost all | |
| 519 | + // false positives introduced by this, will be caught | |
| 520 | + // by the checksum validation below anyway. | |
| 521 | + // Strict checking should return FALSE for unknown | |
| 522 | + // countries. | |
| 523 | + if (typeof bbanpattern !== "undefined") { | |
| 524 | + ibanregexp = new RegExp("^[A-Z]{2}\\d{2}" + bbanpattern + "$", ""); | |
| 525 | + if (!(ibanregexp.test(iban))) { | |
| 526 | + return false; // invalid country specific format | |
| 527 | + } | |
| 528 | + } | |
| 529 | + | |
| 530 | + // now check the checksum, first convert to digits | |
| 531 | + ibancheck = iban.substring(4, iban.length) + iban.substring(0, 4); | |
| 532 | + for (i = 0; i < ibancheck.length; i++) { | |
| 533 | + charAt = ibancheck.charAt(i); | |
| 534 | + if (charAt !== "0") { | |
| 535 | + leadingZeroes = false; | |
| 536 | + } | |
| 537 | + if (!leadingZeroes) { | |
| 538 | + ibancheckdigits += "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(charAt); | |
| 539 | + } | |
| 540 | + } | |
| 541 | + | |
| 542 | + // calculate the result of: ibancheckdigits % 97 | |
| 543 | + for (p = 0; p < ibancheckdigits.length; p++) { | |
| 544 | + cChar = ibancheckdigits.charAt(p); | |
| 545 | + cOperator = "" + cRest + "" + cChar; | |
| 546 | + cRest = cOperator % 97; | |
| 547 | + } | |
| 548 | + return cRest === 1; | |
| 549 | +}, "Please specify a valid IBAN"); | |
| 550 | + | |
| 551 | +$.validator.addMethod("integer", function(value, element) { | |
| 552 | + return this.optional(element) || /^-?\d+$/.test(value); | |
| 553 | +}, "A positive or negative non-decimal number please"); | |
| 554 | + | |
| 555 | +$.validator.addMethod("ipv4", function(value, element) { | |
| 556 | + return this.optional(element) || /^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test(value); | |
| 557 | +}, "Please enter a valid IP v4 address."); | |
| 558 | + | |
| 559 | +$.validator.addMethod("ipv6", function(value, element) { | |
| 560 | + return this.optional(element) || /^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(value); | |
| 561 | +}, "Please enter a valid IP v6 address."); | |
| 562 | + | |
| 563 | +$.validator.addMethod("lettersonly", function(value, element) { | |
| 564 | + return this.optional(element) || /^[a-z]+$/i.test(value); | |
| 565 | +}, "Letters only please"); | |
| 566 | + | |
| 567 | +$.validator.addMethod("letterswithbasicpunc", function(value, element) { | |
| 568 | + return this.optional(element) || /^[a-z\-.,()'"\s]+$/i.test(value); | |
| 569 | +}, "Letters or punctuation only please"); | |
| 570 | + | |
| 571 | +$.validator.addMethod("mobileNL", function(value, element) { | |
| 572 | + return this.optional(element) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test(value); | |
| 573 | +}, "Please specify a valid mobile number"); | |
| 574 | + | |
| 575 | +/* For UK phone functions, do the following server side processing: | |
| 576 | + * Compare original input with this RegEx pattern: | |
| 577 | + * ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$ | |
| 578 | + * Extract $1 and set $prefix to '+44<space>' if $1 is '44', otherwise set $prefix to '0' | |
| 579 | + * Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2. | |
| 580 | + * A number of very detailed GB telephone number RegEx patterns can also be found at: | |
| 581 | + * http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers | |
| 582 | + */ | |
| 583 | +$.validator.addMethod("mobileUK", function(phone_number, element) { | |
| 584 | + phone_number = phone_number.replace(/\(|\)|\s+|-/g, ""); | |
| 585 | + return this.optional(element) || phone_number.length > 9 && | |
| 586 | + phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/); | |
| 587 | +}, "Please specify a valid mobile number"); | |
| 588 | + | |
| 589 | +/* | |
| 590 | + * The número de identidad de extranjero ( NIE )is a code used to identify the non-nationals in Spain | |
| 591 | + */ | |
| 592 | +$.validator.addMethod( "nieES", function( value ) { | |
| 593 | + "use strict"; | |
| 594 | + | |
| 595 | + value = value.toUpperCase(); | |
| 596 | + | |
| 597 | + // Basic format test | |
| 598 | + if ( !value.match( "((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)" ) ) { | |
| 599 | + return false; | |
| 600 | + } | |
| 601 | + | |
| 602 | + // Test NIE | |
| 603 | + //T | |
| 604 | + if ( /^[T]{1}/.test( value ) ) { | |
| 605 | + return ( value[ 8 ] === /^[T]{1}[A-Z0-9]{8}$/.test( value ) ); | |
| 606 | + } | |
| 607 | + | |
| 608 | + //XYZ | |
| 609 | + if ( /^[XYZ]{1}/.test( value ) ) { | |
| 610 | + return ( | |
| 611 | + value[ 8 ] === "TRWAGMYFPDXBNJZSQVHLCKE".charAt( | |
| 612 | + value.replace( "X", "0" ) | |
| 613 | + .replace( "Y", "1" ) | |
| 614 | + .replace( "Z", "2" ) | |
| 615 | + .substring( 0, 8 ) % 23 | |
| 616 | + ) | |
| 617 | + ); | |
| 618 | + } | |
| 619 | + | |
| 620 | + return false; | |
| 621 | + | |
| 622 | +}, "Please specify a valid NIE number." ); | |
| 623 | + | |
| 624 | +/* | |
| 625 | + * The Número de Identificación Fiscal ( NIF ) is the way tax identification used in Spain for individuals | |
| 626 | + */ | |
| 627 | +$.validator.addMethod( "nifES", function( value ) { | |
| 628 | + "use strict"; | |
| 629 | + | |
| 630 | + value = value.toUpperCase(); | |
| 631 | + | |
| 632 | + // Basic format test | |
| 633 | + if ( !value.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)") ) { | |
| 634 | + return false; | |
| 635 | + } | |
| 636 | + | |
| 637 | + // Test NIF | |
| 638 | + if ( /^[0-9]{8}[A-Z]{1}$/.test( value ) ) { | |
| 639 | + return ( "TRWAGMYFPDXBNJZSQVHLCKE".charAt( value.substring( 8, 0 ) % 23 ) === value.charAt( 8 ) ); | |
| 640 | + } | |
| 641 | + // Test specials NIF (starts with K, L or M) | |
| 642 | + if ( /^[KLM]{1}/.test( value ) ) { | |
| 643 | + return ( value[ 8 ] === String.fromCharCode( 64 ) ); | |
| 644 | + } | |
| 645 | + | |
| 646 | + return false; | |
| 647 | + | |
| 648 | +}, "Please specify a valid NIF number." ); | |
| 649 | + | |
| 650 | +jQuery.validator.addMethod( "notEqualTo", function( value, element, param ) { | |
| 651 | + return this.optional(element) || !$.validator.methods.equalTo.call( this, value, element, param ); | |
| 652 | +}, "Please enter a different value, values must not be the same." ); | |
| 653 | + | |
| 654 | +$.validator.addMethod("nowhitespace", function(value, element) { | |
| 655 | + return this.optional(element) || /^\S+$/i.test(value); | |
| 656 | +}, "No white space please"); | |
| 657 | + | |
| 658 | +/** | |
| 659 | +* Return true if the field value matches the given format RegExp | |
| 660 | +* | |
| 661 | +* @example $.validator.methods.pattern("AR1004",element,/^AR\d{4}$/) | |
| 662 | +* @result true | |
| 663 | +* | |
| 664 | +* @example $.validator.methods.pattern("BR1004",element,/^AR\d{4}$/) | |
| 665 | +* @result false | |
| 666 | +* | |
| 667 | +* @name $.validator.methods.pattern | |
| 668 | +* @type Boolean | |
| 669 | +* @cat Plugins/Validate/Methods | |
| 670 | +*/ | |
| 671 | +$.validator.addMethod("pattern", function(value, element, param) { | |
| 672 | + if (this.optional(element)) { | |
| 673 | + return true; | |
| 674 | + } | |
| 675 | + if (typeof param === "string") { | |
| 676 | + param = new RegExp("^(?:" + param + ")$"); | |
| 677 | + } | |
| 678 | + return param.test(value); | |
| 679 | +}, "Invalid format."); | |
| 680 | + | |
| 681 | +/** | |
| 682 | + * Dutch phone numbers have 10 digits (or 11 and start with +31). | |
| 683 | + */ | |
| 684 | +$.validator.addMethod("phoneNL", function(value, element) { | |
| 685 | + return this.optional(element) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test(value); | |
| 686 | +}, "Please specify a valid phone number."); | |
| 687 | + | |
| 688 | +/* For UK phone functions, do the following server side processing: | |
| 689 | + * Compare original input with this RegEx pattern: | |
| 690 | + * ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$ | |
| 691 | + * Extract $1 and set $prefix to '+44<space>' if $1 is '44', otherwise set $prefix to '0' | |
| 692 | + * Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2. | |
| 693 | + * A number of very detailed GB telephone number RegEx patterns can also be found at: | |
| 694 | + * http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers | |
| 695 | + */ | |
| 696 | +$.validator.addMethod("phoneUK", function(phone_number, element) { | |
| 697 | + phone_number = phone_number.replace(/\(|\)|\s+|-/g, ""); | |
| 698 | + return this.optional(element) || phone_number.length > 9 && | |
| 699 | + phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/); | |
| 700 | +}, "Please specify a valid phone number"); | |
| 701 | + | |
| 702 | +/** | |
| 703 | + * matches US phone number format | |
| 704 | + * | |
| 705 | + * where the area code may not start with 1 and the prefix may not start with 1 | |
| 706 | + * allows '-' or ' ' as a separator and allows parens around area code | |
| 707 | + * some people may want to put a '1' in front of their number | |
| 708 | + * | |
| 709 | + * 1(212)-999-2345 or | |
| 710 | + * 212 999 2344 or | |
| 711 | + * 212-999-0983 | |
| 712 | + * | |
| 713 | + * but not | |
| 714 | + * 111-123-5434 | |
| 715 | + * and not | |
| 716 | + * 212 123 4567 | |
| 717 | + */ | |
| 718 | +$.validator.addMethod("phoneUS", function(phone_number, element) { | |
| 719 | + phone_number = phone_number.replace(/\s+/g, ""); | |
| 720 | + return this.optional(element) || phone_number.length > 9 && | |
| 721 | + phone_number.match(/^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]([02-9]\d|1[02-9])-?\d{4}$/); | |
| 722 | +}, "Please specify a valid phone number"); | |
| 723 | + | |
| 724 | +/* For UK phone functions, do the following server side processing: | |
| 725 | + * Compare original input with this RegEx pattern: | |
| 726 | + * ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$ | |
| 727 | + * Extract $1 and set $prefix to '+44<space>' if $1 is '44', otherwise set $prefix to '0' | |
| 728 | + * Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2. | |
| 729 | + * A number of very detailed GB telephone number RegEx patterns can also be found at: | |
| 730 | + * http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers | |
| 731 | + */ | |
| 732 | +//Matches UK landline + mobile, accepting only 01-3 for landline or 07 for mobile to exclude many premium numbers | |
| 733 | +$.validator.addMethod("phonesUK", function(phone_number, element) { | |
| 734 | + phone_number = phone_number.replace(/\(|\)|\s+|-/g, ""); | |
| 735 | + return this.optional(element) || phone_number.length > 9 && | |
| 736 | + phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/); | |
| 737 | +}, "Please specify a valid uk phone number"); | |
| 738 | + | |
| 739 | +/** | |
| 740 | + * Matches a valid Canadian Postal Code | |
| 741 | + * | |
| 742 | + * @example jQuery.validator.methods.postalCodeCA( "H0H 0H0", element ) | |
| 743 | + * @result true | |
| 744 | + * | |
| 745 | + * @example jQuery.validator.methods.postalCodeCA( "H0H0H0", element ) | |
| 746 | + * @result false | |
| 747 | + * | |
| 748 | + * @name jQuery.validator.methods.postalCodeCA | |
| 749 | + * @type Boolean | |
| 750 | + * @cat Plugins/Validate/Methods | |
| 751 | + */ | |
| 752 | +$.validator.addMethod( "postalCodeCA", function( value, element ) { | |
| 753 | + return this.optional( element ) || /^[ABCEGHJKLMNPRSTVXY]\d[A-Z] \d[A-Z]\d$/.test( value ); | |
| 754 | +}, "Please specify a valid postal code" ); | |
| 755 | + | |
| 756 | +/* | |
| 757 | +* Valida CEPs do brasileiros: | |
| 758 | +* | |
| 759 | +* Formatos aceitos: | |
| 760 | +* 99999-999 | |
| 761 | +* 99.999-999 | |
| 762 | +* 99999999 | |
| 763 | +*/ | |
| 764 | +$.validator.addMethod("postalcodeBR", function(cep_value, element) { | |
| 765 | + return this.optional(element) || /^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test( cep_value ); | |
| 766 | +}, "Informe um CEP válido."); | |
| 767 | + | |
| 768 | +/* Matches Italian postcode (CAP) */ | |
| 769 | +$.validator.addMethod("postalcodeIT", function(value, element) { | |
| 770 | + return this.optional(element) || /^\d{5}$/.test(value); | |
| 771 | +}, "Please specify a valid postal code"); | |
| 772 | + | |
| 773 | +$.validator.addMethod("postalcodeNL", function(value, element) { | |
| 774 | + return this.optional(element) || /^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test(value); | |
| 775 | +}, "Please specify a valid postal code"); | |
| 776 | + | |
| 777 | +// Matches UK postcode. Does not match to UK Channel Islands that have their own postcodes (non standard UK) | |
| 778 | +$.validator.addMethod("postcodeUK", function(value, element) { | |
| 779 | + return this.optional(element) || /^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test(value); | |
| 780 | +}, "Please specify a valid UK postcode"); | |
| 781 | + | |
| 782 | +/* | |
| 783 | + * Lets you say "at least X inputs that match selector Y must be filled." | |
| 784 | + * | |
| 785 | + * The end result is that neither of these inputs: | |
| 786 | + * | |
| 787 | + * <input class="productinfo" name="partnumber"> | |
| 788 | + * <input class="productinfo" name="description"> | |
| 789 | + * | |
| 790 | + * ...will validate unless at least one of them is filled. | |
| 791 | + * | |
| 792 | + * partnumber: {require_from_group: [1,".productinfo"]}, | |
| 793 | + * description: {require_from_group: [1,".productinfo"]} | |
| 794 | + * | |
| 795 | + * options[0]: number of fields that must be filled in the group | |
| 796 | + * options[1]: CSS selector that defines the group of conditionally required fields | |
| 797 | + */ | |
| 798 | +$.validator.addMethod("require_from_group", function(value, element, options) { | |
| 799 | + var $fields = $(options[1], element.form), | |
| 800 | + $fieldsFirst = $fields.eq(0), | |
| 801 | + validator = $fieldsFirst.data("valid_req_grp") ? $fieldsFirst.data("valid_req_grp") : $.extend({}, this), | |
| 802 | + isValid = $fields.filter(function() { | |
| 803 | + return validator.elementValue(this); | |
| 804 | + }).length >= options[0]; | |
| 805 | + | |
| 806 | + // Store the cloned validator for future validation | |
| 807 | + $fieldsFirst.data("valid_req_grp", validator); | |
| 808 | + | |
| 809 | + // If element isn't being validated, run each require_from_group field's validation rules | |
| 810 | + if (!$(element).data("being_validated")) { | |
| 811 | + $fields.data("being_validated", true); | |
| 812 | + $fields.each(function() { | |
| 813 | + validator.element(this); | |
| 814 | + }); | |
| 815 | + $fields.data("being_validated", false); | |
| 816 | + } | |
| 817 | + return isValid; | |
| 818 | +}, $.validator.format("Please fill at least {0} of these fields.")); | |
| 819 | + | |
| 820 | +/* | |
| 821 | + * Lets you say "either at least X inputs that match selector Y must be filled, | |
| 822 | + * OR they must all be skipped (left blank)." | |
| 823 | + * | |
| 824 | + * The end result, is that none of these inputs: | |
| 825 | + * | |
| 826 | + * <input class="productinfo" name="partnumber"> | |
| 827 | + * <input class="productinfo" name="description"> | |
| 828 | + * <input class="productinfo" name="color"> | |
| 829 | + * | |
| 830 | + * ...will validate unless either at least two of them are filled, | |
| 831 | + * OR none of them are. | |
| 832 | + * | |
| 833 | + * partnumber: {skip_or_fill_minimum: [2,".productinfo"]}, | |
| 834 | + * description: {skip_or_fill_minimum: [2,".productinfo"]}, | |
| 835 | + * color: {skip_or_fill_minimum: [2,".productinfo"]} | |
| 836 | + * | |
| 837 | + * options[0]: number of fields that must be filled in the group | |
| 838 | + * options[1]: CSS selector that defines the group of conditionally required fields | |
| 839 | + * | |
| 840 | + */ | |
| 841 | +$.validator.addMethod("skip_or_fill_minimum", function(value, element, options) { | |
| 842 | + var $fields = $(options[1], element.form), | |
| 843 | + $fieldsFirst = $fields.eq(0), | |
| 844 | + validator = $fieldsFirst.data("valid_skip") ? $fieldsFirst.data("valid_skip") : $.extend({}, this), | |
| 845 | + numberFilled = $fields.filter(function() { | |
| 846 | + return validator.elementValue(this); | |
| 847 | + }).length, | |
| 848 | + isValid = numberFilled === 0 || numberFilled >= options[0]; | |
| 849 | + | |
| 850 | + // Store the cloned validator for future validation | |
| 851 | + $fieldsFirst.data("valid_skip", validator); | |
| 852 | + | |
| 853 | + // If element isn't being validated, run each skip_or_fill_minimum field's validation rules | |
| 854 | + if (!$(element).data("being_validated")) { | |
| 855 | + $fields.data("being_validated", true); | |
| 856 | + $fields.each(function() { | |
| 857 | + validator.element(this); | |
| 858 | + }); | |
| 859 | + $fields.data("being_validated", false); | |
| 860 | + } | |
| 861 | + return isValid; | |
| 862 | +}, $.validator.format("Please either skip these fields or fill at least {0} of them.")); | |
| 863 | + | |
| 864 | +/* Validates US States and/or Territories by @jdforsythe | |
| 865 | + * Can be case insensitive or require capitalization - default is case insensitive | |
| 866 | + * Can include US Territories or not - default does not | |
| 867 | + * Can include US Military postal abbreviations (AA, AE, AP) - default does not | |
| 868 | + * | |
| 869 | + * Note: "States" always includes DC (District of Colombia) | |
| 870 | + * | |
| 871 | + * Usage examples: | |
| 872 | + * | |
| 873 | + * This is the default - case insensitive, no territories, no military zones | |
| 874 | + * stateInput: { | |
| 875 | + * caseSensitive: false, | |
| 876 | + * includeTerritories: false, | |
| 877 | + * includeMilitary: false | |
| 878 | + * } | |
| 879 | + * | |
| 880 | + * Only allow capital letters, no territories, no military zones | |
| 881 | + * stateInput: { | |
| 882 | + * caseSensitive: false | |
| 883 | + * } | |
| 884 | + * | |
| 885 | + * Case insensitive, include territories but not military zones | |
| 886 | + * stateInput: { | |
| 887 | + * includeTerritories: true | |
| 888 | + * } | |
| 889 | + * | |
| 890 | + * Only allow capital letters, include territories and military zones | |
| 891 | + * stateInput: { | |
| 892 | + * caseSensitive: true, | |
| 893 | + * includeTerritories: true, | |
| 894 | + * includeMilitary: true | |
| 895 | + * } | |
| 896 | + * | |
| 897 | + * | |
| 898 | + * | |
| 899 | + */ | |
| 900 | + | |
| 901 | +$.validator.addMethod("stateUS", function(value, element, options) { | |
| 902 | + var isDefault = typeof options === "undefined", | |
| 903 | + caseSensitive = ( isDefault || typeof options.caseSensitive === "undefined" ) ? false : options.caseSensitive, | |
| 904 | + includeTerritories = ( isDefault || typeof options.includeTerritories === "undefined" ) ? false : options.includeTerritories, | |
| 905 | + includeMilitary = ( isDefault || typeof options.includeMilitary === "undefined" ) ? false : options.includeMilitary, | |
| 906 | + regex; | |
| 907 | + | |
| 908 | + if (!includeTerritories && !includeMilitary) { | |
| 909 | + regex = "^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$"; | |
| 910 | + } else if (includeTerritories && includeMilitary) { | |
| 911 | + regex = "^(A[AEKLPRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$"; | |
| 912 | + } else if (includeTerritories) { | |
| 913 | + regex = "^(A[KLRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$"; | |
| 914 | + } else { | |
| 915 | + regex = "^(A[AEKLPRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$"; | |
| 916 | + } | |
| 917 | + | |
| 918 | + regex = caseSensitive ? new RegExp(regex) : new RegExp(regex, "i"); | |
| 919 | + return this.optional(element) || regex.test(value); | |
| 920 | +}, | |
| 921 | +"Please specify a valid state"); | |
| 922 | + | |
| 923 | +// TODO check if value starts with <, otherwise don't try stripping anything | |
| 924 | +$.validator.addMethod("strippedminlength", function(value, element, param) { | |
| 925 | + return $(value).text().length >= param; | |
| 926 | +}, $.validator.format("Please enter at least {0} characters")); | |
| 927 | + | |
| 928 | +$.validator.addMethod("time", function(value, element) { | |
| 929 | + return this.optional(element) || /^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test(value); | |
| 930 | +}, "Please enter a valid time, between 00:00 and 23:59"); | |
| 931 | + | |
| 932 | +$.validator.addMethod("time12h", function(value, element) { | |
| 933 | + return this.optional(element) || /^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test(value); | |
| 934 | +}, "Please enter a valid time in 12-hour am/pm format"); | |
| 935 | + | |
| 936 | +// same as url, but TLD is optional | |
| 937 | +$.validator.addMethod("url2", function(value, element) { | |
| 938 | + return this.optional(element) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value); | |
| 939 | +}, $.validator.messages.url); | |
| 940 | + | |
| 941 | +/** | |
| 942 | + * Return true, if the value is a valid vehicle identification number (VIN). | |
| 943 | + * | |
| 944 | + * Works with all kind of text inputs. | |
| 945 | + * | |
| 946 | + * @example <input type="text" size="20" name="VehicleID" class="{required:true,vinUS:true}" /> | |
| 947 | + * @desc Declares a required input element whose value must be a valid vehicle identification number. | |
| 948 | + * | |
| 949 | + * @name $.validator.methods.vinUS | |
| 950 | + * @type Boolean | |
| 951 | + * @cat Plugins/Validate/Methods | |
| 952 | + */ | |
| 953 | +$.validator.addMethod("vinUS", function(v) { | |
| 954 | + if (v.length !== 17) { | |
| 955 | + return false; | |
| 956 | + } | |
| 957 | + | |
| 958 | + var LL = [ "A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "P", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" ], | |
| 959 | + VL = [ 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 7, 9, 2, 3, 4, 5, 6, 7, 8, 9 ], | |
| 960 | + FL = [ 8, 7, 6, 5, 4, 3, 2, 10, 0, 9, 8, 7, 6, 5, 4, 3, 2 ], | |
| 961 | + rs = 0, | |
| 962 | + i, n, d, f, cd, cdv; | |
| 963 | + | |
| 964 | + for (i = 0; i < 17; i++) { | |
| 965 | + f = FL[i]; | |
| 966 | + d = v.slice(i, i + 1); | |
| 967 | + if (i === 8) { | |
| 968 | + cdv = d; | |
| 969 | + } | |
| 970 | + if (!isNaN(d)) { | |
| 971 | + d *= f; | |
| 972 | + } else { | |
| 973 | + for (n = 0; n < LL.length; n++) { | |
| 974 | + if (d.toUpperCase() === LL[n]) { | |
| 975 | + d = VL[n]; | |
| 976 | + d *= f; | |
| 977 | + if (isNaN(cdv) && n === 8) { | |
| 978 | + cdv = LL[n]; | |
| 979 | + } | |
| 980 | + break; | |
| 981 | + } | |
| 982 | + } | |
| 983 | + } | |
| 984 | + rs += d; | |
| 985 | + } | |
| 986 | + cd = rs % 11; | |
| 987 | + if (cd === 10) { | |
| 988 | + cd = "X"; | |
| 989 | + } | |
| 990 | + if (cd === cdv) { | |
| 991 | + return true; | |
| 992 | + } | |
| 993 | + return false; | |
| 994 | +}, "The specified vehicle identification number (VIN) is invalid."); | |
| 995 | + | |
| 996 | +$.validator.addMethod("zipcodeUS", function(value, element) { | |
| 997 | + return this.optional(element) || /^\d{5}(-\d{4})?$/.test(value); | |
| 998 | +}, "The specified US ZIP Code is invalid"); | |
| 999 | + | |
| 1000 | +$.validator.addMethod("ziprange", function(value, element) { | |
| 1001 | + return this.optional(element) || /^90[2-5]\d\{2\}-\d{4}$/.test(value); | |
| 1002 | +}, "Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx"); | |
| 1003 | + | |
| 1004 | +})); | |
| 0 | 1005 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/additional-methods.min.js
0 → 100644
| 1 | +/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 | |
| 2 | + * http://jqueryvalidation.org/ | |
| 3 | + * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ | |
| 4 | +!function(a){"function"==typeof define&&define.amd?define(["jquery","./jquery.validate.min"],a):a(jQuery)}(function(a){!function(){function b(a){return a.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ").replace(/[.(),;:!?%#$'\"_+=\/\-“”’]*/g,"")}a.validator.addMethod("maxWords",function(a,c,d){return this.optional(c)||b(a).match(/\b\w+\b/g).length<=d},a.validator.format("Please enter {0} words or less.")),a.validator.addMethod("minWords",function(a,c,d){return this.optional(c)||b(a).match(/\b\w+\b/g).length>=d},a.validator.format("Please enter at least {0} words.")),a.validator.addMethod("rangeWords",function(a,c,d){var e=b(a),f=/\b\w+\b/g;return this.optional(c)||e.match(f).length>=d[0]&&e.match(f).length<=d[1]},a.validator.format("Please enter between {0} and {1} words."))}(),a.validator.addMethod("accept",function(b,c,d){var e,f,g="string"==typeof d?d.replace(/\s/g,"").replace(/,/g,"|"):"image/*",h=this.optional(c);if(h)return h;if("file"===a(c).attr("type")&&(g=g.replace(/\*/g,".*"),c.files&&c.files.length))for(e=0;e<c.files.length;e++)if(f=c.files[e],!f.type.match(new RegExp("\\.?("+g+")$","i")))return!1;return!0},a.validator.format("Please enter a value with a valid mimetype.")),a.validator.addMethod("alphanumeric",function(a,b){return this.optional(b)||/^\w+$/i.test(a)},"Letters, numbers, and underscores only please"),a.validator.addMethod("bankaccountNL",function(a,b){if(this.optional(b))return!0;if(!/^[0-9]{9}|([0-9]{2} ){3}[0-9]{3}$/.test(a))return!1;var c,d,e,f=a.replace(/ /g,""),g=0,h=f.length;for(c=0;h>c;c++)d=h-c,e=f.substring(c,c+1),g+=d*e;return g%11===0},"Please specify a valid bank account number"),a.validator.addMethod("bankorgiroaccountNL",function(b,c){return this.optional(c)||a.validator.methods.bankaccountNL.call(this,b,c)||a.validator.methods.giroaccountNL.call(this,b,c)},"Please specify a valid bank or giro account number"),a.validator.addMethod("bic",function(a,b){return this.optional(b)||/^([A-Z]{6}[A-Z2-9][A-NP-Z1-2])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test(a)},"Please specify a valid BIC code"),a.validator.addMethod("cifES",function(a){"use strict";var b,c,d,e,f,g,h=[];if(a=a.toUpperCase(),!a.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)"))return!1;for(d=0;9>d;d++)h[d]=parseInt(a.charAt(d),10);for(c=h[2]+h[4]+h[6],e=1;8>e;e+=2)f=(2*h[e]).toString(),g=f.charAt(1),c+=parseInt(f.charAt(0),10)+(""===g?0:parseInt(g,10));return/^[ABCDEFGHJNPQRSUVW]{1}/.test(a)?(c+="",b=10-parseInt(c.charAt(c.length-1),10),a+=b,h[8].toString()===String.fromCharCode(64+b)||h[8].toString()===a.charAt(a.length-1)):!1},"Please specify a valid CIF number."),a.validator.addMethod("cpfBR",function(a){if(a=a.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g,""),11!==a.length)return!1;var b,c,d,e,f=0;if(b=parseInt(a.substring(9,10),10),c=parseInt(a.substring(10,11),10),d=function(a,b){var c=10*a%11;return(10===c||11===c)&&(c=0),c===b},""===a||"00000000000"===a||"11111111111"===a||"22222222222"===a||"33333333333"===a||"44444444444"===a||"55555555555"===a||"66666666666"===a||"77777777777"===a||"88888888888"===a||"99999999999"===a)return!1;for(e=1;9>=e;e++)f+=parseInt(a.substring(e-1,e),10)*(11-e);if(d(f,b)){for(f=0,e=1;10>=e;e++)f+=parseInt(a.substring(e-1,e),10)*(12-e);return d(f,c)}return!1},"Please specify a valid CPF number"),a.validator.addMethod("creditcardtypes",function(a,b,c){if(/[^0-9\-]+/.test(a))return!1;a=a.replace(/\D/g,"");var d=0;return c.mastercard&&(d|=1),c.visa&&(d|=2),c.amex&&(d|=4),c.dinersclub&&(d|=8),c.enroute&&(d|=16),c.discover&&(d|=32),c.jcb&&(d|=64),c.unknown&&(d|=128),c.all&&(d=255),1&d&&/^(5[12345])/.test(a)?16===a.length:2&d&&/^(4)/.test(a)?16===a.length:4&d&&/^(3[47])/.test(a)?15===a.length:8&d&&/^(3(0[012345]|[68]))/.test(a)?14===a.length:16&d&&/^(2(014|149))/.test(a)?15===a.length:32&d&&/^(6011)/.test(a)?16===a.length:64&d&&/^(3)/.test(a)?16===a.length:64&d&&/^(2131|1800)/.test(a)?15===a.length:128&d?!0:!1},"Please enter a valid credit card number."),a.validator.addMethod("currency",function(a,b,c){var d,e="string"==typeof c,f=e?c:c[0],g=e?!0:c[1];return f=f.replace(/,/g,""),f=g?f+"]":f+"]?",d="^["+f+"([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$",d=new RegExp(d),this.optional(b)||d.test(a)},"Please specify a valid currency"),a.validator.addMethod("dateFA",function(a,b){return this.optional(b)||/^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test(a)},a.validator.messages.date),a.validator.addMethod("dateITA",function(a,b){var c,d,e,f,g,h=!1,i=/^\d{1,2}\/\d{1,2}\/\d{4}$/;return i.test(a)?(c=a.split("/"),d=parseInt(c[0],10),e=parseInt(c[1],10),f=parseInt(c[2],10),g=new Date(Date.UTC(f,e-1,d,12,0,0,0)),h=g.getUTCFullYear()===f&&g.getUTCMonth()===e-1&&g.getUTCDate()===d?!0:!1):h=!1,this.optional(b)||h},a.validator.messages.date),a.validator.addMethod("dateNL",function(a,b){return this.optional(b)||/^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(a)},a.validator.messages.date),a.validator.addMethod("extension",function(a,b,c){return c="string"==typeof c?c.replace(/,/g,"|"):"png|jpe?g|gif",this.optional(b)||a.match(new RegExp("\\.("+c+")$","i"))},a.validator.format("Please enter a value with a valid extension.")),a.validator.addMethod("giroaccountNL",function(a,b){return this.optional(b)||/^[0-9]{1,7}$/.test(a)},"Please specify a valid giro account number"),a.validator.addMethod("iban",function(a,b){if(this.optional(b))return!0;var c,d,e,f,g,h,i,j,k,l=a.replace(/ /g,"").toUpperCase(),m="",n=!0,o="",p="";if(c=l.substring(0,2),h={AL:"\\d{8}[\\dA-Z]{16}",AD:"\\d{8}[\\dA-Z]{12}",AT:"\\d{16}",AZ:"[\\dA-Z]{4}\\d{20}",BE:"\\d{12}",BH:"[A-Z]{4}[\\dA-Z]{14}",BA:"\\d{16}",BR:"\\d{23}[A-Z][\\dA-Z]",BG:"[A-Z]{4}\\d{6}[\\dA-Z]{8}",CR:"\\d{17}",HR:"\\d{17}",CY:"\\d{8}[\\dA-Z]{16}",CZ:"\\d{20}",DK:"\\d{14}",DO:"[A-Z]{4}\\d{20}",EE:"\\d{16}",FO:"\\d{14}",FI:"\\d{14}",FR:"\\d{10}[\\dA-Z]{11}\\d{2}",GE:"[\\dA-Z]{2}\\d{16}",DE:"\\d{18}",GI:"[A-Z]{4}[\\dA-Z]{15}",GR:"\\d{7}[\\dA-Z]{16}",GL:"\\d{14}",GT:"[\\dA-Z]{4}[\\dA-Z]{20}",HU:"\\d{24}",IS:"\\d{22}",IE:"[\\dA-Z]{4}\\d{14}",IL:"\\d{19}",IT:"[A-Z]\\d{10}[\\dA-Z]{12}",KZ:"\\d{3}[\\dA-Z]{13}",KW:"[A-Z]{4}[\\dA-Z]{22}",LV:"[A-Z]{4}[\\dA-Z]{13}",LB:"\\d{4}[\\dA-Z]{20}",LI:"\\d{5}[\\dA-Z]{12}",LT:"\\d{16}",LU:"\\d{3}[\\dA-Z]{13}",MK:"\\d{3}[\\dA-Z]{10}\\d{2}",MT:"[A-Z]{4}\\d{5}[\\dA-Z]{18}",MR:"\\d{23}",MU:"[A-Z]{4}\\d{19}[A-Z]{3}",MC:"\\d{10}[\\dA-Z]{11}\\d{2}",MD:"[\\dA-Z]{2}\\d{18}",ME:"\\d{18}",NL:"[A-Z]{4}\\d{10}",NO:"\\d{11}",PK:"[\\dA-Z]{4}\\d{16}",PS:"[\\dA-Z]{4}\\d{21}",PL:"\\d{24}",PT:"\\d{21}",RO:"[A-Z]{4}[\\dA-Z]{16}",SM:"[A-Z]\\d{10}[\\dA-Z]{12}",SA:"\\d{2}[\\dA-Z]{18}",RS:"\\d{18}",SK:"\\d{20}",SI:"\\d{15}",ES:"\\d{20}",SE:"\\d{20}",CH:"\\d{5}[\\dA-Z]{12}",TN:"\\d{20}",TR:"\\d{5}[\\dA-Z]{17}",AE:"\\d{3}\\d{16}",GB:"[A-Z]{4}\\d{14}",VG:"[\\dA-Z]{4}\\d{16}"},g=h[c],"undefined"!=typeof g&&(i=new RegExp("^[A-Z]{2}\\d{2}"+g+"$",""),!i.test(l)))return!1;for(d=l.substring(4,l.length)+l.substring(0,4),j=0;j<d.length;j++)e=d.charAt(j),"0"!==e&&(n=!1),n||(m+="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(e));for(k=0;k<m.length;k++)f=m.charAt(k),p=""+o+f,o=p%97;return 1===o},"Please specify a valid IBAN"),a.validator.addMethod("integer",function(a,b){return this.optional(b)||/^-?\d+$/.test(a)},"A positive or negative non-decimal number please"),a.validator.addMethod("ipv4",function(a,b){return this.optional(b)||/^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test(a)},"Please enter a valid IP v4 address."),a.validator.addMethod("ipv6",function(a,b){return this.optional(b)||/^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(a)},"Please enter a valid IP v6 address."),a.validator.addMethod("lettersonly",function(a,b){return this.optional(b)||/^[a-z]+$/i.test(a)},"Letters only please"),a.validator.addMethod("letterswithbasicpunc",function(a,b){return this.optional(b)||/^[a-z\-.,()'"\s]+$/i.test(a)},"Letters or punctuation only please"),a.validator.addMethod("mobileNL",function(a,b){return this.optional(b)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test(a)},"Please specify a valid mobile number"),a.validator.addMethod("mobileUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/)},"Please specify a valid mobile number"),a.validator.addMethod("nieES",function(a){"use strict";return a=a.toUpperCase(),a.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)")?/^[T]{1}/.test(a)?a[8]===/^[T]{1}[A-Z0-9]{8}$/.test(a):/^[XYZ]{1}/.test(a)?a[8]==="TRWAGMYFPDXBNJZSQVHLCKE".charAt(a.replace("X","0").replace("Y","1").replace("Z","2").substring(0,8)%23):!1:!1},"Please specify a valid NIE number."),a.validator.addMethod("nifES",function(a){"use strict";return a=a.toUpperCase(),a.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)")?/^[0-9]{8}[A-Z]{1}$/.test(a)?"TRWAGMYFPDXBNJZSQVHLCKE".charAt(a.substring(8,0)%23)===a.charAt(8):/^[KLM]{1}/.test(a)?a[8]===String.fromCharCode(64):!1:!1},"Please specify a valid NIF number."),jQuery.validator.addMethod("notEqualTo",function(b,c,d){return this.optional(c)||!a.validator.methods.equalTo.call(this,b,c,d)},"Please enter a different value, values must not be the same."),a.validator.addMethod("nowhitespace",function(a,b){return this.optional(b)||/^\S+$/i.test(a)},"No white space please"),a.validator.addMethod("pattern",function(a,b,c){return this.optional(b)?!0:("string"==typeof c&&(c=new RegExp("^(?:"+c+")$")),c.test(a))},"Invalid format."),a.validator.addMethod("phoneNL",function(a,b){return this.optional(b)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test(a)},"Please specify a valid phone number."),a.validator.addMethod("phoneUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/)},"Please specify a valid phone number"),a.validator.addMethod("phoneUS",function(a,b){return a=a.replace(/\s+/g,""),this.optional(b)||a.length>9&&a.match(/^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]([02-9]\d|1[02-9])-?\d{4}$/)},"Please specify a valid phone number"),a.validator.addMethod("phonesUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/)},"Please specify a valid uk phone number"),a.validator.addMethod("postalCodeCA",function(a,b){return this.optional(b)||/^[ABCEGHJKLMNPRSTVXY]\d[A-Z] \d[A-Z]\d$/.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postalcodeBR",function(a,b){return this.optional(b)||/^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test(a)},"Informe um CEP válido."),a.validator.addMethod("postalcodeIT",function(a,b){return this.optional(b)||/^\d{5}$/.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postalcodeNL",function(a,b){return this.optional(b)||/^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postcodeUK",function(a,b){return this.optional(b)||/^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test(a)},"Please specify a valid UK postcode"),a.validator.addMethod("require_from_group",function(b,c,d){var e=a(d[1],c.form),f=e.eq(0),g=f.data("valid_req_grp")?f.data("valid_req_grp"):a.extend({},this),h=e.filter(function(){return g.elementValue(this)}).length>=d[0];return f.data("valid_req_grp",g),a(c).data("being_validated")||(e.data("being_validated",!0),e.each(function(){g.element(this)}),e.data("being_validated",!1)),h},a.validator.format("Please fill at least {0} of these fields.")),a.validator.addMethod("skip_or_fill_minimum",function(b,c,d){var e=a(d[1],c.form),f=e.eq(0),g=f.data("valid_skip")?f.data("valid_skip"):a.extend({},this),h=e.filter(function(){return g.elementValue(this)}).length,i=0===h||h>=d[0];return f.data("valid_skip",g),a(c).data("being_validated")||(e.data("being_validated",!0),e.each(function(){g.element(this)}),e.data("being_validated",!1)),i},a.validator.format("Please either skip these fields or fill at least {0} of them.")),a.validator.addMethod("stateUS",function(a,b,c){var d,e="undefined"==typeof c,f=e||"undefined"==typeof c.caseSensitive?!1:c.caseSensitive,g=e||"undefined"==typeof c.includeTerritories?!1:c.includeTerritories,h=e||"undefined"==typeof c.includeMilitary?!1:c.includeMilitary;return d=g||h?g&&h?"^(A[AEKLPRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":g?"^(A[KLRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":"^(A[AEKLPRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$":"^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$",d=f?new RegExp(d):new RegExp(d,"i"),this.optional(b)||d.test(a)},"Please specify a valid state"),a.validator.addMethod("strippedminlength",function(b,c,d){return a(b).text().length>=d},a.validator.format("Please enter at least {0} characters")),a.validator.addMethod("time",function(a,b){return this.optional(b)||/^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test(a)},"Please enter a valid time, between 00:00 and 23:59"),a.validator.addMethod("time12h",function(a,b){return this.optional(b)||/^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test(a)},"Please enter a valid time in 12-hour am/pm format"),a.validator.addMethod("url2",function(a,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},a.validator.messages.url),a.validator.addMethod("vinUS",function(a){if(17!==a.length)return!1;var b,c,d,e,f,g,h=["A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z"],i=[1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9],j=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2],k=0;for(b=0;17>b;b++){if(e=j[b],d=a.slice(b,b+1),8===b&&(g=d),isNaN(d)){for(c=0;c<h.length;c++)if(d.toUpperCase()===h[c]){d=i[c],d*=e,isNaN(g)&&8===c&&(g=h[c]);break}}else d*=e;k+=d}return f=k%11,10===f&&(f="X"),f===g?!0:!1},"The specified vehicle identification number (VIN) is invalid."),a.validator.addMethod("zipcodeUS",function(a,b){return this.optional(b)||/^\d{5}(-\d{4})?$/.test(a)},"The specified US ZIP Code is invalid"),a.validator.addMethod("ziprange",function(a,b){return this.optional(b)||/^90[2-5]\d\{2\}-\d{4}$/.test(a)},"Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx")}); | |
| 0 | 5 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/jquery.validate.js
0 → 100644
| 1 | +/*! | |
| 2 | + * jQuery Validation Plugin v1.14.0 | |
| 3 | + * | |
| 4 | + * http://jqueryvalidation.org/ | |
| 5 | + * | |
| 6 | + * Copyright (c) 2015 Jörn Zaefferer | |
| 7 | + * Released under the MIT license | |
| 8 | + */ | |
| 9 | +(function( factory ) { | |
| 10 | + if ( typeof define === "function" && define.amd ) { | |
| 11 | + define( ["jquery"], factory ); | |
| 12 | + } else { | |
| 13 | + factory( jQuery ); | |
| 14 | + } | |
| 15 | +}(function( $ ) { | |
| 16 | + | |
| 17 | +$.extend($.fn, { | |
| 18 | + // http://jqueryvalidation.org/validate/ | |
| 19 | + validate: function( options ) { | |
| 20 | + | |
| 21 | + // if nothing is selected, return nothing; can't chain anyway | |
| 22 | + if ( !this.length ) { | |
| 23 | + if ( options && options.debug && window.console ) { | |
| 24 | + console.warn( "Nothing selected, can't validate, returning nothing." ); | |
| 25 | + } | |
| 26 | + return; | |
| 27 | + } | |
| 28 | + | |
| 29 | + // check if a validator for this form was already created | |
| 30 | + var validator = $.data( this[ 0 ], "validator" ); | |
| 31 | + if ( validator ) { | |
| 32 | + return validator; | |
| 33 | + } | |
| 34 | + | |
| 35 | + // Add novalidate tag if HTML5. | |
| 36 | + this.attr( "novalidate", "novalidate" ); | |
| 37 | + | |
| 38 | + validator = new $.validator( options, this[ 0 ] ); | |
| 39 | + $.data( this[ 0 ], "validator", validator ); | |
| 40 | + | |
| 41 | + if ( validator.settings.onsubmit ) { | |
| 42 | + | |
| 43 | + this.on( "click.validate", ":submit", function( event ) { | |
| 44 | + if ( validator.settings.submitHandler ) { | |
| 45 | + validator.submitButton = event.target; | |
| 46 | + } | |
| 47 | + | |
| 48 | + // allow suppressing validation by adding a cancel class to the submit button | |
| 49 | + if ( $( this ).hasClass( "cancel" ) ) { | |
| 50 | + validator.cancelSubmit = true; | |
| 51 | + } | |
| 52 | + | |
| 53 | + // allow suppressing validation by adding the html5 formnovalidate attribute to the submit button | |
| 54 | + if ( $( this ).attr( "formnovalidate" ) !== undefined ) { | |
| 55 | + validator.cancelSubmit = true; | |
| 56 | + } | |
| 57 | + }); | |
| 58 | + | |
| 59 | + // validate the form on submit | |
| 60 | + this.on( "submit.validate", function( event ) { | |
| 61 | + if ( validator.settings.debug ) { | |
| 62 | + // prevent form submit to be able to see console output | |
| 63 | + event.preventDefault(); | |
| 64 | + } | |
| 65 | + function handle() { | |
| 66 | + var hidden, result; | |
| 67 | + if ( validator.settings.submitHandler ) { | |
| 68 | + if ( validator.submitButton ) { | |
| 69 | + // insert a hidden input as a replacement for the missing submit button | |
| 70 | + hidden = $( "<input type='hidden'/>" ) | |
| 71 | + .attr( "name", validator.submitButton.name ) | |
| 72 | + .val( $( validator.submitButton ).val() ) | |
| 73 | + .appendTo( validator.currentForm ); | |
| 74 | + } | |
| 75 | + result = validator.settings.submitHandler.call( validator, validator.currentForm, event ); | |
| 76 | + if ( validator.submitButton ) { | |
| 77 | + // and clean up afterwards; thanks to no-block-scope, hidden can be referenced | |
| 78 | + hidden.remove(); | |
| 79 | + } | |
| 80 | + if ( result !== undefined ) { | |
| 81 | + return result; | |
| 82 | + } | |
| 83 | + return false; | |
| 84 | + } | |
| 85 | + return true; | |
| 86 | + } | |
| 87 | + | |
| 88 | + // prevent submit for invalid forms or custom submit handlers | |
| 89 | + if ( validator.cancelSubmit ) { | |
| 90 | + validator.cancelSubmit = false; | |
| 91 | + return handle(); | |
| 92 | + } | |
| 93 | + if ( validator.form() ) { | |
| 94 | + if ( validator.pendingRequest ) { | |
| 95 | + validator.formSubmitted = true; | |
| 96 | + return false; | |
| 97 | + } | |
| 98 | + return handle(); | |
| 99 | + } else { | |
| 100 | + validator.focusInvalid(); | |
| 101 | + return false; | |
| 102 | + } | |
| 103 | + }); | |
| 104 | + } | |
| 105 | + | |
| 106 | + return validator; | |
| 107 | + }, | |
| 108 | + // http://jqueryvalidation.org/valid/ | |
| 109 | + valid: function() { | |
| 110 | + var valid, validator, errorList; | |
| 111 | + | |
| 112 | + if ( $( this[ 0 ] ).is( "form" ) ) { | |
| 113 | + valid = this.validate().form(); | |
| 114 | + } else { | |
| 115 | + errorList = []; | |
| 116 | + valid = true; | |
| 117 | + validator = $( this[ 0 ].form ).validate(); | |
| 118 | + this.each( function() { | |
| 119 | + valid = validator.element( this ) && valid; | |
| 120 | + errorList = errorList.concat( validator.errorList ); | |
| 121 | + }); | |
| 122 | + validator.errorList = errorList; | |
| 123 | + } | |
| 124 | + return valid; | |
| 125 | + }, | |
| 126 | + | |
| 127 | + // http://jqueryvalidation.org/rules/ | |
| 128 | + rules: function( command, argument ) { | |
| 129 | + var element = this[ 0 ], | |
| 130 | + settings, staticRules, existingRules, data, param, filtered; | |
| 131 | + | |
| 132 | + if ( command ) { | |
| 133 | + settings = $.data( element.form, "validator" ).settings; | |
| 134 | + staticRules = settings.rules; | |
| 135 | + existingRules = $.validator.staticRules( element ); | |
| 136 | + switch ( command ) { | |
| 137 | + case "add": | |
| 138 | + $.extend( existingRules, $.validator.normalizeRule( argument ) ); | |
| 139 | + // remove messages from rules, but allow them to be set separately | |
| 140 | + delete existingRules.messages; | |
| 141 | + staticRules[ element.name ] = existingRules; | |
| 142 | + if ( argument.messages ) { | |
| 143 | + settings.messages[ element.name ] = $.extend( settings.messages[ element.name ], argument.messages ); | |
| 144 | + } | |
| 145 | + break; | |
| 146 | + case "remove": | |
| 147 | + if ( !argument ) { | |
| 148 | + delete staticRules[ element.name ]; | |
| 149 | + return existingRules; | |
| 150 | + } | |
| 151 | + filtered = {}; | |
| 152 | + $.each( argument.split( /\s/ ), function( index, method ) { | |
| 153 | + filtered[ method ] = existingRules[ method ]; | |
| 154 | + delete existingRules[ method ]; | |
| 155 | + if ( method === "required" ) { | |
| 156 | + $( element ).removeAttr( "aria-required" ); | |
| 157 | + } | |
| 158 | + }); | |
| 159 | + return filtered; | |
| 160 | + } | |
| 161 | + } | |
| 162 | + | |
| 163 | + data = $.validator.normalizeRules( | |
| 164 | + $.extend( | |
| 165 | + {}, | |
| 166 | + $.validator.classRules( element ), | |
| 167 | + $.validator.attributeRules( element ), | |
| 168 | + $.validator.dataRules( element ), | |
| 169 | + $.validator.staticRules( element ) | |
| 170 | + ), element ); | |
| 171 | + | |
| 172 | + // make sure required is at front | |
| 173 | + if ( data.required ) { | |
| 174 | + param = data.required; | |
| 175 | + delete data.required; | |
| 176 | + data = $.extend( { required: param }, data ); | |
| 177 | + $( element ).attr( "aria-required", "true" ); | |
| 178 | + } | |
| 179 | + | |
| 180 | + // make sure remote is at back | |
| 181 | + if ( data.remote ) { | |
| 182 | + param = data.remote; | |
| 183 | + delete data.remote; | |
| 184 | + data = $.extend( data, { remote: param }); | |
| 185 | + } | |
| 186 | + | |
| 187 | + return data; | |
| 188 | + } | |
| 189 | +}); | |
| 190 | + | |
| 191 | +// Custom selectors | |
| 192 | +$.extend( $.expr[ ":" ], { | |
| 193 | + // http://jqueryvalidation.org/blank-selector/ | |
| 194 | + blank: function( a ) { | |
| 195 | + return !$.trim( "" + $( a ).val() ); | |
| 196 | + }, | |
| 197 | + // http://jqueryvalidation.org/filled-selector/ | |
| 198 | + filled: function( a ) { | |
| 199 | + return !!$.trim( "" + $( a ).val() ); | |
| 200 | + }, | |
| 201 | + // http://jqueryvalidation.org/unchecked-selector/ | |
| 202 | + unchecked: function( a ) { | |
| 203 | + return !$( a ).prop( "checked" ); | |
| 204 | + } | |
| 205 | +}); | |
| 206 | + | |
| 207 | +// constructor for validator | |
| 208 | +$.validator = function( options, form ) { | |
| 209 | + this.settings = $.extend( true, {}, $.validator.defaults, options ); | |
| 210 | + this.currentForm = form; | |
| 211 | + this.init(); | |
| 212 | +}; | |
| 213 | + | |
| 214 | +// http://jqueryvalidation.org/jQuery.validator.format/ | |
| 215 | +$.validator.format = function( source, params ) { | |
| 216 | + if ( arguments.length === 1 ) { | |
| 217 | + return function() { | |
| 218 | + var args = $.makeArray( arguments ); | |
| 219 | + args.unshift( source ); | |
| 220 | + return $.validator.format.apply( this, args ); | |
| 221 | + }; | |
| 222 | + } | |
| 223 | + if ( arguments.length > 2 && params.constructor !== Array ) { | |
| 224 | + params = $.makeArray( arguments ).slice( 1 ); | |
| 225 | + } | |
| 226 | + if ( params.constructor !== Array ) { | |
| 227 | + params = [ params ]; | |
| 228 | + } | |
| 229 | + $.each( params, function( i, n ) { | |
| 230 | + source = source.replace( new RegExp( "\\{" + i + "\\}", "g" ), function() { | |
| 231 | + return n; | |
| 232 | + }); | |
| 233 | + }); | |
| 234 | + return source; | |
| 235 | +}; | |
| 236 | + | |
| 237 | +$.extend( $.validator, { | |
| 238 | + | |
| 239 | + defaults: { | |
| 240 | + messages: {}, | |
| 241 | + groups: {}, | |
| 242 | + rules: {}, | |
| 243 | + errorClass: "error", | |
| 244 | + validClass: "valid", | |
| 245 | + errorElement: "label", | |
| 246 | + focusCleanup: false, | |
| 247 | + focusInvalid: true, | |
| 248 | + errorContainer: $( [] ), | |
| 249 | + errorLabelContainer: $( [] ), | |
| 250 | + onsubmit: true, | |
| 251 | + ignore: ":hidden", | |
| 252 | + ignoreTitle: false, | |
| 253 | + onfocusin: function( element ) { | |
| 254 | + this.lastActive = element; | |
| 255 | + | |
| 256 | + // Hide error label and remove error class on focus if enabled | |
| 257 | + if ( this.settings.focusCleanup ) { | |
| 258 | + if ( this.settings.unhighlight ) { | |
| 259 | + this.settings.unhighlight.call( this, element, this.settings.errorClass, this.settings.validClass ); | |
| 260 | + } | |
| 261 | + this.hideThese( this.errorsFor( element ) ); | |
| 262 | + } | |
| 263 | + }, | |
| 264 | + onfocusout: function( element ) { | |
| 265 | + if ( !this.checkable( element ) && ( element.name in this.submitted || !this.optional( element ) ) ) { | |
| 266 | + this.element( element ); | |
| 267 | + } | |
| 268 | + }, | |
| 269 | + onkeyup: function( element, event ) { | |
| 270 | + // Avoid revalidate the field when pressing one of the following keys | |
| 271 | + // Shift => 16 | |
| 272 | + // Ctrl => 17 | |
| 273 | + // Alt => 18 | |
| 274 | + // Caps lock => 20 | |
| 275 | + // End => 35 | |
| 276 | + // Home => 36 | |
| 277 | + // Left arrow => 37 | |
| 278 | + // Up arrow => 38 | |
| 279 | + // Right arrow => 39 | |
| 280 | + // Down arrow => 40 | |
| 281 | + // Insert => 45 | |
| 282 | + // Num lock => 144 | |
| 283 | + // AltGr key => 225 | |
| 284 | + var excludedKeys = [ | |
| 285 | + 16, 17, 18, 20, 35, 36, 37, | |
| 286 | + 38, 39, 40, 45, 144, 225 | |
| 287 | + ]; | |
| 288 | + | |
| 289 | + if ( event.which === 9 && this.elementValue( element ) === "" || $.inArray( event.keyCode, excludedKeys ) !== -1 ) { | |
| 290 | + return; | |
| 291 | + } else if ( element.name in this.submitted || element === this.lastElement ) { | |
| 292 | + this.element( element ); | |
| 293 | + } | |
| 294 | + }, | |
| 295 | + onclick: function( element ) { | |
| 296 | + // click on selects, radiobuttons and checkboxes | |
| 297 | + if ( element.name in this.submitted ) { | |
| 298 | + this.element( element ); | |
| 299 | + | |
| 300 | + // or option elements, check parent select in that case | |
| 301 | + } else if ( element.parentNode.name in this.submitted ) { | |
| 302 | + this.element( element.parentNode ); | |
| 303 | + } | |
| 304 | + }, | |
| 305 | + highlight: function( element, errorClass, validClass ) { | |
| 306 | + if ( element.type === "radio" ) { | |
| 307 | + this.findByName( element.name ).addClass( errorClass ).removeClass( validClass ); | |
| 308 | + } else { | |
| 309 | + $( element ).addClass( errorClass ).removeClass( validClass ); | |
| 310 | + } | |
| 311 | + }, | |
| 312 | + unhighlight: function( element, errorClass, validClass ) { | |
| 313 | + if ( element.type === "radio" ) { | |
| 314 | + this.findByName( element.name ).removeClass( errorClass ).addClass( validClass ); | |
| 315 | + } else { | |
| 316 | + $( element ).removeClass( errorClass ).addClass( validClass ); | |
| 317 | + } | |
| 318 | + } | |
| 319 | + }, | |
| 320 | + | |
| 321 | + // http://jqueryvalidation.org/jQuery.validator.setDefaults/ | |
| 322 | + setDefaults: function( settings ) { | |
| 323 | + $.extend( $.validator.defaults, settings ); | |
| 324 | + }, | |
| 325 | + | |
| 326 | + messages: { | |
| 327 | + required: "This field is required.", | |
| 328 | + remote: "Please fix this field.", | |
| 329 | + email: "Please enter a valid email address.", | |
| 330 | + url: "Please enter a valid URL.", | |
| 331 | + date: "Please enter a valid date.", | |
| 332 | + dateISO: "Please enter a valid date ( ISO ).", | |
| 333 | + number: "Please enter a valid number.", | |
| 334 | + digits: "Please enter only digits.", | |
| 335 | + creditcard: "Please enter a valid credit card number.", | |
| 336 | + equalTo: "Please enter the same value again.", | |
| 337 | + maxlength: $.validator.format( "Please enter no more than {0} characters." ), | |
| 338 | + minlength: $.validator.format( "Please enter at least {0} characters." ), | |
| 339 | + rangelength: $.validator.format( "Please enter a value between {0} and {1} characters long." ), | |
| 340 | + range: $.validator.format( "Please enter a value between {0} and {1}." ), | |
| 341 | + max: $.validator.format( "Please enter a value less than or equal to {0}." ), | |
| 342 | + min: $.validator.format( "Please enter a value greater than or equal to {0}." ) | |
| 343 | + }, | |
| 344 | + | |
| 345 | + autoCreateRanges: false, | |
| 346 | + | |
| 347 | + prototype: { | |
| 348 | + | |
| 349 | + init: function() { | |
| 350 | + this.labelContainer = $( this.settings.errorLabelContainer ); | |
| 351 | + this.errorContext = this.labelContainer.length && this.labelContainer || $( this.currentForm ); | |
| 352 | + this.containers = $( this.settings.errorContainer ).add( this.settings.errorLabelContainer ); | |
| 353 | + this.submitted = {}; | |
| 354 | + this.valueCache = {}; | |
| 355 | + this.pendingRequest = 0; | |
| 356 | + this.pending = {}; | |
| 357 | + this.invalid = {}; | |
| 358 | + this.reset(); | |
| 359 | + | |
| 360 | + var groups = ( this.groups = {} ), | |
| 361 | + rules; | |
| 362 | + $.each( this.settings.groups, function( key, value ) { | |
| 363 | + if ( typeof value === "string" ) { | |
| 364 | + value = value.split( /\s/ ); | |
| 365 | + } | |
| 366 | + $.each( value, function( index, name ) { | |
| 367 | + groups[ name ] = key; | |
| 368 | + }); | |
| 369 | + }); | |
| 370 | + rules = this.settings.rules; | |
| 371 | + $.each( rules, function( key, value ) { | |
| 372 | + rules[ key ] = $.validator.normalizeRule( value ); | |
| 373 | + }); | |
| 374 | + | |
| 375 | + function delegate( event ) { | |
| 376 | + var validator = $.data( this.form, "validator" ), | |
| 377 | + eventType = "on" + event.type.replace( /^validate/, "" ), | |
| 378 | + settings = validator.settings; | |
| 379 | + if ( settings[ eventType ] && !$( this ).is( settings.ignore ) ) { | |
| 380 | + settings[ eventType ].call( validator, this, event ); | |
| 381 | + } | |
| 382 | + } | |
| 383 | + | |
| 384 | + $( this.currentForm ) | |
| 385 | + .on( "focusin.validate focusout.validate keyup.validate", | |
| 386 | + ":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], " + | |
| 387 | + "[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], " + | |
| 388 | + "[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], " + | |
| 389 | + "[type='radio'], [type='checkbox']", delegate) | |
| 390 | + // Support: Chrome, oldIE | |
| 391 | + // "select" is provided as event.target when clicking a option | |
| 392 | + .on("click.validate", "select, option, [type='radio'], [type='checkbox']", delegate); | |
| 393 | + | |
| 394 | + if ( this.settings.invalidHandler ) { | |
| 395 | + $( this.currentForm ).on( "invalid-form.validate", this.settings.invalidHandler ); | |
| 396 | + } | |
| 397 | + | |
| 398 | + // Add aria-required to any Static/Data/Class required fields before first validation | |
| 399 | + // Screen readers require this attribute to be present before the initial submission http://www.w3.org/TR/WCAG-TECHS/ARIA2.html | |
| 400 | + $( this.currentForm ).find( "[required], [data-rule-required], .required" ).attr( "aria-required", "true" ); | |
| 401 | + }, | |
| 402 | + | |
| 403 | + // http://jqueryvalidation.org/Validator.form/ | |
| 404 | + form: function() { | |
| 405 | + this.checkForm(); | |
| 406 | + $.extend( this.submitted, this.errorMap ); | |
| 407 | + this.invalid = $.extend({}, this.errorMap ); | |
| 408 | + if ( !this.valid() ) { | |
| 409 | + $( this.currentForm ).triggerHandler( "invalid-form", [ this ]); | |
| 410 | + } | |
| 411 | + this.showErrors(); | |
| 412 | + return this.valid(); | |
| 413 | + }, | |
| 414 | + | |
| 415 | + checkForm: function() { | |
| 416 | + this.prepareForm(); | |
| 417 | + for ( var i = 0, elements = ( this.currentElements = this.elements() ); elements[ i ]; i++ ) { | |
| 418 | + this.check( elements[ i ] ); | |
| 419 | + } | |
| 420 | + return this.valid(); | |
| 421 | + }, | |
| 422 | + | |
| 423 | + // http://jqueryvalidation.org/Validator.element/ | |
| 424 | + element: function( element ) { | |
| 425 | + var cleanElement = this.clean( element ), | |
| 426 | + checkElement = this.validationTargetFor( cleanElement ), | |
| 427 | + result = true; | |
| 428 | + | |
| 429 | + this.lastElement = checkElement; | |
| 430 | + | |
| 431 | + if ( checkElement === undefined ) { | |
| 432 | + delete this.invalid[ cleanElement.name ]; | |
| 433 | + } else { | |
| 434 | + this.prepareElement( checkElement ); | |
| 435 | + this.currentElements = $( checkElement ); | |
| 436 | + | |
| 437 | + result = this.check( checkElement ) !== false; | |
| 438 | + if ( result ) { | |
| 439 | + delete this.invalid[ checkElement.name ]; | |
| 440 | + } else { | |
| 441 | + this.invalid[ checkElement.name ] = true; | |
| 442 | + } | |
| 443 | + } | |
| 444 | + // Add aria-invalid status for screen readers | |
| 445 | + $( element ).attr( "aria-invalid", !result ); | |
| 446 | + | |
| 447 | + if ( !this.numberOfInvalids() ) { | |
| 448 | + // Hide error containers on last error | |
| 449 | + this.toHide = this.toHide.add( this.containers ); | |
| 450 | + } | |
| 451 | + this.showErrors(); | |
| 452 | + return result; | |
| 453 | + }, | |
| 454 | + | |
| 455 | + // http://jqueryvalidation.org/Validator.showErrors/ | |
| 456 | + showErrors: function( errors ) { | |
| 457 | + if ( errors ) { | |
| 458 | + // add items to error list and map | |
| 459 | + $.extend( this.errorMap, errors ); | |
| 460 | + this.errorList = []; | |
| 461 | + for ( var name in errors ) { | |
| 462 | + this.errorList.push({ | |
| 463 | + message: errors[ name ], | |
| 464 | + element: this.findByName( name )[ 0 ] | |
| 465 | + }); | |
| 466 | + } | |
| 467 | + // remove items from success list | |
| 468 | + this.successList = $.grep( this.successList, function( element ) { | |
| 469 | + return !( element.name in errors ); | |
| 470 | + }); | |
| 471 | + } | |
| 472 | + if ( this.settings.showErrors ) { | |
| 473 | + this.settings.showErrors.call( this, this.errorMap, this.errorList ); | |
| 474 | + } else { | |
| 475 | + this.defaultShowErrors(); | |
| 476 | + } | |
| 477 | + }, | |
| 478 | + | |
| 479 | + // http://jqueryvalidation.org/Validator.resetForm/ | |
| 480 | + resetForm: function() { | |
| 481 | + if ( $.fn.resetForm ) { | |
| 482 | + $( this.currentForm ).resetForm(); | |
| 483 | + } | |
| 484 | + this.submitted = {}; | |
| 485 | + this.lastElement = null; | |
| 486 | + this.prepareForm(); | |
| 487 | + this.hideErrors(); | |
| 488 | + var i, elements = this.elements() | |
| 489 | + .removeData( "previousValue" ) | |
| 490 | + .removeAttr( "aria-invalid" ); | |
| 491 | + | |
| 492 | + if ( this.settings.unhighlight ) { | |
| 493 | + for ( i = 0; elements[ i ]; i++ ) { | |
| 494 | + this.settings.unhighlight.call( this, elements[ i ], | |
| 495 | + this.settings.errorClass, "" ); | |
| 496 | + } | |
| 497 | + } else { | |
| 498 | + elements.removeClass( this.settings.errorClass ); | |
| 499 | + } | |
| 500 | + }, | |
| 501 | + | |
| 502 | + numberOfInvalids: function() { | |
| 503 | + return this.objectLength( this.invalid ); | |
| 504 | + }, | |
| 505 | + | |
| 506 | + objectLength: function( obj ) { | |
| 507 | + /* jshint unused: false */ | |
| 508 | + var count = 0, | |
| 509 | + i; | |
| 510 | + for ( i in obj ) { | |
| 511 | + count++; | |
| 512 | + } | |
| 513 | + return count; | |
| 514 | + }, | |
| 515 | + | |
| 516 | + hideErrors: function() { | |
| 517 | + this.hideThese( this.toHide ); | |
| 518 | + }, | |
| 519 | + | |
| 520 | + hideThese: function( errors ) { | |
| 521 | + errors.not( this.containers ).text( "" ); | |
| 522 | + this.addWrapper( errors ).hide(); | |
| 523 | + }, | |
| 524 | + | |
| 525 | + valid: function() { | |
| 526 | + return this.size() === 0; | |
| 527 | + }, | |
| 528 | + | |
| 529 | + size: function() { | |
| 530 | + return this.errorList.length; | |
| 531 | + }, | |
| 532 | + | |
| 533 | + focusInvalid: function() { | |
| 534 | + if ( this.settings.focusInvalid ) { | |
| 535 | + try { | |
| 536 | + $( this.findLastActive() || this.errorList.length && this.errorList[ 0 ].element || []) | |
| 537 | + .filter( ":visible" ) | |
| 538 | + .focus() | |
| 539 | + // manually trigger focusin event; without it, focusin handlers isn't called, findLastActive won't have anything to find | |
| 540 | + .trigger( "focusin" ); | |
| 541 | + } catch ( e ) { | |
| 542 | + // ignore IE throwing errors when focusing hidden elements | |
| 543 | + } | |
| 544 | + } | |
| 545 | + }, | |
| 546 | + | |
| 547 | + findLastActive: function() { | |
| 548 | + var lastActive = this.lastActive; | |
| 549 | + return lastActive && $.grep( this.errorList, function( n ) { | |
| 550 | + return n.element.name === lastActive.name; | |
| 551 | + }).length === 1 && lastActive; | |
| 552 | + }, | |
| 553 | + | |
| 554 | + elements: function() { | |
| 555 | + var validator = this, | |
| 556 | + rulesCache = {}; | |
| 557 | + | |
| 558 | + // select all valid inputs inside the form (no submit or reset buttons) | |
| 559 | + return $( this.currentForm ) | |
| 560 | + .find( "input, select, textarea" ) | |
| 561 | + .not( ":submit, :reset, :image, :disabled" ) | |
| 562 | + .not( this.settings.ignore ) | |
| 563 | + .filter( function() { | |
| 564 | + if ( !this.name && validator.settings.debug && window.console ) { | |
| 565 | + console.error( "%o has no name assigned", this ); | |
| 566 | + } | |
| 567 | + | |
| 568 | + // select only the first element for each name, and only those with rules specified | |
| 569 | + if ( this.name in rulesCache || !validator.objectLength( $( this ).rules() ) ) { | |
| 570 | + return false; | |
| 571 | + } | |
| 572 | + | |
| 573 | + rulesCache[ this.name ] = true; | |
| 574 | + return true; | |
| 575 | + }); | |
| 576 | + }, | |
| 577 | + | |
| 578 | + clean: function( selector ) { | |
| 579 | + return $( selector )[ 0 ]; | |
| 580 | + }, | |
| 581 | + | |
| 582 | + errors: function() { | |
| 583 | + var errorClass = this.settings.errorClass.split( " " ).join( "." ); | |
| 584 | + return $( this.settings.errorElement + "." + errorClass, this.errorContext ); | |
| 585 | + }, | |
| 586 | + | |
| 587 | + reset: function() { | |
| 588 | + this.successList = []; | |
| 589 | + this.errorList = []; | |
| 590 | + this.errorMap = {}; | |
| 591 | + this.toShow = $( [] ); | |
| 592 | + this.toHide = $( [] ); | |
| 593 | + this.currentElements = $( [] ); | |
| 594 | + }, | |
| 595 | + | |
| 596 | + prepareForm: function() { | |
| 597 | + this.reset(); | |
| 598 | + this.toHide = this.errors().add( this.containers ); | |
| 599 | + }, | |
| 600 | + | |
| 601 | + prepareElement: function( element ) { | |
| 602 | + this.reset(); | |
| 603 | + this.toHide = this.errorsFor( element ); | |
| 604 | + }, | |
| 605 | + | |
| 606 | + elementValue: function( element ) { | |
| 607 | + var val, | |
| 608 | + $element = $( element ), | |
| 609 | + type = element.type; | |
| 610 | + | |
| 611 | + if ( type === "radio" || type === "checkbox" ) { | |
| 612 | + return this.findByName( element.name ).filter(":checked").val(); | |
| 613 | + } else if ( type === "number" && typeof element.validity !== "undefined" ) { | |
| 614 | + return element.validity.badInput ? false : $element.val(); | |
| 615 | + } | |
| 616 | + | |
| 617 | + val = $element.val(); | |
| 618 | + if ( typeof val === "string" ) { | |
| 619 | + return val.replace(/\r/g, "" ); | |
| 620 | + } | |
| 621 | + return val; | |
| 622 | + }, | |
| 623 | + | |
| 624 | + check: function( element ) { | |
| 625 | + element = this.validationTargetFor( this.clean( element ) ); | |
| 626 | + | |
| 627 | + var rules = $( element ).rules(), | |
| 628 | + rulesCount = $.map( rules, function( n, i ) { | |
| 629 | + return i; | |
| 630 | + }).length, | |
| 631 | + dependencyMismatch = false, | |
| 632 | + val = this.elementValue( element ), | |
| 633 | + result, method, rule; | |
| 634 | + | |
| 635 | + for ( method in rules ) { | |
| 636 | + rule = { method: method, parameters: rules[ method ] }; | |
| 637 | + try { | |
| 638 | + | |
| 639 | + result = $.validator.methods[ method ].call( this, val, element, rule.parameters ); | |
| 640 | + | |
| 641 | + // if a method indicates that the field is optional and therefore valid, | |
| 642 | + // don't mark it as valid when there are no other rules | |
| 643 | + if ( result === "dependency-mismatch" && rulesCount === 1 ) { | |
| 644 | + dependencyMismatch = true; | |
| 645 | + continue; | |
| 646 | + } | |
| 647 | + dependencyMismatch = false; | |
| 648 | + | |
| 649 | + if ( result === "pending" ) { | |
| 650 | + this.toHide = this.toHide.not( this.errorsFor( element ) ); | |
| 651 | + return; | |
| 652 | + } | |
| 653 | + | |
| 654 | + if ( !result ) { | |
| 655 | + this.formatAndAdd( element, rule ); | |
| 656 | + return false; | |
| 657 | + } | |
| 658 | + } catch ( e ) { | |
| 659 | + if ( this.settings.debug && window.console ) { | |
| 660 | + console.log( "Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.", e ); | |
| 661 | + } | |
| 662 | + if ( e instanceof TypeError ) { | |
| 663 | + e.message += ". Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method."; | |
| 664 | + } | |
| 665 | + | |
| 666 | + throw e; | |
| 667 | + } | |
| 668 | + } | |
| 669 | + if ( dependencyMismatch ) { | |
| 670 | + return; | |
| 671 | + } | |
| 672 | + if ( this.objectLength( rules ) ) { | |
| 673 | + this.successList.push( element ); | |
| 674 | + } | |
| 675 | + return true; | |
| 676 | + }, | |
| 677 | + | |
| 678 | + // return the custom message for the given element and validation method | |
| 679 | + // specified in the element's HTML5 data attribute | |
| 680 | + // return the generic message if present and no method specific message is present | |
| 681 | + customDataMessage: function( element, method ) { | |
| 682 | + return $( element ).data( "msg" + method.charAt( 0 ).toUpperCase() + | |
| 683 | + method.substring( 1 ).toLowerCase() ) || $( element ).data( "msg" ); | |
| 684 | + }, | |
| 685 | + | |
| 686 | + // return the custom message for the given element name and validation method | |
| 687 | + customMessage: function( name, method ) { | |
| 688 | + var m = this.settings.messages[ name ]; | |
| 689 | + return m && ( m.constructor === String ? m : m[ method ]); | |
| 690 | + }, | |
| 691 | + | |
| 692 | + // return the first defined argument, allowing empty strings | |
| 693 | + findDefined: function() { | |
| 694 | + for ( var i = 0; i < arguments.length; i++) { | |
| 695 | + if ( arguments[ i ] !== undefined ) { | |
| 696 | + return arguments[ i ]; | |
| 697 | + } | |
| 698 | + } | |
| 699 | + return undefined; | |
| 700 | + }, | |
| 701 | + | |
| 702 | + defaultMessage: function( element, method ) { | |
| 703 | + return this.findDefined( | |
| 704 | + this.customMessage( element.name, method ), | |
| 705 | + this.customDataMessage( element, method ), | |
| 706 | + // title is never undefined, so handle empty string as undefined | |
| 707 | + !this.settings.ignoreTitle && element.title || undefined, | |
| 708 | + $.validator.messages[ method ], | |
| 709 | + "<strong>Warning: No message defined for " + element.name + "</strong>" | |
| 710 | + ); | |
| 711 | + }, | |
| 712 | + | |
| 713 | + formatAndAdd: function( element, rule ) { | |
| 714 | + var message = this.defaultMessage( element, rule.method ), | |
| 715 | + theregex = /\$?\{(\d+)\}/g; | |
| 716 | + if ( typeof message === "function" ) { | |
| 717 | + message = message.call( this, rule.parameters, element ); | |
| 718 | + } else if ( theregex.test( message ) ) { | |
| 719 | + message = $.validator.format( message.replace( theregex, "{$1}" ), rule.parameters ); | |
| 720 | + } | |
| 721 | + this.errorList.push({ | |
| 722 | + message: message, | |
| 723 | + element: element, | |
| 724 | + method: rule.method | |
| 725 | + }); | |
| 726 | + | |
| 727 | + this.errorMap[ element.name ] = message; | |
| 728 | + this.submitted[ element.name ] = message; | |
| 729 | + }, | |
| 730 | + | |
| 731 | + addWrapper: function( toToggle ) { | |
| 732 | + if ( this.settings.wrapper ) { | |
| 733 | + toToggle = toToggle.add( toToggle.parent( this.settings.wrapper ) ); | |
| 734 | + } | |
| 735 | + return toToggle; | |
| 736 | + }, | |
| 737 | + | |
| 738 | + defaultShowErrors: function() { | |
| 739 | + var i, elements, error; | |
| 740 | + for ( i = 0; this.errorList[ i ]; i++ ) { | |
| 741 | + error = this.errorList[ i ]; | |
| 742 | + if ( this.settings.highlight ) { | |
| 743 | + this.settings.highlight.call( this, error.element, this.settings.errorClass, this.settings.validClass ); | |
| 744 | + } | |
| 745 | + this.showLabel( error.element, error.message ); | |
| 746 | + } | |
| 747 | + if ( this.errorList.length ) { | |
| 748 | + this.toShow = this.toShow.add( this.containers ); | |
| 749 | + } | |
| 750 | + if ( this.settings.success ) { | |
| 751 | + for ( i = 0; this.successList[ i ]; i++ ) { | |
| 752 | + this.showLabel( this.successList[ i ] ); | |
| 753 | + } | |
| 754 | + } | |
| 755 | + if ( this.settings.unhighlight ) { | |
| 756 | + for ( i = 0, elements = this.validElements(); elements[ i ]; i++ ) { | |
| 757 | + this.settings.unhighlight.call( this, elements[ i ], this.settings.errorClass, this.settings.validClass ); | |
| 758 | + } | |
| 759 | + } | |
| 760 | + this.toHide = this.toHide.not( this.toShow ); | |
| 761 | + this.hideErrors(); | |
| 762 | + this.addWrapper( this.toShow ).show(); | |
| 763 | + }, | |
| 764 | + | |
| 765 | + validElements: function() { | |
| 766 | + return this.currentElements.not( this.invalidElements() ); | |
| 767 | + }, | |
| 768 | + | |
| 769 | + invalidElements: function() { | |
| 770 | + return $( this.errorList ).map(function() { | |
| 771 | + return this.element; | |
| 772 | + }); | |
| 773 | + }, | |
| 774 | + | |
| 775 | + showLabel: function( element, message ) { | |
| 776 | + var place, group, errorID, | |
| 777 | + error = this.errorsFor( element ), | |
| 778 | + elementID = this.idOrName( element ), | |
| 779 | + describedBy = $( element ).attr( "aria-describedby" ); | |
| 780 | + if ( error.length ) { | |
| 781 | + // refresh error/success class | |
| 782 | + error.removeClass( this.settings.validClass ).addClass( this.settings.errorClass ); | |
| 783 | + // replace message on existing label | |
| 784 | + error.html( message ); | |
| 785 | + } else { | |
| 786 | + // create error element | |
| 787 | + error = $( "<" + this.settings.errorElement + ">" ) | |
| 788 | + .attr( "id", elementID + "-error" ) | |
| 789 | + .addClass( this.settings.errorClass ) | |
| 790 | + .html( message || "" ); | |
| 791 | + | |
| 792 | + // Maintain reference to the element to be placed into the DOM | |
| 793 | + place = error; | |
| 794 | + if ( this.settings.wrapper ) { | |
| 795 | + // make sure the element is visible, even in IE | |
| 796 | + // actually showing the wrapped element is handled elsewhere | |
| 797 | + place = error.hide().show().wrap( "<" + this.settings.wrapper + "/>" ).parent(); | |
| 798 | + } | |
| 799 | + if ( this.labelContainer.length ) { | |
| 800 | + this.labelContainer.append( place ); | |
| 801 | + } else if ( this.settings.errorPlacement ) { | |
| 802 | + this.settings.errorPlacement( place, $( element ) ); | |
| 803 | + } else { | |
| 804 | + place.insertAfter( element ); | |
| 805 | + } | |
| 806 | + | |
| 807 | + // Link error back to the element | |
| 808 | + if ( error.is( "label" ) ) { | |
| 809 | + // If the error is a label, then associate using 'for' | |
| 810 | + error.attr( "for", elementID ); | |
| 811 | + } else if ( error.parents( "label[for='" + elementID + "']" ).length === 0 ) { | |
| 812 | + // If the element is not a child of an associated label, then it's necessary | |
| 813 | + // to explicitly apply aria-describedby | |
| 814 | + | |
| 815 | + errorID = error.attr( "id" ).replace( /(:|\.|\[|\]|\$)/g, "\\$1"); | |
| 816 | + // Respect existing non-error aria-describedby | |
| 817 | + if ( !describedBy ) { | |
| 818 | + describedBy = errorID; | |
| 819 | + } else if ( !describedBy.match( new RegExp( "\\b" + errorID + "\\b" ) ) ) { | |
| 820 | + // Add to end of list if not already present | |
| 821 | + describedBy += " " + errorID; | |
| 822 | + } | |
| 823 | + $( element ).attr( "aria-describedby", describedBy ); | |
| 824 | + | |
| 825 | + // If this element is grouped, then assign to all elements in the same group | |
| 826 | + group = this.groups[ element.name ]; | |
| 827 | + if ( group ) { | |
| 828 | + $.each( this.groups, function( name, testgroup ) { | |
| 829 | + if ( testgroup === group ) { | |
| 830 | + $( "[name='" + name + "']", this.currentForm ) | |
| 831 | + .attr( "aria-describedby", error.attr( "id" ) ); | |
| 832 | + } | |
| 833 | + }); | |
| 834 | + } | |
| 835 | + } | |
| 836 | + } | |
| 837 | + if ( !message && this.settings.success ) { | |
| 838 | + error.text( "" ); | |
| 839 | + if ( typeof this.settings.success === "string" ) { | |
| 840 | + error.addClass( this.settings.success ); | |
| 841 | + } else { | |
| 842 | + this.settings.success( error, element ); | |
| 843 | + } | |
| 844 | + } | |
| 845 | + this.toShow = this.toShow.add( error ); | |
| 846 | + }, | |
| 847 | + | |
| 848 | + errorsFor: function( element ) { | |
| 849 | + var name = this.idOrName( element ), | |
| 850 | + describer = $( element ).attr( "aria-describedby" ), | |
| 851 | + selector = "label[for='" + name + "'], label[for='" + name + "'] *"; | |
| 852 | + | |
| 853 | + // aria-describedby should directly reference the error element | |
| 854 | + if ( describer ) { | |
| 855 | + selector = selector + ", #" + describer.replace( /\s+/g, ", #" ); | |
| 856 | + } | |
| 857 | + return this | |
| 858 | + .errors() | |
| 859 | + .filter( selector ); | |
| 860 | + }, | |
| 861 | + | |
| 862 | + idOrName: function( element ) { | |
| 863 | + return this.groups[ element.name ] || ( this.checkable( element ) ? element.name : element.id || element.name ); | |
| 864 | + }, | |
| 865 | + | |
| 866 | + validationTargetFor: function( element ) { | |
| 867 | + | |
| 868 | + // If radio/checkbox, validate first element in group instead | |
| 869 | + if ( this.checkable( element ) ) { | |
| 870 | + element = this.findByName( element.name ); | |
| 871 | + } | |
| 872 | + | |
| 873 | + // Always apply ignore filter | |
| 874 | + return $( element ).not( this.settings.ignore )[ 0 ]; | |
| 875 | + }, | |
| 876 | + | |
| 877 | + checkable: function( element ) { | |
| 878 | + return ( /radio|checkbox/i ).test( element.type ); | |
| 879 | + }, | |
| 880 | + | |
| 881 | + findByName: function( name ) { | |
| 882 | + return $( this.currentForm ).find( "[name='" + name + "']" ); | |
| 883 | + }, | |
| 884 | + | |
| 885 | + getLength: function( value, element ) { | |
| 886 | + switch ( element.nodeName.toLowerCase() ) { | |
| 887 | + case "select": | |
| 888 | + return $( "option:selected", element ).length; | |
| 889 | + case "input": | |
| 890 | + if ( this.checkable( element ) ) { | |
| 891 | + return this.findByName( element.name ).filter( ":checked" ).length; | |
| 892 | + } | |
| 893 | + } | |
| 894 | + return value.length; | |
| 895 | + }, | |
| 896 | + | |
| 897 | + depend: function( param, element ) { | |
| 898 | + return this.dependTypes[typeof param] ? this.dependTypes[typeof param]( param, element ) : true; | |
| 899 | + }, | |
| 900 | + | |
| 901 | + dependTypes: { | |
| 902 | + "boolean": function( param ) { | |
| 903 | + return param; | |
| 904 | + }, | |
| 905 | + "string": function( param, element ) { | |
| 906 | + return !!$( param, element.form ).length; | |
| 907 | + }, | |
| 908 | + "function": function( param, element ) { | |
| 909 | + return param( element ); | |
| 910 | + } | |
| 911 | + }, | |
| 912 | + | |
| 913 | + optional: function( element ) { | |
| 914 | + var val = this.elementValue( element ); | |
| 915 | + return !$.validator.methods.required.call( this, val, element ) && "dependency-mismatch"; | |
| 916 | + }, | |
| 917 | + | |
| 918 | + startRequest: function( element ) { | |
| 919 | + if ( !this.pending[ element.name ] ) { | |
| 920 | + this.pendingRequest++; | |
| 921 | + this.pending[ element.name ] = true; | |
| 922 | + } | |
| 923 | + }, | |
| 924 | + | |
| 925 | + stopRequest: function( element, valid ) { | |
| 926 | + this.pendingRequest--; | |
| 927 | + // sometimes synchronization fails, make sure pendingRequest is never < 0 | |
| 928 | + if ( this.pendingRequest < 0 ) { | |
| 929 | + this.pendingRequest = 0; | |
| 930 | + } | |
| 931 | + delete this.pending[ element.name ]; | |
| 932 | + if ( valid && this.pendingRequest === 0 && this.formSubmitted && this.form() ) { | |
| 933 | + $( this.currentForm ).submit(); | |
| 934 | + this.formSubmitted = false; | |
| 935 | + } else if (!valid && this.pendingRequest === 0 && this.formSubmitted ) { | |
| 936 | + $( this.currentForm ).triggerHandler( "invalid-form", [ this ]); | |
| 937 | + this.formSubmitted = false; | |
| 938 | + } | |
| 939 | + }, | |
| 940 | + | |
| 941 | + previousValue: function( element ) { | |
| 942 | + return $.data( element, "previousValue" ) || $.data( element, "previousValue", { | |
| 943 | + old: null, | |
| 944 | + valid: true, | |
| 945 | + message: this.defaultMessage( element, "remote" ) | |
| 946 | + }); | |
| 947 | + }, | |
| 948 | + | |
| 949 | + // cleans up all forms and elements, removes validator-specific events | |
| 950 | + destroy: function() { | |
| 951 | + this.resetForm(); | |
| 952 | + | |
| 953 | + $( this.currentForm ) | |
| 954 | + .off( ".validate" ) | |
| 955 | + .removeData( "validator" ); | |
| 956 | + } | |
| 957 | + | |
| 958 | + }, | |
| 959 | + | |
| 960 | + classRuleSettings: { | |
| 961 | + required: { required: true }, | |
| 962 | + email: { email: true }, | |
| 963 | + url: { url: true }, | |
| 964 | + date: { date: true }, | |
| 965 | + dateISO: { dateISO: true }, | |
| 966 | + number: { number: true }, | |
| 967 | + digits: { digits: true }, | |
| 968 | + creditcard: { creditcard: true } | |
| 969 | + }, | |
| 970 | + | |
| 971 | + addClassRules: function( className, rules ) { | |
| 972 | + if ( className.constructor === String ) { | |
| 973 | + this.classRuleSettings[ className ] = rules; | |
| 974 | + } else { | |
| 975 | + $.extend( this.classRuleSettings, className ); | |
| 976 | + } | |
| 977 | + }, | |
| 978 | + | |
| 979 | + classRules: function( element ) { | |
| 980 | + var rules = {}, | |
| 981 | + classes = $( element ).attr( "class" ); | |
| 982 | + | |
| 983 | + if ( classes ) { | |
| 984 | + $.each( classes.split( " " ), function() { | |
| 985 | + if ( this in $.validator.classRuleSettings ) { | |
| 986 | + $.extend( rules, $.validator.classRuleSettings[ this ]); | |
| 987 | + } | |
| 988 | + }); | |
| 989 | + } | |
| 990 | + return rules; | |
| 991 | + }, | |
| 992 | + | |
| 993 | + normalizeAttributeRule: function( rules, type, method, value ) { | |
| 994 | + | |
| 995 | + // convert the value to a number for number inputs, and for text for backwards compability | |
| 996 | + // allows type="date" and others to be compared as strings | |
| 997 | + if ( /min|max/.test( method ) && ( type === null || /number|range|text/.test( type ) ) ) { | |
| 998 | + value = Number( value ); | |
| 999 | + | |
| 1000 | + // Support Opera Mini, which returns NaN for undefined minlength | |
| 1001 | + if ( isNaN( value ) ) { | |
| 1002 | + value = undefined; | |
| 1003 | + } | |
| 1004 | + } | |
| 1005 | + | |
| 1006 | + if ( value || value === 0 ) { | |
| 1007 | + rules[ method ] = value; | |
| 1008 | + } else if ( type === method && type !== "range" ) { | |
| 1009 | + | |
| 1010 | + // exception: the jquery validate 'range' method | |
| 1011 | + // does not test for the html5 'range' type | |
| 1012 | + rules[ method ] = true; | |
| 1013 | + } | |
| 1014 | + }, | |
| 1015 | + | |
| 1016 | + attributeRules: function( element ) { | |
| 1017 | + var rules = {}, | |
| 1018 | + $element = $( element ), | |
| 1019 | + type = element.getAttribute( "type" ), | |
| 1020 | + method, value; | |
| 1021 | + | |
| 1022 | + for ( method in $.validator.methods ) { | |
| 1023 | + | |
| 1024 | + // support for <input required> in both html5 and older browsers | |
| 1025 | + if ( method === "required" ) { | |
| 1026 | + value = element.getAttribute( method ); | |
| 1027 | + | |
| 1028 | + // Some browsers return an empty string for the required attribute | |
| 1029 | + // and non-HTML5 browsers might have required="" markup | |
| 1030 | + if ( value === "" ) { | |
| 1031 | + value = true; | |
| 1032 | + } | |
| 1033 | + | |
| 1034 | + // force non-HTML5 browsers to return bool | |
| 1035 | + value = !!value; | |
| 1036 | + } else { | |
| 1037 | + value = $element.attr( method ); | |
| 1038 | + } | |
| 1039 | + | |
| 1040 | + this.normalizeAttributeRule( rules, type, method, value ); | |
| 1041 | + } | |
| 1042 | + | |
| 1043 | + // maxlength may be returned as -1, 2147483647 ( IE ) and 524288 ( safari ) for text inputs | |
| 1044 | + if ( rules.maxlength && /-1|2147483647|524288/.test( rules.maxlength ) ) { | |
| 1045 | + delete rules.maxlength; | |
| 1046 | + } | |
| 1047 | + | |
| 1048 | + return rules; | |
| 1049 | + }, | |
| 1050 | + | |
| 1051 | + dataRules: function( element ) { | |
| 1052 | + var rules = {}, | |
| 1053 | + $element = $( element ), | |
| 1054 | + type = element.getAttribute( "type" ), | |
| 1055 | + method, value; | |
| 1056 | + | |
| 1057 | + for ( method in $.validator.methods ) { | |
| 1058 | + value = $element.data( "rule" + method.charAt( 0 ).toUpperCase() + method.substring( 1 ).toLowerCase() ); | |
| 1059 | + this.normalizeAttributeRule( rules, type, method, value ); | |
| 1060 | + } | |
| 1061 | + return rules; | |
| 1062 | + }, | |
| 1063 | + | |
| 1064 | + staticRules: function( element ) { | |
| 1065 | + var rules = {}, | |
| 1066 | + validator = $.data( element.form, "validator" ); | |
| 1067 | + | |
| 1068 | + if ( validator.settings.rules ) { | |
| 1069 | + rules = $.validator.normalizeRule( validator.settings.rules[ element.name ] ) || {}; | |
| 1070 | + } | |
| 1071 | + return rules; | |
| 1072 | + }, | |
| 1073 | + | |
| 1074 | + normalizeRules: function( rules, element ) { | |
| 1075 | + // handle dependency check | |
| 1076 | + $.each( rules, function( prop, val ) { | |
| 1077 | + // ignore rule when param is explicitly false, eg. required:false | |
| 1078 | + if ( val === false ) { | |
| 1079 | + delete rules[ prop ]; | |
| 1080 | + return; | |
| 1081 | + } | |
| 1082 | + if ( val.param || val.depends ) { | |
| 1083 | + var keepRule = true; | |
| 1084 | + switch ( typeof val.depends ) { | |
| 1085 | + case "string": | |
| 1086 | + keepRule = !!$( val.depends, element.form ).length; | |
| 1087 | + break; | |
| 1088 | + case "function": | |
| 1089 | + keepRule = val.depends.call( element, element ); | |
| 1090 | + break; | |
| 1091 | + } | |
| 1092 | + if ( keepRule ) { | |
| 1093 | + rules[ prop ] = val.param !== undefined ? val.param : true; | |
| 1094 | + } else { | |
| 1095 | + delete rules[ prop ]; | |
| 1096 | + } | |
| 1097 | + } | |
| 1098 | + }); | |
| 1099 | + | |
| 1100 | + // evaluate parameters | |
| 1101 | + $.each( rules, function( rule, parameter ) { | |
| 1102 | + rules[ rule ] = $.isFunction( parameter ) ? parameter( element ) : parameter; | |
| 1103 | + }); | |
| 1104 | + | |
| 1105 | + // clean number parameters | |
| 1106 | + $.each([ "minlength", "maxlength" ], function() { | |
| 1107 | + if ( rules[ this ] ) { | |
| 1108 | + rules[ this ] = Number( rules[ this ] ); | |
| 1109 | + } | |
| 1110 | + }); | |
| 1111 | + $.each([ "rangelength", "range" ], function() { | |
| 1112 | + var parts; | |
| 1113 | + if ( rules[ this ] ) { | |
| 1114 | + if ( $.isArray( rules[ this ] ) ) { | |
| 1115 | + rules[ this ] = [ Number( rules[ this ][ 0 ]), Number( rules[ this ][ 1 ] ) ]; | |
| 1116 | + } else if ( typeof rules[ this ] === "string" ) { | |
| 1117 | + parts = rules[ this ].replace(/[\[\]]/g, "" ).split( /[\s,]+/ ); | |
| 1118 | + rules[ this ] = [ Number( parts[ 0 ]), Number( parts[ 1 ] ) ]; | |
| 1119 | + } | |
| 1120 | + } | |
| 1121 | + }); | |
| 1122 | + | |
| 1123 | + if ( $.validator.autoCreateRanges ) { | |
| 1124 | + // auto-create ranges | |
| 1125 | + if ( rules.min != null && rules.max != null ) { | |
| 1126 | + rules.range = [ rules.min, rules.max ]; | |
| 1127 | + delete rules.min; | |
| 1128 | + delete rules.max; | |
| 1129 | + } | |
| 1130 | + if ( rules.minlength != null && rules.maxlength != null ) { | |
| 1131 | + rules.rangelength = [ rules.minlength, rules.maxlength ]; | |
| 1132 | + delete rules.minlength; | |
| 1133 | + delete rules.maxlength; | |
| 1134 | + } | |
| 1135 | + } | |
| 1136 | + | |
| 1137 | + return rules; | |
| 1138 | + }, | |
| 1139 | + | |
| 1140 | + // Converts a simple string to a {string: true} rule, e.g., "required" to {required:true} | |
| 1141 | + normalizeRule: function( data ) { | |
| 1142 | + if ( typeof data === "string" ) { | |
| 1143 | + var transformed = {}; | |
| 1144 | + $.each( data.split( /\s/ ), function() { | |
| 1145 | + transformed[ this ] = true; | |
| 1146 | + }); | |
| 1147 | + data = transformed; | |
| 1148 | + } | |
| 1149 | + return data; | |
| 1150 | + }, | |
| 1151 | + | |
| 1152 | + // http://jqueryvalidation.org/jQuery.validator.addMethod/ | |
| 1153 | + addMethod: function( name, method, message ) { | |
| 1154 | + $.validator.methods[ name ] = method; | |
| 1155 | + $.validator.messages[ name ] = message !== undefined ? message : $.validator.messages[ name ]; | |
| 1156 | + if ( method.length < 3 ) { | |
| 1157 | + $.validator.addClassRules( name, $.validator.normalizeRule( name ) ); | |
| 1158 | + } | |
| 1159 | + }, | |
| 1160 | + | |
| 1161 | + methods: { | |
| 1162 | + | |
| 1163 | + // http://jqueryvalidation.org/required-method/ | |
| 1164 | + required: function( value, element, param ) { | |
| 1165 | + // check if dependency is met | |
| 1166 | + if ( !this.depend( param, element ) ) { | |
| 1167 | + return "dependency-mismatch"; | |
| 1168 | + } | |
| 1169 | + if ( element.nodeName.toLowerCase() === "select" ) { | |
| 1170 | + // could be an array for select-multiple or a string, both are fine this way | |
| 1171 | + var val = $( element ).val(); | |
| 1172 | + return val && val.length > 0; | |
| 1173 | + } | |
| 1174 | + if ( this.checkable( element ) ) { | |
| 1175 | + return this.getLength( value, element ) > 0; | |
| 1176 | + } | |
| 1177 | + return value.length > 0; | |
| 1178 | + }, | |
| 1179 | + | |
| 1180 | + // http://jqueryvalidation.org/email-method/ | |
| 1181 | + email: function( value, element ) { | |
| 1182 | + // From https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address | |
| 1183 | + // Retrieved 2014-01-14 | |
| 1184 | + // If you have a problem with this implementation, report a bug against the above spec | |
| 1185 | + // Or use custom methods to implement your own email validation | |
| 1186 | + return this.optional( element ) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test( value ); | |
| 1187 | + }, | |
| 1188 | + | |
| 1189 | + // http://jqueryvalidation.org/url-method/ | |
| 1190 | + url: function( value, element ) { | |
| 1191 | + | |
| 1192 | + // Copyright (c) 2010-2013 Diego Perini, MIT licensed | |
| 1193 | + // https://gist.github.com/dperini/729294 | |
| 1194 | + // see also https://mathiasbynens.be/demo/url-regex | |
| 1195 | + // modified to allow protocol-relative URLs | |
| 1196 | + return this.optional( element ) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test( value ); | |
| 1197 | + }, | |
| 1198 | + | |
| 1199 | + // http://jqueryvalidation.org/date-method/ | |
| 1200 | + date: function( value, element ) { | |
| 1201 | + return this.optional( element ) || !/Invalid|NaN/.test( new Date( value ).toString() ); | |
| 1202 | + }, | |
| 1203 | + | |
| 1204 | + // http://jqueryvalidation.org/dateISO-method/ | |
| 1205 | + dateISO: function( value, element ) { | |
| 1206 | + return this.optional( element ) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test( value ); | |
| 1207 | + }, | |
| 1208 | + | |
| 1209 | + // http://jqueryvalidation.org/number-method/ | |
| 1210 | + number: function( value, element ) { | |
| 1211 | + return this.optional( element ) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test( value ); | |
| 1212 | + }, | |
| 1213 | + | |
| 1214 | + // http://jqueryvalidation.org/digits-method/ | |
| 1215 | + digits: function( value, element ) { | |
| 1216 | + return this.optional( element ) || /^\d+$/.test( value ); | |
| 1217 | + }, | |
| 1218 | + | |
| 1219 | + // http://jqueryvalidation.org/creditcard-method/ | |
| 1220 | + // based on http://en.wikipedia.org/wiki/Luhn_algorithm | |
| 1221 | + creditcard: function( value, element ) { | |
| 1222 | + if ( this.optional( element ) ) { | |
| 1223 | + return "dependency-mismatch"; | |
| 1224 | + } | |
| 1225 | + // accept only spaces, digits and dashes | |
| 1226 | + if ( /[^0-9 \-]+/.test( value ) ) { | |
| 1227 | + return false; | |
| 1228 | + } | |
| 1229 | + var nCheck = 0, | |
| 1230 | + nDigit = 0, | |
| 1231 | + bEven = false, | |
| 1232 | + n, cDigit; | |
| 1233 | + | |
| 1234 | + value = value.replace( /\D/g, "" ); | |
| 1235 | + | |
| 1236 | + // Basing min and max length on | |
| 1237 | + // http://developer.ean.com/general_info/Valid_Credit_Card_Types | |
| 1238 | + if ( value.length < 13 || value.length > 19 ) { | |
| 1239 | + return false; | |
| 1240 | + } | |
| 1241 | + | |
| 1242 | + for ( n = value.length - 1; n >= 0; n--) { | |
| 1243 | + cDigit = value.charAt( n ); | |
| 1244 | + nDigit = parseInt( cDigit, 10 ); | |
| 1245 | + if ( bEven ) { | |
| 1246 | + if ( ( nDigit *= 2 ) > 9 ) { | |
| 1247 | + nDigit -= 9; | |
| 1248 | + } | |
| 1249 | + } | |
| 1250 | + nCheck += nDigit; | |
| 1251 | + bEven = !bEven; | |
| 1252 | + } | |
| 1253 | + | |
| 1254 | + return ( nCheck % 10 ) === 0; | |
| 1255 | + }, | |
| 1256 | + | |
| 1257 | + // http://jqueryvalidation.org/minlength-method/ | |
| 1258 | + minlength: function( value, element, param ) { | |
| 1259 | + var length = $.isArray( value ) ? value.length : this.getLength( value, element ); | |
| 1260 | + return this.optional( element ) || length >= param; | |
| 1261 | + }, | |
| 1262 | + | |
| 1263 | + // http://jqueryvalidation.org/maxlength-method/ | |
| 1264 | + maxlength: function( value, element, param ) { | |
| 1265 | + var length = $.isArray( value ) ? value.length : this.getLength( value, element ); | |
| 1266 | + return this.optional( element ) || length <= param; | |
| 1267 | + }, | |
| 1268 | + | |
| 1269 | + // http://jqueryvalidation.org/rangelength-method/ | |
| 1270 | + rangelength: function( value, element, param ) { | |
| 1271 | + var length = $.isArray( value ) ? value.length : this.getLength( value, element ); | |
| 1272 | + return this.optional( element ) || ( length >= param[ 0 ] && length <= param[ 1 ] ); | |
| 1273 | + }, | |
| 1274 | + | |
| 1275 | + // http://jqueryvalidation.org/min-method/ | |
| 1276 | + min: function( value, element, param ) { | |
| 1277 | + return this.optional( element ) || value >= param; | |
| 1278 | + }, | |
| 1279 | + | |
| 1280 | + // http://jqueryvalidation.org/max-method/ | |
| 1281 | + max: function( value, element, param ) { | |
| 1282 | + return this.optional( element ) || value <= param; | |
| 1283 | + }, | |
| 1284 | + | |
| 1285 | + // http://jqueryvalidation.org/range-method/ | |
| 1286 | + range: function( value, element, param ) { | |
| 1287 | + return this.optional( element ) || ( value >= param[ 0 ] && value <= param[ 1 ] ); | |
| 1288 | + }, | |
| 1289 | + | |
| 1290 | + // http://jqueryvalidation.org/equalTo-method/ | |
| 1291 | + equalTo: function( value, element, param ) { | |
| 1292 | + // bind to the blur event of the target in order to revalidate whenever the target field is updated | |
| 1293 | + // TODO find a way to bind the event just once, avoiding the unbind-rebind overhead | |
| 1294 | + var target = $( param ); | |
| 1295 | + if ( this.settings.onfocusout ) { | |
| 1296 | + target.off( ".validate-equalTo" ).on( "blur.validate-equalTo", function() { | |
| 1297 | + $( element ).valid(); | |
| 1298 | + }); | |
| 1299 | + } | |
| 1300 | + return value === target.val(); | |
| 1301 | + }, | |
| 1302 | + | |
| 1303 | + // http://jqueryvalidation.org/remote-method/ | |
| 1304 | + remote: function( value, element, param ) { | |
| 1305 | + if ( this.optional( element ) ) { | |
| 1306 | + return "dependency-mismatch"; | |
| 1307 | + } | |
| 1308 | + | |
| 1309 | + var previous = this.previousValue( element ), | |
| 1310 | + validator, data; | |
| 1311 | + | |
| 1312 | + if (!this.settings.messages[ element.name ] ) { | |
| 1313 | + this.settings.messages[ element.name ] = {}; | |
| 1314 | + } | |
| 1315 | + previous.originalMessage = this.settings.messages[ element.name ].remote; | |
| 1316 | + this.settings.messages[ element.name ].remote = previous.message; | |
| 1317 | + | |
| 1318 | + param = typeof param === "string" && { url: param } || param; | |
| 1319 | + | |
| 1320 | + if ( previous.old === value ) { | |
| 1321 | + return previous.valid; | |
| 1322 | + } | |
| 1323 | + | |
| 1324 | + previous.old = value; | |
| 1325 | + validator = this; | |
| 1326 | + this.startRequest( element ); | |
| 1327 | + data = {}; | |
| 1328 | + data[ element.name ] = value; | |
| 1329 | + $.ajax( $.extend( true, { | |
| 1330 | + mode: "abort", | |
| 1331 | + port: "validate" + element.name, | |
| 1332 | + dataType: "json", | |
| 1333 | + data: data, | |
| 1334 | + context: validator.currentForm, | |
| 1335 | + success: function( response ) { | |
| 1336 | + var valid = response === true || response === "true", | |
| 1337 | + errors, message, submitted; | |
| 1338 | + | |
| 1339 | + validator.settings.messages[ element.name ].remote = previous.originalMessage; | |
| 1340 | + if ( valid ) { | |
| 1341 | + submitted = validator.formSubmitted; | |
| 1342 | + validator.prepareElement( element ); | |
| 1343 | + validator.formSubmitted = submitted; | |
| 1344 | + validator.successList.push( element ); | |
| 1345 | + delete validator.invalid[ element.name ]; | |
| 1346 | + validator.showErrors(); | |
| 1347 | + } else { | |
| 1348 | + errors = {}; | |
| 1349 | + message = response || validator.defaultMessage( element, "remote" ); | |
| 1350 | + errors[ element.name ] = previous.message = $.isFunction( message ) ? message( value ) : message; | |
| 1351 | + validator.invalid[ element.name ] = true; | |
| 1352 | + validator.showErrors( errors ); | |
| 1353 | + } | |
| 1354 | + previous.valid = valid; | |
| 1355 | + validator.stopRequest( element, valid ); | |
| 1356 | + } | |
| 1357 | + }, param ) ); | |
| 1358 | + return "pending"; | |
| 1359 | + } | |
| 1360 | + } | |
| 1361 | + | |
| 1362 | +}); | |
| 1363 | + | |
| 1364 | +// ajax mode: abort | |
| 1365 | +// usage: $.ajax({ mode: "abort"[, port: "uniqueport"]}); | |
| 1366 | +// if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort() | |
| 1367 | + | |
| 1368 | +var pendingRequests = {}, | |
| 1369 | + ajax; | |
| 1370 | +// Use a prefilter if available (1.5+) | |
| 1371 | +if ( $.ajaxPrefilter ) { | |
| 1372 | + $.ajaxPrefilter(function( settings, _, xhr ) { | |
| 1373 | + var port = settings.port; | |
| 1374 | + if ( settings.mode === "abort" ) { | |
| 1375 | + if ( pendingRequests[port] ) { | |
| 1376 | + pendingRequests[port].abort(); | |
| 1377 | + } | |
| 1378 | + pendingRequests[port] = xhr; | |
| 1379 | + } | |
| 1380 | + }); | |
| 1381 | +} else { | |
| 1382 | + // Proxy ajax | |
| 1383 | + ajax = $.ajax; | |
| 1384 | + $.ajax = function( settings ) { | |
| 1385 | + var mode = ( "mode" in settings ? settings : $.ajaxSettings ).mode, | |
| 1386 | + port = ( "port" in settings ? settings : $.ajaxSettings ).port; | |
| 1387 | + if ( mode === "abort" ) { | |
| 1388 | + if ( pendingRequests[port] ) { | |
| 1389 | + pendingRequests[port].abort(); | |
| 1390 | + } | |
| 1391 | + pendingRequests[port] = ajax.apply(this, arguments); | |
| 1392 | + return pendingRequests[port]; | |
| 1393 | + } | |
| 1394 | + return ajax.apply(this, arguments); | |
| 1395 | + }; | |
| 1396 | +} | |
| 1397 | + | |
| 1398 | +})); | |
| 0 | 1399 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/jquery.validate.min.js
0 → 100644
| 1 | +/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 | |
| 2 | + * http://jqueryvalidation.org/ | |
| 3 | + * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ | |
| 4 | +!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.on("click.validate",":submit",function(b){c.settings.submitHandler&&(c.submitButton=b.target),a(this).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(this).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.on("submit.validate",function(b){function d(){var d,e;return c.settings.submitHandler?(c.submitButton&&(d=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),e=c.settings.submitHandler.call(c,c.currentForm,b),c.submitButton&&d.remove(),void 0!==e?e:!1):!0}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c,d;return a(this[0]).is("form")?b=this.validate().form():(d=[],b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element(this)&&b,d=d.concat(c.errorList)}),c.errorList=d),b},rules:function(b,c){var d,e,f,g,h,i,j=this[0];if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(b,c){i[c]=f[c],delete f[c],"required"===c&&a(j).removeAttr("aria-required")}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g),a(j).attr("aria-required","true")),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}),a.extend(a.expr[":"],{blank:function(b){return!a.trim(""+a(b).val())},filled:function(b){return!!a.trim(""+a(b).val())},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(a)))},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(b,c){var d=[16,17,18,20,35,36,37,38,39,40,45,144,225];9===c.which&&""===this.elementValue(b)||-1!==a.inArray(c.keyCode,d)||(b.name in this.submitted||b===this.lastElement)&&this.element(b)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date ( ISO ).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){var c=a.data(this.form,"validator"),d="on"+b.type.replace(/^validate/,""),e=c.settings;e[d]&&!a(this).is(e.ignore)&&e[d].call(c,this,b)}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c,d=this.groups={};a.each(this.settings.groups,function(b,c){"string"==typeof c&&(c=c.split(/\s/)),a.each(c,function(a,c){d[c]=b})}),c=this.settings.rules,a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).on("focusin.validate focusout.validate keyup.validate",":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], [type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox']",b).on("click.validate","select, option, [type='radio'], [type='checkbox']",b),this.settings.invalidHandler&&a(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler),a(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required","true")},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){var c=this.clean(b),d=this.validationTargetFor(c),e=!0;return this.lastElement=d,void 0===d?delete this.invalid[c.name]:(this.prepareElement(d),this.currentElements=a(d),e=this.check(d)!==!1,e?delete this.invalid[d.name]:this.invalid[d.name]=!0),a(b).attr("aria-invalid",!e),this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),e},showErrors:function(b){if(b){a.extend(this.errorMap,b),this.errorList=[];for(var c in b)this.errorList.push({message:b[c],element:this.findByName(c)[0]});this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors();var b,c=this.elements().removeData("previousValue").removeAttr("aria-invalid");if(this.settings.unhighlight)for(b=0;c[b];b++)this.settings.unhighlight.call(this,c[b],this.settings.errorClass,"");else c.removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b,c=0;for(b in a)c++;return c},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(a){a.not(this.containers).text(""),this.addWrapper(a).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){return!this.name&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in c||!b.objectLength(a(this).rules())?!1:(c[this.name]=!0,!0)})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.split(" ").join(".");return a(this.settings.errorElement+"."+b,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([]),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c,d=a(b),e=b.type;return"radio"===e||"checkbox"===e?this.findByName(b.name).filter(":checked").val():"number"===e&&"undefined"!=typeof b.validity?b.validity.badInput?!1:d.val():(c=d.val(),"string"==typeof c?c.replace(/\r/g,""):c)},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d,e,f=a(b).rules(),g=a.map(f,function(a,b){return b}).length,h=!1,i=this.elementValue(b);for(d in f){e={method:d,parameters:f[d]};try{if(c=a.validator.methods[d].call(this,i,b,e.parameters),"dependency-mismatch"===c&&1===g){h=!0;continue}if(h=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,e),!1}catch(j){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+b.id+", check the '"+e.method+"' method.",j),j instanceof TypeError&&(j.message+=". Exception occurred when checking element "+b.id+", check the '"+e.method+"' method."),j}}if(!h)return this.objectLength(f)&&this.successList.push(b),!0},customDataMessage:function(b,c){return a(b).data("msg"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase())||a(b).data("msg")},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a];return void 0},defaultMessage:function(b,c){return this.findDefined(this.customMessage(b.name,c),this.customDataMessage(b,c),!this.settings.ignoreTitle&&b.title||void 0,a.validator.messages[c],"<strong>Warning: No message defined for "+b.name+"</strong>")},formatAndAdd:function(b,c){var d=this.defaultMessage(b,c.method),e=/\$?\{(\d+)\}/g;"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),this.errorList.push({message:d,element:b,method:c.method}),this.errorMap[b.name]=d,this.submitted[b.name]=d},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)c=this.errorList[a],this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d,e,f,g=this.errorsFor(b),h=this.idOrName(b),i=a(b).attr("aria-describedby");g.length?(g.removeClass(this.settings.validClass).addClass(this.settings.errorClass),g.html(c)):(g=a("<"+this.settings.errorElement+">").attr("id",h+"-error").addClass(this.settings.errorClass).html(c||""),d=g,this.settings.wrapper&&(d=g.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(d):this.settings.errorPlacement?this.settings.errorPlacement(d,a(b)):d.insertAfter(b),g.is("label")?g.attr("for",h):0===g.parents("label[for='"+h+"']").length&&(f=g.attr("id").replace(/(:|\.|\[|\]|\$)/g,"\\$1"),i?i.match(new RegExp("\\b"+f+"\\b"))||(i+=" "+f):i=f,a(b).attr("aria-describedby",i),e=this.groups[b.name],e&&a.each(this.groups,function(b,c){c===e&&a("[name='"+b+"']",this.currentForm).attr("aria-describedby",g.attr("id"))}))),!c&&this.settings.success&&(g.text(""),"string"==typeof this.settings.success?g.addClass(this.settings.success):this.settings.success(g,b)),this.toShow=this.toShow.add(g)},errorsFor:function(b){var c=this.idOrName(b),d=a(b).attr("aria-describedby"),e="label[for='"+c+"'], label[for='"+c+"'] *";return d&&(e=e+", #"+d.replace(/\s+/g,", #")),this.errors().filter(e)},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(b){return this.checkable(b)&&(b=this.findByName(b.name)),a(b).not(this.settings.ignore)[0]},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+b+"']")},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):!0},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(a){this.pending[a.name]||(this.pendingRequest++,this.pending[a.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],c&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,"remote")})},destroy:function(){this.resetForm(),a(this.currentForm).off(".validate").removeData("validator")}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},normalizeAttributeRule:function(a,b,c,d){/min|max/.test(c)&&(null===b||/number|range|text/.test(b))&&(d=Number(d),isNaN(d)&&(d=void 0)),d||0===d?a[c]=d:b===c&&"range"!==b&&(a[c]=!0)},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),this.normalizeAttributeRule(e,g,c,d);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)d=f.data("rule"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()),this.normalizeAttributeRule(e,g,c,d);return e},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0!==e.param?e.param:!0:delete b[d]}}),a.each(b,function(d,e){b[d]=a.isFunction(e)?e(c):e}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var c;b[this]&&(a.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(c=b[this].replace(/[\[\]]/g,"").split(/[\s,]+/),b[this]=[Number(c[0]),Number(c[1])]))}),a.validator.autoCreateRanges&&(null!=b.min&&null!=b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),null!=b.minlength&&null!=b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:b.length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(a)},date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a).toString())},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a)},number:function(a,b){return this.optional(b)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},creditcard:function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9 \-]+/.test(a))return!1;var c,d,e=0,f=0,g=!1;if(a=a.replace(/\D/g,""),a.length<13||a.length>19)return!1;for(c=a.length-1;c>=0;c--)d=a.charAt(c),f=parseInt(d,10),g&&(f*=2)>9&&(f-=9),e+=f,g=!g;return e%10===0},minlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d},maxlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||d>=e},rangelength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||c>=a},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.off(".validate-equalTo").on("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d){if(this.optional(c))return"dependency-mismatch";var e,f,g=this.previousValue(c);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),g.originalMessage=this.settings.messages[c.name].remote,this.settings.messages[c.name].remote=g.message,d="string"==typeof d&&{url:d}||d,g.old===b?g.valid:(g.old=b,e=this,this.startRequest(c),f={},f[c.name]=b,a.ajax(a.extend(!0,{mode:"abort",port:"validate"+c.name,dataType:"json",data:f,context:e.currentForm,success:function(d){var f,h,i,j=d===!0||"true"===d;e.settings.messages[c.name].remote=g.originalMessage,j?(i=e.formSubmitted,e.prepareElement(c),e.formSubmitted=i,e.successList.push(c),delete e.invalid[c.name],e.showErrors()):(f={},h=d||e.defaultMessage(c,"remote"),f[c.name]=g.message=a.isFunction(h)?h(b):h,e.invalid[c.name]=!0,e.showErrors(f)),g.valid=j,e.stopRequest(c,j)}},d)),"pending")}}});var b,c={};a.ajaxPrefilter?a.ajaxPrefilter(function(a,b,d){var e=a.port;"abort"===a.mode&&(c[e]&&c[e].abort(),c[e]=d)}):(b=a.ajax,a.ajax=function(d){var e=("mode"in d?d:a.ajaxSettings).mode,f=("port"in d?d:a.ajaxSettings).port;return"abort"===e?(c[f]&&c[f].abort(),c[f]=b.apply(this,arguments),c[f]):b.apply(this,arguments)})}); | |
| 0 | 5 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_ar.js
0 → 100644
| 1 | +(function( factory ) { | |
| 2 | + if ( typeof define === "function" && define.amd ) { | |
| 3 | + define( ["jquery", "../jquery.validate"], factory ); | |
| 4 | + } else { | |
| 5 | + factory( jQuery ); | |
| 6 | + } | |
| 7 | +}(function( $ ) { | |
| 8 | + | |
| 9 | +/* | |
| 10 | + * Translated default messages for the jQuery validation plugin. | |
| 11 | + * Locale: AR (Arabic; العربية) | |
| 12 | + */ | |
| 13 | +$.extend($.validator.messages, { | |
| 14 | + required: "هذا الحقل إلزامي", | |
| 15 | + remote: "يرجى تصحيح هذا الحقل للمتابعة", | |
| 16 | + email: "رجاء إدخال عنوان بريد إلكتروني صحيح", | |
| 17 | + url: "رجاء إدخال عنوان موقع إلكتروني صحيح", | |
| 18 | + date: "رجاء إدخال تاريخ صحيح", | |
| 19 | + dateISO: "رجاء إدخال تاريخ صحيح (ISO)", | |
| 20 | + number: "رجاء إدخال عدد بطريقة صحيحة", | |
| 21 | + digits: "رجاء إدخال أرقام فقط", | |
| 22 | + creditcard: "رجاء إدخال رقم بطاقة ائتمان صحيح", | |
| 23 | + equalTo: "رجاء إدخال نفس القيمة", | |
| 24 | + extension: "رجاء إدخال ملف بامتداد موافق عليه", | |
| 25 | + maxlength: $.validator.format("الحد الأقصى لعدد الحروف هو {0}"), | |
| 26 | + minlength: $.validator.format("الحد الأدنى لعدد الحروف هو {0}"), | |
| 27 | + rangelength: $.validator.format("عدد الحروف يجب أن يكون بين {0} و {1}"), | |
| 28 | + range: $.validator.format("رجاء إدخال عدد قيمته بين {0} و {1}"), | |
| 29 | + max: $.validator.format("رجاء إدخال عدد أقل من أو يساوي (0}"), | |
| 30 | + min: $.validator.format("رجاء إدخال عدد أكبر من أو يساوي (0}") | |
| 31 | +}); | |
| 32 | + | |
| 33 | +})); | |
| 0 | 34 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_ar.min.js
0 → 100644
| 1 | +/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 | |
| 2 | + * http://jqueryvalidation.org/ | |
| 3 | + * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ | |
| 4 | +!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"هذا الحقل إلزامي",remote:"يرجى تصحيح هذا الحقل للمتابعة",email:"رجاء إدخال عنوان بريد إلكتروني صحيح",url:"رجاء إدخال عنوان موقع إلكتروني صحيح",date:"رجاء إدخال تاريخ صحيح",dateISO:"رجاء إدخال تاريخ صحيح (ISO)",number:"رجاء إدخال عدد بطريقة صحيحة",digits:"رجاء إدخال أرقام فقط",creditcard:"رجاء إدخال رقم بطاقة ائتمان صحيح",equalTo:"رجاء إدخال نفس القيمة",extension:"رجاء إدخال ملف بامتداد موافق عليه",maxlength:a.validator.format("الحد الأقصى لعدد الحروف هو {0}"),minlength:a.validator.format("الحد الأدنى لعدد الحروف هو {0}"),rangelength:a.validator.format("عدد الحروف يجب أن يكون بين {0} و {1}"),range:a.validator.format("رجاء إدخال عدد قيمته بين {0} و {1}"),max:a.validator.format("رجاء إدخال عدد أقل من أو يساوي (0}"),min:a.validator.format("رجاء إدخال عدد أكبر من أو يساوي (0}")})}); | |
| 0 | 5 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_bg.js
0 → 100644
| 1 | +(function( factory ) { | |
| 2 | + if ( typeof define === "function" && define.amd ) { | |
| 3 | + define( ["jquery", "../jquery.validate"], factory ); | |
| 4 | + } else { | |
| 5 | + factory( jQuery ); | |
| 6 | + } | |
| 7 | +}(function( $ ) { | |
| 8 | + | |
| 9 | +/* | |
| 10 | + * Translated default messages for the jQuery validation plugin. | |
| 11 | + * Locale: BG (Bulgarian; български език) | |
| 12 | + */ | |
| 13 | +$.extend($.validator.messages, { | |
| 14 | + required: "Полето е задължително.", | |
| 15 | + remote: "Моля, въведете правилната стойност.", | |
| 16 | + email: "Моля, въведете валиден email.", | |
| 17 | + url: "Моля, въведете валидно URL.", | |
| 18 | + date: "Моля, въведете валидна дата.", | |
| 19 | + dateISO: "Моля, въведете валидна дата (ISO).", | |
| 20 | + number: "Моля, въведете валиден номер.", | |
| 21 | + digits: "Моля, въведете само цифри.", | |
| 22 | + creditcard: "Моля, въведете валиден номер на кредитна карта.", | |
| 23 | + equalTo: "Моля, въведете същата стойност отново.", | |
| 24 | + extension: "Моля, въведете стойност с валидно разширение.", | |
| 25 | + maxlength: $.validator.format("Моля, въведете повече от {0} символа."), | |
| 26 | + minlength: $.validator.format("Моля, въведете поне {0} символа."), | |
| 27 | + rangelength: $.validator.format("Моля, въведете стойност с дължина между {0} и {1} символа."), | |
| 28 | + range: $.validator.format("Моля, въведете стойност между {0} и {1}."), | |
| 29 | + max: $.validator.format("Моля, въведете стойност по-малка или равна на {0}."), | |
| 30 | + min: $.validator.format("Моля, въведете стойност по-голяма или равна на {0}.") | |
| 31 | +}); | |
| 32 | + | |
| 33 | +})); | |
| 0 | 34 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_bg.min.js
0 → 100644
| 1 | +/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 | |
| 2 | + * http://jqueryvalidation.org/ | |
| 3 | + * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ | |
| 4 | +!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Полето е задължително.",remote:"Моля, въведете правилната стойност.",email:"Моля, въведете валиден email.",url:"Моля, въведете валидно URL.",date:"Моля, въведете валидна дата.",dateISO:"Моля, въведете валидна дата (ISO).",number:"Моля, въведете валиден номер.",digits:"Моля, въведете само цифри.",creditcard:"Моля, въведете валиден номер на кредитна карта.",equalTo:"Моля, въведете същата стойност отново.",extension:"Моля, въведете стойност с валидно разширение.",maxlength:a.validator.format("Моля, въведете повече от {0} символа."),minlength:a.validator.format("Моля, въведете поне {0} символа."),rangelength:a.validator.format("Моля, въведете стойност с дължина между {0} и {1} символа."),range:a.validator.format("Моля, въведете стойност между {0} и {1}."),max:a.validator.format("Моля, въведете стойност по-малка или равна на {0}."),min:a.validator.format("Моля, въведете стойност по-голяма или равна на {0}.")})}); | |
| 0 | 5 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_bn_BD.js
0 → 100644
| 1 | +(function( factory ) { | |
| 2 | + if ( typeof define === "function" && define.amd ) { | |
| 3 | + define( ["jquery", "../jquery.validate"], factory ); | |
| 4 | + } else { | |
| 5 | + factory( jQuery ); | |
| 6 | + } | |
| 7 | +}(function( $ ) { | |
| 8 | + | |
| 9 | +/* | |
| 10 | + * Translated default messages for the jQuery validation plugin. | |
| 11 | + * Locale: bn_BD (Bengali, Bangladesh) | |
| 12 | + */ | |
| 13 | +$.extend($.validator.messages, { | |
| 14 | + required: "এই তথ্যটি আবশ্যক।", | |
| 15 | + remote: "এই তথ্যটি ঠিক করুন।", | |
| 16 | + email: "অনুগ্রহ করে একটি সঠিক মেইল ঠিকানা লিখুন।", | |
| 17 | + url: "অনুগ্রহ করে একটি সঠিক লিঙ্ক দিন।", | |
| 18 | + date: "তারিখ সঠিক নয়।", | |
| 19 | + dateISO: "অনুগ্রহ করে একটি সঠিক (ISO) তারিখ লিখুন।", | |
| 20 | + number: "অনুগ্রহ করে একটি সঠিক নম্বর লিখুন।", | |
| 21 | + digits: "এখানে শুধু সংখ্যা ব্যবহার করা যাবে।", | |
| 22 | + creditcard: "অনুগ্রহ করে একটি ক্রেডিট কার্ডের সঠিক নম্বর লিখুন।", | |
| 23 | + equalTo: "একই মান আবার লিখুন।", | |
| 24 | + extension: "সঠিক ধরনের ফাইল আপলোড করুন।", | |
| 25 | + maxlength: $.validator.format("{0}টির বেশি অক্ষর লেখা যাবে না।"), | |
| 26 | + minlength: $.validator.format("{0}টির কম অক্ষর লেখা যাবে না।"), | |
| 27 | + rangelength: $.validator.format("{0} থেকে {1} টি অক্ষর সম্বলিত মান লিখুন।"), | |
| 28 | + range: $.validator.format("{0} থেকে {1} এর মধ্যে একটি মান ব্যবহার করুন।"), | |
| 29 | + max: $.validator.format("অনুগ্রহ করে {0} বা তার চাইতে কম মান ব্যবহার করুন।"), | |
| 30 | + min: $.validator.format("অনুগ্রহ করে {0} বা তার চাইতে বেশি মান ব্যবহার করুন।") | |
| 31 | +}); | |
| 32 | + | |
| 33 | +})); | |
| 0 | 34 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_bn_BD.min.js
0 → 100644
| 1 | +/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 | |
| 2 | + * http://jqueryvalidation.org/ | |
| 3 | + * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ | |
| 4 | +!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"এই তথ্যটি আবশ্যক।",remote:"এই তথ্যটি ঠিক করুন।",email:"অনুগ্রহ করে একটি সঠিক মেইল ঠিকানা লিখুন।",url:"অনুগ্রহ করে একটি সঠিক লিঙ্ক দিন।",date:"তারিখ সঠিক নয়।",dateISO:"অনুগ্রহ করে একটি সঠিক (ISO) তারিখ লিখুন।",number:"অনুগ্রহ করে একটি সঠিক নম্বর লিখুন।",digits:"এখানে শুধু সংখ্যা ব্যবহার করা যাবে।",creditcard:"অনুগ্রহ করে একটি ক্রেডিট কার্ডের সঠিক নম্বর লিখুন।",equalTo:"একই মান আবার লিখুন।",extension:"সঠিক ধরনের ফাইল আপলোড করুন।",maxlength:a.validator.format("{0}টির বেশি অক্ষর লেখা যাবে না।"),minlength:a.validator.format("{0}টির কম অক্ষর লেখা যাবে না।"),rangelength:a.validator.format("{0} থেকে {1} টি অক্ষর সম্বলিত মান লিখুন।"),range:a.validator.format("{0} থেকে {1} এর মধ্যে একটি মান ব্যবহার করুন।"),max:a.validator.format("অনুগ্রহ করে {0} বা তার চাইতে কম মান ব্যবহার করুন।"),min:a.validator.format("অনুগ্রহ করে {0} বা তার চাইতে বেশি মান ব্যবহার করুন।")})}); | |
| 0 | 5 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_ca.js
0 → 100644
| 1 | +(function( factory ) { | |
| 2 | + if ( typeof define === "function" && define.amd ) { | |
| 3 | + define( ["jquery", "../jquery.validate"], factory ); | |
| 4 | + } else { | |
| 5 | + factory( jQuery ); | |
| 6 | + } | |
| 7 | +}(function( $ ) { | |
| 8 | + | |
| 9 | +/* | |
| 10 | + * Translated default messages for the jQuery validation plugin. | |
| 11 | + * Locale: CA (Catalan; català) | |
| 12 | + */ | |
| 13 | +$.extend($.validator.messages, { | |
| 14 | + required: "Aquest camp és obligatori.", | |
| 15 | + remote: "Si us plau, omple aquest camp.", | |
| 16 | + email: "Si us plau, escriu una adreça de correu-e vàlida", | |
| 17 | + url: "Si us plau, escriu una URL vàlida.", | |
| 18 | + date: "Si us plau, escriu una data vàlida.", | |
| 19 | + dateISO: "Si us plau, escriu una data (ISO) vàlida.", | |
| 20 | + number: "Si us plau, escriu un número enter vàlid.", | |
| 21 | + digits: "Si us plau, escriu només dígits.", | |
| 22 | + creditcard: "Si us plau, escriu un número de tarjeta vàlid.", | |
| 23 | + equalTo: "Si us plau, escriu el mateix valor de nou.", | |
| 24 | + extension: "Si us plau, escriu un valor amb una extensió acceptada.", | |
| 25 | + maxlength: $.validator.format("Si us plau, no escriguis més de {0} caracters."), | |
| 26 | + minlength: $.validator.format("Si us plau, no escriguis menys de {0} caracters."), | |
| 27 | + rangelength: $.validator.format("Si us plau, escriu un valor entre {0} i {1} caracters."), | |
| 28 | + range: $.validator.format("Si us plau, escriu un valor entre {0} i {1}."), | |
| 29 | + max: $.validator.format("Si us plau, escriu un valor menor o igual a {0}."), | |
| 30 | + min: $.validator.format("Si us plau, escriu un valor major o igual a {0}.") | |
| 31 | +}); | |
| 32 | + | |
| 33 | +})); | |
| 0 | 34 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_ca.min.js
0 → 100644
| 1 | +/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 | |
| 2 | + * http://jqueryvalidation.org/ | |
| 3 | + * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ | |
| 4 | +!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Aquest camp és obligatori.",remote:"Si us plau, omple aquest camp.",email:"Si us plau, escriu una adreça de correu-e vàlida",url:"Si us plau, escriu una URL vàlida.",date:"Si us plau, escriu una data vàlida.",dateISO:"Si us plau, escriu una data (ISO) vàlida.",number:"Si us plau, escriu un número enter vàlid.",digits:"Si us plau, escriu només dígits.",creditcard:"Si us plau, escriu un número de tarjeta vàlid.",equalTo:"Si us plau, escriu el mateix valor de nou.",extension:"Si us plau, escriu un valor amb una extensió acceptada.",maxlength:a.validator.format("Si us plau, no escriguis més de {0} caracters."),minlength:a.validator.format("Si us plau, no escriguis menys de {0} caracters."),rangelength:a.validator.format("Si us plau, escriu un valor entre {0} i {1} caracters."),range:a.validator.format("Si us plau, escriu un valor entre {0} i {1}."),max:a.validator.format("Si us plau, escriu un valor menor o igual a {0}."),min:a.validator.format("Si us plau, escriu un valor major o igual a {0}.")})}); | |
| 0 | 5 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_cs.js
0 → 100644
| 1 | +(function( factory ) { | |
| 2 | + if ( typeof define === "function" && define.amd ) { | |
| 3 | + define( ["jquery", "../jquery.validate"], factory ); | |
| 4 | + } else { | |
| 5 | + factory( jQuery ); | |
| 6 | + } | |
| 7 | +}(function( $ ) { | |
| 8 | + | |
| 9 | +/* | |
| 10 | + * Translated default messages for the jQuery validation plugin. | |
| 11 | + * Locale: CS (Czech; čeština, český jazyk) | |
| 12 | + */ | |
| 13 | +$.extend($.validator.messages, { | |
| 14 | + required: "Tento údaj je povinný.", | |
| 15 | + remote: "Prosím, opravte tento údaj.", | |
| 16 | + email: "Prosím, zadejte platný e-mail.", | |
| 17 | + url: "Prosím, zadejte platné URL.", | |
| 18 | + date: "Prosím, zadejte platné datum.", | |
| 19 | + dateISO: "Prosím, zadejte platné datum (ISO).", | |
| 20 | + number: "Prosím, zadejte číslo.", | |
| 21 | + digits: "Prosím, zadávejte pouze číslice.", | |
| 22 | + creditcard: "Prosím, zadejte číslo kreditní karty.", | |
| 23 | + equalTo: "Prosím, zadejte znovu stejnou hodnotu.", | |
| 24 | + extension: "Prosím, zadejte soubor se správnou příponou.", | |
| 25 | + maxlength: $.validator.format("Prosím, zadejte nejvíce {0} znaků."), | |
| 26 | + minlength: $.validator.format("Prosím, zadejte nejméně {0} znaků."), | |
| 27 | + rangelength: $.validator.format("Prosím, zadejte od {0} do {1} znaků."), | |
| 28 | + range: $.validator.format("Prosím, zadejte hodnotu od {0} do {1}."), | |
| 29 | + max: $.validator.format("Prosím, zadejte hodnotu menší nebo rovnu {0}."), | |
| 30 | + min: $.validator.format("Prosím, zadejte hodnotu větší nebo rovnu {0}.") | |
| 31 | +}); | |
| 32 | + | |
| 33 | +})); | |
| 0 | 34 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_cs.min.js
0 → 100644
| 1 | +/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 | |
| 2 | + * http://jqueryvalidation.org/ | |
| 3 | + * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ | |
| 4 | +!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Tento údaj je povinný.",remote:"Prosím, opravte tento údaj.",email:"Prosím, zadejte platný e-mail.",url:"Prosím, zadejte platné URL.",date:"Prosím, zadejte platné datum.",dateISO:"Prosím, zadejte platné datum (ISO).",number:"Prosím, zadejte číslo.",digits:"Prosím, zadávejte pouze číslice.",creditcard:"Prosím, zadejte číslo kreditní karty.",equalTo:"Prosím, zadejte znovu stejnou hodnotu.",extension:"Prosím, zadejte soubor se správnou příponou.",maxlength:a.validator.format("Prosím, zadejte nejvíce {0} znaků."),minlength:a.validator.format("Prosím, zadejte nejméně {0} znaků."),rangelength:a.validator.format("Prosím, zadejte od {0} do {1} znaků."),range:a.validator.format("Prosím, zadejte hodnotu od {0} do {1}."),max:a.validator.format("Prosím, zadejte hodnotu menší nebo rovnu {0}."),min:a.validator.format("Prosím, zadejte hodnotu větší nebo rovnu {0}.")})}); | |
| 0 | 5 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_da.js
0 → 100644
| 1 | +(function( factory ) { | |
| 2 | + if ( typeof define === "function" && define.amd ) { | |
| 3 | + define( ["jquery", "../jquery.validate"], factory ); | |
| 4 | + } else { | |
| 5 | + factory( jQuery ); | |
| 6 | + } | |
| 7 | +}(function( $ ) { | |
| 8 | + | |
| 9 | +/* | |
| 10 | + * Translated default messages for the jQuery validation plugin. | |
| 11 | + * Locale: DA (Danish; dansk) | |
| 12 | + */ | |
| 13 | +$.extend($.validator.messages, { | |
| 14 | + required: "Dette felt er påkrævet.", | |
| 15 | + maxlength: $.validator.format("Indtast højst {0} tegn."), | |
| 16 | + minlength: $.validator.format("Indtast mindst {0} tegn."), | |
| 17 | + rangelength: $.validator.format("Indtast mindst {0} og højst {1} tegn."), | |
| 18 | + email: "Indtast en gyldig email-adresse.", | |
| 19 | + url: "Indtast en gyldig URL.", | |
| 20 | + date: "Indtast en gyldig dato.", | |
| 21 | + number: "Indtast et tal.", | |
| 22 | + digits: "Indtast kun cifre.", | |
| 23 | + equalTo: "Indtast den samme værdi igen.", | |
| 24 | + range: $.validator.format("Angiv en værdi mellem {0} og {1}."), | |
| 25 | + max: $.validator.format("Angiv en værdi der højst er {0}."), | |
| 26 | + min: $.validator.format("Angiv en værdi der mindst er {0}."), | |
| 27 | + creditcard: "Indtast et gyldigt kreditkortnummer." | |
| 28 | +}); | |
| 29 | + | |
| 30 | +})); | |
| 0 | 31 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_da.min.js
0 → 100644
| 1 | +/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 | |
| 2 | + * http://jqueryvalidation.org/ | |
| 3 | + * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ | |
| 4 | +!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Dette felt er påkrævet.",maxlength:a.validator.format("Indtast højst {0} tegn."),minlength:a.validator.format("Indtast mindst {0} tegn."),rangelength:a.validator.format("Indtast mindst {0} og højst {1} tegn."),email:"Indtast en gyldig email-adresse.",url:"Indtast en gyldig URL.",date:"Indtast en gyldig dato.",number:"Indtast et tal.",digits:"Indtast kun cifre.",equalTo:"Indtast den samme værdi igen.",range:a.validator.format("Angiv en værdi mellem {0} og {1}."),max:a.validator.format("Angiv en værdi der højst er {0}."),min:a.validator.format("Angiv en værdi der mindst er {0}."),creditcard:"Indtast et gyldigt kreditkortnummer."})}); | |
| 0 | 5 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_de.js
0 → 100644
| 1 | +(function( factory ) { | |
| 2 | + if ( typeof define === "function" && define.amd ) { | |
| 3 | + define( ["jquery", "../jquery.validate"], factory ); | |
| 4 | + } else { | |
| 5 | + factory( jQuery ); | |
| 6 | + } | |
| 7 | +}(function( $ ) { | |
| 8 | + | |
| 9 | +/* | |
| 10 | + * Translated default messages for the jQuery validation plugin. | |
| 11 | + * Locale: DE (German, Deutsch) | |
| 12 | + */ | |
| 13 | +$.extend($.validator.messages, { | |
| 14 | + required: "Dieses Feld ist ein Pflichtfeld.", | |
| 15 | + maxlength: $.validator.format("Geben Sie bitte maximal {0} Zeichen ein."), | |
| 16 | + minlength: $.validator.format("Geben Sie bitte mindestens {0} Zeichen ein."), | |
| 17 | + rangelength: $.validator.format("Geben Sie bitte mindestens {0} und maximal {1} Zeichen ein."), | |
| 18 | + email: "Geben Sie bitte eine gültige E-Mail Adresse ein.", | |
| 19 | + url: "Geben Sie bitte eine gültige URL ein.", | |
| 20 | + date: "Bitte geben Sie ein gültiges Datum ein.", | |
| 21 | + number: "Geben Sie bitte eine Nummer ein.", | |
| 22 | + digits: "Geben Sie bitte nur Ziffern ein.", | |
| 23 | + equalTo: "Bitte denselben Wert wiederholen.", | |
| 24 | + range: $.validator.format("Geben Sie bitte einen Wert zwischen {0} und {1} ein."), | |
| 25 | + max: $.validator.format("Geben Sie bitte einen Wert kleiner oder gleich {0} ein."), | |
| 26 | + min: $.validator.format("Geben Sie bitte einen Wert größer oder gleich {0} ein."), | |
| 27 | + creditcard: "Geben Sie bitte eine gültige Kreditkarten-Nummer ein." | |
| 28 | +}); | |
| 29 | + | |
| 30 | +})); | |
| 0 | 31 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_de.min.js
0 → 100644
| 1 | +/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 | |
| 2 | + * http://jqueryvalidation.org/ | |
| 3 | + * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ | |
| 4 | +!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Dieses Feld ist ein Pflichtfeld.",maxlength:a.validator.format("Geben Sie bitte maximal {0} Zeichen ein."),minlength:a.validator.format("Geben Sie bitte mindestens {0} Zeichen ein."),rangelength:a.validator.format("Geben Sie bitte mindestens {0} und maximal {1} Zeichen ein."),email:"Geben Sie bitte eine gültige E-Mail Adresse ein.",url:"Geben Sie bitte eine gültige URL ein.",date:"Bitte geben Sie ein gültiges Datum ein.",number:"Geben Sie bitte eine Nummer ein.",digits:"Geben Sie bitte nur Ziffern ein.",equalTo:"Bitte denselben Wert wiederholen.",range:a.validator.format("Geben Sie bitte einen Wert zwischen {0} und {1} ein."),max:a.validator.format("Geben Sie bitte einen Wert kleiner oder gleich {0} ein."),min:a.validator.format("Geben Sie bitte einen Wert größer oder gleich {0} ein."),creditcard:"Geben Sie bitte eine gültige Kreditkarten-Nummer ein."})}); | |
| 0 | 5 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_el.js
0 → 100644
| 1 | +(function( factory ) { | |
| 2 | + if ( typeof define === "function" && define.amd ) { | |
| 3 | + define( ["jquery", "../jquery.validate"], factory ); | |
| 4 | + } else { | |
| 5 | + factory( jQuery ); | |
| 6 | + } | |
| 7 | +}(function( $ ) { | |
| 8 | + | |
| 9 | +/* | |
| 10 | + * Translated default messages for the jQuery validation plugin. | |
| 11 | + * Locale: EL (Greek; ελληνικά) | |
| 12 | + */ | |
| 13 | +$.extend($.validator.messages, { | |
| 14 | + required: "Αυτό το πεδίο είναι υποχρεωτικό.", | |
| 15 | + remote: "Παρακαλώ διορθώστε αυτό το πεδίο.", | |
| 16 | + email: "Παρακαλώ εισάγετε μια έγκυρη διεύθυνση email.", | |
| 17 | + url: "Παρακαλώ εισάγετε ένα έγκυρο URL.", | |
| 18 | + date: "Παρακαλώ εισάγετε μια έγκυρη ημερομηνία.", | |
| 19 | + dateISO: "Παρακαλώ εισάγετε μια έγκυρη ημερομηνία (ISO).", | |
| 20 | + number: "Παρακαλώ εισάγετε έναν έγκυρο αριθμό.", | |
| 21 | + digits: "Παρακαλώ εισάγετε μόνο αριθμητικά ψηφία.", | |
| 22 | + creditcard: "Παρακαλώ εισάγετε έναν έγκυρο αριθμό πιστωτικής κάρτας.", | |
| 23 | + equalTo: "Παρακαλώ εισάγετε την ίδια τιμή ξανά.", | |
| 24 | + extension: "Παρακαλώ εισάγετε μια τιμή με έγκυρη επέκταση αρχείου.", | |
| 25 | + maxlength: $.validator.format("Παρακαλώ εισάγετε μέχρι και {0} χαρακτήρες."), | |
| 26 | + minlength: $.validator.format("Παρακαλώ εισάγετε τουλάχιστον {0} χαρακτήρες."), | |
| 27 | + rangelength: $.validator.format("Παρακαλώ εισάγετε μια τιμή με μήκος μεταξύ {0} και {1} χαρακτήρων."), | |
| 28 | + range: $.validator.format("Παρακαλώ εισάγετε μια τιμή μεταξύ {0} και {1}."), | |
| 29 | + max: $.validator.format("Παρακαλώ εισάγετε μια τιμή μικρότερη ή ίση του {0}."), | |
| 30 | + min: $.validator.format("Παρακαλώ εισάγετε μια τιμή μεγαλύτερη ή ίση του {0}.") | |
| 31 | +}); | |
| 32 | + | |
| 33 | +})); | |
| 0 | 34 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_el.min.js
0 → 100644
| 1 | +/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 | |
| 2 | + * http://jqueryvalidation.org/ | |
| 3 | + * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ | |
| 4 | +!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Αυτό το πεδίο είναι υποχρεωτικό.",remote:"Παρακαλώ διορθώστε αυτό το πεδίο.",email:"Παρακαλώ εισάγετε μια έγκυρη διεύθυνση email.",url:"Παρακαλώ εισάγετε ένα έγκυρο URL.",date:"Παρακαλώ εισάγετε μια έγκυρη ημερομηνία.",dateISO:"Παρακαλώ εισάγετε μια έγκυρη ημερομηνία (ISO).",number:"Παρακαλώ εισάγετε έναν έγκυρο αριθμό.",digits:"Παρακαλώ εισάγετε μόνο αριθμητικά ψηφία.",creditcard:"Παρακαλώ εισάγετε έναν έγκυρο αριθμό πιστωτικής κάρτας.",equalTo:"Παρακαλώ εισάγετε την ίδια τιμή ξανά.",extension:"Παρακαλώ εισάγετε μια τιμή με έγκυρη επέκταση αρχείου.",maxlength:a.validator.format("Παρακαλώ εισάγετε μέχρι και {0} χαρακτήρες."),minlength:a.validator.format("Παρακαλώ εισάγετε τουλάχιστον {0} χαρακτήρες."),rangelength:a.validator.format("Παρακαλώ εισάγετε μια τιμή με μήκος μεταξύ {0} και {1} χαρακτήρων."),range:a.validator.format("Παρακαλώ εισάγετε μια τιμή μεταξύ {0} και {1}."),max:a.validator.format("Παρακαλώ εισάγετε μια τιμή μικρότερη ή ίση του {0}."),min:a.validator.format("Παρακαλώ εισάγετε μια τιμή μεγαλύτερη ή ίση του {0}.")})}); | |
| 0 | 5 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_es.js
0 → 100644
| 1 | +(function( factory ) { | |
| 2 | + if ( typeof define === "function" && define.amd ) { | |
| 3 | + define( ["jquery", "../jquery.validate"], factory ); | |
| 4 | + } else { | |
| 5 | + factory( jQuery ); | |
| 6 | + } | |
| 7 | +}(function( $ ) { | |
| 8 | + | |
| 9 | +/* | |
| 10 | + * Translated default messages for the jQuery validation plugin. | |
| 11 | + * Locale: ES (Spanish; Español) | |
| 12 | + */ | |
| 13 | +$.extend($.validator.messages, { | |
| 14 | + required: "Este campo es obligatorio.", | |
| 15 | + remote: "Por favor, rellena este campo.", | |
| 16 | + email: "Por favor, escribe una dirección de correo válida.", | |
| 17 | + url: "Por favor, escribe una URL válida.", | |
| 18 | + date: "Por favor, escribe una fecha válida.", | |
| 19 | + dateISO: "Por favor, escribe una fecha (ISO) válida.", | |
| 20 | + number: "Por favor, escribe un número válido.", | |
| 21 | + digits: "Por favor, escribe sólo dígitos.", | |
| 22 | + creditcard: "Por favor, escribe un número de tarjeta válido.", | |
| 23 | + equalTo: "Por favor, escribe el mismo valor de nuevo.", | |
| 24 | + extension: "Por favor, escribe un valor con una extensión aceptada.", | |
| 25 | + maxlength: $.validator.format("Por favor, no escribas más de {0} caracteres."), | |
| 26 | + minlength: $.validator.format("Por favor, no escribas menos de {0} caracteres."), | |
| 27 | + rangelength: $.validator.format("Por favor, escribe un valor entre {0} y {1} caracteres."), | |
| 28 | + range: $.validator.format("Por favor, escribe un valor entre {0} y {1}."), | |
| 29 | + max: $.validator.format("Por favor, escribe un valor menor o igual a {0}."), | |
| 30 | + min: $.validator.format("Por favor, escribe un valor mayor o igual a {0}."), | |
| 31 | + nifES: "Por favor, escribe un NIF válido.", | |
| 32 | + nieES: "Por favor, escribe un NIE válido.", | |
| 33 | + cifES: "Por favor, escribe un CIF válido." | |
| 34 | +}); | |
| 35 | + | |
| 36 | +})); | |
| 0 | 37 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_es.min.js
0 → 100644
| 1 | +/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 | |
| 2 | + * http://jqueryvalidation.org/ | |
| 3 | + * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ | |
| 4 | +!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Este campo es obligatorio.",remote:"Por favor, rellena este campo.",email:"Por favor, escribe una dirección de correo válida.",url:"Por favor, escribe una URL válida.",date:"Por favor, escribe una fecha válida.",dateISO:"Por favor, escribe una fecha (ISO) válida.",number:"Por favor, escribe un número válido.",digits:"Por favor, escribe sólo dígitos.",creditcard:"Por favor, escribe un número de tarjeta válido.",equalTo:"Por favor, escribe el mismo valor de nuevo.",extension:"Por favor, escribe un valor con una extensión aceptada.",maxlength:a.validator.format("Por favor, no escribas más de {0} caracteres."),minlength:a.validator.format("Por favor, no escribas menos de {0} caracteres."),rangelength:a.validator.format("Por favor, escribe un valor entre {0} y {1} caracteres."),range:a.validator.format("Por favor, escribe un valor entre {0} y {1}."),max:a.validator.format("Por favor, escribe un valor menor o igual a {0}."),min:a.validator.format("Por favor, escribe un valor mayor o igual a {0}."),nifES:"Por favor, escribe un NIF válido.",nieES:"Por favor, escribe un NIE válido.",cifES:"Por favor, escribe un CIF válido."})}); | |
| 0 | 5 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_es_AR.js
0 → 100644
| 1 | +(function( factory ) { | |
| 2 | + if ( typeof define === "function" && define.amd ) { | |
| 3 | + define( ["jquery", "../jquery.validate"], factory ); | |
| 4 | + } else { | |
| 5 | + factory( jQuery ); | |
| 6 | + } | |
| 7 | +}(function( $ ) { | |
| 8 | + | |
| 9 | +/* | |
| 10 | + * Translated default messages for the jQuery validation plugin. | |
| 11 | + * Locale: ES (Spanish; Español) | |
| 12 | + * Region: AR (Argentina) | |
| 13 | + */ | |
| 14 | +$.extend($.validator.messages, { | |
| 15 | + required: "Este campo es obligatorio.", | |
| 16 | + remote: "Por favor, completá este campo.", | |
| 17 | + email: "Por favor, escribí una dirección de correo válida.", | |
| 18 | + url: "Por favor, escribí una URL válida.", | |
| 19 | + date: "Por favor, escribí una fecha válida.", | |
| 20 | + dateISO: "Por favor, escribí una fecha (ISO) válida.", | |
| 21 | + number: "Por favor, escribí un número entero válido.", | |
| 22 | + digits: "Por favor, escribí sólo dígitos.", | |
| 23 | + creditcard: "Por favor, escribí un número de tarjeta válido.", | |
| 24 | + equalTo: "Por favor, escribí el mismo valor de nuevo.", | |
| 25 | + extension: "Por favor, escribí un valor con una extensión aceptada.", | |
| 26 | + maxlength: $.validator.format("Por favor, no escribas más de {0} caracteres."), | |
| 27 | + minlength: $.validator.format("Por favor, no escribas menos de {0} caracteres."), | |
| 28 | + rangelength: $.validator.format("Por favor, escribí un valor entre {0} y {1} caracteres."), | |
| 29 | + range: $.validator.format("Por favor, escribí un valor entre {0} y {1}."), | |
| 30 | + max: $.validator.format("Por favor, escribí un valor menor o igual a {0}."), | |
| 31 | + min: $.validator.format("Por favor, escribí un valor mayor o igual a {0}."), | |
| 32 | + nifES: "Por favor, escribí un NIF válido.", | |
| 33 | + nieES: "Por favor, escribí un NIE válido.", | |
| 34 | + cifES: "Por favor, escribí un CIF válido." | |
| 35 | +}); | |
| 36 | + | |
| 37 | +})); | |
| 0 | 38 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_es_AR.min.js
0 → 100644
| 1 | +/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 | |
| 2 | + * http://jqueryvalidation.org/ | |
| 3 | + * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ | |
| 4 | +!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Este campo es obligatorio.",remote:"Por favor, completá este campo.",email:"Por favor, escribí una dirección de correo válida.",url:"Por favor, escribí una URL válida.",date:"Por favor, escribí una fecha válida.",dateISO:"Por favor, escribí una fecha (ISO) válida.",number:"Por favor, escribí un número entero válido.",digits:"Por favor, escribí sólo dígitos.",creditcard:"Por favor, escribí un número de tarjeta válido.",equalTo:"Por favor, escribí el mismo valor de nuevo.",extension:"Por favor, escribí un valor con una extensión aceptada.",maxlength:a.validator.format("Por favor, no escribas más de {0} caracteres."),minlength:a.validator.format("Por favor, no escribas menos de {0} caracteres."),rangelength:a.validator.format("Por favor, escribí un valor entre {0} y {1} caracteres."),range:a.validator.format("Por favor, escribí un valor entre {0} y {1}."),max:a.validator.format("Por favor, escribí un valor menor o igual a {0}."),min:a.validator.format("Por favor, escribí un valor mayor o igual a {0}."),nifES:"Por favor, escribí un NIF válido.",nieES:"Por favor, escribí un NIE válido.",cifES:"Por favor, escribí un CIF válido."})}); | |
| 0 | 5 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_es_PE.js
0 → 100644
| 1 | +(function( factory ) { | |
| 2 | + if ( typeof define === "function" && define.amd ) { | |
| 3 | + define( ["jquery", "../jquery.validate"], factory ); | |
| 4 | + } else { | |
| 5 | + factory( jQuery ); | |
| 6 | + } | |
| 7 | +}(function( $ ) { | |
| 8 | + | |
| 9 | +/* | |
| 10 | + * Translated default messages for the jQuery validation plugin. | |
| 11 | + * Locale: ES (Spanish; Español) | |
| 12 | + * Region: PE (Perú) | |
| 13 | + */ | |
| 14 | +$.extend($.validator.messages, { | |
| 15 | + required: "Este campo es obligatorio.", | |
| 16 | + remote: "Por favor, llene este campo.", | |
| 17 | + email: "Por favor, escriba un correo electrónico válido.", | |
| 18 | + url: "Por favor, escriba una URL válida.", | |
| 19 | + date: "Por favor, escriba una fecha válida.", | |
| 20 | + dateISO: "Por favor, escriba una fecha (ISO) válida.", | |
| 21 | + number: "Por favor, escriba un número válido.", | |
| 22 | + digits: "Por favor, escriba sólo dígitos.", | |
| 23 | + creditcard: "Por favor, escriba un número de tarjeta válido.", | |
| 24 | + equalTo: "Por favor, escriba el mismo valor de nuevo.", | |
| 25 | + extension: "Por favor, escriba un valor con una extensión permitida.", | |
| 26 | + maxlength: $.validator.format("Por favor, no escriba más de {0} caracteres."), | |
| 27 | + minlength: $.validator.format("Por favor, no escriba menos de {0} caracteres."), | |
| 28 | + rangelength: $.validator.format("Por favor, escriba un valor entre {0} y {1} caracteres."), | |
| 29 | + range: $.validator.format("Por favor, escriba un valor entre {0} y {1}."), | |
| 30 | + max: $.validator.format("Por favor, escriba un valor menor o igual a {0}."), | |
| 31 | + min: $.validator.format("Por favor, escriba un valor mayor o igual a {0}."), | |
| 32 | + nifES: "Por favor, escriba un NIF válido.", | |
| 33 | + nieES: "Por favor, escriba un NIE válido.", | |
| 34 | + cifES: "Por favor, escriba un CIF válido." | |
| 35 | +}); | |
| 36 | + | |
| 37 | +})); | |
| 0 | 38 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_es_PE.min.js
0 → 100644
| 1 | +/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 | |
| 2 | + * http://jqueryvalidation.org/ | |
| 3 | + * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ | |
| 4 | +!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Este campo es obligatorio.",remote:"Por favor, llene este campo.",email:"Por favor, escriba un correo electrónico válido.",url:"Por favor, escriba una URL válida.",date:"Por favor, escriba una fecha válida.",dateISO:"Por favor, escriba una fecha (ISO) válida.",number:"Por favor, escriba un número válido.",digits:"Por favor, escriba sólo dígitos.",creditcard:"Por favor, escriba un número de tarjeta válido.",equalTo:"Por favor, escriba el mismo valor de nuevo.",extension:"Por favor, escriba un valor con una extensión permitida.",maxlength:a.validator.format("Por favor, no escriba más de {0} caracteres."),minlength:a.validator.format("Por favor, no escriba menos de {0} caracteres."),rangelength:a.validator.format("Por favor, escriba un valor entre {0} y {1} caracteres."),range:a.validator.format("Por favor, escriba un valor entre {0} y {1}."),max:a.validator.format("Por favor, escriba un valor menor o igual a {0}."),min:a.validator.format("Por favor, escriba un valor mayor o igual a {0}."),nifES:"Por favor, escriba un NIF válido.",nieES:"Por favor, escriba un NIE válido.",cifES:"Por favor, escriba un CIF válido."})}); | |
| 0 | 5 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_et.js
0 → 100644
| 1 | +(function( factory ) { | |
| 2 | + if ( typeof define === "function" && define.amd ) { | |
| 3 | + define( ["jquery", "../jquery.validate"], factory ); | |
| 4 | + } else { | |
| 5 | + factory( jQuery ); | |
| 6 | + } | |
| 7 | +}(function( $ ) { | |
| 8 | + | |
| 9 | +/* | |
| 10 | + * Translated default messages for the jQuery validation plugin. | |
| 11 | + * Locale: ET (Estonian; eesti, eesti keel) | |
| 12 | + */ | |
| 13 | +$.extend($.validator.messages, { | |
| 14 | + required: "See väli peab olema täidetud.", | |
| 15 | + maxlength: $.validator.format("Palun sisestage vähem kui {0} tähemärki."), | |
| 16 | + minlength: $.validator.format("Palun sisestage vähemalt {0} tähemärki."), | |
| 17 | + rangelength: $.validator.format("Palun sisestage väärtus vahemikus {0} kuni {1} tähemärki."), | |
| 18 | + email: "Palun sisestage korrektne e-maili aadress.", | |
| 19 | + url: "Palun sisestage korrektne URL.", | |
| 20 | + date: "Palun sisestage korrektne kuupäev.", | |
| 21 | + dateISO: "Palun sisestage korrektne kuupäev (YYYY-MM-DD).", | |
| 22 | + number: "Palun sisestage korrektne number.", | |
| 23 | + digits: "Palun sisestage ainult numbreid.", | |
| 24 | + equalTo: "Palun sisestage sama väärtus uuesti.", | |
| 25 | + range: $.validator.format("Palun sisestage väärtus vahemikus {0} kuni {1}."), | |
| 26 | + max: $.validator.format("Palun sisestage väärtus, mis on väiksem või võrdne arvuga {0}."), | |
| 27 | + min: $.validator.format("Palun sisestage väärtus, mis on suurem või võrdne arvuga {0}."), | |
| 28 | + creditcard: "Palun sisestage korrektne krediitkaardi number." | |
| 29 | +}); | |
| 30 | + | |
| 31 | +})); | |
| 0 | 32 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_et.min.js
0 → 100644
| 1 | +/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 | |
| 2 | + * http://jqueryvalidation.org/ | |
| 3 | + * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ | |
| 4 | +!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"See väli peab olema täidetud.",maxlength:a.validator.format("Palun sisestage vähem kui {0} tähemärki."),minlength:a.validator.format("Palun sisestage vähemalt {0} tähemärki."),rangelength:a.validator.format("Palun sisestage väärtus vahemikus {0} kuni {1} tähemärki."),email:"Palun sisestage korrektne e-maili aadress.",url:"Palun sisestage korrektne URL.",date:"Palun sisestage korrektne kuupäev.",dateISO:"Palun sisestage korrektne kuupäev (YYYY-MM-DD).",number:"Palun sisestage korrektne number.",digits:"Palun sisestage ainult numbreid.",equalTo:"Palun sisestage sama väärtus uuesti.",range:a.validator.format("Palun sisestage väärtus vahemikus {0} kuni {1}."),max:a.validator.format("Palun sisestage väärtus, mis on väiksem või võrdne arvuga {0}."),min:a.validator.format("Palun sisestage väärtus, mis on suurem või võrdne arvuga {0}."),creditcard:"Palun sisestage korrektne krediitkaardi number."})}); | |
| 0 | 5 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_eu.js
0 → 100644
| 1 | +(function( factory ) { | |
| 2 | + if ( typeof define === "function" && define.amd ) { | |
| 3 | + define( ["jquery", "../jquery.validate"], factory ); | |
| 4 | + } else { | |
| 5 | + factory( jQuery ); | |
| 6 | + } | |
| 7 | +}(function( $ ) { | |
| 8 | + | |
| 9 | +/* | |
| 10 | + * Translated default messages for the jQuery validation plugin. | |
| 11 | + * Locale: EU (Basque; euskara, euskera) | |
| 12 | + */ | |
| 13 | +$.extend($.validator.messages, { | |
| 14 | + required: "Eremu hau beharrezkoa da.", | |
| 15 | + remote: "Mesedez, bete eremu hau.", | |
| 16 | + email: "Mesedez, idatzi baliozko posta helbide bat.", | |
| 17 | + url: "Mesedez, idatzi baliozko URL bat.", | |
| 18 | + date: "Mesedez, idatzi baliozko data bat.", | |
| 19 | + dateISO: "Mesedez, idatzi baliozko (ISO) data bat.", | |
| 20 | + number: "Mesedez, idatzi baliozko zenbaki oso bat.", | |
| 21 | + digits: "Mesedez, idatzi digituak soilik.", | |
| 22 | + creditcard: "Mesedez, idatzi baliozko txartel zenbaki bat.", | |
| 23 | + equalTo: "Mesedez, idatzi berdina berriro ere.", | |
| 24 | + extension: "Mesedez, idatzi onartutako luzapena duen balio bat.", | |
| 25 | + maxlength: $.validator.format("Mesedez, ez idatzi {0} karaktere baino gehiago."), | |
| 26 | + minlength: $.validator.format("Mesedez, ez idatzi {0} karaktere baino gutxiago."), | |
| 27 | + rangelength: $.validator.format("Mesedez, idatzi {0} eta {1} karaktere arteko balio bat."), | |
| 28 | + range: $.validator.format("Mesedez, idatzi {0} eta {1} arteko balio bat."), | |
| 29 | + max: $.validator.format("Mesedez, idatzi {0} edo txikiagoa den balio bat."), | |
| 30 | + min: $.validator.format("Mesedez, idatzi {0} edo handiagoa den balio bat.") | |
| 31 | +}); | |
| 32 | + | |
| 33 | +})); | |
| 0 | 34 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_eu.min.js
0 → 100644
| 1 | +/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 | |
| 2 | + * http://jqueryvalidation.org/ | |
| 3 | + * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ | |
| 4 | +!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Eremu hau beharrezkoa da.",remote:"Mesedez, bete eremu hau.",email:"Mesedez, idatzi baliozko posta helbide bat.",url:"Mesedez, idatzi baliozko URL bat.",date:"Mesedez, idatzi baliozko data bat.",dateISO:"Mesedez, idatzi baliozko (ISO) data bat.",number:"Mesedez, idatzi baliozko zenbaki oso bat.",digits:"Mesedez, idatzi digituak soilik.",creditcard:"Mesedez, idatzi baliozko txartel zenbaki bat.",equalTo:"Mesedez, idatzi berdina berriro ere.",extension:"Mesedez, idatzi onartutako luzapena duen balio bat.",maxlength:a.validator.format("Mesedez, ez idatzi {0} karaktere baino gehiago."),minlength:a.validator.format("Mesedez, ez idatzi {0} karaktere baino gutxiago."),rangelength:a.validator.format("Mesedez, idatzi {0} eta {1} karaktere arteko balio bat."),range:a.validator.format("Mesedez, idatzi {0} eta {1} arteko balio bat."),max:a.validator.format("Mesedez, idatzi {0} edo txikiagoa den balio bat."),min:a.validator.format("Mesedez, idatzi {0} edo handiagoa den balio bat.")})}); | |
| 0 | 5 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_fa.js
0 → 100644
| 1 | +(function( factory ) { | |
| 2 | + if ( typeof define === "function" && define.amd ) { | |
| 3 | + define( ["jquery", "../jquery.validate"], factory ); | |
| 4 | + } else { | |
| 5 | + factory( jQuery ); | |
| 6 | + } | |
| 7 | +}(function( $ ) { | |
| 8 | + | |
| 9 | +/* | |
| 10 | + * Translated default messages for the jQuery validation plugin. | |
| 11 | + * Locale: FA (Persian; فارسی) | |
| 12 | + */ | |
| 13 | +$.extend($.validator.messages, { | |
| 14 | + required: "تکمیل این فیلد اجباری است.", | |
| 15 | + remote: "لطفا این فیلد را تصحیح کنید.", | |
| 16 | + email: ".لطفا یک ایمیل صحیح وارد کنید", | |
| 17 | + url: "لطفا آدرس صحیح وارد کنید.", | |
| 18 | + date: "لطفا یک تاریخ صحیح وارد کنید", | |
| 19 | + dateFA: "لطفا یک تاریخ صحیح وارد کنید", | |
| 20 | + dateISO: "لطفا تاریخ صحیح وارد کنید (ISO).", | |
| 21 | + number: "لطفا عدد صحیح وارد کنید.", | |
| 22 | + digits: "لطفا تنها رقم وارد کنید", | |
| 23 | + creditcard: "لطفا کریدیت کارت صحیح وارد کنید.", | |
| 24 | + equalTo: "لطفا مقدار برابری وارد کنید", | |
| 25 | + extension: "لطفا مقداری وارد کنید که ", | |
| 26 | + maxlength: $.validator.format("لطفا بیشتر از {0} حرف وارد نکنید."), | |
| 27 | + minlength: $.validator.format("لطفا کمتر از {0} حرف وارد نکنید."), | |
| 28 | + rangelength: $.validator.format("لطفا مقداری بین {0} تا {1} حرف وارد کنید."), | |
| 29 | + range: $.validator.format("لطفا مقداری بین {0} تا {1} حرف وارد کنید."), | |
| 30 | + max: $.validator.format("لطفا مقداری کمتر از {0} حرف وارد کنید."), | |
| 31 | + min: $.validator.format("لطفا مقداری بیشتر از {0} حرف وارد کنید."), | |
| 32 | + minWords: $.validator.format("لطفا حداقل {0} کلمه وارد کنید."), | |
| 33 | + maxWords: $.validator.format("لطفا حداکثر {0} کلمه وارد کنید.") | |
| 34 | +}); | |
| 35 | + | |
| 36 | +})); | |
| 0 | 37 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_fa.min.js
0 → 100644
| 1 | +/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 | |
| 2 | + * http://jqueryvalidation.org/ | |
| 3 | + * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ | |
| 4 | +!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"تکمیل این فیلد اجباری است.",remote:"لطفا این فیلد را تصحیح کنید.",email:".لطفا یک ایمیل صحیح وارد کنید",url:"لطفا آدرس صحیح وارد کنید.",date:"لطفا یک تاریخ صحیح وارد کنید",dateFA:"لطفا یک تاریخ صحیح وارد کنید",dateISO:"لطفا تاریخ صحیح وارد کنید (ISO).",number:"لطفا عدد صحیح وارد کنید.",digits:"لطفا تنها رقم وارد کنید",creditcard:"لطفا کریدیت کارت صحیح وارد کنید.",equalTo:"لطفا مقدار برابری وارد کنید",extension:"لطفا مقداری وارد کنید که ",maxlength:a.validator.format("لطفا بیشتر از {0} حرف وارد نکنید."),minlength:a.validator.format("لطفا کمتر از {0} حرف وارد نکنید."),rangelength:a.validator.format("لطفا مقداری بین {0} تا {1} حرف وارد کنید."),range:a.validator.format("لطفا مقداری بین {0} تا {1} حرف وارد کنید."),max:a.validator.format("لطفا مقداری کمتر از {0} حرف وارد کنید."),min:a.validator.format("لطفا مقداری بیشتر از {0} حرف وارد کنید."),minWords:a.validator.format("لطفا حداقل {0} کلمه وارد کنید."),maxWords:a.validator.format("لطفا حداکثر {0} کلمه وارد کنید.")})}); | |
| 0 | 5 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_fi.js
0 → 100644
| 1 | +(function( factory ) { | |
| 2 | + if ( typeof define === "function" && define.amd ) { | |
| 3 | + define( ["jquery", "../jquery.validate"], factory ); | |
| 4 | + } else { | |
| 5 | + factory( jQuery ); | |
| 6 | + } | |
| 7 | +}(function( $ ) { | |
| 8 | + | |
| 9 | +/* | |
| 10 | + * Translated default messages for the jQuery validation plugin. | |
| 11 | + * Locale: FI (Finnish; suomi, suomen kieli) | |
| 12 | + */ | |
| 13 | +$.extend($.validator.messages, { | |
| 14 | + required: "Tämä kenttä on pakollinen.", | |
| 15 | + email: "Syötä oikea sähköpostiosoite.", | |
| 16 | + url: "Syötä oikea URL-osoite.", | |
| 17 | + date: "Syötä oikea päivämäärä.", | |
| 18 | + dateISO: "Syötä oikea päivämäärä muodossa VVVV-KK-PP.", | |
| 19 | + number: "Syötä luku.", | |
| 20 | + creditcard: "Syötä voimassa oleva luottokorttinumero.", | |
| 21 | + digits: "Syötä pelkästään numeroita.", | |
| 22 | + equalTo: "Syötä sama arvo uudestaan.", | |
| 23 | + maxlength: $.validator.format("Voit syöttää enintään {0} merkkiä."), | |
| 24 | + minlength: $.validator.format("Vähintään {0} merkkiä."), | |
| 25 | + rangelength: $.validator.format("Syötä vähintään {0} ja enintään {1} merkkiä."), | |
| 26 | + range: $.validator.format("Syötä arvo väliltä {0}–{1}."), | |
| 27 | + max: $.validator.format("Syötä arvo, joka on enintään {0}."), | |
| 28 | + min: $.validator.format("Syötä arvo, joka on vähintään {0}.") | |
| 29 | +}); | |
| 30 | + | |
| 31 | +})); | |
| 0 | 32 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_fi.min.js
0 → 100644
| 1 | +/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 | |
| 2 | + * http://jqueryvalidation.org/ | |
| 3 | + * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ | |
| 4 | +!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Tämä kenttä on pakollinen.",email:"Syötä oikea sähköpostiosoite.",url:"Syötä oikea URL-osoite.",date:"Syötä oikea päivämäärä.",dateISO:"Syötä oikea päivämäärä muodossa VVVV-KK-PP.",number:"Syötä luku.",creditcard:"Syötä voimassa oleva luottokorttinumero.",digits:"Syötä pelkästään numeroita.",equalTo:"Syötä sama arvo uudestaan.",maxlength:a.validator.format("Voit syöttää enintään {0} merkkiä."),minlength:a.validator.format("Vähintään {0} merkkiä."),rangelength:a.validator.format("Syötä vähintään {0} ja enintään {1} merkkiä."),range:a.validator.format("Syötä arvo väliltä {0}–{1}."),max:a.validator.format("Syötä arvo, joka on enintään {0}."),min:a.validator.format("Syötä arvo, joka on vähintään {0}.")})}); | |
| 0 | 5 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_fr.js
0 → 100644
| 1 | +(function( factory ) { | |
| 2 | + if ( typeof define === "function" && define.amd ) { | |
| 3 | + define( ["jquery", "../jquery.validate"], factory ); | |
| 4 | + } else { | |
| 5 | + factory( jQuery ); | |
| 6 | + } | |
| 7 | +}(function( $ ) { | |
| 8 | + | |
| 9 | +/* | |
| 10 | + * Translated default messages for the jQuery validation plugin. | |
| 11 | + * Locale: FR (French; français) | |
| 12 | + */ | |
| 13 | +$.extend($.validator.messages, { | |
| 14 | + required: "Ce champ est obligatoire.", | |
| 15 | + remote: "Veuillez corriger ce champ.", | |
| 16 | + email: "Veuillez fournir une adresse électronique valide.", | |
| 17 | + url: "Veuillez fournir une adresse URL valide.", | |
| 18 | + date: "Veuillez fournir une date valide.", | |
| 19 | + dateISO: "Veuillez fournir une date valide (ISO).", | |
| 20 | + number: "Veuillez fournir un numéro valide.", | |
| 21 | + digits: "Veuillez fournir seulement des chiffres.", | |
| 22 | + creditcard: "Veuillez fournir un numéro de carte de crédit valide.", | |
| 23 | + equalTo: "Veuillez fournir encore la même valeur.", | |
| 24 | + extension: "Veuillez fournir une valeur avec une extension valide.", | |
| 25 | + maxlength: $.validator.format("Veuillez fournir au plus {0} caractères."), | |
| 26 | + minlength: $.validator.format("Veuillez fournir au moins {0} caractères."), | |
| 27 | + rangelength: $.validator.format("Veuillez fournir une valeur qui contient entre {0} et {1} caractères."), | |
| 28 | + range: $.validator.format("Veuillez fournir une valeur entre {0} et {1}."), | |
| 29 | + max: $.validator.format("Veuillez fournir une valeur inférieure ou égale à {0}."), | |
| 30 | + min: $.validator.format("Veuillez fournir une valeur supérieure ou égale à {0}."), | |
| 31 | + maxWords: $.validator.format("Veuillez fournir au plus {0} mots."), | |
| 32 | + minWords: $.validator.format("Veuillez fournir au moins {0} mots."), | |
| 33 | + rangeWords: $.validator.format("Veuillez fournir entre {0} et {1} mots."), | |
| 34 | + letterswithbasicpunc: "Veuillez fournir seulement des lettres et des signes de ponctuation.", | |
| 35 | + alphanumeric: "Veuillez fournir seulement des lettres, nombres, espaces et soulignages.", | |
| 36 | + lettersonly: "Veuillez fournir seulement des lettres.", | |
| 37 | + nowhitespace: "Veuillez ne pas inscrire d'espaces blancs.", | |
| 38 | + ziprange: "Veuillez fournir un code postal entre 902xx-xxxx et 905-xx-xxxx.", | |
| 39 | + integer: "Veuillez fournir un nombre non décimal qui est positif ou négatif.", | |
| 40 | + vinUS: "Veuillez fournir un numéro d'identification du véhicule (VIN).", | |
| 41 | + dateITA: "Veuillez fournir une date valide.", | |
| 42 | + time: "Veuillez fournir une heure valide entre 00:00 et 23:59.", | |
| 43 | + phoneUS: "Veuillez fournir un numéro de téléphone valide.", | |
| 44 | + phoneUK: "Veuillez fournir un numéro de téléphone valide.", | |
| 45 | + mobileUK: "Veuillez fournir un numéro de téléphone mobile valide.", | |
| 46 | + strippedminlength: $.validator.format("Veuillez fournir au moins {0} caractères."), | |
| 47 | + email2: "Veuillez fournir une adresse électronique valide.", | |
| 48 | + url2: "Veuillez fournir une adresse URL valide.", | |
| 49 | + creditcardtypes: "Veuillez fournir un numéro de carte de crédit valide.", | |
| 50 | + ipv4: "Veuillez fournir une adresse IP v4 valide.", | |
| 51 | + ipv6: "Veuillez fournir une adresse IP v6 valide.", | |
| 52 | + require_from_group: "Veuillez fournir au moins {0} de ces champs.", | |
| 53 | + nifES: "Veuillez fournir un numéro NIF valide.", | |
| 54 | + nieES: "Veuillez fournir un numéro NIE valide.", | |
| 55 | + cifES: "Veuillez fournir un numéro CIF valide.", | |
| 56 | + postalCodeCA: "Veuillez fournir un code postal valide." | |
| 57 | +}); | |
| 58 | + | |
| 59 | +})); | |
| 0 | 60 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_fr.min.js
0 → 100644
| 1 | +/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 | |
| 2 | + * http://jqueryvalidation.org/ | |
| 3 | + * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ | |
| 4 | +!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Ce champ est obligatoire.",remote:"Veuillez corriger ce champ.",email:"Veuillez fournir une adresse électronique valide.",url:"Veuillez fournir une adresse URL valide.",date:"Veuillez fournir une date valide.",dateISO:"Veuillez fournir une date valide (ISO).",number:"Veuillez fournir un numéro valide.",digits:"Veuillez fournir seulement des chiffres.",creditcard:"Veuillez fournir un numéro de carte de crédit valide.",equalTo:"Veuillez fournir encore la même valeur.",extension:"Veuillez fournir une valeur avec une extension valide.",maxlength:a.validator.format("Veuillez fournir au plus {0} caractères."),minlength:a.validator.format("Veuillez fournir au moins {0} caractères."),rangelength:a.validator.format("Veuillez fournir une valeur qui contient entre {0} et {1} caractères."),range:a.validator.format("Veuillez fournir une valeur entre {0} et {1}."),max:a.validator.format("Veuillez fournir une valeur inférieure ou égale à {0}."),min:a.validator.format("Veuillez fournir une valeur supérieure ou égale à {0}."),maxWords:a.validator.format("Veuillez fournir au plus {0} mots."),minWords:a.validator.format("Veuillez fournir au moins {0} mots."),rangeWords:a.validator.format("Veuillez fournir entre {0} et {1} mots."),letterswithbasicpunc:"Veuillez fournir seulement des lettres et des signes de ponctuation.",alphanumeric:"Veuillez fournir seulement des lettres, nombres, espaces et soulignages.",lettersonly:"Veuillez fournir seulement des lettres.",nowhitespace:"Veuillez ne pas inscrire d'espaces blancs.",ziprange:"Veuillez fournir un code postal entre 902xx-xxxx et 905-xx-xxxx.",integer:"Veuillez fournir un nombre non décimal qui est positif ou négatif.",vinUS:"Veuillez fournir un numéro d'identification du véhicule (VIN).",dateITA:"Veuillez fournir une date valide.",time:"Veuillez fournir une heure valide entre 00:00 et 23:59.",phoneUS:"Veuillez fournir un numéro de téléphone valide.",phoneUK:"Veuillez fournir un numéro de téléphone valide.",mobileUK:"Veuillez fournir un numéro de téléphone mobile valide.",strippedminlength:a.validator.format("Veuillez fournir au moins {0} caractères."),email2:"Veuillez fournir une adresse électronique valide.",url2:"Veuillez fournir une adresse URL valide.",creditcardtypes:"Veuillez fournir un numéro de carte de crédit valide.",ipv4:"Veuillez fournir une adresse IP v4 valide.",ipv6:"Veuillez fournir une adresse IP v6 valide.",require_from_group:"Veuillez fournir au moins {0} de ces champs.",nifES:"Veuillez fournir un numéro NIF valide.",nieES:"Veuillez fournir un numéro NIE valide.",cifES:"Veuillez fournir un numéro CIF valide.",postalCodeCA:"Veuillez fournir un code postal valide."})}); | |
| 0 | 5 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_ge.js
0 → 100644
| 1 | +(function( factory ) { | |
| 2 | + if ( typeof define === "function" && define.amd ) { | |
| 3 | + define( ["jquery", "../jquery.validate"], factory ); | |
| 4 | + } else { | |
| 5 | + factory( jQuery ); | |
| 6 | + } | |
| 7 | +}(function( $ ) { | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * @author @tatocaster <kutaliatato@gmail.com> | |
| 11 | + * Translated default messages for the jQuery validation plugin. | |
| 12 | + * Locale: GE (Georgian; ქართული) | |
| 13 | + */ | |
| 14 | +$.extend($.validator.messages, { | |
| 15 | + required: "ეს ველი სავალდებულოა", | |
| 16 | + remote: "გთხოვთ შეასწოროთ.", | |
| 17 | + email: "გთხოვთ შეიყვანოთ სწორი ფორმატით.", | |
| 18 | + url: "გთხოვთ შეიყვანოთ სწორი ფორმატით.", | |
| 19 | + date: "გთხოვთ შეიყვანოთ სწორი თარიღი.", | |
| 20 | + dateISO: "გთხოვთ შეიყვანოთ სწორი ფორმატით ( ISO ).", | |
| 21 | + number: "გთხოვთ შეიყვანოთ რიცხვი.", | |
| 22 | + digits: "დაშვებულია მხოლოდ ციფრები.", | |
| 23 | + creditcard: "გთხოვთ შეიყვანოთ სწორი ფორმატის ბარათის კოდი.", | |
| 24 | + equalTo: "გთხოვთ შეიყვანოთ იგივე მნიშვნელობა.", | |
| 25 | + maxlength: $.validator.format( "გთხოვთ შეიყვანოთ არა უმეტეს {0} სიმბოლოსი." ), | |
| 26 | + minlength: $.validator.format( "შეიყვანეთ მინიმუმ {0} სიმბოლო." ), | |
| 27 | + rangelength: $.validator.format( "გთხოვთ შეიყვანოთ {0} -დან {1} -მდე რაოდენობის სიმბოლოები." ), | |
| 28 | + range: $.validator.format( "შეიყვანეთ {0} -სა {1} -ს შორის." ), | |
| 29 | + max: $.validator.format( "გთხოვთ შეიყვანოთ მნიშვნელობა ნაკლები ან ტოლი {0} -ს." ), | |
| 30 | + min: $.validator.format( "გთხოვთ შეიყვანოთ მნიშვნელობა მეტი ან ტოლი {0} -ს." ) | |
| 31 | +}); | |
| 32 | + | |
| 33 | +})); | |
| 0 | 34 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/assets/plugins/jquery-validation/js/localization/messages_ge.min.js
0 → 100644
| 1 | +/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015 | |
| 2 | + * http://jqueryvalidation.org/ | |
| 3 | + * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ | |
| 4 | +!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"ეს ველი სავალდებულოა",remote:"გთხოვთ შეასწოროთ.",email:"გთხოვთ შეიყვანოთ სწორი ფორმატით.",url:"გთხოვთ შეიყვანოთ სწორი ფორმატით.",date:"გთხოვთ შეიყვანოთ სწორი თარიღი.",dateISO:"გთხოვთ შეიყვანოთ სწორი ფორმატით ( ISO ).",number:"გთხოვთ შეიყვანოთ რიცხვი.",digits:"დაშვებულია მხოლოდ ციფრები.",creditcard:"გთხოვთ შეიყვანოთ სწორი ფორმატის ბარათის კოდი.",equalTo:"გთხოვთ შეიყვანოთ იგივე მნიშვნელობა.",maxlength:a.validator.format("გთხოვთ შეიყვანოთ არა უმეტეს {0} სიმბოლოსი."),minlength:a.validator.format("შეიყვანეთ მინიმუმ {0} სიმბოლო."),rangelength:a.validator.format("გთხოვთ შეიყვანოთ {0} -დან {1} -მდე რაოდენობის სიმბოლოები."),range:a.validator.format("შეიყვანეთ {0} -სა {1} -ს შორის."),max:a.validator.format("გთხოვთ შეიყვანოთ მნიშვნელობა ნაკლები ან ტოლი {0} -ს."),min:a.validator.format("გთხოვთ შეიყვანოთ მნიშვნელობა მეტი ან ტოლი {0} -ს.")})}); | |
| 0 | 5 | \ No newline at end of file | ... | ... |