Commit 4f65f977 by 侯昆

初始化

1 parent de7728ce
Showing 53 changed files with 2169 additions and 0 deletions
/.idea/
/serverside/.idea/
/serverside/cihai.iml
/serverside/cihai-jsp/cihai-jsp.iml
/serverside/cihai-core/cihai-core.iml
/serverside/cihai-app/cihai-app.iml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>cihai</artifactId>
<groupId>com.dookay</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cihai-app</artifactId>
<packaging>war</packaging>
<properties>
<maven.test.skip>true</maven.test.skip>
<jetty.scope>compile</jetty.scope>
</properties>
<dependencies>
<dependency>
<groupId>com.dookay</groupId>
<artifactId>coral-common-web</artifactId>
</dependency>
<dependency>
<groupId>com.dookay</groupId>
<artifactId>cihai-core</artifactId>
</dependency>
<!--开发工具-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<!--表现层-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<scope>${jetty.scope}</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
<scope>${jetty.scope}</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>apache-jsp</artifactId>
<scope>${jetty.scope}</scope>
</dependency>
<!--表现层-->
<!--工具-->
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<!--接口文档-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
</dependency>
<!--接口文档-->
</dependencies>
</project>
package com.dookay.cihai.app;
import com.dookay.coral.common.core.CoralCommonCoreMarker;
import com.dookay.coral.common.web.CoralCommonWebMarker;
import com.dookay.cihai.core.CihaiCoreMarker;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching;
/**
* 项目运行入口
*
* @author houkun
*/
@SpringBootApplication(
// 加载不同模块的配置与待注入的Bean
scanBasePackageClasses = {
CoralCommonCoreMarker.class,
CoralCommonWebMarker.class,
CihaiCoreMarker.class,
CihaiAppApplication.class,
})
@ServletComponentScan(basePackageClasses = {
CoralCommonWebMarker.class,
CihaiAppApplication.class
})
@MapperScan(basePackageClasses = CihaiCoreMarker.class)
@EnableCaching
public class CihaiAppApplication extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(CihaiAppApplication.class);
}
public static void main(String[] args) {
SpringApplication.run(CihaiAppApplication.class, args);
}
}
package com.dookay.cihai.app.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
* 接口文档配置
*
* @author houkun
*/
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket demoApi() {
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("Coral Demo 示例接口文档")
.description("示例描述")
.version("0.1")
.build();
}
}
package com.dookay.cihai.app.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
/**
* Web config
*
* @author houkun
*/
@Configuration
public class WebMvcConfig extends WebMvcConfigurerAdapter {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("swagger-ui.html")
.addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/");
}
}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>cihai</artifactId>
<groupId>com.dookay</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cihai-core</artifactId>
<dependencies>
<!--稻壳基础类库核心部分 不包含web -->
<dependency>
<groupId>com.dookay</groupId>
<artifactId>coral-common-core</artifactId>
</dependency>
<!--稻壳基础类库核心部分 不包含web -->
<!--开发工具-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<!--开发工具-->
</dependencies>
</project>
package com.dookay.cihai.core;
import com.dookay.coral.common.core.CoralCommonCoreMarker;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
/**
* @author houkun
*/
public interface CihaiCoreMarker {
}
# 解决 springboot-devtool 影响 tk.mybatis.mapper 插件报错问题
# 详见: https://github.com/abel533/MyBatis-Spring-Boot/issues/5
restart.include.mapper=/mapper-[\\w-\\.]+jar
restart.include.pagehelper=/pagehelper-[\\w-\\.]+jar
restart.include.coralcommon=/coral-common-[\\w-\\.]+jar
\ No newline at end of file \ No newline at end of file
package com.dookay.cihai.core;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.annotation.Rollback;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE)
@Rollback
@Transactional
@MapperScan(basePackageClasses = CihaiCoreMarker.class)
public class CihaiCoreApplicationTests {
@Test
public void contextLoads() {
}
}
# 数据库配置
# 数据库连接
spring.datasource.url=jdbc:mysql://localhost:3306/test
spring.datasource.username=root
# 加密后的密码
spring.datasource.password=UvoEsj8TZ9a11DQRR42EGuoIRjeuqSagmUzCdUeDnw9PJ9hum0Lx/MTPrpIR7isrPdA8lMpaY77eW4g3f1tCQQ==
# 加密时的公钥
public-key=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJFbtR5GoNcW9j8b4RhZQ1CC1xNBx8Sqphxc8/6vNWYdd7d84AUfSAzFXCzGvuvJ0URNAg9IykPDexY/mHP8dA0CAwEAAQ==
# druid解密配置
spring.datasource.druid.connection-properties=config.decrypt=true;config.decrypt.key=${public-key}
spring.datasource.druid.filter.config.enabled=true
#mybatis
# 设置扫描 mapper xml路径
mapper.mappers=com.dookay.coral.common.core.persistence.Mapper
mybatis.mapper-locations=classpath*:mapper/*.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>cihai</artifactId>
<groupId>com.dookay</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cihai-jsp</artifactId>
<packaging>war</packaging>
<properties>
<maven.test.skip>true</maven.test.skip>
<jetty.scope>compile</jetty.scope>
</properties>
<dependencies>
<dependency>
<groupId>com.dookay</groupId>
<artifactId>coral-common-web</artifactId>
</dependency>
<dependency>
<groupId>com.dookay</groupId>
<artifactId>cihai-core</artifactId>
</dependency>
<!--开发工具-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<!--表现层-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<scope>${jetty.scope}</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
<scope>${jetty.scope}</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>apache-jsp</artifactId>
<scope>${jetty.scope}</scope>
</dependency>
<!--表现层-->
<!--工具-->
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
</dependencies>
</project>
package com.dookay.cihai.jsp;
import com.dookay.coral.common.core.CoralCommonCoreMarker;
import com.dookay.coral.common.web.CoralCommonWebMarker;
import com.dookay.cihai.core.CihaiCoreMarker;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching;
/**
* 项目运行入口
*
* @author houkun
*/
@SpringBootApplication(
// 加载不同模块的配置与待注入的Bean
scanBasePackageClasses = {
CoralCommonCoreMarker.class,
CoralCommonWebMarker.class,
CihaiCoreMarker.class,
CihaiJspApplication.class,
})
@MapperScan(basePackageClasses = CihaiCoreMarker.class)
@ServletComponentScan(basePackageClasses = {
CoralCommonWebMarker.class,
CihaiJspApplication.class
})
@EnableCaching
public class CihaiJspApplication extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(CihaiJspApplication.class);
}
public static void main(String[] args) {
SpringApplication.run(CihaiJspApplication.class, args);
}
}
# 解决 springboot-devtool 影响 tk.mybatis.mapper 插件报错问题
# 详见: https://github.com/abel533/MyBatis-Spring-Boot/issues/5
restart.include.mapper=/mapper-[\\w-\\.]+jar
restart.include.pagehelper=/pagehelper-[\\w-\\.]+jar
restart.include.coralcommon=/coral-common-[\\w-\\.]+jar
restart.include.coraldemocore=/cihai-core[\\w-\\.]+jar
\ No newline at end of file \ No newline at end of file
debug=true
# 数据库连接
spring.datasource.url=jdbc:mysql://localhost:3306/test
spring.datasource.username=root
# 加密后的密码
spring.datasource.password=UvoEsj8TZ9a11DQRR42EGuoIRjeuqSagmUzCdUeDnw9PJ9hum0Lx/MTPrpIR7isrPdA8lMpaY77eW4g3f1tCQQ==
# 加密时的公钥
public-key=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJFbtR5GoNcW9j8b4RhZQ1CC1xNBx8Sqphxc8/6vNWYdd7d84AUfSAzFXCzGvuvJ0URNAg9IykPDexY/mHP8dA0CAwEAAQ==
# 日志
logging.level.root=info
logging.level.com.dookay.core=trace
# redis
spring.redis.host=127.0.0.1
coral.web.resource.mapping.uploads-inner=/uploads/**
coral.web.resource.mapping.uploads-mapping=file:/data/www/uploads/demo/
coral.web.view.form.interval-milli-second=10000
\ No newline at end of file \ No newline at end of file
# 数据库连接
spring.datasource.url=jdbc:mysql://localhost:3306/test
spring.datasource.username=root
# 加密后的密码
spring.datasource.password=UvoEsj8TZ9a11DQRR42EGuoIRjeuqSagmUzCdUeDnw9PJ9hum0Lx/MTPrpIR7isrPdA8lMpaY77eW4g3f1tCQQ==
# 加密时的公钥
public-key=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJFbtR5GoNcW9j8b4RhZQ1CC1xNBx8Sqphxc8/6vNWYdd7d84AUfSAzFXCzGvuvJ0URNAg9IykPDexY/mHP8dA0CAwEAAQ==
# 日志
logging.level.root=error
logging.level.com.dookay.coral.common.core=info
logging.level.com.dookay.coral.common.web=info
logging.level.com.dookay.front=info
logging.level.com.dookay.core=info
logging.file=/data/www/log/cihai.log
# redis
spring.redis.host=127.0.0.1
# 上传文件路径映射
coral.web.resource.mapping.uploads-inner=/uploads/**
coral.web.resource.mapping.uploads-mapping=file:/data/www/uploads/demo/
# 打开 gzip
server.compression.enabled=true
# 数据库连接
spring.datasource.url=jdbc:mysql://localhost:3306/test
spring.datasource.username=root
# 加密后的密码
spring.datasource.password=UvoEsj8TZ9a11DQRR42EGuoIRjeuqSagmUzCdUeDnw9PJ9hum0Lx/MTPrpIR7isrPdA8lMpaY77eW4g3f1tCQQ==
# 加密时的公钥
public-key=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJFbtR5GoNcW9j8b4RhZQ1CC1xNBx8Sqphxc8/6vNWYdd7d84AUfSAzFXCzGvuvJ0URNAg9IykPDexY/mHP8dA0CAwEAAQ==
# 日志
logging.level.root=warn
logging.level.com.dookay.coral.common.core=debug
logging.level.com.dookay.coral.common.web=debug
logging.level.com.dookay.front=debug
logging.level.com.dookay.core=debug
logging.file=/data/www/log/cihai.log
# redis
spring.redis.host=127.0.0.1
# 上传文件路径映射
coral.web.resource.mapping.uploads-inner=/uploads/**
coral.web.resource.mapping.uploads-mapping=file:/data/www/uploads/demo/
# 打开 gzip
server.compression.enabled=true
# 通用配置
spring.profiles.active=dev
# druid性能相关配置
spring.datasource.druid.initial-size=5
spring.datasource.druid.max-active=50
spring.datasource.druid.min-idle=5
spring.datasource.druid.test-on-borrow=true
spring.datasource.druid.test-on-return=false
spring.datasource.druid.test-while-idle=true
spring.datasource.druid.validation-query=select 1
spring.datasource.druid.max-wait=5000
spring.datasource.druid.time-between-eviction-runs-millis=600000
spring.datasource.druid.min-evictable-idle-time-millis=1800000
# druid解密配置
spring.datasource.druid.connection-properties=config.decrypt=true;config.decrypt.key=${public-key}
spring.datasource.druid.filter.config.enabled=true
# 关闭druid监控
spring.datasource.druid.filter.stat.enabled=false
# mybatis插件配置
# 设置扫描 mapper xml路径
mapper.mappers=com.dookay.coral.common.core.persistence.Mapper
mybatis.mapper-locations=classpath*:mapper/*.xml
# jsp页面配置
spring.mvc.view.prefix=/WEB-INF/jsp/
spring.mvc.view.suffix=.jsp
# 错误页面
coral.web.view.error.not-found=404
coral.web.view.error.bad-request=400
coral.web.view.error.internal-error=500
coral.web.view.error.service=service
coral.web.view.error.other=other
<%@ include file="/WEB-INF/jsp/include/taglib.jsp" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<jsp:include page="/WEB-INF/jsp/include/header.jsp">
<jsp:param name="pageTitle" value="coral-list"/>
</jsp:include>
<h1>400</h1>
<p>${error.get("status")}</p>
<p>${error.get("code")}</p>
<p>${error.get("message")}</p>
<p>${error.get("path")}</p>
<p>${error.get("errorDetail")}</p>
<jsp:include page="/WEB-INF/jsp/include/footer.jsp"/>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<jsp:include page="/WEB-INF/jsp/include/header.jsp">
<jsp:param name="pageTitle" value="coral-list"/>
</jsp:include>
<h1>404</h1>
<p>${error.get("status")}</p>
<p>${error.get("code")}</p>
<p>${error.get("message")}</p>
<p>${error.get("path")}</p>
<p>${error.get("errorDetail")}</p>
<jsp:include page="/WEB-INF/jsp/include/footer.jsp"/>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<jsp:include page="/WEB-INF/jsp/include/header.jsp">
<jsp:param name="pageTitle" value="coral-list"/>
</jsp:include>
<h1>500</h1>
<p>${error.get("status")}</p>
<p>${error.get("code")}</p>
<p>${error.get("message")}</p>
<p>${error.get("path")}</p>
<p>${error.get("errorDetail")}</p>
<jsp:include page="/WEB-INF/jsp/include/footer.jsp"/>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--添加此行消除额外空格--%>
<%@ page trimDirectiveWhitespaces="true" %>
<%--添加此行消除额外空格--%>
<jsp:include page="/WEB-INF/jsp/include/header.jsp">
<jsp:param name="pageTitle" value="coral-list"/>
</jsp:include>
<jsp:useBean id="coralList" scope="request" type="com.dookay.coral.common.web.component.list.CoralListModelContainer<com.dookay.core.domain.CountryDomain>"/>
<h1>coralList</h1>
<%--排序器--%>
<p><a class="${cl:isCurrentOrder("id-desc") ? "active" : ""}" href="${cl:sortUrl("id-desc")}">id-desc</a></p>
<p><a class="${cl:isCurrentOrder("id-asc") ? "active" : ""}" href="${cl:sortUrl("id-asc")}">id-asc</a></p>
<p><a class="${cl:isCurrentOrder("countryCode-desc") ? "active" : ""}" href="${cl:sortUrl("countryCode-desc")}">countryCode-desc</a></p>
<p>currentOrder: ${coralList.sorterModel.orderBy}</p>
<%--排序器--%>
<%--单选--%>
<p>
<c:forEach var="item" items="${cl:singleSelect('id').items}">
<span><a class="${item.selected ? "active" :""}" href="${cl:singleSelectUrl("id", item)}">${item.text}</a></span>
</c:forEach>
<span><a class="${cl:noneSelectByField("id") ? "active" :""}" href="${cl:unSelectUrl("id")}">全部</a></span>
</p>
<%--单选--%>
<form>
<%--多选--%>
<h3>countryCode:</h3>
<c:forEach var="item" items="${cl:multiSelect('countryCode').items}">
<input type="checkbox" name="countryCode"
value="${item.value}" ${item.selected ? "checked" : ""} /> ${item.text}
</c:forEach>
<%--多选--%>
<%--搜索--%>
<h3>countryName</h3>
<input type="text" name="countryName" value="${cl:searchSelect("countryName").selected}">
<%--搜索--%>
<%--范围选择--%>
<input type="date" name="createTimeGt" value="${cl:rangeSelect("createTime").selected.min}">
<input type="date" name="createTimeLt" value="${cl:rangeSelect("createTime").selected.max}">
<%--范围选择--%>
<%--隐藏域,保存分页和排序信息--%>
<cl:filterHidden/>
<%--隐藏域,保存分页和排序信息--%>
<input type="submit" value="提交">
</form>
<table>
<tr>
<th>id</th>
<th>code</th>
<th>name</th>
</tr>
<c:choose>
<c:when test="${cl:isEmpty()}">
<%--无内容--%>
<tr>
<td colspan="3">无数据</td>
</tr>
<%--无内容--%>
</c:when>
<c:otherwise>
<%--有内容--%>
<c:forEach var="country" items="${coralList.resultList}">
<tr>
<td>${country.id}</td>
<td>${country.countryCode}</td>
<td>${country.countryName}</td>
</tr>
</c:forEach>
<%--有内容--%>
</c:otherwise>
</c:choose>
</table>
<%--翻页器--%>
<p>
<c:forEach var="page" items="${coralList.pageModel.pages}">
<span>
<c:choose>
<c:when test="${page != null}">
<a href="${page.url}">${page.pageIndex}</a>
</c:when>
<c:otherwise>
<span>...</span>
</c:otherwise>
</c:choose>
</span>
</c:forEach>
<span>当前第${coralList.pageModel.currentPage.pageIndex}页,共${coralList.pageModel.totalPage}页,${coralList.pageModel.totalRecord}条记录</span>
</p>
<%--翻页器--%>
<style>
a.active {
color: red;
}
</style>
<jsp:include page="/WEB-INF/jsp/include/footer.jsp"/>
\ No newline at end of file \ No newline at end of file
<%@ include file="/WEB-INF/jsp/include/taglib.jsp" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--添加此行消除额外空格--%>
<%@ page trimDirectiveWhitespaces="true" %>
<%--添加此行消除额外空格--%>
<jsp:include page="/WEB-INF/jsp/include/header.jsp">
<jsp:param name="pageTitle" value="user-list"/>
</jsp:include>
<jsp:useBean id="coralList" scope="request" type="com.dookay.coral.common.web.component.list.CoralListModelContainer<com.dookay.core.domain.UserInfoDomain>"/>
<h1>coralList</h1>
<%--排序器--%>
<p><a class="${cl:isCurrentOrder("id-desc") ? "active" : ""}" href="${cl:sortUrl("id-desc")}">id-desc</a></p>
<p><a class="${cl:isCurrentOrder("id-asc") ? "active" : ""}" href="${cl:sortUrl("id-asc")}">id-asc</a></p>
<p>currentOrder: ${coralList.sorterModel.orderBy}</p>
<%--排序器--%>
<form>
<%--多选--%>
<h3>countryCode:</h3>
<c:forEach var="item" items="${cl:multiSelect('username').items}">
<input type="checkbox" name="username"
value="${item.value}" ${item.selected ? "checked" : ""} /> ${item.text}
</c:forEach>
<%--多选--%>
<%--隐藏域,保存分页和排序信息--%>
<cl:filterHidden/>
<%--隐藏域,保存分页和排序信息--%>
<input type="submit" value="提交">
</form>
<table>
<tr>
<th>id</th>
<th>username</th>
</tr>
<c:choose>
<c:when test="${cl:isEmpty()}">
<%--无内容--%>
<tr>
<td colspan="3">无数据</td>
</tr>
<%--无内容--%>
</c:when>
<c:otherwise>
<%--有内容--%>
<c:forEach var="user" items="${coralList.resultList}">
<tr>
<td>${user.id}</td>
<td>${user.username}</td>
</tr>
</c:forEach>
<%--有内容--%>
</c:otherwise>
</c:choose>
</table>
<%--翻页器--%>
<p>
<c:forEach var="page" items="${coralList.pageModel.pages}">
<span>
<c:choose>
<c:when test="${page != null}">
<a href="${page.url}">${page.pageIndex}</a>
</c:when>
<c:otherwise>
<span>...</span>
</c:otherwise>
</c:choose>
</span>
</c:forEach>
<span>当前第${coralList.pageModel.currentPage.pageIndex}页,共${coralList.pageModel.totalPage}页,${coralList.pageModel.totalRecord}条记录</span>
</p>
<%--翻页器--%>
<style>
a.active {
color: red;
}
</style>
<jsp:include page="/WEB-INF/jsp/include/footer.jsp"/>
\ No newline at end of file \ No newline at end of file
<%@ include file="/WEB-INF/jsp/include/taglib.jsp" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--添加此行消除额外空格--%>
<%@ page trimDirectiveWhitespaces="true" %>
<%--添加此行消除额外空格--%>
<jsp:include page="/WEB-INF/jsp/include/header.jsp">
<jsp:param name="pageTitle" value="form-index"/>
</jsp:include>
<p>普通html表单需手动添加csrf</p>
<%--@elvariable id="_csrf" type="org.springframework.security.web.csrf.CsrfToken"--%>
<input name="${_csrf.parameterName}" value="${_csrf.token}">
<%--@elvariable id="simpleForm" type="com.dookay.jsp.demo.form.form.SimpleForm"--%>
<form:form action="/form/simple" modelAttribute="simpleForm" cssClass="j_ajaxForm">
<p>
姓名:<form:input path="name"/>
</p>
<p>
手机号:<form:input path="mobile"/>
</p>
<p>
<form:button>提交</form:button>
</p>
</form:form>
<jsp:include page="/WEB-INF/jsp/include/footer.jsp"/>
\ No newline at end of file \ No newline at end of file
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--添加此行消除额外空格--%>
<%@ page trimDirectiveWhitespaces="true" %>
<%--添加此行消除额外空格--%>
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script src="${ctx}/static/js/backend.js"></script>
<script src="${ctx}/static/js/validator/jquery.validator.min.js"></script>
<script src="${ctx}/static/js/validator/local/zh-CN.js"></script>
<script src="${ctx}/static/js/layer/layer.js"></script>
<script>
$(function () {
backEndApp.init()
})
</script>
</body>
</html>
\ No newline at end of file \ No newline at end of file
<%@ include file="/WEB-INF/jsp/include/taglib.jsp" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--添加此行消除额外空格--%>
<%@ page trimDirectiveWhitespaces="true" %>
<%--添加此行消除额外空格--%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="generator" content="www.dookay.com">
<title>cihai ${param.pageTitle}</title>
</head>
<body>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="cl" uri="coral-list" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
\ No newline at end of file \ No newline at end of file
<%@ include file="/WEB-INF/jsp/include/taglib.jsp" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<jsp:include page="/WEB-INF/jsp/include/header.jsp">
<jsp:param name="pageTitle" value="coral-list"/>
</jsp:include>
<h1>index</h1>
<jsp:include page="/WEB-INF/jsp/include/footer.jsp"/>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<jsp:include page="/WEB-INF/jsp/include/header.jsp">
<jsp:param name="pageTitle" value="coral-list"/>
</jsp:include>
<h1>other error</h1>
<p>${error.get("status")}</p>
<p>${error.get("code")}</p>
<p>${error.get("message")}</p>
<p>${error.get("path")}</p>
<p>${error.get("errorDetail")}</p>
<jsp:include page="/WEB-INF/jsp/include/footer.jsp"/>
<%--@elvariable id="error" type="java.util.Map"--%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<jsp:include page="/WEB-INF/jsp/include/header.jsp">
<jsp:param name="pageTitle" value="coral-list"/>
</jsp:include>
<h1>service error</h1>
<p>${error.get("status")}</p>
<p>${error.get("code")}</p>
<p>${error.get("message")}</p>
<p>${error.get("path")}</p>
<p>${error.get("errorDetail")}</p>
<jsp:include page="/WEB-INF/jsp/include/footer.jsp"/>
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
</web-app>
\ No newline at end of file \ No newline at end of file
/*js 原生扩展*/
Array.prototype.remove = function (dx) {
for (var i = 0; i < this.length; i++) {
if (this[i] == dx) {
this.splice(i, 1);
}
}
return this;
}
Array.prototype.has = function (dx) {
for (var i = 0; i < this.length; i++) {
if (this[i] == dx) {
return true;
}
}
return false;
}
Array.prototype.contains = function (obj) {
var i = this.length;
while (i--) {
if (this[i] === obj) {
return true;
}
}
return false;
}
Date.prototype.format = function (format) {
/*
* eg:format="yyyy-MM-dd hh:mm:ss";
*/
if (!format) {
format = "yyyy-MM-dd hh:mm:ss";
}
var o = {
"M+": this.getMonth() + 1, // month
"d+": this.getDate(), // day
"h+": this.getHours(), // hour
"m+": this.getMinutes(), // minute
"s+": this.getSeconds(), // second
"q+": Math.floor((this.getMonth() + 3) / 3), // quarter
"S": this.getMilliseconds()
// millisecond
};
if (/(y+)/.test(format)) {
format = format.replace(RegExp.$1, (this.getFullYear() + "").substr(4
- RegExp.$1.length));
}
for (var k in o) {
if (new RegExp("(" + k + ")").test(format)) {
format = format.replace(RegExp.$1, RegExp.$1.length == 1
? o[k]
: ("00" + o[k]).substr(("" + o[k]).length));
}
}
return format;
};
String.prototype.escapeRegExp = function () {
return this.replace(/[.*+?^${}()|[\]\/\\]/g, "\\$0");
};
String.prototype.trimEnd = function (c) {
if (c)
return this.replace(new RegExp(c.escapeRegExp() + "*$"), '');
return this.replace(/\s+$/, '');
}
String.prototype.trimStart = function (c) {
if (c)
return this.replace(new RegExp("^" + c.escapeRegExp() + "*"), '');
return this.replace(/^\s+/, '');
}
var backEndApp = function () {
var _init = function () {
$(function () {
/**
* ajax表单提交
* @param options
* @returns {$}
*/
$.fn.ajaxSubmitForm = function (options) {
var params = {
before: function ($form) {
return true;
},
success: function ($form, data) {
if (data.code == "Ok") {
function okfun() {
if ($form.attr("data-next") != null && $form.attr("data-next") != "" && $form.attr("data-next") != "#")
location.href = $form.attr("data-next");
else if (data.NextUrl != null && data.NextUrl != "") {
location.href = data.NextUrl;
} else {
location.reload();
}
}
var time = parseInt($form.data('time'));
if (isNaN(time)) {
time = 2000;
}
if (time <= 0) {
okfun();
} else {
$.tips(data.message);
setTimeout(function () {
okfun();
}, time);
}
}
// 未登录
else {
$.tips(data.message);
}
}
};
$.extend(params, options);
this.submit(function (e) {
e.preventDefault();
var $form = $(this);
$form.validator();
var result = params.before($form);
if (result == false)
return false;
else {
$form.find(':submit').attr('disabled', 'disabled');
$form.find(':submit').addClass('disabled');
$form.find(':focus').blur();
if ($form.data("validator") != undefined && $form.data("validator") != null) {
$form.isValid(function (v) {
if (v) {
post();
} else {
$form.find(':submit').removeAttr('disabled');
$form.find(':submit').removeClass('disabled');
}
});
}
}
function post() {
$.ajax({
type: $form.attr("method") || "post",
url: $form.attr("action"),
data: $form.serialize(),
error: function (xmlHttpRequest, textStatus, errorThrown) {
$.tip('很遗憾,提交失败');
$form.find(':submit').removeAttr('disabled');
$form.find(':submit').removeClass('disabled');
},
success: function (data) {
if (data != null) {
params.success($form, data);
}
$form.find(':submit').removeAttr('disabled');
$form.find(':submit').removeClass('disabled');
}
});
}
return false;
});
return this;
}
$.extend({
tips: function (msg) {
return layer.open({skin: "msg", time: 1, content: msg});
}
});
$.extend({
tips: function (msg,fn) {
if(!fn){
fn=function () {}
}
return layer.open({skin: "msg", time: 2, content: msg,cancel:fn()});
}
});
$.setUrlParam = function (key, value, href) {
href = href || window.location.href;
var queryReg = /(\?.*)/;
var queryMathes = queryReg.exec(href);
var query = queryMathes && queryMathes.length >= 2 ? queryMathes[1] : '';
query = query.trimEnd('&').trimEnd('#');
var hashReg = /(#.*)/;
var hashMatches = hashReg.exec(href);
var hash = hashMatches && hashMatches.length >= 2 ? hashMatches[1] : '';
query = query.replace(hash, '');
var q = query + "&";
var re = new RegExp("[?|&]" + key + "=.*?&");
if (!re.test(q)) {
if (q == '&') {
q = '';
}
q += key + "=" + encodeURIComponent(value);
}
else
q = q.replace(re, "&" + key + "=" + encodeURIComponent(value) + "&");
q = q.trimStart("&").trimEnd("&");
q = (q[0] == "?" ? q : ("?" + q)) + hash;
return href.replace(/\?.*/, '').replace(hash, '') + q;
}
$.getUrlParam = function (key, query) {
if (!query)
query = window.location.search;
var re = new RegExp("[?|&]" + key + "=(.*?)&");
var matches = re.exec(query + "&");
if (!matches || matches.length < 2)
return "";
return decodeURIComponent(matches[1].replace("+", " "));
}
$(".j_ajaxForm").ajaxSubmitForm();
// $.pageLoading=function () {
// const param={pageIndex:"pageIndex"};
// var options={
// container:"loading-container",
// loadmore:"weui-loadmore"
// };
//
// var loading = false; //状态标记
// var $weui_loadmore = $("."+options.loadmore);
// var totalPage = $("."+options.container).data("totalpage");
// var pageIndex = 1;
//
// console.log(totalPage);
// $(document.body).infinite().on("infinite", function () {
// if (loading) return;
// loading = true;
// $weui_loadmore.show();
// if (pageIndex < totalPage) {
// pageIndex++;
// var nextUrl = $.setUrlParam(param.pageIndex, pageIndex);
// $.get(nextUrl, function (result) {
// setTimeout(function () {
// $("."+options.container).append($(result).find("."+options.container).html());
// loading = false;
// }, 500); //模拟延迟
// })
// } else {
// console.info("end")
// $(document.body).destroyInfinite();
// $weui_loadmore.html("<p>没有更多</p>");
// }
// });
//
// }
})
}
return {
init: function () {
_init();
}
}
}();
\ No newline at end of file \ No newline at end of file
/*! layer弹层组件拓展类 */
;!function(){layer.use("skin/layer.ext.css",function(){layer.layui_layer_extendlayerextjs=!0});var a=layer.cache||{},b=function(b){return a.skin?" "+a.skin+" "+a.skin+"-"+b:""};layer.prompt=function(a,c){a=a||{},"function"==typeof a&&(c=a);var d,e=2==a.formType?'<textarea class="layui-layer-input">'+(a.value||"")+"</textarea>":function(){return'<input type="'+(1==a.formType?"password":"text")+'" class="layui-layer-input" value="'+(a.value||"")+'">'}();return layer.open($.extend({btn:["&#x786E;&#x5B9A;","&#x53D6;&#x6D88;"],content:e,skin:"layui-layer-prompt"+b("prompt"),success:function(a){d=a.find(".layui-layer-input"),d.focus()},yes:function(b){var e=d.val();""===e?d.focus():e.length>(a.maxlength||500)?layer.tips("&#x6700;&#x591A;&#x8F93;&#x5165;"+(a.maxlength||500)+"&#x4E2A;&#x5B57;&#x6570;",d,{tips:1}):c&&c(e,b,d)}},a))},layer.tab=function(a){a=a||{};var c=a.tab||{};return layer.open($.extend({type:1,skin:"layui-layer-tab"+b("tab"),title:function(){var a=c.length,b=1,d="";if(a>0)for(d='<span class="layui-layer-tabnow">'+c[0].title+"</span>";a>b;b++)d+="<span>"+c[b].title+"</span>";return d}(),content:'<ul class="layui-layer-tabmain">'+function(){var a=c.length,b=1,d="";if(a>0)for(d='<li class="layui-layer-tabli xubox_tab_layer">'+(c[0].content||"no content")+"</li>";a>b;b++)d+='<li class="layui-layer-tabli">'+(c[b].content||"no content")+"</li>";return d}()+"</ul>",success:function(a){var b=a.find(".layui-layer-title").children(),c=a.find(".layui-layer-tabmain").children();b.on("mousedown",function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0;var b=$(this),d=b.index();b.addClass("layui-layer-tabnow").siblings().removeClass("layui-layer-tabnow"),c.eq(d).show().siblings().hide()})}},a))},layer.photos=function(a,c,d){function e(a,b,c){var d=new Image;d.onload=function(){d.onload=null,b(d)},d.onerror=function(a){d.onload=null,c(a)},d.src=a}var f={};if(a=a||{},a.photos){var g=a.photos.constructor===Object,h=g?a.photos:{},i=h.data||[],j=h.start||0;if(f.imgIndex=j+1,g){if(0===i.length)return void layer.msg("&#x6CA1;&#x6709;&#x56FE;&#x7247;")}else{var k=$(a.photos),l=k.find(a.img||"img");if(0===l.length)return;if(c||k.find(h.img||"img").each(function(b){var c=$(this);i.push({alt:c.attr("alt"),pid:c.attr("layer-pid"),src:c.attr("layer-src")||c.attr("src"),thumb:c.attr("src")}),c.on("click",function(){layer.photos($.extend(a,{photos:{start:b,data:i,tab:a.tab},full:a.full}),!0)})}),!c)return}f.imgprev=function(a){f.imgIndex--,f.imgIndex<1&&(f.imgIndex=i.length),f.tabimg(a)},f.imgnext=function(a){f.imgIndex++,f.imgIndex>i.length&&(f.imgIndex=1),f.tabimg(a)},f.keyup=function(a){if(!f.end){var b=a.keyCode;a.preventDefault(),37===b?f.imgprev(!0):39===b?f.imgnext(!0):27===b&&layer.close(f.index)}},f.tabimg=function(b){i.length<=1||(h.start=f.imgIndex-1,layer.close(f.index),layer.photos(a,!0,b))},f.event=function(){f.bigimg.hover(function(){f.imgsee.show()},function(){f.imgsee.hide()}),f.bigimg.find(".layui-layer-imgprev").on("click",function(a){a.preventDefault(),f.imgprev()}),f.bigimg.find(".layui-layer-imgnext").on("click",function(a){a.preventDefault(),f.imgnext()}),$(document).on("keyup",f.keyup)},f.loadi=layer.load(1,{shade:"shade"in a?!1:.9,scrollbar:!1}),e(i[j].src,function(c){layer.close(f.loadi),f.index=layer.open($.extend({type:1,area:function(){var b=[c.width,c.height],d=[$(window).width()-100,$(window).height()-100];return!a.full&&b[0]>d[0]&&(b[0]=d[0],b[1]=b[0]*d[1]/b[0]),[b[0]+"px",b[1]+"px"]}(),title:!1,shade:.9,shadeClose:!0,closeBtn:!1,move:".layui-layer-phimg img",moveType:1,scrollbar:!1,moveOut:!0,shift:5*Math.random()|0,skin:"layui-layer-photos"+b("photos"),content:'<div class="layui-layer-phimg"><img src="'+i[j].src+'" alt="'+(i[j].alt||"")+'" layer-pid="'+i[j].pid+'"><div class="layui-layer-imgsee">'+(i.length>1?'<span class="layui-layer-imguide"><a href="javascript:;" class="layui-layer-iconext layui-layer-imgprev"></a><a href="javascript:;" class="layui-layer-iconext layui-layer-imgnext"></a></span>':"")+'<div class="layui-layer-imgbar" style="display:'+(d?"block":"")+'"><span class="layui-layer-imgtit"><a href="javascript:;">'+(i[j].alt||"")+"</a><em>"+f.imgIndex+"/"+i.length+"</em></span></div></div></div>",success:function(b,c){f.bigimg=b.find(".layui-layer-phimg"),f.imgsee=b.find(".layui-layer-imguide,.layui-layer-imgbar"),f.event(b),a.tab&&a.tab(i[j],b)},end:function(){f.end=!0,$(document).off("keyup",f.keyup)}},a))},function(){layer.close(f.loadi),layer.msg("&#x5F53;&#x524D;&#x56FE;&#x7247;&#x5730;&#x5740;&#x5F02;&#x5E38;",{time:2e3},function(){i.length>1&&f.imgnext(!0)})})}}}();
\ No newline at end of file \ No newline at end of file
body .selectCountry {
background-color: rgba(0,0,0,.8);
}
\ No newline at end of file \ No newline at end of file
.n-inline-block, .nice-validator input, .nice-validator select, .nice-validator textarea, .msg-wrap, .n-icon, .n-msg { display: inline-block; *display: inline; *zoom: 1; }
/*.msg-box{position:relative;*zoom:1}*/
.msg-wrap { position: relative; white-space: nowrap; }
.msg-wrap, .n-icon, .n-msg { vertical-align: top; }
.n-arrow { position: absolute; overflow: hidden; }
.n-arrow b, .n-arrow i { position: absolute; left: 0; top: 0; border: 0; margin: 0; padding: 0; overflow: hidden; font-weight: 400; font-style: normal; font-size: 12px; font-family: serif; line-height: 14px; _line-height: 15px; color: #FFE7D5; }
.n-arrow i { text-shadow: none; }
.n-icon { width: 16px; height: 16px; overflow: hidden; background-repeat: no-repeat; }
.n-msg { display: inline-block; line-height: 15px; margin-left: 2px; *margin-top: -1px; _margin-top: 0; font-size: 14px; font-family: 微软雅黑; }
.n-error { color: #c33; }
.n-ok { color: #390; }
.n-tip, .n-loading { color: #808080; }
.n-error .n-icon { background-position: 0 0; }
.n-ok .n-icon { background-position: -16px 0; }
.n-tip .n-icon { background-position: -32px 0; }
.n-loading .n-icon { background: url("images/loading.gif") 0 center no-repeat !important; }
.n-top, .n-right, .n-bottom, .n-left { line-height: 0; vertical-align: top; outline: 0; position: relative; }
.n-top .n-arrow, .n-bottom .n-arrow { height: 6px; width: 12px; left: 45%; }
.n-left .n-arrow, .n-right .n-arrow { width: 6px; height: 12px; top: 6px; }
.n-top { vertical-align: top; }
.n-top .msg-wrap { margin-bottom: 6px; }
.n-top .n-arrow { bottom: -6px; }
.n-top .n-arrow b { top: -6px; }
.n-top .n-arrow i { top: -7px; }
.n-bottom { vertical-align: bottom; }
.n-bottom .msg-wrap { margin-top: 6px; }
.n-bottom .n-arrow { top: -6px; }
.n-bottom .n-arrow b { top: -1px; }
.n-bottom .n-arrow i { top: 0; }
.n-left .msg-wrap { right: 100%; margin-right: 6px; }
.n-left .n-arrow { right: -6px; }
.n-left .n-arrow b { left: -6px; }
.n-left .n-arrow i { left: -7px; }
.n-right .msg-wrap { margin-left: 6px; }
.n-right .n-arrow { left: -6px; }
.n-right .n-arrow b { left: 1px; }
.n-right .n-arrow i { left: 2px; }
.n-default .n-left, .n-default .n-right { margin-top: 5px; }
.n-default .n-top .msg-wrap { bottom: 100%; }
.n-default .n-bottom .msg-wrap { top: 100%; }
.n-default .msg-wrap { position: absolute; z-index: 1;top: -23px; }
/*.n-default .msg-wrap .n-icon { background-image: url("images/validator_default.png"); }*/
.n-default .n-tip .n-icon { display: none; }
.n-simple .msg-wrap { position: absolute; z-index: 1; }
.n-simple .msg-wrap .n-icon { background-image: url("images/validator_simple.png"); }
.n-simple .n-top .msg-wrap { bottom: 100%; }
.n-simple .n-bottom .msg-wrap { top: 100%; }
.n-simple .n-left, .n-simple .n-right { margin-top: 5px; }
.n-simple .n-bottom .msg-wrap { margin-top: 3px; }
.n-simple .n-tip .n-icon { display: none; }
.n-yellow .msg-wrap { position: absolute; bottom: 100%; z-index: 1; padding: 10px 15px; font-size: 12px; background-color: #FFE7D5; color: #333; box-shadow: 0 1px 3px #999; border-radius: 2px; }
.n-yellow .msg-wrap .n-arrow b { text-shadow: 2px 1px 0px #ccc; }
.n-yellow .msg-wrap .n-arrow i { }
.n-yellow .msg-wrap .n-icon { background-image: url("images/validator_simple.png"); }
.n-yellow .n-top .msg-wrap { bottom: 100%; border-bottom-left-radius: 0; }
.n-yellow .n-bottom .msg-wrap { top: 100%; }
.n-yellow .n-tip, .n-yellow .n-ok, .n-yellow .n-loading { background-color: #f8fdff; border-color: #ddd; color: #333; box-shadow: 0 1px 3px #ccc; }
.n-yellow .n-tip .n-arrow b, .n-yellow .n-ok .n-arrow b, .n-yellow .n-loading .n-arrow b { color: #ddd; text-shadow: 0 0 2px #ccc; }
.n-yellow .n-tip .n-arrow i, .n-yellow .n-ok .n-arrow i, .n-yellow .n-loading .n-arrow i { color: #f8fdff; }
.n-yellow .n-tip .n-icon { display: none; }
.n-invalid { color: #ff0000; border-color: #ff0000; background-color: #ffe8d6; }
.n-top .n-arrow{ border: transparent solid 4px; border-top: #ffe8d6 solid 4px; border-left: #ffe8d6 solid 4px; position: absolute; bottom: -8px; left: 0px;width: 0;height: 0; }
.msg-box { position: relative;bottom: 2px;float: left;}
.nice-validator .error{ border:1px solid #ff0000;padding-top: 1px;padding-bottom: 1px;}
\ No newline at end of file \ No newline at end of file
/*********************************
* Themes, rules, and i18n support
* Locale: English
*********************************/
(function(factory) {
typeof module === "object" && module.exports ? module.exports = factory( require( "jquery" ) ) :
typeof define === 'function' && define.amd ? define(['jquery'], factory) :
factory(jQuery);
}(function($) {
/* Global configuration
*/
$.validator.config({
//stopOnError: true,
//focusCleanup: true,
//theme: 'yellow_right',
//timely: 2,
// Custom rules
rules: {
digits: [/^\d+$/, "Please enter only digits."]
,letters: [/^[a-z]+$/i, "Please enter only letters."]
,date: [/^\d{4}-\d{2}-\d{2}$/, "Please enter a valid date, format: yyyy-mm-dd"]
,time: [/^([01]\d|2[0-3])(:[0-5]\d){1,2}$/, "Please enter a valid time, between 00:00 and 23:59"]
,email: [/^[\w\+\-]+(\.[\w\+\-]+)*@[a-z\d\-]+(\.[a-z\d\-]+)*\.([a-z]{2,4})$/i, "Please enter a valid email address."]
,url: [/^(https?|s?ftp):\/\/\S+$/i, "Please enter a valid URL."]
,accept: function (element, params){
if (!params) return true;
var ext = params[0],
value = $(element).val();
return (ext === '*') ||
(new RegExp(".(?:" + ext + ")$", "i")).test(value) ||
this.renderMsg("Only accept {1} file extension.", ext.replace(/\|/g, ', '));
}
},
// Default error messages
messages: {
0: "This field",
fallback: "{0} is not valid.",
loading: "Validating...",
error: "Network Error.",
timeout: "Request timed out.",
required: "{0} is required.",
remote: "Please try another name.",
integer: {
'*': "Please enter an integer.",
'+': "Please enter a positive integer.",
'+0': "Please enter a positive integer or 0.",
'-': "Please enter a negative integer.",
'-0': "Please enter a negative integer or 0."
},
match: {
eq: "{0} must be equal to {1}.",
neq: "{0} must be not equal to {1}.",
lt: "{0} must be less than {1}.",
gt: "{0} must be greater than {1}.",
lte: "{0} must be less than or equal to {1}.",
gte: "{0} must be greater than or equal to {1}."
},
range: {
rg: "Please enter a number between {1} and {2}.",
gte: "Please enter a number greater than or equal to {1}.",
lte: "Please enter a number less than or equal to {1}.",
gtlt: "Please fill in the number of {1} to {2}.",
gt: "Please enter a number greater than {1}.",
lt: "Please enter a number less than {1}."
},
checked: {
eq: "Please check {1} items.",
rg: "Please check between {1} and {2} items.",
gte: "Please check at least {1} items.",
lte: "Please check no more than {1} items."
},
length: {
eq: "Please enter {1} characters.",
rg: "Please enter a value between {1} and {2} characters long.",
gte: "Please enter at least {1} characters.",
lte: "Please enter no more than {1} characters.",
eq_2: "",
rg_2: "",
gte_2: "",
lte_2: ""
}
}
});
/* Themes
*/
var TPL_ARROW = '<span class="n-arrow"><b>◆</b><i>◆</i></span>';
$.validator.setTheme({
'simple_right': {
formClass: 'n-simple',
msgClass: 'n-right'
},
'simple_bottom': {
formClass: 'n-simple',
msgClass: 'n-bottom'
},
'yellow_top': {
formClass: 'n-yellow',
msgClass: 'n-top',
msgArrow: TPL_ARROW
},
'yellow_right': {
formClass: 'n-yellow',
msgClass: 'n-right',
msgArrow: TPL_ARROW
},
'yellow_right_effect': {
formClass: 'n-yellow',
msgClass: 'n-right',
msgArrow: TPL_ARROW,
msgShow: function($msgbox, type){
var $el = $msgbox.children();
if ($el.is(':animated')) return;
if (type === 'error') {
$el.css({left: '20px', opacity: 0})
.delay(100).show().stop()
.animate({left: '-4px', opacity: 1}, 150)
.animate({left: '3px'}, 80)
.animate({left: 0}, 80);
} else {
$el.css({left: 0, opacity: 1}).fadeIn(200);
}
},
msgHide: function($msgbox, type){
var $el = $msgbox.children();
$el.stop().delay(100).show()
.animate({left: '20px', opacity: 0}, 300, function(){
$msgbox.hide();
});
}
}
});
}));
/*********************************
* Themes, rules, and i18n support
* Locale: English; 英文
*********************************/
(function(factory) {
typeof module === "object" && module.exports ? module.exports = factory( require( "jquery" ) ) :
typeof define === 'function' && define.amd ? define(['jquery'], factory) :
factory(jQuery);
}(function($) {
/* Global configuration
*/
$.validator.config({
//stopOnError: true,
//focusCleanup: true,
//theme: 'yellow_right',
//timely: 2,
// Custom rules
rules: {
digits: [/^\d+$/, "Please fill in the numbers."]
,letters: [/^[a-z]+$/i, "Please fill in the letter."]
,date: [/^\d{4}-\d{2}-\d{2}$/, "Please fill in the valid date form: yyyy-mm-dd."]
,time: [/^([01]\d|2[0-3])(:[0-5]\d){1,2}$/, "Please fill in the valid time between 00:00 and 23:59."]
,email: [/^[\w\+\-]+(\.[\w\+\-]+)*@[a-z\d\-]+(\.[a-z\d\-]+)*\.([a-z]{2,4})$/i, "Please fill in the correct email address."]
,url: [/^(https?|s?ftp):\/\/\S+$/i, "Please fill in the valid URL."]
,qq: [/^[1-9]\d{4,}$/, "Please fill in the valid QQ number."]
,IDcard: [/^\d{6}(19|2\d)?\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)?$/, "Please fill in the correct identification number."]
,tel: [/^(?:(?:0\d{2,3}[\- ]?[1-9]\d{6,7})|(?:[48]00[\- ]?[1-9]\d{6}))$/, "Must fill in correctly."]
,mobile: [/^1[3-9]\d{9}$/, "Must fill in correctly."]
,zipcode: [/^\d{6}$/, "Please check the zip code format."]
,chinese: [/^[\u0391-\uFFE5]+$/, "Please fill in the Chinese characters."]
,username: [/^\w{3,12}$/, "Please fill in 3-12 digits, letters and underline."]
,password: [/^[\S]{6,16}$/, "Please fill out the 6-16 characters and cannot contain spaces"]
,accept: function (element, params){
if (!params) return true;
var ext = params[0],
value = $(element).val();
return (ext === '*') ||
(new RegExp(".(?:" + ext + ")$", "i")).test(value) ||
this.renderMsg("Files that accept only the{1}suffix", ext.replace(/\|/g, ','));
}
},
// Default error messages
messages: {
0: "in here",
fallback: "{0} the format is incorrect",
loading: "Verifying...",
error: "Network anomaly",
timeout: "Request Timeout",
required: "{0} Must Fill",
remote: "{0}Already in use",
equalTo: "The password entered for the two time must be consistent.",
integer: {
'*': "Please fill in the integer.",
'+': "Fill in the positive integer, please.",
'+0': "Please fill in the positive integer or 0.",
'-': "Please fill in the negative integer.",
'-0': "Please fill in the negative integer or 0."
},
match: {
eq: "{0} and {1} is not same",
neq: "{0} and {1} can not be the same",
lt: "{0} must be less than {1}",
gt: "{0} must be greater than {1}",
lte: "{0} not greater than {1}",
gte: "{0} not less than {1}"
},
range: {
rg: "请填写{1}到{2}的数",
gte: "请填写不小于{1}的数",
lte: "请填写最大{1}的数",
gtlt: "请填写{1}到{2}之间的数",
gt: "请填写大于{1}的数",
lt: "请填写小于{1}的数"
},
checked: {
eq: "请选择{1}项",
rg: "请选择{1}到{2}项",
gte: "请至少选择{1}项",
lte: "请最多选择{1}项"
},
length: {
eq: "请填写{1}个字符",
rg: "请填写{1}到{2}个字符",
gte: "请至少填写{1}个字符",
lte: "请最多填写{1}个字符",
eq_2: "",
rg_2: "",
gte_2: "",
lte_2: ""
}
}
});
/* Themes
*/
var TPL_ARROW = '<span class="n-arrow"><b>◆</b><i>◆</i></span>';
$.validator.setTheme({
'simple_right': {
formClass: 'n-simple',
msgClass: 'n-right'
},
'simple_bottom': {
formClass: 'n-simple',
msgClass: 'n-bottom'
},
'yellow_top': {
formClass: 'n-yellow',
msgClass: 'n-top',
msgArrow: TPL_ARROW
},
'yellow_right': {
formClass: 'n-yellow',
msgClass: 'n-right',
msgArrow: TPL_ARROW
},
'yellow_right_effect': {
formClass: 'n-yellow',
msgClass: 'n-right',
msgArrow: TPL_ARROW,
msgShow: function($msgbox, type){
var $el = $msgbox.children();
if ($el.is(':animated')) return;
if (type === 'error') {
$el.css({left: '20px', opacity: 0})
.delay(100).show().stop()
.animate({left: '-4px', opacity: 1}, 150)
.animate({left: '3px'}, 80)
.animate({left: 0}, 80);
} else {
$el.css({left: 0, opacity: 1}).fadeIn(200);
}
},
msgHide: function($msgbox, type){
var $el = $msgbox.children();
$el.stop().delay(100).show()
.animate({left: '20px', opacity: 0}, 300, function(){
$msgbox.hide();
});
}
}
});
}));
/*********************************
* Themes, rules, and i18n support
* Locale: Japanese; 日本語
*********************************/
(function(factory) {
typeof module === "object" && module.exports ? module.exports = factory( require( "jquery" ) ) :
typeof define === 'function' && define.amd ? define(['jquery'], factory) :
factory(jQuery);
}(function($) {
/* Global configuration
*/
$.validator.config({
//stopOnError: true,
//focusCleanup: true,
//theme: 'yellow_right',
//timely: 2,
// Custom rules
rules: {
digits: [/^\d+$/, "数字だけを入力してください"]
,letters: [/^[a-z]+$/i, "手紙のみでお願いします"]
,date: [/^\d{4}-\d{2}-\d{2}$/, "有効な日付を入力してください、,フォーマット:YYYY-MM-DD"]
,time: [/^([01]\d|2[0-3])(:[0-5]\d){1,2}$/, "有効な時刻を入力してください,00:00~23:59の間"]
,email: [/^[\w\+\-]+(\.[\w\+\-]+)*@[a-z\d\-]+(\.[a-z\d\-]+)*\.([a-z]{2,4})$/i, "有効なメールアドレスを入力してください"]
,url: [/^(https?|s?ftp):\/\/\S+$/i, "有効なURLを入力してください"]
,accept: function (element, params){
if (!params) return true;
var ext = params[0],
value = $(element).val();
return (ext === '*') ||
(new RegExp(".(?:" + ext + ")$", "i")).test(value) ||
this.renderMsg("ファイル拡張子を{1}のみを受け入れる", ext.replace(/\|/g, '、'));
}
},
// Default error messages
messages: {
0: "このフィールド",
fallback: "{0}は有効ではありません",
loading: "検証プロセス...",
error: "ネットワークエラー",
timeout: "要求がタイムアウトしました",
required: "{0}は必須です",
remote: "この値が使用されている",
integer: {
'*': "整数を入力してください",
'+': "正の整数を入力してください",
'+0': "正の整数または0を入力してください",
'-': "負の整数を入力してください",
'-0': "負の整数または0を入力してください"
},
match: {
eq: "{0}と{1}と同じでなければなりません",
neq: "{0}と{1}は同じにすることはできません",
lt: "{0}未満{1}なければならない",
gt: "{0}より{1}大なければならない",
lte: "{0}小なりイコール{1}なければならない",
gte: "{0}大なりイコール{1}なければならない"
},
range: {
rg: "{1}~{2}の数を入力してください",
gte: "{1}以上の数を入力してください",
lte: "{1}以下の数を入力してください",
gtlt: "{1}~{2}の間の数を入力してください",
gt: "{1}より大きい数を入力してください",
lt: "{1}より小きい数を入力してください"
},
checked: {
eq: "{1}項目を選択してください",
rg: "{1}から{2}の項目を選択してください",
gte: "少なくとも{1}の項目を選択してください",
lte: "{1}の項目まで選択してください"
},
length: {
eq: "{1}文字を入力してください",
rg: "{1}文字から{2}文字までの値を入力してください",
gte: "{1}文字以上で入力してください",
lte: "{1}文字以内で入力してください",
eq_2: "",
rg_2: "",
gte_2: "",
lte_2: ""
}
}
});
/* Themes
*/
var TPL_ARROW = '<span class="n-arrow"><b>◆</b><i>◆</i></span>';
$.validator.setTheme({
'simple_right': {
formClass: 'n-simple',
msgClass: 'n-right'
},
'simple_bottom': {
formClass: 'n-simple',
msgClass: 'n-bottom'
},
'yellow_top': {
formClass: 'n-yellow',
msgClass: 'n-top',
msgArrow: TPL_ARROW
},
'yellow_right': {
formClass: 'n-yellow',
msgClass: 'n-right',
msgArrow: TPL_ARROW
},
'yellow_right_effect': {
formClass: 'n-yellow',
msgClass: 'n-right',
msgArrow: TPL_ARROW,
msgShow: function($msgbox, type){
var $el = $msgbox.children();
if ($el.is(':animated')) return;
if (type === 'error') {
$el.css({left: '20px', opacity: 0})
.delay(100).show().stop()
.animate({left: '-4px', opacity: 1}, 150)
.animate({left: '3px'}, 80)
.animate({left: 0}, 80);
} else {
$el.css({left: 0, opacity: 1}).fadeIn(200);
}
},
msgHide: function($msgbox, type){
var $el = $msgbox.children();
$el.stop().delay(100).show()
.animate({left: '20px', opacity: 0}, 300, function(){
$msgbox.hide();
});
}
}
});
}));
/*********************************
* Themes, rules, and i18n support
* Locale: Chinese; 中文
*********************************/
(function(factory) {
typeof module === "object" && module.exports ? module.exports = factory( require( "jquery" ) ) :
typeof define === 'function' && define.amd ? define(['jquery'], factory) :
factory(jQuery);
}(function($) {
/* Global configuration
*/
$.validator.config({
//stopOnError: true,
//focusCleanup: true,
//theme: 'yellow_right',
//timely: 2,
// Custom rules
rules: {
digits: [/^\d+$/, "请填写数字"]
,letters: [/^[a-z]+$/i, "请填写字母"]
,date: [/^\d{4}-\d{2}-\d{2}$/, "请填写有效的日期,格式:yyyy-mm-dd"]
,time: [/^([01]\d|2[0-3])(:[0-5]\d){1,2}$/, "请填写有效的时间,00:00到23:59之间"]
,email: [/^[\w\+\-]+(\.[\w\+\-]+)*@[a-z\d\-]+(\.[a-z\d\-]+)*\.([a-z]{2,4})$/i, "请填写有效的邮箱"]
,url: [/^(https?|s?ftp):\/\/\S+$/i, "请填写有效的网址"]
,qq: [/^[1-9]\d{4,}$/, "请填写有效的QQ号"]
,IDcard: [/^\d{6}(19|2\d)?\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)?$/, "请填写正确的身份证号码"]
,tel: [/^(?:(?:0\d{2,3}[\- ]?[1-9]\d{6,7})|(?:[48]00[\- ]?[1-9]\d{6}))$/, "请填写有效的电话号码"]
,mobile: [/^1[3-9]\d{9}$/, "请填写有效的手机号"]
,zipcode: [/^\d{6}$/, "请检查邮政编码格式"]
,chinese: [/^[\u0391-\uFFE5]+$/, "请填写中文字符"]
,username: [/^\w{3,12}$/, "请填写3-12位数字、字母、下划线"]
,password: [/^[\S]{6,16}$/, "请填写6-16位字符,不能包含空格"]
,accept: function (element, params){
if (!params) return true;
var ext = params[0],
value = $(element).val();
return (ext === '*') ||
(new RegExp(".(?:" + ext + ")$", "i")).test(value) ||
this.renderMsg("只接受{1}后缀的文件", ext.replace(/\|/g, ','));
}
},
// Default error messages
messages: {
0: "此处",
fallback: "{0}格式不正确",
loading: "正在验证...",
error: "网络异常",
timeout: "请求超时",
required: "{0}不能为空",
remote: "{0}已被使用",
integer: {
'*': "请填写整数",
'+': "请填写正整数",
'+0': "请填写正整数或0",
'-': "请填写负整数",
'-0': "请填写负整数或0"
},
match: {
eq: "{0}与{1}不一致",
neq: "{0}与{1}不能相同",
lt: "{0}必须小于{1}",
gt: "{0}必须大于{1}",
lte: "{0}不能大于{1}",
gte: "{0}不能小于{1}"
},
range: {
rg: "请填写{1}到{2}的数",
gte: "请填写不小于{1}的数",
lte: "请填写最大{1}的数",
gtlt: "请填写{1}到{2}之间的数",
gt: "请填写大于{1}的数",
lt: "请填写小于{1}的数"
},
checked: {
eq: "请选择{1}项",
rg: "请选择{1}到{2}项",
gte: "请至少选择{1}项",
lte: "请最多选择{1}项"
},
length: {
eq: "请填写{1}个字符",
rg: "请填写{1}到{2}个字符",
gte: "请至少填写{1}个字符",
lte: "请最多填写{1}个字符",
eq_2: "",
rg_2: "",
gte_2: "",
lte_2: ""
}
}
});
/* Themes
*/
var TPL_ARROW = '<span class="n-arrow"><b>◆</b><i>◆</i></span>';
$.validator.setTheme({
'simple_right': {
formClass: 'n-simple',
msgClass: 'n-right'
},
'simple_bottom': {
formClass: 'n-simple',
msgClass: 'n-bottom'
},
'yellow_top': {
formClass: 'n-yellow',
msgClass: 'n-top',
msgArrow: TPL_ARROW
},
'yellow_right': {
formClass: 'n-yellow',
msgClass: 'n-right',
msgArrow: TPL_ARROW
},
'yellow_right_effect': {
formClass: 'n-yellow',
msgClass: 'n-right',
msgArrow: TPL_ARROW,
msgShow: function($msgbox, type){
var $el = $msgbox.children();
if ($el.is(':animated')) return;
if (type === 'error') {
$el.css({left: '20px', opacity: 0})
.delay(100).show().stop()
.animate({left: '-4px', opacity: 1}, 150)
.animate({left: '3px'}, 80)
.animate({left: 0}, 80);
} else {
$el.css({left: 0, opacity: 1}).fadeIn(200);
}
},
msgHide: function($msgbox, type){
var $el = $msgbox.children();
$el.stop().delay(100).show()
.animate({left: '20px', opacity: 0}, 300, function(){
$msgbox.hide();
});
}
}
});
}));
/*********************************
* Themes, rules, and i18n support
* Locale: Chinese; 中文
*********************************/
(function(factory) {
typeof module === "object" && module.exports ? module.exports = factory( require( "jquery" ) ) :
typeof define === 'function' && define.amd ? define(['jquery'], factory) :
factory(jQuery);
}(function($) {
/* Global configuration
*/
$.validator.config({
//stopOnError: true,
//focusCleanup: true,
//theme: 'yellow_right',
//timely: 2,
// Custom rules
rules: {
digits: [/^\d+$/, "请填写数字"]
,letters: [/^[a-z]+$/i, "请填写字母"]
,date: [/^\d{4}-\d{2}-\d{2}$/, "请填写有效的日期,格式:yyyy-mm-dd"]
,time: [/^([01]\d|2[0-3])(:[0-5]\d){1,2}$/, "请填写有效的时间,00:00到23:59之间"]
,email: [/^[\w\+\-]+(\.[\w\+\-]+)*@[a-z\d\-]+(\.[a-z\d\-]+)*\.([a-z]{2,4})$/i, "请填写有效的邮箱"]
,url: [/^(https?|s?ftp):\/\/\S+$/i, "请填写有效的网址"]
,qq: [/^[1-9]\d{4,}$/, "请填写有效的QQ号"]
,IDcard: [/^\d{6}(19|2\d)?\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)?$/, "请填写正确的身份证号码"]
,tel: [/^(?:(?:0\d{2,3}[\- ]?[1-9]\d{6,7})|(?:[48]00[\- ]?[1-9]\d{6}))$/, "请填写有效的电话号码"]
,mobile: [/^1[3-9]\d{9}$/, "请填写有效的手机号"]
,allMobile: [/^(\+|[0-9])\d+$/, "请填写有效的手机号"]
,zipcode: [/^\d{6}$/, "请检查邮政编码格式"]
,chinese: [/^[\u0391-\uFFE5]+$/, "请填写中文字符"]
,username: [/^\w{3,12}$/, "请填写3-12位数字、字母、下划线"]
,password: [/^[\S]{6,16}$/, "请填写6-16位字符,不能包含空格"]
,accept: function (element, params){
if (!params) return true;
var ext = params[0],
value = $(element).val();
return (ext === '*') ||
(new RegExp(".(?:" + ext + ")$", "i")).test(value) ||
this.renderMsg("只接受{1}后缀的文件", ext.replace(/\|/g, ','));
}
},
// Default error messages
messages: {
0: "此处",
fallback: "{0}格式不正确",
loading: "正在验证...",
error: "网络异常",
timeout: "请求超时",
required: "{0}不能为空",
remote: "{0}已被使用",
equalTo: "两次输入的密码必须一致",
integer: {
'*': "请填写整数",
'+': "请填写正整数",
'+0': "请填写正整数或0",
'-': "请填写负整数",
'-0': "请填写负整数或0"
},
match: {
eq: "{0}与{1}不一致",
neq: "{0}与{1}不能相同",
lt: "{0}必须小于{1}",
gt: "{0}必须大于{1}",
lte: "{0}不能大于{1}",
gte: "{0}不能小于{1}"
},
range: {
rg: "请填写{1}到{2}的数",
gte: "请填写不小于{1}的数",
lte: "请填写最大{1}的数",
gtlt: "请填写{1}到{2}之间的数",
gt: "请填写大于{1}的数",
lt: "请填写小于{1}的数"
},
checked: {
eq: "请选择{1}项",
rg: "请选择{1}到{2}项",
gte: "请至少选择{1}项",
lte: "请最多选择{1}项"
},
length: {
eq: "请填写{1}个字符",
rg: "请填写{1}到{2}个字符",
gte: "请至少填写{1}个字符",
lte: "请最多填写{1}个字符",
eq_2: "",
rg_2: "",
gte_2: "",
lte_2: ""
}
}
});
/* Themes
*/
var TPL_ARROW = '<span class="n-arrow"><b>◆</b><i>◆</i></span>';
$.validator.setTheme({
'simple_right': {
formClass: 'n-simple',
msgClass: 'n-right'
},
'simple_bottom': {
formClass: 'n-simple',
msgClass: 'n-bottom'
},
'yellow_top': {
formClass: 'n-yellow',
msgClass: 'n-top',
msgArrow: TPL_ARROW
},
'yellow_right': {
formClass: 'n-yellow',
msgClass: 'n-right',
msgArrow: TPL_ARROW
},
'yellow_right_effect': {
formClass: 'n-yellow',
msgClass: 'n-right',
msgArrow: TPL_ARROW,
msgShow: function($msgbox, type){
var $el = $msgbox.children();
if ($el.is(':animated')) return;
if (type === 'error') {
$el.css({left: '20px', opacity: 0})
.delay(100).show().stop()
.animate({left: '-4px', opacity: 1}, 150)
.animate({left: '3px'}, 80)
.animate({left: 0}, 80);
} else {
$el.css({left: 0, opacity: 1}).fadeIn(200);
}
},
msgHide: function($msgbox, type){
var $el = $msgbox.children();
$el.stop().delay(100).show()
.animate({left: '20px', opacity: 0}, 300, function(){
$msgbox.hide();
});
}
}
});
}));
/*********************************
* Themes, rules, and i18n support
* Locale: Chinese; 中文; TW (Taiwan)
*********************************/
(function(factory) {
typeof module === "object" && module.exports ? module.exports = factory( require( "jquery" ) ) :
typeof define === 'function' && define.amd ? define(['jquery'], factory) :
factory(jQuery);
}(function($) {
/* Global configuration
*/
$.validator.config({
//stopOnError: true,
//focusCleanup: true,
//theme: 'yellow_right',
//timely: 2,
// Custom rules
rules: {
digits: [/^\d+$/, "請填寫數字"]
,letters: [/^[a-z]+$/i, "請填寫字母"]
,date: [/^\d{4}-\d{2}-\d{2}$/, "請填寫有效的日期,格式:yyyy-mm-dd"]
,time: [/^([01]\d|2[0-3])(:[0-5]\d){1,2}$/, "請填寫有效的時間,00:00到23:59之間"]
,email: [/^[\w\+\-]+(\.[\w\+\-]+)*@[a-z\d\-]+(\.[a-z\d\-]+)*\.([a-z]{2,4})$/i, "請填寫有效的電郵"]
,url: [/^(https?|s?ftp):\/\/\S+$/i, "請填寫有效的網址"]
,accept: function (element, params){
if (!params) return true;
var ext = params[0],
value = $(element).val();
return (ext === '*') ||
(new RegExp(".(?:" + ext + ")$", "i")).test(value) ||
this.renderMsg("只接受{1}後綴的文件", ext.replace(/\|/g, ','));
}
},
// Default error messages
messages: {
0: "此處",
fallback: "{0}格式不正確",
loading: "正在驗證...",
error: "網絡異常",
timeout: "請求超時",
required: "{0}不能為空",
remote: "{0}已被使用",
integer: {
'*': "請填寫整數",
'+': "請填寫正整數",
'+0': "請填寫正整數或0",
'-': "請填寫負整數",
'-0': "請填寫負整數或0"
},
match: {
eq: "{0}與{1}不一致",
neq: "{0}與{1}不能相同",
lt: "{0}必須小於{1}",
gt: "{0}必須大於{1}",
lte: "{0}不能大於{1}",
gte: "{0}不能小於{1}"
},
range: {
rg: "請填寫{1}到{2}的數",
gte: "請填寫不小於{1}的數",
lte: "請填寫最大{1}的數",
gtlt: "請填寫{1}到{2}之間的數",
gt: "請填寫大於{1}的數",
lt: "請填寫小於{1}的數"
},
checked: {
eq: "請選擇{1}項",
rg: "請選擇{1}到{2}項",
gte: "請至少選擇{1}項",
lte: "請最多選擇{1}項"
},
length: {
eq: "請填寫{1}個字符",
rg: "請填寫{1}到{2}個字符",
gte: "請至少填寫{1}個字符",
lte: "請最多填寫{1}個字符",
eq_2: "",
rg_2: "",
gte_2: "",
lte_2: ""
}
}
});
/* Themes
*/
var TPL_ARROW = '<span class="n-arrow"><b>◆</b><i>◆</i></span>';
$.validator.setTheme({
'simple_right': {
formClass: 'n-simple',
msgClass: 'n-right'
},
'simple_bottom': {
formClass: 'n-simple',
msgClass: 'n-bottom'
},
'yellow_top': {
formClass: 'n-yellow',
msgClass: 'n-top',
msgArrow: TPL_ARROW
},
'yellow_right': {
formClass: 'n-yellow',
msgClass: 'n-right',
msgArrow: TPL_ARROW
},
'yellow_right_effect': {
formClass: 'n-yellow',
msgClass: 'n-right',
msgArrow: TPL_ARROW,
msgShow: function($msgbox, type){
var $el = $msgbox.children();
if ($el.is(':animated')) return;
if (type === 'error') {
$el.css({left: '20px', opacity: 0})
.delay(100).show().stop()
.animate({left: '-4px', opacity: 1}, 150)
.animate({left: '3px'}, 80)
.animate({left: 0}, 80);
} else {
$el.css({left: 0, opacity: 1}).fadeIn(200);
}
},
msgHide: function($msgbox, type){
var $el = $msgbox.children();
$el.stop().delay(100).show()
.animate({left: '20px', opacity: 0}, 300, function(){
$msgbox.hide();
});
}
}
});
}));
package com.dookay.cihai.jsp;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.annotation.Rollback;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;
@RunWith(SpringRunner.class)
@SpringBootTest
@Rollback
@Transactional
public class CihaiJspApplicationTests {
@Test
public void contextLoads() {
}
}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.dookay</groupId>
<artifactId>cihai</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>cihai</name>
<description>稻壳开发模板项目</description>
<properties>
<dookay.common.version>2.0.15</dookay.common.version>
<dookay.dependencies.version>2.0.1</dookay.dependencies.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<complier.plugin.version>3.7.0</complier.plugin.version>
</properties>
<dependencyManagement>
<dependencies>
<!--稻壳版本依赖-->
<dependency>
<groupId>com.dookay</groupId>
<artifactId>coral-dependencies</artifactId>
<version>${dookay.dependencies.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<!--稻壳版本依赖-->
<!--稻壳基础库-->
<dependency>
<groupId>com.dookay</groupId>
<artifactId>coral-common-core</artifactId>
<version>${dookay.common.version}</version>
</dependency>
<dependency>
<groupId>com.dookay</groupId>
<artifactId>coral-common-web</artifactId>
<version>${dookay.common.version}</version>
</dependency>
<!--稻壳基础库-->
<!--项目内依赖-->
<dependency>
<groupId>com.dookay</groupId>
<artifactId>cihai-core</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!--项目内依赖-->
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<!--打包插件 - 指定 java 版本-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${complier.plugin.version}</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<!--打包插件 - 指定 java 版本-->
</plugins>
</pluginManagement>
</build>
<modules>
<module>cihai-core</module>
<module>cihai-jsp</module>
<module>cihai-app</module>
</modules>
</project>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!