diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..8ba191626635d7bb271e178e56723157b4632d1d --- /dev/null +++ b/pom.xml @@ -0,0 +1,188 @@ + + + 4.0.0 + + com.es + disped + 1.0.0-SNAPSHOT + + disped-web + war + disped-web Maven Webapp + http://maven.apache.org + + + + + com.es + disped-core + 1.0.0-SNAPSHOT + + + commons-io + commons-io + + + + + + com.alibaba + druid + 1.1.5 + + + + + javax.servlet + jstl + 1.2 + + + + + dom4j + dom4j + 1.6.1 + + + + + org.apache.solr + solr-solrj + 7.1.0 + + + slf4j-api + org.slf4j + + + zookeeper + org.apache.zookeeper + + + commons-io + commons-io + + + + + + + com.alibaba + dubbo + 2.6.0 + + + spring-context + org.springframework + + + spring-beans + org.springframework + + + spring-web + org.springframework + + + + + + + org.apache.zookeeper + zookeeper + 3.4.11 + + + slf4j-log4j12 + org.slf4j + + + slf4j-api + org.slf4j + + + log4j + log4j + + + + + + + com.github.sgroschupf + zkclient + 0.1 + + + zookeeper + org.apache.zookeeper + + + log4j + log4j + + + + + + + org.slf4j + slf4j-api + ${slf4j.version} + + + org.slf4j + log4j-over-slf4j + ${slf4j.version} + + + + + ch.qos.logback + logback-classic + ${logback.version} + + + + + org.springframework.data + spring-data-redis + 1.8.9.RELEASE + + + jcl-over-slf4j + org.slf4j + + + + + + org.springframework.session + spring-session + 1.3.2.RELEASE + + + com.fasterxml.jackson.core + jackson-databind + 2.9.5 + + + + com.thetransactioncompany + cors-filter + 2.6 + + + + org.springframework + spring-test + ${spring.version} + test + + + + disped-web + + diff --git a/src/main/java/com/es/disped/web/controller/area/AreaController.java b/src/main/java/com/es/disped/web/controller/area/AreaController.java new file mode 100644 index 0000000000000000000000000000000000000000..424d94773bfb323ab7c395ff617c9a0baaf84695 --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/area/AreaController.java @@ -0,0 +1,155 @@ +/** + * + */ +package com.es.disped.web.controller.area; + +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.es.disped.api.area.AreaService; +import com.es.disped.common.constant.RecordStatus; +import com.es.disped.common.model.MsgModel; +import com.es.disped.common.model.PageModel; +import com.es.disped.core.controller.BaseController; +import com.es.disped.dao.model.Area; +import com.es.disped.dao.model.AreaExample; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; + +/** + * @author Anson
+ * + * Copyright by EasyShare 2019
+ * + * All right reserved
+ * + * Created on 下午3:41:36
+ * + * 名称:AreaController.java
+ * + * 描述:区域管理
+ */ +@Api("区域管理") +@Controller +@RequestMapping("/manage/area") +public class AreaController extends BaseController { + + @Autowired + AreaService areaService; + + @ApiOperation(value="保存地区",response=MsgModel.class,httpMethod="POST", + notes="保存地区对象,地区名称,地区联系人手机号以及地区联系人不能为空") + @RequiresPermissions(value="sys:save") + @RequestMapping(value="/save",method=RequestMethod.POST) + public @ResponseBody MsgModel save(@RequestBody @ApiParam(name="area",value="地区对象",required=true) Area area) + { + int count=0; + if(Optional.of(area) + .filter(name->area.getAreaName()!=null) + .filter(code->area.getAreaPhone()!=null) + .filter(uid->area.getUserId()!=null) + .isPresent()) + { + area.setAreaId(getUUID()); + area.setAreaValid(RecordStatus.USEAGE.getValue()); + count=areaService.insertSelective(area); + } + return new MsgModel(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"":"保存失败", count==1?area:"") ; + } + + + + @ApiOperation(value="更新地区",response=MsgModel.class,httpMethod="POST", + notes="更新地区对象,其中地区编号不能为空") + @RequiresPermissions(value="sys:update") + @RequestMapping(value="/update",method=RequestMethod.POST) + public @ResponseBody MsgModel update(@RequestBody @ApiParam(name="area",value="地区对象",required=true) Area area) + { + int count=0; + if(Optional.of(area) + .filter(areaId->area.getAreaId()!=null) + .isPresent()) + { + count=areaService.updateByPrimaryKeySelective(area); + } + return new MsgModel(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"":"保存失败", count==1?area:"") ; + } + + + @ApiOperation(value="删除地区",response=MsgModel.class,httpMethod="POST",notes="删除地区,需要地区编号") + @RequiresPermissions(value="sys:delete") + @RequestMapping(value="/delete",method=RequestMethod.POST) + public @ResponseBody MsgModel delete(@RequestBody @ApiParam(name="area",value="地区对象",required=true) Area area) + { + int count=0; + if(Optional.of(area) + .filter(areaId->area.getAreaId()!=null) + .isPresent()) + { + count=areaService.deleteByPrimaryKey(area.getAreaId()); + } + return new MsgModel(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"":"删除失败", count==1?area:""); + } + + + @ApiOperation(value="检索地区",response=MsgModel.class,httpMethod="POST",notes="检索地区,包括模糊检索") + @RequestMapping(value="/list",method=RequestMethod.POST) + public @ResponseBody MsgModel list(@RequestBody @ApiParam(name="area",value="地区对象",required=false) Area area) + { + AreaExample listExample=new AreaExample(); + AreaExample.Criteria criteria=listExample.createCriteria(); + if(!this.isNull(area.getAreaId())) + { + criteria.andAreaIdEqualTo(area.getAreaId()); + } + if(!this.isNull(area.getAreaName())) + { + criteria.andAreaNameLike("%"+area.getAreaName()+"%"); + } + if(!this.isNull(area.getAreaPhone())) + { + criteria.andAreaPhoneLike("%"+area.getAreaPhone()+"%"); + } + if(!this.isNull(area.getAreaAddress())) + { + criteria.andAreaAddressLike("%"+area.getAreaAddress()+"%"); + } + List areas=areaService.selectByExample(listExample); + return this.resultMsg(areas.size()>0?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + areas.size()>0?"":"地区列表为空", areas.size()>0?areas:""); + } + + + @ApiOperation(value="获取地区列表",httpMethod="POST",response=MsgModel.class,notes="获取地区信息(管理端),分页加载") + @RequestMapping(value="/pages",method=RequestMethod.POST) + public @ResponseBody MsgModel pages(@RequestBody @ApiParam(name="paramMap",value="分页参数[offset,limit]",required=true) Map paramMap) + { + AreaExample pageExample=new AreaExample(); + PageModel pageModel=null; + if(Optional.of(paramMap) + .filter(offset->paramMap.containsKey("offset")!=false) + .filter(limit->paramMap.containsKey("limit")!=false) + .isPresent()) + { + pageModel=areaService.selectByExampleForOffsetPage(pageExample, + Integer.valueOf(paramMap.get("offset").toString()), Integer.valueOf(paramMap.get("limit").toString())); + } + return this.resultMsg(pageModel!=null?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + pageModel!=null?"":"地区列表为空", pageModel!=null?pageModel:""); + } +} diff --git a/src/main/java/com/es/disped/web/controller/clazz/ClazzController.java b/src/main/java/com/es/disped/web/controller/clazz/ClazzController.java new file mode 100644 index 0000000000000000000000000000000000000000..37b3320be8941e2f3cf620d9fcf0e85bb60e598c --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/clazz/ClazzController.java @@ -0,0 +1,211 @@ +package com.es.disped.web.controller.clazz; + +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.apache.shiro.authz.annotation.Logical; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.es.disped.api.clazz.ClazzService; +import com.es.disped.common.constant.RecordStatus; +import com.es.disped.common.model.MsgModel; +import com.es.disped.common.model.PageModel; +import com.es.disped.core.controller.BaseController; +import com.es.disped.dao.model.Clazz; +import com.es.disped.dao.model.ClazzExample; +import com.es.disped.dao.model.SyllabusForeignModel; +import com.es.disped.dao.model.UserForeignModel; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; + +/** + * @author Anson
+ * Copyright by EasyShare 2019
+ * + * All right reserved
+ * + * Created on 2019年7月6日 上午10:08:09
+ * 名称:ClazzController.java
+ * 描述:班级管理
+ */ +@Api(value="班级管理") +@Controller +@RequestMapping("/manage/clazz") +public class ClazzController extends BaseController{ + + private final String USER_NAMESPACE="com.es.disped.dao.mapper.user.UserCustomMapper"; + + private final String CLAZZ_NAMESPACE="com.es.disped.dao.mapper.clazz.ClazzCustomMapper"; + + private final String SYLLABUS_NAMESPACE="com.es.disped.dao.mapper.syllabus.SyllabusCustomMapper"; + + @Autowired + ClazzService clazzService; + + + @ApiOperation(value="保存班级",response=MsgModel.class,httpMethod="POST",notes="保存班级信息") + @RequiresPermissions(value={"admin:save","sys:save"},logical=Logical.OR) + @Transactional + @RequestMapping(value="/save",method=RequestMethod.POST) + public @ResponseBody MsgModel save(@RequestBody @ApiParam(name="clazz",value="班级对象",required=true) Clazz clazz) + { + int count=0; + if(Optional.of(clazz) + .filter(name->clazz.getClazzName()!=null) + .filter(tId->clazz.getTeacherId()!=null) + .filter(max->clazz.getClazzMaxStudent()!=null) + .filter(syId->clazz.getSyllabusId()!=null) + .isPresent()) + { + clazz.setClazzId(getUUID()); + + UserForeignModel teacherForeignModel=this.getService().selectOne( + USER_NAMESPACE+".getUserForeignModel", clazz.getTeacherId()); + clazz.setTeacherName(teacherForeignModel.getUserName()); + + SyllabusForeignModel syllabusForeignModel=this.getService().selectOne( + SYLLABUS_NAMESPACE, clazz.getSyllabusId()); + clazz.setSyllabusName(syllabusForeignModel.getSyllabusName()); + + if(!this.isNull(clazz.getAssistantId())) + { + UserForeignModel assistantForeignModel=this.getService().selectOne(USER_NAMESPACE+".getUserForeignModel", clazz.getAssistantId()); + clazz.setAssistantName(assistantForeignModel.getUserName()); + } + + clazz.setClazzValid(RecordStatus.USEAGE.getValue()); + + count=clazzService.insertSelective(clazz); + } + return this.resultMsg(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"保存成功":"保存失败",count==1?clazz:""); + } + + + @ApiOperation(value="更新班级",response=MsgModel.class,httpMethod="POST",notes="更新班级信息") + @RequiresPermissions(value={"admin:update","sys:update"},logical=Logical.OR) + @Transactional + @RequestMapping(value="/update",method=RequestMethod.POST) + public @ResponseBody MsgModel update(@RequestBody @ApiParam(name="clazz",value="班级对象",required=true) Clazz clazz) + { + int count=0; + if(Optional.of(clazz) + .filter(cId->clazz.getClazzId()!=null) + .isPresent()) + { + if(!this.isNull(clazz.getTeacherId())) + { + UserForeignModel teacherForeignModel=this.getService().selectOne(USER_NAMESPACE+".getUserForeignModel", clazz.getTeacherId()); + clazz.setTeacherName(teacherForeignModel.getUserName()); + } + if(!this.isNull(clazz.getAssistantId())) + { + UserForeignModel assistantForeignModel=this.getService().selectOne(USER_NAMESPACE+".getUserForeignModel", clazz.getAssistantId()); + clazz.setAssistantName(assistantForeignModel.getUserName()); + } + if(!this.isNull(clazz.getSyllabusId())) + { + SyllabusForeignModel syllabusForeignModel=this.getService().selectOne( + SYLLABUS_NAMESPACE, clazz.getSyllabusId()); + clazz.setSyllabusName(syllabusForeignModel.getSyllabusName()); + } + count=clazzService.updateByPrimaryKeySelective(clazz); + } + return this.resultMsg(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"保存成功":"保存失败",count==1?clazz:""); + } + + @ApiOperation(value="删除班级",response=MsgModel.class,httpMethod="POST",notes="删除班级信息") + @RequiresPermissions(value={"admin:delete","sys:delete"},logical=Logical.OR) + @RequestMapping(value="/delete",method=RequestMethod.POST) + public @ResponseBody MsgModel delete(@RequestBody @ApiParam(name="clazz",value="班级对象",required=true) Clazz clazz) + { + int count=0; + if(!this.isNull(clazz.getClazzId())) + { + count=this.getService().delete(CLAZZ_NAMESPACE+".deleteClazzModel", clazz.getClazzId()); + } + return this.resultMsg(count>=1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count>=1?"保存成功":"保存失败",count>=1?clazz:""); + } + + + @ApiOperation(value="检索班级",response=MsgModel.class,httpMethod="POST", + notes="检索班级对象,精确检索:班级ID,教学计划ID,教师ID,助教ID;模糊检索:班级名称,教学大纲名称,教师姓名,助教姓名,班级最大容量") + @RequestMapping(value="/list",method=RequestMethod.POST) + public @ResponseBody MsgModel list(@RequestBody @ApiParam(name="clazz",value="班级对象",required=false) Clazz clazz) + { + ClazzExample listExample=new ClazzExample(); + ClazzExample.Criteria criteria=listExample.createCriteria(); + if(!this.isNull(clazz.getClazzId())) + { + criteria.andClazzIdEqualTo(clazz.getClazzId()); + } + if(!this.isNull(clazz.getTeacherId())) + { + criteria.andTeacherIdEqualTo(clazz.getTeacherId()); + } + if(!this.isNull(clazz.getAssistantId())) + { + criteria.andAssistantIdEqualTo(clazz.getAssistantId()); + } + if(!this.isNull(clazz.getSyllabusId())) + { + criteria.andSyllabusIdEqualTo(clazz.getSyllabusId()); + } + if(!this.isNull(clazz.getClazzName())) + { + criteria.andClazzNameLike("%"+clazz.getClazzName()+"%"); + } + if(!this.isNull(clazz.getTeacherName())) + { + criteria.andTeacherNameLike("%"+clazz.getTeacherName()+"%"); + } + if(!this.isNull(clazz.getAssistantName())) + { + criteria.andAssistantNameLike("%"+clazz.getAssistantName()+"%"); + } + if(!this.isNull(clazz.getSyllabusName())) + { + criteria.andSyllabusNameLike("%"+clazz.getSyllabusName()+"%"); + } + if(!this.isNull(clazz.getClazzMaxStudent())) + { + criteria.andClazzMaxStudentLessThanOrEqualTo(clazz.getClazzMaxStudent()); + } + List list=clazzService.selectByExample(listExample); + return this.resultMsg(!this.isNull(list)?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + !this.isNull(list)?"课时列表加载成功":"课时列表加载失败",!this.isNull(list)?list:""); + } + + + @ApiOperation(value="分页加载班级",response=MsgModel.class,httpMethod="POST",notes="分页加载班级,分页参数['offset','limit']") + @RequestMapping(value="/pages",method=RequestMethod.POST) + public @ResponseBody MsgModel pages(@RequestBody @ApiParam(name="paramMap",value="分页参数[offset,limit]",required=true) Map paramMap) + { + ClazzExample listExample=new ClazzExample(); + PageModel pageModel=null; + if(Optional.of(paramMap) + .filter(offset->paramMap.containsKey("offset")!=false) + .filter(limit->paramMap.containsKey("limit")!=false) + .isPresent()) + { + pageModel=clazzService.selectByExampleForOffsetPage(listExample, + Integer.valueOf(paramMap.get("offset").toString()), Integer.valueOf(paramMap.get("limit").toString())); + + } + return this.resultMsg(!this.isNull(pageModel)?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + !this.isNull(pageModel)?"课时加载成功":"课时加载失败",!this.isNull(pageModel)?pageModel:""); + } +} diff --git a/src/main/java/com/es/disped/web/controller/clazzstudent/ClazzStudentController.java b/src/main/java/com/es/disped/web/controller/clazzstudent/ClazzStudentController.java new file mode 100644 index 0000000000000000000000000000000000000000..1120ee8fa9a2f0e62bafbdf5ed11774625d4d761 --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/clazzstudent/ClazzStudentController.java @@ -0,0 +1,178 @@ +package com.es.disped.web.controller.clazzstudent; + +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.apache.shiro.authz.annotation.Logical; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.es.disped.api.clazzstudent.ClazzStudentService; +import com.es.disped.common.model.MsgModel; +import com.es.disped.common.model.PageModel; +import com.es.disped.core.controller.BaseController; +import com.es.disped.dao.model.ClazzForeignModel; +import com.es.disped.dao.model.ClazzStudent; +import com.es.disped.dao.model.ClazzStudentExample; +import com.es.disped.dao.model.UserForeignModel; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; + +/** + * @author Anson
+ * Copyright by EasyShare 2019
+ * + * All right reserved
+ * + * Created on 2019年7月6日 下午8:33:32
+ * 名称:ClazzStudentController.java
+ * 描述:班级学生管理
+ */ +@Api(value="班级学生关系管理") +@Controller +@RequestMapping("/manage/clazz/student") +public class ClazzStudentController extends BaseController{ + + private final String CLAZZ_NAMESPACE="com.es.disped.dao.mapper.clazz.ClazzCustomMapper"; + + private final String USER_NAMESPACE="com.es.disped.dao.mapper.user.UserCustomMapper"; + + @Autowired + ClazzStudentService clazzStudentService; + + @ApiOperation(value="保存班级学生关系对象",response=MsgModel.class,httpMethod="POST",notes="保存班级学生关系对象") + @RequiresPermissions(value={"admin:save","sys:save"},logical=Logical.OR) + @Transactional + @RequestMapping(value="/save",method=RequestMethod.POST) + public @ResponseBody MsgModel save(@RequestBody @ApiParam(name="clazzStudent",value="班级学生对象",required=true) ClazzStudent clazzStudent) + { + int count=0; + if(Optional.of(clazzStudent) + .filter(cId->clazzStudent.getClazzId()!=null) + .filter(sId->clazzStudent.getStudentId()!=null) + .isPresent()) + { + ClazzForeignModel clazzForeignModel=this.getService().selectOne(CLAZZ_NAMESPACE+".getClazzForeignModel", clazzStudent.getClazzId()); + if(clazzForeignModel.getClazzStudentNum()>clazzForeignModel.getClazzMaxStudent()) + { + clazzStudent.setClazzName(clazzForeignModel.getClazzName()); + clazzStudent.setRelId(getUUID()); + UserForeignModel userForeignModel=this.getService().selectOne(USER_NAMESPACE+".getUserForeignModel", clazzStudent.getStudentId()); + clazzStudent.setStudentName(userForeignModel.getUserName()); + count=clazzStudentService.insertSelective(clazzStudent); + } + //若学生添加成功,则更新班级人数 + if(count==1) + { + this.getService().update(CLAZZ_NAMESPACE+".addClazzStudentNum", clazzStudent.getClazzId()); + } + } + return this.resultMsg(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"保存成功":"保存失败", count==1?clazzStudent:""); + } + + @ApiOperation(value="更新班级学生关系对象",response=MsgModel.class,httpMethod="POST",notes="更新班级学生关系对象") + @RequiresPermissions(value={"admin:update","sys:update"},logical=Logical.OR) + @Transactional + @RequestMapping(value="/update",method=RequestMethod.POST) + public @ResponseBody MsgModel update(@RequestBody @ApiParam(name="clazzStudent",value="班级学生对象",required=true) ClazzStudent clazzStudent) + { + int count=0; + if(!this.isNull(clazzStudent.getRelId())) + { + if(!this.isNull(clazzStudent.getClazzId())) + { + ClazzForeignModel clazzForeignModel=this.getService().selectOne(CLAZZ_NAMESPACE+".getClazzForeignModel", clazzStudent.getClazzId()); + clazzStudent.setClazzName(clazzForeignModel.getClazzName()); + } + if(!this.isNull(clazzStudent.getStudentId())) + { + UserForeignModel userForeignModel=this.getService().selectOne(USER_NAMESPACE+".getUserForeignModel", clazzStudent.getStudentId()); + clazzStudent.setStudentName(userForeignModel.getUserName()); + } + count=clazzStudentService.updateByPrimaryKeySelective(clazzStudent); + } + return this.resultMsg(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"更新成功":"更新失败", count==1?clazzStudent:""); + } + + @ApiOperation(value="删除班级学生关系对象",response=MsgModel.class,httpMethod="POST",notes="删除班级学生关系对象") + @RequiresPermissions(value={"admin:delete","sys:delete"},logical=Logical.OR) + @Transactional + @RequestMapping(value="/delete",method=RequestMethod.POST) + public @ResponseBody MsgModel delete(@RequestBody @ApiParam(name="clazzStudent",value="班级学生对象",required=true) ClazzStudent clazzStudent) + { + int count=0; + if(!this.isNull(clazzStudent.getRelId())) + { + count=clazzStudentService.deleteByPrimaryKey(clazzStudent.getRelId()); + this.getService().update(CLAZZ_NAMESPACE+".minusClazzStudentNum", clazzStudent.getClazzId()); + } + return this.resultMsg(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"删除成功":"删除失败", count==1?clazzStudent:""); + } + + + @ApiOperation(value="检索班级学生关系对象",response=MsgModel.class,httpMethod="POST", + notes="检索班级学生关系对象,精确检索:关系主键ID,班级ID,学生ID;模糊检索:班级名称,学生姓名") + @RequestMapping(value="/list",method=RequestMethod.POST) + public @ResponseBody MsgModel list(@RequestBody @ApiParam(name="clazzStudent",value="班级学生对象",required=false) ClazzStudent clazzStudent) + { + ClazzStudentExample listExample=new ClazzStudentExample(); + ClazzStudentExample.Criteria criteria=listExample.createCriteria(); + if(!this.isNull(clazzStudent.getRelId())) + { + criteria.andRelIdEqualTo(clazzStudent.getRelId()); + } + if(!this.isNull(clazzStudent.getClazzId())) + { + criteria.andClazzIdEqualTo(clazzStudent.getClazzId()); + } + if(!this.isNull(clazzStudent.getStudentId())) + { + criteria.andStudentIdEqualTo(clazzStudent.getStudentId()); + } + if(!this.isNull(clazzStudent.getClazzName())) + { + criteria.andClazzNameLike("%"+clazzStudent.getClazzName()+"%"); + } + if(!this.isNull(clazzStudent.getStudentName())) + { + criteria.andStudentNameLike("%"+clazzStudent.getStudentName()+"%"); + } + List list=clazzStudentService.selectByExample(listExample); + return this.resultMsg(!this.isNull(list)?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + !this.isNull(list)?"班级学生加载成功":"班级学生加载失败", !this.isNull(list)?list:""); + } + + + @ApiOperation(value="分页加载班级学生",response=MsgModel.class,httpMethod="POST",notes="分页加载班级学生,分页参数['offset','limit']") + @RequestMapping(value="/pages",method=RequestMethod.POST) + public @ResponseBody MsgModel pages(@RequestBody @ApiParam(name="paramMap",value="分页参数[offset,limit]",required=true) Map paramMap) + { + ClazzStudentExample listExample=new ClazzStudentExample(); + PageModel pageModel=null; + if(Optional.of(paramMap) + .filter(offset->paramMap.containsKey("offset")!=false) + .filter(limit->paramMap.containsKey("limit")!=false) + .isPresent()) + { + pageModel=clazzStudentService.selectByExampleForOffsetPage(listExample, + Integer.valueOf(paramMap.get("offset").toString()), Integer.valueOf(paramMap.get("limit").toString())); + + } + return this.resultMsg(!this.isNull(pageModel)?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + !this.isNull(pageModel)?"班级学生加载成功":"班级学生加载失败",!this.isNull(pageModel)?pageModel:""); + } + +} diff --git a/src/main/java/com/es/disped/web/controller/course/CourseController.java b/src/main/java/com/es/disped/web/controller/course/CourseController.java new file mode 100644 index 0000000000000000000000000000000000000000..df95f93872df21ce4ad5262c60389088a1d8ec92 --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/course/CourseController.java @@ -0,0 +1,128 @@ +package com.es.disped.web.controller.course; + +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.apache.shiro.authz.annotation.Logical; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.es.disped.api.course.CourseService; +import com.es.disped.common.constant.RecordStatus; +import com.es.disped.common.model.MsgModel; +import com.es.disped.common.model.PageModel; +import com.es.disped.core.controller.BaseController; +import com.es.disped.dao.model.Course; +import com.es.disped.dao.model.CourseExample; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; + +@Api(value="课程管理") +@Controller +@RequestMapping("/manage/course") +public class CourseController extends BaseController{ + + private final String COURSE_NAMESPACE="com.es.disped.dao.mapper.course.CourseCustomMapper"; + + @Autowired + CourseService courseService; + + @ApiOperation(value="课程新增",response=MsgModel.class,httpMethod="POST",notes="系统管理员添加课程") + @RequestMapping(value="/save",method=RequestMethod.POST) + @RequiresPermissions(value={"admin:save","sys:save"},logical=Logical.OR) + public @ResponseBody MsgModel save(@RequestBody @ApiParam(name="course", value="课程对象",required=true) Course course) + { + int count=0; + if(Optional.of(course) + .filter(name->course.getCourseName()!=null) + .isPresent()) + { + course.setCourseId(this.getUUID()); + course.setCourseUpdateDate(this.currentDate("yyyy-MM-dd HH:mm:ss")); + course.setCourseValid(RecordStatus.USEAGE.getValue()); + count=courseService.insertSelective(course); + } + return this.resultMsg(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"课程保存成功":"课程保存失败",count==1?course:""); + } + + + @ApiOperation(value="课程更新",response=MsgModel.class,httpMethod="POST",notes="系统管理员更新课程") + @RequestMapping(value="/update",method=RequestMethod.POST) + @RequiresPermissions(value={"admin:save","sys:save"},logical=Logical.OR) + public @ResponseBody MsgModel update(@RequestBody @ApiParam(name="course", value="课程对象",required=true) Course course) + { + int count=0; + if(Optional.of(course) + .filter(name->course.getCourseId()!=null) + .isPresent()) + { + count=courseService.updateByPrimaryKey(course); + } + return this.resultMsg(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"课程更新成功":"课程更新失败",count==1?course:""); + } + + @ApiOperation(value="课程删除",response=MsgModel.class,httpMethod="POST",notes="系统管理员删除课程") + @RequestMapping(value="/delete",method=RequestMethod.POST) + @RequiresPermissions(value={"admin:save","sys:save"},logical=Logical.OR) + public @ResponseBody MsgModel delete(@RequestBody @ApiParam(name="course", value="课程对象",required=true) Course course) + { + int count=0; + if(Optional.of(course) + .filter(name->course.getCourseId()!=null) + .isPresent()) + { + //删除对象及引用对象 + count=this.getService().delete(COURSE_NAMESPACE+".deleteCourseModel", course.getCourseId()); + } + return this.resultMsg(count>=1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count>=1?"课程删除成功":"课程删除失败",count>=1?course:""); + } + + @ApiOperation(value="课程检索",response=MsgModel.class,httpMethod="POST",notes="检索课程,包含模糊检索(课程名称),精确检索(课程ID)") + @RequestMapping(value="/list",method=RequestMethod.POST) + public @ResponseBody MsgModel list(@RequestBody @ApiParam(name="course", value="课程对象",required=false) Course course) + { + CourseExample listExample=new CourseExample(); + if(!this.isNull(course.getCourseId())) + { + listExample.createCriteria().andCourseIdEqualTo(course.getCourseId()); + } + if(!this.isNull(course.getCourseName())) + { + listExample.createCriteria().andCourseNameLike("%"+course.getCourseName()+"%"); + } + List courses=courseService.selectByExample(listExample); + return this.resultMsg(!this.isNull(courses)?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + !this.isNull(courses)?"课程加载成功":"课程加载失败",!this.isNull(courses)?courses:""); + } + + + @ApiOperation(value="课程分页加载",response=MsgModel.class,httpMethod="POST",notes="分页加载课程,分页参数[offset,limit]") + @RequestMapping(value="/pages",method=RequestMethod.POST) + public @ResponseBody MsgModel pages(@RequestBody @ApiParam(name="paramMap",value="分页参数[offset,limit]",required=true) Map paramMap) + { + CourseExample listExample=new CourseExample(); + PageModel pageModel=null; + if(Optional.of(paramMap) + .filter(offset->paramMap.containsKey("offset")!=false) + .filter(limit->paramMap.containsKey("limit")!=false) + .isPresent()) + { + pageModel=courseService.selectByExampleForOffsetPage(listExample, + Integer.valueOf(paramMap.get("offset").toString()), Integer.valueOf(paramMap.get("limit").toString())); + } + return this.resultMsg(!this.isNull(pageModel)?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + !this.isNull(pageModel)?"课程加载成功":"课程加载失败",!this.isNull(pageModel)?pageModel:""); + } +} diff --git a/src/main/java/com/es/disped/web/controller/coursetemplate/CourseTemplateController.java b/src/main/java/com/es/disped/web/controller/coursetemplate/CourseTemplateController.java new file mode 100644 index 0000000000000000000000000000000000000000..a65ed9013f7068875a5d80195a8c0456ecbaec7d --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/coursetemplate/CourseTemplateController.java @@ -0,0 +1,193 @@ +package com.es.disped.web.controller.coursetemplate; + +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.apache.shiro.authz.annotation.Logical; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.es.disped.api.coursetemplate.CourseTemplateService; +import com.es.disped.common.constant.RecordStatus; +import com.es.disped.common.model.MsgModel; +import com.es.disped.common.model.PageModel; +import com.es.disped.core.controller.BaseController; +import com.es.disped.dao.model.CourseForeignModel; +import com.es.disped.dao.model.CourseTemplate; +import com.es.disped.dao.model.CourseTemplateExample; +import com.es.disped.dao.model.LevelForeignModel; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; + + +/** + * @author Anson
+ * Copyright by EasyShare 2019
+ * + * All right reserved
+ * + * Created on 2019年7月3日 上午9:52:12
+ * 名称:CourseTemplateController.java
+ * 描述:课程模板管理
+ */ +@Api(value="课程模板管理") +@Controller +@RequestMapping("/manage/course/template") +public class CourseTemplateController extends BaseController { + + private final String COURSE_NAMESPACE="com.es.disped.dao.mapper.course.CourseCustomMapper"; + private final String LEVEL_NAMESPACE="com.es.disped.dao.mapper.level.LevelCustomMapper"; + private final String TEMPLATE_NAMESPACE="com.es.disped.dao.mapper.template.TemplateCustomMapper"; + + @Autowired + CourseTemplateService courseTemplateService; + + @ApiOperation(value="保存课程模板",response=MsgModel.class,httpMethod="POST",notes="保存课程模板") + @RequiresPermissions(value={"admin:save","sys:save"},logical=Logical.OR) + @Transactional + @RequestMapping(value="/save",method=RequestMethod.POST) + public @ResponseBody MsgModel save(@RequestBody @ApiParam(name="courseTemplate",value="课程模板对象",required=true) CourseTemplate courseTemplate) + { + int count=0; + if(Optional.of(courseTemplate) + .filter(templateName->courseTemplate.getTemplateName()!=null) + .filter(courseId->courseTemplate.getCourseId()!=null) + .filter(levelId->courseTemplate.getLevelId()!=null) + .filter(minAge->courseTemplate.getMinAge()!=null) + .filter(maxAge->courseTemplate.getMaxAge()!=null) + .filter(type->courseTemplate.getCourseType()!=null) + .filter(book->courseTemplate.getCourseBook()!=null) + .isPresent()) + { + courseTemplate.setTemplateId(getUUID()); + CourseForeignModel courseForeignModel=this.getService().selectOne( + COURSE_NAMESPACE+".getCourseForeignModel", courseTemplate.getCourseId()); + courseTemplate.setCourseName(courseForeignModel.getCourseName()); + LevelForeignModel levelForeignModel=this.getService().selectOne( + LEVEL_NAMESPACE+".getLevelForeignModel",courseTemplate.getLevelId()); + courseTemplate.setLevelName(levelForeignModel.getLevelName()); + courseTemplate.setCourseValid(RecordStatus.USEAGE.getValue()); + count=courseTemplateService.insertSelective(courseTemplate); + } + return this.resultMsg(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"保存成功":"保存失败",count==1?courseTemplate:""); + } + + @ApiOperation(value="更新课程模板",response=MsgModel.class,httpMethod="POST",notes="更新课程模板") + @RequiresPermissions(value={"admin:update","sys:update"},logical=Logical.OR) + @Transactional + @RequestMapping(value="/update",method=RequestMethod.POST) + public @ResponseBody MsgModel update(@RequestBody @ApiParam(name="courseTemplate",value="课程模板对象",required=true) CourseTemplate courseTemplate) + { + int count=0; + if(!this.isNull(courseTemplate.getTemplateId())) + { + if(!this.isNull(courseTemplate.getCourseId())) + { + CourseForeignModel courseForeignModel=this.getService().selectOne( + COURSE_NAMESPACE+".getCourseForeignModel", courseTemplate.getCourseId()); + courseTemplate.setCourseName(courseForeignModel.getCourseName()); + } + if(!this.isNull(courseTemplate.getLevelId())) + { + LevelForeignModel levelForeignModel=this.getService().selectOne( + LEVEL_NAMESPACE+".getLevelForeignModel",courseTemplate.getLevelId()); + courseTemplate.setLevelName(levelForeignModel.getLevelName()); + } + count=courseTemplateService.updateByPrimaryKeySelective(courseTemplate); + } + return this.resultMsg(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"更新成功":"更新失败",count==1?courseTemplate:""); + } + + @ApiOperation(value="删除课程模板",response=MsgModel.class,httpMethod="POST",notes="删除课程模板") + @RequiresPermissions(value={"admin:delete","sys:delete"},logical=Logical.OR) + @RequestMapping(value="/delete",method=RequestMethod.POST) + public @ResponseBody MsgModel delete(@RequestBody @ApiParam(name="courseTemplate",value="课程模板对象",required=true) CourseTemplate courseTemplate) + { + int count=0; + if(!this.isNull(courseTemplate.getTemplateId())) + { + count=this.getService().delete(TEMPLATE_NAMESPACE+".deleteTemplateModel", courseTemplate.getTemplateId()); + } + return this.resultMsg(count>=1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count>=1?"删除成功":"删除失败",count>=1?courseTemplate:""); + } + + + @ApiOperation(value="检索课程模板",response=MsgModel.class,httpMethod="POST",notes="检索课程模板") + @RequestMapping(value="/list",method=RequestMethod.POST) + public @ResponseBody MsgModel list(@RequestBody @ApiParam(name="courseTemplate",value="课程模板对象",required=false) CourseTemplate courseTemplate) + { + CourseTemplateExample listExample=new CourseTemplateExample(); + CourseTemplateExample.Criteria criteria=listExample.createCriteria(); + if(!this.isNull(courseTemplate.getTemplateId())) + { + criteria.andTemplateIdEqualTo(courseTemplate.getTemplateId()); + } + if(!this.isNull(courseTemplate.getTemplateName())) + { + criteria.andTemplateNameEqualTo(courseTemplate.getTemplateName()); + } + if(!this.isNull(courseTemplate.getCourseId())) + { + criteria.andCourseIdEqualTo(courseTemplate.getCourseId()); + } + if(!this.isNull(courseTemplate.getCourseName())) + { + criteria.andCourseNameLike("%"+courseTemplate.getCourseName()+"%"); + } + if(!this.isNull(courseTemplate.getLevelId())) + { + criteria.andLevelIdEqualTo(courseTemplate.getLevelId()); + } + if(!this.isNull(courseTemplate.getLevelName())) + { + criteria.andLevelNameLike("%"+courseTemplate.getLevelName()+"%"); + } + if(!this.isNull(courseTemplate.getMinAge())) + { + criteria.andMinAgeGreaterThanOrEqualTo(courseTemplate.getMinAge()); + } + if(!this.isNull(courseTemplate.getMaxAge())) + { + criteria.andMaxAgeLessThanOrEqualTo(courseTemplate.getMaxAge()); + } + if(!this.isNull(courseTemplate.getCourseType())) + { + criteria.andCourseTypeLike("%"+courseTemplate.getCourseType()+"%"); + } + List courseTemplates=courseTemplateService.selectByExample(listExample); + return this.resultMsg(!this.isNull(courseTemplates)?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + !this.isNull(courseTemplates)?"课程模板加载成功":"课程模板加载失败",!this.isNull(courseTemplates)?courseTemplates:""); + } + + + @ApiOperation(value="课程模板分页加载",response=MsgModel.class,httpMethod="POST",notes="课程模板分页加载,分页参数[offset,limit]") + @RequestMapping(value="/pages",method=RequestMethod.POST) + public @ResponseBody MsgModel pages(@RequestBody @ApiParam(name="paramMap",value="分页参数[offset,limit]",required=true) Map paramMap) + { + CourseTemplateExample listExample=new CourseTemplateExample(); + PageModel pageModel=null; + if(Optional.of(paramMap) + .filter(offset->paramMap.containsKey("offset")!=false) + .filter(limit->paramMap.containsKey("limit")!=false) + .isPresent()) + { + pageModel=courseTemplateService.selectByExampleForOffsetPage(listExample, + Integer.valueOf(paramMap.get("offset").toString()), Integer.valueOf(paramMap.get("limit").toString())); + } + return this.resultMsg(!this.isNull(pageModel)?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + !this.isNull(pageModel)?"课程加载成功":"课程加载失败",!this.isNull(pageModel)?pageModel:""); + } +} diff --git a/src/main/java/com/es/disped/web/controller/homework/HomeworkController.java b/src/main/java/com/es/disped/web/controller/homework/HomeworkController.java new file mode 100644 index 0000000000000000000000000000000000000000..c4cc3076b089cb1386a3a2fd50bf669c3ef6e31b --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/homework/HomeworkController.java @@ -0,0 +1,161 @@ +//package com.es.disped.web.controller.homework; +// +//import java.util.List; +//import java.util.Map; +//import java.util.Optional; +// +//import org.apache.shiro.authz.annotation.Logical; +//import org.apache.shiro.authz.annotation.RequiresPermissions; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.http.HttpStatus; +//import org.springframework.stereotype.Controller; +//import org.springframework.transaction.annotation.Transactional; +//import org.springframework.web.bind.annotation.RequestBody; +//import org.springframework.web.bind.annotation.RequestMapping; +//import org.springframework.web.bind.annotation.RequestMethod; +//import org.springframework.web.bind.annotation.ResponseBody; +// +//import com.es.disped.api.homework.HomeworkService; +//import com.es.disped.common.constant.RecordStatus; +//import com.es.disped.common.model.MsgModel; +//import com.es.disped.common.model.PageModel; +//import com.es.disped.core.controller.BaseController; +//import com.es.disped.dao.model.Homework; +//import com.es.disped.dao.model.HomeworkExample; +//import com.es.disped.dao.model.LessonForeignModel; +// +//import io.swagger.annotations.Api; +//import io.swagger.annotations.ApiOperation; +//import io.swagger.annotations.ApiParam; +// +///** +// * @author Anson
+// * Copyright by EasyShare 2019
+// * +// * All right reserved
+// * +// * Created on 2019年7月7日 下午12:01:59
+// * 名称:HomeworkController.java
+// * 描述:作业管理
+// */ +//@Api(value="作业管理") +//@Controller +//@RequestMapping("/manage/homework") +//public class HomeworkController extends BaseController{ +// +// private final String LESSON_NAMESPACE="com.es.disped.dao.mapper.lesson.LessonCustomMapper"; +// +// private final String HOMEWORK_NAMESPACE="com.es.disped.dao.mapper.homework.HomeworkCustomMapper"; +// +// @Autowired +// HomeworkService homeworkService; +// +// @ApiOperation(value="保存作业对象",response=MsgModel.class,httpMethod="POST",notes="保存作业对象") +// @RequiresPermissions(value={"admin:save","sys:save"},logical=Logical.OR) +// @Transactional +// @RequestMapping(value="/save",method=RequestMethod.POST) +// public @ResponseBody MsgModel save(@RequestBody @ApiParam(name="homework",value="作业对象",required=true) Homework homework) +// { +// int count=0; +// if(Optional.of(homework) +// .filter(name->homework.getHomeworkName()!=null) +// .filter(content->homework.getHomeworkContent()!=null) +// .filter(lId->homework.getLessonId()!=null) +// .filter(url->homework.getHomeWorkUrl()!=null) +// .isPresent()) +// { +// LessonForeignModel foreignModel=this.getService().selectOne(LESSON_NAMESPACE+".getLessonForeignModel", homework.getLessonId()); +// homework.setLessonName(foreignModel.getLessonName()); +// homework.setHomeworkId(getUUID()); +// homework.setHomeworkUpdateTime(this.currentDate("yyyy-MM-dd")); +// homework.setHomeworkValid(RecordStatus.USEAGE.getValue()); +// count=homeworkService.insertSelective(homework); +// } +// return this.resultMsg(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), +// count==1?"保存成功":"保存失败", count==1?homework:""); +// } +// +// @ApiOperation(value="更新作业对象",response=MsgModel.class,httpMethod="POST",notes="更新作业对象") +// @RequiresPermissions(value={"admin:update","sys:update"},logical=Logical.OR) +// @Transactional +// @RequestMapping(value="/update",method=RequestMethod.POST) +// public @ResponseBody MsgModel update(@RequestBody @ApiParam(name="homework",value="作业对象",required=true) Homework homework) +// { +// int count=0; +// if(!this.isNull(homework.getHomeworkId())) +// { +// if(!this.isNull(homework.getLessonId())) +// { +// LessonForeignModel foreignModel=this.getService().selectOne(LESSON_NAMESPACE+".getLessonForeignModel", homework.getLessonId()); +// homework.setLessonName(foreignModel.getLessonName()); +// } +// homework.setHomeworkUpdateTime(this.currentDate("yyyy-MM-dd")); +// count=homeworkService.updateByPrimaryKeySelective(homework); +// } +// return this.resultMsg(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), +// count==1?"更新成功":"更新失败", count==1?homework:""); +// } +// +// @ApiOperation(value="删除作业对象",response=MsgModel.class,httpMethod="POST",notes="删除作业对象") +// @RequiresPermissions(value={"admin:delete","sys:delete"},logical=Logical.OR) +// @RequestMapping(value="/delete",method=RequestMethod.POST) +// public @ResponseBody MsgModel delete(@RequestBody @ApiParam(name="homework",value="作业对象",required=true) Homework homework) +// { +// int count=0; +// if(!this.isNull(homework.getHomeworkId())) +// { +// count=this.getService().delete(HOMEWORK_NAMESPACE+".deleteHomeworkModel", homework.getHomeworkId()); +// } +// return this.resultMsg(count>=1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), +// count>=1?"删除成功":"删除失败", count>=1?homework:""); +// } +// +// @ApiOperation(value="检索作业",response=MsgModel.class,httpMethod="POST", +// notes="检索作业对象,精确检索:作业ID,课时ID;模糊检索:作业名称,课时名称") +// @RequiresPermissions(value={"admin:select","sys:select"},logical=Logical.OR) +// @RequestMapping(value="/list",method=RequestMethod.POST) +// public @ResponseBody MsgModel list(@RequestBody @ApiParam(name="homework",value="作业对象",required=false) Homework homework) +// { +// HomeworkExample listExample=new HomeworkExample(); +// HomeworkExample.Criteria criteria=listExample.createCriteria(); +// if(!this.isNull(homework.getHomeworkId())) +// { +// criteria.andHomeworkIdEqualTo(homework.getHomeworkId()); +// } +// if(!this.isNull(homework.getLessonId())) +// { +// criteria.andLessonIdEqualTo(homework.getLessonId()); +// } +// if(!this.isNull(homework.getHomeworkName())) +// { +// criteria.andHomeworkNameLike("%"+homework.getHomeworkName()+"%"); +// } +// if(!this.isNull(homework.getLessonName())) +// { +// criteria.andLessonNameLike("%"+homework.getLessonName()+"%"); +// } +// List list=homeworkService.selectByExample(listExample); +// return this.resultMsg(!this.isNull(list)?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), +// !this.isNull(list)?"作业列表加载成功":"作业列表加载失败",!this.isNull(list)?list:""); +// } +// +// @ApiOperation(value="分页加载作业",response=MsgModel.class,httpMethod="POST",notes="分页加载作业,分页参数['offset','limit']") +// @RequiresPermissions(value={"admin:select","sys:select"},logical=Logical.OR) +// @RequestMapping(value="/pages",method=RequestMethod.POST) +// public @ResponseBody MsgModel pages(@RequestBody @ApiParam(name="paramMap",value="分页参数[offset,limit]",required=true) Map paramMap) +// { +// HomeworkExample listExample=new HomeworkExample(); +// PageModel pageModel=null; +// if(Optional.of(paramMap) +// .filter(offset->paramMap.containsKey("offset")!=false) +// .filter(limit->paramMap.containsKey("limit")!=false) +// .isPresent()) +// { +// pageModel=homeworkService.selectByExampleForOffsetPage(listExample, +// Integer.valueOf(paramMap.get("offset").toString()), Integer.valueOf(paramMap.get("limit").toString())); +// +// } +// return this.resultMsg(!this.isNull(pageModel)?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), +// !this.isNull(pageModel)?"作业加载成功":"作业加载失败",!this.isNull(pageModel)?pageModel:""); +// } +//} diff --git a/src/main/java/com/es/disped/web/controller/index/IndexController.java b/src/main/java/com/es/disped/web/controller/index/IndexController.java new file mode 100644 index 0000000000000000000000000000000000000000..de5996030e0b073865c452e761ea4bc8246da9b2 --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/index/IndexController.java @@ -0,0 +1,172 @@ +package com.es.disped.web.controller.index; + +import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.shiro.SecurityUtils; +import org.apache.shiro.subject.Subject; +import org.dom4j.Document; +import org.dom4j.DocumentException; +import org.dom4j.Element; +import org.dom4j.io.SAXReader; +import org.slf4j.Logger; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.es.disped.common.model.MsgModel; +import com.es.disped.core.annotation.LogInject; +import com.es.disped.core.controller.BaseController; +import com.es.disped.dao.model.LoginUser; +import com.es.disped.dao.model.MenuModel; +import com.es.disped.dao.model.UserType; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; + +@Api(value="首页") +@Controller +public class IndexController extends BaseController{ + + private final String NAMESPACE="com.es.disped.dao.mapper.index.IndexCustomMapper"; + + @LogInject + private static Logger log; + + /** + * 跳转到登录页
+ * + * @return String 登录页路径 + */ + @RequestMapping("/sign") + public String login() + { + if (this.isNull(this.getSessionUser())) + { + return "login"; + } else + { + return "redirect:/"; + } + } + + /** + * 跳转错误页(包含404、500等一系列错误页)
+ * + * @return String 错误页路径 + */ + @RequestMapping("/{errorCode}/error") + public @ResponseBody MsgModel error(@PathVariable String errorCode) + { + System.out.println(errorCode); + return new MsgModel(Integer.valueOf(errorCode),"error"); + } + + /** + * 获取系统菜单
+ * + * @return List 菜单列表集合 + */ + @ApiOperation(value="获取系统菜单",response=MsgModel.class,httpMethod="POST",notes="登录用户获取当前用户对应角色的系统菜单") + @ApiImplicitParam(name="roleId",value="当前登录用户的角色ID",required=false,dataType="String") + @RequestMapping(value="/init/menu",method=RequestMethod.POST) + public @ResponseBody MsgModel menu(String roleId) { + if (UserType.ADMIN.getValue().equals(this.getSessionUser().getUserType())) + { + // 管理员菜单(在系统 xml 中配置) + return getMenuForXml(); + } else + { + // 一般用户菜单 general(根据角色获取对应菜单列表) + if(this.isNull(roleId)) + { + Subject subject = SecurityUtils.getSubject(); + LoginUser loginUser=(LoginUser) subject.getPrincipal(); + if(!this.isNull(loginUser.getUserRoles())) + { + roleId=loginUser.getUserRoles().get(0).getRoleId(); + } + } + Map paramMap = new HashMap<>(); + paramMap.put("menuId", "00000000000000000000000000000000"); + paramMap.put("roleId", roleId); + paramMap.put("userId", this.getSessionUser().getUserId()); + + List list = new ArrayList<>(); + List rootList = this.getService().selectList(NAMESPACE+".getMenu", paramMap); + for (MenuModel menuModel : rootList) { + menuModel.setChildren(getMenu(menuModel.getId(), roleId)); + list.add(menuModel); + } + return this.resultMsg(list.size()>0?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + list.size()>0?"":"系统菜单获取失败", list.size()>0?list:""); + } + } + + /** + * 递归获取当前登录用户的所有菜单信息
+ * + * @param pid 菜单父ID + * @return List 菜单列表集合 + */ + private List getMenu(String pid, String roleId) { + Map paramMap = new HashMap<>(); + paramMap.put("menuId", pid); + paramMap.put("roleId", roleId); + paramMap.put("userId", this.getSessionUser().getUserId()); + + List list = new ArrayList<>(); + List menuList = this.getService().selectList(NAMESPACE+".getMenu", paramMap); + for (MenuModel menuModel : menuList) { + if (!this.isNull(menuModel.getId())) { + menuModel.setChildren(getMenu(menuModel.getId(), roleId)); + } + list.add(menuModel); + } + return list; + } + + + /** + * 从 xml 中读取管理员菜单(adminMenu.xml)
+ * + * @return List 菜单列表集合 + */ + @SuppressWarnings("unchecked") + private MsgModel getMenuForXml() { + List list = new ArrayList<>(); + try { + InputStream inputStream = this.getClass().getResourceAsStream("/adminMenu.xml"); + SAXReader reader = new SAXReader(); + Document document = reader.read(inputStream); + Element element = document.getRootElement(); + List menus = element.elements(); + for(Element menu : menus) { + MenuModel menuModelParent = new MenuModel(); + List childList = new ArrayList<>(); + menuModelParent.setName(menu.attributeValue("name")); + menuModelParent.setIcon(this.isNull(menu.attributeValue("icon")) ? "zmdi zmdi-apps" : menu.attributeValue("icon")); + List menuItems = menu.elements(); + for (Element menuItem : menuItems) { + MenuModel menuModelChild = new MenuModel(); + menuModelChild.setName(menuItem.elementText("name")); + menuModelChild.setUrl(menuItem.elementText("url")); + childList.add(menuModelChild); + } + menuModelParent.setChildren(childList); + list.add(menuModelParent); + } + } catch (DocumentException e) { + log.error("读取 xml 菜单信息失败"); + } + return this.resultMsg(list.size()>0?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + list.size()>0?"":"管理员菜单加载失败", list.size()>0?list:""); + } +} diff --git a/src/main/java/com/es/disped/web/controller/lesson/LessonController.java b/src/main/java/com/es/disped/web/controller/lesson/LessonController.java new file mode 100644 index 0000000000000000000000000000000000000000..2d473dde47458fc552b75249ceb05bf75082bc73 --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/lesson/LessonController.java @@ -0,0 +1,177 @@ +package com.es.disped.web.controller.lesson; + +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.apache.shiro.authz.annotation.Logical; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.es.disped.api.lesson.LessonService; +import com.es.disped.common.constant.RecordStatus; +import com.es.disped.common.model.MsgModel; +import com.es.disped.common.model.PageModel; +import com.es.disped.core.controller.BaseController; +import com.es.disped.dao.model.Lesson; +import com.es.disped.dao.model.LessonExample; +import com.es.disped.dao.model.SyllabusForeignModel; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; + +/** + * @author Anson
+ * Copyright by EasyShare 2019
+ * + * All right reserved
+ * + * Created on 2019年7月5日 下午4:41:01
+ * 名称:LessonController.java
+ * 描述:课时管理
+ */ +@Api(value="课时管理") +@Controller +@RequestMapping("/manage/lesson") +public class LessonController extends BaseController{ + + private final String SYLLABUS_NAMESPACE="com.es.disped.dao.mapper.syllabus.SyllabusCustomMapper"; + private final String LESSON_NAMESPACE="com.es.disped.dao.mapper.lesson.LessonCustomMapper"; + + @Autowired + LessonService lessonService; + + @ApiOperation(value="新增课时",response=MsgModel.class,httpMethod="POST",notes="新增课时对象") + @RequiresPermissions(value={"admin:save","sys:save"},logical=Logical.OR) + @Transactional + @RequestMapping(value="/save",method=RequestMethod.POST) + public @ResponseBody MsgModel save(@RequestBody @ApiParam(name="lesson",value="课时对象",required=true) Lesson lesson) + { + int count=0; + if(Optional.of(lesson) + .filter(lname->lesson.getLessonName()!=null) + .filter(syId->lesson.getSyllabusId()!=null) + .filter(content->lesson.getLessonContent()!=null) + .filter(btime->lesson.getLessonBeginTime()!=null) + .filter(etime->lesson.getLessonEndTime()!=null) + .isPresent()) + { + lesson.setLessonId(getUUID()); + SyllabusForeignModel syllabusForeignModel=this.getService().selectOne( + SYLLABUS_NAMESPACE+".getSyllabusForeignModel", lesson.getSyllabusId()); + lesson.setSyllabusName(syllabusForeignModel.getSyllabusName()); + + LessonExample countExample=new LessonExample(); + LessonExample.Criteria criteria=countExample.createCriteria(); + criteria.andSyllabusIdEqualTo(lesson.getSyllabusId()).andLessonValidEqualTo(RecordStatus.USEAGE.getValue()); + int total=lessonService.countByExample(countExample); + lesson.setLessonIndex(total+1); + + lesson.setLessonValid(RecordStatus.USEAGE.getValue()); + count=lessonService.insertSelective(lesson); + } + return this.resultMsg(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"保存成功":"保存失败",count==1?lesson:""); + } + + + @ApiOperation(value="更新课时",response=MsgModel.class,httpMethod="POST",notes="更新课时对象") + @RequiresPermissions(value={"admin:update","sys:update"},logical=Logical.OR) + @Transactional + @RequestMapping(value="/update",method=RequestMethod.POST) + public @ResponseBody MsgModel update(@RequestBody @ApiParam(name="lesson",value="课时对象",required=true) Lesson lesson) + { + int count=0; + if(!this.isNull(lesson.getLessonId())) + { + if(!this.isNull(lesson.getSyllabusId())) + { + SyllabusForeignModel syllabusForeignModel=this.getService().selectOne( + SYLLABUS_NAMESPACE+".getSyllabusForeignModel", lesson.getSyllabusId()); + lesson.setSyllabusName(syllabusForeignModel.getSyllabusName()); + } + count=lessonService.updateByPrimaryKey(lesson); + } + return this.resultMsg(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"更新成功":"更新失败",count==1?lesson:""); + } + + + @ApiOperation(value="删除课时",response=MsgModel.class,httpMethod="POST",notes="删除课时对象") + @RequiresPermissions(value={"admin:delete","sys:delete"},logical=Logical.OR) + @RequestMapping(value="/delete",method=RequestMethod.POST) + public @ResponseBody MsgModel delete(@RequestBody @ApiParam(name="lesson",value="课时对象",required=true) Lesson lesson) + { + int count=0; + if(!this.isNull(lesson.getLessonId())) + { + count=this.getService().delete(LESSON_NAMESPACE+".deleteLessonModel", lesson.getLessonId()); + } + return this.resultMsg(count>=1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count>=1?"删除成功":"删除失败",count>=1?lesson:""); + } + + @ApiOperation(value="检索课时",response=MsgModel.class,httpMethod="POST", + notes="检索课时对象,精确检索:课时ID,教学计划ID;模糊检索:教学大纲名称,课时名称,课时开始时间+结束时间") + @RequestMapping(value="/list",method=RequestMethod.POST) + public @ResponseBody MsgModel list(@RequestBody @ApiParam(name="lesson",value="课时对象",required=false) Lesson lesson) + { + LessonExample listExample=new LessonExample(); + LessonExample.Criteria criteria=listExample.createCriteria(); + if(!this.isNull(lesson.getLessonId())) + { + criteria.andLessonIdEqualTo(lesson.getLessonId()); + } + if(!this.isNull(lesson.getSyllabusId())) + { + criteria.andSyllabusIdEqualTo(lesson.getSyllabusId()); + } + if(!this.isNull(lesson.getSyllabusName())) + { + criteria.andSyllabusNameLike("%"+lesson.getSyllabusName()+"%"); + } + if(!this.isNull(lesson.getLessonName())) + { + criteria.andLessonNameLike("%"+lesson.getLessonName()+"%"); + } + if(!this.isNull(lesson.getLessonBeginTime())) + { + criteria.andLessonBeginTimeGreaterThanOrEqualTo(lesson.getLessonBeginTime()); + } + if(!this.isNull(lesson.getLessonEndTime())) + { + criteria.andLessonEndTimeLessThanOrEqualTo(lesson.getLessonEndTime()); + } + List list=lessonService.selectByExample(listExample); + return this.resultMsg(!this.isNull(list)?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + !this.isNull(list)?"课时列表加载成功":"课时列表加载失败",!this.isNull(list)?list:""); + } + + + @ApiOperation(value="分页加载课时",response=MsgModel.class,httpMethod="POST",notes="分页加载课时,分页参数['offset','limit']") + @RequestMapping(value="/pages",method=RequestMethod.POST) + public @ResponseBody MsgModel pages(@RequestBody @ApiParam(name="paramMap",value="分页参数[offset,limit]",required=true) Map paramMap) + { + LessonExample listExample=new LessonExample(); + PageModel pageModel=null; + if(Optional.of(paramMap) + .filter(offset->paramMap.containsKey("offset")!=false) + .filter(limit->paramMap.containsKey("limit")!=false) + .isPresent()) + { + pageModel=lessonService.selectByExampleForOffsetPage(listExample, + Integer.valueOf(paramMap.get("offset").toString()), Integer.valueOf(paramMap.get("limit").toString())); + + } + return this.resultMsg(!this.isNull(pageModel)?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + !this.isNull(pageModel)?"课时加载成功":"课时加载失败",!this.isNull(pageModel)?pageModel:""); + } +} diff --git a/src/main/java/com/es/disped/web/controller/level/LevelController.java b/src/main/java/com/es/disped/web/controller/level/LevelController.java new file mode 100644 index 0000000000000000000000000000000000000000..65270e95bd01353d05758adcf6d211b029fd5696 --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/level/LevelController.java @@ -0,0 +1,129 @@ +package com.es.disped.web.controller.level; + +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.es.disped.api.level.LevelService; +import com.es.disped.common.constant.RecordStatus; +import com.es.disped.common.model.MsgModel; +import com.es.disped.common.model.PageModel; +import com.es.disped.core.controller.BaseController; +import com.es.disped.dao.model.Level; +import com.es.disped.dao.model.LevelExample; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; + +@Api(value="等级阶段管理") +@Controller +@RequestMapping("/manage/level") +public class LevelController extends BaseController { + + @Autowired + LevelService levelService; + + @ApiOperation(value="保存等级",response=MsgModel.class,httpMethod="POST", + notes="保存等级对象,等级名称不能为空") + @RequiresPermissions(value="sys:save") + @RequestMapping(value="/save",method=RequestMethod.POST) + public @ResponseBody MsgModel save(@RequestBody @ApiParam(name="level",value="等级对象",required=true) Level level) + { + int count=0; + if(Optional.of(level) + .filter(name->level.getLevelName()!=null) + .isPresent()) + { + level.setLevelId(this.getUUID()); + level.setLevelValid(RecordStatus.USEAGE.getValue()); + count=levelService.insertSelective(level); + } + return new MsgModel(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"保存成功":"保存失败", count==1?level:"") ; + } + + @ApiOperation(value="更新等级",response=MsgModel.class,httpMethod="POST", + notes="更新等级对象,等级ID不能为空") + @RequiresPermissions(value="sys:update") + @RequestMapping(value="/update",method=RequestMethod.POST) + public @ResponseBody MsgModel update(@RequestBody @ApiParam(name="level",value="等级对象",required=true) Level level) + { + int count=0; + if(Optional.of(level) + .filter(name->level.getLevelId()!=null) + .isPresent()) + { + count=levelService.updateByPrimaryKey(level); + } + return new MsgModel(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"更新成功":"更新失败", count==1?level:"") ; + } + + @ApiOperation(value="删除等级",response=MsgModel.class,httpMethod="POST", + notes="删除等级对象,等级ID不能为空") + @RequiresPermissions(value="sys:delete") + @RequestMapping(value="/delete",method=RequestMethod.POST) + public @ResponseBody MsgModel delete(@RequestBody @ApiParam(name="level",value="等级对象",required=true) Level level) + { + int count=0; + if(Optional.of(level) + .filter(name->level.getLevelId()!=null) + .isPresent()) + { + count=levelService.deleteByPrimaryKey(level.getLevelId()); + } + return new MsgModel(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"删除成功":"删除失败", count==1?level:"") ; + } + + @ApiOperation(value="检索等级",response=MsgModel.class,httpMethod="POST",notes="检索等级,包括模糊检索(等级名称,等级描述),精确检索(等级ID)") + @RequestMapping(value="/list",method=RequestMethod.POST) + public @ResponseBody MsgModel list(@RequestBody @ApiParam(name="level",value="等级对象",required=false) Level level) + { + LevelExample listExample=new LevelExample(); + if(!this.isNull(level.getLevelId())) + { + listExample.createCriteria().andLevelIdEqualTo(level.getLevelId()); + } + if(!this.isNull(level.getLevelName())) + { + listExample.createCriteria().andLevelNameLike("%"+level.getLevelName()+"%"); + } + if(!this.isNull(level.getLevelDescription())) + { + listExample.createCriteria().andLevelDescriptionLike("%"+level.getLevelDescription()+"%"); + } + List levels=levelService.selectByExample(listExample); + return this.resultMsg(!this.isNull(levels)?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + !this.isNull(levels)?"等级列表加载成功":"等级列表为空", !this.isNull(levels)?levels:""); + } + + + @ApiOperation(value="获取等级列表",httpMethod="POST",response=MsgModel.class,notes="获取等级信息(管理端),分页加载") + @RequestMapping(value="/pages",method=RequestMethod.POST) + public @ResponseBody MsgModel pages(@RequestBody @ApiParam(name="paramMap",value="分页参数[offset,limit]",required=true) Map paramMap) + { + LevelExample pageExample=new LevelExample(); + PageModel pageModel=null; + if(Optional.of(paramMap) + .filter(offset->paramMap.containsKey("offset")!=false) + .filter(limit->paramMap.containsKey("limit")!=false) + .isPresent()) + { + pageModel=levelService.selectByExampleForOffsetPage(pageExample, + Integer.valueOf(paramMap.get("offset").toString()), Integer.valueOf(paramMap.get("limit").toString())); + } + return this.resultMsg(pageModel!=null?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + pageModel!=null?"等级列表加载成功":"等级列表为空", pageModel!=null?pageModel:""); + } +} diff --git a/src/main/java/com/es/disped/web/controller/login/LoginController.java b/src/main/java/com/es/disped/web/controller/login/LoginController.java new file mode 100644 index 0000000000000000000000000000000000000000..e536e8dd6b1b17e18d2d9a588e134f34847c3d67 --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/login/LoginController.java @@ -0,0 +1,148 @@ +package com.es.disped.web.controller.login; + +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.apache.shiro.SecurityUtils; +import org.apache.shiro.authc.AuthenticationException; +import org.apache.shiro.authc.UsernamePasswordToken; +import org.apache.shiro.subject.Subject; +import org.slf4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.es.disped.api.sms.SmsService; +import com.es.disped.api.user.UserService; +import com.es.disped.common.constant.RecordStatus; +import com.es.disped.common.model.MsgModel; +import com.es.disped.core.annotation.LogInject; +import com.es.disped.core.controller.BaseController; +import com.es.disped.dao.model.LoginUser; +import com.es.disped.dao.model.User; +import com.es.disped.dao.model.UserExample; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; + +@Api("用户登录注册接口") +@Controller +@RequestMapping("/common/login") +public class LoginController extends BaseController{ + + @LogInject + Logger log; + @Autowired + SmsService smsService; + @Autowired + UserService userService; + @Autowired + RedisTemplate redisTemplate; + + + @ApiOperation(value="验证手机号",httpMethod="POST",response=MsgModel.class,notes="检查手机号是否被注册") + @ApiImplicitParam(name="phone",value="手机号",required=true,dataType="String") + @RequestMapping(value="/check/phone",method=RequestMethod.POST) + public @ResponseBody MsgModel checkPhone(@RequestBody Map paramMap) + { + UserExample userExample=new UserExample(); + userExample.createCriteria().andPhoneEqualTo(paramMap.get("phone").toString()); + List users=userService.selectByExample(userExample); + return new MsgModel(this.isNull(users)?HttpStatus.OK.value():HttpStatus.NOT_ACCEPTABLE.value(), + this.isNull(users)?"":"手机号已被注册"); + } + + + + @ApiOperation(value="注册",httpMethod="POST",response=MsgModel.class,notes="实现用户信息注册(个人注册)") + @RequestMapping(value="/registe", method=RequestMethod.POST) + public @ResponseBody MsgModel registe(@RequestBody @ApiParam(name="user", value="用户对象",required=true) User user) + { + int count=0; + if(Optional.of(user) + .filter((username)->user.getUsername()!=null) + .filter((phone)->user.getPhone()!=null) + .filter((password)->user.getPassword()!=null) + .isPresent() + &&redisTemplate.hasKey(user.getPhone()))//防止用户替换手机号 + { + user.setUserId(getUUID()); + user.setPassword(this.md5(user.getPassword())); + user.setJoinDate(this.currentDate("yyyy-MM-dd HH:mm:ss")); + user.setUserValid(RecordStatus.VERTIFY.getValue()); + count=userService.insert(user); + } + //无论注册是否成功,删除验证码 + redisTemplate.delete(user.getPhone()); + //无论是否成功,保存用户ID + this.getSession().setAttribute("registeUser", user); + log.debug(count==1?HttpStatus.OK.value()+"-注册成功":HttpStatus.EXPECTATION_FAILED.value()+"-注册失败",user); + return new MsgModel(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(),count==1?"注册成功":"注册失败"); + } + + + @ApiOperation(value="登录",httpMethod="POST", response=MsgModel.class,notes="根据用户名密码实现用户登录") + @ApiImplicitParam(name="paramMap",value="登录",required=true,dataType="HashMap") + @RequestMapping(value="/sign/in", method=RequestMethod.POST) + public @ResponseBody MsgModel login(@RequestBody Map paramMap) + { + paramMap.put("password", this.md5(paramMap.get("password").toString())); + LoginUser loginUser = this.getService().selectOne( + "com.es.disped.dao.mapper.login.LoginCustomMapper.getLoginUser", + paramMap.get("phone").toString()); + if (this.isNull(loginUser)) + { + return new MsgModel(HttpStatus.FORBIDDEN.value(), "用户名、密码不正确!"); + } + + if (RecordStatus.USEAGE.getValue()!=loginUser.getUserValid()) + { + return new MsgModel(HttpStatus.FORBIDDEN.value(), "该用户"+RecordStatus.getName(loginUser.getUserValid())); + } + try + { + Subject subject = SecurityUtils.getSubject(); + // 当前用户是否已通过身份验证 + if (!subject.isAuthenticated()) + { + + UsernamePasswordToken token = new UsernamePasswordToken(paramMap.get("phone").toString(), + paramMap.get("password").toString()); + + token.setRememberMe(Boolean.valueOf(paramMap.get("remember").toString())); + //验证角色和权限 + subject.login(token); + this.getSession().setAttribute(this.sessionUser, loginUser); + } + return new MsgModel(HttpStatus.OK.value(), paramMap.get("remember").toString(),loginUser); + } catch (AuthenticationException e) { + e.printStackTrace(); + return new MsgModel(HttpStatus.EXPECTATION_FAILED.value(), "登录认证失败"); + } + } + + + + @ApiOperation(value="退出登录",httpMethod="GET",response=MsgModel.class,notes="退出登录") + @RequestMapping(value="/sign/out",method=RequestMethod.GET) + public @ResponseBody MsgModel logout() + { + Subject subject = SecurityUtils.getSubject(); + LoginUser loginUser=(LoginUser) subject.getPrincipal(); + System.out.println(">>>>>>>>>>>logout>>>>>>>>>>>"+loginUser); + if(subject.isAuthenticated()) + { + subject.logout(); + this.getSession().invalidate(); + } + return new MsgModel(HttpStatus.OK.value(), "退出"); + } +} diff --git a/src/main/java/com/es/disped/web/controller/menu/MenuController.java b/src/main/java/com/es/disped/web/controller/menu/MenuController.java new file mode 100644 index 0000000000000000000000000000000000000000..6f3ac4bada1ac78550100538198b8c6fe02a80a6 --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/menu/MenuController.java @@ -0,0 +1,160 @@ +package com.es.disped.web.controller.menu; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +import org.apache.shiro.authz.annotation.Logical; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.es.disped.api.menu.MenuService; +import com.es.disped.api.menurole.MenuRoleService; +import com.es.disped.common.constant.RecordStatus; +import com.es.disped.common.model.MsgModel; +import com.es.disped.core.controller.BaseController; +import com.es.disped.dao.model.Menu; +import com.es.disped.dao.model.MenuExample; +import com.es.disped.dao.model.MenuNode; +import com.es.disped.dao.model.MenuType; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; + +@Api(value="菜单管理") +@Controller +@RequestMapping("/manage/menu") +public class MenuController extends BaseController { + + private final String NAMESPACE="com.es.disped.dao.mapper.menu.MenuCustomMapper"; + + @Autowired + MenuService menuService; + @Autowired + MenuRoleService menuRoleService; + + @ApiOperation(value="菜单保存",response=MsgModel.class,httpMethod="POST",notes="保存菜单-管理端") + @RequiresPermissions(value= {"admin:save","sys:save"},logical=Logical.OR) + @Transactional + @RequestMapping(value="/save",method=RequestMethod.POST) + public @ResponseBody MsgModel save(@RequestBody @ApiParam(name="menu",value="菜单对象",required=true) Menu menu) + { + int count=0; + if(Optional.of(menu) + .filter(name->menu.getMenuName()!=null) + .filter(icon->menu.getMenuIcon()!=null) + .filter(parentId->menu.getMenuParentId()!=null) + .filter(url->menu.getMenuUrl()!=null) + .isPresent()) + { + //保存菜单 + menu.setMenuId(this.getUUID()); + menu.setMenuType(MenuType.MENU.getValue()); + menu.setMenuValid(RecordStatus.USEAGE.getValue()); + count=menuService.insertSelective(menu); + //更新菜单父节点 + Menu oldParentNode=menuService.selectByPrimaryKey(menu.getMenuParentId()); + if(MenuType.MENU.getValue().equals(oldParentNode.getMenuType())) + { + Menu parentNode=new Menu(); + parentNode.setMenuType(MenuType.GROUP.getValue()); + MenuExample menuExample=new MenuExample(); + menuExample.createCriteria().andMenuIdEqualTo(oldParentNode.getMenuId()); + menuService.updateByExampleSelective(parentNode, menuExample); + } + } + return new MsgModel(count!=0?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count!=0?"":"添加失败", count!=0?menu:""); + } + + @ApiOperation(value="菜单更新",response=MsgModel.class,httpMethod="POST",notes="菜单更新-管理端") + @RequiresPermissions(value= {"admin:update","sys:update"},logical=Logical.OR) + @RequestMapping(value="/update",method=RequestMethod.POST) + public @ResponseBody MsgModel update(@RequestBody @ApiParam(name="menu",value="菜单对象",required=true) Menu menu) + { + int count=0; + if(Optional.of(menu) + .filter(mid->menu.getMenuId()!=null) + .isPresent()) + { + count=menuService.updateByPrimaryKeySelective(menu); + } + return new MsgModel(count!=0?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count!=0?"":"更新失败", count!=0?menu:""); + } + + @ApiOperation(value="菜单删除",response=MsgModel.class,httpMethod="POST",notes="删除菜单-管理端") + @RequiresPermissions(value= {"admin:delete","sys:delete"},logical=Logical.OR) + @Transactional + @RequestMapping(value="/delete",method=RequestMethod.POST) + public @ResponseBody MsgModel delete(@RequestBody @ApiParam(name="menu",value="菜单对象",required=true) Menu menu) + { + int count=0; + if(Optional.of(menu) + .filter(mid->menu.getMenuId()!=null) + .filter(perantId->menu.getMenuParentId()!=null) + .isPresent()) + { + //删除菜单节点及子节点 + MenuExample deleteExample=new MenuExample(); + deleteExample.createCriteria().andMenuParentIdEqualTo(menu.getMenuId()); + count+=menuService.deleteByExample(deleteExample); + count+=menuService.deleteByPrimaryKey(menu.getMenuId()); + //修改父类节点类型 + MenuExample listExample=new MenuExample(); + listExample.createCriteria().andMenuParentIdEqualTo(menu.getMenuParentId()); + List list=menuService.selectByExample(listExample); + if(this.isNull(list)) + { + Menu parentNode=new Menu(); + parentNode.setMenuType(MenuType.MENU.getValue()); + MenuExample parentExample=new MenuExample(); + parentExample.createCriteria().andMenuIdEqualTo(menu.getMenuParentId()); + menuService.updateByExampleSelective(parentNode, parentExample); + } + } + return new MsgModel(count!=0?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count!=0?"":"删除失败", count!=0?menu:""); + } + + + @ApiOperation(value="获取Tree结构菜单",response=MsgModel.class,httpMethod="POST",notes="获取Tree结构菜单-管理端") + @ApiImplicitParam(name="id", value="菜单ID", required=false,dataType="String") + @RequestMapping(value="/menuTree",method=RequestMethod.POST) + public @ResponseBody MsgModel getMenuTree(String id) + { + if(this.isNull(id)) + { + id="00000000000000000000000000000000"; + } + List nodeList=new ArrayList(); + List rootList=this.getService().selectList(NAMESPACE+".getMenuNode", id); + for(MenuNode menuNode:rootList) + { + menuNode.setChildren(getMenuNode(menuNode.getId())); + nodeList.add(menuNode); + } + return new MsgModel(nodeList.size()>0?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + nodeList.size()>0?"":"获取菜单为空", nodeList.size()>0?nodeList:""); + } + + /** + * 菜单 tree 结构加载
+ * + * @param pid 菜单父ID + * @return List 菜单节点集合 + */ + private List getMenuNode(String pid) { + List menuList = this.getService().selectList(NAMESPACE + ".getMenuNode", pid); + return menuList; + } +} diff --git a/src/main/java/com/es/disped/web/controller/menurole/MenuRoleController.java b/src/main/java/com/es/disped/web/controller/menurole/MenuRoleController.java new file mode 100644 index 0000000000000000000000000000000000000000..d507be2bad1695bdcd3713c618ec96cf7afee03d --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/menurole/MenuRoleController.java @@ -0,0 +1,130 @@ +package com.es.disped.web.controller.menurole; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.apache.shiro.authz.annotation.Logical; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.es.disped.api.menurole.MenuRoleService; +import com.es.disped.common.model.MsgModel; +import com.es.disped.core.controller.BaseController; +import com.es.disped.dao.model.MenuNode; +import com.es.disped.dao.model.MenuRoleRel; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; + +@Api(value="为角色管理菜单") +@Controller +@RequestMapping("/manage/role/menu") +public class MenuRoleController extends BaseController { + + private final String NAMESPACE="com.es.disped.dao.mapper.menu.MenuCustomMapper"; + + @Autowired + MenuRoleService menuRoleService; + + @ApiOperation(value="为角色添加菜单",response=MsgModel.class,httpMethod="POST",notes="为角色添加菜单-管理端") + @RequiresPermissions(value= {"admin:save","sys:save"},logical=Logical.OR) + @RequestMapping(value="/add",method=RequestMethod.POST) + public @ResponseBody MsgModel add(@RequestBody @ApiParam() MenuRoleRel menuRoleRel) + { + int count=0; + if(Optional.of(menuRoleRel) + .filter(roleId->menuRoleRel.getRoleId()!=null) + .filter(menuId->menuRoleRel.getMenuId()!=null) + .isPresent()) + { + menuRoleRel.setRelId(getUUID()); + count=menuRoleService.insert(menuRoleRel); + } + return new MsgModel(count!=0?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count!=0?"":"赋予菜单失败",count!=0?menuRoleRel:""); + } + + @ApiOperation(value="更新角色菜单",response=MsgModel.class,httpMethod="POST",notes="更新角色菜单-管理端") + @RequiresPermissions(value= {"admin:update","sys:update"},logical=Logical.OR) + @RequestMapping(value="/update",method=RequestMethod.POST) + public @ResponseBody MsgModel update(@RequestBody @ApiParam() MenuRoleRel menuRoleRel) + { + int count=0; + if(Optional.of(menuRoleRel) + .filter(relId->menuRoleRel.getRelId()!=null) + .filter(roleId->menuRoleRel.getRoleId()!=null) + .filter(menuId->menuRoleRel.getMenuId()!=null) + .isPresent()) + { + count=menuRoleService.updateByPrimaryKey(menuRoleRel); + } + return new MsgModel(count!=0?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count!=0?"":"更新角色菜单失败",count!=0?menuRoleRel:""); + } + + @ApiOperation(value="回收角色菜单",response=MsgModel.class,httpMethod="POST",notes="回收角色菜单-管理端") + @RequiresPermissions(value= {"admin:delete","sys:delete"},logical=Logical.OR) + @RequestMapping(value="/recycle",method=RequestMethod.POST) + public @ResponseBody MsgModel recycle(@RequestBody @ApiParam() MenuRoleRel menuRoleRel) + { + int count=0; + if(Optional.of(menuRoleRel) + .filter(relId->menuRoleRel.getRelId()!=null) + .isPresent()) + { + count=menuRoleService.deleteByPrimaryKey(menuRoleRel.getRelId()); + } + return new MsgModel(count!=0?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count!=0?"":"回收角色菜单失败",count!=0?menuRoleRel:""); + } + + + @ApiOperation(value="获取 checkbox 形式的树结构,并获取已选中项",response=MsgModel.class,httpMethod="POST", + notes="获取 checkbox 形式的树结构,并获取已选中项-管理端") + @RequiresPermissions(value= {"admin:select","sys:select"},logical=Logical.OR) + @RequestMapping(value="/menuCheckedTree",method=RequestMethod.POST) + public @ResponseBody MsgModel getMenuCheckedTree(String roleId, String id) + { + if (this.isNull(id)) { + id = "00000000000000000000000000000000"; + } + + Map paramMap = new HashMap<>(); + paramMap.put("roleId", roleId); + paramMap.put("menuId", id); + + List nodeList = new ArrayList<>(); + List rootList = this.getService().selectList(NAMESPACE + ".getMenuCheckedNode", paramMap); + for (MenuNode menuNode : rootList) { + menuNode.setChildren(getMenuCheckedNode(roleId, menuNode.getId())); + nodeList.add(menuNode); + } + return this.resultMsg(nodeList.size()>0?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + nodeList.size()>0?"":"菜单列表为空", nodeList.size()>0?nodeList:""); + } + + /** + * 获取 checkbox 形式的树结构,并获取已选中项(为角色管理提供支持)
+ * + * @param roleId 角色Id + * @param pid 树父Id + * @return List 树结构结果集 + */ + private List getMenuCheckedNode(String roleId, String pid) { + Map paramMap = new HashMap<>(); + paramMap.put("roleId", roleId); + paramMap.put("menuId", pid); + List menuList = this.getService().selectList(NAMESPACE + ".getMenuCheckedNode", paramMap); + return menuList; + } +} diff --git a/src/main/java/com/es/disped/web/controller/oj/contest/ContestController.java b/src/main/java/com/es/disped/web/controller/oj/contest/ContestController.java new file mode 100644 index 0000000000000000000000000000000000000000..c990933487d2ea25c138444fde29f98fa0322ed6 --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/oj/contest/ContestController.java @@ -0,0 +1,154 @@ +package com.es.disped.web.controller.oj.contest; + +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.apache.shiro.authz.annotation.Logical; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.es.disped.api.oj.contest.HustContestService; +import com.es.disped.common.annotation.DynamicDataSource; +import com.es.disped.common.model.MsgModel; +import com.es.disped.common.model.PageModel; +import com.es.disped.core.controller.BaseController; +import com.es.disped.dao.oj.model.Contest; +import com.es.disped.dao.oj.model.ContestExample; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; + +/** + * @author Anson
+ * Copyright by EasyShare 2019
+ * + * All right reserved
+ * + * Created on 2019年7月17日 下午3:32:04
+ * 名称:ContestController.java
+ * 描述:竞赛及作业管理
+ */ +@Api("竞赛及作业管理") +@Controller +@RequestMapping("manage/oj/contest") +public class ContestController extends BaseController{ + + @Autowired + HustContestService hustContestService; + + @ApiOperation(value="保存竞赛作业",response=MsgModel.class,httpMethod="POST",notes="保存竞赛或保存作业练习") + @RequiresPermissions(value={"teacher:save","admin:save"},logical=Logical.OR) + @RequestMapping(value="/save",method=RequestMethod.POST) + @DynamicDataSource + public @ResponseBody MsgModel save(@RequestBody @ApiParam(name="contest",value="竞赛及作业对象",required=true) Contest contest) + { + int count=0; + if(Optional.of(contest) + .filter(title->contest.getTitle()!=null) + .filter(stime->contest.getStartTime()!=null) + .filter(etime->contest.getEndTime()!=null) + .filter(lang->contest.getLangmask()!=null) + .isPresent()) + { + contest.setUserId(this.getSessionUser().getPhone()); + count=hustContestService.insertSelective(contest); + } + return this.resultMsg(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"竞赛及作业保存成功":"竞赛及作业保存失败",count==1?contest:""); + } + + + @ApiOperation(value="更新竞赛作业",response=MsgModel.class,httpMethod="POST",notes="更新竞赛或保存作业练习") + @RequiresPermissions(value={"teacher:update","admin:update"},logical=Logical.OR) + @RequestMapping(value="/update",method=RequestMethod.POST) + @DynamicDataSource + public @ResponseBody MsgModel update(@RequestBody @ApiParam(name="contest",value="竞赛及作业对象",required=true) Contest contest) + { + int count=0; + if(Optional.of(contest) + .filter(title->contest.getContestId()!=null) + .isPresent()) + { + count=hustContestService.updateByPrimaryKeySelective(contest); + } + return this.resultMsg(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"竞赛及作业更新成功":"竞赛及作业更新失败",count==1?contest:""); + } + + + @ApiOperation(value="删除竞赛作业",response=MsgModel.class,httpMethod="POST",notes="删除竞赛或保存作业练习,逻辑删除") + @RequiresPermissions(value={"teacher:delete","admin:delete"},logical=Logical.OR) + @RequestMapping(value="/delete",method=RequestMethod.POST) + @DynamicDataSource + public @ResponseBody MsgModel delete(@RequestBody @ApiParam(name="contest",value="竞赛及作业对象",required=true) Contest contest) + { + int count=0; + if(!this.isNull(contest.getContestId())) + { + contest.setDefunct("Y");//设置为删除标记 + ContestExample deleteExample=new ContestExample(); + deleteExample.createCriteria().andContestIdEqualTo(contest.getContestId()); + count=hustContestService.updateByPrimaryKeySelective(contest); + } + return this.resultMsg(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"竞赛及作业删除成功":"竞赛及作业删除失败",count==1?contest:""); + } + + @ApiOperation(value="检索竞赛及作业",response=MsgModel.class,httpMethod="POST",notes="检索竞赛/作业") + @RequestMapping(value="/list",method=RequestMethod.POST) + @DynamicDataSource + public @ResponseBody MsgModel list(@RequestBody @ApiParam(name="contest",value="竞赛/作业对象",required=false) Contest contest) + { + ContestExample listExample=new ContestExample(); + ContestExample.Criteria criteria=listExample.createCriteria(); + criteria.andDefunctEqualTo("N"); + if(!this.isNull(contest.getContestId())) + { + criteria.andContestIdEqualTo(contest.getContestId()); + } + if(!this.isNull(contest.getTitle())) + { + criteria.andTitleLike("%"+contest.getTitle()+"%"); + } + if(!this.isNull(contest.getStartTime())) + { + criteria.andStartTimeGreaterThanOrEqualTo(contest.getStartTime()); + } + if(!this.isNull(contest.getEndTime())) + { + criteria.andEndTimeLessThanOrEqualTo(contest.getEndTime()); + } + List list=hustContestService.selectByExample(listExample); + return this.resultMsg(!this.isNull(list)?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + !this.isNull(list)?"竞赛/作业列表加载成功":"竞赛/作业列表加载失败",!this.isNull(list)?list:""); + } + + + @ApiOperation(value="分页加载竞赛/作业",response=MsgModel.class,httpMethod="POST",notes="分页加载竞赛/作业,分页参数['offset','limit']") + @RequestMapping(value="/pages",method=RequestMethod.POST) + @DynamicDataSource + public @ResponseBody MsgModel pages(@RequestBody @ApiParam(name="paramMap",value="分页参数[offset,limit]",required=true) Map paramMap) + { + ContestExample listExample=new ContestExample(); + PageModel pageModel=null; + if(Optional.of(paramMap) + .filter(offset->paramMap.containsKey("offset")!=false) + .filter(limit->paramMap.containsKey("limit")!=false) + .isPresent()) + { + pageModel=hustContestService.selectByExampleForOffsetPage(listExample, + Integer.valueOf(paramMap.get("offset").toString()), Integer.valueOf(paramMap.get("limit").toString())); + + } + return this.resultMsg(!this.isNull(pageModel)?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + !this.isNull(pageModel)?"竞赛/作业加载成功":"竞赛/作业加载失败",!this.isNull(pageModel)?pageModel:""); + } +} diff --git a/src/main/java/com/es/disped/web/controller/oj/contestproblem/ContestProblemController.java b/src/main/java/com/es/disped/web/controller/oj/contestproblem/ContestProblemController.java new file mode 100644 index 0000000000000000000000000000000000000000..ec0134cdf09c6f1408fdfd762d30b24138f1be7b --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/oj/contestproblem/ContestProblemController.java @@ -0,0 +1,130 @@ +package com.es.disped.web.controller.oj.contestproblem; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +import org.apache.shiro.authz.annotation.Logical; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.es.disped.api.oj.contestproblem.HustContestProblemService; +import com.es.disped.api.oj.problem.HustProblemService; +import com.es.disped.common.annotation.DynamicDataSource; +import com.es.disped.common.model.MsgModel; +import com.es.disped.core.controller.BaseController; +import com.es.disped.dao.oj.model.ContestProblem; +import com.es.disped.dao.oj.model.ContestProblemExample; +import com.es.disped.dao.oj.model.Problem; +import com.es.disped.dao.oj.model.ProblemExample; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; + +/** + * @author Anson
+ * Copyright by EasyShare 2019
+ * + * All right reserved
+ * + * Created on 2019年7月17日 下午9:45:31
+ * 名称:ContestProblemController.java
+ * 描述:竞赛及作业题目管理
+ */ +@Api("竞赛及作业题目管理") +@Controller +@RequestMapping("/manage/oj/contest/problem") +public class ContestProblemController extends BaseController{ + + @Autowired + HustContestProblemService hustContestProblemService; + @Autowired + HustProblemService hustProblemService; + + @ApiOperation(value="保存竞赛题目对象集合",response=MsgModel.class,httpMethod="POST",notes="批量添加竞赛或者作业题目") + @RequiresPermissions(value={"teacher:save","admin:save"},logical=Logical.OR) + @RequestMapping(value="/save",method=RequestMethod.POST) + @Transactional + @DynamicDataSource + public @ResponseBody MsgModel save(@RequestBody @ApiParam(name="contestProblems",value="竞赛及作业题目对象集合",required=true) List contestProblems) + { + int count=0; + for(ContestProblem record:contestProblems) + { + if(Optional.of(record) + .filter(cId->record.getContestId()!=null) + .filter(pId->record.getProblemId()!=null) + .isPresent()) + { + count+=hustContestProblemService.insertSelective(record); + } + } + return this.resultMsg(count>=1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count>=1?"竞赛作业题目添加成功":"竞赛作业题目添加失败",count>=1?contestProblems:""); + } + + + @ApiOperation(value="移除竞赛题目对象",response=MsgModel.class,httpMethod="POST",notes="移除竞赛或者作业题目,支持批量移除") + @RequiresPermissions(value={"teacher:delete","admin:delete"},logical=Logical.OR) + @RequestMapping(value="/delete",method=RequestMethod.POST) + @DynamicDataSource + public @ResponseBody MsgModel delete(@RequestBody @ApiParam(name="contestProblems",value="竞赛及作业题目对象集合",required=true) List contestProblems) + { + int count=0; + List pIds=new ArrayList(); + for(ContestProblem record:contestProblems) + { + if(!this.isNull(record.getProblemId())) + { + pIds.add(record.getProblemId()); + } + } + ContestProblemExample deleteExample=new ContestProblemExample(); + ContestProblemExample.Criteria criteria=deleteExample.createCriteria(); + criteria.andProblemIdIn(pIds); + count=hustContestProblemService.deleteByExample(deleteExample); + return this.resultMsg(count>=1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count>=1?"竞赛作业题目移除成功":"竞赛作业题目移除失败",count>=1?contestProblems:""); + } + + @ApiOperation(value="根据竞赛/作业ID查询学生竞赛/作业列表",response=MsgModel.class,httpMethod="POST",notes="加载某一竞赛/作业的题目列表") + @RequestMapping(value="/select",method=RequestMethod.POST) + @DynamicDataSource + public @ResponseBody MsgModel getContestProblem(@RequestBody @ApiParam(name="contestProblem",value="竞赛及作业学生对象",required=true) + ContestProblem contestProblem) + { + List contestProblems=new ArrayList(); + if(!this.isNull(contestProblem.getContestId())) + { + ContestProblemExample contestProblemExample=new ContestProblemExample(); + ContestProblemExample.Criteria criteria=contestProblemExample.createCriteria(); + criteria.andContestIdEqualTo(contestProblem.getContestId()); + contestProblems=hustContestProblemService.selectByExample(contestProblemExample); + } + List pIds=new ArrayList(); + if(!this.isNull(contestProblems)) + { + for(ContestProblem record:contestProblems) + { + if(!this.isNull(record.getProblemId())) + { + pIds.add(record.getProblemId()); + } + } + } + ProblemExample problemExample=new ProblemExample(); + ProblemExample.Criteria criteria=problemExample.createCriteria(); + criteria.andProblemIdIn(pIds).andDefunctEqualTo("N"); + List problems=hustProblemService.selectByExample(problemExample); + return this.resultMsg(!this.isNull(problems)?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + !this.isNull(problems)?"学生作业加载成功":"学生作业加载失败",!this.isNull(problems)?problems:""); + } +} diff --git a/src/main/java/com/es/disped/web/controller/oj/conteststudent/ContestStudentController.java b/src/main/java/com/es/disped/web/controller/oj/conteststudent/ContestStudentController.java new file mode 100644 index 0000000000000000000000000000000000000000..561f43aa573ff0c996c98bf41b4d40a9e24a8ea1 --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/oj/conteststudent/ContestStudentController.java @@ -0,0 +1,137 @@ +package com.es.disped.web.controller.oj.conteststudent; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +import org.apache.shiro.authz.annotation.Logical; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.es.disped.api.oj.contest.HustContestService; +import com.es.disped.api.oj.conteststudent.HustContestStudentService; +import com.es.disped.common.annotation.DynamicDataSource; +import com.es.disped.common.constant.DataSourceName; +import com.es.disped.common.model.MsgModel; +import com.es.disped.common.spring.DataSourceContextHolder; +import com.es.disped.core.controller.BaseController; +import com.es.disped.dao.model.ContestStudentRel; +import com.es.disped.dao.model.ContestStudentRelExample; +import com.es.disped.dao.oj.model.Contest; +import com.es.disped.dao.oj.model.ContestExample; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; + +/** + * @author Anson
+ * Copyright by EasyShare 2019
+ * + * All right reserved
+ * + * Created on 2019年7月18日 下午12:07:58
+ * 名称:ContestStudentController.java
+ * 描述:竞赛及作业学生关系管理
+ */ +@Api("竞赛及作业学生关系管理") +@Controller +@RequestMapping("/manage/oj/contest/student") +public class ContestStudentController extends BaseController{ + + @Autowired + HustContestStudentService hustContestStudentService; + @Autowired + HustContestService hustContestService; + + @ApiOperation(value="为学生分配给竞赛及作业对象",response=MsgModel.class,httpMethod="POST",notes="为竞赛及作业添加学生") + @RequiresPermissions(value={"teacher:save","admin:save"},logical=Logical.OR) + @RequestMapping(value="/save",method=RequestMethod.POST) + @Transactional + @DynamicDataSource + public @ResponseBody MsgModel save(@RequestBody @ApiParam(name="contestStudentRels",value="竞赛及作业学生对象",required=true) + List contestStudentRels) + { + int count=0; + for(ContestStudentRel record:contestStudentRels) + { + if(Optional.of(record) + .filter(cId->record.getContestId()!=null) + .filter(sId->record.getStudentId()!=null)//ESH平台对象的用户ID + .filter(spe->record.getStudentPhone()!=null)//OJ系统对应的用户ID + .isPresent()) + { + record.setRelId(getUUID()); + count+=hustContestStudentService.insertSelective(record); + } + } + return this.resultMsg(count>=1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count>=1?"竞赛作业学生添加成功":"竞赛作业学生添加失败",count>=1?contestStudentRels:""); + } + + + @ApiOperation(value="删除竞赛及作业对象关联的学生",response=MsgModel.class,httpMethod="POST",notes="删除为竞赛及作业添加的学生") + @RequiresPermissions(value={"teacher:delete","admin:delete"},logical=Logical.OR) + @RequestMapping(value="/delete",method=RequestMethod.POST) + public @ResponseBody MsgModel delete(@RequestBody @ApiParam(name="contestStudentRels",value="竞赛及作业学生对象",required=true) + List contestStudentRels) + { + int count=0; + List sIds=new ArrayList(); + for(ContestStudentRel record:contestStudentRels) + { + if(!this.isNull(record.getStudentId())) + { + sIds.add(record.getStudentId()); + } + } + ContestStudentRelExample deleteExample=new ContestStudentRelExample(); + ContestStudentRelExample.Criteria criteria=deleteExample.createCriteria(); + criteria.andStudentIdIn(sIds); + count=hustContestStudentService.deleteByExample(deleteExample); + return this.resultMsg(count>=1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count>=1?"竞赛作业学生删除成功":"竞赛作业学生删除失败",count>=1?contestStudentRels:""); + } + + + @ApiOperation(value="根据学生ID查询学生竞赛及作业列表",response=MsgModel.class,httpMethod="POST",notes="加载学生个人相关的竞赛及作业") + @RequestMapping(value="/select",method=RequestMethod.POST) + public @ResponseBody MsgModel getStudentContest(@RequestBody @ApiParam(name="contestStudentRel",value="竞赛及作业学生对象",required=true) + ContestStudentRel contestStudentRel) + { + List contestStudentRels=null; + if(!this.isNull(contestStudentRel.getStudentId())) + { + ContestStudentRelExample selectExample=new ContestStudentRelExample(); + ContestStudentRelExample.Criteria criteria=selectExample.createCriteria(); + criteria.andStudentIdEqualTo(contestStudentRel.getStudentId()); + contestStudentRels=hustContestStudentService.selectByExample(selectExample); + } + ContestExample contestExample=new ContestExample(); + ContestExample.Criteria criteria=contestExample.createCriteria(); + List cIds=new ArrayList(); + if(!this.isNull(contestStudentRels)) + { + for(ContestStudentRel record:contestStudentRels) + { + if(!this.isNull(record.getContestId())) + { + cIds.add(record.getContestId()); + } + } + } + criteria.andContestIdIn(cIds).andDefunctEqualTo("N"); + DataSourceContextHolder.setDataSource(DataSourceName.EXTEND.getName()); + List contests=hustContestService.selectByExample(contestExample); + DataSourceContextHolder.clearDataSource(); + return this.resultMsg(!this.isNull(contests)?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + !this.isNull(contests)?"学生作业加载成功":"学生作业加载失败",!this.isNull(contests)?contests:""); + } +} diff --git a/src/main/java/com/es/disped/web/controller/oj/judgeproblem/JudgeProblemController.java b/src/main/java/com/es/disped/web/controller/oj/judgeproblem/JudgeProblemController.java new file mode 100644 index 0000000000000000000000000000000000000000..f6b93a14465f6f4f37ddb3fab41ab548ecf47efb --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/oj/judgeproblem/JudgeProblemController.java @@ -0,0 +1,137 @@ +package com.es.disped.web.controller.oj.judgeproblem; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.es.disped.api.oj.solution.HustSolutionService; +import com.es.disped.api.oj.sourcecode.HustSourceCodeService; +import com.es.disped.api.oj.sourcecodeuser.HustSourceCodeUserService; +import com.es.disped.common.annotation.DynamicDataSource; +import com.es.disped.common.model.MsgModel; +import com.es.disped.core.controller.BaseController; +import com.es.disped.dao.oj.model.Solution; +import com.es.disped.dao.oj.model.SourceCode; +import com.es.disped.dao.oj.model.SourceCodeUser; +import com.es.disped.dao.oj.model.SubmitProbDefunct; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; + +/** + * @author Anson
+ * Copyright by EasyShare 2019
+ * + * All right reserved
+ * + * Created on 2019年7月19日 下午1:49:08
+ * 名称:JudgeProblemController.java
+ * 描述:OJ判题
+ */ +@Api("OJ判题") +@Controller +@RequestMapping("/oj/judge") +public class JudgeProblemController extends BaseController{ + + private final String NAMESPACE="com.es.disped.dao.mapper.judge.JudgeCustomMapper"; + + @Autowired + HustSolutionService hustSolutionService; + @Autowired + HustSourceCodeService hustSourceCodeService; + @Autowired + HustSourceCodeUserService hustSourceCodeUserService; + + @ApiOperation(value="提交题目",response=MsgModel.class,httpMethod="POST", + notes="OJ判题,问题列表与作业题目提交参数不同:问题列表,问题ID,语言,源码;作业:作业ID,问题在作业中的序号值,语言,源码") + @RequestMapping(value="/submit",method=RequestMethod.POST) + @DynamicDataSource + public @ResponseBody MsgModel submit(@RequestBody @ApiParam(name="paramMap",value="判题序列对象",required=true) Map paramMap) + { + int count=0; + SubmitProbDefunct submitProbDefunct=null; + if(paramMap.containsKey("id")) + { + submitProbDefunct=this.getHustService().selectOne(NAMESPACE+".getProbDefunctById", paramMap.get("id")); + }else if(paramMap.containsKey("cid")&¶mMap.containsKey("pid")) + { + Map map=new HashMap(); + map.put("cid", paramMap.get("cid")); + map.put("pid", paramMap.get("pid")); + submitProbDefunct=this.getHustService().selectOne(NAMESPACE+".getProbDefunctByParams", map); + } + if(this.isNull(submitProbDefunct)) + { + return this.resultMsg(HttpStatus.NOT_FOUND.value(), "所提交的题目不存在"); + } + if(!this.isNull(submitProbDefunct)&&!submitProbDefunct.getDefunct().equals("N")) + { + return this.resultMsg(HttpStatus.UNAVAILABLE_FOR_LEGAL_REASONS.value(), "题目被禁用"); + } + Integer res=this.getHustService().selectOne(NAMESPACE+".getProblastSubmit", this.getSessionUser().getPhone()); + if(res==1) + { + return this.resultMsg(HttpStatus.FORBIDDEN.value(), "题目提交过于频繁"); + } + + String source=paramMap.get("source").toString(); + source=source.replaceAll("\r\n", "\n"); + + Solution solution=new Solution(); + solution.setProblemId(submitProbDefunct.getProblemId()); + solution.setUserId(this.getSessionUser().getPhone()); + solution.setInDate(new Date()); + solution.setLanguage(Integer.valueOf(paramMap.get("language").toString())); + solution.setIp(this.getRequest().getRemoteAddr()); + solution.setCodeLength(source.length()); + solution.setResult((short)14); + if(paramMap.containsKey("cid")&¶mMap.containsKey("pid")) + { + solution.setContestId(Integer.valueOf(paramMap.get("cid").toString())); + solution.setNum(Byte.valueOf(paramMap.get("pid").toString())); + } + //保存提交记录 + count+=hustSolutionService.insertSelective(solution); + //查询记录ID + Map soMap=new HashMap(); + soMap.put("userId", this.getSessionUser().getPhone()); + soMap.put("problemId", submitProbDefunct.getProblemId()); + Integer solutionId=this.getHustService().selectOne(NAMESPACE+".getLastSubmitsoId", soMap); + //保存提交源码 + SourceCode sourceCode=new SourceCode(); + sourceCode.setSolutionId(solutionId); + sourceCode.setSource(source); + count+=hustSourceCodeService.insert(sourceCode); + SourceCodeUser sourceCodeUser=new SourceCodeUser(); + sourceCodeUser.setSolutionId(solutionId); + sourceCodeUser.setSource(source); + count+=hustSourceCodeUserService.insert(sourceCodeUser); + //修改result为0,开始判题 + Solution updateSolution=new Solution(); + updateSolution.setResult((short)0); + updateSolution.setSolutionId(solutionId); + hustSolutionService.updateByPrimaryKeySelective(updateSolution); + return this.resultMsg(count>1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count>1?"提交成功":"提交失败",count>1?solutionId:""); + } + + + @ApiOperation(value="获取判题结果",response=MsgModel.class,httpMethod="POST",notes="OJ判题结果") + @RequestMapping(value="/status",method=RequestMethod.POST) + @DynamicDataSource + public @ResponseBody MsgModel status(@RequestBody @ApiParam(name="solution",value="判题结果对象",required=true) Solution solution) + { + Solution res=this.getHustService().selectOne(NAMESPACE+".getJudgeStatus", solution.getSolutionId()); + return this.resultMsg(!this.isNull(res)?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + !this.isNull(res)?"加载成功":"获取失败",!this.isNull(res)?res:""); + } +} diff --git a/src/main/java/com/es/disped/web/controller/oj/problem/ProblemController.java b/src/main/java/com/es/disped/web/controller/oj/problem/ProblemController.java new file mode 100644 index 0000000000000000000000000000000000000000..6b6a9739390f80c05275696c991c1fd5400738b3 --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/oj/problem/ProblemController.java @@ -0,0 +1,106 @@ +package com.es.disped.web.controller.oj.problem; + +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.es.disped.api.oj.problem.HustProblemService; +import com.es.disped.common.annotation.DynamicDataSource; +import com.es.disped.common.model.MsgModel; +import com.es.disped.common.model.PageModel; +import com.es.disped.core.controller.BaseController; +import com.es.disped.dao.oj.model.Problem; +import com.es.disped.dao.oj.model.ProblemExample; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; + +/** + * @author Anson
+ * Copyright by EasyShare 2019
+ * + * All right reserved
+ * + * Created on 2019年7月16日 上午12:57:21
+ * 名称:ProblemController.java
+ * 描述:OJ题库管理
+ */ +@Api("OJ题库管理") +@Controller +@RequestMapping("/oj/problem") +public class ProblemController extends BaseController{ + + @Autowired + HustProblemService hustProblemService; + + @ApiOperation(value="检索OJ题库",response=MsgModel.class,httpMethod="POST",notes="检索OJ题库") + @RequestMapping(value="/list",method=RequestMethod.POST) + @DynamicDataSource + public @ResponseBody MsgModel list(@RequestBody @ApiParam(name="problem",value="OJ题库对象",required=false) Problem problem) + { + ProblemExample listExample=new ProblemExample(); + ProblemExample.Criteria criteria=listExample.createCriteria(); + criteria.andDefunctEqualTo("N"); + if(!this.isNull(problem.getProblemId())) + { + criteria.andProblemIdEqualTo(problem.getProblemId()); + } + if(!this.isNull(problem.getTitle())) + { + criteria.andTitleLike("%"+problem.getTitle()+"%"); + } + listExample.setOrderByClause("problem_id asc"); + List list=hustProblemService.selectByExample(listExample); + return this.resultMsg(!this.isNull(list)?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + !this.isNull(list)?"OJ题库列表加载成功":"OJ题库列表加载失败",!this.isNull(list)?list:""); + } + + + @ApiOperation(value="分页加载OJ题库",response=MsgModel.class,httpMethod="POST",notes="分页加载OJ题库,分页参数['offset','limit']") + @RequestMapping(value="/pages",method=RequestMethod.POST) + @DynamicDataSource + public @ResponseBody MsgModel pages(@RequestBody @ApiParam(name="paramMap",value="分页参数[offset,limit]",required=true) Map paramMap) + { + ProblemExample listExample=new ProblemExample(); + PageModel pageModel=null; + if(Optional.of(paramMap) + .filter(offset->paramMap.containsKey("offset")!=false) + .filter(limit->paramMap.containsKey("limit")!=false) + .isPresent()) + { + listExample.setOrderByClause("problem_id asc"); + pageModel=hustProblemService.selectByExampleForOffsetPage(listExample, + Integer.valueOf(paramMap.get("offset").toString()), Integer.valueOf(paramMap.get("limit").toString())); + + } + return this.resultMsg(!this.isNull(pageModel)?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + !this.isNull(pageModel)?"OJ题库加载成功":"OJ题库加载失败",!this.isNull(pageModel)?pageModel:""); + } + + + + @ApiOperation(value="获取题目描述",response=MsgModel.class,httpMethod="POST",notes="通过题目ID获取题目描述内容") + @RequestMapping(value="/getProblemDetail",method=RequestMethod.POST) + @DynamicDataSource + public @ResponseBody MsgModel getProblemDetail(@RequestBody @ApiParam(name="problem",value="OJ题库对象",required=false) Problem problem) + { + ProblemExample problemExample=new ProblemExample(); + ProblemExample.Criteria criteria=problemExample.createCriteria(); + criteria.andDefunctEqualTo("N").andProblemIdEqualTo(problem.getProblemId()); + Problem problemDetail=hustProblemService.selectFirstByExampleWithBLOBs(problemExample); + return this.resultMsg(!this.isNull(problemDetail)?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + !this.isNull(problemDetail)?"OJ题库列表加载成功":"OJ题库列表加载失败",!this.isNull(problemDetail)?problemDetail:""); + } + + + +} diff --git a/src/main/java/com/es/disped/web/controller/oj/solution/SolutionController.java b/src/main/java/com/es/disped/web/controller/oj/solution/SolutionController.java new file mode 100644 index 0000000000000000000000000000000000000000..8bc02736dc97a24dd19be5b85799cb504721d8e4 --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/oj/solution/SolutionController.java @@ -0,0 +1,143 @@ +package com.es.disped.web.controller.oj.solution; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.es.disped.api.oj.solution.HustSolutionService; +import com.es.disped.common.annotation.DynamicDataSource; +import com.es.disped.common.model.MsgModel; +import com.es.disped.common.model.PageModel; +import com.es.disped.core.controller.BaseController; +import com.es.disped.dao.oj.model.Solution; +import com.es.disped.dao.oj.model.SolutionExample; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; + +@Api("OJ判题结果管理") +@Controller +@RequestMapping("/oj/solution") +public class SolutionController extends BaseController{ + + private final String NAMESPACE="com.es.disped.dao.mapper.solution.SolutionCustomMapper"; + + @Autowired + HustSolutionService hustSolutionService; + + + @ApiOperation(value="获取用户所有答题结果",response=MsgModel.class,httpMethod="POST",notes="通过用户ID判断用户是否通过答题") + @RequestMapping(value="/getProblemResultList",method=RequestMethod.POST) + @DynamicDataSource + public @ResponseBody MsgModel judgeProblemPassResult(@RequestBody @ApiParam(name="solution",value="判题结果对象",required=true) Solution solution) + { + List solutions=null; + if(!this.isNull(solution.getUserId())) + { + solutions=this.getHustService().selectList(NAMESPACE+".getProblemResultList", solution.getUserId()); + } + Map map=new HashMap(); + if(!this.isNull(solutions)) + { + for(Solution record:solutions) + { + map.put(record.getSolutionId(), record.getResult()==(short)4?"Y":"N"); + } + } + return this.resultMsg(!this.isNull(solutions)?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + !this.isNull(solutions)?"获取成功":"获取失败",!this.isNull(solutions)?map:""); + } + + + @ApiOperation(value="获取用户答题情况列表",response=MsgModel.class,httpMethod="POST",notes="获取用户提交记录") + @RequestMapping(value="/getProblemPassUserList",method=RequestMethod.POST) + @DynamicDataSource + public @ResponseBody MsgModel getProblemPassResult(@RequestBody @ApiParam(name="solution",value="判题结果对象",required=false) Solution solution) + { + List list=null; + SolutionExample solutionExample=new SolutionExample(); + SolutionExample.Criteria criteria=solutionExample.createCriteria(); + if(!this.isNull(solution.getProblemId())) + { + criteria.andProblemIdEqualTo(solution.getProblemId()); + } + if(!this.isNull(solution.getResult())) + { + criteria.andResultEqualTo(solution.getResult()); + } + if(!this.isNull(solution.getSolutionId())) + { + criteria.andSolutionIdEqualTo(solution.getSolutionId()); + } + if(!this.isNull(solution.getUserId())) + { + criteria.andUserIdEqualTo(solution.getUserId()); + } + solutionExample.setOrderByClause("judgetime desc"); + list=hustSolutionService.selectByExample(solutionExample); + return this.resultMsg(!this.isNull(list)?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + !this.isNull(list)?"列表加载成功":"数据为空",!this.isNull(list)?list:""); + } + + + + @ApiOperation(value="分页获取状态栏目所有答题情况",response=MsgModel.class,httpMethod="POST",notes="分页获取状态栏所有答题情况,分页参数['offset','limit']") + @RequestMapping(value="/pages",method=RequestMethod.POST) + @DynamicDataSource + public @ResponseBody MsgModel pages(@RequestBody @ApiParam(name="paramMap",value="分页参数[offset,limit]",required=true) Map paramMap) + { + SolutionExample listExample=new SolutionExample(); + PageModel pageModel=null; + if(Optional.of(paramMap) + .filter(offset->paramMap.containsKey("offset")!=false) + .filter(limit->paramMap.containsKey("limit")!=false) + .isPresent()) + { + pageModel=hustSolutionService.selectByExampleForOffsetPage(listExample, + Integer.valueOf(paramMap.get("offset").toString()), Integer.valueOf(paramMap.get("limit").toString())); + + } + return this.resultMsg(!this.isNull(pageModel)?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + !this.isNull(pageModel)?"判题结果加载成功":"判题结果加载失败",!this.isNull(pageModel)?pageModel:""); + } + +// @ApiOperation(value="获取编译结果",response=MsgModel.class,httpMethod="POST",notes="通过判题ID获取题目编译结果") +// @RequestMapping(value="/getCompileRuntimeInfo",method=RequestMethod.POST) +// @DynamicDataSource +// public @ResponseBody MsgModel getSource(@RequestBody Solution solution) +// { +// if(Optional.of(solution) +// .filter(sId->solution.getSolutionId()!=null) +// .filter(uId->solution.getUserId()!=null) +// .isPresent()) +// { +// SolutionExample selectExample=new SolutionExample(); +// SolutionExample.Criteria criteria=selectExample.createCriteria(); +// criteria.andSolutionIdEqualTo(solution.getSolutionId()).andUserIdEqualTo(solution.getUserId()); +// selectExample.ord +// Solution res=hustSolutionService.selectByExample(selectExample); +// } +// return this.resultMsg(null); +// } + +// @ApiOperation(value="AAAAAAAAAAAA",response=MsgModel.class,httpMethod="POST", +// notes="AAAAAAAAAAAA") +// @RequestMapping(value="/a",method=RequestMethod.POST) +// @DynamicDataSource +// public @ResponseBody MsgModel getUserACRate(@RequestBody Integer problemId) +// { +//// List list=null; +// List list=this.getHustService().selectList("com.es.disped.dao.mapper.problem.ProblemCustomMapper.getProblemPassResult", problemId); +// return this.resultMsg(HttpStatus.OK.value(),"",list); +// } +} diff --git a/src/main/java/com/es/disped/web/controller/oj/sourcecode/SourceCodeController.java b/src/main/java/com/es/disped/web/controller/oj/sourcecode/SourceCodeController.java new file mode 100644 index 0000000000000000000000000000000000000000..034bdade3b3ae677f2d1291b556e9a98ae36c6f9 --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/oj/sourcecode/SourceCodeController.java @@ -0,0 +1,49 @@ +//package com.es.disped.web.controller.oj.sourcecode; +// +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.http.HttpStatus; +//import org.springframework.stereotype.Controller; +//import org.springframework.web.bind.annotation.RequestBody; +//import org.springframework.web.bind.annotation.RequestMapping; +//import org.springframework.web.bind.annotation.RequestMethod; +//import org.springframework.web.bind.annotation.ResponseBody; +// +//import com.es.disped.api.oj.solution.HustSolutionService; +//import com.es.disped.common.annotation.DynamicDataSource; +//import com.es.disped.common.model.MsgModel; +//import com.es.disped.core.controller.BaseController; +//import com.es.disped.dao.oj.model.Solution; +// +//import io.swagger.annotations.Api; +//import io.swagger.annotations.ApiOperation; +//import io.swagger.annotations.ApiParam; +// +///** +// * @author Anson
+// * Copyright by EasyShare 2019
+// * +// * All right reserved
+// * +// * Created on 2019年7月21日 下午10:38:58
+// * 名称:SourceCodeController.java
+// * 描述:源码管理
+// */ +//@Api("源码管理") +//@Controller +//@RequestMapping("/oj/source") +//public class SourceCodeController extends BaseController{ +// +// @Autowired +// HustSolutionService hustSolutionService; +// +// @ApiOperation(value="获取判题源码",response=MsgModel.class,httpMethod="POST",notes="获取提交的源码") +// @RequestMapping(value="/code",method=RequestMethod.POST) +// @DynamicDataSource +// public @ResponseBody MsgModel getSource(@RequestBody @ApiParam(name="solution",value="判题结果对象",required=true) Solution solution) +// { +// Solution res=hustSolutionService.selectByPrimaryKey(solution.getSolutionId().toString()); +// return this.resultMsg(!this.isNull(res)?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), +// !this.isNull(res)?"加载成功":"获取失败",!this.isNull(res)?res:""); +// } +// +//} diff --git a/src/main/java/com/es/disped/web/controller/oj/sourcecodeuser/SourceCodeUserController.java b/src/main/java/com/es/disped/web/controller/oj/sourcecodeuser/SourceCodeUserController.java new file mode 100644 index 0000000000000000000000000000000000000000..8dbe91c42887ab198984658762041edc24567acf --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/oj/sourcecodeuser/SourceCodeUserController.java @@ -0,0 +1,49 @@ +package com.es.disped.web.controller.oj.sourcecodeuser; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.es.disped.api.oj.sourcecodeuser.HustSourceCodeUserService; +import com.es.disped.common.annotation.DynamicDataSource; +import com.es.disped.common.model.MsgModel; +import com.es.disped.core.controller.BaseController; +import com.es.disped.dao.oj.model.SourceCodeUser; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; + +/** + * @author Anson
+ * Copyright by EasyShare 2019
+ * + * All right reserved
+ * + * Created on 2019年7月21日 下午10:38:58
+ * 名称:SourceCodeUserController.java
+ * 描述:用户源码管理
+ */ +@Api("用户源码管理") +@Controller +@RequestMapping("/oj/source/user") +public class SourceCodeUserController extends BaseController{ + + @Autowired + HustSourceCodeUserService hustSourceCodeUserService; + + @ApiOperation(value="获取判题源码",response=MsgModel.class,httpMethod="POST",notes="获取提交的源码") + @RequestMapping(value="/code",method=RequestMethod.POST) + @DynamicDataSource + public @ResponseBody MsgModel getSource(@RequestBody @ApiParam(name="sourceCodeUser",value="用户源码对象",required=true) SourceCodeUser sourceCodeUser) + { + SourceCodeUser res=hustSourceCodeUserService.selectByPrimaryKey(sourceCodeUser.getSolutionId()); + return this.resultMsg(!this.isNull(res)?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + !this.isNull(res)?"加载成功":"获取失败",!this.isNull(res)?res:""); + } + +} diff --git a/src/main/java/com/es/disped/web/controller/oj/users/UsersController.java b/src/main/java/com/es/disped/web/controller/oj/users/UsersController.java new file mode 100644 index 0000000000000000000000000000000000000000..93bbdc65f03b863ed639d6d043cf7754a1e19fc5 --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/oj/users/UsersController.java @@ -0,0 +1,88 @@ +package com.es.disped.web.controller.oj.users; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.es.disped.api.oj.user.HustUserService; +import com.es.disped.common.annotation.DynamicDataSource; +import com.es.disped.common.model.MsgModel; +import com.es.disped.core.controller.BaseController; +import com.es.disped.dao.model.User; +import com.es.disped.dao.oj.model.Users; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; + + +/** + * @author Anson
+ * Copyright by EasyShare 2019
+ * + * All right reserved
+ * + * Created on 2019年7月17日 下午11:59:52
+ * 名称:UsersController.java
+ * 描述:OJ用户管理
+ */ +@Api("OJ用户管理") +@Controller +@RequestMapping("/oj/users") +public class UsersController extends BaseController{ + + + @Autowired + HustUserService hustUserService; + + @ApiOperation(value="OJ注册",httpMethod="POST",response=MsgModel.class,notes="OJ注册") + @RequestMapping(value="/registe",method=RequestMethod.POST) + @DynamicDataSource + public @ResponseBody MsgModel RegisteOJ() + { + int count=0; + User user=(User) this.getSession().getAttribute("registeUser"); + Users ojUser=hustUserService.selectByPrimaryKey(user.getUserId()); + if(this.isNull(ojUser)) + { + ojUser=new Users(); + ojUser.setUserId(user.getPhone()); + ojUser.setNick(user.getUsername()); + ojUser.setPassword(user.getPassword()); + ojUser.setEmail(user.getEmail()); + ojUser.setSchool(user.getBelongSchool()); + ojUser.setIp(this.getRequest().getRemoteAddr()); + ojUser.setRegTime(new Date()); + ojUser.setAccesstime(new Date()); + count=hustUserService.insertSelective(ojUser); + } + this.getSession().removeAttribute("registeUser"); + return new MsgModel(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(),count==1?"":"OJ系统注册失败"); + } + + + @ApiOperation(value="统计用户答题情况",response=MsgModel.class,httpMethod="POST", + notes="通过用户ID统计用户答题情况,此处用户ID为ESH平台用户注册的手机号") + @RequestMapping(value="/getUserACRate",method=RequestMethod.POST) + @DynamicDataSource + public @ResponseBody MsgModel getUserACRate(@RequestBody Users user) + { + Map map=new HashMap(); + Users res=null; + if(!this.isNull(user.getUserId())) + { + res=hustUserService.selectByPrimaryKey(user.getUserId()); + } + map.put("problemSum", res.getSubmit()); + map.put("passSum", res.getSolved()); + map.put("rate", new StringBuilder(res.getSubmit()>0?String.format("%.2f", 100.0*res.getSolved()/res.getSubmit()):"0.00")+"%"); + return this.resultMsg(HttpStatus.OK.value(),"",map); + } +} diff --git a/src/main/java/com/es/disped/web/controller/permission/PermissionController.java b/src/main/java/com/es/disped/web/controller/permission/PermissionController.java new file mode 100644 index 0000000000000000000000000000000000000000..ff6c36fde0a64790dce1900ce5de0820873ed781 --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/permission/PermissionController.java @@ -0,0 +1,227 @@ +/** + * + */ +package com.es.disped.web.controller.permission; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.apache.shiro.authz.annotation.Logical; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.slf4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.es.disped.api.permission.PermissionService; +import com.es.disped.api.rolepermission.RolePermissionService; +import com.es.disped.common.constant.RecordStatus; +import com.es.disped.common.model.MsgModel; +import com.es.disped.core.annotation.LogInject; +import com.es.disped.core.controller.BaseController; +import com.es.disped.dao.model.Permission; +import com.es.disped.dao.model.PermissionExample; +import com.es.disped.dao.model.PermissionNode; +import com.es.disped.dao.model.PermissionType; +import com.es.disped.dao.model.RolePermissionRelExample; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; + +/** + * @author Anson
+ * + * Copyright by EasyShare 2019
+ * + * All right reserved
+ * + * Created on 下午4:31:39
+ * + * 名称:PermissionController.java
+ * + * 描述:权限管理
+ */ +@Api(value="权限管理") +@Controller +@RequestMapping("/manage/permission") +public class PermissionController extends BaseController{ + + private static final String NAMESPACE="com.es.disped.dao.mapper.permission.PermissionCustomMapper"; + + @LogInject + Logger log; + + @Autowired + PermissionService permissionService; + @Autowired + RolePermissionService rolePermissionService; + + @ApiOperation(value="权限保存",response=MsgModel.class,httpMethod="POST",notes="保存新权限-管理端") + @RequiresPermissions(value= {"admin:save","sys:save"},logical=Logical.OR) + @RequestMapping(value="/save",method=RequestMethod.POST) + @Transactional + public @ResponseBody MsgModel save(@RequestBody @ApiParam(name="permission",value="权限对象",required=true) Permission permission) + { + int count=0; + if(Optional.of(permission) + .filter(name->permission.getPermissionName()!=null) + .filter(parentId->permission.getPermissionParentId()!=null) + .filter(code->permission.getPermissionCode()!=null) + .isPresent()) + { + permission.setPermissionId(getUUID()); + permission.setPermissionType(PermissionType.PERMISSION.getValue()); + permission.setPermissionValid(RecordStatus.USEAGE.getValue()); + count=permissionService.insertSelective(permission); + Permission oldParentNode=permissionService.selectByPrimaryKey(permission.getPermissionParentId()); + //修改父节点类型 + if(PermissionType.PERMISSION.getValue().equals(oldParentNode.getPermissionType())) + { + Permission parentNode=new Permission(); + parentNode.setPermissionType(PermissionType.GROUP.getValue()); + PermissionExample permissionExample=new PermissionExample(); + permissionExample.createCriteria().andPermissionIdEqualTo(oldParentNode.getPermissionId()); + permissionService.updateByExampleSelective(parentNode, permissionExample); + } + } + log.debug(count==1?HttpStatus.OK.value()+"-权限保存成功": + HttpStatus.EXPECTATION_FAILED.value()+"-权限保存失败",permission); + return new MsgModel(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"权限保存成功":"权限保存失败", permission); + } + + @ApiOperation(value="权限更新",response=MsgModel.class,httpMethod="POST",notes="更新权限-管理端") + @RequiresPermissions(value= {"admin:update","sys:update"},logical=Logical.OR) + @RequestMapping(value="/update",method=RequestMethod.POST) + public @ResponseBody MsgModel update(@RequestBody @ApiParam(name="permission",value="权限对象",required=true) Permission permission) + { + int count=0; + if(Optional.of(permission) + .filter(id->permission.getPermissionId()!=null) + .isPresent()) + { + count=permissionService.updateByPrimaryKeySelective(permission); + } + log.debug(count==1?HttpStatus.OK.value()+"-权限更新成功": + HttpStatus.EXPECTATION_FAILED.value()+"-权限更新失败",permission); + return new MsgModel(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"权限更新成功":"权限更新失败", permission); + } + + @ApiOperation(value="删除权限",response=MsgModel.class,httpMethod="POST",notes="根据权限主键删除权限-管理端") + @RequiresPermissions(value= {"admin:delete","sys:delete"},logical=Logical.OR) + @Transactional + @RequestMapping(value="/delete",method=RequestMethod.POST) + public @ResponseBody MsgModel delete(@RequestBody @ApiParam(name="permission",value="权限对象",required=true) Permission permission) + { + int pCount=0,relCount=0; + if(Optional.of(permission) + .filter(pId->permission.getPermissionId()!=null) + .filter(ppId->permission.getPermissionParentId()!=null) + .isPresent()) + { + //删除权限引用 + RolePermissionRelExample rolePermissionRelExample=new RolePermissionRelExample(); + rolePermissionRelExample.createCriteria().andPermissionIdEqualTo(permission.getPermissionId()); + relCount=rolePermissionService.deleteByExample(rolePermissionRelExample); + //删除权限节点及子节点 + PermissionExample permissionExample=new PermissionExample(); + permissionExample.createCriteria().andPermissionParentIdEqualTo(permission.getPermissionId()); + pCount+=permissionService.deleteByExample(permissionExample);//删除子节点 + pCount+=permissionService.deleteByPrimaryKey(permission.getPermissionId());//删除当前节点 + //修改权限父类节点 + PermissionExample parentExample=new PermissionExample(); + parentExample.createCriteria().andPermissionParentIdEqualTo(permission.getPermissionParentId()); + List list=permissionService.selectByExample(parentExample); + if(this.isNull(list)) + { + Permission parentNode=new Permission(); + parentNode.setPermissionType(PermissionType.PERMISSION.getValue()); + PermissionExample parentPermissionExample=new PermissionExample(); + parentPermissionExample.createCriteria().andPermissionIdEqualTo(permission.getPermissionParentId()); + permissionService.updateByExampleSelective(parentNode, parentPermissionExample); + } + } + log.debug(pCount>=1?HttpStatus.OK.value()+"-权限删除成功,共删除"+pCount+"个权限,"+relCount+"个引用": + HttpStatus.EXPECTATION_FAILED.value()+"-权限删除失败,共删除"+pCount+"个权限,"+relCount+"个引用"); + return new MsgModel(pCount>=1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + pCount>=1?"权限删除成功,共删除"+pCount+"个权限,"+relCount+"个引用":"权限删除失败"); + } + + @ApiOperation(value="权限检索",response=MsgModel.class,httpMethod="POST",notes="根据权限可检索字段检索权限列表-管理端") + @RequestMapping(value="/list",method=RequestMethod.POST) + public @ResponseBody MsgModel list(@RequestBody @ApiParam(name="permission",value="权限对象",required=false) Permission permission) + { + PermissionExample example=new PermissionExample(); + if(!this.isNull(permission.getPermissionName())) + { + example.createCriteria().andPermissionNameLike("%"+permission.getPermissionName()+"%"); + } + if(!this.isNull(permission.getPermissionId())) + { + example.createCriteria().andPermissionIdEqualTo(permission.getPermissionId()); + } + List permissions=permissionService.selectByExample(example); + return new MsgModel(permissions.size()>0?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + permissions.size()>0?"":"权限列表为空", permissions.size()>0?permissions:""); + } + +// @ApiOperation(value="权限列表分页查询",response=MsgModel.class,httpMethod="POST",notes="分页加载权限列表-管理端") +// @RequiresPermissions(value= {"admin:select","sys:select"},logical=Logical.OR) +// @RequestMapping(value="/pages",method=RequestMethod.POST) +// public @ResponseBody MsgModel pages(@RequestBody @ApiParam(name="paramMap",value="分页参数[offset,limit]",required=true) Map paramMap) +// { +// PermissionExample example=new PermissionExample(); +// PageModel pageModel=null; +// if(Optional.of(paramMap) +// .filter(offset->paramMap.containsKey("offset")!=false) +// .filter(limit->paramMap.containsKey("limit")!=false) +// .isPresent()) +// { +// pageModel=permissionService.selectByExampleForOffsetPage(example, +// Integer.valueOf(paramMap.get("offset").toString()), Integer.valueOf(paramMap.get("limit").toString())); +// } +// return new MsgModel(pageModel!=null?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), +// pageModel!=null?"":"权限加载失败", pageModel!=null?pageModel:""); +// } + + + @ApiOperation(value="获取权限Tree结构列表",response=MsgModel.class,httpMethod="POST",notes="根据权限ID检索权限Tree列表-管理端") + @RequiresPermissions(value= {"admin:select","sys:select"},logical=Logical.OR) + @RequestMapping(value="/permissionTree",method=RequestMethod.POST) + public @ResponseBody MsgModel getPermissionTree(@RequestBody @ApiParam(name="paramMap",value="当前检索的Tree的起始节点ID,若默认为空则从根节点开始",required=false) Map paramMap) + { + if (!paramMap.containsKey("id")) { + paramMap.put("id", "00000000000000000000000000000000"); + } + List nodeList=new ArrayList<>(); + List rootList=this.getService().selectList(NAMESPACE+".getPermissionNode", paramMap.get("id")); + for(PermissionNode permissionNode:rootList) + { + permissionNode.setChildren(getPermissionNode(permissionNode.getId())); + nodeList.add(permissionNode); + } + return new MsgModel(nodeList.size()>0?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + nodeList.size()>0?"":"列表加载失败", nodeList.size()>0?nodeList:""); + } + + /** + * 获取Tree结构权限集合 + * @param pid + * {@link String} pid 权限父类ID + * @return + * List 权限节点列表集合 + */ + private List getPermissionNode(String pid) { + List permissionList=this.getService().selectList(NAMESPACE+".getPermissionNode", pid); + return permissionList; + } +} diff --git a/src/main/java/com/es/disped/web/controller/reset/ResetController.java b/src/main/java/com/es/disped/web/controller/reset/ResetController.java new file mode 100644 index 0000000000000000000000000000000000000000..eba3bd43d3cab638722ecfdb8d91c9fca4798134 --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/reset/ResetController.java @@ -0,0 +1,129 @@ +/** + * + */ +package com.es.disped.web.controller.reset; + +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.slf4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.alibaba.fastjson.JSONObject; +import com.es.disped.api.sms.SmsService; +import com.es.disped.api.user.UserService; +import com.es.disped.common.constant.AliSms; +import com.es.disped.common.model.MsgModel; +import com.es.disped.core.annotation.LogInject; +import com.es.disped.core.controller.BaseController; +import com.es.disped.dao.model.User; +import com.es.disped.dao.model.UserExample; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; + +/** + * @author Anson
+ * + * Copyright by EasyShare 2019
+ * + * All right reserved
+ * + * Created on 下午8:43:07
+ * + * 名称:ResetController.java
+ * + * 描述:用户密码重置
+ */ +@Api("用户密码重置") +@Controller +@RequestMapping("/reset") +public class ResetController extends BaseController { + + @LogInject + Logger log; + @Autowired + SmsService smsService; + @Autowired + UserService userService; + @Autowired + RedisTemplate redisTemplate; + + + + @ApiOperation(value="重置密码人员手机号确认",httpMethod="POST",response=MsgModel.class, + notes="用户重置密码,先通过向手机号发送验证码的形式,确认用户账号是否存在,且手机号是否确证") + @ApiImplicitParam(name="phone",value="手机号",required=true,dataType="String") + @RequestMapping(value="/vertify",method=RequestMethod.POST) + public @ResponseBody MsgModel resetUserVertify(@RequestBody Map paramMap) + { + UserExample userExample=new UserExample(); + userExample.createCriteria().andPhoneEqualTo(paramMap.get("phone").toString()); + List users=userService.selectByExample(userExample); + return new MsgModel((!this.isNull(users))?HttpStatus.OK.value():HttpStatus.NOT_ACCEPTABLE.value(), + (!this.isNull(users))?"":"手机号不存在"); + } + + + + @ApiOperation(value="密码重置",httpMethod="POST",response=MsgModel.class, + notes="重置密码,提交用户手机验证码,用户手机号,以及新密码") + @ApiImplicitParams({ + @ApiImplicitParam(name="code",value="验证码",required=true,dataType="String"), + @ApiImplicitParam(name="phone",value="手机号",required=true,dataType="String"), + @ApiImplicitParam(name="password",value="密码",required=true,dataType="String") + }) + @RequestMapping(value="/password",method=RequestMethod.POST) + public @ResponseBody MsgModel reset(@RequestBody Map paramMap) + { + int count=0; + User user=new User(); + if(Optional.of(paramMap) + .filter(code->paramMap.get("code")!=null) + .filter(phone->paramMap.get("phone")!=null) + .filter(password->paramMap.get("password")!=null) + .isPresent() + &&redisTemplate.hasKey(paramMap.get("phone").toString())) + { + user.setPassword(this.md5(paramMap.get("password").toString())); + UserExample userExample=new UserExample(); + userExample.createCriteria().andPhoneEqualTo(user.getPhone()); + count=userService.updateByExampleSelective(user, userExample); + redisTemplate.delete(paramMap.get("phone").toString()); + } + //重置成功,短信通知用户 + if(count==1) + { + JSONObject paramJson=new JSONObject(); + paramJson.put("password", paramMap.get("password")); + smsService.sendMessage( + AliSms.ALI_MESSAGE_SIGN_NAME.ES_TECH.getValue(), + paramMap.get("phone").toString(), + AliSms.ALI_MESSAGE_TEMPLATE_CODE.PASSWORD_RESET.getValue(), + paramJson.toJSONString()); + } + return new MsgModel(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"":"密码重置失败"); + } + + + + @ApiOperation(value="新密码短信通知",httpMethod="POST",response=MsgModel.class, + notes="用户重置密码,将密码通过短信形式发送至手机") + @RequestMapping(value="/notice") + public @ResponseBody MsgModel resetNotice(@RequestBody Map paramMap) + { + + return new MsgModel(); + } +} diff --git a/src/main/java/com/es/disped/web/controller/role/RoleController.java b/src/main/java/com/es/disped/web/controller/role/RoleController.java new file mode 100644 index 0000000000000000000000000000000000000000..e3438d733491ec886756f64449b53f061b1ec68c --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/role/RoleController.java @@ -0,0 +1,225 @@ +package com.es.disped.web.controller.role; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.apache.shiro.authz.annotation.Logical; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.slf4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.es.disped.api.role.RoleService; +import com.es.disped.api.userrole.UserRoleRelService; +import com.es.disped.common.constant.RecordStatus; +import com.es.disped.common.model.MsgModel; +import com.es.disped.core.annotation.LogInject; +import com.es.disped.core.controller.BaseController; +import com.es.disped.dao.model.Role; +import com.es.disped.dao.model.RoleExample; +import com.es.disped.dao.model.RoleNode; +import com.es.disped.dao.model.RoleType; +import com.es.disped.dao.model.UserRoleRelExample; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; + +/** + * @author Anson
+ * + * Copyright by EasyShare 2019
+ * + * All right reserved
+ * + * Created on 下午5:00:13
+ * + * 名称:RoleController.java
+ * + * 描述:角色管理
+ */ +@Api(value="角色管理") +@Controller +@RequestMapping("/manage/role") +public class RoleController extends BaseController{ + + private static final String NAMESPACE="com.es.disped.dao.mapper.role.RoleCustomMapper"; + + @LogInject + private static Logger log; + + @Autowired + RoleService roleService; + + @Autowired + UserRoleRelService userRoleRelService; + + @ApiOperation(value="新增角色",httpMethod="POST",response=MsgModel.class,notes="新增角色-管理端") + @RequiresPermissions(value= {"admin:save","sys:save"},logical=Logical.OR) + @RequestMapping(value="/save",method=RequestMethod.POST) + @Transactional + public @ResponseBody MsgModel save(@RequestBody @ApiParam(name="role",value="角色对象",required=true) Role role) + { + int count=0; + if(Optional.of(role) + .filter(name->role.getRoleName()!=null) + .filter(parentId->role.getRoleParentId()!=null) + .filter(code->role.getRoleCode()!=null) + .isPresent()) + { + role.setRoleId(getUUID()); + role.setRoleType(RoleType.ROLE.getValue()); + role.setRoleValid(RecordStatus.USEAGE.getValue()); + count=roleService.insertSelective(role); + //修改角色父类节点类型 + Role oldParentNode=roleService.selectByPrimaryKey(role.getRoleParentId()); + if(RoleType.ROLE.getValue().equals(oldParentNode.getRoleType())) + { + Role parentNode=new Role(); + parentNode.setRoleType(RoleType.GROUP.getValue()); + RoleExample roleExample=new RoleExample(); + roleExample.createCriteria().andRoleIdEqualTo(oldParentNode.getRoleId()); + roleService.updateByExampleSelective(parentNode, roleExample); + } + } + log.debug(count==1?HttpStatus.OK.value()+"-角色写入成功": + HttpStatus.EXPECTATION_FAILED.value()+"-保存失败",role); + return new MsgModel(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"角色写入成功":"保存失败", role); + } + + @ApiOperation(value="更新角色",httpMethod="POST",response=MsgModel.class,notes="更新角色-管理端") + @RequiresPermissions(value= {"admin:update","sys:update"},logical=Logical.OR) + @RequestMapping(value="/update",method=RequestMethod.POST) + public @ResponseBody MsgModel update(@RequestBody @ApiParam(name="role",value="角色对象",required=true) Role role) + { + int count=0; + if(Optional.of(role) + .filter(id->role.getRoleId()!=null) + .isPresent()) + { + count=roleService.updateByPrimaryKeySelective(role); + } + log.debug(count==1?HttpStatus.OK.value()+"-角色更新成功": + HttpStatus.EXPECTATION_FAILED.value()+"-角色更新失败",role); + return new MsgModel(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"角色更新成功":"角色更新失败", role); + } + + @ApiOperation(value="删除角色",httpMethod="POST",response=MsgModel.class,notes="删除角色-系统端") + @RequiresPermissions(value= {"admin:delete","sys:delete"},logical=Logical.OR) + @Transactional + @RequestMapping(value="/delete",method=RequestMethod.POST) + public @ResponseBody MsgModel delete(@RequestBody @ApiParam(name="role",value="角色对象",required=true) Role role) + { + int relCount=0,roleCount=0; + if(Optional.of(role) + .filter(rId->role.getRoleId()!=null) + .filter(rpId->role.getRoleParentId()!=null) + .isPresent()) + { + //删除角色引用 + UserRoleRelExample userRoleRelExample=new UserRoleRelExample(); + userRoleRelExample.createCriteria().andRoleIdEqualTo(role.getRoleId()); + relCount=userRoleRelService.deleteByExample(userRoleRelExample); + //删除角色节点及子节点 + RoleExample roleExample=new RoleExample(); + roleExample.createCriteria().andRoleParentIdEqualTo(role.getRoleId()); + roleCount+=roleService.deleteByExample(roleExample); + roleCount+=roleService.deleteByPrimaryKey(role.getRoleId()); + //修改当前角色父节点类型 + RoleExample parentExample=new RoleExample(); + parentExample.createCriteria().andRoleParentIdEqualTo(role.getRoleParentId()); + List list=roleService.selectByExample(parentExample); + if(this.isNull(list)) + { + Role parentNode=new Role(); + parentNode.setRoleType(RoleType.ROLE.getValue()); + RoleExample parentRoleExample=new RoleExample(); + parentRoleExample.createCriteria().andRoleIdEqualTo(parentNode.getRoleId()); + roleService.updateByExampleSelective(parentNode, parentRoleExample); + } + } + log.debug(roleCount>=1?HttpStatus.OK.value()+"-角色删除成功,共删除"+roleCount+"个角色,"+relCount+"个引用": + HttpStatus.EXPECTATION_FAILED.value()+"-角色删除失败,共删除"+roleCount+"个角色,"+relCount+"个引用"); + return new MsgModel(roleCount>=1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + roleCount>=1?"角色删除成功,共删除"+roleCount+"个角色,"+relCount+"个引用":"角色删除失败"); + } + + + + @ApiOperation(value="角色检索",httpMethod="POST",response=MsgModel.class,notes="角色检索-系统端") + @RequestMapping(value="/list",method=RequestMethod.POST) + public @ResponseBody MsgModel list(@RequestBody @ApiParam(name="role",value="角色对象",required=false) Role role) + { + RoleExample roleExample=new RoleExample(); + if(!this.isNull(role.getRoleName())) + { + roleExample.createCriteria().andRoleNameLike("%"+role.getRoleName()+"%"); + } + if(!this.isNull(role.getRoleId())) + { + roleExample.createCriteria().andRoleIdEqualTo(role.getRoleId()); + } + List roles=roleService.selectByExample(roleExample); + return new MsgModel(roles.size()>0?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + roles.size()>0?"":"角色检索不到", roles.size()>0?roles:""); + } + +// @ApiOperation(value="角色分页查询",httpMethod="POST",response=MsgModel.class,notes="角色分页查询-系统端") +// @RequiresPermissions(value= {"admin:select","sys:select"},logical=Logical.OR) +// @RequestMapping(value="/pages",method=RequestMethod.POST) +// public @ResponseBody MsgModel pages(@RequestBody @ApiParam(name="paramMap",value="分页查询参数[offset,limit]",required=true) Map paramMap) +// { +// RoleExample roleExample=new RoleExample(); +// PageModel pageModel=null; +// if(Optional.of(paramMap) +// .filter(offset->paramMap.containsKey("offset")!=false) +// .filter(limit->paramMap.containsKey("limit")!=false) +// .isPresent()) +// { +// pageModel=roleService.selectByExampleForOffsetPage(roleExample, +// Integer.valueOf(paramMap.get("offset").toString()), Integer.valueOf(paramMap.get("limit").toString())); +// } +// return new MsgModel(pageModel!=null?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), +// pageModel!=null?"":"角色检索不到", pageModel!=null?pageModel:""); +// } + + @ApiOperation(value="获取角色Tree结构列表",httpMethod="POST",response=MsgModel.class,notes="根据角色ID对应节点向下检索拉取Tree,id可为null-系统端") + @RequestMapping(value="/roleTree",method=RequestMethod.POST) + public @ResponseBody MsgModel getRoleTree(@RequestBody @ApiParam(name="paramMap",value="当前检索的Tree的起始节点ID,若默认为空则从根节点开始",required=false) Map paramMap) + { + if (!paramMap.containsKey("id")) { + paramMap.put("id", "00000000000000000000000000000000"); + } + List nodeList = new ArrayList<>(); + List rootList = this.getService().selectList(NAMESPACE+".getRoleNode", paramMap.get("id")); + for (RoleNode roleNode : rootList) { + roleNode.setChildren(getRoleNode(roleNode.getId())); + nodeList.add(roleNode); + } + return new MsgModel(nodeList.size()>0?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + nodeList.size()>0?"":"列表加载失败", nodeList.size()>0?nodeList:""); + } + + /** + * 角色 tree 结构加载
+ * + * @param pid 父Id + * @return List 角色节点列表集合 + */ + private List getRoleNode(String pid) { + List roleList = this.getService().selectList(NAMESPACE+".getRoleNode", pid); + return roleList; + } + + +} diff --git a/src/main/java/com/es/disped/web/controller/rolepermission/RolePermissionController.java b/src/main/java/com/es/disped/web/controller/rolepermission/RolePermissionController.java new file mode 100644 index 0000000000000000000000000000000000000000..b53b010e54d66addfde04944053f4ebb899d6ce2 --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/rolepermission/RolePermissionController.java @@ -0,0 +1,157 @@ +/** + * + */ +package com.es.disped.web.controller.rolepermission; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.apache.shiro.authz.annotation.Logical; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.slf4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.es.disped.api.rolepermission.RolePermissionService; +import com.es.disped.common.model.MsgModel; +import com.es.disped.core.annotation.LogInject; +import com.es.disped.core.controller.BaseController; +import com.es.disped.dao.model.PermissionNode; +import com.es.disped.dao.model.RolePermissionRel; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; + +/** + * @author Anson
+ * + * Copyright by EasyShare 2019
+ * + * All right reserved
+ * + * Created on 上午10:59:17
+ * + * 名称:PermissionForRoleController.java
+ * + * 描述:角色赋予权限
+ */ +@Api(value="角色赋予权限") +@Controller +@RequestMapping("/manage/permission/role") +public class RolePermissionController extends BaseController{ + + private static final String NAMESPACE="com.es.disped.dao.mapper.permission.PermissionCustomMapper"; + + @LogInject + Logger log; + + @Autowired + RolePermissionService rolePermissionService; + + @ApiOperation(value="保存角色权限引用",httpMethod="POST",response=MsgModel.class,notes="为角色新增权限") + @RequiresPermissions(value= {"admin:save","sys:save"},logical=Logical.OR) + @RequestMapping(value="/save",method=RequestMethod.POST) + public @ResponseBody MsgModel save( @RequestBody @ApiParam(name="rolePermissionRel",value="角色权限引用关系对象",required=true) RolePermissionRel rolePermissionRel) + { + int count=0; + if(Optional.of(rolePermissionRel) + .filter(roleid->rolePermissionRel.getRoleId()!=null) + .filter(pid->rolePermissionRel.getPermissionId()!=null) + .isPresent()) + { + rolePermissionRel.setRelId(getUUID()); + count=rolePermissionService.insert(rolePermissionRel); + } + log.debug(count==1?HttpStatus.OK.value()+"-为角色新增权限成功" + :HttpStatus.EXPECTATION_FAILED.value()+"-为角色新增权限失败"); + return new MsgModel(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"为角色新增权限成功":"为角色新增权限失败", rolePermissionRel); + } + + @ApiOperation(value="更新角色权限引用",httpMethod="POST",response=MsgModel.class,notes="为角色更新权限") + @RequiresPermissions(value= {"admin:update","sys:update"},logical=Logical.OR) + @RequestMapping(value="/update",method=RequestMethod.POST) + public @ResponseBody MsgModel update( @RequestBody @ApiParam(name="rolePermissionRel",value="角色权限引用关系对象",required=true) RolePermissionRel rolePermissionRel) + { + int count=0; + if(Optional.of(rolePermissionRel) + .filter(relid->rolePermissionRel.getRelId()!=null) + .isPresent()) + { + count=rolePermissionService.updateByPrimaryKeySelective(rolePermissionRel); + } + log.debug(count==1?HttpStatus.OK.value()+"-为角色更新权限成功" + :HttpStatus.EXPECTATION_FAILED.value()+"-为角色更新权限失败"); + return new MsgModel(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"为角色更新权限成功":"为角色更新权限失败", rolePermissionRel); + } + + @ApiOperation(value="回收角色权限引用",httpMethod="POST",response=MsgModel.class,notes="回收角色权限") + @RequiresPermissions(value= {"admin:delete","sys:delete"},logical=Logical.OR) + @RequestMapping(value="/recycle",method=RequestMethod.POST) + public @ResponseBody MsgModel recycle( @RequestBody @ApiParam(name="rolePermissionRel",value="角色权限引用关系对象",required=true,example="relId=XXXX") RolePermissionRel rolePermissionRel) + { + int count=0; + String relId=rolePermissionRel.getRelId(); + if(!this.isNull(relId)) + { + count=rolePermissionService.deleteByPrimaryKey(relId); + } + log.debug(count==1?HttpStatus.OK.value()+"-回收角色权限成功" + :HttpStatus.EXPECTATION_FAILED.value()+"-回收角色权限失败"); + return new MsgModel(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"回收角色权限成功":"回收角色权限失败"); + } + + @ApiOperation(value="获取 checkbox 形式的 tree 结构(为角色管理提供支持)",response=MsgModel.class,httpMethod="POST", + notes="根据角色ID和权限父类ID获取checked类型Tree列表-管理端") +// @ApiImplicitParams({ +// @ApiImplicitParam(name="roleId",value="角色ID",required=true), +// @ApiImplicitParam(name="permissionId",value="当前检索的角色类型的权限节点ID,若默认为空则从根节点开始",required=false) +// }) + @RequiresPermissions(value= {"admin:select","sys:select"},logical=Logical.OR) + @RequestMapping(value="/permissionCheckedTree",method=RequestMethod.POST) + public @ResponseBody MsgModel getPermissionCheckedTree(@RequestBody @ApiParam(name="paramMap",value="当前检索的角色类型的权限节点ID,若默认为空则从根节点开始",required=false) Map paramMap) + { + if (!paramMap.containsKey("permissionId")) { + paramMap.put("permissionId", "00000000000000000000000000000000"); + } + + List nodeList=new ArrayList<>(); + List rootList=this.getService().selectList(NAMESPACE+".getPermissionCheckedNode", paramMap); + for(PermissionNode permissionNode:rootList) + { + permissionNode.setChildren(getPermissionCheckedNode(paramMap.get("roleId").toString(), permissionNode.getId())); + nodeList.add(permissionNode); + } + return new MsgModel(nodeList.size()>0?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + nodeList.size()>0?"":"列表加载失败", nodeList.size()>0?nodeList:""); + } + + + /** + * 获取 checkbox 形式的 tree 结构(为角色管理提供支持) + * @param roleId + * {@link String} roleId 角色ID + * @param pid + * {@link String} pid 权限父类ID + * @return + * List 权限节点列表集合 + */ + private List getPermissionCheckedNode(String roleId, String pid) { + Map paramMap = new HashMap<>(); + paramMap.put("roleId", roleId); + paramMap.put("permissionId", pid); + List permissionList=this.getService().selectList(NAMESPACE+".getPermissionCheckedNode", paramMap); + return permissionList; + } +} diff --git a/src/main/java/com/es/disped/web/controller/settings/SettingController.java b/src/main/java/com/es/disped/web/controller/settings/SettingController.java new file mode 100644 index 0000000000000000000000000000000000000000..dc52e70c7a4f0bbd6c1fbcd6f374c04730306267 --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/settings/SettingController.java @@ -0,0 +1,116 @@ +package com.es.disped.web.controller.settings; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.es.disped.common.constant.RecordStatus; +import com.es.disped.common.model.MsgModel; +import com.es.disped.core.controller.BaseController; +import com.es.disped.dao.model.MenuType; +import com.es.disped.dao.model.PermissionType; +import com.es.disped.dao.model.RoleType; +import com.es.disped.dao.model.UserType; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; + +@Api(value="属性配置") +@Controller +@RequestMapping("/common/setting") +public class SettingController extends BaseController { + + private final String MENU="menu"; + private final String RECORD="record"; + private final String PERMISSION="permission"; + private final String ROLE="role"; + private final String USER="user"; + + @ApiOperation(value="菜单类型",response=MsgModel.class,httpMethod="POST",notes="获取菜单类型") + @RequestMapping(value="/property",method=RequestMethod.POST) + public @ResponseBody MsgModel getProperties(@RequestBody @ApiParam(name="properties",value="需要获取的属性名称['menu','record','permission','role','user']",required=true) List properties) + { + List> lists=new ArrayList>(); + for(String property:properties) + { + if(MENU.equals(property)) + { + lists.add(getMenuTypes()); + }else if(RECORD.equals(property)) + { + lists.add(getRecordStatusTypes()); + }else if(PERMISSION.equals(property)) + { + lists.add(getPermissionTypes()); + }else if(ROLE.equals(property)) + { + lists.add(getRoleTypes()); + }else if(USER.equals(property)) + { + lists.add(getUserTypes()); + } + } + return new MsgModel(lists.size()>0?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + lists.size()>0?"":"获取失败", lists.size()>0?lists:""); + } + + private Map getUserTypes() { + Map map=new HashMap(); + List userTypes=Arrays.asList(UserType.values()); + for(UserType userType:userTypes) + { + map.put(userType.getValue(), userType.getName()); + } + return map; + } + + private Map getRoleTypes() { + Map map=new HashMap(); + List roleTypes=Arrays.asList(RoleType.values()); + for(RoleType roleType:roleTypes) + { + map.put(roleType.getValue(), roleType.getName()); + } + return map; + } + + private Map getPermissionTypes() { + Map map=new HashMap(); + List permissionTypes=Arrays.asList(PermissionType.values()); + for(PermissionType permissionType:permissionTypes) + { + map.put(permissionType.getValue(), permissionType.getName()); + } + return map; + } + + private Map getRecordStatusTypes() { + Map map=new HashMap(); + List recordStatus=Arrays.asList(RecordStatus.values()); + for(RecordStatus status:recordStatus) + { + map.put(String.valueOf(status.getValue()), status.getName()); + } + return map; + } + + private Map getMenuTypes() { + Map map=new HashMap(); + List menuTypes=Arrays.asList(MenuType.values()); + for(MenuType menuType:menuTypes) + { + map.put(menuType.getValue(), menuType.getName()); + } + return map; + } +} diff --git a/src/main/java/com/es/disped/web/controller/sms/SmsController.java b/src/main/java/com/es/disped/web/controller/sms/SmsController.java new file mode 100644 index 0000000000000000000000000000000000000000..d74dfe34fe2df80d525f48a587f20d9173b650ec --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/sms/SmsController.java @@ -0,0 +1,228 @@ +/** + * + */ +package com.es.disped.web.controller.sms; + +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.TimeUnit; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.es.disped.api.sms.SmsService; +import com.es.disped.common.constant.AliSms; +import com.es.disped.common.model.MsgModel; +import com.es.disped.core.controller.BaseController; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; + +/** + * @author Anson
+ * + * Copyright by EasyShare 2019
+ * + * All right reserved
+ * + * Created on 下午4:06:29
+ * + * 名称:SmsController.java
+ * + * 描述:
+ */ +@Api("短信发送") +@Controller +@RequestMapping("/sms") +public class SmsController extends BaseController{ + + @Autowired + SmsService smsService; + @Autowired + RedisTemplate redisTemplate; + +// @RequestMapping(value="/templatecode/list",method=RequestMethod.POST) +// public @ResponseBody MsgModel getTemplateCodeList() +// { +// Map tempalteCodeMap=new HashMap(); +// for(AliSms.ALI_MESSAGE_TEMPLATE_CODE templateCode:AliSms.ALI_MESSAGE_TEMPLATE_CODE.values()) +// { +// tempalteCodeMap.put(templateCode.getName(), templateCode.getValue()); +// } +// return new MsgModel(HttpStatus.OK.value(), "短信模板获取成功",tempalteCodeMap); +// } + + + + /** + * 手机号认证-验证码请求 + * + * @param paramMap + * {@link Map} 请求参数-phone + * @return + * {@link MsgModel} 消息返回对象 + */ + @ApiOperation(value="短信验证码发送",response=MsgModel.class,httpMethod="POST",notes="发送短信验证码") + @ApiImplicitParam(name="phone",value="手机号",required=true,dataType="String") + @RequestMapping(value="/send/code",method=RequestMethod.POST) + public @ResponseBody MsgModel sendVertifyCode(@RequestBody Map paramMap) + { + String vertifyCode=String.valueOf((int)((Math.random()*9+1)*1000000)); + String templateCode=AliSms.ALI_MESSAGE_TEMPLATE_CODE.VERTIFY_CODE.getValue(); + String phone=paramMap.get("phone").toString(); + JSONObject paramJson= new JSONObject(); + paramJson.put("code", vertifyCode); + MsgModel msgModel=smsService.sendMessage(AliSms.ALI_MESSAGE_SIGN_NAME.ES_TECH.getValue(), phone, + templateCode, paramJson.toJSONString()); + if(msgModel.getStatus()==HttpStatus.OK.value()&&msgModel.getMsg().equals("OK")) + { + redisTemplate.opsForValue().set(phone, vertifyCode,30,TimeUnit.MINUTES); + } + return new MsgModel((msgModel.getStatus()==HttpStatus.OK.value() + &&msgModel.getMsg().equals("OK"))?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value() + , (msgModel.getStatus()==HttpStatus.OK.value() + &&msgModel.getMsg().equals("OK"))?"验证码发送成功":msgModel.getMsg()); + } + + + /** + * 验证码校验 + * @param paramMap + * phone-value手机号
+ * code-value验证码 + * @return + * {@link MsgModel} + */ + @ApiOperation(value="验证短信验证码",httpMethod="POST",response=MsgModel.class,notes="验证短信验证码是否正确") + @ApiImplicitParams({ + @ApiImplicitParam(name="phone", value="用户手机号",required=true,dataType="String"), + @ApiImplicitParam(name="code", value="验证码",required=true,dataType="String") + }) + @RequestMapping(value="/vertify/code",method=RequestMethod.POST) + public @ResponseBody MsgModel vertify(@RequestBody Map paramMap) + { + String phone=paramMap.get("phone").toString(); + String code=paramMap.get("code").toString(); + String redisCode=redisTemplate.opsForValue().get(phone); + return new MsgModel(redisCode.equals(code)?HttpStatus.OK.value():HttpStatus.NOT_FOUND.value(), + redisCode.equals(code)?"":"验证失败"); + } + + /** + * 一对一短信发送 + * @param paramMap + * phone-value手机号
+ * paramJson-value("content":"value")参数内容,JSON格式 + * @return + * {@link MsgModel} + */ + @ApiOperation(value="一对一发送短信",response=MsgModel.class,httpMethod="POST", + notes="一对一短信发送,提交参数中,paramJson变量值为JSON对象->content:value") + @ApiImplicitParams({ + @ApiImplicitParam(name="phone",value="手机号",required=true,dataType="String",example="{phone:'11111111111',paramJson:'{'content':'新消息'}'}"), + @ApiImplicitParam(name="paramJson",value="短信内容的JSON字符串{'content':'XXX'},content名称不可变",required=true,dataType="String") + }) + @RequestMapping(value="/send/notice",method=RequestMethod.POST) + public @ResponseBody MsgModel sendMessage(@RequestBody Map paramMap) + { + String phone=paramMap.get("phone").toString(); + String paramJson=paramMap.get("paramJson").toString(); + MsgModel msgModel=smsService.sendMessage(AliSms.ALI_MESSAGE_SIGN_NAME.ES_TECH.getValue(), + phone, AliSms.ALI_MESSAGE_TEMPLATE_CODE.ORDINARY_NOTICE.getValue(), paramJson); + return new MsgModel((msgModel.getStatus()==HttpStatus.OK.value() + &&msgModel.getMsg().equals("OK"))?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value() + , (msgModel.getStatus()==HttpStatus.OK.value() + &&msgModel.getMsg().equals("OK"))?"通知发送成功":msgModel.getMsg()); + } + + + /** + * 群发短信 + * @param paramMap + * phone-value的JSON数组,名为phoneJsonArray
+ * content-value的的json对象,名为paramJson + * @return + * {@link MsgModel} + */ + @ApiOperation(value="群发短信",response=MsgModel.class,httpMethod="POST", + notes="短信群发,提交参数中,paramJson变量值为JSON对象->content:value") + @ApiImplicitParams({ + @ApiImplicitParam(name="phoneJsonArray",value="phonjson数组",required=true,dataType="String"), + @ApiImplicitParam(name="paramJson",value="json字符串{'content':'XXX'}",required=true,dataType="String") + }) + @RequestMapping(value="/send/batch",method=RequestMethod.POST) + public @ResponseBody MsgModel sendBatch(@RequestBody Map paramMap) + { + JSONArray phoneJsonArray=(JSONArray) paramMap.get("phoneJsonArray"); + JSONArray signNameJsonArray= new JSONArray(); + JSONArray paramJsonArray=new JSONArray(); + for(int i=0;i + * phone-value;sendDate-value;offset-value;limit-value + * @return + * {@link MsgModel} + */ + @ApiOperation(value="短信查询接口",response=MsgModel.class,httpMethod="POST", + notes="查询已发送的短信,手机号,发送日期,当前查询页,每页数据容量") + @ApiImplicitParams({ + @ApiImplicitParam(name="phone",value="手机号",required=true,dataType="String"), + @ApiImplicitParam(name="sendDate",value="发送日期",required=true,dataType="String"), + @ApiImplicitParam(name="offset",value="查询位置",required=true,dataType="Integer"), + @ApiImplicitParam(name="limit",value="查询数量", required=true,dataType="Integer") + }) + @RequestMapping(value="/query",method=RequestMethod.POST) + public @ResponseBody MsgModel query(@RequestBody Map paramMap) + { + MsgModel msgModel=null; + if(Optional.of(paramMap) + .filter(phone->paramMap.get("phone")!=null) + .filter(sendDate->paramMap.get("sendDate")!=null) + .filter(currentPage->paramMap.get("offset")!=null) + .filter(pageSize->paramMap.get("limit")!=null) + .isPresent()) + { + msgModel=smsService.queryMessage( + paramMap.get("phone").toString(), + paramMap.get("sendDate").toString(), + Long.valueOf(paramMap.get("offset").toString()), + Long.valueOf(paramMap.get("limit").toString())); + } + + return new MsgModel((msgModel.getStatus()==HttpStatus.OK.value() + &&msgModel.getMsg().equals("OK"))?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value() + , (msgModel.getStatus()==HttpStatus.OK.value() + &&msgModel.getMsg().equals("OK"))?"":msgModel.getMsg() + , (msgModel.getStatus()==HttpStatus.OK.value() + &&msgModel.getMsg().equals("OK"))?msgModel.getRes():""); + } +} diff --git a/src/main/java/com/es/disped/web/controller/syllabus/SyllabusController.java b/src/main/java/com/es/disped/web/controller/syllabus/SyllabusController.java new file mode 100644 index 0000000000000000000000000000000000000000..43793e352952fc7df63c0875ed0eec401a045c3d --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/syllabus/SyllabusController.java @@ -0,0 +1,171 @@ +package com.es.disped.web.controller.syllabus; + +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.apache.shiro.authz.annotation.Logical; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.es.disped.api.syllabus.SyllabusService; +import com.es.disped.common.constant.RecordStatus; +import com.es.disped.common.model.MsgModel; +import com.es.disped.common.model.PageModel; +import com.es.disped.core.controller.BaseController; +import com.es.disped.dao.model.Syllabus; +import com.es.disped.dao.model.SyllabusExample; +import com.es.disped.dao.model.TemplateForeignModel; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; + +@Api(value="教学大纲管理") +@Controller +@RequestMapping("/manage/syllabus") +public class SyllabusController extends BaseController{ + + private final String TEMPLATE_NAMESPACE="com.es.disped.dao.mapper.template.TemplateCustomMapper"; + + private final String SYLLABUS_NAMESPACE="com.es.disped.dao.mapper.syllabus.SyllabusCustomMapper"; + + @Autowired + SyllabusService syllabusService; + + @ApiOperation(value="新增教学大纲",response=MsgModel.class,httpMethod="POST",notes="添加教学大纲") + @RequiresPermissions(value={"admin:save","sys:save"},logical=Logical.OR) + @Transactional + @RequestMapping(value="/save",method=RequestMethod.POST) + public @ResponseBody MsgModel save(@RequestBody @ApiParam(name="syllabus",value="教学大纲对象",required=true) Syllabus syllabus) + { + int count=0; + if(Optional.of(syllabus) + .filter(name->syllabus.getSyllabusName()!=null) + .filter(tpId->syllabus.getTemplateId()!=null) + .filter(address->syllabus.getAddress()!=null) + .filter(bday->syllabus.getSyllabusBeginDay()!=null) + .filter(eday->syllabus.getSyllabusEndDay()!=null) + .filter(thway->syllabus.getTeachWay()!=null) + .filter(redate->syllabus.getReminderTime()!=null) + .isPresent()) + { + syllabus.setSyllabusId(getUUID()); + TemplateForeignModel foreignModel=this.getService().selectOne( + TEMPLATE_NAMESPACE+".getTemplateForeignModel", syllabus.getTemplateId()); + syllabus.setTemplateName(foreignModel.getTemplateName()); + syllabus.setSyllabusValid(RecordStatus.USEAGE.getValue()); + count=syllabusService.insertSelective(syllabus); + } + return this.resultMsg(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"保存成功":"保存失败",count==1?syllabus:""); + } + + + @ApiOperation(value="更新教学大纲",response=MsgModel.class,httpMethod="POST",notes="更新教学大纲") + @RequiresPermissions(value={"admin:update","sys:update"},logical=Logical.OR) + @Transactional + @RequestMapping(value="/update",method=RequestMethod.POST) + public @ResponseBody MsgModel update(@RequestBody @ApiParam(name="syllabus",value="教学大纲对象",required=true) Syllabus syllabus) + { + int count=0; + if(!this.isNull(syllabus.getSyllabusId())) + { + if(!this.isNull(syllabus.getTemplateId())) + { + TemplateForeignModel foreignModel=this.getService().selectOne( + TEMPLATE_NAMESPACE+".getTemplateForeignModel", syllabus.getTemplateId()); + syllabus.setTemplateName(foreignModel.getTemplateName()); + } + count=syllabusService.updateByPrimaryKeySelective(syllabus); + } + return this.resultMsg(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"更新成功":"更新失败",count==1?syllabus:""); + } + + + @ApiOperation(value="删除教学大纲",response=MsgModel.class,httpMethod="POST",notes="删除教学大纲") + @RequiresPermissions(value={"admin:delete","sys:delete"},logical=Logical.OR) + @RequestMapping(value="/delete",method=RequestMethod.POST) + public @ResponseBody MsgModel delete(@RequestBody @ApiParam(name="syllabus",value="教学大纲对象",required=true) Syllabus syllabus) + { + int count=0; + if(!this.isNull(syllabus.getSyllabusId())) + { + count=this.getService().delete(SYLLABUS_NAMESPACE+".deleteSyllabusModel", syllabus.getSyllabusId()); + } + return this.resultMsg(count>=1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count>=1?"删除成功":"删除失败",count>=1?syllabus:""); + } + + + @ApiOperation(value="检索教学大纲",response=MsgModel.class,httpMethod="POST", + notes="检索教学大纲,精确检索:主键,课程模板ID,开始及截止日期;模糊检索:大纲名称,课程模板名称,上课地址,教学类型") + @RequestMapping(value="/list",method=RequestMethod.POST) + public @ResponseBody MsgModel list(@RequestBody @ApiParam(name="syllabus",value="教学大纲对象",required=false) Syllabus syllabus) + { + SyllabusExample listExample=new SyllabusExample(); + SyllabusExample.Criteria criteria=listExample.createCriteria(); + if(!this.isNull(syllabus.getSyllabusId())) + { + criteria.andSyllabusIdEqualTo(syllabus.getSyllabusId()); + } + if(!this.isNull(syllabus.getSyllabusName())) + { + criteria.andSyllabusNameLike("%"+syllabus.getSyllabusName()+"%"); + } + if(!this.isNull(syllabus.getTemplateId())) + { + criteria.andTemplateIdEqualTo(syllabus.getTemplateId()); + } + if(!this.isNull(syllabus.getTemplateName())) + { + criteria.andTemplateNameLike("%"+syllabus.getTemplateName()+"%"); + } + if(!this.isNull(syllabus.getAddress())) + { + criteria.andAddressLike("%"+syllabus.getAddress()+"%"); + } + if(!this.isNull(syllabus.getSyllabusBeginDay())) + { + criteria.andSyllabusBeginDayGreaterThanOrEqualTo(syllabus.getSyllabusBeginDay()); + } + if(!this.isNull(syllabus.getSyllabusEndDay())) + { + criteria.andSyllabusEndDayLessThanOrEqualTo(syllabus.getSyllabusEndDay()); + } + if(!this.isNull(syllabus.getTeachWay())) + { + criteria.andTeachWayLike("%"+syllabus.getTeachWay()+"%"); + } + List list=syllabusService.selectByExample(listExample); + return this.resultMsg(!this.isNull(list)?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + !this.isNull(list)?"加载成功":"查询失败",!this.isNull(list)?list:""); + } + + @ApiOperation(value="分页加载教学大纲",response=MsgModel.class,httpMethod="POST",notes="分页加载教学大纲,分页参数['offset','limit']") + @RequestMapping(value="/pages",method=RequestMethod.POST) + public @ResponseBody MsgModel pages(@RequestBody @ApiParam(name="paramMap",value="分页参数[offset,limit]",required=true) Map paramMap) + { + SyllabusExample listExample=new SyllabusExample(); + PageModel pageModel=null; + if(Optional.of(paramMap) + .filter(offset->paramMap.containsKey("offset")!=false) + .filter(limit->paramMap.containsKey("limit")!=false) + .isPresent()) + { + pageModel=syllabusService.selectByExampleForOffsetPage(listExample, + Integer.valueOf(paramMap.get("offset").toString()), Integer.valueOf(paramMap.get("limit").toString())); + + } + return this.resultMsg(!this.isNull(pageModel)?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + !this.isNull(pageModel)?"教学大纲加载成功":"教学大纲加载失败",!this.isNull(pageModel)?pageModel:""); + } +} diff --git a/src/main/java/com/es/disped/web/controller/syllabusstudent/SyllabusStudentController.java b/src/main/java/com/es/disped/web/controller/syllabusstudent/SyllabusStudentController.java new file mode 100644 index 0000000000000000000000000000000000000000..d469fb7c43a37230af4215bb6d63579e047d57bd --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/syllabusstudent/SyllabusStudentController.java @@ -0,0 +1,190 @@ +package com.es.disped.web.controller.syllabusstudent; + +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.apache.shiro.authz.annotation.Logical; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.es.disped.api.syllabusstudent.SyllabusStudentRelService; +import com.es.disped.common.model.MsgModel; +import com.es.disped.common.model.PageModel; +import com.es.disped.core.controller.BaseController; +import com.es.disped.dao.model.SyllabusForeignModel; +import com.es.disped.dao.model.SyllabusStudentRel; +import com.es.disped.dao.model.SyllabusStudentRelExample; +import com.es.disped.dao.model.UserForeignModel; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; + + +/** + * @author Anson
+ * Copyright by EasyShare 2019
+ * + * All right reserved
+ * + * Created on 2019年7月5日 下午1:02:25
+ * 名称:SyllabusStudentController.java
+ * 描述:教学大纲学生关系管理
+ */ +@Api(value="教学大纲学生关系管理-课程学生") +@Controller +@RequestMapping("/manage/syllabus/student") +public class SyllabusStudentController extends BaseController{ + + private final String USER_NAMESPACE="com.es.disped.dao.mapper.user.UserCustomMapper"; + private final String SYLLABUS_NAMESPACE="com.es.disped.dao.mapper.syllabus.SyllabusCustomMapper"; + private final String SYLLABUS_STUDENT_NAMESPACE="com.es.disped.dao.mapper.syllabusstudent.SyllabusStudentCustomMapper"; + + @Autowired + SyllabusStudentRelService syllabusStudentRelService; + + @ApiOperation(value="保存大纲授课学生关系对象",response=MsgModel.class,httpMethod="POST",notes="将学生加入教学计划中,表明学生所在的教学计划类别,不分班级") + @RequiresPermissions(value={"admin:save","sys:save"},logical=Logical.OR) + @Transactional + @RequestMapping(value="/save",method=RequestMethod.POST) + public @ResponseBody MsgModel save(@RequestBody @ApiParam(name="syllabusStudentRel",value="教学计划学生关系对象",required=true) SyllabusStudentRel syllabusStudentRel) + { + int count=0; + if(Optional.of(syllabusStudentRel) + .filter(stuId->syllabusStudentRel.getStudentId()!=null) + .filter(sylId->syllabusStudentRel.getSyllabusId()!=null) + .filter(stype->syllabusStudentRel.getStudentType()!=null) + .isPresent()) + { + syllabusStudentRel.setRelId(getUUID()); + if(this.isNull(syllabusStudentRel.getJoinDate())) + { + syllabusStudentRel.setJoinDate(this.currentDate("yyyy-MM-dd")); + } + UserForeignModel userForeignModel=this.getService().selectOne( + USER_NAMESPACE+".getUserForeignModel", syllabusStudentRel.getStudentId()); + SyllabusForeignModel syllabusForeignModel=this.getService().selectOne( + SYLLABUS_NAMESPACE+".getSyllabusForeignModel", syllabusStudentRel.getSyllabusId()); + syllabusStudentRel.setStudentName(userForeignModel.getUserName()); + syllabusStudentRel.setSyllabusName(syllabusForeignModel.getSyllabusName()); + count=syllabusStudentRelService.insertSelective(syllabusStudentRel); + } + return this.resultMsg(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"保存成功":"保存失败",count==1?syllabusStudentRel:""); + } + + + @ApiOperation(value="更新大纲授课学生关系对象",response=MsgModel.class,httpMethod="POST",notes="更新教学计划信息") + @RequiresPermissions(value={"admin:update","sys:update"},logical=Logical.OR) + @Transactional + @RequestMapping(value="/update",method=RequestMethod.POST) + public @ResponseBody MsgModel update(@RequestBody @ApiParam(name="syllabusStudentRel",value="教学计划学生关系对象",required=true) SyllabusStudentRel syllabusStudentRel) + { + int count=0; + if(Optional.of(syllabusStudentRel) + .filter(relId->syllabusStudentRel.getRelId()!=null) + .isPresent()) + { + if(!this.isNull(syllabusStudentRel.getStudentId())) + { + UserForeignModel userForeignModel=this.getService().selectOne( + USER_NAMESPACE+".getUserForeignModel",syllabusStudentRel.getStudentId()); + syllabusStudentRel.setStudentName(userForeignModel.getUserName()); + } + if(!this.isNull(syllabusStudentRel.getSyllabusId())) + { + SyllabusForeignModel syllabusForeignModel=this.getService().selectOne( + SYLLABUS_NAMESPACE+".getSyllabusForeignModel",syllabusStudentRel.getSyllabusId()); + syllabusStudentRel.setSyllabusName(syllabusForeignModel.getSyllabusName()); + } + count=syllabusStudentRelService.updateByPrimaryKey(syllabusStudentRel); + } + return this.resultMsg(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"更新成功":"更新失败",count==1?syllabusStudentRel:""); + } + + @ApiOperation(value="删除大纲授课学生关系对象",response=MsgModel.class,httpMethod="POST",notes="删除教学计划信息") + @RequiresPermissions(value={"admin:delete","sys:delete"},logical=Logical.OR) + @RequestMapping(value="/delete",method=RequestMethod.POST) + public @ResponseBody MsgModel delete(@RequestBody @ApiParam(name="syllabusStudentRel",value="教学计划学生关系对象",required=true) SyllabusStudentRel syllabusStudentRel) + { + int count=0; + if(Optional.of(syllabusStudentRel) + .filter(relId->syllabusStudentRel.getRelId()!=null) + .isPresent()) + { +// count=syllabusStudentRelService.deleteByPrimaryKey(syllabusStudentRel.getRelId()); + this.getService().delete(SYLLABUS_STUDENT_NAMESPACE+".deleteSyllabusStudentModel", syllabusStudentRel.getRelId()); + } + return this.resultMsg(count>=1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count>=1?"删除成功":"删除失败",count>=1?syllabusStudentRel:""); + } + + @ApiOperation(value="查询大纲授课学生关系对象",response=MsgModel.class,httpMethod="POST", + notes="查询教学计划信息,精确检索:关系主键,学生ID,教学大纲ID;模糊检索:学生姓名,教学大纲名称,学生类型,报名时间") + @RequestMapping(value="/list",method=RequestMethod.POST) + public @ResponseBody MsgModel list(@RequestBody @ApiParam(name="syllabusStudentRel",value="教学计划学生关系对象",required=false) SyllabusStudentRel syllabusStudentRel) + { + SyllabusStudentRelExample listExample=new SyllabusStudentRelExample(); + SyllabusStudentRelExample.Criteria criteria=listExample.createCriteria(); + + if(!this.isNull(syllabusStudentRel.getRelId())) + { + criteria.andRelIdEqualTo(syllabusStudentRel.getRelId()); + } + if(!this.isNull(syllabusStudentRel.getStudentId())) + { + criteria.andStudentIdEqualTo(syllabusStudentRel.getStudentId()); + } + if(!this.isNull(syllabusStudentRel.getSyllabusId())) + { + criteria.andSyllabusIdEqualTo(syllabusStudentRel.getSyllabusId()); + } + if(!this.isNull(syllabusStudentRel.getStudentName())) + { + criteria.andStudentNameLike("%"+syllabusStudentRel.getStudentName()+"%"); + } + if(!this.isNull(syllabusStudentRel.getSyllabusName())) + { + criteria.andSyllabusNameLike("%"+syllabusStudentRel.getSyllabusName()+"%"); + } + if(!this.isNull(syllabusStudentRel.getStudentType())) + { + criteria.andStudentTypeLike("%"+syllabusStudentRel.getStudentType()+"%"); + } + if(!this.isNull(syllabusStudentRel.getJoinDate())) + { + criteria.andJoinDateEqualTo("%"+syllabusStudentRel.getJoinDate()+"%"); + } + List list=syllabusStudentRelService.selectByExample(listExample); + return this.resultMsg(!this.isNull(list)?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + !this.isNull(list)?"加载成功":"查询失败",!this.isNull(list)?list:""); + } + + + @ApiOperation(value="分页加载教学大纲内学生关系信息",response=MsgModel.class,httpMethod="POST",notes="分页加载教学大纲内学生关系信息,分页参数['offset','limit']") + @RequestMapping(value="/pages",method=RequestMethod.POST) + public @ResponseBody MsgModel pages(@RequestBody @ApiParam(name="paramMap",value="分页参数[offset,limit]",required=true) Map paramMap) + { + SyllabusStudentRelExample listExample=new SyllabusStudentRelExample(); + PageModel pageModel=null; + if(Optional.of(paramMap) + .filter(offset->paramMap.containsKey("offset")!=false) + .filter(limit->paramMap.containsKey("limit")!=false) + .isPresent()) + { + pageModel=syllabusStudentRelService.selectByExampleForOffsetPage(listExample, + Integer.valueOf(paramMap.get("offset").toString()), Integer.valueOf(paramMap.get("limit").toString())); + } + return this.resultMsg(!this.isNull(pageModel)?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + !this.isNull(pageModel)?"教学大纲内学生关系信息加载成功":"教学大纲内学生关系信息加载失败",!this.isNull(pageModel)?pageModel:""); + } +} diff --git a/src/main/java/com/es/disped/web/controller/user/UserController.java b/src/main/java/com/es/disped/web/controller/user/UserController.java new file mode 100644 index 0000000000000000000000000000000000000000..04be838c575f14e6ca713497bbba87ab73fc298d --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/user/UserController.java @@ -0,0 +1,181 @@ +package com.es.disped.web.controller.user; + +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.apache.shiro.authz.annotation.Logical; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.slf4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.es.disped.api.sms.SmsService; +import com.es.disped.api.user.UserService; +import com.es.disped.common.constant.AliSms; +import com.es.disped.common.constant.RecordStatus; +import com.es.disped.common.model.MsgModel; +import com.es.disped.common.model.PageModel; +import com.es.disped.core.annotation.LogInject; +import com.es.disped.core.controller.BaseController; +import com.es.disped.dao.model.User; +import com.es.disped.dao.model.UserExample; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; + +@Api("用户信息管理端") +@Controller +@RequestMapping("/manage/user") +public class UserController extends BaseController{ + + @LogInject + Logger log; + @Autowired + SmsService smsService; + @Autowired + UserService userService; + + @ApiOperation(value="保存用户对象",httpMethod="POST",response=MsgModel.class, + notes="教研员保存用户信息(管理端)") + @RequiresPermissions(value= {"admin:save","sys:save"},logical=Logical.OR) + @RequestMapping(value="/save",method=RequestMethod.POST) + public @ResponseBody MsgModel save(@RequestBody @ApiParam(name="user",value="用户对象",required=true) User user) + { + int count=0; + if(Optional.of(user) + .filter(name->user.getUsername()!=null) + .filter(psd->user.getPassword()!=null) + .isPresent()) + { + user.setUserId(this.getUUID()); + user.setPassword(this.md5(user.getPassword())); + user.setUserValid(RecordStatus.VERTIFY.getValue()); + count=userService.insertSelective(user); + } + this.getSession().setAttribute("registeUser", user); + return new MsgModel(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"保存成功":"保存失败", user); + } + + + + @ApiOperation(value="更新用户对象",httpMethod="POST",response=MsgModel.class, + notes="教研员更新用户信息(管理端)") + @RequiresPermissions(value= {"admin:update","sys:update"},logical=Logical.OR) + @RequestMapping(value="/update",method=RequestMethod.POST) + public @ResponseBody MsgModel update(@RequestBody @ApiParam(name="user",value="用户对象",required=true) User user) + { + int count=0; + if(!this.isNull(user.getPassword())) + { + user.setPassword(this.md5(user.getPassword())); + } + if(!this.isNull(user.getUserId())) + { + count=userService.updateByPrimaryKeySelective(user); + } + return new MsgModel(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"更新成功":"更新失败", user); + } + + + @ApiOperation(value="检索用户对象",httpMethod="POST",response=MsgModel.class, + notes="教研员检索用户信息(管理端)") + @RequiresPermissions(value= {"admin:select","sys:select"},logical=Logical.OR) + @RequestMapping(value="/list",method=RequestMethod.POST) + public @ResponseBody MsgModel list(@RequestBody @ApiParam(name="user",value="用户对象",required=false) User user) + { + UserExample listExample=new UserExample(); + UserExample.Criteria criteria=listExample.createCriteria(); + criteria.andUserValidNotEqualTo(RecordStatus.VERTIFY.getValue()); + if(!this.isNull(user.getUsername())) + { + criteria.andUsernameLike("%"+user.getUsername()+"%"); + } + if(!this.isNull(user.getUserId())) + { + criteria.andUserIdEqualTo(user.getUserId()); + } + if(!this.isNull(user.getPhone())) + { + criteria.andPhoneLike("%"+user.getPhone()+"%"); + } + if(!this.isNull(user.getUserType())) + { + criteria.andUserTypeEqualTo(user.getUserType()); + } + List users=userService.selectByExample(listExample); + return new MsgModel(users.size()>0?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + users.size()>0?"列表加载成功":"列表加载失败", users); + } + + + @ApiOperation(value="分页获取用户列表",httpMethod="POST",response=MsgModel.class,notes="管理员获取用户信息(管理端),分页加载") + @RequiresPermissions(value= {"admin:select","sys:select"},logical=Logical.OR) + @RequestMapping(value="/pages",method=RequestMethod.POST) + public @ResponseBody MsgModel pages(@RequestBody @ApiParam(name="paramMap",value="分页参数[offset,limit]",required=true) Map paramMap) + { + UserExample userExample=new UserExample(); + userExample.createCriteria().andUserValidNotEqualTo(RecordStatus.VERTIFY.getValue()); + userExample.setOrderByClause("join_date desc"); + PageModel pageModel=null; + if(Optional.of(paramMap) + .filter(offset->paramMap.containsKey("offset")!=false) + .filter(limit->paramMap.containsKey("limit")!=false) + .isPresent()) + { + pageModel=userService.selectByExampleForOffsetPage(userExample, + Integer.valueOf(paramMap.get("offset").toString()), Integer.valueOf(paramMap.get("limit").toString())); + } + return new MsgModel(pageModel!=null?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + pageModel!=null?"":"用户列表为空", pageModel!=null?pageModel:""); + } + + + @ApiOperation(value="获取待审核新用户列表",httpMethod="POST",response=MsgModel.class, notes="管理员获取待审核新用户信息(管理端),分页加载") + @RequiresPermissions(value= {"admin:select","sys:select"},logical=Logical.OR) + @RequestMapping(value="/vertifyUserList",method=RequestMethod.POST) + public @ResponseBody MsgModel vertifyUserList(@RequestBody @ApiParam(name="paramMap",value="分页参数[offset,limit]",required=true) Map paramMap) + { + UserExample userExample=new UserExample(); + int offset=(int) paramMap.get("offset"); + int limit=(int) paramMap.get("limit"); + userExample.createCriteria().andUserValidEqualTo(RecordStatus.VERTIFY.getValue()); + PageModel users=userService.selectByExampleForOffsetPage(userExample, offset, limit); + return new MsgModel(this.isNull(users)?HttpStatus.NOT_FOUND.value():HttpStatus.OK.value(), + this.isNull(users)?"没有待审核用户":"",this.isNull(users)?null:users); + } + + + + @ApiOperation(value="审核新用户",httpMethod="POST",response=MsgModel.class, + notes="教研员审核新用户信息,需用户提交ID及手机号、状态更新值(管理端)") + @RequiresPermissions(value= {"admin:update","sys:update"},logical=Logical.OR) + @RequestMapping(value="/vertify",method=RequestMethod.POST) + public @ResponseBody MsgModel vertify(@RequestBody @ApiParam(name="user",value="用户对象",required=true) User user) + { + int count=0; + if(Optional.of(user) + .filter(userId->user.getUserId()!=null) + .isPresent()) + { + user.setUserValid(RecordStatus.USEAGE.getValue()); + count=userService.updateByPrimaryKeySelective(user); + } + //审核通过,短信通知 + if(count==1) + { + smsService.sendMessage(AliSms.ALI_MESSAGE_SIGN_NAME.ES_TECH.getValue(), user.getPhone(), + AliSms.ALI_MESSAGE_TEMPLATE_CODE.PASSWORD_RESET.getValue(), null); + } + return new MsgModel(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"":"审核不通过"); + } +} \ No newline at end of file diff --git a/src/main/java/com/es/disped/web/controller/usermenu/UserMenuController.java b/src/main/java/com/es/disped/web/controller/usermenu/UserMenuController.java new file mode 100644 index 0000000000000000000000000000000000000000..41d741926e2f642db285ec229ebb60abb59525a8 --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/usermenu/UserMenuController.java @@ -0,0 +1,44 @@ +//package com.es.disped.web.controller.usermenu; +// +//import java.util.ArrayList; +//import java.util.List; +// +//import org.springframework.http.HttpStatus; +//import org.springframework.stereotype.Controller; +//import org.springframework.web.bind.annotation.RequestMapping; +//import org.springframework.web.bind.annotation.RequestMethod; +//import org.springframework.web.bind.annotation.ResponseBody; +// +//import com.es.disped.common.model.MsgModel; +//import com.es.disped.core.controller.BaseController; +//import com.es.disped.dao.model.Menu; +//import com.es.disped.dao.model.RolePermission; +// +//import io.swagger.annotations.Api; +//import io.swagger.annotations.ApiOperation; +// +//@Api(value="用户菜单") +//@Controller +//@RequestMapping("/user/menu") +//public class UserMenuController extends BaseController { +// +// +// @ApiOperation(value="获取登录用户菜单",response=MsgModel.class,httpMethod="POST",notes="获取登录用户菜单") +// @RequestMapping(value="/init",method=RequestMethod.POST) +// public @ResponseBody MsgModel init() +// { +// if(this.isNull(this.getSessionUser())) +// { +// return new MsgModel(HttpStatus.FORBIDDEN.value(), "用户已下线"); +// } +// List ids=new ArrayList(); +// for(RolePermission rolePermission:this.getSessionUser().getUserRoles()) +// { +// ids.add(rolePermission.getRoleId()); +// } +// List menus=this.getService().selectList("com.es.disped.dao.mapper.menu.MenuCustomMapper.getUserMenuMap", ids); +// +// return new MsgModel(menus.size()>0?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), +// menus.size()>0?"":"菜单加载失败",menus.size()>0?menus:""); +// } +//} diff --git a/src/main/java/com/es/disped/web/controller/userrole/UserRoleController.java b/src/main/java/com/es/disped/web/controller/userrole/UserRoleController.java new file mode 100644 index 0000000000000000000000000000000000000000..041794e76a11e40517e25b177a2d98eb94de8b09 --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/userrole/UserRoleController.java @@ -0,0 +1,141 @@ +package com.es.disped.web.controller.userrole; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.apache.shiro.authz.annotation.Logical; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.slf4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.es.disped.api.userrole.UserRoleRelService; +import com.es.disped.common.model.MsgModel; +import com.es.disped.core.annotation.LogInject; +import com.es.disped.core.controller.BaseController; +import com.es.disped.dao.model.RoleNode; +import com.es.disped.dao.model.UserRoleRel; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; + +@Api(value="用户角色管理") +@Controller +@RequestMapping("/manage/user/role") +public class UserRoleController extends BaseController{ + + private static final String NAMESPACE="com.es.disped.dao.mapper.role.RoleCustomMapper"; + + @LogInject + private static Logger log; + + @Autowired + UserRoleRelService userRoleRelService; + + @ApiOperation(value="用户角色绑定",httpMethod="POST",response=MsgModel.class,notes="给用户赋予角色-管理端") + @RequiresPermissions(value= {"admin:save","sys:save"},logical=Logical.OR) + @RequestMapping(value="/save",method=RequestMethod.POST) + public @ResponseBody MsgModel save(@RequestBody @ApiParam(name="userRoleRel", value="用户角色关联对象",required=true) UserRoleRel userRoleRel) + { + int count=0; + if(Optional.of(userRoleRel) + .filter(uid->userRoleRel.getUserId()!=null) + .filter(rid->userRoleRel.getRoleId()!=null) + .isPresent()) + { + userRoleRel.setRelId(this.getUUID()); + count=userRoleRelService.insert(userRoleRel); + } + log.debug(count==1?HttpStatus.OK.value()+"-权限赋予成功": + HttpStatus.EXPECTATION_FAILED.value()+"-权限赋予失败", userRoleRel); + return new MsgModel(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"权限赋予成功":"权限赋予失败", userRoleRel); + } + + + + @ApiOperation(value="用户角色修改",httpMethod="POST",response=MsgModel.class,notes="修改用户角色-管理端:通过关系主键修改") + @RequiresPermissions(value= {"admin:update","sys:update"},logical=Logical.OR) + @RequestMapping(value="/update",method=RequestMethod.POST) + public @ResponseBody MsgModel update(@RequestBody @ApiParam(name="userRoleRel", value="用户角色关联对象",required=true) UserRoleRel userRoleRel) + { + int count=0; + if(Optional.of(userRoleRel) + .filter(relid->userRoleRel.getRelId()!=null) + .isPresent()) + { + count=userRoleRelService.updateByPrimaryKeySelective(userRoleRel); + } + log.debug(count==1?HttpStatus.OK.value()+"-权限修改成功": + HttpStatus.EXPECTATION_FAILED.value()+"-权限修改失败", userRoleRel); + return new MsgModel(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"权限修改成功":"权限修改失败", userRoleRel); + } + + @ApiOperation(value="回收用户角色",httpMethod="POST",response=MsgModel.class,notes="回收用户角色-管理端:通过关联主键回收") + @RequiresPermissions(value= {"admin:delete","sys:delete"},logical=Logical.OR) + @RequestMapping(value="/recycle",method=RequestMethod.POST) + public @ResponseBody MsgModel recycle(@RequestBody @ApiParam(name="userRoleRel", value="用户角色关联对象",required=true) UserRoleRel userRoleRel) + { + int count=0; + String relId=userRoleRel.getRelId(); + if(!this.isNull(relId)) + { + count=userRoleRelService.deleteByPrimaryKey(relId); + } + log.debug(count==1?HttpStatus.OK.value()+"-角色收回成功": + HttpStatus.EXPECTATION_FAILED.value()+"-角色收回失败",relId); + return new MsgModel(count==1?HttpStatus.OK.value():HttpStatus.EXPECTATION_FAILED.value(), + count==1?"角色收回成功":"角色收回失败"); + } + + + + @ApiOperation(value="获取 checkbox 形式的 tree 结构(为用户管理提供支持)",httpMethod="POST",response=MsgModel.class, + notes="根据用户ID和角色父类ID获取checked类型Tree列表-系统端") +// @ApiImplicitParams({ +// @ApiImplicitParam(name="userId",value="用户ID",required=true), +// @ApiImplicitParam(name="roleId",value="当当前检索的用户的角色节点ID,若默认为空则从根节点开始",required=false) +// }) + @RequestMapping(value = "/roleCheckedTree", method = RequestMethod.POST) + public @ResponseBody List getRoleCheckedTree(@RequestBody @ApiParam(name="paramMap",value="当前检索的用户的角色节点ID,若默认为空则从根节点开始",required=false) Map paramMap) { + + if (!paramMap.containsKey("roleId")) { + paramMap.put("roleId", "00000000000000000000000000000000"); + } + + List nodeList = new ArrayList<>(); + List rootList = this.getService().selectList(NAMESPACE+".getRoleCheckedNode", paramMap); + for (RoleNode roleNode : rootList) { + roleNode.setChildren(getRoleCheckedNode(paramMap.get("userId").toString(), roleNode.getId())); + nodeList.add(roleNode); + } + return nodeList; + } + + + + /** + * 角色 checkbox 形式 tree 加载(为用户管理提供支持)
+ * + * @param userId 用户Id + * @param pid 父Id + * @return List 角色节点列表集合 + */ + private List getRoleCheckedNode(String userId, String pid) { + Map paramMap = new HashMap<>(); + paramMap.put("userId", userId); + paramMap.put("roleId", pid); + List roleList = this.getService().selectList(NAMESPACE+".getRoleCheckedNode", paramMap); + return roleList; + } +} diff --git a/src/main/java/com/es/disped/web/controller/wechat/WeChatController.java b/src/main/java/com/es/disped/web/controller/wechat/WeChatController.java new file mode 100644 index 0000000000000000000000000000000000000000..d98a9039152fae7d06e33344af0bbbaa6021012a --- /dev/null +++ b/src/main/java/com/es/disped/web/controller/wechat/WeChatController.java @@ -0,0 +1,155 @@ +package com.es.disped.web.controller.wechat; + +import java.io.IOException; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.TimeUnit; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.slf4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.es.disped.api.user.UserService; +import com.es.disped.api.wechat.WeChatService; +import com.es.disped.common.constant.WeChat; +import com.es.disped.common.model.MsgModel; +import com.es.disped.common.wechat.http.request.WeChatRequest; +import com.es.disped.common.wechat.http.response.AccessResponse; +import com.es.disped.common.wechat.model.TextMsg; +import com.es.disped.common.wechat.signature.WeChatSignature; +import com.es.disped.core.annotation.LogInject; +import com.es.disped.core.controller.BaseController; +import com.es.disped.dao.model.User; +import com.es.disped.dao.model.UserExample; + +import io.swagger.annotations.Api; + +@Api(value="微信消息推送") +@Controller +@RequestMapping("/wechat/message") +public class WeChatController extends BaseController{ + + @LogInject + Logger logger; + @Autowired + RedisTemplate redisTemplate; + @Autowired + WeChatService weChatService; + @Autowired + UserService userService; + + + @RequestMapping(value="/signature",method=RequestMethod.GET) + @ResponseBody + public String checkSignature(WeChatRequest request) + { + System.out.println("测试微信的接入:"+request); + if (WeChatSignature.checkSignature(request)) { + logger.info("校验成功,直接返回数据"); + return request.getEchostr(); + } + logger.info("校验失败"); + return null; + } + + + + @RequestMapping(value="/course/notice",method=RequestMethod.POST) + public @ResponseBody MsgModel sendCourseReservationSuccessMessage(@RequestBody Map paramMap) + { + //若token在半小时内过期,则重新获取 + checkToken(); + + + +// String toUser=paramMap.remove("toUser").toString(); + + + + MsgModel msgModel=weChatService.sendTemplateMessage(paramMap, + WeChat.TemplateMessage.COURSE_RESERVATION_SUCCESS.getValue(), + //toUser, + "oFR0dw2TCCyaXYZMa9rmF64bp3Ao", + redisTemplate.opsForValue().get("wechat_access_token")); + return msgModel; + } + + @RequestMapping(value="/signature",method=RequestMethod.POST) + public void bindWeChatUser(HttpServletRequest request, HttpServletResponse response) + { + response.setCharacterEncoding("UTF-8"); + Map paramMap=xmlToMap(request); + String fromUserName=paramMap.get("FromUserName"); + String toUserName=paramMap.get("ToUserName"); + String msgType=paramMap.get("MsgType"); + String content=paramMap.get("Content"); + + + TextMsg textMsg=new TextMsg(); + textMsg.setFromUserName(toUserName); + textMsg.setToUserName(fromUserName); + textMsg.setCreateTime(this.currentDate("yyyy-MM-dd HH:mm:ss")); + if(WeChat.MessageType.TEXT.getValue().equals(msgType)) + { + int count=0; + if(content.length()==11) + { + User user=new User(); + user.setOpenId(fromUserName); + UserExample example=new UserExample(); + example.createCriteria().andPhoneEqualTo(content); + count=userService.updateByExampleSelective(user, example); + } + textMsg.setMsgType(WeChat.MessageType.TEXT.getValue()); + textMsg.setContent(count==1?"绑定成功":"绑定失败"); + }else if(WeChat.MessageType.EVENT.getValue().equals(msgType)) + { + String eventType=paramMap.get("Event"); + if(WeChat.MessageType.EVENT_SUBSCRIBE.getValue().equals(eventType)) + { + textMsg.setMsgType(WeChat.MessageType.TEXT.getValue()); + textMsg.setContent("感谢您的关注~\r\n请输入注册教研室平台所用的手机号进行绑定\r\n若尚未注册教研室平台,请先前往教研室平台进行注册!"); + } + } + try { + response.getWriter().write(textMsgToXml(textMsg)); + } catch (IOException e) { + e.printStackTrace(); + } + } + + + /** + * 监测accessToken是否过期 + */ + private void checkToken() + { + //若token在半小时内过期,则重新获取 + if(redisTemplate.getExpire("wechat_access_token", TimeUnit.SECONDS)<60*30) + { + MsgModel msgModel=weChatService.getAccessToken(); + if(Optional.of(msgModel) + .filter(status->msgModel.getStatus()==HttpStatus.OK.value()) + .filter(response->msgModel.getRes()!=null) + .filter(errcode->((AccessResponse)msgModel.getRes()).getErrorcode()==null) + .isPresent()) + { + AccessResponse response=(AccessResponse) msgModel.getRes(); + redisTemplate.opsForValue().set("wechat_access_token", + response.getAccess_token(), + Integer.valueOf(response.getExpires_in()), + TimeUnit.SECONDS); + } + } + } + +} diff --git a/src/main/java/com/es/disped/web/swagger2/Swagger2Config.java b/src/main/java/com/es/disped/web/swagger2/Swagger2Config.java new file mode 100644 index 0000000000000000000000000000000000000000..4987b9a734e400d4dacc913f835c8143f1e709c6 --- /dev/null +++ b/src/main/java/com/es/disped/web/swagger2/Swagger2Config.java @@ -0,0 +1,47 @@ +package com.es.disped.web.swagger2; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.stereotype.Component; +import org.springframework.web.servlet.config.annotation.EnableWebMvc; + +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.Contact; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +@Component +@Configuration +@EnableSwagger2 +@EnableWebMvc +@ComponentScan("com.es.disped") +public class Swagger2Config { + @Bean + public Docket createAPI() { + return new Docket(DocumentationType.SWAGGER_2) + .forCodeGeneration(true) + .select() + .apis(RequestHandlerSelectors.any()) + .paths(PathSelectors.any()) + .build() + .apiInfo(apiInfo()); + } + + private ApiInfo apiInfo() { + + Contact contact=new Contact("Anson","https://blog.csdn.net/j_anson","georgeanson@foxmail.com"); + ApiInfo apiInfo = new ApiInfoBuilder() + .license("Apache License Version 2.0") + .title("易享学堂平台") + .description("易享学堂平台API文档") + .contact(contact) + .version("1.0") + .build(); + return apiInfo; + } +} \ No newline at end of file diff --git a/src/main/resources/adminMenu.xml b/src/main/resources/adminMenu.xml new file mode 100644 index 0000000000000000000000000000000000000000..1098d3ddcc707c3ede72ffb84642f8fc30fd4963 --- /dev/null +++ b/src/main/resources/adminMenu.xml @@ -0,0 +1,64 @@ + + + + + + 用户管理 + /# + + + 权限管理 + /# + + + + + 角色管理 + /# + + + 菜单管理 + /# + + + + + 课程管理 + /# + + + 课程模板管理 + /# + + + 教学计划管理 + /# + + + + + + + 区域管理 + /# + + + + \ No newline at end of file diff --git a/src/main/resources/ehcache.xml b/src/main/resources/ehcache.xml new file mode 100644 index 0000000000000000000000000000000000000000..1920f7586b2bb228bd5ce51a8fd4037e15d97818 --- /dev/null +++ b/src/main/resources/ehcache.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml new file mode 100644 index 0000000000000000000000000000000000000000..0914d60f7de7ee1f45459ba45ea2a606a3f31a38 --- /dev/null +++ b/src/main/resources/logback.xml @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + + + + + + + + + ERROR + ACCEPT + DENY + + + + + ${logback.path}/%d{yyyy-MM-dd}/${logback.name}.error.log + + ${logback.maxHistory} + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n + + + + ${logback.maxSize} + + + + + + + + WARN + ACCEPT + DENY + + + + ${logback.path}/%d{yyyy-MM-dd}/${logback.name}.warn.log + + ${logback.maxHistory} + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n + + + + ${logback.maxSize} + + + + + + + + INFO + ACCEPT + DENY + + + + ${logback.path}/%d{yyyy-MM-dd}/${logback.name}.info.log + + ${logback.maxHistory} + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n + + + + ${logback.maxSize} + + + + + + + + DEBUG + ACCEPT + DENY + + + + ${logback.path}/%d{yyyy-MM-dd}/${logback.name}.debug.log + + + ${logback.maxHistory} + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n + + + + ${logback.maxSize} + + + + + + + + TRACE + ACCEPT + DENY + + + + ${logback.path}/%d{yyyy-MM-dd}/${logback.name}.trace.log + + ${logback.maxHistory} + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n + + + + ${logback.maxSize} + + + + + + + WARN + ACCEPT + DENY + + + + + + ${logback.db.url} + ${logback.db.username} + ${logback.db.password} + ${logback.db.driverClassName} + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/properties/dubbo.properties b/src/main/resources/properties/dubbo.properties new file mode 100644 index 0000000000000000000000000000000000000000..99996447cc0dedce87b0ba80be7ab99fac469a9e --- /dev/null +++ b/src/main/resources/properties/dubbo.properties @@ -0,0 +1,2 @@ +dubbo.application.name=disped-dubbo-consumer +dubbo.registry.address=zookeeper://127.0.0.1:2181 \ No newline at end of file diff --git a/src/main/resources/properties/logback.properties b/src/main/resources/properties/logback.properties new file mode 100644 index 0000000000000000000000000000000000000000..ce564a091512b82e5ed7d26fa48728ce327f5db2 --- /dev/null +++ b/src/main/resources/properties/logback.properties @@ -0,0 +1,10 @@ +logback.name=disped-web +logback.path=E:\\logs + +logback.maxHistory=30 +logback.maxSize=10MB + +logback.db.username=root +logback.db.password=root +logback.db.driverClassName=com.mysql.jdbc.Driver +logback.db.url=jdbc:mysql://localhost:3306/esheducation_logback_mysql_schema?useUnicode=true&characterEncoding=utf8&useSSL=false \ No newline at end of file diff --git a/src/main/resources/properties/redis.properties b/src/main/resources/properties/redis.properties new file mode 100644 index 0000000000000000000000000000000000000000..f407b5163b973322ece46512cf415679878374f5 --- /dev/null +++ b/src/main/resources/properties/redis.properties @@ -0,0 +1,15 @@ +redis.maxIdle=300 +redis.maxTotal=1000 +redis.maxWaitMillis=10000 +redis.minEvictableIdleTimeMillis=300000 +redis.numTestsPerEvictionRun=1024 +redis.timeBetweenEvictionRunsMillis=30000 +redis.testOnBorrow=true +redis.testWhileIdle=true + +redis.hostName=127.0.0.1 +redis.port=6379 +redis.password=anson +redis.usePool=true + +redis.maxInactiveIntervalInSeconds=100 \ No newline at end of file diff --git a/src/main/resources/properties/setting.properties b/src/main/resources/properties/setting.properties new file mode 100644 index 0000000000000000000000000000000000000000..5c398c999869625f581dd0416f0e523070cc9822 --- /dev/null +++ b/src/main/resources/properties/setting.properties @@ -0,0 +1 @@ +setting.upload=E:\\upload \ No newline at end of file diff --git a/src/main/resources/spring/applicationContext.xml b/src/main/resources/spring/applicationContext.xml new file mode 100644 index 0000000000000000000000000000000000000000..e6a5dfd99928a594fdfdd83475a8a65788c57520 --- /dev/null +++ b/src/main/resources/spring/applicationContext.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + diff --git a/src/main/resources/spring/config/spring-beans.xml b/src/main/resources/spring/config/spring-beans.xml new file mode 100644 index 0000000000000000000000000000000000000000..ce7c43d1f68011ccbd0521b84b4d8295f848c18d --- /dev/null +++ b/src/main/resources/spring/config/spring-beans.xml @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/src/main/resources/spring/config/spring-druid.xml b/src/main/resources/spring/config/spring-druid.xml new file mode 100644 index 0000000000000000000000000000000000000000..071d3cea0c3c0d785b959c2ba2d5167fba5119b4 --- /dev/null +++ b/src/main/resources/spring/config/spring-druid.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + com.es.disped.web.controller.* + + + + + + + + diff --git a/src/main/resources/spring/config/spring-dubbo-customer.xml b/src/main/resources/spring/config/spring-dubbo-customer.xml new file mode 100644 index 0000000000000000000000000000000000000000..8fee95fdbba7081f9200a3e479113dc8936eca35 --- /dev/null +++ b/src/main/resources/spring/config/spring-dubbo-customer.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/spring/config/spring-ehcache.xml b/src/main/resources/spring/config/spring-ehcache.xml new file mode 100644 index 0000000000000000000000000000000000000000..35adacae32c65b3cdc72976e0ee199f5d550f42a --- /dev/null +++ b/src/main/resources/spring/config/spring-ehcache.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/spring/config/spring-redis.xml b/src/main/resources/spring/config/spring-redis.xml new file mode 100644 index 0000000000000000000000000000000000000000..d142f1c8d123158ca55aa8161fc07dc41d2c543f --- /dev/null +++ b/src/main/resources/spring/config/spring-redis.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/spring/config/spring-shiro.xml b/src/main/resources/spring/config/spring-shiro.xml new file mode 100644 index 0000000000000000000000000000000000000000..06aa250d9cc47bb2f41a0b7be9bb4d67698b7e8f --- /dev/null +++ b/src/main/resources/spring/config/spring-shiro.xml @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /swagger-ui.html = anon + /swagger-resources/** = anon + /v2/** = anon + /webjars/** = anon + /resources/** = anon + /common/login/** = anon + /sms/send/code = anon + /sms/vertify/code = anon + /wechat/message/** = anon + /** = authc + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/spring/springMVC-servlet.xml b/src/main/resources/spring/springMVC-servlet.xml new file mode 100644 index 0000000000000000000000000000000000000000..78d201ab49d253bf6521cfcd33c0cae2baf82f47 --- /dev/null +++ b/src/main/resources/spring/springMVC-servlet.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + text/html;charset=UTF-8 + application/json;charset=UTF-8 + + + + + QuoteFieldNames + WriteNullBooleanAsFalse + WriteDateUseDateFormat + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/html; charset=UTF-8 + application/json;charset=UTF-8 + + + + + + + + text/html; charset=UTF-8 + application/json;charset=UTF-8 + + + + + + + + + + + + + + + + + + + + + + + + + + + redirect:/views/error.jsp + + + + + + + + diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000000000000000000000000000000000..ac017b0d0decc01b30d525a4915663a588add456 --- /dev/null +++ b/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,123 @@ + + + disped-web + + + + springSessionRepositoryFilter + org.springframework.web.filter.DelegatingFilterProxy + + + springSessionRepositoryFilter + /* + + + + + characterEncodingFilter + org.springframework.web.filter.CharacterEncodingFilter + + encoding + UTF-8 + + + forceRequestEncoding + true + + + + characterEncodingFilter + /* + + + + + springMVC + org.springframework.web.servlet.DispatcherServlet + + contextConfigLocation + classpath:spring/springMVC-servlet.xml + + 1 + + + springMVC + / + + + + + + contextConfigLocation + classpath:spring/applicationContext.xml + + + + org.springframework.web.context.ContextLoaderListener + + + + + shiroFilter + org.springframework.web.filter.DelegatingFilterProxy + + targetFilterLifecycle + true + + + + shiroFilter + /* + + + + + + CORS + com.thetransactioncompany.cors.CORSFilter + + cors.allowOrigin + * + + + cors.supportedMethods + GET, POST, OPTIONS + + + cors.supportedHeaders + Accept, Origin, Authorization, Access-Control-Allow-Headers, X-Requested-With, X_Requested_With, Content-Type, Last-Modified + + + cors.exposedHeaders + Set-Cookie + + + cors.supportsCredentials + true + + + + CORS + /* + + + + + 60 + + + + + views/index.jsp + + + + + 404 + /404/error + + + diff --git a/src/main/webapp/resources/css/.DS_Store b/src/main/webapp/resources/css/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..73f2322e7a7392218334c6086a5d60e57befef9d Binary files /dev/null and b/src/main/webapp/resources/css/.DS_Store differ diff --git a/src/main/webapp/resources/css/bootstrap-responsive.min.css b/src/main/webapp/resources/css/bootstrap-responsive.min.css new file mode 100644 index 0000000000000000000000000000000000000000..05978601011d16a1473189fce9ce1090055af2ce --- /dev/null +++ b/src/main/webapp/resources/css/bootstrap-responsive.min.css @@ -0,0 +1,9 @@ +/*! + * Bootstrap Responsive v2.3.0 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}@-ms-viewport{width:device-width}.hidden{display:none;visibility:hidden}.visible-phone{display:none!important}.visible-tablet{display:none!important}.hidden-desktop{display:none!important}.visible-desktop{display:inherit!important}@media(min-width:768px) and (max-width:979px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-tablet{display:inherit!important}.hidden-tablet{display:none!important}}@media(max-width:767px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-phone{display:inherit!important}.hidden-phone{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:inherit!important}.hidden-print{display:none!important}}@media(min-width:1200px){.row{margin-left:-30px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:30px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:1170px}.span12{width:1170px}.span11{width:1070px}.span10{width:970px}.span9{width:870px}.span8{width:770px}.span7{width:670px}.span6{width:570px}.span5{width:470px}.span4{width:370px}.span3{width:270px}.span2{width:170px}.span1{width:70px}.offset12{margin-left:1230px}.offset11{margin-left:1130px}.offset10{margin-left:1030px}.offset9{margin-left:930px}.offset8{margin-left:830px}.offset7{margin-left:730px}.offset6{margin-left:630px}.offset5{margin-left:530px}.offset4{margin-left:430px}.offset3{margin-left:330px}.offset2{margin-left:230px}.offset1{margin-left:130px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.564102564102564%;*margin-left:2.5109110747408616%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.564102564102564%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.45299145299145%;*width:91.39979996362975%}.row-fluid .span10{width:82.90598290598291%;*width:82.8527914166212%}.row-fluid .span9{width:74.35897435897436%;*width:74.30578286961266%}.row-fluid .span8{width:65.81196581196582%;*width:65.75877432260411%}.row-fluid .span7{width:57.26495726495726%;*width:57.21176577559556%}.row-fluid .span6{width:48.717948717948715%;*width:48.664757228587014%}.row-fluid .span5{width:40.17094017094017%;*width:40.11774868157847%}.row-fluid .span4{width:31.623931623931625%;*width:31.570740134569924%}.row-fluid .span3{width:23.076923076923077%;*width:23.023731587561375%}.row-fluid .span2{width:14.52991452991453%;*width:14.476723040552828%}.row-fluid .span1{width:5.982905982905983%;*width:5.929714493544281%}.row-fluid .offset12{margin-left:105.12820512820512%;*margin-left:105.02182214948171%}.row-fluid .offset12:first-child{margin-left:102.56410256410257%;*margin-left:102.45771958537915%}.row-fluid .offset11{margin-left:96.58119658119658%;*margin-left:96.47481360247316%}.row-fluid .offset11:first-child{margin-left:94.01709401709402%;*margin-left:93.91071103837061%}.row-fluid .offset10{margin-left:88.03418803418803%;*margin-left:87.92780505546462%}.row-fluid .offset10:first-child{margin-left:85.47008547008548%;*margin-left:85.36370249136206%}.row-fluid .offset9{margin-left:79.48717948717949%;*margin-left:79.38079650845607%}.row-fluid .offset9:first-child{margin-left:76.92307692307693%;*margin-left:76.81669394435352%}.row-fluid .offset8{margin-left:70.94017094017094%;*margin-left:70.83378796144753%}.row-fluid .offset8:first-child{margin-left:68.37606837606839%;*margin-left:68.26968539734497%}.row-fluid .offset7{margin-left:62.393162393162385%;*margin-left:62.28677941443899%}.row-fluid .offset7:first-child{margin-left:59.82905982905982%;*margin-left:59.72267685033642%}.row-fluid .offset6{margin-left:53.84615384615384%;*margin-left:53.739770867430444%}.row-fluid .offset6:first-child{margin-left:51.28205128205128%;*margin-left:51.175668303327875%}.row-fluid .offset5{margin-left:45.299145299145295%;*margin-left:45.1927623204219%}.row-fluid .offset5:first-child{margin-left:42.73504273504273%;*margin-left:42.62865975631933%}.row-fluid .offset4{margin-left:36.75213675213675%;*margin-left:36.645753773413354%}.row-fluid .offset4:first-child{margin-left:34.18803418803419%;*margin-left:34.081651209310785%}.row-fluid .offset3{margin-left:28.205128205128204%;*margin-left:28.0987452264048%}.row-fluid .offset3:first-child{margin-left:25.641025641025642%;*margin-left:25.53464266230224%}.row-fluid .offset2{margin-left:19.65811965811966%;*margin-left:19.551736679396257%}.row-fluid .offset2:first-child{margin-left:17.094017094017094%;*margin-left:16.98763411529369%}.row-fluid .offset1{margin-left:11.11111111111111%;*margin-left:11.004728132387708%}.row-fluid .offset1:first-child{margin-left:8.547008547008547%;*margin-left:8.440625568285142%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:30px}input.span12,textarea.span12,.uneditable-input.span12{width:1156px}input.span11,textarea.span11,.uneditable-input.span11{width:1056px}input.span10,textarea.span10,.uneditable-input.span10{width:956px}input.span9,textarea.span9,.uneditable-input.span9{width:856px}input.span8,textarea.span8,.uneditable-input.span8{width:756px}input.span7,textarea.span7,.uneditable-input.span7{width:656px}input.span6,textarea.span6,.uneditable-input.span6{width:556px}input.span5,textarea.span5,.uneditable-input.span5{width:456px}input.span4,textarea.span4,.uneditable-input.span4{width:356px}input.span3,textarea.span3,.uneditable-input.span3{width:256px}input.span2,textarea.span2,.uneditable-input.span2{width:156px}input.span1,textarea.span1,.uneditable-input.span1{width:56px}.thumbnails{margin-left:-30px}.thumbnails>li{margin-left:30px}.row-fluid .thumbnails{margin-left:0}}@media(min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:724px}.span12{width:724px}.span11{width:662px}.span10{width:600px}.span9{width:538px}.span8{width:476px}.span7{width:414px}.span6{width:352px}.span5{width:290px}.span4{width:228px}.span3{width:166px}.span2{width:104px}.span1{width:42px}.offset12{margin-left:764px}.offset11{margin-left:702px}.offset10{margin-left:640px}.offset9{margin-left:578px}.offset8{margin-left:516px}.offset7{margin-left:454px}.offset6{margin-left:392px}.offset5{margin-left:330px}.offset4{margin-left:268px}.offset3{margin-left:206px}.offset2{margin-left:144px}.offset1{margin-left:82px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.7624309392265194%;*margin-left:2.709239449864817%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.7624309392265194%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.43646408839778%;*width:91.38327259903608%}.row-fluid .span10{width:82.87292817679558%;*width:82.81973668743387%}.row-fluid .span9{width:74.30939226519337%;*width:74.25620077583166%}.row-fluid .span8{width:65.74585635359117%;*width:65.69266486422946%}.row-fluid .span7{width:57.18232044198895%;*width:57.12912895262725%}.row-fluid .span6{width:48.61878453038674%;*width:48.56559304102504%}.row-fluid .span5{width:40.05524861878453%;*width:40.00205712942283%}.row-fluid .span4{width:31.491712707182323%;*width:31.43852121782062%}.row-fluid .span3{width:22.92817679558011%;*width:22.87498530621841%}.row-fluid .span2{width:14.3646408839779%;*width:14.311449394616199%}.row-fluid .span1{width:5.801104972375691%;*width:5.747913483013988%}.row-fluid .offset12{margin-left:105.52486187845304%;*margin-left:105.41847889972962%}.row-fluid .offset12:first-child{margin-left:102.76243093922652%;*margin-left:102.6560479605031%}.row-fluid .offset11{margin-left:96.96132596685082%;*margin-left:96.8549429881274%}.row-fluid .offset11:first-child{margin-left:94.1988950276243%;*margin-left:94.09251204890089%}.row-fluid .offset10{margin-left:88.39779005524862%;*margin-left:88.2914070765252%}.row-fluid .offset10:first-child{margin-left:85.6353591160221%;*margin-left:85.52897613729868%}.row-fluid .offset9{margin-left:79.8342541436464%;*margin-left:79.72787116492299%}.row-fluid .offset9:first-child{margin-left:77.07182320441989%;*margin-left:76.96544022569647%}.row-fluid .offset8{margin-left:71.2707182320442%;*margin-left:71.16433525332079%}.row-fluid .offset8:first-child{margin-left:68.50828729281768%;*margin-left:68.40190431409427%}.row-fluid .offset7{margin-left:62.70718232044199%;*margin-left:62.600799341718584%}.row-fluid .offset7:first-child{margin-left:59.94475138121547%;*margin-left:59.838368402492065%}.row-fluid .offset6{margin-left:54.14364640883978%;*margin-left:54.037263430116376%}.row-fluid .offset6:first-child{margin-left:51.38121546961326%;*margin-left:51.27483249088986%}.row-fluid .offset5{margin-left:45.58011049723757%;*margin-left:45.47372751851417%}.row-fluid .offset5:first-child{margin-left:42.81767955801105%;*margin-left:42.71129657928765%}.row-fluid .offset4{margin-left:37.01657458563536%;*margin-left:36.91019160691196%}.row-fluid .offset4:first-child{margin-left:34.25414364640884%;*margin-left:34.14776066768544%}.row-fluid .offset3{margin-left:28.45303867403315%;*margin-left:28.346655695309746%}.row-fluid .offset3:first-child{margin-left:25.69060773480663%;*margin-left:25.584224756083227%}.row-fluid .offset2{margin-left:19.88950276243094%;*margin-left:19.783119783707537%}.row-fluid .offset2:first-child{margin-left:17.12707182320442%;*margin-left:17.02068884448102%}.row-fluid .offset1{margin-left:11.32596685082873%;*margin-left:11.219583872105325%}.row-fluid .offset1:first-child{margin-left:8.56353591160221%;*margin-left:8.457152932878806%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:710px}input.span11,textarea.span11,.uneditable-input.span11{width:648px}input.span10,textarea.span10,.uneditable-input.span10{width:586px}input.span9,textarea.span9,.uneditable-input.span9{width:524px}input.span8,textarea.span8,.uneditable-input.span8{width:462px}input.span7,textarea.span7,.uneditable-input.span7{width:400px}input.span6,textarea.span6,.uneditable-input.span6{width:338px}input.span5,textarea.span5,.uneditable-input.span5{width:276px}input.span4,textarea.span4,.uneditable-input.span4{width:214px}input.span3,textarea.span3,.uneditable-input.span3{width:152px}input.span2,textarea.span2,.uneditable-input.span2{width:90px}input.span1,textarea.span1,.uneditable-input.span1{width:28px}}@media(max-width:767px){body{padding-right:20px;padding-left:20px}.navbar-fixed-top,.navbar-fixed-bottom,.navbar-static-top{margin-right:-20px;margin-left:-20px}.container-fluid{padding:0}.dl-horizontal dt{float:none;width:auto;clear:none;text-align:left}.dl-horizontal dd{margin-left:0}.container{width:auto}.row-fluid{width:100%}.row,.thumbnails{margin-left:0}.thumbnails>li{float:none;margin-left:0}[class*="span"],.uneditable-input[class*="span"],.row-fluid [class*="span"]{display:block;float:none;width:100%;margin-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.span12,.row-fluid .span12{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="offset"]:first-child{margin-left:0}.input-large,.input-xlarge,.input-xxlarge,input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.input-prepend input,.input-append input,.input-prepend input[class*="span"],.input-append input[class*="span"]{display:inline-block;width:auto}.controls-row [class*="span"]+[class*="span"]{margin-left:0}.modal{position:fixed;top:20px;right:20px;left:20px;width:auto;margin:0}.modal.fade{top:-100px}.modal.fade.in{top:20px}}@media(max-width:480px){.nav-collapse{-webkit-transform:translate3d(0,0,0)}.page-header h1 small{display:block;line-height:20px}input[type="checkbox"],input[type="radio"]{border:1px solid #ccc}.form-horizontal .control-label{float:none;width:auto;padding-top:0;text-align:left}.form-horizontal .controls{margin-left:0}.form-horizontal .control-list{padding-top:0}.form-horizontal .form-actions{padding-right:10px;padding-left:10px}.media .pull-left,.media .pull-right{display:block;float:none;margin-bottom:10px}.media-object{margin-right:0;margin-left:0}.modal{top:10px;right:10px;left:10px}.modal-header .close{padding:10px;margin:-10px}.carousel-caption{position:static}}@media(max-width:979px){body{padding-top:0}.navbar-fixed-top,.navbar-fixed-bottom{position:static}.navbar-fixed-top{margin-bottom:20px}.navbar-fixed-bottom{margin-top:20px}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding:5px}.navbar .container{width:auto;padding:0}.navbar .brand{padding-right:10px;padding-left:10px;margin:0 0 0 -5px}.nav-collapse{clear:both}.nav-collapse .nav{float:none;margin:0 0 10px}.nav-collapse .nav>li{float:none}.nav-collapse .nav>li>a{margin-bottom:2px}.nav-collapse .nav>.divider-vertical{display:none}.nav-collapse .nav .nav-header{color:#777;text-shadow:none}.nav-collapse .nav>li>a,.nav-collapse .dropdown-menu a{padding:9px 15px;font-weight:bold;color:#777;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.nav-collapse .btn{padding:4px 10px 4px;font-weight:normal;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.nav-collapse .dropdown-menu li+li a{margin-bottom:2px}.nav-collapse .nav>li>a:hover,.nav-collapse .nav>li>a:focus,.nav-collapse .dropdown-menu a:hover,.nav-collapse .dropdown-menu a:focus{background-color:#f2f2f2}.navbar-inverse .nav-collapse .nav>li>a,.navbar-inverse .nav-collapse .dropdown-menu a{color:#999}.navbar-inverse .nav-collapse .nav>li>a:hover,.navbar-inverse .nav-collapse .nav>li>a:focus,.navbar-inverse .nav-collapse .dropdown-menu a:hover,.navbar-inverse .nav-collapse .dropdown-menu a:focus{background-color:#111}.nav-collapse.in .btn-group{padding:0;margin-top:5px}.nav-collapse .dropdown-menu{position:static;top:auto;left:auto;display:none;float:none;max-width:none;padding:0;margin:0 15px;background-color:transparent;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.nav-collapse .open>.dropdown-menu{display:block}.nav-collapse .dropdown-menu:before,.nav-collapse .dropdown-menu:after{display:none}.nav-collapse .dropdown-menu .divider{display:none}.nav-collapse .nav>li>.dropdown-menu:before,.nav-collapse .nav>li>.dropdown-menu:after{display:none}.nav-collapse .navbar-form,.nav-collapse .navbar-search{float:none;padding:10px 15px;margin:10px 0;border-top:1px solid #f2f2f2;border-bottom:1px solid #f2f2f2;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}.navbar-inverse .nav-collapse .navbar-form,.navbar-inverse .nav-collapse .navbar-search{border-top-color:#111;border-bottom-color:#111}.navbar .nav-collapse .nav.pull-right{float:none;margin-left:0}.nav-collapse,.nav-collapse.collapse{height:0;overflow:hidden}.navbar .btn-navbar{display:block}.navbar-static .navbar-inner{padding-right:10px;padding-left:10px}}@media(min-width:980px){.nav-collapse.collapse{height:auto!important;overflow:visible!important}} diff --git a/src/main/webapp/resources/css/bootstrap-wysihtml5.css b/src/main/webapp/resources/css/bootstrap-wysihtml5.css new file mode 100644 index 0000000000000000000000000000000000000000..d0b845e594eed50328f71516ba3ee58fc46ff963 --- /dev/null +++ b/src/main/webapp/resources/css/bootstrap-wysihtml5.css @@ -0,0 +1,102 @@ +ul.wysihtml5-toolbar { + margin: 0; + padding: 0; + display: block; +} + +ul.wysihtml5-toolbar::after { + clear: both; + display: table; + content: ""; +} + +ul.wysihtml5-toolbar > li { + float: left; + display: list-item; + list-style: none; + margin: 0 5px 10px 0; +} + +ul.wysihtml5-toolbar a[data-wysihtml5-command=bold] { + font-weight: bold; +} + +ul.wysihtml5-toolbar a[data-wysihtml5-command=italic] { + font-style: italic; +} + +ul.wysihtml5-toolbar a[data-wysihtml5-command=underline] { + text-decoration: underline; +} + +ul.wysihtml5-toolbar a.btn.wysihtml5-command-active { + background-image: none; + -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05); + background-color: #E6E6E6; + background-color: #D9D9D9; + outline: 0; +} + +ul.wysihtml5-commands-disabled .dropdown-menu { + display: none !important; +} + +ul.wysihtml5-toolbar div.wysihtml5-colors { + display:block; + width: 50px; + height: 20px; + margin-top: 2px; + margin-left: 5px; + position: absolute; + pointer-events: none; +} + +ul.wysihtml5-toolbar a.wysihtml5-colors-title { + padding-left: 70px; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="black"] { + background: black !important; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="silver"] { + background: silver !important; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="gray"] { + background: gray !important; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="maroon"] { + background: maroon !important; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="red"] { + background: red !important; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="purple"] { + background: purple !important; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="green"] { + background: green !important; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="olive"] { + background: olive !important; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="navy"] { + background: navy !important; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="blue"] { + background: blue !important; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="orange"] { + background: orange !important; +} \ No newline at end of file diff --git a/src/main/webapp/resources/css/bootstrap.min.css b/src/main/webapp/resources/css/bootstrap.min.css new file mode 100644 index 0000000000000000000000000000000000000000..c9a1a590c9cc64aad30ed6e5839c12ce78498a8e --- /dev/null +++ b/src/main/webapp/resources/css/bootstrap.min.css @@ -0,0 +1 @@ +/*!* Bootstrap v2.3.0** Copyright 2012 Twitter, Inc* Licensed under the Apache License v2.0* http://www.apache.org/licenses/LICENSE-2.0** Designed and built with all the love in the world @twitter by @mdo and @fat.*/.clearfix {*zoom:1}.clearfix:before, .clearfix:after {display:table;line-height:0;content:""}.clearfix:after {clear:both}.hide-text {font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level {display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}article, aside, details, figcaption, figure, footer, header, hgroup, nav, section {display:block}audio, canvas, video {display:inline-block;*display:inline;*zoom:1}audio:not([controls]) {display:none}html {font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}a:focus {outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}a:hover, a:active {outline:0}sub, sup {position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup {top:-0.5em}sub {bottom:-0.25em}img {width:auto\9;height:auto;max-width:100%;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic}#map_canvas img, .google-maps img {max-width:none}button, input, select, textarea {margin:0;font-size:100%;vertical-align:middle}button, input {*overflow:visible;line-height:normal}button::-moz-focus-inner, input::-moz-focus-inner {padding:0;border:0}button, html input[type="button"], input[type="reset"], input[type="submit"] {cursor:pointer;-webkit-appearance:button}label, select, button, input[type="button"], input[type="reset"], input[type="submit"], input[type="radio"], input[type="checkbox"] {cursor:pointer}input[type="search"] {-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type="search"]::-webkit-search-decoration, input[type="search"]::-webkit-search-cancel-button {-webkit-appearance:none}textarea {overflow:auto;vertical-align:top}@media print {* {color:#000!important;text-shadow:none!important;background:transparent!important;box-shadow:none!important}a, a:visited {text-decoration:underline}a[href]:after {content:" (" attr(href) ")"}abbr[title]:after {content:" (" attr(title) ")"}.ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after {content:""}pre, blockquote {border:1px solid #999;page-break-inside:avoid}thead {display:table-header-group}tr, img {page-break-inside:avoid}img {max-width:100%!important}@page {margin:.5cm}p, h2, h3 {orphans:3;widows:3}h2, h3 {page-break-after:avoid}}body {margin:0;font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;font-size:14px;line-height:20px;color:#333;background-color:#fff}a {color:#08c;text-decoration:none}a:hover, a:focus {color:#005580;text-decoration:underline}.img-rounded {-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.img-polaroid {padding:4px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.1);box-shadow:0 1px 3px rgba(0,0,0,0.1)}.img-circle {-webkit-border-radius:500px;-moz-border-radius:500px;border-radius:500px}.row {margin-left:-20px;*zoom:1}.row:before, .row:after {display:table;line-height:0;content:""}.row:after {clear:both}[class*="span"] {float:left;min-height:1px;margin-left:20px}.container, .navbar-static-top .container, .navbar-fixed-top .container, .navbar-fixed-bottom .container {width:940px}.span12 {width:940px}.span11 {width:860px}.span10 {width:780px}.span9 {width:700px}.span8 {width:620px}.span7 {width:540px}.span6 {width:460px}.span5 {width:380px}.span4 {width:300px}.span3 {width:220px}.span2 {width:140px}.span1 {width:60px}.offset12 {margin-left:980px}.offset11 {margin-left:900px}.offset10 {margin-left:820px}.offset9 {margin-left:740px}.offset8 {margin-left:660px}.offset7 {margin-left:580px}.offset6 {margin-left:500px}.offset5 {margin-left:420px}.offset4 {margin-left:340px}.offset3 {margin-left:260px}.offset2 {margin-left:180px}.offset1 {margin-left:100px}.row-fluid {width:100%;*zoom:1}.row-fluid:before, .row-fluid:after {display:table;line-height:0;content:""}.row-fluid:after {clear:both}.row-fluid [class*="span"] {display:block;float:left;width:100%;min-height:30px;margin-left:2.127659574468085%;*margin-left:2.074468085106383%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child {margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"] {margin-left:2.127659574468085%}.row-fluid .span12 {width:100%;*width:99.94680851063829%}.row-fluid .span11 {width:91.48936170212765%;*width:91.43617021276594%}.row-fluid .span10 {width:82.97872340425532%;*width:82.92553191489361%}.row-fluid .span9 {width:74.46808510638297%;*width:74.41489361702126%}.row-fluid .span8 {width:65.95744680851064%;*width:65.90425531914893%}.row-fluid .span7 {width:57.44680851063829%;*width:57.39361702127659%}.row-fluid .span6 {width:48.93617021276595%;*width:48.88297872340425%}.row-fluid .span5 {width:40.42553191489362%;*width:40.37234042553192%}.row-fluid .span4 {width:31.914893617021278%;*width:31.861702127659576%}.row-fluid .span3 {width:23.404255319148934%;*width:23.351063829787233%}.row-fluid .span2 {width:14.893617021276595%;*width:14.840425531914894%}.row-fluid .span1 {width:6.382978723404255%;*width:6.329787234042553%}.row-fluid .offset12 {margin-left:104.25531914893617%;*margin-left:104.14893617021275%}.row-fluid .offset12:first-child {margin-left:102.12765957446808%;*margin-left:102.02127659574467%}.row-fluid .offset11 {margin-left:95.74468085106382%;*margin-left:95.6382978723404%}.row-fluid .offset11:first-child {margin-left:93.61702127659574%;*margin-left:93.51063829787232%}.row-fluid .offset10 {margin-left:87.23404255319149%;*margin-left:87.12765957446807%}.row-fluid .offset10:first-child {margin-left:85.1063829787234%;*margin-left:84.99999999999999%}.row-fluid .offset9 {margin-left:78.72340425531914%;*margin-left:78.61702127659572%}.row-fluid .offset9:first-child {margin-left:76.59574468085106%;*margin-left:76.48936170212764%}.row-fluid .offset8 {margin-left:70.2127659574468%;*margin-left:70.10638297872339%}.row-fluid .offset8:first-child {margin-left:68.08510638297872%;*margin-left:67.9787234042553%}.row-fluid .offset7 {margin-left:61.70212765957446%;*margin-left:61.59574468085106%}.row-fluid .offset7:first-child {margin-left:59.574468085106375%;*margin-left:59.46808510638297%}.row-fluid .offset6 {margin-left:53.191489361702125%;*margin-left:53.085106382978715%}.row-fluid .offset6:first-child {margin-left:51.063829787234035%;*margin-left:50.95744680851063%}.row-fluid .offset5 {margin-left:44.68085106382979%;*margin-left:44.57446808510638%}.row-fluid .offset5:first-child {margin-left:42.5531914893617%;*margin-left:42.4468085106383%}.row-fluid .offset4 {margin-left:36.170212765957444%;*margin-left:36.06382978723405%}.row-fluid .offset4:first-child {margin-left:34.04255319148936%;*margin-left:33.93617021276596%}.row-fluid .offset3 {margin-left:27.659574468085104%;*margin-left:27.5531914893617%}.row-fluid .offset3:first-child {margin-left:25.53191489361702%;*margin-left:25.425531914893618%}.row-fluid .offset2 {margin-left:19.148936170212764%;*margin-left:19.04255319148936%}.row-fluid .offset2:first-child {margin-left:17.02127659574468%;*margin-left:16.914893617021278%}.row-fluid .offset1 {margin-left:10.638297872340425%;*margin-left:10.53191489361702%}.row-fluid .offset1:first-child {margin-left:8.51063829787234%;*margin-left:8.404255319148938%}[class*="span"].hide, .row-fluid [class*="span"].hide {display:none}[class*="span"].pull-right, .row-fluid [class*="span"].pull-right {float:right}.container {margin-right:auto;margin-left:auto;*zoom:1}.container:before, .container:after {display:table;line-height:0;content:""}.container:after {clear:both}.container-fluid {padding-right:20px;padding-left:20px;*zoom:1}.container-fluid:before, .container-fluid:after {display:table;line-height:0;content:""}.container-fluid:after {clear:both}p {margin:0 0 10px}.lead {margin-bottom:20px;font-size:21px;font-weight:200;line-height:30px}small {font-size:85%}strong {font-weight:bold}em {font-style:italic}cite {font-style:normal}.muted {color:#999}a.muted:hover, a.muted:focus {color:#808080}.text-warning {color:#c09853}a.text-warning:hover, a.text-warning:focus {color:#a47e3c}.text-error {color:#b94a48}a.text-error:hover, a.text-error:focus {color:#953b39}.text-info {color:#3a87ad}a.text-info:hover, a.text-info:focus {color:#2d6987}.text-success {color:#468847}a.text-success:hover, a.text-success:focus {color:#356635}.text-left {text-align:left}.text-right {text-align:right}.text-center {text-align:center}h1, h2, h3, h4, h5, h6 {margin:10px 0;font-family:inherit;font-weight:bold;line-height:20px;color:inherit;text-rendering:optimizelegibility}h1 small, h2 small, h3 small, h4 small, h5 small, h6 small {font-weight:normal;line-height:1;color:#999}h1, h2, h3 {line-height:40px}h1 {font-size:38.5px}h2 {font-size:31.5px}h3 {font-size:24.5px}h4 {font-size:17.5px}h5 {font-size:14px}h6 {font-size:11.9px}h1 small {font-size:24.5px}h2 small {font-size:17.5px}h3 small {font-size:14px}h4 small {font-size:14px}.page-header {padding-bottom:9px;margin:20px 0 30px;border-bottom:1px solid #eee}ul, ol {padding:0;margin:0 0 10px 25px}ul ul, ul ol, ol ol, ol ul {margin-bottom:0}li {line-height:20px}ul.unstyled, ol.unstyled {margin-left:0;list-style:none}ul.inline, ol.inline {margin-left:0;list-style:none}ul.inline>li, ol.inline>li {display:inline-block;*display:inline;padding-right:5px;padding-left:5px;*zoom:1}dl {margin-bottom:20px}dt, dd {line-height:20px}dt {font-weight:bold}dd {margin-left:10px}.dl-horizontal {*zoom:1}.dl-horizontal:before, .dl-horizontal:after {display:table;line-height:0;content:""}.dl-horizontal:after {clear:both}.dl-horizontal dt {float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd {margin-left:180px}hr {margin:20px 0;border:0;border-top:1px solid #eee;border-bottom:1px solid #fff}abbr[title], abbr[data-original-title] {cursor:help;border-bottom:1px dotted #999}abbr.initialism {font-size:90%;text-transform:uppercase}blockquote {padding:0 0 0 15px;margin:0 0 20px;border-left:5px solid #eee}blockquote p {margin-bottom:0;font-size:17.5px;font-weight:300;line-height:1.25}blockquote small {display:block;line-height:20px;color:#999}blockquote small:before {content:'\2014 \00A0'}blockquote.pull-right {float:right;padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0}blockquote.pull-right p, blockquote.pull-right small {text-align:right}blockquote.pull-right small:before {content:''}blockquote.pull-right small:after {content:'\00A0 \2014'}q:before, q:after, blockquote:before, blockquote:after {content:""}address {display:block;margin-bottom:20px;font-style:normal;line-height:20px}code, pre {padding:0 3px 2px;font-family:Monaco, Menlo, Consolas, "Courier New", monospace;font-size:12px;color:#333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}code {padding:2px 4px;color:#d14;white-space:nowrap;background-color:#f7f7f9;border:1px solid #e1e1e8}pre {display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:20px;word-break:break-all;word-wrap:break-word;white-space:pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}pre.prettyprint {margin-bottom:20px}pre code {padding:0;color:inherit;white-space:pre;white-space:pre-wrap;background-color:transparent;border:0}.pre-scrollable {max-height:340px;overflow-y:scroll}form {margin:0 0 20px}fieldset {padding:0;margin:0;border:0}legend {display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:40px;color:#333;border:0;border-bottom:1px solid #e5e5e5}legend small {font-size:15px;color:#999}label, input, button, select, textarea {font-size:14px;font-weight:normal;line-height:20px}input, button, select, textarea {font-family:"Helvetica Neue", Helvetica, Arial, sans-serif}label {display:block;margin-bottom:5px}select, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input {display:inline-block;height:20px;padding:4px 6px;margin-bottom:10px;font-size:14px;line-height:20px;color:#555;vertical-align:middle;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}input, textarea, .uneditable-input {width:206px}textarea {height:auto}textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input {background-color:#fff;border:1px solid #ccc;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border linear .2s, box-shadow linear .2s;-moz-transition:border linear .2s, box-shadow linear .2s;-o-transition:border linear .2s, box-shadow linear .2s;transition:border linear .2s, box-shadow linear .2s}textarea:focus, input[type="text"]:focus, input[type="password"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="date"]:focus, input[type="month"]:focus, input[type="time"]:focus, input[type="week"]:focus, input[type="number"]:focus, input[type="email"]:focus, input[type="url"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="color"]:focus, .uneditable-input:focus {border-color:rgba(82,168,236,0.8);outline:0;outline:thin dotted \9;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075), 0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075), 0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075), 0 0 8px rgba(82,168,236,0.6)}input[type="radio"], input[type="checkbox"] {margin:4px 0 0;margin-top:1px \9;*margin-top:0;line-height:normal}input[type="file"], input[type="image"], input[type="submit"], input[type="reset"], input[type="button"], input[type="radio"], input[type="checkbox"] {width:auto}select, input[type="file"] {height:30px;*margin-top:4px;line-height:30px}select {width:70px;background-color:#fff;border:1px solid #ccc}select[multiple], select[size] {height:auto}select:focus, input[type="file"]:focus, input[type="radio"]:focus, input[type="checkbox"]:focus {outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.uneditable-input, .uneditable-textarea {color:#999;cursor:not-allowed;background-color:#fcfcfc;border-color:#ccc;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);box-shadow:inset 0 1px 2px rgba(0,0,0,0.025)}.uneditable-input {overflow:hidden;white-space:nowrap}.uneditable-textarea {width:auto;height:auto}input:-moz-placeholder, textarea:-moz-placeholder {color:#999}input:-ms-input-placeholder, textarea:-ms-input-placeholder {color:#999}input::-webkit-input-placeholder, textarea::-webkit-input-placeholder {color:#999}.radio, .checkbox {min-height:20px;padding-left:20px}.radio input[type="radio"], .checkbox input[type="checkbox"] {float:left;margin-left:-20px}.controls>.radio:first-child, .controls>.checkbox:first-child {padding-top:5px}.radio.inline, .checkbox.inline {display:inline-block;padding-top:5px;margin-bottom:0;vertical-align:middle}.radio.inline+.radio.inline, .checkbox.inline+.checkbox.inline {margin-left:10px}.input-mini {width:60px}.input-small {width:90px}.input-medium {width:150px}.input-large {width:210px}.input-xlarge {width:270px}.input-xxlarge {width:530px}input[class*="span"], select[class*="span"], textarea[class*="span"], .uneditable-input[class*="span"], .row-fluid input[class*="span"], .row-fluid select[class*="span"], .row-fluid textarea[class*="span"], .row-fluid .uneditable-input[class*="span"] {float:none;margin-left:0}.input-append input[class*="span"], .input-append .uneditable-input[class*="span"], .input-prepend input[class*="span"], .input-prepend .uneditable-input[class*="span"], .row-fluid input[class*="span"], .row-fluid select[class*="span"], .row-fluid textarea[class*="span"], .row-fluid .uneditable-input[class*="span"], .row-fluid .input-prepend [class*="span"], .row-fluid .input-append [class*="span"] {display:inline-block}input, textarea, .uneditable-input {margin-left:0}.controls-row [class*="span"]+[class*="span"] {margin-left:20px}input.span12, textarea.span12, .uneditable-input.span12 {width:926px}input.span11, textarea.span11, .uneditable-input.span11 {width:846px}input.span10, textarea.span10, .uneditable-input.span10 {width:766px}input.span9, textarea.span9, .uneditable-input.span9 {width:686px}input.span8, textarea.span8, .uneditable-input.span8 {width:606px}input.span7, textarea.span7, .uneditable-input.span7 {width:526px}input.span6, textarea.span6, .uneditable-input.span6 {width:446px}input.span5, textarea.span5, .uneditable-input.span5 {width:366px}input.span4, textarea.span4, .uneditable-input.span4 {width:286px}input.span3, textarea.span3, .uneditable-input.span3 {width:206px}input.span2, textarea.span2, .uneditable-input.span2 {width:126px}input.span1, textarea.span1, .uneditable-input.span1 {width:46px}.controls-row {*zoom:1}.controls-row:before, .controls-row:after {display:table;line-height:0;content:""}.controls-row:after {clear:both}.controls-row [class*="span"], .row-fluid .controls-row [class*="span"] {float:left}.controls-row .checkbox[class*="span"], .controls-row .radio[class*="span"] {padding-top:5px}input[disabled], select[disabled], textarea[disabled], input[readonly], select[readonly], textarea[readonly] {cursor:not-allowed;background-color:#eee}input[type="radio"][disabled], input[type="checkbox"][disabled], input[type="radio"][readonly], input[type="checkbox"][readonly] {background-color:transparent}.control-group.warning .control-label, .control-group.warning .help-block, .control-group.warning .help-inline {color:#c09853}.control-group.warning .checkbox, .control-group.warning .radio, .control-group.warning input, .control-group.warning select, .control-group.warning textarea {color:#c09853}.control-group.warning input, .control-group.warning select, .control-group.warning textarea {border-color:#c09853;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.warning input:focus, .control-group.warning select:focus, .control-group.warning textarea:focus {border-color:#a47e3c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #dbc59e;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #dbc59e;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #dbc59e}.control-group.warning .input-prepend .add-on, .control-group.warning .input-append .add-on {color:#c09853;background-color:#fcf8e3;border-color:#c09853}.control-group.error .control-label, .control-group.error .help-block, .control-group.error .help-inline {color:#b94a48}.control-group.error .checkbox, .control-group.error .radio, .control-group.error input, .control-group.error select, .control-group.error textarea {color:#b94a48}.control-group.error input, .control-group.error select, .control-group.error textarea {border-color:#b94a48;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.error input:focus, .control-group.error select:focus, .control-group.error textarea:focus {border-color:#953b39;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #d59392;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #d59392;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #d59392}.control-group.error .input-prepend .add-on, .control-group.error .input-append .add-on {color:#b94a48;background-color:#f2dede;border-color:#b94a48}.control-group.success .control-label, .control-group.success .help-block, .control-group.success .help-inline {color:#468847}.control-group.success .checkbox, .control-group.success .radio, .control-group.success input, .control-group.success select, .control-group.success textarea {color:#468847}.control-group.success input, .control-group.success select, .control-group.success textarea {border-color:#468847;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.success input:focus, .control-group.success select:focus, .control-group.success textarea:focus {border-color:#356635;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #7aba7b;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #7aba7b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #7aba7b}.control-group.success .input-prepend .add-on, .control-group.success .input-append .add-on {color:#468847;background-color:#dff0d8;border-color:#468847}.control-group.info .control-label, .control-group.info .help-block, .control-group.info .help-inline {color:#3a87ad}.control-group.info .checkbox, .control-group.info .radio, .control-group.info input, .control-group.info select, .control-group.info textarea {color:#3a87ad}.control-group.info input, .control-group.info select, .control-group.info textarea {border-color:#3a87ad;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.info input:focus, .control-group.info select:focus, .control-group.info textarea:focus {border-color:#2d6987;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #7ab5d3;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #7ab5d3;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #7ab5d3}.control-group.info .input-prepend .add-on, .control-group.info .input-append .add-on {color:#3a87ad;background-color:#d9edf7;border-color:#3a87ad}input:focus:invalid, textarea:focus:invalid, select:focus:invalid {color:#b94a48;border-color:#ee5f5b}input:focus:invalid:focus, textarea:focus:invalid:focus, select:focus:invalid:focus {border-color:#e9322d;-webkit-box-shadow:0 0 6px #f8b9b7;-moz-box-shadow:0 0 6px #f8b9b7;box-shadow:0 0 6px #f8b9b7}.form-actions {padding:19px 20px 20px;margin-top:20px;margin-bottom:20px;background-color:#f5f5f5;border-top:1px solid #e5e5e5;*zoom:1}.form-actions:before, .form-actions:after {display:table;line-height:0;content:""}.form-actions:after {clear:both}.help-block, .help-inline {color:#595959}.help-block {display:block;margin-bottom:10px}.help-inline {display:inline-block;*display:inline;padding-left:5px;vertical-align:middle;*zoom:1}.input-append, .input-prepend {display:inline-block;margin-bottom:10px;font-size:0;white-space:nowrap;vertical-align:middle}.input-append input, .input-prepend input, .input-append select, .input-prepend select, .input-append .uneditable-input, .input-prepend .uneditable-input, .input-append .dropdown-menu, .input-prepend .dropdown-menu, .input-append .popover, .input-prepend .popover {font-size:14px}.input-append input, .input-prepend input, .input-append select, .input-prepend select, .input-append .uneditable-input, .input-prepend .uneditable-input {position:relative;margin-bottom:0;*margin-left:0;vertical-align:top;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-append input:focus, .input-prepend input:focus, .input-append select:focus, .input-prepend select:focus, .input-append .uneditable-input:focus, .input-prepend .uneditable-input:focus {z-index:2}.input-append .add-on, .input-prepend .add-on {display:inline-block;width:auto;height:20px;min-width:16px;padding:4px 5px;font-size:14px;font-weight:normal;line-height:20px;text-align:center;text-shadow:0 1px 0 #fff;background-color:#eee;border:1px solid #ccc}.input-append .add-on, .input-prepend .add-on, .input-append .btn, .input-prepend .btn, .input-append .btn-group>.dropdown-toggle, .input-prepend .btn-group>.dropdown-toggle {vertical-align:top;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-append .active, .input-prepend .active {background-color:#a9dba9;border-color:#46a546}.input-prepend .add-on, .input-prepend .btn {margin-right:-1px}.input-prepend .add-on:first-child, .input-prepend .btn:first-child {-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-append input, .input-append select, .input-append .uneditable-input {-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-append input+.btn-group .btn:last-child, .input-append select+.btn-group .btn:last-child, .input-append .uneditable-input+.btn-group .btn:last-child {-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-append .add-on, .input-append .btn, .input-append .btn-group {margin-left:-1px}.input-append .add-on:last-child, .input-append .btn:last-child, .input-append .btn-group:last-child>.dropdown-toggle {-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append input, .input-prepend.input-append select, .input-prepend.input-append .uneditable-input {-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-prepend.input-append input+.btn-group .btn, .input-prepend.input-append select+.btn-group .btn, .input-prepend.input-append .uneditable-input+.btn-group .btn {-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append .add-on:first-child, .input-prepend.input-append .btn:first-child {margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-prepend.input-append .add-on:last-child, .input-prepend.input-append .btn:last-child {margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append .btn-group:first-child {margin-left:0}input.search-query {padding-right:14px;padding-right:4px \9;padding-left:14px;padding-left:4px \9;margin-bottom:0;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.form-search .input-append .search-query, .form-search .input-prepend .search-query {-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.form-search .input-append .search-query {-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search .input-append .btn {-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .search-query {-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .btn {-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search input, .form-inline input, .form-horizontal input, .form-search textarea, .form-inline textarea, .form-horizontal textarea, .form-search select, .form-inline select, .form-horizontal select, .form-search .help-inline, .form-inline .help-inline, .form-horizontal .help-inline, .form-search .uneditable-input, .form-inline .uneditable-input, .form-horizontal .uneditable-input, .form-search .input-prepend, .form-inline .input-prepend, .form-horizontal .input-prepend, .form-search .input-append, .form-inline .input-append, .form-horizontal .input-append {display:inline-block;*display:inline;margin-bottom:0;vertical-align:middle;*zoom:1}.form-search .hide, .form-inline .hide, .form-horizontal .hide {display:none}.form-search label, .form-inline label, .form-search .btn-group, .form-inline .btn-group {display:inline-block}.form-search .input-append, .form-inline .input-append, .form-search .input-prepend, .form-inline .input-prepend {margin-bottom:0}.form-search .radio, .form-search .checkbox, .form-inline .radio, .form-inline .checkbox {padding-left:0;margin-bottom:0;vertical-align:middle}.form-search .radio input[type="radio"], .form-search .checkbox input[type="checkbox"], .form-inline .radio input[type="radio"], .form-inline .checkbox input[type="checkbox"] {float:left;margin-right:3px;margin-left:0}.control-group {margin-bottom:10px}legend+.control-group {margin-top:20px;-webkit-margin-top-collapse:separate}.form-horizontal .control-group {margin-bottom:20px;*zoom:1}.form-horizontal .control-group:before, .form-horizontal .control-group:after {display:table;line-height:0;content:""}.form-horizontal .control-group:after {clear:both}.form-horizontal .control-label {float:left;width:160px;padding-top:5px;text-align:right}.form-horizontal .controls {*display:inline-block;*padding-left:20px;margin-left:180px;*margin-left:0}.form-horizontal .controls:first-child {*padding-left:180px}.form-horizontal .help-block {margin-bottom:0}.form-horizontal input+.help-block, .form-horizontal select+.help-block, .form-horizontal textarea+.help-block, .form-horizontal .uneditable-input+.help-block, .form-horizontal .input-prepend+.help-block, .form-horizontal .input-append+.help-block {margin-top:10px}.form-horizontal .form-actions {padding-left:180px}table {max-width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0}.table {width:100%;margin-bottom:20px}.table th, .table td {padding:8px;line-height:20px;text-align:left;vertical-align:top;border-top:1px solid #ddd}.table th {font-weight:bold}.table thead th {vertical-align:bottom}.table caption+thead tr:first-child th, .table caption+thead tr:first-child td, .table colgroup+thead tr:first-child th, .table colgroup+thead tr:first-child td, .table thead:first-child tr:first-child th, .table thead:first-child tr:first-child td {border-top:0}.table tbody+tbody {border-top:2px solid #ddd}.table .table {background-color:#fff}.table-condensed th, .table-condensed td {padding:4px 5px}.table-bordered {border:1px solid #ddd;border-collapse:separate;*border-collapse:collapse;border-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.table-bordered th, .table-bordered td {border-left:1px solid #ddd}.table-bordered caption+thead tr:first-child th, .table-bordered caption+tbody tr:first-child th, .table-bordered caption+tbody tr:first-child td, .table-bordered colgroup+thead tr:first-child th, .table-bordered colgroup+tbody tr:first-child th, .table-bordered colgroup+tbody tr:first-child td, .table-bordered thead:first-child tr:first-child th, .table-bordered tbody:first-child tr:first-child th, .table-bordered tbody:first-child tr:first-child td {border-top:0}.table-bordered thead:first-child tr:first-child>th:first-child, .table-bordered tbody:first-child tr:first-child>td:first-child, .table-bordered tbody:first-child tr:first-child>th:first-child {-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered thead:first-child tr:first-child>th:last-child, .table-bordered tbody:first-child tr:first-child>td:last-child, .table-bordered tbody:first-child tr:first-child>th:last-child {-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px}.table-bordered thead:last-child tr:last-child>th:first-child, .table-bordered tbody:last-child tr:last-child>td:first-child, .table-bordered tbody:last-child tr:last-child>th:first-child, .table-bordered tfoot:last-child tr:last-child>td:first-child, .table-bordered tfoot:last-child tr:last-child>th:first-child {-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px}.table-bordered thead:last-child tr:last-child>th:last-child, .table-bordered tbody:last-child tr:last-child>td:last-child, .table-bordered tbody:last-child tr:last-child>th:last-child, .table-bordered tfoot:last-child tr:last-child>td:last-child, .table-bordered tfoot:last-child tr:last-child>th:last-child {-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px}.table-bordered tfoot+tbody:last-child tr:last-child td:first-child {-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0;-moz-border-radius-bottomleft:0}.table-bordered tfoot+tbody:last-child tr:last-child td:last-child {-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0;-moz-border-radius-bottomright:0}.table-bordered caption+thead tr:first-child th:first-child, .table-bordered caption+tbody tr:first-child td:first-child, .table-bordered colgroup+thead tr:first-child th:first-child, .table-bordered colgroup+tbody tr:first-child td:first-child {-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered caption+thead tr:first-child th:last-child, .table-bordered caption+tbody tr:first-child td:last-child, .table-bordered colgroup+thead tr:first-child th:last-child, .table-bordered colgroup+tbody tr:first-child td:last-child {-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px}.table-striped tbody>tr:nth-child(odd)>td, .table-striped tbody>tr:nth-child(odd)>th {background-color:#f9f9f9}.table-hover tbody tr:hover>td, .table-hover tbody tr:hover>th {background-color:#f5f5f5}table td[class*="span"], table th[class*="span"], .row-fluid table td[class*="span"], .row-fluid table th[class*="span"] {display:table-cell;float:none;margin-left:0}.table td.span1, .table th.span1 {float:none;width:44px;margin-left:0}.table td.span2, .table th.span2 {float:none;width:124px;margin-left:0}.table td.span3, .table th.span3 {float:none;width:204px;margin-left:0}.table td.span4, .table th.span4 {float:none;width:284px;margin-left:0}.table td.span5, .table th.span5 {float:none;width:364px;margin-left:0}.table td.span6, .table th.span6 {float:none;width:444px;margin-left:0}.table td.span7, .table th.span7 {float:none;width:524px;margin-left:0}.table td.span8, .table th.span8 {float:none;width:604px;margin-left:0}.table td.span9, .table th.span9 {float:none;width:684px;margin-left:0}.table td.span10, .table th.span10 {float:none;width:764px;margin-left:0}.table td.span11, .table th.span11 {float:none;width:844px;margin-left:0}.table td.span12, .table th.span12 {float:none;width:924px;margin-left:0}.table tbody tr.success>td {background-color:#dff0d8}.table tbody tr.error>td {background-color:#f2dede}.table tbody tr.warning>td {background-color:#fcf8e3}.table tbody tr.info>td {background-color:#d9edf7}.table-hover tbody tr.success:hover>td {background-color:#d0e9c6}.table-hover tbody tr.error:hover>td {background-color:#ebcccc}.table-hover tbody tr.warning:hover>td {background-color:#faf2cc}.table-hover tbody tr.info:hover>td {background-color:#c4e3f3}[class^="icon-"], [class*=" icon-"] {display:inline-block;width:14px;height:14px;margin-top:1px;*margin-right:.3em;line-height:14px;vertical-align:text-top; background-image:url("../img/glyphicons-halflings.html");background-position:14px 14px;background-repeat:no-repeat}.icon-white, .nav-pills>.active>a>[class^="icon-"], .nav-pills>.active>a>[class*=" icon-"], .nav-list>.active>a>[class^="icon-"], .nav-list>.active>a>[class*=" icon-"], .navbar-inverse .nav>.active>a>[class^="icon-"], .navbar-inverse .nav>.active>a>[class*=" icon-"], .dropdown-menu>li>a:hover>[class^="icon-"], .dropdown-menu>li>a:focus>[class^="icon-"], .dropdown-menu>li>a:hover>[class*=" icon-"], .dropdown-menu>li>a:focus>[class*=" icon-"], .dropdown-menu>.active>a>[class^="icon-"], .dropdown-menu>.active>a>[class*=" icon-"], .dropdown-submenu:hover>a>[class^="icon-"], .dropdown-submenu:focus>a>[class^="icon-"], .dropdown-submenu:hover>a>[class*=" icon-"], .dropdown-submenu:focus>a>[class*=" icon-"] {background-image:url("../img/glyphicons-halflings-white.png")}.icon-glass {background-position:0 0}.icon-music {background-position:-24px 0}.icon-search {background-position:-48px 0}.icon-envelope {background-position:-72px 0}.icon-heart {background-position:-96px 0}.icon-star {background-position:-120px 0}.icon-star-empty {background-position:-144px 0}.icon-user {background-position:-168px 0}.icon-film {background-position:-192px 0}.icon-th-large {background-position:-216px 0}.icon-th {background-position:-240px 0}.icon-th-list {background-position:-264px 0}.icon-ok {background-position:-288px 0}.icon-remove {background-position:-312px 0}.icon-zoom-in {background-position:-336px 0}.icon-zoom-out {background-position:-360px 0}.icon-off {background-position:-384px 0}.icon-signal {background-position:-408px 0}.icon-cog {background-position:-432px 0}.icon-trash {background-position:-456px 0}.icon-home {background-position:0 -24px}.icon-file {background-position:-24px -24px}.icon-time {background-position:-48px -24px}.icon-road {background-position:-72px -24px}.icon-download-alt {background-position:-96px -24px}.icon-download {background-position:-120px -24px}.icon-upload {background-position:-144px -24px}.icon-inbox {background-position:-168px -24px}.icon-play-circle {background-position:-192px -24px}.icon-repeat {background-position:-216px -24px}.icon-refresh {background-position:-240px -24px}.icon-list-alt {background-position:-264px -24px}.icon-lock {background-position:-287px -24px}.icon-flag {background-position:-312px -24px}.icon-headphones {background-position:-336px -24px}.icon-volume-off {background-position:-360px -24px}.icon-volume-down {background-position:-384px -24px}.icon-volume-up {background-position:-408px -24px}.icon-qrcode {background-position:-432px -24px}.icon-barcode {background-position:-456px -24px}.icon-tag {background-position:0 -48px}.icon-tags {background-position:-25px -48px}.icon-book {background-position:-48px -48px}.icon-bookmark {background-position:-72px -48px}.icon-print {background-position:-96px -48px}.icon-camera {background-position:-120px -48px}.icon-font {background-position:-144px -48px}.icon-bold {background-position:-167px -48px}.icon-italic {background-position:-192px -48px}.icon-text-height {background-position:-216px -48px}.icon-text-width {background-position:-240px -48px}.icon-align-left {background-position:-264px -48px}.icon-align-center {background-position:-288px -48px}.icon-align-right {background-position:-312px -48px}.icon-align-justify {background-position:-336px -48px}.icon-list {background-position:-360px -48px}.icon-indent-left {background-position:-384px -48px}.icon-indent-right {background-position:-408px -48px}.icon-facetime-video {background-position:-432px -48px}.icon-picture {background-position:-456px -48px}.icon-pencil {background-position:0 -72px}.icon-map-marker {background-position:-24px -72px}.icon-adjust {background-position:-48px -72px}.icon-tint {background-position:-72px -72px}.icon-edit {background-position:-96px -72px}.icon-share {background-position:-120px -72px}.icon-check {background-position:-144px -72px}.icon-move {background-position:-168px -72px}.icon-step-backward {background-position:-192px -72px}.icon-fast-backward {background-position:-216px -72px}.icon-backward {background-position:-240px -72px}.icon-play {background-position:-264px -72px}.icon-pause {background-position:-288px -72px}.icon-stop {background-position:-312px -72px}.icon-forward {background-position:-336px -72px}.icon-fast-forward {background-position:-360px -72px}.icon-step-forward {background-position:-384px -72px}.icon-eject {background-position:-408px -72px}.icon-chevron-left {background-position:-432px -72px}.icon-chevron-right {background-position:-456px -72px}.icon-plus-sign {background-position:0 -96px}.icon-minus-sign {background-position:-24px -96px}.icon-remove-sign {background-position:-48px -96px}.icon-ok-sign {background-position:-72px -96px}.icon-question-sign {background-position:-96px -96px}.icon-info-sign {background-position:-120px -96px}.icon-screenshot {background-position:-144px -96px}.icon-remove-circle {background-position:-168px -96px}.icon-ok-circle {background-position:-192px -96px}.icon-ban-circle {background-position:-216px -96px}.icon-arrow-left {background-position:-240px -96px}.icon-arrow-right {background-position:-264px -96px}.icon-arrow-up {background-position:-289px -96px}.icon-arrow-down {background-position:-312px -96px}.icon-share-alt {background-position:-336px -96px}.icon-resize-full {background-position:-360px -96px}.icon-resize-small {background-position:-384px -96px}.icon-plus {background-position:-408px -96px}.icon-minus {background-position:-433px -96px}.icon-asterisk {background-position:-456px -96px}.icon-exclamation-sign {background-position:0 -120px}.icon-gift {background-position:-24px -120px}.icon-leaf {background-position:-48px -120px}.icon-fire {background-position:-72px -120px}.icon-eye-open {background-position:-96px -120px}.icon-eye-close {background-position:-120px -120px}.icon-warning-sign {background-position:-144px -120px}.icon-plane {background-position:-168px -120px}.icon-calendar {background-position:-192px -120px}.icon-random {width:16px;background-position:-216px -120px}.icon-comment {background-position:-240px -120px}.icon-magnet {background-position:-264px -120px}.icon-chevron-up {background-position:-288px -120px}.icon-chevron-down {background-position:-313px -119px}.icon-retweet {background-position:-336px -120px}.icon-shopping-cart {background-position:-360px -120px}.icon-folder-close {width:16px;background-position:-384px -120px}.icon-folder-open {width:16px;background-position:-408px -120px}.icon-resize-vertical {background-position:-432px -119px}.icon-resize-horizontal {background-position:-456px -118px}.icon-hdd {background-position:0 -144px}.icon-bullhorn {background-position:-24px -144px}.icon-bell {background-position:-48px -144px}.icon-certificate {background-position:-72px -144px}.icon-thumbs-up {background-position:-96px -144px}.icon-thumbs-down {background-position:-120px -144px}.icon-hand-right {background-position:-144px -144px}.icon-hand-left {background-position:-168px -144px}.icon-hand-up {background-position:-192px -144px}.icon-hand-down {background-position:-216px -144px}.icon-circle-arrow-right {background-position:-240px -144px}.icon-circle-arrow-left {background-position:-264px -144px}.icon-circle-arrow-up {background-position:-288px -144px}.icon-circle-arrow-down {background-position:-312px -144px}.icon-globe {background-position:-336px -144px}.icon-wrench {background-position:-360px -144px}.icon-tasks {background-position:-384px -144px}.icon-filter {background-position:-408px -144px}.icon-briefcase {background-position:-432px -144px}.icon-fullscreen {background-position:-456px -144px}.dropup, .dropdown {position:relative}.dropdown-toggle {*margin-bottom:-3px}.dropdown-toggle:active, .open .dropdown-toggle {outline:0}.caret {display:inline-block;width:0;height:0;vertical-align:top;border-top:4px solid #000;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.dropdown .caret {margin-top:8px;margin-left:2px}.dropdown-menu {position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);*border-right-width:2px;*border-bottom-width:2px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.dropdown-menu.pull-right {right:0;left:auto}.dropdown-menu .divider {*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.dropdown-menu>li>a {display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover, .dropdown-menu>li>a:focus, .dropdown-submenu:hover>a, .dropdown-submenu:focus>a {color:#fff;text-decoration:none;background-color:#0081c2;background-image:-moz-linear-gradient(top, #08c, #0077b3);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#0077b3));background-image:-webkit-linear-gradient(top, #08c, #0077b3);background-image:-o-linear-gradient(top, #08c, #0077b3);background-image:linear-gradient(to bottom, #08c, #0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0)}.dropdown-menu>.active>a, .dropdown-menu>.active>a:hover, .dropdown-menu>.active>a:focus {color:#fff;text-decoration:none;background-color:#0081c2;background-image:-moz-linear-gradient(top, #08c, #0077b3);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#0077b3));background-image:-webkit-linear-gradient(top, #08c, #0077b3);background-image:-o-linear-gradient(top, #08c, #0077b3);background-image:linear-gradient(to bottom, #08c, #0077b3);background-repeat:repeat-x;outline:0;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0)}.dropdown-menu>.disabled>a, .dropdown-menu>.disabled>a:hover, .dropdown-menu>.disabled>a:focus {color:#999}.dropdown-menu>.disabled>a:hover, .dropdown-menu>.disabled>a:focus {text-decoration:none;cursor:default;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open {*z-index:1000}.open>.dropdown-menu {display:block}.pull-right>.dropdown-menu {right:0;left:auto}.dropup .caret, .navbar-fixed-bottom .dropdown .caret {border-top:0;border-bottom:4px solid #000;content:""}.dropup .dropdown-menu, .navbar-fixed-bottom .dropdown .dropdown-menu {top:auto;bottom:100%;margin-bottom:1px}.dropdown-submenu {position:relative}.dropdown-submenu>.dropdown-menu {top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px}.dropdown-submenu:hover>.dropdown-menu {display:block}.dropup .dropdown-submenu>.dropdown-menu {top:auto;bottom:0;margin-top:0;margin-bottom:-2px;-webkit-border-radius:5px 5px 5px 0;-moz-border-radius:5px 5px 5px 0;border-radius:5px 5px 5px 0}.dropdown-submenu>a:after {display:block;float:right;width:0;height:0;margin-top:5px;margin-right:-10px;border-color:transparent;border-left-color:#ccc;border-style:solid;border-width:5px 0 5px 5px;content:" "}.dropdown-submenu:hover>a:after {border-left-color:#fff}.dropdown-submenu.pull-left {float:none}.dropdown-submenu.pull-left>.dropdown-menu {left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.dropdown .dropdown-menu .nav-header {padding-right:20px;padding-left:20px}.typeahead {z-index:1051;margin-top:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.well {min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote {border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-large {padding:24px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.well-small {padding:9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.fade {opacity:0;-webkit-transition:opacity .15s linear;-moz-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in {opacity:1}.collapse {position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;-moz-transition:height .35s ease;-o-transition:height .35s ease;transition:height .35s ease}.collapse.in {height:auto}.close {float:right;font-size:20px;font-weight:bold;line-height:20px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover, .close:focus {color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}button.close {padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.btn {display:inline-block;*display:inline;padding:4px 12px;margin-bottom:0;*margin-left:.3em;font-size:14px;line-height:20px;color:#333;text-align:center;text-shadow:0 1px 1px rgba(255,255,255,0.75);vertical-align:middle;cursor:pointer;background-color:#f5f5f5;*background-color:#e6e6e6;background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#e6e6e6));background-image:-webkit-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:linear-gradient(to bottom, #fff, #e6e6e6);background-repeat:repeat-x;border:1px solid #ccc;*border:0;border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom-color:#b3b3b3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);*zoom:1;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 2px rgba(0,0,0,0.05)}.btn:hover, .btn:focus, .btn:active, .btn.active, .btn.disabled, .btn[disabled] {color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.btn:active, .btn.active {background-color:#ccc \9}.btn:first-child {*margin-left:0}.btn:hover, .btn:focus {color:#333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.btn:focus {outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.active, .btn:active {background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.05)}.btn.disabled, .btn[disabled] {cursor:default;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-large {padding:11px 19px;font-size:17.5px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.btn-large [class^="icon-"], .btn-large [class*=" icon-"] {margin-top:4px}.btn-small {padding:2px 10px;font-size:11.9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-small [class^="icon-"], .btn-small [class*=" icon-"] {margin-top:0}.btn-mini [class^="icon-"], .btn-mini [class*=" icon-"] {margin-top:-1px}.btn-mini {padding:0 6px;font-size:10.5px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-block {display:block;width:100%;padding-right:0;padding-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.btn-block+.btn-block {margin-top:5px}input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="button"].btn-block {width:100%}.btn-primary.active, .btn-warning.active, .btn-danger.active, .btn-success.active, .btn-info.active, .btn-inverse.active {color:rgba(255,255,255,0.75)}.btn-primary {color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#006dcc;*background-color:#04c;background-image:-moz-linear-gradient(top, #08c, #04c);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#04c));background-image:-webkit-linear-gradient(top, #08c, #04c);background-image:-o-linear-gradient(top, #08c, #04c);background-image:linear-gradient(to bottom, #08c, #04c);background-repeat:repeat-x;border-color:#04c #04c #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .btn-primary.disabled, .btn-primary[disabled] {color:#fff;background-color:#04c;*background-color:#003bb3}.btn-primary:active, .btn-primary.active {background-color:#039 \9}.btn-warning {color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#faa732;*background-color:#f89406;background-image:-moz-linear-gradient(top, #fbb450, #f89406);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));background-image:-webkit-linear-gradient(top, #fbb450, #f89406);background-image:-o-linear-gradient(top, #fbb450, #f89406);background-image:linear-gradient(to bottom, #fbb450, #f89406);background-repeat:repeat-x;border-color:#f89406 #f89406 #ad6704;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-warning:hover, .btn-warning:focus, .btn-warning:active, .btn-warning.active, .btn-warning.disabled, .btn-warning[disabled] {color:#fff;background-color:#f89406;*background-color:#df8505}.btn-warning:active, .btn-warning.active {background-color:#c67605 \9}.btn-danger {color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#da4f49;*background-color:#bd362f;background-image:-moz-linear-gradient(top, #ee5f5b, #bd362f);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));background-image:-webkit-linear-gradient(top, #ee5f5b, #bd362f);background-image:-o-linear-gradient(top, #ee5f5b, #bd362f);background-image:linear-gradient(to bottom, #ee5f5b, #bd362f);background-repeat:repeat-x;border-color:#bd362f #bd362f #802420;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-danger:hover, .btn-danger:focus, .btn-danger:active, .btn-danger.active, .btn-danger.disabled, .btn-danger[disabled] {color:#fff;background-color:#bd362f;*background-color:#a9302a}.btn-danger:active, .btn-danger.active {background-color:#942a25 \9}.btn-success {color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#5bb75b;*background-color:#51a351;background-image:-moz-linear-gradient(top, #62c462, #51a351);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351));background-image:-webkit-linear-gradient(top, #62c462, #51a351);background-image:-o-linear-gradient(top, #62c462, #51a351);background-image:linear-gradient(to bottom, #62c462, #51a351);background-repeat:repeat-x;border-color:#51a351 #51a351 #387038;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff51a351', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-success:hover, .btn-success:focus, .btn-success:active, .btn-success.active, .btn-success.disabled, .btn-success[disabled] {color:#fff;background-color:#51a351;*background-color:#499249}.btn-success:active, .btn-success.active {background-color:#408140 \9}.btn-info {color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#49afcd;*background-color:#2f96b4;background-image:-moz-linear-gradient(top, #5bc0de, #2f96b4);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4));background-image:-webkit-linear-gradient(top, #5bc0de, #2f96b4);background-image:-o-linear-gradient(top, #5bc0de, #2f96b4);background-image:linear-gradient(to bottom, #5bc0de, #2f96b4);background-repeat:repeat-x;border-color:#2f96b4 #2f96b4 #1f6377;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2f96b4', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-info:hover, .btn-info:focus, .btn-info:active, .btn-info.active, .btn-info.disabled, .btn-info[disabled] {color:#fff;background-color:#2f96b4;*background-color:#2a85a0}.btn-info:active, .btn-info.active {background-color:#24748c \9}.btn-inverse {color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#363636;*background-color:#222;background-image:-moz-linear-gradient(top, #444, #222);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#444), to(#222));background-image:-webkit-linear-gradient(top, #444, #222);background-image:-o-linear-gradient(top, #444, #222);background-image:linear-gradient(to bottom, #444, #222);background-repeat:repeat-x;border-color:#222 #222 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-inverse:hover, .btn-inverse:focus, .btn-inverse:active, .btn-inverse.active, .btn-inverse.disabled, .btn-inverse[disabled] {color:#fff;background-color:#222;*background-color:#151515}.btn-inverse:active, .btn-inverse.active {background-color:#080808 \9}button.btn, input[type="submit"].btn {*padding-top:3px;*padding-bottom:3px}button.btn::-moz-focus-inner, input[type="submit"].btn::-moz-focus-inner {padding:0;border:0}button.btn.btn-large, input[type="submit"].btn.btn-large {*padding-top:7px;*padding-bottom:7px}button.btn.btn-small, input[type="submit"].btn.btn-small {*padding-top:3px;*padding-bottom:3px}button.btn.btn-mini, input[type="submit"].btn.btn-mini {*padding-top:1px;*padding-bottom:1px}.btn-link, .btn-link:active, .btn-link[disabled] {background-color:transparent;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-link {color:#08c;cursor:pointer;border-color:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-link:hover, .btn-link:focus {color:#005580;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover, .btn-link[disabled]:focus {color:#333;text-decoration:none}.btn-group {position:relative;display:inline-block;*display:inline;*margin-left:.3em;font-size:0;white-space:nowrap;vertical-align:middle;*zoom:1}.btn-group:first-child {*margin-left:0}.btn-group+.btn-group {margin-left:5px}.btn-toolbar {margin-top:10px;margin-bottom:10px;font-size:0}.btn-toolbar>.btn+.btn, .btn-toolbar>.btn-group+.btn, .btn-toolbar>.btn+.btn-group {margin-left:5px}.btn-group>.btn {position:relative;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group>.btn+.btn {margin-left:-1px}.btn-group>.btn, .btn-group>.dropdown-menu, .btn-group>.popover {font-size:14px}.btn-group>.btn-mini {font-size:10.5px}.btn-group>.btn-small {font-size:11.9px}.btn-group>.btn-large {font-size:17.5px}.btn-group>.btn:first-child {margin-left:0;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-topleft:4px}.btn-group>.btn:last-child, .btn-group>.dropdown-toggle {-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px}.btn-group>.btn.large:first-child {margin-left:0;-webkit-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-webkit-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-topleft:6px}.btn-group>.btn.large:last-child, .btn-group>.large.dropdown-toggle {-webkit-border-top-right-radius:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;border-bottom-right-radius:6px;-moz-border-radius-topright:6px;-moz-border-radius-bottomright:6px}.btn-group>.btn:hover, .btn-group>.btn:focus, .btn-group>.btn:active, .btn-group>.btn.active {z-index:2}.btn-group .dropdown-toggle:active, .btn-group.open .dropdown-toggle {outline:0}.btn-group>.btn+.dropdown-toggle {*padding-top:5px;padding-right:8px;*padding-bottom:5px;padding-left:8px;-webkit-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125), inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125), inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 1px 0 0 rgba(255,255,255,0.125), inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 2px rgba(0,0,0,0.05)}.btn-group>.btn-mini+.dropdown-toggle {*padding-top:2px;padding-right:5px;*padding-bottom:2px;padding-left:5px}.btn-group>.btn-small+.dropdown-toggle {*padding-top:5px;*padding-bottom:4px}.btn-group>.btn-large+.dropdown-toggle {*padding-top:7px;padding-right:12px;*padding-bottom:7px;padding-left:12px}.btn-group.open .dropdown-toggle {background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.05)}.btn-group.open .btn.dropdown-toggle {background-color:#e6e6e6}.btn-group.open .btn-primary.dropdown-toggle {background-color:#04c}.btn-group.open .btn-warning.dropdown-toggle {background-color:#f89406}.btn-group.open .btn-danger.dropdown-toggle {background-color:#bd362f}.btn-group.open .btn-success.dropdown-toggle {background-color:#51a351}.btn-group.open .btn-info.dropdown-toggle {background-color:#2f96b4}.btn-group.open .btn-inverse.dropdown-toggle {background-color:#222}.btn .caret {margin-top:8px;margin-left:0}.btn-large .caret {margin-top:6px}.btn-large .caret {border-top-width:5px;border-right-width:5px;border-left-width:5px}.btn-mini .caret, .btn-small .caret {margin-top:8px}.dropup .btn-large .caret {border-bottom-width:5px}.btn-primary .caret, .btn-warning .caret, .btn-danger .caret, .btn-info .caret, .btn-success .caret, .btn-inverse .caret {border-top-color:#fff;border-bottom-color:#fff}.btn-group-vertical {display:inline-block;*display:inline;*zoom:1}.btn-group-vertical>.btn {display:block;float:none;max-width:100%;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group-vertical>.btn+.btn {margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:first-child {-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.btn-group-vertical>.btn:last-child {-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.btn-group-vertical>.btn-large:first-child {-webkit-border-radius:6px 6px 0 0;-moz-border-radius:6px 6px 0 0;border-radius:6px 6px 0 0}.btn-group-vertical>.btn-large:last-child {-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.alert {padding:8px 35px 8px 14px;margin-bottom:20px;text-shadow:0 1px 0 rgba(255,255,255,0.5);background-color:#fcf8e3;border:1px solid #fbeed5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.alert, .alert h4 {color:#c09853}.alert h4 {margin:0}.alert .close {position:relative;top:-2px;right:-21px;line-height:20px}.alert-success {color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.alert-success h4 {color:#468847}.alert-danger, .alert-error {color:#b94a48;background-color:#f2dede;border-color:#eed3d7}.alert-danger h4, .alert-error h4 {color:#b94a48}.alert-info {color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}.alert-info h4 {color:#3a87ad}.alert-block {padding-top:14px;padding-bottom:14px}.alert-block>p, .alert-block>ul {margin-bottom:0}.alert-block p+p {margin-top:5px}.nav {margin-bottom:20px;margin-left:0;list-style:none}.nav>li>a {display:block}.nav>li>a:hover, .nav>li>a:focus {text-decoration:none;background-color:#eee}.nav>li>a>img {max-width:none}.nav>.pull-right {float:right}.nav-header {display:block;padding:3px 15px;font-size:11px;font-weight:bold;line-height:20px;color:#999;text-shadow:0 1px 0 rgba(255,255,255,0.5);text-transform:uppercase}.nav li+.nav-header {margin-top:9px}.nav-list {padding-right:15px;padding-left:15px;margin-bottom:0}.nav-list>li>a, .nav-list .nav-header {margin-right:-15px;margin-left:-15px;text-shadow:0 1px 0 rgba(255,255,255,0.5)}.nav-list>li>a {padding:3px 15px}.nav-list>.active>a, .nav-list>.active>a:hover, .nav-list>.active>a:focus {color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.2);background-color:#08c}.nav-list [class^="icon-"], .nav-list [class*=" icon-"] {margin-right:2px}.nav-list .divider {*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.nav-tabs, .nav-pills {*zoom:1}.nav-tabs:before, .nav-pills:before, .nav-tabs:after, .nav-pills:after {display:table;line-height:0;content:""}.nav-tabs:after, .nav-pills:after {clear:both}.nav-tabs>li, .nav-pills>li {float:left}.nav-tabs>li>a, .nav-pills>li>a {padding-right:12px;padding-left:12px;margin-right:2px;line-height:14px}.nav-tabs {border-bottom:1px solid #ddd}.nav-tabs>li {margin-bottom:-1px}.nav-tabs>li>a {padding-top:8px;padding-bottom:8px;line-height:20px;border:1px solid transparent;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover, .nav-tabs>li>a:focus {border-color:#eee #eee #ddd}.nav-tabs>.active>a, .nav-tabs>.active>a:hover, .nav-tabs>.active>a:focus {color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-pills>li>a {padding-top:8px;padding-bottom:8px;margin-top:2px;margin-bottom:2px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.nav-pills>.active>a, .nav-pills>.active>a:hover, .nav-pills>.active>a:focus {color:#fff;background-color:#08c}.nav-stacked>li {float:none}.nav-stacked>li>a {margin-right:0}.nav-tabs.nav-stacked {border-bottom:0}.nav-tabs.nav-stacked>li>a {border:1px solid #ddd;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.nav-tabs.nav-stacked>li:first-child>a {-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-topleft:4px}.nav-tabs.nav-stacked>li:last-child>a {-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomright:4px;-moz-border-radius-bottomleft:4px}.nav-tabs.nav-stacked>li>a:hover, .nav-tabs.nav-stacked>li>a:focus {z-index:2;border-color:#ddd}.nav-pills.nav-stacked>li>a {margin-bottom:3px}.nav-pills.nav-stacked>li:last-child>a {margin-bottom:1px}.nav-tabs .dropdown-menu {-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.nav-pills .dropdown-menu {-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.nav .dropdown-toggle .caret {margin-top:6px;border-top-color:#08c;border-bottom-color:#08c}.nav .dropdown-toggle:hover .caret, .nav .dropdown-toggle:focus .caret {border-top-color:#005580;border-bottom-color:#005580}.nav-tabs .dropdown-toggle .caret {margin-top:8px}.nav .active .dropdown-toggle .caret {border-top-color:#fff;border-bottom-color:#fff}.nav-tabs .active .dropdown-toggle .caret {border-top-color:#555;border-bottom-color:#555}.nav>.dropdown.active>a:hover, .nav>.dropdown.active>a:focus {cursor:pointer}.nav-tabs .open .dropdown-toggle, .nav-pills .open .dropdown-toggle, .nav>li.dropdown.open.active>a:hover, .nav>li.dropdown.open.active>a:focus {color:#fff;background-color:#999;border-color:#999}.nav li.dropdown.open .caret, .nav li.dropdown.open.active .caret, .nav li.dropdown.open a:hover .caret, .nav li.dropdown.open a:focus .caret {border-top-color:#fff;border-bottom-color:#fff;opacity:1;filter:alpha(opacity=100)}.tabs-stacked .open>a:hover, .tabs-stacked .open>a:focus {border-color:#999}.tabbable {*zoom:1}.tabbable:before, .tabbable:after {display:table;line-height:0;content:""}.tabbable:after {clear:both}.tab-content {overflow:auto}.tabs-below>.nav-tabs, .tabs-right>.nav-tabs, .tabs-left>.nav-tabs {border-bottom:0}.tab-content>.tab-pane, .pill-content>.pill-pane {display:none}.tab-content>.active, .pill-content>.active {display:block}.tabs-below>.nav-tabs {border-top:1px solid #ddd}.tabs-below>.nav-tabs>li {margin-top:-1px;margin-bottom:0}.tabs-below>.nav-tabs>li>a {-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.tabs-below>.nav-tabs>li>a:hover, .tabs-below>.nav-tabs>li>a:focus {border-top-color:#ddd;border-bottom-color:transparent}.tabs-below>.nav-tabs>.active>a, .tabs-below>.nav-tabs>.active>a:hover, .tabs-below>.nav-tabs>.active>a:focus {border-color:transparent #ddd #ddd #ddd}.tabs-left>.nav-tabs>li, .tabs-right>.nav-tabs>li {float:none}.tabs-left>.nav-tabs>li>a, .tabs-right>.nav-tabs>li>a {min-width:74px;margin-right:0;margin-bottom:3px}.tabs-left>.nav-tabs {float:left;margin-right:19px;border-right:1px solid #ddd}.tabs-left>.nav-tabs>li>a {margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.tabs-left>.nav-tabs>li>a:hover, .tabs-left>.nav-tabs>li>a:focus {border-color:#eee #ddd #eee #eee}.tabs-left>.nav-tabs .active>a, .tabs-left>.nav-tabs .active>a:hover, .tabs-left>.nav-tabs .active>a:focus {border-color:#ddd transparent #ddd #ddd;*border-right-color:#fff}.tabs-right>.nav-tabs {float:right;margin-left:19px;border-left:1px solid #ddd}.tabs-right>.nav-tabs>li>a {margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.tabs-right>.nav-tabs>li>a:hover, .tabs-right>.nav-tabs>li>a:focus {border-color:#eee #eee #eee #ddd}.tabs-right>.nav-tabs .active>a, .tabs-right>.nav-tabs .active>a:hover, .tabs-right>.nav-tabs .active>a:focus {border-color:#ddd #ddd #ddd transparent;*border-left-color:#fff}.nav>.disabled>a {color:#999}.nav>.disabled>a:hover, .nav>.disabled>a:focus {text-decoration:none;cursor:default;background-color:transparent}.navbar {*position:relative;*z-index:2;margin-bottom:20px;overflow:visible}.navbar-inner {min-height:40px;padding-right:20px;padding-left:20px;background-color:#fafafa;background-image:-moz-linear-gradient(top, #fff, #f2f2f2);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#f2f2f2));background-image:-webkit-linear-gradient(top, #fff, #f2f2f2);background-image:-o-linear-gradient(top, #fff, #f2f2f2);background-image:linear-gradient(to bottom, #fff, #f2f2f2);background-repeat:repeat-x;border:1px solid #d4d4d4;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff2f2f2', GradientType=0);*zoom:1;-webkit-box-shadow:0 1px 4px rgba(0,0,0,0.065);-moz-box-shadow:0 1px 4px rgba(0,0,0,0.065);box-shadow:0 1px 4px rgba(0,0,0,0.065)}.navbar-inner:before, .navbar-inner:after {display:table;line-height:0;content:""}.navbar-inner:after {clear:both}.navbar .container {width:auto}.nav-collapse.collapse {height:auto;overflow:visible}.navbar .brand {display:block;float:left;padding:10px 20px 10px;margin-left:-20px;font-size:20px;font-weight:200;color:#777;text-shadow:0 1px 0 #fff}.navbar .brand:hover, .navbar .brand:focus {text-decoration:none}.navbar-text {margin-bottom:0;line-height:40px;color:#777}.navbar-link {color:#777}.navbar-link:hover, .navbar-link:focus {color:#333}.navbar .divider-vertical {height:40px;margin:0 9px;border-right:1px solid #fff;border-left:1px solid #f2f2f2}.navbar .btn, .navbar .btn-group {margin-top:5px}.navbar .btn-group .btn, .navbar .input-prepend .btn, .navbar .input-append .btn, .navbar .input-prepend .btn-group, .navbar .input-append .btn-group {margin-top:0}.navbar-form {margin-bottom:0;*zoom:1}.navbar-form:before, .navbar-form:after {display:table;line-height:0;content:""}.navbar-form:after {clear:both}.navbar-form input, .navbar-form select, .navbar-form .radio, .navbar-form .checkbox {margin-top:5px}.navbar-form input, .navbar-form select, .navbar-form .btn {display:inline-block;margin-bottom:0}.navbar-form input[type="image"], .navbar-form input[type="checkbox"], .navbar-form input[type="radio"] {margin-top:3px}.navbar-form .input-append, .navbar-form .input-prepend {margin-top:5px;white-space:nowrap}.navbar-form .input-append input, .navbar-form .input-prepend input {margin-top:0}.navbar-search {position:relative;float:left;margin-top:5px;margin-bottom:0}.navbar-search .search-query {padding:4px 14px;margin-bottom:0;font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;font-size:13px;font-weight:normal;line-height:1;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.navbar-static-top {position:static;margin-bottom:0}.navbar-static-top .navbar-inner {-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-fixed-top, .navbar-fixed-bottom {position:fixed;right:0;left:0;z-index:1030;margin-bottom:0}.navbar-fixed-top .navbar-inner, .navbar-static-top .navbar-inner {border-width:0 0 1px}.navbar-fixed-bottom .navbar-inner {border-width:1px 0 0}.navbar-fixed-top .navbar-inner, .navbar-fixed-bottom .navbar-inner {padding-right:0;padding-left:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-static-top .container, .navbar-fixed-top .container, .navbar-fixed-bottom .container {width:940px}.navbar-fixed-top {top:0}.navbar-fixed-top .navbar-inner, .navbar-static-top .navbar-inner {-webkit-box-shadow:0 1px 10px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 10px rgba(0,0,0,0.1);box-shadow:0 1px 10px rgba(0,0,0,0.1)}.navbar-fixed-bottom {bottom:0}.navbar-fixed-bottom .navbar-inner {-webkit-box-shadow:0 -1px 10px rgba(0,0,0,0.1);-moz-box-shadow:0 -1px 10px rgba(0,0,0,0.1);box-shadow:0 -1px 10px rgba(0,0,0,0.1)}.navbar .nav {position:relative;left:0;display:block;float:left;margin:0 10px 0 0}.navbar .nav.pull-right {float:right;margin-right:0}.navbar .nav>li {float:left}.navbar .nav>li>a {float:none;padding:10px 15px 10px;color:#777;text-decoration:none;text-shadow:0 1px 0 #fff}.navbar .nav .dropdown-toggle .caret {margin-top:8px}.navbar .nav>li>a:focus, .navbar .nav>li>a:hover {color:#333;text-decoration:none;background-color:transparent}.navbar .nav>.active>a, .navbar .nav>.active>a:hover, .navbar .nav>.active>a:focus {color:#555;text-decoration:none;background-color:#e5e5e5;-webkit-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);-moz-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);box-shadow:inset 0 3px 8px rgba(0,0,0,0.125)}.navbar .btn-navbar {display:none;float:right;padding:7px 10px;margin-right:5px;margin-left:5px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#ededed;*background-color:#e5e5e5;background-image:-moz-linear-gradient(top, #f2f2f2, #e5e5e5);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#e5e5e5));background-image:-webkit-linear-gradient(top, #f2f2f2, #e5e5e5);background-image:-o-linear-gradient(top, #f2f2f2, #e5e5e5);background-image:linear-gradient(to bottom, #f2f2f2, #e5e5e5);background-repeat:repeat-x;border-color:#e5e5e5 #e5e5e5 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2', endColorstr='#ffe5e5e5', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1), 0 1px 0 rgba(255,255,255,0.075);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1), 0 1px 0 rgba(255,255,255,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1), 0 1px 0 rgba(255,255,255,0.075)}.navbar .btn-navbar:hover, .navbar .btn-navbar:focus, .navbar .btn-navbar:active, .navbar .btn-navbar.active, .navbar .btn-navbar.disabled, .navbar .btn-navbar[disabled] {color:#fff;background-color:#e5e5e5;*background-color:#d9d9d9}.navbar .btn-navbar:active, .navbar .btn-navbar.active {background-color:#ccc \9}.navbar .btn-navbar .icon-bar {display:block;width:18px;height:2px;background-color:#f5f5f5;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,0.25);-moz-box-shadow:0 1px 0 rgba(0,0,0,0.25);box-shadow:0 1px 0 rgba(0,0,0,0.25)}.btn-navbar .icon-bar+.icon-bar {margin-top:3px}.navbar .nav>li>.dropdown-menu:before {position:absolute;top:-7px;left:9px;display:inline-block;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-left:7px solid transparent;border-bottom-color:rgba(0,0,0,0.2);content:''}.navbar .nav>li>.dropdown-menu:after {position:absolute;top:-6px;left:10px;display:inline-block;border-right:6px solid transparent;border-bottom:6px solid #fff;border-left:6px solid transparent;content:''}.navbar-fixed-bottom .nav>li>.dropdown-menu:before {top:auto;bottom:-7px;border-top:7px solid #ccc;border-bottom:0;border-top-color:rgba(0,0,0,0.2)}.navbar-fixed-bottom .nav>li>.dropdown-menu:after {top:auto;bottom:-6px;border-top:6px solid #fff;border-bottom:0}.navbar .nav li.dropdown>a:hover .caret, .navbar .nav li.dropdown>a:focus .caret {border-top-color:#333;border-bottom-color:#333}.navbar .nav li.dropdown.open>.dropdown-toggle, .navbar .nav li.dropdown.active>.dropdown-toggle, .navbar .nav li.dropdown.open.active>.dropdown-toggle {color:#555;background-color:#e5e5e5}.navbar .nav li.dropdown>.dropdown-toggle .caret {border-top-color:#777;border-bottom-color:#777}.navbar .nav li.dropdown.open>.dropdown-toggle .caret, .navbar .nav li.dropdown.active>.dropdown-toggle .caret, .navbar .nav li.dropdown.open.active>.dropdown-toggle .caret {border-top-color:#555;border-bottom-color:#555}.navbar .pull-right>li>.dropdown-menu, .navbar .nav>li>.dropdown-menu.pull-right {right:0;left:auto}.navbar .pull-right>li>.dropdown-menu:before, .navbar .nav>li>.dropdown-menu.pull-right:before {right:12px;left:auto}.navbar .pull-right>li>.dropdown-menu:after, .navbar .nav>li>.dropdown-menu.pull-right:after {right:13px;left:auto}.navbar .pull-right>li>.dropdown-menu .dropdown-menu, .navbar .nav>li>.dropdown-menu.pull-right .dropdown-menu {right:100%;left:auto;margin-right:-1px;margin-left:0;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.navbar-inverse .navbar-inner {background-color:#1b1b1b;background-image:-moz-linear-gradient(top, #222, #111);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#222), to(#111));background-image:-webkit-linear-gradient(top, #222, #111);background-image:-o-linear-gradient(top, #222, #111);background-image:linear-gradient(to bottom, #222, #111);background-repeat:repeat-x;border-color:#252525;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff111111', GradientType=0)}.navbar-inverse .brand, .navbar-inverse .nav>li>a {color:#999;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.navbar-inverse .brand:hover, .navbar-inverse .nav>li>a:hover, .navbar-inverse .brand:focus, .navbar-inverse .nav>li>a:focus {color:#fff}.navbar-inverse .brand {color:#999}.navbar-inverse .navbar-text {color:#999}.navbar-inverse .nav>li>a:focus, .navbar-inverse .nav>li>a:hover {color:#fff;background-color:transparent}.navbar-inverse .nav .active>a, .navbar-inverse .nav .active>a:hover, .navbar-inverse .nav .active>a:focus {color:#fff;background-color:#111}.navbar-inverse .navbar-link {color:#999}.navbar-inverse .navbar-link:hover, .navbar-inverse .navbar-link:focus {color:#fff}.navbar-inverse .divider-vertical {border-right-color:#222;border-left-color:#111}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle, .navbar-inverse .nav li.dropdown.active>.dropdown-toggle, .navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle {color:#fff;background-color:#111}.navbar-inverse .nav li.dropdown>a:hover .caret, .navbar-inverse .nav li.dropdown>a:focus .caret {border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .nav li.dropdown>.dropdown-toggle .caret {border-top-color:#999;border-bottom-color:#999}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle .caret, .navbar-inverse .nav li.dropdown.active>.dropdown-toggle .caret, .navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle .caret {border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .navbar-search .search-query {color:#fff;background-color:#515151;border-color:#111;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1), 0 1px 0 rgba(255,255,255,0.15);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1), 0 1px 0 rgba(255,255,255,0.15);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1), 0 1px 0 rgba(255,255,255,0.15);-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.navbar-inverse .navbar-search .search-query:-moz-placeholder {color:#ccc}.navbar-inverse .navbar-search .search-query:-ms-input-placeholder {color:#ccc}.navbar-inverse .navbar-search .search-query::-webkit-input-placeholder {color:#ccc}.navbar-inverse .navbar-search .search-query:focus, .navbar-inverse .navbar-search .search-query.focused {padding:5px 15px;color:#333;text-shadow:0 1px 0 #fff;background-color:#fff;border:0;outline:0;-webkit-box-shadow:0 0 3px rgba(0,0,0,0.15);-moz-box-shadow:0 0 3px rgba(0,0,0,0.15);box-shadow:0 0 3px rgba(0,0,0,0.15)}.navbar-inverse .btn-navbar {color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e0e0e;*background-color:#040404;background-image:-moz-linear-gradient(top, #151515, #040404);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#151515), to(#040404));background-image:-webkit-linear-gradient(top, #151515, #040404);background-image:-o-linear-gradient(top, #151515, #040404);background-image:linear-gradient(to bottom, #151515, #040404);background-repeat:repeat-x;border-color:#040404 #040404 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff151515', endColorstr='#ff040404', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.navbar-inverse .btn-navbar:hover, .navbar-inverse .btn-navbar:focus, .navbar-inverse .btn-navbar:active, .navbar-inverse .btn-navbar.active, .navbar-inverse .btn-navbar.disabled, .navbar-inverse .btn-navbar[disabled] {color:#fff;background-color:#040404;*background-color:#000}.navbar-inverse .btn-navbar:active, .navbar-inverse .btn-navbar.active {background-color:#000 \9}.breadcrumb {padding:8px 15px;margin:0 0 20px;list-style:none;background-color:#f5f5f5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.breadcrumb>li {display:inline-block;*display:inline;text-shadow:0 1px 0 #fff;*zoom:1}.breadcrumb>li>.divider {padding:0 5px;color:#ccc}.breadcrumb>.active {color:#999}.pagination {margin:20px 0}.pagination ul {display:inline-block;*display:inline;margin-bottom:0;margin-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*zoom:1;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:0 1px 2px rgba(0,0,0,0.05);box-shadow:0 1px 2px rgba(0,0,0,0.05)}.pagination ul>li {display:inline}.pagination ul>li>a, .pagination ul>li>span {float:left;padding:4px 12px;line-height:20px;text-decoration:none;background-color:#fff;border:1px solid #ddd;border-left-width:0}.pagination ul>li>a:hover, .pagination ul>li>a:focus, .pagination ul>.active>a, .pagination ul>.active>span {background-color:#f5f5f5}.pagination ul>.active>a, .pagination ul>.active>span {color:#999;cursor:default}.pagination ul>.disabled>span, .pagination ul>.disabled>a, .pagination ul>.disabled>a:hover, .pagination ul>.disabled>a:focus {color:#999;cursor:default;background-color:transparent}.pagination ul>li:first-child>a, .pagination ul>li:first-child>span {border-left-width:1px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-topleft:4px}.pagination ul>li:last-child>a, .pagination ul>li:last-child>span {-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px}.pagination-centered {text-align:center}.pagination-right {text-align:right}.pagination-large ul>li>a, .pagination-large ul>li>span {padding:11px 19px;font-size:17.5px}.pagination-large ul>li:first-child>a, .pagination-large ul>li:first-child>span {-webkit-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-webkit-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-topleft:6px}.pagination-large ul>li:last-child>a, .pagination-large ul>li:last-child>span {-webkit-border-top-right-radius:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;border-bottom-right-radius:6px;-moz-border-radius-topright:6px;-moz-border-radius-bottomright:6px}.pagination-mini ul>li:first-child>a, .pagination-small ul>li:first-child>a, .pagination-mini ul>li:first-child>span, .pagination-small ul>li:first-child>span {-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-radius-bottomleft:3px;-moz-border-radius-topleft:3px}.pagination-mini ul>li:last-child>a, .pagination-small ul>li:last-child>a, .pagination-mini ul>li:last-child>span, .pagination-small ul>li:last-child>span {-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px;-moz-border-radius-topright:3px;-moz-border-radius-bottomright:3px}.pagination-small ul>li>a, .pagination-small ul>li>span {padding:2px 10px;font-size:11.9px}.pagination-mini ul>li>a, .pagination-mini ul>li>span {padding:0 6px;font-size:10.5px}.pager {margin:20px 0;text-align:center;list-style:none;*zoom:1}.pager:before, .pager:after {display:table;line-height:0;content:""}.pager:after {clear:both}.pager li {display:inline}.pager li>a, .pager li>span {display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.pager li>a:hover, .pager li>a:focus {text-decoration:none;background-color:#f5f5f5}.pager .next>a, .pager .next>span {float:right}.pager .previous>a, .pager .previous>span {float:left}.pager .disabled>a, .pager .disabled>a:hover, .pager .disabled>a:focus, .pager .disabled>span {color:#999;cursor:default;background-color:#fff}.modal-backdrop {position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade {opacity:0}.modal-backdrop, .modal-backdrop.fade.in {opacity:.8;filter:alpha(opacity=80)}.modal {position:fixed;top:10%;left:50%;z-index:1050;width:560px;margin-left:-280px;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;outline:0;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box}.modal.fade {top:-25%;-webkit-transition:opacity .3s linear, top .3s ease-out;-moz-transition:opacity .3s linear, top .3s ease-out;-o-transition:opacity .3s linear, top .3s ease-out;transition:opacity .3s linear, top .3s ease-out}.modal.fade.in {top:10%}.modal-header {padding:9px 15px;border-bottom:1px solid #eee}.modal-header .close {margin-top:2px}.modal-header h3 {margin:0;line-height:30px}.modal-body {position:relative;max-height:400px;padding:15px;overflow-y:auto}.modal-form {margin-bottom:0}.modal-footer {padding:14px 15px 15px;margin-bottom:0;text-align:right;background-color:#f5f5f5;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;*zoom:1;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.modal-footer:before, .modal-footer:after {display:table;line-height:0;content:""}.modal-footer:after {clear:both}.modal-footer .btn+.btn {margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn {margin-left:-1px}.modal-footer .btn-block+.btn-block {margin-left:0}.tooltip {position:absolute;z-index:1030;display:block;font-size:11px;line-height:1.4;opacity:0;filter:alpha(opacity=0);visibility:visible}.tooltip.in {opacity:.8;filter:alpha(opacity=80)}.tooltip.top {padding:5px 0;margin-top:-3px}.tooltip.right {padding:0 5px;margin-left:3px}.tooltip.bottom {padding:5px 0;margin-top:3px}.tooltip.left {padding:0 5px;margin-left:-3px}.tooltip-inner {max-width:200px;padding:8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.tooltip-arrow {position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow {bottom:0;left:50%;margin-left:-5px;border-top-color:#000;border-width:5px 5px 0}.tooltip.right .tooltip-arrow {top:50%;left:0;margin-top:-5px;border-right-color:#000;border-width:5px 5px 5px 0}.tooltip.left .tooltip-arrow {top:50%;right:0;margin-top:-5px;border-left-color:#000;border-width:5px 0 5px 5px}.tooltip.bottom .tooltip-arrow {top:0;left:50%;margin-left:-5px;border-bottom-color:#000;border-width:0 5px 5px}.popover {position:absolute;top:0;left:0;z-index:1010;display:none;min-width:200px;max-width:200px;padding:1px;text-align:left;white-space:normal;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.popover.top {margin-top:-10px}.popover.right {margin-left:10px}.popover.bottom {margin-top:10px}.popover.left {margin-left:-10px}.popover-title {padding:8px 14px;margin:0;font-size:14px;font-weight:normal;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.popover-title:empty {display:none}.popover-content {padding:9px 14px}.popover .arrow, .popover .arrow:after {position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover .arrow {border-width:11px}.popover .arrow:after {border-width:10px;content:""}.popover.top .arrow {bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,0.25);border-bottom-width:0}.popover.top .arrow:after {bottom:1px;margin-left:-10px;border-top-color:#fff;border-bottom-width:0}.popover.right .arrow {top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,0.25);border-left-width:0}.popover.right .arrow:after {bottom:-10px;left:1px;border-right-color:#fff;border-left-width:0}.popover.bottom .arrow {top:-11px;left:50%;margin-left:-11px;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,0.25);border-top-width:0}.popover.bottom .arrow:after {top:1px;margin-left:-10px;border-bottom-color:#fff;border-top-width:0}.popover.left .arrow {top:50%;right:-11px;margin-top:-11px;border-left-color:#999;border-left-color:rgba(0,0,0,0.25);border-right-width:0}.popover.left .arrow:after {right:1px;bottom:-10px;border-left-color:#fff;border-right-width:0}.thumbnails {margin-left:-20px;list-style:none;*zoom:1}.thumbnails:before, .thumbnails:after {display:table;line-height:0;content:""}.thumbnails:after {clear:both}.row-fluid .thumbnails {margin-left:0}.thumbnails>li {float:left;margin-bottom:20px;margin-left:20px}.thumbnail {display:block;padding:4px;line-height:20px;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.055);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.055);box-shadow:0 1px 3px rgba(0,0,0,0.055);-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}a.thumbnail:hover, a.thumbnail:focus {border-color:#08c;-webkit-box-shadow:0 1px 4px rgba(0,105,214,0.25);-moz-box-shadow:0 1px 4px rgba(0,105,214,0.25);box-shadow:0 1px 4px rgba(0,105,214,0.25)}.thumbnail>img {display:block;max-width:100%;margin-right:auto;margin-left:auto}.thumbnail .caption {padding:9px;color:#555}.media, .media-body {overflow:hidden;*overflow:visible;zoom:1}.media, .media .media {margin-top:15px}.media:first-child {margin-top:0}.media-object {display:block}.media-heading {margin:0 0 5px}.media>.pull-left {margin-right:10px}.media>.pull-right {margin-left:10px}.media-list {margin-left:0;list-style:none}.label, .badge {display:inline-block;padding:2px 4px;font-size:11.844px;font-weight:bold;line-height:14px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);white-space:nowrap;vertical-align:baseline;background-color:#999}.label {-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.badge {padding-right:9px;padding-left:9px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px}.label:empty, .badge:empty {display:none}a.label:hover, a.label:focus, a.badge:hover, a.badge:focus {color:#fff;text-decoration:none;cursor:pointer}.label-important, .badge-important {background-color:#b94a48}.label-important[href], .badge-important[href] {background-color:#953b39}.label-warning, .badge-warning {background-color:#f89406}.label-warning[href], .badge-warning[href] {background-color:#c67605}.label-success, .badge-success {background-color:#468847}.label-success[href], .badge-success[href] {background-color:#356635}.label-info, .badge-info {background-color:#3a87ad}.label-info[href], .badge-info[href] {background-color:#2d6987}.label-inverse, .badge-inverse {background-color:#333}.label-inverse[href], .badge-inverse[href] {background-color:#1a1a1a}.btn .label, .btn .badge {position:relative;top:-1px}.btn-mini .label, .btn-mini .badge {top:0}@-webkit-keyframes progress-bar-stripes {from {background-position:40px 0}to {background-position:0 0}}@-moz-keyframes progress-bar-stripes {from {background-position:40px 0}to {background-position:0 0}}@-ms-keyframes progress-bar-stripes {from {background-position:40px 0}to {background-position:0 0}}@-o-keyframes progress-bar-stripes {from {background-position:0 0}to {background-position:40px 0}}@keyframes progress-bar-stripes {from {background-position:40px 0}to {background-position:0 0}}.progress {height:20px;margin-bottom:20px;overflow:hidden;background-color:#f7f7f7;background-image:-moz-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9));background-image:-webkit-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:-o-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:linear-gradient(to bottom, #f5f5f5, #f9f9f9);background-repeat:repeat-x;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#fff9f9f9', GradientType=0);-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress .bar {float:left;width:0;height:100%;font-size:12px;color:#fff;text-align:center;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e90d2;background-image:-moz-linear-gradient(top, #149bdf, #0480be);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be));background-image:-webkit-linear-gradient(top, #149bdf, #0480be);background-image:-o-linear-gradient(top, #149bdf, #0480be);background-image:linear-gradient(to bottom, #149bdf, #0480be);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf', endColorstr='#ff0480be', GradientType=0);-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width .6s ease;-moz-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress .bar+.bar {-webkit-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15), inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15), inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 1px 0 0 rgba(0,0,0,0.15), inset 0 -1px 0 rgba(0,0,0,0.15)}.progress-striped .bar {background-color:#149bdf;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255,255,255,0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255,255,255,0.15)), color-stop(0.75, rgba(255,255,255,0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);-webkit-background-size:40px 40px;-moz-background-size:40px 40px;-o-background-size:40px 40px;background-size:40px 40px}.progress.active .bar {-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-danger .bar, .progress .bar-danger {background-color:#dd514c;background-image:-moz-linear-gradient(top, #ee5f5b, #c43c35);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35));background-image:-webkit-linear-gradient(top, #ee5f5b, #c43c35);background-image:-o-linear-gradient(top, #ee5f5b, #c43c35);background-image:linear-gradient(to bottom, #ee5f5b, #c43c35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffc43c35', GradientType=0)}.progress-danger.progress-striped .bar, .progress-striped .bar-danger {background-color:#ee5f5b;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255,255,255,0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255,255,255,0.15)), color-stop(0.75, rgba(255,255,255,0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-success .bar, .progress .bar-success {background-color:#5eb95e;background-image:-moz-linear-gradient(top, #62c462, #57a957);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957));background-image:-webkit-linear-gradient(top, #62c462, #57a957);background-image:-o-linear-gradient(top, #62c462, #57a957);background-image:linear-gradient(to bottom, #62c462, #57a957);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff57a957', GradientType=0)}.progress-success.progress-striped .bar, .progress-striped .bar-success {background-color:#62c462;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255,255,255,0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255,255,255,0.15)), color-stop(0.75, rgba(255,255,255,0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-info .bar, .progress .bar-info {background-color:#4bb1cf;background-image:-moz-linear-gradient(top, #5bc0de, #339bb9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9));background-image:-webkit-linear-gradient(top, #5bc0de, #339bb9);background-image:-o-linear-gradient(top, #5bc0de, #339bb9);background-image:linear-gradient(to bottom, #5bc0de, #339bb9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff339bb9', GradientType=0)}.progress-info.progress-striped .bar, .progress-striped .bar-info {background-color:#5bc0de;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255,255,255,0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255,255,255,0.15)), color-stop(0.75, rgba(255,255,255,0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-warning .bar, .progress .bar-warning {background-color:#faa732;background-image:-moz-linear-gradient(top, #fbb450, #f89406);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));background-image:-webkit-linear-gradient(top, #fbb450, #f89406);background-image:-o-linear-gradient(top, #fbb450, #f89406);background-image:linear-gradient(to bottom, #fbb450, #f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0)}.progress-warning.progress-striped .bar, .progress-striped .bar-warning {background-color:#fbb450;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255,255,255,0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255,255,255,0.15)), color-stop(0.75, rgba(255,255,255,0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.accordion {margin-bottom:20px}.accordion-group {margin-bottom:2px;border:1px solid #e5e5e5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.accordion-heading {border-bottom:0}.accordion-heading .accordion-toggle {display:block;padding:8px 15px}.accordion-toggle {cursor:pointer}.accordion-inner {padding:9px 15px;border-top:1px solid #e5e5e5}.carousel {position:relative;margin-bottom:20px;line-height:1}.carousel-inner {position:relative;width:100%;overflow:hidden}.carousel-inner>.item {position:relative;display:none;-webkit-transition:.6s ease-in-out left;-moz-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img, .carousel-inner>.item>a>img {display:block;line-height:1}.carousel-inner>.active, .carousel-inner>.next, .carousel-inner>.prev {display:block}.carousel-inner>.active {left:0}.carousel-inner>.next, .carousel-inner>.prev {position:absolute;top:0;width:100%}.carousel-inner>.next {left:100%}.carousel-inner>.prev {left:-100%}.carousel-inner>.next.left, .carousel-inner>.prev.right {left:0}.carousel-inner>.active.left {left:-100%}.carousel-inner>.active.right {left:100%}.carousel-control {position:absolute;top:40%;left:15px;width:40px;height:40px;margin-top:-20px;font-size:60px;font-weight:100;line-height:30px;color:#fff;text-align:center;background:#222;border:3px solid #fff;-webkit-border-radius:23px;-moz-border-radius:23px;border-radius:23px;opacity:.5;filter:alpha(opacity=50)}.carousel-control.right {right:15px;left:auto}.carousel-control:hover, .carousel-control:focus {color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-indicators {position:absolute;top:15px;right:15px;z-index:5;margin:0;list-style:none}.carousel-indicators li {display:block;float:left;width:10px;height:10px;margin-left:5px;text-indent:-999px;background-color:#ccc;background-color:rgba(255,255,255,0.25);border-radius:5px}.carousel-indicators .active {background-color:#fff}.carousel-caption {position:absolute;right:0;bottom:0;left:0;padding:15px;background:#333;background:rgba(0,0,0,0.75)}.carousel-caption h4, .carousel-caption p {line-height:20px;color:#fff}.carousel-caption h4 {margin:0 0 5px}.carousel-caption p {margin-bottom:0}.hero-unit {padding:60px;margin-bottom:30px;font-size:18px;font-weight:200;line-height:30px;color:inherit;background-color:#eee;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.hero-unit h1 {margin-bottom:0;font-size:60px;line-height:1;letter-spacing:-1px;color:inherit}.hero-unit li {line-height:30px}.pull-right {float:right}.pull-left {float:left}.hide {display:none}.show {display:block}.invisible {visibility:hidden}.affix {position:fixed} \ No newline at end of file diff --git a/src/main/webapp/resources/css/colorpicker.css b/src/main/webapp/resources/css/colorpicker.css new file mode 100644 index 0000000000000000000000000000000000000000..da77e450712c3150d162dca3dbd07dfce15af120 --- /dev/null +++ b/src/main/webapp/resources/css/colorpicker.css @@ -0,0 +1,115 @@ +/* + Colorpicker for Bootstrap + Copyright 2012 Stefan Petre + Licensed under the Apache License v2.0 + http://www.apache.org/licenses/LICENSE-2.0 +*/ + .colorpicker-saturation { + width: 100px; + height: 100px; + background-image: url('../img/saturation.png'); + cursor: crosshair; + float: left; +} +.colorpicker-saturation i { + display: block; + height: 5px; + width: 5px; + border: 1px solid #000; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + position: absolute; + top: 0; + left: 0; + margin: -4px 0 0 -4px; +} +.colorpicker-saturation i b { + display: block; + height: 5px; + width: 5px; + border: 1px solid #fff; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; +} +.colorpicker-hue, .colorpicker-alpha { + width: 15px; + height: 100px; + float: left; + cursor: row-resize; + margin-left: 4px; + margin-bottom: 4px; +} +.colorpicker-hue i, .colorpicker-alpha i { + display: block; + height: 1px; + background: #000; + border-top: 1px solid #fff; + position: absolute; + top: 0; + left: 0; + width: 100%; + margin-top: -1px; +} +.colorpicker-hue { + background-image: url('../img/hue.png'); +} +.colorpicker-alpha { + background-image: url('../img/alpha.html'); + display: none; +} +.colorpicker { +*zoom: 1; + top: 0; + left: 0; + padding: 4px; + min-width: 120px; + margin-top: 1px; +} +.colorpicker:before, .colorpicker:after { + display: table; + content: ""; +} +.colorpicker:after { + clear: both; +} +.colorpicker:before { + content: ''; + display: inline-block; + position: absolute; + top: -7px; + left: 6px; +} +.colorpicker:after { + content: ''; + display: inline-block; + position: absolute; + top: -6px; + left: 7px; +} +.colorpicker div { + position: relative; +} +.colorpicker.alpha { + min-width: 140px; +} +.colorpicker.alpha .colorpicker-alpha { + display: block; +} +.colorpicker-color { + height: 10px; + margin-top: 5px; + clear: both; + background-image: url('../img/alpha.html'); + background-position: 0 100%; +} +.colorpicker-color div { + height: 10px; +} +.input-append.color .add-on i, .input-prepend.color .add-on i { + display: block; + cursor: pointer; + width: 16px; + height: 16px; +} diff --git a/src/main/webapp/resources/css/datepicker.css b/src/main/webapp/resources/css/datepicker.css new file mode 100644 index 0000000000000000000000000000000000000000..43ee2f9cd871d98d016878582402841af9b8b0a4 --- /dev/null +++ b/src/main/webapp/resources/css/datepicker.css @@ -0,0 +1,116 @@ +/* + Datepicker for Bootstrap + Copyright 2012 Stefan Petre + Licensed under the Apache License v2.0 + http://www.apache.org/licenses/LICENSE-2.0 +*/ + .datepicker { + top: 0; + left: 0; + padding: 4px; + margin-top: 1px; /*.dow { border-top: 1px solid #ddd !important; }*/ +} +.datepicker:before { + content: ''; + display: inline-block; + position: absolute; + top: -7px; + left: 6px; +} +.datepicker:after { + content: ''; + display: inline-block; + +} +.datepicker > div { + display: none; +} +.datepicker table { + width: 100%; + margin: 0; +} +.datepicker td, .datepicker th { + text-align: center; + width: 20px; + height: 20px; + +} +.datepicker td.day:hover { + background: #eeeeee; + cursor: pointer; +} +.datepicker td.old, .datepicker td.new { + color: #999999; +} +.datepicker td.active, .datepicker td.active:hover { + background: #49cced; + border-color: #0044cc #0044cc #002a80; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); +filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + color: #fff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); +} +.datepicker td.active:hover, .datepicker td.active:hover:hover, .datepicker td.active:active, .datepicker td.active:hover:active, .datepicker td.active.active, .datepicker td.active:hover.active, .datepicker td.active.disabled, .datepicker td.active:hover.disabled, .datepicker td.active[disabled], .datepicker td.active:hover[disabled] { + background-color: #49cced; +} +.datepicker td.active:active, .datepicker td.active:hover:active, .datepicker td.active.active, .datepicker td.active:hover.active { + background-color: #003399 \9; +} +.datepicker td span { + display: block; + width: 47px; + height: 54px; + line-height: 54px; + float: left; + margin: 2px; + cursor: pointer; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.datepicker td span:hover { + background: #eeeeee; +} +.datepicker td span.active { + background-color: #006dcc; + background-image: -moz-linear-gradient(top, #0088cc, #0044cc); + background-image: -ms-linear-gradient(top, #0088cc, #0044cc); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); + background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); + background-image: -o-linear-gradient(top, #0088cc, #0044cc); + background-image: linear-gradient(top, #0088cc, #0044cc); + background-repeat: repeat-x; +filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0); + border-color: #0044cc #0044cc #002a80; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); +filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + color: #fff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); +} +.datepicker td span.active:hover, .datepicker td span.active:active, .datepicker td span.active.active, .datepicker td span.active.disabled, .datepicker td span.active[disabled] { + background-color: #0044cc; +} +.datepicker td span.active:active, .datepicker td span.active.active { + background-color: #003399 \9; +} +.datepicker td span.old { + color: #999999; +} +.datepicker th.switch { + width: 145px; +} +.datepicker th.next, .datepicker th.prev { + font-size: 19.5px; +} +.datepicker thead tr:first-child th { + cursor: pointer; +} +.datepicker thead tr:first-child th:hover { + background: #eeeeee; +} +.input-append.date .add-on i, .input-prepend.date .add-on i { + display: block; + cursor: pointer; + width: 16px; + height: 16px; +} diff --git a/src/main/webapp/resources/css/et.css b/src/main/webapp/resources/css/et.css new file mode 100644 index 0000000000000000000000000000000000000000..16ec535f8b61be763f6ccdc1fa573974067f9378 --- /dev/null +++ b/src/main/webapp/resources/css/et.css @@ -0,0 +1 @@ +@font-face{font-family:fontello;src:url(../font/fontello.eot);src:url(../font/fontello.eot#iefix) format("embedded-opentype"),url(../font/fontello.woff2) format("woff2"),url(../font/fontello.woff) format("woff"),url(../font/fontello.ttf) format("truetype"),url(../font/fontello.svg#fontello) format("svg");font-weight:400;font-style:normal}[class*=" v-icon-"]:before,[class^=v-icon-]:before{font-family:fontello;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.v-icon-down-dir:before{content:"\E800"}.v-icon-up-dir:before{content:"\E801"}.v-icon-cancel:before{content:"\E802"}.v-icon-spin3:before{content:"\E832"}.v-icon-spin4:before{content:"\E834"}.v-icon-spin5:before{content:"\E838"}.v-icon-filter:before{content:"\F0B0"}.v-icon-angle-double-left:before{content:"\F100"}.v-icon-angle-double-right:before{content:"\F101"}.v-icon-angle-left:before{content:"\F104"}.v-icon-angle-right:before{content:"\F105"}.animate-loading-05{-moz-animation:spin .5s infinite linear;-o-animation:spin .5s infinite linear;-webkit-animation:spin .5s infinite linear;animation:spin .5s infinite linear;display:inline-block}.animate-loading-08{-moz-animation:spin .8s infinite linear;-o-animation:spin .8s infinite linear;-webkit-animation:spin .8s infinite linear;animation:spin .8s infinite linear;display:inline-block}.animate-loading-11{-moz-animation:spin 1.1s infinite linear;-o-animation:spin 1.1s infinite linear;-webkit-animation:spin 1.1s infinite linear;animation:spin 1.1s infinite linear;display:inline-block}.animate-loading-14{-moz-animation:spin 1.4s infinite linear;-o-animation:spin 1.4s infinite linear;-webkit-animation:spin 1.4s infinite linear;animation:spin 1.4s infinite linear;display:inline-block}.animate-loading-17{-moz-animation:spin 1.7s infinite linear;-o-animation:spin 1.7s infinite linear;-webkit-animation:spin 1.7s infinite linear;animation:spin 1.7s infinite linear;display:inline-block}.animate-loading-20{-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear;display:inline-block}.animate-loading-23{-moz-animation:spin 2.3s infinite linear;-o-animation:spin 2.3s infinite linear;-webkit-animation:spin 2.3s infinite linear;animation:spin 2.3s infinite linear;display:inline-block}.animate-loading-26{-moz-animation:spin 2.6s infinite linear;-o-animation:spin 2.6s infinite linear;-webkit-animation:spin 2.6s infinite linear;animation:spin 2.6s infinite linear;display:inline-block}.animate-loading-29{-moz-animation:spin 2.9s infinite linear;-o-animation:spin 2.9s infinite linear;-webkit-animation:spin 2.9s infinite linear;animation:spin 2.9s infinite linear;display:inline-block}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg);-o-transform:rotate(0deg);-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-moz-transform:rotate(359deg);-o-transform:rotate(359deg);-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-moz-transform:rotate(0deg);-o-transform:rotate(0deg);-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-moz-transform:rotate(359deg);-o-transform:rotate(359deg);-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@-o-keyframes spin{0%{-moz-transform:rotate(0deg);-o-transform:rotate(0deg);-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-moz-transform:rotate(359deg);-o-transform:rotate(359deg);-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@-ms-keyframes spin{0%{-moz-transform:rotate(0deg);-o-transform:rotate(0deg);-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-moz-transform:rotate(359deg);-o-transform:rotate(359deg);-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spin{0%{-moz-transform:rotate(0deg);-o-transform:rotate(0deg);-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-moz-transform:rotate(359deg);-o-transform:rotate(359deg);-webkit-transform:rotate(359deg);transform:rotate(359deg)}}*,:after,:before{box-sizing:border-box}.v-page--large .v-page-goto,.v-page--large .v-page-goto .v-page-goto-input,.v-page--large .v-page-li,.v-page--large .v-page-select,.v-page--large .v-page-total{font-size:16px;height:40px;line-height:40px}.v-page--large .v-page-li{min-width:40px}.v-page--large .v-page-li i{font-size:120%}.v-page--large .v-page-goto .v-page-goto-input{width:50px}.v-page--middle .v-page-goto,.v-page--middle .v-page-goto .v-page-goto-input,.v-page--middle .v-page-li,.v-page--middle .v-page-select,.v-page--middle .v-page-total{font-size:14px;height:32px;line-height:32px}.v-page--middle .v-page-li{min-width:32px}.v-page--middle .v-page-li i{font-size:120%}.v-page--middle .v-page-goto .v-page-goto-input{width:50px}.v-page--small .v-page-goto,.v-page--small .v-page-goto .v-page-goto-input,.v-page--small .v-page-li,.v-page--small .v-page-select,.v-page--small .v-page-total{font-size:12px;height:24px;line-height:24px}.v-page--small .v-page-li{min-width:24px}.v-page--small .v-page-li i{font-size:120%}.v-page--small .v-page-goto .v-page-goto-input{width:45px}.v-page-ul{margin:0;padding:0;display:inline-block;margin:0 4px;list-style-type:none;-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;-ms-user-select:none}.v-page-total{float:left;display:inline-block;margin:0 4px}.v-page-select{float:left}.v-page-li{float:left;margin-right:4px;cursor:pointer;transition:all .1s ease-in-out;text-align:center;list-style:none;background-color:#fff;border:1px solid #c8cdd4;border-radius:4px}.v-page-li a{color:#333}.v-page-li:hover{border-color:#0092dd}.v-page-li:hover a{color:#0092dd}.v-page-li-active{border-color:#0092dd;background-color:#0092dd}.v-page-li-active a{color:#fff}.v-page-li-active:hover{border-color:#0092dd;background-color:#0092dd}.v-page-li-active:hover a{color:#fff}.v-page-next i,.v-page-prev i{color:#666}.v-page-jump-next:after,.v-page-jump-prev:after{content:"\2022\2022\2022";display:block;letter-spacing:1px;color:#666;text-align:center}.v-page-jump-next:hover:after,.v-page-jump-next i,.v-page-jump-prev:hover:after,.v-page-jump-prev i{display:none}.v-page-jump-next:hover i,.v-page-jump-prev:hover i{display:inline;color:#0092dd}.v-page-select{display:inline-block;margin:0 4px}.v-page-pager{float:left}.v-page-goto{float:left;display:inline-block;margin:0 4px}.v-page-goto-input{padding:1px 7px;display:inline-block;border:1px solid #c8cdd4;background-color:#fff;background-image:none;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out;border-radius:4px}.v-page-goto-input:hover{border-color:#0092dd}.v-page-disabled{cursor:not-allowed;border-color:#d7dde4}.v-page-disabled i{color:#ccc}.v-page-disabled:hover{border-color:#d7dde4}.v-page-disabled:hover i{color:#ccc;cursor:not-allowed}.v-select--large .v-select-items-li,.v-select--large .v-select-selected{font-size:16px;height:40px;line-height:40px}.v-select--large .v-select-selected-i{line-height:40px!important}.v-select--middle .v-select-items-li,.v-select--middle .v-select-selected{font-size:14px;height:32px;line-height:32px}.v-select--middle .v-select-selected-i{line-height:32px!important}.v-select--small .v-select-items-li,.v-select--small .v-select-selected{font-size:13px;height:24px;line-height:24px}.v-select--small .v-select-selected-i{line-height:24px!important}.v-select-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;background-image:none;border:1px solid #fff;box-sizing:border-box;color:#1f2d3d;display:inline-block;font-size:inherit;line-height:1;outline:none;padding-left:2px;transition:border-color .2s cubic-bezier(.645,.045,.355,1);width:80%;text-align:left}.v-select-selected-span{width:80%;display:block!important;text-align:center;cursor:pointer;white-space:nowrap;overflow:hidden;padding-left:2px}.v-select-selected-i{display:inline-block;position:absolute;top:0;right:0;font-size:120%}.v-table-views,.v-table-views *,.v-table-views :after,.v-table-views :before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.v-table-views{position:relative;overflow:hidden;border:1px solid #ddd;padding:0;background-color:#fff}.v-table-footer{border-top:1px solid #ddd}.v-table-leftview,.v-table-rightview{position:absolute;overflow:hidden;top:0}.v-table-leftview{left:0}.v-table-header{overflow:hidden;background-position:0 0;background-size:initial;background-attachment:scroll;background-origin:initial;background-clip:initial;background-color:initial;background-repeat-x:repeat;background-repeat-y:no-repeat}.v-table-footer-inner,.v-table-header,.v-table-pager,.v-table-toolbar{border-color:#ddd}.v-table-header-inner{float:left;width:10000px}.v-table-btable,.v-table-ftable,.v-table-htable{border-collapse:separate}.v-table-body td,.v-table-footer td,.v-table-header td{margin:0;padding:0}.v-table-body-cell{padding:0 3px;margin:0;white-space:nowrap;word-wrap:normal;overflow:hidden;border:0 solid #ddd;text-overflow:ellipsis}.v-table-body{margin:0;padding:0;zoom:1}.v-table-rightview .v-table-body,.v-table-rightview .v-table-footer{overflow-x:auto;overflow-y:auto}.v-table-leftview .v-table-body{overflow-x:hidden!important;overflow-y:hidden!important}.v-table-body-inner-pb{padding-bottom:20px}.v-table-rightview{right:0}.v-table-title-cell{margin:0;border:0 solid #ddd}.v-table-title-cell:before{content:"";display:inline-block;height:100%;vertical-align:middle}.table-title{padding:0 3px;word-break:break-all;line-height:1.2em}.table-title,.v-table-sort-icon{display:inline-block;vertical-align:middle;overflow:hidden}.v-table-sort-icon{position:relative;width:16px;height:19px;margin-left:-5px;cursor:pointer}.v-table-sort-icon i{position:absolute;display:block;width:16px;height:15px;overflow:hidden;color:#a6a6a6;transition:color .2s ease-in-out}.v-table-sort-icon i:first-child{top:-5px}.v-table-sort-icon i:last-child{bottom:1px}.v-table-header .cursorPointer{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;-ms-user-select:none}.vertical-border{border-right-width:1px!important}.horizontal-border{border-bottom-width:1px!important}.v-table-rightview-special-border td:last-child .v-table-body-cell{border-right-width:0!important}.v-table-dropdown{margin-left:-3px!important}.v-table-filter-icon{font-size:14px;cursor:pointer}.v-table-empty-content,.v-table-empty-scroll{position:absolute;overflow-y:hidden;text-align:center}.v-table-empty-content{overflow-x:auto}.v-table-empty-inner{overflow:hidden}.v-table-loading{position:relative;display:block;z-index:99999;background-color:#fff;height:100%;width:100%}.v-table-loading-content{z-index:9999999;position:absolute;left:50%}.v-table-drag-line{position:absolute;left:0;top:0;bottom:0;width:0;border-left:2px dashed #ddd;z-index:10}.v-checkbox-wrapper{font-size:12px}.v-checkbox,.v-checkbox-wrapper{cursor:pointer;display:inline-block;position:relative}.v-checkbox{white-space:nowrap;outline:none;line-height:1;vertical-align:text-bottom}.v-checkbox-checked:after{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:2px;border:1px solid #108ee9;content:"";-webkit-animation-fill-mode:both;animation-fill-mode:both;visibility:hidden}.v-checkbox-input{position:absolute;left:0;z-index:1;cursor:pointer;opacity:0;filter:alpha(opacity=0);top:0;bottom:0;right:0}.v-checkbox-inner{position:relative;top:0;left:0;display:block;width:14px;height:14px;border:1px solid #abbacc;border-radius:2px;background-color:#fff;-webkit-transition:all .3s;transition:all .3s}.v-checkbox-inner:after{-webkit-transform:rotate(45deg) scale(0);-ms-transform:rotate(45deg) scale(0);transform:rotate(45deg) scale(0);left:4px;top:1px;width:5px;height:8px;-webkit-transition:all .1s cubic-bezier(.71,-.46,.88,.6);transition:all .1s cubic-bezier(.71,-.46,.88,.6)}.v-checkbox-checked .v-checkbox-inner:after,.v-checkbox-inner:after{position:absolute;display:table;border:2px solid #fff;border-top:0;border-left:0;content:" "}.v-checkbox-checked .v-checkbox-inner:after{-webkit-transform:rotate(45deg) scale(1);-ms-transform:rotate(45deg) scale(1);transform:rotate(45deg) scale(1);-webkit-transition:all .2s cubic-bezier(.12,.4,.29,1.46) .1s;transition:all .2s cubic-bezier(.12,.4,.29,1.46) .1s}.v-checkbox-checked .v-checkbox-inner,.v-checkbox-indeterminate .v-checkbox-inner{background-color:#108ee9;border-color:#108ee9}.v-checkbox-input:focus+.v-checkbox-inner,.v-checkbox-wrapper:hover .v-checkbox-inner,.v-checkbox:hover .v-checkbox-inner{border-color:#108ee9}.v-checkbox-disabled{cursor:not-allowed}.v-checkbox-disabled.v-checkbox-checked .v-checkbox-inner:after{-webkit-animation-name:none;animation-name:none;border-color:rgba(0,0,0,.25)}.v-checkbox-disabled .v-checkbox-input{cursor:not-allowed}.v-checkbox-disabled .v-checkbox-inner{border-color:#d9d9d9!important;background-color:#f7f7f7}.v-checkbox-disabled .v-checkbox-inner:after{-webkit-animation-name:none;animation-name:none;border-color:#f7f7f7}.v-checkbox-disabled+span{color:rgba(0,0,0,.25);cursor:not-allowed}.v-checkbox-indeterminate .v-checkbox-inner:after{content:" ";-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);position:absolute;left:2px;top:5px;width:8px;height:1px}.v-checkbox-indeterminate.v-checkbox-disabled .v-checkbox-inner:after{border-color:rgba(0,0,0,.25)}.v-select-items-multiple{display:table;width:100%;padding:5px}.v-select-items-multiple span{vertical-align:middle;font-size:14px;font-weight:400;color:rgba(0,0,0,.65)}.v-select-items-multiple:hover{background-color:#e6f7ff}.v-dropdown--large .v-dropdown-items-li,.v-dropdown--large .v-dropdown-selected{font-size:16px;height:40px;line-height:40px}.v-dropdown--large .v-dropdown-selected-i{line-height:40px!important}.v-dropdown--middle .v-dropdown-items-li,.v-dropdown--middle .v-dropdown-selected{font-size:14px;height:32px;line-height:32px}.v-dropdown--middle .v-dropdown-selected-i{line-height:32px!important}.v-dropdown--small .v-dropdown-items-li,.v-dropdown--small .v-dropdown-selected{font-size:13px;height:24px;line-height:24px}.v-dropdown--small .v-dropdown-selected-i{line-height:24px!important}.v-dropdown{display:inline-table;margin:0}.v-dropdown-dd,.v-dropdown-dt{z-index:9999}.v-dropdown-dd,.v-dropdown-dt,.v-dropdown-items{margin:0;padding:0;background-color:#fff}.v-dropdown-items{overflow:hidden;text-overflow:ellipsis;word-wrap:normal;white-space:nowrap}.v-dropdown a,.v-dropdown a:visited{color:#000;text-decoration:none;outline:none}.v-dropdown-selected{position:relative;display:block;border:1px solid #c8cdd4;border-radius:2px}.v-dropdown-selected:hover{color:#0092dd;border-color:#0092dd}.v-dropdown-selected-span{width:80%;display:block!important;text-align:center;cursor:pointer;white-space:nowrap;overflow:hidden;padding-left:2px}.v-dropdown-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;background-image:none;border:1px solid #fff;box-sizing:border-box;color:#1f2d3d;display:inline-block;font-size:inherit;line-height:1;outline:none;padding-left:2px;transition:border-color .2s cubic-bezier(.645,.045,.355,1);width:80%;text-align:left}.v-dropdown-selected-i{display:inline-block;position:absolute;top:0;right:0;font-size:120%}.v-dropdown-dd{position:absolute!important;z-index:9999999}.v-dropdown-items{position:fixed;top:2px;left:0;list-style:none;border-radius:2px;background-color:#fff;box-shadow:0 2px 4px rgba(0,0,0,.12),0 0 6px rgba(0,0,0,.04);border:1px solid #d1dbe5;color:#c5c0b0;padding:5px 0;width:auto}.v-dropdown-items-li{white-space:nowrap}.v-dropdown-items-li.active{background-color:#0092dd}.v-dropdown-items-li.active a{color:#fff}.v-dropdown-items-li-a{width:100%;display:block;padding-left:8px;padding-right:8px}.v-dropdown-items-li-a-left{text-align:left}.v-dropdown-items-li-a-center{text-align:center}.v-dropdown-items-li-a-right{text-align:right}.v-dropdown-items-li:hover{background-color:#e4e8f1;color:#fff}.v-dropdown-items-li.active:hover{background-color:#0092dd}.v-dropdown-items-multiple{display:table;width:100%;padding:5px}.v-dropdown-items-multiple span{vertical-align:middle;font-size:14px;font-weight:400;color:rgba(0,0,0,.65)}.v-dropdown-items-multiple:hover{background-color:#e6f7ff}.v-dropdown-operation{padding:8px 0 3px;font-size:14px;border-top:1px solid #e8e8e8}.v-dropdown-operation-item{padding:0 8px;color:#495060}.v-dropdown-operation-item:last-child{float:right}.v-dropdown-operation-item:hover{color:#1890ff}.v-table-sort-icon .checked{color:#48576a}.v-table-filter-icon{color:#999}.v-table-filter-icon.checked{color:#48576a} \ No newline at end of file diff --git a/src/main/webapp/resources/css/fullcalendar.css b/src/main/webapp/resources/css/fullcalendar.css new file mode 100644 index 0000000000000000000000000000000000000000..6d0c52c892781eff94ea0daf6b97d53b6eafc19e --- /dev/null +++ b/src/main/webapp/resources/css/fullcalendar.css @@ -0,0 +1,404 @@ + +.fc { + direction: ltr; + text-align: left; border:1px solid #dadada; +} +.fc table { + border-collapse: collapse; + border-spacing: 0; +} +html .fc, .fc table { + font-size: 1em; +} +.fc td, .fc th { + padding: 0; + vertical-align: top; +} +.fc-header { + position: relative; +} +.fc-header td { + position: relative; + white-space: nowrap; +} +.fc-header-left { + text-align: left; +} +.fc-header-center { + left: 10%; + position: absolute; + text-align: center; + top: 0; + width: 80%; +} +.fc-button-inner { + border-left: 1px solid #D5D5D5; +} +.panel-left .fc-header-right .fc-button:last-child .fc-button-inner { + border-right: 1px solid #D5D5D5; +} +.fc-header-left .fc-button-inner { + border: medium none; +} +.fc-header-right { + position: absolute !important; + right: 0; + text-align: right; + top: -37px; +} +.panel-left .fc-header-right { + right: -1px; +} +.fc-header-title { + display: inline-block; + vertical-align: top; +} +.fc-header-title strong { + display: block; + margin-top: 0; + padding: 8px 12px !important; + white-space: nowrap; +} +.fc .fc-header-space { + padding-left: 10px; +} +.fc-header .fc-corner-right { + float: right; + margin-right: 1px; +} +.fc-header .ui-corner-right { + margin-right: 0; +} +.fc-header .fc-state-hover, .fc-header .ui-state-hover { + z-index: 2; +} +.fc-header .fc-state-down { + z-index: 3; +} +.fc-header .fc-state-active, .fc-header .ui-state-active { + z-index: 4; +} +.fc-button-prev .fc-button-content { + background: url("../img/larrow.png") no-repeat scroll 15px 13px transparent; + width: 10px; +} +.fc-button-next .fc-button-content { + background: url("../img/rarrow.png") no-repeat scroll 15px 13px transparent; + width: 10px; +} +.fc-content { +} +.fc-view { + overflow: hidden; + width: 100%; +} +.fc-widget-header, .fc-widget-content { + border: 1px solid #D5D5D5; +} +.fc-state-highlight { + background: url("../images/backgrounds/calActiveBg.html") repeat-x scroll 0 0 #F5F5F5; +} +.fc-cell-overlay { + background: none repeat scroll 0 0 #99CCFF; + opacity: 0.2; +} +.fc-button { + cursor: pointer; + display: inline-block; + position: relative; +} +.fc-state-default { +} +.fc-button-inner { + float: left; + overflow: hidden; + position: relative; +} +.fc-state-default .fc-button-inner { +} +.fc-button-content { + float: left; + height: 36px; + line-height: 37px; + padding: 0 14px; + position: relative; + white-space: nowrap; +} +.fc-header-right .fc-button-content { + height: 37px; +} +.fc-button-content .fc-icon-wrap { + float: left; + position: relative; + top: 50%; +} +.fc-button-content .ui-icon { + float: left; + margin-top: -50%; + position: relative; +} +.fc-state-default .fc-button-effect { + left: 0; + position: absolute; + top: 50%; +} +.fc-state-default .fc-button-effect span { +} +.fc-state-default, .fc-state-default .fc-button-inner { +} +.fc-state-hover, .fc-state-hover .fc-button-inner { +} +.fc-state-down, .fc-state-down .fc-button-inner { +} +.fc-state-active, .fc-state-active .fc-button-inner { + background: none repeat scroll 0 0 #F9F9F9; + color: #797979; +} +.fc-first th { + padding-top: 1px; +} +.fc-state-disabled, .fc-state-disabled .fc-button-inner { + border-color: #DDDDDD; + color: #999999; +} +.fc-state-disabled { + cursor: default; +} +.fc-state-disabled .fc-button-effect { + display: none; +} +.fc-event { + border-style: solid; + border-width: 0; + cursor: default; + font-size: 0.85em; +} +a.fc-event, .fc-event-draggable { + cursor: pointer; +} +a.fc-event { + text-decoration: none; +} +.fc-rtl .fc-event { + text-align: right; +} +.fc-event-skin { + background-color: #fb7a2c; + border-color: #000000; + border-radius: 2px 2px 2px 2px; + color: #FFFFFF; + display: block; + font-size: 11px; + margin-top: 1px; + padding: 1px 0; +} +.fc-event-inner { + border-style: solid; + border-width: 0; + height: 100%; + overflow: hidden; + position: relative; + width: 100%; +} +.fc-event-time, .fc-event-title { + display: block; + float: left; + line-height: 16px; + padding: 0 2px 1px 5px; +} +.fc .ui-resizable-handle { + display: block; + font-size: 300%; + line-height: 50%; + overflow: hidden; + position: absolute; + z-index: 99999; +} +.fc-event-hori { + margin-bottom: 1px; +} +.fc-event-hori .ui-resizable-e { + cursor: e-resize; + height: 100% !important; + right: -3px !important; + top: 0 !important; + width: 7px !important; +} +.fc-event-hori .ui-resizable-w { + cursor: w-resize; + height: 100% !important; + left: -3px !important; + top: 0 !important; + width: 7px !important; +} +.fc-event-hori .ui-resizable-handle { +} +.fc-corner-left { + margin-left: 1px; +} +.fc-corner-left .fc-button-inner, .fc-corner-left .fc-event-inner { +} +.fc-corner-right { + margin-right: 1px; +} +.fc-corner-right .fc-button-inner, .fc-corner-right .fc-event-inner { + margin-right: -1px; +} +.fc-corner-top { + margin-top: 1px; +} +.fc-corner-top .fc-event-inner { + margin-top: -1px; +} +.fc-corner-bottom { + margin-bottom: 1px; +} +.fc-corner-bottom .fc-event-inner { + margin-bottom: -1px; +} +.fc-corner-left .fc-event-inner { +} +.fc-corner-right .fc-event-inner { +} +.fc-corner-top .fc-event-inner { + border-top-width: 1px; +} +.fc-corner-bottom .fc-event-inner { + border-bottom-width: 1px; +} +table.fc-border-separate { + border-collapse: separate; +} +.fc-border-separate th, .fc-border-separate td { + border-width: 1px 0 0 1px; +} +.fc-border-separate td:first-child, .fc-border-separate th:first-child { + border-left: medium none; +} +.fc-border-separate th.fc-last, .fc-border-separate td.fc-last { +} +.fc-border-separate tr.fc-last th, .fc-border-separate tr.fc-last td { + border-top-width: 1px; +} +.fc-border-separate tbody tr.fc-first td, .fc-border-separate tbody tr.fc-first th { + border-top-width: 1px; +} +.fc-grid th { + text-align: center; +} +.fc-grid .fc-day-number { + float: right; + padding: 3px 5px; +} +.fc-grid .fc-other-month .fc-day-number { + opacity: 0.3; +} +.fc-grid .fc-day-content { + clear: both; + padding: 5px 2px 3px; +} +.fc-grid .fc-event-time { + font-weight: bold; +} +.fc-rtl .fc-grid .fc-day-number { + float: left; +} +.fc-rtl .fc-grid .fc-event-time { + float: right; +} +.fc-agenda table { + border-collapse: separate; +} +.fc-agenda-days th { + text-align: center; +} +.fc-agenda .fc-agenda-axis { + font-weight: normal; + padding: 0 4px; + text-align: right; + vertical-align: middle; + white-space: nowrap; + width: 50px; +} +.fc-agenda .fc-day-content { + padding: 2px 2px 1px; +} +.fc-agenda-days .fc-agenda-axis { + border-right-width: 1px; +} +.fc-agenda-days .fc-col0 { + border-left-width: 0; +} +.fc-agenda-allday th { + border-width: 0 1px; +} +.fc-agenda-allday .fc-day-content { + min-height: 34px; +} +.fc-agenda-divider-inner { + height: 2px; + overflow: hidden; +} +.fc-widget-header .fc-agenda-divider-inner { + background: none repeat scroll 0 0 #EEEEEE; +} +.fc-agenda-slots th { + border-width: 1px 1px 0; +} +.fc-agenda-slots td { + background: none repeat scroll 0 0 transparent; + border-width: 1px 0 0; +} +.fc-agenda-slots td div { + height: 20px; +} +.fc-agenda-slots tr.fc-slot0 th, .fc-agenda-slots tr.fc-slot0 td { + border-top-width: 0; +} +.fc-agenda-slots tr.fc-minor th, .fc-agenda-slots tr.fc-minor td { + border-top-style: dotted; +} +.fc-agenda-slots tr.fc-minor th.ui-widget-header { +} +.fc-event-vert { + border-width: 0 1px; +} +.fc-event-vert .fc-event-head, .fc-event-vert .fc-event-content { + overflow: hidden; + position: relative; + width: 100%; + z-index: 2; +} +.fc-event-vert .fc-event-time { + font-size: 10px; + white-space: nowrap; +} +.fc-event-vert .fc-event-bg { + background: none repeat scroll 0 0 #FFFFFF; + height: 100%; + left: 0; + opacity: 0.3; + position: absolute; + top: 0; + width: 100%; + z-index: 1; +} +.fc .ui-draggable-dragging .fc-event-bg, .fc-select-helper .fc-event-bg { +} +.fc-event-vert .ui-resizable-s { + bottom: 0 !important; + cursor: s-resize; + font-family: monospace; + font-size: 11px !important; + height: 8px !important; + line-height: 8px !important; + overflow: hidden !important; + text-align: center; + width: 100% !important; +} +.fc-agenda .ui-resizable-resizing { +} + +#external-events .external-event { + margin-bottom: 5px; cursor:all-scroll; +} diff --git a/src/main/webapp/resources/css/jquery.gritter.css b/src/main/webapp/resources/css/jquery.gritter.css new file mode 100644 index 0000000000000000000000000000000000000000..fe11500453fc369ffe592692827ed4c3dde42997 --- /dev/null +++ b/src/main/webapp/resources/css/jquery.gritter.css @@ -0,0 +1,91 @@ +/* the norm */ +#gritter-notice-wrapper { + position:fixed; + top:50px; + right:10px; + width:301px; + z-index:100001; +} +#gritter-notice-wrapper.top-left { + left: 20px; + right: auto; +} +#gritter-notice-wrapper.bottom-right { + top: auto; + left: auto; + bottom: 20px; + right: 20px; +} +#gritter-notice-wrapper.bottom-left { + top: auto; + right: auto; + bottom: 20px; + left: 20px; +} +.gritter-item-wrapper { + position:relative; + margin:0 0 10px 0; +} + +.gritter-top, .gritter-bottom { + height: 0; +} + +.gritter-item { + display:block; + background: #f74d4d; /* Old browsers */ + color:#2b2b2b; box-shadow:3px 3px 20px #000; + padding:7px 10px 10px; + font-size: 11px; color:#fff; + font-family:verdana; +} +.hover .gritter-item { +} +.gritter-item p { + padding:0; + margin:0; + word-wrap:break-word; + font-size: 10px; + line-height: 14px; +} +.gritter-close { + display:none; + position:absolute; + top:-7px; + right:-9px; + background:url(../img/gritter.png) no-repeat left top; + cursor:pointer; + width:30px; + height:30px; +} +.gritter-title { + font-size:12px; + font-weight:bold; + padding:0 0 7px 0; + display:block; +} +.gritter-image { + width:32px; + height:32px; + float:left; + margin: 5px; +} +.gritter-with-image, +.gritter-without-image { + padding:0; +} +.gritter-with-image { + width:220px; + float:right; +} +/* for the light (white) version of the gritter notice */ +.gritter-light .gritter-item, +.gritter-light .gritter-bottom, +.gritter-light .gritter-top, +.gritter-light .gritter-close { + background-image: url(../img/gritter-light.png); + color: #222; +} +.gritter-light .gritter-title { + text-shadow: none; +} diff --git a/src/main/webapp/resources/css/matrix-login.css b/src/main/webapp/resources/css/matrix-login.css new file mode 100644 index 0000000000000000000000000000000000000000..049a29068fad0996ce9fc3420fcf7a30c7b7302e --- /dev/null +++ b/src/main/webapp/resources/css/matrix-login.css @@ -0,0 +1,66 @@ +html, body { width: 100%; height: 100%;} +/*Bootstrap-overlay*/ + +body { + overflow-x: hidden; + margin-top: -10px; font-family: 'Open Sans', sans-serif; font-size:12px; color:#666; +} +a{color:#666;} +a:hover, a:focus { + text-decoration: none; color:#28b779; +} +.dropdown-menu .divider{ margin:4px 0px;} +.dropdown-menu{ min-width:180px;} +.dropdown-menu > li > a{ padding:3px 10px; color:#666; font-size:12px;} +.dropdown-menu > li > a i{ padding-right:3px;} +.userphoto img{ width:19px; height:19px;} +select, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input, .label, .dropdown-menu, .btn, .well, .progress, .table-bordered, .btn-group > .btn:first-child, .btn-group > .btn:last-child, .btn-group > .btn:last-child, .btn-group > .dropdown-toggle, .alert{ border-radius:0px;} +.btn, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input{ box-shadow:none;} +.progress, .progress-success .bar, .progress .bar-success, .progress-warning .bar, .progress .bar-warning, .progress-danger .bar, .progress .bar-danger, .progress-info .bar, .progress .bar-info, .btn, .btn-primary{background-image:none;} +.accordion-heading h5{ width:70%; } +.form-horizontal .form-actions{ padding-left:20px; } +#footer{ padding:10px; text-align:center;} +.carousel{ margin-bottom:0px;} +.fl { float:left} +.fr {float:right} +.label-important, .badge-important{ background:#f74d4d;} + +/*Metro Background color class*/ +.bg_lb{ background:#27a9e3;} +.bg_db{ background:#2295c9;} +.bg_lg{ background:#28b779;} +.bg_dg{ background:#28b779;} +.bg_ly{ background:#ffb848;} +.bg_dy{ background:#da9628;} +.bg_ls{ background:#2255a4;} +.bg_lo{ background:#da542e;} +.bg_lr{ background:#f74d4d;} +.bg_lv{ background:#603bbc;} +.bg_lh{ background:#b6b3b3;} + +body { background-color:#2E363F; padding: 0; margin-top:10%;} +#logo, #loginbox { width: 32%; margin-left: auto; margin-right: auto; position: relative;} +#logo img { margin: 0 auto; display: block;} +#loginbox { overflow: hidden !important; text-align: left; position: relative; } +#loginbox form{ width:100%; position:relative; top:0; left:0; } +#loginbox .form-actions { padding: 14px 20px 15px;} +#loginbox .form-actions .pull-left { margin-top:0px;} +#loginbox form#loginform { z-index: 200; display:block;} +#loginbox form#recoverform { z-index: 100; display:none;} +#loginbox form#recoverform .form-actions { margin-top: 10px;} +#loginbox .main_input_box { margin:0 auto; text-align:center; font-size:13px;} +#loginbox .main_input_box .add-on{ padding:9px 9px; *line-height:31px; color:#fff; width:30px; display:inline-block;} +#loginbox .main_input_box input{ height:30px; border:0px; display:inline-block; width:75%; line-height:28px; margin-bottom:3px;} +/* #loginbox .controls{ padding:0 20px;} */ +#loginbox .control-group{ padding:20px 0; margin-bottom:0px;} +.form-vertical, .form-actions { margin-bottom: 0; background:none;} +#loginbox .normal_text{ padding:15px 10px; text-align:center; font-size:14px; line-height:20px; color:#fff; } +@media (max-width:800px){ +#logo { width: 60%; } +#loginbox{ width:80%} +} +@media (max-width: 480px){ +#logo { width: 40%; } +#loginbox{ width:90%} +#loginbox .control-group{ padding:8px 0; margin-bottom:0px;} +} \ No newline at end of file diff --git a/src/main/webapp/resources/css/matrix-media.css b/src/main/webapp/resources/css/matrix-media.css new file mode 100644 index 0000000000000000000000000000000000000000..a680bbb2c69365b42f2d13cf9d09db148051199f --- /dev/null +++ b/src/main/webapp/resources/css/matrix-media.css @@ -0,0 +1,76 @@ +body { + background:#2E363F; +} + +#header { + background-color: #1f262d; + margin-top:10px; +} +#search input[type=text], #search button { + background-color: #28b779; +} +#search input[type=text]:focus { + color: #777777; +} +#sidebar > ul{border-bottom: 1px solid #37414b} +#sidebar > ul > li { + border-top: 1px solid #37414b; border-bottom: 1px solid #1f262d; +} +#sidebar > ul > li.active { + background-color: #27a9e3; border-bottom: 1px solid #27a9e3; border-top: 1px solid #27a9e3; +} +#sidebar > ul > li.active a{ color:#fff; text-decoration:none;} + +#sidebar > ul > li > a > .label { + background-color:#F66; +} +#sidebar > ul > li > a:hover { + background-color: #27a9e3; color:#fff; +} +#sidebar > ul li ul { + background-color: #1e242b; +} +#sidebar > ul li ul li a{ color:#939da8} +#sidebar > ul li ul li a:hover, #sidebar > ul li ul li.active a { + color: #fff; + background-color: #28b779; +} + + +#search input[type=text] { + background-color: #47515b; color: #fff; +} +#search input[type=text]:focus { + color: #2e363f; color: #fff; box-shadow:none; +} +.dropdown-menu li a:hover, .dropdown-menu .active a, .dropdown-menu .active a:hover { + color: #eeeeee; + background:#666; + +} +.top_message{ float:right; padding:20px 12px; position:relative; top:-13px; border-left:1px solid #3D3A37; font-size:14px; line-height:20px; *line-height:20px; color:#333; text-align:center; vertical-align:middle; cursor:pointer; } +.top_message:hover{ background:#000} +.rightzero{ right:0px; display:none;} +@media (max-width: 480px) { + #sidebar > a { + background:#27a9e3; + + } + .quick-actions_homepage .quick-actions li{ min-width:100%;} +} +@media (min-width: 768px) and (max-width: 970px) {.quick-actions_homepage .quick-actions li{ min-width:20.5%;}} +@media (min-width: 481px) and (max-width: 767px) { + #sidebar > ul ul:before { + } + #sidebar > ul ul:after { + border-right: 6px solid #222222; + } + .quick-actions_homepage .quick-actions li{ min-width:47%;} +} +div.tagsinput { border:1px solid #CCC; background: #FFF; padding:5px; width:300px; height:100px; overflow-y: auto;} +div.tagsinput span.tag { border: 1px solid #a5d24a; -moz-border-radius:2px; -webkit-border-radius:2px; display: block; float: left; padding: 5px; text-decoration:none; background: #cde69c; color: #638421; margin-right: 5px; margin-bottom:5px;font-family: helvetica; font-size:13px;} +div.tagsinput span.tag a { font-weight: bold; color: #82ad2b; text-decoration:none; font-size: 11px; } +div.tagsinput input { width:80px; margin:0px; font-family: helvetica; font-size: 13px; border:1px solid transparent; padding:5px; background: transparent; color: #000; outline:0px; margin-right:5px; margin-bottom:5px; } +div.tagsinput div { display:block; float: left; } +.tags_clear { clear: both; width: 100%; height: 0px; } +.not_valid {background: #FBD8DB !important; color: #90111A !important;} diff --git a/src/main/webapp/resources/css/matrix-style.css b/src/main/webapp/resources/css/matrix-style.css new file mode 100644 index 0000000000000000000000000000000000000000..01bc69fdf72728f01bd94c7b6492a6e51c778d90 --- /dev/null +++ b/src/main/webapp/resources/css/matrix-style.css @@ -0,0 +1,1610 @@ +* { + outline:none !important; + -moz-outline: none !important; +} +td { + vertical-align: middle !important; +} +html, body{height:100%} +/* Main */ + +/*Bootstrap-overlay*/ + +body { + overflow-x: hidden; + margin-top: -10px; font-family: 'Open Sans', sans-serif; font-size:12px; color:#666; +} +a{color:#666;} +a:hover, a:focus { + text-decoration: none; color:#28b779; +} +.dropdown-menu .divider{ margin:4px 0px;} +.dropdown-menu{ min-width:180px;} +.dropdown-menu > li > a{ padding:3px 10px; color:#666; font-size:12px;} +.dropdown-menu > li > a i{ padding-right:3px;} +.userphoto img{ width:19px; height:19px;} +select, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input, .label, .dropdown-menu, .btn, .well, .progress, .table-bordered, .btn-group > .btn:first-child, .btn-group > .btn:last-child, .btn-group > .btn:last-child, .btn-group > .dropdown-toggle, .alert{ border-radius:0px;} +.btn, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input{ box-shadow:none;} +.progress, .progress-success .bar, .progress .bar-success, .progress-warning .bar, .progress .bar-warning, .progress-danger .bar, .progress .bar-danger, .progress-info .bar, .progress .bar-info, .btn, .btn-primary{background-image:none;} +.accordion-heading h5{ width:70%; } +.form-horizontal .form-actions{ padding-left:20px; } +#footer{ padding:10px; text-align:center;} +hr{ border-top-color:#dadada;} +.carousel{ margin-bottom:0px;} +.fl { float:left} +.fr {float:right} +.label-important, .badge-important{ background:#f74d4d;} +.copyrights{text-indent:-9999px;height:0;line-height:0;font-size:0;overflow:hidden;} +/*Metro Background color class*/ +.bg_lb{ background:#27a9e3;} +.bg_db{ background:#2295c9;} +.bg_lg{ background:#28b779;} +.bg_dg{ background:#28b779;} +.bg_ly{ background:#ffb848;} +.bg_dy{ background:#da9628;} +.bg_ls{ background:#2255a4;} +.bg_lo{ background:#da542e;} +.bg_lr{ background:#f74d4d;} +.bg_lv{ background:#603bbc;} +.bg_lh{ background:#b6b3b3;} + +/* Header */ +#header { + height: 77px; + position: relative; + width: 100%; + z-index: -9; +} +#header h1 { + background: url("../img/logo.png") no-repeat scroll 0 0 transparent; + /* background-size: cover; */ + height: 31px; + left: 20px; + line-height: 600px; + overflow: hidden; + position: relative; + top: 26px; + width: 191px; +} +#header h1 a { + display: block; +} +/* Search input */ +#search { + position: absolute; + z-index: 25; + top: 6px; + right:10px; +} +#search input[type=text] { + padding: 4px 10px 5px; + border: 0; + width: 100px; +} +#search button { + border: 0; + margin-left:-3px; + margin-top: -11px; + padding: 5px 10px 4px; +} +#search button i { + opacity: 0.8; color:#fff; +} +#search button:hover i, #search button:active i { + opacity: 1; +} + + +/* Top user navigation */ +#user-nav { + position: absolute; + right: 0; + top:0px; + z-index: 20; + margin: 0; +} +#user-nav > ul { + margin: 0; + padding: 0; + list-style: none; border-right: 1px solid #2e363f;border-left: 1px solid #000; +} +#user-nav > ul > li { + float: left; + list-style-type: none; + margin: 0; + position: relative; + padding: 0; border-left: 1px solid #2e363f; border-right: 1px solid #000; +} +#user-nav > ul > li > a { + padding:9px 10px; + display: block; + font-size: 11px; +} +#user-nav > ul > li > a:hover, #user-nav > ul > li.open > a { + color: #ffffff; background:#000; +} +#user-nav > ul > li > a > i, #sidebar li a i { + opacity: .5; + margin-top: 2px; +} +#user-nav > ul > li > a:hover > i, #user-nav > ul > li.open > a > i { + opacity: 1; +} +#user-nav > ul > li > a > .label { + vertical-align: middle; + padding: 1px 4px 1px; + margin: -2px 4px 0; + display: inline-block; +} +#user-nav > ul ul > li > a { + text-align: left; +} +#user-nav > ul ul > li > a:hover { +} +/* Sidebar Navigation */ +#sidebar { + display: block; + float: left; + position: relative; + width: 220px; + z-index: 16; + font-size: 15px; +} +#sidebar > ul { + list-style: none; + margin: 0px 0 0; + padding: 0; + position: absolute; + width: 220px; +} +#sidebar > ul > li { + display: block; + position: relative; +} +#sidebar > ul > li > a { + padding: 10px 0 10px 15px; + display: block; + color: #939da8; +} +#sidebar > ul > li > a > i { + margin-right: 10px; +} +#sidebar > ul > li.active > a { + background: url("../img/menu-active.png") no-repeat scroll right center transparent !important; + text-decoration:none; +} +#sidebar > ul > li > a > .label { + margin: 0 20px 0 0; + float: right; + padding: 3px 5px 2px; +} +#sidebar > ul li ul { + display: none; + margin: 0; + padding: 0; +} +#sidebar > ul li.open ul { + display: block; +} +#sidebar > ul li ul li a { + padding: 10px 0 10px 25px; + display: block; + color: #777777; +} +#sidebar > ul li ul li:first-child a { + border-top: 0; +} +#sidebar > ul li ul li:last-child a { + border-bottom: 0; +} +/* Content */ +#content { + background: none repeat scroll 0 0 #eeeeee; + margin-left: 220px; + margin-right: 0; + padding-bottom: 25px; + position: relative; + min-height:100%; + width: auto; +} +#content-header { + position: abslute; + width: 100%; + margin-top: -38px; + z-index: 20; +} +#content-header h1 { + color: #555555; + font-size: 28px; + font-weight: normal; + float: none; + text-shadow: 0 1px 0 #ffffff; + margin-left: 20px; + position: relative; +} +#content-header .btn-group { + float: right; + right: 20px; + position: absolute; +} +#content-header h1, #content-header .btn-group { + margin-top: 20px; +} +#content-header .btn-group .btn { + padding: 11px 14px 9px; +} +#content-header .btn-group .btn .label { + position: absolute; + top: -7px; +} +.container-fluid .row-fluid:first-child { + margin-top: 20px; +} +/* Breadcrumb */ +#breadcrumb { + background-color: #fff; + border-bottom: 1px solid #e3ebed; +} +#breadcrumb a { + padding: 8px 20px 8px 10px; + display: inline-block; + background-image: url('../img/breadcrumb.png'); + background-position: center right; + background-repeat: no-repeat; + font-size: 11px; + color: #666666; +} +#breadcrumb a:hover { + color: #333333; +} +#breadcrumb a:last-child { + background-image:none; +} +#breadcrumb a.current { + font-weight: bold; + color: #444444; +} +#breadcrumb a i { + margin-right: 5px; + opacity: .6; +} +#breadcrumb a:hover i { + margin-right: 5px; + opacity: .8; +} +/*todo-list*/ +.todo ul { + list-style: none outside none; + margin: 0; +} +.todo li { + border-bottom: 1px solid #EBEBEB; + margin-bottom: 0; + padding: 10px 0; +} +.todo li:hover { + background: none repeat scroll 0 0 #FCFCFC; + border-color: #D9D9D9; +} +.todo li:last-child{ border-bottom:0px;} +.todo li .txt { + float: left; +} +.todo li .by { + margin-left: 10px; + margin-right: 10px; +} +.todo li .date { + margin-right: 10px; +} + +/* Stat boxes and quick actions */ +.quick-actions_homepage { + width:100%; + text-align:center; position:relative; + float:left; + margin-top:10px; +} +.stat-boxes, .quick-actions, .quick-actions-horizontal, .stats-plain { + display: block; + list-style: none outside none; + margin: 15px 0; + text-align: center; +} +.stat-boxes2 { + display: inline-block; + list-style: none outside none; + margin:0px; + text-align: center; +} +.stat-boxes2 li { + display: inline-block; + line-height: 18px; + margin: 0 10px 10px; + padding: 0 10px; background:#fff; border: 1px solid #DCDCDC +} +.stat-boxes2 li:hover{ background: #f6f6f6; } +.stat-boxes2 .left, .stat-boxes .right { + text-shadow: 0 1px 0 #fff; + float: left; +} +.stat-boxes2 .left { + border-right: 1px solid #DCDCDC; + box-shadow: 1px 0 0 0 #FFFFFF; + font-size: 10px; + font-weight: bold; + margin-right: 10px; + padding: 10px 14px 6px 4px; +} +.stat-boxes2 .right { + color: #666666; + font-size: 12px; + padding: 9px 10px 7px 0; + text-align: center; + min-width: 70px; float:left +} +.stat-boxes2 .left span, .stat-boxes2 .right strong { + display: block; +} +.stat-boxes2 .right strong { + font-size: 26px; + margin-bottom: 3px; + margin-top: 6px; +} +.quick-actions_homepage .quick-actions li{ position:relative;} +.quick-actions_homepage .quick-actions li .label{ position:absolute; padding:5px; top:-10px; right:-5px;} +.stats-plain { + width: 100%; +} +.stat-boxes li, .quick-actions li, .quick-actions-horizontal li { + float: left; + line-height: 18px; + margin: 0 10px 10px 0px; + padding: 0 10px; +} +.stat-boxes li a:hover, .quick-actions li a:hover, .quick-actions-horizontal li a:hover, .stat-boxes li:hover, .quick-actions li:hover, .quick-actions-horizontal li:hover { + background: #2E363F; +} +.quick-actions li { + min-width:14%; + min-height:70px; +} +.quick-actions_homepage .quick-actions .span3{ width:30%;} +.quick-actions li, .quick-actions-horizontal li { + padding: 0; +} +.stats-plain li { + padding: 0 30px; + display: inline-block; + margin: 0 10px 20px; +} +.quick-actions li a { + padding:10px 30px; +} +.stats-plain li h4 { + font-size: 40px; + margin-bottom: 15px; +} +.stats-plain li span { + font-size: 14px; + color: #fff; +} +.quick-actions-horizontal li a span { + padding: 10px 12px 10px 10px; + display: inline-block; +} +.quick-actions li a, .quick-actions-horizontal li a { + display: block; + color: #fff; font-size:14px; + font-weight:lighter; +} +.quick-actions li a i[class^="icon-"], .quick-actions li a i[class*=" icon-"] { + font-size:30px; + display: block; + margin: 0 auto 5px; +} +.quick-actions-horizontal li a i[class^="icon-"], .quick-actions-horizontal li a i[class*=" icon-"] { + background-repeat: no-repeat; + background-attachment: scroll; + background-position: center; + background-color: transparent; + width: 16px; + height: 16px; + display: inline-block; + margin: -2px 0 0 !important; + border-right: 1px solid #dddddd; + margin-right: 10px; + padding: 10px; + vertical-align: middle; +} + +.quick-actions li:active, .quick-actions-horizontal li:active { + background-image: -webkit-gradient(linear, 0 0%, 0 100%, from(#EEEEEE), to(#F4F4F4)); + background-image: -webkit-linear-gradient(top, #EEEEEE 0%, #F4F4F4 100%); + background-image: -moz-linear-gradient(top, #EEEEEE 0%, #F4F4F4 100%); + background-image: -ms-linear-gradient(top, #EEEEEE 0%, #F4F4F4 100%); + background-image: -o-linear-gradient(top, #EEEEEE 0%, #F4F4F4 100%); + background-image: linear-gradient(top, #EEEEEE 0%, #F4F4F4 100%); + box-shadow: 0 1px 4px 0 rgba(0,0,0,0.2) inset, 0 1px 0 rgba(255,255,255,0.4); +} +.stat-boxes .left, .stat-boxes .right { + text-shadow: 0 1px 0 #fff; + float: left; +} +.stat-boxes .left { + border-right: 1px solid #DCDCDC; + box-shadow: 1px 0 0 0 #FFFFFF; + font-size: 10px; + font-weight: bold; + margin-right: 10px; + padding: 10px 14px 6px 4px; +} +.stat-boxes .right { + color: #666666; + font-size: 12px; + padding: 9px 10px 7px 0; + text-align: center; + min-width: 70px; +} +.stat-boxes .left span, .stat-boxes .right strong { + display: block; +} +.stat-boxes .right strong { + font-size: 26px; + margin-bottom: 3px; + margin-top: 6px; +} +.stat-boxes .peity_bar_good, .stat-boxes .peity_line_good, { + color: #459D1C; +} +.stat-boxes .peity_bar_neutral, .stat-boxes .peity_line_neutral { + color: #757575; +} +.stat-boxes .peity_bar_bad, .stat-boxes .peity_line_bad { + color: #BA1E20; +} +.stats-plain { +} + +.site-stats { + margin: 0; + padding: 0; text-align:center; + list-style: none; +} +.site-stats li { + cursor: pointer; display:inline-block; + margin: 0 5px 10px; text-align:center; width:42%; + padding:10px 0; color:#fff; + position: relative; +} +.site-stats li i{ font-size:24px; clear:both} +.site-stats li:hover { background:#2E363F; +} + +.site-stats li i { + vertical-align: baseline; +} +.site-stats li strong { + font-weight: bold; + font-size: 20px; width:100%; float:left; + margin-left:0px; +} +.site-stats li small { + margin-left:0px; + font-size: 11px; + width:100%; float:left; +} +/* Charts & graphs **/ +.chart, .pie, .bars, #donut, #interactive, #placeholder, #placeholder2 { + height: 300px; + max-width: 100%; +} +#choices{ border-top:1px solid #dcdcdc; margin:10px 0; padding:10px;} +#choices br{ display:none;} +#choices input{ margin:-5px 5px 0 0;} +#choices label{ display:inline-block; padding-right:20px; } +#tooltip { + position: absolute; + display:none; + border: none; + padding: 3px 8px; + border-radius: 3px; + font-size: 10px; + background-color: #222222; + color: #ffffff; + z-index: 25; +} +/* Widgets */ +.widget-box { + background: none repeat scroll 0 0 #F9F9F9; + border-left: 1px solid #CDCDCD; + border-top: 1px solid #CDCDCD; + border-right: 1px solid #CDCDCD; + clear: both; + margin-top: 16px; + margin-bottom: 16px; + position: relative; +} +.widget-box.widget-calendar, .widget-box.widget-chat { + overflow:hidden !important; +} +.accordion .widget-box { + margin-top: -2px; + margin-bottom: 0; + border-radius: 0; +} +.widget-box.widget-plain { + background: transparent; + border: none; + margin-top: 0; + margin-bottom: 0; +} +.widget-title, .modal-header, .table th, div.dataTables_wrapper .ui-widget-header { + background:#efefef; + border-bottom: 1px solid #CDCDCD; + height: 36px; +} +.widget-title .nav-tabs { + border-bottom: 0 none; +} +.widget-title .nav-tabs li a { + border-bottom: medium none !important; + border-left: 1px solid #DDDDDD; + border-radius: 0 0 0 0; + border-right: 1px solid #DDDDDD; + border-top: medium none; + color: #999999; + margin: 0; + outline: medium none; + padding: 9px 10px 8px; + font-weight: bold; + text-shadow: 0 1px 0 #FFFFFF; +} +.widget-title .nav-tabs li:first-child a { + border-left: medium none !important; +} +.widget-title .nav-tabs li a:hover { + background-color: transparent !important; + border-color: #D6D6D6; + border-width: 0 1px; + color: #2b2b2b; +} +.widget-title .nav-tabs li.active a { + background-color: #F9F9F9 !important; + color: #444444; +} +.widget-title span.icon { + padding: 9px 10px 7px 11px; + float: left; border-right:1px solid #dadada; +} +.widget-title h5 { + color: #666; + float: left; + font-size: 12px; + font-weight: bold; + padding: 12px; + line-height: 12px; + margin: 0; +} +.widget-title .buttons { + float: right; + margin: 8px 10px 0 0; +} +.widget-title .label { + padding: 3px 5px 2px; + float: right; + margin: 9px 11px 0 0; + box-shadow: 0 1px 2px rgba(0,0,0,0.3) inset, 0 1px 0 #ffffff; +} +.widget-calendar .widget-title .label { + margin-right: 190px; +} +.widget-content { + padding:15px; + border-bottom: 1px solid #cdcdcd; +} +.widget-box.widget-plain .widget-content { + padding: 12px 0 0; +} +.widget-box.collapsible .collapse.in .widget-content { + border-bottom: 1px solid #CDCDCD; +} +.recent-posts, .recent-comments, .recent-users { + margin: 0; + padding: 0; +} +.recent-posts li, .recent-comments li, .article-post li, .recent-users li { + border-bottom: 1px dotted #AEBDC8; + list-style: none outside none; + padding: 10px; +} +.recent-posts li.viewall, .recent-comments li.viewall, .recent-users li.viewall { + padding: 0; +} +.recent-posts li.viewall a, .recent-comments li.viewall a, .recent-users li.viewall a { + padding: 5px; + text-align: center; + display: block; + color: #888888; +} +.recent-posts li.viewall a:hover, .recent-comments li.viewall a:hover, .recent-users li.viewall a:hover { + background-color: #eeeeee; +} +.recent-posts li:last-child, .recent-comments li:last-child, .recent-users li:last-child { + border-bottom: none !important; +} +.user-thumb { + background: none repeat scroll 0 0 #FFFFFF; + float: left; + height: 40px; + margin-right: 10px; + margin-top: 5px; + padding: 2px; + width: 40px; +} +.user-info { + color: #666666; + font-size: 11px; +} + +.invoice-content { + padding: 20px; +} +.invoice-action { + margin-bottom: 30px; +} +.invoice-head { + clear: both; + margin-bottom: 40px; + overflow: hidden; + width: auto; +} +.invoice-meta { + font-size: 18px; + margin-bottom: 40px; +} +.invoice-date { + float: right; + font-size: 80%; +} +.invoice-content h5 { + color: #333333; + font-size: 16px; + font-weight: normal; + margin-bottom: 10px; +} +.invoice-content ul { + list-style: none; + margin: 0; + padding: 0; +} +.invoice-to { + float: left; + width: 370px; +} +.invoice-from { + float: right; + width: 300px; +} +.invoice-to li, .invoice-from li { + clear: left; +} +.invoice-to li span, .invoice-from li span { + display: block; +} +.invoice-content th.total-label { + text-align: right; +} +.invoice-content th.total-amount { + text-align: left; +} +.amount-word { + color: #666666; + margin-bottom: 40px; + margin-top: 40px; +} +.amount-word span { + color: #5476A6; + font-weight: bold; + padding-left: 20px; +} +.panel-left { + margin-top:103px; +} +.panel-left2 { + margin-left:176px; +} +.panel-right { + width: 100%; + background-color: #fff; + border-bottom: 1px solid #dddddd; + position: absolute; + right: 0; + overflow:auto; + top:38px; + height:76px; +} +.panel-right2 { + width: 100%; + background-color: #fff; + border-right: 1px solid #dddddd; + position: absolute; + left: 0; + overflow:auto; + top:0px; + height:94%; + width:175px; +} +.panel-right .panel-title, .panel-right2 .panel-title { + width: 100%; + background-color: #ececec; + border-bottom: 1px solid #dddddd; +} +.panel-right .panel-title h5, .panel-right2 .panel-title h5 { + font-size: 12px; + color: #777777; + text-shadow: 0 1px 0 #ffffff; + padding: 6px 10px 5px; + margin: 0; +} +.panel-right .panel-content { + padding: 10px; +} +.chat-content { + height: 470px; + padding: 15px; +} +.chat-messages { + height: 420px; + overflow: auto; + position: relative; +} +.chat-message { + padding: 7px 15px; + margin: 7px 0 0; +} +.chat-message input[type=text] { + margin-bottom: 0 !important; + width: 100%; +} +.chat-message .input-box { + display: block; + margin-right: 90px; +} +.chat-message button { + float: right; +} +#chat-messages-inner p { + padding:0px; + margin: 10px 0 0 0; +} +#chat-messages-inner p img { + display: inline-block; + float: left; + vertical-align: middle; + width: 28px; + height: 28px; + margin-top:-1px; + margin-right:10px; +} +#chat-messages-inner .msg-block, #chat-messages-inner p.offline span { + background: none repeat scroll 0 0 #FFFFFF; + border: 1px solid #cccccc; + box-shadow: 1px 1px 0 1px rgba(0, 0, 0, 0.05); + display: block; + margin-left:0px; + padding: 10px; + position: relative; +} +#chat-messages-inner p.offline span { + background: none repeat scroll 0 0 #FFF5F5; +} +#chat-messages-inner .time { + color: #999999; + font-size: 11px; + float:right; +} +#chat-messages-inner .msg { + display: block; + margin-top: 13px; + border-top:1px solid #dadada; +} +#chat-messages-inner .msg-block:before { + border-right: 7px solid rgba(0,0,0,0.1); + border-top: 7px solid transparent; + border-bottom: 7px solid transparent; + content: ""; + display:none; + left: -7px; + position: absolute; + top: 11px; +} +#chat-messages-inner .msg-block:after { + border-right: 6px solid #ffffff; + border-top: 6px solid transparent; + border-bottom: 6px solid transparent; + content: ""; + display: none; + left: -6px; + position: absolute; + top: 12px; +} +.chat-users { + padding: 0 0 30px; +} +.chat-users .contact-list { + line-height: 21px; + list-style: none outside none; + margin: 0; + padding: 0; + font-size: 10px; +} +.chat-users .contact-list li { + border: 1px solid #DADADA; + margin:5px 5px; + padding: 1px; + position: relative; +} +.chat-users .contact-list li:hover { + background-color: #efefef; +} +.chat-users .contact-list li a { + color: #666666; + display: block; + padding: 8px 5px; +} +.chat-users .contact-list li.online a { + font-weight: bold; +} +.chat-users .contact-list li.new { + background-color: #eaeaea; +} +.chat-users .contact-list li.offline { + background-color: #EDE0E0; +} +.chat-users .contact-list li a img { + display: inline-block; + margin-right: 10px; + vertical-align: middle; + width: 28px; + height: 28px; +} +.chat-users .contact-list li .msg-count { + padding: 3px 5px; + position: absolute; + right: 10px; + top: 12px; +} +.taskDesc i { + margin: 1px 5px 0; +} +.taskStatus, .taskOptions { + text-align: center !important; +} +.taskStatus .in-progress { + color: #64909E; +} +.taskStatus .pending { + color: #AC6363; +} +.taskStatus .done { + color: #75B468; +} +.activity-list { + list-style: none outside none; + margin: 0; +} +.activity-list li { + border-bottom: 1px solid #EEEEEE; + display: block; +} +.activity-list li:last-child { + border-bottom: medium none; +} +.activity-list li a { + display: block; + padding: 7px 10px; +} +.activity-list li a:hover { + background-color: #FBFBFB; +} +.activity-list li a span { + color: #AAAAAA; + font-size: 11px; + font-style: italic; +} +.activity-list li a i { + margin-right: 10px; + opacity: 0.6; + vertical-align: middle; +} +.new-update { + border-top: 1px solid #DDDDDD; + padding: 10px 12px; +} +.new-update:first-child { + border-top: medium none; +} +.new-update span { + display:block; +} +.new-update i { + float: left; + margin-top: 3px; + margin-right: 13px; +} +.new-update .update-date { + color: #BBBBBB; + float: right; + margin: 4px -2px 0 0; + text-align: center; + width: 30px; +} +.new-update .update-date .update-day { + display: block; + font-size: 20px; + font-weight: bold; + margin-bottom: -4px; +} +.update-done, .update-alert, .update-notice { + display: block; + float: left; + max-width: 76%; +} +/* Tables */ +tr:hover{ background:#f6f6f6;} +span.icon .checker { + margin-top: -5px; + margin-right: 0; +} +.dataTables_length { + color: #878787; + margin: 7px 5px 0; + position: relative; + left:5px; width:50%; + top: -2px; +} +.dataTables_length div { + vertical-align: middle; +} +.dataTables_paginate { + line-height: 16px; + text-align: right; + margin-top: 5px; + margin-right: 10px; +} +.dataTables_paginate { + line-height: 16px; + text-align: right; + margin-top: 5px; + margin-right: 10px; +} +.dataTables_paginate .ui-button, .pagination.alternate li a { + font-size: 12px; + padding: 4px 10px !important; + border-style: solid; + border-width: 1px; + border-color: #dddddd #dddddd #cccccc; /* for IE < 9 */ + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + display: inline-block; + line-height: 16px; + background: #f5f5f5; + color: #333333; + text-shadow: 0 1px 0 #ffffff; +} +.dataTables_paginate .ui-button:hover, .pagination.alternate li a:hover { + background: #e8e8e8; + color: #222222; + text-shadow: 0 1px 0 #ffffff; + cursor: pointer; +} +.dataTables_paginate .first { + border-radius: 4px 0 0 4px; +} +.dataTables_paginate .last { + border-radius: 0 4px 4px 0; +} +.dataTables_paginate .ui-state-disabled, .fc-state-disabled, .pagination.alternate li.disabled a { + color: #AAAAAA !important; +} +.dataTables_paginate .ui-state-disabled:hover, .fc-state-disabled:hover, .pagination.alternate li.disabled a:hover { + background: #f5f5f5; + cursor: default !important; +} +.dataTables_paginate span .ui-state-disabled, .pagination.alternate li.active a { + background: #41BEDD !important; + color: #ffffff !important; + cursor: default !important; +} +div.dataTables_wrapper .ui-widget-header { + border-right: medium none; + border-top: 1px solid #D5D5D5; + font-weight: normal; + margin-top: -1px; +} +.dataTables_wrapper .ui-toolbar { + padding: 5px; +} +.dataTables_filter { + color: #878787; + font-size: 11px; + right: 0; top:37px; + margin: 4px 8px 2px 10px; + position: absolute; + text-align: left; +} +.dataTables_filter input { + margin-bottom: 0; +} +.table th { + height: auto; + font-size: 10px; + padding: 5px 10px 2px; + border-bottom: 0; + text-align: center; + color: #666666; +} +.table.with-check tr th:first-child, .table.with-check tr td:first-child { + width: 10px; +} +.table.with-check tr th:first-child i { + margin-top: -2px; + opacity: 0.6; +} +.table.with-check tr td:first-child .checker { + margin-right: 0; +} +.table tr.checked td { + background-color: #FFFFE3 !important; +} +/* Misc */ +.nopadding { + padding: 0 !important; +} +.nopadding .table { + margin-bottom: 0; +} +.nopadding .table-bordered { + border: 0; +} +.thumbnails { + margin-left: -2.12766% !important; +} +.thumbnails [class*="span"] { + margin-left: 2.12766% !important; + position: relative; +} +.thumbnails .actions { + width: auto; + height: 16px; + background-color:#000; + padding: 4px 8px 8px 8px; + position: absolute; + bottom:0%; + left:50%; + margin-top: -13px; + margin-left: -24px; + opacity: 0; top:10%; transition:1s ease-out; + -moz-transition: opacity 0.3s ease-in-out; +} +.thumbnails li:hover .actions,.thumbnails li:hover .actions a:hover{ + opacity: 1; color:#fff; top:50%; transition:1s ease-out; +} +.line { + background: url("../img/line.png") repeat-x scroll 0 0 transparent; + display: block; + height: 8px; +} +.modal { + z-index: 99999 !important; +} +.modal-backdrop { + z-index: 999 !important; +} +.modal-header { + height: auto; + padding: 8px 15px 5px; +} +.modal-header h3 { + font-size: 12px; + text-shadow: 0 1px 0 #ffffff; +} +.notify-ui ul { + list-style: none; + margin: 0; + padding: 0; +} +.notify-ui li { + background: #eeeeee; + margin-bottom: 5px; + padding: 5px 10px; + text-align: center; + border: 1px solid #dddddd; +} +.notify-ui li:hover { + cursor: pointer; + color: #777777; +} +/* Forms */ +form { + margin-bottom: 0; +} +.form-horizontal .control-group { + border-top: 1px solid #ffffff; + border-bottom: 1px solid #eeeeee; + margin-bottom: 0; +} +.form-horizontal .control-group:last-child { + border-bottom: 0; +} +.form-horizontal .control-label { + padding-top: 15px; + width: 180px; +} +.form-horizontal .controls { + margin-left: 200px; + padding: 10px 0; +} +.form-horizontal input[type=text], .form-horizontal input[type=password], .form-horizontal textarea { +} +.row-fluid .span20 { + width:97.8% +} +.form-horizontal .form-actions { + margin-top: 0; + margin-bottom: 0; +} +.help-block, .help-inline { + color: #999999; +} +/***********light-box***************/ +#lightbox { + position:fixed; /* keeps the lightbox window in the current viewport */ + top:0; + left:0; + width:100%; + height:100%; + background:url(overlay.png) repeat #000; + text-align:center; + z-index:9999; +} +#lightbox p { + position:absolute; + top:10px; + right:10px; + width:22px; + height:22px; + cursor:pointer; + z-index:22; + border:1px solid #fff; + border-radius:100%; + padding:2px; + text-align:center; + transition:0.5s; +} +#lightbox p:hover { + transform:rotate(180deg) +} +#imgbox { + position:absolute; /* keeps the lightbox window in the current viewport */ + left:0; + top:0px; + width:100%; + height:100%; + background:url(overlay.png) repeat #000; + text-align:center; + z-index:21; +} +#imgbox img { + margin-top:100px; + border:10px solid #fff; +} +/***********Error Page******************/ +.error_ex{ text-align:center;} +.error_ex h1{ font-size:140px; font-weight:bold; padding:50px 0; color:#28B779} + +#sidebar .content { + padding:10px; + position: relative; color:#939DA8; +} +#sidebar .percent { + font-weight: 700; + position: absolute; + right: 10px; + top:25px; +} +#sidebar .progress { + margin-bottom: 2px; + margin-top: 2px; + width: 70%; +} +#sidebar .progress-mini { + height: 6px; +} +#sidebar .stat { + font-size: 11px; +} +/***********light-box-end***************/ + +.btn-icon-pg ul { + margin:0px; + padding:0px; +} +.btn-icon-pg ul li { + margin:5px; + padding:5px; + list-style:none; + display:inline-block; + border:1px solid #dadada; + min-width:187px; + cursor:pointer +} +.btn-icon-pg ul li:hover i { + transition:0.3s; + -moz-transition:0.3s; + -webkit-transition:0.3s; + -o-transition:0.3s; + margin-left:8px; +} +.accordion { + margin-top:16px; +} +.fix_hgt { + height:115px; + overflow-x:auto; +} +.input-append .add-on:last-child, .input-append .btn:last-child { + border-radius:0px; + padding:6px 5px 2px; +} +.input-prepend input, .input-append input, .input-prepend input[class*="span"], .input-append input[class*="span"] { + width:none; +} +.input-append input, .input-append select, .input-prepend span, .input-prepend input { + border-radius:0px!important; +} +/***********pop-over********************/ +.bs-docs-tooltip-examples { + list-style: none outside none; + margin: 0 0 10px; + position:relative; + text-align: center; +} +.bs-docs-tooltip-examples li { + display: inline; + padding: 0 10px; + list-style:none; + position:relative; +} +/* Responsive design */ +@media (max-width: 480px) { +#header h1 { + top: 10px; left:5px; + margin: 3px auto; +} +#user-nav { + position: relative; + left: auto; + right: auto; + width: 100%; + margin-top: -31px; + border-top:1px solid #363E48; + margin-bottom: 0px; + background:#2E363F; + float:right; +} +.navbar > .nav { + float: none; +} +#my_menu { + display:none; +} +#my_menu_input { + display:block; +} +#user-nav > ul { + right: 0px; + margin-left:20%!important; + margin-top:0px; + width:100%; + background:#000; + position: relative; +} +#user-nav > ul > li { + padding:0px 0px; +} +#user-nav > ul > li > a { + padding:5px 10px; +} +#sidebar .content{ display:none;} +#content { + margin-left: 0 !important; + border-top-left-radius: 0; + margin-top:0px; +} +#content-header { + margin-top: 0; + text-align: center; +} +#content-header h1, #content-header .btn-group { + float: none; +} +#content-header h1 { + display: block; + text-align: center; + margin-left: auto; + margin-top: 0; + padding-top: 15px; + width: 100%; +} +#content-header .btn-group { + margin-top: 70px; + margin-bottom: 0; + margin-right: 0; + left: 30%; +} +#sidebar { + float: none; + width: 100% !important; + display:block; + position:relative; + top:0px; +} +#sidebar > ul { + margin:0px; + padding:0px; + width:100%; + display:block; + z-index:999; + position:relative +} +#sidebar > ul > li { + list-style-type:none; + display:block; + border-top:1px solid #41BEDD; + float:none !important; + margin:0px; + position:relative; + padding:2px 10px; + cursor:pointer +} +#sidebar > ul > li:hover ul { + display:none; +} +#sidebar > ul > li:hover { + background-color:#27a9e3; +} +#sidebar > ul > li:hover a { + background:none; +} +#sidebar > ul li ul { + margin:0px; + padding:0px; + top:35px; left:0px; + z-index:999; + display:none; + position:absolute; + width:100%; + min-width:100%; + border-radius:none; +} +#sidebar > ul li ul li { + list-style-type:none; + margin:0px; + font-size:12px; + line-height:30px; +} +#sidebar > ul li ul li a { + display:block; + padding:5px 10px; + color:#fff; + text-decoration:none; + font-weight:bold; +} +#sidebar > ul li ul li:hover a { + border-radius:0px; +} +#sidebar > ul li span { + cursor:pointer; + margin:0px 2px 0 5px; + font-weight:bold; + color:#fff; + font-size:12px; +} +#sidebar > ul li a i { + background-image: url("../img/glyphicons-halflings-white.png"); + margin-top:4px; + vertical-align: top; +} +#sidebar > a { + padding: 9px 20px 9px 15px; + display: block !important; + color: #eeeeee; + float:none !important; + font-size:12px; + font-weight:bold +} +#sidebar > ul > li > a { + padding:5px; + display:block; + color: #AAAAAA; +} +.widget-title .buttons > .btn { + width: 11px; + white-space: nowrap; + overflow: hidden; +} +.form-horizontal .control-label { + padding-left: 30px; +} +.form-horizontal .controls { + margin-left: 0; + padding: 10px 30px; +} +.form-actions { + text-align: center; +} +.panel-right2 { + width: 100%; + background-color: #fff; + border-right: 1px solid #dddddd; + position: relative; + left: 0; + overflow:auto; + top:0px; + height:87%; + width:100%; +} +.panel-left2 { + margin-left:0px; +} +.dataTables_paginate .ui-button, .pagination.alternate li a { + padding:4px 4px!important; +} +.table th { + padding: 5px 4px 2px; +} +} + @media (min-width: 481px) and (max-width: 970px) { +body { + background:#49CCED +} +#header h1 { + top:10px; left:35px; +} +#search { + top:5px +} +#my_menu { + display:none; +} +#my_menu_input { + display:block; +} +#content { + margin-top:0px; +} +#sidebar > ul > li { + float:none; +} +#sidebar > ul > li:hover ul { + display:block; +} +#sidebar, #sidebar > ul { + width: 43px; + display: block; + position: absolute; + height:100%; + z-index:1; +} +#sidebar > ul ul { + display: none; + position: absolute; + left:43px; + top: 0; + min-width: 150px; + list-style: none; +} +#sidebar > ul ul li a { + white-space: nowrap; + padding: 10px 25px; +} +#sidebar > ul ul:before { + border-top: 7px solid transparent; + border-bottom: 7px solid transparent; + content: ""; + display: inline-block; + left: -6px; + position: absolute; + top: 11px; +} +#sidebar > ul ul:after { + content: ""; + display: inline-block; + left: -5px; + position: absolute; + top: 12px; +} +#sidebar > a { + display: none !important; +} +#sidebar > ul > li.open.submenu > a { + border-bottom: none !important; +} +#sidebar > ul > li > a > span { + display: none; +} +#content { + margin-left: 43px; +} +#sidebar .content{ display:none;} +} +@media (max-width: 600px) { +.widget-title .buttons { + float: left; +} +.panel-left { + margin-right: 0; +} +.panel-right { + border-top: 1px solid #DDDDDD; + border-left: none; + position: relative; + top: auto; + right: auto; + height: auto; + width: auto; +} +#sidebar .content{ display:none;} +} +@media (max-width: 767px) { +body { + padding: 0 !important; +} +.container-fluid { + padding-left: 20px; + padding-right: 20px; +} +#search { + display: none; +} +#user-nav > ul > li > a > span.text { + display: none; +} +#sidebar .content{ display:none;} +} +@media (min-width: 768px) and (max-width: 979px) { + [class*="span"], .row-fluid [class*="span"] { + display: block; + float: none; + margin-left: 0; + width: auto; +} +} +@media (max-width: 979px) { +div.dataTables_wrapper .ui-widget-header { + height: 68px; +} +.dataTables_filter{ position:relative; top:0px;} +.dataTables_length{ width:100%; text-align:center;} +.dataTables_filter, .dataTables_paginate { + text-align: center; +} +#sidebar .content{ display:none;} +} + +table { + border-bottom: 1px solid #ddd !important; +} + +.v-select-dt, .v-page-goto { + display: none !important; +} + +.v-select, .v-dropdown, .v-dropdown--small, .v-page-select{ + display: none !important; +} +.dropdown-toggle:hover { + background: #20262d !important; + cursor: default; +} \ No newline at end of file diff --git a/src/main/webapp/resources/css/select2.css b/src/main/webapp/resources/css/select2.css new file mode 100644 index 0000000000000000000000000000000000000000..19d07059504e03c468092668c7fdb43f1dfae5a9 --- /dev/null +++ b/src/main/webapp/resources/css/select2.css @@ -0,0 +1,483 @@ +/* +Version: 3.2 Timestamp: Mon Sep 10 10:38:04 PDT 2012 +*/ +.select2-container { + position: relative; + display: inline-block; + /* inline-block for ie7 */ + zoom: 1; + *display: inline; + vertical-align: top; width:90%; +} +.dataTables_length .select2-container{ width:auto!important;} +.select2-container, +.select2-drop, +.select2-search, +.select2-search input{ + /* + Force border-box so that % widths fit the parent + container without overlap because of margin/padding. + + More Info : http://www.quirksmode.org/css/box.html + */ + -moz-box-sizing: border-box; /* firefox */ + -ms-box-sizing: border-box; /* ie */ + -webkit-box-sizing: border-box; /* webkit */ + -khtml-box-sizing: border-box; /* konqueror */ + box-sizing: border-box; /* css3 */ +} + +.select2-container .select2-choice { + background-color: #fff; + + -moz-background-clip: padding; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #aaa; + display: block; + overflow: hidden; + white-space: nowrap; + position: relative; + height: 26px; + line-height: 26px; + padding: 0 0 0 8px; + color: #444; + text-decoration: none; +} + +.select2-container.select2-drop-above .select2-choice +{ + border-bottom-color: #aaa; + +} + +.select2-container .select2-choice span { + margin-right: 26px; + display: block; + overflow: hidden; + white-space: nowrap; + -o-text-overflow: ellipsis; + -ms-text-overflow: ellipsis; + text-overflow: ellipsis; +} + +.select2-container .select2-choice abbr { + display: block; + position: absolute; + right: 26px; + top: 8px; + width: 12px; + height: 12px; + font-size: 1px; + background: url('../img/select2.png') right top no-repeat; + cursor: pointer; + text-decoration: none; + border:0; + outline: 0; +} +.select2-container .select2-choice abbr:hover { + background-position: right -11px; + cursor: pointer; +} + +.select2-drop { + background: #fff; + color: #000; + border: 1px solid #aaa; + border-top: 0; + position: absolute; + top: 100%; + -webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15); + -moz-box-shadow: 0 4px 5px rgba(0, 0, 0, .15); + -o-box-shadow: 0 4px 5px rgba(0, 0, 0, .15); + box-shadow: 0 4px 5px rgba(0, 0, 0, .15); + z-index: 999999; + width:100%; + margin-top:-1px; + +} + +.select2-drop.select2-drop-above { + + margin-top:1px; + border-top: 1px solid #aaa; + border-bottom: 0; + + -webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15); + -moz-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15); + -o-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15); + box-shadow: 0 -4px 5px rgba(0, 0, 0, .15); +} + +.select2-container .select2-choice div { + + -moz-background-clip: padding; + -webkit-background-clip: padding-box; + background-clip: padding-box; + background: #ccc; + border-left: 1px solid #aaa; + position: absolute; + right: 0; + top: 0; + display: block; + height: 100%; + width: 18px; +} + +.select2-container .select2-choice div b { + background: url('../img/select2.png') no-repeat 0 1px; + display: block; + width: 100%; + height: 100%; +} + +.select2-search { + display: inline-block; + white-space: nowrap; + z-index: 10000; + min-height: 26px; + width: 100%; + margin: 0; + padding-left: 4px; + padding-right: 4px; +} + +.select2-search-hidden { + display: block; + position: absolute; + left: -10000px; +} + +.select2-search input { + background: #fff url('../img/select2.png') no-repeat 100% -22px; + background: url('../img/select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); + background: url('../img/select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); + background: url('../img/select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); + background: url('../img/select2.png') no-repeat 100% -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%); + background: url('../img/select2.png') no-repeat 100% -22px, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%); + background: url('../img/select2.png') no-repeat 100% -22px, linear-gradient(top, #ffffff 85%, #eeeeee 99%); + padding: 4px 20px 4px 5px; + outline: 0; + border: 1px solid #aaa; + font-family: sans-serif; + font-size: 1em; + width:100%; + margin:0; + height:auto !important; + min-height: 26px; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + border-radius: 0; + -moz-border-radius: 0; + -webkit-border-radius: 0; +} + +.select2-drop.select2-drop-above .select2-search input +{ + margin-top:4px; +} + +.select2-search input.select2-active { + background: #fff url('../img/spinner.gif') no-repeat 100%; + background: url('../img/spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); + background: url('../img/spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); + background: url('../img/spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); + background: url('../img/spinner.gif') no-repeat 100%, -o-linear-gradient(bottom, white 85%, #eeeeee 99%); + background: url('../img/spinner.gif') no-repeat 100%, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%); + background: url('../img/spinner.gif') no-repeat 100%, linear-gradient(top, #ffffff 85%, #eeeeee 99%); +} + + +.select2-container-active .select2-choice, +.select2-container-active .select2-choices { + -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3); + -moz-box-shadow : 0 0 5px rgba(0,0,0,.3); + -o-box-shadow : 0 0 5px rgba(0,0,0,.3); + box-shadow : 0 0 5px rgba(0,0,0,.3); + border: 1px solid #5897fb; + outline: none; +} + +.select2-dropdown-open .select2-choice { + border: 1px solid #aaa; + border-bottom-color: transparent; + -webkit-box-shadow: 0 1px 0 #fff inset; + -moz-box-shadow : 0 1px 0 #fff inset; + -o-box-shadow : 0 1px 0 #fff inset; + box-shadow : 0 1px 0 #fff inset; + background-color: #eee; + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, white), color-stop(0.5, #eeeeee)); + background-image: -webkit-linear-gradient(center bottom, white 0%, #eeeeee 50%); + background-image: -moz-linear-gradient(center bottom, white 0%, #eeeeee 50%); + background-image: -o-linear-gradient(bottom, white 0%, #eeeeee 50%); + background-image: -ms-linear-gradient(top, #ffffff 0%,#eeeeee 50%); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 ); + background-image: linear-gradient(top, #ffffff 0%,#eeeeee 50%); + -webkit-border-bottom-left-radius : 0; + -webkit-border-bottom-right-radius: 0; + -moz-border-radius-bottomleft : 0; + -moz-border-radius-bottomright: 0; + border-bottom-left-radius : 0; + border-bottom-right-radius: 0; +} + +.select2-dropdown-open .select2-choice div { + background: transparent; + border-left: none; +} +.select2-dropdown-open .select2-choice div b { + background-position: -18px 1px; +} + +/* results */ +.select2-results { + margin: 4px 4px 4px 0; + padding: 0 0 0 4px; + position: relative; + overflow-x: hidden; + overflow-y: auto; + max-height: 200px; +} + +.select2-results ul.select2-result-sub { + margin: 0 0 0 0; +} + +.select2-results ul.select2-result-sub > li .select2-result-label { padding-left: 20px } +.select2-results ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 40px } +.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 60px } +.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 80px } +.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 100px } +.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 110px } +.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 120px } + +.select2-results li { + list-style: none; + display: list-item; +} + +.select2-results li.select2-result-with-children > .select2-result-label { + font-weight: bold; +} + +.select2-results .select2-result-label { + padding: 3px 7px 4px; + margin: 0; + cursor: pointer; +} + +.select2-results .select2-highlighted { + background: #3875d7; + color: #fff; +} +.select2-results li em { + background: #feffde; + font-style: normal; +} +.select2-results .select2-highlighted em { + background: transparent; +} +.select2-results .select2-no-results, +.select2-results .select2-searching, +.select2-results .select2-selection-limit { + background: #f4f4f4; + display: list-item; +} + +/* +disabled look for already selected choices in the results dropdown +.select2-results .select2-disabled.select2-highlighted { + color: #666; + background: #f4f4f4; + display: list-item; + cursor: default; +} +.select2-results .select2-disabled { + background: #f4f4f4; + display: list-item; + cursor: default; +} +*/ +.select2-results .select2-disabled { + display: none; +} + +.select2-more-results.select2-active { + background: #f4f4f4 url('../img/spinner.gif') no-repeat 100%; +} + +.select2-more-results { + background: #f4f4f4; + display: list-item; +} + +/* disabled styles */ + +.select2-container.select2-container-disabled .select2-choice { + background-color: #f4f4f4; + background-image: none; + border: 1px solid #ddd; + cursor: default; +} + +.select2-container.select2-container-disabled .select2-choice div { + background-color: #f4f4f4; + background-image: none; + border-left: 0; +} + + +/* multiselect */ + +.select2-container-multi .select2-choices { + background-color: #fff; + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff)); + background-image: -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%); + background-image: -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%); + background-image: -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%); + background-image: -ms-linear-gradient(top, #eeeeee 1%, #ffffff 15%); + background-image: linear-gradient(top, #eeeeee 1%, #ffffff 15%); + border: 1px solid #ccc; + margin: 0; + padding: 0; + cursor: text; + overflow: hidden; + height: auto !important; + height: 1%; + position: relative; width:100%; + +} + +.select2-container-multi .select2-choices { + min-height: 26px; +} + +.select2-container-multi.select2-container-active .select2-choices { + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(82, 168, 236, 0.6); + -moz-box-shadow : 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(82, 168, 236, 0.6); + -o-box-shadow : 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(82, 168, 236, 0.6); + box-shadow : 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(82, 168, 236, 0.6); + border: 1px solid #5897fb; + outline: none; +} +.select2-container-multi .select2-choices li { + float: left; + list-style: none; +} +.select2-container-multi .select2-choices .select2-search-field { + white-space: nowrap; + margin: 0; + padding: 0; +} + +.select2-container-multi .select2-choices .select2-search-field input { + color: #666; + background: transparent !important; + font-family: sans-serif; + font-size: 100%; + height: 15px; + padding: 5px; + margin: 1px 0; + outline: 0; + border: 0; + -webkit-box-shadow: none; + -moz-box-shadow : none; + -o-box-shadow : none; + box-shadow : none; +} + +.select2-container-multi .select2-choices .select2-search-field input.select2-active { + background: #fff url('../img/spinner.gif') no-repeat 100% !important; +} + +.select2-default { + color: #999 !important; +} + +.select2-container-multi .select2-choices .select2-search-choice { + -moz-background-clip : padding; + -webkit-background-clip: padding-box; + background-clip : padding-box; + background:#f9eae1; + -webkit-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05); + -moz-box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05); + box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05); + color: #333; + border: 1px solid #F77825; + line-height: 13px; + padding: 3px 5px 3px 18px; + margin: 3px 0 3px 5px; + position: relative; + cursor: default; +} +.select2-container-multi .select2-choices .select2-search-choice span { + cursor: default; +} +.select2-container-multi .select2-choices .select2-search-choice-focus { + background: #d4d4d4; +} + +.select2-search-choice-close { + display: block; + position: absolute; + right: 3px; + top: 4px; + width: 12px; + height: 13px; + font-size: 1px; + background: url('../img/select2.png') right top no-repeat; + outline: none; +} + +.select2-container-multi .select2-search-choice-close { + left: 3px; +} + + +.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover { + background-position: right -11px; +} +.select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close { + background-position: right -11px; +} + +/* disabled styles */ + +.select2-container-multi.select2-container-disabled .select2-choices{ + background-color: #f4f4f4; + background-image: none; + border: 1px solid #ddd; + cursor: default; +} + +.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice { + background-image: none; + background-color: #f4f4f4; + border: 1px solid #ddd; + padding: 3px 5px 3px 5px; +} + +.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close { + display: none; +} +/* end multiselect */ + +.select2-result-selectable .select2-match, +.select2-result-unselectable .select2-result-selectable .select2-match { text-decoration: underline; } +.select2-result-unselectable .select2-match { text-decoration: none; } + +.select2-offscreen { position: absolute; left: -10000px; } + +/* Retina-ize icons */ + +@media only screen and (-webkit-min-device-pixel-ratio: 1.5) { + .select2-search input, .select2-search-choice-close, .select2-container .select2-choice abbr, .select2-container .select2-choice div b { + background-image: url(../img/select2x2.png) !important; + background-repeat: no-repeat !important; + background-size: 60px 40px !important; + } + .select2-search input { + background-position: 100% -21px !important; + } +} diff --git a/src/main/webapp/resources/css/uniform.css b/src/main/webapp/resources/css/uniform.css new file mode 100644 index 0000000000000000000000000000000000000000..c226e0cd5bc039e2232b3dab549302857395e200 --- /dev/null +++ b/src/main/webapp/resources/css/uniform.css @@ -0,0 +1,587 @@ +/* + +Uniform Theme: Uniform Default +Version: 1.6 +By: Josh Pyles +License: MIT License +--- +For use with the Uniform plugin: +http://pixelmatrixdesign.com/uniform/ +--- +Generated by Uniform Theme Generator: +http://pixelmatrixdesign.com/uniform/themer.html + +*/ + +/* Global Declaration */ + +div.selector, +div.selector span, +div.checker span, +div.radio span, +div.uploader, +div.uploader span.action, +div.button, +div.button span { + background-image: url(../img/sprite.png); + background-repeat: no-repeat; + -webkit-font-smoothing: antialiased; +} + +.selector, +.radio, +.checker, +.uploader, +.button, +.selector *, +.radio *, +.checker *, +.uploader *, +.button *{ + margin: 0; + padding: 0; +} + +/* INPUT & TEXTAREA */ + + + +input.text:focus, +input.email:focus, +input.password:focus, +textarea.uniform:focus { +} + +/* SPRITES */ + +/* Select */ + +div.selector { + background-position: -483px -130px; + line-height: 26px; + height: 26px; +} + +div.selector span { + background-position: right 0px; + height: 26px; + line-height: 26px; +} + +div.selector select { + /* change these to adjust positioning of select element */ + top: 0px; + left: 0px; +} + +div.selector:active, +div.selector.active { + background-position: -483px -156px; +} + +div.selector:active span, +div.selector.active span { + background-position: right -26px; +} + +div.selector.focus, div.selector.hover, div.selector:hover { + background-position: -483px -182px; +} + +div.selector.focus span, div.selector.hover span, div.selector:hover span { + background-position: right -52px; +} + +div.selector.focus:active, +div.selector.focus.active, +div.selector:hover:active, +div.selector.active:hover { + background-position: -483px -208px; +} + +div.selector.focus:active span, +div.selector:hover:active span, +div.selector.active:hover span, +div.selector.focus.active span { + background-position: right -78px; +} + +div.selector.disabled { + background-position: -483px -234px; +} + +div.selector.disabled span { + background-position: right -104px; +} + +/* Checkbox */ + +div.checker { + width: 19px; + height: 19px; +} + +div.checker input { + width: 19px; + height: 19px; +} + +div.checker span { + background-position: 0px -260px; + height: 19px; + width: 19px; +} + +div.checker:active span, +div.checker.active span { + background-position: -19px -260px; +} + +div.checker.focus span, +div.checker:hover span { + background-position: -38px -260px; +} + +div.checker.focus:active span, +div.checker:active:hover span, +div.checker.active:hover span, +div.checker.focus.active span { + background-position: -57px -260px; +} + +div.checker span.checked { + background-position: -76px -260px; +} + +div.checker:active span.checked, +div.checker.active span.checked { + background-position: -95px -260px; +} + +div.checker.focus span.checked, +div.checker:hover span.checked { + background-position: -114px -260px; +} + +div.checker.focus:active span.checked, +div.checker:hover:active span.checked, +div.checker.active:hover span.checked, +div.checker.active.focus span.checked { + background-position: -133px -260px; +} + +div.checker.disabled span, +div.checker.disabled:active span, +div.checker.disabled.active span { + background-position: -152px -260px; +} + +div.checker.disabled span.checked, +div.checker.disabled:active span.checked, +div.checker.disabled.active span.checked { + background-position: -171px -260px; +} + +/* Radio */ + +div.radio { + width: 18px; + height: 18px; +} + +div.radio input { + width: 18px; + height: 18px; +} + +div.radio span { + height: 18px; + width: 18px; + background-position: 0px -279px; +} + +div.radio:active span, +div.radio.active span { + background-position: -18px -279px; +} + +div.radio.focus span, +div.radio:hover span { + background-position: -36px -279px; +} + +div.radio.focus:active span, +div.radio:active:hover span, +div.radio.active:hover span, +div.radio.active.focus span { + background-position: -54px -279px; +} + +div.radio span.checked { + background-position: -72px -279px; +} + +div.radio:active span.checked, +div.radio.active span.checked { + background-position: -90px -279px; +} + +div.radio.focus span.checked, div.radio:hover span.checked { + background-position: -108px -279px; +} + +div.radio.focus:active span.checked, +div.radio:hover:active span.checked, +div.radio.focus.active span.checked, +div.radio.active:hover span.checked { + background-position: -126px -279px; +} + +div.radio.disabled span, +div.radio.disabled:active span, +div.radio.disabled.active span { + background-position: -144px -279px; +} + +div.radio.disabled span.checked, +div.radio.disabled:active span.checked, +div.radio.disabled.active span.checked { + background-position: -162px -279px; +} + +/* Uploader */ + +div.uploader { + background-position: 0px -297px; + height: 28px; +} + +div.uploader span.action { + background-position: right -409px; + height: 24px; + line-height: 24px; +} + +div.uploader span.filename { + height: 24px; + /* change this line to adjust positioning of filename area */ + margin: 2px 0px 2px 2px; + line-height: 24px; +} + +div.uploader.focus, +div.uploader.hover, +div.uploader:hover { + background-position: 0px -353px; +} + +div.uploader.focus span.action, +div.uploader.hover span.action, +div.uploader:hover span.action { + background-position: right -437px; +} + +div.uploader.active span.action, +div.uploader:active span.action { + background-position: right -465px; +} + +div.uploader.focus.active span.action, +div.uploader:focus.active span.action, +div.uploader.focus:active span.action, +div.uploader:focus:active span.action { + background-position: right -493px; +} + +div.uploader.disabled { + background-position: 0px -325px; +} + +div.uploader.disabled span.action { + background-position: right -381px; +} + +div.button { + background-position: 0px -523px; +} + +div.button span { + background-position: right -643px; +} + +div.button.focus, +div.button:focus, +div.button:hover, +div.button.hover { + background-position: 0px -553px; +} + +div.button.focus span, +div.button:focus span, +div.button:hover span, +div.button.hover span { + background-position: right -673px; +} + +div.button.active, +div.button:active { + background-position: 0px -583px; +} + +div.button.active span, +div.button:active span { + background-position: right -703px; + color: #555; +} + +div.button.disabled, +div.button:disabled { + background-position: 0px -613px; +} + +div.button.disabled span, +div.button:disabled span { + background-position: right -733px; + color: #bbb; + cursor: default; +} + +/* PRESENTATION */ + +/* Button */ + +div.button { + height: 30px; +} + +div.button span { + margin-left: 13px; + height: 22px; + padding-top: 8px; + font-weight: bold; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 12px; + letter-spacing: 1px; + text-transform: uppercase; + padding-left: 2px; + padding-right: 15px; +} + +/* Select */ +div.selector { + width: 190px; + font-size: 12px; +} + +div.selector select { + min-width: 190px; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 12px; + border: solid 1px #fff; +} + +div.selector span { + padding: 0px 25px 0px 2px; + cursor: pointer; +} + +div.selector span { + color: #666; + width: 158px; + text-shadow: 0 1px 0 #fff; +} + +div.selector.disabled span { + color: #bbb; +} + +/* Checker */ +div.checker { + margin-right: 5px; +} + +/* Radio */ +div.radio { + margin-right: 3px; +} + +/* Uploader */ +div.uploader { + width: 190px; + cursor: pointer; +} + +div.uploader span.action { + width: 85px; + text-align: center; + text-shadow: #fff 0px 1px 0px; + background-color: #fff; + font-size: 11px; + font-weight: bold; +} + +div.uploader span.filename { + color: #777; + width: 82px; + border-right: solid 1px #bbb; + font-size: 11px; +} + +div.uploader input { + width: 190px; +} + +div.uploader.disabled span.action { + color: #aaa; +} + +div.uploader.disabled span.filename { + border-color: #ddd; + color: #aaa; +} +/* + +CORE FUNCTIONALITY + +Not advised to edit stuff below this line +----------------------------------------------------- +*/ + +.selector, +.checker, +.button, +.radio, +.uploader { + display: -moz-inline-box; + display: inline-block; + vertical-align: middle; + zoom: 1; + *display: inline; +} + +.selector select:focus, .radio input:focus, .checker input:focus, .uploader input:focus { + outline: 0; +} + +/* Button */ + +div.button a, +div.button button, +div.button input { + position: absolute; +} + +div.button { + cursor: pointer; + position: relative; +} + +div.button span { + display: -moz-inline-box; + display: inline-block; + line-height: 1; + text-align: center; +} + +/* Select */ + +div.selector { + position: relative; + padding-left: 10px; + overflow: hidden; +} + +div.selector span { + display: block; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +div.selector select { + position: absolute; + opacity: 0; + filter: alpha(opacity:0); + height: 25px; + border: none; + background: none; +} + +/* Checker */ + +div.checker { + position: relative; +} + +div.checker span { + display: -moz-inline-box; + display: inline-block; + text-align: center; +} + +div.checker input { + opacity: 0; + filter: alpha(opacity:0); + display: inline-block; + background: none; +} + +/* Radio */ + +div.radio { + position: relative; +} + +div.radio span { + display: -moz-inline-box; + display: inline-block; + text-align: center; +} + +div.radio input { + opacity: 0; + filter: alpha(opacity:0); + text-align: center; + display: inline-block; + background: none; +} + +/* Uploader */ + +div.uploader { + position: relative; + overflow: hidden; + cursor: default; +} + +div.uploader span.action { + float: left; + display: inline; + padding: 2px 0px; + overflow: hidden; + cursor: pointer; +} + +div.uploader span.filename { + padding: 0px 10px; + float: left; + display: block; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + cursor: default; + position:relative; +} + +div.uploader input { + opacity: 0; + filter: alpha(opacity:0); + position: absolute; + top: 0; + right: 0; + bottom: 0; + float: right; + height: 25px; + border: none; + cursor: default; +} diff --git a/src/main/webapp/resources/font-awesome/css/Descr.WD3 b/src/main/webapp/resources/font-awesome/css/Descr.WD3 new file mode 100644 index 0000000000000000000000000000000000000000..331540eef186dc56f5fdbb493f35fe60b48685d8 Binary files /dev/null and b/src/main/webapp/resources/font-awesome/css/Descr.WD3 differ diff --git a/src/main/webapp/resources/font-awesome/css/font-awesome.css b/src/main/webapp/resources/font-awesome/css/font-awesome.css new file mode 100644 index 0000000000000000000000000000000000000000..496984924d3b614f17c419db316a0789c3d0a2d5 --- /dev/null +++ b/src/main/webapp/resources/font-awesome/css/font-awesome.css @@ -0,0 +1,469 @@ +/* Font Awesome 3.0 + the iconic font designed for use with Twitter Bootstrap + ------------------------------------------------------- + The full suite of pictographic icons, examples, and documentation + can be found at: http://fortawesome.github.com/Font-Awesome/ + + License + ------------------------------------------------------- + • The Font Awesome font is licensed under the SIL Open Font License - http://scripts.sil.org/OFL + • Font Awesome CSS, LESS, and SASS files are licensed under the MIT License - + http://opensource.org/licenses/mit-license.html + • The Font Awesome pictograms are licensed under the CC BY 3.0 License - http://creativecommons.org/licenses/by/3.0/ + • Attribution is no longer required in Font Awesome 3.0, but much appreciated: + "Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome" + + Contact + ------------------------------------------------------- + Email: dave@davegandy.com + Twitter: http://twitter.com/fortaweso_me + Work: Lead Product Designer @ http://kyruus.com + + */ +@font-face { + font-family: 'FontAwesome'; + src: url('../font/fontawesome-webfont.eot'); + src: url('../font/fontawesome-webfont.eot@#iefix') format('embedded-opentype'), + url('../font/fontawesome-webfont.woff') format('woff'), + url('../font/fontawesome-webfont.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} +/* Font Awesome styles + ------------------------------------------------------- */ +/* includes sprites.less reset */ +[class^="icon-"], +[class*=" icon-"] { + font-family: FontAwesome; + font-weight: normal; + font-style: normal; + text-decoration: inherit; + display: inline; + width: auto; + height: auto; + line-height: normal; + vertical-align: baseline; + background-image: none !important; + background-position: 0% 0%; + background-repeat: repeat; +} +[class^="icon-"]:before, +[class*=" icon-"]:before { + text-decoration: inherit; + display: inline-block; + speak: none; +} +/* makes sure icons active on rollover in links */ +a [class^="icon-"], +a [class*=" icon-"] { + display: inline-block; +} +/* makes the font 33% larger relative to the icon container */ +.icon-large:before { + vertical-align: -10%; + font-size: 1.3333333333333333em; +} +.btn [class^="icon-"], +.nav [class^="icon-"], +.btn [class*=" icon-"], +.nav [class*=" icon-"] { + display: inline; + /* keeps button heights with and without icons the same */ + + line-height: .6em; +} +.btn [class^="icon-"].icon-spin, +.nav [class^="icon-"].icon-spin, +.btn [class*=" icon-"].icon-spin, +.nav [class*=" icon-"].icon-spin { + display: inline-block; +} +li [class^="icon-"], +li [class*=" icon-"] { + display: inline-block; + width: 1.25em; + text-align: center; +} +li [class^="icon-"].icon-large, +li [class*=" icon-"].icon-large { + /* increased font size for icon-large */ + + width: 1.5625em; +} +ul.icons { + list-style-type: none; + text-indent: -0.75em; +} +ul.icons li [class^="icon-"], +ul.icons li [class*=" icon-"] { + width: .75em; +} +.icon-muted { + color: #eeeeee; +} +.icon-border { + border: solid 1px #eeeeee; + padding: .2em .25em .15em; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.icon-2x { + font-size: 2em; +} +.icon-2x.icon-border { + border-width: 2px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.icon-3x { + font-size: 3em; +} +.icon-3x.icon-border { + border-width: 3px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; +} +.icon-4x { + font-size: 4em; +} +.icon-4x.icon-border { + border-width: 4px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; +} +.pull-right { + float: right; +} +.pull-left { + float: left; +} +[class^="icon-"].pull-left, +[class*=" icon-"].pull-left { + margin-right: .35em; +} +[class^="icon-"].pull-right, +[class*=" icon-"].pull-right { + margin-left: .35em; +} +.btn [class^="icon-"].pull-left.icon-2x, +.btn [class*=" icon-"].pull-left.icon-2x, +.btn [class^="icon-"].pull-right.icon-2x, +.btn [class*=" icon-"].pull-right.icon-2x { + margin-top: .35em; +} +.btn [class^="icon-"].icon-spin.icon-large, +.btn [class*=" icon-"].icon-spin.icon-large { + height: .75em; +} +.btn.btn-small [class^="icon-"].pull-left.icon-2x, +.btn.btn-small [class*=" icon-"].pull-left.icon-2x, +.btn.btn-small [class^="icon-"].pull-right.icon-2x, +.btn.btn-small [class*=" icon-"].pull-right.icon-2x { + margin-top: .45em; +} +.btn.btn-large [class^="icon-"].pull-left.icon-2x, +.btn.btn-large [class*=" icon-"].pull-left.icon-2x, +.btn.btn-large [class^="icon-"].pull-right.icon-2x, +.btn.btn-large [class*=" icon-"].pull-right.icon-2x { + margin-top: .2em; +} +.icon-spin { + display: inline-block; + -moz-animation: spin 2s infinite linear; + -o-animation: spin 2s infinite linear; + -webkit-animation: spin 2s infinite linear; + animation: spin 2s infinite linear; +} +@-moz-keyframes spin { + 0% { -moz-transform: rotate(0deg); } + 100% { -moz-transform: rotate(359deg); } +} +@-webkit-keyframes spin { + 0% { -webkit-transform: rotate(0deg); } + 100% { -webkit-transform: rotate(359deg); } +} +@-o-keyframes spin { + 0% { -o-transform: rotate(0deg); } + 100% { -o-transform: rotate(359deg); } +} +@-ms-keyframes spin { + 0% { -ms-transform: rotate(0deg); } + 100% { -ms-transform: rotate(359deg); } +} +@keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(359deg); } +} +/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen + readers do not read off random characters that represent icons */ +.icon-glass:before { content: "\f000"; } +.icon-music:before { content: "\f001"; } +.icon-search:before { content: "\f002"; } +.icon-envelope:before { content: "\f003"; } +.icon-heart:before { content: "\f004"; } +.icon-star:before { content: "\f005"; } +.icon-star-empty:before { content: "\f006"; } +.icon-user:before { content: "\f007"; } +.icon-film:before { content: "\f008"; } +.icon-th-large:before { content: "\f009"; } +.icon-th:before { content: "\f00a"; } +.icon-th-list:before { content: "\f00b"; } +.icon-ok:before { content: "\f00c"; } +.icon-remove:before { content: "\f00d"; } +.icon-zoom-in:before { content: "\f00e"; } + +.icon-zoom-out:before { content: "\f010"; } +.icon-off:before { content: "\f011"; } +.icon-signal:before { content: "\f012"; } +.icon-cog:before { content: "\f013"; } +.icon-trash:before { content: "\f014"; } +.icon-home:before { content: "\f015"; } +.icon-file:before { content: "\f016"; } +.icon-time:before { content: "\f017"; } +.icon-road:before { content: "\f018"; } +.icon-download-alt:before { content: "\f019"; } +.icon-download:before { content: "\f01a"; } +.icon-upload:before { content: "\f01b"; } +.icon-inbox:before { content: "\f01c"; } +.icon-play-circle:before { content: "\f01d"; } +.icon-repeat:before { content: "\f01e"; } + +/* \f020 doesn't work in Safari. all shifted one down */ +.icon-refresh:before { content: "\f021"; } +.icon-list-alt:before { content: "\f022"; } +.icon-lock:before { content: "\f023"; } +.icon-flag:before { content: "\f024"; } +.icon-headphones:before { content: "\f025"; } +.icon-volume-off:before { content: "\f026"; } +.icon-volume-down:before { content: "\f027"; } +.icon-volume-up:before { content: "\f028"; } +.icon-qrcode:before { content: "\f029"; } +.icon-barcode:before { content: "\f02a"; } +.icon-tag:before { content: "\f02b"; } +.icon-tags:before { content: "\f02c"; } +.icon-book:before { content: "\f02d"; } +.icon-bookmark:before { content: "\f02e"; } +.icon-print:before { content: "\f02f"; } + +.icon-camera:before { content: "\f030"; } +.icon-font:before { content: "\f031"; } +.icon-bold:before { content: "\f032"; } +.icon-italic:before { content: "\f033"; } +.icon-text-height:before { content: "\f034"; } +.icon-text-width:before { content: "\f035"; } +.icon-align-left:before { content: "\f036"; } +.icon-align-center:before { content: "\f037"; } +.icon-align-right:before { content: "\f038"; } +.icon-align-justify:before { content: "\f039"; } +.icon-list:before { content: "\f03a"; } +.icon-indent-left:before { content: "\f03b"; } +.icon-indent-right:before { content: "\f03c"; } +.icon-facetime-video:before { content: "\f03d"; } +.icon-picture:before { content: "\f03e"; } + +.icon-pencil:before { content: "\f040"; } +.icon-map-marker:before { content: "\f041"; } +.icon-adjust:before { content: "\f042"; } +.icon-tint:before { content: "\f043"; } +.icon-edit:before { content: "\f044"; } +.icon-share:before { content: "\f045"; } +.icon-check:before { content: "\f046"; } +.icon-move:before { content: "\f047"; } +.icon-step-backward:before { content: "\f048"; } +.icon-fast-backward:before { content: "\f049"; } +.icon-backward:before { content: "\f04a"; } +.icon-play:before { content: "\f04b"; } +.icon-pause:before { content: "\f04c"; } +.icon-stop:before { content: "\f04d"; } +.icon-forward:before { content: "\f04e"; } + +.icon-fast-forward:before { content: "\f050"; } +.icon-step-forward:before { content: "\f051"; } +.icon-eject:before { content: "\f052"; } +.icon-chevron-left:before { content: "\f053"; } +.icon-chevron-right:before { content: "\f054"; } +.icon-plus-sign:before { content: "\f055"; } +.icon-minus-sign:before { content: "\f056"; } +.icon-remove-sign:before { content: "\f057"; } +.icon-ok-sign:before { content: "\f058"; } +.icon-question-sign:before { content: "\f059"; } +.icon-info-sign:before { content: "\f05a"; } +.icon-screenshot:before { content: "\f05b"; } +.icon-remove-circle:before { content: "\f05c"; } +.icon-ok-circle:before { content: "\f05d"; } +.icon-ban-circle:before { content: "\f05e"; } + +.icon-arrow-left:before { content: "\f060"; } +.icon-arrow-right:before { content: "\f061"; } +.icon-arrow-up:before { content: "\f062"; } +.icon-arrow-down:before { content: "\f063"; } +.icon-share-alt:before { content: "\f064"; } +.icon-resize-full:before { content: "\f065"; } +.icon-resize-small:before { content: "\f066"; } +.icon-plus:before { content: "\f067"; } +.icon-minus:before { content: "\f068"; } +.icon-asterisk:before { content: "\f069"; } +.icon-exclamation-sign:before { content: "\f06a"; } +.icon-gift:before { content: "\f06b"; } +.icon-leaf:before { content: "\f06c"; } +.icon-fire:before { content: "\f06d"; } +.icon-eye-open:before { content: "\f06e"; } + +.icon-eye-close:before { content: "\f070"; } +.icon-warning-sign:before { content: "\f071"; } +.icon-plane:before { content: "\f072"; } +.icon-calendar:before { content: "\f073"; } +.icon-random:before { content: "\f074"; } +.icon-comment:before { content: "\f075"; } +.icon-magnet:before { content: "\f076"; } +.icon-chevron-up:before { content: "\f077"; } +.icon-chevron-down:before { content: "\f078"; } +.icon-retweet:before { content: "\f079"; } +.icon-shopping-cart:before { content: "\f07a"; } +.icon-folder-close:before { content: "\f07b"; } +.icon-folder-open:before { content: "\f07c"; } +.icon-resize-vertical:before { content: "\f07d"; } +.icon-resize-horizontal:before { content: "\f07e"; } + +.icon-bar-chart:before { content: "\f080"; } +.icon-twitter-sign:before { content: "\f081"; } +.icon-facebook-sign:before { content: "\f082"; } +.icon-camera-retro:before { content: "\f083"; } +.icon-key:before { content: "\f084"; } +.icon-cogs:before { content: "\f085"; } +.icon-comments:before { content: "\f086"; } +.icon-thumbs-up:before { content: "\f087"; } +.icon-thumbs-down:before { content: "\f088"; } +.icon-star-half:before { content: "\f089"; } +.icon-heart-empty:before { content: "\f08a"; } +.icon-signout:before { content: "\f08b"; } +.icon-linkedin-sign:before { content: "\f08c"; } +.icon-pushpin:before { content: "\f08d"; } +.icon-external-link:before { content: "\f08e"; } + +.icon-signin:before { content: "\f090"; } +.icon-trophy:before { content: "\f091"; } +.icon-github-sign:before { content: "\f092"; } +.icon-upload-alt:before { content: "\f093"; } +.icon-lemon:before { content: "\f094"; } +.icon-phone:before { content: "\f095"; } +.icon-check-empty:before { content: "\f096"; } +.icon-bookmark-empty:before { content: "\f097"; } +.icon-phone-sign:before { content: "\f098"; } +.icon-twitter:before { content: "\f099"; } +.icon-facebook:before { content: "\f09a"; } +.icon-github:before { content: "\f09b"; } +.icon-unlock:before { content: "\f09c"; } +.icon-credit-card:before { content: "\f09d"; } +.icon-rss:before { content: "\f09e"; } + +.icon-hdd:before { content: "\f0a0"; } +.icon-bullhorn:before { content: "\f0a1"; } +.icon-bell:before { content: "\f0a2"; } +.icon-certificate:before { content: "\f0a3"; } +.icon-hand-right:before { content: "\f0a4"; } +.icon-hand-left:before { content: "\f0a5"; } +.icon-hand-up:before { content: "\f0a6"; } +.icon-hand-down:before { content: "\f0a7"; } +.icon-circle-arrow-left:before { content: "\f0a8"; } +.icon-circle-arrow-right:before { content: "\f0a9"; } +.icon-circle-arrow-up:before { content: "\f0aa"; } +.icon-circle-arrow-down:before { content: "\f0ab"; } +.icon-globe:before { content: "\f0ac"; } +.icon-wrench:before { content: "\f0ad"; } +.icon-tasks:before { content: "\f0ae"; } + +.icon-filter:before { content: "\f0b0"; } +.icon-briefcase:before { content: "\f0b1"; } +.icon-fullscreen:before { content: "\f0b2"; } + +.icon-group:before { content: "\f0c0"; } +.icon-link:before { content: "\f0c1"; } +.icon-cloud:before { content: "\f0c2"; } +.icon-beaker:before { content: "\f0c3"; } +.icon-cut:before { content: "\f0c4"; } +.icon-copy:before { content: "\f0c5"; } +.icon-paper-clip:before { content: "\f0c6"; } +.icon-save:before { content: "\f0c7"; } +.icon-sign-blank:before { content: "\f0c8"; } +.icon-reorder:before { content: "\f0c9"; } +.icon-list-ul:before { content: "\f0ca"; } +.icon-list-ol:before { content: "\f0cb"; } +.icon-strikethrough:before { content: "\f0cc"; } +.icon-underline:before { content: "\f0cd"; } +.icon-table:before { content: "\f0ce"; } + +.icon-magic:before { content: "\f0d0"; } +.icon-truck:before { content: "\f0d1"; } +.icon-pinterest:before { content: "\f0d2"; } +.icon-pinterest-sign:before { content: "\f0d3"; } +.icon-google-plus-sign:before { content: "\f0d4"; } +.icon-google-plus:before { content: "\f0d5"; } +.icon-money:before { content: "\f0d6"; } +.icon-caret-down:before { content: "\f0d7"; } +.icon-caret-up:before { content: "\f0d8"; } +.icon-caret-left:before { content: "\f0d9"; } +.icon-caret-right:before { content: "\f0da"; } +.icon-columns:before { content: "\f0db"; } +.icon-sort:before { content: "\f0dc"; } +.icon-sort-down:before { content: "\f0dd"; } +.icon-sort-up:before { content: "\f0de"; } + +.icon-envelope-alt:before { content: "\f0e0"; } +.icon-linkedin:before { content: "\f0e1"; } +.icon-undo:before { content: "\f0e2"; } +.icon-legal:before { content: "\f0e3"; } +.icon-dashboard:before { content: "\f0e4"; } +.icon-comment-alt:before { content: "\f0e5"; } +.icon-comments-alt:before { content: "\f0e6"; } +.icon-bolt:before { content: "\f0e7"; } +.icon-sitemap:before { content: "\f0e8"; } +.icon-umbrella:before { content: "\f0e9"; } +.icon-paste:before { content: "\f0ea"; } +.icon-lightbulb:before { content: "\f0eb"; } +.icon-exchange:before { content: "\f0ec"; } +.icon-cloud-download:before { content: "\f0ed"; } +.icon-cloud-upload:before { content: "\f0ee"; } + +.icon-user-md:before { content: "\f0f0"; } +.icon-stethoscope:before { content: "\f0f1"; } +.icon-suitcase:before { content: "\f0f2"; } +.icon-bell-alt:before { content: "\f0f3"; } +.icon-coffee:before { content: "\f0f4"; } +.icon-food:before { content: "\f0f5"; } +.icon-file-alt:before { content: "\f0f6"; } +.icon-building:before { content: "\f0f7"; } +.icon-hospital:before { content: "\f0f8"; } +.icon-ambulance:before { content: "\f0f9"; } +.icon-medkit:before { content: "\f0fa"; } +.icon-fighter-jet:before { content: "\f0fb"; } +.icon-beer:before { content: "\f0fc"; } +.icon-h-sign:before { content: "\f0fd"; } +.icon-plus-sign-alt:before { content: "\f0fe"; } + +.icon-double-angle-left:before { content: "\f100"; } +.icon-double-angle-right:before { content: "\f101"; } +.icon-double-angle-up:before { content: "\f102"; } +.icon-double-angle-down:before { content: "\f103"; } +.icon-angle-left:before { content: "\f104"; } +.icon-angle-right:before { content: "\f105"; } +.icon-angle-up:before { content: "\f106"; } +.icon-angle-down:before { content: "\f107"; } +.icon-desktop:before { content: "\f108"; } +.icon-laptop:before { content: "\f109"; } +.icon-tablet:before { content: "\f10a"; } +.icon-mobile-phone:before { content: "\f10b"; } +.icon-circle-blank:before { content: "\f10c"; } +.icon-quote-left:before { content: "\f10d"; } +.icon-quote-right:before { content: "\f10e"; } + +.icon-spinner:before { content: "\f110"; } +.icon-circle:before { content: "\f111"; } +.icon-reply:before { content: "\f112"; } +.icon-github-alt:before { content: "\f113"; } +.icon-folder-close-alt:before { content: "\f114"; } +.icon-folder-open-alt:before { content: "\f115"; } diff --git a/src/main/webapp/resources/font-awesome/font/Descr.WD3 b/src/main/webapp/resources/font-awesome/font/Descr.WD3 new file mode 100644 index 0000000000000000000000000000000000000000..6808d4811caf6a50a080f32e709c3fa0e54af0ef Binary files /dev/null and b/src/main/webapp/resources/font-awesome/font/Descr.WD3 differ diff --git a/src/main/webapp/resources/font-awesome/font/fontawesome-webfont.eot b/src/main/webapp/resources/font-awesome/font/fontawesome-webfont.eot new file mode 100644 index 0000000000000000000000000000000000000000..7d81019e4f174caaf5ccd785fc361f6bff196b53 Binary files /dev/null and b/src/main/webapp/resources/font-awesome/font/fontawesome-webfont.eot differ diff --git a/src/main/webapp/resources/font-awesome/font/fontawesome-webfont.eot@ b/src/main/webapp/resources/font-awesome/font/fontawesome-webfont.eot@ new file mode 100644 index 0000000000000000000000000000000000000000..7d81019e4f174caaf5ccd785fc361f6bff196b53 Binary files /dev/null and b/src/main/webapp/resources/font-awesome/font/fontawesome-webfont.eot@ differ diff --git a/src/main/webapp/resources/font-awesome/font/fontawesome-webfont.ttf b/src/main/webapp/resources/font-awesome/font/fontawesome-webfont.ttf new file mode 100644 index 0000000000000000000000000000000000000000..d46172476a3c7caf4f44946e3c40218559f3edfa Binary files /dev/null and b/src/main/webapp/resources/font-awesome/font/fontawesome-webfont.ttf differ diff --git a/src/main/webapp/resources/font-awesome/font/fontawesome-webfont.woff b/src/main/webapp/resources/font-awesome/font/fontawesome-webfont.woff new file mode 100644 index 0000000000000000000000000000000000000000..3c89ae09b88b38d3bc8563ca69f7f401b7301f45 Binary files /dev/null and b/src/main/webapp/resources/font-awesome/font/fontawesome-webfont.woff differ diff --git a/src/main/webapp/resources/font/fontello.eot b/src/main/webapp/resources/font/fontello.eot new file mode 100644 index 0000000000000000000000000000000000000000..d00285750745c9a2677a93153b7d8032f5b02789 Binary files /dev/null and b/src/main/webapp/resources/font/fontello.eot differ diff --git a/src/main/webapp/resources/font/fontello.svg b/src/main/webapp/resources/font/fontello.svg new file mode 100644 index 0000000000000000000000000000000000000000..db06416b0036d6cc1d97c3bacf6011ca8c206fcd --- /dev/null +++ b/src/main/webapp/resources/font/fontello.svg @@ -0,0 +1,64 @@ + + + +Copyright (C) 2018 by original authors @ fontello.com + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/resources/font/fontello.ttf b/src/main/webapp/resources/font/fontello.ttf new file mode 100644 index 0000000000000000000000000000000000000000..3676c9900515e2859848be1e61bf78c5d96069fe Binary files /dev/null and b/src/main/webapp/resources/font/fontello.ttf differ diff --git a/src/main/webapp/resources/font/fontello.woff b/src/main/webapp/resources/font/fontello.woff new file mode 100644 index 0000000000000000000000000000000000000000..05a3ae4378c1e47eaf1bfe0d438c5338161a650c Binary files /dev/null and b/src/main/webapp/resources/font/fontello.woff differ diff --git a/src/main/webapp/resources/font/fontello.woff2 b/src/main/webapp/resources/font/fontello.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..9eeed0d4f0f678ab6afe13b896e1a222a7450c4f Binary files /dev/null and b/src/main/webapp/resources/font/fontello.woff2 differ diff --git a/src/main/webapp/resources/images/.DS_Store b/src/main/webapp/resources/images/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..ad15ae628217ba3f10a57f0ee461c1fa2e75df41 Binary files /dev/null and b/src/main/webapp/resources/images/.DS_Store differ diff --git a/src/main/webapp/resources/images/backgrounds/Descr.WD3 b/src/main/webapp/resources/images/backgrounds/Descr.WD3 new file mode 100644 index 0000000000000000000000000000000000000000..072db7a9de7de6e10e0485b4e3ffb62ef83571c7 Binary files /dev/null and b/src/main/webapp/resources/images/backgrounds/Descr.WD3 differ diff --git a/src/main/webapp/resources/images/backgrounds/blank2 b/src/main/webapp/resources/images/backgrounds/blank2 new file mode 100644 index 0000000000000000000000000000000000000000..398700e09c4ec3745bd38b7d5e8d77b9a6facbb5 Binary files /dev/null and b/src/main/webapp/resources/images/backgrounds/blank2 differ diff --git a/src/main/webapp/resources/images/backgrounds/calActiveBg.html b/src/main/webapp/resources/images/backgrounds/calActiveBg.html new file mode 100644 index 0000000000000000000000000000000000000000..1730507810d929691a01b948f2483f2c1b6a61d7 --- /dev/null +++ b/src/main/webapp/resources/images/backgrounds/calActiveBg.html @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + Page not found - Theme Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+
+ + +
+
+ +

404 Not Found

+

Apologies, but the page you requested could not be found. Perhaps searching will help.

+
+

+

+
+ + +
+
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/resources/images/backgrounds/skype_3Asuniljoshi19@call b/src/main/webapp/resources/images/backgrounds/skype_3Asuniljoshi19@call new file mode 100644 index 0000000000000000000000000000000000000000..1730507810d929691a01b948f2483f2c1b6a61d7 --- /dev/null +++ b/src/main/webapp/resources/images/backgrounds/skype_3Asuniljoshi19@call @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + Page not found - Theme Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+
+ + +
+
+ +

404 Not Found

+

Apologies, but the page you requested could not be found. Perhaps searching will help.

+
+

+

+
+ + +
+
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/resources/images/gallery/imgbox3.html b/src/main/webapp/resources/images/gallery/imgbox3.html new file mode 100644 index 0000000000000000000000000000000000000000..1229715285cd5f52b299a9dcf7936157626237ff --- /dev/null +++ b/src/main/webapp/resources/images/gallery/imgbox3.html @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + Page not found - Theme Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+
+ + +
+
+ +

404 Not Found

+

Apologies, but the page you requested could not be found. Perhaps searching will help.

+
+

+

+
+ + +
+
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/resources/img/.DS_Store b/src/main/webapp/resources/img/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..57777b4277f3c6394ee890cb885ca0fe0dbce7c4 Binary files /dev/null and b/src/main/webapp/resources/img/.DS_Store differ diff --git a/src/main/webapp/resources/img/Descr.WD3 b/src/main/webapp/resources/img/Descr.WD3 new file mode 100644 index 0000000000000000000000000000000000000000..e410f477eea631fb9cd550c3343221ab07d1bf3b Binary files /dev/null and b/src/main/webapp/resources/img/Descr.WD3 differ diff --git a/src/main/webapp/resources/img/alpha.html b/src/main/webapp/resources/img/alpha.html new file mode 100644 index 0000000000000000000000000000000000000000..1229715285cd5f52b299a9dcf7936157626237ff --- /dev/null +++ b/src/main/webapp/resources/img/alpha.html @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + Page not found - Theme Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+
+ + +
+
+ +

404 Not Found

+

Apologies, but the page you requested could not be found. Perhaps searching will help.

+
+

+

+
+ + +
+
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/resources/img/bg.jpg b/src/main/webapp/resources/img/bg.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7d6651de5bb56b42a349b56b684ead751a153e7c Binary files /dev/null and b/src/main/webapp/resources/img/bg.jpg differ diff --git a/src/main/webapp/resources/img/breadcrumb.png b/src/main/webapp/resources/img/breadcrumb.png new file mode 100644 index 0000000000000000000000000000000000000000..d3462402e4f803860a6b11fdc9bff76f7e3a955d Binary files /dev/null and b/src/main/webapp/resources/img/breadcrumb.png differ diff --git a/src/main/webapp/resources/img/default.png b/src/main/webapp/resources/img/default.png new file mode 100644 index 0000000000000000000000000000000000000000..581c3c23d378f0ca755ea091ee914aa0e274788b Binary files /dev/null and b/src/main/webapp/resources/img/default.png differ diff --git a/src/main/webapp/resources/img/demo/Descr.WD3 b/src/main/webapp/resources/img/demo/Descr.WD3 new file mode 100644 index 0000000000000000000000000000000000000000..9388fbf80f192d66b19c0f0d09ddf0d6bda335b4 Binary files /dev/null and b/src/main/webapp/resources/img/demo/Descr.WD3 differ diff --git a/src/main/webapp/resources/img/demo/av1.jpg b/src/main/webapp/resources/img/demo/av1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e3caaa76a520caca2e68f4f94c39bac7ad80a89e Binary files /dev/null and b/src/main/webapp/resources/img/demo/av1.jpg differ diff --git a/src/main/webapp/resources/img/demo/av2.jpg b/src/main/webapp/resources/img/demo/av2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..73bbe80b7e030676588c670387aa497c29cca419 Binary files /dev/null and b/src/main/webapp/resources/img/demo/av2.jpg differ diff --git a/src/main/webapp/resources/img/demo/av3.jpg b/src/main/webapp/resources/img/demo/av3.jpg new file mode 100644 index 0000000000000000000000000000000000000000..73eef408fd21e539eb6764bb697282e873e6a70a Binary files /dev/null and b/src/main/webapp/resources/img/demo/av3.jpg differ diff --git a/src/main/webapp/resources/img/demo/av4.jpg b/src/main/webapp/resources/img/demo/av4.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4271fc29b25813729dc874d6d4ef00cb6fc3d4af Binary files /dev/null and b/src/main/webapp/resources/img/demo/av4.jpg differ diff --git a/src/main/webapp/resources/img/demo/av5.jpg b/src/main/webapp/resources/img/demo/av5.jpg new file mode 100644 index 0000000000000000000000000000000000000000..dfa24fa5ab3ba4873690e49d2a5cd46ad579d340 Binary files /dev/null and b/src/main/webapp/resources/img/demo/av5.jpg differ diff --git a/src/main/webapp/resources/img/demo/demo-image1.jpg b/src/main/webapp/resources/img/demo/demo-image1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a4a2191cc5e1bc0bf46bd90005dd24faa6f2e8b8 Binary files /dev/null and b/src/main/webapp/resources/img/demo/demo-image1.jpg differ diff --git a/src/main/webapp/resources/img/demo/demo-image2.jpg b/src/main/webapp/resources/img/demo/demo-image2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..3e63af85b568b77125a776a09fe6660d3d2aca31 Binary files /dev/null and b/src/main/webapp/resources/img/demo/demo-image2.jpg differ diff --git a/src/main/webapp/resources/img/demo/demo-image3.jpg b/src/main/webapp/resources/img/demo/demo-image3.jpg new file mode 100644 index 0000000000000000000000000000000000000000..079da312559e982ce42cc2d27da7bf433c85a6b8 Binary files /dev/null and b/src/main/webapp/resources/img/demo/demo-image3.jpg differ diff --git a/src/main/webapp/resources/img/demo/envelope.png b/src/main/webapp/resources/img/demo/envelope.png new file mode 100644 index 0000000000000000000000000000000000000000..78c131c0ff2bf69fc04e537076ecc408c020cbb6 Binary files /dev/null and b/src/main/webapp/resources/img/demo/envelope.png differ diff --git a/src/main/webapp/resources/img/gallery/Descr.WD3 b/src/main/webapp/resources/img/gallery/Descr.WD3 new file mode 100644 index 0000000000000000000000000000000000000000..8ce58a45706c438fef50f4d35bac8d509205a708 Binary files /dev/null and b/src/main/webapp/resources/img/gallery/Descr.WD3 differ diff --git a/src/main/webapp/resources/img/gallery/imgbox1.jpg b/src/main/webapp/resources/img/gallery/imgbox1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ba58811c73f31fd2ee98dc13988d70c2073264f8 Binary files /dev/null and b/src/main/webapp/resources/img/gallery/imgbox1.jpg differ diff --git a/src/main/webapp/resources/img/gallery/imgbox2.jpg b/src/main/webapp/resources/img/gallery/imgbox2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f3dba1a5076b0f95323bfb158be130fff03275c7 Binary files /dev/null and b/src/main/webapp/resources/img/gallery/imgbox2.jpg differ diff --git a/src/main/webapp/resources/img/gallery/imgbox3.jpg b/src/main/webapp/resources/img/gallery/imgbox3.jpg new file mode 100644 index 0000000000000000000000000000000000000000..182e7cbedf27d071bce4dcbe4965fa428e6f9e7f Binary files /dev/null and b/src/main/webapp/resources/img/gallery/imgbox3.jpg differ diff --git a/src/main/webapp/resources/img/gallery/imgbox4.jpg b/src/main/webapp/resources/img/gallery/imgbox4.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a2278036fe38014d1c5861f79e15c434a877d436 Binary files /dev/null and b/src/main/webapp/resources/img/gallery/imgbox4.jpg differ diff --git a/src/main/webapp/resources/img/gallery/imgbox5.jpg b/src/main/webapp/resources/img/gallery/imgbox5.jpg new file mode 100644 index 0000000000000000000000000000000000000000..aa60cc5520f86328e5a5e7a58932603eb37a0ccd Binary files /dev/null and b/src/main/webapp/resources/img/gallery/imgbox5.jpg differ diff --git a/src/main/webapp/resources/img/glyphicons-halflings-white.png b/src/main/webapp/resources/img/glyphicons-halflings-white.png new file mode 100644 index 0000000000000000000000000000000000000000..3bf6484a29d8da269f9bc874b25493a45fae3bae Binary files /dev/null and b/src/main/webapp/resources/img/glyphicons-halflings-white.png differ diff --git a/src/main/webapp/resources/img/glyphicons-halflings.html b/src/main/webapp/resources/img/glyphicons-halflings.html new file mode 100644 index 0000000000000000000000000000000000000000..1229715285cd5f52b299a9dcf7936157626237ff --- /dev/null +++ b/src/main/webapp/resources/img/glyphicons-halflings.html @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + Page not found - Theme Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+
+ + +
+
+ +

404 Not Found

+

Apologies, but the page you requested could not be found. Perhaps searching will help.

+
+

+

+
+ + +
+
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/resources/img/gritter.png b/src/main/webapp/resources/img/gritter.png new file mode 100644 index 0000000000000000000000000000000000000000..4b84bf78f5f5d49afedbf5863ecccdb8ae95a6f6 Binary files /dev/null and b/src/main/webapp/resources/img/gritter.png differ diff --git a/src/main/webapp/resources/img/hue.png b/src/main/webapp/resources/img/hue.png new file mode 100644 index 0000000000000000000000000000000000000000..75957d0509be44f3caf317b832e44307950b0415 Binary files /dev/null and b/src/main/webapp/resources/img/hue.png differ diff --git a/src/main/webapp/resources/img/icon.png b/src/main/webapp/resources/img/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..861e030c0a577a4079c320bd6f74322b96b5f07d Binary files /dev/null and b/src/main/webapp/resources/img/icon.png differ diff --git a/src/main/webapp/resources/img/larrow.png b/src/main/webapp/resources/img/larrow.png new file mode 100644 index 0000000000000000000000000000000000000000..a4a736809a1179d8b7741410ea3a8da0307fb223 Binary files /dev/null and b/src/main/webapp/resources/img/larrow.png differ diff --git a/src/main/webapp/resources/img/line.png b/src/main/webapp/resources/img/line.png new file mode 100644 index 0000000000000000000000000000000000000000..ef73f83f89755fb6894750705ce7d1b7af2bd9b0 Binary files /dev/null and b/src/main/webapp/resources/img/line.png differ diff --git a/src/main/webapp/resources/img/logo.png b/src/main/webapp/resources/img/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..e1a4565c211a83ebd00b19309fc7e6e39e320f7b Binary files /dev/null and b/src/main/webapp/resources/img/logo.png differ diff --git a/src/main/webapp/resources/img/logoer.png b/src/main/webapp/resources/img/logoer.png new file mode 100644 index 0000000000000000000000000000000000000000..6f3157942a279495aad476c8f966ce138b536595 Binary files /dev/null and b/src/main/webapp/resources/img/logoer.png differ diff --git a/src/main/webapp/resources/img/menu-active.png b/src/main/webapp/resources/img/menu-active.png new file mode 100644 index 0000000000000000000000000000000000000000..a62bbebd33e62993bc5f77af5a6cd87819223d61 Binary files /dev/null and b/src/main/webapp/resources/img/menu-active.png differ diff --git a/src/main/webapp/resources/img/rarrow.png b/src/main/webapp/resources/img/rarrow.png new file mode 100644 index 0000000000000000000000000000000000000000..1c9fdf832907b3ff66aee1f8bba36358f6781bd6 Binary files /dev/null and b/src/main/webapp/resources/img/rarrow.png differ diff --git a/src/main/webapp/resources/img/saturation.png b/src/main/webapp/resources/img/saturation.png new file mode 100644 index 0000000000000000000000000000000000000000..a5e7fcd9c7712465e027166a37c4e82929f7f4d4 Binary files /dev/null and b/src/main/webapp/resources/img/saturation.png differ diff --git a/src/main/webapp/resources/img/select2.png b/src/main/webapp/resources/img/select2.png new file mode 100644 index 0000000000000000000000000000000000000000..9ba2d825b11fc34196a78340f058a75217a7be18 Binary files /dev/null and b/src/main/webapp/resources/img/select2.png differ diff --git a/src/main/webapp/resources/img/spinner.gif b/src/main/webapp/resources/img/spinner.gif new file mode 100644 index 0000000000000000000000000000000000000000..5b33f7e54f4e55b6b8774d86d96895db9af044b4 Binary files /dev/null and b/src/main/webapp/resources/img/spinner.gif differ diff --git a/src/main/webapp/resources/img/sprite.png b/src/main/webapp/resources/img/sprite.png new file mode 100644 index 0000000000000000000000000000000000000000..c4b27c3e3cab676d3c0702d71ac3500f91c3cd67 Binary files /dev/null and b/src/main/webapp/resources/img/sprite.png differ diff --git a/src/main/webapp/resources/js/.DS_Store b/src/main/webapp/resources/js/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5be668f349f8545f8af8782ab57dae295f47f3a2 Binary files /dev/null and b/src/main/webapp/resources/js/.DS_Store differ diff --git a/src/main/webapp/resources/js/bootstrap-colorpicker.js b/src/main/webapp/resources/js/bootstrap-colorpicker.js new file mode 100644 index 0000000000000000000000000000000000000000..6a0fc8adba0aa401be5edef94e87f6dd17a762ba --- /dev/null +++ b/src/main/webapp/resources/js/bootstrap-colorpicker.js @@ -0,0 +1,540 @@ +/* ========================================================= + * bootstrap-colorpicker.js + * http://www.eyecon.ro/bootstrap-colorpicker + * ========================================================= + * Copyright 2012 Stefan Petre + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================= */ + +!function( $ ) { + + // Color object + + var Color = function(val) { + this.value = { + h: 1, + s: 1, + b: 1, + a: 1 + }; + this.setColor(val); + }; + + Color.prototype = { + constructor: Color, + + //parse a string to HSB + setColor: function(val){ + val = val.toLowerCase(); + var that = this; + $.each( CPGlobal.stringParsers, function( i, parser ) { + var match = parser.re.exec( val ), + values = match && parser.parse( match ), + space = parser.space||'rgba'; + if ( values ) { + if (space === 'hsla') { + that.value = CPGlobal.RGBtoHSB.apply(null, CPGlobal.HSLtoRGB.apply(null, values)); + } else { + that.value = CPGlobal.RGBtoHSB.apply(null, values); + } + return false; + } + }); + }, + + setHue: function(h) { + this.value.h = 1- h; + }, + + setSaturation: function(s) { + this.value.s = s; + }, + + setLightness: function(b) { + this.value.b = 1- b; + }, + + setAlpha: function(a) { + this.value.a = parseInt((1 - a)*100, 10)/100; + }, + + // HSBtoRGB from RaphaelJS + // https://github.com/DmitryBaranovskiy/raphael/ + toRGB: function(h, s, b, a) { + if (!h) { + h = this.value.h; + s = this.value.s; + b = this.value.b; + } + h *= 360; + var R, G, B, X, C; + h = (h % 360) / 60; + C = b * s; + X = C * (1 - Math.abs(h % 2 - 1)); + R = G = B = b - C; + + h = ~~h; + R += [C, X, 0, 0, X, C][h]; + G += [X, C, C, X, 0, 0][h]; + B += [0, 0, X, C, C, X][h]; + return { + r: Math.round(R*255), + g: Math.round(G*255), + b: Math.round(B*255), + a: a||this.value.a + }; + }, + + toHex: function(h, s, b, a){ + var rgb = this.toRGB(h, s, b, a); + return '#'+((1 << 24) | (parseInt(rgb.r) << 16) | (parseInt(rgb.g) << 8) | parseInt(rgb.b)).toString(16).substr(1); + }, + + toHSL: function(h, s, b, a){ + if (!h) { + h = this.value.h; + s = this.value.s; + b = this.value.b; + } + var H = h, + L = (2 - s) * b, + S = s * b; + if (L > 0 && L <= 1) { + S /= L; + } else { + S /= 2 - L; + } + L /= 2; + if (S > 1) { + S = 1; + } + return { + h: H, + s: S, + l: L, + a: a||this.value.a + }; + } + }; + + // Picker object + + var Colorpicker = function(element, options){ + this.element = $(element); + var format = options.format||this.element.data('color-format')||'hex'; + this.format = CPGlobal.translateFormats[format]; + this.isInput = this.element.is('input'); + this.component = this.element.is('.color') ? this.element.find('.add-on') : false; + + this.picker = $(CPGlobal.template) + .appendTo('body') + .on('mousedown', $.proxy(this.mousedown, this)); + + if (this.isInput) { + this.element.on({ + 'focus': $.proxy(this.show, this), + 'keyup': $.proxy(this.update, this) + }); + } else if (this.component){ + this.component.on({ + 'click': $.proxy(this.show, this) + }); + } else { + this.element.on({ + 'click': $.proxy(this.show, this) + }); + } + if (format === 'rgba' || format === 'hsla') { + this.picker.addClass('alpha'); + this.alpha = this.picker.find('.colorpicker-alpha')[0].style; + } + + if (this.component){ + this.picker.find('.colorpicker-color').hide(); + this.preview = this.element.find('i')[0].style; + } else { + this.preview = this.picker.find('div:last')[0].style; + } + + this.base = this.picker.find('div:first')[0].style; + this.update(); + }; + + Colorpicker.prototype = { + constructor: Colorpicker, + + show: function(e) { + this.picker.show(); + this.height = this.component ? this.component.outerHeight() : this.element.outerHeight(); + this.place(); + $(window).on('resize', $.proxy(this.place, this)); + if (!this.isInput) { + if (e) { + e.stopPropagation(); + e.preventDefault(); + } + } + $(document).on({ + 'mousedown': $.proxy(this.hide, this) + }); + this.element.trigger({ + type: 'show', + color: this.color + }); + }, + + update: function(){ + this.color = new Color(this.isInput ? this.element.prop('value') : this.element.data('color')); + this.picker.find('i') + .eq(0).css({left: this.color.value.s*100, top: 100 - this.color.value.b*100}).end() + .eq(1).css('top', 100 * (1 - this.color.value.h)).end() + .eq(2).css('top', 100 * (1 - this.color.value.a)); + this.previewColor(); + }, + + setValue: function(newColor) { + this.color = new Color(newColor); + this.picker.find('i') + .eq(0).css({left: this.color.value.s*100, top: 100 - this.color.value.b*100}).end() + .eq(1).css('top', 100 * (1 - this.color.value.h)).end() + .eq(2).css('top', 100 * (1 - this.color.value.a)); + this.previewColor(); + this.element.trigger({ + type: 'changeColor', + color: this.color + }); + }, + + hide: function(){ + this.picker.hide(); + $(window).off('resize', this.place); + if (!this.isInput) { + $(document).off({ + 'mousedown': this.hide + }); + if (this.component){ + this.element.find('input').prop('value', this.format.call(this)); + } + this.element.data('color', this.format.call(this)); + } else { + this.element.prop('value', this.format.call(this)); + } + this.element.trigger({ + type: 'hide', + color: this.color + }); + }, + + place: function(){ + var offset = this.component ? this.component.offset() : this.element.offset(); + this.picker.css({ + top: offset.top + this.height, + left: offset.left + }); + }, + + //preview color change + previewColor: function(){ + try { + this.preview.backgroundColor = this.format.call(this); + } catch(e) { + this.preview.backgroundColor = this.color.toHex(); + } + //set the color for brightness/saturation slider + this.base.backgroundColor = this.color.toHex(this.color.value.h, 1, 1, 1); + //set te color for alpha slider + if (this.alpha) { + this.alpha.backgroundColor = this.color.toHex(); + } + }, + + pointer: null, + + slider: null, + + mousedown: function(e){ + e.stopPropagation(); + e.preventDefault(); + + var target = $(e.target); + + //detect the slider and set the limits and callbacks + var zone = target.closest('div'); + if (!zone.is('.colorpicker')) { + if (zone.is('.colorpicker-saturation')) { + this.slider = $.extend({}, CPGlobal.sliders.saturation); + } + else if (zone.is('.colorpicker-hue')) { + this.slider = $.extend({}, CPGlobal.sliders.hue); + } + else if (zone.is('.colorpicker-alpha')) { + this.slider = $.extend({}, CPGlobal.sliders.alpha); + } else { + return false; + } + var offset = zone.offset(); + //reference to knob's style + this.slider.knob = zone.find('i')[0].style; + this.slider.left = e.pageX - offset.left; + this.slider.top = e.pageY - offset.top; + this.pointer = { + left: e.pageX, + top: e.pageY + }; + //trigger mousemove to move the knob to the current position + $(document).on({ + mousemove: $.proxy(this.mousemove, this), + mouseup: $.proxy(this.mouseup, this) + }).trigger('mousemove'); + } + return false; + }, + + mousemove: function(e){ + e.stopPropagation(); + e.preventDefault(); + var left = Math.max( + 0, + Math.min( + this.slider.maxLeft, + this.slider.left + ((e.pageX||this.pointer.left) - this.pointer.left) + ) + ); + var top = Math.max( + 0, + Math.min( + this.slider.maxTop, + this.slider.top + ((e.pageY||this.pointer.top) - this.pointer.top) + ) + ); + this.slider.knob.left = left + 'px'; + this.slider.knob.top = top + 'px'; + if (this.slider.callLeft) { + this.color[this.slider.callLeft].call(this.color, left/100); + } + if (this.slider.callTop) { + this.color[this.slider.callTop].call(this.color, top/100); + } + this.previewColor(); + this.element.trigger({ + type: 'changeColor', + color: this.color + }); + return false; + }, + + mouseup: function(e){ + e.stopPropagation(); + e.preventDefault(); + $(document).off({ + mousemove: this.mousemove, + mouseup: this.mouseup + }); + return false; + } + } + + $.fn.colorpicker = function ( option ) { + return this.each(function () { + var $this = $(this), + data = $this.data('colorpicker'), + options = typeof option === 'object' && option; + if (!data) { + $this.data('colorpicker', (data = new Colorpicker(this, $.extend({}, $.fn.colorpicker.defaults,options)))); + } + if (typeof option === 'string') data[option](); + }); + }; + + $.fn.colorpicker.defaults = { + }; + + $.fn.colorpicker.Constructor = Colorpicker; + + var CPGlobal = { + + // translate a format from Color object to a string + translateFormats: { + 'rgb': function(){ + var rgb = this.color.toRGB(); + return 'rgb('+rgb.r+','+rgb.g+','+rgb.b+')'; + }, + + 'rgba': function(){ + var rgb = this.color.toRGB(); + return 'rgba('+rgb.r+','+rgb.g+','+rgb.b+','+rgb.a+')'; + }, + + 'hsl': function(){ + var hsl = this.color.toHSL(); + return 'hsl('+Math.round(hsl.h*360)+','+Math.round(hsl.s*100)+'%,'+Math.round(hsl.l*100)+'%)'; + }, + + 'hsla': function(){ + var hsl = this.color.toHSL(); + return 'hsla('+Math.round(hsl.h*360)+','+Math.round(hsl.s*100)+'%,'+Math.round(hsl.l*100)+'%,'+hsl.a+')'; + }, + + 'hex': function(){ + return this.color.toHex(); + } + }, + + sliders: { + saturation: { + maxLeft: 100, + maxTop: 100, + callLeft: 'setSaturation', + callTop: 'setLightness' + }, + + hue: { + maxLeft: 0, + maxTop: 100, + callLeft: false, + callTop: 'setHue' + }, + + alpha: { + maxLeft: 0, + maxTop: 100, + callLeft: false, + callTop: 'setAlpha' + } + }, + + // HSBtoRGB from RaphaelJS + // https://github.com/DmitryBaranovskiy/raphael/ + RGBtoHSB: function (r, g, b, a){ + r /= 255; + g /= 255; + b /= 255; + + var H, S, V, C; + V = Math.max(r, g, b); + C = V - Math.min(r, g, b); + H = (C === 0 ? null : + V == r ? (g - b) / C : + V == g ? (b - r) / C + 2 : + (r - g) / C + 4 + ); + H = ((H + 360) % 6) * 60 / 360; + S = C === 0 ? 0 : C / V; + return {h: H||1, s: S, b: V, a: a||1}; + }, + + HueToRGB: function (p, q, h) { + if (h < 0) + h += 1; + else if (h > 1) + h -= 1; + + if ((h * 6) < 1) + return p + (q - p) * h * 6; + else if ((h * 2) < 1) + return q; + else if ((h * 3) < 2) + return p + (q - p) * ((2 / 3) - h) * 6; + else + return p; + }, + + HSLtoRGB: function (h, s, l, a) + { + if (s < 0) { + s = 0; + } + var q; + if (l <= 0.5) { + q = l * (1 + s); + } else { + q = l + s - (l * s); + } + + var p = 2 * l - q; + + var tr = h + (1 / 3); + var tg = h; + var tb = h - (1 / 3); + + var r = Math.round(CPGlobal.HueToRGB(p, q, tr) * 255); + var g = Math.round(CPGlobal.HueToRGB(p, q, tg) * 255); + var b = Math.round(CPGlobal.HueToRGB(p, q, tb) * 255); + return [r, g, b, a||1]; + }, + + // a set of RE's that can match strings and generate color tuples. + // from John Resig color plugin + // https://github.com/jquery/jquery-color/ + stringParsers: [ + { + re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/, + parse: function( execResult ) { + return [ + execResult[ 1 ], + execResult[ 2 ], + execResult[ 3 ], + execResult[ 4 ] + ]; + } + }, { + re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/, + parse: function( execResult ) { + return [ + 2.55 * execResult[1], + 2.55 * execResult[2], + 2.55 * execResult[3], + execResult[ 4 ] + ]; + } + }, { + re: /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/, + parse: function( execResult ) { + return [ + parseInt( execResult[ 1 ], 16 ), + parseInt( execResult[ 2 ], 16 ), + parseInt( execResult[ 3 ], 16 ) + ]; + } + }, { + re: /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/, + parse: function( execResult ) { + return [ + parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ), + parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ), + parseInt( execResult[ 3 ] + execResult[ 3 ], 16 ) + ]; + } + }, { + re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/, + space: 'hsla', + parse: function( execResult ) { + return [ + execResult[1]/360, + execResult[2] / 100, + execResult[3] / 100, + execResult[4] + ]; + } + } + ], + template: '")}}if(aI.length>0){aI.push('
');aC=aH(aI,"width:10000px;");aG=aC.height();aC.remove()}}}else{if(aK==null||aG==null){for(aF=0;aF'+aE+"")}}if(aI.length>0){aC=aH(aI,"");if(aK==null){aK=aC.children().width()}if(aG==null){aG=aC.find("div.tickLabel").height()}aC.remove()}}}if(aK==null){aK=0}if(aG==null){aG=0}aD.labelWidth=aK;aD.labelHeight=aG}function au(aD){var aC=aD.labelWidth,aL=aD.labelHeight,aH=aD.options.position,aF=aD.options.tickLength,aG=O.grid.axisMargin,aJ=O.grid.labelMargin,aK=aD.direction=="x"?p:aw,aE;var aB=c.grep(aK,function(aN){return aN&&aN.options.position==aH&&aN.reserveSpace});if(c.inArray(aD,aB)==aB.length-1){aG=0}if(aF==null){aF="full"}var aI=c.grep(aK,function(aN){return aN&&aN.reserveSpace});var aM=c.inArray(aD,aI)==0;if(!aM&&aF=="full"){aF=5}if(!isNaN(+aF)){aJ+=+aF}if(aD.direction=="x"){aL+=aJ;if(aH=="bottom"){q.bottom+=aL+aG;aD.box={top:I-q.bottom,height:aL}}else{aD.box={top:q.top+aG,height:aL};q.top+=aL+aG}}else{aC+=aJ;if(aH=="left"){aD.box={left:q.left+aG,width:aC};q.left+=aC+aG}else{q.right+=aC+aG;aD.box={left:G-q.right,width:aC}}}aD.position=aH;aD.tickLength=aF;aD.box.padding=aJ;aD.innermost=aM}function U(aB){if(aB.direction=="x"){aB.box.left=q.left;aB.box.width=h}else{aB.box.top=q.top;aB.box.height=w}}function t(){var aC,aE=m();c.each(aE,function(aF,aG){aG.show=aG.options.show;if(aG.show==null){aG.show=aG.used}aG.reserveSpace=aG.show||aG.options.reserveSpace;n(aG)});allocatedAxes=c.grep(aE,function(aF){return aF.reserveSpace});q.left=q.right=q.top=q.bottom=0;if(O.grid.show){c.each(allocatedAxes,function(aF,aG){S(aG);P(aG);ap(aG,aG.ticks);L(aG)});for(aC=allocatedAxes.length-1;aC>=0;--aC){au(allocatedAxes[aC])}var aD=O.grid.minBorderMargin;if(aD==null){aD=0;for(aC=0;aC=0){aD=0}}if(aF.max==null){aB+=aH*aG;if(aB>0&&aE.datamax!=null&&aE.datamax<=0){aB=0}}}}aE.min=aD;aE.max=aB}function S(aG){var aM=aG.options;var aH;if(typeof aM.ticks=="number"&&aM.ticks>0){aH=aM.ticks}else{aH=0.3*Math.sqrt(aG.direction=="x"?G:I)}var aT=(aG.max-aG.min)/aH,aO,aB,aN,aR,aS,aQ,aI;if(aM.mode=="time"){var aJ={second:1000,minute:60*1000,hour:60*60*1000,day:24*60*60*1000,month:30*24*60*60*1000,year:365.2425*24*60*60*1000};var aK=[[1,"second"],[2,"second"],[5,"second"],[10,"second"],[30,"second"],[1,"minute"],[2,"minute"],[5,"minute"],[10,"minute"],[30,"minute"],[1,"hour"],[2,"hour"],[4,"hour"],[8,"hour"],[12,"hour"],[1,"day"],[2,"day"],[3,"day"],[0.25,"month"],[0.5,"month"],[1,"month"],[2,"month"],[3,"month"],[6,"month"],[1,"year"]];var aC=0;if(aM.minTickSize!=null){if(typeof aM.tickSize=="number"){aC=aM.tickSize}else{aC=aM.minTickSize[0]*aJ[aM.minTickSize[1]]}}for(var aS=0;aS=aC){break}}aO=aK[aS][0];aN=aK[aS][1];if(aN=="year"){aQ=Math.pow(10,Math.floor(Math.log(aT/aJ.year)/Math.LN10));aI=(aT/aJ.year)/aQ;if(aI<1.5){aO=1}else{if(aI<3){aO=2}else{if(aI<7.5){aO=5}else{aO=10}}}aO*=aQ}aG.tickSize=aM.tickSize||[aO,aN];aB=function(aX){var a2=[],a0=aX.tickSize[0],a3=aX.tickSize[1],a1=new Date(aX.min);var aW=a0*aJ[a3];if(a3=="second"){a1.setUTCSeconds(a(a1.getUTCSeconds(),a0))}if(a3=="minute"){a1.setUTCMinutes(a(a1.getUTCMinutes(),a0))}if(a3=="hour"){a1.setUTCHours(a(a1.getUTCHours(),a0))}if(a3=="month"){a1.setUTCMonth(a(a1.getUTCMonth(),a0))}if(a3=="year"){a1.setUTCFullYear(a(a1.getUTCFullYear(),a0))}a1.setUTCMilliseconds(0);if(aW>=aJ.minute){a1.setUTCSeconds(0)}if(aW>=aJ.hour){a1.setUTCMinutes(0)}if(aW>=aJ.day){a1.setUTCHours(0)}if(aW>=aJ.day*4){a1.setUTCDate(1)}if(aW>=aJ.year){a1.setUTCMonth(0)}var a5=0,a4=Number.NaN,aY;do{aY=a4;a4=a1.getTime();a2.push(a4);if(a3=="month"){if(a0<1){a1.setUTCDate(1);var aV=a1.getTime();a1.setUTCMonth(a1.getUTCMonth()+1);var aZ=a1.getTime();a1.setTime(a4+a5*aJ.hour+(aZ-aV)*a0);a5=a1.getUTCHours();a1.setUTCHours(0)}else{a1.setUTCMonth(a1.getUTCMonth()+a0)}}else{if(a3=="year"){a1.setUTCFullYear(a1.getUTCFullYear()+a0)}else{a1.setTime(a4+aW)}}}while(a4aU){aP=aU}aQ=Math.pow(10,-aP);aI=aT/aQ;if(aI<1.5){aO=1}else{if(aI<3){aO=2;if(aI>2.25&&(aU==null||aP+1<=aU)){aO=2.5;++aP}}else{if(aI<7.5){aO=5}else{aO=10}}}aO*=aQ;if(aM.minTickSize!=null&&aO0){if(aM.min==null){aG.min=Math.min(aG.min,aL[0])}if(aM.max==null&&aL.length>1){aG.max=Math.max(aG.max,aL[aL.length-1])}}aB=function(aX){var aY=[],aV,aW;for(aW=0;aW1&&/\..*0$/.test((aD[1]-aD[0]).toFixed(aE)))){aG.tickDecimals=aE}}}}aG.tickGenerator=aB;if(c.isFunction(aM.tickFormatter)){aG.tickFormatter=function(aV,aW){return""+aM.tickFormatter(aV,aW)}}else{aG.tickFormatter=aR}}function P(aF){var aH=aF.options.ticks,aG=[];if(aH==null||(typeof aH=="number"&&aH>0)){aG=aF.tickGenerator(aF)}else{if(aH){if(c.isFunction(aH)){aG=aH({min:aF.min,max:aF.max})}else{aG=aH}}}var aE,aB;aF.ticks=[];for(aE=0;aE1){aC=aD[1]}}else{aB=+aD}if(aC==null){aC=aF.tickFormatter(aB,aF)}if(!isNaN(aB)){aF.ticks.push({v:aB,label:aC})}}}function ap(aB,aC){if(aB.options.autoscaleMargin&&aC.length>0){if(aB.options.min==null){aB.min=Math.min(aB.min,aC[0].v)}if(aB.options.max==null&&aC.length>1){aB.max=Math.max(aB.max,aC[aC.length-1].v)}}}function W(){H.clearRect(0,0,G,I);var aC=O.grid;if(aC.show&&aC.backgroundColor){N()}if(aC.show&&!aC.aboveData){ac()}for(var aB=0;aBaG){var aC=aH;aH=aG;aG=aC}return{from:aH,to:aG,axis:aE}}function N(){H.save();H.translate(q.left,q.top);H.fillStyle=am(O.grid.backgroundColor,w,0,"rgba(255, 255, 255, 0)");H.fillRect(0,0,h,w);H.restore()}function ac(){var aF;H.save();H.translate(q.left,q.top);var aH=O.grid.markings;if(aH){if(c.isFunction(aH)){var aK=aq.getAxes();aK.xmin=aK.xaxis.min;aK.xmax=aK.xaxis.max;aK.ymin=aK.yaxis.min;aK.ymax=aK.yaxis.max;aH=aH(aK)}for(aF=0;aFaC.axis.max||aI.toaI.axis.max){continue}aC.from=Math.max(aC.from,aC.axis.min);aC.to=Math.min(aC.to,aC.axis.max);aI.from=Math.max(aI.from,aI.axis.min);aI.to=Math.min(aI.to,aI.axis.max);if(aC.from==aC.to&&aI.from==aI.to){continue}aC.from=aC.axis.p2c(aC.from);aC.to=aC.axis.p2c(aC.to);aI.from=aI.axis.p2c(aI.from);aI.to=aI.axis.p2c(aI.to);if(aC.from==aC.to||aI.from==aI.to){H.beginPath();H.strokeStyle=aD.color||O.grid.markingsColor;H.lineWidth=aD.lineWidth||O.grid.markingsLineWidth;H.moveTo(aC.from,aI.from);H.lineTo(aC.to,aI.to);H.stroke()}else{H.fillStyle=aD.color||O.grid.markingsColor;H.fillRect(aC.from,aI.to,aC.to-aC.from,aI.from-aI.to)}}}var aK=m(),aM=O.grid.borderWidth;for(var aE=0;aEaB.max||(aQ=="full"&&aM>0&&(aO==aB.min||aO==aB.max))){continue}if(aB.direction=="x"){aN=aB.p2c(aO);aJ=aQ=="full"?-w:aQ;if(aB.position=="top"){aJ=-aJ}}else{aL=aB.p2c(aO);aP=aQ=="full"?-h:aQ;if(aB.position=="left"){aP=-aP}}if(H.lineWidth==1){if(aB.direction=="x"){aN=Math.floor(aN)+0.5}else{aL=Math.floor(aL)+0.5}}H.moveTo(aN,aL);H.lineTo(aN+aP,aL+aJ)}H.stroke()}if(aM){H.lineWidth=aM;H.strokeStyle=O.grid.borderColor;H.strokeRect(-aM/2,-aM/2,h+aM,w+aM)}H.restore()}function k(){av.find(".tickLabels").remove();var aG=['
'];var aJ=m();for(var aD=0;aD');for(var aE=0;aEaC.max){continue}var aK={},aI;if(aC.direction=="x"){aI="center";aK.left=Math.round(q.left+aC.p2c(aH.v)-aC.labelWidth/2);if(aC.position=="bottom"){aK.top=aF.top+aF.padding}else{aK.bottom=I-(aF.top+aF.height-aF.padding)}}else{aK.top=Math.round(q.top+aC.p2c(aH.v)-aC.labelHeight/2);if(aC.position=="left"){aK.right=G-(aF.left+aF.width-aF.padding);aI="right"}else{aK.left=aF.left+aF.padding;aI="left"}}aK.width=aC.labelWidth;var aB=["position:absolute","text-align:"+aI];for(var aL in aK){aB.push(aL+":"+aK[aL]+"px")}aG.push('
'+aH.label+"
")}aG.push("
")}aG.push("");av.append(aG.join(""))}function d(aB){if(aB.lines.show){at(aB)}if(aB.bars.show){e(aB)}if(aB.points.show){ao(aB)}}function at(aE){function aD(aP,aQ,aI,aU,aT){var aV=aP.points,aJ=aP.pointsize,aN=null,aM=null;H.beginPath();for(var aO=aJ;aO=aR&&aS>aT.max){if(aR>aT.max){continue}aL=(aT.max-aS)/(aR-aS)*(aK-aL)+aL;aS=aT.max}else{if(aR>=aS&&aR>aT.max){if(aS>aT.max){continue}aK=(aT.max-aS)/(aR-aS)*(aK-aL)+aL;aR=aT.max}}if(aL<=aK&&aL=aK&&aL>aU.max){if(aK>aU.max){continue}aS=(aU.max-aL)/(aK-aL)*(aR-aS)+aS;aL=aU.max}else{if(aK>=aL&&aK>aU.max){if(aL>aU.max){continue}aR=(aU.max-aL)/(aK-aL)*(aR-aS)+aS;aK=aU.max}}if(aL!=aN||aS!=aM){H.moveTo(aU.p2c(aL)+aQ,aT.p2c(aS)+aI)}aN=aK;aM=aR;H.lineTo(aU.p2c(aK)+aQ,aT.p2c(aR)+aI)}H.stroke()}function aF(aI,aQ,aP){var aW=aI.points,aV=aI.pointsize,aN=Math.min(Math.max(0,aP.min),aP.max),aX=0,aU,aT=false,aM=1,aL=0,aR=0;while(true){if(aV>0&&aX>aW.length+aV){break}aX+=aV;var aZ=aW[aX-aV],aK=aW[aX-aV+aM],aY=aW[aX],aJ=aW[aX+aM];if(aT){if(aV>0&&aZ!=null&&aY==null){aR=aX;aV=-aV;aM=2;continue}if(aV<0&&aX==aL+aV){H.fill();aT=false;aV=-aV;aM=1;aX=aL=aR+aV;continue}}if(aZ==null||aY==null){continue}if(aZ<=aY&&aZ=aY&&aZ>aQ.max){if(aY>aQ.max){continue}aK=(aQ.max-aZ)/(aY-aZ)*(aJ-aK)+aK;aZ=aQ.max}else{if(aY>=aZ&&aY>aQ.max){if(aZ>aQ.max){continue}aJ=(aQ.max-aZ)/(aY-aZ)*(aJ-aK)+aK;aY=aQ.max}}if(!aT){H.beginPath();H.moveTo(aQ.p2c(aZ),aP.p2c(aN));aT=true}if(aK>=aP.max&&aJ>=aP.max){H.lineTo(aQ.p2c(aZ),aP.p2c(aP.max));H.lineTo(aQ.p2c(aY),aP.p2c(aP.max));continue}else{if(aK<=aP.min&&aJ<=aP.min){H.lineTo(aQ.p2c(aZ),aP.p2c(aP.min));H.lineTo(aQ.p2c(aY),aP.p2c(aP.min));continue}}var aO=aZ,aS=aY;if(aK<=aJ&&aK=aP.min){aZ=(aP.min-aK)/(aJ-aK)*(aY-aZ)+aZ;aK=aP.min}else{if(aJ<=aK&&aJ=aP.min){aY=(aP.min-aK)/(aJ-aK)*(aY-aZ)+aZ;aJ=aP.min}}if(aK>=aJ&&aK>aP.max&&aJ<=aP.max){aZ=(aP.max-aK)/(aJ-aK)*(aY-aZ)+aZ;aK=aP.max}else{if(aJ>=aK&&aJ>aP.max&&aK<=aP.max){aY=(aP.max-aK)/(aJ-aK)*(aY-aZ)+aZ;aJ=aP.max}}if(aZ!=aO){H.lineTo(aQ.p2c(aO),aP.p2c(aK))}H.lineTo(aQ.p2c(aZ),aP.p2c(aK));H.lineTo(aQ.p2c(aY),aP.p2c(aJ));if(aY!=aS){H.lineTo(aQ.p2c(aY),aP.p2c(aJ));H.lineTo(aQ.p2c(aS),aP.p2c(aJ))}}}H.save();H.translate(q.left,q.top);H.lineJoin="round";var aG=aE.lines.lineWidth,aB=aE.shadowSize;if(aG>0&&aB>0){H.lineWidth=aB;H.strokeStyle="rgba(0,0,0,0.1)";var aH=Math.PI/18;aD(aE.datapoints,Math.sin(aH)*(aG/2+aB/2),Math.cos(aH)*(aG/2+aB/2),aE.xaxis,aE.yaxis);H.lineWidth=aB/2;aD(aE.datapoints,Math.sin(aH)*(aG/2+aB/4),Math.cos(aH)*(aG/2+aB/4),aE.xaxis,aE.yaxis)}H.lineWidth=aG;H.strokeStyle=aE.color;var aC=ae(aE.lines,aE.color,0,w);if(aC){H.fillStyle=aC;aF(aE.datapoints,aE.xaxis,aE.yaxis)}if(aG>0){aD(aE.datapoints,0,0,aE.xaxis,aE.yaxis)}H.restore()}function ao(aE){function aH(aN,aM,aU,aK,aS,aT,aQ,aJ){var aR=aN.points,aI=aN.pointsize;for(var aL=0;aLaT.max||aOaQ.max){continue}H.beginPath();aP=aT.p2c(aP);aO=aQ.p2c(aO)+aK;if(aJ=="circle"){H.arc(aP,aO,aM,0,aS?Math.PI:Math.PI*2,false)}else{aJ(H,aP,aO,aM,aS)}H.closePath();if(aU){H.fillStyle=aU;H.fill()}H.stroke()}}H.save();H.translate(q.left,q.top);var aG=aE.points.lineWidth,aC=aE.shadowSize,aB=aE.points.radius,aF=aE.points.symbol;if(aG>0&&aC>0){var aD=aC/2;H.lineWidth=aD;H.strokeStyle="rgba(0,0,0,0.1)";aH(aE.datapoints,aB,null,aD+aD/2,true,aE.xaxis,aE.yaxis,aF);H.strokeStyle="rgba(0,0,0,0.2)";aH(aE.datapoints,aB,null,aD/2,true,aE.xaxis,aE.yaxis,aF)}H.lineWidth=aG;H.strokeStyle=aE.color;aH(aE.datapoints,aB,ae(aE.points,aE.color),0,false,aE.xaxis,aE.yaxis,aF);H.restore()}function E(aN,aM,aV,aI,aQ,aF,aD,aL,aK,aU,aR,aC){var aE,aT,aJ,aP,aG,aB,aO,aH,aS;if(aR){aH=aB=aO=true;aG=false;aE=aV;aT=aN;aP=aM+aI;aJ=aM+aQ;if(aTaL.max||aPaK.max){return}if(aEaL.max){aT=aL.max;aB=false}if(aJaK.max){aP=aK.max;aO=false}aE=aL.p2c(aE);aJ=aK.p2c(aJ);aT=aL.p2c(aT);aP=aK.p2c(aP);if(aD){aU.beginPath();aU.moveTo(aE,aJ);aU.lineTo(aE,aP);aU.lineTo(aT,aP);aU.lineTo(aT,aJ);aU.fillStyle=aD(aJ,aP);aU.fill()}if(aC>0&&(aG||aB||aO||aH)){aU.beginPath();aU.moveTo(aE,aJ+aF);if(aG){aU.lineTo(aE,aP+aF)}else{aU.moveTo(aE,aP+aF)}if(aO){aU.lineTo(aT,aP+aF)}else{aU.moveTo(aT,aP+aF)}if(aB){aU.lineTo(aT,aJ+aF)}else{aU.moveTo(aT,aJ+aF)}if(aH){aU.lineTo(aE,aJ+aF)}else{aU.moveTo(aE,aJ+aF)}aU.stroke()}}function e(aD){function aC(aJ,aI,aL,aG,aK,aN,aM){var aO=aJ.points,aF=aJ.pointsize;for(var aH=0;aH")}aH.push("");aF=true}if(aN){aJ=aN(aJ,aM)}aH.push('
'+aJ+"")}if(aF){aH.push("")}if(aH.length==0){return}var aL=''+aH.join("")+"
";if(O.legend.container!=null){c(O.legend.container).html(aL)}else{var aI="",aC=O.legend.position,aD=O.legend.margin;if(aD[0]==null){aD=[aD,aD]}if(aC.charAt(0)=="n"){aI+="top:"+(aD[1]+q.top)+"px;"}else{if(aC.charAt(0)=="s"){aI+="bottom:"+(aD[1]+q.bottom)+"px;"}}if(aC.charAt(1)=="e"){aI+="right:"+(aD[0]+q.right)+"px;"}else{if(aC.charAt(1)=="w"){aI+="left:"+(aD[0]+q.left)+"px;"}}var aK=c('
'+aL.replace('style="','style="position:absolute;'+aI+";")+"
").appendTo(av);if(O.legend.backgroundOpacity!=0){var aG=O.legend.backgroundColor;if(aG==null){aG=O.grid.backgroundColor;if(aG&&typeof aG=="string"){aG=c.color.parse(aG)}else{aG=c.color.extract(aK,"background-color")}aG.a=1;aG=aG.toString()}var aB=aK.children();c('
').prependTo(aK).css("opacity",O.legend.backgroundOpacity)}}}var ab=[],M=null;function K(aI,aG,aD){var aO=O.grid.mouseActiveRadius,a0=aO*aO+1,aY=null,aR=false,aW,aU;for(aW=Q.length-1;aW>=0;--aW){if(!aD(Q[aW])){continue}var aP=Q[aW],aH=aP.xaxis,aF=aP.yaxis,aV=aP.datapoints.points,aT=aP.datapoints.pointsize,aQ=aH.c2p(aI),aN=aF.c2p(aG),aC=aO/aH.scale,aB=aO/aF.scale;if(aH.options.inverseTransform){aC=Number.MAX_VALUE}if(aF.options.inverseTransform){aB=Number.MAX_VALUE}if(aP.lines.show||aP.points.show){for(aU=0;aUaC||aK-aQ<-aC||aJ-aN>aB||aJ-aN<-aB){continue}var aM=Math.abs(aH.p2c(aK)-aI),aL=Math.abs(aF.p2c(aJ)-aG),aS=aM*aM+aL*aL;if(aS=Math.min(aZ,aK)&&aN>=aJ+aE&&aN<=aJ+aX):(aQ>=aK+aE&&aQ<=aK+aX&&aN>=Math.min(aZ,aJ)&&aN<=Math.max(aZ,aJ))){aY=[aW,aU/aT]}}}}if(aY){aW=aY[0];aU=aY[1];aT=Q[aW].datapoints.pointsize;return{datapoint:Q[aW].datapoints.points.slice(aU*aT,(aU+1)*aT),dataIndex:aU,series:Q[aW],seriesIndex:aW}}return null}function aa(aB){if(O.grid.hoverable){u("plothover",aB,function(aC){return aC.hoverable!=false})}}function l(aB){if(O.grid.hoverable){u("plothover",aB,function(aC){return false})}}function R(aB){u("plotclick",aB,function(aC){return aC.clickable!=false})}function u(aC,aB,aD){var aE=y.offset(),aH=aB.pageX-aE.left-q.left,aF=aB.pageY-aE.top-q.top,aJ=C({left:aH,top:aF});aJ.pageX=aB.pageX;aJ.pageY=aB.pageY;var aK=K(aH,aF,aD);if(aK){aK.pageX=parseInt(aK.series.xaxis.p2c(aK.datapoint[0])+aE.left+q.left);aK.pageY=parseInt(aK.series.yaxis.p2c(aK.datapoint[1])+aE.top+q.top)}if(O.grid.autoHighlight){for(var aG=0;aGaH.max||aIaG.max){return}var aF=aE.points.radius+aE.points.lineWidth/2;A.lineWidth=aF;A.strokeStyle=c.color.parse(aE.color).scale("a",0.5).toString();var aB=1.5*aF,aC=aH.p2c(aC),aI=aG.p2c(aI);A.beginPath();if(aE.points.symbol=="circle"){A.arc(aC,aI,aB,0,2*Math.PI,false)}else{aE.points.symbol(A,aC,aI,aB,false)}A.closePath();A.stroke()}function v(aE,aB){A.lineWidth=aE.bars.lineWidth;A.strokeStyle=c.color.parse(aE.color).scale("a",0.5).toString();var aD=c.color.parse(aE.color).scale("a",0.5).toString();var aC=aE.bars.align=="left"?0:-aE.bars.barWidth/2;E(aB[0],aB[1],aB[2]||0,aC,aC+aE.bars.barWidth,0,function(){return aD},aE.xaxis,aE.yaxis,A,aE.bars.horizontal,aE.bars.lineWidth)}function am(aJ,aB,aH,aC){if(typeof aJ=="string"){return aJ}else{var aI=H.createLinearGradient(0,aH,0,aB);for(var aE=0,aD=aJ.colors.length;aE12){n=n-12}else{if(n==0){n=12}}}for(var g=0;g1){N.series.pie.tilt=1}if(N.series.pie.tilt<0){N.series.pie.tilt=0}O.hooks.processDatapoints.push(E);O.hooks.drawOverlay.push(H);O.hooks.draw.push(r)}}function e(P,N){var O=P.getOptions();if(O.series.pie.show&&O.grid.hoverable){N.unbind("mousemove").mousemove(t)}if(O.series.pie.show&&O.grid.clickable){N.unbind("click").click(l)}}function G(O){var P="";function N(S,T){if(!T){T=0}for(var R=0;Rh.width-n){B=h.width-n}}}function v(O){for(var N=0;N0){R.push({data:[[1,P]],color:N,label:a.series.pie.combine.label,angle:(P*(Math.PI*2))/M,percent:(P/M*100)})}return R}function r(S,Q){if(!L){return}ctx=Q;I();var T=S.getData();var P=0;while(F&&P0){n*=w}P+=1;N();if(a.series.pie.tilt<=0.8){O()}R()}if(P>=o){N();L.prepend('
Could not draw pie with labels contained inside canvas
')}if(S.setSeries&&S.insertLegend){S.setSeries(T);S.insertLegend()}function N(){ctx.clearRect(0,0,h.width,h.height);L.children().filter(".pieLabel, .pieLabelBackground").remove()}function O(){var Z=5;var Y=15;var W=10;var X=0.02;if(a.series.pie.radius>1){var U=a.series.pie.radius}else{var U=n*a.series.pie.radius}if(U>=(h.width/2)-Z||U*a.series.pie.tilt>=(h.height/2)-Y||U<=W){return}ctx.save();ctx.translate(Z,Y);ctx.globalAlpha=X;ctx.fillStyle="#000";ctx.translate(B,p);ctx.scale(1,a.series.pie.tilt);for(var V=1;V<=W;V++){ctx.beginPath();ctx.arc(0,0,U,0,Math.PI*2,false);ctx.fill();U-=V}ctx.restore()}function R(){startAngle=Math.PI*a.series.pie.startAngle;if(a.series.pie.radius>1){var U=a.series.pie.radius}else{var U=n*a.series.pie.radius}ctx.save();ctx.translate(B,p);ctx.scale(1,a.series.pie.tilt);ctx.save();var Y=startAngle;for(var W=0;W1e-9){ctx.moveTo(0,0)}else{if(b.browser.msie){ab-=0.0001}}ctx.arc(0,0,U,Y,Y+ab,false);ctx.closePath();Y+=ab;if(aa){ctx.fill()}else{ctx.stroke()}}function V(){var ac=startAngle;if(a.series.pie.label.radius>1){var Z=a.series.pie.label.radius}else{var Z=n*a.series.pie.label.radius}for(var ab=0;ab=a.series.pie.label.threshold*100){aa(T[ab],ac,ab)}ac+=T[ab].angle}function aa(ap,ai,ag){if(ap.data[0][1]==0){return}var ar=a.legend.labelFormatter,aq,ae=a.series.pie.label.formatter;if(ar){aq=ar(ap.label,ap)}else{aq=ap.label}if(ae){aq=ae(aq,ap)}var aj=((ai+ap.angle)+ai)/2;var ao=B+Math.round(Math.cos(aj)*Z);var am=p+Math.round(Math.sin(aj)*Z)*a.series.pie.tilt;var af=''+aq+"";L.append(af);var an=L.children("#pieLabel"+ag);var ad=(am-an.height()/2);var ah=(ao-an.width()/2);an.css("top",ad);an.css("left",ah);if(0-ad>0||0-ah>0||h.height-(ad+an.height())<0||h.width-(ah+an.width())<0){F=true}if(a.series.pie.label.background.opacity!=0){var ak=a.series.pie.label.background.color;if(ak==null){ak=ap.color}var al="top:"+ad+"px;left:"+ah+"px;";b('
').insertBefore(an).css("opacity",a.series.pie.label.background.opacity)}}}}}function J(N){if(a.series.pie.innerRadius>0){N.save();innerRadius=a.series.pie.innerRadius>1?a.series.pie.innerRadius:n*a.series.pie.innerRadius;N.globalCompositeOperation="destination-out";N.beginPath();N.fillStyle=a.series.pie.stroke.color;N.arc(0,0,innerRadius,0,Math.PI*2,false);N.fill();N.closePath();N.restore();N.save();N.beginPath();N.strokeStyle=a.series.pie.stroke.color;N.arc(0,0,innerRadius,0,Math.PI*2,false);N.stroke();N.closePath();N.restore()}}function s(Q,R){for(var S=false,P=-1,N=Q.length,O=N-1;++P1?O.series.pie.radius:n*O.series.pie.radius;for(var Q=0;Q1?P.series.pie.radius:n*P.series.pie.radius;R.save();R.translate(B,p);R.scale(1,P.series.pie.tilt);for(i=0;i1e-9){R.moveTo(0,0)}R.arc(0,0,N,S.startAngle,S.startAngle+S.angle,false);R.closePath();R.fill()}}}var a={series:{pie:{show:false,radius:"auto",innerRadius:0,startAngle:3/2,tilt:1,offset:{top:0,left:"auto"},stroke:{color:"#FFF",width:1},label:{show:"auto",formatter:function(d,e){return'
'+d+"
"+Math.round(e.percent)+"%
"},radius:1,background:{color:null,opacity:0},threshold:0},combine:{threshold:-1,color:null,label:"Other"},highlight:{opacity:0.5}}}};b.plot.plugins.push({init:c,options:a,name:"pie",version:"1.0"})})(jQuery); \ No newline at end of file diff --git a/src/main/webapp/resources/js/jquery.flot.resize.min.js b/src/main/webapp/resources/js/jquery.flot.resize.min.js new file mode 100644 index 0000000000000000000000000000000000000000..1fa0771f570ea1a6cfd9259fb02d707d279ca859 --- /dev/null +++ b/src/main/webapp/resources/js/jquery.flot.resize.min.js @@ -0,0 +1 @@ +(function(n,p,u){var w=n([]),s=n.resize=n.extend(n.resize,{}),o,l="setTimeout",m="resize",t=m+"-special-event",v="delay",r="throttleWindow";s[v]=250;s[r]=true;n.event.special[m]={setup:function(){if(!s[r]&&this[l]){return false}var a=n(this);w=w.add(a);n.data(this,t,{w:a.width(),h:a.height()});if(w.length===1){q()}},teardown:function(){if(!s[r]&&this[l]){return false}var a=n(this);w=w.not(a);a.removeData(t);if(!w.length){clearTimeout(o)}},add:function(b){if(!s[r]&&this[l]){return false}var c;function a(d,h,g){var f=n(this),e=n.data(this,t);e.w=h!==u?h:f.width();e.h=g!==u?g:f.height();c.apply(this,arguments)}if(n.isFunction(b)){c=b;return a}else{c=b.handler;b.handler=a}}};function q(){o=p[l](function(){w.each(function(){var d=n(this),a=d.width(),b=d.height(),c=n.data(this,t);if(a!==c.w||b!==c.h){d.trigger(m,[c.w=a,c.h=b])}});q()},s[v])}})(jQuery,this);(function(b){var a={};function c(f){function e(){var h=f.getPlaceholder();if(h.width()==0||h.height()==0){return}f.resize();f.setupGrid();f.draw()}function g(i,h){i.getPlaceholder().resize(e)}function d(i,h){i.getPlaceholder().unbind("resize",e)}f.hooks.bindEvents.push(g);f.hooks.shutdown.push(d)}b.plot.plugins.push({init:c,options:a,name:"resize",version:"1.0"})})(jQuery); \ No newline at end of file diff --git a/src/main/webapp/resources/js/jquery.gritter.min.js b/src/main/webapp/resources/js/jquery.gritter.min.js new file mode 100644 index 0000000000000000000000000000000000000000..6481c9369f96dbda2f9bcbf3101e549c475dda50 --- /dev/null +++ b/src/main/webapp/resources/js/jquery.gritter.min.js @@ -0,0 +1 @@ +(function(b){b.gritter={};b.gritter.options={position:"",class_name:"",fade_in_speed:"medium",fade_out_speed:1000,time:6000};b.gritter.add=function(f){try{return a.add(f||{})}catch(d){var c="Gritter Error: "+d;(typeof(console)!="undefined"&&console.error)?console.error(c,f):alert(c)}};b.gritter.remove=function(d,c){a.removeSpecific(d,c||{})};b.gritter.removeAll=function(c){a.stop(c||{})};var a={position:"",fade_in_speed:"",fade_out_speed:"",time:"",_custom_timer:0,_item_count:0,_is_setup:0,_tpl_close:'
',_tpl_title:'[[title]]',_tpl_item:'',_tpl_wrap:'
',add:function(g){if(typeof(g)=="string"){g={text:g}}if(!g.text){throw'You must supply "text" parameter.'}if(!this._is_setup){this._runSetup()}var k=g.title,n=g.text,e=g.image||"",l=g.sticky||false,m=g.class_name||b.gritter.options.class_name,j=b.gritter.options.position,d=g.time||"";this._verifyWrapper();this._item_count++;var f=this._item_count,i=this._tpl_item;b(["before_open","after_open","before_close","after_close"]).each(function(p,q){a["_"+q+"_"+f]=(b.isFunction(g[q]))?g[q]:function(){}});this._custom_timer=0;if(d){this._custom_timer=d}var c=(e!="")?'':"",h=(e!="")?"gritter-with-image":"gritter-without-image";if(k){k=this._str_replace("[[title]]",k,this._tpl_title)}else{k=""}i=this._str_replace(["[[title]]","[[text]]","[[close]]","[[image]]","[[number]]","[[class_name]]","[[item_class]]"],[k,n,this._tpl_close,c,this._item_count,h,m],i);if(this["_before_open_"+f]()===false){return false}b("#gritter-notice-wrapper").addClass(j).append(i);var o=b("#gritter-item-"+this._item_count);o.fadeIn(this.fade_in_speed,function(){a["_after_open_"+f](b(this))});if(!l){this._setFadeTimer(o,f)}b(o).bind("mouseenter mouseleave",function(p){if(p.type=="mouseenter"){if(!l){a._restoreItemIfFading(b(this),f)}}else{if(!l){a._setFadeTimer(b(this),f)}}a._hoverState(b(this),p.type)});b(o).find(".gritter-close").click(function(){a.removeSpecific(f,{},null,true)});return f},_countRemoveWrapper:function(c,d,f){d.remove();this["_after_close_"+c](d,f);if(b(".gritter-item-wrapper").length==0){b("#gritter-notice-wrapper").remove()}},_fade:function(g,d,j,f){var j=j||{},i=(typeof(j.fade)!="undefined")?j.fade:true,c=j.speed||this.fade_out_speed,h=f;this["_before_close_"+d](g,h);if(f){g.unbind("mouseenter mouseleave")}if(i){g.animate({opacity:0},c,function(){g.animate({height:0},300,function(){a._countRemoveWrapper(d,g,h)})})}else{this._countRemoveWrapper(d,g)}},_hoverState:function(d,c){if(c=="mouseenter"){d.addClass("hover");d.find(".gritter-close").show()}else{d.removeClass("hover");d.find(".gritter-close").hide()}},removeSpecific:function(c,g,f,d){if(!f){var f=b("#gritter-item-"+c)}this._fade(f,c,g||{},d)},_restoreItemIfFading:function(d,c){clearTimeout(this["_int_id_"+c]);d.stop().css({opacity:"",height:""})},_runSetup:function(){for(opt in b.gritter.options){this[opt]=b.gritter.options[opt]}this._is_setup=1},_setFadeTimer:function(f,d){var c=(this._custom_timer)?this._custom_timer:this.time;this["_int_id_"+d]=setTimeout(function(){a._fade(f,d)},c)},stop:function(e){var c=(b.isFunction(e.before_close))?e.before_close:function(){};var f=(b.isFunction(e.after_close))?e.after_close:function(){};var d=b("#gritter-notice-wrapper");c(d);d.fadeOut(function(){b(this).remove();f()})},_str_replace:function(v,e,o,n){var k=0,h=0,t="",m="",g=0,q=0,l=[].concat(v),c=[].concat(e),u=o,d=c instanceof Array,p=u instanceof Array;u=[].concat(u);if(n){this.window[n]=0}for(k=0,g=u.length;k").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"":"")+""),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;e=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="
"+""+"
",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="
t
",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="
",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function( +a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&j.push({elem:this,matches:d.slice(e)});for(k=0;k0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f +.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(;d1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]===""&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/src/main/webapp/resources/js/jquery.peity.min.js b/src/main/webapp/resources/js/jquery.peity.min.js new file mode 100644 index 0000000000000000000000000000000000000000..cec5761f48d2864ebb2b57a635f7a3849caac144 --- /dev/null +++ b/src/main/webapp/resources/js/jquery.peity.min.js @@ -0,0 +1,12 @@ +// Peity jQuery plugin version 0.6.0 +// (c) 2011 Ben Pickles +// +// http://benpickles.github.com/peity/ +// +// Released under MIT license. +(function(i,k){function o(a,h){var b=k.createElement("canvas");b.setAttribute("width",a*m);b.setAttribute("height",h*m);m!=1&&b.setAttribute("style","width:"+a+"px;height:"+h+"px");return b}var g=i.fn.peity=function(a,h){k.createElement("canvas").getContext&&this.each(function(){i(this).change(function(){var b=i.extend({},h),d=this;i.each(b,function(a,c){i.isFunction(c)&&(b[a]=c.call(d))});var f=i(this).html();g.graphers[a].call(this,i.extend({},g.defaults[a],b));i(this).trigger("chart:changed",f)}).trigger("change")}); +return this};g.graphers={};g.defaults={};g.add=function(a,h,b){g.graphers[a]=b;g.defaults[a]=h};var m=window.devicePixelRatio||1;g.add("pie",{colours:["#FFF4DD","#FF9900"],delimeter:"/",diameter:16},function(a){var h=i(this),b=h.text().split(a.delimeter),d=parseFloat(b[0]),f=parseFloat(b[1]),b=-Math.PI/2,d=d/f*Math.PI*2,f=o(a.diameter,a.diameter),e=f.getContext("2d"),c=f.width/2;e.beginPath();e.moveTo(c,c);e.arc(c,c,c,d+b,d==0?Math.PI*2:b,!1);e.fillStyle=a.colours[0];e.fill();e.beginPath();e.moveTo(c, +c);e.arc(c,c,c,b,d+b,!1);e.fillStyle=a.colours[1];e.fill();h.wrapInner(i("").hide()).append(f)});g.add("line",{colour:"#c6d9fd",strokeColour:"#4d89f9",strokeWidth:1,delimeter:",",height:16,max:null,min:0,width:32},function(a){var h=i(this),b=o(a.width,a.height),d=h.text().split(a.delimeter);d.length==1&&d.push(d[0]);var f=Math.max.apply(Math,d.concat([a.max])),e=Math.min.apply(Math,d.concat([a.min])),c=b.getContext("2d"),g=b.width,l=b.height,q=g/(d.length-1),f=l/(f-e),n=[],j;c.beginPath();c.moveTo(0, +l+e*f);for(j=0;j").hide()).append(b)});g.add("bar",{colour:"#4D89F9",delimeter:",",height:16,max:null,min:0,width:32},function(a){var h=i(this),b=h.text().split(a.delimeter),d=Math.max.apply(Math, +b.concat([a.max])),f=Math.min.apply(Math,b.concat([a.min])),e=o(a.width,a.height),c=e.getContext("2d"),g=e.height,d=g/(d-f),l=m/2,k=(e.width+l)/b.length;c.fillStyle=a.colour;for(a=0;a").hide()).append(e)})})(jQuery,document); + diff --git a/src/main/webapp/resources/js/jquery.toggle.buttons.html b/src/main/webapp/resources/js/jquery.toggle.buttons.html new file mode 100644 index 0000000000000000000000000000000000000000..1229715285cd5f52b299a9dcf7936157626237ff --- /dev/null +++ b/src/main/webapp/resources/js/jquery.toggle.buttons.html @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + Page not found - Theme Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+
+ + +
+
+ +

404 Not Found

+

Apologies, but the page you requested could not be found. Perhaps searching will help.

+
+

+

+ + + +
+
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/resources/js/jquery.ui.custom.js b/src/main/webapp/resources/js/jquery.ui.custom.js new file mode 100644 index 0000000000000000000000000000000000000000..41f6726137721852666e53fe5f6d3a20a867e3cb --- /dev/null +++ b/src/main/webapp/resources/js/jquery.ui.custom.js @@ -0,0 +1,6160 @@ +/*! + * jQuery UI 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI + */ +(function( $, undefined ) { + +// prevent duplicate loading +// this is only a problem because we proxy existing functions +// and we don't want to double proxy them +$.ui = $.ui || {}; +if ( $.ui.version ) { + return; +} + +$.extend( $.ui, { + version: "1.8.21", + + keyCode: { + ALT: 18, + BACKSPACE: 8, + CAPS_LOCK: 20, + COMMA: 188, + COMMAND: 91, + COMMAND_LEFT: 91, // COMMAND + COMMAND_RIGHT: 93, + CONTROL: 17, + DELETE: 46, + DOWN: 40, + END: 35, + ENTER: 13, + ESCAPE: 27, + HOME: 36, + INSERT: 45, + LEFT: 37, + MENU: 93, // COMMAND_RIGHT + NUMPAD_ADD: 107, + NUMPAD_DECIMAL: 110, + NUMPAD_DIVIDE: 111, + NUMPAD_ENTER: 108, + NUMPAD_MULTIPLY: 106, + NUMPAD_SUBTRACT: 109, + PAGE_DOWN: 34, + PAGE_UP: 33, + PERIOD: 190, + RIGHT: 39, + SHIFT: 16, + SPACE: 32, + TAB: 9, + UP: 38, + WINDOWS: 91 // COMMAND + } +}); + +// plugins +$.fn.extend({ + propAttr: $.fn.prop || $.fn.attr, + + _focus: $.fn.focus, + focus: function( delay, fn ) { + return typeof delay === "number" ? + this.each(function() { + var elem = this; + setTimeout(function() { + $( elem ).focus(); + if ( fn ) { + fn.call( elem ); + } + }, delay ); + }) : + this._focus.apply( this, arguments ); + }, + + scrollParent: function() { + var scrollParent; + if (($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) { + scrollParent = this.parents().filter(function() { + return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); + }).eq(0); + } else { + scrollParent = this.parents().filter(function() { + return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); + }).eq(0); + } + + return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent; + }, + + zIndex: function( zIndex ) { + if ( zIndex !== undefined ) { + return this.css( "zIndex", zIndex ); + } + + if ( this.length ) { + var elem = $( this[ 0 ] ), position, value; + while ( elem.length && elem[ 0 ] !== document ) { + // Ignore z-index if position is set to a value where z-index is ignored by the browser + // This makes behavior of this function consistent across browsers + // WebKit always returns auto if the element is positioned + position = elem.css( "position" ); + if ( position === "absolute" || position === "relative" || position === "fixed" ) { + // IE returns 0 when zIndex is not specified + // other browsers return a string + // we ignore the case of nested elements with an explicit value of 0 + //
+ value = parseInt( elem.css( "zIndex" ), 10 ); + if ( !isNaN( value ) && value !== 0 ) { + return value; + } + } + elem = elem.parent(); + } + } + + return 0; + }, + + disableSelection: function() { + return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) + + ".ui-disableSelection", function( event ) { + event.preventDefault(); + }); + }, + + enableSelection: function() { + return this.unbind( ".ui-disableSelection" ); + } +}); + +$.each( [ "Width", "Height" ], function( i, name ) { + var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ], + type = name.toLowerCase(), + orig = { + innerWidth: $.fn.innerWidth, + innerHeight: $.fn.innerHeight, + outerWidth: $.fn.outerWidth, + outerHeight: $.fn.outerHeight + }; + + function reduce( elem, size, border, margin ) { + $.each( side, function() { + size -= parseFloat( $.curCSS( elem, "padding" + this, true) ) || 0; + if ( border ) { + size -= parseFloat( $.curCSS( elem, "border" + this + "Width", true) ) || 0; + } + if ( margin ) { + size -= parseFloat( $.curCSS( elem, "margin" + this, true) ) || 0; + } + }); + return size; + } + + $.fn[ "inner" + name ] = function( size ) { + if ( size === undefined ) { + return orig[ "inner" + name ].call( this ); + } + + return this.each(function() { + $( this ).css( type, reduce( this, size ) + "px" ); + }); + }; + + $.fn[ "outer" + name] = function( size, margin ) { + if ( typeof size !== "number" ) { + return orig[ "outer" + name ].call( this, size ); + } + + return this.each(function() { + $( this).css( type, reduce( this, size, true, margin ) + "px" ); + }); + }; +}); + +// selectors +function focusable( element, isTabIndexNotNaN ) { + var nodeName = element.nodeName.toLowerCase(); + if ( "area" === nodeName ) { + var map = element.parentNode, + mapName = map.name, + img; + if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) { + return false; + } + img = $( "img[usemap=#" + mapName + "]" )[0]; + return !!img && visible( img ); + } + return ( /input|select|textarea|button|object/.test( nodeName ) + ? !element.disabled + : "a" == nodeName + ? element.href || isTabIndexNotNaN + : isTabIndexNotNaN) + // the element and all of its ancestors must be visible + && visible( element ); +} + +function visible( element ) { + return !$( element ).parents().andSelf().filter(function() { + return $.curCSS( this, "visibility" ) === "hidden" || + $.expr.filters.hidden( this ); + }).length; +} + +$.extend( $.expr[ ":" ], { + data: function( elem, i, match ) { + return !!$.data( elem, match[ 3 ] ); + }, + + focusable: function( element ) { + return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) ); + }, + + tabbable: function( element ) { + var tabIndex = $.attr( element, "tabindex" ), + isTabIndexNaN = isNaN( tabIndex ); + return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN ); + } +}); + +// support +$(function() { + var body = document.body, + div = body.appendChild( div = document.createElement( "div" ) ); + + // access offsetHeight before setting the style to prevent a layout bug + // in IE 9 which causes the elemnt to continue to take up space even + // after it is removed from the DOM (#8026) + div.offsetHeight; + + $.extend( div.style, { + minHeight: "100px", + height: "auto", + padding: 0, + borderWidth: 0 + }); + + $.support.minHeight = div.offsetHeight === 100; + $.support.selectstart = "onselectstart" in div; + + // set display to none to avoid a layout bug in IE + // http://dev.jquery.com/ticket/4014 + body.removeChild( div ).style.display = "none"; +}); + + + + + +// deprecated +$.extend( $.ui, { + // $.ui.plugin is deprecated. Use the proxy pattern instead. + plugin: { + add: function( module, option, set ) { + var proto = $.ui[ module ].prototype; + for ( var i in set ) { + proto.plugins[ i ] = proto.plugins[ i ] || []; + proto.plugins[ i ].push( [ option, set[ i ] ] ); + } + }, + call: function( instance, name, args ) { + var set = instance.plugins[ name ]; + if ( !set || !instance.element[ 0 ].parentNode ) { + return; + } + + for ( var i = 0; i < set.length; i++ ) { + if ( instance.options[ set[ i ][ 0 ] ] ) { + set[ i ][ 1 ].apply( instance.element, args ); + } + } + } + }, + + // will be deprecated when we switch to jQuery 1.4 - use jQuery.contains() + contains: function( a, b ) { + return document.compareDocumentPosition ? + a.compareDocumentPosition( b ) & 16 : + a !== b && a.contains( b ); + }, + + // only used by resizable + hasScroll: function( el, a ) { + + //If overflow is hidden, the element might have extra content, but the user wants to hide it + if ( $( el ).css( "overflow" ) === "hidden") { + return false; + } + + var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop", + has = false; + + if ( el[ scroll ] > 0 ) { + return true; + } + + // TODO: determine which cases actually cause this to happen + // if the element doesn't have the scroll set, see if it's possible to + // set the scroll + el[ scroll ] = 1; + has = ( el[ scroll ] > 0 ); + el[ scroll ] = 0; + return has; + }, + + // these are odd functions, fix the API or move into individual plugins + isOverAxis: function( x, reference, size ) { + //Determines when x coordinate is over "b" element axis + return ( x > reference ) && ( x < ( reference + size ) ); + }, + isOver: function( y, x, top, left, height, width ) { + //Determines when x, y coordinates is over "b" element + return $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width ); + } +}); + +})( jQuery ); +/*! + * jQuery UI Widget 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Widget + */ +(function( $, undefined ) { + +// jQuery 1.4+ +if ( $.cleanData ) { + var _cleanData = $.cleanData; + $.cleanData = function( elems ) { + for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { + try { + $( elem ).triggerHandler( "remove" ); + // http://bugs.jquery.com/ticket/8235 + } catch( e ) {} + } + _cleanData( elems ); + }; +} else { + var _remove = $.fn.remove; + $.fn.remove = function( selector, keepData ) { + return this.each(function() { + if ( !keepData ) { + if ( !selector || $.filter( selector, [ this ] ).length ) { + $( "*", this ).add( [ this ] ).each(function() { + try { + $( this ).triggerHandler( "remove" ); + // http://bugs.jquery.com/ticket/8235 + } catch( e ) {} + }); + } + } + return _remove.call( $(this), selector, keepData ); + }); + }; +} + +$.widget = function( name, base, prototype ) { + var namespace = name.split( "." )[ 0 ], + fullName; + name = name.split( "." )[ 1 ]; + fullName = namespace + "-" + name; + + if ( !prototype ) { + prototype = base; + base = $.Widget; + } + + // create selector for plugin + $.expr[ ":" ][ fullName ] = function( elem ) { + return !!$.data( elem, name ); + }; + + $[ namespace ] = $[ namespace ] || {}; + $[ namespace ][ name ] = function( options, element ) { + // allow instantiation without initializing for simple inheritance + if ( arguments.length ) { + this._createWidget( options, element ); + } + }; + + var basePrototype = new base(); + // we need to make the options hash a property directly on the new instance + // otherwise we'll modify the options hash on the prototype that we're + // inheriting from +// $.each( basePrototype, function( key, val ) { +// if ( $.isPlainObject(val) ) { +// basePrototype[ key ] = $.extend( {}, val ); +// } +// }); + basePrototype.options = $.extend( true, {}, basePrototype.options ); + $[ namespace ][ name ].prototype = $.extend( true, basePrototype, { + namespace: namespace, + widgetName: name, + widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name, + widgetBaseClass: fullName + }, prototype ); + + $.widget.bridge( name, $[ namespace ][ name ] ); +}; + +$.widget.bridge = function( name, object ) { + $.fn[ name ] = function( options ) { + var isMethodCall = typeof options === "string", + args = Array.prototype.slice.call( arguments, 1 ), + returnValue = this; + + // allow multiple hashes to be passed on init + options = !isMethodCall && args.length ? + $.extend.apply( null, [ true, options ].concat(args) ) : + options; + + // prevent calls to internal methods + if ( isMethodCall && options.charAt( 0 ) === "_" ) { + return returnValue; + } + + if ( isMethodCall ) { + this.each(function() { + var instance = $.data( this, name ), + methodValue = instance && $.isFunction( instance[options] ) ? + instance[ options ].apply( instance, args ) : + instance; + // TODO: add this back in 1.9 and use $.error() (see #5972) +// if ( !instance ) { +// throw "cannot call methods on " + name + " prior to initialization; " + +// "attempted to call method '" + options + "'"; +// } +// if ( !$.isFunction( instance[options] ) ) { +// throw "no such method '" + options + "' for " + name + " widget instance"; +// } +// var methodValue = instance[ options ].apply( instance, args ); + if ( methodValue !== instance && methodValue !== undefined ) { + returnValue = methodValue; + return false; + } + }); + } else { + this.each(function() { + var instance = $.data( this, name ); + if ( instance ) { + instance.option( options || {} )._init(); + } else { + $.data( this, name, new object( options, this ) ); + } + }); + } + + return returnValue; + }; +}; + +$.Widget = function( options, element ) { + // allow instantiation without initializing for simple inheritance + if ( arguments.length ) { + this._createWidget( options, element ); + } +}; + +$.Widget.prototype = { + widgetName: "widget", + widgetEventPrefix: "", + options: { + disabled: false + }, + _createWidget: function( options, element ) { + // $.widget.bridge stores the plugin instance, but we do it anyway + // so that it's stored even before the _create function runs + $.data( element, this.widgetName, this ); + this.element = $( element ); + this.options = $.extend( true, {}, + this.options, + this._getCreateOptions(), + options ); + + var self = this; + this.element.bind( "remove." + this.widgetName, function() { + self.destroy(); + }); + + this._create(); + this._trigger( "create" ); + this._init(); + }, + _getCreateOptions: function() { + return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ]; + }, + _create: function() {}, + _init: function() {}, + + destroy: function() { + this.element + .unbind( "." + this.widgetName ) + .removeData( this.widgetName ); + this.widget() + .unbind( "." + this.widgetName ) + .removeAttr( "aria-disabled" ) + .removeClass( + this.widgetBaseClass + "-disabled " + + "ui-state-disabled" ); + }, + + widget: function() { + return this.element; + }, + + option: function( key, value ) { + var options = key; + + if ( arguments.length === 0 ) { + // don't return a reference to the internal hash + return $.extend( {}, this.options ); + } + + if (typeof key === "string" ) { + if ( value === undefined ) { + return this.options[ key ]; + } + options = {}; + options[ key ] = value; + } + + this._setOptions( options ); + + return this; + }, + _setOptions: function( options ) { + var self = this; + $.each( options, function( key, value ) { + self._setOption( key, value ); + }); + + return this; + }, + _setOption: function( key, value ) { + this.options[ key ] = value; + + if ( key === "disabled" ) { + this.widget() + [ value ? "addClass" : "removeClass"]( + this.widgetBaseClass + "-disabled" + " " + + "ui-state-disabled" ) + .attr( "aria-disabled", value ); + } + + return this; + }, + + enable: function() { + return this._setOption( "disabled", false ); + }, + disable: function() { + return this._setOption( "disabled", true ); + }, + + _trigger: function( type, event, data ) { + var prop, orig, + callback = this.options[ type ]; + + data = data || {}; + event = $.Event( event ); + event.type = ( type === this.widgetEventPrefix ? + type : + this.widgetEventPrefix + type ).toLowerCase(); + // the original event may come from any element + // so we need to reset the target on the new event + event.target = this.element[ 0 ]; + + // copy original event properties over to the new event + orig = event.originalEvent; + if ( orig ) { + for ( prop in orig ) { + if ( !( prop in event ) ) { + event[ prop ] = orig[ prop ]; + } + } + } + + this.element.trigger( event, data ); + + return !( $.isFunction(callback) && + callback.call( this.element[0], event, data ) === false || + event.isDefaultPrevented() ); + } +}; + +})( jQuery ); +/*! + * jQuery UI Mouse 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Mouse + * + * Depends: + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +var mouseHandled = false; +$( document ).mouseup( function( e ) { + mouseHandled = false; +}); + +$.widget("ui.mouse", { + options: { + cancel: ':input,option', + distance: 1, + delay: 0 + }, + _mouseInit: function() { + var self = this; + + this.element + .bind('mousedown.'+this.widgetName, function(event) { + return self._mouseDown(event); + }) + .bind('click.'+this.widgetName, function(event) { + if (true === $.data(event.target, self.widgetName + '.preventClickEvent')) { + $.removeData(event.target, self.widgetName + '.preventClickEvent'); + event.stopImmediatePropagation(); + return false; + } + }); + + this.started = false; + }, + + // TODO: make sure destroying one instance of mouse doesn't mess with + // other instances of mouse + _mouseDestroy: function() { + this.element.unbind('.'+this.widgetName); + $(document) + .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate) + .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate); + }, + + _mouseDown: function(event) { + // don't let more than one widget handle mouseStart + if( mouseHandled ) { return }; + + // we may have missed mouseup (out of window) + (this._mouseStarted && this._mouseUp(event)); + + this._mouseDownEvent = event; + + var self = this, + btnIsLeft = (event.which == 1), + // event.target.nodeName works around a bug in IE 8 with + // disabled inputs (#7620) + elIsCancel = (typeof this.options.cancel == "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false); + if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) { + return true; + } + + this.mouseDelayMet = !this.options.delay; + if (!this.mouseDelayMet) { + this._mouseDelayTimer = setTimeout(function() { + self.mouseDelayMet = true; + }, this.options.delay); + } + + if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { + this._mouseStarted = (this._mouseStart(event) !== false); + if (!this._mouseStarted) { + event.preventDefault(); + return true; + } + } + + // Click event may never have fired (Gecko & Opera) + if (true === $.data(event.target, this.widgetName + '.preventClickEvent')) { + $.removeData(event.target, this.widgetName + '.preventClickEvent'); + } + + // these delegates are required to keep context + this._mouseMoveDelegate = function(event) { + return self._mouseMove(event); + }; + this._mouseUpDelegate = function(event) { + return self._mouseUp(event); + }; + $(document) + .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate) + .bind('mouseup.'+this.widgetName, this._mouseUpDelegate); + + event.preventDefault(); + + mouseHandled = true; + return true; + }, + + _mouseMove: function(event) { + // IE mouseup check - mouseup happened when mouse was out of window + if ($.browser.msie && !(document.documentMode >= 9) && !event.button) { + return this._mouseUp(event); + } + + if (this._mouseStarted) { + this._mouseDrag(event); + return event.preventDefault(); + } + + if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { + this._mouseStarted = + (this._mouseStart(this._mouseDownEvent, event) !== false); + (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event)); + } + + return !this._mouseStarted; + }, + + _mouseUp: function(event) { + $(document) + .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate) + .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate); + + if (this._mouseStarted) { + this._mouseStarted = false; + + if (event.target == this._mouseDownEvent.target) { + $.data(event.target, this.widgetName + '.preventClickEvent', true); + } + + this._mouseStop(event); + } + + return false; + }, + + _mouseDistanceMet: function(event) { + return (Math.max( + Math.abs(this._mouseDownEvent.pageX - event.pageX), + Math.abs(this._mouseDownEvent.pageY - event.pageY) + ) >= this.options.distance + ); + }, + + _mouseDelayMet: function(event) { + return this.mouseDelayMet; + }, + + // These are placeholder methods, to be overriden by extending plugin + _mouseStart: function(event) {}, + _mouseDrag: function(event) {}, + _mouseStop: function(event) {}, + _mouseCapture: function(event) { return true; } +}); + +})(jQuery); +/*! + * jQuery UI Position 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Position + */ +(function( $, undefined ) { + +$.ui = $.ui || {}; + +var horizontalPositions = /left|center|right/, + verticalPositions = /top|center|bottom/, + center = "center", + support = {}, + _position = $.fn.position, + _offset = $.fn.offset; + +$.fn.position = function( options ) { + if ( !options || !options.of ) { + return _position.apply( this, arguments ); + } + + // make a copy, we don't want to modify arguments + options = $.extend( {}, options ); + + var target = $( options.of ), + targetElem = target[0], + collision = ( options.collision || "flip" ).split( " " ), + offset = options.offset ? options.offset.split( " " ) : [ 0, 0 ], + targetWidth, + targetHeight, + basePosition; + + if ( targetElem.nodeType === 9 ) { + targetWidth = target.width(); + targetHeight = target.height(); + basePosition = { top: 0, left: 0 }; + // TODO: use $.isWindow() in 1.9 + } else if ( targetElem.setTimeout ) { + targetWidth = target.width(); + targetHeight = target.height(); + basePosition = { top: target.scrollTop(), left: target.scrollLeft() }; + } else if ( targetElem.preventDefault ) { + // force left top to allow flipping + options.at = "left top"; + targetWidth = targetHeight = 0; + basePosition = { top: options.of.pageY, left: options.of.pageX }; + } else { + targetWidth = target.outerWidth(); + targetHeight = target.outerHeight(); + basePosition = target.offset(); + } + + // force my and at to have valid horizontal and veritcal positions + // if a value is missing or invalid, it will be converted to center + $.each( [ "my", "at" ], function() { + var pos = ( options[this] || "" ).split( " " ); + if ( pos.length === 1) { + pos = horizontalPositions.test( pos[0] ) ? + pos.concat( [center] ) : + verticalPositions.test( pos[0] ) ? + [ center ].concat( pos ) : + [ center, center ]; + } + pos[ 0 ] = horizontalPositions.test( pos[0] ) ? pos[ 0 ] : center; + pos[ 1 ] = verticalPositions.test( pos[1] ) ? pos[ 1 ] : center; + options[ this ] = pos; + }); + + // normalize collision option + if ( collision.length === 1 ) { + collision[ 1 ] = collision[ 0 ]; + } + + // normalize offset option + offset[ 0 ] = parseInt( offset[0], 10 ) || 0; + if ( offset.length === 1 ) { + offset[ 1 ] = offset[ 0 ]; + } + offset[ 1 ] = parseInt( offset[1], 10 ) || 0; + + if ( options.at[0] === "right" ) { + basePosition.left += targetWidth; + } else if ( options.at[0] === center ) { + basePosition.left += targetWidth / 2; + } + + if ( options.at[1] === "bottom" ) { + basePosition.top += targetHeight; + } else if ( options.at[1] === center ) { + basePosition.top += targetHeight / 2; + } + + basePosition.left += offset[ 0 ]; + basePosition.top += offset[ 1 ]; + + return this.each(function() { + var elem = $( this ), + elemWidth = elem.outerWidth(), + elemHeight = elem.outerHeight(), + marginLeft = parseInt( $.curCSS( this, "marginLeft", true ) ) || 0, + marginTop = parseInt( $.curCSS( this, "marginTop", true ) ) || 0, + collisionWidth = elemWidth + marginLeft + + ( parseInt( $.curCSS( this, "marginRight", true ) ) || 0 ), + collisionHeight = elemHeight + marginTop + + ( parseInt( $.curCSS( this, "marginBottom", true ) ) || 0 ), + position = $.extend( {}, basePosition ), + collisionPosition; + + if ( options.my[0] === "right" ) { + position.left -= elemWidth; + } else if ( options.my[0] === center ) { + position.left -= elemWidth / 2; + } + + if ( options.my[1] === "bottom" ) { + position.top -= elemHeight; + } else if ( options.my[1] === center ) { + position.top -= elemHeight / 2; + } + + // prevent fractions if jQuery version doesn't support them (see #5280) + if ( !support.fractions ) { + position.left = Math.round( position.left ); + position.top = Math.round( position.top ); + } + + collisionPosition = { + left: position.left - marginLeft, + top: position.top - marginTop + }; + + $.each( [ "left", "top" ], function( i, dir ) { + if ( $.ui.position[ collision[i] ] ) { + $.ui.position[ collision[i] ][ dir ]( position, { + targetWidth: targetWidth, + targetHeight: targetHeight, + elemWidth: elemWidth, + elemHeight: elemHeight, + collisionPosition: collisionPosition, + collisionWidth: collisionWidth, + collisionHeight: collisionHeight, + offset: offset, + my: options.my, + at: options.at + }); + } + }); + + if ( $.fn.bgiframe ) { + elem.bgiframe(); + } + elem.offset( $.extend( position, { using: options.using } ) ); + }); +}; + +$.ui.position = { + fit: { + left: function( position, data ) { + var win = $( window ), + over = data.collisionPosition.left + data.collisionWidth - win.width() - win.scrollLeft(); + position.left = over > 0 ? position.left - over : Math.max( position.left - data.collisionPosition.left, position.left ); + }, + top: function( position, data ) { + var win = $( window ), + over = data.collisionPosition.top + data.collisionHeight - win.height() - win.scrollTop(); + position.top = over > 0 ? position.top - over : Math.max( position.top - data.collisionPosition.top, position.top ); + } + }, + + flip: { + left: function( position, data ) { + if ( data.at[0] === center ) { + return; + } + var win = $( window ), + over = data.collisionPosition.left + data.collisionWidth - win.width() - win.scrollLeft(), + myOffset = data.my[ 0 ] === "left" ? + -data.elemWidth : + data.my[ 0 ] === "right" ? + data.elemWidth : + 0, + atOffset = data.at[ 0 ] === "left" ? + data.targetWidth : + -data.targetWidth, + offset = -2 * data.offset[ 0 ]; + position.left += data.collisionPosition.left < 0 ? + myOffset + atOffset + offset : + over > 0 ? + myOffset + atOffset + offset : + 0; + }, + top: function( position, data ) { + if ( data.at[1] === center ) { + return; + } + var win = $( window ), + over = data.collisionPosition.top + data.collisionHeight - win.height() - win.scrollTop(), + myOffset = data.my[ 1 ] === "top" ? + -data.elemHeight : + data.my[ 1 ] === "bottom" ? + data.elemHeight : + 0, + atOffset = data.at[ 1 ] === "top" ? + data.targetHeight : + -data.targetHeight, + offset = -2 * data.offset[ 1 ]; + position.top += data.collisionPosition.top < 0 ? + myOffset + atOffset + offset : + over > 0 ? + myOffset + atOffset + offset : + 0; + } + } +}; + +// offset setter from jQuery 1.4 +if ( !$.offset.setOffset ) { + $.offset.setOffset = function( elem, options ) { + // set position first, in-case top/left are set even on static elem + if ( /static/.test( $.curCSS( elem, "position" ) ) ) { + elem.style.position = "relative"; + } + var curElem = $( elem ), + curOffset = curElem.offset(), + curTop = parseInt( $.curCSS( elem, "top", true ), 10 ) || 0, + curLeft = parseInt( $.curCSS( elem, "left", true ), 10) || 0, + props = { + top: (options.top - curOffset.top) + curTop, + left: (options.left - curOffset.left) + curLeft + }; + + if ( 'using' in options ) { + options.using.call( elem, props ); + } else { + curElem.css( props ); + } + }; + + $.fn.offset = function( options ) { + var elem = this[ 0 ]; + if ( !elem || !elem.ownerDocument ) { return null; } + if ( options ) { + if ( $.isFunction( options ) ) { + return this.each(function( i ) { + $( this ).offset( options.call( this, i, $( this ).offset() ) ); + }); + } + return this.each(function() { + $.offset.setOffset( this, options ); + }); + } + return _offset.call( this ); + }; +} + +// fraction support test (older versions of jQuery don't support fractions) +(function () { + var body = document.getElementsByTagName( "body" )[ 0 ], + div = document.createElement( "div" ), + testElement, testElementParent, testElementStyle, offset, offsetTotal; + + //Create a "fake body" for testing based on method used in jQuery.support + testElement = document.createElement( body ? "div" : "body" ); + testElementStyle = { + visibility: "hidden", + width: 0, + height: 0, + border: 0, + margin: 0, + background: "none" + }; + if ( body ) { + $.extend( testElementStyle, { + position: "absolute", + left: "-1000px", + top: "-1000px" + }); + } + for ( var i in testElementStyle ) { + testElement.style[ i ] = testElementStyle[ i ]; + } + testElement.appendChild( div ); + testElementParent = body || document.documentElement; + testElementParent.insertBefore( testElement, testElementParent.firstChild ); + + div.style.cssText = "position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;"; + + offset = $( div ).offset( function( _, offset ) { + return offset; + }).offset(); + + testElement.innerHTML = ""; + testElementParent.removeChild( testElement ); + + offsetTotal = offset.top + offset.left + ( body ? 2000 : 0 ); + support.fractions = offsetTotal > 21 && offsetTotal < 22; +})(); + +}( jQuery )); +/*! + * jQuery UI Draggable 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Draggables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget("ui.draggable", $.ui.mouse, { + widgetEventPrefix: "drag", + options: { + addClasses: true, + appendTo: "parent", + axis: false, + connectToSortable: false, + containment: false, + cursor: "auto", + cursorAt: false, + grid: false, + handle: false, + helper: "original", + iframeFix: false, + opacity: false, + refreshPositions: false, + revert: false, + revertDuration: 500, + scope: "default", + scroll: true, + scrollSensitivity: 20, + scrollSpeed: 20, + snap: false, + snapMode: "both", + snapTolerance: 20, + stack: false, + zIndex: false + }, + _create: function() { + + if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position"))) + this.element[0].style.position = 'relative'; + + (this.options.addClasses && this.element.addClass("ui-draggable")); + (this.options.disabled && this.element.addClass("ui-draggable-disabled")); + + this._mouseInit(); + + }, + + destroy: function() { + if(!this.element.data('draggable')) return; + this.element + .removeData("draggable") + .unbind(".draggable") + .removeClass("ui-draggable" + + " ui-draggable-dragging" + + " ui-draggable-disabled"); + this._mouseDestroy(); + + return this; + }, + + _mouseCapture: function(event) { + + var o = this.options; + + // among others, prevent a drag on a resizable-handle + if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle')) + return false; + + //Quit if we're not on a valid handle + this.handle = this._getHandle(event); + if (!this.handle) + return false; + + if ( o.iframeFix ) { + $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() { + $('
') + .css({ + width: this.offsetWidth+"px", height: this.offsetHeight+"px", + position: "absolute", opacity: "0.001", zIndex: 1000 + }) + .css($(this).offset()) + .appendTo("body"); + }); + } + + return true; + + }, + + _mouseStart: function(event) { + + var o = this.options; + + //Create and append the visible helper + this.helper = this._createHelper(event); + + this.helper.addClass("ui-draggable-dragging"); + + //Cache the helper size + this._cacheHelperProportions(); + + //If ddmanager is used for droppables, set the global draggable + if($.ui.ddmanager) + $.ui.ddmanager.current = this; + + /* + * - Position generation - + * This block generates everything position related - it's the core of draggables. + */ + + //Cache the margins of the original element + this._cacheMargins(); + + //Store the helper's css position + this.cssPosition = this.helper.css("position"); + this.scrollParent = this.helper.scrollParent(); + + //The element's absolute position on the page minus margins + this.offset = this.positionAbs = this.element.offset(); + this.offset = { + top: this.offset.top - this.margins.top, + left: this.offset.left - this.margins.left + }; + + $.extend(this.offset, { + click: { //Where the click happened, relative to the element + left: event.pageX - this.offset.left, + top: event.pageY - this.offset.top + }, + parent: this._getParentOffset(), + relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper + }); + + //Generate the original position + this.originalPosition = this.position = this._generatePosition(event); + this.originalPageX = event.pageX; + this.originalPageY = event.pageY; + + //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied + (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt)); + + //Set a containment if given in the options + if(o.containment) + this._setContainment(); + + //Trigger event + callbacks + if(this._trigger("start", event) === false) { + this._clear(); + return false; + } + + //Recache the helper size + this._cacheHelperProportions(); + + //Prepare the droppable offsets + if ($.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(this, event); + + + this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position + + //If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003) + if ( $.ui.ddmanager ) $.ui.ddmanager.dragStart(this, event); + + return true; + }, + + _mouseDrag: function(event, noPropagation) { + + //Compute the helpers position + this.position = this._generatePosition(event); + this.positionAbs = this._convertPositionTo("absolute"); + + //Call plugins and callbacks and use the resulting position if something is returned + if (!noPropagation) { + var ui = this._uiHash(); + if(this._trigger('drag', event, ui) === false) { + this._mouseUp({}); + return false; + } + this.position = ui.position; + } + + if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px'; + if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px'; + if($.ui.ddmanager) $.ui.ddmanager.drag(this, event); + + return false; + }, + + _mouseStop: function(event) { + + //If we are using droppables, inform the manager about the drop + var dropped = false; + if ($.ui.ddmanager && !this.options.dropBehaviour) + dropped = $.ui.ddmanager.drop(this, event); + + //if a drop comes from outside (a sortable) + if(this.dropped) { + dropped = this.dropped; + this.dropped = false; + } + + //if the original element is no longer in the DOM don't bother to continue (see #8269) + var element = this.element[0], elementInDom = false; + while ( element && (element = element.parentNode) ) { + if (element == document ) { + elementInDom = true; + } + } + if ( !elementInDom && this.options.helper === "original" ) + return false; + + if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) { + var self = this; + $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() { + if(self._trigger("stop", event) !== false) { + self._clear(); + } + }); + } else { + if(this._trigger("stop", event) !== false) { + this._clear(); + } + } + + return false; + }, + + _mouseUp: function(event) { + if (this.options.iframeFix === true) { + $("div.ui-draggable-iframeFix").each(function() { + this.parentNode.removeChild(this); + }); //Remove frame helpers + } + + //If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003) + if( $.ui.ddmanager ) $.ui.ddmanager.dragStop(this, event); + + return $.ui.mouse.prototype._mouseUp.call(this, event); + }, + + cancel: function() { + + if(this.helper.is(".ui-draggable-dragging")) { + this._mouseUp({}); + } else { + this._clear(); + } + + return this; + + }, + + _getHandle: function(event) { + + var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false; + $(this.options.handle, this.element) + .find("*") + .andSelf() + .each(function() { + if(this == event.target) handle = true; + }); + + return handle; + + }, + + _createHelper: function(event) { + + var o = this.options; + var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone().removeAttr('id') : this.element); + + if(!helper.parents('body').length) + helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo)); + + if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) + helper.css("position", "absolute"); + + return helper; + + }, + + _adjustOffsetFromHelper: function(obj) { + if (typeof obj == 'string') { + obj = obj.split(' '); + } + if ($.isArray(obj)) { + obj = {left: +obj[0], top: +obj[1] || 0}; + } + if ('left' in obj) { + this.offset.click.left = obj.left + this.margins.left; + } + if ('right' in obj) { + this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; + } + if ('top' in obj) { + this.offset.click.top = obj.top + this.margins.top; + } + if ('bottom' in obj) { + this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; + } + }, + + _getParentOffset: function() { + + //Get the offsetParent and cache its position + this.offsetParent = this.helper.offsetParent(); + var po = this.offsetParent.offset(); + + // This is a special case where we need to modify a offset calculated on start, since the following happened: + // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent + // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that + // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag + if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) { + po.left += this.scrollParent.scrollLeft(); + po.top += this.scrollParent.scrollTop(); + } + + if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information + || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix + po = { top: 0, left: 0 }; + + return { + top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), + left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) + }; + + }, + + _getRelativeOffset: function() { + + if(this.cssPosition == "relative") { + var p = this.element.position(); + return { + top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(), + left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft() + }; + } else { + return { top: 0, left: 0 }; + } + + }, + + _cacheMargins: function() { + this.margins = { + left: (parseInt(this.element.css("marginLeft"),10) || 0), + top: (parseInt(this.element.css("marginTop"),10) || 0), + right: (parseInt(this.element.css("marginRight"),10) || 0), + bottom: (parseInt(this.element.css("marginBottom"),10) || 0) + }; + }, + + _cacheHelperProportions: function() { + this.helperProportions = { + width: this.helper.outerWidth(), + height: this.helper.outerHeight() + }; + }, + + _setContainment: function() { + + var o = this.options; + if(o.containment == 'parent') o.containment = this.helper[0].parentNode; + if(o.containment == 'document' || o.containment == 'window') this.containment = [ + o.containment == 'document' ? 0 : $(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, + o.containment == 'document' ? 0 : $(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, + (o.containment == 'document' ? 0 : $(window).scrollLeft()) + $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left, + (o.containment == 'document' ? 0 : $(window).scrollTop()) + ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top + ]; + + if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) { + var c = $(o.containment); + var ce = c[0]; if(!ce) return; + var co = c.offset(); + var over = ($(ce).css("overflow") != 'hidden'); + + this.containment = [ + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0), + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0), + (over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, + (over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom + ]; + this.relative_container = c; + + } else if(o.containment.constructor == Array) { + this.containment = o.containment; + } + + }, + + _convertPositionTo: function(d, pos) { + + if(!pos) pos = this.position; + var mod = d == "absolute" ? 1 : -1; + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + + return { + top: ( + pos.top // The absolute mouse position + + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border) + - ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod) + ), + left: ( + pos.left // The absolute mouse position + + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border) + - ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod) + ) + }; + + }, + + _generatePosition: function(event) { + + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + var pageX = event.pageX; + var pageY = event.pageY; + + /* + * - Position constraining - + * Constrain the position to a mix of grid, containment. + */ + + if(this.originalPosition) { //If we are not dragging yet, we won't check for options + var containment; + if(this.containment) { + if (this.relative_container){ + var co = this.relative_container.offset(); + containment = [ this.containment[0] + co.left, + this.containment[1] + co.top, + this.containment[2] + co.left, + this.containment[3] + co.top ]; + } + else { + containment = this.containment; + } + + if(event.pageX - this.offset.click.left < containment[0]) pageX = containment[0] + this.offset.click.left; + if(event.pageY - this.offset.click.top < containment[1]) pageY = containment[1] + this.offset.click.top; + if(event.pageX - this.offset.click.left > containment[2]) pageX = containment[2] + this.offset.click.left; + if(event.pageY - this.offset.click.top > containment[3]) pageY = containment[3] + this.offset.click.top; + } + + if(o.grid) { + //Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950) + var top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY; + pageY = containment ? (!(top - this.offset.click.top < containment[1] || top - this.offset.click.top > containment[3]) ? top : (!(top - this.offset.click.top < containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; + + var left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX; + pageX = containment ? (!(left - this.offset.click.left < containment[0] || left - this.offset.click.left > containment[2]) ? left : (!(left - this.offset.click.left < containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; + } + + } + + return { + top: ( + pageY // The absolute mouse position + - this.offset.click.top // Click offset (relative to the element) + - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.top // The offsetParent's offset without borders (offset + border) + + ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) )) + ), + left: ( + pageX // The absolute mouse position + - this.offset.click.left // Click offset (relative to the element) + - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.left // The offsetParent's offset without borders (offset + border) + + ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() )) + ) + }; + + }, + + _clear: function() { + this.helper.removeClass("ui-draggable-dragging"); + if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove(); + //if($.ui.ddmanager) $.ui.ddmanager.current = null; + this.helper = null; + this.cancelHelperRemoval = false; + }, + + // From now on bulk stuff - mainly helpers + + _trigger: function(type, event, ui) { + ui = ui || this._uiHash(); + $.ui.plugin.call(this, type, [event, ui]); + if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins + return $.Widget.prototype._trigger.call(this, type, event, ui); + }, + + plugins: {}, + + _uiHash: function(event) { + return { + helper: this.helper, + position: this.position, + originalPosition: this.originalPosition, + offset: this.positionAbs + }; + } + +}); + +$.extend($.ui.draggable, { + version: "1.8.21" +}); + +$.ui.plugin.add("draggable", "connectToSortable", { + start: function(event, ui) { + + var inst = $(this).data("draggable"), o = inst.options, + uiSortable = $.extend({}, ui, { item: inst.element }); + inst.sortables = []; + $(o.connectToSortable).each(function() { + var sortable = $.data(this, 'sortable'); + if (sortable && !sortable.options.disabled) { + inst.sortables.push({ + instance: sortable, + shouldRevert: sortable.options.revert + }); + sortable.refreshPositions(); // Call the sortable's refreshPositions at drag start to refresh the containerCache since the sortable container cache is used in drag and needs to be up to date (this will ensure it's initialised as well as being kept in step with any changes that might have happened on the page). + sortable._trigger("activate", event, uiSortable); + } + }); + + }, + stop: function(event, ui) { + + //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper + var inst = $(this).data("draggable"), + uiSortable = $.extend({}, ui, { item: inst.element }); + + $.each(inst.sortables, function() { + if(this.instance.isOver) { + + this.instance.isOver = 0; + + inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance + this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work) + + //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid' + if(this.shouldRevert) this.instance.options.revert = true; + + //Trigger the stop of the sortable + this.instance._mouseStop(event); + + this.instance.options.helper = this.instance.options._helper; + + //If the helper has been the original item, restore properties in the sortable + if(inst.options.helper == 'original') + this.instance.currentItem.css({ top: 'auto', left: 'auto' }); + + } else { + this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance + this.instance._trigger("deactivate", event, uiSortable); + } + + }); + + }, + drag: function(event, ui) { + + var inst = $(this).data("draggable"), self = this; + + var checkPos = function(o) { + var dyClick = this.offset.click.top, dxClick = this.offset.click.left; + var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left; + var itemHeight = o.height, itemWidth = o.width; + var itemTop = o.top, itemLeft = o.left; + + return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth); + }; + + $.each(inst.sortables, function(i) { + + //Copy over some variables to allow calling the sortable's native _intersectsWith + this.instance.positionAbs = inst.positionAbs; + this.instance.helperProportions = inst.helperProportions; + this.instance.offset.click = inst.offset.click; + + if(this.instance._intersectsWith(this.instance.containerCache)) { + + //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once + if(!this.instance.isOver) { + + this.instance.isOver = 1; + //Now we fake the start of dragging for the sortable instance, + //by cloning the list group item, appending it to the sortable and using it as inst.currentItem + //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one) + this.instance.currentItem = $(self).clone().removeAttr('id').appendTo(this.instance.element).data("sortable-item", true); + this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it + this.instance.options.helper = function() { return ui.helper[0]; }; + + event.target = this.instance.currentItem[0]; + this.instance._mouseCapture(event, true); + this.instance._mouseStart(event, true, true); + + //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes + this.instance.offset.click.top = inst.offset.click.top; + this.instance.offset.click.left = inst.offset.click.left; + this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left; + this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top; + + inst._trigger("toSortable", event); + inst.dropped = this.instance.element; //draggable revert needs that + //hack so receive/update callbacks work (mostly) + inst.currentItem = inst.element; + this.instance.fromOutside = inst; + + } + + //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable + if(this.instance.currentItem) this.instance._mouseDrag(event); + + } else { + + //If it doesn't intersect with the sortable, and it intersected before, + //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval + if(this.instance.isOver) { + + this.instance.isOver = 0; + this.instance.cancelHelperRemoval = true; + + //Prevent reverting on this forced stop + this.instance.options.revert = false; + + // The out event needs to be triggered independently + this.instance._trigger('out', event, this.instance._uiHash(this.instance)); + + this.instance._mouseStop(event, true); + this.instance.options.helper = this.instance.options._helper; + + //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size + this.instance.currentItem.remove(); + if(this.instance.placeholder) this.instance.placeholder.remove(); + + inst._trigger("fromSortable", event); + inst.dropped = false; //draggable revert needs that + } + + }; + + }); + + } +}); + +$.ui.plugin.add("draggable", "cursor", { + start: function(event, ui) { + var t = $('body'), o = $(this).data('draggable').options; + if (t.css("cursor")) o._cursor = t.css("cursor"); + t.css("cursor", o.cursor); + }, + stop: function(event, ui) { + var o = $(this).data('draggable').options; + if (o._cursor) $('body').css("cursor", o._cursor); + } +}); + +$.ui.plugin.add("draggable", "opacity", { + start: function(event, ui) { + var t = $(ui.helper), o = $(this).data('draggable').options; + if(t.css("opacity")) o._opacity = t.css("opacity"); + t.css('opacity', o.opacity); + }, + stop: function(event, ui) { + var o = $(this).data('draggable').options; + if(o._opacity) $(ui.helper).css('opacity', o._opacity); + } +}); + +$.ui.plugin.add("draggable", "scroll", { + start: function(event, ui) { + var i = $(this).data("draggable"); + if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset(); + }, + drag: function(event, ui) { + + var i = $(this).data("draggable"), o = i.options, scrolled = false; + + if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') { + + if(!o.axis || o.axis != 'x') { + if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) + i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed; + else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity) + i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed; + } + + if(!o.axis || o.axis != 'y') { + if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) + i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed; + else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity) + i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed; + } + + } else { + + if(!o.axis || o.axis != 'x') { + if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); + else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); + } + + if(!o.axis || o.axis != 'y') { + if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); + else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); + } + + } + + if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(i, event); + + } +}); + +$.ui.plugin.add("draggable", "snap", { + start: function(event, ui) { + + var i = $(this).data("draggable"), o = i.options; + i.snapElements = []; + + $(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() { + var $t = $(this); var $o = $t.offset(); + if(this != i.element[0]) i.snapElements.push({ + item: this, + width: $t.outerWidth(), height: $t.outerHeight(), + top: $o.top, left: $o.left + }); + }); + + }, + drag: function(event, ui) { + + var inst = $(this).data("draggable"), o = inst.options; + var d = o.snapTolerance; + + var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width, + y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height; + + for (var i = inst.snapElements.length - 1; i >= 0; i--){ + + var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width, + t = inst.snapElements[i].top, b = t + inst.snapElements[i].height; + + //Yes, I know, this is insane ;) + if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) { + if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); + inst.snapElements[i].snapping = false; + continue; + } + + if(o.snapMode != 'inner') { + var ts = Math.abs(t - y2) <= d; + var bs = Math.abs(b - y1) <= d; + var ls = Math.abs(l - x2) <= d; + var rs = Math.abs(r - x1) <= d; + if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top; + if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top; + if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left; + if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left; + } + + var first = (ts || bs || ls || rs); + + if(o.snapMode != 'outer') { + var ts = Math.abs(t - y1) <= d; + var bs = Math.abs(b - y2) <= d; + var ls = Math.abs(l - x1) <= d; + var rs = Math.abs(r - x2) <= d; + if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top; + if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top; + if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left; + if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left; + } + + if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) + (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); + inst.snapElements[i].snapping = (ts || bs || ls || rs || first); + + }; + + } +}); + +$.ui.plugin.add("draggable", "stack", { + start: function(event, ui) { + + var o = $(this).data("draggable").options; + + var group = $.makeArray($(o.stack)).sort(function(a,b) { + return (parseInt($(a).css("zIndex"),10) || 0) - (parseInt($(b).css("zIndex"),10) || 0); + }); + if (!group.length) { return; } + + var min = parseInt(group[0].style.zIndex) || 0; + $(group).each(function(i) { + this.style.zIndex = min + i; + }); + + this[0].style.zIndex = min + group.length; + + } +}); + +$.ui.plugin.add("draggable", "zIndex", { + start: function(event, ui) { + var t = $(ui.helper), o = $(this).data("draggable").options; + if(t.css("zIndex")) o._zIndex = t.css("zIndex"); + t.css('zIndex', o.zIndex); + }, + stop: function(event, ui) { + var o = $(this).data("draggable").options; + if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex); + } +}); + +})(jQuery); +/*! + * jQuery UI Droppable 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Droppables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.mouse.js + * jquery.ui.draggable.js + */ +(function( $, undefined ) { + +$.widget("ui.droppable", { + widgetEventPrefix: "drop", + options: { + accept: '*', + activeClass: false, + addClasses: true, + greedy: false, + hoverClass: false, + scope: 'default', + tolerance: 'intersect' + }, + _create: function() { + + var o = this.options, accept = o.accept; + this.isover = 0; this.isout = 1; + + this.accept = $.isFunction(accept) ? accept : function(d) { + return d.is(accept); + }; + + //Store the droppable's proportions + this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight }; + + // Add the reference and positions to the manager + $.ui.ddmanager.droppables[o.scope] = $.ui.ddmanager.droppables[o.scope] || []; + $.ui.ddmanager.droppables[o.scope].push(this); + + (o.addClasses && this.element.addClass("ui-droppable")); + + }, + + destroy: function() { + var drop = $.ui.ddmanager.droppables[this.options.scope]; + for ( var i = 0; i < drop.length; i++ ) + if ( drop[i] == this ) + drop.splice(i, 1); + + this.element + .removeClass("ui-droppable ui-droppable-disabled") + .removeData("droppable") + .unbind(".droppable"); + + return this; + }, + + _setOption: function(key, value) { + + if(key == 'accept') { + this.accept = $.isFunction(value) ? value : function(d) { + return d.is(value); + }; + } + $.Widget.prototype._setOption.apply(this, arguments); + }, + + _activate: function(event) { + var draggable = $.ui.ddmanager.current; + if(this.options.activeClass) this.element.addClass(this.options.activeClass); + (draggable && this._trigger('activate', event, this.ui(draggable))); + }, + + _deactivate: function(event) { + var draggable = $.ui.ddmanager.current; + if(this.options.activeClass) this.element.removeClass(this.options.activeClass); + (draggable && this._trigger('deactivate', event, this.ui(draggable))); + }, + + _over: function(event) { + + var draggable = $.ui.ddmanager.current; + if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element + + if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + if(this.options.hoverClass) this.element.addClass(this.options.hoverClass); + this._trigger('over', event, this.ui(draggable)); + } + + }, + + _out: function(event) { + + var draggable = $.ui.ddmanager.current; + if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element + + if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass); + this._trigger('out', event, this.ui(draggable)); + } + + }, + + _drop: function(event,custom) { + + var draggable = custom || $.ui.ddmanager.current; + if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element + + var childrenIntersection = false; + this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function() { + var inst = $.data(this, 'droppable'); + if( + inst.options.greedy + && !inst.options.disabled + && inst.options.scope == draggable.options.scope + && inst.accept.call(inst.element[0], (draggable.currentItem || draggable.element)) + && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance) + ) { childrenIntersection = true; return false; } + }); + if(childrenIntersection) return false; + + if(this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + if(this.options.activeClass) this.element.removeClass(this.options.activeClass); + if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass); + this._trigger('drop', event, this.ui(draggable)); + return this.element; + } + + return false; + + }, + + ui: function(c) { + return { + draggable: (c.currentItem || c.element), + helper: c.helper, + position: c.position, + offset: c.positionAbs + }; + } + +}); + +$.extend($.ui.droppable, { + version: "1.8.21" +}); + +$.ui.intersect = function(draggable, droppable, toleranceMode) { + + if (!droppable.offset) return false; + + var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width, + y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height; + var l = droppable.offset.left, r = l + droppable.proportions.width, + t = droppable.offset.top, b = t + droppable.proportions.height; + + switch (toleranceMode) { + case 'fit': + return (l <= x1 && x2 <= r + && t <= y1 && y2 <= b); + break; + case 'intersect': + return (l < x1 + (draggable.helperProportions.width / 2) // Right Half + && x2 - (draggable.helperProportions.width / 2) < r // Left Half + && t < y1 + (draggable.helperProportions.height / 2) // Bottom Half + && y2 - (draggable.helperProportions.height / 2) < b ); // Top Half + break; + case 'pointer': + var draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left), + draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top), + isOver = $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width); + return isOver; + break; + case 'touch': + return ( + (y1 >= t && y1 <= b) || // Top edge touching + (y2 >= t && y2 <= b) || // Bottom edge touching + (y1 < t && y2 > b) // Surrounded vertically + ) && ( + (x1 >= l && x1 <= r) || // Left edge touching + (x2 >= l && x2 <= r) || // Right edge touching + (x1 < l && x2 > r) // Surrounded horizontally + ); + break; + default: + return false; + break; + } + +}; + +/* + This manager tracks offsets of draggables and droppables +*/ +$.ui.ddmanager = { + current: null, + droppables: { 'default': [] }, + prepareOffsets: function(t, event) { + + var m = $.ui.ddmanager.droppables[t.options.scope] || []; + var type = event ? event.type : null; // workaround for #2317 + var list = (t.currentItem || t.element).find(":data(droppable)").andSelf(); + + droppablesLoop: for (var i = 0; i < m.length; i++) { + + if(m[i].options.disabled || (t && !m[i].accept.call(m[i].element[0],(t.currentItem || t.element)))) continue; //No disabled and non-accepted + for (var j=0; j < list.length; j++) { if(list[j] == m[i].element[0]) { m[i].proportions.height = 0; continue droppablesLoop; } }; //Filter out elements in the current dragged item + m[i].visible = m[i].element.css("display") != "none"; if(!m[i].visible) continue; //If the element is not visible, continue + + if(type == "mousedown") m[i]._activate.call(m[i], event); //Activate the droppable if used directly from draggables + + m[i].offset = m[i].element.offset(); + m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight }; + + } + + }, + drop: function(draggable, event) { + + var dropped = false; + $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() { + + if(!this.options) return; + if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance)) + dropped = this._drop.call(this, event) || dropped; + + if (!this.options.disabled && this.visible && this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + this.isout = 1; this.isover = 0; + this._deactivate.call(this, event); + } + + }); + return dropped; + + }, + dragStart: function( draggable, event ) { + //Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003) + draggable.element.parents( ":not(body,html)" ).bind( "scroll.droppable", function() { + if( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event ); + }); + }, + drag: function(draggable, event) { + + //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse. + if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, event); + + //Run through all droppables and check their positions based on specific tolerance options + $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() { + + if(this.options.disabled || this.greedyChild || !this.visible) return; + var intersects = $.ui.intersect(draggable, this, this.options.tolerance); + + var c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null); + if(!c) return; + + var parentInstance; + if (this.options.greedy) { + var parent = this.element.parents(':data(droppable):eq(0)'); + if (parent.length) { + parentInstance = $.data(parent[0], 'droppable'); + parentInstance.greedyChild = (c == 'isover' ? 1 : 0); + } + } + + // we just moved into a greedy child + if (parentInstance && c == 'isover') { + parentInstance['isover'] = 0; + parentInstance['isout'] = 1; + parentInstance._out.call(parentInstance, event); + } + + this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0; + this[c == "isover" ? "_over" : "_out"].call(this, event); + + // we just moved out of a greedy child + if (parentInstance && c == 'isout') { + parentInstance['isout'] = 0; + parentInstance['isover'] = 1; + parentInstance._over.call(parentInstance, event); + } + }); + + }, + dragStop: function( draggable, event ) { + draggable.element.parents( ":not(body,html)" ).unbind( "scroll.droppable" ); + //Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003) + if( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event ); + } +}; + +})(jQuery); +/*! + * jQuery UI Resizable 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Resizables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget("ui.resizable", $.ui.mouse, { + widgetEventPrefix: "resize", + options: { + alsoResize: false, + animate: false, + animateDuration: "slow", + animateEasing: "swing", + aspectRatio: false, + autoHide: false, + containment: false, + ghost: false, + grid: false, + handles: "e,s,se", + helper: false, + maxHeight: null, + maxWidth: null, + minHeight: 10, + minWidth: 10, + zIndex: 1000 + }, + _create: function() { + + var self = this, o = this.options; + this.element.addClass("ui-resizable"); + + $.extend(this, { + _aspectRatio: !!(o.aspectRatio), + aspectRatio: o.aspectRatio, + originalElement: this.element, + _proportionallyResizeElements: [], + _helper: o.helper || o.ghost || o.animate ? o.helper || 'ui-resizable-helper' : null + }); + + //Wrap the element if it cannot hold child nodes + if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) { + + //Create a wrapper element and set the wrapper to the new current internal element + this.element.wrap( + $('
').css({ + position: this.element.css('position'), + width: this.element.outerWidth(), + height: this.element.outerHeight(), + top: this.element.css('top'), + left: this.element.css('left') + }) + ); + + //Overwrite the original this.element + this.element = this.element.parent().data( + "resizable", this.element.data('resizable') + ); + + this.elementIsWrapper = true; + + //Move margins to the wrapper + this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") }); + this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0}); + + //Prevent Safari textarea resize + this.originalResizeStyle = this.originalElement.css('resize'); + this.originalElement.css('resize', 'none'); + + //Push the actual element to our proportionallyResize internal array + this._proportionallyResizeElements.push(this.originalElement.css({ position: 'static', zoom: 1, display: 'block' })); + + // avoid IE jump (hard set the margin) + this.originalElement.css({ margin: this.originalElement.css('margin') }); + + // fix handlers offset + this._proportionallyResize(); + + } + + this.handles = o.handles || (!$('.ui-resizable-handle', this.element).length ? "e,s,se" : { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' }); + if(this.handles.constructor == String) { + + if(this.handles == 'all') this.handles = 'n,e,s,w,se,sw,ne,nw'; + var n = this.handles.split(","); this.handles = {}; + + for(var i = 0; i < n.length; i++) { + + var handle = $.trim(n[i]), hname = 'ui-resizable-'+handle; + var axis = $('
'); + + // Apply zIndex to all handles - see #7960 + axis.css({ zIndex: o.zIndex }); + + //TODO : What's going on here? + if ('se' == handle) { + axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se'); + }; + + //Insert into internal handles object and append to element + this.handles[handle] = '.ui-resizable-'+handle; + this.element.append(axis); + } + + } + + this._renderAxis = function(target) { + + target = target || this.element; + + for(var i in this.handles) { + + if(this.handles[i].constructor == String) + this.handles[i] = $(this.handles[i], this.element).show(); + + //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls) + if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) { + + var axis = $(this.handles[i], this.element), padWrapper = 0; + + //Checking the correct pad and border + padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth(); + + //The padding type i have to apply... + var padPos = [ 'padding', + /ne|nw|n/.test(i) ? 'Top' : + /se|sw|s/.test(i) ? 'Bottom' : + /^e$/.test(i) ? 'Right' : 'Left' ].join(""); + + target.css(padPos, padWrapper); + + this._proportionallyResize(); + + } + + //TODO: What's that good for? There's not anything to be executed left + if(!$(this.handles[i]).length) + continue; + + } + }; + + //TODO: make renderAxis a prototype function + this._renderAxis(this.element); + + this._handles = $('.ui-resizable-handle', this.element) + .disableSelection(); + + //Matching axis name + this._handles.mouseover(function() { + if (!self.resizing) { + if (this.className) + var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i); + //Axis, default = se + self.axis = axis && axis[1] ? axis[1] : 'se'; + } + }); + + //If we want to auto hide the elements + if (o.autoHide) { + this._handles.hide(); + $(this.element) + .addClass("ui-resizable-autohide") + .hover(function() { + if (o.disabled) return; + $(this).removeClass("ui-resizable-autohide"); + self._handles.show(); + }, + function(){ + if (o.disabled) return; + if (!self.resizing) { + $(this).addClass("ui-resizable-autohide"); + self._handles.hide(); + } + }); + } + + //Initialize the mouse interaction + this._mouseInit(); + + }, + + destroy: function() { + + this._mouseDestroy(); + + var _destroy = function(exp) { + $(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing") + .removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove(); + }; + + //TODO: Unwrap at same DOM position + if (this.elementIsWrapper) { + _destroy(this.element); + var wrapper = this.element; + wrapper.after( + this.originalElement.css({ + position: wrapper.css('position'), + width: wrapper.outerWidth(), + height: wrapper.outerHeight(), + top: wrapper.css('top'), + left: wrapper.css('left') + }) + ).remove(); + } + + this.originalElement.css('resize', this.originalResizeStyle); + _destroy(this.originalElement); + + return this; + }, + + _mouseCapture: function(event) { + var handle = false; + for (var i in this.handles) { + if ($(this.handles[i])[0] == event.target) { + handle = true; + } + } + + return !this.options.disabled && handle; + }, + + _mouseStart: function(event) { + + var o = this.options, iniPos = this.element.position(), el = this.element; + + this.resizing = true; + this.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() }; + + // bugfix for http://dev.jquery.com/ticket/1749 + if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) { + el.css({ position: 'absolute', top: iniPos.top, left: iniPos.left }); + } + + this._renderProxy(); + + var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top')); + + if (o.containment) { + curleft += $(o.containment).scrollLeft() || 0; + curtop += $(o.containment).scrollTop() || 0; + } + + //Store needed variables + this.offset = this.helper.offset(); + this.position = { left: curleft, top: curtop }; + this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; + this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; + this.originalPosition = { left: curleft, top: curtop }; + this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() }; + this.originalMousePosition = { left: event.pageX, top: event.pageY }; + + //Aspect Ratio + this.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1); + + var cursor = $('.ui-resizable-' + this.axis).css('cursor'); + $('body').css('cursor', cursor == 'auto' ? this.axis + '-resize' : cursor); + + el.addClass("ui-resizable-resizing"); + this._propagate("start", event); + return true; + }, + + _mouseDrag: function(event) { + + //Increase performance, avoid regex + var el = this.helper, o = this.options, props = {}, + self = this, smp = this.originalMousePosition, a = this.axis; + + var dx = (event.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0; + var trigger = this._change[a]; + if (!trigger) return false; + + // Calculate the attrs that will be change + var data = trigger.apply(this, [event, dx, dy]), ie6 = $.browser.msie && $.browser.version < 7, csdif = this.sizeDiff; + + // Put this in the mouseDrag handler since the user can start pressing shift while resizing + this._updateVirtualBoundaries(event.shiftKey); + if (this._aspectRatio || event.shiftKey) + data = this._updateRatio(data, event); + + data = this._respectSize(data, event); + + // plugins callbacks need to be called first + this._propagate("resize", event); + + el.css({ + top: this.position.top + "px", left: this.position.left + "px", + width: this.size.width + "px", height: this.size.height + "px" + }); + + if (!this._helper && this._proportionallyResizeElements.length) + this._proportionallyResize(); + + this._updateCache(data); + + // calling the user callback at the end + this._trigger('resize', event, this.ui()); + + return false; + }, + + _mouseStop: function(event) { + + this.resizing = false; + var o = this.options, self = this; + + if(this._helper) { + var pr = this._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName), + soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height, + soffsetw = ista ? 0 : self.sizeDiff.width; + + var s = { width: (self.helper.width() - soffsetw), height: (self.helper.height() - soffseth) }, + left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null, + top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null; + + if (!o.animate) + this.element.css($.extend(s, { top: top, left: left })); + + self.helper.height(self.size.height); + self.helper.width(self.size.width); + + if (this._helper && !o.animate) this._proportionallyResize(); + } + + $('body').css('cursor', 'auto'); + + this.element.removeClass("ui-resizable-resizing"); + + this._propagate("stop", event); + + if (this._helper) this.helper.remove(); + return false; + + }, + + _updateVirtualBoundaries: function(forceAspectRatio) { + var o = this.options, pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b; + + b = { + minWidth: isNumber(o.minWidth) ? o.minWidth : 0, + maxWidth: isNumber(o.maxWidth) ? o.maxWidth : Infinity, + minHeight: isNumber(o.minHeight) ? o.minHeight : 0, + maxHeight: isNumber(o.maxHeight) ? o.maxHeight : Infinity + }; + + if(this._aspectRatio || forceAspectRatio) { + // We want to create an enclosing box whose aspect ration is the requested one + // First, compute the "projected" size for each dimension based on the aspect ratio and other dimension + pMinWidth = b.minHeight * this.aspectRatio; + pMinHeight = b.minWidth / this.aspectRatio; + pMaxWidth = b.maxHeight * this.aspectRatio; + pMaxHeight = b.maxWidth / this.aspectRatio; + + if(pMinWidth > b.minWidth) b.minWidth = pMinWidth; + if(pMinHeight > b.minHeight) b.minHeight = pMinHeight; + if(pMaxWidth < b.maxWidth) b.maxWidth = pMaxWidth; + if(pMaxHeight < b.maxHeight) b.maxHeight = pMaxHeight; + } + this._vBoundaries = b; + }, + + _updateCache: function(data) { + var o = this.options; + this.offset = this.helper.offset(); + if (isNumber(data.left)) this.position.left = data.left; + if (isNumber(data.top)) this.position.top = data.top; + if (isNumber(data.height)) this.size.height = data.height; + if (isNumber(data.width)) this.size.width = data.width; + }, + + _updateRatio: function(data, event) { + + var o = this.options, cpos = this.position, csize = this.size, a = this.axis; + + if (isNumber(data.height)) data.width = (data.height * this.aspectRatio); + else if (isNumber(data.width)) data.height = (data.width / this.aspectRatio); + + if (a == 'sw') { + data.left = cpos.left + (csize.width - data.width); + data.top = null; + } + if (a == 'nw') { + data.top = cpos.top + (csize.height - data.height); + data.left = cpos.left + (csize.width - data.width); + } + + return data; + }, + + _respectSize: function(data, event) { + + var el = this.helper, o = this._vBoundaries, pRatio = this._aspectRatio || event.shiftKey, a = this.axis, + ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height), + isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height); + + if (isminw) data.width = o.minWidth; + if (isminh) data.height = o.minHeight; + if (ismaxw) data.width = o.maxWidth; + if (ismaxh) data.height = o.maxHeight; + + var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height; + var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a); + + if (isminw && cw) data.left = dw - o.minWidth; + if (ismaxw && cw) data.left = dw - o.maxWidth; + if (isminh && ch) data.top = dh - o.minHeight; + if (ismaxh && ch) data.top = dh - o.maxHeight; + + // fixing jump error on top/left - bug #2330 + var isNotwh = !data.width && !data.height; + if (isNotwh && !data.left && data.top) data.top = null; + else if (isNotwh && !data.top && data.left) data.left = null; + + return data; + }, + + _proportionallyResize: function() { + + var o = this.options; + if (!this._proportionallyResizeElements.length) return; + var element = this.helper || this.element; + + for (var i=0; i < this._proportionallyResizeElements.length; i++) { + + var prel = this._proportionallyResizeElements[i]; + + if (!this.borderDif) { + var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')], + p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')]; + + this.borderDif = $.map(b, function(v, i) { + var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0; + return border + padding; + }); + } + + if ($.browser.msie && !(!($(element).is(':hidden') || $(element).parents(':hidden').length))) + continue; + + prel.css({ + height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0, + width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0 + }); + + }; + + }, + + _renderProxy: function() { + + var el = this.element, o = this.options; + this.elementOffset = el.offset(); + + if(this._helper) { + + this.helper = this.helper || $('
'); + + // fix ie6 offset TODO: This seems broken + var ie6 = $.browser.msie && $.browser.version < 7, ie6offset = (ie6 ? 1 : 0), + pxyoffset = ( ie6 ? 2 : -1 ); + + this.helper.addClass(this._helper).css({ + width: this.element.outerWidth() + pxyoffset, + height: this.element.outerHeight() + pxyoffset, + position: 'absolute', + left: this.elementOffset.left - ie6offset +'px', + top: this.elementOffset.top - ie6offset +'px', + zIndex: ++o.zIndex //TODO: Don't modify option + }); + + this.helper + .appendTo("body") + .disableSelection(); + + } else { + this.helper = this.element; + } + + }, + + _change: { + e: function(event, dx, dy) { + return { width: this.originalSize.width + dx }; + }, + w: function(event, dx, dy) { + var o = this.options, cs = this.originalSize, sp = this.originalPosition; + return { left: sp.left + dx, width: cs.width - dx }; + }, + n: function(event, dx, dy) { + var o = this.options, cs = this.originalSize, sp = this.originalPosition; + return { top: sp.top + dy, height: cs.height - dy }; + }, + s: function(event, dx, dy) { + return { height: this.originalSize.height + dy }; + }, + se: function(event, dx, dy) { + return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy])); + }, + sw: function(event, dx, dy) { + return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy])); + }, + ne: function(event, dx, dy) { + return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy])); + }, + nw: function(event, dx, dy) { + return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy])); + } + }, + + _propagate: function(n, event) { + $.ui.plugin.call(this, n, [event, this.ui()]); + (n != "resize" && this._trigger(n, event, this.ui())); + }, + + plugins: {}, + + ui: function() { + return { + originalElement: this.originalElement, + element: this.element, + helper: this.helper, + position: this.position, + size: this.size, + originalSize: this.originalSize, + originalPosition: this.originalPosition + }; + } + +}); + +$.extend($.ui.resizable, { + version: "1.8.21" +}); + +/* + * Resizable Extensions + */ + +$.ui.plugin.add("resizable", "alsoResize", { + + start: function (event, ui) { + var self = $(this).data("resizable"), o = self.options; + + var _store = function (exp) { + $(exp).each(function() { + var el = $(this); + el.data("resizable-alsoresize", { + width: parseInt(el.width(), 10), height: parseInt(el.height(), 10), + left: parseInt(el.css('left'), 10), top: parseInt(el.css('top'), 10) + }); + }); + }; + + if (typeof(o.alsoResize) == 'object' && !o.alsoResize.parentNode) { + if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); } + else { $.each(o.alsoResize, function (exp) { _store(exp); }); } + }else{ + _store(o.alsoResize); + } + }, + + resize: function (event, ui) { + var self = $(this).data("resizable"), o = self.options, os = self.originalSize, op = self.originalPosition; + + var delta = { + height: (self.size.height - os.height) || 0, width: (self.size.width - os.width) || 0, + top: (self.position.top - op.top) || 0, left: (self.position.left - op.left) || 0 + }, + + _alsoResize = function (exp, c) { + $(exp).each(function() { + var el = $(this), start = $(this).data("resizable-alsoresize"), style = {}, + css = c && c.length ? c : el.parents(ui.originalElement[0]).length ? ['width', 'height'] : ['width', 'height', 'top', 'left']; + + $.each(css, function (i, prop) { + var sum = (start[prop]||0) + (delta[prop]||0); + if (sum && sum >= 0) + style[prop] = sum || null; + }); + + el.css(style); + }); + }; + + if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) { + $.each(o.alsoResize, function (exp, c) { _alsoResize(exp, c); }); + }else{ + _alsoResize(o.alsoResize); + } + }, + + stop: function (event, ui) { + $(this).removeData("resizable-alsoresize"); + } +}); + +$.ui.plugin.add("resizable", "animate", { + + stop: function(event, ui) { + var self = $(this).data("resizable"), o = self.options; + + var pr = self._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName), + soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height, + soffsetw = ista ? 0 : self.sizeDiff.width; + + var style = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) }, + left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null, + top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null; + + self.element.animate( + $.extend(style, top && left ? { top: top, left: left } : {}), { + duration: o.animateDuration, + easing: o.animateEasing, + step: function() { + + var data = { + width: parseInt(self.element.css('width'), 10), + height: parseInt(self.element.css('height'), 10), + top: parseInt(self.element.css('top'), 10), + left: parseInt(self.element.css('left'), 10) + }; + + if (pr && pr.length) $(pr[0]).css({ width: data.width, height: data.height }); + + // propagating resize, and updating values for each animation step + self._updateCache(data); + self._propagate("resize", event); + + } + } + ); + } + +}); + +$.ui.plugin.add("resizable", "containment", { + + start: function(event, ui) { + var self = $(this).data("resizable"), o = self.options, el = self.element; + var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc; + if (!ce) return; + + self.containerElement = $(ce); + + if (/document/.test(oc) || oc == document) { + self.containerOffset = { left: 0, top: 0 }; + self.containerPosition = { left: 0, top: 0 }; + + self.parentData = { + element: $(document), left: 0, top: 0, + width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight + }; + } + + // i'm a node, so compute top, left, right, bottom + else { + var element = $(ce), p = []; + $([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); }); + + self.containerOffset = element.offset(); + self.containerPosition = element.position(); + self.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) }; + + var co = self.containerOffset, ch = self.containerSize.height, cw = self.containerSize.width, + width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch); + + self.parentData = { + element: ce, left: co.left, top: co.top, width: width, height: height + }; + } + }, + + resize: function(event, ui) { + var self = $(this).data("resizable"), o = self.options, + ps = self.containerSize, co = self.containerOffset, cs = self.size, cp = self.position, + pRatio = self._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = self.containerElement; + + if (ce[0] != document && (/static/).test(ce.css('position'))) cop = co; + + if (cp.left < (self._helper ? co.left : 0)) { + self.size.width = self.size.width + (self._helper ? (self.position.left - co.left) : (self.position.left - cop.left)); + if (pRatio) self.size.height = self.size.width / self.aspectRatio; + self.position.left = o.helper ? co.left : 0; + } + + if (cp.top < (self._helper ? co.top : 0)) { + self.size.height = self.size.height + (self._helper ? (self.position.top - co.top) : self.position.top); + if (pRatio) self.size.width = self.size.height * self.aspectRatio; + self.position.top = self._helper ? co.top : 0; + } + + self.offset.left = self.parentData.left+self.position.left; + self.offset.top = self.parentData.top+self.position.top; + + var woset = Math.abs( (self._helper ? self.offset.left - cop.left : (self.offset.left - cop.left)) + self.sizeDiff.width ), + hoset = Math.abs( (self._helper ? self.offset.top - cop.top : (self.offset.top - co.top)) + self.sizeDiff.height ); + + var isParent = self.containerElement.get(0) == self.element.parent().get(0), + isOffsetRelative = /relative|absolute/.test(self.containerElement.css('position')); + + if(isParent && isOffsetRelative) woset -= self.parentData.left; + + if (woset + self.size.width >= self.parentData.width) { + self.size.width = self.parentData.width - woset; + if (pRatio) self.size.height = self.size.width / self.aspectRatio; + } + + if (hoset + self.size.height >= self.parentData.height) { + self.size.height = self.parentData.height - hoset; + if (pRatio) self.size.width = self.size.height * self.aspectRatio; + } + }, + + stop: function(event, ui){ + var self = $(this).data("resizable"), o = self.options, cp = self.position, + co = self.containerOffset, cop = self.containerPosition, ce = self.containerElement; + + var helper = $(self.helper), ho = helper.offset(), w = helper.outerWidth() - self.sizeDiff.width, h = helper.outerHeight() - self.sizeDiff.height; + + if (self._helper && !o.animate && (/relative/).test(ce.css('position'))) + $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h }); + + if (self._helper && !o.animate && (/static/).test(ce.css('position'))) + $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h }); + + } +}); + +$.ui.plugin.add("resizable", "ghost", { + + start: function(event, ui) { + + var self = $(this).data("resizable"), o = self.options, cs = self.size; + + self.ghost = self.originalElement.clone(); + self.ghost + .css({ opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 }) + .addClass('ui-resizable-ghost') + .addClass(typeof o.ghost == 'string' ? o.ghost : ''); + + self.ghost.appendTo(self.helper); + + }, + + resize: function(event, ui){ + var self = $(this).data("resizable"), o = self.options; + if (self.ghost) self.ghost.css({ position: 'relative', height: self.size.height, width: self.size.width }); + }, + + stop: function(event, ui){ + var self = $(this).data("resizable"), o = self.options; + if (self.ghost && self.helper) self.helper.get(0).removeChild(self.ghost.get(0)); + } + +}); + +$.ui.plugin.add("resizable", "grid", { + + resize: function(event, ui) { + var self = $(this).data("resizable"), o = self.options, cs = self.size, os = self.originalSize, op = self.originalPosition, a = self.axis, ratio = o._aspectRatio || event.shiftKey; + o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid; + var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1); + + if (/^(se|s|e)$/.test(a)) { + self.size.width = os.width + ox; + self.size.height = os.height + oy; + } + else if (/^(ne)$/.test(a)) { + self.size.width = os.width + ox; + self.size.height = os.height + oy; + self.position.top = op.top - oy; + } + else if (/^(sw)$/.test(a)) { + self.size.width = os.width + ox; + self.size.height = os.height + oy; + self.position.left = op.left - ox; + } + else { + self.size.width = os.width + ox; + self.size.height = os.height + oy; + self.position.top = op.top - oy; + self.position.left = op.left - ox; + } + } + +}); + +var num = function(v) { + return parseInt(v, 10) || 0; +}; + +var isNumber = function(value) { + return !isNaN(parseInt(value, 10)); +}; + +})(jQuery); +/*! + * jQuery UI Selectable 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Selectables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget("ui.selectable", $.ui.mouse, { + options: { + appendTo: 'body', + autoRefresh: true, + distance: 0, + filter: '*', + tolerance: 'touch' + }, + _create: function() { + var self = this; + + this.element.addClass("ui-selectable"); + + this.dragged = false; + + // cache selectee children based on filter + var selectees; + this.refresh = function() { + selectees = $(self.options.filter, self.element[0]); + selectees.addClass("ui-selectee"); + selectees.each(function() { + var $this = $(this); + var pos = $this.offset(); + $.data(this, "selectable-item", { + element: this, + $element: $this, + left: pos.left, + top: pos.top, + right: pos.left + $this.outerWidth(), + bottom: pos.top + $this.outerHeight(), + startselected: false, + selected: $this.hasClass('ui-selected'), + selecting: $this.hasClass('ui-selecting'), + unselecting: $this.hasClass('ui-unselecting') + }); + }); + }; + this.refresh(); + + this.selectees = selectees.addClass("ui-selectee"); + + this._mouseInit(); + + this.helper = $("
"); + }, + + destroy: function() { + this.selectees + .removeClass("ui-selectee") + .removeData("selectable-item"); + this.element + .removeClass("ui-selectable ui-selectable-disabled") + .removeData("selectable") + .unbind(".selectable"); + this._mouseDestroy(); + + return this; + }, + + _mouseStart: function(event) { + var self = this; + + this.opos = [event.pageX, event.pageY]; + + if (this.options.disabled) + return; + + var options = this.options; + + this.selectees = $(options.filter, this.element[0]); + + this._trigger("start", event); + + $(options.appendTo).append(this.helper); + // position helper (lasso) + this.helper.css({ + "left": event.clientX, + "top": event.clientY, + "width": 0, + "height": 0 + }); + + if (options.autoRefresh) { + this.refresh(); + } + + this.selectees.filter('.ui-selected').each(function() { + var selectee = $.data(this, "selectable-item"); + selectee.startselected = true; + if (!event.metaKey && !event.ctrlKey) { + selectee.$element.removeClass('ui-selected'); + selectee.selected = false; + selectee.$element.addClass('ui-unselecting'); + selectee.unselecting = true; + // selectable UNSELECTING callback + self._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + }); + + $(event.target).parents().andSelf().each(function() { + var selectee = $.data(this, "selectable-item"); + if (selectee) { + var doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass('ui-selected'); + selectee.$element + .removeClass(doSelect ? "ui-unselecting" : "ui-selected") + .addClass(doSelect ? "ui-selecting" : "ui-unselecting"); + selectee.unselecting = !doSelect; + selectee.selecting = doSelect; + selectee.selected = doSelect; + // selectable (UN)SELECTING callback + if (doSelect) { + self._trigger("selecting", event, { + selecting: selectee.element + }); + } else { + self._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + return false; + } + }); + + }, + + _mouseDrag: function(event) { + var self = this; + this.dragged = true; + + if (this.options.disabled) + return; + + var options = this.options; + + var x1 = this.opos[0], y1 = this.opos[1], x2 = event.pageX, y2 = event.pageY; + if (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; } + if (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; } + this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1}); + + this.selectees.each(function() { + var selectee = $.data(this, "selectable-item"); + //prevent helper from being selected if appendTo: selectable + if (!selectee || selectee.element == self.element[0]) + return; + var hit = false; + if (options.tolerance == 'touch') { + hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) ); + } else if (options.tolerance == 'fit') { + hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2); + } + + if (hit) { + // SELECT + if (selectee.selected) { + selectee.$element.removeClass('ui-selected'); + selectee.selected = false; + } + if (selectee.unselecting) { + selectee.$element.removeClass('ui-unselecting'); + selectee.unselecting = false; + } + if (!selectee.selecting) { + selectee.$element.addClass('ui-selecting'); + selectee.selecting = true; + // selectable SELECTING callback + self._trigger("selecting", event, { + selecting: selectee.element + }); + } + } else { + // UNSELECT + if (selectee.selecting) { + if ((event.metaKey || event.ctrlKey) && selectee.startselected) { + selectee.$element.removeClass('ui-selecting'); + selectee.selecting = false; + selectee.$element.addClass('ui-selected'); + selectee.selected = true; + } else { + selectee.$element.removeClass('ui-selecting'); + selectee.selecting = false; + if (selectee.startselected) { + selectee.$element.addClass('ui-unselecting'); + selectee.unselecting = true; + } + // selectable UNSELECTING callback + self._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + } + if (selectee.selected) { + if (!event.metaKey && !event.ctrlKey && !selectee.startselected) { + selectee.$element.removeClass('ui-selected'); + selectee.selected = false; + + selectee.$element.addClass('ui-unselecting'); + selectee.unselecting = true; + // selectable UNSELECTING callback + self._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + } + } + }); + + return false; + }, + + _mouseStop: function(event) { + var self = this; + + this.dragged = false; + + var options = this.options; + + $('.ui-unselecting', this.element[0]).each(function() { + var selectee = $.data(this, "selectable-item"); + selectee.$element.removeClass('ui-unselecting'); + selectee.unselecting = false; + selectee.startselected = false; + self._trigger("unselected", event, { + unselected: selectee.element + }); + }); + $('.ui-selecting', this.element[0]).each(function() { + var selectee = $.data(this, "selectable-item"); + selectee.$element.removeClass('ui-selecting').addClass('ui-selected'); + selectee.selecting = false; + selectee.selected = true; + selectee.startselected = true; + self._trigger("selected", event, { + selected: selectee.element + }); + }); + this._trigger("stop", event); + + this.helper.remove(); + + return false; + } + +}); + +$.extend($.ui.selectable, { + version: "1.8.21" +}); + +})(jQuery); +/*! + * jQuery UI Sortable 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Sortables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget("ui.sortable", $.ui.mouse, { + widgetEventPrefix: "sort", + ready: false, + options: { + appendTo: "parent", + axis: false, + connectWith: false, + containment: false, + cursor: 'auto', + cursorAt: false, + dropOnEmpty: true, + forcePlaceholderSize: false, + forceHelperSize: false, + grid: false, + handle: false, + helper: "original", + items: '> *', + opacity: false, + placeholder: false, + revert: false, + scroll: true, + scrollSensitivity: 20, + scrollSpeed: 20, + scope: "default", + tolerance: "intersect", + zIndex: 1000 + }, + _create: function() { + + var o = this.options; + this.containerCache = {}; + this.element.addClass("ui-sortable"); + + //Get the items + this.refresh(); + + //Let's determine if the items are being displayed horizontally + this.floating = this.items.length ? o.axis === 'x' || (/left|right/).test(this.items[0].item.css('float')) || (/inline|table-cell/).test(this.items[0].item.css('display')) : false; + + //Let's determine the parent's offset + this.offset = this.element.offset(); + + //Initialize mouse events for interaction + this._mouseInit(); + + //We're ready to go + this.ready = true + + }, + + destroy: function() { + $.Widget.prototype.destroy.call( this ); + this.element + .removeClass("ui-sortable ui-sortable-disabled"); + this._mouseDestroy(); + + for ( var i = this.items.length - 1; i >= 0; i-- ) + this.items[i].item.removeData(this.widgetName + "-item"); + + return this; + }, + + _setOption: function(key, value){ + if ( key === "disabled" ) { + this.options[ key ] = value; + + this.widget() + [ value ? "addClass" : "removeClass"]( "ui-sortable-disabled" ); + } else { + // Don't call widget base _setOption for disable as it adds ui-state-disabled class + $.Widget.prototype._setOption.apply(this, arguments); + } + }, + + _mouseCapture: function(event, overrideHandle) { + var that = this; + + if (this.reverting) { + return false; + } + + if(this.options.disabled || this.options.type == 'static') return false; + + //We have to refresh the items data once first + this._refreshItems(event); + + //Find out if the clicked node (or one of its parents) is a actual item in this.items + var currentItem = null, self = this, nodes = $(event.target).parents().each(function() { + if($.data(this, that.widgetName + '-item') == self) { + currentItem = $(this); + return false; + } + }); + if($.data(event.target, that.widgetName + '-item') == self) currentItem = $(event.target); + + if(!currentItem) return false; + if(this.options.handle && !overrideHandle) { + var validHandle = false; + + $(this.options.handle, currentItem).find("*").andSelf().each(function() { if(this == event.target) validHandle = true; }); + if(!validHandle) return false; + } + + this.currentItem = currentItem; + this._removeCurrentsFromItems(); + return true; + + }, + + _mouseStart: function(event, overrideHandle, noActivation) { + + var o = this.options, self = this; + this.currentContainer = this; + + //We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture + this.refreshPositions(); + + //Create and append the visible helper + this.helper = this._createHelper(event); + + //Cache the helper size + this._cacheHelperProportions(); + + /* + * - Position generation - + * This block generates everything position related - it's the core of draggables. + */ + + //Cache the margins of the original element + this._cacheMargins(); + + //Get the next scrolling parent + this.scrollParent = this.helper.scrollParent(); + + //The element's absolute position on the page minus margins + this.offset = this.currentItem.offset(); + this.offset = { + top: this.offset.top - this.margins.top, + left: this.offset.left - this.margins.left + }; + + $.extend(this.offset, { + click: { //Where the click happened, relative to the element + left: event.pageX - this.offset.left, + top: event.pageY - this.offset.top + }, + parent: this._getParentOffset(), + relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper + }); + + // Only after we got the offset, we can change the helper's position to absolute + // TODO: Still need to figure out a way to make relative sorting possible + this.helper.css("position", "absolute"); + this.cssPosition = this.helper.css("position"); + + //Generate the original position + this.originalPosition = this._generatePosition(event); + this.originalPageX = event.pageX; + this.originalPageY = event.pageY; + + //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied + (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt)); + + //Cache the former DOM position + this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] }; + + //If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way + if(this.helper[0] != this.currentItem[0]) { + this.currentItem.hide(); + } + + //Create the placeholder + this._createPlaceholder(); + + //Set a containment if given in the options + if(o.containment) + this._setContainment(); + + if(o.cursor) { // cursor option + if ($('body').css("cursor")) this._storedCursor = $('body').css("cursor"); + $('body').css("cursor", o.cursor); + } + + if(o.opacity) { // opacity option + if (this.helper.css("opacity")) this._storedOpacity = this.helper.css("opacity"); + this.helper.css("opacity", o.opacity); + } + + if(o.zIndex) { // zIndex option + if (this.helper.css("zIndex")) this._storedZIndex = this.helper.css("zIndex"); + this.helper.css("zIndex", o.zIndex); + } + + //Prepare scrolling + if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') + this.overflowOffset = this.scrollParent.offset(); + + //Call callbacks + this._trigger("start", event, this._uiHash()); + + //Recache the helper size + if(!this._preserveHelperProportions) + this._cacheHelperProportions(); + + + //Post 'activate' events to possible containers + if(!noActivation) { + for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i]._trigger("activate", event, self._uiHash(this)); } + } + + //Prepare possible droppables + if($.ui.ddmanager) + $.ui.ddmanager.current = this; + + if ($.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(this, event); + + this.dragging = true; + + this.helper.addClass("ui-sortable-helper"); + this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position + return true; + + }, + + _mouseDrag: function(event) { + + //Compute the helpers position + this.position = this._generatePosition(event); + this.positionAbs = this._convertPositionTo("absolute"); + + if (!this.lastPositionAbs) { + this.lastPositionAbs = this.positionAbs; + } + + //Do scrolling + if(this.options.scroll) { + var o = this.options, scrolled = false; + if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') { + + if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) + this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed; + else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity) + this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed; + + if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) + this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed; + else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity) + this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed; + + } else { + + if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); + else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); + + if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); + else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); + + } + + if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(this, event); + } + + //Regenerate the absolute position used for position checks + this.positionAbs = this._convertPositionTo("absolute"); + + //Set the helper position + if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px'; + if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px'; + + //Rearrange + for (var i = this.items.length - 1; i >= 0; i--) { + + //Cache variables and intersection, continue if no intersection + var item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item); + if (!intersection) continue; + + if(itemElement != this.currentItem[0] //cannot intersect with itself + && this.placeholder[intersection == 1 ? "next" : "prev"]()[0] != itemElement //no useless actions that have been done before + && !$.ui.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked + && (this.options.type == 'semi-dynamic' ? !$.ui.contains(this.element[0], itemElement) : true) + //&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container + ) { + + this.direction = intersection == 1 ? "down" : "up"; + + if (this.options.tolerance == "pointer" || this._intersectsWithSides(item)) { + this._rearrange(event, item); + } else { + break; + } + + this._trigger("change", event, this._uiHash()); + break; + } + } + + //Post events to containers + this._contactContainers(event); + + //Interconnect with droppables + if($.ui.ddmanager) $.ui.ddmanager.drag(this, event); + + //Call callbacks + this._trigger('sort', event, this._uiHash()); + + this.lastPositionAbs = this.positionAbs; + return false; + + }, + + _mouseStop: function(event, noPropagation) { + + if(!event) return; + + //If we are using droppables, inform the manager about the drop + if ($.ui.ddmanager && !this.options.dropBehaviour) + $.ui.ddmanager.drop(this, event); + + if(this.options.revert) { + var self = this; + var cur = self.placeholder.offset(); + + self.reverting = true; + + $(this.helper).animate({ + left: cur.left - this.offset.parent.left - self.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft), + top: cur.top - this.offset.parent.top - self.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop) + }, parseInt(this.options.revert, 10) || 500, function() { + self._clear(event); + }); + } else { + this._clear(event, noPropagation); + } + + return false; + + }, + + cancel: function() { + + var self = this; + + if(this.dragging) { + + this._mouseUp({ target: null }); + + if(this.options.helper == "original") + this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"); + else + this.currentItem.show(); + + //Post deactivating events to containers + for (var i = this.containers.length - 1; i >= 0; i--){ + this.containers[i]._trigger("deactivate", null, self._uiHash(this)); + if(this.containers[i].containerCache.over) { + this.containers[i]._trigger("out", null, self._uiHash(this)); + this.containers[i].containerCache.over = 0; + } + } + + } + + if (this.placeholder) { + //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node! + if(this.placeholder[0].parentNode) this.placeholder[0].parentNode.removeChild(this.placeholder[0]); + if(this.options.helper != "original" && this.helper && this.helper[0].parentNode) this.helper.remove(); + + $.extend(this, { + helper: null, + dragging: false, + reverting: false, + _noFinalSort: null + }); + + if(this.domPosition.prev) { + $(this.domPosition.prev).after(this.currentItem); + } else { + $(this.domPosition.parent).prepend(this.currentItem); + } + } + + return this; + + }, + + serialize: function(o) { + + var items = this._getItemsAsjQuery(o && o.connected); + var str = []; o = o || {}; + + $(items).each(function() { + var res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/)); + if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2])); + }); + + if(!str.length && o.key) { + str.push(o.key + '='); + } + + return str.join('&'); + + }, + + toArray: function(o) { + + var items = this._getItemsAsjQuery(o && o.connected); + var ret = []; o = o || {}; + + items.each(function() { ret.push($(o.item || this).attr(o.attribute || 'id') || ''); }); + return ret; + + }, + + /* Be careful with the following core functions */ + _intersectsWith: function(item) { + + var x1 = this.positionAbs.left, + x2 = x1 + this.helperProportions.width, + y1 = this.positionAbs.top, + y2 = y1 + this.helperProportions.height; + + var l = item.left, + r = l + item.width, + t = item.top, + b = t + item.height; + + var dyClick = this.offset.click.top, + dxClick = this.offset.click.left; + + var isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r; + + if( this.options.tolerance == "pointer" + || this.options.forcePointerForContainers + || (this.options.tolerance != "pointer" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height']) + ) { + return isOverElement; + } else { + + return (l < x1 + (this.helperProportions.width / 2) // Right Half + && x2 - (this.helperProportions.width / 2) < r // Left Half + && t < y1 + (this.helperProportions.height / 2) // Bottom Half + && y2 - (this.helperProportions.height / 2) < b ); // Top Half + + } + }, + + _intersectsWithPointer: function(item) { + + var isOverElementHeight = (this.options.axis === 'x') || $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height), + isOverElementWidth = (this.options.axis === 'y') || $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width), + isOverElement = isOverElementHeight && isOverElementWidth, + verticalDirection = this._getDragVerticalDirection(), + horizontalDirection = this._getDragHorizontalDirection(); + + if (!isOverElement) + return false; + + return this.floating ? + ( ((horizontalDirection && horizontalDirection == "right") || verticalDirection == "down") ? 2 : 1 ) + : ( verticalDirection && (verticalDirection == "down" ? 2 : 1) ); + + }, + + _intersectsWithSides: function(item) { + + var isOverBottomHalf = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height), + isOverRightHalf = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width), + verticalDirection = this._getDragVerticalDirection(), + horizontalDirection = this._getDragHorizontalDirection(); + + if (this.floating && horizontalDirection) { + return ((horizontalDirection == "right" && isOverRightHalf) || (horizontalDirection == "left" && !isOverRightHalf)); + } else { + return verticalDirection && ((verticalDirection == "down" && isOverBottomHalf) || (verticalDirection == "up" && !isOverBottomHalf)); + } + + }, + + _getDragVerticalDirection: function() { + var delta = this.positionAbs.top - this.lastPositionAbs.top; + return delta != 0 && (delta > 0 ? "down" : "up"); + }, + + _getDragHorizontalDirection: function() { + var delta = this.positionAbs.left - this.lastPositionAbs.left; + return delta != 0 && (delta > 0 ? "right" : "left"); + }, + + refresh: function(event) { + this._refreshItems(event); + this.refreshPositions(); + return this; + }, + + _connectWith: function() { + var options = this.options; + return options.connectWith.constructor == String + ? [options.connectWith] + : options.connectWith; + }, + + _getItemsAsjQuery: function(connected) { + + var self = this; + var items = []; + var queries = []; + var connectWith = this._connectWith(); + + if(connectWith && connected) { + for (var i = connectWith.length - 1; i >= 0; i--){ + var cur = $(connectWith[i]); + for (var j = cur.length - 1; j >= 0; j--){ + var inst = $.data(cur[j], this.widgetName); + if(inst && inst != this && !inst.options.disabled) { + queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), inst]); + } + }; + }; + } + + queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), this]); + + for (var i = queries.length - 1; i >= 0; i--){ + queries[i][0].each(function() { + items.push(this); + }); + }; + + return $(items); + + }, + + _removeCurrentsFromItems: function() { + + var list = this.currentItem.find(":data(" + this.widgetName + "-item)"); + + for (var i=0; i < this.items.length; i++) { + + for (var j=0; j < list.length; j++) { + if(list[j] == this.items[i].item[0]) + this.items.splice(i,1); + }; + + }; + + }, + + _refreshItems: function(event) { + + this.items = []; + this.containers = [this]; + var items = this.items; + var self = this; + var queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]]; + var connectWith = this._connectWith(); + + if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down + for (var i = connectWith.length - 1; i >= 0; i--){ + var cur = $(connectWith[i]); + for (var j = cur.length - 1; j >= 0; j--){ + var inst = $.data(cur[j], this.widgetName); + if(inst && inst != this && !inst.options.disabled) { + queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]); + this.containers.push(inst); + } + }; + }; + } + + for (var i = queries.length - 1; i >= 0; i--) { + var targetData = queries[i][1]; + var _queries = queries[i][0]; + + for (var j=0, queriesLength = _queries.length; j < queriesLength; j++) { + var item = $(_queries[j]); + + item.data(this.widgetName + '-item', targetData); // Data for target checking (mouse manager) + + items.push({ + item: item, + instance: targetData, + width: 0, height: 0, + left: 0, top: 0 + }); + }; + }; + + }, + + refreshPositions: function(fast) { + + //This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change + if(this.offsetParent && this.helper) { + this.offset.parent = this._getParentOffset(); + } + + for (var i = this.items.length - 1; i >= 0; i--){ + var item = this.items[i]; + + //We ignore calculating positions of all connected containers when we're not over them + if(item.instance != this.currentContainer && this.currentContainer && item.item[0] != this.currentItem[0]) + continue; + + var t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item; + + if (!fast) { + item.width = t.outerWidth(); + item.height = t.outerHeight(); + } + + var p = t.offset(); + item.left = p.left; + item.top = p.top; + }; + + if(this.options.custom && this.options.custom.refreshContainers) { + this.options.custom.refreshContainers.call(this); + } else { + for (var i = this.containers.length - 1; i >= 0; i--){ + var p = this.containers[i].element.offset(); + this.containers[i].containerCache.left = p.left; + this.containers[i].containerCache.top = p.top; + this.containers[i].containerCache.width = this.containers[i].element.outerWidth(); + this.containers[i].containerCache.height = this.containers[i].element.outerHeight(); + }; + } + + return this; + }, + + _createPlaceholder: function(that) { + + var self = that || this, o = self.options; + + if(!o.placeholder || o.placeholder.constructor == String) { + var className = o.placeholder; + o.placeholder = { + element: function() { + + var el = $(document.createElement(self.currentItem[0].nodeName)) + .addClass(className || self.currentItem[0].className+" ui-sortable-placeholder") + .removeClass("ui-sortable-helper")[0]; + + if(!className) + el.style.visibility = "hidden"; + + return el; + }, + update: function(container, p) { + + // 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that + // 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified + if(className && !o.forcePlaceholderSize) return; + + //If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item + if(!p.height()) { p.height(self.currentItem.innerHeight() - parseInt(self.currentItem.css('paddingTop')||0, 10) - parseInt(self.currentItem.css('paddingBottom')||0, 10)); }; + if(!p.width()) { p.width(self.currentItem.innerWidth() - parseInt(self.currentItem.css('paddingLeft')||0, 10) - parseInt(self.currentItem.css('paddingRight')||0, 10)); }; + } + }; + } + + //Create the placeholder + self.placeholder = $(o.placeholder.element.call(self.element, self.currentItem)); + + //Append it after the actual current item + self.currentItem.after(self.placeholder); + + //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317) + o.placeholder.update(self, self.placeholder); + + }, + + _contactContainers: function(event) { + + // get innermost container that intersects with item + var innermostContainer = null, innermostIndex = null; + + + for (var i = this.containers.length - 1; i >= 0; i--){ + + // never consider a container that's located within the item itself + if($.ui.contains(this.currentItem[0], this.containers[i].element[0])) + continue; + + if(this._intersectsWith(this.containers[i].containerCache)) { + + // if we've already found a container and it's more "inner" than this, then continue + if(innermostContainer && $.ui.contains(this.containers[i].element[0], innermostContainer.element[0])) + continue; + + innermostContainer = this.containers[i]; + innermostIndex = i; + + } else { + // container doesn't intersect. trigger "out" event if necessary + if(this.containers[i].containerCache.over) { + this.containers[i]._trigger("out", event, this._uiHash(this)); + this.containers[i].containerCache.over = 0; + } + } + + } + + // if no intersecting containers found, return + if(!innermostContainer) return; + + // move the item into the container if it's not there already + if(this.containers.length === 1) { + this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); + this.containers[innermostIndex].containerCache.over = 1; + } else if(this.currentContainer != this.containers[innermostIndex]) { + + //When entering a new container, we will find the item with the least distance and append our item near it + var dist = 10000; var itemWithLeastDistance = null; var base = this.positionAbs[this.containers[innermostIndex].floating ? 'left' : 'top']; + for (var j = this.items.length - 1; j >= 0; j--) { + if(!$.ui.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) continue; + var cur = this.containers[innermostIndex].floating ? this.items[j].item.offset().left : this.items[j].item.offset().top; + if(Math.abs(cur - base) < dist) { + dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j]; + this.direction = (cur - base > 0) ? 'down' : 'up'; + } + } + + if(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled + return; + + this.currentContainer = this.containers[innermostIndex]; + itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true); + this._trigger("change", event, this._uiHash()); + this.containers[innermostIndex]._trigger("change", event, this._uiHash(this)); + + //Update the placeholder + this.options.placeholder.update(this.currentContainer, this.placeholder); + + this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); + this.containers[innermostIndex].containerCache.over = 1; + } + + + }, + + _createHelper: function(event) { + + var o = this.options; + var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper == 'clone' ? this.currentItem.clone() : this.currentItem); + + if(!helper.parents('body').length) //Add the helper to the DOM if that didn't happen already + $(o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]); + + if(helper[0] == this.currentItem[0]) + this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") }; + + if(helper[0].style.width == '' || o.forceHelperSize) helper.width(this.currentItem.width()); + if(helper[0].style.height == '' || o.forceHelperSize) helper.height(this.currentItem.height()); + + return helper; + + }, + + _adjustOffsetFromHelper: function(obj) { + if (typeof obj == 'string') { + obj = obj.split(' '); + } + if ($.isArray(obj)) { + obj = {left: +obj[0], top: +obj[1] || 0}; + } + if ('left' in obj) { + this.offset.click.left = obj.left + this.margins.left; + } + if ('right' in obj) { + this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; + } + if ('top' in obj) { + this.offset.click.top = obj.top + this.margins.top; + } + if ('bottom' in obj) { + this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; + } + }, + + _getParentOffset: function() { + + + //Get the offsetParent and cache its position + this.offsetParent = this.helper.offsetParent(); + var po = this.offsetParent.offset(); + + // This is a special case where we need to modify a offset calculated on start, since the following happened: + // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent + // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that + // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag + if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) { + po.left += this.scrollParent.scrollLeft(); + po.top += this.scrollParent.scrollTop(); + } + + if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information + || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix + po = { top: 0, left: 0 }; + + return { + top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), + left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) + }; + + }, + + _getRelativeOffset: function() { + + if(this.cssPosition == "relative") { + var p = this.currentItem.position(); + return { + top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(), + left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft() + }; + } else { + return { top: 0, left: 0 }; + } + + }, + + _cacheMargins: function() { + this.margins = { + left: (parseInt(this.currentItem.css("marginLeft"),10) || 0), + top: (parseInt(this.currentItem.css("marginTop"),10) || 0) + }; + }, + + _cacheHelperProportions: function() { + this.helperProportions = { + width: this.helper.outerWidth(), + height: this.helper.outerHeight() + }; + }, + + _setContainment: function() { + + var o = this.options; + if(o.containment == 'parent') o.containment = this.helper[0].parentNode; + if(o.containment == 'document' || o.containment == 'window') this.containment = [ + 0 - this.offset.relative.left - this.offset.parent.left, + 0 - this.offset.relative.top - this.offset.parent.top, + $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left, + ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top + ]; + + if(!(/^(document|window|parent)$/).test(o.containment)) { + var ce = $(o.containment)[0]; + var co = $(o.containment).offset(); + var over = ($(ce).css("overflow") != 'hidden'); + + this.containment = [ + co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left, + co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top, + co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left, + co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top + ]; + } + + }, + + _convertPositionTo: function(d, pos) { + + if(!pos) pos = this.position; + var mod = d == "absolute" ? 1 : -1; + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + + return { + top: ( + pos.top // The absolute mouse position + + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border) + - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod) + ), + left: ( + pos.left // The absolute mouse position + + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border) + - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod) + ) + }; + + }, + + _generatePosition: function(event) { + + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + + // This is another very weird special case that only happens for relative elements: + // 1. If the css position is relative + // 2. and the scroll parent is the document or similar to the offset parent + // we have to refresh the relative offset during the scroll so there are no jumps + if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) { + this.offset.relative = this._getRelativeOffset(); + } + + var pageX = event.pageX; + var pageY = event.pageY; + + /* + * - Position constraining - + * Constrain the position to a mix of grid, containment. + */ + + if(this.originalPosition) { //If we are not dragging yet, we won't check for options + + if(this.containment) { + if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left; + if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top; + if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left; + if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top; + } + + if(o.grid) { + var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1]; + pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; + + var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0]; + pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; + } + + } + + return { + top: ( + pageY // The absolute mouse position + - this.offset.click.top // Click offset (relative to the element) + - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.top // The offsetParent's offset without borders (offset + border) + + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) )) + ), + left: ( + pageX // The absolute mouse position + - this.offset.click.left // Click offset (relative to the element) + - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.left // The offsetParent's offset without borders (offset + border) + + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() )) + ) + }; + + }, + + _rearrange: function(event, i, a, hardRefresh) { + + a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction == 'down' ? i.item[0] : i.item[0].nextSibling)); + + //Various things done here to improve the performance: + // 1. we create a setTimeout, that calls refreshPositions + // 2. on the instance, we have a counter variable, that get's higher after every append + // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same + // 4. this lets only the last addition to the timeout stack through + this.counter = this.counter ? ++this.counter : 1; + var self = this, counter = this.counter; + + window.setTimeout(function() { + if(counter == self.counter) self.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove + },0); + + }, + + _clear: function(event, noPropagation) { + + this.reverting = false; + // We delay all events that have to be triggered to after the point where the placeholder has been removed and + // everything else normalized again + var delayedTriggers = [], self = this; + + // We first have to update the dom position of the actual currentItem + // Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088) + if(!this._noFinalSort && this.currentItem.parent().length) this.placeholder.before(this.currentItem); + this._noFinalSort = null; + + if(this.helper[0] == this.currentItem[0]) { + for(var i in this._storedCSS) { + if(this._storedCSS[i] == 'auto' || this._storedCSS[i] == 'static') this._storedCSS[i] = ''; + } + this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"); + } else { + this.currentItem.show(); + } + + if(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); }); + if((this.fromOutside || this.domPosition.prev != this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !noPropagation) delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed + if(!$.ui.contains(this.element[0], this.currentItem[0])) { //Node was moved out of the current element + if(!noPropagation) delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); }); + for (var i = this.containers.length - 1; i >= 0; i--){ + if($.ui.contains(this.containers[i].element[0], this.currentItem[0]) && !noPropagation) { + delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); }; }).call(this, this.containers[i])); + delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this)); }; }).call(this, this.containers[i])); + } + }; + }; + + //Post events to containers + for (var i = this.containers.length - 1; i >= 0; i--){ + if(!noPropagation) delayedTriggers.push((function(c) { return function(event) { c._trigger("deactivate", event, this._uiHash(this)); }; }).call(this, this.containers[i])); + if(this.containers[i].containerCache.over) { + delayedTriggers.push((function(c) { return function(event) { c._trigger("out", event, this._uiHash(this)); }; }).call(this, this.containers[i])); + this.containers[i].containerCache.over = 0; + } + } + + //Do what was originally in plugins + if(this._storedCursor) $('body').css("cursor", this._storedCursor); //Reset cursor + if(this._storedOpacity) this.helper.css("opacity", this._storedOpacity); //Reset opacity + if(this._storedZIndex) this.helper.css("zIndex", this._storedZIndex == 'auto' ? '' : this._storedZIndex); //Reset z-index + + this.dragging = false; + if(this.cancelHelperRemoval) { + if(!noPropagation) { + this._trigger("beforeStop", event, this._uiHash()); + for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events + this._trigger("stop", event, this._uiHash()); + } + return false; + } + + if(!noPropagation) this._trigger("beforeStop", event, this._uiHash()); + + //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node! + this.placeholder[0].parentNode.removeChild(this.placeholder[0]); + + if(this.helper[0] != this.currentItem[0]) this.helper.remove(); this.helper = null; + + if(!noPropagation) { + for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events + this._trigger("stop", event, this._uiHash()); + } + + this.fromOutside = false; + return true; + + }, + + _trigger: function() { + if ($.Widget.prototype._trigger.apply(this, arguments) === false) { + this.cancel(); + } + }, + + _uiHash: function(inst) { + var self = inst || this; + return { + helper: self.helper, + placeholder: self.placeholder || $([]), + position: self.position, + originalPosition: self.originalPosition, + offset: self.positionAbs, + item: self.currentItem, + sender: inst ? inst.element : null + }; + } + +}); + +$.extend($.ui.sortable, { + version: "1.8.21" +}); + +})(jQuery); +/*! + * jQuery UI Autocomplete 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Autocomplete + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.position.js + */ +(function( $, undefined ) { + +// used to prevent race conditions with remote data sources +var requestIndex = 0; + +$.widget( "ui.autocomplete", { + options: { + appendTo: "body", + autoFocus: false, + delay: 300, + minLength: 1, + position: { + my: "left top", + at: "left bottom", + collision: "none" + }, + source: null + }, + + pending: 0, + + _create: function() { + var self = this, + doc = this.element[ 0 ].ownerDocument, + suppressKeyPress; + this.isMultiLine = this.element.is( "textarea" ); + + this.element + .addClass( "ui-autocomplete-input" ) + .attr( "autocomplete", "off" ) + // TODO verify these actually work as intended + .attr({ + role: "textbox", + "aria-autocomplete": "list", + "aria-haspopup": "true" + }) + .bind( "keydown.autocomplete", function( event ) { + if ( self.options.disabled || self.element.propAttr( "readOnly" ) ) { + return; + } + + suppressKeyPress = false; + var keyCode = $.ui.keyCode; + switch( event.keyCode ) { + case keyCode.PAGE_UP: + self._move( "previousPage", event ); + break; + case keyCode.PAGE_DOWN: + self._move( "nextPage", event ); + break; + case keyCode.UP: + self._keyEvent( "previous", event ); + break; + case keyCode.DOWN: + self._keyEvent( "next", event ); + break; + case keyCode.ENTER: + case keyCode.NUMPAD_ENTER: + // when menu is open and has focus + if ( self.menu.active ) { + // #6055 - Opera still allows the keypress to occur + // which causes forms to submit + suppressKeyPress = true; + event.preventDefault(); + } + //passthrough - ENTER and TAB both select the current element + case keyCode.TAB: + if ( !self.menu.active ) { + return; + } + self.menu.select( event ); + break; + case keyCode.ESCAPE: + self.element.val( self.term ); + self.close( event ); + break; + default: + // keypress is triggered before the input value is changed + clearTimeout( self.searching ); + self.searching = setTimeout(function() { + // only search if the value has changed + if ( self.term != self.element.val() ) { + self.selectedItem = null; + self.search( null, event ); + } + }, self.options.delay ); + break; + } + }) + .bind( "keypress.autocomplete", function( event ) { + if ( suppressKeyPress ) { + suppressKeyPress = false; + event.preventDefault(); + } + }) + .bind( "focus.autocomplete", function() { + if ( self.options.disabled ) { + return; + } + + self.selectedItem = null; + self.previous = self.element.val(); + }) + .bind( "blur.autocomplete", function( event ) { + if ( self.options.disabled ) { + return; + } + + clearTimeout( self.searching ); + // clicks on the menu (or a button to trigger a search) will cause a blur event + self.closing = setTimeout(function() { + self.close( event ); + self._change( event ); + }, 150 ); + }); + this._initSource(); + this.menu = $( "
    " ) + .addClass( "ui-autocomplete" ) + .appendTo( $( this.options.appendTo || "body", doc )[0] ) + // prevent the close-on-blur in case of a "slow" click on the menu (long mousedown) + .mousedown(function( event ) { + // clicking on the scrollbar causes focus to shift to the body + // but we can't detect a mouseup or a click immediately afterward + // so we have to track the next mousedown and close the menu if + // the user clicks somewhere outside of the autocomplete + var menuElement = self.menu.element[ 0 ]; + if ( !$( event.target ).closest( ".ui-menu-item" ).length ) { + setTimeout(function() { + $( document ).one( 'mousedown', function( event ) { + if ( event.target !== self.element[ 0 ] && + event.target !== menuElement && + !$.ui.contains( menuElement, event.target ) ) { + self.close(); + } + }); + }, 1 ); + } + + // use another timeout to make sure the blur-event-handler on the input was already triggered + setTimeout(function() { + clearTimeout( self.closing ); + }, 13); + }) + .menu({ + focus: function( event, ui ) { + var item = ui.item.data( "item.autocomplete" ); + if ( false !== self._trigger( "focus", event, { item: item } ) ) { + // use value to match what will end up in the input, if it was a key event + if ( /^key/.test(event.originalEvent.type) ) { + self.element.val( item.value ); + } + } + }, + selected: function( event, ui ) { + var item = ui.item.data( "item.autocomplete" ), + previous = self.previous; + + // only trigger when focus was lost (click on menu) + if ( self.element[0] !== doc.activeElement ) { + self.element.focus(); + self.previous = previous; + // #6109 - IE triggers two focus events and the second + // is asynchronous, so we need to reset the previous + // term synchronously and asynchronously :-( + setTimeout(function() { + self.previous = previous; + self.selectedItem = item; + }, 1); + } + + if ( false !== self._trigger( "select", event, { item: item } ) ) { + self.element.val( item.value ); + } + // reset the term after the select event + // this allows custom select handling to work properly + self.term = self.element.val(); + + self.close( event ); + self.selectedItem = item; + }, + blur: function( event, ui ) { + // don't set the value of the text field if it's already correct + // this prevents moving the cursor unnecessarily + if ( self.menu.element.is(":visible") && + ( self.element.val() !== self.term ) ) { + self.element.val( self.term ); + } + } + }) + .zIndex( this.element.zIndex() + 1 ) + // workaround for jQuery bug #5781 http://dev.jquery.com/ticket/5781 + .css({ top: 0, left: 0 }) + .hide() + .data( "menu" ); + if ( $.fn.bgiframe ) { + this.menu.element.bgiframe(); + } + // turning off autocomplete prevents the browser from remembering the + // value when navigating through history, so we re-enable autocomplete + // if the page is unloaded before the widget is destroyed. #7790 + self.beforeunloadHandler = function() { + self.element.removeAttr( "autocomplete" ); + }; + $( window ).bind( "beforeunload", self.beforeunloadHandler ); + }, + + destroy: function() { + this.element + .removeClass( "ui-autocomplete-input" ) + .removeAttr( "autocomplete" ) + .removeAttr( "role" ) + .removeAttr( "aria-autocomplete" ) + .removeAttr( "aria-haspopup" ); + this.menu.element.remove(); + $( window ).unbind( "beforeunload", this.beforeunloadHandler ); + $.Widget.prototype.destroy.call( this ); + }, + + _setOption: function( key, value ) { + $.Widget.prototype._setOption.apply( this, arguments ); + if ( key === "source" ) { + this._initSource(); + } + if ( key === "appendTo" ) { + this.menu.element.appendTo( $( value || "body", this.element[0].ownerDocument )[0] ) + } + if ( key === "disabled" && value && this.xhr ) { + this.xhr.abort(); + } + }, + + _initSource: function() { + var self = this, + array, + url; + if ( $.isArray(this.options.source) ) { + array = this.options.source; + this.source = function( request, response ) { + response( $.ui.autocomplete.filter(array, request.term) ); + }; + } else if ( typeof this.options.source === "string" ) { + url = this.options.source; + this.source = function( request, response ) { + if ( self.xhr ) { + self.xhr.abort(); + } + self.xhr = $.ajax({ + url: url, + data: request, + dataType: "json", + success: function( data, status ) { + response( data ); + }, + error: function() { + response( [] ); + } + }); + }; + } else { + this.source = this.options.source; + } + }, + + search: function( value, event ) { + value = value != null ? value : this.element.val(); + + // always save the actual value, not the one passed as an argument + this.term = this.element.val(); + + if ( value.length < this.options.minLength ) { + return this.close( event ); + } + + clearTimeout( this.closing ); + if ( this._trigger( "search", event ) === false ) { + return; + } + + return this._search( value ); + }, + + _search: function( value ) { + this.pending++; + this.element.addClass( "ui-autocomplete-loading" ); + + this.source( { term: value }, this._response() ); + }, + + _response: function() { + var that = this, + index = ++requestIndex; + + return function( content ) { + if ( index === requestIndex ) { + that.__response( content ); + } + + that.pending--; + if ( !that.pending ) { + that.element.removeClass( "ui-autocomplete-loading" ); + } + }; + }, + + __response: function( content ) { + if ( !this.options.disabled && content && content.length ) { + content = this._normalize( content ); + this._suggest( content ); + this._trigger( "open" ); + } else { + this.close(); + } + }, + + close: function( event ) { + clearTimeout( this.closing ); + if ( this.menu.element.is(":visible") ) { + this.menu.element.hide(); + this.menu.deactivate(); + this._trigger( "close", event ); + } + }, + + _change: function( event ) { + if ( this.previous !== this.element.val() ) { + this._trigger( "change", event, { item: this.selectedItem } ); + } + }, + + _normalize: function( items ) { + // assume all items have the right format when the first item is complete + if ( items.length && items[0].label && items[0].value ) { + return items; + } + return $.map( items, function(item) { + if ( typeof item === "string" ) { + return { + label: item, + value: item + }; + } + return $.extend({ + label: item.label || item.value, + value: item.value || item.label + }, item ); + }); + }, + + _suggest: function( items ) { + var ul = this.menu.element + .empty() + .zIndex( this.element.zIndex() + 1 ); + this._renderMenu( ul, items ); + // TODO refresh should check if the active item is still in the dom, removing the need for a manual deactivate + this.menu.deactivate(); + this.menu.refresh(); + + // size and position menu + ul.show(); + this._resizeMenu(); + ul.position( $.extend({ + of: this.element + }, this.options.position )); + + if ( this.options.autoFocus ) { + this.menu.next( new $.Event("mouseover") ); + } + }, + + _resizeMenu: function() { + var ul = this.menu.element; + ul.outerWidth( Math.max( + // Firefox wraps long text (possibly a rounding bug) + // so we add 1px to avoid the wrapping (#7513) + ul.width( "" ).outerWidth() + 1, + this.element.outerWidth() + ) ); + }, + + _renderMenu: function( ul, items ) { + var self = this; + $.each( items, function( index, item ) { + self._renderItem( ul, item ); + }); + }, + + _renderItem: function( ul, item) { + return $( "
  • " ) + .data( "item.autocomplete", item ) + .append( $( "" ).text( item.label ) ) + .appendTo( ul ); + }, + + _move: function( direction, event ) { + if ( !this.menu.element.is(":visible") ) { + this.search( null, event ); + return; + } + if ( this.menu.first() && /^previous/.test(direction) || + this.menu.last() && /^next/.test(direction) ) { + this.element.val( this.term ); + this.menu.deactivate(); + return; + } + this.menu[ direction ]( event ); + }, + + widget: function() { + return this.menu.element; + }, + _keyEvent: function( keyEvent, event ) { + if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) { + this._move( keyEvent, event ); + + // prevents moving cursor to beginning/end of the text field in some browsers + event.preventDefault(); + } + } +}); + +$.extend( $.ui.autocomplete, { + escapeRegex: function( value ) { + return value.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); + }, + filter: function(array, term) { + var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" ); + return $.grep( array, function(value) { + return matcher.test( value.label || value.value || value ); + }); + } +}); + +}( jQuery )); + +/* + * jQuery UI Menu (not officially released) + * + * This widget isn't yet finished and the API is subject to change. We plan to finish + * it for the next release. You're welcome to give it a try anyway and give us feedback, + * as long as you're okay with migrating your code later on. We can help with that, too. + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Menu + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function($) { + +$.widget("ui.menu", { + _create: function() { + var self = this; + this.element + .addClass("ui-menu ui-widget ui-widget-content ui-corner-all") + .attr({ + role: "listbox", + "aria-activedescendant": "ui-active-menuitem" + }) + .click(function( event ) { + if ( !$( event.target ).closest( ".ui-menu-item a" ).length ) { + return; + } + // temporary + event.preventDefault(); + self.select( event ); + }); + this.refresh(); + }, + + refresh: function() { + var self = this; + + // don't refresh list items that are already adapted + var items = this.element.children("li:not(.ui-menu-item):has(a)") + .addClass("ui-menu-item") + .attr("role", "menuitem"); + + items.children("a") + .addClass("ui-corner-all") + .attr("tabindex", -1) + // mouseenter doesn't work with event delegation + .mouseenter(function( event ) { + self.activate( event, $(this).parent() ); + }) + .mouseleave(function() { + self.deactivate(); + }); + }, + + activate: function( event, item ) { + this.deactivate(); + if (this.hasScroll()) { + var offset = item.offset().top - this.element.offset().top, + scroll = this.element.scrollTop(), + elementHeight = this.element.height(); + if (offset < 0) { + this.element.scrollTop( scroll + offset); + } else if (offset >= elementHeight) { + this.element.scrollTop( scroll + offset - elementHeight + item.height()); + } + } + this.active = item.eq(0) + .children("a") + .addClass("ui-state-hover") + .attr("id", "ui-active-menuitem") + .end(); + this._trigger("focus", event, { item: item }); + }, + + deactivate: function() { + if (!this.active) { return; } + + this.active.children("a") + .removeClass("ui-state-hover") + .removeAttr("id"); + this._trigger("blur"); + this.active = null; + }, + + next: function(event) { + this.move("next", ".ui-menu-item:first", event); + }, + + previous: function(event) { + this.move("prev", ".ui-menu-item:last", event); + }, + + first: function() { + return this.active && !this.active.prevAll(".ui-menu-item").length; + }, + + last: function() { + return this.active && !this.active.nextAll(".ui-menu-item").length; + }, + + move: function(direction, edge, event) { + if (!this.active) { + this.activate(event, this.element.children(edge)); + return; + } + var next = this.active[direction + "All"](".ui-menu-item").eq(0); + if (next.length) { + this.activate(event, next); + } else { + this.activate(event, this.element.children(edge)); + } + }, + + // TODO merge with previousPage + nextPage: function(event) { + if (this.hasScroll()) { + // TODO merge with no-scroll-else + if (!this.active || this.last()) { + this.activate(event, this.element.children(".ui-menu-item:first")); + return; + } + var base = this.active.offset().top, + height = this.element.height(), + result = this.element.children(".ui-menu-item").filter(function() { + var close = $(this).offset().top - base - height + $(this).height(); + // TODO improve approximation + return close < 10 && close > -10; + }); + + // TODO try to catch this earlier when scrollTop indicates the last page anyway + if (!result.length) { + result = this.element.children(".ui-menu-item:last"); + } + this.activate(event, result); + } else { + this.activate(event, this.element.children(".ui-menu-item") + .filter(!this.active || this.last() ? ":first" : ":last")); + } + }, + + // TODO merge with nextPage + previousPage: function(event) { + if (this.hasScroll()) { + // TODO merge with no-scroll-else + if (!this.active || this.first()) { + this.activate(event, this.element.children(".ui-menu-item:last")); + return; + } + + var base = this.active.offset().top, + height = this.element.height(), + result = this.element.children(".ui-menu-item").filter(function() { + var close = $(this).offset().top - base + height - $(this).height(); + // TODO improve approximation + return close < 10 && close > -10; + }); + + // TODO try to catch this earlier when scrollTop indicates the last page anyway + if (!result.length) { + result = this.element.children(".ui-menu-item:first"); + } + this.activate(event, result); + } else { + this.activate(event, this.element.children(".ui-menu-item") + .filter(!this.active || this.first() ? ":last" : ":first")); + } + }, + + hasScroll: function() { + return this.element.height() < this.element[ $.fn.prop ? "prop" : "attr" ]("scrollHeight"); + }, + + select: function( event ) { + this._trigger("selected", event, { item: this.active }); + } +}); + +}(jQuery)); +/*! + * jQuery UI Button 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Button + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +var lastActive, startXPos, startYPos, clickDragged, + baseClasses = "ui-button ui-widget ui-state-default ui-corner-all", + stateClasses = "ui-state-hover ui-state-active ", + typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only", + formResetHandler = function() { + var buttons = $( this ).find( ":ui-button" ); + setTimeout(function() { + buttons.button( "refresh" ); + }, 1 ); + }, + radioGroup = function( radio ) { + var name = radio.name, + form = radio.form, + radios = $( [] ); + if ( name ) { + if ( form ) { + radios = $( form ).find( "[name='" + name + "']" ); + } else { + radios = $( "[name='" + name + "']", radio.ownerDocument ) + .filter(function() { + return !this.form; + }); + } + } + return radios; + }; + +$.widget( "ui.button", { + options: { + disabled: null, + text: true, + label: null, + icons: { + primary: null, + secondary: null + } + }, + _create: function() { + this.element.closest( "form" ) + .unbind( "reset.button" ) + .bind( "reset.button", formResetHandler ); + + if ( typeof this.options.disabled !== "boolean" ) { + this.options.disabled = !!this.element.propAttr( "disabled" ); + } else { + this.element.propAttr( "disabled", this.options.disabled ); + } + + this._determineButtonType(); + this.hasTitle = !!this.buttonElement.attr( "title" ); + + var self = this, + options = this.options, + toggleButton = this.type === "checkbox" || this.type === "radio", + hoverClass = "ui-state-hover" + ( !toggleButton ? " ui-state-active" : "" ), + focusClass = "ui-state-focus"; + + if ( options.label === null ) { + options.label = this.buttonElement.html(); + } + + this.buttonElement + .addClass( baseClasses ) + .attr( "role", "button" ) + .bind( "mouseenter.button", function() { + if ( options.disabled ) { + return; + } + $( this ).addClass( "ui-state-hover" ); + if ( this === lastActive ) { + $( this ).addClass( "ui-state-active" ); + } + }) + .bind( "mouseleave.button", function() { + if ( options.disabled ) { + return; + } + $( this ).removeClass( hoverClass ); + }) + .bind( "click.button", function( event ) { + if ( options.disabled ) { + event.preventDefault(); + event.stopImmediatePropagation(); + } + }); + + this.element + .bind( "focus.button", function() { + // no need to check disabled, focus won't be triggered anyway + self.buttonElement.addClass( focusClass ); + }) + .bind( "blur.button", function() { + self.buttonElement.removeClass( focusClass ); + }); + + if ( toggleButton ) { + this.element.bind( "change.button", function() { + if ( clickDragged ) { + return; + } + self.refresh(); + }); + // if mouse moves between mousedown and mouseup (drag) set clickDragged flag + // prevents issue where button state changes but checkbox/radio checked state + // does not in Firefox (see ticket #6970) + this.buttonElement + .bind( "mousedown.button", function( event ) { + if ( options.disabled ) { + return; + } + clickDragged = false; + startXPos = event.pageX; + startYPos = event.pageY; + }) + .bind( "mouseup.button", function( event ) { + if ( options.disabled ) { + return; + } + if ( startXPos !== event.pageX || startYPos !== event.pageY ) { + clickDragged = true; + } + }); + } + + if ( this.type === "checkbox" ) { + this.buttonElement.bind( "click.button", function() { + if ( options.disabled || clickDragged ) { + return false; + } + $( this ).toggleClass( "ui-state-active" ); + self.buttonElement.attr( "aria-pressed", self.element[0].checked ); + }); + } else if ( this.type === "radio" ) { + this.buttonElement.bind( "click.button", function() { + if ( options.disabled || clickDragged ) { + return false; + } + $( this ).addClass( "ui-state-active" ); + self.buttonElement.attr( "aria-pressed", "true" ); + + var radio = self.element[ 0 ]; + radioGroup( radio ) + .not( radio ) + .map(function() { + return $( this ).button( "widget" )[ 0 ]; + }) + .removeClass( "ui-state-active" ) + .attr( "aria-pressed", "false" ); + }); + } else { + this.buttonElement + .bind( "mousedown.button", function() { + if ( options.disabled ) { + return false; + } + $( this ).addClass( "ui-state-active" ); + lastActive = this; + $( document ).one( "mouseup", function() { + lastActive = null; + }); + }) + .bind( "mouseup.button", function() { + if ( options.disabled ) { + return false; + } + $( this ).removeClass( "ui-state-active" ); + }) + .bind( "keydown.button", function(event) { + if ( options.disabled ) { + return false; + } + if ( event.keyCode == $.ui.keyCode.SPACE || event.keyCode == $.ui.keyCode.ENTER ) { + $( this ).addClass( "ui-state-active" ); + } + }) + .bind( "keyup.button", function() { + $( this ).removeClass( "ui-state-active" ); + }); + + if ( this.buttonElement.is("a") ) { + this.buttonElement.keyup(function(event) { + if ( event.keyCode === $.ui.keyCode.SPACE ) { + // TODO pass through original event correctly (just as 2nd argument doesn't work) + $( this ).click(); + } + }); + } + } + + // TODO: pull out $.Widget's handling for the disabled option into + // $.Widget.prototype._setOptionDisabled so it's easy to proxy and can + // be overridden by individual plugins + this._setOption( "disabled", options.disabled ); + this._resetButton(); + }, + + _determineButtonType: function() { + + if ( this.element.is(":checkbox") ) { + this.type = "checkbox"; + } else if ( this.element.is(":radio") ) { + this.type = "radio"; + } else if ( this.element.is("input") ) { + this.type = "input"; + } else { + this.type = "button"; + } + + if ( this.type === "checkbox" || this.type === "radio" ) { + // we don't search against the document in case the element + // is disconnected from the DOM + var ancestor = this.element.parents().filter(":last"), + labelSelector = "label[for='" + this.element.attr("id") + "']"; + this.buttonElement = ancestor.find( labelSelector ); + if ( !this.buttonElement.length ) { + ancestor = ancestor.length ? ancestor.siblings() : this.element.siblings(); + this.buttonElement = ancestor.filter( labelSelector ); + if ( !this.buttonElement.length ) { + this.buttonElement = ancestor.find( labelSelector ); + } + } + this.element.addClass( "ui-helper-hidden-accessible" ); + + var checked = this.element.is( ":checked" ); + if ( checked ) { + this.buttonElement.addClass( "ui-state-active" ); + } + this.buttonElement.attr( "aria-pressed", checked ); + } else { + this.buttonElement = this.element; + } + }, + + widget: function() { + return this.buttonElement; + }, + + destroy: function() { + this.element + .removeClass( "ui-helper-hidden-accessible" ); + this.buttonElement + .removeClass( baseClasses + " " + stateClasses + " " + typeClasses ) + .removeAttr( "role" ) + .removeAttr( "aria-pressed" ) + .html( this.buttonElement.find(".ui-button-text").html() ); + + if ( !this.hasTitle ) { + this.buttonElement.removeAttr( "title" ); + } + + $.Widget.prototype.destroy.call( this ); + }, + + _setOption: function( key, value ) { + $.Widget.prototype._setOption.apply( this, arguments ); + if ( key === "disabled" ) { + if ( value ) { + this.element.propAttr( "disabled", true ); + } else { + this.element.propAttr( "disabled", false ); + } + return; + } + this._resetButton(); + }, + + refresh: function() { + var isDisabled = this.element.is( ":disabled" ); + if ( isDisabled !== this.options.disabled ) { + this._setOption( "disabled", isDisabled ); + } + if ( this.type === "radio" ) { + radioGroup( this.element[0] ).each(function() { + if ( $( this ).is( ":checked" ) ) { + $( this ).button( "widget" ) + .addClass( "ui-state-active" ) + .attr( "aria-pressed", "true" ); + } else { + $( this ).button( "widget" ) + .removeClass( "ui-state-active" ) + .attr( "aria-pressed", "false" ); + } + }); + } else if ( this.type === "checkbox" ) { + if ( this.element.is( ":checked" ) ) { + this.buttonElement + .addClass( "ui-state-active" ) + .attr( "aria-pressed", "true" ); + } else { + this.buttonElement + .removeClass( "ui-state-active" ) + .attr( "aria-pressed", "false" ); + } + } + }, + + _resetButton: function() { + if ( this.type === "input" ) { + if ( this.options.label ) { + this.element.val( this.options.label ); + } + return; + } + var buttonElement = this.buttonElement.removeClass( typeClasses ), + buttonText = $( "", this.element[0].ownerDocument ) + .addClass( "ui-button-text" ) + .html( this.options.label ) + .appendTo( buttonElement.empty() ) + .text(), + icons = this.options.icons, + multipleIcons = icons.primary && icons.secondary, + buttonClasses = []; + + if ( icons.primary || icons.secondary ) { + if ( this.options.text ) { + buttonClasses.push( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) ); + } + + if ( icons.primary ) { + buttonElement.prepend( "" ); + } + + if ( icons.secondary ) { + buttonElement.append( "" ); + } + + if ( !this.options.text ) { + buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" ); + + if ( !this.hasTitle ) { + buttonElement.attr( "title", buttonText ); + } + } + } else { + buttonClasses.push( "ui-button-text-only" ); + } + buttonElement.addClass( buttonClasses.join( " " ) ); + } +}); + +$.widget( "ui.buttonset", { + options: { + items: ":button, :submit, :reset, :checkbox, :radio, a, :data(button)" + }, + + _create: function() { + this.element.addClass( "ui-buttonset" ); + }, + + _init: function() { + this.refresh(); + }, + + _setOption: function( key, value ) { + if ( key === "disabled" ) { + this.buttons.button( "option", key, value ); + } + + $.Widget.prototype._setOption.apply( this, arguments ); + }, + + refresh: function() { + var rtl = this.element.css( "direction" ) === "rtl"; + + this.buttons = this.element.find( this.options.items ) + .filter( ":ui-button" ) + .button( "refresh" ) + .end() + .not( ":ui-button" ) + .button() + .end() + .map(function() { + return $( this ).button( "widget" )[ 0 ]; + }) + .removeClass( "ui-corner-all ui-corner-left ui-corner-right" ) + .filter( ":first" ) + .addClass( rtl ? "ui-corner-right" : "ui-corner-left" ) + .end() + .filter( ":last" ) + .addClass( rtl ? "ui-corner-left" : "ui-corner-right" ) + .end() + .end(); + }, + + destroy: function() { + this.element.removeClass( "ui-buttonset" ); + this.buttons + .map(function() { + return $( this ).button( "widget" )[ 0 ]; + }) + .removeClass( "ui-corner-left ui-corner-right" ) + .end() + .button( "destroy" ); + + $.Widget.prototype.destroy.call( this ); + } +}); + +}( jQuery ) ); +/*! + * jQuery UI Slider 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Slider + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +// number of pages in a slider +// (how many times can you page up/down to go through the whole range) +var numPages = 5; + +$.widget( "ui.slider", $.ui.mouse, { + + widgetEventPrefix: "slide", + + options: { + animate: false, + distance: 0, + max: 100, + min: 0, + orientation: "horizontal", + range: false, + step: 1, + value: 0, + values: null + }, + + _create: function() { + var self = this, + o = this.options, + existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ), + handle = "", + handleCount = ( o.values && o.values.length ) || 1, + handles = []; + + this._keySliding = false; + this._mouseSliding = false; + this._animateOff = true; + this._handleIndex = null; + this._detectOrientation(); + this._mouseInit(); + + this.element + .addClass( "ui-slider" + + " ui-slider-" + this.orientation + + " ui-widget" + + " ui-widget-content" + + " ui-corner-all" + + ( o.disabled ? " ui-slider-disabled ui-disabled" : "" ) ); + + this.range = $([]); + + if ( o.range ) { + if ( o.range === true ) { + if ( !o.values ) { + o.values = [ this._valueMin(), this._valueMin() ]; + } + if ( o.values.length && o.values.length !== 2 ) { + o.values = [ o.values[0], o.values[0] ]; + } + } + + this.range = $( "
    " ) + .appendTo( this.element ) + .addClass( "ui-slider-range" + + // note: this isn't the most fittingly semantic framework class for this element, + // but worked best visually with a variety of themes + " ui-widget-header" + + ( ( o.range === "min" || o.range === "max" ) ? " ui-slider-range-" + o.range : "" ) ); + } + + for ( var i = existingHandles.length; i < handleCount; i += 1 ) { + handles.push( handle ); + } + + this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( self.element ) ); + + this.handle = this.handles.eq( 0 ); + + this.handles.add( this.range ).filter( "a" ) + .click(function( event ) { + event.preventDefault(); + }) + .hover(function() { + if ( !o.disabled ) { + $( this ).addClass( "ui-state-hover" ); + } + }, function() { + $( this ).removeClass( "ui-state-hover" ); + }) + .focus(function() { + if ( !o.disabled ) { + $( ".ui-slider .ui-state-focus" ).removeClass( "ui-state-focus" ); + $( this ).addClass( "ui-state-focus" ); + } else { + $( this ).blur(); + } + }) + .blur(function() { + $( this ).removeClass( "ui-state-focus" ); + }); + + this.handles.each(function( i ) { + $( this ).data( "index.ui-slider-handle", i ); + }); + + this.handles + .keydown(function( event ) { + var index = $( this ).data( "index.ui-slider-handle" ), + allowed, + curVal, + newVal, + step; + + if ( self.options.disabled ) { + return; + } + + switch ( event.keyCode ) { + case $.ui.keyCode.HOME: + case $.ui.keyCode.END: + case $.ui.keyCode.PAGE_UP: + case $.ui.keyCode.PAGE_DOWN: + case $.ui.keyCode.UP: + case $.ui.keyCode.RIGHT: + case $.ui.keyCode.DOWN: + case $.ui.keyCode.LEFT: + event.preventDefault(); + if ( !self._keySliding ) { + self._keySliding = true; + $( this ).addClass( "ui-state-active" ); + allowed = self._start( event, index ); + if ( allowed === false ) { + return; + } + } + break; + } + + step = self.options.step; + if ( self.options.values && self.options.values.length ) { + curVal = newVal = self.values( index ); + } else { + curVal = newVal = self.value(); + } + + switch ( event.keyCode ) { + case $.ui.keyCode.HOME: + newVal = self._valueMin(); + break; + case $.ui.keyCode.END: + newVal = self._valueMax(); + break; + case $.ui.keyCode.PAGE_UP: + newVal = self._trimAlignValue( curVal + ( (self._valueMax() - self._valueMin()) / numPages ) ); + break; + case $.ui.keyCode.PAGE_DOWN: + newVal = self._trimAlignValue( curVal - ( (self._valueMax() - self._valueMin()) / numPages ) ); + break; + case $.ui.keyCode.UP: + case $.ui.keyCode.RIGHT: + if ( curVal === self._valueMax() ) { + return; + } + newVal = self._trimAlignValue( curVal + step ); + break; + case $.ui.keyCode.DOWN: + case $.ui.keyCode.LEFT: + if ( curVal === self._valueMin() ) { + return; + } + newVal = self._trimAlignValue( curVal - step ); + break; + } + + self._slide( event, index, newVal ); + }) + .keyup(function( event ) { + var index = $( this ).data( "index.ui-slider-handle" ); + + if ( self._keySliding ) { + self._keySliding = false; + self._stop( event, index ); + self._change( event, index ); + $( this ).removeClass( "ui-state-active" ); + } + + }); + + this._refreshValue(); + + this._animateOff = false; + }, + + destroy: function() { + this.handles.remove(); + this.range.remove(); + + this.element + .removeClass( "ui-slider" + + " ui-slider-horizontal" + + " ui-slider-vertical" + + " ui-slider-disabled" + + " ui-widget" + + " ui-widget-content" + + " ui-corner-all" ) + .removeData( "slider" ) + .unbind( ".slider" ); + + this._mouseDestroy(); + + return this; + }, + + _mouseCapture: function( event ) { + var o = this.options, + position, + normValue, + distance, + closestHandle, + self, + index, + allowed, + offset, + mouseOverHandle; + + if ( o.disabled ) { + return false; + } + + this.elementSize = { + width: this.element.outerWidth(), + height: this.element.outerHeight() + }; + this.elementOffset = this.element.offset(); + + position = { x: event.pageX, y: event.pageY }; + normValue = this._normValueFromMouse( position ); + distance = this._valueMax() - this._valueMin() + 1; + self = this; + this.handles.each(function( i ) { + var thisDistance = Math.abs( normValue - self.values(i) ); + if ( distance > thisDistance ) { + distance = thisDistance; + closestHandle = $( this ); + index = i; + } + }); + + // workaround for bug #3736 (if both handles of a range are at 0, + // the first is always used as the one with least distance, + // and moving it is obviously prevented by preventing negative ranges) + if( o.range === true && this.values(1) === o.min ) { + index += 1; + closestHandle = $( this.handles[index] ); + } + + allowed = this._start( event, index ); + if ( allowed === false ) { + return false; + } + this._mouseSliding = true; + + self._handleIndex = index; + + closestHandle + .addClass( "ui-state-active" ) + .focus(); + + offset = closestHandle.offset(); + mouseOverHandle = !$( event.target ).parents().andSelf().is( ".ui-slider-handle" ); + this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : { + left: event.pageX - offset.left - ( closestHandle.width() / 2 ), + top: event.pageY - offset.top - + ( closestHandle.height() / 2 ) - + ( parseInt( closestHandle.css("borderTopWidth"), 10 ) || 0 ) - + ( parseInt( closestHandle.css("borderBottomWidth"), 10 ) || 0) + + ( parseInt( closestHandle.css("marginTop"), 10 ) || 0) + }; + + if ( !this.handles.hasClass( "ui-state-hover" ) ) { + this._slide( event, index, normValue ); + } + this._animateOff = true; + return true; + }, + + _mouseStart: function( event ) { + return true; + }, + + _mouseDrag: function( event ) { + var position = { x: event.pageX, y: event.pageY }, + normValue = this._normValueFromMouse( position ); + + this._slide( event, this._handleIndex, normValue ); + + return false; + }, + + _mouseStop: function( event ) { + this.handles.removeClass( "ui-state-active" ); + this._mouseSliding = false; + + this._stop( event, this._handleIndex ); + this._change( event, this._handleIndex ); + + this._handleIndex = null; + this._clickOffset = null; + this._animateOff = false; + + return false; + }, + + _detectOrientation: function() { + this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal"; + }, + + _normValueFromMouse: function( position ) { + var pixelTotal, + pixelMouse, + percentMouse, + valueTotal, + valueMouse; + + if ( this.orientation === "horizontal" ) { + pixelTotal = this.elementSize.width; + pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 ); + } else { + pixelTotal = this.elementSize.height; + pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 ); + } + + percentMouse = ( pixelMouse / pixelTotal ); + if ( percentMouse > 1 ) { + percentMouse = 1; + } + if ( percentMouse < 0 ) { + percentMouse = 0; + } + if ( this.orientation === "vertical" ) { + percentMouse = 1 - percentMouse; + } + + valueTotal = this._valueMax() - this._valueMin(); + valueMouse = this._valueMin() + percentMouse * valueTotal; + + return this._trimAlignValue( valueMouse ); + }, + + _start: function( event, index ) { + var uiHash = { + handle: this.handles[ index ], + value: this.value() + }; + if ( this.options.values && this.options.values.length ) { + uiHash.value = this.values( index ); + uiHash.values = this.values(); + } + return this._trigger( "start", event, uiHash ); + }, + + _slide: function( event, index, newVal ) { + var otherVal, + newValues, + allowed; + + if ( this.options.values && this.options.values.length ) { + otherVal = this.values( index ? 0 : 1 ); + + if ( ( this.options.values.length === 2 && this.options.range === true ) && + ( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) ) + ) { + newVal = otherVal; + } + + if ( newVal !== this.values( index ) ) { + newValues = this.values(); + newValues[ index ] = newVal; + // A slide can be canceled by returning false from the slide callback + allowed = this._trigger( "slide", event, { + handle: this.handles[ index ], + value: newVal, + values: newValues + } ); + otherVal = this.values( index ? 0 : 1 ); + if ( allowed !== false ) { + this.values( index, newVal, true ); + } + } + } else { + if ( newVal !== this.value() ) { + // A slide can be canceled by returning false from the slide callback + allowed = this._trigger( "slide", event, { + handle: this.handles[ index ], + value: newVal + } ); + if ( allowed !== false ) { + this.value( newVal ); + } + } + } + }, + + _stop: function( event, index ) { + var uiHash = { + handle: this.handles[ index ], + value: this.value() + }; + if ( this.options.values && this.options.values.length ) { + uiHash.value = this.values( index ); + uiHash.values = this.values(); + } + + this._trigger( "stop", event, uiHash ); + }, + + _change: function( event, index ) { + if ( !this._keySliding && !this._mouseSliding ) { + var uiHash = { + handle: this.handles[ index ], + value: this.value() + }; + if ( this.options.values && this.options.values.length ) { + uiHash.value = this.values( index ); + uiHash.values = this.values(); + } + + this._trigger( "change", event, uiHash ); + } + }, + + value: function( newValue ) { + if ( arguments.length ) { + this.options.value = this._trimAlignValue( newValue ); + this._refreshValue(); + this._change( null, 0 ); + return; + } + + return this._value(); + }, + + values: function( index, newValue ) { + var vals, + newValues, + i; + + if ( arguments.length > 1 ) { + this.options.values[ index ] = this._trimAlignValue( newValue ); + this._refreshValue(); + this._change( null, index ); + return; + } + + if ( arguments.length ) { + if ( $.isArray( arguments[ 0 ] ) ) { + vals = this.options.values; + newValues = arguments[ 0 ]; + for ( i = 0; i < vals.length; i += 1 ) { + vals[ i ] = this._trimAlignValue( newValues[ i ] ); + this._change( null, i ); + } + this._refreshValue(); + } else { + if ( this.options.values && this.options.values.length ) { + return this._values( index ); + } else { + return this.value(); + } + } + } else { + return this._values(); + } + }, + + _setOption: function( key, value ) { + var i, + valsLength = 0; + + if ( $.isArray( this.options.values ) ) { + valsLength = this.options.values.length; + } + + $.Widget.prototype._setOption.apply( this, arguments ); + + switch ( key ) { + case "disabled": + if ( value ) { + this.handles.filter( ".ui-state-focus" ).blur(); + this.handles.removeClass( "ui-state-hover" ); + this.handles.propAttr( "disabled", true ); + this.element.addClass( "ui-disabled" ); + } else { + this.handles.propAttr( "disabled", false ); + this.element.removeClass( "ui-disabled" ); + } + break; + case "orientation": + this._detectOrientation(); + this.element + .removeClass( "ui-slider-horizontal ui-slider-vertical" ) + .addClass( "ui-slider-" + this.orientation ); + this._refreshValue(); + break; + case "value": + this._animateOff = true; + this._refreshValue(); + this._change( null, 0 ); + this._animateOff = false; + break; + case "values": + this._animateOff = true; + this._refreshValue(); + for ( i = 0; i < valsLength; i += 1 ) { + this._change( null, i ); + } + this._animateOff = false; + break; + } + }, + + //internal value getter + // _value() returns value trimmed by min and max, aligned by step + _value: function() { + var val = this.options.value; + val = this._trimAlignValue( val ); + + return val; + }, + + //internal values getter + // _values() returns array of values trimmed by min and max, aligned by step + // _values( index ) returns single value trimmed by min and max, aligned by step + _values: function( index ) { + var val, + vals, + i; + + if ( arguments.length ) { + val = this.options.values[ index ]; + val = this._trimAlignValue( val ); + + return val; + } else { + // .slice() creates a copy of the array + // this copy gets trimmed by min and max and then returned + vals = this.options.values.slice(); + for ( i = 0; i < vals.length; i+= 1) { + vals[ i ] = this._trimAlignValue( vals[ i ] ); + } + + return vals; + } + }, + + // returns the step-aligned value that val is closest to, between (inclusive) min and max + _trimAlignValue: function( val ) { + if ( val <= this._valueMin() ) { + return this._valueMin(); + } + if ( val >= this._valueMax() ) { + return this._valueMax(); + } + var step = ( this.options.step > 0 ) ? this.options.step : 1, + valModStep = (val - this._valueMin()) % step, + alignValue = val - valModStep; + + if ( Math.abs(valModStep) * 2 >= step ) { + alignValue += ( valModStep > 0 ) ? step : ( -step ); + } + + // Since JavaScript has problems with large floats, round + // the final value to 5 digits after the decimal point (see #4124) + return parseFloat( alignValue.toFixed(5) ); + }, + + _valueMin: function() { + return this.options.min; + }, + + _valueMax: function() { + return this.options.max; + }, + + _refreshValue: function() { + var oRange = this.options.range, + o = this.options, + self = this, + animate = ( !this._animateOff ) ? o.animate : false, + valPercent, + _set = {}, + lastValPercent, + value, + valueMin, + valueMax; + + if ( this.options.values && this.options.values.length ) { + this.handles.each(function( i, j ) { + valPercent = ( self.values(i) - self._valueMin() ) / ( self._valueMax() - self._valueMin() ) * 100; + _set[ self.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; + $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); + if ( self.options.range === true ) { + if ( self.orientation === "horizontal" ) { + if ( i === 0 ) { + self.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate ); + } + if ( i === 1 ) { + self.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } ); + } + } else { + if ( i === 0 ) { + self.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate ); + } + if ( i === 1 ) { + self.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } ); + } + } + } + lastValPercent = valPercent; + }); + } else { + value = this.value(); + valueMin = this._valueMin(); + valueMax = this._valueMax(); + valPercent = ( valueMax !== valueMin ) ? + ( value - valueMin ) / ( valueMax - valueMin ) * 100 : + 0; + _set[ self.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; + this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); + + if ( oRange === "min" && this.orientation === "horizontal" ) { + this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate ); + } + if ( oRange === "max" && this.orientation === "horizontal" ) { + this.range[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } ); + } + if ( oRange === "min" && this.orientation === "vertical" ) { + this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate ); + } + if ( oRange === "max" && this.orientation === "vertical" ) { + this.range[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } ); + } + } + } + +}); + +$.extend( $.ui.slider, { + version: "1.8.21" +}); + +}(jQuery)); +/*! + * jQuery UI Progressbar 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Progressbar + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget( "ui.progressbar", { + options: { + value: 0, + max: 100 + }, + + min: 0, + + _create: function() { + this.element + .addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" ) + .attr({ + role: "progressbar", + "aria-valuemin": this.min, + "aria-valuemax": this.options.max, + "aria-valuenow": this._value() + }); + + this.valueDiv = $( "
    " ) + .appendTo( this.element ); + + this.oldValue = this._value(); + this._refreshValue(); + }, + + destroy: function() { + this.element + .removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" ) + .removeAttr( "role" ) + .removeAttr( "aria-valuemin" ) + .removeAttr( "aria-valuemax" ) + .removeAttr( "aria-valuenow" ); + + this.valueDiv.remove(); + + $.Widget.prototype.destroy.apply( this, arguments ); + }, + + value: function( newValue ) { + if ( newValue === undefined ) { + return this._value(); + } + + this._setOption( "value", newValue ); + return this; + }, + + _setOption: function( key, value ) { + if ( key === "value" ) { + this.options.value = value; + this._refreshValue(); + if ( this._value() === this.options.max ) { + this._trigger( "complete" ); + } + } + + $.Widget.prototype._setOption.apply( this, arguments ); + }, + + _value: function() { + var val = this.options.value; + // normalize invalid value + if ( typeof val !== "number" ) { + val = 0; + } + return Math.min( this.options.max, Math.max( this.min, val ) ); + }, + + _percentage: function() { + return 100 * this._value() / this.options.max; + }, + + _refreshValue: function() { + var value = this.value(); + var percentage = this._percentage(); + + if ( this.oldValue !== value ) { + this.oldValue = value; + this._trigger( "change" ); + } + + this.valueDiv + .toggle( value > this.min ) + .toggleClass( "ui-corner-right", value === this.options.max ) + .width( percentage.toFixed(0) + "%" ); + this.element.attr( "aria-valuenow", value ); + } +}); + +$.extend( $.ui.progressbar, { + version: "1.8.21" +}); + +})( jQuery ); diff --git a/src/main/webapp/resources/js/jquery.uniform.js b/src/main/webapp/resources/js/jquery.uniform.js new file mode 100644 index 0000000000000000000000000000000000000000..0903813f48d0f6202639d8ef004a040d19928eb5 --- /dev/null +++ b/src/main/webapp/resources/js/jquery.uniform.js @@ -0,0 +1,672 @@ +/* + +Uniform v1.7.5 +Copyright © 2009 Josh Pyles / Pixelmatrix Design LLC +http://pixelmatrixdesign.com + +Requires jQuery 1.4 or newer + +Much thanks to Thomas Reynolds and Buck Wilson for their help and advice on this + +Disabling text selection is made possible by Mathias Bynens +and his noSelect plugin. + +Also, thanks to David Kaneda and Eugene Bond for their contributions to the plugin + +License: +MIT License - http://www.opensource.org/licenses/mit-license.php + +Enjoy! + +*/ + +(function($) { + $.uniform = { + options: { + selectClass: 'selector', + radioClass: 'radio', + checkboxClass: 'checker', + fileClass: 'uploader', + filenameClass: 'filename', + fileBtnClass: 'action', + fileDefaultText: 'No file selected', + fileBtnText: 'Choose File', + checkedClass: 'checked', + focusClass: 'focus', + disabledClass: 'disabled', + buttonClass: 'button', + activeClass: 'active', + hoverClass: 'hover', + useID: true, + idPrefix: 'uniform', + resetSelector: false, + autoHide: true + }, + elements: [] + }; + + if($.browser.msie && $.browser.version < 7){ + $.support.selectOpacity = false; + }else{ + $.support.selectOpacity = true; + } + + $.fn.uniform = function(options) { + + options = $.extend($.uniform.options, options); + + var el = this; + //code for specifying a reset button + if(options.resetSelector != false){ + $(options.resetSelector).mouseup(function(){ + function resetThis(){ + $.uniform.update(el); + } + setTimeout(resetThis, 10); + }); + } + + function doInput(elem){ + $el = $(elem); + $el.addClass($el.attr("type")); + storeElement(elem); + } + + function doTextarea(elem){ + $(elem).addClass("uniform"); + storeElement(elem); + } + + function doButton(elem){ + var $el = $(elem); + + var divTag = $("
    "), + spanTag = $(""); + + divTag.addClass(options.buttonClass); + + if(options.useID && $el.attr("id") != "") divTag.attr("id", options.idPrefix+"-"+$el.attr("id")); + + var btnText; + + if($el.is("a") || $el.is("button")){ + btnText = $el.text(); + }else if($el.is(":submit") || $el.is(":reset") || $el.is("input[type=button]")){ + btnText = $el.attr("value"); + } + + btnText = btnText == "" ? $el.is(":reset") ? "Reset" : "Submit" : btnText; + + spanTag.html(btnText); + + $el.css("opacity", 0); + $el.wrap(divTag); + $el.wrap(spanTag); + + //redefine variables + divTag = $el.closest("div"); + spanTag = $el.closest("span"); + + if($el.is(":disabled")) divTag.addClass(options.disabledClass); + + divTag.bind({ + "mouseenter.uniform": function(){ + divTag.addClass(options.hoverClass); + }, + "mouseleave.uniform": function(){ + divTag.removeClass(options.hoverClass); + divTag.removeClass(options.activeClass); + }, + "mousedown.uniform touchbegin.uniform": function(){ + divTag.addClass(options.activeClass); + }, + "mouseup.uniform touchend.uniform": function(){ + divTag.removeClass(options.activeClass); + }, + "click.uniform touchend.uniform": function(e){ + if($(e.target).is("span") || $(e.target).is("div")){ + if(elem[0].dispatchEvent){ + var ev = document.createEvent('MouseEvents'); + ev.initEvent( 'click', true, true ); + elem[0].dispatchEvent(ev); + }else{ + elem[0].click(); + } + } + } + }); + + elem.bind({ + "focus.uniform": function(){ + divTag.addClass(options.focusClass); + }, + "blur.uniform": function(){ + divTag.removeClass(options.focusClass); + } + }); + + $.uniform.noSelect(divTag); + storeElement(elem); + + } + + function doSelect(elem){ + var $el = $(elem); + + var divTag = $('
    '), + spanTag = $(''); + + if(!$el.css("display") == "none" && options.autoHide){ + divTag.hide(); + } + + divTag.addClass(options.selectClass); + + if(options.useID && elem.attr("id") != ""){ + divTag.attr("id", options.idPrefix+"-"+elem.attr("id")); + } + + var selected = elem.find(":selected:first"); + if(selected.length == 0){ + selected = elem.find("option:first"); + } + spanTag.html(selected.html()); + + elem.css('opacity', 0); + elem.wrap(divTag); + elem.before(spanTag); + + //redefine variables + divTag = elem.parent("div"); + spanTag = elem.siblings("span"); + + elem.bind({ + "change.uniform": function() { + spanTag.text(elem.find(":selected").html()); + divTag.removeClass(options.activeClass); + }, + "focus.uniform": function() { + divTag.addClass(options.focusClass); + }, + "blur.uniform": function() { + divTag.removeClass(options.focusClass); + divTag.removeClass(options.activeClass); + }, + "mousedown.uniform touchbegin.uniform": function() { + divTag.addClass(options.activeClass); + }, + "mouseup.uniform touchend.uniform": function() { + divTag.removeClass(options.activeClass); + }, + "click.uniform touchend.uniform": function(){ + divTag.removeClass(options.activeClass); + }, + "mouseenter.uniform": function() { + divTag.addClass(options.hoverClass); + }, + "mouseleave.uniform": function() { + divTag.removeClass(options.hoverClass); + divTag.removeClass(options.activeClass); + }, + "keyup.uniform": function(){ + spanTag.text(elem.find(":selected").html()); + } + }); + + //handle disabled state + if($(elem).attr("disabled")){ + //box is checked by default, check our box + divTag.addClass(options.disabledClass); + } + $.uniform.noSelect(spanTag); + + storeElement(elem); + + } + + function doCheckbox(elem){ + var $el = $(elem); + + var divTag = $('
    '), + spanTag = $(''); + + if(!$el.css("display") == "none" && options.autoHide){ + divTag.hide(); + } + + divTag.addClass(options.checkboxClass); + + //assign the id of the element + if(options.useID && elem.attr("id") != ""){ + divTag.attr("id", options.idPrefix+"-"+elem.attr("id")); + } + + //wrap with the proper elements + $(elem).wrap(divTag); + $(elem).wrap(spanTag); + + //redefine variables + spanTag = elem.parent(); + divTag = spanTag.parent(); + + //hide normal input and add focus classes + $(elem) + .css("opacity", 0) + .bind({ + "focus.uniform": function(){ + divTag.addClass(options.focusClass); + }, + "blur.uniform": function(){ + divTag.removeClass(options.focusClass); + }, + "click.uniform touchend.uniform": function(){ + if(!$(elem).attr("checked")){ + //box was just unchecked, uncheck span + spanTag.removeClass(options.checkedClass); + }else{ + //box was just checked, check span. + spanTag.addClass(options.checkedClass); + } + }, + "mousedown.uniform touchbegin.uniform": function() { + divTag.addClass(options.activeClass); + }, + "mouseup.uniform touchend.uniform": function() { + divTag.removeClass(options.activeClass); + }, + "mouseenter.uniform": function() { + divTag.addClass(options.hoverClass); + }, + "mouseleave.uniform": function() { + divTag.removeClass(options.hoverClass); + divTag.removeClass(options.activeClass); + } + }); + + //handle defaults + if($(elem).attr("checked")){ + //box is checked by default, check our box + spanTag.addClass(options.checkedClass); + } + + //handle disabled state + if($(elem).attr("disabled")){ + //box is checked by default, check our box + divTag.addClass(options.disabledClass); + } + + storeElement(elem); + } + + function doRadio(elem){ + var $el = $(elem); + + var divTag = $('
    '), + spanTag = $(''); + + if(!$el.css("display") == "none" && options.autoHide){ + divTag.hide(); + } + + divTag.addClass(options.radioClass); + + if(options.useID && elem.attr("id") != ""){ + divTag.attr("id", options.idPrefix+"-"+elem.attr("id")); + } + + //wrap with the proper elements + $(elem).wrap(divTag); + $(elem).wrap(spanTag); + + //redefine variables + spanTag = elem.parent(); + divTag = spanTag.parent(); + + //hide normal input and add focus classes + $(elem) + .css("opacity", 0) + .bind({ + "focus.uniform": function(){ + divTag.addClass(options.focusClass); + }, + "blur.uniform": function(){ + divTag.removeClass(options.focusClass); + }, + "click.uniform touchend.uniform": function(){ + if(!$(elem).attr("checked")){ + //box was just unchecked, uncheck span + spanTag.removeClass(options.checkedClass); + }else{ + //box was just checked, check span + var classes = options.radioClass.split(" ")[0]; + $("." + classes + " span." + options.checkedClass + ":has([name='" + $(elem).attr('name') + "'])").removeClass(options.checkedClass); + spanTag.addClass(options.checkedClass); + } + }, + "mousedown.uniform touchend.uniform": function() { + if(!$(elem).is(":disabled")){ + divTag.addClass(options.activeClass); + } + }, + "mouseup.uniform touchbegin.uniform": function() { + divTag.removeClass(options.activeClass); + }, + "mouseenter.uniform touchend.uniform": function() { + divTag.addClass(options.hoverClass); + }, + "mouseleave.uniform": function() { + divTag.removeClass(options.hoverClass); + divTag.removeClass(options.activeClass); + } + }); + + //handle defaults + if($(elem).attr("checked")){ + //box is checked by default, check span + spanTag.addClass(options.checkedClass); + } + //handle disabled state + if($(elem).attr("disabled")){ + //box is checked by default, check our box + divTag.addClass(options.disabledClass); + } + + storeElement(elem); + + } + + function doFile(elem){ + //sanitize input + var $el = $(elem); + + var divTag = $('
    '), + filenameTag = $(''+options.fileDefaultText+''), + btnTag = $(''+options.fileBtnText+''); + + if(!$el.css("display") == "none" && options.autoHide){ + divTag.hide(); + } + + divTag.addClass(options.fileClass); + filenameTag.addClass(options.filenameClass); + btnTag.addClass(options.fileBtnClass); + + if(options.useID && $el.attr("id") != ""){ + divTag.attr("id", options.idPrefix+"-"+$el.attr("id")); + } + + //wrap with the proper elements + $el.wrap(divTag); + $el.after(btnTag); + $el.after(filenameTag); + + //redefine variables + divTag = $el.closest("div"); + filenameTag = $el.siblings("."+options.filenameClass); + btnTag = $el.siblings("."+options.fileBtnClass); + + //set the size + if(!$el.attr("size")){ + var divWidth = divTag.width(); + //$el.css("width", divWidth); + $el.attr("size", divWidth/10); + } + + //actions + var setFilename = function() + { + var filename = $el.val(); + if (filename === '') + { + filename = options.fileDefaultText; + } + else + { + filename = filename.split(/[\/\\]+/); + filename = filename[(filename.length-1)]; + } + filenameTag.text(filename); + }; + + // Account for input saved across refreshes + setFilename(); + + $el + .css("opacity", 0) + .bind({ + "focus.uniform": function(){ + divTag.addClass(options.focusClass); + }, + "blur.uniform": function(){ + divTag.removeClass(options.focusClass); + }, + "mousedown.uniform": function() { + if(!$(elem).is(":disabled")){ + divTag.addClass(options.activeClass); + } + }, + "mouseup.uniform": function() { + divTag.removeClass(options.activeClass); + }, + "mouseenter.uniform": function() { + divTag.addClass(options.hoverClass); + }, + "mouseleave.uniform": function() { + divTag.removeClass(options.hoverClass); + divTag.removeClass(options.activeClass); + } + }); + + // IE7 doesn't fire onChange until blur or second fire. + if ($.browser.msie){ + // IE considers browser chrome blocking I/O, so it + // suspends tiemouts until after the file has been selected. + $el.bind('click.uniform.ie7', function() { + setTimeout(setFilename, 0); + }); + }else{ + // All other browsers behave properly + $el.bind('change.uniform', setFilename); + } + + //handle defaults + if($el.attr("disabled")){ + //box is checked by default, check our box + divTag.addClass(options.disabledClass); + } + + $.uniform.noSelect(filenameTag); + $.uniform.noSelect(btnTag); + + storeElement(elem); + + } + + $.uniform.restore = function(elem){ + if(elem == undefined){ + elem = $($.uniform.elements); + } + + $(elem).each(function(){ + if($(this).is(":checkbox")){ + //unwrap from span and div + $(this).unwrap().unwrap(); + }else if($(this).is("select")){ + //remove sibling span + $(this).siblings("span").remove(); + //unwrap parent div + $(this).unwrap(); + }else if($(this).is(":radio")){ + //unwrap from span and div + $(this).unwrap().unwrap(); + }else if($(this).is(":file")){ + //remove sibling spans + $(this).siblings("span").remove(); + //unwrap parent div + $(this).unwrap(); + }else if($(this).is("button, :submit, :reset, a, input[type='button']")){ + //unwrap from span and div + $(this).unwrap().unwrap(); + } + + //unbind events + $(this).unbind(".uniform"); + + //reset inline style + $(this).css("opacity", "1"); + + //remove item from list of uniformed elements + var index = $.inArray($(elem), $.uniform.elements); + $.uniform.elements.splice(index, 1); + }); + }; + + function storeElement(elem){ + //store this element in our global array + elem = $(elem).get(); + if(elem.length > 1){ + $.each(elem, function(i, val){ + $.uniform.elements.push(val); + }); + }else{ + $.uniform.elements.push(elem); + } + } + + //noSelect v1.0 + $.uniform.noSelect = function(elem) { + function f() { + return false; + }; + $(elem).each(function() { + this.onselectstart = this.ondragstart = f; // Webkit & IE + $(this) + .mousedown(f) // Webkit & Opera + .css({ MozUserSelect: 'none' }); // Firefox + }); + }; + + $.uniform.update = function(elem){ + if(elem == undefined){ + elem = $($.uniform.elements); + } + //sanitize input + elem = $(elem); + + elem.each(function(){ + //do to each item in the selector + //function to reset all classes + var $e = $(this); + + if($e.is("select")){ + //element is a select + var spanTag = $e.siblings("span"); + var divTag = $e.parent("div"); + + divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass); + + //reset current selected text + spanTag.html($e.find(":selected").html()); + + if($e.is(":disabled")){ + divTag.addClass(options.disabledClass); + }else{ + divTag.removeClass(options.disabledClass); + } + + }else if($e.is(":checkbox")){ + //element is a checkbox + var spanTag = $e.closest("span"); + var divTag = $e.closest("div"); + + divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass); + spanTag.removeClass(options.checkedClass); + + if($e.is(":checked")){ + spanTag.addClass(options.checkedClass); + } + if($e.is(":disabled")){ + divTag.addClass(options.disabledClass); + }else{ + divTag.removeClass(options.disabledClass); + } + + }else if($e.is(":radio")){ + //element is a radio + var spanTag = $e.closest("span"); + var divTag = $e.closest("div"); + + divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass); + spanTag.removeClass(options.checkedClass); + + if($e.is(":checked")){ + spanTag.addClass(options.checkedClass); + } + + if($e.is(":disabled")){ + divTag.addClass(options.disabledClass); + }else{ + divTag.removeClass(options.disabledClass); + } + }else if($e.is(":file")){ + var divTag = $e.parent("div"); + var filenameTag = $e.siblings(options.filenameClass); + btnTag = $e.siblings(options.fileBtnClass); + + divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass); + + filenameTag.text($e.val()); + + if($e.is(":disabled")){ + divTag.addClass(options.disabledClass); + }else{ + divTag.removeClass(options.disabledClass); + } + }else if($e.is(":submit") || $e.is(":reset") || $e.is("button") || $e.is("a") || elem.is("input[type=button]")){ + var divTag = $e.closest("div"); + divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass); + + if($e.is(":disabled")){ + divTag.addClass(options.disabledClass); + }else{ + divTag.removeClass(options.disabledClass); + } + + } + + }); + }; + + return this.each(function() { + if($.support.selectOpacity){ + var elem = $(this); + + if(elem.is("select")){ + //element is a select + if(elem.attr("multiple") != true){ + //element is not a multi-select + if(elem.attr("size") == undefined || elem.attr("size") <= 1){ + doSelect(elem); + } + } + }else if(elem.is(":checkbox")){ + //element is a checkbox + doCheckbox(elem); + }else if(elem.is(":radio")){ + //element is a radio + doRadio(elem); + }else if(elem.is(":file")){ + //element is a file upload + doFile(elem); + }else if(elem.is(":text, :password, input[type='email']")){ + doInput(elem); + }else if(elem.is("textarea")){ + doTextarea(elem); + }else if(elem.is("a") || elem.is(":submit") || elem.is(":reset") || elem.is("button") || elem.is("input[type=button]")){ + doButton(elem); + } + + } + }); + }; +})(jQuery); \ No newline at end of file diff --git a/src/main/webapp/resources/js/jquery.validate.js b/src/main/webapp/resources/js/jquery.validate.js new file mode 100644 index 0000000000000000000000000000000000000000..b7ed45b4a4db246176bc74b76aa9194bcfe8b181 --- /dev/null +++ b/src/main/webapp/resources/js/jquery.validate.js @@ -0,0 +1,1188 @@ +/** + * jQuery Validation Plugin 1.9.0 + * + * http://bassistance.de/jquery-plugins/jquery-plugin-validation/ + * http://docs.jquery.com/Plugins/Validation + * + * Copyright (c) 2006 - 2011 Jörn Zaefferer + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ + +(function($) { + +$.extend($.fn, { + // http://docs.jquery.com/Plugins/Validation/validate + validate: function( options ) { + + // if nothing is selected, return nothing; can't chain anyway + if (!this.length) { + options && options.debug && window.console && console.warn( "nothing selected, can't validate, returning nothing" ); + return; + } + + // check if a validator for this form was already created + var validator = $.data(this[0], 'validator'); + if ( validator ) { + return validator; + } + + // Add novalidate tag if HTML5. + this.attr('novalidate', 'novalidate'); + + validator = new $.validator( options, this[0] ); + $.data(this[0], 'validator', validator); + + if ( validator.settings.onsubmit ) { + + var inputsAndButtons = this.find("input, button"); + + // allow suppresing validation by adding a cancel class to the submit button + inputsAndButtons.filter(".cancel").click(function () { + validator.cancelSubmit = true; + }); + + // when a submitHandler is used, capture the submitting button + if (validator.settings.submitHandler) { + inputsAndButtons.filter(":submit").click(function () { + validator.submitButton = this; + }); + } + + // validate the form on submit + this.submit( function( event ) { + if ( validator.settings.debug ) + // prevent form submit to be able to see console output + event.preventDefault(); + + function handle() { + if ( validator.settings.submitHandler ) { + if (validator.submitButton) { + // insert a hidden input as a replacement for the missing submit button + var hidden = $("").attr("name", validator.submitButton.name).val(validator.submitButton.value).appendTo(validator.currentForm); + } + validator.settings.submitHandler.call( validator, validator.currentForm ); + if (validator.submitButton) { + // and clean up afterwards; thanks to no-block-scope, hidden can be referenced + hidden.remove(); + } + return false; + } + return true; + } + + // prevent submit for invalid forms or custom submit handlers + if ( validator.cancelSubmit ) { + validator.cancelSubmit = false; + return handle(); + } + if ( validator.form() ) { + if ( validator.pendingRequest ) { + validator.formSubmitted = true; + return false; + } + return handle(); + } else { + validator.focusInvalid(); + return false; + } + }); + } + + return validator; + }, + // http://docs.jquery.com/Plugins/Validation/valid + valid: function() { + if ( $(this[0]).is('form')) { + return this.validate().form(); + } else { + var valid = true; + var validator = $(this[0].form).validate(); + this.each(function() { + valid &= validator.element(this); + }); + return valid; + } + }, + // attributes: space seperated list of attributes to retrieve and remove + removeAttrs: function(attributes) { + var result = {}, + $element = this; + $.each(attributes.split(/\s/), function(index, value) { + result[value] = $element.attr(value); + $element.removeAttr(value); + }); + return result; + }, + // http://docs.jquery.com/Plugins/Validation/rules + rules: function(command, argument) { + var element = this[0]; + + if (command) { + var settings = $.data(element.form, 'validator').settings; + var staticRules = settings.rules; + var existingRules = $.validator.staticRules(element); + switch(command) { + case "add": + $.extend(existingRules, $.validator.normalizeRule(argument)); + staticRules[element.name] = existingRules; + if (argument.messages) + settings.messages[element.name] = $.extend( settings.messages[element.name], argument.messages ); + break; + case "remove": + if (!argument) { + delete staticRules[element.name]; + return existingRules; + } + var filtered = {}; + $.each(argument.split(/\s/), function(index, method) { + filtered[method] = existingRules[method]; + delete existingRules[method]; + }); + return filtered; + } + } + + var data = $.validator.normalizeRules( + $.extend( + {}, + $.validator.metadataRules(element), + $.validator.classRules(element), + $.validator.attributeRules(element), + $.validator.staticRules(element) + ), element); + + // make sure required is at front + if (data.required) { + var param = data.required; + delete data.required; + data = $.extend({required: param}, data); + } + + return data; + } +}); + +// Custom selectors +$.extend($.expr[":"], { + // http://docs.jquery.com/Plugins/Validation/blank + blank: function(a) {return !$.trim("" + a.value);}, + // http://docs.jquery.com/Plugins/Validation/filled + filled: function(a) {return !!$.trim("" + a.value);}, + // http://docs.jquery.com/Plugins/Validation/unchecked + unchecked: function(a) {return !a.checked;} +}); + +// constructor for validator +$.validator = function( options, form ) { + this.settings = $.extend( true, {}, $.validator.defaults, options ); + this.currentForm = form; + this.init(); +}; + +$.validator.format = function(source, params) { + if ( arguments.length == 1 ) + return function() { + var args = $.makeArray(arguments); + args.unshift(source); + return $.validator.format.apply( this, args ); + }; + if ( arguments.length > 2 && params.constructor != Array ) { + params = $.makeArray(arguments).slice(1); + } + if ( params.constructor != Array ) { + params = [ params ]; + } + $.each(params, function(i, n) { + source = source.replace(new RegExp("\\{" + i + "\\}", "g"), n); + }); + return source; +}; + +$.extend($.validator, { + + defaults: { + messages: {}, + groups: {}, + rules: {}, + errorClass: "error", + validClass: "valid", + errorElement: "label", + focusInvalid: true, + errorContainer: $( [] ), + errorLabelContainer: $( [] ), + onsubmit: true, + ignore: ":hidden", + ignoreTitle: false, + onfocusin: function(element, event) { + this.lastActive = element; + + // hide error label and remove error class on focus if enabled + if ( this.settings.focusCleanup && !this.blockFocusCleanup ) { + this.settings.unhighlight && this.settings.unhighlight.call( this, element, this.settings.errorClass, this.settings.validClass ); + this.addWrapper(this.errorsFor(element)).hide(); + } + }, + onfocusout: function(element, event) { + if ( !this.checkable(element) && (element.name in this.submitted || !this.optional(element)) ) { + this.element(element); + } + }, + onkeyup: function(element, event) { + if ( element.name in this.submitted || element == this.lastElement ) { + this.element(element); + } + }, + onclick: function(element, event) { + // click on selects, radiobuttons and checkboxes + if ( element.name in this.submitted ) + this.element(element); + // or option elements, check parent select in that case + else if (element.parentNode.name in this.submitted) + this.element(element.parentNode); + }, + highlight: function(element, errorClass, validClass) { + if (element.type === 'radio') { + this.findByName(element.name).addClass(errorClass).removeClass(validClass); + } else { + $(element).addClass(errorClass).removeClass(validClass); + } + }, + unhighlight: function(element, errorClass, validClass) { + if (element.type === 'radio') { + this.findByName(element.name).removeClass(errorClass).addClass(validClass); + } else { + $(element).removeClass(errorClass).addClass(validClass); + } + } + }, + + // http://docs.jquery.com/Plugins/Validation/Validator/setDefaults + setDefaults: function(settings) { + $.extend( $.validator.defaults, settings ); + }, + + 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.", + accept: "Please enter a value with a valid extension.", + maxlength: $.validator.format("Please enter no more than {0} characters."), + minlength: $.validator.format("Please enter at least {0} characters."), + rangelength: $.validator.format("Please enter a value between {0} and {1} characters long."), + range: $.validator.format("Please enter a value between {0} and {1}."), + max: $.validator.format("Please enter a value less than or equal to {0}."), + min: $.validator.format("Please enter a value greater than or equal to {0}.") + }, + + autoCreateRanges: false, + + prototype: { + + init: function() { + this.labelContainer = $(this.settings.errorLabelContainer); + this.errorContext = this.labelContainer.length && this.labelContainer || $(this.currentForm); + this.containers = $(this.settings.errorContainer).add( this.settings.errorLabelContainer ); + this.submitted = {}; + this.valueCache = {}; + this.pendingRequest = 0; + this.pending = {}; + this.invalid = {}; + this.reset(); + + var groups = (this.groups = {}); + $.each(this.settings.groups, function(key, value) { + $.each(value.split(/\s/), function(index, name) { + groups[name] = key; + }); + }); + var rules = this.settings.rules; + $.each(rules, function(key, value) { + rules[key] = $.validator.normalizeRule(value); + }); + + function delegate(event) { + var validator = $.data(this[0].form, "validator"), + eventType = "on" + event.type.replace(/^validate/, ""); + validator.settings[eventType] && validator.settings[eventType].call(validator, this[0], event); + } + $(this.currentForm) + .validateDelegate("[type='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'] ", + "focusin focusout keyup", delegate) + .validateDelegate("[type='radio'], [type='checkbox'], select, option", "click", delegate); + + if (this.settings.invalidHandler) + $(this.currentForm).bind("invalid-form.validate", this.settings.invalidHandler); + }, + + // http://docs.jquery.com/Plugins/Validation/Validator/form + form: function() { + this.checkForm(); + $.extend(this.submitted, this.errorMap); + this.invalid = $.extend({}, this.errorMap); + if (!this.valid()) + $(this.currentForm).triggerHandler("invalid-form", [this]); + this.showErrors(); + return this.valid(); + }, + + checkForm: function() { + this.prepareForm(); + for ( var i = 0, elements = (this.currentElements = this.elements()); elements[i]; i++ ) { + this.check( elements[i] ); + } + return this.valid(); + }, + + // http://docs.jquery.com/Plugins/Validation/Validator/element + element: function( element ) { + element = this.validationTargetFor( this.clean( element ) ); + this.lastElement = element; + this.prepareElement( element ); + this.currentElements = $(element); + var result = this.check( element ); + if ( result ) { + delete this.invalid[element.name]; + } else { + this.invalid[element.name] = true; + } + if ( !this.numberOfInvalids() ) { + // Hide error containers on last error + this.toHide = this.toHide.add( this.containers ); + } + this.showErrors(); + return result; + }, + + // http://docs.jquery.com/Plugins/Validation/Validator/showErrors + showErrors: function(errors) { + if(errors) { + // add items to error list and map + $.extend( this.errorMap, errors ); + this.errorList = []; + for ( var name in errors ) { + this.errorList.push({ + message: errors[name], + element: this.findByName(name)[0] + }); + } + // remove items from success list + this.successList = $.grep( this.successList, function(element) { + return !(element.name in errors); + }); + } + this.settings.showErrors + ? this.settings.showErrors.call( this, this.errorMap, this.errorList ) + : this.defaultShowErrors(); + }, + + // http://docs.jquery.com/Plugins/Validation/Validator/resetForm + resetForm: function() { + if ( $.fn.resetForm ) + $( this.currentForm ).resetForm(); + this.submitted = {}; + this.lastElement = null; + this.prepareForm(); + this.hideErrors(); + this.elements().removeClass( this.settings.errorClass ); + }, + + numberOfInvalids: function() { + return this.objectLength(this.invalid); + }, + + objectLength: function( obj ) { + var count = 0; + for ( var i in obj ) + count++; + return count; + }, + + hideErrors: function() { + this.addWrapper( this.toHide ).hide(); + }, + + valid: function() { + return this.size() == 0; + }, + + size: function() { + return this.errorList.length; + }, + + focusInvalid: function() { + if( this.settings.focusInvalid ) { + try { + $(this.findLastActive() || this.errorList.length && this.errorList[0].element || []) + .filter(":visible") + .focus() + // manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find + .trigger("focusin"); + } catch(e) { + // ignore IE throwing errors when focusing hidden elements + } + } + }, + + findLastActive: function() { + var lastActive = this.lastActive; + return lastActive && $.grep(this.errorList, function(n) { + return n.element.name == lastActive.name; + }).length == 1 && lastActive; + }, + + elements: function() { + var validator = this, + rulesCache = {}; + + // select all valid inputs inside the form (no submit or reset buttons) + return $(this.currentForm) + .find("input, select, textarea") + .not(":submit, :reset, :image, [disabled]") + .not( this.settings.ignore ) + .filter(function() { + !this.name && validator.settings.debug && window.console && console.error( "%o has no name assigned", this); + + // select only the first element for each name, and only those with rules specified + if ( this.name in rulesCache || !validator.objectLength($(this).rules()) ) + return false; + + rulesCache[this.name] = true; + return true; + }); + }, + + clean: function( selector ) { + return $( selector )[0]; + }, + + errors: function() { + return $( this.settings.errorElement + "." + this.settings.errorClass, this.errorContext ); + }, + + reset: function() { + this.successList = []; + this.errorList = []; + this.errorMap = {}; + this.toShow = $([]); + this.toHide = $([]); + this.currentElements = $([]); + }, + + prepareForm: function() { + this.reset(); + this.toHide = this.errors().add( this.containers ); + }, + + prepareElement: function( element ) { + this.reset(); + this.toHide = this.errorsFor(element); + }, + + check: function( element ) { + element = this.validationTargetFor( this.clean( element ) ); + + var rules = $(element).rules(); + var dependencyMismatch = false; + for (var method in rules ) { + var rule = { method: method, parameters: rules[method] }; + try { + var result = $.validator.methods[method].call( this, element.value.replace(/\r/g, ""), element, rule.parameters ); + + // if a method indicates that the field is optional and therefore valid, + // don't mark it as valid when there are no other rules + if ( result == "dependency-mismatch" ) { + dependencyMismatch = true; + continue; + } + dependencyMismatch = false; + + if ( result == "pending" ) { + this.toHide = this.toHide.not( this.errorsFor(element) ); + return; + } + + if( !result ) { + this.formatAndAdd( element, rule ); + return false; + } + } catch(e) { + this.settings.debug && window.console && console.log("exception occured when checking element " + element.id + + ", check the '" + rule.method + "' method", e); + throw e; + } + } + if (dependencyMismatch) + return; + if ( this.objectLength(rules) ) + this.successList.push(element); + return true; + }, + + // return the custom message for the given element and validation method + // specified in the element's "messages" metadata + customMetaMessage: function(element, method) { + if (!$.metadata) + return; + + var meta = this.settings.meta + ? $(element).metadata()[this.settings.meta] + : $(element).metadata(); + + return meta && meta.messages && meta.messages[method]; + }, + + // return the custom message for the given element name and validation method + customMessage: function( name, method ) { + var m = this.settings.messages[name]; + return m && (m.constructor == String + ? m + : m[method]); + }, + + // return the first defined argument, allowing empty strings + findDefined: function() { + for(var i = 0; i < arguments.length; i++) { + if (arguments[i] !== undefined) + return arguments[i]; + } + return undefined; + }, + + defaultMessage: function( element, method) { + return this.findDefined( + this.customMessage( element.name, method ), + this.customMetaMessage( element, method ), + // title is never undefined, so handle empty string as undefined + !this.settings.ignoreTitle && element.title || undefined, + $.validator.messages[method], + "Warning: No message defined for " + element.name + "" + ); + }, + + formatAndAdd: function( element, rule ) { + var message = this.defaultMessage( element, rule.method ), + theregex = /\$?\{(\d+)\}/g; + if ( typeof message == "function" ) { + message = message.call(this, rule.parameters, element); + } else if (theregex.test(message)) { + message = jQuery.format(message.replace(theregex, '{$1}'), rule.parameters); + } + this.errorList.push({ + message: message, + element: element + }); + + this.errorMap[element.name] = message; + this.submitted[element.name] = message; + }, + + addWrapper: function(toToggle) { + if ( this.settings.wrapper ) + toToggle = toToggle.add( toToggle.parent( this.settings.wrapper ) ); + return toToggle; + }, + + defaultShowErrors: function() { + for ( var i = 0; this.errorList[i]; i++ ) { + var error = this.errorList[i]; + this.settings.highlight && this.settings.highlight.call( this, error.element, this.settings.errorClass, this.settings.validClass ); + this.showLabel( error.element, error.message ); + } + if( this.errorList.length ) { + this.toShow = this.toShow.add( this.containers ); + } + if (this.settings.success) { + for ( var i = 0; this.successList[i]; i++ ) { + this.showLabel( this.successList[i] ); + } + } + if (this.settings.unhighlight) { + for ( var i = 0, elements = this.validElements(); elements[i]; i++ ) { + this.settings.unhighlight.call( this, elements[i], 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 $(this.errorList).map(function() { + return this.element; + }); + }, + + showLabel: function(element, message) { + var label = this.errorsFor( element ); + if ( label.length ) { + // refresh error/success class + label.removeClass( this.settings.validClass ).addClass( this.settings.errorClass ); + + // check if we have a generated label, replace the message then + label.attr("generated") && label.html(message); + } else { + // create label + label = $("<" + this.settings.errorElement + "/>") + .attr({"for": this.idOrName(element), generated: true}) + .addClass(this.settings.errorClass) + .html(message || ""); + if ( this.settings.wrapper ) { + // make sure the element is visible, even in IE + // actually showing the wrapped element is handled elsewhere + label = label.hide().show().wrap("<" + this.settings.wrapper + "/>").parent(); + } + if ( !this.labelContainer.append(label).length ) + this.settings.errorPlacement + ? this.settings.errorPlacement(label, $(element) ) + : label.insertAfter(element); + } + if ( !message && this.settings.success ) { + label.text(""); + typeof this.settings.success == "string" + ? label.addClass( this.settings.success ) + : this.settings.success( label ); + } + this.toShow = this.toShow.add(label); + }, + + errorsFor: function(element) { + var name = this.idOrName(element); + return this.errors().filter(function() { + return $(this).attr('for') == name; + }); + }, + + idOrName: function(element) { + return this.groups[element.name] || (this.checkable(element) ? element.name : element.id || element.name); + }, + + validationTargetFor: function(element) { + // if radio/checkbox, validate first element in group instead + if (this.checkable(element)) { + element = this.findByName( element.name ).not(this.settings.ignore)[0]; + } + return element; + }, + + checkable: function( element ) { + return /radio|checkbox/i.test(element.type); + }, + + findByName: function( name ) { + // select by name and filter by form for performance over form.find("[name=...]") + var form = this.currentForm; + return $(document.getElementsByName(name)).map(function(index, element) { + return element.form == form && element.name == name && element || null; + }); + }, + + getLength: function(value, element) { + switch( element.nodeName.toLowerCase() ) { + case 'select': + return $("option:selected", element).length; + case 'input': + if( this.checkable( element) ) + return this.findByName(element.name).filter(':checked').length; + } + return value.length; + }, + + depend: function(param, element) { + return this.dependTypes[typeof param] + ? this.dependTypes[typeof param](param, element) + : true; + }, + + dependTypes: { + "boolean": function(param, element) { + return param; + }, + "string": function(param, element) { + return !!$(param, element.form).length; + }, + "function": function(param, element) { + return param(element); + } + }, + + optional: function(element) { + return !$.validator.methods.required.call(this, $.trim(element.value), element) && "dependency-mismatch"; + }, + + startRequest: function(element) { + if (!this.pending[element.name]) { + this.pendingRequest++; + this.pending[element.name] = true; + } + }, + + stopRequest: function(element, valid) { + this.pendingRequest--; + // sometimes synchronization fails, make sure pendingRequest is never < 0 + if (this.pendingRequest < 0) + this.pendingRequest = 0; + delete this.pending[element.name]; + if ( valid && this.pendingRequest == 0 && this.formSubmitted && this.form() ) { + $(this.currentForm).submit(); + this.formSubmitted = false; + } else if (!valid && this.pendingRequest == 0 && this.formSubmitted) { + $(this.currentForm).triggerHandler("invalid-form", [this]); + this.formSubmitted = false; + } + }, + + previousValue: function(element) { + return $.data(element, "previousValue") || $.data(element, "previousValue", { + old: null, + valid: true, + message: this.defaultMessage( element, "remote" ) + }); + } + + }, + + classRuleSettings: { + required: {required: true}, + email: {email: true}, + url: {url: true}, + date: {date: true}, + dateISO: {dateISO: true}, + dateDE: {dateDE: true}, + number: {number: true}, + numberDE: {numberDE: true}, + digits: {digits: true}, + creditcard: {creditcard: true} + }, + + addClassRules: function(className, rules) { + className.constructor == String ? + this.classRuleSettings[className] = rules : + $.extend(this.classRuleSettings, className); + }, + + classRules: function(element) { + var rules = {}; + var classes = $(element).attr('class'); + classes && $.each(classes.split(' '), function() { + if (this in $.validator.classRuleSettings) { + $.extend(rules, $.validator.classRuleSettings[this]); + } + }); + return rules; + }, + + attributeRules: function(element) { + var rules = {}; + var $element = $(element); + + for (var method in $.validator.methods) { + var value; + // If .prop exists (jQuery >= 1.6), use it to get true/false for required + if (method === 'required' && typeof $.fn.prop === 'function') { + value = $element.prop(method); + } else { + value = $element.attr(method); + } + if (value) { + rules[method] = value; + } else if ($element[0].getAttribute("type") === method) { + rules[method] = true; + } + } + + // maxlength may be returned as -1, 2147483647 (IE) and 524288 (safari) for text inputs + if (rules.maxlength && /-1|2147483647|524288/.test(rules.maxlength)) { + delete rules.maxlength; + } + + return rules; + }, + + metadataRules: function(element) { + if (!$.metadata) return {}; + + var meta = $.data(element.form, 'validator').settings.meta; + return meta ? + $(element).metadata()[meta] : + $(element).metadata(); + }, + + staticRules: function(element) { + var rules = {}; + var validator = $.data(element.form, 'validator'); + if (validator.settings.rules) { + rules = $.validator.normalizeRule(validator.settings.rules[element.name]) || {}; + } + return rules; + }, + + normalizeRules: function(rules, element) { + // handle dependency check + $.each(rules, function(prop, val) { + // ignore rule when param is explicitly false, eg. required:false + if (val === false) { + delete rules[prop]; + return; + } + if (val.param || val.depends) { + var keepRule = true; + switch (typeof val.depends) { + case "string": + keepRule = !!$(val.depends, element.form).length; + break; + case "function": + keepRule = val.depends.call(element, element); + break; + } + if (keepRule) { + rules[prop] = val.param !== undefined ? val.param : true; + } else { + delete rules[prop]; + } + } + }); + + // evaluate parameters + $.each(rules, function(rule, parameter) { + rules[rule] = $.isFunction(parameter) ? parameter(element) : parameter; + }); + + // clean number parameters + $.each(['minlength', 'maxlength', 'min', 'max'], function() { + if (rules[this]) { + rules[this] = Number(rules[this]); + } + }); + $.each(['rangelength', 'range'], function() { + if (rules[this]) { + rules[this] = [Number(rules[this][0]), Number(rules[this][1])]; + } + }); + + if ($.validator.autoCreateRanges) { + // auto-create ranges + if (rules.min && rules.max) { + rules.range = [rules.min, rules.max]; + delete rules.min; + delete rules.max; + } + if (rules.minlength && rules.maxlength) { + rules.rangelength = [rules.minlength, rules.maxlength]; + delete rules.minlength; + delete rules.maxlength; + } + } + + // To support custom messages in metadata ignore rule methods titled "messages" + if (rules.messages) { + delete rules.messages; + } + + return rules; + }, + + // Converts a simple string to a {string: true} rule, e.g., "required" to {required:true} + normalizeRule: function(data) { + if( typeof data == "string" ) { + var transformed = {}; + $.each(data.split(/\s/), function() { + transformed[this] = true; + }); + data = transformed; + } + return data; + }, + + // http://docs.jquery.com/Plugins/Validation/Validator/addMethod + addMethod: function(name, method, message) { + $.validator.methods[name] = method; + $.validator.messages[name] = message != undefined ? message : $.validator.messages[name]; + if (method.length < 3) { + $.validator.addClassRules(name, $.validator.normalizeRule(name)); + } + }, + + methods: { + + // http://docs.jquery.com/Plugins/Validation/Methods/required + required: function(value, element, param) { + // check if dependency is met + if ( !this.depend(param, element) ) + return "dependency-mismatch"; + switch( element.nodeName.toLowerCase() ) { + case 'select': + // could be an array for select-multiple or a string, both are fine this way + var val = $(element).val(); + return val && val.length > 0; + case 'input': + if ( this.checkable(element) ) + return this.getLength(value, element) > 0; + default: + return $.trim(value).length > 0; + } + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/remote + remote: function(value, element, param) { + if ( this.optional(element) ) + return "dependency-mismatch"; + + var previous = this.previousValue(element); + if (!this.settings.messages[element.name] ) + this.settings.messages[element.name] = {}; + previous.originalMessage = this.settings.messages[element.name].remote; + this.settings.messages[element.name].remote = previous.message; + + param = typeof param == "string" && {url:param} || param; + + if ( this.pending[element.name] ) { + return "pending"; + } + if ( previous.old === value ) { + return previous.valid; + } + + previous.old = value; + var validator = this; + this.startRequest(element); + var data = {}; + data[element.name] = value; + $.ajax($.extend(true, { + url: param, + mode: "abort", + port: "validate" + element.name, + dataType: "json", + data: data, + success: function(response) { + validator.settings.messages[element.name].remote = previous.originalMessage; + var valid = response === true; + if ( valid ) { + var submitted = validator.formSubmitted; + validator.prepareElement(element); + validator.formSubmitted = submitted; + validator.successList.push(element); + validator.showErrors(); + } else { + var errors = {}; + var message = response || validator.defaultMessage( element, "remote" ); + errors[element.name] = previous.message = $.isFunction(message) ? message(value) : message; + validator.showErrors(errors); + } + previous.valid = valid; + validator.stopRequest(element, valid); + } + }, param)); + return "pending"; + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/minlength + minlength: function(value, element, param) { + return this.optional(element) || this.getLength($.trim(value), element) >= param; + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/maxlength + maxlength: function(value, element, param) { + return this.optional(element) || this.getLength($.trim(value), element) <= param; + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/rangelength + rangelength: function(value, element, param) { + var length = this.getLength($.trim(value), element); + return this.optional(element) || ( length >= param[0] && length <= param[1] ); + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/min + min: function( value, element, param ) { + return this.optional(element) || value >= param; + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/max + max: function( value, element, param ) { + return this.optional(element) || value <= param; + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/range + range: function( value, element, param ) { + return this.optional(element) || ( value >= param[0] && value <= param[1] ); + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/email + email: function(value, element) { + // contributed by Scott Gonzalez: http://projects.scottsplayground.com/email_address_validation/ + return this.optional(element) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([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])))$/i.test(value); + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/url + url: function(value, element) { + // contributed by Scott Gonzalez: http://projects.scottsplayground.com/iri/ + 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); + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/date + date: function(value, element) { + return this.optional(element) || !/Invalid|NaN/.test(new Date(value)); + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/dateISO + dateISO: function(value, element) { + return this.optional(element) || /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value); + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/number + number: function(value, element) { + return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value); + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/digits + digits: function(value, element) { + return this.optional(element) || /^\d+$/.test(value); + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/creditcard + // based on http://en.wikipedia.org/wiki/Luhn + creditcard: function(value, element) { + if ( this.optional(element) ) + return "dependency-mismatch"; + // accept only spaces, digits and dashes + if (/[^0-9 -]+/.test(value)) + return false; + var nCheck = 0, + nDigit = 0, + bEven = false; + + value = value.replace(/\D/g, ""); + + for (var n = value.length - 1; n >= 0; n--) { + var cDigit = value.charAt(n); + var nDigit = parseInt(cDigit, 10); + if (bEven) { + if ((nDigit *= 2) > 9) + nDigit -= 9; + } + nCheck += nDigit; + bEven = !bEven; + } + + return (nCheck % 10) == 0; + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/accept + accept: function(value, element, param) { + param = typeof param == "string" ? param.replace(/,/g, '|') : "png|jpe?g|gif"; + return this.optional(element) || value.match(new RegExp(".(" + param + ")$", "i")); + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/equalTo + equalTo: function(value, element, param) { + // bind to the blur event of the target in order to revalidate whenever the target field is updated + // TODO find a way to bind the event just once, avoiding the unbind-rebind overhead + var target = $(param).unbind(".validate-equalTo").bind("blur.validate-equalTo", function() { + $(element).valid(); + }); + return value == target.val(); + } + + } + +}); + +// deprecated, use $.validator.format instead +$.format = $.validator.format; + +})(jQuery); + +// ajax mode: abort +// usage: $.ajax({ mode: "abort"[, port: "uniqueport"]}); +// if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort() +;(function($) { + var pendingRequests = {}; + // Use a prefilter if available (1.5+) + if ( $.ajaxPrefilter ) { + $.ajaxPrefilter(function(settings, _, xhr) { + var port = settings.port; + if (settings.mode == "abort") { + if ( pendingRequests[port] ) { + pendingRequests[port].abort(); + } + pendingRequests[port] = xhr; + } + }); + } else { + // Proxy ajax + var ajax = $.ajax; + $.ajax = function(settings) { + var mode = ( "mode" in settings ? settings : $.ajaxSettings ).mode, + port = ( "port" in settings ? settings : $.ajaxSettings ).port; + if (mode == "abort") { + if ( pendingRequests[port] ) { + pendingRequests[port].abort(); + } + return (pendingRequests[port] = ajax.apply(this, arguments)); + } + return ajax.apply(this, arguments); + }; + } +})(jQuery); + +// provides cross-browser focusin and focusout events +// IE has native support, in other browsers, use event caputuring (neither bubbles) + +// provides delegate(type: String, delegate: Selector, handler: Callback) plugin for easier event delegation +// handler is only called when $(event.target).is(delegate), in the scope of the jquery-object for event.target +;(function($) { + // only implement if not provided by jQuery core (since 1.4) + // TODO verify if jQuery 1.4's implementation is compatible with older jQuery special-event APIs + if (!jQuery.event.special.focusin && !jQuery.event.special.focusout && document.addEventListener) { + $.each({ + focus: 'focusin', + blur: 'focusout' + }, function( original, fix ){ + $.event.special[fix] = { + setup:function() { + this.addEventListener( original, handler, true ); + }, + teardown:function() { + this.removeEventListener( original, handler, true ); + }, + handler: function(e) { + arguments[0] = $.event.fix(e); + arguments[0].type = fix; + return $.event.handle.apply(this, arguments); + } + }; + function handler(e) { + e = $.event.fix(e); + e.type = fix; + return $.event.handle.call(this, e); + } + }); + }; + $.extend($.fn, { + validateDelegate: function(delegate, type, handler) { + return this.bind(type, function(event) { + var target = $(event.target); + if (target.is(delegate)) { + return handler.apply(target, arguments); + } + }); + } + }); +})(jQuery); diff --git a/src/main/webapp/resources/js/jquery.wizard.js b/src/main/webapp/resources/js/jquery.wizard.js new file mode 100644 index 0000000000000000000000000000000000000000..2eea9e8ba55b8648f09836d0eab5cebf1753a7a7 --- /dev/null +++ b/src/main/webapp/resources/js/jquery.wizard.js @@ -0,0 +1,456 @@ +/* + * jQuery wizard plug-in 3.0.5 + * + * + * Copyright (c) 2011 Jan Sundman (jan.sundman[at]aland.net) + * + * http://www.thecodemine.org + * + * Licensed under the MIT licens: + * http://www.opensource.org/licenses/mit-license.php + * + */ + + +(function($){ + $.widget("ui.formwizard", { + + _init: function() { + + var wizard = this; + var formOptionsSuccess = this.options.formOptions.success; + var formOptionsComplete = this.options.formOptions.complete; + var formOptionsBeforeSend = this.options.formOptions.beforeSend; + var formOptionsBeforeSubmit = this.options.formOptions.beforeSubmit; + var formOptionsBeforeSerialize = this.options.formOptions.beforeSerialize; + this.options.formOptions = $.extend(this.options.formOptions,{ + success : function(responseText, textStatus, xhr){ + if(formOptionsSuccess){ + formOptionsSuccess(responseText, textStatus, xhr); + } + if(wizard.options.formOptions && wizard.options.formOptions.resetForm || !wizard.options.formOptions){ + wizard._reset(); + } + }, + complete : function(xhr, textStatus){ + if(formOptionsComplete){ + formOptionsComplete(xhr, textStatus); + } + wizard._enableNavigation(); + }, + beforeSubmit : function(arr, theForm, options) { + if(formOptionsBeforeSubmit){ + var shouldSubmit = formOptionsBeforeSubmit(arr, theForm, options); + if(!shouldSubmit) + wizard._enableNavigation(); + return shouldSubmit; + } + }, + beforeSend : function(xhr) { + if(formOptionsBeforeSend){ + var shouldSubmit = formOptionsBeforeSend(xhr); + if(!shouldSubmit) + wizard._enableNavigation(); + return shouldSubmit; + } + }, + beforeSerialize: function(form, options) { + if(formOptionsBeforeSerialize){ + var shouldSubmit = formOptionsBeforeSerialize(form, options); + if(!shouldSubmit) + wizard._enableNavigation(); + return shouldSubmit; + } + } + }); + + this.steps = this.element.find(".step").hide(); + + this.firstStep = this.steps.eq(0).attr("id"); + this.activatedSteps = new Array(); + this.isLastStep = false; + this.previousStep = undefined; + this.currentStep = this.steps.eq(0).attr("id"); + this.nextButton = this.element.find(this.options.next) + .click(function() { + return wizard._next(); + }); + + this.nextButtonInitinalValue = this.nextButton.val(); + this.nextButton.val(this.options.textNext); + + this.backButton = this.element.find(this.options.back) + .click(function() { + wizard._back();return false; + }); + + this.backButtonInitinalValue = this.backButton.val(); + this.backButton.val(this.options.textBack); + + if(this.options.validationEnabled && jQuery().validate == undefined){ + this.options.validationEnabled = false; + if( (window['console'] !== undefined) ){ + console.log("%s", "validationEnabled option set, but the validation plugin is not included"); + } + }else if(this.options.validationEnabled){ + this.element.validate(this.options.validationOptions); + } + if(this.options.formPluginEnabled && jQuery().ajaxSubmit == undefined){ + this.options.formPluginEnabled = false; + if( (window['console'] !== undefined) ){ + console.log("%s", "formPluginEnabled option set but the form plugin is not included"); + } + } + + if(this.options.disableInputFields == true){ + $(this.steps).find(":input:not('.wizard-ignore')").attr("disabled","disabled"); + } + + if(this.options.historyEnabled){ + $(window).bind('hashchange', undefined, function(event){ + var hashStep = event.getState( "_" + $(wizard.element).attr( 'id' )) || wizard.firstStep; + if(hashStep !== wizard.currentStep){ + if(wizard.options.validationEnabled && hashStep === wizard._navigate(wizard.currentStep)){ + if(!wizard.element.valid()){ + wizard._updateHistory(wizard.currentStep); + wizard.element.validate().focusInvalid(); + + return false; + } + } + if(hashStep !== wizard.currentStep) + wizard._show(hashStep); + } + }); + } + + this.element.addClass("ui-formwizard"); + this.element.find(":input").addClass("ui-wizard-content"); + this.steps.addClass("ui-formwizard-content"); + this.backButton.addClass("ui-formwizard-button ui-wizard-content"); + this.nextButton.addClass("ui-formwizard-button ui-wizard-content"); + + if(!this.options.disableUIStyles){ + this.element.addClass("ui-helper-reset ui-widget ui-widget-content ui-helper-reset ui-corner-all"); + this.element.find(":input").addClass("ui-helper-reset ui-state-default"); + this.steps.addClass("ui-helper-reset ui-corner-all"); + this.backButton.addClass("ui-helper-reset ui-state-default"); + this.nextButton.addClass("ui-helper-reset ui-state-default"); + } + this._show(undefined); + return $(this); + }, + + _next : function(){ + if(this.options.validationEnabled){ + if(!this.element.valid()){ + this.element.validate().focusInvalid(); + return false; + } + } + + if(this.options.remoteAjax != undefined){ + var options = this.options.remoteAjax[this.currentStep]; + var wizard = this; + if(options !== undefined){ + var success = options.success; + var beforeSend = options.beforeSend; + var complete = options.complete; + + options = $.extend({},options,{ + success: function(data, statusText){ + if((success !== undefined && success(data, statusText)) || (success == undefined)){ + wizard._continueToNextStep(); + } + }, + beforeSend : function(xhr){ + wizard._disableNavigation(); + if(beforeSend !== undefined) + beforeSend(xhr); + $(wizard.element).trigger('before_remote_ajax', {"currentStep" : wizard.currentStep}); + }, + complete : function(xhr, statusText){ + if(complete !== undefined) + complete(xhr, statusText); + $(wizard.element).trigger('after_remote_ajax', {"currentStep" : wizard.currentStep}); + wizard._enableNavigation(); + } + }) + this.element.ajaxSubmit(options); + return false; + } + } + + return this._continueToNextStep(); + }, + + _back : function(){ + if(this.activatedSteps.length > 0){ + if(this.options.historyEnabled){ + this._updateHistory(this.activatedSteps[this.activatedSteps.length - 2]); + }else{ + this._show(this.activatedSteps[this.activatedSteps.length - 2], true); + } + } + return false; + }, + + _continueToNextStep : function(){ + if(this.isLastStep){ + for(var i = 0; i < this.activatedSteps.length; i++){ + this.steps.filter("#" + this.activatedSteps[i]).find(":input").not(".wizard-ignore").removeAttr("disabled"); + } + if(!this.options.formPluginEnabled){ + return true; + }else{ + this._disableNavigation(); + this.element.ajaxSubmit(this.options.formOptions); + return false; + } + } + + var step = this._navigate(this.currentStep); + if(step == this.currentStep){ + return false; + } + if(this.options.historyEnabled){ + this._updateHistory(step); + }else{ + this._show(step, true); + } + return false; + }, + + _updateHistory : function(step){ + var state = {}; + state["_" + $(this.element).attr('id')] = step; + $.bbq.pushState(state); + }, + + _disableNavigation : function(){ + this.nextButton.attr("disabled","disabled"); + this.backButton.attr("disabled","disabled"); + if(!this.options.disableUIStyles){ + this.nextButton.removeClass("ui-state-active").addClass("ui-state-disabled"); + this.backButton.removeClass("ui-state-active").addClass("ui-state-disabled"); + } + }, + + _enableNavigation : function(){ + if(this.isLastStep){ + this.nextButton.val(this.options.textSubmit); + }else{ + this.nextButton.val(this.options.textNext); + } + + if($.trim(this.currentStep) !== this.steps.eq(0).attr("id")){ + this.backButton.removeAttr("disabled"); + if(!this.options.disableUIStyles){ + this.backButton.removeClass("ui-state-disabled").addClass("ui-state-active"); + } + } + + this.nextButton.removeAttr("disabled"); + if(!this.options.disableUIStyles){ + this.nextButton.removeClass("ui-state-disabled").addClass("ui-state-active"); + } + }, + + _animate : function(oldStep, newStep, stepShownCallback){ + this._disableNavigation(); + var old = this.steps.filter("#" + oldStep); + var current = this.steps.filter("#" + newStep); + old.find(":input").not(".wizard-ignore").attr("disabled","disabled"); + current.find(":input").not(".wizard-ignore").removeAttr("disabled"); + var wizard = this; + old.animate(wizard.options.outAnimation, wizard.options.outDuration, wizard.options.easing, function(){ + current.animate(wizard.options.inAnimation, wizard.options.inDuration, wizard.options.easing, function(){ + if(wizard.options.focusFirstInput) + current.find(":input:first").focus(); + wizard._enableNavigation(); + + stepShownCallback.apply(wizard); + }); + return; + }); + }, + + _checkIflastStep : function(step){ + this.isLastStep = false; + if($("#" + step).hasClass(this.options.submitStepClass) || this.steps.filter(":last").attr("id") == step){ + this.isLastStep = true; + } + }, + + _getLink : function(step){ + var link = undefined; + var links = this.steps.filter("#" + step).find(this.options.linkClass); + + if(links != undefined){ + if(links.filter(":radio,:checkbox").size() > 0){ + link = links.filter(this.options.linkClass + ":checked").val(); + }else{ + link = $(links).val(); + } + } + return link; + }, + + _navigate : function(step){ + var link = this._getLink(step); + if(link != undefined){ + if((link != "" && link != null && link != undefined) && this.steps.filter("#" + link).attr("id") != undefined){ + return link; + } + return this.currentStep; + }else if(link == undefined && !this.isLastStep){ + var step1 = this.steps.filter("#" + step).next().attr("id"); + return step1; + } + }, + + _show : function(step){ + var backwards = false; + var triggerStepShown = step !== undefined; + if(step == undefined || step == ""){ + this.activatedSteps.pop(); + step = this.firstStep; + this.activatedSteps.push(step); + }else{ + if($.inArray(step, this.activatedSteps) > -1){ + backwards = true; + this.activatedSteps.pop(); + }else { + this.activatedSteps.push(step); + } + } + + if(this.currentStep !== step || step === this.firstStep){ + this.previousStep = this.currentStep; + this._checkIflastStep(step); + this.currentStep = step; + var stepShownCallback = function(){if(triggerStepShown)$(this.element).trigger('step_shown', $.extend({"isBackNavigation" : backwards},this._state()));}; + this._animate(this.previousStep, step, stepShownCallback); + }; + + + }, + + _reset : function(){ + this.element.resetForm() + $("label,:input,textarea",this).removeClass("error"); + for(var i = 0; i < this.activatedSteps.length; i++){ + this.steps.filter("#" + this.activatedSteps[i]).hide().find(":input").attr("disabled","disabled"); + } + this.activatedSteps = new Array(); + this.previousStep = undefined; + this.isLastStep = false; + if(this.options.historyEnabled){ + this._updateHistory(this.firstStep); + }else{ + this._show(this.firstStep); + } + + }, + + _state : function(state){ + var currentState = { "settings" : this.options, + "activatedSteps" : this.activatedSteps, + "isLastStep" : this.isLastStep, + "isFirstStep" : this.currentStep === this.firstStep, + "previousStep" : this.previousStep, + "currentStep" : this.currentStep, + "backButton" : this.backButton, + "nextButton" : this.nextButton, + "steps" : this.steps, + "firstStep" : this.firstStep + } + + if(state !== undefined) + return currentState[state]; + + return currentState; + }, + + /*Methods*/ + + show : function(step){ + if(this.options.historyEnabled){ + this._updateHistory(step); + }else{ + this._show(step); + } + }, + + state : function(state){ + return this._state(state); + }, + + reset : function(){ + this._reset(); + }, + + next : function(){ + this._next(); + }, + + back : function(){ + this._back(); + }, + + destroy: function() { + this.element.find("*").removeAttr("disabled").show(); + this.nextButton.unbind("click").val(this.nextButtonInitinalValue).removeClass("ui-state-disabled").addClass("ui-state-active"); + this.backButton.unbind("click").val(this.backButtonInitinalValue).removeClass("ui-state-disabled").addClass("ui-state-active"); + this.backButtonInitinalValue = undefined; + this.nextButtonInitinalValue = undefined; + this.activatedSteps = undefined; + this.previousStep = undefined; + this.currentStep = undefined; + this.isLastStep = undefined; + this.options = undefined; + this.nextButton = undefined; + this.backButton = undefined; + this.formwizard = undefined; + this.element = undefined; + this.steps = undefined; + this.firstStep = undefined; + }, + + update_steps : function(){ + this.steps = this.element.find(".step").addClass("ui-formwizard-content"); + this.steps.not("#" + this.currentStep).hide().find(":input").addClass("ui-wizard-content").attr("disabled","disabled"); + this._checkIflastStep(this.currentStep); + this._enableNavigation(); + if(!this.options.disableUIStyles){ + this.steps.addClass("ui-helper-reset ui-corner-all"); + this.steps.find(":input").addClass("ui-helper-reset ui-state-default"); + } + }, + + options: { + historyEnabled : false, + validationEnabled : false, + validationOptions : undefined, + formPluginEnabled : false, + linkClass : ".link", + submitStepClass : "submit_step", + back : ":reset", + next : ":submit", + textSubmit : 'Submit', + textNext : 'Next', + textBack : 'Back', + remoteAjax : undefined, + inAnimation : {opacity: 'show'}, + outAnimation: {opacity: 'hide'}, + inDuration : 400, + outDuration: 400, + easing: 'swing', + focusFirstInput : false, + disableInputFields : true, + formOptions : { reset: true, success: function(data) { if( (window['console'] !== undefined) ){console.log("%s", "form submit successful");}}, + disableUIStyles : false + } + } + }); +})(jQuery); diff --git a/src/main/webapp/resources/js/maruti.html b/src/main/webapp/resources/js/maruti.html new file mode 100644 index 0000000000000000000000000000000000000000..1229715285cd5f52b299a9dcf7936157626237ff --- /dev/null +++ b/src/main/webapp/resources/js/maruti.html @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + Page not found - Theme Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + +
    +
    + + +
    +
    + +

    404 Not Found

    +

    Apologies, but the page you requested could not be found. Perhaps searching will help.

    +
    +

    +

    + + + +
    +
    + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/resources/js/masked.js b/src/main/webapp/resources/js/masked.js new file mode 100644 index 0000000000000000000000000000000000000000..fdbd5209e447d7da7bceecf180c2a9c418b0f901 --- /dev/null +++ b/src/main/webapp/resources/js/masked.js @@ -0,0 +1,7 @@ +/* + Masked Input plugin for jQuery + Copyright (c) 2007-2011 Josh Bush (digitalbush.com) + Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license) + Version: 1.3 +*/ +(function(a){var b=(a.browser.msie?"paste":"input")+".mask",c=window.orientation!=undefined;a.mask={definitions:{9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},dataName:"rawMaskFn"},a.fn.extend({caret:function(a,b){if(this.length!=0){if(typeof a=="number"){b=typeof b=="number"?b:a;return this.each(function(){if(this.setSelectionRange)this.setSelectionRange(a,b);else if(this.createTextRange){var c=this.createTextRange();c.collapse(!0),c.moveEnd("character",b),c.moveStart("character",a),c.select()}})}if(this[0].setSelectionRange)a=this[0].selectionStart,b=this[0].selectionEnd;else if(document.selection&&document.selection.createRange){var c=document.selection.createRange();a=0-c.duplicate().moveStart("character",-1e5),b=a+c.text.length}return{begin:a,end:b}}},unmask:function(){return this.trigger("unmask")},mask:function(d,e){if(!d&&this.length>0){var f=a(this[0]);return f.data(a.mask.dataName)()}e=a.extend({placeholder:"_",completed:null},e);var g=a.mask.definitions,h=[],i=d.length,j=null,k=d.length;a.each(d.split(""),function(a,b){b=="?"?(k--,i=a):g[b]?(h.push(new RegExp(g[b])),j==null&&(j=h.length-1)):h.push(null)});return this.trigger("unmask").each(function(){function v(a){var b=f.val(),c=-1;for(var d=0,g=0;db.length)break}else l[d]==b.charAt(g)&&d!=i&&(g++,c=d);if(!a&&c+1=i)u(),a||f.val(f.val().substring(0,c+1));return i?d:j}function u(){return f.val(l.join("")).val()}function t(a,b){for(var c=a;c=k&&e.completed.call(f)}}return!1}}function r(a){var b=a.which;if(b==8||b==46||c&&b==127){var d=f.caret(),e=d.begin,g=d.end;g-e==0&&(e=b!=46?o(e):g=n(e-1),g=b==46?n(g):g),t(e,g),p(e,g-1);return!1}if(b==27){f.val(m),f.caret(0,v());return!1}}function q(a){for(var b=a,c=e.placeholder;b=0&&!h[a]);return a}function n(a){while(++a<=k&&!h[a]);return a}var f=a(this),l=a.map(d.split(""),function(a,b){if(a!="?")return g[a]?e.placeholder:a}),m=f.val();f.data(a.mask.dataName,function(){return a.map(l,function(a,b){return h[b]&&a!=e.placeholder?a:null}).join("")}),f.attr("readonly")||f.one("unmask",function(){f.unbind(".mask").removeData(a.mask.dataName)}).bind("focus.mask",function(){m=f.val();var b=v();u();var c=function(){b==d.length?f.caret(0,b):f.caret(b)};(a.browser.msie?c:function(){setTimeout(c,0)})()}).bind("blur.mask",function(){v(),f.val()!=m&&f.change()}).bind("keydown.mask",r).bind("keypress.mask",s).bind(b,function(){setTimeout(function(){f.caret(v(!0))},0)}),v()})}})})(jQuery) \ No newline at end of file diff --git a/src/main/webapp/resources/js/matrix.calendar.js b/src/main/webapp/resources/js/matrix.calendar.js new file mode 100644 index 0000000000000000000000000000000000000000..d2d7d2cf05102a60841e9fd0140d5a243c59089b --- /dev/null +++ b/src/main/webapp/resources/js/matrix.calendar.js @@ -0,0 +1,107 @@ + +$(document).ready(function(){ + + maruti.init(); + + $('#add-event-submit').click(function(){ + maruti.add_event(); + }); + + $('#event-name').keypress(function(e){ + if(e.which == 13) { + maruti.add_event(); + } + }); +}); + +maruti = { + + // === Initialize the fullCalendar and external draggable events === // + init: function() { + // Prepare the dates + var date = new Date(); + var d = date.getDate(); + var m = date.getMonth(); + var y = date.getFullYear(); + + $('#fullcalendar').fullCalendar({ + header: { + left: 'prev,next', + center: 'title', + right: 'month,basicWeek,basicDay' + }, + editable: true, + droppable: true, // this allows things to be dropped onto the calendar !!! + drop: function(date, allDay) { // this function is called when something is dropped + + // retrieve the dropped element's stored Event Object + var originalEventObject = $(this).data('eventObject'); + + // we need to copy it, so that multiple events don't have a reference to the same object + var copiedEventObject = $.extend({}, originalEventObject); + + // assign it the date that was reported + copiedEventObject.start = date; + copiedEventObject.allDay = allDay; + + // render the event on the calendar + // the last `true` argument determines if the event "sticks" (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/) + $('#fullcalendar').fullCalendar('renderEvent', copiedEventObject, true); + + // is the "remove after drop" checkbox checked? + + // if so, remove the element from the "Draggable Events" list + $(this).remove(); + + } + }); + this.external_events(); + }, + + // === Adds an event if name is provided === // + add_event: function(){ + if($('#event-name').val() != '') { + var event_name = $('#event-name').val(); + $('#external-events .panel-content').append('
    '+event_name+'
    '); + this.external_events(); + $('#modal-add-event').modal('hide'); + $('#event-name').val(''); + } else { + this.show_error(); + } + }, + + // === Initialize the draggable external events === // + external_events: function(){ + /* initialize the external events + -----------------------------------------------------------------*/ + $('#external-events div.external-event').each(function() { + // create an Event Object (http://arshaw.com/fullcalendar/docs/event_data/Event_Object/) + // it doesn't need to have a start or end + var eventObject = { + title: $.trim($(this).text()) // use the element's text as the event title + }; + + // store the Event Object in the DOM element so we can get to it later + $(this).data('eventObject', eventObject); + + // make the event draggable using jQuery UI + $(this).draggable({ + zIndex: 999, + revert: true, // will cause the event to go back to its + revertDuration: 0 // original position after the drag + }); + }); + }, + + // === Show error if no event name is provided === // + show_error: function(){ + $('#modal-error').remove(); + $('').appendTo('#modal-add-event .modal-body'); + $('#modal-error').delay('1500').fadeOut(700,function() { + $(this).remove(); + }); + } + + +}; diff --git a/src/main/webapp/resources/js/matrix.charts.js b/src/main/webapp/resources/js/matrix.charts.js new file mode 100644 index 0000000000000000000000000000000000000000..434dae6e3646b3e0083547cdd806f070d6f32d72 --- /dev/null +++ b/src/main/webapp/resources/js/matrix.charts.js @@ -0,0 +1,118 @@ + +$(document).ready(function(){ + + + // === Prepare the chart data ===/ + var sin = [], cos = []; + for (var i = 0; i < 14; i += 0.5) { + sin.push([i, Math.sin(i)]); + cos.push([i, Math.cos(i)]); + } + // === Prepare the chart data ===/ + var sin = [], cos = []; + for (var i = 0; i < 14; i += 0.5) { + sin.push([i, Math.sin(i)]); + cos.push([i, Math.cos(i)]); + } + + // === Make chart === // + var plot = $.plot($(".chart"), + [ { data: sin, label: "sin(x)", color: "#ee7951"}, { data: cos, label: "cos(x)",color: "#4fb9f0" } ], { + series: { + lines: { show: true }, + points: { show: true } + }, + grid: { hoverable: true, clickable: true }, + yaxis: { min: -1.6, max: 1.6 } + }); + + // === Point hover in chart === // + var previousPoint = null; + $(".chart").bind("plothover", function (event, pos, item) { + + if (item) { + if (previousPoint != item.dataIndex) { + previousPoint = item.dataIndex; + + $('#tooltip').fadeOut(200,function(){ + $(this).remove(); + }); + var x = item.datapoint[0].toFixed(2), + y = item.datapoint[1].toFixed(2); + + maruti.flot_tooltip(item.pageX, item.pageY,item.series.label + " of " + x + " = " + y); + } + + } else { + $('#tooltip').fadeOut(200,function(){ + $(this).remove(); + }); + previousPoint = null; + } + }); + + + + + var data = []; + var series = Math.floor(Math.random()*10)+1; + for( var i = 0; i'+label+'
    '+Math.round(series.percent)+'%
    '; + }, + background: { + opacity: 0.5, + color: '#000' + } + }, + innerRadius: 0.2 + }, + legend: { + show: false + } + } + }); + var d1 = []; + for (var i = 0; i <= 10; i += 1) d1.push([i, parseInt(Math.random() * 30)]); + + var data = new Array(); + data.push({ + data:d1, + bars: { + show: true, + barWidth: 0.4, + order: 1, + } + }); + + + //Display graph + var bar = $.plot($(".bars"), data, { + legend: true + }); + +}); + + +maruti = { + // === Tooltip for flot charts === // + flot_tooltip: function(x, y, contents) { + + $('
    ' + contents + '
    ').css( { + top: y + 5, + left: x + 5 + }).appendTo("body").fadeIn(200); + } +} diff --git a/src/main/webapp/resources/js/matrix.chat.js b/src/main/webapp/resources/js/matrix.chat.js new file mode 100644 index 0000000000000000000000000000000000000000..0f2977439e91f424f36284a0dd0276c049fb566e --- /dev/null +++ b/src/main/webapp/resources/js/matrix.chat.js @@ -0,0 +1,66 @@ + +$(document).ready(function(){ + + var msg_template = '

    '; + + $('.chat-message button').click(function(){ + var input = $(this).siblings('span').children('input[type=text]'); + if(input.val() != ''){ + add_message('You','img/demo/av1.jpg',input.val(),true); + } + }); + + $('.chat-message input').keypress(function(e){ + if(e.which == 13) { + if($(this).val() != ''){ + add_message('You','img/demo/av1.jpg',$(this).val(),true); + } + } + }); + + setTimeout(function(){ + add_message('Linda','img/demo/av2.jpg','Hello Every one do u want to freindship with me?') + },'1000'); + setTimeout(function(){ + add_message('Mark','img/demo/av3.jpg','Yuppi! why not sirji!!.') + },'4000'); + setTimeout(function(){ + add_message('Linda','img/demo/av2.jpg','Thanks!!! See you soon than') + },'8000'); + setTimeout(function(){ + add_message('Mark','img/demo/av3.jpg','ok Bye than!!!.') + },'12000'); + setTimeout(function(){ + remove_user('Linda','Linda') + },'16000'); + var i = 0; + function add_message(name,img,msg,clear) { + i = i + 1; + var inner = $('#chat-messages-inner'); + var time = new Date(); + var hours = time.getHours(); + var minutes = time.getMinutes(); + if(hours < 10) hours = '0' + hours; + if(minutes < 10) minutes = '0' + minutes; + var id = 'msg-'+i; + var idname = name.replace(' ','-').toLowerCase(); + inner.append('

    ' + +''+name+' - '+hours+':'+minutes+'' + +''+msg+'

    '); + $('#'+id).hide().fadeIn(800); + if(clear) { + $('.chat-message input').val('').focus(); + } + $('#chat-messages').animate({ scrollTop: inner.height() },1000); + } + function remove_user(userid,name) { + i = i + 1; + $('.contact-list li#user-'+userid).addClass('offline').delay(1000).slideUp(800,function(){ + $(this).remove(); + }); + var inner = $('#chat-messages-inner'); + var id = 'msg-'+i; + inner.append('

    User '+name+' left the chat

    '); + $('#'+id).hide().fadeIn(800); + } +}); diff --git a/src/main/webapp/resources/js/matrix.dashboard.js b/src/main/webapp/resources/js/matrix.dashboard.js new file mode 100644 index 0000000000000000000000000000000000000000..59d71cc07ce4df3a50425b81a8b6591fc3fdef11 --- /dev/null +++ b/src/main/webapp/resources/js/matrix.dashboard.js @@ -0,0 +1,164 @@ + +$(document).ready(function(){ + + + + // === Prepare peity charts === // + maruti.peity(); + + // === Prepare the chart data ===/ + var sin = [], cos = []; + for (var i = 0; i < 14; i += 0.5) { + sin.push([i, Math.sin(i)]); + cos.push([i, Math.cos(i)]); + } + + // === Make chart === // + var plot = $.plot($(".chart"), + [ { data: sin, label: "sin(x)", color: "#ee7951"}, { data: cos, label: "cos(x)",color: "#4fb9f0" } ], { + series: { + lines: { show: true }, + points: { show: true } + }, + grid: { hoverable: true, clickable: true }, + yaxis: { min: -1.6, max: 1.6 } + }); + + // === Point hover in chart === // + var previousPoint = null; + $(".chart").bind("plothover", function (event, pos, item) { + + if (item) { + if (previousPoint != item.dataIndex) { + previousPoint = item.dataIndex; + + $('#tooltip').fadeOut(200,function(){ + $(this).remove(); + }); + var x = item.datapoint[0].toFixed(2), + y = item.datapoint[1].toFixed(2); + + maruti.flot_tooltip(item.pageX, item.pageY,item.series.label + " of " + x + " = " + y); + } + + } else { + $('#tooltip').fadeOut(200,function(){ + $(this).remove(); + }); + previousPoint = null; + } + }); + + + + + // === Calendar === // + var date = new Date(); + var d = date.getDate(); + var m = date.getMonth(); + var y = date.getFullYear(); + + $('.calendar').fullCalendar({ + header: { + left: 'prev,next', + center: 'title', + right: 'month,basicWeek,basicDay' + }, + editable: true, + events: [ + { + title: 'All day event', + start: new Date(y, m, 1) + }, + { + title: 'Long event', + start: new Date(y, m, 5), + end: new Date(y, m, 8) + }, + { + id: 999, + title: 'Repeating event', + start: new Date(y, m, 2, 16, 0), + end: new Date(y, m, 3, 18, 0), + allDay: false + }, + { + id: 999, + title: 'Repeating event', + start: new Date(y, m, 9, 16, 0), + end: new Date(y, m, 10, 18, 0), + allDay: false + }, + { + title: 'Lunch', + start: new Date(y, m, 14, 12, 0), + end: new Date(y, m, 15, 14, 0), + allDay: false + }, + { + title: 'Birthday PARTY', + start: new Date(y, m, 18), + end: new Date(y, m, 20), + allDay: false + }, + { + title: 'Click for Google', + start: new Date(y, m, 27), + end: new Date(y, m, 29), + url: 'http://www.google.com' + } + ] + }); +}); + + +maruti = { + // === Peity charts === // + peity: function(){ + $.fn.peity.defaults.line = { + strokeWidth: 1, + delimeter: ",", + height: 24, + max: null, + min: 0, + width: 50 + }; + $.fn.peity.defaults.bar = { + delimeter: ",", + height: 24, + max: null, + min: 0, + width: 50 + }; + $(".peity_line_good span").peity("line", { + colour: "#57a532", + strokeColour: "#459D1C" + }); + $(".peity_line_bad span").peity("line", { + colour: "#FFC4C7", + strokeColour: "#BA1E20" + }); + $(".peity_line_neutral span").peity("line", { + colour: "#CCCCCC", + strokeColour: "#757575" + }); + $(".peity_bar_good span").peity("bar", { + colour: "#459D1C" + }); + $(".peity_bar_bad span").peity("bar", { + colour: "#BA1E20" + }); + $(".peity_bar_neutral span").peity("bar", { + colour: "#4fb9f0" + }); + }, + + // === Tooltip for flot charts === // + flot_tooltip: function(x, y, contents) { + + $('
    ' + contents + '
    ').css( { + top: y + 5, + left: x + 5 + }).appendTo("body").fadeIn(200); + } +} diff --git a/src/main/webapp/resources/js/matrix.form_common.js b/src/main/webapp/resources/js/matrix.form_common.js new file mode 100644 index 0000000000000000000000000000000000000000..e4191d0641f3cfb94f8fc97a15bf7981320d4e65 --- /dev/null +++ b/src/main/webapp/resources/js/matrix.form_common.js @@ -0,0 +1,207 @@ + +$(document).ready(function(){ + + $('input[type=checkbox],input[type=radio],input[type=file]').uniform(); + + $('select').select2(); + $('.colorpicker').colorpicker(); + $('.datepicker').datepicker(); +}); + +$(document).ready(function() { + + //------------- Tags plugin -------------// + + $("#tags").select2({ + tags:["red", "green", "blue", "orange"] + }); + + //------------- Elastic textarea -------------// + if ($('textarea').hasClass('elastic')) { + $('.elastic').elastic(); + } + + //------------- Input limiter -------------// + if ($('textarea').hasClass('limit')) { + $('.limit').inputlimiter({ + limit: 100 + }); + } + + //------------- Masked input fields -------------// + $("#mask-phone").mask("(999) 999-9999", {completed:function(){alert("Callback action after complete");}}); + $("#mask-phoneExt").mask("(999) 999-9999? x99999"); + $("#mask-phoneInt").mask("+40 999 999 999"); + $("#mask-date").mask("99/99/9999"); + $("#mask-ssn").mask("999-99-9999"); + $("#mask-productKey").mask("a*-999-a999", { placeholder: "*" }); + $("#mask-eyeScript").mask("~9.99 ~9.99 999"); + $("#mask-percent").mask("99%"); + + //------------- Toggle button -------------// + + $('.normal-toggle-button').toggleButtons(); + $('.text-toggle-button').toggleButtons({ + width: 140, + label: { + enabled: "ONLINE", + disabled: "OFFLINE" + } + }); + $('.iToggle-button').toggleButtons({ + width: 70, + label: { + enabled: "", + disabled: "" + } + }); + + //------------- Spinners with steps -------------// + $( "#spinner1" ).spinner(); + + /*Demacial*/ + $( "#spinner2" ).spinner({ + step: 0.01, + numberFormat: "n" + }); + + /*Custom step size*/ + $( "#spinner3" ).spinner({ + step: 5 + }); + + /*Currency spinner*/ + $( "#spinner4" ).spinner({ + numberFormat: "C" + }); + + //------------- Colorpicker -------------// + if($('div').hasClass('picker')){ + $('.picker').farbtastic('#color'); + } + //------------- Datepicker -------------// + if($('#datepicker').length) { + $("#datepicker").datepicker({ + showOtherMonths:true + }); + } + if($('#datepicker-inline').length) { + $('#datepicker-inline').datepicker({ + inline: true, + showOtherMonths:true + }); + } + + //------------- Combined picker -------------// + if($('#combined-picker').length) { + $('#combined-picker').datetimepicker(); + } + + //------------- Time entry (picker) -------------// + $('#timepicker').timeEntry({ + show24Hours: true, + spinnerImage: '' + }); + $('#timepicker').timeEntry('setTime', '22:15') + + //------------- Select plugin -------------// + $("#select1").select2(); + $("#select2").select2(); + + //--------------- Dual multi select ------------------// + $.configureBoxes(); + + //--------------- Tinymce ------------------// + $('textarea.tinymce').tinymce({ + // Location of TinyMCE script + script_url : 'plugins/forms/tiny_mce/tiny_mce.js', + + // General options + theme : "advanced", + plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,advlist", + + // Theme options + theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect", + theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", + theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", + theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak", + theme_advanced_toolbar_location : "top", + theme_advanced_toolbar_align : "left", + theme_advanced_statusbar_location : "bottom", + theme_advanced_resizing : true, + + // Example content CSS (should be your site CSS) + content_css : "css/main.css", + + // Drop lists for link/image/media/template dialogs + template_external_list_url : "lists/template_list.js", + external_link_list_url : "lists/link_list.js", + external_image_list_url : "lists/image_list.js", + media_external_list_url : "lists/media_list.js", + + // Replace values for the template plugin + template_replace_values : { + username : "SuprUser", + staffid : "991234" + } + }); + + //Boostrap modal + $('#myModal').modal({ show: false}); + + //add event to modal after closed + $('#myModal').on('hidden', function () { + console.log('modal is closed'); + }) + +});//End document ready functions + +//sparkline in sidebar area +var positive = [1,5,3,7,8,6,10]; +var negative = [10,6,8,7,3,5,1] +var negative1 = [7,6,8,7,6,5,4] + +$('#stat1').sparkline(positive,{ + height:15, + spotRadius: 0, + barColor: '#9FC569', + type: 'bar' +}); +$('#stat2').sparkline(negative,{ + height:15, + spotRadius: 0, + barColor: '#ED7A53', + type: 'bar' +}); +$('#stat3').sparkline(negative1,{ + height:15, + spotRadius: 0, + barColor: '#ED7A53', + type: 'bar' +}); +$('#stat4').sparkline(positive,{ + height:15, + spotRadius: 0, + barColor: '#9FC569', + type: 'bar' +}); +//sparkline in widget +$('#stat5').sparkline(positive,{ + height:15, + spotRadius: 0, + barColor: '#9FC569', + type: 'bar' +}); + +$('#stat6').sparkline(positive, { + width: 70,//Width of the chart - Defaults to 'auto' - May be any valid css width - 1.5em, 20px, etc (using a number without a unit specifier won't do what you want) - This option does nothing for bar and tristate chars (see barWidth) + height: 20,//Height of the chart - Defaults to 'auto' (line height of the containing tag) + lineColor: '#88bbc8',//Used by line and discrete charts to specify the colour of the line drawn as a CSS values string + fillColor: '#f2f7f9',//Specify the colour used to fill the area under the graph as a CSS value. Set to false to disable fill + spotColor: '#e72828',//The CSS colour of the final value marker. Set to false or an empty string to hide it + maxSpotColor: '#005e20',//The CSS colour of the marker displayed for the maximum value. Set to false or an empty string to hide it + minSpotColor: '#f7941d',//The CSS colour of the marker displayed for the mimum value. Set to false or an empty string to hide it + spotRadius: 3,//Radius of all spot markers, In pixels (default: 1.5) - Integer + lineWidth: 2//In pixels (default: 1) - Integer +}); + diff --git a/src/main/webapp/resources/js/matrix.form_validation.js b/src/main/webapp/resources/js/matrix.form_validation.js new file mode 100644 index 0000000000000000000000000000000000000000..3f3bf130cb41ee310e4da54988ae3706efd6bb5a --- /dev/null +++ b/src/main/webapp/resources/js/matrix.form_validation.js @@ -0,0 +1,88 @@ + +$(document).ready(function(){ + + $('input[type=checkbox],input[type=radio],input[type=file]').uniform(); + + $('select').select2(); + + // Form Validation + $("#basic_validate").validate({ + rules:{ + required:{ + required:true + }, + email:{ + required:true, + email: true + }, + date:{ + required:true, + date: true + }, + url:{ + required:true, + url: true + } + }, + errorClass: "help-inline", + errorElement: "span", + highlight:function(element, errorClass, validClass) { + $(element).parents('.control-group').addClass('error'); + }, + unhighlight: function(element, errorClass, validClass) { + $(element).parents('.control-group').removeClass('error'); + $(element).parents('.control-group').addClass('success'); + } + }); + + $("#number_validate").validate({ + rules:{ + min:{ + required: true, + min:10 + }, + max:{ + required:true, + max:24 + }, + number:{ + required:true, + number:true + } + }, + errorClass: "help-inline", + errorElement: "span", + highlight:function(element, errorClass, validClass) { + $(element).parents('.control-group').addClass('error'); + }, + unhighlight: function(element, errorClass, validClass) { + $(element).parents('.control-group').removeClass('error'); + $(element).parents('.control-group').addClass('success'); + } + }); + + $("#password_validate").validate({ + rules:{ + pwd:{ + required: true, + minlength:6, + maxlength:20 + }, + pwd2:{ + required:true, + minlength:6, + maxlength:20, + equalTo:"#pwd" + } + }, + errorClass: "help-inline", + errorElement: "span", + highlight:function(element, errorClass, validClass) { + $(element).parents('.control-group').addClass('error'); + }, + unhighlight: function(element, errorClass, validClass) { + $(element).parents('.control-group').removeClass('error'); + $(element).parents('.control-group').addClass('success'); + } + }); +}); diff --git a/src/main/webapp/resources/js/matrix.interface.js b/src/main/webapp/resources/js/matrix.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/webapp/resources/js/matrix.js b/src/main/webapp/resources/js/matrix.js new file mode 100644 index 0000000000000000000000000000000000000000..9319c5b57750e166ac16e256b6ee27bf8b253473 --- /dev/null +++ b/src/main/webapp/resources/js/matrix.js @@ -0,0 +1,190 @@ + +$(document).ready(function(){ + + + + // === Sidebar navigation === // + + $('.submenu > a').click(function(e) + { + e.preventDefault(); + var submenu = $(this).siblings('ul'); + var li = $(this).parents('li'); + var submenus = $('#sidebar li.submenu ul'); + var submenus_parents = $('#sidebar li.submenu'); + if(li.hasClass('open')) + { + if(($(window).width() > 768) || ($(window).width() < 479)) { + submenu.slideUp(); + } else { + submenu.fadeOut(250); + } + li.removeClass('open'); + } else + { + if(($(window).width() > 768) || ($(window).width() < 479)) { + submenus.slideUp(); + submenu.slideDown(); + } else { + submenus.fadeOut(250); + submenu.fadeIn(250); + } + submenus_parents.removeClass('open'); + li.addClass('open'); + } + }); + + var ul = $('#sidebar > ul'); + + $('#sidebar > a').click(function(e) + { + e.preventDefault(); + var sidebar = $('#sidebar'); + if(sidebar.hasClass('open')) + { + sidebar.removeClass('open'); + ul.slideUp(250); + } else + { + sidebar.addClass('open'); + ul.slideDown(250); + } + }); + + // === Resize window related === // + $(window).resize(function() + { + if($(window).width() > 479) + { + ul.css({'display':'block'}); + $('#content-header .btn-group').css({width:'auto'}); + } + if($(window).width() < 479) + { + ul.css({'display':'none'}); + fix_position(); + } + if($(window).width() > 768) + { + $('#user-nav > ul').css({width:'auto',margin:'0'}); + $('#content-header .btn-group').css({width:'auto'}); + } + }); + + if($(window).width() < 468) + { + ul.css({'display':'none'}); + fix_position(); + } + + if($(window).width() > 479) + { + $('#content-header .btn-group').css({width:'auto'}); + ul.css({'display':'block'}); + } + + // === Tooltips === // + $('.tip').tooltip(); + $('.tip-left').tooltip({ placement: 'left' }); + $('.tip-right').tooltip({ placement: 'right' }); + $('.tip-top').tooltip({ placement: 'top' }); + $('.tip-bottom').tooltip({ placement: 'bottom' }); + + // === Search input typeahead === // + $('#search input[type=text]').typeahead({ + source: ['Dashboard','Form elements','Common Elements','Validation','Wizard','Buttons','Icons','Interface elements','Support','Calendar','Gallery','Reports','Charts','Graphs','Widgets'], + items: 4 + }); + + // === Fixes the position of buttons group in content header and top user navigation === // + function fix_position() + { + var uwidth = $('#user-nav > ul').width(); + $('#user-nav > ul').css({width:uwidth,'margin-left':'-' + uwidth / 2 + 'px'}); + + var cwidth = $('#content-header .btn-group').width(); + $('#content-header .btn-group').css({width:cwidth,'margin-left':'-' + uwidth / 2 + 'px'}); + } + + // === Style switcher === // + $('#style-switcher i').click(function() + { + if($(this).hasClass('open')) + { + $(this).parent().animate({marginRight:'-=190'}); + $(this).removeClass('open'); + } else + { + $(this).parent().animate({marginRight:'+=190'}); + $(this).addClass('open'); + } + $(this).toggleClass('icon-arrow-left'); + $(this).toggleClass('icon-arrow-right'); + }); + + $('#style-switcher a').click(function() + { + var style = $(this).attr('href').replace('#',''); + $('.skin-color').attr('href','css/maruti.'+style+'.css'); + $(this).siblings('a').css({'border-color':'transparent'}); + $(this).css({'border-color':'#aaaaaa'}); + }); + + $('.lightbox_trigger').click(function(e) { + + e.preventDefault(); + + var image_href = $(this).attr("href"); + + if ($('#lightbox').length > 0) { + + $('#imgbox').html('

    '); + + $('#lightbox').slideDown(500); + } + + else { + var lightbox = + ''; + + $('body').append(lightbox); + $('#lightbox').slideDown(500); + } + + }); + + + $('#lightbox').live('click', function() { + $('#lightbox').hide(200); + }); + +}); + +var ip = '.'; + +$('#logout').click(function() { + $.post(ip + '/logout', {}, function(data) { + window.location.href = 'index.html'; + }).error(function() { + cp('请求失败'); + }); +}); + +function cp(text, title) { + title = title || '提示 Tips'; + $.gritter.add({ + title: title, + text: text, + sticky: false + }); +} + +var gUsrType = JSON.parse(localStorage.getItem('uinfo')).userSysType; +var gUsrName = JSON.parse(localStorage.getItem('uinfo')).userName; +var guserId = JSON.parse(localStorage.getItem('uinfo')).userId; + +$('#topBarName').text(gUsrName + ' - ' + guserId); diff --git a/src/main/webapp/resources/js/matrix.login.js b/src/main/webapp/resources/js/matrix.login.js new file mode 100644 index 0000000000000000000000000000000000000000..d838cdfa6e8500bc0b1e63a967f873dbfa90a43e --- /dev/null +++ b/src/main/webapp/resources/js/matrix.login.js @@ -0,0 +1,47 @@ + +$(document).ready(function(){ + + var login = $('#loginform'); + var recover = $('#recoverform'); + var speed = 400; + + $('#to-recover').click(function(){ + + $("#loginform").slideUp(); + $("#recoverform").fadeIn(); + }); + $('#to-login').click(function(){ + + $("#recoverform").hide(); + $("#loginform").fadeIn(); + }); + + + $('#to-login').click(function(){ + + }); + + if($.browser.msie == true && $.browser.version.slice(0,3) < 10) { + $('input[placeholder]').each(function(){ + + var input = $(this); + + $(input).val(input.attr('placeholder')); + + $(input).focus(function(){ + if (input.val() == input.attr('placeholder')) { + input.val(''); + } + }); + + $(input).blur(function(){ + if (input.val() == '' || input.val() == input.attr('placeholder')) { + input.val(input.attr('placeholder')); + } + }); + }); + + + + } +}); diff --git a/src/main/webapp/resources/js/matrix.popover.js b/src/main/webapp/resources/js/matrix.popover.js new file mode 100644 index 0000000000000000000000000000000000000000..d2e0a625245cf11d8650b4e2261195959949325e --- /dev/null +++ b/src/main/webapp/resources/js/matrix.popover.js @@ -0,0 +1,60 @@ + +$(function () +{ $("#example, #example2, #example3, #example4").popover(); +}); + + +!function( $ ) { +"use strict" +var Popover = function ( element, options ) { +this.init('popover', element, options) +} +/* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js +========================================== */ +Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, { +constructor: Popover +, setContent: function () { +var $tip = this.tip() +, title = this.getTitle() +, content = this.getContent() +$tip.find('.popover-title')[ $.type(title) == 'object' ? 'append' : 'html' ](title) +$tip.find('.popover-content > *')[ $.type(content) == 'object' ? 'append' : 'html' ](content) +$tip.removeClass('fade top bottom left right in') +} +, hasContent: function () { +return this.getTitle() || this.getContent() +} +, getContent: function () { +var content +, $e = this.$element +, o = this.options +content = $e.attr('data-content') +|| (typeof o.content == 'function' ? o.content.call($e[0]) : o.content) +content = content.toString().replace(/(^\s*|\s*$)/, "") +return content +} +, tip: function() { +if (!this.$tip) { +this.$tip = $(this.options.template) +} +return this.$tip +} +}) +/* POPOVER PLUGIN DEFINITION +* ======================= */ +$.fn.popover = function ( option ) { +return this.each(function () { +var $this = $(this) +, data = $this.data('popover') +, options = typeof option == 'object' && option +if (!data) $this.data('popover', (data = new Popover(this, options))) +if (typeof option == 'string') data[option]() +}) +} +$.fn.popover.Constructor = Popover +$.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, { +placement: 'right' +, content: '' +, template: '

    ' +}) +}( window.jQuery ); diff --git a/src/main/webapp/resources/js/matrix.tables.js b/src/main/webapp/resources/js/matrix.tables.js new file mode 100644 index 0000000000000000000000000000000000000000..4ab29c837baadb4b0cf3dc7dfc77dd24cec42466 --- /dev/null +++ b/src/main/webapp/resources/js/matrix.tables.js @@ -0,0 +1,27 @@ + +$(document).ready(function(){ + + // $('.data-table').dataTable({ + // "bJQueryUI": true, + // "sPaginationType": "full_numbers", + // "sDom": '<""l>t<"F"fp>' + // }); + + $('input[type=checkbox],input[type=radio],input[type=file]').uniform(); + + // $('select').select2(); + + $("span.icon input:checkbox, th input:checkbox").click(function() { + var checkedStatus = this.checked; + var checkbox = $(this).parents('.widget-box').find('tr td:first-child input:checkbox'); + checkbox.each(function() { + this.checked = checkedStatus; + if (checkedStatus == this.checked) { + $(this).closest('.checker > span').removeClass('checked'); + } + if (this.checked) { + $(this).closest('.checker > span').addClass('checked'); + } + }); + }); +}); diff --git a/src/main/webapp/resources/js/matrix.wizard.js b/src/main/webapp/resources/js/matrix.wizard.js new file mode 100644 index 0000000000000000000000000000000000000000..cf160805a9f6760410e4a5c13be496223f974cc5 --- /dev/null +++ b/src/main/webapp/resources/js/matrix.wizard.js @@ -0,0 +1,43 @@ + +$(document).ready(function(){ + + $("#form-wizard").formwizard({ + formPluginEnabled: true, + validationEnabled: true, + focusFirstInput : true, + disableUIStyles : true, + + formOptions :{ + success: function(data){$("#status").fadeTo(500,1,function(){ $(this).html("Form was submitted!").fadeTo(5000, 0); })}, + beforeSubmit: function(data){$("#submitted").html("Form was submitted with ajax. Data sent to the server: " + $.param(data) + "");}, + dataType: 'json', + resetForm: true + }, + validationOptions : { + rules: { + username: "required", + password: "required", + password2: { + equalTo: "#password" + }, + email: { required: true, email: true }, + eula: "required" + }, + messages: { + username: "Please enter your name or username", + password: "You must enter the password", + password2: { equalTo: "Password don't match" }, + email: { required: "Please, enter your email", email: "Correct email format is name@domain.com" }, + eula: "You must accept the eula" + }, + errorClass: "help-inline", + errorElement: "span", + highlight:function(element, errorClass, validClass) { + $(element).parents('.control-group').addClass('error'); + }, + unhighlight: function(element, errorClass, validClass) { + $(element).parents('.control-group').removeClass('error'); + } + } + }); +}); diff --git a/src/main/webapp/resources/js/select2.min.js b/src/main/webapp/resources/js/select2.min.js new file mode 100644 index 0000000000000000000000000000000000000000..15237356589874a9762d08a80900d1d4b62f9945 --- /dev/null +++ b/src/main/webapp/resources/js/select2.min.js @@ -0,0 +1,82 @@ +/* +Copyright 2012 Igor Vaynberg + +Version: 3.2 Timestamp: Mon Sep 10 10:38:04 PDT 2012 + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in +compliance with the License. You may obtain a copy of the License in the LICENSE file, or at: + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is +distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and limitations under the License. +*/ +(function(e){"undefined"==typeof e.fn.each2&&e.fn.extend({each2:function(g){for(var i=e([0]),m=-1,s=this.length;++ma.length)return[]; +c=a.split(b);d=0;for(j=c.length;dd?c.push(a):(c.push(a.substring(0,d)),c.push(""),c.push(a.substring(d,d+b)),c.push(""),c.push(a.substring(d+b,a.length)))}function C(a){var b, +c=0,d=null,j=a.quietMillis||100;return function(h){window.clearTimeout(b);b=window.setTimeout(function(){var b=c+=1,j=a.data,n=a.transport||e.ajax,f=a.traditional||!1,g=a.type||"GET",j=j.call(this,h.term,h.page,h.context);null!==d&&d.abort();d=n.call(null,{url:a.url,dataType:a.dataType,data:j,type:g,traditional:f,success:function(d){bd.tokenSeparators.length)return g;for(;;){h=-1;k=0; +for(n=d.tokenSeparators.length;kh)break;f=a.substring(0,h);a=a.substring(h+o.length);if(0=a}};var I=1;G=function(){return I++}; +e(document).delegate("body","mousemove",function(a){e.data(document,"select2-lastpos",{x:a.pageX,y:a.pageY})});e(document).ready(function(){e(document).delegate("body","mousedown touchend",function(a){var b=e(a.target).closest("div.select2-container").get(0),c;b?e(document).find("div.select2-container-active").each(function(){this!==b&&e(this).data("select2").blur()}):(b=e(a.target).closest("div.select2-drop").get(0),e(document).find("div.select2-drop-active").each(function(){this!==b&&e(this).data("select2").blur()})); +b=e(a.target);c=b.attr("for");"LABEL"===a.target.tagName&&(c&&0\|])/g,"\\$1");this.container.attr("id",this.containerId);var d=!1,j;this.body=function(){!1===d&&(j=a.element.closest("body"),d=!0);return j};a.element.attr("class")!==g&&this.container.addClass(a.element.attr("class").replace(/validate\[[\S ]+] ?/,""));this.container.css(v(a.containerCss));this.container.addClass(v(a.containerCssClass));this.opts.element.data("select2",this).hide().before(this.container);this.container.data("select2", +this);this.dropdown=this.container.find(".select2-drop");this.dropdown.addClass(v(a.dropdownCssClass));this.dropdown.data("select2",this);this.results=b=this.container.find(".select2-results");this.search=c=this.container.find("input.select2-input");c.attr("tabIndex",this.opts.element.attr("tabIndex"));this.resultsPage=0;this.context=null;this.initContainer();this.initContainerWidth();this.results.bind("mousemove",function(a){var b=e.data(document,"select2-lastpos");(b===g||b.x!==a.pageX||b.y!==a.pageY)&& +e(a.target).trigger("mousemove-filtered",a)});this.dropdown.delegate(".select2-results","mousemove-filtered",this.bind(this.highlightUnderEvent));var h=this.results,f=A(80,function(a){h.trigger("scroll-debounced",a)});h.bind("scroll",function(a){0<=i(a.target,h.get())&&f(a)});this.dropdown.delegate(".select2-results","scroll-debounced",this.bind(this.loadMoreIfNeeded));e.fn.mousewheel&&b.mousewheel(function(a,c,d,e){c=b.scrollTop();0=c-e?(b.scrollTop(0),l(a)):0>e&&b.get(0).scrollHeight-b.scrollTop()+ +e<=b.height()&&(b.scrollTop(b.get(0).scrollHeight-b.height()),l(a))});c.bind("keydown",function(){e.data(c,"keyup-change-value")===g&&e.data(c,"keyup-change-value",c.val())});c.bind("keyup",function(){var a=e.data(c,"keyup-change-value");a!==g&&c.val()!==a&&(e.removeData(c,"keyup-change-value"),c.trigger("keyup-change"))});c.bind("keyup-change",this.bind(this.updateResults));c.bind("focus",function(){c.addClass("select2-focused");" "===c.val()&&c.val("")});c.bind("blur",function(){c.removeClass("select2-focused")}); +this.dropdown.delegate(".select2-results","mouseup",this.bind(function(a){0 element.");});a=e.extend({},{populateResults:function(b, +c,d){var f,n=this.opts.id,o=this;f=function(b,c,j){var h,l,i,m,r,p,q;h=0;for(l=b.length;h0;p=e("
  • ");p.addClass("select2-results-dept-"+j);p.addClass("select2-result");p.addClass(m?"select2-result-selectable":"select2-result-unselectable");r&&p.addClass("select2-result-with-children");p.addClass(o.opts.formatResultCssClass(i));m=e("
    ");m.addClass("select2-result-label");q=a.formatResult(i,m,d);q!==g&&m.html(o.opts.escapeMarkup(q)); +p.append(m);if(r){r=e("
      ");r.addClass("select2-result-sub");f(i.children,r,j+1);p.append(r)}p.data("select2-data",i);c.append(p)}};f(c,b,0)}},e.fn.select2.defaults,a);"function"!==typeof a.id&&(d=a.id,a.id=function(a){return a[d]});if(c)a.query=this.bind(function(a){var c={results:[],more:false},d=a.term,f,n,o;o=function(b,c){var e;if(b.is("option"))a.matcher(d,b.text(),b)&&c.push({id:b.attr("value"),text:b.text(),element:b.get(),css:b.attr("class")});else if(b.is("optgroup")){e={text:b.attr("label"), +children:[],element:b.get(),css:b.attr("class")};b.children().each2(function(a,b){o(b,e.children)});e.children.length>0&&c.push(e)}};f=b.children();if(this.getPlaceholder()!==g&&f.length>0){n=f[0];e(n).text()===""&&(f=f.not(n))}f.each2(function(a,b){o(b,c.results)});a.callback(c)}),a.id=function(a){return a.id},a.formatResultCssClass=function(a){return a.css};else if(!("query"in a))if("ajax"in a){if((c=a.element.data("ajax-url"))&&0=this.body().scrollTop(),k=this.dropdown.hasClass("select2-drop-above"),n;"static"!==this.body().css("position")&& +(n=this.body().offset(),b-=n.top,f-=n.left);k?(k=!0,!g&&j&&(k=!1)):(k=!1,!j&&g&&(k=!0));k?(b=a.top-d,this.container.addClass("select2-drop-above"),this.dropdown.addClass("select2-drop-above")):(this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above"));a=e.extend({top:b,left:f,width:c},v(this.opts.dropdownCss));this.dropdown.css(a)},shouldOpen:function(){var a;if(this.opened())return!1;a=e.Event("open");this.opts.element.trigger(a);return!a.isDefaultPrevented()}, +clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above");this.dropdown.removeClass("select2-drop-above")},open:function(){if(!this.shouldOpen())return!1;window.setTimeout(this.bind(this.opening),1);return!0},opening:function(){var a=this.containerId,b=this.containerSelector,c="scroll."+a,d="resize."+a;this.container.parents().each(function(){e(this).bind(c,function(){var a=e(b);0==a.length&&e(this).unbind(c);a.select2("close")})});e(window).bind(d,function(){var a= +e(b);0==a.length&&e(window).unbind(d);a.select2("close")});this.clearDropdownAlignmentPreference();" "===this.search.val()&&this.search.val("");this.container.addClass("select2-dropdown-open").addClass("select2-container-active");this.updateResults(!0);this.dropdown[0]!==this.body().children().last()[0]&&this.dropdown.detach().appendTo(this.body());this.dropdown.show();this.positionDropdown();this.dropdown.addClass("select2-drop-active");this.ensureHighlightVisible();this.focusSearch()},close:function(){if(this.opened()){var a= +this;this.container.parents().each(function(){e(this).unbind("scroll."+a.containerId)});e(window).unbind("resize."+this.containerId);this.clearDropdownAlignmentPreference();this.dropdown.hide();this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active");this.results.empty();this.clearSearch();this.opts.element.trigger(e.Event("close"))}},clearSearch:function(){},ensureHighlightVisible:function(){var a=this.results,b,c,d,f;c=this.highlight();0>c||(0==c?a.scrollTop(0): +(b=a.find(".select2-result-selectable"),d=e(b[c]),f=d.offset().top+d.outerHeight(),c===b.length-1&&(b=a.find("li.select2-more-results"),0b&&a.scrollTop(a.scrollTop()+(f-b)),d=d.offset().top-a.offset().top,0>d&&a.scrollTop(a.scrollTop()+d)))},moveHighlight:function(a){for(var b=this.results.find(".select2-result-selectable"),c=this.highlight();-1=b.length&&(a=b.length-1);0>a&&(a=0);b.removeClass("select2-highlighted");e(b[a]).addClass("select2-highlighted");this.ensureHighlightVisible()},countSelectableResults:function(){return this.results.find(".select2-result-selectable").not(".select2-disabled").length}, +highlightUnderEvent:function(a){a=e(a.target).closest(".select2-result-selectable");if(0=c&&(b.addClass("select2-active"),this.opts.query({term:f,page:d,context:g,matcher:this.opts.matcher,callback:this.bind(function(c){e.opened()&&(e.opts.populateResults.call(this,a,c.results,{term:f,page:d,context:g}),!0===c.more?(b.detach().appendTo(a).text(e.opts.formatLoadMore(d+1)),window.setTimeout(function(){e.loadMoreIfNeeded()},10)):b.remove(),e.positionDropdown(),e.resultsPage=d)})})))},tokenize:function(){},updateResults:function(a){function b(){f.scrollTop(0);d.removeClass("select2-active"); +k.positionDropdown()}function c(a){f.html(k.opts.escapeMarkup(a));b()}var d=this.search,f=this.results,h=this.opts,i,k=this;if(!(!0!==a&&(!1===this.showSearchInput||!this.opened()))){d.addClass("select2-active");if(1<=h.maximumSelectionSize&&(i=this.data(),e.isArray(i)&&i.length>=h.maximumSelectionSize&&u(h.formatSelectionTooBig,"formatSelectionTooBig"))){c("
    • "+h.formatSelectionTooBig(h.maximumSelectionSize)+"
    • ");return}d.val().length"+h.formatInputTooShort(d.val(),h.minimumInputLength)+""):(c("
    • "+h.formatSearching()+"
    • "),i=this.tokenize(),i!=g&&null!=i&&d.val(i),this.resultsPage=1,h.query({term:d.val(),page:this.resultsPage,context:null,matcher:h.matcher,callback:this.bind(function(i){var l;this.opened()&&((this.context=i.context===g?null:i.context,this.opts.createSearchChoice&&""!==d.val()&&(l=this.opts.createSearchChoice.call(null, +d.val(),i.results),l!==g&&null!==l&&k.id(l)!==g&&null!==k.id(l)&&0===e(i.results).filter(function(){return m(k.id(this),k.id(l))}).length&&i.results.unshift(l)),0===i.results.length&&u(h.formatNoMatches,"formatNoMatches"))?c("
    • "+h.formatNoMatches(d.val())+"
    • "):(f.empty(),k.opts.populateResults.call(this,f,i.results,{term:d.val(),page:this.resultsPage,context:null}),!0===i.more&&u(h.formatLoadMore,"formatLoadMore")&&(f.append("
    • "+k.opts.escapeMarkup(h.formatLoadMore(this.resultsPage))+ +"
    • "),window.setTimeout(function(){k.loadMoreIfNeeded()},10)),this.postprocessResults(i,a),b()))})}))}},cancel:function(){this.close()},blur:function(){this.close();this.container.removeClass("select2-container-active");this.dropdown.removeClass("select2-drop-active");this.search[0]===document.activeElement&&this.search.blur();this.clearSearch();this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){this.search.show();this.search.focus(); +window.setTimeout(this.bind(function(){this.search.show();this.search.focus();this.search.val(this.search.val())}),10)},selectHighlighted:function(){var a=this.highlight(),b=this.results.find(".select2-highlighted").not(".select2-disabled"),c=b.closest(".select2-result-selectable").data("select2-data");c&&(b.addClass("select2-disabled"),this.highlight(a),this.onSelect(c))},getPlaceholder:function(){return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")|| +this.opts.placeholder},initContainerWidth:function(){var a=function(){var a,c,d,f;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth()?"auto":this.opts.element.outerWidth()+"px";if("copy"===this.opts.width||"resolve"===this.opts.width){a=this.opts.element.attr("style");if(a!==g){a=a.split(";");d=0;for(f=a.length;d
      ",{"class":"select2-container"}).html("
      ")}, +opening:function(){this.search.show();this.parent.opening.apply(this,arguments);this.dropdown.removeClass("select2-offscreen")},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.dropdown.removeAttr("style").addClass("select2-offscreen").insertAfter(this.selection).show())},focus:function(){this.close();this.selection.focus()},isFocused:function(){return this.selection[0]===document.activeElement},cancel:function(){this.parent.cancel.apply(this,arguments);this.selection.focus()}, +initContainer:function(){var a,b=this.dropdown;this.selection=a=this.container.find(".select2-choice");this.search.bind("keydown",this.bind(function(a){if(this.enabled)if(a.which===f.PAGE_UP||a.which===f.PAGE_DOWN)l(a);else if(this.opened())switch(a.which){case f.UP:case f.DOWN:this.moveHighlight(a.which===f.UP?-1:1);l(a);break;case f.TAB:case f.ENTER:this.selectHighlighted();l(a);break;case f.ESC:this.cancel(a),l(a)}else a.which===f.TAB||f.isControl(a)||f.isFunctionKey(a)||a.which===f.ESC||!1=== +this.opts.openOnEnter&&a.which===f.ENTER||this.open()}));this.search.bind("focus",this.bind(function(){this.selection.attr("tabIndex","-1")}));this.search.bind("blur",this.bind(function(){this.opened()||this.container.removeClass("select2-container-active");window.setTimeout(this.bind(function(){this.selection.attr("tabIndex",this.opts.element.attr("tabIndex"))}),10)}));a.bind("mousedown",this.bind(function(){this.opened()?(this.close(),this.selection.focus()):this.enabled&&this.open()}));b.bind("mousedown", +this.bind(function(){this.search.focus()}));a.bind("focus",this.bind(function(){this.container.addClass("select2-container-active");this.search.attr("tabIndex","-1")}));a.bind("blur",this.bind(function(){this.opened()||this.container.removeClass("select2-container-active");window.setTimeout(this.bind(function(){this.search.attr("tabIndex",this.opts.element.attr("tabIndex"))}),10)}));a.bind("keydown",this.bind(function(a){if(this.enabled)if(a.which===f.PAGE_UP||a.which===f.PAGE_DOWN)l(a);else if(!(a.which=== +f.TAB||f.isControl(a)||f.isFunctionKey(a)||a.which===f.ESC)&&!(!1===this.opts.openOnEnter&&a.which===f.ENTER))if(a.which==f.DELETE)this.opts.allowClear&&this.clear();else{this.open();if(a.which!==f.ENTER&&!(48>a.which)){var b=String.fromCharCode(a.which).toLowerCase();a.shiftKey&&(b=b.toUpperCase());this.search.focus();this.search.val(b)}l(a)}}));a.delegate("abbr","mousedown",this.bind(function(a){this.enabled&&(this.clear(),l(a),this.close(),this.triggerChange(),this.selection.focus())}));this.setPlaceholder(); +this.search.bind("focus",this.bind(function(){this.container.addClass("select2-container-active")}))},clear:function(){this.opts.element.val("");this.selection.find("span").empty();this.selection.removeData("select2-data");this.setPlaceholder()},initSelection:function(){if(""===this.opts.element.val())this.close(),this.setPlaceholder();else{var a=this;this.opts.initSelection.call(null,this.opts.element,function(b){b!==g&&null!==b&&(a.updateSelection(b),a.close(),a.setPlaceholder())})}},prepareOpts:function(){var a= +this.parent.prepareOpts.apply(this,arguments);"select"===a.element.get(0).tagName.toLowerCase()&&(a.initSelection=function(a,c){var d=a.find(":selected");e.isFunction(c)&&c({id:d.attr("value"),text:d.text()})});return a},setPlaceholder:function(){var a=this.getPlaceholder();""===this.opts.element.val()&&a!==g&&!(this.select&&""!==this.select.find("option:first").text())&&(this.selection.find("span").html(this.opts.escapeMarkup(a)),this.selection.addClass("select2-default"),this.selection.find("abbr").hide())}, +postprocessResults:function(a,b){var c=0,d=this,f=!0;this.results.find(".select2-result-selectable").each2(function(a,b){if(m(d.id(b.data("select2-data")),d.opts.element.val()))return c=a,!1});this.highlight(c);!0===b&&(f=this.showSearchInput=F(a.results)>=this.opts.minimumResultsForSearch,this.dropdown.find(".select2-search")[f?"removeClass":"addClass"]("select2-search-hidden"),e(this.dropdown,this.container)[f?"addClass":"removeClass"]("select2-with-searchbox"))},onSelect:function(a){var b=this.opts.element.val(); +this.opts.element.val(this.id(a));this.updateSelection(a);this.close();this.selection.focus();m(b,this.id(a))||this.triggerChange()},updateSelection:function(a){var b=this.selection.find("span");this.selection.data("select2-data",a);b.empty();a=this.opts.formatSelection(a,b);a!==g&&b.append(this.opts.escapeMarkup(a));this.selection.removeClass("select2-default");this.opts.allowClear&&this.getPlaceholder()!==g&&this.selection.find("abbr").show()},val:function(){var a,b=null,c=this;if(0===arguments.length)return this.opts.element.val(); +a=arguments[0];if(this.select)this.select.val(a).find(":selected").each2(function(a,c){b={id:c.attr("value"),text:c.text()};return!1}),this.updateSelection(b),this.setPlaceholder();else{if(this.opts.initSelection===g)throw Error("cannot call val() if initSelection() is not defined");a?(this.opts.element.val(a),this.opts.initSelection(this.opts.element,function(a){c.opts.element.val(!a?"":c.id(a));c.updateSelection(a);c.setPlaceholder()})):this.clear()}},clearSearch:function(){this.search.val("")}, +data:function(a){var b;if(0===arguments.length)return b=this.selection.data("select2-data"),b==g&&(b=null),b;!a||""===a?this.clear():(this.opts.element.val(!a?"":this.id(a)),this.updateSelection(a))}});z=x(w,{createContainer:function(){return e("
      ",{"class":"select2-container select2-container-multi"}).html("
      ")}, +prepareOpts:function(){var a=this.parent.prepareOpts.apply(this,arguments);"select"===a.element.get(0).tagName.toLowerCase()&&(a.initSelection=function(a,c){var d=[];a.find(":selected").each2(function(a,b){d.push({id:b.attr("value"),text:b.text()})});e.isFunction(c)&&c(d)});return a},initContainer:function(){var a;this.searchContainer=this.container.find(".select2-search-field");this.selection=a=this.container.find(".select2-choices");this.search.bind("keydown",this.bind(function(b){if(this.enabled){if(b.which=== +f.BACKSPACE&&""===this.search.val()){this.close();var c;c=a.find(".select2-search-choice-focus");if(0i(d.id(this),b)&&(b.push(d.id(this)),c.push(this))});a=c;this.selection.find(".select2-search-choice").remove();e(a).each(function(){d.addSelectedChoice(this)});d.postprocessResults()},tokenize:function(){var a=this.search.val(),a=this.opts.tokenizer(a,this.data(),this.bind(this.onSelect), +this.opts);null!=a&&a!=g&&(this.search.val(a),0
      "), +c=this.id(a),d=this.getVal(),f;f=this.opts.formatSelection(a,b);b.find("div").replaceWith("
      "+this.opts.escapeMarkup(f)+"
      ");b.find(".select2-search-choice-close").bind("mousedown",l).bind("click dblclick",this.bind(function(a){this.enabled&&(e(a.target).closest(".select2-search-choice").fadeOut("fast",this.bind(function(){this.unselect(e(a.target));this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");this.close();this.focusSearch()})).dequeue(), +l(a))})).bind("focus",this.bind(function(){this.enabled&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))}));b.data("select2-data",a);b.insertBefore(this.searchContainer);d.push(c);this.setVal(d)},unselect:function(a){var b=this.getVal(),c,d,a=a.closest(".select2-search-choice");if(0===a.length)throw"Invalid argument: "+a+". Must be .select2-search-choice";c=a.data("select2-data");d=i(this.id(c),b);0<=d&&(b.splice(d,1),this.setVal(b),this.select&& +this.postprocessResults());a.remove();this.triggerChange({removed:c})},postprocessResults:function(){var a=this.getVal(),b=this.results.find(".select2-result-selectable"),c=this.results.find(".select2-result-with-children"),d=this;b.each2(function(b,c){var e=d.id(c.data("select2-data"));0<=i(e,a)?c.addClass("select2-disabled").removeClass("select2-result-selectable"):c.removeClass("select2-disabled").addClass("select2-result-selectable")});c.each2(function(a,b){0==b.find(".select2-result-selectable").length? +b.addClass("select2-disabled"):b.removeClass("select2-disabled")});b.each2(function(a,b){if(!b.hasClass("select2-disabled")&&b.hasClass("select2-result-selectable"))return d.highlight(0),!1})},resizeSearch:function(){var a,b,c,d,f=this.search.outerWidth()-this.search.width();a=this.search;q||(c=a[0].currentStyle||window.getComputedStyle(a[0],null),q=e("
      ").css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:c.fontSize,fontFamily:c.fontFamily,fontStyle:c.fontStyle, +fontWeight:c.fontWeight,letterSpacing:c.letterSpacing,textTransform:c.textTransform,whiteSpace:"nowrap"}),e("body").append(q));q.text(a.val());a=q.width()+10;b=this.search.offset().left;c=this.selection.width();d=this.selection.offset().left;b=c-(b-d)-f;bb&&(b=c-f);this.search.width(b)},getVal:function(){var a;if(this.select)return a=this.select.val(),null===a?[]:a;a=this.opts.element.val();return s(a,this.opts.separator)},setVal:function(a){var b;this.select?this.select.val(a):(b= +[],e(a).each(function(){0>i(this,b)&&b.push(this)}),this.opts.element.val(0===b.length?"":b.join(this.opts.separator)))},val:function(){var a,b=[],c=this;if(0===arguments.length)return this.getVal();if(a=arguments[0])if(this.setVal(a),this.select)this.select.find(":selected").each(function(){b.push({id:e(this).attr("value"),text:e(this).text()})}),this.updateSelection(b);else{if(this.opts.initSelection===g)throw Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element, +function(a){var b=e(a).map(c.id);c.setVal(b);c.updateSelection(a);c.clearSearch()})}else this.opts.element.val(""),this.updateSelection([]);this.clearSearch()},onSortStart:function(){if(this.select)throw Error("Sorting of elements is not supported when attached to instead.");this.search.width(0);this.searchContainer.hide()},onSortEnd:function(){var a=[],b=this;this.searchContainer.show();this.searchContainer.appendTo(this.searchContainer.parent());this.resizeSearch(); +this.selection.find(".select2-search-choice").each(function(){a.push(b.opts.id(e(this).data("select2-data")))});this.setVal(a);this.triggerChange()},data:function(a){var b=this,c;if(0===arguments.length)return this.selection.find(".select2-search-choice").map(function(){return e(this).data("select2-data")}).get();a||(a=[]);c=e.map(a,function(a){return b.opts.id(a)});this.setVal(c);this.updateSelection(a);this.clearSearch()}});e.fn.select2=function(){var a=Array.prototype.slice.call(arguments,0),b, +c,d,f,h="val destroy opened open close focus isFocused container onSortStart onSortEnd enable disable positionDropdown data".split(" ");this.each(function(){if(0===a.length||"object"===typeof a[0])b=0===a.length?{}:e.extend({},a[0]),b.element=e(this),"select"===b.element.get(0).tagName.toLowerCase()?f=b.element.attr("multiple"):(f=b.multiple||!1,"tags"in b&&(b.multiple=f=!0)),c=f?new z:new y,c.init(b);else if("string"===typeof a[0]){if(0>i(a[0],h))throw"Unknown method: "+a[0];d=g;c=e(this).data("select2"); +if(c!==g&&(d="container"===a[0]?c.container:c[a[0]].apply(c,a.slice(1)),d!==g))return!1}else throw"Invalid arguments to select2 plugin: "+a;});return d===g?this:d};e.fn.select2.defaults={width:"copy",closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(a,b,c){b=[];B(a.text,c.term,b);return b.join("")},formatSelection:function(a){return a?a.text:g},formatResultCssClass:function(){return g},formatNoMatches:function(){return"No matches found"}, +formatInputTooShort:function(a,b){return"Please enter "+(b-a.length)+" more characters"},formatSelectionTooBig:function(a){return"You can only select "+a+" item"+(1==a?"":"s")},formatLoadMore:function(){return"Loading more results..."},formatSearching:function(){return"Searching..."},minimumResultsForSearch:0,minimumInputLength:0,maximumSelectionSize:0,id:function(a){return a.id},matcher:function(a,b){return 0<=b.toUpperCase().indexOf(a.toUpperCase())},separator:",",tokenSeparators:[],tokenizer:H, +escapeMarkup:function(a){return a&&"string"===typeof a?a.replace(/&/g,"&"):a},blurOnChange:!1};window.Select2={query:{ajax:C,local:D,tags:E},util:{debounce:A,markMatch:B},"class":{"abstract":w,single:y,multi:z}}}})(jQuery); diff --git a/src/main/webapp/resources/js/vue.min.js b/src/main/webapp/resources/js/vue.min.js new file mode 100644 index 0000000000000000000000000000000000000000..836793b4cafa381080fe48fd5ed5f83f598469bf --- /dev/null +++ b/src/main/webapp/resources/js/vue.min.js @@ -0,0 +1,6 @@ +/*! + * Vue.js v2.5.13 + * (c) 2014-2017 Evan You + * Released under the MIT License. + */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Vue=e()}(this,function(){"use strict";function t(t){return void 0===t||null===t}function e(t){return void 0!==t&&null!==t}function n(t){return!0===t}function r(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function i(t){return null!==t&&"object"==typeof t}function o(t){return"[object Object]"===Nn.call(t)}function a(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function s(t){return null==t?"":"object"==typeof t?JSON.stringify(t,null,2):String(t)}function c(t){var e=parseFloat(t);return isNaN(e)?t:e}function u(t,e){for(var n=Object.create(null),r=t.split(","),i=0;i-1)return t.splice(n,1)}}function f(t,e){return Mn.call(t,e)}function p(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}function d(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n}function v(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function h(t,e){for(var n in e)t[n]=e[n];return t}function m(t){for(var e={},n=0;n0&&(tt((s=et(s,(o||"")+"_"+a))[0])&&tt(u)&&(l[c]=x(u.text+s[0].text),s.shift()),l.push.apply(l,s)):r(s)?tt(u)?l[c]=x(u.text+s):""!==s&&l.push(x(s)):tt(s)&&tt(u)?l[c]=x(u.text+s.text):(n(i._isVList)&&e(s.tag)&&t(s.key)&&e(o)&&(s.key="__vlist"+o+"_"+a+"__"),l.push(s)));return l}function nt(t,e){return(t.__esModule||fr&&"Module"===t[Symbol.toStringTag])&&(t=t.default),i(t)?e.extend(t):t}function rt(t){return t.isComment&&t.asyncFactory}function it(t){if(Array.isArray(t))for(var n=0;n=0||n.indexOf(t[i])<0)&&r.push(t[i]);return r}return t}}(n[o],r[o],i[o]));return e}(t);r&&h(t.extendOptions,r),(e=t.options=F(n,t.extendOptions)).name&&(e.components[e.name]=t)}}return e}function Rt(t){this._init(t)}function Ht(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,r=n.cid,i=t._Ctor||(t._Ctor={});if(i[r])return i[r];var o=t.name||n.options.name,a=function(t){this._init(t)};return a.prototype=Object.create(n.prototype),a.prototype.constructor=a,a.cid=e++,a.options=F(n.options,t),a.super=n,a.options.props&&function(t){var e=t.options.props;for(var n in e)mt(t.prototype,"_props",n)}(a),a.options.computed&&function(t){var e=t.options.computed;for(var n in e)gt(t.prototype,n,e[n])}(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,zn.forEach(function(t){a[t]=n[t]}),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=t,a.sealedOptions=h({},a.options),i[r]=a,a}}function Bt(t){return t&&(t.Ctor.options.name||t.tag)}function Ut(t,e){return Array.isArray(t)?t.indexOf(e)>-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!function(t){return"[object RegExp]"===Nn.call(t)}(t)&&t.test(e)}function Vt(t,e){var n=t.cache,r=t.keys,i=t._vnode;for(var o in n){var a=n[o];if(a){var s=Bt(a.componentOptions);s&&!e(s)&&zt(n,o,r,i)}}}function zt(t,e,n,r){var i=t[e];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),t[e]=null,l(n,e)}function Kt(t){for(var n=t.data,r=t,i=t;e(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(n=Jt(i.data,n));for(;e(r=r.parent);)r&&r.data&&(n=Jt(n,r.data));return function(t,n){if(e(t)||e(n))return qt(t,Wt(n));return""}(n.staticClass,n.class)}function Jt(t,n){return{staticClass:qt(t.staticClass,n.staticClass),class:e(t.class)?[t.class,n.class]:n.class}}function qt(t,e){return t?e?t+" "+e:t:e||""}function Wt(t){return Array.isArray(t)?function(t){for(var n,r="",i=0,o=t.length;i=0&&" "===(m=t.charAt(h));h--);m&&Ii.test(m)||(l=!0)}}else void 0===o?(v=i+1,o=t.slice(0,i).trim()):e();if(void 0===o?o=t.slice(0,i).trim():0!==v&&e(),a)for(i=0;i-1?{exp:t.slice(0,ii),key:'"'+t.slice(ii+1)+'"'}:{exp:t,key:null};ni=t,ii=oi=ai=0;for(;!_e();)be(ri=ge())?$e(ri):91===ri&&function(t){var e=1;oi=ii;for(;!_e();)if(t=ge(),be(t))$e(t);else if(91===t&&e++,93===t&&e--,0===e){ai=ii;break}}(ri);return{exp:t.slice(0,oi),key:t.slice(oi+1,ai)}}(t);return null===n.key?t+"="+e:"$set("+n.exp+", "+n.key+", "+e+")"}function ge(){return ni.charCodeAt(++ii)}function _e(){return ii>=ei}function be(t){return 34===t||39===t}function $e(t){for(var e=t;!_e()&&(t=ge())!==e;);}function Ce(t,e,n,r,i){e=function(t){return t._withTask||(t._withTask=function(){Er=!0;var e=t.apply(null,arguments);return Er=!1,e})}(e),n&&(e=function(t,e,n){var r=si;return function i(){null!==t.apply(null,arguments)&&we(e,i,n,r)}}(e,t,r)),si.addEventListener(t,e,or?{capture:r,passive:i}:r)}function we(t,e,n,r){(r||si).removeEventListener(t,e._withTask||e,n)}function xe(n,r){if(!t(n.data.on)||!t(r.data.on)){var i=r.data.on||{},o=n.data.on||{};si=r.elm,function(t){if(e(t[Li])){var n=Qn?"change":"input";t[n]=[].concat(t[Li],t[n]||[]),delete t[Li]}e(t[Mi])&&(t.change=[].concat(t[Mi],t.change||[]),delete t[Mi])}(i),X(i,o,Ce,we,r.context),si=void 0}}function ke(n,r){if(!t(n.data.domProps)||!t(r.data.domProps)){var i,o,a=r.elm,s=n.data.domProps||{},u=r.data.domProps||{};e(u.__ob__)&&(u=r.data.domProps=h({},u));for(i in s)t(u[i])&&(a[i]="");for(i in u){if(o=u[i],"textContent"===i||"innerHTML"===i){if(r.children&&(r.children.length=0),o===s[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===i){a._value=o;var l=t(o)?"":String(o);(function(t,n){return!t.composing&&("OPTION"===t.tagName||function(t,e){var n=!0;try{n=document.activeElement!==t}catch(t){}return n&&t.value!==e}(t,n)||function(t,n){var r=t.value,i=t._vModifiers;if(e(i)){if(i.lazy)return!1;if(i.number)return c(r)!==c(n);if(i.trim)return r.trim()!==n.trim()}return r!==n}(t,n))})(a,l)&&(a.value=l)}else a[i]=o}}}function Ae(t){var e=Oe(t.style);return t.staticStyle?h(t.staticStyle,e):e}function Oe(t){return Array.isArray(t)?m(t):"string"==typeof t?Fi(t):t}function Se(n,r){var i=r.data,o=n.data;if(!(t(i.staticStyle)&&t(i.style)&&t(o.staticStyle)&&t(o.style))){var a,s,c=r.elm,u=o.staticStyle,l=o.normalizedStyle||o.style||{},f=u||l,p=Oe(r.data.style)||{};r.data.normalizedStyle=e(p.__ob__)?h({},p):p;var d=function(t,e){var n,r={};if(e)for(var i=t;i.componentInstance;)(i=i.componentInstance._vnode)&&i.data&&(n=Ae(i.data))&&h(r,n);(n=Ae(t.data))&&h(r,n);for(var o=t;o=o.parent;)o.data&&(n=Ae(o.data))&&h(r,n);return r}(r,!0);for(s in f)t(d[s])&&Bi(c,s,"");for(s in d)(a=d[s])!==f[s]&&Bi(c,s,null==a?"":a)}}function Te(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(/\s+/).forEach(function(e){return t.classList.add(e)}):t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function Ee(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(/\s+/).forEach(function(e){return t.classList.remove(e)}):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" "+(t.getAttribute("class")||"")+" ",r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?t.setAttribute("class",n):t.removeAttribute("class")}}function je(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&h(e,Ki(t.name||"v")),h(e,t),e}return"string"==typeof t?Ki(t):void 0}}function Ne(t){Qi(function(){Qi(t)})}function Ie(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),Te(t,e))}function Le(t,e){t._transitionClasses&&l(t._transitionClasses,e),Ee(t,e)}function Me(t,e,n){var r=De(t,e),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===qi?Zi:Yi,c=0,u=function(){t.removeEventListener(s,l),n()},l=function(e){e.target===t&&++c>=a&&u()};setTimeout(function(){c0&&(n=qi,l=a,f=o.length):e===Wi?u>0&&(n=Wi,l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?qi:Wi:null)?n===qi?o.length:c.length:0;return{type:n,timeout:l,propCount:f,hasTransform:n===qi&&to.test(r[Gi+"Property"])}}function Pe(t,e){for(;t.length1}function Ve(t,e){!0!==e.data.show&&Re(e)}function ze(t,e,n){Ke(t,e,n),(Qn||er)&&setTimeout(function(){Ke(t,e,n)},0)}function Ke(t,e,n){var r=e.value,i=t.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,c=t.options.length;s-1,a.selected!==o&&(a.selected=o);else if(g(qe(a),r))return void(t.selectedIndex!==s&&(t.selectedIndex=s));i||(t.selectedIndex=-1)}}function Je(t,e){return e.every(function(e){return!g(e,t)})}function qe(t){return"_value"in t?t._value:t.value}function We(t){t.target.composing=!0}function Ge(t){t.target.composing&&(t.target.composing=!1,Ze(t.target,"input"))}function Ze(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function Xe(t){return!t.componentInstance||t.data&&t.data.transition?t:Xe(t.componentInstance._vnode)}function Ye(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?Ye(it(e.children)):t}function Qe(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var i=n._parentListeners;for(var o in i)e[Pn(o)]=i[o];return e}function tn(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}function en(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function nn(t){t.data.newPos=t.elm.getBoundingClientRect()}function rn(t){var e=t.data.pos,n=t.data.newPos,r=e.left-n.left,i=e.top-n.top;if(r||i){t.data.moved=!0;var o=t.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}function on(t,e){var n=e?zo:Vo;return t.replace(n,function(t){return Uo[t]})}function an(t,e,n){return{type:1,tag:t,attrsList:e,attrsMap:function(t){for(var e={},n=0,r=t.length;n=0&&a[i].lowerCasedTag!==s;i--);else i=0;if(i>=0){for(var c=a.length-1;c>=i;c--)e.end&&e.end(a[c].tag,n,r);a.length=i,o=i&&a[i-1].tag}else"br"===s?e.start&&e.start(t,[],!0,n,r):"p"===s&&(e.start&&e.start(t,[],!1,n,r),e.end&&e.end(t,n,r))}for(var i,o,a=[],s=e.expectHTML,c=e.isUnaryTag||Bn,u=e.canBeLeftOpenTag||Bn,l=0;t;){if(i=t,o&&Ho(o)){var f=0,p=o.toLowerCase(),d=Bo[p]||(Bo[p]=new RegExp("([\\s\\S]*?)(]*>)","i")),v=t.replace(d,function(t,n,r){return f=r.length,Ho(p)||"noscript"===p||(n=n.replace(//g,"$1").replace(//g,"$1")),Jo(p,n)&&(n=n.slice(1)),e.chars&&e.chars(n),""});l+=t.length-v.length,t=v,r(p,l-f,l)}else{var h=t.indexOf("<");if(0===h){if(Ao.test(t)){var m=t.indexOf("--\x3e");if(m>=0){e.shouldKeepComment&&e.comment(t.substring(4,m)),n(m+3);continue}}if(Oo.test(t)){var y=t.indexOf("]>");if(y>=0){n(y+2);continue}}var g=t.match(ko);if(g){n(g[0].length);continue}var _=t.match(xo);if(_){var b=l;n(_[0].length),r(_[1],b,l);continue}var $=function(){var e=t.match(Co);if(e){var r={tagName:e[1],attrs:[],start:l};n(e[0].length);for(var i,o;!(i=t.match(wo))&&(o=t.match(_o));)n(o[0].length),r.attrs.push(o);if(i)return r.unarySlash=i[1],n(i[0].length),r.end=l,r}}();if($){!function(t){var n=t.tagName,i=t.unarySlash;s&&("p"===o&&go(n)&&r(o),u(n)&&o===n&&r(n));for(var l=c(n)||!!i,f=t.attrs.length,p=new Array(f),d=0;d=0){for(w=t.slice(h);!(xo.test(w)||Co.test(w)||Ao.test(w)||Oo.test(w)||(x=w.indexOf("<",1))<0);)h+=x,w=t.slice(h);C=t.substring(0,h),n(h)}h<0&&(C=t,t=""),e.chars&&C&&e.chars(C)}if(t===i){e.chars&&e.chars(t);break}}r()}(t,{warn:To,expectHTML:e.expectHTML,isUnaryTag:e.isUnaryTag,canBeLeftOpenTag:e.canBeLeftOpenTag,shouldDecodeNewlines:e.shouldDecodeNewlines,shouldDecodeNewlinesForHref:e.shouldDecodeNewlinesForHref,shouldKeepComment:e.comments,start:function(t,a,u){var l=i&&i.ns||Do(t);Qn&&"svg"===l&&(a=function(t){for(var e=[],n=0;nc&&(s.push(o=t.slice(c,i)),a.push(JSON.stringify(o)));var u=ae(r[1].trim());a.push("_s("+u+")"),s.push({"@binding":u}),c=i+r[0].length}return c':'
      ',Ro.innerHTML.indexOf(" ")>0}var jn=Object.freeze({}),Nn=Object.prototype.toString,In=u("slot,component",!0),Ln=u("key,ref,slot,slot-scope,is"),Mn=Object.prototype.hasOwnProperty,Dn=/-(\w)/g,Pn=p(function(t){return t.replace(Dn,function(t,e){return e?e.toUpperCase():""})}),Fn=p(function(t){return t.charAt(0).toUpperCase()+t.slice(1)}),Rn=/\B([A-Z])/g,Hn=p(function(t){return t.replace(Rn,"-$1").toLowerCase()}),Bn=function(t,e,n){return!1},Un=function(t){return t},Vn="data-server-rendered",zn=["component","directive","filter"],Kn=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured"],Jn={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:Bn,isReservedAttr:Bn,isUnknownElement:Bn,getTagNamespace:y,parsePlatformTagName:Un,mustUseProp:Bn,_lifecycleHooks:Kn},qn=/[^\w.$]/,Wn="__proto__"in{},Gn="undefined"!=typeof window,Zn="undefined"!=typeof WXEnvironment&&!!WXEnvironment.platform,Xn=Zn&&WXEnvironment.platform.toLowerCase(),Yn=Gn&&window.navigator.userAgent.toLowerCase(),Qn=Yn&&/msie|trident/.test(Yn),tr=Yn&&Yn.indexOf("msie 9.0")>0,er=Yn&&Yn.indexOf("edge/")>0,nr=Yn&&Yn.indexOf("android")>0||"android"===Xn,rr=Yn&&/iphone|ipad|ipod|ios/.test(Yn)||"ios"===Xn,ir=(Yn&&/chrome\/\d+/.test(Yn),{}.watch),or=!1;if(Gn)try{var ar={};Object.defineProperty(ar,"passive",{get:function(){or=!0}}),window.addEventListener("test-passive",null,ar)}catch(t){}var sr,cr,ur=function(){return void 0===sr&&(sr=!Gn&&"undefined"!=typeof global&&"server"===global.process.env.VUE_ENV),sr},lr=Gn&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,fr="undefined"!=typeof Symbol&&w(Symbol)&&"undefined"!=typeof Reflect&&w(Reflect.ownKeys);cr="undefined"!=typeof Set&&w(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var pr=y,dr=0,vr=function(){this.id=dr++,this.subs=[]};vr.prototype.addSub=function(t){this.subs.push(t)},vr.prototype.removeSub=function(t){l(this.subs,t)},vr.prototype.depend=function(){vr.target&&vr.target.addDep(this)},vr.prototype.notify=function(){for(var t=this.subs.slice(),e=0,n=t.length;eVr&&Fr[n].id>t.id;)n--;Fr.splice(n+1,0,t)}else Fr.push(t);Br||(Br=!0,q(ht))}}(this)},Kr.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||i(t)||this.deep){var e=this.value;if(this.value=t,this.user)try{this.cb.call(this.vm,t,e)}catch(t){V(t,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,t,e)}}},Kr.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},Kr.prototype.depend=function(){for(var t=this.deps.length;t--;)this.deps[t].depend()},Kr.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||l(this.vm._watchers,this);for(var t=this.deps.length;t--;)this.deps[t].removeSub(this);this.active=!1}};var Jr={enumerable:!0,configurable:!0,get:y,set:y},qr={lazy:!0};Nt(It.prototype);var Wr={init:function(t,n,r,i){if(!t.componentInstance||t.componentInstance._isDestroyed){(t.componentInstance=function(t,n,r,i){var o={_isComponent:!0,parent:n,_parentVnode:t,_parentElm:r||null,_refElm:i||null},a=t.data.inlineTemplate;return e(a)&&(o.render=a.render,o.staticRenderFns=a.staticRenderFns),new t.componentOptions.Ctor(o)}(t,Pr,r,i)).$mount(n?t.elm:void 0,n)}else if(t.data.keepAlive){var o=t;Wr.prepatch(o,o)}},prepatch:function(t,e){var n=e.componentOptions;!function(t,e,n,r,i){var o=!!(i||t.$options._renderChildren||r.data.scopedSlots||t.$scopedSlots!==jn);if(t.$options._parentVnode=r,t.$vnode=r,t._vnode&&(t._vnode.parent=r),t.$options._renderChildren=i,t.$attrs=r.data&&r.data.attrs||jn,t.$listeners=n||jn,e&&t.$options.props){Cr.shouldConvert=!1;for(var a=t._props,s=t.$options._propKeys||[],c=0;c1?v(n):n;for(var r=v(arguments,1),i=0,o=n.length;iparseInt(this.max)&&zt(a,s[0],s,this._vnode)),e.data.keepAlive=!0}return e||t&&t[0]}}};!function(t){var e={};e.get=function(){return Jn},Object.defineProperty(t,"config",e),t.util={warn:pr,extend:h,mergeOptions:F,defineReactive:E},t.set=j,t.delete=N,t.nextTick=q,t.options=Object.create(null),zn.forEach(function(e){t.options[e+"s"]=Object.create(null)}),t.options._base=t,h(t.options.components,ti),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=v(arguments,1);return n.unshift(this),"function"==typeof t.install?t.install.apply(t,n):"function"==typeof t&&t.apply(null,n),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=F(this.options,t),this}}(t),Ht(t),function(t){zn.forEach(function(e){t[e]=function(t,n){return n?("component"===e&&o(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"==typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}})}(t)}(Rt),Object.defineProperty(Rt.prototype,"$isServer",{get:ur}),Object.defineProperty(Rt.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Rt.version="2.5.13";var ei,ni,ri,ii,oi,ai,si,ci,ui=u("style,class"),li=u("input,textarea,option,select,progress"),fi=function(t,e,n){return"value"===n&&li(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},pi=u("contenteditable,draggable,spellcheck"),di=u("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),vi="http://www.w3.org/1999/xlink",hi=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},mi=function(t){return hi(t)?t.slice(6,t.length):""},yi=function(t){return null==t||!1===t},gi={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},_i=u("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),bi=u("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),$i=function(t){return _i(t)||bi(t)},Ci=Object.create(null),wi=u("text,number,password,search,email,tel,url"),xi=Object.freeze({createElement:function(t,e){var n=document.createElement(t);return"select"!==t?n:(e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n)},createElementNS:function(t,e){return document.createElementNS(gi[t],e)},createTextNode:function(t){return document.createTextNode(t)},createComment:function(t){return document.createComment(t)},insertBefore:function(t,e,n){t.insertBefore(e,n)},removeChild:function(t,e){t.removeChild(e)},appendChild:function(t,e){t.appendChild(e)},parentNode:function(t){return t.parentNode},nextSibling:function(t){return t.nextSibling},tagName:function(t){return t.tagName},setTextContent:function(t,e){t.textContent=e},setAttribute:function(t,e,n){t.setAttribute(e,n)}}),ki={create:function(t,e){Xt(e)},update:function(t,e){t.data.ref!==e.data.ref&&(Xt(t,!0),Xt(e))},destroy:function(t){Xt(t,!0)}},Ai=new mr("",{},[]),Oi=["create","activate","update","remove","destroy"],Si={create:te,update:te,destroy:function(t){te(t,Ai)}},Ti=Object.create(null),Ei=[ki,Si],ji={create:re,update:re},Ni={create:oe,update:oe},Ii=/[\w).+\-_$\]]/,Li="__r",Mi="__c",Di={create:xe,update:xe},Pi={create:ke,update:ke},Fi=p(function(t){var e={},n=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach(function(t){if(t){var r=t.split(n);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}),Ri=/^--/,Hi=/\s*!important$/,Bi=function(t,e,n){if(Ri.test(e))t.style.setProperty(e,n);else if(Hi.test(n))t.style.setProperty(e,n.replace(Hi,""),"important");else{var r=Vi(e);if(Array.isArray(n))for(var i=0,o=n.length;id?v(n,t(i[g+1])?null:i[g+1].elm,i,p,g,o):p>g&&m(0,r,f,d)}function _(r,i,o,a){if(r!==i){var s=i.elm=r.elm;if(n(r.isAsyncPlaceholder))e(i.asyncFactory.resolved)?$(r.elm,i,o):i.isAsyncPlaceholder=!0;else if(n(i.isStatic)&&n(r.isStatic)&&i.key===r.key&&(n(i.isCloned)||n(i.isOnce)))i.componentInstance=r.componentInstance;else{var c,u=i.data;e(u)&&e(c=u.hook)&&e(c=c.prepatch)&&c(r,i);var l=r.children,p=i.children;if(e(u)&&f(i)){for(c=0;c-1?Ci[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:Ci[t]=/HTMLUnknownElement/.test(e.toString())},h(Rt.options.directives,ro),h(Rt.options.components,so),Rt.prototype.__patch__=Gn?eo:y,Rt.prototype.$mount=function(t,e){return t=t&&Gn?Zt(t):void 0,function(t,e,n){t.$el=e,t.$options.render||(t.$options.render=gr),vt(t,"beforeMount");var r;return r=function(){t._update(t._render(),n)},new Kr(t,r,y,null,!0),n=!1,null==t.$vnode&&(t._isMounted=!0,vt(t,"mounted")),t}(this,t,e)},Rt.nextTick(function(){Jn.devtools&&lr&&lr.emit("init",Rt)},0);var co,uo=/\{\{((?:.|\n)+?)\}\}/g,lo=/[-.*+?^${}()|[\]\/\\]/g,fo=p(function(t){var e=t[0].replace(lo,"\\$&"),n=t[1].replace(lo,"\\$&");return new RegExp(e+"((?:.|\\n)+?)"+n,"g")}),po={staticKeys:["staticClass"],transformNode:function(t,e){e.warn;var n=he(t,"class");n&&(t.staticClass=JSON.stringify(n));var r=ve(t,"class",!1);r&&(t.classBinding=r)},genData:function(t){var e="";return t.staticClass&&(e+="staticClass:"+t.staticClass+","),t.classBinding&&(e+="class:"+t.classBinding+","),e}},vo={staticKeys:["staticStyle"],transformNode:function(t,e){e.warn;var n=he(t,"style");n&&(t.staticStyle=JSON.stringify(Fi(n)));var r=ve(t,"style",!1);r&&(t.styleBinding=r)},genData:function(t){var e="";return t.staticStyle&&(e+="staticStyle:"+t.staticStyle+","),t.styleBinding&&(e+="style:("+t.styleBinding+"),"),e}},ho=function(t){return co=co||document.createElement("div"),co.innerHTML=t,co.textContent},mo=u("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),yo=u("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),go=u("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),_o=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,bo="[a-zA-Z_][\\w\\-\\.]*",$o="((?:"+bo+"\\:)?"+bo+")",Co=new RegExp("^<"+$o),wo=/^\s*(\/?)>/,xo=new RegExp("^<\\/"+$o+"[^>]*>"),ko=/^]+>/i,Ao=/^ + * + * eminem
      + * dr. dre + *
      50 Cent
      + *
      + * + * + * + * + *
        + *
      • eminem
      • + *
      • dr. dre
      • + *
      • 50 Cent
      • + *
      + */ +wysihtml5.dom.convertToList = (function() { + function _createListItem(doc, list) { + var listItem = doc.createElement("li"); + list.appendChild(listItem); + return listItem; + } + + function _createList(doc, type) { + return doc.createElement(type); + } + + function convertToList(element, listType) { + if (element.nodeName === "UL" || element.nodeName === "OL" || element.nodeName === "MENU") { + // Already a list + return element; + } + + var doc = element.ownerDocument, + list = _createList(doc, listType), + lineBreaks = element.querySelectorAll("br"), + lineBreaksLength = lineBreaks.length, + childNodes, + childNodesLength, + childNode, + lineBreak, + parentNode, + isBlockElement, + isLineBreak, + currentListItem, + i; + + // First find
      at the end of inline elements and move them behind them + for (i=0; i if empty, otherwise create a new one + currentListItem = currentListItem.firstChild ? _createListItem(doc, list) : currentListItem; + currentListItem.appendChild(childNode); + currentListItem = null; + continue; + } + + if (isLineBreak) { + // Only create a new list item in the next iteration when the current one has already content + currentListItem = currentListItem.firstChild ? null : currentListItem; + continue; + } + + currentListItem.appendChild(childNode); + } + + element.parentNode.replaceChild(list, element); + return list; + } + + return convertToList; +})();/** + * Copy a set of attributes from one element to another + * + * @param {Array} attributesToCopy List of attributes which should be copied + * @return {Object} Returns an object which offers the "from" method which can be invoked with the element where to + * copy the attributes from., this again returns an object which provides a method named "to" which can be invoked + * with the element where to copy the attributes to (see example) + * + * @example + * var textarea = document.querySelector("textarea"), + * div = document.querySelector("div[contenteditable=true]"), + * anotherDiv = document.querySelector("div.preview"); + * wysihtml5.dom.copyAttributes(["spellcheck", "value", "placeholder"]).from(textarea).to(div).andTo(anotherDiv); + * + */ +wysihtml5.dom.copyAttributes = function(attributesToCopy) { + return { + from: function(elementToCopyFrom) { + return { + to: function(elementToCopyTo) { + var attribute, + i = 0, + length = attributesToCopy.length; + for (; ifoo"); + */ +wysihtml5.dom.getAsDom = (function() { + + var _innerHTMLShiv = function(html, context) { + var tempElement = context.createElement("div"); + tempElement.style.display = "none"; + context.body.appendChild(tempElement); + // IE throws an exception when trying to insert via innerHTML + try { tempElement.innerHTML = html; } catch(e) {} + context.body.removeChild(tempElement); + return tempElement; + }; + + /** + * Make sure IE supports HTML5 tags, which is accomplished by simply creating one instance of each element + */ + var _ensureHTML5Compatibility = function(context) { + if (context._wysihtml5_supportsHTML5Tags) { + return; + } + for (var i=0, length=HTML5_ELEMENTS.length; i "block" + */ +wysihtml5.dom.getStyle = (function() { + var stylePropertyMapping = { + "float": ("styleFloat" in document.createElement("div").style) ? "styleFloat" : "cssFloat" + }, + REG_EXP_CAMELIZE = /\-[a-z]/g; + + function camelize(str) { + return str.replace(REG_EXP_CAMELIZE, function(match) { + return match.charAt(1).toUpperCase(); + }); + } + + return function(property) { + return { + from: function(element) { + if (element.nodeType !== wysihtml5.ELEMENT_NODE) { + return; + } + + var doc = element.ownerDocument, + camelizedProperty = stylePropertyMapping[property] || camelize(property), + style = element.style, + currentStyle = element.currentStyle, + styleValue = style[camelizedProperty]; + if (styleValue) { + return styleValue; + } + + // currentStyle is no standard and only supported by Opera and IE but it has one important advantage over the standard-compliant + // window.getComputedStyle, since it returns css property values in their original unit: + // If you set an elements width to "50%", window.getComputedStyle will give you it's current width in px while currentStyle + // gives you the original "50%". + // Opera supports both, currentStyle and window.getComputedStyle, that's why checking for currentStyle should have higher prio + if (currentStyle) { + try { + return currentStyle[camelizedProperty]; + } catch(e) { + //ie will occasionally fail for unknown reasons. swallowing exception + } + } + + var win = doc.defaultView || doc.parentWindow, + needsOverflowReset = (property === "height" || property === "width") && element.nodeName === "TEXTAREA", + originalOverflow, + returnValue; + + if (win.getComputedStyle) { + // Chrome and Safari both calculate a wrong width and height for textareas when they have scroll bars + // therfore we remove and restore the scrollbar and calculate the value in between + if (needsOverflowReset) { + originalOverflow = style.overflow; + style.overflow = "hidden"; + } + returnValue = win.getComputedStyle(element, null).getPropertyValue(property); + if (needsOverflowReset) { + style.overflow = originalOverflow || ""; + } + return returnValue; + } + } + }; + }; +})();/** + * High performant way to check whether an element with a specific tag name is in the given document + * Optimized for being heavily executed + * Unleashes the power of live node lists + * + * @param {Object} doc The document object of the context where to check + * @param {String} tagName Upper cased tag name + * @example + * wysihtml5.dom.hasElementWithTagName(document, "IMG"); + */ +wysihtml5.dom.hasElementWithTagName = (function() { + var LIVE_CACHE = {}, + DOCUMENT_IDENTIFIER = 1; + + function _getDocumentIdentifier(doc) { + return doc._wysihtml5_identifier || (doc._wysihtml5_identifier = DOCUMENT_IDENTIFIER++); + } + + return function(doc, tagName) { + var key = _getDocumentIdentifier(doc) + ":" + tagName, + cacheEntry = LIVE_CACHE[key]; + if (!cacheEntry) { + cacheEntry = LIVE_CACHE[key] = doc.getElementsByTagName(tagName); + } + + return cacheEntry.length > 0; + }; +})();/** + * High performant way to check whether an element with a specific class name is in the given document + * Optimized for being heavily executed + * Unleashes the power of live node lists + * + * @param {Object} doc The document object of the context where to check + * @param {String} tagName Upper cased tag name + * @example + * wysihtml5.dom.hasElementWithClassName(document, "foobar"); + */ +(function(wysihtml5) { + var LIVE_CACHE = {}, + DOCUMENT_IDENTIFIER = 1; + + function _getDocumentIdentifier(doc) { + return doc._wysihtml5_identifier || (doc._wysihtml5_identifier = DOCUMENT_IDENTIFIER++); + } + + wysihtml5.dom.hasElementWithClassName = function(doc, className) { + // getElementsByClassName is not supported by IE<9 + // but is sometimes mocked via library code (which then doesn't return live node lists) + if (!wysihtml5.browser.supportsNativeGetElementsByClassName()) { + return !!doc.querySelector("." + className); + } + + var key = _getDocumentIdentifier(doc) + ":" + className, + cacheEntry = LIVE_CACHE[key]; + if (!cacheEntry) { + cacheEntry = LIVE_CACHE[key] = doc.getElementsByClassName(className); + } + + return cacheEntry.length > 0; + }; +})(wysihtml5); +wysihtml5.dom.insert = function(elementToInsert) { + return { + after: function(element) { + element.parentNode.insertBefore(elementToInsert, element.nextSibling); + }, + + before: function(element) { + element.parentNode.insertBefore(elementToInsert, element); + }, + + into: function(element) { + element.appendChild(elementToInsert); + } + }; +};wysihtml5.dom.insertCSS = function(rules) { + rules = rules.join("\n"); + + return { + into: function(doc) { + var head = doc.head || doc.getElementsByTagName("head")[0], + styleElement = doc.createElement("style"); + + styleElement.type = "text/css"; + + if (styleElement.styleSheet) { + styleElement.styleSheet.cssText = rules; + } else { + styleElement.appendChild(doc.createTextNode(rules)); + } + + if (head) { + head.appendChild(styleElement); + } + } + }; +};/** + * Method to set dom events + * + * @example + * wysihtml5.dom.observe(iframe.contentWindow.document.body, ["focus", "blur"], function() { ... }); + */ +wysihtml5.dom.observe = function(element, eventNames, handler) { + eventNames = typeof(eventNames) === "string" ? [eventNames] : eventNames; + + var handlerWrapper, + eventName, + i = 0, + length = eventNames.length; + + for (; i
      foo bar
      + * + * var userHTML = '
      I'm a table!
      '; + * wysihtml5.dom.parse(userHTML); + * // => 'I'm a table!' + * + * var userHTML = '
      foobar
      foobar
      '; + * wysihtml5.dom.parse(userHTML, { + * tags: { + * div: undefined, + * br: true + * } + * }); + * // => '' + * + * var userHTML = '
      foo
      bar
      '; + * wysihtml5.dom.parse(userHTML, { + * classes: { + * red: 1, + * green: 1 + * }, + * tags: { + * div: { + * rename_tag: "p" + * } + * } + * }); + * // => '

      foo

      bar

      ' + */ +wysihtml5.dom.parse = (function() { + + /** + * It's not possible to use a XMLParser/DOMParser as HTML5 is not always well-formed XML + * new DOMParser().parseFromString('') will cause a parseError since the + * node isn't closed + * + * Therefore we've to use the browser's ordinary HTML parser invoked by setting innerHTML. + */ + var NODE_TYPE_MAPPING = { + "1": _handleElement, + "3": _handleText + }, + // Rename unknown tags to this + DEFAULT_NODE_NAME = "span", + WHITE_SPACE_REG_EXP = /\s+/, + defaultRules = { tags: {}, classes: {} }, + currentRules = {}; + + /** + * Iterates over all childs of the element, recreates them, appends them into a document fragment + * which later replaces the entire body content + */ + function parse(elementOrHtml, rules, context, cleanUp) { + wysihtml5.lang.object(currentRules).merge(defaultRules).merge(rules).get(); + + context = context || elementOrHtml.ownerDocument || document; + var fragment = context.createDocumentFragment(), + isString = typeof(elementOrHtml) === "string", + element, + newNode, + firstChild; + + if (isString) { + element = wysihtml5.dom.getAsDom(elementOrHtml, context); + } else { + element = elementOrHtml; + } + + while (element.firstChild) { + firstChild = element.firstChild; + element.removeChild(firstChild); + newNode = _convert(firstChild, cleanUp); + if (newNode) { + fragment.appendChild(newNode); + } + } + + // Clear element contents + element.innerHTML = ""; + + // Insert new DOM tree + element.appendChild(fragment); + + return isString ? wysihtml5.quirks.getCorrectInnerHTML(element) : element; + } + + function _convert(oldNode, cleanUp) { + var oldNodeType = oldNode.nodeType, + oldChilds = oldNode.childNodes, + oldChildsLength = oldChilds.length, + newNode, + method = NODE_TYPE_MAPPING[oldNodeType], + i = 0; + + newNode = method && method(oldNode); + + if (!newNode) { + return null; + } + + for (i=0; i elements + if (cleanUp && + newNode.childNodes.length <= 1 && + newNode.nodeName.toLowerCase() === DEFAULT_NODE_NAME && + !newNode.attributes.length) { + return newNode.firstChild; + } + + return newNode; + } + + function _handleElement(oldNode) { + var rule, + newNode, + endTag, + tagRules = currentRules.tags, + nodeName = oldNode.nodeName.toLowerCase(), + scopeName = oldNode.scopeName; + + /** + * We already parsed that element + * ignore it! (yes, this sometimes happens in IE8 when the html is invalid) + */ + if (oldNode._wysihtml5) { + return null; + } + oldNode._wysihtml5 = 1; + + if (oldNode.className === "wysihtml5-temp") { + return null; + } + + /** + * IE is the only browser who doesn't include the namespace in the + * nodeName, that's why we have to prepend it by ourselves + * scopeName is a proprietary IE feature + * read more here http://msdn.microsoft.com/en-us/library/ms534388(v=vs.85).aspx + */ + if (scopeName && scopeName != "HTML") { + nodeName = scopeName + ":" + nodeName; + } + + /** + * Repair node + * IE is a bit bitchy when it comes to invalid nested markup which includes unclosed tags + * A

      doesn't need to be closed according HTML4-5 spec, we simply replace it with a

      to preserve its content and layout + */ + if ("outerHTML" in oldNode) { + if (!wysihtml5.browser.autoClosesUnclosedTags() && + oldNode.nodeName === "P" && + oldNode.outerHTML.slice(-4).toLowerCase() !== "

      ") { + nodeName = "div"; + } + } + + if (nodeName in tagRules) { + rule = tagRules[nodeName]; + if (!rule || rule.remove) { + return null; + } + + rule = typeof(rule) === "string" ? { rename_tag: rule } : rule; + } else if (oldNode.firstChild) { + rule = { rename_tag: DEFAULT_NODE_NAME }; + } else { + // Remove empty unknown elements + return null; + } + + newNode = oldNode.ownerDocument.createElement(rule.rename_tag || nodeName); + _handleAttributes(oldNode, newNode, rule); + + oldNode = null; + return newNode; + } + + function _handleAttributes(oldNode, newNode, rule) { + var attributes = {}, // fresh new set of attributes to set on newNode + setClass = rule.set_class, // classes to set + addClass = rule.add_class, // add classes based on existing attributes + setAttributes = rule.set_attributes, // attributes to set on the current node + checkAttributes = rule.check_attributes, // check/convert values of attributes + allowedClasses = currentRules.classes, + i = 0, + classes = [], + newClasses = [], + newUniqueClasses = [], + oldClasses = [], + classesLength, + newClassesLength, + currentClass, + newClass, + attributeName, + newAttributeValue, + method; + + if (setAttributes) { + attributes = wysihtml5.lang.object(setAttributes).clone(); + } + + if (checkAttributes) { + for (attributeName in checkAttributes) { + method = attributeCheckMethods[checkAttributes[attributeName]]; + if (!method) { + continue; + } + newAttributeValue = method(_getAttribute(oldNode, attributeName)); + if (typeof(newAttributeValue) === "string") { + attributes[attributeName] = newAttributeValue; + } + } + } + + if (setClass) { + classes.push(setClass); + } + + if (addClass) { + for (attributeName in addClass) { + method = addClassMethods[addClass[attributeName]]; + if (!method) { + continue; + } + newClass = method(_getAttribute(oldNode, attributeName)); + if (typeof(newClass) === "string") { + classes.push(newClass); + } + } + } + + // make sure that wysihtml5 temp class doesn't get stripped out + allowedClasses["_wysihtml5-temp-placeholder"] = 1; + + // add old classes last + oldClasses = oldNode.getAttribute("class"); + if (oldClasses) { + classes = classes.concat(oldClasses.split(WHITE_SPACE_REG_EXP)); + } + classesLength = classes.length; + for (; i under https when it's new attribute value is non-https + // TODO: Investigate this further and check for smarter handling + try { + newNode.setAttribute(attributeName, attributes[attributeName]); + } catch(e) {} + } + + // IE8 sometimes loses the width/height attributes when those are set before the "src" + // so we make sure to set them again + if (attributes.src) { + if (typeof(attributes.width) !== "undefined") { + newNode.setAttribute("width", attributes.width); + } + if (typeof(attributes.height) !== "undefined") { + newNode.setAttribute("height", attributes.height); + } + } + } + + /** + * IE gives wrong results for hasAttribute/getAttribute, for example: + * var td = document.createElement("td"); + * td.getAttribute("rowspan"); // => "1" in IE + * + * Therefore we have to check the element's outerHTML for the attribute + */ + var HAS_GET_ATTRIBUTE_BUG = !wysihtml5.browser.supportsGetAttributeCorrectly(); + function _getAttribute(node, attributeName) { + attributeName = attributeName.toLowerCase(); + var nodeName = node.nodeName; + if (nodeName == "IMG" && attributeName == "src" && _isLoadedImage(node) === true) { + // Get 'src' attribute value via object property since this will always contain the + // full absolute url (http://...) + // this fixes a very annoying bug in firefox (ver 3.6 & 4) and IE 8 where images copied from the same host + // will have relative paths, which the sanitizer strips out (see attributeCheckMethods.url) + return node.src; + } else if (HAS_GET_ATTRIBUTE_BUG && "outerHTML" in node) { + // Don't trust getAttribute/hasAttribute in IE 6-8, instead check the element's outerHTML + var outerHTML = node.outerHTML.toLowerCase(), + // TODO: This might not work for attributes without value: + hasAttribute = outerHTML.indexOf(" " + attributeName + "=") != -1; + + return hasAttribute ? node.getAttribute(attributeName) : null; + } else{ + return node.getAttribute(attributeName); + } + } + + /** + * Check whether the given node is a proper loaded image + * FIXME: Returns undefined when unknown (Chrome, Safari) + */ + function _isLoadedImage(node) { + try { + return node.complete && !node.mozMatchesSelector(":-moz-broken"); + } catch(e) { + if (node.complete && node.readyState === "complete") { + return true; + } + } + } + + function _handleText(oldNode) { + return oldNode.ownerDocument.createTextNode(oldNode.data); + } + + + // ------------ attribute checks ------------ \\ + var attributeCheckMethods = { + url: (function() { + var REG_EXP = /^https?:\/\//i; + return function(attributeValue) { + if (!attributeValue || !attributeValue.match(REG_EXP)) { + return null; + } + return attributeValue.replace(REG_EXP, function(match) { + return match.toLowerCase(); + }); + }; + })(), + + alt: (function() { + var REG_EXP = /[^ a-z0-9_\-]/gi; + return function(attributeValue) { + if (!attributeValue) { + return ""; + } + return attributeValue.replace(REG_EXP, ""); + }; + })(), + + numbers: (function() { + var REG_EXP = /\D/g; + return function(attributeValue) { + attributeValue = (attributeValue || "").replace(REG_EXP, ""); + return attributeValue || null; + }; + })() + }; + + // ------------ class converter (converts an html attribute to a class name) ------------ \\ + var addClassMethods = { + align_img: (function() { + var mapping = { + left: "wysiwyg-float-left", + right: "wysiwyg-float-right" + }; + return function(attributeValue) { + return mapping[String(attributeValue).toLowerCase()]; + }; + })(), + + align_text: (function() { + var mapping = { + left: "wysiwyg-text-align-left", + right: "wysiwyg-text-align-right", + center: "wysiwyg-text-align-center", + justify: "wysiwyg-text-align-justify" + }; + return function(attributeValue) { + return mapping[String(attributeValue).toLowerCase()]; + }; + })(), + + clear_br: (function() { + var mapping = { + left: "wysiwyg-clear-left", + right: "wysiwyg-clear-right", + both: "wysiwyg-clear-both", + all: "wysiwyg-clear-both" + }; + return function(attributeValue) { + return mapping[String(attributeValue).toLowerCase()]; + }; + })(), + + size_font: (function() { + var mapping = { + "1": "wysiwyg-font-size-xx-small", + "2": "wysiwyg-font-size-small", + "3": "wysiwyg-font-size-medium", + "4": "wysiwyg-font-size-large", + "5": "wysiwyg-font-size-x-large", + "6": "wysiwyg-font-size-xx-large", + "7": "wysiwyg-font-size-xx-large", + "-": "wysiwyg-font-size-smaller", + "+": "wysiwyg-font-size-larger" + }; + return function(attributeValue) { + return mapping[String(attributeValue).charAt(0)]; + }; + })() + }; + + return parse; +})();/** + * Checks for empty text node childs and removes them + * + * @param {Element} node The element in which to cleanup + * @example + * wysihtml5.dom.removeEmptyTextNodes(element); + */ +wysihtml5.dom.removeEmptyTextNodes = function(node) { + var childNode, + childNodes = wysihtml5.lang.array(node.childNodes).get(), + childNodesLength = childNodes.length, + i = 0; + for (; i to a

      ) and keeps its childs + * + * @param {Element} element The list element which should be renamed + * @param {Element} newNodeName The desired tag name + * + * @example + * + *

        + *
      • eminem
      • + *
      • dr. dre
      • + *
      • 50 Cent
      • + *
      + * + * + * + * + *
        + *
      1. eminem
      2. + *
      3. dr. dre
      4. + *
      5. 50 Cent
      6. + *
      + */ +wysihtml5.dom.renameElement = function(element, newNodeName) { + var newElement = element.ownerDocument.createElement(newNodeName), + firstChild; + while (firstChild = element.firstChild) { + newElement.appendChild(firstChild); + } + wysihtml5.dom.copyAttributes(["align", "className"]).from(element).to(newElement); + element.parentNode.replaceChild(newElement, element); + return newElement; +};/** + * Takes an element, removes it and replaces it with it's childs + * + * @param {Object} node The node which to replace with it's child nodes + * @example + *
      + * hello + *
      + * + */ +wysihtml5.dom.replaceWithChildNodes = function(node) { + if (!node.parentNode) { + return; + } + + if (!node.firstChild) { + node.parentNode.removeChild(node); + return; + } + + var fragment = node.ownerDocument.createDocumentFragment(); + while (node.firstChild) { + fragment.appendChild(node.firstChild); + } + node.parentNode.replaceChild(fragment, node); + node = fragment = null; +}; +/** + * Unwraps an unordered/ordered list + * + * @param {Element} element The list element which should be unwrapped + * + * @example + * + *
        + *
      • eminem
      • + *
      • dr. dre
      • + *
      • 50 Cent
      • + *
      + * + * + * + * + * eminem
      + * dr. dre
      + * 50 Cent
      + */ +(function(dom) { + function _isBlockElement(node) { + return dom.getStyle("display").from(node) === "block"; + } + + function _isLineBreak(node) { + return node.nodeName === "BR"; + } + + function _appendLineBreak(element) { + var lineBreak = element.ownerDocument.createElement("br"); + element.appendChild(lineBreak); + } + + function resolveList(list) { + if (list.nodeName !== "MENU" && list.nodeName !== "UL" && list.nodeName !== "OL") { + return; + } + + var doc = list.ownerDocument, + fragment = doc.createDocumentFragment(), + previousSibling = list.previousElementSibling || list.previousSibling, + firstChild, + lastChild, + isLastChild, + shouldAppendLineBreak, + listItem; + + if (previousSibling && !_isBlockElement(previousSibling)) { + _appendLineBreak(fragment); + } + + while (listItem = list.firstChild) { + lastChild = listItem.lastChild; + while (firstChild = listItem.firstChild) { + isLastChild = firstChild === lastChild; + // This needs to be done before appending it to the fragment, as it otherwise will loose style information + shouldAppendLineBreak = isLastChild && !_isBlockElement(firstChild) && !_isLineBreak(firstChild); + fragment.appendChild(firstChild); + if (shouldAppendLineBreak) { + _appendLineBreak(fragment); + } + } + + listItem.parentNode.removeChild(listItem); + } + list.parentNode.replaceChild(fragment, list); + } + + dom.resolveList = resolveList; +})(wysihtml5.dom);/** + * Sandbox for executing javascript, parsing css styles and doing dom operations in a secure way + * + * Browser Compatibility: + * - Secure in MSIE 6+, but only when the user hasn't made changes to his security level "restricted" + * - Partially secure in other browsers (Firefox, Opera, Safari, Chrome, ...) + * + * Please note that this class can't benefit from the HTML5 sandbox attribute for the following reasons: + * - sandboxing doesn't work correctly with inlined content (src="javascript:'...'") + * - sandboxing of physical documents causes that the dom isn't accessible anymore from the outside (iframe.contentWindow, ...) + * - setting the "allow-same-origin" flag would fix that, but then still javascript and dom events refuse to fire + * - therefore the "allow-scripts" flag is needed, which then would deactivate any security, as the js executed inside the iframe + * can do anything as if the sandbox attribute wasn't set + * + * @param {Function} [readyCallback] Method that gets invoked when the sandbox is ready + * @param {Object} [config] Optional parameters + * + * @example + * new wysihtml5.dom.Sandbox(function(sandbox) { + * sandbox.getWindow().document.body.innerHTML = ''; + * }); + */ +(function(wysihtml5) { + var /** + * Default configuration + */ + doc = document, + /** + * Properties to unset/protect on the window object + */ + windowProperties = [ + "parent", "top", "opener", "frameElement", "frames", + "localStorage", "globalStorage", "sessionStorage", "indexedDB" + ], + /** + * Properties on the window object which are set to an empty function + */ + windowProperties2 = [ + "open", "close", "openDialog", "showModalDialog", + "alert", "confirm", "prompt", + "openDatabase", "postMessage", + "XMLHttpRequest", "XDomainRequest" + ], + /** + * Properties to unset/protect on the document object + */ + documentProperties = [ + "referrer", + "write", "open", "close" + ]; + + wysihtml5.dom.Sandbox = Base.extend( + /** @scope wysihtml5.dom.Sandbox.prototype */ { + + constructor: function(readyCallback, config) { + this.callback = readyCallback || wysihtml5.EMPTY_FUNCTION; + this.config = wysihtml5.lang.object({}).merge(config).get(); + this.iframe = this._createIframe(); + }, + + insertInto: function(element) { + if (typeof(element) === "string") { + element = doc.getElementById(element); + } + + element.appendChild(this.iframe); + }, + + getIframe: function() { + return this.iframe; + }, + + getWindow: function() { + this._readyError(); + }, + + getDocument: function() { + this._readyError(); + }, + + destroy: function() { + var iframe = this.getIframe(); + iframe.parentNode.removeChild(iframe); + }, + + _readyError: function() { + throw new Error("wysihtml5.Sandbox: Sandbox iframe isn't loaded yet"); + }, + + /** + * Creates the sandbox iframe + * + * Some important notes: + * - We can't use HTML5 sandbox for now: + * setting it causes that the iframe's dom can't be accessed from the outside + * Therefore we need to set the "allow-same-origin" flag which enables accessing the iframe's dom + * But then there's another problem, DOM events (focus, blur, change, keypress, ...) aren't fired. + * In order to make this happen we need to set the "allow-scripts" flag. + * A combination of allow-scripts and allow-same-origin is almost the same as setting no sandbox attribute at all. + * - Chrome & Safari, doesn't seem to support sandboxing correctly when the iframe's html is inlined (no physical document) + * - IE needs to have the security="restricted" attribute set before the iframe is + * inserted into the dom tree + * - Believe it or not but in IE "security" in document.createElement("iframe") is false, even + * though it supports it + * - When an iframe has security="restricted", in IE eval() & execScript() don't work anymore + * - IE doesn't fire the onload event when the content is inlined in the src attribute, therefore we rely + * on the onreadystatechange event + */ + _createIframe: function() { + var that = this, + iframe = doc.createElement("iframe"); + iframe.className = "wysihtml5-sandbox"; + wysihtml5.dom.setAttributes({ + "security": "restricted", + "allowtransparency": "true", + "frameborder": 0, + "width": 0, + "height": 0, + "marginwidth": 0, + "marginheight": 0 + }).on(iframe); + + // Setting the src like this prevents ssl warnings in IE6 + if (wysihtml5.browser.throwsMixedContentWarningWhenIframeSrcIsEmpty()) { + iframe.src = "javascript:''"; + } + + iframe.onload = function() { + iframe.onreadystatechange = iframe.onload = null; + that._onLoadIframe(iframe); + }; + + iframe.onreadystatechange = function() { + if (/loaded|complete/.test(iframe.readyState)) { + iframe.onreadystatechange = iframe.onload = null; + that._onLoadIframe(iframe); + } + }; + + return iframe; + }, + + /** + * Callback for when the iframe has finished loading + */ + _onLoadIframe: function(iframe) { + // don't resume when the iframe got unloaded (eg. by removing it from the dom) + if (!wysihtml5.dom.contains(doc.documentElement, iframe)) { + return; + } + + var that = this, + iframeWindow = iframe.contentWindow, + iframeDocument = iframe.contentWindow.document, + charset = doc.characterSet || doc.charset || "utf-8", + sandboxHtml = this._getHtml({ + charset: charset, + stylesheets: this.config.stylesheets + }); + + // Create the basic dom tree including proper DOCTYPE and charset + iframeDocument.open("text/html", "replace"); + iframeDocument.write(sandboxHtml); + iframeDocument.close(); + + this.getWindow = function() { return iframe.contentWindow; }; + this.getDocument = function() { return iframe.contentWindow.document; }; + + // Catch js errors and pass them to the parent's onerror event + // addEventListener("error") doesn't work properly in some browsers + // TODO: apparently this doesn't work in IE9! + iframeWindow.onerror = function(errorMessage, fileName, lineNumber) { + throw new Error("wysihtml5.Sandbox: " + errorMessage, fileName, lineNumber); + }; + + if (!wysihtml5.browser.supportsSandboxedIframes()) { + // Unset a bunch of sensitive variables + // Please note: This isn't hack safe! + // It more or less just takes care of basic attacks and prevents accidental theft of sensitive information + // IE is secure though, which is the most important thing, since IE is the only browser, who + // takes over scripts & styles into contentEditable elements when copied from external websites + // or applications (Microsoft Word, ...) + var i, length; + for (i=0, length=windowProperties.length; i'; + } + } + templateVars.stylesheets = html; + + return wysihtml5.lang.string( + '' + + '#{stylesheets}' + + '' + ).interpolate(templateVars); + }, + + /** + * Method to unset/override existing variables + * @example + * // Make cookie unreadable and unwritable + * this._unset(document, "cookie", "", true); + */ + _unset: function(object, property, value, setter) { + try { object[property] = value; } catch(e) {} + + try { object.__defineGetter__(property, function() { return value; }); } catch(e) {} + if (setter) { + try { object.__defineSetter__(property, function() {}); } catch(e) {} + } + + if (!wysihtml5.browser.crashesWhenDefineProperty(property)) { + try { + var config = { + get: function() { return value; } + }; + if (setter) { + config.set = function() {}; + } + Object.defineProperty(object, property, config); + } catch(e) {} + } + } + }); +})(wysihtml5); +(function() { + var mapping = { + "className": "class" + }; + wysihtml5.dom.setAttributes = function(attributes) { + return { + on: function(element) { + for (var i in attributes) { + element.setAttribute(mapping[i] || i, attributes[i]); + } + } + } + }; +})();wysihtml5.dom.setStyles = function(styles) { + return { + on: function(element) { + var style = element.style; + if (typeof(styles) === "string") { + style.cssText += ";" + styles; + return; + } + for (var i in styles) { + if (i === "float") { + style.cssFloat = styles[i]; + style.styleFloat = styles[i]; + } else { + style[i] = styles[i]; + } + } + } + }; +};/** + * Simulate HTML5 placeholder attribute + * + * Needed since + * - div[contentEditable] elements don't support it + * - older browsers (such as IE8 and Firefox 3.6) don't support it at all + * + * @param {Object} parent Instance of main wysihtml5.Editor class + * @param {Element} view Instance of wysihtml5.views.* class + * @param {String} placeholderText + * + * @example + * wysihtml.dom.simulatePlaceholder(this, composer, "Foobar"); + */ +(function(dom) { + dom.simulatePlaceholder = function(editor, view, placeholderText) { + var CLASS_NAME = "placeholder", + unset = function() { + if (view.hasPlaceholderSet()) { + view.clear(); + } + dom.removeClass(view.element, CLASS_NAME); + }, + set = function() { + if (view.isEmpty()) { + view.setValue(placeholderText); + dom.addClass(view.element, CLASS_NAME); + } + }; + + editor + .observe("set_placeholder", set) + .observe("unset_placeholder", unset) + .observe("focus:composer", unset) + .observe("paste:composer", unset) + .observe("blur:composer", set); + + set(); + }; +})(wysihtml5.dom); +(function(dom) { + var documentElement = document.documentElement; + if ("textContent" in documentElement) { + dom.setTextContent = function(element, text) { + element.textContent = text; + }; + + dom.getTextContent = function(element) { + return element.textContent; + }; + } else if ("innerText" in documentElement) { + dom.setTextContent = function(element, text) { + element.innerText = text; + }; + + dom.getTextContent = function(element) { + return element.innerText; + }; + } else { + dom.setTextContent = function(element, text) { + element.nodeValue = text; + }; + + dom.getTextContent = function(element) { + return element.nodeValue; + }; + } +})(wysihtml5.dom); + +/** + * Fix most common html formatting misbehaviors of browsers implementation when inserting + * content via copy & paste contentEditable + * + * @author Christopher Blum + */ +wysihtml5.quirks.cleanPastedHTML = (function() { + // TODO: We probably need more rules here + var defaultRules = { + // When pasting underlined links into a contentEditable, IE thinks, it has to insert to keep the styling + "a u": wysihtml5.dom.replaceWithChildNodes + }; + + function cleanPastedHTML(elementOrHtml, rules, context) { + rules = rules || defaultRules; + context = context || elementOrHtml.ownerDocument || document; + + var element, + isString = typeof(elementOrHtml) === "string", + method, + matches, + matchesLength, + i, + j = 0; + if (isString) { + element = wysihtml5.dom.getAsDom(elementOrHtml, context); + } else { + element = elementOrHtml; + } + + for (i in rules) { + matches = element.querySelectorAll(i); + method = rules[i]; + matchesLength = matches.length; + for (; j 

      " || + innerHTML == "

       

       

      ") { + element.innerHTML = ""; + } + }, 0); + }; + + return function(composer) { + dom.observe(composer.element, ["cut", "keydown"], clearIfNecessary); + }; + })(); + + + + /** + * In Opera when the caret is in the first and only item of a list (
      • |
      ) and the list is the first child of the contentEditable element, it's impossible to delete the list by hitting backspace + * + * @param {Object} contentEditableElement The contentEditable element to observe for clearing events + * @exaple + * wysihtml5.quirks.ensureProperClearing(myContentEditableElement); + */ + wysihtml5.quirks.ensureProperClearingOfLists = (function() { + var ELEMENTS_THAT_CONTAIN_LI = ["OL", "UL", "MENU"]; + + var clearIfNecessary = function(element, contentEditableElement) { + if (!contentEditableElement.firstChild || !wysihtml5.lang.array(ELEMENTS_THAT_CONTAIN_LI).contains(contentEditableElement.firstChild.nodeName)) { + return; + } + + var list = dom.getParentElement(element, { nodeName: ELEMENTS_THAT_CONTAIN_LI }); + if (!list) { + return; + } + + var listIsFirstChildOfContentEditable = list == contentEditableElement.firstChild; + if (!listIsFirstChildOfContentEditable) { + return; + } + + var hasOnlyOneListItem = list.childNodes.length <= 1; + if (!hasOnlyOneListItem) { + return; + } + + var onlyListItemIsEmpty = list.firstChild ? list.firstChild.innerHTML === "" : true; + if (!onlyListItemIsEmpty) { + return; + } + + list.parentNode.removeChild(list); + }; + + return function(composer) { + dom.observe(composer.element, "keydown", function(event) { + if (event.keyCode !== wysihtml5.BACKSPACE_KEY) { + return; + } + + var element = composer.selection.getSelectedNode(); + clearIfNecessary(element, composer.element); + }); + }; + })(); + +})(wysihtml5); +// See https://bugzilla.mozilla.org/show_bug.cgi?id=664398 +// +// In Firefox this: +// var d = document.createElement("div"); +// d.innerHTML ='
      '; +// d.innerHTML; +// will result in: +// +// which is wrong +(function(wysihtml5) { + var TILDE_ESCAPED = "%7E"; + wysihtml5.quirks.getCorrectInnerHTML = function(element) { + var innerHTML = element.innerHTML; + if (innerHTML.indexOf(TILDE_ESCAPED) === -1) { + return innerHTML; + } + + var elementsWithTilde = element.querySelectorAll("[href*='~'], [src*='~']"), + url, + urlToSearch, + length, + i; + for (i=0, length=elementsWithTilde.length; i on return + * - Chrome & Safari insert new
      on return + * - Firefox inserts
      on return (yippie!) + * + * @param {Element} element + * + * @example + * wysihtml5.quirks.insertLineBreakOnReturn(element); + */ +(function(wysihtml5) { + var dom = wysihtml5.dom, + USE_NATIVE_LINE_BREAK_WHEN_CARET_INSIDE_TAGS = ["LI", "P", "H1", "H2", "H3", "H4", "H5", "H6"], + LIST_TAGS = ["UL", "OL", "MENU"]; + + wysihtml5.quirks.insertLineBreakOnReturn = function(composer) { + function unwrap(selectedNode) { + var parentElement = dom.getParentElement(selectedNode, { nodeName: ["P", "DIV"] }, 2); + if (!parentElement) { + return; + } + + var invisibleSpace = document.createTextNode(wysihtml5.INVISIBLE_SPACE); + dom.insert(invisibleSpace).before(parentElement); + dom.replaceWithChildNodes(parentElement); + composer.selection.selectNode(invisibleSpace); + } + + function keyDown(event) { + var keyCode = event.keyCode; + if (event.shiftKey || (keyCode !== wysihtml5.ENTER_KEY && keyCode !== wysihtml5.BACKSPACE_KEY)) { + return; + } + + var element = event.target, + selectedNode = composer.selection.getSelectedNode(), + blockElement = dom.getParentElement(selectedNode, { nodeName: USE_NATIVE_LINE_BREAK_WHEN_CARET_INSIDE_TAGS }, 4); + if (blockElement) { + // Some browsers create

      elements after leaving a list + // check after keydown of backspace and return whether a

      got inserted and unwrap it + if (blockElement.nodeName === "LI" && (keyCode === wysihtml5.ENTER_KEY || keyCode === wysihtml5.BACKSPACE_KEY)) { + setTimeout(function() { + var selectedNode = composer.selection.getSelectedNode(), + list, + div; + if (!selectedNode) { + return; + } + + list = dom.getParentElement(selectedNode, { + nodeName: LIST_TAGS + }, 2); + + if (list) { + return; + } + + unwrap(selectedNode); + }, 0); + } else if (blockElement.nodeName.match(/H[1-6]/) && keyCode === wysihtml5.ENTER_KEY) { + setTimeout(function() { + unwrap(composer.selection.getSelectedNode()); + }, 0); + } + return; + } + + if (keyCode === wysihtml5.ENTER_KEY && !wysihtml5.browser.insertsLineBreaksOnReturn()) { + composer.commands.exec("insertLineBreak"); + event.preventDefault(); + } + } + + // keypress doesn't fire when you hit backspace + dom.observe(composer.element.ownerDocument, "keydown", keyDown); + }; +})(wysihtml5);/** + * Force rerendering of a given element + * Needed to fix display misbehaviors of IE + * + * @param {Element} element The element object which needs to be rerendered + * @example + * wysihtml5.quirks.redraw(document.body); + */ +(function(wysihtml5) { + var CLASS_NAME = "wysihtml5-quirks-redraw"; + + wysihtml5.quirks.redraw = function(element) { + wysihtml5.dom.addClass(element, CLASS_NAME); + wysihtml5.dom.removeClass(element, CLASS_NAME); + + // Following hack is needed for firefox to make sure that image resize handles are properly removed + try { + var doc = element.ownerDocument; + doc.execCommand("italic", false, null); + doc.execCommand("italic", false, null); + } catch(e) {} + }; +})(wysihtml5);/** + * Selection API + * + * @example + * var selection = new wysihtml5.Selection(editor); + */ +(function(wysihtml5) { + var dom = wysihtml5.dom; + + function _getCumulativeOffsetTop(element) { + var top = 0; + if (element.parentNode) { + do { + top += element.offsetTop || 0; + element = element.offsetParent; + } while (element); + } + return top; + } + + wysihtml5.Selection = Base.extend( + /** @scope wysihtml5.Selection.prototype */ { + constructor: function(editor) { + // Make sure that our external range library is initialized + window.rangy.init(); + + this.editor = editor; + this.composer = editor.composer; + this.doc = this.composer.doc; + }, + + /** + * Get the current selection as a bookmark to be able to later restore it + * + * @return {Object} An object that represents the current selection + */ + getBookmark: function() { + var range = this.getRange(); + return range && range.cloneRange(); + }, + + /** + * Restore a selection retrieved via wysihtml5.Selection.prototype.getBookmark + * + * @param {Object} bookmark An object that represents the current selection + */ + setBookmark: function(bookmark) { + if (!bookmark) { + return; + } + + this.setSelection(bookmark); + }, + + /** + * Set the caret in front of the given node + * + * @param {Object} node The element or text node where to position the caret in front of + * @example + * selection.setBefore(myElement); + */ + setBefore: function(node) { + var range = rangy.createRange(this.doc); + range.setStartBefore(node); + range.setEndBefore(node); + return this.setSelection(range); + }, + + /** + * Set the caret after the given node + * + * @param {Object} node The element or text node where to position the caret in front of + * @example + * selection.setBefore(myElement); + */ + setAfter: function(node) { + var range = rangy.createRange(this.doc); + range.setStartAfter(node); + range.setEndAfter(node); + return this.setSelection(range); + }, + + /** + * Ability to select/mark nodes + * + * @param {Element} node The node/element to select + * @example + * selection.selectNode(document.getElementById("my-image")); + */ + selectNode: function(node) { + var range = rangy.createRange(this.doc), + isElement = node.nodeType === wysihtml5.ELEMENT_NODE, + canHaveHTML = "canHaveHTML" in node ? node.canHaveHTML : (node.nodeName !== "IMG"), + content = isElement ? node.innerHTML : node.data, + isEmpty = (content === "" || content === wysihtml5.INVISIBLE_SPACE), + displayStyle = dom.getStyle("display").from(node), + isBlockElement = (displayStyle === "block" || displayStyle === "list-item"); + + if (isEmpty && isElement && canHaveHTML) { + // Make sure that caret is visible in node by inserting a zero width no breaking space + try { node.innerHTML = wysihtml5.INVISIBLE_SPACE; } catch(e) {} + } + + if (canHaveHTML) { + range.selectNodeContents(node); + } else { + range.selectNode(node); + } + + if (canHaveHTML && isEmpty && isElement) { + range.collapse(isBlockElement); + } else if (canHaveHTML && isEmpty) { + range.setStartAfter(node); + range.setEndAfter(node); + } + + this.setSelection(range); + }, + + /** + * Get the node which contains the selection + * + * @param {Boolean} [controlRange] (only IE) Whether it should return the selected ControlRange element when the selection type is a "ControlRange" + * @return {Object} The node that contains the caret + * @example + * var nodeThatContainsCaret = selection.getSelectedNode(); + */ + getSelectedNode: function(controlRange) { + var selection, + range; + + if (controlRange && this.doc.selection && this.doc.selection.type === "Control") { + range = this.doc.selection.createRange(); + if (range && range.length) { + return range.item(0); + } + } + + selection = this.getSelection(this.doc); + if (selection.focusNode === selection.anchorNode) { + return selection.focusNode; + } else { + range = this.getRange(this.doc); + return range ? range.commonAncestorContainer : this.doc.body; + } + }, + + executeAndRestore: function(method, restoreScrollPosition) { + var body = this.doc.body, + oldScrollTop = restoreScrollPosition && body.scrollTop, + oldScrollLeft = restoreScrollPosition && body.scrollLeft, + className = "_wysihtml5-temp-placeholder", + placeholderHTML = '' + wysihtml5.INVISIBLE_SPACE + '', + range = this.getRange(this.doc), + newRange; + + // Nothing selected, execute and say goodbye + if (!range) { + method(body, body); + return; + } + + var node = range.createContextualFragment(placeholderHTML); + range.insertNode(node); + + // Make sure that a potential error doesn't cause our placeholder element to be left as a placeholder + try { + method(range.startContainer, range.endContainer); + } catch(e3) { + setTimeout(function() { throw e3; }, 0); + } + + caretPlaceholder = this.doc.querySelector("." + className); + if (caretPlaceholder) { + newRange = rangy.createRange(this.doc); + newRange.selectNode(caretPlaceholder); + newRange.deleteContents(); + this.setSelection(newRange); + } else { + // fallback for when all hell breaks loose + body.focus(); + } + + if (restoreScrollPosition) { + body.scrollTop = oldScrollTop; + body.scrollLeft = oldScrollLeft; + } + + // Remove it again, just to make sure that the placeholder is definitely out of the dom tree + try { + caretPlaceholder.parentNode.removeChild(caretPlaceholder); + } catch(e4) {} + }, + + /** + * Different approach of preserving the selection (doesn't modify the dom) + * Takes all text nodes in the selection and saves the selection position in the first and last one + */ + executeAndRestoreSimple: function(method) { + var range = this.getRange(), + body = this.doc.body, + newRange, + firstNode, + lastNode, + textNodes, + rangeBackup; + + // Nothing selected, execute and say goodbye + if (!range) { + method(body, body); + return; + } + + textNodes = range.getNodes([3]); + firstNode = textNodes[0] || range.startContainer; + lastNode = textNodes[textNodes.length - 1] || range.endContainer; + + rangeBackup = { + collapsed: range.collapsed, + startContainer: firstNode, + startOffset: firstNode === range.startContainer ? range.startOffset : 0, + endContainer: lastNode, + endOffset: lastNode === range.endContainer ? range.endOffset : lastNode.length + }; + + try { + method(range.startContainer, range.endContainer); + } catch(e) { + setTimeout(function() { throw e; }, 0); + } + + newRange = rangy.createRange(this.doc); + try { newRange.setStart(rangeBackup.startContainer, rangeBackup.startOffset); } catch(e1) {} + try { newRange.setEnd(rangeBackup.endContainer, rangeBackup.endOffset); } catch(e2) {} + try { this.setSelection(newRange); } catch(e3) {} + }, + + /** + * Insert html at the caret position and move the cursor after the inserted html + * + * @param {String} html HTML string to insert + * @example + * selection.insertHTML("

      foobar

      "); + */ + insertHTML: function(html) { + var range = rangy.createRange(this.doc), + node = range.createContextualFragment(html), + lastChild = node.lastChild; + this.insertNode(node); + if (lastChild) { + this.setAfter(lastChild); + } + }, + + /** + * Insert a node at the caret position and move the cursor behind it + * + * @param {Object} node HTML string to insert + * @example + * selection.insertNode(document.createTextNode("foobar")); + */ + insertNode: function(node) { + var range = this.getRange(); + if (range) { + range.insertNode(node); + } + }, + + /** + * Wraps current selection with the given node + * + * @param {Object} node The node to surround the selected elements with + */ + surround: function(node) { + var range = this.getRange(); + if (!range) { + return; + } + + try { + // This only works when the range boundaries are not overlapping other elements + range.surroundContents(node); + this.selectNode(node); + } catch(e) { + // fallback + node.appendChild(range.extractContents()); + range.insertNode(node); + } + }, + + /** + * Scroll the current caret position into the view + * FIXME: This is a bit hacky, there might be a smarter way of doing this + * + * @example + * selection.scrollIntoView(); + */ + scrollIntoView: function() { + var doc = this.doc, + hasScrollBars = doc.documentElement.scrollHeight > doc.documentElement.offsetHeight, + tempElement = doc._wysihtml5ScrollIntoViewElement = doc._wysihtml5ScrollIntoViewElement || (function() { + var element = doc.createElement("span"); + // The element needs content in order to be able to calculate it's position properly + element.innerHTML = wysihtml5.INVISIBLE_SPACE; + return element; + })(), + offsetTop; + + if (hasScrollBars) { + this.insertNode(tempElement); + offsetTop = _getCumulativeOffsetTop(tempElement); + tempElement.parentNode.removeChild(tempElement); + if (offsetTop > doc.body.scrollTop) { + doc.body.scrollTop = offsetTop; + } + } + }, + + /** + * Select line where the caret is in + */ + selectLine: function() { + if (wysihtml5.browser.supportsSelectionModify()) { + this._selectLine_W3C(); + } else if (this.doc.selection) { + this._selectLine_MSIE(); + } + }, + + /** + * See https://developer.mozilla.org/en/DOM/Selection/modify + */ + _selectLine_W3C: function() { + var win = this.doc.defaultView, + selection = win.getSelection(); + selection.modify("extend", "left", "lineboundary"); + selection.modify("extend", "right", "lineboundary"); + }, + + _selectLine_MSIE: function() { + var range = this.doc.selection.createRange(), + rangeTop = range.boundingTop, + rangeHeight = range.boundingHeight, + scrollWidth = this.doc.body.scrollWidth, + rangeBottom, + rangeEnd, + measureNode, + i, + j; + + if (!range.moveToPoint) { + return; + } + + if (rangeTop === 0) { + // Don't know why, but when the selection ends at the end of a line + // range.boundingTop is 0 + measureNode = this.doc.createElement("span"); + this.insertNode(measureNode); + rangeTop = measureNode.offsetTop; + measureNode.parentNode.removeChild(measureNode); + } + + rangeTop += 1; + + for (i=-10; i=0; j--) { + try { + rangeEnd.moveToPoint(j, rangeBottom); + break; + } catch(e2) {} + } + + range.setEndPoint("EndToEnd", rangeEnd); + range.select(); + }, + + getText: function() { + var selection = this.getSelection(); + return selection ? selection.toString() : ""; + }, + + getNodes: function(nodeType, filter) { + var range = this.getRange(); + if (range) { + return range.getNodes([nodeType], filter); + } else { + return []; + } + }, + + getRange: function() { + var selection = this.getSelection(); + return selection && selection.rangeCount && selection.getRangeAt(0); + }, + + getSelection: function() { + return rangy.getSelection(this.doc.defaultView || this.doc.parentWindow); + }, + + setSelection: function(range) { + var win = this.doc.defaultView || this.doc.parentWindow, + selection = rangy.getSelection(win); + return selection.setSingleRange(range); + } + }); + +})(wysihtml5); +/** + * Inspired by the rangy CSS Applier module written by Tim Down and licensed under the MIT license. + * http://code.google.com/p/rangy/ + * + * changed in order to be able ... + * - to use custom tags + * - to detect and replace similar css classes via reg exp + */ +(function(wysihtml5, rangy) { + var defaultTagName = "span"; + + var REG_EXP_WHITE_SPACE = /\s+/g; + + function hasClass(el, cssClass, regExp) { + if (!el.className) { + return false; + } + + var matchingClassNames = el.className.match(regExp) || []; + return matchingClassNames[matchingClassNames.length - 1] === cssClass; + } + + function addClass(el, cssClass, regExp) { + if (el.className) { + removeClass(el, regExp); + el.className += " " + cssClass; + } else { + el.className = cssClass; + } + } + + function removeClass(el, regExp) { + if (el.className) { + el.className = el.className.replace(regExp, ""); + } + } + + function hasSameClasses(el1, el2) { + return el1.className.replace(REG_EXP_WHITE_SPACE, " ") == el2.className.replace(REG_EXP_WHITE_SPACE, " "); + } + + function replaceWithOwnChildren(el) { + var parent = el.parentNode; + while (el.firstChild) { + parent.insertBefore(el.firstChild, el); + } + parent.removeChild(el); + } + + function elementsHaveSameNonClassAttributes(el1, el2) { + if (el1.attributes.length != el2.attributes.length) { + return false; + } + for (var i = 0, len = el1.attributes.length, attr1, attr2, name; i < len; ++i) { + attr1 = el1.attributes[i]; + name = attr1.name; + if (name != "class") { + attr2 = el2.attributes.getNamedItem(name); + if (attr1.specified != attr2.specified) { + return false; + } + if (attr1.specified && attr1.nodeValue !== attr2.nodeValue) { + return false; + } + } + } + return true; + } + + function isSplitPoint(node, offset) { + if (rangy.dom.isCharacterDataNode(node)) { + if (offset == 0) { + return !!node.previousSibling; + } else if (offset == node.length) { + return !!node.nextSibling; + } else { + return true; + } + } + + return offset > 0 && offset < node.childNodes.length; + } + + function splitNodeAt(node, descendantNode, descendantOffset) { + var newNode; + if (rangy.dom.isCharacterDataNode(descendantNode)) { + if (descendantOffset == 0) { + descendantOffset = rangy.dom.getNodeIndex(descendantNode); + descendantNode = descendantNode.parentNode; + } else if (descendantOffset == descendantNode.length) { + descendantOffset = rangy.dom.getNodeIndex(descendantNode) + 1; + descendantNode = descendantNode.parentNode; + } else { + newNode = rangy.dom.splitDataNode(descendantNode, descendantOffset); + } + } + if (!newNode) { + newNode = descendantNode.cloneNode(false); + if (newNode.id) { + newNode.removeAttribute("id"); + } + var child; + while ((child = descendantNode.childNodes[descendantOffset])) { + newNode.appendChild(child); + } + rangy.dom.insertAfter(newNode, descendantNode); + } + return (descendantNode == node) ? newNode : splitNodeAt(node, newNode.parentNode, rangy.dom.getNodeIndex(newNode)); + } + + function Merge(firstNode) { + this.isElementMerge = (firstNode.nodeType == wysihtml5.ELEMENT_NODE); + this.firstTextNode = this.isElementMerge ? firstNode.lastChild : firstNode; + this.textNodes = [this.firstTextNode]; + } + + Merge.prototype = { + doMerge: function() { + var textBits = [], textNode, parent, text; + for (var i = 0, len = this.textNodes.length; i < len; ++i) { + textNode = this.textNodes[i]; + parent = textNode.parentNode; + textBits[i] = textNode.data; + if (i) { + parent.removeChild(textNode); + if (!parent.hasChildNodes()) { + parent.parentNode.removeChild(parent); + } + } + } + this.firstTextNode.data = text = textBits.join(""); + return text; + }, + + getLength: function() { + var i = this.textNodes.length, len = 0; + while (i--) { + len += this.textNodes[i].length; + } + return len; + }, + + toString: function() { + var textBits = []; + for (var i = 0, len = this.textNodes.length; i < len; ++i) { + textBits[i] = "'" + this.textNodes[i].data + "'"; + } + return "[Merge(" + textBits.join(",") + ")]"; + } + }; + + function HTMLApplier(tagNames, cssClass, similarClassRegExp, normalize) { + this.tagNames = tagNames || [defaultTagName]; + this.cssClass = cssClass || ""; + this.similarClassRegExp = similarClassRegExp; + this.normalize = normalize; + this.applyToAnyTagName = false; + } + + HTMLApplier.prototype = { + getAncestorWithClass: function(node) { + var cssClassMatch; + while (node) { + cssClassMatch = this.cssClass ? hasClass(node, this.cssClass, this.similarClassRegExp) : true; + if (node.nodeType == wysihtml5.ELEMENT_NODE && rangy.dom.arrayContains(this.tagNames, node.tagName.toLowerCase()) && cssClassMatch) { + return node; + } + node = node.parentNode; + } + return false; + }, + + // Normalizes nodes after applying a CSS class to a Range. + postApply: function(textNodes, range) { + var firstNode = textNodes[0], lastNode = textNodes[textNodes.length - 1]; + + var merges = [], currentMerge; + + var rangeStartNode = firstNode, rangeEndNode = lastNode; + var rangeStartOffset = 0, rangeEndOffset = lastNode.length; + + var textNode, precedingTextNode; + + for (var i = 0, len = textNodes.length; i < len; ++i) { + textNode = textNodes[i]; + precedingTextNode = this.getAdjacentMergeableTextNode(textNode.parentNode, false); + if (precedingTextNode) { + if (!currentMerge) { + currentMerge = new Merge(precedingTextNode); + merges.push(currentMerge); + } + currentMerge.textNodes.push(textNode); + if (textNode === firstNode) { + rangeStartNode = currentMerge.firstTextNode; + rangeStartOffset = rangeStartNode.length; + } + if (textNode === lastNode) { + rangeEndNode = currentMerge.firstTextNode; + rangeEndOffset = currentMerge.getLength(); + } + } else { + currentMerge = null; + } + } + + // Test whether the first node after the range needs merging + var nextTextNode = this.getAdjacentMergeableTextNode(lastNode.parentNode, true); + if (nextTextNode) { + if (!currentMerge) { + currentMerge = new Merge(lastNode); + merges.push(currentMerge); + } + currentMerge.textNodes.push(nextTextNode); + } + + // Do the merges + if (merges.length) { + for (i = 0, len = merges.length; i < len; ++i) { + merges[i].doMerge(); + } + // Set the range boundaries + range.setStart(rangeStartNode, rangeStartOffset); + range.setEnd(rangeEndNode, rangeEndOffset); + } + }, + + getAdjacentMergeableTextNode: function(node, forward) { + var isTextNode = (node.nodeType == wysihtml5.TEXT_NODE); + var el = isTextNode ? node.parentNode : node; + var adjacentNode; + var propName = forward ? "nextSibling" : "previousSibling"; + if (isTextNode) { + // Can merge if the node's previous/next sibling is a text node + adjacentNode = node[propName]; + if (adjacentNode && adjacentNode.nodeType == wysihtml5.TEXT_NODE) { + return adjacentNode; + } + } else { + // Compare element with its sibling + adjacentNode = el[propName]; + if (adjacentNode && this.areElementsMergeable(node, adjacentNode)) { + return adjacentNode[forward ? "firstChild" : "lastChild"]; + } + } + return null; + }, + + areElementsMergeable: function(el1, el2) { + return rangy.dom.arrayContains(this.tagNames, (el1.tagName || "").toLowerCase()) + && rangy.dom.arrayContains(this.tagNames, (el2.tagName || "").toLowerCase()) + && hasSameClasses(el1, el2) + && elementsHaveSameNonClassAttributes(el1, el2); + }, + + createContainer: function(doc) { + var el = doc.createElement(this.tagNames[0]); + if (this.cssClass) { + el.className = this.cssClass; + } + return el; + }, + + applyToTextNode: function(textNode) { + var parent = textNode.parentNode; + if (parent.childNodes.length == 1 && rangy.dom.arrayContains(this.tagNames, parent.tagName.toLowerCase())) { + if (this.cssClass) { + addClass(parent, this.cssClass, this.similarClassRegExp); + } + } else { + var el = this.createContainer(rangy.dom.getDocument(textNode)); + textNode.parentNode.insertBefore(el, textNode); + el.appendChild(textNode); + } + }, + + isRemovable: function(el) { + return rangy.dom.arrayContains(this.tagNames, el.tagName.toLowerCase()) && wysihtml5.lang.string(el.className).trim() == this.cssClass; + }, + + undoToTextNode: function(textNode, range, ancestorWithClass) { + if (!range.containsNode(ancestorWithClass)) { + // Split out the portion of the ancestor from which we can remove the CSS class + var ancestorRange = range.cloneRange(); + ancestorRange.selectNode(ancestorWithClass); + + if (ancestorRange.isPointInRange(range.endContainer, range.endOffset) && isSplitPoint(range.endContainer, range.endOffset)) { + splitNodeAt(ancestorWithClass, range.endContainer, range.endOffset); + range.setEndAfter(ancestorWithClass); + } + if (ancestorRange.isPointInRange(range.startContainer, range.startOffset) && isSplitPoint(range.startContainer, range.startOffset)) { + ancestorWithClass = splitNodeAt(ancestorWithClass, range.startContainer, range.startOffset); + } + } + + if (this.similarClassRegExp) { + removeClass(ancestorWithClass, this.similarClassRegExp); + } + if (this.isRemovable(ancestorWithClass)) { + replaceWithOwnChildren(ancestorWithClass); + } + }, + + applyToRange: function(range) { + var textNodes = range.getNodes([wysihtml5.TEXT_NODE]); + if (!textNodes.length) { + try { + var node = this.createContainer(range.endContainer.ownerDocument); + range.surroundContents(node); + this.selectNode(range, node); + return; + } catch(e) {} + } + + range.splitBoundaries(); + textNodes = range.getNodes([wysihtml5.TEXT_NODE]); + + if (textNodes.length) { + var textNode; + + for (var i = 0, len = textNodes.length; i < len; ++i) { + textNode = textNodes[i]; + if (!this.getAncestorWithClass(textNode)) { + this.applyToTextNode(textNode); + } + } + + range.setStart(textNodes[0], 0); + textNode = textNodes[textNodes.length - 1]; + range.setEnd(textNode, textNode.length); + + if (this.normalize) { + this.postApply(textNodes, range); + } + } + }, + + undoToRange: function(range) { + var textNodes = range.getNodes([wysihtml5.TEXT_NODE]), textNode, ancestorWithClass; + if (textNodes.length) { + range.splitBoundaries(); + textNodes = range.getNodes([wysihtml5.TEXT_NODE]); + } else { + var doc = range.endContainer.ownerDocument, + node = doc.createTextNode(wysihtml5.INVISIBLE_SPACE); + range.insertNode(node); + range.selectNode(node); + textNodes = [node]; + } + + for (var i = 0, len = textNodes.length; i < len; ++i) { + textNode = textNodes[i]; + ancestorWithClass = this.getAncestorWithClass(textNode); + if (ancestorWithClass) { + this.undoToTextNode(textNode, range, ancestorWithClass); + } + } + + if (len == 1) { + this.selectNode(range, textNodes[0]); + } else { + range.setStart(textNodes[0], 0); + textNode = textNodes[textNodes.length - 1]; + range.setEnd(textNode, textNode.length); + + if (this.normalize) { + this.postApply(textNodes, range); + } + } + }, + + selectNode: function(range, node) { + var isElement = node.nodeType === wysihtml5.ELEMENT_NODE, + canHaveHTML = "canHaveHTML" in node ? node.canHaveHTML : true, + content = isElement ? node.innerHTML : node.data, + isEmpty = (content === "" || content === wysihtml5.INVISIBLE_SPACE); + + if (isEmpty && isElement && canHaveHTML) { + // Make sure that caret is visible in node by inserting a zero width no breaking space + try { node.innerHTML = wysihtml5.INVISIBLE_SPACE; } catch(e) {} + } + range.selectNodeContents(node); + if (isEmpty && isElement) { + range.collapse(false); + } else if (isEmpty) { + range.setStartAfter(node); + range.setEndAfter(node); + } + }, + + getTextSelectedByRange: function(textNode, range) { + var textRange = range.cloneRange(); + textRange.selectNodeContents(textNode); + + var intersectionRange = textRange.intersection(range); + var text = intersectionRange ? intersectionRange.toString() : ""; + textRange.detach(); + + return text; + }, + + isAppliedToRange: function(range) { + var ancestors = [], + ancestor, + textNodes = range.getNodes([wysihtml5.TEXT_NODE]); + if (!textNodes.length) { + ancestor = this.getAncestorWithClass(range.startContainer); + return ancestor ? [ancestor] : false; + } + + for (var i = 0, len = textNodes.length, selectedText; i < len; ++i) { + selectedText = this.getTextSelectedByRange(textNodes[i], range); + ancestor = this.getAncestorWithClass(textNodes[i]); + if (selectedText != "" && !ancestor) { + return false; + } else { + ancestors.push(ancestor); + } + } + return ancestors; + }, + + toggleRange: function(range) { + if (this.isAppliedToRange(range)) { + this.undoToRange(range); + } else { + this.applyToRange(range); + } + } + }; + + wysihtml5.selection.HTMLApplier = HTMLApplier; + +})(wysihtml5, rangy);/** + * Rich Text Query/Formatting Commands + * + * @example + * var commands = new wysihtml5.Commands(editor); + */ +wysihtml5.Commands = Base.extend( + /** @scope wysihtml5.Commands.prototype */ { + constructor: function(editor) { + this.editor = editor; + this.composer = editor.composer; + this.doc = this.composer.doc; + }, + + /** + * Check whether the browser supports the given command + * + * @param {String} command The command string which to check (eg. "bold", "italic", "insertUnorderedList") + * @example + * commands.supports("createLink"); + */ + support: function(command) { + return wysihtml5.browser.supportsCommand(this.doc, command); + }, + + /** + * Check whether the browser supports the given command + * + * @param {String} command The command string which to execute (eg. "bold", "italic", "insertUnorderedList") + * @param {String} [value] The command value parameter, needed for some commands ("createLink", "insertImage", ...), optional for commands that don't require one ("bold", "underline", ...) + * @example + * commands.exec("insertImage", "http://a1.twimg.com/profile_images/113868655/schrei_twitter_reasonably_small.jpg"); + */ + exec: function(command, value) { + var obj = wysihtml5.commands[command], + args = wysihtml5.lang.array(arguments).get(), + method = obj && obj.exec, + result = null; + + this.editor.fire("beforecommand:composer"); + + if (method) { + args.unshift(this.composer); + result = method.apply(obj, args); + } else { + try { + // try/catch for buggy firefox + result = this.doc.execCommand(command, false, value); + } catch(e) {} + } + + this.editor.fire("aftercommand:composer"); + return result; + }, + + /** + * Check whether the current command is active + * If the caret is within a bold text, then calling this with command "bold" should return true + * + * @param {String} command The command string which to check (eg. "bold", "italic", "insertUnorderedList") + * @param {String} [commandValue] The command value parameter (eg. for "insertImage" the image src) + * @return {Boolean} Whether the command is active + * @example + * var isCurrentSelectionBold = commands.state("bold"); + */ + state: function(command, commandValue) { + var obj = wysihtml5.commands[command], + args = wysihtml5.lang.array(arguments).get(), + method = obj && obj.state; + if (method) { + args.unshift(this.composer); + return method.apply(obj, args); + } else { + try { + // try/catch for buggy firefox + return this.doc.queryCommandState(command); + } catch(e) { + return false; + } + } + }, + + /** + * Get the current command's value + * + * @param {String} command The command string which to check (eg. "formatBlock") + * @return {String} The command value + * @example + * var currentBlockElement = commands.value("formatBlock"); + */ + value: function(command) { + var obj = wysihtml5.commands[command], + method = obj && obj.value; + if (method) { + return method.call(obj, this.composer, command); + } else { + try { + // try/catch for buggy firefox + return this.doc.queryCommandValue(command); + } catch(e) { + return null; + } + } + } +}); +(function(wysihtml5) { + var undef; + + wysihtml5.commands.bold = { + exec: function(composer, command) { + return wysihtml5.commands.formatInline.exec(composer, command, "b"); + }, + + state: function(composer, command, color) { + // element.ownerDocument.queryCommandState("bold") results: + // firefox: only + // chrome: , ,

      ,

      , ... + // ie: , + // opera: , + return wysihtml5.commands.formatInline.state(composer, command, "b"); + }, + + value: function() { + return undef; + } + }; +})(wysihtml5); + +(function(wysihtml5) { + var undef, + NODE_NAME = "A", + dom = wysihtml5.dom; + + function _removeFormat(composer, anchors) { + var length = anchors.length, + i = 0, + anchor, + codeElement, + textContent; + for (; i contains url-like text content, rename it to to prevent re-autolinking + // else replace with its childNodes + if (textContent.match(dom.autoLink.URL_REG_EXP) && !codeElement) { + // element is used to prevent later auto-linking of the content + codeElement = dom.renameElement(anchor, "code"); + } else { + dom.replaceWithChildNodes(anchor); + } + } + } + + function _format(composer, attributes) { + var doc = composer.doc, + tempClass = "_wysihtml5-temp-" + (+new Date()), + tempClassRegExp = /non-matching-class/g, + i = 0, + length, + anchors, + anchor, + hasElementChild, + isEmpty, + elementToSetCaretAfter, + textContent, + whiteSpace, + j; + wysihtml5.commands.formatInline.exec(composer, undef, NODE_NAME, tempClass, tempClassRegExp); + anchors = doc.querySelectorAll(NODE_NAME + "." + tempClass); + length = anchors.length; + for (; i element + * The element is needed to avoid auto linking + * + * @example + * // either ... + * wysihtml5.commands.createLink.exec(composer, "createLink", "http://www.google.de"); + * // ... or ... + * wysihtml5.commands.createLink.exec(composer, "createLink", { href: "http://www.google.de", target: "_blank" }); + */ + exec: function(composer, command, value) { + var anchors = this.state(composer, command); + if (anchors) { + // Selection contains links + composer.selection.executeAndRestore(function() { + _removeFormat(composer, anchors); + }); + } else { + // Create links + value = typeof(value) === "object" ? value : { href: value }; + _format(composer, value); + } + }, + + state: function(composer, command) { + return wysihtml5.commands.formatInline.state(composer, command, "A"); + }, + + value: function() { + return undef; + } + }; +})(wysihtml5);/** + * document.execCommand("fontSize") will create either inline styles (firefox, chrome) or use font tags + * which we don't want + * Instead we set a css class + */ +(function(wysihtml5) { + var undef, + REG_EXP = /wysiwyg-font-size-[a-z\-]+/g; + + wysihtml5.commands.fontSize = { + exec: function(composer, command, size) { + return wysihtml5.commands.formatInline.exec(composer, command, "span", "wysiwyg-font-size-" + size, REG_EXP); + }, + + state: function(composer, command, size) { + return wysihtml5.commands.formatInline.state(composer, command, "span", "wysiwyg-font-size-" + size, REG_EXP); + }, + + value: function() { + return undef; + } + }; +})(wysihtml5); +/** + * document.execCommand("foreColor") will create either inline styles (firefox, chrome) or use font tags + * which we don't want + * Instead we set a css class + */ +(function(wysihtml5) { + var undef, + REG_EXP = /wysiwyg-color-[a-z]+/g; + + wysihtml5.commands.foreColor = { + exec: function(composer, command, color) { + return wysihtml5.commands.formatInline.exec(composer, command, "span", "wysiwyg-color-" + color, REG_EXP); + }, + + state: function(composer, command, color) { + return wysihtml5.commands.formatInline.state(composer, command, "span", "wysiwyg-color-" + color, REG_EXP); + }, + + value: function() { + return undef; + } + }; +})(wysihtml5);(function(wysihtml5) { + var undef, + dom = wysihtml5.dom, + DEFAULT_NODE_NAME = "DIV", + // Following elements are grouped + // when the caret is within a H1 and the H4 is invoked, the H1 should turn into H4 + // instead of creating a H4 within a H1 which would result in semantically invalid html + BLOCK_ELEMENTS_GROUP = ["H1", "H2", "H3", "H4", "H5", "H6", "P", "BLOCKQUOTE", DEFAULT_NODE_NAME]; + + /** + * Remove similiar classes (based on classRegExp) + * and add the desired class name + */ + function _addClass(element, className, classRegExp) { + if (element.className) { + _removeClass(element, classRegExp); + element.className += " " + className; + } else { + element.className = className; + } + } + + function _removeClass(element, classRegExp) { + element.className = element.className.replace(classRegExp, ""); + } + + /** + * Check whether given node is a text node and whether it's empty + */ + function _isBlankTextNode(node) { + return node.nodeType === wysihtml5.TEXT_NODE && !wysihtml5.lang.string(node.data).trim(); + } + + /** + * Returns previous sibling node that is not a blank text node + */ + function _getPreviousSiblingThatIsNotBlank(node) { + var previousSibling = node.previousSibling; + while (previousSibling && _isBlankTextNode(previousSibling)) { + previousSibling = previousSibling.previousSibling; + } + return previousSibling; + } + + /** + * Returns next sibling node that is not a blank text node + */ + function _getNextSiblingThatIsNotBlank(node) { + var nextSibling = node.nextSibling; + while (nextSibling && _isBlankTextNode(nextSibling)) { + nextSibling = nextSibling.nextSibling; + } + return nextSibling; + } + + /** + * Adds line breaks before and after the given node if the previous and next siblings + * aren't already causing a visual line break (block element or
      ) + */ + function _addLineBreakBeforeAndAfter(node) { + var doc = node.ownerDocument, + nextSibling = _getNextSiblingThatIsNotBlank(node), + previousSibling = _getPreviousSiblingThatIsNotBlank(node); + + if (nextSibling && !_isLineBreakOrBlockElement(nextSibling)) { + node.parentNode.insertBefore(doc.createElement("br"), nextSibling); + } + if (previousSibling && !_isLineBreakOrBlockElement(previousSibling)) { + node.parentNode.insertBefore(doc.createElement("br"), node); + } + } + + /** + * Removes line breaks before and after the given node + */ + function _removeLineBreakBeforeAndAfter(node) { + var nextSibling = _getNextSiblingThatIsNotBlank(node), + previousSibling = _getPreviousSiblingThatIsNotBlank(node); + + if (nextSibling && _isLineBreak(nextSibling)) { + nextSibling.parentNode.removeChild(nextSibling); + } + if (previousSibling && _isLineBreak(previousSibling)) { + previousSibling.parentNode.removeChild(previousSibling); + } + } + + function _removeLastChildIfLineBreak(node) { + var lastChild = node.lastChild; + if (lastChild && _isLineBreak(lastChild)) { + lastChild.parentNode.removeChild(lastChild); + } + } + + function _isLineBreak(node) { + + return node.nodeName === "BR"; + } + + /** + * Checks whether the elment causes a visual line break + * (
      or block elements) + */ + function _isLineBreakOrBlockElement(element) { + if (_isLineBreak(element)) { + return true; + } + + if (dom.getStyle("display").from(element) === "block") { + return true; + } + + return false; + } + + /** + * Execute native query command + * and if necessary modify the inserted node's className + */ + function _execCommand(doc, command, nodeName, className) { + if (className) { + var eventListener = dom.observe(doc, "DOMNodeInserted", function(event) { + var target = event.target, + displayStyle; + if (target.nodeType !== wysihtml5.ELEMENT_NODE) { + return; + } + displayStyle = dom.getStyle("display").from(target); + if (displayStyle.substr(0, 6) !== "inline") { + // Make sure that only block elements receive the given class + target.className += " " + className; + } + }); + } + doc.execCommand(command, false, nodeName); + if (eventListener) { + eventListener.stop(); + } + } + + function _selectLineAndWrap(composer, element) { + composer.selection.selectLine(); + composer.selection.surround(element); + _removeLineBreakBeforeAndAfter(element); + _removeLastChildIfLineBreak(element); + composer.selection.selectNode(element); + } + + function _hasClasses(element) { + return !!wysihtml5.lang.string(element.className).trim(); + } + + wysihtml5.commands.formatBlock = { + exec: function(composer, command, nodeName, className, classRegExp) { + var doc = composer.doc, + blockElement = this.state(composer, command, nodeName, className, classRegExp), + selectedNode; + + nodeName = typeof(nodeName) === "string" ? nodeName.toUpperCase() : nodeName; + + if (blockElement) { + composer.selection.executeAndRestoreSimple(function() { + if (classRegExp) { + _removeClass(blockElement, classRegExp); + } + var hasClasses = _hasClasses(blockElement); + if (!hasClasses && blockElement.nodeName === (nodeName || DEFAULT_NODE_NAME)) { + // Insert a line break afterwards and beforewards when there are siblings + // that are not of type line break or block element + _addLineBreakBeforeAndAfter(blockElement); + dom.replaceWithChildNodes(blockElement); + } else if (hasClasses) { + // Make sure that styling is kept by renaming the element to
      and copying over the class name + dom.renameElement(blockElement, DEFAULT_NODE_NAME); + } + }); + return; + } + + // Find similiar block element and rename it (

      =>

      ) + if (nodeName === null || wysihtml5.lang.array(BLOCK_ELEMENTS_GROUP).contains(nodeName)) { + selectedNode = composer.selection.getSelectedNode(); + blockElement = dom.getParentElement(selectedNode, { + nodeName: BLOCK_ELEMENTS_GROUP + }); + + if (blockElement) { + composer.selection.executeAndRestoreSimple(function() { + // Rename current block element to new block element and add class + if (nodeName) { + blockElement = dom.renameElement(blockElement, nodeName); + } + if (className) { + _addClass(blockElement, className, classRegExp); + } + }); + return; + } + } + + if (composer.commands.support(command)) { + _execCommand(doc, command, nodeName || DEFAULT_NODE_NAME, className); + return; + } + + blockElement = doc.createElement(nodeName || DEFAULT_NODE_NAME); + if (className) { + blockElement.className = className; + } + _selectLineAndWrap(composer, blockElement); + }, + + state: function(composer, command, nodeName, className, classRegExp) { + nodeName = typeof(nodeName) === "string" ? nodeName.toUpperCase() : nodeName; + var selectedNode = composer.selection.getSelectedNode(); + return dom.getParentElement(selectedNode, { + nodeName: nodeName, + className: className, + classRegExp: classRegExp + }); + }, + + value: function() { + return undef; + } + }; +})(wysihtml5);/** + * formatInline scenarios for tag "B" (| = caret, |foo| = selected text) + * + * #1 caret in unformatted text: + * abcdefg| + * output: + * abcdefg| + * + * #2 unformatted text selected: + * abc|deg|h + * output: + * abc|deg|h + * + * #3 unformatted text selected across boundaries: + * ab|c defg|h + * output: + * ab|c defg|h + * + * #4 formatted text entirely selected + * |abc| + * output: + * |abc| + * + * #5 formatted text partially selected + * ab|c| + * output: + * ab|c| + * + * #6 formatted text selected across boundaries + * ab|c de|fgh + * output: + * ab|c de|fgh + */ +(function(wysihtml5) { + var undef, + // Treat as and vice versa + ALIAS_MAPPING = { + "strong": "b", + "em": "i", + "b": "strong", + "i": "em" + }, + htmlApplier = {}; + + function _getTagNames(tagName) { + var alias = ALIAS_MAPPING[tagName]; + return alias ? [tagName.toLowerCase(), alias.toLowerCase()] : [tagName.toLowerCase()]; + } + + function _getApplier(tagName, className, classRegExp) { + var identifier = tagName + ":" + className; + if (!htmlApplier[identifier]) { + htmlApplier[identifier] = new wysihtml5.selection.HTMLApplier(_getTagNames(tagName), className, classRegExp, true); + } + return htmlApplier[identifier]; + } + + wysihtml5.commands.formatInline = { + exec: function(composer, command, tagName, className, classRegExp) { + var range = composer.selection.getRange(); + if (!range) { + return false; + } + _getApplier(tagName, className, classRegExp).toggleRange(range); + composer.selection.setSelection(range); + }, + + state: function(composer, command, tagName, className, classRegExp) { + var doc = composer.doc, + aliasTagName = ALIAS_MAPPING[tagName] || tagName, + range; + + // Check whether the document contains a node with the desired tagName + if (!wysihtml5.dom.hasElementWithTagName(doc, tagName) && + !wysihtml5.dom.hasElementWithTagName(doc, aliasTagName)) { + return false; + } + + // Check whether the document contains a node with the desired className + if (className && !wysihtml5.dom.hasElementWithClassName(doc, className)) { + return false; + } + + range = composer.selection.getRange(); + if (!range) { + return false; + } + + return _getApplier(tagName, className, classRegExp).isAppliedToRange(range); + }, + + value: function() { + return undef; + } + }; +})(wysihtml5);(function(wysihtml5) { + var undef; + + wysihtml5.commands.insertHTML = { + exec: function(composer, command, html) { + if (composer.commands.support(command)) { + composer.doc.execCommand(command, false, html); + } else { + composer.selection.insertHTML(html); + } + }, + + state: function() { + return false; + }, + + value: function() { + return undef; + } + }; +})(wysihtml5);(function(wysihtml5) { + var NODE_NAME = "IMG"; + + wysihtml5.commands.insertImage = { + /** + * Inserts an + * If selection is already an image link, it removes it + * + * @example + * // either ... + * wysihtml5.commands.insertImage.exec(composer, "insertImage", "http://www.google.de/logo.jpg"); + * // ... or ... + * wysihtml5.commands.insertImage.exec(composer, "insertImage", { src: "http://www.google.de/logo.jpg", title: "foo" }); + */ + exec: function(composer, command, value) { + value = typeof(value) === "object" ? value : { src: value }; + + var doc = composer.doc, + image = this.state(composer), + textNode, + i, + parent; + + if (image) { + // Image already selected, set the caret before it and delete it + composer.selection.setBefore(image); + parent = image.parentNode; + parent.removeChild(image); + + // and it's parent
      too if it hasn't got any other relevant child nodes + wysihtml5.dom.removeEmptyTextNodes(parent); + if (parent.nodeName === "A" && !parent.firstChild) { + composer.selection.setAfter(parent); + parent.parentNode.removeChild(parent); + } + + // firefox and ie sometimes don't remove the image handles, even though the image got removed + wysihtml5.quirks.redraw(composer.element); + return; + } + + image = doc.createElement(NODE_NAME); + + for (i in value) { + image[i] = value[i]; + } + + composer.selection.insertNode(image); + if (wysihtml5.browser.hasProblemsSettingCaretAfterImg()) { + textNode = doc.createTextNode(wysihtml5.INVISIBLE_SPACE); + composer.selection.insertNode(textNode); + composer.selection.setAfter(textNode); + } else { + composer.selection.setAfter(image); + } + }, + + state: function(composer) { + var doc = composer.doc, + selectedNode, + text, + imagesInSelection; + + if (!wysihtml5.dom.hasElementWithTagName(doc, NODE_NAME)) { + return false; + } + + selectedNode = composer.selection.getSelectedNode(); + if (!selectedNode) { + return false; + } + + if (selectedNode.nodeName === NODE_NAME) { + // This works perfectly in IE + return selectedNode; + } + + if (selectedNode.nodeType !== wysihtml5.ELEMENT_NODE) { + return false; + } + + text = composer.selection.getText(); + text = wysihtml5.lang.string(text).trim(); + if (text) { + return false; + } + + imagesInSelection = composer.selection.getNodes(wysihtml5.ELEMENT_NODE, function(node) { + return node.nodeName === "IMG"; + }); + + if (imagesInSelection.length !== 1) { + return false; + } + + return imagesInSelection[0]; + }, + + value: function(composer) { + var image = this.state(composer); + return image && image.src; + } + }; +})(wysihtml5);(function(wysihtml5) { + var undef, + LINE_BREAK = "
      " + (wysihtml5.browser.needsSpaceAfterLineBreak() ? " " : ""); + + wysihtml5.commands.insertLineBreak = { + exec: function(composer, command) { + if (composer.commands.support(command)) { + composer.doc.execCommand(command, false, null); + if (!wysihtml5.browser.autoScrollsToCaret()) { + composer.selection.scrollIntoView(); + } + } else { + composer.commands.exec("insertHTML", LINE_BREAK); + } + }, + + state: function() { + return false; + }, + + value: function() { + return undef; + } + }; +})(wysihtml5);(function(wysihtml5) { + var undef; + + wysihtml5.commands.insertOrderedList = { + exec: function(composer, command) { + var doc = composer.doc, + selectedNode = composer.selection.getSelectedNode(), + list = wysihtml5.dom.getParentElement(selectedNode, { nodeName: "OL" }), + otherList = wysihtml5.dom.getParentElement(selectedNode, { nodeName: "UL" }), + tempClassName = "_wysihtml5-temp-" + new Date().getTime(), + isEmpty, + tempElement; + + if (composer.commands.support(command)) { + doc.execCommand(command, false, null); + return; + } + + if (list) { + // Unwrap list + //
      1. foo
      2. bar
      + // becomes: + // foo
      bar
      + composer.selection.executeAndRestoreSimple(function() { + wysihtml5.dom.resolveList(list); + }); + } else if (otherList) { + // Turn an unordered list into an ordered list + //
      • foo
      • bar
      + // becomes: + //
      1. foo
      2. bar
      + composer.selection.executeAndRestoreSimple(function() { + wysihtml5.dom.renameElement(otherList, "ol"); + }); + } else { + // Create list + composer.commands.exec("formatBlock", "div", tempClassName); + tempElement = doc.querySelector("." + tempClassName); + isEmpty = tempElement.innerHTML === "" || tempElement.innerHTML === wysihtml5.INVISIBLE_SPACE; + composer.selection.executeAndRestoreSimple(function() { + list = wysihtml5.dom.convertToList(tempElement, "ol"); + }); + if (isEmpty) { + composer.selection.selectNode(list.querySelector("li")); + } + } + }, + + state: function(composer) { + var selectedNode = composer.selection.getSelectedNode(); + return wysihtml5.dom.getParentElement(selectedNode, { nodeName: "OL" }); + }, + + value: function() { + return undef; + } + }; +})(wysihtml5);(function(wysihtml5) { + var undef; + + wysihtml5.commands.insertUnorderedList = { + exec: function(composer, command) { + var doc = composer.doc, + selectedNode = composer.selection.getSelectedNode(), + list = wysihtml5.dom.getParentElement(selectedNode, { nodeName: "UL" }), + otherList = wysihtml5.dom.getParentElement(selectedNode, { nodeName: "OL" }), + tempClassName = "_wysihtml5-temp-" + new Date().getTime(), + isEmpty, + tempElement; + + if (composer.commands.support(command)) { + doc.execCommand(command, false, null); + return; + } + + if (list) { + // Unwrap list + //
      • foo
      • bar
      + // becomes: + // foo
      bar
      + composer.selection.executeAndRestoreSimple(function() { + wysihtml5.dom.resolveList(list); + }); + } else if (otherList) { + // Turn an ordered list into an unordered list + //
      1. foo
      2. bar
      + // becomes: + //
      • foo
      • bar
      + composer.selection.executeAndRestoreSimple(function() { + wysihtml5.dom.renameElement(otherList, "ul"); + }); + } else { + // Create list + composer.commands.exec("formatBlock", "div", tempClassName); + tempElement = doc.querySelector("." + tempClassName); + isEmpty = tempElement.innerHTML === "" || tempElement.innerHTML === wysihtml5.INVISIBLE_SPACE; + composer.selection.executeAndRestoreSimple(function() { + list = wysihtml5.dom.convertToList(tempElement, "ul"); + }); + if (isEmpty) { + composer.selection.selectNode(list.querySelector("li")); + } + } + }, + + state: function(composer) { + var selectedNode = composer.selection.getSelectedNode(); + return wysihtml5.dom.getParentElement(selectedNode, { nodeName: "UL" }); + }, + + value: function() { + return undef; + } + }; +})(wysihtml5);(function(wysihtml5) { + var undef; + + wysihtml5.commands.italic = { + exec: function(composer, command) { + return wysihtml5.commands.formatInline.exec(composer, command, "i"); + }, + + state: function(composer, command, color) { + // element.ownerDocument.queryCommandState("italic") results: + // firefox: only + // chrome: , ,
      , ... + // ie: , + // opera: only + return wysihtml5.commands.formatInline.state(composer, command, "i"); + }, + + value: function() { + return undef; + } + }; +})(wysihtml5);(function(wysihtml5) { + var undef, + CLASS_NAME = "wysiwyg-text-align-center", + REG_EXP = /wysiwyg-text-align-[a-z]+/g; + + wysihtml5.commands.justifyCenter = { + exec: function(composer, command) { + return wysihtml5.commands.formatBlock.exec(composer, "formatBlock", null, CLASS_NAME, REG_EXP); + }, + + state: function(composer, command) { + return wysihtml5.commands.formatBlock.state(composer, "formatBlock", null, CLASS_NAME, REG_EXP); + }, + + value: function() { + return undef; + } + }; +})(wysihtml5);(function(wysihtml5) { + var undef, + CLASS_NAME = "wysiwyg-text-align-left", + REG_EXP = /wysiwyg-text-align-[a-z]+/g; + + wysihtml5.commands.justifyLeft = { + exec: function(composer, command) { + return wysihtml5.commands.formatBlock.exec(composer, "formatBlock", null, CLASS_NAME, REG_EXP); + }, + + state: function(composer, command) { + return wysihtml5.commands.formatBlock.state(composer, "formatBlock", null, CLASS_NAME, REG_EXP); + }, + + value: function() { + return undef; + } + }; +})(wysihtml5);(function(wysihtml5) { + var undef, + CLASS_NAME = "wysiwyg-text-align-right", + REG_EXP = /wysiwyg-text-align-[a-z]+/g; + + wysihtml5.commands.justifyRight = { + exec: function(composer, command) { + return wysihtml5.commands.formatBlock.exec(composer, "formatBlock", null, CLASS_NAME, REG_EXP); + }, + + state: function(composer, command) { + return wysihtml5.commands.formatBlock.state(composer, "formatBlock", null, CLASS_NAME, REG_EXP); + }, + + value: function() { + return undef; + } + }; +})(wysihtml5);(function(wysihtml5) { + var undef; + wysihtml5.commands.underline = { + exec: function(composer, command) { + return wysihtml5.commands.formatInline.exec(composer, command, "u"); + }, + + state: function(composer, command) { + return wysihtml5.commands.formatInline.state(composer, command, "u"); + }, + + value: function() { + return undef; + } + }; +})(wysihtml5);/** + * Undo Manager for wysihtml5 + * slightly inspired by http://rniwa.com/editing/undomanager.html#the-undomanager-interface + */ +(function(wysihtml5) { + var Z_KEY = 90, + Y_KEY = 89, + BACKSPACE_KEY = 8, + DELETE_KEY = 46, + MAX_HISTORY_ENTRIES = 40, + UNDO_HTML = '' + wysihtml5.INVISIBLE_SPACE + '', + REDO_HTML = '' + wysihtml5.INVISIBLE_SPACE + '', + dom = wysihtml5.dom; + + function cleanTempElements(doc) { + var tempElement; + while (tempElement = doc.querySelector("._wysihtml5-temp")) { + tempElement.parentNode.removeChild(tempElement); + } + } + + wysihtml5.UndoManager = wysihtml5.lang.Dispatcher.extend( + /** @scope wysihtml5.UndoManager.prototype */ { + constructor: function(editor) { + this.editor = editor; + this.composer = editor.composer; + this.element = this.composer.element; + this.history = [this.composer.getValue()]; + this.position = 1; + + // Undo manager currently only supported in browsers who have the insertHTML command (not IE) + if (this.composer.commands.support("insertHTML")) { + this._observe(); + } + }, + + _observe: function() { + var that = this, + doc = this.composer.sandbox.getDocument(), + lastKey; + + // Catch CTRL+Z and CTRL+Y + dom.observe(this.element, "keydown", function(event) { + if (event.altKey || (!event.ctrlKey && !event.metaKey)) { + return; + } + + var keyCode = event.keyCode, + isUndo = keyCode === Z_KEY && !event.shiftKey, + isRedo = (keyCode === Z_KEY && event.shiftKey) || (keyCode === Y_KEY); + + if (isUndo) { + that.undo(); + event.preventDefault(); + } else if (isRedo) { + that.redo(); + event.preventDefault(); + } + }); + + // Catch delete and backspace + dom.observe(this.element, "keydown", function(event) { + var keyCode = event.keyCode; + if (keyCode === lastKey) { + return; + } + + lastKey = keyCode; + + if (keyCode === BACKSPACE_KEY || keyCode === DELETE_KEY) { + that.transact(); + } + }); + + // Now this is very hacky: + // These days browsers don't offer a undo/redo event which we could hook into + // to be notified when the user hits undo/redo in the contextmenu. + // Therefore we simply insert two elements as soon as the contextmenu gets opened. + // The last element being inserted will be immediately be removed again by a exexCommand("undo") + // => When the second element appears in the dom tree then we know the user clicked "redo" in the context menu + // => When the first element disappears from the dom tree then we know the user clicked "undo" in the context menu + if (wysihtml5.browser.hasUndoInContextMenu()) { + var interval, observed, cleanUp = function() { + cleanTempElements(doc); + clearInterval(interval); + }; + + dom.observe(this.element, "contextmenu", function() { + cleanUp(); + that.composer.selection.executeAndRestoreSimple(function() { + if (that.element.lastChild) { + that.composer.selection.setAfter(that.element.lastChild); + } + + // enable undo button in context menu + doc.execCommand("insertHTML", false, UNDO_HTML); + // enable redo button in context menu + doc.execCommand("insertHTML", false, REDO_HTML); + doc.execCommand("undo", false, null); + }); + + interval = setInterval(function() { + if (doc.getElementById("_wysihtml5-redo")) { + cleanUp(); + that.redo(); + } else if (!doc.getElementById("_wysihtml5-undo")) { + cleanUp(); + that.undo(); + } + }, 400); + + if (!observed) { + observed = true; + dom.observe(document, "mousedown", cleanUp); + dom.observe(doc, ["mousedown", "paste", "cut", "copy"], cleanUp); + } + }); + } + + this.editor + .observe("newword:composer", function() { + that.transact(); + }) + + .observe("beforecommand:composer", function() { + that.transact(); + }); + }, + + transact: function() { + var previousHtml = this.history[this.position - 1], + currentHtml = this.composer.getValue(); + + if (currentHtml == previousHtml) { + return; + } + + var length = this.history.length = this.position; + if (length > MAX_HISTORY_ENTRIES) { + this.history.shift(); + this.position--; + } + + this.position++; + this.history.push(currentHtml); + }, + + undo: function() { + this.transact(); + + if (this.position <= 1) { + return; + } + + this.set(this.history[--this.position - 1]); + this.editor.fire("undo:composer"); + }, + + redo: function() { + if (this.position >= this.history.length) { + return; + } + + this.set(this.history[++this.position - 1]); + this.editor.fire("redo:composer"); + }, + + set: function(html) { + this.composer.setValue(html); + this.editor.focus(true); + } + }); +})(wysihtml5); +/** + * TODO: the following methods still need unit test coverage + */ +wysihtml5.views.View = Base.extend( + /** @scope wysihtml5.views.View.prototype */ { + constructor: function(parent, textareaElement, config) { + this.parent = parent; + this.element = textareaElement; + this.config = config; + + this._observeViewChange(); + }, + + _observeViewChange: function() { + var that = this; + this.parent.observe("beforeload", function() { + that.parent.observe("change_view", function(view) { + if (view === that.name) { + that.parent.currentView = that; + that.show(); + // Using tiny delay here to make sure that the placeholder is set before focusing + setTimeout(function() { that.focus(); }, 0); + } else { + that.hide(); + } + }); + }); + }, + + focus: function() { + if (this.element.ownerDocument.querySelector(":focus") === this.element) { + return; + } + + try { this.element.focus(); } catch(e) {} + }, + + hide: function() { + this.element.style.display = "none"; + }, + + show: function() { + this.element.style.display = ""; + }, + + disable: function() { + this.element.setAttribute("disabled", "disabled"); + }, + + enable: function() { + this.element.removeAttribute("disabled"); + } +});(function(wysihtml5) { + var dom = wysihtml5.dom, + browser = wysihtml5.browser; + + wysihtml5.views.Composer = wysihtml5.views.View.extend( + /** @scope wysihtml5.views.Composer.prototype */ { + name: "composer", + + // Needed for firefox in order to display a proper caret in an empty contentEditable + CARET_HACK: "
      ", + + constructor: function(parent, textareaElement, config) { + this.base(parent, textareaElement, config); + this.textarea = this.parent.textarea; + this._initSandbox(); + }, + + clear: function() { + this.element.innerHTML = browser.displaysCaretInEmptyContentEditableCorrectly() ? "" : this.CARET_HACK; + }, + + getValue: function(parse) { + var value = this.isEmpty() ? "" : wysihtml5.quirks.getCorrectInnerHTML(this.element); + + if (parse) { + value = this.parent.parse(value); + } + + // Replace all "zero width no breaking space" chars + // which are used as hacks to enable some functionalities + // Also remove all CARET hacks that somehow got left + value = wysihtml5.lang.string(value).replace(wysihtml5.INVISIBLE_SPACE).by(""); + + return value; + }, + + setValue: function(html, parse) { + if (parse) { + html = this.parent.parse(html); + } + this.element.innerHTML = html; + }, + + show: function() { + this.iframe.style.display = this._displayStyle || ""; + + // Firefox needs this, otherwise contentEditable becomes uneditable + this.disable(); + this.enable(); + }, + + hide: function() { + this._displayStyle = dom.getStyle("display").from(this.iframe); + if (this._displayStyle === "none") { + this._displayStyle = null; + } + this.iframe.style.display = "none"; + }, + + disable: function() { + this.element.removeAttribute("contentEditable"); + this.base(); + }, + + enable: function() { + this.element.setAttribute("contentEditable", "true"); + this.base(); + }, + + focus: function(setToEnd) { + // IE 8 fires the focus event after .focus() + // This is needed by our simulate_placeholder.js to work + // therefore we clear it ourselves this time + if (wysihtml5.browser.doesAsyncFocus() && this.hasPlaceholderSet()) { + this.clear(); + } + + this.base(); + + var lastChild = this.element.lastChild; + if (setToEnd && lastChild) { + if (lastChild.nodeName === "BR") { + this.selection.setBefore(this.element.lastChild); + } else { + this.selection.setAfter(this.element.lastChild); + } + } + }, + + getTextContent: function() { + return dom.getTextContent(this.element); + }, + + hasPlaceholderSet: function() { + return this.getTextContent() == this.textarea.element.getAttribute("placeholder"); + }, + + isEmpty: function() { + var innerHTML = this.element.innerHTML, + elementsWithVisualValue = "blockquote, ul, ol, img, embed, object, table, iframe, svg, video, audio, button, input, select, textarea"; + return innerHTML === "" || + innerHTML === this.CARET_HACK || + + this.hasPlaceholderSet() || + (this.getTextContent() === "" && !this.element.querySelector(elementsWithVisualValue)); + }, + + _initSandbox: function() { + var that = this; + + this.sandbox = new dom.Sandbox(function() { + that._create(); + }, { + stylesheets: this.config.stylesheets + }); + this.iframe = this.sandbox.getIframe(); + + // Create hidden field which tells the server after submit, that the user used an wysiwyg editor + var hiddenField = document.createElement("input"); + hiddenField.type = "hidden"; + hiddenField.name = "_wysihtml5_mode"; + hiddenField.value = 1; + + // Store reference to current wysihtml5 instance on the textarea element + var textareaElement = this.textarea.element; + dom.insert(this.iframe).after(textareaElement); + dom.insert(hiddenField).after(textareaElement); + }, + + _create: function() { + var that = this; + + this.doc = this.sandbox.getDocument(); + this.element = this.doc.body; + this.textarea = this.parent.textarea; + this.element.innerHTML = this.textarea.getValue(true); + this.enable(); + + // Make sure our selection handler is ready + this.selection = new wysihtml5.Selection(this.parent); + + // Make sure commands dispatcher is ready + this.commands = new wysihtml5.Commands(this.parent); + + dom.copyAttributes([ + "className", "spellcheck", "title", "lang", "dir", "accessKey" + ]).from(this.textarea.element).to(this.element); + + dom.addClass(this.element, this.config.composerClassName); + + // Make the editor look like the original textarea, by syncing styles + if (this.config.style) { + this.style(); + } + + this.observe(); + + var name = this.config.name; + if (name) { + dom.addClass(this.element, name); + dom.addClass(this.iframe, name); + } + + // Simulate html5 placeholder attribute on contentEditable element + var placeholderText = typeof(this.config.placeholder) === "string" + ? this.config.placeholder + : this.textarea.element.getAttribute("placeholder"); + if (placeholderText) { + dom.simulatePlaceholder(this.parent, this, placeholderText); + } + + // Make sure that the browser avoids using inline styles whenever possible + this.commands.exec("styleWithCSS", false); + + this._initAutoLinking(); + this._initObjectResizing(); + this._initUndoManager(); + + // Simulate html5 autofocus on contentEditable element + if (this.textarea.element.hasAttribute("autofocus") || document.querySelector(":focus") == this.textarea.element) { + setTimeout(function() { that.focus(); }, 100); + } + + wysihtml5.quirks.insertLineBreakOnReturn(this); + + // IE sometimes leaves a single paragraph, which can't be removed by the user + if (!browser.clearsContentEditableCorrectly()) { + wysihtml5.quirks.ensureProperClearing(this); + } + + if (!browser.clearsListsInContentEditableCorrectly()) { + wysihtml5.quirks.ensureProperClearingOfLists(this); + } + + // Set up a sync that makes sure that textarea and editor have the same content + if (this.initSync && this.config.sync) { + this.initSync(); + } + + // Okay hide the textarea, we are ready to go + this.textarea.hide(); + + // Fire global (before-)load event + this.parent.fire("beforeload").fire("load"); + }, + + _initAutoLinking: function() { + var that = this, + supportsDisablingOfAutoLinking = browser.canDisableAutoLinking(), + supportsAutoLinking = browser.doesAutoLinkingInContentEditable(); + if (supportsDisablingOfAutoLinking) { + this.commands.exec("autoUrlDetect", false); + } + + if (!this.config.autoLink) { + return; + } + + // Only do the auto linking by ourselves when the browser doesn't support auto linking + // OR when he supports auto linking but we were able to turn it off (IE9+) + if (!supportsAutoLinking || (supportsAutoLinking && supportsDisablingOfAutoLinking)) { + this.parent.observe("newword:composer", function() { + that.selection.executeAndRestore(function(startContainer, endContainer) { + dom.autoLink(endContainer.parentNode); + }); + }); + } + + // Assuming we have the following: + //
      http://www.google.de + // If a user now changes the url in the innerHTML we want to make sure that + // it's synchronized with the href attribute (as long as the innerHTML is still a url) + var // Use a live NodeList to check whether there are any links in the document + links = this.sandbox.getDocument().getElementsByTagName("a"), + // The autoLink helper method reveals a reg exp to detect correct urls + urlRegExp = dom.autoLink.URL_REG_EXP, + getTextContent = function(element) { + var textContent = wysihtml5.lang.string(dom.getTextContent(element)).trim(); + if (textContent.substr(0, 4) === "www.") { + textContent = "http://" + textContent; + } + return textContent; + }; + + dom.observe(this.element, "keydown", function(event) { + if (!links.length) { + return; + } + + var selectedNode = that.selection.getSelectedNode(event.target.ownerDocument), + link = dom.getParentElement(selectedNode, { nodeName: "A" }, 4), + textContent; + + if (!link) { + return; + } + + textContent = getTextContent(link); + // keydown is fired before the actual content is changed + // therefore we set a timeout to change the href + setTimeout(function() { + var newTextContent = getTextContent(link); + if (newTextContent === textContent) { + return; + } + + // Only set href when new href looks like a valid url + if (newTextContent.match(urlRegExp)) { + link.setAttribute("href", newTextContent); + } + }, 0); + }); + }, + + _initObjectResizing: function() { + var properties = ["width", "height"], + propertiesLength = properties.length, + element = this.element; + + this.commands.exec("enableObjectResizing", this.config.allowObjectResizing); + + if (this.config.allowObjectResizing) { + // IE sets inline styles after resizing objects + // The following lines make sure that the width/height css properties + // are copied over to the width/height attributes + if (browser.supportsEvent("resizeend")) { + dom.observe(element, "resizeend", function(event) { + var target = event.target || event.srcElement, + style = target.style, + i = 0, + property; + for(; i
      + * toolbar.execCommand("formatBlock", "blockquote"); + */ + execCommand: function(command, commandValue) { + if (this.commandsDisabled) { + return; + } + + var commandObj = this.commandMapping[command + ":" + commandValue]; + + // Show dialog when available + if (commandObj && commandObj.dialog && !commandObj.state) { + commandObj.dialog.show(); + } else { + this._execCommand(command, commandValue); + } + }, + + _execCommand: function(command, commandValue) { + // Make sure that composer is focussed (false => don't move caret to the end) + this.editor.focus(false); + + this.composer.commands.exec(command, commandValue); + this._updateLinkStates(); + }, + + execAction: function(action) { + var editor = this.editor; + switch(action) { + case "change_view": + if (editor.currentView === editor.textarea) { + editor.fire("change_view", "composer"); + } else { + editor.fire("change_view", "textarea"); + } + break; + } + }, + + _observe: function() { + var that = this, + editor = this.editor, + container = this.container, + links = this.commandLinks.concat(this.actionLinks), + length = links.length, + i = 0; + + for (; i= 0.3.0 comes with basic support for iOS 5) + supportTouchDevices: true + }; + + wysihtml5.Editor = wysihtml5.lang.Dispatcher.extend( + /** @scope wysihtml5.Editor.prototype */ { + constructor: function(textareaElement, config) { + this.textareaElement = typeof(textareaElement) === "string" ? document.getElementById(textareaElement) : textareaElement; + this.config = wysihtml5.lang.object({}).merge(defaultConfig).merge(config).get(); + this.textarea = new wysihtml5.views.Textarea(this, this.textareaElement, this.config); + this.currentView = this.textarea; + this._isCompatible = wysihtml5.browser.supported(); + + // Sort out unsupported/unwanted browsers here + if (!this._isCompatible || (!this.config.supportTouchDevices && wysihtml5.browser.isTouchDevice())) { + var that = this; + setTimeout(function() { that.fire("beforeload").fire("load"); }, 0); + return; + } + + // Add class name to body, to indicate that the editor is supported + wysihtml5.dom.addClass(document.body, this.config.bodyClassName); + + this.composer = new wysihtml5.views.Composer(this, this.textareaElement, this.config); + this.currentView = this.composer; + + if (typeof(this.config.parser) === "function") { + this._initParser(); + } + + this.observe("beforeload", function() { + this.synchronizer = new wysihtml5.views.Synchronizer(this, this.textarea, this.composer); + if (this.config.toolbar) { + this.toolbar = new wysihtml5.toolbar.Toolbar(this, this.config.toolbar); + } + }); + + try { + console.log("Heya! This page is using wysihtml5 for rich text editing. Check out https://github.com/xing/wysihtml5"); + } catch(e) {} + }, + + isCompatible: function() { + return this._isCompatible; + }, + + clear: function() { + this.currentView.clear(); + return this; + }, + + getValue: function(parse) { + return this.currentView.getValue(parse); + }, + + setValue: function(html, parse) { + if (!html) { + return this.clear(); + } + this.currentView.setValue(html, parse); + return this; + }, + + focus: function(setToEnd) { + this.currentView.focus(setToEnd); + return this; + }, + + /** + * Deactivate editor (make it readonly) + */ + disable: function() { + this.currentView.disable(); + return this; + }, + + /** + * Activate editor + */ + enable: function() { + this.currentView.enable(); + return this; + }, + + isEmpty: function() { + return this.currentView.isEmpty(); + }, + + hasPlaceholderSet: function() { + return this.currentView.hasPlaceholderSet(); + }, + + parse: function(htmlOrElement) { + var returnValue = this.config.parser(htmlOrElement, this.config.parserRules, this.composer.sandbox.getDocument(), true); + if (typeof(htmlOrElement) === "object") { + wysihtml5.quirks.redraw(htmlOrElement); + } + return returnValue; + }, + + /** + * Prepare html parser logic + * - Observes for paste and drop + */ + _initParser: function() { + this.observe("paste:composer", function() { + var keepScrollPosition = true, + that = this; + that.composer.selection.executeAndRestore(function() { + wysihtml5.quirks.cleanPastedHTML(that.composer.element); + that.parse(that.composer.element); + }, keepScrollPosition); + }); + + this.observe("paste:textarea", function() { + var value = this.textarea.getValue(), + newValue; + newValue = this.parse(value); + this.textarea.setValue(newValue); + }); + } + }); +})(wysihtml5); diff --git a/src/main/webapp/views/index.jsp b/src/main/webapp/views/index.jsp new file mode 100644 index 0000000000000000000000000000000000000000..1eb2123bffaa87a72c6ba83702f4edb1631087c8 --- /dev/null +++ b/src/main/webapp/views/index.jsp @@ -0,0 +1,213 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + + + + + + + + + +

      用户登录注册


      + + + +

      角色管理

      + + + +

      权限管理

      + + + +

      角色赋予权限

      + +
      +

      用户管理

      + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/views/login.jsp b/src/main/webapp/views/login.jsp new file mode 100644 index 0000000000000000000000000000000000000000..0e0209b98958425b577df8d462a713c32ac5ac7c --- /dev/null +++ b/src/main/webapp/views/login.jsp @@ -0,0 +1,109 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + + + + + + + + + +

      用户登录注册


      + + + + + +
      +

      用户注册

      + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/views/registe.jsp b/src/main/webapp/views/registe.jsp new file mode 100644 index 0000000000000000000000000000000000000000..584740aae531b71de81d53e2299cb33a1c16c672 --- /dev/null +++ b/src/main/webapp/views/registe.jsp @@ -0,0 +1,76 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Login + + + +
      +

      用户登录

      + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/views/user.jsp b/src/main/webapp/views/user.jsp new file mode 100644 index 0000000000000000000000000000000000000000..927448fbad4aa7ca2624b7c2330d1f5a2014b3cd --- /dev/null +++ b/src/main/webapp/views/user.jsp @@ -0,0 +1,143 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + + + + + + + + + +

      用户管理(管理端)


      + + + +

      用户角色

      + + + + + +
      +

      角色权限管理

      + + + + + + + \ No newline at end of file diff --git a/src/test/java/com/es/disped/json/Json.java b/src/test/java/com/es/disped/json/Json.java new file mode 100644 index 0000000000000000000000000000000000000000..64c97235e4600ed8715462b159bc659ed49db386 --- /dev/null +++ b/src/test/java/com/es/disped/json/Json.java @@ -0,0 +1,17 @@ +package com.es.disped.json; + +import org.junit.Test; + +import com.alibaba.fastjson.JSONObject; +import com.es.disped.common.wechat.http.response.AccessResponse; + +public class Json { + + @Test + public void strNull() + { + String str=null; + AccessResponse response=JSONObject.parseObject(str,AccessResponse.class); + System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>Str->null:"+response); + } +} diff --git a/src/test/java/com/es/disped/map/MapTest.java b/src/test/java/com/es/disped/map/MapTest.java new file mode 100644 index 0000000000000000000000000000000000000000..4873f9bb6a4a3edb7bd69b594b5e4fe9befe4c0a --- /dev/null +++ b/src/test/java/com/es/disped/map/MapTest.java @@ -0,0 +1,65 @@ +package com.es.disped.map; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import org.junit.Test; + +import com.alibaba.fastjson.JSONObject; +import com.es.disped.dao.model.MenuType; + +public class MapTest { + + @Test + public void test() + { + Map map=new HashMap(); + map.put("key1", "value1"); + map.put("key1=2", "value2"); + map.put("phone", "1111111"); + + String phone=map.remove("phone").toString(); + + System.out.println("phone"+phone); + + for(Entry entry:map.entrySet()) + { + System.out.println(entry); + } + } + + @Test + public void menu() + { + List> menuTypes=new ArrayList<>(); + + Map map=new HashMap<>(); + List list=Arrays.asList(MenuType.values()); + for(MenuType menuType:list) + { + map.put(menuType.getName(), menuType.getValue()); + } + menuTypes.add(map); + System.out.println(menuTypes); + List str=new ArrayList<>(); + str.add("a"); + str.add("b"); + System.out.println(JSONObject.toJSON(str)); + } + + @Test + public void type() + { + String id="asd"; + t(id); + } + + public void t(Object id) + { + System.out.println(id.getClass()); + } +} diff --git a/src/test/java/com/es/disped/service/datasource/ChangeDataSource.java b/src/test/java/com/es/disped/service/datasource/ChangeDataSource.java new file mode 100644 index 0000000000000000000000000000000000000000..88efd08798f3bf56d67f7ff74cd4aa47f17705da --- /dev/null +++ b/src/test/java/com/es/disped/service/datasource/ChangeDataSource.java @@ -0,0 +1,56 @@ +package com.es.disped.service.datasource; + +import java.util.List; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.annotation.Order; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.web.WebAppConfiguration; + +import com.es.disped.api.oj.user.HustUserService; +import com.es.disped.common.annotation.DynamicDataSource; +import com.es.disped.common.constant.DataSourceName; +import com.es.disped.common.spring.DataSourceContextHolder; +import com.es.disped.dao.oj.model.Users; +import com.es.disped.dao.oj.model.UsersExample; + +@RunWith(SpringJUnit4ClassRunner.class) +@WebAppConfiguration +@ContextConfiguration(locations={ + "classpath:spring/applicationContext.xml", + "classpath:spring/springMVC-servlet.xml", +}) +public class ChangeDataSource { + + @Autowired + HustUserService hustUserService; + + @Test + public void test() + { + DataSourceContextHolder.setDataSource(DataSourceName.EXTEND.getName()); + System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"+DataSourceContextHolder.getDataSource()); + List users=hustUserService.selectByExample(new UsersExample()); + if(users==null) + { + System.out.println(">>>>>>>>>>>>>>>>>>>>>> NULL"); + }else + { + for(Users users2:users) + { + System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>USER: "+users2); + } + } + + } + + @Test + public void datasource() + { + DataSourceContextHolder.setDataSource(DataSourceName.EXTEND.getName()); + System.out.println(DataSourceContextHolder.getDataSource()); + } +} diff --git a/src/test/java/com/es/disped/wechat/Message.java b/src/test/java/com/es/disped/wechat/Message.java new file mode 100644 index 0000000000000000000000000000000000000000..95eb7e9cd4257bc946365b705d837d7ae8b2edd8 --- /dev/null +++ b/src/test/java/com/es/disped/wechat/Message.java @@ -0,0 +1,72 @@ +package com.es.disped.wechat; + +import java.util.HashMap; +import java.util.Map; +import java.util.TreeMap; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.web.WebAppConfiguration; + +import com.alibaba.fastjson.JSONObject; +import com.es.disped.api.http.HttpService; +import com.es.disped.common.wechat.http.config.WeChatConfig; +import com.es.disped.common.wechat.http.request.AccessRequest; +import com.es.disped.common.wechat.http.response.AccessResponse; +import com.es.disped.common.wechat.model.TemplateMsg; + +@RunWith(SpringJUnit4ClassRunner.class) +@WebAppConfiguration +@ContextConfiguration(locations={ + "classpath:spring/applicationContext.xml", + "classpath:spring/springMVC-servlet.xml", +}) +public class Message { + + private static final String ACCESS_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token?"; + + @Autowired + HttpService httpService; + + @Test + public void testSendTemplate() { + AccessResponse response=null; + AccessRequest request = new AccessRequest(WeChatConfig.getAppId(), WeChatConfig.getAppsecret()); + // 构建请求参数 + Map map = new HashMap(); + map.put("grant_type", request.getGrant_type()); + map.put("appid", request.getAppid()); + map.put("secret", request.getSecret()); + String result = httpService.doGet(ACCESS_TOKEN_URL, map); + response = JSONObject.parseObject(result, AccessResponse.class); + System.out.println("response:>>>>>>>>>>>>>>>>>>>>>>>>>>>"+response); + + +// TemplateMsgResponse templateMsgResponse = null; + TreeMap> params = new TreeMap>(); + //根据具体模板参数组装 + params.put("first", TemplateMsg.item("处方审核未通过,请修改处方", "#000000")); + params.put("prescriptionCode",TemplateMsg.item("RP2018091020001", "#000000")); + params.put("doctorName",TemplateMsg.item("彭慰医师", "#000000")); + params.put("auditStatus",TemplateMsg.item("未通过", "#000000")); + params.put("prescriptionState",TemplateMsg.item("待修改", "#000000")); + params.put("auditTime",TemplateMsg.item("2018-09-10 22:22:00", "#000000")); + params.put("remark",TemplateMsg.item("你开处的处方不合格,请注意修改", "#000000")); + TemplateMsg templateMsg = new TemplateMsg(); + templateMsg.setTemplate_id("Xg_CUCHKHpPgaKkGoneWxPKJBmldknmlwBknpOZYHGA"); + templateMsg.setTouser("oSKX-0tdbbSeiDJifJrz1o45zHtc"); + templateMsg.setUrl("http://music.163.com/#/song?id=27867140"); + templateMsg.setData(params); +// ObjectMapper object = new ObjectMapper(); + String data = null; + String url = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+response.getAccess_token(); +// data = object.writeValueAsString(wechatTemplateMsg); + data = JSONObject.toJSONString(templateMsg); + System.out.println("data:"+data); + String msgResult = httpService.postJson(url, data); + System.out.println("输出结果:"+msgResult); + } +} diff --git a/src/test/java/com/es/disped/wechat/Token.java b/src/test/java/com/es/disped/wechat/Token.java new file mode 100644 index 0000000000000000000000000000000000000000..70f3fcfdb12680bcc9fa62c2d0ae96085aeab552 --- /dev/null +++ b/src/test/java/com/es/disped/wechat/Token.java @@ -0,0 +1,61 @@ +package com.es.disped.wechat; + +import java.util.HashMap; +import java.util.Map; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.web.WebAppConfiguration; + +import com.alibaba.fastjson.JSONObject; +import com.es.disped.api.http.HttpService; +import com.es.disped.common.wechat.http.config.WeChatConfig; +import com.es.disped.common.wechat.http.request.AccessRequest; +import com.es.disped.common.wechat.http.response.AccessResponse; + +@RunWith(SpringJUnit4ClassRunner.class) +@WebAppConfiguration +@ContextConfiguration(locations={ + "classpath:spring/applicationContext.xml", + "classpath:spring/springMVC-servlet.xml", +}) +public class Token { + + //@Autowired + private WeChatConfig config=new WeChatConfig(); + + @Autowired + HttpService httpService; + + private static final String ACCESS_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token?"; + + + @Test + public void testConfig() { + System.out.println("config:>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"+config); + } + + @Test + public void testGetAccessToken() { + AccessRequest request = new AccessRequest(WeChatConfig.getAppId(), WeChatConfig.getAppsecret()); + // 构建请求参数 + Map map = new HashMap(); + map.put("grant_type", request.getGrant_type()); + map.put("appid", request.getAppid()); + map.put("secret", request.getSecret()); + try { + String result = httpService.doGet(ACCESS_TOKEN_URL, map); + AccessResponse response=JSONObject.parseObject(result, AccessResponse.class); + System.out.println("response:>>>>>>>>>>>>>>>>>>>>>>>>>>>"+response); + System.out.println(response.getErrmsg()); + + System.out.println(response.getErrorcode()==null); + } catch (Exception e) { + + e.printStackTrace(); + } + } +} diff --git a/target/classes/adminMenu.xml b/target/classes/adminMenu.xml new file mode 100644 index 0000000000000000000000000000000000000000..1098d3ddcc707c3ede72ffb84642f8fc30fd4963 --- /dev/null +++ b/target/classes/adminMenu.xml @@ -0,0 +1,64 @@ + + + + + + 用户管理 + /# + + + 权限管理 + /# + + + + + 角色管理 + /# + + + 菜单管理 + /# + + + + + 课程管理 + /# + + + 课程模板管理 + /# + + + 教学计划管理 + /# + + + + + + + 区域管理 + /# + + + + \ No newline at end of file diff --git a/target/classes/ehcache.xml b/target/classes/ehcache.xml new file mode 100644 index 0000000000000000000000000000000000000000..1920f7586b2bb228bd5ce51a8fd4037e15d97818 --- /dev/null +++ b/target/classes/ehcache.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/classes/logback.xml b/target/classes/logback.xml new file mode 100644 index 0000000000000000000000000000000000000000..0914d60f7de7ee1f45459ba45ea2a606a3f31a38 --- /dev/null +++ b/target/classes/logback.xml @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + + + + + + + + + ERROR + ACCEPT + DENY + + + + + ${logback.path}/%d{yyyy-MM-dd}/${logback.name}.error.log + + ${logback.maxHistory} + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n + + + + ${logback.maxSize} + + + + + + + + WARN + ACCEPT + DENY + + + + ${logback.path}/%d{yyyy-MM-dd}/${logback.name}.warn.log + + ${logback.maxHistory} + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n + + + + ${logback.maxSize} + + + + + + + + INFO + ACCEPT + DENY + + + + ${logback.path}/%d{yyyy-MM-dd}/${logback.name}.info.log + + ${logback.maxHistory} + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n + + + + ${logback.maxSize} + + + + + + + + DEBUG + ACCEPT + DENY + + + + ${logback.path}/%d{yyyy-MM-dd}/${logback.name}.debug.log + + + ${logback.maxHistory} + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n + + + + ${logback.maxSize} + + + + + + + + TRACE + ACCEPT + DENY + + + + ${logback.path}/%d{yyyy-MM-dd}/${logback.name}.trace.log + + ${logback.maxHistory} + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n + + + + ${logback.maxSize} + + + + + + + WARN + ACCEPT + DENY + + + + + + ${logback.db.url} + ${logback.db.username} + ${logback.db.password} + ${logback.db.driverClassName} + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/classes/properties/dubbo.properties b/target/classes/properties/dubbo.properties new file mode 100644 index 0000000000000000000000000000000000000000..99996447cc0dedce87b0ba80be7ab99fac469a9e --- /dev/null +++ b/target/classes/properties/dubbo.properties @@ -0,0 +1,2 @@ +dubbo.application.name=disped-dubbo-consumer +dubbo.registry.address=zookeeper://127.0.0.1:2181 \ No newline at end of file diff --git a/target/classes/properties/logback.properties b/target/classes/properties/logback.properties new file mode 100644 index 0000000000000000000000000000000000000000..ce564a091512b82e5ed7d26fa48728ce327f5db2 --- /dev/null +++ b/target/classes/properties/logback.properties @@ -0,0 +1,10 @@ +logback.name=disped-web +logback.path=E:\\logs + +logback.maxHistory=30 +logback.maxSize=10MB + +logback.db.username=root +logback.db.password=root +logback.db.driverClassName=com.mysql.jdbc.Driver +logback.db.url=jdbc:mysql://localhost:3306/esheducation_logback_mysql_schema?useUnicode=true&characterEncoding=utf8&useSSL=false \ No newline at end of file diff --git a/target/classes/properties/redis.properties b/target/classes/properties/redis.properties new file mode 100644 index 0000000000000000000000000000000000000000..f407b5163b973322ece46512cf415679878374f5 --- /dev/null +++ b/target/classes/properties/redis.properties @@ -0,0 +1,15 @@ +redis.maxIdle=300 +redis.maxTotal=1000 +redis.maxWaitMillis=10000 +redis.minEvictableIdleTimeMillis=300000 +redis.numTestsPerEvictionRun=1024 +redis.timeBetweenEvictionRunsMillis=30000 +redis.testOnBorrow=true +redis.testWhileIdle=true + +redis.hostName=127.0.0.1 +redis.port=6379 +redis.password=anson +redis.usePool=true + +redis.maxInactiveIntervalInSeconds=100 \ No newline at end of file diff --git a/target/classes/properties/setting.properties b/target/classes/properties/setting.properties new file mode 100644 index 0000000000000000000000000000000000000000..5c398c999869625f581dd0416f0e523070cc9822 --- /dev/null +++ b/target/classes/properties/setting.properties @@ -0,0 +1 @@ +setting.upload=E:\\upload \ No newline at end of file diff --git a/target/classes/spring/applicationContext.xml b/target/classes/spring/applicationContext.xml new file mode 100644 index 0000000000000000000000000000000000000000..e6a5dfd99928a594fdfdd83475a8a65788c57520 --- /dev/null +++ b/target/classes/spring/applicationContext.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + diff --git a/target/classes/spring/config/spring-beans.xml b/target/classes/spring/config/spring-beans.xml new file mode 100644 index 0000000000000000000000000000000000000000..ce7c43d1f68011ccbd0521b84b4d8295f848c18d --- /dev/null +++ b/target/classes/spring/config/spring-beans.xml @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/target/classes/spring/config/spring-druid.xml b/target/classes/spring/config/spring-druid.xml new file mode 100644 index 0000000000000000000000000000000000000000..071d3cea0c3c0d785b959c2ba2d5167fba5119b4 --- /dev/null +++ b/target/classes/spring/config/spring-druid.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + com.es.disped.web.controller.* + + + + + + + + diff --git a/target/classes/spring/config/spring-dubbo-customer.xml b/target/classes/spring/config/spring-dubbo-customer.xml new file mode 100644 index 0000000000000000000000000000000000000000..8fee95fdbba7081f9200a3e479113dc8936eca35 --- /dev/null +++ b/target/classes/spring/config/spring-dubbo-customer.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/classes/spring/config/spring-ehcache.xml b/target/classes/spring/config/spring-ehcache.xml new file mode 100644 index 0000000000000000000000000000000000000000..35adacae32c65b3cdc72976e0ee199f5d550f42a --- /dev/null +++ b/target/classes/spring/config/spring-ehcache.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/classes/spring/config/spring-redis.xml b/target/classes/spring/config/spring-redis.xml new file mode 100644 index 0000000000000000000000000000000000000000..d142f1c8d123158ca55aa8161fc07dc41d2c543f --- /dev/null +++ b/target/classes/spring/config/spring-redis.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/classes/spring/config/spring-shiro.xml b/target/classes/spring/config/spring-shiro.xml new file mode 100644 index 0000000000000000000000000000000000000000..06aa250d9cc47bb2f41a0b7be9bb4d67698b7e8f --- /dev/null +++ b/target/classes/spring/config/spring-shiro.xml @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /swagger-ui.html = anon + /swagger-resources/** = anon + /v2/** = anon + /webjars/** = anon + /resources/** = anon + /common/login/** = anon + /sms/send/code = anon + /sms/vertify/code = anon + /wechat/message/** = anon + /** = authc + + + + + + + + \ No newline at end of file diff --git a/target/classes/spring/springMVC-servlet.xml b/target/classes/spring/springMVC-servlet.xml new file mode 100644 index 0000000000000000000000000000000000000000..78d201ab49d253bf6521cfcd33c0cae2baf82f47 --- /dev/null +++ b/target/classes/spring/springMVC-servlet.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + text/html;charset=UTF-8 + application/json;charset=UTF-8 + + + + + QuoteFieldNames + WriteNullBooleanAsFalse + WriteDateUseDateFormat + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/html; charset=UTF-8 + application/json;charset=UTF-8 + + + + + + + + text/html; charset=UTF-8 + application/json;charset=UTF-8 + + + + + + + + + + + + + + + + + + + + + + + + + + + redirect:/views/error.jsp + + + + + + + + diff --git a/target/disped-web/WEB-INF/classes/ehcache.xml b/target/disped-web/WEB-INF/classes/ehcache.xml new file mode 100644 index 0000000000000000000000000000000000000000..0aea006c2e097bf22a99ce1a69902e32ee7fff13 --- /dev/null +++ b/target/disped-web/WEB-INF/classes/ehcache.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/disped-web/WEB-INF/classes/logback.xml b/target/disped-web/WEB-INF/classes/logback.xml new file mode 100644 index 0000000000000000000000000000000000000000..59132be6b990d33b126645a001e248e5b6924c9d --- /dev/null +++ b/target/disped-web/WEB-INF/classes/logback.xml @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + + + + + + + + + ERROR + ACCEPT + DENY + + + + + ${logback.path}/%d{yyyy-MM-dd}/${logback.name}.error.log + + ${logback.maxHistory} + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n + + + + ${logback.maxSize} + + + + + + + + WARN + ACCEPT + DENY + + + + ${logback.path}/%d{yyyy-MM-dd}/${logback.name}.warn.log + + ${logback.maxHistory} + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n + + + + ${logback.maxSize} + + + + + + + + INFO + ACCEPT + DENY + + + + ${logback.path}/%d{yyyy-MM-dd}/${logback.name}.info.log + + ${logback.maxHistory} + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n + + + + ${logback.maxSize} + + + + + + + + DEBUG + ACCEPT + DENY + + + + ${logback.path}/%d{yyyy-MM-dd}/${logback.name}.debug.log + + + ${logback.maxHistory} + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n + + + + ${logback.maxSize} + + + + + + + + TRACE + ACCEPT + DENY + + + + ${logback.path}/%d{yyyy-MM-dd}/${logback.name}.trace.log + + ${logback.maxHistory} + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n + + + + ${logback.maxSize} + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/disped-web/WEB-INF/classes/properties/dubbo.properties b/target/disped-web/WEB-INF/classes/properties/dubbo.properties new file mode 100644 index 0000000000000000000000000000000000000000..99996447cc0dedce87b0ba80be7ab99fac469a9e --- /dev/null +++ b/target/disped-web/WEB-INF/classes/properties/dubbo.properties @@ -0,0 +1,2 @@ +dubbo.application.name=disped-dubbo-consumer +dubbo.registry.address=zookeeper://127.0.0.1:2181 \ No newline at end of file diff --git a/target/disped-web/WEB-INF/classes/properties/logback.properties b/target/disped-web/WEB-INF/classes/properties/logback.properties new file mode 100644 index 0000000000000000000000000000000000000000..ce564a091512b82e5ed7d26fa48728ce327f5db2 --- /dev/null +++ b/target/disped-web/WEB-INF/classes/properties/logback.properties @@ -0,0 +1,10 @@ +logback.name=disped-web +logback.path=E:\\logs + +logback.maxHistory=30 +logback.maxSize=10MB + +logback.db.username=root +logback.db.password=root +logback.db.driverClassName=com.mysql.jdbc.Driver +logback.db.url=jdbc:mysql://localhost:3306/esheducation_logback_mysql_schema?useUnicode=true&characterEncoding=utf8&useSSL=false \ No newline at end of file diff --git a/target/disped-web/WEB-INF/classes/properties/redis.properties b/target/disped-web/WEB-INF/classes/properties/redis.properties new file mode 100644 index 0000000000000000000000000000000000000000..f407b5163b973322ece46512cf415679878374f5 --- /dev/null +++ b/target/disped-web/WEB-INF/classes/properties/redis.properties @@ -0,0 +1,15 @@ +redis.maxIdle=300 +redis.maxTotal=1000 +redis.maxWaitMillis=10000 +redis.minEvictableIdleTimeMillis=300000 +redis.numTestsPerEvictionRun=1024 +redis.timeBetweenEvictionRunsMillis=30000 +redis.testOnBorrow=true +redis.testWhileIdle=true + +redis.hostName=127.0.0.1 +redis.port=6379 +redis.password=anson +redis.usePool=true + +redis.maxInactiveIntervalInSeconds=100 \ No newline at end of file diff --git a/target/disped-web/WEB-INF/classes/properties/setting.properties b/target/disped-web/WEB-INF/classes/properties/setting.properties new file mode 100644 index 0000000000000000000000000000000000000000..5c398c999869625f581dd0416f0e523070cc9822 --- /dev/null +++ b/target/disped-web/WEB-INF/classes/properties/setting.properties @@ -0,0 +1 @@ +setting.upload=E:\\upload \ No newline at end of file diff --git a/target/disped-web/WEB-INF/classes/spring/applicationContext.xml b/target/disped-web/WEB-INF/classes/spring/applicationContext.xml new file mode 100644 index 0000000000000000000000000000000000000000..e6a5dfd99928a594fdfdd83475a8a65788c57520 --- /dev/null +++ b/target/disped-web/WEB-INF/classes/spring/applicationContext.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + diff --git a/target/disped-web/WEB-INF/classes/spring/config/spring-beans.xml b/target/disped-web/WEB-INF/classes/spring/config/spring-beans.xml new file mode 100644 index 0000000000000000000000000000000000000000..ce7c43d1f68011ccbd0521b84b4d8295f848c18d --- /dev/null +++ b/target/disped-web/WEB-INF/classes/spring/config/spring-beans.xml @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/target/disped-web/WEB-INF/classes/spring/config/spring-druid.xml b/target/disped-web/WEB-INF/classes/spring/config/spring-druid.xml new file mode 100644 index 0000000000000000000000000000000000000000..071d3cea0c3c0d785b959c2ba2d5167fba5119b4 --- /dev/null +++ b/target/disped-web/WEB-INF/classes/spring/config/spring-druid.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + com.es.disped.web.controller.* + + + + + + + + diff --git a/target/disped-web/WEB-INF/classes/spring/config/spring-dubbo-customer.xml b/target/disped-web/WEB-INF/classes/spring/config/spring-dubbo-customer.xml new file mode 100644 index 0000000000000000000000000000000000000000..5e101057d263036ae6519a28dfbacb1b8e13e0f0 --- /dev/null +++ b/target/disped-web/WEB-INF/classes/spring/config/spring-dubbo-customer.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/disped-web/WEB-INF/classes/spring/config/spring-ehcache.xml b/target/disped-web/WEB-INF/classes/spring/config/spring-ehcache.xml new file mode 100644 index 0000000000000000000000000000000000000000..35adacae32c65b3cdc72976e0ee199f5d550f42a --- /dev/null +++ b/target/disped-web/WEB-INF/classes/spring/config/spring-ehcache.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/disped-web/WEB-INF/classes/spring/config/spring-redis.xml b/target/disped-web/WEB-INF/classes/spring/config/spring-redis.xml new file mode 100644 index 0000000000000000000000000000000000000000..d142f1c8d123158ca55aa8161fc07dc41d2c543f --- /dev/null +++ b/target/disped-web/WEB-INF/classes/spring/config/spring-redis.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/disped-web/WEB-INF/classes/spring/config/spring-shiro.xml b/target/disped-web/WEB-INF/classes/spring/config/spring-shiro.xml new file mode 100644 index 0000000000000000000000000000000000000000..13432f1ced49ad9b5eb55b872a81bec62e08cec7 --- /dev/null +++ b/target/disped-web/WEB-INF/classes/spring/config/spring-shiro.xml @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /swagger-ui.html = anon + /swagger-resources/** = anon + /v2/** = anon + /webjars/** = anon + /resources/** = anon + /common/login/** = anon + /sms/send/code = anon + /wechat/message/** = anon + /** = authc + + + + + + + \ No newline at end of file diff --git a/target/disped-web/WEB-INF/classes/spring/config/spring-solr.xml b/target/disped-web/WEB-INF/classes/spring/config/spring-solr.xml new file mode 100644 index 0000000000000000000000000000000000000000..4d1fd50ba95609d4afe0b9877480be644e17bb50 --- /dev/null +++ b/target/disped-web/WEB-INF/classes/spring/config/spring-solr.xml @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/target/disped-web/WEB-INF/classes/spring/springMVC-servlet.xml b/target/disped-web/WEB-INF/classes/spring/springMVC-servlet.xml new file mode 100644 index 0000000000000000000000000000000000000000..c16f990c575b3afb43207b4540ac6de721ff776f --- /dev/null +++ b/target/disped-web/WEB-INF/classes/spring/springMVC-servlet.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + text/html;charset=UTF-8 + application/json;charset=UTF-8 + + + + + QuoteFieldNames + WriteNullBooleanAsFalse + WriteDateUseDateFormat + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/html; charset=UTF-8 + application/json;charset=UTF-8 + + + + + + + + text/html; charset=UTF-8 + application/json;charset=UTF-8 + + + + + + + + + + + + + + + + + + + + + + + + + + + redirect:/views/error.jsp + + + + + + diff --git a/target/disped-web/WEB-INF/web.xml b/target/disped-web/WEB-INF/web.xml new file mode 100644 index 0000000000000000000000000000000000000000..690cb2ccfa3a201ae0e9bea6233cadd3c60de54f --- /dev/null +++ b/target/disped-web/WEB-INF/web.xml @@ -0,0 +1,123 @@ + + + disped-web + + + + springSessionRepositoryFilter + org.springframework.web.filter.DelegatingFilterProxy + + + springSessionRepositoryFilter + /* + + + + + characterEncodingFilter + org.springframework.web.filter.CharacterEncodingFilter + + encoding + UTF-8 + + + forceRequestEncoding + true + + + + characterEncodingFilter + /* + + + + + springMVC + org.springframework.web.servlet.DispatcherServlet + + contextConfigLocation + classpath:spring/springMVC-servlet.xml + + 1 + + + springMVC + / + + + + + + contextConfigLocation + classpath:spring/applicationContext.xml + + + + org.springframework.web.context.ContextLoaderListener + + + + + shiroFilter + org.springframework.web.filter.DelegatingFilterProxy + + targetFilterLifecycle + true + + + + shiroFilter + /* + + + + + + CORS + com.thetransactioncompany.cors.CORSFilter + + cors.allowOrigin + * + + + cors.supportedMethods + GET, POST, OPTIONS + + + cors.supportedHeaders + Accept, Origin, X-Requested-With, X_Requested_With, Content-Type, Last-Modified + + + cors.exposedHeaders + Set-Cookie + + + cors.supportsCredentials + true + + + + CORS + /* + + + + + 30 + + + + + views/index.jsp + + + + + 404 + /404/error + + + diff --git a/target/disped-web/index.jsp b/target/disped-web/index.jsp new file mode 100644 index 0000000000000000000000000000000000000000..c38169bb958579c635a5c09ee2f379cc5956c0c2 --- /dev/null +++ b/target/disped-web/index.jsp @@ -0,0 +1,5 @@ + + +

      Hello World!

      + + diff --git a/target/disped-web/resources/css/bootstrap-responsive.min.css b/target/disped-web/resources/css/bootstrap-responsive.min.css new file mode 100644 index 0000000000000000000000000000000000000000..05978601011d16a1473189fce9ce1090055af2ce --- /dev/null +++ b/target/disped-web/resources/css/bootstrap-responsive.min.css @@ -0,0 +1,9 @@ +/*! + * Bootstrap Responsive v2.3.0 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}@-ms-viewport{width:device-width}.hidden{display:none;visibility:hidden}.visible-phone{display:none!important}.visible-tablet{display:none!important}.hidden-desktop{display:none!important}.visible-desktop{display:inherit!important}@media(min-width:768px) and (max-width:979px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-tablet{display:inherit!important}.hidden-tablet{display:none!important}}@media(max-width:767px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-phone{display:inherit!important}.hidden-phone{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:inherit!important}.hidden-print{display:none!important}}@media(min-width:1200px){.row{margin-left:-30px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:30px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:1170px}.span12{width:1170px}.span11{width:1070px}.span10{width:970px}.span9{width:870px}.span8{width:770px}.span7{width:670px}.span6{width:570px}.span5{width:470px}.span4{width:370px}.span3{width:270px}.span2{width:170px}.span1{width:70px}.offset12{margin-left:1230px}.offset11{margin-left:1130px}.offset10{margin-left:1030px}.offset9{margin-left:930px}.offset8{margin-left:830px}.offset7{margin-left:730px}.offset6{margin-left:630px}.offset5{margin-left:530px}.offset4{margin-left:430px}.offset3{margin-left:330px}.offset2{margin-left:230px}.offset1{margin-left:130px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.564102564102564%;*margin-left:2.5109110747408616%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.564102564102564%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.45299145299145%;*width:91.39979996362975%}.row-fluid .span10{width:82.90598290598291%;*width:82.8527914166212%}.row-fluid .span9{width:74.35897435897436%;*width:74.30578286961266%}.row-fluid .span8{width:65.81196581196582%;*width:65.75877432260411%}.row-fluid .span7{width:57.26495726495726%;*width:57.21176577559556%}.row-fluid .span6{width:48.717948717948715%;*width:48.664757228587014%}.row-fluid .span5{width:40.17094017094017%;*width:40.11774868157847%}.row-fluid .span4{width:31.623931623931625%;*width:31.570740134569924%}.row-fluid .span3{width:23.076923076923077%;*width:23.023731587561375%}.row-fluid .span2{width:14.52991452991453%;*width:14.476723040552828%}.row-fluid .span1{width:5.982905982905983%;*width:5.929714493544281%}.row-fluid .offset12{margin-left:105.12820512820512%;*margin-left:105.02182214948171%}.row-fluid .offset12:first-child{margin-left:102.56410256410257%;*margin-left:102.45771958537915%}.row-fluid .offset11{margin-left:96.58119658119658%;*margin-left:96.47481360247316%}.row-fluid .offset11:first-child{margin-left:94.01709401709402%;*margin-left:93.91071103837061%}.row-fluid .offset10{margin-left:88.03418803418803%;*margin-left:87.92780505546462%}.row-fluid .offset10:first-child{margin-left:85.47008547008548%;*margin-left:85.36370249136206%}.row-fluid .offset9{margin-left:79.48717948717949%;*margin-left:79.38079650845607%}.row-fluid .offset9:first-child{margin-left:76.92307692307693%;*margin-left:76.81669394435352%}.row-fluid .offset8{margin-left:70.94017094017094%;*margin-left:70.83378796144753%}.row-fluid .offset8:first-child{margin-left:68.37606837606839%;*margin-left:68.26968539734497%}.row-fluid .offset7{margin-left:62.393162393162385%;*margin-left:62.28677941443899%}.row-fluid .offset7:first-child{margin-left:59.82905982905982%;*margin-left:59.72267685033642%}.row-fluid .offset6{margin-left:53.84615384615384%;*margin-left:53.739770867430444%}.row-fluid .offset6:first-child{margin-left:51.28205128205128%;*margin-left:51.175668303327875%}.row-fluid .offset5{margin-left:45.299145299145295%;*margin-left:45.1927623204219%}.row-fluid .offset5:first-child{margin-left:42.73504273504273%;*margin-left:42.62865975631933%}.row-fluid .offset4{margin-left:36.75213675213675%;*margin-left:36.645753773413354%}.row-fluid .offset4:first-child{margin-left:34.18803418803419%;*margin-left:34.081651209310785%}.row-fluid .offset3{margin-left:28.205128205128204%;*margin-left:28.0987452264048%}.row-fluid .offset3:first-child{margin-left:25.641025641025642%;*margin-left:25.53464266230224%}.row-fluid .offset2{margin-left:19.65811965811966%;*margin-left:19.551736679396257%}.row-fluid .offset2:first-child{margin-left:17.094017094017094%;*margin-left:16.98763411529369%}.row-fluid .offset1{margin-left:11.11111111111111%;*margin-left:11.004728132387708%}.row-fluid .offset1:first-child{margin-left:8.547008547008547%;*margin-left:8.440625568285142%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:30px}input.span12,textarea.span12,.uneditable-input.span12{width:1156px}input.span11,textarea.span11,.uneditable-input.span11{width:1056px}input.span10,textarea.span10,.uneditable-input.span10{width:956px}input.span9,textarea.span9,.uneditable-input.span9{width:856px}input.span8,textarea.span8,.uneditable-input.span8{width:756px}input.span7,textarea.span7,.uneditable-input.span7{width:656px}input.span6,textarea.span6,.uneditable-input.span6{width:556px}input.span5,textarea.span5,.uneditable-input.span5{width:456px}input.span4,textarea.span4,.uneditable-input.span4{width:356px}input.span3,textarea.span3,.uneditable-input.span3{width:256px}input.span2,textarea.span2,.uneditable-input.span2{width:156px}input.span1,textarea.span1,.uneditable-input.span1{width:56px}.thumbnails{margin-left:-30px}.thumbnails>li{margin-left:30px}.row-fluid .thumbnails{margin-left:0}}@media(min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:724px}.span12{width:724px}.span11{width:662px}.span10{width:600px}.span9{width:538px}.span8{width:476px}.span7{width:414px}.span6{width:352px}.span5{width:290px}.span4{width:228px}.span3{width:166px}.span2{width:104px}.span1{width:42px}.offset12{margin-left:764px}.offset11{margin-left:702px}.offset10{margin-left:640px}.offset9{margin-left:578px}.offset8{margin-left:516px}.offset7{margin-left:454px}.offset6{margin-left:392px}.offset5{margin-left:330px}.offset4{margin-left:268px}.offset3{margin-left:206px}.offset2{margin-left:144px}.offset1{margin-left:82px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.7624309392265194%;*margin-left:2.709239449864817%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.7624309392265194%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.43646408839778%;*width:91.38327259903608%}.row-fluid .span10{width:82.87292817679558%;*width:82.81973668743387%}.row-fluid .span9{width:74.30939226519337%;*width:74.25620077583166%}.row-fluid .span8{width:65.74585635359117%;*width:65.69266486422946%}.row-fluid .span7{width:57.18232044198895%;*width:57.12912895262725%}.row-fluid .span6{width:48.61878453038674%;*width:48.56559304102504%}.row-fluid .span5{width:40.05524861878453%;*width:40.00205712942283%}.row-fluid .span4{width:31.491712707182323%;*width:31.43852121782062%}.row-fluid .span3{width:22.92817679558011%;*width:22.87498530621841%}.row-fluid .span2{width:14.3646408839779%;*width:14.311449394616199%}.row-fluid .span1{width:5.801104972375691%;*width:5.747913483013988%}.row-fluid .offset12{margin-left:105.52486187845304%;*margin-left:105.41847889972962%}.row-fluid .offset12:first-child{margin-left:102.76243093922652%;*margin-left:102.6560479605031%}.row-fluid .offset11{margin-left:96.96132596685082%;*margin-left:96.8549429881274%}.row-fluid .offset11:first-child{margin-left:94.1988950276243%;*margin-left:94.09251204890089%}.row-fluid .offset10{margin-left:88.39779005524862%;*margin-left:88.2914070765252%}.row-fluid .offset10:first-child{margin-left:85.6353591160221%;*margin-left:85.52897613729868%}.row-fluid .offset9{margin-left:79.8342541436464%;*margin-left:79.72787116492299%}.row-fluid .offset9:first-child{margin-left:77.07182320441989%;*margin-left:76.96544022569647%}.row-fluid .offset8{margin-left:71.2707182320442%;*margin-left:71.16433525332079%}.row-fluid .offset8:first-child{margin-left:68.50828729281768%;*margin-left:68.40190431409427%}.row-fluid .offset7{margin-left:62.70718232044199%;*margin-left:62.600799341718584%}.row-fluid .offset7:first-child{margin-left:59.94475138121547%;*margin-left:59.838368402492065%}.row-fluid .offset6{margin-left:54.14364640883978%;*margin-left:54.037263430116376%}.row-fluid .offset6:first-child{margin-left:51.38121546961326%;*margin-left:51.27483249088986%}.row-fluid .offset5{margin-left:45.58011049723757%;*margin-left:45.47372751851417%}.row-fluid .offset5:first-child{margin-left:42.81767955801105%;*margin-left:42.71129657928765%}.row-fluid .offset4{margin-left:37.01657458563536%;*margin-left:36.91019160691196%}.row-fluid .offset4:first-child{margin-left:34.25414364640884%;*margin-left:34.14776066768544%}.row-fluid .offset3{margin-left:28.45303867403315%;*margin-left:28.346655695309746%}.row-fluid .offset3:first-child{margin-left:25.69060773480663%;*margin-left:25.584224756083227%}.row-fluid .offset2{margin-left:19.88950276243094%;*margin-left:19.783119783707537%}.row-fluid .offset2:first-child{margin-left:17.12707182320442%;*margin-left:17.02068884448102%}.row-fluid .offset1{margin-left:11.32596685082873%;*margin-left:11.219583872105325%}.row-fluid .offset1:first-child{margin-left:8.56353591160221%;*margin-left:8.457152932878806%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:710px}input.span11,textarea.span11,.uneditable-input.span11{width:648px}input.span10,textarea.span10,.uneditable-input.span10{width:586px}input.span9,textarea.span9,.uneditable-input.span9{width:524px}input.span8,textarea.span8,.uneditable-input.span8{width:462px}input.span7,textarea.span7,.uneditable-input.span7{width:400px}input.span6,textarea.span6,.uneditable-input.span6{width:338px}input.span5,textarea.span5,.uneditable-input.span5{width:276px}input.span4,textarea.span4,.uneditable-input.span4{width:214px}input.span3,textarea.span3,.uneditable-input.span3{width:152px}input.span2,textarea.span2,.uneditable-input.span2{width:90px}input.span1,textarea.span1,.uneditable-input.span1{width:28px}}@media(max-width:767px){body{padding-right:20px;padding-left:20px}.navbar-fixed-top,.navbar-fixed-bottom,.navbar-static-top{margin-right:-20px;margin-left:-20px}.container-fluid{padding:0}.dl-horizontal dt{float:none;width:auto;clear:none;text-align:left}.dl-horizontal dd{margin-left:0}.container{width:auto}.row-fluid{width:100%}.row,.thumbnails{margin-left:0}.thumbnails>li{float:none;margin-left:0}[class*="span"],.uneditable-input[class*="span"],.row-fluid [class*="span"]{display:block;float:none;width:100%;margin-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.span12,.row-fluid .span12{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="offset"]:first-child{margin-left:0}.input-large,.input-xlarge,.input-xxlarge,input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.input-prepend input,.input-append input,.input-prepend input[class*="span"],.input-append input[class*="span"]{display:inline-block;width:auto}.controls-row [class*="span"]+[class*="span"]{margin-left:0}.modal{position:fixed;top:20px;right:20px;left:20px;width:auto;margin:0}.modal.fade{top:-100px}.modal.fade.in{top:20px}}@media(max-width:480px){.nav-collapse{-webkit-transform:translate3d(0,0,0)}.page-header h1 small{display:block;line-height:20px}input[type="checkbox"],input[type="radio"]{border:1px solid #ccc}.form-horizontal .control-label{float:none;width:auto;padding-top:0;text-align:left}.form-horizontal .controls{margin-left:0}.form-horizontal .control-list{padding-top:0}.form-horizontal .form-actions{padding-right:10px;padding-left:10px}.media .pull-left,.media .pull-right{display:block;float:none;margin-bottom:10px}.media-object{margin-right:0;margin-left:0}.modal{top:10px;right:10px;left:10px}.modal-header .close{padding:10px;margin:-10px}.carousel-caption{position:static}}@media(max-width:979px){body{padding-top:0}.navbar-fixed-top,.navbar-fixed-bottom{position:static}.navbar-fixed-top{margin-bottom:20px}.navbar-fixed-bottom{margin-top:20px}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding:5px}.navbar .container{width:auto;padding:0}.navbar .brand{padding-right:10px;padding-left:10px;margin:0 0 0 -5px}.nav-collapse{clear:both}.nav-collapse .nav{float:none;margin:0 0 10px}.nav-collapse .nav>li{float:none}.nav-collapse .nav>li>a{margin-bottom:2px}.nav-collapse .nav>.divider-vertical{display:none}.nav-collapse .nav .nav-header{color:#777;text-shadow:none}.nav-collapse .nav>li>a,.nav-collapse .dropdown-menu a{padding:9px 15px;font-weight:bold;color:#777;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.nav-collapse .btn{padding:4px 10px 4px;font-weight:normal;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.nav-collapse .dropdown-menu li+li a{margin-bottom:2px}.nav-collapse .nav>li>a:hover,.nav-collapse .nav>li>a:focus,.nav-collapse .dropdown-menu a:hover,.nav-collapse .dropdown-menu a:focus{background-color:#f2f2f2}.navbar-inverse .nav-collapse .nav>li>a,.navbar-inverse .nav-collapse .dropdown-menu a{color:#999}.navbar-inverse .nav-collapse .nav>li>a:hover,.navbar-inverse .nav-collapse .nav>li>a:focus,.navbar-inverse .nav-collapse .dropdown-menu a:hover,.navbar-inverse .nav-collapse .dropdown-menu a:focus{background-color:#111}.nav-collapse.in .btn-group{padding:0;margin-top:5px}.nav-collapse .dropdown-menu{position:static;top:auto;left:auto;display:none;float:none;max-width:none;padding:0;margin:0 15px;background-color:transparent;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.nav-collapse .open>.dropdown-menu{display:block}.nav-collapse .dropdown-menu:before,.nav-collapse .dropdown-menu:after{display:none}.nav-collapse .dropdown-menu .divider{display:none}.nav-collapse .nav>li>.dropdown-menu:before,.nav-collapse .nav>li>.dropdown-menu:after{display:none}.nav-collapse .navbar-form,.nav-collapse .navbar-search{float:none;padding:10px 15px;margin:10px 0;border-top:1px solid #f2f2f2;border-bottom:1px solid #f2f2f2;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}.navbar-inverse .nav-collapse .navbar-form,.navbar-inverse .nav-collapse .navbar-search{border-top-color:#111;border-bottom-color:#111}.navbar .nav-collapse .nav.pull-right{float:none;margin-left:0}.nav-collapse,.nav-collapse.collapse{height:0;overflow:hidden}.navbar .btn-navbar{display:block}.navbar-static .navbar-inner{padding-right:10px;padding-left:10px}}@media(min-width:980px){.nav-collapse.collapse{height:auto!important;overflow:visible!important}} diff --git a/target/disped-web/resources/css/bootstrap-wysihtml5.css b/target/disped-web/resources/css/bootstrap-wysihtml5.css new file mode 100644 index 0000000000000000000000000000000000000000..d0b845e594eed50328f71516ba3ee58fc46ff963 --- /dev/null +++ b/target/disped-web/resources/css/bootstrap-wysihtml5.css @@ -0,0 +1,102 @@ +ul.wysihtml5-toolbar { + margin: 0; + padding: 0; + display: block; +} + +ul.wysihtml5-toolbar::after { + clear: both; + display: table; + content: ""; +} + +ul.wysihtml5-toolbar > li { + float: left; + display: list-item; + list-style: none; + margin: 0 5px 10px 0; +} + +ul.wysihtml5-toolbar a[data-wysihtml5-command=bold] { + font-weight: bold; +} + +ul.wysihtml5-toolbar a[data-wysihtml5-command=italic] { + font-style: italic; +} + +ul.wysihtml5-toolbar a[data-wysihtml5-command=underline] { + text-decoration: underline; +} + +ul.wysihtml5-toolbar a.btn.wysihtml5-command-active { + background-image: none; + -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05); + background-color: #E6E6E6; + background-color: #D9D9D9; + outline: 0; +} + +ul.wysihtml5-commands-disabled .dropdown-menu { + display: none !important; +} + +ul.wysihtml5-toolbar div.wysihtml5-colors { + display:block; + width: 50px; + height: 20px; + margin-top: 2px; + margin-left: 5px; + position: absolute; + pointer-events: none; +} + +ul.wysihtml5-toolbar a.wysihtml5-colors-title { + padding-left: 70px; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="black"] { + background: black !important; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="silver"] { + background: silver !important; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="gray"] { + background: gray !important; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="maroon"] { + background: maroon !important; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="red"] { + background: red !important; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="purple"] { + background: purple !important; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="green"] { + background: green !important; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="olive"] { + background: olive !important; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="navy"] { + background: navy !important; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="blue"] { + background: blue !important; +} + +ul.wysihtml5-toolbar div[data-wysihtml5-command-value="orange"] { + background: orange !important; +} \ No newline at end of file diff --git a/target/disped-web/resources/css/bootstrap.min.css b/target/disped-web/resources/css/bootstrap.min.css new file mode 100644 index 0000000000000000000000000000000000000000..c9a1a590c9cc64aad30ed6e5839c12ce78498a8e --- /dev/null +++ b/target/disped-web/resources/css/bootstrap.min.css @@ -0,0 +1 @@ +/*!* Bootstrap v2.3.0** Copyright 2012 Twitter, Inc* Licensed under the Apache License v2.0* http://www.apache.org/licenses/LICENSE-2.0** Designed and built with all the love in the world @twitter by @mdo and @fat.*/.clearfix {*zoom:1}.clearfix:before, .clearfix:after {display:table;line-height:0;content:""}.clearfix:after {clear:both}.hide-text {font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level {display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}article, aside, details, figcaption, figure, footer, header, hgroup, nav, section {display:block}audio, canvas, video {display:inline-block;*display:inline;*zoom:1}audio:not([controls]) {display:none}html {font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}a:focus {outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}a:hover, a:active {outline:0}sub, sup {position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup {top:-0.5em}sub {bottom:-0.25em}img {width:auto\9;height:auto;max-width:100%;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic}#map_canvas img, .google-maps img {max-width:none}button, input, select, textarea {margin:0;font-size:100%;vertical-align:middle}button, input {*overflow:visible;line-height:normal}button::-moz-focus-inner, input::-moz-focus-inner {padding:0;border:0}button, html input[type="button"], input[type="reset"], input[type="submit"] {cursor:pointer;-webkit-appearance:button}label, select, button, input[type="button"], input[type="reset"], input[type="submit"], input[type="radio"], input[type="checkbox"] {cursor:pointer}input[type="search"] {-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type="search"]::-webkit-search-decoration, input[type="search"]::-webkit-search-cancel-button {-webkit-appearance:none}textarea {overflow:auto;vertical-align:top}@media print {* {color:#000!important;text-shadow:none!important;background:transparent!important;box-shadow:none!important}a, a:visited {text-decoration:underline}a[href]:after {content:" (" attr(href) ")"}abbr[title]:after {content:" (" attr(title) ")"}.ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after {content:""}pre, blockquote {border:1px solid #999;page-break-inside:avoid}thead {display:table-header-group}tr, img {page-break-inside:avoid}img {max-width:100%!important}@page {margin:.5cm}p, h2, h3 {orphans:3;widows:3}h2, h3 {page-break-after:avoid}}body {margin:0;font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;font-size:14px;line-height:20px;color:#333;background-color:#fff}a {color:#08c;text-decoration:none}a:hover, a:focus {color:#005580;text-decoration:underline}.img-rounded {-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.img-polaroid {padding:4px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.1);box-shadow:0 1px 3px rgba(0,0,0,0.1)}.img-circle {-webkit-border-radius:500px;-moz-border-radius:500px;border-radius:500px}.row {margin-left:-20px;*zoom:1}.row:before, .row:after {display:table;line-height:0;content:""}.row:after {clear:both}[class*="span"] {float:left;min-height:1px;margin-left:20px}.container, .navbar-static-top .container, .navbar-fixed-top .container, .navbar-fixed-bottom .container {width:940px}.span12 {width:940px}.span11 {width:860px}.span10 {width:780px}.span9 {width:700px}.span8 {width:620px}.span7 {width:540px}.span6 {width:460px}.span5 {width:380px}.span4 {width:300px}.span3 {width:220px}.span2 {width:140px}.span1 {width:60px}.offset12 {margin-left:980px}.offset11 {margin-left:900px}.offset10 {margin-left:820px}.offset9 {margin-left:740px}.offset8 {margin-left:660px}.offset7 {margin-left:580px}.offset6 {margin-left:500px}.offset5 {margin-left:420px}.offset4 {margin-left:340px}.offset3 {margin-left:260px}.offset2 {margin-left:180px}.offset1 {margin-left:100px}.row-fluid {width:100%;*zoom:1}.row-fluid:before, .row-fluid:after {display:table;line-height:0;content:""}.row-fluid:after {clear:both}.row-fluid [class*="span"] {display:block;float:left;width:100%;min-height:30px;margin-left:2.127659574468085%;*margin-left:2.074468085106383%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child {margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"] {margin-left:2.127659574468085%}.row-fluid .span12 {width:100%;*width:99.94680851063829%}.row-fluid .span11 {width:91.48936170212765%;*width:91.43617021276594%}.row-fluid .span10 {width:82.97872340425532%;*width:82.92553191489361%}.row-fluid .span9 {width:74.46808510638297%;*width:74.41489361702126%}.row-fluid .span8 {width:65.95744680851064%;*width:65.90425531914893%}.row-fluid .span7 {width:57.44680851063829%;*width:57.39361702127659%}.row-fluid .span6 {width:48.93617021276595%;*width:48.88297872340425%}.row-fluid .span5 {width:40.42553191489362%;*width:40.37234042553192%}.row-fluid .span4 {width:31.914893617021278%;*width:31.861702127659576%}.row-fluid .span3 {width:23.404255319148934%;*width:23.351063829787233%}.row-fluid .span2 {width:14.893617021276595%;*width:14.840425531914894%}.row-fluid .span1 {width:6.382978723404255%;*width:6.329787234042553%}.row-fluid .offset12 {margin-left:104.25531914893617%;*margin-left:104.14893617021275%}.row-fluid .offset12:first-child {margin-left:102.12765957446808%;*margin-left:102.02127659574467%}.row-fluid .offset11 {margin-left:95.74468085106382%;*margin-left:95.6382978723404%}.row-fluid .offset11:first-child {margin-left:93.61702127659574%;*margin-left:93.51063829787232%}.row-fluid .offset10 {margin-left:87.23404255319149%;*margin-left:87.12765957446807%}.row-fluid .offset10:first-child {margin-left:85.1063829787234%;*margin-left:84.99999999999999%}.row-fluid .offset9 {margin-left:78.72340425531914%;*margin-left:78.61702127659572%}.row-fluid .offset9:first-child {margin-left:76.59574468085106%;*margin-left:76.48936170212764%}.row-fluid .offset8 {margin-left:70.2127659574468%;*margin-left:70.10638297872339%}.row-fluid .offset8:first-child {margin-left:68.08510638297872%;*margin-left:67.9787234042553%}.row-fluid .offset7 {margin-left:61.70212765957446%;*margin-left:61.59574468085106%}.row-fluid .offset7:first-child {margin-left:59.574468085106375%;*margin-left:59.46808510638297%}.row-fluid .offset6 {margin-left:53.191489361702125%;*margin-left:53.085106382978715%}.row-fluid .offset6:first-child {margin-left:51.063829787234035%;*margin-left:50.95744680851063%}.row-fluid .offset5 {margin-left:44.68085106382979%;*margin-left:44.57446808510638%}.row-fluid .offset5:first-child {margin-left:42.5531914893617%;*margin-left:42.4468085106383%}.row-fluid .offset4 {margin-left:36.170212765957444%;*margin-left:36.06382978723405%}.row-fluid .offset4:first-child {margin-left:34.04255319148936%;*margin-left:33.93617021276596%}.row-fluid .offset3 {margin-left:27.659574468085104%;*margin-left:27.5531914893617%}.row-fluid .offset3:first-child {margin-left:25.53191489361702%;*margin-left:25.425531914893618%}.row-fluid .offset2 {margin-left:19.148936170212764%;*margin-left:19.04255319148936%}.row-fluid .offset2:first-child {margin-left:17.02127659574468%;*margin-left:16.914893617021278%}.row-fluid .offset1 {margin-left:10.638297872340425%;*margin-left:10.53191489361702%}.row-fluid .offset1:first-child {margin-left:8.51063829787234%;*margin-left:8.404255319148938%}[class*="span"].hide, .row-fluid [class*="span"].hide {display:none}[class*="span"].pull-right, .row-fluid [class*="span"].pull-right {float:right}.container {margin-right:auto;margin-left:auto;*zoom:1}.container:before, .container:after {display:table;line-height:0;content:""}.container:after {clear:both}.container-fluid {padding-right:20px;padding-left:20px;*zoom:1}.container-fluid:before, .container-fluid:after {display:table;line-height:0;content:""}.container-fluid:after {clear:both}p {margin:0 0 10px}.lead {margin-bottom:20px;font-size:21px;font-weight:200;line-height:30px}small {font-size:85%}strong {font-weight:bold}em {font-style:italic}cite {font-style:normal}.muted {color:#999}a.muted:hover, a.muted:focus {color:#808080}.text-warning {color:#c09853}a.text-warning:hover, a.text-warning:focus {color:#a47e3c}.text-error {color:#b94a48}a.text-error:hover, a.text-error:focus {color:#953b39}.text-info {color:#3a87ad}a.text-info:hover, a.text-info:focus {color:#2d6987}.text-success {color:#468847}a.text-success:hover, a.text-success:focus {color:#356635}.text-left {text-align:left}.text-right {text-align:right}.text-center {text-align:center}h1, h2, h3, h4, h5, h6 {margin:10px 0;font-family:inherit;font-weight:bold;line-height:20px;color:inherit;text-rendering:optimizelegibility}h1 small, h2 small, h3 small, h4 small, h5 small, h6 small {font-weight:normal;line-height:1;color:#999}h1, h2, h3 {line-height:40px}h1 {font-size:38.5px}h2 {font-size:31.5px}h3 {font-size:24.5px}h4 {font-size:17.5px}h5 {font-size:14px}h6 {font-size:11.9px}h1 small {font-size:24.5px}h2 small {font-size:17.5px}h3 small {font-size:14px}h4 small {font-size:14px}.page-header {padding-bottom:9px;margin:20px 0 30px;border-bottom:1px solid #eee}ul, ol {padding:0;margin:0 0 10px 25px}ul ul, ul ol, ol ol, ol ul {margin-bottom:0}li {line-height:20px}ul.unstyled, ol.unstyled {margin-left:0;list-style:none}ul.inline, ol.inline {margin-left:0;list-style:none}ul.inline>li, ol.inline>li {display:inline-block;*display:inline;padding-right:5px;padding-left:5px;*zoom:1}dl {margin-bottom:20px}dt, dd {line-height:20px}dt {font-weight:bold}dd {margin-left:10px}.dl-horizontal {*zoom:1}.dl-horizontal:before, .dl-horizontal:after {display:table;line-height:0;content:""}.dl-horizontal:after {clear:both}.dl-horizontal dt {float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd {margin-left:180px}hr {margin:20px 0;border:0;border-top:1px solid #eee;border-bottom:1px solid #fff}abbr[title], abbr[data-original-title] {cursor:help;border-bottom:1px dotted #999}abbr.initialism {font-size:90%;text-transform:uppercase}blockquote {padding:0 0 0 15px;margin:0 0 20px;border-left:5px solid #eee}blockquote p {margin-bottom:0;font-size:17.5px;font-weight:300;line-height:1.25}blockquote small {display:block;line-height:20px;color:#999}blockquote small:before {content:'\2014 \00A0'}blockquote.pull-right {float:right;padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0}blockquote.pull-right p, blockquote.pull-right small {text-align:right}blockquote.pull-right small:before {content:''}blockquote.pull-right small:after {content:'\00A0 \2014'}q:before, q:after, blockquote:before, blockquote:after {content:""}address {display:block;margin-bottom:20px;font-style:normal;line-height:20px}code, pre {padding:0 3px 2px;font-family:Monaco, Menlo, Consolas, "Courier New", monospace;font-size:12px;color:#333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}code {padding:2px 4px;color:#d14;white-space:nowrap;background-color:#f7f7f9;border:1px solid #e1e1e8}pre {display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:20px;word-break:break-all;word-wrap:break-word;white-space:pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}pre.prettyprint {margin-bottom:20px}pre code {padding:0;color:inherit;white-space:pre;white-space:pre-wrap;background-color:transparent;border:0}.pre-scrollable {max-height:340px;overflow-y:scroll}form {margin:0 0 20px}fieldset {padding:0;margin:0;border:0}legend {display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:40px;color:#333;border:0;border-bottom:1px solid #e5e5e5}legend small {font-size:15px;color:#999}label, input, button, select, textarea {font-size:14px;font-weight:normal;line-height:20px}input, button, select, textarea {font-family:"Helvetica Neue", Helvetica, Arial, sans-serif}label {display:block;margin-bottom:5px}select, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input {display:inline-block;height:20px;padding:4px 6px;margin-bottom:10px;font-size:14px;line-height:20px;color:#555;vertical-align:middle;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}input, textarea, .uneditable-input {width:206px}textarea {height:auto}textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input {background-color:#fff;border:1px solid #ccc;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border linear .2s, box-shadow linear .2s;-moz-transition:border linear .2s, box-shadow linear .2s;-o-transition:border linear .2s, box-shadow linear .2s;transition:border linear .2s, box-shadow linear .2s}textarea:focus, input[type="text"]:focus, input[type="password"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="date"]:focus, input[type="month"]:focus, input[type="time"]:focus, input[type="week"]:focus, input[type="number"]:focus, input[type="email"]:focus, input[type="url"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="color"]:focus, .uneditable-input:focus {border-color:rgba(82,168,236,0.8);outline:0;outline:thin dotted \9;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075), 0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075), 0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075), 0 0 8px rgba(82,168,236,0.6)}input[type="radio"], input[type="checkbox"] {margin:4px 0 0;margin-top:1px \9;*margin-top:0;line-height:normal}input[type="file"], input[type="image"], input[type="submit"], input[type="reset"], input[type="button"], input[type="radio"], input[type="checkbox"] {width:auto}select, input[type="file"] {height:30px;*margin-top:4px;line-height:30px}select {width:70px;background-color:#fff;border:1px solid #ccc}select[multiple], select[size] {height:auto}select:focus, input[type="file"]:focus, input[type="radio"]:focus, input[type="checkbox"]:focus {outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.uneditable-input, .uneditable-textarea {color:#999;cursor:not-allowed;background-color:#fcfcfc;border-color:#ccc;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);box-shadow:inset 0 1px 2px rgba(0,0,0,0.025)}.uneditable-input {overflow:hidden;white-space:nowrap}.uneditable-textarea {width:auto;height:auto}input:-moz-placeholder, textarea:-moz-placeholder {color:#999}input:-ms-input-placeholder, textarea:-ms-input-placeholder {color:#999}input::-webkit-input-placeholder, textarea::-webkit-input-placeholder {color:#999}.radio, .checkbox {min-height:20px;padding-left:20px}.radio input[type="radio"], .checkbox input[type="checkbox"] {float:left;margin-left:-20px}.controls>.radio:first-child, .controls>.checkbox:first-child {padding-top:5px}.radio.inline, .checkbox.inline {display:inline-block;padding-top:5px;margin-bottom:0;vertical-align:middle}.radio.inline+.radio.inline, .checkbox.inline+.checkbox.inline {margin-left:10px}.input-mini {width:60px}.input-small {width:90px}.input-medium {width:150px}.input-large {width:210px}.input-xlarge {width:270px}.input-xxlarge {width:530px}input[class*="span"], select[class*="span"], textarea[class*="span"], .uneditable-input[class*="span"], .row-fluid input[class*="span"], .row-fluid select[class*="span"], .row-fluid textarea[class*="span"], .row-fluid .uneditable-input[class*="span"] {float:none;margin-left:0}.input-append input[class*="span"], .input-append .uneditable-input[class*="span"], .input-prepend input[class*="span"], .input-prepend .uneditable-input[class*="span"], .row-fluid input[class*="span"], .row-fluid select[class*="span"], .row-fluid textarea[class*="span"], .row-fluid .uneditable-input[class*="span"], .row-fluid .input-prepend [class*="span"], .row-fluid .input-append [class*="span"] {display:inline-block}input, textarea, .uneditable-input {margin-left:0}.controls-row [class*="span"]+[class*="span"] {margin-left:20px}input.span12, textarea.span12, .uneditable-input.span12 {width:926px}input.span11, textarea.span11, .uneditable-input.span11 {width:846px}input.span10, textarea.span10, .uneditable-input.span10 {width:766px}input.span9, textarea.span9, .uneditable-input.span9 {width:686px}input.span8, textarea.span8, .uneditable-input.span8 {width:606px}input.span7, textarea.span7, .uneditable-input.span7 {width:526px}input.span6, textarea.span6, .uneditable-input.span6 {width:446px}input.span5, textarea.span5, .uneditable-input.span5 {width:366px}input.span4, textarea.span4, .uneditable-input.span4 {width:286px}input.span3, textarea.span3, .uneditable-input.span3 {width:206px}input.span2, textarea.span2, .uneditable-input.span2 {width:126px}input.span1, textarea.span1, .uneditable-input.span1 {width:46px}.controls-row {*zoom:1}.controls-row:before, .controls-row:after {display:table;line-height:0;content:""}.controls-row:after {clear:both}.controls-row [class*="span"], .row-fluid .controls-row [class*="span"] {float:left}.controls-row .checkbox[class*="span"], .controls-row .radio[class*="span"] {padding-top:5px}input[disabled], select[disabled], textarea[disabled], input[readonly], select[readonly], textarea[readonly] {cursor:not-allowed;background-color:#eee}input[type="radio"][disabled], input[type="checkbox"][disabled], input[type="radio"][readonly], input[type="checkbox"][readonly] {background-color:transparent}.control-group.warning .control-label, .control-group.warning .help-block, .control-group.warning .help-inline {color:#c09853}.control-group.warning .checkbox, .control-group.warning .radio, .control-group.warning input, .control-group.warning select, .control-group.warning textarea {color:#c09853}.control-group.warning input, .control-group.warning select, .control-group.warning textarea {border-color:#c09853;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.warning input:focus, .control-group.warning select:focus, .control-group.warning textarea:focus {border-color:#a47e3c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #dbc59e;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #dbc59e;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #dbc59e}.control-group.warning .input-prepend .add-on, .control-group.warning .input-append .add-on {color:#c09853;background-color:#fcf8e3;border-color:#c09853}.control-group.error .control-label, .control-group.error .help-block, .control-group.error .help-inline {color:#b94a48}.control-group.error .checkbox, .control-group.error .radio, .control-group.error input, .control-group.error select, .control-group.error textarea {color:#b94a48}.control-group.error input, .control-group.error select, .control-group.error textarea {border-color:#b94a48;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.error input:focus, .control-group.error select:focus, .control-group.error textarea:focus {border-color:#953b39;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #d59392;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #d59392;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #d59392}.control-group.error .input-prepend .add-on, .control-group.error .input-append .add-on {color:#b94a48;background-color:#f2dede;border-color:#b94a48}.control-group.success .control-label, .control-group.success .help-block, .control-group.success .help-inline {color:#468847}.control-group.success .checkbox, .control-group.success .radio, .control-group.success input, .control-group.success select, .control-group.success textarea {color:#468847}.control-group.success input, .control-group.success select, .control-group.success textarea {border-color:#468847;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.success input:focus, .control-group.success select:focus, .control-group.success textarea:focus {border-color:#356635;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #7aba7b;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #7aba7b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #7aba7b}.control-group.success .input-prepend .add-on, .control-group.success .input-append .add-on {color:#468847;background-color:#dff0d8;border-color:#468847}.control-group.info .control-label, .control-group.info .help-block, .control-group.info .help-inline {color:#3a87ad}.control-group.info .checkbox, .control-group.info .radio, .control-group.info input, .control-group.info select, .control-group.info textarea {color:#3a87ad}.control-group.info input, .control-group.info select, .control-group.info textarea {border-color:#3a87ad;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.info input:focus, .control-group.info select:focus, .control-group.info textarea:focus {border-color:#2d6987;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #7ab5d3;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #7ab5d3;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #7ab5d3}.control-group.info .input-prepend .add-on, .control-group.info .input-append .add-on {color:#3a87ad;background-color:#d9edf7;border-color:#3a87ad}input:focus:invalid, textarea:focus:invalid, select:focus:invalid {color:#b94a48;border-color:#ee5f5b}input:focus:invalid:focus, textarea:focus:invalid:focus, select:focus:invalid:focus {border-color:#e9322d;-webkit-box-shadow:0 0 6px #f8b9b7;-moz-box-shadow:0 0 6px #f8b9b7;box-shadow:0 0 6px #f8b9b7}.form-actions {padding:19px 20px 20px;margin-top:20px;margin-bottom:20px;background-color:#f5f5f5;border-top:1px solid #e5e5e5;*zoom:1}.form-actions:before, .form-actions:after {display:table;line-height:0;content:""}.form-actions:after {clear:both}.help-block, .help-inline {color:#595959}.help-block {display:block;margin-bottom:10px}.help-inline {display:inline-block;*display:inline;padding-left:5px;vertical-align:middle;*zoom:1}.input-append, .input-prepend {display:inline-block;margin-bottom:10px;font-size:0;white-space:nowrap;vertical-align:middle}.input-append input, .input-prepend input, .input-append select, .input-prepend select, .input-append .uneditable-input, .input-prepend .uneditable-input, .input-append .dropdown-menu, .input-prepend .dropdown-menu, .input-append .popover, .input-prepend .popover {font-size:14px}.input-append input, .input-prepend input, .input-append select, .input-prepend select, .input-append .uneditable-input, .input-prepend .uneditable-input {position:relative;margin-bottom:0;*margin-left:0;vertical-align:top;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-append input:focus, .input-prepend input:focus, .input-append select:focus, .input-prepend select:focus, .input-append .uneditable-input:focus, .input-prepend .uneditable-input:focus {z-index:2}.input-append .add-on, .input-prepend .add-on {display:inline-block;width:auto;height:20px;min-width:16px;padding:4px 5px;font-size:14px;font-weight:normal;line-height:20px;text-align:center;text-shadow:0 1px 0 #fff;background-color:#eee;border:1px solid #ccc}.input-append .add-on, .input-prepend .add-on, .input-append .btn, .input-prepend .btn, .input-append .btn-group>.dropdown-toggle, .input-prepend .btn-group>.dropdown-toggle {vertical-align:top;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-append .active, .input-prepend .active {background-color:#a9dba9;border-color:#46a546}.input-prepend .add-on, .input-prepend .btn {margin-right:-1px}.input-prepend .add-on:first-child, .input-prepend .btn:first-child {-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-append input, .input-append select, .input-append .uneditable-input {-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-append input+.btn-group .btn:last-child, .input-append select+.btn-group .btn:last-child, .input-append .uneditable-input+.btn-group .btn:last-child {-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-append .add-on, .input-append .btn, .input-append .btn-group {margin-left:-1px}.input-append .add-on:last-child, .input-append .btn:last-child, .input-append .btn-group:last-child>.dropdown-toggle {-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append input, .input-prepend.input-append select, .input-prepend.input-append .uneditable-input {-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-prepend.input-append input+.btn-group .btn, .input-prepend.input-append select+.btn-group .btn, .input-prepend.input-append .uneditable-input+.btn-group .btn {-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append .add-on:first-child, .input-prepend.input-append .btn:first-child {margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-prepend.input-append .add-on:last-child, .input-prepend.input-append .btn:last-child {margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append .btn-group:first-child {margin-left:0}input.search-query {padding-right:14px;padding-right:4px \9;padding-left:14px;padding-left:4px \9;margin-bottom:0;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.form-search .input-append .search-query, .form-search .input-prepend .search-query {-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.form-search .input-append .search-query {-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search .input-append .btn {-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .search-query {-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .btn {-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search input, .form-inline input, .form-horizontal input, .form-search textarea, .form-inline textarea, .form-horizontal textarea, .form-search select, .form-inline select, .form-horizontal select, .form-search .help-inline, .form-inline .help-inline, .form-horizontal .help-inline, .form-search .uneditable-input, .form-inline .uneditable-input, .form-horizontal .uneditable-input, .form-search .input-prepend, .form-inline .input-prepend, .form-horizontal .input-prepend, .form-search .input-append, .form-inline .input-append, .form-horizontal .input-append {display:inline-block;*display:inline;margin-bottom:0;vertical-align:middle;*zoom:1}.form-search .hide, .form-inline .hide, .form-horizontal .hide {display:none}.form-search label, .form-inline label, .form-search .btn-group, .form-inline .btn-group {display:inline-block}.form-search .input-append, .form-inline .input-append, .form-search .input-prepend, .form-inline .input-prepend {margin-bottom:0}.form-search .radio, .form-search .checkbox, .form-inline .radio, .form-inline .checkbox {padding-left:0;margin-bottom:0;vertical-align:middle}.form-search .radio input[type="radio"], .form-search .checkbox input[type="checkbox"], .form-inline .radio input[type="radio"], .form-inline .checkbox input[type="checkbox"] {float:left;margin-right:3px;margin-left:0}.control-group {margin-bottom:10px}legend+.control-group {margin-top:20px;-webkit-margin-top-collapse:separate}.form-horizontal .control-group {margin-bottom:20px;*zoom:1}.form-horizontal .control-group:before, .form-horizontal .control-group:after {display:table;line-height:0;content:""}.form-horizontal .control-group:after {clear:both}.form-horizontal .control-label {float:left;width:160px;padding-top:5px;text-align:right}.form-horizontal .controls {*display:inline-block;*padding-left:20px;margin-left:180px;*margin-left:0}.form-horizontal .controls:first-child {*padding-left:180px}.form-horizontal .help-block {margin-bottom:0}.form-horizontal input+.help-block, .form-horizontal select+.help-block, .form-horizontal textarea+.help-block, .form-horizontal .uneditable-input+.help-block, .form-horizontal .input-prepend+.help-block, .form-horizontal .input-append+.help-block {margin-top:10px}.form-horizontal .form-actions {padding-left:180px}table {max-width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0}.table {width:100%;margin-bottom:20px}.table th, .table td {padding:8px;line-height:20px;text-align:left;vertical-align:top;border-top:1px solid #ddd}.table th {font-weight:bold}.table thead th {vertical-align:bottom}.table caption+thead tr:first-child th, .table caption+thead tr:first-child td, .table colgroup+thead tr:first-child th, .table colgroup+thead tr:first-child td, .table thead:first-child tr:first-child th, .table thead:first-child tr:first-child td {border-top:0}.table tbody+tbody {border-top:2px solid #ddd}.table .table {background-color:#fff}.table-condensed th, .table-condensed td {padding:4px 5px}.table-bordered {border:1px solid #ddd;border-collapse:separate;*border-collapse:collapse;border-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.table-bordered th, .table-bordered td {border-left:1px solid #ddd}.table-bordered caption+thead tr:first-child th, .table-bordered caption+tbody tr:first-child th, .table-bordered caption+tbody tr:first-child td, .table-bordered colgroup+thead tr:first-child th, .table-bordered colgroup+tbody tr:first-child th, .table-bordered colgroup+tbody tr:first-child td, .table-bordered thead:first-child tr:first-child th, .table-bordered tbody:first-child tr:first-child th, .table-bordered tbody:first-child tr:first-child td {border-top:0}.table-bordered thead:first-child tr:first-child>th:first-child, .table-bordered tbody:first-child tr:first-child>td:first-child, .table-bordered tbody:first-child tr:first-child>th:first-child {-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered thead:first-child tr:first-child>th:last-child, .table-bordered tbody:first-child tr:first-child>td:last-child, .table-bordered tbody:first-child tr:first-child>th:last-child {-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px}.table-bordered thead:last-child tr:last-child>th:first-child, .table-bordered tbody:last-child tr:last-child>td:first-child, .table-bordered tbody:last-child tr:last-child>th:first-child, .table-bordered tfoot:last-child tr:last-child>td:first-child, .table-bordered tfoot:last-child tr:last-child>th:first-child {-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px}.table-bordered thead:last-child tr:last-child>th:last-child, .table-bordered tbody:last-child tr:last-child>td:last-child, .table-bordered tbody:last-child tr:last-child>th:last-child, .table-bordered tfoot:last-child tr:last-child>td:last-child, .table-bordered tfoot:last-child tr:last-child>th:last-child {-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px}.table-bordered tfoot+tbody:last-child tr:last-child td:first-child {-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0;-moz-border-radius-bottomleft:0}.table-bordered tfoot+tbody:last-child tr:last-child td:last-child {-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0;-moz-border-radius-bottomright:0}.table-bordered caption+thead tr:first-child th:first-child, .table-bordered caption+tbody tr:first-child td:first-child, .table-bordered colgroup+thead tr:first-child th:first-child, .table-bordered colgroup+tbody tr:first-child td:first-child {-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered caption+thead tr:first-child th:last-child, .table-bordered caption+tbody tr:first-child td:last-child, .table-bordered colgroup+thead tr:first-child th:last-child, .table-bordered colgroup+tbody tr:first-child td:last-child {-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px}.table-striped tbody>tr:nth-child(odd)>td, .table-striped tbody>tr:nth-child(odd)>th {background-color:#f9f9f9}.table-hover tbody tr:hover>td, .table-hover tbody tr:hover>th {background-color:#f5f5f5}table td[class*="span"], table th[class*="span"], .row-fluid table td[class*="span"], .row-fluid table th[class*="span"] {display:table-cell;float:none;margin-left:0}.table td.span1, .table th.span1 {float:none;width:44px;margin-left:0}.table td.span2, .table th.span2 {float:none;width:124px;margin-left:0}.table td.span3, .table th.span3 {float:none;width:204px;margin-left:0}.table td.span4, .table th.span4 {float:none;width:284px;margin-left:0}.table td.span5, .table th.span5 {float:none;width:364px;margin-left:0}.table td.span6, .table th.span6 {float:none;width:444px;margin-left:0}.table td.span7, .table th.span7 {float:none;width:524px;margin-left:0}.table td.span8, .table th.span8 {float:none;width:604px;margin-left:0}.table td.span9, .table th.span9 {float:none;width:684px;margin-left:0}.table td.span10, .table th.span10 {float:none;width:764px;margin-left:0}.table td.span11, .table th.span11 {float:none;width:844px;margin-left:0}.table td.span12, .table th.span12 {float:none;width:924px;margin-left:0}.table tbody tr.success>td {background-color:#dff0d8}.table tbody tr.error>td {background-color:#f2dede}.table tbody tr.warning>td {background-color:#fcf8e3}.table tbody tr.info>td {background-color:#d9edf7}.table-hover tbody tr.success:hover>td {background-color:#d0e9c6}.table-hover tbody tr.error:hover>td {background-color:#ebcccc}.table-hover tbody tr.warning:hover>td {background-color:#faf2cc}.table-hover tbody tr.info:hover>td {background-color:#c4e3f3}[class^="icon-"], [class*=" icon-"] {display:inline-block;width:14px;height:14px;margin-top:1px;*margin-right:.3em;line-height:14px;vertical-align:text-top; background-image:url("../img/glyphicons-halflings.html");background-position:14px 14px;background-repeat:no-repeat}.icon-white, .nav-pills>.active>a>[class^="icon-"], .nav-pills>.active>a>[class*=" icon-"], .nav-list>.active>a>[class^="icon-"], .nav-list>.active>a>[class*=" icon-"], .navbar-inverse .nav>.active>a>[class^="icon-"], .navbar-inverse .nav>.active>a>[class*=" icon-"], .dropdown-menu>li>a:hover>[class^="icon-"], .dropdown-menu>li>a:focus>[class^="icon-"], .dropdown-menu>li>a:hover>[class*=" icon-"], .dropdown-menu>li>a:focus>[class*=" icon-"], .dropdown-menu>.active>a>[class^="icon-"], .dropdown-menu>.active>a>[class*=" icon-"], .dropdown-submenu:hover>a>[class^="icon-"], .dropdown-submenu:focus>a>[class^="icon-"], .dropdown-submenu:hover>a>[class*=" icon-"], .dropdown-submenu:focus>a>[class*=" icon-"] {background-image:url("../img/glyphicons-halflings-white.png")}.icon-glass {background-position:0 0}.icon-music {background-position:-24px 0}.icon-search {background-position:-48px 0}.icon-envelope {background-position:-72px 0}.icon-heart {background-position:-96px 0}.icon-star {background-position:-120px 0}.icon-star-empty {background-position:-144px 0}.icon-user {background-position:-168px 0}.icon-film {background-position:-192px 0}.icon-th-large {background-position:-216px 0}.icon-th {background-position:-240px 0}.icon-th-list {background-position:-264px 0}.icon-ok {background-position:-288px 0}.icon-remove {background-position:-312px 0}.icon-zoom-in {background-position:-336px 0}.icon-zoom-out {background-position:-360px 0}.icon-off {background-position:-384px 0}.icon-signal {background-position:-408px 0}.icon-cog {background-position:-432px 0}.icon-trash {background-position:-456px 0}.icon-home {background-position:0 -24px}.icon-file {background-position:-24px -24px}.icon-time {background-position:-48px -24px}.icon-road {background-position:-72px -24px}.icon-download-alt {background-position:-96px -24px}.icon-download {background-position:-120px -24px}.icon-upload {background-position:-144px -24px}.icon-inbox {background-position:-168px -24px}.icon-play-circle {background-position:-192px -24px}.icon-repeat {background-position:-216px -24px}.icon-refresh {background-position:-240px -24px}.icon-list-alt {background-position:-264px -24px}.icon-lock {background-position:-287px -24px}.icon-flag {background-position:-312px -24px}.icon-headphones {background-position:-336px -24px}.icon-volume-off {background-position:-360px -24px}.icon-volume-down {background-position:-384px -24px}.icon-volume-up {background-position:-408px -24px}.icon-qrcode {background-position:-432px -24px}.icon-barcode {background-position:-456px -24px}.icon-tag {background-position:0 -48px}.icon-tags {background-position:-25px -48px}.icon-book {background-position:-48px -48px}.icon-bookmark {background-position:-72px -48px}.icon-print {background-position:-96px -48px}.icon-camera {background-position:-120px -48px}.icon-font {background-position:-144px -48px}.icon-bold {background-position:-167px -48px}.icon-italic {background-position:-192px -48px}.icon-text-height {background-position:-216px -48px}.icon-text-width {background-position:-240px -48px}.icon-align-left {background-position:-264px -48px}.icon-align-center {background-position:-288px -48px}.icon-align-right {background-position:-312px -48px}.icon-align-justify {background-position:-336px -48px}.icon-list {background-position:-360px -48px}.icon-indent-left {background-position:-384px -48px}.icon-indent-right {background-position:-408px -48px}.icon-facetime-video {background-position:-432px -48px}.icon-picture {background-position:-456px -48px}.icon-pencil {background-position:0 -72px}.icon-map-marker {background-position:-24px -72px}.icon-adjust {background-position:-48px -72px}.icon-tint {background-position:-72px -72px}.icon-edit {background-position:-96px -72px}.icon-share {background-position:-120px -72px}.icon-check {background-position:-144px -72px}.icon-move {background-position:-168px -72px}.icon-step-backward {background-position:-192px -72px}.icon-fast-backward {background-position:-216px -72px}.icon-backward {background-position:-240px -72px}.icon-play {background-position:-264px -72px}.icon-pause {background-position:-288px -72px}.icon-stop {background-position:-312px -72px}.icon-forward {background-position:-336px -72px}.icon-fast-forward {background-position:-360px -72px}.icon-step-forward {background-position:-384px -72px}.icon-eject {background-position:-408px -72px}.icon-chevron-left {background-position:-432px -72px}.icon-chevron-right {background-position:-456px -72px}.icon-plus-sign {background-position:0 -96px}.icon-minus-sign {background-position:-24px -96px}.icon-remove-sign {background-position:-48px -96px}.icon-ok-sign {background-position:-72px -96px}.icon-question-sign {background-position:-96px -96px}.icon-info-sign {background-position:-120px -96px}.icon-screenshot {background-position:-144px -96px}.icon-remove-circle {background-position:-168px -96px}.icon-ok-circle {background-position:-192px -96px}.icon-ban-circle {background-position:-216px -96px}.icon-arrow-left {background-position:-240px -96px}.icon-arrow-right {background-position:-264px -96px}.icon-arrow-up {background-position:-289px -96px}.icon-arrow-down {background-position:-312px -96px}.icon-share-alt {background-position:-336px -96px}.icon-resize-full {background-position:-360px -96px}.icon-resize-small {background-position:-384px -96px}.icon-plus {background-position:-408px -96px}.icon-minus {background-position:-433px -96px}.icon-asterisk {background-position:-456px -96px}.icon-exclamation-sign {background-position:0 -120px}.icon-gift {background-position:-24px -120px}.icon-leaf {background-position:-48px -120px}.icon-fire {background-position:-72px -120px}.icon-eye-open {background-position:-96px -120px}.icon-eye-close {background-position:-120px -120px}.icon-warning-sign {background-position:-144px -120px}.icon-plane {background-position:-168px -120px}.icon-calendar {background-position:-192px -120px}.icon-random {width:16px;background-position:-216px -120px}.icon-comment {background-position:-240px -120px}.icon-magnet {background-position:-264px -120px}.icon-chevron-up {background-position:-288px -120px}.icon-chevron-down {background-position:-313px -119px}.icon-retweet {background-position:-336px -120px}.icon-shopping-cart {background-position:-360px -120px}.icon-folder-close {width:16px;background-position:-384px -120px}.icon-folder-open {width:16px;background-position:-408px -120px}.icon-resize-vertical {background-position:-432px -119px}.icon-resize-horizontal {background-position:-456px -118px}.icon-hdd {background-position:0 -144px}.icon-bullhorn {background-position:-24px -144px}.icon-bell {background-position:-48px -144px}.icon-certificate {background-position:-72px -144px}.icon-thumbs-up {background-position:-96px -144px}.icon-thumbs-down {background-position:-120px -144px}.icon-hand-right {background-position:-144px -144px}.icon-hand-left {background-position:-168px -144px}.icon-hand-up {background-position:-192px -144px}.icon-hand-down {background-position:-216px -144px}.icon-circle-arrow-right {background-position:-240px -144px}.icon-circle-arrow-left {background-position:-264px -144px}.icon-circle-arrow-up {background-position:-288px -144px}.icon-circle-arrow-down {background-position:-312px -144px}.icon-globe {background-position:-336px -144px}.icon-wrench {background-position:-360px -144px}.icon-tasks {background-position:-384px -144px}.icon-filter {background-position:-408px -144px}.icon-briefcase {background-position:-432px -144px}.icon-fullscreen {background-position:-456px -144px}.dropup, .dropdown {position:relative}.dropdown-toggle {*margin-bottom:-3px}.dropdown-toggle:active, .open .dropdown-toggle {outline:0}.caret {display:inline-block;width:0;height:0;vertical-align:top;border-top:4px solid #000;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.dropdown .caret {margin-top:8px;margin-left:2px}.dropdown-menu {position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);*border-right-width:2px;*border-bottom-width:2px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.dropdown-menu.pull-right {right:0;left:auto}.dropdown-menu .divider {*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.dropdown-menu>li>a {display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover, .dropdown-menu>li>a:focus, .dropdown-submenu:hover>a, .dropdown-submenu:focus>a {color:#fff;text-decoration:none;background-color:#0081c2;background-image:-moz-linear-gradient(top, #08c, #0077b3);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#0077b3));background-image:-webkit-linear-gradient(top, #08c, #0077b3);background-image:-o-linear-gradient(top, #08c, #0077b3);background-image:linear-gradient(to bottom, #08c, #0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0)}.dropdown-menu>.active>a, .dropdown-menu>.active>a:hover, .dropdown-menu>.active>a:focus {color:#fff;text-decoration:none;background-color:#0081c2;background-image:-moz-linear-gradient(top, #08c, #0077b3);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#0077b3));background-image:-webkit-linear-gradient(top, #08c, #0077b3);background-image:-o-linear-gradient(top, #08c, #0077b3);background-image:linear-gradient(to bottom, #08c, #0077b3);background-repeat:repeat-x;outline:0;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0)}.dropdown-menu>.disabled>a, .dropdown-menu>.disabled>a:hover, .dropdown-menu>.disabled>a:focus {color:#999}.dropdown-menu>.disabled>a:hover, .dropdown-menu>.disabled>a:focus {text-decoration:none;cursor:default;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open {*z-index:1000}.open>.dropdown-menu {display:block}.pull-right>.dropdown-menu {right:0;left:auto}.dropup .caret, .navbar-fixed-bottom .dropdown .caret {border-top:0;border-bottom:4px solid #000;content:""}.dropup .dropdown-menu, .navbar-fixed-bottom .dropdown .dropdown-menu {top:auto;bottom:100%;margin-bottom:1px}.dropdown-submenu {position:relative}.dropdown-submenu>.dropdown-menu {top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px}.dropdown-submenu:hover>.dropdown-menu {display:block}.dropup .dropdown-submenu>.dropdown-menu {top:auto;bottom:0;margin-top:0;margin-bottom:-2px;-webkit-border-radius:5px 5px 5px 0;-moz-border-radius:5px 5px 5px 0;border-radius:5px 5px 5px 0}.dropdown-submenu>a:after {display:block;float:right;width:0;height:0;margin-top:5px;margin-right:-10px;border-color:transparent;border-left-color:#ccc;border-style:solid;border-width:5px 0 5px 5px;content:" "}.dropdown-submenu:hover>a:after {border-left-color:#fff}.dropdown-submenu.pull-left {float:none}.dropdown-submenu.pull-left>.dropdown-menu {left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.dropdown .dropdown-menu .nav-header {padding-right:20px;padding-left:20px}.typeahead {z-index:1051;margin-top:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.well {min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote {border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-large {padding:24px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.well-small {padding:9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.fade {opacity:0;-webkit-transition:opacity .15s linear;-moz-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in {opacity:1}.collapse {position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;-moz-transition:height .35s ease;-o-transition:height .35s ease;transition:height .35s ease}.collapse.in {height:auto}.close {float:right;font-size:20px;font-weight:bold;line-height:20px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover, .close:focus {color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}button.close {padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.btn {display:inline-block;*display:inline;padding:4px 12px;margin-bottom:0;*margin-left:.3em;font-size:14px;line-height:20px;color:#333;text-align:center;text-shadow:0 1px 1px rgba(255,255,255,0.75);vertical-align:middle;cursor:pointer;background-color:#f5f5f5;*background-color:#e6e6e6;background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#e6e6e6));background-image:-webkit-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:linear-gradient(to bottom, #fff, #e6e6e6);background-repeat:repeat-x;border:1px solid #ccc;*border:0;border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom-color:#b3b3b3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);*zoom:1;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 2px rgba(0,0,0,0.05)}.btn:hover, .btn:focus, .btn:active, .btn.active, .btn.disabled, .btn[disabled] {color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.btn:active, .btn.active {background-color:#ccc \9}.btn:first-child {*margin-left:0}.btn:hover, .btn:focus {color:#333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.btn:focus {outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.active, .btn:active {background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.05)}.btn.disabled, .btn[disabled] {cursor:default;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-large {padding:11px 19px;font-size:17.5px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.btn-large [class^="icon-"], .btn-large [class*=" icon-"] {margin-top:4px}.btn-small {padding:2px 10px;font-size:11.9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-small [class^="icon-"], .btn-small [class*=" icon-"] {margin-top:0}.btn-mini [class^="icon-"], .btn-mini [class*=" icon-"] {margin-top:-1px}.btn-mini {padding:0 6px;font-size:10.5px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-block {display:block;width:100%;padding-right:0;padding-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.btn-block+.btn-block {margin-top:5px}input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="button"].btn-block {width:100%}.btn-primary.active, .btn-warning.active, .btn-danger.active, .btn-success.active, .btn-info.active, .btn-inverse.active {color:rgba(255,255,255,0.75)}.btn-primary {color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#006dcc;*background-color:#04c;background-image:-moz-linear-gradient(top, #08c, #04c);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#04c));background-image:-webkit-linear-gradient(top, #08c, #04c);background-image:-o-linear-gradient(top, #08c, #04c);background-image:linear-gradient(to bottom, #08c, #04c);background-repeat:repeat-x;border-color:#04c #04c #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .btn-primary.disabled, .btn-primary[disabled] {color:#fff;background-color:#04c;*background-color:#003bb3}.btn-primary:active, .btn-primary.active {background-color:#039 \9}.btn-warning {color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#faa732;*background-color:#f89406;background-image:-moz-linear-gradient(top, #fbb450, #f89406);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));background-image:-webkit-linear-gradient(top, #fbb450, #f89406);background-image:-o-linear-gradient(top, #fbb450, #f89406);background-image:linear-gradient(to bottom, #fbb450, #f89406);background-repeat:repeat-x;border-color:#f89406 #f89406 #ad6704;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-warning:hover, .btn-warning:focus, .btn-warning:active, .btn-warning.active, .btn-warning.disabled, .btn-warning[disabled] {color:#fff;background-color:#f89406;*background-color:#df8505}.btn-warning:active, .btn-warning.active {background-color:#c67605 \9}.btn-danger {color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#da4f49;*background-color:#bd362f;background-image:-moz-linear-gradient(top, #ee5f5b, #bd362f);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));background-image:-webkit-linear-gradient(top, #ee5f5b, #bd362f);background-image:-o-linear-gradient(top, #ee5f5b, #bd362f);background-image:linear-gradient(to bottom, #ee5f5b, #bd362f);background-repeat:repeat-x;border-color:#bd362f #bd362f #802420;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-danger:hover, .btn-danger:focus, .btn-danger:active, .btn-danger.active, .btn-danger.disabled, .btn-danger[disabled] {color:#fff;background-color:#bd362f;*background-color:#a9302a}.btn-danger:active, .btn-danger.active {background-color:#942a25 \9}.btn-success {color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#5bb75b;*background-color:#51a351;background-image:-moz-linear-gradient(top, #62c462, #51a351);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351));background-image:-webkit-linear-gradient(top, #62c462, #51a351);background-image:-o-linear-gradient(top, #62c462, #51a351);background-image:linear-gradient(to bottom, #62c462, #51a351);background-repeat:repeat-x;border-color:#51a351 #51a351 #387038;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff51a351', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-success:hover, .btn-success:focus, .btn-success:active, .btn-success.active, .btn-success.disabled, .btn-success[disabled] {color:#fff;background-color:#51a351;*background-color:#499249}.btn-success:active, .btn-success.active {background-color:#408140 \9}.btn-info {color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#49afcd;*background-color:#2f96b4;background-image:-moz-linear-gradient(top, #5bc0de, #2f96b4);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4));background-image:-webkit-linear-gradient(top, #5bc0de, #2f96b4);background-image:-o-linear-gradient(top, #5bc0de, #2f96b4);background-image:linear-gradient(to bottom, #5bc0de, #2f96b4);background-repeat:repeat-x;border-color:#2f96b4 #2f96b4 #1f6377;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2f96b4', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-info:hover, .btn-info:focus, .btn-info:active, .btn-info.active, .btn-info.disabled, .btn-info[disabled] {color:#fff;background-color:#2f96b4;*background-color:#2a85a0}.btn-info:active, .btn-info.active {background-color:#24748c \9}.btn-inverse {color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#363636;*background-color:#222;background-image:-moz-linear-gradient(top, #444, #222);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#444), to(#222));background-image:-webkit-linear-gradient(top, #444, #222);background-image:-o-linear-gradient(top, #444, #222);background-image:linear-gradient(to bottom, #444, #222);background-repeat:repeat-x;border-color:#222 #222 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-inverse:hover, .btn-inverse:focus, .btn-inverse:active, .btn-inverse.active, .btn-inverse.disabled, .btn-inverse[disabled] {color:#fff;background-color:#222;*background-color:#151515}.btn-inverse:active, .btn-inverse.active {background-color:#080808 \9}button.btn, input[type="submit"].btn {*padding-top:3px;*padding-bottom:3px}button.btn::-moz-focus-inner, input[type="submit"].btn::-moz-focus-inner {padding:0;border:0}button.btn.btn-large, input[type="submit"].btn.btn-large {*padding-top:7px;*padding-bottom:7px}button.btn.btn-small, input[type="submit"].btn.btn-small {*padding-top:3px;*padding-bottom:3px}button.btn.btn-mini, input[type="submit"].btn.btn-mini {*padding-top:1px;*padding-bottom:1px}.btn-link, .btn-link:active, .btn-link[disabled] {background-color:transparent;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-link {color:#08c;cursor:pointer;border-color:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-link:hover, .btn-link:focus {color:#005580;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover, .btn-link[disabled]:focus {color:#333;text-decoration:none}.btn-group {position:relative;display:inline-block;*display:inline;*margin-left:.3em;font-size:0;white-space:nowrap;vertical-align:middle;*zoom:1}.btn-group:first-child {*margin-left:0}.btn-group+.btn-group {margin-left:5px}.btn-toolbar {margin-top:10px;margin-bottom:10px;font-size:0}.btn-toolbar>.btn+.btn, .btn-toolbar>.btn-group+.btn, .btn-toolbar>.btn+.btn-group {margin-left:5px}.btn-group>.btn {position:relative;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group>.btn+.btn {margin-left:-1px}.btn-group>.btn, .btn-group>.dropdown-menu, .btn-group>.popover {font-size:14px}.btn-group>.btn-mini {font-size:10.5px}.btn-group>.btn-small {font-size:11.9px}.btn-group>.btn-large {font-size:17.5px}.btn-group>.btn:first-child {margin-left:0;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-topleft:4px}.btn-group>.btn:last-child, .btn-group>.dropdown-toggle {-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px}.btn-group>.btn.large:first-child {margin-left:0;-webkit-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-webkit-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-topleft:6px}.btn-group>.btn.large:last-child, .btn-group>.large.dropdown-toggle {-webkit-border-top-right-radius:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;border-bottom-right-radius:6px;-moz-border-radius-topright:6px;-moz-border-radius-bottomright:6px}.btn-group>.btn:hover, .btn-group>.btn:focus, .btn-group>.btn:active, .btn-group>.btn.active {z-index:2}.btn-group .dropdown-toggle:active, .btn-group.open .dropdown-toggle {outline:0}.btn-group>.btn+.dropdown-toggle {*padding-top:5px;padding-right:8px;*padding-bottom:5px;padding-left:8px;-webkit-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125), inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125), inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 1px 0 0 rgba(255,255,255,0.125), inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 2px rgba(0,0,0,0.05)}.btn-group>.btn-mini+.dropdown-toggle {*padding-top:2px;padding-right:5px;*padding-bottom:2px;padding-left:5px}.btn-group>.btn-small+.dropdown-toggle {*padding-top:5px;*padding-bottom:4px}.btn-group>.btn-large+.dropdown-toggle {*padding-top:7px;padding-right:12px;*padding-bottom:7px;padding-left:12px}.btn-group.open .dropdown-toggle {background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.05)}.btn-group.open .btn.dropdown-toggle {background-color:#e6e6e6}.btn-group.open .btn-primary.dropdown-toggle {background-color:#04c}.btn-group.open .btn-warning.dropdown-toggle {background-color:#f89406}.btn-group.open .btn-danger.dropdown-toggle {background-color:#bd362f}.btn-group.open .btn-success.dropdown-toggle {background-color:#51a351}.btn-group.open .btn-info.dropdown-toggle {background-color:#2f96b4}.btn-group.open .btn-inverse.dropdown-toggle {background-color:#222}.btn .caret {margin-top:8px;margin-left:0}.btn-large .caret {margin-top:6px}.btn-large .caret {border-top-width:5px;border-right-width:5px;border-left-width:5px}.btn-mini .caret, .btn-small .caret {margin-top:8px}.dropup .btn-large .caret {border-bottom-width:5px}.btn-primary .caret, .btn-warning .caret, .btn-danger .caret, .btn-info .caret, .btn-success .caret, .btn-inverse .caret {border-top-color:#fff;border-bottom-color:#fff}.btn-group-vertical {display:inline-block;*display:inline;*zoom:1}.btn-group-vertical>.btn {display:block;float:none;max-width:100%;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group-vertical>.btn+.btn {margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:first-child {-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.btn-group-vertical>.btn:last-child {-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.btn-group-vertical>.btn-large:first-child {-webkit-border-radius:6px 6px 0 0;-moz-border-radius:6px 6px 0 0;border-radius:6px 6px 0 0}.btn-group-vertical>.btn-large:last-child {-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.alert {padding:8px 35px 8px 14px;margin-bottom:20px;text-shadow:0 1px 0 rgba(255,255,255,0.5);background-color:#fcf8e3;border:1px solid #fbeed5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.alert, .alert h4 {color:#c09853}.alert h4 {margin:0}.alert .close {position:relative;top:-2px;right:-21px;line-height:20px}.alert-success {color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.alert-success h4 {color:#468847}.alert-danger, .alert-error {color:#b94a48;background-color:#f2dede;border-color:#eed3d7}.alert-danger h4, .alert-error h4 {color:#b94a48}.alert-info {color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}.alert-info h4 {color:#3a87ad}.alert-block {padding-top:14px;padding-bottom:14px}.alert-block>p, .alert-block>ul {margin-bottom:0}.alert-block p+p {margin-top:5px}.nav {margin-bottom:20px;margin-left:0;list-style:none}.nav>li>a {display:block}.nav>li>a:hover, .nav>li>a:focus {text-decoration:none;background-color:#eee}.nav>li>a>img {max-width:none}.nav>.pull-right {float:right}.nav-header {display:block;padding:3px 15px;font-size:11px;font-weight:bold;line-height:20px;color:#999;text-shadow:0 1px 0 rgba(255,255,255,0.5);text-transform:uppercase}.nav li+.nav-header {margin-top:9px}.nav-list {padding-right:15px;padding-left:15px;margin-bottom:0}.nav-list>li>a, .nav-list .nav-header {margin-right:-15px;margin-left:-15px;text-shadow:0 1px 0 rgba(255,255,255,0.5)}.nav-list>li>a {padding:3px 15px}.nav-list>.active>a, .nav-list>.active>a:hover, .nav-list>.active>a:focus {color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.2);background-color:#08c}.nav-list [class^="icon-"], .nav-list [class*=" icon-"] {margin-right:2px}.nav-list .divider {*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.nav-tabs, .nav-pills {*zoom:1}.nav-tabs:before, .nav-pills:before, .nav-tabs:after, .nav-pills:after {display:table;line-height:0;content:""}.nav-tabs:after, .nav-pills:after {clear:both}.nav-tabs>li, .nav-pills>li {float:left}.nav-tabs>li>a, .nav-pills>li>a {padding-right:12px;padding-left:12px;margin-right:2px;line-height:14px}.nav-tabs {border-bottom:1px solid #ddd}.nav-tabs>li {margin-bottom:-1px}.nav-tabs>li>a {padding-top:8px;padding-bottom:8px;line-height:20px;border:1px solid transparent;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover, .nav-tabs>li>a:focus {border-color:#eee #eee #ddd}.nav-tabs>.active>a, .nav-tabs>.active>a:hover, .nav-tabs>.active>a:focus {color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-pills>li>a {padding-top:8px;padding-bottom:8px;margin-top:2px;margin-bottom:2px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.nav-pills>.active>a, .nav-pills>.active>a:hover, .nav-pills>.active>a:focus {color:#fff;background-color:#08c}.nav-stacked>li {float:none}.nav-stacked>li>a {margin-right:0}.nav-tabs.nav-stacked {border-bottom:0}.nav-tabs.nav-stacked>li>a {border:1px solid #ddd;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.nav-tabs.nav-stacked>li:first-child>a {-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-topleft:4px}.nav-tabs.nav-stacked>li:last-child>a {-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomright:4px;-moz-border-radius-bottomleft:4px}.nav-tabs.nav-stacked>li>a:hover, .nav-tabs.nav-stacked>li>a:focus {z-index:2;border-color:#ddd}.nav-pills.nav-stacked>li>a {margin-bottom:3px}.nav-pills.nav-stacked>li:last-child>a {margin-bottom:1px}.nav-tabs .dropdown-menu {-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.nav-pills .dropdown-menu {-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.nav .dropdown-toggle .caret {margin-top:6px;border-top-color:#08c;border-bottom-color:#08c}.nav .dropdown-toggle:hover .caret, .nav .dropdown-toggle:focus .caret {border-top-color:#005580;border-bottom-color:#005580}.nav-tabs .dropdown-toggle .caret {margin-top:8px}.nav .active .dropdown-toggle .caret {border-top-color:#fff;border-bottom-color:#fff}.nav-tabs .active .dropdown-toggle .caret {border-top-color:#555;border-bottom-color:#555}.nav>.dropdown.active>a:hover, .nav>.dropdown.active>a:focus {cursor:pointer}.nav-tabs .open .dropdown-toggle, .nav-pills .open .dropdown-toggle, .nav>li.dropdown.open.active>a:hover, .nav>li.dropdown.open.active>a:focus {color:#fff;background-color:#999;border-color:#999}.nav li.dropdown.open .caret, .nav li.dropdown.open.active .caret, .nav li.dropdown.open a:hover .caret, .nav li.dropdown.open a:focus .caret {border-top-color:#fff;border-bottom-color:#fff;opacity:1;filter:alpha(opacity=100)}.tabs-stacked .open>a:hover, .tabs-stacked .open>a:focus {border-color:#999}.tabbable {*zoom:1}.tabbable:before, .tabbable:after {display:table;line-height:0;content:""}.tabbable:after {clear:both}.tab-content {overflow:auto}.tabs-below>.nav-tabs, .tabs-right>.nav-tabs, .tabs-left>.nav-tabs {border-bottom:0}.tab-content>.tab-pane, .pill-content>.pill-pane {display:none}.tab-content>.active, .pill-content>.active {display:block}.tabs-below>.nav-tabs {border-top:1px solid #ddd}.tabs-below>.nav-tabs>li {margin-top:-1px;margin-bottom:0}.tabs-below>.nav-tabs>li>a {-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.tabs-below>.nav-tabs>li>a:hover, .tabs-below>.nav-tabs>li>a:focus {border-top-color:#ddd;border-bottom-color:transparent}.tabs-below>.nav-tabs>.active>a, .tabs-below>.nav-tabs>.active>a:hover, .tabs-below>.nav-tabs>.active>a:focus {border-color:transparent #ddd #ddd #ddd}.tabs-left>.nav-tabs>li, .tabs-right>.nav-tabs>li {float:none}.tabs-left>.nav-tabs>li>a, .tabs-right>.nav-tabs>li>a {min-width:74px;margin-right:0;margin-bottom:3px}.tabs-left>.nav-tabs {float:left;margin-right:19px;border-right:1px solid #ddd}.tabs-left>.nav-tabs>li>a {margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.tabs-left>.nav-tabs>li>a:hover, .tabs-left>.nav-tabs>li>a:focus {border-color:#eee #ddd #eee #eee}.tabs-left>.nav-tabs .active>a, .tabs-left>.nav-tabs .active>a:hover, .tabs-left>.nav-tabs .active>a:focus {border-color:#ddd transparent #ddd #ddd;*border-right-color:#fff}.tabs-right>.nav-tabs {float:right;margin-left:19px;border-left:1px solid #ddd}.tabs-right>.nav-tabs>li>a {margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.tabs-right>.nav-tabs>li>a:hover, .tabs-right>.nav-tabs>li>a:focus {border-color:#eee #eee #eee #ddd}.tabs-right>.nav-tabs .active>a, .tabs-right>.nav-tabs .active>a:hover, .tabs-right>.nav-tabs .active>a:focus {border-color:#ddd #ddd #ddd transparent;*border-left-color:#fff}.nav>.disabled>a {color:#999}.nav>.disabled>a:hover, .nav>.disabled>a:focus {text-decoration:none;cursor:default;background-color:transparent}.navbar {*position:relative;*z-index:2;margin-bottom:20px;overflow:visible}.navbar-inner {min-height:40px;padding-right:20px;padding-left:20px;background-color:#fafafa;background-image:-moz-linear-gradient(top, #fff, #f2f2f2);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#f2f2f2));background-image:-webkit-linear-gradient(top, #fff, #f2f2f2);background-image:-o-linear-gradient(top, #fff, #f2f2f2);background-image:linear-gradient(to bottom, #fff, #f2f2f2);background-repeat:repeat-x;border:1px solid #d4d4d4;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff2f2f2', GradientType=0);*zoom:1;-webkit-box-shadow:0 1px 4px rgba(0,0,0,0.065);-moz-box-shadow:0 1px 4px rgba(0,0,0,0.065);box-shadow:0 1px 4px rgba(0,0,0,0.065)}.navbar-inner:before, .navbar-inner:after {display:table;line-height:0;content:""}.navbar-inner:after {clear:both}.navbar .container {width:auto}.nav-collapse.collapse {height:auto;overflow:visible}.navbar .brand {display:block;float:left;padding:10px 20px 10px;margin-left:-20px;font-size:20px;font-weight:200;color:#777;text-shadow:0 1px 0 #fff}.navbar .brand:hover, .navbar .brand:focus {text-decoration:none}.navbar-text {margin-bottom:0;line-height:40px;color:#777}.navbar-link {color:#777}.navbar-link:hover, .navbar-link:focus {color:#333}.navbar .divider-vertical {height:40px;margin:0 9px;border-right:1px solid #fff;border-left:1px solid #f2f2f2}.navbar .btn, .navbar .btn-group {margin-top:5px}.navbar .btn-group .btn, .navbar .input-prepend .btn, .navbar .input-append .btn, .navbar .input-prepend .btn-group, .navbar .input-append .btn-group {margin-top:0}.navbar-form {margin-bottom:0;*zoom:1}.navbar-form:before, .navbar-form:after {display:table;line-height:0;content:""}.navbar-form:after {clear:both}.navbar-form input, .navbar-form select, .navbar-form .radio, .navbar-form .checkbox {margin-top:5px}.navbar-form input, .navbar-form select, .navbar-form .btn {display:inline-block;margin-bottom:0}.navbar-form input[type="image"], .navbar-form input[type="checkbox"], .navbar-form input[type="radio"] {margin-top:3px}.navbar-form .input-append, .navbar-form .input-prepend {margin-top:5px;white-space:nowrap}.navbar-form .input-append input, .navbar-form .input-prepend input {margin-top:0}.navbar-search {position:relative;float:left;margin-top:5px;margin-bottom:0}.navbar-search .search-query {padding:4px 14px;margin-bottom:0;font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;font-size:13px;font-weight:normal;line-height:1;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.navbar-static-top {position:static;margin-bottom:0}.navbar-static-top .navbar-inner {-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-fixed-top, .navbar-fixed-bottom {position:fixed;right:0;left:0;z-index:1030;margin-bottom:0}.navbar-fixed-top .navbar-inner, .navbar-static-top .navbar-inner {border-width:0 0 1px}.navbar-fixed-bottom .navbar-inner {border-width:1px 0 0}.navbar-fixed-top .navbar-inner, .navbar-fixed-bottom .navbar-inner {padding-right:0;padding-left:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-static-top .container, .navbar-fixed-top .container, .navbar-fixed-bottom .container {width:940px}.navbar-fixed-top {top:0}.navbar-fixed-top .navbar-inner, .navbar-static-top .navbar-inner {-webkit-box-shadow:0 1px 10px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 10px rgba(0,0,0,0.1);box-shadow:0 1px 10px rgba(0,0,0,0.1)}.navbar-fixed-bottom {bottom:0}.navbar-fixed-bottom .navbar-inner {-webkit-box-shadow:0 -1px 10px rgba(0,0,0,0.1);-moz-box-shadow:0 -1px 10px rgba(0,0,0,0.1);box-shadow:0 -1px 10px rgba(0,0,0,0.1)}.navbar .nav {position:relative;left:0;display:block;float:left;margin:0 10px 0 0}.navbar .nav.pull-right {float:right;margin-right:0}.navbar .nav>li {float:left}.navbar .nav>li>a {float:none;padding:10px 15px 10px;color:#777;text-decoration:none;text-shadow:0 1px 0 #fff}.navbar .nav .dropdown-toggle .caret {margin-top:8px}.navbar .nav>li>a:focus, .navbar .nav>li>a:hover {color:#333;text-decoration:none;background-color:transparent}.navbar .nav>.active>a, .navbar .nav>.active>a:hover, .navbar .nav>.active>a:focus {color:#555;text-decoration:none;background-color:#e5e5e5;-webkit-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);-moz-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);box-shadow:inset 0 3px 8px rgba(0,0,0,0.125)}.navbar .btn-navbar {display:none;float:right;padding:7px 10px;margin-right:5px;margin-left:5px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#ededed;*background-color:#e5e5e5;background-image:-moz-linear-gradient(top, #f2f2f2, #e5e5e5);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#e5e5e5));background-image:-webkit-linear-gradient(top, #f2f2f2, #e5e5e5);background-image:-o-linear-gradient(top, #f2f2f2, #e5e5e5);background-image:linear-gradient(to bottom, #f2f2f2, #e5e5e5);background-repeat:repeat-x;border-color:#e5e5e5 #e5e5e5 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2', endColorstr='#ffe5e5e5', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1), 0 1px 0 rgba(255,255,255,0.075);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1), 0 1px 0 rgba(255,255,255,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1), 0 1px 0 rgba(255,255,255,0.075)}.navbar .btn-navbar:hover, .navbar .btn-navbar:focus, .navbar .btn-navbar:active, .navbar .btn-navbar.active, .navbar .btn-navbar.disabled, .navbar .btn-navbar[disabled] {color:#fff;background-color:#e5e5e5;*background-color:#d9d9d9}.navbar .btn-navbar:active, .navbar .btn-navbar.active {background-color:#ccc \9}.navbar .btn-navbar .icon-bar {display:block;width:18px;height:2px;background-color:#f5f5f5;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,0.25);-moz-box-shadow:0 1px 0 rgba(0,0,0,0.25);box-shadow:0 1px 0 rgba(0,0,0,0.25)}.btn-navbar .icon-bar+.icon-bar {margin-top:3px}.navbar .nav>li>.dropdown-menu:before {position:absolute;top:-7px;left:9px;display:inline-block;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-left:7px solid transparent;border-bottom-color:rgba(0,0,0,0.2);content:''}.navbar .nav>li>.dropdown-menu:after {position:absolute;top:-6px;left:10px;display:inline-block;border-right:6px solid transparent;border-bottom:6px solid #fff;border-left:6px solid transparent;content:''}.navbar-fixed-bottom .nav>li>.dropdown-menu:before {top:auto;bottom:-7px;border-top:7px solid #ccc;border-bottom:0;border-top-color:rgba(0,0,0,0.2)}.navbar-fixed-bottom .nav>li>.dropdown-menu:after {top:auto;bottom:-6px;border-top:6px solid #fff;border-bottom:0}.navbar .nav li.dropdown>a:hover .caret, .navbar .nav li.dropdown>a:focus .caret {border-top-color:#333;border-bottom-color:#333}.navbar .nav li.dropdown.open>.dropdown-toggle, .navbar .nav li.dropdown.active>.dropdown-toggle, .navbar .nav li.dropdown.open.active>.dropdown-toggle {color:#555;background-color:#e5e5e5}.navbar .nav li.dropdown>.dropdown-toggle .caret {border-top-color:#777;border-bottom-color:#777}.navbar .nav li.dropdown.open>.dropdown-toggle .caret, .navbar .nav li.dropdown.active>.dropdown-toggle .caret, .navbar .nav li.dropdown.open.active>.dropdown-toggle .caret {border-top-color:#555;border-bottom-color:#555}.navbar .pull-right>li>.dropdown-menu, .navbar .nav>li>.dropdown-menu.pull-right {right:0;left:auto}.navbar .pull-right>li>.dropdown-menu:before, .navbar .nav>li>.dropdown-menu.pull-right:before {right:12px;left:auto}.navbar .pull-right>li>.dropdown-menu:after, .navbar .nav>li>.dropdown-menu.pull-right:after {right:13px;left:auto}.navbar .pull-right>li>.dropdown-menu .dropdown-menu, .navbar .nav>li>.dropdown-menu.pull-right .dropdown-menu {right:100%;left:auto;margin-right:-1px;margin-left:0;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.navbar-inverse .navbar-inner {background-color:#1b1b1b;background-image:-moz-linear-gradient(top, #222, #111);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#222), to(#111));background-image:-webkit-linear-gradient(top, #222, #111);background-image:-o-linear-gradient(top, #222, #111);background-image:linear-gradient(to bottom, #222, #111);background-repeat:repeat-x;border-color:#252525;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff111111', GradientType=0)}.navbar-inverse .brand, .navbar-inverse .nav>li>a {color:#999;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.navbar-inverse .brand:hover, .navbar-inverse .nav>li>a:hover, .navbar-inverse .brand:focus, .navbar-inverse .nav>li>a:focus {color:#fff}.navbar-inverse .brand {color:#999}.navbar-inverse .navbar-text {color:#999}.navbar-inverse .nav>li>a:focus, .navbar-inverse .nav>li>a:hover {color:#fff;background-color:transparent}.navbar-inverse .nav .active>a, .navbar-inverse .nav .active>a:hover, .navbar-inverse .nav .active>a:focus {color:#fff;background-color:#111}.navbar-inverse .navbar-link {color:#999}.navbar-inverse .navbar-link:hover, .navbar-inverse .navbar-link:focus {color:#fff}.navbar-inverse .divider-vertical {border-right-color:#222;border-left-color:#111}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle, .navbar-inverse .nav li.dropdown.active>.dropdown-toggle, .navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle {color:#fff;background-color:#111}.navbar-inverse .nav li.dropdown>a:hover .caret, .navbar-inverse .nav li.dropdown>a:focus .caret {border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .nav li.dropdown>.dropdown-toggle .caret {border-top-color:#999;border-bottom-color:#999}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle .caret, .navbar-inverse .nav li.dropdown.active>.dropdown-toggle .caret, .navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle .caret {border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .navbar-search .search-query {color:#fff;background-color:#515151;border-color:#111;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1), 0 1px 0 rgba(255,255,255,0.15);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1), 0 1px 0 rgba(255,255,255,0.15);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1), 0 1px 0 rgba(255,255,255,0.15);-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.navbar-inverse .navbar-search .search-query:-moz-placeholder {color:#ccc}.navbar-inverse .navbar-search .search-query:-ms-input-placeholder {color:#ccc}.navbar-inverse .navbar-search .search-query::-webkit-input-placeholder {color:#ccc}.navbar-inverse .navbar-search .search-query:focus, .navbar-inverse .navbar-search .search-query.focused {padding:5px 15px;color:#333;text-shadow:0 1px 0 #fff;background-color:#fff;border:0;outline:0;-webkit-box-shadow:0 0 3px rgba(0,0,0,0.15);-moz-box-shadow:0 0 3px rgba(0,0,0,0.15);box-shadow:0 0 3px rgba(0,0,0,0.15)}.navbar-inverse .btn-navbar {color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e0e0e;*background-color:#040404;background-image:-moz-linear-gradient(top, #151515, #040404);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#151515), to(#040404));background-image:-webkit-linear-gradient(top, #151515, #040404);background-image:-o-linear-gradient(top, #151515, #040404);background-image:linear-gradient(to bottom, #151515, #040404);background-repeat:repeat-x;border-color:#040404 #040404 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff151515', endColorstr='#ff040404', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.navbar-inverse .btn-navbar:hover, .navbar-inverse .btn-navbar:focus, .navbar-inverse .btn-navbar:active, .navbar-inverse .btn-navbar.active, .navbar-inverse .btn-navbar.disabled, .navbar-inverse .btn-navbar[disabled] {color:#fff;background-color:#040404;*background-color:#000}.navbar-inverse .btn-navbar:active, .navbar-inverse .btn-navbar.active {background-color:#000 \9}.breadcrumb {padding:8px 15px;margin:0 0 20px;list-style:none;background-color:#f5f5f5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.breadcrumb>li {display:inline-block;*display:inline;text-shadow:0 1px 0 #fff;*zoom:1}.breadcrumb>li>.divider {padding:0 5px;color:#ccc}.breadcrumb>.active {color:#999}.pagination {margin:20px 0}.pagination ul {display:inline-block;*display:inline;margin-bottom:0;margin-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*zoom:1;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:0 1px 2px rgba(0,0,0,0.05);box-shadow:0 1px 2px rgba(0,0,0,0.05)}.pagination ul>li {display:inline}.pagination ul>li>a, .pagination ul>li>span {float:left;padding:4px 12px;line-height:20px;text-decoration:none;background-color:#fff;border:1px solid #ddd;border-left-width:0}.pagination ul>li>a:hover, .pagination ul>li>a:focus, .pagination ul>.active>a, .pagination ul>.active>span {background-color:#f5f5f5}.pagination ul>.active>a, .pagination ul>.active>span {color:#999;cursor:default}.pagination ul>.disabled>span, .pagination ul>.disabled>a, .pagination ul>.disabled>a:hover, .pagination ul>.disabled>a:focus {color:#999;cursor:default;background-color:transparent}.pagination ul>li:first-child>a, .pagination ul>li:first-child>span {border-left-width:1px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-topleft:4px}.pagination ul>li:last-child>a, .pagination ul>li:last-child>span {-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px}.pagination-centered {text-align:center}.pagination-right {text-align:right}.pagination-large ul>li>a, .pagination-large ul>li>span {padding:11px 19px;font-size:17.5px}.pagination-large ul>li:first-child>a, .pagination-large ul>li:first-child>span {-webkit-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-webkit-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-topleft:6px}.pagination-large ul>li:last-child>a, .pagination-large ul>li:last-child>span {-webkit-border-top-right-radius:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;border-bottom-right-radius:6px;-moz-border-radius-topright:6px;-moz-border-radius-bottomright:6px}.pagination-mini ul>li:first-child>a, .pagination-small ul>li:first-child>a, .pagination-mini ul>li:first-child>span, .pagination-small ul>li:first-child>span {-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-radius-bottomleft:3px;-moz-border-radius-topleft:3px}.pagination-mini ul>li:last-child>a, .pagination-small ul>li:last-child>a, .pagination-mini ul>li:last-child>span, .pagination-small ul>li:last-child>span {-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px;-moz-border-radius-topright:3px;-moz-border-radius-bottomright:3px}.pagination-small ul>li>a, .pagination-small ul>li>span {padding:2px 10px;font-size:11.9px}.pagination-mini ul>li>a, .pagination-mini ul>li>span {padding:0 6px;font-size:10.5px}.pager {margin:20px 0;text-align:center;list-style:none;*zoom:1}.pager:before, .pager:after {display:table;line-height:0;content:""}.pager:after {clear:both}.pager li {display:inline}.pager li>a, .pager li>span {display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.pager li>a:hover, .pager li>a:focus {text-decoration:none;background-color:#f5f5f5}.pager .next>a, .pager .next>span {float:right}.pager .previous>a, .pager .previous>span {float:left}.pager .disabled>a, .pager .disabled>a:hover, .pager .disabled>a:focus, .pager .disabled>span {color:#999;cursor:default;background-color:#fff}.modal-backdrop {position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade {opacity:0}.modal-backdrop, .modal-backdrop.fade.in {opacity:.8;filter:alpha(opacity=80)}.modal {position:fixed;top:10%;left:50%;z-index:1050;width:560px;margin-left:-280px;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;outline:0;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box}.modal.fade {top:-25%;-webkit-transition:opacity .3s linear, top .3s ease-out;-moz-transition:opacity .3s linear, top .3s ease-out;-o-transition:opacity .3s linear, top .3s ease-out;transition:opacity .3s linear, top .3s ease-out}.modal.fade.in {top:10%}.modal-header {padding:9px 15px;border-bottom:1px solid #eee}.modal-header .close {margin-top:2px}.modal-header h3 {margin:0;line-height:30px}.modal-body {position:relative;max-height:400px;padding:15px;overflow-y:auto}.modal-form {margin-bottom:0}.modal-footer {padding:14px 15px 15px;margin-bottom:0;text-align:right;background-color:#f5f5f5;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;*zoom:1;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.modal-footer:before, .modal-footer:after {display:table;line-height:0;content:""}.modal-footer:after {clear:both}.modal-footer .btn+.btn {margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn {margin-left:-1px}.modal-footer .btn-block+.btn-block {margin-left:0}.tooltip {position:absolute;z-index:1030;display:block;font-size:11px;line-height:1.4;opacity:0;filter:alpha(opacity=0);visibility:visible}.tooltip.in {opacity:.8;filter:alpha(opacity=80)}.tooltip.top {padding:5px 0;margin-top:-3px}.tooltip.right {padding:0 5px;margin-left:3px}.tooltip.bottom {padding:5px 0;margin-top:3px}.tooltip.left {padding:0 5px;margin-left:-3px}.tooltip-inner {max-width:200px;padding:8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.tooltip-arrow {position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow {bottom:0;left:50%;margin-left:-5px;border-top-color:#000;border-width:5px 5px 0}.tooltip.right .tooltip-arrow {top:50%;left:0;margin-top:-5px;border-right-color:#000;border-width:5px 5px 5px 0}.tooltip.left .tooltip-arrow {top:50%;right:0;margin-top:-5px;border-left-color:#000;border-width:5px 0 5px 5px}.tooltip.bottom .tooltip-arrow {top:0;left:50%;margin-left:-5px;border-bottom-color:#000;border-width:0 5px 5px}.popover {position:absolute;top:0;left:0;z-index:1010;display:none;min-width:200px;max-width:200px;padding:1px;text-align:left;white-space:normal;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.popover.top {margin-top:-10px}.popover.right {margin-left:10px}.popover.bottom {margin-top:10px}.popover.left {margin-left:-10px}.popover-title {padding:8px 14px;margin:0;font-size:14px;font-weight:normal;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.popover-title:empty {display:none}.popover-content {padding:9px 14px}.popover .arrow, .popover .arrow:after {position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover .arrow {border-width:11px}.popover .arrow:after {border-width:10px;content:""}.popover.top .arrow {bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,0.25);border-bottom-width:0}.popover.top .arrow:after {bottom:1px;margin-left:-10px;border-top-color:#fff;border-bottom-width:0}.popover.right .arrow {top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,0.25);border-left-width:0}.popover.right .arrow:after {bottom:-10px;left:1px;border-right-color:#fff;border-left-width:0}.popover.bottom .arrow {top:-11px;left:50%;margin-left:-11px;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,0.25);border-top-width:0}.popover.bottom .arrow:after {top:1px;margin-left:-10px;border-bottom-color:#fff;border-top-width:0}.popover.left .arrow {top:50%;right:-11px;margin-top:-11px;border-left-color:#999;border-left-color:rgba(0,0,0,0.25);border-right-width:0}.popover.left .arrow:after {right:1px;bottom:-10px;border-left-color:#fff;border-right-width:0}.thumbnails {margin-left:-20px;list-style:none;*zoom:1}.thumbnails:before, .thumbnails:after {display:table;line-height:0;content:""}.thumbnails:after {clear:both}.row-fluid .thumbnails {margin-left:0}.thumbnails>li {float:left;margin-bottom:20px;margin-left:20px}.thumbnail {display:block;padding:4px;line-height:20px;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.055);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.055);box-shadow:0 1px 3px rgba(0,0,0,0.055);-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}a.thumbnail:hover, a.thumbnail:focus {border-color:#08c;-webkit-box-shadow:0 1px 4px rgba(0,105,214,0.25);-moz-box-shadow:0 1px 4px rgba(0,105,214,0.25);box-shadow:0 1px 4px rgba(0,105,214,0.25)}.thumbnail>img {display:block;max-width:100%;margin-right:auto;margin-left:auto}.thumbnail .caption {padding:9px;color:#555}.media, .media-body {overflow:hidden;*overflow:visible;zoom:1}.media, .media .media {margin-top:15px}.media:first-child {margin-top:0}.media-object {display:block}.media-heading {margin:0 0 5px}.media>.pull-left {margin-right:10px}.media>.pull-right {margin-left:10px}.media-list {margin-left:0;list-style:none}.label, .badge {display:inline-block;padding:2px 4px;font-size:11.844px;font-weight:bold;line-height:14px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);white-space:nowrap;vertical-align:baseline;background-color:#999}.label {-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.badge {padding-right:9px;padding-left:9px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px}.label:empty, .badge:empty {display:none}a.label:hover, a.label:focus, a.badge:hover, a.badge:focus {color:#fff;text-decoration:none;cursor:pointer}.label-important, .badge-important {background-color:#b94a48}.label-important[href], .badge-important[href] {background-color:#953b39}.label-warning, .badge-warning {background-color:#f89406}.label-warning[href], .badge-warning[href] {background-color:#c67605}.label-success, .badge-success {background-color:#468847}.label-success[href], .badge-success[href] {background-color:#356635}.label-info, .badge-info {background-color:#3a87ad}.label-info[href], .badge-info[href] {background-color:#2d6987}.label-inverse, .badge-inverse {background-color:#333}.label-inverse[href], .badge-inverse[href] {background-color:#1a1a1a}.btn .label, .btn .badge {position:relative;top:-1px}.btn-mini .label, .btn-mini .badge {top:0}@-webkit-keyframes progress-bar-stripes {from {background-position:40px 0}to {background-position:0 0}}@-moz-keyframes progress-bar-stripes {from {background-position:40px 0}to {background-position:0 0}}@-ms-keyframes progress-bar-stripes {from {background-position:40px 0}to {background-position:0 0}}@-o-keyframes progress-bar-stripes {from {background-position:0 0}to {background-position:40px 0}}@keyframes progress-bar-stripes {from {background-position:40px 0}to {background-position:0 0}}.progress {height:20px;margin-bottom:20px;overflow:hidden;background-color:#f7f7f7;background-image:-moz-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9));background-image:-webkit-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:-o-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:linear-gradient(to bottom, #f5f5f5, #f9f9f9);background-repeat:repeat-x;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#fff9f9f9', GradientType=0);-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress .bar {float:left;width:0;height:100%;font-size:12px;color:#fff;text-align:center;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e90d2;background-image:-moz-linear-gradient(top, #149bdf, #0480be);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be));background-image:-webkit-linear-gradient(top, #149bdf, #0480be);background-image:-o-linear-gradient(top, #149bdf, #0480be);background-image:linear-gradient(to bottom, #149bdf, #0480be);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf', endColorstr='#ff0480be', GradientType=0);-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width .6s ease;-moz-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress .bar+.bar {-webkit-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15), inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15), inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 1px 0 0 rgba(0,0,0,0.15), inset 0 -1px 0 rgba(0,0,0,0.15)}.progress-striped .bar {background-color:#149bdf;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255,255,255,0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255,255,255,0.15)), color-stop(0.75, rgba(255,255,255,0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);-webkit-background-size:40px 40px;-moz-background-size:40px 40px;-o-background-size:40px 40px;background-size:40px 40px}.progress.active .bar {-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-danger .bar, .progress .bar-danger {background-color:#dd514c;background-image:-moz-linear-gradient(top, #ee5f5b, #c43c35);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35));background-image:-webkit-linear-gradient(top, #ee5f5b, #c43c35);background-image:-o-linear-gradient(top, #ee5f5b, #c43c35);background-image:linear-gradient(to bottom, #ee5f5b, #c43c35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffc43c35', GradientType=0)}.progress-danger.progress-striped .bar, .progress-striped .bar-danger {background-color:#ee5f5b;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255,255,255,0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255,255,255,0.15)), color-stop(0.75, rgba(255,255,255,0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-success .bar, .progress .bar-success {background-color:#5eb95e;background-image:-moz-linear-gradient(top, #62c462, #57a957);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957));background-image:-webkit-linear-gradient(top, #62c462, #57a957);background-image:-o-linear-gradient(top, #62c462, #57a957);background-image:linear-gradient(to bottom, #62c462, #57a957);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff57a957', GradientType=0)}.progress-success.progress-striped .bar, .progress-striped .bar-success {background-color:#62c462;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255,255,255,0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255,255,255,0.15)), color-stop(0.75, rgba(255,255,255,0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-info .bar, .progress .bar-info {background-color:#4bb1cf;background-image:-moz-linear-gradient(top, #5bc0de, #339bb9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9));background-image:-webkit-linear-gradient(top, #5bc0de, #339bb9);background-image:-o-linear-gradient(top, #5bc0de, #339bb9);background-image:linear-gradient(to bottom, #5bc0de, #339bb9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff339bb9', GradientType=0)}.progress-info.progress-striped .bar, .progress-striped .bar-info {background-color:#5bc0de;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255,255,255,0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255,255,255,0.15)), color-stop(0.75, rgba(255,255,255,0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-warning .bar, .progress .bar-warning {background-color:#faa732;background-image:-moz-linear-gradient(top, #fbb450, #f89406);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));background-image:-webkit-linear-gradient(top, #fbb450, #f89406);background-image:-o-linear-gradient(top, #fbb450, #f89406);background-image:linear-gradient(to bottom, #fbb450, #f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0)}.progress-warning.progress-striped .bar, .progress-striped .bar-warning {background-color:#fbb450;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255,255,255,0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255,255,255,0.15)), color-stop(0.75, rgba(255,255,255,0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.accordion {margin-bottom:20px}.accordion-group {margin-bottom:2px;border:1px solid #e5e5e5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.accordion-heading {border-bottom:0}.accordion-heading .accordion-toggle {display:block;padding:8px 15px}.accordion-toggle {cursor:pointer}.accordion-inner {padding:9px 15px;border-top:1px solid #e5e5e5}.carousel {position:relative;margin-bottom:20px;line-height:1}.carousel-inner {position:relative;width:100%;overflow:hidden}.carousel-inner>.item {position:relative;display:none;-webkit-transition:.6s ease-in-out left;-moz-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img, .carousel-inner>.item>a>img {display:block;line-height:1}.carousel-inner>.active, .carousel-inner>.next, .carousel-inner>.prev {display:block}.carousel-inner>.active {left:0}.carousel-inner>.next, .carousel-inner>.prev {position:absolute;top:0;width:100%}.carousel-inner>.next {left:100%}.carousel-inner>.prev {left:-100%}.carousel-inner>.next.left, .carousel-inner>.prev.right {left:0}.carousel-inner>.active.left {left:-100%}.carousel-inner>.active.right {left:100%}.carousel-control {position:absolute;top:40%;left:15px;width:40px;height:40px;margin-top:-20px;font-size:60px;font-weight:100;line-height:30px;color:#fff;text-align:center;background:#222;border:3px solid #fff;-webkit-border-radius:23px;-moz-border-radius:23px;border-radius:23px;opacity:.5;filter:alpha(opacity=50)}.carousel-control.right {right:15px;left:auto}.carousel-control:hover, .carousel-control:focus {color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-indicators {position:absolute;top:15px;right:15px;z-index:5;margin:0;list-style:none}.carousel-indicators li {display:block;float:left;width:10px;height:10px;margin-left:5px;text-indent:-999px;background-color:#ccc;background-color:rgba(255,255,255,0.25);border-radius:5px}.carousel-indicators .active {background-color:#fff}.carousel-caption {position:absolute;right:0;bottom:0;left:0;padding:15px;background:#333;background:rgba(0,0,0,0.75)}.carousel-caption h4, .carousel-caption p {line-height:20px;color:#fff}.carousel-caption h4 {margin:0 0 5px}.carousel-caption p {margin-bottom:0}.hero-unit {padding:60px;margin-bottom:30px;font-size:18px;font-weight:200;line-height:30px;color:inherit;background-color:#eee;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.hero-unit h1 {margin-bottom:0;font-size:60px;line-height:1;letter-spacing:-1px;color:inherit}.hero-unit li {line-height:30px}.pull-right {float:right}.pull-left {float:left}.hide {display:none}.show {display:block}.invisible {visibility:hidden}.affix {position:fixed} \ No newline at end of file diff --git a/target/disped-web/resources/css/colorpicker.css b/target/disped-web/resources/css/colorpicker.css new file mode 100644 index 0000000000000000000000000000000000000000..da77e450712c3150d162dca3dbd07dfce15af120 --- /dev/null +++ b/target/disped-web/resources/css/colorpicker.css @@ -0,0 +1,115 @@ +/* + Colorpicker for Bootstrap + Copyright 2012 Stefan Petre + Licensed under the Apache License v2.0 + http://www.apache.org/licenses/LICENSE-2.0 +*/ + .colorpicker-saturation { + width: 100px; + height: 100px; + background-image: url('../img/saturation.png'); + cursor: crosshair; + float: left; +} +.colorpicker-saturation i { + display: block; + height: 5px; + width: 5px; + border: 1px solid #000; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + position: absolute; + top: 0; + left: 0; + margin: -4px 0 0 -4px; +} +.colorpicker-saturation i b { + display: block; + height: 5px; + width: 5px; + border: 1px solid #fff; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; +} +.colorpicker-hue, .colorpicker-alpha { + width: 15px; + height: 100px; + float: left; + cursor: row-resize; + margin-left: 4px; + margin-bottom: 4px; +} +.colorpicker-hue i, .colorpicker-alpha i { + display: block; + height: 1px; + background: #000; + border-top: 1px solid #fff; + position: absolute; + top: 0; + left: 0; + width: 100%; + margin-top: -1px; +} +.colorpicker-hue { + background-image: url('../img/hue.png'); +} +.colorpicker-alpha { + background-image: url('../img/alpha.html'); + display: none; +} +.colorpicker { +*zoom: 1; + top: 0; + left: 0; + padding: 4px; + min-width: 120px; + margin-top: 1px; +} +.colorpicker:before, .colorpicker:after { + display: table; + content: ""; +} +.colorpicker:after { + clear: both; +} +.colorpicker:before { + content: ''; + display: inline-block; + position: absolute; + top: -7px; + left: 6px; +} +.colorpicker:after { + content: ''; + display: inline-block; + position: absolute; + top: -6px; + left: 7px; +} +.colorpicker div { + position: relative; +} +.colorpicker.alpha { + min-width: 140px; +} +.colorpicker.alpha .colorpicker-alpha { + display: block; +} +.colorpicker-color { + height: 10px; + margin-top: 5px; + clear: both; + background-image: url('../img/alpha.html'); + background-position: 0 100%; +} +.colorpicker-color div { + height: 10px; +} +.input-append.color .add-on i, .input-prepend.color .add-on i { + display: block; + cursor: pointer; + width: 16px; + height: 16px; +} diff --git a/target/disped-web/resources/css/datepicker.css b/target/disped-web/resources/css/datepicker.css new file mode 100644 index 0000000000000000000000000000000000000000..43ee2f9cd871d98d016878582402841af9b8b0a4 --- /dev/null +++ b/target/disped-web/resources/css/datepicker.css @@ -0,0 +1,116 @@ +/* + Datepicker for Bootstrap + Copyright 2012 Stefan Petre + Licensed under the Apache License v2.0 + http://www.apache.org/licenses/LICENSE-2.0 +*/ + .datepicker { + top: 0; + left: 0; + padding: 4px; + margin-top: 1px; /*.dow { border-top: 1px solid #ddd !important; }*/ +} +.datepicker:before { + content: ''; + display: inline-block; + position: absolute; + top: -7px; + left: 6px; +} +.datepicker:after { + content: ''; + display: inline-block; + +} +.datepicker > div { + display: none; +} +.datepicker table { + width: 100%; + margin: 0; +} +.datepicker td, .datepicker th { + text-align: center; + width: 20px; + height: 20px; + +} +.datepicker td.day:hover { + background: #eeeeee; + cursor: pointer; +} +.datepicker td.old, .datepicker td.new { + color: #999999; +} +.datepicker td.active, .datepicker td.active:hover { + background: #49cced; + border-color: #0044cc #0044cc #002a80; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); +filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + color: #fff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); +} +.datepicker td.active:hover, .datepicker td.active:hover:hover, .datepicker td.active:active, .datepicker td.active:hover:active, .datepicker td.active.active, .datepicker td.active:hover.active, .datepicker td.active.disabled, .datepicker td.active:hover.disabled, .datepicker td.active[disabled], .datepicker td.active:hover[disabled] { + background-color: #49cced; +} +.datepicker td.active:active, .datepicker td.active:hover:active, .datepicker td.active.active, .datepicker td.active:hover.active { + background-color: #003399 \9; +} +.datepicker td span { + display: block; + width: 47px; + height: 54px; + line-height: 54px; + float: left; + margin: 2px; + cursor: pointer; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.datepicker td span:hover { + background: #eeeeee; +} +.datepicker td span.active { + background-color: #006dcc; + background-image: -moz-linear-gradient(top, #0088cc, #0044cc); + background-image: -ms-linear-gradient(top, #0088cc, #0044cc); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); + background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); + background-image: -o-linear-gradient(top, #0088cc, #0044cc); + background-image: linear-gradient(top, #0088cc, #0044cc); + background-repeat: repeat-x; +filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0); + border-color: #0044cc #0044cc #002a80; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); +filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + color: #fff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); +} +.datepicker td span.active:hover, .datepicker td span.active:active, .datepicker td span.active.active, .datepicker td span.active.disabled, .datepicker td span.active[disabled] { + background-color: #0044cc; +} +.datepicker td span.active:active, .datepicker td span.active.active { + background-color: #003399 \9; +} +.datepicker td span.old { + color: #999999; +} +.datepicker th.switch { + width: 145px; +} +.datepicker th.next, .datepicker th.prev { + font-size: 19.5px; +} +.datepicker thead tr:first-child th { + cursor: pointer; +} +.datepicker thead tr:first-child th:hover { + background: #eeeeee; +} +.input-append.date .add-on i, .input-prepend.date .add-on i { + display: block; + cursor: pointer; + width: 16px; + height: 16px; +} diff --git a/target/disped-web/resources/css/et.css b/target/disped-web/resources/css/et.css new file mode 100644 index 0000000000000000000000000000000000000000..16ec535f8b61be763f6ccdc1fa573974067f9378 --- /dev/null +++ b/target/disped-web/resources/css/et.css @@ -0,0 +1 @@ +@font-face{font-family:fontello;src:url(../font/fontello.eot);src:url(../font/fontello.eot#iefix) format("embedded-opentype"),url(../font/fontello.woff2) format("woff2"),url(../font/fontello.woff) format("woff"),url(../font/fontello.ttf) format("truetype"),url(../font/fontello.svg#fontello) format("svg");font-weight:400;font-style:normal}[class*=" v-icon-"]:before,[class^=v-icon-]:before{font-family:fontello;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.v-icon-down-dir:before{content:"\E800"}.v-icon-up-dir:before{content:"\E801"}.v-icon-cancel:before{content:"\E802"}.v-icon-spin3:before{content:"\E832"}.v-icon-spin4:before{content:"\E834"}.v-icon-spin5:before{content:"\E838"}.v-icon-filter:before{content:"\F0B0"}.v-icon-angle-double-left:before{content:"\F100"}.v-icon-angle-double-right:before{content:"\F101"}.v-icon-angle-left:before{content:"\F104"}.v-icon-angle-right:before{content:"\F105"}.animate-loading-05{-moz-animation:spin .5s infinite linear;-o-animation:spin .5s infinite linear;-webkit-animation:spin .5s infinite linear;animation:spin .5s infinite linear;display:inline-block}.animate-loading-08{-moz-animation:spin .8s infinite linear;-o-animation:spin .8s infinite linear;-webkit-animation:spin .8s infinite linear;animation:spin .8s infinite linear;display:inline-block}.animate-loading-11{-moz-animation:spin 1.1s infinite linear;-o-animation:spin 1.1s infinite linear;-webkit-animation:spin 1.1s infinite linear;animation:spin 1.1s infinite linear;display:inline-block}.animate-loading-14{-moz-animation:spin 1.4s infinite linear;-o-animation:spin 1.4s infinite linear;-webkit-animation:spin 1.4s infinite linear;animation:spin 1.4s infinite linear;display:inline-block}.animate-loading-17{-moz-animation:spin 1.7s infinite linear;-o-animation:spin 1.7s infinite linear;-webkit-animation:spin 1.7s infinite linear;animation:spin 1.7s infinite linear;display:inline-block}.animate-loading-20{-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear;display:inline-block}.animate-loading-23{-moz-animation:spin 2.3s infinite linear;-o-animation:spin 2.3s infinite linear;-webkit-animation:spin 2.3s infinite linear;animation:spin 2.3s infinite linear;display:inline-block}.animate-loading-26{-moz-animation:spin 2.6s infinite linear;-o-animation:spin 2.6s infinite linear;-webkit-animation:spin 2.6s infinite linear;animation:spin 2.6s infinite linear;display:inline-block}.animate-loading-29{-moz-animation:spin 2.9s infinite linear;-o-animation:spin 2.9s infinite linear;-webkit-animation:spin 2.9s infinite linear;animation:spin 2.9s infinite linear;display:inline-block}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg);-o-transform:rotate(0deg);-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-moz-transform:rotate(359deg);-o-transform:rotate(359deg);-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-moz-transform:rotate(0deg);-o-transform:rotate(0deg);-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-moz-transform:rotate(359deg);-o-transform:rotate(359deg);-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@-o-keyframes spin{0%{-moz-transform:rotate(0deg);-o-transform:rotate(0deg);-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-moz-transform:rotate(359deg);-o-transform:rotate(359deg);-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@-ms-keyframes spin{0%{-moz-transform:rotate(0deg);-o-transform:rotate(0deg);-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-moz-transform:rotate(359deg);-o-transform:rotate(359deg);-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spin{0%{-moz-transform:rotate(0deg);-o-transform:rotate(0deg);-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-moz-transform:rotate(359deg);-o-transform:rotate(359deg);-webkit-transform:rotate(359deg);transform:rotate(359deg)}}*,:after,:before{box-sizing:border-box}.v-page--large .v-page-goto,.v-page--large .v-page-goto .v-page-goto-input,.v-page--large .v-page-li,.v-page--large .v-page-select,.v-page--large .v-page-total{font-size:16px;height:40px;line-height:40px}.v-page--large .v-page-li{min-width:40px}.v-page--large .v-page-li i{font-size:120%}.v-page--large .v-page-goto .v-page-goto-input{width:50px}.v-page--middle .v-page-goto,.v-page--middle .v-page-goto .v-page-goto-input,.v-page--middle .v-page-li,.v-page--middle .v-page-select,.v-page--middle .v-page-total{font-size:14px;height:32px;line-height:32px}.v-page--middle .v-page-li{min-width:32px}.v-page--middle .v-page-li i{font-size:120%}.v-page--middle .v-page-goto .v-page-goto-input{width:50px}.v-page--small .v-page-goto,.v-page--small .v-page-goto .v-page-goto-input,.v-page--small .v-page-li,.v-page--small .v-page-select,.v-page--small .v-page-total{font-size:12px;height:24px;line-height:24px}.v-page--small .v-page-li{min-width:24px}.v-page--small .v-page-li i{font-size:120%}.v-page--small .v-page-goto .v-page-goto-input{width:45px}.v-page-ul{margin:0;padding:0;display:inline-block;margin:0 4px;list-style-type:none;-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;-ms-user-select:none}.v-page-total{float:left;display:inline-block;margin:0 4px}.v-page-select{float:left}.v-page-li{float:left;margin-right:4px;cursor:pointer;transition:all .1s ease-in-out;text-align:center;list-style:none;background-color:#fff;border:1px solid #c8cdd4;border-radius:4px}.v-page-li a{color:#333}.v-page-li:hover{border-color:#0092dd}.v-page-li:hover a{color:#0092dd}.v-page-li-active{border-color:#0092dd;background-color:#0092dd}.v-page-li-active a{color:#fff}.v-page-li-active:hover{border-color:#0092dd;background-color:#0092dd}.v-page-li-active:hover a{color:#fff}.v-page-next i,.v-page-prev i{color:#666}.v-page-jump-next:after,.v-page-jump-prev:after{content:"\2022\2022\2022";display:block;letter-spacing:1px;color:#666;text-align:center}.v-page-jump-next:hover:after,.v-page-jump-next i,.v-page-jump-prev:hover:after,.v-page-jump-prev i{display:none}.v-page-jump-next:hover i,.v-page-jump-prev:hover i{display:inline;color:#0092dd}.v-page-select{display:inline-block;margin:0 4px}.v-page-pager{float:left}.v-page-goto{float:left;display:inline-block;margin:0 4px}.v-page-goto-input{padding:1px 7px;display:inline-block;border:1px solid #c8cdd4;background-color:#fff;background-image:none;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out;border-radius:4px}.v-page-goto-input:hover{border-color:#0092dd}.v-page-disabled{cursor:not-allowed;border-color:#d7dde4}.v-page-disabled i{color:#ccc}.v-page-disabled:hover{border-color:#d7dde4}.v-page-disabled:hover i{color:#ccc;cursor:not-allowed}.v-select--large .v-select-items-li,.v-select--large .v-select-selected{font-size:16px;height:40px;line-height:40px}.v-select--large .v-select-selected-i{line-height:40px!important}.v-select--middle .v-select-items-li,.v-select--middle .v-select-selected{font-size:14px;height:32px;line-height:32px}.v-select--middle .v-select-selected-i{line-height:32px!important}.v-select--small .v-select-items-li,.v-select--small .v-select-selected{font-size:13px;height:24px;line-height:24px}.v-select--small .v-select-selected-i{line-height:24px!important}.v-select-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;background-image:none;border:1px solid #fff;box-sizing:border-box;color:#1f2d3d;display:inline-block;font-size:inherit;line-height:1;outline:none;padding-left:2px;transition:border-color .2s cubic-bezier(.645,.045,.355,1);width:80%;text-align:left}.v-select-selected-span{width:80%;display:block!important;text-align:center;cursor:pointer;white-space:nowrap;overflow:hidden;padding-left:2px}.v-select-selected-i{display:inline-block;position:absolute;top:0;right:0;font-size:120%}.v-table-views,.v-table-views *,.v-table-views :after,.v-table-views :before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.v-table-views{position:relative;overflow:hidden;border:1px solid #ddd;padding:0;background-color:#fff}.v-table-footer{border-top:1px solid #ddd}.v-table-leftview,.v-table-rightview{position:absolute;overflow:hidden;top:0}.v-table-leftview{left:0}.v-table-header{overflow:hidden;background-position:0 0;background-size:initial;background-attachment:scroll;background-origin:initial;background-clip:initial;background-color:initial;background-repeat-x:repeat;background-repeat-y:no-repeat}.v-table-footer-inner,.v-table-header,.v-table-pager,.v-table-toolbar{border-color:#ddd}.v-table-header-inner{float:left;width:10000px}.v-table-btable,.v-table-ftable,.v-table-htable{border-collapse:separate}.v-table-body td,.v-table-footer td,.v-table-header td{margin:0;padding:0}.v-table-body-cell{padding:0 3px;margin:0;white-space:nowrap;word-wrap:normal;overflow:hidden;border:0 solid #ddd;text-overflow:ellipsis}.v-table-body{margin:0;padding:0;zoom:1}.v-table-rightview .v-table-body,.v-table-rightview .v-table-footer{overflow-x:auto;overflow-y:auto}.v-table-leftview .v-table-body{overflow-x:hidden!important;overflow-y:hidden!important}.v-table-body-inner-pb{padding-bottom:20px}.v-table-rightview{right:0}.v-table-title-cell{margin:0;border:0 solid #ddd}.v-table-title-cell:before{content:"";display:inline-block;height:100%;vertical-align:middle}.table-title{padding:0 3px;word-break:break-all;line-height:1.2em}.table-title,.v-table-sort-icon{display:inline-block;vertical-align:middle;overflow:hidden}.v-table-sort-icon{position:relative;width:16px;height:19px;margin-left:-5px;cursor:pointer}.v-table-sort-icon i{position:absolute;display:block;width:16px;height:15px;overflow:hidden;color:#a6a6a6;transition:color .2s ease-in-out}.v-table-sort-icon i:first-child{top:-5px}.v-table-sort-icon i:last-child{bottom:1px}.v-table-header .cursorPointer{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;-ms-user-select:none}.vertical-border{border-right-width:1px!important}.horizontal-border{border-bottom-width:1px!important}.v-table-rightview-special-border td:last-child .v-table-body-cell{border-right-width:0!important}.v-table-dropdown{margin-left:-3px!important}.v-table-filter-icon{font-size:14px;cursor:pointer}.v-table-empty-content,.v-table-empty-scroll{position:absolute;overflow-y:hidden;text-align:center}.v-table-empty-content{overflow-x:auto}.v-table-empty-inner{overflow:hidden}.v-table-loading{position:relative;display:block;z-index:99999;background-color:#fff;height:100%;width:100%}.v-table-loading-content{z-index:9999999;position:absolute;left:50%}.v-table-drag-line{position:absolute;left:0;top:0;bottom:0;width:0;border-left:2px dashed #ddd;z-index:10}.v-checkbox-wrapper{font-size:12px}.v-checkbox,.v-checkbox-wrapper{cursor:pointer;display:inline-block;position:relative}.v-checkbox{white-space:nowrap;outline:none;line-height:1;vertical-align:text-bottom}.v-checkbox-checked:after{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:2px;border:1px solid #108ee9;content:"";-webkit-animation-fill-mode:both;animation-fill-mode:both;visibility:hidden}.v-checkbox-input{position:absolute;left:0;z-index:1;cursor:pointer;opacity:0;filter:alpha(opacity=0);top:0;bottom:0;right:0}.v-checkbox-inner{position:relative;top:0;left:0;display:block;width:14px;height:14px;border:1px solid #abbacc;border-radius:2px;background-color:#fff;-webkit-transition:all .3s;transition:all .3s}.v-checkbox-inner:after{-webkit-transform:rotate(45deg) scale(0);-ms-transform:rotate(45deg) scale(0);transform:rotate(45deg) scale(0);left:4px;top:1px;width:5px;height:8px;-webkit-transition:all .1s cubic-bezier(.71,-.46,.88,.6);transition:all .1s cubic-bezier(.71,-.46,.88,.6)}.v-checkbox-checked .v-checkbox-inner:after,.v-checkbox-inner:after{position:absolute;display:table;border:2px solid #fff;border-top:0;border-left:0;content:" "}.v-checkbox-checked .v-checkbox-inner:after{-webkit-transform:rotate(45deg) scale(1);-ms-transform:rotate(45deg) scale(1);transform:rotate(45deg) scale(1);-webkit-transition:all .2s cubic-bezier(.12,.4,.29,1.46) .1s;transition:all .2s cubic-bezier(.12,.4,.29,1.46) .1s}.v-checkbox-checked .v-checkbox-inner,.v-checkbox-indeterminate .v-checkbox-inner{background-color:#108ee9;border-color:#108ee9}.v-checkbox-input:focus+.v-checkbox-inner,.v-checkbox-wrapper:hover .v-checkbox-inner,.v-checkbox:hover .v-checkbox-inner{border-color:#108ee9}.v-checkbox-disabled{cursor:not-allowed}.v-checkbox-disabled.v-checkbox-checked .v-checkbox-inner:after{-webkit-animation-name:none;animation-name:none;border-color:rgba(0,0,0,.25)}.v-checkbox-disabled .v-checkbox-input{cursor:not-allowed}.v-checkbox-disabled .v-checkbox-inner{border-color:#d9d9d9!important;background-color:#f7f7f7}.v-checkbox-disabled .v-checkbox-inner:after{-webkit-animation-name:none;animation-name:none;border-color:#f7f7f7}.v-checkbox-disabled+span{color:rgba(0,0,0,.25);cursor:not-allowed}.v-checkbox-indeterminate .v-checkbox-inner:after{content:" ";-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);position:absolute;left:2px;top:5px;width:8px;height:1px}.v-checkbox-indeterminate.v-checkbox-disabled .v-checkbox-inner:after{border-color:rgba(0,0,0,.25)}.v-select-items-multiple{display:table;width:100%;padding:5px}.v-select-items-multiple span{vertical-align:middle;font-size:14px;font-weight:400;color:rgba(0,0,0,.65)}.v-select-items-multiple:hover{background-color:#e6f7ff}.v-dropdown--large .v-dropdown-items-li,.v-dropdown--large .v-dropdown-selected{font-size:16px;height:40px;line-height:40px}.v-dropdown--large .v-dropdown-selected-i{line-height:40px!important}.v-dropdown--middle .v-dropdown-items-li,.v-dropdown--middle .v-dropdown-selected{font-size:14px;height:32px;line-height:32px}.v-dropdown--middle .v-dropdown-selected-i{line-height:32px!important}.v-dropdown--small .v-dropdown-items-li,.v-dropdown--small .v-dropdown-selected{font-size:13px;height:24px;line-height:24px}.v-dropdown--small .v-dropdown-selected-i{line-height:24px!important}.v-dropdown{display:inline-table;margin:0}.v-dropdown-dd,.v-dropdown-dt{z-index:9999}.v-dropdown-dd,.v-dropdown-dt,.v-dropdown-items{margin:0;padding:0;background-color:#fff}.v-dropdown-items{overflow:hidden;text-overflow:ellipsis;word-wrap:normal;white-space:nowrap}.v-dropdown a,.v-dropdown a:visited{color:#000;text-decoration:none;outline:none}.v-dropdown-selected{position:relative;display:block;border:1px solid #c8cdd4;border-radius:2px}.v-dropdown-selected:hover{color:#0092dd;border-color:#0092dd}.v-dropdown-selected-span{width:80%;display:block!important;text-align:center;cursor:pointer;white-space:nowrap;overflow:hidden;padding-left:2px}.v-dropdown-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;background-image:none;border:1px solid #fff;box-sizing:border-box;color:#1f2d3d;display:inline-block;font-size:inherit;line-height:1;outline:none;padding-left:2px;transition:border-color .2s cubic-bezier(.645,.045,.355,1);width:80%;text-align:left}.v-dropdown-selected-i{display:inline-block;position:absolute;top:0;right:0;font-size:120%}.v-dropdown-dd{position:absolute!important;z-index:9999999}.v-dropdown-items{position:fixed;top:2px;left:0;list-style:none;border-radius:2px;background-color:#fff;box-shadow:0 2px 4px rgba(0,0,0,.12),0 0 6px rgba(0,0,0,.04);border:1px solid #d1dbe5;color:#c5c0b0;padding:5px 0;width:auto}.v-dropdown-items-li{white-space:nowrap}.v-dropdown-items-li.active{background-color:#0092dd}.v-dropdown-items-li.active a{color:#fff}.v-dropdown-items-li-a{width:100%;display:block;padding-left:8px;padding-right:8px}.v-dropdown-items-li-a-left{text-align:left}.v-dropdown-items-li-a-center{text-align:center}.v-dropdown-items-li-a-right{text-align:right}.v-dropdown-items-li:hover{background-color:#e4e8f1;color:#fff}.v-dropdown-items-li.active:hover{background-color:#0092dd}.v-dropdown-items-multiple{display:table;width:100%;padding:5px}.v-dropdown-items-multiple span{vertical-align:middle;font-size:14px;font-weight:400;color:rgba(0,0,0,.65)}.v-dropdown-items-multiple:hover{background-color:#e6f7ff}.v-dropdown-operation{padding:8px 0 3px;font-size:14px;border-top:1px solid #e8e8e8}.v-dropdown-operation-item{padding:0 8px;color:#495060}.v-dropdown-operation-item:last-child{float:right}.v-dropdown-operation-item:hover{color:#1890ff}.v-table-sort-icon .checked{color:#48576a}.v-table-filter-icon{color:#999}.v-table-filter-icon.checked{color:#48576a} \ No newline at end of file diff --git a/target/disped-web/resources/css/fullcalendar.css b/target/disped-web/resources/css/fullcalendar.css new file mode 100644 index 0000000000000000000000000000000000000000..6d0c52c892781eff94ea0daf6b97d53b6eafc19e --- /dev/null +++ b/target/disped-web/resources/css/fullcalendar.css @@ -0,0 +1,404 @@ + +.fc { + direction: ltr; + text-align: left; border:1px solid #dadada; +} +.fc table { + border-collapse: collapse; + border-spacing: 0; +} +html .fc, .fc table { + font-size: 1em; +} +.fc td, .fc th { + padding: 0; + vertical-align: top; +} +.fc-header { + position: relative; +} +.fc-header td { + position: relative; + white-space: nowrap; +} +.fc-header-left { + text-align: left; +} +.fc-header-center { + left: 10%; + position: absolute; + text-align: center; + top: 0; + width: 80%; +} +.fc-button-inner { + border-left: 1px solid #D5D5D5; +} +.panel-left .fc-header-right .fc-button:last-child .fc-button-inner { + border-right: 1px solid #D5D5D5; +} +.fc-header-left .fc-button-inner { + border: medium none; +} +.fc-header-right { + position: absolute !important; + right: 0; + text-align: right; + top: -37px; +} +.panel-left .fc-header-right { + right: -1px; +} +.fc-header-title { + display: inline-block; + vertical-align: top; +} +.fc-header-title strong { + display: block; + margin-top: 0; + padding: 8px 12px !important; + white-space: nowrap; +} +.fc .fc-header-space { + padding-left: 10px; +} +.fc-header .fc-corner-right { + float: right; + margin-right: 1px; +} +.fc-header .ui-corner-right { + margin-right: 0; +} +.fc-header .fc-state-hover, .fc-header .ui-state-hover { + z-index: 2; +} +.fc-header .fc-state-down { + z-index: 3; +} +.fc-header .fc-state-active, .fc-header .ui-state-active { + z-index: 4; +} +.fc-button-prev .fc-button-content { + background: url("../img/larrow.png") no-repeat scroll 15px 13px transparent; + width: 10px; +} +.fc-button-next .fc-button-content { + background: url("../img/rarrow.png") no-repeat scroll 15px 13px transparent; + width: 10px; +} +.fc-content { +} +.fc-view { + overflow: hidden; + width: 100%; +} +.fc-widget-header, .fc-widget-content { + border: 1px solid #D5D5D5; +} +.fc-state-highlight { + background: url("../images/backgrounds/calActiveBg.html") repeat-x scroll 0 0 #F5F5F5; +} +.fc-cell-overlay { + background: none repeat scroll 0 0 #99CCFF; + opacity: 0.2; +} +.fc-button { + cursor: pointer; + display: inline-block; + position: relative; +} +.fc-state-default { +} +.fc-button-inner { + float: left; + overflow: hidden; + position: relative; +} +.fc-state-default .fc-button-inner { +} +.fc-button-content { + float: left; + height: 36px; + line-height: 37px; + padding: 0 14px; + position: relative; + white-space: nowrap; +} +.fc-header-right .fc-button-content { + height: 37px; +} +.fc-button-content .fc-icon-wrap { + float: left; + position: relative; + top: 50%; +} +.fc-button-content .ui-icon { + float: left; + margin-top: -50%; + position: relative; +} +.fc-state-default .fc-button-effect { + left: 0; + position: absolute; + top: 50%; +} +.fc-state-default .fc-button-effect span { +} +.fc-state-default, .fc-state-default .fc-button-inner { +} +.fc-state-hover, .fc-state-hover .fc-button-inner { +} +.fc-state-down, .fc-state-down .fc-button-inner { +} +.fc-state-active, .fc-state-active .fc-button-inner { + background: none repeat scroll 0 0 #F9F9F9; + color: #797979; +} +.fc-first th { + padding-top: 1px; +} +.fc-state-disabled, .fc-state-disabled .fc-button-inner { + border-color: #DDDDDD; + color: #999999; +} +.fc-state-disabled { + cursor: default; +} +.fc-state-disabled .fc-button-effect { + display: none; +} +.fc-event { + border-style: solid; + border-width: 0; + cursor: default; + font-size: 0.85em; +} +a.fc-event, .fc-event-draggable { + cursor: pointer; +} +a.fc-event { + text-decoration: none; +} +.fc-rtl .fc-event { + text-align: right; +} +.fc-event-skin { + background-color: #fb7a2c; + border-color: #000000; + border-radius: 2px 2px 2px 2px; + color: #FFFFFF; + display: block; + font-size: 11px; + margin-top: 1px; + padding: 1px 0; +} +.fc-event-inner { + border-style: solid; + border-width: 0; + height: 100%; + overflow: hidden; + position: relative; + width: 100%; +} +.fc-event-time, .fc-event-title { + display: block; + float: left; + line-height: 16px; + padding: 0 2px 1px 5px; +} +.fc .ui-resizable-handle { + display: block; + font-size: 300%; + line-height: 50%; + overflow: hidden; + position: absolute; + z-index: 99999; +} +.fc-event-hori { + margin-bottom: 1px; +} +.fc-event-hori .ui-resizable-e { + cursor: e-resize; + height: 100% !important; + right: -3px !important; + top: 0 !important; + width: 7px !important; +} +.fc-event-hori .ui-resizable-w { + cursor: w-resize; + height: 100% !important; + left: -3px !important; + top: 0 !important; + width: 7px !important; +} +.fc-event-hori .ui-resizable-handle { +} +.fc-corner-left { + margin-left: 1px; +} +.fc-corner-left .fc-button-inner, .fc-corner-left .fc-event-inner { +} +.fc-corner-right { + margin-right: 1px; +} +.fc-corner-right .fc-button-inner, .fc-corner-right .fc-event-inner { + margin-right: -1px; +} +.fc-corner-top { + margin-top: 1px; +} +.fc-corner-top .fc-event-inner { + margin-top: -1px; +} +.fc-corner-bottom { + margin-bottom: 1px; +} +.fc-corner-bottom .fc-event-inner { + margin-bottom: -1px; +} +.fc-corner-left .fc-event-inner { +} +.fc-corner-right .fc-event-inner { +} +.fc-corner-top .fc-event-inner { + border-top-width: 1px; +} +.fc-corner-bottom .fc-event-inner { + border-bottom-width: 1px; +} +table.fc-border-separate { + border-collapse: separate; +} +.fc-border-separate th, .fc-border-separate td { + border-width: 1px 0 0 1px; +} +.fc-border-separate td:first-child, .fc-border-separate th:first-child { + border-left: medium none; +} +.fc-border-separate th.fc-last, .fc-border-separate td.fc-last { +} +.fc-border-separate tr.fc-last th, .fc-border-separate tr.fc-last td { + border-top-width: 1px; +} +.fc-border-separate tbody tr.fc-first td, .fc-border-separate tbody tr.fc-first th { + border-top-width: 1px; +} +.fc-grid th { + text-align: center; +} +.fc-grid .fc-day-number { + float: right; + padding: 3px 5px; +} +.fc-grid .fc-other-month .fc-day-number { + opacity: 0.3; +} +.fc-grid .fc-day-content { + clear: both; + padding: 5px 2px 3px; +} +.fc-grid .fc-event-time { + font-weight: bold; +} +.fc-rtl .fc-grid .fc-day-number { + float: left; +} +.fc-rtl .fc-grid .fc-event-time { + float: right; +} +.fc-agenda table { + border-collapse: separate; +} +.fc-agenda-days th { + text-align: center; +} +.fc-agenda .fc-agenda-axis { + font-weight: normal; + padding: 0 4px; + text-align: right; + vertical-align: middle; + white-space: nowrap; + width: 50px; +} +.fc-agenda .fc-day-content { + padding: 2px 2px 1px; +} +.fc-agenda-days .fc-agenda-axis { + border-right-width: 1px; +} +.fc-agenda-days .fc-col0 { + border-left-width: 0; +} +.fc-agenda-allday th { + border-width: 0 1px; +} +.fc-agenda-allday .fc-day-content { + min-height: 34px; +} +.fc-agenda-divider-inner { + height: 2px; + overflow: hidden; +} +.fc-widget-header .fc-agenda-divider-inner { + background: none repeat scroll 0 0 #EEEEEE; +} +.fc-agenda-slots th { + border-width: 1px 1px 0; +} +.fc-agenda-slots td { + background: none repeat scroll 0 0 transparent; + border-width: 1px 0 0; +} +.fc-agenda-slots td div { + height: 20px; +} +.fc-agenda-slots tr.fc-slot0 th, .fc-agenda-slots tr.fc-slot0 td { + border-top-width: 0; +} +.fc-agenda-slots tr.fc-minor th, .fc-agenda-slots tr.fc-minor td { + border-top-style: dotted; +} +.fc-agenda-slots tr.fc-minor th.ui-widget-header { +} +.fc-event-vert { + border-width: 0 1px; +} +.fc-event-vert .fc-event-head, .fc-event-vert .fc-event-content { + overflow: hidden; + position: relative; + width: 100%; + z-index: 2; +} +.fc-event-vert .fc-event-time { + font-size: 10px; + white-space: nowrap; +} +.fc-event-vert .fc-event-bg { + background: none repeat scroll 0 0 #FFFFFF; + height: 100%; + left: 0; + opacity: 0.3; + position: absolute; + top: 0; + width: 100%; + z-index: 1; +} +.fc .ui-draggable-dragging .fc-event-bg, .fc-select-helper .fc-event-bg { +} +.fc-event-vert .ui-resizable-s { + bottom: 0 !important; + cursor: s-resize; + font-family: monospace; + font-size: 11px !important; + height: 8px !important; + line-height: 8px !important; + overflow: hidden !important; + text-align: center; + width: 100% !important; +} +.fc-agenda .ui-resizable-resizing { +} + +#external-events .external-event { + margin-bottom: 5px; cursor:all-scroll; +} diff --git a/target/disped-web/resources/css/jquery.gritter.css b/target/disped-web/resources/css/jquery.gritter.css new file mode 100644 index 0000000000000000000000000000000000000000..fe11500453fc369ffe592692827ed4c3dde42997 --- /dev/null +++ b/target/disped-web/resources/css/jquery.gritter.css @@ -0,0 +1,91 @@ +/* the norm */ +#gritter-notice-wrapper { + position:fixed; + top:50px; + right:10px; + width:301px; + z-index:100001; +} +#gritter-notice-wrapper.top-left { + left: 20px; + right: auto; +} +#gritter-notice-wrapper.bottom-right { + top: auto; + left: auto; + bottom: 20px; + right: 20px; +} +#gritter-notice-wrapper.bottom-left { + top: auto; + right: auto; + bottom: 20px; + left: 20px; +} +.gritter-item-wrapper { + position:relative; + margin:0 0 10px 0; +} + +.gritter-top, .gritter-bottom { + height: 0; +} + +.gritter-item { + display:block; + background: #f74d4d; /* Old browsers */ + color:#2b2b2b; box-shadow:3px 3px 20px #000; + padding:7px 10px 10px; + font-size: 11px; color:#fff; + font-family:verdana; +} +.hover .gritter-item { +} +.gritter-item p { + padding:0; + margin:0; + word-wrap:break-word; + font-size: 10px; + line-height: 14px; +} +.gritter-close { + display:none; + position:absolute; + top:-7px; + right:-9px; + background:url(../img/gritter.png) no-repeat left top; + cursor:pointer; + width:30px; + height:30px; +} +.gritter-title { + font-size:12px; + font-weight:bold; + padding:0 0 7px 0; + display:block; +} +.gritter-image { + width:32px; + height:32px; + float:left; + margin: 5px; +} +.gritter-with-image, +.gritter-without-image { + padding:0; +} +.gritter-with-image { + width:220px; + float:right; +} +/* for the light (white) version of the gritter notice */ +.gritter-light .gritter-item, +.gritter-light .gritter-bottom, +.gritter-light .gritter-top, +.gritter-light .gritter-close { + background-image: url(../img/gritter-light.png); + color: #222; +} +.gritter-light .gritter-title { + text-shadow: none; +} diff --git a/target/disped-web/resources/css/matrix-login.css b/target/disped-web/resources/css/matrix-login.css new file mode 100644 index 0000000000000000000000000000000000000000..049a29068fad0996ce9fc3420fcf7a30c7b7302e --- /dev/null +++ b/target/disped-web/resources/css/matrix-login.css @@ -0,0 +1,66 @@ +html, body { width: 100%; height: 100%;} +/*Bootstrap-overlay*/ + +body { + overflow-x: hidden; + margin-top: -10px; font-family: 'Open Sans', sans-serif; font-size:12px; color:#666; +} +a{color:#666;} +a:hover, a:focus { + text-decoration: none; color:#28b779; +} +.dropdown-menu .divider{ margin:4px 0px;} +.dropdown-menu{ min-width:180px;} +.dropdown-menu > li > a{ padding:3px 10px; color:#666; font-size:12px;} +.dropdown-menu > li > a i{ padding-right:3px;} +.userphoto img{ width:19px; height:19px;} +select, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input, .label, .dropdown-menu, .btn, .well, .progress, .table-bordered, .btn-group > .btn:first-child, .btn-group > .btn:last-child, .btn-group > .btn:last-child, .btn-group > .dropdown-toggle, .alert{ border-radius:0px;} +.btn, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input{ box-shadow:none;} +.progress, .progress-success .bar, .progress .bar-success, .progress-warning .bar, .progress .bar-warning, .progress-danger .bar, .progress .bar-danger, .progress-info .bar, .progress .bar-info, .btn, .btn-primary{background-image:none;} +.accordion-heading h5{ width:70%; } +.form-horizontal .form-actions{ padding-left:20px; } +#footer{ padding:10px; text-align:center;} +.carousel{ margin-bottom:0px;} +.fl { float:left} +.fr {float:right} +.label-important, .badge-important{ background:#f74d4d;} + +/*Metro Background color class*/ +.bg_lb{ background:#27a9e3;} +.bg_db{ background:#2295c9;} +.bg_lg{ background:#28b779;} +.bg_dg{ background:#28b779;} +.bg_ly{ background:#ffb848;} +.bg_dy{ background:#da9628;} +.bg_ls{ background:#2255a4;} +.bg_lo{ background:#da542e;} +.bg_lr{ background:#f74d4d;} +.bg_lv{ background:#603bbc;} +.bg_lh{ background:#b6b3b3;} + +body { background-color:#2E363F; padding: 0; margin-top:10%;} +#logo, #loginbox { width: 32%; margin-left: auto; margin-right: auto; position: relative;} +#logo img { margin: 0 auto; display: block;} +#loginbox { overflow: hidden !important; text-align: left; position: relative; } +#loginbox form{ width:100%; position:relative; top:0; left:0; } +#loginbox .form-actions { padding: 14px 20px 15px;} +#loginbox .form-actions .pull-left { margin-top:0px;} +#loginbox form#loginform { z-index: 200; display:block;} +#loginbox form#recoverform { z-index: 100; display:none;} +#loginbox form#recoverform .form-actions { margin-top: 10px;} +#loginbox .main_input_box { margin:0 auto; text-align:center; font-size:13px;} +#loginbox .main_input_box .add-on{ padding:9px 9px; *line-height:31px; color:#fff; width:30px; display:inline-block;} +#loginbox .main_input_box input{ height:30px; border:0px; display:inline-block; width:75%; line-height:28px; margin-bottom:3px;} +/* #loginbox .controls{ padding:0 20px;} */ +#loginbox .control-group{ padding:20px 0; margin-bottom:0px;} +.form-vertical, .form-actions { margin-bottom: 0; background:none;} +#loginbox .normal_text{ padding:15px 10px; text-align:center; font-size:14px; line-height:20px; color:#fff; } +@media (max-width:800px){ +#logo { width: 60%; } +#loginbox{ width:80%} +} +@media (max-width: 480px){ +#logo { width: 40%; } +#loginbox{ width:90%} +#loginbox .control-group{ padding:8px 0; margin-bottom:0px;} +} \ No newline at end of file diff --git a/target/disped-web/resources/css/matrix-media.css b/target/disped-web/resources/css/matrix-media.css new file mode 100644 index 0000000000000000000000000000000000000000..a680bbb2c69365b42f2d13cf9d09db148051199f --- /dev/null +++ b/target/disped-web/resources/css/matrix-media.css @@ -0,0 +1,76 @@ +body { + background:#2E363F; +} + +#header { + background-color: #1f262d; + margin-top:10px; +} +#search input[type=text], #search button { + background-color: #28b779; +} +#search input[type=text]:focus { + color: #777777; +} +#sidebar > ul{border-bottom: 1px solid #37414b} +#sidebar > ul > li { + border-top: 1px solid #37414b; border-bottom: 1px solid #1f262d; +} +#sidebar > ul > li.active { + background-color: #27a9e3; border-bottom: 1px solid #27a9e3; border-top: 1px solid #27a9e3; +} +#sidebar > ul > li.active a{ color:#fff; text-decoration:none;} + +#sidebar > ul > li > a > .label { + background-color:#F66; +} +#sidebar > ul > li > a:hover { + background-color: #27a9e3; color:#fff; +} +#sidebar > ul li ul { + background-color: #1e242b; +} +#sidebar > ul li ul li a{ color:#939da8} +#sidebar > ul li ul li a:hover, #sidebar > ul li ul li.active a { + color: #fff; + background-color: #28b779; +} + + +#search input[type=text] { + background-color: #47515b; color: #fff; +} +#search input[type=text]:focus { + color: #2e363f; color: #fff; box-shadow:none; +} +.dropdown-menu li a:hover, .dropdown-menu .active a, .dropdown-menu .active a:hover { + color: #eeeeee; + background:#666; + +} +.top_message{ float:right; padding:20px 12px; position:relative; top:-13px; border-left:1px solid #3D3A37; font-size:14px; line-height:20px; *line-height:20px; color:#333; text-align:center; vertical-align:middle; cursor:pointer; } +.top_message:hover{ background:#000} +.rightzero{ right:0px; display:none;} +@media (max-width: 480px) { + #sidebar > a { + background:#27a9e3; + + } + .quick-actions_homepage .quick-actions li{ min-width:100%;} +} +@media (min-width: 768px) and (max-width: 970px) {.quick-actions_homepage .quick-actions li{ min-width:20.5%;}} +@media (min-width: 481px) and (max-width: 767px) { + #sidebar > ul ul:before { + } + #sidebar > ul ul:after { + border-right: 6px solid #222222; + } + .quick-actions_homepage .quick-actions li{ min-width:47%;} +} +div.tagsinput { border:1px solid #CCC; background: #FFF; padding:5px; width:300px; height:100px; overflow-y: auto;} +div.tagsinput span.tag { border: 1px solid #a5d24a; -moz-border-radius:2px; -webkit-border-radius:2px; display: block; float: left; padding: 5px; text-decoration:none; background: #cde69c; color: #638421; margin-right: 5px; margin-bottom:5px;font-family: helvetica; font-size:13px;} +div.tagsinput span.tag a { font-weight: bold; color: #82ad2b; text-decoration:none; font-size: 11px; } +div.tagsinput input { width:80px; margin:0px; font-family: helvetica; font-size: 13px; border:1px solid transparent; padding:5px; background: transparent; color: #000; outline:0px; margin-right:5px; margin-bottom:5px; } +div.tagsinput div { display:block; float: left; } +.tags_clear { clear: both; width: 100%; height: 0px; } +.not_valid {background: #FBD8DB !important; color: #90111A !important;} diff --git a/target/disped-web/resources/css/matrix-style.css b/target/disped-web/resources/css/matrix-style.css new file mode 100644 index 0000000000000000000000000000000000000000..01bc69fdf72728f01bd94c7b6492a6e51c778d90 --- /dev/null +++ b/target/disped-web/resources/css/matrix-style.css @@ -0,0 +1,1610 @@ +* { + outline:none !important; + -moz-outline: none !important; +} +td { + vertical-align: middle !important; +} +html, body{height:100%} +/* Main */ + +/*Bootstrap-overlay*/ + +body { + overflow-x: hidden; + margin-top: -10px; font-family: 'Open Sans', sans-serif; font-size:12px; color:#666; +} +a{color:#666;} +a:hover, a:focus { + text-decoration: none; color:#28b779; +} +.dropdown-menu .divider{ margin:4px 0px;} +.dropdown-menu{ min-width:180px;} +.dropdown-menu > li > a{ padding:3px 10px; color:#666; font-size:12px;} +.dropdown-menu > li > a i{ padding-right:3px;} +.userphoto img{ width:19px; height:19px;} +select, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input, .label, .dropdown-menu, .btn, .well, .progress, .table-bordered, .btn-group > .btn:first-child, .btn-group > .btn:last-child, .btn-group > .btn:last-child, .btn-group > .dropdown-toggle, .alert{ border-radius:0px;} +.btn, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input{ box-shadow:none;} +.progress, .progress-success .bar, .progress .bar-success, .progress-warning .bar, .progress .bar-warning, .progress-danger .bar, .progress .bar-danger, .progress-info .bar, .progress .bar-info, .btn, .btn-primary{background-image:none;} +.accordion-heading h5{ width:70%; } +.form-horizontal .form-actions{ padding-left:20px; } +#footer{ padding:10px; text-align:center;} +hr{ border-top-color:#dadada;} +.carousel{ margin-bottom:0px;} +.fl { float:left} +.fr {float:right} +.label-important, .badge-important{ background:#f74d4d;} +.copyrights{text-indent:-9999px;height:0;line-height:0;font-size:0;overflow:hidden;} +/*Metro Background color class*/ +.bg_lb{ background:#27a9e3;} +.bg_db{ background:#2295c9;} +.bg_lg{ background:#28b779;} +.bg_dg{ background:#28b779;} +.bg_ly{ background:#ffb848;} +.bg_dy{ background:#da9628;} +.bg_ls{ background:#2255a4;} +.bg_lo{ background:#da542e;} +.bg_lr{ background:#f74d4d;} +.bg_lv{ background:#603bbc;} +.bg_lh{ background:#b6b3b3;} + +/* Header */ +#header { + height: 77px; + position: relative; + width: 100%; + z-index: -9; +} +#header h1 { + background: url("../img/logo.png") no-repeat scroll 0 0 transparent; + /* background-size: cover; */ + height: 31px; + left: 20px; + line-height: 600px; + overflow: hidden; + position: relative; + top: 26px; + width: 191px; +} +#header h1 a { + display: block; +} +/* Search input */ +#search { + position: absolute; + z-index: 25; + top: 6px; + right:10px; +} +#search input[type=text] { + padding: 4px 10px 5px; + border: 0; + width: 100px; +} +#search button { + border: 0; + margin-left:-3px; + margin-top: -11px; + padding: 5px 10px 4px; +} +#search button i { + opacity: 0.8; color:#fff; +} +#search button:hover i, #search button:active i { + opacity: 1; +} + + +/* Top user navigation */ +#user-nav { + position: absolute; + right: 0; + top:0px; + z-index: 20; + margin: 0; +} +#user-nav > ul { + margin: 0; + padding: 0; + list-style: none; border-right: 1px solid #2e363f;border-left: 1px solid #000; +} +#user-nav > ul > li { + float: left; + list-style-type: none; + margin: 0; + position: relative; + padding: 0; border-left: 1px solid #2e363f; border-right: 1px solid #000; +} +#user-nav > ul > li > a { + padding:9px 10px; + display: block; + font-size: 11px; +} +#user-nav > ul > li > a:hover, #user-nav > ul > li.open > a { + color: #ffffff; background:#000; +} +#user-nav > ul > li > a > i, #sidebar li a i { + opacity: .5; + margin-top: 2px; +} +#user-nav > ul > li > a:hover > i, #user-nav > ul > li.open > a > i { + opacity: 1; +} +#user-nav > ul > li > a > .label { + vertical-align: middle; + padding: 1px 4px 1px; + margin: -2px 4px 0; + display: inline-block; +} +#user-nav > ul ul > li > a { + text-align: left; +} +#user-nav > ul ul > li > a:hover { +} +/* Sidebar Navigation */ +#sidebar { + display: block; + float: left; + position: relative; + width: 220px; + z-index: 16; + font-size: 15px; +} +#sidebar > ul { + list-style: none; + margin: 0px 0 0; + padding: 0; + position: absolute; + width: 220px; +} +#sidebar > ul > li { + display: block; + position: relative; +} +#sidebar > ul > li > a { + padding: 10px 0 10px 15px; + display: block; + color: #939da8; +} +#sidebar > ul > li > a > i { + margin-right: 10px; +} +#sidebar > ul > li.active > a { + background: url("../img/menu-active.png") no-repeat scroll right center transparent !important; + text-decoration:none; +} +#sidebar > ul > li > a > .label { + margin: 0 20px 0 0; + float: right; + padding: 3px 5px 2px; +} +#sidebar > ul li ul { + display: none; + margin: 0; + padding: 0; +} +#sidebar > ul li.open ul { + display: block; +} +#sidebar > ul li ul li a { + padding: 10px 0 10px 25px; + display: block; + color: #777777; +} +#sidebar > ul li ul li:first-child a { + border-top: 0; +} +#sidebar > ul li ul li:last-child a { + border-bottom: 0; +} +/* Content */ +#content { + background: none repeat scroll 0 0 #eeeeee; + margin-left: 220px; + margin-right: 0; + padding-bottom: 25px; + position: relative; + min-height:100%; + width: auto; +} +#content-header { + position: abslute; + width: 100%; + margin-top: -38px; + z-index: 20; +} +#content-header h1 { + color: #555555; + font-size: 28px; + font-weight: normal; + float: none; + text-shadow: 0 1px 0 #ffffff; + margin-left: 20px; + position: relative; +} +#content-header .btn-group { + float: right; + right: 20px; + position: absolute; +} +#content-header h1, #content-header .btn-group { + margin-top: 20px; +} +#content-header .btn-group .btn { + padding: 11px 14px 9px; +} +#content-header .btn-group .btn .label { + position: absolute; + top: -7px; +} +.container-fluid .row-fluid:first-child { + margin-top: 20px; +} +/* Breadcrumb */ +#breadcrumb { + background-color: #fff; + border-bottom: 1px solid #e3ebed; +} +#breadcrumb a { + padding: 8px 20px 8px 10px; + display: inline-block; + background-image: url('../img/breadcrumb.png'); + background-position: center right; + background-repeat: no-repeat; + font-size: 11px; + color: #666666; +} +#breadcrumb a:hover { + color: #333333; +} +#breadcrumb a:last-child { + background-image:none; +} +#breadcrumb a.current { + font-weight: bold; + color: #444444; +} +#breadcrumb a i { + margin-right: 5px; + opacity: .6; +} +#breadcrumb a:hover i { + margin-right: 5px; + opacity: .8; +} +/*todo-list*/ +.todo ul { + list-style: none outside none; + margin: 0; +} +.todo li { + border-bottom: 1px solid #EBEBEB; + margin-bottom: 0; + padding: 10px 0; +} +.todo li:hover { + background: none repeat scroll 0 0 #FCFCFC; + border-color: #D9D9D9; +} +.todo li:last-child{ border-bottom:0px;} +.todo li .txt { + float: left; +} +.todo li .by { + margin-left: 10px; + margin-right: 10px; +} +.todo li .date { + margin-right: 10px; +} + +/* Stat boxes and quick actions */ +.quick-actions_homepage { + width:100%; + text-align:center; position:relative; + float:left; + margin-top:10px; +} +.stat-boxes, .quick-actions, .quick-actions-horizontal, .stats-plain { + display: block; + list-style: none outside none; + margin: 15px 0; + text-align: center; +} +.stat-boxes2 { + display: inline-block; + list-style: none outside none; + margin:0px; + text-align: center; +} +.stat-boxes2 li { + display: inline-block; + line-height: 18px; + margin: 0 10px 10px; + padding: 0 10px; background:#fff; border: 1px solid #DCDCDC +} +.stat-boxes2 li:hover{ background: #f6f6f6; } +.stat-boxes2 .left, .stat-boxes .right { + text-shadow: 0 1px 0 #fff; + float: left; +} +.stat-boxes2 .left { + border-right: 1px solid #DCDCDC; + box-shadow: 1px 0 0 0 #FFFFFF; + font-size: 10px; + font-weight: bold; + margin-right: 10px; + padding: 10px 14px 6px 4px; +} +.stat-boxes2 .right { + color: #666666; + font-size: 12px; + padding: 9px 10px 7px 0; + text-align: center; + min-width: 70px; float:left +} +.stat-boxes2 .left span, .stat-boxes2 .right strong { + display: block; +} +.stat-boxes2 .right strong { + font-size: 26px; + margin-bottom: 3px; + margin-top: 6px; +} +.quick-actions_homepage .quick-actions li{ position:relative;} +.quick-actions_homepage .quick-actions li .label{ position:absolute; padding:5px; top:-10px; right:-5px;} +.stats-plain { + width: 100%; +} +.stat-boxes li, .quick-actions li, .quick-actions-horizontal li { + float: left; + line-height: 18px; + margin: 0 10px 10px 0px; + padding: 0 10px; +} +.stat-boxes li a:hover, .quick-actions li a:hover, .quick-actions-horizontal li a:hover, .stat-boxes li:hover, .quick-actions li:hover, .quick-actions-horizontal li:hover { + background: #2E363F; +} +.quick-actions li { + min-width:14%; + min-height:70px; +} +.quick-actions_homepage .quick-actions .span3{ width:30%;} +.quick-actions li, .quick-actions-horizontal li { + padding: 0; +} +.stats-plain li { + padding: 0 30px; + display: inline-block; + margin: 0 10px 20px; +} +.quick-actions li a { + padding:10px 30px; +} +.stats-plain li h4 { + font-size: 40px; + margin-bottom: 15px; +} +.stats-plain li span { + font-size: 14px; + color: #fff; +} +.quick-actions-horizontal li a span { + padding: 10px 12px 10px 10px; + display: inline-block; +} +.quick-actions li a, .quick-actions-horizontal li a { + display: block; + color: #fff; font-size:14px; + font-weight:lighter; +} +.quick-actions li a i[class^="icon-"], .quick-actions li a i[class*=" icon-"] { + font-size:30px; + display: block; + margin: 0 auto 5px; +} +.quick-actions-horizontal li a i[class^="icon-"], .quick-actions-horizontal li a i[class*=" icon-"] { + background-repeat: no-repeat; + background-attachment: scroll; + background-position: center; + background-color: transparent; + width: 16px; + height: 16px; + display: inline-block; + margin: -2px 0 0 !important; + border-right: 1px solid #dddddd; + margin-right: 10px; + padding: 10px; + vertical-align: middle; +} + +.quick-actions li:active, .quick-actions-horizontal li:active { + background-image: -webkit-gradient(linear, 0 0%, 0 100%, from(#EEEEEE), to(#F4F4F4)); + background-image: -webkit-linear-gradient(top, #EEEEEE 0%, #F4F4F4 100%); + background-image: -moz-linear-gradient(top, #EEEEEE 0%, #F4F4F4 100%); + background-image: -ms-linear-gradient(top, #EEEEEE 0%, #F4F4F4 100%); + background-image: -o-linear-gradient(top, #EEEEEE 0%, #F4F4F4 100%); + background-image: linear-gradient(top, #EEEEEE 0%, #F4F4F4 100%); + box-shadow: 0 1px 4px 0 rgba(0,0,0,0.2) inset, 0 1px 0 rgba(255,255,255,0.4); +} +.stat-boxes .left, .stat-boxes .right { + text-shadow: 0 1px 0 #fff; + float: left; +} +.stat-boxes .left { + border-right: 1px solid #DCDCDC; + box-shadow: 1px 0 0 0 #FFFFFF; + font-size: 10px; + font-weight: bold; + margin-right: 10px; + padding: 10px 14px 6px 4px; +} +.stat-boxes .right { + color: #666666; + font-size: 12px; + padding: 9px 10px 7px 0; + text-align: center; + min-width: 70px; +} +.stat-boxes .left span, .stat-boxes .right strong { + display: block; +} +.stat-boxes .right strong { + font-size: 26px; + margin-bottom: 3px; + margin-top: 6px; +} +.stat-boxes .peity_bar_good, .stat-boxes .peity_line_good, { + color: #459D1C; +} +.stat-boxes .peity_bar_neutral, .stat-boxes .peity_line_neutral { + color: #757575; +} +.stat-boxes .peity_bar_bad, .stat-boxes .peity_line_bad { + color: #BA1E20; +} +.stats-plain { +} + +.site-stats { + margin: 0; + padding: 0; text-align:center; + list-style: none; +} +.site-stats li { + cursor: pointer; display:inline-block; + margin: 0 5px 10px; text-align:center; width:42%; + padding:10px 0; color:#fff; + position: relative; +} +.site-stats li i{ font-size:24px; clear:both} +.site-stats li:hover { background:#2E363F; +} + +.site-stats li i { + vertical-align: baseline; +} +.site-stats li strong { + font-weight: bold; + font-size: 20px; width:100%; float:left; + margin-left:0px; +} +.site-stats li small { + margin-left:0px; + font-size: 11px; + width:100%; float:left; +} +/* Charts & graphs **/ +.chart, .pie, .bars, #donut, #interactive, #placeholder, #placeholder2 { + height: 300px; + max-width: 100%; +} +#choices{ border-top:1px solid #dcdcdc; margin:10px 0; padding:10px;} +#choices br{ display:none;} +#choices input{ margin:-5px 5px 0 0;} +#choices label{ display:inline-block; padding-right:20px; } +#tooltip { + position: absolute; + display:none; + border: none; + padding: 3px 8px; + border-radius: 3px; + font-size: 10px; + background-color: #222222; + color: #ffffff; + z-index: 25; +} +/* Widgets */ +.widget-box { + background: none repeat scroll 0 0 #F9F9F9; + border-left: 1px solid #CDCDCD; + border-top: 1px solid #CDCDCD; + border-right: 1px solid #CDCDCD; + clear: both; + margin-top: 16px; + margin-bottom: 16px; + position: relative; +} +.widget-box.widget-calendar, .widget-box.widget-chat { + overflow:hidden !important; +} +.accordion .widget-box { + margin-top: -2px; + margin-bottom: 0; + border-radius: 0; +} +.widget-box.widget-plain { + background: transparent; + border: none; + margin-top: 0; + margin-bottom: 0; +} +.widget-title, .modal-header, .table th, div.dataTables_wrapper .ui-widget-header { + background:#efefef; + border-bottom: 1px solid #CDCDCD; + height: 36px; +} +.widget-title .nav-tabs { + border-bottom: 0 none; +} +.widget-title .nav-tabs li a { + border-bottom: medium none !important; + border-left: 1px solid #DDDDDD; + border-radius: 0 0 0 0; + border-right: 1px solid #DDDDDD; + border-top: medium none; + color: #999999; + margin: 0; + outline: medium none; + padding: 9px 10px 8px; + font-weight: bold; + text-shadow: 0 1px 0 #FFFFFF; +} +.widget-title .nav-tabs li:first-child a { + border-left: medium none !important; +} +.widget-title .nav-tabs li a:hover { + background-color: transparent !important; + border-color: #D6D6D6; + border-width: 0 1px; + color: #2b2b2b; +} +.widget-title .nav-tabs li.active a { + background-color: #F9F9F9 !important; + color: #444444; +} +.widget-title span.icon { + padding: 9px 10px 7px 11px; + float: left; border-right:1px solid #dadada; +} +.widget-title h5 { + color: #666; + float: left; + font-size: 12px; + font-weight: bold; + padding: 12px; + line-height: 12px; + margin: 0; +} +.widget-title .buttons { + float: right; + margin: 8px 10px 0 0; +} +.widget-title .label { + padding: 3px 5px 2px; + float: right; + margin: 9px 11px 0 0; + box-shadow: 0 1px 2px rgba(0,0,0,0.3) inset, 0 1px 0 #ffffff; +} +.widget-calendar .widget-title .label { + margin-right: 190px; +} +.widget-content { + padding:15px; + border-bottom: 1px solid #cdcdcd; +} +.widget-box.widget-plain .widget-content { + padding: 12px 0 0; +} +.widget-box.collapsible .collapse.in .widget-content { + border-bottom: 1px solid #CDCDCD; +} +.recent-posts, .recent-comments, .recent-users { + margin: 0; + padding: 0; +} +.recent-posts li, .recent-comments li, .article-post li, .recent-users li { + border-bottom: 1px dotted #AEBDC8; + list-style: none outside none; + padding: 10px; +} +.recent-posts li.viewall, .recent-comments li.viewall, .recent-users li.viewall { + padding: 0; +} +.recent-posts li.viewall a, .recent-comments li.viewall a, .recent-users li.viewall a { + padding: 5px; + text-align: center; + display: block; + color: #888888; +} +.recent-posts li.viewall a:hover, .recent-comments li.viewall a:hover, .recent-users li.viewall a:hover { + background-color: #eeeeee; +} +.recent-posts li:last-child, .recent-comments li:last-child, .recent-users li:last-child { + border-bottom: none !important; +} +.user-thumb { + background: none repeat scroll 0 0 #FFFFFF; + float: left; + height: 40px; + margin-right: 10px; + margin-top: 5px; + padding: 2px; + width: 40px; +} +.user-info { + color: #666666; + font-size: 11px; +} + +.invoice-content { + padding: 20px; +} +.invoice-action { + margin-bottom: 30px; +} +.invoice-head { + clear: both; + margin-bottom: 40px; + overflow: hidden; + width: auto; +} +.invoice-meta { + font-size: 18px; + margin-bottom: 40px; +} +.invoice-date { + float: right; + font-size: 80%; +} +.invoice-content h5 { + color: #333333; + font-size: 16px; + font-weight: normal; + margin-bottom: 10px; +} +.invoice-content ul { + list-style: none; + margin: 0; + padding: 0; +} +.invoice-to { + float: left; + width: 370px; +} +.invoice-from { + float: right; + width: 300px; +} +.invoice-to li, .invoice-from li { + clear: left; +} +.invoice-to li span, .invoice-from li span { + display: block; +} +.invoice-content th.total-label { + text-align: right; +} +.invoice-content th.total-amount { + text-align: left; +} +.amount-word { + color: #666666; + margin-bottom: 40px; + margin-top: 40px; +} +.amount-word span { + color: #5476A6; + font-weight: bold; + padding-left: 20px; +} +.panel-left { + margin-top:103px; +} +.panel-left2 { + margin-left:176px; +} +.panel-right { + width: 100%; + background-color: #fff; + border-bottom: 1px solid #dddddd; + position: absolute; + right: 0; + overflow:auto; + top:38px; + height:76px; +} +.panel-right2 { + width: 100%; + background-color: #fff; + border-right: 1px solid #dddddd; + position: absolute; + left: 0; + overflow:auto; + top:0px; + height:94%; + width:175px; +} +.panel-right .panel-title, .panel-right2 .panel-title { + width: 100%; + background-color: #ececec; + border-bottom: 1px solid #dddddd; +} +.panel-right .panel-title h5, .panel-right2 .panel-title h5 { + font-size: 12px; + color: #777777; + text-shadow: 0 1px 0 #ffffff; + padding: 6px 10px 5px; + margin: 0; +} +.panel-right .panel-content { + padding: 10px; +} +.chat-content { + height: 470px; + padding: 15px; +} +.chat-messages { + height: 420px; + overflow: auto; + position: relative; +} +.chat-message { + padding: 7px 15px; + margin: 7px 0 0; +} +.chat-message input[type=text] { + margin-bottom: 0 !important; + width: 100%; +} +.chat-message .input-box { + display: block; + margin-right: 90px; +} +.chat-message button { + float: right; +} +#chat-messages-inner p { + padding:0px; + margin: 10px 0 0 0; +} +#chat-messages-inner p img { + display: inline-block; + float: left; + vertical-align: middle; + width: 28px; + height: 28px; + margin-top:-1px; + margin-right:10px; +} +#chat-messages-inner .msg-block, #chat-messages-inner p.offline span { + background: none repeat scroll 0 0 #FFFFFF; + border: 1px solid #cccccc; + box-shadow: 1px 1px 0 1px rgba(0, 0, 0, 0.05); + display: block; + margin-left:0px; + padding: 10px; + position: relative; +} +#chat-messages-inner p.offline span { + background: none repeat scroll 0 0 #FFF5F5; +} +#chat-messages-inner .time { + color: #999999; + font-size: 11px; + float:right; +} +#chat-messages-inner .msg { + display: block; + margin-top: 13px; + border-top:1px solid #dadada; +} +#chat-messages-inner .msg-block:before { + border-right: 7px solid rgba(0,0,0,0.1); + border-top: 7px solid transparent; + border-bottom: 7px solid transparent; + content: ""; + display:none; + left: -7px; + position: absolute; + top: 11px; +} +#chat-messages-inner .msg-block:after { + border-right: 6px solid #ffffff; + border-top: 6px solid transparent; + border-bottom: 6px solid transparent; + content: ""; + display: none; + left: -6px; + position: absolute; + top: 12px; +} +.chat-users { + padding: 0 0 30px; +} +.chat-users .contact-list { + line-height: 21px; + list-style: none outside none; + margin: 0; + padding: 0; + font-size: 10px; +} +.chat-users .contact-list li { + border: 1px solid #DADADA; + margin:5px 5px; + padding: 1px; + position: relative; +} +.chat-users .contact-list li:hover { + background-color: #efefef; +} +.chat-users .contact-list li a { + color: #666666; + display: block; + padding: 8px 5px; +} +.chat-users .contact-list li.online a { + font-weight: bold; +} +.chat-users .contact-list li.new { + background-color: #eaeaea; +} +.chat-users .contact-list li.offline { + background-color: #EDE0E0; +} +.chat-users .contact-list li a img { + display: inline-block; + margin-right: 10px; + vertical-align: middle; + width: 28px; + height: 28px; +} +.chat-users .contact-list li .msg-count { + padding: 3px 5px; + position: absolute; + right: 10px; + top: 12px; +} +.taskDesc i { + margin: 1px 5px 0; +} +.taskStatus, .taskOptions { + text-align: center !important; +} +.taskStatus .in-progress { + color: #64909E; +} +.taskStatus .pending { + color: #AC6363; +} +.taskStatus .done { + color: #75B468; +} +.activity-list { + list-style: none outside none; + margin: 0; +} +.activity-list li { + border-bottom: 1px solid #EEEEEE; + display: block; +} +.activity-list li:last-child { + border-bottom: medium none; +} +.activity-list li a { + display: block; + padding: 7px 10px; +} +.activity-list li a:hover { + background-color: #FBFBFB; +} +.activity-list li a span { + color: #AAAAAA; + font-size: 11px; + font-style: italic; +} +.activity-list li a i { + margin-right: 10px; + opacity: 0.6; + vertical-align: middle; +} +.new-update { + border-top: 1px solid #DDDDDD; + padding: 10px 12px; +} +.new-update:first-child { + border-top: medium none; +} +.new-update span { + display:block; +} +.new-update i { + float: left; + margin-top: 3px; + margin-right: 13px; +} +.new-update .update-date { + color: #BBBBBB; + float: right; + margin: 4px -2px 0 0; + text-align: center; + width: 30px; +} +.new-update .update-date .update-day { + display: block; + font-size: 20px; + font-weight: bold; + margin-bottom: -4px; +} +.update-done, .update-alert, .update-notice { + display: block; + float: left; + max-width: 76%; +} +/* Tables */ +tr:hover{ background:#f6f6f6;} +span.icon .checker { + margin-top: -5px; + margin-right: 0; +} +.dataTables_length { + color: #878787; + margin: 7px 5px 0; + position: relative; + left:5px; width:50%; + top: -2px; +} +.dataTables_length div { + vertical-align: middle; +} +.dataTables_paginate { + line-height: 16px; + text-align: right; + margin-top: 5px; + margin-right: 10px; +} +.dataTables_paginate { + line-height: 16px; + text-align: right; + margin-top: 5px; + margin-right: 10px; +} +.dataTables_paginate .ui-button, .pagination.alternate li a { + font-size: 12px; + padding: 4px 10px !important; + border-style: solid; + border-width: 1px; + border-color: #dddddd #dddddd #cccccc; /* for IE < 9 */ + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + display: inline-block; + line-height: 16px; + background: #f5f5f5; + color: #333333; + text-shadow: 0 1px 0 #ffffff; +} +.dataTables_paginate .ui-button:hover, .pagination.alternate li a:hover { + background: #e8e8e8; + color: #222222; + text-shadow: 0 1px 0 #ffffff; + cursor: pointer; +} +.dataTables_paginate .first { + border-radius: 4px 0 0 4px; +} +.dataTables_paginate .last { + border-radius: 0 4px 4px 0; +} +.dataTables_paginate .ui-state-disabled, .fc-state-disabled, .pagination.alternate li.disabled a { + color: #AAAAAA !important; +} +.dataTables_paginate .ui-state-disabled:hover, .fc-state-disabled:hover, .pagination.alternate li.disabled a:hover { + background: #f5f5f5; + cursor: default !important; +} +.dataTables_paginate span .ui-state-disabled, .pagination.alternate li.active a { + background: #41BEDD !important; + color: #ffffff !important; + cursor: default !important; +} +div.dataTables_wrapper .ui-widget-header { + border-right: medium none; + border-top: 1px solid #D5D5D5; + font-weight: normal; + margin-top: -1px; +} +.dataTables_wrapper .ui-toolbar { + padding: 5px; +} +.dataTables_filter { + color: #878787; + font-size: 11px; + right: 0; top:37px; + margin: 4px 8px 2px 10px; + position: absolute; + text-align: left; +} +.dataTables_filter input { + margin-bottom: 0; +} +.table th { + height: auto; + font-size: 10px; + padding: 5px 10px 2px; + border-bottom: 0; + text-align: center; + color: #666666; +} +.table.with-check tr th:first-child, .table.with-check tr td:first-child { + width: 10px; +} +.table.with-check tr th:first-child i { + margin-top: -2px; + opacity: 0.6; +} +.table.with-check tr td:first-child .checker { + margin-right: 0; +} +.table tr.checked td { + background-color: #FFFFE3 !important; +} +/* Misc */ +.nopadding { + padding: 0 !important; +} +.nopadding .table { + margin-bottom: 0; +} +.nopadding .table-bordered { + border: 0; +} +.thumbnails { + margin-left: -2.12766% !important; +} +.thumbnails [class*="span"] { + margin-left: 2.12766% !important; + position: relative; +} +.thumbnails .actions { + width: auto; + height: 16px; + background-color:#000; + padding: 4px 8px 8px 8px; + position: absolute; + bottom:0%; + left:50%; + margin-top: -13px; + margin-left: -24px; + opacity: 0; top:10%; transition:1s ease-out; + -moz-transition: opacity 0.3s ease-in-out; +} +.thumbnails li:hover .actions,.thumbnails li:hover .actions a:hover{ + opacity: 1; color:#fff; top:50%; transition:1s ease-out; +} +.line { + background: url("../img/line.png") repeat-x scroll 0 0 transparent; + display: block; + height: 8px; +} +.modal { + z-index: 99999 !important; +} +.modal-backdrop { + z-index: 999 !important; +} +.modal-header { + height: auto; + padding: 8px 15px 5px; +} +.modal-header h3 { + font-size: 12px; + text-shadow: 0 1px 0 #ffffff; +} +.notify-ui ul { + list-style: none; + margin: 0; + padding: 0; +} +.notify-ui li { + background: #eeeeee; + margin-bottom: 5px; + padding: 5px 10px; + text-align: center; + border: 1px solid #dddddd; +} +.notify-ui li:hover { + cursor: pointer; + color: #777777; +} +/* Forms */ +form { + margin-bottom: 0; +} +.form-horizontal .control-group { + border-top: 1px solid #ffffff; + border-bottom: 1px solid #eeeeee; + margin-bottom: 0; +} +.form-horizontal .control-group:last-child { + border-bottom: 0; +} +.form-horizontal .control-label { + padding-top: 15px; + width: 180px; +} +.form-horizontal .controls { + margin-left: 200px; + padding: 10px 0; +} +.form-horizontal input[type=text], .form-horizontal input[type=password], .form-horizontal textarea { +} +.row-fluid .span20 { + width:97.8% +} +.form-horizontal .form-actions { + margin-top: 0; + margin-bottom: 0; +} +.help-block, .help-inline { + color: #999999; +} +/***********light-box***************/ +#lightbox { + position:fixed; /* keeps the lightbox window in the current viewport */ + top:0; + left:0; + width:100%; + height:100%; + background:url(overlay.png) repeat #000; + text-align:center; + z-index:9999; +} +#lightbox p { + position:absolute; + top:10px; + right:10px; + width:22px; + height:22px; + cursor:pointer; + z-index:22; + border:1px solid #fff; + border-radius:100%; + padding:2px; + text-align:center; + transition:0.5s; +} +#lightbox p:hover { + transform:rotate(180deg) +} +#imgbox { + position:absolute; /* keeps the lightbox window in the current viewport */ + left:0; + top:0px; + width:100%; + height:100%; + background:url(overlay.png) repeat #000; + text-align:center; + z-index:21; +} +#imgbox img { + margin-top:100px; + border:10px solid #fff; +} +/***********Error Page******************/ +.error_ex{ text-align:center;} +.error_ex h1{ font-size:140px; font-weight:bold; padding:50px 0; color:#28B779} + +#sidebar .content { + padding:10px; + position: relative; color:#939DA8; +} +#sidebar .percent { + font-weight: 700; + position: absolute; + right: 10px; + top:25px; +} +#sidebar .progress { + margin-bottom: 2px; + margin-top: 2px; + width: 70%; +} +#sidebar .progress-mini { + height: 6px; +} +#sidebar .stat { + font-size: 11px; +} +/***********light-box-end***************/ + +.btn-icon-pg ul { + margin:0px; + padding:0px; +} +.btn-icon-pg ul li { + margin:5px; + padding:5px; + list-style:none; + display:inline-block; + border:1px solid #dadada; + min-width:187px; + cursor:pointer +} +.btn-icon-pg ul li:hover i { + transition:0.3s; + -moz-transition:0.3s; + -webkit-transition:0.3s; + -o-transition:0.3s; + margin-left:8px; +} +.accordion { + margin-top:16px; +} +.fix_hgt { + height:115px; + overflow-x:auto; +} +.input-append .add-on:last-child, .input-append .btn:last-child { + border-radius:0px; + padding:6px 5px 2px; +} +.input-prepend input, .input-append input, .input-prepend input[class*="span"], .input-append input[class*="span"] { + width:none; +} +.input-append input, .input-append select, .input-prepend span, .input-prepend input { + border-radius:0px!important; +} +/***********pop-over********************/ +.bs-docs-tooltip-examples { + list-style: none outside none; + margin: 0 0 10px; + position:relative; + text-align: center; +} +.bs-docs-tooltip-examples li { + display: inline; + padding: 0 10px; + list-style:none; + position:relative; +} +/* Responsive design */ +@media (max-width: 480px) { +#header h1 { + top: 10px; left:5px; + margin: 3px auto; +} +#user-nav { + position: relative; + left: auto; + right: auto; + width: 100%; + margin-top: -31px; + border-top:1px solid #363E48; + margin-bottom: 0px; + background:#2E363F; + float:right; +} +.navbar > .nav { + float: none; +} +#my_menu { + display:none; +} +#my_menu_input { + display:block; +} +#user-nav > ul { + right: 0px; + margin-left:20%!important; + margin-top:0px; + width:100%; + background:#000; + position: relative; +} +#user-nav > ul > li { + padding:0px 0px; +} +#user-nav > ul > li > a { + padding:5px 10px; +} +#sidebar .content{ display:none;} +#content { + margin-left: 0 !important; + border-top-left-radius: 0; + margin-top:0px; +} +#content-header { + margin-top: 0; + text-align: center; +} +#content-header h1, #content-header .btn-group { + float: none; +} +#content-header h1 { + display: block; + text-align: center; + margin-left: auto; + margin-top: 0; + padding-top: 15px; + width: 100%; +} +#content-header .btn-group { + margin-top: 70px; + margin-bottom: 0; + margin-right: 0; + left: 30%; +} +#sidebar { + float: none; + width: 100% !important; + display:block; + position:relative; + top:0px; +} +#sidebar > ul { + margin:0px; + padding:0px; + width:100%; + display:block; + z-index:999; + position:relative +} +#sidebar > ul > li { + list-style-type:none; + display:block; + border-top:1px solid #41BEDD; + float:none !important; + margin:0px; + position:relative; + padding:2px 10px; + cursor:pointer +} +#sidebar > ul > li:hover ul { + display:none; +} +#sidebar > ul > li:hover { + background-color:#27a9e3; +} +#sidebar > ul > li:hover a { + background:none; +} +#sidebar > ul li ul { + margin:0px; + padding:0px; + top:35px; left:0px; + z-index:999; + display:none; + position:absolute; + width:100%; + min-width:100%; + border-radius:none; +} +#sidebar > ul li ul li { + list-style-type:none; + margin:0px; + font-size:12px; + line-height:30px; +} +#sidebar > ul li ul li a { + display:block; + padding:5px 10px; + color:#fff; + text-decoration:none; + font-weight:bold; +} +#sidebar > ul li ul li:hover a { + border-radius:0px; +} +#sidebar > ul li span { + cursor:pointer; + margin:0px 2px 0 5px; + font-weight:bold; + color:#fff; + font-size:12px; +} +#sidebar > ul li a i { + background-image: url("../img/glyphicons-halflings-white.png"); + margin-top:4px; + vertical-align: top; +} +#sidebar > a { + padding: 9px 20px 9px 15px; + display: block !important; + color: #eeeeee; + float:none !important; + font-size:12px; + font-weight:bold +} +#sidebar > ul > li > a { + padding:5px; + display:block; + color: #AAAAAA; +} +.widget-title .buttons > .btn { + width: 11px; + white-space: nowrap; + overflow: hidden; +} +.form-horizontal .control-label { + padding-left: 30px; +} +.form-horizontal .controls { + margin-left: 0; + padding: 10px 30px; +} +.form-actions { + text-align: center; +} +.panel-right2 { + width: 100%; + background-color: #fff; + border-right: 1px solid #dddddd; + position: relative; + left: 0; + overflow:auto; + top:0px; + height:87%; + width:100%; +} +.panel-left2 { + margin-left:0px; +} +.dataTables_paginate .ui-button, .pagination.alternate li a { + padding:4px 4px!important; +} +.table th { + padding: 5px 4px 2px; +} +} + @media (min-width: 481px) and (max-width: 970px) { +body { + background:#49CCED +} +#header h1 { + top:10px; left:35px; +} +#search { + top:5px +} +#my_menu { + display:none; +} +#my_menu_input { + display:block; +} +#content { + margin-top:0px; +} +#sidebar > ul > li { + float:none; +} +#sidebar > ul > li:hover ul { + display:block; +} +#sidebar, #sidebar > ul { + width: 43px; + display: block; + position: absolute; + height:100%; + z-index:1; +} +#sidebar > ul ul { + display: none; + position: absolute; + left:43px; + top: 0; + min-width: 150px; + list-style: none; +} +#sidebar > ul ul li a { + white-space: nowrap; + padding: 10px 25px; +} +#sidebar > ul ul:before { + border-top: 7px solid transparent; + border-bottom: 7px solid transparent; + content: ""; + display: inline-block; + left: -6px; + position: absolute; + top: 11px; +} +#sidebar > ul ul:after { + content: ""; + display: inline-block; + left: -5px; + position: absolute; + top: 12px; +} +#sidebar > a { + display: none !important; +} +#sidebar > ul > li.open.submenu > a { + border-bottom: none !important; +} +#sidebar > ul > li > a > span { + display: none; +} +#content { + margin-left: 43px; +} +#sidebar .content{ display:none;} +} +@media (max-width: 600px) { +.widget-title .buttons { + float: left; +} +.panel-left { + margin-right: 0; +} +.panel-right { + border-top: 1px solid #DDDDDD; + border-left: none; + position: relative; + top: auto; + right: auto; + height: auto; + width: auto; +} +#sidebar .content{ display:none;} +} +@media (max-width: 767px) { +body { + padding: 0 !important; +} +.container-fluid { + padding-left: 20px; + padding-right: 20px; +} +#search { + display: none; +} +#user-nav > ul > li > a > span.text { + display: none; +} +#sidebar .content{ display:none;} +} +@media (min-width: 768px) and (max-width: 979px) { + [class*="span"], .row-fluid [class*="span"] { + display: block; + float: none; + margin-left: 0; + width: auto; +} +} +@media (max-width: 979px) { +div.dataTables_wrapper .ui-widget-header { + height: 68px; +} +.dataTables_filter{ position:relative; top:0px;} +.dataTables_length{ width:100%; text-align:center;} +.dataTables_filter, .dataTables_paginate { + text-align: center; +} +#sidebar .content{ display:none;} +} + +table { + border-bottom: 1px solid #ddd !important; +} + +.v-select-dt, .v-page-goto { + display: none !important; +} + +.v-select, .v-dropdown, .v-dropdown--small, .v-page-select{ + display: none !important; +} +.dropdown-toggle:hover { + background: #20262d !important; + cursor: default; +} \ No newline at end of file diff --git a/target/disped-web/resources/css/select2.css b/target/disped-web/resources/css/select2.css new file mode 100644 index 0000000000000000000000000000000000000000..19d07059504e03c468092668c7fdb43f1dfae5a9 --- /dev/null +++ b/target/disped-web/resources/css/select2.css @@ -0,0 +1,483 @@ +/* +Version: 3.2 Timestamp: Mon Sep 10 10:38:04 PDT 2012 +*/ +.select2-container { + position: relative; + display: inline-block; + /* inline-block for ie7 */ + zoom: 1; + *display: inline; + vertical-align: top; width:90%; +} +.dataTables_length .select2-container{ width:auto!important;} +.select2-container, +.select2-drop, +.select2-search, +.select2-search input{ + /* + Force border-box so that % widths fit the parent + container without overlap because of margin/padding. + + More Info : http://www.quirksmode.org/css/box.html + */ + -moz-box-sizing: border-box; /* firefox */ + -ms-box-sizing: border-box; /* ie */ + -webkit-box-sizing: border-box; /* webkit */ + -khtml-box-sizing: border-box; /* konqueror */ + box-sizing: border-box; /* css3 */ +} + +.select2-container .select2-choice { + background-color: #fff; + + -moz-background-clip: padding; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #aaa; + display: block; + overflow: hidden; + white-space: nowrap; + position: relative; + height: 26px; + line-height: 26px; + padding: 0 0 0 8px; + color: #444; + text-decoration: none; +} + +.select2-container.select2-drop-above .select2-choice +{ + border-bottom-color: #aaa; + +} + +.select2-container .select2-choice span { + margin-right: 26px; + display: block; + overflow: hidden; + white-space: nowrap; + -o-text-overflow: ellipsis; + -ms-text-overflow: ellipsis; + text-overflow: ellipsis; +} + +.select2-container .select2-choice abbr { + display: block; + position: absolute; + right: 26px; + top: 8px; + width: 12px; + height: 12px; + font-size: 1px; + background: url('../img/select2.png') right top no-repeat; + cursor: pointer; + text-decoration: none; + border:0; + outline: 0; +} +.select2-container .select2-choice abbr:hover { + background-position: right -11px; + cursor: pointer; +} + +.select2-drop { + background: #fff; + color: #000; + border: 1px solid #aaa; + border-top: 0; + position: absolute; + top: 100%; + -webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15); + -moz-box-shadow: 0 4px 5px rgba(0, 0, 0, .15); + -o-box-shadow: 0 4px 5px rgba(0, 0, 0, .15); + box-shadow: 0 4px 5px rgba(0, 0, 0, .15); + z-index: 999999; + width:100%; + margin-top:-1px; + +} + +.select2-drop.select2-drop-above { + + margin-top:1px; + border-top: 1px solid #aaa; + border-bottom: 0; + + -webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15); + -moz-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15); + -o-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15); + box-shadow: 0 -4px 5px rgba(0, 0, 0, .15); +} + +.select2-container .select2-choice div { + + -moz-background-clip: padding; + -webkit-background-clip: padding-box; + background-clip: padding-box; + background: #ccc; + border-left: 1px solid #aaa; + position: absolute; + right: 0; + top: 0; + display: block; + height: 100%; + width: 18px; +} + +.select2-container .select2-choice div b { + background: url('../img/select2.png') no-repeat 0 1px; + display: block; + width: 100%; + height: 100%; +} + +.select2-search { + display: inline-block; + white-space: nowrap; + z-index: 10000; + min-height: 26px; + width: 100%; + margin: 0; + padding-left: 4px; + padding-right: 4px; +} + +.select2-search-hidden { + display: block; + position: absolute; + left: -10000px; +} + +.select2-search input { + background: #fff url('../img/select2.png') no-repeat 100% -22px; + background: url('../img/select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); + background: url('../img/select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); + background: url('../img/select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); + background: url('../img/select2.png') no-repeat 100% -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%); + background: url('../img/select2.png') no-repeat 100% -22px, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%); + background: url('../img/select2.png') no-repeat 100% -22px, linear-gradient(top, #ffffff 85%, #eeeeee 99%); + padding: 4px 20px 4px 5px; + outline: 0; + border: 1px solid #aaa; + font-family: sans-serif; + font-size: 1em; + width:100%; + margin:0; + height:auto !important; + min-height: 26px; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + border-radius: 0; + -moz-border-radius: 0; + -webkit-border-radius: 0; +} + +.select2-drop.select2-drop-above .select2-search input +{ + margin-top:4px; +} + +.select2-search input.select2-active { + background: #fff url('../img/spinner.gif') no-repeat 100%; + background: url('../img/spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); + background: url('../img/spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); + background: url('../img/spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); + background: url('../img/spinner.gif') no-repeat 100%, -o-linear-gradient(bottom, white 85%, #eeeeee 99%); + background: url('../img/spinner.gif') no-repeat 100%, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%); + background: url('../img/spinner.gif') no-repeat 100%, linear-gradient(top, #ffffff 85%, #eeeeee 99%); +} + + +.select2-container-active .select2-choice, +.select2-container-active .select2-choices { + -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3); + -moz-box-shadow : 0 0 5px rgba(0,0,0,.3); + -o-box-shadow : 0 0 5px rgba(0,0,0,.3); + box-shadow : 0 0 5px rgba(0,0,0,.3); + border: 1px solid #5897fb; + outline: none; +} + +.select2-dropdown-open .select2-choice { + border: 1px solid #aaa; + border-bottom-color: transparent; + -webkit-box-shadow: 0 1px 0 #fff inset; + -moz-box-shadow : 0 1px 0 #fff inset; + -o-box-shadow : 0 1px 0 #fff inset; + box-shadow : 0 1px 0 #fff inset; + background-color: #eee; + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, white), color-stop(0.5, #eeeeee)); + background-image: -webkit-linear-gradient(center bottom, white 0%, #eeeeee 50%); + background-image: -moz-linear-gradient(center bottom, white 0%, #eeeeee 50%); + background-image: -o-linear-gradient(bottom, white 0%, #eeeeee 50%); + background-image: -ms-linear-gradient(top, #ffffff 0%,#eeeeee 50%); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 ); + background-image: linear-gradient(top, #ffffff 0%,#eeeeee 50%); + -webkit-border-bottom-left-radius : 0; + -webkit-border-bottom-right-radius: 0; + -moz-border-radius-bottomleft : 0; + -moz-border-radius-bottomright: 0; + border-bottom-left-radius : 0; + border-bottom-right-radius: 0; +} + +.select2-dropdown-open .select2-choice div { + background: transparent; + border-left: none; +} +.select2-dropdown-open .select2-choice div b { + background-position: -18px 1px; +} + +/* results */ +.select2-results { + margin: 4px 4px 4px 0; + padding: 0 0 0 4px; + position: relative; + overflow-x: hidden; + overflow-y: auto; + max-height: 200px; +} + +.select2-results ul.select2-result-sub { + margin: 0 0 0 0; +} + +.select2-results ul.select2-result-sub > li .select2-result-label { padding-left: 20px } +.select2-results ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 40px } +.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 60px } +.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 80px } +.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 100px } +.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 110px } +.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 120px } + +.select2-results li { + list-style: none; + display: list-item; +} + +.select2-results li.select2-result-with-children > .select2-result-label { + font-weight: bold; +} + +.select2-results .select2-result-label { + padding: 3px 7px 4px; + margin: 0; + cursor: pointer; +} + +.select2-results .select2-highlighted { + background: #3875d7; + color: #fff; +} +.select2-results li em { + background: #feffde; + font-style: normal; +} +.select2-results .select2-highlighted em { + background: transparent; +} +.select2-results .select2-no-results, +.select2-results .select2-searching, +.select2-results .select2-selection-limit { + background: #f4f4f4; + display: list-item; +} + +/* +disabled look for already selected choices in the results dropdown +.select2-results .select2-disabled.select2-highlighted { + color: #666; + background: #f4f4f4; + display: list-item; + cursor: default; +} +.select2-results .select2-disabled { + background: #f4f4f4; + display: list-item; + cursor: default; +} +*/ +.select2-results .select2-disabled { + display: none; +} + +.select2-more-results.select2-active { + background: #f4f4f4 url('../img/spinner.gif') no-repeat 100%; +} + +.select2-more-results { + background: #f4f4f4; + display: list-item; +} + +/* disabled styles */ + +.select2-container.select2-container-disabled .select2-choice { + background-color: #f4f4f4; + background-image: none; + border: 1px solid #ddd; + cursor: default; +} + +.select2-container.select2-container-disabled .select2-choice div { + background-color: #f4f4f4; + background-image: none; + border-left: 0; +} + + +/* multiselect */ + +.select2-container-multi .select2-choices { + background-color: #fff; + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff)); + background-image: -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%); + background-image: -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%); + background-image: -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%); + background-image: -ms-linear-gradient(top, #eeeeee 1%, #ffffff 15%); + background-image: linear-gradient(top, #eeeeee 1%, #ffffff 15%); + border: 1px solid #ccc; + margin: 0; + padding: 0; + cursor: text; + overflow: hidden; + height: auto !important; + height: 1%; + position: relative; width:100%; + +} + +.select2-container-multi .select2-choices { + min-height: 26px; +} + +.select2-container-multi.select2-container-active .select2-choices { + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(82, 168, 236, 0.6); + -moz-box-shadow : 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(82, 168, 236, 0.6); + -o-box-shadow : 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(82, 168, 236, 0.6); + box-shadow : 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(82, 168, 236, 0.6); + border: 1px solid #5897fb; + outline: none; +} +.select2-container-multi .select2-choices li { + float: left; + list-style: none; +} +.select2-container-multi .select2-choices .select2-search-field { + white-space: nowrap; + margin: 0; + padding: 0; +} + +.select2-container-multi .select2-choices .select2-search-field input { + color: #666; + background: transparent !important; + font-family: sans-serif; + font-size: 100%; + height: 15px; + padding: 5px; + margin: 1px 0; + outline: 0; + border: 0; + -webkit-box-shadow: none; + -moz-box-shadow : none; + -o-box-shadow : none; + box-shadow : none; +} + +.select2-container-multi .select2-choices .select2-search-field input.select2-active { + background: #fff url('../img/spinner.gif') no-repeat 100% !important; +} + +.select2-default { + color: #999 !important; +} + +.select2-container-multi .select2-choices .select2-search-choice { + -moz-background-clip : padding; + -webkit-background-clip: padding-box; + background-clip : padding-box; + background:#f9eae1; + -webkit-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05); + -moz-box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05); + box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05); + color: #333; + border: 1px solid #F77825; + line-height: 13px; + padding: 3px 5px 3px 18px; + margin: 3px 0 3px 5px; + position: relative; + cursor: default; +} +.select2-container-multi .select2-choices .select2-search-choice span { + cursor: default; +} +.select2-container-multi .select2-choices .select2-search-choice-focus { + background: #d4d4d4; +} + +.select2-search-choice-close { + display: block; + position: absolute; + right: 3px; + top: 4px; + width: 12px; + height: 13px; + font-size: 1px; + background: url('../img/select2.png') right top no-repeat; + outline: none; +} + +.select2-container-multi .select2-search-choice-close { + left: 3px; +} + + +.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover { + background-position: right -11px; +} +.select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close { + background-position: right -11px; +} + +/* disabled styles */ + +.select2-container-multi.select2-container-disabled .select2-choices{ + background-color: #f4f4f4; + background-image: none; + border: 1px solid #ddd; + cursor: default; +} + +.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice { + background-image: none; + background-color: #f4f4f4; + border: 1px solid #ddd; + padding: 3px 5px 3px 5px; +} + +.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close { + display: none; +} +/* end multiselect */ + +.select2-result-selectable .select2-match, +.select2-result-unselectable .select2-result-selectable .select2-match { text-decoration: underline; } +.select2-result-unselectable .select2-match { text-decoration: none; } + +.select2-offscreen { position: absolute; left: -10000px; } + +/* Retina-ize icons */ + +@media only screen and (-webkit-min-device-pixel-ratio: 1.5) { + .select2-search input, .select2-search-choice-close, .select2-container .select2-choice abbr, .select2-container .select2-choice div b { + background-image: url(../img/select2x2.png) !important; + background-repeat: no-repeat !important; + background-size: 60px 40px !important; + } + .select2-search input { + background-position: 100% -21px !important; + } +} diff --git a/target/disped-web/resources/css/uniform.css b/target/disped-web/resources/css/uniform.css new file mode 100644 index 0000000000000000000000000000000000000000..c226e0cd5bc039e2232b3dab549302857395e200 --- /dev/null +++ b/target/disped-web/resources/css/uniform.css @@ -0,0 +1,587 @@ +/* + +Uniform Theme: Uniform Default +Version: 1.6 +By: Josh Pyles +License: MIT License +--- +For use with the Uniform plugin: +http://pixelmatrixdesign.com/uniform/ +--- +Generated by Uniform Theme Generator: +http://pixelmatrixdesign.com/uniform/themer.html + +*/ + +/* Global Declaration */ + +div.selector, +div.selector span, +div.checker span, +div.radio span, +div.uploader, +div.uploader span.action, +div.button, +div.button span { + background-image: url(../img/sprite.png); + background-repeat: no-repeat; + -webkit-font-smoothing: antialiased; +} + +.selector, +.radio, +.checker, +.uploader, +.button, +.selector *, +.radio *, +.checker *, +.uploader *, +.button *{ + margin: 0; + padding: 0; +} + +/* INPUT & TEXTAREA */ + + + +input.text:focus, +input.email:focus, +input.password:focus, +textarea.uniform:focus { +} + +/* SPRITES */ + +/* Select */ + +div.selector { + background-position: -483px -130px; + line-height: 26px; + height: 26px; +} + +div.selector span { + background-position: right 0px; + height: 26px; + line-height: 26px; +} + +div.selector select { + /* change these to adjust positioning of select element */ + top: 0px; + left: 0px; +} + +div.selector:active, +div.selector.active { + background-position: -483px -156px; +} + +div.selector:active span, +div.selector.active span { + background-position: right -26px; +} + +div.selector.focus, div.selector.hover, div.selector:hover { + background-position: -483px -182px; +} + +div.selector.focus span, div.selector.hover span, div.selector:hover span { + background-position: right -52px; +} + +div.selector.focus:active, +div.selector.focus.active, +div.selector:hover:active, +div.selector.active:hover { + background-position: -483px -208px; +} + +div.selector.focus:active span, +div.selector:hover:active span, +div.selector.active:hover span, +div.selector.focus.active span { + background-position: right -78px; +} + +div.selector.disabled { + background-position: -483px -234px; +} + +div.selector.disabled span { + background-position: right -104px; +} + +/* Checkbox */ + +div.checker { + width: 19px; + height: 19px; +} + +div.checker input { + width: 19px; + height: 19px; +} + +div.checker span { + background-position: 0px -260px; + height: 19px; + width: 19px; +} + +div.checker:active span, +div.checker.active span { + background-position: -19px -260px; +} + +div.checker.focus span, +div.checker:hover span { + background-position: -38px -260px; +} + +div.checker.focus:active span, +div.checker:active:hover span, +div.checker.active:hover span, +div.checker.focus.active span { + background-position: -57px -260px; +} + +div.checker span.checked { + background-position: -76px -260px; +} + +div.checker:active span.checked, +div.checker.active span.checked { + background-position: -95px -260px; +} + +div.checker.focus span.checked, +div.checker:hover span.checked { + background-position: -114px -260px; +} + +div.checker.focus:active span.checked, +div.checker:hover:active span.checked, +div.checker.active:hover span.checked, +div.checker.active.focus span.checked { + background-position: -133px -260px; +} + +div.checker.disabled span, +div.checker.disabled:active span, +div.checker.disabled.active span { + background-position: -152px -260px; +} + +div.checker.disabled span.checked, +div.checker.disabled:active span.checked, +div.checker.disabled.active span.checked { + background-position: -171px -260px; +} + +/* Radio */ + +div.radio { + width: 18px; + height: 18px; +} + +div.radio input { + width: 18px; + height: 18px; +} + +div.radio span { + height: 18px; + width: 18px; + background-position: 0px -279px; +} + +div.radio:active span, +div.radio.active span { + background-position: -18px -279px; +} + +div.radio.focus span, +div.radio:hover span { + background-position: -36px -279px; +} + +div.radio.focus:active span, +div.radio:active:hover span, +div.radio.active:hover span, +div.radio.active.focus span { + background-position: -54px -279px; +} + +div.radio span.checked { + background-position: -72px -279px; +} + +div.radio:active span.checked, +div.radio.active span.checked { + background-position: -90px -279px; +} + +div.radio.focus span.checked, div.radio:hover span.checked { + background-position: -108px -279px; +} + +div.radio.focus:active span.checked, +div.radio:hover:active span.checked, +div.radio.focus.active span.checked, +div.radio.active:hover span.checked { + background-position: -126px -279px; +} + +div.radio.disabled span, +div.radio.disabled:active span, +div.radio.disabled.active span { + background-position: -144px -279px; +} + +div.radio.disabled span.checked, +div.radio.disabled:active span.checked, +div.radio.disabled.active span.checked { + background-position: -162px -279px; +} + +/* Uploader */ + +div.uploader { + background-position: 0px -297px; + height: 28px; +} + +div.uploader span.action { + background-position: right -409px; + height: 24px; + line-height: 24px; +} + +div.uploader span.filename { + height: 24px; + /* change this line to adjust positioning of filename area */ + margin: 2px 0px 2px 2px; + line-height: 24px; +} + +div.uploader.focus, +div.uploader.hover, +div.uploader:hover { + background-position: 0px -353px; +} + +div.uploader.focus span.action, +div.uploader.hover span.action, +div.uploader:hover span.action { + background-position: right -437px; +} + +div.uploader.active span.action, +div.uploader:active span.action { + background-position: right -465px; +} + +div.uploader.focus.active span.action, +div.uploader:focus.active span.action, +div.uploader.focus:active span.action, +div.uploader:focus:active span.action { + background-position: right -493px; +} + +div.uploader.disabled { + background-position: 0px -325px; +} + +div.uploader.disabled span.action { + background-position: right -381px; +} + +div.button { + background-position: 0px -523px; +} + +div.button span { + background-position: right -643px; +} + +div.button.focus, +div.button:focus, +div.button:hover, +div.button.hover { + background-position: 0px -553px; +} + +div.button.focus span, +div.button:focus span, +div.button:hover span, +div.button.hover span { + background-position: right -673px; +} + +div.button.active, +div.button:active { + background-position: 0px -583px; +} + +div.button.active span, +div.button:active span { + background-position: right -703px; + color: #555; +} + +div.button.disabled, +div.button:disabled { + background-position: 0px -613px; +} + +div.button.disabled span, +div.button:disabled span { + background-position: right -733px; + color: #bbb; + cursor: default; +} + +/* PRESENTATION */ + +/* Button */ + +div.button { + height: 30px; +} + +div.button span { + margin-left: 13px; + height: 22px; + padding-top: 8px; + font-weight: bold; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 12px; + letter-spacing: 1px; + text-transform: uppercase; + padding-left: 2px; + padding-right: 15px; +} + +/* Select */ +div.selector { + width: 190px; + font-size: 12px; +} + +div.selector select { + min-width: 190px; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 12px; + border: solid 1px #fff; +} + +div.selector span { + padding: 0px 25px 0px 2px; + cursor: pointer; +} + +div.selector span { + color: #666; + width: 158px; + text-shadow: 0 1px 0 #fff; +} + +div.selector.disabled span { + color: #bbb; +} + +/* Checker */ +div.checker { + margin-right: 5px; +} + +/* Radio */ +div.radio { + margin-right: 3px; +} + +/* Uploader */ +div.uploader { + width: 190px; + cursor: pointer; +} + +div.uploader span.action { + width: 85px; + text-align: center; + text-shadow: #fff 0px 1px 0px; + background-color: #fff; + font-size: 11px; + font-weight: bold; +} + +div.uploader span.filename { + color: #777; + width: 82px; + border-right: solid 1px #bbb; + font-size: 11px; +} + +div.uploader input { + width: 190px; +} + +div.uploader.disabled span.action { + color: #aaa; +} + +div.uploader.disabled span.filename { + border-color: #ddd; + color: #aaa; +} +/* + +CORE FUNCTIONALITY + +Not advised to edit stuff below this line +----------------------------------------------------- +*/ + +.selector, +.checker, +.button, +.radio, +.uploader { + display: -moz-inline-box; + display: inline-block; + vertical-align: middle; + zoom: 1; + *display: inline; +} + +.selector select:focus, .radio input:focus, .checker input:focus, .uploader input:focus { + outline: 0; +} + +/* Button */ + +div.button a, +div.button button, +div.button input { + position: absolute; +} + +div.button { + cursor: pointer; + position: relative; +} + +div.button span { + display: -moz-inline-box; + display: inline-block; + line-height: 1; + text-align: center; +} + +/* Select */ + +div.selector { + position: relative; + padding-left: 10px; + overflow: hidden; +} + +div.selector span { + display: block; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +div.selector select { + position: absolute; + opacity: 0; + filter: alpha(opacity:0); + height: 25px; + border: none; + background: none; +} + +/* Checker */ + +div.checker { + position: relative; +} + +div.checker span { + display: -moz-inline-box; + display: inline-block; + text-align: center; +} + +div.checker input { + opacity: 0; + filter: alpha(opacity:0); + display: inline-block; + background: none; +} + +/* Radio */ + +div.radio { + position: relative; +} + +div.radio span { + display: -moz-inline-box; + display: inline-block; + text-align: center; +} + +div.radio input { + opacity: 0; + filter: alpha(opacity:0); + text-align: center; + display: inline-block; + background: none; +} + +/* Uploader */ + +div.uploader { + position: relative; + overflow: hidden; + cursor: default; +} + +div.uploader span.action { + float: left; + display: inline; + padding: 2px 0px; + overflow: hidden; + cursor: pointer; +} + +div.uploader span.filename { + padding: 0px 10px; + float: left; + display: block; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + cursor: default; + position:relative; +} + +div.uploader input { + opacity: 0; + filter: alpha(opacity:0); + position: absolute; + top: 0; + right: 0; + bottom: 0; + float: right; + height: 25px; + border: none; + cursor: default; +} diff --git a/target/disped-web/resources/font-awesome/css/Descr.WD3 b/target/disped-web/resources/font-awesome/css/Descr.WD3 new file mode 100644 index 0000000000000000000000000000000000000000..331540eef186dc56f5fdbb493f35fe60b48685d8 Binary files /dev/null and b/target/disped-web/resources/font-awesome/css/Descr.WD3 differ diff --git a/target/disped-web/resources/font-awesome/css/font-awesome.css b/target/disped-web/resources/font-awesome/css/font-awesome.css new file mode 100644 index 0000000000000000000000000000000000000000..496984924d3b614f17c419db316a0789c3d0a2d5 --- /dev/null +++ b/target/disped-web/resources/font-awesome/css/font-awesome.css @@ -0,0 +1,469 @@ +/* Font Awesome 3.0 + the iconic font designed for use with Twitter Bootstrap + ------------------------------------------------------- + The full suite of pictographic icons, examples, and documentation + can be found at: http://fortawesome.github.com/Font-Awesome/ + + License + ------------------------------------------------------- + • The Font Awesome font is licensed under the SIL Open Font License - http://scripts.sil.org/OFL + • Font Awesome CSS, LESS, and SASS files are licensed under the MIT License - + http://opensource.org/licenses/mit-license.html + • The Font Awesome pictograms are licensed under the CC BY 3.0 License - http://creativecommons.org/licenses/by/3.0/ + • Attribution is no longer required in Font Awesome 3.0, but much appreciated: + "Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome" + + Contact + ------------------------------------------------------- + Email: dave@davegandy.com + Twitter: http://twitter.com/fortaweso_me + Work: Lead Product Designer @ http://kyruus.com + + */ +@font-face { + font-family: 'FontAwesome'; + src: url('../font/fontawesome-webfont.eot'); + src: url('../font/fontawesome-webfont.eot@#iefix') format('embedded-opentype'), + url('../font/fontawesome-webfont.woff') format('woff'), + url('../font/fontawesome-webfont.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} +/* Font Awesome styles + ------------------------------------------------------- */ +/* includes sprites.less reset */ +[class^="icon-"], +[class*=" icon-"] { + font-family: FontAwesome; + font-weight: normal; + font-style: normal; + text-decoration: inherit; + display: inline; + width: auto; + height: auto; + line-height: normal; + vertical-align: baseline; + background-image: none !important; + background-position: 0% 0%; + background-repeat: repeat; +} +[class^="icon-"]:before, +[class*=" icon-"]:before { + text-decoration: inherit; + display: inline-block; + speak: none; +} +/* makes sure icons active on rollover in links */ +a [class^="icon-"], +a [class*=" icon-"] { + display: inline-block; +} +/* makes the font 33% larger relative to the icon container */ +.icon-large:before { + vertical-align: -10%; + font-size: 1.3333333333333333em; +} +.btn [class^="icon-"], +.nav [class^="icon-"], +.btn [class*=" icon-"], +.nav [class*=" icon-"] { + display: inline; + /* keeps button heights with and without icons the same */ + + line-height: .6em; +} +.btn [class^="icon-"].icon-spin, +.nav [class^="icon-"].icon-spin, +.btn [class*=" icon-"].icon-spin, +.nav [class*=" icon-"].icon-spin { + display: inline-block; +} +li [class^="icon-"], +li [class*=" icon-"] { + display: inline-block; + width: 1.25em; + text-align: center; +} +li [class^="icon-"].icon-large, +li [class*=" icon-"].icon-large { + /* increased font size for icon-large */ + + width: 1.5625em; +} +ul.icons { + list-style-type: none; + text-indent: -0.75em; +} +ul.icons li [class^="icon-"], +ul.icons li [class*=" icon-"] { + width: .75em; +} +.icon-muted { + color: #eeeeee; +} +.icon-border { + border: solid 1px #eeeeee; + padding: .2em .25em .15em; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.icon-2x { + font-size: 2em; +} +.icon-2x.icon-border { + border-width: 2px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.icon-3x { + font-size: 3em; +} +.icon-3x.icon-border { + border-width: 3px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; +} +.icon-4x { + font-size: 4em; +} +.icon-4x.icon-border { + border-width: 4px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; +} +.pull-right { + float: right; +} +.pull-left { + float: left; +} +[class^="icon-"].pull-left, +[class*=" icon-"].pull-left { + margin-right: .35em; +} +[class^="icon-"].pull-right, +[class*=" icon-"].pull-right { + margin-left: .35em; +} +.btn [class^="icon-"].pull-left.icon-2x, +.btn [class*=" icon-"].pull-left.icon-2x, +.btn [class^="icon-"].pull-right.icon-2x, +.btn [class*=" icon-"].pull-right.icon-2x { + margin-top: .35em; +} +.btn [class^="icon-"].icon-spin.icon-large, +.btn [class*=" icon-"].icon-spin.icon-large { + height: .75em; +} +.btn.btn-small [class^="icon-"].pull-left.icon-2x, +.btn.btn-small [class*=" icon-"].pull-left.icon-2x, +.btn.btn-small [class^="icon-"].pull-right.icon-2x, +.btn.btn-small [class*=" icon-"].pull-right.icon-2x { + margin-top: .45em; +} +.btn.btn-large [class^="icon-"].pull-left.icon-2x, +.btn.btn-large [class*=" icon-"].pull-left.icon-2x, +.btn.btn-large [class^="icon-"].pull-right.icon-2x, +.btn.btn-large [class*=" icon-"].pull-right.icon-2x { + margin-top: .2em; +} +.icon-spin { + display: inline-block; + -moz-animation: spin 2s infinite linear; + -o-animation: spin 2s infinite linear; + -webkit-animation: spin 2s infinite linear; + animation: spin 2s infinite linear; +} +@-moz-keyframes spin { + 0% { -moz-transform: rotate(0deg); } + 100% { -moz-transform: rotate(359deg); } +} +@-webkit-keyframes spin { + 0% { -webkit-transform: rotate(0deg); } + 100% { -webkit-transform: rotate(359deg); } +} +@-o-keyframes spin { + 0% { -o-transform: rotate(0deg); } + 100% { -o-transform: rotate(359deg); } +} +@-ms-keyframes spin { + 0% { -ms-transform: rotate(0deg); } + 100% { -ms-transform: rotate(359deg); } +} +@keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(359deg); } +} +/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen + readers do not read off random characters that represent icons */ +.icon-glass:before { content: "\f000"; } +.icon-music:before { content: "\f001"; } +.icon-search:before { content: "\f002"; } +.icon-envelope:before { content: "\f003"; } +.icon-heart:before { content: "\f004"; } +.icon-star:before { content: "\f005"; } +.icon-star-empty:before { content: "\f006"; } +.icon-user:before { content: "\f007"; } +.icon-film:before { content: "\f008"; } +.icon-th-large:before { content: "\f009"; } +.icon-th:before { content: "\f00a"; } +.icon-th-list:before { content: "\f00b"; } +.icon-ok:before { content: "\f00c"; } +.icon-remove:before { content: "\f00d"; } +.icon-zoom-in:before { content: "\f00e"; } + +.icon-zoom-out:before { content: "\f010"; } +.icon-off:before { content: "\f011"; } +.icon-signal:before { content: "\f012"; } +.icon-cog:before { content: "\f013"; } +.icon-trash:before { content: "\f014"; } +.icon-home:before { content: "\f015"; } +.icon-file:before { content: "\f016"; } +.icon-time:before { content: "\f017"; } +.icon-road:before { content: "\f018"; } +.icon-download-alt:before { content: "\f019"; } +.icon-download:before { content: "\f01a"; } +.icon-upload:before { content: "\f01b"; } +.icon-inbox:before { content: "\f01c"; } +.icon-play-circle:before { content: "\f01d"; } +.icon-repeat:before { content: "\f01e"; } + +/* \f020 doesn't work in Safari. all shifted one down */ +.icon-refresh:before { content: "\f021"; } +.icon-list-alt:before { content: "\f022"; } +.icon-lock:before { content: "\f023"; } +.icon-flag:before { content: "\f024"; } +.icon-headphones:before { content: "\f025"; } +.icon-volume-off:before { content: "\f026"; } +.icon-volume-down:before { content: "\f027"; } +.icon-volume-up:before { content: "\f028"; } +.icon-qrcode:before { content: "\f029"; } +.icon-barcode:before { content: "\f02a"; } +.icon-tag:before { content: "\f02b"; } +.icon-tags:before { content: "\f02c"; } +.icon-book:before { content: "\f02d"; } +.icon-bookmark:before { content: "\f02e"; } +.icon-print:before { content: "\f02f"; } + +.icon-camera:before { content: "\f030"; } +.icon-font:before { content: "\f031"; } +.icon-bold:before { content: "\f032"; } +.icon-italic:before { content: "\f033"; } +.icon-text-height:before { content: "\f034"; } +.icon-text-width:before { content: "\f035"; } +.icon-align-left:before { content: "\f036"; } +.icon-align-center:before { content: "\f037"; } +.icon-align-right:before { content: "\f038"; } +.icon-align-justify:before { content: "\f039"; } +.icon-list:before { content: "\f03a"; } +.icon-indent-left:before { content: "\f03b"; } +.icon-indent-right:before { content: "\f03c"; } +.icon-facetime-video:before { content: "\f03d"; } +.icon-picture:before { content: "\f03e"; } + +.icon-pencil:before { content: "\f040"; } +.icon-map-marker:before { content: "\f041"; } +.icon-adjust:before { content: "\f042"; } +.icon-tint:before { content: "\f043"; } +.icon-edit:before { content: "\f044"; } +.icon-share:before { content: "\f045"; } +.icon-check:before { content: "\f046"; } +.icon-move:before { content: "\f047"; } +.icon-step-backward:before { content: "\f048"; } +.icon-fast-backward:before { content: "\f049"; } +.icon-backward:before { content: "\f04a"; } +.icon-play:before { content: "\f04b"; } +.icon-pause:before { content: "\f04c"; } +.icon-stop:before { content: "\f04d"; } +.icon-forward:before { content: "\f04e"; } + +.icon-fast-forward:before { content: "\f050"; } +.icon-step-forward:before { content: "\f051"; } +.icon-eject:before { content: "\f052"; } +.icon-chevron-left:before { content: "\f053"; } +.icon-chevron-right:before { content: "\f054"; } +.icon-plus-sign:before { content: "\f055"; } +.icon-minus-sign:before { content: "\f056"; } +.icon-remove-sign:before { content: "\f057"; } +.icon-ok-sign:before { content: "\f058"; } +.icon-question-sign:before { content: "\f059"; } +.icon-info-sign:before { content: "\f05a"; } +.icon-screenshot:before { content: "\f05b"; } +.icon-remove-circle:before { content: "\f05c"; } +.icon-ok-circle:before { content: "\f05d"; } +.icon-ban-circle:before { content: "\f05e"; } + +.icon-arrow-left:before { content: "\f060"; } +.icon-arrow-right:before { content: "\f061"; } +.icon-arrow-up:before { content: "\f062"; } +.icon-arrow-down:before { content: "\f063"; } +.icon-share-alt:before { content: "\f064"; } +.icon-resize-full:before { content: "\f065"; } +.icon-resize-small:before { content: "\f066"; } +.icon-plus:before { content: "\f067"; } +.icon-minus:before { content: "\f068"; } +.icon-asterisk:before { content: "\f069"; } +.icon-exclamation-sign:before { content: "\f06a"; } +.icon-gift:before { content: "\f06b"; } +.icon-leaf:before { content: "\f06c"; } +.icon-fire:before { content: "\f06d"; } +.icon-eye-open:before { content: "\f06e"; } + +.icon-eye-close:before { content: "\f070"; } +.icon-warning-sign:before { content: "\f071"; } +.icon-plane:before { content: "\f072"; } +.icon-calendar:before { content: "\f073"; } +.icon-random:before { content: "\f074"; } +.icon-comment:before { content: "\f075"; } +.icon-magnet:before { content: "\f076"; } +.icon-chevron-up:before { content: "\f077"; } +.icon-chevron-down:before { content: "\f078"; } +.icon-retweet:before { content: "\f079"; } +.icon-shopping-cart:before { content: "\f07a"; } +.icon-folder-close:before { content: "\f07b"; } +.icon-folder-open:before { content: "\f07c"; } +.icon-resize-vertical:before { content: "\f07d"; } +.icon-resize-horizontal:before { content: "\f07e"; } + +.icon-bar-chart:before { content: "\f080"; } +.icon-twitter-sign:before { content: "\f081"; } +.icon-facebook-sign:before { content: "\f082"; } +.icon-camera-retro:before { content: "\f083"; } +.icon-key:before { content: "\f084"; } +.icon-cogs:before { content: "\f085"; } +.icon-comments:before { content: "\f086"; } +.icon-thumbs-up:before { content: "\f087"; } +.icon-thumbs-down:before { content: "\f088"; } +.icon-star-half:before { content: "\f089"; } +.icon-heart-empty:before { content: "\f08a"; } +.icon-signout:before { content: "\f08b"; } +.icon-linkedin-sign:before { content: "\f08c"; } +.icon-pushpin:before { content: "\f08d"; } +.icon-external-link:before { content: "\f08e"; } + +.icon-signin:before { content: "\f090"; } +.icon-trophy:before { content: "\f091"; } +.icon-github-sign:before { content: "\f092"; } +.icon-upload-alt:before { content: "\f093"; } +.icon-lemon:before { content: "\f094"; } +.icon-phone:before { content: "\f095"; } +.icon-check-empty:before { content: "\f096"; } +.icon-bookmark-empty:before { content: "\f097"; } +.icon-phone-sign:before { content: "\f098"; } +.icon-twitter:before { content: "\f099"; } +.icon-facebook:before { content: "\f09a"; } +.icon-github:before { content: "\f09b"; } +.icon-unlock:before { content: "\f09c"; } +.icon-credit-card:before { content: "\f09d"; } +.icon-rss:before { content: "\f09e"; } + +.icon-hdd:before { content: "\f0a0"; } +.icon-bullhorn:before { content: "\f0a1"; } +.icon-bell:before { content: "\f0a2"; } +.icon-certificate:before { content: "\f0a3"; } +.icon-hand-right:before { content: "\f0a4"; } +.icon-hand-left:before { content: "\f0a5"; } +.icon-hand-up:before { content: "\f0a6"; } +.icon-hand-down:before { content: "\f0a7"; } +.icon-circle-arrow-left:before { content: "\f0a8"; } +.icon-circle-arrow-right:before { content: "\f0a9"; } +.icon-circle-arrow-up:before { content: "\f0aa"; } +.icon-circle-arrow-down:before { content: "\f0ab"; } +.icon-globe:before { content: "\f0ac"; } +.icon-wrench:before { content: "\f0ad"; } +.icon-tasks:before { content: "\f0ae"; } + +.icon-filter:before { content: "\f0b0"; } +.icon-briefcase:before { content: "\f0b1"; } +.icon-fullscreen:before { content: "\f0b2"; } + +.icon-group:before { content: "\f0c0"; } +.icon-link:before { content: "\f0c1"; } +.icon-cloud:before { content: "\f0c2"; } +.icon-beaker:before { content: "\f0c3"; } +.icon-cut:before { content: "\f0c4"; } +.icon-copy:before { content: "\f0c5"; } +.icon-paper-clip:before { content: "\f0c6"; } +.icon-save:before { content: "\f0c7"; } +.icon-sign-blank:before { content: "\f0c8"; } +.icon-reorder:before { content: "\f0c9"; } +.icon-list-ul:before { content: "\f0ca"; } +.icon-list-ol:before { content: "\f0cb"; } +.icon-strikethrough:before { content: "\f0cc"; } +.icon-underline:before { content: "\f0cd"; } +.icon-table:before { content: "\f0ce"; } + +.icon-magic:before { content: "\f0d0"; } +.icon-truck:before { content: "\f0d1"; } +.icon-pinterest:before { content: "\f0d2"; } +.icon-pinterest-sign:before { content: "\f0d3"; } +.icon-google-plus-sign:before { content: "\f0d4"; } +.icon-google-plus:before { content: "\f0d5"; } +.icon-money:before { content: "\f0d6"; } +.icon-caret-down:before { content: "\f0d7"; } +.icon-caret-up:before { content: "\f0d8"; } +.icon-caret-left:before { content: "\f0d9"; } +.icon-caret-right:before { content: "\f0da"; } +.icon-columns:before { content: "\f0db"; } +.icon-sort:before { content: "\f0dc"; } +.icon-sort-down:before { content: "\f0dd"; } +.icon-sort-up:before { content: "\f0de"; } + +.icon-envelope-alt:before { content: "\f0e0"; } +.icon-linkedin:before { content: "\f0e1"; } +.icon-undo:before { content: "\f0e2"; } +.icon-legal:before { content: "\f0e3"; } +.icon-dashboard:before { content: "\f0e4"; } +.icon-comment-alt:before { content: "\f0e5"; } +.icon-comments-alt:before { content: "\f0e6"; } +.icon-bolt:before { content: "\f0e7"; } +.icon-sitemap:before { content: "\f0e8"; } +.icon-umbrella:before { content: "\f0e9"; } +.icon-paste:before { content: "\f0ea"; } +.icon-lightbulb:before { content: "\f0eb"; } +.icon-exchange:before { content: "\f0ec"; } +.icon-cloud-download:before { content: "\f0ed"; } +.icon-cloud-upload:before { content: "\f0ee"; } + +.icon-user-md:before { content: "\f0f0"; } +.icon-stethoscope:before { content: "\f0f1"; } +.icon-suitcase:before { content: "\f0f2"; } +.icon-bell-alt:before { content: "\f0f3"; } +.icon-coffee:before { content: "\f0f4"; } +.icon-food:before { content: "\f0f5"; } +.icon-file-alt:before { content: "\f0f6"; } +.icon-building:before { content: "\f0f7"; } +.icon-hospital:before { content: "\f0f8"; } +.icon-ambulance:before { content: "\f0f9"; } +.icon-medkit:before { content: "\f0fa"; } +.icon-fighter-jet:before { content: "\f0fb"; } +.icon-beer:before { content: "\f0fc"; } +.icon-h-sign:before { content: "\f0fd"; } +.icon-plus-sign-alt:before { content: "\f0fe"; } + +.icon-double-angle-left:before { content: "\f100"; } +.icon-double-angle-right:before { content: "\f101"; } +.icon-double-angle-up:before { content: "\f102"; } +.icon-double-angle-down:before { content: "\f103"; } +.icon-angle-left:before { content: "\f104"; } +.icon-angle-right:before { content: "\f105"; } +.icon-angle-up:before { content: "\f106"; } +.icon-angle-down:before { content: "\f107"; } +.icon-desktop:before { content: "\f108"; } +.icon-laptop:before { content: "\f109"; } +.icon-tablet:before { content: "\f10a"; } +.icon-mobile-phone:before { content: "\f10b"; } +.icon-circle-blank:before { content: "\f10c"; } +.icon-quote-left:before { content: "\f10d"; } +.icon-quote-right:before { content: "\f10e"; } + +.icon-spinner:before { content: "\f110"; } +.icon-circle:before { content: "\f111"; } +.icon-reply:before { content: "\f112"; } +.icon-github-alt:before { content: "\f113"; } +.icon-folder-close-alt:before { content: "\f114"; } +.icon-folder-open-alt:before { content: "\f115"; } diff --git a/target/disped-web/resources/font-awesome/font/Descr.WD3 b/target/disped-web/resources/font-awesome/font/Descr.WD3 new file mode 100644 index 0000000000000000000000000000000000000000..6808d4811caf6a50a080f32e709c3fa0e54af0ef Binary files /dev/null and b/target/disped-web/resources/font-awesome/font/Descr.WD3 differ diff --git a/target/disped-web/resources/font-awesome/font/fontawesome-webfont.eot b/target/disped-web/resources/font-awesome/font/fontawesome-webfont.eot new file mode 100644 index 0000000000000000000000000000000000000000..7d81019e4f174caaf5ccd785fc361f6bff196b53 Binary files /dev/null and b/target/disped-web/resources/font-awesome/font/fontawesome-webfont.eot differ diff --git a/target/disped-web/resources/font-awesome/font/fontawesome-webfont.eot@ b/target/disped-web/resources/font-awesome/font/fontawesome-webfont.eot@ new file mode 100644 index 0000000000000000000000000000000000000000..7d81019e4f174caaf5ccd785fc361f6bff196b53 Binary files /dev/null and b/target/disped-web/resources/font-awesome/font/fontawesome-webfont.eot@ differ diff --git a/target/disped-web/resources/font-awesome/font/fontawesome-webfont.ttf b/target/disped-web/resources/font-awesome/font/fontawesome-webfont.ttf new file mode 100644 index 0000000000000000000000000000000000000000..d46172476a3c7caf4f44946e3c40218559f3edfa Binary files /dev/null and b/target/disped-web/resources/font-awesome/font/fontawesome-webfont.ttf differ diff --git a/target/disped-web/resources/font-awesome/font/fontawesome-webfont.woff b/target/disped-web/resources/font-awesome/font/fontawesome-webfont.woff new file mode 100644 index 0000000000000000000000000000000000000000..3c89ae09b88b38d3bc8563ca69f7f401b7301f45 Binary files /dev/null and b/target/disped-web/resources/font-awesome/font/fontawesome-webfont.woff differ diff --git a/target/disped-web/resources/font/fontello.eot b/target/disped-web/resources/font/fontello.eot new file mode 100644 index 0000000000000000000000000000000000000000..d00285750745c9a2677a93153b7d8032f5b02789 Binary files /dev/null and b/target/disped-web/resources/font/fontello.eot differ diff --git a/target/disped-web/resources/font/fontello.svg b/target/disped-web/resources/font/fontello.svg new file mode 100644 index 0000000000000000000000000000000000000000..db06416b0036d6cc1d97c3bacf6011ca8c206fcd --- /dev/null +++ b/target/disped-web/resources/font/fontello.svg @@ -0,0 +1,64 @@ + + + +Copyright (C) 2018 by original authors @ fontello.com + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/disped-web/resources/font/fontello.ttf b/target/disped-web/resources/font/fontello.ttf new file mode 100644 index 0000000000000000000000000000000000000000..3676c9900515e2859848be1e61bf78c5d96069fe Binary files /dev/null and b/target/disped-web/resources/font/fontello.ttf differ diff --git a/target/disped-web/resources/font/fontello.woff b/target/disped-web/resources/font/fontello.woff new file mode 100644 index 0000000000000000000000000000000000000000..05a3ae4378c1e47eaf1bfe0d438c5338161a650c Binary files /dev/null and b/target/disped-web/resources/font/fontello.woff differ diff --git a/target/disped-web/resources/font/fontello.woff2 b/target/disped-web/resources/font/fontello.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..9eeed0d4f0f678ab6afe13b896e1a222a7450c4f Binary files /dev/null and b/target/disped-web/resources/font/fontello.woff2 differ diff --git a/target/disped-web/resources/images/backgrounds/Descr.WD3 b/target/disped-web/resources/images/backgrounds/Descr.WD3 new file mode 100644 index 0000000000000000000000000000000000000000..072db7a9de7de6e10e0485b4e3ffb62ef83571c7 Binary files /dev/null and b/target/disped-web/resources/images/backgrounds/Descr.WD3 differ diff --git a/target/disped-web/resources/images/backgrounds/blank2 b/target/disped-web/resources/images/backgrounds/blank2 new file mode 100644 index 0000000000000000000000000000000000000000..398700e09c4ec3745bd38b7d5e8d77b9a6facbb5 Binary files /dev/null and b/target/disped-web/resources/images/backgrounds/blank2 differ diff --git a/target/disped-web/resources/images/backgrounds/calActiveBg.html b/target/disped-web/resources/images/backgrounds/calActiveBg.html new file mode 100644 index 0000000000000000000000000000000000000000..1730507810d929691a01b948f2483f2c1b6a61d7 --- /dev/null +++ b/target/disped-web/resources/images/backgrounds/calActiveBg.html @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + Page not found - Theme Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +
      + + +
      +
      + + +
      +
      + +

      404 Not Found

      +

      Apologies, but the page you requested could not be found. Perhaps searching will help.

      +
      +

      +

      +
      + + +
      +
      + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/disped-web/resources/images/backgrounds/skype_3Asuniljoshi19@call b/target/disped-web/resources/images/backgrounds/skype_3Asuniljoshi19@call new file mode 100644 index 0000000000000000000000000000000000000000..1730507810d929691a01b948f2483f2c1b6a61d7 --- /dev/null +++ b/target/disped-web/resources/images/backgrounds/skype_3Asuniljoshi19@call @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + Page not found - Theme Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +
      + + +
      +
      + + +
      +
      + +

      404 Not Found

      +

      Apologies, but the page you requested could not be found. Perhaps searching will help.

      +
      +

      +

      +
      + + +
      +
      + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/disped-web/resources/images/gallery/imgbox3.html b/target/disped-web/resources/images/gallery/imgbox3.html new file mode 100644 index 0000000000000000000000000000000000000000..1229715285cd5f52b299a9dcf7936157626237ff --- /dev/null +++ b/target/disped-web/resources/images/gallery/imgbox3.html @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + Page not found - Theme Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +
      + + +
      +
      + + +
      +
      + +

      404 Not Found

      +

      Apologies, but the page you requested could not be found. Perhaps searching will help.

      +
      +

      +

      +
      + + +
      +
      + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/disped-web/resources/img/Descr.WD3 b/target/disped-web/resources/img/Descr.WD3 new file mode 100644 index 0000000000000000000000000000000000000000..e410f477eea631fb9cd550c3343221ab07d1bf3b Binary files /dev/null and b/target/disped-web/resources/img/Descr.WD3 differ diff --git a/target/disped-web/resources/img/alpha.html b/target/disped-web/resources/img/alpha.html new file mode 100644 index 0000000000000000000000000000000000000000..1229715285cd5f52b299a9dcf7936157626237ff --- /dev/null +++ b/target/disped-web/resources/img/alpha.html @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + Page not found - Theme Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +
      + + +
      +
      + + +
      +
      + +

      404 Not Found

      +

      Apologies, but the page you requested could not be found. Perhaps searching will help.

      +
      +

      +

      +
      + + +
      +
      + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/disped-web/resources/img/bg.jpg b/target/disped-web/resources/img/bg.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7d6651de5bb56b42a349b56b684ead751a153e7c Binary files /dev/null and b/target/disped-web/resources/img/bg.jpg differ diff --git a/target/disped-web/resources/img/breadcrumb.png b/target/disped-web/resources/img/breadcrumb.png new file mode 100644 index 0000000000000000000000000000000000000000..d3462402e4f803860a6b11fdc9bff76f7e3a955d Binary files /dev/null and b/target/disped-web/resources/img/breadcrumb.png differ diff --git a/target/disped-web/resources/img/default.png b/target/disped-web/resources/img/default.png new file mode 100644 index 0000000000000000000000000000000000000000..581c3c23d378f0ca755ea091ee914aa0e274788b Binary files /dev/null and b/target/disped-web/resources/img/default.png differ diff --git a/target/disped-web/resources/img/demo/Descr.WD3 b/target/disped-web/resources/img/demo/Descr.WD3 new file mode 100644 index 0000000000000000000000000000000000000000..9388fbf80f192d66b19c0f0d09ddf0d6bda335b4 Binary files /dev/null and b/target/disped-web/resources/img/demo/Descr.WD3 differ diff --git a/target/disped-web/resources/img/demo/av1.jpg b/target/disped-web/resources/img/demo/av1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e3caaa76a520caca2e68f4f94c39bac7ad80a89e Binary files /dev/null and b/target/disped-web/resources/img/demo/av1.jpg differ diff --git a/target/disped-web/resources/img/demo/av2.jpg b/target/disped-web/resources/img/demo/av2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..73bbe80b7e030676588c670387aa497c29cca419 Binary files /dev/null and b/target/disped-web/resources/img/demo/av2.jpg differ diff --git a/target/disped-web/resources/img/demo/av3.jpg b/target/disped-web/resources/img/demo/av3.jpg new file mode 100644 index 0000000000000000000000000000000000000000..73eef408fd21e539eb6764bb697282e873e6a70a Binary files /dev/null and b/target/disped-web/resources/img/demo/av3.jpg differ diff --git a/target/disped-web/resources/img/demo/av4.jpg b/target/disped-web/resources/img/demo/av4.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4271fc29b25813729dc874d6d4ef00cb6fc3d4af Binary files /dev/null and b/target/disped-web/resources/img/demo/av4.jpg differ diff --git a/target/disped-web/resources/img/demo/av5.jpg b/target/disped-web/resources/img/demo/av5.jpg new file mode 100644 index 0000000000000000000000000000000000000000..dfa24fa5ab3ba4873690e49d2a5cd46ad579d340 Binary files /dev/null and b/target/disped-web/resources/img/demo/av5.jpg differ diff --git a/target/disped-web/resources/img/demo/demo-image1.jpg b/target/disped-web/resources/img/demo/demo-image1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a4a2191cc5e1bc0bf46bd90005dd24faa6f2e8b8 Binary files /dev/null and b/target/disped-web/resources/img/demo/demo-image1.jpg differ diff --git a/target/disped-web/resources/img/demo/demo-image2.jpg b/target/disped-web/resources/img/demo/demo-image2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..3e63af85b568b77125a776a09fe6660d3d2aca31 Binary files /dev/null and b/target/disped-web/resources/img/demo/demo-image2.jpg differ diff --git a/target/disped-web/resources/img/demo/demo-image3.jpg b/target/disped-web/resources/img/demo/demo-image3.jpg new file mode 100644 index 0000000000000000000000000000000000000000..079da312559e982ce42cc2d27da7bf433c85a6b8 Binary files /dev/null and b/target/disped-web/resources/img/demo/demo-image3.jpg differ diff --git a/target/disped-web/resources/img/demo/envelope.png b/target/disped-web/resources/img/demo/envelope.png new file mode 100644 index 0000000000000000000000000000000000000000..78c131c0ff2bf69fc04e537076ecc408c020cbb6 Binary files /dev/null and b/target/disped-web/resources/img/demo/envelope.png differ diff --git a/target/disped-web/resources/img/gallery/Descr.WD3 b/target/disped-web/resources/img/gallery/Descr.WD3 new file mode 100644 index 0000000000000000000000000000000000000000..8ce58a45706c438fef50f4d35bac8d509205a708 Binary files /dev/null and b/target/disped-web/resources/img/gallery/Descr.WD3 differ diff --git a/target/disped-web/resources/img/gallery/imgbox1.jpg b/target/disped-web/resources/img/gallery/imgbox1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ba58811c73f31fd2ee98dc13988d70c2073264f8 Binary files /dev/null and b/target/disped-web/resources/img/gallery/imgbox1.jpg differ diff --git a/target/disped-web/resources/img/gallery/imgbox2.jpg b/target/disped-web/resources/img/gallery/imgbox2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f3dba1a5076b0f95323bfb158be130fff03275c7 Binary files /dev/null and b/target/disped-web/resources/img/gallery/imgbox2.jpg differ diff --git a/target/disped-web/resources/img/gallery/imgbox3.jpg b/target/disped-web/resources/img/gallery/imgbox3.jpg new file mode 100644 index 0000000000000000000000000000000000000000..182e7cbedf27d071bce4dcbe4965fa428e6f9e7f Binary files /dev/null and b/target/disped-web/resources/img/gallery/imgbox3.jpg differ diff --git a/target/disped-web/resources/img/gallery/imgbox4.jpg b/target/disped-web/resources/img/gallery/imgbox4.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a2278036fe38014d1c5861f79e15c434a877d436 Binary files /dev/null and b/target/disped-web/resources/img/gallery/imgbox4.jpg differ diff --git a/target/disped-web/resources/img/gallery/imgbox5.jpg b/target/disped-web/resources/img/gallery/imgbox5.jpg new file mode 100644 index 0000000000000000000000000000000000000000..aa60cc5520f86328e5a5e7a58932603eb37a0ccd Binary files /dev/null and b/target/disped-web/resources/img/gallery/imgbox5.jpg differ diff --git a/target/disped-web/resources/img/glyphicons-halflings-white.png b/target/disped-web/resources/img/glyphicons-halflings-white.png new file mode 100644 index 0000000000000000000000000000000000000000..3bf6484a29d8da269f9bc874b25493a45fae3bae Binary files /dev/null and b/target/disped-web/resources/img/glyphicons-halflings-white.png differ diff --git a/target/disped-web/resources/img/glyphicons-halflings.html b/target/disped-web/resources/img/glyphicons-halflings.html new file mode 100644 index 0000000000000000000000000000000000000000..1229715285cd5f52b299a9dcf7936157626237ff --- /dev/null +++ b/target/disped-web/resources/img/glyphicons-halflings.html @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + Page not found - Theme Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +
      + + +
      +
      + + +
      +
      + +

      404 Not Found

      +

      Apologies, but the page you requested could not be found. Perhaps searching will help.

      +
      +

      +

      +
      + + +
      +
      + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/disped-web/resources/img/gritter.png b/target/disped-web/resources/img/gritter.png new file mode 100644 index 0000000000000000000000000000000000000000..4b84bf78f5f5d49afedbf5863ecccdb8ae95a6f6 Binary files /dev/null and b/target/disped-web/resources/img/gritter.png differ diff --git a/target/disped-web/resources/img/hue.png b/target/disped-web/resources/img/hue.png new file mode 100644 index 0000000000000000000000000000000000000000..75957d0509be44f3caf317b832e44307950b0415 Binary files /dev/null and b/target/disped-web/resources/img/hue.png differ diff --git a/target/disped-web/resources/img/icon.png b/target/disped-web/resources/img/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..861e030c0a577a4079c320bd6f74322b96b5f07d Binary files /dev/null and b/target/disped-web/resources/img/icon.png differ diff --git a/target/disped-web/resources/img/larrow.png b/target/disped-web/resources/img/larrow.png new file mode 100644 index 0000000000000000000000000000000000000000..a4a736809a1179d8b7741410ea3a8da0307fb223 Binary files /dev/null and b/target/disped-web/resources/img/larrow.png differ diff --git a/target/disped-web/resources/img/line.png b/target/disped-web/resources/img/line.png new file mode 100644 index 0000000000000000000000000000000000000000..ef73f83f89755fb6894750705ce7d1b7af2bd9b0 Binary files /dev/null and b/target/disped-web/resources/img/line.png differ diff --git a/target/disped-web/resources/img/logo.png b/target/disped-web/resources/img/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..e1a4565c211a83ebd00b19309fc7e6e39e320f7b Binary files /dev/null and b/target/disped-web/resources/img/logo.png differ diff --git a/target/disped-web/resources/img/logoer.png b/target/disped-web/resources/img/logoer.png new file mode 100644 index 0000000000000000000000000000000000000000..6f3157942a279495aad476c8f966ce138b536595 Binary files /dev/null and b/target/disped-web/resources/img/logoer.png differ diff --git a/target/disped-web/resources/img/menu-active.png b/target/disped-web/resources/img/menu-active.png new file mode 100644 index 0000000000000000000000000000000000000000..a62bbebd33e62993bc5f77af5a6cd87819223d61 Binary files /dev/null and b/target/disped-web/resources/img/menu-active.png differ diff --git a/target/disped-web/resources/img/rarrow.png b/target/disped-web/resources/img/rarrow.png new file mode 100644 index 0000000000000000000000000000000000000000..1c9fdf832907b3ff66aee1f8bba36358f6781bd6 Binary files /dev/null and b/target/disped-web/resources/img/rarrow.png differ diff --git a/target/disped-web/resources/img/saturation.png b/target/disped-web/resources/img/saturation.png new file mode 100644 index 0000000000000000000000000000000000000000..a5e7fcd9c7712465e027166a37c4e82929f7f4d4 Binary files /dev/null and b/target/disped-web/resources/img/saturation.png differ diff --git a/target/disped-web/resources/img/select2.png b/target/disped-web/resources/img/select2.png new file mode 100644 index 0000000000000000000000000000000000000000..9ba2d825b11fc34196a78340f058a75217a7be18 Binary files /dev/null and b/target/disped-web/resources/img/select2.png differ diff --git a/target/disped-web/resources/img/spinner.gif b/target/disped-web/resources/img/spinner.gif new file mode 100644 index 0000000000000000000000000000000000000000..5b33f7e54f4e55b6b8774d86d96895db9af044b4 Binary files /dev/null and b/target/disped-web/resources/img/spinner.gif differ diff --git a/target/disped-web/resources/img/sprite.png b/target/disped-web/resources/img/sprite.png new file mode 100644 index 0000000000000000000000000000000000000000..c4b27c3e3cab676d3c0702d71ac3500f91c3cd67 Binary files /dev/null and b/target/disped-web/resources/img/sprite.png differ diff --git a/target/disped-web/resources/js/bootstrap-colorpicker.js b/target/disped-web/resources/js/bootstrap-colorpicker.js new file mode 100644 index 0000000000000000000000000000000000000000..6a0fc8adba0aa401be5edef94e87f6dd17a762ba --- /dev/null +++ b/target/disped-web/resources/js/bootstrap-colorpicker.js @@ -0,0 +1,540 @@ +/* ========================================================= + * bootstrap-colorpicker.js + * http://www.eyecon.ro/bootstrap-colorpicker + * ========================================================= + * Copyright 2012 Stefan Petre + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================= */ + +!function( $ ) { + + // Color object + + var Color = function(val) { + this.value = { + h: 1, + s: 1, + b: 1, + a: 1 + }; + this.setColor(val); + }; + + Color.prototype = { + constructor: Color, + + //parse a string to HSB + setColor: function(val){ + val = val.toLowerCase(); + var that = this; + $.each( CPGlobal.stringParsers, function( i, parser ) { + var match = parser.re.exec( val ), + values = match && parser.parse( match ), + space = parser.space||'rgba'; + if ( values ) { + if (space === 'hsla') { + that.value = CPGlobal.RGBtoHSB.apply(null, CPGlobal.HSLtoRGB.apply(null, values)); + } else { + that.value = CPGlobal.RGBtoHSB.apply(null, values); + } + return false; + } + }); + }, + + setHue: function(h) { + this.value.h = 1- h; + }, + + setSaturation: function(s) { + this.value.s = s; + }, + + setLightness: function(b) { + this.value.b = 1- b; + }, + + setAlpha: function(a) { + this.value.a = parseInt((1 - a)*100, 10)/100; + }, + + // HSBtoRGB from RaphaelJS + // https://github.com/DmitryBaranovskiy/raphael/ + toRGB: function(h, s, b, a) { + if (!h) { + h = this.value.h; + s = this.value.s; + b = this.value.b; + } + h *= 360; + var R, G, B, X, C; + h = (h % 360) / 60; + C = b * s; + X = C * (1 - Math.abs(h % 2 - 1)); + R = G = B = b - C; + + h = ~~h; + R += [C, X, 0, 0, X, C][h]; + G += [X, C, C, X, 0, 0][h]; + B += [0, 0, X, C, C, X][h]; + return { + r: Math.round(R*255), + g: Math.round(G*255), + b: Math.round(B*255), + a: a||this.value.a + }; + }, + + toHex: function(h, s, b, a){ + var rgb = this.toRGB(h, s, b, a); + return '#'+((1 << 24) | (parseInt(rgb.r) << 16) | (parseInt(rgb.g) << 8) | parseInt(rgb.b)).toString(16).substr(1); + }, + + toHSL: function(h, s, b, a){ + if (!h) { + h = this.value.h; + s = this.value.s; + b = this.value.b; + } + var H = h, + L = (2 - s) * b, + S = s * b; + if (L > 0 && L <= 1) { + S /= L; + } else { + S /= 2 - L; + } + L /= 2; + if (S > 1) { + S = 1; + } + return { + h: H, + s: S, + l: L, + a: a||this.value.a + }; + } + }; + + // Picker object + + var Colorpicker = function(element, options){ + this.element = $(element); + var format = options.format||this.element.data('color-format')||'hex'; + this.format = CPGlobal.translateFormats[format]; + this.isInput = this.element.is('input'); + this.component = this.element.is('.color') ? this.element.find('.add-on') : false; + + this.picker = $(CPGlobal.template) + .appendTo('body') + .on('mousedown', $.proxy(this.mousedown, this)); + + if (this.isInput) { + this.element.on({ + 'focus': $.proxy(this.show, this), + 'keyup': $.proxy(this.update, this) + }); + } else if (this.component){ + this.component.on({ + 'click': $.proxy(this.show, this) + }); + } else { + this.element.on({ + 'click': $.proxy(this.show, this) + }); + } + if (format === 'rgba' || format === 'hsla') { + this.picker.addClass('alpha'); + this.alpha = this.picker.find('.colorpicker-alpha')[0].style; + } + + if (this.component){ + this.picker.find('.colorpicker-color').hide(); + this.preview = this.element.find('i')[0].style; + } else { + this.preview = this.picker.find('div:last')[0].style; + } + + this.base = this.picker.find('div:first')[0].style; + this.update(); + }; + + Colorpicker.prototype = { + constructor: Colorpicker, + + show: function(e) { + this.picker.show(); + this.height = this.component ? this.component.outerHeight() : this.element.outerHeight(); + this.place(); + $(window).on('resize', $.proxy(this.place, this)); + if (!this.isInput) { + if (e) { + e.stopPropagation(); + e.preventDefault(); + } + } + $(document).on({ + 'mousedown': $.proxy(this.hide, this) + }); + this.element.trigger({ + type: 'show', + color: this.color + }); + }, + + update: function(){ + this.color = new Color(this.isInput ? this.element.prop('value') : this.element.data('color')); + this.picker.find('i') + .eq(0).css({left: this.color.value.s*100, top: 100 - this.color.value.b*100}).end() + .eq(1).css('top', 100 * (1 - this.color.value.h)).end() + .eq(2).css('top', 100 * (1 - this.color.value.a)); + this.previewColor(); + }, + + setValue: function(newColor) { + this.color = new Color(newColor); + this.picker.find('i') + .eq(0).css({left: this.color.value.s*100, top: 100 - this.color.value.b*100}).end() + .eq(1).css('top', 100 * (1 - this.color.value.h)).end() + .eq(2).css('top', 100 * (1 - this.color.value.a)); + this.previewColor(); + this.element.trigger({ + type: 'changeColor', + color: this.color + }); + }, + + hide: function(){ + this.picker.hide(); + $(window).off('resize', this.place); + if (!this.isInput) { + $(document).off({ + 'mousedown': this.hide + }); + if (this.component){ + this.element.find('input').prop('value', this.format.call(this)); + } + this.element.data('color', this.format.call(this)); + } else { + this.element.prop('value', this.format.call(this)); + } + this.element.trigger({ + type: 'hide', + color: this.color + }); + }, + + place: function(){ + var offset = this.component ? this.component.offset() : this.element.offset(); + this.picker.css({ + top: offset.top + this.height, + left: offset.left + }); + }, + + //preview color change + previewColor: function(){ + try { + this.preview.backgroundColor = this.format.call(this); + } catch(e) { + this.preview.backgroundColor = this.color.toHex(); + } + //set the color for brightness/saturation slider + this.base.backgroundColor = this.color.toHex(this.color.value.h, 1, 1, 1); + //set te color for alpha slider + if (this.alpha) { + this.alpha.backgroundColor = this.color.toHex(); + } + }, + + pointer: null, + + slider: null, + + mousedown: function(e){ + e.stopPropagation(); + e.preventDefault(); + + var target = $(e.target); + + //detect the slider and set the limits and callbacks + var zone = target.closest('div'); + if (!zone.is('.colorpicker')) { + if (zone.is('.colorpicker-saturation')) { + this.slider = $.extend({}, CPGlobal.sliders.saturation); + } + else if (zone.is('.colorpicker-hue')) { + this.slider = $.extend({}, CPGlobal.sliders.hue); + } + else if (zone.is('.colorpicker-alpha')) { + this.slider = $.extend({}, CPGlobal.sliders.alpha); + } else { + return false; + } + var offset = zone.offset(); + //reference to knob's style + this.slider.knob = zone.find('i')[0].style; + this.slider.left = e.pageX - offset.left; + this.slider.top = e.pageY - offset.top; + this.pointer = { + left: e.pageX, + top: e.pageY + }; + //trigger mousemove to move the knob to the current position + $(document).on({ + mousemove: $.proxy(this.mousemove, this), + mouseup: $.proxy(this.mouseup, this) + }).trigger('mousemove'); + } + return false; + }, + + mousemove: function(e){ + e.stopPropagation(); + e.preventDefault(); + var left = Math.max( + 0, + Math.min( + this.slider.maxLeft, + this.slider.left + ((e.pageX||this.pointer.left) - this.pointer.left) + ) + ); + var top = Math.max( + 0, + Math.min( + this.slider.maxTop, + this.slider.top + ((e.pageY||this.pointer.top) - this.pointer.top) + ) + ); + this.slider.knob.left = left + 'px'; + this.slider.knob.top = top + 'px'; + if (this.slider.callLeft) { + this.color[this.slider.callLeft].call(this.color, left/100); + } + if (this.slider.callTop) { + this.color[this.slider.callTop].call(this.color, top/100); + } + this.previewColor(); + this.element.trigger({ + type: 'changeColor', + color: this.color + }); + return false; + }, + + mouseup: function(e){ + e.stopPropagation(); + e.preventDefault(); + $(document).off({ + mousemove: this.mousemove, + mouseup: this.mouseup + }); + return false; + } + } + + $.fn.colorpicker = function ( option ) { + return this.each(function () { + var $this = $(this), + data = $this.data('colorpicker'), + options = typeof option === 'object' && option; + if (!data) { + $this.data('colorpicker', (data = new Colorpicker(this, $.extend({}, $.fn.colorpicker.defaults,options)))); + } + if (typeof option === 'string') data[option](); + }); + }; + + $.fn.colorpicker.defaults = { + }; + + $.fn.colorpicker.Constructor = Colorpicker; + + var CPGlobal = { + + // translate a format from Color object to a string + translateFormats: { + 'rgb': function(){ + var rgb = this.color.toRGB(); + return 'rgb('+rgb.r+','+rgb.g+','+rgb.b+')'; + }, + + 'rgba': function(){ + var rgb = this.color.toRGB(); + return 'rgba('+rgb.r+','+rgb.g+','+rgb.b+','+rgb.a+')'; + }, + + 'hsl': function(){ + var hsl = this.color.toHSL(); + return 'hsl('+Math.round(hsl.h*360)+','+Math.round(hsl.s*100)+'%,'+Math.round(hsl.l*100)+'%)'; + }, + + 'hsla': function(){ + var hsl = this.color.toHSL(); + return 'hsla('+Math.round(hsl.h*360)+','+Math.round(hsl.s*100)+'%,'+Math.round(hsl.l*100)+'%,'+hsl.a+')'; + }, + + 'hex': function(){ + return this.color.toHex(); + } + }, + + sliders: { + saturation: { + maxLeft: 100, + maxTop: 100, + callLeft: 'setSaturation', + callTop: 'setLightness' + }, + + hue: { + maxLeft: 0, + maxTop: 100, + callLeft: false, + callTop: 'setHue' + }, + + alpha: { + maxLeft: 0, + maxTop: 100, + callLeft: false, + callTop: 'setAlpha' + } + }, + + // HSBtoRGB from RaphaelJS + // https://github.com/DmitryBaranovskiy/raphael/ + RGBtoHSB: function (r, g, b, a){ + r /= 255; + g /= 255; + b /= 255; + + var H, S, V, C; + V = Math.max(r, g, b); + C = V - Math.min(r, g, b); + H = (C === 0 ? null : + V == r ? (g - b) / C : + V == g ? (b - r) / C + 2 : + (r - g) / C + 4 + ); + H = ((H + 360) % 6) * 60 / 360; + S = C === 0 ? 0 : C / V; + return {h: H||1, s: S, b: V, a: a||1}; + }, + + HueToRGB: function (p, q, h) { + if (h < 0) + h += 1; + else if (h > 1) + h -= 1; + + if ((h * 6) < 1) + return p + (q - p) * h * 6; + else if ((h * 2) < 1) + return q; + else if ((h * 3) < 2) + return p + (q - p) * ((2 / 3) - h) * 6; + else + return p; + }, + + HSLtoRGB: function (h, s, l, a) + { + if (s < 0) { + s = 0; + } + var q; + if (l <= 0.5) { + q = l * (1 + s); + } else { + q = l + s - (l * s); + } + + var p = 2 * l - q; + + var tr = h + (1 / 3); + var tg = h; + var tb = h - (1 / 3); + + var r = Math.round(CPGlobal.HueToRGB(p, q, tr) * 255); + var g = Math.round(CPGlobal.HueToRGB(p, q, tg) * 255); + var b = Math.round(CPGlobal.HueToRGB(p, q, tb) * 255); + return [r, g, b, a||1]; + }, + + // a set of RE's that can match strings and generate color tuples. + // from John Resig color plugin + // https://github.com/jquery/jquery-color/ + stringParsers: [ + { + re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/, + parse: function( execResult ) { + return [ + execResult[ 1 ], + execResult[ 2 ], + execResult[ 3 ], + execResult[ 4 ] + ]; + } + }, { + re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/, + parse: function( execResult ) { + return [ + 2.55 * execResult[1], + 2.55 * execResult[2], + 2.55 * execResult[3], + execResult[ 4 ] + ]; + } + }, { + re: /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/, + parse: function( execResult ) { + return [ + parseInt( execResult[ 1 ], 16 ), + parseInt( execResult[ 2 ], 16 ), + parseInt( execResult[ 3 ], 16 ) + ]; + } + }, { + re: /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/, + parse: function( execResult ) { + return [ + parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ), + parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ), + parseInt( execResult[ 3 ] + execResult[ 3 ], 16 ) + ]; + } + }, { + re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/, + space: 'hsla', + parse: function( execResult ) { + return [ + execResult[1]/360, + execResult[2] / 100, + execResult[3] / 100, + execResult[4] + ]; + } + } + ], + template: '
      ")}}if(aI.length>0){aI.push('
      ');aC=aH(aI,"width:10000px;");aG=aC.height();aC.remove()}}}else{if(aK==null||aG==null){for(aF=0;aF'+aE+"
      ")}}if(aI.length>0){aC=aH(aI,"");if(aK==null){aK=aC.children().width()}if(aG==null){aG=aC.find("div.tickLabel").height()}aC.remove()}}}if(aK==null){aK=0}if(aG==null){aG=0}aD.labelWidth=aK;aD.labelHeight=aG}function au(aD){var aC=aD.labelWidth,aL=aD.labelHeight,aH=aD.options.position,aF=aD.options.tickLength,aG=O.grid.axisMargin,aJ=O.grid.labelMargin,aK=aD.direction=="x"?p:aw,aE;var aB=c.grep(aK,function(aN){return aN&&aN.options.position==aH&&aN.reserveSpace});if(c.inArray(aD,aB)==aB.length-1){aG=0}if(aF==null){aF="full"}var aI=c.grep(aK,function(aN){return aN&&aN.reserveSpace});var aM=c.inArray(aD,aI)==0;if(!aM&&aF=="full"){aF=5}if(!isNaN(+aF)){aJ+=+aF}if(aD.direction=="x"){aL+=aJ;if(aH=="bottom"){q.bottom+=aL+aG;aD.box={top:I-q.bottom,height:aL}}else{aD.box={top:q.top+aG,height:aL};q.top+=aL+aG}}else{aC+=aJ;if(aH=="left"){aD.box={left:q.left+aG,width:aC};q.left+=aC+aG}else{q.right+=aC+aG;aD.box={left:G-q.right,width:aC}}}aD.position=aH;aD.tickLength=aF;aD.box.padding=aJ;aD.innermost=aM}function U(aB){if(aB.direction=="x"){aB.box.left=q.left;aB.box.width=h}else{aB.box.top=q.top;aB.box.height=w}}function t(){var aC,aE=m();c.each(aE,function(aF,aG){aG.show=aG.options.show;if(aG.show==null){aG.show=aG.used}aG.reserveSpace=aG.show||aG.options.reserveSpace;n(aG)});allocatedAxes=c.grep(aE,function(aF){return aF.reserveSpace});q.left=q.right=q.top=q.bottom=0;if(O.grid.show){c.each(allocatedAxes,function(aF,aG){S(aG);P(aG);ap(aG,aG.ticks);L(aG)});for(aC=allocatedAxes.length-1;aC>=0;--aC){au(allocatedAxes[aC])}var aD=O.grid.minBorderMargin;if(aD==null){aD=0;for(aC=0;aC=0){aD=0}}if(aF.max==null){aB+=aH*aG;if(aB>0&&aE.datamax!=null&&aE.datamax<=0){aB=0}}}}aE.min=aD;aE.max=aB}function S(aG){var aM=aG.options;var aH;if(typeof aM.ticks=="number"&&aM.ticks>0){aH=aM.ticks}else{aH=0.3*Math.sqrt(aG.direction=="x"?G:I)}var aT=(aG.max-aG.min)/aH,aO,aB,aN,aR,aS,aQ,aI;if(aM.mode=="time"){var aJ={second:1000,minute:60*1000,hour:60*60*1000,day:24*60*60*1000,month:30*24*60*60*1000,year:365.2425*24*60*60*1000};var aK=[[1,"second"],[2,"second"],[5,"second"],[10,"second"],[30,"second"],[1,"minute"],[2,"minute"],[5,"minute"],[10,"minute"],[30,"minute"],[1,"hour"],[2,"hour"],[4,"hour"],[8,"hour"],[12,"hour"],[1,"day"],[2,"day"],[3,"day"],[0.25,"month"],[0.5,"month"],[1,"month"],[2,"month"],[3,"month"],[6,"month"],[1,"year"]];var aC=0;if(aM.minTickSize!=null){if(typeof aM.tickSize=="number"){aC=aM.tickSize}else{aC=aM.minTickSize[0]*aJ[aM.minTickSize[1]]}}for(var aS=0;aS=aC){break}}aO=aK[aS][0];aN=aK[aS][1];if(aN=="year"){aQ=Math.pow(10,Math.floor(Math.log(aT/aJ.year)/Math.LN10));aI=(aT/aJ.year)/aQ;if(aI<1.5){aO=1}else{if(aI<3){aO=2}else{if(aI<7.5){aO=5}else{aO=10}}}aO*=aQ}aG.tickSize=aM.tickSize||[aO,aN];aB=function(aX){var a2=[],a0=aX.tickSize[0],a3=aX.tickSize[1],a1=new Date(aX.min);var aW=a0*aJ[a3];if(a3=="second"){a1.setUTCSeconds(a(a1.getUTCSeconds(),a0))}if(a3=="minute"){a1.setUTCMinutes(a(a1.getUTCMinutes(),a0))}if(a3=="hour"){a1.setUTCHours(a(a1.getUTCHours(),a0))}if(a3=="month"){a1.setUTCMonth(a(a1.getUTCMonth(),a0))}if(a3=="year"){a1.setUTCFullYear(a(a1.getUTCFullYear(),a0))}a1.setUTCMilliseconds(0);if(aW>=aJ.minute){a1.setUTCSeconds(0)}if(aW>=aJ.hour){a1.setUTCMinutes(0)}if(aW>=aJ.day){a1.setUTCHours(0)}if(aW>=aJ.day*4){a1.setUTCDate(1)}if(aW>=aJ.year){a1.setUTCMonth(0)}var a5=0,a4=Number.NaN,aY;do{aY=a4;a4=a1.getTime();a2.push(a4);if(a3=="month"){if(a0<1){a1.setUTCDate(1);var aV=a1.getTime();a1.setUTCMonth(a1.getUTCMonth()+1);var aZ=a1.getTime();a1.setTime(a4+a5*aJ.hour+(aZ-aV)*a0);a5=a1.getUTCHours();a1.setUTCHours(0)}else{a1.setUTCMonth(a1.getUTCMonth()+a0)}}else{if(a3=="year"){a1.setUTCFullYear(a1.getUTCFullYear()+a0)}else{a1.setTime(a4+aW)}}}while(a4aU){aP=aU}aQ=Math.pow(10,-aP);aI=aT/aQ;if(aI<1.5){aO=1}else{if(aI<3){aO=2;if(aI>2.25&&(aU==null||aP+1<=aU)){aO=2.5;++aP}}else{if(aI<7.5){aO=5}else{aO=10}}}aO*=aQ;if(aM.minTickSize!=null&&aO0){if(aM.min==null){aG.min=Math.min(aG.min,aL[0])}if(aM.max==null&&aL.length>1){aG.max=Math.max(aG.max,aL[aL.length-1])}}aB=function(aX){var aY=[],aV,aW;for(aW=0;aW1&&/\..*0$/.test((aD[1]-aD[0]).toFixed(aE)))){aG.tickDecimals=aE}}}}aG.tickGenerator=aB;if(c.isFunction(aM.tickFormatter)){aG.tickFormatter=function(aV,aW){return""+aM.tickFormatter(aV,aW)}}else{aG.tickFormatter=aR}}function P(aF){var aH=aF.options.ticks,aG=[];if(aH==null||(typeof aH=="number"&&aH>0)){aG=aF.tickGenerator(aF)}else{if(aH){if(c.isFunction(aH)){aG=aH({min:aF.min,max:aF.max})}else{aG=aH}}}var aE,aB;aF.ticks=[];for(aE=0;aE1){aC=aD[1]}}else{aB=+aD}if(aC==null){aC=aF.tickFormatter(aB,aF)}if(!isNaN(aB)){aF.ticks.push({v:aB,label:aC})}}}function ap(aB,aC){if(aB.options.autoscaleMargin&&aC.length>0){if(aB.options.min==null){aB.min=Math.min(aB.min,aC[0].v)}if(aB.options.max==null&&aC.length>1){aB.max=Math.max(aB.max,aC[aC.length-1].v)}}}function W(){H.clearRect(0,0,G,I);var aC=O.grid;if(aC.show&&aC.backgroundColor){N()}if(aC.show&&!aC.aboveData){ac()}for(var aB=0;aBaG){var aC=aH;aH=aG;aG=aC}return{from:aH,to:aG,axis:aE}}function N(){H.save();H.translate(q.left,q.top);H.fillStyle=am(O.grid.backgroundColor,w,0,"rgba(255, 255, 255, 0)");H.fillRect(0,0,h,w);H.restore()}function ac(){var aF;H.save();H.translate(q.left,q.top);var aH=O.grid.markings;if(aH){if(c.isFunction(aH)){var aK=aq.getAxes();aK.xmin=aK.xaxis.min;aK.xmax=aK.xaxis.max;aK.ymin=aK.yaxis.min;aK.ymax=aK.yaxis.max;aH=aH(aK)}for(aF=0;aFaC.axis.max||aI.toaI.axis.max){continue}aC.from=Math.max(aC.from,aC.axis.min);aC.to=Math.min(aC.to,aC.axis.max);aI.from=Math.max(aI.from,aI.axis.min);aI.to=Math.min(aI.to,aI.axis.max);if(aC.from==aC.to&&aI.from==aI.to){continue}aC.from=aC.axis.p2c(aC.from);aC.to=aC.axis.p2c(aC.to);aI.from=aI.axis.p2c(aI.from);aI.to=aI.axis.p2c(aI.to);if(aC.from==aC.to||aI.from==aI.to){H.beginPath();H.strokeStyle=aD.color||O.grid.markingsColor;H.lineWidth=aD.lineWidth||O.grid.markingsLineWidth;H.moveTo(aC.from,aI.from);H.lineTo(aC.to,aI.to);H.stroke()}else{H.fillStyle=aD.color||O.grid.markingsColor;H.fillRect(aC.from,aI.to,aC.to-aC.from,aI.from-aI.to)}}}var aK=m(),aM=O.grid.borderWidth;for(var aE=0;aEaB.max||(aQ=="full"&&aM>0&&(aO==aB.min||aO==aB.max))){continue}if(aB.direction=="x"){aN=aB.p2c(aO);aJ=aQ=="full"?-w:aQ;if(aB.position=="top"){aJ=-aJ}}else{aL=aB.p2c(aO);aP=aQ=="full"?-h:aQ;if(aB.position=="left"){aP=-aP}}if(H.lineWidth==1){if(aB.direction=="x"){aN=Math.floor(aN)+0.5}else{aL=Math.floor(aL)+0.5}}H.moveTo(aN,aL);H.lineTo(aN+aP,aL+aJ)}H.stroke()}if(aM){H.lineWidth=aM;H.strokeStyle=O.grid.borderColor;H.strokeRect(-aM/2,-aM/2,h+aM,w+aM)}H.restore()}function k(){av.find(".tickLabels").remove();var aG=['
      '];var aJ=m();for(var aD=0;aD');for(var aE=0;aEaC.max){continue}var aK={},aI;if(aC.direction=="x"){aI="center";aK.left=Math.round(q.left+aC.p2c(aH.v)-aC.labelWidth/2);if(aC.position=="bottom"){aK.top=aF.top+aF.padding}else{aK.bottom=I-(aF.top+aF.height-aF.padding)}}else{aK.top=Math.round(q.top+aC.p2c(aH.v)-aC.labelHeight/2);if(aC.position=="left"){aK.right=G-(aF.left+aF.width-aF.padding);aI="right"}else{aK.left=aF.left+aF.padding;aI="left"}}aK.width=aC.labelWidth;var aB=["position:absolute","text-align:"+aI];for(var aL in aK){aB.push(aL+":"+aK[aL]+"px")}aG.push('
      '+aH.label+"
      ")}aG.push("
      ")}aG.push("

      ");av.append(aG.join(""))}function d(aB){if(aB.lines.show){at(aB)}if(aB.bars.show){e(aB)}if(aB.points.show){ao(aB)}}function at(aE){function aD(aP,aQ,aI,aU,aT){var aV=aP.points,aJ=aP.pointsize,aN=null,aM=null;H.beginPath();for(var aO=aJ;aO=aR&&aS>aT.max){if(aR>aT.max){continue}aL=(aT.max-aS)/(aR-aS)*(aK-aL)+aL;aS=aT.max}else{if(aR>=aS&&aR>aT.max){if(aS>aT.max){continue}aK=(aT.max-aS)/(aR-aS)*(aK-aL)+aL;aR=aT.max}}if(aL<=aK&&aL=aK&&aL>aU.max){if(aK>aU.max){continue}aS=(aU.max-aL)/(aK-aL)*(aR-aS)+aS;aL=aU.max}else{if(aK>=aL&&aK>aU.max){if(aL>aU.max){continue}aR=(aU.max-aL)/(aK-aL)*(aR-aS)+aS;aK=aU.max}}if(aL!=aN||aS!=aM){H.moveTo(aU.p2c(aL)+aQ,aT.p2c(aS)+aI)}aN=aK;aM=aR;H.lineTo(aU.p2c(aK)+aQ,aT.p2c(aR)+aI)}H.stroke()}function aF(aI,aQ,aP){var aW=aI.points,aV=aI.pointsize,aN=Math.min(Math.max(0,aP.min),aP.max),aX=0,aU,aT=false,aM=1,aL=0,aR=0;while(true){if(aV>0&&aX>aW.length+aV){break}aX+=aV;var aZ=aW[aX-aV],aK=aW[aX-aV+aM],aY=aW[aX],aJ=aW[aX+aM];if(aT){if(aV>0&&aZ!=null&&aY==null){aR=aX;aV=-aV;aM=2;continue}if(aV<0&&aX==aL+aV){H.fill();aT=false;aV=-aV;aM=1;aX=aL=aR+aV;continue}}if(aZ==null||aY==null){continue}if(aZ<=aY&&aZ=aY&&aZ>aQ.max){if(aY>aQ.max){continue}aK=(aQ.max-aZ)/(aY-aZ)*(aJ-aK)+aK;aZ=aQ.max}else{if(aY>=aZ&&aY>aQ.max){if(aZ>aQ.max){continue}aJ=(aQ.max-aZ)/(aY-aZ)*(aJ-aK)+aK;aY=aQ.max}}if(!aT){H.beginPath();H.moveTo(aQ.p2c(aZ),aP.p2c(aN));aT=true}if(aK>=aP.max&&aJ>=aP.max){H.lineTo(aQ.p2c(aZ),aP.p2c(aP.max));H.lineTo(aQ.p2c(aY),aP.p2c(aP.max));continue}else{if(aK<=aP.min&&aJ<=aP.min){H.lineTo(aQ.p2c(aZ),aP.p2c(aP.min));H.lineTo(aQ.p2c(aY),aP.p2c(aP.min));continue}}var aO=aZ,aS=aY;if(aK<=aJ&&aK=aP.min){aZ=(aP.min-aK)/(aJ-aK)*(aY-aZ)+aZ;aK=aP.min}else{if(aJ<=aK&&aJ=aP.min){aY=(aP.min-aK)/(aJ-aK)*(aY-aZ)+aZ;aJ=aP.min}}if(aK>=aJ&&aK>aP.max&&aJ<=aP.max){aZ=(aP.max-aK)/(aJ-aK)*(aY-aZ)+aZ;aK=aP.max}else{if(aJ>=aK&&aJ>aP.max&&aK<=aP.max){aY=(aP.max-aK)/(aJ-aK)*(aY-aZ)+aZ;aJ=aP.max}}if(aZ!=aO){H.lineTo(aQ.p2c(aO),aP.p2c(aK))}H.lineTo(aQ.p2c(aZ),aP.p2c(aK));H.lineTo(aQ.p2c(aY),aP.p2c(aJ));if(aY!=aS){H.lineTo(aQ.p2c(aY),aP.p2c(aJ));H.lineTo(aQ.p2c(aS),aP.p2c(aJ))}}}H.save();H.translate(q.left,q.top);H.lineJoin="round";var aG=aE.lines.lineWidth,aB=aE.shadowSize;if(aG>0&&aB>0){H.lineWidth=aB;H.strokeStyle="rgba(0,0,0,0.1)";var aH=Math.PI/18;aD(aE.datapoints,Math.sin(aH)*(aG/2+aB/2),Math.cos(aH)*(aG/2+aB/2),aE.xaxis,aE.yaxis);H.lineWidth=aB/2;aD(aE.datapoints,Math.sin(aH)*(aG/2+aB/4),Math.cos(aH)*(aG/2+aB/4),aE.xaxis,aE.yaxis)}H.lineWidth=aG;H.strokeStyle=aE.color;var aC=ae(aE.lines,aE.color,0,w);if(aC){H.fillStyle=aC;aF(aE.datapoints,aE.xaxis,aE.yaxis)}if(aG>0){aD(aE.datapoints,0,0,aE.xaxis,aE.yaxis)}H.restore()}function ao(aE){function aH(aN,aM,aU,aK,aS,aT,aQ,aJ){var aR=aN.points,aI=aN.pointsize;for(var aL=0;aLaT.max||aOaQ.max){continue}H.beginPath();aP=aT.p2c(aP);aO=aQ.p2c(aO)+aK;if(aJ=="circle"){H.arc(aP,aO,aM,0,aS?Math.PI:Math.PI*2,false)}else{aJ(H,aP,aO,aM,aS)}H.closePath();if(aU){H.fillStyle=aU;H.fill()}H.stroke()}}H.save();H.translate(q.left,q.top);var aG=aE.points.lineWidth,aC=aE.shadowSize,aB=aE.points.radius,aF=aE.points.symbol;if(aG>0&&aC>0){var aD=aC/2;H.lineWidth=aD;H.strokeStyle="rgba(0,0,0,0.1)";aH(aE.datapoints,aB,null,aD+aD/2,true,aE.xaxis,aE.yaxis,aF);H.strokeStyle="rgba(0,0,0,0.2)";aH(aE.datapoints,aB,null,aD/2,true,aE.xaxis,aE.yaxis,aF)}H.lineWidth=aG;H.strokeStyle=aE.color;aH(aE.datapoints,aB,ae(aE.points,aE.color),0,false,aE.xaxis,aE.yaxis,aF);H.restore()}function E(aN,aM,aV,aI,aQ,aF,aD,aL,aK,aU,aR,aC){var aE,aT,aJ,aP,aG,aB,aO,aH,aS;if(aR){aH=aB=aO=true;aG=false;aE=aV;aT=aN;aP=aM+aI;aJ=aM+aQ;if(aTaL.max||aPaK.max){return}if(aEaL.max){aT=aL.max;aB=false}if(aJaK.max){aP=aK.max;aO=false}aE=aL.p2c(aE);aJ=aK.p2c(aJ);aT=aL.p2c(aT);aP=aK.p2c(aP);if(aD){aU.beginPath();aU.moveTo(aE,aJ);aU.lineTo(aE,aP);aU.lineTo(aT,aP);aU.lineTo(aT,aJ);aU.fillStyle=aD(aJ,aP);aU.fill()}if(aC>0&&(aG||aB||aO||aH)){aU.beginPath();aU.moveTo(aE,aJ+aF);if(aG){aU.lineTo(aE,aP+aF)}else{aU.moveTo(aE,aP+aF)}if(aO){aU.lineTo(aT,aP+aF)}else{aU.moveTo(aT,aP+aF)}if(aB){aU.lineTo(aT,aJ+aF)}else{aU.moveTo(aT,aJ+aF)}if(aH){aU.lineTo(aE,aJ+aF)}else{aU.moveTo(aE,aJ+aF)}aU.stroke()}}function e(aD){function aC(aJ,aI,aL,aG,aK,aN,aM){var aO=aJ.points,aF=aJ.pointsize;for(var aH=0;aH")}aH.push("");aF=true}if(aN){aJ=aN(aJ,aM)}aH.push('
      '+aJ+"")}if(aF){aH.push("")}if(aH.length==0){return}var aL=''+aH.join("")+"
      ";if(O.legend.container!=null){c(O.legend.container).html(aL)}else{var aI="",aC=O.legend.position,aD=O.legend.margin;if(aD[0]==null){aD=[aD,aD]}if(aC.charAt(0)=="n"){aI+="top:"+(aD[1]+q.top)+"px;"}else{if(aC.charAt(0)=="s"){aI+="bottom:"+(aD[1]+q.bottom)+"px;"}}if(aC.charAt(1)=="e"){aI+="right:"+(aD[0]+q.right)+"px;"}else{if(aC.charAt(1)=="w"){aI+="left:"+(aD[0]+q.left)+"px;"}}var aK=c('
      '+aL.replace('style="','style="position:absolute;'+aI+";")+"
      ").appendTo(av);if(O.legend.backgroundOpacity!=0){var aG=O.legend.backgroundColor;if(aG==null){aG=O.grid.backgroundColor;if(aG&&typeof aG=="string"){aG=c.color.parse(aG)}else{aG=c.color.extract(aK,"background-color")}aG.a=1;aG=aG.toString()}var aB=aK.children();c('
      ').prependTo(aK).css("opacity",O.legend.backgroundOpacity)}}}var ab=[],M=null;function K(aI,aG,aD){var aO=O.grid.mouseActiveRadius,a0=aO*aO+1,aY=null,aR=false,aW,aU;for(aW=Q.length-1;aW>=0;--aW){if(!aD(Q[aW])){continue}var aP=Q[aW],aH=aP.xaxis,aF=aP.yaxis,aV=aP.datapoints.points,aT=aP.datapoints.pointsize,aQ=aH.c2p(aI),aN=aF.c2p(aG),aC=aO/aH.scale,aB=aO/aF.scale;if(aH.options.inverseTransform){aC=Number.MAX_VALUE}if(aF.options.inverseTransform){aB=Number.MAX_VALUE}if(aP.lines.show||aP.points.show){for(aU=0;aUaC||aK-aQ<-aC||aJ-aN>aB||aJ-aN<-aB){continue}var aM=Math.abs(aH.p2c(aK)-aI),aL=Math.abs(aF.p2c(aJ)-aG),aS=aM*aM+aL*aL;if(aS=Math.min(aZ,aK)&&aN>=aJ+aE&&aN<=aJ+aX):(aQ>=aK+aE&&aQ<=aK+aX&&aN>=Math.min(aZ,aJ)&&aN<=Math.max(aZ,aJ))){aY=[aW,aU/aT]}}}}if(aY){aW=aY[0];aU=aY[1];aT=Q[aW].datapoints.pointsize;return{datapoint:Q[aW].datapoints.points.slice(aU*aT,(aU+1)*aT),dataIndex:aU,series:Q[aW],seriesIndex:aW}}return null}function aa(aB){if(O.grid.hoverable){u("plothover",aB,function(aC){return aC.hoverable!=false})}}function l(aB){if(O.grid.hoverable){u("plothover",aB,function(aC){return false})}}function R(aB){u("plotclick",aB,function(aC){return aC.clickable!=false})}function u(aC,aB,aD){var aE=y.offset(),aH=aB.pageX-aE.left-q.left,aF=aB.pageY-aE.top-q.top,aJ=C({left:aH,top:aF});aJ.pageX=aB.pageX;aJ.pageY=aB.pageY;var aK=K(aH,aF,aD);if(aK){aK.pageX=parseInt(aK.series.xaxis.p2c(aK.datapoint[0])+aE.left+q.left);aK.pageY=parseInt(aK.series.yaxis.p2c(aK.datapoint[1])+aE.top+q.top)}if(O.grid.autoHighlight){for(var aG=0;aGaH.max||aIaG.max){return}var aF=aE.points.radius+aE.points.lineWidth/2;A.lineWidth=aF;A.strokeStyle=c.color.parse(aE.color).scale("a",0.5).toString();var aB=1.5*aF,aC=aH.p2c(aC),aI=aG.p2c(aI);A.beginPath();if(aE.points.symbol=="circle"){A.arc(aC,aI,aB,0,2*Math.PI,false)}else{aE.points.symbol(A,aC,aI,aB,false)}A.closePath();A.stroke()}function v(aE,aB){A.lineWidth=aE.bars.lineWidth;A.strokeStyle=c.color.parse(aE.color).scale("a",0.5).toString();var aD=c.color.parse(aE.color).scale("a",0.5).toString();var aC=aE.bars.align=="left"?0:-aE.bars.barWidth/2;E(aB[0],aB[1],aB[2]||0,aC,aC+aE.bars.barWidth,0,function(){return aD},aE.xaxis,aE.yaxis,A,aE.bars.horizontal,aE.bars.lineWidth)}function am(aJ,aB,aH,aC){if(typeof aJ=="string"){return aJ}else{var aI=H.createLinearGradient(0,aH,0,aB);for(var aE=0,aD=aJ.colors.length;aE12){n=n-12}else{if(n==0){n=12}}}for(var g=0;g1){N.series.pie.tilt=1}if(N.series.pie.tilt<0){N.series.pie.tilt=0}O.hooks.processDatapoints.push(E);O.hooks.drawOverlay.push(H);O.hooks.draw.push(r)}}function e(P,N){var O=P.getOptions();if(O.series.pie.show&&O.grid.hoverable){N.unbind("mousemove").mousemove(t)}if(O.series.pie.show&&O.grid.clickable){N.unbind("click").click(l)}}function G(O){var P="";function N(S,T){if(!T){T=0}for(var R=0;Rh.width-n){B=h.width-n}}}function v(O){for(var N=0;N0){R.push({data:[[1,P]],color:N,label:a.series.pie.combine.label,angle:(P*(Math.PI*2))/M,percent:(P/M*100)})}return R}function r(S,Q){if(!L){return}ctx=Q;I();var T=S.getData();var P=0;while(F&&P0){n*=w}P+=1;N();if(a.series.pie.tilt<=0.8){O()}R()}if(P>=o){N();L.prepend('
      Could not draw pie with labels contained inside canvas
      ')}if(S.setSeries&&S.insertLegend){S.setSeries(T);S.insertLegend()}function N(){ctx.clearRect(0,0,h.width,h.height);L.children().filter(".pieLabel, .pieLabelBackground").remove()}function O(){var Z=5;var Y=15;var W=10;var X=0.02;if(a.series.pie.radius>1){var U=a.series.pie.radius}else{var U=n*a.series.pie.radius}if(U>=(h.width/2)-Z||U*a.series.pie.tilt>=(h.height/2)-Y||U<=W){return}ctx.save();ctx.translate(Z,Y);ctx.globalAlpha=X;ctx.fillStyle="#000";ctx.translate(B,p);ctx.scale(1,a.series.pie.tilt);for(var V=1;V<=W;V++){ctx.beginPath();ctx.arc(0,0,U,0,Math.PI*2,false);ctx.fill();U-=V}ctx.restore()}function R(){startAngle=Math.PI*a.series.pie.startAngle;if(a.series.pie.radius>1){var U=a.series.pie.radius}else{var U=n*a.series.pie.radius}ctx.save();ctx.translate(B,p);ctx.scale(1,a.series.pie.tilt);ctx.save();var Y=startAngle;for(var W=0;W1e-9){ctx.moveTo(0,0)}else{if(b.browser.msie){ab-=0.0001}}ctx.arc(0,0,U,Y,Y+ab,false);ctx.closePath();Y+=ab;if(aa){ctx.fill()}else{ctx.stroke()}}function V(){var ac=startAngle;if(a.series.pie.label.radius>1){var Z=a.series.pie.label.radius}else{var Z=n*a.series.pie.label.radius}for(var ab=0;ab=a.series.pie.label.threshold*100){aa(T[ab],ac,ab)}ac+=T[ab].angle}function aa(ap,ai,ag){if(ap.data[0][1]==0){return}var ar=a.legend.labelFormatter,aq,ae=a.series.pie.label.formatter;if(ar){aq=ar(ap.label,ap)}else{aq=ap.label}if(ae){aq=ae(aq,ap)}var aj=((ai+ap.angle)+ai)/2;var ao=B+Math.round(Math.cos(aj)*Z);var am=p+Math.round(Math.sin(aj)*Z)*a.series.pie.tilt;var af=''+aq+"";L.append(af);var an=L.children("#pieLabel"+ag);var ad=(am-an.height()/2);var ah=(ao-an.width()/2);an.css("top",ad);an.css("left",ah);if(0-ad>0||0-ah>0||h.height-(ad+an.height())<0||h.width-(ah+an.width())<0){F=true}if(a.series.pie.label.background.opacity!=0){var ak=a.series.pie.label.background.color;if(ak==null){ak=ap.color}var al="top:"+ad+"px;left:"+ah+"px;";b('
      ').insertBefore(an).css("opacity",a.series.pie.label.background.opacity)}}}}}function J(N){if(a.series.pie.innerRadius>0){N.save();innerRadius=a.series.pie.innerRadius>1?a.series.pie.innerRadius:n*a.series.pie.innerRadius;N.globalCompositeOperation="destination-out";N.beginPath();N.fillStyle=a.series.pie.stroke.color;N.arc(0,0,innerRadius,0,Math.PI*2,false);N.fill();N.closePath();N.restore();N.save();N.beginPath();N.strokeStyle=a.series.pie.stroke.color;N.arc(0,0,innerRadius,0,Math.PI*2,false);N.stroke();N.closePath();N.restore()}}function s(Q,R){for(var S=false,P=-1,N=Q.length,O=N-1;++P1?O.series.pie.radius:n*O.series.pie.radius;for(var Q=0;Q1?P.series.pie.radius:n*P.series.pie.radius;R.save();R.translate(B,p);R.scale(1,P.series.pie.tilt);for(i=0;i1e-9){R.moveTo(0,0)}R.arc(0,0,N,S.startAngle,S.startAngle+S.angle,false);R.closePath();R.fill()}}}var a={series:{pie:{show:false,radius:"auto",innerRadius:0,startAngle:3/2,tilt:1,offset:{top:0,left:"auto"},stroke:{color:"#FFF",width:1},label:{show:"auto",formatter:function(d,e){return'
      '+d+"
      "+Math.round(e.percent)+"%
      "},radius:1,background:{color:null,opacity:0},threshold:0},combine:{threshold:-1,color:null,label:"Other"},highlight:{opacity:0.5}}}};b.plot.plugins.push({init:c,options:a,name:"pie",version:"1.0"})})(jQuery); \ No newline at end of file diff --git a/target/disped-web/resources/js/jquery.flot.resize.min.js b/target/disped-web/resources/js/jquery.flot.resize.min.js new file mode 100644 index 0000000000000000000000000000000000000000..1fa0771f570ea1a6cfd9259fb02d707d279ca859 --- /dev/null +++ b/target/disped-web/resources/js/jquery.flot.resize.min.js @@ -0,0 +1 @@ +(function(n,p,u){var w=n([]),s=n.resize=n.extend(n.resize,{}),o,l="setTimeout",m="resize",t=m+"-special-event",v="delay",r="throttleWindow";s[v]=250;s[r]=true;n.event.special[m]={setup:function(){if(!s[r]&&this[l]){return false}var a=n(this);w=w.add(a);n.data(this,t,{w:a.width(),h:a.height()});if(w.length===1){q()}},teardown:function(){if(!s[r]&&this[l]){return false}var a=n(this);w=w.not(a);a.removeData(t);if(!w.length){clearTimeout(o)}},add:function(b){if(!s[r]&&this[l]){return false}var c;function a(d,h,g){var f=n(this),e=n.data(this,t);e.w=h!==u?h:f.width();e.h=g!==u?g:f.height();c.apply(this,arguments)}if(n.isFunction(b)){c=b;return a}else{c=b.handler;b.handler=a}}};function q(){o=p[l](function(){w.each(function(){var d=n(this),a=d.width(),b=d.height(),c=n.data(this,t);if(a!==c.w||b!==c.h){d.trigger(m,[c.w=a,c.h=b])}});q()},s[v])}})(jQuery,this);(function(b){var a={};function c(f){function e(){var h=f.getPlaceholder();if(h.width()==0||h.height()==0){return}f.resize();f.setupGrid();f.draw()}function g(i,h){i.getPlaceholder().resize(e)}function d(i,h){i.getPlaceholder().unbind("resize",e)}f.hooks.bindEvents.push(g);f.hooks.shutdown.push(d)}b.plot.plugins.push({init:c,options:a,name:"resize",version:"1.0"})})(jQuery); \ No newline at end of file diff --git a/target/disped-web/resources/js/jquery.gritter.min.js b/target/disped-web/resources/js/jquery.gritter.min.js new file mode 100644 index 0000000000000000000000000000000000000000..6481c9369f96dbda2f9bcbf3101e549c475dda50 --- /dev/null +++ b/target/disped-web/resources/js/jquery.gritter.min.js @@ -0,0 +1 @@ +(function(b){b.gritter={};b.gritter.options={position:"",class_name:"",fade_in_speed:"medium",fade_out_speed:1000,time:6000};b.gritter.add=function(f){try{return a.add(f||{})}catch(d){var c="Gritter Error: "+d;(typeof(console)!="undefined"&&console.error)?console.error(c,f):alert(c)}};b.gritter.remove=function(d,c){a.removeSpecific(d,c||{})};b.gritter.removeAll=function(c){a.stop(c||{})};var a={position:"",fade_in_speed:"",fade_out_speed:"",time:"",_custom_timer:0,_item_count:0,_is_setup:0,_tpl_close:'
      ',_tpl_title:'[[title]]',_tpl_item:'',_tpl_wrap:'
      ',add:function(g){if(typeof(g)=="string"){g={text:g}}if(!g.text){throw'You must supply "text" parameter.'}if(!this._is_setup){this._runSetup()}var k=g.title,n=g.text,e=g.image||"",l=g.sticky||false,m=g.class_name||b.gritter.options.class_name,j=b.gritter.options.position,d=g.time||"";this._verifyWrapper();this._item_count++;var f=this._item_count,i=this._tpl_item;b(["before_open","after_open","before_close","after_close"]).each(function(p,q){a["_"+q+"_"+f]=(b.isFunction(g[q]))?g[q]:function(){}});this._custom_timer=0;if(d){this._custom_timer=d}var c=(e!="")?'':"",h=(e!="")?"gritter-with-image":"gritter-without-image";if(k){k=this._str_replace("[[title]]",k,this._tpl_title)}else{k=""}i=this._str_replace(["[[title]]","[[text]]","[[close]]","[[image]]","[[number]]","[[class_name]]","[[item_class]]"],[k,n,this._tpl_close,c,this._item_count,h,m],i);if(this["_before_open_"+f]()===false){return false}b("#gritter-notice-wrapper").addClass(j).append(i);var o=b("#gritter-item-"+this._item_count);o.fadeIn(this.fade_in_speed,function(){a["_after_open_"+f](b(this))});if(!l){this._setFadeTimer(o,f)}b(o).bind("mouseenter mouseleave",function(p){if(p.type=="mouseenter"){if(!l){a._restoreItemIfFading(b(this),f)}}else{if(!l){a._setFadeTimer(b(this),f)}}a._hoverState(b(this),p.type)});b(o).find(".gritter-close").click(function(){a.removeSpecific(f,{},null,true)});return f},_countRemoveWrapper:function(c,d,f){d.remove();this["_after_close_"+c](d,f);if(b(".gritter-item-wrapper").length==0){b("#gritter-notice-wrapper").remove()}},_fade:function(g,d,j,f){var j=j||{},i=(typeof(j.fade)!="undefined")?j.fade:true,c=j.speed||this.fade_out_speed,h=f;this["_before_close_"+d](g,h);if(f){g.unbind("mouseenter mouseleave")}if(i){g.animate({opacity:0},c,function(){g.animate({height:0},300,function(){a._countRemoveWrapper(d,g,h)})})}else{this._countRemoveWrapper(d,g)}},_hoverState:function(d,c){if(c=="mouseenter"){d.addClass("hover");d.find(".gritter-close").show()}else{d.removeClass("hover");d.find(".gritter-close").hide()}},removeSpecific:function(c,g,f,d){if(!f){var f=b("#gritter-item-"+c)}this._fade(f,c,g||{},d)},_restoreItemIfFading:function(d,c){clearTimeout(this["_int_id_"+c]);d.stop().css({opacity:"",height:""})},_runSetup:function(){for(opt in b.gritter.options){this[opt]=b.gritter.options[opt]}this._is_setup=1},_setFadeTimer:function(f,d){var c=(this._custom_timer)?this._custom_timer:this.time;this["_int_id_"+d]=setTimeout(function(){a._fade(f,d)},c)},stop:function(e){var c=(b.isFunction(e.before_close))?e.before_close:function(){};var f=(b.isFunction(e.after_close))?e.after_close:function(){};var d=b("#gritter-notice-wrapper");c(d);d.fadeOut(function(){b(this).remove();f()})},_str_replace:function(v,e,o,n){var k=0,h=0,t="",m="",g=0,q=0,l=[].concat(v),c=[].concat(e),u=o,d=c instanceof Array,p=u instanceof Array;u=[].concat(u);if(n){this.window[n]=0}for(k=0,g=u.length;k").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"":"")+""),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;e=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
      a",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="
      "+""+"
      ",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="
      t
      ",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="
      ",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function( +a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&j.push({elem:this,matches:d.slice(e)});for(k=0;k0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

      ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
      ";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*",""],legend:[1,"
      ","
      "],thead:[1,"","
      "],tr:[2,"","
      "],td:[3,"","
      "],col:[2,"","
      "],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
      ","
      "]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f +.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(;d1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]===""&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
      ").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/target/disped-web/resources/js/jquery.peity.min.js b/target/disped-web/resources/js/jquery.peity.min.js new file mode 100644 index 0000000000000000000000000000000000000000..cec5761f48d2864ebb2b57a635f7a3849caac144 --- /dev/null +++ b/target/disped-web/resources/js/jquery.peity.min.js @@ -0,0 +1,12 @@ +// Peity jQuery plugin version 0.6.0 +// (c) 2011 Ben Pickles +// +// http://benpickles.github.com/peity/ +// +// Released under MIT license. +(function(i,k){function o(a,h){var b=k.createElement("canvas");b.setAttribute("width",a*m);b.setAttribute("height",h*m);m!=1&&b.setAttribute("style","width:"+a+"px;height:"+h+"px");return b}var g=i.fn.peity=function(a,h){k.createElement("canvas").getContext&&this.each(function(){i(this).change(function(){var b=i.extend({},h),d=this;i.each(b,function(a,c){i.isFunction(c)&&(b[a]=c.call(d))});var f=i(this).html();g.graphers[a].call(this,i.extend({},g.defaults[a],b));i(this).trigger("chart:changed",f)}).trigger("change")}); +return this};g.graphers={};g.defaults={};g.add=function(a,h,b){g.graphers[a]=b;g.defaults[a]=h};var m=window.devicePixelRatio||1;g.add("pie",{colours:["#FFF4DD","#FF9900"],delimeter:"/",diameter:16},function(a){var h=i(this),b=h.text().split(a.delimeter),d=parseFloat(b[0]),f=parseFloat(b[1]),b=-Math.PI/2,d=d/f*Math.PI*2,f=o(a.diameter,a.diameter),e=f.getContext("2d"),c=f.width/2;e.beginPath();e.moveTo(c,c);e.arc(c,c,c,d+b,d==0?Math.PI*2:b,!1);e.fillStyle=a.colours[0];e.fill();e.beginPath();e.moveTo(c, +c);e.arc(c,c,c,b,d+b,!1);e.fillStyle=a.colours[1];e.fill();h.wrapInner(i("").hide()).append(f)});g.add("line",{colour:"#c6d9fd",strokeColour:"#4d89f9",strokeWidth:1,delimeter:",",height:16,max:null,min:0,width:32},function(a){var h=i(this),b=o(a.width,a.height),d=h.text().split(a.delimeter);d.length==1&&d.push(d[0]);var f=Math.max.apply(Math,d.concat([a.max])),e=Math.min.apply(Math,d.concat([a.min])),c=b.getContext("2d"),g=b.width,l=b.height,q=g/(d.length-1),f=l/(f-e),n=[],j;c.beginPath();c.moveTo(0, +l+e*f);for(j=0;j").hide()).append(b)});g.add("bar",{colour:"#4D89F9",delimeter:",",height:16,max:null,min:0,width:32},function(a){var h=i(this),b=h.text().split(a.delimeter),d=Math.max.apply(Math, +b.concat([a.max])),f=Math.min.apply(Math,b.concat([a.min])),e=o(a.width,a.height),c=e.getContext("2d"),g=e.height,d=g/(d-f),l=m/2,k=(e.width+l)/b.length;c.fillStyle=a.colour;for(a=0;a").hide()).append(e)})})(jQuery,document); + diff --git a/target/disped-web/resources/js/jquery.toggle.buttons.html b/target/disped-web/resources/js/jquery.toggle.buttons.html new file mode 100644 index 0000000000000000000000000000000000000000..1229715285cd5f52b299a9dcf7936157626237ff --- /dev/null +++ b/target/disped-web/resources/js/jquery.toggle.buttons.html @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + Page not found - Theme Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +
      + + +
      +
      + + +
      +
      + +

      404 Not Found

      +

      Apologies, but the page you requested could not be found. Perhaps searching will help.

      +
      +

      +

      + + + +
      +
      + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/disped-web/resources/js/jquery.ui.custom.js b/target/disped-web/resources/js/jquery.ui.custom.js new file mode 100644 index 0000000000000000000000000000000000000000..41f6726137721852666e53fe5f6d3a20a867e3cb --- /dev/null +++ b/target/disped-web/resources/js/jquery.ui.custom.js @@ -0,0 +1,6160 @@ +/*! + * jQuery UI 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI + */ +(function( $, undefined ) { + +// prevent duplicate loading +// this is only a problem because we proxy existing functions +// and we don't want to double proxy them +$.ui = $.ui || {}; +if ( $.ui.version ) { + return; +} + +$.extend( $.ui, { + version: "1.8.21", + + keyCode: { + ALT: 18, + BACKSPACE: 8, + CAPS_LOCK: 20, + COMMA: 188, + COMMAND: 91, + COMMAND_LEFT: 91, // COMMAND + COMMAND_RIGHT: 93, + CONTROL: 17, + DELETE: 46, + DOWN: 40, + END: 35, + ENTER: 13, + ESCAPE: 27, + HOME: 36, + INSERT: 45, + LEFT: 37, + MENU: 93, // COMMAND_RIGHT + NUMPAD_ADD: 107, + NUMPAD_DECIMAL: 110, + NUMPAD_DIVIDE: 111, + NUMPAD_ENTER: 108, + NUMPAD_MULTIPLY: 106, + NUMPAD_SUBTRACT: 109, + PAGE_DOWN: 34, + PAGE_UP: 33, + PERIOD: 190, + RIGHT: 39, + SHIFT: 16, + SPACE: 32, + TAB: 9, + UP: 38, + WINDOWS: 91 // COMMAND + } +}); + +// plugins +$.fn.extend({ + propAttr: $.fn.prop || $.fn.attr, + + _focus: $.fn.focus, + focus: function( delay, fn ) { + return typeof delay === "number" ? + this.each(function() { + var elem = this; + setTimeout(function() { + $( elem ).focus(); + if ( fn ) { + fn.call( elem ); + } + }, delay ); + }) : + this._focus.apply( this, arguments ); + }, + + scrollParent: function() { + var scrollParent; + if (($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) { + scrollParent = this.parents().filter(function() { + return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); + }).eq(0); + } else { + scrollParent = this.parents().filter(function() { + return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); + }).eq(0); + } + + return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent; + }, + + zIndex: function( zIndex ) { + if ( zIndex !== undefined ) { + return this.css( "zIndex", zIndex ); + } + + if ( this.length ) { + var elem = $( this[ 0 ] ), position, value; + while ( elem.length && elem[ 0 ] !== document ) { + // Ignore z-index if position is set to a value where z-index is ignored by the browser + // This makes behavior of this function consistent across browsers + // WebKit always returns auto if the element is positioned + position = elem.css( "position" ); + if ( position === "absolute" || position === "relative" || position === "fixed" ) { + // IE returns 0 when zIndex is not specified + // other browsers return a string + // we ignore the case of nested elements with an explicit value of 0 + //
      + value = parseInt( elem.css( "zIndex" ), 10 ); + if ( !isNaN( value ) && value !== 0 ) { + return value; + } + } + elem = elem.parent(); + } + } + + return 0; + }, + + disableSelection: function() { + return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) + + ".ui-disableSelection", function( event ) { + event.preventDefault(); + }); + }, + + enableSelection: function() { + return this.unbind( ".ui-disableSelection" ); + } +}); + +$.each( [ "Width", "Height" ], function( i, name ) { + var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ], + type = name.toLowerCase(), + orig = { + innerWidth: $.fn.innerWidth, + innerHeight: $.fn.innerHeight, + outerWidth: $.fn.outerWidth, + outerHeight: $.fn.outerHeight + }; + + function reduce( elem, size, border, margin ) { + $.each( side, function() { + size -= parseFloat( $.curCSS( elem, "padding" + this, true) ) || 0; + if ( border ) { + size -= parseFloat( $.curCSS( elem, "border" + this + "Width", true) ) || 0; + } + if ( margin ) { + size -= parseFloat( $.curCSS( elem, "margin" + this, true) ) || 0; + } + }); + return size; + } + + $.fn[ "inner" + name ] = function( size ) { + if ( size === undefined ) { + return orig[ "inner" + name ].call( this ); + } + + return this.each(function() { + $( this ).css( type, reduce( this, size ) + "px" ); + }); + }; + + $.fn[ "outer" + name] = function( size, margin ) { + if ( typeof size !== "number" ) { + return orig[ "outer" + name ].call( this, size ); + } + + return this.each(function() { + $( this).css( type, reduce( this, size, true, margin ) + "px" ); + }); + }; +}); + +// selectors +function focusable( element, isTabIndexNotNaN ) { + var nodeName = element.nodeName.toLowerCase(); + if ( "area" === nodeName ) { + var map = element.parentNode, + mapName = map.name, + img; + if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) { + return false; + } + img = $( "img[usemap=#" + mapName + "]" )[0]; + return !!img && visible( img ); + } + return ( /input|select|textarea|button|object/.test( nodeName ) + ? !element.disabled + : "a" == nodeName + ? element.href || isTabIndexNotNaN + : isTabIndexNotNaN) + // the element and all of its ancestors must be visible + && visible( element ); +} + +function visible( element ) { + return !$( element ).parents().andSelf().filter(function() { + return $.curCSS( this, "visibility" ) === "hidden" || + $.expr.filters.hidden( this ); + }).length; +} + +$.extend( $.expr[ ":" ], { + data: function( elem, i, match ) { + return !!$.data( elem, match[ 3 ] ); + }, + + focusable: function( element ) { + return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) ); + }, + + tabbable: function( element ) { + var tabIndex = $.attr( element, "tabindex" ), + isTabIndexNaN = isNaN( tabIndex ); + return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN ); + } +}); + +// support +$(function() { + var body = document.body, + div = body.appendChild( div = document.createElement( "div" ) ); + + // access offsetHeight before setting the style to prevent a layout bug + // in IE 9 which causes the elemnt to continue to take up space even + // after it is removed from the DOM (#8026) + div.offsetHeight; + + $.extend( div.style, { + minHeight: "100px", + height: "auto", + padding: 0, + borderWidth: 0 + }); + + $.support.minHeight = div.offsetHeight === 100; + $.support.selectstart = "onselectstart" in div; + + // set display to none to avoid a layout bug in IE + // http://dev.jquery.com/ticket/4014 + body.removeChild( div ).style.display = "none"; +}); + + + + + +// deprecated +$.extend( $.ui, { + // $.ui.plugin is deprecated. Use the proxy pattern instead. + plugin: { + add: function( module, option, set ) { + var proto = $.ui[ module ].prototype; + for ( var i in set ) { + proto.plugins[ i ] = proto.plugins[ i ] || []; + proto.plugins[ i ].push( [ option, set[ i ] ] ); + } + }, + call: function( instance, name, args ) { + var set = instance.plugins[ name ]; + if ( !set || !instance.element[ 0 ].parentNode ) { + return; + } + + for ( var i = 0; i < set.length; i++ ) { + if ( instance.options[ set[ i ][ 0 ] ] ) { + set[ i ][ 1 ].apply( instance.element, args ); + } + } + } + }, + + // will be deprecated when we switch to jQuery 1.4 - use jQuery.contains() + contains: function( a, b ) { + return document.compareDocumentPosition ? + a.compareDocumentPosition( b ) & 16 : + a !== b && a.contains( b ); + }, + + // only used by resizable + hasScroll: function( el, a ) { + + //If overflow is hidden, the element might have extra content, but the user wants to hide it + if ( $( el ).css( "overflow" ) === "hidden") { + return false; + } + + var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop", + has = false; + + if ( el[ scroll ] > 0 ) { + return true; + } + + // TODO: determine which cases actually cause this to happen + // if the element doesn't have the scroll set, see if it's possible to + // set the scroll + el[ scroll ] = 1; + has = ( el[ scroll ] > 0 ); + el[ scroll ] = 0; + return has; + }, + + // these are odd functions, fix the API or move into individual plugins + isOverAxis: function( x, reference, size ) { + //Determines when x coordinate is over "b" element axis + return ( x > reference ) && ( x < ( reference + size ) ); + }, + isOver: function( y, x, top, left, height, width ) { + //Determines when x, y coordinates is over "b" element + return $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width ); + } +}); + +})( jQuery ); +/*! + * jQuery UI Widget 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Widget + */ +(function( $, undefined ) { + +// jQuery 1.4+ +if ( $.cleanData ) { + var _cleanData = $.cleanData; + $.cleanData = function( elems ) { + for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { + try { + $( elem ).triggerHandler( "remove" ); + // http://bugs.jquery.com/ticket/8235 + } catch( e ) {} + } + _cleanData( elems ); + }; +} else { + var _remove = $.fn.remove; + $.fn.remove = function( selector, keepData ) { + return this.each(function() { + if ( !keepData ) { + if ( !selector || $.filter( selector, [ this ] ).length ) { + $( "*", this ).add( [ this ] ).each(function() { + try { + $( this ).triggerHandler( "remove" ); + // http://bugs.jquery.com/ticket/8235 + } catch( e ) {} + }); + } + } + return _remove.call( $(this), selector, keepData ); + }); + }; +} + +$.widget = function( name, base, prototype ) { + var namespace = name.split( "." )[ 0 ], + fullName; + name = name.split( "." )[ 1 ]; + fullName = namespace + "-" + name; + + if ( !prototype ) { + prototype = base; + base = $.Widget; + } + + // create selector for plugin + $.expr[ ":" ][ fullName ] = function( elem ) { + return !!$.data( elem, name ); + }; + + $[ namespace ] = $[ namespace ] || {}; + $[ namespace ][ name ] = function( options, element ) { + // allow instantiation without initializing for simple inheritance + if ( arguments.length ) { + this._createWidget( options, element ); + } + }; + + var basePrototype = new base(); + // we need to make the options hash a property directly on the new instance + // otherwise we'll modify the options hash on the prototype that we're + // inheriting from +// $.each( basePrototype, function( key, val ) { +// if ( $.isPlainObject(val) ) { +// basePrototype[ key ] = $.extend( {}, val ); +// } +// }); + basePrototype.options = $.extend( true, {}, basePrototype.options ); + $[ namespace ][ name ].prototype = $.extend( true, basePrototype, { + namespace: namespace, + widgetName: name, + widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name, + widgetBaseClass: fullName + }, prototype ); + + $.widget.bridge( name, $[ namespace ][ name ] ); +}; + +$.widget.bridge = function( name, object ) { + $.fn[ name ] = function( options ) { + var isMethodCall = typeof options === "string", + args = Array.prototype.slice.call( arguments, 1 ), + returnValue = this; + + // allow multiple hashes to be passed on init + options = !isMethodCall && args.length ? + $.extend.apply( null, [ true, options ].concat(args) ) : + options; + + // prevent calls to internal methods + if ( isMethodCall && options.charAt( 0 ) === "_" ) { + return returnValue; + } + + if ( isMethodCall ) { + this.each(function() { + var instance = $.data( this, name ), + methodValue = instance && $.isFunction( instance[options] ) ? + instance[ options ].apply( instance, args ) : + instance; + // TODO: add this back in 1.9 and use $.error() (see #5972) +// if ( !instance ) { +// throw "cannot call methods on " + name + " prior to initialization; " + +// "attempted to call method '" + options + "'"; +// } +// if ( !$.isFunction( instance[options] ) ) { +// throw "no such method '" + options + "' for " + name + " widget instance"; +// } +// var methodValue = instance[ options ].apply( instance, args ); + if ( methodValue !== instance && methodValue !== undefined ) { + returnValue = methodValue; + return false; + } + }); + } else { + this.each(function() { + var instance = $.data( this, name ); + if ( instance ) { + instance.option( options || {} )._init(); + } else { + $.data( this, name, new object( options, this ) ); + } + }); + } + + return returnValue; + }; +}; + +$.Widget = function( options, element ) { + // allow instantiation without initializing for simple inheritance + if ( arguments.length ) { + this._createWidget( options, element ); + } +}; + +$.Widget.prototype = { + widgetName: "widget", + widgetEventPrefix: "", + options: { + disabled: false + }, + _createWidget: function( options, element ) { + // $.widget.bridge stores the plugin instance, but we do it anyway + // so that it's stored even before the _create function runs + $.data( element, this.widgetName, this ); + this.element = $( element ); + this.options = $.extend( true, {}, + this.options, + this._getCreateOptions(), + options ); + + var self = this; + this.element.bind( "remove." + this.widgetName, function() { + self.destroy(); + }); + + this._create(); + this._trigger( "create" ); + this._init(); + }, + _getCreateOptions: function() { + return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ]; + }, + _create: function() {}, + _init: function() {}, + + destroy: function() { + this.element + .unbind( "." + this.widgetName ) + .removeData( this.widgetName ); + this.widget() + .unbind( "." + this.widgetName ) + .removeAttr( "aria-disabled" ) + .removeClass( + this.widgetBaseClass + "-disabled " + + "ui-state-disabled" ); + }, + + widget: function() { + return this.element; + }, + + option: function( key, value ) { + var options = key; + + if ( arguments.length === 0 ) { + // don't return a reference to the internal hash + return $.extend( {}, this.options ); + } + + if (typeof key === "string" ) { + if ( value === undefined ) { + return this.options[ key ]; + } + options = {}; + options[ key ] = value; + } + + this._setOptions( options ); + + return this; + }, + _setOptions: function( options ) { + var self = this; + $.each( options, function( key, value ) { + self._setOption( key, value ); + }); + + return this; + }, + _setOption: function( key, value ) { + this.options[ key ] = value; + + if ( key === "disabled" ) { + this.widget() + [ value ? "addClass" : "removeClass"]( + this.widgetBaseClass + "-disabled" + " " + + "ui-state-disabled" ) + .attr( "aria-disabled", value ); + } + + return this; + }, + + enable: function() { + return this._setOption( "disabled", false ); + }, + disable: function() { + return this._setOption( "disabled", true ); + }, + + _trigger: function( type, event, data ) { + var prop, orig, + callback = this.options[ type ]; + + data = data || {}; + event = $.Event( event ); + event.type = ( type === this.widgetEventPrefix ? + type : + this.widgetEventPrefix + type ).toLowerCase(); + // the original event may come from any element + // so we need to reset the target on the new event + event.target = this.element[ 0 ]; + + // copy original event properties over to the new event + orig = event.originalEvent; + if ( orig ) { + for ( prop in orig ) { + if ( !( prop in event ) ) { + event[ prop ] = orig[ prop ]; + } + } + } + + this.element.trigger( event, data ); + + return !( $.isFunction(callback) && + callback.call( this.element[0], event, data ) === false || + event.isDefaultPrevented() ); + } +}; + +})( jQuery ); +/*! + * jQuery UI Mouse 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Mouse + * + * Depends: + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +var mouseHandled = false; +$( document ).mouseup( function( e ) { + mouseHandled = false; +}); + +$.widget("ui.mouse", { + options: { + cancel: ':input,option', + distance: 1, + delay: 0 + }, + _mouseInit: function() { + var self = this; + + this.element + .bind('mousedown.'+this.widgetName, function(event) { + return self._mouseDown(event); + }) + .bind('click.'+this.widgetName, function(event) { + if (true === $.data(event.target, self.widgetName + '.preventClickEvent')) { + $.removeData(event.target, self.widgetName + '.preventClickEvent'); + event.stopImmediatePropagation(); + return false; + } + }); + + this.started = false; + }, + + // TODO: make sure destroying one instance of mouse doesn't mess with + // other instances of mouse + _mouseDestroy: function() { + this.element.unbind('.'+this.widgetName); + $(document) + .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate) + .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate); + }, + + _mouseDown: function(event) { + // don't let more than one widget handle mouseStart + if( mouseHandled ) { return }; + + // we may have missed mouseup (out of window) + (this._mouseStarted && this._mouseUp(event)); + + this._mouseDownEvent = event; + + var self = this, + btnIsLeft = (event.which == 1), + // event.target.nodeName works around a bug in IE 8 with + // disabled inputs (#7620) + elIsCancel = (typeof this.options.cancel == "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false); + if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) { + return true; + } + + this.mouseDelayMet = !this.options.delay; + if (!this.mouseDelayMet) { + this._mouseDelayTimer = setTimeout(function() { + self.mouseDelayMet = true; + }, this.options.delay); + } + + if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { + this._mouseStarted = (this._mouseStart(event) !== false); + if (!this._mouseStarted) { + event.preventDefault(); + return true; + } + } + + // Click event may never have fired (Gecko & Opera) + if (true === $.data(event.target, this.widgetName + '.preventClickEvent')) { + $.removeData(event.target, this.widgetName + '.preventClickEvent'); + } + + // these delegates are required to keep context + this._mouseMoveDelegate = function(event) { + return self._mouseMove(event); + }; + this._mouseUpDelegate = function(event) { + return self._mouseUp(event); + }; + $(document) + .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate) + .bind('mouseup.'+this.widgetName, this._mouseUpDelegate); + + event.preventDefault(); + + mouseHandled = true; + return true; + }, + + _mouseMove: function(event) { + // IE mouseup check - mouseup happened when mouse was out of window + if ($.browser.msie && !(document.documentMode >= 9) && !event.button) { + return this._mouseUp(event); + } + + if (this._mouseStarted) { + this._mouseDrag(event); + return event.preventDefault(); + } + + if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { + this._mouseStarted = + (this._mouseStart(this._mouseDownEvent, event) !== false); + (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event)); + } + + return !this._mouseStarted; + }, + + _mouseUp: function(event) { + $(document) + .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate) + .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate); + + if (this._mouseStarted) { + this._mouseStarted = false; + + if (event.target == this._mouseDownEvent.target) { + $.data(event.target, this.widgetName + '.preventClickEvent', true); + } + + this._mouseStop(event); + } + + return false; + }, + + _mouseDistanceMet: function(event) { + return (Math.max( + Math.abs(this._mouseDownEvent.pageX - event.pageX), + Math.abs(this._mouseDownEvent.pageY - event.pageY) + ) >= this.options.distance + ); + }, + + _mouseDelayMet: function(event) { + return this.mouseDelayMet; + }, + + // These are placeholder methods, to be overriden by extending plugin + _mouseStart: function(event) {}, + _mouseDrag: function(event) {}, + _mouseStop: function(event) {}, + _mouseCapture: function(event) { return true; } +}); + +})(jQuery); +/*! + * jQuery UI Position 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Position + */ +(function( $, undefined ) { + +$.ui = $.ui || {}; + +var horizontalPositions = /left|center|right/, + verticalPositions = /top|center|bottom/, + center = "center", + support = {}, + _position = $.fn.position, + _offset = $.fn.offset; + +$.fn.position = function( options ) { + if ( !options || !options.of ) { + return _position.apply( this, arguments ); + } + + // make a copy, we don't want to modify arguments + options = $.extend( {}, options ); + + var target = $( options.of ), + targetElem = target[0], + collision = ( options.collision || "flip" ).split( " " ), + offset = options.offset ? options.offset.split( " " ) : [ 0, 0 ], + targetWidth, + targetHeight, + basePosition; + + if ( targetElem.nodeType === 9 ) { + targetWidth = target.width(); + targetHeight = target.height(); + basePosition = { top: 0, left: 0 }; + // TODO: use $.isWindow() in 1.9 + } else if ( targetElem.setTimeout ) { + targetWidth = target.width(); + targetHeight = target.height(); + basePosition = { top: target.scrollTop(), left: target.scrollLeft() }; + } else if ( targetElem.preventDefault ) { + // force left top to allow flipping + options.at = "left top"; + targetWidth = targetHeight = 0; + basePosition = { top: options.of.pageY, left: options.of.pageX }; + } else { + targetWidth = target.outerWidth(); + targetHeight = target.outerHeight(); + basePosition = target.offset(); + } + + // force my and at to have valid horizontal and veritcal positions + // if a value is missing or invalid, it will be converted to center + $.each( [ "my", "at" ], function() { + var pos = ( options[this] || "" ).split( " " ); + if ( pos.length === 1) { + pos = horizontalPositions.test( pos[0] ) ? + pos.concat( [center] ) : + verticalPositions.test( pos[0] ) ? + [ center ].concat( pos ) : + [ center, center ]; + } + pos[ 0 ] = horizontalPositions.test( pos[0] ) ? pos[ 0 ] : center; + pos[ 1 ] = verticalPositions.test( pos[1] ) ? pos[ 1 ] : center; + options[ this ] = pos; + }); + + // normalize collision option + if ( collision.length === 1 ) { + collision[ 1 ] = collision[ 0 ]; + } + + // normalize offset option + offset[ 0 ] = parseInt( offset[0], 10 ) || 0; + if ( offset.length === 1 ) { + offset[ 1 ] = offset[ 0 ]; + } + offset[ 1 ] = parseInt( offset[1], 10 ) || 0; + + if ( options.at[0] === "right" ) { + basePosition.left += targetWidth; + } else if ( options.at[0] === center ) { + basePosition.left += targetWidth / 2; + } + + if ( options.at[1] === "bottom" ) { + basePosition.top += targetHeight; + } else if ( options.at[1] === center ) { + basePosition.top += targetHeight / 2; + } + + basePosition.left += offset[ 0 ]; + basePosition.top += offset[ 1 ]; + + return this.each(function() { + var elem = $( this ), + elemWidth = elem.outerWidth(), + elemHeight = elem.outerHeight(), + marginLeft = parseInt( $.curCSS( this, "marginLeft", true ) ) || 0, + marginTop = parseInt( $.curCSS( this, "marginTop", true ) ) || 0, + collisionWidth = elemWidth + marginLeft + + ( parseInt( $.curCSS( this, "marginRight", true ) ) || 0 ), + collisionHeight = elemHeight + marginTop + + ( parseInt( $.curCSS( this, "marginBottom", true ) ) || 0 ), + position = $.extend( {}, basePosition ), + collisionPosition; + + if ( options.my[0] === "right" ) { + position.left -= elemWidth; + } else if ( options.my[0] === center ) { + position.left -= elemWidth / 2; + } + + if ( options.my[1] === "bottom" ) { + position.top -= elemHeight; + } else if ( options.my[1] === center ) { + position.top -= elemHeight / 2; + } + + // prevent fractions if jQuery version doesn't support them (see #5280) + if ( !support.fractions ) { + position.left = Math.round( position.left ); + position.top = Math.round( position.top ); + } + + collisionPosition = { + left: position.left - marginLeft, + top: position.top - marginTop + }; + + $.each( [ "left", "top" ], function( i, dir ) { + if ( $.ui.position[ collision[i] ] ) { + $.ui.position[ collision[i] ][ dir ]( position, { + targetWidth: targetWidth, + targetHeight: targetHeight, + elemWidth: elemWidth, + elemHeight: elemHeight, + collisionPosition: collisionPosition, + collisionWidth: collisionWidth, + collisionHeight: collisionHeight, + offset: offset, + my: options.my, + at: options.at + }); + } + }); + + if ( $.fn.bgiframe ) { + elem.bgiframe(); + } + elem.offset( $.extend( position, { using: options.using } ) ); + }); +}; + +$.ui.position = { + fit: { + left: function( position, data ) { + var win = $( window ), + over = data.collisionPosition.left + data.collisionWidth - win.width() - win.scrollLeft(); + position.left = over > 0 ? position.left - over : Math.max( position.left - data.collisionPosition.left, position.left ); + }, + top: function( position, data ) { + var win = $( window ), + over = data.collisionPosition.top + data.collisionHeight - win.height() - win.scrollTop(); + position.top = over > 0 ? position.top - over : Math.max( position.top - data.collisionPosition.top, position.top ); + } + }, + + flip: { + left: function( position, data ) { + if ( data.at[0] === center ) { + return; + } + var win = $( window ), + over = data.collisionPosition.left + data.collisionWidth - win.width() - win.scrollLeft(), + myOffset = data.my[ 0 ] === "left" ? + -data.elemWidth : + data.my[ 0 ] === "right" ? + data.elemWidth : + 0, + atOffset = data.at[ 0 ] === "left" ? + data.targetWidth : + -data.targetWidth, + offset = -2 * data.offset[ 0 ]; + position.left += data.collisionPosition.left < 0 ? + myOffset + atOffset + offset : + over > 0 ? + myOffset + atOffset + offset : + 0; + }, + top: function( position, data ) { + if ( data.at[1] === center ) { + return; + } + var win = $( window ), + over = data.collisionPosition.top + data.collisionHeight - win.height() - win.scrollTop(), + myOffset = data.my[ 1 ] === "top" ? + -data.elemHeight : + data.my[ 1 ] === "bottom" ? + data.elemHeight : + 0, + atOffset = data.at[ 1 ] === "top" ? + data.targetHeight : + -data.targetHeight, + offset = -2 * data.offset[ 1 ]; + position.top += data.collisionPosition.top < 0 ? + myOffset + atOffset + offset : + over > 0 ? + myOffset + atOffset + offset : + 0; + } + } +}; + +// offset setter from jQuery 1.4 +if ( !$.offset.setOffset ) { + $.offset.setOffset = function( elem, options ) { + // set position first, in-case top/left are set even on static elem + if ( /static/.test( $.curCSS( elem, "position" ) ) ) { + elem.style.position = "relative"; + } + var curElem = $( elem ), + curOffset = curElem.offset(), + curTop = parseInt( $.curCSS( elem, "top", true ), 10 ) || 0, + curLeft = parseInt( $.curCSS( elem, "left", true ), 10) || 0, + props = { + top: (options.top - curOffset.top) + curTop, + left: (options.left - curOffset.left) + curLeft + }; + + if ( 'using' in options ) { + options.using.call( elem, props ); + } else { + curElem.css( props ); + } + }; + + $.fn.offset = function( options ) { + var elem = this[ 0 ]; + if ( !elem || !elem.ownerDocument ) { return null; } + if ( options ) { + if ( $.isFunction( options ) ) { + return this.each(function( i ) { + $( this ).offset( options.call( this, i, $( this ).offset() ) ); + }); + } + return this.each(function() { + $.offset.setOffset( this, options ); + }); + } + return _offset.call( this ); + }; +} + +// fraction support test (older versions of jQuery don't support fractions) +(function () { + var body = document.getElementsByTagName( "body" )[ 0 ], + div = document.createElement( "div" ), + testElement, testElementParent, testElementStyle, offset, offsetTotal; + + //Create a "fake body" for testing based on method used in jQuery.support + testElement = document.createElement( body ? "div" : "body" ); + testElementStyle = { + visibility: "hidden", + width: 0, + height: 0, + border: 0, + margin: 0, + background: "none" + }; + if ( body ) { + $.extend( testElementStyle, { + position: "absolute", + left: "-1000px", + top: "-1000px" + }); + } + for ( var i in testElementStyle ) { + testElement.style[ i ] = testElementStyle[ i ]; + } + testElement.appendChild( div ); + testElementParent = body || document.documentElement; + testElementParent.insertBefore( testElement, testElementParent.firstChild ); + + div.style.cssText = "position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;"; + + offset = $( div ).offset( function( _, offset ) { + return offset; + }).offset(); + + testElement.innerHTML = ""; + testElementParent.removeChild( testElement ); + + offsetTotal = offset.top + offset.left + ( body ? 2000 : 0 ); + support.fractions = offsetTotal > 21 && offsetTotal < 22; +})(); + +}( jQuery )); +/*! + * jQuery UI Draggable 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Draggables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget("ui.draggable", $.ui.mouse, { + widgetEventPrefix: "drag", + options: { + addClasses: true, + appendTo: "parent", + axis: false, + connectToSortable: false, + containment: false, + cursor: "auto", + cursorAt: false, + grid: false, + handle: false, + helper: "original", + iframeFix: false, + opacity: false, + refreshPositions: false, + revert: false, + revertDuration: 500, + scope: "default", + scroll: true, + scrollSensitivity: 20, + scrollSpeed: 20, + snap: false, + snapMode: "both", + snapTolerance: 20, + stack: false, + zIndex: false + }, + _create: function() { + + if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position"))) + this.element[0].style.position = 'relative'; + + (this.options.addClasses && this.element.addClass("ui-draggable")); + (this.options.disabled && this.element.addClass("ui-draggable-disabled")); + + this._mouseInit(); + + }, + + destroy: function() { + if(!this.element.data('draggable')) return; + this.element + .removeData("draggable") + .unbind(".draggable") + .removeClass("ui-draggable" + + " ui-draggable-dragging" + + " ui-draggable-disabled"); + this._mouseDestroy(); + + return this; + }, + + _mouseCapture: function(event) { + + var o = this.options; + + // among others, prevent a drag on a resizable-handle + if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle')) + return false; + + //Quit if we're not on a valid handle + this.handle = this._getHandle(event); + if (!this.handle) + return false; + + if ( o.iframeFix ) { + $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() { + $('
      ') + .css({ + width: this.offsetWidth+"px", height: this.offsetHeight+"px", + position: "absolute", opacity: "0.001", zIndex: 1000 + }) + .css($(this).offset()) + .appendTo("body"); + }); + } + + return true; + + }, + + _mouseStart: function(event) { + + var o = this.options; + + //Create and append the visible helper + this.helper = this._createHelper(event); + + this.helper.addClass("ui-draggable-dragging"); + + //Cache the helper size + this._cacheHelperProportions(); + + //If ddmanager is used for droppables, set the global draggable + if($.ui.ddmanager) + $.ui.ddmanager.current = this; + + /* + * - Position generation - + * This block generates everything position related - it's the core of draggables. + */ + + //Cache the margins of the original element + this._cacheMargins(); + + //Store the helper's css position + this.cssPosition = this.helper.css("position"); + this.scrollParent = this.helper.scrollParent(); + + //The element's absolute position on the page minus margins + this.offset = this.positionAbs = this.element.offset(); + this.offset = { + top: this.offset.top - this.margins.top, + left: this.offset.left - this.margins.left + }; + + $.extend(this.offset, { + click: { //Where the click happened, relative to the element + left: event.pageX - this.offset.left, + top: event.pageY - this.offset.top + }, + parent: this._getParentOffset(), + relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper + }); + + //Generate the original position + this.originalPosition = this.position = this._generatePosition(event); + this.originalPageX = event.pageX; + this.originalPageY = event.pageY; + + //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied + (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt)); + + //Set a containment if given in the options + if(o.containment) + this._setContainment(); + + //Trigger event + callbacks + if(this._trigger("start", event) === false) { + this._clear(); + return false; + } + + //Recache the helper size + this._cacheHelperProportions(); + + //Prepare the droppable offsets + if ($.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(this, event); + + + this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position + + //If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003) + if ( $.ui.ddmanager ) $.ui.ddmanager.dragStart(this, event); + + return true; + }, + + _mouseDrag: function(event, noPropagation) { + + //Compute the helpers position + this.position = this._generatePosition(event); + this.positionAbs = this._convertPositionTo("absolute"); + + //Call plugins and callbacks and use the resulting position if something is returned + if (!noPropagation) { + var ui = this._uiHash(); + if(this._trigger('drag', event, ui) === false) { + this._mouseUp({}); + return false; + } + this.position = ui.position; + } + + if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px'; + if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px'; + if($.ui.ddmanager) $.ui.ddmanager.drag(this, event); + + return false; + }, + + _mouseStop: function(event) { + + //If we are using droppables, inform the manager about the drop + var dropped = false; + if ($.ui.ddmanager && !this.options.dropBehaviour) + dropped = $.ui.ddmanager.drop(this, event); + + //if a drop comes from outside (a sortable) + if(this.dropped) { + dropped = this.dropped; + this.dropped = false; + } + + //if the original element is no longer in the DOM don't bother to continue (see #8269) + var element = this.element[0], elementInDom = false; + while ( element && (element = element.parentNode) ) { + if (element == document ) { + elementInDom = true; + } + } + if ( !elementInDom && this.options.helper === "original" ) + return false; + + if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) { + var self = this; + $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() { + if(self._trigger("stop", event) !== false) { + self._clear(); + } + }); + } else { + if(this._trigger("stop", event) !== false) { + this._clear(); + } + } + + return false; + }, + + _mouseUp: function(event) { + if (this.options.iframeFix === true) { + $("div.ui-draggable-iframeFix").each(function() { + this.parentNode.removeChild(this); + }); //Remove frame helpers + } + + //If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003) + if( $.ui.ddmanager ) $.ui.ddmanager.dragStop(this, event); + + return $.ui.mouse.prototype._mouseUp.call(this, event); + }, + + cancel: function() { + + if(this.helper.is(".ui-draggable-dragging")) { + this._mouseUp({}); + } else { + this._clear(); + } + + return this; + + }, + + _getHandle: function(event) { + + var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false; + $(this.options.handle, this.element) + .find("*") + .andSelf() + .each(function() { + if(this == event.target) handle = true; + }); + + return handle; + + }, + + _createHelper: function(event) { + + var o = this.options; + var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone().removeAttr('id') : this.element); + + if(!helper.parents('body').length) + helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo)); + + if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) + helper.css("position", "absolute"); + + return helper; + + }, + + _adjustOffsetFromHelper: function(obj) { + if (typeof obj == 'string') { + obj = obj.split(' '); + } + if ($.isArray(obj)) { + obj = {left: +obj[0], top: +obj[1] || 0}; + } + if ('left' in obj) { + this.offset.click.left = obj.left + this.margins.left; + } + if ('right' in obj) { + this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; + } + if ('top' in obj) { + this.offset.click.top = obj.top + this.margins.top; + } + if ('bottom' in obj) { + this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; + } + }, + + _getParentOffset: function() { + + //Get the offsetParent and cache its position + this.offsetParent = this.helper.offsetParent(); + var po = this.offsetParent.offset(); + + // This is a special case where we need to modify a offset calculated on start, since the following happened: + // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent + // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that + // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag + if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) { + po.left += this.scrollParent.scrollLeft(); + po.top += this.scrollParent.scrollTop(); + } + + if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information + || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix + po = { top: 0, left: 0 }; + + return { + top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), + left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) + }; + + }, + + _getRelativeOffset: function() { + + if(this.cssPosition == "relative") { + var p = this.element.position(); + return { + top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(), + left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft() + }; + } else { + return { top: 0, left: 0 }; + } + + }, + + _cacheMargins: function() { + this.margins = { + left: (parseInt(this.element.css("marginLeft"),10) || 0), + top: (parseInt(this.element.css("marginTop"),10) || 0), + right: (parseInt(this.element.css("marginRight"),10) || 0), + bottom: (parseInt(this.element.css("marginBottom"),10) || 0) + }; + }, + + _cacheHelperProportions: function() { + this.helperProportions = { + width: this.helper.outerWidth(), + height: this.helper.outerHeight() + }; + }, + + _setContainment: function() { + + var o = this.options; + if(o.containment == 'parent') o.containment = this.helper[0].parentNode; + if(o.containment == 'document' || o.containment == 'window') this.containment = [ + o.containment == 'document' ? 0 : $(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, + o.containment == 'document' ? 0 : $(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, + (o.containment == 'document' ? 0 : $(window).scrollLeft()) + $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left, + (o.containment == 'document' ? 0 : $(window).scrollTop()) + ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top + ]; + + if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) { + var c = $(o.containment); + var ce = c[0]; if(!ce) return; + var co = c.offset(); + var over = ($(ce).css("overflow") != 'hidden'); + + this.containment = [ + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0), + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0), + (over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, + (over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom + ]; + this.relative_container = c; + + } else if(o.containment.constructor == Array) { + this.containment = o.containment; + } + + }, + + _convertPositionTo: function(d, pos) { + + if(!pos) pos = this.position; + var mod = d == "absolute" ? 1 : -1; + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + + return { + top: ( + pos.top // The absolute mouse position + + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border) + - ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod) + ), + left: ( + pos.left // The absolute mouse position + + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border) + - ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod) + ) + }; + + }, + + _generatePosition: function(event) { + + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + var pageX = event.pageX; + var pageY = event.pageY; + + /* + * - Position constraining - + * Constrain the position to a mix of grid, containment. + */ + + if(this.originalPosition) { //If we are not dragging yet, we won't check for options + var containment; + if(this.containment) { + if (this.relative_container){ + var co = this.relative_container.offset(); + containment = [ this.containment[0] + co.left, + this.containment[1] + co.top, + this.containment[2] + co.left, + this.containment[3] + co.top ]; + } + else { + containment = this.containment; + } + + if(event.pageX - this.offset.click.left < containment[0]) pageX = containment[0] + this.offset.click.left; + if(event.pageY - this.offset.click.top < containment[1]) pageY = containment[1] + this.offset.click.top; + if(event.pageX - this.offset.click.left > containment[2]) pageX = containment[2] + this.offset.click.left; + if(event.pageY - this.offset.click.top > containment[3]) pageY = containment[3] + this.offset.click.top; + } + + if(o.grid) { + //Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950) + var top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY; + pageY = containment ? (!(top - this.offset.click.top < containment[1] || top - this.offset.click.top > containment[3]) ? top : (!(top - this.offset.click.top < containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; + + var left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX; + pageX = containment ? (!(left - this.offset.click.left < containment[0] || left - this.offset.click.left > containment[2]) ? left : (!(left - this.offset.click.left < containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; + } + + } + + return { + top: ( + pageY // The absolute mouse position + - this.offset.click.top // Click offset (relative to the element) + - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.top // The offsetParent's offset without borders (offset + border) + + ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) )) + ), + left: ( + pageX // The absolute mouse position + - this.offset.click.left // Click offset (relative to the element) + - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.left // The offsetParent's offset without borders (offset + border) + + ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() )) + ) + }; + + }, + + _clear: function() { + this.helper.removeClass("ui-draggable-dragging"); + if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove(); + //if($.ui.ddmanager) $.ui.ddmanager.current = null; + this.helper = null; + this.cancelHelperRemoval = false; + }, + + // From now on bulk stuff - mainly helpers + + _trigger: function(type, event, ui) { + ui = ui || this._uiHash(); + $.ui.plugin.call(this, type, [event, ui]); + if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins + return $.Widget.prototype._trigger.call(this, type, event, ui); + }, + + plugins: {}, + + _uiHash: function(event) { + return { + helper: this.helper, + position: this.position, + originalPosition: this.originalPosition, + offset: this.positionAbs + }; + } + +}); + +$.extend($.ui.draggable, { + version: "1.8.21" +}); + +$.ui.plugin.add("draggable", "connectToSortable", { + start: function(event, ui) { + + var inst = $(this).data("draggable"), o = inst.options, + uiSortable = $.extend({}, ui, { item: inst.element }); + inst.sortables = []; + $(o.connectToSortable).each(function() { + var sortable = $.data(this, 'sortable'); + if (sortable && !sortable.options.disabled) { + inst.sortables.push({ + instance: sortable, + shouldRevert: sortable.options.revert + }); + sortable.refreshPositions(); // Call the sortable's refreshPositions at drag start to refresh the containerCache since the sortable container cache is used in drag and needs to be up to date (this will ensure it's initialised as well as being kept in step with any changes that might have happened on the page). + sortable._trigger("activate", event, uiSortable); + } + }); + + }, + stop: function(event, ui) { + + //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper + var inst = $(this).data("draggable"), + uiSortable = $.extend({}, ui, { item: inst.element }); + + $.each(inst.sortables, function() { + if(this.instance.isOver) { + + this.instance.isOver = 0; + + inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance + this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work) + + //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid' + if(this.shouldRevert) this.instance.options.revert = true; + + //Trigger the stop of the sortable + this.instance._mouseStop(event); + + this.instance.options.helper = this.instance.options._helper; + + //If the helper has been the original item, restore properties in the sortable + if(inst.options.helper == 'original') + this.instance.currentItem.css({ top: 'auto', left: 'auto' }); + + } else { + this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance + this.instance._trigger("deactivate", event, uiSortable); + } + + }); + + }, + drag: function(event, ui) { + + var inst = $(this).data("draggable"), self = this; + + var checkPos = function(o) { + var dyClick = this.offset.click.top, dxClick = this.offset.click.left; + var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left; + var itemHeight = o.height, itemWidth = o.width; + var itemTop = o.top, itemLeft = o.left; + + return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth); + }; + + $.each(inst.sortables, function(i) { + + //Copy over some variables to allow calling the sortable's native _intersectsWith + this.instance.positionAbs = inst.positionAbs; + this.instance.helperProportions = inst.helperProportions; + this.instance.offset.click = inst.offset.click; + + if(this.instance._intersectsWith(this.instance.containerCache)) { + + //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once + if(!this.instance.isOver) { + + this.instance.isOver = 1; + //Now we fake the start of dragging for the sortable instance, + //by cloning the list group item, appending it to the sortable and using it as inst.currentItem + //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one) + this.instance.currentItem = $(self).clone().removeAttr('id').appendTo(this.instance.element).data("sortable-item", true); + this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it + this.instance.options.helper = function() { return ui.helper[0]; }; + + event.target = this.instance.currentItem[0]; + this.instance._mouseCapture(event, true); + this.instance._mouseStart(event, true, true); + + //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes + this.instance.offset.click.top = inst.offset.click.top; + this.instance.offset.click.left = inst.offset.click.left; + this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left; + this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top; + + inst._trigger("toSortable", event); + inst.dropped = this.instance.element; //draggable revert needs that + //hack so receive/update callbacks work (mostly) + inst.currentItem = inst.element; + this.instance.fromOutside = inst; + + } + + //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable + if(this.instance.currentItem) this.instance._mouseDrag(event); + + } else { + + //If it doesn't intersect with the sortable, and it intersected before, + //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval + if(this.instance.isOver) { + + this.instance.isOver = 0; + this.instance.cancelHelperRemoval = true; + + //Prevent reverting on this forced stop + this.instance.options.revert = false; + + // The out event needs to be triggered independently + this.instance._trigger('out', event, this.instance._uiHash(this.instance)); + + this.instance._mouseStop(event, true); + this.instance.options.helper = this.instance.options._helper; + + //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size + this.instance.currentItem.remove(); + if(this.instance.placeholder) this.instance.placeholder.remove(); + + inst._trigger("fromSortable", event); + inst.dropped = false; //draggable revert needs that + } + + }; + + }); + + } +}); + +$.ui.plugin.add("draggable", "cursor", { + start: function(event, ui) { + var t = $('body'), o = $(this).data('draggable').options; + if (t.css("cursor")) o._cursor = t.css("cursor"); + t.css("cursor", o.cursor); + }, + stop: function(event, ui) { + var o = $(this).data('draggable').options; + if (o._cursor) $('body').css("cursor", o._cursor); + } +}); + +$.ui.plugin.add("draggable", "opacity", { + start: function(event, ui) { + var t = $(ui.helper), o = $(this).data('draggable').options; + if(t.css("opacity")) o._opacity = t.css("opacity"); + t.css('opacity', o.opacity); + }, + stop: function(event, ui) { + var o = $(this).data('draggable').options; + if(o._opacity) $(ui.helper).css('opacity', o._opacity); + } +}); + +$.ui.plugin.add("draggable", "scroll", { + start: function(event, ui) { + var i = $(this).data("draggable"); + if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset(); + }, + drag: function(event, ui) { + + var i = $(this).data("draggable"), o = i.options, scrolled = false; + + if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') { + + if(!o.axis || o.axis != 'x') { + if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) + i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed; + else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity) + i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed; + } + + if(!o.axis || o.axis != 'y') { + if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) + i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed; + else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity) + i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed; + } + + } else { + + if(!o.axis || o.axis != 'x') { + if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); + else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); + } + + if(!o.axis || o.axis != 'y') { + if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); + else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); + } + + } + + if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(i, event); + + } +}); + +$.ui.plugin.add("draggable", "snap", { + start: function(event, ui) { + + var i = $(this).data("draggable"), o = i.options; + i.snapElements = []; + + $(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() { + var $t = $(this); var $o = $t.offset(); + if(this != i.element[0]) i.snapElements.push({ + item: this, + width: $t.outerWidth(), height: $t.outerHeight(), + top: $o.top, left: $o.left + }); + }); + + }, + drag: function(event, ui) { + + var inst = $(this).data("draggable"), o = inst.options; + var d = o.snapTolerance; + + var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width, + y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height; + + for (var i = inst.snapElements.length - 1; i >= 0; i--){ + + var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width, + t = inst.snapElements[i].top, b = t + inst.snapElements[i].height; + + //Yes, I know, this is insane ;) + if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) { + if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); + inst.snapElements[i].snapping = false; + continue; + } + + if(o.snapMode != 'inner') { + var ts = Math.abs(t - y2) <= d; + var bs = Math.abs(b - y1) <= d; + var ls = Math.abs(l - x2) <= d; + var rs = Math.abs(r - x1) <= d; + if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top; + if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top; + if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left; + if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left; + } + + var first = (ts || bs || ls || rs); + + if(o.snapMode != 'outer') { + var ts = Math.abs(t - y1) <= d; + var bs = Math.abs(b - y2) <= d; + var ls = Math.abs(l - x1) <= d; + var rs = Math.abs(r - x2) <= d; + if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top; + if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top; + if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left; + if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left; + } + + if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) + (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); + inst.snapElements[i].snapping = (ts || bs || ls || rs || first); + + }; + + } +}); + +$.ui.plugin.add("draggable", "stack", { + start: function(event, ui) { + + var o = $(this).data("draggable").options; + + var group = $.makeArray($(o.stack)).sort(function(a,b) { + return (parseInt($(a).css("zIndex"),10) || 0) - (parseInt($(b).css("zIndex"),10) || 0); + }); + if (!group.length) { return; } + + var min = parseInt(group[0].style.zIndex) || 0; + $(group).each(function(i) { + this.style.zIndex = min + i; + }); + + this[0].style.zIndex = min + group.length; + + } +}); + +$.ui.plugin.add("draggable", "zIndex", { + start: function(event, ui) { + var t = $(ui.helper), o = $(this).data("draggable").options; + if(t.css("zIndex")) o._zIndex = t.css("zIndex"); + t.css('zIndex', o.zIndex); + }, + stop: function(event, ui) { + var o = $(this).data("draggable").options; + if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex); + } +}); + +})(jQuery); +/*! + * jQuery UI Droppable 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Droppables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.mouse.js + * jquery.ui.draggable.js + */ +(function( $, undefined ) { + +$.widget("ui.droppable", { + widgetEventPrefix: "drop", + options: { + accept: '*', + activeClass: false, + addClasses: true, + greedy: false, + hoverClass: false, + scope: 'default', + tolerance: 'intersect' + }, + _create: function() { + + var o = this.options, accept = o.accept; + this.isover = 0; this.isout = 1; + + this.accept = $.isFunction(accept) ? accept : function(d) { + return d.is(accept); + }; + + //Store the droppable's proportions + this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight }; + + // Add the reference and positions to the manager + $.ui.ddmanager.droppables[o.scope] = $.ui.ddmanager.droppables[o.scope] || []; + $.ui.ddmanager.droppables[o.scope].push(this); + + (o.addClasses && this.element.addClass("ui-droppable")); + + }, + + destroy: function() { + var drop = $.ui.ddmanager.droppables[this.options.scope]; + for ( var i = 0; i < drop.length; i++ ) + if ( drop[i] == this ) + drop.splice(i, 1); + + this.element + .removeClass("ui-droppable ui-droppable-disabled") + .removeData("droppable") + .unbind(".droppable"); + + return this; + }, + + _setOption: function(key, value) { + + if(key == 'accept') { + this.accept = $.isFunction(value) ? value : function(d) { + return d.is(value); + }; + } + $.Widget.prototype._setOption.apply(this, arguments); + }, + + _activate: function(event) { + var draggable = $.ui.ddmanager.current; + if(this.options.activeClass) this.element.addClass(this.options.activeClass); + (draggable && this._trigger('activate', event, this.ui(draggable))); + }, + + _deactivate: function(event) { + var draggable = $.ui.ddmanager.current; + if(this.options.activeClass) this.element.removeClass(this.options.activeClass); + (draggable && this._trigger('deactivate', event, this.ui(draggable))); + }, + + _over: function(event) { + + var draggable = $.ui.ddmanager.current; + if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element + + if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + if(this.options.hoverClass) this.element.addClass(this.options.hoverClass); + this._trigger('over', event, this.ui(draggable)); + } + + }, + + _out: function(event) { + + var draggable = $.ui.ddmanager.current; + if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element + + if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass); + this._trigger('out', event, this.ui(draggable)); + } + + }, + + _drop: function(event,custom) { + + var draggable = custom || $.ui.ddmanager.current; + if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element + + var childrenIntersection = false; + this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function() { + var inst = $.data(this, 'droppable'); + if( + inst.options.greedy + && !inst.options.disabled + && inst.options.scope == draggable.options.scope + && inst.accept.call(inst.element[0], (draggable.currentItem || draggable.element)) + && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance) + ) { childrenIntersection = true; return false; } + }); + if(childrenIntersection) return false; + + if(this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + if(this.options.activeClass) this.element.removeClass(this.options.activeClass); + if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass); + this._trigger('drop', event, this.ui(draggable)); + return this.element; + } + + return false; + + }, + + ui: function(c) { + return { + draggable: (c.currentItem || c.element), + helper: c.helper, + position: c.position, + offset: c.positionAbs + }; + } + +}); + +$.extend($.ui.droppable, { + version: "1.8.21" +}); + +$.ui.intersect = function(draggable, droppable, toleranceMode) { + + if (!droppable.offset) return false; + + var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width, + y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height; + var l = droppable.offset.left, r = l + droppable.proportions.width, + t = droppable.offset.top, b = t + droppable.proportions.height; + + switch (toleranceMode) { + case 'fit': + return (l <= x1 && x2 <= r + && t <= y1 && y2 <= b); + break; + case 'intersect': + return (l < x1 + (draggable.helperProportions.width / 2) // Right Half + && x2 - (draggable.helperProportions.width / 2) < r // Left Half + && t < y1 + (draggable.helperProportions.height / 2) // Bottom Half + && y2 - (draggable.helperProportions.height / 2) < b ); // Top Half + break; + case 'pointer': + var draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left), + draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top), + isOver = $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width); + return isOver; + break; + case 'touch': + return ( + (y1 >= t && y1 <= b) || // Top edge touching + (y2 >= t && y2 <= b) || // Bottom edge touching + (y1 < t && y2 > b) // Surrounded vertically + ) && ( + (x1 >= l && x1 <= r) || // Left edge touching + (x2 >= l && x2 <= r) || // Right edge touching + (x1 < l && x2 > r) // Surrounded horizontally + ); + break; + default: + return false; + break; + } + +}; + +/* + This manager tracks offsets of draggables and droppables +*/ +$.ui.ddmanager = { + current: null, + droppables: { 'default': [] }, + prepareOffsets: function(t, event) { + + var m = $.ui.ddmanager.droppables[t.options.scope] || []; + var type = event ? event.type : null; // workaround for #2317 + var list = (t.currentItem || t.element).find(":data(droppable)").andSelf(); + + droppablesLoop: for (var i = 0; i < m.length; i++) { + + if(m[i].options.disabled || (t && !m[i].accept.call(m[i].element[0],(t.currentItem || t.element)))) continue; //No disabled and non-accepted + for (var j=0; j < list.length; j++) { if(list[j] == m[i].element[0]) { m[i].proportions.height = 0; continue droppablesLoop; } }; //Filter out elements in the current dragged item + m[i].visible = m[i].element.css("display") != "none"; if(!m[i].visible) continue; //If the element is not visible, continue + + if(type == "mousedown") m[i]._activate.call(m[i], event); //Activate the droppable if used directly from draggables + + m[i].offset = m[i].element.offset(); + m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight }; + + } + + }, + drop: function(draggable, event) { + + var dropped = false; + $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() { + + if(!this.options) return; + if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance)) + dropped = this._drop.call(this, event) || dropped; + + if (!this.options.disabled && this.visible && this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + this.isout = 1; this.isover = 0; + this._deactivate.call(this, event); + } + + }); + return dropped; + + }, + dragStart: function( draggable, event ) { + //Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003) + draggable.element.parents( ":not(body,html)" ).bind( "scroll.droppable", function() { + if( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event ); + }); + }, + drag: function(draggable, event) { + + //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse. + if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, event); + + //Run through all droppables and check their positions based on specific tolerance options + $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() { + + if(this.options.disabled || this.greedyChild || !this.visible) return; + var intersects = $.ui.intersect(draggable, this, this.options.tolerance); + + var c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null); + if(!c) return; + + var parentInstance; + if (this.options.greedy) { + var parent = this.element.parents(':data(droppable):eq(0)'); + if (parent.length) { + parentInstance = $.data(parent[0], 'droppable'); + parentInstance.greedyChild = (c == 'isover' ? 1 : 0); + } + } + + // we just moved into a greedy child + if (parentInstance && c == 'isover') { + parentInstance['isover'] = 0; + parentInstance['isout'] = 1; + parentInstance._out.call(parentInstance, event); + } + + this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0; + this[c == "isover" ? "_over" : "_out"].call(this, event); + + // we just moved out of a greedy child + if (parentInstance && c == 'isout') { + parentInstance['isout'] = 0; + parentInstance['isover'] = 1; + parentInstance._over.call(parentInstance, event); + } + }); + + }, + dragStop: function( draggable, event ) { + draggable.element.parents( ":not(body,html)" ).unbind( "scroll.droppable" ); + //Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003) + if( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event ); + } +}; + +})(jQuery); +/*! + * jQuery UI Resizable 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Resizables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget("ui.resizable", $.ui.mouse, { + widgetEventPrefix: "resize", + options: { + alsoResize: false, + animate: false, + animateDuration: "slow", + animateEasing: "swing", + aspectRatio: false, + autoHide: false, + containment: false, + ghost: false, + grid: false, + handles: "e,s,se", + helper: false, + maxHeight: null, + maxWidth: null, + minHeight: 10, + minWidth: 10, + zIndex: 1000 + }, + _create: function() { + + var self = this, o = this.options; + this.element.addClass("ui-resizable"); + + $.extend(this, { + _aspectRatio: !!(o.aspectRatio), + aspectRatio: o.aspectRatio, + originalElement: this.element, + _proportionallyResizeElements: [], + _helper: o.helper || o.ghost || o.animate ? o.helper || 'ui-resizable-helper' : null + }); + + //Wrap the element if it cannot hold child nodes + if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) { + + //Create a wrapper element and set the wrapper to the new current internal element + this.element.wrap( + $('
      ').css({ + position: this.element.css('position'), + width: this.element.outerWidth(), + height: this.element.outerHeight(), + top: this.element.css('top'), + left: this.element.css('left') + }) + ); + + //Overwrite the original this.element + this.element = this.element.parent().data( + "resizable", this.element.data('resizable') + ); + + this.elementIsWrapper = true; + + //Move margins to the wrapper + this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") }); + this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0}); + + //Prevent Safari textarea resize + this.originalResizeStyle = this.originalElement.css('resize'); + this.originalElement.css('resize', 'none'); + + //Push the actual element to our proportionallyResize internal array + this._proportionallyResizeElements.push(this.originalElement.css({ position: 'static', zoom: 1, display: 'block' })); + + // avoid IE jump (hard set the margin) + this.originalElement.css({ margin: this.originalElement.css('margin') }); + + // fix handlers offset + this._proportionallyResize(); + + } + + this.handles = o.handles || (!$('.ui-resizable-handle', this.element).length ? "e,s,se" : { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' }); + if(this.handles.constructor == String) { + + if(this.handles == 'all') this.handles = 'n,e,s,w,se,sw,ne,nw'; + var n = this.handles.split(","); this.handles = {}; + + for(var i = 0; i < n.length; i++) { + + var handle = $.trim(n[i]), hname = 'ui-resizable-'+handle; + var axis = $('
      '); + + // Apply zIndex to all handles - see #7960 + axis.css({ zIndex: o.zIndex }); + + //TODO : What's going on here? + if ('se' == handle) { + axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se'); + }; + + //Insert into internal handles object and append to element + this.handles[handle] = '.ui-resizable-'+handle; + this.element.append(axis); + } + + } + + this._renderAxis = function(target) { + + target = target || this.element; + + for(var i in this.handles) { + + if(this.handles[i].constructor == String) + this.handles[i] = $(this.handles[i], this.element).show(); + + //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls) + if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) { + + var axis = $(this.handles[i], this.element), padWrapper = 0; + + //Checking the correct pad and border + padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth(); + + //The padding type i have to apply... + var padPos = [ 'padding', + /ne|nw|n/.test(i) ? 'Top' : + /se|sw|s/.test(i) ? 'Bottom' : + /^e$/.test(i) ? 'Right' : 'Left' ].join(""); + + target.css(padPos, padWrapper); + + this._proportionallyResize(); + + } + + //TODO: What's that good for? There's not anything to be executed left + if(!$(this.handles[i]).length) + continue; + + } + }; + + //TODO: make renderAxis a prototype function + this._renderAxis(this.element); + + this._handles = $('.ui-resizable-handle', this.element) + .disableSelection(); + + //Matching axis name + this._handles.mouseover(function() { + if (!self.resizing) { + if (this.className) + var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i); + //Axis, default = se + self.axis = axis && axis[1] ? axis[1] : 'se'; + } + }); + + //If we want to auto hide the elements + if (o.autoHide) { + this._handles.hide(); + $(this.element) + .addClass("ui-resizable-autohide") + .hover(function() { + if (o.disabled) return; + $(this).removeClass("ui-resizable-autohide"); + self._handles.show(); + }, + function(){ + if (o.disabled) return; + if (!self.resizing) { + $(this).addClass("ui-resizable-autohide"); + self._handles.hide(); + } + }); + } + + //Initialize the mouse interaction + this._mouseInit(); + + }, + + destroy: function() { + + this._mouseDestroy(); + + var _destroy = function(exp) { + $(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing") + .removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove(); + }; + + //TODO: Unwrap at same DOM position + if (this.elementIsWrapper) { + _destroy(this.element); + var wrapper = this.element; + wrapper.after( + this.originalElement.css({ + position: wrapper.css('position'), + width: wrapper.outerWidth(), + height: wrapper.outerHeight(), + top: wrapper.css('top'), + left: wrapper.css('left') + }) + ).remove(); + } + + this.originalElement.css('resize', this.originalResizeStyle); + _destroy(this.originalElement); + + return this; + }, + + _mouseCapture: function(event) { + var handle = false; + for (var i in this.handles) { + if ($(this.handles[i])[0] == event.target) { + handle = true; + } + } + + return !this.options.disabled && handle; + }, + + _mouseStart: function(event) { + + var o = this.options, iniPos = this.element.position(), el = this.element; + + this.resizing = true; + this.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() }; + + // bugfix for http://dev.jquery.com/ticket/1749 + if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) { + el.css({ position: 'absolute', top: iniPos.top, left: iniPos.left }); + } + + this._renderProxy(); + + var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top')); + + if (o.containment) { + curleft += $(o.containment).scrollLeft() || 0; + curtop += $(o.containment).scrollTop() || 0; + } + + //Store needed variables + this.offset = this.helper.offset(); + this.position = { left: curleft, top: curtop }; + this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; + this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; + this.originalPosition = { left: curleft, top: curtop }; + this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() }; + this.originalMousePosition = { left: event.pageX, top: event.pageY }; + + //Aspect Ratio + this.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1); + + var cursor = $('.ui-resizable-' + this.axis).css('cursor'); + $('body').css('cursor', cursor == 'auto' ? this.axis + '-resize' : cursor); + + el.addClass("ui-resizable-resizing"); + this._propagate("start", event); + return true; + }, + + _mouseDrag: function(event) { + + //Increase performance, avoid regex + var el = this.helper, o = this.options, props = {}, + self = this, smp = this.originalMousePosition, a = this.axis; + + var dx = (event.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0; + var trigger = this._change[a]; + if (!trigger) return false; + + // Calculate the attrs that will be change + var data = trigger.apply(this, [event, dx, dy]), ie6 = $.browser.msie && $.browser.version < 7, csdif = this.sizeDiff; + + // Put this in the mouseDrag handler since the user can start pressing shift while resizing + this._updateVirtualBoundaries(event.shiftKey); + if (this._aspectRatio || event.shiftKey) + data = this._updateRatio(data, event); + + data = this._respectSize(data, event); + + // plugins callbacks need to be called first + this._propagate("resize", event); + + el.css({ + top: this.position.top + "px", left: this.position.left + "px", + width: this.size.width + "px", height: this.size.height + "px" + }); + + if (!this._helper && this._proportionallyResizeElements.length) + this._proportionallyResize(); + + this._updateCache(data); + + // calling the user callback at the end + this._trigger('resize', event, this.ui()); + + return false; + }, + + _mouseStop: function(event) { + + this.resizing = false; + var o = this.options, self = this; + + if(this._helper) { + var pr = this._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName), + soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height, + soffsetw = ista ? 0 : self.sizeDiff.width; + + var s = { width: (self.helper.width() - soffsetw), height: (self.helper.height() - soffseth) }, + left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null, + top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null; + + if (!o.animate) + this.element.css($.extend(s, { top: top, left: left })); + + self.helper.height(self.size.height); + self.helper.width(self.size.width); + + if (this._helper && !o.animate) this._proportionallyResize(); + } + + $('body').css('cursor', 'auto'); + + this.element.removeClass("ui-resizable-resizing"); + + this._propagate("stop", event); + + if (this._helper) this.helper.remove(); + return false; + + }, + + _updateVirtualBoundaries: function(forceAspectRatio) { + var o = this.options, pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b; + + b = { + minWidth: isNumber(o.minWidth) ? o.minWidth : 0, + maxWidth: isNumber(o.maxWidth) ? o.maxWidth : Infinity, + minHeight: isNumber(o.minHeight) ? o.minHeight : 0, + maxHeight: isNumber(o.maxHeight) ? o.maxHeight : Infinity + }; + + if(this._aspectRatio || forceAspectRatio) { + // We want to create an enclosing box whose aspect ration is the requested one + // First, compute the "projected" size for each dimension based on the aspect ratio and other dimension + pMinWidth = b.minHeight * this.aspectRatio; + pMinHeight = b.minWidth / this.aspectRatio; + pMaxWidth = b.maxHeight * this.aspectRatio; + pMaxHeight = b.maxWidth / this.aspectRatio; + + if(pMinWidth > b.minWidth) b.minWidth = pMinWidth; + if(pMinHeight > b.minHeight) b.minHeight = pMinHeight; + if(pMaxWidth < b.maxWidth) b.maxWidth = pMaxWidth; + if(pMaxHeight < b.maxHeight) b.maxHeight = pMaxHeight; + } + this._vBoundaries = b; + }, + + _updateCache: function(data) { + var o = this.options; + this.offset = this.helper.offset(); + if (isNumber(data.left)) this.position.left = data.left; + if (isNumber(data.top)) this.position.top = data.top; + if (isNumber(data.height)) this.size.height = data.height; + if (isNumber(data.width)) this.size.width = data.width; + }, + + _updateRatio: function(data, event) { + + var o = this.options, cpos = this.position, csize = this.size, a = this.axis; + + if (isNumber(data.height)) data.width = (data.height * this.aspectRatio); + else if (isNumber(data.width)) data.height = (data.width / this.aspectRatio); + + if (a == 'sw') { + data.left = cpos.left + (csize.width - data.width); + data.top = null; + } + if (a == 'nw') { + data.top = cpos.top + (csize.height - data.height); + data.left = cpos.left + (csize.width - data.width); + } + + return data; + }, + + _respectSize: function(data, event) { + + var el = this.helper, o = this._vBoundaries, pRatio = this._aspectRatio || event.shiftKey, a = this.axis, + ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height), + isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height); + + if (isminw) data.width = o.minWidth; + if (isminh) data.height = o.minHeight; + if (ismaxw) data.width = o.maxWidth; + if (ismaxh) data.height = o.maxHeight; + + var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height; + var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a); + + if (isminw && cw) data.left = dw - o.minWidth; + if (ismaxw && cw) data.left = dw - o.maxWidth; + if (isminh && ch) data.top = dh - o.minHeight; + if (ismaxh && ch) data.top = dh - o.maxHeight; + + // fixing jump error on top/left - bug #2330 + var isNotwh = !data.width && !data.height; + if (isNotwh && !data.left && data.top) data.top = null; + else if (isNotwh && !data.top && data.left) data.left = null; + + return data; + }, + + _proportionallyResize: function() { + + var o = this.options; + if (!this._proportionallyResizeElements.length) return; + var element = this.helper || this.element; + + for (var i=0; i < this._proportionallyResizeElements.length; i++) { + + var prel = this._proportionallyResizeElements[i]; + + if (!this.borderDif) { + var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')], + p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')]; + + this.borderDif = $.map(b, function(v, i) { + var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0; + return border + padding; + }); + } + + if ($.browser.msie && !(!($(element).is(':hidden') || $(element).parents(':hidden').length))) + continue; + + prel.css({ + height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0, + width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0 + }); + + }; + + }, + + _renderProxy: function() { + + var el = this.element, o = this.options; + this.elementOffset = el.offset(); + + if(this._helper) { + + this.helper = this.helper || $('
      '); + + // fix ie6 offset TODO: This seems broken + var ie6 = $.browser.msie && $.browser.version < 7, ie6offset = (ie6 ? 1 : 0), + pxyoffset = ( ie6 ? 2 : -1 ); + + this.helper.addClass(this._helper).css({ + width: this.element.outerWidth() + pxyoffset, + height: this.element.outerHeight() + pxyoffset, + position: 'absolute', + left: this.elementOffset.left - ie6offset +'px', + top: this.elementOffset.top - ie6offset +'px', + zIndex: ++o.zIndex //TODO: Don't modify option + }); + + this.helper + .appendTo("body") + .disableSelection(); + + } else { + this.helper = this.element; + } + + }, + + _change: { + e: function(event, dx, dy) { + return { width: this.originalSize.width + dx }; + }, + w: function(event, dx, dy) { + var o = this.options, cs = this.originalSize, sp = this.originalPosition; + return { left: sp.left + dx, width: cs.width - dx }; + }, + n: function(event, dx, dy) { + var o = this.options, cs = this.originalSize, sp = this.originalPosition; + return { top: sp.top + dy, height: cs.height - dy }; + }, + s: function(event, dx, dy) { + return { height: this.originalSize.height + dy }; + }, + se: function(event, dx, dy) { + return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy])); + }, + sw: function(event, dx, dy) { + return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy])); + }, + ne: function(event, dx, dy) { + return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy])); + }, + nw: function(event, dx, dy) { + return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy])); + } + }, + + _propagate: function(n, event) { + $.ui.plugin.call(this, n, [event, this.ui()]); + (n != "resize" && this._trigger(n, event, this.ui())); + }, + + plugins: {}, + + ui: function() { + return { + originalElement: this.originalElement, + element: this.element, + helper: this.helper, + position: this.position, + size: this.size, + originalSize: this.originalSize, + originalPosition: this.originalPosition + }; + } + +}); + +$.extend($.ui.resizable, { + version: "1.8.21" +}); + +/* + * Resizable Extensions + */ + +$.ui.plugin.add("resizable", "alsoResize", { + + start: function (event, ui) { + var self = $(this).data("resizable"), o = self.options; + + var _store = function (exp) { + $(exp).each(function() { + var el = $(this); + el.data("resizable-alsoresize", { + width: parseInt(el.width(), 10), height: parseInt(el.height(), 10), + left: parseInt(el.css('left'), 10), top: parseInt(el.css('top'), 10) + }); + }); + }; + + if (typeof(o.alsoResize) == 'object' && !o.alsoResize.parentNode) { + if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); } + else { $.each(o.alsoResize, function (exp) { _store(exp); }); } + }else{ + _store(o.alsoResize); + } + }, + + resize: function (event, ui) { + var self = $(this).data("resizable"), o = self.options, os = self.originalSize, op = self.originalPosition; + + var delta = { + height: (self.size.height - os.height) || 0, width: (self.size.width - os.width) || 0, + top: (self.position.top - op.top) || 0, left: (self.position.left - op.left) || 0 + }, + + _alsoResize = function (exp, c) { + $(exp).each(function() { + var el = $(this), start = $(this).data("resizable-alsoresize"), style = {}, + css = c && c.length ? c : el.parents(ui.originalElement[0]).length ? ['width', 'height'] : ['width', 'height', 'top', 'left']; + + $.each(css, function (i, prop) { + var sum = (start[prop]||0) + (delta[prop]||0); + if (sum && sum >= 0) + style[prop] = sum || null; + }); + + el.css(style); + }); + }; + + if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) { + $.each(o.alsoResize, function (exp, c) { _alsoResize(exp, c); }); + }else{ + _alsoResize(o.alsoResize); + } + }, + + stop: function (event, ui) { + $(this).removeData("resizable-alsoresize"); + } +}); + +$.ui.plugin.add("resizable", "animate", { + + stop: function(event, ui) { + var self = $(this).data("resizable"), o = self.options; + + var pr = self._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName), + soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height, + soffsetw = ista ? 0 : self.sizeDiff.width; + + var style = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) }, + left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null, + top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null; + + self.element.animate( + $.extend(style, top && left ? { top: top, left: left } : {}), { + duration: o.animateDuration, + easing: o.animateEasing, + step: function() { + + var data = { + width: parseInt(self.element.css('width'), 10), + height: parseInt(self.element.css('height'), 10), + top: parseInt(self.element.css('top'), 10), + left: parseInt(self.element.css('left'), 10) + }; + + if (pr && pr.length) $(pr[0]).css({ width: data.width, height: data.height }); + + // propagating resize, and updating values for each animation step + self._updateCache(data); + self._propagate("resize", event); + + } + } + ); + } + +}); + +$.ui.plugin.add("resizable", "containment", { + + start: function(event, ui) { + var self = $(this).data("resizable"), o = self.options, el = self.element; + var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc; + if (!ce) return; + + self.containerElement = $(ce); + + if (/document/.test(oc) || oc == document) { + self.containerOffset = { left: 0, top: 0 }; + self.containerPosition = { left: 0, top: 0 }; + + self.parentData = { + element: $(document), left: 0, top: 0, + width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight + }; + } + + // i'm a node, so compute top, left, right, bottom + else { + var element = $(ce), p = []; + $([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); }); + + self.containerOffset = element.offset(); + self.containerPosition = element.position(); + self.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) }; + + var co = self.containerOffset, ch = self.containerSize.height, cw = self.containerSize.width, + width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch); + + self.parentData = { + element: ce, left: co.left, top: co.top, width: width, height: height + }; + } + }, + + resize: function(event, ui) { + var self = $(this).data("resizable"), o = self.options, + ps = self.containerSize, co = self.containerOffset, cs = self.size, cp = self.position, + pRatio = self._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = self.containerElement; + + if (ce[0] != document && (/static/).test(ce.css('position'))) cop = co; + + if (cp.left < (self._helper ? co.left : 0)) { + self.size.width = self.size.width + (self._helper ? (self.position.left - co.left) : (self.position.left - cop.left)); + if (pRatio) self.size.height = self.size.width / self.aspectRatio; + self.position.left = o.helper ? co.left : 0; + } + + if (cp.top < (self._helper ? co.top : 0)) { + self.size.height = self.size.height + (self._helper ? (self.position.top - co.top) : self.position.top); + if (pRatio) self.size.width = self.size.height * self.aspectRatio; + self.position.top = self._helper ? co.top : 0; + } + + self.offset.left = self.parentData.left+self.position.left; + self.offset.top = self.parentData.top+self.position.top; + + var woset = Math.abs( (self._helper ? self.offset.left - cop.left : (self.offset.left - cop.left)) + self.sizeDiff.width ), + hoset = Math.abs( (self._helper ? self.offset.top - cop.top : (self.offset.top - co.top)) + self.sizeDiff.height ); + + var isParent = self.containerElement.get(0) == self.element.parent().get(0), + isOffsetRelative = /relative|absolute/.test(self.containerElement.css('position')); + + if(isParent && isOffsetRelative) woset -= self.parentData.left; + + if (woset + self.size.width >= self.parentData.width) { + self.size.width = self.parentData.width - woset; + if (pRatio) self.size.height = self.size.width / self.aspectRatio; + } + + if (hoset + self.size.height >= self.parentData.height) { + self.size.height = self.parentData.height - hoset; + if (pRatio) self.size.width = self.size.height * self.aspectRatio; + } + }, + + stop: function(event, ui){ + var self = $(this).data("resizable"), o = self.options, cp = self.position, + co = self.containerOffset, cop = self.containerPosition, ce = self.containerElement; + + var helper = $(self.helper), ho = helper.offset(), w = helper.outerWidth() - self.sizeDiff.width, h = helper.outerHeight() - self.sizeDiff.height; + + if (self._helper && !o.animate && (/relative/).test(ce.css('position'))) + $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h }); + + if (self._helper && !o.animate && (/static/).test(ce.css('position'))) + $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h }); + + } +}); + +$.ui.plugin.add("resizable", "ghost", { + + start: function(event, ui) { + + var self = $(this).data("resizable"), o = self.options, cs = self.size; + + self.ghost = self.originalElement.clone(); + self.ghost + .css({ opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 }) + .addClass('ui-resizable-ghost') + .addClass(typeof o.ghost == 'string' ? o.ghost : ''); + + self.ghost.appendTo(self.helper); + + }, + + resize: function(event, ui){ + var self = $(this).data("resizable"), o = self.options; + if (self.ghost) self.ghost.css({ position: 'relative', height: self.size.height, width: self.size.width }); + }, + + stop: function(event, ui){ + var self = $(this).data("resizable"), o = self.options; + if (self.ghost && self.helper) self.helper.get(0).removeChild(self.ghost.get(0)); + } + +}); + +$.ui.plugin.add("resizable", "grid", { + + resize: function(event, ui) { + var self = $(this).data("resizable"), o = self.options, cs = self.size, os = self.originalSize, op = self.originalPosition, a = self.axis, ratio = o._aspectRatio || event.shiftKey; + o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid; + var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1); + + if (/^(se|s|e)$/.test(a)) { + self.size.width = os.width + ox; + self.size.height = os.height + oy; + } + else if (/^(ne)$/.test(a)) { + self.size.width = os.width + ox; + self.size.height = os.height + oy; + self.position.top = op.top - oy; + } + else if (/^(sw)$/.test(a)) { + self.size.width = os.width + ox; + self.size.height = os.height + oy; + self.position.left = op.left - ox; + } + else { + self.size.width = os.width + ox; + self.size.height = os.height + oy; + self.position.top = op.top - oy; + self.position.left = op.left - ox; + } + } + +}); + +var num = function(v) { + return parseInt(v, 10) || 0; +}; + +var isNumber = function(value) { + return !isNaN(parseInt(value, 10)); +}; + +})(jQuery); +/*! + * jQuery UI Selectable 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Selectables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget("ui.selectable", $.ui.mouse, { + options: { + appendTo: 'body', + autoRefresh: true, + distance: 0, + filter: '*', + tolerance: 'touch' + }, + _create: function() { + var self = this; + + this.element.addClass("ui-selectable"); + + this.dragged = false; + + // cache selectee children based on filter + var selectees; + this.refresh = function() { + selectees = $(self.options.filter, self.element[0]); + selectees.addClass("ui-selectee"); + selectees.each(function() { + var $this = $(this); + var pos = $this.offset(); + $.data(this, "selectable-item", { + element: this, + $element: $this, + left: pos.left, + top: pos.top, + right: pos.left + $this.outerWidth(), + bottom: pos.top + $this.outerHeight(), + startselected: false, + selected: $this.hasClass('ui-selected'), + selecting: $this.hasClass('ui-selecting'), + unselecting: $this.hasClass('ui-unselecting') + }); + }); + }; + this.refresh(); + + this.selectees = selectees.addClass("ui-selectee"); + + this._mouseInit(); + + this.helper = $("
      "); + }, + + destroy: function() { + this.selectees + .removeClass("ui-selectee") + .removeData("selectable-item"); + this.element + .removeClass("ui-selectable ui-selectable-disabled") + .removeData("selectable") + .unbind(".selectable"); + this._mouseDestroy(); + + return this; + }, + + _mouseStart: function(event) { + var self = this; + + this.opos = [event.pageX, event.pageY]; + + if (this.options.disabled) + return; + + var options = this.options; + + this.selectees = $(options.filter, this.element[0]); + + this._trigger("start", event); + + $(options.appendTo).append(this.helper); + // position helper (lasso) + this.helper.css({ + "left": event.clientX, + "top": event.clientY, + "width": 0, + "height": 0 + }); + + if (options.autoRefresh) { + this.refresh(); + } + + this.selectees.filter('.ui-selected').each(function() { + var selectee = $.data(this, "selectable-item"); + selectee.startselected = true; + if (!event.metaKey && !event.ctrlKey) { + selectee.$element.removeClass('ui-selected'); + selectee.selected = false; + selectee.$element.addClass('ui-unselecting'); + selectee.unselecting = true; + // selectable UNSELECTING callback + self._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + }); + + $(event.target).parents().andSelf().each(function() { + var selectee = $.data(this, "selectable-item"); + if (selectee) { + var doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass('ui-selected'); + selectee.$element + .removeClass(doSelect ? "ui-unselecting" : "ui-selected") + .addClass(doSelect ? "ui-selecting" : "ui-unselecting"); + selectee.unselecting = !doSelect; + selectee.selecting = doSelect; + selectee.selected = doSelect; + // selectable (UN)SELECTING callback + if (doSelect) { + self._trigger("selecting", event, { + selecting: selectee.element + }); + } else { + self._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + return false; + } + }); + + }, + + _mouseDrag: function(event) { + var self = this; + this.dragged = true; + + if (this.options.disabled) + return; + + var options = this.options; + + var x1 = this.opos[0], y1 = this.opos[1], x2 = event.pageX, y2 = event.pageY; + if (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; } + if (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; } + this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1}); + + this.selectees.each(function() { + var selectee = $.data(this, "selectable-item"); + //prevent helper from being selected if appendTo: selectable + if (!selectee || selectee.element == self.element[0]) + return; + var hit = false; + if (options.tolerance == 'touch') { + hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) ); + } else if (options.tolerance == 'fit') { + hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2); + } + + if (hit) { + // SELECT + if (selectee.selected) { + selectee.$element.removeClass('ui-selected'); + selectee.selected = false; + } + if (selectee.unselecting) { + selectee.$element.removeClass('ui-unselecting'); + selectee.unselecting = false; + } + if (!selectee.selecting) { + selectee.$element.addClass('ui-selecting'); + selectee.selecting = true; + // selectable SELECTING callback + self._trigger("selecting", event, { + selecting: selectee.element + }); + } + } else { + // UNSELECT + if (selectee.selecting) { + if ((event.metaKey || event.ctrlKey) && selectee.startselected) { + selectee.$element.removeClass('ui-selecting'); + selectee.selecting = false; + selectee.$element.addClass('ui-selected'); + selectee.selected = true; + } else { + selectee.$element.removeClass('ui-selecting'); + selectee.selecting = false; + if (selectee.startselected) { + selectee.$element.addClass('ui-unselecting'); + selectee.unselecting = true; + } + // selectable UNSELECTING callback + self._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + } + if (selectee.selected) { + if (!event.metaKey && !event.ctrlKey && !selectee.startselected) { + selectee.$element.removeClass('ui-selected'); + selectee.selected = false; + + selectee.$element.addClass('ui-unselecting'); + selectee.unselecting = true; + // selectable UNSELECTING callback + self._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + } + } + }); + + return false; + }, + + _mouseStop: function(event) { + var self = this; + + this.dragged = false; + + var options = this.options; + + $('.ui-unselecting', this.element[0]).each(function() { + var selectee = $.data(this, "selectable-item"); + selectee.$element.removeClass('ui-unselecting'); + selectee.unselecting = false; + selectee.startselected = false; + self._trigger("unselected", event, { + unselected: selectee.element + }); + }); + $('.ui-selecting', this.element[0]).each(function() { + var selectee = $.data(this, "selectable-item"); + selectee.$element.removeClass('ui-selecting').addClass('ui-selected'); + selectee.selecting = false; + selectee.selected = true; + selectee.startselected = true; + self._trigger("selected", event, { + selected: selectee.element + }); + }); + this._trigger("stop", event); + + this.helper.remove(); + + return false; + } + +}); + +$.extend($.ui.selectable, { + version: "1.8.21" +}); + +})(jQuery); +/*! + * jQuery UI Sortable 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Sortables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget("ui.sortable", $.ui.mouse, { + widgetEventPrefix: "sort", + ready: false, + options: { + appendTo: "parent", + axis: false, + connectWith: false, + containment: false, + cursor: 'auto', + cursorAt: false, + dropOnEmpty: true, + forcePlaceholderSize: false, + forceHelperSize: false, + grid: false, + handle: false, + helper: "original", + items: '> *', + opacity: false, + placeholder: false, + revert: false, + scroll: true, + scrollSensitivity: 20, + scrollSpeed: 20, + scope: "default", + tolerance: "intersect", + zIndex: 1000 + }, + _create: function() { + + var o = this.options; + this.containerCache = {}; + this.element.addClass("ui-sortable"); + + //Get the items + this.refresh(); + + //Let's determine if the items are being displayed horizontally + this.floating = this.items.length ? o.axis === 'x' || (/left|right/).test(this.items[0].item.css('float')) || (/inline|table-cell/).test(this.items[0].item.css('display')) : false; + + //Let's determine the parent's offset + this.offset = this.element.offset(); + + //Initialize mouse events for interaction + this._mouseInit(); + + //We're ready to go + this.ready = true + + }, + + destroy: function() { + $.Widget.prototype.destroy.call( this ); + this.element + .removeClass("ui-sortable ui-sortable-disabled"); + this._mouseDestroy(); + + for ( var i = this.items.length - 1; i >= 0; i-- ) + this.items[i].item.removeData(this.widgetName + "-item"); + + return this; + }, + + _setOption: function(key, value){ + if ( key === "disabled" ) { + this.options[ key ] = value; + + this.widget() + [ value ? "addClass" : "removeClass"]( "ui-sortable-disabled" ); + } else { + // Don't call widget base _setOption for disable as it adds ui-state-disabled class + $.Widget.prototype._setOption.apply(this, arguments); + } + }, + + _mouseCapture: function(event, overrideHandle) { + var that = this; + + if (this.reverting) { + return false; + } + + if(this.options.disabled || this.options.type == 'static') return false; + + //We have to refresh the items data once first + this._refreshItems(event); + + //Find out if the clicked node (or one of its parents) is a actual item in this.items + var currentItem = null, self = this, nodes = $(event.target).parents().each(function() { + if($.data(this, that.widgetName + '-item') == self) { + currentItem = $(this); + return false; + } + }); + if($.data(event.target, that.widgetName + '-item') == self) currentItem = $(event.target); + + if(!currentItem) return false; + if(this.options.handle && !overrideHandle) { + var validHandle = false; + + $(this.options.handle, currentItem).find("*").andSelf().each(function() { if(this == event.target) validHandle = true; }); + if(!validHandle) return false; + } + + this.currentItem = currentItem; + this._removeCurrentsFromItems(); + return true; + + }, + + _mouseStart: function(event, overrideHandle, noActivation) { + + var o = this.options, self = this; + this.currentContainer = this; + + //We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture + this.refreshPositions(); + + //Create and append the visible helper + this.helper = this._createHelper(event); + + //Cache the helper size + this._cacheHelperProportions(); + + /* + * - Position generation - + * This block generates everything position related - it's the core of draggables. + */ + + //Cache the margins of the original element + this._cacheMargins(); + + //Get the next scrolling parent + this.scrollParent = this.helper.scrollParent(); + + //The element's absolute position on the page minus margins + this.offset = this.currentItem.offset(); + this.offset = { + top: this.offset.top - this.margins.top, + left: this.offset.left - this.margins.left + }; + + $.extend(this.offset, { + click: { //Where the click happened, relative to the element + left: event.pageX - this.offset.left, + top: event.pageY - this.offset.top + }, + parent: this._getParentOffset(), + relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper + }); + + // Only after we got the offset, we can change the helper's position to absolute + // TODO: Still need to figure out a way to make relative sorting possible + this.helper.css("position", "absolute"); + this.cssPosition = this.helper.css("position"); + + //Generate the original position + this.originalPosition = this._generatePosition(event); + this.originalPageX = event.pageX; + this.originalPageY = event.pageY; + + //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied + (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt)); + + //Cache the former DOM position + this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] }; + + //If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way + if(this.helper[0] != this.currentItem[0]) { + this.currentItem.hide(); + } + + //Create the placeholder + this._createPlaceholder(); + + //Set a containment if given in the options + if(o.containment) + this._setContainment(); + + if(o.cursor) { // cursor option + if ($('body').css("cursor")) this._storedCursor = $('body').css("cursor"); + $('body').css("cursor", o.cursor); + } + + if(o.opacity) { // opacity option + if (this.helper.css("opacity")) this._storedOpacity = this.helper.css("opacity"); + this.helper.css("opacity", o.opacity); + } + + if(o.zIndex) { // zIndex option + if (this.helper.css("zIndex")) this._storedZIndex = this.helper.css("zIndex"); + this.helper.css("zIndex", o.zIndex); + } + + //Prepare scrolling + if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') + this.overflowOffset = this.scrollParent.offset(); + + //Call callbacks + this._trigger("start", event, this._uiHash()); + + //Recache the helper size + if(!this._preserveHelperProportions) + this._cacheHelperProportions(); + + + //Post 'activate' events to possible containers + if(!noActivation) { + for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i]._trigger("activate", event, self._uiHash(this)); } + } + + //Prepare possible droppables + if($.ui.ddmanager) + $.ui.ddmanager.current = this; + + if ($.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(this, event); + + this.dragging = true; + + this.helper.addClass("ui-sortable-helper"); + this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position + return true; + + }, + + _mouseDrag: function(event) { + + //Compute the helpers position + this.position = this._generatePosition(event); + this.positionAbs = this._convertPositionTo("absolute"); + + if (!this.lastPositionAbs) { + this.lastPositionAbs = this.positionAbs; + } + + //Do scrolling + if(this.options.scroll) { + var o = this.options, scrolled = false; + if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') { + + if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) + this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed; + else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity) + this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed; + + if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) + this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed; + else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity) + this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed; + + } else { + + if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); + else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); + + if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); + else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); + + } + + if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(this, event); + } + + //Regenerate the absolute position used for position checks + this.positionAbs = this._convertPositionTo("absolute"); + + //Set the helper position + if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px'; + if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px'; + + //Rearrange + for (var i = this.items.length - 1; i >= 0; i--) { + + //Cache variables and intersection, continue if no intersection + var item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item); + if (!intersection) continue; + + if(itemElement != this.currentItem[0] //cannot intersect with itself + && this.placeholder[intersection == 1 ? "next" : "prev"]()[0] != itemElement //no useless actions that have been done before + && !$.ui.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked + && (this.options.type == 'semi-dynamic' ? !$.ui.contains(this.element[0], itemElement) : true) + //&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container + ) { + + this.direction = intersection == 1 ? "down" : "up"; + + if (this.options.tolerance == "pointer" || this._intersectsWithSides(item)) { + this._rearrange(event, item); + } else { + break; + } + + this._trigger("change", event, this._uiHash()); + break; + } + } + + //Post events to containers + this._contactContainers(event); + + //Interconnect with droppables + if($.ui.ddmanager) $.ui.ddmanager.drag(this, event); + + //Call callbacks + this._trigger('sort', event, this._uiHash()); + + this.lastPositionAbs = this.positionAbs; + return false; + + }, + + _mouseStop: function(event, noPropagation) { + + if(!event) return; + + //If we are using droppables, inform the manager about the drop + if ($.ui.ddmanager && !this.options.dropBehaviour) + $.ui.ddmanager.drop(this, event); + + if(this.options.revert) { + var self = this; + var cur = self.placeholder.offset(); + + self.reverting = true; + + $(this.helper).animate({ + left: cur.left - this.offset.parent.left - self.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft), + top: cur.top - this.offset.parent.top - self.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop) + }, parseInt(this.options.revert, 10) || 500, function() { + self._clear(event); + }); + } else { + this._clear(event, noPropagation); + } + + return false; + + }, + + cancel: function() { + + var self = this; + + if(this.dragging) { + + this._mouseUp({ target: null }); + + if(this.options.helper == "original") + this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"); + else + this.currentItem.show(); + + //Post deactivating events to containers + for (var i = this.containers.length - 1; i >= 0; i--){ + this.containers[i]._trigger("deactivate", null, self._uiHash(this)); + if(this.containers[i].containerCache.over) { + this.containers[i]._trigger("out", null, self._uiHash(this)); + this.containers[i].containerCache.over = 0; + } + } + + } + + if (this.placeholder) { + //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node! + if(this.placeholder[0].parentNode) this.placeholder[0].parentNode.removeChild(this.placeholder[0]); + if(this.options.helper != "original" && this.helper && this.helper[0].parentNode) this.helper.remove(); + + $.extend(this, { + helper: null, + dragging: false, + reverting: false, + _noFinalSort: null + }); + + if(this.domPosition.prev) { + $(this.domPosition.prev).after(this.currentItem); + } else { + $(this.domPosition.parent).prepend(this.currentItem); + } + } + + return this; + + }, + + serialize: function(o) { + + var items = this._getItemsAsjQuery(o && o.connected); + var str = []; o = o || {}; + + $(items).each(function() { + var res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/)); + if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2])); + }); + + if(!str.length && o.key) { + str.push(o.key + '='); + } + + return str.join('&'); + + }, + + toArray: function(o) { + + var items = this._getItemsAsjQuery(o && o.connected); + var ret = []; o = o || {}; + + items.each(function() { ret.push($(o.item || this).attr(o.attribute || 'id') || ''); }); + return ret; + + }, + + /* Be careful with the following core functions */ + _intersectsWith: function(item) { + + var x1 = this.positionAbs.left, + x2 = x1 + this.helperProportions.width, + y1 = this.positionAbs.top, + y2 = y1 + this.helperProportions.height; + + var l = item.left, + r = l + item.width, + t = item.top, + b = t + item.height; + + var dyClick = this.offset.click.top, + dxClick = this.offset.click.left; + + var isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r; + + if( this.options.tolerance == "pointer" + || this.options.forcePointerForContainers + || (this.options.tolerance != "pointer" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height']) + ) { + return isOverElement; + } else { + + return (l < x1 + (this.helperProportions.width / 2) // Right Half + && x2 - (this.helperProportions.width / 2) < r // Left Half + && t < y1 + (this.helperProportions.height / 2) // Bottom Half + && y2 - (this.helperProportions.height / 2) < b ); // Top Half + + } + }, + + _intersectsWithPointer: function(item) { + + var isOverElementHeight = (this.options.axis === 'x') || $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height), + isOverElementWidth = (this.options.axis === 'y') || $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width), + isOverElement = isOverElementHeight && isOverElementWidth, + verticalDirection = this._getDragVerticalDirection(), + horizontalDirection = this._getDragHorizontalDirection(); + + if (!isOverElement) + return false; + + return this.floating ? + ( ((horizontalDirection && horizontalDirection == "right") || verticalDirection == "down") ? 2 : 1 ) + : ( verticalDirection && (verticalDirection == "down" ? 2 : 1) ); + + }, + + _intersectsWithSides: function(item) { + + var isOverBottomHalf = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height), + isOverRightHalf = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width), + verticalDirection = this._getDragVerticalDirection(), + horizontalDirection = this._getDragHorizontalDirection(); + + if (this.floating && horizontalDirection) { + return ((horizontalDirection == "right" && isOverRightHalf) || (horizontalDirection == "left" && !isOverRightHalf)); + } else { + return verticalDirection && ((verticalDirection == "down" && isOverBottomHalf) || (verticalDirection == "up" && !isOverBottomHalf)); + } + + }, + + _getDragVerticalDirection: function() { + var delta = this.positionAbs.top - this.lastPositionAbs.top; + return delta != 0 && (delta > 0 ? "down" : "up"); + }, + + _getDragHorizontalDirection: function() { + var delta = this.positionAbs.left - this.lastPositionAbs.left; + return delta != 0 && (delta > 0 ? "right" : "left"); + }, + + refresh: function(event) { + this._refreshItems(event); + this.refreshPositions(); + return this; + }, + + _connectWith: function() { + var options = this.options; + return options.connectWith.constructor == String + ? [options.connectWith] + : options.connectWith; + }, + + _getItemsAsjQuery: function(connected) { + + var self = this; + var items = []; + var queries = []; + var connectWith = this._connectWith(); + + if(connectWith && connected) { + for (var i = connectWith.length - 1; i >= 0; i--){ + var cur = $(connectWith[i]); + for (var j = cur.length - 1; j >= 0; j--){ + var inst = $.data(cur[j], this.widgetName); + if(inst && inst != this && !inst.options.disabled) { + queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), inst]); + } + }; + }; + } + + queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), this]); + + for (var i = queries.length - 1; i >= 0; i--){ + queries[i][0].each(function() { + items.push(this); + }); + }; + + return $(items); + + }, + + _removeCurrentsFromItems: function() { + + var list = this.currentItem.find(":data(" + this.widgetName + "-item)"); + + for (var i=0; i < this.items.length; i++) { + + for (var j=0; j < list.length; j++) { + if(list[j] == this.items[i].item[0]) + this.items.splice(i,1); + }; + + }; + + }, + + _refreshItems: function(event) { + + this.items = []; + this.containers = [this]; + var items = this.items; + var self = this; + var queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]]; + var connectWith = this._connectWith(); + + if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down + for (var i = connectWith.length - 1; i >= 0; i--){ + var cur = $(connectWith[i]); + for (var j = cur.length - 1; j >= 0; j--){ + var inst = $.data(cur[j], this.widgetName); + if(inst && inst != this && !inst.options.disabled) { + queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]); + this.containers.push(inst); + } + }; + }; + } + + for (var i = queries.length - 1; i >= 0; i--) { + var targetData = queries[i][1]; + var _queries = queries[i][0]; + + for (var j=0, queriesLength = _queries.length; j < queriesLength; j++) { + var item = $(_queries[j]); + + item.data(this.widgetName + '-item', targetData); // Data for target checking (mouse manager) + + items.push({ + item: item, + instance: targetData, + width: 0, height: 0, + left: 0, top: 0 + }); + }; + }; + + }, + + refreshPositions: function(fast) { + + //This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change + if(this.offsetParent && this.helper) { + this.offset.parent = this._getParentOffset(); + } + + for (var i = this.items.length - 1; i >= 0; i--){ + var item = this.items[i]; + + //We ignore calculating positions of all connected containers when we're not over them + if(item.instance != this.currentContainer && this.currentContainer && item.item[0] != this.currentItem[0]) + continue; + + var t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item; + + if (!fast) { + item.width = t.outerWidth(); + item.height = t.outerHeight(); + } + + var p = t.offset(); + item.left = p.left; + item.top = p.top; + }; + + if(this.options.custom && this.options.custom.refreshContainers) { + this.options.custom.refreshContainers.call(this); + } else { + for (var i = this.containers.length - 1; i >= 0; i--){ + var p = this.containers[i].element.offset(); + this.containers[i].containerCache.left = p.left; + this.containers[i].containerCache.top = p.top; + this.containers[i].containerCache.width = this.containers[i].element.outerWidth(); + this.containers[i].containerCache.height = this.containers[i].element.outerHeight(); + }; + } + + return this; + }, + + _createPlaceholder: function(that) { + + var self = that || this, o = self.options; + + if(!o.placeholder || o.placeholder.constructor == String) { + var className = o.placeholder; + o.placeholder = { + element: function() { + + var el = $(document.createElement(self.currentItem[0].nodeName)) + .addClass(className || self.currentItem[0].className+" ui-sortable-placeholder") + .removeClass("ui-sortable-helper")[0]; + + if(!className) + el.style.visibility = "hidden"; + + return el; + }, + update: function(container, p) { + + // 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that + // 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified + if(className && !o.forcePlaceholderSize) return; + + //If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item + if(!p.height()) { p.height(self.currentItem.innerHeight() - parseInt(self.currentItem.css('paddingTop')||0, 10) - parseInt(self.currentItem.css('paddingBottom')||0, 10)); }; + if(!p.width()) { p.width(self.currentItem.innerWidth() - parseInt(self.currentItem.css('paddingLeft')||0, 10) - parseInt(self.currentItem.css('paddingRight')||0, 10)); }; + } + }; + } + + //Create the placeholder + self.placeholder = $(o.placeholder.element.call(self.element, self.currentItem)); + + //Append it after the actual current item + self.currentItem.after(self.placeholder); + + //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317) + o.placeholder.update(self, self.placeholder); + + }, + + _contactContainers: function(event) { + + // get innermost container that intersects with item + var innermostContainer = null, innermostIndex = null; + + + for (var i = this.containers.length - 1; i >= 0; i--){ + + // never consider a container that's located within the item itself + if($.ui.contains(this.currentItem[0], this.containers[i].element[0])) + continue; + + if(this._intersectsWith(this.containers[i].containerCache)) { + + // if we've already found a container and it's more "inner" than this, then continue + if(innermostContainer && $.ui.contains(this.containers[i].element[0], innermostContainer.element[0])) + continue; + + innermostContainer = this.containers[i]; + innermostIndex = i; + + } else { + // container doesn't intersect. trigger "out" event if necessary + if(this.containers[i].containerCache.over) { + this.containers[i]._trigger("out", event, this._uiHash(this)); + this.containers[i].containerCache.over = 0; + } + } + + } + + // if no intersecting containers found, return + if(!innermostContainer) return; + + // move the item into the container if it's not there already + if(this.containers.length === 1) { + this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); + this.containers[innermostIndex].containerCache.over = 1; + } else if(this.currentContainer != this.containers[innermostIndex]) { + + //When entering a new container, we will find the item with the least distance and append our item near it + var dist = 10000; var itemWithLeastDistance = null; var base = this.positionAbs[this.containers[innermostIndex].floating ? 'left' : 'top']; + for (var j = this.items.length - 1; j >= 0; j--) { + if(!$.ui.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) continue; + var cur = this.containers[innermostIndex].floating ? this.items[j].item.offset().left : this.items[j].item.offset().top; + if(Math.abs(cur - base) < dist) { + dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j]; + this.direction = (cur - base > 0) ? 'down' : 'up'; + } + } + + if(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled + return; + + this.currentContainer = this.containers[innermostIndex]; + itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true); + this._trigger("change", event, this._uiHash()); + this.containers[innermostIndex]._trigger("change", event, this._uiHash(this)); + + //Update the placeholder + this.options.placeholder.update(this.currentContainer, this.placeholder); + + this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); + this.containers[innermostIndex].containerCache.over = 1; + } + + + }, + + _createHelper: function(event) { + + var o = this.options; + var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper == 'clone' ? this.currentItem.clone() : this.currentItem); + + if(!helper.parents('body').length) //Add the helper to the DOM if that didn't happen already + $(o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]); + + if(helper[0] == this.currentItem[0]) + this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") }; + + if(helper[0].style.width == '' || o.forceHelperSize) helper.width(this.currentItem.width()); + if(helper[0].style.height == '' || o.forceHelperSize) helper.height(this.currentItem.height()); + + return helper; + + }, + + _adjustOffsetFromHelper: function(obj) { + if (typeof obj == 'string') { + obj = obj.split(' '); + } + if ($.isArray(obj)) { + obj = {left: +obj[0], top: +obj[1] || 0}; + } + if ('left' in obj) { + this.offset.click.left = obj.left + this.margins.left; + } + if ('right' in obj) { + this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; + } + if ('top' in obj) { + this.offset.click.top = obj.top + this.margins.top; + } + if ('bottom' in obj) { + this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; + } + }, + + _getParentOffset: function() { + + + //Get the offsetParent and cache its position + this.offsetParent = this.helper.offsetParent(); + var po = this.offsetParent.offset(); + + // This is a special case where we need to modify a offset calculated on start, since the following happened: + // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent + // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that + // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag + if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) { + po.left += this.scrollParent.scrollLeft(); + po.top += this.scrollParent.scrollTop(); + } + + if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information + || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix + po = { top: 0, left: 0 }; + + return { + top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), + left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) + }; + + }, + + _getRelativeOffset: function() { + + if(this.cssPosition == "relative") { + var p = this.currentItem.position(); + return { + top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(), + left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft() + }; + } else { + return { top: 0, left: 0 }; + } + + }, + + _cacheMargins: function() { + this.margins = { + left: (parseInt(this.currentItem.css("marginLeft"),10) || 0), + top: (parseInt(this.currentItem.css("marginTop"),10) || 0) + }; + }, + + _cacheHelperProportions: function() { + this.helperProportions = { + width: this.helper.outerWidth(), + height: this.helper.outerHeight() + }; + }, + + _setContainment: function() { + + var o = this.options; + if(o.containment == 'parent') o.containment = this.helper[0].parentNode; + if(o.containment == 'document' || o.containment == 'window') this.containment = [ + 0 - this.offset.relative.left - this.offset.parent.left, + 0 - this.offset.relative.top - this.offset.parent.top, + $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left, + ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top + ]; + + if(!(/^(document|window|parent)$/).test(o.containment)) { + var ce = $(o.containment)[0]; + var co = $(o.containment).offset(); + var over = ($(ce).css("overflow") != 'hidden'); + + this.containment = [ + co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left, + co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top, + co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left, + co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top + ]; + } + + }, + + _convertPositionTo: function(d, pos) { + + if(!pos) pos = this.position; + var mod = d == "absolute" ? 1 : -1; + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + + return { + top: ( + pos.top // The absolute mouse position + + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border) + - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod) + ), + left: ( + pos.left // The absolute mouse position + + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border) + - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod) + ) + }; + + }, + + _generatePosition: function(event) { + + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + + // This is another very weird special case that only happens for relative elements: + // 1. If the css position is relative + // 2. and the scroll parent is the document or similar to the offset parent + // we have to refresh the relative offset during the scroll so there are no jumps + if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) { + this.offset.relative = this._getRelativeOffset(); + } + + var pageX = event.pageX; + var pageY = event.pageY; + + /* + * - Position constraining - + * Constrain the position to a mix of grid, containment. + */ + + if(this.originalPosition) { //If we are not dragging yet, we won't check for options + + if(this.containment) { + if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left; + if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top; + if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left; + if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top; + } + + if(o.grid) { + var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1]; + pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; + + var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0]; + pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; + } + + } + + return { + top: ( + pageY // The absolute mouse position + - this.offset.click.top // Click offset (relative to the element) + - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.top // The offsetParent's offset without borders (offset + border) + + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) )) + ), + left: ( + pageX // The absolute mouse position + - this.offset.click.left // Click offset (relative to the element) + - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.left // The offsetParent's offset without borders (offset + border) + + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() )) + ) + }; + + }, + + _rearrange: function(event, i, a, hardRefresh) { + + a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction == 'down' ? i.item[0] : i.item[0].nextSibling)); + + //Various things done here to improve the performance: + // 1. we create a setTimeout, that calls refreshPositions + // 2. on the instance, we have a counter variable, that get's higher after every append + // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same + // 4. this lets only the last addition to the timeout stack through + this.counter = this.counter ? ++this.counter : 1; + var self = this, counter = this.counter; + + window.setTimeout(function() { + if(counter == self.counter) self.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove + },0); + + }, + + _clear: function(event, noPropagation) { + + this.reverting = false; + // We delay all events that have to be triggered to after the point where the placeholder has been removed and + // everything else normalized again + var delayedTriggers = [], self = this; + + // We first have to update the dom position of the actual currentItem + // Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088) + if(!this._noFinalSort && this.currentItem.parent().length) this.placeholder.before(this.currentItem); + this._noFinalSort = null; + + if(this.helper[0] == this.currentItem[0]) { + for(var i in this._storedCSS) { + if(this._storedCSS[i] == 'auto' || this._storedCSS[i] == 'static') this._storedCSS[i] = ''; + } + this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"); + } else { + this.currentItem.show(); + } + + if(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); }); + if((this.fromOutside || this.domPosition.prev != this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !noPropagation) delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed + if(!$.ui.contains(this.element[0], this.currentItem[0])) { //Node was moved out of the current element + if(!noPropagation) delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); }); + for (var i = this.containers.length - 1; i >= 0; i--){ + if($.ui.contains(this.containers[i].element[0], this.currentItem[0]) && !noPropagation) { + delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); }; }).call(this, this.containers[i])); + delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this)); }; }).call(this, this.containers[i])); + } + }; + }; + + //Post events to containers + for (var i = this.containers.length - 1; i >= 0; i--){ + if(!noPropagation) delayedTriggers.push((function(c) { return function(event) { c._trigger("deactivate", event, this._uiHash(this)); }; }).call(this, this.containers[i])); + if(this.containers[i].containerCache.over) { + delayedTriggers.push((function(c) { return function(event) { c._trigger("out", event, this._uiHash(this)); }; }).call(this, this.containers[i])); + this.containers[i].containerCache.over = 0; + } + } + + //Do what was originally in plugins + if(this._storedCursor) $('body').css("cursor", this._storedCursor); //Reset cursor + if(this._storedOpacity) this.helper.css("opacity", this._storedOpacity); //Reset opacity + if(this._storedZIndex) this.helper.css("zIndex", this._storedZIndex == 'auto' ? '' : this._storedZIndex); //Reset z-index + + this.dragging = false; + if(this.cancelHelperRemoval) { + if(!noPropagation) { + this._trigger("beforeStop", event, this._uiHash()); + for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events + this._trigger("stop", event, this._uiHash()); + } + return false; + } + + if(!noPropagation) this._trigger("beforeStop", event, this._uiHash()); + + //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node! + this.placeholder[0].parentNode.removeChild(this.placeholder[0]); + + if(this.helper[0] != this.currentItem[0]) this.helper.remove(); this.helper = null; + + if(!noPropagation) { + for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events + this._trigger("stop", event, this._uiHash()); + } + + this.fromOutside = false; + return true; + + }, + + _trigger: function() { + if ($.Widget.prototype._trigger.apply(this, arguments) === false) { + this.cancel(); + } + }, + + _uiHash: function(inst) { + var self = inst || this; + return { + helper: self.helper, + placeholder: self.placeholder || $([]), + position: self.position, + originalPosition: self.originalPosition, + offset: self.positionAbs, + item: self.currentItem, + sender: inst ? inst.element : null + }; + } + +}); + +$.extend($.ui.sortable, { + version: "1.8.21" +}); + +})(jQuery); +/*! + * jQuery UI Autocomplete 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Autocomplete + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.position.js + */ +(function( $, undefined ) { + +// used to prevent race conditions with remote data sources +var requestIndex = 0; + +$.widget( "ui.autocomplete", { + options: { + appendTo: "body", + autoFocus: false, + delay: 300, + minLength: 1, + position: { + my: "left top", + at: "left bottom", + collision: "none" + }, + source: null + }, + + pending: 0, + + _create: function() { + var self = this, + doc = this.element[ 0 ].ownerDocument, + suppressKeyPress; + this.isMultiLine = this.element.is( "textarea" ); + + this.element + .addClass( "ui-autocomplete-input" ) + .attr( "autocomplete", "off" ) + // TODO verify these actually work as intended + .attr({ + role: "textbox", + "aria-autocomplete": "list", + "aria-haspopup": "true" + }) + .bind( "keydown.autocomplete", function( event ) { + if ( self.options.disabled || self.element.propAttr( "readOnly" ) ) { + return; + } + + suppressKeyPress = false; + var keyCode = $.ui.keyCode; + switch( event.keyCode ) { + case keyCode.PAGE_UP: + self._move( "previousPage", event ); + break; + case keyCode.PAGE_DOWN: + self._move( "nextPage", event ); + break; + case keyCode.UP: + self._keyEvent( "previous", event ); + break; + case keyCode.DOWN: + self._keyEvent( "next", event ); + break; + case keyCode.ENTER: + case keyCode.NUMPAD_ENTER: + // when menu is open and has focus + if ( self.menu.active ) { + // #6055 - Opera still allows the keypress to occur + // which causes forms to submit + suppressKeyPress = true; + event.preventDefault(); + } + //passthrough - ENTER and TAB both select the current element + case keyCode.TAB: + if ( !self.menu.active ) { + return; + } + self.menu.select( event ); + break; + case keyCode.ESCAPE: + self.element.val( self.term ); + self.close( event ); + break; + default: + // keypress is triggered before the input value is changed + clearTimeout( self.searching ); + self.searching = setTimeout(function() { + // only search if the value has changed + if ( self.term != self.element.val() ) { + self.selectedItem = null; + self.search( null, event ); + } + }, self.options.delay ); + break; + } + }) + .bind( "keypress.autocomplete", function( event ) { + if ( suppressKeyPress ) { + suppressKeyPress = false; + event.preventDefault(); + } + }) + .bind( "focus.autocomplete", function() { + if ( self.options.disabled ) { + return; + } + + self.selectedItem = null; + self.previous = self.element.val(); + }) + .bind( "blur.autocomplete", function( event ) { + if ( self.options.disabled ) { + return; + } + + clearTimeout( self.searching ); + // clicks on the menu (or a button to trigger a search) will cause a blur event + self.closing = setTimeout(function() { + self.close( event ); + self._change( event ); + }, 150 ); + }); + this._initSource(); + this.menu = $( "
        " ) + .addClass( "ui-autocomplete" ) + .appendTo( $( this.options.appendTo || "body", doc )[0] ) + // prevent the close-on-blur in case of a "slow" click on the menu (long mousedown) + .mousedown(function( event ) { + // clicking on the scrollbar causes focus to shift to the body + // but we can't detect a mouseup or a click immediately afterward + // so we have to track the next mousedown and close the menu if + // the user clicks somewhere outside of the autocomplete + var menuElement = self.menu.element[ 0 ]; + if ( !$( event.target ).closest( ".ui-menu-item" ).length ) { + setTimeout(function() { + $( document ).one( 'mousedown', function( event ) { + if ( event.target !== self.element[ 0 ] && + event.target !== menuElement && + !$.ui.contains( menuElement, event.target ) ) { + self.close(); + } + }); + }, 1 ); + } + + // use another timeout to make sure the blur-event-handler on the input was already triggered + setTimeout(function() { + clearTimeout( self.closing ); + }, 13); + }) + .menu({ + focus: function( event, ui ) { + var item = ui.item.data( "item.autocomplete" ); + if ( false !== self._trigger( "focus", event, { item: item } ) ) { + // use value to match what will end up in the input, if it was a key event + if ( /^key/.test(event.originalEvent.type) ) { + self.element.val( item.value ); + } + } + }, + selected: function( event, ui ) { + var item = ui.item.data( "item.autocomplete" ), + previous = self.previous; + + // only trigger when focus was lost (click on menu) + if ( self.element[0] !== doc.activeElement ) { + self.element.focus(); + self.previous = previous; + // #6109 - IE triggers two focus events and the second + // is asynchronous, so we need to reset the previous + // term synchronously and asynchronously :-( + setTimeout(function() { + self.previous = previous; + self.selectedItem = item; + }, 1); + } + + if ( false !== self._trigger( "select", event, { item: item } ) ) { + self.element.val( item.value ); + } + // reset the term after the select event + // this allows custom select handling to work properly + self.term = self.element.val(); + + self.close( event ); + self.selectedItem = item; + }, + blur: function( event, ui ) { + // don't set the value of the text field if it's already correct + // this prevents moving the cursor unnecessarily + if ( self.menu.element.is(":visible") && + ( self.element.val() !== self.term ) ) { + self.element.val( self.term ); + } + } + }) + .zIndex( this.element.zIndex() + 1 ) + // workaround for jQuery bug #5781 http://dev.jquery.com/ticket/5781 + .css({ top: 0, left: 0 }) + .hide() + .data( "menu" ); + if ( $.fn.bgiframe ) { + this.menu.element.bgiframe(); + } + // turning off autocomplete prevents the browser from remembering the + // value when navigating through history, so we re-enable autocomplete + // if the page is unloaded before the widget is destroyed. #7790 + self.beforeunloadHandler = function() { + self.element.removeAttr( "autocomplete" ); + }; + $( window ).bind( "beforeunload", self.beforeunloadHandler ); + }, + + destroy: function() { + this.element + .removeClass( "ui-autocomplete-input" ) + .removeAttr( "autocomplete" ) + .removeAttr( "role" ) + .removeAttr( "aria-autocomplete" ) + .removeAttr( "aria-haspopup" ); + this.menu.element.remove(); + $( window ).unbind( "beforeunload", this.beforeunloadHandler ); + $.Widget.prototype.destroy.call( this ); + }, + + _setOption: function( key, value ) { + $.Widget.prototype._setOption.apply( this, arguments ); + if ( key === "source" ) { + this._initSource(); + } + if ( key === "appendTo" ) { + this.menu.element.appendTo( $( value || "body", this.element[0].ownerDocument )[0] ) + } + if ( key === "disabled" && value && this.xhr ) { + this.xhr.abort(); + } + }, + + _initSource: function() { + var self = this, + array, + url; + if ( $.isArray(this.options.source) ) { + array = this.options.source; + this.source = function( request, response ) { + response( $.ui.autocomplete.filter(array, request.term) ); + }; + } else if ( typeof this.options.source === "string" ) { + url = this.options.source; + this.source = function( request, response ) { + if ( self.xhr ) { + self.xhr.abort(); + } + self.xhr = $.ajax({ + url: url, + data: request, + dataType: "json", + success: function( data, status ) { + response( data ); + }, + error: function() { + response( [] ); + } + }); + }; + } else { + this.source = this.options.source; + } + }, + + search: function( value, event ) { + value = value != null ? value : this.element.val(); + + // always save the actual value, not the one passed as an argument + this.term = this.element.val(); + + if ( value.length < this.options.minLength ) { + return this.close( event ); + } + + clearTimeout( this.closing ); + if ( this._trigger( "search", event ) === false ) { + return; + } + + return this._search( value ); + }, + + _search: function( value ) { + this.pending++; + this.element.addClass( "ui-autocomplete-loading" ); + + this.source( { term: value }, this._response() ); + }, + + _response: function() { + var that = this, + index = ++requestIndex; + + return function( content ) { + if ( index === requestIndex ) { + that.__response( content ); + } + + that.pending--; + if ( !that.pending ) { + that.element.removeClass( "ui-autocomplete-loading" ); + } + }; + }, + + __response: function( content ) { + if ( !this.options.disabled && content && content.length ) { + content = this._normalize( content ); + this._suggest( content ); + this._trigger( "open" ); + } else { + this.close(); + } + }, + + close: function( event ) { + clearTimeout( this.closing ); + if ( this.menu.element.is(":visible") ) { + this.menu.element.hide(); + this.menu.deactivate(); + this._trigger( "close", event ); + } + }, + + _change: function( event ) { + if ( this.previous !== this.element.val() ) { + this._trigger( "change", event, { item: this.selectedItem } ); + } + }, + + _normalize: function( items ) { + // assume all items have the right format when the first item is complete + if ( items.length && items[0].label && items[0].value ) { + return items; + } + return $.map( items, function(item) { + if ( typeof item === "string" ) { + return { + label: item, + value: item + }; + } + return $.extend({ + label: item.label || item.value, + value: item.value || item.label + }, item ); + }); + }, + + _suggest: function( items ) { + var ul = this.menu.element + .empty() + .zIndex( this.element.zIndex() + 1 ); + this._renderMenu( ul, items ); + // TODO refresh should check if the active item is still in the dom, removing the need for a manual deactivate + this.menu.deactivate(); + this.menu.refresh(); + + // size and position menu + ul.show(); + this._resizeMenu(); + ul.position( $.extend({ + of: this.element + }, this.options.position )); + + if ( this.options.autoFocus ) { + this.menu.next( new $.Event("mouseover") ); + } + }, + + _resizeMenu: function() { + var ul = this.menu.element; + ul.outerWidth( Math.max( + // Firefox wraps long text (possibly a rounding bug) + // so we add 1px to avoid the wrapping (#7513) + ul.width( "" ).outerWidth() + 1, + this.element.outerWidth() + ) ); + }, + + _renderMenu: function( ul, items ) { + var self = this; + $.each( items, function( index, item ) { + self._renderItem( ul, item ); + }); + }, + + _renderItem: function( ul, item) { + return $( "
      • " ) + .data( "item.autocomplete", item ) + .append( $( "" ).text( item.label ) ) + .appendTo( ul ); + }, + + _move: function( direction, event ) { + if ( !this.menu.element.is(":visible") ) { + this.search( null, event ); + return; + } + if ( this.menu.first() && /^previous/.test(direction) || + this.menu.last() && /^next/.test(direction) ) { + this.element.val( this.term ); + this.menu.deactivate(); + return; + } + this.menu[ direction ]( event ); + }, + + widget: function() { + return this.menu.element; + }, + _keyEvent: function( keyEvent, event ) { + if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) { + this._move( keyEvent, event ); + + // prevents moving cursor to beginning/end of the text field in some browsers + event.preventDefault(); + } + } +}); + +$.extend( $.ui.autocomplete, { + escapeRegex: function( value ) { + return value.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); + }, + filter: function(array, term) { + var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" ); + return $.grep( array, function(value) { + return matcher.test( value.label || value.value || value ); + }); + } +}); + +}( jQuery )); + +/* + * jQuery UI Menu (not officially released) + * + * This widget isn't yet finished and the API is subject to change. We plan to finish + * it for the next release. You're welcome to give it a try anyway and give us feedback, + * as long as you're okay with migrating your code later on. We can help with that, too. + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Menu + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function($) { + +$.widget("ui.menu", { + _create: function() { + var self = this; + this.element + .addClass("ui-menu ui-widget ui-widget-content ui-corner-all") + .attr({ + role: "listbox", + "aria-activedescendant": "ui-active-menuitem" + }) + .click(function( event ) { + if ( !$( event.target ).closest( ".ui-menu-item a" ).length ) { + return; + } + // temporary + event.preventDefault(); + self.select( event ); + }); + this.refresh(); + }, + + refresh: function() { + var self = this; + + // don't refresh list items that are already adapted + var items = this.element.children("li:not(.ui-menu-item):has(a)") + .addClass("ui-menu-item") + .attr("role", "menuitem"); + + items.children("a") + .addClass("ui-corner-all") + .attr("tabindex", -1) + // mouseenter doesn't work with event delegation + .mouseenter(function( event ) { + self.activate( event, $(this).parent() ); + }) + .mouseleave(function() { + self.deactivate(); + }); + }, + + activate: function( event, item ) { + this.deactivate(); + if (this.hasScroll()) { + var offset = item.offset().top - this.element.offset().top, + scroll = this.element.scrollTop(), + elementHeight = this.element.height(); + if (offset < 0) { + this.element.scrollTop( scroll + offset); + } else if (offset >= elementHeight) { + this.element.scrollTop( scroll + offset - elementHeight + item.height()); + } + } + this.active = item.eq(0) + .children("a") + .addClass("ui-state-hover") + .attr("id", "ui-active-menuitem") + .end(); + this._trigger("focus", event, { item: item }); + }, + + deactivate: function() { + if (!this.active) { return; } + + this.active.children("a") + .removeClass("ui-state-hover") + .removeAttr("id"); + this._trigger("blur"); + this.active = null; + }, + + next: function(event) { + this.move("next", ".ui-menu-item:first", event); + }, + + previous: function(event) { + this.move("prev", ".ui-menu-item:last", event); + }, + + first: function() { + return this.active && !this.active.prevAll(".ui-menu-item").length; + }, + + last: function() { + return this.active && !this.active.nextAll(".ui-menu-item").length; + }, + + move: function(direction, edge, event) { + if (!this.active) { + this.activate(event, this.element.children(edge)); + return; + } + var next = this.active[direction + "All"](".ui-menu-item").eq(0); + if (next.length) { + this.activate(event, next); + } else { + this.activate(event, this.element.children(edge)); + } + }, + + // TODO merge with previousPage + nextPage: function(event) { + if (this.hasScroll()) { + // TODO merge with no-scroll-else + if (!this.active || this.last()) { + this.activate(event, this.element.children(".ui-menu-item:first")); + return; + } + var base = this.active.offset().top, + height = this.element.height(), + result = this.element.children(".ui-menu-item").filter(function() { + var close = $(this).offset().top - base - height + $(this).height(); + // TODO improve approximation + return close < 10 && close > -10; + }); + + // TODO try to catch this earlier when scrollTop indicates the last page anyway + if (!result.length) { + result = this.element.children(".ui-menu-item:last"); + } + this.activate(event, result); + } else { + this.activate(event, this.element.children(".ui-menu-item") + .filter(!this.active || this.last() ? ":first" : ":last")); + } + }, + + // TODO merge with nextPage + previousPage: function(event) { + if (this.hasScroll()) { + // TODO merge with no-scroll-else + if (!this.active || this.first()) { + this.activate(event, this.element.children(".ui-menu-item:last")); + return; + } + + var base = this.active.offset().top, + height = this.element.height(), + result = this.element.children(".ui-menu-item").filter(function() { + var close = $(this).offset().top - base + height - $(this).height(); + // TODO improve approximation + return close < 10 && close > -10; + }); + + // TODO try to catch this earlier when scrollTop indicates the last page anyway + if (!result.length) { + result = this.element.children(".ui-menu-item:first"); + } + this.activate(event, result); + } else { + this.activate(event, this.element.children(".ui-menu-item") + .filter(!this.active || this.first() ? ":last" : ":first")); + } + }, + + hasScroll: function() { + return this.element.height() < this.element[ $.fn.prop ? "prop" : "attr" ]("scrollHeight"); + }, + + select: function( event ) { + this._trigger("selected", event, { item: this.active }); + } +}); + +}(jQuery)); +/*! + * jQuery UI Button 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Button + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +var lastActive, startXPos, startYPos, clickDragged, + baseClasses = "ui-button ui-widget ui-state-default ui-corner-all", + stateClasses = "ui-state-hover ui-state-active ", + typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only", + formResetHandler = function() { + var buttons = $( this ).find( ":ui-button" ); + setTimeout(function() { + buttons.button( "refresh" ); + }, 1 ); + }, + radioGroup = function( radio ) { + var name = radio.name, + form = radio.form, + radios = $( [] ); + if ( name ) { + if ( form ) { + radios = $( form ).find( "[name='" + name + "']" ); + } else { + radios = $( "[name='" + name + "']", radio.ownerDocument ) + .filter(function() { + return !this.form; + }); + } + } + return radios; + }; + +$.widget( "ui.button", { + options: { + disabled: null, + text: true, + label: null, + icons: { + primary: null, + secondary: null + } + }, + _create: function() { + this.element.closest( "form" ) + .unbind( "reset.button" ) + .bind( "reset.button", formResetHandler ); + + if ( typeof this.options.disabled !== "boolean" ) { + this.options.disabled = !!this.element.propAttr( "disabled" ); + } else { + this.element.propAttr( "disabled", this.options.disabled ); + } + + this._determineButtonType(); + this.hasTitle = !!this.buttonElement.attr( "title" ); + + var self = this, + options = this.options, + toggleButton = this.type === "checkbox" || this.type === "radio", + hoverClass = "ui-state-hover" + ( !toggleButton ? " ui-state-active" : "" ), + focusClass = "ui-state-focus"; + + if ( options.label === null ) { + options.label = this.buttonElement.html(); + } + + this.buttonElement + .addClass( baseClasses ) + .attr( "role", "button" ) + .bind( "mouseenter.button", function() { + if ( options.disabled ) { + return; + } + $( this ).addClass( "ui-state-hover" ); + if ( this === lastActive ) { + $( this ).addClass( "ui-state-active" ); + } + }) + .bind( "mouseleave.button", function() { + if ( options.disabled ) { + return; + } + $( this ).removeClass( hoverClass ); + }) + .bind( "click.button", function( event ) { + if ( options.disabled ) { + event.preventDefault(); + event.stopImmediatePropagation(); + } + }); + + this.element + .bind( "focus.button", function() { + // no need to check disabled, focus won't be triggered anyway + self.buttonElement.addClass( focusClass ); + }) + .bind( "blur.button", function() { + self.buttonElement.removeClass( focusClass ); + }); + + if ( toggleButton ) { + this.element.bind( "change.button", function() { + if ( clickDragged ) { + return; + } + self.refresh(); + }); + // if mouse moves between mousedown and mouseup (drag) set clickDragged flag + // prevents issue where button state changes but checkbox/radio checked state + // does not in Firefox (see ticket #6970) + this.buttonElement + .bind( "mousedown.button", function( event ) { + if ( options.disabled ) { + return; + } + clickDragged = false; + startXPos = event.pageX; + startYPos = event.pageY; + }) + .bind( "mouseup.button", function( event ) { + if ( options.disabled ) { + return; + } + if ( startXPos !== event.pageX || startYPos !== event.pageY ) { + clickDragged = true; + } + }); + } + + if ( this.type === "checkbox" ) { + this.buttonElement.bind( "click.button", function() { + if ( options.disabled || clickDragged ) { + return false; + } + $( this ).toggleClass( "ui-state-active" ); + self.buttonElement.attr( "aria-pressed", self.element[0].checked ); + }); + } else if ( this.type === "radio" ) { + this.buttonElement.bind( "click.button", function() { + if ( options.disabled || clickDragged ) { + return false; + } + $( this ).addClass( "ui-state-active" ); + self.buttonElement.attr( "aria-pressed", "true" ); + + var radio = self.element[ 0 ]; + radioGroup( radio ) + .not( radio ) + .map(function() { + return $( this ).button( "widget" )[ 0 ]; + }) + .removeClass( "ui-state-active" ) + .attr( "aria-pressed", "false" ); + }); + } else { + this.buttonElement + .bind( "mousedown.button", function() { + if ( options.disabled ) { + return false; + } + $( this ).addClass( "ui-state-active" ); + lastActive = this; + $( document ).one( "mouseup", function() { + lastActive = null; + }); + }) + .bind( "mouseup.button", function() { + if ( options.disabled ) { + return false; + } + $( this ).removeClass( "ui-state-active" ); + }) + .bind( "keydown.button", function(event) { + if ( options.disabled ) { + return false; + } + if ( event.keyCode == $.ui.keyCode.SPACE || event.keyCode == $.ui.keyCode.ENTER ) { + $( this ).addClass( "ui-state-active" ); + } + }) + .bind( "keyup.button", function() { + $( this ).removeClass( "ui-state-active" ); + }); + + if ( this.buttonElement.is("a") ) { + this.buttonElement.keyup(function(event) { + if ( event.keyCode === $.ui.keyCode.SPACE ) { + // TODO pass through original event correctly (just as 2nd argument doesn't work) + $( this ).click(); + } + }); + } + } + + // TODO: pull out $.Widget's handling for the disabled option into + // $.Widget.prototype._setOptionDisabled so it's easy to proxy and can + // be overridden by individual plugins + this._setOption( "disabled", options.disabled ); + this._resetButton(); + }, + + _determineButtonType: function() { + + if ( this.element.is(":checkbox") ) { + this.type = "checkbox"; + } else if ( this.element.is(":radio") ) { + this.type = "radio"; + } else if ( this.element.is("input") ) { + this.type = "input"; + } else { + this.type = "button"; + } + + if ( this.type === "checkbox" || this.type === "radio" ) { + // we don't search against the document in case the element + // is disconnected from the DOM + var ancestor = this.element.parents().filter(":last"), + labelSelector = "label[for='" + this.element.attr("id") + "']"; + this.buttonElement = ancestor.find( labelSelector ); + if ( !this.buttonElement.length ) { + ancestor = ancestor.length ? ancestor.siblings() : this.element.siblings(); + this.buttonElement = ancestor.filter( labelSelector ); + if ( !this.buttonElement.length ) { + this.buttonElement = ancestor.find( labelSelector ); + } + } + this.element.addClass( "ui-helper-hidden-accessible" ); + + var checked = this.element.is( ":checked" ); + if ( checked ) { + this.buttonElement.addClass( "ui-state-active" ); + } + this.buttonElement.attr( "aria-pressed", checked ); + } else { + this.buttonElement = this.element; + } + }, + + widget: function() { + return this.buttonElement; + }, + + destroy: function() { + this.element + .removeClass( "ui-helper-hidden-accessible" ); + this.buttonElement + .removeClass( baseClasses + " " + stateClasses + " " + typeClasses ) + .removeAttr( "role" ) + .removeAttr( "aria-pressed" ) + .html( this.buttonElement.find(".ui-button-text").html() ); + + if ( !this.hasTitle ) { + this.buttonElement.removeAttr( "title" ); + } + + $.Widget.prototype.destroy.call( this ); + }, + + _setOption: function( key, value ) { + $.Widget.prototype._setOption.apply( this, arguments ); + if ( key === "disabled" ) { + if ( value ) { + this.element.propAttr( "disabled", true ); + } else { + this.element.propAttr( "disabled", false ); + } + return; + } + this._resetButton(); + }, + + refresh: function() { + var isDisabled = this.element.is( ":disabled" ); + if ( isDisabled !== this.options.disabled ) { + this._setOption( "disabled", isDisabled ); + } + if ( this.type === "radio" ) { + radioGroup( this.element[0] ).each(function() { + if ( $( this ).is( ":checked" ) ) { + $( this ).button( "widget" ) + .addClass( "ui-state-active" ) + .attr( "aria-pressed", "true" ); + } else { + $( this ).button( "widget" ) + .removeClass( "ui-state-active" ) + .attr( "aria-pressed", "false" ); + } + }); + } else if ( this.type === "checkbox" ) { + if ( this.element.is( ":checked" ) ) { + this.buttonElement + .addClass( "ui-state-active" ) + .attr( "aria-pressed", "true" ); + } else { + this.buttonElement + .removeClass( "ui-state-active" ) + .attr( "aria-pressed", "false" ); + } + } + }, + + _resetButton: function() { + if ( this.type === "input" ) { + if ( this.options.label ) { + this.element.val( this.options.label ); + } + return; + } + var buttonElement = this.buttonElement.removeClass( typeClasses ), + buttonText = $( "", this.element[0].ownerDocument ) + .addClass( "ui-button-text" ) + .html( this.options.label ) + .appendTo( buttonElement.empty() ) + .text(), + icons = this.options.icons, + multipleIcons = icons.primary && icons.secondary, + buttonClasses = []; + + if ( icons.primary || icons.secondary ) { + if ( this.options.text ) { + buttonClasses.push( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) ); + } + + if ( icons.primary ) { + buttonElement.prepend( "" ); + } + + if ( icons.secondary ) { + buttonElement.append( "" ); + } + + if ( !this.options.text ) { + buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" ); + + if ( !this.hasTitle ) { + buttonElement.attr( "title", buttonText ); + } + } + } else { + buttonClasses.push( "ui-button-text-only" ); + } + buttonElement.addClass( buttonClasses.join( " " ) ); + } +}); + +$.widget( "ui.buttonset", { + options: { + items: ":button, :submit, :reset, :checkbox, :radio, a, :data(button)" + }, + + _create: function() { + this.element.addClass( "ui-buttonset" ); + }, + + _init: function() { + this.refresh(); + }, + + _setOption: function( key, value ) { + if ( key === "disabled" ) { + this.buttons.button( "option", key, value ); + } + + $.Widget.prototype._setOption.apply( this, arguments ); + }, + + refresh: function() { + var rtl = this.element.css( "direction" ) === "rtl"; + + this.buttons = this.element.find( this.options.items ) + .filter( ":ui-button" ) + .button( "refresh" ) + .end() + .not( ":ui-button" ) + .button() + .end() + .map(function() { + return $( this ).button( "widget" )[ 0 ]; + }) + .removeClass( "ui-corner-all ui-corner-left ui-corner-right" ) + .filter( ":first" ) + .addClass( rtl ? "ui-corner-right" : "ui-corner-left" ) + .end() + .filter( ":last" ) + .addClass( rtl ? "ui-corner-left" : "ui-corner-right" ) + .end() + .end(); + }, + + destroy: function() { + this.element.removeClass( "ui-buttonset" ); + this.buttons + .map(function() { + return $( this ).button( "widget" )[ 0 ]; + }) + .removeClass( "ui-corner-left ui-corner-right" ) + .end() + .button( "destroy" ); + + $.Widget.prototype.destroy.call( this ); + } +}); + +}( jQuery ) ); +/*! + * jQuery UI Slider 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Slider + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +// number of pages in a slider +// (how many times can you page up/down to go through the whole range) +var numPages = 5; + +$.widget( "ui.slider", $.ui.mouse, { + + widgetEventPrefix: "slide", + + options: { + animate: false, + distance: 0, + max: 100, + min: 0, + orientation: "horizontal", + range: false, + step: 1, + value: 0, + values: null + }, + + _create: function() { + var self = this, + o = this.options, + existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ), + handle = "", + handleCount = ( o.values && o.values.length ) || 1, + handles = []; + + this._keySliding = false; + this._mouseSliding = false; + this._animateOff = true; + this._handleIndex = null; + this._detectOrientation(); + this._mouseInit(); + + this.element + .addClass( "ui-slider" + + " ui-slider-" + this.orientation + + " ui-widget" + + " ui-widget-content" + + " ui-corner-all" + + ( o.disabled ? " ui-slider-disabled ui-disabled" : "" ) ); + + this.range = $([]); + + if ( o.range ) { + if ( o.range === true ) { + if ( !o.values ) { + o.values = [ this._valueMin(), this._valueMin() ]; + } + if ( o.values.length && o.values.length !== 2 ) { + o.values = [ o.values[0], o.values[0] ]; + } + } + + this.range = $( "
        " ) + .appendTo( this.element ) + .addClass( "ui-slider-range" + + // note: this isn't the most fittingly semantic framework class for this element, + // but worked best visually with a variety of themes + " ui-widget-header" + + ( ( o.range === "min" || o.range === "max" ) ? " ui-slider-range-" + o.range : "" ) ); + } + + for ( var i = existingHandles.length; i < handleCount; i += 1 ) { + handles.push( handle ); + } + + this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( self.element ) ); + + this.handle = this.handles.eq( 0 ); + + this.handles.add( this.range ).filter( "a" ) + .click(function( event ) { + event.preventDefault(); + }) + .hover(function() { + if ( !o.disabled ) { + $( this ).addClass( "ui-state-hover" ); + } + }, function() { + $( this ).removeClass( "ui-state-hover" ); + }) + .focus(function() { + if ( !o.disabled ) { + $( ".ui-slider .ui-state-focus" ).removeClass( "ui-state-focus" ); + $( this ).addClass( "ui-state-focus" ); + } else { + $( this ).blur(); + } + }) + .blur(function() { + $( this ).removeClass( "ui-state-focus" ); + }); + + this.handles.each(function( i ) { + $( this ).data( "index.ui-slider-handle", i ); + }); + + this.handles + .keydown(function( event ) { + var index = $( this ).data( "index.ui-slider-handle" ), + allowed, + curVal, + newVal, + step; + + if ( self.options.disabled ) { + return; + } + + switch ( event.keyCode ) { + case $.ui.keyCode.HOME: + case $.ui.keyCode.END: + case $.ui.keyCode.PAGE_UP: + case $.ui.keyCode.PAGE_DOWN: + case $.ui.keyCode.UP: + case $.ui.keyCode.RIGHT: + case $.ui.keyCode.DOWN: + case $.ui.keyCode.LEFT: + event.preventDefault(); + if ( !self._keySliding ) { + self._keySliding = true; + $( this ).addClass( "ui-state-active" ); + allowed = self._start( event, index ); + if ( allowed === false ) { + return; + } + } + break; + } + + step = self.options.step; + if ( self.options.values && self.options.values.length ) { + curVal = newVal = self.values( index ); + } else { + curVal = newVal = self.value(); + } + + switch ( event.keyCode ) { + case $.ui.keyCode.HOME: + newVal = self._valueMin(); + break; + case $.ui.keyCode.END: + newVal = self._valueMax(); + break; + case $.ui.keyCode.PAGE_UP: + newVal = self._trimAlignValue( curVal + ( (self._valueMax() - self._valueMin()) / numPages ) ); + break; + case $.ui.keyCode.PAGE_DOWN: + newVal = self._trimAlignValue( curVal - ( (self._valueMax() - self._valueMin()) / numPages ) ); + break; + case $.ui.keyCode.UP: + case $.ui.keyCode.RIGHT: + if ( curVal === self._valueMax() ) { + return; + } + newVal = self._trimAlignValue( curVal + step ); + break; + case $.ui.keyCode.DOWN: + case $.ui.keyCode.LEFT: + if ( curVal === self._valueMin() ) { + return; + } + newVal = self._trimAlignValue( curVal - step ); + break; + } + + self._slide( event, index, newVal ); + }) + .keyup(function( event ) { + var index = $( this ).data( "index.ui-slider-handle" ); + + if ( self._keySliding ) { + self._keySliding = false; + self._stop( event, index ); + self._change( event, index ); + $( this ).removeClass( "ui-state-active" ); + } + + }); + + this._refreshValue(); + + this._animateOff = false; + }, + + destroy: function() { + this.handles.remove(); + this.range.remove(); + + this.element + .removeClass( "ui-slider" + + " ui-slider-horizontal" + + " ui-slider-vertical" + + " ui-slider-disabled" + + " ui-widget" + + " ui-widget-content" + + " ui-corner-all" ) + .removeData( "slider" ) + .unbind( ".slider" ); + + this._mouseDestroy(); + + return this; + }, + + _mouseCapture: function( event ) { + var o = this.options, + position, + normValue, + distance, + closestHandle, + self, + index, + allowed, + offset, + mouseOverHandle; + + if ( o.disabled ) { + return false; + } + + this.elementSize = { + width: this.element.outerWidth(), + height: this.element.outerHeight() + }; + this.elementOffset = this.element.offset(); + + position = { x: event.pageX, y: event.pageY }; + normValue = this._normValueFromMouse( position ); + distance = this._valueMax() - this._valueMin() + 1; + self = this; + this.handles.each(function( i ) { + var thisDistance = Math.abs( normValue - self.values(i) ); + if ( distance > thisDistance ) { + distance = thisDistance; + closestHandle = $( this ); + index = i; + } + }); + + // workaround for bug #3736 (if both handles of a range are at 0, + // the first is always used as the one with least distance, + // and moving it is obviously prevented by preventing negative ranges) + if( o.range === true && this.values(1) === o.min ) { + index += 1; + closestHandle = $( this.handles[index] ); + } + + allowed = this._start( event, index ); + if ( allowed === false ) { + return false; + } + this._mouseSliding = true; + + self._handleIndex = index; + + closestHandle + .addClass( "ui-state-active" ) + .focus(); + + offset = closestHandle.offset(); + mouseOverHandle = !$( event.target ).parents().andSelf().is( ".ui-slider-handle" ); + this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : { + left: event.pageX - offset.left - ( closestHandle.width() / 2 ), + top: event.pageY - offset.top - + ( closestHandle.height() / 2 ) - + ( parseInt( closestHandle.css("borderTopWidth"), 10 ) || 0 ) - + ( parseInt( closestHandle.css("borderBottomWidth"), 10 ) || 0) + + ( parseInt( closestHandle.css("marginTop"), 10 ) || 0) + }; + + if ( !this.handles.hasClass( "ui-state-hover" ) ) { + this._slide( event, index, normValue ); + } + this._animateOff = true; + return true; + }, + + _mouseStart: function( event ) { + return true; + }, + + _mouseDrag: function( event ) { + var position = { x: event.pageX, y: event.pageY }, + normValue = this._normValueFromMouse( position ); + + this._slide( event, this._handleIndex, normValue ); + + return false; + }, + + _mouseStop: function( event ) { + this.handles.removeClass( "ui-state-active" ); + this._mouseSliding = false; + + this._stop( event, this._handleIndex ); + this._change( event, this._handleIndex ); + + this._handleIndex = null; + this._clickOffset = null; + this._animateOff = false; + + return false; + }, + + _detectOrientation: function() { + this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal"; + }, + + _normValueFromMouse: function( position ) { + var pixelTotal, + pixelMouse, + percentMouse, + valueTotal, + valueMouse; + + if ( this.orientation === "horizontal" ) { + pixelTotal = this.elementSize.width; + pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 ); + } else { + pixelTotal = this.elementSize.height; + pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 ); + } + + percentMouse = ( pixelMouse / pixelTotal ); + if ( percentMouse > 1 ) { + percentMouse = 1; + } + if ( percentMouse < 0 ) { + percentMouse = 0; + } + if ( this.orientation === "vertical" ) { + percentMouse = 1 - percentMouse; + } + + valueTotal = this._valueMax() - this._valueMin(); + valueMouse = this._valueMin() + percentMouse * valueTotal; + + return this._trimAlignValue( valueMouse ); + }, + + _start: function( event, index ) { + var uiHash = { + handle: this.handles[ index ], + value: this.value() + }; + if ( this.options.values && this.options.values.length ) { + uiHash.value = this.values( index ); + uiHash.values = this.values(); + } + return this._trigger( "start", event, uiHash ); + }, + + _slide: function( event, index, newVal ) { + var otherVal, + newValues, + allowed; + + if ( this.options.values && this.options.values.length ) { + otherVal = this.values( index ? 0 : 1 ); + + if ( ( this.options.values.length === 2 && this.options.range === true ) && + ( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) ) + ) { + newVal = otherVal; + } + + if ( newVal !== this.values( index ) ) { + newValues = this.values(); + newValues[ index ] = newVal; + // A slide can be canceled by returning false from the slide callback + allowed = this._trigger( "slide", event, { + handle: this.handles[ index ], + value: newVal, + values: newValues + } ); + otherVal = this.values( index ? 0 : 1 ); + if ( allowed !== false ) { + this.values( index, newVal, true ); + } + } + } else { + if ( newVal !== this.value() ) { + // A slide can be canceled by returning false from the slide callback + allowed = this._trigger( "slide", event, { + handle: this.handles[ index ], + value: newVal + } ); + if ( allowed !== false ) { + this.value( newVal ); + } + } + } + }, + + _stop: function( event, index ) { + var uiHash = { + handle: this.handles[ index ], + value: this.value() + }; + if ( this.options.values && this.options.values.length ) { + uiHash.value = this.values( index ); + uiHash.values = this.values(); + } + + this._trigger( "stop", event, uiHash ); + }, + + _change: function( event, index ) { + if ( !this._keySliding && !this._mouseSliding ) { + var uiHash = { + handle: this.handles[ index ], + value: this.value() + }; + if ( this.options.values && this.options.values.length ) { + uiHash.value = this.values( index ); + uiHash.values = this.values(); + } + + this._trigger( "change", event, uiHash ); + } + }, + + value: function( newValue ) { + if ( arguments.length ) { + this.options.value = this._trimAlignValue( newValue ); + this._refreshValue(); + this._change( null, 0 ); + return; + } + + return this._value(); + }, + + values: function( index, newValue ) { + var vals, + newValues, + i; + + if ( arguments.length > 1 ) { + this.options.values[ index ] = this._trimAlignValue( newValue ); + this._refreshValue(); + this._change( null, index ); + return; + } + + if ( arguments.length ) { + if ( $.isArray( arguments[ 0 ] ) ) { + vals = this.options.values; + newValues = arguments[ 0 ]; + for ( i = 0; i < vals.length; i += 1 ) { + vals[ i ] = this._trimAlignValue( newValues[ i ] ); + this._change( null, i ); + } + this._refreshValue(); + } else { + if ( this.options.values && this.options.values.length ) { + return this._values( index ); + } else { + return this.value(); + } + } + } else { + return this._values(); + } + }, + + _setOption: function( key, value ) { + var i, + valsLength = 0; + + if ( $.isArray( this.options.values ) ) { + valsLength = this.options.values.length; + } + + $.Widget.prototype._setOption.apply( this, arguments ); + + switch ( key ) { + case "disabled": + if ( value ) { + this.handles.filter( ".ui-state-focus" ).blur(); + this.handles.removeClass( "ui-state-hover" ); + this.handles.propAttr( "disabled", true ); + this.element.addClass( "ui-disabled" ); + } else { + this.handles.propAttr( "disabled", false ); + this.element.removeClass( "ui-disabled" ); + } + break; + case "orientation": + this._detectOrientation(); + this.element + .removeClass( "ui-slider-horizontal ui-slider-vertical" ) + .addClass( "ui-slider-" + this.orientation ); + this._refreshValue(); + break; + case "value": + this._animateOff = true; + this._refreshValue(); + this._change( null, 0 ); + this._animateOff = false; + break; + case "values": + this._animateOff = true; + this._refreshValue(); + for ( i = 0; i < valsLength; i += 1 ) { + this._change( null, i ); + } + this._animateOff = false; + break; + } + }, + + //internal value getter + // _value() returns value trimmed by min and max, aligned by step + _value: function() { + var val = this.options.value; + val = this._trimAlignValue( val ); + + return val; + }, + + //internal values getter + // _values() returns array of values trimmed by min and max, aligned by step + // _values( index ) returns single value trimmed by min and max, aligned by step + _values: function( index ) { + var val, + vals, + i; + + if ( arguments.length ) { + val = this.options.values[ index ]; + val = this._trimAlignValue( val ); + + return val; + } else { + // .slice() creates a copy of the array + // this copy gets trimmed by min and max and then returned + vals = this.options.values.slice(); + for ( i = 0; i < vals.length; i+= 1) { + vals[ i ] = this._trimAlignValue( vals[ i ] ); + } + + return vals; + } + }, + + // returns the step-aligned value that val is closest to, between (inclusive) min and max + _trimAlignValue: function( val ) { + if ( val <= this._valueMin() ) { + return this._valueMin(); + } + if ( val >= this._valueMax() ) { + return this._valueMax(); + } + var step = ( this.options.step > 0 ) ? this.options.step : 1, + valModStep = (val - this._valueMin()) % step, + alignValue = val - valModStep; + + if ( Math.abs(valModStep) * 2 >= step ) { + alignValue += ( valModStep > 0 ) ? step : ( -step ); + } + + // Since JavaScript has problems with large floats, round + // the final value to 5 digits after the decimal point (see #4124) + return parseFloat( alignValue.toFixed(5) ); + }, + + _valueMin: function() { + return this.options.min; + }, + + _valueMax: function() { + return this.options.max; + }, + + _refreshValue: function() { + var oRange = this.options.range, + o = this.options, + self = this, + animate = ( !this._animateOff ) ? o.animate : false, + valPercent, + _set = {}, + lastValPercent, + value, + valueMin, + valueMax; + + if ( this.options.values && this.options.values.length ) { + this.handles.each(function( i, j ) { + valPercent = ( self.values(i) - self._valueMin() ) / ( self._valueMax() - self._valueMin() ) * 100; + _set[ self.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; + $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); + if ( self.options.range === true ) { + if ( self.orientation === "horizontal" ) { + if ( i === 0 ) { + self.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate ); + } + if ( i === 1 ) { + self.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } ); + } + } else { + if ( i === 0 ) { + self.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate ); + } + if ( i === 1 ) { + self.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } ); + } + } + } + lastValPercent = valPercent; + }); + } else { + value = this.value(); + valueMin = this._valueMin(); + valueMax = this._valueMax(); + valPercent = ( valueMax !== valueMin ) ? + ( value - valueMin ) / ( valueMax - valueMin ) * 100 : + 0; + _set[ self.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; + this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); + + if ( oRange === "min" && this.orientation === "horizontal" ) { + this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate ); + } + if ( oRange === "max" && this.orientation === "horizontal" ) { + this.range[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } ); + } + if ( oRange === "min" && this.orientation === "vertical" ) { + this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate ); + } + if ( oRange === "max" && this.orientation === "vertical" ) { + this.range[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } ); + } + } + } + +}); + +$.extend( $.ui.slider, { + version: "1.8.21" +}); + +}(jQuery)); +/*! + * jQuery UI Progressbar 1.8.21 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Progressbar + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget( "ui.progressbar", { + options: { + value: 0, + max: 100 + }, + + min: 0, + + _create: function() { + this.element + .addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" ) + .attr({ + role: "progressbar", + "aria-valuemin": this.min, + "aria-valuemax": this.options.max, + "aria-valuenow": this._value() + }); + + this.valueDiv = $( "
        " ) + .appendTo( this.element ); + + this.oldValue = this._value(); + this._refreshValue(); + }, + + destroy: function() { + this.element + .removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" ) + .removeAttr( "role" ) + .removeAttr( "aria-valuemin" ) + .removeAttr( "aria-valuemax" ) + .removeAttr( "aria-valuenow" ); + + this.valueDiv.remove(); + + $.Widget.prototype.destroy.apply( this, arguments ); + }, + + value: function( newValue ) { + if ( newValue === undefined ) { + return this._value(); + } + + this._setOption( "value", newValue ); + return this; + }, + + _setOption: function( key, value ) { + if ( key === "value" ) { + this.options.value = value; + this._refreshValue(); + if ( this._value() === this.options.max ) { + this._trigger( "complete" ); + } + } + + $.Widget.prototype._setOption.apply( this, arguments ); + }, + + _value: function() { + var val = this.options.value; + // normalize invalid value + if ( typeof val !== "number" ) { + val = 0; + } + return Math.min( this.options.max, Math.max( this.min, val ) ); + }, + + _percentage: function() { + return 100 * this._value() / this.options.max; + }, + + _refreshValue: function() { + var value = this.value(); + var percentage = this._percentage(); + + if ( this.oldValue !== value ) { + this.oldValue = value; + this._trigger( "change" ); + } + + this.valueDiv + .toggle( value > this.min ) + .toggleClass( "ui-corner-right", value === this.options.max ) + .width( percentage.toFixed(0) + "%" ); + this.element.attr( "aria-valuenow", value ); + } +}); + +$.extend( $.ui.progressbar, { + version: "1.8.21" +}); + +})( jQuery ); diff --git a/target/disped-web/resources/js/jquery.uniform.js b/target/disped-web/resources/js/jquery.uniform.js new file mode 100644 index 0000000000000000000000000000000000000000..0903813f48d0f6202639d8ef004a040d19928eb5 --- /dev/null +++ b/target/disped-web/resources/js/jquery.uniform.js @@ -0,0 +1,672 @@ +/* + +Uniform v1.7.5 +Copyright © 2009 Josh Pyles / Pixelmatrix Design LLC +http://pixelmatrixdesign.com + +Requires jQuery 1.4 or newer + +Much thanks to Thomas Reynolds and Buck Wilson for their help and advice on this + +Disabling text selection is made possible by Mathias Bynens +and his noSelect plugin. + +Also, thanks to David Kaneda and Eugene Bond for their contributions to the plugin + +License: +MIT License - http://www.opensource.org/licenses/mit-license.php + +Enjoy! + +*/ + +(function($) { + $.uniform = { + options: { + selectClass: 'selector', + radioClass: 'radio', + checkboxClass: 'checker', + fileClass: 'uploader', + filenameClass: 'filename', + fileBtnClass: 'action', + fileDefaultText: 'No file selected', + fileBtnText: 'Choose File', + checkedClass: 'checked', + focusClass: 'focus', + disabledClass: 'disabled', + buttonClass: 'button', + activeClass: 'active', + hoverClass: 'hover', + useID: true, + idPrefix: 'uniform', + resetSelector: false, + autoHide: true + }, + elements: [] + }; + + if($.browser.msie && $.browser.version < 7){ + $.support.selectOpacity = false; + }else{ + $.support.selectOpacity = true; + } + + $.fn.uniform = function(options) { + + options = $.extend($.uniform.options, options); + + var el = this; + //code for specifying a reset button + if(options.resetSelector != false){ + $(options.resetSelector).mouseup(function(){ + function resetThis(){ + $.uniform.update(el); + } + setTimeout(resetThis, 10); + }); + } + + function doInput(elem){ + $el = $(elem); + $el.addClass($el.attr("type")); + storeElement(elem); + } + + function doTextarea(elem){ + $(elem).addClass("uniform"); + storeElement(elem); + } + + function doButton(elem){ + var $el = $(elem); + + var divTag = $("
        "), + spanTag = $(""); + + divTag.addClass(options.buttonClass); + + if(options.useID && $el.attr("id") != "") divTag.attr("id", options.idPrefix+"-"+$el.attr("id")); + + var btnText; + + if($el.is("a") || $el.is("button")){ + btnText = $el.text(); + }else if($el.is(":submit") || $el.is(":reset") || $el.is("input[type=button]")){ + btnText = $el.attr("value"); + } + + btnText = btnText == "" ? $el.is(":reset") ? "Reset" : "Submit" : btnText; + + spanTag.html(btnText); + + $el.css("opacity", 0); + $el.wrap(divTag); + $el.wrap(spanTag); + + //redefine variables + divTag = $el.closest("div"); + spanTag = $el.closest("span"); + + if($el.is(":disabled")) divTag.addClass(options.disabledClass); + + divTag.bind({ + "mouseenter.uniform": function(){ + divTag.addClass(options.hoverClass); + }, + "mouseleave.uniform": function(){ + divTag.removeClass(options.hoverClass); + divTag.removeClass(options.activeClass); + }, + "mousedown.uniform touchbegin.uniform": function(){ + divTag.addClass(options.activeClass); + }, + "mouseup.uniform touchend.uniform": function(){ + divTag.removeClass(options.activeClass); + }, + "click.uniform touchend.uniform": function(e){ + if($(e.target).is("span") || $(e.target).is("div")){ + if(elem[0].dispatchEvent){ + var ev = document.createEvent('MouseEvents'); + ev.initEvent( 'click', true, true ); + elem[0].dispatchEvent(ev); + }else{ + elem[0].click(); + } + } + } + }); + + elem.bind({ + "focus.uniform": function(){ + divTag.addClass(options.focusClass); + }, + "blur.uniform": function(){ + divTag.removeClass(options.focusClass); + } + }); + + $.uniform.noSelect(divTag); + storeElement(elem); + + } + + function doSelect(elem){ + var $el = $(elem); + + var divTag = $('
        '), + spanTag = $(''); + + if(!$el.css("display") == "none" && options.autoHide){ + divTag.hide(); + } + + divTag.addClass(options.selectClass); + + if(options.useID && elem.attr("id") != ""){ + divTag.attr("id", options.idPrefix+"-"+elem.attr("id")); + } + + var selected = elem.find(":selected:first"); + if(selected.length == 0){ + selected = elem.find("option:first"); + } + spanTag.html(selected.html()); + + elem.css('opacity', 0); + elem.wrap(divTag); + elem.before(spanTag); + + //redefine variables + divTag = elem.parent("div"); + spanTag = elem.siblings("span"); + + elem.bind({ + "change.uniform": function() { + spanTag.text(elem.find(":selected").html()); + divTag.removeClass(options.activeClass); + }, + "focus.uniform": function() { + divTag.addClass(options.focusClass); + }, + "blur.uniform": function() { + divTag.removeClass(options.focusClass); + divTag.removeClass(options.activeClass); + }, + "mousedown.uniform touchbegin.uniform": function() { + divTag.addClass(options.activeClass); + }, + "mouseup.uniform touchend.uniform": function() { + divTag.removeClass(options.activeClass); + }, + "click.uniform touchend.uniform": function(){ + divTag.removeClass(options.activeClass); + }, + "mouseenter.uniform": function() { + divTag.addClass(options.hoverClass); + }, + "mouseleave.uniform": function() { + divTag.removeClass(options.hoverClass); + divTag.removeClass(options.activeClass); + }, + "keyup.uniform": function(){ + spanTag.text(elem.find(":selected").html()); + } + }); + + //handle disabled state + if($(elem).attr("disabled")){ + //box is checked by default, check our box + divTag.addClass(options.disabledClass); + } + $.uniform.noSelect(spanTag); + + storeElement(elem); + + } + + function doCheckbox(elem){ + var $el = $(elem); + + var divTag = $('
        '), + spanTag = $(''); + + if(!$el.css("display") == "none" && options.autoHide){ + divTag.hide(); + } + + divTag.addClass(options.checkboxClass); + + //assign the id of the element + if(options.useID && elem.attr("id") != ""){ + divTag.attr("id", options.idPrefix+"-"+elem.attr("id")); + } + + //wrap with the proper elements + $(elem).wrap(divTag); + $(elem).wrap(spanTag); + + //redefine variables + spanTag = elem.parent(); + divTag = spanTag.parent(); + + //hide normal input and add focus classes + $(elem) + .css("opacity", 0) + .bind({ + "focus.uniform": function(){ + divTag.addClass(options.focusClass); + }, + "blur.uniform": function(){ + divTag.removeClass(options.focusClass); + }, + "click.uniform touchend.uniform": function(){ + if(!$(elem).attr("checked")){ + //box was just unchecked, uncheck span + spanTag.removeClass(options.checkedClass); + }else{ + //box was just checked, check span. + spanTag.addClass(options.checkedClass); + } + }, + "mousedown.uniform touchbegin.uniform": function() { + divTag.addClass(options.activeClass); + }, + "mouseup.uniform touchend.uniform": function() { + divTag.removeClass(options.activeClass); + }, + "mouseenter.uniform": function() { + divTag.addClass(options.hoverClass); + }, + "mouseleave.uniform": function() { + divTag.removeClass(options.hoverClass); + divTag.removeClass(options.activeClass); + } + }); + + //handle defaults + if($(elem).attr("checked")){ + //box is checked by default, check our box + spanTag.addClass(options.checkedClass); + } + + //handle disabled state + if($(elem).attr("disabled")){ + //box is checked by default, check our box + divTag.addClass(options.disabledClass); + } + + storeElement(elem); + } + + function doRadio(elem){ + var $el = $(elem); + + var divTag = $('
        '), + spanTag = $(''); + + if(!$el.css("display") == "none" && options.autoHide){ + divTag.hide(); + } + + divTag.addClass(options.radioClass); + + if(options.useID && elem.attr("id") != ""){ + divTag.attr("id", options.idPrefix+"-"+elem.attr("id")); + } + + //wrap with the proper elements + $(elem).wrap(divTag); + $(elem).wrap(spanTag); + + //redefine variables + spanTag = elem.parent(); + divTag = spanTag.parent(); + + //hide normal input and add focus classes + $(elem) + .css("opacity", 0) + .bind({ + "focus.uniform": function(){ + divTag.addClass(options.focusClass); + }, + "blur.uniform": function(){ + divTag.removeClass(options.focusClass); + }, + "click.uniform touchend.uniform": function(){ + if(!$(elem).attr("checked")){ + //box was just unchecked, uncheck span + spanTag.removeClass(options.checkedClass); + }else{ + //box was just checked, check span + var classes = options.radioClass.split(" ")[0]; + $("." + classes + " span." + options.checkedClass + ":has([name='" + $(elem).attr('name') + "'])").removeClass(options.checkedClass); + spanTag.addClass(options.checkedClass); + } + }, + "mousedown.uniform touchend.uniform": function() { + if(!$(elem).is(":disabled")){ + divTag.addClass(options.activeClass); + } + }, + "mouseup.uniform touchbegin.uniform": function() { + divTag.removeClass(options.activeClass); + }, + "mouseenter.uniform touchend.uniform": function() { + divTag.addClass(options.hoverClass); + }, + "mouseleave.uniform": function() { + divTag.removeClass(options.hoverClass); + divTag.removeClass(options.activeClass); + } + }); + + //handle defaults + if($(elem).attr("checked")){ + //box is checked by default, check span + spanTag.addClass(options.checkedClass); + } + //handle disabled state + if($(elem).attr("disabled")){ + //box is checked by default, check our box + divTag.addClass(options.disabledClass); + } + + storeElement(elem); + + } + + function doFile(elem){ + //sanitize input + var $el = $(elem); + + var divTag = $('
        '), + filenameTag = $(''+options.fileDefaultText+''), + btnTag = $(''+options.fileBtnText+''); + + if(!$el.css("display") == "none" && options.autoHide){ + divTag.hide(); + } + + divTag.addClass(options.fileClass); + filenameTag.addClass(options.filenameClass); + btnTag.addClass(options.fileBtnClass); + + if(options.useID && $el.attr("id") != ""){ + divTag.attr("id", options.idPrefix+"-"+$el.attr("id")); + } + + //wrap with the proper elements + $el.wrap(divTag); + $el.after(btnTag); + $el.after(filenameTag); + + //redefine variables + divTag = $el.closest("div"); + filenameTag = $el.siblings("."+options.filenameClass); + btnTag = $el.siblings("."+options.fileBtnClass); + + //set the size + if(!$el.attr("size")){ + var divWidth = divTag.width(); + //$el.css("width", divWidth); + $el.attr("size", divWidth/10); + } + + //actions + var setFilename = function() + { + var filename = $el.val(); + if (filename === '') + { + filename = options.fileDefaultText; + } + else + { + filename = filename.split(/[\/\\]+/); + filename = filename[(filename.length-1)]; + } + filenameTag.text(filename); + }; + + // Account for input saved across refreshes + setFilename(); + + $el + .css("opacity", 0) + .bind({ + "focus.uniform": function(){ + divTag.addClass(options.focusClass); + }, + "blur.uniform": function(){ + divTag.removeClass(options.focusClass); + }, + "mousedown.uniform": function() { + if(!$(elem).is(":disabled")){ + divTag.addClass(options.activeClass); + } + }, + "mouseup.uniform": function() { + divTag.removeClass(options.activeClass); + }, + "mouseenter.uniform": function() { + divTag.addClass(options.hoverClass); + }, + "mouseleave.uniform": function() { + divTag.removeClass(options.hoverClass); + divTag.removeClass(options.activeClass); + } + }); + + // IE7 doesn't fire onChange until blur or second fire. + if ($.browser.msie){ + // IE considers browser chrome blocking I/O, so it + // suspends tiemouts until after the file has been selected. + $el.bind('click.uniform.ie7', function() { + setTimeout(setFilename, 0); + }); + }else{ + // All other browsers behave properly + $el.bind('change.uniform', setFilename); + } + + //handle defaults + if($el.attr("disabled")){ + //box is checked by default, check our box + divTag.addClass(options.disabledClass); + } + + $.uniform.noSelect(filenameTag); + $.uniform.noSelect(btnTag); + + storeElement(elem); + + } + + $.uniform.restore = function(elem){ + if(elem == undefined){ + elem = $($.uniform.elements); + } + + $(elem).each(function(){ + if($(this).is(":checkbox")){ + //unwrap from span and div + $(this).unwrap().unwrap(); + }else if($(this).is("select")){ + //remove sibling span + $(this).siblings("span").remove(); + //unwrap parent div + $(this).unwrap(); + }else if($(this).is(":radio")){ + //unwrap from span and div + $(this).unwrap().unwrap(); + }else if($(this).is(":file")){ + //remove sibling spans + $(this).siblings("span").remove(); + //unwrap parent div + $(this).unwrap(); + }else if($(this).is("button, :submit, :reset, a, input[type='button']")){ + //unwrap from span and div + $(this).unwrap().unwrap(); + } + + //unbind events + $(this).unbind(".uniform"); + + //reset inline style + $(this).css("opacity", "1"); + + //remove item from list of uniformed elements + var index = $.inArray($(elem), $.uniform.elements); + $.uniform.elements.splice(index, 1); + }); + }; + + function storeElement(elem){ + //store this element in our global array + elem = $(elem).get(); + if(elem.length > 1){ + $.each(elem, function(i, val){ + $.uniform.elements.push(val); + }); + }else{ + $.uniform.elements.push(elem); + } + } + + //noSelect v1.0 + $.uniform.noSelect = function(elem) { + function f() { + return false; + }; + $(elem).each(function() { + this.onselectstart = this.ondragstart = f; // Webkit & IE + $(this) + .mousedown(f) // Webkit & Opera + .css({ MozUserSelect: 'none' }); // Firefox + }); + }; + + $.uniform.update = function(elem){ + if(elem == undefined){ + elem = $($.uniform.elements); + } + //sanitize input + elem = $(elem); + + elem.each(function(){ + //do to each item in the selector + //function to reset all classes + var $e = $(this); + + if($e.is("select")){ + //element is a select + var spanTag = $e.siblings("span"); + var divTag = $e.parent("div"); + + divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass); + + //reset current selected text + spanTag.html($e.find(":selected").html()); + + if($e.is(":disabled")){ + divTag.addClass(options.disabledClass); + }else{ + divTag.removeClass(options.disabledClass); + } + + }else if($e.is(":checkbox")){ + //element is a checkbox + var spanTag = $e.closest("span"); + var divTag = $e.closest("div"); + + divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass); + spanTag.removeClass(options.checkedClass); + + if($e.is(":checked")){ + spanTag.addClass(options.checkedClass); + } + if($e.is(":disabled")){ + divTag.addClass(options.disabledClass); + }else{ + divTag.removeClass(options.disabledClass); + } + + }else if($e.is(":radio")){ + //element is a radio + var spanTag = $e.closest("span"); + var divTag = $e.closest("div"); + + divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass); + spanTag.removeClass(options.checkedClass); + + if($e.is(":checked")){ + spanTag.addClass(options.checkedClass); + } + + if($e.is(":disabled")){ + divTag.addClass(options.disabledClass); + }else{ + divTag.removeClass(options.disabledClass); + } + }else if($e.is(":file")){ + var divTag = $e.parent("div"); + var filenameTag = $e.siblings(options.filenameClass); + btnTag = $e.siblings(options.fileBtnClass); + + divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass); + + filenameTag.text($e.val()); + + if($e.is(":disabled")){ + divTag.addClass(options.disabledClass); + }else{ + divTag.removeClass(options.disabledClass); + } + }else if($e.is(":submit") || $e.is(":reset") || $e.is("button") || $e.is("a") || elem.is("input[type=button]")){ + var divTag = $e.closest("div"); + divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass); + + if($e.is(":disabled")){ + divTag.addClass(options.disabledClass); + }else{ + divTag.removeClass(options.disabledClass); + } + + } + + }); + }; + + return this.each(function() { + if($.support.selectOpacity){ + var elem = $(this); + + if(elem.is("select")){ + //element is a select + if(elem.attr("multiple") != true){ + //element is not a multi-select + if(elem.attr("size") == undefined || elem.attr("size") <= 1){ + doSelect(elem); + } + } + }else if(elem.is(":checkbox")){ + //element is a checkbox + doCheckbox(elem); + }else if(elem.is(":radio")){ + //element is a radio + doRadio(elem); + }else if(elem.is(":file")){ + //element is a file upload + doFile(elem); + }else if(elem.is(":text, :password, input[type='email']")){ + doInput(elem); + }else if(elem.is("textarea")){ + doTextarea(elem); + }else if(elem.is("a") || elem.is(":submit") || elem.is(":reset") || elem.is("button") || elem.is("input[type=button]")){ + doButton(elem); + } + + } + }); + }; +})(jQuery); \ No newline at end of file diff --git a/target/disped-web/resources/js/jquery.validate.js b/target/disped-web/resources/js/jquery.validate.js new file mode 100644 index 0000000000000000000000000000000000000000..b7ed45b4a4db246176bc74b76aa9194bcfe8b181 --- /dev/null +++ b/target/disped-web/resources/js/jquery.validate.js @@ -0,0 +1,1188 @@ +/** + * jQuery Validation Plugin 1.9.0 + * + * http://bassistance.de/jquery-plugins/jquery-plugin-validation/ + * http://docs.jquery.com/Plugins/Validation + * + * Copyright (c) 2006 - 2011 Jörn Zaefferer + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ + +(function($) { + +$.extend($.fn, { + // http://docs.jquery.com/Plugins/Validation/validate + validate: function( options ) { + + // if nothing is selected, return nothing; can't chain anyway + if (!this.length) { + options && options.debug && window.console && console.warn( "nothing selected, can't validate, returning nothing" ); + return; + } + + // check if a validator for this form was already created + var validator = $.data(this[0], 'validator'); + if ( validator ) { + return validator; + } + + // Add novalidate tag if HTML5. + this.attr('novalidate', 'novalidate'); + + validator = new $.validator( options, this[0] ); + $.data(this[0], 'validator', validator); + + if ( validator.settings.onsubmit ) { + + var inputsAndButtons = this.find("input, button"); + + // allow suppresing validation by adding a cancel class to the submit button + inputsAndButtons.filter(".cancel").click(function () { + validator.cancelSubmit = true; + }); + + // when a submitHandler is used, capture the submitting button + if (validator.settings.submitHandler) { + inputsAndButtons.filter(":submit").click(function () { + validator.submitButton = this; + }); + } + + // validate the form on submit + this.submit( function( event ) { + if ( validator.settings.debug ) + // prevent form submit to be able to see console output + event.preventDefault(); + + function handle() { + if ( validator.settings.submitHandler ) { + if (validator.submitButton) { + // insert a hidden input as a replacement for the missing submit button + var hidden = $("").attr("name", validator.submitButton.name).val(validator.submitButton.value).appendTo(validator.currentForm); + } + validator.settings.submitHandler.call( validator, validator.currentForm ); + if (validator.submitButton) { + // and clean up afterwards; thanks to no-block-scope, hidden can be referenced + hidden.remove(); + } + return false; + } + return true; + } + + // prevent submit for invalid forms or custom submit handlers + if ( validator.cancelSubmit ) { + validator.cancelSubmit = false; + return handle(); + } + if ( validator.form() ) { + if ( validator.pendingRequest ) { + validator.formSubmitted = true; + return false; + } + return handle(); + } else { + validator.focusInvalid(); + return false; + } + }); + } + + return validator; + }, + // http://docs.jquery.com/Plugins/Validation/valid + valid: function() { + if ( $(this[0]).is('form')) { + return this.validate().form(); + } else { + var valid = true; + var validator = $(this[0].form).validate(); + this.each(function() { + valid &= validator.element(this); + }); + return valid; + } + }, + // attributes: space seperated list of attributes to retrieve and remove + removeAttrs: function(attributes) { + var result = {}, + $element = this; + $.each(attributes.split(/\s/), function(index, value) { + result[value] = $element.attr(value); + $element.removeAttr(value); + }); + return result; + }, + // http://docs.jquery.com/Plugins/Validation/rules + rules: function(command, argument) { + var element = this[0]; + + if (command) { + var settings = $.data(element.form, 'validator').settings; + var staticRules = settings.rules; + var existingRules = $.validator.staticRules(element); + switch(command) { + case "add": + $.extend(existingRules, $.validator.normalizeRule(argument)); + staticRules[element.name] = existingRules; + if (argument.messages) + settings.messages[element.name] = $.extend( settings.messages[element.name], argument.messages ); + break; + case "remove": + if (!argument) { + delete staticRules[element.name]; + return existingRules; + } + var filtered = {}; + $.each(argument.split(/\s/), function(index, method) { + filtered[method] = existingRules[method]; + delete existingRules[method]; + }); + return filtered; + } + } + + var data = $.validator.normalizeRules( + $.extend( + {}, + $.validator.metadataRules(element), + $.validator.classRules(element), + $.validator.attributeRules(element), + $.validator.staticRules(element) + ), element); + + // make sure required is at front + if (data.required) { + var param = data.required; + delete data.required; + data = $.extend({required: param}, data); + } + + return data; + } +}); + +// Custom selectors +$.extend($.expr[":"], { + // http://docs.jquery.com/Plugins/Validation/blank + blank: function(a) {return !$.trim("" + a.value);}, + // http://docs.jquery.com/Plugins/Validation/filled + filled: function(a) {return !!$.trim("" + a.value);}, + // http://docs.jquery.com/Plugins/Validation/unchecked + unchecked: function(a) {return !a.checked;} +}); + +// constructor for validator +$.validator = function( options, form ) { + this.settings = $.extend( true, {}, $.validator.defaults, options ); + this.currentForm = form; + this.init(); +}; + +$.validator.format = function(source, params) { + if ( arguments.length == 1 ) + return function() { + var args = $.makeArray(arguments); + args.unshift(source); + return $.validator.format.apply( this, args ); + }; + if ( arguments.length > 2 && params.constructor != Array ) { + params = $.makeArray(arguments).slice(1); + } + if ( params.constructor != Array ) { + params = [ params ]; + } + $.each(params, function(i, n) { + source = source.replace(new RegExp("\\{" + i + "\\}", "g"), n); + }); + return source; +}; + +$.extend($.validator, { + + defaults: { + messages: {}, + groups: {}, + rules: {}, + errorClass: "error", + validClass: "valid", + errorElement: "label", + focusInvalid: true, + errorContainer: $( [] ), + errorLabelContainer: $( [] ), + onsubmit: true, + ignore: ":hidden", + ignoreTitle: false, + onfocusin: function(element, event) { + this.lastActive = element; + + // hide error label and remove error class on focus if enabled + if ( this.settings.focusCleanup && !this.blockFocusCleanup ) { + this.settings.unhighlight && this.settings.unhighlight.call( this, element, this.settings.errorClass, this.settings.validClass ); + this.addWrapper(this.errorsFor(element)).hide(); + } + }, + onfocusout: function(element, event) { + if ( !this.checkable(element) && (element.name in this.submitted || !this.optional(element)) ) { + this.element(element); + } + }, + onkeyup: function(element, event) { + if ( element.name in this.submitted || element == this.lastElement ) { + this.element(element); + } + }, + onclick: function(element, event) { + // click on selects, radiobuttons and checkboxes + if ( element.name in this.submitted ) + this.element(element); + // or option elements, check parent select in that case + else if (element.parentNode.name in this.submitted) + this.element(element.parentNode); + }, + highlight: function(element, errorClass, validClass) { + if (element.type === 'radio') { + this.findByName(element.name).addClass(errorClass).removeClass(validClass); + } else { + $(element).addClass(errorClass).removeClass(validClass); + } + }, + unhighlight: function(element, errorClass, validClass) { + if (element.type === 'radio') { + this.findByName(element.name).removeClass(errorClass).addClass(validClass); + } else { + $(element).removeClass(errorClass).addClass(validClass); + } + } + }, + + // http://docs.jquery.com/Plugins/Validation/Validator/setDefaults + setDefaults: function(settings) { + $.extend( $.validator.defaults, settings ); + }, + + 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.", + accept: "Please enter a value with a valid extension.", + maxlength: $.validator.format("Please enter no more than {0} characters."), + minlength: $.validator.format("Please enter at least {0} characters."), + rangelength: $.validator.format("Please enter a value between {0} and {1} characters long."), + range: $.validator.format("Please enter a value between {0} and {1}."), + max: $.validator.format("Please enter a value less than or equal to {0}."), + min: $.validator.format("Please enter a value greater than or equal to {0}.") + }, + + autoCreateRanges: false, + + prototype: { + + init: function() { + this.labelContainer = $(this.settings.errorLabelContainer); + this.errorContext = this.labelContainer.length && this.labelContainer || $(this.currentForm); + this.containers = $(this.settings.errorContainer).add( this.settings.errorLabelContainer ); + this.submitted = {}; + this.valueCache = {}; + this.pendingRequest = 0; + this.pending = {}; + this.invalid = {}; + this.reset(); + + var groups = (this.groups = {}); + $.each(this.settings.groups, function(key, value) { + $.each(value.split(/\s/), function(index, name) { + groups[name] = key; + }); + }); + var rules = this.settings.rules; + $.each(rules, function(key, value) { + rules[key] = $.validator.normalizeRule(value); + }); + + function delegate(event) { + var validator = $.data(this[0].form, "validator"), + eventType = "on" + event.type.replace(/^validate/, ""); + validator.settings[eventType] && validator.settings[eventType].call(validator, this[0], event); + } + $(this.currentForm) + .validateDelegate("[type='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'] ", + "focusin focusout keyup", delegate) + .validateDelegate("[type='radio'], [type='checkbox'], select, option", "click", delegate); + + if (this.settings.invalidHandler) + $(this.currentForm).bind("invalid-form.validate", this.settings.invalidHandler); + }, + + // http://docs.jquery.com/Plugins/Validation/Validator/form + form: function() { + this.checkForm(); + $.extend(this.submitted, this.errorMap); + this.invalid = $.extend({}, this.errorMap); + if (!this.valid()) + $(this.currentForm).triggerHandler("invalid-form", [this]); + this.showErrors(); + return this.valid(); + }, + + checkForm: function() { + this.prepareForm(); + for ( var i = 0, elements = (this.currentElements = this.elements()); elements[i]; i++ ) { + this.check( elements[i] ); + } + return this.valid(); + }, + + // http://docs.jquery.com/Plugins/Validation/Validator/element + element: function( element ) { + element = this.validationTargetFor( this.clean( element ) ); + this.lastElement = element; + this.prepareElement( element ); + this.currentElements = $(element); + var result = this.check( element ); + if ( result ) { + delete this.invalid[element.name]; + } else { + this.invalid[element.name] = true; + } + if ( !this.numberOfInvalids() ) { + // Hide error containers on last error + this.toHide = this.toHide.add( this.containers ); + } + this.showErrors(); + return result; + }, + + // http://docs.jquery.com/Plugins/Validation/Validator/showErrors + showErrors: function(errors) { + if(errors) { + // add items to error list and map + $.extend( this.errorMap, errors ); + this.errorList = []; + for ( var name in errors ) { + this.errorList.push({ + message: errors[name], + element: this.findByName(name)[0] + }); + } + // remove items from success list + this.successList = $.grep( this.successList, function(element) { + return !(element.name in errors); + }); + } + this.settings.showErrors + ? this.settings.showErrors.call( this, this.errorMap, this.errorList ) + : this.defaultShowErrors(); + }, + + // http://docs.jquery.com/Plugins/Validation/Validator/resetForm + resetForm: function() { + if ( $.fn.resetForm ) + $( this.currentForm ).resetForm(); + this.submitted = {}; + this.lastElement = null; + this.prepareForm(); + this.hideErrors(); + this.elements().removeClass( this.settings.errorClass ); + }, + + numberOfInvalids: function() { + return this.objectLength(this.invalid); + }, + + objectLength: function( obj ) { + var count = 0; + for ( var i in obj ) + count++; + return count; + }, + + hideErrors: function() { + this.addWrapper( this.toHide ).hide(); + }, + + valid: function() { + return this.size() == 0; + }, + + size: function() { + return this.errorList.length; + }, + + focusInvalid: function() { + if( this.settings.focusInvalid ) { + try { + $(this.findLastActive() || this.errorList.length && this.errorList[0].element || []) + .filter(":visible") + .focus() + // manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find + .trigger("focusin"); + } catch(e) { + // ignore IE throwing errors when focusing hidden elements + } + } + }, + + findLastActive: function() { + var lastActive = this.lastActive; + return lastActive && $.grep(this.errorList, function(n) { + return n.element.name == lastActive.name; + }).length == 1 && lastActive; + }, + + elements: function() { + var validator = this, + rulesCache = {}; + + // select all valid inputs inside the form (no submit or reset buttons) + return $(this.currentForm) + .find("input, select, textarea") + .not(":submit, :reset, :image, [disabled]") + .not( this.settings.ignore ) + .filter(function() { + !this.name && validator.settings.debug && window.console && console.error( "%o has no name assigned", this); + + // select only the first element for each name, and only those with rules specified + if ( this.name in rulesCache || !validator.objectLength($(this).rules()) ) + return false; + + rulesCache[this.name] = true; + return true; + }); + }, + + clean: function( selector ) { + return $( selector )[0]; + }, + + errors: function() { + return $( this.settings.errorElement + "." + this.settings.errorClass, this.errorContext ); + }, + + reset: function() { + this.successList = []; + this.errorList = []; + this.errorMap = {}; + this.toShow = $([]); + this.toHide = $([]); + this.currentElements = $([]); + }, + + prepareForm: function() { + this.reset(); + this.toHide = this.errors().add( this.containers ); + }, + + prepareElement: function( element ) { + this.reset(); + this.toHide = this.errorsFor(element); + }, + + check: function( element ) { + element = this.validationTargetFor( this.clean( element ) ); + + var rules = $(element).rules(); + var dependencyMismatch = false; + for (var method in rules ) { + var rule = { method: method, parameters: rules[method] }; + try { + var result = $.validator.methods[method].call( this, element.value.replace(/\r/g, ""), element, rule.parameters ); + + // if a method indicates that the field is optional and therefore valid, + // don't mark it as valid when there are no other rules + if ( result == "dependency-mismatch" ) { + dependencyMismatch = true; + continue; + } + dependencyMismatch = false; + + if ( result == "pending" ) { + this.toHide = this.toHide.not( this.errorsFor(element) ); + return; + } + + if( !result ) { + this.formatAndAdd( element, rule ); + return false; + } + } catch(e) { + this.settings.debug && window.console && console.log("exception occured when checking element " + element.id + + ", check the '" + rule.method + "' method", e); + throw e; + } + } + if (dependencyMismatch) + return; + if ( this.objectLength(rules) ) + this.successList.push(element); + return true; + }, + + // return the custom message for the given element and validation method + // specified in the element's "messages" metadata + customMetaMessage: function(element, method) { + if (!$.metadata) + return; + + var meta = this.settings.meta + ? $(element).metadata()[this.settings.meta] + : $(element).metadata(); + + return meta && meta.messages && meta.messages[method]; + }, + + // return the custom message for the given element name and validation method + customMessage: function( name, method ) { + var m = this.settings.messages[name]; + return m && (m.constructor == String + ? m + : m[method]); + }, + + // return the first defined argument, allowing empty strings + findDefined: function() { + for(var i = 0; i < arguments.length; i++) { + if (arguments[i] !== undefined) + return arguments[i]; + } + return undefined; + }, + + defaultMessage: function( element, method) { + return this.findDefined( + this.customMessage( element.name, method ), + this.customMetaMessage( element, method ), + // title is never undefined, so handle empty string as undefined + !this.settings.ignoreTitle && element.title || undefined, + $.validator.messages[method], + "Warning: No message defined for " + element.name + "" + ); + }, + + formatAndAdd: function( element, rule ) { + var message = this.defaultMessage( element, rule.method ), + theregex = /\$?\{(\d+)\}/g; + if ( typeof message == "function" ) { + message = message.call(this, rule.parameters, element); + } else if (theregex.test(message)) { + message = jQuery.format(message.replace(theregex, '{$1}'), rule.parameters); + } + this.errorList.push({ + message: message, + element: element + }); + + this.errorMap[element.name] = message; + this.submitted[element.name] = message; + }, + + addWrapper: function(toToggle) { + if ( this.settings.wrapper ) + toToggle = toToggle.add( toToggle.parent( this.settings.wrapper ) ); + return toToggle; + }, + + defaultShowErrors: function() { + for ( var i = 0; this.errorList[i]; i++ ) { + var error = this.errorList[i]; + this.settings.highlight && this.settings.highlight.call( this, error.element, this.settings.errorClass, this.settings.validClass ); + this.showLabel( error.element, error.message ); + } + if( this.errorList.length ) { + this.toShow = this.toShow.add( this.containers ); + } + if (this.settings.success) { + for ( var i = 0; this.successList[i]; i++ ) { + this.showLabel( this.successList[i] ); + } + } + if (this.settings.unhighlight) { + for ( var i = 0, elements = this.validElements(); elements[i]; i++ ) { + this.settings.unhighlight.call( this, elements[i], 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 $(this.errorList).map(function() { + return this.element; + }); + }, + + showLabel: function(element, message) { + var label = this.errorsFor( element ); + if ( label.length ) { + // refresh error/success class + label.removeClass( this.settings.validClass ).addClass( this.settings.errorClass ); + + // check if we have a generated label, replace the message then + label.attr("generated") && label.html(message); + } else { + // create label + label = $("<" + this.settings.errorElement + "/>") + .attr({"for": this.idOrName(element), generated: true}) + .addClass(this.settings.errorClass) + .html(message || ""); + if ( this.settings.wrapper ) { + // make sure the element is visible, even in IE + // actually showing the wrapped element is handled elsewhere + label = label.hide().show().wrap("<" + this.settings.wrapper + "/>").parent(); + } + if ( !this.labelContainer.append(label).length ) + this.settings.errorPlacement + ? this.settings.errorPlacement(label, $(element) ) + : label.insertAfter(element); + } + if ( !message && this.settings.success ) { + label.text(""); + typeof this.settings.success == "string" + ? label.addClass( this.settings.success ) + : this.settings.success( label ); + } + this.toShow = this.toShow.add(label); + }, + + errorsFor: function(element) { + var name = this.idOrName(element); + return this.errors().filter(function() { + return $(this).attr('for') == name; + }); + }, + + idOrName: function(element) { + return this.groups[element.name] || (this.checkable(element) ? element.name : element.id || element.name); + }, + + validationTargetFor: function(element) { + // if radio/checkbox, validate first element in group instead + if (this.checkable(element)) { + element = this.findByName( element.name ).not(this.settings.ignore)[0]; + } + return element; + }, + + checkable: function( element ) { + return /radio|checkbox/i.test(element.type); + }, + + findByName: function( name ) { + // select by name and filter by form for performance over form.find("[name=...]") + var form = this.currentForm; + return $(document.getElementsByName(name)).map(function(index, element) { + return element.form == form && element.name == name && element || null; + }); + }, + + getLength: function(value, element) { + switch( element.nodeName.toLowerCase() ) { + case 'select': + return $("option:selected", element).length; + case 'input': + if( this.checkable( element) ) + return this.findByName(element.name).filter(':checked').length; + } + return value.length; + }, + + depend: function(param, element) { + return this.dependTypes[typeof param] + ? this.dependTypes[typeof param](param, element) + : true; + }, + + dependTypes: { + "boolean": function(param, element) { + return param; + }, + "string": function(param, element) { + return !!$(param, element.form).length; + }, + "function": function(param, element) { + return param(element); + } + }, + + optional: function(element) { + return !$.validator.methods.required.call(this, $.trim(element.value), element) && "dependency-mismatch"; + }, + + startRequest: function(element) { + if (!this.pending[element.name]) { + this.pendingRequest++; + this.pending[element.name] = true; + } + }, + + stopRequest: function(element, valid) { + this.pendingRequest--; + // sometimes synchronization fails, make sure pendingRequest is never < 0 + if (this.pendingRequest < 0) + this.pendingRequest = 0; + delete this.pending[element.name]; + if ( valid && this.pendingRequest == 0 && this.formSubmitted && this.form() ) { + $(this.currentForm).submit(); + this.formSubmitted = false; + } else if (!valid && this.pendingRequest == 0 && this.formSubmitted) { + $(this.currentForm).triggerHandler("invalid-form", [this]); + this.formSubmitted = false; + } + }, + + previousValue: function(element) { + return $.data(element, "previousValue") || $.data(element, "previousValue", { + old: null, + valid: true, + message: this.defaultMessage( element, "remote" ) + }); + } + + }, + + classRuleSettings: { + required: {required: true}, + email: {email: true}, + url: {url: true}, + date: {date: true}, + dateISO: {dateISO: true}, + dateDE: {dateDE: true}, + number: {number: true}, + numberDE: {numberDE: true}, + digits: {digits: true}, + creditcard: {creditcard: true} + }, + + addClassRules: function(className, rules) { + className.constructor == String ? + this.classRuleSettings[className] = rules : + $.extend(this.classRuleSettings, className); + }, + + classRules: function(element) { + var rules = {}; + var classes = $(element).attr('class'); + classes && $.each(classes.split(' '), function() { + if (this in $.validator.classRuleSettings) { + $.extend(rules, $.validator.classRuleSettings[this]); + } + }); + return rules; + }, + + attributeRules: function(element) { + var rules = {}; + var $element = $(element); + + for (var method in $.validator.methods) { + var value; + // If .prop exists (jQuery >= 1.6), use it to get true/false for required + if (method === 'required' && typeof $.fn.prop === 'function') { + value = $element.prop(method); + } else { + value = $element.attr(method); + } + if (value) { + rules[method] = value; + } else if ($element[0].getAttribute("type") === method) { + rules[method] = true; + } + } + + // maxlength may be returned as -1, 2147483647 (IE) and 524288 (safari) for text inputs + if (rules.maxlength && /-1|2147483647|524288/.test(rules.maxlength)) { + delete rules.maxlength; + } + + return rules; + }, + + metadataRules: function(element) { + if (!$.metadata) return {}; + + var meta = $.data(element.form, 'validator').settings.meta; + return meta ? + $(element).metadata()[meta] : + $(element).metadata(); + }, + + staticRules: function(element) { + var rules = {}; + var validator = $.data(element.form, 'validator'); + if (validator.settings.rules) { + rules = $.validator.normalizeRule(validator.settings.rules[element.name]) || {}; + } + return rules; + }, + + normalizeRules: function(rules, element) { + // handle dependency check + $.each(rules, function(prop, val) { + // ignore rule when param is explicitly false, eg. required:false + if (val === false) { + delete rules[prop]; + return; + } + if (val.param || val.depends) { + var keepRule = true; + switch (typeof val.depends) { + case "string": + keepRule = !!$(val.depends, element.form).length; + break; + case "function": + keepRule = val.depends.call(element, element); + break; + } + if (keepRule) { + rules[prop] = val.param !== undefined ? val.param : true; + } else { + delete rules[prop]; + } + } + }); + + // evaluate parameters + $.each(rules, function(rule, parameter) { + rules[rule] = $.isFunction(parameter) ? parameter(element) : parameter; + }); + + // clean number parameters + $.each(['minlength', 'maxlength', 'min', 'max'], function() { + if (rules[this]) { + rules[this] = Number(rules[this]); + } + }); + $.each(['rangelength', 'range'], function() { + if (rules[this]) { + rules[this] = [Number(rules[this][0]), Number(rules[this][1])]; + } + }); + + if ($.validator.autoCreateRanges) { + // auto-create ranges + if (rules.min && rules.max) { + rules.range = [rules.min, rules.max]; + delete rules.min; + delete rules.max; + } + if (rules.minlength && rules.maxlength) { + rules.rangelength = [rules.minlength, rules.maxlength]; + delete rules.minlength; + delete rules.maxlength; + } + } + + // To support custom messages in metadata ignore rule methods titled "messages" + if (rules.messages) { + delete rules.messages; + } + + return rules; + }, + + // Converts a simple string to a {string: true} rule, e.g., "required" to {required:true} + normalizeRule: function(data) { + if( typeof data == "string" ) { + var transformed = {}; + $.each(data.split(/\s/), function() { + transformed[this] = true; + }); + data = transformed; + } + return data; + }, + + // http://docs.jquery.com/Plugins/Validation/Validator/addMethod + addMethod: function(name, method, message) { + $.validator.methods[name] = method; + $.validator.messages[name] = message != undefined ? message : $.validator.messages[name]; + if (method.length < 3) { + $.validator.addClassRules(name, $.validator.normalizeRule(name)); + } + }, + + methods: { + + // http://docs.jquery.com/Plugins/Validation/Methods/required + required: function(value, element, param) { + // check if dependency is met + if ( !this.depend(param, element) ) + return "dependency-mismatch"; + switch( element.nodeName.toLowerCase() ) { + case 'select': + // could be an array for select-multiple or a string, both are fine this way + var val = $(element).val(); + return val && val.length > 0; + case 'input': + if ( this.checkable(element) ) + return this.getLength(value, element) > 0; + default: + return $.trim(value).length > 0; + } + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/remote + remote: function(value, element, param) { + if ( this.optional(element) ) + return "dependency-mismatch"; + + var previous = this.previousValue(element); + if (!this.settings.messages[element.name] ) + this.settings.messages[element.name] = {}; + previous.originalMessage = this.settings.messages[element.name].remote; + this.settings.messages[element.name].remote = previous.message; + + param = typeof param == "string" && {url:param} || param; + + if ( this.pending[element.name] ) { + return "pending"; + } + if ( previous.old === value ) { + return previous.valid; + } + + previous.old = value; + var validator = this; + this.startRequest(element); + var data = {}; + data[element.name] = value; + $.ajax($.extend(true, { + url: param, + mode: "abort", + port: "validate" + element.name, + dataType: "json", + data: data, + success: function(response) { + validator.settings.messages[element.name].remote = previous.originalMessage; + var valid = response === true; + if ( valid ) { + var submitted = validator.formSubmitted; + validator.prepareElement(element); + validator.formSubmitted = submitted; + validator.successList.push(element); + validator.showErrors(); + } else { + var errors = {}; + var message = response || validator.defaultMessage( element, "remote" ); + errors[element.name] = previous.message = $.isFunction(message) ? message(value) : message; + validator.showErrors(errors); + } + previous.valid = valid; + validator.stopRequest(element, valid); + } + }, param)); + return "pending"; + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/minlength + minlength: function(value, element, param) { + return this.optional(element) || this.getLength($.trim(value), element) >= param; + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/maxlength + maxlength: function(value, element, param) { + return this.optional(element) || this.getLength($.trim(value), element) <= param; + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/rangelength + rangelength: function(value, element, param) { + var length = this.getLength($.trim(value), element); + return this.optional(element) || ( length >= param[0] && length <= param[1] ); + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/min + min: function( value, element, param ) { + return this.optional(element) || value >= param; + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/max + max: function( value, element, param ) { + return this.optional(element) || value <= param; + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/range + range: function( value, element, param ) { + return this.optional(element) || ( value >= param[0] && value <= param[1] ); + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/email + email: function(value, element) { + // contributed by Scott Gonzalez: http://projects.scottsplayground.com/email_address_validation/ + return this.optional(element) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([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])))$/i.test(value); + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/url + url: function(value, element) { + // contributed by Scott Gonzalez: http://projects.scottsplayground.com/iri/ + 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); + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/date + date: function(value, element) { + return this.optional(element) || !/Invalid|NaN/.test(new Date(value)); + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/dateISO + dateISO: function(value, element) { + return this.optional(element) || /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value); + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/number + number: function(value, element) { + return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value); + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/digits + digits: function(value, element) { + return this.optional(element) || /^\d+$/.test(value); + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/creditcard + // based on http://en.wikipedia.org/wiki/Luhn + creditcard: function(value, element) { + if ( this.optional(element) ) + return "dependency-mismatch"; + // accept only spaces, digits and dashes + if (/[^0-9 -]+/.test(value)) + return false; + var nCheck = 0, + nDigit = 0, + bEven = false; + + value = value.replace(/\D/g, ""); + + for (var n = value.length - 1; n >= 0; n--) { + var cDigit = value.charAt(n); + var nDigit = parseInt(cDigit, 10); + if (bEven) { + if ((nDigit *= 2) > 9) + nDigit -= 9; + } + nCheck += nDigit; + bEven = !bEven; + } + + return (nCheck % 10) == 0; + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/accept + accept: function(value, element, param) { + param = typeof param == "string" ? param.replace(/,/g, '|') : "png|jpe?g|gif"; + return this.optional(element) || value.match(new RegExp(".(" + param + ")$", "i")); + }, + + // http://docs.jquery.com/Plugins/Validation/Methods/equalTo + equalTo: function(value, element, param) { + // bind to the blur event of the target in order to revalidate whenever the target field is updated + // TODO find a way to bind the event just once, avoiding the unbind-rebind overhead + var target = $(param).unbind(".validate-equalTo").bind("blur.validate-equalTo", function() { + $(element).valid(); + }); + return value == target.val(); + } + + } + +}); + +// deprecated, use $.validator.format instead +$.format = $.validator.format; + +})(jQuery); + +// ajax mode: abort +// usage: $.ajax({ mode: "abort"[, port: "uniqueport"]}); +// if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort() +;(function($) { + var pendingRequests = {}; + // Use a prefilter if available (1.5+) + if ( $.ajaxPrefilter ) { + $.ajaxPrefilter(function(settings, _, xhr) { + var port = settings.port; + if (settings.mode == "abort") { + if ( pendingRequests[port] ) { + pendingRequests[port].abort(); + } + pendingRequests[port] = xhr; + } + }); + } else { + // Proxy ajax + var ajax = $.ajax; + $.ajax = function(settings) { + var mode = ( "mode" in settings ? settings : $.ajaxSettings ).mode, + port = ( "port" in settings ? settings : $.ajaxSettings ).port; + if (mode == "abort") { + if ( pendingRequests[port] ) { + pendingRequests[port].abort(); + } + return (pendingRequests[port] = ajax.apply(this, arguments)); + } + return ajax.apply(this, arguments); + }; + } +})(jQuery); + +// provides cross-browser focusin and focusout events +// IE has native support, in other browsers, use event caputuring (neither bubbles) + +// provides delegate(type: String, delegate: Selector, handler: Callback) plugin for easier event delegation +// handler is only called when $(event.target).is(delegate), in the scope of the jquery-object for event.target +;(function($) { + // only implement if not provided by jQuery core (since 1.4) + // TODO verify if jQuery 1.4's implementation is compatible with older jQuery special-event APIs + if (!jQuery.event.special.focusin && !jQuery.event.special.focusout && document.addEventListener) { + $.each({ + focus: 'focusin', + blur: 'focusout' + }, function( original, fix ){ + $.event.special[fix] = { + setup:function() { + this.addEventListener( original, handler, true ); + }, + teardown:function() { + this.removeEventListener( original, handler, true ); + }, + handler: function(e) { + arguments[0] = $.event.fix(e); + arguments[0].type = fix; + return $.event.handle.apply(this, arguments); + } + }; + function handler(e) { + e = $.event.fix(e); + e.type = fix; + return $.event.handle.call(this, e); + } + }); + }; + $.extend($.fn, { + validateDelegate: function(delegate, type, handler) { + return this.bind(type, function(event) { + var target = $(event.target); + if (target.is(delegate)) { + return handler.apply(target, arguments); + } + }); + } + }); +})(jQuery); diff --git a/target/disped-web/resources/js/jquery.wizard.js b/target/disped-web/resources/js/jquery.wizard.js new file mode 100644 index 0000000000000000000000000000000000000000..2eea9e8ba55b8648f09836d0eab5cebf1753a7a7 --- /dev/null +++ b/target/disped-web/resources/js/jquery.wizard.js @@ -0,0 +1,456 @@ +/* + * jQuery wizard plug-in 3.0.5 + * + * + * Copyright (c) 2011 Jan Sundman (jan.sundman[at]aland.net) + * + * http://www.thecodemine.org + * + * Licensed under the MIT licens: + * http://www.opensource.org/licenses/mit-license.php + * + */ + + +(function($){ + $.widget("ui.formwizard", { + + _init: function() { + + var wizard = this; + var formOptionsSuccess = this.options.formOptions.success; + var formOptionsComplete = this.options.formOptions.complete; + var formOptionsBeforeSend = this.options.formOptions.beforeSend; + var formOptionsBeforeSubmit = this.options.formOptions.beforeSubmit; + var formOptionsBeforeSerialize = this.options.formOptions.beforeSerialize; + this.options.formOptions = $.extend(this.options.formOptions,{ + success : function(responseText, textStatus, xhr){ + if(formOptionsSuccess){ + formOptionsSuccess(responseText, textStatus, xhr); + } + if(wizard.options.formOptions && wizard.options.formOptions.resetForm || !wizard.options.formOptions){ + wizard._reset(); + } + }, + complete : function(xhr, textStatus){ + if(formOptionsComplete){ + formOptionsComplete(xhr, textStatus); + } + wizard._enableNavigation(); + }, + beforeSubmit : function(arr, theForm, options) { + if(formOptionsBeforeSubmit){ + var shouldSubmit = formOptionsBeforeSubmit(arr, theForm, options); + if(!shouldSubmit) + wizard._enableNavigation(); + return shouldSubmit; + } + }, + beforeSend : function(xhr) { + if(formOptionsBeforeSend){ + var shouldSubmit = formOptionsBeforeSend(xhr); + if(!shouldSubmit) + wizard._enableNavigation(); + return shouldSubmit; + } + }, + beforeSerialize: function(form, options) { + if(formOptionsBeforeSerialize){ + var shouldSubmit = formOptionsBeforeSerialize(form, options); + if(!shouldSubmit) + wizard._enableNavigation(); + return shouldSubmit; + } + } + }); + + this.steps = this.element.find(".step").hide(); + + this.firstStep = this.steps.eq(0).attr("id"); + this.activatedSteps = new Array(); + this.isLastStep = false; + this.previousStep = undefined; + this.currentStep = this.steps.eq(0).attr("id"); + this.nextButton = this.element.find(this.options.next) + .click(function() { + return wizard._next(); + }); + + this.nextButtonInitinalValue = this.nextButton.val(); + this.nextButton.val(this.options.textNext); + + this.backButton = this.element.find(this.options.back) + .click(function() { + wizard._back();return false; + }); + + this.backButtonInitinalValue = this.backButton.val(); + this.backButton.val(this.options.textBack); + + if(this.options.validationEnabled && jQuery().validate == undefined){ + this.options.validationEnabled = false; + if( (window['console'] !== undefined) ){ + console.log("%s", "validationEnabled option set, but the validation plugin is not included"); + } + }else if(this.options.validationEnabled){ + this.element.validate(this.options.validationOptions); + } + if(this.options.formPluginEnabled && jQuery().ajaxSubmit == undefined){ + this.options.formPluginEnabled = false; + if( (window['console'] !== undefined) ){ + console.log("%s", "formPluginEnabled option set but the form plugin is not included"); + } + } + + if(this.options.disableInputFields == true){ + $(this.steps).find(":input:not('.wizard-ignore')").attr("disabled","disabled"); + } + + if(this.options.historyEnabled){ + $(window).bind('hashchange', undefined, function(event){ + var hashStep = event.getState( "_" + $(wizard.element).attr( 'id' )) || wizard.firstStep; + if(hashStep !== wizard.currentStep){ + if(wizard.options.validationEnabled && hashStep === wizard._navigate(wizard.currentStep)){ + if(!wizard.element.valid()){ + wizard._updateHistory(wizard.currentStep); + wizard.element.validate().focusInvalid(); + + return false; + } + } + if(hashStep !== wizard.currentStep) + wizard._show(hashStep); + } + }); + } + + this.element.addClass("ui-formwizard"); + this.element.find(":input").addClass("ui-wizard-content"); + this.steps.addClass("ui-formwizard-content"); + this.backButton.addClass("ui-formwizard-button ui-wizard-content"); + this.nextButton.addClass("ui-formwizard-button ui-wizard-content"); + + if(!this.options.disableUIStyles){ + this.element.addClass("ui-helper-reset ui-widget ui-widget-content ui-helper-reset ui-corner-all"); + this.element.find(":input").addClass("ui-helper-reset ui-state-default"); + this.steps.addClass("ui-helper-reset ui-corner-all"); + this.backButton.addClass("ui-helper-reset ui-state-default"); + this.nextButton.addClass("ui-helper-reset ui-state-default"); + } + this._show(undefined); + return $(this); + }, + + _next : function(){ + if(this.options.validationEnabled){ + if(!this.element.valid()){ + this.element.validate().focusInvalid(); + return false; + } + } + + if(this.options.remoteAjax != undefined){ + var options = this.options.remoteAjax[this.currentStep]; + var wizard = this; + if(options !== undefined){ + var success = options.success; + var beforeSend = options.beforeSend; + var complete = options.complete; + + options = $.extend({},options,{ + success: function(data, statusText){ + if((success !== undefined && success(data, statusText)) || (success == undefined)){ + wizard._continueToNextStep(); + } + }, + beforeSend : function(xhr){ + wizard._disableNavigation(); + if(beforeSend !== undefined) + beforeSend(xhr); + $(wizard.element).trigger('before_remote_ajax', {"currentStep" : wizard.currentStep}); + }, + complete : function(xhr, statusText){ + if(complete !== undefined) + complete(xhr, statusText); + $(wizard.element).trigger('after_remote_ajax', {"currentStep" : wizard.currentStep}); + wizard._enableNavigation(); + } + }) + this.element.ajaxSubmit(options); + return false; + } + } + + return this._continueToNextStep(); + }, + + _back : function(){ + if(this.activatedSteps.length > 0){ + if(this.options.historyEnabled){ + this._updateHistory(this.activatedSteps[this.activatedSteps.length - 2]); + }else{ + this._show(this.activatedSteps[this.activatedSteps.length - 2], true); + } + } + return false; + }, + + _continueToNextStep : function(){ + if(this.isLastStep){ + for(var i = 0; i < this.activatedSteps.length; i++){ + this.steps.filter("#" + this.activatedSteps[i]).find(":input").not(".wizard-ignore").removeAttr("disabled"); + } + if(!this.options.formPluginEnabled){ + return true; + }else{ + this._disableNavigation(); + this.element.ajaxSubmit(this.options.formOptions); + return false; + } + } + + var step = this._navigate(this.currentStep); + if(step == this.currentStep){ + return false; + } + if(this.options.historyEnabled){ + this._updateHistory(step); + }else{ + this._show(step, true); + } + return false; + }, + + _updateHistory : function(step){ + var state = {}; + state["_" + $(this.element).attr('id')] = step; + $.bbq.pushState(state); + }, + + _disableNavigation : function(){ + this.nextButton.attr("disabled","disabled"); + this.backButton.attr("disabled","disabled"); + if(!this.options.disableUIStyles){ + this.nextButton.removeClass("ui-state-active").addClass("ui-state-disabled"); + this.backButton.removeClass("ui-state-active").addClass("ui-state-disabled"); + } + }, + + _enableNavigation : function(){ + if(this.isLastStep){ + this.nextButton.val(this.options.textSubmit); + }else{ + this.nextButton.val(this.options.textNext); + } + + if($.trim(this.currentStep) !== this.steps.eq(0).attr("id")){ + this.backButton.removeAttr("disabled"); + if(!this.options.disableUIStyles){ + this.backButton.removeClass("ui-state-disabled").addClass("ui-state-active"); + } + } + + this.nextButton.removeAttr("disabled"); + if(!this.options.disableUIStyles){ + this.nextButton.removeClass("ui-state-disabled").addClass("ui-state-active"); + } + }, + + _animate : function(oldStep, newStep, stepShownCallback){ + this._disableNavigation(); + var old = this.steps.filter("#" + oldStep); + var current = this.steps.filter("#" + newStep); + old.find(":input").not(".wizard-ignore").attr("disabled","disabled"); + current.find(":input").not(".wizard-ignore").removeAttr("disabled"); + var wizard = this; + old.animate(wizard.options.outAnimation, wizard.options.outDuration, wizard.options.easing, function(){ + current.animate(wizard.options.inAnimation, wizard.options.inDuration, wizard.options.easing, function(){ + if(wizard.options.focusFirstInput) + current.find(":input:first").focus(); + wizard._enableNavigation(); + + stepShownCallback.apply(wizard); + }); + return; + }); + }, + + _checkIflastStep : function(step){ + this.isLastStep = false; + if($("#" + step).hasClass(this.options.submitStepClass) || this.steps.filter(":last").attr("id") == step){ + this.isLastStep = true; + } + }, + + _getLink : function(step){ + var link = undefined; + var links = this.steps.filter("#" + step).find(this.options.linkClass); + + if(links != undefined){ + if(links.filter(":radio,:checkbox").size() > 0){ + link = links.filter(this.options.linkClass + ":checked").val(); + }else{ + link = $(links).val(); + } + } + return link; + }, + + _navigate : function(step){ + var link = this._getLink(step); + if(link != undefined){ + if((link != "" && link != null && link != undefined) && this.steps.filter("#" + link).attr("id") != undefined){ + return link; + } + return this.currentStep; + }else if(link == undefined && !this.isLastStep){ + var step1 = this.steps.filter("#" + step).next().attr("id"); + return step1; + } + }, + + _show : function(step){ + var backwards = false; + var triggerStepShown = step !== undefined; + if(step == undefined || step == ""){ + this.activatedSteps.pop(); + step = this.firstStep; + this.activatedSteps.push(step); + }else{ + if($.inArray(step, this.activatedSteps) > -1){ + backwards = true; + this.activatedSteps.pop(); + }else { + this.activatedSteps.push(step); + } + } + + if(this.currentStep !== step || step === this.firstStep){ + this.previousStep = this.currentStep; + this._checkIflastStep(step); + this.currentStep = step; + var stepShownCallback = function(){if(triggerStepShown)$(this.element).trigger('step_shown', $.extend({"isBackNavigation" : backwards},this._state()));}; + this._animate(this.previousStep, step, stepShownCallback); + }; + + + }, + + _reset : function(){ + this.element.resetForm() + $("label,:input,textarea",this).removeClass("error"); + for(var i = 0; i < this.activatedSteps.length; i++){ + this.steps.filter("#" + this.activatedSteps[i]).hide().find(":input").attr("disabled","disabled"); + } + this.activatedSteps = new Array(); + this.previousStep = undefined; + this.isLastStep = false; + if(this.options.historyEnabled){ + this._updateHistory(this.firstStep); + }else{ + this._show(this.firstStep); + } + + }, + + _state : function(state){ + var currentState = { "settings" : this.options, + "activatedSteps" : this.activatedSteps, + "isLastStep" : this.isLastStep, + "isFirstStep" : this.currentStep === this.firstStep, + "previousStep" : this.previousStep, + "currentStep" : this.currentStep, + "backButton" : this.backButton, + "nextButton" : this.nextButton, + "steps" : this.steps, + "firstStep" : this.firstStep + } + + if(state !== undefined) + return currentState[state]; + + return currentState; + }, + + /*Methods*/ + + show : function(step){ + if(this.options.historyEnabled){ + this._updateHistory(step); + }else{ + this._show(step); + } + }, + + state : function(state){ + return this._state(state); + }, + + reset : function(){ + this._reset(); + }, + + next : function(){ + this._next(); + }, + + back : function(){ + this._back(); + }, + + destroy: function() { + this.element.find("*").removeAttr("disabled").show(); + this.nextButton.unbind("click").val(this.nextButtonInitinalValue).removeClass("ui-state-disabled").addClass("ui-state-active"); + this.backButton.unbind("click").val(this.backButtonInitinalValue).removeClass("ui-state-disabled").addClass("ui-state-active"); + this.backButtonInitinalValue = undefined; + this.nextButtonInitinalValue = undefined; + this.activatedSteps = undefined; + this.previousStep = undefined; + this.currentStep = undefined; + this.isLastStep = undefined; + this.options = undefined; + this.nextButton = undefined; + this.backButton = undefined; + this.formwizard = undefined; + this.element = undefined; + this.steps = undefined; + this.firstStep = undefined; + }, + + update_steps : function(){ + this.steps = this.element.find(".step").addClass("ui-formwizard-content"); + this.steps.not("#" + this.currentStep).hide().find(":input").addClass("ui-wizard-content").attr("disabled","disabled"); + this._checkIflastStep(this.currentStep); + this._enableNavigation(); + if(!this.options.disableUIStyles){ + this.steps.addClass("ui-helper-reset ui-corner-all"); + this.steps.find(":input").addClass("ui-helper-reset ui-state-default"); + } + }, + + options: { + historyEnabled : false, + validationEnabled : false, + validationOptions : undefined, + formPluginEnabled : false, + linkClass : ".link", + submitStepClass : "submit_step", + back : ":reset", + next : ":submit", + textSubmit : 'Submit', + textNext : 'Next', + textBack : 'Back', + remoteAjax : undefined, + inAnimation : {opacity: 'show'}, + outAnimation: {opacity: 'hide'}, + inDuration : 400, + outDuration: 400, + easing: 'swing', + focusFirstInput : false, + disableInputFields : true, + formOptions : { reset: true, success: function(data) { if( (window['console'] !== undefined) ){console.log("%s", "form submit successful");}}, + disableUIStyles : false + } + } + }); +})(jQuery); diff --git a/target/disped-web/resources/js/maruti.html b/target/disped-web/resources/js/maruti.html new file mode 100644 index 0000000000000000000000000000000000000000..1229715285cd5f52b299a9dcf7936157626237ff --- /dev/null +++ b/target/disped-web/resources/js/maruti.html @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + Page not found - Theme Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        +
        + + +
        +
        + + +
        +
        + +

        404 Not Found

        +

        Apologies, but the page you requested could not be found. Perhaps searching will help.

        +
        +

        +

        + + + +
        +
        + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/disped-web/resources/js/masked.js b/target/disped-web/resources/js/masked.js new file mode 100644 index 0000000000000000000000000000000000000000..fdbd5209e447d7da7bceecf180c2a9c418b0f901 --- /dev/null +++ b/target/disped-web/resources/js/masked.js @@ -0,0 +1,7 @@ +/* + Masked Input plugin for jQuery + Copyright (c) 2007-2011 Josh Bush (digitalbush.com) + Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license) + Version: 1.3 +*/ +(function(a){var b=(a.browser.msie?"paste":"input")+".mask",c=window.orientation!=undefined;a.mask={definitions:{9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},dataName:"rawMaskFn"},a.fn.extend({caret:function(a,b){if(this.length!=0){if(typeof a=="number"){b=typeof b=="number"?b:a;return this.each(function(){if(this.setSelectionRange)this.setSelectionRange(a,b);else if(this.createTextRange){var c=this.createTextRange();c.collapse(!0),c.moveEnd("character",b),c.moveStart("character",a),c.select()}})}if(this[0].setSelectionRange)a=this[0].selectionStart,b=this[0].selectionEnd;else if(document.selection&&document.selection.createRange){var c=document.selection.createRange();a=0-c.duplicate().moveStart("character",-1e5),b=a+c.text.length}return{begin:a,end:b}}},unmask:function(){return this.trigger("unmask")},mask:function(d,e){if(!d&&this.length>0){var f=a(this[0]);return f.data(a.mask.dataName)()}e=a.extend({placeholder:"_",completed:null},e);var g=a.mask.definitions,h=[],i=d.length,j=null,k=d.length;a.each(d.split(""),function(a,b){b=="?"?(k--,i=a):g[b]?(h.push(new RegExp(g[b])),j==null&&(j=h.length-1)):h.push(null)});return this.trigger("unmask").each(function(){function v(a){var b=f.val(),c=-1;for(var d=0,g=0;db.length)break}else l[d]==b.charAt(g)&&d!=i&&(g++,c=d);if(!a&&c+1=i)u(),a||f.val(f.val().substring(0,c+1));return i?d:j}function u(){return f.val(l.join("")).val()}function t(a,b){for(var c=a;c=k&&e.completed.call(f)}}return!1}}function r(a){var b=a.which;if(b==8||b==46||c&&b==127){var d=f.caret(),e=d.begin,g=d.end;g-e==0&&(e=b!=46?o(e):g=n(e-1),g=b==46?n(g):g),t(e,g),p(e,g-1);return!1}if(b==27){f.val(m),f.caret(0,v());return!1}}function q(a){for(var b=a,c=e.placeholder;b=0&&!h[a]);return a}function n(a){while(++a<=k&&!h[a]);return a}var f=a(this),l=a.map(d.split(""),function(a,b){if(a!="?")return g[a]?e.placeholder:a}),m=f.val();f.data(a.mask.dataName,function(){return a.map(l,function(a,b){return h[b]&&a!=e.placeholder?a:null}).join("")}),f.attr("readonly")||f.one("unmask",function(){f.unbind(".mask").removeData(a.mask.dataName)}).bind("focus.mask",function(){m=f.val();var b=v();u();var c=function(){b==d.length?f.caret(0,b):f.caret(b)};(a.browser.msie?c:function(){setTimeout(c,0)})()}).bind("blur.mask",function(){v(),f.val()!=m&&f.change()}).bind("keydown.mask",r).bind("keypress.mask",s).bind(b,function(){setTimeout(function(){f.caret(v(!0))},0)}),v()})}})})(jQuery) \ No newline at end of file diff --git a/target/disped-web/resources/js/matrix.calendar.js b/target/disped-web/resources/js/matrix.calendar.js new file mode 100644 index 0000000000000000000000000000000000000000..d2d7d2cf05102a60841e9fd0140d5a243c59089b --- /dev/null +++ b/target/disped-web/resources/js/matrix.calendar.js @@ -0,0 +1,107 @@ + +$(document).ready(function(){ + + maruti.init(); + + $('#add-event-submit').click(function(){ + maruti.add_event(); + }); + + $('#event-name').keypress(function(e){ + if(e.which == 13) { + maruti.add_event(); + } + }); +}); + +maruti = { + + // === Initialize the fullCalendar and external draggable events === // + init: function() { + // Prepare the dates + var date = new Date(); + var d = date.getDate(); + var m = date.getMonth(); + var y = date.getFullYear(); + + $('#fullcalendar').fullCalendar({ + header: { + left: 'prev,next', + center: 'title', + right: 'month,basicWeek,basicDay' + }, + editable: true, + droppable: true, // this allows things to be dropped onto the calendar !!! + drop: function(date, allDay) { // this function is called when something is dropped + + // retrieve the dropped element's stored Event Object + var originalEventObject = $(this).data('eventObject'); + + // we need to copy it, so that multiple events don't have a reference to the same object + var copiedEventObject = $.extend({}, originalEventObject); + + // assign it the date that was reported + copiedEventObject.start = date; + copiedEventObject.allDay = allDay; + + // render the event on the calendar + // the last `true` argument determines if the event "sticks" (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/) + $('#fullcalendar').fullCalendar('renderEvent', copiedEventObject, true); + + // is the "remove after drop" checkbox checked? + + // if so, remove the element from the "Draggable Events" list + $(this).remove(); + + } + }); + this.external_events(); + }, + + // === Adds an event if name is provided === // + add_event: function(){ + if($('#event-name').val() != '') { + var event_name = $('#event-name').val(); + $('#external-events .panel-content').append('
        '+event_name+'
        '); + this.external_events(); + $('#modal-add-event').modal('hide'); + $('#event-name').val(''); + } else { + this.show_error(); + } + }, + + // === Initialize the draggable external events === // + external_events: function(){ + /* initialize the external events + -----------------------------------------------------------------*/ + $('#external-events div.external-event').each(function() { + // create an Event Object (http://arshaw.com/fullcalendar/docs/event_data/Event_Object/) + // it doesn't need to have a start or end + var eventObject = { + title: $.trim($(this).text()) // use the element's text as the event title + }; + + // store the Event Object in the DOM element so we can get to it later + $(this).data('eventObject', eventObject); + + // make the event draggable using jQuery UI + $(this).draggable({ + zIndex: 999, + revert: true, // will cause the event to go back to its + revertDuration: 0 // original position after the drag + }); + }); + }, + + // === Show error if no event name is provided === // + show_error: function(){ + $('#modal-error').remove(); + $('').appendTo('#modal-add-event .modal-body'); + $('#modal-error').delay('1500').fadeOut(700,function() { + $(this).remove(); + }); + } + + +}; diff --git a/target/disped-web/resources/js/matrix.charts.js b/target/disped-web/resources/js/matrix.charts.js new file mode 100644 index 0000000000000000000000000000000000000000..434dae6e3646b3e0083547cdd806f070d6f32d72 --- /dev/null +++ b/target/disped-web/resources/js/matrix.charts.js @@ -0,0 +1,118 @@ + +$(document).ready(function(){ + + + // === Prepare the chart data ===/ + var sin = [], cos = []; + for (var i = 0; i < 14; i += 0.5) { + sin.push([i, Math.sin(i)]); + cos.push([i, Math.cos(i)]); + } + // === Prepare the chart data ===/ + var sin = [], cos = []; + for (var i = 0; i < 14; i += 0.5) { + sin.push([i, Math.sin(i)]); + cos.push([i, Math.cos(i)]); + } + + // === Make chart === // + var plot = $.plot($(".chart"), + [ { data: sin, label: "sin(x)", color: "#ee7951"}, { data: cos, label: "cos(x)",color: "#4fb9f0" } ], { + series: { + lines: { show: true }, + points: { show: true } + }, + grid: { hoverable: true, clickable: true }, + yaxis: { min: -1.6, max: 1.6 } + }); + + // === Point hover in chart === // + var previousPoint = null; + $(".chart").bind("plothover", function (event, pos, item) { + + if (item) { + if (previousPoint != item.dataIndex) { + previousPoint = item.dataIndex; + + $('#tooltip').fadeOut(200,function(){ + $(this).remove(); + }); + var x = item.datapoint[0].toFixed(2), + y = item.datapoint[1].toFixed(2); + + maruti.flot_tooltip(item.pageX, item.pageY,item.series.label + " of " + x + " = " + y); + } + + } else { + $('#tooltip').fadeOut(200,function(){ + $(this).remove(); + }); + previousPoint = null; + } + }); + + + + + var data = []; + var series = Math.floor(Math.random()*10)+1; + for( var i = 0; i'+label+'
        '+Math.round(series.percent)+'%
        '; + }, + background: { + opacity: 0.5, + color: '#000' + } + }, + innerRadius: 0.2 + }, + legend: { + show: false + } + } + }); + var d1 = []; + for (var i = 0; i <= 10; i += 1) d1.push([i, parseInt(Math.random() * 30)]); + + var data = new Array(); + data.push({ + data:d1, + bars: { + show: true, + barWidth: 0.4, + order: 1, + } + }); + + + //Display graph + var bar = $.plot($(".bars"), data, { + legend: true + }); + +}); + + +maruti = { + // === Tooltip for flot charts === // + flot_tooltip: function(x, y, contents) { + + $('
        ' + contents + '
        ').css( { + top: y + 5, + left: x + 5 + }).appendTo("body").fadeIn(200); + } +} diff --git a/target/disped-web/resources/js/matrix.chat.js b/target/disped-web/resources/js/matrix.chat.js new file mode 100644 index 0000000000000000000000000000000000000000..0f2977439e91f424f36284a0dd0276c049fb566e --- /dev/null +++ b/target/disped-web/resources/js/matrix.chat.js @@ -0,0 +1,66 @@ + +$(document).ready(function(){ + + var msg_template = '

        '; + + $('.chat-message button').click(function(){ + var input = $(this).siblings('span').children('input[type=text]'); + if(input.val() != ''){ + add_message('You','img/demo/av1.jpg',input.val(),true); + } + }); + + $('.chat-message input').keypress(function(e){ + if(e.which == 13) { + if($(this).val() != ''){ + add_message('You','img/demo/av1.jpg',$(this).val(),true); + } + } + }); + + setTimeout(function(){ + add_message('Linda','img/demo/av2.jpg','Hello Every one do u want to freindship with me?') + },'1000'); + setTimeout(function(){ + add_message('Mark','img/demo/av3.jpg','Yuppi! why not sirji!!.') + },'4000'); + setTimeout(function(){ + add_message('Linda','img/demo/av2.jpg','Thanks!!! See you soon than') + },'8000'); + setTimeout(function(){ + add_message('Mark','img/demo/av3.jpg','ok Bye than!!!.') + },'12000'); + setTimeout(function(){ + remove_user('Linda','Linda') + },'16000'); + var i = 0; + function add_message(name,img,msg,clear) { + i = i + 1; + var inner = $('#chat-messages-inner'); + var time = new Date(); + var hours = time.getHours(); + var minutes = time.getMinutes(); + if(hours < 10) hours = '0' + hours; + if(minutes < 10) minutes = '0' + minutes; + var id = 'msg-'+i; + var idname = name.replace(' ','-').toLowerCase(); + inner.append('

        ' + +''+name+' - '+hours+':'+minutes+'' + +''+msg+'

        '); + $('#'+id).hide().fadeIn(800); + if(clear) { + $('.chat-message input').val('').focus(); + } + $('#chat-messages').animate({ scrollTop: inner.height() },1000); + } + function remove_user(userid,name) { + i = i + 1; + $('.contact-list li#user-'+userid).addClass('offline').delay(1000).slideUp(800,function(){ + $(this).remove(); + }); + var inner = $('#chat-messages-inner'); + var id = 'msg-'+i; + inner.append('

        User '+name+' left the chat

        '); + $('#'+id).hide().fadeIn(800); + } +}); diff --git a/target/disped-web/resources/js/matrix.dashboard.js b/target/disped-web/resources/js/matrix.dashboard.js new file mode 100644 index 0000000000000000000000000000000000000000..59d71cc07ce4df3a50425b81a8b6591fc3fdef11 --- /dev/null +++ b/target/disped-web/resources/js/matrix.dashboard.js @@ -0,0 +1,164 @@ + +$(document).ready(function(){ + + + + // === Prepare peity charts === // + maruti.peity(); + + // === Prepare the chart data ===/ + var sin = [], cos = []; + for (var i = 0; i < 14; i += 0.5) { + sin.push([i, Math.sin(i)]); + cos.push([i, Math.cos(i)]); + } + + // === Make chart === // + var plot = $.plot($(".chart"), + [ { data: sin, label: "sin(x)", color: "#ee7951"}, { data: cos, label: "cos(x)",color: "#4fb9f0" } ], { + series: { + lines: { show: true }, + points: { show: true } + }, + grid: { hoverable: true, clickable: true }, + yaxis: { min: -1.6, max: 1.6 } + }); + + // === Point hover in chart === // + var previousPoint = null; + $(".chart").bind("plothover", function (event, pos, item) { + + if (item) { + if (previousPoint != item.dataIndex) { + previousPoint = item.dataIndex; + + $('#tooltip').fadeOut(200,function(){ + $(this).remove(); + }); + var x = item.datapoint[0].toFixed(2), + y = item.datapoint[1].toFixed(2); + + maruti.flot_tooltip(item.pageX, item.pageY,item.series.label + " of " + x + " = " + y); + } + + } else { + $('#tooltip').fadeOut(200,function(){ + $(this).remove(); + }); + previousPoint = null; + } + }); + + + + + // === Calendar === // + var date = new Date(); + var d = date.getDate(); + var m = date.getMonth(); + var y = date.getFullYear(); + + $('.calendar').fullCalendar({ + header: { + left: 'prev,next', + center: 'title', + right: 'month,basicWeek,basicDay' + }, + editable: true, + events: [ + { + title: 'All day event', + start: new Date(y, m, 1) + }, + { + title: 'Long event', + start: new Date(y, m, 5), + end: new Date(y, m, 8) + }, + { + id: 999, + title: 'Repeating event', + start: new Date(y, m, 2, 16, 0), + end: new Date(y, m, 3, 18, 0), + allDay: false + }, + { + id: 999, + title: 'Repeating event', + start: new Date(y, m, 9, 16, 0), + end: new Date(y, m, 10, 18, 0), + allDay: false + }, + { + title: 'Lunch', + start: new Date(y, m, 14, 12, 0), + end: new Date(y, m, 15, 14, 0), + allDay: false + }, + { + title: 'Birthday PARTY', + start: new Date(y, m, 18), + end: new Date(y, m, 20), + allDay: false + }, + { + title: 'Click for Google', + start: new Date(y, m, 27), + end: new Date(y, m, 29), + url: 'http://www.google.com' + } + ] + }); +}); + + +maruti = { + // === Peity charts === // + peity: function(){ + $.fn.peity.defaults.line = { + strokeWidth: 1, + delimeter: ",", + height: 24, + max: null, + min: 0, + width: 50 + }; + $.fn.peity.defaults.bar = { + delimeter: ",", + height: 24, + max: null, + min: 0, + width: 50 + }; + $(".peity_line_good span").peity("line", { + colour: "#57a532", + strokeColour: "#459D1C" + }); + $(".peity_line_bad span").peity("line", { + colour: "#FFC4C7", + strokeColour: "#BA1E20" + }); + $(".peity_line_neutral span").peity("line", { + colour: "#CCCCCC", + strokeColour: "#757575" + }); + $(".peity_bar_good span").peity("bar", { + colour: "#459D1C" + }); + $(".peity_bar_bad span").peity("bar", { + colour: "#BA1E20" + }); + $(".peity_bar_neutral span").peity("bar", { + colour: "#4fb9f0" + }); + }, + + // === Tooltip for flot charts === // + flot_tooltip: function(x, y, contents) { + + $('
        ' + contents + '
        ').css( { + top: y + 5, + left: x + 5 + }).appendTo("body").fadeIn(200); + } +} diff --git a/target/disped-web/resources/js/matrix.form_common.js b/target/disped-web/resources/js/matrix.form_common.js new file mode 100644 index 0000000000000000000000000000000000000000..e4191d0641f3cfb94f8fc97a15bf7981320d4e65 --- /dev/null +++ b/target/disped-web/resources/js/matrix.form_common.js @@ -0,0 +1,207 @@ + +$(document).ready(function(){ + + $('input[type=checkbox],input[type=radio],input[type=file]').uniform(); + + $('select').select2(); + $('.colorpicker').colorpicker(); + $('.datepicker').datepicker(); +}); + +$(document).ready(function() { + + //------------- Tags plugin -------------// + + $("#tags").select2({ + tags:["red", "green", "blue", "orange"] + }); + + //------------- Elastic textarea -------------// + if ($('textarea').hasClass('elastic')) { + $('.elastic').elastic(); + } + + //------------- Input limiter -------------// + if ($('textarea').hasClass('limit')) { + $('.limit').inputlimiter({ + limit: 100 + }); + } + + //------------- Masked input fields -------------// + $("#mask-phone").mask("(999) 999-9999", {completed:function(){alert("Callback action after complete");}}); + $("#mask-phoneExt").mask("(999) 999-9999? x99999"); + $("#mask-phoneInt").mask("+40 999 999 999"); + $("#mask-date").mask("99/99/9999"); + $("#mask-ssn").mask("999-99-9999"); + $("#mask-productKey").mask("a*-999-a999", { placeholder: "*" }); + $("#mask-eyeScript").mask("~9.99 ~9.99 999"); + $("#mask-percent").mask("99%"); + + //------------- Toggle button -------------// + + $('.normal-toggle-button').toggleButtons(); + $('.text-toggle-button').toggleButtons({ + width: 140, + label: { + enabled: "ONLINE", + disabled: "OFFLINE" + } + }); + $('.iToggle-button').toggleButtons({ + width: 70, + label: { + enabled: "", + disabled: "" + } + }); + + //------------- Spinners with steps -------------// + $( "#spinner1" ).spinner(); + + /*Demacial*/ + $( "#spinner2" ).spinner({ + step: 0.01, + numberFormat: "n" + }); + + /*Custom step size*/ + $( "#spinner3" ).spinner({ + step: 5 + }); + + /*Currency spinner*/ + $( "#spinner4" ).spinner({ + numberFormat: "C" + }); + + //------------- Colorpicker -------------// + if($('div').hasClass('picker')){ + $('.picker').farbtastic('#color'); + } + //------------- Datepicker -------------// + if($('#datepicker').length) { + $("#datepicker").datepicker({ + showOtherMonths:true + }); + } + if($('#datepicker-inline').length) { + $('#datepicker-inline').datepicker({ + inline: true, + showOtherMonths:true + }); + } + + //------------- Combined picker -------------// + if($('#combined-picker').length) { + $('#combined-picker').datetimepicker(); + } + + //------------- Time entry (picker) -------------// + $('#timepicker').timeEntry({ + show24Hours: true, + spinnerImage: '' + }); + $('#timepicker').timeEntry('setTime', '22:15') + + //------------- Select plugin -------------// + $("#select1").select2(); + $("#select2").select2(); + + //--------------- Dual multi select ------------------// + $.configureBoxes(); + + //--------------- Tinymce ------------------// + $('textarea.tinymce').tinymce({ + // Location of TinyMCE script + script_url : 'plugins/forms/tiny_mce/tiny_mce.js', + + // General options + theme : "advanced", + plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,advlist", + + // Theme options + theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect", + theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", + theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", + theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak", + theme_advanced_toolbar_location : "top", + theme_advanced_toolbar_align : "left", + theme_advanced_statusbar_location : "bottom", + theme_advanced_resizing : true, + + // Example content CSS (should be your site CSS) + content_css : "css/main.css", + + // Drop lists for link/image/media/template dialogs + template_external_list_url : "lists/template_list.js", + external_link_list_url : "lists/link_list.js", + external_image_list_url : "lists/image_list.js", + media_external_list_url : "lists/media_list.js", + + // Replace values for the template plugin + template_replace_values : { + username : "SuprUser", + staffid : "991234" + } + }); + + //Boostrap modal + $('#myModal').modal({ show: false}); + + //add event to modal after closed + $('#myModal').on('hidden', function () { + console.log('modal is closed'); + }) + +});//End document ready functions + +//sparkline in sidebar area +var positive = [1,5,3,7,8,6,10]; +var negative = [10,6,8,7,3,5,1] +var negative1 = [7,6,8,7,6,5,4] + +$('#stat1').sparkline(positive,{ + height:15, + spotRadius: 0, + barColor: '#9FC569', + type: 'bar' +}); +$('#stat2').sparkline(negative,{ + height:15, + spotRadius: 0, + barColor: '#ED7A53', + type: 'bar' +}); +$('#stat3').sparkline(negative1,{ + height:15, + spotRadius: 0, + barColor: '#ED7A53', + type: 'bar' +}); +$('#stat4').sparkline(positive,{ + height:15, + spotRadius: 0, + barColor: '#9FC569', + type: 'bar' +}); +//sparkline in widget +$('#stat5').sparkline(positive,{ + height:15, + spotRadius: 0, + barColor: '#9FC569', + type: 'bar' +}); + +$('#stat6').sparkline(positive, { + width: 70,//Width of the chart - Defaults to 'auto' - May be any valid css width - 1.5em, 20px, etc (using a number without a unit specifier won't do what you want) - This option does nothing for bar and tristate chars (see barWidth) + height: 20,//Height of the chart - Defaults to 'auto' (line height of the containing tag) + lineColor: '#88bbc8',//Used by line and discrete charts to specify the colour of the line drawn as a CSS values string + fillColor: '#f2f7f9',//Specify the colour used to fill the area under the graph as a CSS value. Set to false to disable fill + spotColor: '#e72828',//The CSS colour of the final value marker. Set to false or an empty string to hide it + maxSpotColor: '#005e20',//The CSS colour of the marker displayed for the maximum value. Set to false or an empty string to hide it + minSpotColor: '#f7941d',//The CSS colour of the marker displayed for the mimum value. Set to false or an empty string to hide it + spotRadius: 3,//Radius of all spot markers, In pixels (default: 1.5) - Integer + lineWidth: 2//In pixels (default: 1) - Integer +}); + diff --git a/target/disped-web/resources/js/matrix.form_validation.js b/target/disped-web/resources/js/matrix.form_validation.js new file mode 100644 index 0000000000000000000000000000000000000000..3f3bf130cb41ee310e4da54988ae3706efd6bb5a --- /dev/null +++ b/target/disped-web/resources/js/matrix.form_validation.js @@ -0,0 +1,88 @@ + +$(document).ready(function(){ + + $('input[type=checkbox],input[type=radio],input[type=file]').uniform(); + + $('select').select2(); + + // Form Validation + $("#basic_validate").validate({ + rules:{ + required:{ + required:true + }, + email:{ + required:true, + email: true + }, + date:{ + required:true, + date: true + }, + url:{ + required:true, + url: true + } + }, + errorClass: "help-inline", + errorElement: "span", + highlight:function(element, errorClass, validClass) { + $(element).parents('.control-group').addClass('error'); + }, + unhighlight: function(element, errorClass, validClass) { + $(element).parents('.control-group').removeClass('error'); + $(element).parents('.control-group').addClass('success'); + } + }); + + $("#number_validate").validate({ + rules:{ + min:{ + required: true, + min:10 + }, + max:{ + required:true, + max:24 + }, + number:{ + required:true, + number:true + } + }, + errorClass: "help-inline", + errorElement: "span", + highlight:function(element, errorClass, validClass) { + $(element).parents('.control-group').addClass('error'); + }, + unhighlight: function(element, errorClass, validClass) { + $(element).parents('.control-group').removeClass('error'); + $(element).parents('.control-group').addClass('success'); + } + }); + + $("#password_validate").validate({ + rules:{ + pwd:{ + required: true, + minlength:6, + maxlength:20 + }, + pwd2:{ + required:true, + minlength:6, + maxlength:20, + equalTo:"#pwd" + } + }, + errorClass: "help-inline", + errorElement: "span", + highlight:function(element, errorClass, validClass) { + $(element).parents('.control-group').addClass('error'); + }, + unhighlight: function(element, errorClass, validClass) { + $(element).parents('.control-group').removeClass('error'); + $(element).parents('.control-group').addClass('success'); + } + }); +}); diff --git a/target/disped-web/resources/js/matrix.interface.js b/target/disped-web/resources/js/matrix.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/target/disped-web/resources/js/matrix.js b/target/disped-web/resources/js/matrix.js new file mode 100644 index 0000000000000000000000000000000000000000..9319c5b57750e166ac16e256b6ee27bf8b253473 --- /dev/null +++ b/target/disped-web/resources/js/matrix.js @@ -0,0 +1,190 @@ + +$(document).ready(function(){ + + + + // === Sidebar navigation === // + + $('.submenu > a').click(function(e) + { + e.preventDefault(); + var submenu = $(this).siblings('ul'); + var li = $(this).parents('li'); + var submenus = $('#sidebar li.submenu ul'); + var submenus_parents = $('#sidebar li.submenu'); + if(li.hasClass('open')) + { + if(($(window).width() > 768) || ($(window).width() < 479)) { + submenu.slideUp(); + } else { + submenu.fadeOut(250); + } + li.removeClass('open'); + } else + { + if(($(window).width() > 768) || ($(window).width() < 479)) { + submenus.slideUp(); + submenu.slideDown(); + } else { + submenus.fadeOut(250); + submenu.fadeIn(250); + } + submenus_parents.removeClass('open'); + li.addClass('open'); + } + }); + + var ul = $('#sidebar > ul'); + + $('#sidebar > a').click(function(e) + { + e.preventDefault(); + var sidebar = $('#sidebar'); + if(sidebar.hasClass('open')) + { + sidebar.removeClass('open'); + ul.slideUp(250); + } else + { + sidebar.addClass('open'); + ul.slideDown(250); + } + }); + + // === Resize window related === // + $(window).resize(function() + { + if($(window).width() > 479) + { + ul.css({'display':'block'}); + $('#content-header .btn-group').css({width:'auto'}); + } + if($(window).width() < 479) + { + ul.css({'display':'none'}); + fix_position(); + } + if($(window).width() > 768) + { + $('#user-nav > ul').css({width:'auto',margin:'0'}); + $('#content-header .btn-group').css({width:'auto'}); + } + }); + + if($(window).width() < 468) + { + ul.css({'display':'none'}); + fix_position(); + } + + if($(window).width() > 479) + { + $('#content-header .btn-group').css({width:'auto'}); + ul.css({'display':'block'}); + } + + // === Tooltips === // + $('.tip').tooltip(); + $('.tip-left').tooltip({ placement: 'left' }); + $('.tip-right').tooltip({ placement: 'right' }); + $('.tip-top').tooltip({ placement: 'top' }); + $('.tip-bottom').tooltip({ placement: 'bottom' }); + + // === Search input typeahead === // + $('#search input[type=text]').typeahead({ + source: ['Dashboard','Form elements','Common Elements','Validation','Wizard','Buttons','Icons','Interface elements','Support','Calendar','Gallery','Reports','Charts','Graphs','Widgets'], + items: 4 + }); + + // === Fixes the position of buttons group in content header and top user navigation === // + function fix_position() + { + var uwidth = $('#user-nav > ul').width(); + $('#user-nav > ul').css({width:uwidth,'margin-left':'-' + uwidth / 2 + 'px'}); + + var cwidth = $('#content-header .btn-group').width(); + $('#content-header .btn-group').css({width:cwidth,'margin-left':'-' + uwidth / 2 + 'px'}); + } + + // === Style switcher === // + $('#style-switcher i').click(function() + { + if($(this).hasClass('open')) + { + $(this).parent().animate({marginRight:'-=190'}); + $(this).removeClass('open'); + } else + { + $(this).parent().animate({marginRight:'+=190'}); + $(this).addClass('open'); + } + $(this).toggleClass('icon-arrow-left'); + $(this).toggleClass('icon-arrow-right'); + }); + + $('#style-switcher a').click(function() + { + var style = $(this).attr('href').replace('#',''); + $('.skin-color').attr('href','css/maruti.'+style+'.css'); + $(this).siblings('a').css({'border-color':'transparent'}); + $(this).css({'border-color':'#aaaaaa'}); + }); + + $('.lightbox_trigger').click(function(e) { + + e.preventDefault(); + + var image_href = $(this).attr("href"); + + if ($('#lightbox').length > 0) { + + $('#imgbox').html('

        '); + + $('#lightbox').slideDown(500); + } + + else { + var lightbox = + ''; + + $('body').append(lightbox); + $('#lightbox').slideDown(500); + } + + }); + + + $('#lightbox').live('click', function() { + $('#lightbox').hide(200); + }); + +}); + +var ip = '.'; + +$('#logout').click(function() { + $.post(ip + '/logout', {}, function(data) { + window.location.href = 'index.html'; + }).error(function() { + cp('请求失败'); + }); +}); + +function cp(text, title) { + title = title || '提示 Tips'; + $.gritter.add({ + title: title, + text: text, + sticky: false + }); +} + +var gUsrType = JSON.parse(localStorage.getItem('uinfo')).userSysType; +var gUsrName = JSON.parse(localStorage.getItem('uinfo')).userName; +var guserId = JSON.parse(localStorage.getItem('uinfo')).userId; + +$('#topBarName').text(gUsrName + ' - ' + guserId); diff --git a/target/disped-web/resources/js/matrix.login.js b/target/disped-web/resources/js/matrix.login.js new file mode 100644 index 0000000000000000000000000000000000000000..d838cdfa6e8500bc0b1e63a967f873dbfa90a43e --- /dev/null +++ b/target/disped-web/resources/js/matrix.login.js @@ -0,0 +1,47 @@ + +$(document).ready(function(){ + + var login = $('#loginform'); + var recover = $('#recoverform'); + var speed = 400; + + $('#to-recover').click(function(){ + + $("#loginform").slideUp(); + $("#recoverform").fadeIn(); + }); + $('#to-login').click(function(){ + + $("#recoverform").hide(); + $("#loginform").fadeIn(); + }); + + + $('#to-login').click(function(){ + + }); + + if($.browser.msie == true && $.browser.version.slice(0,3) < 10) { + $('input[placeholder]').each(function(){ + + var input = $(this); + + $(input).val(input.attr('placeholder')); + + $(input).focus(function(){ + if (input.val() == input.attr('placeholder')) { + input.val(''); + } + }); + + $(input).blur(function(){ + if (input.val() == '' || input.val() == input.attr('placeholder')) { + input.val(input.attr('placeholder')); + } + }); + }); + + + + } +}); diff --git a/target/disped-web/resources/js/matrix.popover.js b/target/disped-web/resources/js/matrix.popover.js new file mode 100644 index 0000000000000000000000000000000000000000..d2e0a625245cf11d8650b4e2261195959949325e --- /dev/null +++ b/target/disped-web/resources/js/matrix.popover.js @@ -0,0 +1,60 @@ + +$(function () +{ $("#example, #example2, #example3, #example4").popover(); +}); + + +!function( $ ) { +"use strict" +var Popover = function ( element, options ) { +this.init('popover', element, options) +} +/* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js +========================================== */ +Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, { +constructor: Popover +, setContent: function () { +var $tip = this.tip() +, title = this.getTitle() +, content = this.getContent() +$tip.find('.popover-title')[ $.type(title) == 'object' ? 'append' : 'html' ](title) +$tip.find('.popover-content > *')[ $.type(content) == 'object' ? 'append' : 'html' ](content) +$tip.removeClass('fade top bottom left right in') +} +, hasContent: function () { +return this.getTitle() || this.getContent() +} +, getContent: function () { +var content +, $e = this.$element +, o = this.options +content = $e.attr('data-content') +|| (typeof o.content == 'function' ? o.content.call($e[0]) : o.content) +content = content.toString().replace(/(^\s*|\s*$)/, "") +return content +} +, tip: function() { +if (!this.$tip) { +this.$tip = $(this.options.template) +} +return this.$tip +} +}) +/* POPOVER PLUGIN DEFINITION +* ======================= */ +$.fn.popover = function ( option ) { +return this.each(function () { +var $this = $(this) +, data = $this.data('popover') +, options = typeof option == 'object' && option +if (!data) $this.data('popover', (data = new Popover(this, options))) +if (typeof option == 'string') data[option]() +}) +} +$.fn.popover.Constructor = Popover +$.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, { +placement: 'right' +, content: '' +, template: '

        ' +}) +}( window.jQuery ); diff --git a/target/disped-web/resources/js/matrix.tables.js b/target/disped-web/resources/js/matrix.tables.js new file mode 100644 index 0000000000000000000000000000000000000000..4ab29c837baadb4b0cf3dc7dfc77dd24cec42466 --- /dev/null +++ b/target/disped-web/resources/js/matrix.tables.js @@ -0,0 +1,27 @@ + +$(document).ready(function(){ + + // $('.data-table').dataTable({ + // "bJQueryUI": true, + // "sPaginationType": "full_numbers", + // "sDom": '<""l>t<"F"fp>' + // }); + + $('input[type=checkbox],input[type=radio],input[type=file]').uniform(); + + // $('select').select2(); + + $("span.icon input:checkbox, th input:checkbox").click(function() { + var checkedStatus = this.checked; + var checkbox = $(this).parents('.widget-box').find('tr td:first-child input:checkbox'); + checkbox.each(function() { + this.checked = checkedStatus; + if (checkedStatus == this.checked) { + $(this).closest('.checker > span').removeClass('checked'); + } + if (this.checked) { + $(this).closest('.checker > span').addClass('checked'); + } + }); + }); +}); diff --git a/target/disped-web/resources/js/matrix.wizard.js b/target/disped-web/resources/js/matrix.wizard.js new file mode 100644 index 0000000000000000000000000000000000000000..cf160805a9f6760410e4a5c13be496223f974cc5 --- /dev/null +++ b/target/disped-web/resources/js/matrix.wizard.js @@ -0,0 +1,43 @@ + +$(document).ready(function(){ + + $("#form-wizard").formwizard({ + formPluginEnabled: true, + validationEnabled: true, + focusFirstInput : true, + disableUIStyles : true, + + formOptions :{ + success: function(data){$("#status").fadeTo(500,1,function(){ $(this).html("Form was submitted!").fadeTo(5000, 0); })}, + beforeSubmit: function(data){$("#submitted").html("Form was submitted with ajax. Data sent to the server: " + $.param(data) + "");}, + dataType: 'json', + resetForm: true + }, + validationOptions : { + rules: { + username: "required", + password: "required", + password2: { + equalTo: "#password" + }, + email: { required: true, email: true }, + eula: "required" + }, + messages: { + username: "Please enter your name or username", + password: "You must enter the password", + password2: { equalTo: "Password don't match" }, + email: { required: "Please, enter your email", email: "Correct email format is name@domain.com" }, + eula: "You must accept the eula" + }, + errorClass: "help-inline", + errorElement: "span", + highlight:function(element, errorClass, validClass) { + $(element).parents('.control-group').addClass('error'); + }, + unhighlight: function(element, errorClass, validClass) { + $(element).parents('.control-group').removeClass('error'); + } + } + }); +}); diff --git a/target/disped-web/resources/js/select2.min.js b/target/disped-web/resources/js/select2.min.js new file mode 100644 index 0000000000000000000000000000000000000000..15237356589874a9762d08a80900d1d4b62f9945 --- /dev/null +++ b/target/disped-web/resources/js/select2.min.js @@ -0,0 +1,82 @@ +/* +Copyright 2012 Igor Vaynberg + +Version: 3.2 Timestamp: Mon Sep 10 10:38:04 PDT 2012 + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in +compliance with the License. You may obtain a copy of the License in the LICENSE file, or at: + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is +distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and limitations under the License. +*/ +(function(e){"undefined"==typeof e.fn.each2&&e.fn.extend({each2:function(g){for(var i=e([0]),m=-1,s=this.length;++ma.length)return[]; +c=a.split(b);d=0;for(j=c.length;dd?c.push(a):(c.push(a.substring(0,d)),c.push(""),c.push(a.substring(d,d+b)),c.push(""),c.push(a.substring(d+b,a.length)))}function C(a){var b, +c=0,d=null,j=a.quietMillis||100;return function(h){window.clearTimeout(b);b=window.setTimeout(function(){var b=c+=1,j=a.data,n=a.transport||e.ajax,f=a.traditional||!1,g=a.type||"GET",j=j.call(this,h.term,h.page,h.context);null!==d&&d.abort();d=n.call(null,{url:a.url,dataType:a.dataType,data:j,type:g,traditional:f,success:function(d){bd.tokenSeparators.length)return g;for(;;){h=-1;k=0; +for(n=d.tokenSeparators.length;kh)break;f=a.substring(0,h);a=a.substring(h+o.length);if(0=a}};var I=1;G=function(){return I++}; +e(document).delegate("body","mousemove",function(a){e.data(document,"select2-lastpos",{x:a.pageX,y:a.pageY})});e(document).ready(function(){e(document).delegate("body","mousedown touchend",function(a){var b=e(a.target).closest("div.select2-container").get(0),c;b?e(document).find("div.select2-container-active").each(function(){this!==b&&e(this).data("select2").blur()}):(b=e(a.target).closest("div.select2-drop").get(0),e(document).find("div.select2-drop-active").each(function(){this!==b&&e(this).data("select2").blur()})); +b=e(a.target);c=b.attr("for");"LABEL"===a.target.tagName&&(c&&0\|])/g,"\\$1");this.container.attr("id",this.containerId);var d=!1,j;this.body=function(){!1===d&&(j=a.element.closest("body"),d=!0);return j};a.element.attr("class")!==g&&this.container.addClass(a.element.attr("class").replace(/validate\[[\S ]+] ?/,""));this.container.css(v(a.containerCss));this.container.addClass(v(a.containerCssClass));this.opts.element.data("select2",this).hide().before(this.container);this.container.data("select2", +this);this.dropdown=this.container.find(".select2-drop");this.dropdown.addClass(v(a.dropdownCssClass));this.dropdown.data("select2",this);this.results=b=this.container.find(".select2-results");this.search=c=this.container.find("input.select2-input");c.attr("tabIndex",this.opts.element.attr("tabIndex"));this.resultsPage=0;this.context=null;this.initContainer();this.initContainerWidth();this.results.bind("mousemove",function(a){var b=e.data(document,"select2-lastpos");(b===g||b.x!==a.pageX||b.y!==a.pageY)&& +e(a.target).trigger("mousemove-filtered",a)});this.dropdown.delegate(".select2-results","mousemove-filtered",this.bind(this.highlightUnderEvent));var h=this.results,f=A(80,function(a){h.trigger("scroll-debounced",a)});h.bind("scroll",function(a){0<=i(a.target,h.get())&&f(a)});this.dropdown.delegate(".select2-results","scroll-debounced",this.bind(this.loadMoreIfNeeded));e.fn.mousewheel&&b.mousewheel(function(a,c,d,e){c=b.scrollTop();0=c-e?(b.scrollTop(0),l(a)):0>e&&b.get(0).scrollHeight-b.scrollTop()+ +e<=b.height()&&(b.scrollTop(b.get(0).scrollHeight-b.height()),l(a))});c.bind("keydown",function(){e.data(c,"keyup-change-value")===g&&e.data(c,"keyup-change-value",c.val())});c.bind("keyup",function(){var a=e.data(c,"keyup-change-value");a!==g&&c.val()!==a&&(e.removeData(c,"keyup-change-value"),c.trigger("keyup-change"))});c.bind("keyup-change",this.bind(this.updateResults));c.bind("focus",function(){c.addClass("select2-focused");" "===c.val()&&c.val("")});c.bind("blur",function(){c.removeClass("select2-focused")}); +this.dropdown.delegate(".select2-results","mouseup",this.bind(function(a){0 element.");});a=e.extend({},{populateResults:function(b, +c,d){var f,n=this.opts.id,o=this;f=function(b,c,j){var h,l,i,m,r,p,q;h=0;for(l=b.length;h0;p=e("
      • ");p.addClass("select2-results-dept-"+j);p.addClass("select2-result");p.addClass(m?"select2-result-selectable":"select2-result-unselectable");r&&p.addClass("select2-result-with-children");p.addClass(o.opts.formatResultCssClass(i));m=e("
        ");m.addClass("select2-result-label");q=a.formatResult(i,m,d);q!==g&&m.html(o.opts.escapeMarkup(q)); +p.append(m);if(r){r=e("
          ");r.addClass("select2-result-sub");f(i.children,r,j+1);p.append(r)}p.data("select2-data",i);c.append(p)}};f(c,b,0)}},e.fn.select2.defaults,a);"function"!==typeof a.id&&(d=a.id,a.id=function(a){return a[d]});if(c)a.query=this.bind(function(a){var c={results:[],more:false},d=a.term,f,n,o;o=function(b,c){var e;if(b.is("option"))a.matcher(d,b.text(),b)&&c.push({id:b.attr("value"),text:b.text(),element:b.get(),css:b.attr("class")});else if(b.is("optgroup")){e={text:b.attr("label"), +children:[],element:b.get(),css:b.attr("class")};b.children().each2(function(a,b){o(b,e.children)});e.children.length>0&&c.push(e)}};f=b.children();if(this.getPlaceholder()!==g&&f.length>0){n=f[0];e(n).text()===""&&(f=f.not(n))}f.each2(function(a,b){o(b,c.results)});a.callback(c)}),a.id=function(a){return a.id},a.formatResultCssClass=function(a){return a.css};else if(!("query"in a))if("ajax"in a){if((c=a.element.data("ajax-url"))&&0=this.body().scrollTop(),k=this.dropdown.hasClass("select2-drop-above"),n;"static"!==this.body().css("position")&& +(n=this.body().offset(),b-=n.top,f-=n.left);k?(k=!0,!g&&j&&(k=!1)):(k=!1,!j&&g&&(k=!0));k?(b=a.top-d,this.container.addClass("select2-drop-above"),this.dropdown.addClass("select2-drop-above")):(this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above"));a=e.extend({top:b,left:f,width:c},v(this.opts.dropdownCss));this.dropdown.css(a)},shouldOpen:function(){var a;if(this.opened())return!1;a=e.Event("open");this.opts.element.trigger(a);return!a.isDefaultPrevented()}, +clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above");this.dropdown.removeClass("select2-drop-above")},open:function(){if(!this.shouldOpen())return!1;window.setTimeout(this.bind(this.opening),1);return!0},opening:function(){var a=this.containerId,b=this.containerSelector,c="scroll."+a,d="resize."+a;this.container.parents().each(function(){e(this).bind(c,function(){var a=e(b);0==a.length&&e(this).unbind(c);a.select2("close")})});e(window).bind(d,function(){var a= +e(b);0==a.length&&e(window).unbind(d);a.select2("close")});this.clearDropdownAlignmentPreference();" "===this.search.val()&&this.search.val("");this.container.addClass("select2-dropdown-open").addClass("select2-container-active");this.updateResults(!0);this.dropdown[0]!==this.body().children().last()[0]&&this.dropdown.detach().appendTo(this.body());this.dropdown.show();this.positionDropdown();this.dropdown.addClass("select2-drop-active");this.ensureHighlightVisible();this.focusSearch()},close:function(){if(this.opened()){var a= +this;this.container.parents().each(function(){e(this).unbind("scroll."+a.containerId)});e(window).unbind("resize."+this.containerId);this.clearDropdownAlignmentPreference();this.dropdown.hide();this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active");this.results.empty();this.clearSearch();this.opts.element.trigger(e.Event("close"))}},clearSearch:function(){},ensureHighlightVisible:function(){var a=this.results,b,c,d,f;c=this.highlight();0>c||(0==c?a.scrollTop(0): +(b=a.find(".select2-result-selectable"),d=e(b[c]),f=d.offset().top+d.outerHeight(),c===b.length-1&&(b=a.find("li.select2-more-results"),0b&&a.scrollTop(a.scrollTop()+(f-b)),d=d.offset().top-a.offset().top,0>d&&a.scrollTop(a.scrollTop()+d)))},moveHighlight:function(a){for(var b=this.results.find(".select2-result-selectable"),c=this.highlight();-1=b.length&&(a=b.length-1);0>a&&(a=0);b.removeClass("select2-highlighted");e(b[a]).addClass("select2-highlighted");this.ensureHighlightVisible()},countSelectableResults:function(){return this.results.find(".select2-result-selectable").not(".select2-disabled").length}, +highlightUnderEvent:function(a){a=e(a.target).closest(".select2-result-selectable");if(0=c&&(b.addClass("select2-active"),this.opts.query({term:f,page:d,context:g,matcher:this.opts.matcher,callback:this.bind(function(c){e.opened()&&(e.opts.populateResults.call(this,a,c.results,{term:f,page:d,context:g}),!0===c.more?(b.detach().appendTo(a).text(e.opts.formatLoadMore(d+1)),window.setTimeout(function(){e.loadMoreIfNeeded()},10)):b.remove(),e.positionDropdown(),e.resultsPage=d)})})))},tokenize:function(){},updateResults:function(a){function b(){f.scrollTop(0);d.removeClass("select2-active"); +k.positionDropdown()}function c(a){f.html(k.opts.escapeMarkup(a));b()}var d=this.search,f=this.results,h=this.opts,i,k=this;if(!(!0!==a&&(!1===this.showSearchInput||!this.opened()))){d.addClass("select2-active");if(1<=h.maximumSelectionSize&&(i=this.data(),e.isArray(i)&&i.length>=h.maximumSelectionSize&&u(h.formatSelectionTooBig,"formatSelectionTooBig"))){c("
        • "+h.formatSelectionTooBig(h.maximumSelectionSize)+"
        • ");return}d.val().length"+h.formatInputTooShort(d.val(),h.minimumInputLength)+""):(c("
        • "+h.formatSearching()+"
        • "),i=this.tokenize(),i!=g&&null!=i&&d.val(i),this.resultsPage=1,h.query({term:d.val(),page:this.resultsPage,context:null,matcher:h.matcher,callback:this.bind(function(i){var l;this.opened()&&((this.context=i.context===g?null:i.context,this.opts.createSearchChoice&&""!==d.val()&&(l=this.opts.createSearchChoice.call(null, +d.val(),i.results),l!==g&&null!==l&&k.id(l)!==g&&null!==k.id(l)&&0===e(i.results).filter(function(){return m(k.id(this),k.id(l))}).length&&i.results.unshift(l)),0===i.results.length&&u(h.formatNoMatches,"formatNoMatches"))?c("
        • "+h.formatNoMatches(d.val())+"
        • "):(f.empty(),k.opts.populateResults.call(this,f,i.results,{term:d.val(),page:this.resultsPage,context:null}),!0===i.more&&u(h.formatLoadMore,"formatLoadMore")&&(f.append("
        • "+k.opts.escapeMarkup(h.formatLoadMore(this.resultsPage))+ +"
        • "),window.setTimeout(function(){k.loadMoreIfNeeded()},10)),this.postprocessResults(i,a),b()))})}))}},cancel:function(){this.close()},blur:function(){this.close();this.container.removeClass("select2-container-active");this.dropdown.removeClass("select2-drop-active");this.search[0]===document.activeElement&&this.search.blur();this.clearSearch();this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){this.search.show();this.search.focus(); +window.setTimeout(this.bind(function(){this.search.show();this.search.focus();this.search.val(this.search.val())}),10)},selectHighlighted:function(){var a=this.highlight(),b=this.results.find(".select2-highlighted").not(".select2-disabled"),c=b.closest(".select2-result-selectable").data("select2-data");c&&(b.addClass("select2-disabled"),this.highlight(a),this.onSelect(c))},getPlaceholder:function(){return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")|| +this.opts.placeholder},initContainerWidth:function(){var a=function(){var a,c,d,f;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth()?"auto":this.opts.element.outerWidth()+"px";if("copy"===this.opts.width||"resolve"===this.opts.width){a=this.opts.element.attr("style");if(a!==g){a=a.split(";");d=0;for(f=a.length;d
          ",{"class":"select2-container"}).html("
          ")}, +opening:function(){this.search.show();this.parent.opening.apply(this,arguments);this.dropdown.removeClass("select2-offscreen")},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.dropdown.removeAttr("style").addClass("select2-offscreen").insertAfter(this.selection).show())},focus:function(){this.close();this.selection.focus()},isFocused:function(){return this.selection[0]===document.activeElement},cancel:function(){this.parent.cancel.apply(this,arguments);this.selection.focus()}, +initContainer:function(){var a,b=this.dropdown;this.selection=a=this.container.find(".select2-choice");this.search.bind("keydown",this.bind(function(a){if(this.enabled)if(a.which===f.PAGE_UP||a.which===f.PAGE_DOWN)l(a);else if(this.opened())switch(a.which){case f.UP:case f.DOWN:this.moveHighlight(a.which===f.UP?-1:1);l(a);break;case f.TAB:case f.ENTER:this.selectHighlighted();l(a);break;case f.ESC:this.cancel(a),l(a)}else a.which===f.TAB||f.isControl(a)||f.isFunctionKey(a)||a.which===f.ESC||!1=== +this.opts.openOnEnter&&a.which===f.ENTER||this.open()}));this.search.bind("focus",this.bind(function(){this.selection.attr("tabIndex","-1")}));this.search.bind("blur",this.bind(function(){this.opened()||this.container.removeClass("select2-container-active");window.setTimeout(this.bind(function(){this.selection.attr("tabIndex",this.opts.element.attr("tabIndex"))}),10)}));a.bind("mousedown",this.bind(function(){this.opened()?(this.close(),this.selection.focus()):this.enabled&&this.open()}));b.bind("mousedown", +this.bind(function(){this.search.focus()}));a.bind("focus",this.bind(function(){this.container.addClass("select2-container-active");this.search.attr("tabIndex","-1")}));a.bind("blur",this.bind(function(){this.opened()||this.container.removeClass("select2-container-active");window.setTimeout(this.bind(function(){this.search.attr("tabIndex",this.opts.element.attr("tabIndex"))}),10)}));a.bind("keydown",this.bind(function(a){if(this.enabled)if(a.which===f.PAGE_UP||a.which===f.PAGE_DOWN)l(a);else if(!(a.which=== +f.TAB||f.isControl(a)||f.isFunctionKey(a)||a.which===f.ESC)&&!(!1===this.opts.openOnEnter&&a.which===f.ENTER))if(a.which==f.DELETE)this.opts.allowClear&&this.clear();else{this.open();if(a.which!==f.ENTER&&!(48>a.which)){var b=String.fromCharCode(a.which).toLowerCase();a.shiftKey&&(b=b.toUpperCase());this.search.focus();this.search.val(b)}l(a)}}));a.delegate("abbr","mousedown",this.bind(function(a){this.enabled&&(this.clear(),l(a),this.close(),this.triggerChange(),this.selection.focus())}));this.setPlaceholder(); +this.search.bind("focus",this.bind(function(){this.container.addClass("select2-container-active")}))},clear:function(){this.opts.element.val("");this.selection.find("span").empty();this.selection.removeData("select2-data");this.setPlaceholder()},initSelection:function(){if(""===this.opts.element.val())this.close(),this.setPlaceholder();else{var a=this;this.opts.initSelection.call(null,this.opts.element,function(b){b!==g&&null!==b&&(a.updateSelection(b),a.close(),a.setPlaceholder())})}},prepareOpts:function(){var a= +this.parent.prepareOpts.apply(this,arguments);"select"===a.element.get(0).tagName.toLowerCase()&&(a.initSelection=function(a,c){var d=a.find(":selected");e.isFunction(c)&&c({id:d.attr("value"),text:d.text()})});return a},setPlaceholder:function(){var a=this.getPlaceholder();""===this.opts.element.val()&&a!==g&&!(this.select&&""!==this.select.find("option:first").text())&&(this.selection.find("span").html(this.opts.escapeMarkup(a)),this.selection.addClass("select2-default"),this.selection.find("abbr").hide())}, +postprocessResults:function(a,b){var c=0,d=this,f=!0;this.results.find(".select2-result-selectable").each2(function(a,b){if(m(d.id(b.data("select2-data")),d.opts.element.val()))return c=a,!1});this.highlight(c);!0===b&&(f=this.showSearchInput=F(a.results)>=this.opts.minimumResultsForSearch,this.dropdown.find(".select2-search")[f?"removeClass":"addClass"]("select2-search-hidden"),e(this.dropdown,this.container)[f?"addClass":"removeClass"]("select2-with-searchbox"))},onSelect:function(a){var b=this.opts.element.val(); +this.opts.element.val(this.id(a));this.updateSelection(a);this.close();this.selection.focus();m(b,this.id(a))||this.triggerChange()},updateSelection:function(a){var b=this.selection.find("span");this.selection.data("select2-data",a);b.empty();a=this.opts.formatSelection(a,b);a!==g&&b.append(this.opts.escapeMarkup(a));this.selection.removeClass("select2-default");this.opts.allowClear&&this.getPlaceholder()!==g&&this.selection.find("abbr").show()},val:function(){var a,b=null,c=this;if(0===arguments.length)return this.opts.element.val(); +a=arguments[0];if(this.select)this.select.val(a).find(":selected").each2(function(a,c){b={id:c.attr("value"),text:c.text()};return!1}),this.updateSelection(b),this.setPlaceholder();else{if(this.opts.initSelection===g)throw Error("cannot call val() if initSelection() is not defined");a?(this.opts.element.val(a),this.opts.initSelection(this.opts.element,function(a){c.opts.element.val(!a?"":c.id(a));c.updateSelection(a);c.setPlaceholder()})):this.clear()}},clearSearch:function(){this.search.val("")}, +data:function(a){var b;if(0===arguments.length)return b=this.selection.data("select2-data"),b==g&&(b=null),b;!a||""===a?this.clear():(this.opts.element.val(!a?"":this.id(a)),this.updateSelection(a))}});z=x(w,{createContainer:function(){return e("
          ",{"class":"select2-container select2-container-multi"}).html("
          ")}, +prepareOpts:function(){var a=this.parent.prepareOpts.apply(this,arguments);"select"===a.element.get(0).tagName.toLowerCase()&&(a.initSelection=function(a,c){var d=[];a.find(":selected").each2(function(a,b){d.push({id:b.attr("value"),text:b.text()})});e.isFunction(c)&&c(d)});return a},initContainer:function(){var a;this.searchContainer=this.container.find(".select2-search-field");this.selection=a=this.container.find(".select2-choices");this.search.bind("keydown",this.bind(function(b){if(this.enabled){if(b.which=== +f.BACKSPACE&&""===this.search.val()){this.close();var c;c=a.find(".select2-search-choice-focus");if(0i(d.id(this),b)&&(b.push(d.id(this)),c.push(this))});a=c;this.selection.find(".select2-search-choice").remove();e(a).each(function(){d.addSelectedChoice(this)});d.postprocessResults()},tokenize:function(){var a=this.search.val(),a=this.opts.tokenizer(a,this.data(),this.bind(this.onSelect), +this.opts);null!=a&&a!=g&&(this.search.val(a),0
          "), +c=this.id(a),d=this.getVal(),f;f=this.opts.formatSelection(a,b);b.find("div").replaceWith("
          "+this.opts.escapeMarkup(f)+"
          ");b.find(".select2-search-choice-close").bind("mousedown",l).bind("click dblclick",this.bind(function(a){this.enabled&&(e(a.target).closest(".select2-search-choice").fadeOut("fast",this.bind(function(){this.unselect(e(a.target));this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");this.close();this.focusSearch()})).dequeue(), +l(a))})).bind("focus",this.bind(function(){this.enabled&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))}));b.data("select2-data",a);b.insertBefore(this.searchContainer);d.push(c);this.setVal(d)},unselect:function(a){var b=this.getVal(),c,d,a=a.closest(".select2-search-choice");if(0===a.length)throw"Invalid argument: "+a+". Must be .select2-search-choice";c=a.data("select2-data");d=i(this.id(c),b);0<=d&&(b.splice(d,1),this.setVal(b),this.select&& +this.postprocessResults());a.remove();this.triggerChange({removed:c})},postprocessResults:function(){var a=this.getVal(),b=this.results.find(".select2-result-selectable"),c=this.results.find(".select2-result-with-children"),d=this;b.each2(function(b,c){var e=d.id(c.data("select2-data"));0<=i(e,a)?c.addClass("select2-disabled").removeClass("select2-result-selectable"):c.removeClass("select2-disabled").addClass("select2-result-selectable")});c.each2(function(a,b){0==b.find(".select2-result-selectable").length? +b.addClass("select2-disabled"):b.removeClass("select2-disabled")});b.each2(function(a,b){if(!b.hasClass("select2-disabled")&&b.hasClass("select2-result-selectable"))return d.highlight(0),!1})},resizeSearch:function(){var a,b,c,d,f=this.search.outerWidth()-this.search.width();a=this.search;q||(c=a[0].currentStyle||window.getComputedStyle(a[0],null),q=e("
          ").css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:c.fontSize,fontFamily:c.fontFamily,fontStyle:c.fontStyle, +fontWeight:c.fontWeight,letterSpacing:c.letterSpacing,textTransform:c.textTransform,whiteSpace:"nowrap"}),e("body").append(q));q.text(a.val());a=q.width()+10;b=this.search.offset().left;c=this.selection.width();d=this.selection.offset().left;b=c-(b-d)-f;bb&&(b=c-f);this.search.width(b)},getVal:function(){var a;if(this.select)return a=this.select.val(),null===a?[]:a;a=this.opts.element.val();return s(a,this.opts.separator)},setVal:function(a){var b;this.select?this.select.val(a):(b= +[],e(a).each(function(){0>i(this,b)&&b.push(this)}),this.opts.element.val(0===b.length?"":b.join(this.opts.separator)))},val:function(){var a,b=[],c=this;if(0===arguments.length)return this.getVal();if(a=arguments[0])if(this.setVal(a),this.select)this.select.find(":selected").each(function(){b.push({id:e(this).attr("value"),text:e(this).text()})}),this.updateSelection(b);else{if(this.opts.initSelection===g)throw Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element, +function(a){var b=e(a).map(c.id);c.setVal(b);c.updateSelection(a);c.clearSearch()})}else this.opts.element.val(""),this.updateSelection([]);this.clearSearch()},onSortStart:function(){if(this.select)throw Error("Sorting of elements is not supported when attached to instead.");this.search.width(0);this.searchContainer.hide()},onSortEnd:function(){var a=[],b=this;this.searchContainer.show();this.searchContainer.appendTo(this.searchContainer.parent());this.resizeSearch(); +this.selection.find(".select2-search-choice").each(function(){a.push(b.opts.id(e(this).data("select2-data")))});this.setVal(a);this.triggerChange()},data:function(a){var b=this,c;if(0===arguments.length)return this.selection.find(".select2-search-choice").map(function(){return e(this).data("select2-data")}).get();a||(a=[]);c=e.map(a,function(a){return b.opts.id(a)});this.setVal(c);this.updateSelection(a);this.clearSearch()}});e.fn.select2=function(){var a=Array.prototype.slice.call(arguments,0),b, +c,d,f,h="val destroy opened open close focus isFocused container onSortStart onSortEnd enable disable positionDropdown data".split(" ");this.each(function(){if(0===a.length||"object"===typeof a[0])b=0===a.length?{}:e.extend({},a[0]),b.element=e(this),"select"===b.element.get(0).tagName.toLowerCase()?f=b.element.attr("multiple"):(f=b.multiple||!1,"tags"in b&&(b.multiple=f=!0)),c=f?new z:new y,c.init(b);else if("string"===typeof a[0]){if(0>i(a[0],h))throw"Unknown method: "+a[0];d=g;c=e(this).data("select2"); +if(c!==g&&(d="container"===a[0]?c.container:c[a[0]].apply(c,a.slice(1)),d!==g))return!1}else throw"Invalid arguments to select2 plugin: "+a;});return d===g?this:d};e.fn.select2.defaults={width:"copy",closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(a,b,c){b=[];B(a.text,c.term,b);return b.join("")},formatSelection:function(a){return a?a.text:g},formatResultCssClass:function(){return g},formatNoMatches:function(){return"No matches found"}, +formatInputTooShort:function(a,b){return"Please enter "+(b-a.length)+" more characters"},formatSelectionTooBig:function(a){return"You can only select "+a+" item"+(1==a?"":"s")},formatLoadMore:function(){return"Loading more results..."},formatSearching:function(){return"Searching..."},minimumResultsForSearch:0,minimumInputLength:0,maximumSelectionSize:0,id:function(a){return a.id},matcher:function(a,b){return 0<=b.toUpperCase().indexOf(a.toUpperCase())},separator:",",tokenSeparators:[],tokenizer:H, +escapeMarkup:function(a){return a&&"string"===typeof a?a.replace(/&/g,"&"):a},blurOnChange:!1};window.Select2={query:{ajax:C,local:D,tags:E},util:{debounce:A,markMatch:B},"class":{"abstract":w,single:y,multi:z}}}})(jQuery); diff --git a/target/disped-web/resources/js/vue.min.js b/target/disped-web/resources/js/vue.min.js new file mode 100644 index 0000000000000000000000000000000000000000..836793b4cafa381080fe48fd5ed5f83f598469bf --- /dev/null +++ b/target/disped-web/resources/js/vue.min.js @@ -0,0 +1,6 @@ +/*! + * Vue.js v2.5.13 + * (c) 2014-2017 Evan You + * Released under the MIT License. + */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Vue=e()}(this,function(){"use strict";function t(t){return void 0===t||null===t}function e(t){return void 0!==t&&null!==t}function n(t){return!0===t}function r(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function i(t){return null!==t&&"object"==typeof t}function o(t){return"[object Object]"===Nn.call(t)}function a(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function s(t){return null==t?"":"object"==typeof t?JSON.stringify(t,null,2):String(t)}function c(t){var e=parseFloat(t);return isNaN(e)?t:e}function u(t,e){for(var n=Object.create(null),r=t.split(","),i=0;i-1)return t.splice(n,1)}}function f(t,e){return Mn.call(t,e)}function p(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}function d(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n}function v(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function h(t,e){for(var n in e)t[n]=e[n];return t}function m(t){for(var e={},n=0;n0&&(tt((s=et(s,(o||"")+"_"+a))[0])&&tt(u)&&(l[c]=x(u.text+s[0].text),s.shift()),l.push.apply(l,s)):r(s)?tt(u)?l[c]=x(u.text+s):""!==s&&l.push(x(s)):tt(s)&&tt(u)?l[c]=x(u.text+s.text):(n(i._isVList)&&e(s.tag)&&t(s.key)&&e(o)&&(s.key="__vlist"+o+"_"+a+"__"),l.push(s)));return l}function nt(t,e){return(t.__esModule||fr&&"Module"===t[Symbol.toStringTag])&&(t=t.default),i(t)?e.extend(t):t}function rt(t){return t.isComment&&t.asyncFactory}function it(t){if(Array.isArray(t))for(var n=0;n=0||n.indexOf(t[i])<0)&&r.push(t[i]);return r}return t}}(n[o],r[o],i[o]));return e}(t);r&&h(t.extendOptions,r),(e=t.options=F(n,t.extendOptions)).name&&(e.components[e.name]=t)}}return e}function Rt(t){this._init(t)}function Ht(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,r=n.cid,i=t._Ctor||(t._Ctor={});if(i[r])return i[r];var o=t.name||n.options.name,a=function(t){this._init(t)};return a.prototype=Object.create(n.prototype),a.prototype.constructor=a,a.cid=e++,a.options=F(n.options,t),a.super=n,a.options.props&&function(t){var e=t.options.props;for(var n in e)mt(t.prototype,"_props",n)}(a),a.options.computed&&function(t){var e=t.options.computed;for(var n in e)gt(t.prototype,n,e[n])}(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,zn.forEach(function(t){a[t]=n[t]}),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=t,a.sealedOptions=h({},a.options),i[r]=a,a}}function Bt(t){return t&&(t.Ctor.options.name||t.tag)}function Ut(t,e){return Array.isArray(t)?t.indexOf(e)>-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!function(t){return"[object RegExp]"===Nn.call(t)}(t)&&t.test(e)}function Vt(t,e){var n=t.cache,r=t.keys,i=t._vnode;for(var o in n){var a=n[o];if(a){var s=Bt(a.componentOptions);s&&!e(s)&&zt(n,o,r,i)}}}function zt(t,e,n,r){var i=t[e];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),t[e]=null,l(n,e)}function Kt(t){for(var n=t.data,r=t,i=t;e(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(n=Jt(i.data,n));for(;e(r=r.parent);)r&&r.data&&(n=Jt(n,r.data));return function(t,n){if(e(t)||e(n))return qt(t,Wt(n));return""}(n.staticClass,n.class)}function Jt(t,n){return{staticClass:qt(t.staticClass,n.staticClass),class:e(t.class)?[t.class,n.class]:n.class}}function qt(t,e){return t?e?t+" "+e:t:e||""}function Wt(t){return Array.isArray(t)?function(t){for(var n,r="",i=0,o=t.length;i=0&&" "===(m=t.charAt(h));h--);m&&Ii.test(m)||(l=!0)}}else void 0===o?(v=i+1,o=t.slice(0,i).trim()):e();if(void 0===o?o=t.slice(0,i).trim():0!==v&&e(),a)for(i=0;i-1?{exp:t.slice(0,ii),key:'"'+t.slice(ii+1)+'"'}:{exp:t,key:null};ni=t,ii=oi=ai=0;for(;!_e();)be(ri=ge())?$e(ri):91===ri&&function(t){var e=1;oi=ii;for(;!_e();)if(t=ge(),be(t))$e(t);else if(91===t&&e++,93===t&&e--,0===e){ai=ii;break}}(ri);return{exp:t.slice(0,oi),key:t.slice(oi+1,ai)}}(t);return null===n.key?t+"="+e:"$set("+n.exp+", "+n.key+", "+e+")"}function ge(){return ni.charCodeAt(++ii)}function _e(){return ii>=ei}function be(t){return 34===t||39===t}function $e(t){for(var e=t;!_e()&&(t=ge())!==e;);}function Ce(t,e,n,r,i){e=function(t){return t._withTask||(t._withTask=function(){Er=!0;var e=t.apply(null,arguments);return Er=!1,e})}(e),n&&(e=function(t,e,n){var r=si;return function i(){null!==t.apply(null,arguments)&&we(e,i,n,r)}}(e,t,r)),si.addEventListener(t,e,or?{capture:r,passive:i}:r)}function we(t,e,n,r){(r||si).removeEventListener(t,e._withTask||e,n)}function xe(n,r){if(!t(n.data.on)||!t(r.data.on)){var i=r.data.on||{},o=n.data.on||{};si=r.elm,function(t){if(e(t[Li])){var n=Qn?"change":"input";t[n]=[].concat(t[Li],t[n]||[]),delete t[Li]}e(t[Mi])&&(t.change=[].concat(t[Mi],t.change||[]),delete t[Mi])}(i),X(i,o,Ce,we,r.context),si=void 0}}function ke(n,r){if(!t(n.data.domProps)||!t(r.data.domProps)){var i,o,a=r.elm,s=n.data.domProps||{},u=r.data.domProps||{};e(u.__ob__)&&(u=r.data.domProps=h({},u));for(i in s)t(u[i])&&(a[i]="");for(i in u){if(o=u[i],"textContent"===i||"innerHTML"===i){if(r.children&&(r.children.length=0),o===s[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===i){a._value=o;var l=t(o)?"":String(o);(function(t,n){return!t.composing&&("OPTION"===t.tagName||function(t,e){var n=!0;try{n=document.activeElement!==t}catch(t){}return n&&t.value!==e}(t,n)||function(t,n){var r=t.value,i=t._vModifiers;if(e(i)){if(i.lazy)return!1;if(i.number)return c(r)!==c(n);if(i.trim)return r.trim()!==n.trim()}return r!==n}(t,n))})(a,l)&&(a.value=l)}else a[i]=o}}}function Ae(t){var e=Oe(t.style);return t.staticStyle?h(t.staticStyle,e):e}function Oe(t){return Array.isArray(t)?m(t):"string"==typeof t?Fi(t):t}function Se(n,r){var i=r.data,o=n.data;if(!(t(i.staticStyle)&&t(i.style)&&t(o.staticStyle)&&t(o.style))){var a,s,c=r.elm,u=o.staticStyle,l=o.normalizedStyle||o.style||{},f=u||l,p=Oe(r.data.style)||{};r.data.normalizedStyle=e(p.__ob__)?h({},p):p;var d=function(t,e){var n,r={};if(e)for(var i=t;i.componentInstance;)(i=i.componentInstance._vnode)&&i.data&&(n=Ae(i.data))&&h(r,n);(n=Ae(t.data))&&h(r,n);for(var o=t;o=o.parent;)o.data&&(n=Ae(o.data))&&h(r,n);return r}(r,!0);for(s in f)t(d[s])&&Bi(c,s,"");for(s in d)(a=d[s])!==f[s]&&Bi(c,s,null==a?"":a)}}function Te(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(/\s+/).forEach(function(e){return t.classList.add(e)}):t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function Ee(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(/\s+/).forEach(function(e){return t.classList.remove(e)}):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" "+(t.getAttribute("class")||"")+" ",r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?t.setAttribute("class",n):t.removeAttribute("class")}}function je(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&h(e,Ki(t.name||"v")),h(e,t),e}return"string"==typeof t?Ki(t):void 0}}function Ne(t){Qi(function(){Qi(t)})}function Ie(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),Te(t,e))}function Le(t,e){t._transitionClasses&&l(t._transitionClasses,e),Ee(t,e)}function Me(t,e,n){var r=De(t,e),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===qi?Zi:Yi,c=0,u=function(){t.removeEventListener(s,l),n()},l=function(e){e.target===t&&++c>=a&&u()};setTimeout(function(){c0&&(n=qi,l=a,f=o.length):e===Wi?u>0&&(n=Wi,l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?qi:Wi:null)?n===qi?o.length:c.length:0;return{type:n,timeout:l,propCount:f,hasTransform:n===qi&&to.test(r[Gi+"Property"])}}function Pe(t,e){for(;t.length1}function Ve(t,e){!0!==e.data.show&&Re(e)}function ze(t,e,n){Ke(t,e,n),(Qn||er)&&setTimeout(function(){Ke(t,e,n)},0)}function Ke(t,e,n){var r=e.value,i=t.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,c=t.options.length;s-1,a.selected!==o&&(a.selected=o);else if(g(qe(a),r))return void(t.selectedIndex!==s&&(t.selectedIndex=s));i||(t.selectedIndex=-1)}}function Je(t,e){return e.every(function(e){return!g(e,t)})}function qe(t){return"_value"in t?t._value:t.value}function We(t){t.target.composing=!0}function Ge(t){t.target.composing&&(t.target.composing=!1,Ze(t.target,"input"))}function Ze(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function Xe(t){return!t.componentInstance||t.data&&t.data.transition?t:Xe(t.componentInstance._vnode)}function Ye(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?Ye(it(e.children)):t}function Qe(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var i=n._parentListeners;for(var o in i)e[Pn(o)]=i[o];return e}function tn(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}function en(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function nn(t){t.data.newPos=t.elm.getBoundingClientRect()}function rn(t){var e=t.data.pos,n=t.data.newPos,r=e.left-n.left,i=e.top-n.top;if(r||i){t.data.moved=!0;var o=t.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}function on(t,e){var n=e?zo:Vo;return t.replace(n,function(t){return Uo[t]})}function an(t,e,n){return{type:1,tag:t,attrsList:e,attrsMap:function(t){for(var e={},n=0,r=t.length;n=0&&a[i].lowerCasedTag!==s;i--);else i=0;if(i>=0){for(var c=a.length-1;c>=i;c--)e.end&&e.end(a[c].tag,n,r);a.length=i,o=i&&a[i-1].tag}else"br"===s?e.start&&e.start(t,[],!0,n,r):"p"===s&&(e.start&&e.start(t,[],!1,n,r),e.end&&e.end(t,n,r))}for(var i,o,a=[],s=e.expectHTML,c=e.isUnaryTag||Bn,u=e.canBeLeftOpenTag||Bn,l=0;t;){if(i=t,o&&Ho(o)){var f=0,p=o.toLowerCase(),d=Bo[p]||(Bo[p]=new RegExp("([\\s\\S]*?)(]*>)","i")),v=t.replace(d,function(t,n,r){return f=r.length,Ho(p)||"noscript"===p||(n=n.replace(//g,"$1").replace(//g,"$1")),Jo(p,n)&&(n=n.slice(1)),e.chars&&e.chars(n),""});l+=t.length-v.length,t=v,r(p,l-f,l)}else{var h=t.indexOf("<");if(0===h){if(Ao.test(t)){var m=t.indexOf("--\x3e");if(m>=0){e.shouldKeepComment&&e.comment(t.substring(4,m)),n(m+3);continue}}if(Oo.test(t)){var y=t.indexOf("]>");if(y>=0){n(y+2);continue}}var g=t.match(ko);if(g){n(g[0].length);continue}var _=t.match(xo);if(_){var b=l;n(_[0].length),r(_[1],b,l);continue}var $=function(){var e=t.match(Co);if(e){var r={tagName:e[1],attrs:[],start:l};n(e[0].length);for(var i,o;!(i=t.match(wo))&&(o=t.match(_o));)n(o[0].length),r.attrs.push(o);if(i)return r.unarySlash=i[1],n(i[0].length),r.end=l,r}}();if($){!function(t){var n=t.tagName,i=t.unarySlash;s&&("p"===o&&go(n)&&r(o),u(n)&&o===n&&r(n));for(var l=c(n)||!!i,f=t.attrs.length,p=new Array(f),d=0;d=0){for(w=t.slice(h);!(xo.test(w)||Co.test(w)||Ao.test(w)||Oo.test(w)||(x=w.indexOf("<",1))<0);)h+=x,w=t.slice(h);C=t.substring(0,h),n(h)}h<0&&(C=t,t=""),e.chars&&C&&e.chars(C)}if(t===i){e.chars&&e.chars(t);break}}r()}(t,{warn:To,expectHTML:e.expectHTML,isUnaryTag:e.isUnaryTag,canBeLeftOpenTag:e.canBeLeftOpenTag,shouldDecodeNewlines:e.shouldDecodeNewlines,shouldDecodeNewlinesForHref:e.shouldDecodeNewlinesForHref,shouldKeepComment:e.comments,start:function(t,a,u){var l=i&&i.ns||Do(t);Qn&&"svg"===l&&(a=function(t){for(var e=[],n=0;nc&&(s.push(o=t.slice(c,i)),a.push(JSON.stringify(o)));var u=ae(r[1].trim());a.push("_s("+u+")"),s.push({"@binding":u}),c=i+r[0].length}return c':'
          ',Ro.innerHTML.indexOf(" ")>0}var jn=Object.freeze({}),Nn=Object.prototype.toString,In=u("slot,component",!0),Ln=u("key,ref,slot,slot-scope,is"),Mn=Object.prototype.hasOwnProperty,Dn=/-(\w)/g,Pn=p(function(t){return t.replace(Dn,function(t,e){return e?e.toUpperCase():""})}),Fn=p(function(t){return t.charAt(0).toUpperCase()+t.slice(1)}),Rn=/\B([A-Z])/g,Hn=p(function(t){return t.replace(Rn,"-$1").toLowerCase()}),Bn=function(t,e,n){return!1},Un=function(t){return t},Vn="data-server-rendered",zn=["component","directive","filter"],Kn=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured"],Jn={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:Bn,isReservedAttr:Bn,isUnknownElement:Bn,getTagNamespace:y,parsePlatformTagName:Un,mustUseProp:Bn,_lifecycleHooks:Kn},qn=/[^\w.$]/,Wn="__proto__"in{},Gn="undefined"!=typeof window,Zn="undefined"!=typeof WXEnvironment&&!!WXEnvironment.platform,Xn=Zn&&WXEnvironment.platform.toLowerCase(),Yn=Gn&&window.navigator.userAgent.toLowerCase(),Qn=Yn&&/msie|trident/.test(Yn),tr=Yn&&Yn.indexOf("msie 9.0")>0,er=Yn&&Yn.indexOf("edge/")>0,nr=Yn&&Yn.indexOf("android")>0||"android"===Xn,rr=Yn&&/iphone|ipad|ipod|ios/.test(Yn)||"ios"===Xn,ir=(Yn&&/chrome\/\d+/.test(Yn),{}.watch),or=!1;if(Gn)try{var ar={};Object.defineProperty(ar,"passive",{get:function(){or=!0}}),window.addEventListener("test-passive",null,ar)}catch(t){}var sr,cr,ur=function(){return void 0===sr&&(sr=!Gn&&"undefined"!=typeof global&&"server"===global.process.env.VUE_ENV),sr},lr=Gn&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,fr="undefined"!=typeof Symbol&&w(Symbol)&&"undefined"!=typeof Reflect&&w(Reflect.ownKeys);cr="undefined"!=typeof Set&&w(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var pr=y,dr=0,vr=function(){this.id=dr++,this.subs=[]};vr.prototype.addSub=function(t){this.subs.push(t)},vr.prototype.removeSub=function(t){l(this.subs,t)},vr.prototype.depend=function(){vr.target&&vr.target.addDep(this)},vr.prototype.notify=function(){for(var t=this.subs.slice(),e=0,n=t.length;eVr&&Fr[n].id>t.id;)n--;Fr.splice(n+1,0,t)}else Fr.push(t);Br||(Br=!0,q(ht))}}(this)},Kr.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||i(t)||this.deep){var e=this.value;if(this.value=t,this.user)try{this.cb.call(this.vm,t,e)}catch(t){V(t,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,t,e)}}},Kr.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},Kr.prototype.depend=function(){for(var t=this.deps.length;t--;)this.deps[t].depend()},Kr.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||l(this.vm._watchers,this);for(var t=this.deps.length;t--;)this.deps[t].removeSub(this);this.active=!1}};var Jr={enumerable:!0,configurable:!0,get:y,set:y},qr={lazy:!0};Nt(It.prototype);var Wr={init:function(t,n,r,i){if(!t.componentInstance||t.componentInstance._isDestroyed){(t.componentInstance=function(t,n,r,i){var o={_isComponent:!0,parent:n,_parentVnode:t,_parentElm:r||null,_refElm:i||null},a=t.data.inlineTemplate;return e(a)&&(o.render=a.render,o.staticRenderFns=a.staticRenderFns),new t.componentOptions.Ctor(o)}(t,Pr,r,i)).$mount(n?t.elm:void 0,n)}else if(t.data.keepAlive){var o=t;Wr.prepatch(o,o)}},prepatch:function(t,e){var n=e.componentOptions;!function(t,e,n,r,i){var o=!!(i||t.$options._renderChildren||r.data.scopedSlots||t.$scopedSlots!==jn);if(t.$options._parentVnode=r,t.$vnode=r,t._vnode&&(t._vnode.parent=r),t.$options._renderChildren=i,t.$attrs=r.data&&r.data.attrs||jn,t.$listeners=n||jn,e&&t.$options.props){Cr.shouldConvert=!1;for(var a=t._props,s=t.$options._propKeys||[],c=0;c1?v(n):n;for(var r=v(arguments,1),i=0,o=n.length;iparseInt(this.max)&&zt(a,s[0],s,this._vnode)),e.data.keepAlive=!0}return e||t&&t[0]}}};!function(t){var e={};e.get=function(){return Jn},Object.defineProperty(t,"config",e),t.util={warn:pr,extend:h,mergeOptions:F,defineReactive:E},t.set=j,t.delete=N,t.nextTick=q,t.options=Object.create(null),zn.forEach(function(e){t.options[e+"s"]=Object.create(null)}),t.options._base=t,h(t.options.components,ti),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=v(arguments,1);return n.unshift(this),"function"==typeof t.install?t.install.apply(t,n):"function"==typeof t&&t.apply(null,n),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=F(this.options,t),this}}(t),Ht(t),function(t){zn.forEach(function(e){t[e]=function(t,n){return n?("component"===e&&o(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"==typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}})}(t)}(Rt),Object.defineProperty(Rt.prototype,"$isServer",{get:ur}),Object.defineProperty(Rt.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Rt.version="2.5.13";var ei,ni,ri,ii,oi,ai,si,ci,ui=u("style,class"),li=u("input,textarea,option,select,progress"),fi=function(t,e,n){return"value"===n&&li(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},pi=u("contenteditable,draggable,spellcheck"),di=u("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),vi="http://www.w3.org/1999/xlink",hi=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},mi=function(t){return hi(t)?t.slice(6,t.length):""},yi=function(t){return null==t||!1===t},gi={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},_i=u("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),bi=u("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),$i=function(t){return _i(t)||bi(t)},Ci=Object.create(null),wi=u("text,number,password,search,email,tel,url"),xi=Object.freeze({createElement:function(t,e){var n=document.createElement(t);return"select"!==t?n:(e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n)},createElementNS:function(t,e){return document.createElementNS(gi[t],e)},createTextNode:function(t){return document.createTextNode(t)},createComment:function(t){return document.createComment(t)},insertBefore:function(t,e,n){t.insertBefore(e,n)},removeChild:function(t,e){t.removeChild(e)},appendChild:function(t,e){t.appendChild(e)},parentNode:function(t){return t.parentNode},nextSibling:function(t){return t.nextSibling},tagName:function(t){return t.tagName},setTextContent:function(t,e){t.textContent=e},setAttribute:function(t,e,n){t.setAttribute(e,n)}}),ki={create:function(t,e){Xt(e)},update:function(t,e){t.data.ref!==e.data.ref&&(Xt(t,!0),Xt(e))},destroy:function(t){Xt(t,!0)}},Ai=new mr("",{},[]),Oi=["create","activate","update","remove","destroy"],Si={create:te,update:te,destroy:function(t){te(t,Ai)}},Ti=Object.create(null),Ei=[ki,Si],ji={create:re,update:re},Ni={create:oe,update:oe},Ii=/[\w).+\-_$\]]/,Li="__r",Mi="__c",Di={create:xe,update:xe},Pi={create:ke,update:ke},Fi=p(function(t){var e={},n=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach(function(t){if(t){var r=t.split(n);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}),Ri=/^--/,Hi=/\s*!important$/,Bi=function(t,e,n){if(Ri.test(e))t.style.setProperty(e,n);else if(Hi.test(n))t.style.setProperty(e,n.replace(Hi,""),"important");else{var r=Vi(e);if(Array.isArray(n))for(var i=0,o=n.length;id?v(n,t(i[g+1])?null:i[g+1].elm,i,p,g,o):p>g&&m(0,r,f,d)}function _(r,i,o,a){if(r!==i){var s=i.elm=r.elm;if(n(r.isAsyncPlaceholder))e(i.asyncFactory.resolved)?$(r.elm,i,o):i.isAsyncPlaceholder=!0;else if(n(i.isStatic)&&n(r.isStatic)&&i.key===r.key&&(n(i.isCloned)||n(i.isOnce)))i.componentInstance=r.componentInstance;else{var c,u=i.data;e(u)&&e(c=u.hook)&&e(c=c.prepatch)&&c(r,i);var l=r.children,p=i.children;if(e(u)&&f(i)){for(c=0;c-1?Ci[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:Ci[t]=/HTMLUnknownElement/.test(e.toString())},h(Rt.options.directives,ro),h(Rt.options.components,so),Rt.prototype.__patch__=Gn?eo:y,Rt.prototype.$mount=function(t,e){return t=t&&Gn?Zt(t):void 0,function(t,e,n){t.$el=e,t.$options.render||(t.$options.render=gr),vt(t,"beforeMount");var r;return r=function(){t._update(t._render(),n)},new Kr(t,r,y,null,!0),n=!1,null==t.$vnode&&(t._isMounted=!0,vt(t,"mounted")),t}(this,t,e)},Rt.nextTick(function(){Jn.devtools&&lr&&lr.emit("init",Rt)},0);var co,uo=/\{\{((?:.|\n)+?)\}\}/g,lo=/[-.*+?^${}()|[\]\/\\]/g,fo=p(function(t){var e=t[0].replace(lo,"\\$&"),n=t[1].replace(lo,"\\$&");return new RegExp(e+"((?:.|\\n)+?)"+n,"g")}),po={staticKeys:["staticClass"],transformNode:function(t,e){e.warn;var n=he(t,"class");n&&(t.staticClass=JSON.stringify(n));var r=ve(t,"class",!1);r&&(t.classBinding=r)},genData:function(t){var e="";return t.staticClass&&(e+="staticClass:"+t.staticClass+","),t.classBinding&&(e+="class:"+t.classBinding+","),e}},vo={staticKeys:["staticStyle"],transformNode:function(t,e){e.warn;var n=he(t,"style");n&&(t.staticStyle=JSON.stringify(Fi(n)));var r=ve(t,"style",!1);r&&(t.styleBinding=r)},genData:function(t){var e="";return t.staticStyle&&(e+="staticStyle:"+t.staticStyle+","),t.styleBinding&&(e+="style:("+t.styleBinding+"),"),e}},ho=function(t){return co=co||document.createElement("div"),co.innerHTML=t,co.textContent},mo=u("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),yo=u("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),go=u("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),_o=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,bo="[a-zA-Z_][\\w\\-\\.]*",$o="((?:"+bo+"\\:)?"+bo+")",Co=new RegExp("^<"+$o),wo=/^\s*(\/?)>/,xo=new RegExp("^<\\/"+$o+"[^>]*>"),ko=/^]+>/i,Ao=/^ + * + * eminem
          + * dr. dre + *
          50 Cent
          + *
          + * + * + * + * + *
            + *
          • eminem
          • + *
          • dr. dre
          • + *
          • 50 Cent
          • + *
          + */ +wysihtml5.dom.convertToList = (function() { + function _createListItem(doc, list) { + var listItem = doc.createElement("li"); + list.appendChild(listItem); + return listItem; + } + + function _createList(doc, type) { + return doc.createElement(type); + } + + function convertToList(element, listType) { + if (element.nodeName === "UL" || element.nodeName === "OL" || element.nodeName === "MENU") { + // Already a list + return element; + } + + var doc = element.ownerDocument, + list = _createList(doc, listType), + lineBreaks = element.querySelectorAll("br"), + lineBreaksLength = lineBreaks.length, + childNodes, + childNodesLength, + childNode, + lineBreak, + parentNode, + isBlockElement, + isLineBreak, + currentListItem, + i; + + // First find
          at the end of inline elements and move them behind them + for (i=0; i if empty, otherwise create a new one + currentListItem = currentListItem.firstChild ? _createListItem(doc, list) : currentListItem; + currentListItem.appendChild(childNode); + currentListItem = null; + continue; + } + + if (isLineBreak) { + // Only create a new list item in the next iteration when the current one has already content + currentListItem = currentListItem.firstChild ? null : currentListItem; + continue; + } + + currentListItem.appendChild(childNode); + } + + element.parentNode.replaceChild(list, element); + return list; + } + + return convertToList; +})();/** + * Copy a set of attributes from one element to another + * + * @param {Array} attributesToCopy List of attributes which should be copied + * @return {Object} Returns an object which offers the "from" method which can be invoked with the element where to + * copy the attributes from., this again returns an object which provides a method named "to" which can be invoked + * with the element where to copy the attributes to (see example) + * + * @example + * var textarea = document.querySelector("textarea"), + * div = document.querySelector("div[contenteditable=true]"), + * anotherDiv = document.querySelector("div.preview"); + * wysihtml5.dom.copyAttributes(["spellcheck", "value", "placeholder"]).from(textarea).to(div).andTo(anotherDiv); + * + */ +wysihtml5.dom.copyAttributes = function(attributesToCopy) { + return { + from: function(elementToCopyFrom) { + return { + to: function(elementToCopyTo) { + var attribute, + i = 0, + length = attributesToCopy.length; + for (; ifoo"); + */ +wysihtml5.dom.getAsDom = (function() { + + var _innerHTMLShiv = function(html, context) { + var tempElement = context.createElement("div"); + tempElement.style.display = "none"; + context.body.appendChild(tempElement); + // IE throws an exception when trying to insert via innerHTML + try { tempElement.innerHTML = html; } catch(e) {} + context.body.removeChild(tempElement); + return tempElement; + }; + + /** + * Make sure IE supports HTML5 tags, which is accomplished by simply creating one instance of each element + */ + var _ensureHTML5Compatibility = function(context) { + if (context._wysihtml5_supportsHTML5Tags) { + return; + } + for (var i=0, length=HTML5_ELEMENTS.length; i "block" + */ +wysihtml5.dom.getStyle = (function() { + var stylePropertyMapping = { + "float": ("styleFloat" in document.createElement("div").style) ? "styleFloat" : "cssFloat" + }, + REG_EXP_CAMELIZE = /\-[a-z]/g; + + function camelize(str) { + return str.replace(REG_EXP_CAMELIZE, function(match) { + return match.charAt(1).toUpperCase(); + }); + } + + return function(property) { + return { + from: function(element) { + if (element.nodeType !== wysihtml5.ELEMENT_NODE) { + return; + } + + var doc = element.ownerDocument, + camelizedProperty = stylePropertyMapping[property] || camelize(property), + style = element.style, + currentStyle = element.currentStyle, + styleValue = style[camelizedProperty]; + if (styleValue) { + return styleValue; + } + + // currentStyle is no standard and only supported by Opera and IE but it has one important advantage over the standard-compliant + // window.getComputedStyle, since it returns css property values in their original unit: + // If you set an elements width to "50%", window.getComputedStyle will give you it's current width in px while currentStyle + // gives you the original "50%". + // Opera supports both, currentStyle and window.getComputedStyle, that's why checking for currentStyle should have higher prio + if (currentStyle) { + try { + return currentStyle[camelizedProperty]; + } catch(e) { + //ie will occasionally fail for unknown reasons. swallowing exception + } + } + + var win = doc.defaultView || doc.parentWindow, + needsOverflowReset = (property === "height" || property === "width") && element.nodeName === "TEXTAREA", + originalOverflow, + returnValue; + + if (win.getComputedStyle) { + // Chrome and Safari both calculate a wrong width and height for textareas when they have scroll bars + // therfore we remove and restore the scrollbar and calculate the value in between + if (needsOverflowReset) { + originalOverflow = style.overflow; + style.overflow = "hidden"; + } + returnValue = win.getComputedStyle(element, null).getPropertyValue(property); + if (needsOverflowReset) { + style.overflow = originalOverflow || ""; + } + return returnValue; + } + } + }; + }; +})();/** + * High performant way to check whether an element with a specific tag name is in the given document + * Optimized for being heavily executed + * Unleashes the power of live node lists + * + * @param {Object} doc The document object of the context where to check + * @param {String} tagName Upper cased tag name + * @example + * wysihtml5.dom.hasElementWithTagName(document, "IMG"); + */ +wysihtml5.dom.hasElementWithTagName = (function() { + var LIVE_CACHE = {}, + DOCUMENT_IDENTIFIER = 1; + + function _getDocumentIdentifier(doc) { + return doc._wysihtml5_identifier || (doc._wysihtml5_identifier = DOCUMENT_IDENTIFIER++); + } + + return function(doc, tagName) { + var key = _getDocumentIdentifier(doc) + ":" + tagName, + cacheEntry = LIVE_CACHE[key]; + if (!cacheEntry) { + cacheEntry = LIVE_CACHE[key] = doc.getElementsByTagName(tagName); + } + + return cacheEntry.length > 0; + }; +})();/** + * High performant way to check whether an element with a specific class name is in the given document + * Optimized for being heavily executed + * Unleashes the power of live node lists + * + * @param {Object} doc The document object of the context where to check + * @param {String} tagName Upper cased tag name + * @example + * wysihtml5.dom.hasElementWithClassName(document, "foobar"); + */ +(function(wysihtml5) { + var LIVE_CACHE = {}, + DOCUMENT_IDENTIFIER = 1; + + function _getDocumentIdentifier(doc) { + return doc._wysihtml5_identifier || (doc._wysihtml5_identifier = DOCUMENT_IDENTIFIER++); + } + + wysihtml5.dom.hasElementWithClassName = function(doc, className) { + // getElementsByClassName is not supported by IE<9 + // but is sometimes mocked via library code (which then doesn't return live node lists) + if (!wysihtml5.browser.supportsNativeGetElementsByClassName()) { + return !!doc.querySelector("." + className); + } + + var key = _getDocumentIdentifier(doc) + ":" + className, + cacheEntry = LIVE_CACHE[key]; + if (!cacheEntry) { + cacheEntry = LIVE_CACHE[key] = doc.getElementsByClassName(className); + } + + return cacheEntry.length > 0; + }; +})(wysihtml5); +wysihtml5.dom.insert = function(elementToInsert) { + return { + after: function(element) { + element.parentNode.insertBefore(elementToInsert, element.nextSibling); + }, + + before: function(element) { + element.parentNode.insertBefore(elementToInsert, element); + }, + + into: function(element) { + element.appendChild(elementToInsert); + } + }; +};wysihtml5.dom.insertCSS = function(rules) { + rules = rules.join("\n"); + + return { + into: function(doc) { + var head = doc.head || doc.getElementsByTagName("head")[0], + styleElement = doc.createElement("style"); + + styleElement.type = "text/css"; + + if (styleElement.styleSheet) { + styleElement.styleSheet.cssText = rules; + } else { + styleElement.appendChild(doc.createTextNode(rules)); + } + + if (head) { + head.appendChild(styleElement); + } + } + }; +};/** + * Method to set dom events + * + * @example + * wysihtml5.dom.observe(iframe.contentWindow.document.body, ["focus", "blur"], function() { ... }); + */ +wysihtml5.dom.observe = function(element, eventNames, handler) { + eventNames = typeof(eventNames) === "string" ? [eventNames] : eventNames; + + var handlerWrapper, + eventName, + i = 0, + length = eventNames.length; + + for (; i
          foo bar
          + * + * var userHTML = '
          I'm a table!
          '; + * wysihtml5.dom.parse(userHTML); + * // => 'I'm a table!' + * + * var userHTML = '
          foobar
          foobar
          '; + * wysihtml5.dom.parse(userHTML, { + * tags: { + * div: undefined, + * br: true + * } + * }); + * // => '' + * + * var userHTML = '
          foo
          bar
          '; + * wysihtml5.dom.parse(userHTML, { + * classes: { + * red: 1, + * green: 1 + * }, + * tags: { + * div: { + * rename_tag: "p" + * } + * } + * }); + * // => '

          foo

          bar

          ' + */ +wysihtml5.dom.parse = (function() { + + /** + * It's not possible to use a XMLParser/DOMParser as HTML5 is not always well-formed XML + * new DOMParser().parseFromString('') will cause a parseError since the + * node isn't closed + * + * Therefore we've to use the browser's ordinary HTML parser invoked by setting innerHTML. + */ + var NODE_TYPE_MAPPING = { + "1": _handleElement, + "3": _handleText + }, + // Rename unknown tags to this + DEFAULT_NODE_NAME = "span", + WHITE_SPACE_REG_EXP = /\s+/, + defaultRules = { tags: {}, classes: {} }, + currentRules = {}; + + /** + * Iterates over all childs of the element, recreates them, appends them into a document fragment + * which later replaces the entire body content + */ + function parse(elementOrHtml, rules, context, cleanUp) { + wysihtml5.lang.object(currentRules).merge(defaultRules).merge(rules).get(); + + context = context || elementOrHtml.ownerDocument || document; + var fragment = context.createDocumentFragment(), + isString = typeof(elementOrHtml) === "string", + element, + newNode, + firstChild; + + if (isString) { + element = wysihtml5.dom.getAsDom(elementOrHtml, context); + } else { + element = elementOrHtml; + } + + while (element.firstChild) { + firstChild = element.firstChild; + element.removeChild(firstChild); + newNode = _convert(firstChild, cleanUp); + if (newNode) { + fragment.appendChild(newNode); + } + } + + // Clear element contents + element.innerHTML = ""; + + // Insert new DOM tree + element.appendChild(fragment); + + return isString ? wysihtml5.quirks.getCorrectInnerHTML(element) : element; + } + + function _convert(oldNode, cleanUp) { + var oldNodeType = oldNode.nodeType, + oldChilds = oldNode.childNodes, + oldChildsLength = oldChilds.length, + newNode, + method = NODE_TYPE_MAPPING[oldNodeType], + i = 0; + + newNode = method && method(oldNode); + + if (!newNode) { + return null; + } + + for (i=0; i elements + if (cleanUp && + newNode.childNodes.length <= 1 && + newNode.nodeName.toLowerCase() === DEFAULT_NODE_NAME && + !newNode.attributes.length) { + return newNode.firstChild; + } + + return newNode; + } + + function _handleElement(oldNode) { + var rule, + newNode, + endTag, + tagRules = currentRules.tags, + nodeName = oldNode.nodeName.toLowerCase(), + scopeName = oldNode.scopeName; + + /** + * We already parsed that element + * ignore it! (yes, this sometimes happens in IE8 when the html is invalid) + */ + if (oldNode._wysihtml5) { + return null; + } + oldNode._wysihtml5 = 1; + + if (oldNode.className === "wysihtml5-temp") { + return null; + } + + /** + * IE is the only browser who doesn't include the namespace in the + * nodeName, that's why we have to prepend it by ourselves + * scopeName is a proprietary IE feature + * read more here http://msdn.microsoft.com/en-us/library/ms534388(v=vs.85).aspx + */ + if (scopeName && scopeName != "HTML") { + nodeName = scopeName + ":" + nodeName; + } + + /** + * Repair node + * IE is a bit bitchy when it comes to invalid nested markup which includes unclosed tags + * A

          doesn't need to be closed according HTML4-5 spec, we simply replace it with a

          to preserve its content and layout + */ + if ("outerHTML" in oldNode) { + if (!wysihtml5.browser.autoClosesUnclosedTags() && + oldNode.nodeName === "P" && + oldNode.outerHTML.slice(-4).toLowerCase() !== "

          ") { + nodeName = "div"; + } + } + + if (nodeName in tagRules) { + rule = tagRules[nodeName]; + if (!rule || rule.remove) { + return null; + } + + rule = typeof(rule) === "string" ? { rename_tag: rule } : rule; + } else if (oldNode.firstChild) { + rule = { rename_tag: DEFAULT_NODE_NAME }; + } else { + // Remove empty unknown elements + return null; + } + + newNode = oldNode.ownerDocument.createElement(rule.rename_tag || nodeName); + _handleAttributes(oldNode, newNode, rule); + + oldNode = null; + return newNode; + } + + function _handleAttributes(oldNode, newNode, rule) { + var attributes = {}, // fresh new set of attributes to set on newNode + setClass = rule.set_class, // classes to set + addClass = rule.add_class, // add classes based on existing attributes + setAttributes = rule.set_attributes, // attributes to set on the current node + checkAttributes = rule.check_attributes, // check/convert values of attributes + allowedClasses = currentRules.classes, + i = 0, + classes = [], + newClasses = [], + newUniqueClasses = [], + oldClasses = [], + classesLength, + newClassesLength, + currentClass, + newClass, + attributeName, + newAttributeValue, + method; + + if (setAttributes) { + attributes = wysihtml5.lang.object(setAttributes).clone(); + } + + if (checkAttributes) { + for (attributeName in checkAttributes) { + method = attributeCheckMethods[checkAttributes[attributeName]]; + if (!method) { + continue; + } + newAttributeValue = method(_getAttribute(oldNode, attributeName)); + if (typeof(newAttributeValue) === "string") { + attributes[attributeName] = newAttributeValue; + } + } + } + + if (setClass) { + classes.push(setClass); + } + + if (addClass) { + for (attributeName in addClass) { + method = addClassMethods[addClass[attributeName]]; + if (!method) { + continue; + } + newClass = method(_getAttribute(oldNode, attributeName)); + if (typeof(newClass) === "string") { + classes.push(newClass); + } + } + } + + // make sure that wysihtml5 temp class doesn't get stripped out + allowedClasses["_wysihtml5-temp-placeholder"] = 1; + + // add old classes last + oldClasses = oldNode.getAttribute("class"); + if (oldClasses) { + classes = classes.concat(oldClasses.split(WHITE_SPACE_REG_EXP)); + } + classesLength = classes.length; + for (; i under https when it's new attribute value is non-https + // TODO: Investigate this further and check for smarter handling + try { + newNode.setAttribute(attributeName, attributes[attributeName]); + } catch(e) {} + } + + // IE8 sometimes loses the width/height attributes when those are set before the "src" + // so we make sure to set them again + if (attributes.src) { + if (typeof(attributes.width) !== "undefined") { + newNode.setAttribute("width", attributes.width); + } + if (typeof(attributes.height) !== "undefined") { + newNode.setAttribute("height", attributes.height); + } + } + } + + /** + * IE gives wrong results for hasAttribute/getAttribute, for example: + * var td = document.createElement("td"); + * td.getAttribute("rowspan"); // => "1" in IE + * + * Therefore we have to check the element's outerHTML for the attribute + */ + var HAS_GET_ATTRIBUTE_BUG = !wysihtml5.browser.supportsGetAttributeCorrectly(); + function _getAttribute(node, attributeName) { + attributeName = attributeName.toLowerCase(); + var nodeName = node.nodeName; + if (nodeName == "IMG" && attributeName == "src" && _isLoadedImage(node) === true) { + // Get 'src' attribute value via object property since this will always contain the + // full absolute url (http://...) + // this fixes a very annoying bug in firefox (ver 3.6 & 4) and IE 8 where images copied from the same host + // will have relative paths, which the sanitizer strips out (see attributeCheckMethods.url) + return node.src; + } else if (HAS_GET_ATTRIBUTE_BUG && "outerHTML" in node) { + // Don't trust getAttribute/hasAttribute in IE 6-8, instead check the element's outerHTML + var outerHTML = node.outerHTML.toLowerCase(), + // TODO: This might not work for attributes without value: + hasAttribute = outerHTML.indexOf(" " + attributeName + "=") != -1; + + return hasAttribute ? node.getAttribute(attributeName) : null; + } else{ + return node.getAttribute(attributeName); + } + } + + /** + * Check whether the given node is a proper loaded image + * FIXME: Returns undefined when unknown (Chrome, Safari) + */ + function _isLoadedImage(node) { + try { + return node.complete && !node.mozMatchesSelector(":-moz-broken"); + } catch(e) { + if (node.complete && node.readyState === "complete") { + return true; + } + } + } + + function _handleText(oldNode) { + return oldNode.ownerDocument.createTextNode(oldNode.data); + } + + + // ------------ attribute checks ------------ \\ + var attributeCheckMethods = { + url: (function() { + var REG_EXP = /^https?:\/\//i; + return function(attributeValue) { + if (!attributeValue || !attributeValue.match(REG_EXP)) { + return null; + } + return attributeValue.replace(REG_EXP, function(match) { + return match.toLowerCase(); + }); + }; + })(), + + alt: (function() { + var REG_EXP = /[^ a-z0-9_\-]/gi; + return function(attributeValue) { + if (!attributeValue) { + return ""; + } + return attributeValue.replace(REG_EXP, ""); + }; + })(), + + numbers: (function() { + var REG_EXP = /\D/g; + return function(attributeValue) { + attributeValue = (attributeValue || "").replace(REG_EXP, ""); + return attributeValue || null; + }; + })() + }; + + // ------------ class converter (converts an html attribute to a class name) ------------ \\ + var addClassMethods = { + align_img: (function() { + var mapping = { + left: "wysiwyg-float-left", + right: "wysiwyg-float-right" + }; + return function(attributeValue) { + return mapping[String(attributeValue).toLowerCase()]; + }; + })(), + + align_text: (function() { + var mapping = { + left: "wysiwyg-text-align-left", + right: "wysiwyg-text-align-right", + center: "wysiwyg-text-align-center", + justify: "wysiwyg-text-align-justify" + }; + return function(attributeValue) { + return mapping[String(attributeValue).toLowerCase()]; + }; + })(), + + clear_br: (function() { + var mapping = { + left: "wysiwyg-clear-left", + right: "wysiwyg-clear-right", + both: "wysiwyg-clear-both", + all: "wysiwyg-clear-both" + }; + return function(attributeValue) { + return mapping[String(attributeValue).toLowerCase()]; + }; + })(), + + size_font: (function() { + var mapping = { + "1": "wysiwyg-font-size-xx-small", + "2": "wysiwyg-font-size-small", + "3": "wysiwyg-font-size-medium", + "4": "wysiwyg-font-size-large", + "5": "wysiwyg-font-size-x-large", + "6": "wysiwyg-font-size-xx-large", + "7": "wysiwyg-font-size-xx-large", + "-": "wysiwyg-font-size-smaller", + "+": "wysiwyg-font-size-larger" + }; + return function(attributeValue) { + return mapping[String(attributeValue).charAt(0)]; + }; + })() + }; + + return parse; +})();/** + * Checks for empty text node childs and removes them + * + * @param {Element} node The element in which to cleanup + * @example + * wysihtml5.dom.removeEmptyTextNodes(element); + */ +wysihtml5.dom.removeEmptyTextNodes = function(node) { + var childNode, + childNodes = wysihtml5.lang.array(node.childNodes).get(), + childNodesLength = childNodes.length, + i = 0; + for (; i to a

          ) and keeps its childs + * + * @param {Element} element The list element which should be renamed + * @param {Element} newNodeName The desired tag name + * + * @example + * + *

            + *
          • eminem
          • + *
          • dr. dre
          • + *
          • 50 Cent
          • + *
          + * + * + * + * + *
            + *
          1. eminem
          2. + *
          3. dr. dre
          4. + *
          5. 50 Cent
          6. + *
          + */ +wysihtml5.dom.renameElement = function(element, newNodeName) { + var newElement = element.ownerDocument.createElement(newNodeName), + firstChild; + while (firstChild = element.firstChild) { + newElement.appendChild(firstChild); + } + wysihtml5.dom.copyAttributes(["align", "className"]).from(element).to(newElement); + element.parentNode.replaceChild(newElement, element); + return newElement; +};/** + * Takes an element, removes it and replaces it with it's childs + * + * @param {Object} node The node which to replace with it's child nodes + * @example + *
          + * hello + *
          + * + */ +wysihtml5.dom.replaceWithChildNodes = function(node) { + if (!node.parentNode) { + return; + } + + if (!node.firstChild) { + node.parentNode.removeChild(node); + return; + } + + var fragment = node.ownerDocument.createDocumentFragment(); + while (node.firstChild) { + fragment.appendChild(node.firstChild); + } + node.parentNode.replaceChild(fragment, node); + node = fragment = null; +}; +/** + * Unwraps an unordered/ordered list + * + * @param {Element} element The list element which should be unwrapped + * + * @example + * + *
            + *
          • eminem
          • + *
          • dr. dre
          • + *
          • 50 Cent
          • + *
          + * + * + * + * + * eminem
          + * dr. dre
          + * 50 Cent
          + */ +(function(dom) { + function _isBlockElement(node) { + return dom.getStyle("display").from(node) === "block"; + } + + function _isLineBreak(node) { + return node.nodeName === "BR"; + } + + function _appendLineBreak(element) { + var lineBreak = element.ownerDocument.createElement("br"); + element.appendChild(lineBreak); + } + + function resolveList(list) { + if (list.nodeName !== "MENU" && list.nodeName !== "UL" && list.nodeName !== "OL") { + return; + } + + var doc = list.ownerDocument, + fragment = doc.createDocumentFragment(), + previousSibling = list.previousElementSibling || list.previousSibling, + firstChild, + lastChild, + isLastChild, + shouldAppendLineBreak, + listItem; + + if (previousSibling && !_isBlockElement(previousSibling)) { + _appendLineBreak(fragment); + } + + while (listItem = list.firstChild) { + lastChild = listItem.lastChild; + while (firstChild = listItem.firstChild) { + isLastChild = firstChild === lastChild; + // This needs to be done before appending it to the fragment, as it otherwise will loose style information + shouldAppendLineBreak = isLastChild && !_isBlockElement(firstChild) && !_isLineBreak(firstChild); + fragment.appendChild(firstChild); + if (shouldAppendLineBreak) { + _appendLineBreak(fragment); + } + } + + listItem.parentNode.removeChild(listItem); + } + list.parentNode.replaceChild(fragment, list); + } + + dom.resolveList = resolveList; +})(wysihtml5.dom);/** + * Sandbox for executing javascript, parsing css styles and doing dom operations in a secure way + * + * Browser Compatibility: + * - Secure in MSIE 6+, but only when the user hasn't made changes to his security level "restricted" + * - Partially secure in other browsers (Firefox, Opera, Safari, Chrome, ...) + * + * Please note that this class can't benefit from the HTML5 sandbox attribute for the following reasons: + * - sandboxing doesn't work correctly with inlined content (src="javascript:'...'") + * - sandboxing of physical documents causes that the dom isn't accessible anymore from the outside (iframe.contentWindow, ...) + * - setting the "allow-same-origin" flag would fix that, but then still javascript and dom events refuse to fire + * - therefore the "allow-scripts" flag is needed, which then would deactivate any security, as the js executed inside the iframe + * can do anything as if the sandbox attribute wasn't set + * + * @param {Function} [readyCallback] Method that gets invoked when the sandbox is ready + * @param {Object} [config] Optional parameters + * + * @example + * new wysihtml5.dom.Sandbox(function(sandbox) { + * sandbox.getWindow().document.body.innerHTML = ''; + * }); + */ +(function(wysihtml5) { + var /** + * Default configuration + */ + doc = document, + /** + * Properties to unset/protect on the window object + */ + windowProperties = [ + "parent", "top", "opener", "frameElement", "frames", + "localStorage", "globalStorage", "sessionStorage", "indexedDB" + ], + /** + * Properties on the window object which are set to an empty function + */ + windowProperties2 = [ + "open", "close", "openDialog", "showModalDialog", + "alert", "confirm", "prompt", + "openDatabase", "postMessage", + "XMLHttpRequest", "XDomainRequest" + ], + /** + * Properties to unset/protect on the document object + */ + documentProperties = [ + "referrer", + "write", "open", "close" + ]; + + wysihtml5.dom.Sandbox = Base.extend( + /** @scope wysihtml5.dom.Sandbox.prototype */ { + + constructor: function(readyCallback, config) { + this.callback = readyCallback || wysihtml5.EMPTY_FUNCTION; + this.config = wysihtml5.lang.object({}).merge(config).get(); + this.iframe = this._createIframe(); + }, + + insertInto: function(element) { + if (typeof(element) === "string") { + element = doc.getElementById(element); + } + + element.appendChild(this.iframe); + }, + + getIframe: function() { + return this.iframe; + }, + + getWindow: function() { + this._readyError(); + }, + + getDocument: function() { + this._readyError(); + }, + + destroy: function() { + var iframe = this.getIframe(); + iframe.parentNode.removeChild(iframe); + }, + + _readyError: function() { + throw new Error("wysihtml5.Sandbox: Sandbox iframe isn't loaded yet"); + }, + + /** + * Creates the sandbox iframe + * + * Some important notes: + * - We can't use HTML5 sandbox for now: + * setting it causes that the iframe's dom can't be accessed from the outside + * Therefore we need to set the "allow-same-origin" flag which enables accessing the iframe's dom + * But then there's another problem, DOM events (focus, blur, change, keypress, ...) aren't fired. + * In order to make this happen we need to set the "allow-scripts" flag. + * A combination of allow-scripts and allow-same-origin is almost the same as setting no sandbox attribute at all. + * - Chrome & Safari, doesn't seem to support sandboxing correctly when the iframe's html is inlined (no physical document) + * - IE needs to have the security="restricted" attribute set before the iframe is + * inserted into the dom tree + * - Believe it or not but in IE "security" in document.createElement("iframe") is false, even + * though it supports it + * - When an iframe has security="restricted", in IE eval() & execScript() don't work anymore + * - IE doesn't fire the onload event when the content is inlined in the src attribute, therefore we rely + * on the onreadystatechange event + */ + _createIframe: function() { + var that = this, + iframe = doc.createElement("iframe"); + iframe.className = "wysihtml5-sandbox"; + wysihtml5.dom.setAttributes({ + "security": "restricted", + "allowtransparency": "true", + "frameborder": 0, + "width": 0, + "height": 0, + "marginwidth": 0, + "marginheight": 0 + }).on(iframe); + + // Setting the src like this prevents ssl warnings in IE6 + if (wysihtml5.browser.throwsMixedContentWarningWhenIframeSrcIsEmpty()) { + iframe.src = "javascript:''"; + } + + iframe.onload = function() { + iframe.onreadystatechange = iframe.onload = null; + that._onLoadIframe(iframe); + }; + + iframe.onreadystatechange = function() { + if (/loaded|complete/.test(iframe.readyState)) { + iframe.onreadystatechange = iframe.onload = null; + that._onLoadIframe(iframe); + } + }; + + return iframe; + }, + + /** + * Callback for when the iframe has finished loading + */ + _onLoadIframe: function(iframe) { + // don't resume when the iframe got unloaded (eg. by removing it from the dom) + if (!wysihtml5.dom.contains(doc.documentElement, iframe)) { + return; + } + + var that = this, + iframeWindow = iframe.contentWindow, + iframeDocument = iframe.contentWindow.document, + charset = doc.characterSet || doc.charset || "utf-8", + sandboxHtml = this._getHtml({ + charset: charset, + stylesheets: this.config.stylesheets + }); + + // Create the basic dom tree including proper DOCTYPE and charset + iframeDocument.open("text/html", "replace"); + iframeDocument.write(sandboxHtml); + iframeDocument.close(); + + this.getWindow = function() { return iframe.contentWindow; }; + this.getDocument = function() { return iframe.contentWindow.document; }; + + // Catch js errors and pass them to the parent's onerror event + // addEventListener("error") doesn't work properly in some browsers + // TODO: apparently this doesn't work in IE9! + iframeWindow.onerror = function(errorMessage, fileName, lineNumber) { + throw new Error("wysihtml5.Sandbox: " + errorMessage, fileName, lineNumber); + }; + + if (!wysihtml5.browser.supportsSandboxedIframes()) { + // Unset a bunch of sensitive variables + // Please note: This isn't hack safe! + // It more or less just takes care of basic attacks and prevents accidental theft of sensitive information + // IE is secure though, which is the most important thing, since IE is the only browser, who + // takes over scripts & styles into contentEditable elements when copied from external websites + // or applications (Microsoft Word, ...) + var i, length; + for (i=0, length=windowProperties.length; i'; + } + } + templateVars.stylesheets = html; + + return wysihtml5.lang.string( + '' + + '#{stylesheets}' + + '' + ).interpolate(templateVars); + }, + + /** + * Method to unset/override existing variables + * @example + * // Make cookie unreadable and unwritable + * this._unset(document, "cookie", "", true); + */ + _unset: function(object, property, value, setter) { + try { object[property] = value; } catch(e) {} + + try { object.__defineGetter__(property, function() { return value; }); } catch(e) {} + if (setter) { + try { object.__defineSetter__(property, function() {}); } catch(e) {} + } + + if (!wysihtml5.browser.crashesWhenDefineProperty(property)) { + try { + var config = { + get: function() { return value; } + }; + if (setter) { + config.set = function() {}; + } + Object.defineProperty(object, property, config); + } catch(e) {} + } + } + }); +})(wysihtml5); +(function() { + var mapping = { + "className": "class" + }; + wysihtml5.dom.setAttributes = function(attributes) { + return { + on: function(element) { + for (var i in attributes) { + element.setAttribute(mapping[i] || i, attributes[i]); + } + } + } + }; +})();wysihtml5.dom.setStyles = function(styles) { + return { + on: function(element) { + var style = element.style; + if (typeof(styles) === "string") { + style.cssText += ";" + styles; + return; + } + for (var i in styles) { + if (i === "float") { + style.cssFloat = styles[i]; + style.styleFloat = styles[i]; + } else { + style[i] = styles[i]; + } + } + } + }; +};/** + * Simulate HTML5 placeholder attribute + * + * Needed since + * - div[contentEditable] elements don't support it + * - older browsers (such as IE8 and Firefox 3.6) don't support it at all + * + * @param {Object} parent Instance of main wysihtml5.Editor class + * @param {Element} view Instance of wysihtml5.views.* class + * @param {String} placeholderText + * + * @example + * wysihtml.dom.simulatePlaceholder(this, composer, "Foobar"); + */ +(function(dom) { + dom.simulatePlaceholder = function(editor, view, placeholderText) { + var CLASS_NAME = "placeholder", + unset = function() { + if (view.hasPlaceholderSet()) { + view.clear(); + } + dom.removeClass(view.element, CLASS_NAME); + }, + set = function() { + if (view.isEmpty()) { + view.setValue(placeholderText); + dom.addClass(view.element, CLASS_NAME); + } + }; + + editor + .observe("set_placeholder", set) + .observe("unset_placeholder", unset) + .observe("focus:composer", unset) + .observe("paste:composer", unset) + .observe("blur:composer", set); + + set(); + }; +})(wysihtml5.dom); +(function(dom) { + var documentElement = document.documentElement; + if ("textContent" in documentElement) { + dom.setTextContent = function(element, text) { + element.textContent = text; + }; + + dom.getTextContent = function(element) { + return element.textContent; + }; + } else if ("innerText" in documentElement) { + dom.setTextContent = function(element, text) { + element.innerText = text; + }; + + dom.getTextContent = function(element) { + return element.innerText; + }; + } else { + dom.setTextContent = function(element, text) { + element.nodeValue = text; + }; + + dom.getTextContent = function(element) { + return element.nodeValue; + }; + } +})(wysihtml5.dom); + +/** + * Fix most common html formatting misbehaviors of browsers implementation when inserting + * content via copy & paste contentEditable + * + * @author Christopher Blum + */ +wysihtml5.quirks.cleanPastedHTML = (function() { + // TODO: We probably need more rules here + var defaultRules = { + // When pasting underlined links into a contentEditable, IE thinks, it has to insert to keep the styling + "a u": wysihtml5.dom.replaceWithChildNodes + }; + + function cleanPastedHTML(elementOrHtml, rules, context) { + rules = rules || defaultRules; + context = context || elementOrHtml.ownerDocument || document; + + var element, + isString = typeof(elementOrHtml) === "string", + method, + matches, + matchesLength, + i, + j = 0; + if (isString) { + element = wysihtml5.dom.getAsDom(elementOrHtml, context); + } else { + element = elementOrHtml; + } + + for (i in rules) { + matches = element.querySelectorAll(i); + method = rules[i]; + matchesLength = matches.length; + for (; j 

          " || + innerHTML == "

           

           

          ") { + element.innerHTML = ""; + } + }, 0); + }; + + return function(composer) { + dom.observe(composer.element, ["cut", "keydown"], clearIfNecessary); + }; + })(); + + + + /** + * In Opera when the caret is in the first and only item of a list (
          • |
          ) and the list is the first child of the contentEditable element, it's impossible to delete the list by hitting backspace + * + * @param {Object} contentEditableElement The contentEditable element to observe for clearing events + * @exaple + * wysihtml5.quirks.ensureProperClearing(myContentEditableElement); + */ + wysihtml5.quirks.ensureProperClearingOfLists = (function() { + var ELEMENTS_THAT_CONTAIN_LI = ["OL", "UL", "MENU"]; + + var clearIfNecessary = function(element, contentEditableElement) { + if (!contentEditableElement.firstChild || !wysihtml5.lang.array(ELEMENTS_THAT_CONTAIN_LI).contains(contentEditableElement.firstChild.nodeName)) { + return; + } + + var list = dom.getParentElement(element, { nodeName: ELEMENTS_THAT_CONTAIN_LI }); + if (!list) { + return; + } + + var listIsFirstChildOfContentEditable = list == contentEditableElement.firstChild; + if (!listIsFirstChildOfContentEditable) { + return; + } + + var hasOnlyOneListItem = list.childNodes.length <= 1; + if (!hasOnlyOneListItem) { + return; + } + + var onlyListItemIsEmpty = list.firstChild ? list.firstChild.innerHTML === "" : true; + if (!onlyListItemIsEmpty) { + return; + } + + list.parentNode.removeChild(list); + }; + + return function(composer) { + dom.observe(composer.element, "keydown", function(event) { + if (event.keyCode !== wysihtml5.BACKSPACE_KEY) { + return; + } + + var element = composer.selection.getSelectedNode(); + clearIfNecessary(element, composer.element); + }); + }; + })(); + +})(wysihtml5); +// See https://bugzilla.mozilla.org/show_bug.cgi?id=664398 +// +// In Firefox this: +// var d = document.createElement("div"); +// d.innerHTML ='
          '; +// d.innerHTML; +// will result in: +// +// which is wrong +(function(wysihtml5) { + var TILDE_ESCAPED = "%7E"; + wysihtml5.quirks.getCorrectInnerHTML = function(element) { + var innerHTML = element.innerHTML; + if (innerHTML.indexOf(TILDE_ESCAPED) === -1) { + return innerHTML; + } + + var elementsWithTilde = element.querySelectorAll("[href*='~'], [src*='~']"), + url, + urlToSearch, + length, + i; + for (i=0, length=elementsWithTilde.length; i on return + * - Chrome & Safari insert new
          on return + * - Firefox inserts
          on return (yippie!) + * + * @param {Element} element + * + * @example + * wysihtml5.quirks.insertLineBreakOnReturn(element); + */ +(function(wysihtml5) { + var dom = wysihtml5.dom, + USE_NATIVE_LINE_BREAK_WHEN_CARET_INSIDE_TAGS = ["LI", "P", "H1", "H2", "H3", "H4", "H5", "H6"], + LIST_TAGS = ["UL", "OL", "MENU"]; + + wysihtml5.quirks.insertLineBreakOnReturn = function(composer) { + function unwrap(selectedNode) { + var parentElement = dom.getParentElement(selectedNode, { nodeName: ["P", "DIV"] }, 2); + if (!parentElement) { + return; + } + + var invisibleSpace = document.createTextNode(wysihtml5.INVISIBLE_SPACE); + dom.insert(invisibleSpace).before(parentElement); + dom.replaceWithChildNodes(parentElement); + composer.selection.selectNode(invisibleSpace); + } + + function keyDown(event) { + var keyCode = event.keyCode; + if (event.shiftKey || (keyCode !== wysihtml5.ENTER_KEY && keyCode !== wysihtml5.BACKSPACE_KEY)) { + return; + } + + var element = event.target, + selectedNode = composer.selection.getSelectedNode(), + blockElement = dom.getParentElement(selectedNode, { nodeName: USE_NATIVE_LINE_BREAK_WHEN_CARET_INSIDE_TAGS }, 4); + if (blockElement) { + // Some browsers create

          elements after leaving a list + // check after keydown of backspace and return whether a

          got inserted and unwrap it + if (blockElement.nodeName === "LI" && (keyCode === wysihtml5.ENTER_KEY || keyCode === wysihtml5.BACKSPACE_KEY)) { + setTimeout(function() { + var selectedNode = composer.selection.getSelectedNode(), + list, + div; + if (!selectedNode) { + return; + } + + list = dom.getParentElement(selectedNode, { + nodeName: LIST_TAGS + }, 2); + + if (list) { + return; + } + + unwrap(selectedNode); + }, 0); + } else if (blockElement.nodeName.match(/H[1-6]/) && keyCode === wysihtml5.ENTER_KEY) { + setTimeout(function() { + unwrap(composer.selection.getSelectedNode()); + }, 0); + } + return; + } + + if (keyCode === wysihtml5.ENTER_KEY && !wysihtml5.browser.insertsLineBreaksOnReturn()) { + composer.commands.exec("insertLineBreak"); + event.preventDefault(); + } + } + + // keypress doesn't fire when you hit backspace + dom.observe(composer.element.ownerDocument, "keydown", keyDown); + }; +})(wysihtml5);/** + * Force rerendering of a given element + * Needed to fix display misbehaviors of IE + * + * @param {Element} element The element object which needs to be rerendered + * @example + * wysihtml5.quirks.redraw(document.body); + */ +(function(wysihtml5) { + var CLASS_NAME = "wysihtml5-quirks-redraw"; + + wysihtml5.quirks.redraw = function(element) { + wysihtml5.dom.addClass(element, CLASS_NAME); + wysihtml5.dom.removeClass(element, CLASS_NAME); + + // Following hack is needed for firefox to make sure that image resize handles are properly removed + try { + var doc = element.ownerDocument; + doc.execCommand("italic", false, null); + doc.execCommand("italic", false, null); + } catch(e) {} + }; +})(wysihtml5);/** + * Selection API + * + * @example + * var selection = new wysihtml5.Selection(editor); + */ +(function(wysihtml5) { + var dom = wysihtml5.dom; + + function _getCumulativeOffsetTop(element) { + var top = 0; + if (element.parentNode) { + do { + top += element.offsetTop || 0; + element = element.offsetParent; + } while (element); + } + return top; + } + + wysihtml5.Selection = Base.extend( + /** @scope wysihtml5.Selection.prototype */ { + constructor: function(editor) { + // Make sure that our external range library is initialized + window.rangy.init(); + + this.editor = editor; + this.composer = editor.composer; + this.doc = this.composer.doc; + }, + + /** + * Get the current selection as a bookmark to be able to later restore it + * + * @return {Object} An object that represents the current selection + */ + getBookmark: function() { + var range = this.getRange(); + return range && range.cloneRange(); + }, + + /** + * Restore a selection retrieved via wysihtml5.Selection.prototype.getBookmark + * + * @param {Object} bookmark An object that represents the current selection + */ + setBookmark: function(bookmark) { + if (!bookmark) { + return; + } + + this.setSelection(bookmark); + }, + + /** + * Set the caret in front of the given node + * + * @param {Object} node The element or text node where to position the caret in front of + * @example + * selection.setBefore(myElement); + */ + setBefore: function(node) { + var range = rangy.createRange(this.doc); + range.setStartBefore(node); + range.setEndBefore(node); + return this.setSelection(range); + }, + + /** + * Set the caret after the given node + * + * @param {Object} node The element or text node where to position the caret in front of + * @example + * selection.setBefore(myElement); + */ + setAfter: function(node) { + var range = rangy.createRange(this.doc); + range.setStartAfter(node); + range.setEndAfter(node); + return this.setSelection(range); + }, + + /** + * Ability to select/mark nodes + * + * @param {Element} node The node/element to select + * @example + * selection.selectNode(document.getElementById("my-image")); + */ + selectNode: function(node) { + var range = rangy.createRange(this.doc), + isElement = node.nodeType === wysihtml5.ELEMENT_NODE, + canHaveHTML = "canHaveHTML" in node ? node.canHaveHTML : (node.nodeName !== "IMG"), + content = isElement ? node.innerHTML : node.data, + isEmpty = (content === "" || content === wysihtml5.INVISIBLE_SPACE), + displayStyle = dom.getStyle("display").from(node), + isBlockElement = (displayStyle === "block" || displayStyle === "list-item"); + + if (isEmpty && isElement && canHaveHTML) { + // Make sure that caret is visible in node by inserting a zero width no breaking space + try { node.innerHTML = wysihtml5.INVISIBLE_SPACE; } catch(e) {} + } + + if (canHaveHTML) { + range.selectNodeContents(node); + } else { + range.selectNode(node); + } + + if (canHaveHTML && isEmpty && isElement) { + range.collapse(isBlockElement); + } else if (canHaveHTML && isEmpty) { + range.setStartAfter(node); + range.setEndAfter(node); + } + + this.setSelection(range); + }, + + /** + * Get the node which contains the selection + * + * @param {Boolean} [controlRange] (only IE) Whether it should return the selected ControlRange element when the selection type is a "ControlRange" + * @return {Object} The node that contains the caret + * @example + * var nodeThatContainsCaret = selection.getSelectedNode(); + */ + getSelectedNode: function(controlRange) { + var selection, + range; + + if (controlRange && this.doc.selection && this.doc.selection.type === "Control") { + range = this.doc.selection.createRange(); + if (range && range.length) { + return range.item(0); + } + } + + selection = this.getSelection(this.doc); + if (selection.focusNode === selection.anchorNode) { + return selection.focusNode; + } else { + range = this.getRange(this.doc); + return range ? range.commonAncestorContainer : this.doc.body; + } + }, + + executeAndRestore: function(method, restoreScrollPosition) { + var body = this.doc.body, + oldScrollTop = restoreScrollPosition && body.scrollTop, + oldScrollLeft = restoreScrollPosition && body.scrollLeft, + className = "_wysihtml5-temp-placeholder", + placeholderHTML = '' + wysihtml5.INVISIBLE_SPACE + '', + range = this.getRange(this.doc), + newRange; + + // Nothing selected, execute and say goodbye + if (!range) { + method(body, body); + return; + } + + var node = range.createContextualFragment(placeholderHTML); + range.insertNode(node); + + // Make sure that a potential error doesn't cause our placeholder element to be left as a placeholder + try { + method(range.startContainer, range.endContainer); + } catch(e3) { + setTimeout(function() { throw e3; }, 0); + } + + caretPlaceholder = this.doc.querySelector("." + className); + if (caretPlaceholder) { + newRange = rangy.createRange(this.doc); + newRange.selectNode(caretPlaceholder); + newRange.deleteContents(); + this.setSelection(newRange); + } else { + // fallback for when all hell breaks loose + body.focus(); + } + + if (restoreScrollPosition) { + body.scrollTop = oldScrollTop; + body.scrollLeft = oldScrollLeft; + } + + // Remove it again, just to make sure that the placeholder is definitely out of the dom tree + try { + caretPlaceholder.parentNode.removeChild(caretPlaceholder); + } catch(e4) {} + }, + + /** + * Different approach of preserving the selection (doesn't modify the dom) + * Takes all text nodes in the selection and saves the selection position in the first and last one + */ + executeAndRestoreSimple: function(method) { + var range = this.getRange(), + body = this.doc.body, + newRange, + firstNode, + lastNode, + textNodes, + rangeBackup; + + // Nothing selected, execute and say goodbye + if (!range) { + method(body, body); + return; + } + + textNodes = range.getNodes([3]); + firstNode = textNodes[0] || range.startContainer; + lastNode = textNodes[textNodes.length - 1] || range.endContainer; + + rangeBackup = { + collapsed: range.collapsed, + startContainer: firstNode, + startOffset: firstNode === range.startContainer ? range.startOffset : 0, + endContainer: lastNode, + endOffset: lastNode === range.endContainer ? range.endOffset : lastNode.length + }; + + try { + method(range.startContainer, range.endContainer); + } catch(e) { + setTimeout(function() { throw e; }, 0); + } + + newRange = rangy.createRange(this.doc); + try { newRange.setStart(rangeBackup.startContainer, rangeBackup.startOffset); } catch(e1) {} + try { newRange.setEnd(rangeBackup.endContainer, rangeBackup.endOffset); } catch(e2) {} + try { this.setSelection(newRange); } catch(e3) {} + }, + + /** + * Insert html at the caret position and move the cursor after the inserted html + * + * @param {String} html HTML string to insert + * @example + * selection.insertHTML("

          foobar

          "); + */ + insertHTML: function(html) { + var range = rangy.createRange(this.doc), + node = range.createContextualFragment(html), + lastChild = node.lastChild; + this.insertNode(node); + if (lastChild) { + this.setAfter(lastChild); + } + }, + + /** + * Insert a node at the caret position and move the cursor behind it + * + * @param {Object} node HTML string to insert + * @example + * selection.insertNode(document.createTextNode("foobar")); + */ + insertNode: function(node) { + var range = this.getRange(); + if (range) { + range.insertNode(node); + } + }, + + /** + * Wraps current selection with the given node + * + * @param {Object} node The node to surround the selected elements with + */ + surround: function(node) { + var range = this.getRange(); + if (!range) { + return; + } + + try { + // This only works when the range boundaries are not overlapping other elements + range.surroundContents(node); + this.selectNode(node); + } catch(e) { + // fallback + node.appendChild(range.extractContents()); + range.insertNode(node); + } + }, + + /** + * Scroll the current caret position into the view + * FIXME: This is a bit hacky, there might be a smarter way of doing this + * + * @example + * selection.scrollIntoView(); + */ + scrollIntoView: function() { + var doc = this.doc, + hasScrollBars = doc.documentElement.scrollHeight > doc.documentElement.offsetHeight, + tempElement = doc._wysihtml5ScrollIntoViewElement = doc._wysihtml5ScrollIntoViewElement || (function() { + var element = doc.createElement("span"); + // The element needs content in order to be able to calculate it's position properly + element.innerHTML = wysihtml5.INVISIBLE_SPACE; + return element; + })(), + offsetTop; + + if (hasScrollBars) { + this.insertNode(tempElement); + offsetTop = _getCumulativeOffsetTop(tempElement); + tempElement.parentNode.removeChild(tempElement); + if (offsetTop > doc.body.scrollTop) { + doc.body.scrollTop = offsetTop; + } + } + }, + + /** + * Select line where the caret is in + */ + selectLine: function() { + if (wysihtml5.browser.supportsSelectionModify()) { + this._selectLine_W3C(); + } else if (this.doc.selection) { + this._selectLine_MSIE(); + } + }, + + /** + * See https://developer.mozilla.org/en/DOM/Selection/modify + */ + _selectLine_W3C: function() { + var win = this.doc.defaultView, + selection = win.getSelection(); + selection.modify("extend", "left", "lineboundary"); + selection.modify("extend", "right", "lineboundary"); + }, + + _selectLine_MSIE: function() { + var range = this.doc.selection.createRange(), + rangeTop = range.boundingTop, + rangeHeight = range.boundingHeight, + scrollWidth = this.doc.body.scrollWidth, + rangeBottom, + rangeEnd, + measureNode, + i, + j; + + if (!range.moveToPoint) { + return; + } + + if (rangeTop === 0) { + // Don't know why, but when the selection ends at the end of a line + // range.boundingTop is 0 + measureNode = this.doc.createElement("span"); + this.insertNode(measureNode); + rangeTop = measureNode.offsetTop; + measureNode.parentNode.removeChild(measureNode); + } + + rangeTop += 1; + + for (i=-10; i=0; j--) { + try { + rangeEnd.moveToPoint(j, rangeBottom); + break; + } catch(e2) {} + } + + range.setEndPoint("EndToEnd", rangeEnd); + range.select(); + }, + + getText: function() { + var selection = this.getSelection(); + return selection ? selection.toString() : ""; + }, + + getNodes: function(nodeType, filter) { + var range = this.getRange(); + if (range) { + return range.getNodes([nodeType], filter); + } else { + return []; + } + }, + + getRange: function() { + var selection = this.getSelection(); + return selection && selection.rangeCount && selection.getRangeAt(0); + }, + + getSelection: function() { + return rangy.getSelection(this.doc.defaultView || this.doc.parentWindow); + }, + + setSelection: function(range) { + var win = this.doc.defaultView || this.doc.parentWindow, + selection = rangy.getSelection(win); + return selection.setSingleRange(range); + } + }); + +})(wysihtml5); +/** + * Inspired by the rangy CSS Applier module written by Tim Down and licensed under the MIT license. + * http://code.google.com/p/rangy/ + * + * changed in order to be able ... + * - to use custom tags + * - to detect and replace similar css classes via reg exp + */ +(function(wysihtml5, rangy) { + var defaultTagName = "span"; + + var REG_EXP_WHITE_SPACE = /\s+/g; + + function hasClass(el, cssClass, regExp) { + if (!el.className) { + return false; + } + + var matchingClassNames = el.className.match(regExp) || []; + return matchingClassNames[matchingClassNames.length - 1] === cssClass; + } + + function addClass(el, cssClass, regExp) { + if (el.className) { + removeClass(el, regExp); + el.className += " " + cssClass; + } else { + el.className = cssClass; + } + } + + function removeClass(el, regExp) { + if (el.className) { + el.className = el.className.replace(regExp, ""); + } + } + + function hasSameClasses(el1, el2) { + return el1.className.replace(REG_EXP_WHITE_SPACE, " ") == el2.className.replace(REG_EXP_WHITE_SPACE, " "); + } + + function replaceWithOwnChildren(el) { + var parent = el.parentNode; + while (el.firstChild) { + parent.insertBefore(el.firstChild, el); + } + parent.removeChild(el); + } + + function elementsHaveSameNonClassAttributes(el1, el2) { + if (el1.attributes.length != el2.attributes.length) { + return false; + } + for (var i = 0, len = el1.attributes.length, attr1, attr2, name; i < len; ++i) { + attr1 = el1.attributes[i]; + name = attr1.name; + if (name != "class") { + attr2 = el2.attributes.getNamedItem(name); + if (attr1.specified != attr2.specified) { + return false; + } + if (attr1.specified && attr1.nodeValue !== attr2.nodeValue) { + return false; + } + } + } + return true; + } + + function isSplitPoint(node, offset) { + if (rangy.dom.isCharacterDataNode(node)) { + if (offset == 0) { + return !!node.previousSibling; + } else if (offset == node.length) { + return !!node.nextSibling; + } else { + return true; + } + } + + return offset > 0 && offset < node.childNodes.length; + } + + function splitNodeAt(node, descendantNode, descendantOffset) { + var newNode; + if (rangy.dom.isCharacterDataNode(descendantNode)) { + if (descendantOffset == 0) { + descendantOffset = rangy.dom.getNodeIndex(descendantNode); + descendantNode = descendantNode.parentNode; + } else if (descendantOffset == descendantNode.length) { + descendantOffset = rangy.dom.getNodeIndex(descendantNode) + 1; + descendantNode = descendantNode.parentNode; + } else { + newNode = rangy.dom.splitDataNode(descendantNode, descendantOffset); + } + } + if (!newNode) { + newNode = descendantNode.cloneNode(false); + if (newNode.id) { + newNode.removeAttribute("id"); + } + var child; + while ((child = descendantNode.childNodes[descendantOffset])) { + newNode.appendChild(child); + } + rangy.dom.insertAfter(newNode, descendantNode); + } + return (descendantNode == node) ? newNode : splitNodeAt(node, newNode.parentNode, rangy.dom.getNodeIndex(newNode)); + } + + function Merge(firstNode) { + this.isElementMerge = (firstNode.nodeType == wysihtml5.ELEMENT_NODE); + this.firstTextNode = this.isElementMerge ? firstNode.lastChild : firstNode; + this.textNodes = [this.firstTextNode]; + } + + Merge.prototype = { + doMerge: function() { + var textBits = [], textNode, parent, text; + for (var i = 0, len = this.textNodes.length; i < len; ++i) { + textNode = this.textNodes[i]; + parent = textNode.parentNode; + textBits[i] = textNode.data; + if (i) { + parent.removeChild(textNode); + if (!parent.hasChildNodes()) { + parent.parentNode.removeChild(parent); + } + } + } + this.firstTextNode.data = text = textBits.join(""); + return text; + }, + + getLength: function() { + var i = this.textNodes.length, len = 0; + while (i--) { + len += this.textNodes[i].length; + } + return len; + }, + + toString: function() { + var textBits = []; + for (var i = 0, len = this.textNodes.length; i < len; ++i) { + textBits[i] = "'" + this.textNodes[i].data + "'"; + } + return "[Merge(" + textBits.join(",") + ")]"; + } + }; + + function HTMLApplier(tagNames, cssClass, similarClassRegExp, normalize) { + this.tagNames = tagNames || [defaultTagName]; + this.cssClass = cssClass || ""; + this.similarClassRegExp = similarClassRegExp; + this.normalize = normalize; + this.applyToAnyTagName = false; + } + + HTMLApplier.prototype = { + getAncestorWithClass: function(node) { + var cssClassMatch; + while (node) { + cssClassMatch = this.cssClass ? hasClass(node, this.cssClass, this.similarClassRegExp) : true; + if (node.nodeType == wysihtml5.ELEMENT_NODE && rangy.dom.arrayContains(this.tagNames, node.tagName.toLowerCase()) && cssClassMatch) { + return node; + } + node = node.parentNode; + } + return false; + }, + + // Normalizes nodes after applying a CSS class to a Range. + postApply: function(textNodes, range) { + var firstNode = textNodes[0], lastNode = textNodes[textNodes.length - 1]; + + var merges = [], currentMerge; + + var rangeStartNode = firstNode, rangeEndNode = lastNode; + var rangeStartOffset = 0, rangeEndOffset = lastNode.length; + + var textNode, precedingTextNode; + + for (var i = 0, len = textNodes.length; i < len; ++i) { + textNode = textNodes[i]; + precedingTextNode = this.getAdjacentMergeableTextNode(textNode.parentNode, false); + if (precedingTextNode) { + if (!currentMerge) { + currentMerge = new Merge(precedingTextNode); + merges.push(currentMerge); + } + currentMerge.textNodes.push(textNode); + if (textNode === firstNode) { + rangeStartNode = currentMerge.firstTextNode; + rangeStartOffset = rangeStartNode.length; + } + if (textNode === lastNode) { + rangeEndNode = currentMerge.firstTextNode; + rangeEndOffset = currentMerge.getLength(); + } + } else { + currentMerge = null; + } + } + + // Test whether the first node after the range needs merging + var nextTextNode = this.getAdjacentMergeableTextNode(lastNode.parentNode, true); + if (nextTextNode) { + if (!currentMerge) { + currentMerge = new Merge(lastNode); + merges.push(currentMerge); + } + currentMerge.textNodes.push(nextTextNode); + } + + // Do the merges + if (merges.length) { + for (i = 0, len = merges.length; i < len; ++i) { + merges[i].doMerge(); + } + // Set the range boundaries + range.setStart(rangeStartNode, rangeStartOffset); + range.setEnd(rangeEndNode, rangeEndOffset); + } + }, + + getAdjacentMergeableTextNode: function(node, forward) { + var isTextNode = (node.nodeType == wysihtml5.TEXT_NODE); + var el = isTextNode ? node.parentNode : node; + var adjacentNode; + var propName = forward ? "nextSibling" : "previousSibling"; + if (isTextNode) { + // Can merge if the node's previous/next sibling is a text node + adjacentNode = node[propName]; + if (adjacentNode && adjacentNode.nodeType == wysihtml5.TEXT_NODE) { + return adjacentNode; + } + } else { + // Compare element with its sibling + adjacentNode = el[propName]; + if (adjacentNode && this.areElementsMergeable(node, adjacentNode)) { + return adjacentNode[forward ? "firstChild" : "lastChild"]; + } + } + return null; + }, + + areElementsMergeable: function(el1, el2) { + return rangy.dom.arrayContains(this.tagNames, (el1.tagName || "").toLowerCase()) + && rangy.dom.arrayContains(this.tagNames, (el2.tagName || "").toLowerCase()) + && hasSameClasses(el1, el2) + && elementsHaveSameNonClassAttributes(el1, el2); + }, + + createContainer: function(doc) { + var el = doc.createElement(this.tagNames[0]); + if (this.cssClass) { + el.className = this.cssClass; + } + return el; + }, + + applyToTextNode: function(textNode) { + var parent = textNode.parentNode; + if (parent.childNodes.length == 1 && rangy.dom.arrayContains(this.tagNames, parent.tagName.toLowerCase())) { + if (this.cssClass) { + addClass(parent, this.cssClass, this.similarClassRegExp); + } + } else { + var el = this.createContainer(rangy.dom.getDocument(textNode)); + textNode.parentNode.insertBefore(el, textNode); + el.appendChild(textNode); + } + }, + + isRemovable: function(el) { + return rangy.dom.arrayContains(this.tagNames, el.tagName.toLowerCase()) && wysihtml5.lang.string(el.className).trim() == this.cssClass; + }, + + undoToTextNode: function(textNode, range, ancestorWithClass) { + if (!range.containsNode(ancestorWithClass)) { + // Split out the portion of the ancestor from which we can remove the CSS class + var ancestorRange = range.cloneRange(); + ancestorRange.selectNode(ancestorWithClass); + + if (ancestorRange.isPointInRange(range.endContainer, range.endOffset) && isSplitPoint(range.endContainer, range.endOffset)) { + splitNodeAt(ancestorWithClass, range.endContainer, range.endOffset); + range.setEndAfter(ancestorWithClass); + } + if (ancestorRange.isPointInRange(range.startContainer, range.startOffset) && isSplitPoint(range.startContainer, range.startOffset)) { + ancestorWithClass = splitNodeAt(ancestorWithClass, range.startContainer, range.startOffset); + } + } + + if (this.similarClassRegExp) { + removeClass(ancestorWithClass, this.similarClassRegExp); + } + if (this.isRemovable(ancestorWithClass)) { + replaceWithOwnChildren(ancestorWithClass); + } + }, + + applyToRange: function(range) { + var textNodes = range.getNodes([wysihtml5.TEXT_NODE]); + if (!textNodes.length) { + try { + var node = this.createContainer(range.endContainer.ownerDocument); + range.surroundContents(node); + this.selectNode(range, node); + return; + } catch(e) {} + } + + range.splitBoundaries(); + textNodes = range.getNodes([wysihtml5.TEXT_NODE]); + + if (textNodes.length) { + var textNode; + + for (var i = 0, len = textNodes.length; i < len; ++i) { + textNode = textNodes[i]; + if (!this.getAncestorWithClass(textNode)) { + this.applyToTextNode(textNode); + } + } + + range.setStart(textNodes[0], 0); + textNode = textNodes[textNodes.length - 1]; + range.setEnd(textNode, textNode.length); + + if (this.normalize) { + this.postApply(textNodes, range); + } + } + }, + + undoToRange: function(range) { + var textNodes = range.getNodes([wysihtml5.TEXT_NODE]), textNode, ancestorWithClass; + if (textNodes.length) { + range.splitBoundaries(); + textNodes = range.getNodes([wysihtml5.TEXT_NODE]); + } else { + var doc = range.endContainer.ownerDocument, + node = doc.createTextNode(wysihtml5.INVISIBLE_SPACE); + range.insertNode(node); + range.selectNode(node); + textNodes = [node]; + } + + for (var i = 0, len = textNodes.length; i < len; ++i) { + textNode = textNodes[i]; + ancestorWithClass = this.getAncestorWithClass(textNode); + if (ancestorWithClass) { + this.undoToTextNode(textNode, range, ancestorWithClass); + } + } + + if (len == 1) { + this.selectNode(range, textNodes[0]); + } else { + range.setStart(textNodes[0], 0); + textNode = textNodes[textNodes.length - 1]; + range.setEnd(textNode, textNode.length); + + if (this.normalize) { + this.postApply(textNodes, range); + } + } + }, + + selectNode: function(range, node) { + var isElement = node.nodeType === wysihtml5.ELEMENT_NODE, + canHaveHTML = "canHaveHTML" in node ? node.canHaveHTML : true, + content = isElement ? node.innerHTML : node.data, + isEmpty = (content === "" || content === wysihtml5.INVISIBLE_SPACE); + + if (isEmpty && isElement && canHaveHTML) { + // Make sure that caret is visible in node by inserting a zero width no breaking space + try { node.innerHTML = wysihtml5.INVISIBLE_SPACE; } catch(e) {} + } + range.selectNodeContents(node); + if (isEmpty && isElement) { + range.collapse(false); + } else if (isEmpty) { + range.setStartAfter(node); + range.setEndAfter(node); + } + }, + + getTextSelectedByRange: function(textNode, range) { + var textRange = range.cloneRange(); + textRange.selectNodeContents(textNode); + + var intersectionRange = textRange.intersection(range); + var text = intersectionRange ? intersectionRange.toString() : ""; + textRange.detach(); + + return text; + }, + + isAppliedToRange: function(range) { + var ancestors = [], + ancestor, + textNodes = range.getNodes([wysihtml5.TEXT_NODE]); + if (!textNodes.length) { + ancestor = this.getAncestorWithClass(range.startContainer); + return ancestor ? [ancestor] : false; + } + + for (var i = 0, len = textNodes.length, selectedText; i < len; ++i) { + selectedText = this.getTextSelectedByRange(textNodes[i], range); + ancestor = this.getAncestorWithClass(textNodes[i]); + if (selectedText != "" && !ancestor) { + return false; + } else { + ancestors.push(ancestor); + } + } + return ancestors; + }, + + toggleRange: function(range) { + if (this.isAppliedToRange(range)) { + this.undoToRange(range); + } else { + this.applyToRange(range); + } + } + }; + + wysihtml5.selection.HTMLApplier = HTMLApplier; + +})(wysihtml5, rangy);/** + * Rich Text Query/Formatting Commands + * + * @example + * var commands = new wysihtml5.Commands(editor); + */ +wysihtml5.Commands = Base.extend( + /** @scope wysihtml5.Commands.prototype */ { + constructor: function(editor) { + this.editor = editor; + this.composer = editor.composer; + this.doc = this.composer.doc; + }, + + /** + * Check whether the browser supports the given command + * + * @param {String} command The command string which to check (eg. "bold", "italic", "insertUnorderedList") + * @example + * commands.supports("createLink"); + */ + support: function(command) { + return wysihtml5.browser.supportsCommand(this.doc, command); + }, + + /** + * Check whether the browser supports the given command + * + * @param {String} command The command string which to execute (eg. "bold", "italic", "insertUnorderedList") + * @param {String} [value] The command value parameter, needed for some commands ("createLink", "insertImage", ...), optional for commands that don't require one ("bold", "underline", ...) + * @example + * commands.exec("insertImage", "http://a1.twimg.com/profile_images/113868655/schrei_twitter_reasonably_small.jpg"); + */ + exec: function(command, value) { + var obj = wysihtml5.commands[command], + args = wysihtml5.lang.array(arguments).get(), + method = obj && obj.exec, + result = null; + + this.editor.fire("beforecommand:composer"); + + if (method) { + args.unshift(this.composer); + result = method.apply(obj, args); + } else { + try { + // try/catch for buggy firefox + result = this.doc.execCommand(command, false, value); + } catch(e) {} + } + + this.editor.fire("aftercommand:composer"); + return result; + }, + + /** + * Check whether the current command is active + * If the caret is within a bold text, then calling this with command "bold" should return true + * + * @param {String} command The command string which to check (eg. "bold", "italic", "insertUnorderedList") + * @param {String} [commandValue] The command value parameter (eg. for "insertImage" the image src) + * @return {Boolean} Whether the command is active + * @example + * var isCurrentSelectionBold = commands.state("bold"); + */ + state: function(command, commandValue) { + var obj = wysihtml5.commands[command], + args = wysihtml5.lang.array(arguments).get(), + method = obj && obj.state; + if (method) { + args.unshift(this.composer); + return method.apply(obj, args); + } else { + try { + // try/catch for buggy firefox + return this.doc.queryCommandState(command); + } catch(e) { + return false; + } + } + }, + + /** + * Get the current command's value + * + * @param {String} command The command string which to check (eg. "formatBlock") + * @return {String} The command value + * @example + * var currentBlockElement = commands.value("formatBlock"); + */ + value: function(command) { + var obj = wysihtml5.commands[command], + method = obj && obj.value; + if (method) { + return method.call(obj, this.composer, command); + } else { + try { + // try/catch for buggy firefox + return this.doc.queryCommandValue(command); + } catch(e) { + return null; + } + } + } +}); +(function(wysihtml5) { + var undef; + + wysihtml5.commands.bold = { + exec: function(composer, command) { + return wysihtml5.commands.formatInline.exec(composer, command, "b"); + }, + + state: function(composer, command, color) { + // element.ownerDocument.queryCommandState("bold") results: + // firefox: only + // chrome: , ,

          ,

          , ... + // ie: , + // opera: , + return wysihtml5.commands.formatInline.state(composer, command, "b"); + }, + + value: function() { + return undef; + } + }; +})(wysihtml5); + +(function(wysihtml5) { + var undef, + NODE_NAME = "A", + dom = wysihtml5.dom; + + function _removeFormat(composer, anchors) { + var length = anchors.length, + i = 0, + anchor, + codeElement, + textContent; + for (; i contains url-like text content, rename it to to prevent re-autolinking + // else replace with its childNodes + if (textContent.match(dom.autoLink.URL_REG_EXP) && !codeElement) { + // element is used to prevent later auto-linking of the content + codeElement = dom.renameElement(anchor, "code"); + } else { + dom.replaceWithChildNodes(anchor); + } + } + } + + function _format(composer, attributes) { + var doc = composer.doc, + tempClass = "_wysihtml5-temp-" + (+new Date()), + tempClassRegExp = /non-matching-class/g, + i = 0, + length, + anchors, + anchor, + hasElementChild, + isEmpty, + elementToSetCaretAfter, + textContent, + whiteSpace, + j; + wysihtml5.commands.formatInline.exec(composer, undef, NODE_NAME, tempClass, tempClassRegExp); + anchors = doc.querySelectorAll(NODE_NAME + "." + tempClass); + length = anchors.length; + for (; i element + * The element is needed to avoid auto linking + * + * @example + * // either ... + * wysihtml5.commands.createLink.exec(composer, "createLink", "http://www.google.de"); + * // ... or ... + * wysihtml5.commands.createLink.exec(composer, "createLink", { href: "http://www.google.de", target: "_blank" }); + */ + exec: function(composer, command, value) { + var anchors = this.state(composer, command); + if (anchors) { + // Selection contains links + composer.selection.executeAndRestore(function() { + _removeFormat(composer, anchors); + }); + } else { + // Create links + value = typeof(value) === "object" ? value : { href: value }; + _format(composer, value); + } + }, + + state: function(composer, command) { + return wysihtml5.commands.formatInline.state(composer, command, "A"); + }, + + value: function() { + return undef; + } + }; +})(wysihtml5);/** + * document.execCommand("fontSize") will create either inline styles (firefox, chrome) or use font tags + * which we don't want + * Instead we set a css class + */ +(function(wysihtml5) { + var undef, + REG_EXP = /wysiwyg-font-size-[a-z\-]+/g; + + wysihtml5.commands.fontSize = { + exec: function(composer, command, size) { + return wysihtml5.commands.formatInline.exec(composer, command, "span", "wysiwyg-font-size-" + size, REG_EXP); + }, + + state: function(composer, command, size) { + return wysihtml5.commands.formatInline.state(composer, command, "span", "wysiwyg-font-size-" + size, REG_EXP); + }, + + value: function() { + return undef; + } + }; +})(wysihtml5); +/** + * document.execCommand("foreColor") will create either inline styles (firefox, chrome) or use font tags + * which we don't want + * Instead we set a css class + */ +(function(wysihtml5) { + var undef, + REG_EXP = /wysiwyg-color-[a-z]+/g; + + wysihtml5.commands.foreColor = { + exec: function(composer, command, color) { + return wysihtml5.commands.formatInline.exec(composer, command, "span", "wysiwyg-color-" + color, REG_EXP); + }, + + state: function(composer, command, color) { + return wysihtml5.commands.formatInline.state(composer, command, "span", "wysiwyg-color-" + color, REG_EXP); + }, + + value: function() { + return undef; + } + }; +})(wysihtml5);(function(wysihtml5) { + var undef, + dom = wysihtml5.dom, + DEFAULT_NODE_NAME = "DIV", + // Following elements are grouped + // when the caret is within a H1 and the H4 is invoked, the H1 should turn into H4 + // instead of creating a H4 within a H1 which would result in semantically invalid html + BLOCK_ELEMENTS_GROUP = ["H1", "H2", "H3", "H4", "H5", "H6", "P", "BLOCKQUOTE", DEFAULT_NODE_NAME]; + + /** + * Remove similiar classes (based on classRegExp) + * and add the desired class name + */ + function _addClass(element, className, classRegExp) { + if (element.className) { + _removeClass(element, classRegExp); + element.className += " " + className; + } else { + element.className = className; + } + } + + function _removeClass(element, classRegExp) { + element.className = element.className.replace(classRegExp, ""); + } + + /** + * Check whether given node is a text node and whether it's empty + */ + function _isBlankTextNode(node) { + return node.nodeType === wysihtml5.TEXT_NODE && !wysihtml5.lang.string(node.data).trim(); + } + + /** + * Returns previous sibling node that is not a blank text node + */ + function _getPreviousSiblingThatIsNotBlank(node) { + var previousSibling = node.previousSibling; + while (previousSibling && _isBlankTextNode(previousSibling)) { + previousSibling = previousSibling.previousSibling; + } + return previousSibling; + } + + /** + * Returns next sibling node that is not a blank text node + */ + function _getNextSiblingThatIsNotBlank(node) { + var nextSibling = node.nextSibling; + while (nextSibling && _isBlankTextNode(nextSibling)) { + nextSibling = nextSibling.nextSibling; + } + return nextSibling; + } + + /** + * Adds line breaks before and after the given node if the previous and next siblings + * aren't already causing a visual line break (block element or
          ) + */ + function _addLineBreakBeforeAndAfter(node) { + var doc = node.ownerDocument, + nextSibling = _getNextSiblingThatIsNotBlank(node), + previousSibling = _getPreviousSiblingThatIsNotBlank(node); + + if (nextSibling && !_isLineBreakOrBlockElement(nextSibling)) { + node.parentNode.insertBefore(doc.createElement("br"), nextSibling); + } + if (previousSibling && !_isLineBreakOrBlockElement(previousSibling)) { + node.parentNode.insertBefore(doc.createElement("br"), node); + } + } + + /** + * Removes line breaks before and after the given node + */ + function _removeLineBreakBeforeAndAfter(node) { + var nextSibling = _getNextSiblingThatIsNotBlank(node), + previousSibling = _getPreviousSiblingThatIsNotBlank(node); + + if (nextSibling && _isLineBreak(nextSibling)) { + nextSibling.parentNode.removeChild(nextSibling); + } + if (previousSibling && _isLineBreak(previousSibling)) { + previousSibling.parentNode.removeChild(previousSibling); + } + } + + function _removeLastChildIfLineBreak(node) { + var lastChild = node.lastChild; + if (lastChild && _isLineBreak(lastChild)) { + lastChild.parentNode.removeChild(lastChild); + } + } + + function _isLineBreak(node) { + + return node.nodeName === "BR"; + } + + /** + * Checks whether the elment causes a visual line break + * (
          or block elements) + */ + function _isLineBreakOrBlockElement(element) { + if (_isLineBreak(element)) { + return true; + } + + if (dom.getStyle("display").from(element) === "block") { + return true; + } + + return false; + } + + /** + * Execute native query command + * and if necessary modify the inserted node's className + */ + function _execCommand(doc, command, nodeName, className) { + if (className) { + var eventListener = dom.observe(doc, "DOMNodeInserted", function(event) { + var target = event.target, + displayStyle; + if (target.nodeType !== wysihtml5.ELEMENT_NODE) { + return; + } + displayStyle = dom.getStyle("display").from(target); + if (displayStyle.substr(0, 6) !== "inline") { + // Make sure that only block elements receive the given class + target.className += " " + className; + } + }); + } + doc.execCommand(command, false, nodeName); + if (eventListener) { + eventListener.stop(); + } + } + + function _selectLineAndWrap(composer, element) { + composer.selection.selectLine(); + composer.selection.surround(element); + _removeLineBreakBeforeAndAfter(element); + _removeLastChildIfLineBreak(element); + composer.selection.selectNode(element); + } + + function _hasClasses(element) { + return !!wysihtml5.lang.string(element.className).trim(); + } + + wysihtml5.commands.formatBlock = { + exec: function(composer, command, nodeName, className, classRegExp) { + var doc = composer.doc, + blockElement = this.state(composer, command, nodeName, className, classRegExp), + selectedNode; + + nodeName = typeof(nodeName) === "string" ? nodeName.toUpperCase() : nodeName; + + if (blockElement) { + composer.selection.executeAndRestoreSimple(function() { + if (classRegExp) { + _removeClass(blockElement, classRegExp); + } + var hasClasses = _hasClasses(blockElement); + if (!hasClasses && blockElement.nodeName === (nodeName || DEFAULT_NODE_NAME)) { + // Insert a line break afterwards and beforewards when there are siblings + // that are not of type line break or block element + _addLineBreakBeforeAndAfter(blockElement); + dom.replaceWithChildNodes(blockElement); + } else if (hasClasses) { + // Make sure that styling is kept by renaming the element to
          and copying over the class name + dom.renameElement(blockElement, DEFAULT_NODE_NAME); + } + }); + return; + } + + // Find similiar block element and rename it (

          =>

          ) + if (nodeName === null || wysihtml5.lang.array(BLOCK_ELEMENTS_GROUP).contains(nodeName)) { + selectedNode = composer.selection.getSelectedNode(); + blockElement = dom.getParentElement(selectedNode, { + nodeName: BLOCK_ELEMENTS_GROUP + }); + + if (blockElement) { + composer.selection.executeAndRestoreSimple(function() { + // Rename current block element to new block element and add class + if (nodeName) { + blockElement = dom.renameElement(blockElement, nodeName); + } + if (className) { + _addClass(blockElement, className, classRegExp); + } + }); + return; + } + } + + if (composer.commands.support(command)) { + _execCommand(doc, command, nodeName || DEFAULT_NODE_NAME, className); + return; + } + + blockElement = doc.createElement(nodeName || DEFAULT_NODE_NAME); + if (className) { + blockElement.className = className; + } + _selectLineAndWrap(composer, blockElement); + }, + + state: function(composer, command, nodeName, className, classRegExp) { + nodeName = typeof(nodeName) === "string" ? nodeName.toUpperCase() : nodeName; + var selectedNode = composer.selection.getSelectedNode(); + return dom.getParentElement(selectedNode, { + nodeName: nodeName, + className: className, + classRegExp: classRegExp + }); + }, + + value: function() { + return undef; + } + }; +})(wysihtml5);/** + * formatInline scenarios for tag "B" (| = caret, |foo| = selected text) + * + * #1 caret in unformatted text: + * abcdefg| + * output: + * abcdefg| + * + * #2 unformatted text selected: + * abc|deg|h + * output: + * abc|deg|h + * + * #3 unformatted text selected across boundaries: + * ab|c defg|h + * output: + * ab|c defg|h + * + * #4 formatted text entirely selected + * |abc| + * output: + * |abc| + * + * #5 formatted text partially selected + * ab|c| + * output: + * ab|c| + * + * #6 formatted text selected across boundaries + * ab|c de|fgh + * output: + * ab|c de|fgh + */ +(function(wysihtml5) { + var undef, + // Treat as and vice versa + ALIAS_MAPPING = { + "strong": "b", + "em": "i", + "b": "strong", + "i": "em" + }, + htmlApplier = {}; + + function _getTagNames(tagName) { + var alias = ALIAS_MAPPING[tagName]; + return alias ? [tagName.toLowerCase(), alias.toLowerCase()] : [tagName.toLowerCase()]; + } + + function _getApplier(tagName, className, classRegExp) { + var identifier = tagName + ":" + className; + if (!htmlApplier[identifier]) { + htmlApplier[identifier] = new wysihtml5.selection.HTMLApplier(_getTagNames(tagName), className, classRegExp, true); + } + return htmlApplier[identifier]; + } + + wysihtml5.commands.formatInline = { + exec: function(composer, command, tagName, className, classRegExp) { + var range = composer.selection.getRange(); + if (!range) { + return false; + } + _getApplier(tagName, className, classRegExp).toggleRange(range); + composer.selection.setSelection(range); + }, + + state: function(composer, command, tagName, className, classRegExp) { + var doc = composer.doc, + aliasTagName = ALIAS_MAPPING[tagName] || tagName, + range; + + // Check whether the document contains a node with the desired tagName + if (!wysihtml5.dom.hasElementWithTagName(doc, tagName) && + !wysihtml5.dom.hasElementWithTagName(doc, aliasTagName)) { + return false; + } + + // Check whether the document contains a node with the desired className + if (className && !wysihtml5.dom.hasElementWithClassName(doc, className)) { + return false; + } + + range = composer.selection.getRange(); + if (!range) { + return false; + } + + return _getApplier(tagName, className, classRegExp).isAppliedToRange(range); + }, + + value: function() { + return undef; + } + }; +})(wysihtml5);(function(wysihtml5) { + var undef; + + wysihtml5.commands.insertHTML = { + exec: function(composer, command, html) { + if (composer.commands.support(command)) { + composer.doc.execCommand(command, false, html); + } else { + composer.selection.insertHTML(html); + } + }, + + state: function() { + return false; + }, + + value: function() { + return undef; + } + }; +})(wysihtml5);(function(wysihtml5) { + var NODE_NAME = "IMG"; + + wysihtml5.commands.insertImage = { + /** + * Inserts an + * If selection is already an image link, it removes it + * + * @example + * // either ... + * wysihtml5.commands.insertImage.exec(composer, "insertImage", "http://www.google.de/logo.jpg"); + * // ... or ... + * wysihtml5.commands.insertImage.exec(composer, "insertImage", { src: "http://www.google.de/logo.jpg", title: "foo" }); + */ + exec: function(composer, command, value) { + value = typeof(value) === "object" ? value : { src: value }; + + var doc = composer.doc, + image = this.state(composer), + textNode, + i, + parent; + + if (image) { + // Image already selected, set the caret before it and delete it + composer.selection.setBefore(image); + parent = image.parentNode; + parent.removeChild(image); + + // and it's parent
          too if it hasn't got any other relevant child nodes + wysihtml5.dom.removeEmptyTextNodes(parent); + if (parent.nodeName === "A" && !parent.firstChild) { + composer.selection.setAfter(parent); + parent.parentNode.removeChild(parent); + } + + // firefox and ie sometimes don't remove the image handles, even though the image got removed + wysihtml5.quirks.redraw(composer.element); + return; + } + + image = doc.createElement(NODE_NAME); + + for (i in value) { + image[i] = value[i]; + } + + composer.selection.insertNode(image); + if (wysihtml5.browser.hasProblemsSettingCaretAfterImg()) { + textNode = doc.createTextNode(wysihtml5.INVISIBLE_SPACE); + composer.selection.insertNode(textNode); + composer.selection.setAfter(textNode); + } else { + composer.selection.setAfter(image); + } + }, + + state: function(composer) { + var doc = composer.doc, + selectedNode, + text, + imagesInSelection; + + if (!wysihtml5.dom.hasElementWithTagName(doc, NODE_NAME)) { + return false; + } + + selectedNode = composer.selection.getSelectedNode(); + if (!selectedNode) { + return false; + } + + if (selectedNode.nodeName === NODE_NAME) { + // This works perfectly in IE + return selectedNode; + } + + if (selectedNode.nodeType !== wysihtml5.ELEMENT_NODE) { + return false; + } + + text = composer.selection.getText(); + text = wysihtml5.lang.string(text).trim(); + if (text) { + return false; + } + + imagesInSelection = composer.selection.getNodes(wysihtml5.ELEMENT_NODE, function(node) { + return node.nodeName === "IMG"; + }); + + if (imagesInSelection.length !== 1) { + return false; + } + + return imagesInSelection[0]; + }, + + value: function(composer) { + var image = this.state(composer); + return image && image.src; + } + }; +})(wysihtml5);(function(wysihtml5) { + var undef, + LINE_BREAK = "
          " + (wysihtml5.browser.needsSpaceAfterLineBreak() ? " " : ""); + + wysihtml5.commands.insertLineBreak = { + exec: function(composer, command) { + if (composer.commands.support(command)) { + composer.doc.execCommand(command, false, null); + if (!wysihtml5.browser.autoScrollsToCaret()) { + composer.selection.scrollIntoView(); + } + } else { + composer.commands.exec("insertHTML", LINE_BREAK); + } + }, + + state: function() { + return false; + }, + + value: function() { + return undef; + } + }; +})(wysihtml5);(function(wysihtml5) { + var undef; + + wysihtml5.commands.insertOrderedList = { + exec: function(composer, command) { + var doc = composer.doc, + selectedNode = composer.selection.getSelectedNode(), + list = wysihtml5.dom.getParentElement(selectedNode, { nodeName: "OL" }), + otherList = wysihtml5.dom.getParentElement(selectedNode, { nodeName: "UL" }), + tempClassName = "_wysihtml5-temp-" + new Date().getTime(), + isEmpty, + tempElement; + + if (composer.commands.support(command)) { + doc.execCommand(command, false, null); + return; + } + + if (list) { + // Unwrap list + //
          1. foo
          2. bar
          + // becomes: + // foo
          bar
          + composer.selection.executeAndRestoreSimple(function() { + wysihtml5.dom.resolveList(list); + }); + } else if (otherList) { + // Turn an unordered list into an ordered list + //
          • foo
          • bar
          + // becomes: + //
          1. foo
          2. bar
          + composer.selection.executeAndRestoreSimple(function() { + wysihtml5.dom.renameElement(otherList, "ol"); + }); + } else { + // Create list + composer.commands.exec("formatBlock", "div", tempClassName); + tempElement = doc.querySelector("." + tempClassName); + isEmpty = tempElement.innerHTML === "" || tempElement.innerHTML === wysihtml5.INVISIBLE_SPACE; + composer.selection.executeAndRestoreSimple(function() { + list = wysihtml5.dom.convertToList(tempElement, "ol"); + }); + if (isEmpty) { + composer.selection.selectNode(list.querySelector("li")); + } + } + }, + + state: function(composer) { + var selectedNode = composer.selection.getSelectedNode(); + return wysihtml5.dom.getParentElement(selectedNode, { nodeName: "OL" }); + }, + + value: function() { + return undef; + } + }; +})(wysihtml5);(function(wysihtml5) { + var undef; + + wysihtml5.commands.insertUnorderedList = { + exec: function(composer, command) { + var doc = composer.doc, + selectedNode = composer.selection.getSelectedNode(), + list = wysihtml5.dom.getParentElement(selectedNode, { nodeName: "UL" }), + otherList = wysihtml5.dom.getParentElement(selectedNode, { nodeName: "OL" }), + tempClassName = "_wysihtml5-temp-" + new Date().getTime(), + isEmpty, + tempElement; + + if (composer.commands.support(command)) { + doc.execCommand(command, false, null); + return; + } + + if (list) { + // Unwrap list + //
          • foo
          • bar
          + // becomes: + // foo
          bar
          + composer.selection.executeAndRestoreSimple(function() { + wysihtml5.dom.resolveList(list); + }); + } else if (otherList) { + // Turn an ordered list into an unordered list + //
          1. foo
          2. bar
          + // becomes: + //
          • foo
          • bar
          + composer.selection.executeAndRestoreSimple(function() { + wysihtml5.dom.renameElement(otherList, "ul"); + }); + } else { + // Create list + composer.commands.exec("formatBlock", "div", tempClassName); + tempElement = doc.querySelector("." + tempClassName); + isEmpty = tempElement.innerHTML === "" || tempElement.innerHTML === wysihtml5.INVISIBLE_SPACE; + composer.selection.executeAndRestoreSimple(function() { + list = wysihtml5.dom.convertToList(tempElement, "ul"); + }); + if (isEmpty) { + composer.selection.selectNode(list.querySelector("li")); + } + } + }, + + state: function(composer) { + var selectedNode = composer.selection.getSelectedNode(); + return wysihtml5.dom.getParentElement(selectedNode, { nodeName: "UL" }); + }, + + value: function() { + return undef; + } + }; +})(wysihtml5);(function(wysihtml5) { + var undef; + + wysihtml5.commands.italic = { + exec: function(composer, command) { + return wysihtml5.commands.formatInline.exec(composer, command, "i"); + }, + + state: function(composer, command, color) { + // element.ownerDocument.queryCommandState("italic") results: + // firefox: only + // chrome: , ,
          , ... + // ie: , + // opera: only + return wysihtml5.commands.formatInline.state(composer, command, "i"); + }, + + value: function() { + return undef; + } + }; +})(wysihtml5);(function(wysihtml5) { + var undef, + CLASS_NAME = "wysiwyg-text-align-center", + REG_EXP = /wysiwyg-text-align-[a-z]+/g; + + wysihtml5.commands.justifyCenter = { + exec: function(composer, command) { + return wysihtml5.commands.formatBlock.exec(composer, "formatBlock", null, CLASS_NAME, REG_EXP); + }, + + state: function(composer, command) { + return wysihtml5.commands.formatBlock.state(composer, "formatBlock", null, CLASS_NAME, REG_EXP); + }, + + value: function() { + return undef; + } + }; +})(wysihtml5);(function(wysihtml5) { + var undef, + CLASS_NAME = "wysiwyg-text-align-left", + REG_EXP = /wysiwyg-text-align-[a-z]+/g; + + wysihtml5.commands.justifyLeft = { + exec: function(composer, command) { + return wysihtml5.commands.formatBlock.exec(composer, "formatBlock", null, CLASS_NAME, REG_EXP); + }, + + state: function(composer, command) { + return wysihtml5.commands.formatBlock.state(composer, "formatBlock", null, CLASS_NAME, REG_EXP); + }, + + value: function() { + return undef; + } + }; +})(wysihtml5);(function(wysihtml5) { + var undef, + CLASS_NAME = "wysiwyg-text-align-right", + REG_EXP = /wysiwyg-text-align-[a-z]+/g; + + wysihtml5.commands.justifyRight = { + exec: function(composer, command) { + return wysihtml5.commands.formatBlock.exec(composer, "formatBlock", null, CLASS_NAME, REG_EXP); + }, + + state: function(composer, command) { + return wysihtml5.commands.formatBlock.state(composer, "formatBlock", null, CLASS_NAME, REG_EXP); + }, + + value: function() { + return undef; + } + }; +})(wysihtml5);(function(wysihtml5) { + var undef; + wysihtml5.commands.underline = { + exec: function(composer, command) { + return wysihtml5.commands.formatInline.exec(composer, command, "u"); + }, + + state: function(composer, command) { + return wysihtml5.commands.formatInline.state(composer, command, "u"); + }, + + value: function() { + return undef; + } + }; +})(wysihtml5);/** + * Undo Manager for wysihtml5 + * slightly inspired by http://rniwa.com/editing/undomanager.html#the-undomanager-interface + */ +(function(wysihtml5) { + var Z_KEY = 90, + Y_KEY = 89, + BACKSPACE_KEY = 8, + DELETE_KEY = 46, + MAX_HISTORY_ENTRIES = 40, + UNDO_HTML = '' + wysihtml5.INVISIBLE_SPACE + '', + REDO_HTML = '' + wysihtml5.INVISIBLE_SPACE + '', + dom = wysihtml5.dom; + + function cleanTempElements(doc) { + var tempElement; + while (tempElement = doc.querySelector("._wysihtml5-temp")) { + tempElement.parentNode.removeChild(tempElement); + } + } + + wysihtml5.UndoManager = wysihtml5.lang.Dispatcher.extend( + /** @scope wysihtml5.UndoManager.prototype */ { + constructor: function(editor) { + this.editor = editor; + this.composer = editor.composer; + this.element = this.composer.element; + this.history = [this.composer.getValue()]; + this.position = 1; + + // Undo manager currently only supported in browsers who have the insertHTML command (not IE) + if (this.composer.commands.support("insertHTML")) { + this._observe(); + } + }, + + _observe: function() { + var that = this, + doc = this.composer.sandbox.getDocument(), + lastKey; + + // Catch CTRL+Z and CTRL+Y + dom.observe(this.element, "keydown", function(event) { + if (event.altKey || (!event.ctrlKey && !event.metaKey)) { + return; + } + + var keyCode = event.keyCode, + isUndo = keyCode === Z_KEY && !event.shiftKey, + isRedo = (keyCode === Z_KEY && event.shiftKey) || (keyCode === Y_KEY); + + if (isUndo) { + that.undo(); + event.preventDefault(); + } else if (isRedo) { + that.redo(); + event.preventDefault(); + } + }); + + // Catch delete and backspace + dom.observe(this.element, "keydown", function(event) { + var keyCode = event.keyCode; + if (keyCode === lastKey) { + return; + } + + lastKey = keyCode; + + if (keyCode === BACKSPACE_KEY || keyCode === DELETE_KEY) { + that.transact(); + } + }); + + // Now this is very hacky: + // These days browsers don't offer a undo/redo event which we could hook into + // to be notified when the user hits undo/redo in the contextmenu. + // Therefore we simply insert two elements as soon as the contextmenu gets opened. + // The last element being inserted will be immediately be removed again by a exexCommand("undo") + // => When the second element appears in the dom tree then we know the user clicked "redo" in the context menu + // => When the first element disappears from the dom tree then we know the user clicked "undo" in the context menu + if (wysihtml5.browser.hasUndoInContextMenu()) { + var interval, observed, cleanUp = function() { + cleanTempElements(doc); + clearInterval(interval); + }; + + dom.observe(this.element, "contextmenu", function() { + cleanUp(); + that.composer.selection.executeAndRestoreSimple(function() { + if (that.element.lastChild) { + that.composer.selection.setAfter(that.element.lastChild); + } + + // enable undo button in context menu + doc.execCommand("insertHTML", false, UNDO_HTML); + // enable redo button in context menu + doc.execCommand("insertHTML", false, REDO_HTML); + doc.execCommand("undo", false, null); + }); + + interval = setInterval(function() { + if (doc.getElementById("_wysihtml5-redo")) { + cleanUp(); + that.redo(); + } else if (!doc.getElementById("_wysihtml5-undo")) { + cleanUp(); + that.undo(); + } + }, 400); + + if (!observed) { + observed = true; + dom.observe(document, "mousedown", cleanUp); + dom.observe(doc, ["mousedown", "paste", "cut", "copy"], cleanUp); + } + }); + } + + this.editor + .observe("newword:composer", function() { + that.transact(); + }) + + .observe("beforecommand:composer", function() { + that.transact(); + }); + }, + + transact: function() { + var previousHtml = this.history[this.position - 1], + currentHtml = this.composer.getValue(); + + if (currentHtml == previousHtml) { + return; + } + + var length = this.history.length = this.position; + if (length > MAX_HISTORY_ENTRIES) { + this.history.shift(); + this.position--; + } + + this.position++; + this.history.push(currentHtml); + }, + + undo: function() { + this.transact(); + + if (this.position <= 1) { + return; + } + + this.set(this.history[--this.position - 1]); + this.editor.fire("undo:composer"); + }, + + redo: function() { + if (this.position >= this.history.length) { + return; + } + + this.set(this.history[++this.position - 1]); + this.editor.fire("redo:composer"); + }, + + set: function(html) { + this.composer.setValue(html); + this.editor.focus(true); + } + }); +})(wysihtml5); +/** + * TODO: the following methods still need unit test coverage + */ +wysihtml5.views.View = Base.extend( + /** @scope wysihtml5.views.View.prototype */ { + constructor: function(parent, textareaElement, config) { + this.parent = parent; + this.element = textareaElement; + this.config = config; + + this._observeViewChange(); + }, + + _observeViewChange: function() { + var that = this; + this.parent.observe("beforeload", function() { + that.parent.observe("change_view", function(view) { + if (view === that.name) { + that.parent.currentView = that; + that.show(); + // Using tiny delay here to make sure that the placeholder is set before focusing + setTimeout(function() { that.focus(); }, 0); + } else { + that.hide(); + } + }); + }); + }, + + focus: function() { + if (this.element.ownerDocument.querySelector(":focus") === this.element) { + return; + } + + try { this.element.focus(); } catch(e) {} + }, + + hide: function() { + this.element.style.display = "none"; + }, + + show: function() { + this.element.style.display = ""; + }, + + disable: function() { + this.element.setAttribute("disabled", "disabled"); + }, + + enable: function() { + this.element.removeAttribute("disabled"); + } +});(function(wysihtml5) { + var dom = wysihtml5.dom, + browser = wysihtml5.browser; + + wysihtml5.views.Composer = wysihtml5.views.View.extend( + /** @scope wysihtml5.views.Composer.prototype */ { + name: "composer", + + // Needed for firefox in order to display a proper caret in an empty contentEditable + CARET_HACK: "
          ", + + constructor: function(parent, textareaElement, config) { + this.base(parent, textareaElement, config); + this.textarea = this.parent.textarea; + this._initSandbox(); + }, + + clear: function() { + this.element.innerHTML = browser.displaysCaretInEmptyContentEditableCorrectly() ? "" : this.CARET_HACK; + }, + + getValue: function(parse) { + var value = this.isEmpty() ? "" : wysihtml5.quirks.getCorrectInnerHTML(this.element); + + if (parse) { + value = this.parent.parse(value); + } + + // Replace all "zero width no breaking space" chars + // which are used as hacks to enable some functionalities + // Also remove all CARET hacks that somehow got left + value = wysihtml5.lang.string(value).replace(wysihtml5.INVISIBLE_SPACE).by(""); + + return value; + }, + + setValue: function(html, parse) { + if (parse) { + html = this.parent.parse(html); + } + this.element.innerHTML = html; + }, + + show: function() { + this.iframe.style.display = this._displayStyle || ""; + + // Firefox needs this, otherwise contentEditable becomes uneditable + this.disable(); + this.enable(); + }, + + hide: function() { + this._displayStyle = dom.getStyle("display").from(this.iframe); + if (this._displayStyle === "none") { + this._displayStyle = null; + } + this.iframe.style.display = "none"; + }, + + disable: function() { + this.element.removeAttribute("contentEditable"); + this.base(); + }, + + enable: function() { + this.element.setAttribute("contentEditable", "true"); + this.base(); + }, + + focus: function(setToEnd) { + // IE 8 fires the focus event after .focus() + // This is needed by our simulate_placeholder.js to work + // therefore we clear it ourselves this time + if (wysihtml5.browser.doesAsyncFocus() && this.hasPlaceholderSet()) { + this.clear(); + } + + this.base(); + + var lastChild = this.element.lastChild; + if (setToEnd && lastChild) { + if (lastChild.nodeName === "BR") { + this.selection.setBefore(this.element.lastChild); + } else { + this.selection.setAfter(this.element.lastChild); + } + } + }, + + getTextContent: function() { + return dom.getTextContent(this.element); + }, + + hasPlaceholderSet: function() { + return this.getTextContent() == this.textarea.element.getAttribute("placeholder"); + }, + + isEmpty: function() { + var innerHTML = this.element.innerHTML, + elementsWithVisualValue = "blockquote, ul, ol, img, embed, object, table, iframe, svg, video, audio, button, input, select, textarea"; + return innerHTML === "" || + innerHTML === this.CARET_HACK || + + this.hasPlaceholderSet() || + (this.getTextContent() === "" && !this.element.querySelector(elementsWithVisualValue)); + }, + + _initSandbox: function() { + var that = this; + + this.sandbox = new dom.Sandbox(function() { + that._create(); + }, { + stylesheets: this.config.stylesheets + }); + this.iframe = this.sandbox.getIframe(); + + // Create hidden field which tells the server after submit, that the user used an wysiwyg editor + var hiddenField = document.createElement("input"); + hiddenField.type = "hidden"; + hiddenField.name = "_wysihtml5_mode"; + hiddenField.value = 1; + + // Store reference to current wysihtml5 instance on the textarea element + var textareaElement = this.textarea.element; + dom.insert(this.iframe).after(textareaElement); + dom.insert(hiddenField).after(textareaElement); + }, + + _create: function() { + var that = this; + + this.doc = this.sandbox.getDocument(); + this.element = this.doc.body; + this.textarea = this.parent.textarea; + this.element.innerHTML = this.textarea.getValue(true); + this.enable(); + + // Make sure our selection handler is ready + this.selection = new wysihtml5.Selection(this.parent); + + // Make sure commands dispatcher is ready + this.commands = new wysihtml5.Commands(this.parent); + + dom.copyAttributes([ + "className", "spellcheck", "title", "lang", "dir", "accessKey" + ]).from(this.textarea.element).to(this.element); + + dom.addClass(this.element, this.config.composerClassName); + + // Make the editor look like the original textarea, by syncing styles + if (this.config.style) { + this.style(); + } + + this.observe(); + + var name = this.config.name; + if (name) { + dom.addClass(this.element, name); + dom.addClass(this.iframe, name); + } + + // Simulate html5 placeholder attribute on contentEditable element + var placeholderText = typeof(this.config.placeholder) === "string" + ? this.config.placeholder + : this.textarea.element.getAttribute("placeholder"); + if (placeholderText) { + dom.simulatePlaceholder(this.parent, this, placeholderText); + } + + // Make sure that the browser avoids using inline styles whenever possible + this.commands.exec("styleWithCSS", false); + + this._initAutoLinking(); + this._initObjectResizing(); + this._initUndoManager(); + + // Simulate html5 autofocus on contentEditable element + if (this.textarea.element.hasAttribute("autofocus") || document.querySelector(":focus") == this.textarea.element) { + setTimeout(function() { that.focus(); }, 100); + } + + wysihtml5.quirks.insertLineBreakOnReturn(this); + + // IE sometimes leaves a single paragraph, which can't be removed by the user + if (!browser.clearsContentEditableCorrectly()) { + wysihtml5.quirks.ensureProperClearing(this); + } + + if (!browser.clearsListsInContentEditableCorrectly()) { + wysihtml5.quirks.ensureProperClearingOfLists(this); + } + + // Set up a sync that makes sure that textarea and editor have the same content + if (this.initSync && this.config.sync) { + this.initSync(); + } + + // Okay hide the textarea, we are ready to go + this.textarea.hide(); + + // Fire global (before-)load event + this.parent.fire("beforeload").fire("load"); + }, + + _initAutoLinking: function() { + var that = this, + supportsDisablingOfAutoLinking = browser.canDisableAutoLinking(), + supportsAutoLinking = browser.doesAutoLinkingInContentEditable(); + if (supportsDisablingOfAutoLinking) { + this.commands.exec("autoUrlDetect", false); + } + + if (!this.config.autoLink) { + return; + } + + // Only do the auto linking by ourselves when the browser doesn't support auto linking + // OR when he supports auto linking but we were able to turn it off (IE9+) + if (!supportsAutoLinking || (supportsAutoLinking && supportsDisablingOfAutoLinking)) { + this.parent.observe("newword:composer", function() { + that.selection.executeAndRestore(function(startContainer, endContainer) { + dom.autoLink(endContainer.parentNode); + }); + }); + } + + // Assuming we have the following: + //
          http://www.google.de + // If a user now changes the url in the innerHTML we want to make sure that + // it's synchronized with the href attribute (as long as the innerHTML is still a url) + var // Use a live NodeList to check whether there are any links in the document + links = this.sandbox.getDocument().getElementsByTagName("a"), + // The autoLink helper method reveals a reg exp to detect correct urls + urlRegExp = dom.autoLink.URL_REG_EXP, + getTextContent = function(element) { + var textContent = wysihtml5.lang.string(dom.getTextContent(element)).trim(); + if (textContent.substr(0, 4) === "www.") { + textContent = "http://" + textContent; + } + return textContent; + }; + + dom.observe(this.element, "keydown", function(event) { + if (!links.length) { + return; + } + + var selectedNode = that.selection.getSelectedNode(event.target.ownerDocument), + link = dom.getParentElement(selectedNode, { nodeName: "A" }, 4), + textContent; + + if (!link) { + return; + } + + textContent = getTextContent(link); + // keydown is fired before the actual content is changed + // therefore we set a timeout to change the href + setTimeout(function() { + var newTextContent = getTextContent(link); + if (newTextContent === textContent) { + return; + } + + // Only set href when new href looks like a valid url + if (newTextContent.match(urlRegExp)) { + link.setAttribute("href", newTextContent); + } + }, 0); + }); + }, + + _initObjectResizing: function() { + var properties = ["width", "height"], + propertiesLength = properties.length, + element = this.element; + + this.commands.exec("enableObjectResizing", this.config.allowObjectResizing); + + if (this.config.allowObjectResizing) { + // IE sets inline styles after resizing objects + // The following lines make sure that the width/height css properties + // are copied over to the width/height attributes + if (browser.supportsEvent("resizeend")) { + dom.observe(element, "resizeend", function(event) { + var target = event.target || event.srcElement, + style = target.style, + i = 0, + property; + for(; i