diff --git a/src/main/java/cn/hellohao/auth/filter/OriginFilter.java b/src/main/java/cn/hellohao/auth/filter/OriginFilter.java index ed7a99e..cdc7bf7 100644 --- a/src/main/java/cn/hellohao/auth/filter/OriginFilter.java +++ b/src/main/java/cn/hellohao/auth/filter/OriginFilter.java @@ -29,7 +29,6 @@ public class OriginFilter { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration corsConfiguration = new CorsConfiguration(); corsConfiguration.setAllowCredentials(true); -// corsConfiguration.setAllowedOriginPatterns(Collections.singletonList(allowedOrigins.replace(" ", ""))); corsConfiguration.setAllowedOriginPatterns(Collections.singletonList(CorsConfiguration.ALL)); corsConfiguration.setAllowedHeaders(Collections.singletonList(CorsConfiguration.ALL)); corsConfiguration.setAllowedMethods(Collections.singletonList(CorsConfiguration.ALL)); @@ -42,28 +41,3 @@ public class OriginFilter { } - - -//@Configuration -//public class OriginFilter implements WebMvcConfigurer { -// -// @Value("${CROS_ALLOWED_ORIGINS}") -// private String allowedOrigins; -// -// @Override -// public void addCorsMappings(CorsRegistry registry) { -// // 允许跨域访问的路径 -// registry.addMapping("/**") -// // 允许跨域访问的源 -// .allowedOrigins("http://服务器Ip:9528","http://服务器Ip:9001") -// // 允许请求方法 -// .allowedMethods("POST", "GET", "PUT", "OPTIONS", "DELETE") -// // 预检间隔时间 -// .maxAge(168000) -// // 允许头部设置 -// .allowedHeaders("*") -// // 是否发送cookie -// .allowCredentials(true); -// } -// -//} \ No newline at end of file diff --git a/src/main/java/cn/hellohao/auth/shiro/ShiroConfig.java b/src/main/java/cn/hellohao/auth/shiro/ShiroConfig.java index eaa8de8..69ce6a2 100644 --- a/src/main/java/cn/hellohao/auth/shiro/ShiroConfig.java +++ b/src/main/java/cn/hellohao/auth/shiro/ShiroConfig.java @@ -43,17 +43,14 @@ public class ShiroConfig { } - //安全对象 @Bean public DefaultWebSecurityManager defaultWebSecurityManager(@Qualifier("userRealm") UserRealm userRealm){ DefaultWebSecurityManager defaultWebSecurityManager = new DefaultWebSecurityManager(); - //关联UserRealm defaultWebSecurityManager.setRealm(userRealm); defaultWebSecurityManager.setRememberMeManager(null); return defaultWebSecurityManager; } - //创建 realm 对象 @Bean(name = "userRealm") public UserRealm userRealm(){ return new UserRealm(); diff --git a/src/main/java/cn/hellohao/auth/shiro/UserRealm.java b/src/main/java/cn/hellohao/auth/shiro/UserRealm.java index c7e1874..5bfb3e4 100644 --- a/src/main/java/cn/hellohao/auth/shiro/UserRealm.java +++ b/src/main/java/cn/hellohao/auth/shiro/UserRealm.java @@ -25,7 +25,6 @@ public class UserRealm extends AuthorizingRealm { @Autowired private UserService userService; - //授权 @Override protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principalCollection) { SimpleAuthorizationInfo info = new SimpleAuthorizationInfo(); diff --git a/src/main/java/cn/hellohao/auth/token/JWTUtil.java b/src/main/java/cn/hellohao/auth/token/JWTUtil.java index e49dc07..7c6b254 100644 --- a/src/main/java/cn/hellohao/auth/token/JWTUtil.java +++ b/src/main/java/cn/hellohao/auth/token/JWTUtil.java @@ -22,9 +22,7 @@ public class JWTUtil { private static String EXPIRE_TIME = ""; private static String SECRET = "www.hellohao.cn"; - //生成Token public static String createToken(User user){ -// Date date = new Date(System.currentTimeMillis() + EXPIRE_TIME); Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.SECOND,604800 );//单位秒,604800 为7天 Algorithm algorithm = Algorithm.HMAC256(SECRET); @@ -33,14 +31,11 @@ public class JWTUtil { .withClaim("username", user.getUsername()) .withClaim("uid", user.getUid()) .withClaim("password", user.getPassword()) - //到期时间 .withExpiresAt(calendar.getTime()) - //创建一个新的JWT,并使用给定的算法进行标记 .sign(algorithm); return token; } - //验证Token public static JSONObject checkToken(String token){ JWTVerifier jwtVerifier = JWT.require(Algorithm.HMAC256(SECRET)).build();//验证对象 JSONObject jsonObject = new JSONObject(); @@ -68,13 +63,5 @@ public class JWTUtil { } - public static void main(String[] args) { - User user = new User(); - user.setEmail("Hellohao@qq.com"); - user.setUsername("Hellohao"); - String token = createToken(user); - System.out.println(token); - checkToken(token); -// checkToken("eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2MjM3NDYwOTUsImVtYWlsIjoiSGVsbG9oYW9AcXEuY29tIiwidXNlcm5hbWUiOiJIZWxsb2hhbyJ9.sFnAq1VU0wuiowaTtgJNNkMzRHPmRg4leNguhh0OMCA"); - } + } diff --git a/src/main/java/cn/hellohao/controller/AdminController.java b/src/main/java/cn/hellohao/controller/AdminController.java index 5f5e2b6..12113bf 100644 --- a/src/main/java/cn/hellohao/controller/AdminController.java +++ b/src/main/java/cn/hellohao/controller/AdminController.java @@ -14,10 +14,8 @@ import org.apache.shiro.SecurityUtils; import org.apache.shiro.subject.Subject; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; import org.springframework.web.bind.annotation.*; -import javax.servlet.http.HttpSession; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; @@ -38,8 +36,6 @@ public class AdminController { @Autowired private UserServiceImpl userService; @Autowired - private UserServiceImpl userServiceImpl; - @Autowired private ImgreviewService imgreviewService; @Autowired private ImgTempService imgTempService; @@ -81,11 +77,9 @@ public class AdminController { UploadConfig uploadConfig = uploadConfigService.getUpdateConfig(); Imgreview imgreview = imgreviewService.selectByPrimaryKey(1);//查询非法个数 Imgreview isImgreviewOK = imgreviewService.selectByusing(1);//查询有没有启动鉴别功能 - //普通用户 String ok = "false"; jsonObject.put("myImgTotal", imgService.countimg(user.getId())); //我的图片数 jsonObject.put("myAlbumTitle", albumService.selectAlbumCount(user.getId()));//我的画廊数量 - //计算自己的百分比 已用量/分配量 long memory = Long.valueOf(user.getMemory());//分配量 Long usermemory = imgService.getusermemory(user.getId())==null?0L:imgService.getusermemory(user.getId()); if(memory==0){ @@ -174,7 +168,7 @@ public class AdminController { } - @PostMapping("/getRecently")//new 获取榜单和最近上传 + @PostMapping("/getRecently")//new @ResponseBody public Msg getRecently(@RequestParam(value = "data", defaultValue = "") String data) { Msg msg = new Msg(); @@ -184,11 +178,9 @@ public class AdminController { User user = (User) subject.getPrincipal(); user = userService.getUsers(user); if(user.getLevel()>1){ - //管理员 可以看榜单数据 和最近上传 jsonObject.put("RecentlyUser",imgService.RecentlyUser()); jsonObject.put("RecentlyUploaded",imgService.RecentlyUploaded(user.getId())); }else{ - //普通用户只能看最近上传 jsonObject.put("RecentlyUploaded",imgService.RecentlyUploaded(user.getId())); } }catch (Exception e){ @@ -325,7 +317,6 @@ public class AdminController { img.setClassifuidlist(calssif); } if(subject.hasRole("admin")){ - //管理员 sql根据userid是否等于空做的判断, img.setUserid(null); }else{ //普通用户 @@ -389,7 +380,6 @@ public class AdminController { userOld.setId(u.getId()); User userInfo = userService.getUsers(userOld); if(!userInfo.getUsername().equals(username)){ - //要修改用户名 Integer countusername = userService.countusername(username); if(countusername == 1 || !SysName.CheckSysName(username)){ msg.setCode("110406"); @@ -400,7 +390,6 @@ public class AdminController { } } if(!userInfo.getEmail().equals(email)){ - //要修改邮箱 Integer countmail = userService.countmail(email); if(countmail == 1){ msg.setCode("110407"); @@ -458,7 +447,6 @@ public class AdminController { break; } } - //删除图片 boolean isDele = false; try{ if (key.getStorageType() == 1) { @@ -483,11 +471,8 @@ public class AdminController { }catch (Exception e){ e.printStackTrace(); } - - //删除库 if(isDele){ try { - //删除图像表之前先删除临时数据表,图像表也会删除 imgTempService.delImgAndExp(image.getImguid()); imgService.deleimg(imgid); imgAndAlbumService.deleteImgAndAlbum(imgname); @@ -505,7 +490,6 @@ public class AdminController { msg.setInfo("图片记录已删除,但是图片源删除失败"); } } - System.out.println("返回的值:"+msg.toString()); return msg; } diff --git a/src/main/java/cn/hellohao/controller/AdminRootController.java b/src/main/java/cn/hellohao/controller/AdminRootController.java index 00d6582..a7af2db 100644 --- a/src/main/java/cn/hellohao/controller/AdminRootController.java +++ b/src/main/java/cn/hellohao/controller/AdminRootController.java @@ -30,8 +30,6 @@ import java.util.Map; @Controller @RequestMapping("/admin/root") public class AdminRootController { - @Autowired - private NOSImageupload nOSImageupload; @Autowired private ConfigService configService; @Autowired @@ -43,12 +41,8 @@ public class AdminRootController { @Autowired private UploadConfigService uploadConfigService; @Autowired - private NoticeService noticeService; - @Autowired private SysConfigService sysConfigService; @Autowired - private GroupService groupService; - @Autowired private ImgService imgService; @Autowired private ImgreviewService imgreviewService; diff --git a/src/main/java/cn/hellohao/controller/AlbumController.java b/src/main/java/cn/hellohao/controller/AlbumController.java index 1aee07c..1bc6327 100644 --- a/src/main/java/cn/hellohao/controller/AlbumController.java +++ b/src/main/java/cn/hellohao/controller/AlbumController.java @@ -2,7 +2,8 @@ package cn.hellohao.controller; import cn.hellohao.pojo.*; import cn.hellohao.pojo.vo.PageResultBean; -import cn.hellohao.service.*; +import cn.hellohao.service.ImgAndAlbumService; +import cn.hellohao.service.UserService; import cn.hellohao.service.impl.AlbumServiceImpl; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; @@ -13,10 +14,10 @@ import org.apache.shiro.SecurityUtils; import org.apache.shiro.subject.Subject; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; -import javax.servlet.http.HttpSession; import java.text.SimpleDateFormat; import java.util.*; @@ -30,14 +31,8 @@ public class AlbumController { @Autowired AlbumServiceImpl albumServiceImpl; @Autowired - private ConfigService configService; - @Autowired - private ImgService imgService; - @Autowired ImgAndAlbumService imgAndAlbumService; @Autowired - private UploadConfigService uploadConfigService; - @Autowired private UserService userService; @PostMapping("/admin/getGalleryList") //new diff --git a/src/main/java/cn/hellohao/controller/ClientController.java b/src/main/java/cn/hellohao/controller/ClientController.java index 5a24ff2..da6e6ac 100644 --- a/src/main/java/cn/hellohao/controller/ClientController.java +++ b/src/main/java/cn/hellohao/controller/ClientController.java @@ -1,26 +1,15 @@ package cn.hellohao.controller; -import cn.hellohao.pojo.*; -import cn.hellohao.service.*; -import cn.hellohao.service.impl.*; -import cn.hellohao.utils.*; -import cn.hutool.http.HttpUtil; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; +import cn.hellohao.pojo.Msg; +import cn.hellohao.service.impl.ClientService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; -import java.io.*; -import java.net.HttpURLConnection; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLConnection; -import java.text.SimpleDateFormat; -import java.util.*; /** * @author Hellohao diff --git a/src/main/java/cn/hellohao/controller/CodeController.java b/src/main/java/cn/hellohao/controller/CodeController.java index 9f28b0f..6d422f1 100644 --- a/src/main/java/cn/hellohao/controller/CodeController.java +++ b/src/main/java/cn/hellohao/controller/CodeController.java @@ -26,7 +26,6 @@ public class CodeController { @Autowired private CodeService codeService; - @RequestMapping(value = "/selectCodeList")//new @ResponseBody public Map selectCodeList(@RequestParam(value = "data", defaultValue = "") String data) { diff --git a/src/main/java/cn/hellohao/controller/ExceptionHandling.java b/src/main/java/cn/hellohao/controller/ExceptionHandling.java index c0cd040..eec709f 100644 --- a/src/main/java/cn/hellohao/controller/ExceptionHandling.java +++ b/src/main/java/cn/hellohao/controller/ExceptionHandling.java @@ -3,16 +3,12 @@ package cn.hellohao.controller; import cn.hellohao.exception.StorageSourceInitException; import cn.hellohao.utils.Print; import org.springframework.ui.Model; -import org.springframework.validation.BindException; -import org.springframework.validation.ObjectError; import org.springframework.web.HttpRequestMethodNotSupportedException; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.servlet.ModelAndView; import java.net.SocketException; -import java.util.Date; -import java.util.List; /** * @author Hellohao @@ -24,7 +20,6 @@ import java.util.List; public class ExceptionHandling { @ExceptionHandler - //@ResponseBody public ModelAndView test(StorageSourceInitException ssie){ ModelAndView modelAndView = new ModelAndView("index"); Print.Normal("异常拦截成功:"+ ssie.getMessage()); @@ -39,7 +34,6 @@ public class ExceptionHandling { Print.Normal("存储源配置不正确,初始化失败"+ e.getMessage()); e.printStackTrace(); modelAndView.addObject("error",e.getMessage()); - //返回错误信息,并显示给用户 return e.getMessage(); } @ExceptionHandler @@ -48,7 +42,6 @@ public class ExceptionHandling { Print.Normal("系统内部错误:"+ e.getMessage()); e.printStackTrace(); modelAndView.addObject("error",e.getMessage()); - //返回错误信息,并显示给用户 return e.getMessage(); } @@ -57,11 +50,8 @@ public class ExceptionHandling { ModelAndView modelAndView = new ModelAndView("/index"); Print.Normal("URL访问类型不正确:"+ e.getMessage()); - //e.printStackTrace(); modelAndView.addObject("error","URL访问类型不正确。"); model.addAttribute("error","URL访问类型不正确。"); - //返回错误信息,并显示给用户 - //return e.getMessage(); return "exception"; } diff --git a/src/main/java/cn/hellohao/controller/GroupController.java b/src/main/java/cn/hellohao/controller/GroupController.java index b1cd731..ca5e5db 100644 --- a/src/main/java/cn/hellohao/controller/GroupController.java +++ b/src/main/java/cn/hellohao/controller/GroupController.java @@ -3,8 +3,6 @@ package cn.hellohao.controller; import cn.hellohao.pojo.Group; import cn.hellohao.pojo.Msg; import cn.hellohao.service.GroupService; -import cn.hellohao.service.KeysService; -import cn.hellohao.service.UserService; import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -28,18 +26,12 @@ import java.util.Map; public class GroupController { @Autowired private GroupService groupService; - @Autowired - private KeysService keysService; - @Autowired - private UserService userService; - @PostMapping("/getGrouplistForUsers") //new @ResponseBody public Msg getGrouplistForUsers() { Msg msg = new Msg(); - //只获取用户组type为0的,只有是0的才是未分配用户组的,才能给指定用户设置 List groupList = groupService.grouplist(0); msg.setData(groupList); return msg; diff --git a/src/main/java/cn/hellohao/controller/IndexController.java b/src/main/java/cn/hellohao/controller/IndexController.java index d17bb89..f70816a 100644 --- a/src/main/java/cn/hellohao/controller/IndexController.java +++ b/src/main/java/cn/hellohao/controller/IndexController.java @@ -100,6 +100,24 @@ public class IndexController { return uploadServicel.uploadForLoc(request,multipartFile,day,null,jsonArray); } + //根据网络图片url上传 + @PostMapping(value = "/uploadForUrl") //new + @ResponseBody + public Msg upurlimg(HttpServletRequest request,@RequestParam(value = "data", defaultValue = "") String data) { + JSONObject jsonObj = JSONObject.parseObject(data); + final JSONArray jsonArray = new JSONArray(); + Integer setday = jsonObj.getInteger("day"); + String imgUrl = jsonObj.getString("imgUrl"); + String selectTreeListStr = jsonObj.getString("classifications"); + if(null != selectTreeListStr){ + String[] calssif = selectTreeListStr.split(","); + for (int i = 0; i < calssif.length; i++) { + jsonArray.add(calssif[i]); + } + } + return uploadServicel.uploadForLoc(request,null,setday,imgUrl,jsonArray); + } + @RequestMapping(value = "/getUploadInfo")//new @ResponseBody public Msg getUploadInfo() { diff --git a/src/main/java/cn/hellohao/controller/UserController.java b/src/main/java/cn/hellohao/controller/UserController.java index 6600650..49981d4 100644 --- a/src/main/java/cn/hellohao/controller/UserController.java +++ b/src/main/java/cn/hellohao/controller/UserController.java @@ -2,7 +2,6 @@ package cn.hellohao.controller; import java.text.SimpleDateFormat; import java.util.Date; -import java.util.Random; import java.util.UUID; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -22,8 +21,8 @@ import org.apache.shiro.subject.Subject; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.*; import com.alibaba.fastjson.JSONObject; +import org.springframework.web.bind.annotation.*; @Controller @@ -46,7 +45,7 @@ public class UserController { @PostMapping("/register") @ResponseBody - public Msg Register(HttpServletRequest request,@RequestParam(value = "data", defaultValue = "") String data) {//Validated + public Msg Register(HttpServletRequest request, @RequestParam(value = "data", defaultValue = "") String data) {//Validated Msg msg = new Msg(); JSONObject jsonObj = JSONObject.parseObject(data); String username = jsonObj.getString("username"); @@ -112,7 +111,6 @@ public class UserController { Integer type = 0; if(emailConfig.getUsing()==1){ user.setIsok(0); - //注册完发激活链接 Thread thread = new Thread() { public void run() { Integer a = NewSendEmail.sendEmail(emailConfig,user.getUsername(), uid, user.getEmail(),config); @@ -121,7 +119,6 @@ public class UserController { thread.start(); msg.setInfo("注册成功,请注意查收邮箱尽快激活账户"); }else{ - //直接注册 user.setIsok(1); msg.setInfo("注册成功,快去登陆吧"); } @@ -208,8 +205,6 @@ public class UserController { } - - //邮箱激活 @RequestMapping(value = "/activation", method = RequestMethod.GET) public String activation(Model model, HttpServletRequest request, HttpSession session, String activation, String username) { Config config = configService.getSourceype(); @@ -232,7 +227,6 @@ public class UserController { } } - //退出 @PostMapping(value = "/logout")//new @ResponseBody public Msg exit(Model model, HttpServletRequest request, HttpServletResponse response, HttpSession session) { @@ -244,7 +238,6 @@ public class UserController { return msg; } - //retrievepass @PostMapping("/retrievePass") //new @ResponseBody public Msg retrievePass(HttpServletRequest request, @RequestParam(value = "data", defaultValue = "") String data) { @@ -307,7 +300,6 @@ public class UserController { return msg; } - //邮箱激活 @RequestMapping(value = "/retrieve", method = RequestMethod.GET) //new public String retrieve(Model model, String activation,String cip) { Integer ret = 0; @@ -341,10 +333,5 @@ public class UserController { } - private Integer number1; - private Integer istmp1; - private Integer number2; - private Integer istmp2; - } diff --git a/src/main/java/cn/hellohao/dao/ImgMapper.java b/src/main/java/cn/hellohao/dao/ImgMapper.java index 498dd22..214e9e6 100644 --- a/src/main/java/cn/hellohao/dao/ImgMapper.java +++ b/src/main/java/cn/hellohao/dao/ImgMapper.java @@ -40,8 +40,6 @@ public interface ImgMapper { List RecentlyUser(); - Integer addGreat(@Param("id") Integer id); - List getyyyy(@Param("userid") Integer userid); List countByM(Images images); diff --git a/src/main/java/cn/hellohao/dao/NoticeMapper.java b/src/main/java/cn/hellohao/dao/NoticeMapper.java deleted file mode 100644 index 33a99e3..0000000 --- a/src/main/java/cn/hellohao/dao/NoticeMapper.java +++ /dev/null @@ -1,9 +0,0 @@ -package cn.hellohao.dao; - -import org.apache.ibatis.annotations.Mapper; - -@Mapper -public interface NoticeMapper { - - String getNotice(); -} diff --git a/src/main/java/cn/hellohao/pojo/User.java b/src/main/java/cn/hellohao/pojo/User.java index 7a036a9..477b267 100644 --- a/src/main/java/cn/hellohao/pojo/User.java +++ b/src/main/java/cn/hellohao/pojo/User.java @@ -7,10 +7,7 @@ public class User { //@NotBlank(message = "用户名不能为空") // @Length(min = 6, max = 20, message = "用户名需要为 6 - 20 个字符") private String username; - //@NotBlank(message = "密码不能为空") private String password; - // @NotBlank(message = "邮箱不能为空") - //@Email(message = "邮箱格式不正确") private String email; private String birthder; private Integer level; @@ -20,13 +17,15 @@ public class User { private Integer groupid; private String groupname; + private Long counts;//用户img counts + public User() { super(); } public User(Integer id, String username, String password, String email, String birthder, Integer level, String uid, - Integer isok, String memory, Integer groupid,String groupname) { + Integer isok, String memory, Integer groupid,String groupname,Long counts) { this.id = id; this.username = username; this.password = password; @@ -38,6 +37,7 @@ public class User { this.memory = memory; this.groupid = groupid; this.groupname = groupname; + this.counts = counts; } public Integer getId() { @@ -127,4 +127,12 @@ public class User { public void setGroupname(String groupname) { this.groupname = groupname; } + + public Long getCounts() { + return counts; + } + + public void setCounts(Long counts) { + this.counts = counts; + } } diff --git a/src/main/java/cn/hellohao/service/ImgService.java b/src/main/java/cn/hellohao/service/ImgService.java index 3acc00d..4693f47 100644 --- a/src/main/java/cn/hellohao/service/ImgService.java +++ b/src/main/java/cn/hellohao/service/ImgService.java @@ -41,8 +41,6 @@ public interface ImgService { List RecentlyUser(); - Integer addGreat(Integer id); - List getyyyy(Integer userid); List countByM(Images images); diff --git a/src/main/java/cn/hellohao/service/NoticeService.java b/src/main/java/cn/hellohao/service/NoticeService.java deleted file mode 100644 index 1fe01c4..0000000 --- a/src/main/java/cn/hellohao/service/NoticeService.java +++ /dev/null @@ -1,9 +0,0 @@ -package cn.hellohao.service; - -import org.springframework.stereotype.Service; - -@Service -public interface NoticeService { - - String getNotice(); -} diff --git a/src/main/java/cn/hellohao/service/impl/ClientService.java b/src/main/java/cn/hellohao/service/impl/ClientService.java index 8479a78..98de830 100644 --- a/src/main/java/cn/hellohao/service/impl/ClientService.java +++ b/src/main/java/cn/hellohao/service/impl/ClientService.java @@ -61,8 +61,6 @@ public class ClientService { @Autowired private UploadConfigMapper uploadConfigMapper; @Autowired - private NoticeMapper noticeMapper; - @Autowired private ImgMapper imgMapper; @Autowired ImgreviewMapper imgreviewMapper; diff --git a/src/main/java/cn/hellohao/service/impl/ImgServiceImpl.java b/src/main/java/cn/hellohao/service/impl/ImgServiceImpl.java index f794714..6ea6390 100644 --- a/src/main/java/cn/hellohao/service/impl/ImgServiceImpl.java +++ b/src/main/java/cn/hellohao/service/impl/ImgServiceImpl.java @@ -230,10 +230,6 @@ public class ImgServiceImpl implements ImgService { return imgMapper.RecentlyUser(); } - @Override - public Integer addGreat(Integer id) { - return imgMapper.addGreat(id); - } public List getyyyy(Integer userid){ return imgMapper.getyyyy(userid); diff --git a/src/main/java/cn/hellohao/service/impl/NoticeServiceImpl.java b/src/main/java/cn/hellohao/service/impl/NoticeServiceImpl.java deleted file mode 100644 index 86e4841..0000000 --- a/src/main/java/cn/hellohao/service/impl/NoticeServiceImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -package cn.hellohao.service.impl; - -import cn.hellohao.dao.NoticeMapper; -import cn.hellohao.service.NoticeService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -@Service -public class NoticeServiceImpl implements NoticeService { - - @Autowired - private NoticeMapper noticeMapper; - - @Override - public String getNotice() { - return noticeMapper.getNotice(); - } -} diff --git a/src/main/resources/db/doc.txt b/src/main/resources/db/doc.txt deleted file mode 100644 index 3ddc008..0000000 --- a/src/main/resources/db/doc.txt +++ /dev/null @@ -1 +0,0 @@ -存储源删除 \ No newline at end of file diff --git a/src/main/resources/db/img.ini b/src/main/resources/db/img.ini deleted file mode 100644 index 492d11a..0000000 --- a/src/main/resources/db/img.ini +++ /dev/null @@ -1,3 +0,0 @@ -aaaaaaaaaaa -vbbbbbbbbbbbbbb -cccccccccccc \ No newline at end of file diff --git a/src/main/resources/mapper/ImgMapper.xml b/src/main/resources/mapper/ImgMapper.xml index 2c79835..0438c41 100644 --- a/src/main/resources/mapper/ImgMapper.xml +++ b/src/main/resources/mapper/ImgMapper.xml @@ -19,7 +19,6 @@ a.imguid, a.format, a.about, - a.great, a.violation FROM imgdata a @@ -128,15 +127,11 @@ - - - update imgdata set great = (great+1) where id = #{id} - ';this.$element.append(panelHtml);this.isEnd=false;this.htmlDoms={code_btn:$('#'+this.options.btnId),code:this.$element.find('.verify-code'),code_area:this.$element.find('.verify-code-area'),code_input:this.$element.find('.varify-input-code'),};this.htmlDoms.code.css({'width':this.options.width,'height':this.options.height,'line-height':this.options.height,'font-size':this.options.fontSize});this.htmlDoms.code_area.css({'width':this.options.width})},setCode:function(){if(this.isEnd==false){var color1Num=Math.floor(Math.random()*3);var color2Num=Math.floor(Math.random()*5);this.htmlDoms.code.css({'background-color':_code_color1[color1Num],'color':_code_color2[color2Num]});this.htmlDoms.code_input.val('');var code='';this.code_chose='';if(this.options.type==1){for(var i=0;i'+_code_chars[charNum]+''}}else{var num1=Math.floor(Math.random()*this.options.figure);var num2=Math.floor(Math.random()*this.options.figure);if(this.options.arith==0){var tmparith=Math.floor(Math.random()*3)}switch(tmparith){case 1:this.code_chose=parseInt(num1)+parseInt(num2);code=num1+' + '+num2+' = ?';break;case 2:if(parseInt(num1)
';this.plusWidth=parseInt(this.setSize.block_width)+parseInt(this.setSize.circle_radius)*2-parseInt(this.setSize.circle_radius)*0.2;this.plusHeight=parseInt(this.setSize.block_height)+parseInt(this.setSize.circle_radius)*2-parseInt(this.setSize.circle_radius)*0.2;tmpHtml=''}panelHtml+=tmpHtml+'
'+this.options.explain+'
';this.$element.append(panelHtml);this.htmlDoms={sub_block:this.$element.find('.verify-sub-block'),out_panel:this.$element.find('.verify-img-out'),img_panel:this.$element.find('.verify-img-panel'),img_canvas:this.$element.find('.verify-img-canvas'),bar_area:this.$element.find('.verify-bar-area'),move_block:this.$element.find('.verify-move-block'),left_bar:this.$element.find('.verify-left-bar'),msg:this.$element.find('.verify-msg'),icon:this.$element.find('.verify-icon'),refresh:this.$element.find('.verify-refresh')};this.$element.css('position','relative');if(this.options.mode=='pop'){this.htmlDoms.out_panel.css({'display':'none','position':'absolute','bottom':'42px'});this.htmlDoms.sub_block.css({'display':'none'})}else{this.htmlDoms.out_panel.css({'position':'relative'})}this.htmlDoms.out_panel.css('height',parseInt(this.setSize.img_height)+this.options.vSpace+'px');this.htmlDoms.img_panel.css({'width':this.setSize.img_width,'height':this.setSize.img_height});this.htmlDoms.bar_area.css({'width':this.setSize.bar_width,'height':this.setSize.bar_height,'line-height':this.setSize.bar_height});this.htmlDoms.move_block.css({'width':this.setSize.bar_height,'height':this.setSize.bar_height});this.htmlDoms.left_bar.css({'width':this.setSize.bar_height,'height':this.setSize.bar_height});this.randSet()},drawImg:function(obj,img){var canvas=this.htmlDoms.img_canvas[0];if(canvas){var ctx=canvas.getContext("2d");ctx.drawImage(img,0,0,parseInt(this.setSize.img_width),parseInt(this.setSize.img_height));graphParameter={x:this.x,y:this.y,r:parseInt(this.setSize.circle_radius),w:(parseInt(this.setSize.block_width)-2*parseInt(this.setSize.circle_radius))/2,h:(parseInt(this.setSize.block_height)-2*parseInt(this.setSize.circle_radius))/2};obj.drawRule(ctx,graphParameter)}var canvas2=this.htmlDoms.sub_block[0];if(canvas2){var proportionX=img.width/parseInt(this.setSize.img_width);var proportionY=img.height/parseInt(this.setSize.img_height);var ctx2=canvas2.getContext("2d");ctx2.restore();ctx2.drawImage(img,this.x*proportionX,(this.y-parseInt(this.setSize.circle_radius)-parseInt(this.setSize.circle_radius)*0.8)*proportionY,this.plusWidth*proportionX,this.plusHeight*proportionY,0,0,this.plusWidth,this.plusHeight);ctx2.save();ctx2.globalCompositeOperation="destination-atop";graphParameter.x=0;graphParameter.y=parseInt(this.setSize.circle_radius)+parseInt(this.setSize.circle_radius)*0.8;obj.drawRule(ctx2,graphParameter)}},drawRule:function(ctx,graphParameter){var x=graphParameter.x;var y=graphParameter.y;var r=graphParameter.r;var w=graphParameter.w;var h=graphParameter.h;ctx.beginPath();ctx.moveTo(x,y);ctx.lineTo((x+w)+r*0.4,y);ctx.arc((x+w)+r,y-r*0.8,r,0.7*Math.PI,0.3*Math.PI);ctx.lineTo((x+(2*w)+(2*r)),y);ctx.lineTo((x+(2*w)+(2*r)),y+h);ctx.arc((x+(2*w)+(2*r))+(r*0.8),y+h+r,r,1.2*Math.PI,0.8*Math.PI);ctx.lineTo((x+(2*w)+(2*r)),y+(2*h)+(2*r));ctx.lineTo(x,y+(2*h)+(2*r));ctx.lineTo(x,y+h+2*r-r*0.4);ctx.arc(x+(r*0.8),y+h+r,r,0.8*Math.PI,1.2*Math.PI,true);ctx.lineTo(x,y);ctx.fillStyle="#fff";ctx.fill();ctx.closePath()},start:function(e){if(this.isEnd==false){this.htmlDoms.msg.text('');this.htmlDoms.move_block.css('background-color','#337ab7');this.htmlDoms.left_bar.css('border-color','#337AB7');this.htmlDoms.icon.css('color','#fff');e.stopPropagation();this.status=true}},move:function(e){if(this.status&&this.isEnd==false){if(this.options.mode=='pop'){this.showImg()}if(!e.touches){var x=e.clientX}else{var x=e.touches[0].pageX}var bar_area_left=Slide.prototype.getLeft(this.htmlDoms.bar_area[0]);var move_block_left=x-bar_area_left;if(this.options.type!=1){if(move_block_left>=(this.htmlDoms.bar_area[0].offsetWidth-parseInt(this.setSize.bar_height)+parseInt(parseInt(this.setSize.block_width)/2)-2)){move_block_left=(this.htmlDoms.bar_area[0].offsetWidth-parseInt(this.setSize.bar_height)+parseInt(parseInt(this.setSize.block_width)/2)-2)}}else{if(move_block_left>=this.htmlDoms.bar_area[0].offsetWidth-parseInt(parseInt(this.setSize.bar_height)/2)+3){this.$element.find('.verify-msg:eq(1)').text('松开验证');move_block_left=this.htmlDoms.bar_area[0].offsetWidth-parseInt(parseInt(this.setSize.bar_height)/2)+3}else{this.$element.find('.verify-msg:eq(1)').text('')}}if(move_block_left<=parseInt(parseInt(this.setSize.block_width)/2)){move_block_left=parseInt(parseInt(this.setSize.block_width)/2)}this.htmlDoms.move_block.css('left',move_block_left-parseInt(parseInt(this.setSize.block_width)/2)+"px");this.htmlDoms.left_bar.css('width',move_block_left-parseInt(parseInt(this.setSize.block_width)/2)+"px");this.htmlDoms.sub_block.css('left',(move_block_left-parseInt(parseInt(this.setSize.block_width)/2))*this.lengthPercent+"px")}},end:function(){var _this=this;if(this.status&&this.isEnd==false){if(this.options.type!=1){var vOffset=parseInt(this.options.vOffset);if(parseInt(this.x)>=(parseInt(this.htmlDoms.sub_block.css('left'))-vOffset)&&parseInt(this.x)<=(parseInt(this.htmlDoms.sub_block.css('left'))+vOffset)){this.htmlDoms.move_block.css('background-color','#5cb85c');this.htmlDoms.left_bar.css({'border-color':'#5cb85c','background-color':'#fff'});this.htmlDoms.icon.css('color','#fff');this.htmlDoms.icon.removeClass('icon-right');this.htmlDoms.icon.addClass('icon-check');this.htmlDoms.refresh.hide();this.isEnd=true;this.options.success(this)}else{this.htmlDoms.move_block.css('background-color','#d9534f');this.htmlDoms.left_bar.css('border-color','#d9534f');this.htmlDoms.icon.css('color','#fff');this.htmlDoms.icon.removeClass('icon-right');this.htmlDoms.icon.addClass('icon-close');setTimeout(function(){_this.refresh()},400);this.options.error(this)}}else{if(parseInt(this.htmlDoms.move_block.css('left'))>=(parseInt(this.setSize.bar_width)-parseInt(this.setSize.bar_height)-parseInt(this.options.vOffset))){this.htmlDoms.move_block.css('background-color','#5cb85c');this.htmlDoms.left_bar.css({'color':'#4cae4c','border-color':'#5cb85c','background-color':'#fff'});this.htmlDoms.icon.css('color','#fff');this.htmlDoms.icon.removeClass('icon-right');this.htmlDoms.icon.addClass('icon-check');this.htmlDoms.refresh.hide();this.$element.find('.verify-msg:eq(1)').text('验证成功');this.isEnd=true;this.options.success(this)}else{this.$element.find('.verify-msg:eq(1)').text('');this.htmlDoms.move_block.css('background-color','#d9534f');this.htmlDoms.left_bar.css('border-color','#d9534f');this.htmlDoms.icon.css('color','#fff');this.htmlDoms.icon.removeClass('icon-right');this.htmlDoms.icon.addClass('icon-close');this.isEnd=true;setTimeout(function(){_this.$element.find('.verify-msg:eq(1)').text('');_this.refresh();_this.isEnd=false},400);this.options.error(this)}}this.status=false}},showImg:function(){this.htmlDoms.out_panel.css({'display':'block'});this.htmlDoms.sub_block.css({'display':'block'})},hideImg:function(){this.htmlDoms.out_panel.css({'display':'none'});this.htmlDoms.sub_block.css({'display':'none'})},resetSize:function(obj){var img_width,img_height,bar_width,bar_height,block_width,block_height,circle_radius;var parentWidth=obj.$element.parent().width()||$(window).width();var parentHeight=obj.$element.parent().height()||$(window).height();if(obj.options.imgSize.width.indexOf('%')!=-1){img_width=parseInt(obj.options.imgSize.width)/100*parentWidth+'px'}else{img_width=obj.options.imgSize.width}if(obj.options.imgSize.height.indexOf('%')!=-1){img_height=parseInt(obj.options.imgSize.height)/100*parentHeight+'px'}else{img_height=obj.options.imgSize.height}if(obj.options.barSize.width.indexOf('%')!=-1){bar_width=parseInt(obj.options.barSize.width)/100*parentWidth+'px'}else{bar_width=obj.options.barSize.width}if(obj.options.barSize.height.indexOf('%')!=-1){bar_height=parseInt(obj.options.barSize.height)/100*parentHeight+'px'}else{bar_height=obj.options.barSize.height}if(obj.options.blockSize){if(obj.options.blockSize.width.indexOf('%')!=-1){block_width=parseInt(obj.options.blockSize.width)/100*parentWidth+'px'}else{block_width=obj.options.blockSize.width}if(obj.options.blockSize.height.indexOf('%')!=-1){block_height=parseInt(obj.options.blockSize.height)/100*parentHeight+'px'}else{block_height=obj.options.blockSize.height}}if(obj.options.circleRadius){if(obj.options.circleRadius.indexOf('%')!=-1){circle_radius=parseInt(obj.options.circleRadius)/100*parentHeight+'px'}else{circle_radius=obj.options.circleRadius}}return{img_width:img_width,img_height:img_height,bar_width:bar_width,bar_height:bar_height,block_width:block_width,block_height:block_height,circle_radius:circle_radius}},randSet:function(){var rand1=Math.floor(Math.random()*9+1);var rand2=Math.floor(Math.random()*9+1);var top=rand1*parseInt(this.setSize.img_height)/15+parseInt(this.setSize.img_height)*0.1;var left=rand2*parseInt(this.setSize.img_width)/15+parseInt(this.setSize.img_width)*0.1;this.x=left;this.y=top;if(this.options.mode=='pop'){this.htmlDoms.sub_block.css({'top':'-'+(parseInt(this.setSize.img_height)+this.options.vSpace+parseInt(this.setSize.circle_radius)+parseInt(this.setSize.circle_radius)*0.8-this.y-2)+'px'})}else{this.htmlDoms.sub_block.css({'top':this.y-(parseInt(this.setSize.circle_radius)+parseInt(this.setSize.circle_radius)*0.8)+2+'px'})}},refresh:function(){var _this=this;this.htmlDoms.refresh.show();this.$element.find('.verify-msg:eq(1)').text('');this.$element.find('.verify-msg:eq(1)').css('color','#000');this.htmlDoms.move_block.animate({'left':'0px'},'fast');this.htmlDoms.left_bar.animate({'width':parseInt(this.setSize.bar_height)},'fast');this.htmlDoms.left_bar.css({'border-color':'#ddd'});this.htmlDoms.move_block.css('background-color','#fff');this.htmlDoms.icon.css('color','#000');this.htmlDoms.icon.removeClass('icon-close');this.htmlDoms.icon.addClass('icon-right');this.$element.find('.verify-msg:eq(0)').text(this.options.explain);this.randSet();this.img_rand=Math.floor(Math.random()*this.options.imgName.length);var img=new Image();img.src=this.options.imgUrl+this.options.imgName[this.img_rand];$(img).on('load',function(e){_this.drawImg(_this,this)});this.isEnd=false;this.htmlDoms.sub_block.css('left',"0px")},getLeft:function(node){var left=$(node).offset().left;return left}};var Points=function(ele,opt){this.$element=ele,this.defaults={mode:'fixed',defaultNum:4,checkNum:3,vSpace:5,imgUrl:'images/',imgName:['1.jpg','2.jpg'],imgSize:{width:'400px',height:'200px',},barSize:{width:'400px',height:'40px',},ready:function(){},success:function(){},error:function(){}},this.options=$.extend({},this.defaults,opt)};Points.prototype={init:function(){var _this=this;_this.loadDom();_this.refresh();_this.options.ready();this.$element[0].onselectstart=document.body.ondrag=function(){return false};if(this.options.mode=='pop'){this.$element.on('mouseover',function(e){_this.showImg()});this.$element.on('mouseout',function(e){_this.hideImg()});this.htmlDoms.out_panel.on('mouseover',function(e){_this.showImg()});this.htmlDoms.out_panel.on('mouseout',function(e){_this.hideImg()})}_this.$element.find('.verify-img-panel canvas').on('click',function(e){_this.checkPosArr.push(_this.getMousePos(this,e));if(_this.num==_this.options.checkNum){_this.num=_this.createPoint(_this.getMousePos(this,e));setTimeout(function(){var flag=_this.comparePos(_this.fontPos,_this.checkPosArr);if(flag==false){_this.options.error(_this);_this.$element.find('.verify-bar-area').css({'color':'#d9534f','border-color':'#d9534f'});_this.$element.find('.verify-msg').text('验证失败');setTimeout(function(){_this.$element.find('.verify-bar-area').css({'color':'#000','border-color':'#ddd'});_this.refresh()},400)}else{_this.$element.find('.verify-bar-area').css({'color':'#4cae4c','border-color':'#5cb85c'});_this.$element.find('.verify-msg').text('验证成功');_this.$element.find('.verify-refresh').hide();_this.$element.find('.verify-img-panel').unbind('click');_this.options.success(_this)}},400)}if(_this.num<_this.options.checkNum){_this.num=_this.createPoint(_this.getMousePos(this,e))}});_this.$element.find('.verify-refresh').on('click',function(){_this.refresh()})},loadDom:function(){this.fontPos=[];this.checkPosArr=[];this.num=1;this.img_rand=Math.floor(Math.random()*this.options.imgName.length);var panelHtml='';var tmpHtml='';this.setSize=Slide.prototype.resetSize(this);panelHtml+='
';this.$element.append(panelHtml);this.htmlDoms={out_panel:this.$element.find('.verify-img-out'),img_panel:this.$element.find('.verify-img-panel'),bar_area:this.$element.find('.verify-bar-area'),msg:this.$element.find('.verify-msg'),};this.$element.css('position','relative');if(this.options.mode=='pop'){this.htmlDoms.out_panel.css({'display':'none','position':'absolute','bottom':'42px'})}else{this.htmlDoms.out_panel.css({'position':'relative'})}this.htmlDoms.out_panel.css('height',parseInt(this.setSize.img_height)+this.options.vSpace+'px');this.htmlDoms.img_panel.css({'width':this.setSize.img_width,'height':this.setSize.img_height,'background-size':this.setSize.img_width+' '+this.setSize.img_height,'margin-bottom':this.options.vSpace+'px'});this.htmlDoms.bar_area.css({'width':this.options.barSize.width,'height':this.setSize.bar_height,'line-height':this.setSize.bar_height})},drawImg:function(obj,img){var canvas=this.$element.find('canvas')[0];var ctx=canvas.getContext("2d");ctx.drawImage(img,0,0,parseInt(this.setSize.img_width),parseInt(this.setSize.img_height));var fontSizeArr=['italic small-caps bold 20px microsoft yahei','small-caps normal 25px arial','34px microsoft yahei'];var fontStr='天地玄黄宇宙洪荒日月盈昃辰宿列张寒来暑往秋收冬藏闰余成岁律吕调阳云腾致雨露结为霜金生丽水玉出昆冈剑号巨阙珠称夜光果珍李柰菜重芥姜海咸河淡鳞潜羽翔龙师火帝鸟官人皇始制文字乃服衣裳推位让国有虞陶唐吊民伐罪周发殷汤坐朝问道垂拱平章爱育黎首臣伏戎羌遐迩体率宾归王';var fontChars=[];var avg=Math.floor(parseInt(this.setSize.img_width)/(parseInt(this.options.defaultNum)+1));var tmp_index='';var color2Num=Math.floor(Math.random()*5);for(var i=1;i<=this.options.defaultNum;i++){fontChars[i-1]=this.getChars(fontStr,fontChars);tmp_index=Math.floor(Math.random()*3);ctx.font=fontSizeArr[tmp_index];ctx.fillStyle=_code_color2[color2Num];if(Math.floor(Math.random()*2)==1){var tmp_y=Math.floor(parseInt(this.setSize.img_height)/2)+tmp_index*20+20}else{var tmp_y=Math.floor(parseInt(this.setSize.img_height)/2)-tmp_index*20}ctx.fillText(fontChars[i-1],avg*i,tmp_y);this.fontPos[i-1]={'char':fontChars[i-1],'x':avg*i,'y':tmp_y}}for(var i=0;i<(this.options.defaultNum-this.options.checkNum);i++){this.shuffle(this.fontPos).pop()}var msgStr='';for(var i=0;i0){tmp_rand=tmp_rand-1}tmp_char=fontStr.charAt(tmp_rand);if($.inArray(tmp_char,fontChars)==-1){return tmp_char}else{return Points.prototype.getChars(fontStr,fontChars)}},shuffle:function(arr){var m=arr.length,i;var tmpF;while(m){i=(Math.random()*m--)>>>0;tmpF=arr[m];arr[m]=arr[i];arr[i]=tmpF}return arr},createPoint:function(pos){this.htmlDoms.img_panel.append('
'+this.num+'
');return++this.num},comparePos:function(fontPos,checkPosArr){var flag=true;for(var i=0;ifontPos[i].x&&parseInt(checkPosArr[i].x)-40fontPos[i].y&&parseInt(checkPosArr[i].y)-40/g,">"):t}function ht(t,i){return t.classList?t.classList.contains(i):-1=this.length||this.viewed&&i===this.index)return this;this.viewing&&this.viewing.abort();var n=this.element,s=this.options,o=this.title,a=this.canvas,r=this.items[i],h=r.querySelector("img"),l=ft(h,"originalUrl"),c=rt(h.getAttribute("alt")),u=document.createElement("img");if(u.src=l,u.alt=c,et(s.view)&&wt(n,j,s.view,{once:!0}),!1===bt(n,j,{originalImage:this.images[i],index:i,image:u})||!this.isShown||this.hiding||this.played)return this;this.image=u,ct(this.items[this.index],f),lt(r,f),this.viewed=!1,this.index=i,this.imageData={},lt(u,z),s.loading&<(a,v),a.innerHTML="",a.appendChild(u),this.renderList(),o.innerHTML="";function d(){var t=e.imageData,i=Array.isArray(s.title)?s.title[1]:s.title;o.innerHTML=rt(et(i)?i.call(e,u,t):"".concat(c," (").concat(t.naturalWidth," × ").concat(t.naturalHeight,")"))}var m;return wt(n,V,d,{once:!0}),this.viewing={abort:function(){pt(n,V,d),u.complete?this.imageRendering?this.imageRendering.abort():this.imageInitializing&&this.imageInitializing.abort():(u.src="",pt(u,Y,m),this.timeout&&clearTimeout(this.timeout))}},u.complete?this.load():(wt(u,Y,m=this.load.bind(this),{once:!0}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){ct(u,z),e.timeout=!1},1e3)),this},prev:function(t){var i=0Math.abs(o)&&(this.pointers={},1
';var n=e.querySelector(".".concat(p,"-container")),s=n.querySelector(".".concat(p,"-title")),o=n.querySelector(".".concat(p,"-toolbar")),a=n.querySelector(".".concat(p,"-navbar")),r=n.querySelector(".".concat(p,"-button")),l=n.querySelector(".".concat(p,"-canvas"));if(this.parent=i,this.viewer=n,this.title=s,this.toolbar=o,this.navbar=a,this.button=r,this.canvas=l,this.footer=n.querySelector(".".concat(p,"-footer")),this.tooltipBox=n.querySelector(".".concat(p,"-tooltip")),this.player=n.querySelector(".".concat(p,"-player")),this.list=n.querySelector(".".concat(p,"-list")),lt(s,h.title?zt(Array.isArray(h.title)?h.title[0]:h.title):k),lt(a,h.navbar?zt(h.navbar):k),ut(r,k,!h.button),h.backdrop&&(lt(n,"".concat(p,"-backdrop")),h.inline||"static"===h.backdrop||gt(l,K,"hide")),$(h.className)&&h.className&&h.className.split(U).forEach(function(t){lt(n,t)}),h.toolbar){var c=document.createElement("ul"),u=it(h.toolbar),d=Z.slice(0,3),m=Z.slice(7,9),f=Z.slice(9);u||lt(o,zt(h.toolbar)),nt(u?h.toolbar:Z,function(t,i){var e=u&&it(t),n=u?mt(i):t,s=e&&!J(t.show)?t.show:t;if(s&&(h.zoomable||-1===d.indexOf(n))&&(h.rotatable||-1===m.indexOf(n))&&(h.scalable||-1===f.indexOf(n))){var o=e&&!J(t.size)?t.size:t,a=e&&!J(t.click)?t.click:t,r=document.createElement("li");r.setAttribute("role","button"),lt(r,"".concat(p,"-").concat(n)),et(a)||gt(r,K,n),G(s)&<(r,zt(s)),-1!==["small","large"].indexOf(o)?lt(r,"".concat(p,"-").concat(o)):"play"===n&<(r,"".concat(p,"-large")),et(a)&&wt(r,S,a),c.appendChild(r)}}),o.appendChild(c)}else lt(o,k);if(!h.rotatable){var g=o.querySelectorAll('li[class*="rotate"]');lt(g,z),nt(g,function(t){o.appendChild(t)})}if(h.inline)lt(r,x),at(n,{zIndex:h.zIndexInline}),"static"===window.getComputedStyle(i).position&&at(i,{position:"relative"}),i.insertBefore(n,t.nextSibling);else{lt(r,w),lt(n,y),lt(n,b),lt(n,k),at(n,{zIndex:h.zIndex});var v=h.container;$(v)&&(v=t.ownerDocument.querySelector(v)),(v=v||this.body).appendChild(n)}h.inline&&(this.render(),this.bind(),this.isShown=!0),this.ready=!0,et(h.ready)&&wt(t,O,h.ready,{once:!0}),!1!==bt(t,O)?this.ready&&h.inline&&this.view(this.index):this.ready=!1}}}],[{key:"noConflict",value:function(){return window.Viewer=Lt,e}},{key:"setDefaults",value:function(t){st(s,it(t)&&t)}}]),e}();return st(Nt.prototype,Tt,Et,It,St,Ct),Nt}); \ No newline at end of file diff --git a/src/main/resources/static/layui/css/admin.css b/src/main/resources/static/layui/css/admin.css deleted file mode 100644 index 1fefae4..0000000 --- a/src/main/resources/static/layui/css/admin.css +++ /dev/null @@ -1,599 +0,0 @@ -/* ----- 头部样式 ----- */ - -/* 背景颜色、高度、底部阴影线 */ -.layui-layout-admin .layui-header { - background-color: #fff; - height: 50px; - box-shadow: 0 1px 0 0 rgba(0, 0, 0, .05); -} - -.layui-layout-admin .layui-header .layui-nav .layui-this:after, -.layui-layout-admin .layui-header .layui-nav-bar { - height: 2px; - background-color: #03152a; - top: 0 !important; -} - -/* 按钮颜色、间距、悬浮小手 */ -.layui-layout-admin .layui-header .layui-nav-item a { - color: #333333; - padding: 0 15px; - cursor: pointer; -} - -/* 按钮悬浮时的颜色 */ -.layui-layout-admin .layui-header .layui-nav-item a:hover { - color: #333333; -} - -/* 顶部导航 logo 样式 */ -.layui-layout-admin .layui-header .layui-logo { - width: 200px; - background-color: #324157; - color: #f2f2f2; - font-size: 18px; - font-family: Myriad Pro, Helvetica Neue, Arial, Helvetica, sans-serif; - font-weight: bold; - overflow: hidden; - line-height: 50px; - transition: all .3s; - white-space: nowrap; - box-shadow: 1px 0 2px 0 rgba(0, 0, 0, .05); -} - -/* 头部水平居中 */ -.layui-layout-admin .layui-header .layui-nav .layui-nav-item { - line-height: 50px; - vertical-align: unset; -} - -.layui-layout-admin .layui-header .layui-nav-item .layui-icon { - font-size: 16px; -} - -.layui-layout-admin .layui-header .layui-logo img { - height: 35px; -} - -/* 面包屑样式 */ -.layui-layout-admin .layui-header .layui-nav .layui-breadcrumb { - margin-left: 10px; -} - -.layui-nav-child { - top: 55px; -} - -.layui-layout-admin .layui-header .layui-nav { - padding: 0 10px; -} - -/* ----- 头部样式 ----- */ - - -/* ----- tab 样式 ----- */ - -/* tab 底色 */ -.layui-layout-admin .layui-tab .layui-tab-title li.layui-this, -.layui-layout-admin .layui-tab .layui-tab-title li:hover { - background-color: #f6f6f6; -} - -/* tab 下划线 */ -.layui-tab-title { - border-bottom-width: 0; -} - -/* 导航最小宽度 */ -.layui-layout-admin .layui-tab .layui-tab-title li { - min-width: 0; - line-height: 40px; - max-width: 160px; - text-overflow: ellipsis; - padding-right: 30px; - overflow: hidden; - border-right: 1px solid #f6f6f6; - vertical-align: top; -} - -/* 关闭按钮样式 */ -.layui-layout-admin .layui-tab > .layui-tab-title li .layui-tab-close { - width: 16px; - height: 16px; - line-height: 16px; - border-radius: 50%; - font-size: 12px; - position: absolute; - top: 12px; - right: 8px; -} - -/* tab 顶部颜色 */ -.layui-layout-admin .layui-tab-title li.layui-this:after { - width: 100%; - border: none; - height: 2px; - background-color: #292B34; -} - -/* tab 顶部切换动画 */ -.layui-layout-admin .layui-tab-title li:after { - content: ''; - position: absolute; - top: 0; - left: 0; - width: 0; - height: 2px; - border-radius: 0; - background-color: #292B34; - transition: all .3s; - transition-property: all; - transition-duration: 0.3s; - transition-timing-function: ease; - transition-delay: 0s; - -webkit-transition: all .3s; -} - -/* 隐藏第一个 tab 的关闭按钮 */ -.layui-layout-admin .layui-tab > .layui-tab-title li:first-child .layui-tab-close { - display: none; -} - -/* 标签卡第一个的标签没有关闭按钮, 所以距离右侧的宽度 15px */ -.layui-layout-admin .layui-tab > .layui-tab-title li:first-child { - padding: 0 15px; -} - -/* tab 页距离顶部距离为 0 */ -.layui-layout-admin .layui-tab { - margin-top: 0; -} - -/* 距离顶部的距离和左侧导航的距离 */ -.layui-layout-admin .layui-body { - left: 200px; - top: 50px; -} - -/* tab 行的高度, 背景色等 */ -.layui-pagetabs { - height: 40px; - line-height: 40px; - padding: 0 80px 0 0; - background-color: #fff; - box-sizing: border-box; - box-shadow: 0 1px 2px 0 rgba(0, 0, 0, .1); -} - -/* ----- tab 样式 ----- */ - - -/* ----- tab 左右按钮样式 ----- */ - -.layui-layout-admin .layui-body .admin-tabs-control { - position: absolute; - top: 0; - width: 40px; - height: 40px; - line-height: 40px; - text-align: center; - cursor: pointer; - transition: all .3s; - border-left: 1px solid #eee; - z-index: 1000; - background-color: white -} - -.layui-layout-admin .layui-body .admin-tabs-control:hover { - background-color: #eee -} - -.layui-layout-admin .layui-body .layui-icon-shrink-right { - left: 0; - border-left: none; - border-right: 1px solid #eee -} - -.layui-layout-admin .layui-body .layui-icon-refresh-3 { - right: 0 -} - -/* ----- tab 左右按钮样式 ----- */ - - -/* ----- 导航样式 ----- */ - - -/* 导航背景颜色 */ -.layui-layout-admin .layui-side { - position: absolute; - top: 50px; - width: 200px; - background-color: #324157; - transition: all .3s; - -webkit-transition: all .3s; - box-shadow: 1px 0 2px 0 rgba(0, 0, 0, .05); - -webkit-touch-callout: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none -} - -.layui-layout-admin .layui-side .layui-nav { - width: 200px; - background-color: transparent; -} - -.layui-layout-admin .layui-side .layui-nav .layui-nav-item .layui-icon { - position: absolute; - top: 50%; - left: 20px; - margin-top: -25px; -} - -.layui-layout-admin .layui-side .layui-nav .layui-nav-item a { - height: 50px; - line-height: 50px; - padding-left: 30px; - padding-right: 30px; -} - -/* 一级导航悬浮字体颜色和背景颜色 */ -.layui-layout-admin .layui-side .layui-nav .layui-nav-item > a:hover { - color: #BFCBD9; - background: #263445; -} - -/* 一级导航被选中时背景颜色和字体颜色 */ -.layui-nav-tree .layui-this, -.layui-nav-tree .layui-this > a, -.layui-nav-tree .layui-this > a:hover { - background-color: #324157; - color: rgb(64, 158, 255) -} - -/* 二级导航基础颜色 */ -.layui-nav-itemed > .layui-nav-child { - display: block; - padding: 0; - background-color: #1f2d3d !important; -} - -/* 二级导航悬浮字体背景颜色 */ -.layui-layout-admin .layui-side .layui-nav .layui-nav-item dl dd > a:hover { - background-color: #01101f; -} - -/* 二级导航被选中时背景颜色和字体颜色 */ -.layui-nav-tree .layui-nav-child dd.layui-this a, -.layui-nav-tree dd.layui-this { - background-color: #1f2d3d !important; - color: rgb(64, 158, 255) -} - -/* this 导航选中时, 颜色不变 */ -.layui-layout-admin .layui-side .layui-nav .layui-nav-item.layui-this > a:hover { - color: rgb(64, 158, 255) -} - - -/* 去除悬浮时左侧的绿条 */ -.layui-nav-tree .layui-nav-bar { - width: 0; -} - -/* 导航菜单展开时颜色 */ -.layui-nav-itemed > a { - color: #BFCBD9 !important; -} - -.layui-nav-tree .layui-nav-child, .layui-nav-tree .layui-nav-child a:hover { - color: #BFCBD9; - background: #001528 0 0; -} - -.layui-layout-admin .layui-side .layui-nav .layui-nav-more { - right: 15px -} - -.layui-layout-admin .layui-side .layui-nav .layui-nav-item .layui-nav-child a { - padding-left: 70px; - cursor: pointer -} - -.layui-layout-admin .layui-side .layui-nav .layui-nav-item .layui-nav-child .layui-nav-child a { - padding-left: 70px -} - -.layui-layout-admin .layui-side .layui-nav .layui-nav-item .layui-nav-child .layui-nav-child .layui-nav-child a { - padding-left: 90px -} - -.layui-layout-admin .layui-side .layui-nav .layui-nav-item .layui-nav-child .layui-nav-child .layui-nav-child .layui-nav-child a { - padding-left: 110px -} - -/* 一级目录额外的高度 */ -.layui-layout-admin .layui-side .layui-nav .layui-nav-item > a { - padding-top: 3px; - padding-bottom: 3px; - cursor: pointer -} - -/* ----- 导航样式 ----- */ - - -/* ----- 导航收起样式 ----- */ - -.layui-layout-admin.admin-nav-mini .layui-header .layui-logo { - width: 60px -} - -.layui-layout-admin.admin-nav-mini .layui-header .layui-logo cite { - display: none -} - -.layui-layout-admin.admin-nav-mini .layui-header .layui-layout-left { - left: 60px -} - -.layui-layout-admin.admin-nav-mini .layui-side { - width: 60px -} - -.layui-layout-admin.admin-nav-mini .layui-side .layui-nav { - width: 60px -} - -.layui-layout-admin.admin-nav-mini .layui-side-scroll { - width: 80px -} - -.layui-layout-admin.admin-nav-mini .layui-side .layui-nav .layui-nav-item > a > cite { - display: none -} - -.layui-layout-admin.admin-nav-mini .layui-side .layui-nav .layui-nav-item > a .layui-nav-more { - display: none -} - -.layui-layout-admin.admin-nav-mini .layui-side .layui-nav .layui-nav-item > a { - overflow: visible -} - -.layui-layout-admin.admin-nav-mini .layui-side .layui-nav .layui-nav-itemed .layui-nav-child { - display: none -} - -.layui-layout-admin.admin-nav-mini .layui-body { - left: 60px -} - -.layui-layout-admin.admin-nav-mini .layui-footer { - left: 60px -} - -.layui-layout-admin.admin-nav-mini .layui-side .layui-nav li.layui-nav-itemed > a { - background: rgba(0, 0, 0, .3) -} - -.layui-layout-admin.admin-nav-mini .layui-header .layui-icon-shrink-right:before { - content: "\e66b" -} - -.layui-layout-admin.admin-nav-mini .layui-side .layui-nav .layui-nav-item.admin-nav-hover > .layui-nav-child { - display: inline-block; - position: fixed; - top: 105px; - left: 65px; - background: #24262f !important; - min-width: 200px; - z-index: 1001 -} - -.layui-layout-admin.admin-nav-mini .layui-side .layui-nav .layui-nav-item.admin-nav-hover .layui-nav-itemed > .layui-nav-child { - display: block -} - -/* ----- 导航收起样式 ----- */ - - -/* ----- 导航小屏幕样式 -----*/ - -@media screen and (max-width: 750px) { - .layui-layout-admin .layui-side { - position: fixed; - left: -260px; - z-index: 10000 - } - - .layui-layout-admin .layui-body { - left: 0 - } - - .layui-layout-admin .layui-footer { - left: 0 - } - - .layui-layout-admin .layui-header .layui-logo { - left: -260px - } - - .layui-layout-admin .layui-header .layui-layout-left { - left: 0 - } - - .layui-layout-admin .layui-header .layui-icon-shrink-right:before { - content: "\e66b" - } - - .layui-layout-admin.admin-nav-mini .layui-header .layui-logo { - width: 220px; - left: 0; - z-index: 10001 - } - - .layui-layout-admin.admin-nav-mini .layui-header { - z-index: auto - } - - .layui-layout-admin.admin-nav-mini .layui-header .layui-logo cite { - display: inline-block - } - - .layui-layout-admin.admin-nav-mini .layui-header .layui-layout-left { - left: 0 - } - - .layui-layout-admin.admin-nav-mini .layui-side { - width: 220px; - left: 0 - } - - .layui-layout-admin.admin-nav-mini .layui-side .layui-nav { - width: 220px - } - - .layui-layout-admin.admin-nav-mini .layui-side-scroll { - width: 240px - } - - .layui-layout-admin.admin-nav-mini .layui-side .layui-nav .layui-nav-item > a > cite { - display: inline-block - } - - .layui-layout-admin.admin-nav-mini .layui-side .layui-nav .layui-nav-item > a .layui-nav-more { - display: inline-block - } - - .layui-layout-admin.admin-nav-mini .layui-side .layui-nav .layui-nav-item > a { - overflow: hidden - } - - .layui-layout-admin.admin-nav-mini .layui-side .layui-nav li.layui-nav-itemed > a { - background: transparent - } - - .layui-layout-admin.admin-nav-mini .layui-side .layui-nav li.layui-nav-item > a:hover { - background: rgba(255, 255, 255, .03) - } - - .layui-layout-admin.admin-nav-mini .layui-side .layui-nav .layui-nav-itemed > .layui-nav-child { - display: block - } - - .layui-layout-admin.admin-nav-mini .layui-body { - left: 0 - } - - .layui-layout-admin.admin-nav-mini .layui-footer { - left: 0 - } - - .layui-layout-admin.admin-nav-mini .site-mobile-shade { - content: ''; - position: fixed; - top: 0; - bottom: 0; - left: 0; - right: 0; - background-color: rgba(0, 0, 0, .1); - z-index: 9999; - cursor: pointer - } - - .layui-layout-admin.admin-nav-mini .layui-side .layui-nav .layui-nav-itemed > a { - background: transparent - } - - .layui-layout-admin.admin-nav-mini .layui-header .layui-icon-shrink-right:before { - content: "\e668" - } - - .layui-layout-admin.admin-nav-mini .layui-side .layui-nav .layui-nav-item.admin-nav-hover > .layui-nav-child { - display: none; - position: static; - background-color: rgba(0, 0, 0, .3) !important; - min-width: 100% - } - - .layui-layout-admin.admin-nav-mini .layui-side .layui-nav .layui-nav-itemed.admin-nav-hover > .layui-nav-child { - display: block - } - - .layui-layout-admin .layui-nav .layui-breadcrumb span, - .layui-layout-admin .layui-nav .layui-breadcrumb a:not(:last-child) { - display: none; - } -} - - -/* ----- 导航小屏幕样式 ----- */ - - -/* ----- 底部样式 ----- */ - -.layui-layout-admin .layui-footer { - left: 200px; - background: #fff; - transition: all .3s; - color: #666; - border-top: 1px solid #eee; - height: 43px; -} - -/* ----- 底部样式 ----- */ - - -/* ----- iframe 样式 ----- */ - -.layui-iframe { - position: absolute; - width: 100%; - height: calc(100% - 40px) !important; - left: 0; - top: 40px; - right: 0; - bottom: 0; - border: none; -} - -/* ----- iframe 样式 ----- */ - - -/* ----- 右键菜单样式 ----- */ - -.rightmenu { - position: absolute; - width: 100px; - z-index: 9999; - display: none; - background-color: #fff; - padding: 2px; - color: #333; - border: 1px solid #eee; - border-radius: 2px; - cursor: pointer; -} - -.rightmenu li { - text-align: center; - display: block; - height: 30px; - line-height: 30px; - margin: 8px 0 8px 0; - -} - -.rightmenu li:hover { - background-color: #f2f2f2; - color: #000000; -} - - -/* ----- 右键菜单样式 ----- */ - -html { - font-style: normal; -} \ No newline at end of file diff --git a/src/main/resources/static/layui/css/public.css b/src/main/resources/static/layui/css/public.css deleted file mode 100644 index 0776e96..0000000 --- a/src/main/resources/static/layui/css/public.css +++ /dev/null @@ -1,57 +0,0 @@ -/* ----- 滚动条样式 ----- */ - -::-webkit-scrollbar { - width: 8px; - height: 8px; - background: transparent; -} - -::-webkit-scrollbar-button:vertical { - display: none; -} - -::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { - background-color: #e2e2e2; -} - -::-webkit-scrollbar-thumb { - border-radius: 8px; - background-color: #a6a6a6; -} - -::-webkit-scrollbar-thumb:vertical:hover { - background-color: #7f7f7f; -} - -::-webkit-scrollbar-thumb:vertical:active { - background-color: rgba(0, 0, 0, .38); -} - -/* ----- 滚动条样式 ----- */ - - -* { - box-sizing: border-box; -} - -.page-loading { - position: fixed; - top: 0; - left: 0; - right: 0; - bottom: 0; - background-color: #fff; -} - -.rubik-loader { - width: 64px; - height: 64px; - position: absolute; - left: 50%; - top: 50%; - -webkit-transform: translate(-50%, -50%); - transform: translate(-50%, -50%); - background-image: url(/images/loading.gif); - background-repeat: no-repeat; - background-position: center; -} diff --git a/src/main/resources/static/layui/home/index.html b/src/main/resources/static/layui/home/index.html deleted file mode 100644 index da2ae7e..0000000 --- a/src/main/resources/static/layui/home/index.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - 222 - - - - -
-
-
- -

Hello World

-

Hello World

-

Hello World

- -

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

-

Hello World

- - - - - - - \ No newline at end of file diff --git a/src/main/resources/static/layui/images/avatar.png b/src/main/resources/static/layui/images/avatar.png deleted file mode 100644 index 25e992d..0000000 Binary files a/src/main/resources/static/layui/images/avatar.png and /dev/null differ diff --git a/src/main/resources/static/layui/images/clear.png b/src/main/resources/static/layui/images/clear.png deleted file mode 100644 index 7852967..0000000 Binary files a/src/main/resources/static/layui/images/clear.png and /dev/null differ diff --git a/src/main/resources/static/layui/images/loading.gif b/src/main/resources/static/layui/images/loading.gif deleted file mode 100644 index 071ecd6..0000000 Binary files a/src/main/resources/static/layui/images/loading.gif and /dev/null differ diff --git a/src/main/resources/static/layui/images/main.png b/src/main/resources/static/layui/images/main.png deleted file mode 100644 index 7a548a6..0000000 Binary files a/src/main/resources/static/layui/images/main.png and /dev/null differ diff --git a/src/main/resources/static/layui/images/security.png b/src/main/resources/static/layui/images/security.png deleted file mode 100644 index 250c4cb..0000000 Binary files a/src/main/resources/static/layui/images/security.png and /dev/null differ diff --git a/src/main/resources/static/layui/js/common.js b/src/main/resources/static/layui/js/common.js deleted file mode 100644 index 468d71e..0000000 --- a/src/main/resources/static/layui/js/common.js +++ /dev/null @@ -1,7 +0,0 @@ -$(document).ready(function () { - - // 加载完成后关闭加载动画. - setTimeout(function () { - $(".page-loading").hide(); - }, 500); -}); \ No newline at end of file diff --git a/src/main/resources/static/layui/js/jquery.js b/src/main/resources/static/layui/js/jquery.js deleted file mode 100644 index eb7c331..0000000 --- a/src/main/resources/static/layui/js/jquery.js +++ /dev/null @@ -1,4432 +0,0 @@ -/*! - * jQuery JavaScript Library v1.3.2 - * http://jquery.com/ - * - * Copyright (c) 2009 John Resig - * Dual licensed under the MIT and GPL licenses. - * http://docs.jquery.com/License - * - * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) - * Revision: 6246 - */ -(function () { - - var - // Will speed up references to window, and allows munging its name. - window = this, - // Will speed up references to undefined, and allows munging its name. - undefined, - // Map over jQuery in case of overwrite - _jQuery = window.jQuery, - // Map over the $ in case of overwrite - _$ = window.$, - - jQuery = window.jQuery = window.$ = function (selector, context) { - // The jQuery object is actually just the init constructor 'enhanced' - return new jQuery.fn.init(selector, context); - }, - - // A simple way to check for HTML strings or ID strings - // (both of which we optimize for) - quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/, - // Is it a simple selector - isSimple = /^.[^:#\[\.,]*$/; - - jQuery.fn = jQuery.prototype = { - init: function (selector, context) { - // Make sure that a selection was provided - selector = selector || document; - - // Handle $(DOMElement) - if (selector.nodeType) { - this[0] = selector; - this.length = 1; - this.context = selector; - return this; - } - // Handle HTML strings - if (typeof selector === "string") { - // Are we dealing with HTML string or an ID? - var match = quickExpr.exec(selector); - - // Verify a match, and that no context was specified for #id - if (match && (match[1] || !context)) { - - // HANDLE: $(html) -> $(array) - if (match[1]) - selector = jQuery.clean([match[1]], context); - - // HANDLE: $("#id") - else { - var elem = document.getElementById(match[3]); - - // Handle the case where IE and Opera return items - // by name instead of ID - if (elem && elem.id != match[3]) - return jQuery().find(selector); - - // Otherwise, we inject the element directly into the jQuery object - var ret = jQuery(elem || []); - ret.context = document; - ret.selector = selector; - return ret; - } - - // HANDLE: $(expr, [context]) - // (which is just equivalent to: $(content).find(expr) - } else - return jQuery(context).find(selector); - - // HANDLE: $(function) - // Shortcut for document ready - } else if (jQuery.isFunction(selector)) - return jQuery(document).ready(selector); - - // Make sure that old selector state is passed along - if (selector.selector && selector.context) { - this.selector = selector.selector; - this.context = selector.context; - } - - return this.setArray(jQuery.isArray(selector) ? - selector : - jQuery.makeArray(selector)); - }, - - // Start with an empty selector - selector: "", - - // The current version of jQuery being used - jquery: "1.3.2", - - // The number of elements contained in the matched element set - size: function () { - return this.length; - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function (num) { - return num === undefined ? - - // Return a 'clean' array - Array.prototype.slice.call(this) : - - // Return just the object - this[num]; - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function (elems, name, selector) { - // Build a new jQuery matched element set - var ret = jQuery(elems); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - ret.context = this.context; - - if (name === "find") - ret.selector = this.selector + (this.selector ? " " : "") + selector; - else if (name) - ret.selector = this.selector + "." + name + "(" + selector + ")"; - - // Return the newly-formed element set - return ret; - }, - - // Force the current matched set of elements to become - // the specified array of elements (destroying the stack in the process) - // You should use pushStack() in order to do this, but maintain the stack - setArray: function (elems) { - // Resetting the length to 0, then using the native Array push - // is a super-fast way to populate an object with array-like properties - this.length = 0; - Array.prototype.push.apply(this, elems); - - return this; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function (callback, args) { - return jQuery.each(this, callback, args); - }, - - // Determine the position of an element within - // the matched set of elements - index: function (elem) { - // Locate the position of the desired element - return jQuery.inArray( - // If it receives a jQuery object, the first element is used - elem && elem.jquery ? elem[0] : elem - , this); - }, - - attr: function (name, value, type) { - var options = name; - - // Look for the case where we're accessing a style value - if (typeof name === "string") - if (value === undefined) - return this[0] && jQuery[type || "attr"](this[0], name); - - else { - options = {}; - options[name] = value; - } - - // Check to see if we're setting style values - return this.each(function (i) { - // Set all the styles - for (name in options) - jQuery.attr( - type ? - this.style : - this, - name, jQuery.prop(this, options[name], type, i, name) - ); - }); - }, - - css: function (key, value) { - // ignore negative width and height values - if ((key == 'width' || key == 'height') && parseFloat(value) < 0) - value = undefined; - return this.attr(key, value, "curCSS"); - }, - - text: function (text) { - if (typeof text !== "object" && text != null) - return this.empty().append((this[0] && this[0].ownerDocument || document).createTextNode(text)); - - var ret = ""; - - jQuery.each(text || this, function () { - jQuery.each(this.childNodes, function () { - if (this.nodeType != 8) - ret += this.nodeType != 1 ? - this.nodeValue : - jQuery.fn.text([this]); - }); - }); - - return ret; - }, - - wrapAll: function (html) { - if (this[0]) { - // The elements to wrap the target around - var wrap = jQuery(html, this[0].ownerDocument).clone(); - - if (this[0].parentNode) - wrap.insertBefore(this[0]); - - wrap.map(function () { - var elem = this; - - while (elem.firstChild) - elem = elem.firstChild; - - return elem; - }).append(this); - } - - return this; - }, - - wrapInner: function (html) { - return this.each(function () { - jQuery(this).contents().wrapAll(html); - }); - }, - - wrap: function (html) { - return this.each(function () { - jQuery(this).wrapAll(html); - }); - }, - - append: function () { - return this.domManip(arguments, true, function (elem) { - if (this.nodeType == 1) - this.appendChild(elem); - }); - }, - - prepend: function () { - return this.domManip(arguments, true, function (elem) { - if (this.nodeType == 1) - this.insertBefore(elem, this.firstChild); - }); - }, - - before: function () { - return this.domManip(arguments, false, function (elem) { - this.parentNode.insertBefore(elem, this); - }); - }, - - after: function () { - return this.domManip(arguments, false, function (elem) { - this.parentNode.insertBefore(elem, this.nextSibling); - }); - }, - - end: function () { - return this.prevObject || jQuery([]); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: [].push, - sort: [].sort, - splice: [].splice, - - find: function (selector) { - if (this.length === 1) { - var ret = this.pushStack([], "find", selector); - ret.length = 0; - jQuery.find(selector, this[0], ret); - return ret; - } else { - return this.pushStack(jQuery.unique(jQuery.map(this, function (elem) { - return jQuery.find(selector, elem); - })), "find", selector); - } - }, - - clone: function (events) { - // Do the clone - var ret = this.map(function () { - if (!jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this)) { - // IE copies events bound via attachEvent when - // using cloneNode. Calling detachEvent on the - // clone will also remove the events from the orignal - // In order to get around this, we use innerHTML. - // Unfortunately, this means some modifications to - // attributes in IE that are actually only stored - // as properties will not be copied (such as the - // the name attribute on an input). - var html = this.outerHTML; - if (!html) { - var div = this.ownerDocument.createElement("div"); - div.appendChild(this.cloneNode(true)); - html = div.innerHTML; - } - - return jQuery.clean([html.replace(/ jQuery\d+="(?:\d+|null)"/g, "").replace(/^\s*/, "")])[0]; - } else - return this.cloneNode(true); - }); - - // Copy the events from the original to the clone - if (events === true) { - var orig = this.find("*").andSelf(), i = 0; - - ret.find("*").andSelf().each(function () { - if (this.nodeName !== orig[i].nodeName) - return; - - var events = jQuery.data(orig[i], "events"); - - for (var type in events) { - for (var handler in events[type]) { - jQuery.event.add(this, type, events[type][handler], events[type][handler].data); - } - } - - i++; - }); - } - - // Return the cloned set - return ret; - }, - - filter: function (selector) { - return this.pushStack( - jQuery.isFunction(selector) && - jQuery.grep(this, function (elem, i) { - return selector.call(elem, i); - }) || - - jQuery.multiFilter(selector, jQuery.grep(this, function (elem) { - return elem.nodeType === 1; - })), "filter", selector); - }, - - closest: function (selector) { - var pos = jQuery.expr.match.POS.test(selector) ? jQuery(selector) : null, - closer = 0; - - return this.map(function () { - var cur = this; - while (cur && cur.ownerDocument) { - if (pos ? pos.index(cur) > -1 : jQuery(cur).is(selector)) { - jQuery.data(cur, "closest", closer); - return cur; - } - cur = cur.parentNode; - closer++; - } - }); - }, - - not: function (selector) { - if (typeof selector === "string") - // test special case where just one selector is passed in - if (isSimple.test(selector)) - return this.pushStack(jQuery.multiFilter(selector, this, true), "not", selector); - else - selector = jQuery.multiFilter(selector, this); - - var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType; - return this.filter(function () { - return isArrayLike ? jQuery.inArray(this, selector) < 0 : this != selector; - }); - }, - - add: function (selector) { - return this.pushStack(jQuery.unique(jQuery.merge( - this.get(), - typeof selector === "string" ? - jQuery(selector) : - jQuery.makeArray(selector) - ))); - }, - - is: function (selector) { - return !!selector && jQuery.multiFilter(selector, this).length > 0; - }, - - hasClass: function (selector) { - return !!selector && this.is("." + selector); - }, - - val: function (value) { - if (value === undefined) { - var elem = this[0]; - - if (elem) { - if (jQuery.nodeName(elem, 'option')) - return (elem.attributes.value || {}).specified ? elem.value : elem.text; - - // We need to handle select boxes special - if (jQuery.nodeName(elem, "select")) { - var index = elem.selectedIndex, - values = [], - options = elem.options, - one = elem.type == "select-one"; - - // Nothing was selected - if (index < 0) - return null; - - // Loop through all the selected options - for (var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++) { - var option = options[i]; - - if (option.selected) { - // Get the specifc value for the option - value = jQuery(option).val(); - - // We don't need an array for one selects - if (one) - return value; - - // Multi-Selects return an array - values.push(value); - } - } - - return values; - } - - // Everything else, we just grab the value - return (elem.value || "").replace(/\r/g, ""); - - } - - return undefined; - } - - if (typeof value === "number") - value += ''; - - return this.each(function () { - if (this.nodeType != 1) - return; - - if (jQuery.isArray(value) && /radio|checkbox/.test(this.type)) - this.checked = (jQuery.inArray(this.value, value) >= 0 || - jQuery.inArray(this.name, value) >= 0); - - else if (jQuery.nodeName(this, "select")) { - var values = jQuery.makeArray(value); - - jQuery("option", this).each(function () { - this.selected = (jQuery.inArray(this.value, values) >= 0 || - jQuery.inArray(this.text, values) >= 0); - }); - - if (!values.length) - this.selectedIndex = -1; - - } else - this.value = value; - }); - }, - - html: function (value) { - return value === undefined ? - (this[0] ? - this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g, "") : - null) : - this.empty().append(value); - }, - - replaceWith: function (value) { - return this.after(value).remove(); - }, - - eq: function (i) { - return this.slice(i, +i + 1); - }, - - slice: function () { - return this.pushStack(Array.prototype.slice.apply(this, arguments), - "slice", Array.prototype.slice.call(arguments).join(",")); - }, - - map: function (callback) { - return this.pushStack(jQuery.map(this, function (elem, i) { - return callback.call(elem, i, elem); - })); - }, - - andSelf: function () { - return this.add(this.prevObject); - }, - - domManip: function (args, table, callback) { - if (this[0]) { - var fragment = (this[0].ownerDocument || this[0]).createDocumentFragment(), - scripts = jQuery.clean(args, (this[0].ownerDocument || this[0]), fragment), - first = fragment.firstChild; - - if (first) - for (var i = 0, l = this.length; i < l; i++) - callback.call(root(this[i], first), this.length > 1 || i > 0 ? - fragment.cloneNode(true) : fragment); - - if (scripts) - jQuery.each(scripts, evalScript); - } - - return this; - - function root(elem, cur) { - return table && jQuery.nodeName(elem, "table") && jQuery.nodeName(cur, "tr") ? - (elem.getElementsByTagName("tbody")[0] || - elem.appendChild(elem.ownerDocument.createElement("tbody"))) : - elem; - } - } - }; - -// Give the init function the jQuery prototype for later instantiation - jQuery.fn.init.prototype = jQuery.fn; - - function evalScript(i, elem) { - if (elem.src) - jQuery.ajax({ - url: elem.src, - async: false, - dataType: "script" - }); - - else - jQuery.globalEval(elem.text || elem.textContent || elem.innerHTML || ""); - - if (elem.parentNode) - elem.parentNode.removeChild(elem); - } - - function now() { - return +new Date; - } - - jQuery.extend = jQuery.fn.extend = function () { - // copy reference to target object - var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options; - - // Handle a deep copy situation - if (typeof target === "boolean") { - deep = target; - target = arguments[1] || {}; - // skip the boolean and the target - i = 2; - } - - // Handle case when target is a string or something (possible in deep copy) - if (typeof target !== "object" && !jQuery.isFunction(target)) - target = {}; - - // extend jQuery itself if only one argument is passed - if (length == i) { - target = this; - --i; - } - - for (; i < length; i++) - // Only deal with non-null/undefined values - if ((options = arguments[i]) != null) - // Extend the base object - for (var name in options) { - var src = target[name], copy = options[name]; - - // Prevent never-ending loop - if (target === copy) - continue; - - // Recurse if we're merging object values - if (deep && copy && typeof copy === "object" && !copy.nodeType) - target[name] = jQuery.extend(deep, - // Never move original objects, clone them - src || (copy.length != null ? [] : {}) - , copy); - - // Don't bring in undefined values - else if (copy !== undefined) - target[name] = copy; - - } - - // Return the modified object - return target; - }; - -// exclude the following css properties to add px - var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i, - // cache defaultView - defaultView = document.defaultView || {}, - toString = Object.prototype.toString; - - jQuery.extend({ - noConflict: function (deep) { - window.$ = _$; - - if (deep) - window.jQuery = _jQuery; - - return jQuery; - }, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function (obj) { - return toString.call(obj) === "[object Function]"; - }, - - isArray: function (obj) { - return toString.call(obj) === "[object Array]"; - }, - - // check if an element is in a (or is an) XML document - isXMLDoc: function (elem) { - return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" || - !!elem.ownerDocument && jQuery.isXMLDoc(elem.ownerDocument); - }, - - // Evalulates a script in a global context - globalEval: function (data) { - if (data && /\S/.test(data)) { - // Inspired by code by Andrea Giammarchi - // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html - var head = document.getElementsByTagName("head")[0] || document.documentElement, - script = document.createElement("script"); - - script.type = "text/javascript"; - if (jQuery.support.scriptEval) - script.appendChild(document.createTextNode(data)); - else - script.text = data; - - // Use insertBefore instead of appendChild to circumvent an IE6 bug. - // This arises when a base node is used (#2709). - head.insertBefore(script, head.firstChild); - head.removeChild(script); - } - }, - - nodeName: function (elem, name) { - return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase(); - }, - - // args is for internal usage only - each: function (object, callback, args) { - var name, i = 0, length = object.length; - - if (args) { - if (length === undefined) { - for (name in object) - if (callback.apply(object[name], args) === false) - break; - } else - for (; i < length;) - if (callback.apply(object[i++], args) === false) - break; - - // A special, fast, case for the most common use of each - } else { - if (length === undefined) { - for (name in object) - if (callback.call(object[name], name, object[name]) === false) - break; - } else - for (var value = object[0]; - i < length && callback.call(value, i, value) !== false; value = object[++i]) { - } - } - - return object; - }, - - prop: function (elem, value, type, i, name) { - // Handle executable functions - if (jQuery.isFunction(value)) - value = value.call(elem, i); - - // Handle passing in a number to a CSS property - return typeof value === "number" && type == "curCSS" && !exclude.test(name) ? - value + "px" : - value; - }, - - className: { - // internal only, use addClass("class") - add: function (elem, classNames) { - jQuery.each((classNames || "").split(/\s+/), function (i, className) { - if (elem.nodeType == 1 && !jQuery.className.has(elem.className, className)) - elem.className += (elem.className ? " " : "") + className; - }); - }, - - // internal only, use removeClass("class") - remove: function (elem, classNames) { - if (elem.nodeType == 1) - elem.className = classNames !== undefined ? - jQuery.grep(elem.className.split(/\s+/), function (className) { - return !jQuery.className.has(classNames, className); - }).join(" ") : - ""; - }, - - // internal only, use hasClass("class") - has: function (elem, className) { - return elem && jQuery.inArray(className, (elem.className || elem).toString().split(/\s+/)) > -1; - } - }, - - // A method for quickly swapping in/out CSS properties to get correct calculations - swap: function (elem, options, callback) { - var old = {}; - // Remember the old values, and insert the new ones - for (var name in options) { - old[name] = elem.style[name]; - elem.style[name] = options[name]; - } - - callback.call(elem); - - // Revert the old values - for (var name in options) - elem.style[name] = old[name]; - }, - - css: function (elem, name, force, extra) { - if (name == "width" || name == "height") { - var val, props = {position: "absolute", visibility: "hidden", display: "block"}, - which = name == "width" ? ["Left", "Right"] : ["Top", "Bottom"]; - - function getWH() { - val = name == "width" ? elem.offsetWidth : elem.offsetHeight; - - if (extra === "border") - return; - - jQuery.each(which, function () { - if (!extra) - val -= parseFloat(jQuery.curCSS(elem, "padding" + this, true)) || 0; - if (extra === "margin") - val += parseFloat(jQuery.curCSS(elem, "margin" + this, true)) || 0; - else - val -= parseFloat(jQuery.curCSS(elem, "border" + this + "Width", true)) || 0; - }); - } - - if (elem.offsetWidth !== 0) - getWH(); - else - jQuery.swap(elem, props, getWH); - - return Math.max(0, Math.round(val)); - } - - return jQuery.curCSS(elem, name, force); - }, - - curCSS: function (elem, name, force) { - var ret, style = elem.style; - - // We need to handle opacity special in IE - if (name == "opacity" && !jQuery.support.opacity) { - ret = jQuery.attr(style, "opacity"); - - return ret == "" ? - "1" : - ret; - } - - // Make sure we're using the right name for getting the float value - if (name.match(/float/i)) - name = styleFloat; - - if (!force && style && style[name]) - ret = style[name]; - - else if (defaultView.getComputedStyle) { - - // Only "float" is needed here - if (name.match(/float/i)) - name = "float"; - - name = name.replace(/([A-Z])/g, "-$1").toLowerCase(); - - var computedStyle = defaultView.getComputedStyle(elem, null); - - if (computedStyle) - ret = computedStyle.getPropertyValue(name); - - // We should always get a number back from opacity - if (name == "opacity" && ret == "") - ret = "1"; - - } else if (elem.currentStyle) { - var camelCase = name.replace(/\-(\w)/g, function (all, letter) { - return letter.toUpperCase(); - }); - - ret = elem.currentStyle[name] || elem.currentStyle[camelCase]; - - // From the awesome hack by Dean Edwards - // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 - - // If we're not dealing with a regular pixel number - // but a number that has a weird ending, we need to convert it to pixels - if (!/^\d+(px)?$/i.test(ret) && /^\d/.test(ret)) { - // Remember the original values - var left = style.left, rsLeft = elem.runtimeStyle.left; - - // Put in the new values to get a computed value out - elem.runtimeStyle.left = elem.currentStyle.left; - style.left = ret || 0; - ret = style.pixelLeft + "px"; - - // Revert the changed values - style.left = left; - elem.runtimeStyle.left = rsLeft; - } - } - - return ret; - }, - - clean: function (elems, context, fragment) { - context = context || document; - - // !context.createElement fails in IE with an error but returns typeof 'object' - if (typeof context.createElement === "undefined") - context = context.ownerDocument || context[0] && context[0].ownerDocument || document; - - // If a single string is passed in and it's a single tag - // just do a createElement and skip the rest - if (!fragment && elems.length === 1 && typeof elems[0] === "string") { - var match = /^<(\w+)\s*\/?>$/.exec(elems[0]); - if (match) - return [context.createElement(match[1])]; - } - - var ret = [], scripts = [], div = context.createElement("div"); - - jQuery.each(elems, function (i, elem) { - if (typeof elem === "number") - elem += ''; - - if (!elem) - return; - - // Convert html string into DOM nodes - if (typeof elem === "string") { - // Fix "XHTML"-style tags in all browsers - elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function (all, front, tag) { - return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? - all : - front + ">"; - }); - - // Trim whitespace, otherwise indexOf won't work as expected - var tags = elem.replace(/^\s+/, "").substring(0, 10).toLowerCase(); - - var wrap = - // option or optgroup - !tags.indexOf("", ""] || - - !tags.indexOf("", ""] || - - tags.match(/^<(thead|tbody|tfoot|colg|cap)/) && - [1, "", "
"] || - - !tags.indexOf("", ""] || - - // matched above - (!tags.indexOf("", ""] || - - !tags.indexOf("", ""] || - - // IE can't serialize and