diff --git a/.gitignore b/.gitignore index 632a353..0e85465 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ .idea/ *.iml -target/ \ No newline at end of file +target/ +/hehe.txt +/jrebel-classpath-216.jar +/jrebel-classpath-7744.jar +/AISearch.iml +/src/main/resources/rebel-remote.xml diff --git a/README.md b/README.md index d858272..22bf62d 100644 --- a/README.md +++ b/README.md @@ -41,4 +41,8 @@ aisearch前后端分离完成,这是前端工程vue-cli地址https://github.com/ tika支持各种类型的文件,doc,java,js,html,md,excel,pdf等 2020年2月9日18:02:00 -发布1.1.0 后台管理完成,集成redis缓存和activemq消息中间件 \ No newline at end of file +发布1.1.0 后台管理完成,集成redis缓存和activemq消息中间件 + +2020年2月15日20:07:01 +整合FastDFS实现图床和网盘功能 + diff --git a/pom.xml b/pom.xml index 6b5c1eb..c234ce6 100644 --- a/pom.xml +++ b/pom.xml @@ -26,6 +26,29 @@ + + + com.github.tobato + fastdfs-client + 1.26.5 + + + + cz.mallat.uasparser + uasparser + 0.6.2 + + + net.sourceforge.jregex + jregex + 1.2_01 + + + + nl.bitwalker + UserAgentUtils + 1.2.4 + org.springframework.boot @@ -60,6 +83,13 @@ + + + + + org.springframework.boot + spring-boot-starter-quartz + commons-dbutils @@ -222,6 +252,12 @@ c3p0 0.9.1.1 + + + javax.persistence + persistence-api + 1.0 + commons-dbcp commons-dbcp @@ -232,6 +268,11 @@ json 20170516 + @@ -303,4 +344,4 @@ - \ No newline at end of file + diff --git a/src/main/java/com/zjj/aisearch/Demo.java b/src/main/java/com/zjj/aisearch/Demo.java index 23a2845..f930920 100644 --- a/src/main/java/com/zjj/aisearch/Demo.java +++ b/src/main/java/com/zjj/aisearch/Demo.java @@ -18,7 +18,6 @@ public class Demo { * java基础 * 次要: * mysql - * * vue,js * * thymeleaf: diff --git a/src/main/java/com/zjj/aisearch/SpringbootApplication.java b/src/main/java/com/zjj/aisearch/SpringbootApplication.java index 331746e..aecbd81 100644 --- a/src/main/java/com/zjj/aisearch/SpringbootApplication.java +++ b/src/main/java/com/zjj/aisearch/SpringbootApplication.java @@ -4,7 +4,7 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.jms.annotation.EnableJms; +import org.springframework.boot.web.servlet.ServletComponentScan; import tk.mybatis.spring.annotation.MapperScan; /** @@ -17,13 +17,11 @@ @SpringBootApplication @MapperScan(basePackages = "com.zjj.aisearch.mapper") @EnableConfigurationProperties(ConfigBean.class) -@EnableJms //启动消息队列 +//扫描servlet +//@EnableJms //启动消息队列 +@ServletComponentScan public class SpringbootApplication { - - public static void main(String[] args) { - SpringApplication.run(SpringbootApplication.class, args); } - } diff --git a/src/main/java/com/zjj/aisearch/activemq/ConsumerService.java b/src/main/java/com/zjj/aisearch/activemq/ConsumerService.java index 6e84569..6943eed 100644 --- a/src/main/java/com/zjj/aisearch/activemq/ConsumerService.java +++ b/src/main/java/com/zjj/aisearch/activemq/ConsumerService.java @@ -6,7 +6,6 @@ import org.springframework.jms.annotation.JmsListener; import org.springframework.jms.core.JmsMessagingTemplate; import org.springframework.messaging.handler.annotation.SendTo; -import org.springframework.stereotype.Component; import javax.jms.Queue; @@ -16,7 +15,7 @@ * @date 2018/9/15 18:36 * */ -@Component +//@Component @Slf4j public class ConsumerService { diff --git a/src/main/java/com/zjj/aisearch/config/FdfsConfiguration.java b/src/main/java/com/zjj/aisearch/config/FdfsConfiguration.java new file mode 100644 index 0000000..c4e70f4 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/config/FdfsConfiguration.java @@ -0,0 +1,16 @@ +package com.zjj.aisearch.config; + +import com.github.tobato.fastdfs.FdfsClientConfig; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.EnableMBeanExport; +import org.springframework.context.annotation.Import; +import org.springframework.jmx.support.RegistrationPolicy; + +/** + * + */ +@Configuration +@Import(FdfsClientConfig.class) // 导入FastDFS-Client组件 +@EnableMBeanExport(registration = RegistrationPolicy.IGNORE_EXISTING) // 解决jmx重复注册bean的问题 +public class FdfsConfiguration { +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/config/QuartzConfig.java b/src/main/java/com/zjj/aisearch/config/QuartzConfig.java new file mode 100644 index 0000000..ccfb8bf --- /dev/null +++ b/src/main/java/com/zjj/aisearch/config/QuartzConfig.java @@ -0,0 +1,27 @@ +package com.zjj.aisearch.config; + +import com.zjj.aisearch.quartz.DateTimeJob; +import org.quartz.*; +import org.springframework.context.annotation.Bean; + +/*@Configuration*/ +public class QuartzConfig { + @Bean + public JobDetail printTimeJobDetail(){ + return JobBuilder.newJob(DateTimeJob.class)//PrintTimeJob我们的业务类 + .withIdentity("DateTimeJob")//可以给该JobDetail起一个id + //每个JobDetail内都有一个Map,包含了关联到这个Job的数据,在Job类中可以通过context获取 + .usingJobData("msg", "Hello World")//关联键值对 + .storeDurably()//即使没有Trigger关联时,也不需要删除该JobDetail + .build(); + } + @Bean + public Trigger printTimeJobTrigger() { + CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule("0/30 * * * * ?"); + return TriggerBuilder.newTrigger() + .forJob(printTimeJobDetail())//关联上述的JobDetail + .withIdentity("quartzTaskService")//给Trigger起个名字 + .withSchedule(cronScheduleBuilder) + .build(); + } +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/controller/BaseController.java b/src/main/java/com/zjj/aisearch/controller/BaseController.java deleted file mode 100644 index cc099e2..0000000 --- a/src/main/java/com/zjj/aisearch/controller/BaseController.java +++ /dev/null @@ -1,200 +0,0 @@ -package com.zjj.aisearch.controller; - -import com.zjj.aisearch.model.ResponseResult; -import com.zjj.aisearch.model.User; -import io.swagger.annotations.ApiOperation; -import lombok.extern.slf4j.Slf4j; -import org.apache.shiro.SecurityUtils; -import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.apache.shiro.subject.Subject; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.ResponseBody; - -/** - * @program: AISearch - * @description: 跳转Controller,前后端分离可以用nginx或者node.js替代,唯一作用就是跳转页面 - * @author: zjj - * @create: 2019-10-05 02:46:49 - **/ -@Controller -@Slf4j -public class BaseController { - - /** - * 跳转系统操作日志列表 - */ - @GetMapping("/systemloglist") - @RequiresPermissions("user:systemloglist") - @ApiOperation("跳转系统操作日志列表") - public String systemloglist() { - return "systemloglist"; - } - - /** - * 跳转便签记录列表 - */ - @GetMapping("/ainotelist") - @ApiOperation("跳转便签记录列表") - public String ainotelist() { - return "ainotelist"; - } - - /** - * 跳转搜索记录列表 - */ - @GetMapping("/list") - @ApiOperation("跳转搜索记录列表") - public String list() { - return "list"; - } - - /** - * 跳转登录日志列表 - */ - @GetMapping("/loginloglist") - @ApiOperation("跳转登录日志列表") - public String loginloglist() { - return "loginloglist"; - } - - /** - * 跳转退出日志列表 - */ - @GetMapping("/logoutloglist") - @ApiOperation("跳转退出日志列表") - public String logoutloglist() { - return "logoutloglist"; - } - - /** - * 跳转markdown日志列表 - */ - @GetMapping("/markdownlist") - @ApiOperation("跳转markdown日志列表") - public String markdownlist() { - return "markdownlist"; - } - - /** - * 跳转注册用户列表 - */ - @GetMapping("/userlist") - @ApiOperation("跳转注册用户列表") - public String userlist() { - return "userlist"; - } - - /** - * 跳转editor记录列表 - */ - @GetMapping("/editorlist") - @ApiOperation("跳转editor记录列表") - public String editorlist() { - return "editorlist"; - } - - /** - * 跳风景美食网站 - */ - @GetMapping("/website") - @ApiOperation("跳风景美食网站") - public String website() { - return "website"; - } - - /** - * 跳转到login页面 - * - * @return - */ - @GetMapping("/login") - @ApiOperation("跳转到login页面") - public String login() { - return "login"; - } - - - /** - * 跳转到regist页面 - * - * @return - */ - @GetMapping("/regist") - @ApiOperation("跳转到regist页面") - public String regist() { - return "regist"; - } - - /** - * 跳转到随机文章页面 - * - * @return - */ - @GetMapping("/article") - @ApiOperation("跳转到随机文章页面") - public String article() { - return "article"; - } - - /** - * 跳转到未授权页面 - * - * @return - */ - /* @GetMapping("/noauth") - @ApiOperation("跳转到未授权页面") - public String noauth() { - - return "noauth"; - }*/ - - /** - * 为了适配前后端分离模式 - * - * @return - */ - @GetMapping("/noauth") - @ApiOperation("跳转到未授权页面") - @ResponseBody - public ResponseResult noauth() { - ResponseResult responseResult = new ResponseResult(); - responseResult.setStatus(-1); - responseResult.setMsg("未授权"); - log.error(responseResult.toString()); - return responseResult; - } - - /** - * 跳转到404页面 - * - * @return - */ - @GetMapping("/error") - @ApiOperation("跳转到404页面") - public String error() { - return "error"; - } - - /** - * 跳转到搜索详情页面 - * - * @return - */ - @GetMapping("/detail") - @ApiOperation("跳转到搜索详情页面") - public String detail() { - return "detail"; - } - - /** - * 进入首页的唯一入口 - */ - @GetMapping("/index") - @ApiOperation("首页") - public String index() { - Subject subject = SecurityUtils.getSubject(); - log.info("[{}]进入首页", ((User) subject.getPrincipal()).getUsername()); - return "index"; - } -} diff --git a/src/main/java/com/zjj/aisearch/controller/ImgController.java b/src/main/java/com/zjj/aisearch/controller/ImgController.java index 0a5780a..c79d050 100644 --- a/src/main/java/com/zjj/aisearch/controller/ImgController.java +++ b/src/main/java/com/zjj/aisearch/controller/ImgController.java @@ -3,9 +3,11 @@ import com.zjj.aisearch.config.ConfigBean; import com.zjj.aisearch.model.Img; import com.zjj.aisearch.model.ResponseResult; +import com.zjj.aisearch.pojo.dto.DocumentDTO; import com.zjj.aisearch.pojo.dto.FullTextDTO; import com.zjj.aisearch.pojo.entity.Page; import com.zjj.aisearch.repository.FullTextRepository; +import com.zjj.aisearch.repository.impl.DocumentESRepository; import com.zjj.aisearch.service.ImgService; import com.zjj.aisearch.service.UploadFileService; import com.zjj.aisearch.utils.DateTimeUtil; @@ -28,6 +30,8 @@ import java.util.HashMap; import java.util.Map; +import static com.zjj.aisearch.utils.UploadFileUtil.uploadFileCommon; + /** * @program: AISearch * @description: 图片上传 @@ -45,6 +49,9 @@ public class ImgController { @Autowired private FullTextRepository fullTextESRepository; + @Autowired + private DocumentESRepository documentESRepository; + @Autowired private ConfigBean configBean; //获取登录信息 不知道怎么获取不到 @@ -138,7 +145,7 @@ public ResponseResult toqueryDocument(@RequestBody Map map, Http @ApiOperation("获取关键字keyword") @PostMapping("/getKeyword") - public ResponseResult getKeyword(HttpServletRequest request){ + public ResponseResult getKeyword(HttpServletRequest request) { String keyword = (String) request.getSession().getAttribute("keyword"); ResponseResult responseResult = new ResponseResult(); responseResult.setMsg(keyword); @@ -149,48 +156,24 @@ public ResponseResult getKeyword(HttpServletRequest request){ @ApiOperation("查询文档") @PostMapping("/queryDocument") public ResponseResult queryDocument(HttpServletResponse response, HttpServletRequest request) throws IOException { - String keyword = (String) request.getSession().getAttribute("keyword"); + /*String keyword = (String) request.getSession().getAttribute("keyword"); Page jestResult = fullTextESRepository.query(keyword, 1, 20); System.out.println(jestResult); System.out.println(jestResult.getList().toString()); ResponseResult responseResult = new ResponseResult(); responseResult.setData(jestResult.getList()); + return responseResult;*/ + String keyword = (String) request.getSession().getAttribute("keyword"); + Page jestResult = documentESRepository.query(keyword, 1, 500); + System.out.println(jestResult); + System.out.println(jestResult.getList().toString()); + ResponseResult responseResult = new ResponseResult(); + responseResult.setData(jestResult.getList()); return responseResult; } private String uploadFile(String uploadPath, MultipartFile file) { - InputStream inputStream = null; - OutputStream os = null; - String path = null; - String fileName = new Date().getTime() + "_" + file.getOriginalFilename(); - try { - byte[] bs = new byte[1024]; - // 读取到的数据长度 - int len; - // 输出的文件流保存到本地文件 - File tempFile = new File(uploadPath); - if (!tempFile.exists()) { - tempFile.mkdirs(); - } - inputStream = file.getInputStream(); - path = tempFile.getPath() + File.separator + fileName; - os = new FileOutputStream(path); - // 开始读取 - while ((len = inputStream.read(bs)) != -1) { - os.write(bs, 0, len); - } - } catch (IOException e) { - e.printStackTrace(); - } finally { - // 完毕,关闭所有链接 - try { - os.close(); - inputStream.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - return fileName; + return uploadFileCommon(uploadPath, file, true); } } diff --git a/src/main/java/com/zjj/aisearch/controller/IndexController.java b/src/main/java/com/zjj/aisearch/controller/IndexController.java index b2f66e7..b242944 100644 --- a/src/main/java/com/zjj/aisearch/controller/IndexController.java +++ b/src/main/java/com/zjj/aisearch/controller/IndexController.java @@ -6,6 +6,10 @@ import com.zjj.aisearch.model.*; import com.zjj.aisearch.service.IndexService; import com.zjj.aisearch.utils.DateTimeUtil; +import com.zjj.aisearch.utils.IPUtil; +import cz.mallat.uasparser.OnlineUpdater; +import cz.mallat.uasparser.UASparser; +import cz.mallat.uasparser.UserAgentInfo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; @@ -21,6 +25,14 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.InetAddress; +import java.net.URL; +import java.net.UnknownHostException; +import java.nio.charset.Charset; import java.util.Date; import java.util.List; import java.util.Map; @@ -60,6 +72,183 @@ public Object validateUsername(String username) { } } + public String getBrowserName(String agent) { + if (agent.indexOf("msie 7") > 0) { + return "ie7"; + } else if (agent.indexOf("msie 8") > 0) { + return "ie8"; + } else if (agent.indexOf("msie 9") > 0) { + return "ie9"; + } else if (agent.indexOf("msie 10") > 0) { + return "ie10"; + } else if (agent.indexOf("msie") > 0) { + return "ie"; + } else if (agent.indexOf("opera") > 0) { + return "opera"; + } else if (agent.indexOf("opera") > 0) { + return "opera"; + } else if (agent.indexOf("firefox") > 0) { + return "firefox"; + } else if (agent.indexOf("webkit") > 0) { + return "webkit"; + } else if (agent.indexOf("gecko") > 0 && agent.indexOf("rv:11") > 0) { + return "ie11"; + } else { + return "Others"; + } + } + + /** + * + * 获取系统版本信息 + */ + public static String getSystem(HttpServletRequest request) + { + String systenInfo = null; + String header = request.getHeader("user-agent"); + if (header == null || header.equals(""))// 为空都默认win10 + { + systenInfo = "windows10"; + return systenInfo; + } + + // 得到用户的操作系统 + if (header.indexOf("NT 6.1") > 0 || header.indexOf("NT 5") > 0 || header.indexOf("NT 6.3") > 0 || header.indexOf("NT 6.2") > 0 || header.indexOf("NT 6.0") > 0 || header.indexOf("NT 5.1") > 0 + || header.indexOf("NT 5.2") > 0 || header.indexOf("NT 6.0") > 0)// win10一下的都取win7 + { + systenInfo = "windows7"; + } + if (header.indexOf("Mac") > 0)// mac系统 + { + systenInfo = "mac系统"; + } + if (header.indexOf("Unix") > 0)// unix系统 + { + systenInfo = "unix系统"; + } + if (header.indexOf("SunOS") > 0)// solaris系统 + { + systenInfo = "solaris系统"; + } + if (header.indexOf("Linux") > 0)// Linux系统 + { + systenInfo = "linux系统"; + } + if (header.indexOf("Ubuntu") > 0)// ubuntu系统 + { + systenInfo = "ubuntu系统"; + } + if (header.indexOf("iPhone") > 0)// 苹果手机 + { + systenInfo = "苹果手机"; + } + if (header.indexOf("Android") > 0)// 安卓系统 + { + systenInfo = "安卓手机"; + } + if (header.indexOf("NT 10") > 0)// win10 + { + systenInfo = "windows10"; + } + if (header == null || header.equals("") || systenInfo.equals("") || systenInfo == null)// 没找到默认为windows10 + { + systenInfo = "windows10"; + } + return systenInfo; + + } + + /** + * 获取用户真实IP地址,不使用request.getRemoteAddr();的原因是有可能用户使用了代理软件方式避免真实IP地址。 + * 可是,如果通过了多级反向代理的话,X-Forwarded-For的值并不止一个,而是一串IP值,究竟哪个才是真正的用户端的真实IP呢? + * 答案是取X-Forwarded-For中第一个非unknown的有效IP字符串 + * @param request + * @return + */ + private static String getIpAddress(HttpServletRequest request) { + String ip = request.getHeader("x-forwarded-for"); + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("Proxy-Client-IP"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("WL-Proxy-Client-IP"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("HTTP_CLIENT_IP"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("HTTP_X_FORWARDED_FOR"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getRemoteAddr(); + if("127.0.0.1".equals(ip)||"0:0:0:0:0:0:0:1".equals(ip)){ + //根据网卡取本机配置的IP + InetAddress inet=null; + try { + inet = InetAddress.getLocalHost(); + } catch (UnknownHostException e) { + e.printStackTrace(); + } + ip= inet.getHostAddress(); + } + } + return ip; + } + /** + * 获取Ip地址,多级反向代理 + * @param request + * @return + */ + public static String getIpaddr(HttpServletRequest request){ + String ipAddress = request.getHeader("x-forwarded-for"); + if(ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) { + ipAddress = request.getHeader("Proxy-Client-IP"); + } + if(ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) { + ipAddress = request.getHeader("WL-Proxy-Client-IP"); + } + if(ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) { + ipAddress = request.getRemoteAddr(); + if(ipAddress.equals("127.0.0.1") || ipAddress.equals("0:0:0:0:0:0:0:1")){ + //根据网卡取本机配置的IP + InetAddress inet=null; + try { + inet = InetAddress.getLocalHost(); + } catch (UnknownHostException e) { + e.printStackTrace(); + } + ipAddress= inet.getHostAddress(); + } + } + //对于通过多个代理的情况,第一个IP为客户端真实IP,多个IP按照','分割 + if(ipAddress!=null && ipAddress.length()>15){ //"***.***.***.***".length() = 15 + if(ipAddress.indexOf(",")>0){ + ipAddress = ipAddress.substring(0,ipAddress.indexOf(",")); + } + } + return ipAddress; + } + public static String getMyIP() throws IOException { + String url="http://ip.chinaz.com/getip.aspx"; + InputStream is = new URL(url).openStream(); + try { + BufferedReader rd = new BufferedReader(new InputStreamReader(is, Charset.forName("UTF-8"))); + + StringBuilder sb = new StringBuilder(); + int cp; + while ((cp = rd.read()) != -1) { + sb.append((char) cp); + } + String jsonText = sb.toString();; + jsonText=jsonText.replaceAll("'", ""); + jsonText=jsonText.substring(1,jsonText.length()-1); + jsonText=jsonText.replaceAll(",", "
"); + return jsonText; + } finally { + is.close(); + // System.out.println("同时 从这里也能看出 即便return了,仍然会执行finally的!"); + } + } /** * login.html,ajax发送的登录请求 * UserInfo 包含浏览器传过来的所有信息 @@ -72,7 +261,48 @@ public Object validateUsername(String username) { */ @RequestMapping("/tologin") @ApiOperation(value = "登录") - public Object tologin(@RequestBody UserInfo userInfo) { + public Object tologin(@RequestBody UserInfo userInfo,HttpServletRequest request) throws IOException { + System.out.println(IPUtil.getPublicIp()); + System.out.println(getIpaddr(request)); + System.out.println(IPUtil.getIpAddress(request)); + System.out.println(getSystem(request)); + UASparser uasParser = new UASparser(OnlineUpdater.getVendoredInputStream()); + UserAgentInfo userAgentInfo = uasParser.parse(request.getHeader("User-Agent")); + System.out.println("操作系统名称:"+userAgentInfo.getOsFamily());// + System.out.println("操作系统:"+userAgentInfo.getOsName());// + System.out.println("浏览器名称:"+userAgentInfo.getUaFamily());// + System.out.println("浏览器版本:"+userAgentInfo.getBrowserVersionInfo());// + System.out.println("设备类型:"+userAgentInfo.getDeviceType()); + System.out.println("浏览器:"+userAgentInfo.getUaName()); + System.out.println("类型:"+userAgentInfo.getType()); + /* //获取浏览器信息 + String ua = request.getHeader("User-Agent"); + System.out.println(ua); +//转成UserAgent对象 + UserAgent userAgent = UserAgent.parseUserAgentString(ua); +//获取浏览器信息 + Browser browser = userAgent.getBrowser(); +//获取系统信息 + OperatingSystem os = userAgent.getOperatingSystem(); + System.out.println(os.isMobileDevice()); +//系统名称 + String system = os.getName(); +//浏览器名称 + String browserName = browser.getName(); + System.out.println(browser.getName()); + System.out.println(browser.getBrowserType()); + System.out.println(browser.getGroup()); + System.out.println(browser.getVersion(ua)); + System.out.println(browser.getManufacturer()); + System.out.println(browser.getRenderingEngine()); + System.out.println(os.getName()); + System.out.println(os.getGroup()); + System.out.println(os.getManufacturer()); + System.out.println(os.getDeviceType());*/ + /* + String agent=request.getHeader("User-Agent").toLowerCase(); + System.out.println(agent); + System.out.println("浏览器版本:"+getBrowserName(agent));*/ log.info("上传目录:" + configBean.getImgDir()); String username = userInfo.getUser().getUsername(); String password = userInfo.getUser().getPassword(); @@ -102,36 +332,58 @@ public Object tologin(@RequestBody UserInfo userInfo) { token = JWT.create().withAudience(user.getUsername()) .sign(Algorithm.HMAC256(user.getPassword())); log.error(token); - //插入本次登录的浏览器信息:型号,版本,系统类型 - BrowserInfo browserInfo = new BrowserInfo(); +BrowserInfo browserInfo = new BrowserInfo(); +browserInfo.setBrowserVersion(userAgentInfo.getBrowserVersionInfo()); +browserInfo.setBrowserType(userAgentInfo.getUaFamily()); +browserInfo.setSystem(getSystem(request)); + indexServiceImpl.insertBrowserInfo(browserInfo); + //返回自动递增的ID + String browserInfoId = browserInfo.getBrowserInfoId(); + Location location = new Location(); + // + location.setIp(getIpaddr(request)); + location.setLocation("重庆市重庆市"); + location.setLocalIp(getIpAddress(request)); + location.setX("29.56471"); + location.setY("106.55073"); + location.setKeyword(userAgentInfo.getDeviceType()); + indexServiceImpl.insertLocation(location); + //返回自动递增的ID + String locationId = location.getLocationId(); +//插入登录日志 + Integer userId = user.getId(); + LoginLog loginLog = getLoginLog(browserInfoId, locationId, userId); + indexServiceImpl.insertLoginLog(loginLog); + //返回本次登录日志id + Integer loginLogId = loginLog.getId(); - browserInfo.setSystem(userInfo.getBrowserInfo()[0]); - browserInfo.setBrowserType(userInfo.getBrowserInfo()[1]); - browserInfo.setBrowserVersion(userInfo.getBrowserInfo()[2]); + + log.info("[{}]正在登陆,登录ID为[{}]", username, loginLogId); + + Session session = subject.getSession(); + //往session存入用户数据,和登录loginLogId,用于判断是否登录 + session.setAttribute("user", user); + session.setAttribute("loginLogId", loginLogId); + + //插入系统日志 + SystemLog systemLog = getSystemLog(username, loginLogId, "login?", "username="); + indexServiceImpl.insertSystemLog(systemLog); + //插入本次登录的浏览器信息:型号,版本,系统类型 + /*BrowserInfo browserInfo = insertBrowserInfo(userInfo); indexServiceImpl.insertBrowserInfo(browserInfo); //返回自动递增的ID String browserInfoId = browserInfo.getBrowserInfoId(); //插入位置信息:X,Y,公网IP,地点,设备类型 - Location location = new Location(); - location.setIp(userInfo.getLocation()[0]); - location.setLocation(userInfo.getLocation()[1]); - location.setLocalIp(userInfo.getLocalIp()); - location.setX(userInfo.getLocation()[2]); - location.setY(userInfo.getLocation()[3]); - location.setKeyword(userInfo.getPcOrPhone()); + Location location = insertLocationInfo(userInfo); indexServiceImpl.insertLocation(location); //返回自动递增的ID String locationId = location.getLocationId(); //插入登录日志 Integer userId = user.getId(); - LoginLog loginLog = new LoginLog(); - loginLog.setCreatetime(DateTimeUtil.dateToStr(new Date(), "yyyy-MM-dd HH:mm:ss")); - loginLog.setBrowserInfoId(browserInfoId); - loginLog.setLocationId(locationId); - loginLog.setUserId(userId); + LoginLog loginLog = getLoginLog(browserInfoId, locationId, userId); indexServiceImpl.insertLoginLog(loginLog); //返回本次登录日志id Integer loginLogId = loginLog.getId(); @@ -145,16 +397,49 @@ public Object tologin(@RequestBody UserInfo userInfo) { session.setAttribute("loginLogId", loginLogId); //插入系统日志 - SystemLog systemLog = new SystemLog(); - systemLog.setCreatetime(DateTimeUtil.dateToStr(new Date(), "yyyy-MM-dd HH:mm:ss")); - systemLog.setOperation("login?" + "username=" + username); - systemLog.setLoginLogId(loginLogId); - indexServiceImpl.insertSystemLog(systemLog); + SystemLog systemLog = getSystemLog(username, loginLogId, "login?", "username="); + indexServiceImpl.insertSystemLog(systemLog);*/ responseResult.setUrl("index").setStatus(0); responseResult.setMsg(token); return responseResult; } + private SystemLog getSystemLog(String username, Integer loginLogId, String s, String s2) { + SystemLog systemLog = new SystemLog(); + systemLog.setCreatetime(DateTimeUtil.dateToStr(new Date(), "yyyy-MM-dd HH:mm:ss")); + systemLog.setOperation(s + s2 + username); + systemLog.setLoginLogId(loginLogId); + return systemLog; + } + + private LoginLog getLoginLog(String browserInfoId, String locationId, Integer userId) { + LoginLog loginLog = new LoginLog(); + loginLog.setCreatetime(DateTimeUtil.dateToStr(new Date(), "yyyy-MM-dd HH:mm:ss")); + loginLog.setBrowserInfoId(browserInfoId); + loginLog.setLocationId(locationId); + loginLog.setUserId(userId); + return loginLog; + } + + private BrowserInfo insertBrowserInfo(@RequestBody UserInfo userInfo) { + BrowserInfo browserInfo = new BrowserInfo(); + browserInfo.setSystem(userInfo.getBrowserInfo()[0]); + browserInfo.setBrowserType(userInfo.getBrowserInfo()[1]); + browserInfo.setBrowserVersion(userInfo.getBrowserInfo()[2]); + return browserInfo; + } + + //抽取的公共方法插入位置信息 + private Location insertLocationInfo(@RequestBody UserInfo userInfo) { + Location location = new Location(); + /*location.setIp(userInfo.getLocation()[0]); + location.setLocation(userInfo.getLocation()[1]); + location.setLocalIp(userInfo.getLocalIp()); + location.setX(userInfo.getLocation()[2]); + location.setY(userInfo.getLocation()[3]); + location.setKeyword(userInfo.getPcOrPhone());*/ + return location; + } /** * regist.html,ajax发送的登录请求 @@ -168,22 +453,13 @@ public Object tologin(@RequestBody UserInfo userInfo) { @ApiOperation("注册") public Object toregist(@RequestBody UserInfo userInfo, HttpServletRequest request) { //插入本次登录的浏览器信息:型号,版本,系统类型 - BrowserInfo browserInfo = new BrowserInfo(); - browserInfo.setSystem(userInfo.getBrowserInfo()[0]); - browserInfo.setBrowserType(userInfo.getBrowserInfo()[1]); - browserInfo.setBrowserVersion(userInfo.getBrowserInfo()[2]); + BrowserInfo browserInfo = insertBrowserInfo(userInfo); indexServiceImpl.insertBrowserInfo(browserInfo); //返回自动递增的ID String browserInfoId = browserInfo.getBrowserInfoId(); //插入位置信息:X,Y,公网IP,地点,设备类型 - Location location = new Location(); - location.setIp(userInfo.getLocation()[0]); - location.setLocation(userInfo.getLocation()[1]); - location.setLocalIp(userInfo.getLocalIp()); - location.setX(userInfo.getLocation()[2]); - location.setY(userInfo.getLocation()[3]); - location.setKeyword(userInfo.getPcOrPhone()); + Location location = insertLocationInfo(userInfo); indexServiceImpl.insertLocation(location); //返回自动递增的ID String locationId = location.getLocationId(); @@ -216,10 +492,7 @@ public Object toregist(@RequestBody UserInfo userInfo, HttpServletRequest reques //没有登录,loginLogId就为空 //插入系统日志 Integer loginLogId = (Integer) request.getSession().getAttribute("loginLogId"); - SystemLog systemLog = new SystemLog(); - systemLog.setCreatetime(DateTimeUtil.dateToStr(new Date(), "yyyy-MM-dd HH:mm:ss")); - systemLog.setOperation("regist?" + "username=" + user.getUsername()); - systemLog.setLoginLogId(loginLogId); + SystemLog systemLog = getSystemLog(user.getUsername(), loginLogId, "regist?", "username="); indexServiceImpl.insertSystemLog(systemLog); log.info("[{}]注册成功", user.getUsername()); responseResult.setMsg("恭喜" + user.getUsername() + "注册成功" + ",您是第" + user.getId() + "位用户") @@ -257,9 +530,7 @@ public Object logout(HttpServletRequest httpServletRequest) { systemLog.setLoginLogId(loginLogId); indexServiceImpl.insertSystemLog(systemLog); - LogoutLog logoutLog = new LogoutLog(); - logoutLog.setCreatetime(DateTimeUtil.dateToStr(new Date(), "yyyy-MM-dd HH:mm:ss")); - logoutLog.setLoginLogId(loginLogId); + LogoutLog logoutLog = getLogoutLog(loginLogId); indexServiceImpl.insertLogoutLog(logoutLog); responseResult.setUrl("login").setStatus(0).setMsg("退出成功"); SecurityUtils.getSubject().logout(); @@ -268,6 +539,14 @@ public Object logout(HttpServletRequest httpServletRequest) { return responseResult; } + //idea重构 + private LogoutLog getLogoutLog(Integer loginLogId) { + LogoutLog logoutLog = new LogoutLog(); + logoutLog.setCreatetime(DateTimeUtil.dateToStr(new Date(), "yyyy-MM-dd HH:mm:ss")); + logoutLog.setLoginLogId(loginLogId); + return logoutLog; + } + /** * 重定向到搜索结果详情页 @@ -297,15 +576,9 @@ public Object detail(HttpServletRequest httpServletRequest, HttpServletResponse Integer loginLogId = (Integer) httpServletRequest.getSession().getAttribute("loginLogId"); - SystemLog systemLog = new SystemLog(); - systemLog.setCreatetime(DateTimeUtil.dateToStr(new Date(), "yyyy-MM-dd HH:mm:ss")); - systemLog.setOperation("detail" + "?keyword=" + keyword); - systemLog.setLoginLogId(loginLogId); + SystemLog systemLog = getSystemLog(keyword, loginLogId, "detail", "?keyword="); - SearchRecord searchRecord = new SearchRecord(); - searchRecord.setKeyword(keyword); - searchRecord.setSearchTime(DateTimeUtil.dateToStr(new Date(), "yyyy-MM-dd HH:mm:ss")); - searchRecord.setLoginLogId(loginLogId); + SearchRecord searchRecord = getSearchRecord(keyword, loginLogId); indexServiceImpl.insertSearchRecord(searchRecord); indexServiceImpl.insertSystemLog(systemLog); @@ -315,6 +588,14 @@ public Object detail(HttpServletRequest httpServletRequest, HttpServletResponse return responseResult; } + private SearchRecord getSearchRecord(String keyword, Integer loginLogId) { + SearchRecord searchRecord = new SearchRecord(); + searchRecord.setKeyword(keyword); + searchRecord.setSearchTime(DateTimeUtil.dateToStr(new Date(), "yyyy-MM-dd HH:mm:ss")); + searchRecord.setLoginLogId(loginLogId); + return searchRecord; + } + /** * 便签模式 */ @@ -330,10 +611,7 @@ public Object note(@RequestBody Map map, HttpServletRequest requ aiNote.setCreatetime(DateTimeUtil.dateToStr(new Date(), "yyyy-MM-dd HH:mm:ss")); aiNote.setLoginLogId(loginLogId); - SystemLog systemLog = new SystemLog(); - systemLog.setCreatetime(DateTimeUtil.dateToStr(new Date(), "yyyy-MM-dd HH:mm:ss")); - systemLog.setOperation("note" + "?content=" + aiNote.getContent()); - systemLog.setLoginLogId(loginLogId); + SystemLog systemLog = getSystemLog(aiNote.getContent(), loginLogId, "note", "?content="); indexServiceImpl.insertSystemLog(systemLog); indexServiceImpl.insertAiNote(aiNote); diff --git a/src/main/java/com/zjj/aisearch/controller/LoversGoalController.java b/src/main/java/com/zjj/aisearch/controller/LoversGoalController.java deleted file mode 100644 index 4bd62cf..0000000 --- a/src/main/java/com/zjj/aisearch/controller/LoversGoalController.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.zjj.aisearch.controller; - -import com.zjj.aisearch.model.QueryForm; -import com.zjj.aisearch.model.SystemLogList; -import com.zjj.aisearch.service.LoversGoalService; -import io.swagger.annotations.ApiOperation; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -/** - * @program: AISearch - * @description: LoversGoal - * @author: zjj - * @create: 2019-10-05 02:46:49 - **/ -@RestController -@Slf4j -public class LoversGoalController { - - @Autowired - private LoversGoalService loversGoalServiceImpl; - - @PostMapping("queryTaskList") - @ApiOperation("查询任务列表") - public List querySystemLog(@RequestBody QueryForm queryForm) { - return null; - } - -} diff --git a/src/main/java/com/zjj/aisearch/controller/QueryController.java b/src/main/java/com/zjj/aisearch/controller/QueryController.java index 9343776..3d9db9a 100644 --- a/src/main/java/com/zjj/aisearch/controller/QueryController.java +++ b/src/main/java/com/zjj/aisearch/controller/QueryController.java @@ -134,6 +134,11 @@ public Integer queryMarkdownListCount(@RequestBody QueryForm queryForm) { public List queryUserList(@RequestBody QueryForm queryForm) { return queryServiceImpl.queryUserList(queryForm); } + @PostMapping("queryFileList") + @ApiOperation("根据条件查询用户记录数据") + public List queryFileList() { + return queryServiceImpl.queryFileList(); + } @PostMapping("queryUserListCount") @ApiOperation("根据条件查询用户记录数据总条数") diff --git a/src/main/java/com/zjj/aisearch/controller/UploadController.java b/src/main/java/com/zjj/aisearch/controller/UploadController.java new file mode 100644 index 0000000..9dd6f74 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/controller/UploadController.java @@ -0,0 +1,177 @@ +package com.zjj.aisearch.controller; + +import com.zjj.aisearch.mapper.DocumentMapper; +import com.zjj.aisearch.mapper.UploadFileMapper; +import com.zjj.aisearch.model.ResponseResult; +import com.zjj.aisearch.pojo.dto.DocumentDTO; +import com.zjj.aisearch.pojo.dto.FullTextDTO; +import com.zjj.aisearch.repository.impl.DocumentESRepository; +import com.zjj.aisearch.service.UploadFileService; +import com.zjj.aisearch.utils.DateTimeUtil; +import com.zjj.aisearch.utils.FastDFSClientUtil; +import com.zjj.aisearch.utils.MultipartFileToFile; +import org.apache.commons.io.IOUtils; +import org.apache.tika.Tika; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.Date; + +/** + * @Description: FastDFS做网盘和图床 + * @Param: + * @return: + * @Author: zjj + * @Date: 2020/2/15 + */ +@RestController +public class UploadController { + @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") + @Autowired + private DocumentMapper documentMapper; + + @Autowired + @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") + private UploadFileMapper uploadFileMapper; + + @Autowired + private DocumentESRepository documentESRepository; + @Autowired + private FastDFSClientUtil dfsClient; + @Autowired + private UploadFileService uploadFileServiceImpl; + + @Autowired + private UploadFileService uploadFileFastServiceImpl; + + + + //上传到本地文件系统中 + @PostMapping("/uploadlocal") + public ResponseResult uploadlocal(@RequestParam("file") MultipartFile file, HttpServletRequest request) throws Exception { + return uploadFileServiceImpl.uploadlocal(file); + } + + //上传到本地文件系统中,使用缓冲流,快一些 + @PostMapping("/uploadlocalfast") + public ResponseResult uploadlocalfast(@RequestParam("file") MultipartFile file, HttpServletRequest request) throws Exception { + return uploadFileFastServiceImpl.uploadlocal(file); + } + + //上传到服务器上 + @PostMapping("/upload") + public ResponseResult fdfsUpload(@RequestParam("file") MultipartFile file, HttpServletRequest request) throws Exception { + ResponseResult responseResult = new ResponseResult(); + try { + String fileUrl = dfsClient.uploadFile(file); + //提取文件信息进入数据库 + FullTextDTO fullTextDTO = new FullTextDTO(); + long size = file.getSize(); + Tika tika = new Tika(); + File file1 = MultipartFileToFile.multipartFileToFile(file); + String fileName = file1.getName(); + String filecontent = tika.parseToString(file1); + MultipartFileToFile.delteTempFile(file1); + fullTextDTO.setCreatetime(DateTimeUtil.dateToStr(new Date(), "yyyy-MM-dd HH:mm:ss")); + //应该存用户id,暂时写死 + fullTextDTO.setCreateuser("zjj"); + fullTextDTO.setFileContent(filecontent); + fullTextDTO.setFileName(fileName); + fullTextDTO.setFilePath(fileUrl); + fullTextDTO.setFileSize(size); + fullTextDTO.setFileType(fileName.substring(fileName.lastIndexOf(".") + 1)); + //保存到数据库 + uploadFileServiceImpl.save(fullTextDTO); + //保存到索引库 + DocumentDTO documentDTO = new DocumentDTO(); + documentDTO.setDocumentcontent(filecontent); + documentDTO.setDocumentname(fileName); + documentDTO.setUrl(fileUrl); + documentMapper.insert(documentDTO); + documentESRepository.save(documentDTO); + responseResult.setStatus(0); + responseResult.setMsg("上传成功,这是第" + fullTextDTO.getId() + "个文件"); + responseResult.setUrl(fileUrl); + responseResult.setData(fileUrl); + } catch (IOException e) { + responseResult.setStatus(-1); + responseResult.setMsg("上传失败"); + e.printStackTrace(); + } + return responseResult; + } + + + /* + * http://localhost/download?filePath=group1/M00/00/00/wKgIZVzZEF2ATP08ABC9j8AnNSs744.jpg + */ + @RequestMapping("/download") + public void download(String filePath, HttpServletRequest request, HttpServletResponse response) throws IOException { + + // group1/M00/00/00/wKgIZVzZEF2ATP08ABC9j8AnNSs744.jpg + String[] paths = filePath.split("/"); + String groupName = null; + for (String item : paths) { + if (item.indexOf("group") != -1) { + groupName = item; + break; + } + } + String path = filePath.substring(filePath.indexOf(groupName) + groupName.length() + 1, filePath.length()); + InputStream input = dfsClient.download(groupName, path); + + //根据文件名获取 MIME 类型 + String fileName = paths[paths.length - 1]; + System.out.println("fileName :" + fileName); // wKgIZVzZEF2ATP08ABC9j8AnNSs744.jpg + String contentType = request.getServletContext().getMimeType(fileName); + String contentDisposition = "attachment;filename=" + fileName; + + // 设置头 + response.setHeader("Content-Type", contentType); + response.setHeader("Content-Disposition", contentDisposition); + + // 获取绑定了客户端的流 + ServletOutputStream output = response.getOutputStream(); + + // 把输入流中的数据写入到输出流中 + IOUtils.copy(input, output); + input.close(); + + } + + /** + * http://localhost/deleteFile?filePath=group1/M00/00/00/wKgIZVzZaRiAZemtAARpYjHP9j4930.jpg + * + * @param filePath group1/M00/00/00/wKgIZVzZaRiAZemtAARpYjHP9j4930.jpg + * @param request + * @param response + * @return + */ + @RequestMapping("/deleteFile") + public ResponseResult delFile(Integer id, String filePath, HttpServletRequest request, HttpServletResponse response) { + ResponseResult responseResult = new ResponseResult(); + try { + dfsClient.delFile(filePath); + uploadFileServiceImpl.deleteFile(id); + } catch (Exception e) { + // 文件不存在报异常 : com.github.tobato.fastdfs.exception.FdfsServerException: 错误码:2,错误信息:找不到节点或文件 + responseResult.setStatus(-1); + responseResult.setMsg("删除失败"); + e.printStackTrace(); + return responseResult; + } + responseResult.setStatus(0); + responseResult.setMsg("成功删除"); + return responseResult; + } +} diff --git a/src/main/java/com/zjj/aisearch/controller/UploadFileController.java b/src/main/java/com/zjj/aisearch/controller/UploadFileController.java deleted file mode 100644 index a689dbc..0000000 --- a/src/main/java/com/zjj/aisearch/controller/UploadFileController.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.zjj.aisearch.controller; - -import com.zjj.aisearch.service.UploadFileService; -import org.springframework.beans.factory.annotation.Autowired; - -/** - * @program: AISearch - * @description: 上传各种文件 - * @author: zjj - * @create: 2020-01-06 14:04:08 - **/ -public class UploadFileController { - - @Autowired - private UploadFileService uploadFileServiceImpl; - - -} diff --git a/src/main/java/com/zjj/aisearch/crawler/AISearchCrawlerDemo.java b/src/main/java/com/zjj/aisearch/crawler/AISearchCrawlerDemo.java new file mode 100644 index 0000000..c8aee88 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/crawler/AISearchCrawlerDemo.java @@ -0,0 +1,15 @@ +package com.zjj.aisearch.crawler; + +import org.springframework.web.client.RestTemplate; + +public class AISearchCrawlerDemo { + + public static void main(String[] args) { + RestTemplate restTemplate = new RestTemplate(); + //System.out.println(restTemplate.getForObject("https://Movie.douban.com/j/new_search_subjects?sort=U&range=0,10&tags=&start=1", String.class)); + for (int i = 1; i < 100; i++) { + + System.out.println(restTemplate.getForObject("https://www.zhihu.com/api/v4/questions/273982054/answers?include=data[*].is_normal,admin_closed_comment,reward_info,is_collapsed,annotation_action,annotation_detail,collapse_reason,is_sticky,collapsed_by,suggest_edit,comment_count,can_comment,content,editable_content,voteup_count,reshipment_settings,comment_permission,created_time,updated_time,review_info,relevant_info,question.detail,excerpt,relationship.is_authorized,is_author,voting,is_thanked,is_nothelp,is_labeled,is_recognized;data[*].mark_infos[*].url;data[*].author.follower_count,badge[*].topics&limit=5&offset=" + i + "&platform=desktop&sort_by=default", String.class)); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/demo/annotations/ZjjAutowired.java b/src/main/java/com/zjj/aisearch/demo/annotations/ZjjAutowired.java new file mode 100644 index 0000000..50e4fc5 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/annotations/ZjjAutowired.java @@ -0,0 +1,9 @@ +package com.zjj.aisearch.demo.annotations; + +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.FIELD, ElementType.TYPE}) +@Documented +public @interface ZjjAutowired { +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/demo/annotations/ZjjController.java b/src/main/java/com/zjj/aisearch/demo/annotations/ZjjController.java new file mode 100644 index 0000000..120e979 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/annotations/ZjjController.java @@ -0,0 +1,10 @@ +package com.zjj.aisearch.demo.annotations; + +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.METHOD, ElementType.TYPE}) +@Documented +public @interface ZjjController { + +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/demo/annotations/ZjjRequestMapping.java b/src/main/java/com/zjj/aisearch/demo/annotations/ZjjRequestMapping.java new file mode 100644 index 0000000..4c97b3b --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/annotations/ZjjRequestMapping.java @@ -0,0 +1,69 @@ +package com.zjj.aisearch.demo.annotations; + +import java.lang.annotation.*; + +/** + * @Target 有下面的取值 + +ElementType.ANNOTATION_TYPE 可以给一个注解进行注解 +ElementType.CONSTRUCTOR 可以给构造方法进行注解 +ElementType.FIELD 可以给属性进行注解 +ElementType.LOCAL_VARIABLE 可以给局部变量进行注解 +ElementType.METHOD 可以给方法进行注解 +ElementType.PACKAGE 可以给一个包进行注解 +ElementType.PARAMETER 可以给一个方法内的参数进行注解 +ElementType.TYPE 可以给一个类型进行注解,比如类、接口、枚举 + @Retention + Retention 的英文意为保留期的意思。当 @Retention 应用到一个注解上的时候,它解释说明了这个注解的的存活时间。 + + 它的取值如下: + - RetentionPolicy.SOURCE 注解只在源码阶段保留,在编译器进行编译时它将被丢弃忽视。 + - RetentionPolicy.CLASS 注解只被保留到编译进行的时候,它并不会被加载到 JVM 中。 + - RetentionPolicy.RUNTIME 注解可以保留到程序运行的时候,它会被加载进入到 JVM 中,所以在程序运行时可以获取到它们。 + + @Documented + 顾名思义,这个元注解肯定是和文档有关。它的作用是能够将注解中的元素包含到 Javadoc 中去。 + @Inherited + Inherited 是继承的意思,但是它并不是说注解本身可以继承,而是说如果一个超类被 @Inherited 注解过的注解进行注解的话,那么如果它的子类没有被任何注解应用的话,那么这个子类就继承了超类的注解。 + + @Repeatable + Repeatable 自然是可重复的意思。@Repeatable 是 Java 1.8 才加进来的,所以算是一个新的特性。 + + 什么样的注解会多次应用呢?通常是注解的值可以同时取多个。 + + 注解的属性 + 注解的属性也叫做成员变量。注解只有成员变量,没有方法。注解的成员变量在注解的定义中以“无形参的方法”形式来声明,其方法名定义了该成员变量的名字,其返回值定义了该成员变量的类型。 + + 上面代码定义了 TestAnnotation 这个注解中拥有 id 和 msg 两个属性。在使用的时候,我们应该给它们进行赋值。 + + 赋值的方式是在注解的括号内以 value=”” 形式,多个属性之前用 ,隔开。 + + 需要注意的是,在注解中定义属性时它的类型必须是 8 种基本数据类型外加 类、接口、注解及它们的数组。 + + 注解中属性可以有默认值,默认值需要用 default 关键值指定。比如: + 另外,还有一种情况。如果一个注解内仅仅只有一个名字为 value 的属性时,应用这个注解时可以直接接属性值填写到括号内 + + 上面代码中,Check 这个注解只有 value 这个属性。所以可以这样应用。 + + @Check("hi") + int a; + 这和下面的效果是一样的 + + @Check(value="hi") + int a; + 最后,还需要注意的一种情况是一个注解没有任何属性。比如 + + public @interface Perform {} + 那么在应用这个注解的时候,括号都可以省略。 + 仅作为标识 + */ +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.METHOD, ElementType.TYPE}) +@Documented +public @interface ZjjRequestMapping { + + /** + * 请求地址 + */ + String value() default "/"; +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/demo/annotations/ZjjService.java b/src/main/java/com/zjj/aisearch/demo/annotations/ZjjService.java new file mode 100644 index 0000000..dd93301 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/annotations/ZjjService.java @@ -0,0 +1,10 @@ +package com.zjj.aisearch.demo.annotations; + +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.METHOD, ElementType.TYPE}) +@Documented +public @interface ZjjService { + +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/demo/aop/ReadMe.md b/src/main/java/com/zjj/aisearch/demo/aop/ReadMe.md new file mode 100644 index 0000000..6437b43 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/aop/ReadMe.md @@ -0,0 +1,25 @@ +2020年2月21日11:59:19 +自己实现springMVC框架 +知识点: +反射:写框架都要用到反射```` +json,xml解析 +注解, +基于servlet, +asm,类似反射 + +第一步:url和地址的映射关系 +第二步:获取方法参数 +第三步:转换并转换请求参数 +第四步:使用反射执行方法 +第五步:写一个入口,并加一些配置 +第六步:处理执行结果,可以先字符串 +https://www.cnblogs.com/hebaibai/p/10338082.html + + +2020年2月28日12:21:01 +我想的是: +1.这半年把各种以后可能会用到最重要的技术(java,js,可视化,爬虫,全文检索,大数据,微服务,深度学习),技能(金融,历史,地理,文化,美食,摄影,绘画,音乐)都看了,至少入门 +2.后面半年考虑怎么把自己会的东西应用起来 +3.接下来,多考虑,恋爱,事业,交际,人脉,生活,旅游, +当然,上面说的这些,可能会变动,可能会发生很大的变动,但是不要浪费时间,一天都不要浪费 +25岁之前,多去尝试,其他都不重要,找到自己的方向最重要,并且,给未来的自己留有足够大的调整空间 diff --git a/src/main/java/com/zjj/aisearch/demo/controller/MyTestController.java b/src/main/java/com/zjj/aisearch/demo/controller/MyTestController.java new file mode 100644 index 0000000..221ff9f --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/controller/MyTestController.java @@ -0,0 +1,36 @@ +package com.zjj.aisearch.demo.controller; + +import com.zjj.aisearch.demo.annotations.ZjjRequestMapping; +import com.zjj.aisearch.service.impl.GetServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.ResponseStatus; + +/** + * @program: AISearch + * @description: 测试Controller + * @author: zjj + * @create: 2020-02-27 23:45:30 + **/ +@Controller +@RequestMapping +public class MyTestController { + + @Autowired + private GetServiceImpl getService; + + @RequestMapping("/fkal") + public static void test() { + System.out.println("dddddddafnN多d"); + } + + @ResponseStatus + @ResponseBody + @ZjjRequestMapping("/dddd") + public String test2() { + System.out.println("ddddd"); + return "你好"; + } +} diff --git a/src/main/java/com/zjj/aisearch/demo/java8/Converter.java b/src/main/java/com/zjj/aisearch/demo/java8/Converter.java new file mode 100644 index 0000000..c059501 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/java8/Converter.java @@ -0,0 +1,6 @@ +package com.zjj.aisearch.demo.java8; + +@FunctionalInterface +interface Converter { + T convert(F from); +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/demo/java8/Demo1.java b/src/main/java/com/zjj/aisearch/demo/java8/Demo1.java new file mode 100644 index 0000000..160333e --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/java8/Demo1.java @@ -0,0 +1,195 @@ +package com.zjj.aisearch.demo.java8; + +import org.junit.Test; + +import java.util.Arrays; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +/** + * @program: AISearch + * @description: + * @author: zjj + * @create: 2020-03-08 10:32:55 + **/ +public class Demo1 { + /** + * 允许在接口中有默认方法实现 + * Java 8 允许我们使用default关键字,为接口声明添加非抽象的方法实现。这个特性又被称为扩展方法。下面是我们的第一个例子: + */ + @Test + public void Test1() { + Formula formula = new Formula() { + @Override + public double calculate(int a) { + return sqrt(a * 100); + } + }; + + System.out.println(formula.calculate(100)); // 100.0 + System.out.println(formula.sqrt(16)); // 4.0 + } + + @Test + public void test2() throws Exception { + List names = Arrays.asList("peter", "anna", "mike", "xenia"); + + Collections.sort(names, new Comparator() { + @Override + public int compare(String a, String b) { + return b.compareTo(a); + } + }); + + /** + * 除了创建匿名对象以外,Java 8 还提供了一种更简洁的方式,Lambda表达式。 + */ + /* Collections.sort(names, (String a, String b) -> { + return b.compareTo(a); + });*/ + /** + *你可以看到,这段代码就比之前的更加简短和易读。但是,它还可以更加简短: + */ + /*Collections.sort(names, (String a, String b) -> b.compareTo(a));*/ +/** + * Java编译器能够自动识别参数的类型,所以你就可以省略掉类型不写。让我们再深入地研究一下lambda表达式的威力吧。 + */ + Collections.sort(names, (a, b) -> b.compareTo(a)); + System.out.println(names); + } + + /** + * 函数式接口 + * + * Lambda表达式如何匹配Java的类型系统?每一个lambda都能够通过一个特定的接口,与一个给定的类型进行匹配。一个所谓的函数式接口必须要有且仅有一个抽象方法声明。每个与之对应的lambda表达式必须要与抽象方法的声明相匹配。由于默认方法不是抽象的,因此你可以在你的函数式接口里任意添加默认方法。 + */ + /** + * java Comparator为何是函数式接口? + * https://segmentfault.com/q/1010000018112927 + *

+ * public @interface FunctionalInterface 官方文档: + *

+ * If an interface declares an abstract method overriding one of the public methods of java.lang.Object, that also does not count toward the interface's abstract method count since any implementation of the interface will have an implementation from java.lang.Object or elsewhere. + * 如果接口声明了一个覆盖java.lang.Object的全局方法之一的抽象方法,那么它不会计入接口的抽象方法数量中,因为接口的任何实现都将具有java.lang.Object或其他地方的实现。 + *

+ * 从中我们可以得知函数式接口的几点特征: + *

+ * 函数式接口只有一个抽象方法 + * default方法某默认实现,不属于抽象方法 + * 接口重写了Object的公共方法也不算入内 + * 所以,Comparator虽然有两个抽象方法: + *

+ * int compare(T o1, T o2); + * boolean equals(Object obj); + * 其中 equals为Object的方法,不算入内,所以Comparator可以作为函数式接口。 + */ + + @Test + public void test3() throws Exception { + /* Converter converter = (from) -> Integer.valueOf(from); + Integer converted = converter.convert("123"); + System.out.println(converted); // 123*/ + /** + * 注意,如果你不写@FunctionalInterface 标注,程序也是正确的。 + */ + + /** + * 方法和构造函数引用 + 上面的代码实例可以通过静态方法引用,使之更加简洁: + */ + + Converter converter = Integer::valueOf; + Integer converted = converter.convert("123"); + System.out.println(converted); // 123 + + /** + * Java 8 允许你通过::关键字获取方法或者构造函数的的引用。上面的例子就演示了如何引用一个静态方法。而且,我们还可以对一个对象的方法进行引用: + */ + + + } + + @Test + public void test4() throws Exception { + Something something = new Something(); + Converter converter = something::startsWith; + String converted = converter.convert("Java"); + System.out.println(converted); // "J" + } + + /** + * 让我们看看如何使用::关键字引用构造函数。首先我们定义一个示例bean,包含不同的构造方法: + */ + + + @Test + public void test5() throws Exception { + Something something = new Something(); + Converter converter = something::startsWith; + String converted = converter.convert("Java"); + System.out.println(converted); // "J" + } + + /** + * 然后我们通过构造函数引用来把所有东西拼到一起,而不是像以前一样,通过手动实现一个工厂来这么做。 + */ + + /** + * 我们通过Person::new来创建一个Person类构造函数的引用。Java编译器会自动地选择合适的构造函数来匹配PersonFactory.create函数的签名,并选择正确的构造函数形式。 + * + * @throws Exception + */ + @Test + public void test6() throws Exception { + PersonFactory personFactory = Person::new; + Person person = personFactory.create("Peter", "Parker"); + System.out.println(person); + } + + /** + * Lambda的范围 + * 对于lambdab表达式外部的变量,其访问权限的粒度与匿名对象的方式非常类似。你能够访问局部对应的外部区域的局部final变量,以及成员变量和静态变量。 + * 访问局部变量 + * 我们可以访问lambda表达式外部的final局部变量: + */ + + @Test + public void test7() throws Exception { + final int num = 1; + Converter stringConverter = + (from) -> String.valueOf(from + num); + + System.out.println(stringConverter.convert(2)); // 3 + } + + /** + * 但是与匿名对象不同的是,变量num并不需要一定是final。下面的代码依然是合法的: + */ + + @Test + public void test8() throws Exception { + int num = 1; + Converter stringConverter = + (from) -> String.valueOf(from + num); + + System.out.println(stringConverter.convert(2)); // 3 + } + + /** + * 然而,num在编译的时候被隐式地当做final变量来处理。下面的代码就不合法: + */ + + @Test + public void test9() throws Exception { + int num = 1; + Converter stringConverter = + (from) -> String.valueOf(from + num); + /*num = 23;*/ + System.out.println(stringConverter.convert(2)); // 3 + //在lambda表达式内部企图改变num的值也是不允许的。 + } + /** + * 与局部变量不同,我们在lambda表达式的内部能获取到对成员变量或静态变量的读写权。这种访问行为在匿名对象里是非常典型的。 + */ +} diff --git a/src/main/java/com/zjj/aisearch/demo/java8/Formula.java b/src/main/java/com/zjj/aisearch/demo/java8/Formula.java new file mode 100644 index 0000000..9c9e805 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/java8/Formula.java @@ -0,0 +1,9 @@ +package com.zjj.aisearch.demo.java8; + +interface Formula { + double calculate(int a); + + default double sqrt(int a) { + return Math.sqrt(a); + } +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/demo/java8/Lambda4.java b/src/main/java/com/zjj/aisearch/demo/java8/Lambda4.java new file mode 100644 index 0000000..b48f59c --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/java8/Lambda4.java @@ -0,0 +1,18 @@ +package com.zjj.aisearch.demo.java8; + +class Lambda4 { + static int outerStaticNum; + int outerNum; + + void testScopes() { + Converter stringConverter1 = (from) -> { + outerNum = 23; + return String.valueOf(from); + }; + + Converter stringConverter2 = (from) -> { + outerStaticNum = 72; + return String.valueOf(from); + }; + } +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/demo/java8/Person.java b/src/main/java/com/zjj/aisearch/demo/java8/Person.java new file mode 100644 index 0000000..911d99d --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/java8/Person.java @@ -0,0 +1,13 @@ +package com.zjj.aisearch.demo.java8; + +class Person { + String firstName; + String lastName; + + Person() {} + + Person(String firstName, String lastName) { + this.firstName = firstName; + this.lastName = lastName; + } +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/demo/java8/PersonFactory.java b/src/main/java/com/zjj/aisearch/demo/java8/PersonFactory.java new file mode 100644 index 0000000..f72a4ed --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/java8/PersonFactory.java @@ -0,0 +1,5 @@ +package com.zjj.aisearch.demo.java8; + +interface PersonFactory

{ + P create(String firstName, String lastName); +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/demo/java8/Something.java b/src/main/java/com/zjj/aisearch/demo/java8/Something.java new file mode 100644 index 0000000..50f597c --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/java8/Something.java @@ -0,0 +1,7 @@ +package com.zjj.aisearch.demo.java8; + +class Something { + String startsWith(String s) { + return String.valueOf(s.charAt(0)); + } +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/demo/mvc/servlet/MyServlet.java b/src/main/java/com/zjj/aisearch/demo/mvc/servlet/MyServlet.java new file mode 100644 index 0000000..31f4a9e --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/mvc/servlet/MyServlet.java @@ -0,0 +1,30 @@ +package com.zjj.aisearch.demo.mvc.servlet; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +@WebServlet(urlPatterns = "/servlet/HelloWorld") + +public class MyServlet extends HttpServlet { + + @Override + + protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + + resp.getWriter().write("my doGet methods"); + + } + + @Override + + protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + + resp.getWriter().write("my doPost method"); + + } + +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/demo/orm/ReadMe.md b/src/main/java/com/zjj/aisearch/demo/orm/ReadMe.md new file mode 100644 index 0000000..9361963 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/orm/ReadMe.md @@ -0,0 +1,4 @@ +2020年2月28日12:09:41 +通过数据库生成实体类 +orm框架 +https://git.hebaibai.com/ \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/demo/orm/User.java b/src/main/java/com/zjj/aisearch/demo/orm/User.java new file mode 100644 index 0000000..6b14a8a --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/orm/User.java @@ -0,0 +1,54 @@ +package com.zjj.aisearch.demo.orm; + +import javax.persistence.Column; +import javax.persistence.Id; +import javax.persistence.Table; +import java.util.Date; + +/** + * 用户表 + * + * @author hejiaxuan + */ +@Table(name = "user") +public class User { + + /** + * 用户名 + */ + @Column(name = "name") + private String name; + + /** + * 用户id + */ + @Id + @Column(name = "id") + private int id; + + /** + * 年龄 + */ + @Column(name = "age") + private int age; + + /** + * mark + */ + @Column(name = "mark") + private String mark; + + /** + * create_date + */ + @Column(name = "create_date") + private Date createDate; + + /** + * status + */ + @Column(name = "status") + private int status; + + //getter and setter and toString +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/demo/patternDesign/adapter/AdapterDemo.java b/src/main/java/com/zjj/aisearch/demo/patternDesign/adapter/AdapterDemo.java new file mode 100644 index 0000000..3b53483 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/patternDesign/adapter/AdapterDemo.java @@ -0,0 +1,27 @@ +package com.zjj.aisearch.demo.patternDesign.adapter; + +/** + * @program: AISearch + * @description: 适配器模式 + * @author: zjj + * @create: 2020-02-25 13:07:32 + **/ + +/** + * 适配器模式(Adapter Pattern)是作为两个不兼容的接口之间的桥梁。这种类型的设计模式属于结构型模式,它结合了两个独立接口的功能。 + * 这种模式涉及到一个单一的类,该类负责加入独立的或不兼容的接口功能。举个真实的例子,读卡器是作为内存卡和笔记本之间的适配器。您将内存卡插入读卡器,再将读卡器插入笔记本,这样就可以通过笔记本来读取内存卡。 + * 意图:将一个类的接口转换成客户希望的另外一个接口。适配器模式使得原本由于接口不兼容而不能一起工作的那些类可以一起工作。 + * 主要解决:主要解决在软件系统中,常常要将一些"现存的对象"放到新的环境中,而新环境要求的接口是现对象不能满足的。 + * 如何解决:继承或依赖(推荐)。 + + 关键代码:适配器继承或依赖已有的对象,实现想要的目标接口。 + 实现 + 我们有一个 MediaPlayer 接口和一个实现了 MediaPlayer 接口的实体类 AudioPlayer。默认情况下,AudioPlayer 可以播放 mp3 格式的音频文件。 + + 我们还有另一个接口 AdvancedMediaPlayer 和实现了 AdvancedMediaPlayer 接口的实体类。该类可以播放 vlc 和 mp4 格式的文件。 + + 我们想要让 AudioPlayer 播放其他格式的音频文件。为了实现这个功能,我们需要创建一个实现了 MediaPlayer 接口的适配器类 MediaAdapter,并使用 AdvancedMediaPlayer 对象来播放所需的格式。 + */ +public class AdapterDemo { + +} diff --git a/src/main/java/com/zjj/aisearch/demo/patternDesign/adapter/AdapterPatternDemo.java b/src/main/java/com/zjj/aisearch/demo/patternDesign/adapter/AdapterPatternDemo.java new file mode 100644 index 0000000..e8aa0f9 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/patternDesign/adapter/AdapterPatternDemo.java @@ -0,0 +1,12 @@ +package com.zjj.aisearch.demo.patternDesign.adapter; + +public class AdapterPatternDemo { + public static void main(String[] args) { + AudioPlayer audioPlayer = new AudioPlayer(); + + audioPlayer.play("mp3", "beyond the horizon.mp3"); + audioPlayer.play("mp4", "alone.mp4"); + audioPlayer.play("vlc", "far far away.vlc"); + audioPlayer.play("avi", "mind me.avi"); + } +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/demo/patternDesign/adapter/AdvancedMediaPlayer.java b/src/main/java/com/zjj/aisearch/demo/patternDesign/adapter/AdvancedMediaPlayer.java new file mode 100644 index 0000000..23c68c6 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/patternDesign/adapter/AdvancedMediaPlayer.java @@ -0,0 +1,6 @@ +package com.zjj.aisearch.demo.patternDesign.adapter; + +public interface AdvancedMediaPlayer { + public void playVlc(String fileName); + public void playMp4(String fileName); +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/demo/patternDesign/adapter/AudioPlayer.java b/src/main/java/com/zjj/aisearch/demo/patternDesign/adapter/AudioPlayer.java new file mode 100644 index 0000000..9ef0a68 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/patternDesign/adapter/AudioPlayer.java @@ -0,0 +1,24 @@ +package com.zjj.aisearch.demo.patternDesign.adapter; + +public class AudioPlayer implements MediaPlayer { + MediaAdapter mediaAdapter; + + @Override + public void play(String audioType, String fileName) { + + //播放 mp3 音乐文件的内置支持 + if(audioType.equalsIgnoreCase("mp3")){ + System.out.println("Playing mp3 file. Name: "+ fileName); + } + //mediaAdapter 提供了播放其他文件格式的支持 + else if(audioType.equalsIgnoreCase("vlc") + || audioType.equalsIgnoreCase("mp4")){ + mediaAdapter = new MediaAdapter(audioType); + mediaAdapter.play(audioType, fileName); + } + else{ + System.out.println("Invalid media. "+ + audioType + " format not supported"); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/demo/patternDesign/adapter/MediaAdapter.java b/src/main/java/com/zjj/aisearch/demo/patternDesign/adapter/MediaAdapter.java new file mode 100644 index 0000000..56a954c --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/patternDesign/adapter/MediaAdapter.java @@ -0,0 +1,23 @@ +package com.zjj.aisearch.demo.patternDesign.adapter; + +public class MediaAdapter implements MediaPlayer { + + AdvancedMediaPlayer advancedMusicPlayer; + + public MediaAdapter(String audioType){ + if(audioType.equalsIgnoreCase("vlc") ){ + advancedMusicPlayer = new VlcPlayer(); + } else if (audioType.equalsIgnoreCase("mp4")){ + advancedMusicPlayer = new Mp4Player(); + } + } + + @Override + public void play(String audioType, String fileName) { + if(audioType.equalsIgnoreCase("vlc")){ + advancedMusicPlayer.playVlc(fileName); + }else if(audioType.equalsIgnoreCase("mp4")){ + advancedMusicPlayer.playMp4(fileName); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/demo/patternDesign/adapter/MediaPlayer.java b/src/main/java/com/zjj/aisearch/demo/patternDesign/adapter/MediaPlayer.java new file mode 100644 index 0000000..d305314 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/patternDesign/adapter/MediaPlayer.java @@ -0,0 +1,5 @@ +package com.zjj.aisearch.demo.patternDesign.adapter; + +public interface MediaPlayer { + public void play(String audioType, String fileName); +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/demo/patternDesign/adapter/Mp4Player.java b/src/main/java/com/zjj/aisearch/demo/patternDesign/adapter/Mp4Player.java new file mode 100644 index 0000000..88550ea --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/patternDesign/adapter/Mp4Player.java @@ -0,0 +1,14 @@ +package com.zjj.aisearch.demo.patternDesign.adapter; + +public class Mp4Player implements AdvancedMediaPlayer{ + + @Override + public void playVlc(String fileName) { + //什么也不做 + } + + @Override + public void playMp4(String fileName) { + System.out.println("Playing mp4 file. Name: "+ fileName); + } +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/demo/patternDesign/adapter/VlcPlayer.java b/src/main/java/com/zjj/aisearch/demo/patternDesign/adapter/VlcPlayer.java new file mode 100644 index 0000000..93e7ea1 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/patternDesign/adapter/VlcPlayer.java @@ -0,0 +1,13 @@ +package com.zjj.aisearch.demo.patternDesign.adapter; + +public class VlcPlayer implements AdvancedMediaPlayer{ + @Override + public void playVlc(String fileName) { + System.out.println("Playing vlc file. Name: "+ fileName); + } + + @Override + public void playMp4(String fileName) { + //什么也不做 + } +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/demo/regexp/TestRegexp1.java b/src/main/java/com/zjj/aisearch/demo/regexp/TestRegexp1.java new file mode 100644 index 0000000..7a902fb --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/regexp/TestRegexp1.java @@ -0,0 +1,42 @@ +package com.zjj.aisearch.demo.regexp; + +/** + * @program: AISearch + * @description: 测试正则表达式demo1 + * @author: zjj + * @create: 2020-03-07 22:04:07 + **/ +public class TestRegexp1 { + public static void main(String[] args) throws Exception { + test1(); + } + + /** + * 1:字符 x + * 匹配x + * 2:\\ + * \ + * 3.\n + * 换行符 + * 4.\t + * 制表符 tab效果 + * 5.\r + * 回车符 + * 6.[abc] + * 字符abc + * 7. + * + * + * + * + * + * + * + * + * + */ + public static void test1() { + + + } +} diff --git a/src/main/java/com/zjj/aisearch/demo/sort/Demo1.java b/src/main/java/com/zjj/aisearch/demo/sort/Demo1.java new file mode 100644 index 0000000..71dfae9 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/sort/Demo1.java @@ -0,0 +1,61 @@ +package com.zjj.aisearch.demo.sort; + +/** + * @program: AISearch + * @description: + * @author: zjj + * @create: 2020-03-14 17:42:38 + **/ + +/** + * https://blog.csdn.net/huosanghuakai1995/article/details/75090370/ + */ +public class Demo1 { + public static int arr[] = {3, 0, 2, 5, 8, 1, 9, 4}; + + public static void main(String[] args) { + // bubbleSort(arr); + selectionSort(arr); + for (int a : arr) { + System.out.println(a); + } + } + + //冒泡排序 + public static void bubbleSort(int array[]) { + + int t = 0; + for (int i = 0; i < array.length - 1; i++) { + for (int j = 0; j < array.length - 1 - i; j++) { + if (array[j] > array[j + 1]) { + t = array[j]; + array[j] = array[j + 1]; + array[j + 1] = t; + } + } + } + } + + //选择排序 + public static int[] selectionSort(int[] array) { + if (array.length == 0) { + return array; + } + for (int i = 0; i < array.length; i++) { + // vim 删除到前一个单词 + int minIndex = i; + for (int j = i; j < array.length; j++) { + if (array[j] < array[minIndex]) { + minIndex = j; + } + } + int temp = array[minIndex]; + array[minIndex] = array[i]; + array[i] = temp; + + } + return array; + } + + +} diff --git a/src/main/java/com/zjj/aisearch/demo/spring/AnnotationApplicationContext.java b/src/main/java/com/zjj/aisearch/demo/spring/AnnotationApplicationContext.java new file mode 100644 index 0000000..e954ea8 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/spring/AnnotationApplicationContext.java @@ -0,0 +1,97 @@ +package com.zjj.aisearch.demo.spring; + + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.concurrent.ConcurrentHashMap; + +public class AnnotationApplicationContext implements ApplicationContext,BeanRegister { + private Map instanceMapping = new ConcurrentHashMap(); + + //保存所有bean的信息,主要包含bean的类型 id等信息 + private List beanDefinitions = new ArrayList(); + //配置文件的config,这里为了简单我们使用properties文件 + private Properties config = new Properties(); + + public AnnotationApplicationContext(String location){ + InputStream is = null; + try{ + + //1、定位 + is = this.getClass().getClassLoader().getResourceAsStream(location); + + //2、载入 + config.load(is); + + //3、注册 + register(); + + //4、实例化 + createBean(); + + //5、注入 + populate(); + + }catch(Exception e){ + e.printStackTrace(); + }finally { + try { + is.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + /** + * 调用具体委派的注入类进行注入 + */ + private void populate() { + Populator populator = new Populator(); + populator.populate(instanceMapping); + } + + /** + * 调用具体的创建对象创建bean + */ + private void createBean() { + BeanCreater creater = new BeanCreater(this); + creater.create(beanDefinitions); + } + + /** + * 调用具体的注册对象注册bean信息 + */ + private void register() { + BeanDefinitionParser parser = new BeanDefinitionParser(this); + parser.parse(config); + } + + public Object getBean(String id) { + return instanceMapping.get(id); + } + public Properties getConfig() { + return this.config; + } + + public T getBean(String id, Class clazz) { + return (T)instanceMapping.get(id); + } + + public Map getBeans() { + return instanceMapping; + } + + public void registBeanDefinition(List bds) { + beanDefinitions.addAll(bds); + } + + public void registInstanceMapping(String id, Object instance) { + instanceMapping.put(id,instance); + } + +} diff --git a/src/main/java/com/zjj/aisearch/demo/spring/ApplicationContext.java b/src/main/java/com/zjj/aisearch/demo/spring/ApplicationContext.java new file mode 100644 index 0000000..029b7e4 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/spring/ApplicationContext.java @@ -0,0 +1,27 @@ +package com.zjj.aisearch.demo.spring; + +import java.util.Map; + +public interface ApplicationContext { + /** + * 根据id获取bean + * @param id + * @return + */ + Object getBean(String id); + + /** + * 根据id获取特定类型的bean,完成强转 + * @param id + * @param clazz + * @param + * @return + */ + T getBean(String id,Class clazz); + + /** + * 获取工厂内的所有bean集合 + * @return + */ + Map getBeans(); +} diff --git a/src/main/java/com/zjj/aisearch/demo/spring/Autowire.java b/src/main/java/com/zjj/aisearch/demo/spring/Autowire.java new file mode 100644 index 0000000..43f089b --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/spring/Autowire.java @@ -0,0 +1,10 @@ +package com.zjj.aisearch.demo.spring; + +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD)//作用在字段上面 +@Documented +public @interface Autowire { + String value() default ""; +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/demo/spring/BeanCreater.java b/src/main/java/com/zjj/aisearch/demo/spring/BeanCreater.java new file mode 100644 index 0000000..08fe6e5 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/spring/BeanCreater.java @@ -0,0 +1,23 @@ +package com.zjj.aisearch.demo.spring; + +import java.util.List; + +public class BeanCreater { + + private BeanRegister register; + + public BeanCreater(BeanRegister register) { + this.register = register; + } + + public void create(List bds) { + for (BeanDefinition bd : bds) { + doCreate(bd); + } + } + + private void doCreate(BeanDefinition bd) { + Object instance = bd.getInstance(); + this.register.registInstanceMapping(bd.getId(), instance); + } +} diff --git a/src/main/java/com/zjj/aisearch/demo/spring/BeanDefinition.java b/src/main/java/com/zjj/aisearch/demo/spring/BeanDefinition.java new file mode 100644 index 0000000..485198b --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/spring/BeanDefinition.java @@ -0,0 +1,35 @@ +package com.zjj.aisearch.demo.spring; + +public class BeanDefinition{ + private String id; + private Class clazz; + public BeanDefinition(String id, Class clazz){ + this.id = id; + this.clazz = clazz; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Class getClazz() { + return clazz; + } + + public void setClazz(Class clazz) { + this.clazz = clazz; + } + + public Object getInstance(){ + try { + return clazz.newInstance(); + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/demo/spring/BeanDefinitionGenerator.java b/src/main/java/com/zjj/aisearch/demo/spring/BeanDefinitionGenerator.java new file mode 100644 index 0000000..da22f9f --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/spring/BeanDefinitionGenerator.java @@ -0,0 +1,61 @@ +package com.zjj.aisearch.demo.spring; + +import java.util.ArrayList; +import java.util.List; + +public class BeanDefinitionGenerator { + + public static List generate(String className) { + try { + System.out.println(className); + Class clazz = Class.forName(className); + + + String[] ids = generateIds(clazz); + if (ids == null) { + return null; + } + List list = new ArrayList(); + for (String id : ids) { + list.add(new BeanDefinition(id, clazz)); + } + return list; + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } + return null; + } + + + /** + * 生成id数组 + * 1.带有@Controller 注解但是注解value没给值,@Controller一般没有 + * 接口定义,用类的全名作为id返回ids长度为1 + * 2.@Component 没有value 获取所有的实现的接口,接口名为id,返货ids数组 + * 长度是实现的接口个数 + * 3.@Component 有value 返回id=value + * 4.不带容器要实例化的注解 null + */ + private static String[] generateIds(Class clazz) { + String[] ids = null; + if (clazz.isAnnotationPresent(Controller.class)) { + ids = new String[]{clazz.getName()}; + } else if (clazz.isAnnotationPresent(Component.class)) { + Component component = (Component) clazz.getAnnotation(Component.class); + String value = component.value(); + if (!"".equals(value)) { + ids = new String[]{value}; + } else { + Class[] interfaces = clazz.getInterfaces(); + ids = new String[interfaces.length]; + //如果这个类实现了接口,就用接口的类型作为id + for (int i = 0; i < interfaces.length; i++) { + ids[i] = interfaces[i].getName(); + } + return ids; + } + } + return ids; + } + +} diff --git a/src/main/java/com/zjj/aisearch/demo/spring/BeanDefinitionParser.java b/src/main/java/com/zjj/aisearch/demo/spring/BeanDefinitionParser.java new file mode 100644 index 0000000..9fd1f9e --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/spring/BeanDefinitionParser.java @@ -0,0 +1,52 @@ +package com.zjj.aisearch.demo.spring; + + +import java.io.File; +import java.net.URL; +import java.util.List; +import java.util.Properties; + +public class BeanDefinitionParser { + //配置的扫描包的key + public static final String SCAN_PACKAGE = "scanPackage"; + //容器注册对象 + private BeanRegister register; + + public BeanDefinitionParser(BeanRegister register) { + this.register = register; + } + + public void parse(Properties properties) { + //获取要扫描的包 + String packageName = properties.getProperty(SCAN_PACKAGE); + //执行注册 + doRegister(packageName); + } + + + private void doRegister(String packageName) { + //获取此包名下的绝对路径 + URL url = getClass().getClassLoader().getResource("./"+packageName.replaceAll("\\.","/")); + //URL url = getClass().getClassLoader().getResource("./com/zjj/aisearch/demo/spring/"); + File dir = new File(url.getFile()); + //循环遍历 递归找到所有的java文件 + for (File file : dir.listFiles()) { + if (file.isDirectory()) { + + //文件夹-->递归继续执行 + doRegister(packageName + "." + file.getName()); + } else { + //处理文件名来获取类名 运行时获取到的是class文件 + String className = packageName + "." + file.getName().replaceAll(".class", "").trim(); + //调用BeanDefinitionGenerator.generate(className)方法,来处理 + //1.类带有容器要处理的注解,则解析id生成BeanDefinition集合返回 + //2.不带有需要处理的注解 直接返回null + List definitions = BeanDefinitionGenerator.generate(className); + if (definitions == null) continue; + //调用容器的注册方法来完成bean信息的注册 + this.register.registBeanDefinition(definitions); + } + } + + } +} diff --git a/src/main/java/com/zjj/aisearch/demo/spring/BeanRegister.java b/src/main/java/com/zjj/aisearch/demo/spring/BeanRegister.java new file mode 100644 index 0000000..595318d --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/spring/BeanRegister.java @@ -0,0 +1,17 @@ +package com.zjj.aisearch.demo.spring; +import java.util.List; + +public interface BeanRegister { + /** + * 向工厂内注册BeanDefinition + * @param bds + */ + void registBeanDefinition(List bds); + + /** + * 向工厂内注册bean实例对象 + * @param id + * @param instance + */ + void registInstanceMapping(String id,Object instance); +} diff --git a/src/main/java/com/zjj/aisearch/demo/spring/Component.java b/src/main/java/com/zjj/aisearch/demo/spring/Component.java new file mode 100644 index 0000000..953b3de --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/spring/Component.java @@ -0,0 +1,10 @@ +package com.zjj.aisearch.demo.spring; + +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +@Documented +public @interface Component { + String value() default ""; +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/demo/spring/Controller.java b/src/main/java/com/zjj/aisearch/demo/spring/Controller.java new file mode 100644 index 0000000..63dfd78 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/spring/Controller.java @@ -0,0 +1,9 @@ +package com.zjj.aisearch.demo.spring; +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME)//运行时注解 +@Target(ElementType.TYPE)//作用在类上面 +@Documented +public @interface Controller { + String value() default ""; +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/demo/spring/MyController.java b/src/main/java/com/zjj/aisearch/demo/spring/MyController.java new file mode 100644 index 0000000..70ebc62 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/spring/MyController.java @@ -0,0 +1,23 @@ +package com.zjj.aisearch.demo.spring; + +/** + * @program: AISearch + * @description: + * @author: zjj + * @create: 2020-03-14 16:08:35 + **/ +@Controller +public class MyController { + @Autowire("myservice") + private MyService service; + + public void test() { + service.say("hello,spring IoC"); + } + + public static void main(String[] args) { + ApplicationContext context = new AnnotationApplicationContext("applicationContext.properties"); + MyController controller = context.getBean("com.zjj.aisearch.demo.spring.MyController", MyController.class); + controller.test(); + } +} diff --git a/src/main/java/com/zjj/aisearch/demo/spring/MyService.java b/src/main/java/com/zjj/aisearch/demo/spring/MyService.java new file mode 100644 index 0000000..bad3b7b --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/spring/MyService.java @@ -0,0 +1,15 @@ +package com.zjj.aisearch.demo.spring; + +/** + * @program: AISearch + * @description: + * @author: zjj + * @create: 2020-03-14 16:11:16 + **/ +@Component("myservice") +public class MyService { + + public void say(String s) { + System.out.println(s); + } +} diff --git a/src/main/java/com/zjj/aisearch/demo/spring/MySpring.java b/src/main/java/com/zjj/aisearch/demo/spring/MySpring.java new file mode 100644 index 0000000..9bafe6c --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/spring/MySpring.java @@ -0,0 +1,38 @@ +package com.zjj.aisearch.demo.spring; + +import com.zjj.aisearch.demo.annotations.ZjjRequestMapping; + +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +/** + * @program: AISearch + * @description: 自己写的Spring + * @author: zjj + * @create: 2020-02-28 11:54:23 + **/ +public class MySpring { + public static void main(String[] args) throws Exception, IllegalAccessException, InvocationTargetException, InstantiationException { + //1:扫描包下的所有类 + Class controller = Class.forName("com.zjj.aisearch.demo.spring.SpringTestController"); + SpringTestController springTestController = (SpringTestController) controller.newInstance(); + Class service = Class.forName("com.zjj.aisearch.demo.spring.SpringTestService"); + SpringTestService springTestService = (SpringTestService) service.newInstance(); + Method test = controller.getMethod("test"); + Field springTestService1 = controller.getField("name"); + springTestService1.set(springTestController,"xixi"); + System.out.println(springTestService1.get(springTestController)); + Field springTestService2 = controller.getField("springTestService"); + springTestService2.set(springTestController,springTestService); + springTestController.test(); + ZjjRequestMapping declaredAnnotation = test.getDeclaredAnnotation(ZjjRequestMapping.class); + //2.获取所有类上的注解 + //3.判断注解是否是ZjjController + //4.是的话实例化,放到容器中交给容器管理 + //5.扫描字段上的注解 + //6.判断是否是ZjjAutowired + //7.是的话,通过反射注入实例 + //8.测试直接使用 + } +} diff --git a/src/main/java/com/zjj/aisearch/demo/spring/Populator.java b/src/main/java/com/zjj/aisearch/demo/spring/Populator.java new file mode 100644 index 0000000..72e9077 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/spring/Populator.java @@ -0,0 +1,35 @@ +package com.zjj.aisearch.demo.spring; + +import java.lang.reflect.Field; +import java.util.Map; + +public class Populator { + + public Populator(){ + } + + public void populate(Map instanceMapping){ + //首先要判断ioc容器中有没有东西 + if(instanceMapping.isEmpty())return; + + //循环遍历每一个容器中得对象 + for (Map.Entry entry:instanceMapping.entrySet()){ + //获取对象的字段 + Field[] fields = entry.getValue().getClass().getDeclaredFields(); + for (Field field:fields){ + if(!field.isAnnotationPresent(Autowire.class))continue; + Autowire autowire = field.getAnnotation(Autowire.class); + //后去字段要注入的id value 为空则按类名 接口名自动注入 + String id = autowire.value(); + if("".equals(id))id = field.getType().getName(); + field.setAccessible(true); + try { + //反射注入 + field.set(entry.getValue(),instanceMapping.get(id)); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + } + } + } +} diff --git a/src/main/java/com/zjj/aisearch/demo/spring/RequestMapping.java b/src/main/java/com/zjj/aisearch/demo/spring/RequestMapping.java new file mode 100644 index 0000000..7ef8ccc --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/spring/RequestMapping.java @@ -0,0 +1,10 @@ +package com.zjj.aisearch.demo.spring; + +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE,ElementType.METHOD})//作用在类和方法 仿照springmvc的套路来 +@Documented +public @interface RequestMapping { + String value() default ""; +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/demo/spring/RequestParam.java b/src/main/java/com/zjj/aisearch/demo/spring/RequestParam.java new file mode 100644 index 0000000..efe0c8d --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/spring/RequestParam.java @@ -0,0 +1,10 @@ +package com.zjj.aisearch.demo.spring; + +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.PARAMETER)//作用在方法的参数上面 +@Documented +public @interface RequestParam { + String value() default ""; +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/demo/spring/SpringTestController.java b/src/main/java/com/zjj/aisearch/demo/spring/SpringTestController.java new file mode 100644 index 0000000..e00b74f --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/spring/SpringTestController.java @@ -0,0 +1,64 @@ +package com.zjj.aisearch.demo.spring; + +import com.zjj.aisearch.demo.annotations.ZjjAutowired; +import com.zjj.aisearch.demo.annotations.ZjjController; +import com.zjj.aisearch.demo.annotations.ZjjRequestMapping; +import com.zjj.aisearch.demo.tomcat.MyRequest; +import com.zjj.aisearch.demo.tomcat.MyResponse; +import com.zjj.aisearch.demo.tomcat.MyServlet; + +import java.io.IOException; +import java.lang.reflect.Field; + +/** + * @program: AISearch + * @description: 自己写spring框架测试Controller + * @author: zjj + * @create: 2020-02-28 19:14:57 + **/ +@ZjjController +public class SpringTestController extends MyServlet { + + @ZjjAutowired + public SpringTestService springTestService; + + public String name = "haha"; + + @ZjjRequestMapping("/testspring") + public void test() { + springTestService.test(); + } + + public void test2() { + System.out.println("test2----"); + } + + @Override + public void doGet(MyRequest myRequest, MyResponse myResponse) { + try { + if (myRequest.getUrl().equals("/testspring")) { + Class controller = Class.forName("com.zjj.aisearch.demo.spring.SpringTestController"); + Class service = Class.forName("com.zjj.aisearch.demo.spring.SpringTestService"); + SpringTestService springTestService = (SpringTestService) service.newInstance(); + SpringTestController springTestController = (SpringTestController) controller.newInstance(); + Field springTestService2 = controller.getField("springTestService"); + System.out.println(springTestService2.get(springTestController)); + System.out.println(springTestService); + this.springTestService = springTestService; + System.out.println(springTestService2.get(springTestController)); + test(); + myResponse.write("Hello, this is my blog"); + } + } catch (IOException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } catch (InstantiationException e) { + e.printStackTrace(); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/zjj/aisearch/demo/spring/SpringTestService.java b/src/main/java/com/zjj/aisearch/demo/spring/SpringTestService.java new file mode 100644 index 0000000..778bcea --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/spring/SpringTestService.java @@ -0,0 +1,17 @@ +package com.zjj.aisearch.demo.spring; + +import com.zjj.aisearch.demo.annotations.ZjjService; + +/** + * @program: AISearch + * @description: + * @author: zjj + * @create: 2020-02-28 19:16:24 + **/ +@ZjjService +public class SpringTestService { + + public void test() { + System.out.println("test........."); + } +} diff --git a/src/main/java/com/zjj/aisearch/demo/spring/TestSpring.java b/src/main/java/com/zjj/aisearch/demo/spring/TestSpring.java new file mode 100644 index 0000000..81dda07 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/spring/TestSpring.java @@ -0,0 +1,21 @@ +package com.zjj.aisearch.demo.spring; + +import com.zjj.aisearch.demo.annotations.ZjjAutowired; +import com.zjj.aisearch.demo.annotations.ZjjController; + +/** + * @program: AISearch + * @description: + * @author: zjj + * @create: 2020-02-29 00:20:51 + **/ +@ZjjController +public class TestSpring { + + @ZjjAutowired + public SpringTestController springTestController; + + public void test() { + springTestController.test(); + } +} diff --git a/src/main/java/com/zjj/aisearch/demo/test/TestScan.java b/src/main/java/com/zjj/aisearch/demo/test/TestScan.java new file mode 100644 index 0000000..af3f96e --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/test/TestScan.java @@ -0,0 +1,237 @@ +package com.zjj.aisearch.demo.test; + +import com.zjj.aisearch.demo.annotations.ZjjAutowired; +import com.zjj.aisearch.demo.annotations.ZjjController; +import com.zjj.aisearch.demo.annotations.ZjjRequestMapping; +import com.zjj.aisearch.demo.annotations.ZjjService; +import com.zjj.aisearch.demo.controller.MyTestController; +import com.zjj.aisearch.demo.spring.SpringTestController; +import com.zjj.aisearch.demo.spring.TestSpring; +import com.zjj.aisearch.demo.utils.ClazzUtils; +import org.apache.commons.collections.map.HashedMap; + +import java.io.File; +import java.lang.annotation.Annotation; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +/** + * @program: AISearch + * @description: 扫描注解测试 + * @author: zjj + * @create: 2020-02-27 23:52:45 + **/ +public class TestScan { + public static void main(String[] args) throws Exception, IllegalAccessException, ClassNotFoundException, NoSuchMethodException { + + //getClassAnnotation(); + //getMethodAnnotation(requestURL); + getPackage2(); + } + + /** + * get指定类的所有注解 + */ + private static void getClassAnnotation() { + Class newClass = MyTestController.class; + for (Annotation annotation : newClass.getDeclaredAnnotations()) { + System.out.println(annotation.toString()); + } + } + + /** + * 扫描指定包下的所有类 + */ + private static void getPackage() throws ClassNotFoundException, IllegalAccessException, InstantiationException, NoSuchFieldException, NoSuchMethodException, InvocationTargetException { + File file = new File("F:\\AISearch\\src\\main\\java\\com\\zjj\\aisearch\\demo\\spring"); + /** + * 1. String[] list() ; + + 说明:返回某个目录下所有文件和目录的文件名,返回类型String[] + File[] listFiles(); + 说明:返回某个目录下所有文件和目录的绝对路径,返回类型File[] + */ + String[] list = file.list(); + File[] files = file.listFiles(); + List ll = new LinkedList<>(); + String packageName = new String("com.zjj.aisearch.demo.spring."); + for (String l : list) { + String[] split = l.split("\\."); + //System.out.println(split[0]); + String s = packageName + split[0]; + ll.add(s); + } + Map map = new HashMap<>(); + for (String l : ll) { + //System.out.println(l); + Class clazz = Class.forName(l); + try { + Object o = clazz.newInstance(); + map.put(l, o); + } catch (InstantiationException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + } + + Object o = map.get("com.zjj.aisearch.demo.spring.SpringTestController"); + Object service = map.get("com.zjj.aisearch.demo.spring.SpringTestService"); + Class aClass = o.getClass(); + Field name = aClass.getField("springTestService"); + name.set(o, service); + Method test = aClass.getMethod("test"); + test.invoke(o); + + } + + /** + * 扫描指定包下的所有类 + */ + private static void getPackage1() throws ClassNotFoundException, IllegalAccessException, InstantiationException, NoSuchFieldException, NoSuchMethodException, InvocationTargetException { + File file = new File("F:\\AISearch\\src\\main\\java\\com\\zjj\\aisearch\\demo\\spring"); + /** + * 1. String[] list() ; + + 说明:返回某个目录下所有文件和目录的文件名,返回类型String[] + File[] listFiles(); + 说明:返回某个目录下所有文件和目录的绝对路径,返回类型File[] + */ + String[] list = file.list(); + File[] files = file.listFiles(); + List ll = new LinkedList<>(); + String packageName = new String("com.zjj.aisearch.demo.spring."); + for (String l : list) { + String[] split = l.split("\\."); + //System.out.println(split[0]); + String s = packageName + split[0]; + ll.add(s); + } + Map map = new HashMap<>(); + Map map2 = new HashMap<>(); + for (String l : ll) { + //System.out.println(l); + Class clazz = Class.forName(l); + boolean annotationPresent = clazz.isAnnotationPresent(ZjjController.class); + boolean annotationPresent2 = clazz.isAnnotationPresent(ZjjService.class); + if (annotationPresent || annotationPresent2) { + Field[] fields = clazz.getFields(); + for (Field f : fields) { + ZjjAutowired declaredAnnotation = f.getDeclaredAnnotation(ZjjAutowired.class); + if (declaredAnnotation != null) { + + System.out.println(f.getType().getSimpleName()); + Class aClass = Class.forName(packageName + f.getType().getSimpleName()); + Object o = aClass.newInstance(); + Object o2 = clazz.newInstance(); + f.set(o2, o); + clazz.getMethod("test").invoke(o2); + } else { + Object o2 = clazz.newInstance(); + } + } + } + + } + + } + + /** + * get指定类的所有自己定义的方法上的注解 + * 获取指定注解 + * + * @param requestURL + */ + public static Object getMethodAnnotation(StringBuffer requestURL) throws InvocationTargetException, IllegalAccessException, ClassNotFoundException, NoSuchMethodException, InstantiationException { + Class newClass = MyTestController.class; + Class aClass = Class.forName("com.zjj.aisearch.demo.controller.MyTestController"); + Constructor constructor = aClass.getConstructor(); + Object o = constructor.newInstance(); + /* Method test = aClass.getMethod("test2",String.class); + Object invoke = test.invoke(o,"lili"); + System.out.println(invoke);*/ + + Method[] methods = aClass.getDeclaredMethods(); + for (Method method : methods) { + ZjjRequestMapping declaredAnnotation = method.getDeclaredAnnotation(ZjjRequestMapping.class); + if (declaredAnnotation != null) { + System.out.println(method); + String value = declaredAnnotation.value(); + System.out.println("http://localhost" + value); + System.out.println(requestURL); + System.out.println(("http://localhost" + value).equals(requestURL)); + if (("http://localhost" + value).equals(requestURL.toString())) { + Object invoke = method.invoke(o); + return invoke; + } + } + } + return "--------"; + } + + /** + * 扫描包下的所有类 + */ + public static void getPackage2() throws ClassNotFoundException, IllegalAccessException, InstantiationException { + + //指定包下的所有类的全路径 + List clazzs = ClazzUtils.getClazzName("com.zjj.aisearch.demo.spring", false); + System.out.println(clazzs); + //实例化所有加ZjjController的类 + //得到所有类的Class对象 + //容器 + Map map = new HashedMap(); + for (String clazz : clazzs) { + Class clazzObject = Class.forName(clazz); + //扫描ZjjService和ZjjController,并实例化 + if (clazzObject.isAnnotationPresent(ZjjService.class) || clazzObject.isAnnotationPresent(ZjjController.class)) { + Object instance = clazzObject.newInstance(); + //扫描ZjjAutowire + Field[] fields = clazzObject.getFields(); + //遍历所有字段 + for (Field field : fields) { + ZjjAutowired annotation = field.getAnnotation(ZjjAutowired.class); + //如果包含ZjjAutowired + if (annotation != null) { + //获取该字段全名 + String typeName = field.getType().getTypeName(); + //实例化该字段 + Class fieldObject = Class.forName(typeName); + Object fieldInstance = fieldObject.newInstance(); + //注入 + field.set(instance, fieldInstance); + Field[] fields1 = fieldObject.getFields(); + for (Field field1 : fields1) { + ZjjAutowired annotation1 = field1.getAnnotation(ZjjAutowired.class); + //如果包含ZjjAutowired + if (annotation1 != null) { + //获取该字段全名 + String typeName1 = field1.getType().getTypeName(); + //实例化该字段 + Class fieldInstance1 = Class.forName(typeName1); + Object fieldInstance2 = fieldInstance1.newInstance(); + //注入 + field1.set(fieldInstance, fieldInstance2); + map.put(typeName1, fieldInstance); + + } + } + } + } + } + } + + TestSpring testSpring = (TestSpring) map.get("com.zjj.aisearch.demo.spring.TestSpring"); + System.out.println(testSpring); + testSpring.test(); + SpringTestController springTestController = (SpringTestController) map.get("com.zjj.aisearch.demo.spring.SpringTestController"); + System.out.println(springTestController); + + } +} diff --git a/src/main/java/com/zjj/aisearch/demo/test/TestScanClass.java b/src/main/java/com/zjj/aisearch/demo/test/TestScanClass.java new file mode 100644 index 0000000..51419cb --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/test/TestScanClass.java @@ -0,0 +1,12 @@ +package com.zjj.aisearch.demo.test; + +/** + * @program: AISearch + * @description: + * @author: zjj + * @create: 2020-02-28 23:26:43 + **/ +public class TestScanClass { + public void scan() { + } +} diff --git a/src/main/java/com/zjj/aisearch/demo/thread/CallableDemo.java b/src/main/java/com/zjj/aisearch/demo/thread/CallableDemo.java new file mode 100644 index 0000000..13e968c --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/thread/CallableDemo.java @@ -0,0 +1,16 @@ +package com.zjj.aisearch.demo.thread; + +import java.util.concurrent.Callable; + +/** + * @program: AISearch + * @description: + * @author: zjj + * @create: 2020-02-24 21:26:00 + **/ +public class CallableDemo implements Callable { + @Override + public String call() throws Exception { + return "haha"; + } +} diff --git a/src/main/java/com/zjj/aisearch/demo/thread/SubThread.java b/src/main/java/com/zjj/aisearch/demo/thread/SubThread.java new file mode 100644 index 0000000..dc17fe4 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/thread/SubThread.java @@ -0,0 +1,20 @@ +package com.zjj.aisearch.demo.thread; + +/** + * @program: AISearch + * @description: + * @author: zjj + * @create: 2020-02-24 19:43:24 + **/ +public class SubThread extends Thread { + public void run() { + for (int i = 1; i < 100; i++) { + try { + Thread.sleep(10); + } catch (InterruptedException e) { + e.printStackTrace(); + } + System.out.println("subThead: " + getName()); + } + } +} diff --git a/src/main/java/com/zjj/aisearch/demo/thread/SubThread1.java b/src/main/java/com/zjj/aisearch/demo/thread/SubThread1.java new file mode 100644 index 0000000..20b3b2d --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/thread/SubThread1.java @@ -0,0 +1,20 @@ +package com.zjj.aisearch.demo.thread; + +/** + * @program: AISearch + * @description: + * @author: zjj + * @create: 2020-02-24 19:43:24 + **/ +public class SubThread1 implements Runnable { + public void run() { + for (int i = 1; i < 100; i++) { + try { + Thread.sleep(50); + } catch (InterruptedException e) { + e.printStackTrace(); + } + System.out.println("subThead: " + i); + } + } +} diff --git a/src/main/java/com/zjj/aisearch/demo/thread/ThreadDemo1.java b/src/main/java/com/zjj/aisearch/demo/thread/ThreadDemo1.java new file mode 100644 index 0000000..bf54043 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/thread/ThreadDemo1.java @@ -0,0 +1,42 @@ +package com.zjj.aisearch.demo.thread; + +/** + * @program: AISearch + * @description: + * @author: zjj + * @create: 2020-02-24 19:42:08 + **/ +public class ThreadDemo1 { + public static void main(String[] args) throws InterruptedException { + SubThread1 subThread = new SubThread1(); + Thread thread = new Thread(subThread); + thread.start(); + System.out.println(thread.getName()); + new Thread() { + public void run() { + for (int i = 1; i < 100; i++) { + try { + Thread.sleep(10); + } catch (InterruptedException e) { + e.printStackTrace(); + } + System.out.println("new: " + i); + } + } + }.start(); + new Thread(() -> { + for (int i = 1; i < 100; i++) { + try { + Thread.sleep(10); + } catch (InterruptedException e) { + e.printStackTrace(); + } + System.out.println("runable: " + i); + } + }).start(); + for (int i = 1; i < 100; i++) { + Thread.sleep(10); + System.out.println("main: " + i); + } + } +} diff --git a/src/main/java/com/zjj/aisearch/demo/thread/ThreadDemo2.java b/src/main/java/com/zjj/aisearch/demo/thread/ThreadDemo2.java new file mode 100644 index 0000000..8b8bd24 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/thread/ThreadDemo2.java @@ -0,0 +1,20 @@ +package com.zjj.aisearch.demo.thread; + +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; + +/** + * @program: AISearch + * @description: + * @author: zjj + * @create: 2020-02-24 19:42:08 + **/ +public class ThreadDemo2 { + public static void main(String[] args) throws InterruptedException { + ExecutorService executorService = Executors.newFixedThreadPool(2); + Future submit = (Future) executorService.submit(new ThreadPoolRunnable()); + Future submit2 = (Future) executorService.submit(new ThreadPoolRunnable()); + + } +} diff --git a/src/main/java/com/zjj/aisearch/demo/thread/ThreadDemo3.java b/src/main/java/com/zjj/aisearch/demo/thread/ThreadDemo3.java new file mode 100644 index 0000000..18263c4 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/thread/ThreadDemo3.java @@ -0,0 +1,22 @@ +package com.zjj.aisearch.demo.thread; + +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; + +/** + * @program: AISearch + * @description: + * @author: zjj + * @create: 2020-02-24 19:42:08 + **/ +public class ThreadDemo3 { + public static void main(String[] args) throws InterruptedException, ExecutionException { + ExecutorService executorService = Executors.newFixedThreadPool(2); + Future submit = executorService.submit(new CallableDemo() + ); + String s = submit.get(); + System.out.println(s); + } +} diff --git a/src/main/java/com/zjj/aisearch/demo/thread/ThreadPoolRunnable.java b/src/main/java/com/zjj/aisearch/demo/thread/ThreadPoolRunnable.java new file mode 100644 index 0000000..0bbd4a9 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/thread/ThreadPoolRunnable.java @@ -0,0 +1,14 @@ +package com.zjj.aisearch.demo.thread; + +/** + * @program: AISearch + * @description: + * @author: zjj + * @create: 2020-02-24 21:22:04 + **/ +public class ThreadPoolRunnable implements Runnable { + @Override + public void run() { + System.out.println("任务"); + } +} diff --git a/src/main/java/com/zjj/aisearch/demo/tomcat/IndexServlet.java b/src/main/java/com/zjj/aisearch/demo/tomcat/IndexServlet.java new file mode 100644 index 0000000..f76a516 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/tomcat/IndexServlet.java @@ -0,0 +1,24 @@ +package com.zjj.aisearch.demo.tomcat; + +import java.io.IOException; + + +public class IndexServlet extends MyServlet { + @Override + public void doGet(MyRequest myRequest, MyResponse myResponse) { + try { + myResponse.write("Hello, myTomcat"); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Override + public void doPost(MyRequest myRequest, MyResponse myResponse) { + try { + myResponse.write("Hello, myTomcat"); + } catch (IOException e) { + e.printStackTrace(); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/demo/tomcat/MyBlog.java b/src/main/java/com/zjj/aisearch/demo/tomcat/MyBlog.java new file mode 100644 index 0000000..3c8f124 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/tomcat/MyBlog.java @@ -0,0 +1,23 @@ +package com.zjj.aisearch.demo.tomcat; + +import java.io.IOException; + + +public class MyBlog extends MyServlet { + @Override + public void doGet(MyRequest myRequest, MyResponse myResponse) { + try { + myResponse.write("Hello, this is my blog"); + } catch (IOException e) { + e.printStackTrace(); + } + } + @Override + public void doPost(MyRequest myRequest, MyResponse myResponse) { + try { + myResponse.write("Hello, this is my blog"); + } catch (IOException e) { + e.printStackTrace(); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/demo/tomcat/MyRequest.java b/src/main/java/com/zjj/aisearch/demo/tomcat/MyRequest.java new file mode 100644 index 0000000..2b76078 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/tomcat/MyRequest.java @@ -0,0 +1,54 @@ +package com.zjj.aisearch.demo.tomcat; + +import java.io.IOException; +import java.io.InputStream; + +/** + * @program: AISearch + * @description: 自己封装的请求体 + * @author: zjj + * @create: 2020-02-28 10:38:41 + **/ +public class MyRequest { + //请求路径 + private String url; + private String method; + + public MyRequest(InputStream inputStream) throws IOException { + String httpRequest = ""; + byte[] httpRequestBytes = new byte[1024]; + int length = 0; + if ((length = inputStream.read(httpRequestBytes))>0) { + httpRequest = new String(httpRequestBytes,0,length); + } + String httpHead = httpRequest.split("\n")[0]; + System.out.println(httpHead); + method = httpHead.split("\\s")[0]; + url = httpHead.split("\\s")[1]; + System.out.println(this.toString()); + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getMethod() { + return method; + } + + public void setMethod(String method) { + this.method = method; + } + + @Override + public String toString() { + return "MyRequest{" + + "url='" + url + '\'' + + ", method='" + method + '\'' + + '}'; + } +} diff --git a/src/main/java/com/zjj/aisearch/demo/tomcat/MyResponse.java b/src/main/java/com/zjj/aisearch/demo/tomcat/MyResponse.java new file mode 100644 index 0000000..4578580 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/tomcat/MyResponse.java @@ -0,0 +1,31 @@ +package com.zjj.aisearch.demo.tomcat; + +import java.io.IOException; +import java.io.OutputStream; + +/** + * @program: AISearch + * @description: 自己写的响应 + * @author: zjj + * @create: 2020-02-28 10:46:13 + **/ +public class MyResponse { + private OutputStream outputStream; + public MyResponse(OutputStream outputStream) { + this.outputStream = outputStream; + } + + public void write(String content) throws IOException { + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append("HTTP/1.1 200 OK\n") //按照HTTP响应报文的格式写入 + .append("Content-Type:text/html\n") + .append("\r\n") + .append("") + .append(content) //将页面内容写入 + .append(""); + byte[] bytes = stringBuffer.toString().getBytes(); + outputStream.write(bytes); + outputStream.close(); + + } +} diff --git a/src/main/java/com/zjj/aisearch/demo/tomcat/MyServlet.java b/src/main/java/com/zjj/aisearch/demo/tomcat/MyServlet.java new file mode 100644 index 0000000..81d7197 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/tomcat/MyServlet.java @@ -0,0 +1,24 @@ +package com.zjj.aisearch.demo.tomcat; + +/** + * @program: AISearch + * @description: 我的Servlet + * @author: zjj + * @create: 2020-02-28 10:49:41 + **/ +public abstract class MyServlet { + public void service(MyRequest myRequest,MyResponse myResponse) { + if (myRequest.getMethod().equalsIgnoreCase("POST")) { + doPost(myRequest,myResponse); + } else if(myRequest.getMethod().equalsIgnoreCase("GET")) { + doGet(myRequest, myResponse); + } + } + + public void doGet(MyRequest myRequest, MyResponse myResponse) { + } + + public void doPost(MyRequest myRequest, MyResponse myResponse) { + + } +} diff --git a/src/main/java/com/zjj/aisearch/demo/tomcat/MyTomcat.java b/src/main/java/com/zjj/aisearch/demo/tomcat/MyTomcat.java new file mode 100644 index 0000000..ac4d1c1 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/tomcat/MyTomcat.java @@ -0,0 +1,65 @@ +package com.zjj.aisearch.demo.tomcat; + +import java.io.InputStream; +import java.io.OutputStream; +import java.net.ServerSocket; +import java.net.Socket; +import java.util.HashMap; +import java.util.Map; + +/** + * @program: AISearch + * @description: 自己写的tomcat + * @author: zjj + * @create: 2020-02-28 10:20:33 + **/ +public class MyTomcat { + private Integer port = 8080; + + private Map urlServletMapping = new HashMap<>(); + + public MyTomcat(Integer port) { + this.port = port; + } + + public void start() throws Exception, IllegalAccessException, InstantiationException, ClassNotFoundException { + + + initServletMapping(); + ServerSocket serverSocket = new ServerSocket(port); + System.out.println("MyTomcat is Starting..."); + while (true) { + Socket accept = serverSocket.accept(); + InputStream inputStream = accept.getInputStream(); + OutputStream outputStream = accept.getOutputStream(); + MyRequest myRequest = new MyRequest(inputStream); + MyResponse myResponse = new MyResponse(outputStream); + dispatch(myRequest, myResponse); + accept.close(); + } + } + + private void dispatch(MyRequest myRequest, MyResponse myResponse) throws Exception, IllegalAccessException, InstantiationException { + String s = urlServletMapping.get(myRequest.getUrl()); + Class myServletClass = Class.forName(s); + MyServlet myservlet = (MyServlet) myServletClass.newInstance(); + myservlet.service(myRequest, myResponse); + /* Class service = Class.forName("com.zjj.aisearch.demo.spring.SpringTestService"); + SpringTestService springTestService = (SpringTestService) service.newInstance(); + Field springTestService2 = myServletClass.getField("name"); + System.out.println(springTestService2.get(myServletClass));*/ + + } + + private void initServletMapping() { + for (ServletMapping servletMapping : ServletMappingConfig.servletMappingList) { + urlServletMapping.put(servletMapping.getUrl(), servletMapping.getClazz()); + } + } + + public static void main(String[] args) throws Exception, IllegalAccessException, ClassNotFoundException, InstantiationException { + MyTomcat myTomcat = new MyTomcat(8080); + myTomcat.start(); + + } +} diff --git a/src/main/java/com/zjj/aisearch/demo/tomcat/ServletMapping.java b/src/main/java/com/zjj/aisearch/demo/tomcat/ServletMapping.java new file mode 100644 index 0000000..669e969 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/tomcat/ServletMapping.java @@ -0,0 +1,42 @@ +package com.zjj.aisearch.demo.tomcat; + +/** + * @program: AISearch + * @description: Servlet映射 + * @author: zjj + * @create: 2020-02-28 10:52:02 + **/ +public class ServletMapping { + private String servletName; + private String url; + private String clazz; + public ServletMapping(String servletName,String url,String clazz) { + this.servletName = servletName; + this.url = url; + this.clazz = clazz; + } + + public String getServletName() { + return servletName; + } + + public void setServletName(String servletName) { + this.servletName = servletName; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getClazz() { + return clazz; + } + + public void setClazz(String clazz) { + this.clazz = clazz; + } +} diff --git a/src/main/java/com/zjj/aisearch/demo/tomcat/ServletMappingConfig.java b/src/main/java/com/zjj/aisearch/demo/tomcat/ServletMappingConfig.java new file mode 100644 index 0000000..d7446ed --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/tomcat/ServletMappingConfig.java @@ -0,0 +1,20 @@ +package com.zjj.aisearch.demo.tomcat; + +import java.util.ArrayList; +import java.util.List; + +/** + * @program: AISearch + * @description: Servlet, Url映射 + * @author: zjj + * @create: 2020-02-28 10:54:24 + **/ +public class ServletMappingConfig { + public static List servletMappingList = new ArrayList<>(); + + static { + servletMappingList.add(new ServletMapping("index", "/index", "com.zjj.aisearch.demo.tomcat.IndexServlet")); + servletMappingList.add(new ServletMapping("myblog", "/myblog", "com.zjj.aisearch.demo.tomcat.MyBlog")); + servletMappingList.add(new ServletMapping("testspring", "/testspring", "com.zjj.aisearch.demo.spring.SpringTestController")); + } +} diff --git a/src/main/java/com/zjj/aisearch/demo/utils/ClassScanUtil.java b/src/main/java/com/zjj/aisearch/demo/utils/ClassScanUtil.java new file mode 100644 index 0000000..2cb0744 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/utils/ClassScanUtil.java @@ -0,0 +1,14 @@ +package com.zjj.aisearch.demo.utils; + +/** + * @program: AISearch + * @description: 扫描类 + * @author: zjj + * @create: 2020-02-28 23:25:02 + **/ +public class ClassScanUtil { + public static void scan() { + + + } +} diff --git a/src/main/java/com/zjj/aisearch/demo/utils/ClazzUtils.java b/src/main/java/com/zjj/aisearch/demo/utils/ClazzUtils.java new file mode 100644 index 0000000..4c1d871 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/demo/utils/ClazzUtils.java @@ -0,0 +1,156 @@ +package com.zjj.aisearch.demo.utils; + +import java.io.File; +import java.io.IOException; +import java.net.JarURLConnection; +import java.net.URL; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.List; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; + +/** + * ClazzUtils + * @author ZENG.XIAO.YAN + * @version 1.0 + */ +public class ClazzUtils { + private static final String CLASS_SUFFIX = ".class"; + private static final String CLASS_FILE_PREFIX = File.separator + "classes" + File.separator; + private static final String PACKAGE_SEPARATOR = "."; + + + + + /** + * 查找包下的所有类的名字 + * @param packageName + * @param showChildPackageFlag 是否需要显示子包内容 + * @return List集合,内容为类的全名 + */ + public static List getClazzName(String packageName, boolean showChildPackageFlag ) { + List result = new ArrayList<>(); + String suffixPath = packageName.replaceAll("\\.", "/"); + ClassLoader loader = Thread.currentThread().getContextClassLoader(); + try { + Enumeration urls = loader.getResources(suffixPath); + while(urls.hasMoreElements()) { + URL url = urls.nextElement(); + if(url != null) { + String protocol = url.getProtocol(); + if("file".equals(protocol)) { + String path = url.getPath(); + System.out.println(path); + result.addAll(getAllClassNameByFile(new File(path), showChildPackageFlag)); + } else if("jar".equals(protocol)) { + JarFile jarFile = null; + try{ + jarFile = ((JarURLConnection) url.openConnection()).getJarFile(); + } catch(Exception e){ + e.printStackTrace(); + } + if(jarFile != null) { + result.addAll(getAllClassNameByJar(jarFile, packageName, showChildPackageFlag)); + } + } + } + } + } catch (IOException e) { + e.printStackTrace(); + } + return result; + } + + + /** + * 递归获取所有class文件的名字 + * @param file + * @param flag 是否需要迭代遍历 + * @return List + */ + private static List getAllClassNameByFile(File file, boolean flag) { + List result = new ArrayList<>(); + if(!file.exists()) { + return result; + } + if(file.isFile()) { + String path = file.getPath(); + // 注意:这里替换文件分割符要用replace。因为replaceAll里面的参数是正则表达式,而windows环境中File.separator="\\"的,因此会有问题 + if(path.endsWith(CLASS_SUFFIX)) { + path = path.replace(CLASS_SUFFIX, ""); + // 从"/classes/"后面开始截取 + String clazzName = path.substring(path.indexOf(CLASS_FILE_PREFIX) + CLASS_FILE_PREFIX.length()) + .replace(File.separator, PACKAGE_SEPARATOR); + if(-1 == clazzName.indexOf("$")) { + result.add(clazzName); + } + } + return result; + + } else { + File[] listFiles = file.listFiles(); + if(listFiles != null && listFiles.length > 0) { + for (File f : listFiles) { + if(flag) { + result.addAll(getAllClassNameByFile(f, flag)); + } else { + if(f.isFile()){ + String path = f.getPath(); + if(path.endsWith(CLASS_SUFFIX)) { + path = path.replace(CLASS_SUFFIX, ""); + // 从"/classes/"后面开始截取 + String clazzName = path.substring(path.indexOf(CLASS_FILE_PREFIX) + CLASS_FILE_PREFIX.length()) + .replace(File.separator, PACKAGE_SEPARATOR); + if(-1 == clazzName.indexOf("$")) { + result.add(clazzName); + } + } + } + } + } + } + return result; + } + } + + + /** + * 递归获取jar所有class文件的名字 + * @param jarFile + * @param packageName 包名 + * @param flag 是否需要迭代遍历 + * @return List + */ + private static List getAllClassNameByJar(JarFile jarFile, String packageName, boolean flag) { + List result = new ArrayList<>(); + Enumeration entries = jarFile.entries(); + while(entries.hasMoreElements()) { + JarEntry jarEntry = entries.nextElement(); + String name = jarEntry.getName(); + // 判断是不是class文件 + if(name.endsWith(CLASS_SUFFIX)) { + name = name.replace(CLASS_SUFFIX, "").replace("/", "."); + if(flag) { + // 如果要子包的文件,那么就只要开头相同且不是内部类就ok + if(name.startsWith(packageName) && -1 == name.indexOf("$")) { + result.add(name); + } + } else { + // 如果不要子包的文件,那么就必须保证最后一个"."之前的字符串和包名一样且不是内部类 + if(packageName.equals(name.substring(0, name.lastIndexOf("."))) && -1 == name.indexOf("$")) { + result.add(name); + } + } + } + } + return result; + } + + public static void main(String[] args) { + List list = ClazzUtils.getClazzName("com.mysql.fabric", false); + for (String string : list) { + System.out.println(string); + } + } +} diff --git a/src/main/java/com/zjj/aisearch/hadoop/HadoopDemo.java b/src/main/java/com/zjj/aisearch/hadoop/HadoopDemo.java new file mode 100644 index 0000000..a2a93a0 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/hadoop/HadoopDemo.java @@ -0,0 +1,15 @@ +package com.zjj.aisearch.hadoop; + +// import com.zkh.utils.HdfsUtil; + +/** + * @program: AISearch + * @description: 测试hadoop + * @author: zjj + * @create: 2020-02-27 11:10:08 + **/ +public class HadoopDemo { + public static void main(String[] args) throws Exception { + // HdfsUtil.readFile("/aaa/test.txt"); + } +} diff --git a/src/main/java/com/zjj/aisearch/mapper/DocumentMapper.java b/src/main/java/com/zjj/aisearch/mapper/DocumentMapper.java new file mode 100644 index 0000000..b387858 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/mapper/DocumentMapper.java @@ -0,0 +1,12 @@ +package com.zjj.aisearch.mapper; + +import com.zjj.aisearch.pojo.dto.DocumentDTO; +import org.apache.ibatis.annotations.Select; +import tk.mybatis.mapper.common.Mapper; + +import java.util.List; + +public interface DocumentMapper extends Mapper { + @Select("select * from document where documentcontent = #{content}") + List selectByContent(String content); +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/mapper/MovieMapper.java b/src/main/java/com/zjj/aisearch/mapper/MovieMapper.java new file mode 100644 index 0000000..6d864d2 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/mapper/MovieMapper.java @@ -0,0 +1,7 @@ +package com.zjj.aisearch.mapper; + +import com.zjj.aisearch.pojo.dto.MovieDTO; +import tk.mybatis.mapper.common.Mapper; + +public interface MovieMapper extends Mapper { +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/mapper/QueryMapper.java b/src/main/java/com/zjj/aisearch/mapper/QueryMapper.java index f403709..ccbbccb 100644 --- a/src/main/java/com/zjj/aisearch/mapper/QueryMapper.java +++ b/src/main/java/com/zjj/aisearch/mapper/QueryMapper.java @@ -1,6 +1,7 @@ package com.zjj.aisearch.mapper; import com.zjj.aisearch.model.EditorList; +import com.zjj.aisearch.model.FullTextFile; import com.zjj.aisearch.model.QueryForm; import com.zjj.aisearch.model.SystemLogList; @@ -48,4 +49,6 @@ public interface QueryMapper { List queryUserList(QueryForm queryForm); Integer queryUserListCount(QueryForm queryForm); + + List queryFileList(); } diff --git a/src/main/java/com/zjj/aisearch/mapper/UploadFileMapper.java b/src/main/java/com/zjj/aisearch/mapper/UploadFileMapper.java index 7bc914b..8cff993 100644 --- a/src/main/java/com/zjj/aisearch/mapper/UploadFileMapper.java +++ b/src/main/java/com/zjj/aisearch/mapper/UploadFileMapper.java @@ -4,4 +4,6 @@ public interface UploadFileMapper { int save(FullTextDTO fullTextDTO); + + int deleteFile(Integer id); } diff --git a/src/main/java/com/zjj/aisearch/model/FastDfs.java b/src/main/java/com/zjj/aisearch/model/FastDfs.java new file mode 100644 index 0000000..228afa5 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/model/FastDfs.java @@ -0,0 +1,26 @@ +package com.zjj.aisearch.model; + +import lombok.Data; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +/** + * @program: AISearch + * @description: 记录所思所想的便签 + * @author: zjj + * @create: 2019-09-30 21:26:21 + **/ +@Getter +@Setter +@Data +@ToString +public class FastDfs { + + private Integer id;//主键id + + private String filename;//name + private String fileurl;//url + + +} diff --git a/src/main/java/com/zjj/aisearch/pojo/dto/DocumentDTO.java b/src/main/java/com/zjj/aisearch/pojo/dto/DocumentDTO.java new file mode 100644 index 0000000..d532c90 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/pojo/dto/DocumentDTO.java @@ -0,0 +1,30 @@ +package com.zjj.aisearch.pojo.dto; + +import io.searchbox.annotations.JestId; +import lombok.Data; +import tk.mybatis.mapper.annotation.KeySql; + +import javax.persistence.Id; +import javax.persistence.Table; + +/** + * @author zjj + * @description 文档 + * @date 2020年2月16日20:41:13 + */ +@Data +@Table(name = "document") +public class DocumentDTO { + //相当于数据库的列字段 + //控制es中的_id=这个id; + //这个策略可以得到返回的ID; + @JestId + @KeySql(useGeneratedKeys = true) + @Id + private Integer id; + + private String documentname; + + private String documentcontent; + private String url; +} diff --git a/src/main/java/com/zjj/aisearch/pojo/dto/MovieDTO.java b/src/main/java/com/zjj/aisearch/pojo/dto/MovieDTO.java new file mode 100644 index 0000000..ba4f009 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/pojo/dto/MovieDTO.java @@ -0,0 +1,24 @@ +package com.zjj.aisearch.pojo.dto; + +import io.searchbox.annotations.JestId; +import lombok.Data; + +import javax.persistence.Id; +import javax.persistence.Table; + +/*等价于上面的@Setter、@Getter、@RequiredArgsConstructor、@ToString、@EqualsAndHashCode*/ +@Data +@Table(name = "movie") +public class MovieDTO { + + //加这个这个就作为索引主键的,不然他会自动生成 + @JestId + @Id + private String id; //电影的id + private String directors;//导演 + private String title;//标题 + private String cover;//封面 + private String rate;//评分 + private String casts;//演员 +} + diff --git a/src/main/java/com/zjj/aisearch/quartz/DateTimeJob.java b/src/main/java/com/zjj/aisearch/quartz/DateTimeJob.java new file mode 100644 index 0000000..1cb196c --- /dev/null +++ b/src/main/java/com/zjj/aisearch/quartz/DateTimeJob.java @@ -0,0 +1,24 @@ +package com.zjj.aisearch.quartz; + +import com.zjj.aisearch.test.TestES; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.quartz.QuartzJobBean; + +import java.text.SimpleDateFormat; +import java.util.Date; + +public class DateTimeJob extends QuartzJobBean { + + @Autowired + TestES testES; + + @Override + protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException { + //获取JobDetail中关联的数据 + String msg = (String) jobExecutionContext.getJobDetail().getJobDataMap().get("msg"); + System.out.println("current time :" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "---" + msg); + /*System.exit(1);*/ + } +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/repository/IDocumentRepository.java b/src/main/java/com/zjj/aisearch/repository/IDocumentRepository.java new file mode 100644 index 0000000..2c45801 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/repository/IDocumentRepository.java @@ -0,0 +1,19 @@ +package com.zjj.aisearch.repository; + + +import com.zjj.aisearch.pojo.dto.DocumentDTO; +import com.zjj.aisearch.pojo.entity.Page; +import io.searchbox.client.JestResult; + +public interface IDocumentRepository { + + boolean save(DocumentDTO documentDTO); + + JestResult deleteDocument(String index, String type, String id); + + // 删除index + void deleteIndex(String index); + + // 查询 + Page query(String queryString, int pageNo, int size); +} diff --git a/src/main/java/com/zjj/aisearch/repository/IMovieRepository.java b/src/main/java/com/zjj/aisearch/repository/IMovieRepository.java new file mode 100644 index 0000000..b9c42a7 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/repository/IMovieRepository.java @@ -0,0 +1,15 @@ +package com.zjj.aisearch.repository; + + +import com.zjj.aisearch.pojo.dto.MovieDTO; +import io.searchbox.client.JestResult; + +public interface IMovieRepository { + + boolean save(MovieDTO movieDTO); + + JestResult deleteDocument(String index, String type, String id); + + // 删除index + void deleteIndex(String index); +} diff --git a/src/main/java/com/zjj/aisearch/repository/impl/DocumentESRepository.java b/src/main/java/com/zjj/aisearch/repository/impl/DocumentESRepository.java new file mode 100644 index 0000000..4d14022 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/repository/impl/DocumentESRepository.java @@ -0,0 +1,130 @@ +package com.zjj.aisearch.repository.impl; + +import com.zjj.aisearch.pojo.dto.DocumentDTO; +import com.zjj.aisearch.pojo.entity.Page; +import com.zjj.aisearch.repository.IDocumentRepository; +import io.searchbox.client.JestClient; +import io.searchbox.client.JestResult; +import io.searchbox.core.Delete; +import io.searchbox.core.Index; +import io.searchbox.core.Search; +import io.searchbox.core.SearchResult; +import io.searchbox.indices.DeleteIndex; +import lombok.extern.slf4j.Slf4j; +import org.elasticsearch.index.query.QueryStringQueryBuilder; +import org.elasticsearch.search.builder.SearchSourceBuilder; +import org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Repository; + +import java.io.IOException; +import java.util.List; +import java.util.Map; + +import static java.util.stream.Collectors.toList; + +@Repository +@Slf4j +public class DocumentESRepository implements IDocumentRepository { + + public static final String INDEX = "document"; + + public static final String TYPE = "document"; + + @Autowired + private JestClient client; + + //数据库导入到索引库 + //创建索引 + @Override + public boolean save(DocumentDTO documentDTO) { + //创建索引 + Index index = new Index.Builder(documentDTO).index(INDEX).type(TYPE).build(); + //返回的结果 + JestResult jestResult = null; + try { + jestResult = client.execute(index); + } catch (IOException e) { + e.printStackTrace(); + } + log.info("save返回结果{}", jestResult.getJsonString()); + return true; + } + + + //删除文档 + + /** + * 根据主键删除文档 + * + * @param index 待操作的库 + * @param type 待操作的表 + * @param id 待操作的主键id + * @return + */ + @Override + public JestResult deleteDocument(String index, String type, String id) { + Delete delete = new Delete.Builder(id).index(index).type(type).build(); + JestResult result = null; + try { + result = client.execute(delete); + log.info("deleteDocument == " + result.getJsonString()); + } catch (IOException e) { + e.printStackTrace(); + } + return result; + } + + // 删除index + @Override + public void deleteIndex(String index) { + try { + JestResult jestResult = client.execute(new DeleteIndex.Builder(index).build()); + System.out.println("deleteIndex result:{}" + jestResult.isSucceeded()); + } catch (IOException e) { + e.printStackTrace(); + } + } + + // 查询 + @Override + public Page query(String queryString, int pageNo, int size) { + SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); + HighlightBuilder highlightBuilder = new HighlightBuilder().field("*").requireFieldMatch(false).tagsSchema("default"); + searchSourceBuilder.highlighter(highlightBuilder); + QueryStringQueryBuilder queryStringQueryBuilder = new QueryStringQueryBuilder(queryString); + searchSourceBuilder.query(queryStringQueryBuilder).from(from(pageNo, size)).size(size); + log.info("搜索DSL:{}", searchSourceBuilder.toString()); + Search search = new Search.Builder(searchSourceBuilder.toString()) + .addIndex(INDEX) + .addType(TYPE) + .build(); + try { + SearchResult result = client.execute(search); + List> hits = result.getHits(DocumentDTO.class); + List articles = hits.stream().map(hit -> { + DocumentDTO article = hit.source; + Map> highlight = hit.highlight; + if (highlight.containsKey("documentcontent")) { + /*article.setFileContent(highlight.get("fileContent").get(0) + " [score]-->" + hit.score);*/ + article.setDocumentcontent(highlight.get("documentcontent").get(0)); + } + if (highlight.containsKey("documentname")) { + /*article.setFileName(highlight.get("fileName").get(0) + " [score]-->" + hit.score);*/ + article.setDocumentname(highlight.get("documentname").get(0)); + } + return article; + }).collect(toList()); + int took = result.getJsonObject().get("took").getAsInt(); + Page page = Page.builder().list(articles).pageNo(pageNo).size(size).total(result.getTotal()).took(took).build(); + return page; + } catch (IOException e) { + log.error("search异常", e); + return null; + } + } + + private int from(int pageNo, int size) { + return (pageNo - 1) * size < 0 ? 0 : (pageNo - 1) * size; + } +} diff --git a/src/main/java/com/zjj/aisearch/repository/impl/FullTextESRepository.java b/src/main/java/com/zjj/aisearch/repository/impl/FullTextESRepository.java index 51a42a6..51b69af 100644 --- a/src/main/java/com/zjj/aisearch/repository/impl/FullTextESRepository.java +++ b/src/main/java/com/zjj/aisearch/repository/impl/FullTextESRepository.java @@ -29,7 +29,7 @@ * @Description: 全文搜索 * @Param: * @return: - * @Author: zjj + * @Author: zjj * @Date: 2020/1/6 */ @Repository diff --git a/src/main/java/com/zjj/aisearch/repository/impl/MovieESRepository.java b/src/main/java/com/zjj/aisearch/repository/impl/MovieESRepository.java new file mode 100644 index 0000000..8591b48 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/repository/impl/MovieESRepository.java @@ -0,0 +1,79 @@ +package com.zjj.aisearch.repository.impl; + +import com.zjj.aisearch.pojo.dto.MovieDTO; +import com.zjj.aisearch.repository.IMovieRepository; +import io.searchbox.client.JestClient; +import io.searchbox.client.JestResult; +import io.searchbox.core.Delete; +import io.searchbox.core.Index; +import io.searchbox.indices.DeleteIndex; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Repository; + +import java.io.IOException; + +@Repository +@Slf4j +public class MovieESRepository implements IMovieRepository { + + public static final String INDEX = "movie"; + + public static final String TYPE = "movie"; + + @Autowired + private JestClient client; + + //数据库导入到索引库 + //创建索引 + @Override + public boolean save(MovieDTO movieDTO) { + //创建索引 + Index index = new Index.Builder(movieDTO).index(INDEX).type(TYPE).build(); + //返回的结果 + JestResult jestResult = null; + try { + jestResult = client.execute(index); + } catch (IOException e) { + e.printStackTrace(); + } + log.info("save返回结果{}", jestResult.getJsonString()); + return true; + } + + + //删除文档 + + /** + * 根据主键删除文档 + * + * @param index 待操作的库 + * @param type 待操作的表 + * @param id 待操作的主键id + * @return + */ + @Override + public JestResult deleteDocument(String index, String type, String id) { + Delete delete = new Delete.Builder(id).index(index).type(type).build(); + JestResult result = null; + try { + result = client.execute(delete); + log.info("deleteDocument == " + result.getJsonString()); + } catch (IOException e) { + e.printStackTrace(); + } + return result; + } + + // 删除index + @Override + public void deleteIndex(String index) { + try { + JestResult jestResult = client.execute(new DeleteIndex.Builder(index).build()); + System.out.println("deleteIndex result:{}" + jestResult.isSucceeded()); + } catch (IOException e) { + e.printStackTrace(); + } + } + +} diff --git a/src/main/java/com/zjj/aisearch/service/GetService.java b/src/main/java/com/zjj/aisearch/service/GetService.java index 6feb39b..08758c8 100644 --- a/src/main/java/com/zjj/aisearch/service/GetService.java +++ b/src/main/java/com/zjj/aisearch/service/GetService.java @@ -1,6 +1,8 @@ package com.zjj.aisearch.service; import com.zjj.aisearch.model.Todo; +import com.zjj.aisearch.pojo.dto.DocumentDTO; +import com.zjj.aisearch.pojo.dto.MovieDTO; import java.util.List; import java.util.Map; @@ -13,4 +15,10 @@ **/ public interface GetService { List getTodoList(Map map); + + List getMovieDTOList(); + + List getDocumentDTOList(); + + Integer getDocumentDTOByName(DocumentDTO documentDTO); } diff --git a/src/main/java/com/zjj/aisearch/service/LoversGoalService.java b/src/main/java/com/zjj/aisearch/service/LoversGoalService.java deleted file mode 100644 index 0909b5b..0000000 --- a/src/main/java/com/zjj/aisearch/service/LoversGoalService.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.zjj.aisearch.service; - -public interface LoversGoalService { - -} diff --git a/src/main/java/com/zjj/aisearch/service/QueryService.java b/src/main/java/com/zjj/aisearch/service/QueryService.java index a9bc895..c17a46c 100644 --- a/src/main/java/com/zjj/aisearch/service/QueryService.java +++ b/src/main/java/com/zjj/aisearch/service/QueryService.java @@ -1,6 +1,7 @@ package com.zjj.aisearch.service; import com.zjj.aisearch.model.EditorList; +import com.zjj.aisearch.model.FullTextFile; import com.zjj.aisearch.model.QueryForm; import com.zjj.aisearch.model.SystemLogList; @@ -49,4 +50,6 @@ public interface QueryService { Integer queryUserListCount(QueryForm queryForm); List queryUserList(QueryForm queryForm); + + List queryFileList(); } diff --git a/src/main/java/com/zjj/aisearch/service/UpdateService.java b/src/main/java/com/zjj/aisearch/service/UpdateService.java index 1b17e8a..f8dc56c 100644 --- a/src/main/java/com/zjj/aisearch/service/UpdateService.java +++ b/src/main/java/com/zjj/aisearch/service/UpdateService.java @@ -11,4 +11,5 @@ public interface UpdateService { Integer deleteMarkdown(Integer id); Integer deleteAINote(Integer id); + } diff --git a/src/main/java/com/zjj/aisearch/service/UploadFileService.java b/src/main/java/com/zjj/aisearch/service/UploadFileService.java index a097944..8c16a92 100644 --- a/src/main/java/com/zjj/aisearch/service/UploadFileService.java +++ b/src/main/java/com/zjj/aisearch/service/UploadFileService.java @@ -1,7 +1,15 @@ package com.zjj.aisearch.service; +import com.zjj.aisearch.model.ResponseResult; import com.zjj.aisearch.pojo.dto.FullTextDTO; +import org.springframework.web.multipart.MultipartFile; public interface UploadFileService { int save(FullTextDTO fullTextDTO); + + int deleteFile(Integer id); + + ResponseResult uploadlocal(MultipartFile file) throws Exception; + + } diff --git a/src/main/java/com/zjj/aisearch/service/WriteService.java b/src/main/java/com/zjj/aisearch/service/WriteService.java index f46fbbc..58692ca 100644 --- a/src/main/java/com/zjj/aisearch/service/WriteService.java +++ b/src/main/java/com/zjj/aisearch/service/WriteService.java @@ -1,7 +1,10 @@ package com.zjj.aisearch.service; import com.zjj.aisearch.model.Editor; -import com.zjj.aisearch.model.MarkDown; /** +import com.zjj.aisearch.model.MarkDown; +import com.zjj.aisearch.pojo.dto.DocumentDTO; + +/** * @program: AISearch * @description: * @author: zjj @@ -14,4 +17,6 @@ public interface WriteService { int saveMarkDown(MarkDown markDown); int saveEditor(Editor editor); + + int saveDocument(DocumentDTO documentDTO); } diff --git a/src/main/java/com/zjj/aisearch/service/impl/GetServiceImpl.java b/src/main/java/com/zjj/aisearch/service/impl/GetServiceImpl.java index dfb294a..903561b 100644 --- a/src/main/java/com/zjj/aisearch/service/impl/GetServiceImpl.java +++ b/src/main/java/com/zjj/aisearch/service/impl/GetServiceImpl.java @@ -1,7 +1,11 @@ package com.zjj.aisearch.service.impl; +import com.zjj.aisearch.mapper.DocumentMapper; import com.zjj.aisearch.mapper.GetMapper; +import com.zjj.aisearch.mapper.MovieMapper; import com.zjj.aisearch.model.Todo; +import com.zjj.aisearch.pojo.dto.DocumentDTO; +import com.zjj.aisearch.pojo.dto.MovieDTO; import com.zjj.aisearch.service.GetService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -20,8 +24,32 @@ public class GetServiceImpl implements GetService { @Autowired private GetMapper getMapper; + @Autowired + private MovieMapper movieMapper; + + @Autowired + private DocumentMapper documentMapper; + @Override public List getTodoList(Map map) { + return getMapper.getTodoList(map); } + + @Override + public List getMovieDTOList() { + return movieMapper.selectAll(); + } + + @Override + public List getDocumentDTOList() { + return documentMapper.selectAll(); + } + + @Override + public Integer getDocumentDTOByName(DocumentDTO documentDTO) { + return documentMapper.selectCount(documentDTO); + } + + } diff --git a/src/main/java/com/zjj/aisearch/service/impl/LoversGoalServiceImpl.java b/src/main/java/com/zjj/aisearch/service/impl/LoversGoalServiceImpl.java deleted file mode 100644 index 7c8ae1c..0000000 --- a/src/main/java/com/zjj/aisearch/service/impl/LoversGoalServiceImpl.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.zjj.aisearch.service.impl; - -import com.zjj.aisearch.mapper.LoversGoalMapper; -import com.zjj.aisearch.mapper.QueryMapper; -import com.zjj.aisearch.service.LoversGoalService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * @program: AISearch - * @description: - * @author: zjj - * @create: 2019-10-05 02:52:40 - **/ -@Service -public class LoversGoalServiceImpl implements LoversGoalService { - @Autowired - private LoversGoalMapper loversGoalMapper; - - -} diff --git a/src/main/java/com/zjj/aisearch/service/impl/QueryServiceImpl.java b/src/main/java/com/zjj/aisearch/service/impl/QueryServiceImpl.java index 8b61973..1eacdf9 100644 --- a/src/main/java/com/zjj/aisearch/service/impl/QueryServiceImpl.java +++ b/src/main/java/com/zjj/aisearch/service/impl/QueryServiceImpl.java @@ -2,6 +2,7 @@ import com.zjj.aisearch.mapper.QueryMapper; import com.zjj.aisearch.model.EditorList; +import com.zjj.aisearch.model.FullTextFile; import com.zjj.aisearch.model.QueryForm; import com.zjj.aisearch.model.SystemLogList; import com.zjj.aisearch.service.QueryService; @@ -121,4 +122,9 @@ public Integer queryUserListCount(QueryForm queryForm) { public List queryUserList(QueryForm queryForm) { return queryMapper.queryUserList(queryForm); } + + @Override + public List queryFileList() { + return queryMapper.queryFileList(); + } } diff --git a/src/main/java/com/zjj/aisearch/service/impl/UploadFileFastServiceImpl.java b/src/main/java/com/zjj/aisearch/service/impl/UploadFileFastServiceImpl.java new file mode 100644 index 0000000..87ea86e --- /dev/null +++ b/src/main/java/com/zjj/aisearch/service/impl/UploadFileFastServiceImpl.java @@ -0,0 +1,85 @@ +package com.zjj.aisearch.service.impl; + +import com.zjj.aisearch.mapper.DocumentMapper; +import com.zjj.aisearch.mapper.UploadFileMapper; +import com.zjj.aisearch.model.ResponseResult; +import com.zjj.aisearch.pojo.dto.DocumentDTO; +import com.zjj.aisearch.pojo.dto.FullTextDTO; +import com.zjj.aisearch.repository.impl.DocumentESRepository; +import com.zjj.aisearch.service.UploadFileService; +import com.zjj.aisearch.utils.MultipartFileToFile; +import com.zjj.aisearch.utils.UploadFileUtil; +import lombok.extern.slf4j.Slf4j; +import org.apache.tika.Tika; +import org.apache.tika.exception.TikaException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.io.IOException; + +/** + * @program: AISearch + * @description: 上传文件 + * @author: zjj + * @create: 2020-01-06 14:06:14 + **/ +@Service +@Slf4j +public class UploadFileFastServiceImpl implements UploadFileService { + @Autowired + private DocumentMapper documentMapper; + + @Autowired + private UploadFileMapper uploadFileMapper; + + @Autowired + private DocumentESRepository documentESRepository; + + @Override + public int save(FullTextDTO fullTextDTO) { + return uploadFileMapper.save(fullTextDTO); + } + + @Override + public int deleteFile(Integer id) { + return uploadFileMapper.deleteFile(id); + } + + @Override + public ResponseResult uploadlocal(MultipartFile file) throws Exception { + ResponseResult responseResult = new ResponseResult(); + try { + //提取文件信息进入数据库 + DocumentDTO documentDTO = new DocumentDTO(); + long size = file.getSize(); + Tika tika = new Tika(); + //考虑这儿会不会文件没传上去或者数据库没写入进去,事务就体现作用了 + //然后这儿开拓展多线程上传和下载,考虑用缓冲流什么的,下载的话需要nginx支持 + //然后多线程上传下载可以用不同的工具类,其实这些操作应该放在service中进行的,然后有无多线程,有无缓冲,用四个不同的service类来实现,体现多态的优势 + /*1、首先文件保存的SAVE方法放在数据库保存后面执行 + 2、建立一个事务,首先进行数据库的保存,但是不要commit;然后save文件,当成功save后就commit,否则就会滚*/ + log.info("有缓冲start:" + System.currentTimeMillis()); + String s = UploadFileUtil.uploadFileFast("I:/document", file); + log.info("有缓冲end:" + System.currentTimeMillis()); + File file1 = MultipartFileToFile.multipartFileToFile(file); + String fileName = file1.getName(); + String filecontent = tika.parseToString(file1); + MultipartFileToFile.delteTempFile(file1); + documentDTO.setDocumentcontent(filecontent); + documentDTO.setDocumentname(s); + //保存到数据库 + documentMapper.insert(documentDTO); + documentESRepository.save(documentDTO); + responseResult.setStatus(0); + responseResult.setMsg("上传成功,这是第" + documentDTO.getId() + "个文件"); + } catch (IOException e) { + responseResult.setStatus(-1); + responseResult.setMsg("上传失败"); + e.printStackTrace(); + } + return responseResult; + } + +} diff --git a/src/main/java/com/zjj/aisearch/service/impl/UploadFileServiceImpl.java b/src/main/java/com/zjj/aisearch/service/impl/UploadFileServiceImpl.java index c281932..0b1e793 100644 --- a/src/main/java/com/zjj/aisearch/service/impl/UploadFileServiceImpl.java +++ b/src/main/java/com/zjj/aisearch/service/impl/UploadFileServiceImpl.java @@ -1,10 +1,22 @@ package com.zjj.aisearch.service.impl; +import com.zjj.aisearch.mapper.DocumentMapper; import com.zjj.aisearch.mapper.UploadFileMapper; +import com.zjj.aisearch.model.ResponseResult; +import com.zjj.aisearch.pojo.dto.DocumentDTO; import com.zjj.aisearch.pojo.dto.FullTextDTO; +import com.zjj.aisearch.repository.impl.DocumentESRepository; import com.zjj.aisearch.service.UploadFileService; +import com.zjj.aisearch.utils.MultipartFileToFile; +import com.zjj.aisearch.utils.UploadFileUtil; +import lombok.extern.slf4j.Slf4j; +import org.apache.tika.Tika; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.io.IOException; /** * @program: AISearch @@ -13,12 +25,60 @@ * @create: 2020-01-06 14:06:14 **/ @Service +@Slf4j public class UploadFileServiceImpl implements UploadFileService { + @Autowired + private DocumentMapper documentMapper; + @Autowired private UploadFileMapper uploadFileMapper; + @Autowired + private DocumentESRepository documentESRepository; + @Override public int save(FullTextDTO fullTextDTO) { return uploadFileMapper.save(fullTextDTO); } + + @Override + public int deleteFile(Integer id) { + return uploadFileMapper.deleteFile(id); + } + + @Override + public ResponseResult uploadlocal(MultipartFile file) throws Exception { + ResponseResult responseResult = new ResponseResult(); + try { + //提取文件信息进入数据库 + DocumentDTO documentDTO = new DocumentDTO(); + long size = file.getSize(); + Tika tika = new Tika(); + //考虑这儿会不会文件没传上去或者数据库没写入进去,事务就体现作用了 + //然后这儿开拓展多线程上传和下载,考虑用缓冲流什么的,下载的话需要nginx支持 + //然后多线程上传下载可以用不同的工具类,其实这些操作应该放在service中进行的,然后有无多线程,有无缓冲,用四个不同的service类来实现,体现多态的优势 + /*1、首先文件保存的SAVE方法放在数据库保存后面执行 + 2、建立一个事务,首先进行数据库的保存,但是不要commit;然后save文件,当成功save后就commit,否则就会滚*/ + log.info("无缓冲start:" + System.currentTimeMillis()); + String s = UploadFileUtil.uploadFile("I:/document", file); + log.info("无缓冲end:" + System.currentTimeMillis()); + File file1 = MultipartFileToFile.multipartFileToFile(file); + String fileName = file1.getName(); + String filecontent = tika.parseToString(file1); + MultipartFileToFile.delteTempFile(file1); + documentDTO.setDocumentcontent(filecontent); + documentDTO.setDocumentname(s); + //保存到数据库 + documentMapper.insert(documentDTO); + documentESRepository.save(documentDTO); + responseResult.setStatus(0); + responseResult.setMsg("上传成功,这是第" + documentDTO.getId() + "个文件"); + } catch (IOException e) { + responseResult.setStatus(-1); + responseResult.setMsg("上传失败"); + e.printStackTrace(); + } + return responseResult; + } + } diff --git a/src/main/java/com/zjj/aisearch/service/impl/WriteServiceImpl.java b/src/main/java/com/zjj/aisearch/service/impl/WriteServiceImpl.java index 50f41f5..fc65a5f 100644 --- a/src/main/java/com/zjj/aisearch/service/impl/WriteServiceImpl.java +++ b/src/main/java/com/zjj/aisearch/service/impl/WriteServiceImpl.java @@ -1,16 +1,14 @@ package com.zjj.aisearch.service.impl; +import com.zjj.aisearch.mapper.DocumentMapper; import com.zjj.aisearch.mapper.WriteMapper; import com.zjj.aisearch.model.Editor; import com.zjj.aisearch.model.MarkDown; -import com.zjj.aisearch.model.QueryForm; -import com.zjj.aisearch.model.SystemLogList; +import com.zjj.aisearch.pojo.dto.DocumentDTO; import com.zjj.aisearch.service.WriteService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.List; - /** * @program: AISearch * @description: @@ -22,6 +20,8 @@ public class WriteServiceImpl implements WriteService { @Autowired private WriteMapper writeMapper; + @Autowired + private DocumentMapper documentMapper; @Override public int saveMarkDown(MarkDown markDown) { @@ -32,4 +32,10 @@ public int saveMarkDown(MarkDown markDown) { public int saveEditor(Editor editor) { return writeMapper.saveEditor(editor); } + @Override + public int saveDocument(DocumentDTO documentDTO) { + return documentMapper.insert(documentDTO); + } + + } diff --git a/src/main/java/com/zjj/aisearch/servlet/StartServlet.java b/src/main/java/com/zjj/aisearch/servlet/StartServlet.java new file mode 100644 index 0000000..3cb3c21 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/servlet/StartServlet.java @@ -0,0 +1,79 @@ +package com.zjj.aisearch.servlet; + +import com.alibaba.fastjson.JSONObject; +import com.zjj.aisearch.demo.test.TestScan; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; + +import javax.servlet.ServletConfig; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; +import java.lang.reflect.InvocationTargetException; + +//@WebServlet(name = "startServlet", urlPatterns = "/*") //标记为servlet,以便启动器扫描。 +@Slf4j +public class StartServlet extends HttpServlet { + + /** + * 初始化项目 + * 1:获取Servlet名称,加载名称相同的配置文件 + * 2:加载配置文件中的urlMapping + * 3:加载其他配置 + */ + + /** + * 2020年2月27日23:38:51 + * 项目启动自动加载这个方法,只加载一次 + * 这个时候把注解和对应的执行方法读进去 + * + * @param config + */ + @Override + @SneakyThrows(ServletException.class) + public void init(ServletConfig config) { + super.init(config); + //为了xml配置映射,其实用注解完全可以不要 + String servletName = config.getServletName(); + log.info("【 zjjMVC " + servletName + " starting 。。。】"); + //-------------------- + //扫描注解,装配url和method的mapping + + + + } + + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) { + try { + doInvoke(request, response); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } catch (NoSuchMethodException e) { + e.printStackTrace(); + } catch (InstantiationException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } catch (InvocationTargetException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + private void doInvoke(HttpServletRequest request, HttpServletResponse response) throws ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException, IOException { + StringBuffer requestURL = request.getRequestURL(); + System.out.println(requestURL); + Object methodAnnotation = TestScan.getMethodAnnotation(requestURL); + System.out.println(methodAnnotation + "======="); + response.setHeader("content-type", "application/json;charset=UTF-8"); + PrintWriter writer = response.getWriter(); + writer.write(JSONObject.toJSONString(methodAnnotation)); + writer.close(); + } + +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/tbed/TbedDemo.java b/src/main/java/com/zjj/aisearch/tbed/TbedDemo.java new file mode 100644 index 0000000..366b7af --- /dev/null +++ b/src/main/java/com/zjj/aisearch/tbed/TbedDemo.java @@ -0,0 +1,17 @@ +package com.zjj.aisearch.tbed; + +import org.springframework.web.client.RestTemplate; + +/** + * @program: AISearch + * @description: 测试图床远程调用 + * @author: zjj + * @create: 2020-02-27 11:39:19 + **/ +public class TbedDemo { + public static void main(String[] args) { + RestTemplate restTemplate = new RestTemplate(); + /*System.out.println(restTemplate.getForObject("http://localhost:8083/user/register", String.class));*/ + System.out.println(restTemplate.getForObject("https://www.zhihu.com/api/v4/questions/273982054/answers?include=data[*].is_normal,admin_closed_comment,reward_info,is_collapsed,annotation_action,annotation_detail,collapse_reason,is_sticky,collapsed_by,suggest_edit,comment_count,can_comment,content,editable_content,voteup_count,reshipment_settings,comment_permission,created_time,updated_time,review_info,relevant_info,question.detail,excerpt,relationship.is_authorized,is_author,voting,is_thanked,is_nothelp,is_labeled,is_recognized;data[*].mark_infos[*].url;data[*].author.follower_count,badge[*].topics&limit=5&offset=10&platform=desktop&sort_by=default", String.class)); + } +} diff --git a/src/main/java/com/zjj/aisearch/test/FileTest.java b/src/main/java/com/zjj/aisearch/test/FileTest.java new file mode 100644 index 0000000..7d4b1af --- /dev/null +++ b/src/main/java/com/zjj/aisearch/test/FileTest.java @@ -0,0 +1,56 @@ +package com.zjj.aisearch.test; + +import java.io.*; + +/** + * @program: AISearch + * @description: + * @author: zjj + * @create: 2020-02-25 00:19:58 + **/ +public class FileTest { + public static void main(String[] args) throws IOException { + removePoint(); + } + + //操作文件,去空行 + private static void removeLine() throws IOException { + File file = new File("F:\\AISearch\\src\\main\\resources\\haha.txt"); + File file2 = new File("F:\\AISearch\\src\\main\\resources\\hehe.txt"); + FileReader fileReader = new FileReader(file); + FileWriter fileWriter = new FileWriter(file2); + BufferedReader bufferedReader = new BufferedReader(fileReader); + BufferedWriter bufferedWriter = new BufferedWriter(fileWriter); + try { + while (bufferedReader.readLine() != null) { + String s = bufferedReader.readLine(); + if (s.length() != 0) { + System.out.println(s + "----"); + bufferedWriter.write(s + "\n"); + } + } + + } catch (IOException e) { + e.printStackTrace(); + } + } + + private static void removePoint() throws IOException { + File file = new File("F:\\AISearch\\src\\main\\resources\\hehe.txt"); + File file2 = new File("F:\\AISearch\\src\\main\\resources\\xixi.txt"); + FileReader fileReader = new FileReader(file); + FileWriter fileWriter = new FileWriter(file2); + BufferedReader bufferedReader = new BufferedReader(fileReader); + BufferedWriter bufferedWriter = new BufferedWriter(fileWriter); + try { + char inss = (char) bufferedReader.read(); + String s = String.valueOf(inss); + String ss = String.valueOf((char) bufferedReader.read()); + while (String.valueOf((char) bufferedReader.read()) != null) { + System.out.println(String.valueOf((char) bufferedReader.read())); + } + } catch (IOException e) { + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/zjj/aisearch/test/Sentence.java b/src/main/java/com/zjj/aisearch/test/Sentence.java new file mode 100644 index 0000000..12cd202 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/test/Sentence.java @@ -0,0 +1,74 @@ +package com.zjj.aisearch.test; + +public class Sentence { + private String text = ""; + private int startOffset = 0; + private int endOffset = 0; + + public Sentence(String text) { + this.text = text; + } + public String next() { + boolean start = true; + for (int i = startOffset; i < text.length(); i++) { + int type = Character.getType(text.charAt(i)); + switch (type) { + case Character.UPPERCASE_LETTER: + case Character.LOWERCASE_LETTER: + case Character.TITLECASE_LETTER: + case Character.MODIFIER_LETTER: + case Character.OTHER_LETTER: + /* + * 1. 0x3041-0x30f6 -> ぁ-ヶ //日文(平|片)假名 + * 2. 0x3105-0x3129 -> ㄅ-ㄩ + * //注意符号 + */ + if (start) { + startOffset = i; + start = false; + } + break; + case Character.LETTER_NUMBER: +// ⅠⅡⅢ 单分 + case Character.OTHER_NUMBER: +// ①⑩㈠㈩⒈⒑⒒⒛⑴⑽⑾⒇ 连着用 + default: +// 其它认为无效字符 + if (!start) { + endOffset = i; + i = text.length(); + } + }// switch + } + String word = ""; + if (startOffset < text.length()) { + if (endOffset <= startOffset) { + endOffset = text.length() - 1; + } + word = text.substring(startOffset, endOffset); + startOffset = endOffset + 1; + } + return word; + } + + + public static void main(String[] args) { + Sentence sen = new Sentence("皇帝那所谓的至高无上的权力在文官集团的大爷们眼中也算不得什么,骂你,讽刺你,那是为了国家大事,那是忠言逆耳,你能说他不对吗?\n" + + "\n" + + "而且这些大爷们既不能杀,也不能轻易打,杀了他们,公务你自己一个人能干吗?\n" + + "\n" + + "劳动模范朱元璋老先生自然可以站出来说:把他们都杀光,我能干!\n" + + "\n" + + "可是朱瞻基不能这样说。\n" + + "\n" + + "于是在太祖皇帝死去二十年后,绳子失去了平衡,获得了票拟权的内阁集团变得更强大,皇帝一个人就要支撑不住了。这样下去,他将被大臣们任意摆布。\n" + + "\n" + + "苦苦支撑的朱瞻基一步步地被拉了过去,正在这时,他看见旁边站着一个人,于是他对这个人说:“你来,和我一起拔!”\n" + + "\n" + + "从此这个人就参加了拔河,并成为这场游戏的一个重要组成部分。"); + String w = ""; + while (!(w = sen.next()).isEmpty()) { + System.out.println(w); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/test/TestES.java b/src/main/java/com/zjj/aisearch/test/TestES.java new file mode 100644 index 0000000..3d3548e --- /dev/null +++ b/src/main/java/com/zjj/aisearch/test/TestES.java @@ -0,0 +1,221 @@ +package com.zjj.aisearch.test; + +import com.zjj.aisearch.mapper.DocumentMapper; +import com.zjj.aisearch.pojo.dto.DocumentDTO; +import com.zjj.aisearch.pojo.dto.JianShuArticleDTO; +import com.zjj.aisearch.pojo.dto.MovieDTO; +import com.zjj.aisearch.pojo.entity.Page; +import com.zjj.aisearch.repository.IDocumentRepository; +import com.zjj.aisearch.repository.IJianShuArticleRepository; +import com.zjj.aisearch.repository.IMovieRepository; +import com.zjj.aisearch.service.GetService; +import com.zjj.aisearch.service.WriteService; +import lombok.extern.slf4j.Slf4j; +import org.apache.tika.Tika; +import org.apache.tika.exception.TikaException; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.stereotype.Component; +import org.springframework.test.context.junit4.SpringRunner; + +import java.io.*; +import java.util.ArrayList; +import java.util.List; + +/** + * @program: AISearch + * @description: 测试Redis 测试的时候要加springboot上下文环境 + * @author: zjj + * @create: 2020-02-08 17:43:46 + **/ +@RunWith(SpringRunner.class) +@SpringBootTest +@Component +@Slf4j +public class TestES { + + @Autowired + private IMovieRepository movieESRepository; + + @Autowired + private IDocumentRepository documentESRepository; + + @Autowired + private IJianShuArticleRepository jianShuArticleESRepository; + + @Autowired + private GetService getService; + + @Autowired + private WriteService writeService; + + @Autowired + private DocumentMapper documentMapper; + + //导入到es + //创建索引 + @Test + public void test() { + List movieDTOList = getService.getMovieDTOList(); + for (MovieDTO movieDTO : movieDTOList) { + movieESRepository.save(movieDTO); + } + } + + //导入到es + //创建document索引 + @Test + public void test4() { + List dccumentDTOList = getService.getDocumentDTOList(); + for (DocumentDTO documentDTO : dccumentDTOList) { + documentESRepository.save(documentDTO); + } + } + + //删除document索引 + + @Test + public void test8() { + documentESRepository.deleteIndex("document"); + } + + + //根据id删除文档 + @Test + public void test9() { + documentESRepository.deleteDocument("document", "document", "AXBUKVfs5MwoOe6VlozH"); + + } + + //数据库和搜索库删除空内容数据 + @Test + public void test10() { + List documentDTOS = documentMapper.selectByContent(""); + for (DocumentDTO documentDTO : documentDTOS) { + documentESRepository.deleteDocument("document", "document", documentDTO.getId().toString()); + documentMapper.delete(documentDTO); + } + System.out.println(documentDTOS); + } + + @Test + public void test12() { + DocumentDTO documentDTO = documentMapper.selectByPrimaryKey("51"); + System.out.println(documentDTO.toString()); + System.out.println(documentDTO.getDocumentcontent().toString().length()); + } + + //删除文件系统空内容 + @Test + public void test11() { + List documentDTOS = documentMapper.selectAll(); + File files = new File("I:/document"); + File[] files1 = files.listFiles(); + ArrayList haha = new ArrayList<>(); + ArrayList hehe = new ArrayList<>(); + for (File file : files1) { + String name = file.getName(); + haha.add(name); + } + for (DocumentDTO documentDTO : documentDTOS) { + String documentname = documentDTO.getDocumentname(); + hehe.add(documentname); + } + for (String ha : haha) { + boolean contains = hehe.contains(ha.toString()); + if (!contains) { + File file = new File("I:/document/" + ha); + boolean delete = file.delete(); + System.out.println(delete); + } + } + } + + + //导入文件到数据库中 + //方法有问题 + @Test + public void test5() throws IOException, TikaException { + + File file = new File("I:\\document"); + File[] files = file.listFiles(); + Tika tika = new Tika(); + DocumentDTO documentDTO = new DocumentDTO(); + for (File f : files) { + String filecontent = ""; + try { + filecontent = tika.parseToString(f); + } catch (Exception e) { + e.printStackTrace(); + } + String name = f.getName(); + documentDTO.setDocumentname(name); + Integer count = getService.getDocumentDTOByName(documentDTO); + //intValue()方法,意思是说,把Integer类型转化为Int类型。 + if (count.intValue() == 0) { + documentDTO.setDocumentcontent(filecontent); + writeService.saveDocument(documentDTO); + } + } + } + + //导入段落文字到数据库中 + @Test + public void test13() throws IOException, TikaException { + File file = new File("F:\\AISearch\\src\\main\\resources\\haha.txt"); + System.out.println(file.getName()); + Reader reader = new FileReader(file); + BufferedReader readers = new BufferedReader(reader); + DocumentDTO documentDTO = new DocumentDTO(); + int i = 169; + while (readers.readLine() != null) { + String s = readers.readLine(); + if (!s.isEmpty()) { + documentDTO.setId(null); + documentDTO.setDocumentname("中国历代党争分行.txt"); + documentDTO.setDocumentcontent(s); + writeService.saveDocument(documentDTO); + documentESRepository.save(documentDTO); + System.out.println(s); + } + } + } + + //测试避免重复文件入库 + @Test + public void test7() { + DocumentDTO documentDTO = new DocumentDTO(); + documentDTO.setDocumentname("1576394941908_java.md"); + Integer count = getService.getDocumentDTOByName(documentDTO); + System.out.println(count.intValue()); + + } + + //删除索引 + @Test + public void test1() { + movieESRepository.deleteIndex("movie"); + } + + //查询简书 + @Test + public void test2() { + Page list = jianShuArticleESRepository.query("你好", 1, 10); + for (JianShuArticleDTO l : list.getList()) { + System.out.println(l.toString()); + } + } + + //查询文件 + @Test + public void test6() { + Page list = documentESRepository.query("乌合之众", 1, 10); + for (DocumentDTO l : list.getList()) { + System.out.println(l.toString()); + } + } + + +} diff --git a/src/main/java/com/zjj/aisearch/test/TestRedis.java b/src/main/java/com/zjj/aisearch/test/TestRedis.java index 8f37fc9..5521bce 100644 --- a/src/main/java/com/zjj/aisearch/test/TestRedis.java +++ b/src/main/java/com/zjj/aisearch/test/TestRedis.java @@ -34,4 +34,5 @@ public void test() { } + } diff --git a/src/main/java/com/zjj/aisearch/utils/FastDFSClientUtil.java b/src/main/java/com/zjj/aisearch/utils/FastDFSClientUtil.java new file mode 100644 index 0000000..5fb5b2c --- /dev/null +++ b/src/main/java/com/zjj/aisearch/utils/FastDFSClientUtil.java @@ -0,0 +1,67 @@ +package com.zjj.aisearch.utils; + +import com.github.tobato.fastdfs.domain.fdfs.StorePath; +import com.github.tobato.fastdfs.domain.fdfs.ThumbImageConfig; +import com.github.tobato.fastdfs.domain.proto.storage.DownloadCallback; +import com.github.tobato.fastdfs.service.FastFileStorageClient; +import org.apache.commons.io.FilenameUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.io.InputStream; + + +@Component +public class FastDFSClientUtil { + + @Value("${fdfs.reqHost}") + private String reqHost; + + @Value("${fdfs.reqPort}") + private String reqPort; + + @Autowired + private FastFileStorageClient storageClient; + + @Autowired + private ThumbImageConfig thumbImageConfig; //创建缩略图 , 缩略图访问有问题,暂未解决 + + + public String uploadFile(MultipartFile file) throws IOException { + StorePath storePath = storageClient.uploadFile((InputStream)file.getInputStream(),file.getSize(), FilenameUtils.getExtension(file.getOriginalFilename()),null); + + String path = thumbImageConfig.getThumbImagePath(storePath.getPath()) ; + System.out.println("thumbImage :" + path); // 缩略图访问有问题,暂未解决 + + return getResAccessUrl(storePath); + } + + public void delFile(String filePath) { + storageClient.deleteFile(filePath); + + } + + + public InputStream download(String groupName, String path ) { + InputStream ins = storageClient.downloadFile(groupName, path, new DownloadCallback(){ + @Override + public InputStream recv(InputStream ins) throws IOException { + // 将此ins返回给上面的ins + return ins; + }}) ; + return ins ; + } + + /** + * 封装文件完整URL地址 + * @param storePath + * @return + */ + private String getResAccessUrl(StorePath storePath) { + String fileUrl = "http://" + reqHost + ":" + reqPort + "/" + storePath.getFullPath(); + return fileUrl; + } +} \ No newline at end of file diff --git a/src/main/java/com/zjj/aisearch/utils/IPUtil.java b/src/main/java/com/zjj/aisearch/utils/IPUtil.java new file mode 100644 index 0000000..9dc6a07 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/utils/IPUtil.java @@ -0,0 +1,142 @@ +package com.zjj.aisearch.utils; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.servlet.http.HttpServletRequest; +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; +import java.net.URL; + +/** + * + * @Description:IP工具类 + * @author zrt + * @date 2018年9月22日 上午10:38:13 + */ +public class IPUtil { + + private static final Logger logger = LoggerFactory.getLogger(IPUtil.class); + + + + /** + * + * @Description:获取客户端的IP + * @author zrt + * @date 2018年9月22日 上午10:39:44 + */ + public static String getIpAddress(HttpServletRequest request) { + //注意本地测试时,浏览器请求不要用localhost,要用本机IP访问项目地址,不然这里取不到ip + // 获取请求主机IP地址,如果通过代理进来,则透过防火墙获取真实IP地址 + + String ip = request.getHeader("X-Forwarded-For"); + if (logger.isInfoEnabled()) { + logger.info("getIpAddress(HttpServletRequest) - X-Forwarded-For - String ip=" + ip); + } + + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("Proxy-Client-IP"); + if (logger.isInfoEnabled()) { + logger.info("getIpAddress(HttpServletRequest) - Proxy-Client-IP - String ip=" + ip); + } + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("WL-Proxy-Client-IP"); + if (logger.isInfoEnabled()) { + logger.info("getIpAddress(HttpServletRequest) - WL-Proxy-Client-IP - String ip=" + ip); + } + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("HTTP_CLIENT_IP"); + if (logger.isInfoEnabled()) { + logger.info("getIpAddress(HttpServletRequest) - HTTP_CLIENT_IP - String ip=" + ip); + } + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("HTTP_X_FORWARDED_FOR"); + if (logger.isInfoEnabled()) { + logger.info("getIpAddress(HttpServletRequest) - HTTP_X_FORWARDED_FOR - String ip=" + ip); + } + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getRemoteAddr(); + if (logger.isInfoEnabled()) { + logger.info("getIpAddress(HttpServletRequest) - getRemoteAddr - String ip=" + ip); + } + } + } else if (ip.length() > 15) { + String[] ips = ip.split(","); + for (int index = 0; index < ips.length; index++) { + String strIp = (String) ips[index]; + if (!("unknown".equalsIgnoreCase(strIp))) { + ip = strIp; + break; + } + } + } + return ip; + } + + + public static void main(String[] args) throws Exception { + + System.err.println("公网ipppppppppppp:" + getPublicIp()); + + + } + + /** + * @Description:获取客户端外网ip + * @Author:zrt + * @Date:2019/6/13 11:23 + **/ + public static String getPublicIp() { + try { + String path = "http://iframe.ip138.com/ic.asp";// 要获得html页面内容的地址 + + URL url = new URL(path);// 创建url对象 + + HttpURLConnection conn = (HttpURLConnection) url.openConnection();// 打开连接 + + conn.setRequestProperty("contentType", "GBK"); // 设置url中文参数编码 + + conn.setConnectTimeout(5 * 1000);// 请求的时间 + + conn.setRequestMethod("GET");// 请求方式 + + InputStream inStream = conn.getInputStream(); + // readLesoSysXML(inStream); + + BufferedReader in = new BufferedReader(new InputStreamReader( + inStream, "GBK")); + StringBuffer buffer = new StringBuffer(); + String line = ""; + // 读取获取到内容的最后一行,写入 + while ((line = in.readLine()) != null) { + buffer.append(line); + } + String str = buffer.toString(); + String ipString1 = str.substring(str.indexOf("[")); + // 获取你的IP是中间的[182.149.82.50]内容 + String ipsString2 = ipString1.substring(ipString1.indexOf("[") + 1, + ipString1.lastIndexOf("]")); + //获取当前IP地址所在地址 + /* String ipsString3=ipString1.substring(ipString1.indexOf(": "),ipString1.lastIndexOf("")); + System.err.println(ipsString3);*/ + + // 返回公网IP值 + return ipsString2; + + } catch (Exception e) { + System.out.println("获取公网IP连接超时"); + return "连接超时"; + } + } + + + +} diff --git a/src/main/java/com/zjj/aisearch/utils/UploadFileUtil.java b/src/main/java/com/zjj/aisearch/utils/UploadFileUtil.java new file mode 100644 index 0000000..f271563 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/utils/UploadFileUtil.java @@ -0,0 +1,80 @@ +package com.zjj.aisearch.utils; + +import org.springframework.web.multipart.MultipartFile; + +import java.io.*; +import java.util.Date; + +/** + * @program: AISearch + * @description: 文件上传工具类 + * @author: zjj + * @create: 2020-02-18 00:45:18 + **/ +public class UploadFileUtil { + + public static String uploadFile(String uploadPath, MultipartFile file) { + return uploadFileCommon(uploadPath, file, false); + } + + public static String uploadFileCommon(String uploadPath, MultipartFile file, boolean isFast) { + InputStream inputStream = null; + OutputStream os = null; + String path = null; + String fileName = new Date().getTime() + "_" + file.getOriginalFilename(); + BufferedInputStream bis = null; + BufferedOutputStream bos = null; + try { + byte[] bs = new byte[1024]; + // 读取到的数据长度 + int len; + // 输出的文件流保存到本地文件 + File tempFile = new File(uploadPath); + if (!tempFile.exists()) { + tempFile.mkdirs(); + } + inputStream = file.getInputStream(); + path = tempFile.getPath() + File.separator + fileName; + os = new FileOutputStream(path); + + if (isFast) { + bis = new BufferedInputStream(inputStream); + bos = new BufferedOutputStream(os); + // 开始读取 + while ((len = bis.read(bs)) != -1) { + bos.write(bs, 0, len); + } + } else { + // 开始读取 + while ((len = inputStream.read(bs)) != -1) { + os.write(bs, 0, len); + } + } + + } catch (IOException e) { + e.printStackTrace(); + } finally { + // 完毕,关闭所有链接 + try { + if (isFast) { + bos.close(); + bis.close(); + os.close(); + inputStream.close(); + } else { + os.close(); + inputStream.close(); + } + + } catch (IOException e) { + e.printStackTrace(); + } + } + return fileName; + } + + //缓冲版 + public static String uploadFileFast(String uploadPath, MultipartFile file) { + return uploadFileCommon(uploadPath, file, true); + } +} diff --git a/src/main/java/com/zjj/aisearch/vim/VimDemo.java b/src/main/java/com/zjj/aisearch/vim/VimDemo.java new file mode 100644 index 0000000..21893f1 --- /dev/null +++ b/src/main/java/com/zjj/aisearch/vim/VimDemo.java @@ -0,0 +1,146 @@ +package com.zjj.aisearch.vim; + +/** + * @program: AISearch + * @description: vim实用快捷键 + * @author: zjj + * @create: 2020-04-15 20:58:57 + **/ +public class VimDemo { + /** + * 删除操作: + * 字符删除: + * x 删除光标所在处字符 这是向前删除 xxxxxxxxxx aaaaaaaaa acc + * X 删除光标所在处字符 这是向后删除 xxxxxxxxxx aacc + * + * 单词删除 + * dw 删除到下一个单词开头 这是删除光标所在处到下一个单词的第一个字母 i am a programmer what are you job + * de 删除到本单词末尾 包括光标所在处 e 是往后走到本单词末尾 i am a programmer what are you job + * dE 删除到本单词末尾 包括标点 不包括光标所在处 i am a programmer what are you job; + * db 删除到前一个单词 i am a programmer what are you + * dB 删除到前一个单词包括标点在内 i am a programmer;what are you + * + * e 往前删除 b 往后删除 e b 会忽略标点 E B 不会 + * + * 行删除 + * dd 删除一整行 + * fsajkjaslksajfk fkalsjfklsajf; sfadj;lsajf; + * fsajkjaslksajfk fkalsjfklsajf; sfadj;lsajf; + * fsajkjaslksajfk fkalsjfklsajf; sfadj;lsajf; + * + * D 或 d$ 删除光标位置到本行末尾 + * fjkalsjfk jfklasjfk jfkalsjjkl asklfjskal + * + * d^ 删除到本行开头 + * fkals fjaskl jfaskl jklas kljlasjklf + * + * dh dl 向前/向后删除 发送框架 jfaksjfklasj fjasklfjas jks + * + * + * 删除命令 需要配合移动命令才能发挥最大的作用 + * + * 3dd 代表删除3行 + * fjsadkjfasjkl + * jfkasjfkl + * jfklasjfasdjklf + * + * + * d2w daw + * + * 删除 从光标后的两个单词 和删除 整个单词 + * fjsakl fklasjfkls fjklasjlfs afjkladsjfajsk + * + * jj + * + * d0 d^ 删除到开头 + * + * . 重复上次修 + * + * DD 和 .可以配合 + * + * fjskalfjkads + * + * jfkas + * jfkasl + * jfkadjf + * fjklasfad + * jfklasdjfkads + * jfklasjfads;;;;;;;;;;;;;;;;;;;;;;;; + * + * A $ 移动到行尾 一个变输入模式,一个不变 + * 0 ^ 移动到行首 一个真正的行首 一个字符行首 + * enter o 换行 一个不进输入模式,一个进输入模式 + * gg 整个文件头部 + * G 整个文件尾部 + * + * 跳转到指定行 + * 3gg 3G 或者 :23 + * + * ffajkasjfkas fsjadklfjkadsluioquwrinvas fsdajklwiojrfi fiosnvxkiowf + * + * + * w b 移动到下一个车单词开头 上一个单词开头 + * jfkas faklsjflkas fjklas + * + * u 撤销 ctrl + R 反撤销 就疯狂撒 + * fsfjwwjk fsaklj fsakfj + * + * v V 进选择模式 + * vc s 选中当前字符并更改 + * vd x 效果一样 都是删除一个字符 + * kjajflskk kkkksssssask + * x 剪贴 + * kkfklas ffjkdsasfjas + * + * kk + * kkk + * : + * + * diw daw 删除 + w * fsa sdkfjsaklh + * + * dtw dfw dFw + * 删除光标到行内目标具体位置 +js sfadjqojfsa + * + *kk + * + * 以上可以换c 代替 d,区c会进入插入模式jhh + * S o + * S 删除一行S + * + * di ( 删除匹配的 + * da ( 包含 匹配符号 + * () + * "fasfsa fas(fsa (fjak fjask)) " + * + * + * :form,to d + * + * 删除 指定行 * * * + * + * + * + * J把下一行合并到当前行 + * jfkalsj + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +} diff --git a/src/main/java/com/zjj/aisearch/zbblog/ZbBlogDemo.java b/src/main/java/com/zjj/aisearch/zbblog/ZbBlogDemo.java new file mode 100644 index 0000000..e72368c --- /dev/null +++ b/src/main/java/com/zjj/aisearch/zbblog/ZbBlogDemo.java @@ -0,0 +1,17 @@ +package com.zjj.aisearch.zbblog; + +import org.springframework.web.client.RestTemplate; + +/** + * @program: AISearch + * @description: zb-blog 测试系统交互 + * @author: zjj + * @create: 2020-02-27 12:30:32 + **/ +public class ZbBlogDemo { + + public static void main(String[] args) { + RestTemplate restTemplate = new RestTemplate(); + System.out.println(restTemplate.getForObject("http://localhost:8090/zhihuapi", String.class)); + } +} diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties index 581ef8e..4c62305 100644 --- a/src/main/resources/application-dev.properties +++ b/src/main/resources/application-dev.properties @@ -6,10 +6,10 @@ server.servlet.session.timeout=36000s server.tomcat.uri-encoding=utf-8 spring.datasource.type=com.alibaba.druid.pool.DruidDataSource spring.datasource.driverClassName=com.mysql.jdbc.Driver -spring.datasource.url=jdbc:mysql://114.55.94.186:3306/aisearch?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true +spring.datasource.url=jdbc:mysql://localhost:3306/aisearch?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true spring.datasource.username=root -spring.datasource.password=myznsh_1996_mysql,)ZJJ -spring.datasource.initialSize=1 +spring.datasource.password=123 +spring.datasource.initialSize=1 spring.datasource.minIdle=3 spring.datasource.maxActive=20 spring.datasource.maxWait=60000 @@ -21,7 +21,7 @@ mybatis.mapper-locations=classpath:mapper/*.xml mybatis.configuration.log-impl: org.apache.ibatis.logging.stdout.StdOutImpl spring.profiles.active=dev #配置jest连接信息 -spring.elasticsearch.jest.uris=http://114.55.94.186:9200 +spring.elasticsearch.jest.uris=http://localhost:9200 #spring.elasticsearch.jest.uris=http://114.55.94.186:9200 spring.elasticsearch.jest.read-timeout=10000s @@ -49,4 +49,4 @@ spring.activemq.pool.max-connections=10 #空闲的连接过期时间,默认为30秒 spring.activemq.pool.idle-timeout=30000ms #强制的连接过期时间,与idleTimeout的区别在于:idleTimeout是在连接空闲一段时间失效,而expiryTimeout不管当前连接的情况,只要达到指定时间就失效。默认为0,never -spring.activemq.pool.expiry-timeout=0ms \ No newline at end of file +spring.activemq.pool.expiry-timeout=0ms diff --git a/src/main/resources/application-prod.properties b/src/main/resources/application-prod.properties index c01a122..e14a129 100644 --- a/src/main/resources/application-prod.properties +++ b/src/main/resources/application-prod.properties @@ -1,15 +1,17 @@ -server.port=443 -server.ssl.key-store=classpath:www.myznsh.com.pfx -server.ssl.key-store-password=123456 -server.ssl.key-store-type=PKCS12 +server.port=80 +#server.ssl.key-store=classpath:www.myznsh.com.pfx +#server.ssl.key-store-password=123456 +#server.ssl.key-store-type=PKCS12 server.servlet.session.timeout=36000s server.tomcat.uri-encoding=utf-8 spring.datasource.type=com.alibaba.druid.pool.DruidDataSource spring.datasource.driverClassName=com.mysql.jdbc.Driver +#spring.datasource.url=jdbc:mysql://localhost:3306/aisearch?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&useSSL=false spring.datasource.url=jdbc:mysql://114.55.94.186:3306/aisearch?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&useSSL=false -spring.datasource.username=root -spring.datasource.password=myznsh_1996_mysql,)ZJJ +#spring.datasource.username=root #spring.datasource.password=123 +spring.datasource.username=zjj +spring.datasource.password=myznsh_1996_mysql,)ZJJ spring.datasource.initialSize=1 spring.datasource.minIdle=3 spring.datasource.maxActive=20 @@ -21,8 +23,8 @@ mybatis.type-aliases-package=com.zjj.aisearch.model mybatis.mapper-locations=classpath:mapper/*.xml mybatis.configuration.log-impl: org.apache.ibatis.logging.stdout.StdOutImpl spring.profiles.active=dev -#spring.elasticsearch.jest.uris=http://localhost:9200 -spring.elasticsearch.jest.uris=http://114.55.94.186:9200 +spring.elasticsearch.jest.uris=http://localhost:9200 +# spring.elasticsearch.jest.uris=http://114.55.94.186:9200 spring.elasticsearch.jest.read-timeout=10000s spring.elasticsearch.jest.username= @@ -49,3 +51,11 @@ spring.activemq.pool.max-connections=10 spring.activemq.pool.idle-timeout=30000ms #强制的连接过期时间,与idleTimeout的区别在于:idleTimeout是在连接空闲一段时间失效,而expiryTimeout不管当前连接的情况,只要达到指定时间就失效。默认为0,never spring.activemq.pool.expiry-timeout=0ms + +#fdfs +fdfs.soTimeout=1500 +fdfs.connectTimeout=600 +fdfs.reqHost=114.55.94.186 +fdfs.reqPort=9999 +fdfs.trackerList[0]=114.55.94.186:22122 + diff --git a/src/main/resources/applicationContext.properties b/src/main/resources/applicationContext.properties new file mode 100644 index 0000000..1503495 --- /dev/null +++ b/src/main/resources/applicationContext.properties @@ -0,0 +1 @@ +scanPackage=com.zjj.aisearch.demo.spring \ No newline at end of file diff --git a/src/main/resources/elasticsearch.bat.lnk b/src/main/resources/elasticsearch.bat.lnk deleted file mode 100644 index bedca08..0000000 Binary files a/src/main/resources/elasticsearch.bat.lnk and /dev/null differ diff --git a/src/main/resources/haha.txt b/src/main/resources/haha.txt new file mode 100644 index 0000000..d65d4ee --- /dev/null +++ b/src/main/resources/haha.txt @@ -0,0 +1,4822 @@ +目录 + +Content + + +导 语 + +目 录 + +作者简介 + +内容简介 + +帝王的烦恼 + +功 臣 + +兄 弟 + +母子不相认 + +此书已经失传了 + +为了权力(1) + +为了权力(2) + +帝王的荣耀 + +修 书 + +命 运 + +转 折 + +你是这种人 + +飞 腾 + +盛世修书 + +每一个人都是 + +投 机 + +有一个人反对 + +双方开门见山 + +来得还真快 + +终 点 + +帝王的抉择 + +不 通 + +郑和之后 + +出 航 + +以德服人 + +无敌舰队 + +和平的使命 + +留个纪念吧(1) + +留个纪念吧(2) + +留个纪念吧(3) + +最后的归宿 + +纵横天下(1) + +纵横天下(2) + +西南边疆的阴谋 + +安南平定战(1) + +安南平定战(2) + +天子守国门 + +一次性解决问题 + +亲 征(1) + +亲 征(2) + +阿鲁台的厄运 + +逆命者必剪除之 + +瓦剌的自信 + +朱棣陷入了矛盾之中(1) + +朱棣陷入了矛盾之中(2) + +战后总结大会(1) + +战后总结大会(2) + +要你命三板斧战斗系统(1) + +要你命三板斧战斗系统(2) + +帝王的财产 + +宦 官(1) + +宦 官(2) + +第一个人(1) + +第一个人(2) + +第二个人 + +第三个人(1) + +第三个人(2) + +生死相搏 + +朱高煦的阴谋(1) + +朱高煦的阴谋(2) + +朱高煦的阴谋(3) + +无畏的杨士奇 + +太子党的反击 + +一剑封喉 + +最后的秘密 + +告 别 + +朱棣默然(1) + +朱棣默然(2) + +最后的答案(1) + +最后的答案(2) + +死于征途的宿命(1) + +死于征途的宿命(2) + +深夜的密谋(1) + +深夜的密谋(2) + +深夜的密谋(3) + +谋杀的疑团(1) + +谋杀的疑团(2) + +朱瞻基是个好同志 + +其实你很脆弱(1) + +其实你很脆弱(2) + +闹剧的终结 + +朱瞻基的痛苦 + +确实过分了(1) + +确实过分了(2) + +确实过分了(3) + + + + + +导 语 + + +导语: + +中国最后一个汉人王朝兴衰的全程解说 + +历史本身很精彩,历史可以写得很好看 + +1、新浪连载总点击超过四百万的人气史诗巨作 + +2、凤凰卫视及各大媒体纷纷专题报道的当前热点事件 + +3、迄今为止唯一一部白话正说的明朝全历史 + +4、读者称为唯一有实力抗衡易中天的历史读物 + + + + + +目 录 + + +目录 + +一 帝王的烦恼 + +二 帝王的荣耀 + +三 帝王的抉择 + +四 郑和之后,再无郑和 + +五 纵横天下 + +六 天子守国门! + +七 逆命者必剪除之! + +八 帝王的财产 + +九 生死相捕 + +十 最后的秘密 + +十一 朱高炽的勇和疑问 + +十二 朱瞻基是个好同志 + +十三 祸根 + +十四 土木堡 + +十五 力挽狂澜 + + + + + +作者简介 + + +作者简介 + +作者当年明月是广州的一位国家公务员。 + +由于其所在的工作环境和一些特殊性,使得他在博览群书之余,能从一些不同于往常的角度去思考历史给我们的启迪,这也是他创作这部长篇历史评论的初衷。从文章中一些看了令人眼前豁然一新的点评,以及风趣活泼又不失独特视点的阐述,我们可以感受到作者对历史及文化的感悟,确实有其独到之处,并带有鲜明的个人印记。 + + + + + +内容简介 + + +内容简介: + +本书是《明朝那些事儿》第二册,内容自永乐夺位的“靖难之役”后开始,先叙述了中国历史上赫赫有名的永乐大帝事迹——挥军北上五征蒙古,郑和七下西洋,南下讨平安南等等,后来永乐于北伐蒙古归来途中病逝,明朝在经历了比较清明的“仁宣之治”后,开始进入动荡时期。大宦官王振把持朝政胡作非为,导致二十万精兵丧于一旦,幸亏著名忠臣于谦在“土木堡之变”中力挽狂澜,挽救了明帝国,但随即又在两位皇帝争夺皇位的“夺门之变”后被害身亡。 + +这一系列的事件和人物都精彩无比,可说高潮迭起,令人目不暇接、欲罢不能。 + +作为一本说历史的书,当年明月所用的笔法,却完全不是以往那些史书笔法。这是一种充满了活力和生气,字字都欲跃然而出的鲜灵笔法,在他笔下,人物不再是一个刻板的名字和符号,而是一个个活生生的人,那些事件更是跌宕起伏,叫人读来欲罢不能。之所以会有这样一种笔法,正如作者说的那样:“由于早年读了太多学究书,所以很痛恨那些故作高深的文章,其实历史本身很精彩,所有的历史都可以写得很好看”。 + + + + + +帝王的烦恼 + + +第二部 + +第一章 帝王的烦恼 + +新的一天又开始了,朱棣坐在皇帝宝座上,俯视着这个帝国的一切,之前那场你死我活的斗争似乎还历历在目,但已经不重要了。因为对于那场斗争中的失败者朱允炆来说,政治地位的完结意味着他的人生已经结束了,无论他本人是生还是死。但对于朱棣而言,今天的阳光是明媚的,他得到了自己想要的一切,在今后的很长时间内,他将用手中的权力去实现自己的梦想,一个富国强兵的梦想。 + +这个梦想不但是他的,也是他父亲的。 + +证明 + +当然在这之前,他必须先做几件事情,这些事情不完成,他的位子是坐不稳的。 + +最重要的事情是,他要证明自己是合法的皇帝。 + +虽然江山已经在手,但舆论的力量也是不能无视的,自己的身上反正已经被打上了反贼的烙印,没办法了,但至少要让自己的子孙堂堂正正的做皇帝。为了达到这个目的,他使用了两个方法: + +其一、他颁布了一道命令,下令凡是建文帝时代执行的各项规章制度与朱元璋的成例有不同的,全部废除,以老祖宗成法为准,这倒不是因为朱元璋的成法好用。只是朱棣要想获得众人的承认,必须再借用一下死去老爹的威名,表明自己才是真正领悟太祖治国精神的人。 + +其二、他命令属下重新修订《太祖实录》,此书已经由建文帝修过一次,但很明显,第一版并不符合朱棣的要求,他需要一个更为显赫的出身,因为类似朱元璋那样白手起家打天下,开口就是“我本淮右布衣”,摆出一幅天不怕、地不怕的那一套已经行不通了。这个世界上本来就没有人愿意做叫花子的,于是,亲生母亲被他扔到了脑后,马皇后成为了他的嫡母,关于这个问题,我们在后面还会详细叙说。 + +此外,他还指示手下人在实录中加入了大量小说笔法的描写,如朱元璋生前曾反复训斥朱标和朱允炆,总是一幅恨铁不成钢的样子,而对朱棣却总是赞赏有加,一看到朱棣就满面笑容,十分高兴。甚至在他死前,还反复询问朱棣的下落,并有意把皇位传给朱棣。但是由于奸诈的朱允炆等人的阴谋行为,合法的继承人朱棣并没有接到朱元璋的这一指示。于是,本该属于朱棣的皇位被无耻的剥夺了。这些内容读来不禁让人在极度痛恨朱允炆等奸邪小人之余,对朱棣终于能够夺得本就属于自己的皇位感到欣慰,并感叹正义终究取得了胜利,好人是有好报的。 + +当朱棣最终完成这两项工作时,他着实松了口气,不利于自己的言论终于被删除了,无数年后,这场靖难战争将被冠以正义的名号广为流传。但作为这段历史地见证人之一,朱棣心里很明白在那些篡改过的地方原本写着历史的真实。他把自己的父亲从坟墓里拖了出来,重新装扮一番,以证明自己的当之无愧。 + +历史证明,朱棣失败了,他没有能够欺骗自己,也没有骗到后来的人,因为真正的史笔并不是史官手下的毛笔,而是人心。 + + + + + +功 臣 + + +功臣 + +自欺欺人也好,自我安慰也好,毕竟皇位才是最现实的。在处理好继位的合法性问题后,下一步就是打赏功臣,这可是极为重要的一步。虽然历来皇帝最不愿意看到的就是大业已成后的功臣,但这些人毕竟在皇帝的大业中投入了大量资本,持有了股份,到了分红的时候把他们踢到一边,是不好收场的。毕竟任何董事局都不可能是董事长一个人说了算。 + +这里也介绍一下明朝的封赏制度,大家在电视中经常看到皇帝赏赐大臣的镜头,动不动就是“赏银一千两”,然后一个太监拿着一个放满银两的盘子走到大臣面前,大臣谢恩后拿钱回家。大致过程也是如此,但很多时候,电视剧的导演可能没有考虑过一千两银子到底有多重,在他们的剧情中,这些大臣们似乎都应该是在武校练过铁砂掌的,因为无论怎么换算,一千两银子都不是轻易用两只手捧得起来的。在此也提出建议,今后处理该类情节时,可以换个台词,比如“某某,我赏银一千两给你,用马车来拉!” + +以上所说的赏银在封赏中只是小意思,我们的先人很早就明白细水长流的道理。横财来得快去得快,真正靠得住的是长期饭票。在明朝,这张长期饭票就是封爵。 + +在那个年代,如果你不姓朱,要想得到这张长期饭票是很困难的,老朱家开的食堂是有名额限制的,如非立有大功,是断然不可能到这个食堂里开饭的。 + +具体说来,封爵这张饭票有三个等级,分别是公爵(小灶)、侯爵(中灶)、伯爵(大灶),此外还有流和世的区别,所谓流,就是说这张饭票只能你自己用,你的儿子就不能用了,富不过三代,饿死算他活该。而世就不同了,你死后,你的儿子、儿子的儿子还可以到食堂来吃饭。 + +但凡拿到这张饭票的人,都会由皇帝发给铁券(证书),以表彰被封者的英勇行为。这张铁券也不简单,分为普通和特殊两种版本。特殊版本分别颁发于朱元璋时代和朱棣时代,因为在这两个时代要想拿到铁券是要拼老命的。 + +朱元璋时代的铁券上书“开国辅运”四字,代表了你开国功臣的身份。朱棣时代的铁券上书“奉天靖难”四字,代表你奉上天之意帮助我朱棣篡权。这两个版本极为少见,在此之后的明朝二百多年历史中都从未再版。自此之后,所有的铁券统一为文臣铁券上书“守正文臣”,武将铁券上书“宣力功臣”。 + +当然了,如果你有幸拿到前两张铁券,倒也不一定是好事。特别是第一版“开国辅运”,因为据有关部门统计,拿到这张铁券的人80%以上都会由朱元璋同志额外附送一张阴曹地府的观光游览券。 + +此外还附有特别说明:单程票,适用于全家老小,可反复使用多次,不限人数。 + +朱棣分封了跟随他靖难的功臣,如张玉(其爵位由其子张辅继承)、朱能等,都被封为世袭公侯,此时所有的将领们都十分高兴,收获的季节到了。 + +但出人意料的是,有一个人对封赏却完全不感兴趣,在他看来,这些人人羡慕的赏赐似乎毫无价值。 + +这个人就是道衍。 + +虽然他并没有上阵打过仗,但毫无疑问的是,他才是朱棣靖难成功的第一功臣,从策划造反到出谋划策,他都是最主要的负责人之一。可以说,正是他把朱棣扶上了皇位。但当他劳心劳力的做成了这件天下第一大事之后,他却谢绝了所有的赏赐。永乐二年(1404),朱棣授官给道衍,任命他为资善大夫,太子少师(正二品),并且正式恢复他原先的名字——姚广孝。 + +此后姚广孝的行为开始变得怪异起来,朱棣让他留头发还俗,他不干,分给他房子,还送给他两个女人做老婆,他不要。这位天下第一谋士每天住在和尚庙里,白天换上制服(官服)上朝,晚上回庙里就换上休闲服(僧服)。 + +他不但不要官,也不要钱,在回家探亲时,他把朱棣赏赐给他的金银财宝都送给自己的同族。我们不禁要问,他到底为什么要这样做? + +在我看来,姚广孝这样做的原因有两个,其一,他是个聪明人,像他这样的智谋之人,如果过于放肆,朱棣是一定容不下他的。功高震主这句话始终被他牢牢的记在心里。 + +其二、他与其他人不同,他造反的目的就是造反。 + +相信很多人都曾被问到,你为什么要读书?一般而言这个问题的答案都是建设祖国,为国争光之类,而在人们的心中,读书的真正目的大多是为了升官、发财,为了满足自己的各种欲望。但事实告诉我们,为了名利去做一件事情也许可以获得动力和成功,但要成就大的事业,需要的是另一种决心和回答——为了读书而读书。 + +朱棣造反是为了皇位,他手下的大将们造反是为了开国功臣的身份和荣誉地位。道衍造反就是为了造反。他的眼光从来就没有被金钱权位牵制过,他有着更高的目标。道衍是一颗子弹,四十年的坎坷经历就是火药,他的权谋手段就是弹头,而朱棣对他而言只是引线,这颗子弹射向谁其实并不重要,能被发射出去就是他所有的愿望。 + +姚广孝,一个被后人称为“黑衣宰相”、争论极大的人,一个深入简出、被神秘笼罩的人,他的愿望其实很简单: + +一展胸中抱负,不负平生所学,足矣。 + + + + + +兄 弟 + + +兄弟 + +建文帝时期,朱棣是藩王,建文帝要削藩,朱棣反对削藩,最后造反,现在朱棣是皇帝了,他也要削藩,那些幸存下来的藩王自然也会反对,但与之前不同的是,他们已经无力造反了。 + +在反对削藩的斗争终于获得胜利后,与他的兄弟们本是同一战线的朱棣突然抽出了宝剑,指向了这些不久之前的战友们,这倒也是理所应当的事情,兄弟情分本来也算不上什么,自古以来父子兄弟相残都是家常便饭。而我们似乎也不能只从人性的冷酷上找原因,他们做出这种行为只是因为受到了不可抗拒的诱惑,这个诱惑就是无上的权力。 + +有权力就可以清除所有自己不喜欢的人,可以得到所有自己想要的东西,可以号令天下,可以任意妄为!自古以来,无数道德先生、谦谦君子都拜倒在它的脚下,无人可以抗拒它的诱惑,兄弟又算得了什么? + +最先被“安置”的是宁王,他被迫跟随朱棣“靖难”,为了换得他的全心支持,朱棣照例也开给了他一张空白支票“事成中分天下”。当然,朱棣这位从来不兑现支票的银行家此次也没有例外,靖难成功之后,他就把这句话抛在了脑后。 + +宁王朱权也是个明白人,他知道所谓中分天下的诺言纯属虚构,且从无雷同,中分他的脑袋倒是很有可能的,于是他很务实的向朱棣提出,北方我不想去了,也不想掌握兵权,希望你能够把我封到苏州,过两天舒服日子。 + +朱棣的回答是不行。 + +“那就去钱塘一带吧,那里也不错。” + +还是不行,朱棣再次向他承诺:除了这两个地方,全国任你挑! + +宁王朱权苦笑道:“还敢再挑么,你看着办吧。” + +于是,朱权被封到了南昌,这是朱棣为他精心挑选的地方。而被强行发配的朱权的心情想来是不会愉快的,一向争强好胜的他居然被人狠狠地鱼肉了一番,他是绝不会心服的,这种情绪就如同一颗毒芽,在他的心中不断生长,并传给了他的子孙。 + +报复的机会终究是会到来的 + +永乐四年(1406)五月,削去齐王爵位和官属,八月,废其为庶人。 + +永乐六年(1408),削去岷王官属及护卫。 + +永乐十年(1412),削去辽王官属及护卫。 + +永乐十九年(1421),削去周王护卫 + +于是,建文帝没有解决的问题终于由他的叔叔朱棣代为解决了。削藩这件建文帝时期第一大事居然是由藩王朱棣最终办成的,这真是一个极大的讽刺。 + +完成这些善后事宜之后,朱棣终于可以把精力放在处理国家大事上了,事实证明,他确实具备一个优秀皇帝的素质,而我们也将把历史上明君继位后干的那些恢复生产,勤于政事之类的套话放到他的身上。又是一片歌舞升平、太平盛世。 + +这样看来,下面的叙述应该是极其乏味的。 + +可惜朱棣并不是一个普通的英明皇帝,他的故事远比那些太平天子要曲折、神秘得多,因为在他的身上,始终环绕着两个疑团,这两个疑团困扰了后人数百年之久,下面我们将对这些谜团进行探究,以期找出真相。 + + + + + +母子不相认 + + +母子不相认 + +《永乐实录》记载:高皇后(马皇后)生五子,长懿文太子标……次上(朱棣),次周王肃。这就是正史的记载,从中可以看出,朱棣是朱元璋和马皇后的第四个儿子。 + +然而事实真是如此吗? + +元至正二十年(1360),朱棣在战火中出生,他是朱元璋的第四个儿子,这并没有错,但那个经历痛苦的分娩,给予他生命、并抚育他长大的母亲却并不是马皇后,那个带着幸福的笑容看着他出生的女人早已经被历史湮没。 + +事实上经过历史学家几百年的探究,到如今,我们也并不知道这位母亲的真实姓名,甚至她的真实身份也存在着争议。这些谜是人为造成的。因为有人不希望这位母亲暴露身份,不承认他有一个叫朱棣的儿子。 + +这个隐瞒真相的人正是朱棣自己。 + +因为朱棣是皇帝,而且是抢夺侄子皇位的皇帝,所以他必须是马皇后的儿子,因为只有这样,他才是嫡出,才有足够的资本去继承皇位。 + +他绝不能是一个身份低贱妃子的儿子,绝对不能! + +正是由于这些政治原因,这位母亲被剥夺了拥有儿子的权利,她永远也不能如同其他母亲一样,欣慰的看着自己的子女成长,并在他们长成后自豪的对周围的人说:“看,那就是我的儿子!” + +在所有的官方史书中,她只不过是一个普通的妃子,没有显赫的家世,没有值得骄傲的子女,平凡的活着,然后平凡的死去。 + +虽然朱棣反复修改了史书,并消灭了许多证据,但历史无法掩盖这句话实在是很有道理的,破绽是存在的,而更让人难以置信的是,它就存在于官方史书中。 + +第一个破绽在明史《黄子澄传》中,其中记载:“子澄曰:周王,燕王之母弟。”从这句话,我们可以很清楚地了解到一个事实,那就是燕王朱棣和周王是同父同母的兄弟。可能有人会认为这是句废话,因为《永乐实录》中也记载了他们两个是同母兄弟,但问题在于,他们的母亲是谁? + +于是下面我们将引出第二个破绽,《太祖成穆孙贵妃传》中,有记载如下:“洪武七年九月薨,年三十有二。帝以妃无子,命周王肃行慈母服三年。”这句话的意思是说,贵妃死后,由于没有儿子,所以指派周王为贵妃服三年,但关键的一句话在后面:“庶子为生母服三年,众子为庶母期,自妃始。” + +“庶子为生母服三年!”看清楚这句话,关键就在这里。正是因为周王是庶子,他才能认庶母为慈母,并为之服三年。再引入我们之前燕王和周王是兄弟的条件,大家对朱棣的身份就应该有一个清楚的认识了。 + +如果有人不明白,我可以用更为简单明了的方式来描述这个推论过程。 + +条件A.周王和燕王是同母兄弟 + +条件B.周王是庶子 + +得出结论C.燕王是庶子。 + +这是正式史书上的记载,至于野史那更是数不胜数,由于这是一个极为重要的问题,所以我们不引用野史,但另有一本应属官方史料记载的《南京太常寺志》曾记载朱棣母亲的真实身份——贡(左有石旁)妃。 + +这里我们先说一下太常寺是一个什么样的机构,太常寺属于礼仪机关,主要负责祭祀、礼乐之事,凡是册立、测风、冠婚、征讨等事情都要在事先由该机关组织实施礼仪,所以它的记载是最准确的,按说有了太常寺的记载,这件事情就没有什么可争论的了,但好事多磨,又出了一个新的问题。 + + + + + +此书已经失传了 + + +此书已经失传了 + +可能看到这里,有人就要骂我了,说了这么多,结果是空口说白话,不是逗人玩吗? + +实在抱歉,因为这书也不是我弄丢的,即使你找遍所有的图书馆,也是找不到这本书的,但是不要着急,因为虽然本人也没有看过这本书,古人却是看过的,并在自己的书中留下了记录。如《国史异考》、《三垣笔记》中都记载过,《南京太常寺志》中确实写明,朱棣的母亲是贡(左有石旁)妃,而孝陵神位的摆布为左一位李淑妃,生太子朱标、秦王、晋王,右一位贡(左有石旁)妃,生成祖朱棣。 + +要知道,在古代,神位的排序可不是按照姓氏笔排列,是严格按照身份来摆列的。 + +而《三垣笔记》更是指出,钱谦益(明末大学问家,后投降清朝)曾于1645年元旦拜谒明孝陵,发现孝陵神位的摆布正如《南京太常寺志》中的记载,贡(左有石旁)妃的灵位在右第一位,足见其身份之高。 + +虽然以上所说的这些证明力度不能和明史相比,但从法律角度来说,也算是证人证言,属于间接证据,当我们把所有证据连接起来时,就会发现朱棣生母的身份应该已经很清楚了。 + +这里也特别注明,关于成祖生母的身份问题已经由我国两位著名的史学家吴晗先生和傅斯年先生论证过,在此谨向两位伟大的先人致敬,是他们为我们揭开了历史的谜团,还原了历史的真相。 + +但是遗憾的是,那位生下朱棣的母亲的生平我们已经无从知晓了,我们只知道,他的儿子抹煞了她在人间留下的几乎全部痕迹,不承认自己是她的儿子。 + + + + + +为了权力(1) + + +为了权力 + +朱棣又一次向马皇后的神位行礼,虽然马皇后确实是一位慈祥的长辈,虽然她也曾无微不至的关照过自己,但她毕竟不是自己的母亲。 + +我也是迫不得已,为了坐上皇位,已经是九死一生,如果再背上一个庶子的名分,怎能服众?怎能安心? + +所以我修改了记录,所以我湮灭了证据,我绝不能承认你是我的母亲!我唯一能做的就是排出你的神位,提高你的身份,我能做的就是这些了。我知道这些并不够,也不足以报答你的生养之情,但我没有别的选择。 + +您是我的母亲,只在我的心中,永远。 + +兄弟不相容 + +建文帝真的死了吗?这曾经是朱棣长时间思考过的一个问题,这个问题他思考了二十二年,从建文四年(1402)靖难成功开始,到永乐二十一年(1423)结束。不负有心人,他最终找到了这个问题的答案,仅仅在他临死之前一年。 + +让我们回到建文四年(1402)的那个夏天,看看谜团的开始。 + +六月十三日,李景隆打开金川门,做了无耻的叛徒,放北军入城,而朱棣却不马上攻击内城,他的目的是等待建文帝自己自杀或者投降,他似乎认为建文帝除了这两条路外,没有别的选择。然而建文帝注定是要和他一生作对的。他选择了第三条路。 + +当扎营于龙江驿的朱棣发现宫城起火时,他十分慌乱,立刻命令士兵进城,救火倒是其次,最重要的是要找一样东西——建文帝,活的死的都行,活要见人!死要见尸! + +朱棣十分清楚这件事的利害关系,即使建文帝死了,大不了背一个逼死主君罪名,自己的骂名够多了,不差这一个。活着的话关起来就是了,也不怕他飞上天去。 + +但最可怕的事情就是失踪,皇帝不见了那可就麻烦了。 + +朱允炆毕竟是合法的皇帝,而自己不过是占据了京城而已,全国大部分地方还是效忠于他的,万一他要是溜了出去,找一个地方号召大臣勤王,带兵攻打自己,到时候胜负还真是未知之数。 + +可是怕什么来什么,经过清查,真的没有找到朱允炆的尸体!朱棣急得像热锅上蚂蚁,命令士兵加紧排查,仍然一无所获。可能有人会奇怪,朱棣已经控制了政权,要找个人还不容易么? + +不瞒你说,还真是不容易,因为这个人是不能公开寻找的。 + +首先不能登寻人启事,什么你叔叔病重,甚为想念,望你见启事后速回之类的话肯定是不会有效果的,其次也不能贴上通缉令,写上什么抓到后有重赏之类的言语,因为朱棣的行动按他自己的说法是靖难,即所谓扫除奸臣,皇帝是并没有错误的,怎么能够被通缉呢,所以这条也不行。最后,他也不能公开派人大规模寻找,因为这样无异于告诉所有的人,建文帝还活着,心中别有企图的人必然会蠢蠢欲动,这个皇位注定是坐不稳了。 + +但是又不能不找,万一哪天蹦出来一个建文帝,真假且不论,号召力是肯定有的,即使平定下来,明天后天可能会出来两个三个,还让不让人安心过日子了?君不见一个所谓的“朱三太子”闹得清朝一百多年不得安宁,所以这实在是一件要命的事情啊。 + +为解决这个问题,朱棣想出了一个绝佳的计划,这个计划分两个部分: + +首先,向外界宣布,建文帝已经于宫内自焚,并找到了尸体,那意思就是所有建文帝的忠臣们,你们就死了这条心吧。 + +其次,派人暗中查访建文帝的下落,具体的查访工作由两个人去做,这两个人寻访的路线也不同,分别是本土和海外。这两个人的名字,一个叫胡荧(有三点水旁),另一个叫郑和。 + +郑和的故事大家都熟悉,我们在后面的章节也会详细介绍这次偶然事件引出的伟大壮举,在此,我们主要讲一下胡荧(有三点水旁)这一路的问题。 + +胡荧(有三点水旁),江苏常州人,既不是靖难嫡系,也不是重臣之后,其为人“喜怒不形于色”,当时仅任给事中,没有任何靠山,可谓人微言轻。在朝中是个不起眼的人物。 + + + + + +为了权力(2) + + +但朱棣却挑中了他,因为正是这样的一个人,才适合去执行这样秘密的任务。 + +无人问津,无人在意,即使出了什么事也可以声明此人与己无关,你不去谁去? + +永乐五年(1407),胡荧(有三点水旁)带着绝密使命出发了,朱棣照例给了他一个公干的名义——寻找仙人。这个名义真是太恰当了,因为仙人本来就是神龙见首不见尾的,但又确实有寻找的价值,一百年找不到也不会有人怀疑。胡荧(有三点水旁)就此开始了他人生中最重要的一项工作——寻人。 + +当然,朱棣和他本人都知道,他要寻找的不是仙人,而是一个死人,至少是一个已经被开出死亡证明的人。 + +朱棣看着胡荧(有三点水旁)远去的身影,心中期盼着那个人的消息尽快传到自己的耳朵里,死了也好,活着也好,只要让我知道就好。和以往一样,他相信自己的选择是正确的,这个人一定会告诉我问题的答案。 + +他的判断是正确的,胡荧(有三点水旁)确实是会给他答案的。他也做好了长期等待的准备,但他没有想到,等待的时间真的很长。 + +胡荧(有三点水旁)开始忠实地履行他的职责,他“遍行天下州郡乡邑,隐查建文帝安在”,这期间连自己的母亲死去,他也没有回家探望,而是继续着自己的工作,探寻这个秘密已经成为了他人生的一个重要组成部分。他的努力并没有白费,最终,他找到了答案,在十六年之后。 + +既然答案揭晓要到十六年之后了,我们就先来看看为什么建文帝的死亡与否会有如此大的争议,其实明代史料大部分都认为建文帝没有死,而且还有一些野史详细记载了建文帝出逃时候的各种情况,虽不可信,但也可一观。 + +根据明代万历年间出版的《致身录》一书所记载,建文帝在城破之日万念俱灰,想要自杀,此时,一个太监突然站出来说道:“高祖驾崩时,留下了一个箱子,说遇到大难之时才可打开,现在是时候了,请皇上打开箱子吧。” + +然后,他们把箱子取出并打开,发现里面东西一应俱全,包括和尚的度牒,袈裟、僧帽、剃刀、甚至还有十两白金。更让人称奇的是,里面还有朱元璋同志的亲笔批示,指示了逃跑路线。于是,建文帝等一干人就此逃出升天。 + +看过以上这些记载,相信大家可能都有似曾相识的感觉,没错,这些记载似乎带有武侠小说的写法和情节,朱元璋确实神机妙算,但还不至于到这个程度,就算他预料到自己的孙子将来要跑路,可他还能预先准备服装道具和路费,甚至连逃跑的路线都能指示的一清二楚,就明显是在胡扯了。就如同武侠小说中 ,某位大侠跌下山崖,然后遇到某位几十年不出山的活老前辈或是挖到死老前辈留下的遗物,而这样的传奇情节在历史上是并不多见的。 + +虽然存在着这些近乎荒诞的记载,但明朝史料大都认为建文帝没有死,那么为什么这个问题还能引起那么大的争议呢?这是因为在后来,一件事情的发生使得建文帝的生死变得不再是单纯的历史问题,而是极为复杂的政治问题。 + +这件事情就是“朱三太子”事件,即所谓明朝灭亡之时,朱三太子并没有死,而是活下来继续组织反清的事件,要说这位朱三太子也实在算是个神仙,从顺治到康熙、雍正,历经三个皇朝,如同幽灵般缠绕着清朝统治者,一直捱到三个皇帝都死了他却始终战斗在反清第一线。清朝政府对这个幽灵极其头疼。很明显,建文帝的故事与朱三太子有很多相似之处,故而在修明史时,清朝政府即授意史官更改这段历史,一口咬定建文帝自杀而死。 + +值得肯定的是,很多史官坚持了原则,顶住了压力,坚持建文帝未死之说,但无耻的人无论哪个朝代总是不会缺的,大学者王鸿绪就是这样的一个人。他的人品明显比不上他的学问,为了逢迎清朝政府,他私自修改了明史稿(明史底稿),认定建文帝已死。由于明史毕竟是官方史书,故而影响了很多人对建文帝之死的看法,直到近代,史学界对建文帝未死的问题才有了一个比较肯定的意见。 + +历史的真相始终是被笼罩在迷雾中的,无数人为了各种目的去修饰和歪曲它,以适应自己的需要。 + +但我始终相信,真相只有一个,而它必定有被揭开的一天。 + + + + + +帝王的荣耀 + + +第二章帝王的荣耀 + +无论我们从哪个角度来看,朱棣都绝对算不上一个好人,这个人冷酷、残忍、权欲熏心,在日常生活中,我们绝对不想和这样的一个人做朋友。但他却是一个实实在在的好皇帝。 + +一个皇帝从不需要用个人的良好品格来证明自己的英明,恰恰相反,在历史上干皇帝这行的人基本都不是什么好人,因为好人干不了皇帝,朱允炆就是铁证。 + +一个人从登上皇位成为皇帝的那一天起,他所得到的就绝不仅仅是权位而已,还有许许多多的敌人,他不但要和天斗、和地斗,还要和自己身边的几乎每一个人斗,大臣、太监、老婆(很多)、老婆的亲戚(也很多)、兄弟姐妹, 甚至还有父母(如果都还活着的话),他成为了所有人的目标。如果不拿出点手段,显示一下自己的能力,很容易被人找到空子踢下皇位,而历史证明,被踢下皇位的皇帝生存率是很低的。 + +为了皇位,为了性命,必须学会权谋诡计,必须六亲不认,他要比最强横的恶霸更强横,比最无赖的流氓更无赖,他不能相信任何人。所以我认为,孤家寡人实在是对皇帝最好的称呼。 + +朱棣就是这样的一个恶霸无赖,也是一个好皇帝。 + +他精力充沛,以劳模朱元璋同志为榜样,每天干到很晚,不停的处理政务。他爱护百姓,关心民间疾苦,实行休养生息政策,在他的统治下,明朝变得越来越强大。荒地被开垦,人们生活水平提高,仓库堆满了粮食和钱币。经济科技文化都有很大的发展,他凭借自己的努力打造出了一个真正的太平盛世。 + +他制定了很多利国利民的政策,也很好地执行了这些政策,使得明朝更为强大,如果要具体说明,还可以列出一大堆经济数字,这些都是套话,具体内容可参考历代历史教科书。我不愿意多写,相信大家也不愿意多看,但值得思考的是,这些举措历史上有很多皇帝都做过,也取得过不错的效果,为什么朱棣却可以超越他们中的绝大多数人,成为中国历史上为数不多的公认的伟大皇帝呢? + +这是因为他做到了别的皇帝没有能够做到的事情。 + +下面,我们将介绍这位伟大皇帝的功绩,就如同我们之前说过的那样,他绝对不是一个好人,却绝对是一个好皇帝。他用惊人的天赋和能力成就了巨大的功业,给我们留下了不朽的遗产,并在六百多年后依然影响着我们的国家和民族,所以从这个角度来说,他确实是中国历史上一位伟大的皇帝,当之无愧。 + + + + + +修 书 + + +修书 + +说起修书这件事,应该是很多人向往的吧,把自己的努力化为书籍确实是一件让人快乐的事情,而对于某些没有能力写书的人而言,要出版一本书还是有办法的。比如我原先上大学的时候,学校的一些教务人员(不教书的)眼红教研室的人出书,想写书却没本事,也不知是谁出的主意,到四处抄来一些名人名言,居然搞出了一本书出版。当然,其销量也是可以预料的。 + +说来很难让人相信,早在几百年前的朱棣时代,也有人做过一件类似的事情,做这件事情的就是朱棣。 + +我们之前说过,朱棣文化修养有限,他自己应该是写不出什么传世名著的,所以他只能指示手下的人修书,其目的当然也是为了自己的名声。其实这并没有什么可指责的,哪个皇帝不想青史留名呢?以往的很多皇帝修了很多书,修书其实是一件并不稀罕的事情,但朱棣确实是个雄才大略的人。他要修的是一部前无古人的书,他要做的是一件前人没有做过的事。 + +“我要修一部古往今来最齐备,最完美、最优秀的书,要让千年之后的人们知道我们这个时代的光辉和荣耀!” + +他做到了,他修成了一部光耀史册,流芳千古的伟大书籍——永乐大典。 + +但就如我们前面说过的那样,他只是一个决策者,无论决策多么英明,没有人执行也是不行的,按照朱棣的构想,他要修一部包含有史以来所有科目,所有类别的大典,毫无疑问,这是一项艰巨的任务,需要一个合适的人担任总编官,这个人必须有广博的学问、清晰的辨别能力、无比的耐心、兼容并包的思想。 + +符合以上条件的人实在是很难找的,但值得庆幸的是,朱棣也确实找到了一个这样的人。 + +而这个人的一生也和永乐大典紧紧地联系在了一起,他的命运如同永乐大典这部书一样,跌宕起伏,却又充满传奇。 + +所以,在我们介绍永乐大典之前,必须先介绍这位伟大的总编官。 + + + + + +命 运 + + +命运 + +永乐十三年(1415),锦衣卫指挥纪纲下达了一道奇怪的命令,他要请自己牢里的一个犯人吃饭。这可是一条大新闻,纪纲是朱棣的红人,锦衣卫的最高统帅,居然会屈尊请一个囚犯吃饭,大家对此议论纷纷。 + +这位囚犯欣然接受了邀请,但饭局开张的时候,纪纲并没有来,只是让人拿了很多酒给这位囚犯饮用,这位心事重重的囚犯一饮便停不住,他回想起了那梦幻般的往事,不一会便酩酊大醉。 + +看他已经喝醉,早已接到指示的锦衣卫打开了大门,把他拖了出去。 + +外面下着很大的雪,此时正是正月。 + +这位囚犯被丢在了雪地里,在漫天大雪之时,在这纯洁的银白色世界里,在对往事的追忆和酒精的麻醉作用中,他迎来了死亡。 + +这个囚犯就是被称为明代第一才子的解缙,永乐大典的主编者。这一年,他四十七岁。 + + + +起点 + +解缙,洪武二年(1369)出生,江西吉安府人,自幼聪明好学,被同乡之人称为才子,大家都认为他将来一定能出人头地。他没有辜负大家的期望,洪武二十一年(1388),他一举考中了进士,由于在家乡时他的名声已经很大,甚至传到了京城,所以朱元璋对他也十分重视,百忙之中还抽空接见了他。朱元璋的这一举动让所有的人都认为,一颗政治新星即将升起。 + +当时正是政治形势错综复杂之时,胡维庸已经案发,法司各级官员不断逮捕大臣,很多今天同朝为臣的人第二天就不见了踪影,真可谓腥风血雨,变化莫测,在这样的环境下,很多大臣成了逍遥派,遇事睁只眼闭只眼,只求能活到退休。 + +但解缙注定是个出人意料的人,在这种朝不保夕的恶劣政治环境中,他没有退却,畏缩,而是表现出了一个知识分子的骨气和勇敢。 + +他勇敢的向朱元璋本人上书,针砭时弊,斥责不必要的杀戮,并呈上了一篇很有名的文章《太平十策》,在此文中,他详细概述了自己的政治思想和治国理念,为朱元璋勾画了一幅太平天下的图画,并对目前的一些政治制度提出了意见和批评。 + +朱元璋的性格我们之前已经介绍过,你不去惹他,他都会来找你麻烦,可是这位解大胆居然敢摸老虎屁股,这实在是需要极大的勇气的。当时很多人都认为解缙疯了,因为只有疯子才敢去惹疯子。 + +解缙疯没疯不好考证,但至少他没死。朱元璋一反常态,居然接受了他的批评,也没有找他的麻烦,当时的人们被惊呆了,他们想不通为什么解缙还能活下来,于是这位敢说真话的解缙开始名满天下。 + +出了名后,烦恼也就来了,固然有人赞赏他的这种勇敢行为,但也有人说他在搞政治投机,是看准机会才上书的。但解缙用他的行为粉碎了所谓投机的说法。他又干出了一件惊天动地的事情。 + +洪武二十三年(1390),朱元璋杀掉了李善长,这件事情有着很深的政治背景,当时的大臣们都很清楚,断然不敢多说一句话。可是永不畏惧的解缙又开始行动了,他代自己的好友上书朱元璋,为李善长申辩。 + +这是一起非常严重的政治事件,朱元璋十分恼火,他知道文章是解缙写的,但出人意料的是,他仍然没有对解缙怎么样,这件事情给了解缙一个错误的信号,他认为,朱元璋是不会把自己怎么样的。 + +解缙继续他的这种极为危险的游戏,他胸怀壮志,不畏权威,敢于说真话,然而他根本不明白,这种举动注定是要付出沉重代价的。不久,他就得到了处罚。 + +洪武二十四年(1391),朱元璋把解缙赶回了家,并丢给他一句话“十年之后再用”。 + +于是,解缙沿着三年前他进京赶考的路回到了自己的家,荣华富贵只是美梦一场,沿路的景色并没有什么变化,然而解缙的心却变了。 + +他始终不明白,自己只不过是说了几句实话,就受到了这样的处罚,读书人做官不就是为了天下苍生吗,不就是为国家效力吗? 这是什么道理! + +那些整天不干正事,遇到难题就让,遇到障碍就倒的无耻之徒牢牢的把握着权位,自己这样全心为国效力的人却得到这样的待遇,这不公平。 + +罢官的日子是苦闷的,人类的最大痛苦并不在于一无所有,而是拥有一切后再失去。京城的繁华,众人的仰慕,皇帝的器重,这些以往的场景时刻缠绕在解缙的心头。 + +在故乡的日子,他一直思索着一个问题,那就是,自己为什么会失败?才学?度量? + +不,不是这些,终于有一天,他开始意识到,自己失败的原因是幼稚,幼稚得一塌糊涂,自己根本就不知道官场是个什么地方。信仰和正直在朝堂之上是没有市场的,要想获得成功,只能迎合皇帝,要使用权谋手段,把握每一个机会,不断的升迁,提高自己的地位! + +解缙终于找到了他自认为正确的道路,他的一生就此开始转变。 + +洪武三十一年(1398),朱元璋去世了,此时距解缙回家已经过去了七年,虽然还没有到十年的约定之期,但解缙还是开始行动了,他很明白,就算到了十年之期,也不会有官做的的,要想当官,只能靠自己! + +他依靠先前的关系网,不断向高官和皇帝上书,要求获得官职,然而命运又和他开了一个玩笑,建文帝虽然知道他很有才能,却不愿用他,只给了他一个小官。把他远远的打法到遥远的西部。幸好他反应快,马上找人疏通关系,终于留在了京城,在翰林院当了一名小官。 + +此时的解缙已经完全没有了青年时期的雄心壮志,他终于明白了政治的黑暗和丑恶,要想往上爬,就不能有原则,不能有尊严,要会溜须拍马,要会逢迎奉承,什么都要,就是不能要脸! + +黑暗的世界啊,我把灵魂卖给你,我只要荣华富贵! + +收下了他的灵魂,黑暗的世界给了他一次机会。 + + + + + +转 折 + + +转折 + +靖难开始了,建文帝眼看就要失败,朱棣已经胜利在望,在这关键时刻,解缙和他的两位好友进行了一次谈话,这是一次载入史册的谈话,就在这次谈话中,三个年轻人确定了不同的人生方向。 + +这里,我们要要先介绍解缙的两位好友,他们的名字分别是胡广、王艮。所谓物以类聚,人以群分,能和解缙这样的才子交朋友的,自然也不是寻常之辈,实际上,这两个人的来头并不比解缙小。 + +说来也巧,他们三个人都是江西吉安府人,是老乡关系,也算是个老乡会吧,解缙是出名的才子,我们前面说过,他是洪武二十一年的进士,高考成绩至少是全国前几十名,可和另两个人比起来,他就差得远了。 + +为什么呢,因为此二人分别是建文二年高考的状元、榜眼。另外还要说一下,第三名叫李贯,也是江西吉安府人,他也是此三人的好友。但由于他没有参加这次的谈话,所以并没有提到他。确实厉害,头三名居然被江西吉安府包揽,让人惊叹此地的教育之发达,足以媲美今日之黄冈中学。 + +大家都是同乡,又是饱学之士,自然有很多共同话题,眼下建文帝这个老板就要完蛋了,他们要坐下来商量一下自己的前途,这三个人都是邻居,而他们谈话的地点选在了另一个邻居吴溥的家里。 + +在他们说出自己的志向前,我们有必要先提一下,解缙、胡广、王艮、李贯都是建文帝的近侍,也就是说他们都是皇帝身边的人,深受皇帝的信任,他们对时局的态度很能反映当时朝臣的看法。但四人中王艮比较特殊,他最有理由对皇帝不满,这是为什么呢? + +因为在建文二年(1400)的那次科举考试中,他才是真正的状元! + +此人经过会试后,参加了殿试,在殿试中,他的策论考了第一名,本来状元应该是他的。但是意想不到的事情发生了,建文帝嫌她长得不好看,把第一名的位置给了胡广(貌寝,易以胡靖,即胡广也)。就这样,到手的状元飞了,按说他应该对建文帝十分不满才对,可这个世界又一次让我们看到了人性的丑恶和真诚。 + +建文帝就要倒台了,大家的话题自然不会扯到诗词书画上,老板下台自己该怎么办,何去何从?三个人作出了不同的选择。当然这个选择是在心底作出的。 + +三人表现如下: + +解缙陈说大义,胡广也愤激慷慨,表示与朱棣不共戴天,以身殉国。王艮不说话,只是默默流泪。 + +谈话结束后的表现: + +解缙结束谈话后,连夜收拾包袱,跑到城外投降了朱棣,而且他跑得很快,历史上也留下了相关证据——“缙驰谒”。胡广第二天投降,十分听话——“召至,叩头谢”。看看,多么有效率,召至,召至,一召就至。第三名李贯也不落人后——“贯亦迎附”。 + +而沉默不语的王艮回家后,对自己的妻子说:“我是领国家俸禄的大臣,到了这个地步,只能以身殉国了。” + +然后他从容自杀。 + +国家以貌取人,他却未以势取国。 + +那一夜,有两个说话的人,一个不说话的人,说话者说出了自己的诺言,最终变成了谎言。不说话的人沉默,却用行动实现了自己心中的诺言。 + +其实早在他们以不同的方式表现自己时,已经有一个人看出了他们各自的结局,这个人就是冷眼旁观的吴溥。 + +就在胡广慷慨激昂的发表完殉国演讲,并一脸正气的告辞归家之后(他家就在吴溥家旁边),吴溥的儿子深有感叹地说道:“胡叔(指胡广)有如此气概,能够以身殉国,实在是一件好事啊。” + +吴溥却微微一笑,说道:“这个人是不会殉国的,此三个人中唯一会以身殉国的只有王艮。” + +吴溥的儿子到底年轻,对此不以为然,准备反驳他的父亲,谁知就在此时,门外传来了胡广的声音: + +“现在外面很乱,你们要把家里的东西看好!” + +两人相对苦笑。 + +话说回来,我们似乎也不能过多责怪这几个投降者,特别是解缙,他受了很多苦,历经了很多坎坷,他太想成功了,而这个机会,是他绝对不能放过的。 + +对于这四个人的行为,人心自有公论。 + + + + + +你是这种人 + + +于是,解缙就此成为了朱棣的宠臣,无论他用了什么手段,他毕竟实现了自己的梦想。从此他开始了自己的传奇性的一生,但在此之前,我们有必要介绍一下,投降三人组中其余两个成员的下落。 + +李贯:朱棣在掌握政权后,拿到了很多朝臣给建文帝的奏章,里面也有很多要求讨伐他的文字,他以开玩笑似的口吻对朝堂上的大臣们说:“这些奏章你们都有份吧。”下面的大臣个个心惊胆战,其实朱棣不过是想开个玩笑而已,他并不会去追究这些人的责任,但一件意想不到的事情发生了。 + +惹事的正是这个李贯,他从容不迫的说道:“我没有,从来也没有。”然后摆出一幅怡然自得的样子。他是一个精明人,很早就注意到了这个问题,为了避祸,他从未上过类似的奏章。 + +现在他的聪明才智终于得到了回报,不过,是以他绝对预料不到的方式。 + +朱棣走到李贯面前,突然把奏章扔到了他的脸上,厉声说道: + +“你还引以为荣吗!你领国家的俸禄,当国家的官员,危急时刻,你作为近侍竟然一句话都不说,我最厌恶的就是你这种人!” + +全身发抖的李贯缩成一团,他没有想到,无耻也是要付出代价的。 + +在这之后,他因为犯法被关进监狱,最后死于狱中,在他临死时,终于悔悟了自己的行为,失声泣道:“王敬止(王艮字敬止),我没脸去见你啊。” + +胡广:之后一直官运亨通,因为文章写得好,有一定处理政务的能力,与解缙一起被任命为明朝首任内阁七名成员之一,后被封为文渊阁大学士。此人死后被追封为礼部尚书,他还创造了一个记录,那就是他是明朝第一个获得谥号的文臣,他的谥号叫做“文穆”。 + +综观他的一生,此人没有吃过什么亏,似乎还过的很不错,不过一个人的品行终归是会暴露出来的。 + +当年胡广和解缙投奔朱棣后,朱棣看到他们是同乡,关系还很好,便有意让他们成为亲家,但当时解缙虽然已经有了儿子,胡广的老婆却是刚刚怀孕,不知是男是女。此时妇产科专家朱棣在未经B超探查的情况下,断言:“一定是女的。” + +结果胡广的老婆确实生了个女孩,所以说领导就是有水平,居然在政务活动之余对妇产科这种副业有如此深的造诣。事后证明,这个女孩也确实不简单,可惜我在史料中没有找到她的名字,只知道她肯定姓胡。 + +这个女孩如约与解缙之子完婚,两家都财大气粗,是众人羡慕的佳对。然而天有不测风云,解缙后来被关进监狱,他的儿子也被流放到辽东,此时胡广又露出了他两面三刀的本性,亲家一倒霉掉进井里,他就立刻四处找石头。勒令自己的女儿与对方离婚。 + +在那个时代,父母之命就是一切,然而这位被朱棣赐婚的女孩很有几分朱棣的霸气,她干出了足以让自己父亲羞愧汗颜的行为。胡广几次逼迫劝说,毫无效果,最后他得到了自己女儿的最终态度,不是分离的文书,而是一只耳朵。 + +她的女儿为表明决不分离的决心,割下了自己的耳朵以明志,还怒斥父亲:“我的亲事虽然不幸,但也是皇上做主,你答应过的,怎么能够这样做呢,宁死不分!” + +这位壮烈女子的行为引起了轰动,众人也借此看清了胡广的面目,而解缙的儿子最终也获得了赦免,回到了那位女子的身边。 + +胡广,羞愧吧,你虽饱读诗书,官运亨通,气节却不如一个普通女子! + +还是那句话,人心自有公论。 + + + + + +飞 腾 + + +飞腾 + +朱棣之所以器重解缙,很大的原因就在于他准确地判断出,解缙就是那个能胜任大典主编工作的人。于是,在永乐元年(1403),朱棣郑重的将这个可以光耀史册也可以累死人的工作交给了解缙。他的要求是“凡书契以来经史子集百家直言,至于天文地志阴阳医卜僧道技艺之言,备辑成一书,毋厌浩繁”。 + +多么豪壮的话语和愿望!请大家不要小看修书这件事,在信息并不发达的当时,书籍即使出版后也是很容易失传的,因为当年也没有出版后送一本给图书馆的习惯,小说之类的书很多人看,但某些经史子集之类的学术书籍就很少有人问津(这点和现在差不多),极易失传。而某些不传世的书籍就更像武侠小说中的秘籍一样,隐藏于深山密林之中,不为人知。要采集这些书籍,必须要大量的金钱和人力物力。所以虽然每个朝代都修书,却大有不同。比较穷的朝代官方修书数量有限,只求修好必须修的那一本——前朝的史书。 + +而朱棣要修的不是一本,也不是一部书,他要修的是涵盖古今,包容万象,蕴含一切知识财富的百科全书! + +这不仅仅是文化,这是包括经济在内的综合实力的体现,是一个国家自信和强大的象征! + +大典之外,再无它书! + +我们可以想到,当朱棣将这项工作交给解缙时,他是把希望和重担一起赋予了这个年仅三十四岁的年轻人,可是让人啼笑皆非的是,在朱棣看来无比重要的事情,在解缙那里却成了一项“一般任务”。 + +解缙在这件事情上并没有表现出政治敏锐性,他天真地以为,这不过是皇帝一时的兴趣,想编本书玩一玩,于是在永乐二年(1404)十一月,他就向皇帝呈送了初稿,名《文献大成》。应该说这套初稿也是花费了解缙很多心血的,但他没有想到,自己的这番心血换来的是朱棣的一顿痛骂。 + +解缙如此之快地完成任务,倒是让朱棣十分高兴,可当他看到解缙送上来的书时,才明白这位书呆子根本就没有领会领导的意图。于是他狠狠地斥责了解缙一顿,然后摆出了大阵势。 + +这个阵势实在是大,完全体现了明朝当时的综合国力,首先,朱棣派了五个翰林学士担任总裁(不是今天我们说的总裁),此五人以王景为首,都是饱学之士。并另派二十名翰林院官员为副总裁,这二十个人也都是著名的学者。此外,朱棣还在全国范围内发起总动员令,召集所有学识渊博的人,不管你是老是少,是贫是富,瘸子跛子也没关系,脑袋能转得动,脚能走得动就行了,全部召集来做编撰,大概相当于我们今天的编辑。 + +这还没完,朱棣拿出了拼命的架势,一定要做到精益求精,他还在全国各个州县寻找有某种特定能力的人,但这种能力并不是学问,那么他到底找的是什么人呢? + +答案是:字写得好的人。 + +由于当时是修一部全书,所以要采集大量的书籍和资料,这些资料找来之后需要找人抄写,这也情有可原,因为当时并没有电脑排版技术,在编撰过程中只有找人用手来写。 + +既然是大明帝国编的书,自然要体面,书籍的字迹必须要漂亮清晰,如果要找一个类似我这样字迹潦草,每天只会在电脑面前打字的人去抄书,别说朱棣看不惯,我自己都会觉得丢人啊。那年头啊,你要是写得一手烂字,你都不好意思和人打招呼。 + +这是名副其实的文化总动员,可以说朱棣是集中了全国的精英知识分子来做这件事情。之前我们曾经提到过,修书也能充分体现国家的经济实力,这是因为你要召集这么多的知识分子来为你修书,你就得在招聘广告上写明:包食宿,按月发工资。千万不要以为知识分子读书人就会心甘情愿的干义务劳动,人家也有老婆孩子。 + +朱棣是一个做事干脆的人,他雷厉风行的解决了问题,他将编撰的总部设在了文渊阁,并给这些编书的人安排了住处,要吃饭时自然有光禄寺的人来送饭,编书的人啥也不用管,编好你的书就行了。 + +看了我们以上的介绍,大家应该清楚了,没有钱,没有很多的钱,这书能修成吗? + +贫穷的王朝整日只能疲于奔命,一点国库收入拿来吃饭就不错了,哪里还有闲钱去修书? + + + + + +盛世修书 + + +盛世修书,实非虚言 + +除了以上所说的这些人外,朱棣还给解缙派去了一个帮手,和他共同主编此书。这个人说是帮手,实际上应该是监工,因为在此之前,他只做过一次二把手,不巧的是,一把手正是朱棣。 + +这个监工就是姚广孝。 + +姚广孝不但精于权谋,还十分有才学,明朝初年第一学者宋濂也十分欣赏他的才华,而那个时候,解缙还在穿开裆裤呢。 + +把这样的一个重量级人物放在解缙身边,朱棣的决心可想而知。 + +当朱棣以排山倒海之势摆出这样一幅豪华阵容时,解缙才终于明白,自己将要完成的是一件多么宏大、光荣的事情。如果不能完成或是完成不好,那就不仅仅是丢官的问题了。 + +啥也别说了,开始玩命干吧! + +在经过领导批示后,解缙同志终于端正了态度,沿着领导指示的方向前进,事实证明,朱棣确实没有看错人。解缙充分发挥了他的才学,他合理的安排者各项工作, 采购、辨析、编写、校对都有条不紊的进行着,每次编写完一部分,他都要亲自审阅,并提出修改意见。作为这支庞大知识分子队伍中的佼佼者,他做得很出色。 + +当这上千人的编撰队伍在他的手中有序运转,所修大典不断接近完成和完善时,解缙终于实现了自己的人生价值和梦想,他不再是怀才不遇的书生,而是国家的栋梁。 + +在修撰大典的过程中,朱棣还不断地给予帮助和关照,永乐四年(1406)四月,朱棣在百忙之中专门抽出时间探望了日夜战斗在工作岗位上的各位修撰人员,并亲切地询问解缙在工作和生活中有何困难,解缙感谢领导的关心,并表示一定再接再厉,把工作做好,以报答皇帝陛下的恩情,不辜负全国知识分子的期望。最后他提出,大典经史部分已经差不多完成了,但子集部分还有很多缺憾。 + +朱棣当即表示,哪里有困难,就来找我,一定能够解决,不就是缺书吗,给你钱,去买,要多少给多少!之后他立刻责成有关部门(礼部)派人出去买书。 + +有了这样的政治支持和经济支持,再加上解缙的得力指挥和安排,无数勤勤恳恳的知识分子日夜不休的工作着,他们在无数个灯火通明的夜晚笔耕不辍,舍弃了自己的家庭和娱乐,付出了健康甚至生命的代价(其中有不少人因为劳累过度而死),只为了完成这部古往今来最为伟大的著作。 + +他们中间的很多人可能并没有什么伟大的理想,因为大部分人只是平凡的抄写员,编撰人,在当时,他们也都只是普通的读书人而已。他们的人生似乎和伟大这两个字扯不上任何关系,但他们所做的却是一件伟大的事。历史不会留下他们的名字,但这部伟大著作的每一页、每一行都流淌着他们的心血。 + +所以不管是累得吐血的编撰,还是整日埋头抄书的书者,他们都是英雄,当之无愧的英雄。 + + + + + +每一个人都是 + + +每一个人都是 + +在这些人的不懈努力下,永乐五年(1407)十一月,这部大典终于完成。 + +此书收录上自先秦,下迄明初各种书籍七、八千余种,共计一万一千零九十五册,二万二千八百七十七卷,三亿七千万字。 + +全部由人手一个字一个字地抄写而成 + +它的内容包括经史子集、天文、地理、阴阳、医术、占卜、释藏、道经、戏剧、工艺、农艺,涵盖了中华民族数千年来的知识财富,它绝不仅仅是一部书,而是一座中华文明史上的金字塔。 + +更为难得的是,以解缙为首的明代知识分子们以广博的胸怀和兼容并包的思想,采集了几乎所有珍贵的文化资料,为我们留下了一笔巨大的财富。 + +朱棣的梦想终于实现了,他郑重的为这部伟大的巨作命名——《永乐大典》 + +现在,我终于可以说,在我的统治下,编成了一部有史以来最大、最全、最完美的书!终有一天,我会老去,但这部书的光荣将永远光耀着后代的人们,告诉他们我们这个时代的辉煌! + +光荣!但这绝不仅仅是朱棣的光荣,这是属于我们这个国家,这个民族的光荣!我们经历了数千年的风风雨雨,曾经光耀四方,强盛一时,也曾曲膝受辱,几经危亡。但我们最终没有屈服,我们的文明传承了下来,并引领着我们顽强的站立起来。 + +永乐大典的伟大之处正在于此,它绝不仅仅是一部书,而是一种精神,文化传承、自强不息的精神。 + +我们要感谢这部书,因为如果没有它的诞生,很多古代书籍,今天的我们将永远也看不到了。 + +如果要给这些书开个书单,恐怕会很长,在此我们只列举其中一些书目,让大家了解此书的重要意义,如《旧唐书》、《旧五代史》、《宋会要辑编》、《续资治通鉴长编》等书,后全部失传,直到清代时,方才从永乐大典中辑录出来,流传于世上。 + +所以我们说,永乐大典是中国文化史上的一座金字塔。 + +在这场建筑中国文化金字塔的工程中,解缙是一个出色的总工程师和设计师。他的功劳其实并不亚于征伐开疆的徐达、蓝玉。他虽然没有万军之中攻城拔寨的豪迈,也没有大漠挥刀、金戈铁马的风光,但他也有自己的武器,他的武器就是他的笔墨。正是在他的带领下,无数辛勤的知识分子用笔墨为我们留下了祖先的智慧和知识,让我们了解了那光荣的过往和先人的伟大。 + +事实证明,那些常常被我们嘲笑的手无缚鸡之力的书生和读书人,他们也有力量,他们也很强壮,他们同样值得我们尊重。 + +谁言书生无用,笔下亦显英雄! + + + + + +投 机 + + +投机 + +永乐大典是解缙一生的最辉煌的成就,也是他一生最高点,然而在此书完结时,那些欢欣雀跃的人中却没有解缙的身影,因为此时,他已经从人生的高峰跌落下来,被贬到了当时人迹罕至的广西。为什么才高八斗、功勋卓著的解缙会落到如此境地呢?谁又该对此负责呢? + +其实解缙落到这步田地完全可以用一个词来形容——咎由自取。 + +因为他做了一件自己并不擅长的事情——投机。 + +要说到投机,解缙并不是生手,我们之前介绍过他拒绝了建文帝方面低微的官职的诱惑,排除万难毅然奔赴朱棣身边的光辉事迹,当然,他的这一举动是有着充分理由的。因为朱棣需要他,而他也需要朱棣。解缙有名气和才能,朱棣有权和钱,互相利用而已。 + +读书种子方孝孺已经被杀掉了,为了证明天下的读书人并非都是硬骨头,为了证明这个世界上还是有人愿意和新皇帝合作,朱棣自然把主动投靠的解缙当成宝贝。他不但任命解缙为永乐大典和第二版太祖实录的总编,还在政治上对他委以重任,在明朝的首任内阁中给他留了一个重要的位置。此任内阁总共七人,个个都是精英,后来为明朝“仁宣盛世”做出巨大贡献的“三杨”中的两杨都在此内阁中担任要职。 + +除此之外,朱棣还经常在下班(散朝)之后单独找解缙谈话,用今天的话来说,这叫“重点培养”,朱棣不止一次的大臣们面前说:“得到解缙,真是上天垂怜于我啊!” + +解缙以政治上的正直直言出名,却因政治投机得益,这真是一种讽刺。 + +解缙终于满足了,他似乎意识到,自己多年来没有成功,只是因为当年政治上的幼稚,为什么一定要说那么多违背皇帝意志的话呢,那不是难为自己吗? + +而这次政治投机的成功也让他认定,今后不要再关心那些与己无关的事情,只有积极投身政治,看准政治方向,并放下自己的政治筹码,才能保证自己的权力和地位。 + +于是,当年的那个一心为民请命、为国效力的单纯的读书人死去了,取而代之的是一个跃跃欲试、胸有城府的政客。 + +也许在很多人看来,这也并没有什么大惊小怪的,只不过是一个人对自己人生的选择罢了,但问题在于,解缙在作出这个选择的时候忘记了一个重要而简单的原则,而正是这个简单的原则断送了他的一生。 + +这条原则就是:不要做你不擅长的事。 + +在我们小的时候,经常会有很多梦想,长大之后要干这个、干那个,现在的小孩想干什么职业我不知道,但在我的那个年代,科学家绝对是第一选择。我当年也曾经憧憬过自己拿着试剂瓶在实验室里不停的摇晃,摇什么并不重要,只是那种感觉实在是太好了。 + +但在长大之后,那些梦想的少年们却并没有真的成为科学家,至少大多数没有。因为在他们的成长过程中,无数的人、无数的事都明确无误的告诉他:“别做梦了,你不是这块料!” + +这句话倒不一定是打击,在很多情况下,它是真诚的劝诫。 + +上天是很公平的,它会把不同的天赋赋予不同的人,有人擅长这些,有人擅长那些,这才构成了我们这个多姿多彩的世界。综合解缙的一生来看,他所擅长的是做学问,而不是搞政治。 + +可是这位本该埋头做学问的人从政治投机中尝到甜头,在长期的政治斗争中积累了一定的经验,便天真地认为自己已经成为了政治高手,从此他义无反顾地投入到了政治斗争的漩涡之中。 + +很不幸的是,他跳入的还不是一般的漩涡,而是关系到帝国根本的最大漩涡——继承人问题。 + +战争年代,武将造反频繁,原因无它,权位而已,要获得权位,最好的办法是自己当皇帝,但这一方法难度太大(参见朱元璋同志发展史),于是很多武将退而求其次,只要能够拥立一个新的皇帝,自己将来就是开国功臣,新老板自然不会忘记穷兄弟,多少是要给点好处的,虽然这行也有风险,比如你遇上的老板不姓赵而是姓朱,那就完蛋了。但和可能的收益比起来,收益还是大于成本的。 + +和平年代就不能这么干了,造反的成本太大,而且十分不容易成功(可参考朱棣同志的生平经历),但一步登天、青云直上是每一个人都梦想的事。于是诸位大臣们退而求其次,寻找将来皇位的继承者。因为皇帝总有一天是要死掉的,如果在他死掉之前成为继承人的心腹,将来必能被委以重任。但这一行也有风险,因为考虑到皇帝的特殊身份和兴趣爱好,以及我国长期以来男女不平等的状况,在很多情况下,皇帝的儿子数量皆为N(N大于等于2)。而如果你遇到一个精力旺盛的皇帝(比如康熙),那就麻烦了。 + +所以说?立继承人可实在不是开玩笑的事情,可以比作一场赌博,万一你押错了宝,下错了筹码,新君并非你所拥立的那位,那就等着倒霉吧,覆巢之下,岂有完卵?你的主子都完蛋了,你还能有出头之日吗? + +可是解缙决心赌一把,应该说他是一个有远见的人,虽然朱棣现在信任他,但朱棣会老,会死,要想长久保住自己的位置,就必须早作打算,解缙经过长期观察,终于选定了自己的目标。 + +永乐二年(1404),他在一位皇子的名下押下了自己所有的筹码——朱高炽。 + +关于朱高炽和朱高煦的权位之争,我们后面还要专门介绍,这里只说与解缙有关的一些事情。 + +其实这二位殿下的矛盾从靖难之时起就已经存在了,大臣们心中都有数,朱棣心里也明白。其实就其本心而言,确实是想传位给朱高煦的,因为朱高煦立有大功,而且长得比较帅。而朱高炽却是个残疾,眼睛还有点问题,要当国家领导人,形象上确实差点。 + +但是朱高炽是长子,立长也算是长期以来的传统,所以朱棣一直犹豫不定,于是他便去征求靖难功臣们的意见。不出所料,大部分参加过靖难的人都推荐朱高煦,这也可以理解,毕竟在一条战线上打过仗,有个战友的名头将来好办事。 + + + + + +有一个人反对 + + +有一个人反对 + +这个人叫金忠,时任兵部尚书,和那些支持朱高煦的公侯勋贵们比起来,他这个二品官实在算不得什么。然而让人想不到的是,正是这个人影响了最后的结果。 + +这倒不是因为他本人的能力,而是因为在他的身后,有一个巨大的身影在支持着他。而这个身影就是那位不见踪影却又似乎无处不在的姚广孝。 + +如果我们翻开金忠的履历,就会发现他和姚广孝有着纠缠不清的关系,正是姚广孝向朱棣推荐了他,而此人的主要能力和姚广孝如出一辙,都是占卜、谋划、机断这些玩意。很多人甚至怀疑,他就是姚广孝的学生。 + +此人一反常态,面对无数人的攻击始终不改变自己的意见,并向朱棣建议,如果拿不定主意,不如去问当朝的大臣。 + +这真是高明之极,当朝和皇帝最亲近的大臣还有谁呢,不就是那七个人吗,而他们大都是读书人,立长的正统观念十分强烈,且这些人也很有可能已经和姚广孝搭上了关系,后来的事情发展也证实了,正是金忠的这一建议,使得原先一边倒的局面发生了根本性的变化。 + +我们实在有理由怀疑,这一切的幕后策划者就是那位表面上看起来不问世事的姚广孝,我们也不得不佩服这位“黑衣宰相”,他总是在关键时刻、关键问题上插入一脚。是十足的不安定因素,哪里有他出没,哪里就不太平。十处敲锣,九处有他,他活在这个时代,真可以说是生逢其时。 + +下面就轮到我们的解缙先生出场了,他正是被询问的对象之一,在这次历史上著名的谈话中,他展现了自己的智慧,证明了他明代第一才子的评价并非虚妄,而事实证明,也正是他的那一番话(确切地说是三个字)奠定了大局。 + + + + + +双方开门见山 + + +双方开门见山 + +朱棣问:“你认为该立谁?” + +解缙答:“世子(指朱高炽)仁厚,应该立为太子。” + +朱棣不说话了,但解缙明白,这是一种否定的表示,他并没有慌乱,因为他还有杀手锏,只要把下一个理由说出来,大位非朱高炽莫属! + +解缙再拜道:“好圣孙!” + +朱棣笑了,解缙也笑了,事情就此定局。 + +所谓好圣孙是指朱高炽的儿子朱瞻基(后来的明宣宗),此人天生聪慧,深得朱棣喜爱,解缙抓住了最关键的地方,为朱高炽立下了汗马功劳。 + +这是一次载入史册的谈话,在这次谈话中,解缙充分发挥了他扎实的才学和心理学知识,在这件帝国第一大事上做出了巨大的贡献,当然这一贡献是相对于朱高炽而言的。 + +朱高炽了解此事后十分感激解缙,他跛着脚来到解缙的住处,亲自向他道谢。 + +朱高炽放心了,解缙也放心了,一个放心皇位在手,一个放心权位不变。 + +然而事实证明,他们都太乐观了。朱高炽的事情我们后面再讲,这里先讲解缙,解缙的问题在于他根本不明白,所谓的大局已定是相对而言的,只要朱棣一天不死,朱高炽就只能作他的太子,而太子不过是皇位的继承人,并不是所有者,也无法保证解缙的地位和安全。 + +更为严重的是,解缙拥护朱高炽的行为已经使他成为了朱高煦的眼中钉肉中刺。而解缙并不清楚:朱高煦就算解决不了朱高炽,解决一个小小的解缙还是绰绰有余的。 + +然而解缙还沉浸在成功的喜悦中,他太自大了,他似乎认为自己搞权谋手段的能力并不亚于做学问。但他错了,他的那两下子在政治老手面前简直就是小孩子把戏。一场灾难即将向解缙袭来。 + + + + + +来得还真快 + + +来得还真快 + +永乐二年(1404)朱棣立朱高炽为太子后,事情并没有像解缙所预料的那样进行下去,他也远远低估了朱高煦的政治力量。事实上,随着朱高煦政治力量的不断发展,他的地位和势力甚至已经超过了太子一党。而且他的行为也日渐猖獗,所用的礼仪已经可以赶得上太子了。 + +此时,解缙做出了他人生中最为错误的一个决定,他去向朱棣打了小报告,报告的内容是,应该立刻制止朱高煦的越礼行为,否则会引起更大的争议。 + +真是笑话,朱高煦用什么礼仪自然有人管,你解缙不姓朱,也不是朱棣的什么亲戚,管得着么?此时的解缙脑海中都是那些朱棣对他的正面评价,如我一天也离不开解缙,解缙是上天赐给我的之类肉麻的话。在他看来,朱棣是对他是言听计从的。 + +然而这次朱棣只是冷冷的告诉他:知道了。 + +解缙太天真了,他不知道朱棣从根本上讲是一个政治家,政治家说话是不能信的,你对他有用时或他有求于你时,他会对你百依百顺,恨不得叫你爷爷。但事情办完后,你就会立刻恢复孙子的身份。很明显,解缙搞错了辈分。 + +朱棣给了解缙几分颜色,解缙就准备开染坊了,还忘了向朱棣要经营许可证。 + +这件事情发生后,解缙就在朱棣的心中被戴上了一顶帽子——干涉家庭内政。你解缙是什么东西?第一家庭的内部事务什么时候轮到你来管? + +此后解缙的地位一落千丈,渐渐失去了朱棣的信任,加上他反对朱棣出兵讨伐安南(今越南,后面我们会详细介绍此事),使得朱棣更加讨厌他。于是,这位当年的第一宠臣,永乐大典、太祖实录的主编在朱棣的眼中变成了一个多余的人,他做的每一件事都得不到朱棣的赞许,取而代之的是不断的斥责和批评。 + +朱棣讨厌他,不希望再看到这个人,只想让他走远一点,越远越好。但他并没有急于动手,因为他还需要解缙为他做一件大事。 + +这件大事就是永乐大典的编纂工作,如果此时把解缙赶走,大典的完成必然会受到影响,想到这里,朱棣把一口恶气暂时压在了肚子里。 + +可叹的是,解缙对此一无所知,他还沉浸在天子第一宠臣的美梦中,仍旧我行我素。朱棣终于无法继续忍耐了,解缙实在过于嚣张、不知进退了,于是,在永乐五年(1407)二月,忍无可忍的朱棣终于把还在编书的解缙赶出了朝廷,远远的打发到了广西当参议。 + +这对于解缙来说是一个晴天霹雳,好端端的书不能编了,翰林学士、内阁成员也干不成了,居然要打起背包去落后地区搞扶贫(当时广西比较荒凉),第一大臣的美梦只做了四年多,就要破灭了吗? + +解缙并没有抗旨(也不敢),老老实实的去了广西,此时的解缙心中充满了茫然和失落,但他没有绝望,因为类似的情况他之前已经遇到过一次,他相信机会还会来临的,上天是不会抛弃他的。 + +毕竟自己还只有三十六岁,朝廷还会起用我的。 + +然而他等了四年,等到的只是到化州督饷的工作,督饷就督饷吧,平平安安过日子不就得了,可解缙偏偏就要搞出点事来,这一搞就把自己给搞到牢里去了。 + +事情是这样的,永乐九年(1411),解缙获得了一个难得的机会,进京汇报督饷情况,一个偏远地区的官员能够捞到这么个进城的机会是很不容易的,按说四处逛逛、买点土特产,回去后吹吹牛也就是了,能闹出什么事情呢? + +可是大家不要忘了,解缙同志不一样,他是从城里出来的,见过大场面,此刻重新见识京城的繁华,引起了他的无限遐思,就开始忘乎所以了。偏巧朱棣此刻正带着五十万人在蒙古出差未归(远征鞑靼),解缙没事干,加上他还存有东山再起的幻想,便在没有请示的情况下,私自去见了太子朱高炽。 + +真是糊涂啊,朱高炽家是什么地方?能够随便去的么? + +解缙的荒唐行为还不止于此,他私自拜见太子之后,居然不等朱棣回来,也不报告,就这么走了!解缙真是晕了头啊。 + +果然,等到朱棣回来后,朱高煦立刻向朱棣报告了此事,朱棣大为震惊,认定解缙有结交太子,图谋不轨的形迹,便下令逮捕解缙,就这样,一代大才子解缙偷鸡不着蚀把米,官也做不成了,变成了监狱里的一名囚犯。 + +至此,解缙终于断绝了所有希望,皇帝不信任他,太子帮不了他,这下是彻底完了。 + +回望自己的一生,少年得志,意气风发,虽经历坎坷,却能够转危为安,更上一层楼,百官推崇,万人敬仰。那是何等的风光,何等的得意! + +可是现在呢,除了整日不见光的黑牢、脚上的镣铐和牢房?那令人窒息的恶臭,自己已经一无所有。输了,彻底输了,愿赌就要服输。 + +解缙想不通的是,为什么最终会失败?自己并不缺乏政治斗争的权谋手段,却落得这个下场,他百思不得其解。 + +其实在解缙之前和之后,有无数与他类似的人都问过这个问题。但他们都没有找到答案,我们也只能说,解缙是在错误的时间、错误的地点,参加了一场错误的赌局。从才子到囚徒,怪谁呢?只能怪他自己。 + + + + + +终 点 + + +终点 + +如果事情就这样结束,解缙也许会作为一个囚徒走完自己的一生,或者在某一次大赦中出狱,当一个老百姓,找一份教书先生的工作糊口,但上天注定要让他的一生有一个悲剧的结局,以吸引后来的人们更多的目光。 + +永乐十三年(1315),锦衣卫纪纲向朱棣上报囚犯名单,朱棣在翻看时找到了解缙的名字,于是他说出了一句水平很高的话:“解缙还在吗?”(缙犹在耶) + +缙犹在耶?这句话的意思很明显,就是问纪纲为什么这个人还活着,但同时这句话的另一层意思就是——他不应该还活着。 + +朱棣是擅长暗语的高手,在此之前的永乐七年(1409),他说过一句类似的话,而那句话的对象是平安。 + +事情的经过十分类似,朱棣在翻看官员名录时看到了平安的名字,便说了一句:“平安还在吗?”(平保儿尚在耶) + +平安是一个很自觉的人,听到朱棣的话后便自杀了。 + +平安是可怜的,解缙比他更可怜,因为他连自杀的权利都没有。 + +长年干特务工作的纪纲对这种暗语是非常精通的,加上他一直以来就和解缙有矛盾,于是便有了开头的那一幕。 + +解缙就在雪地里结束了自己的一生,洁白的大雪掩盖了解缙的尸体和他那不再洁白的心,当年那个正义直言的解缙大概也想不到自己会有这样的结局。 + +无论如何,解缙的一生是有意义的,因为不管他做了什么事情,是错还是对,都无法掩盖他的功绩,由他主编的永乐大典一直保留至今,为我们留下了大量的知识财富,当我们看到那些宝贵典籍时,我们应该记得,有一个叫解缙的人曾为此费尽心力,仅凭这一点,他就足以为赢得我们后世之人的尊重。 + + + + + +帝王的抉择 + + +第三章 帝王的抉择 + +朱棣所做的另一件影响深远的事情就是迁都,而迁都这种事情无论在哪个朝代都是一件大事。朱棣的这次迁都无疑是对后世影响最大的一次。今天的北京拥有上千万人口,无数的高楼大厦,是我们国家的首都,也是世界上最繁华的城市之一,而这一切的起点就源自于朱棣的一个决定。 + +永乐元年(1403)三月,蒙古军队进攻辽东,大肆抢掠了一通,当地的都指挥沈永是个无能之辈,即无法抵御,又不及时向领导汇报,朱棣听说此事,大为恼火,立刻杀掉了沈永,并召集大臣,询问北方军事形势恶化的原因。 + +朱棣质问他的大臣们,北方防御如此之弱,蒙古军队竟然如入无人之境,这样下去怎么得了,谁该为此负责? + +然而出乎朱棣意料的是,大臣们虽然个个都不开口,却并不胆怯,反而直愣愣的看着他。朱棣心头一阵无名火起,正准备发作,突然心念一转,把话又缩了回去。 + +为什么呢? + +因为他终于明白这些大臣们为什么一直盯着他了,该为此事负责的人正是他自己! + +在明朝的防御体系中,负责北方防御的主要就是燕王朱棣和宁王朱权,可是在靖难之战中,朱权被他绑票,他也跑到了南京作了皇帝,北方边界少了他们两个人,基本上就属于不设防地段了,怎么怪得了别人呢? + +南京是一个很不错的地方,也很适宜建都,因为这里地势险要,风水好,外加是主要粮食产地,由于当时中国的经济中心已经南移,建都于此是很有利于维持明朝统治的。 + +但问题在于,明帝国的住宿地并不是独门独院,在帝国的北方有着几个并不友好的邻居,这些邻居经常不经主人允许就擅自进屋拿走自己喜欢的东西,还从来不写欠条。一次两次也就罢了,长此下去怎么得了? + +出兵讨伐也没有什么效果,因为这些邻居基本上都是游击队编制,使用的是你进我退,你退我再来的政策,他们自己属于游牧民族,又不种地,每天的工作也就是骑马跑来跑去,闲着也是闲着,不抢你抢谁? + +讨伐不行,不管更不行,这真是个难题啊。 + +军事政治形势固然是后来迁都的主要原因,但还有一些原因也是不可忽视的,这就是朱棣本人的特点。 + +难道朱棣个人与迁都也有关系吗? + +答案是肯定的,如果你还记得,我们之前曾经提过朱棣虽然是在南京出生,是南京户口,但他21岁就去了北平,并在那里生活了二十年,虽然并没有转户口(当年进北平不难),但他的生活习惯已经完全北方化了。 + +据史料记载,朱棣偏好北方饮食,而且十分喜欢朝鲜泡菜,当时的朝鲜国王李芳远曾派出朝鲜厨师(火者)侍奉朱棣,而他也欣然接受,想来喜好北方口味的朱棣对南方菜不会太感兴趣。北方虽然多风沙,远远不如南方的秀美山水,但朱棣一直以来就在这样的环境下生活,对他而言,熟悉的才是最好的。 + +当然了,朱棣迁都的主要原因还是政治需要,既然下定了主意,那就迁吧。 + +且慢!这可不是说迁就能迁的,迁都不是搬家,绝对不是打好包袱,打个电话叫搬家公司来就行的。最大的难题在于,朱棣并不是一个人搬去北平,如果是这样,那倒是省事了。 + +迁都不但要迁走朱棣,还要迁走他的大小老婆若干人,王公大臣若干人,士兵百姓若干人,这些人也要找地方住,也要修房子。北平打了很多年的仗,街道、宫殿都要重修,城市布局也要重新安排。而且跟他去北平的都不是一般人,需要大笔的资金才能安置好这些人。其难度绝对不下于重新建都。 + +这些问题虽然难办,但毕竟还是可以解决的,摆在朱棣面前的还有一个更大的难题,如果这个难题不解决,迁都就等于白迁。 + +我们知道,朱棣迁都的主要原因是为控制北方边界,保证国家安全。按说迁都就能解决这一问题,但诸位想过没有,还有一样东西是必须的。 + +那就是粮食。 + +北平附近不是产粮区,而迁都必然会有很多人口涌入(中国人向来有往大城市跑的习惯),这些人要消耗大量的粮食,而且要控制边界,就必须养着大批士兵,虽然明朝实现了军屯(军人平时种地,战时打仗),能够解决部分军队的粮食问题,但京城的精锐部队(如三大营)是不种地的,这么多人吃什么,总不能喝西北风吧。 + +更严重的问题在于,仅仅保证北平士兵百姓的粮食还不够,因为明朝政府将来可能会经常出去慰问一下那些不太友好的邻居,给他们一点小小的教训,所谓兵马未动,粮草先行,派十万人去打仗,你就要准备十万人的粮食,而北平附近的粮食产量是绝对不足以保障这些行动的。 + +可能有人会说,这算什么难题,从南方产粮区运输粮食到北方不就行了? + +如果你这样想,那就恭喜你了,你终于找到了这个问题的难点所在。 + +粮食问题之所以成为迁都的最大障碍,难就难在运输上,在那个年代,既没有火车汽车,也没有飞机,要运送粮食只能靠人力,今天我们搭乘现代化交通工具从南京到北京也要花费不少时间,而当年的人们走一趟要花一个多月,而且大家可不要忽略一个问题,那就是运输粮食的人也是要吃饭的。无论他们多么尽忠职守,你也应该有一个清醒地认识:他们在吃光自己所运的粮食之前,是绝对不会饿死的。 + +所以如果你找人从陆路上运输粮食,你就必须额外准备运输者的口粮,让他推两辆粮车上路,运一辆,吃一辆,等到了目的地,交出还没有吃完的那部分,就算交差了。而你额外准备的那部分口粮可能比他运过去的粮食还要多。 + +如果有哪个政府愿意长期用这种方式来运输物资,那么等待这个政府的命运只有一个——破产。 + +所以,明朝政府剩下的唯一选择就是——河运(又称漕运)。 + +是啊,问题似乎已经解决了,答案很简单嘛,用船来运输粮食不就能又快又多的完成运输任务吗?那你干嘛还要兜那么大的圈子呢? + +我可以保证,绝对没有戏弄大家的意思,关于这个问题,我可以用两个字来回答: + + + + + +不 通 + + +不通 + +在当时,从南方主要产粮区到北方的河道是不通畅的,运河栓塞,河流改道给当时的河运带了了极大的不便,除非明代的船只是水陆两用型,否则想一路顺风是绝对不可能的。明太祖朱元璋就在这上面吃过大亏,想当年他老人家打仗的时候,需要从南方向辽东、北平一带调集军粮,但河运不通,无奈之下,只好取道海路,经渤海运输,绕远路不说,还因为风浪太大,很不安全,十斤军粮能送到一半已经是谢天谢地了 + +可是修整河道决不是一件可以随便提出的事情,大家应该还记得,元朝灭亡的导火线就是治理河道。水利工程无论在哪个年代都绝对是国家重点投入的项目。需要大笔的金钱和众多的劳力。而且万一花钱太多,动摇了国家根本,问题可就严重了(隋炀帝的京杭大运河就是例子),所以这件事情和修书一样,不是强国盛世你连想都不要想。 + +朱棣的时代就是盛世。 + +经过洪武年间的长期恢复,加上朱棣正确的治国方略,当时的明朝已经有了足够的经济实力去完成以前无法想象的事情。永乐大典也修出来了,搞点水利自然不在话下。 + +永乐九年(1411),朱棣命令工部尚书宋礼治理会通河,以保证河道的畅通,宋礼是一个很有能力的水利专家,他完成了任务,此后漕运总督陈瑄进一步疏通了河道,从此南北漕运畅通无阻,所谓“南极江口,北尽大通桥,运道三千余里”,粮食问题最终得到了解决。 + +而迁都的其他工作也一直在紧张地进行之中,中央各部门的办公单位早在永乐七年(1409)就已经修好,而京城的建设工作于永乐十五年开始,一直进行了三十余年才结束。 + +眼见机会成熟,朱棣于永乐十九年(1431)正式下令:迁都! + +原先的京师改名为南京,北京作为明帝国新的都城被确定下来,从此北京这个城市正式成为了明朝首都,并一直延续了二百余年,但它的历史却并未随着明朝的灭亡而结束,相反,它一直富有生气的存在和发展着,并最终成为世界上最有影响力的城市之一。 + +当今天的我们徜徉在北京这个现代化都市,看着高楼林立、车水马龙的繁华景象时,不应该忘记,正是五百多年前的一个叫朱棣的人奠定了这一切的基础。 + +要说明的是,朱棣在建设北京时,是有着相当的现代意识的,他十分注意城市的整体规划,分别修建了数条主线和支线,把北京市区规划成形状整齐的方块,并制定了严厉的规定,禁止乱搭乱盖,还铺设了完整的下水道系统。 + +而现在我们看到的故宫和天坛等北京著名建筑,都是朱棣时代打下的基础(此后清朝曾经整修过)。特别值得一提的是故宫,它占地十七万平方米,征用无数劳力,用了二十年完成,它原先只是供皇帝居住的地方,老百姓绝对与之无缘,也没有买票参观这一说,但这并不能影响它在历史上的地位。现在故宫已作为中华民族的历史瑰宝成为我们每个中国人的骄傲。 + +无可否认,这正是朱棣的功绩,不能也无法抹煞 + +值得一提的是,当年的迁都决不是一帆风顺,众人响应的,实际上,根本没有几个人赞成朱棣的这一决策。 + +原因很简单,除了朱棣靖难带过来的那些人之外,朝廷大部分大臣都是长期在南方生活的,老婆孩子都在南京,狐朋狗友、社会关系也都在这里,谁愿意跟着朱棣去北方吹风? + +恰好在迁都后不久,皇宫发生火灾,而且全国很多地方都出现自然灾害,当时人们称为“天灾”,大臣们自然而然的就把这些事情归结为——都是迁都惹的祸。 + +朱棣为人虽然够狠够绝,但毕竟自然科学理论知识修养不足,他也有点慌乱,便向群臣征求意见,以便弥补过失。 + +但他没有想到的是,大臣们却借此机会对他发起了猛烈的攻击。 + +许多大臣上书,陈说迁都的害处,并表示之所以有天灾,就是因为迁都造成的。其中主事箫仪的言辞最为激烈,史料记载“仪言之尤峻”,至于他到底说了些什么并未列出,但估计是骂了朱棣,大家知道,朱棣从来就不是个忍气吞声的人,他的回应也很干脆,直接就把箫仪杀掉了。 + +这下可捅了马蜂窝,要知道读书人可不是好惹的,自幼聆听圣贤之言,以天子门生自居,皇帝又怎么样?怕你不成? + +于是众多大臣纷纷上书,言论如潮,还在午门外集会公开辩论,说是辩论会,但会上意见完全是一边倒,其实就是针对朱棣的集会,如果换个一般的皇帝,看到如此多的手下反对自己,很可能会动摇,但朱棣不是一般的皇帝,他坚持了自己的看法,坚定了迁都的决心。 + +“你们都不要再说了,迁都是我做的决定,一定要迁,我说了算,就这么办了!” + +朱棣这样做是需要勇气的,他在反对者占多数的情况下,还敢于坚持观点,毫不退让,事实上,很多大臣提出的意见也是很中肯的,如迁都劳民伤财,引发贪污腐败等,都是客观存在的事实。但历史将会证明,朱棣的选择是正确的。 + +在历史上,经常会出现一些十分有水平的人物,他们能够在形势尚不明朗之前预见到事物将来的发展,如诸葛亮在破草房里就能琢磨出天下将来会三分等,但诸葛亮的这种琢磨是不需要成本的,即使他琢磨得不对,也没有人去找他麻烦。 + +容易出麻烦的是抉择,也就是说,必须牺牲某些眼前的利益去换来将来更长远的利益。这种抉择往往是极为痛苦的,因为眼前利益是大家都能看到的,长远的利益却是看不到的,就好比你让大家丢下手中已有的钞票,跟着你去挖金矿,金矿固然诱人,但是否真有却着实要画个大问号,你说有就有?凭什么? + +一百多年后伟大的改革家张居正就是栽倒在这种抉择上的,因为那些大臣们宁可抱着手上的那点家当等死,也不肯跟他去走那条未知的道路。 + +朱棣就是这样一个很有水平的领导,也是一个敢于抉择的领导,他知道迁都是一项大工程,耗时耗力,但他准确地判断出,影响明帝国的长治久安的最大因素就是北方的蒙古,要想将来平平安安过日子,就必须舍弃眼前的利益,迁都北京。否则明朝将难逃南宋的厄运。 + +与张居正相比,朱棣有一个优势——他是皇帝,而且还是一个铁腕皇帝,一个敢背骂名我行我素的皇帝,所以他能够一直坚持自己的信念,所以他终于完成了迁都这项艰难的工作。 + +朱棣迁都的行为招致了当时众人的反对,很多人也断言此举必不可行,但十九年后站在北京城头遥望远方的于谦应该不会这样想。 + +历史才是事物发展最终的判断者,在不久之后,它将毫无疑问地告诉每一个人:朱棣的抉择是正确的。 + + + + + +郑和之后 + + +第四章 郑和之后,再无郑和 + +之前我们曾经介绍过,朱棣曾派出两路人去寻找建文帝,一路是胡荧(有三点水旁),他的事情我们已经讲过了,这位胡荧(有三点水旁)的生平很多人都不熟悉,这也不奇怪,因为他从事是秘密工作,大肆宣传是不好的。 + +但另一路人马的际遇却大不相同,不但闻名于当时,还名留青史,千古流芳。这就是鼎鼎大名的郑和舰队和他们七下西洋的壮举。 + +同样是执行秘密使命,境遇却如此不同,我们不禁要问:同样是人,差距怎么那么大呢? + +原因很多,如队伍规模、附带使命等等,但在我看来,能成就如此壮举,最大的功劳应当归于这支舰队的指挥者——伟大的郑和。 + +伟大这个词用在郑和身上是绝对不过分的,他不是皇室宗亲,也没有显赫的家世,但他以自己的努力和智慧成就了一段传奇——中国人的海上传奇,在郑和之前历史上有过无数的王侯将相,在他之后还会有很多,但郑和只有一个。 + +郑和之后,再无郑和——梁启超 + +下面就让我们来介绍这位伟大航海家波澜壮阔的一生。 + +郑和,洪武四年(1371)出生,原名马三保,云南人,自小聪明好学,更为难得的是,他从小就对航海有着浓厚的兴趣,按说在当时的中国,航海并不是什么热门学科,而且云南也不是出海之地,为什么郑和会喜欢航海呢? + +这是因为郑和是一名虔诚的伊斯兰教徒,他的祖父和父亲都信奉伊斯兰教,而所有的伊斯兰教徒心底都有着一个最大的愿望——去圣城麦加朝圣。 + +去麦加朝圣是全世界伊斯兰教徒的最大愿望,居住在麦加的教徒们是幸运的,因为他们可以时刻仰望圣地,但对于当时的郑和来说,这实在是一件极为不易的事情。麦加就在今天的沙特阿拉伯境内,有兴趣的朋友可以在地图上把麦加和云南连起来,再乘以比例尺,就知道有多远了。不过好在他的家庭经济条件并不差,他的祖父和父亲都曾经去过麦加,在郑和小时候,他的父亲经常对他讲述那朝圣途中破浪远航、跋山涉水的惊险经历和万里之外、异国他乡的奇人异事。这些都深深的影响了郑和。 + +也正是因此,幼年的郑和与他同龄的那些孩子并不一样,他没有坐在书桌前日复一日的背诵圣贤之言,以求将来图个功名,而是努力锻炼身体,学习与航海有关的知识,因为在他的心中,有着这样一个信念:有朝一日,必定乘风破浪,朝圣麦加。 + +如果他的一生就这么发展下去,也许在十余年后,他就能实现自己的愿望,完成一个平凡的伊斯兰教徒的夙愿,然后平凡地生活下去。 + +可是某些人注定是不会平凡地度过一生的,伟大的使命和事业似乎必定要由这些被上天选中的人去完成,即使有时是以十分残忍的方式。 + +洪武十四年(1381),傅友德、蓝玉奉朱元璋之命令,远征云南,明军势如破竹,仅用了半年时间就平定了云南全境,正是这次远征改变了郑和的命运。顺便提一句,在这次战役中,明军中的一名将领戚祥阵亡,他的牺牲为自己的家族换来了世袭武职,改变了自己家族的命运,从此他的子孙代代习武。这位戚祥只是个无名之辈,之所以这里要特意提到他,是因为他有一个十分争气的后代子孙——戚继光。 + +历史真是让人难以捉摸啊。 + +对于明朝政府和朱元璋来说,这不过是无数次远征中的一次,但对于郑和而言,这次远征是他人生的转折,痛苦而未知的转折。 + +战后,很多儿童成为了战俘,按说战俘就战俘吧,拉去干苦力也就是了,可当时对待儿童战俘有一个极为残忍的惯例——阉割。 + +这种惯例的目的不言而喻,也实在让人不忍多说,而年仅11岁的马三保正是这些不幸孩子中的一员。 + +我们不难想象当年马三保的痛苦,无数的梦想似乎都已经离他而去了,但历史已经无数次地告诉我们,悲剧的开端,往往也是荣耀的起点。 + +悲剧,还是荣耀,只取决于你,取决于你是否坚强。 + +从此,这个年仅十一岁的少年开始跟随明军征战四方,北方的风雪、大漠的黄沙,处处都留下了他的痕迹,以他的年龄,本应在家玩耍、嬉戏,却突然变成了战争中的一员,在那血流成河,尸横遍野的战场上飞奔。刀剑和长枪代替了木马和玩偶,在军营里,没有人会把他当孩子看,也不会有人去照顾和看护他,在战争中,谁也不能保证明天还能活下来,所以唯一可以照顾他的就是他自己。 + +可是一个十一岁的孩子怎么能照顾自己呢? + +我们无法想象当年的马三保吃过多少苦,受过多少累,多少次死里逃生,我们知道的?,悲惨的遭遇并没有磨灭他心中的希望和信念,他顽强地活了下来,并最后成为了伟大的郑和。 + +总结历史上的名人(如朱元璋等)的童年经历,我们可以断言:小时候多吃点苦头,实在不是一件坏事。 + +在度过五年颠沛流离的生活后,他遇到了一个影响他一生的人,这个人就是朱棣。 + +当时的朱棣还是燕王,他一眼就看中了这个沉默寡言却又目光坚毅的少年,并挑选他做了自己的贴身侍卫,从此马三保就跟随朱棣左右,成为了他的亲信。 + +金子到哪里都是会发光的,马三保是个注定要成就大事业的人,在之后的靖难之战中,他跟随朱棣出生入死,立下大功,我们之前介绍过,在郑村坝之战中,朱棣正是采用他的计策,连破李景隆七营,大败南军。 + +朱棣从此也重新认识了这个贴身侍卫,永乐元年(1403),朱棣登基后,立刻封马三保为内官监太监,这已经是内官的最高官职, 永乐二年(1404),朱棣又给予他更大的荣耀,赐姓"郑",之后,他便改名为郑和,这个名字注定要光耀史册。 + +要知道,皇帝赐姓是明代至高无上的荣耀,后来的郑成功被皇帝赐姓后,便将之作为自己一生中的最大光荣,他的手下也称呼他为“国姓爷”,可见朱棣对郑和的评价之高。 + +上天要你受苦,往往会回报更多给你,这也是屡见不鲜的,郑和受到了朱棣的重用,成为了朝廷中炙手可热的人物,作为朱棣的臣子,他已经得到了很多别人想都不敢想的荣耀,想来当年的郑和应该也知足了。 + +但命运似乎一定要让他成为传奇人物,要让他流芳千古。更大的使命和光荣将会降临到他的头上,更大的事业将等待他去开创。 + + + + + +出 航 + + +出航 + +朱棣安排郑和出海是有着深层次目的的,除了寻找建文帝外,郑和还肩负着威服四海,胸怀远人的使命,这大致也可以算是中国历史上的老传统,但凡强盛的朝代,必定会有这样的一些举动,如汉朝时候贯通东西的丝绸之路,唐朝时众多发展中国家及不发达国家留学生来到我国学习先进的科学文化技术,都是这一传统的表现。 + +中国强盛,万国景仰,这大概就是历来皇帝们最大的梦想吧,历史上的中国并没有太多的领土要求,这是因为我们一向都很自负,天朝上国,万物丰盛,何必去抢人家的破衣烂衫? + +但正如俗话所说,锋芒自有毕现之日,强盛于东方之中国的光辉是无法掩盖的,当它的先进和文明为世界所公认之时,威服四海的时刻自然也就到来了。 + +实话实说,在中国强盛之时,虽然也因其势力的扩大与外国发生过领土争端和战争(如唐与阿拉伯之战),也曾发动过对近邻国家的战争(如征高丽之战),但总体而言,中国的外交政策还是比较开明的,我们慷慨的给予外来者帮助,并将中华民族的先进科学文化成就传播到世界各地,四大发明就是最大的例证。 + +综合来看,我们可以用四个字来形容中国胸怀远人的传统和宗旨: + + + + + +以德服人 + + +以德服人 + +现在中国又成为了一个强盛的国家,经过长期的战乱和恢复,以及几位堪称劳动模范的皇帝的辛勤耕耘和工作,此时的华夏大地已经成为了真正的太平盛世,人民安居乐业,国家粮银充足,是该做点什么的时候了。 + +在我们这个庞大国家的四周到底还有些什么?这是每一个强盛的朝代都很感兴趣的一个问题,明帝国就是一个强盛的朝代,而明帝国四周的陆地区域已由汉唐盛世时的远征英雄们探明,相比而言,帝国那漫长的海岸线更容易引起人们的遐想,在宽阔大海的那一头有着怎样的世界呢? + +最先映入人们眼帘的就是西洋,需要说明的是西洋这个名词在明朝的意义与今日并不相同,当时的所谓西洋其实是现在的南洋,之前的朝代虽也曾派出船只远航过这些地区,但那只是比较单一的行动,并没有什么大的影响,海的那边到底有些什么,人们并不是十分清楚,而现在强大的明帝国的统治者朱棣是一个与众不同的人,他之所以被认为是历史上少有的英明君主,绝非由于仁慈或是和善,而是因为他做了很多历史上从来没有人做过的事情。 + +现在,朱棣将把一件历史上从来没有人做过的事情交给郑和来完成,这是光荣,也是重托。 + +无论从哪个角度来看,郑和都是最合适的人选,他不但具有丰富的航海知识,还久经战争考验,军事素养很高,性格坚毅顽强,最后,他要去的西洋各国中有很多都信奉伊斯兰教,而郑和自己就是一个虔诚的穆斯林。 + +按说这只是一次航海任务而已,何必要派郑和这样一个多样型人才去呢,然而事实证明,郑和此次远航要面对的,绝不仅仅是大海而已。 + +历史将记住这个日子,永乐三年六月十五日(1405年7月11日),郑和在福建五虎门起航,开始了中国历史上最伟大的远航征程,郑和站在船头,看着即将出发的庞大舰队和眼前的茫茫大海。 + +他明白自己此次航程所负的使命和职责,但他并不知道,此时此刻,他正在创造一段历史,将会被后人永远传颂的历史。 + +他的心中充满了兴奋,自幼年始向往的大海现在就在他的眼前,等待着他去征服!一段伟大的历程就要开始了! + +扬帆! + + + + + +无敌舰队 + + +无敌舰队 + +我们之前曾不断用舰队这个词语来称呼郑和的船队,似乎略显夸张,一支外交兼寻人的船队怎么能被称为舰队呢,但看了下面的介绍,相信你就会认同,除了舰队外,实在没有别的词语可以形容他的这支船队。 + +托当年一代枭雄陈友谅的服,朱元璋对造船技术十分重视,这也难怪,当年老朱在与老陈的水战中吃了不少亏,连命也差点搭进去。在他的鼓励下,明朝的造船工艺有了极大的发展,据史料记载,当时郑和的船只中最大的叫做宝船,这船到底有多大呢,“大者,长四十四丈四尺,阔一十八丈;中者,长三十七丈,阔一十五丈”。大家可以自己换算一下,按照这个长度,郑和大可在航海之余举办个运动会,设置了百米跑道绝对不成问题。 + +而这条船的帆绝非我们电视上看到的那种单帆,让人难以想象的是,它有十二张帆!它的锚和舵也都是巨无霸型的,转动的时候需要几百人喊口号一起动手才能摆得动,南京市在五十年代曾经挖掘过明代宝船制造遗址,出土过一根木杆,这根木杆长十一米,问题来了,这根木杆是船上的哪个部位呢? + +鉴定结论出来了,让所有的人都目瞪口呆,这根木杆不是人们预想中的桅杆,而是舵杆! + +如果你不明白这是个什么概念,我可以说明一下,桅杆是什么大家应该清楚,所谓舵杆只不过是船只舵叶的控制联动杆,经过推算,这根舵杆连接的舵叶高度大约为六米左右。也就是说这条船的舵叶有三层楼高! + +航空母舰,名副其实的航空母舰 + +这种宝船就是郑和舰队的主力舰,也就是我们通常所说的旗舰,此外还有专门用于运输的马船,用于作战的战船,用于运粮食的粮船和专门在各大船只之间运人的水船。 + +郑和率领的就是这样的一支舰队,舰队之名实在实至名归。 + +这是郑和船队的情况,那么他带了多少人下西洋呢? + +“将士卒二万七千八百余人” + +说句实话,从这个数字看,这支船队无论如何也不像是去寻人或是办外交的,倒是很让人怀疑是出去找碴打仗的。但事实告诉我们,这确实是一支友好的舰队,所到之处,没有战争和鲜血,只有和平和友善。 + +强而不欺,威而不霸,这才是一个伟大国家和民族的气度与底蕴。 + +郑和的船队向南航行,首先到达了占城,然后他们自占城南下,半个月后到达爪哇(印度尼西亚爪哇岛),此地是马六甲海峡的重要据点,但凡由马六甲海峡去非洲必经此地,在当时,这里也是一个人口稠密,物产丰富的地方,当然,当时这地方还没有统一的印度尼西亚政府。而且直到今天,我们也搞不清当时岛上的政府是由什么人组成的。 + +郑和的船队到达此地后,本想继续南下,但一场悲剧突然发生了,船队的航程被迫停止了,而郑和将面对他的航海生涯中的第一次艰难考验。 + +事情是这样的,当是统治爪哇国的有两个国王,互相之间开战,史料记载是“东王”和“西王”,至于到底是些什么人,那也是一笔糊涂账,反正是“西王”战胜了“东王”。“东王”战败后,国家也被灭了,“西王”准备秋后算账,正好此时,郑和船队经过“东王”的领地,“西王”手下的人杀红了眼,也没细看,竟然杀了船队上岸船员一百七十多人。 + +郑和得知这个消息后,感到十分意外,手下的士兵们听说这个巴掌大的地方武装居然敢杀大明的人,十分愤怒和激动,跑到郑和面前,声泪俱下,要求就地解决那个什么“西王”,让他上西天去做一个名副其实的王。 + +郑和冷静地看着围在他四周激动的下属,他明白,这些愤怒的人之所以没有动手攻打爪哇,只是因为还没有接到他的命令。 + +那些受害的船员中有很多人郑和都见过,大家辛辛苦苦跟随他下西洋,是为了完成使命,并不是来送命的,他们的无辜被杀郑和也很气愤,他完全有理由去攻打这位所谓的“西王”,而且毫无疑问,这是一场毫无悬念的战争,自己的军队装备了火炮和火枪等先进武器,而对手不过是当地的一些土著而已,只要他一声令下,自己的舰队将轻易获得胜利,并为死难的船员们报仇雪恨。 + +但他没有下达这样的命令。 + +他镇定地看着那些跃跃欲试的下属,告诉他们,决不能开战,因为我们负有更大的使命。 + + + + + +和平的使命 + + +和平的使命 + +如果我们现在开战,自然可以取得胜利,但那样就会偏离我们下西洋的原意,也会耽误我们的行程,更严重的是,打败爪哇的消息传到西洋各地,各国就会怀疑我们的来意,我们的使命就真的无法达成了。 + +郑和说完后,便力排众议,制止了部下的鲁莽行为,命令派出使者前往西王驻地交涉此事。 + +郑和实在是一个了不起的人,他在手握重兵的情况下能够保持清醒的头脑,克制自己的愤怒,以大局为重,这需要何等的忍耐力!事实证明,郑和的行为决不是懦弱,而是明智的。 + +郑和需要面对的是忍耐,而那位西王面对的却是恐惧,极大的恐惧。 + +当他知道自己的下属杀掉了大明派来的舰队船员时,吓得魂不附体,立刻派出使者去郑和处反复解释误会,他又怕这样做不奏效,便命令派人连夜坐船赶到中国去谢罪,这倒不一定是因为他有多么惭愧和后悔,只是他明白,以大明的实力,要灭掉自己,就如同捏死一只蚂蚁那么简单。 + +朱棣得知此事后,称赞了郑和顾全大局的行为,并狠狠地教训了西王的使者,让他们赔偿六万两黄金(这个抚恤金的价码相当高),两年后,西王派人送上了赔偿金,只有一万两黄金,这倒不是因为他们敢于反悔,实在是这么个小岛即使挖地三尺也找不出六万两黄金来。 + +实在是没法子了,家里就这么点家当,该怎么着您就看着办吧。 + +当西王的使者忐忑不安地送上黄金后,却得到了他意想不到的回答,朱棣明确地告诉他,我早知你们是筹不出来的,要你们赔偿黄金,只不过是要你们明白自己的罪过而已,难道还缺你们那点金子吗? + +朱棣的这一表示完全征服了爪哇,自此之后他们自发自觉地年年向中国进贡。 + +在这一事件中,郑和充分地体现了他冷静的思维和准确的判断能力,也说明朱棣看人的眼光实在独到。 + +在经过这段风波之后,郑和的船队一路南下,先后经过苏门答腊、锡兰山等地,一路上与西洋各国交流联系并开展贸易活动,这些国家也纷纷派出使者,跟随郑和船队航行,准备去中国向永乐皇帝朝贡。 + +带着贸易得来的物品和各国的使者,郑和到达了此次航行的终点——古里。 + +古里就是今天印度的科泽科德,位于印度半岛的西南端。此地是一个重要的中转站,早在洪武年间,朱元璋就曾派使者到过这里,而此次郑和前来,却有着另一个重要的使命。 + +由于古里的统治者曾多次派使者到中国朝贡,并向中国称臣,所以在永乐三年,明成祖给古里统治者发放诏书(委任状),正式封其为国王,并赐予印诰等物。当然了,古里人不一定像中国人一样使用印章,但既然是封国王,总是要搞点仪式意思下的。 + +可是诏书写好了,却没那么容易送过去,因为这位受封的老兄还在印度呆着呢,所以郑和此次是带着诏书来到古里的,他拿着诏书,以大明皇帝的名义正式封当地统治者为古里国王。从此两国关系更加紧密,此后郑和下西洋,皆以此地位中转站和落脚点。 + +在办完这件大事后,郑和开始准备回航,此时距离他出航时已经一年有余,他回顾了此次航程中的种种际遇,感慨良多,经历了那么多的风波,终于来到了这个叫古里的国家,完成了自己的最终使命。 + +这里物产丰富,风景优美,人们和善大度,友好热情,这一切都给郑和留下了极其深刻的印象。 + + + + + +留个纪念吧(1) + + +留个纪念吧 + +他带领属下和当地人一起建立了一个碑亭,并刻上碑文,以纪念这段历史,文曰: + +其国去中国十万余里,民物咸若,熙皞同风,刻石于兹,永昭万世。 + +这是一座历史的里程碑。 + +郑和的船队开始返航了,迎风站在船上的郑和注视着那渐渐远去的古里海岸,这是一个美丽的地方,我们会再来的! + +也许是宿命的安排吧,郑和不会想到,美丽的古里不但是他第一次航程的终点,也将会成为他传奇一生的终点! + +第一次远航就这样完成了,船队浩浩荡荡地向着中国返航,然而上天似乎并不愿意郑和就这样风平浪静地回到祖国,它已经为这些急于回家的人们准备好了最后一道难关,而对于郑和和他的船队来说,这是一场真正的考验,一场生死攸关的考验。 + +自古以来,交通要道都绝不是什么安全的地方,因为很多原本靠天吃饭的人会发现其实靠路吃饭更有效,于是陆路上有了路霸,海上有了海盗,但无论陆路海路,他们的开场白和口号都是一样的——要想从此过,留下买路财。 + +按说郑和的舰队似乎不应该受到这些骚扰,但这决不是因为强盗们为这支舰队的和平使命而感动,而是军事实力的威慑作用。 + +即使是再凶悍的强盗,也要考虑抢劫的成本,像郑和这样带着几万士兵拿着火枪招摇过市,航空母舰上架大炮的主,实在是不好对付的。 + +北欧的海盗再猖獗,也不敢去抢西班牙的无敌舰队,干抢劫之前要先掂掂自己的斤两,这一原则早已被古今中外的诸多精明强盗们都牢记在心。 + +但这个世界上,有精明的强盗就必然有拙劣的强盗,一时头脑发热、误判形势,带支手枪就敢抢坦克的人也不是没有,下面我们要介绍的就是这样一位头脑发热的仁兄。 + +此人名叫陈祖义,他正准备开始自己人生中最大的一次抢劫。 + +当然,也是最后一次。 + +陈祖义,广东潮州人,洪武年间因为犯罪逃往海外,当年没有国际刑警组织,也没有引渡条例,所以也就没人再去管他,后来,他逃到了三佛齐(今属印度尼西亚)的渤林邦国,在国王麻那者巫里手下当上了大将。 + +真是厉害,这位陈祖义不过是个逃犯,原先也没发现他担任过什么职务,最多是个村长,到了这个渤林邦国(不好意思,我实在不知道是现在的哪个地方),居然成了重臣,中国真是多人才啊。 + +更厉害的还在后面,国王死后,他召集了一批海盗,自立为王,就这样,这位陈祖义成为了渤林邦国的国王。 + +以上就是陈祖义先生的奋斗成功史,估计也算不上为国争光吧。 + +陈祖义有了兵(海盗),便经常在马六甲海峡附近干起老本行——抢劫,这也很正常,他手下的都是海盗,海盗不去打劫还能干啥,周围的国家深受其害,但由于这些国家都很弱小,也奈何不得陈祖义。 + +就这样,陈祖义的胆子和胃口都越来越大,逐渐演变到专门打劫大船,商船,猖獗了很多年,直到他遇到了郑和。 + +郑和的船队浩浩荡荡地开过三佛齐时,刚好撞到陈祖义,郑和对此人也早有耳闻,便做好了战斗准备,而陈祖义却做出了一个让所有人都意想不到的决定。 + +他决定向郑和投降。 + +要知道,陈祖义虽然贪婪,但却绝不是个疯子,他能够混到国王的位置(实际只是一个小部落),也是不容易的,看着那些堪称庞然大物的战船和黑洞洞的炮口,但凡神智清醒的人都不会甘愿当炮灰的。 + +但海盗毕竟是海盗,陈祖义的投降只不过是权宜之计,郑和船上的那些金银财宝是最大的诱惑,在陈祖义看来只要干成了这一票,今后就一辈子吃穿不愁了。 + +但要怎么干呢,硬拼肯定是不行了,那就智取! + +陈祖义决定利用假投降麻痹郑和,然后召集大批海盗趁官军不备突袭郑和旗舰,控制中枢打乱明军部署,各个击破。 + +应该说这算是个不错的计划,就陈祖义的实力而言,他也只能选择这样的计划,在经过精心筹划之后,他信心满满地开始布置各项抢劫前的准备工作。 + +在陈祖义看来,郑和是一只羊,一只能够给他带来巨大财富的肥羊。 + +很快就要发财了。 + +陈祖义为了圆满完成这次打劫任务,四处寻找同伙,七拼八凑之下,居然也被他找到了五千多人,战船二十余艘,于是他带领属下踌躇满志地向明军战船逼近,准备打明军一个措手不及。 + +不出陈祖义所料?明军船队毫无动静,连船上的哨兵也比平日要少,陈祖义大喜,命令手下海盗发动进攻,然而就在此时,明军船队突然杀声四起,火炮齐鸣,陈祖义的船队被分割包围,成了大炮的靶子。目瞪口呆的海盗们黄粱美梦还没有醒,就去了黄泉。 + +陈祖义终于明白,自己已经中了明军的埋伏,这下是彻底完蛋了。 + +训练有素的明军给这些纪律松散的海盗们上了一堂军事训练课,他们迅速解决了战斗,全歼海盗五千余人,击沉敌船十余艘,并俘获多艘,而此次行动的组织者陈祖义也被活捉。 + + + + + +留个纪念吧(2) + + +陈祖义做梦也想不到,那个一脸和气接受他投降的郑和突然从肥羊变成了猛虎,他有一种上当的感觉。 + +其实陈祖义之前之所以会认为自己必胜无疑,一方面是出于自信,另一方面则是因为他不了解郑和是一个什么样的人。 + +可能陈祖义是在三佛齐呆久了,还当上了部落头,每天被一群人当主子贡着,就真把自己当回事了,其实从两个人的身份就可以看出来,陈祖义是在中国混不下去了才逃出来的一般犯人,而郑和却是千里挑一的佼佼者! + +陈祖义长期以来带着他的海盗部下打劫船只,最多也就指挥几千人,都没有遇到什么抵抗,他似乎天真的以为打仗就这么简单,这个叫郑和的人也必然会成为他的手下败将。 + +而郑和从十一岁起就已经从军,有着丰富的军事经验,他在朱棣手下身经百战,参加的都是指挥几十万军队的大战役,还曾经和那个时代最优秀的将领铁铉、盛庸、平安等人上阵交锋,那些超级猛人都奈何不了他,何况小小的海盗头陈祖义。 + +陈祖义的这些花招根本逃不过郑和的眼睛,郑和之所以没有立刻揭穿陈祖义,是因为他决定将计就计,设置一个更好的圈套让陈祖义跳进去,等到他把四周的海盗都找来,才方便一网打尽。此外,在郑和看来,活捉陈祖义很有必要,因为这个人将来可以派上用场。至于派上什么用场,我们下面会介绍。 + +在清除了这些海盗后,郑和继续扬帆向祖国挺进,永乐五年(1407)九月,郑和光荣完成使命,回到了京城,并受到了朱棣的热烈欢迎和接见。 + +此时,陈祖义成为了一个有用的人,由于他本就是逃犯,又干过海盗,为纪念此次航海使命的完成和清除海盗行动的成功,朱棣下令当着各国使者的面杀掉了陈祖义,并斩首示众,警示他人。这么看来,陈祖义多少也算为宣传事业做出了点贡献。 + +这次创造历史的远航虽然没有找到建文帝,却带来了一大堆西洋各国的使者,这些使者见证了大明的强盛,十分景仰,纷纷向大明朝贡,而朱棣也终于体会到了君临万邦的滋味。 + +国家强盛就是好啊,感觉实在不错。 + +而朱棣也从他们那里知道了很多远方国家的风土人情,他还得知在更遥远的地方,有着皮肤黝黑的民族和他们那神秘的国度。 + +这实在是一件很有意思的事情,不但可以探访以往不知道的世界,还能够将大明帝国的威名传播海外,顺道做点生意,何乐而不为呢,虽然出航的费用高了点,但这点钱大明朝还是拿得出来的,谁让咱有钱呢? + +于是,在朱棣的全力支持下,郑和继续着他的远航,此后,他分别于永乐五年(1407)九月、永乐七年(1409)九月、永乐十一年(1413)冬、永乐十五年(1417)冬、永乐十九年(1421)春,五次率领船队下西洋。 + +这五次的航海过程与第一次比较类似,除了路线不同,到达地方不同、路上遇事不同外,其他基本相同,所以这里就不一一阐述了。 + +郑和在之后的五次下西洋的主要目的已经转变为了和平交流和官方贸易,当然他和他的舰队在这几次航程中也干过一些小事,如下: + +1、调节国家矛盾,维护世界和平(暹罗与苏门答腊); + +2、收拾拦路打劫,不听招呼的国家(锡兰山国),把国王抓回中国坐牢(够狠); + +3、带其他国家国王到中国观光(苏禄国代表团,国王亲自带队,总计人数三百四十余人,吃了一个多月才回去); + +4、带回了中国人向往几千年的野兽——麒麟(后来证实是长颈鹿)。 + +(这么总结一下,发现这些似乎也不是小事) + +经过郑和的努力,西洋各国于明朝建立了良好的关系,虽然彼此之间生活习惯不同,国力相差很大,但开放的大明并未因此对这些国家另眼相看,它以自己的文明和宽容真正从心底征服了这些国家。 + +大明统治下的中国并没有在船队上架上高音喇叭,宣扬自己是为了和平友善而来,正如后来那些拿着圣经,乘坐着几艘小船,高声叫嚷自己是为了传播福音而来的西方人。 + +郑和的船队带来的是丰富的贸易品和援助品(某些国家确实很穷),他的船队从未主动攻击过,即使是自卫也很有分寸(如那位锡兰山国王,后来也被放了回去),从不仗势欺人(虽然他们确实有这个资本),西洋各国的人们,无论人种,无论贫富,都能从这些陌生的人脸上看到真诚的笑容,他们心中明白,这些人是友善的给予者。 + +而西方探险家们在经历最初的惊奇后,很快发现这些国家有着巨大的财富,却没有强大的军事实力,于是他们用各种暴力手段、杀人放火,只是为了抢夺本?属于当地人的财产。 + +南非的一位著名政治家曾经说过:西方人来到我们面前时,手中拿着圣经,我们手中有黄金,后来就变成了,他们手中有黄金,我们手中拿着圣经。 + +这是一个十分中肯的评价,对于那些西方人,当地人心中明白:这些人是邪恶的掠夺者。 + +即使他们最终被这些西方人所征服,但他们决不会放弃反抗,他们会争取到自由的那一天,因为这种蛮横的征服是不可能稳固的。 + + + + + +留个纪念吧(3) + + +孰是孰非,一目了然。 + +有一句老话用在这里很合适:要相信群众,群众的眼睛是雪亮的。 + +所以我还是重复那句话:以德服人,这绝对不是一句笑话,君不见今日某大国在世界上呼东喝西,指南打北,很是威风,却也是麻烦不断,反抗四起。 + +暴力可以成为解决问题的后盾,但绝对不能解决问题。 + +当时世界上最强大的大明朝在拥有压倒性军事优势的情况下,能够平等对待那些小国,并尊重他们的主权和领土完整,给予而不抢掠,是很不简单的。 + +它不是武力征服者,却用自己友好的行动真正征服了航海沿途几乎所有的国家。 + +这种征服是心底的征服,它存在于每一个人的心中。当那浩浩荡荡的船队来到时,人们不会四处躲避,而是纷纷出来热烈欢迎这些远方而来的客人。 + +在我看来,这才是真正的征服。 + +圆满完成外交使命之外,郑和还成功地开辟了新的航线,他发现经过印度古里(今科泽科德)和溜山(今马尔代夫群岛),可以避开风暴区,直接到达阿拉伯半岛红海沿岸和东非国家。这是一个了不起的成就。 + +在前六次航程中,郑和的船队最远到达了非洲东岸,并留下了自己的足迹。他们拜访了许多国家,包括今天的索马里、莫桑比克、肯尼亚等国,这也是古代中国人到达过的最远的地方。 + +大家可能注意到了,上面我们只介绍了郑和六下西洋的经过,却漏掉了第七次,这并不是疏忽,而是因为第七次远航对于郑和而言,有着极为特殊的意义,就在这次远航中,他终于实现了自己心中的最大梦想。 + +之前的六次航程对于郑和来说,固然是难忘的,可是他始终未能完成自己一生的夙愿——朝圣。这也成为了在他心头萦绕不去的牵挂,但他相信,只要继续下西洋的航程,总是会有机会的。 + +可是一个不幸的消息沉重地打击了他,永乐二十二年(1424),最支持他的航海活动的朱棣去世了,大家忙着争权夺位,谁也没心思去理睬这个已经年近花甲,头发斑白的老人和他那似乎不切实际的航海壮举。 + +郑和被冷落了,他突然之间就变成了一个无人理会,无任何用处的人,等待他的可能只有退休养老这条路了。 + +幼年的梦想终归还是没能实现啊,永乐皇帝已经去世了,远航也就此结束了吧! + +上天终究没有再次打击这位历经坎坷的老者,他给了郑和实现梦想的机会。 + +宣德五年(1430),宣德帝朱瞻基突然让人去寻找郑和,并亲自召见了他,告诉他:立刻组织远航,再下西洋! + +此时距离上次航行已经过去了七年之久,很多准备工作都要重新做起,工作十分艰巨,但郑和仍然十分兴奋,他认为,新皇帝会继续永乐大帝的遗志,不断继续下西洋的航程。 + +事实证明,郑和实在是过于天真了,对于朱瞻基而言,这次远航有着另外的目的,只不过是权宜之计而已,并非一系列航海活动的开始,恰恰相反,是结束。 + +朱瞻基为什么要重新启动航海计划呢,我引用他诏书上的一段,大家看了就清楚了,摘抄如下: + +“朕祗嗣太祖高皇帝(这个大家比较熟悉),太宗文皇帝(朱棣、爷爷)、仁宗昭皇帝(朱高炽、爹)大统,君临万邦,体祖宗之至仁,普辑宁于庶类,已大敕天下,纪元宣德,咸与维新。尔诸番国远外海外,未有闻知,兹特遣太监郑和、王景弘等赍诏往谕,其各敬顺天道,抚辑人民,以共享太平之福。” + +看明白了吧,这位新科皇帝收拾掉自己的叔叔(这个后面会详细讲)后,经过几年时间,稳固了皇位,终于也动起了君临万邦的念头,但问题在于,“万邦”比较远,还不通公路,你要让人家来朝贡,先得告诉人家才行。想来想去,只能再次起用郑和,目的也很明确:告诉所有的人,皇帝轮流坐,终于到我朱瞻基了! + +不管朱瞻基的目的何在,此时的郑和是幸福的,他终于从众人的冷落中走了出来,有机会去实现自己儿时的梦想。 + +作为皇帝的臣子,郑和的第一任务就是完成国家交给他的重任,而他那强烈的愿望只能埋藏在心底,从几岁的顽童到年近花甲的老者,他一直在等待着,现在是时候了。 + +宣德六年(1430)十二月,郑和又一次出航了,他看着跟随自己二十余年的属下和老船工,回想起当年第一次出航的盛况,不禁感慨万千。经历了那么多的风波,现在终于可以实现梦想了! + +他回望了不断远去而模糊的大陆海岸线一眼,心中充满了惆怅和喜悦,又要离开自己的祖国了,前往异国的彼岸,和从前六次一样。 + +但郑和想不到的是,这次回望将是他投向祖国的最后一瞥,他永远也无法回来了。 + + + + + +最后的归宿 + + +最后的归宿 + +郑和的船队越过马六甲海峡,将消息传递给各个国家,然后穿越曼德海峡,沿红海北上,驶往郑和几十年来日思夜想的地方——麦加。 + +伊斯兰教派有三大圣地,分别是麦加、麦地那、耶路撒冷。其中麦加是第一圣地,伟大的穆罕默德就在这里创建了伊斯兰教。穆斯林一生最大的荣耀就是到此地朝圣。 + +不管你是什么种族、什么出身,也不管你坐船、坐车、还是走路,只要你是穆斯林,只要有一丝的可能性,就一定会来到这里,向圣石和真主安拉吐露你的心声。 + +郑和终于来到这个地方,虽然他是一个优秀的航海家,虽然他是一个开创历史的人,但在此刻,他只是一个普通而虔诚的穆斯林。 + +他终于来到了这片梦想中的地方,他终于触摸到了那神圣的圣石,他终于实现了自己的梦想。 + +这是一次长达五十余年的朝圣之旅,五十年前,梦想开始,五十年后,梦想实现。这正是郑和那传奇一生的轨迹。 + +从幸福的幼年到苦难的童年,再到风云变幻的成年,如今他已经是一个风烛残年的老者,经历残酷的战场厮杀,尔虞我诈的权谋诡计,还有那浩瀚大海上的风风雨雨惊涛骇浪,无数次的考验和折磨终于都挺过来了。 + +我的梦想终于实现了,我已别无所求。 + +朝圣之后,船队开始归航,使命已经完成,梦想也已实现,是时候回家了。 + +但郑和却再也回不去了。 + +长期的航海生活几乎燃尽了郑和所有的精力,在归航途中,他终于病倒了,而且一病不起,当船只到达郑和第一次远航的终点古里时,郑和的生命终于走到了尽头。 + +伟大的航海家郑和就此结束了他的一生,由于他幼年的不幸遭遇,他没有能够成家,留下子女,但这并不妨碍他成为一个伟大的,为后人怀念的人。 + +他历经坎坷,九死一生,终于实现了这一中国历史乃至世界历史上伟大的壮举,他率领庞大船队七下西洋,促进了明朝和东南亚、印度、非洲等国的和平交流,并向他们展示了一个强大、开明的国家的真实面貌。 + +虽然他的个人生活是不幸的,也没有能够享受到夫妻之情和天伦之乐。但他却用自己的行动为我们留下了一段传奇,一段中国人的海上传奇。 + +而创造这段传奇的郑和,是一个英雄,一个真正的英雄,是我们这个国家和民族的骄傲。 + +古里成为了郑和最后到达的地方,似乎是一种天意,二十多年前,他第一次抵达这里,意气风发之余,立下了“刻石于兹,永昭万世”豪言壮语。二十年后,他心满意足的在这里结束了自己传奇的一生。 + +郑和,再看一眼神秘而深邃的大海吧,那里才是你真正的归宿,你永远属于那里。 + +古里的人们再也没有能够看到大明的船队,郑和之后,再无郑和。 + +六十多年后,一支由四艘船只组成的船队又来到了古里,这支船队的率领者叫达·伽马。 + +这些葡萄牙人上岸后的第一件事就是四处寻找所谓的财宝,当他们得知这里盛产香料、丝绸时,欣喜若狂,这下真的要发财了。 + +找到这个可以发大财的地方后,达·伽马十分得意,便在科泽科德竖立了一根标柱,用他自己的话说,这根标柱象征着葡萄牙的主权。 + +在别人的土地上树立自己的主权,这是什么逻辑?其实也不用奇怪,这位达·伽马在他的这次航行的所到之地都竖了类似的标柱,用这种乱搭乱建的方式去树立他所谓的主权,这就是西方殖民者的逻辑。 + +然而这位挂着冒险家头衔的殖民者永远也不会知道,早在六十年多前,有一个叫郑和的人率领着大明国的庞大舰队来到过这里,并树立了一座丰碑。 + +一座代表和平与友好的丰碑。 + + + + + +纵横天下(1) + + +第五章 纵横天下 + +让我们回到永乐大帝的时代,在朱棣的统治下,国泰民安,修书、迁都、远航这些事情都在有条不紊地进行着,此时的中国是亚洲乃至世界上最强大的国家之一,如果考虑到同时代的东罗马帝国已经奄奄一息,英法百年战争还在打,哈布斯堡家族外强中干,德意志帝国四分五裂,我们似乎也可以把前面那句话中的之一两字去掉。 + +我们经常会产生一个疑问,那就是怎样才能获得其它国家及其人民的尊重,在世界上风光自豪一把,其实答案很简单——国家强大。 + +明朝在这方面就是一个典型的例子。 + +自元朝中期,国力衰落后,原先那威风凛凛横跨欧亚的蒙古帝国就已经成为了空架子,元朝皇帝成了名义上的统治者,很多国家再也不来朝贡,甚至断绝了联系。 + +生了病的老虎非但不是老虎,连猫都不如。 + +而自从朱元璋接受这个烂摊子后,励精图治,努力发展生产,国力渐渐强盛,而等到朱棣继位,大明帝国更是扶摇直上,威名远播。 + +于是那些已经“失踪”很久的各国使臣们又纷纷出现,进贡的进贡,朝拜的朝拜,不过你可千万别把这些表面上的礼仪当真,要知道,他们进贡、朝拜后,是有回报的,即所谓的“锦绮、纱罗、金银、细软之物赐之”,要是国家不强盛,没有钱,你看他还来不来拜你? + +之前我们说过,洪武年间,朝鲜成为了明朝的属国,自此之后,朝鲜国凡册立太子、国王登基必先告知明朝皇帝,并获得皇帝的许可和正式册封,方可生效。永乐元年,新任国王李芳远即派遣使臣到中国朝贡,此惯例之后二百余年一直未变。 + +而郑和下西洋后,许多东南亚国家也纷纷前来朝贡,不过其中某些国家的朝贡方式十分特别。 + +按说朝贡只要派个大臣充当使者来就行了,但某些国家的使臣竟然就是他们的国王! + +据统计,仅在永乐年间,与郑和下西洋有关的东南亚及非洲国家使节来华共三百余次,平均每年十余次,盛况空前。而文莱、满剌加、苏禄、古麻剌朗国每次来到中国的使团都是国王带队,而且这些国王来访绝不像今天的国家元首访问,呆个两三天就走,他们往往要住上一两个月,带着几百个使团成员吃好玩好再走,与其说是使团,似乎更类似观光旅游团。 + +让人吃惊的还在后面,在这一系列过程中,居然有多达三位国王在率团访问期间在中国病逝,更让人难以置信的是,他们是如此的钦慕中国,在遗嘱中竟都表示要将自己葬于中华大地。而明朝政府尊重他们的选择,按照亲王的礼仪厚葬了他们。 + +贵为一国之君,死后竟不愿回故土,而宁愿埋葬于异国他乡之中国,可见当年大明之吸引力。 + +此外当时的琉球群岛三国:中山、山南、山北,也纷纷派遣使臣来到中国朝贡,其中中山最强,也是最先来的,山南、山北也十分积极,不但定期朝贡,还派遣许多官方子弟来到中国学习先进文化。 + +而亚洲另一个国家的朝贡也是值得仔细一说的,这个国家就是近现代与中国打过许多交道的日本。 + +在当时无数的朝贡使团中,也有日本的身影,永乐元年,日本的实际统治者源道义派遣使臣到中国朝贡,当时朝贡国家很多,大都平安无事,可偏偏日本的朝贡团就出了问题。 + +什么问题呢,原来当时的明朝政府是允许外国使臣携带兵器的,但这些日本朝贡团却不同其他,他们不但自己佩刀,还往往携带大量兵器入境。在完成外交使命后,他们竟然私自将带来的大批武士刀在市场上公开出售,顺便赚点外快(估计也是因为没有其它的东西可卖)。按照今天海关和工商局的讲法,这种行为是携带超过合理自用范围的违禁品,并在没有经营许可证的情况下擅自出售,应予处罚,大臣李至刚就建议将违禁者抓起来关两天,教训他们一下。 + +在这个问题上,朱棣显示了开明的态度,他认为日本人冒着掉到海里喂王八的危险,这么远来一趟不容易,就批准他们公开在市场上出售兵器(外夷修贡,履险蹈危,所费实多。。。毋阻向化)。 + +可能有的朋友已经注意到了,我们在上文中并没有说日本国王或是日本天皇,而是用了一个词——实际统治者。因为之后我们还要和这个叫日本的国家打很多交道,这里就先解释一下这样称呼的原因,下面我们将暂时离开明朝,进入日本历史。 + + + + + +纵横天下(2) + + +在日本,天皇一直是至高无上的统治者,但天皇实际统治的时间并不长,真正的实权往往掌控在拥有土地和士兵的大臣手上,他们才是这个国家真正的统治者。到了公元十三世纪,随着一件事情的发生,这个倾向进一步深化, + +这件事就是日本历史上著名的源平合战,源平两家都是日本著名的武士家族,当时源氏的领军人物源赖朝在他的弟弟,日本第一传奇人物源义经的帮助下打败了平氏,获得了日本的统治权。 + +源赖朝是日本历史上著名的政治家,后来的德川家康一直奉此人为偶像,他为了更好的控制政权,在京都之外建立了幕府,作为武士统治的基地。由于幕府建在镰仓,日本史称镰仓幕府。源赖朝还给了自己一个特别的封号——征夷大将军,这就是后来日本历史上所谓幕府将军的来历。 + +而那位永乐年间来朝贡的源道义就是当时的日本将军,当然,在明朝和之后的清朝史书中都是找不到日本将军这个称呼的,对于这个来历复杂,不清不楚的将军,中国史书全部统称日本王,这倒也是理所应当的,毕竟名分再怎么乱、怎么复杂,那也是日本自己的事情。 + +也正是由于这一原因,日本的国家政治和发布政令(包括发动侵略战争)都是由占据统治地位的将军或实权大臣(如丰臣秀吉就不是将军,而是关白)主使的。 + +当然了,近现代发动甲午战争和侵华战争的那几位仁兄除外(明治维新之后,天皇已经掌握了实权)。 + +但在当时,在强大的明朝面前,日本还是表现得比较友好的,虽然这种友好只是表面上的,暂时的。 + +永乐三年(1405),日本国派遣使臣向明朝朝贡,此时中国沿海一带已经出现较多倭寇,他们经常四处打家劫舍,杀人放火,朱棣大发雷霆,他严厉质问日本使臣,并让他带话回去,要日本国王(将军)好好管管这件事情。这番辞令换成今天的外交语言来说,应该是,如果日本不管,由此造成的一切后果将由日方负责等等。如果按照朱棣的性格直说,那就是,如果你不管,我替你管。 + +当时的日本将军是个聪明人,他明白朱棣这番话的含义,便马上发兵,剿灭了那些作乱的人,并把其中带头的二十个人押送到了中国,朱棣十分满意,他也给足了日本将军面子,又让他们把这些人押回日本自己处置。 + +可是朱棣没有想到的是,使臣走到宁波时,觉得这些人带来带去太麻烦,占位置不说还费粮食,就地把他们解决了,还是用比较特别的方式——“蒸杀之”。 + +从此事可以看出,当时的日本是很识时务的。 + +但好景不长,不久之后,明朝派遣使臣去日本,日本将军竟然私自扣押明朝使臣,此后,日本停止向明朝朝贡,两国关系陷入低谷,总体而言,当时的大多数国家与明朝的关系都是极为融洽的,而在明帝国的西北部,西域各国也与明朝恢复了联系,并开始向明朝朝贡。 + +此时的明朝,疆域虽然不及元朝,但已北抵蒙古,西达西域,东北控制女真,西南拥有西藏,并有朝鲜、安南(今越南)为属国,其影响力和控制力更是远播四方。 + +如此辽阔之疆域,如此强大之影响力,当时的大明已经成为堪与汉唐媲美的强大帝国。 + +在大明帝国统治下的百姓们终于摆脱了战乱和流浪,不再畏惧异族的侵扰,因为这个强大的国家足可以让他们引以为傲,并自豪地说: + +我是大明的子民。 + + + + + +西南边疆的阴谋 + + +西南边疆的阴谋 + +虽然明帝国十分强大,但捣乱的邻居还是有的,也多多少少带来了一些麻烦,而最早出现麻烦的地方,就是安南。 + +安南(今越南),又称交阯,汉唐时为中国的一部分,到了五代时候,中原地区打得昏天黑地,谁也没时间管它,安南便独立了,但仍然是中国的属国,且交往密切。明洪武年间,朱元璋曾册封过安南国王陈氏,双方关系良好,自此安南仿效朝鲜,向大明朝功,且凡国王继位等大事都要向大明皇帝报告,得到正式册封后方可确认为合法。 + +然而在建文帝时期,安南的平静被打破了,它的国内发生了一件惊天动地的大事,由于有人及时封锁了消息,大明对此一无所知。 + +永乐元年,安南国王照例派人朝贺,朱棣和礼部的官员都惊奇的发现,在朝贺文书上,安南国王不再姓陈,而是姓胡。文书中还自称陈氏无后,自己是陈氏外甥,被百姓拥立为国王,请求得到大明皇帝的册封。 + +这篇文书看上去并没有什么破绽,事情似乎也合情合理,但政治经验丰富的朱棣感觉到其中一定有问题,便派遣礼部官员到安南探访实情。 + +被派出的官员名叫杨渤,他带着随从到了安南,由于某些未知原因,他在安南转了一圈,回朝后便证明安南国王所说属实,并无虚构。朱棣这才相信,正式册封其为安南国王。 + +于是安南的秘密被继续掩盖。 + +事后看来,这位杨渤如果不是犯了形式主义错误,就是犯了受贿罪。 + +但黑幕终究会被揭开的。 + +永乐二年,安南国大臣裴伯耆突然出现在中国,并说有紧急事情向皇帝禀报,他随即被送往京城,在得到朱棣接见后,他终于以见证人的身份说出了安南事件的真相。 + +原来在建文帝时期,安南丞相黎季犛突然发难,杀害了原来的国王及拥护国王的大臣,自后他改名为胡一元,并传位给他的儿子胡(上大下互),并设计欺骗大明皇帝,骗取封号。 + +裴伯耆实在是一等一的忠臣,说得深泪俱下,还写了一封书信,其中有几句话实在感人:“臣不自量,敢效申包胥之忠,哀鸣阙下,伏愿兴吊伐之师,隆继绝之义,荡除奸凶,复立陈氏,臣死且不朽!” + +裴伯耆慷慨陈词,然而效果却不是很好,因为朱棣是一个饱经政治风雨的权场老手,对这一说法也是将信将疑。而且从裴伯耆的书信看来,很明显,此人的用意在于借明朝的大军讨伐安南,这是一件大事,朱棣是不可能仅听一面之辞就发兵的。于是, 朱棣并没有马上行动,而是安排裴伯耆先住下,容后再谈。 + +然而同年八月,另一个不速之客的到来打破了朱棣的沉默。 + +这个人就是原先安南陈氏国王的弟弟陈天平,他也来到了京城,并证实了裴伯耆的说法。 + +这下朱棣就为难了,如果此二人所说的是真话,那么这就是一起严重的政治事件,必须出兵了,可谁又能保证他们没有撒谎呢,现任安南国王大权已经在握,自然 会否认陈天平的说法,真伪如何判定呢? + +而且最重要的问题在于,朱棣以前并没有见过陈天平,对他而言,这个所谓的陈天平不过是一个来历不明的人,万一要听了他的话,出兵送他回国,最后证实他是假冒的,那堂堂的大明国就会名誉扫地,难以收拾局面。 + +这真是一个政治难题啊。 + +然而朱棣就是朱棣,他想出了一个绝妙的主意解开了难题。 + +大凡年底,各国都会来提前朝贡,以恭祝大明来年风调雨顺,国泰民安。安南也不例外,就在这一年年底,安南的使臣如同以往一样来到明朝京城,向朱棣朝贡,但他们绝没有想到,一场好戏正等待着他们。 + +使臣们来到宫殿里,正准备下拜,坐在宝座上的朱棣突然发话:“你们看看这个人,还认识他么?” + +此时陈天平应声站了出来,看着安南来的使臣们。 + +使臣们看清来人后,大惊失色,出于习惯立刻下拜,有的还痛哭流涕。 + +一旁的裴伯耆也十分气愤,他站出来斥责使臣们明知现任国王是篡权贼子,却为虎作伥,不配为人臣。他的几句话击中了使臣们的要害,安南使臣们惶恐不安,无以应对。 + +老到的朱棣立刻从这一幕中明白了事情的真相,他拍案而起,厉声斥责安南使臣串通蒙蔽大明,对篡国奸臣却不闻不问的恶劣行径。 + +在搞清事情经过后,朱棣立刻发布诏书,对现任安南国王胡(上大下互)进行严厉指责,并表示这件事情如果没有一个让自己满意的答复,就要他好看。 + +朱棣的这一番狠话很见成效,安?现任胡氏国王的答复很快就传到了京城,在答复的书信中,这位国王进行了深刻的批评和自我批评,表示自己不过是临时占个位置而已,国号纪年都没敢改,现在已经把位置空了出来,诚心诚意等待陈天平回国继承王位。 + +这个回答让朱棣十分满意,他也宽容的表示,如果能够照做,不但不会追究他的责任,还会给他分封土地。 + +然后,朱棣立刻安排陈天平回国。 + +话虽这样说,但朱棣是个十分精明的人,他深知口头协议和文书都是信不过的(这得益于他早年的经历),因为当年他自己就从来没有遵守过这些东西。 + +为保障事情的顺利进行,他安排使臣和广西将军黄中率领五千人护送陈天平回国,按照朱棣的设想,陈天平继位之事已是万无一失。 + +可是之后发生的事情只能用一个词语来形容:耸人听闻。 + +黄中护送陈天平到了安南之后,安南军竟然设置伏兵在黄中眼皮底下杀害了陈天平,还顺道杀掉了明朝使臣,封锁道路,阻止明军前进。 + +消息传到了京城之后,朱棣被激怒了,被真正的激怒了。 + +真是胆大包天! + +阳奉阴违也就罢了,竟然敢当着明军杀掉王位继承人,连大明派去的使臣都一齐杀掉! + +不抱此仇,大明何用!养兵何用! + + + + + +安南平定战(1) + + +安南平定战 + +杀掉了陈天平,胡氏父子安心了,陈氏的后人全部被杀掉了,还顺便干掉了明朝使臣,他虽然知道明朝一定会来找他算账,但他也早已安排好了军队防御,并在显要位置设置了关卡。 + +只要占据有利地势,再拖上了几年,明朝也不得不承认自己的地位。 + +这就是胡氏父子的如意算盘。 + +算盘虽然这样打,但他们也明白,明朝发怒攻打过来不是好玩的,于是他们日夜不停操练军队,布置防御,准备应对。 + +但出乎他们意料的是,过了三个多月,明朝那边一点动静都没有,莫非他们觉得地方偏远,不愿前来? + +存有侥幸心理的胡氏父子没有高兴多久,战争的消息就传来了,明朝军队已经正式出发准备攻取安南。 + +这早在胡氏父子的预料之中,所以当部下向他们报告军情时,父子俩还故作镇定,表明一切防御工作都已经预备好,没有什么可怕的。 + +这对父子之所以还能如此打肿脸充胖子,强装镇定,很大一部分原因在于这父子两个并不知道为何明朝要过三个月才来攻打他们。 + +那是因为军队太多,需要动员时间。 + +多少军队需要动员几个月? + +答:三十万 + +当然了,根据军事家们的习惯,还有一个号称的人数,这次明军军队共三十万,对安南号称八十万,胡氏父子从手下口中听到这个数字后,差点没晕过去。 + +带领这支庞大军队的正是名将朱能,此人我们之前已经介绍过多次,让他出征表明朱棣对此事的重视,朱棣期盼着朱能可以发扬他靖难事后的无畏精神,一举解决问题。 + +可惜天不如人愿,估计朱能也没有想到,他不但没有能够完成这次任务,而且连安南的影子都没能看见。 + +明军的行动计划是这样的,分兵两路,一路以朱能为统帅,自广西进军,另一路由沐晟带领,自云南进军。 + +这是一个历史悠久的军事计划,凡是攻打安南,必从广西和云南分兵两路进行攻击,这几乎已经是固定套路,从古一直用到今。 + +可是意外发生了,朱能在行军途中不幸病倒,经抢救无效逝世,这也难怪,因为大军出发走到广西足足用了三个月。一路上颠簸不定,朱能的所有精力在那场惊天动地的大战中已经消耗得差不多了,再去参加一场战争也太苛责他了,应该休息休息了。 + +朱能的位置空出来了,代替他的倒也不是外人,此人就是被朱棣称为“靖难第一功臣”张玉的儿子——张辅。 + +这是一个艰巨的任务,因为朱能的突然去世让很多人对战争的前景产生了忧虑,而这位威信远不如朱能的人能否胜任主帅职位也很让人怀疑。 + +令人欣慰的是,在这紧急时刻,张玉似乎灵魂附体到了张辅的身上。张辅继承了张玉的优良传统,在这场战争中,他不是一个人在战斗。 + +张辅在接任统帅位置后,面对下属们不信任的目光,召开了第一次军事会议,在这次会议上,他详细地介绍了作战方针和计划,其步骤之周密精确让属下叹服,在会议的最后,张辅说道:“当年开平王(常遇春)远征中途去世,岐阳王(李文忠)代之,大破元军!我虽不才,愿效前辈,与诸位同生共死,誓破安南!” + +在稳定士气,准备充分后,张辅自广西凭祥正式向安南进军,与此同时,沐晟自云南进军,明军两路突击,向安南腹地前进。 + +事实证明,安南的胡氏父子的自信是靠不住的,张辅带兵如入无人之境,连破隘留、鸡陵两关,一路攻击前行,并在白鹤与另一路沐晟的军队会师。 + +至此,明军已经攻破了安南外部防线,突入内地,现在横在张辅面前,阻碍他前进的是安南重镇多邦。 + +据史料记载,当时的安南有东西两都,人口共有七百余万,且境内多江,安南沿江布防,不与明军交战,企图拖垮明军。 + +张辅识破了安南的企图,他派出部将朱荣在嘉林江打败安南军,建立了稳固阵地,然后他与沐晟合兵一处,准备向眼前的多邦城进攻。 + + + + + +安南平定战(2) + + +多邦虽然是安南重镇,防御坚固,但在优势明军的面前似乎也并不难攻克,这是当时大多数将领们的看法,然而这些将领们似乎并没有注意到,在历史上,轻敌的情绪往往就是这样出现并导致严重后果的。所幸的是张辅并不是这些将领中的一员,他派出了许多探子去侦查城内的情况,直觉告诉他,这座城池并不那么简单。 + +张辅的感觉是正确的,这座多邦城不但比明军想象的更为坚固,在其城内还有着一种秘密武器——大象。 + +安南军队估计到了自己战斗力的不足,便驯养了很多大象,准备在明军进攻时放出这些庞然大物,突袭明军,好在张辅没有轻敌,及时掌握了这一情况。 + +可是话虽如此,掌握象情的张辅也没有什么好的办法来对付大象,这种动物皮厚、结实又硕大无比,战场之上,仓促之间,一般的刀枪似乎也奈它不何。该怎么办呢? + +这时有人给张辅出了一个可以克制大象的主意,不过在今天看来,这个主意说了与没说似乎没有多大区别。 + +这条妙计就是找狮子来攻击大象,因为狮子是百兽之王,必定能够吓跑大象。 + +我们暂且不说在动物学上这一观点是否成立,单单只问一句:去哪里找狮子呢? + +大家知道,中国是不产狮子的,难得的几头狮子都是从外国进口的,据《后汉书》记载,汉章帝时,月氏国曾进贡狮子,此后安息国也曾进贡过,但这种通过进贡方式得来的狮子数量必然不多,而且当年也没有人工繁殖技术,估计也是死一头少一头。就算明朝时还有狮子,应该也是按照今天大熊猫的待遇保护起来的,怎么可能给你去打仗? + +那该怎么办呢,狮子没有,大象可是活生生的在城里等着呢,难不成画几头狮子出来打仗? + +答对了! 没有真的,就用画的! + +你没有看错,我也没有写错,当年的张辅就是用画的狮子去打仗的。 + +张辅不是疯子,他也明白用木头和纸糊的玩意儿是不可能和大象这种巨型动物较劲的,不管画得多好,毕竟也只是画出来的,当不得真。作为一名优秀的将领,张辅已经准备好了一整套应对方案,准备攻击防守严密的多邦城。 + +其实到底是真狮子还是假狮子并不重要,关键看在谁的手里,怎么使用,因为最终决定战争胜负的是指挥官的智慧和素质。 + +张辅的数十万大军在多邦城外住了下来,但却迟迟不进攻,城内人的神经也从紧绷状态慢慢松弛了下来,甚至有一些城墙上的守兵也开始和城边的明军士兵打招呼,当然了,这是一种挑衅,在他们看来,自己的战略就要成功了,明军长期呆在这里,补给必然跟不上,而攻城又没有把握,只有撤退这一条路了。 + +安南守军不知道的是,其实明军迟迟不进攻的理由很简单:刀在砍人之前磨的时间越久,就越锋利,用起来杀伤力也会更大。 + +事实正是如此,此时的张辅组织了敢死队,准备攻击多邦城。他所等待的不过是一个好的时机而已。 + +在经过长时间等待后,明军于十二月的一个深夜对多邦城发起了攻击,在战斗中,明军充分发挥了领导带头打仗的先锋模范作用,都督黄中手持火把,率队先行渡过护城河,为部队前进开路,都指挥蔡福亲自架云梯,并率先登上多邦城。这两名高级军官的英勇行为大大鼓舞了明军的士气,士兵们奋勇争先,一举攻破外城,安南士兵们无论如何也想不到,平日毫无动静的明军突然变成了猛虎,如此猛烈之进攻让他们的防线全面崩溃,士兵们四散奔逃。 + +战火蔓延到了内城,此时安南军终于使出了他们的杀手锏,大象,他们驱使大象攻击明军,希望能够挽回败局,然而,早有准备的张辅拿出了应对的方法。 + +考虑到画的狮子虽然威武,但也只能吓人而已,不一定能吓大象,张辅另外准备了很多马匹,并把这些马匹的眼睛蒙了起来,在外面罩上狮子皮(画的),等到大象出现的时候便驱赶马匹往前冲,虽然从动物的天性来说,马绝对不敢和大象作对,但蒙上眼睛的马就算是恐龙来了也会往前冲的。与此同时,张辅还大量使用火枪攻击大象,杀伤力可能不大,但是火枪的威慑作用却相当厉害。 + +在张辅的这几招作用下,安南军队的大象吓得不轻,结果纷纷掉头逃跑,冲散了后面准备捡便宜的安南军,在丧失了所有的希望后,安南军彻底失去了抵抗的勇气,明军一举攻克多邦城。 + +多邦战役的胜利沉重地打击了安南的抵抗意志,此后明军一路高歌猛进,先后攻克东都和西都,并于此年(永乐五年)五月,攻克安南全境,俘获胡氏父子,并押解回国,安南就此平定。 + +在安南平定后,朱棣曾下旨寻找陈氏后代,但并无结果,此时又有上千安南人向明朝政府请愿,表示安南以前就是中国领地,陈氏已无后代,希望能归入中国,成为中国的一个郡。 + +朱棣同意了这一提议,并于永乐五年(1407)六月,改安南为交阯,并设置了布政使司,使之成为了中国的一部分,于是自汉唐之后,安南又一次成为中国领土。 + +安南问题的解决使得中国的西南边界获得了安宁和平静,但明朝政府还有着一个更大的烦恼,这个烦恼缠绕了明朝上百年,如同噩梦一般挥之不去。 + + + + + +天子守国门 + + +第六章 天子守国门! + +蒙古 + +自明朝开国以来,蒙古这个邻居就始终让大明头疼不已,打仗无数次,谈判无数次,打完再谈,谈完再打,原来的元朝被打成了北元(后代称谓),再从北元被打成鞑靼(蒙古古称),可是不管怎么打,就是没消停过。几十年打下来,蒙古军队从政府军、正规军被打成了杂牌军、游击队,但该抢的地方还是抢,该来的时候还是来。 + +这倒也不难理解,本来在中原地区好好的,饭来张口、衣来伸手,全国各地到处走,作为四级民族制度中的头等人,日子过的自然很不错,但是好日子才过了九十几年,平地一声炮响,出来了一个朱元璋,把原来的贵族赶到了草原上去干老本行——放牧,整日顶风和牛羊打交道,又没有什么娱乐节目,如此大的反差,换了是谁也不会甘心啊,更严重的问题在于,他们没有自己的手工业和农业,经济结构严重失衡,除了牛羊肉什么都缺,就算想搞封闭自然经济也没法搞起来。想拿东西和明朝换,干点进出口买卖,可是人家不让干,这也容易理解,毕竟经常打仗,谁知道你是不是想趁机潜入境内干点破坏活动,所以大规模的互市生意是没有办法做起来的。 + +该怎么办呢,需要的、缺少的东西不会从天上掉下来,也不能通过做生意换回来,人不能让尿憋死,那就抢吧! + +你敢抢我,我就打你,于是就接着上演全武行,你上次杀了我父亲,我这次杀你儿子,仇恨不断加深,子子孙孙无穷匮也! + +在这样的历史背景下,明朝展开了与蒙古部落的持久战,这一战就是上百年。 + +下面我们介绍一下永乐时期蒙古的形势,之前我们说过,北元统治者脱古思帖木儿被蓝玉击败后,逃到土刺河,被也速迭儿杀死,之后蒙古大汗之位经过多次传递,于建文四年(1402)被不属于黄金家族的鬼力赤所篡夺,并该国名为鞑靼。我查了一下,这位鬼力赤虽然不是黄金家族直系,但也不算是外人,他的祖先是窝阔台,由于他不是嫡系,传到他这里血统关系已经比较乱了,也许就是因为这个原因,他没有正统黄金家族的那种使命感,所以他废除了元朝国号,并向大明称臣,建立了朝贡关系。从此,北方边境进入了和平时期。 + +可是这个和平时期实在有点短,只有六年。 + +鬼力赤不是黄金家族的人,也对黄金家族没有多少兴趣,可他的手下却不一样,当时的鞑靼太保阿鲁台就是这样一个传统观念很重的人,他对鬼力赤的行为极其不满,整日梦想着恢复蒙古帝国的荣光。在这种动机的驱使下,他杀害了鬼力赤,并拥戴元朝宗室本雅失里为可汗。但这位继承蒙古正统的本雅失里统治的地方实在小得可怜。 + +这是因为经过与明朝的战争,北元的皇帝已经逐渐丧失了对蒙古全境的控制权,当时的蒙古已经分裂为三块,分别是蒙古本部(也就是后来的鞑靼),瓦剌(这个名字大家应该熟悉),兀良哈三卫。 + +蒙古本部鞑靼我们介绍过了,他们占据着蒙古高原,由黄金家族统治,属于蒙古正统。 + +瓦剌,又称作西蒙古,占据蒙古西部,在明初首领猛可帖木儿死后,瓦剌由马哈木统领。 + +兀良哈三卫,就是我们之前提到过的参加过靖难的精锐朵颜三卫,这个部落是怎么来的呢,那还得从几十年前说起。 + +洪武二十年(1387),朱元璋派遣冯胜远征辽东,冯胜兵不血刃地降伏了纳哈出,并设置了泰宁、福余、朵颜三卫(军事单位), 后统称朵颜三卫,并在此安置投降的蒙古人,朱元璋将这些人划归宁王朱权统领之下,靖难之战中,朱棣绑架宁王,其中很大的一个原因就在于他想得到这些战斗力极强的蒙古骑兵。而这些骑兵在靖难中也确实发挥了巨大作用,战后,朱棣封赏了朵颜三卫,并与其互通贸易,他们占据着辽东一带,向明朝朝贡,接受明朝的指挥。 + +昔日的元帝国分裂成了三部分,不得不说是一种悲哀,而此三部分虽然都是蒙古人组成的部落,互相之间的关系却极为复杂,当然,这种复杂关系很大程度上是明朝有意造成的。 + +首先,鞑靼部落自认为是蒙古正统,瞧不起其他两个部落,而且他们和明朝有深仇大恨,一直以来都采取敌对态度。 + +瓦剌就不同了,他们原先受黄金家族管辖,黄金家族衰落后,他们趁机崛起,企图获得蒙古的统治权,明朝政府敏锐地发现了这个问题,并加以利用,他们通过给予瓦剌封号,并提供援助的方式扶持瓦剌势力,以对抗鞑靼。 + +而在瓦剌首领马哈木心中,部落矛盾是大于民族矛盾的,他并不喜欢明朝,但他更加讨厌动不动就指手划脚,以首领自居的鞑靼。 + +都什么时候了,还想摆老大的架子。 + +出于这一考虑,他?明朝政府达成了联盟,当然这种联盟是以外敌的存在为前提的,大家心里都清楚,一旦情况变化,昨日的盟友就是明日的敌人。 + +兀良哈三卫可以算是明朝的老朋友了,但这种朋友关系也是并不稳固的,虽然他们向明朝朝贡,并听从明朝的指挥,但他们毕竟是蒙古人,与鞑靼和瓦剌之间存在着千丝万缕的联系。 + +最后是明朝,他可算是这一切的始作俑者,特长就是煽风点火,北元是他打垮的,瓦剌是他扶持的,兀良哈三卫是他安置的,搞这么多动作,无非只有一个目的,分解元帝国的势力,让他永不翻身。 + +大致情况就是这样,鞑靼和瓦剌打得死去活来,兀良哈在一旁看热闹,明朝不断给双方加油,看到哪方占优势就上去打一拳维护比赛平衡。 + +如果成吉思汗在天有灵,见到这些不肖子孙互相打来打去,昔日风光无限的蒙古帝国四分五裂,不知作何感想。 + + + + + +一次性解决问题 + + +一次性解决问题 + +蒙古本部鞑靼太师在拥立本雅失里为可汗后,奉行了对抗政策,于明朝断绝了关系,更为恶劣的是,永乐七年(1409)四月,鞑靼杀害了明朝使节郭骥,他们的这一举动无疑是在向大明示威。但他们没有想到,他们的这一举动实在是利人损己。 + +因为明朝政府其实早已做好准备要收拾鞑靼,缺少的不过是一个借口和机会而已,而这件事情的发生正好提供了他们所需要的一切。 + +鞑靼之所以成为明朝的目标,绝不仅仅因为他们对明朝报有敌对态度。 + +鞑靼的新首领本雅史里与太师阿鲁台都属于那种身无分文却敢于胸怀天下的人,虽然此时鞑靼的实力已经大不如前,他们却一直做着恢复蒙古帝国的美梦,连年出战,东边打兀良哈,西面打瓦剌,虽然没有多大效果,但声势却也颇为吓人。 + +鞑靼的猖狂举动引起了朱棣的主意,为了打压鞑靼的嚣张气焰,他于永乐七年(1409)封瓦剌首领马哈木为顺宁王,并提供援助,帮助他们作战,瓦剌乘势击败前来进攻的本雅失里和阿鲁台,鞑靼的势力受到了一定的压制。 + +为了一次性解决问题,朱棣决定派出大军远征,兵力为十万,并亲自拟定作战计划,但在最重要的问题上,他犹豫了。 + +这就是指挥官的人选,朱棣常年用兵,十分清楚打仗不是儿戏,必须要有丰富战争经验的人才能胜任这一职务。最好的人选自然是曾经与自己一同靖难的将领们,可是问题在于,当年的靖难名将如今已经死得差不多了, 最厉害的张玉在东昌之战中被盛庸干掉了,朱能也已经死了,张玉的儿子张辅倒是个好人选,可惜刚刚平定的安南并不老实,经常闹独立,张辅也走不开。想来想去,只剩下了一个人选:邱福。 + +对于邱福,我们并不陌生,前面我们也曾经介绍过他,在白沟河之战中,他奉命冲击李景隆中军,却没有成功,但这并没有影响他在朱棣心中的地位,此后他多次立下战功,并在战后被封为淇国公(公爵)。但朱棣也很清楚,这位仁兄虽然作战勇猛,却并非统帅之才,但目下正是用人之际,比他更能打的差不多都死光了,无奈之下,朱棣只得将十万大军交给了这位老将。 + +永乐七年(1409)七月,丘福正式领兵十万出发北征,在他出发前,朱棣不无担心地叮嘱他千万不可轻敌,要谨慎用兵,看准时机再与敌决战。邱福表示一定谨记,跟随他出发的还有四名将领,分别是副将王聪、霍亲,左右参将王忠、李远。 + +此四人也绝非等闲之辈,参加此次远征之前都已经被封为侯爵,战场经验丰富。 + +朱棣亲自为大军送行,他相信如此强的兵力,加上有经验的将领,足可以狠狠地教训一下鞑靼。 + +看着大军远去,朱棣的心中却有一种不安感油然而生,多年的军事直觉让他觉得自己似乎漏掉了什么,他思虑再三,终于省起,便立刻派人骑快马赶到邱福军中,只为了传达一句话。 + +这句话是对邱福说的,“如果有人说敌人很容易战胜,你千万不要相信!”(军中有言敌易取者,慎勿信之) + +邱福接收了皇帝指示,并表示一定不辜负皇帝的信任和期望。 + +朱棣不愧为一位优秀的军事家,他敏锐地意识到了这支军队最大的隐患就在于轻敌冒进,而最容易犯这个错误的就是主帅邱福,在军队出发后,竟然还派人专程赶去传达这一指示,实在是用心良苦。 + +后来的事实也证明了朱棣的判断是准确的,问题在于,主帅邱福偏偏就是一个左耳进,右耳出的人,遇到这样的主帅,真是神仙都没办法。 + +邱福率领军队一路猛进,赶到了胪朐河(今中蒙边境克鲁伦河),击溃了一些散兵,并抓获了鞑靼的一名尚书,丘福便询问敌情,这位尚书倒是个直爽人,也没等邱福用什么酷刑和利诱手段,就主动交待,鞑靼军队主力就在此地北方三十里,如果现在进攻,必然可以轻易获得大胜。 + +邱福十分高兴,干脆就让这个尚书当向导,照着他所指引的方向前进。这样看来,邱福倒真是有几分国际主义者的潜质,竟然如此信任刚刚抓来的俘虏,而从他的年纪看,似乎也早已过了天真无邪的少年时代,但在这件事情上,他实在是天真地过头了。 + +另一方面,我们也不得不佩服朱棣的料事如神,他好像就是这场战争的剧本编剧,事先已经告诉了男主角邱福应对的台词和接下来的剧情,可惜大牌演员邱福却没有按照剧本来演。 + +在那位向导的的带领下,邱福果然找到了鞑靼的军营,但是并没有多少士兵,那位向导总会解释说,大部队在前面。就这样,不停的追了两天,依然如此,总是那么几百个鞑靼士兵,而且一触即溃。 + +部下们开始担忧了,他们认为那个向导不怀好意,然而邱福却没有这种意识,第三天,他还是下令部队跟随向导前进,这下子他的副将李远也坐不住了。 + +李远劝邱福及时回撤,前面可能有埋伏,可是邱福不听,他固执地认为前方必然有鞑靼的大本营,只要前行必可取胜,李远急得跳脚,也顾不得上下级关系,大喊道:“皇上和你说过的话,你忘记了吗!?” + +这下可惹恼了邱福,他厉声说道:“不要多说了,不听我的指挥,就杀了你!” + +邱福如同前两日一样地出发了,带路的还是那位向导,这一次他没有让邱福失望,找了很久的鞑靼军队终于出现了,但与邱福所预期的不一样,这些鞑靼骑兵是主动前来的,而且并没有四散奔逃,也没有惊慌失措,反而看上去吃饱喝足,睡眠充分,此刻正精神焕发地注视着他们。 + +终于找到你们了,找得好苦。 + +终于等到你们了,等了很久。 + + + + + +亲 征(1) + + +亲征 + +永乐七年(1409)八月,远征军的战报传到了京城,战报简单明了:全军覆没。 + +这是一次惨痛的失败,不但十万大军全部被消灭,邱福、王聪、霍亲、王忠、李远五员大将也全部战死沙场。 + +朱棣震怒了,他打了很多年仗,多次死里逃生,恶仗乱仗见得多了,但像这样惨痛的败仗他还真没见过。 + +邱福无能!无能! + +骂人出气虽然痛快,但骂完后还是要解决问题,明军的战斗力还是很强的,关键问题就在于指挥官的人选。邱福固然无能,但现在朝廷里还有谁能代替邱福出征呢,谁又能保证一定能取胜呢? + +人选只有一个——朱棣 + +于是在靖难之战后七年,朱棣再次披上了盔甲,拿起了战刀,准备走上战场去击败他的敌人,与之前的那次战争之不同的是,上一次他是皇子,这一次他是皇帝,上一次是为了皇位,这一次是为了国家。 + +朱棣不但是一个优秀的皇帝,也是一个优秀的将领,这种上马冲锋,下马治国的本领实在是很罕有的,鞑靼已经领教过了皇帝朱棣的外交手段和政治手腕,现在他们将有幸亲身体会到名将朱棣那闪亮刀锋掠过身体的感觉。 + +朱棣完全继承了朱元璋的人生哲学“要么不做,要么做绝”,这次也不例外,为了给鞑靼一个致命的打击,他下达了总动员令,命令凡长江以北全部可以调动的士兵,立刻全部向北方集结,于是长江以北无数人马浩浩荡荡地开始向集结地进发,到永乐八年(1410)一月,部队集结完毕,共五十万,朱棣自任统帅。 + +与此同时,朱棣派遣使者分别向瓦剌和兀良哈传递消息,大致意思是大明马上就要出击鞑靼,希望你们不要多管闲事,如果多事,大可连你们一起收拾。 + +瓦剌和兀良哈都十分识时务,而且他们与鞑靼本来就有着矛盾,怎么肯花力气替自己的敌人出头? + +而此时的鞑靼却十分没有自知之明,击败明军后,本雅史里与阿鲁台十分得意,甚至开始谋划恢复元帝国,重新做皇帝。因而对瓦剌和兀良哈更加傲慢。这两位尚在做美梦的仁兄根本不会想到,刀已经架在了他们的脖子上,只等砍下去了。 + +在做好了一切准备工作后,朱棣终于率领着他的五十万大军出塞远征,目标直指鞑靼! + +八年未经战阵的朱棣终于回到了战场,一切似乎都是那么的熟悉,在他看来,江南水乡的秀丽和宁静远远比不上北方草原的辽阔与豪迈。 + +丝竹之音、轻柔吴语对他没有多少吸引力,万马嘶鸣、号角嘹亮才是他的最爱! + +这就是朱棣,一个沉迷于战场搏杀,陶醉于金戈铁马的朱棣,一个真正而彻底的战士。 + +朱棣率领着他的大军不断向北方挺进,当军队经过大伯颜山时,朱棣纵马登上山顶,远望大漠,唯见万里黄沙,极尽萧条,二十年前,他曾经远征经过此地,那一年他三十岁,这里还有很多人家,是繁华之地,如今却变成了一片荒漠。朱棣感叹良多,对身边的大臣说道:“元兴盛之时,这里都是民居之地啊。” + +容不得朱棣的更多感叹,大军于同年五月到达了几个月前邱福全军覆没的胪朐河,由于时间不长,四处仍然可见死难明军的尸骨和盔甲武器,很明显,蒙古军队管杀不管埋。 + +朱棣看到了这一场景,便让手下的士兵们去寻找明军尸骨,并将他们就地埋葬,入土为安,然后他看着那条湍流不息的胪朐河,沉默不语,思索良久,才开口说道:“自此之后,此河就改名为饮马河吧。” + +言罢,他便率领大军渡过大河。 + +过河之后,明军抓到了少数鞑靼士兵,他们供认鞑靼首领本雅失里就在附近,经过仔细分析,朱棣确认了这一情报的真实性,他立刻下令部将王友就驻扎此地,自己则率领精锐骑兵带上二十天口粮继续追击。 + +兵贵神速,朱棣深深懂得这个道理,而种种迹象表明,自己寻找已久的目标就在附近! + +朱棣的判断没有错,本雅失里确实统领着大队鞑靼骑兵驻扎在附近,但他的老搭档阿鲁台却不在身边,这是为什么呢? + +原来他们吵架了。 + + + + + +亲 征(2) + + +本雅失里是阿鲁台扶植上台的,两人关系一向很好,也甚少争吵,但在得知朱棣亲率五十万大军前来讨伐时,他们慌张之余,竟然发生了激烈的争吵,令人啼笑皆非的是,他们争吵的内容并不是要不要抵抗和怎么抵抗,而是往哪个方向逃跑! + +这二位仁兄虽然壮志凌云,但还是有自知之明的,听说朱棣亲率五十万人来攻击自己后,他们立刻意识到,这次明朝政府是来玩命的,无论怎么扳指头算,自己手下的这点兵力也绝对不够五十万人打的,向瓦剌和兀良哈求援又没有回音,那就只有跑了。 + +可是往那边跑呢?这是个重要的问题。 + +本雅失里说:往西跑,西边安全。 + +阿鲁台说:西边是瓦剌的地盘,我刚和人家打完仗,哪好意思去投奔,不如往东跑,东边安全。 + +本雅失里反对,他说:东边的兀良哈是明朝的附属,决不肯收留自己这个元朝宗室,要去你去,反正我不去。 + +两人僵持不下,越吵越激烈,后来他们决定停止争吵(再不停明军就要来了),分兵突围。 + +就这样,本雅失里一路向西狂跑,可还没有赶到瓦剌就撞到了朱棣的大军,不能不说是运气不好。 + +本雅失里发现了明朝大军的动向,他立刻命令部队加速前进。 + +与此同时,率领精锐骑兵的朱棣也快马加鞭向本雅失里不断靠近。 + +这是一场战场上的赛跑,最终朱棣占据了优势,因为他明智地把辎重和后勤留在了饮马河畔,只带上口粮日夜追击,而本雅失里却舍不得他抢来的那些东西,带着一大堆家当逃跑,自然跑不快。 + +朱棣终于追上了本雅失里,并立刻向他发动了攻击,本雅失里万万没有想到,朱棣来得这么快,毫无招架之功,被朱棣一顿猛打,丢下了所有辎重,只带了七个人逃了出去。战后,朱棣不打收条就全部收走了本雅失里辛辛苦苦带过来,一直舍不得丢的那些金银财宝,而可怜的本雅失里就这样无偿地为朱棣干了一趟搬运工。 + +无论如何,本雅失里总算是捡了一条命,继续着他的逃亡之路,但他却未必知道,他的这次战败不但是他的耻辱,也会让他的祖先蒙羞。 + +或许是宿命的安排吧,朱棣追上并击溃这位成吉思汗子孙的地方,就是斡难河(今蒙古鄂嫩河)。 + +朱棣正在马上俯视着这片刚刚经过大战的土地,大风吹拂着一望无际的草原,斡难河水在阳光的照耀下,映出迷人的光彩,刚发生的那场恶战似乎与这片美丽的土地毫无关系。 + +胜利喜悦已经消退的朱棣突然想起了什么,他沉思了一会,对身边的侍卫感叹道:“这里是斡难河,是成吉思汗兴起的地方啊。” + +是的,两百年前,就在斡难河畔,铁木真统一了蒙古部落,成为了伟大的成吉思汗,术赤、窝阔台、拖雷、哲别等后来威震欧亚大陆的名将们环绕在他的周围,宣誓向他效忠。之后他们各自出征,将自己的宝剑指向了世界的各个角落,并最终建立了横跨欧亚的蒙古帝国。 + +转眼之间,两百年过去了,草原上的大风仍旧呼啸,斡难河水依然流淌,但那雄伟的帝国早已不见了踪影,而就在不久之前,伟大的成吉思汗的子孙在这里被打得落荒而逃。 + +一切都过去了,只有那辽阔的草原和奔流的河水似乎在向后人叙说着这里当年的盛况。 + +百年皇图霸业,过眼烟云耳! + + + + + +阿鲁台的厄运 + + +阿鲁台的厄运 + +本雅失里逃走了,他如愿逃到了瓦剌,然而命运和他开了一个小小的玩笑,虽然以往与瓦剌的战争都是太师阿鲁台指挥,本雅失里并未参与过,可是瓦剌的首领马哈木充分发挥了一视同仁的精神,不但没有给他什么优厚待遇,反而从他这里拿走了一样东西——他的脑袋,报旧仇之余,还顺便去向明朝要两个赏钱。 + +朱棣击败了本雅失里, 但办事向来十分周到的他并未忘记阿鲁台,他随即命令大军转向攻击阿鲁台。 + +此时的阿鲁台情况比本雅失里好不了多少,兀良哈也不肯接纳他,这倒也怪不得兀良哈,被人追斩的人一般都是不受欢迎的。阿鲁台只好在茫茫草原和大漠间穿行,躲避着明军。 + +明军此时也不断寻找着阿鲁台,但由于阿鲁台采用游击战术,方位变换不定,和明军玩起了捉迷藏,而明军粮食就快接济不上了,无奈之下,只好班师,看上去,阿鲁台算是逃过了这一劫。 + +但人要是倒霉起来,连喝凉水也会塞牙的。 + +明军在班师途中,经过阔滦海子(今呼伦湖)时,居然撞上了正在此地闲逛的阿鲁台!这真是踏破铁鞋无觅处,得来全不费功夫。 + +天堂有路你不走,地狱无门偏闯进来! + +朱棣立刻命令军队摆好阵势,五十万大军随时准备发起攻击。此刻的阿鲁台吓得魂不附体,朱棣抓住了阿鲁台的这一心理,派使者传话,要阿鲁台立刻投降,否则后果自负。 + +阿鲁台十分想投降,他很清楚明军的实力,如果要强行对抗,只有死路一条,但部下们却死不同意,双方争执不下。阿鲁台急得跳脚,却又无计可施,在这情况下,阿鲁台和部下达成了一个共识,那就是能拖多久,就拖多久。 + +阿鲁台以需要考虑的时间为理由,把使者打发走了,然后他接着回去和那些部下们讨论对策,会议中,有人提出趁此机会可以偷偷逃走,明军必然追赶不及。这个观点获得了很多人的支持,阿鲁台也认为不错,便决定派遣部分军队先走。 + +然而就在他们调遣军队之时,外面突然传来了巨大的喧哗声和马鸣声!阿鲁台立刻意识到,明军开始进攻了! + +然而此刻的明军大营也并没有接到发动总攻的命令,掌管中军的副将安远伯柳升听到外面乱成一片,大为吃惊,马上出营察看。他惊奇地发现有数千骑兵已经奔离营区,杀向敌军。柳升大为恼火,认为是有人违反军纪私自出战,但当他看清那支骑兵的帅旗后,就立刻没有了火气。 + +因为那是皇帝陛下的旗帜 + +这可了不得,万一出了什么事情不是闹着玩的,柳升立刻命令大营士兵不必列队,立刻紧跟皇帝,发起总攻! + +这一幕混乱的发起者正是朱棣,自从他排遣使者前往阿鲁台军中后,便一直注视着对方的动向,而阿鲁台的缓兵之计自然瞒不过他的眼睛,要知道,他自己就是搞阴谋诡计的行家里手,当年为了争取时间,还装过一把精神病人,在这方面,阿鲁台做他的学生都不够格。 + +而当他发现敌军迟迟不作答复,阵型似乎有所变化时,他就敏锐的判断出,敌军准备有所动作了,至于是进攻还是逃跑,那并不重要,真正重要的是,要立刻抓住时机,痛击敌军。 + +于是他顾不得通知后军,便亲率数千骑兵猛冲对方大营!在他统率下的骑兵们个个英勇无比,以一当十,要知道,带头冲锋的可是皇帝啊!那可不是一般人,平日神龙见首不见尾,贵为天子的人,现在居然拿起刀和普通士兵一起冲锋,还身先士卒,冲在前面,领导做出了这样的表率,哪里还有人不拼命呢? + +跟着皇帝冲一把,死了也值啊 + +榜样的力量是无穷的,在朱棣的鼓舞下,明军如下山猛虎般冲入敌阵,疯狂砍杀蒙古士兵,朱棣更是自己亲自挥刀斩杀敌人,士兵们为了在皇帝面前表现得更好一点,自然更加卖命。经过两三次冲锋,阿鲁台军就彻底崩溃,阿鲁台带头逃跑,而且逃跑效率很高,一下子逃出去上百里地。他本以为安全了,可是明军却紧追不舍,一直跟在他屁股后面追杀,阿鲁台精疲力竭,跑到了回曲津(地名),实在跑不动了,便停下来休息,可还没有等他坐稳,明军就已赶到,又是一顿猛砍,阿鲁台二话不说,扭头就逃,并最终以其极强的求生本能再次逃出生天,但他的手下却已几乎全军覆没。 + +在获得全胜后,朱棣班师回朝,经过这次打击,鞑靼的势力基本解体,大汗被杀,实力大大削弱。阿鲁台被明朝的军事打击搞得痛苦不堪,手忙脚乱,四处求援却又无人援助,无奈之下,他于永乐八年(1410)冬天正式向明朝朝贡,表示愿意顺服于明朝。 + +此战过后,北方各蒙古部落无不心惊胆战,因为明朝的这次军事行动让他们认识到,这个强大的邻居是不能随意得罪的,说打你就打你,绝对不打折扣。 + +朱棣的这次出征虽然没有能够完全解决问题,但也沉重地打击了敌对势力,为北方边界换来了一个长期和平的局面(至少他本人是这样认为的)。 + + + + + +逆命者必剪除之 + + +第七章逆命者必剪除之! + +鞑靼战败的消息,震惊了很多蒙古部落,他们没有想到,由黄金家族统领的蒙古本部居然如此不堪一击,而在他们中间,有一个部落对这一结果却十分高兴,这个部落就是瓦剌。 + +我们前面说过,瓦剌和鞑靼之间有很深的仇恨,估计也超过了人民内部矛盾的范畴,在明军进攻时,瓦剌作为与鞑靼同一种族的部落,不但不帮忙,还替明朝政府解决了本雅失里这个祸害。这样的功劳自然得到了明朝政府的嘉奖。作为这场战争中的旁观者,瓦剌得到了许多利益,然而明朝政府想不到的是,不久之后,这位旁观者就将转变为一个参与者。 + +瓦剌首领马哈木是一个比较有才能的统治者,他并不满足于自己的地盘,而自己的最大竞争对手阿鲁台已经被明军打成了无业游民,他所占据的东部蒙古也变得极为空虚,马哈木是个见了便宜就想占的人,他开始不断蚕食西部蒙古的地盘,几年之间,瓦剌的实力开始急剧膨胀,占领了很多地方。此时阿鲁台却缺兵少将,成了没娘的孩子,他只能去向明朝政府哭诉,可是每次得到的都是“知道啦”“你回去吧,我们会和他打招呼的”之类的话。 + +上学时候的经历告诉我们,打小报告的一般都没有好下场,阿鲁台也不例外,他告状之后境况不但没有改变,反而经常挨打,而且一次比一次狠,鞑靼从此陷入了极端困顿的境地。 + +应该说,阿鲁台落得如此下场,不但是因为瓦剌的进攻,明朝政府的默许和支持也是其中一个因素,眼看鞑靼就要一蹶不振,然而此时时局又出现了意想不到的变化。 + +瓦剌变得过于强大了。 + +不管瓦剌和鞑靼有什么样的矛盾,但他们毕竟还是蒙古人,“攘外必先安内”也并不单单是汉族的传统,在打垮了鞑靼后,瓦剌的马哈木也动起了统一蒙古,恢复帝国的念头,他立答里巴(黄金家族阿里布哥系)为汗,还侵占了和林。 + +明朝政府终于发现,这个旁观者竟然已经变得如此强大,大有一统蒙古之势。而此时阿鲁台也已经被打得失魂落魄,竟然带着自己的部落跑到长城边上来,说自己已经没有活路了,要求政治避难。 + +事到如今,再也不能不管了,明朝政府如同古往今来的所有政权一样,都遵循一条准则: + +没有永远的朋友,也没有永远的敌人,只有永远的利益。 + +昔日的朋友终于变成了敌人。 + +明朝对瓦剌说:“从哪里来,就滚回哪里去!” + +瓦剌说:“我不滚。” + +“不滚,我就打你!” + +“你来吧,怕你不成!” + +不再废话,开打。 + + + + + +瓦剌的自信 + + +瓦剌的自信 + +马哈木敢与明朝如此叫板,决不是一时冲动,他还是有点资本的,当时瓦剌所管辖的西蒙古一直没有受到过明朝的正面打击,而在明朝攻击鞑靼的军事行动中,他还趁机捡了不少便宜,越发耀武扬威起来,这就如同一个小康之家突然中了几百万彩票,便摆起了排场,想去跟人比富。 + +马哈木明白,一旦和明朝撕破脸,就要动真格的了,但马哈木并不畏惧,因为他也有自己的杀手锏——骑兵。 + +在当时,蒙古草原上最强大的骑兵部队已经不再是蒙古本部鞑靼,而是瓦剌。事实证明,蒙古不愧是马上的民族,他们生长在马上,血管里流着游牧民族的血液,即使不复当年之荣光,他们也无愧于最优秀骑兵部队的称号。 + +马哈木仔细观察了明朝和鞑靼的战争,他敏锐地发现明朝的骑兵并不比鞑靼的强,只是因为明军势头很大,而鞑靼却出现了内部分裂,所以才会如此轻易地击败鞑靼。 + +我不会犯那样的错误,瓦剌将在我的统一指挥下诱敌深入,然后发动出其不意的攻击,一举歼灭明军,重现蒙古的辉煌! + +马哈木并不是一个只会空喊口号的人,他已经准备了一个详尽的作战计划,并预设了决战的地点,他相信,只要明军被引入了这个圈套,他就一定能够取得战役的胜利。 + +他几乎成功了。 + +敌人就在前方! + +自从瓦剌表示不服从明朝的调遣,不肯回到西蒙古领地后,朱棣就下定决心,要拔掉这一颗钉子,自小以来,只有他抢别人的东西,别人乖乖听他的话,他不去欺负别人已经是谢天谢地,还没有谁敢欺负过他,而如今小小的瓦剌竟然敢于和他公开叫板,不教训一下是不行了。 + +永乐十二年(1414)二月,他再次带领五十万大军远征,安定侯柳升等部将随同出征,大军浩浩荡荡,向瓦剌出发。 + +朱棣是一个十分有经验的将领,他很清楚,自己的骑兵并不能在与蒙古骑兵的直接冲突中占到多少便宜,毕竟自己手下最精锐的骑兵还是蒙古人组成的朵颜三卫,而这些人还是拿钱的雇佣兵。如今要到瓦剌的土地上与他们作战,瓦剌的骑兵必然会全力以赴,其战斗力是很强大的。 + +骑兵战斗力上的差异不是一朝一夕可以解决的,全民作战的瓦剌也必然会充分利用这一战斗兵种上的优点,加上深入敌境,敌军必有埋伏,如何应付这些问题呢? + +朱棣早已准备好了对策,他演练了全新的阵型,并带上了一支特殊的军队,他相信,这支军队一定会给马哈木意想不到的打击。 + +大军出发后,行军四个多月,一路扫荡瓦剌势力,但让朱棣吃惊的是,即使在深入瓦剌境内后,他们也并未遇到过像样的抵抗。朱棣与邱福不同,他的直觉告诉他,瓦剌军队正在某个地方等待着他,进行一场决战。 + +六月初三,明军前锋将领刘江到达康哈里海,无意之间发现了瓦剌军队,他立刻发动进攻,将全军击溃,并抓到了俘虏,据俘虏交待,马哈木就在此去百里的忽兰忽失温(今蒙古图拉河),且毫无准备。 + +走了几个月的将领和士兵们都十分兴奋,他们已经走了很远的路,希望能够一举打垮瓦剌,如今已经得到了确切敌情,正好可以给对方来一个措手不及。但朱棣的反应却出乎每个人的意料。 + +朱棣在听到这个消息后,仔细分析了敌情,他也认为敌人就在附近,但这些敌人决不是毫无防备的,而是已经做好了决战准备,所以他下令军队不可轻动。 + +属下们听到这个消息都很沮丧,但他们毕竟不敢违背皇帝的军令,但出人意料的是,过了不久,朱棣又改变了主意,命令军队立刻兼程前进,将领们十分高兴,却又摸不着头脑,这位皇帝陛下打的是什么算盘? + + + + + +朱棣陷入了矛盾之中(1) + + +朱棣陷入了矛盾之中 + +他长期以来的军事经验告诉他,从种种迹象看,瓦剌军队是有意识地诱敌深入,而刘江打败的先锋部队很明显是瓦剌故意放出来的诱饵,如果继续深入必然会遭到瓦剌的伏击。 + +最好的办法无疑是在此地等待瓦剌前来决战,但这是不可能的。 + +作为一支深入敌境的军队,找到敌人主力速战速决才是关键,粮食就这么多,无论如何是耗不起的。 + +没办法了。 + +敌人就在前方等着我们,那就来吧,龙潭虎穴也要闯上一闯! + +更何况,我也有自己的杀手锏。 + +明知山有虎,偏向虎山行! + +前方百里,忽兰忽失温! + +此时的瓦剌首领马哈木在沉浸于喜悦之中,他看着部落的另两个首领太平和博罗,得意之情溢于言表。正是在他的周密策划之下,瓦剌保存了实力,并集结了部落最为强大的三万骑兵,在忽兰忽失温设下了圈套,等待着明军的到来。 + +马哈木之所以挑选忽兰忽失温为战场,是有着充分的考虑的,忽兰忽失温附近多山,有利于骑兵部队隐藏,而且将骑兵藏于山上还有着一个很大的优势,那就是一旦发现明军,可以借助山势直冲而下,以难挡之势一举冲垮明军阵型,只要明军阵型一乱,即使人再多也起不了任何作用,只能乖乖地仁自己宰割。 + +马哈木是对的,虽然他肯定没有学过物理,不会懂得势能这个概念,但将骑兵放在高处一冲而下确实有着极强的冲击作用,如果明军没有什么别的办法,阵营必然会被截成几部分,到时首尾无法呼应,形成不了强大的战斗力,就是一盘散沙。 + +这实在是马哈木所能想到的最好的方法,坚壁清野、诱敌深入、居高而下、一举荡平,如同一部完整的动作片,前三个动作是准备,最后一个是结局。但这部动作片要想得到一个完美的结局必有一个前提条件,那就是当瓦剌军队从高处向下冲击时,明军“没有什么别的办法”。 + +明军已是我囊中之物!不久之后,瓦剌和我马哈木必将成为蒙古新的领袖! + +可惜明军统帅朱棣偏偏是一个“有办法”的人,北平城造反时他有办法,白沟河大战时他也有办法,被挡在山东之外进退两难时,他还是有办法。 + +没有办法,他也走不到今天这一步。 + +六月初七,他带着自己的办法来到了忽兰忽失温,来到了马哈木为他安排的战场。 + +看完四周的环境,朱棣不由得抽了一口冷气,和他想象的丝毫不差,此处山多险峻,是伏击作战的不二之选。 + +无论如何,这里就是决战的地点了。 + +当那浩浩荡荡的大军来到自己眼前的时候,马哈木感觉到了强烈的兴奋,身后的三万大军只等待他的一声号令,就可以杀下山去,把明军击溃,彻底地击溃! + +离成功只差一步! + +更让马哈木惊喜的是,明军打头的并不是什么精锐骑兵,而是一些步兵,这简直是天助我也,只要打开了突破口,明军必然无法抵抗自己的攻击。 + +虽然离明军还有一段距离,但在仔细观察了明军阵型后,马哈木已有了必胜的把握,他随即下达了总攻的命令!三万骑兵自山上一冲而下,以猛虎之势扑向山下的明军,杀声遍野,马匹嘶鸣,震天动地。马哈木得意地在山上指挥着他的军队,等待着瓦剌骑兵一举冲垮明军的景象。 + +胜利就在眼前! + +然而,就在瓦剌骑兵发动冲锋后不久,这场看起来一边倒的战役局势突然出现了意想不到的变化! + +突击!神机营! + +在发现瓦剌军队发动进攻后,明军迅速变换了阵型,原先队伍前列的步兵迅速由中间向两翼后退,中军后阵立刻涌出一支部队填补了空位。 + +这支部队与明军中的骑兵和步兵不同,他们手中拿着的并不是马刀或是长剑,而是火铳。 + +在迅速排布好阵型之后,士兵们将手中的火铳对准了不断逼近中的瓦剌骑兵,他们等待着指挥官柳升的命令。 + +瓦剌骑兵注意到了明军阵营的变化,但他们并未在意,而是继续纵马猛冲。 + +此时山上的马哈木也看到这一幕,和他手下的那些人不同,他是见过世面的,明军阵型的这一突然变化让他汗毛直竖,血液几乎凝固,他声嘶力竭地喊道:“是神机营!快退!” + +已经来不及了。 + + + + + +朱棣陷入了矛盾之中(2) + + +中军主帅柳升一声令下,万枪齐发,冲锋中的瓦剌骑兵万料不到会有这样的突然打击,纷纷受伤倒地,损失惨重。一时间战场上人仰马翻,惨烈无比。 + +但仗已经打到这个地步,已经冲锋了,难道还能退回去不成,索性拼到底吧! + +于是剩下的瓦剌骑兵更加拚死向明军冲去。 + +这也是瓦剌骑兵所能做出的最正确的抉择,因为当时明军所使用的火铳是需要装填火药的,而装填火药需要时间,因而在最初的一轮齐射之后,战场上陷入了短暂的宁静之中。 + +瓦剌骑兵见状大喜,他们认定,只要能够冲入明军阵营,一样能够打败明军,获得全胜。 + +然而此时,战场上又出现了意想不到的情况。 + +瓦剌军眼看就要冲入明军阵营,也就在此刻,明军开始了第二次变阵! + +神机营发动齐射之后,并没有出现手忙脚乱装填火药的情形,相反,他们将火铳收好,开始有条不紊地向阵型两翼迅速后撤,明军大队骑兵随即从后军冲出,并分为三部,左路由部将李彬、谭青指挥,右路由部将王通指挥,中军由朱棣亲自统帅。 + +在朱棣的统一指挥下,明军左右两翼分别向瓦剌骑兵发动侧击,朱棣更是神勇无比,又一次亲率大军冲入敌阵,挥舞马刀砍杀瓦剌骑兵,与敌军展开激战。 + +可怜从山上冲下来的瓦剌骑兵,跑了这么远的路,到了明军跟前却发现原先密集的大队人马突然分散,瓦剌军还没有缓过神来,其左右两翼就受到了明军的猛烈攻击,而自己正面的明军更是勇猛无比,四面受敌,到处挨打,之前看似不堪一击的绵羊突然变成了恶狼,这所有的一切让瓦剌陷入了极端的窘境,几万大军就此溃灭。 + +瓦剌首领马哈木是个聪明人,见势不妙,立刻带头逃跑,而已是一盘散沙的瓦剌军也纷纷掉头鼠窜,要知道,游牧骑兵虽然打仗勇猛,但逃跑起来和一般人也没有什么区别,反而跑得更快。 + +此战明军大胜,“斩其王子数十人”(不知是谁的儿子),杀伤瓦剌军万余人,按说人家跑了也就算了,但问题在于这支明军的统帅者是朱棣,他秉承父亲朱元璋同志的优良传统,牢记“凡事做绝”的行为准则,继续猛追马哈木。 + +明军连续追击,马哈木叫苦不迭,跑了上百里地,还是没有摆脱敌军,这样下去不是办法,而且如此狼狈不堪也实在太丢人,马哈木随即鼓起勇气,整合军队,再战明军,用我们今天的话说,叫挽回一点面子。 + +可朱棣实在不给一点面子,瓦剌军整队反攻,正中他下怀,明军势不可挡,一举攻破瓦剌军阵(又败之),马哈木十分果断,转身就跑。 + +马哈木接着跑,明军接着追,一直跑到图拉河边,马哈木眼见逃不脱,便耍起了流氓,甩掉了难兄难弟太平和博罗,让他们去殿后,自己一个人逃走。 + +而朱棣这边也不轻松,虽然追击很顺利,但中途的一个突发事件,却把朱棣着实下了一跳。 + +在追击开始时,明军使用以乱打乱的战术,分散追击瓦剌军,本来这一战术没有什么问题,可有一个人过于兴奋,几乎惹下了大祸。 + +这个人就是朱棣内侍李谦,他当时也在痛打落水狗的人群之中,但由于他追击太猛,以致深入敌军之地,被瓦剌军包围,按说李谦并不是什么大人物,死了也就死了吧,但和在他一起的偏偏还有一个朱瞻基。 + +朱瞻基是朱棣的孙子,朱高炽的儿子,即所谓的皇太孙,朱瞻基自幼聪明伶俐,朱棣并不喜欢他的残疾儿子朱高炽,却十分喜爱朱瞻基,而朱高炽之所以能够当上皇帝,很大程度上也是因为有这么一个机灵的好儿子。 + +朱棣一直以来就把朱瞻基当成将来的接班人来培养,此次出征他特意带上朱瞻基,也是希望朱瞻基能够借此机会见见世面,锻炼一下。 + +话虽如此,也不过是锻炼而已,就如同今天的领导下基层体验生活,挂职锻炼,不会真的动刀动枪去上阵拼杀。朱棣喜欢亲自抄家伙砍人,那是因为他长年从事该项运动,经验丰富,且善于躲闪,能够砍人而不被人砍,朱瞻基不过是个毛孩子,带出来转转而已,但这个毛孩子竟然不知深浅,一时头热,跟着李谦逞英雄去了。 + +当朱棣发现自己身边少了朱瞻基时,顿时傻了眼,冷汗直冒,这一仗胜负不要紧,输了可以重来,但要是把接班人弄没了,那才真是得不偿失。他火冒三丈,立刻派人询问朱瞻基和李谦的去向,得知他们已经追到了九龙口(地名)后,便火速派出军队接应自己的孙子回来,也算老天有眼,瓦剌军慌乱之间,也没有想到自己围住的是这么个大人物,见有人来接应,也就四散奔逃了。 + +朱瞻基平安回来了,但内侍李谦却不敢回来,他极?后怕,感到自己问题严重,还没等朱棣向他问罪,就自杀了。 + +虽然有这样的一个小插曲,但此次战役,明军还是彻底击败了瓦剌军主力,自此之后几十年内,瓦剌再也不敢向明军挑衅,边境从此太平了一段时间。 + +现代的一位伟人曾经这样描述过战争和和平的关系: + +一仗打出十年和平。 + +至理名言,古今通用。 + + + + + +战后总结大会(1) + + +战后总结大会 + +下面我们就这次战役开一个总结大会,在召开总结大会之前,有必要先说一下这次会议的必要性和议题,毕竟把朱棣和马哈木同志请来开会并不容易,为了不耽误大家的时间,我们现在开始: + +这次忽兰忽失温战役虽然并不是什么决定性的战役,但却很值得分析,因为这个看似普通的战役中蕴含了一些明军作战的秘密和规律,是应该认真研究的。 + +这次会议主要探讨两个问题,第一、为什么明军能够战胜? + +先说一下,马哈木同志不要站起来了,不用激动,事情的经过我们已经知道了,战败是事实,具体分析还是交给我吧。 + +要知道,一场战争的胜负是有很多决定因素的,之前我们介绍过,明军的骑兵个人能力不一定能够胜过瓦剌骑兵,但为什么明军却能在瓦剌占据天时地利人和情况下击败瓦剌呢? + +这是因为朱棣统帅下的明军有一套极有技术含量的战法和几支高素质的部队。战法问题过于复杂,我们下面再讨论,先说说明军的高素质部队:三大营。 + +三大营是朱棣同志组建的部队,这支部队也是明朝的最精锐部队,它们分别是:五军营、三千营、神机营 + +先说五军营,五军营并不是指五个军种,实际上,五军营是骑兵和步兵的混合体,分为中军、左军、左掖军、右掖军、右哨军,这支部队是从各个地方抽调上来的精锐部队,担任攻击的主力。 + +下面说一下三千营,我们前面已经说过五军营是明军主力,那么为什么还要单设一个三千营呢,这是因为三千营与五军营并不相同,它主要是由投降的蒙古骑兵组成的。也就是说,三千营实际上是以雇佣兵为主的。 + +之所以叫三千营,是因为组建此营时,是以三千蒙古骑兵为骨干的,当然后来随着部队的发展,实际人数当不止三千人,三千营与五军营不同,它下属全部都是骑兵,这支骑兵部队人数虽然不多,却是朱棣手下最为强悍的骑兵力量,他们在战争中主要担任突击的角色。 + +最后我们要介绍朱棣手下最特殊的一支部队,神机营。 + +之所以说它特殊,是因为这支部队使用的武器是火炮和火铳,在明朝时候,人们称呼这些火器为神机炮,许多游牧民族的骑兵就是丧命于这些神机炮下,马哈木同志就不要哭了,毕竟事情已经过去了。 + +可以说,这支部队就是明朝政府的炮兵部队,朱棣同志之所以要组建这样的一支部队,那是有着深刻原因的。 + +我们看到朱棣同志沉痛地点了点头,没有错,在靖难的时候,朱棣同志主要使用的就是骑兵,但是盛庸先生却大量使用火器袭击他和他的军队,造成了极为不好的影响,朱棣同志自己也几次差点在战场上被干掉。 + +这也使得朱棣同志深刻吸取了教训,在他后来组建军队时,便专门设置了这样一个以使用火器为主的部队,正是这支部队在忽兰忽失温战役中发挥了巨大的作用。 + +好了,以上我们介绍了朱棣的高素质部队,但这并不是他获得胜利的根本原因,明军获胜的真正秘诀在于他们的战法。 + +下面我们就探讨第二个问题:明军使用了怎样的战法? + +可能出乎很多人的意料,明军的战法是非常先进的,那到底先进到什么水平? + +客观地说,明军的战术虽不能说领先世界几百年,但放眼全球,至少在当时,绝无可望其项背者。 + +这并不是信口胡说,是有着充分的证据的,请大家坐好,下面我们将详细介绍明朝军队先进战法的发展过程。 + +在朱元璋时代,明朝有徐达、常遇春、李文忠等十分优秀的骑兵将领,这些人使用骑兵作战堪称不世出之奇才,连靠骑兵起家的蒙古人也被他们打得狼狈不堪,但除了他们率领的骑兵之外,明朝在军事上还有另一招看家本领,那就是火器。 + +事实证明,中国人在发明火药之后,并不仅仅用它制作鞭炮,经过上百年的演化改进,明代时候朱元璋的军队中已经开始大规模使用火器,包括火炮和火铳等,而相应于擅长使用骑兵的徐达等人,朱元璋的手下也涌现出了一大批善于使用火器作战的将领。这些将领中的佼佼者就是邓愈和沐英。 + +邓愈是偏好使用火器的,在洪都保卫战中,他的部下就曾经使用火器重创过陈友谅的军队,但朱元璋时代,对火器战术的运用达到登峰造极程度的,却并不是他,而是沐英。 + + + + + +战后总结大会(2) + + +在那将星闪耀的年代,沐英并不如徐达等人那么耀眼夺目,但他也是一名十分优秀的将领,洪武十四年,他随同傅友德、蓝玉攻击云南,虽不是主帅,但他的排名仅次于蓝玉,可见绝非等闲之辈,一年之后,云南平定,傅友德、蓝玉先后奉调回京,朱元璋下令,沐英暂不回京,镇守云南。按照当时的说法,这只是一个暂时的安排,然而沐英却迟迟没有等到调动工作的机会,慢慢地,他由临时工变成了合同工,他留在了云南。 + +他死后,他的子孙也留在了云南,接着执行祖辈与朱元璋签订的那份长期镇守合同,从此沐氏就成为了云南的镇守者,而这份合同的年限也实在有点长——二百六十年,直到明朝灭亡。 + +但也正是在这片土地上,沐英创造出了他独特的火器战法。 + +沐英时代的云南决不是我们今天看到的所谓春城和旅游胜地,实际上,当时的云南还是一片蛮荒之地,少数民族众多,且以造反为日常主要活动项目,云南之地少平原,骑兵没有多大作用,大部分的军事行动要靠步兵,本来毫无组织的少数民族应该不是训练有素的明朝步兵的对手,可偏偏当地有一种特产,而这种特产又是少数民族喜闻乐见,并极其乐于使用的。 + +这种特产就是大象。 + +话说大象这种动物,身高体胖皮厚,虽不惹事但也不好惹,连山中王老虎见了也要给它三分面子,当年象牙也没现在这么值钱,所以大象数量很多。当地少数民族造反时,总喜欢使用这种当地特产。 + +明军骑马,反军骑大象,这仗怎么打? + +克制大象的方法还是有的,那就是火器,火铳和火炮不但能够有效打击大象,在开枪时发出的响声还能起到威吓的作用。事实上,这也是当年明军唯一可以克制大象军团的方法。 + +但事实总是不如人意,沐英时代所使用的火铳是洪武火铳,这种火铳射程不远,且每次发射后都需要换黑火药和铅子,无法形成持续的杀伤力,发射火铳的士兵往往射完第一发子弹后就会被大象踩死,这种赔本买卖沐英是不会做的。 + +在经过无数次失败和思考后,沐英终于创造出了一种先进且足以克制大象的火器战法。 + +这种战法根据敌军大象兵打前阵的特点,将火铳兵列队为三行,发现敌象兵前进后,第一行首先发射火铳,然后第二行、第三行继续发射,在二三行发射时,第一列就可以从容装好子弹,形成完备而持续的强大火力(置火铳为三行,列阵中。。。前行退后,次行继之;又不退,次行退后,三行继之)。 + +这种开创性的战术克服了当时火铳的局限性,三行轮流开火,没有丝毫停歇,足以将任何敢于来犯之敌人(包括大象)打成漏斗。 + +正是凭借着这种战法,沐英彻底平定了云南境内的叛乱,这种战法由于其使用的地域性,并没有在明军中广泛流传,但这并不能否定其在军事史上的伟大意义。 + +在沐英发明三行火铳战法的百年之后,普鲁士国王菲特列二世经过长期钻研,发明了与之类似的三线战法,其排兵布阵方法与沐英如出一辙,后来,他凭借着这一战法称雄欧洲。 + +当然,这位普鲁士国王认为自己才是三线战术当之无愧的首创者,如果此事发生在发明权和知识产权制度十分清晰的今天,我们是很有理由向这位国王收取专利权使用费的。 + +沐英的三行火器战法虽然并没有在明军中得以广泛流传和使用,但我们不需要为此感到遗憾,因为就在不久之后,一种威力更大,更先进的战法将代替它的位置,在明朝乃至世界军事史上写下辉煌的一页。 + +发明这种战法的是一位优秀的军事家,他就是我们熟悉的朱棣同志。 + +我们也很荣幸地把这位发明者请到了我们的大会现场,喔,朱棣同志,你不用站起来,坐着就行,下面我们将继续介绍这种新式战法的使用方法。 + +在明朝永乐时期,由于早期的徐达、常遇春等一群猛将都已故去,新一代的骑兵随着生活水平的提高,其吃苦耐劳精神有所退化(并非玩笑),不如他们的先辈,明朝骑兵对蒙古骑兵的个体战略优势已经失去,想要克制整日游牧抢劫的蒙古骑兵的冲击力,必须配合使用其他武力手段。 + +朱棣同志根据其长期武装斗争的经验,设置了三大营,并正式将火炮军队引入了明军的战斗序列,他希望用火器来压制蒙古骑兵的冲击,但问题在于,骑兵不同于象兵,其速度极快,由于当时火器杀伤力和射击距离以及换火药时间上的限制,即使朱棣使用沐英的三行火器战法,也是无法抵御骑兵冲击的。 + +在总结经验教训后,明军终于找到了一套能够有效克制蒙古骑兵的战法,本人给明军使用的这套战法取了一个名字,叫“ + + + + + +要你命三板斧战斗系统(1) + + +要你命三板斧战斗系统” + +“要你命三板斧战斗系统”使用说明书 + +首先必须承认,这个名字不是我首创的,而是取材于某搞笑电影中的“要你命3000”武器,也许有的朋友看过这部电影,这个所谓的“要你命3000”武器是由西瓜刀,石灰粉,毒药,绳子一系列工具组成,具体使用过程比较复杂,也很多样,比如先洒石灰粉遮住对方眼睛,然后用西瓜刀砍,或是下毒等等。 + +我在这里借鉴其名决不是为了搞笑,恰恰相反,我的态度是很认真的,因为在我看来这个“要你命3000”武器系统正好能够借用来说明永乐时期明军战法的特点。 + +明军的这个三板斧战法是建立在三大营基础上的,与“要你命3000”武器系统类似的是,明军是对三大营军事力量进行合理调配与组合,达到克制蒙古骑兵的目的。 + +所谓的要你命三板斧战法的操作过程是这样的,首先,在发现蒙古骑兵后,神机营的士兵会立刻向阵型前列靠拢,并做好火炮和火铳的发射准备,在统一指挥下进行齐射。这轮齐射是对蒙古骑兵的第一轮打击,也就是第一斧头。 + +神机营射击完毕后,会立刻撤退到队伍的两翼,然后三千营与五军营的骑兵会立刻补上空位,对已经受创的蒙古骑兵发动突击,这就是明军的第二斧头。 + +骑兵突击后,五军营的步兵开始进攻,他们经常手持制骑兵武器(如长矛等),对蒙古骑兵发动最后一轮打击,这也是明军的最后一斧头。 + +可以看到,这是一个完整的战斗系统,明军使用火器压制敌人骑兵推进挫其锐气后,立刻发动反突击,然后用步兵巩固战场(神机铳居前,马队居后,步卒次之),这一系统的具体使用根据战场条件的不同各异,其细节操作过程也要复杂得多,比如多兵种部队的队形转换等,但其大致过程是相同的。 + +以冲击力见长的蒙古骑兵就是败在了明军的这套战术之下,无论多么凶悍的骑兵也扛不住这三斧头,这套“要你命三板斧战斗系统”经常搞得蒙古人痛苦不堪,却又无可奈何。 + +此外明军使用的武器也是很有特点的,据考证,当时的明军骑兵使用的兵器与蒙古骑兵也多有不同,某些明朝骑兵使用的不是马刀,而是另一种威力更大的独门兵器——狼牙棒。 + +虽然骑兵多数使用的是弯马刀,但据现代科技人员研究表明,高速移动中的骑兵在与敌方骑兵对交锋时,使用狼牙棒的一方是占有优势的,这是因为狼牙棒的打击范围广,使用方便,马刀只有单面开刃,狼牙棒却是圆周面铁刺,无论哪一部分击打对手都会造成伤害,此外还兼具棍棒打击功能,其威力实在堪比现在街头斗殴时使用的王牌武器——三棱刮刀。 + + + + + +要你命三板斧战斗系统(2) + + +而且狼牙棒的批量制作费用低廉,没有统一标准,在棍棒上加装铁钉铁签等物体,几十分钟即可制作完成,简单方便,还可自由发挥创造力,如个别心理阴暗者会加装倒钩倒刺等,不死也让你掉层皮,实在让人胆寒,正是所谓价格便宜,量又足,他们一直用它。 + +综合以上的分析,我们可以看出,明军的胜利决不是侥幸,在他们辉煌战绩的背后,是对先进武器的研发、战术的科学分析和战斗过程的细节编排,是无数军事战术科研人员的辛勤汗水的结晶。 + +所以在我看来,科学技术是第一推动力这句话实在是极为正确的。 + +和我们前面介绍过的沐英三行战法一样,朱棣的这套战法在后来的时代里也有很多近似品。 + +三百多年后,一位矮个子开始使用与朱棣类似的战法,他的战术可以用三句话来概括:先用大炮轰,再用骑兵砍,最后步兵上。 + +可以看出,他的这套战法和朱棣时代的明军战法是比较类似的,正是凭借这套战法,他征服了大半个欧洲,并最终找到了一份和朱棣相同的工作——皇帝。 + +这位矮个子就是法国的拿破仑,他威震天下的资本正是他那独特而富于机动性的炮骑结合战术。 + +天才总是有某些共通点的。 + +会议开到现在,也该散会了,希望大家能够从这个总结会议中了解一些明朝的战术思想和技巧,也算没白开这个会。 + +对了,差点说漏了最重要一点,以上我们已经概括了明军的战术思想和战斗方法,虽然这些都是明军取胜的重要原因,但先进的武器和战术并不是影响战争胜负的决定性因素,事实上,古往今来,所有战争的胜负关系都遵循着一个最根本的原理: + +最终决定胜负的是参加战争的人。 + +马哈木失败了,他的挑衅行为终于换来了教训,明白自己没有与明朝对抗的实力后,他也步阿鲁台后尘,于永乐十三年(1415)向明朝朝贡称臣。 + +不过总体看来,马哈木这个人还是比较守信用的,至少比阿鲁台强,或者说他很识时务,可能是那惨烈的一仗给他的心灵以沉重的打击,他终其一生再也没有侵犯过明朝边界,这无疑是一件好事,但从史料来看,他也并没有闲着,此后他将所有的精力都投入到了对子孙的培养中。 + +很明显,他认识到了最重要的一点,那就是以瓦剌目前的经济实力和科技实力,绝对不是明朝政府的对手,但他也明白,先进的武器和战术从来都不是胜利的保障,统帅和参与战争的人才是最为关键的。 + +事实证明,他确实培养出了堪称英才的下一代。 + +他的儿子叫脱欢,二十年后杀掉了鞑靼首领阿鲁台,最终统一蒙古。 + +他的孙子叫额森,这位仁兄比他老子还厉害,干出了更加惊天动地的事,他还有一个广为人知的名字——也先。 + + + + + +帝王的财产 + + +第八章 帝王的财产 + +朱棣对待蒙古部落的这种指哪打哪,横扫一切的军事讨伐有效地震慑了瓦剌和鞑靼,自永乐十二年(1414)征伐瓦剌得胜归来后,明帝国的边界终于安静了下来,瓦剌奄奄一息,鞑靼心有余悸,“不打不服,打服为止”这句俗语用在此处十分合适。永乐大帝朱棣就这样用武力为自己的国民创造了一个良好的生活环境,此时永乐大典已经修成,边疆平安无事,周边四夷争相向明朝皇帝朝贡,大明帝国可谓风光无比。 + +在朱元璋和朱棣父子的辛苦经营下,明帝国的文治武功达到了最高峰,国家繁荣昌盛、百业兴旺的景象又一次在中国大地上呈现,这固然是朱棣的成就,但究其根本还是朱元璋时代打下的良好基础在起作用,因为朱元璋就如同一个尽职的管家婆,早已为自己的子孙制定了一系列政策,让他们去照着执行。 + +事实上,朱棣时代奉行的仍然是他父亲的那一套系统,但朱棣本人在此基础上也有着自己的发明创造,下面我们将介绍朱棣统治时期出现的几个新机构,这些机构对之后的明代历史有着极为深远的影响,而且这些也确实可以算得上是朱棣辛苦劳动的结果,是超越前人的发明创造,值得一提。 + +我们先从最重要的一个说起。 + +这是一个全新的机构,是由朱棣本人设立的,但这个新机构的设立者朱棣做梦也不会想到,几十年之后,它会成长为一个可怕的庞然大物,庞大到足以威胁皇帝的地位和权力。 + +这个机构就是内阁。 + +永乐初年,被政事累得半死不活的朱棣终于无法忍受下去了,他总算领教了自己老爹朱元璋的工作效率和工作精神,自己纵然全力以赴没日没夜的干工作,还是很难完成,在这种情况下,他任命解缙等七人为殿阁大学士,参与机务。 + +这七个人组成了明朝的第一任内阁,自此之后,朱棣但凡战争、用人、甚至立太子这样的事情都要与这七个人讨论方作决定,其职权责任不可谓不大。 + +但出人意料的是,内阁成员的官职却只有五品,远远低于尚书、侍郎等中央官员,这也是朱棣精心设置的,他对内阁也存有一定戒心,为防止这七个人权势过大,他特意降低了这些所谓阁员的品衔,他似乎认为这样就能够有效的控制内阁。 + +后来的事实证明,他错了。 + +谁也料不到这个当初丝毫不起眼的小机构最终竟然会成为明帝国统治的中枢,当年官位仅五品的阁臣成为了百官的首领,更让人难以置信的是,这个机构的生命力竟然会比明朝这个朝代更长! + +它已经由一个机构变成了一种制度,在此之后的五百余年一直延续下去,成为中国封建政治制度中极为重要的部分。 + +在我们之后的叙述中,这个机构将经常出现在我们的文章中,无数忠臣、奸臣、乱臣都将在这个舞台上表现他们的一生。 + +内阁固然重要,但下一个机构的知名度却要远远的大于它,这个朱棣出于特殊目的建立的部门几百年来都笼罩着神秘色彩,它的名字也经常和罪恶、阴谋纠缠在一起。 + +这个部门的名字叫东厂。 + +我们前面曾提到过锦衣卫这个特务部门,虽然此部门一度被朱元璋废除,但朱棣登基后不久便恢复了该部门的建制,原因很简单,朱棣需要特务。 + +像朱棣这样靠造反上台的人,虽然嘴上不说,心里却是很虚的,自己搞阴谋的人必然总是认为别人也在搞阴谋,为了更加有效的监视百官,他重新起用了锦衣卫。 + +但不久之后,朱棣就感觉到锦衣卫也不太好用,毕竟这些人都是良民出身,和百官交往也很密,而朱棣本着怀疑一切、否定一切的科学精神,认定这些人也不可靠。 + +这下就难办了,特务还不可靠,谁可靠呢? + + + + + +宦 官(1) + + +宦官 + +宦官最可靠,虽然这些家伙没文化,身体还有残疾(特等),大部分还有点变态心理(可以理解),但毕竟曾经帮助我篡位,一直在我身边,所以信任他们是没错的。 + +就这么定了,设立一个由宦官主管的机构,向我一个人负责,负责刺探情报,有事直接向我汇报请示,办公地点就设在东安门吧,这样调动也方便点。 + +至于名字,既然总部在东安门,就叫东厂吧。 + +永乐十八年(1420),朱棣设置东厂,这个明代最大的特务机构就此登上历史舞台,其权力之大、作恶之多、名声之臭实在罕有匹敌。 + +由于其机构位于东安门,所以被命名为东厂,家住北京的朋友有兴趣可以去原址看看,具体地址是今天的北京王府井大街北部,名字还叫东厂胡同。 + +东厂设立之初便十分有气派,主要反映在东厂的关防印上,别的部门官印只是简单写明部门名称而已,东厂的关防印却大不相同,具体说来是十四个大字:“钦差总督东厂官校办事太监关防”,虽然语法不一定通畅,却十分有派头,而在我看来,这样的印记还兼具一定防伪作用,毕竟街头私刻公章的小贩要刻这么多字花费的力气会更多,收费也更贵。 + +最初东厂只负责侦查、抓人,并没有审判的权利,抓获人犯要交给锦衣卫北镇抚司审理,但到后来,为了方便搞冤假错案,本着人无我有,人有我优的精神,东厂充分发挥积极性,也开办了自己的监狱。 + +东厂设置有千户、百户、掌班、领班、司房等职务,但具体干活的是役长和番役,他们职责很广,什么都管,什么都看,朝廷会审案件,东厂要派人听审;朝廷的各个衙门上班,东厂派出人员坐班,六部的各种文件,东厂要派人查看;这还不算,更让人瞠目结舌的是,这些人还负责市场调查,连今天菜市场白菜萝卜多少钱一斤,都要记录在案。 + +这些无孔不入的人不但监视百官,连他们的同行锦衣卫也监视,可见其权力之大。 + +能统率这么大的机构,拥有如此大的权力,东厂首领也就成为了人人称羡的职业,但这个职业有一个先天性的限制条件:必须是宦官(有得必有失啊)。 + +东厂的首领称为东厂掌印太监,是宦官中的第二号人物。 + +第一号人物自然是鼎鼎大名的司礼监掌印太监。 + +这些东厂的特务在刺探情报,鱼肉百姓之余,也有着自己敬仰的偶像和信条,在东厂的府衙大厅旁边,设置了一座小厅,专门用于供奉这位偶像。 + +相信大家也绝对不会想到,这位拥有大量东厂崇拜者的偶像竟然是——岳飞。 + +更令人啼笑皆非的是,东厂人员还在东厂大堂前建造了一座牌坊,写上了自己的座右铭——百世流芳。 + +百世流芳相信他们是做不到了,遗臭万年倒是很有可能,而可怜的岳飞如果知道还有这样一群人把他当成偶像,只怕也是高兴不起来的。 + +这里也要特地说明,请大家不要相信新龙门客栈中的所谓绝顶太监高手之类的鬼话,现实中的东厂太监手边也没有什么葵花宝典,抓人逞凶等大部分的具体事情都是由东厂太监手下的那些正常人干的。 + +自从这个机构成立后,不光是朝廷百官倒霉,连锦衣卫也跟着郁闷,因为他们原本就是特务,东厂的人却成了监视特务的特务,锦衣卫的地位大受影响。 + +在东厂成立之前,锦衣卫也算是个有前途的职业,许多“有志青年”出于各种目的,纷纷投身于明朝的特务事业,但东厂机构出现后,其势头就盖过了锦衣卫,抢了锦衣卫的风头。 + +原因也很简单,东厂是直接向皇帝负责的,而且其首领东厂掌印太监是皇帝身边的人,与皇帝的关系不一般,也不是锦衣卫的首领锦衣卫指挥使能够相比的。 + +所以在之后的明代历史发展中,原本是平级的锦衣卫和东厂逐渐变成了上下级关系,有些锦衣卫指挥使见了东厂掌印太监甚至要下跪叩头。 + +不过事情总有例外,在明代的特务历史中,有一位锦衣卫指挥使依靠自己的才能和努力第一次压倒了东厂,这位指挥使十分厉害,在他任指挥使的时期内,锦衣卫的威名和权力要远远大于东厂,可见事在人为。 + +这位堪称明代最强锦衣卫的人是一位重量级的人物,在他的那个时代有着强大势力和深远的政治影响,我们将在以后的文章中详细介绍他的一生。 + + + + + +宦 官(2) + + +最后一个介绍的是我们经常在电视剧中听到的一个称谓——巡抚。 + +大家对这个名字应该并不陌生,这个名称最初出现在永乐年间,也算是朱棣的发明创造吧,实际上,那个时候的巡抚和之后的巡抚并不是一回事。 + +我们之前曾经介绍过,朱元璋时期废除了中书省,设置布政使司,最高长官为布政使,主管全省事务,地位相当于我们今天的省长。本来布政使管事也算正常,但朱元璋有一个嗜好——分权,他绝不放心把一省的所有大权都交给一个人,于是他还另外设置了两个部门,分管司法和军事。 + +这两个部门分别是提刑按察使司和都指挥使司,最高长官为按察使和都指挥使。 + +老朱搞这么一手,无非是为了便于控制各省事务,防止地方坐大,本意不坏,但后来的事情发展又出乎了他的意料,这是因为他的这一举动正应了中国的一句俗话: + +三个和尚没水喝。 + +虽然这三位长官的职权并不相同,布政使管民政、财政、按察使管司法、都指挥使管军事,但大家都在省城办公,抬头不见低头见,关系处得不好,也是很麻烦的,平日里三家谁也不服谁,太平时期还好办,万一要有个洪灾旱灾之类天灾,如果没有统一调配,是很麻烦的,特别当时还经常出现农民起义这种群众性活动,没有一个总指挥来管事,没准农民军打进官衙时,这三位大人还在争论谁当老大。 + +为了处理这三个和尚的问题,中央想了一个办法,就是由中央派人下去管理全省事务,这个类似中央特派员的人就叫巡抚。 + +要说明的是,中央可不是随便派个人下来当巡抚的,在论资排辈十分严重的中国,能被派下来管事的都不是等闲之辈,一般来说,这些巡抚都是各部的侍郎(副部级)。 + +与很多人所想的不同,在永乐时期,中央官员序列中实际上并没有巡抚这个官名,所谓的巡抚不过是个临时的官职,中央的本意是派个人下去管事,事情办完了你就回来,继续干你的副部级。 + +可是天不随人愿,中央大员下到地方,小事容易办,要是遇到民族纷争问题和农民造反这些大事,就不是一年半年能回来的了。要遇到这种事情,巡抚可就麻烦了,东跑西跑,一忙就是大半年,这里解决了那里又闹,逢年过节的,民工都能回家过年,而有些焦头烂额的巡抚却几年回不了家。 + +本来只是个临时差事,却经常是一去不返,巡抚也有老婆孩子,也有夫妻分居,子女入学这些问题,长期挂在外面也实在苦了这些大人,中央也麻烦,往往是这个刚巡回来,又有汇报何处出事,地方处理不了,需要再派,周而复始,也影响中央人员调配,于是,在后来的历史发展中,巡抚逐渐由临时特派员变成了固定特派员,人还算是中央的人,但具体办公都在地方,也不用一年跑几趟了。 + +既然说到巡抚,我们就不得不说与之相关的两个官职。 + +巡抚虽然是大官,却并非最大的地方官员,事实上,比巡抚大的还有两级,这两级官员才真正称得上是举足轻重的人物。 + +明朝政府确定了巡抚制度后,又出现了新的难题,因为当时的农民起义军们经常会变换地点,也就是所谓的打一枪换一个地方,也算是游击战的一种,山东的往河北跑,湖北的往湖南跑,遇到这种情况,巡抚们就犯难了。比如浙江巡抚带着兵追着起义军跑,眼看就要追上,结果这些人跑到了福建,浙江巡抚地形不熟,也不方便跑到人家地盘里面去,就会要求福建巡抚或是都指挥使司配合,如果关系好也就罢了,算是帮你个忙。关系不好的那就麻烦了,人家可以把眼一抬:“你何许人也,贵姓?凭什么听你指挥?” + +为了处理这种情况,中央只得再派出更高级别的官员(一般是尚书正部级),到地方去处理事务,专门管巡抚。这些人就是所谓的总督。 + +总督一般管两个省或是一个大省(如四川总督只管四川),可以对巡抚发令。 + +按说事情到这里就算解决了,可是政策实在跟不上形势,到了明朝后期,如李自成、张献忠这样的猛人出来后,游击队变成了正规军,排场是相当的大,人家手下几十万人,根本不把你小小的巡抚、总督放在眼里,正规军不小打小闹,要打就打省会城市,一闹就几个省,总督也管不了。 + +在这种情况下,中国有史以来最大的地方官出场了,疲于应付的明朝政府最后只得又创造出一个新官名——督师。这个官专门管总督,农民军闹到哪里,他就管到哪里,当然了,这种最高级别的地方官一般都是由中央最高文官大学士兼任的。 + +以上三种机构或官职都是在永乐时期由朱棣首创的,其作用有好有坏,我们在这里介绍它们,是因为在后面的文章中,我们还要经常和他们打交道,所以在这里必须先打个底。 + +与这些制度机构相比,朱棣还给他的子孙后代留下了一样更加珍贵的宝物,也正是这件宝物不但开创了永乐盛世,还在朱棣死后,将这种繁荣富强的局面维持下去。 + +这件宝物就是人才。 + +朱棣和朱元璋一样,都是中国历史上十分有作为的英明君主,但综合来看,朱棣比朱元璋在各个方面都差一个层次,除了一点之外。 + +这一点就是看人才的眼光。 + +之前我们曾经介绍过朱元璋给他的孙子留下的那三个人,事实证明这三个人是名副其实的书呆子,作用极其有限,朱棣也给自己的子孙留下了三个人,这三个人却与之前的齐黄大不相同。 + +他们是真正的治世英才。 + +由于他们三个人都姓杨,所以史称“三杨” + +他们是那个时代最为优秀的人物,且各有特长,不但有能力,而且有城府心计,历经四朝而不倒,堪称奇人,下面我们就逐个介绍他们的传奇经历。 + + + + + +第一个人(1) + + +第一个人 博古守正 杨士奇 + +如果要评选中国历史上著名盛世之一——仁宣盛世的第一缔造者,恐怕还轮不到仁宣两位皇帝,此荣誉实非杨士奇莫属,因为如果没有他,朱高炽可能就不是所谓的明仁宗了。 + +这位传奇文臣活跃于四朝,掌控朝政,风光无限,但这一切都是他应得的,为了走到这一步,他付出了太多太多。 + +至正二十五年(1365),杨士奇出生在袁州,当年正是朱元璋闹革命的时候,各地都兵慌马乱,民不聊生,为了躲避饥荒,杨士奇的父母带着他四处奔走,日子过得很苦。在杨士奇一岁半的时候,他的父亲杨美终于在乱世中彻底得到了解脱——去世了。 + +幼年的杨士奇不懂得悲伤,也没有时间悲伤,因为他还要跟着母亲继续为了生存而奔走,上天还是公平的,他虽然没有给杨士奇幸福的童年,却给了他一个好母亲。 + +杨士奇的母亲是一个十分有远见的人,即使在四处飘流的时候,她也不忘记做一件事——教杨士奇读书。在那遍地烽火的岁月中,她丢弃了很多行李,但始终带着一本书——《大学》,说来惭愧,此书我到二十岁才通读,而杨士奇先生五岁就已经会背了,每看到此,本人都会感叹新社会就是好,如果在下生在那个时代,估计混到四五十岁还是个童生。 + +读书是要讲天分的,杨士奇就十分有天分,可读书还需要另一样更为重要的东西,那就是钱。 + +杨士奇没钱,他的母亲也没钱。 + +没有钱,就上不起私塾,就读不了书,就不能上京考试,就不能当官,毕竟科举考试并不是只考《大学》。 + +杨士奇和他的母亲就这样在贫困的煎熬中迎来了人生的转折。 + +洪武四年(1371),杨士奇的母亲改嫁了,杨士奇从此便多了一位继父,一位严肃且严厉的继父。 + +这位继父叫罗性,他同时也兼任杨士奇的老师。 + +罗性,字子理,事实上,他并不是一个普通人,此人出生世家,当时已经是著名的名士,且有官职在身,性格耿直,但生性高傲,瞧不起人杨士奇怀揣着好奇和畏惧住进了罗性的家,当然,也是他自己的家。 + +罗性是一个十分严厉孤傲的人,对这个跟着自己新娶妻子(或是妾)一道进门,却并非自家血亲的小孩并没有给什么好脸色。这似乎也是很自然的事。 + +进入罗家后不久,杨士奇就被强令改姓罗,这似乎也很正常,给你饭吃的人总是有着某种权力的。 + +杨士奇就这样在这个陌生的环境下开始了自己的生活,虽然改姓罗,但毕竟不是人家的孩子,差别待遇总是有的,罗性也并不怎么重视他,这一点,即使是幼年的杨士奇也能感觉得到。他唯一能做的就是更加小心翼翼,尽量不去惹祸,以免给他和他的母亲带来麻烦。 + +两年后,年仅八岁的杨士奇的一次惊人之举改变了他的生活状况。 + +洪武六年(1373),罗家举行祭祀先祖的仪式,还是小孩的杨士奇被触动了,他想起了自己故去的父亲和颠沛流离的生活,他也想祭拜自己的父亲和亲人。 + +可是罗家的祠堂决不会有杨家的位置,而且如果他公开祭祀自己的家人,恐怕是不会让继父罗性高兴的。 + +这个年仅八岁的小男孩却并未放弃,他从外面捡来土块,做成神位的样子,找到一个无人注意的角落,郑重地向自己亡故的父亲跪拜行礼。 + +杨士奇所不知道的是,他这自以为隐秘的行为被一个人看在了眼里,这个人正是罗性。 + +不久之后,罗性找到了杨士奇,告诉他自己看到了他祭拜祖先的行为,还告知他从今往后,恢复他的杨姓,不再跟自己姓罗。 + +杨士奇十分惊慌,他以为是罗性不想再养他,要将他赶出门去。 + +罗性却摇了摇头,叹息道:“我的几个儿子都不争气,希望你将来能够略微照顾一下他们。” + +他接着感叹道:“你才八岁,却能够寄人篱下而不堕其志,不忘祖先,你将来必成大器!你不必改姓了,将来你必定不会辱没生父的姓氏。” + +罗性是对的,有志从来不在年高。 + +自此之后,罗性开始对杨士奇另眼相看,并着力培养他,供他读书。 + +如果事情就这样发展下去,杨士奇应该会通过各项考试,最终中进士入朝为官,因为他确实有这个实力,但上天实在弄人。 + +仅仅一年之后,罗性因罪被贬职到远方,杨士奇和他母亲的生活又一次陷入了困境。然而在这艰苦的环境下,有志气的杨士奇却没有放弃希望,他仍然努力读书学习,为自己的将来?奋斗。 + +由于家境贫困,杨士奇没有办法向其他读书人那样上京赶考图个功名,为了贴补家用,他十五岁就去乡村私塾做老师,当时私塾很多,没有形成垄断产业,每个学生入学时候交部分学费,不用开学时去教务处一次性交清,如果觉得先生教得不好,可以随时走人,所以老师的水平是决定其收入的关键,学生多收入就多,由于他学问根基扎实,很多人来作他的学生,但毕竟在农村贫困地区,他的收入还是十分微薄,只能混口饭吃。 + + + + + +第一个人(2) + + +生活贫困的杨士奇和他的母亲一直过着清贫的生活,不久之后,他又用自己的行动诠释了人穷志不穷这条格言的意义。 + +杨士奇的一个朋友家里也十分穷困,但他没有别的谋生之道,家里还有老人要养,实在过不下去了。杨士奇主动找到他,问他有没有读过四书,这个人虽然穷点,学问还是有的,便回答说读过。杨士奇当即表示,自己可以把教的学生分一半给他,并将教书的报酬也分一半给他。 + +他的这位朋友十分感动,因为他知道,杨士奇也有母亲要养,家境也很贫穷,在如此的情况下,竟然还能这样仗义,实在太不简单。 + +少了一半收入的杨士奇回家将这件事情告诉了母亲,他本以为母亲会不高兴,毕竟本来已经很穷困的家也实在经不起这样的折腾,但出乎他意料的是,母亲却十分高兴地对他说:“你能够这样做,不枉我养育你成人啊!” + +是的,穷人也是有尊严和信义的,正是因为有这样明理的母亲,后来的杨士奇才能成为一代名臣。 + +杨士奇就是这样成长起来的,在困难中不断努力,在贫困中坚持信念,最终成就事业。 + +人穷,志不可短! + +没有功名的杨士奇仕途并不顺利,他先在县里做了一个训导(类似今天的县教育局官员),训导是个小官,只是整天在衙门里混日子,可杨士奇做官实在很失败,他连混日子都没有混成。 + +不久之后,杨士奇竟然在工作中丢失了学印,在当年那个时代,丢失衙门印章是一件很大的事,比今天的警察丢枪还要严重得多,是有可能要坐牢的。此时,杨士奇显示了他灵活的一面。 + +如果是方孝孺丢了印,估计会写上几十份检讨,然后去当地政府自首,坐牢时还要时刻反省自己,杨士奇没有这么多花样,他直接就弃官逃跑了。 + +杨士奇还真不是书呆子啊 + +之后逃犯杨士奇流浪江湖,他这个所谓逃犯是应该要画引号的,因为县衙也不会费时费力来追捕他,说得难听一点,他连被追捕的价值都不具备,此后二十多年,他到处给私塾打工养活自己,值得欣慰的是,长年漂泊生活没有让他变成二混子,在工作之余,他继续努力读书,其学术水平已达到了一个相当的高度。 + +在度过长期学习教书的流浪生活后,杨士奇终于等到了他人生的转机。 + +建文二年(1400),建文帝召集儒生撰写《太祖实录》,三十六岁的杨士奇由于其扎实的史学文学功底,被保举为编撰。 + +在编撰过程中,杨士奇以深厚的文史才学较好地完成了工作,并得到了此书主编方孝孺的赞赏,居然一举成为了《太祖实录》的副总裁。 + +永乐继位后,杨士奇真正得到了重用,他与解缙等人一起被任命为明朝首任内阁七名成员之一,自此之后,他成为了朱棣的重臣。 + +与解缙相同,他也不是个安分的人,此后不久,他卷入了立太子的纷争,他和解缙都拥护朱高炽,但与解缙不同的是,他要聪明得多。 + +青少年时期的艰苦经历磨炼了杨士奇,使他变得老成而有心计。他为人十分谨慎,别人和他说过的话,他都烂在肚子里,从不轻易发言泄密,他是太子的忠实拥护者,却从不明显表现出来,其城府可见一斑。 + +而杨士奇之所以能够有所成就,其经验大致可以概括为一句话: + +刚出道时要低调,再低调。 + +虽然杨士奇精于权谋诡计,但事实证明,他并不是一个滑头的两面派,在这场你死我活的夺位斗争中,他始终坚定地站在了朱高炽一边,并依靠自己的智慧和忠诚最终战胜了政治对手,将朱高炽扶上了皇帝的宝座。 + +永乐年间,最为残酷的政治斗争就是朱高炽与朱高煦的皇位之争,在这场斗争中,无数人头落地,无数大臣折腰,阴谋诡计层出不穷,双方各出奇谋,经过更是一波三折,跌宕起伏,斗争一直延续到朱棣去世的那个夜晚,一个人冒着极大的风险,秘密连夜出发,奔波一个月赶路报信,方才分出了胜负。 + +事实上,不但杨士奇参加了这场斗争,我们下面要介绍的三杨中的另外两个也没有闲着,他们都是太子党的得力干将。在后面的文章中,我们会详细介绍这场惊天动地的皇位之争。 + + + + + +第二个人 + + +第二个人足智多谋杨荣 + +我们接着介绍的杨荣是三杨中的第二杨,他虽然没有杨士奇那样出众的政务才能和学问基础,却有一项他人不及的能力——准确的判断力。 + +杨荣,洪武四年(1371)生,福建人,原名杨子荣(注意区分),他虽然没有深入虎穴,剿灭土匪的壮举,但其大智大勇却着实可以和后来的那位战斗英雄相比。 + +与杨士奇不同,他小时候没有吃过那么多苦,家里环境不错的他走的正是读书、应试、做官的这条老路。建文二年(1400),他考中进士,由于成绩优秀,被授予编修之职,即所谓的翰林。 + +建文帝时代翰林院可谓书呆子云集之地,这也难怪,毕竟掌权的就是黄子澄、方孝孺那样的人,上行下效也很正常。 + +然而后来的事实证明,杨荣这位优等生与他的那些同事们有很大的不同,他实在不是个书呆子,而应该算是一位心思缜密的谋士。 + +与杨士奇一样,这个足智多谋的人也是在永乐时期才被重用的,但他飞黄腾达的经过却很有点传奇色彩,因为他凭借的不是才学,而是一句话。 + +建文四年(1402),朱棣终于打败了顽强的南军,进入京城,夺得了皇位,现在他只剩下一件事要办——登基即位。 + +然而就在他骑马向大殿进发时,意想不到的事情发生了。 + +一个人站了出来,阻挡了他的去路(迎于马首)。 + +这个人正是杨荣。 + +由于当时情况还比较混乱,敌友难分,难保某些忠于建文帝的大臣不会玩类似恐怖分子和荆轲那样的把戏,周围的人十分紧张,而朱棣本人也大为吃惊,但他不会想到,更让他吃惊的还在后面。 + +杨荣竟然对他说,现在不应该进宫即位。 + +不应该即位?笑话!打了那么多年的仗,装了那么久的傻,死了那么多的人,无非只是为了皇位,可眼前的这个书生竟然敢阻止我即位,凭什么!真是可笑! + +在场的人几乎已经认定杨荣发疯了,准备替他收尸。 + +但杨荣真的阻止了朱棣的即位,还让朱棣心悦诚服照办,而他完成这个不可能的任务竟然只用了一句话。 + +“殿下是应该先去即位呢,还是先去祭陵呢?”(先遏陵乎,先即位乎?) + +一语惊醒梦中人。 + +我们前面说过,朱棣造反是披着合法外衣的,说得粗一点就是即要当婊子,又要立牌坊,胜利冲昏了他的头脑,竟然一时之间忘记了立牌坊,只是一心要当婊子。无论怎么说,如果不先拜一下老爹的坟,那是很不妥当的,朱棣连忙拨转马头,去给老爹上坟。 + +从这件事情上,我们可以看出杨荣已经精明到了极点,他摸透了朱棣的心理,也看透了遮羞布下权力斗争的真相。这样的一个人比他的上级方孝孺、黄子澄不知要高明多少倍。 + +同样老奸巨猾的朱棣从此记住了这个叫杨荣的人,在他即位后便重用杨荣,并将其召入内阁,成为七人内阁中的一员。 + +当时的内阁七人都是名满天下之辈,而在他们中间,杨荣并不显眼,他没有解缙的才学,也没有杨士奇的政务能力,并不是个引人注目的人,但这决不是他的能力不行,事实上,他所擅长的是另一种本领——谋断。 + +所谓谋断就是谋略和判断,这些本应是姚广孝那一类人的专长,而从小熟读四书五经,应该是个老实读书人的杨荣居然会擅长这些,实在令人费解,但他善于判断形势却是不争的事实,下面的这个事例就很能说明问题。 + +一天晚上,边关突然传来急报,宁夏被蒙古军队围攻,守将派人几百里加急报信,这是紧急军情,朱棣也连忙起身去内阁找阁臣讨论如何处理(内阁有24小时值班制度,七天一换),偏巧那天晚上,值班的正是杨荣。 + +朱棣风风火火地来到内阁,把奏报交给杨荣看,问他有什么意见。 + +出乎朱棣预料,杨荣看完后没有丝毫慌乱,表情轻松自然,大有一副太监不急皇帝急的势头。 + +朱棣又气又急,杨荣却慢条斯理的对他说:“请陛下再等一会,宁夏一定会有第二份解围奏报送来的。” + +朱棣好奇地看着他,让他说出理由,杨荣此刻也不敢再玩深沉,因为朱棣不是一个对大臣很有耐心的人。 + +杨荣胸有成竹地说道:“我了解宁夏的情况,那里城防坚固,而且长期作战,士兵经验丰富,足以抵御周围的蒙古军队。从他们发出第一份奏报的日期来看,距离今天已过去十余天,此刻宁夏应该已经解围了,必然会发出第二份奏报。” + +不久之后,朱棣果然收到了第二份解围的奏报,自认料事如神的朱棣对杨荣也十分佩服,并交给他一个更为光荣的任务——从军。 + +朱棣认识到,杨荣是一个能谋善断的人,在对蒙古作战中,这样的人才正是他所需要的,于是在永乐十二年(1414)的那次远征中,杨荣随同朱棣出行,表现良好,获得了朱棣的信任。朱棣便将军队中最为重要的东西——印信交给杨荣保管,而且军中但凡宣诏等事务,必须得到杨荣的奏报才会发出,可以说,杨荣就是朱棣的私人秘书。 + +朱棣之所以如此信任杨荣,很大的一个原因就在于他这个人处事不偏不倚,也不参与朱高炽与朱高煦的夺位之争,没有帮派背景,当然,这仅仅是朱棣的想法而已。 + +朱棣想不到的是,这个看上去十分听话的杨荣并不像他表面上那么简单,朱棣将印信和奏报之权授予杨荣,只是为了要他好好干活,然而这位杨荣却利用这一便利条件,在关键时刻做出了一件关键的事情。 + +永乐二十二年(1424)七月,朱棣病逝之时,那个当机立断,驰奔上千里向太子报告朱棣已死的消息,为太子登基争取宝贵时间,制定周密计划的人,正是一向为人低调的杨荣。因为他的真实身份和杨士奇一样,是不折不扣的太子党。 + + + + + +第三个人(1) + + +第三个人临危不惧杨溥 + +下面要说的这位杨溥,其名气与功绩和前面介绍过的两位相比有不小的差距,但他却是三人中最具传奇色彩的一个,别人出名、受重用依靠的是才学和能力,他靠的却是蹲监狱。 + +杨溥,洪武五年(1372)生,湖北石首人,建文二年(1400)中进士,是杨荣的进士同学,更为难得的是,他也被授予编修,又成为了杨荣的同事,但与杨荣不同的是,杨溥是天生的太子党,因为在永乐元年,他就被派去服侍朱高炽,算是早期党员。 + +朱棣毕竟还是太天真了,杨荣和杨溥这种同学加同事的关系,外加内阁七人文臣集团固有的拥立太子的政治立场,说杨荣不是太子党,真是鬼都不信。 + +杨溥没有杨士奇和杨荣那样突出的才能,他辅佐太子十余年,并没有什么大的成就,也不引人注目,这样下去,即使将来太子即位,他也不会有什么前途,但永乐十二年发生的一个突发事件却改变了他的命运,不过,这个突发事件实在不是一件好事。 + +永乐十二年(1414),“东宫迎驾事件”事发,这是一个有着极深政治背景的事件,真正的幕后策划者正是朱高煦。在这次事件中,太子党受到严重打击,几乎一蹶不振,许多大臣被关进监狱当替罪羊,而杨溥正是那无数普普通通的替罪羊中的一只。 + +由于杨溥的工作单位就是太子东宫,所以他被认定为直接责任者,享受特殊待遇,被关进了特级监狱——锦衣卫的诏狱。 + +锦衣卫诏狱是一所历史悠久,知名度极高的监狱,级别低者是与之无缘的(后期开始降低标准,什么人都关),能进去人的不是穷凶极恶就是达官显贵。所谓身不能至,心向往之,有些普通犯人对这所笼罩神秘色彩的监狱也有着好奇心,这种心理也可以理解,从古至今,蹲监狱一直都是吹牛的资本,如“兄弟我当年在里面的时候”,说出来十分威风。 + +此外,蹲出名的人也绝不在少数。反正在哪里都是坐牢,找个知名度最高的监狱蹲着,将来出来后还可以吹牛“兄弟我当年蹲诏狱的时候”,应该也能吓住不少同道中人。 + +这样看来,蹲监狱也算是出名的一条捷径。 + +然而事实上,在当年,想靠蹲诏狱出名可不是一件容易的事,首先要够级别,其次你还要有足够的运气。 + +因为一旦进了诏狱,就不太容易活着出来了。 + +诏狱是真正的人间地狱,阴冷潮湿,环境恶劣,虽然是高等级监狱,却绝不是卫生模范监狱,蚊虫老鼠到处跑,监狱也从来不搞卫生评比,反正这些东西骚扰的也不是自己。 + +虽然环境恶劣,但北镇抚司的锦衣卫们(诏狱由北镇抚司直辖)却从来没有放松过对犯人们的关照,他们秉承着宽于律己,严于待人的管理理念,对犯人们严格要求,并坚持抗拒从严,坦白也从严的审讯原则,经常用犯人练习拳脚功夫,以达到锻炼身体的目的,同时他们还开展各项刑具的科研攻关工作,并无私地在犯人身上试验刑具的实际效果。 + +最初进入诏狱的犯人每天的生活都是在等待——被审讯——被殴打(拳脚,上刑具)——等待中度过的,等到每人审你也没人打你的时候,说明你的人生开始出现了三种变数,1、即将被砍头 2、即将被释放 3、你已经被遗忘了 + +相信所有的犯人都会选择第二种结果,但可惜的是,选择权从来不在他们的手上。 + +这就是诏狱,这里的犯人没有外出放风的机会,没有打牌消遣等娱乐活动,自然更不可能在晚上排队到礼堂看新闻报道。 + + + + + +第三个人(2) + + +明朝著名的铁汉杨继盛、左光斗等人都蹲过诏狱,他们腿被打断后,骨头露了出来也没人管,任他们自生自灭。所以我们说,这里是真正的地狱。 + +杨溥进的就是这种监狱,刚进来时总是要吃点苦头的,不久之后,他也陷入了坐牢苦等的境况,但杨溥想不到的是,这一等就是十年。 + +更惨的是,杨溥的生命时刻都笼罩着死亡的阴影,“东宫迎驾事件”始终没有了结,而朱高煦更是处心积虑要借此事彻底消灭太子党,在这种情况下,杨溥随时都有被拉出去砍头的危险(史载“旦夕且死”),然而杨溥却以一种谁也想不到的行为来应对死亡的威胁。 + +如果明天生命就可能结束,而你却无能为力,你会干些什么? + +我相信很多人在这种状况下是准备写遗书或是大吃一顿,把以前没玩的都补上,更多的人则是怨天尤人,抱怨上天不公。 + +这些都是人的正常反应,可杨溥奇就奇在他的反应不正常。 + +明天就可能被拉出去砍头,他却仍在读书,而且是不停地读,读了很多书(读经史诸子书不辍),这实在是让人难以理解,在那种险恶的环境下,性命随时不保,读书还有什么用呢? + +可这个人却浑似坐牢的不是自己,每天在散发恶臭、肮脏潮湿的牢房里,却如同身在自己书房里一样,不停地用功读书,他的自学行为让其他犯人很惊讶,到后来,连看守他的狱卒都怀疑他精神不正常。 + +他的这种举动也引起了朱棣的主意,有一次朱棣突然想起他,便问杨溥现在在干什么(幸好不是问杨溥尚在否),大臣告诉他杨溥在监狱里每天都不停地读书。 + +朱棣听到这个答案后,沉思良久,向锦衣卫指挥使纪纲下达了命令,要他务必好好看守杨溥,不能出任何问题。 + +我们前面说过,朱棣是一个很有水平的领导,这种水平就体现在对人的认识上,他很清楚杨溥的境况和心理状态,然而就是在这样的情况下,杨溥却能视死如归,毫不畏惧,也绝非伪装(装不了那么长时间),这是很不容易的。 + +很明显,这个叫杨溥的人心中根本就没有害怕这两个字。 + +自古以来,最可怕的事情并不是死,而是每天在死亡的威胁下等死。 + +不知何时发生,只知随时可能发生,这种等死的感受才是最为痛苦的 + +杨溥不怕死,也不怕等死,这样的人,天下还有何可怕?! + +真是个人才啊! + +正是因为这个原因,朱棣才特意让人关照杨溥,他虽然不愿用杨溥,却可以留给自己的儿子用。 + +也多亏了朱棣的这种关照,杨溥才能在诏狱中度过长达十年的艰苦生活,最终熬到刑满释放,光荣出狱,并被明仁宗委以重任,成为一代名臣。 + +看了以上这三位的人生经历,我们就能知道:在这个世界上,要混出头实在不容易啊。 + +之所以在这里介绍三杨的经历,不但因为他们将在后来的明代历史中扮演重要角色,更重要的是,他们都参加了那场惨烈的皇位之争,并担任了主角,以上的内容不过是参与这场斗争演员的个人简介,下面我们将开始讲述这场残酷的政治搏斗。 + + + + + +生死相搏 + + +第九章 生死相搏 + +朱高煦一直不服气 + +这也很容易理解,他长得一表人才,相貌英俊,且有优秀的军事才能,相比之下,自己的那个哥哥不但是个大胖子,还是个瘸子,连走路都要人扶,更别谈骑马了。 + +简直就是个废人。 + +可是,偏偏就是这样的一个废人,将来要做自己的主人! + +谁让人家生得早呢? + +自己也不是没有努力过,靖难的时候,拼老命为父亲的江山搏杀,数次出生入死,却总是被父亲忽悠,虽得到了一句“勉之,世子多疾!”的空话,却从此就没有了下文。 + +干了那么多的事,却什么回报都没有,朱高煦很愤怒,后果很严重。 + +他恨朱高炽,更恨说话不算数的父亲朱棣。 + +想做皇帝,只能靠自己了。 + +不择手段、不论方法,一定要把皇位抢过来! + +朱高煦不知道的是,他确实错怪了自己的父亲。 + +朱棣是明代厚黑学的专家,水平很高,说谎抵赖如同吃饭喝水一样正常,但在选择太子这件事情上,他却并没有骗人,他确实是想立朱高煦的。 + +父亲总是喜欢像自己的儿子,朱高煦就很像自己,都很英武、都很擅长军事、都很精明、也都很无赖。 + +朱高炽却大不相同,这个儿子胖得像头猪,臃肿不堪,小时候得病成了瘸子(可能是小儿麻痹症),走路都要人扶,简直就是半个废人。朱棣实在想不通,如此英明神武的自己,怎么会有个这样的儿子。 + +除了外貌,朱高炽在性格上也和朱棣截然相反,他是个老实人,品性温和,虽然对父亲十分尊重,但对其对待建文帝大臣的残忍行为十分不满,这样的人自然也不会讨朱棣的喜欢。 + +于是朱棣开始征求群臣的意见,为换人做准备,他先问自己手下的武将,得到的答案几乎是一致的——立朱高煦。 + +武将:战友上台将来好办事啊。 + +之后他又去问文臣,得到的答复也很统一——立朱高炽。 + +文臣:自古君不立长,国家必有大乱。 + +一向精明的朱棣也没了主意,便找来解缙,于是就有了前面所说的那场著名的谈话。从此朱棣开始倾向于立朱高炽。 + +但在此之后,禁不住朱高煦一派大臣的游说,朱棣又有些动摇,立太子一事也就搁置了下来,无数大臣反复劝说,但朱棣就是不立太子,朱高炽派大臣十分明白,朱棣是想立朱高煦的。于是,朱高炽派第一干将解缙开始了他的第二次心理战。 + +不久之后,有大臣画了一幅画(极有可能是有人预先安排的),画中一头老虎带着一群幼虎,作父子相亲状。朱棣也亲来观看,此时站在他身边的解缙突然站了出来,拿起毛笔,不由分说地在画上题了这样一首诗: + +虎为百兽尊,谁敢触其怒。 + +惟有父子情,一步一回顾。 + +高!实在是高! + +解缙的这首打油诗做得并不高明,却很实用,所谓百兽尊不就是皇帝吗,这首诗就是告诉朱棣,你是皇帝,天下归你所有,但父子之情是无法替代也不应抛开的。朱高煦深受你的宠爱,但你也不应该忘记朱高炽和你的父子之情啊。 + +解缙的判断没有错,朱棣停下了脚步,他被深深地打动了。 + +是啊,虽然朱高炽是半个废人,虽然他不如朱高煦能干,但他也是我的儿子,是我亲自抚养长大的亲生儿子啊!他没有什么显赫的功绩,但他一直都是一个忠厚老实的人,从没有犯错,不应该对他不公啊。 + +就在那一刻,朱棣做出了决定。 + +他命令,立刻召见朱高炽,并正式册封他为太子(上感其意,立召太子归,至是遂立之)。 + +从此朱高炽成为了太子,他终于放心了,支持他的太子党大臣们也终于放心了。 + +这场夺位之争似乎就要以朱高炽的胜利而告终,然而事实恰恰相反,这场争斗才刚开始。 + + + + + +朱高煦的阴谋(1) + + +朱高煦的阴谋 + +朱高炽被册立为太子后,自然风光无限,而朱高煦却祸不单行,不但皇位无望,还被分封到云南。 + +当时的云南十分落后,让他去那里无疑是一种发配,朱高煦自然不愿意去,但这是皇帝的命令,总不能不执行吧,朱高煦经过仔细思考,终于想出了一个不去云南的方法——耍赖。 + +他找到父亲朱棣,不断诉苦,说自己又没有犯错,凭什么要去云南,反复劝说,赖着就是不走。朱棣被他缠得没有办法,加上他也确实比较喜欢这个儿子,便收回了命令,让他跟随自己去北方巡视边界(当时尚未迁都)。 + +在跟随朱棣巡边时,朱高煦表现良好,深得朱棣欢心,高兴之余,朱棣便让他自己决定去留之地。 + +朱高煦等的就是这个机会,他告诉朱棣,自己哪里也不去,就留在京城(南京)。 + +朱棣同意了他的要求,从此,朱高煦便以京城为基地,开始谋划针对朱高炽的阴谋。 + +他广收朝中大臣为爪牙,四处打探消息,企图抓住机会给太子以致命打击。 + +朱高煦深通权术之道,他明白,要想打倒太子,必须先除去他身边的人,而太子党中最显眼的解缙就成了他首要打击的对象。在朱高煦的策划下,外加解缙本人不知收敛,永乐五年(1407),解缙被赶出京城,太子党受到了沉重打击。 + +朱高煦的第一次攻击获得了全胜。 + +但搞掉解缙不过是为下一次的进攻做准备,因为朱高煦的真正目标是被太子党保护着的朱高炽。 + +经过周密策划后,永乐十年(1412),朱高煦发动了第二次进攻。 + +朱高煦深知朝中文臣支持太子的很多,要想把文官集团一网打尽绝无可能,于是他另出奇招,花重金收买了朱棣身边的很多近臣侍卫,并让这些人不断地说太子的坏话,而自永乐七年后,由于朱棣要外出征讨蒙古,便经常安排太子监国(代理国家大事),在这种情况下,精于权术的朱高煦终于等到了一个最佳的进攻机会。 + +朱高煦聪明过人,他跟随朱棣多年,深知自己的这位父亲大人虽然十分精明且长于权谋诡计,却有一个弱点——多疑。 + +而太子监国期间,正是他的这种弱点爆发的时刻,因为他多疑的根源就在于对权力的贪婪,虽然由于出征不得不将权力交给太子,但这是迫不得已的,朱高煦相信,所有关于太子急于登基,抢班夺权的传闻都会在朱棣的心中引发一颗颗定时炸弹。 + +朱高煦的策略是正确的,他准确地击中了要害,在身边人的蛊惑下,不容权力有失的朱棣果然开始怀疑一向老实的太子的用心。 + +永乐十年(1412)九月,朱棣北巡回京,对太子搞了一次突然袭击,审查了其监国期间的各项工作,严厉训斥了太子,并抓了一大批太子身边的官员,更改了太子颁布的多项政令。 + +朱棣的这种没事找事的找茬行为让大臣们十分不满,他们纷纷上书,其中言辞最激烈的是大理寺丞耿通,他直言太子没有错,不应该更改(太子事无大过误,无可更也)。 + +但直言的耿通却绝不会想到,他的这一举动可正中朱棣下怀, + +耿通算是个做官没开窍的人,他根本不懂得朱棣这些行为背后的政治意义,欲加之罪,何患无辞!人家本来就是来找茬踢场子的,不过随意找个借口,是直接奔着人来的,多说何益! + +朱棣却是一个借题发挥的老手,他由此得到了启发,决定向耿通借一样东西,以达到自己的目的。 + +这样东西就是耿通的脑袋。 + +随后,朱棣便煞费苦心地演了一出好戏。 + +他把文武百官集合到午门,用阴沉的眼光扫视着他们,怒斥耿通的罪行(好像也没什么罪行),最后斩钉截铁地说道:像耿通这样的人,一定要杀(必杀通无赦)! + +如此杀气腾腾,群臣无不胆寒,但大臣们并不知道,这场戏的高潮还没有到。 + +耿通被处决后,朱棣集合大臣们开展思想教育,终于说出了他演这场戏最终的目的: + +“太子犯错,不过是小问题,耿通为太子说话,实际上是离间我们父子,这样的行为绝对不能宽恕,所以我一定要杀了他(失出,细故耳。。。离间我父子,不可恕)! + +至此终于原形毕露。 + +耿通无非是说太子没错而已,怎么扯得到离间父子关系上,这个帽子戴得实在不高明却也说出了朱棣的真意: + +朱高炽,老子还没死呢,你老实点! + +太子地位岌岌可危,太子党被打下去一批,朱高炽本人经过这?打击,也心灰意冷,既然让自己监国,却又不给干事的权利,做事也不是,不做事也不是,这不是拿人开涮吗? + +在这关键时刻,一个大臣挺身而出,用他的智慧稳住了太子的地位。 + +这个人就是我们之前说过的杨士奇。 + + + + + +朱高煦的阴谋(2) + + +杨士奇虽然学问比不上解缙,他的脑袋可比解缙灵活得多,解缙虽然也参与政治斗争,却实在太嫩,一点也不知道低调做官的原则。本来就是个书生,却硬要转行去干政客,隔行如隔山,水平差的太远。 + +杨士奇就大不相同了,此人我们介绍过,他不是科举出身,其履历也很复杂,先后干过老师、教育局小科员、逃犯(其间曾兼职教师)等不同职业,社会背景复杂,特别是他在社会上混了二十多年,也算跑过江湖,黑道白道地痞混混估计也见过不少,按照今天的流动人口规定,他这个流动了二十年的人是绝对的盲流,估计还可以算是在道上混过的。 + +朝廷就是一个小社会,皇帝大臣们和地痞混混也没有什么区别,不过是吃得好点,穿得好点,人品更卑劣,斗争更加激烈点而已,在这里杨士奇如鱼得水,灵活运用他在社会上学来的本领,而他学得最好,也用得最好的就是:做官时一定要低调。 + +他虽然为太子继位监国出了很多力,却从不声张,永乐七年(1409)七月,太子为感谢他一直以来的工作和努力,特别在京城闹市区繁华地带赐给他一座豪宅,换了别人,估计早就高高兴兴地去拿钥匙准备入住,可杨士奇却拒绝了。 + +他推辞了太子的好意,表示自己房子够住,不需要这么大的豪宅。 + +这个世界上没有人会嫌房子多,杨士奇也不例外,他拒绝的原因其实很简单,如果他拿了那栋房子,就会成为朱高煦的重点打击目标,权衡利弊,他明智地拒绝了这笔横财。 + +杨士奇虽然没有接受太子的礼物,但他对太子的忠诚却是旁人比不上的,应该说他成为太子党并不完全是为了投机,很大程度上是因为他对太子的感情。 + +自永乐二年(1404)朱高炽被立为太子后,杨士奇就被任命为左中允(官名),做了太子的部下,朱高炽虽然其貌不扬,却是个真正仁厚老实的人,经常劝阻父亲的残暴行为,弟弟朱高煦屡次向他挑衅,阴谋对付他,朱高炽却一次又一次的容忍了下来,甚至数次还帮这个无赖弟弟说情。 + +这些事情给杨士奇留下了深刻的印象,他虽然历经宦海,城府极深,儿时母亲对他的教诲却始终记在心头,仗义执言已经成为了他性格中的一部分,虽然很多年过去了,他却并没有变,他还是当年的那个正气在胸的杨士奇。 + +眼前的朱高炽虽然形象不好,身体不便,却是一个能够仁怀天下的人,他将来一定能成为一个好皇帝的,我相信自己的判断。 + +秉持着这个信念,杨士奇与太子同甘共苦,携手并肩,走过了二十年历经坎坷的储君岁月。 + +说来也实在让人有些啼笑皆非,可能是由于杨士奇过于低调,连朱棣也以为杨士奇不是太子党,把他当成了中间派,经常向他询问太子的情况,而在永乐十年(1412)的风波之后,朱棣对太子也产生了怀疑,便向杨士奇询问太子监国时表现如何。 + +这看上去是个很简单的问题,实际上却暗藏杀机。 + +城府极深的杨士奇听到这句问话后,敏锐地感觉到了这一点,他立刻意识到,决定太子命运的关键时刻来到了。 + +他紧张地思索着问题的答案。 + +趁着杨士奇先生还在思考的时间,我们来看一下为什么这个问题难以回答又十分关键。 + +如果回答太子十分积极,勤恳做事,和群众(大臣)们打成一片,能独立处理政事,威望很高的话,那太子一定完蛋了。 + +你爹还在呢,现在就拉拢大臣,独立处事,想抢班夺权,让老爹不得好死啊。 + +既然这个答案不行,那么我们换一个答案: + +太子平时积极参加娱乐活动,不理政事,疏远大臣,有事情就交给下面去办,没有什么威信。 + +这样回答的话,太子的结局估计也是——完蛋。 + +这又是一个非常类似二十二条军规的矛盾逻辑。 + +太子的悲哀也就在此,无数太子就是这样被自己的父亲玩残的,自古以来,一把手和二把手的关系始终是处理不好的,在封建社会,皇帝就是一把手,太子就是二把手,自然逃脱不了这个规则的制约。 + +你积极肯干,说你有野心,你消极怠工,说你没前途。 + +干多了也不行,干少了也不行,其实只是要告诉你,不服我是不行的 + +让你干,你就不得休息,不让你干,你就不得好死。 + +这似乎是很难理解的,到底是什么使得这一滑稽现象反复发生呢? + +答案很简单:权力。 + +谁分我的权,我就要谁的命!(儿子也不例外) + +朱棣很明白,他最终是要将权力交给太子的,而在此之前,太子必须有一定的办事能力,为了帝国的未来,无能的废物是不能成为继承人的,所以必须给太子权力和锻炼的机会,但他更明白,要想得一个善终,混个自然死亡,不至于七八十岁还被拉出去砍头,就必须紧紧握住自己手中的权力,直到他死的那一天! + +儿子是不能相信的,老婆是不能相信的,天下人都是不能相信的 + +这就是皇帝的悲哀。 + + + + + +朱高煦的阴谋(3) + + +好了,现在杨士奇先生已经完成了他的思索,让我们来看看他的答案: + +“太子监国期间努力处理政事,能够听取大臣的合理意见,但对于不对的意见,也绝不会随便同意,对于近臣不恰当的要求,他会当面驳斥和批评。” + +这就是水平啊,在朱棣举办的现场提问回答活动中,杨士奇能够在规定时间内想出这种两全其美的外交辞令,实在不简单。 + +既勤恳干活礼贤下士,又能够群而不党,与大臣保持距离,在杨士奇的描述下,朱高炽那肥头大耳的形象一下子变得光辉照人。 + +朱棣听了这个答案也十分满意,脸上立刻阴转晴,变得十分安详,当然最后他还不忘夸奖杨士奇,说他是一个尽职尽责的人。 + +在这场看不见硝烟的战争中,朱棣和杨士奇各出绝招,朱棣施展的是武当长拳,外柔内刚,杨士奇则是太极高手,左推右挡,来往自如。 + +从这个角度来看,他们似乎可以算是武当派的同门师兄弟。 + +于是,永乐十年(1412)的这场纷争就此结束,太子党受到了沉重打击,太子被警告,地位也有所动摇,但由于杨士奇等人的努力,终于稳定住了局势。 + +可是太子前面的路还很长,只要朱棣一天不死,他就会不断受到朱高煦的攻击,直到他登上皇位或是中途死去。 + +事实也是如此,另一个更大的阴谋正在策划之中,对太子而言,这也将是他监国二十年中经受的最严酷的考验。 + +在朱高煦持续不断地诬陷诋毁下,朱棣确实对太子有了看法,但暂时也没有换太子的想法,皇帝这样想,下面的大臣们可不这样想。 + +看到朱棣训斥太子,许多原先投靠太子准备投机的官员们纷纷改换门庭,成为了朱高煦的党羽,但杨士奇却始终没有背弃太子,他一直守护着这个人,守护在这个看上去迟早会被废掉的太子身边。 + +大浪淘沙,始见真金。 + +不久之后,一场更大的风暴到来了,太子和杨士奇将接受真正的考验。 + +永乐十二年(1414)九月,朱棣北巡归来,当时太子及其下属官员奉命留守南京,闻听这个消息,立刻派人准备迎接,但迎接时由于准备不足,有所延误,朱棣很不高兴。 + +其实说来这也就是个芝麻绿豆的小事,朱棣同志平日经常自行骑马出入大漠等不毛之地,陪同的人也不多,像迎驾这种形象工程有没有是不大在乎的。所以太子朱高炽虽然心中不安,却也没多想。 + +然而后来事情的发展大大出乎了朱高炽的意料。 + +朱棣大发雷霆,把朱高炽狠狠骂了一顿,大概意思是老子在外面打仗那么辛苦,也是为了你将来的江山打基础,你却连个基本迎接工作都做不好,要你这个废物有什么用? + +朱高炽挨骂了,心里非常委屈:不就是稍微晚了点,至于搞得这么大吗? + +至于,非常至于。 + +朱高炽不知道的是,在此之前,他的好弟弟朱高煦不断打探他的行动,虽然并没有什么发现,但政治家朱高煦先生整人是从来不需要事实的,他不断编造太子企图不轨的各种小道消息,并密报给朱棣。 + +朱棣开始并不相信,之后禁不住朱高煦长年累月的造谣,加上身边被朱高煦买通的人们也不断说坏话,他渐渐地又开始怀疑起太子来。 + +屋漏偏逢连夜雨,没想到回来就碰上了太子迎驾迟缓这件事,虽然这并不是个大事情,但在朱棣那里却变成了导火线。在朱棣看来,这是太子藐视他的一种表现。 + +自己还没有退休呢,就敢这么怠慢,将来还得了?! + +在朱高煦的推波助澜下,事情开始一边倒,太子受到严厉斥责的同时,太子党的主要官员如尚书蹇义、学士黄淮、洗马(官名,不是马夫)杨溥都被抓了起来,关进了监狱。 + +最黑暗的时刻终于到来了。 + +在朱高煦的精心组织策划和挑拨下,朱棣的怒火越烧越旺,太子党几乎被一网打尽。 + +朱棣已经认定太子党那帮人都想着自己早死,然后拥立太子博一个功名,他对太子的失望情绪也达到了顶点。他不再相信拥护太子的那些东宫文官们,除了一个人外。 + +这个例外的人就是杨士奇。 + +说来奇怪,虽然杨士奇一直在太子身边,朱棣却一直认为他是一个公正客观的人,于是在两年后,朱棣再次召见他,问了他一个问题。 + +与两年前一样,这也是一次生死攸关的问答。 + + + + + +无畏的杨士奇 + + +无畏的杨士奇 + +当时的政治局势极为复杂,由于朱棣公开斥责太子,且把太子的很多亲信都关进了监狱,于是很多大臣们都认为太子已经干不了多久了,倒戈的倒戈,退隐的退隐,太子也朱高炽陷入了孤立之中,现实让他又一次见识了世态炎凉,人情冷暖 + +原先巴结逢迎的大臣们此时都不见了踪影,唯恐自己和太子扯上什么关系,连累自己的前途,在这种情况下,杨士奇开始了他和朱棣的问答较量。 + +这次朱棣没有遮遮掩掩,他直接了当地问杨士奇,太子是否有贰心,不然为何违反礼仪,迟缓接驾?(这在朱棣看来是藐视自己) + +在此之前,也有人也劝过杨士奇要识时务,太子已经不行了,应该自己早作打算。 + +杨士奇用自己的答案回复了朱棣,也回复了这些人的“建议”。 + +杨士奇答道:“太子对您一直尊敬孝顺,这次的事情是我们臣下没有做好准备工作,罪责在我们臣下,与太子无关。”(太子孝敬,凡所稽迟,皆臣等罪) + +说完,他抬起头,无畏地迎接朱棣锐利的目光。 + +朱棣终于释然了,既然不是太子的本意,既然太子并不是有意怠慢,自己也就放心了。 + +就这样,悬崖边上的朱高炽又被杨士奇拉了回来。 + +杨士奇这样做是需要勇气的,在太子势孤的情况下,主动替太子承担责任,需要冒很大的风险,要知道,朱棣不整太子,对他们这些东宫官员们却不会手软。与他一同辅佐太子的人都已经进了监狱,只剩下了他暂时幸免,但他却主动将责任归于自己,宁愿去坐牢,也不愿意牵连太子。 + +杨士奇用行动告诉了那些左右摇摆的人,不是所有的人都能被收买,不是所有的人都趋炎附势。 + +从当时的形势来看,朱高炽的太子地位被摘掉是迟早的事情,继续跟随他并不明智,还很容易成为朱高煦打击的对象,是非常危险的。所以我们可以说,在风雨飘摇中依然坚持支持太子的杨士奇,不是一个投机者。 + +就如同三十年前,他身处穷困,却仍然无私援助那位朋友一样,三十年后,他又做出了足以让自己母亲欣慰的事情。 + +三十年过去了,虽然他已身处高位,锦衣玉食,他的所作所为却并没有违背他的人生信条。 + +人穷志不短,患难见真情 + +杨士奇最终还是为他的无畏行为付出了代价,朱高煦恨他入骨,指示他买通的人攻击杨士奇(士奇不当独宥),本来不打算处置他的朱棣也禁不住身边人的反复煽动,将杨士奇关入了监狱。 + +朱高炽得知杨士奇也即将被关入监狱,十分焦急,但以他目前的处境,仅能自保,是绝对保不住杨士奇的。 + +杨士奇却不以为意,反而在下狱前对太子说:殿下宅心仁厚,将来必成一代英主,望殿下多多保重,无论以后遇到什么情况,都一定要坚持下去,决不可轻言放弃。 + +此时,朱高炽终于意识到,眼前这个即将进入监狱却还心忧自己的杨士奇其实不只是他的属下,更是他的朋友,是患难与共的伙伴。 + +太子的地位保住了,却已经成为了真正的孤家寡人,在朱高煦咄咄逼人的气势下,他还能坚持多久呢? + +朱高煦的失误 + +朱高煦终于第一次掌握了主动权,他的阴谋策划终于有了结果,太子受到了沉重打击,而帮太子说话的文官集团也已经奄奄一息,形势一片大好,前途十分光明。 + +话说回来,人有一个很大的缺点,那就是一旦得意就容易忘形,朱高煦也不例外。 + +胜利在望的朱高煦在历史书中找到了自己的偶像,并在之后的岁月中一直以此自居。 + +他的这位偶像就是唐太宗李世民,他经常见人就说:“我这么英明神武,不是很像李世民吗(我英武,岂不类秦王李世民乎)?” + +如此急切表白自我的言语,今日观之,足以让人三伏天里尚感寒气逼人,如果朱高煦出生在现代,定可大展拳脚,拍些个人写真照片,再配上自信的台词,必能一举成名。 + +朱高煦不是花痴,他这样说是有着深厚的政治寓意的。 + +大家只要想一想就能明白他的隐含意思,李世民与朱高煦一样,都是次子,李建成对应朱高炽,都是太子,甚至连他们的弟弟也有对应关系,李元吉对应朱高燧,都是第三子。 + +这样就很清楚了,李世民杀掉了李建成,当上皇帝,朱高煦杀掉朱高炽,登上皇位。 + +朱高煦导演希望把几百年前的那一幕戏再演一遍。 + +我们这?先不说朱高煦先生是否有李世民那样的水平,既然他坚持这样认为,那也没办法,就凑合吧,让他先演李世民,单从这出戏的演员阵容和所处角色上看,似乎和之前的那一幕确实十分相似。 + +但朱高煦导演也出现了一个致命的失误,他忽略了这场戏中另一个大牌演员的感受,强行派给他一个角色,这也导致了他最终的失败。 + +他要派的是这场戏的主要角色之一——李世民的父亲李渊,被挑中的演员正是他的父亲朱棣。 + +这也是没办法的事,要把这场戏演好,演完,搞一个朱高煦突破重重险阻,战胜大坏蛋朱高炽,登基为皇帝的大团圆结局,就必须得到赞助厂商总经理朱棣的全力支持。 + +朱棣不是李渊,事实上,他跟李渊根本就没有任何共通点,但他很清楚,上一幕戏中,李渊在李世民登基后的下场是被迫退位,如果这一次朱高煦像当年的李世民那样来一下,他的结局也是不会超出剧本之外的。 + +朱棣虽然不是导演,却是戏霸。 + +让我演李渊,你小子还没睡醒吧! + + + + + +太子党的反击 + + +太子党的反击 + +就在朱棣渐渐对日益嚣张的朱高煦感到厌恶时,太子党开始了自己的反击。 + +当时正值朱高煦主动向朱棣要求增加自己的护卫,这引起了朱棣的警觉,永乐十三年(1415)五月,朱棣决定改封朱高煦去青州,按说青州并不是很差的地方,但朱高煦为了夺权的需要,不肯离开京城,又开始耍赖。 + +这次朱棣没有耐心陪朱高煦玩下去了,他直截了当地告诉朱高煦:你既然已经被封,就赶紧去上任,怎么能总是赖在京城不走(既受藩封,岂可常居京邸)?! + +朱棣不断的打击太子,无非是想告诉太子不要急于夺权,但他的这一行动却给了朱高煦错误的信号,他误以为皇位非自己莫属,越发专横跋扈,最终触怒了朱棣。 + +捧得起你,自然也踩得扁你 + +太子党的精英们抓住了这个机会,发出了致命的一击,而完成这一击的人正是杨士奇。 + +由于平日表现良好,且自我改造态度积极,杨士奇和蹇义连监狱的门都没进,就被放了出来,再次被委以重任。但千万不要由此推出朱棣慈悲为怀的结论,要知道,他们的难兄难弟杨溥还在监狱里看书呢,而且一看就是十年。 + +由此可见,特赦也是有级别限制的 + +逃离牢狱之灾的杨士奇自然不会洗心革面,与朱高煦和平相处,在经过长期的观察和对时局的揣摩后,他敏锐地抓住了机会,发动了攻击。 + +说来似乎有点不可思议,与前两次一样,他的这次攻击也是通过问答对话的形式完成的。 + +此次对话除了朱棣和杨士奇外,蹇义也在场,不过他的表现实在让人失望。 + +朱棣问:“我最近听到很多汉王(朱高煦封号)行为不法的传闻,你们知道这些事情吗?” + +这话是对杨士奇和蹇义两个人问的,但两人的反应却大不相同。 + +蹇义虽然忠于太子,却也被整怕了,他深恐这又是一个陷阱,要是实话实说,只怕又要遭殃,便推说自己不知道。 + +朱棣失望地转向了另一个人——杨士奇,他注视着杨士奇,等着他的答复。 + +杨士奇等待这一天已经很久了 + +经历了那么多的波折和阴谋,自己身边的同伴不是被杀掉,就是被朱高煦整垮,为了自己的信念,他忍耐了很久,他曾经有很多机会向朱棣揭发朱高煦的不轨行为,但作为一个政治老手,他十分清楚权力斗争就如同剑客比武,一击必杀才是制胜的王道,因为一旦宝剑出鞘,就没有收回的余地。 + +朱棣已经丧失了对朱高煦的信任,他已经渐渐看清自己这个儿子的真面目,这是最好的机会,机不可失,失不再来! + +拔剑出鞘! + +杨士奇从容答道:“我和蹇义一直在东宫服侍太子,人家就把我们看成太子的人(还装,难道你不是吗),有什么话也会不跟我们讲,所以我们不知道。” + +奇怪了,这句回答不是和蹇义一样,啥也没说吗? + +要知道,自古以来最狠的整人方法就是先夸你,再骂你,杨士奇熟练地运用了这一技巧。所以别急,下面还有个但是呢。 + +“但是,汉王两次被封都不肯到地方就藩,现在陛下要迁都了,在这个时候,他要求留在南京,希望陛下仔细考虑一下他的用意。”(惟陛下熟察其意) + +细细品来,杨士奇此言实在厉害,看似平淡无奇,却处处透着杀机,要把朱高煦往死里整,杨士奇之权谋老到实在让人胆寒。 + +杨士奇终于亮出了他的宝剑,在正确的时间,正确的地点,对正确的人,使出了那一剑。 + + + + + +一剑封喉 + + +一剑封喉 + +朱棣被杨士奇的话震惊了,朱高煦三番两次不肯走,如今要迁都了,他却执意留在南京,他到底想干什么?! + +不能再拖了,让他马上就滚! + +永乐十五年(1417)三月,不顾朱高煦的反复哀求,朱棣强行将他封到了乐安州(今山东广饶),朱高煦十分不满,但也没有办法,他已经意识到,自己此生注定不可能用合法手段登上皇位了 + +朱棣确实是一个老谋深算的人,如果我们翻开地图察看的话,就会发现他似乎已经预见到了自己的这个儿子将来不会老实,于是在封地时,便已做好了打算。乐安州离北京很近,离南京却很远,将朱高煦调离他的老巢,安置在天子眼皮底下,将来就算要打,朝发夕至,很快就能解决,不能不说是一招好棋。 + +至少在这一点上,朱棣要比他的父亲高明。 + +至此,储君之争暂时告一段落,太子党经过长期艰苦的斗争,稳住了太子的宝座,也为后来仁宣盛世的出现提供了必要条件。 + +另一方面,朱高煦多年的图谋策划最终付之东流,至少朱棣绝对不会再考虑立他为太子了,但这位仁兄自然也是不会死心的,他把自己的阴谋活动完全转入地下,并勾结他的同党准备东山再起。 + +不过这一次他不打算继续搞和平演变了,因为在他面前只剩下了一条路——武装夺权。 + +虽然方针已经拟定,但朱高煦还是很有自知之明的,自己老爹打仗有多厉害,他比谁都清楚,只要他还是一个精神正常的人,就绝对不会在自己老爹头上动土。 + +朱高煦决定等待,等到时机成熟的那一天。 + + + + + +最后的秘密 + + +第十章 最后的秘密 + +平定天下,迁都北京,修成大典,沟通南洋,威震四海,平定安南,打压蒙古 + +以上就是朱棣同志的主要政绩史。在执政的前十几年中,他不停地忙活,不停地工作,付出了许多心血,也获得了许多成就,正是这些成就为他赢得了一代英主的名誉。 + +他做了历史上很多皇帝都没有做到的事情,但他并未感到丝毫疲惫,因为在朱棣的心目中,权力就是他工作的动力,手握权力的他就如同服用了兴奋剂一样,权力对他而言已经变成了一种毒品,一分一秒也离不开,任何人也无法夺走。 + +像他这样的人似乎是没有也不可能有朋友的。 + +但朱棣还是有朋友的,在我看来,至少有一个。 + + + + + +告 别 + + +告别 + +永乐十六年(1418)三月北京庆寿寺 + +朱棣带着急促的脚步走进了寺里,他不是来拜佛的,他到这里的目的,是要向一个人告别,向一个朋友告别。 + +八十四岁的姚广孝已经无力起身迎接他的朋友,长年的军旅生涯和极其繁重的参谋工作耗干了他的所有精力,当年那个年过花甲却仍满怀抱负的阴谋家不见了,取而代之的只是一个躺在床上的无力老者。 + +此时的姚广孝感慨良多,洪武十八年(1385)的那次相遇不但改变了朱棣的一生,也改变了自己的命运。自此之后,他为这位野心家效力,奇计百出,立下汗马功劳,同吃同住同劳动(造反应该也算是一种劳动)的生活培养了他和朱棣深厚的感情,朱棣事实上已经成为了他的朋友。 + +这并不奇怪,野心家的朋友一般都是阴谋家。 + +在朱棣取得皇位后,姚广孝也一下子从穷和尚变成了富方丈,他可以向朱棣要房子、车子(马车)、美女、金银财宝,而朱棣一定会满足他的要求。因为作为打下这座江山的第一功臣,他完全有这个资格。 + +可他什么也不要 + +金银赏赐退了回去,宫女退了回去,房屋宅第退了回去,他没有留头发,还是光着脑袋去上朝,回家后换上僧人服装,住在寺庙里,接着做他的和尚。 + +他造反的目的只是为了实现自己的抱负,抱负实现了,也就心满意足了。此外,他还十分清楚自己的那位“朋友”朱棣根本不是什么善类,他是绝对不会容忍一个知道他太多秘密,比他还聪明的人一直守在身边的。 + +所以他隐藏了自己,只求平静地生活下去。 + +综观他的一生,实在没有多少喜剧色彩,中青年时代不得志,到了60岁才开始自己的事业,干的还是造反这个整日担惊受怕,没有劳动保险的特种行业。等到造反成功也不能太过招摇,只能继续在寺庙里吃素,而且他也没有类似抽烟喝酒逛窑子的业余爱好,可以说,他的生活实在很无趣 + +他谋划推翻了一个政权,又参与重建了一个政权,却并没有得到什么,而在某些人看来,他除了挣下一个助纣为孽的阴谋家名声外,这辈子算是白活了。 + +他的悲剧还不仅于此,他之前的行为不过是各为其主罢了,也算不上是个坏人,他还曾经劝阻过朱棣不要大开杀戒,虽然并没有成功,却也能看出此人并非残忍好杀之辈。 + +但这并不能减轻他的恶名,因为他毕竟是煽动造反的不义之徒,旁人怎么看倒也无所谓,最让他痛苦的是,连他唯一的亲人和身边的密友也对他嗤之以鼻。 + +永乐二年(1404)八月,姚广孝回到了家乡长州,此时他已经是朝廷的重臣,并被封为太子少师,与之前落魄之时大不相同,可以说是衣锦还乡,但出乎他意料的事情发生了。 + +父母已经去世,他最亲的亲人就是他的姐姐,他兴冲冲地赶去姐姐家,希望自己的亲人能够分享自己的荣耀,但他的姐姐却对他闭而不见(姊不纳),无奈之下,他只好去见青年时候的好友王宾,可是王宾也不愿意见他(宾亦不见),只是让人带了两句话给他,这两句话言简意赅,深刻表达了王宾对他的情感: + +和尚误矣!和尚误矣! + +姚广孝终于体会到了众叛亲离的滋味,原先虽然穷困,但毕竟还有亲人和朋友,现在大权在握,官袍加身,身边的人却纷纷离他而去。 + +耳闻目睹,都带给姚广孝极大的刺激,从此他除了白天上朝干活外,其余的时间都躲在寺庙里过类似苦行僧的生活,似乎是要反省自己以前的行为。 + +这种生活磨练着他的身体,却也给他带来了长寿,这位只比朱元璋小七岁的和尚居然一口气活到了八十四岁,他要是再争口气,估计连朱棣都活不过他,有望打破张定边的纪录。 + +但这一切只是假设,现在已经奄奄一息的他正躺在床上看着自己这位叫朱棣的朋友 + +心情复杂的朱棣也注视着姚广孝,像他这样靠造反起家的人最为惧怕的就是造反。所以他抓紧了手中的权力,怀疑任何一个靠近他的人,而眼前的这个人是唯一例外的。这个神秘的和尚帮助他夺取了皇位,却又分毫不取,为人低调,他了解自己的脾气,性格和所有的一举一动,权谋水平甚至超过了自己,却从不显露,很有分寸。这真是个聪明人啊! + +只有这样的聪明人才能做朱棣的朋友。 + +在双方的这最后一次会面中,他们谈了很多,让人奇怪的是,他们谈的都是一些国家大事,姚广孝丝毫未提及自己的私事,这似乎也很正常,大家相处几十年,彼此之间十分了解,也就没有什么私事可说了的吧。 + +朱棣很清楚,姚广孝已经不行了,这是一个做事目的性很强的人,自然不会无缘无故在生命的最后时刻找自己聊国家大事,他一定会提出某个要求。 + +朱棣和姚广孝如同老朋友一般地继续着交谈,但在他们的心底,都等待着最后时刻的到来。 + +话终于说完了,两人陷入了沉默之中。 + +姚广孝终于开口了,他提出了人生中最后一个要求: + +“请陛下释放溥洽吧。” + + + + + +朱棣默然(1) + + +朱棣默然 + +不出所料,他果然提出了这个要求 + +堪称当世第一谋士的姚广孝临死前提出的竟然是这样的一个要求,这个溥洽到底是什么人呢,能够让姚广孝在生命的最后一刻仍然如此挂念他的安危? + +其实溥洽的个人安危并不是那么重要,只是因为这个人的身上隐藏着一个秘密,隐藏着朱棣追寻十余年而不得的一个答案。 + +这个秘密就是建文帝的下落。 + +十六年前,一场大火焚毁了皇宫,同时也隐灭了建文帝朱允炆的踪迹,等到朱棣带领大群消防队员赶到现场的时候,留给他的只是一堆废墟和活不见人死不见尸的尴尬局面。 + +从此建文帝的下落就成了他的心头大患,为了找出这个问题的答案,朱棣想尽各种办法四处找人,只要有任何蛛丝马迹,他就会抓住不放。 + +也就在此时,有人向他告密,还有一个人知道建文帝的下落,这个人就是溥洽。 + +溥洽是建文帝朱允炆的主录僧,据说当时正是他安排朱允炆出逃的,虽是传闻,但此人与朱允炆关系密切,他确实很有可能知道朱允炆的下落。 + +朱棣听说后大喜,便将溥洽关进了监狱,至于他是否拷打过溥洽,溥洽如何回应,史无记载,我们自然也不知道。但我们可以肯定的是,他并没有从溥洽的口中得到他想要的东西,因为直到二十年后他临死前方才找到了问题的答案。 + +但溥洽却从此开始难见天日,他不但是一个特殊的政治犯,还是一个绝对不会被释放的政治犯,原因很简单,他不说出朱允炆的下落,自然不会放他,而如果他说了出来,朱棣也决不会把这个知情人释放出狱,依着朱棣的性格,还很有可能杀人灭口,一了百了。 + +如无意外,溥洽这一辈子就要在牢房里度过了。 + +但是现在,意外发生了。 + +朱棣知道姚广孝这个要求的分量,溥洽是不能放的,但这毕竟是自己老朋友这一生中的最后一个愿望,实在难以抉择。 + +姚广孝目不转睛地看着沉默中的朱棣,他知道眼前的这位皇帝正在思考,准备做出决定。 + +“好吧,我答应你” + +姚广孝释然了,他曾亲眼看见在自己的阴谋策划之下,无数人死于非命,从方孝孺到黄子澄,凌迟、灭族,这些无比残忍的罪行就发生在自己面前,他曾劝阻过,却无能为力。虽然这些人并非直接死在自己手上,但他确实是这一切的始作俑者。 + +虽然他不是善男信女,但他也不是泯灭人性的恶魔。残酷的政治斗争和亲人朋友的离去让他开始反思自己的行为,很多人因为他而死去,他却背负着罪恶活了下来。 + +所以在他生命的最后时刻,他提出了这个要求。 + +不是为了救赎溥洽,而是为了救赎他自己的灵魂。 + +精神上得到解脱的姚广孝最终也得到了肉体的解脱,三月十八日,姚广孝病死于北京庆寿寺,年八十四。 + +这位永乐年间最伟大的阴谋家终于含笑离开了人世,他付出了很多,却似乎并没有得到什么,他的前半生努力实践着自己的抱负,后半生却背负着罪恶感孤独地生活着。 + +无论如何,对于他而言,一切都已结束。 + +朱棣遵守了他的诺言,放出了溥洽,不是因为仁慈,而是出于对老朋友的承诺。 + +皇位夺下来了,首都迁过去了,大典修完了,南洋逛遍了,安南平定了,瓦剌鞑靼没戏唱了。 + +现在唯一的老朋友也走了。 + +这场戏演到现在,也差不多了,当年三十一岁的青年朱棣起兵造反,最终夺得天下,之后他又开始了自己的统治,创造了属于他的时代。 + +在这漫长而短暂的几十年中,该做的事情他做了,不该做的事情他也做了。但综合来看,他确实是一位历史上少有的雄才大略的皇帝。上面列出的那些政绩里的任何一条都很难做到、做好,但他却用短短十几年的时间就全部完成了。 + +做皇帝做到他这个份上,实在不容易啊。 + +按说有如此功绩,朱棣也应该心满意足了,但其实不然,在他坐在皇位上的每一个白天,睡在寝宫里的每一个夜晚,有一件事情总是缠绕在他的心头,如噩梦般挥之不去,斩之不绝。 + + + + + +朱棣默然(2) + + +是的,雄才大略的朱棣在他执政的每一个日日夜夜都挂念着这件事,恐惧着这件事。 + +朱允炆,你到底是死是活,现在何方?! + +朱棣,不用再等多久了,你很快就会知道答案。 + +永乐二十年(1422),欠收拾的阿鲁台又开始闹事,他率军大举进攻明朝边境,其本意只是小打小闹,想干一票抢劫而已,估计明朝也不会把他怎么样,这一套理论用在别人身上有可能行得通,但可惜的是,他的对手是从不妥协的朱棣。 + +朱棣听说这个十二年前被打服的小弟又不服了,也不多说,虽已年届花甲(当时五十五岁),好勇斗狠的个性却从未减退。 + +不服就打到你服为止! + +同年三月,朱棣又一次亲征,大军浩浩荡荡向鞑靼进发,一路上都没有遇到什么像样的抵抗,到了七月,大军抵达沙珲原(地名),接近了阿鲁台的老巢。 + +阿鲁台实行不抵抗政策,是否有什么后着呢? + +答案是没有。 + +阿鲁台不抵抗的原因很简单,他没有能力抵抗。 + +这位当年曾立志于恢复蒙古帝国的人已经蜕变成了一个小毛贼,只能抢抢劫,闹闹事,他没有退敌的办法,唯一的应对就是带着老婆孩子跑路。 + +荡平了阿鲁台的老巢后,朱棣准备班师回朝,由于当时兀良哈三卫与阿鲁台已经互相勾结,所以朱棣决定回去的路上顺便教训一下这个当年的下属。 + +他命令部队向西开进,并说道:“兀良哈知道我军前来,必然向西撤退,在那里等着他们就是了。” + +部下们面面相觑,人家往哪边撤退,你是怎么知道的? + +可是皇帝说话,自然要听,大军随即向西边转移,八月到达齐拉尔河,正好遇到了兀良哈的军队及部落。 + +兀良哈十分惊慌,朱棣却十分兴奋,按照现在的退休制度,他已经到了退休年龄,虽然按照级别划定,他应该是厅级以上干部,估计还能干很长时间,但中国历史上,皇帝到了他这个年纪,还亲自拿刀砍人的实在是少之又少。 + +值此遇敌之时,他横刀立马,以五十五岁之高龄再次带领骑兵亲自冲入敌阵,大破兀良哈(斩首数百级,余皆走散)。 + +此后他又率军追击,一举扫平了兀良哈的巢穴,这才心满意足地回了家。 + +从朱棣的种种行为经历来看,他是一个热爱战争陶醉于战争的人,是一个天生的战士。 + +上天并没有亏待这位喜欢打仗,热爱战争的皇帝,仅仅一年之后,他又一次亲征鞑靼,不过这次出征的缘由却十分奇特,很明显是没事找事。 + +永乐二十一年(1423)七月,边关将领报告阿鲁台有可能(注意此处)会进攻边界,本来这不过是一份普通的边关报告,朱棣却二话不说,马上准备亲征。 + +人家都说了,只是可能而已,而且边关既然能够收到情报,必然有准备,何需皇帝陛下亲自出马? + +就算阿鲁台真的想要袭击边界,估计他也会说:“我还没动手呢,就算打也是小打,你干嘛搞这么大阵势?” + +其实朱棣的动机十分简单: + +实话说了吧,就是想打你,你能怎么样? + +看来先发制人的政策绝非今日某大国首先发明的,这是历史上所有的强者通用的法则。 + +同年八月,朱棣第四次亲征,千里之外的阿鲁台得到消息后,马上就开始收拾东西,准备溜号。他已经习惯了扮演逃亡者,并掌握了这一角色的行动规律和行为准则——你来我就跑,安全第一。 + +这是一次不成功的远征,由于阿鲁台逃得十分彻底,朱棣什么也没有打着,只好班师回朝。 + +虽然此次远征并无收获,朱棣却在远征途中获得了一件意想不到的礼物,一件对他而言价值连城的礼物。 + +这件礼物就是他已苦苦寻觅二十年的答案。 + + + + + +最后的答案(1) + + +最后的答案 + +胡濙终于回来了 + +十六年前,他接受了秘密的使命,独自出行两湖江浙,探访大小寺庙,只为了寻找朱允炆的行踪,十年之间费尽心力,却毫无收获。 + +胡濙十分清楚,朱棣绝对不是一个可以商量的人,自他接受这个任务起,自己的命运就只剩下了两种结局,要么找到朱允炆,要么继续寻找,直到自己死去,另一个人来接替他。 + +没有同伴,没有朋友,不能倾诉也无法倾诉,胡濙就这样苦苦寻找了十几年,这期间他没有回过家,连母亲去世他也无法回家探望,因为在使命完成之前,他没有回家的权力。 + +朱棣也并不是刻薄的人,他深知这项工作的辛苦,永乐十四年(1414),他终于召胡濙回来,并任命他为礼部左侍郎,从小小的给事中一下子提拔为礼部的第二把手,胡濙成为了众人羡慕的对象,但只有朱棣和胡濙本人才知道,这一切不过是对胡濙从事的秘密工作的报答。 + +历时十年,胡濙没有能够找到朱允炆,他只得回到朝廷做他的官。 + +这个人真的还存在吗?或许这一辈子也找不到他了吧。 + +三年后的一次任命打破了胡濙的幻想。 + +永乐十七年(1419),朱棣再次命令胡濙出巡江浙一带,这次任命看似普普通通,实际上是另一次寻找的开始。我们有理由相信,这次朱棣是获得了准确的情报,朱允炆就在这一带! + +一定要找到他! + +然而胡濙这一去又是几年毫无音信,这下子连朱棣也几乎丧失了信心。 + +胡濙一直在找,朱棣一直在等,二十年过去了,两个青年人的约定变成了老年人的约定,朱棣的身体也是一天不如一天,恐怕等不了多久了,但约定还在继续,也必须继续下去。 + +就在看上去朱允炆即将被划入永远失踪人口时,事情出现了意想不到的转机 + +这个悬疑长达二十年的问题终于得到了解答,在一个神秘的夜里。 + +永乐二十一年(1423)的一个深夜,远征途中的朱棣正在他的行在内睡觉(帝已就寐),忽然内侍前来通报,说有人前来进见。 + +被吵醒了的朱棣很不高兴,这也是人之常情,即使普通人也不愿意在熟睡之际被人从美梦中惊醒,但当内侍说出前来进见的人的名字时,朱棣如同触电一般地立刻睡意全消,他命令马上召见此人。而这个深夜前来吵醒朱棣的人正是胡濙。(闻濙至,急起召入) + +朱棣的心中充满了兴奋、期待、和恐惧,他十分清楚,如果没有他的命令,胡濙是绝不可能私自回来的。而此刻胡濙不经请示,深夜到访必然只有一个原因——他找到了那个人。 + +胡濙见到了朱棣,告诉了他自己所知道的一切,两人交谈了很长时间(悉以所闻对,漏下四鼓乃出。。。至是疑始释)。 + +相信很多人都会问,他们到底谈了些什么,这个悬疑二十年的谜团的谜底到底是什么? + +我必须饱含悲痛地告诉大家,我也不知道。 + +坦率地说,现在说出这句话,我也很惭愧,胡濙最终没有忽悠朱棣,他虽然让朱棣等了十六年,但确实带给了他答案。 + +而从我讲这个谜团开始,到现在谜团结束,中间穿插了无数历史事件,也已经过去了很长时间,但我最终还是不能给大家一个肯定的答案。 + +说实话,这似乎也不能怪我,之前已经说过,此文是采集多种史料经过本人自己的分析辨别写成,虽然也采用过一些明清笔记杂谈之类的记载,但主要依据的还是明实录、明史等正史资料。 + +我这人胆子并不算小,但如此重大的历史悬疑问题,也实在不敢乱编,史料上没有,我自然也不能写有。不过大家也不用失望,因为我虽然不能给出结论,却能够推理出一个结论。 + +要知道,史料是死的,人却是活的,历史学家的职责之一就是从过往的死文字中发现活的秘密。 + +下面我们就开始这段推理,力争发现历史背后隐藏的真相,在这段推理过程中,我们将得到三个推论: + +首先,从上面的这段记载我们可以知道,胡濙的使命确实是寻找建文帝,而朱棣在深夜被吵醒还如此兴奋,其原因我们也已经分析过了,除非已经完成使命,胡濙是绝对没有胆子敢擅离职守的。 + +由此我们得到推论1: 胡濙完成了他的使命,带来了建文帝的消息。 + +接下来是最重要的部分,也是争议最多的部分,胡濙到底对朱棣说了什么? + +这似乎是个死无对证的问题,但其实只要在推论1的基础上抓住蛛丝马迹?行一些推理辨别,我们就可以知道在那个夜晚两人交谈的内容。 + + + + + +最后的答案(2) + + +胡濙深夜到访,会对朱棣说些什么呢?有以下几种可能: + +A:我没有找到建文帝,也没有他的消息,这么晚跑来吵醒你是想逗你玩的。 + +结论:不可能 + +原因:朱棣不会把如此重要的工作交给一个精神不正常的人。 + +B: 我找到了建文帝的下落,但他已经死了。 + +结论:可能性较小 + +原因:虽然本人当时并不在场,我却可以推定胡濙告诉朱棣的应该不是这句话,因为在史书中有一句极为关键的话可以证明我的推论 + +“悉以所闻对,漏下四鼓乃出” + +看到了吗,“漏下四鼓乃出”!如果说一个人已经死掉,就算你是验尸的,无论如何也不可能讲这么长时间,胡濙为人沉稳寡言,身负绝密使命,绝对不是一个喜欢说废话的人,所以我们可以推定,他告诉朱棣的应该不是这些。 + +我们就此得出最后的结论C + +C: 我找到了建文帝,并和他交谈过。 + +结论:很有可能 + +原因:以上两推论皆不对,此为所剩可能性最大的结论。 + +就这样,我们结合史料用排除法得到了第二个推论. + +推论2:胡濙找到了建文帝,并和他交谈过。 + +结合推论1和推论2, 我们最终来到了这个谜团的终点——建文帝对胡濙说过些什么? + +这看上去似乎是我们绝对不可能知道的,连胡濙对朱棣说了些什么我们都无法肯定,怎么能够了解到建文帝对胡濙说过什么话呢? + +其实只要细细分析,就会发现,我们是可以知道的。 + +因为建文帝对胡濙说过的话,必然就是胡濙和朱棣的谈话内容! + +胡濙不是吃饱了没事干四处找人聊天的那种官员,他肩负重要使命,且必须完成,当他找到建文帝并与之交谈后,一定会把所有的谈话内容告诉朱棣,因为这正是他任务中的最重要部分。所以我们可以肯定,在那个神秘夜晚胡濙告诉朱棣的,正是建文帝告诉胡濙的。 + +现在我们已经清楚,只要知道了胡濙和建文帝的谈话内容,就能了解胡濙和朱棣的谈话内容,那么胡濙和建文帝到底谈了些什么呢? + +可以肯定的是,他们不会谈论天气好坏,物价高低等问题,当年的臣子胡濙除了向建文帝行礼叙旧外,其谈话必然只有一个主题——你的打算。 + +陛下,你还活着,那你到底想怎么样呢? + +我们有理由相信,朱允炆给了胡濙一个答案。 + +而在那个神秘的夜里,胡濙告诉朱棣的也正是这个答案。 + +建文帝的答案到底是什么,这看上去也是我们不可能知道的秘密。 + +然而事实上,我们是可以了解这个秘密的,因为这个秘密的答案正是我们的第三个推论。 + +解开秘密的钥匙仍然在史料中——“至是疑始释” + +解脱了,彻底解脱了,二十年的疑问、忧虑、期待、愧疚、恐惧,在那个夜晚之后,全部烟消云散。 + +需要说明的是,我们同时可以推定胡濙与朱棣谈话之时,建文帝应该还活着。 + +因为胡濙是一个文臣,之后他还因为在此事上立下大功,被任命为尚书,并成为了后来的明宣宗托孤五大臣之一,在寻访过程中,为了保密,他一直是单人作业,像他这样的一个人,是干不出杀人灭口的事情的。而他深夜探访朱棣,也充分说明了在此之前,他并没有向朱棣通报过建文帝的消息。 + +当然,在谈话之后,朱棣会不会派人去斩一下草,除一下根,那也是很难说的。 + +不过我愿意相信,朱棣没有这样做,在我看来,他并不是一个灭绝人性的人,他的残忍行为只是为了保证自己的皇位,如今二十多年过去了,他也变成了一个老人,并且得到了那个答案,他也应该罢手了。 + +推论3: 答案 + +“二十年过去了,我也不想再争了,安心做你的皇帝吧,我只想一个人继续活下去。” + +我相信,这就是最后的答案,因为只有这样的答案才能平息这场二十多年的纷争,才能彻底解脱这两个人的恐惧。 + +坐在皇位上的那个,解脱的是精神,藏身民间的那个,解脱的是肉体。 + +我不会再和你争了,做一个好皇帝吧。 + +我不会再寻找你了,当一个老百姓,平静地活下去吧。 + +这场叔侄之争终于划上了句号。为了权力,这对亲人彼此之间从猜忌到仇恨,再到兵刃相见,骨肉互残,最终叔叔打败了侄子,抢得了皇位。 + +但事情并未就此结束,登上皇位的人虽然大权在握,却时刻提心吊胆,唯恐自己在某一天夜里醒来,会像上一个失败者那样失去自己刚刚得到的东西。 + +因为一无所有并不可怕,可怕的是得到后再失去。 + +被赶下去的那个人更惨,他必须抛弃荣华富贵的生活,藏身民间,从此不问世事,还要躲避当权者的追寻,唯有隐姓埋名,只求继续活下去。 + +这种残酷的心灵和肉体上的煎熬整整持续了二十年,六千多个日日夜夜的折磨,足以让任何一个人发疯。 + +得到了权力,似乎就得到了一切,但其实很多人并不明白,在权力游戏中,你没有休息的机会,一旦参加进来,就必须一直玩下去,直到你失败或是死亡。 + +得到了很多,但失去的更多。 + +这就是他们必须付出的代价,无论是成功者,还是失败者。 + +走上了这条路,就不能再回头。 + + + + + +死于征途的宿命(1) + + +死于征途的宿命 + +无论如何,朱棣终于得到了解脱,虽然来得迟了一点,但毕竟还是来了,至少他不会将这个疑问带进棺材。 + +也算是老天开眼吧,因为如果这个答案来得再晚一两年,朱棣也只能带着遗憾去见他父亲了,不过现在他终于可以心无旁顾的过几天舒服日子了。 + +朱棣的精神得到了解放,这之后的日子对他而言应该是放松而愉快的,但这恐怕也是上天对他最后的恩赐了,因为死神已经悄悄逼近了他。 + +永乐二十二年(1424)元月,阿鲁台又开始重操旧业,在明朝边界沿路抢劫,侵扰大同等地,此时朱棣的身体已经大不如前,但为了彻底解决问题,他还是十分勉强地骑上了战马,第五次率领大军出征。 + +就算不为自己着想,也要为儿子着想,帮他把对头收拾干净,将来才好安心做皇帝,就算留不下多少遗产,也给你留个太平日子吧。 + +古往今来的父爱,大抵都是如此。 + +朱棣与往常一样,挑选了几个大臣与他一同出发远征,而在他挑选的人中,有一个会在不久之后发挥极为重要的作用。 + +这个人就是杨荣。 + +六月,大军出发到达达兰纳木尔河,这里就是原先阿鲁台出没之地,然而此刻已经是人去楼空。抢劫惯犯阿鲁台早已收拾好包袱,逃之夭夭了。 + +经过反复搜寻,仍然不见阿鲁台的身影,朱棣的身体却是一天不如一天,大臣们发生了争论: + +张辅表示,愿意自己领取一个月的粮食,率领军队深入大漠,一定要把阿鲁台抓回来。 + +杨荣表示,大军已经到此,如果继续呆下去,粮草必然无法充足供应,必须尽早班师。 + +朱棣木然地听完他们的争论,下达了命令: + + + + + +死于征途的宿命(2) + + +班师。 + +他也已经厌倦了,从少年时起跟随名将远征,到青年时靖难造反,再到成年时远出蒙古,横扫大漠。打了几十年的仗,杀了无数的人,驰骋疆场的生活固然让人意气风发,却也使人疲惫不堪。 + +还是回家吧。 + +七月,大军到达翠微岗,周身患病的朱棣召见了杨荣,君臣二人之间进行了最后一次谈话。 + +朱棣说道:“太子经过这么多年磨练,政务已经十分熟悉,我回去后会将大权交给他,我自己就安度晚年,过几天平安日子吧。” + +杨荣心中大喜,却并不表露,他回应道:“太子殿下忠厚仁义,一定不会辜负陛下的期望。” + +重病缠身的朱棣笑了笑,他夺得了江山,也守住了江山,现在儿子已经很能干了,大明帝国必将在他的手中变得更加强大,自己也终于能够安享太平了。 + +但朱棣想不到的是,他已经回不了家了。 + +可能上天也学习了朱棣这种凡事做绝的作风,他注定要让这个喜爱战争和打仗的皇帝在征途中结束他的一生。 + +大军到达榆木川后,朱棣那原本强撑着的身体终于支持不住,于军营中病逝,年六十五。 + +六十五年前,在战火硝烟中诞生的那个婴孩,经历了无数风波,终于在征途中找到了自己的归宿,获得了永久的安宁。 + +在我看来,在远征途中死去,实在是他最佳的落幕方式,这位传奇帝王就此结束了他的一生。 + +这似乎也是一种宿命,生于战火,死于征途的宿命。 + +按照以往的习惯,应该给这位皇帝写一个整体的评价,其实对这位传奇帝王的评价,在以往的明史资料中有很多版本,而我认为最为出色的当属明史的评论。 + +虽然明史有很多错漏和问题,但至少在对朱棣的评价上,在我看来,史料中无出其右者,我之前很少引用古文,最多只是引用只言片语,用来说明出处,但此段文字实在是神来之笔,在下本欲自己动笔写评,奈何实在不敢班门弄斧,故引用如下: + +赞: + +“文皇少长习兵,据幽燕形胜之地,乘建文孱弱,长驱内向,奄有四海。即位以 + +后,躬行节俭,水旱朝告夕振,无有壅蔽。知人善任,表里洞达,雄武之略,同符高祖。六师屡出,漠北尘清。至其季年,威德遐被,四方宾服,明命而入贡者殆三十国。幅陨之广,远迈汉唐!成功骏烈,卓乎盛矣!然而革除之际,倒行逆施,惭德亦曷可掩哉! + +幅陨之广,远迈汉唐!成功骏烈,卓乎盛矣! + +得评如此,足当含笑九泉! + +他不是一个好人,却是一个不折不扣的好皇帝。 + + + + + +深夜的密谋(1) + + +深夜的密谋 + +朱棣结束了他传奇性的一生,终于故去了,死人没有了烦恼,也不用再顾虑权力、金钱、前途之类的东西,但活人却是要考虑这些的。 + +在朱棣死去后的那片哀怨愁云下,却隐藏着一股潜流。不同的利益集团正在加紧行动的步伐,他们争夺的就是朱棣留下的最有价值的遗产——皇位。 + +早在朱棣出发远征之时,他的好儿子朱高煦就已经预见到,自己的这位父亲可能很快就要走人了,他加紧了筹划,派出自己的儿子朱瞻圻潜伏在京城,并用快马传递消息,一晚上甚至会有七八批人往来通报,在没有电话的当年,也真是苦了那些报信的。 + +朱高煦做梦都想要皇位,但他十分清楚,必须确认自己的父亲抢救无效死亡后,才能动手,要是情况没摸准,自己就起兵,结果老爹来个诈尸或是借尸还魂,来到自己面前:“小子,想学你爹造反啊!”不用打,自己就败局已定。 + +在造反专家朱棣面前,朱高煦的道行还太浅。 + +所以他耐心地等待着,等待着那个消息的到来。 + +朱棣的内侍马云是个并不起眼的人,平日看上去不偏不倚,然而此时,他也亮出了自己的立场,朱棣死后,他以内侍身份深夜召集两个人开会,这两个人分别是杨荣和金幼孜。 + +他们三人经过密谋,做出了这样的决定,暂不发丧,每日按时给皇帝送膳食,以掩人耳目,并严格控制消息,禁止军营中人擅自外出报信。 + +可能有人会问,皇帝死后,由于尚远征在外,密不发丧不是通常的安排吗,为什么会说是密谋呢? + +因为这看似寻常的安排实际上暗藏玄机,在朱棣死前,他召见的顾命大臣并不是这两个人,而是张辅! + +朱棣临死前召见张辅,并传达了传位太子的旨意,这似乎并没有什么让人担心的,但问题就在于张辅这个人。 + +张辅是张玉的儿子,而张玉和邱福与朱高煦的关系十分紧密,他们都是靖难时候的战友,在立储问题上,靖难派是支持朱高煦的。 + +马云召集杨荣、金幼孜两人密谋做出如此重大之决定,竟然没有张辅在场,实在是十分之不寻常。很明显,他们是有所防备的。 + +事实证明,他们的担心并非没有道理,因为就在一年后,朱高煦起兵造反的前夜,派人去京城寻找的那个内应,正是张辅。 + +在封锁消息之后,杨荣被赋予了最为重要的使命——回京向太子报丧,并筹备太子继位事宜,这位潜伏多年的太子党秘密成员终于有了用武之地,他日夜兼程,终于将遗命及时送到了太子手中。 + +朱高煦从头到尾都被蒙在鼓里,等到他知道消息的时候,太子已经做好了各项准备,登基即位了。 + +朱高煦先生,你又没有猜对,吸取教训,下回再来,你还有一次机会。 + +明仁宗朱高炽 + +第十一章朱高炽的勇气和疑团 + +历经千辛万苦的大胖子朱高炽终于登上了皇位,定年号洪熙。 + +事实证明,这个体态臃肿的大胖子确实是一个仁厚宽人的皇帝,在他那肥胖残疾的外表下,是一颗并不残疾的,温和的心。 + +他登上皇位后,立刻下令释放还在牢房里面坚持学习的杨溥同学,并将其召入内阁。此时杨士奇和杨荣已经是内阁成员。明代历史上最强内阁之一——“三杨”内阁就此形成。 + +但此时一个问题出现了,虽然大家都知道内阁是皇帝最为信任的机构,其权力也最大,但由于这些内阁成员仅仅是五品官,要让那些二品尚书们向他们低头确实是很难的。 + +这个问题看似很容易解决,既然如此,那就改吧,把内阁学士提成二品,不就没事了吗? + +事情哪里有那么简单!你说改就改?你爹留下的制度,尸骨未寒,你就敢动手改造?正统的文官们在这个问题上一向是很有道理的。 + + + + + +深夜的密谋(2) + + +可是不改似乎又不行,问题总得解决啊。 + +在这个世界上的无数国家民族中,要排聪明程度,中国人绝对可以排在前几位,而其最大的智慧之一就在于变通。这样做不行,那就换个做法,反正达到目的就可以了。 + +所谓此路不通,我就绕路走,正是这一智慧的集中体现。 + +朱高炽没有改动父亲的大学士品位设置,却搞了一套兼职体系。 + +他任命杨荣为太常寺卿,杨士奇为礼部侍郎,金幼孜为户部侍郎,同时还担任内阁大学士。这样原先只有五品的小官一下子成了三品大员,办起事情来也就方便了。 + +目的达到了,父亲的制度也没有违反,从此这一兼职制度延续了二百多年,并成为了内阁的固定制度之一。 + +这类的事情在之后的历史中比比皆是,每看及此,不得不为中国人的智慧而惊叹。 + +登基后的朱高炽并没有忘记那些当年和他共患难的朋友们,洪熙元年(1425),他用自己的行为回报了他的朋友。 + +在一般人看来,皇帝回报大臣无非是赏赐点东西,夸奖两句,而这位朱高炽的回报方式却着实让人吃惊,在历代皇帝中也算极为罕见了。 + +同年四月的一天,朱高炽散朝后,留下了杨士奇和蹇义,他有话对这两个人说。 + +在当年那场惊心动魄的斗争之中,无数人背叛了他,背离了他,只有这两个人在他极端困难的情况下,依然忠实地跟随着他,杨士奇自不必说,蹇义虽然为人低调,却也一直在他身边。 + +年华逝去,大浪淘沙,这两个历经考验的人决不仅仅是他的属下,也是他的朋友。 + +朱高炽注视着他的两个朋友,深情地说道:“我监国二十年,不断有小人想陷害我,无论时局之艰难,形势之险恶,心中之苦,我们三个人共同承担,最后多亏父亲仁明,我才有今天啊!” + +回顾以前的艰难岁月,朱高炽感触良多,说着说着竟流下了眼泪。 + +杨士奇和蹇义也泣不成声,说道:“先帝之明,也是被陛下的诚孝仁厚所感动的啊。” + +就这样,经历苦难辛酸的三个朋友哭成一团。 + +在我看来,这种真情的表述远比那些金银珠宝更能表达朱高炽的谢意。 + +朱高炽没有辜负杨士奇的期望,他确实是一个好皇帝。 + +虽然他是一个短命的皇帝,皇位还没坐热,就去向他父亲报到了,但在其短短一年的执政时间内,他。。。(以下略去若干字),保持了大明帝国的繁荣。 + +为什么要略去呢,因为这些夸奖皇帝的内容千篇一律,什么恢复生产,勤于政务等等等等。这些套话废话我实在不愿写,大家估计也不喜欢看,如有意深入探究,可参考相关教科书。 + +在我看来,这些都是皇帝的本分事情,而真正能够体现朱高炽的宽仁并给他留下不朽名声的,是这样的一件事: + +我们已经说过,朱棣是永乐二十二年(1424)七月去世的,根据规定,如无特殊情况,皇太子在父亲死后可以马上登基为帝,但是,绝对不能马上将当年改换成自己的年号元年,必须等到第二年,老爹的尸体凉透了,才能立下自己的字号。 + +比如朱棣永乐二十二年(1424)七月去世,朱高炽立即即位,并有了自己的年号洪熙。从七月到十二月,实际上已经是他的统治时期,但这段时间还是只能算在永乐二十二年内,只有到第二年(1425)年,才能被称为洪熙元年。 + +在这段时间内,是皇太子们的适应期,用通俗的话说,就是走出自己父亲的影子,一般在这段时间内,新皇帝们还不敢太放肆,对父亲们留下的各项命令政策都照本宣科,即使想要自己当家作主,改天换地的,也多半不会挑这个时候。 + +可是就是这个忠厚老实的朱高炽,在尚未站稳脚跟的情况下,在这段时间内,就敢于更改自己父亲当年的命令。 + +这在当时的很多大臣们看来,是大逆不道的事情。 + +但在我看来,朱高炽的这一改实在干得好,干得大快人心! + +十一月的一天,朱高炽突然下达诏令,凡是建文帝时期因为靖难而被罚没为奴的大臣家属们,一律赦免为老百姓,并发给土地,让他们安居乐业。 + + + + + +深夜的密谋(3) + + +靖难之时,朱棣杀人无数,罚奴无数,齐泰、黄子澄、方孝孺等人也被定性为奸臣,此事已是板上钉钉,断无更改之理。 + +然而此时,他的儿子朱高炽却突然下了这样一道旨意,让很多大臣措手不及。可更让他们吃惊的还在后面。 + +朱高炽接着问大臣:“齐泰和黄子澄还有无后人?” + +大臣半天才反应过来,答道:“齐泰有一个儿子,当年只有六岁,所以免死,被罚戍边。黄子澄没有后代(后得知,黄子澄有个儿子当年改姓逃脱,后被赦免)。” + +朱高炽沉吟许久,说道:“赦免齐泰的儿子,把他接回来吧。” + +他接着问:“方孝孺可有后代?” + +大臣们目瞪口呆。 + +方孝孺?您说的是那个灭了十族的方孝孺? + +十族都灭了,还去那里找后代?您不会是拿死人开心吧! + +可皇帝已经下令了,就快去查吧 + +这一查还查出来了,虽然没有后代,但确实有个亲戚。 + +方孝孺的父亲方克勤有个弟弟叫方克家,这位方克家有个儿子叫方孝复(方孝孺的堂兄),当时也被罚充军戍边,至此终于回家了。 + +比起这些宽仁行为,更让人吃惊的是朱高炽所说的一句话。 + +朱高炽当着满朝文武大臣的面说道:“建文时期的很多大臣们,都被杀掉了,但像方孝孺这一类人,都是忠臣啊!” + +底下的大臣们又是一片目瞪口呆,鸦雀无声。 + +忠臣?您父亲不是说他们是奸党么?到您这里就给改了?那么说您父亲还是杀错了? + +就在这样的一片争议声中,朱高炽完成了他的壮举。 + +在立足未稳之时,朱高炽敢于凭借自己的正义感和良心改正自己父亲的错误,不畏人言,不怕反对,这是毫无疑问的壮举。 + +真正的仁厚也是需要勇气的。 + +朱高炽是一个勇敢的人。 + +虽然这位明仁宗短命,只做了一年皇帝,在明朝的所有皇帝中排名倒数第二,但他仅凭这一件事情,就足以对得起他谥号中的那个仁字,也无愧他一代英主的美名。 + +如果让这位明仁宗接着干下去,相信大明帝国一定能够繁荣兴盛,欣欣向荣,但还是应了那句老话——“好人不长命”,洪熙元年(1425)五月,只做了十个月皇帝的朱高炽病重,不久之后就去世了。 + +这位厚道的皇帝就此结束了他的一生,但他的义举将始终为人所牢记。 + +至少那些被赦免的人们会记得。 + + + + + +谋杀的疑团(1) + + +谋杀的疑团 + +皇帝的位置又空了,但这个位置注定不会太久,很多人都排队等着呢。 + +朱高炽病重,英明神武的太子朱瞻基自然十分关注,但除此之外,还有一双眼睛盯着皇位,这自然就是我们的老朋友朱高煦。 + +朱高煦虽然屡战屡败,却屡败屡战,以帝国主义亡我之心不死的决心和毅力,数十年如一日地坚持搞阴谋,搞破坏,朱高炽十分仁厚,并未因此处罚他,只是警告而已。而这位无赖兄却越发嚣张跋扈,现在眼见朱高炽病重,他也开始了自己的又一次夺位阴谋。 + +吸取上次的教训,朱高煦加强了情报工作,安排了很多眼线时刻盯着朱高炽,当然不是为了保证他的安全,而是要确定他什么时候死。 + +他的计划是这样的,考虑到京城的三大营要收拾自己手下那些虾兵蟹将易如反掌,出兵攻打没有把握,几乎等于自杀,他决定拿朱高炽的儿子朱瞻基开刀。 + +他准备等到朱高炽的死讯后,便立刻在道路上埋伏士兵,等朱瞻基奔丧路过之时,一举将其击灭,然后趁乱登上皇位。 + +朱高煦对自己的计划很有信心,何来信心?来自作案时间。 + +之前说过,他的封地在山东乐安,而太子朱瞻基在南京(根据惯例,太子守南京),只要死讯传出,太子必然会从南京出发,所需时日很长,而他却可以从容不迫地安排好士兵等着太子的到来。 + +乐安离京城很近,南京离京城很远,朱高炽一死,最先得到消息的自然是我朱高煦,等你听到风声,赶来京城的时候,我的士兵早就在路上等着你了! + +我有充分的作案时间,朱瞻基,你就认命吧! + +朱高煦的主意应该说是不错的,但不幸的是,他遇到了一件十分奇怪的事,这件事情不但使他的计划落空,也在历史上留下了一个谜团。 + +洪熙元年(1425)五月,朱高炽逝世,朱高煦得到消息,十分高兴,估计到朱瞻基赶到这里还有一段时间,他不慌不忙地安排士兵准备伏击。 + +可出人意料的事情发生了,他做好准备,可是左等右等,朱瞻基就是不来,没等朱高煦吟出今夜你会不会来的词句,就收到了一个不幸的消息——朱瞻基已经赶到京城,继位为皇帝。 + +怪哉,真是怪哉! + +难道朱瞻基会飞不成,或是他能预知未来,未卜先知? + +这不但是朱高煦的疑问,也是后人的疑问。 + + + + + +谋杀的疑团(2) + + +关于这一点,史料上有很多不同的记载,有的说朱高煦袭击太子只是传闻,实际上太子是接到丧报后从容赶到京城的,有的说朱高煦是没有准备好,等到太子过去了才派兵出去埋伏的。 + +还有一种说法就比较骇人听闻了: + +朱瞻基比朱高煦更早知道自己父亲的死讯。 + +路途远近是客观事实,只要报信的人不是在路上扎了帐篷,睡个几天几夜,乐安的朱高煦一定会比南京的朱瞻基更早知道消息。当年没有电话电报,也没有飞机,你就是想破脑袋,也找不出朱瞻基比朱高煦更早知道死讯的理由和方法。 + +其实方法是有的,也是唯一的可能性。 + +如果这一说法属实,我们就只能得出一个结论: + +朱瞻基不能预知未来,却创造了未来。 + +他谋杀了自己的父亲。 + +如果你对这一推论感到不满,也请不要向我丢砖头,因为这个推论并非我首创,实际上,明仁宗朱高炽的死亡原因一直以来都是历史悬案,到目前为止有几种说法,一种说法认为朱高炽纵欲,加之身体有病,最终病死,另一种说法认为是他的儿子朱瞻基等不及父亲传位,谋杀了他,因为从朱高炽死亡前后的一些迹象(如登基礼仪已备)表明,朱瞻基可能已经做好了登基的准备。 + +前一种我们不去说他,单说后一种,事实上,朱高煦极有可能在路上设置埋伏,因为从他在后来朱瞻基已经登基,情况诸多不利的情况下也要造反的行为来看,他犯上作乱的决心是很大的。这么好的机会,他应该不会错过。 + +那么为什么他没有遇上朱瞻基呢,这其中就有几种原因,可能是朱瞻基绕开了大道,也可能是朱瞻基听到父亲病重,提前出发,更有可能是朱高煦有准备好,错失机会。 + +对于这个问题,我不可能给出任何答案甚至推论,这可能注定又是一个永远的谜团。 + +历史的魅力可能就在于他永远有无数的谜团让人们去探究,却总也找不出答案。 + +纵欲而死也好,被谋杀也好,反正不是自然死亡(很少有皇帝能遇上这个殊荣)。 + +我们最终也只能得到一个肯定的结论: + +朱高炽死了,朱瞻基继位。 + +仅此而已。 + +当然了,我们不应该忘记可怜的阴谋家朱高煦,这位同志搞了几十年阴谋,却一事无成,多次眼见煮熟的鸭子飞掉,从父亲到兄弟,再到兄弟的儿子,就是没有自己的份,说实话,搞阴谋居然搞到这个份上,实在可悲,可怜。 + +如果要评最成功的阴谋家,姚广孝一定能排在前三名,而朱高煦注定会名落孙山。 + +但如果要评最可怜搞笑的阴谋家,朱高煦必能当仁不让,名列前茅。 + +真是悲哀,悲哀的阴谋家朱高煦空就是这样等了几十年,他的耐心已经磨灭殆尽,在他的心中,已经立下心愿: + +下定决心,排除万难,一定造一把反! + + + + + +朱瞻基是个好同志 + + +明宣宗朱瞻基 + +第十二章朱瞻基是个好同志 + +朱瞻基是个好皇帝,不是小好,是大好。 + +他勤于政事,恢复生产(不要怪我说废话,好皇帝都是差不多的),关心民间疾苦,他经常去民间私访,但绝对不是乾隆皇帝那种下江南的方式,他微服出访,不讲排场,不向地方摊派,不给地方增加负担,每次只带侍卫出行。 + +有一次,他去给父亲上坟(遏陵),回来时路过昌平(今北京昌平区),看到农田里有几个老农在很辛勤地干活,类似这种的劳动模范皇帝自然十分喜欢,他便叫身边侍卫叫了一个农民过来问话,询问为何他们如此勤劳耕作,估计这位农民不知道他的身份,于是皇帝得到了一个自己绝对想不到的答案。 + +农民回答他:我们春天耕种,夏天耕耘,秋天才能收稻子,如果任何一个时候偷懒,这一年的生活就没有着落。连田租也交不起,要养活老婆孩子,只能每天不停地干活了。 + +朱瞻基叹了口气,他这才明白,这些人这么拼命的干,并不是为了他的江山社稷,只是要活下去而已。 + +这样的回答也让朱瞻基十分尴尬,他只好打圆场地说:“那你们冬天可以休息吧。” + +这次轮到农民叹气了,他说:“冬天的时候,官府的徭役就派下来了,我们还得去出力气呢。” + +朱瞻基看了看田地里农民那总也直不起的腰,感触良多,吩咐侍卫准备回宫。 + +这位农民想必并不知道问他话的这个人的身份,他也绝对想不到,他和这个人的这番对话将会在历史上流传下来。 + +朱瞻基回到了皇宫,连夜写了一篇文章,把他的这次经历描述了一番,发给各位大臣,他动情地说道:“百姓如此辛苦,才能谋生,我们怎能不爱惜民力啊。” + +当然了,皇帝陛下的感叹是否能够对下面这些权谋老手有所触动,那倒是很不一定的事情,但是从这个故事我们可以看出,朱瞻基是个明白人,也是一个能够体谅老百姓的疾苦的人。 + +事实上,由于他的爷爷朱棣先生实在过于威猛,谁敢不服他就打谁,甚至有时候是没事找事,主动去找别人麻烦,一来二去虽然确实很威风,但给百姓们也增加了很多的负担,大军出征要粮食,要民工,要很多的钱。朱棣自己既不种地,也不赚钱,他会向下级官吏去要,官吏大人们自然也不会去种地,他们便会把所有的负担加在老百姓身上。 + +所以到了永乐后期,很多地方已经出现了逃荒的现象,生产也遭受了很大的破坏,朱瞻基没有他爷爷那么伟大的志向,但他很明白,现在已到了休养生息的时候了。 + +所幸他的父亲给他留下了像“三杨”这样的助手,面对着民生凋敝的现状,朱瞻基跃跃欲试,要大干一场。 + +可是在大干之前,他必须先料理一个人。 + +终于造反了! + +朱高煦先生终于忍无可忍了。 + +他感叹自己找错了工作,干什么不好,偏偏要去干阴谋家,这一行虽然竞争不激烈,但对素质要求极高,虽然有姚广孝这样的成功人士作为自己的光荣榜样,但也不能保证自己的成功。 + +要想做一个成功的坏人、阴谋家,关键在于提高自己的素质。 + +朱高煦的素质不行,搞了几十年阴谋却什么结果也没有,几个皇帝就在自己眼前不断上下,现在连自己的晚辈朱瞻基也上台了,作为一位阴谋家,朱高煦的事业是失败的,也实在混得太差。 + +更让人难以接受的是,他想造反已经成了公开的秘密,上到皇帝下到老百姓,大家都知道这位先生想要造反,阴谋家这一职业,最大的特点就在于隐秘工作和地下工作,相比之下,朱高煦先生可以算是这个行业的耻辱,也颇为同行们所嘲笑。 + +二十多年一事无成,造反造得人尽皆知,所有一切不但侮辱了朱高煦先生的人格,也侮辱了他的智商。 + +不想再等,也不想再忍了,兄弟我混二十多年容易么!造反了! + +朱高煦虽然激动,但并没有丧失理智,他在造反之前,派出了亲信枚青,去京城找一个人,他相信,凭着多年的交情,这个人一定能够站在他的这边,只要能把这个人拉过来,大事必成! + +宣德元年(1426)七月,枚青潜入京城,去找朱高煦的好朋友——张辅。 + +张辅热情地接待了他,共叙友谊之后,问清了朱高煦的意图和枚青的来意,要说这张辅为人也实在没话说,是个直爽人,他连睡觉的地方都没来得及给枚青安排,就把他捆起来,连夜送给了朱瞻基。 + +朋友?交情?呸!时务! + +朱瞻基知道了这个消息,却并不想动手,他希望和平解决。 + +为达到这个目的,他派出了中官侯泰去山东乐安找朱高煦,希望对方能够悬崖勒马。 + +可是下面发生的事情却实在让人大出所料。 + +侯泰奉皇帝之命前来,迎接他的是气焰嚣张的朱高煦,这位造反兄傲气十足,竟然面对天子来使南面而坐,看那架势大有我造反我怕谁的意思。 + +而朱高煦下面所说的话就很明显是他的心里话了: + +“靖难时候,没有我出力,哪有今天,结果太宗(朱棣)听信谗言,把我封到了这个地方,仁宗想用金帛笼络我,现在的皇帝又想用祖制来压制我,我怎么可能久居此地!” + +接着,他又向侯泰主动出示了自己的兵马军器,明目张胆地说:“这些就可以横行天下了!回去告诉你的主子(归报尔主),把那些煽动他的奸臣们抓来送给我,再和他接着谈(徐议我所欲)。 + +看看这些用词,所谓“归报尔主”、“徐议我所欲”,给三分颜色,却想开染坊!无耻一词当之无愧。 + +从古至今,像朱高煦这样的无赖都有一个共同特点,明明自己搞阴谋,却总喜欢诬赖别人,给他留面子,却是给脸不要脸。 + +对付这种无赖,实在是不用讲道理的,最好的方法就是给他一个响亮的耳光。 + + + + + +其实你很脆弱(1) + + +其实你很脆弱 + +到了这个地步,不打也得打了,朱瞻基召开军事会议,商讨如何平叛,当时大臣们都认为应该派遣阳武侯薛禄带兵平叛,而张辅更是十分积极, 希望能带两万兵马去扫荡他的老朋友。 + +但杨荣提出了反对意见,他认为在目前这种情况下,如果皇帝亲征,必定能够一举击败朱高煦。 + +张辅不服气,与杨荣争论了起来,双方争执不下,事情又走到了十字路口。 + +朱瞻基也拿不定主意,派兵出去打固然省事,却不能保证胜利,自己亲征虽有气势,但危险太大,无法保证安全。 + +正在他犹豫不决之时,大臣夏原吉只用了一句话,便坚定了朱瞻基亲征的信念: + +“皇上忘记了李景隆的事吗?” + +李景隆?对,就是那个饭桶李景隆。 + +当年建文帝把兵权交给这个饭桶,结果一败涂地,想到这个饭桶的结局,朱瞻基立刻下定决心,亲征! + +谁说李景隆是饭桶、废物?从这件事情上看,饭桶废物也是有用的,至少他的愚蠢起到了警示后人的作用,功德无量啊! + +宣德元年(1426)八月十日,朱瞻基亲征乐安,大军行动迅速,八月二十日已经到达乐安城外。 + +朱高煦固然是无赖,但无赖想要干出点事情来,靠耍赖是不行的,还是需要点本事的。 + +他原先以为是薛禄带兵来平乱,并不放在眼里,没有想到,自己的好侄子竟然亲自前来,一下子慌了手脚,组织士兵们抵抗,却少有听命者。 + +这个时候,朱高煦才发现自己是如此地脆弱。 + +朱瞻基实在不是等闲之辈,在征途之中,他曾经问手下的大臣们:“你们认为朱高煦会如何行动?” + +有大臣回答:“乐安太小,他可能会进攻济南,以抗拒大军。” + +也有大臣说:“他曾在南京多年,必然会带兵南下。” + +朱瞻基笑着摇了摇头,说道:“你们说得都不对,济南虽然很近,却不容易攻,而且大军行军迅速,他也来不及攻击,南京更不可能,他的那些手下们的家属都在乐安,怎么可能愿意往南边走?” + +“他会一直在乐安等着我的” + +事实确实如此,朱高煦一直都在乐安,倒不是因为他想决一死战,而是他别无去处。 + +大军到达之后,并未强攻,只是用火铳和弓箭射击城上守军,虽然没有动真格的,气势却十分吓人,城中守军本来就没有什么斗志,这样一来更是失魂落魄,纷纷逃亡。 + + + + + +其实你很脆弱(2) + + +朱瞻基充分了解了战场局势和士兵心理,派人将敕令捆在箭上射入城中,敕令上说明首恶必办,协从不问的原则,并给朱高煦很周到地标上了生擒和击毙两种价码,城中的人顿时蠢蠢欲动,就连朱高煦身边的侍卫也有自己的打算,他们看着朱高煦时的眼神,就如同看着一个金灿灿的猪头。 + +朱高煦狼狈不堪,只好派人出诚送信,表示愿意出城投降,只是希望有一个晚上的时间告别亲人,就前来自首。 + +朱高煦是这样说的,也是这样做的。 + +第二天他准备打开城门,投降朱瞻基,然而他手下的部将王斌拉住了他,对他说了一番义正严辞的话: + +“宁可战死,决不做俘虏!”(宁一战死,毋为人所擒) + +朱高煦目瞪口呆,自己都准备投降了,这个部下竟然还如此有骨气。他顿时精神大振,表示自己一定与城池共存亡! + +发表完慷慨激昂的演讲后,朱高煦昂首挺胸地走回了自己的指挥位置。 + +然后他换了一条小路,偷偷溜出城池,去向朱瞻基投降,还发表了他的投降演讲: + +“我罪该万死,全由皇上发落!”(臣罪万万死,惟陛下命) + +这场闹剧就此收场。 + +朱高煦是个彻头彻尾的丑角,阴谋家做不成,造反也失败,不但没素质还没人品,一个月前还大言不惭“归报尔主”、“徐议我所欲”。 + +一个月后,就成了“臣罪万万死,惟陛下命。” + +不做好人,连坏人也做不成,这样的一个活宝实在让人无话可说。 + +朱高煦,你的名字是弱者。 + +在这场滑稽戏里,朱高煦扮演了丑角,但这出戏却也在无意中成就了一位小人物。 + +朱高煦出来投降后,按照规矩,皇帝要派一个人数落他的罪行,通俗点说就是骂人,当然这个工作是不可能由皇帝自己来做的。 + +于是皇帝便指派了身边的一个御史去完成这项骂人的工作,但皇帝绝对想不到的是,自己随意指派的御史竟然骂出了名堂,骂出了精彩。 + +这位御史领命之后,踏步上前,面对这位昔日位高权重的王爷,无丝毫惧色,开始数落其罪状,骂声宏亮,条理清晰,并能配合严厉的表情,众人为之侧目。(正词崭崭,声色震厉) + +朱高煦那脆弱的心灵又一次受到了沉重的打击,在这位御史的凌厉攻势下,他被骂得抬不起头,趴在地上不停地发抖。(伏地战栗) + +这一情景给皇帝朱瞻基留下十分深刻的印象,他认定此人必是可造之才,回去之后,他当即下令派这个人巡按江西。(注意,不是巡抚)巡按外地正是御史的职责,也不算什么高升,但皇帝的这一举动明显是想历练此人,然后加以重用。 + +在历史中,奸邪小人依靠一些偶然的闪光表现得到皇帝的欢心和信任,从而为祸国家的事情并不少见(比如和绅),但事实证明,这一次,朱瞻基并没看错,这位声音洪亮的御史确实是一位不可多得的人才。 + +在二十年后,他将挺身而出,奋力挽救国家的危亡,并成就伟大的事业,千古流芳。 + +这位御史的名字叫做于谦。 + + + + + +闹剧的终结 + + +闹剧的终结 + +虽然这次造反以一种极为戏剧性的方式完结了,但搞笑并未就此结束,朱高煦先生将以他那滑稽的表演,为我们上演“朱高煦造反”这部喜剧的续集。 + +朱瞻基确实是个厚道人,虽然很多人劝说他杀掉朱高煦,但他却并没有这样做,只是将其关在了西安门的牢房里,按说他对朱高煦已经是仁至义尽,可朱高煦偏偏就是个死不悔改的人。 + +有一天,朱瞻基想起了他的这位叔叔,便去看望他,两人没说几句话,朱高煦突然伸出一脚,把朱瞻基钩倒在地。 + +我每次看到这个地方,都百思不得其解,总是搞不懂朱高煦是怎么思考的,他的脑袋装的是否都是浆糊。 + +既然脚能钩到,说明两人已经很接近,你上去撞也好,咬也好,掐也好,踢也好,都能起到点作用,这么多方法你不用,偏偏就是钩他一下,如同几岁小孩的恶作剧,实在让人哭笑不得。 + +闹剧还没有完,吃了暗算的朱瞻基十分气愤,老实人也发怒了,便下令用一口三百斤的铜缸把朱高煦盖住,那意思就是不让他再动了。可后来发生的事情实在是让人匪夷所思。 + +朱高煦先生突然又不干喜剧演员了,转而练起了举重,他力气很大,居然把缸顶了起来,但由于头被罩住看不清,只能东倒西歪的到处走。 + +呆着就呆着吧,你干嘛非要动呢? + +这一动,就把命动没了。 + +朱瞻基从头到尾见识了这场闹剧,他再也无法忍耐了,于是派人把大缸按住,然后找来很多煤炭,压在缸上,把煤点燃烧红,处死了朱高煦。 + +这种死刑方法极其类似江南名菜叫花鸡的做法,不过名字要改成“叫花猪(朱)”。 + +朱高煦先生就这样结束了他多姿多彩的一生,他的一生,从阴谋家到喜剧演员,再到举重运动员,无不是一步一个坑,极其失败,但我们实在要感谢他,是他的搞笑举动使得我们的历史如此多姿多彩。 + +我曾数次怀疑这段记载的真实性,因为我实在很难理解这位朱高煦先生的行为规律和原因,怀疑他是一个精神不正常的人。但在历史之中,人的行为确实是很难理解的。 + +不管这位朱高煦先生精神到底正不正常,史料记载是否真实,朱瞻基终于摆脱了这最后一个累赘,一心一意地去做他的明君去了。 + +朱瞻基的统治时间并不长,只有十年,加上他父亲的统治时间,也只有十一年,但他和他父亲统治的这短短十一年,却被后代史学家公认为是堪与“文景之治”相比的“仁宣之治”。是中国历史上的盛世。 + +何以有如此之高的评价,盛世何来?来自休养生息,清静养民。 + +其实封建社会的老百姓们自我发展能力并不差,你就算不对他进行思想教育,他也知道自己要吃饭,要挣钱,要过好日子,只要官府不要天天加收田赋,征收徭役,给这些不堪重负的人们一点喘息之机,他们是会努力工作的。 + +明宣宗就是这样的一个不扰民的皇帝,他没有祖父那样的雄才大略,但他很清楚,老百姓也是普通人,也要过日子,应该给他们生存下去的空间。 + +在他执政的十年里,每天勤勤恳恳,工作加班,听取大臣们的意见,处理各种朝政,能够妥善处理和蒙古的冲突问题,能不动兵尽量不动,所以在他的统治时期,一直没有出什么大事。 + +这对于像我这样叙述故事的人来说,并不是一件好事,但对于当年的百姓们而言,却是功德无量。 + +好的皇帝就如同现代足球场上的好裁判,四处都有他的身影,不知疲倦的奔跑,却从不轻易打断比赛的节奏,即使出现违规行为,也能够及时制止,并及时退出,不使自己成为场上的主角。 + +这样的裁判才是好裁判。 + +不干扰百姓们的生活,增加他们的负担,为其当为之事,治民若水,因势利导,才是皇帝治国的最高境界。 + +这样的皇帝才是好皇帝。 + +朱瞻基就是一个彻头彻尾的好皇帝,而且从治国安民的角度来看,他比他的祖父要强得多。 + + + + + +朱瞻基的痛苦 + + +朱瞻基的痛苦 + +朱瞻基是明君,是好皇帝,但他也有着自己的痛苦。 + +世界上还有人能让皇帝痛苦? + +是的,确实存在这样的人。他们就是那些平日跪拜在大殿上,看似毕恭毕敬的大臣们。 + +这些大臣们绝非看上去那么听话,在他们谦恭的姿态后面,是一个拥有可怕力量的庞然大物。 + +自唐朝以来科举造就了很多文官,并确定了文官制度。历经几百年,这一制度终于在明朝开花结果,培养出了一个副产品。那些凭借着科举考试跃上龙门的精英们通过同乡、同门、同事的关系结成了一个无比巨大的实力集团——文官集团。 + +明仁宗朱高炽是一个公认的老实人,好皇帝,但就是这位好皇帝,却被一个叫李时勉的大臣狠狠地骂了一顿,朱高炽品行很好,怎么会骂他,这又是从何说起呢? + +原来朱高炽先生做了这样几件事,他登基之后,要换侍女,新君登基,这个要求似乎也不过分,此外他还整修了宫殿(规模并不大),最后由于身体不适,他曾有几天没有上朝见群臣。 + +这些事情似乎并不是什么大事,可是李时勉却写了一封很长的信,数落了皇帝一通,全文逻辑性极强,骂人不吐脏字,水平很高,摘抄如下: + +所谓整修宫殿——“所谓节民力者此也” + +所谓选侍女——“所谓谨嗜欲者此也”(这句比较狠) + +所谓有几天不上朝——“所谓勤政事者此也”(你李时勉就没有休息过?) + +还没有完,最狠的话后面,总结发言——“所谓务正学者此也” + +以上,翻译成通俗语言可以理解为穷奢极欲,好色之徒,消极怠工,不务正业。 + +大胖子朱高炽虽然脾气好,但还是忍不住,把李时勉打了一顿,他的愤怒也是有道理的,勤勤恳恳干工作,虽然有这些小问题,却被戴上了这么大的帽子,实在让人难堪,毕竟当年还是封建社会,可这位李时勉却着实有点现代民主意识,把皇帝不当干部,就这么开口训斥,也怪不得朱胖子生气。 + +朱胖子气得生了病,可这位李时勉虽然挨了顿打,但还是活了下来,到了朱瞻基继位,竟然又把这位骂过自己父亲的人放了出来,还表扬了他。 + +坦言之,李时勉所说的这些东西确实是需要改正的,但作为一个封建社会的皇帝,这些行为实在不足以被扣上这么大的帽子。事实上,在这些所谓的直言进谏的背后,有着复杂的历史政治背景。 + +李时勉的行为并不是孤立的,他代表着一群人,这群人就是文官集团。 + +文官集团特点如下: + +一、饱读诗书,特别是理学,整日研习所谓圣贤之道。 + +二、坚持宽于律己,严于待人的原则,以圣人的标准来要求别人。(一部分) + +三、擅长骂人,掐架,帮派斗争。 + +座右铭:打死不要紧,青史留名在。 + +要说明的是,这不过是文官集团的一般特征,也不是否定文官集团的积极意义,实际上,也有很大一部分的优秀文官是严于律己的。 + +明宣宗辛辛苦苦干活,也不好色,没有什么其他娱乐,按说不应该有什么值得指责的,可善于研究问题的文官们还是找到了漏洞。 + +这位明宣宗没有什么特别喜欢的活动,却有一个小爱好——闲暇之余斗蛐蛐。虽然这不算是健康的文体活动,倒也不是什么不良嗜好。皇帝也有自己消闲方式,你总不能让他每天做一套广播体操当娱乐吧。 + +但就连这点小小的爱好,也被文官们批判了很多次,后来不知是谁缺德,竟然给这位为工作和江山累得半死不活的好皇帝取了个外号“蛐蛐皇帝”。 + + + + + +确实过分了(1) + + +确实过分了 + +这些人的行为可以用矫枉过正来形容,无论谁当皇帝,恐怕都受不了,你想打他,那还是成全了他,当年因正义直言被打,可是一件光荣的事。 + +如那位李时勉就是一个例子,被打之后不但毫无悔意,还洋洋自得,深以被打为荣。 + +而在明宣宗时代,文官集团的势力得到了进一步的发展,内阁权力也越来越大,出现了所谓“票拟”。 + +票拟,也称条旨,指的是大臣草拟对各种奏章的处理意见,并将这些意见附于奏章之上,送给皇帝御览。 + +票拟的出现是必然的,朱瞻基明显没有他的祖先那样的工作精力,整日劳顿还是忙不过来,很多奏章不可能一一亲自看过处理,于是他便安排内阁人员代为浏览奏章,并提出处理意见,这样他也会轻松得多。 + +可能有人会问,这样的话,皇帝还有什么权力呢,他不就被架空了吗? + +这个请大家放心,古往今来的皇帝除了极个别之外,都不是白痴,给内阁票拟权只是为了要他们干活的,皇帝还留有一手后着,专门用来压制内阁的权力。 + +这一后着就是同意的权力。 + +不要忘记,大臣只是给皇帝打工的,一项政令是否可以实施,大臣只能提出意见, 然后写上请领导审批的字样,送给皇帝大人审阅,如果皇帝大人不同意,你就是下笔千文,上万言书,也是一点作用都没有的。 + +朱瞻基良好地把握了这一点,他有效地发动大臣们的积极性,让他们努力干活,却又卡住了他们仆大欺主,翻身做人的可能性。所有经过票拟的奏章只有经过皇帝的批示,才可以实施。 + +由于皇帝用于批示的是红笔,所以皇帝的这一权力被称为“批红”。 + +至此,到明宣宗时,皇帝的权力被正式分为了“票拟”和“批红”两大部分,朱元璋做梦也不会想到,仅仅过了不到三十年,他苦心经营的政治体系就被轻易地击破并改动。 + +此后明代二百多年的历史中,“票拟”的权力一直为内阁大学士所占有,而“批红”的权力却并非一直握在皇帝的手中,在不久之后,这一权力将被另一群登上政治舞台的人所占据。 + +这些人就是太监。 + +明宣宗这一辈子没干过什么坏事,也不好酒色,除了喜欢斗蛐蛐被人说过几句外,没有什么劣迹,但有一件事情例外。 + +有些后世的人甚至认为,明宣宗做的这件错事给大明王朝的灭亡埋下了伏笔。 + +他到底做了什么伤天害理,灭绝人性的事呢? + +说穿了其实也没什么,他只不过搞了点教育事业——教太监读书。 + +宣德元年(1426),明宣宗突然下令,设置“内书堂”,教导宦官们读书,大家应该知道,在传宗接代观念极其严重的中国,去坐太监的都是不得已而为止,混口饭吃而已,这些人自然没有什么文化,而朱瞻基开设学堂的目的,正是为了给这些太监们扫盲。 + +可他不会想到,这次文化启蒙运动不但扫掉了太监们的文盲,也扫掉了阻挡他们进入政坛的最后一道障碍。 + +要知道,当一个坏人并不难,但要做一个坏到极点的极品坏人是很难的。没有文化的坏人干点小偷小摸,拦路抢劫之类的勾当,最多只能骚扰骚扰自己家的邻居老百姓,而读过书的坏人却可以祸国殃民,危害四方。 + +从事情的后续发展来看,朱瞻基的这一举措确实也培养了不少极品坏人。 + +很多人认为,朱瞻基的这一措施确实是错误的,但其本意不过是要这些太监们学点文化,并没有什么其他的企图。 + +真的是这样吗? + +我认为不是,在我看来,朱瞻基是故意的,从法律上来解释,就是明知其行为会导致太监参权的结果,却希望或者放任这种结果的发生。 + + + + + +确实过分了(2) + + +这位皇帝厚道,却不蠢,他的这一举措带有政治目的。 + +而要揭示他这一行为背后的秘密,就必须引出我们下面的一个话题: + +太监是怎样炼成的 + +先要说明,这个话题与生理方面无关,也不探究那要人命的一刀,只谈谈这个特殊的群体,及其参与政治的真正原因。 + +太监这个名词大家都十分熟悉,而且大多数人还会在这个称呼前面加个死字,骂起人来十分提神,且通俗易懂。 + +实际上在明代,要想混到太监,可不是一件容易的事情,所谓太监是宦官的首领,不是谁都有资格被称为太监的。 + +别说太监,就是想当普通宦官也很不容易,在明朝,宦官可是个抢手的工作。 + +要知道,在这个世界上,混碗饭吃是不容易的,就算你有勇气挨那一刀,还要有运气进宫才行,不要以为当宦官那么简单,也是要经过挑选面试的。官方的阉割场所只阉割那些已经经过挑选的人。说句寒掺话,要是人家看不上,你连被阉的资格都没有。 + +在明代经常有人在未经官方允许的情况下自行阉割,然后跑到北京去当太监。他们中间有很多人没有被挑中,回家了此一生,当然,也有成功者(如鼎鼎大名的魏忠贤)。 + +到了明朝中期,由于想当宦官的人太多,很多有志于投身宦官事业的人没有被官方处理的机会,便以大无畏的勇气自行了断子孙根,可到后来又没能进宫。他们不能成家立业,只能到处游荡,这些人自然成为了社会的不安定因素。 + +为了应对这一情况,后期的明朝政府曾经颁布了一条十分特别的法令: + +严禁自行阉割! + +对此我只能说,这是一个奇妙的世界。 + +明代宦官有很多级别,刚进宫时只能当典簿、长随、奉御,如果表现良好,就能被升迁为监丞,监丞再往上升是少监,少监的顶头上司就是闻名遐迩的太监。 + +可见,要想干到太监实在不容易啊。 + +宦官有专门的机构,共二十四个衙门,分别有十二监、四局、八司,其最高统领宦官才能被称作太监,这二十四个衙门各有分工,不但处理宫中事务,还要处理部分政务。 + +事实上,在这些宦官衙门中,也有冷热轻重之分,重者权倾天下,轻者轻如鸿毛。一个刚入宫的宦官要想出头,先要看他被分在哪个部门。 + +如果你被分在了司礼监或是御马监,那就先恭喜了,你的太监前途将一片光明,继续努力下去,光宗耀祖或是遗臭万年都是有可能的。 + +因为这两个监局是权力最大的太监机构,司礼监就是专门掌管内外章奏的,相当于皇帝的私人秘书,我们前面说过,皇帝把票拟的权力给了内阁,自己保留了批红权。 + +而到了明宣宗时候,由于文件太多,朱瞻基自己也没有时间看完,便会让司礼监的人按照票拟的内容抄下来,代理自己行使批红的权力。 + +这个为皇帝代笔的人有一个专门的称呼——司礼监秉笔太监。 + +于是,天下唯一可以压制内阁票拟权的批红权就落在了秉笔太监的手中。 + +到了明朝后期,皇帝不管朝政,某些太监便会自作主张,乱发旨意,下面的官想告状也告不了。因为你告状的奏章最多只能告到皇帝那里,可代皇帝批阅奏章的人很可能就是你要告的人,那你这状能告下来吗? + +由此可见,秉笔太监实在位高权重。 + +但是这位秉笔太监却还不是权力最大的太监,在他的上头还有一个——司礼监掌印太监。 + +这很好理解,在印章文化十分发达的中国,你写再多,我不给你盖章你也没办法。 + +而一旦司礼监掌印太监兼任了东厂太监(如冯保和魏忠贤),那就真是权倾四海,威震天下。事实上,几乎所有明代的著名太监都出自司礼监,如果当年有名监展览馆,司礼监必然是所挂画像最多的地方。 + +司礼监出监才啊。 + +而作为一个有志气的青年宦官,你应该以这些人为偶像,努力奋斗,争取名留青史!(当然一般来说都是恶名) + +如果你有幸能干到司礼监掌印太监,那说明你的太监生涯已经达到了光辉的顶点,你已成为了太监中的佼佼者,是太监中的成功人士。如果你还凑巧干了些坏事,那么你的名声一定不限于当代,而会世代流传下来,供众人茶余饭后谈论和唾骂。 + +如果你没有能够进入司礼监,而是进入了御马监,那我同样要恭喜你,这也是个好地方,虽然这里出的名人没有司礼监多,但也不少,比如著名的汪直、谷大用等,都是的好榜样。 + +必须说明的是,这个所谓御马监不是管马的,而是管理御用兵符。说到这里大家也应该知道为什么御马监是个有前途的部门了。 + +司礼监和御马监一文一武,成为最为显赫的太监部门,宫中宦官无不尽心竭力,想进入这两个部门。 + +有好必有坏,万一你不幸被分到了直殿监和都知监,那你就惨了。因为这两个监名字虽然气派,却只管理一件事——清洁卫生。 + + + + + +确实过分了(3) + + + + +这两个监不但条件艰苦,没有人瞧得起,连办公场所都没有(似乎也不需要),而且秋扫落叶冬扫雪,工作十分之苦。 + +这样的部门自然是无法吸引众多青年宦官的。 + +介绍完太监的奋斗史,下面就要谈太监参与政治的问题了。 + +在我们很多人的心目中,太监政治大概是这样的一幕场景: + +在一个月黑风高的夜晚,在一所阴森的房子里,几个面目狰狞的太监在十分微弱的烛光下进行着密谋。 + +一个太监奸笑(标准表情)着对旁边的人说道:“尚书王某某阻碍我们的夺权计划,要把他干掉!” + +这时另一个太监也奸笑(保持形象)着说:“我看还是先把侍郎张某某干掉。” + +最后太监头子(一般就是最坏的那个)发话:“照计划行事,把那些忠臣们都清除掉,然后再把皇帝换掉,我们来坐江山!” + +以往人们心中的太监形象就是如此,只要一提到太监,就会和坏蛋联系起来,然后就是朝廷中的忠臣们为了正义和理想与坏蛋们进行了不懈的斗争,成功了就是正义终于战胜邪恶,失败了就是人间悲剧。 + +真的是这样吗? + +我认为不是,人们往往过于关注那些所谓忠臣们的行为,却很少发现这些大臣们的可怕之处。 + +之前在我们的丞相怎样炼成的专题中,曾经对明朝的相权君权分立做了分析,并用了一个拔河的比喻,皇帝和大臣各站在绳子的两边,不断的拔河,朱元璋是优秀运动员,体力好,他活着的时候,没有人能拔得过他。 + +他的儿子朱棣也是运动健将,虽然设立了内阁,但还是能够掌握主动权。 + +到了朱瞻基,情况就大不相同了,文官集团十分之强大,连皇帝也奈何他们不得。 + +在我们很多人的印象中,皇帝是想干什么就能干什么的,没有人能够管得了。可是实际上,明朝的皇帝是不容易当的,那些大臣们就像一群苍蝇,不但要向你提意见,甚至有时候还会挖苦你,讽刺你,你还不好把他怎么样。 + +明仁宗心地善良,却因为小事被骂得气急败坏,他的儿子朱瞻基行为端正,只喜欢斗蛐蛐,也被那些人当成罪状来批判,老百姓有自己的爱好,皇帝居然不能有。 + +绳子那一头是一股极其庞大的力量,那些在我们看来无比正直的大臣们有着充分的力量控制朝政,他们有学识,有谋略,有办事能力,有很多的同门、同事。 + +而绳子的这一头,只有皇帝一个人。 + +皇帝那所谓的至高无上的权力在文官集团的大爷们眼中也算不得什么,骂你,讽刺你,那是为了国家大事,那是忠言逆耳,你能说他不对吗? + +而且这些大爷们既不能杀,也不能轻易打,杀了他们,公务你自己一个人能干吗? + +劳动模范朱元璋老先生自然可以站出来说:把他们都杀光,我能干! + +可是朱瞻基不能这样说。 + +于是在太祖皇帝死去二十年后,绳子失去了平衡,获得了票拟权的内阁集团变得更强大,皇帝一个人就要支撑不住了。这样下去,他将被大臣们任意摆布。 + +苦苦支撑的朱瞻基一步步地被拉了过去,正在这时,他看见旁边站着一个人,于是他对这个人说:“你来,和我一起拔!” + +从此这个人就参加了拔河,并成为这场游戏的一个重要组成部分。 + +这个人的名字就叫太监 + + + + + diff --git a/src/main/resources/hehe.txt b/src/main/resources/hehe.txt new file mode 100644 index 0000000..4776b36 --- /dev/null +++ b/src/main/resources/hehe.txt @@ -0,0 +1,1015 @@ +导 语 +目 录 +作者简介 +内容简介 +帝王的烦恼 +功 臣 +兄 弟 +母子不相认 +此书已经失传了 +为了权力(1) +为了权力(2) +帝王的荣耀 +修 书 +命 运 +转 折 +你是这种人 +飞 腾 +盛世修书 +每一个人都是 +投 机 +有一个人反对 +双方开门见山 +来得还真快 +终 点 +帝王的抉择 +不 通 +郑和之后 +出 航 +以德服人 +无敌舰队 +和平的使命 +留个纪念吧(1) +留个纪念吧(2) +留个纪念吧(3) +最后的归宿 +纵横天下(1) +纵横天下(2) +西南边疆的阴谋 +安南平定战(1) +安南平定战(2) +天子守国门 +一次性解决问题 +亲 征(1) +亲 征(2) +阿鲁台的厄运 +逆命者必剪除之 +瓦剌的自信 +朱棣陷入了矛盾之中(1) +朱棣陷入了矛盾之中(2) +战后总结大会(1) +战后总结大会(2) +要你命三板斧战斗系统(1) +要你命三板斧战斗系统(2) +帝王的财产 +宦 官(1) +宦 官(2) +第一个人(1) +第一个人(2) +第二个人 +第三个人(1) +第三个人(2) +生死相搏 +朱高煦的阴谋(1) +朱高煦的阴谋(2) +朱高煦的阴谋(3) +无畏的杨士奇 +太子党的反击 +一剑封喉 +最后的秘密 +告 别 +朱棣默然(1) +朱棣默然(2) +最后的答案(1) +最后的答案(2) +死于征途的宿命(1) +死于征途的宿命(2) +深夜的密谋(1) +深夜的密谋(2) +深夜的密谋(3) +谋杀的疑团(1) +谋杀的疑团(2) +朱瞻基是个好同志 +其实你很脆弱(1) +其实你很脆弱(2) +闹剧的终结 +朱瞻基的痛苦 +确实过分了(1) +确实过分了(2) +确实过分了(3) +导 语 +目录 +一 帝王的烦恼 +二 帝王的荣耀 +三 帝王的抉择 +四 郑和之后,再无郑和 +五 纵横天下 +六 天子守国门! +七 逆命者必剪除之! +八 帝王的财产 +九 生死相捕 +十 最后的秘密 +十一 朱高炽的勇和疑问 +十二 朱瞻基是个好同志 +十三 祸根 +十四 土木堡 +十五 力挽狂澜 +作者简介 +内容简介: +本书是《明朝那些事儿》第二册,内容自永乐夺位的“靖难之役”后开始,先叙述了中国历史上赫赫有名的永乐大帝事迹——挥军北上五征蒙古,郑和七下西洋,南下讨平安南等等,后来永乐于北伐蒙古归来途中病逝,明朝在经历了比较清明的“仁宣之治”后,开始进入动荡时期。大宦官王振把持朝政胡作非为,导致二十万精兵丧于一旦,幸亏著名忠臣于谦在“土木堡之变”中力挽狂澜,挽救了明帝国,但随即又在两位皇帝争夺皇位的“夺门之变”后被害身亡。 +这一系列的事件和人物都精彩无比,可说高潮迭起,令人目不暇接、欲罢不能。 +作为一本说历史的书,当年明月所用的笔法,却完全不是以往那些史书笔法。这是一种充满了活力和生气,字字都欲跃然而出的鲜灵笔法,在他笔下,人物不再是一个刻板的名字和符号,而是一个个活生生的人,那些事件更是跌宕起伏,叫人读来欲罢不能。之所以会有这样一种笔法,正如作者说的那样:“由于早年读了太多学究书,所以很痛恨那些故作高深的文章,其实历史本身很精彩,所有的历史都可以写得很好看”。 +帝王的烦恼 +功臣 +自欺欺人也好,自我安慰也好,毕竟皇位才是最现实的。在处理好继位的合法性问题后,下一步就是打赏功臣,这可是极为重要的一步。虽然历来皇帝最不愿意看到的就是大业已成后的功臣,但这些人毕竟在皇帝的大业中投入了大量资本,持有了股份,到了分红的时候把他们踢到一边,是不好收场的。毕竟任何董事局都不可能是董事长一个人说了算。 +这里也介绍一下明朝的封赏制度,大家在电视中经常看到皇帝赏赐大臣的镜头,动不动就是“赏银一千两”,然后一个太监拿着一个放满银两的盘子走到大臣面前,大臣谢恩后拿钱回家。大致过程也是如此,但很多时候,电视剧的导演可能没有考虑过一千两银子到底有多重,在他们的剧情中,这些大臣们似乎都应该是在武校练过铁砂掌的,因为无论怎么换算,一千两银子都不是轻易用两只手捧得起来的。在此也提出建议,今后处理该类情节时,可以换个台词,比如“某某,我赏银一千两给你,用马车来拉!” +以上所说的赏银在封赏中只是小意思,我们的先人很早就明白细水长流的道理。横财来得快去得快,真正靠得住的是长期饭票。在明朝,这张长期饭票就是封爵。 +在那个年代,如果你不姓朱,要想得到这张长期饭票是很困难的,老朱家开的食堂是有名额限制的,如非立有大功,是断然不可能到这个食堂里开饭的。 +具体说来,封爵这张饭票有三个等级,分别是公爵(小灶)、侯爵(中灶)、伯爵(大灶),此外还有流和世的区别,所谓流,就是说这张饭票只能你自己用,你的儿子就不能用了,富不过三代,饿死算他活该。而世就不同了,你死后,你的儿子、儿子的儿子还可以到食堂来吃饭。 +但凡拿到这张饭票的人,都会由皇帝发给铁券(证书),以表彰被封者的英勇行为。这张铁券也不简单,分为普通和特殊两种版本。特殊版本分别颁发于朱元璋时代和朱棣时代,因为在这两个时代要想拿到铁券是要拼老命的。 +朱元璋时代的铁券上书“开国辅运”四字,代表了你开国功臣的身份。朱棣时代的铁券上书“奉天靖难”四字,代表你奉上天之意帮助我朱棣篡权。这两个版本极为少见,在此之后的明朝二百多年历史中都从未再版。自此之后,所有的铁券统一为文臣铁券上书“守正文臣”,武将铁券上书“宣力功臣”。 +当然了,如果你有幸拿到前两张铁券,倒也不一定是好事。特别是第一版“开国辅运”,因为据有关部门统计,拿到这张铁券的人80%以上都会由朱元璋同志额外附送一张阴曹地府的观光游览券。 +此外还附有特别说明:单程票,适用于全家老小,可反复使用多次,不限人数。 +朱棣分封了跟随他靖难的功臣,如张玉(其爵位由其子张辅继承)、朱能等,都被封为世袭公侯,此时所有的将领们都十分高兴,收获的季节到了。 +但出人意料的是,有一个人对封赏却完全不感兴趣,在他看来,这些人人羡慕的赏赐似乎毫无价值。 +这个人就是道衍。 +虽然他并没有上阵打过仗,但毫无疑问的是,他才是朱棣靖难成功的第一功臣,从策划造反到出谋划策,他都是最主要的负责人之一。可以说,正是他把朱棣扶上了皇位。但当他劳心劳力的做成了这件天下第一大事之后,他却谢绝了所有的赏赐。永乐二年(1404),朱棣授官给道衍,任命他为资善大夫,太子少师(正二品),并且正式恢复他原先的名字——姚广孝。 +此后姚广孝的行为开始变得怪异起来,朱棣让他留头发还俗,他不干,分给他房子,还送给他两个女人做老婆,他不要。这位天下第一谋士每天住在和尚庙里,白天换上制服(官服)上朝,晚上回庙里就换上休闲服(僧服)。 +他不但不要官,也不要钱,在回家探亲时,他把朱棣赏赐给他的金银财宝都送给自己的同族。我们不禁要问,他到底为什么要这样做? +在我看来,姚广孝这样做的原因有两个,其一,他是个聪明人,像他这样的智谋之人,如果过于放肆,朱棣是一定容不下他的。功高震主这句话始终被他牢牢的记在心里。 +其二、他与其他人不同,他造反的目的就是造反。 +相信很多人都曾被问到,你为什么要读书?一般而言这个问题的答案都是建设祖国,为国争光之类,而在人们的心中,读书的真正目的大多是为了升官、发财,为了满足自己的各种欲望。但事实告诉我们,为了名利去做一件事情也许可以获得动力和成功,但要成就大的事业,需要的是另一种决心和回答——为了读书而读书。 +朱棣造反是为了皇位,他手下的大将们造反是为了开国功臣的身份和荣誉地位。道衍造反就是为了造反。他的眼光从来就没有被金钱权位牵制过,他有着更高的目标。道衍是一颗子弹,四十年的坎坷经历就是火药,他的权谋手段就是弹头,而朱棣对他而言只是引线,这颗子弹射向谁其实并不重要,能被发射出去就是他所有的愿望。 +姚广孝,一个被后人称为“黑衣宰相”、争论极大的人,一个深入简出、被神秘笼罩的人,他的愿望其实很简单: +一展胸中抱负,不负平生所学,足矣。 +兄 弟 +母子不相认 +《永乐实录》记载:高皇后(马皇后)生五子,长懿文太子标……次上(朱棣),次周王肃。这就是正史的记载,从中可以看出,朱棣是朱元璋和马皇后的第四个儿子。 +然而事实真是如此吗? +元至正二十年(1360),朱棣在战火中出生,他是朱元璋的第四个儿子,这并没有错,但那个经历痛苦的分娩,给予他生命、并抚育他长大的母亲却并不是马皇后,那个带着幸福的笑容看着他出生的女人早已经被历史湮没。 +事实上经过历史学家几百年的探究,到如今,我们也并不知道这位母亲的真实姓名,甚至她的真实身份也存在着争议。这些谜是人为造成的。因为有人不希望这位母亲暴露身份,不承认他有一个叫朱棣的儿子。 +这个隐瞒真相的人正是朱棣自己。 +因为朱棣是皇帝,而且是抢夺侄子皇位的皇帝,所以他必须是马皇后的儿子,因为只有这样,他才是嫡出,才有足够的资本去继承皇位。 +他绝不能是一个身份低贱妃子的儿子,绝对不能! +正是由于这些政治原因,这位母亲被剥夺了拥有儿子的权利,她永远也不能如同其他母亲一样,欣慰的看着自己的子女成长,并在他们长成后自豪的对周围的人说:“看,那就是我的儿子!” +在所有的官方史书中,她只不过是一个普通的妃子,没有显赫的家世,没有值得骄傲的子女,平凡的活着,然后平凡的死去。 +虽然朱棣反复修改了史书,并消灭了许多证据,但历史无法掩盖这句话实在是很有道理的,破绽是存在的,而更让人难以置信的是,它就存在于官方史书中。 +第一个破绽在明史《黄子澄传》中,其中记载:“子澄曰:周王,燕王之母弟。”从这句话,我们可以很清楚地了解到一个事实,那就是燕王朱棣和周王是同父同母的兄弟。可能有人会认为这是句废话,因为《永乐实录》中也记载了他们两个是同母兄弟,但问题在于,他们的母亲是谁? +于是下面我们将引出第二个破绽,《太祖成穆孙贵妃传》中,有记载如下:“洪武七年九月薨,年三十有二。帝以妃无子,命周王肃行慈母服三年。”这句话的意思是说,贵妃死后,由于没有儿子,所以指派周王为贵妃服三年,但关键的一句话在后面:“庶子为生母服三年,众子为庶母期,自妃始。” +“庶子为生母服三年!”看清楚这句话,关键就在这里。正是因为周王是庶子,他才能认庶母为慈母,并为之服三年。再引入我们之前燕王和周王是兄弟的条件,大家对朱棣的身份就应该有一个清楚的认识了。 +如果有人不明白,我可以用更为简单明了的方式来描述这个推论过程。 +条件A.周王和燕王是同母兄弟 +条件B.周王是庶子 +得出结论C.燕王是庶子。 +这是正式史书上的记载,至于野史那更是数不胜数,由于这是一个极为重要的问题,所以我们不引用野史,但另有一本应属官方史料记载的《南京太常寺志》曾记载朱棣母亲的真实身份——贡(左有石旁)妃。 +这里我们先说一下太常寺是一个什么样的机构,太常寺属于礼仪机关,主要负责祭祀、礼乐之事,凡是册立、测风、冠婚、征讨等事情都要在事先由该机关组织实施礼仪,所以它的记载是最准确的,按说有了太常寺的记载,这件事情就没有什么可争论的了,但好事多磨,又出了一个新的问题。 +此书已经失传了 +为了权力 +朱棣又一次向马皇后的神位行礼,虽然马皇后确实是一位慈祥的长辈,虽然她也曾无微不至的关照过自己,但她毕竟不是自己的母亲。 +我也是迫不得已,为了坐上皇位,已经是九死一生,如果再背上一个庶子的名分,怎能服众?怎能安心? +所以我修改了记录,所以我湮灭了证据,我绝不能承认你是我的母亲!我唯一能做的就是排出你的神位,提高你的身份,我能做的就是这些了。我知道这些并不够,也不足以报答你的生养之情,但我没有别的选择。 +您是我的母亲,只在我的心中,永远。 +兄弟不相容 +建文帝真的死了吗?这曾经是朱棣长时间思考过的一个问题,这个问题他思考了二十二年,从建文四年(1402)靖难成功开始,到永乐二十一年(1423)结束。不负有心人,他最终找到了这个问题的答案,仅仅在他临死之前一年。 +让我们回到建文四年(1402)的那个夏天,看看谜团的开始。 +六月十三日,李景隆打开金川门,做了无耻的叛徒,放北军入城,而朱棣却不马上攻击内城,他的目的是等待建文帝自己自杀或者投降,他似乎认为建文帝除了这两条路外,没有别的选择。然而建文帝注定是要和他一生作对的。他选择了第三条路。 +当扎营于龙江驿的朱棣发现宫城起火时,他十分慌乱,立刻命令士兵进城,救火倒是其次,最重要的是要找一样东西——建文帝,活的死的都行,活要见人!死要见尸! +朱棣十分清楚这件事的利害关系,即使建文帝死了,大不了背一个逼死主君罪名,自己的骂名够多了,不差这一个。活着的话关起来就是了,也不怕他飞上天去。 +但最可怕的事情就是失踪,皇帝不见了那可就麻烦了。 +朱允炆毕竟是合法的皇帝,而自己不过是占据了京城而已,全国大部分地方还是效忠于他的,万一他要是溜了出去,找一个地方号召大臣勤王,带兵攻打自己,到时候胜负还真是未知之数。 +可是怕什么来什么,经过清查,真的没有找到朱允炆的尸体!朱棣急得像热锅上蚂蚁,命令士兵加紧排查,仍然一无所获。可能有人会奇怪,朱棣已经控制了政权,要找个人还不容易么? +不瞒你说,还真是不容易,因为这个人是不能公开寻找的。 +首先不能登寻人启事,什么你叔叔病重,甚为想念,望你见启事后速回之类的话肯定是不会有效果的,其次也不能贴上通缉令,写上什么抓到后有重赏之类的言语,因为朱棣的行动按他自己的说法是靖难,即所谓扫除奸臣,皇帝是并没有错误的,怎么能够被通缉呢,所以这条也不行。最后,他也不能公开派人大规模寻找,因为这样无异于告诉所有的人,建文帝还活着,心中别有企图的人必然会蠢蠢欲动,这个皇位注定是坐不稳了。 +但是又不能不找,万一哪天蹦出来一个建文帝,真假且不论,号召力是肯定有的,即使平定下来,明天后天可能会出来两个三个,还让不让人安心过日子了?君不见一个所谓的“朱三太子”闹得清朝一百多年不得安宁,所以这实在是一件要命的事情啊。 +为解决这个问题,朱棣想出了一个绝佳的计划,这个计划分两个部分: +首先,向外界宣布,建文帝已经于宫内自焚,并找到了尸体,那意思就是所有建文帝的忠臣们,你们就死了这条心吧。 +其次,派人暗中查访建文帝的下落,具体的查访工作由两个人去做,这两个人寻访的路线也不同,分别是本土和海外。这两个人的名字,一个叫胡荧(有三点水旁),另一个叫郑和。 +郑和的故事大家都熟悉,我们在后面的章节也会详细介绍这次偶然事件引出的伟大壮举,在此,我们主要讲一下胡荧(有三点水旁)这一路的问题。 +胡荧(有三点水旁),江苏常州人,既不是靖难嫡系,也不是重臣之后,其为人“喜怒不形于色”,当时仅任给事中,没有任何靠山,可谓人微言轻。在朝中是个不起眼的人物。 +为了权力(2) +第二章帝王的荣耀 +无论我们从哪个角度来看,朱棣都绝对算不上一个好人,这个人冷酷、残忍、权欲熏心,在日常生活中,我们绝对不想和这样的一个人做朋友。但他却是一个实实在在的好皇帝。 +一个皇帝从不需要用个人的良好品格来证明自己的英明,恰恰相反,在历史上干皇帝这行的人基本都不是什么好人,因为好人干不了皇帝,朱允炆就是铁证。 +一个人从登上皇位成为皇帝的那一天起,他所得到的就绝不仅仅是权位而已,还有许许多多的敌人,他不但要和天斗、和地斗,还要和自己身边的几乎每一个人斗,大臣、太监、老婆(很多)、老婆的亲戚(也很多)、兄弟姐妹, 甚至还有父母(如果都还活着的话),他成为了所有人的目标。如果不拿出点手段,显示一下自己的能力,很容易被人找到空子踢下皇位,而历史证明,被踢下皇位的皇帝生存率是很低的。 +为了皇位,为了性命,必须学会权谋诡计,必须六亲不认,他要比最强横的恶霸更强横,比最无赖的流氓更无赖,他不能相信任何人。所以我认为,孤家寡人实在是对皇帝最好的称呼。 +朱棣就是这样的一个恶霸无赖,也是一个好皇帝。 +他精力充沛,以劳模朱元璋同志为榜样,每天干到很晚,不停的处理政务。他爱护百姓,关心民间疾苦,实行休养生息政策,在他的统治下,明朝变得越来越强大。荒地被开垦,人们生活水平提高,仓库堆满了粮食和钱币。经济科技文化都有很大的发展,他凭借自己的努力打造出了一个真正的太平盛世。 +他制定了很多利国利民的政策,也很好地执行了这些政策,使得明朝更为强大,如果要具体说明,还可以列出一大堆经济数字,这些都是套话,具体内容可参考历代历史教科书。我不愿意多写,相信大家也不愿意多看,但值得思考的是,这些举措历史上有很多皇帝都做过,也取得过不错的效果,为什么朱棣却可以超越他们中的绝大多数人,成为中国历史上为数不多的公认的伟大皇帝呢? +这是因为他做到了别的皇帝没有能够做到的事情。 +下面,我们将介绍这位伟大皇帝的功绩,就如同我们之前说过的那样,他绝对不是一个好人,却绝对是一个好皇帝。他用惊人的天赋和能力成就了巨大的功业,给我们留下了不朽的遗产,并在六百多年后依然影响着我们的国家和民族,所以从这个角度来说,他确实是中国历史上一位伟大的皇帝,当之无愧。 +修 书 +命运 +永乐十三年(1415),锦衣卫指挥纪纲下达了一道奇怪的命令,他要请自己牢里的一个犯人吃饭。这可是一条大新闻,纪纲是朱棣的红人,锦衣卫的最高统帅,居然会屈尊请一个囚犯吃饭,大家对此议论纷纷。 +这位囚犯欣然接受了邀请,但饭局开张的时候,纪纲并没有来,只是让人拿了很多酒给这位囚犯饮用,这位心事重重的囚犯一饮便停不住,他回想起了那梦幻般的往事,不一会便酩酊大醉。 +看他已经喝醉,早已接到指示的锦衣卫打开了大门,把他拖了出去。 +外面下着很大的雪,此时正是正月。 +这位囚犯被丢在了雪地里,在漫天大雪之时,在这纯洁的银白色世界里,在对往事的追忆和酒精的麻醉作用中,他迎来了死亡。 +这个囚犯就是被称为明代第一才子的解缙,永乐大典的主编者。这一年,他四十七岁。 +起点 +解缙,洪武二年(1369)出生,江西吉安府人,自幼聪明好学,被同乡之人称为才子,大家都认为他将来一定能出人头地。他没有辜负大家的期望,洪武二十一年(1388),他一举考中了进士,由于在家乡时他的名声已经很大,甚至传到了京城,所以朱元璋对他也十分重视,百忙之中还抽空接见了他。朱元璋的这一举动让所有的人都认为,一颗政治新星即将升起。 +当时正是政治形势错综复杂之时,胡维庸已经案发,法司各级官员不断逮捕大臣,很多今天同朝为臣的人第二天就不见了踪影,真可谓腥风血雨,变化莫测,在这样的环境下,很多大臣成了逍遥派,遇事睁只眼闭只眼,只求能活到退休。 +但解缙注定是个出人意料的人,在这种朝不保夕的恶劣政治环境中,他没有退却,畏缩,而是表现出了一个知识分子的骨气和勇敢。 +他勇敢的向朱元璋本人上书,针砭时弊,斥责不必要的杀戮,并呈上了一篇很有名的文章《太平十策》,在此文中,他详细概述了自己的政治思想和治国理念,为朱元璋勾画了一幅太平天下的图画,并对目前的一些政治制度提出了意见和批评。 +朱元璋的性格我们之前已经介绍过,你不去惹他,他都会来找你麻烦,可是这位解大胆居然敢摸老虎屁股,这实在是需要极大的勇气的。当时很多人都认为解缙疯了,因为只有疯子才敢去惹疯子。 +解缙疯没疯不好考证,但至少他没死。朱元璋一反常态,居然接受了他的批评,也没有找他的麻烦,当时的人们被惊呆了,他们想不通为什么解缙还能活下来,于是这位敢说真话的解缙开始名满天下。 +出了名后,烦恼也就来了,固然有人赞赏他的这种勇敢行为,但也有人说他在搞政治投机,是看准机会才上书的。但解缙用他的行为粉碎了所谓投机的说法。他又干出了一件惊天动地的事情。 +洪武二十三年(1390),朱元璋杀掉了李善长,这件事情有着很深的政治背景,当时的大臣们都很清楚,断然不敢多说一句话。可是永不畏惧的解缙又开始行动了,他代自己的好友上书朱元璋,为李善长申辩。 +这是一起非常严重的政治事件,朱元璋十分恼火,他知道文章是解缙写的,但出人意料的是,他仍然没有对解缙怎么样,这件事情给了解缙一个错误的信号,他认为,朱元璋是不会把自己怎么样的。 +解缙继续他的这种极为危险的游戏,他胸怀壮志,不畏权威,敢于说真话,然而他根本不明白,这种举动注定是要付出沉重代价的。不久,他就得到了处罚。 +洪武二十四年(1391),朱元璋把解缙赶回了家,并丢给他一句话“十年之后再用”。 +于是,解缙沿着三年前他进京赶考的路回到了自己的家,荣华富贵只是美梦一场,沿路的景色并没有什么变化,然而解缙的心却变了。 +他始终不明白,自己只不过是说了几句实话,就受到了这样的处罚,读书人做官不就是为了天下苍生吗,不就是为国家效力吗? 这是什么道理! +那些整天不干正事,遇到难题就让,遇到障碍就倒的无耻之徒牢牢的把握着权位,自己这样全心为国效力的人却得到这样的待遇,这不公平。 +罢官的日子是苦闷的,人类的最大痛苦并不在于一无所有,而是拥有一切后再失去。京城的繁华,众人的仰慕,皇帝的器重,这些以往的场景时刻缠绕在解缙的心头。 +在故乡的日子,他一直思索着一个问题,那就是,自己为什么会失败?才学?度量? +不,不是这些,终于有一天,他开始意识到,自己失败的原因是幼稚,幼稚得一塌糊涂,自己根本就不知道官场是个什么地方。信仰和正直在朝堂之上是没有市场的,要想获得成功,只能迎合皇帝,要使用权谋手段,把握每一个机会,不断的升迁,提高自己的地位! +解缙终于找到了他自认为正确的道路,他的一生就此开始转变。 +洪武三十一年(1398),朱元璋去世了,此时距解缙回家已经过去了七年,虽然还没有到十年的约定之期,但解缙还是开始行动了,他很明白,就算到了十年之期,也不会有官做的的,要想当官,只能靠自己! +他依靠先前的关系网,不断向高官和皇帝上书,要求获得官职,然而命运又和他开了一个玩笑,建文帝虽然知道他很有才能,却不愿用他,只给了他一个小官。把他远远的打法到遥远的西部。幸好他反应快,马上找人疏通关系,终于留在了京城,在翰林院当了一名小官。 +此时的解缙已经完全没有了青年时期的雄心壮志,他终于明白了政治的黑暗和丑恶,要想往上爬,就不能有原则,不能有尊严,要会溜须拍马,要会逢迎奉承,什么都要,就是不能要脸! +黑暗的世界啊,我把灵魂卖给你,我只要荣华富贵! +收下了他的灵魂,黑暗的世界给了他一次机会。 +转 折 +于是,解缙就此成为了朱棣的宠臣,无论他用了什么手段,他毕竟实现了自己的梦想。从此他开始了自己的传奇性的一生,但在此之前,我们有必要介绍一下,投降三人组中其余两个成员的下落。 +李贯:朱棣在掌握政权后,拿到了很多朝臣给建文帝的奏章,里面也有很多要求讨伐他的文字,他以开玩笑似的口吻对朝堂上的大臣们说:“这些奏章你们都有份吧。”下面的大臣个个心惊胆战,其实朱棣不过是想开个玩笑而已,他并不会去追究这些人的责任,但一件意想不到的事情发生了。 +惹事的正是这个李贯,他从容不迫的说道:“我没有,从来也没有。”然后摆出一幅怡然自得的样子。他是一个精明人,很早就注意到了这个问题,为了避祸,他从未上过类似的奏章。 +现在他的聪明才智终于得到了回报,不过,是以他绝对预料不到的方式。 +朱棣走到李贯面前,突然把奏章扔到了他的脸上,厉声说道: +“你还引以为荣吗!你领国家的俸禄,当国家的官员,危急时刻,你作为近侍竟然一句话都不说,我最厌恶的就是你这种人!” +全身发抖的李贯缩成一团,他没有想到,无耻也是要付出代价的。 +在这之后,他因为犯法被关进监狱,最后死于狱中,在他临死时,终于悔悟了自己的行为,失声泣道:“王敬止(王艮字敬止),我没脸去见你啊。” +胡广:之后一直官运亨通,因为文章写得好,有一定处理政务的能力,与解缙一起被任命为明朝首任内阁七名成员之一,后被封为文渊阁大学士。此人死后被追封为礼部尚书,他还创造了一个记录,那就是他是明朝第一个获得谥号的文臣,他的谥号叫做“文穆”。 +综观他的一生,此人没有吃过什么亏,似乎还过的很不错,不过一个人的品行终归是会暴露出来的。 +当年胡广和解缙投奔朱棣后,朱棣看到他们是同乡,关系还很好,便有意让他们成为亲家,但当时解缙虽然已经有了儿子,胡广的老婆却是刚刚怀孕,不知是男是女。此时妇产科专家朱棣在未经B超探查的情况下,断言:“一定是女的。” +结果胡广的老婆确实生了个女孩,所以说领导就是有水平,居然在政务活动之余对妇产科这种副业有如此深的造诣。事后证明,这个女孩也确实不简单,可惜我在史料中没有找到她的名字,只知道她肯定姓胡。 +这个女孩如约与解缙之子完婚,两家都财大气粗,是众人羡慕的佳对。然而天有不测风云,解缙后来被关进监狱,他的儿子也被流放到辽东,此时胡广又露出了他两面三刀的本性,亲家一倒霉掉进井里,他就立刻四处找石头。勒令自己的女儿与对方离婚。 +在那个时代,父母之命就是一切,然而这位被朱棣赐婚的女孩很有几分朱棣的霸气,她干出了足以让自己父亲羞愧汗颜的行为。胡广几次逼迫劝说,毫无效果,最后他得到了自己女儿的最终态度,不是分离的文书,而是一只耳朵。 +她的女儿为表明决不分离的决心,割下了自己的耳朵以明志,还怒斥父亲:“我的亲事虽然不幸,但也是皇上做主,你答应过的,怎么能够这样做呢,宁死不分!” +这位壮烈女子的行为引起了轰动,众人也借此看清了胡广的面目,而解缙的儿子最终也获得了赦免,回到了那位女子的身边。 +胡广,羞愧吧,你虽饱读诗书,官运亨通,气节却不如一个普通女子! +还是那句话,人心自有公论。 +飞 腾 +盛世修书,实非虚言 +除了以上所说的这些人外,朱棣还给解缙派去了一个帮手,和他共同主编此书。这个人说是帮手,实际上应该是监工,因为在此之前,他只做过一次二把手,不巧的是,一把手正是朱棣。 +这个监工就是姚广孝。 +姚广孝不但精于权谋,还十分有才学,明朝初年第一学者宋濂也十分欣赏他的才华,而那个时候,解缙还在穿开裆裤呢。 +把这样的一个重量级人物放在解缙身边,朱棣的决心可想而知。 +当朱棣以排山倒海之势摆出这样一幅豪华阵容时,解缙才终于明白,自己将要完成的是一件多么宏大、光荣的事情。如果不能完成或是完成不好,那就不仅仅是丢官的问题了。 +啥也别说了,开始玩命干吧! +在经过领导批示后,解缙同志终于端正了态度,沿着领导指示的方向前进,事实证明,朱棣确实没有看错人。解缙充分发挥了他的才学,他合理的安排者各项工作, 采购、辨析、编写、校对都有条不紊的进行着,每次编写完一部分,他都要亲自审阅,并提出修改意见。作为这支庞大知识分子队伍中的佼佼者,他做得很出色。 +当这上千人的编撰队伍在他的手中有序运转,所修大典不断接近完成和完善时,解缙终于实现了自己的人生价值和梦想,他不再是怀才不遇的书生,而是国家的栋梁。 +在修撰大典的过程中,朱棣还不断地给予帮助和关照,永乐四年(1406)四月,朱棣在百忙之中专门抽出时间探望了日夜战斗在工作岗位上的各位修撰人员,并亲切地询问解缙在工作和生活中有何困难,解缙感谢领导的关心,并表示一定再接再厉,把工作做好,以报答皇帝陛下的恩情,不辜负全国知识分子的期望。最后他提出,大典经史部分已经差不多完成了,但子集部分还有很多缺憾。 +朱棣当即表示,哪里有困难,就来找我,一定能够解决,不就是缺书吗,给你钱,去买,要多少给多少!之后他立刻责成有关部门(礼部)派人出去买书。 +有了这样的政治支持和经济支持,再加上解缙的得力指挥和安排,无数勤勤恳恳的知识分子日夜不休的工作着,他们在无数个灯火通明的夜晚笔耕不辍,舍弃了自己的家庭和娱乐,付出了健康甚至生命的代价(其中有不少人因为劳累过度而死),只为了完成这部古往今来最为伟大的著作。 +他们中间的很多人可能并没有什么伟大的理想,因为大部分人只是平凡的抄写员,编撰人,在当时,他们也都只是普通的读书人而已。他们的人生似乎和伟大这两个字扯不上任何关系,但他们所做的却是一件伟大的事。历史不会留下他们的名字,但这部伟大著作的每一页、每一行都流淌着他们的心血。 +所以不管是累得吐血的编撰,还是整日埋头抄书的书者,他们都是英雄,当之无愧的英雄。 +每一个人都是 +投机 +永乐大典是解缙一生的最辉煌的成就,也是他一生最高点,然而在此书完结时,那些欢欣雀跃的人中却没有解缙的身影,因为此时,他已经从人生的高峰跌落下来,被贬到了当时人迹罕至的广西。为什么才高八斗、功勋卓著的解缙会落到如此境地呢?谁又该对此负责呢? +其实解缙落到这步田地完全可以用一个词来形容——咎由自取。 +因为他做了一件自己并不擅长的事情——投机。 +要说到投机,解缙并不是生手,我们之前介绍过他拒绝了建文帝方面低微的官职的诱惑,排除万难毅然奔赴朱棣身边的光辉事迹,当然,他的这一举动是有着充分理由的。因为朱棣需要他,而他也需要朱棣。解缙有名气和才能,朱棣有权和钱,互相利用而已。 +读书种子方孝孺已经被杀掉了,为了证明天下的读书人并非都是硬骨头,为了证明这个世界上还是有人愿意和新皇帝合作,朱棣自然把主动投靠的解缙当成宝贝。他不但任命解缙为永乐大典和第二版太祖实录的总编,还在政治上对他委以重任,在明朝的首任内阁中给他留了一个重要的位置。此任内阁总共七人,个个都是精英,后来为明朝“仁宣盛世”做出巨大贡献的“三杨”中的两杨都在此内阁中担任要职。 +除此之外,朱棣还经常在下班(散朝)之后单独找解缙谈话,用今天的话来说,这叫“重点培养”,朱棣不止一次的大臣们面前说:“得到解缙,真是上天垂怜于我啊!” +解缙以政治上的正直直言出名,却因政治投机得益,这真是一种讽刺。 +解缙终于满足了,他似乎意识到,自己多年来没有成功,只是因为当年政治上的幼稚,为什么一定要说那么多违背皇帝意志的话呢,那不是难为自己吗? +而这次政治投机的成功也让他认定,今后不要再关心那些与己无关的事情,只有积极投身政治,看准政治方向,并放下自己的政治筹码,才能保证自己的权力和地位。 +于是,当年的那个一心为民请命、为国效力的单纯的读书人死去了,取而代之的是一个跃跃欲试、胸有城府的政客。 +也许在很多人看来,这也并没有什么大惊小怪的,只不过是一个人对自己人生的选择罢了,但问题在于,解缙在作出这个选择的时候忘记了一个重要而简单的原则,而正是这个简单的原则断送了他的一生。 +这条原则就是:不要做你不擅长的事。 +在我们小的时候,经常会有很多梦想,长大之后要干这个、干那个,现在的小孩想干什么职业我不知道,但在我的那个年代,科学家绝对是第一选择。我当年也曾经憧憬过自己拿着试剂瓶在实验室里不停的摇晃,摇什么并不重要,只是那种感觉实在是太好了。 +但在长大之后,那些梦想的少年们却并没有真的成为科学家,至少大多数没有。因为在他们的成长过程中,无数的人、无数的事都明确无误的告诉他:“别做梦了,你不是这块料!” +这句话倒不一定是打击,在很多情况下,它是真诚的劝诫。 +上天是很公平的,它会把不同的天赋赋予不同的人,有人擅长这些,有人擅长那些,这才构成了我们这个多姿多彩的世界。综合解缙的一生来看,他所擅长的是做学问,而不是搞政治。 +可是这位本该埋头做学问的人从政治投机中尝到甜头,在长期的政治斗争中积累了一定的经验,便天真地认为自己已经成为了政治高手,从此他义无反顾地投入到了政治斗争的漩涡之中。 +很不幸的是,他跳入的还不是一般的漩涡,而是关系到帝国根本的最大漩涡——继承人问题。 +战争年代,武将造反频繁,原因无它,权位而已,要获得权位,最好的办法是自己当皇帝,但这一方法难度太大(参见朱元璋同志发展史),于是很多武将退而求其次,只要能够拥立一个新的皇帝,自己将来就是开国功臣,新老板自然不会忘记穷兄弟,多少是要给点好处的,虽然这行也有风险,比如你遇上的老板不姓赵而是姓朱,那就完蛋了。但和可能的收益比起来,收益还是大于成本的。 +和平年代就不能这么干了,造反的成本太大,而且十分不容易成功(可参考朱棣同志的生平经历),但一步登天、青云直上是每一个人都梦想的事。于是诸位大臣们退而求其次,寻找将来皇位的继承者。因为皇帝总有一天是要死掉的,如果在他死掉之前成为继承人的心腹,将来必能被委以重任。但这一行也有风险,因为考虑到皇帝的特殊身份和兴趣爱好,以及我国长期以来男女不平等的状况,在很多情况下,皇帝的儿子数量皆为N(N大于等于2)。而如果你遇到一个精力旺盛的皇帝(比如康熙),那就麻烦了。 +所以说?立继承人可实在不是开玩笑的事情,可以比作一场赌博,万一你押错了宝,下错了筹码,新君并非你所拥立的那位,那就等着倒霉吧,覆巢之下,岂有完卵?你的主子都完蛋了,你还能有出头之日吗? +可是解缙决心赌一把,应该说他是一个有远见的人,虽然朱棣现在信任他,但朱棣会老,会死,要想长久保住自己的位置,就必须早作打算,解缙经过长期观察,终于选定了自己的目标。 +永乐二年(1404),他在一位皇子的名下押下了自己所有的筹码——朱高炽。 +关于朱高炽和朱高煦的权位之争,我们后面还要专门介绍,这里只说与解缙有关的一些事情。 +其实这二位殿下的矛盾从靖难之时起就已经存在了,大臣们心中都有数,朱棣心里也明白。其实就其本心而言,确实是想传位给朱高煦的,因为朱高煦立有大功,而且长得比较帅。而朱高炽却是个残疾,眼睛还有点问题,要当国家领导人,形象上确实差点。 +但是朱高炽是长子,立长也算是长期以来的传统,所以朱棣一直犹豫不定,于是他便去征求靖难功臣们的意见。不出所料,大部分参加过靖难的人都推荐朱高煦,这也可以理解,毕竟在一条战线上打过仗,有个战友的名头将来好办事。 +有一个人反对 +双方开门见山 +朱棣问:“你认为该立谁?” +解缙答:“世子(指朱高炽)仁厚,应该立为太子。” +朱棣不说话了,但解缙明白,这是一种否定的表示,他并没有慌乱,因为他还有杀手锏,只要把下一个理由说出来,大位非朱高炽莫属! +解缙再拜道:“好圣孙!” +朱棣笑了,解缙也笑了,事情就此定局。 +所谓好圣孙是指朱高炽的儿子朱瞻基(后来的明宣宗),此人天生聪慧,深得朱棣喜爱,解缙抓住了最关键的地方,为朱高炽立下了汗马功劳。 +这是一次载入史册的谈话,在这次谈话中,解缙充分发挥了他扎实的才学和心理学知识,在这件帝国第一大事上做出了巨大的贡献,当然这一贡献是相对于朱高炽而言的。 +朱高炽了解此事后十分感激解缙,他跛着脚来到解缙的住处,亲自向他道谢。 +朱高炽放心了,解缙也放心了,一个放心皇位在手,一个放心权位不变。 +然而事实证明,他们都太乐观了。朱高炽的事情我们后面再讲,这里先讲解缙,解缙的问题在于他根本不明白,所谓的大局已定是相对而言的,只要朱棣一天不死,朱高炽就只能作他的太子,而太子不过是皇位的继承人,并不是所有者,也无法保证解缙的地位和安全。 +更为严重的是,解缙拥护朱高炽的行为已经使他成为了朱高煦的眼中钉肉中刺。而解缙并不清楚:朱高煦就算解决不了朱高炽,解决一个小小的解缙还是绰绰有余的。 +然而解缙还沉浸在成功的喜悦中,他太自大了,他似乎认为自己搞权谋手段的能力并不亚于做学问。但他错了,他的那两下子在政治老手面前简直就是小孩子把戏。一场灾难即将向解缙袭来。 +来得还真快 +终点 +如果事情就这样结束,解缙也许会作为一个囚徒走完自己的一生,或者在某一次大赦中出狱,当一个老百姓,找一份教书先生的工作糊口,但上天注定要让他的一生有一个悲剧的结局,以吸引后来的人们更多的目光。 +永乐十三年(1315),锦衣卫纪纲向朱棣上报囚犯名单,朱棣在翻看时找到了解缙的名字,于是他说出了一句水平很高的话:“解缙还在吗?”(缙犹在耶) +缙犹在耶?这句话的意思很明显,就是问纪纲为什么这个人还活着,但同时这句话的另一层意思就是——他不应该还活着。 +朱棣是擅长暗语的高手,在此之前的永乐七年(1409),他说过一句类似的话,而那句话的对象是平安。 +事情的经过十分类似,朱棣在翻看官员名录时看到了平安的名字,便说了一句:“平安还在吗?”(平保儿尚在耶) +平安是一个很自觉的人,听到朱棣的话后便自杀了。 +平安是可怜的,解缙比他更可怜,因为他连自杀的权利都没有。 +长年干特务工作的纪纲对这种暗语是非常精通的,加上他一直以来就和解缙有矛盾,于是便有了开头的那一幕。 +解缙就在雪地里结束了自己的一生,洁白的大雪掩盖了解缙的尸体和他那不再洁白的心,当年那个正义直言的解缙大概也想不到自己会有这样的结局。 +无论如何,解缙的一生是有意义的,因为不管他做了什么事情,是错还是对,都无法掩盖他的功绩,由他主编的永乐大典一直保留至今,为我们留下了大量的知识财富,当我们看到那些宝贵典籍时,我们应该记得,有一个叫解缙的人曾为此费尽心力,仅凭这一点,他就足以为赢得我们后世之人的尊重。 +帝王的抉择 +不通 +在当时,从南方主要产粮区到北方的河道是不通畅的,运河栓塞,河流改道给当时的河运带了了极大的不便,除非明代的船只是水陆两用型,否则想一路顺风是绝对不可能的。明太祖朱元璋就在这上面吃过大亏,想当年他老人家打仗的时候,需要从南方向辽东、北平一带调集军粮,但河运不通,无奈之下,只好取道海路,经渤海运输,绕远路不说,还因为风浪太大,很不安全,十斤军粮能送到一半已经是谢天谢地了 +可是修整河道决不是一件可以随便提出的事情,大家应该还记得,元朝灭亡的导火线就是治理河道。水利工程无论在哪个年代都绝对是国家重点投入的项目。需要大笔的金钱和众多的劳力。而且万一花钱太多,动摇了国家根本,问题可就严重了(隋炀帝的京杭大运河就是例子),所以这件事情和修书一样,不是强国盛世你连想都不要想。 +朱棣的时代就是盛世。 +经过洪武年间的长期恢复,加上朱棣正确的治国方略,当时的明朝已经有了足够的经济实力去完成以前无法想象的事情。永乐大典也修出来了,搞点水利自然不在话下。 +永乐九年(1411),朱棣命令工部尚书宋礼治理会通河,以保证河道的畅通,宋礼是一个很有能力的水利专家,他完成了任务,此后漕运总督陈瑄进一步疏通了河道,从此南北漕运畅通无阻,所谓“南极江口,北尽大通桥,运道三千余里”,粮食问题最终得到了解决。 +而迁都的其他工作也一直在紧张地进行之中,中央各部门的办公单位早在永乐七年(1409)就已经修好,而京城的建设工作于永乐十五年开始,一直进行了三十余年才结束。 +眼见机会成熟,朱棣于永乐十九年(1431)正式下令:迁都! +原先的京师改名为南京,北京作为明帝国新的都城被确定下来,从此北京这个城市正式成为了明朝首都,并一直延续了二百余年,但它的历史却并未随着明朝的灭亡而结束,相反,它一直富有生气的存在和发展着,并最终成为世界上最有影响力的城市之一。 +当今天的我们徜徉在北京这个现代化都市,看着高楼林立、车水马龙的繁华景象时,不应该忘记,正是五百多年前的一个叫朱棣的人奠定了这一切的基础。 +要说明的是,朱棣在建设北京时,是有着相当的现代意识的,他十分注意城市的整体规划,分别修建了数条主线和支线,把北京市区规划成形状整齐的方块,并制定了严厉的规定,禁止乱搭乱盖,还铺设了完整的下水道系统。 +而现在我们看到的故宫和天坛等北京著名建筑,都是朱棣时代打下的基础(此后清朝曾经整修过)。特别值得一提的是故宫,它占地十七万平方米,征用无数劳力,用了二十年完成,它原先只是供皇帝居住的地方,老百姓绝对与之无缘,也没有买票参观这一说,但这并不能影响它在历史上的地位。现在故宫已作为中华民族的历史瑰宝成为我们每个中国人的骄傲。 +无可否认,这正是朱棣的功绩,不能也无法抹煞 +值得一提的是,当年的迁都决不是一帆风顺,众人响应的,实际上,根本没有几个人赞成朱棣的这一决策。 +原因很简单,除了朱棣靖难带过来的那些人之外,朝廷大部分大臣都是长期在南方生活的,老婆孩子都在南京,狐朋狗友、社会关系也都在这里,谁愿意跟着朱棣去北方吹风? +恰好在迁都后不久,皇宫发生火灾,而且全国很多地方都出现自然灾害,当时人们称为“天灾”,大臣们自然而然的就把这些事情归结为——都是迁都惹的祸。 +朱棣为人虽然够狠够绝,但毕竟自然科学理论知识修养不足,他也有点慌乱,便向群臣征求意见,以便弥补过失。 +但他没有想到的是,大臣们却借此机会对他发起了猛烈的攻击。 +许多大臣上书,陈说迁都的害处,并表示之所以有天灾,就是因为迁都造成的。其中主事箫仪的言辞最为激烈,史料记载“仪言之尤峻”,至于他到底说了些什么并未列出,但估计是骂了朱棣,大家知道,朱棣从来就不是个忍气吞声的人,他的回应也很干脆,直接就把箫仪杀掉了。 +这下可捅了马蜂窝,要知道读书人可不是好惹的,自幼聆听圣贤之言,以天子门生自居,皇帝又怎么样?怕你不成? +于是众多大臣纷纷上书,言论如潮,还在午门外集会公开辩论,说是辩论会,但会上意见完全是一边倒,其实就是针对朱棣的集会,如果换个一般的皇帝,看到如此多的手下反对自己,很可能会动摇,但朱棣不是一般的皇帝,他坚持了自己的看法,坚定了迁都的决心。 +“你们都不要再说了,迁都是我做的决定,一定要迁,我说了算,就这么办了!” +朱棣这样做是需要勇气的,他在反对者占多数的情况下,还敢于坚持观点,毫不退让,事实上,很多大臣提出的意见也是很中肯的,如迁都劳民伤财,引发贪污腐败等,都是客观存在的事实。但历史将会证明,朱棣的选择是正确的。 +在历史上,经常会出现一些十分有水平的人物,他们能够在形势尚不明朗之前预见到事物将来的发展,如诸葛亮在破草房里就能琢磨出天下将来会三分等,但诸葛亮的这种琢磨是不需要成本的,即使他琢磨得不对,也没有人去找他麻烦。 +容易出麻烦的是抉择,也就是说,必须牺牲某些眼前的利益去换来将来更长远的利益。这种抉择往往是极为痛苦的,因为眼前利益是大家都能看到的,长远的利益却是看不到的,就好比你让大家丢下手中已有的钞票,跟着你去挖金矿,金矿固然诱人,但是否真有却着实要画个大问号,你说有就有?凭什么? +一百多年后伟大的改革家张居正就是栽倒在这种抉择上的,因为那些大臣们宁可抱着手上的那点家当等死,也不肯跟他去走那条未知的道路。 +朱棣就是这样一个很有水平的领导,也是一个敢于抉择的领导,他知道迁都是一项大工程,耗时耗力,但他准确地判断出,影响明帝国的长治久安的最大因素就是北方的蒙古,要想将来平平安安过日子,就必须舍弃眼前的利益,迁都北京。否则明朝将难逃南宋的厄运。 +与张居正相比,朱棣有一个优势——他是皇帝,而且还是一个铁腕皇帝,一个敢背骂名我行我素的皇帝,所以他能够一直坚持自己的信念,所以他终于完成了迁都这项艰难的工作。 +朱棣迁都的行为招致了当时众人的反对,很多人也断言此举必不可行,但十九年后站在北京城头遥望远方的于谦应该不会这样想。 +历史才是事物发展最终的判断者,在不久之后,它将毫无疑问地告诉每一个人:朱棣的抉择是正确的。 +郑和之后 +出航 +朱棣安排郑和出海是有着深层次目的的,除了寻找建文帝外,郑和还肩负着威服四海,胸怀远人的使命,这大致也可以算是中国历史上的老传统,但凡强盛的朝代,必定会有这样的一些举动,如汉朝时候贯通东西的丝绸之路,唐朝时众多发展中国家及不发达国家留学生来到我国学习先进的科学文化技术,都是这一传统的表现。 +中国强盛,万国景仰,这大概就是历来皇帝们最大的梦想吧,历史上的中国并没有太多的领土要求,这是因为我们一向都很自负,天朝上国,万物丰盛,何必去抢人家的破衣烂衫? +但正如俗话所说,锋芒自有毕现之日,强盛于东方之中国的光辉是无法掩盖的,当它的先进和文明为世界所公认之时,威服四海的时刻自然也就到来了。 +实话实说,在中国强盛之时,虽然也因其势力的扩大与外国发生过领土争端和战争(如唐与阿拉伯之战),也曾发动过对近邻国家的战争(如征高丽之战),但总体而言,中国的外交政策还是比较开明的,我们慷慨的给予外来者帮助,并将中华民族的先进科学文化成就传播到世界各地,四大发明就是最大的例证。 +综合来看,我们可以用四个字来形容中国胸怀远人的传统和宗旨: +以德服人 +无敌舰队 +我们之前曾不断用舰队这个词语来称呼郑和的船队,似乎略显夸张,一支外交兼寻人的船队怎么能被称为舰队呢,但看了下面的介绍,相信你就会认同,除了舰队外,实在没有别的词语可以形容他的这支船队。 +托当年一代枭雄陈友谅的服,朱元璋对造船技术十分重视,这也难怪,当年老朱在与老陈的水战中吃了不少亏,连命也差点搭进去。在他的鼓励下,明朝的造船工艺有了极大的发展,据史料记载,当时郑和的船只中最大的叫做宝船,这船到底有多大呢,“大者,长四十四丈四尺,阔一十八丈;中者,长三十七丈,阔一十五丈”。大家可以自己换算一下,按照这个长度,郑和大可在航海之余举办个运动会,设置了百米跑道绝对不成问题。 +而这条船的帆绝非我们电视上看到的那种单帆,让人难以想象的是,它有十二张帆!它的锚和舵也都是巨无霸型的,转动的时候需要几百人喊口号一起动手才能摆得动,南京市在五十年代曾经挖掘过明代宝船制造遗址,出土过一根木杆,这根木杆长十一米,问题来了,这根木杆是船上的哪个部位呢? +鉴定结论出来了,让所有的人都目瞪口呆,这根木杆不是人们预想中的桅杆,而是舵杆! +如果你不明白这是个什么概念,我可以说明一下,桅杆是什么大家应该清楚,所谓舵杆只不过是船只舵叶的控制联动杆,经过推算,这根舵杆连接的舵叶高度大约为六米左右。也就是说这条船的舵叶有三层楼高! +航空母舰,名副其实的航空母舰 +这种宝船就是郑和舰队的主力舰,也就是我们通常所说的旗舰,此外还有专门用于运输的马船,用于作战的战船,用于运粮食的粮船和专门在各大船只之间运人的水船。 +郑和率领的就是这样的一支舰队,舰队之名实在实至名归。 +这是郑和船队的情况,那么他带了多少人下西洋呢? +“将士卒二万七千八百余人” +说句实话,从这个数字看,这支船队无论如何也不像是去寻人或是办外交的,倒是很让人怀疑是出去找碴打仗的。但事实告诉我们,这确实是一支友好的舰队,所到之处,没有战争和鲜血,只有和平和友善。 +强而不欺,威而不霸,这才是一个伟大国家和民族的气度与底蕴。 +郑和的船队向南航行,首先到达了占城,然后他们自占城南下,半个月后到达爪哇(印度尼西亚爪哇岛),此地是马六甲海峡的重要据点,但凡由马六甲海峡去非洲必经此地,在当时,这里也是一个人口稠密,物产丰富的地方,当然,当时这地方还没有统一的印度尼西亚政府。而且直到今天,我们也搞不清当时岛上的政府是由什么人组成的。 +郑和的船队到达此地后,本想继续南下,但一场悲剧突然发生了,船队的航程被迫停止了,而郑和将面对他的航海生涯中的第一次艰难考验。 +事情是这样的,当是统治爪哇国的有两个国王,互相之间开战,史料记载是“东王”和“西王”,至于到底是些什么人,那也是一笔糊涂账,反正是“西王”战胜了“东王”。“东王”战败后,国家也被灭了,“西王”准备秋后算账,正好此时,郑和船队经过“东王”的领地,“西王”手下的人杀红了眼,也没细看,竟然杀了船队上岸船员一百七十多人。 +郑和得知这个消息后,感到十分意外,手下的士兵们听说这个巴掌大的地方武装居然敢杀大明的人,十分愤怒和激动,跑到郑和面前,声泪俱下,要求就地解决那个什么“西王”,让他上西天去做一个名副其实的王。 +郑和冷静地看着围在他四周激动的下属,他明白,这些愤怒的人之所以没有动手攻打爪哇,只是因为还没有接到他的命令。 +那些受害的船员中有很多人郑和都见过,大家辛辛苦苦跟随他下西洋,是为了完成使命,并不是来送命的,他们的无辜被杀郑和也很气愤,他完全有理由去攻打这位所谓的“西王”,而且毫无疑问,这是一场毫无悬念的战争,自己的军队装备了火炮和火枪等先进武器,而对手不过是当地的一些土著而已,只要他一声令下,自己的舰队将轻易获得胜利,并为死难的船员们报仇雪恨。 +但他没有下达这样的命令。 +他镇定地看着那些跃跃欲试的下属,告诉他们,决不能开战,因为我们负有更大的使命。 +和平的使命 +留个纪念吧 +他带领属下和当地人一起建立了一个碑亭,并刻上碑文,以纪念这段历史,文曰: +其国去中国十万余里,民物咸若,熙皞同风,刻石于兹,永昭万世。 +这是一座历史的里程碑。 +郑和的船队开始返航了,迎风站在船上的郑和注视着那渐渐远去的古里海岸,这是一个美丽的地方,我们会再来的! +也许是宿命的安排吧,郑和不会想到,美丽的古里不但是他第一次航程的终点,也将会成为他传奇一生的终点! +第一次远航就这样完成了,船队浩浩荡荡地向着中国返航,然而上天似乎并不愿意郑和就这样风平浪静地回到祖国,它已经为这些急于回家的人们准备好了最后一道难关,而对于郑和和他的船队来说,这是一场真正的考验,一场生死攸关的考验。 +自古以来,交通要道都绝不是什么安全的地方,因为很多原本靠天吃饭的人会发现其实靠路吃饭更有效,于是陆路上有了路霸,海上有了海盗,但无论陆路海路,他们的开场白和口号都是一样的——要想从此过,留下买路财。 +按说郑和的舰队似乎不应该受到这些骚扰,但这决不是因为强盗们为这支舰队的和平使命而感动,而是军事实力的威慑作用。 +即使是再凶悍的强盗,也要考虑抢劫的成本,像郑和这样带着几万士兵拿着火枪招摇过市,航空母舰上架大炮的主,实在是不好对付的。 +北欧的海盗再猖獗,也不敢去抢西班牙的无敌舰队,干抢劫之前要先掂掂自己的斤两,这一原则早已被古今中外的诸多精明强盗们都牢记在心。 +但这个世界上,有精明的强盗就必然有拙劣的强盗,一时头脑发热、误判形势,带支手枪就敢抢坦克的人也不是没有,下面我们要介绍的就是这样一位头脑发热的仁兄。 +此人名叫陈祖义,他正准备开始自己人生中最大的一次抢劫。 +当然,也是最后一次。 +陈祖义,广东潮州人,洪武年间因为犯罪逃往海外,当年没有国际刑警组织,也没有引渡条例,所以也就没人再去管他,后来,他逃到了三佛齐(今属印度尼西亚)的渤林邦国,在国王麻那者巫里手下当上了大将。 +真是厉害,这位陈祖义不过是个逃犯,原先也没发现他担任过什么职务,最多是个村长,到了这个渤林邦国(不好意思,我实在不知道是现在的哪个地方),居然成了重臣,中国真是多人才啊。 +更厉害的还在后面,国王死后,他召集了一批海盗,自立为王,就这样,这位陈祖义成为了渤林邦国的国王。 +以上就是陈祖义先生的奋斗成功史,估计也算不上为国争光吧。 +陈祖义有了兵(海盗),便经常在马六甲海峡附近干起老本行——抢劫,这也很正常,他手下的都是海盗,海盗不去打劫还能干啥,周围的国家深受其害,但由于这些国家都很弱小,也奈何不得陈祖义。 +就这样,陈祖义的胆子和胃口都越来越大,逐渐演变到专门打劫大船,商船,猖獗了很多年,直到他遇到了郑和。 +郑和的船队浩浩荡荡地开过三佛齐时,刚好撞到陈祖义,郑和对此人也早有耳闻,便做好了战斗准备,而陈祖义却做出了一个让所有人都意想不到的决定。 +他决定向郑和投降。 +要知道,陈祖义虽然贪婪,但却绝不是个疯子,他能够混到国王的位置(实际只是一个小部落),也是不容易的,看着那些堪称庞然大物的战船和黑洞洞的炮口,但凡神智清醒的人都不会甘愿当炮灰的。 +但海盗毕竟是海盗,陈祖义的投降只不过是权宜之计,郑和船上的那些金银财宝是最大的诱惑,在陈祖义看来只要干成了这一票,今后就一辈子吃穿不愁了。 +但要怎么干呢,硬拼肯定是不行了,那就智取! +陈祖义决定利用假投降麻痹郑和,然后召集大批海盗趁官军不备突袭郑和旗舰,控制中枢打乱明军部署,各个击破。 +应该说这算是个不错的计划,就陈祖义的实力而言,他也只能选择这样的计划,在经过精心筹划之后,他信心满满地开始布置各项抢劫前的准备工作。 +在陈祖义看来,郑和是一只羊,一只能够给他带来巨大财富的肥羊。 +很快就要发财了。 +陈祖义为了圆满完成这次打劫任务,四处寻找同伙,七拼八凑之下,居然也被他找到了五千多人,战船二十余艘,于是他带领属下踌躇满志地向明军战船逼近,准备打明军一个措手不及。 +不出陈祖义所料?明军船队毫无动静,连船上的哨兵也比平日要少,陈祖义大喜,命令手下海盗发动进攻,然而就在此时,明军船队突然杀声四起,火炮齐鸣,陈祖义的船队被分割包围,成了大炮的靶子。目瞪口呆的海盗们黄粱美梦还没有醒,就去了黄泉。 +陈祖义终于明白,自己已经中了明军的埋伏,这下是彻底完蛋了。 +训练有素的明军给这些纪律松散的海盗们上了一堂军事训练课,他们迅速解决了战斗,全歼海盗五千余人,击沉敌船十余艘,并俘获多艘,而此次行动的组织者陈祖义也被活捉。 +留个纪念吧(2) +孰是孰非,一目了然。 +有一句老话用在这里很合适:要相信群众,群众的眼睛是雪亮的。 +所以我还是重复那句话:以德服人,这绝对不是一句笑话,君不见今日某大国在世界上呼东喝西,指南打北,很是威风,却也是麻烦不断,反抗四起。 +暴力可以成为解决问题的后盾,但绝对不能解决问题。 +当时世界上最强大的大明朝在拥有压倒性军事优势的情况下,能够平等对待那些小国,并尊重他们的主权和领土完整,给予而不抢掠,是很不简单的。 +它不是武力征服者,却用自己友好的行动真正征服了航海沿途几乎所有的国家。 +这种征服是心底的征服,它存在于每一个人的心中。当那浩浩荡荡的船队来到时,人们不会四处躲避,而是纷纷出来热烈欢迎这些远方而来的客人。 +在我看来,这才是真正的征服。 +圆满完成外交使命之外,郑和还成功地开辟了新的航线,他发现经过印度古里(今科泽科德)和溜山(今马尔代夫群岛),可以避开风暴区,直接到达阿拉伯半岛红海沿岸和东非国家。这是一个了不起的成就。 +在前六次航程中,郑和的船队最远到达了非洲东岸,并留下了自己的足迹。他们拜访了许多国家,包括今天的索马里、莫桑比克、肯尼亚等国,这也是古代中国人到达过的最远的地方。 +大家可能注意到了,上面我们只介绍了郑和六下西洋的经过,却漏掉了第七次,这并不是疏忽,而是因为第七次远航对于郑和而言,有着极为特殊的意义,就在这次远航中,他终于实现了自己心中的最大梦想。 +之前的六次航程对于郑和来说,固然是难忘的,可是他始终未能完成自己一生的夙愿——朝圣。这也成为了在他心头萦绕不去的牵挂,但他相信,只要继续下西洋的航程,总是会有机会的。 +可是一个不幸的消息沉重地打击了他,永乐二十二年(1424),最支持他的航海活动的朱棣去世了,大家忙着争权夺位,谁也没心思去理睬这个已经年近花甲,头发斑白的老人和他那似乎不切实际的航海壮举。 +郑和被冷落了,他突然之间就变成了一个无人理会,无任何用处的人,等待他的可能只有退休养老这条路了。 +幼年的梦想终归还是没能实现啊,永乐皇帝已经去世了,远航也就此结束了吧! +上天终究没有再次打击这位历经坎坷的老者,他给了郑和实现梦想的机会。 +宣德五年(1430),宣德帝朱瞻基突然让人去寻找郑和,并亲自召见了他,告诉他:立刻组织远航,再下西洋! +此时距离上次航行已经过去了七年之久,很多准备工作都要重新做起,工作十分艰巨,但郑和仍然十分兴奋,他认为,新皇帝会继续永乐大帝的遗志,不断继续下西洋的航程。 +事实证明,郑和实在是过于天真了,对于朱瞻基而言,这次远航有着另外的目的,只不过是权宜之计而已,并非一系列航海活动的开始,恰恰相反,是结束。 +朱瞻基为什么要重新启动航海计划呢,我引用他诏书上的一段,大家看了就清楚了,摘抄如下: +“朕祗嗣太祖高皇帝(这个大家比较熟悉),太宗文皇帝(朱棣、爷爷)、仁宗昭皇帝(朱高炽、爹)大统,君临万邦,体祖宗之至仁,普辑宁于庶类,已大敕天下,纪元宣德,咸与维新。尔诸番国远外海外,未有闻知,兹特遣太监郑和、王景弘等赍诏往谕,其各敬顺天道,抚辑人民,以共享太平之福。” +看明白了吧,这位新科皇帝收拾掉自己的叔叔(这个后面会详细讲)后,经过几年时间,稳固了皇位,终于也动起了君临万邦的念头,但问题在于,“万邦”比较远,还不通公路,你要让人家来朝贡,先得告诉人家才行。想来想去,只能再次起用郑和,目的也很明确:告诉所有的人,皇帝轮流坐,终于到我朱瞻基了! +不管朱瞻基的目的何在,此时的郑和是幸福的,他终于从众人的冷落中走了出来,有机会去实现自己儿时的梦想。 +作为皇帝的臣子,郑和的第一任务就是完成国家交给他的重任,而他那强烈的愿望只能埋藏在心底,从几岁的顽童到年近花甲的老者,他一直在等待着,现在是时候了。 +宣德六年(1430)十二月,郑和又一次出航了,他看着跟随自己二十余年的属下和老船工,回想起当年第一次出航的盛况,不禁感慨万千。经历了那么多的风波,现在终于可以实现梦想了! +他回望了不断远去而模糊的大陆海岸线一眼,心中充满了惆怅和喜悦,又要离开自己的祖国了,前往异国的彼岸,和从前六次一样。 +但郑和想不到的是,这次回望将是他投向祖国的最后一瞥,他永远也无法回来了。 +最后的归宿 +第五章 纵横天下 +让我们回到永乐大帝的时代,在朱棣的统治下,国泰民安,修书、迁都、远航这些事情都在有条不紊地进行着,此时的中国是亚洲乃至世界上最强大的国家之一,如果考虑到同时代的东罗马帝国已经奄奄一息,英法百年战争还在打,哈布斯堡家族外强中干,德意志帝国四分五裂,我们似乎也可以把前面那句话中的之一两字去掉。 +我们经常会产生一个疑问,那就是怎样才能获得其它国家及其人民的尊重,在世界上风光自豪一把,其实答案很简单——国家强大。 +明朝在这方面就是一个典型的例子。 +自元朝中期,国力衰落后,原先那威风凛凛横跨欧亚的蒙古帝国就已经成为了空架子,元朝皇帝成了名义上的统治者,很多国家再也不来朝贡,甚至断绝了联系。 +生了病的老虎非但不是老虎,连猫都不如。 +而自从朱元璋接受这个烂摊子后,励精图治,努力发展生产,国力渐渐强盛,而等到朱棣继位,大明帝国更是扶摇直上,威名远播。 +于是那些已经“失踪”很久的各国使臣们又纷纷出现,进贡的进贡,朝拜的朝拜,不过你可千万别把这些表面上的礼仪当真,要知道,他们进贡、朝拜后,是有回报的,即所谓的“锦绮、纱罗、金银、细软之物赐之”,要是国家不强盛,没有钱,你看他还来不来拜你? +之前我们说过,洪武年间,朝鲜成为了明朝的属国,自此之后,朝鲜国凡册立太子、国王登基必先告知明朝皇帝,并获得皇帝的许可和正式册封,方可生效。永乐元年,新任国王李芳远即派遣使臣到中国朝贡,此惯例之后二百余年一直未变。 +而郑和下西洋后,许多东南亚国家也纷纷前来朝贡,不过其中某些国家的朝贡方式十分特别。 +按说朝贡只要派个大臣充当使者来就行了,但某些国家的使臣竟然就是他们的国王! +据统计,仅在永乐年间,与郑和下西洋有关的东南亚及非洲国家使节来华共三百余次,平均每年十余次,盛况空前。而文莱、满剌加、苏禄、古麻剌朗国每次来到中国的使团都是国王带队,而且这些国王来访绝不像今天的国家元首访问,呆个两三天就走,他们往往要住上一两个月,带着几百个使团成员吃好玩好再走,与其说是使团,似乎更类似观光旅游团。 +让人吃惊的还在后面,在这一系列过程中,居然有多达三位国王在率团访问期间在中国病逝,更让人难以置信的是,他们是如此的钦慕中国,在遗嘱中竟都表示要将自己葬于中华大地。而明朝政府尊重他们的选择,按照亲王的礼仪厚葬了他们。 +贵为一国之君,死后竟不愿回故土,而宁愿埋葬于异国他乡之中国,可见当年大明之吸引力。 +此外当时的琉球群岛三国:中山、山南、山北,也纷纷派遣使臣来到中国朝贡,其中中山最强,也是最先来的,山南、山北也十分积极,不但定期朝贡,还派遣许多官方子弟来到中国学习先进文化。 +而亚洲另一个国家的朝贡也是值得仔细一说的,这个国家就是近现代与中国打过许多交道的日本。 +在当时无数的朝贡使团中,也有日本的身影,永乐元年,日本的实际统治者源道义派遣使臣到中国朝贡,当时朝贡国家很多,大都平安无事,可偏偏日本的朝贡团就出了问题。 +什么问题呢,原来当时的明朝政府是允许外国使臣携带兵器的,但这些日本朝贡团却不同其他,他们不但自己佩刀,还往往携带大量兵器入境。在完成外交使命后,他们竟然私自将带来的大批武士刀在市场上公开出售,顺便赚点外快(估计也是因为没有其它的东西可卖)。按照今天海关和工商局的讲法,这种行为是携带超过合理自用范围的违禁品,并在没有经营许可证的情况下擅自出售,应予处罚,大臣李至刚就建议将违禁者抓起来关两天,教训他们一下。 +在这个问题上,朱棣显示了开明的态度,他认为日本人冒着掉到海里喂王八的危险,这么远来一趟不容易,就批准他们公开在市场上出售兵器(外夷修贡,履险蹈危,所费实多。。。毋阻向化)。 +可能有的朋友已经注意到了,我们在上文中并没有说日本国王或是日本天皇,而是用了一个词——实际统治者。因为之后我们还要和这个叫日本的国家打很多交道,这里就先解释一下这样称呼的原因,下面我们将暂时离开明朝,进入日本历史。 +纵横天下(2) +西南边疆的阴谋 +虽然明帝国十分强大,但捣乱的邻居还是有的,也多多少少带来了一些麻烦,而最早出现麻烦的地方,就是安南。 +安南(今越南),又称交阯,汉唐时为中国的一部分,到了五代时候,中原地区打得昏天黑地,谁也没时间管它,安南便独立了,但仍然是中国的属国,且交往密切。明洪武年间,朱元璋曾册封过安南国王陈氏,双方关系良好,自此安南仿效朝鲜,向大明朝功,且凡国王继位等大事都要向大明皇帝报告,得到正式册封后方可确认为合法。 +然而在建文帝时期,安南的平静被打破了,它的国内发生了一件惊天动地的大事,由于有人及时封锁了消息,大明对此一无所知。 +永乐元年,安南国王照例派人朝贺,朱棣和礼部的官员都惊奇的发现,在朝贺文书上,安南国王不再姓陈,而是姓胡。文书中还自称陈氏无后,自己是陈氏外甥,被百姓拥立为国王,请求得到大明皇帝的册封。 +这篇文书看上去并没有什么破绽,事情似乎也合情合理,但政治经验丰富的朱棣感觉到其中一定有问题,便派遣礼部官员到安南探访实情。 +被派出的官员名叫杨渤,他带着随从到了安南,由于某些未知原因,他在安南转了一圈,回朝后便证明安南国王所说属实,并无虚构。朱棣这才相信,正式册封其为安南国王。 +于是安南的秘密被继续掩盖。 +事后看来,这位杨渤如果不是犯了形式主义错误,就是犯了受贿罪。 +但黑幕终究会被揭开的。 +永乐二年,安南国大臣裴伯耆突然出现在中国,并说有紧急事情向皇帝禀报,他随即被送往京城,在得到朱棣接见后,他终于以见证人的身份说出了安南事件的真相。 +原来在建文帝时期,安南丞相黎季犛突然发难,杀害了原来的国王及拥护国王的大臣,自后他改名为胡一元,并传位给他的儿子胡(上大下互),并设计欺骗大明皇帝,骗取封号。 +裴伯耆实在是一等一的忠臣,说得深泪俱下,还写了一封书信,其中有几句话实在感人:“臣不自量,敢效申包胥之忠,哀鸣阙下,伏愿兴吊伐之师,隆继绝之义,荡除奸凶,复立陈氏,臣死且不朽!” +裴伯耆慷慨陈词,然而效果却不是很好,因为朱棣是一个饱经政治风雨的权场老手,对这一说法也是将信将疑。而且从裴伯耆的书信看来,很明显,此人的用意在于借明朝的大军讨伐安南,这是一件大事,朱棣是不可能仅听一面之辞就发兵的。于是, 朱棣并没有马上行动,而是安排裴伯耆先住下,容后再谈。 +然而同年八月,另一个不速之客的到来打破了朱棣的沉默。 +这个人就是原先安南陈氏国王的弟弟陈天平,他也来到了京城,并证实了裴伯耆的说法。 +这下朱棣就为难了,如果此二人所说的是真话,那么这就是一起严重的政治事件,必须出兵了,可谁又能保证他们没有撒谎呢,现任安南国王大权已经在握,自然 会否认陈天平的说法,真伪如何判定呢? +而且最重要的问题在于,朱棣以前并没有见过陈天平,对他而言,这个所谓的陈天平不过是一个来历不明的人,万一要听了他的话,出兵送他回国,最后证实他是假冒的,那堂堂的大明国就会名誉扫地,难以收拾局面。 +这真是一个政治难题啊。 +然而朱棣就是朱棣,他想出了一个绝妙的主意解开了难题。 +大凡年底,各国都会来提前朝贡,以恭祝大明来年风调雨顺,国泰民安。安南也不例外,就在这一年年底,安南的使臣如同以往一样来到明朝京城,向朱棣朝贡,但他们绝没有想到,一场好戏正等待着他们。 +使臣们来到宫殿里,正准备下拜,坐在宝座上的朱棣突然发话:“你们看看这个人,还认识他么?” +此时陈天平应声站了出来,看着安南来的使臣们。 +使臣们看清来人后,大惊失色,出于习惯立刻下拜,有的还痛哭流涕。 +一旁的裴伯耆也十分气愤,他站出来斥责使臣们明知现任国王是篡权贼子,却为虎作伥,不配为人臣。他的几句话击中了使臣们的要害,安南使臣们惶恐不安,无以应对。 +老到的朱棣立刻从这一幕中明白了事情的真相,他拍案而起,厉声斥责安南使臣串通蒙蔽大明,对篡国奸臣却不闻不问的恶劣行径。 +在搞清事情经过后,朱棣立刻发布诏书,对现任安南国王胡(上大下互)进行严厉指责,并表示这件事情如果没有一个让自己满意的答复,就要他好看。 +朱棣的这一番狠话很见成效,安?现任胡氏国王的答复很快就传到了京城,在答复的书信中,这位国王进行了深刻的批评和自我批评,表示自己不过是临时占个位置而已,国号纪年都没敢改,现在已经把位置空了出来,诚心诚意等待陈天平回国继承王位。 +这个回答让朱棣十分满意,他也宽容的表示,如果能够照做,不但不会追究他的责任,还会给他分封土地。 +然后,朱棣立刻安排陈天平回国。 +话虽这样说,但朱棣是个十分精明的人,他深知口头协议和文书都是信不过的(这得益于他早年的经历),因为当年他自己就从来没有遵守过这些东西。 +为保障事情的顺利进行,他安排使臣和广西将军黄中率领五千人护送陈天平回国,按照朱棣的设想,陈天平继位之事已是万无一失。 +可是之后发生的事情只能用一个词语来形容:耸人听闻。 +黄中护送陈天平到了安南之后,安南军竟然设置伏兵在黄中眼皮底下杀害了陈天平,还顺道杀掉了明朝使臣,封锁道路,阻止明军前进。 +消息传到了京城之后,朱棣被激怒了,被真正的激怒了。 +真是胆大包天! +阳奉阴违也就罢了,竟然敢当着明军杀掉王位继承人,连大明派去的使臣都一齐杀掉! +不抱此仇,大明何用!养兵何用! +安南平定战(1) +多邦虽然是安南重镇,防御坚固,但在优势明军的面前似乎也并不难攻克,这是当时大多数将领们的看法,然而这些将领们似乎并没有注意到,在历史上,轻敌的情绪往往就是这样出现并导致严重后果的。所幸的是张辅并不是这些将领中的一员,他派出了许多探子去侦查城内的情况,直觉告诉他,这座城池并不那么简单。 +张辅的感觉是正确的,这座多邦城不但比明军想象的更为坚固,在其城内还有着一种秘密武器——大象。 +安南军队估计到了自己战斗力的不足,便驯养了很多大象,准备在明军进攻时放出这些庞然大物,突袭明军,好在张辅没有轻敌,及时掌握了这一情况。 +可是话虽如此,掌握象情的张辅也没有什么好的办法来对付大象,这种动物皮厚、结实又硕大无比,战场之上,仓促之间,一般的刀枪似乎也奈它不何。该怎么办呢? +这时有人给张辅出了一个可以克制大象的主意,不过在今天看来,这个主意说了与没说似乎没有多大区别。 +这条妙计就是找狮子来攻击大象,因为狮子是百兽之王,必定能够吓跑大象。 +我们暂且不说在动物学上这一观点是否成立,单单只问一句:去哪里找狮子呢? +大家知道,中国是不产狮子的,难得的几头狮子都是从外国进口的,据《后汉书》记载,汉章帝时,月氏国曾进贡狮子,此后安息国也曾进贡过,但这种通过进贡方式得来的狮子数量必然不多,而且当年也没有人工繁殖技术,估计也是死一头少一头。就算明朝时还有狮子,应该也是按照今天大熊猫的待遇保护起来的,怎么可能给你去打仗? +那该怎么办呢,狮子没有,大象可是活生生的在城里等着呢,难不成画几头狮子出来打仗? +答对了! 没有真的,就用画的! +你没有看错,我也没有写错,当年的张辅就是用画的狮子去打仗的。 +张辅不是疯子,他也明白用木头和纸糊的玩意儿是不可能和大象这种巨型动物较劲的,不管画得多好,毕竟也只是画出来的,当不得真。作为一名优秀的将领,张辅已经准备好了一整套应对方案,准备攻击防守严密的多邦城。 +其实到底是真狮子还是假狮子并不重要,关键看在谁的手里,怎么使用,因为最终决定战争胜负的是指挥官的智慧和素质。 +张辅的数十万大军在多邦城外住了下来,但却迟迟不进攻,城内人的神经也从紧绷状态慢慢松弛了下来,甚至有一些城墙上的守兵也开始和城边的明军士兵打招呼,当然了,这是一种挑衅,在他们看来,自己的战略就要成功了,明军长期呆在这里,补给必然跟不上,而攻城又没有把握,只有撤退这一条路了。 +安南守军不知道的是,其实明军迟迟不进攻的理由很简单:刀在砍人之前磨的时间越久,就越锋利,用起来杀伤力也会更大。 +事实正是如此,此时的张辅组织了敢死队,准备攻击多邦城。他所等待的不过是一个好的时机而已。 +在经过长时间等待后,明军于十二月的一个深夜对多邦城发起了攻击,在战斗中,明军充分发挥了领导带头打仗的先锋模范作用,都督黄中手持火把,率队先行渡过护城河,为部队前进开路,都指挥蔡福亲自架云梯,并率先登上多邦城。这两名高级军官的英勇行为大大鼓舞了明军的士气,士兵们奋勇争先,一举攻破外城,安南士兵们无论如何也想不到,平日毫无动静的明军突然变成了猛虎,如此猛烈之进攻让他们的防线全面崩溃,士兵们四散奔逃。 +战火蔓延到了内城,此时安南军终于使出了他们的杀手锏,大象,他们驱使大象攻击明军,希望能够挽回败局,然而,早有准备的张辅拿出了应对的方法。 +考虑到画的狮子虽然威武,但也只能吓人而已,不一定能吓大象,张辅另外准备了很多马匹,并把这些马匹的眼睛蒙了起来,在外面罩上狮子皮(画的),等到大象出现的时候便驱赶马匹往前冲,虽然从动物的天性来说,马绝对不敢和大象作对,但蒙上眼睛的马就算是恐龙来了也会往前冲的。与此同时,张辅还大量使用火枪攻击大象,杀伤力可能不大,但是火枪的威慑作用却相当厉害。 +在张辅的这几招作用下,安南军队的大象吓得不轻,结果纷纷掉头逃跑,冲散了后面准备捡便宜的安南军,在丧失了所有的希望后,安南军彻底失去了抵抗的勇气,明军一举攻克多邦城。 +多邦战役的胜利沉重地打击了安南的抵抗意志,此后明军一路高歌猛进,先后攻克东都和西都,并于此年(永乐五年)五月,攻克安南全境,俘获胡氏父子,并押解回国,安南就此平定。 +在安南平定后,朱棣曾下旨寻找陈氏后代,但并无结果,此时又有上千安南人向明朝政府请愿,表示安南以前就是中国领地,陈氏已无后代,希望能归入中国,成为中国的一个郡。 +朱棣同意了这一提议,并于永乐五年(1407)六月,改安南为交阯,并设置了布政使司,使之成为了中国的一部分,于是自汉唐之后,安南又一次成为中国领土。 +安南问题的解决使得中国的西南边界获得了安宁和平静,但明朝政府还有着一个更大的烦恼,这个烦恼缠绕了明朝上百年,如同噩梦一般挥之不去。 +天子守国门 +一次性解决问题 +蒙古本部鞑靼太师在拥立本雅失里为可汗后,奉行了对抗政策,于明朝断绝了关系,更为恶劣的是,永乐七年(1409)四月,鞑靼杀害了明朝使节郭骥,他们的这一举动无疑是在向大明示威。但他们没有想到,他们的这一举动实在是利人损己。 +因为明朝政府其实早已做好准备要收拾鞑靼,缺少的不过是一个借口和机会而已,而这件事情的发生正好提供了他们所需要的一切。 +鞑靼之所以成为明朝的目标,绝不仅仅因为他们对明朝报有敌对态度。 +鞑靼的新首领本雅史里与太师阿鲁台都属于那种身无分文却敢于胸怀天下的人,虽然此时鞑靼的实力已经大不如前,他们却一直做着恢复蒙古帝国的美梦,连年出战,东边打兀良哈,西面打瓦剌,虽然没有多大效果,但声势却也颇为吓人。 +鞑靼的猖狂举动引起了朱棣的主意,为了打压鞑靼的嚣张气焰,他于永乐七年(1409)封瓦剌首领马哈木为顺宁王,并提供援助,帮助他们作战,瓦剌乘势击败前来进攻的本雅失里和阿鲁台,鞑靼的势力受到了一定的压制。 +为了一次性解决问题,朱棣决定派出大军远征,兵力为十万,并亲自拟定作战计划,但在最重要的问题上,他犹豫了。 +这就是指挥官的人选,朱棣常年用兵,十分清楚打仗不是儿戏,必须要有丰富战争经验的人才能胜任这一职务。最好的人选自然是曾经与自己一同靖难的将领们,可是问题在于,当年的靖难名将如今已经死得差不多了, 最厉害的张玉在东昌之战中被盛庸干掉了,朱能也已经死了,张玉的儿子张辅倒是个好人选,可惜刚刚平定的安南并不老实,经常闹独立,张辅也走不开。想来想去,只剩下了一个人选:邱福。 +对于邱福,我们并不陌生,前面我们也曾经介绍过他,在白沟河之战中,他奉命冲击李景隆中军,却没有成功,但这并没有影响他在朱棣心中的地位,此后他多次立下战功,并在战后被封为淇国公(公爵)。但朱棣也很清楚,这位仁兄虽然作战勇猛,却并非统帅之才,但目下正是用人之际,比他更能打的差不多都死光了,无奈之下,朱棣只得将十万大军交给了这位老将。 +永乐七年(1409)七月,丘福正式领兵十万出发北征,在他出发前,朱棣不无担心地叮嘱他千万不可轻敌,要谨慎用兵,看准时机再与敌决战。邱福表示一定谨记,跟随他出发的还有四名将领,分别是副将王聪、霍亲,左右参将王忠、李远。 +此四人也绝非等闲之辈,参加此次远征之前都已经被封为侯爵,战场经验丰富。 +朱棣亲自为大军送行,他相信如此强的兵力,加上有经验的将领,足可以狠狠地教训一下鞑靼。 +看着大军远去,朱棣的心中却有一种不安感油然而生,多年的军事直觉让他觉得自己似乎漏掉了什么,他思虑再三,终于省起,便立刻派人骑快马赶到邱福军中,只为了传达一句话。 +这句话是对邱福说的,“如果有人说敌人很容易战胜,你千万不要相信!”(军中有言敌易取者,慎勿信之) +邱福接收了皇帝指示,并表示一定不辜负皇帝的信任和期望。 +朱棣不愧为一位优秀的军事家,他敏锐地意识到了这支军队最大的隐患就在于轻敌冒进,而最容易犯这个错误的就是主帅邱福,在军队出发后,竟然还派人专程赶去传达这一指示,实在是用心良苦。 +后来的事实也证明了朱棣的判断是准确的,问题在于,主帅邱福偏偏就是一个左耳进,右耳出的人,遇到这样的主帅,真是神仙都没办法。 +邱福率领军队一路猛进,赶到了胪朐河(今中蒙边境克鲁伦河),击溃了一些散兵,并抓获了鞑靼的一名尚书,丘福便询问敌情,这位尚书倒是个直爽人,也没等邱福用什么酷刑和利诱手段,就主动交待,鞑靼军队主力就在此地北方三十里,如果现在进攻,必然可以轻易获得大胜。 +邱福十分高兴,干脆就让这个尚书当向导,照着他所指引的方向前进。这样看来,邱福倒真是有几分国际主义者的潜质,竟然如此信任刚刚抓来的俘虏,而从他的年纪看,似乎也早已过了天真无邪的少年时代,但在这件事情上,他实在是天真地过头了。 +另一方面,我们也不得不佩服朱棣的料事如神,他好像就是这场战争的剧本编剧,事先已经告诉了男主角邱福应对的台词和接下来的剧情,可惜大牌演员邱福却没有按照剧本来演。 +在那位向导的的带领下,邱福果然找到了鞑靼的军营,但是并没有多少士兵,那位向导总会解释说,大部队在前面。就这样,不停的追了两天,依然如此,总是那么几百个鞑靼士兵,而且一触即溃。 +部下们开始担忧了,他们认为那个向导不怀好意,然而邱福却没有这种意识,第三天,他还是下令部队跟随向导前进,这下子他的副将李远也坐不住了。 +李远劝邱福及时回撤,前面可能有埋伏,可是邱福不听,他固执地认为前方必然有鞑靼的大本营,只要前行必可取胜,李远急得跳脚,也顾不得上下级关系,大喊道:“皇上和你说过的话,你忘记了吗!?” +这下可惹恼了邱福,他厉声说道:“不要多说了,不听我的指挥,就杀了你!” +邱福如同前两日一样地出发了,带路的还是那位向导,这一次他没有让邱福失望,找了很久的鞑靼军队终于出现了,但与邱福所预期的不一样,这些鞑靼骑兵是主动前来的,而且并没有四散奔逃,也没有惊慌失措,反而看上去吃饱喝足,睡眠充分,此刻正精神焕发地注视着他们。 +终于找到你们了,找得好苦。 +终于等到你们了,等了很久。 +亲 征(1) +本雅失里是阿鲁台扶植上台的,两人关系一向很好,也甚少争吵,但在得知朱棣亲率五十万大军前来讨伐时,他们慌张之余,竟然发生了激烈的争吵,令人啼笑皆非的是,他们争吵的内容并不是要不要抵抗和怎么抵抗,而是往哪个方向逃跑! +这二位仁兄虽然壮志凌云,但还是有自知之明的,听说朱棣亲率五十万人来攻击自己后,他们立刻意识到,这次明朝政府是来玩命的,无论怎么扳指头算,自己手下的这点兵力也绝对不够五十万人打的,向瓦剌和兀良哈求援又没有回音,那就只有跑了。 +可是往那边跑呢?这是个重要的问题。 +本雅失里说:往西跑,西边安全。 +阿鲁台说:西边是瓦剌的地盘,我刚和人家打完仗,哪好意思去投奔,不如往东跑,东边安全。 +本雅失里反对,他说:东边的兀良哈是明朝的附属,决不肯收留自己这个元朝宗室,要去你去,反正我不去。 +两人僵持不下,越吵越激烈,后来他们决定停止争吵(再不停明军就要来了),分兵突围。 +就这样,本雅失里一路向西狂跑,可还没有赶到瓦剌就撞到了朱棣的大军,不能不说是运气不好。 +本雅失里发现了明朝大军的动向,他立刻命令部队加速前进。 +与此同时,率领精锐骑兵的朱棣也快马加鞭向本雅失里不断靠近。 +这是一场战场上的赛跑,最终朱棣占据了优势,因为他明智地把辎重和后勤留在了饮马河畔,只带上口粮日夜追击,而本雅失里却舍不得他抢来的那些东西,带着一大堆家当逃跑,自然跑不快。 +朱棣终于追上了本雅失里,并立刻向他发动了攻击,本雅失里万万没有想到,朱棣来得这么快,毫无招架之功,被朱棣一顿猛打,丢下了所有辎重,只带了七个人逃了出去。战后,朱棣不打收条就全部收走了本雅失里辛辛苦苦带过来,一直舍不得丢的那些金银财宝,而可怜的本雅失里就这样无偿地为朱棣干了一趟搬运工。 +无论如何,本雅失里总算是捡了一条命,继续着他的逃亡之路,但他却未必知道,他的这次战败不但是他的耻辱,也会让他的祖先蒙羞。 +或许是宿命的安排吧,朱棣追上并击溃这位成吉思汗子孙的地方,就是斡难河(今蒙古鄂嫩河)。 +朱棣正在马上俯视着这片刚刚经过大战的土地,大风吹拂着一望无际的草原,斡难河水在阳光的照耀下,映出迷人的光彩,刚发生的那场恶战似乎与这片美丽的土地毫无关系。 +胜利喜悦已经消退的朱棣突然想起了什么,他沉思了一会,对身边的侍卫感叹道:“这里是斡难河,是成吉思汗兴起的地方啊。” +是的,两百年前,就在斡难河畔,铁木真统一了蒙古部落,成为了伟大的成吉思汗,术赤、窝阔台、拖雷、哲别等后来威震欧亚大陆的名将们环绕在他的周围,宣誓向他效忠。之后他们各自出征,将自己的宝剑指向了世界的各个角落,并最终建立了横跨欧亚的蒙古帝国。 +转眼之间,两百年过去了,草原上的大风仍旧呼啸,斡难河水依然流淌,但那雄伟的帝国早已不见了踪影,而就在不久之前,伟大的成吉思汗的子孙在这里被打得落荒而逃。 +一切都过去了,只有那辽阔的草原和奔流的河水似乎在向后人叙说着这里当年的盛况。 +百年皇图霸业,过眼烟云耳! +阿鲁台的厄运 +第七章逆命者必剪除之! +鞑靼战败的消息,震惊了很多蒙古部落,他们没有想到,由黄金家族统领的蒙古本部居然如此不堪一击,而在他们中间,有一个部落对这一结果却十分高兴,这个部落就是瓦剌。 +我们前面说过,瓦剌和鞑靼之间有很深的仇恨,估计也超过了人民内部矛盾的范畴,在明军进攻时,瓦剌作为与鞑靼同一种族的部落,不但不帮忙,还替明朝政府解决了本雅失里这个祸害。这样的功劳自然得到了明朝政府的嘉奖。作为这场战争中的旁观者,瓦剌得到了许多利益,然而明朝政府想不到的是,不久之后,这位旁观者就将转变为一个参与者。 +瓦剌首领马哈木是一个比较有才能的统治者,他并不满足于自己的地盘,而自己的最大竞争对手阿鲁台已经被明军打成了无业游民,他所占据的东部蒙古也变得极为空虚,马哈木是个见了便宜就想占的人,他开始不断蚕食西部蒙古的地盘,几年之间,瓦剌的实力开始急剧膨胀,占领了很多地方。此时阿鲁台却缺兵少将,成了没娘的孩子,他只能去向明朝政府哭诉,可是每次得到的都是“知道啦”“你回去吧,我们会和他打招呼的”之类的话。 +上学时候的经历告诉我们,打小报告的一般都没有好下场,阿鲁台也不例外,他告状之后境况不但没有改变,反而经常挨打,而且一次比一次狠,鞑靼从此陷入了极端困顿的境地。 +应该说,阿鲁台落得如此下场,不但是因为瓦剌的进攻,明朝政府的默许和支持也是其中一个因素,眼看鞑靼就要一蹶不振,然而此时时局又出现了意想不到的变化。 +瓦剌变得过于强大了。 +不管瓦剌和鞑靼有什么样的矛盾,但他们毕竟还是蒙古人,“攘外必先安内”也并不单单是汉族的传统,在打垮了鞑靼后,瓦剌的马哈木也动起了统一蒙古,恢复帝国的念头,他立答里巴(黄金家族阿里布哥系)为汗,还侵占了和林。 +明朝政府终于发现,这个旁观者竟然已经变得如此强大,大有一统蒙古之势。而此时阿鲁台也已经被打得失魂落魄,竟然带着自己的部落跑到长城边上来,说自己已经没有活路了,要求政治避难。 +事到如今,再也不能不管了,明朝政府如同古往今来的所有政权一样,都遵循一条准则: +没有永远的朋友,也没有永远的敌人,只有永远的利益。 +昔日的朋友终于变成了敌人。 +明朝对瓦剌说:“从哪里来,就滚回哪里去!” +瓦剌说:“我不滚。” +“不滚,我就打你!” +“你来吧,怕你不成!” +不再废话,开打。 +瓦剌的自信 +朱棣陷入了矛盾之中 +他长期以来的军事经验告诉他,从种种迹象看,瓦剌军队是有意识地诱敌深入,而刘江打败的先锋部队很明显是瓦剌故意放出来的诱饵,如果继续深入必然会遭到瓦剌的伏击。 +最好的办法无疑是在此地等待瓦剌前来决战,但这是不可能的。 +作为一支深入敌境的军队,找到敌人主力速战速决才是关键,粮食就这么多,无论如何是耗不起的。 +没办法了。 +敌人就在前方等着我们,那就来吧,龙潭虎穴也要闯上一闯! +更何况,我也有自己的杀手锏。 +明知山有虎,偏向虎山行! +前方百里,忽兰忽失温! +此时的瓦剌首领马哈木在沉浸于喜悦之中,他看着部落的另两个首领太平和博罗,得意之情溢于言表。正是在他的周密策划之下,瓦剌保存了实力,并集结了部落最为强大的三万骑兵,在忽兰忽失温设下了圈套,等待着明军的到来。 +马哈木之所以挑选忽兰忽失温为战场,是有着充分的考虑的,忽兰忽失温附近多山,有利于骑兵部队隐藏,而且将骑兵藏于山上还有着一个很大的优势,那就是一旦发现明军,可以借助山势直冲而下,以难挡之势一举冲垮明军阵型,只要明军阵型一乱,即使人再多也起不了任何作用,只能乖乖地仁自己宰割。 +马哈木是对的,虽然他肯定没有学过物理,不会懂得势能这个概念,但将骑兵放在高处一冲而下确实有着极强的冲击作用,如果明军没有什么别的办法,阵营必然会被截成几部分,到时首尾无法呼应,形成不了强大的战斗力,就是一盘散沙。 +这实在是马哈木所能想到的最好的方法,坚壁清野、诱敌深入、居高而下、一举荡平,如同一部完整的动作片,前三个动作是准备,最后一个是结局。但这部动作片要想得到一个完美的结局必有一个前提条件,那就是当瓦剌军队从高处向下冲击时,明军“没有什么别的办法”。 +明军已是我囊中之物!不久之后,瓦剌和我马哈木必将成为蒙古新的领袖! +可惜明军统帅朱棣偏偏是一个“有办法”的人,北平城造反时他有办法,白沟河大战时他也有办法,被挡在山东之外进退两难时,他还是有办法。 +没有办法,他也走不到今天这一步。 +六月初七,他带着自己的办法来到了忽兰忽失温,来到了马哈木为他安排的战场。 +看完四周的环境,朱棣不由得抽了一口冷气,和他想象的丝毫不差,此处山多险峻,是伏击作战的不二之选。 +无论如何,这里就是决战的地点了。 +当那浩浩荡荡的大军来到自己眼前的时候,马哈木感觉到了强烈的兴奋,身后的三万大军只等待他的一声号令,就可以杀下山去,把明军击溃,彻底地击溃! +离成功只差一步! +更让马哈木惊喜的是,明军打头的并不是什么精锐骑兵,而是一些步兵,这简直是天助我也,只要打开了突破口,明军必然无法抵抗自己的攻击。 +虽然离明军还有一段距离,但在仔细观察了明军阵型后,马哈木已有了必胜的把握,他随即下达了总攻的命令!三万骑兵自山上一冲而下,以猛虎之势扑向山下的明军,杀声遍野,马匹嘶鸣,震天动地。马哈木得意地在山上指挥着他的军队,等待着瓦剌骑兵一举冲垮明军的景象。 +胜利就在眼前! +然而,就在瓦剌骑兵发动冲锋后不久,这场看起来一边倒的战役局势突然出现了意想不到的变化! +突击!神机营! +在发现瓦剌军队发动进攻后,明军迅速变换了阵型,原先队伍前列的步兵迅速由中间向两翼后退,中军后阵立刻涌出一支部队填补了空位。 +这支部队与明军中的骑兵和步兵不同,他们手中拿着的并不是马刀或是长剑,而是火铳。 +在迅速排布好阵型之后,士兵们将手中的火铳对准了不断逼近中的瓦剌骑兵,他们等待着指挥官柳升的命令。 +瓦剌骑兵注意到了明军阵营的变化,但他们并未在意,而是继续纵马猛冲。 +此时山上的马哈木也看到这一幕,和他手下的那些人不同,他是见过世面的,明军阵型的这一突然变化让他汗毛直竖,血液几乎凝固,他声嘶力竭地喊道:“是神机营!快退!” +已经来不及了。 +朱棣陷入了矛盾之中(2) +战后总结大会 +下面我们就这次战役开一个总结大会,在召开总结大会之前,有必要先说一下这次会议的必要性和议题,毕竟把朱棣和马哈木同志请来开会并不容易,为了不耽误大家的时间,我们现在开始: +这次忽兰忽失温战役虽然并不是什么决定性的战役,但却很值得分析,因为这个看似普通的战役中蕴含了一些明军作战的秘密和规律,是应该认真研究的。 +这次会议主要探讨两个问题,第一、为什么明军能够战胜? +先说一下,马哈木同志不要站起来了,不用激动,事情的经过我们已经知道了,战败是事实,具体分析还是交给我吧。 +要知道,一场战争的胜负是有很多决定因素的,之前我们介绍过,明军的骑兵个人能力不一定能够胜过瓦剌骑兵,但为什么明军却能在瓦剌占据天时地利人和情况下击败瓦剌呢? +这是因为朱棣统帅下的明军有一套极有技术含量的战法和几支高素质的部队。战法问题过于复杂,我们下面再讨论,先说说明军的高素质部队:三大营。 +三大营是朱棣同志组建的部队,这支部队也是明朝的最精锐部队,它们分别是:五军营、三千营、神机营 +先说五军营,五军营并不是指五个军种,实际上,五军营是骑兵和步兵的混合体,分为中军、左军、左掖军、右掖军、右哨军,这支部队是从各个地方抽调上来的精锐部队,担任攻击的主力。 +下面说一下三千营,我们前面已经说过五军营是明军主力,那么为什么还要单设一个三千营呢,这是因为三千营与五军营并不相同,它主要是由投降的蒙古骑兵组成的。也就是说,三千营实际上是以雇佣兵为主的。 +之所以叫三千营,是因为组建此营时,是以三千蒙古骑兵为骨干的,当然后来随着部队的发展,实际人数当不止三千人,三千营与五军营不同,它下属全部都是骑兵,这支骑兵部队人数虽然不多,却是朱棣手下最为强悍的骑兵力量,他们在战争中主要担任突击的角色。 +最后我们要介绍朱棣手下最特殊的一支部队,神机营。 +之所以说它特殊,是因为这支部队使用的武器是火炮和火铳,在明朝时候,人们称呼这些火器为神机炮,许多游牧民族的骑兵就是丧命于这些神机炮下,马哈木同志就不要哭了,毕竟事情已经过去了。 +可以说,这支部队就是明朝政府的炮兵部队,朱棣同志之所以要组建这样的一支部队,那是有着深刻原因的。 +我们看到朱棣同志沉痛地点了点头,没有错,在靖难的时候,朱棣同志主要使用的就是骑兵,但是盛庸先生却大量使用火器袭击他和他的军队,造成了极为不好的影响,朱棣同志自己也几次差点在战场上被干掉。 +这也使得朱棣同志深刻吸取了教训,在他后来组建军队时,便专门设置了这样一个以使用火器为主的部队,正是这支部队在忽兰忽失温战役中发挥了巨大的作用。 +好了,以上我们介绍了朱棣的高素质部队,但这并不是他获得胜利的根本原因,明军获胜的真正秘诀在于他们的战法。 +下面我们就探讨第二个问题:明军使用了怎样的战法? +可能出乎很多人的意料,明军的战法是非常先进的,那到底先进到什么水平? +客观地说,明军的战术虽不能说领先世界几百年,但放眼全球,至少在当时,绝无可望其项背者。 +这并不是信口胡说,是有着充分的证据的,请大家坐好,下面我们将详细介绍明朝军队先进战法的发展过程。 +在朱元璋时代,明朝有徐达、常遇春、李文忠等十分优秀的骑兵将领,这些人使用骑兵作战堪称不世出之奇才,连靠骑兵起家的蒙古人也被他们打得狼狈不堪,但除了他们率领的骑兵之外,明朝在军事上还有另一招看家本领,那就是火器。 +事实证明,中国人在发明火药之后,并不仅仅用它制作鞭炮,经过上百年的演化改进,明代时候朱元璋的军队中已经开始大规模使用火器,包括火炮和火铳等,而相应于擅长使用骑兵的徐达等人,朱元璋的手下也涌现出了一大批善于使用火器作战的将领。这些将领中的佼佼者就是邓愈和沐英。 +邓愈是偏好使用火器的,在洪都保卫战中,他的部下就曾经使用火器重创过陈友谅的军队,但朱元璋时代,对火器战术的运用达到登峰造极程度的,却并不是他,而是沐英。 +战后总结大会(2) +要你命三板斧战斗系统” +“要你命三板斧战斗系统”使用说明书 +首先必须承认,这个名字不是我首创的,而是取材于某搞笑电影中的“要你命3000”武器,也许有的朋友看过这部电影,这个所谓的“要你命3000”武器是由西瓜刀,石灰粉,毒药,绳子一系列工具组成,具体使用过程比较复杂,也很多样,比如先洒石灰粉遮住对方眼睛,然后用西瓜刀砍,或是下毒等等。 +我在这里借鉴其名决不是为了搞笑,恰恰相反,我的态度是很认真的,因为在我看来这个“要你命3000”武器系统正好能够借用来说明永乐时期明军战法的特点。 +明军的这个三板斧战法是建立在三大营基础上的,与“要你命3000”武器系统类似的是,明军是对三大营军事力量进行合理调配与组合,达到克制蒙古骑兵的目的。 +所谓的要你命三板斧战法的操作过程是这样的,首先,在发现蒙古骑兵后,神机营的士兵会立刻向阵型前列靠拢,并做好火炮和火铳的发射准备,在统一指挥下进行齐射。这轮齐射是对蒙古骑兵的第一轮打击,也就是第一斧头。 +神机营射击完毕后,会立刻撤退到队伍的两翼,然后三千营与五军营的骑兵会立刻补上空位,对已经受创的蒙古骑兵发动突击,这就是明军的第二斧头。 +骑兵突击后,五军营的步兵开始进攻,他们经常手持制骑兵武器(如长矛等),对蒙古骑兵发动最后一轮打击,这也是明军的最后一斧头。 +可以看到,这是一个完整的战斗系统,明军使用火器压制敌人骑兵推进挫其锐气后,立刻发动反突击,然后用步兵巩固战场(神机铳居前,马队居后,步卒次之),这一系统的具体使用根据战场条件的不同各异,其细节操作过程也要复杂得多,比如多兵种部队的队形转换等,但其大致过程是相同的。 +以冲击力见长的蒙古骑兵就是败在了明军的这套战术之下,无论多么凶悍的骑兵也扛不住这三斧头,这套“要你命三板斧战斗系统”经常搞得蒙古人痛苦不堪,却又无可奈何。 +此外明军使用的武器也是很有特点的,据考证,当时的明军骑兵使用的兵器与蒙古骑兵也多有不同,某些明朝骑兵使用的不是马刀,而是另一种威力更大的独门兵器——狼牙棒。 +虽然骑兵多数使用的是弯马刀,但据现代科技人员研究表明,高速移动中的骑兵在与敌方骑兵对交锋时,使用狼牙棒的一方是占有优势的,这是因为狼牙棒的打击范围广,使用方便,马刀只有单面开刃,狼牙棒却是圆周面铁刺,无论哪一部分击打对手都会造成伤害,此外还兼具棍棒打击功能,其威力实在堪比现在街头斗殴时使用的王牌武器——三棱刮刀。 +要你命三板斧战斗系统(2) +第八章 帝王的财产 +朱棣对待蒙古部落的这种指哪打哪,横扫一切的军事讨伐有效地震慑了瓦剌和鞑靼,自永乐十二年(1414)征伐瓦剌得胜归来后,明帝国的边界终于安静了下来,瓦剌奄奄一息,鞑靼心有余悸,“不打不服,打服为止”这句俗语用在此处十分合适。永乐大帝朱棣就这样用武力为自己的国民创造了一个良好的生活环境,此时永乐大典已经修成,边疆平安无事,周边四夷争相向明朝皇帝朝贡,大明帝国可谓风光无比。 +在朱元璋和朱棣父子的辛苦经营下,明帝国的文治武功达到了最高峰,国家繁荣昌盛、百业兴旺的景象又一次在中国大地上呈现,这固然是朱棣的成就,但究其根本还是朱元璋时代打下的良好基础在起作用,因为朱元璋就如同一个尽职的管家婆,早已为自己的子孙制定了一系列政策,让他们去照着执行。 +事实上,朱棣时代奉行的仍然是他父亲的那一套系统,但朱棣本人在此基础上也有着自己的发明创造,下面我们将介绍朱棣统治时期出现的几个新机构,这些机构对之后的明代历史有着极为深远的影响,而且这些也确实可以算得上是朱棣辛苦劳动的结果,是超越前人的发明创造,值得一提。 +我们先从最重要的一个说起。 +这是一个全新的机构,是由朱棣本人设立的,但这个新机构的设立者朱棣做梦也不会想到,几十年之后,它会成长为一个可怕的庞然大物,庞大到足以威胁皇帝的地位和权力。 +这个机构就是内阁。 +永乐初年,被政事累得半死不活的朱棣终于无法忍受下去了,他总算领教了自己老爹朱元璋的工作效率和工作精神,自己纵然全力以赴没日没夜的干工作,还是很难完成,在这种情况下,他任命解缙等七人为殿阁大学士,参与机务。 +这七个人组成了明朝的第一任内阁,自此之后,朱棣但凡战争、用人、甚至立太子这样的事情都要与这七个人讨论方作决定,其职权责任不可谓不大。 +但出人意料的是,内阁成员的官职却只有五品,远远低于尚书、侍郎等中央官员,这也是朱棣精心设置的,他对内阁也存有一定戒心,为防止这七个人权势过大,他特意降低了这些所谓阁员的品衔,他似乎认为这样就能够有效的控制内阁。 +后来的事实证明,他错了。 +谁也料不到这个当初丝毫不起眼的小机构最终竟然会成为明帝国统治的中枢,当年官位仅五品的阁臣成为了百官的首领,更让人难以置信的是,这个机构的生命力竟然会比明朝这个朝代更长! +它已经由一个机构变成了一种制度,在此之后的五百余年一直延续下去,成为中国封建政治制度中极为重要的部分。 +在我们之后的叙述中,这个机构将经常出现在我们的文章中,无数忠臣、奸臣、乱臣都将在这个舞台上表现他们的一生。 +内阁固然重要,但下一个机构的知名度却要远远的大于它,这个朱棣出于特殊目的建立的部门几百年来都笼罩着神秘色彩,它的名字也经常和罪恶、阴谋纠缠在一起。 +这个部门的名字叫东厂。 +我们前面曾提到过锦衣卫这个特务部门,虽然此部门一度被朱元璋废除,但朱棣登基后不久便恢复了该部门的建制,原因很简单,朱棣需要特务。 +像朱棣这样靠造反上台的人,虽然嘴上不说,心里却是很虚的,自己搞阴谋的人必然总是认为别人也在搞阴谋,为了更加有效的监视百官,他重新起用了锦衣卫。 +但不久之后,朱棣就感觉到锦衣卫也不太好用,毕竟这些人都是良民出身,和百官交往也很密,而朱棣本着怀疑一切、否定一切的科学精神,认定这些人也不可靠。 +这下就难办了,特务还不可靠,谁可靠呢? +宦 官(1) +最后一个介绍的是我们经常在电视剧中听到的一个称谓——巡抚。 +大家对这个名字应该并不陌生,这个名称最初出现在永乐年间,也算是朱棣的发明创造吧,实际上,那个时候的巡抚和之后的巡抚并不是一回事。 +我们之前曾经介绍过,朱元璋时期废除了中书省,设置布政使司,最高长官为布政使,主管全省事务,地位相当于我们今天的省长。本来布政使管事也算正常,但朱元璋有一个嗜好——分权,他绝不放心把一省的所有大权都交给一个人,于是他还另外设置了两个部门,分管司法和军事。 +这两个部门分别是提刑按察使司和都指挥使司,最高长官为按察使和都指挥使。 +老朱搞这么一手,无非是为了便于控制各省事务,防止地方坐大,本意不坏,但后来的事情发展又出乎了他的意料,这是因为他的这一举动正应了中国的一句俗话: +三个和尚没水喝。 +虽然这三位长官的职权并不相同,布政使管民政、财政、按察使管司法、都指挥使管军事,但大家都在省城办公,抬头不见低头见,关系处得不好,也是很麻烦的,平日里三家谁也不服谁,太平时期还好办,万一要有个洪灾旱灾之类天灾,如果没有统一调配,是很麻烦的,特别当时还经常出现农民起义这种群众性活动,没有一个总指挥来管事,没准农民军打进官衙时,这三位大人还在争论谁当老大。 +为了处理这三个和尚的问题,中央想了一个办法,就是由中央派人下去管理全省事务,这个类似中央特派员的人就叫巡抚。 +要说明的是,中央可不是随便派个人下来当巡抚的,在论资排辈十分严重的中国,能被派下来管事的都不是等闲之辈,一般来说,这些巡抚都是各部的侍郎(副部级)。 +与很多人所想的不同,在永乐时期,中央官员序列中实际上并没有巡抚这个官名,所谓的巡抚不过是个临时的官职,中央的本意是派个人下去管事,事情办完了你就回来,继续干你的副部级。 +可是天不随人愿,中央大员下到地方,小事容易办,要是遇到民族纷争问题和农民造反这些大事,就不是一年半年能回来的了。要遇到这种事情,巡抚可就麻烦了,东跑西跑,一忙就是大半年,这里解决了那里又闹,逢年过节的,民工都能回家过年,而有些焦头烂额的巡抚却几年回不了家。 +本来只是个临时差事,却经常是一去不返,巡抚也有老婆孩子,也有夫妻分居,子女入学这些问题,长期挂在外面也实在苦了这些大人,中央也麻烦,往往是这个刚巡回来,又有汇报何处出事,地方处理不了,需要再派,周而复始,也影响中央人员调配,于是,在后来的历史发展中,巡抚逐渐由临时特派员变成了固定特派员,人还算是中央的人,但具体办公都在地方,也不用一年跑几趟了。 +既然说到巡抚,我们就不得不说与之相关的两个官职。 +巡抚虽然是大官,却并非最大的地方官员,事实上,比巡抚大的还有两级,这两级官员才真正称得上是举足轻重的人物。 +明朝政府确定了巡抚制度后,又出现了新的难题,因为当时的农民起义军们经常会变换地点,也就是所谓的打一枪换一个地方,也算是游击战的一种,山东的往河北跑,湖北的往湖南跑,遇到这种情况,巡抚们就犯难了。比如浙江巡抚带着兵追着起义军跑,眼看就要追上,结果这些人跑到了福建,浙江巡抚地形不熟,也不方便跑到人家地盘里面去,就会要求福建巡抚或是都指挥使司配合,如果关系好也就罢了,算是帮你个忙。关系不好的那就麻烦了,人家可以把眼一抬:“你何许人也,贵姓?凭什么听你指挥?” +为了处理这种情况,中央只得再派出更高级别的官员(一般是尚书正部级),到地方去处理事务,专门管巡抚。这些人就是所谓的总督。 +总督一般管两个省或是一个大省(如四川总督只管四川),可以对巡抚发令。 +按说事情到这里就算解决了,可是政策实在跟不上形势,到了明朝后期,如李自成、张献忠这样的猛人出来后,游击队变成了正规军,排场是相当的大,人家手下几十万人,根本不把你小小的巡抚、总督放在眼里,正规军不小打小闹,要打就打省会城市,一闹就几个省,总督也管不了。 +在这种情况下,中国有史以来最大的地方官出场了,疲于应付的明朝政府最后只得又创造出一个新官名——督师。这个官专门管总督,农民军闹到哪里,他就管到哪里,当然了,这种最高级别的地方官一般都是由中央最高文官大学士兼任的。 +以上三种机构或官职都是在永乐时期由朱棣首创的,其作用有好有坏,我们在这里介绍它们,是因为在后面的文章中,我们还要经常和他们打交道,所以在这里必须先打个底。 +与这些制度机构相比,朱棣还给他的子孙后代留下了一样更加珍贵的宝物,也正是这件宝物不但开创了永乐盛世,还在朱棣死后,将这种繁荣富强的局面维持下去。 +这件宝物就是人才。 +朱棣和朱元璋一样,都是中国历史上十分有作为的英明君主,但综合来看,朱棣比朱元璋在各个方面都差一个层次,除了一点之外。 +这一点就是看人才的眼光。 +之前我们曾经介绍过朱元璋给他的孙子留下的那三个人,事实证明这三个人是名副其实的书呆子,作用极其有限,朱棣也给自己的子孙留下了三个人,这三个人却与之前的齐黄大不相同。 +他们是真正的治世英才。 +由于他们三个人都姓杨,所以史称“三杨” +他们是那个时代最为优秀的人物,且各有特长,不但有能力,而且有城府心计,历经四朝而不倒,堪称奇人,下面我们就逐个介绍他们的传奇经历。 +第一个人(1) +生活贫困的杨士奇和他的母亲一直过着清贫的生活,不久之后,他又用自己的行动诠释了人穷志不穷这条格言的意义。 +杨士奇的一个朋友家里也十分穷困,但他没有别的谋生之道,家里还有老人要养,实在过不下去了。杨士奇主动找到他,问他有没有读过四书,这个人虽然穷点,学问还是有的,便回答说读过。杨士奇当即表示,自己可以把教的学生分一半给他,并将教书的报酬也分一半给他。 +他的这位朋友十分感动,因为他知道,杨士奇也有母亲要养,家境也很贫穷,在如此的情况下,竟然还能这样仗义,实在太不简单。 +少了一半收入的杨士奇回家将这件事情告诉了母亲,他本以为母亲会不高兴,毕竟本来已经很穷困的家也实在经不起这样的折腾,但出乎他意料的是,母亲却十分高兴地对他说:“你能够这样做,不枉我养育你成人啊!” +是的,穷人也是有尊严和信义的,正是因为有这样明理的母亲,后来的杨士奇才能成为一代名臣。 +杨士奇就是这样成长起来的,在困难中不断努力,在贫困中坚持信念,最终成就事业。 +人穷,志不可短! +没有功名的杨士奇仕途并不顺利,他先在县里做了一个训导(类似今天的县教育局官员),训导是个小官,只是整天在衙门里混日子,可杨士奇做官实在很失败,他连混日子都没有混成。 +不久之后,杨士奇竟然在工作中丢失了学印,在当年那个时代,丢失衙门印章是一件很大的事,比今天的警察丢枪还要严重得多,是有可能要坐牢的。此时,杨士奇显示了他灵活的一面。 +如果是方孝孺丢了印,估计会写上几十份检讨,然后去当地政府自首,坐牢时还要时刻反省自己,杨士奇没有这么多花样,他直接就弃官逃跑了。 +杨士奇还真不是书呆子啊 +之后逃犯杨士奇流浪江湖,他这个所谓逃犯是应该要画引号的,因为县衙也不会费时费力来追捕他,说得难听一点,他连被追捕的价值都不具备,此后二十多年,他到处给私塾打工养活自己,值得欣慰的是,长年漂泊生活没有让他变成二混子,在工作之余,他继续努力读书,其学术水平已达到了一个相当的高度。 +在度过长期学习教书的流浪生活后,杨士奇终于等到了他人生的转机。 +建文二年(1400),建文帝召集儒生撰写《太祖实录》,三十六岁的杨士奇由于其扎实的史学文学功底,被保举为编撰。 +在编撰过程中,杨士奇以深厚的文史才学较好地完成了工作,并得到了此书主编方孝孺的赞赏,居然一举成为了《太祖实录》的副总裁。 +永乐继位后,杨士奇真正得到了重用,他与解缙等人一起被任命为明朝首任内阁七名成员之一,自此之后,他成为了朱棣的重臣。 +与解缙相同,他也不是个安分的人,此后不久,他卷入了立太子的纷争,他和解缙都拥护朱高炽,但与解缙不同的是,他要聪明得多。 +青少年时期的艰苦经历磨炼了杨士奇,使他变得老成而有心计。他为人十分谨慎,别人和他说过的话,他都烂在肚子里,从不轻易发言泄密,他是太子的忠实拥护者,却从不明显表现出来,其城府可见一斑。 +而杨士奇之所以能够有所成就,其经验大致可以概括为一句话: +刚出道时要低调,再低调。 +虽然杨士奇精于权谋诡计,但事实证明,他并不是一个滑头的两面派,在这场你死我活的夺位斗争中,他始终坚定地站在了朱高炽一边,并依靠自己的智慧和忠诚最终战胜了政治对手,将朱高炽扶上了皇帝的宝座。 +永乐年间,最为残酷的政治斗争就是朱高炽与朱高煦的皇位之争,在这场斗争中,无数人头落地,无数大臣折腰,阴谋诡计层出不穷,双方各出奇谋,经过更是一波三折,跌宕起伏,斗争一直延续到朱棣去世的那个夜晚,一个人冒着极大的风险,秘密连夜出发,奔波一个月赶路报信,方才分出了胜负。 +事实上,不但杨士奇参加了这场斗争,我们下面要介绍的三杨中的另外两个也没有闲着,他们都是太子党的得力干将。在后面的文章中,我们会详细介绍这场惊天动地的皇位之争。 +第二个人 +第三个人临危不惧杨溥 +下面要说的这位杨溥,其名气与功绩和前面介绍过的两位相比有不小的差距,但他却是三人中最具传奇色彩的一个,别人出名、受重用依靠的是才学和能力,他靠的却是蹲监狱。 +杨溥,洪武五年(1372)生,湖北石首人,建文二年(1400)中进士,是杨荣的进士同学,更为难得的是,他也被授予编修,又成为了杨荣的同事,但与杨荣不同的是,杨溥是天生的太子党,因为在永乐元年,他就被派去服侍朱高炽,算是早期党员。 +朱棣毕竟还是太天真了,杨荣和杨溥这种同学加同事的关系,外加内阁七人文臣集团固有的拥立太子的政治立场,说杨荣不是太子党,真是鬼都不信。 +杨溥没有杨士奇和杨荣那样突出的才能,他辅佐太子十余年,并没有什么大的成就,也不引人注目,这样下去,即使将来太子即位,他也不会有什么前途,但永乐十二年发生的一个突发事件却改变了他的命运,不过,这个突发事件实在不是一件好事。 +永乐十二年(1414),“东宫迎驾事件”事发,这是一个有着极深政治背景的事件,真正的幕后策划者正是朱高煦。在这次事件中,太子党受到严重打击,几乎一蹶不振,许多大臣被关进监狱当替罪羊,而杨溥正是那无数普普通通的替罪羊中的一只。 +由于杨溥的工作单位就是太子东宫,所以他被认定为直接责任者,享受特殊待遇,被关进了特级监狱——锦衣卫的诏狱。 +锦衣卫诏狱是一所历史悠久,知名度极高的监狱,级别低者是与之无缘的(后期开始降低标准,什么人都关),能进去人的不是穷凶极恶就是达官显贵。所谓身不能至,心向往之,有些普通犯人对这所笼罩神秘色彩的监狱也有着好奇心,这种心理也可以理解,从古至今,蹲监狱一直都是吹牛的资本,如“兄弟我当年在里面的时候”,说出来十分威风。 +此外,蹲出名的人也绝不在少数。反正在哪里都是坐牢,找个知名度最高的监狱蹲着,将来出来后还可以吹牛“兄弟我当年蹲诏狱的时候”,应该也能吓住不少同道中人。 +这样看来,蹲监狱也算是出名的一条捷径。 +然而事实上,在当年,想靠蹲诏狱出名可不是一件容易的事,首先要够级别,其次你还要有足够的运气。 +因为一旦进了诏狱,就不太容易活着出来了。 +诏狱是真正的人间地狱,阴冷潮湿,环境恶劣,虽然是高等级监狱,却绝不是卫生模范监狱,蚊虫老鼠到处跑,监狱也从来不搞卫生评比,反正这些东西骚扰的也不是自己。 +虽然环境恶劣,但北镇抚司的锦衣卫们(诏狱由北镇抚司直辖)却从来没有放松过对犯人们的关照,他们秉承着宽于律己,严于待人的管理理念,对犯人们严格要求,并坚持抗拒从严,坦白也从严的审讯原则,经常用犯人练习拳脚功夫,以达到锻炼身体的目的,同时他们还开展各项刑具的科研攻关工作,并无私地在犯人身上试验刑具的实际效果。 +最初进入诏狱的犯人每天的生活都是在等待——被审讯——被殴打(拳脚,上刑具)——等待中度过的,等到每人审你也没人打你的时候,说明你的人生开始出现了三种变数,1、即将被砍头 2、即将被释放 3、你已经被遗忘了 +相信所有的犯人都会选择第二种结果,但可惜的是,选择权从来不在他们的手上。 +这就是诏狱,这里的犯人没有外出放风的机会,没有打牌消遣等娱乐活动,自然更不可能在晚上排队到礼堂看新闻报道。 +第三个人(2) +第九章 生死相搏 +朱高煦一直不服气 +这也很容易理解,他长得一表人才,相貌英俊,且有优秀的军事才能,相比之下,自己的那个哥哥不但是个大胖子,还是个瘸子,连走路都要人扶,更别谈骑马了。 +简直就是个废人。 +可是,偏偏就是这样的一个废人,将来要做自己的主人! +谁让人家生得早呢? +自己也不是没有努力过,靖难的时候,拼老命为父亲的江山搏杀,数次出生入死,却总是被父亲忽悠,虽得到了一句“勉之,世子多疾!”的空话,却从此就没有了下文。 +干了那么多的事,却什么回报都没有,朱高煦很愤怒,后果很严重。 +他恨朱高炽,更恨说话不算数的父亲朱棣。 +想做皇帝,只能靠自己了。 +不择手段、不论方法,一定要把皇位抢过来! +朱高煦不知道的是,他确实错怪了自己的父亲。 +朱棣是明代厚黑学的专家,水平很高,说谎抵赖如同吃饭喝水一样正常,但在选择太子这件事情上,他却并没有骗人,他确实是想立朱高煦的。 +父亲总是喜欢像自己的儿子,朱高煦就很像自己,都很英武、都很擅长军事、都很精明、也都很无赖。 +朱高炽却大不相同,这个儿子胖得像头猪,臃肿不堪,小时候得病成了瘸子(可能是小儿麻痹症),走路都要人扶,简直就是半个废人。朱棣实在想不通,如此英明神武的自己,怎么会有个这样的儿子。 +除了外貌,朱高炽在性格上也和朱棣截然相反,他是个老实人,品性温和,虽然对父亲十分尊重,但对其对待建文帝大臣的残忍行为十分不满,这样的人自然也不会讨朱棣的喜欢。 +于是朱棣开始征求群臣的意见,为换人做准备,他先问自己手下的武将,得到的答案几乎是一致的——立朱高煦。 +武将:战友上台将来好办事啊。 +之后他又去问文臣,得到的答复也很统一——立朱高炽。 +文臣:自古君不立长,国家必有大乱。 +一向精明的朱棣也没了主意,便找来解缙,于是就有了前面所说的那场著名的谈话。从此朱棣开始倾向于立朱高炽。 +但在此之后,禁不住朱高煦一派大臣的游说,朱棣又有些动摇,立太子一事也就搁置了下来,无数大臣反复劝说,但朱棣就是不立太子,朱高炽派大臣十分明白,朱棣是想立朱高煦的。于是,朱高炽派第一干将解缙开始了他的第二次心理战。 +不久之后,有大臣画了一幅画(极有可能是有人预先安排的),画中一头老虎带着一群幼虎,作父子相亲状。朱棣也亲来观看,此时站在他身边的解缙突然站了出来,拿起毛笔,不由分说地在画上题了这样一首诗: +虎为百兽尊,谁敢触其怒。 +惟有父子情,一步一回顾。 +高!实在是高! +解缙的这首打油诗做得并不高明,却很实用,所谓百兽尊不就是皇帝吗,这首诗就是告诉朱棣,你是皇帝,天下归你所有,但父子之情是无法替代也不应抛开的。朱高煦深受你的宠爱,但你也不应该忘记朱高炽和你的父子之情啊。 +解缙的判断没有错,朱棣停下了脚步,他被深深地打动了。 +是啊,虽然朱高炽是半个废人,虽然他不如朱高煦能干,但他也是我的儿子,是我亲自抚养长大的亲生儿子啊!他没有什么显赫的功绩,但他一直都是一个忠厚老实的人,从没有犯错,不应该对他不公啊。 +就在那一刻,朱棣做出了决定。 +他命令,立刻召见朱高炽,并正式册封他为太子(上感其意,立召太子归,至是遂立之)。 +从此朱高炽成为了太子,他终于放心了,支持他的太子党大臣们也终于放心了。 +这场夺位之争似乎就要以朱高炽的胜利而告终,然而事实恰恰相反,这场争斗才刚开始。 +朱高煦的阴谋(1) +杨士奇虽然学问比不上解缙,他的脑袋可比解缙灵活得多,解缙虽然也参与政治斗争,却实在太嫩,一点也不知道低调做官的原则。本来就是个书生,却硬要转行去干政客,隔行如隔山,水平差的太远。 +杨士奇就大不相同了,此人我们介绍过,他不是科举出身,其履历也很复杂,先后干过老师、教育局小科员、逃犯(其间曾兼职教师)等不同职业,社会背景复杂,特别是他在社会上混了二十多年,也算跑过江湖,黑道白道地痞混混估计也见过不少,按照今天的流动人口规定,他这个流动了二十年的人是绝对的盲流,估计还可以算是在道上混过的。 +朝廷就是一个小社会,皇帝大臣们和地痞混混也没有什么区别,不过是吃得好点,穿得好点,人品更卑劣,斗争更加激烈点而已,在这里杨士奇如鱼得水,灵活运用他在社会上学来的本领,而他学得最好,也用得最好的就是:做官时一定要低调。 +他虽然为太子继位监国出了很多力,却从不声张,永乐七年(1409)七月,太子为感谢他一直以来的工作和努力,特别在京城闹市区繁华地带赐给他一座豪宅,换了别人,估计早就高高兴兴地去拿钥匙准备入住,可杨士奇却拒绝了。 +他推辞了太子的好意,表示自己房子够住,不需要这么大的豪宅。 +这个世界上没有人会嫌房子多,杨士奇也不例外,他拒绝的原因其实很简单,如果他拿了那栋房子,就会成为朱高煦的重点打击目标,权衡利弊,他明智地拒绝了这笔横财。 +杨士奇虽然没有接受太子的礼物,但他对太子的忠诚却是旁人比不上的,应该说他成为太子党并不完全是为了投机,很大程度上是因为他对太子的感情。 +自永乐二年(1404)朱高炽被立为太子后,杨士奇就被任命为左中允(官名),做了太子的部下,朱高炽虽然其貌不扬,却是个真正仁厚老实的人,经常劝阻父亲的残暴行为,弟弟朱高煦屡次向他挑衅,阴谋对付他,朱高炽却一次又一次的容忍了下来,甚至数次还帮这个无赖弟弟说情。 +这些事情给杨士奇留下了深刻的印象,他虽然历经宦海,城府极深,儿时母亲对他的教诲却始终记在心头,仗义执言已经成为了他性格中的一部分,虽然很多年过去了,他却并没有变,他还是当年的那个正气在胸的杨士奇。 +眼前的朱高炽虽然形象不好,身体不便,却是一个能够仁怀天下的人,他将来一定能成为一个好皇帝的,我相信自己的判断。 +秉持着这个信念,杨士奇与太子同甘共苦,携手并肩,走过了二十年历经坎坷的储君岁月。 +说来也实在让人有些啼笑皆非,可能是由于杨士奇过于低调,连朱棣也以为杨士奇不是太子党,把他当成了中间派,经常向他询问太子的情况,而在永乐十年(1412)的风波之后,朱棣对太子也产生了怀疑,便向杨士奇询问太子监国时表现如何。 +这看上去是个很简单的问题,实际上却暗藏杀机。 +城府极深的杨士奇听到这句问话后,敏锐地感觉到了这一点,他立刻意识到,决定太子命运的关键时刻来到了。 +他紧张地思索着问题的答案。 +趁着杨士奇先生还在思考的时间,我们来看一下为什么这个问题难以回答又十分关键。 +如果回答太子十分积极,勤恳做事,和群众(大臣)们打成一片,能独立处理政事,威望很高的话,那太子一定完蛋了。 +你爹还在呢,现在就拉拢大臣,独立处事,想抢班夺权,让老爹不得好死啊。 +既然这个答案不行,那么我们换一个答案: +太子平时积极参加娱乐活动,不理政事,疏远大臣,有事情就交给下面去办,没有什么威信。 +这样回答的话,太子的结局估计也是——完蛋。 +这又是一个非常类似二十二条军规的矛盾逻辑。 +太子的悲哀也就在此,无数太子就是这样被自己的父亲玩残的,自古以来,一把手和二把手的关系始终是处理不好的,在封建社会,皇帝就是一把手,太子就是二把手,自然逃脱不了这个规则的制约。 +你积极肯干,说你有野心,你消极怠工,说你没前途。 +干多了也不行,干少了也不行,其实只是要告诉你,不服我是不行的 +让你干,你就不得休息,不让你干,你就不得好死。 +这似乎是很难理解的,到底是什么使得这一滑稽现象反复发生呢? +答案很简单:权力。 +谁分我的权,我就要谁的命!(儿子也不例外) +朱棣很明白,他最终是要将权力交给太子的,而在此之前,太子必须有一定的办事能力,为了帝国的未来,无能的废物是不能成为继承人的,所以必须给太子权力和锻炼的机会,但他更明白,要想得一个善终,混个自然死亡,不至于七八十岁还被拉出去砍头,就必须紧紧握住自己手中的权力,直到他死的那一天! +儿子是不能相信的,老婆是不能相信的,天下人都是不能相信的 +这就是皇帝的悲哀。 +朱高煦的阴谋(3) +无畏的杨士奇 +当时的政治局势极为复杂,由于朱棣公开斥责太子,且把太子的很多亲信都关进了监狱,于是很多大臣们都认为太子已经干不了多久了,倒戈的倒戈,退隐的退隐,太子也朱高炽陷入了孤立之中,现实让他又一次见识了世态炎凉,人情冷暖 +原先巴结逢迎的大臣们此时都不见了踪影,唯恐自己和太子扯上什么关系,连累自己的前途,在这种情况下,杨士奇开始了他和朱棣的问答较量。 +这次朱棣没有遮遮掩掩,他直接了当地问杨士奇,太子是否有贰心,不然为何违反礼仪,迟缓接驾?(这在朱棣看来是藐视自己) +在此之前,也有人也劝过杨士奇要识时务,太子已经不行了,应该自己早作打算。 +杨士奇用自己的答案回复了朱棣,也回复了这些人的“建议”。 +杨士奇答道:“太子对您一直尊敬孝顺,这次的事情是我们臣下没有做好准备工作,罪责在我们臣下,与太子无关。”(太子孝敬,凡所稽迟,皆臣等罪) +说完,他抬起头,无畏地迎接朱棣锐利的目光。 +朱棣终于释然了,既然不是太子的本意,既然太子并不是有意怠慢,自己也就放心了。 +就这样,悬崖边上的朱高炽又被杨士奇拉了回来。 +杨士奇这样做是需要勇气的,在太子势孤的情况下,主动替太子承担责任,需要冒很大的风险,要知道,朱棣不整太子,对他们这些东宫官员们却不会手软。与他一同辅佐太子的人都已经进了监狱,只剩下了他暂时幸免,但他却主动将责任归于自己,宁愿去坐牢,也不愿意牵连太子。 +杨士奇用行动告诉了那些左右摇摆的人,不是所有的人都能被收买,不是所有的人都趋炎附势。 +从当时的形势来看,朱高炽的太子地位被摘掉是迟早的事情,继续跟随他并不明智,还很容易成为朱高煦打击的对象,是非常危险的。所以我们可以说,在风雨飘摇中依然坚持支持太子的杨士奇,不是一个投机者。 +就如同三十年前,他身处穷困,却仍然无私援助那位朋友一样,三十年后,他又做出了足以让自己母亲欣慰的事情。 +三十年过去了,虽然他已身处高位,锦衣玉食,他的所作所为却并没有违背他的人生信条。 +人穷志不短,患难见真情 +杨士奇最终还是为他的无畏行为付出了代价,朱高煦恨他入骨,指示他买通的人攻击杨士奇(士奇不当独宥),本来不打算处置他的朱棣也禁不住身边人的反复煽动,将杨士奇关入了监狱。 +朱高炽得知杨士奇也即将被关入监狱,十分焦急,但以他目前的处境,仅能自保,是绝对保不住杨士奇的。 +杨士奇却不以为意,反而在下狱前对太子说:殿下宅心仁厚,将来必成一代英主,望殿下多多保重,无论以后遇到什么情况,都一定要坚持下去,决不可轻言放弃。 +此时,朱高炽终于意识到,眼前这个即将进入监狱却还心忧自己的杨士奇其实不只是他的属下,更是他的朋友,是患难与共的伙伴。 +太子的地位保住了,却已经成为了真正的孤家寡人,在朱高煦咄咄逼人的气势下,他还能坚持多久呢? +朱高煦的失误 +朱高煦终于第一次掌握了主动权,他的阴谋策划终于有了结果,太子受到了沉重打击,而帮太子说话的文官集团也已经奄奄一息,形势一片大好,前途十分光明。 +话说回来,人有一个很大的缺点,那就是一旦得意就容易忘形,朱高煦也不例外。 +胜利在望的朱高煦在历史书中找到了自己的偶像,并在之后的岁月中一直以此自居。 +他的这位偶像就是唐太宗李世民,他经常见人就说:“我这么英明神武,不是很像李世民吗(我英武,岂不类秦王李世民乎)?” +如此急切表白自我的言语,今日观之,足以让人三伏天里尚感寒气逼人,如果朱高煦出生在现代,定可大展拳脚,拍些个人写真照片,再配上自信的台词,必能一举成名。 +朱高煦不是花痴,他这样说是有着深厚的政治寓意的。 +大家只要想一想就能明白他的隐含意思,李世民与朱高煦一样,都是次子,李建成对应朱高炽,都是太子,甚至连他们的弟弟也有对应关系,李元吉对应朱高燧,都是第三子。 +这样就很清楚了,李世民杀掉了李建成,当上皇帝,朱高煦杀掉朱高炽,登上皇位。 +朱高煦导演希望把几百年前的那一幕戏再演一遍。 +我们这?先不说朱高煦先生是否有李世民那样的水平,既然他坚持这样认为,那也没办法,就凑合吧,让他先演李世民,单从这出戏的演员阵容和所处角色上看,似乎和之前的那一幕确实十分相似。 +但朱高煦导演也出现了一个致命的失误,他忽略了这场戏中另一个大牌演员的感受,强行派给他一个角色,这也导致了他最终的失败。 +他要派的是这场戏的主要角色之一——李世民的父亲李渊,被挑中的演员正是他的父亲朱棣。 +这也是没办法的事,要把这场戏演好,演完,搞一个朱高煦突破重重险阻,战胜大坏蛋朱高炽,登基为皇帝的大团圆结局,就必须得到赞助厂商总经理朱棣的全力支持。 +朱棣不是李渊,事实上,他跟李渊根本就没有任何共通点,但他很清楚,上一幕戏中,李渊在李世民登基后的下场是被迫退位,如果这一次朱高煦像当年的李世民那样来一下,他的结局也是不会超出剧本之外的。 +朱棣虽然不是导演,却是戏霸。 +让我演李渊,你小子还没睡醒吧! +太子党的反击 +一剑封喉 +朱棣被杨士奇的话震惊了,朱高煦三番两次不肯走,如今要迁都了,他却执意留在南京,他到底想干什么?! +不能再拖了,让他马上就滚! +永乐十五年(1417)三月,不顾朱高煦的反复哀求,朱棣强行将他封到了乐安州(今山东广饶),朱高煦十分不满,但也没有办法,他已经意识到,自己此生注定不可能用合法手段登上皇位了 +朱棣确实是一个老谋深算的人,如果我们翻开地图察看的话,就会发现他似乎已经预见到了自己的这个儿子将来不会老实,于是在封地时,便已做好了打算。乐安州离北京很近,离南京却很远,将朱高煦调离他的老巢,安置在天子眼皮底下,将来就算要打,朝发夕至,很快就能解决,不能不说是一招好棋。 +至少在这一点上,朱棣要比他的父亲高明。 +至此,储君之争暂时告一段落,太子党经过长期艰苦的斗争,稳住了太子的宝座,也为后来仁宣盛世的出现提供了必要条件。 +另一方面,朱高煦多年的图谋策划最终付之东流,至少朱棣绝对不会再考虑立他为太子了,但这位仁兄自然也是不会死心的,他把自己的阴谋活动完全转入地下,并勾结他的同党准备东山再起。 +不过这一次他不打算继续搞和平演变了,因为在他面前只剩下了一条路——武装夺权。 +虽然方针已经拟定,但朱高煦还是很有自知之明的,自己老爹打仗有多厉害,他比谁都清楚,只要他还是一个精神正常的人,就绝对不会在自己老爹头上动土。 +朱高煦决定等待,等到时机成熟的那一天。 +最后的秘密 +告别 +永乐十六年(1418)三月北京庆寿寺 +朱棣带着急促的脚步走进了寺里,他不是来拜佛的,他到这里的目的,是要向一个人告别,向一个朋友告别。 +八十四岁的姚广孝已经无力起身迎接他的朋友,长年的军旅生涯和极其繁重的参谋工作耗干了他的所有精力,当年那个年过花甲却仍满怀抱负的阴谋家不见了,取而代之的只是一个躺在床上的无力老者。 +此时的姚广孝感慨良多,洪武十八年(1385)的那次相遇不但改变了朱棣的一生,也改变了自己的命运。自此之后,他为这位野心家效力,奇计百出,立下汗马功劳,同吃同住同劳动(造反应该也算是一种劳动)的生活培养了他和朱棣深厚的感情,朱棣事实上已经成为了他的朋友。 +这并不奇怪,野心家的朋友一般都是阴谋家。 +在朱棣取得皇位后,姚广孝也一下子从穷和尚变成了富方丈,他可以向朱棣要房子、车子(马车)、美女、金银财宝,而朱棣一定会满足他的要求。因为作为打下这座江山的第一功臣,他完全有这个资格。 +可他什么也不要 +金银赏赐退了回去,宫女退了回去,房屋宅第退了回去,他没有留头发,还是光着脑袋去上朝,回家后换上僧人服装,住在寺庙里,接着做他的和尚。 +他造反的目的只是为了实现自己的抱负,抱负实现了,也就心满意足了。此外,他还十分清楚自己的那位“朋友”朱棣根本不是什么善类,他是绝对不会容忍一个知道他太多秘密,比他还聪明的人一直守在身边的。 +所以他隐藏了自己,只求平静地生活下去。 +综观他的一生,实在没有多少喜剧色彩,中青年时代不得志,到了60岁才开始自己的事业,干的还是造反这个整日担惊受怕,没有劳动保险的特种行业。等到造反成功也不能太过招摇,只能继续在寺庙里吃素,而且他也没有类似抽烟喝酒逛窑子的业余爱好,可以说,他的生活实在很无趣 +他谋划推翻了一个政权,又参与重建了一个政权,却并没有得到什么,而在某些人看来,他除了挣下一个助纣为孽的阴谋家名声外,这辈子算是白活了。 +他的悲剧还不仅于此,他之前的行为不过是各为其主罢了,也算不上是个坏人,他还曾经劝阻过朱棣不要大开杀戒,虽然并没有成功,却也能看出此人并非残忍好杀之辈。 +但这并不能减轻他的恶名,因为他毕竟是煽动造反的不义之徒,旁人怎么看倒也无所谓,最让他痛苦的是,连他唯一的亲人和身边的密友也对他嗤之以鼻。 +永乐二年(1404)八月,姚广孝回到了家乡长州,此时他已经是朝廷的重臣,并被封为太子少师,与之前落魄之时大不相同,可以说是衣锦还乡,但出乎他意料的事情发生了。 +父母已经去世,他最亲的亲人就是他的姐姐,他兴冲冲地赶去姐姐家,希望自己的亲人能够分享自己的荣耀,但他的姐姐却对他闭而不见(姊不纳),无奈之下,他只好去见青年时候的好友王宾,可是王宾也不愿意见他(宾亦不见),只是让人带了两句话给他,这两句话言简意赅,深刻表达了王宾对他的情感: +和尚误矣!和尚误矣! +姚广孝终于体会到了众叛亲离的滋味,原先虽然穷困,但毕竟还有亲人和朋友,现在大权在握,官袍加身,身边的人却纷纷离他而去。 +耳闻目睹,都带给姚广孝极大的刺激,从此他除了白天上朝干活外,其余的时间都躲在寺庙里过类似苦行僧的生活,似乎是要反省自己以前的行为。 +这种生活磨练着他的身体,却也给他带来了长寿,这位只比朱元璋小七岁的和尚居然一口气活到了八十四岁,他要是再争口气,估计连朱棣都活不过他,有望打破张定边的纪录。 +但这一切只是假设,现在已经奄奄一息的他正躺在床上看着自己这位叫朱棣的朋友 +心情复杂的朱棣也注视着姚广孝,像他这样靠造反起家的人最为惧怕的就是造反。所以他抓紧了手中的权力,怀疑任何一个靠近他的人,而眼前的这个人是唯一例外的。这个神秘的和尚帮助他夺取了皇位,却又分毫不取,为人低调,他了解自己的脾气,性格和所有的一举一动,权谋水平甚至超过了自己,却从不显露,很有分寸。这真是个聪明人啊! +只有这样的聪明人才能做朱棣的朋友。 +在双方的这最后一次会面中,他们谈了很多,让人奇怪的是,他们谈的都是一些国家大事,姚广孝丝毫未提及自己的私事,这似乎也很正常,大家相处几十年,彼此之间十分了解,也就没有什么私事可说了的吧。 +朱棣很清楚,姚广孝已经不行了,这是一个做事目的性很强的人,自然不会无缘无故在生命的最后时刻找自己聊国家大事,他一定会提出某个要求。 +朱棣和姚广孝如同老朋友一般地继续着交谈,但在他们的心底,都等待着最后时刻的到来。 +话终于说完了,两人陷入了沉默之中。 +姚广孝终于开口了,他提出了人生中最后一个要求: +“请陛下释放溥洽吧。” +朱棣默然(1) +是的,雄才大略的朱棣在他执政的每一个日日夜夜都挂念着这件事,恐惧着这件事。 +朱允炆,你到底是死是活,现在何方?! +朱棣,不用再等多久了,你很快就会知道答案。 +永乐二十年(1422),欠收拾的阿鲁台又开始闹事,他率军大举进攻明朝边境,其本意只是小打小闹,想干一票抢劫而已,估计明朝也不会把他怎么样,这一套理论用在别人身上有可能行得通,但可惜的是,他的对手是从不妥协的朱棣。 +朱棣听说这个十二年前被打服的小弟又不服了,也不多说,虽已年届花甲(当时五十五岁),好勇斗狠的个性却从未减退。 +不服就打到你服为止! +同年三月,朱棣又一次亲征,大军浩浩荡荡向鞑靼进发,一路上都没有遇到什么像样的抵抗,到了七月,大军抵达沙珲原(地名),接近了阿鲁台的老巢。 +阿鲁台实行不抵抗政策,是否有什么后着呢? +答案是没有。 +阿鲁台不抵抗的原因很简单,他没有能力抵抗。 +这位当年曾立志于恢复蒙古帝国的人已经蜕变成了一个小毛贼,只能抢抢劫,闹闹事,他没有退敌的办法,唯一的应对就是带着老婆孩子跑路。 +荡平了阿鲁台的老巢后,朱棣准备班师回朝,由于当时兀良哈三卫与阿鲁台已经互相勾结,所以朱棣决定回去的路上顺便教训一下这个当年的下属。 +他命令部队向西开进,并说道:“兀良哈知道我军前来,必然向西撤退,在那里等着他们就是了。” +部下们面面相觑,人家往哪边撤退,你是怎么知道的? +可是皇帝说话,自然要听,大军随即向西边转移,八月到达齐拉尔河,正好遇到了兀良哈的军队及部落。 +兀良哈十分惊慌,朱棣却十分兴奋,按照现在的退休制度,他已经到了退休年龄,虽然按照级别划定,他应该是厅级以上干部,估计还能干很长时间,但中国历史上,皇帝到了他这个年纪,还亲自拿刀砍人的实在是少之又少。 +值此遇敌之时,他横刀立马,以五十五岁之高龄再次带领骑兵亲自冲入敌阵,大破兀良哈(斩首数百级,余皆走散)。 +此后他又率军追击,一举扫平了兀良哈的巢穴,这才心满意足地回了家。 +从朱棣的种种行为经历来看,他是一个热爱战争陶醉于战争的人,是一个天生的战士。 +上天并没有亏待这位喜欢打仗,热爱战争的皇帝,仅仅一年之后,他又一次亲征鞑靼,不过这次出征的缘由却十分奇特,很明显是没事找事。 +永乐二十一年(1423)七月,边关将领报告阿鲁台有可能(注意此处)会进攻边界,本来这不过是一份普通的边关报告,朱棣却二话不说,马上准备亲征。 +人家都说了,只是可能而已,而且边关既然能够收到情报,必然有准备,何需皇帝陛下亲自出马? +就算阿鲁台真的想要袭击边界,估计他也会说:“我还没动手呢,就算打也是小打,你干嘛搞这么大阵势?” +其实朱棣的动机十分简单: +实话说了吧,就是想打你,你能怎么样? +看来先发制人的政策绝非今日某大国首先发明的,这是历史上所有的强者通用的法则。 +同年八月,朱棣第四次亲征,千里之外的阿鲁台得到消息后,马上就开始收拾东西,准备溜号。他已经习惯了扮演逃亡者,并掌握了这一角色的行动规律和行为准则——你来我就跑,安全第一。 +这是一次不成功的远征,由于阿鲁台逃得十分彻底,朱棣什么也没有打着,只好班师回朝。 +虽然此次远征并无收获,朱棣却在远征途中获得了一件意想不到的礼物,一件对他而言价值连城的礼物。 +这件礼物就是他已苦苦寻觅二十年的答案。 +最后的答案(1) +胡濙深夜到访,会对朱棣说些什么呢?有以下几种可能: +A:我没有找到建文帝,也没有他的消息,这么晚跑来吵醒你是想逗你玩的。 +结论:不可能 +原因:朱棣不会把如此重要的工作交给一个精神不正常的人。 +B: 我找到了建文帝的下落,但他已经死了。 +结论:可能性较小 +原因:虽然本人当时并不在场,我却可以推定胡濙告诉朱棣的应该不是这句话,因为在史书中有一句极为关键的话可以证明我的推论 +“悉以所闻对,漏下四鼓乃出” +看到了吗,“漏下四鼓乃出”!如果说一个人已经死掉,就算你是验尸的,无论如何也不可能讲这么长时间,胡濙为人沉稳寡言,身负绝密使命,绝对不是一个喜欢说废话的人,所以我们可以推定,他告诉朱棣的应该不是这些。 +我们就此得出最后的结论C +C: 我找到了建文帝,并和他交谈过。 +结论:很有可能 +原因:以上两推论皆不对,此为所剩可能性最大的结论。 +就这样,我们结合史料用排除法得到了第二个推论. +推论2:胡濙找到了建文帝,并和他交谈过。 +结合推论1和推论2, 我们最终来到了这个谜团的终点——建文帝对胡濙说过些什么? +这看上去似乎是我们绝对不可能知道的,连胡濙对朱棣说了些什么我们都无法肯定,怎么能够了解到建文帝对胡濙说过什么话呢? +其实只要细细分析,就会发现,我们是可以知道的。 +因为建文帝对胡濙说过的话,必然就是胡濙和朱棣的谈话内容! +胡濙不是吃饱了没事干四处找人聊天的那种官员,他肩负重要使命,且必须完成,当他找到建文帝并与之交谈后,一定会把所有的谈话内容告诉朱棣,因为这正是他任务中的最重要部分。所以我们可以肯定,在那个神秘夜晚胡濙告诉朱棣的,正是建文帝告诉胡濙的。 +现在我们已经清楚,只要知道了胡濙和建文帝的谈话内容,就能了解胡濙和朱棣的谈话内容,那么胡濙和建文帝到底谈了些什么呢? +可以肯定的是,他们不会谈论天气好坏,物价高低等问题,当年的臣子胡濙除了向建文帝行礼叙旧外,其谈话必然只有一个主题——你的打算。 +陛下,你还活着,那你到底想怎么样呢? +我们有理由相信,朱允炆给了胡濙一个答案。 +而在那个神秘的夜里,胡濙告诉朱棣的也正是这个答案。 +建文帝的答案到底是什么,这看上去也是我们不可能知道的秘密。 +然而事实上,我们是可以了解这个秘密的,因为这个秘密的答案正是我们的第三个推论。 +解开秘密的钥匙仍然在史料中——“至是疑始释” +解脱了,彻底解脱了,二十年的疑问、忧虑、期待、愧疚、恐惧,在那个夜晚之后,全部烟消云散。 +需要说明的是,我们同时可以推定胡濙与朱棣谈话之时,建文帝应该还活着。 +因为胡濙是一个文臣,之后他还因为在此事上立下大功,被任命为尚书,并成为了后来的明宣宗托孤五大臣之一,在寻访过程中,为了保密,他一直是单人作业,像他这样的一个人,是干不出杀人灭口的事情的。而他深夜探访朱棣,也充分说明了在此之前,他并没有向朱棣通报过建文帝的消息。 +当然,在谈话之后,朱棣会不会派人去斩一下草,除一下根,那也是很难说的。 +不过我愿意相信,朱棣没有这样做,在我看来,他并不是一个灭绝人性的人,他的残忍行为只是为了保证自己的皇位,如今二十多年过去了,他也变成了一个老人,并且得到了那个答案,他也应该罢手了。 +推论3: 答案 +“二十年过去了,我也不想再争了,安心做你的皇帝吧,我只想一个人继续活下去。” +我相信,这就是最后的答案,因为只有这样的答案才能平息这场二十多年的纷争,才能彻底解脱这两个人的恐惧。 +坐在皇位上的那个,解脱的是精神,藏身民间的那个,解脱的是肉体。 +我不会再和你争了,做一个好皇帝吧。 +我不会再寻找你了,当一个老百姓,平静地活下去吧。 +这场叔侄之争终于划上了句号。为了权力,这对亲人彼此之间从猜忌到仇恨,再到兵刃相见,骨肉互残,最终叔叔打败了侄子,抢得了皇位。 +但事情并未就此结束,登上皇位的人虽然大权在握,却时刻提心吊胆,唯恐自己在某一天夜里醒来,会像上一个失败者那样失去自己刚刚得到的东西。 +因为一无所有并不可怕,可怕的是得到后再失去。 +被赶下去的那个人更惨,他必须抛弃荣华富贵的生活,藏身民间,从此不问世事,还要躲避当权者的追寻,唯有隐姓埋名,只求继续活下去。 +这种残酷的心灵和肉体上的煎熬整整持续了二十年,六千多个日日夜夜的折磨,足以让任何一个人发疯。 +得到了权力,似乎就得到了一切,但其实很多人并不明白,在权力游戏中,你没有休息的机会,一旦参加进来,就必须一直玩下去,直到你失败或是死亡。 +得到了很多,但失去的更多。 +这就是他们必须付出的代价,无论是成功者,还是失败者。 +走上了这条路,就不能再回头。 +死于征途的宿命(1) +班师。 +他也已经厌倦了,从少年时起跟随名将远征,到青年时靖难造反,再到成年时远出蒙古,横扫大漠。打了几十年的仗,杀了无数的人,驰骋疆场的生活固然让人意气风发,却也使人疲惫不堪。 +还是回家吧。 +七月,大军到达翠微岗,周身患病的朱棣召见了杨荣,君臣二人之间进行了最后一次谈话。 +朱棣说道:“太子经过这么多年磨练,政务已经十分熟悉,我回去后会将大权交给他,我自己就安度晚年,过几天平安日子吧。” +杨荣心中大喜,却并不表露,他回应道:“太子殿下忠厚仁义,一定不会辜负陛下的期望。” +重病缠身的朱棣笑了笑,他夺得了江山,也守住了江山,现在儿子已经很能干了,大明帝国必将在他的手中变得更加强大,自己也终于能够安享太平了。 +但朱棣想不到的是,他已经回不了家了。 +可能上天也学习了朱棣这种凡事做绝的作风,他注定要让这个喜爱战争和打仗的皇帝在征途中结束他的一生。 +大军到达榆木川后,朱棣那原本强撑着的身体终于支持不住,于军营中病逝,年六十五。 +六十五年前,在战火硝烟中诞生的那个婴孩,经历了无数风波,终于在征途中找到了自己的归宿,获得了永久的安宁。 +在我看来,在远征途中死去,实在是他最佳的落幕方式,这位传奇帝王就此结束了他的一生。 +这似乎也是一种宿命,生于战火,死于征途的宿命。 +按照以往的习惯,应该给这位皇帝写一个整体的评价,其实对这位传奇帝王的评价,在以往的明史资料中有很多版本,而我认为最为出色的当属明史的评论。 +虽然明史有很多错漏和问题,但至少在对朱棣的评价上,在我看来,史料中无出其右者,我之前很少引用古文,最多只是引用只言片语,用来说明出处,但此段文字实在是神来之笔,在下本欲自己动笔写评,奈何实在不敢班门弄斧,故引用如下: +赞: +“文皇少长习兵,据幽燕形胜之地,乘建文孱弱,长驱内向,奄有四海。即位以 +后,躬行节俭,水旱朝告夕振,无有壅蔽。知人善任,表里洞达,雄武之略,同符高祖。六师屡出,漠北尘清。至其季年,威德遐被,四方宾服,明命而入贡者殆三十国。幅陨之广,远迈汉唐!成功骏烈,卓乎盛矣!然而革除之际,倒行逆施,惭德亦曷可掩哉! +幅陨之广,远迈汉唐!成功骏烈,卓乎盛矣! +得评如此,足当含笑九泉! +他不是一个好人,却是一个不折不扣的好皇帝。 +深夜的密谋(1) +可是不改似乎又不行,问题总得解决啊。 +在这个世界上的无数国家民族中,要排聪明程度,中国人绝对可以排在前几位,而其最大的智慧之一就在于变通。这样做不行,那就换个做法,反正达到目的就可以了。 +所谓此路不通,我就绕路走,正是这一智慧的集中体现。 +朱高炽没有改动父亲的大学士品位设置,却搞了一套兼职体系。 +他任命杨荣为太常寺卿,杨士奇为礼部侍郎,金幼孜为户部侍郎,同时还担任内阁大学士。这样原先只有五品的小官一下子成了三品大员,办起事情来也就方便了。 +目的达到了,父亲的制度也没有违反,从此这一兼职制度延续了二百多年,并成为了内阁的固定制度之一。 +这类的事情在之后的历史中比比皆是,每看及此,不得不为中国人的智慧而惊叹。 +登基后的朱高炽并没有忘记那些当年和他共患难的朋友们,洪熙元年(1425),他用自己的行为回报了他的朋友。 +在一般人看来,皇帝回报大臣无非是赏赐点东西,夸奖两句,而这位朱高炽的回报方式却着实让人吃惊,在历代皇帝中也算极为罕见了。 +同年四月的一天,朱高炽散朝后,留下了杨士奇和蹇义,他有话对这两个人说。 +在当年那场惊心动魄的斗争之中,无数人背叛了他,背离了他,只有这两个人在他极端困难的情况下,依然忠实地跟随着他,杨士奇自不必说,蹇义虽然为人低调,却也一直在他身边。 +年华逝去,大浪淘沙,这两个历经考验的人决不仅仅是他的属下,也是他的朋友。 +朱高炽注视着他的两个朋友,深情地说道:“我监国二十年,不断有小人想陷害我,无论时局之艰难,形势之险恶,心中之苦,我们三个人共同承担,最后多亏父亲仁明,我才有今天啊!” +回顾以前的艰难岁月,朱高炽感触良多,说着说着竟流下了眼泪。 +杨士奇和蹇义也泣不成声,说道:“先帝之明,也是被陛下的诚孝仁厚所感动的啊。” +就这样,经历苦难辛酸的三个朋友哭成一团。 +在我看来,这种真情的表述远比那些金银珠宝 \ No newline at end of file diff --git a/src/main/resources/mapper/IndexMapper.xml b/src/main/resources/mapper/IndexMapper.xml index ebff64c..4ec8790 100644 --- a/src/main/resources/mapper/IndexMapper.xml +++ b/src/main/resources/mapper/IndexMapper.xml @@ -65,12 +65,20 @@ - \ No newline at end of file + diff --git a/src/main/resources/mapper/QueryMapper.xml b/src/main/resources/mapper/QueryMapper.xml index f5f4a55..b6ea5f2 100644 --- a/src/main/resources/mapper/QueryMapper.xml +++ b/src/main/resources/mapper/QueryMapper.xml @@ -1,6 +1,21 @@ + + + + + + + + + + + + @@ -684,6 +699,10 @@ limit #{startpage} , 10 + + "),l=this.markdownTextarea=a.children("textarea")),l.addClass(s.textarea.markdown).attr("placeholder",n.placeholder),("undefined"==typeof l.attr("name")||""===l.attr("name"))&&l.attr("name",""!==n.name?n.name:i+"-markdown-doc");var c=[n.readOnly?"":'',n.saveHTMLToTextarea?'':"",'
','
','
'].join("\n");return a.append(c).addClass(r+"vertical"),""!==n.theme&&a.addClass(r+"theme-"+n.theme),this.mask=a.children("."+r+"mask"),this.containerMask=a.children("."+r+"container-mask"),""!==n.markdown&&l.val(n.markdown),""!==n.appendMarkdown&&l.val(l.val()+n.appendMarkdown),this.htmlTextarea=a.children("."+s.textarea.html),this.preview=a.children("."+r+"preview"),this.previewContainer=this.preview.children("."+r+"preview-container"),""!==n.previewTheme&&this.preview.addClass(r+"preview-theme-"+n.previewTheme),"function"==typeof define&&define.amd&&("undefined"!=typeof katex&&(t.$katex=katex),n.searchReplace&&!n.readOnly&&(t.loadCSS(n.path+"codemirror/addon/dialog/dialog"),t.loadCSS(n.path+"codemirror/addon/search/matchesonscrollbar"))),"function"==typeof define&&define.amd||!n.autoLoadModules?("undefined"!=typeof CodeMirror&&(t.$CodeMirror=CodeMirror),"undefined"!=typeof marked&&(t.$marked=marked),this.setCodeMirror().setToolbar().loadedDisplay()):this.loadQueues(),this},loadQueues:function(){var e=this,i=this.settings,o=i.path,r=function(){return t.isIE8?void e.loadedDisplay():void(i.flowChart||i.sequenceDiagram?t.loadScript(o+"raphael.min",function(){t.loadScript(o+"underscore.min",function(){!i.flowChart&&i.sequenceDiagram?t.loadScript(o+"sequence-diagram.min",function(){e.loadedDisplay()}):i.flowChart&&!i.sequenceDiagram?t.loadScript(o+"flowchart.min",function(){t.loadScript(o+"jquery.flowchart.min",function(){e.loadedDisplay()})}):i.flowChart&&i.sequenceDiagram&&t.loadScript(o+"flowchart.min",function(){t.loadScript(o+"jquery.flowchart.min",function(){t.loadScript(o+"sequence-diagram.min",function(){e.loadedDisplay()})})})})}):e.loadedDisplay())};return t.loadCSS(o+"codemirror/codemirror.min"),i.searchReplace&&!i.readOnly&&(t.loadCSS(o+"codemirror/addon/dialog/dialog"),t.loadCSS(o+"codemirror/addon/search/matchesonscrollbar")),i.codeFold&&t.loadCSS(o+"codemirror/addon/fold/foldgutter"),t.loadScript(o+"codemirror/codemirror.min",function(){t.$CodeMirror=CodeMirror,t.loadScript(o+"codemirror/modes.min",function(){t.loadScript(o+"codemirror/addons.min",function(){return e.setCodeMirror(),"gfm"!==i.mode&&"markdown"!==i.mode?(e.loadedDisplay(),!1):(e.setToolbar(),void t.loadScript(o+"marked.min",function(){t.$marked=marked,i.previewCodeHighlight?t.loadScript(o+"prettify.min",function(){r()}):r()}))})})}),this},setTheme:function(e){var t=this.editor,i=this.settings.theme,o=this.classPrefix+"theme-";return t.removeClass(o+i).addClass(o+e),this.settings.theme=e,this},setEditorTheme:function(e){var i=this.settings;return i.editorTheme=e,"default"!==e&&t.loadCSS(i.path+"codemirror/theme/"+i.editorTheme),this.cm.setOption("theme",e),this},setCodeMirrorTheme:function(e){return this.setEditorTheme(e),this},setPreviewTheme:function(e){var t=this.preview,i=this.settings.previewTheme,o=this.classPrefix+"preview-theme-";return t.removeClass(o+i).addClass(o+e),this.settings.previewTheme=e,this},setCodeMirror:function(){var e=this.settings,i=this.editor;"default"!==e.editorTheme&&t.loadCSS(e.path+"codemirror/theme/"+e.editorTheme);var o={mode:e.mode,theme:e.editorTheme,tabSize:e.tabSize,dragDrop:!1,autofocus:e.autoFocus,autoCloseTags:e.autoCloseTags,readOnly:e.readOnly?"nocursor":!1,indentUnit:e.indentUnit,lineNumbers:e.lineNumbers,lineWrapping:e.lineWrapping,extraKeys:{"Ctrl-Q":function(e){e.foldCode(e.getCursor())}},foldGutter:e.codeFold,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],matchBrackets:e.matchBrackets,indentWithTabs:e.indentWithTabs,styleActiveLine:e.styleActiveLine,styleSelectedText:e.styleSelectedText,autoCloseBrackets:e.autoCloseBrackets,showTrailingSpace:e.showTrailingSpace,highlightSelectionMatches:e.matchWordHighlight?{showToken:"onselected"===e.matchWordHighlight?!1:/\w/}:!1};return this.codeEditor=this.cm=t.$CodeMirror.fromTextArea(this.markdownTextarea[0],o),this.codeMirror=this.cmElement=i.children(".CodeMirror"),""!==e.value&&this.cm.setValue(e.value),this.codeMirror.css({fontSize:e.fontSize,width:e.watch?"50%":"100%"}),e.autoHeight&&(this.codeMirror.css("height","auto"),this.cm.setOption("viewportMargin",1/0)),e.lineNumbers||this.codeMirror.find(".CodeMirror-gutters").css("border-right","none"),this},getCodeMirrorOption:function(e){return this.cm.getOption(e)},setCodeMirrorOption:function(e,t){return this.cm.setOption(e,t),this},addKeyMap:function(e,t){return this.cm.addKeyMap(e,t),this},removeKeyMap:function(e){return this.cm.removeKeyMap(e),this},gotoLine:function(t){var i=this.settings;if(!i.gotoLine)return this;var o=this.cm,r=(this.editor,o.lineCount()),n=this.preview;if("string"==typeof t&&("last"===t&&(t=r),"first"===t&&(t=1)),"number"!=typeof t)return alert("Error: The line number must be an integer."),this;if(t=parseInt(t)-1,t>r)return alert("Error: The line number range 1-"+r),this;o.setCursor({line:t,ch:0});var a=o.getScrollInfo(),s=a.clientHeight,l=o.charCoords({line:t,ch:0},"local");if(o.scrollTo(null,(l.top+l.bottom-s)/2),i.watch){var c=this.codeMirror.find(".CodeMirror-scroll")[0],h=e(c).height(),d=c.scrollTop,u=d/c.scrollHeight;n.scrollTop(0===d?0:d+h>=c.scrollHeight-16?n[0].scrollHeight:n[0].scrollHeight*u)}return o.focus(),this},extend:function(){return"undefined"!=typeof arguments[1]&&("function"==typeof arguments[1]&&(arguments[1]=e.proxy(arguments[1],this)),this[arguments[0]]=arguments[1]),"object"==typeof arguments[0]&&"undefined"==typeof arguments[0].length&&e.extend(!0,this,arguments[0]),this},set:function(t,i){return"undefined"!=typeof i&&"function"==typeof i&&(i=e.proxy(i,this)),this[t]=i,this},config:function(t,i){var o=this.settings;return"object"==typeof t&&(o=e.extend(!0,o,t)),"string"==typeof t&&(o[t]=i),this.settings=o,this.recreate(),this},on:function(t,i){var o=this.settings;return"undefined"!=typeof o["on"+t]&&(o["on"+t]=e.proxy(i,this)),this},off:function(e){var t=this.settings;return"undefined"!=typeof t["on"+e]&&(t["on"+e]=function(){}),this},showToolbar:function(t){var i=this.settings;return i.readOnly?this:(i.toolbar&&(this.toolbar.length<1||""===this.toolbar.find("."+this.classPrefix+"menu").html())&&this.setToolbar(),i.toolbar=!0,this.toolbar.show(),this.resize(),e.proxy(t||function(){},this)(),this)},hideToolbar:function(t){var i=this.settings;return i.toolbar=!1,this.toolbar.hide(),this.resize(),e.proxy(t||function(){},this)(),this},setToolbarAutoFixed:function(t){var i=this.state,o=this.editor,r=this.toolbar,n=this.settings;"undefined"!=typeof t&&(n.toolbarAutoFixed=t);var a=function(){var t=e(window),i=t.scrollTop();return n.toolbarAutoFixed?void r.css(i-o.offset().top>10&&i
    ';i.append(n),r=this.toolbar=i.children("."+o+"toolbar")}if(!e.toolbar)return r.hide(),this;r.show();for(var a="function"==typeof e.toolbarIcons?e.toolbarIcons():"string"==typeof e.toolbarIcons?t.toolbarModes[e.toolbarIcons]:e.toolbarIcons,s=r.find("."+this.classPrefix+"menu"),l="",c=!1,h=0,d=a.length;d>h;h++){var u=a[h];if("||"===u)c=!0;else if("|"===u)l+='
  • |
  • ';else{var f=/h(\d)/.test(u),g=u;"watch"!==u||e.watch||(g="unwatch");var p=e.lang.toolbar[g],m=e.toolbarIconTexts[g],w=e.toolbarIconsClass[g];p="undefined"==typeof p?"":p,m="undefined"==typeof m?"":m,w="undefined"==typeof w?"":w;var v=c?'
  • ':"
  • ";"undefined"!=typeof e.toolbarCustomIcons[u]&&"function"!=typeof e.toolbarCustomIcons[u]?v+=e.toolbarCustomIcons[u]:(v+='',v+=''+(f?u.toUpperCase():""===w?m:"")+"",v+=""),v+="
  • ",l=c?v+l:l+v}}return s.html(l),s.find('[title="Lowercase"]').attr("title",e.lang.toolbar.lowercase),s.find('[title="ucwords"]').attr("title",e.lang.toolbar.ucwords),this.setToolbarHandler(),this.setToolbarAutoFixed(),this},dialogLockScreen:function(){return e.proxy(t.dialogLockScreen,this)(),this},dialogShowMask:function(i){return e.proxy(t.dialogShowMask,this)(i),this},getToolbarHandles:function(e){var i=this.toolbarHandlers=t.toolbarHandlers;return e&&"undefined"!=typeof toolbarIconHandlers[e]?i[e]:i},setToolbarHandler:function(){var i=this,o=this.settings;if(!o.toolbar||o.readOnly)return this;var r=this.toolbar,n=this.cm,a=this.classPrefix,s=this.toolbarIcons=r.find("."+a+"menu > li > a"),l=this.getToolbarHandles();return s.bind(t.mouseOrTouch("click","touchend"),function(t){var r=e(this).children(".fa"),a=r.attr("name"),s=n.getCursor(),c=n.getSelection();return""!==a?(i.activeIcon=r,"undefined"!=typeof l[a]?e.proxy(l[a],i)(n):"undefined"!=typeof o.toolbarHandlers[a]&&e.proxy(o.toolbarHandlers[a],i)(n,r,s,c),"link"!==a&&"reference-link"!==a&&"image"!==a&&"code-block"!==a&&"preformatted-text"!==a&&"watch"!==a&&"preview"!==a&&"search"!==a&&"fullscreen"!==a&&"info"!==a&&n.focus(),!1):void 0}),this},createDialog:function(i){return e.proxy(t.createDialog,this)(i)},createInfoDialog:function(){var e=this,i=this.editor,o=this.classPrefix,r=['
    ','
    ','

    '+t.title+"v"+t.version+"

    ","

    "+this.lang.description+"

    ",'

    '+t.homePage+'

    ','

    Copyright © 2015 Pandao, The MIT License.

    ',"
    ",'',"
    "].join("\n");i.append(r);var n=this.infoDialog=i.children("."+o+"dialog-info");return n.find("."+o+"dialog-close").bind(t.mouseOrTouch("click","touchend"),function(){e.hideInfoDialog()}),n.css("border",t.isIE8?"1px solid #ddd":"").css("z-index",t.dialogZindex).show(),this.infoDialogPosition(),this},infoDialogPosition:function(){var t=this.infoDialog,i=function(){t.css({top:(e(window).height()-t.height())/2+"px",left:(e(window).width()-t.width())/2+"px"})};return i(),e(window).resize(i),this},showInfoDialog:function(){e("html,body").css("overflow-x","hidden");var i=this.editor,o=this.settings,r=this.infoDialog=i.children("."+this.classPrefix+"dialog-info");return r.length<1&&this.createInfoDialog(),this.lockScreen(!0),this.mask.css({opacity:o.dialogMaskOpacity,backgroundColor:o.dialogMaskBgColor}).show(),r.css("z-index",t.dialogZindex).show(),this.infoDialogPosition(),this},hideInfoDialog:function(){return e("html,body").css("overflow-x",""),this.infoDialog.hide(),this.mask.hide(),this.lockScreen(!1),this},lockScreen:function(e){return t.lockScreen(e),this.resize(),this},recreate:function(){var e=this.editor,t=this.settings;return this.codeMirror.remove(),this.setCodeMirror(),t.readOnly||(e.find(".editormd-dialog").length>0&&e.find(".editormd-dialog").remove(),t.toolbar&&(this.getToolbarHandles(),this.setToolbar())),this.loadedDisplay(!0),this},previewCodeHighlight:function(){var e=this.settings,t=this.previewContainer;return e.previewCodeHighlight&&(t.find("pre").addClass("prettyprint linenums"),"undefined"!=typeof prettyPrint&&prettyPrint()),this},katexRender:function(){return null===i?this:(this.previewContainer.find("."+t.classNames.tex).each(function(){var i=e(this);t.$katex.render(i.text(),i[0]),i.find(".katex").css("font-size","1.6em")}),this)},flowChartAndSequenceDiagramRender:function(){var i=this,r=this.settings,n=this.previewContainer;if(t.isIE8)return this;if(r.flowChart){if(null===o)return this;n.find(".flowchart").flowChart()}r.sequenceDiagram&&n.find(".sequence-diagram").sequenceDiagram({theme:"simple"});var a=i.preview,s=i.codeMirror,l=s.find(".CodeMirror-scroll"),c=l.height(),h=l.scrollTop(),d=h/l[0].scrollHeight,u=0;a.find(".markdown-toc-list").each(function(){u+=e(this).height()});var f=a.find(".editormd-toc-menu").height();return f=f?f:0,a.scrollTop(0===h?0:h+c>=l[0].scrollHeight-16?a[0].scrollHeight:(a[0].scrollHeight+u+f)*d),this},registerKeyMaps:function(i){var o=this,r=this.cm,n=this.settings,a=t.toolbarHandlers,s=n.disabledKeyMaps;if(i=i||null){for(var l in i)if(e.inArray(l,s)<0){var c={};c[l]=i[l],r.addKeyMap(i)}}else{for(var h in t.keyMaps){var d=t.keyMaps[h],u="string"==typeof d?e.proxy(a[d],o):e.proxy(d,o);if(e.inArray(h,["F9","F10","F11"])<0&&e.inArray(h,s)<0){var f={};f[h]=u,r.addKeyMap(f)}}e(window).keydown(function(t){var i={120:"F9",121:"F10",122:"F11"};if(e.inArray(i[t.keyCode],s)<0)switch(t.keyCode){case 120:return e.proxy(a.watch,o)(),!1;case 121:return e.proxy(a.preview,o)(),!1;case 122:return e.proxy(a.fullscreen,o)(),!1}})}return this},bindScrollEvent:function(){var i=this,o=this.preview,r=this.settings,n=this.codeMirror,a=t.mouseOrTouch;if(!r.syncScrolling)return this;var s=function(){n.find(".CodeMirror-scroll").bind(a("scroll","touchmove"),function(t){var n=e(this).height(),a=e(this).scrollTop(),s=a/e(this)[0].scrollHeight,l=0;o.find(".markdown-toc-list").each(function(){l+=e(this).height()});var c=o.find(".editormd-toc-menu").height();c=c?c:0,o.scrollTop(0===a?0:a+n>=e(this)[0].scrollHeight-16?o[0].scrollHeight:(o[0].scrollHeight+l+c)*s),e.proxy(r.onscroll,i)(t)})},l=function(){n.find(".CodeMirror-scroll").unbind(a("scroll","touchmove"))},c=function(){o.bind(a("scroll","touchmove"),function(t){var o=e(this).height(),a=e(this).scrollTop(),s=a/e(this)[0].scrollHeight,l=n.find(".CodeMirror-scroll");l.scrollTop(0===a?0:a+o>=e(this)[0].scrollHeight?l[0].scrollHeight:l[0].scrollHeight*s),e.proxy(r.onpreviewscroll,i)(t)})},h=function(){o.unbind(a("scroll","touchmove"))};return n.bind({mouseover:s,mouseout:l,touchstart:s,touchend:l}),"single"===r.syncScrolling?this:(o.bind({mouseover:c,mouseout:h,touchstart:c,touchend:h}),this)},bindChangeEvent:function(){var e=this,t=this.cm,o=this.settings;return o.syncScrolling?(t.on("change",function(t,r){o.watch&&e.previewContainer.css("padding",o.autoHeight?"20px 20px 50px 40px":"20px"),i=setTimeout(function(){clearTimeout(i),e.save(),i=null},o.delay)}),this):this},loadedDisplay:function(t){t=t||!1;var i=this,o=this.editor,r=this.preview,n=this.settings;return this.containerMask.hide(),this.save(),n.watch&&r.show(),o.data("oldWidth",o.width()).data("oldHeight",o.height()),this.resize(),this.registerKeyMaps(),e(window).resize(function(){i.resize()}),this.bindScrollEvent().bindChangeEvent(),t||e.proxy(n.onload,this)(),this.state.loaded=!0,this},width:function(e){return this.editor.css("width","number"==typeof e?e+"px":e),this.resize(),this},height:function(e){return this.editor.css("height","number"==typeof e?e+"px":e),this.resize(),this},resize:function(t,i){t=t||null,i=i||null;var o=this.state,r=this.editor,n=this.preview,a=this.toolbar,s=this.settings,l=this.codeMirror;if(t&&r.css("width","number"==typeof t?t+"px":t),!s.autoHeight||o.fullscreen||o.preview?(i&&r.css("height","number"==typeof i?i+"px":i),o.fullscreen&&r.height(e(window).height()),s.toolbar&&!s.readOnly?l.css("margin-top",a.height()+1).height(r.height()-a.height()):l.css("margin-top",0).height(r.height())):(r.css("height","auto"),l.css("height","auto")),s.watch)if(l.width(r.width()/2),n.width(o.preview?r.width():r.width()/2),this.previewContainer.css("padding",s.autoHeight?"20px 20px 50px 40px":"20px"),s.toolbar&&!s.readOnly?n.css("top",a.height()+1):n.css("top",0),!s.autoHeight||o.fullscreen||o.preview){var c=s.toolbar&&!s.readOnly?r.height()-a.height():r.height();n.height(c)}else n.height("");else l.width(r.width()),n.hide();return o.loaded&&e.proxy(s.onresize,this)(),this},save:function(){if(null===i)return this;var r=this,n=this.state,a=this.settings,s=this.cm,l=s.getValue(),c=this.previewContainer;if("gfm"!==a.mode&&"markdown"!==a.mode)return this.markdownTextarea.val(l),this;var h=t.$marked,d=this.markdownToC=[],u=this.markedRendererOptions={toc:a.toc,tocm:a.tocm,tocStartLevel:a.tocStartLevel,pageBreak:a.pageBreak,taskList:a.taskList,emoji:a.emoji,tex:a.tex,atLink:a.atLink,emailLink:a.emailLink,flowChart:a.flowChart,sequenceDiagram:a.sequenceDiagram,previewCodeHighlight:a.previewCodeHighlight},f=this.markedOptions={renderer:t.markedRenderer(d,u),gfm:!0,tables:!0,breaks:!0,pedantic:!1,sanitize:a.htmlDecode?!1:!0,smartLists:!0,smartypants:!0};h.setOptions(f);var g=t.$marked(l,f);if(g=t.filterHTMLTags(g,a.htmlDecode),this.markdownTextarea.text(l),s.save(),a.saveHTMLToTextarea&&this.htmlTextarea.text(g),a.watch||!a.watch&&n.preview){if(c.html(g),this.previewCodeHighlight(),a.toc){var p=""===a.tocContainer?c:e(a.tocContainer),m=p.find("."+this.classPrefix+"toc-menu");p.attr("previewContainer",""===a.tocContainer?"true":"false"),""!==a.tocContainer&&m.length>0&&m.remove(),t.markdownToCRenderer(d,p,a.tocDropdown,a.tocStartLevel),(a.tocDropdown||p.find("."+this.classPrefix+"toc-menu").length>0)&&t.tocDropdownMenu(p,""!==a.tocTitle?a.tocTitle:this.lang.tocTitle),""!==a.tocContainer&&c.find(".markdown-toc").css("border","none")}a.tex&&(!t.kaTeXLoaded&&a.autoLoadModules?t.loadKaTeX(function(){t.$katex=katex,t.kaTeXLoaded=!0,r.katexRender()}):(t.$katex=katex,this.katexRender())),(a.flowChart||a.sequenceDiagram)&&(o=setTimeout(function(){clearTimeout(o),r.flowChartAndSequenceDiagramRender(),o=null},10)),n.loaded&&e.proxy(a.onchange,this)()}return this},focus:function(){return this.cm.focus(),this},setCursor:function(e){return this.cm.setCursor(e),this},getCursor:function(){return this.cm.getCursor()},setSelection:function(e,t){return this.cm.setSelection(e,t),this},getSelection:function(){return this.cm.getSelection()},setSelections:function(e){return this.cm.setSelections(e),this},getSelections:function(){return this.cm.getSelections()},replaceSelection:function(e){return this.cm.replaceSelection(e),this},insertValue:function(e){return this.replaceSelection(e),this},appendMarkdown:function(e){var t=(this.settings,this.cm);return t.setValue(t.getValue()+e),this},setMarkdown:function(e){return this.cm.setValue(e||this.settings.markdown),this},getMarkdown:function(){return this.cm.getValue()},getValue:function(){return this.cm.getValue()},setValue:function(e){return this.cm.setValue(e),this},clear:function(){return this.cm.setValue(""),this},getHTML:function(){return this.settings.saveHTMLToTextarea?this.htmlTextarea.val():(alert("Error: settings.saveHTMLToTextarea == false"),!1)},getTextareaSavedHTML:function(){return this.getHTML()},getPreviewedHTML:function(){return this.settings.watch?this.previewContainer.html():(alert("Error: settings.watch == false"),!1)},watch:function(t){var o=this.settings;if(e.inArray(o.mode,["gfm","markdown"])<0)return this;if(this.state.watching=o.watch=!0,this.preview.show(),this.toolbar){var r=o.toolbarIconsClass.watch,n=o.toolbarIconsClass.unwatch,a=this.toolbar.find(".fa[name=watch]");a.parent().attr("title",o.lang.toolbar.watch),a.removeClass(n).addClass(r)}return this.codeMirror.css("border-right","1px solid #ddd").width(this.editor.width()/2),i=0,this.save().resize(),o.onwatch||(o.onwatch=t||function(){}),e.proxy(o.onwatch,this)(),this},unwatch:function(t){var i=this.settings;if(this.state.watching=i.watch=!1,this.preview.hide(),this.toolbar){var o=i.toolbarIconsClass.watch,r=i.toolbarIconsClass.unwatch,n=this.toolbar.find(".fa[name=watch]");n.parent().attr("title",i.lang.toolbar.unwatch),n.removeClass(o).addClass(r)}return this.codeMirror.css("border-right","none").width(this.editor.width()),this.resize(),i.onunwatch||(i.onunwatch=t||function(){}),e.proxy(i.onunwatch,this)(),this},show:function(t){t=t||function(){};var i=this;return this.editor.show(0,function(){e.proxy(t,i)()}),this},hide:function(t){t=t||function(){};var i=this;return this.editor.hide(0,function(){e.proxy(t,i)()}),this},previewing:function(){var i=this,o=this.editor,r=this.preview,n=this.toolbar,a=this.settings,s=this.codeMirror,l=this.previewContainer;if(e.inArray(a.mode,["gfm","markdown"])<0)return this;a.toolbar&&n&&(n.toggle(),n.find(".fa[name=preview]").toggleClass("active")),s.toggle();var c=function(e){e.shiftKey&&27===e.keyCode&&i.previewed()};"none"===s.css("display")?(this.state.preview=!0,this.state.fullscreen&&r.css("background","#fff"),o.find("."+this.classPrefix+"preview-close-btn").show().bind(t.mouseOrTouch("click","touchend"),function(){i.previewed()}),a.watch?l.css("padding",""):this.save(),l.addClass(this.classPrefix+"preview-active"),r.show().css({position:"",top:0,width:o.width(),height:a.autoHeight&&!this.state.fullscreen?"auto":o.height()}),this.state.loaded&&e.proxy(a.onpreviewing,this)(),e(window).bind("keyup",c)):(e(window).unbind("keyup",c),this.previewed())},previewed:function(){var i=this.editor,o=this.preview,r=this.toolbar,n=this.settings,a=this.previewContainer,s=i.find("."+this.classPrefix+"preview-close-btn");return this.state.preview=!1,this.codeMirror.show(),n.toolbar&&r.show(),o[n.watch?"show":"hide"](),s.hide().unbind(t.mouseOrTouch("click","touchend")),a.removeClass(this.classPrefix+"preview-active"),n.watch&&a.css("padding","20px"),o.css({background:null,position:"absolute",width:i.width()/2,height:n.autoHeight&&!this.state.fullscreen?"auto":i.height()-r.height(),top:n.toolbar?r.height():0}),this.state.loaded&&e.proxy(n.onpreviewed,this)(),this},fullscreen:function(){var t=this,i=this.state,o=this.editor,r=(this.preview,this.toolbar),n=this.settings,a=this.classPrefix+"fullscreen";r&&r.find(".fa[name=fullscreen]").parent().toggleClass("active");var s=function(e){e.shiftKey||27!==e.keyCode||i.fullscreen&&t.fullscreenExit()};return o.hasClass(a)?(e(window).unbind("keyup",s),this.fullscreenExit()):(i.fullscreen=!0,e("html,body").css("overflow","hidden"),o.css({width:e(window).width(),height:e(window).height()}).addClass(a),this.resize(),e.proxy(n.onfullscreen,this)(),e(window).bind("keyup",s)),this},fullscreenExit:function(){var t=this.editor,i=this.settings,o=this.toolbar,r=this.classPrefix+"fullscreen";return this.state.fullscreen=!1,o&&o.find(".fa[name=fullscreen]").parent().removeClass("active"),e("html,body").css("overflow",""),t.css({width:t.data("oldWidth"),height:t.data("oldHeight")}).removeClass(r),this.resize(),e.proxy(i.onfullscreenExit,this)(),this},executePlugin:function(i,o){var r=this,n=this.cm,a=this.settings;return o=a.pluginPath+o,"function"==typeof define?"undefined"==typeof this[i]?(alert("Error: "+i+" plugin is not found, you are not load this plugin."),this):(this[i](n),this):(e.inArray(o,t.loadFiles.plugin)<0?t.loadPlugin(o,function(){t.loadPlugins[i]=r[i],r[i](n)}):e.proxy(t.loadPlugins[i],this)(n),this)},search:function(e){var t=this.settings;return t.searchReplace?(t.readOnly||this.cm.execCommand(e||"find"),this):(alert("Error: settings.searchReplace == false"),this)},searchReplace:function(){return this.search("replace"),this},searchReplaceAll:function(){return this.search("replaceAll"),this}},t.fn.init.prototype=t.fn,t.dialogLockScreen=function(){var t=this.settings||{dialogLockScreen:!0};t.dialogLockScreen&&(e("html,body").css("overflow","hidden"),this.resize())},t.dialogShowMask=function(t){var i=this.editor,o=this.settings||{dialogShowMask:!0};t.css({top:(e(window).height()-t.height())/2+"px",left:(e(window).width()-t.width())/2+"px"}),o.dialogShowMask&&i.children("."+this.classPrefix+"mask").css("z-index",parseInt(t.css("z-index"))-1).show()},t.toolbarHandlers={undo:function(){this.cm.undo()},redo:function(){this.cm.redo()},bold:function(){var e=this.cm,t=e.getCursor(),i=e.getSelection();e.replaceSelection("**"+i+"**"),""===i&&e.setCursor(t.line,t.ch+2)},del:function(){var e=this.cm,t=e.getCursor(),i=e.getSelection();e.replaceSelection("~~"+i+"~~"),""===i&&e.setCursor(t.line,t.ch+2)},italic:function(){var e=this.cm,t=e.getCursor(),i=e.getSelection();e.replaceSelection("*"+i+"*"),""===i&&e.setCursor(t.line,t.ch+1)},quote:function(){var e=this.cm,t=e.getCursor(),i=e.getSelection();0!==t.ch?(e.setCursor(t.line,0),e.replaceSelection("> "+i),e.setCursor(t.line,t.ch+2)):e.replaceSelection("> "+i)},ucfirst:function(){var e=this.cm,i=e.getSelection(),o=e.listSelections();e.replaceSelection(t.firstUpperCase(i)),e.setSelections(o)},ucwords:function(){var e=this.cm,i=e.getSelection(),o=e.listSelections();e.replaceSelection(t.wordsFirstUpperCase(i)),e.setSelections(o)},uppercase:function(){var e=this.cm,t=e.getSelection(),i=e.listSelections();e.replaceSelection(t.toUpperCase()),e.setSelections(i)},lowercase:function(){var e=this.cm,t=(e.getCursor(),e.getSelection()),i=e.listSelections();e.replaceSelection(t.toLowerCase()),e.setSelections(i)},h1:function(){var e=this.cm,t=e.getCursor(),i=e.getSelection();0!==t.ch?(e.setCursor(t.line,0),e.replaceSelection("# "+i),e.setCursor(t.line,t.ch+2)):e.replaceSelection("# "+i)},h2:function(){var e=this.cm,t=e.getCursor(),i=e.getSelection();0!==t.ch?(e.setCursor(t.line,0), -e.replaceSelection("## "+i),e.setCursor(t.line,t.ch+3)):e.replaceSelection("## "+i)},h3:function(){var e=this.cm,t=e.getCursor(),i=e.getSelection();0!==t.ch?(e.setCursor(t.line,0),e.replaceSelection("### "+i),e.setCursor(t.line,t.ch+4)):e.replaceSelection("### "+i)},h4:function(){var e=this.cm,t=e.getCursor(),i=e.getSelection();0!==t.ch?(e.setCursor(t.line,0),e.replaceSelection("#### "+i),e.setCursor(t.line,t.ch+5)):e.replaceSelection("#### "+i)},h5:function(){var e=this.cm,t=e.getCursor(),i=e.getSelection();0!==t.ch?(e.setCursor(t.line,0),e.replaceSelection("##### "+i),e.setCursor(t.line,t.ch+6)):e.replaceSelection("##### "+i)},h6:function(){var e=this.cm,t=e.getCursor(),i=e.getSelection();0!==t.ch?(e.setCursor(t.line,0),e.replaceSelection("###### "+i),e.setCursor(t.line,t.ch+7)):e.replaceSelection("###### "+i)},"list-ul":function(){var e=this.cm,t=(e.getCursor(),e.getSelection());if(""===t)e.replaceSelection("- "+t);else{for(var i=t.split("\n"),o=0,r=i.length;r>o;o++)i[o]=""===i[o]?"":"- "+i[o];e.replaceSelection(i.join("\n"))}},"list-ol":function(){var e=this.cm,t=(e.getCursor(),e.getSelection());if(""===t)e.replaceSelection("1. "+t);else{for(var i=t.split("\n"),o=0,r=i.length;r>o;o++)i[o]=""===i[o]?"":o+1+". "+i[o];e.replaceSelection(i.join("\n"))}},hr:function(){{var e=this.cm,t=e.getCursor();e.getSelection()}e.replaceSelection((0!==t.ch?"\n\n":"\n")+"------------\n\n")},tex:function(){if(!this.settings.tex)return alert("settings.tex === false"),this;var e=this.cm,t=e.getCursor(),i=e.getSelection();e.replaceSelection("$$"+i+"$$"),""===i&&e.setCursor(t.line,t.ch+2)},link:function(){this.executePlugin("linkDialog","link-dialog/link-dialog")},"reference-link":function(){this.executePlugin("referenceLinkDialog","reference-link-dialog/reference-link-dialog")},pagebreak:function(){if(!this.settings.pageBreak)return alert("settings.pageBreak === false"),this;{var e=this.cm;e.getSelection()}e.replaceSelection("\r\n[========]\r\n")},image:function(){this.executePlugin("imageDialog","image-dialog/image-dialog")},code:function(){var e=this.cm,t=e.getCursor(),i=e.getSelection();e.replaceSelection("`"+i+"`"),""===i&&e.setCursor(t.line,t.ch+1)},"code-block":function(){this.executePlugin("codeBlockDialog","code-block-dialog/code-block-dialog")},"preformatted-text":function(){this.executePlugin("preformattedTextDialog","preformatted-text-dialog/preformatted-text-dialog")},table:function(){this.executePlugin("tableDialog","table-dialog/table-dialog")},datetime:function(){var e=this.cm,i=(e.getSelection(),new Date,this.settings.lang.name),o=t.dateFormat()+" "+t.dateFormat("zh-cn"===i||"zh-tw"===i?"cn-week-day":"week-day");e.replaceSelection(o)},emoji:function(){this.executePlugin("emojiDialog","emoji-dialog/emoji-dialog")},"html-entities":function(){this.executePlugin("htmlEntitiesDialog","html-entities-dialog/html-entities-dialog")},"goto-line":function(){this.executePlugin("gotoLineDialog","goto-line-dialog/goto-line-dialog")},watch:function(){this[this.settings.watch?"unwatch":"watch"]()},preview:function(){this.previewing()},fullscreen:function(){this.fullscreen()},clear:function(){this.clear()},search:function(){this.search()},help:function(){this.executePlugin("helpDialog","help-dialog/help-dialog")},info:function(){this.showInfoDialog()}},t.keyMaps={"Ctrl-1":"h1","Ctrl-2":"h2","Ctrl-3":"h3","Ctrl-4":"h4","Ctrl-5":"h5","Ctrl-6":"h6","Ctrl-B":"bold","Ctrl-D":"datetime","Ctrl-E":function(){var e=this.cm,t=e.getCursor(),i=e.getSelection();return this.settings.emoji?(e.replaceSelection(":"+i+":"),void(""===i&&e.setCursor(t.line,t.ch+1))):void alert("Error: settings.emoji == false")},"Ctrl-Alt-G":"goto-line","Ctrl-H":"hr","Ctrl-I":"italic","Ctrl-K":"code","Ctrl-L":function(){var e=this.cm,t=e.getCursor(),i=e.getSelection(),o=""===i?"":' "'+i+'"';e.replaceSelection("["+i+"]("+o+")"),""===i&&e.setCursor(t.line,t.ch+1)},"Ctrl-U":"list-ul","Shift-Ctrl-A":function(){var e=this.cm,t=e.getCursor(),i=e.getSelection();return this.settings.atLink?(e.replaceSelection("@"+i),void(""===i&&e.setCursor(t.line,t.ch+1))):void alert("Error: settings.atLink == false")},"Shift-Ctrl-C":"code","Shift-Ctrl-Q":"quote","Shift-Ctrl-S":"del","Shift-Ctrl-K":"tex","Shift-Alt-C":function(){var e=this.cm,t=e.getCursor(),i=e.getSelection();e.replaceSelection(["```",i,"```"].join("\n")),""===i&&e.setCursor(t.line,t.ch+3)},"Shift-Ctrl-Alt-C":"code-block","Shift-Ctrl-H":"html-entities","Shift-Alt-H":"help","Shift-Ctrl-E":"emoji","Shift-Ctrl-U":"uppercase","Shift-Alt-U":"ucwords","Shift-Ctrl-Alt-U":"ucfirst","Shift-Alt-L":"lowercase","Shift-Ctrl-I":function(){var e=this.cm,t=e.getCursor(),i=e.getSelection(),o=""===i?"":' "'+i+'"';e.replaceSelection("!["+i+"]("+o+")"),""===i&&e.setCursor(t.line,t.ch+4)},"Shift-Ctrl-Alt-I":"image","Shift-Ctrl-L":"link","Shift-Ctrl-O":"list-ol","Shift-Ctrl-P":"preformatted-text","Shift-Ctrl-T":"table","Shift-Alt-P":"pagebreak",F9:"watch",F10:"preview",F11:"fullscreen"};var r=function(e){return String.prototype.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};t.trim=r;var n=function(e){return e.toLowerCase().replace(/\b(\w)|\s(\w)/g,function(e){return e.toUpperCase()})};t.ucwords=t.wordsFirstUpperCase=n;var a=function(e){return e.toLowerCase().replace(/\b(\w)/,function(e){return e.toUpperCase()})};return t.firstUpperCase=t.ucfirst=a,t.urls={atLinkBase:"https://github.com/"},t.regexs={atLink:/@(\w+)/g,email:/(\w+)@(\w+)\.(\w+)\.?(\w+)?/g,emailLink:/(mailto:)?([\w\.\_]+)@(\w+)\.(\w+)\.?(\w+)?/g,emoji:/:([\w\+-]+):/g,emojiDatetime:/(\d{2}:\d{2}:\d{2})/g,twemoji:/:(tw-([\w]+)-?(\w+)?):/g,fontAwesome:/:(fa-([\w]+)(-(\w+)){0,}):/g,editormdLogo:/:(editormd-logo-?(\w+)?):/g,pageBreak:/^\[[=]{8,}\]$/},t.emoji={path:"http://www.emoji-cheat-sheet.com/graphics/emojis/",ext:".png"},t.twemoji={path:"http://twemoji.maxcdn.com/36x36/",ext:".png"},t.markedRenderer=function(i,o){var n={toc:!0,tocm:!1,tocStartLevel:1,pageBreak:!0,atLink:!0,emailLink:!0,taskList:!1,emoji:!1,tex:!1,flowChart:!1,sequenceDiagram:!1},a=e.extend(n,o||{}),s=t.$marked,l=new s.Renderer;i=i||[];var c=t.regexs,h=c.atLink,d=c.emoji,u=c.email,f=c.emailLink,g=c.twemoji,p=c.fontAwesome,m=c.editormdLogo,w=c.pageBreak;return l.emoji=function(e){e=e.replace(t.regexs.emojiDatetime,function(e){return e.replace(/:/g,":")});var i=e.match(d);if(!i||!a.emoji)return e;for(var o=0,r=i.length;r>o;o++)":+1:"===i[o]&&(i[o]=":\\+1:"),e=e.replace(new RegExp(i[o]),function(e,i){var o=e.match(p),r=e.replace(/:/g,"");if(o)for(var n=0,a=o.length;a>n;n++){var s=o[n].replace(/:/g,"");return''}else{var l=e.match(m),c=e.match(g);if(l)for(var h=0,d=l.length;d>h;h++){var u=l[h].replace(/:/g,"");return''}else{if(!c){var f="+1"===r?"plus1":r;return f="black_large_square"===f?"black_square":f,f="moon"===f?"waxing_gibbous_moon":f,':'+r+':'}for(var w=0,v=c.length;v>w;w++){var k=c[w].replace(/:/g,"").replace("tw-","");return'twemoji-'+k+''}}}});return e},l.atLink=function(i){return h.test(i)?(a.atLink&&(i=i.replace(u,function(e,t,i,o){return e.replace(/@/g,"_#_@_#_")}),i=i.replace(h,function(e,i){return''+e+""}).replace(/_#_@_#_/g,"@")),a.emailLink&&(i=i.replace(f,function(t,i,o,r,n){return!i&&e.inArray(n,"jpg|jpeg|png|gif|webp|ico|icon|pdf".split("|"))<0?''+t+"":t})),i):i},l.link=function(e,t,i){if(this.options.sanitize){try{var o=decodeURIComponent(unescape(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(r){return""}if(0===o.indexOf("javascript:"))return""}var n=''+i.replace(/@/g,"@")+""):(t&&(n+=' title="'+t+'"'),n+=">"+i+"")},l.heading=function(e,t,o){var n=e,a=/\s*\]*)\>(.*)\<\/a\>\s*/;if(a.test(e)){var s=[];e=e.split(/\]+)\>([^\>]*)\<\/a\>/);for(var l=0,c=e.length;c>l;l++)s.push(e[l].replace(/\s*href\=\"(.*)\"\s*/g,""));e=s.join(" ")}e=r(e);var h=e.toLowerCase().replace(/[^\w]+/g,"-"),d={text:e,level:t,slug:h},u=/^[\u4e00-\u9fa5]+$/.test(e),f=u?escape(e).replace(/\%/g,""):e.toLowerCase().replace(/[^\w]+/g,"-");i.push(d);var g="';return g+='',g+='',g+=this.atLink(a?this.emoji(n):this.emoji(e)),g+=""},l.pageBreak=function(e){return w.test(e)&&a.pageBreak&&(e='
    '),e},l.paragraph=function(e){var i=/\$\$(.*)\$\$/g.test(e),o=/^\$\$(.*)\$\$$/.test(e),r=o?' class="'+t.classNames.tex+'"':"",n=a.tocm?/^(\[TOC\]|\[TOCM\])$/.test(e):/^\[TOC\]$/.test(e),s=/^\[TOCM\]$/.test(e);e=!o&&i?e.replace(/(\$\$([^\$]*)\$\$)+/g,function(e,i){return''+i.replace(/\$/g,"")+""}):o?e.replace(/\$/g,""):e;var l='
    '+e+"
    ";return n?s?'
    '+l+"

    ":l:w.test(e)?this.pageBreak(e):""+this.atLink(this.emoji(e))+"

    \n"},l.code=function(e,i,o){return"seq"===i||"sequence"===i?'
    '+e+"
    ":"flow"===i?'
    '+e+"
    ":"math"===i||"latex"===i||"katex"===i?'

    '+e+"

    ":s.Renderer.prototype.code.apply(this,arguments)},l.tablecell=function(e,t){var i=t.header?"th":"td",o=t.align?"<"+i+' style="text-align:'+t.align+'">':"<"+i+">";return o+this.atLink(this.emoji(e))+"\n"},l.listitem=function(e){return a.taskList&&/^\s*\[[x\s]\]\s*/.test(e)?(e=e.replace(/^\s*\[\s\]\s*/,' ').replace(/^\s*\[x\]\s*/,' '),'
  • '+this.atLink(this.emoji(e))+"
  • "):"
  • "+this.atLink(this.emoji(e))+"
  • "},l},t.markdownToCRenderer=function(e,t,i,o){var r="",n=0,a=this.classPrefix;o=o||1;for(var s=0,l=e.length;l>s;s++){var c=e[s].text,h=e[s].level;o>h||(r+=h>n?"":n>h?new Array(n-h+2).join(""):"",r+='
  • '+c+"
      ",n=h)}var d=t.find(".markdown-toc");if(d.length<1&&"false"===t.attr("previewContainer")){var u='
      ';u=i?'
      '+u+"
      ":u,t.html(u),d=t.find(".markdown-toc")}return i&&d.wrap('

      '),d.html('
        ').children(".markdown-toc-list").html(r.replace(/\r?\n?\\<\/ul\>/g,"")),d},t.tocDropdownMenu=function(t,i){i=i||"Table of Contents";var o=400,r=t.find("."+this.classPrefix+"toc-menu");return r.each(function(){var t=e(this),r=t.children(".markdown-toc"),n='',a=''+n+i+"",s=r.children("ul"),l=s.find("li");r.append(a),l.first().before("
      • "+i+" "+n+"

      • "),t.mouseover(function(){s.show(),l.each(function(){var t=e(this),i=t.children("ul");if(""===i.html()&&i.remove(),i.length>0&&""!==i.html()){var r=t.children("a").first();r.children(".fa").length<1&&r.append(e(n).css({"float":"right",paddingTop:"4px"}))}t.mouseover(function(){i.css("z-index",o).show(),o+=1}).mouseleave(function(){i.hide()})})}).mouseleave(function(){s.hide()})}),r},t.filterHTMLTags=function(t,i){if("string"!=typeof t&&(t=new String(t)),"string"!=typeof i)return t;for(var o=i.split("|"),r=o[0].split(","),n=o[1],a=0,s=r.length;s>a;a++){var l=r[a];t=t.replace(new RegExp("]*)>([^>]*)","igm"),"")}if("undefined"!=typeof n){var c=/\<(\w+)\s*([^\>]*)\>([^\>]*)\<\/(\w+)\>/gi;t="*"===n?t.replace(c,function(e,t,i,o,r){return"<"+t+">"+o+""}):"on*"===n?t.replace(c,function(t,i,o,r,n){var a=e("<"+i+">"+r+""),s=e(t)[0].attributes,l={};e.each(s,function(e,t){'"'!==t.nodeName&&(l[t.nodeName]=t.nodeValue)}),e.each(l,function(e){0===e.indexOf("on")&&delete l[e]}),a.attr(l);var c="undefined"!=typeof a[1]?e(a[1]).text():"";return a[0].outerHTML+c}):t.replace(c,function(t,i,o,r){var a=n.split(","),s=e(t);return s.html(r),e.each(a,function(e){s.attr(a[e],null)}),s[0].outerHTML})}return t},t.markdownToHTML=function(i,o){var r={gfm:!0,toc:!0,tocm:!1,tocStartLevel:1,tocTitle:"目录",tocDropdown:!1,tocContainer:"",markdown:"",markdownSourceCode:!1,htmlDecode:!1,autoLoadKaTeX:!0,pageBreak:!0,atLink:!0,emailLink:!0,tex:!1,taskList:!1,emoji:!1,flowChart:!1,sequenceDiagram:!1,previewCodeHighlight:!0};t.$marked=marked;var n=e("#"+i),a=n.settings=e.extend(!0,r,o||{}),s=n.find("textarea");s.length<1&&(n.append(""),s=n.find("textarea"));var l=""===a.markdown?s.val():a.markdown,c=[],h={toc:a.toc,tocm:a.tocm,tocStartLevel:a.tocStartLevel,taskList:a.taskList,emoji:a.emoji,tex:a.tex,pageBreak:a.pageBreak,atLink:a.atLink,emailLink:a.emailLink,flowChart:a.flowChart,sequenceDiagram:a.sequenceDiagram,previewCodeHighlight:a.previewCodeHighlight},d={renderer:t.markedRenderer(c,h),gfm:a.gfm,tables:!0,breaks:!0,pedantic:!1,sanitize:a.htmlDecode?!1:!0,smartLists:!0,smartypants:!0};l=new String(l);var u=marked(l,d);u=t.filterHTMLTags(u,a.htmlDecode),a.markdownSourceCode?s.text(l):s.remove(),n.addClass("markdown-body "+this.classPrefix+"html-preview").append(u);var f=""!==a.tocContainer?e(a.tocContainer):n;if(""!==a.tocContainer&&f.attr("previewContainer",!1),a.toc&&(n.tocContainer=this.markdownToCRenderer(c,f,a.tocDropdown,a.tocStartLevel),(a.tocDropdown||n.find("."+this.classPrefix+"toc-menu").length>0)&&this.tocDropdownMenu(n,a.tocTitle),""!==a.tocContainer&&n.find(".editormd-toc-menu, .editormd-markdown-toc").remove()),a.previewCodeHighlight&&(n.find("pre").addClass("prettyprint linenums"),prettyPrint()),t.isIE8||(a.flowChart&&n.find(".flowchart").flowChart(),a.sequenceDiagram&&n.find(".sequence-diagram").sequenceDiagram({theme:"simple"})),a.tex){var g=function(){n.find("."+t.classNames.tex).each(function(){var t=e(this);katex.render(t.html().replace(/</g,"<").replace(/>/g,">"),t[0]),t.find(".katex").css("font-size","1.6em")})};!a.autoLoadKaTeX||t.$katex||t.kaTeXLoaded?g():this.loadKaTeX(function(){t.$katex=katex,t.kaTeXLoaded=!0,g()})}return n.getMarkdown=function(){return s.val()},n},t.themes=["default","dark"],t.previewThemes=["default","dark"],t.editorThemes=["default","3024-day","3024-night","ambiance","ambiance-mobile","base16-dark","base16-light","blackboard","cobalt","eclipse","elegant","erlang-dark","lesser-dark","mbo","mdn-like","midnight","monokai","neat","neo","night","paraiso-dark","paraiso-light","pastel-on-dark","rubyblue","solarized","the-matrix","tomorrow-night-eighties","twilight","vibrant-ink","xq-dark","xq-light"],t.loadPlugins={},t.loadFiles={js:[],css:[],plugin:[]},t.loadPlugin=function(e,i,o){i=i||function(){},this.loadScript(e,function(){t.loadFiles.plugin.push(e),i()},o)},t.loadCSS=function(e,i,o){o=o||"head",i=i||function(){};var r=document.createElement("link");r.type="text/css",r.rel="stylesheet",r.onload=r.onreadystatechange=function(){t.loadFiles.css.push(e),i()},r.href=e+".css","head"===o?document.getElementsByTagName("head")[0].appendChild(r):document.body.appendChild(r)},t.isIE="Microsoft Internet Explorer"==navigator.appName,t.isIE8=t.isIE&&"8."==navigator.appVersion.match(/8./i),t.loadScript=function(e,i,o){o=o||"head",i=i||function(){};var r=null;r=document.createElement("script"),r.id=e.replace(/[\./]+/g,"-"),r.type="text/javascript",r.src=e+".js",t.isIE8?r.onreadystatechange=function(){r.readyState&&("loaded"===r.readyState||"complete"===r.readyState)&&(r.onreadystatechange=null,t.loadFiles.js.push(e),i())}:r.onload=function(){t.loadFiles.js.push(e),i()},"head"===o?document.getElementsByTagName("head")[0].appendChild(r):document.body.appendChild(r)},t.katexURL={css:"//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min",js:"//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min"},t.kaTeXLoaded=!1,t.loadKaTeX=function(e){t.loadCSS(t.katexURL.css,function(){t.loadScript(t.katexURL.js,e||function(){})})},t.lockScreen=function(t){e("html,body").css("overflow",t?"hidden":"")},t.createDialog=function(i){var o={name:"",width:420,height:240,title:"",drag:!0,closed:!0,content:"",mask:!0,maskStyle:{backgroundColor:"#fff",opacity:.1},lockScreen:!0,footer:!0,buttons:!1};i=e.extend(!0,o,i);var r=this,n=this.editor,a=t.classPrefix,s=(new Date).getTime(),l=""===i.name?a+"dialog-"+s:i.name,c=t.mouseOrTouch,h='
        ';""!==i.title&&(h+='
        ",h+=''+i.title+"",h+="
        "),i.closed&&(h+=''),h+='
        '+i.content,(i.footer||"string"==typeof i.footer)&&(h+='"),h+="
        ",h+='
        ',h+='
        ',h+="
        ",n.append(h);var d=n.find("."+l);d.lockScreen=function(t){return i.lockScreen&&(e("html,body").css("overflow",t?"hidden":""),r.resize()),d},d.showMask=function(){return i.mask&&n.find("."+a+"mask").css(i.maskStyle).css("z-index",t.dialogZindex-1).show(),d},d.hideMask=function(){return i.mask&&n.find("."+a+"mask").hide(),d},d.loading=function(e){var t=d.find("."+a+"dialog-mask");return t[e?"show":"hide"](),d},d.lockScreen(!0).showMask(),d.show().css({zIndex:t.dialogZindex,border:t.isIE8?"1px solid #ddd":"",width:"number"==typeof i.width?i.width+"px":i.width,height:"number"==typeof i.height?i.height+"px":i.height});var u=function(){d.css({top:(e(window).height()-d.height())/2+"px",left:(e(window).width()-d.width())/2+"px"})};if(u(),e(window).resize(u),d.children("."+a+"dialog-close").bind(c("click","touchend"),function(){d.hide().lockScreen(!1).hideMask()}),"object"==typeof i.buttons){var f=d.footer=d.find("."+a+"dialog-footer");for(var g in i.buttons){var p=i.buttons[g],m=a+g+"-btn";f.append('"),p[1]=e.proxy(p[1],d),f.children("."+m).bind(c("click","touchend"),p[1])}}if(""!==i.title&&i.drag){var w,v,k=d.children("."+a+"dialog-header");i.mask||k.bind(c("click","touchend"),function(){t.dialogZindex+=2,d.css("z-index",t.dialogZindex)}),k.mousedown(function(e){e=e||window.event,w=e.clientX-parseInt(d[0].style.left),v=e.clientY-parseInt(d[0].style.top),document.onmousemove=y});var b=function(e){e.removeClass(a+"user-unselect").off("selectstart")},x=function(e){e.addClass(a+"user-unselect").on("selectstart",function(e){return!1})},y=function(t){t=t||window.event;var i,o,r=parseInt(d[0].style.left),n=parseInt(d[0].style.top);r>=0?r+d.width()<=e(window).width()?i=t.clientX-w:(i=e(window).width()-d.width(),document.onmousemove=null):(i=0,document.onmousemove=null),n>=0?o=t.clientY-v:(o=0,document.onmousemove=null),document.onselectstart=function(){return!1},x(e("body")),x(d),d[0].style.left=i+"px",d[0].style.top=o+"px"};document.onmouseup=function(){b(e("body")),b(d),document.onselectstart=null,document.onmousemove=null},k.touchDraggable=function(){var t=null,i=function(i){var o=i.originalEvent,r=e(this).parent().position();t={x:o.changedTouches[0].pageX-r.left,y:o.changedTouches[0].pageY-r.top}},o=function(i){i.preventDefault();var o=i.originalEvent;e(this).parent().css({top:o.changedTouches[0].pageY-t.y,left:o.changedTouches[0].pageX-t.x})};this.bind("touchstart",i).bind("touchmove",o)},k.touchDraggable()}return t.dialogZindex+=2,d},t.mouseOrTouch=function(e,t){e=e||"click",t=t||"touchend";var i=e;try{document.createEvent("TouchEvent"),i=t}catch(o){}return i},t.dateFormat=function(e){e=e||"";var t=function(e){return 10>e?"0"+e:e},i=new Date,o=i.getFullYear(),r=o.toString().slice(2,4),n=t(i.getMonth()+1),a=t(i.getDate()),s=i.getDay(),l=t(i.getHours()),c=t(i.getMinutes()),h=t(i.getSeconds()),d=t(i.getMilliseconds()),u="",f=r+"-"+n+"-"+a,g=o+"-"+n+"-"+a,p=l+":"+c+":"+h;switch(e){case"UNIX Time":u=i.getTime();break;case"UTC":u=i.toUTCString();break;case"yy":u=r;break;case"year":case"yyyy":u=o;break;case"month":case"mm":u=n;break;case"cn-week-day":case"cn-wd":var m=["日","一","二","三","四","五","六"];u="星期"+m[s];break;case"week-day":case"wd":var w=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];u=w[s];break;case"day":case"dd":u=a;break;case"hour":case"hh":u=l;break;case"min":case"ii":u=c;break;case"second":case"ss":u=h;break;case"ms":u=d;break;case"yy-mm-dd":u=f;break;case"yyyy-mm-dd":u=g;break;case"yyyy-mm-dd h:i:s ms":case"full + ms":u=g+" "+p+" "+d;break;case"full":case"yyyy-mm-dd h:i:s":default:u=g+" "+p}return u},t}}); \ No newline at end of file diff --git a/src/main/resources/static/editor.md-master/fonts/FontAwesome.otf b/src/main/resources/static/editor.md-master/fonts/FontAwesome.otf deleted file mode 100644 index f7936cc..0000000 Binary files a/src/main/resources/static/editor.md-master/fonts/FontAwesome.otf and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/fonts/editormd-logo.eot b/src/main/resources/static/editor.md-master/fonts/editormd-logo.eot deleted file mode 100644 index 6f378fd..0000000 Binary files a/src/main/resources/static/editor.md-master/fonts/editormd-logo.eot and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/fonts/editormd-logo.svg b/src/main/resources/static/editor.md-master/fonts/editormd-logo.svg deleted file mode 100644 index cce729b..0000000 --- a/src/main/resources/static/editor.md-master/fonts/editormd-logo.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - -Generated by IcoMoon - - - - - - - \ No newline at end of file diff --git a/src/main/resources/static/editor.md-master/fonts/editormd-logo.ttf b/src/main/resources/static/editor.md-master/fonts/editormd-logo.ttf deleted file mode 100644 index 659c1b3..0000000 Binary files a/src/main/resources/static/editor.md-master/fonts/editormd-logo.ttf and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/fonts/editormd-logo.woff b/src/main/resources/static/editor.md-master/fonts/editormd-logo.woff deleted file mode 100644 index 384ee49..0000000 Binary files a/src/main/resources/static/editor.md-master/fonts/editormd-logo.woff and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/fonts/fontawesome-webfont.eot b/src/main/resources/static/editor.md-master/fonts/fontawesome-webfont.eot deleted file mode 100644 index 33b2bb8..0000000 Binary files a/src/main/resources/static/editor.md-master/fonts/fontawesome-webfont.eot and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/fonts/fontawesome-webfont.svg b/src/main/resources/static/editor.md-master/fonts/fontawesome-webfont.svg deleted file mode 100644 index 1ee89d4..0000000 --- a/src/main/resources/static/editor.md-master/fonts/fontawesome-webfont.svg +++ /dev/null @@ -1,565 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/static/editor.md-master/fonts/fontawesome-webfont.ttf b/src/main/resources/static/editor.md-master/fonts/fontawesome-webfont.ttf deleted file mode 100644 index ed9372f..0000000 Binary files a/src/main/resources/static/editor.md-master/fonts/fontawesome-webfont.ttf and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/fonts/fontawesome-webfont.woff b/src/main/resources/static/editor.md-master/fonts/fontawesome-webfont.woff deleted file mode 100644 index 8b280b9..0000000 Binary files a/src/main/resources/static/editor.md-master/fonts/fontawesome-webfont.woff and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/fonts/fontawesome-webfont.woff2 b/src/main/resources/static/editor.md-master/fonts/fontawesome-webfont.woff2 deleted file mode 100644 index 3311d58..0000000 Binary files a/src/main/resources/static/editor.md-master/fonts/fontawesome-webfont.woff2 and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/images/loading.gif b/src/main/resources/static/editor.md-master/images/loading.gif deleted file mode 100644 index 3aa9c85..0000000 Binary files a/src/main/resources/static/editor.md-master/images/loading.gif and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/images/loading@2x.gif b/src/main/resources/static/editor.md-master/images/loading@2x.gif deleted file mode 100644 index bcc021e..0000000 Binary files a/src/main/resources/static/editor.md-master/images/loading@2x.gif and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/images/loading@3x.gif b/src/main/resources/static/editor.md-master/images/loading@3x.gif deleted file mode 100644 index 216aa5a..0000000 Binary files a/src/main/resources/static/editor.md-master/images/loading@3x.gif and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/images/logos/editormd-favicon-16x16.ico b/src/main/resources/static/editor.md-master/images/logos/editormd-favicon-16x16.ico deleted file mode 100644 index 1dfecec..0000000 Binary files a/src/main/resources/static/editor.md-master/images/logos/editormd-favicon-16x16.ico and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/images/logos/editormd-favicon-24x24.ico b/src/main/resources/static/editor.md-master/images/logos/editormd-favicon-24x24.ico deleted file mode 100644 index 2dc884d..0000000 Binary files a/src/main/resources/static/editor.md-master/images/logos/editormd-favicon-24x24.ico and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/images/logos/editormd-favicon-32x32.ico b/src/main/resources/static/editor.md-master/images/logos/editormd-favicon-32x32.ico deleted file mode 100644 index 986b10f..0000000 Binary files a/src/main/resources/static/editor.md-master/images/logos/editormd-favicon-32x32.ico and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/images/logos/editormd-favicon-48x48.ico b/src/main/resources/static/editor.md-master/images/logos/editormd-favicon-48x48.ico deleted file mode 100644 index 023cdef..0000000 Binary files a/src/main/resources/static/editor.md-master/images/logos/editormd-favicon-48x48.ico and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/images/logos/editormd-favicon-64x64.ico b/src/main/resources/static/editor.md-master/images/logos/editormd-favicon-64x64.ico deleted file mode 100644 index b114b82..0000000 Binary files a/src/main/resources/static/editor.md-master/images/logos/editormd-favicon-64x64.ico and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/images/logos/editormd-logo-114x114.png b/src/main/resources/static/editor.md-master/images/logos/editormd-logo-114x114.png deleted file mode 100644 index 0e1a745..0000000 Binary files a/src/main/resources/static/editor.md-master/images/logos/editormd-logo-114x114.png and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/images/logos/editormd-logo-120x120.png b/src/main/resources/static/editor.md-master/images/logos/editormd-logo-120x120.png deleted file mode 100644 index b8bfa39..0000000 Binary files a/src/main/resources/static/editor.md-master/images/logos/editormd-logo-120x120.png and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/images/logos/editormd-logo-144x144.png b/src/main/resources/static/editor.md-master/images/logos/editormd-logo-144x144.png deleted file mode 100644 index d86bf64..0000000 Binary files a/src/main/resources/static/editor.md-master/images/logos/editormd-logo-144x144.png and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/images/logos/editormd-logo-16x16.png b/src/main/resources/static/editor.md-master/images/logos/editormd-logo-16x16.png deleted file mode 100644 index 867be67..0000000 Binary files a/src/main/resources/static/editor.md-master/images/logos/editormd-logo-16x16.png and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/images/logos/editormd-logo-180x180.png b/src/main/resources/static/editor.md-master/images/logos/editormd-logo-180x180.png deleted file mode 100644 index 207bd3e..0000000 Binary files a/src/main/resources/static/editor.md-master/images/logos/editormd-logo-180x180.png and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/images/logos/editormd-logo-240x240.png b/src/main/resources/static/editor.md-master/images/logos/editormd-logo-240x240.png deleted file mode 100644 index 119d5b9..0000000 Binary files a/src/main/resources/static/editor.md-master/images/logos/editormd-logo-240x240.png and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/images/logos/editormd-logo-24x24.png b/src/main/resources/static/editor.md-master/images/logos/editormd-logo-24x24.png deleted file mode 100644 index 5014194..0000000 Binary files a/src/main/resources/static/editor.md-master/images/logos/editormd-logo-24x24.png and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/images/logos/editormd-logo-320x320.png b/src/main/resources/static/editor.md-master/images/logos/editormd-logo-320x320.png deleted file mode 100644 index 00bc3cc..0000000 Binary files a/src/main/resources/static/editor.md-master/images/logos/editormd-logo-320x320.png and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/images/logos/editormd-logo-32x32.png b/src/main/resources/static/editor.md-master/images/logos/editormd-logo-32x32.png deleted file mode 100644 index c1614f9..0000000 Binary files a/src/main/resources/static/editor.md-master/images/logos/editormd-logo-32x32.png and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/images/logos/editormd-logo-48x48.png b/src/main/resources/static/editor.md-master/images/logos/editormd-logo-48x48.png deleted file mode 100644 index 8c7f6c0..0000000 Binary files a/src/main/resources/static/editor.md-master/images/logos/editormd-logo-48x48.png and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/images/logos/editormd-logo-57x57.png b/src/main/resources/static/editor.md-master/images/logos/editormd-logo-57x57.png deleted file mode 100644 index cd43a0b..0000000 Binary files a/src/main/resources/static/editor.md-master/images/logos/editormd-logo-57x57.png and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/images/logos/editormd-logo-64x64.png b/src/main/resources/static/editor.md-master/images/logos/editormd-logo-64x64.png deleted file mode 100644 index 9445db3..0000000 Binary files a/src/main/resources/static/editor.md-master/images/logos/editormd-logo-64x64.png and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/images/logos/editormd-logo-72x72.png b/src/main/resources/static/editor.md-master/images/logos/editormd-logo-72x72.png deleted file mode 100644 index d7e172a..0000000 Binary files a/src/main/resources/static/editor.md-master/images/logos/editormd-logo-72x72.png and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/images/logos/editormd-logo-96x96.png b/src/main/resources/static/editor.md-master/images/logos/editormd-logo-96x96.png deleted file mode 100644 index 0bc7e41..0000000 Binary files a/src/main/resources/static/editor.md-master/images/logos/editormd-logo-96x96.png and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/images/logos/vi.png b/src/main/resources/static/editor.md-master/images/logos/vi.png deleted file mode 100644 index 796a522..0000000 Binary files a/src/main/resources/static/editor.md-master/images/logos/vi.png and /dev/null differ diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/AUTHORS b/src/main/resources/static/editor.md-master/lib/codemirror/AUTHORS deleted file mode 100644 index 9d62d48..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/AUTHORS +++ /dev/null @@ -1,436 +0,0 @@ -List of CodeMirror contributors. Updated before every release. - -4r2r -Aaron Brooks -Abdelouahab -Abe Fettig -Adam Ahmed -Adam King -adanlobato -Adán Lobato -Adrian Aichner -aeroson -Ahmad Amireh -Ahmad M. Zawawi -ahoward -Akeksandr Motsjonov -Alberto González Palomo -Alberto Pose -Albert Xing -Alexander Pavlov -Alexander Schepanovski -Alexander Shvets -Alexander Solovyov -Alexandre Bique -alexey-k -Alex Piggott -Aliaksei Chapyzhenka -Amsul -amuntean -Amy -Ananya Sen -anaran -AndersMad -Anders Nawroth -Anderson Mesquita -Andrea G -Andreas Reischuck -Andre von Houck -Andrey Fedorov -Andrey Klyuchnikov -Andrey Lushnikov -Andy Joslin -Andy Kimball -Andy Li -angelozerr -angelo.zerr@gmail.com -Ankit -Ankit Ahuja -Ansel Santosa -Anthony Grimes -Anton Kovalyov -areos -as3boyan -AtomicPages LLC -Atul Bhouraskar -Aurelian Oancea -Bastian Müller -Bem Jones-Bey -benbro -Beni Cherniavsky-Paskin -Benjamin DeCoste -Ben Keen -Bernhard Sirlinger -Bert Chang -Billy Moon -binny -B Krishna Chaitanya -Blaine G -blukat29 -boomyjee -borawjm -Brandon Frohs -Brandon Wamboldt -Brett Zamir -Brian Grinstead -Brian Sletten -Bruce Mitchener -Chandra Sekhar Pydi -Charles Skelton -Cheah Chu Yeow -Chris Coyier -Chris Granger -Chris Houseknecht -Chris Morgan -Christian Oyarzun -Christian Petrov -Christopher Brown -ciaranj -CodeAnimal -ComFreek -Curtis Gagliardi -dagsta -daines -Dale Jung -Dan Bentley -Dan Heberden -Daniel, Dao Quang Minh -Daniele Di Sarli -Daniel Faust -Daniel Huigens -Daniel KJ -Daniel Neel -Daniel Parnell -Danny Yoo -darealshinji -Darius Roberts -Dave Myers -David Mignot -David Pathakjee -David Vázquez -deebugger -Deep Thought -Devon Carew -dignifiedquire -Dimage Sapelkin -Dmitry Kiselyov -domagoj412 -Dominator008 -Domizio Demichelis -Doug Wikle -Drew Bratcher -Drew Hintz -Drew Khoury -Dror BG -duralog -eborden -edsharp -ekhaled -Enam Mijbah Noor -Eric Allam -eustas -Fabien O'Carroll -Fabio Zendhi Nagao -Faiza Alsaied -Fauntleroy -fbuchinger -feizhang365 -Felipe Lalanne -Felix Raab -Filip Noetzel -flack -ForbesLindesay -Forbes Lindesay -Ford_Lawnmower -Forrest Oliphant -Frank Wiegand -Gabriel Gheorghian -Gabriel Horner -Gabriel Nahmias -galambalazs -Gautam Mehta -gekkoe -Gerard Braad -Gergely Hegykozi -Giovanni Calò -Glenn Jorde -Glenn Ruehle -Golevka -Gordon Smith -Grant Skinner -greengiant -Gregory Koberger -Guillaume Massé -Guillaume Massé -Gustavo Rodrigues -Hakan Tunc -Hans Engel -Hardest -Hasan Karahan -Herculano Campos -Hiroyuki Makino -hitsthings -Hocdoc -Ian Beck -Ian Dickinson -Ian Wehrman -Ian Wetherbee -Ice White -ICHIKAWA, Yuji -ilvalle -Ingo Richter -Irakli Gozalishvili -Ivan Kurnosov -Jacob Lee -Jakob Miland -Jakub Vrana -Jakub Vrána -James Campos -James Thorne -Jamie Hill -Jan Jongboom -jankeromnes -Jan Keromnes -Jan Odvarko -Jan T. Sott -Jared Forsyth -Jason -Jason Barnabe -Jason Grout -Jason Johnston -Jason San Jose -Jason Siefken -Jaydeep Solanki -Jean Boussier -jeffkenton -Jeff Pickhardt -jem (graphite) -Jeremy Parmenter -Jochen Berger -Johan Ask -John Connor -John Lees-Miller -John Snelson -John Van Der Loo -Jonathan Malmaud -jongalloway -Jon Malmaud -Jon Sangster -Joost-Wim Boekesteijn -Joseph Pecoraro -Joshua Newman -Josh Watzman -jots -jsoojeon -Juan Benavides Romero -Jucovschi Constantin -Juho Vuori -Justin Hileman -jwallers@gmail.com -kaniga -Ken Newman -Ken Rockot -Kevin Sawicki -Kevin Ushey -Klaus Silveira -Koh Zi Han, Cliff -komakino -Konstantin Lopuhin -koops -ks-ifware -kubelsmieci -KwanEsq -Lanfei -Lanny -Laszlo Vidacs -leaf corcoran -Leonid Khachaturov -Leon Sorokin -Leonya Khachaturov -Liam Newman -LM -lochel -Lorenzo Stoakes -Luciano Longo -Luke Stagner -lynschinzer -Maksim Lin -Maksym Taran -Malay Majithia -Manuel Rego Casasnovas -Marat Dreizin -Marcel Gerber -Marco Aurélio -Marco Munizaga -Marcus Bointon -Marek Rudnicki -Marijn Haverbeke -Mário Gonçalves -Mario Pietsch -Mark Lentczner -Marko Bonaci -Martin Balek -Martín Gaitán -Martin Hasoň -Mason Malone -Mateusz Paprocki -Mathias Bynens -mats cronqvist -Matthew Beale -Matthias Bussonnier -Matthias BUSSONNIER -Matt McDonald -Matt Pass -Matt Sacks -mauricio -Maximilian Hils -Maxim Kraev -Max Kirsch -Max Xiantu -mbarkhau -Metatheos -Micah Dubinko -Michael Lehenbauer -Michael Zhou -Mighty Guava -Miguel Castillo -mihailik -Mike -Mike Brevoort -Mike Diaz -Mike Ivanov -Mike Kadin -MinRK -Miraculix87 -misfo -mloginov -Moritz Schwörer -mps -mtaran-google -Narciso Jaramillo -Nathan Williams -ndr -nerbert -nextrevision -ngn -nguillaumin -Ng Zhi An -Nicholas Bollweg -Nicholas Bollweg (Nick) -Nick Small -Niels van Groningen -nightwing -Nikita Beloglazov -Nikita Vasilyev -Nikolay Kostov -nilp0inter -Nisarg Jhaveri -nlwillia -Norman Rzepka -pablo -Page -Panupong Pasupat -paris -Patil Arpith -Patrick Stoica -Patrick Strawderman -Paul Garvin -Paul Ivanov -Pavel Feldman -Pavel Strashkin -Paweł Bartkiewicz -peteguhl -Peter Flynn -peterkroon -Peter Kroon -prasanthj -Prasanth J -Radek Piórkowski -Rahul -Randall Mason -Randy Burden -Randy Edmunds -Rasmus Erik Voel Jensen -Ray Ratchup -Richard van der Meer -Richard Z.H. Wang -Robert Crossfield -Roberto Abdelkader Martínez Pérez -robertop23 -Robert Plummer -Ruslan Osmanov -Ryan Prior -sabaca -Samuel Ainsworth -sandeepshetty -Sander AKA Redsandro -santec -Sascha Peilicke -satchmorun -sathyamoorthi -SCLINIC\jdecker -Scott Aikin -Scott Goodhew -Sebastian Zaha -shaund -shaun gilchrist -Shawn A -sheopory -Shiv Deepak -Shmuel Englard -Shubham Jain -silverwind -snasa -soliton4 -sonson -spastorelli -srajanpaliwal -Stanislav Oaserele -Stas Kobzar -Stefan Borsje -Steffen Beyer -Steve O'Hara -stoskov -Taha Jahangir -Takuji Shimokawa -Tarmil -tel -tfjgeorge -Thaddee Tyl -TheHowl -think -Thomas Dvornik -Thomas Schmid -Tim Alby -Tim Baumann -Timothy Farrell -Timothy Hatcher -TobiasBg -Tomas-A -Tomas Varaneckas -Tom Erik Støwer -Tom MacWright -Tony Jian -Travis Heppe -Triangle717 -twifkak -Vestimir Markov -vf -Vincent Woo -Volker Mische -wenli -Wesley Wiser -Will Binns-Smith -William Jamieson -William Stein -Willy -Wojtek Ptak -Xavier Mendez -Yassin N. Hassan -YNH Webdev -Yunchi Luo -Yuvi Panda -Zachary Dremann -Zhang Hao -zziuni -魏鹏刚 diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/LICENSE b/src/main/resources/static/editor.md-master/lib/codemirror/LICENSE deleted file mode 100644 index d21bbea..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2014 by Marijn Haverbeke and others - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/README.md b/src/main/resources/static/editor.md-master/lib/codemirror/README.md deleted file mode 100644 index bc6e7f5..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# CodeMirror -[![Build Status](https://travis-ci.org/codemirror/CodeMirror.svg)](https://travis-ci.org/codemirror/CodeMirror) -[![NPM version](https://img.shields.io/npm/v/codemirror.svg)](https://www.npmjs.org/package/codemirror) -[Funding status: ![maintainer happiness](https://marijnhaverbeke.nl/fund/status_s.png)](https://marijnhaverbeke.nl/fund/) - -CodeMirror is a JavaScript component that provides a code editor in -the browser. When a mode is available for the language you are coding -in, it will color your code, and optionally help with indentation. - -The project page is http://codemirror.net -The manual is at http://codemirror.net/doc/manual.html -The contributing guidelines are in [CONTRIBUTING.md](https://github.com/codemirror/CodeMirror/blob/master/CONTRIBUTING.md) diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/comment/comment.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/comment/comment.js deleted file mode 100644 index 2dd114d..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/comment/comment.js +++ /dev/null @@ -1,183 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var noOptions = {}; - var nonWS = /[^\s\u00a0]/; - var Pos = CodeMirror.Pos; - - function firstNonWS(str) { - var found = str.search(nonWS); - return found == -1 ? 0 : found; - } - - CodeMirror.commands.toggleComment = function(cm) { - var minLine = Infinity, ranges = cm.listSelections(), mode = null; - for (var i = ranges.length - 1; i >= 0; i--) { - var from = ranges[i].from(), to = ranges[i].to(); - if (from.line >= minLine) continue; - if (to.line >= minLine) to = Pos(minLine, 0); - minLine = from.line; - if (mode == null) { - if (cm.uncomment(from, to)) mode = "un"; - else { cm.lineComment(from, to); mode = "line"; } - } else if (mode == "un") { - cm.uncomment(from, to); - } else { - cm.lineComment(from, to); - } - } - }; - - CodeMirror.defineExtension("lineComment", function(from, to, options) { - if (!options) options = noOptions; - var self = this, mode = self.getModeAt(from); - var commentString = options.lineComment || mode.lineComment; - if (!commentString) { - if (options.blockCommentStart || mode.blockCommentStart) { - options.fullLines = true; - self.blockComment(from, to, options); - } - return; - } - var firstLine = self.getLine(from.line); - if (firstLine == null) return; - var end = Math.min(to.ch != 0 || to.line == from.line ? to.line + 1 : to.line, self.lastLine() + 1); - var pad = options.padding == null ? " " : options.padding; - var blankLines = options.commentBlankLines || from.line == to.line; - - self.operation(function() { - if (options.indent) { - var baseString = firstLine.slice(0, firstNonWS(firstLine)); - for (var i = from.line; i < end; ++i) { - var line = self.getLine(i), cut = baseString.length; - if (!blankLines && !nonWS.test(line)) continue; - if (line.slice(0, cut) != baseString) cut = firstNonWS(line); - self.replaceRange(baseString + commentString + pad, Pos(i, 0), Pos(i, cut)); - } - } else { - for (var i = from.line; i < end; ++i) { - if (blankLines || nonWS.test(self.getLine(i))) - self.replaceRange(commentString + pad, Pos(i, 0)); - } - } - }); - }); - - CodeMirror.defineExtension("blockComment", function(from, to, options) { - if (!options) options = noOptions; - var self = this, mode = self.getModeAt(from); - var startString = options.blockCommentStart || mode.blockCommentStart; - var endString = options.blockCommentEnd || mode.blockCommentEnd; - if (!startString || !endString) { - if ((options.lineComment || mode.lineComment) && options.fullLines != false) - self.lineComment(from, to, options); - return; - } - - var end = Math.min(to.line, self.lastLine()); - if (end != from.line && to.ch == 0 && nonWS.test(self.getLine(end))) --end; - - var pad = options.padding == null ? " " : options.padding; - if (from.line > end) return; - - self.operation(function() { - if (options.fullLines != false) { - var lastLineHasText = nonWS.test(self.getLine(end)); - self.replaceRange(pad + endString, Pos(end)); - self.replaceRange(startString + pad, Pos(from.line, 0)); - var lead = options.blockCommentLead || mode.blockCommentLead; - if (lead != null) for (var i = from.line + 1; i <= end; ++i) - if (i != end || lastLineHasText) - self.replaceRange(lead + pad, Pos(i, 0)); - } else { - self.replaceRange(endString, to); - self.replaceRange(startString, from); - } - }); - }); - - CodeMirror.defineExtension("uncomment", function(from, to, options) { - if (!options) options = noOptions; - var self = this, mode = self.getModeAt(from); - var end = Math.min(to.ch != 0 || to.line == from.line ? to.line : to.line - 1, self.lastLine()), start = Math.min(from.line, end); - - // Try finding line comments - var lineString = options.lineComment || mode.lineComment, lines = []; - var pad = options.padding == null ? " " : options.padding, didSomething; - lineComment: { - if (!lineString) break lineComment; - for (var i = start; i <= end; ++i) { - var line = self.getLine(i); - var found = line.indexOf(lineString); - if (found > -1 && !/comment/.test(self.getTokenTypeAt(Pos(i, found + 1)))) found = -1; - if (found == -1 && (i != end || i == start) && nonWS.test(line)) break lineComment; - if (found > -1 && nonWS.test(line.slice(0, found))) break lineComment; - lines.push(line); - } - self.operation(function() { - for (var i = start; i <= end; ++i) { - var line = lines[i - start]; - var pos = line.indexOf(lineString), endPos = pos + lineString.length; - if (pos < 0) continue; - if (line.slice(endPos, endPos + pad.length) == pad) endPos += pad.length; - didSomething = true; - self.replaceRange("", Pos(i, pos), Pos(i, endPos)); - } - }); - if (didSomething) return true; - } - - // Try block comments - var startString = options.blockCommentStart || mode.blockCommentStart; - var endString = options.blockCommentEnd || mode.blockCommentEnd; - if (!startString || !endString) return false; - var lead = options.blockCommentLead || mode.blockCommentLead; - var startLine = self.getLine(start), endLine = end == start ? startLine : self.getLine(end); - var open = startLine.indexOf(startString), close = endLine.lastIndexOf(endString); - if (close == -1 && start != end) { - endLine = self.getLine(--end); - close = endLine.lastIndexOf(endString); - } - if (open == -1 || close == -1 || - !/comment/.test(self.getTokenTypeAt(Pos(start, open + 1))) || - !/comment/.test(self.getTokenTypeAt(Pos(end, close + 1)))) - return false; - - // Avoid killing block comments completely outside the selection. - // Positions of the last startString before the start of the selection, and the first endString after it. - var lastStart = startLine.lastIndexOf(startString, from.ch); - var firstEnd = lastStart == -1 ? -1 : startLine.slice(0, from.ch).indexOf(endString, lastStart + startString.length); - if (lastStart != -1 && firstEnd != -1 && firstEnd + endString.length != from.ch) return false; - // Positions of the first endString after the end of the selection, and the last startString before it. - firstEnd = endLine.indexOf(endString, to.ch); - var almostLastStart = endLine.slice(to.ch).lastIndexOf(startString, firstEnd - to.ch); - lastStart = (firstEnd == -1 || almostLastStart == -1) ? -1 : to.ch + almostLastStart; - if (firstEnd != -1 && lastStart != -1 && lastStart != to.ch) return false; - - self.operation(function() { - self.replaceRange("", Pos(end, close - (pad && endLine.slice(close - pad.length, close) == pad ? pad.length : 0)), - Pos(end, close + endString.length)); - var openEnd = open + startString.length; - if (pad && startLine.slice(openEnd, openEnd + pad.length) == pad) openEnd += pad.length; - self.replaceRange("", Pos(start, open), Pos(start, openEnd)); - if (lead) for (var i = start + 1; i <= end; ++i) { - var line = self.getLine(i), found = line.indexOf(lead); - if (found == -1 || nonWS.test(line.slice(0, found))) continue; - var foundEnd = found + lead.length; - if (pad && line.slice(foundEnd, foundEnd + pad.length) == pad) foundEnd += pad.length; - self.replaceRange("", Pos(i, found), Pos(i, foundEnd)); - } - }); - return true; - }); -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/comment/continuecomment.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/comment/continuecomment.js deleted file mode 100644 index b11d51e..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/comment/continuecomment.js +++ /dev/null @@ -1,85 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - var modes = ["clike", "css", "javascript"]; - - for (var i = 0; i < modes.length; ++i) - CodeMirror.extendMode(modes[i], {blockCommentContinue: " * "}); - - function continueComment(cm) { - if (cm.getOption("disableInput")) return CodeMirror.Pass; - var ranges = cm.listSelections(), mode, inserts = []; - for (var i = 0; i < ranges.length; i++) { - var pos = ranges[i].head, token = cm.getTokenAt(pos); - if (token.type != "comment") return CodeMirror.Pass; - var modeHere = CodeMirror.innerMode(cm.getMode(), token.state).mode; - if (!mode) mode = modeHere; - else if (mode != modeHere) return CodeMirror.Pass; - - var insert = null; - if (mode.blockCommentStart && mode.blockCommentContinue) { - var end = token.string.indexOf(mode.blockCommentEnd); - var full = cm.getRange(CodeMirror.Pos(pos.line, 0), CodeMirror.Pos(pos.line, token.end)), found; - if (end != -1 && end == token.string.length - mode.blockCommentEnd.length && pos.ch >= end) { - // Comment ended, don't continue it - } else if (token.string.indexOf(mode.blockCommentStart) == 0) { - insert = full.slice(0, token.start); - if (!/^\s*$/.test(insert)) { - insert = ""; - for (var j = 0; j < token.start; ++j) insert += " "; - } - } else if ((found = full.indexOf(mode.blockCommentContinue)) != -1 && - found + mode.blockCommentContinue.length > token.start && - /^\s*$/.test(full.slice(0, found))) { - insert = full.slice(0, found); - } - if (insert != null) insert += mode.blockCommentContinue; - } - if (insert == null && mode.lineComment && continueLineCommentEnabled(cm)) { - var line = cm.getLine(pos.line), found = line.indexOf(mode.lineComment); - if (found > -1) { - insert = line.slice(0, found); - if (/\S/.test(insert)) insert = null; - else insert += mode.lineComment + line.slice(found + mode.lineComment.length).match(/^\s*/)[0]; - } - } - if (insert == null) return CodeMirror.Pass; - inserts[i] = "\n" + insert; - } - - cm.operation(function() { - for (var i = ranges.length - 1; i >= 0; i--) - cm.replaceRange(inserts[i], ranges[i].from(), ranges[i].to(), "+insert"); - }); - } - - function continueLineCommentEnabled(cm) { - var opt = cm.getOption("continueComments"); - if (opt && typeof opt == "object") - return opt.continueLineComment !== false; - return true; - } - - CodeMirror.defineOption("continueComments", null, function(cm, val, prev) { - if (prev && prev != CodeMirror.Init) - cm.removeKeyMap("continueComment"); - if (val) { - var key = "Enter"; - if (typeof val == "string") - key = val; - else if (typeof val == "object" && val.key) - key = val.key; - var map = {name: "continueComment"}; - map[key] = continueComment; - cm.addKeyMap(map); - } - }); -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/dialog/dialog.css b/src/main/resources/static/editor.md-master/lib/codemirror/addon/dialog/dialog.css deleted file mode 100644 index 2e7c0fc..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/dialog/dialog.css +++ /dev/null @@ -1,32 +0,0 @@ -.CodeMirror-dialog { - position: absolute; - left: 0; right: 0; - background: white; - z-index: 15; - padding: .1em .8em; - overflow: hidden; - color: #333; -} - -.CodeMirror-dialog-top { - border-bottom: 1px solid #eee; - top: 0; -} - -.CodeMirror-dialog-bottom { - border-top: 1px solid #eee; - bottom: 0; -} - -.CodeMirror-dialog input { - border: none; - outline: none; - background: transparent; - width: 20em; - color: inherit; - font-family: monospace; -} - -.CodeMirror-dialog button { - font-size: 70%; -} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/dialog/dialog.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/dialog/dialog.js deleted file mode 100644 index e0e8ad4..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/dialog/dialog.js +++ /dev/null @@ -1,155 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Open simple dialogs on top of an editor. Relies on dialog.css. - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - function dialogDiv(cm, template, bottom) { - var wrap = cm.getWrapperElement(); - var dialog; - dialog = wrap.appendChild(document.createElement("div")); - if (bottom) - dialog.className = "CodeMirror-dialog CodeMirror-dialog-bottom"; - else - dialog.className = "CodeMirror-dialog CodeMirror-dialog-top"; - - if (typeof template == "string") { - dialog.innerHTML = template; - } else { // Assuming it's a detached DOM element. - dialog.appendChild(template); - } - return dialog; - } - - function closeNotification(cm, newVal) { - if (cm.state.currentNotificationClose) - cm.state.currentNotificationClose(); - cm.state.currentNotificationClose = newVal; - } - - CodeMirror.defineExtension("openDialog", function(template, callback, options) { - if (!options) options = {}; - - closeNotification(this, null); - - var dialog = dialogDiv(this, template, options.bottom); - var closed = false, me = this; - function close(newVal) { - if (typeof newVal == 'string') { - inp.value = newVal; - } else { - if (closed) return; - closed = true; - dialog.parentNode.removeChild(dialog); - me.focus(); - - if (options.onClose) options.onClose(dialog); - } - } - - var inp = dialog.getElementsByTagName("input")[0], button; - if (inp) { - if (options.value) { - inp.value = options.value; - inp.select(); - } - - if (options.onInput) - CodeMirror.on(inp, "input", function(e) { options.onInput(e, inp.value, close);}); - if (options.onKeyUp) - CodeMirror.on(inp, "keyup", function(e) {options.onKeyUp(e, inp.value, close);}); - - CodeMirror.on(inp, "keydown", function(e) { - if (options && options.onKeyDown && options.onKeyDown(e, inp.value, close)) { return; } - if (e.keyCode == 27 || (options.closeOnEnter !== false && e.keyCode == 13)) { - inp.blur(); - CodeMirror.e_stop(e); - close(); - } - if (e.keyCode == 13) callback(inp.value, e); - }); - - if (options.closeOnBlur !== false) CodeMirror.on(inp, "blur", close); - - inp.focus(); - } else if (button = dialog.getElementsByTagName("button")[0]) { - CodeMirror.on(button, "click", function() { - close(); - me.focus(); - }); - - if (options.closeOnBlur !== false) CodeMirror.on(button, "blur", close); - - button.focus(); - } - return close; - }); - - CodeMirror.defineExtension("openConfirm", function(template, callbacks, options) { - closeNotification(this, null); - var dialog = dialogDiv(this, template, options && options.bottom); - var buttons = dialog.getElementsByTagName("button"); - var closed = false, me = this, blurring = 1; - function close() { - if (closed) return; - closed = true; - dialog.parentNode.removeChild(dialog); - me.focus(); - } - buttons[0].focus(); - for (var i = 0; i < buttons.length; ++i) { - var b = buttons[i]; - (function(callback) { - CodeMirror.on(b, "click", function(e) { - CodeMirror.e_preventDefault(e); - close(); - if (callback) callback(me); - }); - })(callbacks[i]); - CodeMirror.on(b, "blur", function() { - --blurring; - setTimeout(function() { if (blurring <= 0) close(); }, 200); - }); - CodeMirror.on(b, "focus", function() { ++blurring; }); - } - }); - - /* - * openNotification - * Opens a notification, that can be closed with an optional timer - * (default 5000ms timer) and always closes on click. - * - * If a notification is opened while another is opened, it will close the - * currently opened one and open the new one immediately. - */ - CodeMirror.defineExtension("openNotification", function(template, options) { - closeNotification(this, close); - var dialog = dialogDiv(this, template, options && options.bottom); - var closed = false, doneTimer; - var duration = options && typeof options.duration !== "undefined" ? options.duration : 5000; - - function close() { - if (closed) return; - closed = true; - clearTimeout(doneTimer); - dialog.parentNode.removeChild(dialog); - } - - CodeMirror.on(dialog, 'click', function(e) { - CodeMirror.e_preventDefault(e); - close(); - }); - - if (duration) - doneTimer = setTimeout(close, duration); - - return close; - }); -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/display/fullscreen.css b/src/main/resources/static/editor.md-master/lib/codemirror/addon/display/fullscreen.css deleted file mode 100644 index 437acd8..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/display/fullscreen.css +++ /dev/null @@ -1,6 +0,0 @@ -.CodeMirror-fullscreen { - position: fixed; - top: 0; left: 0; right: 0; bottom: 0; - height: auto; - z-index: 9; -} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/display/fullscreen.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/display/fullscreen.js deleted file mode 100644 index cd3673b..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/display/fullscreen.js +++ /dev/null @@ -1,41 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineOption("fullScreen", false, function(cm, val, old) { - if (old == CodeMirror.Init) old = false; - if (!old == !val) return; - if (val) setFullscreen(cm); - else setNormal(cm); - }); - - function setFullscreen(cm) { - var wrap = cm.getWrapperElement(); - cm.state.fullScreenRestore = {scrollTop: window.pageYOffset, scrollLeft: window.pageXOffset, - width: wrap.style.width, height: wrap.style.height}; - wrap.style.width = ""; - wrap.style.height = "auto"; - wrap.className += " CodeMirror-fullscreen"; - document.documentElement.style.overflow = "hidden"; - cm.refresh(); - } - - function setNormal(cm) { - var wrap = cm.getWrapperElement(); - wrap.className = wrap.className.replace(/\s*CodeMirror-fullscreen\b/, ""); - document.documentElement.style.overflow = ""; - var info = cm.state.fullScreenRestore; - wrap.style.width = info.width; wrap.style.height = info.height; - window.scrollTo(info.scrollLeft, info.scrollTop); - cm.refresh(); - } -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/display/panel.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/display/panel.js deleted file mode 100644 index 22c0453..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/display/panel.js +++ /dev/null @@ -1,94 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - CodeMirror.defineExtension("addPanel", function(node, options) { - if (!this.state.panels) initPanels(this); - - var info = this.state.panels; - if (options && options.position == "bottom") - info.wrapper.appendChild(node); - else - info.wrapper.insertBefore(node, info.wrapper.firstChild); - var height = (options && options.height) || node.offsetHeight; - this._setSize(null, info.heightLeft -= height); - info.panels++; - return new Panel(this, node, options, height); - }); - - function Panel(cm, node, options, height) { - this.cm = cm; - this.node = node; - this.options = options; - this.height = height; - this.cleared = false; - } - - Panel.prototype.clear = function() { - if (this.cleared) return; - this.cleared = true; - var info = this.cm.state.panels; - this.cm._setSize(null, info.heightLeft += this.height); - info.wrapper.removeChild(this.node); - if (--info.panels == 0) removePanels(this.cm); - }; - - Panel.prototype.changed = function(height) { - var newHeight = height == null ? this.node.offsetHeight : height; - var info = this.cm.state.panels; - this.cm._setSize(null, info.height += (newHeight - this.height)); - this.height = newHeight; - }; - - function initPanels(cm) { - var wrap = cm.getWrapperElement(); - var style = window.getComputedStyle ? window.getComputedStyle(wrap) : wrap.currentStyle; - var height = parseInt(style.height); - var info = cm.state.panels = { - setHeight: wrap.style.height, - heightLeft: height, - panels: 0, - wrapper: document.createElement("div") - }; - wrap.parentNode.insertBefore(info.wrapper, wrap); - var hasFocus = cm.hasFocus(); - info.wrapper.appendChild(wrap); - if (hasFocus) cm.focus(); - - cm._setSize = cm.setSize; - if (height != null) cm.setSize = function(width, newHeight) { - if (newHeight == null) return this._setSize(width, newHeight); - info.setHeight = newHeight; - if (typeof newHeight != "number") { - var px = /^(\d+\.?\d*)px$/.exec(newHeight); - if (px) { - newHeight = Number(px[1]); - } else { - info.wrapper.style.height = newHeight; - newHeight = info.wrapper.offsetHeight; - info.wrapper.style.height = ""; - } - } - cm._setSize(width, info.heightLeft += (newHeight - height)); - height = newHeight; - }; - } - - function removePanels(cm) { - var info = cm.state.panels; - cm.state.panels = null; - - var wrap = cm.getWrapperElement(); - info.wrapper.parentNode.replaceChild(wrap, info.wrapper); - wrap.style.height = info.setHeight; - cm.setSize = cm._setSize; - cm.setSize(); - } -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/display/placeholder.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/display/placeholder.js deleted file mode 100644 index bb0c393..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/display/placeholder.js +++ /dev/null @@ -1,58 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - CodeMirror.defineOption("placeholder", "", function(cm, val, old) { - var prev = old && old != CodeMirror.Init; - if (val && !prev) { - cm.on("blur", onBlur); - cm.on("change", onChange); - onChange(cm); - } else if (!val && prev) { - cm.off("blur", onBlur); - cm.off("change", onChange); - clearPlaceholder(cm); - var wrapper = cm.getWrapperElement(); - wrapper.className = wrapper.className.replace(" CodeMirror-empty", ""); - } - - if (val && !cm.hasFocus()) onBlur(cm); - }); - - function clearPlaceholder(cm) { - if (cm.state.placeholder) { - cm.state.placeholder.parentNode.removeChild(cm.state.placeholder); - cm.state.placeholder = null; - } - } - function setPlaceholder(cm) { - clearPlaceholder(cm); - var elt = cm.state.placeholder = document.createElement("pre"); - elt.style.cssText = "height: 0; overflow: visible"; - elt.className = "CodeMirror-placeholder"; - elt.appendChild(document.createTextNode(cm.getOption("placeholder"))); - cm.display.lineSpace.insertBefore(elt, cm.display.lineSpace.firstChild); - } - - function onBlur(cm) { - if (isEmpty(cm)) setPlaceholder(cm); - } - function onChange(cm) { - var wrapper = cm.getWrapperElement(), empty = isEmpty(cm); - wrapper.className = wrapper.className.replace(" CodeMirror-empty", "") + (empty ? " CodeMirror-empty" : ""); - - if (empty) setPlaceholder(cm); - else clearPlaceholder(cm); - } - - function isEmpty(cm) { - return (cm.lineCount() === 1) && (cm.getLine(0) === ""); - } -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/display/rulers.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/display/rulers.js deleted file mode 100644 index 13185d3..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/display/rulers.js +++ /dev/null @@ -1,64 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineOption("rulers", false, function(cm, val, old) { - if (old && old != CodeMirror.Init) { - clearRulers(cm); - cm.off("refresh", refreshRulers); - } - if (val && val.length) { - setRulers(cm); - cm.on("refresh", refreshRulers); - } - }); - - function clearRulers(cm) { - for (var i = cm.display.lineSpace.childNodes.length - 1; i >= 0; i--) { - var node = cm.display.lineSpace.childNodes[i]; - if (/(^|\s)CodeMirror-ruler($|\s)/.test(node.className)) - node.parentNode.removeChild(node); - } - } - - function setRulers(cm) { - var val = cm.getOption("rulers"); - var cw = cm.defaultCharWidth(); - var left = cm.charCoords(CodeMirror.Pos(cm.firstLine(), 0), "div").left; - var minH = cm.display.scroller.offsetHeight + 30; - for (var i = 0; i < val.length; i++) { - var elt = document.createElement("div"); - elt.className = "CodeMirror-ruler"; - var col, cls = null, conf = val[i]; - if (typeof conf == "number") { - col = conf; - } else { - col = conf.column; - if (conf.className) elt.className += " " + conf.className; - if (conf.color) elt.style.borderColor = conf.color; - if (conf.lineStyle) elt.style.borderLeftStyle = conf.lineStyle; - if (conf.width) elt.style.borderLeftWidth = conf.width; - cls = val[i].className; - } - elt.style.left = (left + col * cw) + "px"; - elt.style.top = "-50px"; - elt.style.bottom = "-20px"; - elt.style.minHeight = minH + "px"; - cm.display.lineSpace.insertBefore(elt, cm.display.cursorDiv); - } - } - - function refreshRulers(cm) { - clearRulers(cm); - setRulers(cm); - } -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/edit/closebrackets.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/edit/closebrackets.js deleted file mode 100644 index ff4bb3f..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/edit/closebrackets.js +++ /dev/null @@ -1,161 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - var DEFAULT_BRACKETS = "()[]{}''\"\""; - var DEFAULT_TRIPLES = "'\""; - var DEFAULT_EXPLODE_ON_ENTER = "[]{}"; - var SPACE_CHAR_REGEX = /\s/; - - var Pos = CodeMirror.Pos; - - CodeMirror.defineOption("autoCloseBrackets", false, function(cm, val, old) { - if (old != CodeMirror.Init && old) - cm.removeKeyMap("autoCloseBrackets"); - if (!val) return; - var pairs = DEFAULT_BRACKETS, triples = DEFAULT_TRIPLES, explode = DEFAULT_EXPLODE_ON_ENTER; - if (typeof val == "string") pairs = val; - else if (typeof val == "object") { - if (val.pairs != null) pairs = val.pairs; - if (val.triples != null) triples = val.triples; - if (val.explode != null) explode = val.explode; - } - var map = buildKeymap(pairs, triples); - if (explode) map.Enter = buildExplodeHandler(explode); - cm.addKeyMap(map); - }); - - function charsAround(cm, pos) { - var str = cm.getRange(Pos(pos.line, pos.ch - 1), - Pos(pos.line, pos.ch + 1)); - return str.length == 2 ? str : null; - } - - // Project the token type that will exists after the given char is - // typed, and use it to determine whether it would cause the start - // of a string token. - function enteringString(cm, pos, ch) { - var line = cm.getLine(pos.line); - var token = cm.getTokenAt(pos); - if (/\bstring2?\b/.test(token.type)) return false; - var stream = new CodeMirror.StringStream(line.slice(0, pos.ch) + ch + line.slice(pos.ch), 4); - stream.pos = stream.start = token.start; - for (;;) { - var type1 = cm.getMode().token(stream, token.state); - if (stream.pos >= pos.ch + 1) return /\bstring2?\b/.test(type1); - stream.start = stream.pos; - } - } - - function buildKeymap(pairs, triples) { - var map = { - name : "autoCloseBrackets", - Backspace: function(cm) { - if (cm.getOption("disableInput")) return CodeMirror.Pass; - var ranges = cm.listSelections(); - for (var i = 0; i < ranges.length; i++) { - if (!ranges[i].empty()) return CodeMirror.Pass; - var around = charsAround(cm, ranges[i].head); - if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass; - } - for (var i = ranges.length - 1; i >= 0; i--) { - var cur = ranges[i].head; - cm.replaceRange("", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1)); - } - } - }; - var closingBrackets = ""; - for (var i = 0; i < pairs.length; i += 2) (function(left, right) { - closingBrackets += right; - map["'" + left + "'"] = function(cm) { - if (cm.getOption("disableInput")) return CodeMirror.Pass; - var ranges = cm.listSelections(), type, next; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i], cur = range.head, curType; - var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1)); - if (!range.empty()) { - curType = "surround"; - } else if (left == right && next == right) { - if (cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == left + left + left) - curType = "skipThree"; - else - curType = "skip"; - } else if (left == right && cur.ch > 1 && triples.indexOf(left) >= 0 && - cm.getRange(Pos(cur.line, cur.ch - 2), cur) == left + left && - (cur.ch <= 2 || cm.getRange(Pos(cur.line, cur.ch - 3), Pos(cur.line, cur.ch - 2)) != left)) { - curType = "addFour"; - } else if (left == '"' || left == "'") { - if (!CodeMirror.isWordChar(next) && enteringString(cm, cur, left)) curType = "both"; - else return CodeMirror.Pass; - } else if (cm.getLine(cur.line).length == cur.ch || closingBrackets.indexOf(next) >= 0 || SPACE_CHAR_REGEX.test(next)) { - curType = "both"; - } else { - return CodeMirror.Pass; - } - if (!type) type = curType; - else if (type != curType) return CodeMirror.Pass; - } - - cm.operation(function() { - if (type == "skip") { - cm.execCommand("goCharRight"); - } else if (type == "skipThree") { - for (var i = 0; i < 3; i++) - cm.execCommand("goCharRight"); - } else if (type == "surround") { - var sels = cm.getSelections(); - for (var i = 0; i < sels.length; i++) - sels[i] = left + sels[i] + right; - cm.replaceSelections(sels, "around"); - } else if (type == "both") { - cm.replaceSelection(left + right, null); - cm.execCommand("goCharLeft"); - } else if (type == "addFour") { - cm.replaceSelection(left + left + left + left, "before"); - cm.execCommand("goCharRight"); - } - }); - }; - if (left != right) map["'" + right + "'"] = function(cm) { - var ranges = cm.listSelections(); - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - if (!range.empty() || - cm.getRange(range.head, Pos(range.head.line, range.head.ch + 1)) != right) - return CodeMirror.Pass; - } - cm.execCommand("goCharRight"); - }; - })(pairs.charAt(i), pairs.charAt(i + 1)); - return map; - } - - function buildExplodeHandler(pairs) { - return function(cm) { - if (cm.getOption("disableInput")) return CodeMirror.Pass; - var ranges = cm.listSelections(); - for (var i = 0; i < ranges.length; i++) { - if (!ranges[i].empty()) return CodeMirror.Pass; - var around = charsAround(cm, ranges[i].head); - if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass; - } - cm.operation(function() { - cm.replaceSelection("\n\n", null); - cm.execCommand("goCharLeft"); - ranges = cm.listSelections(); - for (var i = 0; i < ranges.length; i++) { - var line = ranges[i].head.line; - cm.indentLine(line, null, true); - cm.indentLine(line + 1, null, true); - } - }); - }; - } -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/edit/closetag.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/edit/closetag.js deleted file mode 100644 index e68d52d..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/edit/closetag.js +++ /dev/null @@ -1,166 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/** - * Tag-closer extension for CodeMirror. - * - * This extension adds an "autoCloseTags" option that can be set to - * either true to get the default behavior, or an object to further - * configure its behavior. - * - * These are supported options: - * - * `whenClosing` (default true) - * Whether to autoclose when the '/' of a closing tag is typed. - * `whenOpening` (default true) - * Whether to autoclose the tag when the final '>' of an opening - * tag is typed. - * `dontCloseTags` (default is empty tags for HTML, none for XML) - * An array of tag names that should not be autoclosed. - * `indentTags` (default is block tags for HTML, none for XML) - * An array of tag names that should, when opened, cause a - * blank line to be added inside the tag, and the blank line and - * closing line to be indented. - * - * See demos/closetag.html for a usage example. - */ - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../fold/xml-fold")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../fold/xml-fold"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - CodeMirror.defineOption("autoCloseTags", false, function(cm, val, old) { - if (old != CodeMirror.Init && old) - cm.removeKeyMap("autoCloseTags"); - if (!val) return; - var map = {name: "autoCloseTags"}; - if (typeof val != "object" || val.whenClosing) - map["'/'"] = function(cm) { return autoCloseSlash(cm); }; - if (typeof val != "object" || val.whenOpening) - map["'>'"] = function(cm) { return autoCloseGT(cm); }; - cm.addKeyMap(map); - }); - - var htmlDontClose = ["area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", - "source", "track", "wbr"]; - var htmlIndent = ["applet", "blockquote", "body", "button", "div", "dl", "fieldset", "form", "frameset", "h1", "h2", "h3", "h4", - "h5", "h6", "head", "html", "iframe", "layer", "legend", "object", "ol", "p", "select", "table", "ul"]; - - function autoCloseGT(cm) { - if (cm.getOption("disableInput")) return CodeMirror.Pass; - var ranges = cm.listSelections(), replacements = []; - for (var i = 0; i < ranges.length; i++) { - if (!ranges[i].empty()) return CodeMirror.Pass; - var pos = ranges[i].head, tok = cm.getTokenAt(pos); - var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state; - if (inner.mode.name != "xml" || !state.tagName) return CodeMirror.Pass; - - var opt = cm.getOption("autoCloseTags"), html = inner.mode.configuration == "html"; - var dontCloseTags = (typeof opt == "object" && opt.dontCloseTags) || (html && htmlDontClose); - var indentTags = (typeof opt == "object" && opt.indentTags) || (html && htmlIndent); - - var tagName = state.tagName; - if (tok.end > pos.ch) tagName = tagName.slice(0, tagName.length - tok.end + pos.ch); - var lowerTagName = tagName.toLowerCase(); - // Don't process the '>' at the end of an end-tag or self-closing tag - if (!tagName || - tok.type == "string" && (tok.end != pos.ch || !/[\"\']/.test(tok.string.charAt(tok.string.length - 1)) || tok.string.length == 1) || - tok.type == "tag" && state.type == "closeTag" || - tok.string.indexOf("/") == (tok.string.length - 1) || // match something like - dontCloseTags && indexOf(dontCloseTags, lowerTagName) > -1 || - closingTagExists(cm, tagName, pos, state, true)) - return CodeMirror.Pass; - - var indent = indentTags && indexOf(indentTags, lowerTagName) > -1; - replacements[i] = {indent: indent, - text: ">" + (indent ? "\n\n" : "") + "", - newPos: indent ? CodeMirror.Pos(pos.line + 1, 0) : CodeMirror.Pos(pos.line, pos.ch + 1)}; - } - - for (var i = ranges.length - 1; i >= 0; i--) { - var info = replacements[i]; - cm.replaceRange(info.text, ranges[i].head, ranges[i].anchor, "+insert"); - var sel = cm.listSelections().slice(0); - sel[i] = {head: info.newPos, anchor: info.newPos}; - cm.setSelections(sel); - if (info.indent) { - cm.indentLine(info.newPos.line, null, true); - cm.indentLine(info.newPos.line + 1, null, true); - } - } - } - - function autoCloseCurrent(cm, typingSlash) { - var ranges = cm.listSelections(), replacements = []; - var head = typingSlash ? "/" : ""; - else if (cm.getMode().name == "htmlmixed" && inner.mode.name == "css") - replacements[i] = head + "style>"; - else - return CodeMirror.Pass; - } else { - if (!state.context || !state.context.tagName || - closingTagExists(cm, state.context.tagName, pos, state)) - return CodeMirror.Pass; - replacements[i] = head + state.context.tagName + ">"; - } - } - cm.replaceSelections(replacements); - ranges = cm.listSelections(); - for (var i = 0; i < ranges.length; i++) - if (i == ranges.length - 1 || ranges[i].head.line < ranges[i + 1].head.line) - cm.indentLine(ranges[i].head.line); - } - - function autoCloseSlash(cm) { - if (cm.getOption("disableInput")) return CodeMirror.Pass; - return autoCloseCurrent(cm, true); - } - - CodeMirror.commands.closeTag = function(cm) { return autoCloseCurrent(cm); }; - - function indexOf(collection, elt) { - if (collection.indexOf) return collection.indexOf(elt); - for (var i = 0, e = collection.length; i < e; ++i) - if (collection[i] == elt) return i; - return -1; - } - - // If xml-fold is loaded, we use its functionality to try and verify - // whether a given tag is actually unclosed. - function closingTagExists(cm, tagName, pos, state, newTag) { - if (!CodeMirror.scanForClosingTag) return false; - var end = Math.min(cm.lastLine() + 1, pos.line + 500); - var nextClose = CodeMirror.scanForClosingTag(cm, pos, null, end); - if (!nextClose || nextClose.tag != tagName) return false; - var cx = state.context; - // If the immediate wrapping context contains onCx instances of - // the same tag, a closing tag only exists if there are at least - // that many closing tags of that type following. - for (var onCx = newTag ? 1 : 0; cx && cx.tagName == tagName; cx = cx.prev) ++onCx; - pos = nextClose.to; - for (var i = 1; i < onCx; i++) { - var next = CodeMirror.scanForClosingTag(cm, pos, null, end); - if (!next || next.tag != tagName) return false; - pos = next.to; - } - return true; - } -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/edit/continuelist.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/edit/continuelist.js deleted file mode 100644 index ca8d267..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/edit/continuelist.js +++ /dev/null @@ -1,51 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var listRE = /^(\s*)(>[> ]*|[*+-]\s|(\d+)\.)(\s*)/, - emptyListRE = /^(\s*)(>[> ]*|[*+-]|(\d+)\.)(\s*)$/, - unorderedListRE = /[*+-]\s/; - - CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) { - if (cm.getOption("disableInput")) return CodeMirror.Pass; - var ranges = cm.listSelections(), replacements = []; - for (var i = 0; i < ranges.length; i++) { - var pos = ranges[i].head, match; - var eolState = cm.getStateAfter(pos.line); - var inList = eolState.list !== false; - var inQuote = eolState.quote !== false; - - if (!ranges[i].empty() || (!inList && !inQuote) || !(match = cm.getLine(pos.line).match(listRE))) { - cm.execCommand("newlineAndIndent"); - return; - } - if (cm.getLine(pos.line).match(emptyListRE)) { - cm.replaceRange("", { - line: pos.line, ch: 0 - }, { - line: pos.line, ch: pos.ch + 1 - }); - replacements[i] = "\n"; - - } else { - var indent = match[1], after = match[4]; - var bullet = unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0 - ? match[2] - : (parseInt(match[3], 10) + 1) + "."; - - replacements[i] = "\n" + indent + bullet + after; - } - } - - cm.replaceSelections(replacements); - }; -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/edit/matchbrackets.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/edit/matchbrackets.js deleted file mode 100644 index 70e1ae1..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/edit/matchbrackets.js +++ /dev/null @@ -1,120 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - var ie_lt8 = /MSIE \d/.test(navigator.userAgent) && - (document.documentMode == null || document.documentMode < 8); - - var Pos = CodeMirror.Pos; - - var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"}; - - function findMatchingBracket(cm, where, strict, config) { - var line = cm.getLineHandle(where.line), pos = where.ch - 1; - var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)]; - if (!match) return null; - var dir = match.charAt(1) == ">" ? 1 : -1; - if (strict && (dir > 0) != (pos == where.ch)) return null; - var style = cm.getTokenTypeAt(Pos(where.line, pos + 1)); - - var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style || null, config); - if (found == null) return null; - return {from: Pos(where.line, pos), to: found && found.pos, - match: found && found.ch == match.charAt(0), forward: dir > 0}; - } - - // bracketRegex is used to specify which type of bracket to scan - // should be a regexp, e.g. /[[\]]/ - // - // Note: If "where" is on an open bracket, then this bracket is ignored. - // - // Returns false when no bracket was found, null when it reached - // maxScanLines and gave up - function scanForBracket(cm, where, dir, style, config) { - var maxScanLen = (config && config.maxScanLineLength) || 10000; - var maxScanLines = (config && config.maxScanLines) || 1000; - - var stack = []; - var re = config && config.bracketRegex ? config.bracketRegex : /[(){}[\]]/; - var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1) - : Math.max(cm.firstLine() - 1, where.line - maxScanLines); - for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) { - var line = cm.getLine(lineNo); - if (!line) continue; - var pos = dir > 0 ? 0 : line.length - 1, end = dir > 0 ? line.length : -1; - if (line.length > maxScanLen) continue; - if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0); - for (; pos != end; pos += dir) { - var ch = line.charAt(pos); - if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) { - var match = matching[ch]; - if ((match.charAt(1) == ">") == (dir > 0)) stack.push(ch); - else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch}; - else stack.pop(); - } - } - } - return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null; - } - - function matchBrackets(cm, autoclear, config) { - // Disable brace matching in long lines, since it'll cause hugely slow updates - var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000; - var marks = [], ranges = cm.listSelections(); - for (var i = 0; i < ranges.length; i++) { - var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, false, config); - if (match && cm.getLine(match.from.line).length <= maxHighlightLen) { - var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket"; - marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style})); - if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen) - marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style})); - } - } - - if (marks.length) { - // Kludge to work around the IE bug from issue #1193, where text - // input stops going to the textare whever this fires. - if (ie_lt8 && cm.state.focused) cm.focus(); - - var clear = function() { - cm.operation(function() { - for (var i = 0; i < marks.length; i++) marks[i].clear(); - }); - }; - if (autoclear) setTimeout(clear, 800); - else return clear; - } - } - - var currentlyHighlighted = null; - function doMatchBrackets(cm) { - cm.operation(function() { - if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;} - currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets); - }); - } - - CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) { - if (old && old != CodeMirror.Init) - cm.off("cursorActivity", doMatchBrackets); - if (val) { - cm.state.matchBrackets = typeof val == "object" ? val : {}; - cm.on("cursorActivity", doMatchBrackets); - } - }); - - CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);}); - CodeMirror.defineExtension("findMatchingBracket", function(pos, strict, config){ - return findMatchingBracket(this, pos, strict, config); - }); - CodeMirror.defineExtension("scanForBracket", function(pos, dir, style, config){ - return scanForBracket(this, pos, dir, style, config); - }); -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/edit/matchtags.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/edit/matchtags.js deleted file mode 100644 index fb1911a..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/edit/matchtags.js +++ /dev/null @@ -1,66 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../fold/xml-fold")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../fold/xml-fold"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineOption("matchTags", false, function(cm, val, old) { - if (old && old != CodeMirror.Init) { - cm.off("cursorActivity", doMatchTags); - cm.off("viewportChange", maybeUpdateMatch); - clear(cm); - } - if (val) { - cm.state.matchBothTags = typeof val == "object" && val.bothTags; - cm.on("cursorActivity", doMatchTags); - cm.on("viewportChange", maybeUpdateMatch); - doMatchTags(cm); - } - }); - - function clear(cm) { - if (cm.state.tagHit) cm.state.tagHit.clear(); - if (cm.state.tagOther) cm.state.tagOther.clear(); - cm.state.tagHit = cm.state.tagOther = null; - } - - function doMatchTags(cm) { - cm.state.failedTagMatch = false; - cm.operation(function() { - clear(cm); - if (cm.somethingSelected()) return; - var cur = cm.getCursor(), range = cm.getViewport(); - range.from = Math.min(range.from, cur.line); range.to = Math.max(cur.line + 1, range.to); - var match = CodeMirror.findMatchingTag(cm, cur, range); - if (!match) return; - if (cm.state.matchBothTags) { - var hit = match.at == "open" ? match.open : match.close; - if (hit) cm.state.tagHit = cm.markText(hit.from, hit.to, {className: "CodeMirror-matchingtag"}); - } - var other = match.at == "close" ? match.open : match.close; - if (other) - cm.state.tagOther = cm.markText(other.from, other.to, {className: "CodeMirror-matchingtag"}); - else - cm.state.failedTagMatch = true; - }); - } - - function maybeUpdateMatch(cm) { - if (cm.state.failedTagMatch) doMatchTags(cm); - } - - CodeMirror.commands.toMatchingTag = function(cm) { - var found = CodeMirror.findMatchingTag(cm, cm.getCursor()); - if (found) { - var other = found.at == "close" ? found.open : found.close; - if (other) cm.extendSelection(other.to, other.from); - } - }; -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/edit/trailingspace.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/edit/trailingspace.js deleted file mode 100644 index fa7b56b..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/edit/trailingspace.js +++ /dev/null @@ -1,27 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - CodeMirror.defineOption("showTrailingSpace", false, function(cm, val, prev) { - if (prev == CodeMirror.Init) prev = false; - if (prev && !val) - cm.removeOverlay("trailingspace"); - else if (!prev && val) - cm.addOverlay({ - token: function(stream) { - for (var l = stream.string.length, i = l; i && /\s/.test(stream.string.charAt(i - 1)); --i) {} - if (i > stream.pos) { stream.pos = i; return null; } - stream.pos = l; - return "trailingspace"; - }, - name: "trailingspace" - }); - }); -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/fold/brace-fold.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/fold/brace-fold.js deleted file mode 100644 index 1605f6c..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/fold/brace-fold.js +++ /dev/null @@ -1,105 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.registerHelper("fold", "brace", function(cm, start) { - var line = start.line, lineText = cm.getLine(line); - var startCh, tokenType; - - function findOpening(openCh) { - for (var at = start.ch, pass = 0;;) { - var found = at <= 0 ? -1 : lineText.lastIndexOf(openCh, at - 1); - if (found == -1) { - if (pass == 1) break; - pass = 1; - at = lineText.length; - continue; - } - if (pass == 1 && found < start.ch) break; - tokenType = cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1)); - if (!/^(comment|string)/.test(tokenType)) return found + 1; - at = found - 1; - } - } - - var startToken = "{", endToken = "}", startCh = findOpening("{"); - if (startCh == null) { - startToken = "[", endToken = "]"; - startCh = findOpening("["); - } - - if (startCh == null) return; - var count = 1, lastLine = cm.lastLine(), end, endCh; - outer: for (var i = line; i <= lastLine; ++i) { - var text = cm.getLine(i), pos = i == line ? startCh : 0; - for (;;) { - var nextOpen = text.indexOf(startToken, pos), nextClose = text.indexOf(endToken, pos); - if (nextOpen < 0) nextOpen = text.length; - if (nextClose < 0) nextClose = text.length; - pos = Math.min(nextOpen, nextClose); - if (pos == text.length) break; - if (cm.getTokenTypeAt(CodeMirror.Pos(i, pos + 1)) == tokenType) { - if (pos == nextOpen) ++count; - else if (!--count) { end = i; endCh = pos; break outer; } - } - ++pos; - } - } - if (end == null || line == end && endCh == startCh) return; - return {from: CodeMirror.Pos(line, startCh), - to: CodeMirror.Pos(end, endCh)}; -}); - -CodeMirror.registerHelper("fold", "import", function(cm, start) { - function hasImport(line) { - if (line < cm.firstLine() || line > cm.lastLine()) return null; - var start = cm.getTokenAt(CodeMirror.Pos(line, 1)); - if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1)); - if (start.type != "keyword" || start.string != "import") return null; - // Now find closing semicolon, return its position - for (var i = line, e = Math.min(cm.lastLine(), line + 10); i <= e; ++i) { - var text = cm.getLine(i), semi = text.indexOf(";"); - if (semi != -1) return {startCh: start.end, end: CodeMirror.Pos(i, semi)}; - } - } - - var start = start.line, has = hasImport(start), prev; - if (!has || hasImport(start - 1) || ((prev = hasImport(start - 2)) && prev.end.line == start - 1)) - return null; - for (var end = has.end;;) { - var next = hasImport(end.line + 1); - if (next == null) break; - end = next.end; - } - return {from: cm.clipPos(CodeMirror.Pos(start, has.startCh + 1)), to: end}; -}); - -CodeMirror.registerHelper("fold", "include", function(cm, start) { - function hasInclude(line) { - if (line < cm.firstLine() || line > cm.lastLine()) return null; - var start = cm.getTokenAt(CodeMirror.Pos(line, 1)); - if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1)); - if (start.type == "meta" && start.string.slice(0, 8) == "#include") return start.start + 8; - } - - var start = start.line, has = hasInclude(start); - if (has == null || hasInclude(start - 1) != null) return null; - for (var end = start;;) { - var next = hasInclude(end + 1); - if (next == null) break; - ++end; - } - return {from: CodeMirror.Pos(start, has + 1), - to: cm.clipPos(CodeMirror.Pos(end))}; -}); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/fold/comment-fold.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/fold/comment-fold.js deleted file mode 100644 index b75db7e..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/fold/comment-fold.js +++ /dev/null @@ -1,57 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.registerGlobalHelper("fold", "comment", function(mode) { - return mode.blockCommentStart && mode.blockCommentEnd; -}, function(cm, start) { - var mode = cm.getModeAt(start), startToken = mode.blockCommentStart, endToken = mode.blockCommentEnd; - if (!startToken || !endToken) return; - var line = start.line, lineText = cm.getLine(line); - - var startCh; - for (var at = start.ch, pass = 0;;) { - var found = at <= 0 ? -1 : lineText.lastIndexOf(startToken, at - 1); - if (found == -1) { - if (pass == 1) return; - pass = 1; - at = lineText.length; - continue; - } - if (pass == 1 && found < start.ch) return; - if (/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1)))) { - startCh = found + startToken.length; - break; - } - at = found - 1; - } - - var depth = 1, lastLine = cm.lastLine(), end, endCh; - outer: for (var i = line; i <= lastLine; ++i) { - var text = cm.getLine(i), pos = i == line ? startCh : 0; - for (;;) { - var nextOpen = text.indexOf(startToken, pos), nextClose = text.indexOf(endToken, pos); - if (nextOpen < 0) nextOpen = text.length; - if (nextClose < 0) nextClose = text.length; - pos = Math.min(nextOpen, nextClose); - if (pos == text.length) break; - if (pos == nextOpen) ++depth; - else if (!--depth) { end = i; endCh = pos; break outer; } - ++pos; - } - } - if (end == null || line == end && endCh == startCh) return; - return {from: CodeMirror.Pos(line, startCh), - to: CodeMirror.Pos(end, endCh)}; -}); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/fold/foldcode.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/fold/foldcode.js deleted file mode 100644 index 62911f9..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/fold/foldcode.js +++ /dev/null @@ -1,149 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - function doFold(cm, pos, options, force) { - if (options && options.call) { - var finder = options; - options = null; - } else { - var finder = getOption(cm, options, "rangeFinder"); - } - if (typeof pos == "number") pos = CodeMirror.Pos(pos, 0); - var minSize = getOption(cm, options, "minFoldSize"); - - function getRange(allowFolded) { - var range = finder(cm, pos); - if (!range || range.to.line - range.from.line < minSize) return null; - var marks = cm.findMarksAt(range.from); - for (var i = 0; i < marks.length; ++i) { - if (marks[i].__isFold && force !== "fold") { - if (!allowFolded) return null; - range.cleared = true; - marks[i].clear(); - } - } - return range; - } - - var range = getRange(true); - if (getOption(cm, options, "scanUp")) while (!range && pos.line > cm.firstLine()) { - pos = CodeMirror.Pos(pos.line - 1, 0); - range = getRange(false); - } - if (!range || range.cleared || force === "unfold") return; - - var myWidget = makeWidget(cm, options); - CodeMirror.on(myWidget, "mousedown", function(e) { - myRange.clear(); - CodeMirror.e_preventDefault(e); - }); - var myRange = cm.markText(range.from, range.to, { - replacedWith: myWidget, - clearOnEnter: true, - __isFold: true - }); - myRange.on("clear", function(from, to) { - CodeMirror.signal(cm, "unfold", cm, from, to); - }); - CodeMirror.signal(cm, "fold", cm, range.from, range.to); - } - - function makeWidget(cm, options) { - var widget = getOption(cm, options, "widget"); - if (typeof widget == "string") { - var text = document.createTextNode(widget); - widget = document.createElement("span"); - widget.appendChild(text); - widget.className = "CodeMirror-foldmarker"; - } - return widget; - } - - // Clumsy backwards-compatible interface - CodeMirror.newFoldFunction = function(rangeFinder, widget) { - return function(cm, pos) { doFold(cm, pos, {rangeFinder: rangeFinder, widget: widget}); }; - }; - - // New-style interface - CodeMirror.defineExtension("foldCode", function(pos, options, force) { - doFold(this, pos, options, force); - }); - - CodeMirror.defineExtension("isFolded", function(pos) { - var marks = this.findMarksAt(pos); - for (var i = 0; i < marks.length; ++i) - if (marks[i].__isFold) return true; - }); - - CodeMirror.commands.toggleFold = function(cm) { - cm.foldCode(cm.getCursor()); - }; - CodeMirror.commands.fold = function(cm) { - cm.foldCode(cm.getCursor(), null, "fold"); - }; - CodeMirror.commands.unfold = function(cm) { - cm.foldCode(cm.getCursor(), null, "unfold"); - }; - CodeMirror.commands.foldAll = function(cm) { - cm.operation(function() { - for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++) - cm.foldCode(CodeMirror.Pos(i, 0), null, "fold"); - }); - }; - CodeMirror.commands.unfoldAll = function(cm) { - cm.operation(function() { - for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++) - cm.foldCode(CodeMirror.Pos(i, 0), null, "unfold"); - }); - }; - - CodeMirror.registerHelper("fold", "combine", function() { - var funcs = Array.prototype.slice.call(arguments, 0); - return function(cm, start) { - for (var i = 0; i < funcs.length; ++i) { - var found = funcs[i](cm, start); - if (found) return found; - } - }; - }); - - CodeMirror.registerHelper("fold", "auto", function(cm, start) { - var helpers = cm.getHelpers(start, "fold"); - for (var i = 0; i < helpers.length; i++) { - var cur = helpers[i](cm, start); - if (cur) return cur; - } - }); - - var defaultOptions = { - rangeFinder: CodeMirror.fold.auto, - widget: "\u2194", - minFoldSize: 0, - scanUp: false - }; - - CodeMirror.defineOption("foldOptions", null); - - function getOption(cm, options, name) { - if (options && options[name] !== undefined) - return options[name]; - var editorOptions = cm.options.foldOptions; - if (editorOptions && editorOptions[name] !== undefined) - return editorOptions[name]; - return defaultOptions[name]; - } - - CodeMirror.defineExtension("foldOption", function(options, name) { - return getOption(this, options, name); - }); -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/fold/foldgutter.css b/src/main/resources/static/editor.md-master/lib/codemirror/addon/fold/foldgutter.css deleted file mode 100644 index ad19ae2..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/fold/foldgutter.css +++ /dev/null @@ -1,20 +0,0 @@ -.CodeMirror-foldmarker { - color: blue; - text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px; - font-family: arial; - line-height: .3; - cursor: pointer; -} -.CodeMirror-foldgutter { - width: .7em; -} -.CodeMirror-foldgutter-open, -.CodeMirror-foldgutter-folded { - cursor: pointer; -} -.CodeMirror-foldgutter-open:after { - content: "\25BE"; -} -.CodeMirror-foldgutter-folded:after { - content: "\25B8"; -} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/fold/foldgutter.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/fold/foldgutter.js deleted file mode 100644 index 199120c..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/fold/foldgutter.js +++ /dev/null @@ -1,144 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("./foldcode")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "./foldcode"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineOption("foldGutter", false, function(cm, val, old) { - if (old && old != CodeMirror.Init) { - cm.clearGutter(cm.state.foldGutter.options.gutter); - cm.state.foldGutter = null; - cm.off("gutterClick", onGutterClick); - cm.off("change", onChange); - cm.off("viewportChange", onViewportChange); - cm.off("fold", onFold); - cm.off("unfold", onFold); - cm.off("swapDoc", updateInViewport); - } - if (val) { - cm.state.foldGutter = new State(parseOptions(val)); - updateInViewport(cm); - cm.on("gutterClick", onGutterClick); - cm.on("change", onChange); - cm.on("viewportChange", onViewportChange); - cm.on("fold", onFold); - cm.on("unfold", onFold); - cm.on("swapDoc", updateInViewport); - } - }); - - var Pos = CodeMirror.Pos; - - function State(options) { - this.options = options; - this.from = this.to = 0; - } - - function parseOptions(opts) { - if (opts === true) opts = {}; - if (opts.gutter == null) opts.gutter = "CodeMirror-foldgutter"; - if (opts.indicatorOpen == null) opts.indicatorOpen = "CodeMirror-foldgutter-open"; - if (opts.indicatorFolded == null) opts.indicatorFolded = "CodeMirror-foldgutter-folded"; - return opts; - } - - function isFolded(cm, line) { - var marks = cm.findMarksAt(Pos(line)); - for (var i = 0; i < marks.length; ++i) - if (marks[i].__isFold && marks[i].find().from.line == line) return true; - } - - function marker(spec) { - if (typeof spec == "string") { - var elt = document.createElement("div"); - elt.className = spec + " CodeMirror-guttermarker-subtle"; - return elt; - } else { - return spec.cloneNode(true); - } - } - - function updateFoldInfo(cm, from, to) { - var opts = cm.state.foldGutter.options, cur = from; - var minSize = cm.foldOption(opts, "minFoldSize"); - var func = cm.foldOption(opts, "rangeFinder"); - cm.eachLine(from, to, function(line) { - var mark = null; - if (isFolded(cm, cur)) { - mark = marker(opts.indicatorFolded); - } else { - var pos = Pos(cur, 0); - var range = func && func(cm, pos); - if (range && range.to.line - range.from.line >= minSize) - mark = marker(opts.indicatorOpen); - } - cm.setGutterMarker(line, opts.gutter, mark); - ++cur; - }); - } - - function updateInViewport(cm) { - var vp = cm.getViewport(), state = cm.state.foldGutter; - if (!state) return; - cm.operation(function() { - updateFoldInfo(cm, vp.from, vp.to); - }); - state.from = vp.from; state.to = vp.to; - } - - function onGutterClick(cm, line, gutter) { - var state = cm.state.foldGutter; - if (!state) return; - var opts = state.options; - if (gutter != opts.gutter) return; - cm.foldCode(Pos(line, 0), opts.rangeFinder); - } - - function onChange(cm) { - var state = cm.state.foldGutter; - if (!state) return; - var opts = state.options; - state.from = state.to = 0; - clearTimeout(state.changeUpdate); - state.changeUpdate = setTimeout(function() { updateInViewport(cm); }, opts.foldOnChangeTimeSpan || 600); - } - - function onViewportChange(cm) { - var state = cm.state.foldGutter; - if (!state) return; - var opts = state.options; - clearTimeout(state.changeUpdate); - state.changeUpdate = setTimeout(function() { - var vp = cm.getViewport(); - if (state.from == state.to || vp.from - state.to > 20 || state.from - vp.to > 20) { - updateInViewport(cm); - } else { - cm.operation(function() { - if (vp.from < state.from) { - updateFoldInfo(cm, vp.from, state.from); - state.from = vp.from; - } - if (vp.to > state.to) { - updateFoldInfo(cm, state.to, vp.to); - state.to = vp.to; - } - }); - } - }, opts.updateViewportTimeSpan || 400); - } - - function onFold(cm, from) { - var state = cm.state.foldGutter; - if (!state) return; - var line = from.line; - if (line >= state.from && line < state.to) - updateFoldInfo(cm, line, line + 1); - } -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/fold/indent-fold.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/fold/indent-fold.js deleted file mode 100644 index e29f15e..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/fold/indent-fold.js +++ /dev/null @@ -1,44 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.registerHelper("fold", "indent", function(cm, start) { - var tabSize = cm.getOption("tabSize"), firstLine = cm.getLine(start.line); - if (!/\S/.test(firstLine)) return; - var getIndent = function(line) { - return CodeMirror.countColumn(line, null, tabSize); - }; - var myIndent = getIndent(firstLine); - var lastLineInFold = null; - // Go through lines until we find a line that definitely doesn't belong in - // the block we're folding, or to the end. - for (var i = start.line + 1, end = cm.lastLine(); i <= end; ++i) { - var curLine = cm.getLine(i); - var curIndent = getIndent(curLine); - if (curIndent > myIndent) { - // Lines with a greater indent are considered part of the block. - lastLineInFold = i; - } else if (!/\S/.test(curLine)) { - // Empty lines might be breaks within the block we're trying to fold. - } else { - // A non-empty line at an indent equal to or less than ours marks the - // start of another block. - break; - } - } - if (lastLineInFold) return { - from: CodeMirror.Pos(start.line, firstLine.length), - to: CodeMirror.Pos(lastLineInFold, cm.getLine(lastLineInFold).length) - }; -}); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/fold/markdown-fold.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/fold/markdown-fold.js deleted file mode 100644 index ce84c94..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/fold/markdown-fold.js +++ /dev/null @@ -1,49 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.registerHelper("fold", "markdown", function(cm, start) { - var maxDepth = 100; - - function isHeader(lineNo) { - var tokentype = cm.getTokenTypeAt(CodeMirror.Pos(lineNo, 0)); - return tokentype && /\bheader\b/.test(tokentype); - } - - function headerLevel(lineNo, line, nextLine) { - var match = line && line.match(/^#+/); - if (match && isHeader(lineNo)) return match[0].length; - match = nextLine && nextLine.match(/^[=\-]+\s*$/); - if (match && isHeader(lineNo + 1)) return nextLine[0] == "=" ? 1 : 2; - return maxDepth; - } - - var firstLine = cm.getLine(start.line), nextLine = cm.getLine(start.line + 1); - var level = headerLevel(start.line, firstLine, nextLine); - if (level === maxDepth) return undefined; - - var lastLineNo = cm.lastLine(); - var end = start.line, nextNextLine = cm.getLine(end + 2); - while (end < lastLineNo) { - if (headerLevel(end + 1, nextLine, nextNextLine) <= level) break; - ++end; - nextLine = nextNextLine; - nextNextLine = cm.getLine(end + 2); - } - - return { - from: CodeMirror.Pos(start.line, firstLine.length), - to: CodeMirror.Pos(end, cm.getLine(end).length) - }; -}); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/fold/xml-fold.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/fold/xml-fold.js deleted file mode 100644 index 504727f..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/fold/xml-fold.js +++ /dev/null @@ -1,182 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var Pos = CodeMirror.Pos; - function cmp(a, b) { return a.line - b.line || a.ch - b.ch; } - - var nameStartChar = "A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"; - var nameChar = nameStartChar + "\-\:\.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; - var xmlTagStart = new RegExp("<(/?)([" + nameStartChar + "][" + nameChar + "]*)", "g"); - - function Iter(cm, line, ch, range) { - this.line = line; this.ch = ch; - this.cm = cm; this.text = cm.getLine(line); - this.min = range ? range.from : cm.firstLine(); - this.max = range ? range.to - 1 : cm.lastLine(); - } - - function tagAt(iter, ch) { - var type = iter.cm.getTokenTypeAt(Pos(iter.line, ch)); - return type && /\btag\b/.test(type); - } - - function nextLine(iter) { - if (iter.line >= iter.max) return; - iter.ch = 0; - iter.text = iter.cm.getLine(++iter.line); - return true; - } - function prevLine(iter) { - if (iter.line <= iter.min) return; - iter.text = iter.cm.getLine(--iter.line); - iter.ch = iter.text.length; - return true; - } - - function toTagEnd(iter) { - for (;;) { - var gt = iter.text.indexOf(">", iter.ch); - if (gt == -1) { if (nextLine(iter)) continue; else return; } - if (!tagAt(iter, gt + 1)) { iter.ch = gt + 1; continue; } - var lastSlash = iter.text.lastIndexOf("/", gt); - var selfClose = lastSlash > -1 && !/\S/.test(iter.text.slice(lastSlash + 1, gt)); - iter.ch = gt + 1; - return selfClose ? "selfClose" : "regular"; - } - } - function toTagStart(iter) { - for (;;) { - var lt = iter.ch ? iter.text.lastIndexOf("<", iter.ch - 1) : -1; - if (lt == -1) { if (prevLine(iter)) continue; else return; } - if (!tagAt(iter, lt + 1)) { iter.ch = lt; continue; } - xmlTagStart.lastIndex = lt; - iter.ch = lt; - var match = xmlTagStart.exec(iter.text); - if (match && match.index == lt) return match; - } - } - - function toNextTag(iter) { - for (;;) { - xmlTagStart.lastIndex = iter.ch; - var found = xmlTagStart.exec(iter.text); - if (!found) { if (nextLine(iter)) continue; else return; } - if (!tagAt(iter, found.index + 1)) { iter.ch = found.index + 1; continue; } - iter.ch = found.index + found[0].length; - return found; - } - } - function toPrevTag(iter) { - for (;;) { - var gt = iter.ch ? iter.text.lastIndexOf(">", iter.ch - 1) : -1; - if (gt == -1) { if (prevLine(iter)) continue; else return; } - if (!tagAt(iter, gt + 1)) { iter.ch = gt; continue; } - var lastSlash = iter.text.lastIndexOf("/", gt); - var selfClose = lastSlash > -1 && !/\S/.test(iter.text.slice(lastSlash + 1, gt)); - iter.ch = gt + 1; - return selfClose ? "selfClose" : "regular"; - } - } - - function findMatchingClose(iter, tag) { - var stack = []; - for (;;) { - var next = toNextTag(iter), end, startLine = iter.line, startCh = iter.ch - (next ? next[0].length : 0); - if (!next || !(end = toTagEnd(iter))) return; - if (end == "selfClose") continue; - if (next[1]) { // closing tag - for (var i = stack.length - 1; i >= 0; --i) if (stack[i] == next[2]) { - stack.length = i; - break; - } - if (i < 0 && (!tag || tag == next[2])) return { - tag: next[2], - from: Pos(startLine, startCh), - to: Pos(iter.line, iter.ch) - }; - } else { // opening tag - stack.push(next[2]); - } - } - } - function findMatchingOpen(iter, tag) { - var stack = []; - for (;;) { - var prev = toPrevTag(iter); - if (!prev) return; - if (prev == "selfClose") { toTagStart(iter); continue; } - var endLine = iter.line, endCh = iter.ch; - var start = toTagStart(iter); - if (!start) return; - if (start[1]) { // closing tag - stack.push(start[2]); - } else { // opening tag - for (var i = stack.length - 1; i >= 0; --i) if (stack[i] == start[2]) { - stack.length = i; - break; - } - if (i < 0 && (!tag || tag == start[2])) return { - tag: start[2], - from: Pos(iter.line, iter.ch), - to: Pos(endLine, endCh) - }; - } - } - } - - CodeMirror.registerHelper("fold", "xml", function(cm, start) { - var iter = new Iter(cm, start.line, 0); - for (;;) { - var openTag = toNextTag(iter), end; - if (!openTag || iter.line != start.line || !(end = toTagEnd(iter))) return; - if (!openTag[1] && end != "selfClose") { - var start = Pos(iter.line, iter.ch); - var close = findMatchingClose(iter, openTag[2]); - return close && {from: start, to: close.from}; - } - } - }); - CodeMirror.findMatchingTag = function(cm, pos, range) { - var iter = new Iter(cm, pos.line, pos.ch, range); - if (iter.text.indexOf(">") == -1 && iter.text.indexOf("<") == -1) return; - var end = toTagEnd(iter), to = end && Pos(iter.line, iter.ch); - var start = end && toTagStart(iter); - if (!end || !start || cmp(iter, pos) > 0) return; - var here = {from: Pos(iter.line, iter.ch), to: to, tag: start[2]}; - if (end == "selfClose") return {open: here, close: null, at: "open"}; - - if (start[1]) { // closing tag - return {open: findMatchingOpen(iter, start[2]), close: here, at: "close"}; - } else { // opening tag - iter = new Iter(cm, to.line, to.ch, range); - return {open: here, close: findMatchingClose(iter, start[2]), at: "open"}; - } - }; - - CodeMirror.findEnclosingTag = function(cm, pos, range) { - var iter = new Iter(cm, pos.line, pos.ch, range); - for (;;) { - var open = findMatchingOpen(iter); - if (!open) break; - var forward = new Iter(cm, pos.line, pos.ch, range); - var close = findMatchingClose(forward, open.tag); - if (close) return {open: open, close: close}; - } - }; - - // Used by addon/edit/closetag.js - CodeMirror.scanForClosingTag = function(cm, pos, name, end) { - var iter = new Iter(cm, pos.line, pos.ch, end ? {from: 0, to: end} : null); - return findMatchingClose(iter, name); - }; -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/hint/anyword-hint.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/hint/anyword-hint.js deleted file mode 100644 index 8e74a92..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/hint/anyword-hint.js +++ /dev/null @@ -1,41 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var WORD = /[\w$]+/, RANGE = 500; - - CodeMirror.registerHelper("hint", "anyword", function(editor, options) { - var word = options && options.word || WORD; - var range = options && options.range || RANGE; - var cur = editor.getCursor(), curLine = editor.getLine(cur.line); - var end = cur.ch, start = end; - while (start && word.test(curLine.charAt(start - 1))) --start; - var curWord = start != end && curLine.slice(start, end); - - var list = [], seen = {}; - var re = new RegExp(word.source, "g"); - for (var dir = -1; dir <= 1; dir += 2) { - var line = cur.line, endLine = Math.min(Math.max(line + dir * range, editor.firstLine()), editor.lastLine()) + dir; - for (; line != endLine; line += dir) { - var text = editor.getLine(line), m; - while (m = re.exec(text)) { - if (line == cur.line && m[0] === curWord) continue; - if ((!curWord || m[0].lastIndexOf(curWord, 0) == 0) && !Object.prototype.hasOwnProperty.call(seen, m[0])) { - seen[m[0]] = true; - list.push(m[0]); - } - } - } - } - return {list: list, from: CodeMirror.Pos(cur.line, start), to: CodeMirror.Pos(cur.line, end)}; - }); -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/hint/css-hint.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/hint/css-hint.js deleted file mode 100644 index 488da34..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/hint/css-hint.js +++ /dev/null @@ -1,56 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../../mode/css/css")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../../mode/css/css"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var pseudoClasses = {link: 1, visited: 1, active: 1, hover: 1, focus: 1, - "first-letter": 1, "first-line": 1, "first-child": 1, - before: 1, after: 1, lang: 1}; - - CodeMirror.registerHelper("hint", "css", function(cm) { - var cur = cm.getCursor(), token = cm.getTokenAt(cur); - var inner = CodeMirror.innerMode(cm.getMode(), token.state); - if (inner.mode.name != "css") return; - - var start = token.start, end = cur.ch, word = token.string.slice(0, end - start); - if (/[^\w$_-]/.test(word)) { - word = ""; start = end = cur.ch; - } - - var spec = CodeMirror.resolveMode("text/css"); - - var result = []; - function add(keywords) { - for (var name in keywords) - if (!word || name.lastIndexOf(word, 0) == 0) - result.push(name); - } - - var st = inner.state.state; - if (st == "pseudo" || token.type == "variable-3") { - add(pseudoClasses); - } else if (st == "block" || st == "maybeprop") { - add(spec.propertyKeywords); - } else if (st == "prop" || st == "parens" || st == "at" || st == "params") { - add(spec.valueKeywords); - add(spec.colorKeywords); - } else if (st == "media" || st == "media_parens") { - add(spec.mediaTypes); - add(spec.mediaFeatures); - } - - if (result.length) return { - list: result, - from: CodeMirror.Pos(cur.line, start), - to: CodeMirror.Pos(cur.line, end) - }; - }); -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/hint/html-hint.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/hint/html-hint.js deleted file mode 100644 index c6769bc..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/hint/html-hint.js +++ /dev/null @@ -1,348 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("./xml-hint")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "./xml-hint"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var langs = "ab aa af ak sq am ar an hy as av ae ay az bm ba eu be bn bh bi bs br bg my ca ch ce ny zh cv kw co cr hr cs da dv nl dz en eo et ee fo fj fi fr ff gl ka de el gn gu ht ha he hz hi ho hu ia id ie ga ig ik io is it iu ja jv kl kn kr ks kk km ki rw ky kv kg ko ku kj la lb lg li ln lo lt lu lv gv mk mg ms ml mt mi mr mh mn na nv nb nd ne ng nn no ii nr oc oj cu om or os pa pi fa pl ps pt qu rm rn ro ru sa sc sd se sm sg sr gd sn si sk sl so st es su sw ss sv ta te tg th ti bo tk tl tn to tr ts tt tw ty ug uk ur uz ve vi vo wa cy wo fy xh yi yo za zu".split(" "); - var targets = ["_blank", "_self", "_top", "_parent"]; - var charsets = ["ascii", "utf-8", "utf-16", "latin1", "latin1"]; - var methods = ["get", "post", "put", "delete"]; - var encs = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"]; - var media = ["all", "screen", "print", "embossed", "braille", "handheld", "print", "projection", "screen", "tty", "tv", "speech", - "3d-glasses", "resolution [>][<][=] [X]", "device-aspect-ratio: X/Y", "orientation:portrait", - "orientation:landscape", "device-height: [X]", "device-width: [X]"]; - var s = { attrs: {} }; // Simple tag, reused for a whole lot of tags - - var data = { - a: { - attrs: { - href: null, ping: null, type: null, - media: media, - target: targets, - hreflang: langs - } - }, - abbr: s, - acronym: s, - address: s, - applet: s, - area: { - attrs: { - alt: null, coords: null, href: null, target: null, ping: null, - media: media, hreflang: langs, type: null, - shape: ["default", "rect", "circle", "poly"] - } - }, - article: s, - aside: s, - audio: { - attrs: { - src: null, mediagroup: null, - crossorigin: ["anonymous", "use-credentials"], - preload: ["none", "metadata", "auto"], - autoplay: ["", "autoplay"], - loop: ["", "loop"], - controls: ["", "controls"] - } - }, - b: s, - base: { attrs: { href: null, target: targets } }, - basefont: s, - bdi: s, - bdo: s, - big: s, - blockquote: { attrs: { cite: null } }, - body: s, - br: s, - button: { - attrs: { - form: null, formaction: null, name: null, value: null, - autofocus: ["", "autofocus"], - disabled: ["", "autofocus"], - formenctype: encs, - formmethod: methods, - formnovalidate: ["", "novalidate"], - formtarget: targets, - type: ["submit", "reset", "button"] - } - }, - canvas: { attrs: { width: null, height: null } }, - caption: s, - center: s, - cite: s, - code: s, - col: { attrs: { span: null } }, - colgroup: { attrs: { span: null } }, - command: { - attrs: { - type: ["command", "checkbox", "radio"], - label: null, icon: null, radiogroup: null, command: null, title: null, - disabled: ["", "disabled"], - checked: ["", "checked"] - } - }, - data: { attrs: { value: null } }, - datagrid: { attrs: { disabled: ["", "disabled"], multiple: ["", "multiple"] } }, - datalist: { attrs: { data: null } }, - dd: s, - del: { attrs: { cite: null, datetime: null } }, - details: { attrs: { open: ["", "open"] } }, - dfn: s, - dir: s, - div: s, - dl: s, - dt: s, - em: s, - embed: { attrs: { src: null, type: null, width: null, height: null } }, - eventsource: { attrs: { src: null } }, - fieldset: { attrs: { disabled: ["", "disabled"], form: null, name: null } }, - figcaption: s, - figure: s, - font: s, - footer: s, - form: { - attrs: { - action: null, name: null, - "accept-charset": charsets, - autocomplete: ["on", "off"], - enctype: encs, - method: methods, - novalidate: ["", "novalidate"], - target: targets - } - }, - frame: s, - frameset: s, - h1: s, h2: s, h3: s, h4: s, h5: s, h6: s, - head: { - attrs: {}, - children: ["title", "base", "link", "style", "meta", "script", "noscript", "command"] - }, - header: s, - hgroup: s, - hr: s, - html: { - attrs: { manifest: null }, - children: ["head", "body"] - }, - i: s, - iframe: { - attrs: { - src: null, srcdoc: null, name: null, width: null, height: null, - sandbox: ["allow-top-navigation", "allow-same-origin", "allow-forms", "allow-scripts"], - seamless: ["", "seamless"] - } - }, - img: { - attrs: { - alt: null, src: null, ismap: null, usemap: null, width: null, height: null, - crossorigin: ["anonymous", "use-credentials"] - } - }, - input: { - attrs: { - alt: null, dirname: null, form: null, formaction: null, - height: null, list: null, max: null, maxlength: null, min: null, - name: null, pattern: null, placeholder: null, size: null, src: null, - step: null, value: null, width: null, - accept: ["audio/*", "video/*", "image/*"], - autocomplete: ["on", "off"], - autofocus: ["", "autofocus"], - checked: ["", "checked"], - disabled: ["", "disabled"], - formenctype: encs, - formmethod: methods, - formnovalidate: ["", "novalidate"], - formtarget: targets, - multiple: ["", "multiple"], - readonly: ["", "readonly"], - required: ["", "required"], - type: ["hidden", "text", "search", "tel", "url", "email", "password", "datetime", "date", "month", - "week", "time", "datetime-local", "number", "range", "color", "checkbox", "radio", - "file", "submit", "image", "reset", "button"] - } - }, - ins: { attrs: { cite: null, datetime: null } }, - kbd: s, - keygen: { - attrs: { - challenge: null, form: null, name: null, - autofocus: ["", "autofocus"], - disabled: ["", "disabled"], - keytype: ["RSA"] - } - }, - label: { attrs: { "for": null, form: null } }, - legend: s, - li: { attrs: { value: null } }, - link: { - attrs: { - href: null, type: null, - hreflang: langs, - media: media, - sizes: ["all", "16x16", "16x16 32x32", "16x16 32x32 64x64"] - } - }, - map: { attrs: { name: null } }, - mark: s, - menu: { attrs: { label: null, type: ["list", "context", "toolbar"] } }, - meta: { - attrs: { - content: null, - charset: charsets, - name: ["viewport", "application-name", "author", "description", "generator", "keywords"], - "http-equiv": ["content-language", "content-type", "default-style", "refresh"] - } - }, - meter: { attrs: { value: null, min: null, low: null, high: null, max: null, optimum: null } }, - nav: s, - noframes: s, - noscript: s, - object: { - attrs: { - data: null, type: null, name: null, usemap: null, form: null, width: null, height: null, - typemustmatch: ["", "typemustmatch"] - } - }, - ol: { attrs: { reversed: ["", "reversed"], start: null, type: ["1", "a", "A", "i", "I"] } }, - optgroup: { attrs: { disabled: ["", "disabled"], label: null } }, - option: { attrs: { disabled: ["", "disabled"], label: null, selected: ["", "selected"], value: null } }, - output: { attrs: { "for": null, form: null, name: null } }, - p: s, - param: { attrs: { name: null, value: null } }, - pre: s, - progress: { attrs: { value: null, max: null } }, - q: { attrs: { cite: null } }, - rp: s, - rt: s, - ruby: s, - s: s, - samp: s, - script: { - attrs: { - type: ["text/javascript"], - src: null, - async: ["", "async"], - defer: ["", "defer"], - charset: charsets - } - }, - section: s, - select: { - attrs: { - form: null, name: null, size: null, - autofocus: ["", "autofocus"], - disabled: ["", "disabled"], - multiple: ["", "multiple"] - } - }, - small: s, - source: { attrs: { src: null, type: null, media: null } }, - span: s, - strike: s, - strong: s, - style: { - attrs: { - type: ["text/css"], - media: media, - scoped: null - } - }, - sub: s, - summary: s, - sup: s, - table: s, - tbody: s, - td: { attrs: { colspan: null, rowspan: null, headers: null } }, - textarea: { - attrs: { - dirname: null, form: null, maxlength: null, name: null, placeholder: null, - rows: null, cols: null, - autofocus: ["", "autofocus"], - disabled: ["", "disabled"], - readonly: ["", "readonly"], - required: ["", "required"], - wrap: ["soft", "hard"] - } - }, - tfoot: s, - th: { attrs: { colspan: null, rowspan: null, headers: null, scope: ["row", "col", "rowgroup", "colgroup"] } }, - thead: s, - time: { attrs: { datetime: null } }, - title: s, - tr: s, - track: { - attrs: { - src: null, label: null, "default": null, - kind: ["subtitles", "captions", "descriptions", "chapters", "metadata"], - srclang: langs - } - }, - tt: s, - u: s, - ul: s, - "var": s, - video: { - attrs: { - src: null, poster: null, width: null, height: null, - crossorigin: ["anonymous", "use-credentials"], - preload: ["auto", "metadata", "none"], - autoplay: ["", "autoplay"], - mediagroup: ["movie"], - muted: ["", "muted"], - controls: ["", "controls"] - } - }, - wbr: s - }; - - var globalAttrs = { - accesskey: ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - "class": null, - contenteditable: ["true", "false"], - contextmenu: null, - dir: ["ltr", "rtl", "auto"], - draggable: ["true", "false", "auto"], - dropzone: ["copy", "move", "link", "string:", "file:"], - hidden: ["hidden"], - id: null, - inert: ["inert"], - itemid: null, - itemprop: null, - itemref: null, - itemscope: ["itemscope"], - itemtype: null, - lang: ["en", "es"], - spellcheck: ["true", "false"], - style: null, - tabindex: ["1", "2", "3", "4", "5", "6", "7", "8", "9"], - title: null, - translate: ["yes", "no"], - onclick: null, - rel: ["stylesheet", "alternate", "author", "bookmark", "help", "license", "next", "nofollow", "noreferrer", "prefetch", "prev", "search", "tag"] - }; - function populate(obj) { - for (var attr in globalAttrs) if (globalAttrs.hasOwnProperty(attr)) - obj.attrs[attr] = globalAttrs[attr]; - } - - populate(s); - for (var tag in data) if (data.hasOwnProperty(tag) && data[tag] != s) - populate(data[tag]); - - CodeMirror.htmlSchema = data; - function htmlHint(cm, options) { - var local = {schemaInfo: data}; - if (options) for (var opt in options) local[opt] = options[opt]; - return CodeMirror.hint.xml(cm, local); - } - CodeMirror.registerHelper("hint", "html", htmlHint); -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/hint/javascript-hint.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/hint/javascript-hint.js deleted file mode 100644 index 7bcbf4a..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/hint/javascript-hint.js +++ /dev/null @@ -1,146 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - var Pos = CodeMirror.Pos; - - function forEach(arr, f) { - for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]); - } - - function arrayContains(arr, item) { - if (!Array.prototype.indexOf) { - var i = arr.length; - while (i--) { - if (arr[i] === item) { - return true; - } - } - return false; - } - return arr.indexOf(item) != -1; - } - - function scriptHint(editor, keywords, getToken, options) { - // Find the token at the cursor - var cur = editor.getCursor(), token = getToken(editor, cur); - if (/\b(?:string|comment)\b/.test(token.type)) return; - token.state = CodeMirror.innerMode(editor.getMode(), token.state).state; - - // If it's not a 'word-style' token, ignore the token. - if (!/^[\w$_]*$/.test(token.string)) { - token = {start: cur.ch, end: cur.ch, string: "", state: token.state, - type: token.string == "." ? "property" : null}; - } else if (token.end > cur.ch) { - token.end = cur.ch; - token.string = token.string.slice(0, cur.ch - token.start); - } - - var tprop = token; - // If it is a property, find out what it is a property of. - while (tprop.type == "property") { - tprop = getToken(editor, Pos(cur.line, tprop.start)); - if (tprop.string != ".") return; - tprop = getToken(editor, Pos(cur.line, tprop.start)); - if (!context) var context = []; - context.push(tprop); - } - return {list: getCompletions(token, context, keywords, options), - from: Pos(cur.line, token.start), - to: Pos(cur.line, token.end)}; - } - - function javascriptHint(editor, options) { - return scriptHint(editor, javascriptKeywords, - function (e, cur) {return e.getTokenAt(cur);}, - options); - }; - CodeMirror.registerHelper("hint", "javascript", javascriptHint); - - function getCoffeeScriptToken(editor, cur) { - // This getToken, it is for coffeescript, imitates the behavior of - // getTokenAt method in javascript.js, that is, returning "property" - // type and treat "." as indepenent token. - var token = editor.getTokenAt(cur); - if (cur.ch == token.start + 1 && token.string.charAt(0) == '.') { - token.end = token.start; - token.string = '.'; - token.type = "property"; - } - else if (/^\.[\w$_]*$/.test(token.string)) { - token.type = "property"; - token.start++; - token.string = token.string.replace(/\./, ''); - } - return token; - } - - function coffeescriptHint(editor, options) { - return scriptHint(editor, coffeescriptKeywords, getCoffeeScriptToken, options); - } - CodeMirror.registerHelper("hint", "coffeescript", coffeescriptHint); - - var stringProps = ("charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight " + - "toUpperCase toLowerCase split concat match replace search").split(" "); - var arrayProps = ("length concat join splice push pop shift unshift slice reverse sort indexOf " + - "lastIndexOf every some filter forEach map reduce reduceRight ").split(" "); - var funcProps = "prototype apply call bind".split(" "); - var javascriptKeywords = ("break case catch continue debugger default delete do else false finally for function " + - "if in instanceof new null return switch throw true try typeof var void while with").split(" "); - var coffeescriptKeywords = ("and break catch class continue delete do else extends false finally for " + - "if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes").split(" "); - - function getCompletions(token, context, keywords, options) { - var found = [], start = token.string, global = options && options.globalScope || window; - function maybeAdd(str) { - if (str.lastIndexOf(start, 0) == 0 && !arrayContains(found, str)) found.push(str); - } - function gatherCompletions(obj) { - if (typeof obj == "string") forEach(stringProps, maybeAdd); - else if (obj instanceof Array) forEach(arrayProps, maybeAdd); - else if (obj instanceof Function) forEach(funcProps, maybeAdd); - for (var name in obj) maybeAdd(name); - } - - if (context && context.length) { - // If this is a property, see if it belongs to some object we can - // find in the current environment. - var obj = context.pop(), base; - if (obj.type && obj.type.indexOf("variable") === 0) { - if (options && options.additionalContext) - base = options.additionalContext[obj.string]; - if (!options || options.useGlobalScope !== false) - base = base || global[obj.string]; - } else if (obj.type == "string") { - base = ""; - } else if (obj.type == "atom") { - base = 1; - } else if (obj.type == "function") { - if (global.jQuery != null && (obj.string == '$' || obj.string == 'jQuery') && - (typeof global.jQuery == 'function')) - base = global.jQuery(); - else if (global._ != null && (obj.string == '_') && (typeof global._ == 'function')) - base = global._(); - } - while (base != null && context.length) - base = base[context.pop().string]; - if (base != null) gatherCompletions(base); - } else { - // If not, just look in the global object and any local scope - // (reading into JS mode internals to get at the local and global variables) - for (var v = token.state.localVars; v; v = v.next) maybeAdd(v.name); - for (var v = token.state.globalVars; v; v = v.next) maybeAdd(v.name); - if (!options || options.useGlobalScope !== false) - gatherCompletions(global); - forEach(keywords, maybeAdd); - } - return found; - } -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/hint/show-hint.css b/src/main/resources/static/editor.md-master/lib/codemirror/addon/hint/show-hint.css deleted file mode 100644 index 924e638..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/hint/show-hint.css +++ /dev/null @@ -1,38 +0,0 @@ -.CodeMirror-hints { - position: absolute; - z-index: 10; - overflow: hidden; - list-style: none; - - margin: 0; - padding: 2px; - - -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2); - -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2); - box-shadow: 2px 3px 5px rgba(0,0,0,.2); - border-radius: 3px; - border: 1px solid silver; - - background: white; - font-size: 90%; - font-family: monospace; - - max-height: 20em; - overflow-y: auto; -} - -.CodeMirror-hint { - margin: 0; - padding: 0 4px; - border-radius: 2px; - max-width: 19em; - overflow: hidden; - white-space: pre; - color: black; - cursor: pointer; -} - -li.CodeMirror-hint-active { - background: #08f; - color: white; -} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/hint/show-hint.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/hint/show-hint.js deleted file mode 100644 index f544619..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/hint/show-hint.js +++ /dev/null @@ -1,394 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var HINT_ELEMENT_CLASS = "CodeMirror-hint"; - var ACTIVE_HINT_ELEMENT_CLASS = "CodeMirror-hint-active"; - - // This is the old interface, kept around for now to stay - // backwards-compatible. - CodeMirror.showHint = function(cm, getHints, options) { - if (!getHints) return cm.showHint(options); - if (options && options.async) getHints.async = true; - var newOpts = {hint: getHints}; - if (options) for (var prop in options) newOpts[prop] = options[prop]; - return cm.showHint(newOpts); - }; - - var asyncRunID = 0; - function retrieveHints(getter, cm, options, then) { - if (getter.async) { - var id = ++asyncRunID; - getter(cm, function(hints) { - if (asyncRunID == id) then(hints); - }, options); - } else { - then(getter(cm, options)); - } - } - - CodeMirror.defineExtension("showHint", function(options) { - // We want a single cursor position. - if (this.listSelections().length > 1 || this.somethingSelected()) return; - - if (this.state.completionActive) this.state.completionActive.close(); - var completion = this.state.completionActive = new Completion(this, options); - var getHints = completion.options.hint; - if (!getHints) return; - - CodeMirror.signal(this, "startCompletion", this); - return retrieveHints(getHints, this, completion.options, function(hints) { completion.showHints(hints); }); - }); - - function Completion(cm, options) { - this.cm = cm; - this.options = this.buildOptions(options); - this.widget = this.onClose = null; - } - - Completion.prototype = { - close: function() { - if (!this.active()) return; - this.cm.state.completionActive = null; - - if (this.widget) this.widget.close(); - if (this.onClose) this.onClose(); - CodeMirror.signal(this.cm, "endCompletion", this.cm); - }, - - active: function() { - return this.cm.state.completionActive == this; - }, - - pick: function(data, i) { - var completion = data.list[i]; - if (completion.hint) completion.hint(this.cm, data, completion); - else this.cm.replaceRange(getText(completion), completion.from || data.from, - completion.to || data.to, "complete"); - CodeMirror.signal(data, "pick", completion); - this.close(); - }, - - showHints: function(data) { - if (!data || !data.list.length || !this.active()) return this.close(); - - if (this.options.completeSingle && data.list.length == 1) - this.pick(data, 0); - else - this.showWidget(data); - }, - - showWidget: function(data) { - this.widget = new Widget(this, data); - CodeMirror.signal(data, "shown"); - - var debounce = 0, completion = this, finished; - var closeOn = this.options.closeCharacters; - var startPos = this.cm.getCursor(), startLen = this.cm.getLine(startPos.line).length; - - var requestAnimationFrame = window.requestAnimationFrame || function(fn) { - return setTimeout(fn, 1000/60); - }; - var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout; - - function done() { - if (finished) return; - finished = true; - completion.close(); - completion.cm.off("cursorActivity", activity); - if (data) CodeMirror.signal(data, "close"); - } - - function update() { - if (finished) return; - CodeMirror.signal(data, "update"); - retrieveHints(completion.options.hint, completion.cm, completion.options, finishUpdate); - } - function finishUpdate(data_) { - data = data_; - if (finished) return; - if (!data || !data.list.length) return done(); - if (completion.widget) completion.widget.close(); - completion.widget = new Widget(completion, data); - } - - function clearDebounce() { - if (debounce) { - cancelAnimationFrame(debounce); - debounce = 0; - } - } - - function activity() { - clearDebounce(); - var pos = completion.cm.getCursor(), line = completion.cm.getLine(pos.line); - if (pos.line != startPos.line || line.length - pos.ch != startLen - startPos.ch || - pos.ch < startPos.ch || completion.cm.somethingSelected() || - (pos.ch && closeOn.test(line.charAt(pos.ch - 1)))) { - completion.close(); - } else { - debounce = requestAnimationFrame(update); - if (completion.widget) completion.widget.close(); - } - } - this.cm.on("cursorActivity", activity); - this.onClose = done; - }, - - buildOptions: function(options) { - var editor = this.cm.options.hintOptions; - var out = {}; - for (var prop in defaultOptions) out[prop] = defaultOptions[prop]; - if (editor) for (var prop in editor) - if (editor[prop] !== undefined) out[prop] = editor[prop]; - if (options) for (var prop in options) - if (options[prop] !== undefined) out[prop] = options[prop]; - return out; - } - }; - - function getText(completion) { - if (typeof completion == "string") return completion; - else return completion.text; - } - - function buildKeyMap(completion, handle) { - var baseMap = { - Up: function() {handle.moveFocus(-1);}, - Down: function() {handle.moveFocus(1);}, - PageUp: function() {handle.moveFocus(-handle.menuSize() + 1, true);}, - PageDown: function() {handle.moveFocus(handle.menuSize() - 1, true);}, - Home: function() {handle.setFocus(0);}, - End: function() {handle.setFocus(handle.length - 1);}, - Enter: handle.pick, - Tab: handle.pick, - Esc: handle.close - }; - var custom = completion.options.customKeys; - var ourMap = custom ? {} : baseMap; - function addBinding(key, val) { - var bound; - if (typeof val != "string") - bound = function(cm) { return val(cm, handle); }; - // This mechanism is deprecated - else if (baseMap.hasOwnProperty(val)) - bound = baseMap[val]; - else - bound = val; - ourMap[key] = bound; - } - if (custom) - for (var key in custom) if (custom.hasOwnProperty(key)) - addBinding(key, custom[key]); - var extra = completion.options.extraKeys; - if (extra) - for (var key in extra) if (extra.hasOwnProperty(key)) - addBinding(key, extra[key]); - return ourMap; - } - - function getHintElement(hintsElement, el) { - while (el && el != hintsElement) { - if (el.nodeName.toUpperCase() === "LI" && el.parentNode == hintsElement) return el; - el = el.parentNode; - } - } - - function Widget(completion, data) { - this.completion = completion; - this.data = data; - var widget = this, cm = completion.cm; - - var hints = this.hints = document.createElement("ul"); - hints.className = "CodeMirror-hints"; - this.selectedHint = data.selectedHint || 0; - - var completions = data.list; - for (var i = 0; i < completions.length; ++i) { - var elt = hints.appendChild(document.createElement("li")), cur = completions[i]; - var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? "" : " " + ACTIVE_HINT_ELEMENT_CLASS); - if (cur.className != null) className = cur.className + " " + className; - elt.className = className; - if (cur.render) cur.render(elt, data, cur); - else elt.appendChild(document.createTextNode(cur.displayText || getText(cur))); - elt.hintId = i; - } - - var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null); - var left = pos.left, top = pos.bottom, below = true; - hints.style.left = left + "px"; - hints.style.top = top + "px"; - // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor. - var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth); - var winH = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight); - (completion.options.container || document.body).appendChild(hints); - var box = hints.getBoundingClientRect(), overlapY = box.bottom - winH; - if (overlapY > 0) { - var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top); - if (curTop - height > 0) { // Fits above cursor - hints.style.top = (top = pos.top - height) + "px"; - below = false; - } else if (height > winH) { - hints.style.height = (winH - 5) + "px"; - hints.style.top = (top = pos.bottom - box.top) + "px"; - var cursor = cm.getCursor(); - if (data.from.ch != cursor.ch) { - pos = cm.cursorCoords(cursor); - hints.style.left = (left = pos.left) + "px"; - box = hints.getBoundingClientRect(); - } - } - } - var overlapX = box.right - winW; - if (overlapX > 0) { - if (box.right - box.left > winW) { - hints.style.width = (winW - 5) + "px"; - overlapX -= (box.right - box.left) - winW; - } - hints.style.left = (left = pos.left - overlapX) + "px"; - } - - cm.addKeyMap(this.keyMap = buildKeyMap(completion, { - moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); }, - setFocus: function(n) { widget.changeActive(n); }, - menuSize: function() { return widget.screenAmount(); }, - length: completions.length, - close: function() { completion.close(); }, - pick: function() { widget.pick(); }, - data: data - })); - - if (completion.options.closeOnUnfocus) { - var closingOnBlur; - cm.on("blur", this.onBlur = function() { closingOnBlur = setTimeout(function() { completion.close(); }, 100); }); - cm.on("focus", this.onFocus = function() { clearTimeout(closingOnBlur); }); - } - - var startScroll = cm.getScrollInfo(); - cm.on("scroll", this.onScroll = function() { - var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect(); - var newTop = top + startScroll.top - curScroll.top; - var point = newTop - (window.pageYOffset || (document.documentElement || document.body).scrollTop); - if (!below) point += hints.offsetHeight; - if (point <= editor.top || point >= editor.bottom) return completion.close(); - hints.style.top = newTop + "px"; - hints.style.left = (left + startScroll.left - curScroll.left) + "px"; - }); - - CodeMirror.on(hints, "dblclick", function(e) { - var t = getHintElement(hints, e.target || e.srcElement); - if (t && t.hintId != null) {widget.changeActive(t.hintId); widget.pick();} - }); - - CodeMirror.on(hints, "click", function(e) { - var t = getHintElement(hints, e.target || e.srcElement); - if (t && t.hintId != null) { - widget.changeActive(t.hintId); - if (completion.options.completeOnSingleClick) widget.pick(); - } - }); - - CodeMirror.on(hints, "mousedown", function() { - setTimeout(function(){cm.focus();}, 20); - }); - - CodeMirror.signal(data, "select", completions[0], hints.firstChild); - return true; - } - - Widget.prototype = { - close: function() { - if (this.completion.widget != this) return; - this.completion.widget = null; - this.hints.parentNode.removeChild(this.hints); - this.completion.cm.removeKeyMap(this.keyMap); - - var cm = this.completion.cm; - if (this.completion.options.closeOnUnfocus) { - cm.off("blur", this.onBlur); - cm.off("focus", this.onFocus); - } - cm.off("scroll", this.onScroll); - }, - - pick: function() { - this.completion.pick(this.data, this.selectedHint); - }, - - changeActive: function(i, avoidWrap) { - if (i >= this.data.list.length) - i = avoidWrap ? this.data.list.length - 1 : 0; - else if (i < 0) - i = avoidWrap ? 0 : this.data.list.length - 1; - if (this.selectedHint == i) return; - var node = this.hints.childNodes[this.selectedHint]; - node.className = node.className.replace(" " + ACTIVE_HINT_ELEMENT_CLASS, ""); - node = this.hints.childNodes[this.selectedHint = i]; - node.className += " " + ACTIVE_HINT_ELEMENT_CLASS; - if (node.offsetTop < this.hints.scrollTop) - this.hints.scrollTop = node.offsetTop - 3; - else if (node.offsetTop + node.offsetHeight > this.hints.scrollTop + this.hints.clientHeight) - this.hints.scrollTop = node.offsetTop + node.offsetHeight - this.hints.clientHeight + 3; - CodeMirror.signal(this.data, "select", this.data.list[this.selectedHint], node); - }, - - screenAmount: function() { - return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1; - } - }; - - CodeMirror.registerHelper("hint", "auto", function(cm, options) { - var helpers = cm.getHelpers(cm.getCursor(), "hint"), words; - if (helpers.length) { - for (var i = 0; i < helpers.length; i++) { - var cur = helpers[i](cm, options); - if (cur && cur.list.length) return cur; - } - } else if (words = cm.getHelper(cm.getCursor(), "hintWords")) { - if (words) return CodeMirror.hint.fromList(cm, {words: words}); - } else if (CodeMirror.hint.anyword) { - return CodeMirror.hint.anyword(cm, options); - } - }); - - CodeMirror.registerHelper("hint", "fromList", function(cm, options) { - var cur = cm.getCursor(), token = cm.getTokenAt(cur); - var found = []; - for (var i = 0; i < options.words.length; i++) { - var word = options.words[i]; - if (word.slice(0, token.string.length) == token.string) - found.push(word); - } - - if (found.length) return { - list: found, - from: CodeMirror.Pos(cur.line, token.start), - to: CodeMirror.Pos(cur.line, token.end) - }; - }); - - CodeMirror.commands.autocomplete = CodeMirror.showHint; - - var defaultOptions = { - hint: CodeMirror.hint.auto, - completeSingle: true, - alignWithWord: true, - closeCharacters: /[\s()\[\]{};:>,]/, - closeOnUnfocus: true, - completeOnSingleClick: false, - container: null, - customKeys: null, - extraKeys: null - }; - - CodeMirror.defineOption("hintOptions", null); -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/hint/sql-hint.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/hint/sql-hint.js deleted file mode 100644 index 5b0cc76..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/hint/sql-hint.js +++ /dev/null @@ -1,240 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../../mode/sql/sql")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../../mode/sql/sql"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var tables; - var defaultTable; - var keywords; - var CONS = { - QUERY_DIV: ";", - ALIAS_KEYWORD: "AS" - }; - var Pos = CodeMirror.Pos; - - function getKeywords(editor) { - var mode = editor.doc.modeOption; - if (mode === "sql") mode = "text/x-sql"; - return CodeMirror.resolveMode(mode).keywords; - } - - function getText(item) { - return typeof item == "string" ? item : item.text; - } - - function getItem(list, item) { - if (!list.slice) return list[item]; - for (var i = list.length - 1; i >= 0; i--) if (getText(list[i]) == item) - return list[i]; - } - - function shallowClone(object) { - var result = {}; - for (var key in object) if (object.hasOwnProperty(key)) - result[key] = object[key]; - return result; - } - - function match(string, word) { - var len = string.length; - var sub = getText(word).substr(0, len); - return string.toUpperCase() === sub.toUpperCase(); - } - - function addMatches(result, search, wordlist, formatter) { - for (var word in wordlist) { - if (!wordlist.hasOwnProperty(word)) continue; - if (Array.isArray(wordlist)) { - word = wordlist[word]; - } - if (match(search, word)) { - result.push(formatter(word)); - } - } - } - - function cleanName(name) { - // Get rid name from backticks(`) and preceding dot(.) - if (name.charAt(0) == ".") { - name = name.substr(1); - } - return name.replace(/`/g, ""); - } - - function insertBackticks(name) { - var nameParts = getText(name).split("."); - for (var i = 0; i < nameParts.length; i++) - nameParts[i] = "`" + nameParts[i] + "`"; - var escaped = nameParts.join("."); - if (typeof name == "string") return escaped; - name = shallowClone(name); - name.text = escaped; - return name; - } - - function nameCompletion(cur, token, result, editor) { - // Try to complete table, colunm names and return start position of completion - var useBacktick = false; - var nameParts = []; - var start = token.start; - var cont = true; - while (cont) { - cont = (token.string.charAt(0) == "."); - useBacktick = useBacktick || (token.string.charAt(0) == "`"); - - start = token.start; - nameParts.unshift(cleanName(token.string)); - - token = editor.getTokenAt(Pos(cur.line, token.start)); - if (token.string == ".") { - cont = true; - token = editor.getTokenAt(Pos(cur.line, token.start)); - } - } - - // Try to complete table names - var string = nameParts.join("."); - addMatches(result, string, tables, function(w) { - return useBacktick ? insertBackticks(w) : w; - }); - - // Try to complete columns from defaultTable - addMatches(result, string, defaultTable, function(w) { - return useBacktick ? insertBackticks(w) : w; - }); - - // Try to complete columns - string = nameParts.pop(); - var table = nameParts.join("."); - - // Check if table is available. If not, find table by Alias - if (!getItem(tables, table)) - table = findTableByAlias(table, editor); - - var columns = getItem(tables, table); - if (columns && Array.isArray(tables) && columns.columns) - columns = columns.columns; - - if (columns) { - addMatches(result, string, columns, function(w) { - if (typeof w == "string") { - w = table + "." + w; - } else { - w = shallowClone(w); - w.text = table + "." + w.text; - } - return useBacktick ? insertBackticks(w) : w; - }); - } - - return start; - } - - function eachWord(lineText, f) { - if (!lineText) return; - var excepted = /[,;]/g; - var words = lineText.split(" "); - for (var i = 0; i < words.length; i++) { - f(words[i]?words[i].replace(excepted, '') : ''); - } - } - - function convertCurToNumber(cur) { - // max characters of a line is 999,999. - return cur.line + cur.ch / Math.pow(10, 6); - } - - function convertNumberToCur(num) { - return Pos(Math.floor(num), +num.toString().split('.').pop()); - } - - function findTableByAlias(alias, editor) { - var doc = editor.doc; - var fullQuery = doc.getValue(); - var aliasUpperCase = alias.toUpperCase(); - var previousWord = ""; - var table = ""; - var separator = []; - var validRange = { - start: Pos(0, 0), - end: Pos(editor.lastLine(), editor.getLineHandle(editor.lastLine()).length) - }; - - //add separator - var indexOfSeparator = fullQuery.indexOf(CONS.QUERY_DIV); - while(indexOfSeparator != -1) { - separator.push(doc.posFromIndex(indexOfSeparator)); - indexOfSeparator = fullQuery.indexOf(CONS.QUERY_DIV, indexOfSeparator+1); - } - separator.unshift(Pos(0, 0)); - separator.push(Pos(editor.lastLine(), editor.getLineHandle(editor.lastLine()).text.length)); - - //find valid range - var prevItem = 0; - var current = convertCurToNumber(editor.getCursor()); - for (var i=0; i< separator.length; i++) { - var _v = convertCurToNumber(separator[i]); - if (current > prevItem && current <= _v) { - validRange = { start: convertNumberToCur(prevItem), end: convertNumberToCur(_v) }; - break; - } - prevItem = _v; - } - - var query = doc.getRange(validRange.start, validRange.end, false); - - for (var i = 0; i < query.length; i++) { - var lineText = query[i]; - eachWord(lineText, function(word) { - var wordUpperCase = word.toUpperCase(); - if (wordUpperCase === aliasUpperCase && getItem(tables, previousWord)) - table = previousWord; - if (wordUpperCase !== CONS.ALIAS_KEYWORD) - previousWord = word; - }); - if (table) break; - } - return table; - } - - CodeMirror.registerHelper("hint", "sql", function(editor, options) { - tables = (options && options.tables) || {}; - var defaultTableName = options && options.defaultTable; - defaultTable = (defaultTableName && getItem(tables, defaultTableName)) || []; - keywords = keywords || getKeywords(editor); - - var cur = editor.getCursor(); - var result = []; - var token = editor.getTokenAt(cur), start, end, search; - if (token.end > cur.ch) { - token.end = cur.ch; - token.string = token.string.slice(0, cur.ch - token.start); - } - - if (token.string.match(/^[.`\w@]\w*$/)) { - search = token.string; - start = token.start; - end = token.end; - } else { - start = end = cur.ch; - search = ""; - } - if (search.charAt(0) == "." || search.charAt(0) == "`") { - start = nameCompletion(cur, token, result, editor); - } else { - addMatches(result, search, tables, function(w) {return w;}); - addMatches(result, search, defaultTable, function(w) {return w;}); - addMatches(result, search, keywords, function(w) {return w.toUpperCase();}); - } - - return {list: result, from: Pos(cur.line, start), to: Pos(cur.line, end)}; - }); -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/hint/xml-hint.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/hint/xml-hint.js deleted file mode 100644 index 9b9baa0..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/hint/xml-hint.js +++ /dev/null @@ -1,110 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var Pos = CodeMirror.Pos; - - function getHints(cm, options) { - var tags = options && options.schemaInfo; - var quote = (options && options.quoteChar) || '"'; - if (!tags) return; - var cur = cm.getCursor(), token = cm.getTokenAt(cur); - if (token.end > cur.ch) { - token.end = cur.ch; - token.string = token.string.slice(0, cur.ch - token.start); - } - var inner = CodeMirror.innerMode(cm.getMode(), token.state); - if (inner.mode.name != "xml") return; - var result = [], replaceToken = false, prefix; - var tag = /\btag\b/.test(token.type) && !/>$/.test(token.string); - var tagName = tag && /^\w/.test(token.string), tagStart; - - if (tagName) { - var before = cm.getLine(cur.line).slice(Math.max(0, token.start - 2), token.start); - var tagType = /<\/$/.test(before) ? "close" : /<$/.test(before) ? "open" : null; - if (tagType) tagStart = token.start - (tagType == "close" ? 2 : 1); - } else if (tag && token.string == "<") { - tagType = "open"; - } else if (tag && token.string == ""); - } else { - // Attribute completion - var curTag = tags[inner.state.tagName], attrs = curTag && curTag.attrs; - var globalAttrs = tags["!attrs"]; - if (!attrs && !globalAttrs) return; - if (!attrs) { - attrs = globalAttrs; - } else if (globalAttrs) { // Combine tag-local and global attributes - var set = {}; - for (var nm in globalAttrs) if (globalAttrs.hasOwnProperty(nm)) set[nm] = globalAttrs[nm]; - for (var nm in attrs) if (attrs.hasOwnProperty(nm)) set[nm] = attrs[nm]; - attrs = set; - } - if (token.type == "string" || token.string == "=") { // A value - var before = cm.getRange(Pos(cur.line, Math.max(0, cur.ch - 60)), - Pos(cur.line, token.type == "string" ? token.start : token.end)); - var atName = before.match(/([^\s\u00a0=<>\"\']+)=$/), atValues; - if (!atName || !attrs.hasOwnProperty(atName[1]) || !(atValues = attrs[atName[1]])) return; - if (typeof atValues == 'function') atValues = atValues.call(this, cm); // Functions can be used to supply values for autocomplete widget - if (token.type == "string") { - prefix = token.string; - var n = 0; - if (/['"]/.test(token.string.charAt(0))) { - quote = token.string.charAt(0); - prefix = token.string.slice(1); - n++; - } - var len = token.string.length; - if (/['"]/.test(token.string.charAt(len - 1))) { - quote = token.string.charAt(len - 1); - prefix = token.string.substr(n, len - 2); - } - replaceToken = true; - } - for (var i = 0; i < atValues.length; ++i) if (!prefix || atValues[i].lastIndexOf(prefix, 0) == 0) - result.push(quote + atValues[i] + quote); - } else { // An attribute name - if (token.type == "attribute") { - prefix = token.string; - replaceToken = true; - } - for (var attr in attrs) if (attrs.hasOwnProperty(attr) && (!prefix || attr.lastIndexOf(prefix, 0) == 0)) - result.push(attr); - } - } - return { - list: result, - from: replaceToken ? Pos(cur.line, tagStart == null ? token.start : tagStart) : cur, - to: replaceToken ? Pos(cur.line, token.end) : cur - }; - } - - CodeMirror.registerHelper("hint", "xml", getHints); -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/lint/coffeescript-lint.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/lint/coffeescript-lint.js deleted file mode 100644 index 7e39428..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/lint/coffeescript-lint.js +++ /dev/null @@ -1,41 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Depends on coffeelint.js from http://www.coffeelint.org/js/coffeelint.js - -// declare global: coffeelint - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.registerHelper("lint", "coffeescript", function(text) { - var found = []; - var parseError = function(err) { - var loc = err.lineNumber; - found.push({from: CodeMirror.Pos(loc-1, 0), - to: CodeMirror.Pos(loc, 0), - severity: err.level, - message: err.message}); - }; - try { - var res = coffeelint.lint(text); - for(var i = 0; i < res.length; i++) { - parseError(res[i]); - } - } catch(e) { - found.push({from: CodeMirror.Pos(e.location.first_line, 0), - to: CodeMirror.Pos(e.location.last_line, e.location.last_column), - severity: 'error', - message: e.message}); - } - return found; -}); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/lint/css-lint.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/lint/css-lint.js deleted file mode 100644 index 1f61b47..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/lint/css-lint.js +++ /dev/null @@ -1,35 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Depends on csslint.js from https://github.com/stubbornella/csslint - -// declare global: CSSLint - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.registerHelper("lint", "css", function(text) { - var found = []; - if (!window.CSSLint) return found; - var results = CSSLint.verify(text), messages = results.messages, message = null; - for ( var i = 0; i < messages.length; i++) { - message = messages[i]; - var startLine = message.line -1, endLine = message.line -1, startCol = message.col -1, endCol = message.col; - found.push({ - from: CodeMirror.Pos(startLine, startCol), - to: CodeMirror.Pos(endLine, endCol), - message: message.message, - severity : message.type - }); - } - return found; -}); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/lint/javascript-lint.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/lint/javascript-lint.js deleted file mode 100644 index 3d65ba6..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/lint/javascript-lint.js +++ /dev/null @@ -1,136 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - // declare global: JSHINT - - var bogus = [ "Dangerous comment" ]; - - var warnings = [ [ "Expected '{'", - "Statement body should be inside '{ }' braces." ] ]; - - var errors = [ "Missing semicolon", "Extra comma", "Missing property name", - "Unmatched ", " and instead saw", " is not defined", - "Unclosed string", "Stopping, unable to continue" ]; - - function validator(text, options) { - if (!window.JSHINT) return []; - JSHINT(text, options); - var errors = JSHINT.data().errors, result = []; - if (errors) parseErrors(errors, result); - return result; - } - - CodeMirror.registerHelper("lint", "javascript", validator); - - function cleanup(error) { - // All problems are warnings by default - fixWith(error, warnings, "warning", true); - fixWith(error, errors, "error"); - - return isBogus(error) ? null : error; - } - - function fixWith(error, fixes, severity, force) { - var description, fix, find, replace, found; - - description = error.description; - - for ( var i = 0; i < fixes.length; i++) { - fix = fixes[i]; - find = (typeof fix === "string" ? fix : fix[0]); - replace = (typeof fix === "string" ? null : fix[1]); - found = description.indexOf(find) !== -1; - - if (force || found) { - error.severity = severity; - } - if (found && replace) { - error.description = replace; - } - } - } - - function isBogus(error) { - var description = error.description; - for ( var i = 0; i < bogus.length; i++) { - if (description.indexOf(bogus[i]) !== -1) { - return true; - } - } - return false; - } - - function parseErrors(errors, output) { - for ( var i = 0; i < errors.length; i++) { - var error = errors[i]; - if (error) { - var linetabpositions, index; - - linetabpositions = []; - - // This next block is to fix a problem in jshint. Jshint - // replaces - // all tabs with spaces then performs some checks. The error - // positions (character/space) are then reported incorrectly, - // not taking the replacement step into account. Here we look - // at the evidence line and try to adjust the character position - // to the correct value. - if (error.evidence) { - // Tab positions are computed once per line and cached - var tabpositions = linetabpositions[error.line]; - if (!tabpositions) { - var evidence = error.evidence; - tabpositions = []; - // ugggh phantomjs does not like this - // forEachChar(evidence, function(item, index) { - Array.prototype.forEach.call(evidence, function(item, - index) { - if (item === '\t') { - // First col is 1 (not 0) to match error - // positions - tabpositions.push(index + 1); - } - }); - linetabpositions[error.line] = tabpositions; - } - if (tabpositions.length > 0) { - var pos = error.character; - tabpositions.forEach(function(tabposition) { - if (pos > tabposition) pos -= 1; - }); - error.character = pos; - } - } - - var start = error.character - 1, end = start + 1; - if (error.evidence) { - index = error.evidence.substring(start).search(/.\b/); - if (index > -1) { - end += index; - } - } - - // Convert to format expected by validation service - error.description = error.reason;// + "(jshint)"; - error.start = error.character; - error.end = end; - error = cleanup(error); - - if (error) - output.push({message: error.description, - severity: error.severity, - from: CodeMirror.Pos(error.line - 1, start), - to: CodeMirror.Pos(error.line - 1, end)}); - } - } - } -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/lint/json-lint.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/lint/json-lint.js deleted file mode 100644 index 9dbb616..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/lint/json-lint.js +++ /dev/null @@ -1,31 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Depends on jsonlint.js from https://github.com/zaach/jsonlint - -// declare global: jsonlint - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.registerHelper("lint", "json", function(text) { - var found = []; - jsonlint.parseError = function(str, hash) { - var loc = hash.loc; - found.push({from: CodeMirror.Pos(loc.first_line - 1, loc.first_column), - to: CodeMirror.Pos(loc.last_line - 1, loc.last_column), - message: str}); - }; - try { jsonlint.parse(text); } - catch(e) {} - return found; -}); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/lint/lint.css b/src/main/resources/static/editor.md-master/lib/codemirror/addon/lint/lint.css deleted file mode 100644 index 414a9a0..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/lint/lint.css +++ /dev/null @@ -1,73 +0,0 @@ -/* The lint marker gutter */ -.CodeMirror-lint-markers { - width: 16px; -} - -.CodeMirror-lint-tooltip { - background-color: infobackground; - border: 1px solid black; - border-radius: 4px 4px 4px 4px; - color: infotext; - font-family: monospace; - font-size: 10pt; - overflow: hidden; - padding: 2px 5px; - position: fixed; - white-space: pre; - white-space: pre-wrap; - z-index: 100; - max-width: 600px; - opacity: 0; - transition: opacity .4s; - -moz-transition: opacity .4s; - -webkit-transition: opacity .4s; - -o-transition: opacity .4s; - -ms-transition: opacity .4s; -} - -.CodeMirror-lint-mark-error, .CodeMirror-lint-mark-warning { - background-position: left bottom; - background-repeat: repeat-x; -} - -.CodeMirror-lint-mark-error { - background-image: - url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==") - ; -} - -.CodeMirror-lint-mark-warning { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII="); -} - -.CodeMirror-lint-marker-error, .CodeMirror-lint-marker-warning { - background-position: center center; - background-repeat: no-repeat; - cursor: pointer; - display: inline-block; - height: 16px; - width: 16px; - vertical-align: middle; - position: relative; -} - -.CodeMirror-lint-message-error, .CodeMirror-lint-message-warning { - padding-left: 18px; - background-position: top left; - background-repeat: no-repeat; -} - -.CodeMirror-lint-marker-error, .CodeMirror-lint-message-error { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII="); -} - -.CodeMirror-lint-marker-warning, .CodeMirror-lint-message-warning { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII="); -} - -.CodeMirror-lint-marker-multiple { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC"); - background-repeat: no-repeat; - background-position: right bottom; - width: 100%; height: 100%; -} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/lint/lint.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/lint/lint.js deleted file mode 100644 index 18eb709..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/lint/lint.js +++ /dev/null @@ -1,205 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - var GUTTER_ID = "CodeMirror-lint-markers"; - - function showTooltip(e, content) { - var tt = document.createElement("div"); - tt.className = "CodeMirror-lint-tooltip"; - tt.appendChild(content.cloneNode(true)); - document.body.appendChild(tt); - - function position(e) { - if (!tt.parentNode) return CodeMirror.off(document, "mousemove", position); - tt.style.top = Math.max(0, e.clientY - tt.offsetHeight - 5) + "px"; - tt.style.left = (e.clientX + 5) + "px"; - } - CodeMirror.on(document, "mousemove", position); - position(e); - if (tt.style.opacity != null) tt.style.opacity = 1; - return tt; - } - function rm(elt) { - if (elt.parentNode) elt.parentNode.removeChild(elt); - } - function hideTooltip(tt) { - if (!tt.parentNode) return; - if (tt.style.opacity == null) rm(tt); - tt.style.opacity = 0; - setTimeout(function() { rm(tt); }, 600); - } - - function showTooltipFor(e, content, node) { - var tooltip = showTooltip(e, content); - function hide() { - CodeMirror.off(node, "mouseout", hide); - if (tooltip) { hideTooltip(tooltip); tooltip = null; } - } - var poll = setInterval(function() { - if (tooltip) for (var n = node;; n = n.parentNode) { - if (n && n.nodeType == 11) n = n.host; - if (n == document.body) return; - if (!n) { hide(); break; } - } - if (!tooltip) return clearInterval(poll); - }, 400); - CodeMirror.on(node, "mouseout", hide); - } - - function LintState(cm, options, hasGutter) { - this.marked = []; - this.options = options; - this.timeout = null; - this.hasGutter = hasGutter; - this.onMouseOver = function(e) { onMouseOver(cm, e); }; - } - - function parseOptions(cm, options) { - if (options instanceof Function) return {getAnnotations: options}; - if (!options || options === true) options = {}; - if (!options.getAnnotations) options.getAnnotations = cm.getHelper(CodeMirror.Pos(0, 0), "lint"); - if (!options.getAnnotations) throw new Error("Required option 'getAnnotations' missing (lint addon)"); - return options; - } - - function clearMarks(cm) { - var state = cm.state.lint; - if (state.hasGutter) cm.clearGutter(GUTTER_ID); - for (var i = 0; i < state.marked.length; ++i) - state.marked[i].clear(); - state.marked.length = 0; - } - - function makeMarker(labels, severity, multiple, tooltips) { - var marker = document.createElement("div"), inner = marker; - marker.className = "CodeMirror-lint-marker-" + severity; - if (multiple) { - inner = marker.appendChild(document.createElement("div")); - inner.className = "CodeMirror-lint-marker-multiple"; - } - - if (tooltips != false) CodeMirror.on(inner, "mouseover", function(e) { - showTooltipFor(e, labels, inner); - }); - - return marker; - } - - function getMaxSeverity(a, b) { - if (a == "error") return a; - else return b; - } - - function groupByLine(annotations) { - var lines = []; - for (var i = 0; i < annotations.length; ++i) { - var ann = annotations[i], line = ann.from.line; - (lines[line] || (lines[line] = [])).push(ann); - } - return lines; - } - - function annotationTooltip(ann) { - var severity = ann.severity; - if (!severity) severity = "error"; - var tip = document.createElement("div"); - tip.className = "CodeMirror-lint-message-" + severity; - tip.appendChild(document.createTextNode(ann.message)); - return tip; - } - - function startLinting(cm) { - var state = cm.state.lint, options = state.options; - var passOptions = options.options || options; // Support deprecated passing of `options` property in options - if (options.async || options.getAnnotations.async) - options.getAnnotations(cm.getValue(), updateLinting, passOptions, cm); - else - updateLinting(cm, options.getAnnotations(cm.getValue(), passOptions, cm)); - } - - function updateLinting(cm, annotationsNotSorted) { - clearMarks(cm); - var state = cm.state.lint, options = state.options; - - var annotations = groupByLine(annotationsNotSorted); - - for (var line = 0; line < annotations.length; ++line) { - var anns = annotations[line]; - if (!anns) continue; - - var maxSeverity = null; - var tipLabel = state.hasGutter && document.createDocumentFragment(); - - for (var i = 0; i < anns.length; ++i) { - var ann = anns[i]; - var severity = ann.severity; - if (!severity) severity = "error"; - maxSeverity = getMaxSeverity(maxSeverity, severity); - - if (options.formatAnnotation) ann = options.formatAnnotation(ann); - if (state.hasGutter) tipLabel.appendChild(annotationTooltip(ann)); - - if (ann.to) state.marked.push(cm.markText(ann.from, ann.to, { - className: "CodeMirror-lint-mark-" + severity, - __annotation: ann - })); - } - - if (state.hasGutter) - cm.setGutterMarker(line, GUTTER_ID, makeMarker(tipLabel, maxSeverity, anns.length > 1, - state.options.tooltips)); - } - if (options.onUpdateLinting) options.onUpdateLinting(annotationsNotSorted, annotations, cm); - } - - function onChange(cm) { - var state = cm.state.lint; - clearTimeout(state.timeout); - state.timeout = setTimeout(function(){startLinting(cm);}, state.options.delay || 500); - } - - function popupSpanTooltip(ann, e) { - var target = e.target || e.srcElement; - showTooltipFor(e, annotationTooltip(ann), target); - } - - function onMouseOver(cm, e) { - var target = e.target || e.srcElement; - if (!/\bCodeMirror-lint-mark-/.test(target.className)) return; - var box = target.getBoundingClientRect(), x = (box.left + box.right) / 2, y = (box.top + box.bottom) / 2; - var spans = cm.findMarksAt(cm.coordsChar({left: x, top: y}, "client")); - for (var i = 0; i < spans.length; ++i) { - var ann = spans[i].__annotation; - if (ann) return popupSpanTooltip(ann, e); - } - } - - CodeMirror.defineOption("lint", false, function(cm, val, old) { - if (old && old != CodeMirror.Init) { - clearMarks(cm); - cm.off("change", onChange); - CodeMirror.off(cm.getWrapperElement(), "mouseover", cm.state.lint.onMouseOver); - delete cm.state.lint; - } - - if (val) { - var gutters = cm.getOption("gutters"), hasLintGutter = false; - for (var i = 0; i < gutters.length; ++i) if (gutters[i] == GUTTER_ID) hasLintGutter = true; - var state = cm.state.lint = new LintState(cm, parseOptions(cm, val), hasLintGutter); - cm.on("change", onChange); - if (state.options.tooltips != false) - CodeMirror.on(cm.getWrapperElement(), "mouseover", state.onMouseOver); - - startLinting(cm); - } - }); -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/lint/yaml-lint.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/lint/yaml-lint.js deleted file mode 100644 index 3f77e52..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/lint/yaml-lint.js +++ /dev/null @@ -1,28 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -// Depends on js-yaml.js from https://github.com/nodeca/js-yaml - -// declare global: jsyaml - -CodeMirror.registerHelper("lint", "yaml", function(text) { - var found = []; - try { jsyaml.load(text); } - catch(e) { - var loc = e.mark; - found.push({ from: CodeMirror.Pos(loc.line, loc.column), to: CodeMirror.Pos(loc.line, loc.column), message: e.message }); - } - return found; -}); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/merge/merge.css b/src/main/resources/static/editor.md-master/lib/codemirror/addon/merge/merge.css deleted file mode 100644 index a6a80e4..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/merge/merge.css +++ /dev/null @@ -1,112 +0,0 @@ -.CodeMirror-merge { - position: relative; - border: 1px solid #ddd; - white-space: pre; -} - -.CodeMirror-merge, .CodeMirror-merge .CodeMirror { - height: 350px; -} - -.CodeMirror-merge-2pane .CodeMirror-merge-pane { width: 47%; } -.CodeMirror-merge-2pane .CodeMirror-merge-gap { width: 6%; } -.CodeMirror-merge-3pane .CodeMirror-merge-pane { width: 31%; } -.CodeMirror-merge-3pane .CodeMirror-merge-gap { width: 3.5%; } - -.CodeMirror-merge-pane { - display: inline-block; - white-space: normal; - vertical-align: top; -} -.CodeMirror-merge-pane-rightmost { - position: absolute; - right: 0px; - z-index: 1; -} - -.CodeMirror-merge-gap { - z-index: 2; - display: inline-block; - height: 100%; - -moz-box-sizing: border-box; - box-sizing: border-box; - overflow: hidden; - border-left: 1px solid #ddd; - border-right: 1px solid #ddd; - position: relative; - background: #f8f8f8; -} - -.CodeMirror-merge-scrolllock-wrap { - position: absolute; - bottom: 0; left: 50%; -} -.CodeMirror-merge-scrolllock { - position: relative; - left: -50%; - cursor: pointer; - color: #555; - line-height: 1; -} - -.CodeMirror-merge-copybuttons-left, .CodeMirror-merge-copybuttons-right { - position: absolute; - left: 0; top: 0; - right: 0; bottom: 0; - line-height: 1; -} - -.CodeMirror-merge-copy { - position: absolute; - cursor: pointer; - color: #44c; -} - -.CodeMirror-merge-copy-reverse { - position: absolute; - cursor: pointer; - color: #44c; -} - -.CodeMirror-merge-copybuttons-left .CodeMirror-merge-copy { left: 2px; } -.CodeMirror-merge-copybuttons-right .CodeMirror-merge-copy { right: 2px; } - -.CodeMirror-merge-r-inserted, .CodeMirror-merge-l-inserted { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAGUlEQVQI12MwuCXy3+CWyH8GBgYGJgYkAABZbAQ9ELXurwAAAABJRU5ErkJggg==); - background-position: bottom left; - background-repeat: repeat-x; -} - -.CodeMirror-merge-r-deleted, .CodeMirror-merge-l-deleted { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAGUlEQVQI12M4Kyb2/6yY2H8GBgYGJgYkAABURgPz6Ks7wQAAAABJRU5ErkJggg==); - background-position: bottom left; - background-repeat: repeat-x; -} - -.CodeMirror-merge-r-chunk { background: #ffffe0; } -.CodeMirror-merge-r-chunk-start { border-top: 1px solid #ee8; } -.CodeMirror-merge-r-chunk-end { border-bottom: 1px solid #ee8; } -.CodeMirror-merge-r-connect { fill: #ffffe0; stroke: #ee8; stroke-width: 1px; } - -.CodeMirror-merge-l-chunk { background: #eef; } -.CodeMirror-merge-l-chunk-start { border-top: 1px solid #88e; } -.CodeMirror-merge-l-chunk-end { border-bottom: 1px solid #88e; } -.CodeMirror-merge-l-connect { fill: #eef; stroke: #88e; stroke-width: 1px; } - -.CodeMirror-merge-l-chunk.CodeMirror-merge-r-chunk { background: #dfd; } -.CodeMirror-merge-l-chunk-start.CodeMirror-merge-r-chunk-start { border-top: 1px solid #4e4; } -.CodeMirror-merge-l-chunk-end.CodeMirror-merge-r-chunk-end { border-bottom: 1px solid #4e4; } - -.CodeMirror-merge-collapsed-widget:before { - content: "(...)"; -} -.CodeMirror-merge-collapsed-widget { - cursor: pointer; - color: #88b; - background: #eef; - border: 1px solid #ddf; - font-size: 90%; - padding: 0 3px; - border-radius: 4px; -} -.CodeMirror-merge-collapsed-line .CodeMirror-gutter-elt { display: none; } diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/merge/merge.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/merge/merge.js deleted file mode 100644 index f1f3aaf..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/merge/merge.js +++ /dev/null @@ -1,735 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// declare global: diff_match_patch, DIFF_INSERT, DIFF_DELETE, DIFF_EQUAL - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("diff_match_patch")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "diff_match_patch"], mod); - else // Plain browser env - mod(CodeMirror, diff_match_patch); -})(function(CodeMirror, diff_match_patch) { - "use strict"; - var Pos = CodeMirror.Pos; - var svgNS = "http://www.w3.org/2000/svg"; - - function DiffView(mv, type) { - this.mv = mv; - this.type = type; - this.classes = type == "left" - ? {chunk: "CodeMirror-merge-l-chunk", - start: "CodeMirror-merge-l-chunk-start", - end: "CodeMirror-merge-l-chunk-end", - insert: "CodeMirror-merge-l-inserted", - del: "CodeMirror-merge-l-deleted", - connect: "CodeMirror-merge-l-connect"} - : {chunk: "CodeMirror-merge-r-chunk", - start: "CodeMirror-merge-r-chunk-start", - end: "CodeMirror-merge-r-chunk-end", - insert: "CodeMirror-merge-r-inserted", - del: "CodeMirror-merge-r-deleted", - connect: "CodeMirror-merge-r-connect"}; - } - - DiffView.prototype = { - constructor: DiffView, - init: function(pane, orig, options) { - this.edit = this.mv.edit; - this.orig = CodeMirror(pane, copyObj({value: orig, readOnly: !this.mv.options.allowEditingOriginals}, copyObj(options))); - - this.diff = getDiff(asString(orig), asString(options.value)); - this.chunks = getChunks(this.diff); - this.diffOutOfDate = this.dealigned = false; - - this.showDifferences = options.showDifferences !== false; - this.forceUpdate = registerUpdate(this); - setScrollLock(this, true, false); - registerScroll(this); - }, - setShowDifferences: function(val) { - val = val !== false; - if (val != this.showDifferences) { - this.showDifferences = val; - this.forceUpdate("full"); - } - } - }; - - function ensureDiff(dv) { - if (dv.diffOutOfDate) { - dv.diff = getDiff(dv.orig.getValue(), dv.edit.getValue()); - dv.chunks = getChunks(dv.diff); - dv.diffOutOfDate = false; - CodeMirror.signal(dv.edit, "updateDiff", dv.diff); - } - } - - var updating = false; - function registerUpdate(dv) { - var edit = {from: 0, to: 0, marked: []}; - var orig = {from: 0, to: 0, marked: []}; - var debounceChange, updatingFast = false; - function update(mode) { - updating = true; - updatingFast = false; - if (mode == "full") { - if (dv.svg) clear(dv.svg); - if (dv.copyButtons) clear(dv.copyButtons); - clearMarks(dv.edit, edit.marked, dv.classes); - clearMarks(dv.orig, orig.marked, dv.classes); - edit.from = edit.to = orig.from = orig.to = 0; - } - ensureDiff(dv); - if (dv.showDifferences) { - updateMarks(dv.edit, dv.diff, edit, DIFF_INSERT, dv.classes); - updateMarks(dv.orig, dv.diff, orig, DIFF_DELETE, dv.classes); - } - makeConnections(dv); - - if (dv.mv.options.connect == "align") - alignChunks(dv); - updating = false; - } - function setDealign(fast) { - if (updating) return; - dv.dealigned = true; - set(fast); - } - function set(fast) { - if (updating || updatingFast) return; - clearTimeout(debounceChange); - if (fast === true) updatingFast = true; - debounceChange = setTimeout(update, fast === true ? 20 : 250); - } - function change(_cm, change) { - if (!dv.diffOutOfDate) { - dv.diffOutOfDate = true; - edit.from = edit.to = orig.from = orig.to = 0; - } - // Update faster when a line was added/removed - setDealign(change.text.length - 1 != change.to.line - change.from.line); - } - dv.edit.on("change", change); - dv.orig.on("change", change); - dv.edit.on("markerAdded", setDealign); - dv.edit.on("markerCleared", setDealign); - dv.orig.on("markerAdded", setDealign); - dv.orig.on("markerCleared", setDealign); - dv.edit.on("viewportChange", function() { set(false); }); - dv.orig.on("viewportChange", function() { set(false); }); - update(); - return update; - } - - function registerScroll(dv) { - dv.edit.on("scroll", function() { - syncScroll(dv, DIFF_INSERT) && makeConnections(dv); - }); - dv.orig.on("scroll", function() { - syncScroll(dv, DIFF_DELETE) && makeConnections(dv); - }); - } - - function syncScroll(dv, type) { - // Change handler will do a refresh after a timeout when diff is out of date - if (dv.diffOutOfDate) return false; - if (!dv.lockScroll) return true; - var editor, other, now = +new Date; - if (type == DIFF_INSERT) { editor = dv.edit; other = dv.orig; } - else { editor = dv.orig; other = dv.edit; } - // Don't take action if the position of this editor was recently set - // (to prevent feedback loops) - if (editor.state.scrollSetBy == dv && (editor.state.scrollSetAt || 0) + 50 > now) return false; - - var sInfo = editor.getScrollInfo(); - if (dv.mv.options.connect == "align") { - targetPos = sInfo.top; - } else { - var halfScreen = .5 * sInfo.clientHeight, midY = sInfo.top + halfScreen; - var mid = editor.lineAtHeight(midY, "local"); - var around = chunkBoundariesAround(dv.chunks, mid, type == DIFF_INSERT); - var off = getOffsets(editor, type == DIFF_INSERT ? around.edit : around.orig); - var offOther = getOffsets(other, type == DIFF_INSERT ? around.orig : around.edit); - var ratio = (midY - off.top) / (off.bot - off.top); - var targetPos = (offOther.top - halfScreen) + ratio * (offOther.bot - offOther.top); - - var botDist, mix; - // Some careful tweaking to make sure no space is left out of view - // when scrolling to top or bottom. - if (targetPos > sInfo.top && (mix = sInfo.top / halfScreen) < 1) { - targetPos = targetPos * mix + sInfo.top * (1 - mix); - } else if ((botDist = sInfo.height - sInfo.clientHeight - sInfo.top) < halfScreen) { - var otherInfo = other.getScrollInfo(); - var botDistOther = otherInfo.height - otherInfo.clientHeight - targetPos; - if (botDistOther > botDist && (mix = botDist / halfScreen) < 1) - targetPos = targetPos * mix + (otherInfo.height - otherInfo.clientHeight - botDist) * (1 - mix); - } - } - - other.scrollTo(sInfo.left, targetPos); - other.state.scrollSetAt = now; - other.state.scrollSetBy = dv; - return true; - } - - function getOffsets(editor, around) { - var bot = around.after; - if (bot == null) bot = editor.lastLine() + 1; - return {top: editor.heightAtLine(around.before || 0, "local"), - bot: editor.heightAtLine(bot, "local")}; - } - - function setScrollLock(dv, val, action) { - dv.lockScroll = val; - if (val && action != false) syncScroll(dv, DIFF_INSERT) && makeConnections(dv); - dv.lockButton.innerHTML = val ? "\u21db\u21da" : "\u21db  \u21da"; - } - - // Updating the marks for editor content - - function clearMarks(editor, arr, classes) { - for (var i = 0; i < arr.length; ++i) { - var mark = arr[i]; - if (mark instanceof CodeMirror.TextMarker) { - mark.clear(); - } else if (mark.parent) { - editor.removeLineClass(mark, "background", classes.chunk); - editor.removeLineClass(mark, "background", classes.start); - editor.removeLineClass(mark, "background", classes.end); - } - } - arr.length = 0; - } - - // FIXME maybe add a margin around viewport to prevent too many updates - function updateMarks(editor, diff, state, type, classes) { - var vp = editor.getViewport(); - editor.operation(function() { - if (state.from == state.to || vp.from - state.to > 20 || state.from - vp.to > 20) { - clearMarks(editor, state.marked, classes); - markChanges(editor, diff, type, state.marked, vp.from, vp.to, classes); - state.from = vp.from; state.to = vp.to; - } else { - if (vp.from < state.from) { - markChanges(editor, diff, type, state.marked, vp.from, state.from, classes); - state.from = vp.from; - } - if (vp.to > state.to) { - markChanges(editor, diff, type, state.marked, state.to, vp.to, classes); - state.to = vp.to; - } - } - }); - } - - function markChanges(editor, diff, type, marks, from, to, classes) { - var pos = Pos(0, 0); - var top = Pos(from, 0), bot = editor.clipPos(Pos(to - 1)); - var cls = type == DIFF_DELETE ? classes.del : classes.insert; - function markChunk(start, end) { - var bfrom = Math.max(from, start), bto = Math.min(to, end); - for (var i = bfrom; i < bto; ++i) { - var line = editor.addLineClass(i, "background", classes.chunk); - if (i == start) editor.addLineClass(line, "background", classes.start); - if (i == end - 1) editor.addLineClass(line, "background", classes.end); - marks.push(line); - } - // When the chunk is empty, make sure a horizontal line shows up - if (start == end && bfrom == end && bto == end) { - if (bfrom) - marks.push(editor.addLineClass(bfrom - 1, "background", classes.end)); - else - marks.push(editor.addLineClass(bfrom, "background", classes.start)); - } - } - - var chunkStart = 0; - for (var i = 0; i < diff.length; ++i) { - var part = diff[i], tp = part[0], str = part[1]; - if (tp == DIFF_EQUAL) { - var cleanFrom = pos.line + (startOfLineClean(diff, i) ? 0 : 1); - moveOver(pos, str); - var cleanTo = pos.line + (endOfLineClean(diff, i) ? 1 : 0); - if (cleanTo > cleanFrom) { - if (i) markChunk(chunkStart, cleanFrom); - chunkStart = cleanTo; - } - } else { - if (tp == type) { - var end = moveOver(pos, str, true); - var a = posMax(top, pos), b = posMin(bot, end); - if (!posEq(a, b)) - marks.push(editor.markText(a, b, {className: cls})); - pos = end; - } - } - } - if (chunkStart <= pos.line) markChunk(chunkStart, pos.line + 1); - } - - // Updating the gap between editor and original - - function makeConnections(dv) { - if (!dv.showDifferences) return; - - if (dv.svg) { - clear(dv.svg); - var w = dv.gap.offsetWidth; - attrs(dv.svg, "width", w, "height", dv.gap.offsetHeight); - } - if (dv.copyButtons) clear(dv.copyButtons); - - var vpEdit = dv.edit.getViewport(), vpOrig = dv.orig.getViewport(); - var sTopEdit = dv.edit.getScrollInfo().top, sTopOrig = dv.orig.getScrollInfo().top; - for (var i = 0; i < dv.chunks.length; i++) { - var ch = dv.chunks[i]; - if (ch.editFrom <= vpEdit.to && ch.editTo >= vpEdit.from && - ch.origFrom <= vpOrig.to && ch.origTo >= vpOrig.from) - drawConnectorsForChunk(dv, ch, sTopOrig, sTopEdit, w); - } - } - - function getMatchingOrigLine(editLine, chunks) { - var editStart = 0, origStart = 0; - for (var i = 0; i < chunks.length; i++) { - var chunk = chunks[i]; - if (chunk.editTo > editLine && chunk.editFrom <= editLine) return null; - if (chunk.editFrom > editLine) break; - editStart = chunk.editTo; - origStart = chunk.origTo; - } - return origStart + (editLine - editStart); - } - - function findAlignedLines(dv, other) { - var linesToAlign = []; - for (var i = 0; i < dv.chunks.length; i++) { - var chunk = dv.chunks[i]; - linesToAlign.push([chunk.origTo, chunk.editTo, other ? getMatchingOrigLine(chunk.editTo, other.chunks) : null]); - } - if (other) { - for (var i = 0; i < other.chunks.length; i++) { - var chunk = other.chunks[i]; - for (var j = 0; j < linesToAlign.length; j++) { - var align = linesToAlign[j]; - if (align[1] == chunk.editTo) { - j = -1; - break; - } else if (align[1] > chunk.editTo) { - break; - } - } - if (j > -1) - linesToAlign.splice(j - 1, 0, [getMatchingOrigLine(chunk.editTo, dv.chunks), chunk.editTo, chunk.origTo]); - } - } - return linesToAlign; - } - - function alignChunks(dv, force) { - if (!dv.dealigned && !force) return; - if (!dv.orig.curOp) return dv.orig.operation(function() { - alignChunks(dv, force); - }); - - dv.dealigned = false; - var other = dv.mv.left == dv ? dv.mv.right : dv.mv.left; - if (other) { - ensureDiff(other); - other.dealigned = false; - } - var linesToAlign = findAlignedLines(dv, other); - - // Clear old aligners - var aligners = dv.mv.aligners; - for (var i = 0; i < aligners.length; i++) - aligners[i].clear(); - aligners.length = 0; - - var cm = [dv.orig, dv.edit], scroll = []; - if (other) cm.push(other.orig); - for (var i = 0; i < cm.length; i++) - scroll.push(cm[i].getScrollInfo().top); - - for (var ln = 0; ln < linesToAlign.length; ln++) - alignLines(cm, linesToAlign[ln], aligners); - - for (var i = 0; i < cm.length; i++) - cm[i].scrollTo(null, scroll[i]); - } - - function alignLines(cm, lines, aligners) { - var maxOffset = 0, offset = []; - for (var i = 0; i < cm.length; i++) if (lines[i] != null) { - var off = cm[i].heightAtLine(lines[i], "local"); - offset[i] = off; - maxOffset = Math.max(maxOffset, off); - } - for (var i = 0; i < cm.length; i++) if (lines[i] != null) { - var diff = maxOffset - offset[i]; - if (diff > 1) - aligners.push(padAbove(cm[i], lines[i], diff)); - } - } - - function padAbove(cm, line, size) { - var above = true; - if (line > cm.lastLine()) { - line--; - above = false; - } - var elt = document.createElement("div"); - elt.className = "CodeMirror-merge-spacer"; - elt.style.height = size + "px"; elt.style.minWidth = "1px"; - return cm.addLineWidget(line, elt, {height: size, above: above}); - } - - function drawConnectorsForChunk(dv, chunk, sTopOrig, sTopEdit, w) { - var flip = dv.type == "left"; - var top = dv.orig.heightAtLine(chunk.origFrom, "local") - sTopOrig; - if (dv.svg) { - var topLpx = top; - var topRpx = dv.edit.heightAtLine(chunk.editFrom, "local") - sTopEdit; - if (flip) { var tmp = topLpx; topLpx = topRpx; topRpx = tmp; } - var botLpx = dv.orig.heightAtLine(chunk.origTo, "local") - sTopOrig; - var botRpx = dv.edit.heightAtLine(chunk.editTo, "local") - sTopEdit; - if (flip) { var tmp = botLpx; botLpx = botRpx; botRpx = tmp; } - var curveTop = " C " + w/2 + " " + topRpx + " " + w/2 + " " + topLpx + " " + (w + 2) + " " + topLpx; - var curveBot = " C " + w/2 + " " + botLpx + " " + w/2 + " " + botRpx + " -1 " + botRpx; - attrs(dv.svg.appendChild(document.createElementNS(svgNS, "path")), - "d", "M -1 " + topRpx + curveTop + " L " + (w + 2) + " " + botLpx + curveBot + " z", - "class", dv.classes.connect); - } - if (dv.copyButtons) { - var copy = dv.copyButtons.appendChild(elt("div", dv.type == "left" ? "\u21dd" : "\u21dc", - "CodeMirror-merge-copy")); - var editOriginals = dv.mv.options.allowEditingOriginals; - copy.title = editOriginals ? "Push to left" : "Revert chunk"; - copy.chunk = chunk; - copy.style.top = top + "px"; - - if (editOriginals) { - var topReverse = dv.orig.heightAtLine(chunk.editFrom, "local") - sTopEdit; - var copyReverse = dv.copyButtons.appendChild(elt("div", dv.type == "right" ? "\u21dd" : "\u21dc", - "CodeMirror-merge-copy-reverse")); - copyReverse.title = "Push to right"; - copyReverse.chunk = {editFrom: chunk.origFrom, editTo: chunk.origTo, - origFrom: chunk.editFrom, origTo: chunk.editTo}; - copyReverse.style.top = topReverse + "px"; - dv.type == "right" ? copyReverse.style.left = "2px" : copyReverse.style.right = "2px"; - } - } - } - - function copyChunk(dv, to, from, chunk) { - if (dv.diffOutOfDate) return; - to.replaceRange(from.getRange(Pos(chunk.origFrom, 0), Pos(chunk.origTo, 0)), - Pos(chunk.editFrom, 0), Pos(chunk.editTo, 0)); - } - - // Merge view, containing 0, 1, or 2 diff views. - - var MergeView = CodeMirror.MergeView = function(node, options) { - if (!(this instanceof MergeView)) return new MergeView(node, options); - - this.options = options; - var origLeft = options.origLeft, origRight = options.origRight == null ? options.orig : options.origRight; - - var hasLeft = origLeft != null, hasRight = origRight != null; - var panes = 1 + (hasLeft ? 1 : 0) + (hasRight ? 1 : 0); - var wrap = [], left = this.left = null, right = this.right = null; - var self = this; - - if (hasLeft) { - left = this.left = new DiffView(this, "left"); - var leftPane = elt("div", null, "CodeMirror-merge-pane"); - wrap.push(leftPane); - wrap.push(buildGap(left)); - } - - var editPane = elt("div", null, "CodeMirror-merge-pane"); - wrap.push(editPane); - - if (hasRight) { - right = this.right = new DiffView(this, "right"); - wrap.push(buildGap(right)); - var rightPane = elt("div", null, "CodeMirror-merge-pane"); - wrap.push(rightPane); - } - - (hasRight ? rightPane : editPane).className += " CodeMirror-merge-pane-rightmost"; - - wrap.push(elt("div", null, null, "height: 0; clear: both;")); - - var wrapElt = this.wrap = node.appendChild(elt("div", wrap, "CodeMirror-merge CodeMirror-merge-" + panes + "pane")); - this.edit = CodeMirror(editPane, copyObj(options)); - - if (left) left.init(leftPane, origLeft, options); - if (right) right.init(rightPane, origRight, options); - - if (options.collapseIdentical) { - updating = true; - this.editor().operation(function() { - collapseIdenticalStretches(self, options.collapseIdentical); - }); - updating = false; - } - if (options.connect == "align") { - this.aligners = []; - alignChunks(this.left || this.right, true); - } - - var onResize = function() { - if (left) makeConnections(left); - if (right) makeConnections(right); - }; - CodeMirror.on(window, "resize", onResize); - var resizeInterval = setInterval(function() { - for (var p = wrapElt.parentNode; p && p != document.body; p = p.parentNode) {} - if (!p) { clearInterval(resizeInterval); CodeMirror.off(window, "resize", onResize); } - }, 5000); - }; - - function buildGap(dv) { - var lock = dv.lockButton = elt("div", null, "CodeMirror-merge-scrolllock"); - lock.title = "Toggle locked scrolling"; - var lockWrap = elt("div", [lock], "CodeMirror-merge-scrolllock-wrap"); - CodeMirror.on(lock, "click", function() { setScrollLock(dv, !dv.lockScroll); }); - var gapElts = [lockWrap]; - if (dv.mv.options.revertButtons !== false) { - dv.copyButtons = elt("div", null, "CodeMirror-merge-copybuttons-" + dv.type); - CodeMirror.on(dv.copyButtons, "click", function(e) { - var node = e.target || e.srcElement; - if (!node.chunk) return; - if (node.className == "CodeMirror-merge-copy-reverse") { - copyChunk(dv, dv.orig, dv.edit, node.chunk); - return; - } - copyChunk(dv, dv.edit, dv.orig, node.chunk); - }); - gapElts.unshift(dv.copyButtons); - } - if (dv.mv.options.connect != "align") { - var svg = document.createElementNS && document.createElementNS(svgNS, "svg"); - if (svg && !svg.createSVGRect) svg = null; - dv.svg = svg; - if (svg) gapElts.push(svg); - } - - return dv.gap = elt("div", gapElts, "CodeMirror-merge-gap"); - } - - MergeView.prototype = { - constuctor: MergeView, - editor: function() { return this.edit; }, - rightOriginal: function() { return this.right && this.right.orig; }, - leftOriginal: function() { return this.left && this.left.orig; }, - setShowDifferences: function(val) { - if (this.right) this.right.setShowDifferences(val); - if (this.left) this.left.setShowDifferences(val); - }, - rightChunks: function() { - if (this.right) { ensureDiff(this.right); return this.right.chunks; } - }, - leftChunks: function() { - if (this.left) { ensureDiff(this.left); return this.left.chunks; } - } - }; - - function asString(obj) { - if (typeof obj == "string") return obj; - else return obj.getValue(); - } - - // Operations on diffs - - var dmp = new diff_match_patch(); - function getDiff(a, b) { - var diff = dmp.diff_main(a, b); - dmp.diff_cleanupSemantic(diff); - // The library sometimes leaves in empty parts, which confuse the algorithm - for (var i = 0; i < diff.length; ++i) { - var part = diff[i]; - if (!part[1]) { - diff.splice(i--, 1); - } else if (i && diff[i - 1][0] == part[0]) { - diff.splice(i--, 1); - diff[i][1] += part[1]; - } - } - return diff; - } - - function getChunks(diff) { - var chunks = []; - var startEdit = 0, startOrig = 0; - var edit = Pos(0, 0), orig = Pos(0, 0); - for (var i = 0; i < diff.length; ++i) { - var part = diff[i], tp = part[0]; - if (tp == DIFF_EQUAL) { - var startOff = startOfLineClean(diff, i) ? 0 : 1; - var cleanFromEdit = edit.line + startOff, cleanFromOrig = orig.line + startOff; - moveOver(edit, part[1], null, orig); - var endOff = endOfLineClean(diff, i) ? 1 : 0; - var cleanToEdit = edit.line + endOff, cleanToOrig = orig.line + endOff; - if (cleanToEdit > cleanFromEdit) { - if (i) chunks.push({origFrom: startOrig, origTo: cleanFromOrig, - editFrom: startEdit, editTo: cleanFromEdit}); - startEdit = cleanToEdit; startOrig = cleanToOrig; - } - } else { - moveOver(tp == DIFF_INSERT ? edit : orig, part[1]); - } - } - if (startEdit <= edit.line || startOrig <= orig.line) - chunks.push({origFrom: startOrig, origTo: orig.line + 1, - editFrom: startEdit, editTo: edit.line + 1}); - return chunks; - } - - function endOfLineClean(diff, i) { - if (i == diff.length - 1) return true; - var next = diff[i + 1][1]; - if (next.length == 1 || next.charCodeAt(0) != 10) return false; - if (i == diff.length - 2) return true; - next = diff[i + 2][1]; - return next.length > 1 && next.charCodeAt(0) == 10; - } - - function startOfLineClean(diff, i) { - if (i == 0) return true; - var last = diff[i - 1][1]; - if (last.charCodeAt(last.length - 1) != 10) return false; - if (i == 1) return true; - last = diff[i - 2][1]; - return last.charCodeAt(last.length - 1) == 10; - } - - function chunkBoundariesAround(chunks, n, nInEdit) { - var beforeE, afterE, beforeO, afterO; - for (var i = 0; i < chunks.length; i++) { - var chunk = chunks[i]; - var fromLocal = nInEdit ? chunk.editFrom : chunk.origFrom; - var toLocal = nInEdit ? chunk.editTo : chunk.origTo; - if (afterE == null) { - if (fromLocal > n) { afterE = chunk.editFrom; afterO = chunk.origFrom; } - else if (toLocal > n) { afterE = chunk.editTo; afterO = chunk.origTo; } - } - if (toLocal <= n) { beforeE = chunk.editTo; beforeO = chunk.origTo; } - else if (fromLocal <= n) { beforeE = chunk.editFrom; beforeO = chunk.origFrom; } - } - return {edit: {before: beforeE, after: afterE}, orig: {before: beforeO, after: afterO}}; - } - - function collapseSingle(cm, from, to) { - cm.addLineClass(from, "wrap", "CodeMirror-merge-collapsed-line"); - var widget = document.createElement("span"); - widget.className = "CodeMirror-merge-collapsed-widget"; - widget.title = "Identical text collapsed. Click to expand."; - var mark = cm.markText(Pos(from, 0), Pos(to - 1), { - inclusiveLeft: true, - inclusiveRight: true, - replacedWith: widget, - clearOnEnter: true - }); - function clear() { - mark.clear(); - cm.removeLineClass(from, "wrap", "CodeMirror-merge-collapsed-line"); - } - widget.addEventListener("click", clear); - return {mark: mark, clear: clear}; - } - - function collapseStretch(size, editors) { - var marks = []; - function clear() { - for (var i = 0; i < marks.length; i++) marks[i].clear(); - } - for (var i = 0; i < editors.length; i++) { - var editor = editors[i]; - var mark = collapseSingle(editor.cm, editor.line, editor.line + size); - marks.push(mark); - mark.mark.on("clear", clear); - } - return marks[0].mark; - } - - function unclearNearChunks(dv, margin, off, clear) { - for (var i = 0; i < dv.chunks.length; i++) { - var chunk = dv.chunks[i]; - for (var l = chunk.editFrom - margin; l < chunk.editTo + margin; l++) { - var pos = l + off; - if (pos >= 0 && pos < clear.length) clear[pos] = false; - } - } - } - - function collapseIdenticalStretches(mv, margin) { - if (typeof margin != "number") margin = 2; - var clear = [], edit = mv.editor(), off = edit.firstLine(); - for (var l = off, e = edit.lastLine(); l <= e; l++) clear.push(true); - if (mv.left) unclearNearChunks(mv.left, margin, off, clear); - if (mv.right) unclearNearChunks(mv.right, margin, off, clear); - - for (var i = 0; i < clear.length; i++) { - if (clear[i]) { - var line = i + off; - for (var size = 1; i < clear.length - 1 && clear[i + 1]; i++, size++) {} - if (size > margin) { - var editors = [{line: line, cm: edit}]; - if (mv.left) editors.push({line: getMatchingOrigLine(line, mv.left.chunks), cm: mv.left.orig}); - if (mv.right) editors.push({line: getMatchingOrigLine(line, mv.right.chunks), cm: mv.right.orig}); - var mark = collapseStretch(size, editors); - if (mv.options.onCollapse) mv.options.onCollapse(mv, line, size, mark); - } - } - } - } - - // General utilities - - function elt(tag, content, className, style) { - var e = document.createElement(tag); - if (className) e.className = className; - if (style) e.style.cssText = style; - if (typeof content == "string") e.appendChild(document.createTextNode(content)); - else if (content) for (var i = 0; i < content.length; ++i) e.appendChild(content[i]); - return e; - } - - function clear(node) { - for (var count = node.childNodes.length; count > 0; --count) - node.removeChild(node.firstChild); - } - - function attrs(elt) { - for (var i = 1; i < arguments.length; i += 2) - elt.setAttribute(arguments[i], arguments[i+1]); - } - - function copyObj(obj, target) { - if (!target) target = {}; - for (var prop in obj) if (obj.hasOwnProperty(prop)) target[prop] = obj[prop]; - return target; - } - - function moveOver(pos, str, copy, other) { - var out = copy ? Pos(pos.line, pos.ch) : pos, at = 0; - for (;;) { - var nl = str.indexOf("\n", at); - if (nl == -1) break; - ++out.line; - if (other) ++other.line; - at = nl + 1; - } - out.ch = (at ? 0 : out.ch) + (str.length - at); - if (other) other.ch = (at ? 0 : other.ch) + (str.length - at); - return out; - } - - function posMin(a, b) { return (a.line - b.line || a.ch - b.ch) < 0 ? a : b; } - function posMax(a, b) { return (a.line - b.line || a.ch - b.ch) > 0 ? a : b; } - function posEq(a, b) { return a.line == b.line && a.ch == b.ch; } -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/mode/loadmode.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/mode/loadmode.js deleted file mode 100644 index 10117ec..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/mode/loadmode.js +++ /dev/null @@ -1,64 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), "cjs"); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], function(CM) { mod(CM, "amd"); }); - else // Plain browser env - mod(CodeMirror, "plain"); -})(function(CodeMirror, env) { - if (!CodeMirror.modeURL) CodeMirror.modeURL = "../mode/%N/%N.js"; - - var loading = {}; - function splitCallback(cont, n) { - var countDown = n; - return function() { if (--countDown == 0) cont(); }; - } - function ensureDeps(mode, cont) { - var deps = CodeMirror.modes[mode].dependencies; - if (!deps) return cont(); - var missing = []; - for (var i = 0; i < deps.length; ++i) { - if (!CodeMirror.modes.hasOwnProperty(deps[i])) - missing.push(deps[i]); - } - if (!missing.length) return cont(); - var split = splitCallback(cont, missing.length); - for (var i = 0; i < missing.length; ++i) - CodeMirror.requireMode(missing[i], split); - } - - CodeMirror.requireMode = function(mode, cont) { - if (typeof mode != "string") mode = mode.name; - if (CodeMirror.modes.hasOwnProperty(mode)) return ensureDeps(mode, cont); - if (loading.hasOwnProperty(mode)) return loading[mode].push(cont); - - var file = CodeMirror.modeURL.replace(/%N/g, mode); - if (env == "plain") { - var script = document.createElement("script"); - script.src = file; - var others = document.getElementsByTagName("script")[0]; - var list = loading[mode] = [cont]; - CodeMirror.on(script, "load", function() { - ensureDeps(mode, function() { - for (var i = 0; i < list.length; ++i) list[i](); - }); - }); - others.parentNode.insertBefore(script, others); - } else if (env == "cjs") { - require(file); - cont(); - } else if (env == "amd") { - requirejs([file], cont); - } - }; - - CodeMirror.autoLoadMode = function(instance, mode) { - if (!CodeMirror.modes.hasOwnProperty(mode)) - CodeMirror.requireMode(mode, function() { - instance.setOption("mode", instance.getOption("mode")); - }); - }; -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/mode/multiplex.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/mode/multiplex.js deleted file mode 100644 index 6a95b32..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/mode/multiplex.js +++ /dev/null @@ -1,118 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.multiplexingMode = function(outer /*, others */) { - // Others should be {open, close, mode [, delimStyle] [, innerStyle]} objects - var others = Array.prototype.slice.call(arguments, 1); - var n_others = others.length; - - function indexOf(string, pattern, from) { - if (typeof pattern == "string") return string.indexOf(pattern, from); - var m = pattern.exec(from ? string.slice(from) : string); - return m ? m.index + from : -1; - } - - return { - startState: function() { - return { - outer: CodeMirror.startState(outer), - innerActive: null, - inner: null - }; - }, - - copyState: function(state) { - return { - outer: CodeMirror.copyState(outer, state.outer), - innerActive: state.innerActive, - inner: state.innerActive && CodeMirror.copyState(state.innerActive.mode, state.inner) - }; - }, - - token: function(stream, state) { - if (!state.innerActive) { - var cutOff = Infinity, oldContent = stream.string; - for (var i = 0; i < n_others; ++i) { - var other = others[i]; - var found = indexOf(oldContent, other.open, stream.pos); - if (found == stream.pos) { - stream.match(other.open); - state.innerActive = other; - state.inner = CodeMirror.startState(other.mode, outer.indent ? outer.indent(state.outer, "") : 0); - return other.delimStyle; - } else if (found != -1 && found < cutOff) { - cutOff = found; - } - } - if (cutOff != Infinity) stream.string = oldContent.slice(0, cutOff); - var outerToken = outer.token(stream, state.outer); - if (cutOff != Infinity) stream.string = oldContent; - return outerToken; - } else { - var curInner = state.innerActive, oldContent = stream.string; - if (!curInner.close && stream.sol()) { - state.innerActive = state.inner = null; - return this.token(stream, state); - } - var found = curInner.close ? indexOf(oldContent, curInner.close, stream.pos) : -1; - if (found == stream.pos) { - stream.match(curInner.close); - state.innerActive = state.inner = null; - return curInner.delimStyle; - } - if (found > -1) stream.string = oldContent.slice(0, found); - var innerToken = curInner.mode.token(stream, state.inner); - if (found > -1) stream.string = oldContent; - - if (curInner.innerStyle) { - if (innerToken) innerToken = innerToken + ' ' + curInner.innerStyle; - else innerToken = curInner.innerStyle; - } - - return innerToken; - } - }, - - indent: function(state, textAfter) { - var mode = state.innerActive ? state.innerActive.mode : outer; - if (!mode.indent) return CodeMirror.Pass; - return mode.indent(state.innerActive ? state.inner : state.outer, textAfter); - }, - - blankLine: function(state) { - var mode = state.innerActive ? state.innerActive.mode : outer; - if (mode.blankLine) { - mode.blankLine(state.innerActive ? state.inner : state.outer); - } - if (!state.innerActive) { - for (var i = 0; i < n_others; ++i) { - var other = others[i]; - if (other.open === "\n") { - state.innerActive = other; - state.inner = CodeMirror.startState(other.mode, mode.indent ? mode.indent(state.outer, "") : 0); - } - } - } else if (state.innerActive.close === "\n") { - state.innerActive = state.inner = null; - } - }, - - electricChars: outer.electricChars, - - innerMode: function(state) { - return state.inner ? {state: state.inner, mode: state.innerActive.mode} : {state: state.outer, mode: outer}; - } - }; -}; - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/mode/multiplex_test.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/mode/multiplex_test.js deleted file mode 100644 index d339434..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/mode/multiplex_test.js +++ /dev/null @@ -1,33 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - CodeMirror.defineMode("markdown_with_stex", function(){ - var inner = CodeMirror.getMode({}, "stex"); - var outer = CodeMirror.getMode({}, "markdown"); - - var innerOptions = { - open: '$', - close: '$', - mode: inner, - delimStyle: 'delim', - innerStyle: 'inner' - }; - - return CodeMirror.multiplexingMode(outer, innerOptions); - }); - - var mode = CodeMirror.getMode({}, "markdown_with_stex"); - - function MT(name) { - test.mode( - name, - mode, - Array.prototype.slice.call(arguments, 1), - 'multiplexing'); - } - - MT( - "stexInsideMarkdown", - "[strong **Equation:**] [delim $][inner&tag \\pi][delim $]"); -})(); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/mode/overlay.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/mode/overlay.js deleted file mode 100644 index e1b9ed3..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/mode/overlay.js +++ /dev/null @@ -1,85 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Utility function that allows modes to be combined. The mode given -// as the base argument takes care of most of the normal mode -// functionality, but a second (typically simple) mode is used, which -// can override the style of text. Both modes get to parse all of the -// text, but when both assign a non-null style to a piece of code, the -// overlay wins, unless the combine argument was true and not overridden, -// or state.overlay.combineTokens was true, in which case the styles are -// combined. - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.overlayMode = function(base, overlay, combine) { - return { - startState: function() { - return { - base: CodeMirror.startState(base), - overlay: CodeMirror.startState(overlay), - basePos: 0, baseCur: null, - overlayPos: 0, overlayCur: null, - streamSeen: null - }; - }, - copyState: function(state) { - return { - base: CodeMirror.copyState(base, state.base), - overlay: CodeMirror.copyState(overlay, state.overlay), - basePos: state.basePos, baseCur: null, - overlayPos: state.overlayPos, overlayCur: null - }; - }, - - token: function(stream, state) { - if (stream != state.streamSeen || - Math.min(state.basePos, state.overlayPos) < stream.start) { - state.streamSeen = stream; - state.basePos = state.overlayPos = stream.start; - } - - if (stream.start == state.basePos) { - state.baseCur = base.token(stream, state.base); - state.basePos = stream.pos; - } - if (stream.start == state.overlayPos) { - stream.pos = stream.start; - state.overlayCur = overlay.token(stream, state.overlay); - state.overlayPos = stream.pos; - } - stream.pos = Math.min(state.basePos, state.overlayPos); - - // state.overlay.combineTokens always takes precedence over combine, - // unless set to null - if (state.overlayCur == null) return state.baseCur; - else if (state.baseCur != null && - state.overlay.combineTokens || - combine && state.overlay.combineTokens == null) - return state.baseCur + " " + state.overlayCur; - else return state.overlayCur; - }, - - indent: base.indent && function(state, textAfter) { - return base.indent(state.base, textAfter); - }, - electricChars: base.electricChars, - - innerMode: function(state) { return {state: state.base, mode: base}; }, - - blankLine: function(state) { - if (base.blankLine) base.blankLine(state.base); - if (overlay.blankLine) overlay.blankLine(state.overlay); - } - }; -}; - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/mode/simple.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/mode/simple.js deleted file mode 100644 index 795328b..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/mode/simple.js +++ /dev/null @@ -1,213 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineSimpleMode = function(name, states) { - CodeMirror.defineMode(name, function(config) { - return CodeMirror.simpleMode(config, states); - }); - }; - - CodeMirror.simpleMode = function(config, states) { - ensureState(states, "start"); - var states_ = {}, meta = states.meta || {}, hasIndentation = false; - for (var state in states) if (state != meta && states.hasOwnProperty(state)) { - var list = states_[state] = [], orig = states[state]; - for (var i = 0; i < orig.length; i++) { - var data = orig[i]; - list.push(new Rule(data, states)); - if (data.indent || data.dedent) hasIndentation = true; - } - } - var mode = { - startState: function() { - return {state: "start", pending: null, - local: null, localState: null, - indent: hasIndentation ? [] : null}; - }, - copyState: function(state) { - var s = {state: state.state, pending: state.pending, - local: state.local, localState: null, - indent: state.indent && state.indent.slice(0)}; - if (state.localState) - s.localState = CodeMirror.copyState(state.local.mode, state.localState); - if (state.stack) - s.stack = state.stack.slice(0); - for (var pers = state.persistentStates; pers; pers = pers.next) - s.persistentStates = {mode: pers.mode, - spec: pers.spec, - state: pers.state == state.localState ? s.localState : CodeMirror.copyState(pers.mode, pers.state), - next: s.persistentStates}; - return s; - }, - token: tokenFunction(states_, config), - innerMode: function(state) { return state.local && {mode: state.local.mode, state: state.localState}; }, - indent: indentFunction(states_, meta) - }; - if (meta) for (var prop in meta) if (meta.hasOwnProperty(prop)) - mode[prop] = meta[prop]; - return mode; - }; - - function ensureState(states, name) { - if (!states.hasOwnProperty(name)) - throw new Error("Undefined state " + name + "in simple mode"); - } - - function toRegex(val, caret) { - if (!val) return /(?:)/; - var flags = ""; - if (val instanceof RegExp) { - if (val.ignoreCase) flags = "i"; - val = val.source; - } else { - val = String(val); - } - return new RegExp((caret === false ? "" : "^") + "(?:" + val + ")", flags); - } - - function asToken(val) { - if (!val) return null; - if (typeof val == "string") return val.replace(/\./g, " "); - var result = []; - for (var i = 0; i < val.length; i++) - result.push(val[i] && val[i].replace(/\./g, " ")); - return result; - } - - function Rule(data, states) { - if (data.next || data.push) ensureState(states, data.next || data.push); - this.regex = toRegex(data.regex); - this.token = asToken(data.token); - this.data = data; - } - - function tokenFunction(states, config) { - return function(stream, state) { - if (state.pending) { - var pend = state.pending.shift(); - if (state.pending.length == 0) state.pending = null; - stream.pos += pend.text.length; - return pend.token; - } - - if (state.local) { - if (state.local.end && stream.match(state.local.end)) { - var tok = state.local.endToken || null; - state.local = state.localState = null; - return tok; - } else { - var tok = state.local.mode.token(stream, state.localState), m; - if (state.local.endScan && (m = state.local.endScan.exec(stream.current()))) - stream.pos = stream.start + m.index; - return tok; - } - } - - var curState = states[state.state]; - for (var i = 0; i < curState.length; i++) { - var rule = curState[i]; - var matches = (!rule.data.sol || stream.sol()) && stream.match(rule.regex); - if (matches) { - if (rule.data.next) { - state.state = rule.data.next; - } else if (rule.data.push) { - (state.stack || (state.stack = [])).push(state.state); - state.state = rule.data.push; - } else if (rule.data.pop && state.stack && state.stack.length) { - state.state = state.stack.pop(); - } - - if (rule.data.mode) - enterLocalMode(config, state, rule.data.mode, rule.token); - if (rule.data.indent) - state.indent.push(stream.indentation() + config.indentUnit); - if (rule.data.dedent) - state.indent.pop(); - if (matches.length > 2) { - state.pending = []; - for (var j = 2; j < matches.length; j++) - if (matches[j]) - state.pending.push({text: matches[j], token: rule.token[j - 1]}); - stream.backUp(matches[0].length - (matches[1] ? matches[1].length : 0)); - return rule.token[0]; - } else if (rule.token && rule.token.join) { - return rule.token[0]; - } else { - return rule.token; - } - } - } - stream.next(); - return null; - }; - } - - function cmp(a, b) { - if (a === b) return true; - if (!a || typeof a != "object" || !b || typeof b != "object") return false; - var props = 0; - for (var prop in a) if (a.hasOwnProperty(prop)) { - if (!b.hasOwnProperty(prop) || !cmp(a[prop], b[prop])) return false; - props++; - } - for (var prop in b) if (b.hasOwnProperty(prop)) props--; - return props == 0; - } - - function enterLocalMode(config, state, spec, token) { - var pers; - if (spec.persistent) for (var p = state.persistentStates; p && !pers; p = p.next) - if (spec.spec ? cmp(spec.spec, p.spec) : spec.mode == p.mode) pers = p; - var mode = pers ? pers.mode : spec.mode || CodeMirror.getMode(config, spec.spec); - var lState = pers ? pers.state : CodeMirror.startState(mode); - if (spec.persistent && !pers) - state.persistentStates = {mode: mode, spec: spec.spec, state: lState, next: state.persistentStates}; - - state.localState = lState; - state.local = {mode: mode, - end: spec.end && toRegex(spec.end), - endScan: spec.end && spec.forceEnd !== false && toRegex(spec.end, false), - endToken: token && token.join ? token[token.length - 1] : token}; - } - - function indexOf(val, arr) { - for (var i = 0; i < arr.length; i++) if (arr[i] === val) return true; - } - - function indentFunction(states, meta) { - return function(state, textAfter, line) { - if (state.local && state.local.mode.indent) - return state.local.mode.indent(state.localState, textAfter, line); - if (state.indent == null || state.local || meta.dontIndentStates && indexOf(state.state, meta.dontIndentStates) > -1) - return CodeMirror.Pass; - - var pos = state.indent.length - 1, rules = states[state.state]; - scan: for (;;) { - for (var i = 0; i < rules.length; i++) { - var rule = rules[i]; - if (rule.data.dedent && rule.data.dedentIfLineStart !== false) { - var m = rule.regex.exec(textAfter); - if (m && m[0]) { - pos--; - if (rule.next || rule.push) rules = states[rule.next || rule.push]; - textAfter = textAfter.slice(m[0].length); - continue scan; - } - } - } - break; - } - return pos < 0 ? 0 : state.indent[pos]; - }; - } -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/runmode/colorize.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/runmode/colorize.js deleted file mode 100644 index eb7060d..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/runmode/colorize.js +++ /dev/null @@ -1,40 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("./runmode")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "./runmode"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var isBlock = /^(p|li|div|h\\d|pre|blockquote|td)$/; - - function textContent(node, out) { - if (node.nodeType == 3) return out.push(node.nodeValue); - for (var ch = node.firstChild; ch; ch = ch.nextSibling) { - textContent(ch, out); - if (isBlock.test(node.nodeType)) out.push("\n"); - } - } - - CodeMirror.colorize = function(collection, defaultMode) { - if (!collection) collection = document.body.getElementsByTagName("pre"); - - for (var i = 0; i < collection.length; ++i) { - var node = collection[i]; - var mode = node.getAttribute("data-lang") || defaultMode; - if (!mode) continue; - - var text = []; - textContent(node, text); - node.innerHTML = ""; - CodeMirror.runMode(text.join(""), mode, node); - - node.className += " cm-s-default"; - } - }; -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/runmode/runmode-standalone.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/runmode/runmode-standalone.js deleted file mode 100644 index f4f352c..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/runmode/runmode-standalone.js +++ /dev/null @@ -1,157 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -window.CodeMirror = {}; - -(function() { -"use strict"; - -function splitLines(string){ return string.split(/\r?\n|\r/); }; - -function StringStream(string) { - this.pos = this.start = 0; - this.string = string; - this.lineStart = 0; -} -StringStream.prototype = { - eol: function() {return this.pos >= this.string.length;}, - sol: function() {return this.pos == 0;}, - peek: function() {return this.string.charAt(this.pos) || null;}, - next: function() { - if (this.pos < this.string.length) - return this.string.charAt(this.pos++); - }, - eat: function(match) { - var ch = this.string.charAt(this.pos); - if (typeof match == "string") var ok = ch == match; - else var ok = ch && (match.test ? match.test(ch) : match(ch)); - if (ok) {++this.pos; return ch;} - }, - eatWhile: function(match) { - var start = this.pos; - while (this.eat(match)){} - return this.pos > start; - }, - eatSpace: function() { - var start = this.pos; - while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos; - return this.pos > start; - }, - skipToEnd: function() {this.pos = this.string.length;}, - skipTo: function(ch) { - var found = this.string.indexOf(ch, this.pos); - if (found > -1) {this.pos = found; return true;} - }, - backUp: function(n) {this.pos -= n;}, - column: function() {return this.start - this.lineStart;}, - indentation: function() {return 0;}, - match: function(pattern, consume, caseInsensitive) { - if (typeof pattern == "string") { - var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;}; - var substr = this.string.substr(this.pos, pattern.length); - if (cased(substr) == cased(pattern)) { - if (consume !== false) this.pos += pattern.length; - return true; - } - } else { - var match = this.string.slice(this.pos).match(pattern); - if (match && match.index > 0) return null; - if (match && consume !== false) this.pos += match[0].length; - return match; - } - }, - current: function(){return this.string.slice(this.start, this.pos);}, - hideFirstChars: function(n, inner) { - this.lineStart += n; - try { return inner(); } - finally { this.lineStart -= n; } - } -}; -CodeMirror.StringStream = StringStream; - -CodeMirror.startState = function (mode, a1, a2) { - return mode.startState ? mode.startState(a1, a2) : true; -}; - -var modes = CodeMirror.modes = {}, mimeModes = CodeMirror.mimeModes = {}; -CodeMirror.defineMode = function (name, mode) { - if (arguments.length > 2) - mode.dependencies = Array.prototype.slice.call(arguments, 2); - modes[name] = mode; -}; -CodeMirror.defineMIME = function (mime, spec) { mimeModes[mime] = spec; }; -CodeMirror.resolveMode = function(spec) { - if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) { - spec = mimeModes[spec]; - } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) { - spec = mimeModes[spec.name]; - } - if (typeof spec == "string") return {name: spec}; - else return spec || {name: "null"}; -}; -CodeMirror.getMode = function (options, spec) { - spec = CodeMirror.resolveMode(spec); - var mfactory = modes[spec.name]; - if (!mfactory) throw new Error("Unknown mode: " + spec); - return mfactory(options, spec); -}; -CodeMirror.registerHelper = CodeMirror.registerGlobalHelper = Math.min; -CodeMirror.defineMode("null", function() { - return {token: function(stream) {stream.skipToEnd();}}; -}); -CodeMirror.defineMIME("text/plain", "null"); - -CodeMirror.runMode = function (string, modespec, callback, options) { - var mode = CodeMirror.getMode({ indentUnit: 2 }, modespec); - - if (callback.nodeType == 1) { - var tabSize = (options && options.tabSize) || 4; - var node = callback, col = 0; - node.innerHTML = ""; - callback = function (text, style) { - if (text == "\n") { - node.appendChild(document.createElement("br")); - col = 0; - return; - } - var content = ""; - // replace tabs - for (var pos = 0; ;) { - var idx = text.indexOf("\t", pos); - if (idx == -1) { - content += text.slice(pos); - col += text.length - pos; - break; - } else { - col += idx - pos; - content += text.slice(pos, idx); - var size = tabSize - col % tabSize; - col += size; - for (var i = 0; i < size; ++i) content += " "; - pos = idx + 1; - } - } - - if (style) { - var sp = node.appendChild(document.createElement("span")); - sp.className = "cm-" + style.replace(/ +/g, " cm-"); - sp.appendChild(document.createTextNode(content)); - } else { - node.appendChild(document.createTextNode(content)); - } - }; - } - - var lines = splitLines(string), state = (options && options.state) || CodeMirror.startState(mode); - for (var i = 0, e = lines.length; i < e; ++i) { - if (i) callback("\n"); - var stream = new CodeMirror.StringStream(lines[i]); - if (!stream.string && mode.blankLine) mode.blankLine(state); - while (!stream.eol()) { - var style = mode.token(stream, state); - callback(stream.current(), style, i, stream.start, state); - stream.start = stream.pos; - } - } -}; -})(); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/runmode/runmode.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/runmode/runmode.js deleted file mode 100644 index 07d2279..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/runmode/runmode.js +++ /dev/null @@ -1,72 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.runMode = function(string, modespec, callback, options) { - var mode = CodeMirror.getMode(CodeMirror.defaults, modespec); - var ie = /MSIE \d/.test(navigator.userAgent); - var ie_lt9 = ie && (document.documentMode == null || document.documentMode < 9); - - if (callback.nodeType == 1) { - var tabSize = (options && options.tabSize) || CodeMirror.defaults.tabSize; - var node = callback, col = 0; - node.innerHTML = ""; - callback = function(text, style) { - if (text == "\n") { - // Emitting LF or CRLF on IE8 or earlier results in an incorrect display. - // Emitting a carriage return makes everything ok. - node.appendChild(document.createTextNode(ie_lt9 ? '\r' : text)); - col = 0; - return; - } - var content = ""; - // replace tabs - for (var pos = 0;;) { - var idx = text.indexOf("\t", pos); - if (idx == -1) { - content += text.slice(pos); - col += text.length - pos; - break; - } else { - col += idx - pos; - content += text.slice(pos, idx); - var size = tabSize - col % tabSize; - col += size; - for (var i = 0; i < size; ++i) content += " "; - pos = idx + 1; - } - } - - if (style) { - var sp = node.appendChild(document.createElement("span")); - sp.className = "cm-" + style.replace(/ +/g, " cm-"); - sp.appendChild(document.createTextNode(content)); - } else { - node.appendChild(document.createTextNode(content)); - } - }; - } - - var lines = CodeMirror.splitLines(string), state = (options && options.state) || CodeMirror.startState(mode); - for (var i = 0, e = lines.length; i < e; ++i) { - if (i) callback("\n"); - var stream = new CodeMirror.StringStream(lines[i]); - if (!stream.string && mode.blankLine) mode.blankLine(state); - while (!stream.eol()) { - var style = mode.token(stream, state); - callback(stream.current(), style, i, stream.start, state); - stream.start = stream.pos; - } - } -}; - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/runmode/runmode.node.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/runmode/runmode.node.js deleted file mode 100644 index 8b8140b..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/runmode/runmode.node.js +++ /dev/null @@ -1,120 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/* Just enough of CodeMirror to run runMode under node.js */ - -// declare global: StringStream - -function splitLines(string){ return string.split(/\r?\n|\r/); }; - -function StringStream(string) { - this.pos = this.start = 0; - this.string = string; - this.lineStart = 0; -} -StringStream.prototype = { - eol: function() {return this.pos >= this.string.length;}, - sol: function() {return this.pos == 0;}, - peek: function() {return this.string.charAt(this.pos) || null;}, - next: function() { - if (this.pos < this.string.length) - return this.string.charAt(this.pos++); - }, - eat: function(match) { - var ch = this.string.charAt(this.pos); - if (typeof match == "string") var ok = ch == match; - else var ok = ch && (match.test ? match.test(ch) : match(ch)); - if (ok) {++this.pos; return ch;} - }, - eatWhile: function(match) { - var start = this.pos; - while (this.eat(match)){} - return this.pos > start; - }, - eatSpace: function() { - var start = this.pos; - while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos; - return this.pos > start; - }, - skipToEnd: function() {this.pos = this.string.length;}, - skipTo: function(ch) { - var found = this.string.indexOf(ch, this.pos); - if (found > -1) {this.pos = found; return true;} - }, - backUp: function(n) {this.pos -= n;}, - column: function() {return this.start - this.lineStart;}, - indentation: function() {return 0;}, - match: function(pattern, consume, caseInsensitive) { - if (typeof pattern == "string") { - var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;}; - var substr = this.string.substr(this.pos, pattern.length); - if (cased(substr) == cased(pattern)) { - if (consume !== false) this.pos += pattern.length; - return true; - } - } else { - var match = this.string.slice(this.pos).match(pattern); - if (match && match.index > 0) return null; - if (match && consume !== false) this.pos += match[0].length; - return match; - } - }, - current: function(){return this.string.slice(this.start, this.pos);}, - hideFirstChars: function(n, inner) { - this.lineStart += n; - try { return inner(); } - finally { this.lineStart -= n; } - } -}; -exports.StringStream = StringStream; - -exports.startState = function(mode, a1, a2) { - return mode.startState ? mode.startState(a1, a2) : true; -}; - -var modes = exports.modes = {}, mimeModes = exports.mimeModes = {}; -exports.defineMode = function(name, mode) { - if (arguments.length > 2) - mode.dependencies = Array.prototype.slice.call(arguments, 2); - modes[name] = mode; -}; -exports.defineMIME = function(mime, spec) { mimeModes[mime] = spec; }; - -exports.defineMode("null", function() { - return {token: function(stream) {stream.skipToEnd();}}; -}); -exports.defineMIME("text/plain", "null"); - -exports.resolveMode = function(spec) { - if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) { - spec = mimeModes[spec]; - } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) { - spec = mimeModes[spec.name]; - } - if (typeof spec == "string") return {name: spec}; - else return spec || {name: "null"}; -}; -exports.getMode = function(options, spec) { - spec = exports.resolveMode(spec); - var mfactory = modes[spec.name]; - if (!mfactory) throw new Error("Unknown mode: " + spec); - return mfactory(options, spec); -}; -exports.registerHelper = exports.registerGlobalHelper = Math.min; - -exports.runMode = function(string, modespec, callback, options) { - var mode = exports.getMode({indentUnit: 2}, modespec); - var lines = splitLines(string), state = (options && options.state) || exports.startState(mode); - for (var i = 0, e = lines.length; i < e; ++i) { - if (i) callback("\n"); - var stream = new exports.StringStream(lines[i]); - if (!stream.string && mode.blankLine) mode.blankLine(state); - while (!stream.eol()) { - var style = mode.token(stream, state); - callback(stream.current(), style, i, stream.start, state); - stream.start = stream.pos; - } - } -}; - -require.cache[require.resolve("../../lib/codemirror")] = require.cache[require.resolve("./runmode.node")]; diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/scroll/annotatescrollbar.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/scroll/annotatescrollbar.js deleted file mode 100644 index 54aeacf..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/scroll/annotatescrollbar.js +++ /dev/null @@ -1,100 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineExtension("annotateScrollbar", function(options) { - if (typeof options == "string") options = {className: options}; - return new Annotation(this, options); - }); - - CodeMirror.defineOption("scrollButtonHeight", 0); - - function Annotation(cm, options) { - this.cm = cm; - this.options = options; - this.buttonHeight = options.scrollButtonHeight || cm.getOption("scrollButtonHeight"); - this.annotations = []; - this.doRedraw = this.doUpdate = null; - this.div = cm.getWrapperElement().appendChild(document.createElement("div")); - this.div.style.cssText = "position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none"; - this.computeScale(); - - function scheduleRedraw(delay) { - clearTimeout(self.doRedraw); - self.doRedraw = setTimeout(function() { self.redraw(); }, delay); - } - - var self = this; - cm.on("refresh", this.resizeHandler = function() { - clearTimeout(self.doUpdate); - self.doUpdate = setTimeout(function() { - if (self.computeScale()) scheduleRedraw(20); - }, 100); - }); - cm.on("markerAdded", this.resizeHandler); - cm.on("markerCleared", this.resizeHandler); - if (options.listenForChanges !== false) - cm.on("change", this.changeHandler = function() { - scheduleRedraw(250); - }); - } - - Annotation.prototype.computeScale = function() { - var cm = this.cm; - var hScale = (cm.getWrapperElement().clientHeight - cm.display.barHeight - this.buttonHeight * 2) / - cm.heightAtLine(cm.lastLine() + 1, "local"); - if (hScale != this.hScale) { - this.hScale = hScale; - return true; - } - }; - - Annotation.prototype.update = function(annotations) { - this.annotations = annotations; - this.redraw(); - }; - - Annotation.prototype.redraw = function(compute) { - if (compute !== false) this.computeScale(); - var cm = this.cm, hScale = this.hScale; - - var frag = document.createDocumentFragment(), anns = this.annotations; - if (cm.display.barWidth) for (var i = 0, nextTop; i < anns.length; i++) { - var ann = anns[i]; - var top = nextTop || cm.charCoords(ann.from, "local").top * hScale; - var bottom = cm.charCoords(ann.to, "local").bottom * hScale; - while (i < anns.length - 1) { - nextTop = cm.charCoords(anns[i + 1].from, "local").top * hScale; - if (nextTop > bottom + .9) break; - ann = anns[++i]; - bottom = cm.charCoords(ann.to, "local").bottom * hScale; - } - if (bottom == top) continue; - var height = Math.max(bottom - top, 3); - - var elt = frag.appendChild(document.createElement("div")); - elt.style.cssText = "position: absolute; right: 0px; width: " + Math.max(cm.display.barWidth - 1, 2) + "px; top: " - + (top + this.buttonHeight) + "px; height: " + height + "px"; - elt.className = this.options.className; - } - this.div.textContent = ""; - this.div.appendChild(frag); - }; - - Annotation.prototype.clear = function() { - this.cm.off("refresh", this.resizeHandler); - this.cm.off("markerAdded", this.resizeHandler); - this.cm.off("markerCleared", this.resizeHandler); - if (this.changeHandler) this.cm.off("change", this.changeHandler); - this.div.parentNode.removeChild(this.div); - }; -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/scroll/scrollpastend.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/scroll/scrollpastend.js deleted file mode 100644 index 008ae4c..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/scroll/scrollpastend.js +++ /dev/null @@ -1,46 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineOption("scrollPastEnd", false, function(cm, val, old) { - if (old && old != CodeMirror.Init) { - cm.off("change", onChange); - cm.off("refresh", updateBottomMargin); - cm.display.lineSpace.parentNode.style.paddingBottom = ""; - cm.state.scrollPastEndPadding = null; - } - if (val) { - cm.on("change", onChange); - cm.on("refresh", updateBottomMargin); - updateBottomMargin(cm); - } - }); - - function onChange(cm, change) { - if (CodeMirror.changeEnd(change).line == cm.lastLine()) - updateBottomMargin(cm); - } - - function updateBottomMargin(cm) { - var padding = ""; - if (cm.lineCount() > 1) { - var totalH = cm.display.scroller.clientHeight - 30, - lastLineH = cm.getLineHandle(cm.lastLine()).height; - padding = (totalH - lastLineH) + "px"; - } - if (cm.state.scrollPastEndPadding != padding) { - cm.state.scrollPastEndPadding = padding; - cm.display.lineSpace.parentNode.style.paddingBottom = padding; - cm.setSize(); - } - } -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/scroll/simplescrollbars.css b/src/main/resources/static/editor.md-master/lib/codemirror/addon/scroll/simplescrollbars.css deleted file mode 100644 index 5eea7aa..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/scroll/simplescrollbars.css +++ /dev/null @@ -1,66 +0,0 @@ -.CodeMirror-simplescroll-horizontal div, .CodeMirror-simplescroll-vertical div { - position: absolute; - background: #ccc; - -moz-box-sizing: border-box; - box-sizing: border-box; - border: 1px solid #bbb; - border-radius: 2px; -} - -.CodeMirror-simplescroll-horizontal, .CodeMirror-simplescroll-vertical { - position: absolute; - z-index: 6; - background: #eee; -} - -.CodeMirror-simplescroll-horizontal { - bottom: 0; left: 0; - height: 8px; -} -.CodeMirror-simplescroll-horizontal div { - bottom: 0; - height: 100%; -} - -.CodeMirror-simplescroll-vertical { - right: 0; top: 0; - width: 8px; -} -.CodeMirror-simplescroll-vertical div { - right: 0; - width: 100%; -} - - -.CodeMirror-overlayscroll .CodeMirror-scrollbar-filler, .CodeMirror-overlayscroll .CodeMirror-gutter-filler { - display: none; -} - -.CodeMirror-overlayscroll-horizontal div, .CodeMirror-overlayscroll-vertical div { - position: absolute; - background: #bcd; - border-radius: 3px; -} - -.CodeMirror-overlayscroll-horizontal, .CodeMirror-overlayscroll-vertical { - position: absolute; - z-index: 6; -} - -.CodeMirror-overlayscroll-horizontal { - bottom: 0; left: 0; - height: 6px; -} -.CodeMirror-overlayscroll-horizontal div { - bottom: 0; - height: 100%; -} - -.CodeMirror-overlayscroll-vertical { - right: 0; top: 0; - width: 6px; -} -.CodeMirror-overlayscroll-vertical div { - right: 0; - width: 100%; -} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/scroll/simplescrollbars.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/scroll/simplescrollbars.js deleted file mode 100644 index bb06adb..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/scroll/simplescrollbars.js +++ /dev/null @@ -1,141 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - function Bar(cls, orientation, scroll) { - this.orientation = orientation; - this.scroll = scroll; - this.screen = this.total = this.size = 1; - this.pos = 0; - - this.node = document.createElement("div"); - this.node.className = cls + "-" + orientation; - this.inner = this.node.appendChild(document.createElement("div")); - - var self = this; - CodeMirror.on(this.inner, "mousedown", function(e) { - if (e.which != 1) return; - CodeMirror.e_preventDefault(e); - var axis = self.orientation == "horizontal" ? "pageX" : "pageY"; - var start = e[axis], startpos = self.pos; - function done() { - CodeMirror.off(document, "mousemove", move); - CodeMirror.off(document, "mouseup", done); - } - function move(e) { - if (e.which != 1) return done(); - self.moveTo(startpos + (e[axis] - start) * (self.total / self.size)); - } - CodeMirror.on(document, "mousemove", move); - CodeMirror.on(document, "mouseup", done); - }); - - CodeMirror.on(this.node, "click", function(e) { - CodeMirror.e_preventDefault(e); - var innerBox = self.inner.getBoundingClientRect(), where; - if (self.orientation == "horizontal") - where = e.clientX < innerBox.left ? -1 : e.clientX > innerBox.right ? 1 : 0; - else - where = e.clientY < innerBox.top ? -1 : e.clientY > innerBox.bottom ? 1 : 0; - self.moveTo(self.pos + where * self.screen); - }); - - function onWheel(e) { - var moved = CodeMirror.wheelEventPixels(e)[self.orientation == "horizontal" ? "x" : "y"]; - var oldPos = self.pos; - self.moveTo(self.pos + moved); - if (self.pos != oldPos) CodeMirror.e_preventDefault(e); - } - CodeMirror.on(this.node, "mousewheel", onWheel); - CodeMirror.on(this.node, "DOMMouseScroll", onWheel); - } - - Bar.prototype.moveTo = function(pos, update) { - if (pos < 0) pos = 0; - if (pos > this.total - this.screen) pos = this.total - this.screen; - if (pos == this.pos) return; - this.pos = pos; - this.inner.style[this.orientation == "horizontal" ? "left" : "top"] = - (pos * (this.size / this.total)) + "px"; - if (update !== false) this.scroll(pos, this.orientation); - }; - - Bar.prototype.update = function(scrollSize, clientSize, barSize) { - this.screen = clientSize; - this.total = scrollSize; - this.size = barSize; - - // FIXME clip to min size? - this.inner.style[this.orientation == "horizontal" ? "width" : "height"] = - this.screen * (this.size / this.total) + "px"; - this.inner.style[this.orientation == "horizontal" ? "left" : "top"] = - this.pos * (this.size / this.total) + "px"; - }; - - function SimpleScrollbars(cls, place, scroll) { - this.addClass = cls; - this.horiz = new Bar(cls, "horizontal", scroll); - place(this.horiz.node); - this.vert = new Bar(cls, "vertical", scroll); - place(this.vert.node); - this.width = null; - } - - SimpleScrollbars.prototype.update = function(measure) { - if (this.width == null) { - var style = window.getComputedStyle ? window.getComputedStyle(this.horiz.node) : this.horiz.node.currentStyle; - if (style) this.width = parseInt(style.height); - } - var width = this.width || 0; - - var needsH = measure.scrollWidth > measure.clientWidth + 1; - var needsV = measure.scrollHeight > measure.clientHeight + 1; - this.vert.node.style.display = needsV ? "block" : "none"; - this.horiz.node.style.display = needsH ? "block" : "none"; - - if (needsV) { - this.vert.update(measure.scrollHeight, measure.clientHeight, - measure.viewHeight - (needsH ? width : 0)); - this.vert.node.style.display = "block"; - this.vert.node.style.bottom = needsH ? width + "px" : "0"; - } - if (needsH) { - this.horiz.update(measure.scrollWidth, measure.clientWidth, - measure.viewWidth - (needsV ? width : 0) - measure.barLeft); - this.horiz.node.style.right = needsV ? width + "px" : "0"; - this.horiz.node.style.left = measure.barLeft + "px"; - } - - return {right: needsV ? width : 0, bottom: needsH ? width : 0}; - }; - - SimpleScrollbars.prototype.setScrollTop = function(pos) { - this.vert.moveTo(pos, false); - }; - - SimpleScrollbars.prototype.setScrollLeft = function(pos) { - this.horiz.moveTo(pos, false); - }; - - SimpleScrollbars.prototype.clear = function() { - var parent = this.horiz.node.parentNode; - parent.removeChild(this.horiz.node); - parent.removeChild(this.vert.node); - }; - - CodeMirror.scrollbarModel.simple = function(place, scroll) { - return new SimpleScrollbars("CodeMirror-simplescroll", place, scroll); - }; - CodeMirror.scrollbarModel.overlay = function(place, scroll) { - return new SimpleScrollbars("CodeMirror-overlayscroll", place, scroll); - }; -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/search/match-highlighter.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/search/match-highlighter.js deleted file mode 100644 index e9a2272..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/search/match-highlighter.js +++ /dev/null @@ -1,128 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Highlighting text that matches the selection -// -// Defines an option highlightSelectionMatches, which, when enabled, -// will style strings that match the selection throughout the -// document. -// -// The option can be set to true to simply enable it, or to a -// {minChars, style, wordsOnly, showToken, delay} object to explicitly -// configure it. minChars is the minimum amount of characters that should be -// selected for the behavior to occur, and style is the token style to -// apply to the matches. This will be prefixed by "cm-" to create an -// actual CSS class name. If wordsOnly is enabled, the matches will be -// highlighted only if the selected text is a word. showToken, when enabled, -// will cause the current token to be highlighted when nothing is selected. -// delay is used to specify how much time to wait, in milliseconds, before -// highlighting the matches. - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var DEFAULT_MIN_CHARS = 2; - var DEFAULT_TOKEN_STYLE = "matchhighlight"; - var DEFAULT_DELAY = 100; - var DEFAULT_WORDS_ONLY = false; - - function State(options) { - if (typeof options == "object") { - this.minChars = options.minChars; - this.style = options.style; - this.showToken = options.showToken; - this.delay = options.delay; - this.wordsOnly = options.wordsOnly; - } - if (this.style == null) this.style = DEFAULT_TOKEN_STYLE; - if (this.minChars == null) this.minChars = DEFAULT_MIN_CHARS; - if (this.delay == null) this.delay = DEFAULT_DELAY; - if (this.wordsOnly == null) this.wordsOnly = DEFAULT_WORDS_ONLY; - this.overlay = this.timeout = null; - } - - CodeMirror.defineOption("highlightSelectionMatches", false, function(cm, val, old) { - if (old && old != CodeMirror.Init) { - var over = cm.state.matchHighlighter.overlay; - if (over) cm.removeOverlay(over); - clearTimeout(cm.state.matchHighlighter.timeout); - cm.state.matchHighlighter = null; - cm.off("cursorActivity", cursorActivity); - } - if (val) { - cm.state.matchHighlighter = new State(val); - highlightMatches(cm); - cm.on("cursorActivity", cursorActivity); - } - }); - - function cursorActivity(cm) { - var state = cm.state.matchHighlighter; - clearTimeout(state.timeout); - state.timeout = setTimeout(function() {highlightMatches(cm);}, state.delay); - } - - function highlightMatches(cm) { - cm.operation(function() { - var state = cm.state.matchHighlighter; - if (state.overlay) { - cm.removeOverlay(state.overlay); - state.overlay = null; - } - if (!cm.somethingSelected() && state.showToken) { - var re = state.showToken === true ? /[\w$]/ : state.showToken; - var cur = cm.getCursor(), line = cm.getLine(cur.line), start = cur.ch, end = start; - while (start && re.test(line.charAt(start - 1))) --start; - while (end < line.length && re.test(line.charAt(end))) ++end; - if (start < end) - cm.addOverlay(state.overlay = makeOverlay(line.slice(start, end), re, state.style)); - return; - } - var from = cm.getCursor("from"), to = cm.getCursor("to"); - if (from.line != to.line) return; - if (state.wordsOnly && !isWord(cm, from, to)) return; - var selection = cm.getRange(from, to).replace(/^\s+|\s+$/g, ""); - if (selection.length >= state.minChars) - cm.addOverlay(state.overlay = makeOverlay(selection, false, state.style)); - }); - } - - function isWord(cm, from, to) { - var str = cm.getRange(from, to); - if (str.match(/^\w+$/) !== null) { - if (from.ch > 0) { - var pos = {line: from.line, ch: from.ch - 1}; - var chr = cm.getRange(pos, from); - if (chr.match(/\W/) === null) return false; - } - if (to.ch < cm.getLine(from.line).length) { - var pos = {line: to.line, ch: to.ch + 1}; - var chr = cm.getRange(to, pos); - if (chr.match(/\W/) === null) return false; - } - return true; - } else return false; - } - - function boundariesAround(stream, re) { - return (!stream.start || !re.test(stream.string.charAt(stream.start - 1))) && - (stream.pos == stream.string.length || !re.test(stream.string.charAt(stream.pos))); - } - - function makeOverlay(query, hasBoundary, style) { - return {token: function(stream) { - if (stream.match(query) && - (!hasBoundary || boundariesAround(stream, hasBoundary))) - return style; - stream.next(); - stream.skipTo(query.charAt(0)) || stream.skipToEnd(); - }}; - } -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/search/matchesonscrollbar.css b/src/main/resources/static/editor.md-master/lib/codemirror/addon/search/matchesonscrollbar.css deleted file mode 100644 index 77932cc..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/search/matchesonscrollbar.css +++ /dev/null @@ -1,8 +0,0 @@ -.CodeMirror-search-match { - background: gold; - border-top: 1px solid orange; - border-bottom: 1px solid orange; - -moz-box-sizing: border-box; - box-sizing: border-box; - opacity: .5; -} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/search/matchesonscrollbar.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/search/matchesonscrollbar.js deleted file mode 100644 index dbd67a4..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/search/matchesonscrollbar.js +++ /dev/null @@ -1,95 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("./searchcursor"), require("../scroll/annotatescrollbar")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "./searchcursor", "../scroll/annotatescrollbar"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineExtension("showMatchesOnScrollbar", function(query, caseFold, options) { - if (typeof options == "string") options = {className: options}; - if (!options) options = {}; - return new SearchAnnotation(this, query, caseFold, options); - }); - - function SearchAnnotation(cm, query, caseFold, options) { - this.cm = cm; - var annotateOptions = {listenForChanges: false}; - for (var prop in options) annotateOptions[prop] = options[prop]; - if (!annotateOptions.className) annotateOptions.className = "CodeMirror-search-match"; - this.annotation = cm.annotateScrollbar(annotateOptions); - this.query = query; - this.caseFold = caseFold; - this.gap = {from: cm.firstLine(), to: cm.lastLine() + 1}; - this.matches = []; - this.update = null; - - this.findMatches(); - this.annotation.update(this.matches); - - var self = this; - cm.on("change", this.changeHandler = function(_cm, change) { self.onChange(change); }); - } - - var MAX_MATCHES = 1000; - - SearchAnnotation.prototype.findMatches = function() { - if (!this.gap) return; - for (var i = 0; i < this.matches.length; i++) { - var match = this.matches[i]; - if (match.from.line >= this.gap.to) break; - if (match.to.line >= this.gap.from) this.matches.splice(i--, 1); - } - var cursor = this.cm.getSearchCursor(this.query, CodeMirror.Pos(this.gap.from, 0), this.caseFold); - while (cursor.findNext()) { - var match = {from: cursor.from(), to: cursor.to()}; - if (match.from.line >= this.gap.to) break; - this.matches.splice(i++, 0, match); - if (this.matches.length > MAX_MATCHES) break; - } - this.gap = null; - }; - - function offsetLine(line, changeStart, sizeChange) { - if (line <= changeStart) return line; - return Math.max(changeStart, line + sizeChange); - } - - SearchAnnotation.prototype.onChange = function(change) { - var startLine = change.from.line; - var endLine = CodeMirror.changeEnd(change).line; - var sizeChange = endLine - change.to.line; - if (this.gap) { - this.gap.from = Math.min(offsetLine(this.gap.from, startLine, sizeChange), change.from.line); - this.gap.to = Math.max(offsetLine(this.gap.to, startLine, sizeChange), change.from.line); - } else { - this.gap = {from: change.from.line, to: endLine + 1}; - } - - if (sizeChange) for (var i = 0; i < this.matches.length; i++) { - var match = this.matches[i]; - var newFrom = offsetLine(match.from.line, startLine, sizeChange); - if (newFrom != match.from.line) match.from = CodeMirror.Pos(newFrom, match.from.ch); - var newTo = offsetLine(match.to.line, startLine, sizeChange); - if (newTo != match.to.line) match.to = CodeMirror.Pos(newTo, match.to.ch); - } - clearTimeout(this.update); - var self = this; - this.update = setTimeout(function() { self.updateAfterChange(); }, 250); - }; - - SearchAnnotation.prototype.updateAfterChange = function() { - this.findMatches(); - this.annotation.update(this.matches); - }; - - SearchAnnotation.prototype.clear = function() { - this.cm.off("change", this.changeHandler); - this.annotation.clear(); - }; -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/search/search.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/search/search.js deleted file mode 100644 index 0251067..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/search/search.js +++ /dev/null @@ -1,164 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Define search commands. Depends on dialog.js or another -// implementation of the openDialog method. - -// Replace works a little oddly -- it will do the replace on the next -// Ctrl-G (or whatever is bound to findNext) press. You prevent a -// replace by making sure the match is no longer selected when hitting -// Ctrl-G. - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("./searchcursor"), require("../dialog/dialog")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "./searchcursor", "../dialog/dialog"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - function searchOverlay(query, caseInsensitive) { - if (typeof query == "string") - query = new RegExp(query.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), caseInsensitive ? "gi" : "g"); - else if (!query.global) - query = new RegExp(query.source, query.ignoreCase ? "gi" : "g"); - - return {token: function(stream) { - query.lastIndex = stream.pos; - var match = query.exec(stream.string); - if (match && match.index == stream.pos) { - stream.pos += match[0].length; - return "searching"; - } else if (match) { - stream.pos = match.index; - } else { - stream.skipToEnd(); - } - }}; - } - - function SearchState() { - this.posFrom = this.posTo = this.query = null; - this.overlay = null; - } - function getSearchState(cm) { - return cm.state.search || (cm.state.search = new SearchState()); - } - function queryCaseInsensitive(query) { - return typeof query == "string" && query == query.toLowerCase(); - } - function getSearchCursor(cm, query, pos) { - // Heuristic: if the query string is all lowercase, do a case insensitive search. - return cm.getSearchCursor(query, pos, queryCaseInsensitive(query)); - } - function dialog(cm, text, shortText, deflt, f) { - if (cm.openDialog) cm.openDialog(text, f, {value: deflt}); - else f(prompt(shortText, deflt)); - } - function confirmDialog(cm, text, shortText, fs) { - if (cm.openConfirm) cm.openConfirm(text, fs); - else if (confirm(shortText)) fs[0](); - } - function parseQuery(query) { - var isRE = query.match(/^\/(.*)\/([a-z]*)$/); - if (isRE) { - try { query = new RegExp(isRE[1], isRE[2].indexOf("i") == -1 ? "" : "i"); } - catch(e) {} // Not a regular expression after all, do a string search - } - if (typeof query == "string" ? query == "" : query.test("")) - query = /x^/; - return query; - } - var queryDialog = - 'Search: (Use /re/ syntax for regexp search)'; - function doSearch(cm, rev) { - var state = getSearchState(cm); - if (state.query) return findNext(cm, rev); - dialog(cm, queryDialog, "Search for:", cm.getSelection(), function(query) { - cm.operation(function() { - if (!query || state.query) return; - state.query = parseQuery(query); - cm.removeOverlay(state.overlay, queryCaseInsensitive(state.query)); - state.overlay = searchOverlay(state.query, queryCaseInsensitive(state.query)); - cm.addOverlay(state.overlay); - if (cm.showMatchesOnScrollbar) { - if (state.annotate) { state.annotate.clear(); state.annotate = null; } - state.annotate = cm.showMatchesOnScrollbar(state.query, queryCaseInsensitive(state.query)); - } - state.posFrom = state.posTo = cm.getCursor(); - findNext(cm, rev); - }); - }); - } - function findNext(cm, rev) {cm.operation(function() { - var state = getSearchState(cm); - var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo); - if (!cursor.find(rev)) { - cursor = getSearchCursor(cm, state.query, rev ? CodeMirror.Pos(cm.lastLine()) : CodeMirror.Pos(cm.firstLine(), 0)); - if (!cursor.find(rev)) return; - } - cm.setSelection(cursor.from(), cursor.to()); - cm.scrollIntoView({from: cursor.from(), to: cursor.to()}); - state.posFrom = cursor.from(); state.posTo = cursor.to(); - });} - function clearSearch(cm) {cm.operation(function() { - var state = getSearchState(cm); - if (!state.query) return; - state.query = null; - cm.removeOverlay(state.overlay); - if (state.annotate) { state.annotate.clear(); state.annotate = null; } - });} - - var replaceQueryDialog = - 'Replace: (Use /re/ syntax for regexp search)'; - var replacementQueryDialog = 'With: '; - var doReplaceConfirm = "Replace? "; - function replace(cm, all) { - if (cm.getOption("readOnly")) return; - dialog(cm, replaceQueryDialog, "Replace:", cm.getSelection(), function(query) { - if (!query) return; - query = parseQuery(query); - dialog(cm, replacementQueryDialog, "Replace with:", "", function(text) { - if (all) { - cm.operation(function() { - for (var cursor = getSearchCursor(cm, query); cursor.findNext();) { - if (typeof query != "string") { - var match = cm.getRange(cursor.from(), cursor.to()).match(query); - cursor.replace(text.replace(/\$(\d)/g, function(_, i) {return match[i];})); - } else cursor.replace(text); - } - }); - } else { - clearSearch(cm); - var cursor = getSearchCursor(cm, query, cm.getCursor()); - var advance = function() { - var start = cursor.from(), match; - if (!(match = cursor.findNext())) { - cursor = getSearchCursor(cm, query); - if (!(match = cursor.findNext()) || - (start && cursor.from().line == start.line && cursor.from().ch == start.ch)) return; - } - cm.setSelection(cursor.from(), cursor.to()); - cm.scrollIntoView({from: cursor.from(), to: cursor.to()}); - confirmDialog(cm, doReplaceConfirm, "Replace?", - [function() {doReplace(match);}, advance]); - }; - var doReplace = function(match) { - cursor.replace(typeof query == "string" ? text : - text.replace(/\$(\d)/g, function(_, i) {return match[i];})); - advance(); - }; - advance(); - } - }); - }); - } - - CodeMirror.commands.find = function(cm) {clearSearch(cm); doSearch(cm);}; - CodeMirror.commands.findNext = doSearch; - CodeMirror.commands.findPrev = function(cm) {doSearch(cm, true);}; - CodeMirror.commands.clearSearch = clearSearch; - CodeMirror.commands.replace = replace; - CodeMirror.commands.replaceAll = function(cm) {replace(cm, true);}; -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/search/searchcursor.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/search/searchcursor.js deleted file mode 100644 index 55c108b..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/search/searchcursor.js +++ /dev/null @@ -1,189 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - var Pos = CodeMirror.Pos; - - function SearchCursor(doc, query, pos, caseFold) { - this.atOccurrence = false; this.doc = doc; - if (caseFold == null && typeof query == "string") caseFold = false; - - pos = pos ? doc.clipPos(pos) : Pos(0, 0); - this.pos = {from: pos, to: pos}; - - // The matches method is filled in based on the type of query. - // It takes a position and a direction, and returns an object - // describing the next occurrence of the query, or null if no - // more matches were found. - if (typeof query != "string") { // Regexp match - if (!query.global) query = new RegExp(query.source, query.ignoreCase ? "ig" : "g"); - this.matches = function(reverse, pos) { - if (reverse) { - query.lastIndex = 0; - var line = doc.getLine(pos.line).slice(0, pos.ch), cutOff = 0, match, start; - for (;;) { - query.lastIndex = cutOff; - var newMatch = query.exec(line); - if (!newMatch) break; - match = newMatch; - start = match.index; - cutOff = match.index + (match[0].length || 1); - if (cutOff == line.length) break; - } - var matchLen = (match && match[0].length) || 0; - if (!matchLen) { - if (start == 0 && line.length == 0) {match = undefined;} - else if (start != doc.getLine(pos.line).length) { - matchLen++; - } - } - } else { - query.lastIndex = pos.ch; - var line = doc.getLine(pos.line), match = query.exec(line); - var matchLen = (match && match[0].length) || 0; - var start = match && match.index; - if (start + matchLen != line.length && !matchLen) matchLen = 1; - } - if (match && matchLen) - return {from: Pos(pos.line, start), - to: Pos(pos.line, start + matchLen), - match: match}; - }; - } else { // String query - var origQuery = query; - if (caseFold) query = query.toLowerCase(); - var fold = caseFold ? function(str){return str.toLowerCase();} : function(str){return str;}; - var target = query.split("\n"); - // Different methods for single-line and multi-line queries - if (target.length == 1) { - if (!query.length) { - // Empty string would match anything and never progress, so - // we define it to match nothing instead. - this.matches = function() {}; - } else { - this.matches = function(reverse, pos) { - if (reverse) { - var orig = doc.getLine(pos.line).slice(0, pos.ch), line = fold(orig); - var match = line.lastIndexOf(query); - if (match > -1) { - match = adjustPos(orig, line, match); - return {from: Pos(pos.line, match), to: Pos(pos.line, match + origQuery.length)}; - } - } else { - var orig = doc.getLine(pos.line).slice(pos.ch), line = fold(orig); - var match = line.indexOf(query); - if (match > -1) { - match = adjustPos(orig, line, match) + pos.ch; - return {from: Pos(pos.line, match), to: Pos(pos.line, match + origQuery.length)}; - } - } - }; - } - } else { - var origTarget = origQuery.split("\n"); - this.matches = function(reverse, pos) { - var last = target.length - 1; - if (reverse) { - if (pos.line - (target.length - 1) < doc.firstLine()) return; - if (fold(doc.getLine(pos.line).slice(0, origTarget[last].length)) != target[target.length - 1]) return; - var to = Pos(pos.line, origTarget[last].length); - for (var ln = pos.line - 1, i = last - 1; i >= 1; --i, --ln) - if (target[i] != fold(doc.getLine(ln))) return; - var line = doc.getLine(ln), cut = line.length - origTarget[0].length; - if (fold(line.slice(cut)) != target[0]) return; - return {from: Pos(ln, cut), to: to}; - } else { - if (pos.line + (target.length - 1) > doc.lastLine()) return; - var line = doc.getLine(pos.line), cut = line.length - origTarget[0].length; - if (fold(line.slice(cut)) != target[0]) return; - var from = Pos(pos.line, cut); - for (var ln = pos.line + 1, i = 1; i < last; ++i, ++ln) - if (target[i] != fold(doc.getLine(ln))) return; - if (fold(doc.getLine(ln).slice(0, origTarget[last].length)) != target[last]) return; - return {from: from, to: Pos(ln, origTarget[last].length)}; - } - }; - } - } - } - - SearchCursor.prototype = { - findNext: function() {return this.find(false);}, - findPrevious: function() {return this.find(true);}, - - find: function(reverse) { - var self = this, pos = this.doc.clipPos(reverse ? this.pos.from : this.pos.to); - function savePosAndFail(line) { - var pos = Pos(line, 0); - self.pos = {from: pos, to: pos}; - self.atOccurrence = false; - return false; - } - - for (;;) { - if (this.pos = this.matches(reverse, pos)) { - this.atOccurrence = true; - return this.pos.match || true; - } - if (reverse) { - if (!pos.line) return savePosAndFail(0); - pos = Pos(pos.line-1, this.doc.getLine(pos.line-1).length); - } - else { - var maxLine = this.doc.lineCount(); - if (pos.line == maxLine - 1) return savePosAndFail(maxLine); - pos = Pos(pos.line + 1, 0); - } - } - }, - - from: function() {if (this.atOccurrence) return this.pos.from;}, - to: function() {if (this.atOccurrence) return this.pos.to;}, - - replace: function(newText) { - if (!this.atOccurrence) return; - var lines = CodeMirror.splitLines(newText); - this.doc.replaceRange(lines, this.pos.from, this.pos.to); - this.pos.to = Pos(this.pos.from.line + lines.length - 1, - lines[lines.length - 1].length + (lines.length == 1 ? this.pos.from.ch : 0)); - } - }; - - // Maps a position in a case-folded line back to a position in the original line - // (compensating for codepoints increasing in number during folding) - function adjustPos(orig, folded, pos) { - if (orig.length == folded.length) return pos; - for (var pos1 = Math.min(pos, orig.length);;) { - var len1 = orig.slice(0, pos1).toLowerCase().length; - if (len1 < pos) ++pos1; - else if (len1 > pos) --pos1; - else return pos1; - } - } - - CodeMirror.defineExtension("getSearchCursor", function(query, pos, caseFold) { - return new SearchCursor(this.doc, query, pos, caseFold); - }); - CodeMirror.defineDocExtension("getSearchCursor", function(query, pos, caseFold) { - return new SearchCursor(this, query, pos, caseFold); - }); - - CodeMirror.defineExtension("selectMatches", function(query, caseFold) { - var ranges = [], next; - var cur = this.getSearchCursor(query, this.getCursor("from"), caseFold); - while (next = cur.findNext()) { - if (CodeMirror.cmpPos(cur.to(), this.getCursor("to")) > 0) break; - ranges.push({anchor: cur.from(), head: cur.to()}); - } - if (ranges.length) - this.setSelections(ranges, 0); - }); -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/selection/active-line.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/selection/active-line.js deleted file mode 100644 index 22da2e0..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/selection/active-line.js +++ /dev/null @@ -1,71 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Because sometimes you need to style the cursor's line. -// -// Adds an option 'styleActiveLine' which, when enabled, gives the -// active line's wrapping
        the CSS class "CodeMirror-activeline", -// and gives its background
        the class "CodeMirror-activeline-background". - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - var WRAP_CLASS = "CodeMirror-activeline"; - var BACK_CLASS = "CodeMirror-activeline-background"; - - CodeMirror.defineOption("styleActiveLine", false, function(cm, val, old) { - var prev = old && old != CodeMirror.Init; - if (val && !prev) { - cm.state.activeLines = []; - updateActiveLines(cm, cm.listSelections()); - cm.on("beforeSelectionChange", selectionChange); - } else if (!val && prev) { - cm.off("beforeSelectionChange", selectionChange); - clearActiveLines(cm); - delete cm.state.activeLines; - } - }); - - function clearActiveLines(cm) { - for (var i = 0; i < cm.state.activeLines.length; i++) { - cm.removeLineClass(cm.state.activeLines[i], "wrap", WRAP_CLASS); - cm.removeLineClass(cm.state.activeLines[i], "background", BACK_CLASS); - } - } - - function sameArray(a, b) { - if (a.length != b.length) return false; - for (var i = 0; i < a.length; i++) - if (a[i] != b[i]) return false; - return true; - } - - function updateActiveLines(cm, ranges) { - var active = []; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - if (!range.empty()) continue; - var line = cm.getLineHandleVisualStart(range.head.line); - if (active[active.length - 1] != line) active.push(line); - } - if (sameArray(cm.state.activeLines, active)) return; - cm.operation(function() { - clearActiveLines(cm); - for (var i = 0; i < active.length; i++) { - cm.addLineClass(active[i], "wrap", WRAP_CLASS); - cm.addLineClass(active[i], "background", BACK_CLASS); - } - cm.state.activeLines = active; - }); - } - - function selectionChange(cm, sel) { - updateActiveLines(cm, sel.ranges); - } -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/selection/mark-selection.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/selection/mark-selection.js deleted file mode 100644 index 5c42d21..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/selection/mark-selection.js +++ /dev/null @@ -1,118 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Because sometimes you need to mark the selected *text*. -// -// Adds an option 'styleSelectedText' which, when enabled, gives -// selected text the CSS class given as option value, or -// "CodeMirror-selectedtext" when the value is not a string. - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineOption("styleSelectedText", false, function(cm, val, old) { - var prev = old && old != CodeMirror.Init; - if (val && !prev) { - cm.state.markedSelection = []; - cm.state.markedSelectionStyle = typeof val == "string" ? val : "CodeMirror-selectedtext"; - reset(cm); - cm.on("cursorActivity", onCursorActivity); - cm.on("change", onChange); - } else if (!val && prev) { - cm.off("cursorActivity", onCursorActivity); - cm.off("change", onChange); - clear(cm); - cm.state.markedSelection = cm.state.markedSelectionStyle = null; - } - }); - - function onCursorActivity(cm) { - cm.operation(function() { update(cm); }); - } - - function onChange(cm) { - if (cm.state.markedSelection.length) - cm.operation(function() { clear(cm); }); - } - - var CHUNK_SIZE = 8; - var Pos = CodeMirror.Pos; - var cmp = CodeMirror.cmpPos; - - function coverRange(cm, from, to, addAt) { - if (cmp(from, to) == 0) return; - var array = cm.state.markedSelection; - var cls = cm.state.markedSelectionStyle; - for (var line = from.line;;) { - var start = line == from.line ? from : Pos(line, 0); - var endLine = line + CHUNK_SIZE, atEnd = endLine >= to.line; - var end = atEnd ? to : Pos(endLine, 0); - var mark = cm.markText(start, end, {className: cls}); - if (addAt == null) array.push(mark); - else array.splice(addAt++, 0, mark); - if (atEnd) break; - line = endLine; - } - } - - function clear(cm) { - var array = cm.state.markedSelection; - for (var i = 0; i < array.length; ++i) array[i].clear(); - array.length = 0; - } - - function reset(cm) { - clear(cm); - var ranges = cm.listSelections(); - for (var i = 0; i < ranges.length; i++) - coverRange(cm, ranges[i].from(), ranges[i].to()); - } - - function update(cm) { - if (!cm.somethingSelected()) return clear(cm); - if (cm.listSelections().length > 1) return reset(cm); - - var from = cm.getCursor("start"), to = cm.getCursor("end"); - - var array = cm.state.markedSelection; - if (!array.length) return coverRange(cm, from, to); - - var coverStart = array[0].find(), coverEnd = array[array.length - 1].find(); - if (!coverStart || !coverEnd || to.line - from.line < CHUNK_SIZE || - cmp(from, coverEnd.to) >= 0 || cmp(to, coverStart.from) <= 0) - return reset(cm); - - while (cmp(from, coverStart.from) > 0) { - array.shift().clear(); - coverStart = array[0].find(); - } - if (cmp(from, coverStart.from) < 0) { - if (coverStart.to.line - from.line < CHUNK_SIZE) { - array.shift().clear(); - coverRange(cm, from, coverStart.to, 0); - } else { - coverRange(cm, from, coverStart.from, 0); - } - } - - while (cmp(to, coverEnd.to) < 0) { - array.pop().clear(); - coverEnd = array[array.length - 1].find(); - } - if (cmp(to, coverEnd.to) > 0) { - if (to.line - coverEnd.from.line < CHUNK_SIZE) { - array.pop().clear(); - coverRange(cm, coverEnd.from, to); - } else { - coverRange(cm, coverEnd.to, to); - } - } - } -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/selection/selection-pointer.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/selection/selection-pointer.js deleted file mode 100644 index ef5e404..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/selection/selection-pointer.js +++ /dev/null @@ -1,98 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineOption("selectionPointer", false, function(cm, val) { - var data = cm.state.selectionPointer; - if (data) { - CodeMirror.off(cm.getWrapperElement(), "mousemove", data.mousemove); - CodeMirror.off(cm.getWrapperElement(), "mouseout", data.mouseout); - CodeMirror.off(window, "scroll", data.windowScroll); - cm.off("cursorActivity", reset); - cm.off("scroll", reset); - cm.state.selectionPointer = null; - cm.display.lineDiv.style.cursor = ""; - } - if (val) { - data = cm.state.selectionPointer = { - value: typeof val == "string" ? val : "default", - mousemove: function(event) { mousemove(cm, event); }, - mouseout: function(event) { mouseout(cm, event); }, - windowScroll: function() { reset(cm); }, - rects: null, - mouseX: null, mouseY: null, - willUpdate: false - }; - CodeMirror.on(cm.getWrapperElement(), "mousemove", data.mousemove); - CodeMirror.on(cm.getWrapperElement(), "mouseout", data.mouseout); - CodeMirror.on(window, "scroll", data.windowScroll); - cm.on("cursorActivity", reset); - cm.on("scroll", reset); - } - }); - - function mousemove(cm, event) { - var data = cm.state.selectionPointer; - if (event.buttons == null ? event.which : event.buttons) { - data.mouseX = data.mouseY = null; - } else { - data.mouseX = event.clientX; - data.mouseY = event.clientY; - } - scheduleUpdate(cm); - } - - function mouseout(cm, event) { - if (!cm.getWrapperElement().contains(event.relatedTarget)) { - var data = cm.state.selectionPointer; - data.mouseX = data.mouseY = null; - scheduleUpdate(cm); - } - } - - function reset(cm) { - cm.state.selectionPointer.rects = null; - scheduleUpdate(cm); - } - - function scheduleUpdate(cm) { - if (!cm.state.selectionPointer.willUpdate) { - cm.state.selectionPointer.willUpdate = true; - setTimeout(function() { - update(cm); - cm.state.selectionPointer.willUpdate = false; - }, 50); - } - } - - function update(cm) { - var data = cm.state.selectionPointer; - if (!data) return; - if (data.rects == null && data.mouseX != null) { - data.rects = []; - if (cm.somethingSelected()) { - for (var sel = cm.display.selectionDiv.firstChild; sel; sel = sel.nextSibling) - data.rects.push(sel.getBoundingClientRect()); - } - } - var inside = false; - if (data.mouseX != null) for (var i = 0; i < data.rects.length; i++) { - var rect = data.rects[i]; - if (rect.left <= data.mouseX && rect.right >= data.mouseX && - rect.top <= data.mouseY && rect.bottom >= data.mouseY) - inside = true; - } - var cursor = inside ? data.value : ""; - if (cm.display.lineDiv.style.cursor != cursor) - cm.display.lineDiv.style.cursor = cursor; - } -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/tern/tern.css b/src/main/resources/static/editor.md-master/lib/codemirror/addon/tern/tern.css deleted file mode 100644 index 76fba33..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/tern/tern.css +++ /dev/null @@ -1,86 +0,0 @@ -.CodeMirror-Tern-completion { - padding-left: 22px; - position: relative; -} -.CodeMirror-Tern-completion:before { - position: absolute; - left: 2px; - bottom: 2px; - border-radius: 50%; - font-size: 12px; - font-weight: bold; - height: 15px; - width: 15px; - line-height: 16px; - text-align: center; - color: white; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -.CodeMirror-Tern-completion-unknown:before { - content: "?"; - background: #4bb; -} -.CodeMirror-Tern-completion-object:before { - content: "O"; - background: #77c; -} -.CodeMirror-Tern-completion-fn:before { - content: "F"; - background: #7c7; -} -.CodeMirror-Tern-completion-array:before { - content: "A"; - background: #c66; -} -.CodeMirror-Tern-completion-number:before { - content: "1"; - background: #999; -} -.CodeMirror-Tern-completion-string:before { - content: "S"; - background: #999; -} -.CodeMirror-Tern-completion-bool:before { - content: "B"; - background: #999; -} - -.CodeMirror-Tern-completion-guess { - color: #999; -} - -.CodeMirror-Tern-tooltip { - border: 1px solid silver; - border-radius: 3px; - color: #444; - padding: 2px 5px; - font-size: 90%; - font-family: monospace; - background-color: white; - white-space: pre-wrap; - - max-width: 40em; - position: absolute; - z-index: 10; - -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2); - -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2); - box-shadow: 2px 3px 5px rgba(0,0,0,.2); - - transition: opacity 1s; - -moz-transition: opacity 1s; - -webkit-transition: opacity 1s; - -o-transition: opacity 1s; - -ms-transition: opacity 1s; -} - -.CodeMirror-Tern-hint-doc { - max-width: 25em; - margin-top: -3px; -} - -.CodeMirror-Tern-fname { color: black; } -.CodeMirror-Tern-farg { color: #70a; } -.CodeMirror-Tern-farg-current { text-decoration: underline; } -.CodeMirror-Tern-type { color: #07c; } -.CodeMirror-Tern-fhint-guess { opacity: .7; } diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/tern/tern.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/tern/tern.js deleted file mode 100644 index b049549..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/tern/tern.js +++ /dev/null @@ -1,697 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Glue code between CodeMirror and Tern. -// -// Create a CodeMirror.TernServer to wrap an actual Tern server, -// register open documents (CodeMirror.Doc instances) with it, and -// call its methods to activate the assisting functions that Tern -// provides. -// -// Options supported (all optional): -// * defs: An array of JSON definition data structures. -// * plugins: An object mapping plugin names to configuration -// options. -// * getFile: A function(name, c) that can be used to access files in -// the project that haven't been loaded yet. Simply do c(null) to -// indicate that a file is not available. -// * fileFilter: A function(value, docName, doc) that will be applied -// to documents before passing them on to Tern. -// * switchToDoc: A function(name, doc) that should, when providing a -// multi-file view, switch the view or focus to the named file. -// * showError: A function(editor, message) that can be used to -// override the way errors are displayed. -// * completionTip: Customize the content in tooltips for completions. -// Is passed a single argument—the completion's data as returned by -// Tern—and may return a string, DOM node, or null to indicate that -// no tip should be shown. By default the docstring is shown. -// * typeTip: Like completionTip, but for the tooltips shown for type -// queries. -// * responseFilter: A function(doc, query, request, error, data) that -// will be applied to the Tern responses before treating them -// -// -// It is possible to run the Tern server in a web worker by specifying -// these additional options: -// * useWorker: Set to true to enable web worker mode. You'll probably -// want to feature detect the actual value you use here, for example -// !!window.Worker. -// * workerScript: The main script of the worker. Point this to -// wherever you are hosting worker.js from this directory. -// * workerDeps: An array of paths pointing (relative to workerScript) -// to the Acorn and Tern libraries and any Tern plugins you want to -// load. Or, if you minified those into a single script and included -// them in the workerScript, simply leave this undefined. - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - // declare global: tern - - CodeMirror.TernServer = function(options) { - var self = this; - this.options = options || {}; - var plugins = this.options.plugins || (this.options.plugins = {}); - if (!plugins.doc_comment) plugins.doc_comment = true; - if (this.options.useWorker) { - this.server = new WorkerServer(this); - } else { - this.server = new tern.Server({ - getFile: function(name, c) { return getFile(self, name, c); }, - async: true, - defs: this.options.defs || [], - plugins: plugins - }); - } - this.docs = Object.create(null); - this.trackChange = function(doc, change) { trackChange(self, doc, change); }; - - this.cachedArgHints = null; - this.activeArgHints = null; - this.jumpStack = []; - - this.getHint = function(cm, c) { return hint(self, cm, c); }; - this.getHint.async = true; - }; - - CodeMirror.TernServer.prototype = { - addDoc: function(name, doc) { - var data = {doc: doc, name: name, changed: null}; - this.server.addFile(name, docValue(this, data)); - CodeMirror.on(doc, "change", this.trackChange); - return this.docs[name] = data; - }, - - delDoc: function(id) { - var found = resolveDoc(this, id); - if (!found) return; - CodeMirror.off(found.doc, "change", this.trackChange); - delete this.docs[found.name]; - this.server.delFile(found.name); - }, - - hideDoc: function(id) { - closeArgHints(this); - var found = resolveDoc(this, id); - if (found && found.changed) sendDoc(this, found); - }, - - complete: function(cm) { - cm.showHint({hint: this.getHint}); - }, - - showType: function(cm, pos, c) { showContextInfo(this, cm, pos, "type", c); }, - - showDocs: function(cm, pos, c) { showContextInfo(this, cm, pos, "documentation", c); }, - - updateArgHints: function(cm) { updateArgHints(this, cm); }, - - jumpToDef: function(cm) { jumpToDef(this, cm); }, - - jumpBack: function(cm) { jumpBack(this, cm); }, - - rename: function(cm) { rename(this, cm); }, - - selectName: function(cm) { selectName(this, cm); }, - - request: function (cm, query, c, pos) { - var self = this; - var doc = findDoc(this, cm.getDoc()); - var request = buildRequest(this, doc, query, pos); - - this.server.request(request, function (error, data) { - if (!error && self.options.responseFilter) - data = self.options.responseFilter(doc, query, request, error, data); - c(error, data); - }); - }, - - destroy: function () { - if (this.worker) { - this.worker.terminate(); - this.worker = null; - } - } - }; - - var Pos = CodeMirror.Pos; - var cls = "CodeMirror-Tern-"; - var bigDoc = 250; - - function getFile(ts, name, c) { - var buf = ts.docs[name]; - if (buf) - c(docValue(ts, buf)); - else if (ts.options.getFile) - ts.options.getFile(name, c); - else - c(null); - } - - function findDoc(ts, doc, name) { - for (var n in ts.docs) { - var cur = ts.docs[n]; - if (cur.doc == doc) return cur; - } - if (!name) for (var i = 0;; ++i) { - n = "[doc" + (i || "") + "]"; - if (!ts.docs[n]) { name = n; break; } - } - return ts.addDoc(name, doc); - } - - function resolveDoc(ts, id) { - if (typeof id == "string") return ts.docs[id]; - if (id instanceof CodeMirror) id = id.getDoc(); - if (id instanceof CodeMirror.Doc) return findDoc(ts, id); - } - - function trackChange(ts, doc, change) { - var data = findDoc(ts, doc); - - var argHints = ts.cachedArgHints; - if (argHints && argHints.doc == doc && cmpPos(argHints.start, change.to) <= 0) - ts.cachedArgHints = null; - - var changed = data.changed; - if (changed == null) - data.changed = changed = {from: change.from.line, to: change.from.line}; - var end = change.from.line + (change.text.length - 1); - if (change.from.line < changed.to) changed.to = changed.to - (change.to.line - end); - if (end >= changed.to) changed.to = end + 1; - if (changed.from > change.from.line) changed.from = change.from.line; - - if (doc.lineCount() > bigDoc && change.to - changed.from > 100) setTimeout(function() { - if (data.changed && data.changed.to - data.changed.from > 100) sendDoc(ts, data); - }, 200); - } - - function sendDoc(ts, doc) { - ts.server.request({files: [{type: "full", name: doc.name, text: docValue(ts, doc)}]}, function(error) { - if (error) window.console.error(error); - else doc.changed = null; - }); - } - - // Completion - - function hint(ts, cm, c) { - ts.request(cm, {type: "completions", types: true, docs: true, urls: true}, function(error, data) { - if (error) return showError(ts, cm, error); - var completions = [], after = ""; - var from = data.start, to = data.end; - if (cm.getRange(Pos(from.line, from.ch - 2), from) == "[\"" && - cm.getRange(to, Pos(to.line, to.ch + 2)) != "\"]") - after = "\"]"; - - for (var i = 0; i < data.completions.length; ++i) { - var completion = data.completions[i], className = typeToIcon(completion.type); - if (data.guess) className += " " + cls + "guess"; - completions.push({text: completion.name + after, - displayText: completion.name, - className: className, - data: completion}); - } - - var obj = {from: from, to: to, list: completions}; - var tooltip = null; - CodeMirror.on(obj, "close", function() { remove(tooltip); }); - CodeMirror.on(obj, "update", function() { remove(tooltip); }); - CodeMirror.on(obj, "select", function(cur, node) { - remove(tooltip); - var content = ts.options.completionTip ? ts.options.completionTip(cur.data) : cur.data.doc; - if (content) { - tooltip = makeTooltip(node.parentNode.getBoundingClientRect().right + window.pageXOffset, - node.getBoundingClientRect().top + window.pageYOffset, content); - tooltip.className += " " + cls + "hint-doc"; - } - }); - c(obj); - }); - } - - function typeToIcon(type) { - var suffix; - if (type == "?") suffix = "unknown"; - else if (type == "number" || type == "string" || type == "bool") suffix = type; - else if (/^fn\(/.test(type)) suffix = "fn"; - else if (/^\[/.test(type)) suffix = "array"; - else suffix = "object"; - return cls + "completion " + cls + "completion-" + suffix; - } - - // Type queries - - function showContextInfo(ts, cm, pos, queryName, c) { - ts.request(cm, queryName, function(error, data) { - if (error) return showError(ts, cm, error); - if (ts.options.typeTip) { - var tip = ts.options.typeTip(data); - } else { - var tip = elt("span", null, elt("strong", null, data.type || "not found")); - if (data.doc) - tip.appendChild(document.createTextNode(" — " + data.doc)); - if (data.url) { - tip.appendChild(document.createTextNode(" ")); - var child = tip.appendChild(elt("a", null, "[docs]")); - child.href = data.url; - child.target = "_blank"; - } - } - tempTooltip(cm, tip); - if (c) c(); - }, pos); - } - - // Maintaining argument hints - - function updateArgHints(ts, cm) { - closeArgHints(ts); - - if (cm.somethingSelected()) return; - var state = cm.getTokenAt(cm.getCursor()).state; - var inner = CodeMirror.innerMode(cm.getMode(), state); - if (inner.mode.name != "javascript") return; - var lex = inner.state.lexical; - if (lex.info != "call") return; - - var ch, argPos = lex.pos || 0, tabSize = cm.getOption("tabSize"); - for (var line = cm.getCursor().line, e = Math.max(0, line - 9), found = false; line >= e; --line) { - var str = cm.getLine(line), extra = 0; - for (var pos = 0;;) { - var tab = str.indexOf("\t", pos); - if (tab == -1) break; - extra += tabSize - (tab + extra) % tabSize - 1; - pos = tab + 1; - } - ch = lex.column - extra; - if (str.charAt(ch) == "(") {found = true; break;} - } - if (!found) return; - - var start = Pos(line, ch); - var cache = ts.cachedArgHints; - if (cache && cache.doc == cm.getDoc() && cmpPos(start, cache.start) == 0) - return showArgHints(ts, cm, argPos); - - ts.request(cm, {type: "type", preferFunction: true, end: start}, function(error, data) { - if (error || !data.type || !(/^fn\(/).test(data.type)) return; - ts.cachedArgHints = { - start: pos, - type: parseFnType(data.type), - name: data.exprName || data.name || "fn", - guess: data.guess, - doc: cm.getDoc() - }; - showArgHints(ts, cm, argPos); - }); - } - - function showArgHints(ts, cm, pos) { - closeArgHints(ts); - - var cache = ts.cachedArgHints, tp = cache.type; - var tip = elt("span", cache.guess ? cls + "fhint-guess" : null, - elt("span", cls + "fname", cache.name), "("); - for (var i = 0; i < tp.args.length; ++i) { - if (i) tip.appendChild(document.createTextNode(", ")); - var arg = tp.args[i]; - tip.appendChild(elt("span", cls + "farg" + (i == pos ? " " + cls + "farg-current" : ""), arg.name || "?")); - if (arg.type != "?") { - tip.appendChild(document.createTextNode(":\u00a0")); - tip.appendChild(elt("span", cls + "type", arg.type)); - } - } - tip.appendChild(document.createTextNode(tp.rettype ? ") ->\u00a0" : ")")); - if (tp.rettype) tip.appendChild(elt("span", cls + "type", tp.rettype)); - var place = cm.cursorCoords(null, "page"); - ts.activeArgHints = makeTooltip(place.right + 1, place.bottom, tip); - } - - function parseFnType(text) { - var args = [], pos = 3; - - function skipMatching(upto) { - var depth = 0, start = pos; - for (;;) { - var next = text.charAt(pos); - if (upto.test(next) && !depth) return text.slice(start, pos); - if (/[{\[\(]/.test(next)) ++depth; - else if (/[}\]\)]/.test(next)) --depth; - ++pos; - } - } - - // Parse arguments - if (text.charAt(pos) != ")") for (;;) { - var name = text.slice(pos).match(/^([^, \(\[\{]+): /); - if (name) { - pos += name[0].length; - name = name[1]; - } - args.push({name: name, type: skipMatching(/[\),]/)}); - if (text.charAt(pos) == ")") break; - pos += 2; - } - - var rettype = text.slice(pos).match(/^\) -> (.*)$/); - - return {args: args, rettype: rettype && rettype[1]}; - } - - // Moving to the definition of something - - function jumpToDef(ts, cm) { - function inner(varName) { - var req = {type: "definition", variable: varName || null}; - var doc = findDoc(ts, cm.getDoc()); - ts.server.request(buildRequest(ts, doc, req), function(error, data) { - if (error) return showError(ts, cm, error); - if (!data.file && data.url) { window.open(data.url); return; } - - if (data.file) { - var localDoc = ts.docs[data.file], found; - if (localDoc && (found = findContext(localDoc.doc, data))) { - ts.jumpStack.push({file: doc.name, - start: cm.getCursor("from"), - end: cm.getCursor("to")}); - moveTo(ts, doc, localDoc, found.start, found.end); - return; - } - } - showError(ts, cm, "Could not find a definition."); - }); - } - - if (!atInterestingExpression(cm)) - dialog(cm, "Jump to variable", function(name) { if (name) inner(name); }); - else - inner(); - } - - function jumpBack(ts, cm) { - var pos = ts.jumpStack.pop(), doc = pos && ts.docs[pos.file]; - if (!doc) return; - moveTo(ts, findDoc(ts, cm.getDoc()), doc, pos.start, pos.end); - } - - function moveTo(ts, curDoc, doc, start, end) { - doc.doc.setSelection(start, end); - if (curDoc != doc && ts.options.switchToDoc) { - closeArgHints(ts); - ts.options.switchToDoc(doc.name, doc.doc); - } - } - - // The {line,ch} representation of positions makes this rather awkward. - function findContext(doc, data) { - var before = data.context.slice(0, data.contextOffset).split("\n"); - var startLine = data.start.line - (before.length - 1); - var start = Pos(startLine, (before.length == 1 ? data.start.ch : doc.getLine(startLine).length) - before[0].length); - - var text = doc.getLine(startLine).slice(start.ch); - for (var cur = startLine + 1; cur < doc.lineCount() && text.length < data.context.length; ++cur) - text += "\n" + doc.getLine(cur); - if (text.slice(0, data.context.length) == data.context) return data; - - var cursor = doc.getSearchCursor(data.context, 0, false); - var nearest, nearestDist = Infinity; - while (cursor.findNext()) { - var from = cursor.from(), dist = Math.abs(from.line - start.line) * 10000; - if (!dist) dist = Math.abs(from.ch - start.ch); - if (dist < nearestDist) { nearest = from; nearestDist = dist; } - } - if (!nearest) return null; - - if (before.length == 1) - nearest.ch += before[0].length; - else - nearest = Pos(nearest.line + (before.length - 1), before[before.length - 1].length); - if (data.start.line == data.end.line) - var end = Pos(nearest.line, nearest.ch + (data.end.ch - data.start.ch)); - else - var end = Pos(nearest.line + (data.end.line - data.start.line), data.end.ch); - return {start: nearest, end: end}; - } - - function atInterestingExpression(cm) { - var pos = cm.getCursor("end"), tok = cm.getTokenAt(pos); - if (tok.start < pos.ch && (tok.type == "comment" || tok.type == "string")) return false; - return /\w/.test(cm.getLine(pos.line).slice(Math.max(pos.ch - 1, 0), pos.ch + 1)); - } - - // Variable renaming - - function rename(ts, cm) { - var token = cm.getTokenAt(cm.getCursor()); - if (!/\w/.test(token.string)) return showError(ts, cm, "Not at a variable"); - dialog(cm, "New name for " + token.string, function(newName) { - ts.request(cm, {type: "rename", newName: newName, fullDocs: true}, function(error, data) { - if (error) return showError(ts, cm, error); - applyChanges(ts, data.changes); - }); - }); - } - - function selectName(ts, cm) { - var name = findDoc(ts, cm.doc).name; - ts.request(cm, {type: "refs"}, function(error, data) { - if (error) return showError(ts, cm, error); - var ranges = [], cur = 0; - for (var i = 0; i < data.refs.length; i++) { - var ref = data.refs[i]; - if (ref.file == name) { - ranges.push({anchor: ref.start, head: ref.end}); - if (cmpPos(cur, ref.start) >= 0 && cmpPos(cur, ref.end) <= 0) - cur = ranges.length - 1; - } - } - cm.setSelections(ranges, cur); - }); - } - - var nextChangeOrig = 0; - function applyChanges(ts, changes) { - var perFile = Object.create(null); - for (var i = 0; i < changes.length; ++i) { - var ch = changes[i]; - (perFile[ch.file] || (perFile[ch.file] = [])).push(ch); - } - for (var file in perFile) { - var known = ts.docs[file], chs = perFile[file];; - if (!known) continue; - chs.sort(function(a, b) { return cmpPos(b.start, a.start); }); - var origin = "*rename" + (++nextChangeOrig); - for (var i = 0; i < chs.length; ++i) { - var ch = chs[i]; - known.doc.replaceRange(ch.text, ch.start, ch.end, origin); - } - } - } - - // Generic request-building helper - - function buildRequest(ts, doc, query, pos) { - var files = [], offsetLines = 0, allowFragments = !query.fullDocs; - if (!allowFragments) delete query.fullDocs; - if (typeof query == "string") query = {type: query}; - query.lineCharPositions = true; - if (query.end == null) { - query.end = pos || doc.doc.getCursor("end"); - if (doc.doc.somethingSelected()) - query.start = doc.doc.getCursor("start"); - } - var startPos = query.start || query.end; - - if (doc.changed) { - if (doc.doc.lineCount() > bigDoc && allowFragments !== false && - doc.changed.to - doc.changed.from < 100 && - doc.changed.from <= startPos.line && doc.changed.to > query.end.line) { - files.push(getFragmentAround(doc, startPos, query.end)); - query.file = "#0"; - var offsetLines = files[0].offsetLines; - if (query.start != null) query.start = Pos(query.start.line - -offsetLines, query.start.ch); - query.end = Pos(query.end.line - offsetLines, query.end.ch); - } else { - files.push({type: "full", - name: doc.name, - text: docValue(ts, doc)}); - query.file = doc.name; - doc.changed = null; - } - } else { - query.file = doc.name; - } - for (var name in ts.docs) { - var cur = ts.docs[name]; - if (cur.changed && cur != doc) { - files.push({type: "full", name: cur.name, text: docValue(ts, cur)}); - cur.changed = null; - } - } - - return {query: query, files: files}; - } - - function getFragmentAround(data, start, end) { - var doc = data.doc; - var minIndent = null, minLine = null, endLine, tabSize = 4; - for (var p = start.line - 1, min = Math.max(0, p - 50); p >= min; --p) { - var line = doc.getLine(p), fn = line.search(/\bfunction\b/); - if (fn < 0) continue; - var indent = CodeMirror.countColumn(line, null, tabSize); - if (minIndent != null && minIndent <= indent) continue; - minIndent = indent; - minLine = p; - } - if (minLine == null) minLine = min; - var max = Math.min(doc.lastLine(), end.line + 20); - if (minIndent == null || minIndent == CodeMirror.countColumn(doc.getLine(start.line), null, tabSize)) - endLine = max; - else for (endLine = end.line + 1; endLine < max; ++endLine) { - var indent = CodeMirror.countColumn(doc.getLine(endLine), null, tabSize); - if (indent <= minIndent) break; - } - var from = Pos(minLine, 0); - - return {type: "part", - name: data.name, - offsetLines: from.line, - text: doc.getRange(from, Pos(endLine, 0))}; - } - - // Generic utilities - - var cmpPos = CodeMirror.cmpPos; - - function elt(tagname, cls /*, ... elts*/) { - var e = document.createElement(tagname); - if (cls) e.className = cls; - for (var i = 2; i < arguments.length; ++i) { - var elt = arguments[i]; - if (typeof elt == "string") elt = document.createTextNode(elt); - e.appendChild(elt); - } - return e; - } - - function dialog(cm, text, f) { - if (cm.openDialog) - cm.openDialog(text + ": ", f); - else - f(prompt(text, "")); - } - - // Tooltips - - function tempTooltip(cm, content) { - if (cm.state.ternTooltip) remove(cm.state.ternTooltip); - var where = cm.cursorCoords(); - var tip = cm.state.ternTooltip = makeTooltip(where.right + 1, where.bottom, content); - function maybeClear() { - old = true; - if (!mouseOnTip) clear(); - } - function clear() { - cm.state.ternTooltip = null; - if (!tip.parentNode) return; - cm.off("cursorActivity", clear); - cm.off('blur', clear); - cm.off('scroll', clear); - fadeOut(tip); - } - var mouseOnTip = false, old = false; - CodeMirror.on(tip, "mousemove", function() { mouseOnTip = true; }); - CodeMirror.on(tip, "mouseout", function(e) { - if (!CodeMirror.contains(tip, e.relatedTarget || e.toElement)) { - if (old) clear(); - else mouseOnTip = false; - } - }); - setTimeout(maybeClear, 1700); - cm.on("cursorActivity", clear); - cm.on('blur', clear); - cm.on('scroll', clear); - } - - function makeTooltip(x, y, content) { - var node = elt("div", cls + "tooltip", content); - node.style.left = x + "px"; - node.style.top = y + "px"; - document.body.appendChild(node); - return node; - } - - function remove(node) { - var p = node && node.parentNode; - if (p) p.removeChild(node); - } - - function fadeOut(tooltip) { - tooltip.style.opacity = "0"; - setTimeout(function() { remove(tooltip); }, 1100); - } - - function showError(ts, cm, msg) { - if (ts.options.showError) - ts.options.showError(cm, msg); - else - tempTooltip(cm, String(msg)); - } - - function closeArgHints(ts) { - if (ts.activeArgHints) { remove(ts.activeArgHints); ts.activeArgHints = null; } - } - - function docValue(ts, doc) { - var val = doc.doc.getValue(); - if (ts.options.fileFilter) val = ts.options.fileFilter(val, doc.name, doc.doc); - return val; - } - - // Worker wrapper - - function WorkerServer(ts) { - var worker = ts.worker = new Worker(ts.options.workerScript); - worker.postMessage({type: "init", - defs: ts.options.defs, - plugins: ts.options.plugins, - scripts: ts.options.workerDeps}); - var msgId = 0, pending = {}; - - function send(data, c) { - if (c) { - data.id = ++msgId; - pending[msgId] = c; - } - worker.postMessage(data); - } - worker.onmessage = function(e) { - var data = e.data; - if (data.type == "getFile") { - getFile(ts, data.name, function(err, text) { - send({type: "getFile", err: String(err), text: text, id: data.id}); - }); - } else if (data.type == "debug") { - window.console.log(data.message); - } else if (data.id && pending[data.id]) { - pending[data.id](data.err, data.body); - delete pending[data.id]; - } - }; - worker.onerror = function(e) { - for (var id in pending) pending[id](e); - pending = {}; - }; - - this.addFile = function(name, text) { send({type: "add", name: name, text: text}); }; - this.delFile = function(name) { send({type: "del", name: name}); }; - this.request = function(body, c) { send({type: "req", body: body}, c); }; - } -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/tern/worker.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/tern/worker.js deleted file mode 100644 index 48277af..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/tern/worker.js +++ /dev/null @@ -1,44 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// declare global: tern, server - -var server; - -this.onmessage = function(e) { - var data = e.data; - switch (data.type) { - case "init": return startServer(data.defs, data.plugins, data.scripts); - case "add": return server.addFile(data.name, data.text); - case "del": return server.delFile(data.name); - case "req": return server.request(data.body, function(err, reqData) { - postMessage({id: data.id, body: reqData, err: err && String(err)}); - }); - case "getFile": - var c = pending[data.id]; - delete pending[data.id]; - return c(data.err, data.text); - default: throw new Error("Unknown message type: " + data.type); - } -}; - -var nextId = 0, pending = {}; -function getFile(file, c) { - postMessage({type: "getFile", name: file, id: ++nextId}); - pending[nextId] = c; -} - -function startServer(defs, plugins, scripts) { - if (scripts) importScripts.apply(null, scripts); - - server = new tern.Server({ - getFile: getFile, - async: true, - defs: defs, - plugins: plugins - }); -} - -var console = { - log: function(v) { postMessage({type: "debug", message: v}); } -}; diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addon/wrap/hardwrap.js b/src/main/resources/static/editor.md-master/lib/codemirror/addon/wrap/hardwrap.js deleted file mode 100644 index fe9b4dd..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addon/wrap/hardwrap.js +++ /dev/null @@ -1,139 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var Pos = CodeMirror.Pos; - - function findParagraph(cm, pos, options) { - var startRE = options.paragraphStart || cm.getHelper(pos, "paragraphStart"); - for (var start = pos.line, first = cm.firstLine(); start > first; --start) { - var line = cm.getLine(start); - if (startRE && startRE.test(line)) break; - if (!/\S/.test(line)) { ++start; break; } - } - var endRE = options.paragraphEnd || cm.getHelper(pos, "paragraphEnd"); - for (var end = pos.line + 1, last = cm.lastLine(); end <= last; ++end) { - var line = cm.getLine(end); - if (endRE && endRE.test(line)) { ++end; break; } - if (!/\S/.test(line)) break; - } - return {from: start, to: end}; - } - - function findBreakPoint(text, column, wrapOn, killTrailingSpace) { - for (var at = column; at > 0; --at) - if (wrapOn.test(text.slice(at - 1, at + 1))) break; - if (at == 0) at = column; - var endOfText = at; - if (killTrailingSpace) - while (text.charAt(endOfText - 1) == " ") --endOfText; - return {from: endOfText, to: at}; - } - - function wrapRange(cm, from, to, options) { - from = cm.clipPos(from); to = cm.clipPos(to); - var column = options.column || 80; - var wrapOn = options.wrapOn || /\s\S|-[^\.\d]/; - var killTrailing = options.killTrailingSpace !== false; - var changes = [], curLine = "", curNo = from.line; - var lines = cm.getRange(from, to, false); - if (!lines.length) return null; - var leadingSpace = lines[0].match(/^[ \t]*/)[0]; - - for (var i = 0; i < lines.length; ++i) { - var text = lines[i], oldLen = curLine.length, spaceInserted = 0; - if (curLine && text && !wrapOn.test(curLine.charAt(curLine.length - 1) + text.charAt(0))) { - curLine += " "; - spaceInserted = 1; - } - var spaceTrimmed = ""; - if (i) { - spaceTrimmed = text.match(/^\s*/)[0]; - text = text.slice(spaceTrimmed.length); - } - curLine += text; - if (i) { - var firstBreak = curLine.length > column && leadingSpace == spaceTrimmed && - findBreakPoint(curLine, column, wrapOn, killTrailing); - // If this isn't broken, or is broken at a different point, remove old break - if (!firstBreak || firstBreak.from != oldLen || firstBreak.to != oldLen + spaceInserted) { - changes.push({text: [spaceInserted ? " " : ""], - from: Pos(curNo, oldLen), - to: Pos(curNo + 1, spaceTrimmed.length)}); - } else { - curLine = leadingSpace + text; - ++curNo; - } - } - while (curLine.length > column) { - var bp = findBreakPoint(curLine, column, wrapOn, killTrailing); - changes.push({text: ["", leadingSpace], - from: Pos(curNo, bp.from), - to: Pos(curNo, bp.to)}); - curLine = leadingSpace + curLine.slice(bp.to); - ++curNo; - } - } - if (changes.length) cm.operation(function() { - for (var i = 0; i < changes.length; ++i) { - var change = changes[i]; - cm.replaceRange(change.text, change.from, change.to); - } - }); - return changes.length ? {from: changes[0].from, to: CodeMirror.changeEnd(changes[changes.length - 1])} : null; - } - - CodeMirror.defineExtension("wrapParagraph", function(pos, options) { - options = options || {}; - if (!pos) pos = this.getCursor(); - var para = findParagraph(this, pos, options); - return wrapRange(this, Pos(para.from, 0), Pos(para.to - 1), options); - }); - - CodeMirror.commands.wrapLines = function(cm) { - cm.operation(function() { - var ranges = cm.listSelections(), at = cm.lastLine() + 1; - for (var i = ranges.length - 1; i >= 0; i--) { - var range = ranges[i], span; - if (range.empty()) { - var para = findParagraph(cm, range.head, {}); - span = {from: Pos(para.from, 0), to: Pos(para.to - 1)}; - } else { - span = {from: range.from(), to: range.to()}; - } - if (span.to.line >= at) continue; - at = span.from.line; - wrapRange(cm, span.from, span.to, {}); - } - }); - }; - - CodeMirror.defineExtension("wrapRange", function(from, to, options) { - return wrapRange(this, from, to, options || {}); - }); - - CodeMirror.defineExtension("wrapParagraphsInRange", function(from, to, options) { - options = options || {}; - var cm = this, paras = []; - for (var line = from.line; line <= to.line;) { - var para = findParagraph(cm, Pos(line, 0), options); - paras.push(para); - line = para.to; - } - var madeChange = false; - if (paras.length) cm.operation(function() { - for (var i = paras.length - 1; i >= 0; --i) - madeChange = madeChange || wrapRange(cm, Pos(paras[i].from, 0), Pos(paras[i].to - 1), options); - }); - return madeChange; - }); -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/addons.min.js b/src/main/resources/static/editor.md-master/lib/codemirror/addons.min.js deleted file mode 100644 index a098080..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/addons.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! Editor.md v1.5.0 | addons.min.js | Open source online markdown editor. | MIT License | By: Pandao | https://github.com/pandao/editor.md | 2015-06-09 */ -!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineOption("showTrailingSpace",!1,function(t,i,o){o==e.Init&&(o=!1),o&&!i?t.removeOverlay("trailingspace"):!o&&i&&t.addOverlay({token:function(e){for(var t=e.string.length,i=t;i&&/\s/.test(e.string.charAt(i-1));--i);return i>e.pos?(e.pos=i,null):(e.pos=t,"trailingspace")},name:"trailingspace"})})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,i){var o,r=e.getWrapperElement();return o=r.appendChild(document.createElement("div")),i?o.className="CodeMirror-dialog CodeMirror-dialog-bottom":o.className="CodeMirror-dialog CodeMirror-dialog-top","string"==typeof t?o.innerHTML=t:o.appendChild(t),o}function i(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}e.defineExtension("openDialog",function(o,r,n){function a(e){if("string"==typeof e)h.value=e;else{if(c)return;c=!0,l.parentNode.removeChild(l),d.focus(),n.onClose&&n.onClose(l)}}n||(n={}),i(this,null);var s,l=t(this,o,n.bottom),c=!1,d=this,h=l.getElementsByTagName("input")[0];return h?(n.value&&(h.value=n.value,h.select()),n.onInput&&e.on(h,"input",function(e){n.onInput(e,h.value,a)}),n.onKeyUp&&e.on(h,"keyup",function(e){n.onKeyUp(e,h.value,a)}),e.on(h,"keydown",function(t){n&&n.onKeyDown&&n.onKeyDown(t,h.value,a)||((27==t.keyCode||n.closeOnEnter!==!1&&13==t.keyCode)&&(h.blur(),e.e_stop(t),a()),13==t.keyCode&&r(h.value,t))}),n.closeOnBlur!==!1&&e.on(h,"blur",a),h.focus()):(s=l.getElementsByTagName("button")[0])&&(e.on(s,"click",function(){a(),d.focus()}),n.closeOnBlur!==!1&&e.on(s,"blur",a),s.focus()),a}),e.defineExtension("openConfirm",function(o,r,n){function a(){c||(c=!0,s.parentNode.removeChild(s),d.focus())}i(this,null);var s=t(this,o,n&&n.bottom),l=s.getElementsByTagName("button"),c=!1,d=this,h=1;l[0].focus();for(var u=0;u=h&&a()},200)}),e.on(f,"focus",function(){++h})}}),e.defineExtension("openNotification",function(o,r){function n(){l||(l=!0,clearTimeout(a),s.parentNode.removeChild(s))}i(this,n);var a,s=t(this,o,r&&r.bottom),l=!1,c=r&&"undefined"!=typeof r.duration?r.duration:5e3;return e.on(s,"click",function(t){e.e_preventDefault(t),n()}),c&&(a=setTimeout(n,c)),n})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,r,n){if(this.atOccurrence=!1,this.doc=e,null==n&&"string"==typeof t&&(n=!1),r=r?e.clipPos(r):o(0,0),this.pos={from:r,to:r},"string"!=typeof t)t.global||(t=new RegExp(t.source,t.ignoreCase?"ig":"g")),this.matches=function(i,r){if(i){t.lastIndex=0;for(var n,a,s=e.getLine(r.line).slice(0,r.ch),l=0;;){t.lastIndex=l;var c=t.exec(s);if(!c)break;if(n=c,a=n.index,l=n.index+(n[0].length||1),l==s.length)break}var d=n&&n[0].length||0;d||(0==a&&0==s.length?n=void 0:a!=e.getLine(r.line).length&&d++)}else{t.lastIndex=r.ch;var s=e.getLine(r.line),n=t.exec(s),d=n&&n[0].length||0,a=n&&n.index;a+d==s.length||d||(d=1)}return n&&d?{from:o(r.line,a),to:o(r.line,a+d),match:n}:void 0};else{var a=t;n&&(t=t.toLowerCase());var s=n?function(e){return e.toLowerCase()}:function(e){return e},l=t.split("\n");if(1==l.length)t.length?this.matches=function(r,n){if(r){var l=e.getLine(n.line).slice(0,n.ch),c=s(l),d=c.lastIndexOf(t);if(d>-1)return d=i(l,c,d),{from:o(n.line,d),to:o(n.line,d+a.length)}}else{var l=e.getLine(n.line).slice(n.ch),c=s(l),d=c.indexOf(t);if(d>-1)return d=i(l,c,d)+n.ch,{from:o(n.line,d),to:o(n.line,d+a.length)}}}:this.matches=function(){};else{var c=a.split("\n");this.matches=function(t,i){var r=l.length-1;if(t){if(i.line-(l.length-1)=1;--d,--a)if(l[d]!=s(e.getLine(a)))return;var h=e.getLine(a),u=h.length-c[0].length;if(s(h.slice(u))!=l[0])return;return{from:o(a,u),to:n}}if(!(i.line+(l.length-1)>e.lastLine())){var h=e.getLine(i.line),u=h.length-c[0].length;if(s(h.slice(u))==l[0]){for(var f=o(i.line,u),a=i.line+1,d=1;r>d;++d,++a)if(l[d]!=s(e.getLine(a)))return;if(s(e.getLine(a).slice(0,c[r].length))==l[r])return{from:f,to:o(a,c[r].length)}}}}}}}function i(e,t,i){if(e.length==t.length)return i;for(var o=Math.min(i,e.length);;){var r=e.slice(0,o).toLowerCase().length;if(i>r)++o;else{if(!(r>i))return o;--o}}}var o=e.Pos;t.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){function t(e){var t=o(e,0);return i.pos={from:t,to:t},i.atOccurrence=!1,!1}for(var i=this,r=this.doc.clipPos(e?this.pos.from:this.pos.to);;){if(this.pos=this.matches(e,r))return this.atOccurrence=!0,this.pos.match||!0;if(e){if(!r.line)return t(0);r=o(r.line-1,this.doc.getLine(r.line-1).length)}else{var n=this.doc.lineCount();if(r.line==n-1)return t(n);r=o(r.line+1,0)}}},from:function(){return this.atOccurrence?this.pos.from:void 0},to:function(){return this.atOccurrence?this.pos.to:void 0},replace:function(t){if(this.atOccurrence){var i=e.splitLines(t);this.doc.replaceRange(i,this.pos.from,this.pos.to),this.pos.to=o(this.pos.from.line+i.length-1,i[i.length-1].length+(1==i.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",function(e,i,o){return new t(this.doc,e,i,o)}),e.defineDocExtension("getSearchCursor",function(e,i,o){return new t(this,e,i,o)}),e.defineExtension("selectMatches",function(t,i){for(var o,r=[],n=this.getSearchCursor(t,this.getCursor("from"),i);(o=n.findNext())&&!(e.cmpPos(n.to(),this.getCursor("to"))>0);)r.push({anchor:n.from(),head:n.to()});r.length&&this.setSelections(r,0)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./searchcursor"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../dialog/dialog"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){return"string"==typeof e?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),t?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(t){e.lastIndex=t.pos;var i=e.exec(t.string);return i&&i.index==t.pos?(t.pos+=i[0].length,"searching"):void(i?t.pos=i.index:t.skipToEnd())}}}function i(){this.posFrom=this.posTo=this.query=null,this.overlay=null}function o(e){return e.state.search||(e.state.search=new i)}function r(e){return"string"==typeof e&&e==e.toLowerCase()}function n(e,t,i){return e.getSearchCursor(t,i,r(t))}function a(e,t,i,o,r){e.openDialog?e.openDialog(t,r,{value:o}):r(prompt(i,o))}function s(e,t,i,o){e.openConfirm?e.openConfirm(t,o):confirm(i)&&o[0]()}function l(e){var t=e.match(/^\/(.*)\/([a-z]*)$/);if(t)try{e=new RegExp(t[1],-1==t[2].indexOf("i")?"":"i")}catch(i){}return("string"==typeof e?""==e:e.test(""))&&(e=/x^/),e}function c(e,i){var n=o(e);return n.query?d(e,i):void a(e,f,"Search for:",e.getSelection(),function(o){e.operation(function(){o&&!n.query&&(n.query=l(o),e.removeOverlay(n.overlay,r(n.query)),n.overlay=t(n.query,r(n.query)),e.addOverlay(n.overlay),e.showMatchesOnScrollbar&&(n.annotate&&(n.annotate.clear(),n.annotate=null),n.annotate=e.showMatchesOnScrollbar(n.query,r(n.query))),n.posFrom=n.posTo=e.getCursor(),d(e,i))})})}function d(t,i){t.operation(function(){var r=o(t),a=n(t,r.query,i?r.posFrom:r.posTo);(a.find(i)||(a=n(t,r.query,i?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0)),a.find(i)))&&(t.setSelection(a.from(),a.to()),t.scrollIntoView({from:a.from(),to:a.to()}),r.posFrom=a.from(),r.posTo=a.to())})}function h(e){e.operation(function(){var t=o(e);t.query&&(t.query=null,e.removeOverlay(t.overlay),t.annotate&&(t.annotate.clear(),t.annotate=null))})}function u(e,t){e.getOption("readOnly")||a(e,g,"Replace:",e.getSelection(),function(i){i&&(i=l(i),a(e,p,"Replace with:","",function(o){if(t)e.operation(function(){for(var t=n(e,i);t.findNext();)if("string"!=typeof i){var r=e.getRange(t.from(),t.to()).match(i);t.replace(o.replace(/\$(\d)/g,function(e,t){return r[t]}))}else t.replace(o)});else{h(e);var r=n(e,i,e.getCursor()),a=function(){var t,o=r.from();!(t=r.findNext())&&(r=n(e,i),!(t=r.findNext())||o&&r.from().line==o.line&&r.from().ch==o.ch)||(e.setSelection(r.from(),r.to()),e.scrollIntoView({from:r.from(),to:r.to()}),s(e,m,"Replace?",[function(){l(t)},a]))},l=function(e){r.replace("string"==typeof i?o:o.replace(/\$(\d)/g,function(t,i){return e[i]})),a()};a()}}))})}var f='Search: (Use /re/ syntax for regexp search)',g='Replace: (Use /re/ syntax for regexp search)',p='With: ',m="Replace? ";e.commands.find=function(e){h(e),c(e)},e.commands.findNext=c,e.commands.findPrev=function(e){c(e,!0)},e.commands.clearSearch=h,e.commands.replace=u,e.commands.replaceAll=function(e){u(e,!0)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){function i(e){clearTimeout(o.doRedraw),o.doRedraw=setTimeout(function(){o.redraw()},e)}this.cm=e,this.options=t,this.buttonHeight=t.scrollButtonHeight||e.getOption("scrollButtonHeight"),this.annotations=[],this.doRedraw=this.doUpdate=null,this.div=e.getWrapperElement().appendChild(document.createElement("div")),this.div.style.cssText="position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none",this.computeScale();var o=this;e.on("refresh",this.resizeHandler=function(){clearTimeout(o.doUpdate),o.doUpdate=setTimeout(function(){o.computeScale()&&i(20)},100)}),e.on("markerAdded",this.resizeHandler),e.on("markerCleared",this.resizeHandler),t.listenForChanges!==!1&&e.on("change",this.changeHandler=function(){i(250)})}e.defineExtension("annotateScrollbar",function(e){return"string"==typeof e&&(e={className:e}),new t(this,e)}),e.defineOption("scrollButtonHeight",0),t.prototype.computeScale=function(){var e=this.cm,t=(e.getWrapperElement().clientHeight-e.display.barHeight-2*this.buttonHeight)/e.heightAtLine(e.lastLine()+1,"local");return t!=this.hScale?(this.hScale=t,!0):void 0},t.prototype.update=function(e){this.annotations=e,this.redraw()},t.prototype.redraw=function(e){e!==!1&&this.computeScale();var t=this.cm,i=this.hScale,o=document.createDocumentFragment(),r=this.annotations;if(t.display.barWidth)for(var n,a=0;ac+.9));)s=r[++a],c=t.charCoords(s.to,"local").bottom*i;if(c!=l){var d=Math.max(c-l,3),h=o.appendChild(document.createElement("div"));h.style.cssText="position: absolute; right: 0px; width: "+Math.max(t.display.barWidth-1,2)+"px; top: "+(l+this.buttonHeight)+"px; height: "+d+"px",h.className=this.options.className}}this.div.textContent="",this.div.appendChild(o)},t.prototype.clear=function(){this.cm.off("refresh",this.resizeHandler),this.cm.off("markerAdded",this.resizeHandler),this.cm.off("markerCleared",this.resizeHandler),this.changeHandler&&this.cm.off("change",this.changeHandler),this.div.parentNode.removeChild(this.div)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./searchcursor"),require("../scroll/annotatescrollbar")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../scroll/annotatescrollbar"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,i,o){this.cm=e;var r={listenForChanges:!1};for(var n in o)r[n]=o[n];r.className||(r.className="CodeMirror-search-match"),this.annotation=e.annotateScrollbar(r),this.query=t,this.caseFold=i,this.gap={from:e.firstLine(),to:e.lastLine()+1},this.matches=[],this.update=null,this.findMatches(),this.annotation.update(this.matches);var a=this;e.on("change",this.changeHandler=function(e,t){a.onChange(t)})}function i(e,t,i){return t>=e?e:Math.max(t,e+i)}e.defineExtension("showMatchesOnScrollbar",function(e,i,o){return"string"==typeof o&&(o={className:o}),o||(o={}),new t(this,e,i,o)});var o=1e3;t.prototype.findMatches=function(){if(this.gap){for(var t=0;t=this.gap.to)break;i.to.line>=this.gap.from&&this.matches.splice(t--,1)}for(var r=this.cm.getSearchCursor(this.query,e.Pos(this.gap.from,0),this.caseFold);r.findNext();){var i={from:r.from(),to:r.to()};if(i.from.line>=this.gap.to)break;if(this.matches.splice(t++,0,i),this.matches.length>o)break}this.gap=null}},t.prototype.onChange=function(t){var o=t.from.line,r=e.changeEnd(t).line,n=r-t.to.line;if(this.gap?(this.gap.from=Math.min(i(this.gap.from,o,n),t.from.line),this.gap.to=Math.max(i(this.gap.to,o,n),t.from.line)):this.gap={from:t.from.line,to:r+1},n)for(var a=0;ac.ch&&(v=v.slice(0,v.length-d.end+c.ch));var w=v.toLowerCase();if(!v||"string"==d.type&&(d.end!=c.ch||!/[\"\']/.test(d.string.charAt(d.string.length-1))||1==d.string.length)||"tag"==d.type&&"closeTag"==u.type||d.string.indexOf("/")==d.string.length-1||p&&r(p,w)>-1||n(t,v,c,u,!0))return e.Pass;var b=m&&r(m,w)>-1;o[l]={indent:b,text:">"+(b?"\n\n":"")+"",newPos:b?e.Pos(c.line+1,0):e.Pos(c.line,c.ch+1)}}for(var l=i.length-1;l>=0;l--){var y=o[l];t.replaceRange(y.text,i[l].head,i[l].anchor,"+insert");var k=t.listSelections().slice(0);k[l]={head:y.newPos,anchor:y.newPos},t.setSelections(k),y.indent&&(t.indentLine(y.newPos.line,null,!0),t.indentLine(y.newPos.line+1,null,!0))}}function i(t,i){for(var o=t.listSelections(),r=[],a=i?"/":"";else{if("htmlmixed"!=t.getMode().name||"css"!=d.mode.name)return e.Pass;r[s]=a+"style>"}else{if(!h.context||!h.context.tagName||n(t,h.context.tagName,l,h))return e.Pass;r[s]=a+h.context.tagName+">"}}t.replaceSelections(r),o=t.listSelections();for(var s=0;si;++i)if(e[i]==t)return i;return-1}function n(t,i,o,r,n){if(!e.scanForClosingTag)return!1;var a=Math.min(t.lastLine()+1,o.line+500),s=e.scanForClosingTag(t,o,null,a);if(!s||s.tag!=i)return!1;for(var l=r.context,c=n?1:0;l&&l.tagName==i;l=l.prev)++c;o=s.to;for(var d=1;c>d;d++){var h=e.scanForClosingTag(t,o,null,a);if(!h||h.tag!=i)return!1;o=h.to}return!0}e.defineOption("autoCloseTags",!1,function(i,r,n){if(n!=e.Init&&n&&i.removeKeyMap("autoCloseTags"),r){var a={name:"autoCloseTags"};("object"!=typeof r||r.whenClosing)&&(a["'/'"]=function(e){return o(e)}),("object"!=typeof r||r.whenOpening)&&(a["'>'"]=function(e){return t(e)}),i.addKeyMap(a)}});var a=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],s=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];e.commands.closeTag=function(e){return i(e)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(t,r,n,a){function s(e){var i=l(t,r);if(!i||i.to.line-i.from.linet.firstLine();)r=e.Pos(r.line-1,0),d=s(!1);if(d&&!d.cleared&&"unfold"!==a){var h=i(t,n);e.on(h,"mousedown",function(t){u.clear(),e.e_preventDefault(t)});var u=t.markText(d.from,d.to,{replacedWith:h,clearOnEnter:!0,__isFold:!0});u.on("clear",function(i,o){e.signal(t,"unfold",t,i,o)}),e.signal(t,"fold",t,d.from,d.to)}}function i(e,t){var i=o(e,t,"widget");if("string"==typeof i){var r=document.createTextNode(i);i=document.createElement("span"),i.appendChild(r),i.className="CodeMirror-foldmarker"}return i}function o(e,t,i){if(t&&void 0!==t[i])return t[i];var o=e.options.foldOptions;return o&&void 0!==o[i]?o[i]:r[i]}e.newFoldFunction=function(e,i){return function(o,r){t(o,r,{rangeFinder:e,widget:i})}},e.defineExtension("foldCode",function(e,i,o){t(this,e,i,o)}),e.defineExtension("isFolded",function(e){for(var t=this.findMarksAt(e),i=0;i=i;i++)t.foldCode(e.Pos(i,0),null,"fold")})},e.commands.unfoldAll=function(t){t.operation(function(){for(var i=t.firstLine(),o=t.lastLine();o>=i;i++)t.foldCode(e.Pos(i,0),null,"unfold")})},e.registerHelper("fold","combine",function(){var e=Array.prototype.slice.call(arguments,0);return function(t,i){for(var o=0;o=s&&(i=r(n.indicatorOpen))}e.setGutterMarker(t,n.gutter,i),++a})}function a(e){var t=e.getViewport(),i=e.state.foldGutter;i&&(e.operation(function(){n(e,t.from,t.to)}),i.from=t.from,i.to=t.to)}function s(e,t,i){var o=e.state.foldGutter;if(o){var r=o.options;i==r.gutter&&e.foldCode(h(t,0),r.rangeFinder)}}function l(e){var t=e.state.foldGutter;if(t){var i=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){a(e)},i.foldOnChangeTimeSpan||600)}}function c(e){var t=e.state.foldGutter;if(t){var i=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){var i=e.getViewport();t.from==t.to||i.from-t.to>20||t.from-i.to>20?a(e):e.operation(function(){i.fromt.to&&(n(e,t.to,i.to),t.to=i.to)})},i.updateViewportTimeSpan||400)}}function d(e,t){var i=e.state.foldGutter;if(i){var o=t.line;o>=i.from&&o=l;++l){var d=t.getLine(l),h=n(d);if(h>a)s=l;else if(/\S/.test(d))break}return s?{from:e.Pos(i.line,r.length),to:e.Pos(s,t.getLine(s).length)}:void 0}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerHelper("fold","brace",function(t,i){function o(o){for(var r=i.ch,l=0;;){var c=0>=r?-1:s.lastIndexOf(o,r-1);if(-1!=c){if(1==l&&c=g;++g)for(var p=t.getLine(g),m=g==a?r:0;;){var v=p.indexOf(l,m),w=p.indexOf(c,m);if(0>v&&(v=p.length),0>w&&(w=p.length),m=Math.min(v,w),m==p.length)break;if(t.getTokenTypeAt(e.Pos(g,m+1))==n)if(m==v)++u;else if(!--u){d=g,h=m;break e}++m}if(null!=d&&(a!=d||h!=r))return{from:e.Pos(a,r),to:e.Pos(d,h)}}}),e.registerHelper("fold","import",function(t,i){function o(i){if(it.lastLine())return null;var o=t.getTokenAt(e.Pos(i,1));if(/\S/.test(o.string)||(o=t.getTokenAt(e.Pos(i,o.end+1))),"keyword"!=o.type||"import"!=o.string)return null;for(var r=i,n=Math.min(t.lastLine(),i+10);n>=r;++r){var a=t.getLine(r),s=a.indexOf(";");if(-1!=s)return{startCh:o.end,end:e.Pos(r,s)}}}var r,i=i.line,n=o(i);if(!n||o(i-1)||(r=o(i-2))&&r.end.line==i-1)return null;for(var a=n.end;;){var s=o(a.line+1);if(null==s)break;a=s.end}return{from:t.clipPos(e.Pos(i,n.startCh+1)),to:a}}),e.registerHelper("fold","include",function(t,i){function o(i){if(it.lastLine())return null;var o=t.getTokenAt(e.Pos(i,1));return/\S/.test(o.string)||(o=t.getTokenAt(e.Pos(i,o.end+1))),"meta"==o.type&&"#include"==o.string.slice(0,8)?o.start+8:void 0}var i=i.line,r=o(i);if(null==r||null!=o(i-1))return null;for(var n=i;;){var a=o(n+1);if(null==a)break;++n}return{from:e.Pos(i,r+1),to:t.clipPos(e.Pos(n))}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){return e.line-t.line||e.ch-t.ch}function i(e,t,i,o){this.line=t,this.ch=i,this.cm=e,this.text=e.getLine(t),this.min=o?o.from:e.firstLine(),this.max=o?o.to-1:e.lastLine()}function o(e,t){var i=e.cm.getTokenTypeAt(u(e.line,t));return i&&/\btag\b/.test(i)}function r(e){return e.line>=e.max?void 0:(e.ch=0,e.text=e.cm.getLine(++e.line),!0)}function n(e){return e.line<=e.min?void 0:(e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0)}function a(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(r(e))continue;return}{if(o(e,t+1)){var i=e.text.lastIndexOf("/",t),n=i>-1&&!/\S/.test(e.text.slice(i+1,t));return e.ch=t+1,n?"selfClose":"regular"}e.ch=t+1}}}function s(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(n(e))continue;return}if(o(e,t+1)){p.lastIndex=t,e.ch=t;var i=p.exec(e.text);if(i&&i.index==t)return i}else e.ch=t}}function l(e){for(;;){p.lastIndex=e.ch;var t=p.exec(e.text);if(!t){if(r(e))continue;return}{if(o(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}}function c(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(n(e))continue;return}{if(o(e,t+1)){var i=e.text.lastIndexOf("/",t),r=i>-1&&!/\S/.test(e.text.slice(i+1,t));return e.ch=t+1,r?"selfClose":"regular"}e.ch=t}}}function d(e,t){for(var i=[];;){var o,r=l(e),n=e.line,s=e.ch-(r?r[0].length:0);if(!r||!(o=a(e)))return;if("selfClose"!=o)if(r[1]){for(var c=i.length-1;c>=0;--c)if(i[c]==r[2]){i.length=c;break}if(0>c&&(!t||t==r[2]))return{tag:r[2],from:u(n,s),to:u(e.line,e.ch)}}else i.push(r[2])}}function h(e,t){for(var i=[];;){var o=c(e);if(!o)return;if("selfClose"!=o){var r=e.line,n=e.ch,a=s(e);if(!a)return;if(a[1])i.push(a[2]);else{for(var l=i.length-1;l>=0;--l)if(i[l]==a[2]){i.length=l;break}if(0>l&&(!t||t==a[2]))return{tag:a[2],from:u(e.line,e.ch),to:u(r,n)}}}else s(e)}}var u=e.Pos,f="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",g=f+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",p=new RegExp("<(/?)(["+f+"]["+g+"]*)","g");e.registerHelper("fold","xml",function(e,t){for(var o=new i(e,t.line,0);;){var r,n=l(o);if(!n||o.line!=t.line||!(r=a(o)))return;if(!n[1]&&"selfClose"!=r){var t=u(o.line,o.ch),s=d(o,n[2]);return s&&{from:t,to:s.from}}}}),e.findMatchingTag=function(e,o,r){var n=new i(e,o.line,o.ch,r);if(-1!=n.text.indexOf(">")||-1!=n.text.indexOf("<")){var l=a(n),c=l&&u(n.line,n.ch),f=l&&s(n);if(l&&f&&!(t(n,o)>0)){var g={from:u(n.line,n.ch),to:c,tag:f[2]};return"selfClose"==l?{open:g,close:null,at:"open"}:f[1]?{open:h(n,f[2]),close:g,at:"close"}:(n=new i(e,c.line,c.ch,r),{open:g,close:d(n,f[2]),at:"open"})}}},e.findEnclosingTag=function(e,t,o){for(var r=new i(e,t.line,t.ch,o);;){var n=h(r);if(!n)break;var a=new i(e,t.line,t.ch,o),s=d(a,n.tag);if(s)return{open:n,close:s}}},e.scanForClosingTag=function(e,t,o,r){var n=new i(e,t.line,t.ch,r?{from:0,to:r}:null);return d(n,o)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerHelper("fold","markdown",function(t,i){function o(i){var o=t.getTokenTypeAt(e.Pos(i,0));return o&&/\bheader\b/.test(o)}function r(e,t,i){var r=t&&t.match(/^#+/);return r&&o(e)?r[0].length:(r=i&&i.match(/^[=\-]+\s*$/),r&&o(e+1)?"="==i[0]?1:2:n)}var n=100,a=t.getLine(i.line),s=t.getLine(i.line+1),l=r(i.line,a,s);if(l===n)return void 0;for(var c=t.lastLine(),d=i.line,h=t.getLine(d+2);c>d&&!(r(d+1,s,h)<=l);)++d,s=h,h=t.getLine(d+2);return{from:e.Pos(i.line,a.length),to:e.Pos(d,t.getLine(d).length)}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerGlobalHelper("fold","comment",function(e){return e.blockCommentStart&&e.blockCommentEnd},function(t,i){var o=t.getModeAt(i),r=o.blockCommentStart,n=o.blockCommentEnd;if(r&&n){for(var a,s=i.line,l=t.getLine(s),c=i.ch,d=0;;){var h=0>=c?-1:l.lastIndexOf(r,c-1);if(-1!=h){if(1==d&&h=m;++m)for(var v=t.getLine(m),w=m==s?a:0;;){var b=v.indexOf(r,w),y=v.indexOf(n,w);if(0>b&&(b=v.length),0>y&&(y=v.length),w=Math.min(b,y),w==v.length)break;if(w==b)++g;else if(!--g){u=m,f=w;break e}++w}if(null!=u&&(s!=u||f!=a))return{from:e.Pos(s,a),to:e.Pos(u,f)}}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.overlayMode=function(t,i,o){return{startState:function(){return{base:e.startState(t),overlay:e.startState(i),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(o){return{base:e.copyState(t,o.base),overlay:e.copyState(i,o.overlay),basePos:o.basePos,baseCur:null,overlayPos:o.overlayPos,overlayCur:null}},token:function(e,r){return(e!=r.streamSeen||Math.min(r.basePos,r.overlayPos)=i.ch+1)return/\bstring2?\b/.test(s);a.start=a.pos}}function o(o,r){for(var n={name:"autoCloseBrackets",Backspace:function(i){if(i.getOption("disableInput"))return e.Pass;for(var r=i.listSelections(),n=0;n=0;n--){var s=r[n].head;i.replaceRange("",c(s.line,s.ch-1),c(s.line,s.ch+1))}}},a="",s=0;s1&&r.indexOf(t)>=0&&n.getRange(c(p.line,p.ch-2),p)==t+t&&(p.ch<=2||n.getRange(c(p.line,p.ch-3),c(p.line,p.ch-2))!=t))f="addFour";else if('"'==t||"'"==t){if(e.isWordChar(d)||!i(n,p,t))return e.Pass;f="both"}else{if(!(n.getLine(p.line).length==p.ch||a.indexOf(d)>=0||l.test(d)))return e.Pass;f="both"}else f="surround";if(s){if(s!=f)return e.Pass}else s=f}n.operation(function(){if("skip"==s)n.execCommand("goCharRight");else if("skipThree"==s)for(var e=0;3>e;e++)n.execCommand("goCharRight");else if("surround"==s){for(var i=n.getSelections(),e=0;es&&e.addOverlay(t.overlay=a(n.slice(s,l),i,t.style)))}var c=e.getCursor("from"),d=e.getCursor("to");if(c.line==d.line&&(!t.wordsOnly||r(e,c,d))){var h=e.getRange(c,d).replace(/^\s+|\s+$/g,"");h.length>=t.minChars&&e.addOverlay(t.overlay=a(h,!1,t.style))}})}function r(e,t,i){var o=e.getRange(t,i);if(null!==o.match(/^\w+$/)){if(t.ch>0){var r={line:t.line,ch:t.ch-1},n=e.getRange(r,t);if(null===n.match(/\W/))return!1}if(i.ch=15){presto=false;webkit=true}var flipCtrlCmd=mac&&(qtwebkit||presto&&(presto_version==null||presto_version<12.11));var captureRightClick=gecko||(ie&&ie_version>=9);var sawReadOnlySpans=false,sawCollapsedSpans=false;function CodeMirror(place,options){if(!(this instanceof CodeMirror)){return new CodeMirror(place,options)}this.options=options=options?copyObj(options):{};copyObj(defaults,options,false);setGuttersForLineNumbers(options);var doc=options.value;if(typeof doc=="string"){doc=new Doc(doc,options.mode)}this.doc=doc;var input=new CodeMirror.inputStyles[options.inputStyle](this);var display=this.display=new Display(place,doc,input);display.wrapper.CodeMirror=this;updateGutters(this);themeChanged(this);if(options.lineWrapping){this.display.wrapper.className+=" CodeMirror-wrap"}if(options.autofocus&&!mobile){display.input.focus()}initScrollbars(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:false,focused:false,suppressEdits:false,pasteIncoming:false,cutIncoming:false,draggingText:false,highlight:new Delayed(),keySeq:null};var cm=this;if(ie&&ie_version<11){setTimeout(function(){cm.display.input.reset(true)},20)}registerEventHandlers(this);ensureGlobalHandlers();startOperation(this);this.curOp.forceUpdate=true;attachDoc(this,doc);if((options.autofocus&&!mobile)||cm.hasFocus()){setTimeout(bind(onFocus,this),20)}else{onBlur(this)}for(var opt in optionHandlers){if(optionHandlers.hasOwnProperty(opt)){optionHandlers[opt](this,options[opt],Init)}}maybeUpdateLineNumberWidth(this);if(options.finishInit){options.finishInit(this)}for(var i=0;id.maxLineLength){d.maxLineLength=len;d.maxLine=line}})}function setGuttersForLineNumbers(options){var found=indexOf(options.gutters,"CodeMirror-linenumbers");if(found==-1&&options.lineNumbers){options.gutters=options.gutters.concat(["CodeMirror-linenumbers"])}else{if(found>-1&&!options.lineNumbers){options.gutters=options.gutters.slice(0);options.gutters.splice(found,1)}}}function measureForScrollbars(cm){var d=cm.display,gutterW=d.gutters.offsetWidth;var docH=Math.round(cm.doc.height+paddingVert(cm.display));return{clientHeight:d.scroller.clientHeight,viewHeight:d.wrapper.clientHeight,scrollWidth:d.scroller.scrollWidth,clientWidth:d.scroller.clientWidth,viewWidth:d.wrapper.clientWidth,barLeft:cm.options.fixedGutter?gutterW:0,docHeight:docH,scrollHeight:docH+scrollGap(cm)+d.barHeight,nativeBarWidth:d.nativeBarWidth,gutterWidth:gutterW}}function NativeScrollbars(place,scroll,cm){this.cm=cm;var vert=this.vert=elt("div",[elt("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar");var horiz=this.horiz=elt("div",[elt("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");place(vert);place(horiz);on(vert,"scroll",function(){if(vert.clientHeight){scroll(vert.scrollTop,"vertical")}});on(horiz,"scroll",function(){if(horiz.clientWidth){scroll(horiz.scrollLeft,"horizontal")}});this.checkedOverlay=false;if(ie&&ie_version<8){this.horiz.style.minHeight=this.vert.style.minWidth="18px"}}NativeScrollbars.prototype=copyObj({update:function(measure){var needsH=measure.scrollWidth>measure.clientWidth+1;var needsV=measure.scrollHeight>measure.clientHeight+1;var sWidth=measure.nativeBarWidth;if(needsV){this.vert.style.display="block";this.vert.style.bottom=needsH?sWidth+"px":"0";var totalHeight=measure.viewHeight-(needsH?sWidth:0);this.vert.firstChild.style.height=Math.max(0,measure.scrollHeight-measure.clientHeight+totalHeight)+"px" -}else{this.vert.style.display="";this.vert.firstChild.style.height="0"}if(needsH){this.horiz.style.display="block";this.horiz.style.right=needsV?sWidth+"px":"0";this.horiz.style.left=measure.barLeft+"px";var totalWidth=measure.viewWidth-measure.barLeft-(needsV?sWidth:0);this.horiz.firstChild.style.width=(measure.scrollWidth-measure.clientWidth+totalWidth)+"px"}else{this.horiz.style.display="";this.horiz.firstChild.style.width="0"}if(!this.checkedOverlay&&measure.clientHeight>0){if(sWidth==0){this.overlayHack()}this.checkedOverlay=true}return{right:needsV?sWidth:0,bottom:needsH?sWidth:0}},setScrollLeft:function(pos){if(this.horiz.scrollLeft!=pos){this.horiz.scrollLeft=pos}},setScrollTop:function(pos){if(this.vert.scrollTop!=pos){this.vert.scrollTop=pos}},overlayHack:function(){var w=mac&&!mac_geMountainLion?"12px":"18px";this.horiz.style.minHeight=this.vert.style.minWidth=w;var self=this;var barMouseDown=function(e){if(e_target(e)!=self.vert&&e_target(e)!=self.horiz){operation(self.cm,onMouseDown)(e)}};on(this.vert,"mousedown",barMouseDown);on(this.horiz,"mousedown",barMouseDown)},clear:function(){var parent=this.horiz.parentNode;parent.removeChild(this.horiz);parent.removeChild(this.vert)}},NativeScrollbars.prototype);function NullScrollbars(){}NullScrollbars.prototype=copyObj({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},NullScrollbars.prototype);CodeMirror.scrollbarModel={"native":NativeScrollbars,"null":NullScrollbars};function initScrollbars(cm){if(cm.display.scrollbars){cm.display.scrollbars.clear();if(cm.display.scrollbars.addClass){rmClass(cm.display.wrapper,cm.display.scrollbars.addClass)}}cm.display.scrollbars=new CodeMirror.scrollbarModel[cm.options.scrollbarStyle](function(node){cm.display.wrapper.insertBefore(node,cm.display.scrollbarFiller);on(node,"mousedown",function(){if(cm.state.focused){setTimeout(function(){cm.display.input.focus()},0)}});node.setAttribute("cm-not-content","true")},function(pos,axis){if(axis=="horizontal"){setScrollLeft(cm,pos)}else{setScrollTop(cm,pos)}},cm);if(cm.display.scrollbars.addClass){addClass(cm.display.wrapper,cm.display.scrollbars.addClass)}}function updateScrollbars(cm,measure){if(!measure){measure=measureForScrollbars(cm)}var startWidth=cm.display.barWidth,startHeight=cm.display.barHeight;updateScrollbarsInner(cm,measure);for(var i=0;i<4&&startWidth!=cm.display.barWidth||startHeight!=cm.display.barHeight;i++){if(startWidth!=cm.display.barWidth&&cm.options.lineWrapping){updateHeightsInViewport(cm)}updateScrollbarsInner(cm,measureForScrollbars(cm));startWidth=cm.display.barWidth;startHeight=cm.display.barHeight}}function updateScrollbarsInner(cm,measure){var d=cm.display;var sizes=d.scrollbars.update(measure);d.sizer.style.paddingRight=(d.barWidth=sizes.right)+"px";d.sizer.style.paddingBottom=(d.barHeight=sizes.bottom)+"px";if(sizes.right&&sizes.bottom){d.scrollbarFiller.style.display="block";d.scrollbarFiller.style.height=sizes.bottom+"px";d.scrollbarFiller.style.width=sizes.right+"px"}else{d.scrollbarFiller.style.display=""}if(sizes.bottom&&cm.options.coverGutterNextToScrollbar&&cm.options.fixedGutter){d.gutterFiller.style.display="block";d.gutterFiller.style.height=sizes.bottom+"px";d.gutterFiller.style.width=measure.gutterWidth+"px"}else{d.gutterFiller.style.display=""}}function visibleLines(display,doc,viewport){var top=viewport&&viewport.top!=null?Math.max(0,viewport.top):display.scroller.scrollTop;top=Math.floor(top-paddingTop(display));var bottom=viewport&&viewport.bottom!=null?viewport.bottom:top+display.wrapper.clientHeight;var from=lineAtHeight(doc,top),to=lineAtHeight(doc,bottom);if(viewport&&viewport.ensure){var ensureFrom=viewport.ensure.from.line,ensureTo=viewport.ensure.to.line;if(ensureFrom=to){from=lineAtHeight(doc,heightAtLine(getLine(doc,ensureTo))-display.wrapper.clientHeight);to=ensureTo}}}return{from:from,to:Math.max(to,from+1)}}function alignHorizontally(cm){var display=cm.display,view=display.view;if(!display.alignWidgets&&(!display.gutters.firstChild||!cm.options.fixedGutter)){return}var comp=compensateForHScroll(display)-display.scroller.scrollLeft+cm.doc.scrollLeft;var gutterW=display.gutters.offsetWidth,left=comp+"px";for(var i=0;i=display.viewFrom&&update.visible.to<=display.viewTo&&(display.updateLineNumbers==null||display.updateLineNumbers>=display.viewTo)&&display.renderedView==display.view&&countDirtyView(cm)==0){return false}if(maybeUpdateLineNumberWidth(cm)){resetView(cm);update.dims=getDimensions(cm)}var end=doc.first+doc.size;var from=Math.max(update.visible.from-cm.options.viewportMargin,doc.first);var to=Math.min(end,update.visible.to+cm.options.viewportMargin);if(display.viewFromto&&display.viewTo-to<20){to=Math.min(end,display.viewTo)}if(sawCollapsedSpans){from=visualLineNo(cm.doc,from);to=visualLineEndNo(cm.doc,to)}var different=from!=display.viewFrom||to!=display.viewTo||display.lastWrapHeight!=update.wrapperHeight||display.lastWrapWidth!=update.wrapperWidth;adjustView(cm,from,to);display.viewOffset=heightAtLine(getLine(cm.doc,display.viewFrom));cm.display.mover.style.top=display.viewOffset+"px";var toUpdate=countDirtyView(cm);if(!different&&toUpdate==0&&!update.force&&display.renderedView==display.view&&(display.updateLineNumbers==null||display.updateLineNumbers>=display.viewTo)){return false}var focused=activeElt();if(toUpdate>4){display.lineDiv.style.display="none"}patchDisplay(cm,display.updateLineNumbers,update.dims);if(toUpdate>4){display.lineDiv.style.display=""}display.renderedView=display.view;if(focused&&activeElt()!=focused&&focused.offsetHeight){focused.focus()}removeChildren(display.cursorDiv);removeChildren(display.selectionDiv);display.gutters.style.height=0;if(different){display.lastWrapHeight=update.wrapperHeight;display.lastWrapWidth=update.wrapperWidth;startWorker(cm,400)}display.updateLineNumbers=null;return true}function postUpdateDisplay(cm,update){var force=update.force,viewport=update.viewport;for(var first=true;;first=false){if(first&&cm.options.lineWrapping&&update.oldDisplayWidth!=displayWidth(cm)){force=true}else{force=false;if(viewport&&viewport.top!=null){viewport={top:Math.min(cm.doc.height+paddingVert(cm.display)-displayHeight(cm),viewport.top)}}update.visible=visibleLines(cm.display,cm.doc,viewport);if(update.visible.from>=cm.display.viewFrom&&update.visible.to<=cm.display.viewTo){break}}if(!updateDisplayIfNeeded(cm,update)){break}updateHeightsInViewport(cm);var barMeasure=measureForScrollbars(cm);updateSelection(cm);setDocumentHeight(cm,barMeasure);updateScrollbars(cm,barMeasure)}update.signal(cm,"update",cm);if(cm.display.viewFrom!=cm.display.reportedViewFrom||cm.display.viewTo!=cm.display.reportedViewTo){update.signal(cm,"viewportChange",cm,cm.display.viewFrom,cm.display.viewTo);cm.display.reportedViewFrom=cm.display.viewFrom;cm.display.reportedViewTo=cm.display.viewTo}}function updateDisplaySimple(cm,viewport){var update=new DisplayUpdate(cm,viewport);if(updateDisplayIfNeeded(cm,update)){updateHeightsInViewport(cm);postUpdateDisplay(cm,update);var barMeasure=measureForScrollbars(cm);updateSelection(cm);setDocumentHeight(cm,barMeasure);updateScrollbars(cm,barMeasure);update.finish()}}function setDocumentHeight(cm,measure){cm.display.sizer.style.minHeight=measure.docHeight+"px";var total=measure.docHeight+cm.display.barHeight; -cm.display.heightForcer.style.top=total+"px";cm.display.gutters.style.height=Math.max(total+scrollGap(cm),measure.clientHeight)+"px"}function updateHeightsInViewport(cm){var display=cm.display;var prevBottom=display.lineDiv.offsetTop;for(var i=0;i0.001||diff<-0.001){updateLineHeight(cur.line,height);updateWidgetHeight(cur.line);if(cur.rest){for(var j=0;j-1){updateNumber=false}updateLineForChanges(cm,lineView,lineN,dims)}if(updateNumber){removeChildren(lineView.lineNumber);lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options,lineN)))}cur=lineView.node.nextSibling}}lineN+=lineView.size}while(cur){cur=rm(cur)}}function updateLineForChanges(cm,lineView,lineN,dims){for(var j=0;j1){if(lastCopied&&lastCopied.join("\n")==inserted){multiPaste=sel.ranges.length%lastCopied.length==0&&map(lastCopied,splitLines)}else{if(textLines.length==sel.ranges.length){multiPaste=map(textLines,function(l){return[l]})}}}for(var i=sel.ranges.length-1;i>=0;i--){var range=sel.ranges[i];var from=range.from(),to=range.to();if(range.empty()){if(deleted&&deleted>0){from=Pos(from.line,from.ch-deleted)}else{if(cm.state.overwrite&&!cm.state.pasteIncoming){to=Pos(to.line,Math.min(getLine(doc,to.line).text.length,to.ch+lst(textLines).length))}}}var updateInput=cm.curOp.updateInput;var changeEvent={from:from,to:to,text:multiPaste?multiPaste[i%multiPaste.length]:textLines,origin:cm.state.pasteIncoming?"paste":cm.state.cutIncoming?"cut":"+input"};makeChange(cm.doc,changeEvent);signalLater(cm,"inputRead",cm,changeEvent);if(inserted&&!cm.state.pasteIncoming&&cm.options.electricChars&&cm.options.smartIndent&&range.head.ch<100&&(!i||sel.ranges[i-1].head.line!=range.head.line)){var mode=cm.getModeAt(range.head);var end=changeEnd(changeEvent);if(mode.electricChars){for(var j=0;j-1){indentLine(cm,end.line,"smart");break}}}else{if(mode.electricInput){if(mode.electricInput.test(getLine(doc,end.line).text.slice(0,end.ch))){indentLine(cm,end.line,"smart")}}}}}ensureCursorVisible(cm);cm.curOp.updateInput=updateInput;cm.curOp.typing=true;cm.state.pasteIncoming=cm.state.cutIncoming=false}function copyableRanges(cm){var text=[],ranges=[];for(var i=0;i=9&&input.hasSelection){input.hasSelection=null}input.poll()});on(te,"paste",function(){if(webkit&&!cm.state.fakedLastChar&&!(new Date-cm.state.lastMiddleDown<200)){var start=te.selectionStart,end=te.selectionEnd;te.value+="$";te.selectionEnd=end;te.selectionStart=start;cm.state.fakedLastChar=true}cm.state.pasteIncoming=true;input.fastPoll()});function prepareCopyCut(e){if(cm.somethingSelected()){lastCopied=cm.getSelections();if(input.inaccurateSelection){input.prevInput="";input.inaccurateSelection=false;te.value=lastCopied.join("\n");selectInput(te)}}else{var ranges=copyableRanges(cm);lastCopied=ranges.text;if(e.type=="cut"){cm.setSelections(ranges.ranges,null,sel_dontScroll)}else{input.prevInput="";te.value=ranges.text.join("\n");selectInput(te)}}if(e.type=="cut"){cm.state.cutIncoming=true}}on(te,"cut",prepareCopyCut);on(te,"copy",prepareCopyCut);on(display.scroller,"paste",function(e){if(eventInWidget(display,e)){return}cm.state.pasteIncoming=true;input.focus()});on(display.lineSpace,"selectstart",function(e){if(!eventInWidget(display,e)){e_preventDefault(e)}})},prepareSelection:function(){var cm=this.cm,display=cm.display,doc=cm.doc;var result=prepareSelection(cm);if(cm.options.moveInputWithCursor){var headPos=cursorCoords(cm,doc.sel.primary().head,"div");var wrapOff=display.wrapper.getBoundingClientRect(),lineOff=display.lineDiv.getBoundingClientRect();result.teTop=Math.max(0,Math.min(display.wrapper.clientHeight-10,headPos.top+lineOff.top-wrapOff.top));result.teLeft=Math.max(0,Math.min(display.wrapper.clientWidth-10,headPos.left+lineOff.left-wrapOff.left))}return result},showSelection:function(drawn){var cm=this.cm,display=cm.display;removeChildrenAndAdd(display.cursorDiv,drawn.cursors);removeChildrenAndAdd(display.selectionDiv,drawn.selection);if(drawn.teTop!=null){this.wrapper.style.top=drawn.teTop+"px";this.wrapper.style.left=drawn.teLeft+"px"}},reset:function(typing){if(this.contextMenuPending){return}var minimal,selected,cm=this.cm,doc=cm.doc;if(cm.somethingSelected()){this.prevInput="";var range=doc.sel.primary();minimal=hasCopyEvent&&(range.to().line-range.from().line>100||(selected=cm.getSelection()).length>1000);var content=minimal?"-":selected||cm.getSelection();this.textarea.value=content;if(cm.state.focused){selectInput(this.textarea)}if(ie&&ie_version>=9){this.hasSelection=content}}else{if(!typing){this.prevInput=this.textarea.value="";if(ie&&ie_version>=9){this.hasSelection=null}}}this.inaccurateSelection=minimal},getField:function(){return this.textarea},supportsTouch:function(){return false},focus:function(){if(this.cm.options.readOnly!="nocursor"&&(!mobile||activeElt()!=this.textarea)){try{this.textarea.focus()}catch(e){}}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var input=this;if(input.pollingFast){return}input.polling.set(this.cm.options.pollInterval,function(){input.poll();if(input.cm.state.focused){input.slowPoll()}})},fastPoll:function(){var missed=false,input=this;input.pollingFast=true;function p(){var changed=input.poll();if(!changed&&!missed){missed=true;input.polling.set(60,p)}else{input.pollingFast=false;input.slowPoll()}}input.polling.set(20,p)},poll:function(){var cm=this.cm,input=this.textarea,prevInput=this.prevInput;if(!cm.state.focused||(hasSelection(input)&&!prevInput)||isReadOnly(cm)||cm.options.disableInput||cm.state.keySeq){return false}if(cm.state.pasteIncoming&&cm.state.fakedLastChar){input.value=input.value.substring(0,input.value.length-1);cm.state.fakedLastChar=false}var text=input.value;if(text==prevInput&&!cm.somethingSelected()){return false}if(ie&&ie_version>=9&&this.hasSelection===text||mac&&/[\uf700-\uf7ff]/.test(text)){cm.display.input.reset();return false}if(text.charCodeAt(0)==8203&&cm.doc.sel==cm.display.selForContextMenu&&!prevInput){prevInput="\u200b" -}var same=0,l=Math.min(prevInput.length,text.length);while(same1000||text.indexOf("\n")>-1){input.value=self.prevInput=""}else{self.prevInput=text}});return true},ensurePolled:function(){if(this.pollingFast&&this.poll()){this.pollingFast=false}},onKeyPress:function(){if(ie&&ie_version>=9){this.hasSelection=null}this.fastPoll()},onContextMenu:function(e){var input=this,cm=input.cm,display=cm.display,te=input.textarea;var pos=posFromMouse(cm,e),scrollPos=display.scroller.scrollTop;if(!pos||presto){return}var reset=cm.options.resetSelectionOnContextMenu;if(reset&&cm.doc.sel.contains(pos)==-1){operation(cm,setSelection)(cm.doc,simpleSelection(pos),sel_dontScroll)}var oldCSS=te.style.cssText;input.wrapper.style.position="absolute";te.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: "+(ie?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";if(webkit){var oldScrollY=window.scrollY}display.input.focus();if(webkit){window.scrollTo(null,oldScrollY)}display.input.reset();if(!cm.somethingSelected()){te.value=input.prevInput=" "}input.contextMenuPending=true;display.selForContextMenu=cm.doc.sel;clearTimeout(display.detectingSelectAll);function prepareSelectAllHack(){if(te.selectionStart!=null){var selected=cm.somethingSelected();var extval=te.value="\u200b"+(selected?te.value:"");input.prevInput=selected?"":"\u200b";te.selectionStart=1;te.selectionEnd=extval.length;display.selForContextMenu=cm.doc.sel}}function rehide(){input.contextMenuPending=false;input.wrapper.style.position="relative";te.style.cssText=oldCSS;if(ie&&ie_version<9){display.scrollbars.setScrollTop(display.scroller.scrollTop=scrollPos)}if(te.selectionStart!=null){if(!ie||(ie&&ie_version<9)){prepareSelectAllHack()}var i=0,poll=function(){if(display.selForContextMenu==cm.doc.sel&&te.selectionStart==0){operation(cm,commands.selectAll)(cm)}else{if(i++<10){display.detectingSelectAll=setTimeout(poll,500)}else{display.input.reset()}}};display.detectingSelectAll=setTimeout(poll,200)}}if(ie&&ie_version>=9){prepareSelectAllHack()}if(captureRightClick){e_stop(e);var mouseup=function(){off(window,"mouseup",mouseup);setTimeout(rehide,20)};on(window,"mouseup",mouseup)}else{setTimeout(rehide,50)}},setUneditable:nothing,needsContentAttribute:false},TextareaInput.prototype);function ContentEditableInput(cm){this.cm=cm;this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null;this.polling=new Delayed()}ContentEditableInput.prototype=copyObj({init:function(display){var input=this,cm=input.cm;var div=input.div=display.lineDiv;div.contentEditable="true";disableBrowserMagic(div);on(div,"paste",function(e){var pasted=e.clipboardData&&e.clipboardData.getData("text/plain");if(pasted){e.preventDefault();cm.replaceSelection(pasted,null,"paste")}});on(div,"compositionstart",function(e){var data=e.data;input.composing={sel:cm.doc.sel,data:data,startData:data};if(!data){return}var prim=cm.doc.sel.primary();var line=cm.getLine(prim.head.line);var found=line.indexOf(data,Math.max(0,prim.head.ch-data.length));if(found>-1&&found<=prim.head.ch){input.composing.sel=simpleSelection(Pos(prim.head.line,found),Pos(prim.head.line,found+data.length))}});on(div,"compositionupdate",function(e){input.composing.data=e.data});on(div,"compositionend",function(e){var ours=input.composing;if(!ours){return}if(e.data!=ours.startData&&!/\u200b/.test(e.data)){ours.data=e.data}setTimeout(function(){if(!ours.handled){input.applyComposition(ours)}if(input.composing==ours){input.composing=null}},50)});on(div,"touchstart",function(){input.forceCompositionEnd()});on(div,"input",function(){if(input.composing){return}if(!input.pollContent()){runInOp(input.cm,function(){regChange(cm)})}});function onCopyCut(e){if(cm.somethingSelected()){lastCopied=cm.getSelections();if(e.type=="cut"){cm.replaceSelection("",null,"cut")}}else{var ranges=copyableRanges(cm);lastCopied=ranges.text;if(e.type=="cut"){cm.operation(function(){cm.setSelections(ranges.ranges,0,sel_dontScroll);cm.replaceSelection("",null,"cut")})}}if(e.clipboardData&&!ios){e.preventDefault();e.clipboardData.clearData();e.clipboardData.setData("text/plain",lastCopied.join("\n"))}else{var kludge=hiddenTextarea(),te=kludge.firstChild;cm.display.lineSpace.insertBefore(kludge,cm.display.lineSpace.firstChild);te.value=lastCopied.join("\n");var hadFocus=document.activeElement;selectInput(te);setTimeout(function(){cm.display.lineSpace.removeChild(kludge);hadFocus.focus()},50)}}on(div,"copy",onCopyCut);on(div,"cut",onCopyCut)},prepareSelection:function(){var result=prepareSelection(this.cm,false);result.focus=this.cm.state.focused;return result},showSelection:function(info){if(!info||!this.cm.display.view.length){return -}if(info.focus){this.showPrimarySelection()}this.showMultipleSelections(info)},showPrimarySelection:function(){var sel=window.getSelection(),prim=this.cm.doc.sel.primary();var curAnchor=domToPos(this.cm,sel.anchorNode,sel.anchorOffset);var curFocus=domToPos(this.cm,sel.focusNode,sel.focusOffset);if(curAnchor&&!curAnchor.bad&&curFocus&&!curFocus.bad&&cmp(minPos(curAnchor,curFocus),prim.from())==0&&cmp(maxPos(curAnchor,curFocus),prim.to())==0){return}var start=posToDOM(this.cm,prim.from());var end=posToDOM(this.cm,prim.to());if(!start&&!end){return}var view=this.cm.display.view;var old=sel.rangeCount&&sel.getRangeAt(0);if(!start){start={node:view[0].measure.map[2],offset:0}}else{if(!end){var measure=view[view.length-1].measure;var map=measure.maps?measure.maps[measure.maps.length-1]:measure.map;end={node:map[map.length-1],offset:map[map.length-2]-map[map.length-3]}}}try{var rng=range(start.node,start.offset,end.offset,end.node)}catch(e){}if(rng){sel.removeAllRanges();sel.addRange(rng);if(old&&sel.anchorNode==null){sel.addRange(old)}}this.rememberSelection()},showMultipleSelections:function(info){removeChildrenAndAdd(this.cm.display.cursorDiv,info.cursors);removeChildrenAndAdd(this.cm.display.selectionDiv,info.selection)},rememberSelection:function(){var sel=window.getSelection();this.lastAnchorNode=sel.anchorNode;this.lastAnchorOffset=sel.anchorOffset;this.lastFocusNode=sel.focusNode;this.lastFocusOffset=sel.focusOffset},selectionInEditor:function(){var sel=window.getSelection();if(!sel.rangeCount){return false}var node=sel.getRangeAt(0).commonAncestorContainer;return contains(this.div,node)},focus:function(){if(this.cm.options.readOnly!="nocursor"){this.div.focus()}},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return true},receivedFocus:function(){var input=this;if(this.selectionInEditor()){this.pollSelection()}else{runInOp(this.cm,function(){input.cm.curOp.selectionChanged=true})}function poll(){if(input.cm.state.focused){input.pollSelection();input.polling.set(input.cm.options.pollInterval,poll)}}this.polling.set(this.cm.options.pollInterval,poll)},pollSelection:function(){if(this.composing){return}var sel=window.getSelection(),cm=this.cm;if(sel.anchorNode!=this.lastAnchorNode||sel.anchorOffset!=this.lastAnchorOffset||sel.focusNode!=this.lastFocusNode||sel.focusOffset!=this.lastFocusOffset){this.rememberSelection();var anchor=domToPos(cm,sel.anchorNode,sel.anchorOffset);var head=domToPos(cm,sel.focusNode,sel.focusOffset);if(anchor&&head){runInOp(cm,function(){setSelection(cm.doc,simpleSelection(anchor,head),sel_dontScroll);if(anchor.bad||head.bad){cm.curOp.selectionChanged=true}})}}},pollContent:function(){var cm=this.cm,display=cm.display,sel=cm.doc.sel.primary();var from=sel.from(),to=sel.to();if(from.linedisplay.viewTo-1){return false}var fromIndex;if(from.line==display.viewFrom||(fromIndex=findViewIndex(cm,from.line))==0){var fromLine=lineNo(display.view[0].line);var fromNode=display.view[0].node}else{var fromLine=lineNo(display.view[fromIndex].line);var fromNode=display.view[fromIndex-1].node.nextSibling}var toIndex=findViewIndex(cm,to.line);if(toIndex==display.view.length-1){var toLine=display.viewTo-1;var toNode=display.view[toIndex].node}else{var toLine=lineNo(display.view[toIndex+1].line)-1;var toNode=display.view[toIndex+1].node.previousSibling}var newText=splitLines(domTextBetween(cm,fromNode,toNode,fromLine,toLine));var oldText=getBetween(cm.doc,Pos(fromLine,0),Pos(toLine,getLine(cm.doc,toLine).text.length));while(newText.length>1&&oldText.length>1){if(lst(newText)==lst(oldText)){newText.pop();oldText.pop();toLine--}else{if(newText[0]==oldText[0]){newText.shift();oldText.shift();fromLine++}else{break}}}var cutFront=0,cutEnd=0;var newTop=newText[0],oldTop=oldText[0],maxCutFront=Math.min(newTop.length,oldTop.length);while(cutFront1||newText[0]||cmp(chFrom,chTo)){replaceRange(cm.doc,newText,chFrom,chTo,"+input");return true}},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){if(!this.composing||this.composing.handled){return}this.applyComposition(this.composing);this.composing.handled=true;this.div.blur();this.div.focus()},applyComposition:function(composing){if(composing.data&&composing.data!=composing.startData){operation(this.cm,applyTextInput)(this.cm,composing.data,0,composing.sel) -}},setUneditable:function(node){node.setAttribute("contenteditable","false")},onKeyPress:function(e){e.preventDefault();operation(this.cm,applyTextInput)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},onContextMenu:nothing,resetPosition:nothing,needsContentAttribute:true},ContentEditableInput.prototype);function posToDOM(cm,pos){var view=findViewForLine(cm,pos.line);if(!view||view.hidden){return null}var line=getLine(cm.doc,pos.line);var info=mapFromLineView(view,line,pos.line);var order=getOrder(line),side="left";if(order){var partPos=getBidiPartAt(order,pos.ch);side=partPos%2?"right":"left"}var result=nodeAndOffsetInLineMap(info.map,pos.ch,"left");result.offset=result.collapse=="right"?result.end:result.start;return result}function badPos(pos,bad){if(bad){pos.bad=true}return pos}function domToPos(cm,node,offset){var lineNode;if(node==cm.display.lineDiv){lineNode=cm.display.lineDiv.childNodes[offset];if(!lineNode){return badPos(cm.clipPos(Pos(cm.display.viewTo-1)),true)}node=null;offset=0}else{for(lineNode=node;;lineNode=lineNode.parentNode){if(!lineNode||lineNode==cm.display.lineDiv){return null}if(lineNode.parentNode&&lineNode.parentNode==cm.display.lineDiv){break}}}for(var i=0;i=0&&cmp(pos,range.to())<=0){return i}}return -1}};function Range(anchor,head){this.anchor=anchor;this.head=head -}Range.prototype={from:function(){return minPos(this.anchor,this.head)},to:function(){return maxPos(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};function normalizeSelection(ranges,primIndex){var prim=ranges[primIndex];ranges.sort(function(a,b){return cmp(a.from(),b.from())});primIndex=indexOf(ranges,prim);for(var i=1;i=0){var from=minPos(prev.from(),cur.from()),to=maxPos(prev.to(),cur.to());var inv=prev.empty()?cur.from()==cur.head:prev.from()==prev.head;if(i<=primIndex){--primIndex}ranges.splice(--i,2,new Range(inv?to:from,inv?from:to))}}return new Selection(ranges,primIndex)}function simpleSelection(anchor,head){return new Selection([new Range(anchor,head||anchor)],0)}function clipLine(doc,n){return Math.max(doc.first,Math.min(n,doc.first+doc.size-1))}function clipPos(doc,pos){if(pos.linelast){return Pos(last,getLine(doc,last).text.length)}return clipToLen(pos,getLine(doc,pos.line).text.length)}function clipToLen(pos,linelen){var ch=pos.ch;if(ch==null||ch>linelen){return Pos(pos.line,linelen)}else{if(ch<0){return Pos(pos.line,0)}else{return pos}}}function isLine(doc,l){return l>=doc.first&&l=curPos.ch:sp.to>curPos.ch))){if(mayClear){signal(m,"beforeCursorEnter");if(m.explicitlyCleared){if(!line.markedSpans){break}else{--i;continue}}}if(!m.atomic){continue}var newPos=m.find(dir<0?-1:1);if(cmp(newPos,curPos)==0){newPos.ch+=dir; -if(newPos.ch<0){if(newPos.line>doc.first){newPos=clipPos(doc,Pos(newPos.line-1))}else{newPos=null}}else{if(newPos.ch>line.text.length){if(newPos.line3){add(left,leftPos.top,null,leftPos.bottom);left=leftSide;if(leftPos.bottomend.bottom||rightPos.bottom==end.bottom&&rightPos.right>end.right){end=rightPos}if(left0){display.blinker=setInterval(function(){display.cursorDiv.style.visibility=(on=!on)?"":"hidden"},cm.options.cursorBlinkRate)}else{if(cm.options.cursorBlinkRate<0){display.cursorDiv.style.visibility="hidden"}}}function startWorker(cm,time){if(cm.doc.mode.startState&&cm.doc.frontier=cm.display.viewTo){return}var end=+new Date+cm.options.workTime;var state=copyState(doc.mode,getStateBefore(cm,doc.frontier));var changedLines=[];doc.iter(doc.frontier,Math.min(doc.first+doc.size,cm.display.viewTo+500),function(line){if(doc.frontier>=cm.display.viewFrom){var oldStyles=line.styles; -var highlighted=highlightLine(cm,line,state,true);line.styles=highlighted.styles;var oldCls=line.styleClasses,newCls=highlighted.classes;if(newCls){line.styleClasses=newCls}else{if(oldCls){line.styleClasses=null}}var ischange=!oldStyles||oldStyles.length!=line.styles.length||oldCls!=newCls&&(!oldCls||!newCls||oldCls.bgClass!=newCls.bgClass||oldCls.textClass!=newCls.textClass);for(var i=0;!ischange&&iend){startWorker(cm,cm.options.workDelay);return true}});if(changedLines.length){runInOp(cm,function(){for(var i=0;ilim;--search){if(search<=doc.first){return doc.first}var line=getLine(doc,search-1);if(line.stateAfter&&(!precise||search<=doc.frontier)){return search}var indented=countColumn(line.text,null,cm.options.tabSize);if(minline==null||minindent>indented){minline=search-1;minindent=indented}}return minline}function getStateBefore(cm,n,precise){var doc=cm.doc,display=cm.display;if(!doc.mode.startState){return true}var pos=findStartLine(cm,n,precise),state=pos>doc.first&&getLine(doc,pos-1).stateAfter;if(!state){state=startState(doc.mode)}else{state=copyState(doc.mode,state)}doc.iter(pos,n,function(line){processLine(cm,line.text,state);var save=pos==n-1||pos%5==0||pos>=display.viewFrom&&pos2){heights.push((cur.bottom+next.top)/2-rect.top)}}}heights.push(rect.bottom-rect.top)}}function mapFromLineView(lineView,line,lineN){if(lineView.line==line){return{map:lineView.measure.map,cache:lineView.measure.cache}}for(var i=0;ilineN){return{map:lineView.measure.maps[i],cache:lineView.measure.caches[i],before:true}}}}function updateExternalMeasurement(cm,line){line=visualLine(line);var lineN=lineNo(line);var view=cm.display.externalMeasured=new LineView(cm.doc,line,lineN);view.lineN=lineN;var built=view.built=buildLineContent(cm,view);view.text=built.pre;removeChildrenAndAdd(cm.display.lineMeasure,built.pre);return view}function measureChar(cm,line,ch,bias){return measureCharPrepared(cm,prepareMeasureForLine(cm,line),ch,bias)}function findViewForLine(cm,lineN){if(lineN>=cm.display.viewFrom&&lineN=ext.lineN&&lineNch){end=mEnd-mStart;start=end-1;if(ch>=mEnd){collapse="right"}}}}if(start!=null){node=map[i+2];if(mStart==mEnd&&bias==(node.insertLeft?"left":"right")){collapse=bias}if(bias=="left"&&start==0){while(i&&map[i-2]==map[i-3]&&map[i-1].insertLeft){node=map[(i-=3)+2];collapse="left"}}if(bias=="right"&&start==mEnd-mStart){while(i0){collapse=bias="right"}var rects;if(cm.options.lineWrapping&&(rects=node.getClientRects()).length>1){rect=rects[bias=="right"?rects.length-1:0]}else{rect=node.getBoundingClientRect()}}if(ie&&ie_version<9&&!start&&(!rect||!rect.left&&!rect.right)){var rSpan=node.parentNode.getClientRects()[0];if(rSpan){rect={left:rSpan.left,right:rSpan.left+charWidth(cm.display),top:rSpan.top,bottom:rSpan.bottom}}else{rect=nullRect}}var rtop=rect.top-prepared.rect.top,rbot=rect.bottom-prepared.rect.top;var mid=(rtop+rbot)/2;var heights=prepared.view.measure.heights;for(var i=0;ipart.from){return get(ch-1)}return get(ch,right)}var order=getOrder(lineObj),ch=pos.ch;if(!order){return get(ch)}var partPos=getBidiPartAt(order,ch);var val=getBidi(ch,partPos);if(bidiOther!=null){val.other=getBidi(ch,bidiOther)}return val}function estimateCoords(cm,pos){var left=0,pos=clipPos(cm.doc,pos);if(!cm.options.lineWrapping){left=charWidth(cm.display)*pos.ch}var lineObj=getLine(cm.doc,pos.line);var top=heightAtLine(lineObj)+paddingTop(cm.display);return{left:left,right:left,top:top,bottom:top+lineObj.height}}function PosWithInfo(line,ch,outside,xRel){var pos=Pos(line,ch);pos.xRel=xRel;if(outside){pos.outside=true}return pos}function coordsChar(cm,x,y){var doc=cm.doc;y+=cm.display.viewOffset;if(y<0){return PosWithInfo(doc.first,0,true,-1)}var lineN=lineAtHeight(doc,y),last=doc.first+doc.size-1;if(lineN>last){return PosWithInfo(doc.first+doc.size-1,getLine(doc,last).text.length,true,1)}if(x<0){x=0}var lineObj=getLine(doc,lineN);for(;;){var found=coordsCharInner(cm,lineObj,lineN,x,y);var merged=collapsedSpanAtEnd(lineObj);var mergedPos=merged&&merged.find(0,true);if(merged&&(found.ch>mergedPos.from.ch||found.ch==mergedPos.from.ch&&found.xRel>0)){lineN=lineNo(lineObj=mergedPos.to.line)}else{return found}}}function coordsCharInner(cm,lineObj,lineNo,x,y){var innerOff=y-heightAtLine(lineObj);var wrongLine=false,adjust=2*cm.display.wrapper.clientWidth;var preparedMeasure=prepareMeasureForLine(cm,lineObj);function getX(ch){var sp=cursorCoords(cm,Pos(lineNo,ch),"line",lineObj,preparedMeasure);wrongLine=true;if(innerOff>sp.bottom){return sp.left-adjust}else{if(innerOfftoX){return PosWithInfo(lineNo,to,toOutside,1)}for(;;){if(bidi?to==from||to==moveVisually(lineObj,from,1):to-from<=1){var ch=x1?1:0);return pos}var step=Math.ceil(dist/2),middle=from+step;if(bidi){middle=from;for(var i=0;ix){to=middle;toX=middleX;if(toOutside=wrongLine){toX+=1000}dist=step}else{from=middle;fromX=middleX;fromOutside=wrongLine;dist-=step}}}var measureText;function textHeight(display){if(display.cachedTextHeight!=null){return display.cachedTextHeight}if(measureText==null){measureText=elt("pre");for(var i=0;i<49;++i){measureText.appendChild(document.createTextNode("x"));measureText.appendChild(elt("br"))}measureText.appendChild(document.createTextNode("x"))}removeChildrenAndAdd(display.measure,measureText);var height=measureText.offsetHeight/50;if(height>3){display.cachedTextHeight=height}removeChildren(display.measure);return height||1}function charWidth(display){if(display.cachedCharWidth!=null){return display.cachedCharWidth}var anchor=elt("span","xxxxxxxxxx");var pre=elt("pre",[anchor]);removeChildrenAndAdd(display.measure,pre);var rect=anchor.getBoundingClientRect(),width=(rect.right-rect.left)/10;if(width>2){display.cachedCharWidth=width}return width||10}var operationGroup=null;var nextOpId=0;function startOperation(cm){cm.curOp={cm:cm,viewChanged:false,startHeight:cm.doc.height,forceUpdate:false,updateInput:null,typing:false,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:false,updateMaxLine:false,scrollLeft:null,scrollTop:null,scrollToPos:null,id:++nextOpId};if(operationGroup){operationGroup.ops.push(cm.curOp)}else{cm.curOp.ownsGroup=operationGroup={ops:[cm.curOp],delayedCallbacks:[]}}}function fireCallbacksForOps(group){var callbacks=group.delayedCallbacks,i=0; -do{for(;i=display.viewTo)||display.maxLineChanged&&cm.options.lineWrapping;op.update=op.mustUpdate&&new DisplayUpdate(cm,op.mustUpdate&&{top:op.scrollTop,ensure:op.scrollToPos},op.forceUpdate)}function endOperation_W1(op){op.updatedDisplay=op.mustUpdate&&updateDisplayIfNeeded(op.cm,op.update)}function endOperation_R2(op){var cm=op.cm,display=cm.display;if(op.updatedDisplay){updateHeightsInViewport(cm)}op.barMeasure=measureForScrollbars(cm);if(display.maxLineChanged&&!cm.options.lineWrapping){op.adjustWidthTo=measureChar(cm,display.maxLine,display.maxLine.text.length).left+3;cm.display.sizerWidth=op.adjustWidthTo;op.barMeasure.scrollWidth=Math.max(display.scroller.clientWidth,display.sizer.offsetLeft+op.adjustWidthTo+scrollGap(cm)+cm.display.barWidth);op.maxScrollLeft=Math.max(0,display.sizer.offsetLeft+op.adjustWidthTo-displayWidth(cm))}if(op.updatedDisplay||op.selectionChanged){op.preparedSelection=display.input.prepareSelection()}}function endOperation_W2(op){var cm=op.cm;if(op.adjustWidthTo!=null){cm.display.sizer.style.minWidth=op.adjustWidthTo+"px";if(op.maxScrollLeft
        ]", - "[link ]", - "[tag&bracket <][tag div][tag&bracket >]", - "[tag&bracket ]"); - -})(); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/meta.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/meta.js deleted file mode 100644 index e110288..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/meta.js +++ /dev/null @@ -1,177 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.modeInfo = [ - {name: "APL", mime: "text/apl", mode: "apl", ext: ["dyalog", "apl"]}, - {name: "Asterisk", mime: "text/x-asterisk", mode: "asterisk", file: /^extensions\.conf$/i}, - {name: "C", mime: "text/x-csrc", mode: "clike", ext: ["c", "h"]}, - {name: "C++", mime: "text/x-c++src", mode: "clike", ext: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"], alias: ["cpp"]}, - {name: "Cobol", mime: "text/x-cobol", mode: "cobol", ext: ["cob", "cpy"]}, - {name: "C#", mime: "text/x-csharp", mode: "clike", ext: ["cs"], alias: ["csharp"]}, - {name: "Clojure", mime: "text/x-clojure", mode: "clojure", ext: ["clj"]}, - {name: "CoffeeScript", mime: "text/x-coffeescript", mode: "coffeescript", ext: ["coffee"], alias: ["coffee", "coffee-script"]}, - {name: "Common Lisp", mime: "text/x-common-lisp", mode: "commonlisp", ext: ["cl", "lisp", "el"], alias: ["lisp"]}, - {name: "Cypher", mime: "application/x-cypher-query", mode: "cypher", ext: ["cyp", "cypher"]}, - {name: "Cython", mime: "text/x-cython", mode: "python", ext: ["pyx", "pxd", "pxi"]}, - {name: "CSS", mime: "text/css", mode: "css", ext: ["css"]}, - {name: "CQL", mime: "text/x-cassandra", mode: "sql", ext: ["cql"]}, - {name: "D", mime: "text/x-d", mode: "d", ext: ["d"]}, - {name: "Dart", mimes: ["application/dart", "text/x-dart"], mode: "dart", ext: ["dart"]}, - {name: "diff", mime: "text/x-diff", mode: "diff", ext: ["diff", "patch"]}, - {name: "Django", mime: "text/x-django", mode: "django"}, - {name: "Dockerfile", mime: "text/x-dockerfile", mode: "dockerfile", file: /^Dockerfile$/}, - {name: "DTD", mime: "application/xml-dtd", mode: "dtd", ext: ["dtd"]}, - {name: "Dylan", mime: "text/x-dylan", mode: "dylan", ext: ["dylan", "dyl", "intr"]}, - {name: "EBNF", mime: "text/x-ebnf", mode: "ebnf"}, - {name: "ECL", mime: "text/x-ecl", mode: "ecl", ext: ["ecl"]}, - {name: "Eiffel", mime: "text/x-eiffel", mode: "eiffel", ext: ["e"]}, - {name: "Embedded Javascript", mime: "application/x-ejs", mode: "htmlembedded", ext: ["ejs"]}, - {name: "Embedded Ruby", mime: "application/x-erb", mode: "htmlembedded", ext: ["erb"]}, - {name: "Erlang", mime: "text/x-erlang", mode: "erlang", ext: ["erl"]}, - {name: "Forth", mime: "text/x-forth", mode: "forth", ext: ["forth", "fth", "4th"]}, - {name: "Fortran", mime: "text/x-fortran", mode: "fortran", ext: ["f", "for", "f77", "f90"]}, - {name: "F#", mime: "text/x-fsharp", mode: "mllike", ext: ["fs"], alias: ["fsharp"]}, - {name: "Gas", mime: "text/x-gas", mode: "gas", ext: ["s"]}, - {name: "Gherkin", mime: "text/x-feature", mode: "gherkin", ext: ["feature"]}, - {name: "GitHub Flavored Markdown", mime: "text/x-gfm", mode: "gfm", file: /^(readme|contributing|history).md$/i}, - {name: "Go", mime: "text/x-go", mode: "go", ext: ["go"]}, - {name: "Groovy", mime: "text/x-groovy", mode: "groovy", ext: ["groovy"]}, - {name: "HAML", mime: "text/x-haml", mode: "haml", ext: ["haml"]}, - {name: "Haskell", mime: "text/x-haskell", mode: "haskell", ext: ["hs"]}, - {name: "Haxe", mime: "text/x-haxe", mode: "haxe", ext: ["hx"]}, - {name: "HXML", mime: "text/x-hxml", mode: "haxe", ext: ["hxml"]}, - {name: "ASP.NET", mime: "application/x-aspx", mode: "htmlembedded", ext: ["aspx"], alias: ["asp", "aspx"]}, - {name: "HTML", mime: "text/html", mode: "htmlmixed", ext: ["html", "htm"], alias: ["xhtml"]}, - {name: "HTTP", mime: "message/http", mode: "http"}, - {name: "IDL", mime: "text/x-idl", mode: "idl", ext: ["pro"]}, - {name: "Jade", mime: "text/x-jade", mode: "jade", ext: ["jade"]}, - {name: "Java", mime: "text/x-java", mode: "clike", ext: ["java"]}, - {name: "Java Server Pages", mime: "application/x-jsp", mode: "htmlembedded", ext: ["jsp"], alias: ["jsp"]}, - {name: "JavaScript", mimes: ["text/javascript", "text/ecmascript", "application/javascript", "application/x-javascript", "application/ecmascript"], - mode: "javascript", ext: ["js"], alias: ["ecmascript", "js", "node"]}, - {name: "JSON", mimes: ["application/json", "application/x-json"], mode: "javascript", ext: ["json", "map"], alias: ["json5"]}, - {name: "JSON-LD", mime: "application/ld+json", mode: "javascript", ext: ["jsonld"], alias: ["jsonld"]}, - {name: "Jinja2", mime: "null", mode: "jinja2"}, - {name: "Julia", mime: "text/x-julia", mode: "julia", ext: ["jl"]}, - {name: "Kotlin", mime: "text/x-kotlin", mode: "kotlin", ext: ["kt"]}, - {name: "LESS", mime: "text/x-less", mode: "css", ext: ["less"]}, - {name: "LiveScript", mime: "text/x-livescript", mode: "livescript", ext: ["ls"], alias: ["ls"]}, - {name: "Lua", mime: "text/x-lua", mode: "lua", ext: ["lua"]}, - {name: "Markdown", mime: "text/x-markdown", mode: "markdown", ext: ["markdown", "md", "mkd"]}, - {name: "mIRC", mime: "text/mirc", mode: "mirc"}, - {name: "MariaDB SQL", mime: "text/x-mariadb", mode: "sql"}, - {name: "Modelica", mime: "text/x-modelica", mode: "modelica", ext: ["mo"]}, - {name: "MS SQL", mime: "text/x-mssql", mode: "sql"}, - {name: "MySQL", mime: "text/x-mysql", mode: "sql"}, - {name: "Nginx", mime: "text/x-nginx-conf", mode: "nginx", file: /nginx.*\.conf$/i}, - {name: "NTriples", mime: "text/n-triples", mode: "ntriples", ext: ["nt"]}, - {name: "Objective C", mime: "text/x-objectivec", mode: "clike", ext: ["m", "mm"]}, - {name: "OCaml", mime: "text/x-ocaml", mode: "mllike", ext: ["ml", "mli", "mll", "mly"]}, - {name: "Octave", mime: "text/x-octave", mode: "octave", ext: ["m"]}, - {name: "Pascal", mime: "text/x-pascal", mode: "pascal", ext: ["p", "pas"]}, - {name: "PEG.js", mime: "null", mode: "pegjs", ext: ["jsonld"]}, - {name: "Perl", mime: "text/x-perl", mode: "perl", ext: ["pl", "pm"]}, - {name: "PHP", mime: "application/x-httpd-php", mode: "php", ext: ["php", "php3", "php4", "php5", "phtml"]}, - {name: "Pig", mime: "text/x-pig", mode: "pig", ext: ["pig"]}, - {name: "Plain Text", mime: "text/plain", mode: "null", ext: ["txt", "text", "conf", "def", "list", "log"]}, - {name: "PLSQL", mime: "text/x-plsql", mode: "sql", ext: ["pls"]}, - {name: "Properties files", mime: "text/x-properties", mode: "properties", ext: ["properties", "ini", "in"], alias: ["ini", "properties"]}, - {name: "Python", mime: "text/x-python", mode: "python", ext: ["py", "pyw"]}, - {name: "Puppet", mime: "text/x-puppet", mode: "puppet", ext: ["pp"]}, - {name: "Q", mime: "text/x-q", mode: "q", ext: ["q"]}, - {name: "R", mime: "text/x-rsrc", mode: "r", ext: ["r"], alias: ["rscript"]}, - {name: "reStructuredText", mime: "text/x-rst", mode: "rst", ext: ["rst"], alias: ["rst"]}, - {name: "RPM Changes", mime: "text/x-rpm-changes", mode: "rpm"}, - {name: "RPM Spec", mime: "text/x-rpm-spec", mode: "rpm", ext: ["spec"]}, - {name: "Ruby", mime: "text/x-ruby", mode: "ruby", ext: ["rb"], alias: ["jruby", "macruby", "rake", "rb", "rbx"]}, - {name: "Rust", mime: "text/x-rustsrc", mode: "rust", ext: ["rs"]}, - {name: "Sass", mime: "text/x-sass", mode: "sass", ext: ["sass"]}, - {name: "Scala", mime: "text/x-scala", mode: "clike", ext: ["scala"]}, - {name: "Scheme", mime: "text/x-scheme", mode: "scheme", ext: ["scm", "ss"]}, - {name: "SCSS", mime: "text/x-scss", mode: "css", ext: ["scss"]}, - {name: "Shell", mime: "text/x-sh", mode: "shell", ext: ["sh", "ksh", "bash"], alias: ["bash", "sh", "zsh"]}, - {name: "Sieve", mime: "application/sieve", mode: "sieve", ext: ["siv", "sieve"]}, - {name: "Slim", mimes: ["text/x-slim", "application/x-slim"], mode: "slim", ext: ["slim"]}, - {name: "Smalltalk", mime: "text/x-stsrc", mode: "smalltalk", ext: ["st"]}, - {name: "Smarty", mime: "text/x-smarty", mode: "smarty", ext: ["tpl"]}, - {name: "SmartyMixed", mime: "text/x-smarty", mode: "smartymixed"}, - {name: "Solr", mime: "text/x-solr", mode: "solr"}, - {name: "Soy", mime: "text/x-soy", mode: "soy", ext: ["soy"], alias: ["closure template"]}, - {name: "SPARQL", mime: "application/sparql-query", mode: "sparql", ext: ["rq", "sparql"], alias: ["sparul"]}, - {name: "Spreadsheet", mime: "text/x-spreadsheet", mode: "spreadsheet", alias: ["excel", "formula"]}, - {name: "SQL", mime: "text/x-sql", mode: "sql", ext: ["sql"]}, - {name: "MariaDB", mime: "text/x-mariadb", mode: "sql"}, - {name: "sTeX", mime: "text/x-stex", mode: "stex"}, - {name: "LaTeX", mime: "text/x-latex", mode: "stex", ext: ["text", "ltx"], alias: ["tex"]}, - {name: "SystemVerilog", mime: "text/x-systemverilog", mode: "verilog", ext: ["v"]}, - {name: "Tcl", mime: "text/x-tcl", mode: "tcl", ext: ["tcl"]}, - {name: "Textile", mime: "text/x-textile", mode: "textile", ext: ["textile"]}, - {name: "TiddlyWiki ", mime: "text/x-tiddlywiki", mode: "tiddlywiki"}, - {name: "Tiki wiki", mime: "text/tiki", mode: "tiki"}, - {name: "TOML", mime: "text/x-toml", mode: "toml", ext: ["toml"]}, - {name: "Tornado", mime: "text/x-tornado", mode: "tornado"}, - {name: "Turtle", mime: "text/turtle", mode: "turtle", ext: ["ttl"]}, - {name: "TypeScript", mime: "application/typescript", mode: "javascript", ext: ["ts"], alias: ["ts"]}, - {name: "VB.NET", mime: "text/x-vb", mode: "vb", ext: ["vb"]}, - {name: "VBScript", mime: "text/vbscript", mode: "vbscript", ext: ["vbs"]}, - {name: "Velocity", mime: "text/velocity", mode: "velocity", ext: ["vtl"]}, - {name: "Verilog", mime: "text/x-verilog", mode: "verilog", ext: ["v"]}, - {name: "XML", mimes: ["application/xml", "text/xml"], mode: "xml", ext: ["xml", "xsl", "xsd"], alias: ["rss", "wsdl", "xsd"]}, - {name: "XQuery", mime: "application/xquery", mode: "xquery", ext: ["xy", "xquery"]}, - {name: "YAML", mime: "text/x-yaml", mode: "yaml", ext: ["yaml"], alias: ["yml"]}, - {name: "Z80", mime: "text/x-z80", mode: "z80", ext: ["z80"]} - ]; - // Ensure all modes have a mime property for backwards compatibility - for (var i = 0; i < CodeMirror.modeInfo.length; i++) { - var info = CodeMirror.modeInfo[i]; - if (info.mimes) info.mime = info.mimes[0]; - } - - CodeMirror.findModeByMIME = function(mime) { - mime = mime.toLowerCase(); - for (var i = 0; i < CodeMirror.modeInfo.length; i++) { - var info = CodeMirror.modeInfo[i]; - if (info.mime == mime) return info; - if (info.mimes) for (var j = 0; j < info.mimes.length; j++) - if (info.mimes[j] == mime) return info; - } - }; - - CodeMirror.findModeByExtension = function(ext) { - for (var i = 0; i < CodeMirror.modeInfo.length; i++) { - var info = CodeMirror.modeInfo[i]; - if (info.ext) for (var j = 0; j < info.ext.length; j++) - if (info.ext[j] == ext) return info; - } - }; - - CodeMirror.findModeByFileName = function(filename) { - for (var i = 0; i < CodeMirror.modeInfo.length; i++) { - var info = CodeMirror.modeInfo[i]; - if (info.file && info.file.test(filename)) return info; - } - var dot = filename.lastIndexOf("."); - var ext = dot > -1 && filename.substring(dot + 1, filename.length); - if (ext) return CodeMirror.findModeByExtension(ext); - }; - - CodeMirror.findModeByName = function(name) { - name = name.toLowerCase(); - for (var i = 0; i < CodeMirror.modeInfo.length; i++) { - var info = CodeMirror.modeInfo[i]; - if (info.name.toLowerCase() == name) return info; - if (info.alias) for (var j = 0; j < info.alias.length; j++) - if (info.alias[j].toLowerCase() == name) return info; - } - }; -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/mirc/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/mirc/index.html deleted file mode 100644 index fd2f34e..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/mirc/index.html +++ /dev/null @@ -1,160 +0,0 @@ - - -CodeMirror: mIRC mode - - - - - - - - - - -
        -

        mIRC mode

        -
        - - -

        MIME types defined: text/mirc.

        - -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/mirc/mirc.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/mirc/mirc.js deleted file mode 100644 index f0d5c6a..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/mirc/mirc.js +++ /dev/null @@ -1,193 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -//mIRC mode by Ford_Lawnmower :: Based on Velocity mode by Steve O'Hara - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMIME("text/mirc", "mirc"); -CodeMirror.defineMode("mirc", function() { - function parseWords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - var specials = parseWords("$! $$ $& $? $+ $abook $abs $active $activecid " + - "$activewid $address $addtok $agent $agentname $agentstat $agentver " + - "$alias $and $anick $ansi2mirc $aop $appactive $appstate $asc $asctime " + - "$asin $atan $avoice $away $awaymsg $awaytime $banmask $base $bfind " + - "$binoff $biton $bnick $bvar $bytes $calc $cb $cd $ceil $chan $chanmodes " + - "$chantypes $chat $chr $cid $clevel $click $cmdbox $cmdline $cnick $color " + - "$com $comcall $comchan $comerr $compact $compress $comval $cos $count " + - "$cr $crc $creq $crlf $ctime $ctimer $ctrlenter $date $day $daylight " + - "$dbuh $dbuw $dccignore $dccport $dde $ddename $debug $decode $decompress " + - "$deltok $devent $dialog $did $didreg $didtok $didwm $disk $dlevel $dll " + - "$dllcall $dname $dns $duration $ebeeps $editbox $emailaddr $encode $error " + - "$eval $event $exist $feof $ferr $fgetc $file $filename $filtered $finddir " + - "$finddirn $findfile $findfilen $findtok $fline $floor $fopen $fread $fserve " + - "$fulladdress $fulldate $fullname $fullscreen $get $getdir $getdot $gettok $gmt " + - "$group $halted $hash $height $hfind $hget $highlight $hnick $hotline " + - "$hotlinepos $ial $ialchan $ibl $idle $iel $ifmatch $ignore $iif $iil " + - "$inelipse $ini $inmidi $inpaste $inpoly $input $inrect $inroundrect " + - "$insong $instok $int $inwave $ip $isalias $isbit $isdde $isdir $isfile " + - "$isid $islower $istok $isupper $keychar $keyrpt $keyval $knick $lactive " + - "$lactivecid $lactivewid $left $len $level $lf $line $lines $link $lock " + - "$lock $locked $log $logstamp $logstampfmt $longfn $longip $lower $ltimer " + - "$maddress $mask $matchkey $matchtok $md5 $me $menu $menubar $menucontext " + - "$menutype $mid $middir $mircdir $mircexe $mircini $mklogfn $mnick $mode " + - "$modefirst $modelast $modespl $mouse $msfile $network $newnick $nick $nofile " + - "$nopath $noqt $not $notags $notify $null $numeric $numok $oline $onpoly " + - "$opnick $or $ord $os $passivedcc $pic $play $pnick $port $portable $portfree " + - "$pos $prefix $prop $protect $puttok $qt $query $rand $r $rawmsg $read $readomo " + - "$readn $regex $regml $regsub $regsubex $remove $remtok $replace $replacex " + - "$reptok $result $rgb $right $round $scid $scon $script $scriptdir $scriptline " + - "$sdir $send $server $serverip $sfile $sha1 $shortfn $show $signal $sin " + - "$site $sline $snick $snicks $snotify $sock $sockbr $sockerr $sockname " + - "$sorttok $sound $sqrt $ssl $sreq $sslready $status $strip $str $stripped " + - "$syle $submenu $switchbar $tan $target $ticks $time $timer $timestamp " + - "$timestampfmt $timezone $tip $titlebar $toolbar $treebar $trust $ulevel " + - "$ulist $upper $uptime $url $usermode $v1 $v2 $var $vcmd $vcmdstat $vcmdver " + - "$version $vnick $vol $wid $width $wildsite $wildtok $window $wrap $xor"); - var keywords = parseWords("abook ajinvite alias aline ame amsg anick aop auser autojoin avoice " + - "away background ban bcopy beep bread break breplace bset btrunc bunset bwrite " + - "channel clear clearall cline clipboard close cnick color comclose comopen " + - "comreg continue copy creq ctcpreply ctcps dcc dccserver dde ddeserver " + - "debug dec describe dialog did didtok disable disconnect dlevel dline dll " + - "dns dqwindow drawcopy drawdot drawfill drawline drawpic drawrect drawreplace " + - "drawrot drawsave drawscroll drawtext ebeeps echo editbox emailaddr enable " + - "events exit fclose filter findtext finger firewall flash flist flood flush " + - "flushini font fopen fseek fsend fserve fullname fwrite ghide gload gmove " + - "gopts goto gplay gpoint gqreq groups gshow gsize gstop gtalk gunload hadd " + - "halt haltdef hdec hdel help hfree hinc hload hmake hop hsave ial ialclear " + - "ialmark identd if ignore iline inc invite iuser join kick linesep links list " + - "load loadbuf localinfo log mdi me menubar mkdir mnick mode msg nick noop notice " + - "notify omsg onotice part partall pdcc perform play playctrl pop protect pvoice " + - "qme qmsg query queryn quit raw reload remini remote remove rename renwin " + - "reseterror resetidle return rlevel rline rmdir run ruser save savebuf saveini " + - "say scid scon server set showmirc signam sline sockaccept sockclose socklist " + - "socklisten sockmark sockopen sockpause sockread sockrename sockudp sockwrite " + - "sound speak splay sreq strip switchbar timer timestamp titlebar tnick tokenize " + - "toolbar topic tray treebar ulist unload unset unsetall updatenl url uwho " + - "var vcadd vcmd vcrem vol while whois window winhelp write writeint if isalnum " + - "isalpha isaop isavoice isban ischan ishop isignore isin isincs isletter islower " + - "isnotify isnum ison isop isprotect isreg isupper isvoice iswm iswmcs " + - "elseif else goto menu nicklist status title icon size option text edit " + - "button check radio box scroll list combo link tab item"); - var functions = parseWords("if elseif else and not or eq ne in ni for foreach while switch"); - var isOperatorChar = /[+\-*&%=<>!?^\/\|]/; - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - function tokenBase(stream, state) { - var beforeParams = state.beforeParams; - state.beforeParams = false; - var ch = stream.next(); - if (/[\[\]{}\(\),\.]/.test(ch)) { - if (ch == "(" && beforeParams) state.inParams = true; - else if (ch == ")") state.inParams = false; - return null; - } - else if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return "number"; - } - else if (ch == "\\") { - stream.eat("\\"); - stream.eat(/./); - return "number"; - } - else if (ch == "/" && stream.eat("*")) { - return chain(stream, state, tokenComment); - } - else if (ch == ";" && stream.match(/ *\( *\(/)) { - return chain(stream, state, tokenUnparsed); - } - else if (ch == ";" && !state.inParams) { - stream.skipToEnd(); - return "comment"; - } - else if (ch == '"') { - stream.eat(/"/); - return "keyword"; - } - else if (ch == "$") { - stream.eatWhile(/[$_a-z0-9A-Z\.:]/); - if (specials && specials.propertyIsEnumerable(stream.current().toLowerCase())) { - return "keyword"; - } - else { - state.beforeParams = true; - return "builtin"; - } - } - else if (ch == "%") { - stream.eatWhile(/[^,^\s^\(^\)]/); - state.beforeParams = true; - return "string"; - } - else if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "operator"; - } - else { - stream.eatWhile(/[\w\$_{}]/); - var word = stream.current().toLowerCase(); - if (keywords && keywords.propertyIsEnumerable(word)) - return "keyword"; - if (functions && functions.propertyIsEnumerable(word)) { - state.beforeParams = true; - return "keyword"; - } - return null; - } - } - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - function tokenUnparsed(stream, state) { - var maybeEnd = 0, ch; - while (ch = stream.next()) { - if (ch == ";" && maybeEnd == 2) { - state.tokenize = tokenBase; - break; - } - if (ch == ")") - maybeEnd++; - else if (ch != " ") - maybeEnd = 0; - } - return "meta"; - } - return { - startState: function() { - return { - tokenize: tokenBase, - beforeParams: false, - inParams: false - }; - }, - token: function(stream, state) { - if (stream.eatSpace()) return null; - return state.tokenize(stream, state); - } - }; -}); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/mllike/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/mllike/index.html deleted file mode 100644 index 5923af8..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/mllike/index.html +++ /dev/null @@ -1,179 +0,0 @@ - - -CodeMirror: ML-like mode - - - - - - - - - - -
        -

        OCaml mode

        - - - - -

        F# mode

        - - - - - -

        MIME types defined: text/x-ocaml (OCaml) and text/x-fsharp (F#).

        -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/mllike/mllike.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/mllike/mllike.js deleted file mode 100644 index 04ab1c9..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/mllike/mllike.js +++ /dev/null @@ -1,205 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode('mllike', function(_config, parserConfig) { - var words = { - 'let': 'keyword', - 'rec': 'keyword', - 'in': 'keyword', - 'of': 'keyword', - 'and': 'keyword', - 'if': 'keyword', - 'then': 'keyword', - 'else': 'keyword', - 'for': 'keyword', - 'to': 'keyword', - 'while': 'keyword', - 'do': 'keyword', - 'done': 'keyword', - 'fun': 'keyword', - 'function': 'keyword', - 'val': 'keyword', - 'type': 'keyword', - 'mutable': 'keyword', - 'match': 'keyword', - 'with': 'keyword', - 'try': 'keyword', - 'open': 'builtin', - 'ignore': 'builtin', - 'begin': 'keyword', - 'end': 'keyword' - }; - - var extraWords = parserConfig.extraWords || {}; - for (var prop in extraWords) { - if (extraWords.hasOwnProperty(prop)) { - words[prop] = parserConfig.extraWords[prop]; - } - } - - function tokenBase(stream, state) { - var ch = stream.next(); - - if (ch === '"') { - state.tokenize = tokenString; - return state.tokenize(stream, state); - } - if (ch === '(') { - if (stream.eat('*')) { - state.commentLevel++; - state.tokenize = tokenComment; - return state.tokenize(stream, state); - } - } - if (ch === '~') { - stream.eatWhile(/\w/); - return 'variable-2'; - } - if (ch === '`') { - stream.eatWhile(/\w/); - return 'quote'; - } - if (ch === '/' && parserConfig.slashComments && stream.eat('/')) { - stream.skipToEnd(); - return 'comment'; - } - if (/\d/.test(ch)) { - stream.eatWhile(/[\d]/); - if (stream.eat('.')) { - stream.eatWhile(/[\d]/); - } - return 'number'; - } - if ( /[+\-*&%=<>!?|]/.test(ch)) { - return 'operator'; - } - stream.eatWhile(/\w/); - var cur = stream.current(); - return words[cur] || 'variable'; - } - - function tokenString(stream, state) { - var next, end = false, escaped = false; - while ((next = stream.next()) != null) { - if (next === '"' && !escaped) { - end = true; - break; - } - escaped = !escaped && next === '\\'; - } - if (end && !escaped) { - state.tokenize = tokenBase; - } - return 'string'; - }; - - function tokenComment(stream, state) { - var prev, next; - while(state.commentLevel > 0 && (next = stream.next()) != null) { - if (prev === '(' && next === '*') state.commentLevel++; - if (prev === '*' && next === ')') state.commentLevel--; - prev = next; - } - if (state.commentLevel <= 0) { - state.tokenize = tokenBase; - } - return 'comment'; - } - - return { - startState: function() {return {tokenize: tokenBase, commentLevel: 0};}, - token: function(stream, state) { - if (stream.eatSpace()) return null; - return state.tokenize(stream, state); - }, - - blockCommentStart: "(*", - blockCommentEnd: "*)", - lineComment: parserConfig.slashComments ? "//" : null - }; -}); - -CodeMirror.defineMIME('text/x-ocaml', { - name: 'mllike', - extraWords: { - 'succ': 'keyword', - 'trace': 'builtin', - 'exit': 'builtin', - 'print_string': 'builtin', - 'print_endline': 'builtin', - 'true': 'atom', - 'false': 'atom', - 'raise': 'keyword' - } -}); - -CodeMirror.defineMIME('text/x-fsharp', { - name: 'mllike', - extraWords: { - 'abstract': 'keyword', - 'as': 'keyword', - 'assert': 'keyword', - 'base': 'keyword', - 'class': 'keyword', - 'default': 'keyword', - 'delegate': 'keyword', - 'downcast': 'keyword', - 'downto': 'keyword', - 'elif': 'keyword', - 'exception': 'keyword', - 'extern': 'keyword', - 'finally': 'keyword', - 'global': 'keyword', - 'inherit': 'keyword', - 'inline': 'keyword', - 'interface': 'keyword', - 'internal': 'keyword', - 'lazy': 'keyword', - 'let!': 'keyword', - 'member' : 'keyword', - 'module': 'keyword', - 'namespace': 'keyword', - 'new': 'keyword', - 'null': 'keyword', - 'override': 'keyword', - 'private': 'keyword', - 'public': 'keyword', - 'return': 'keyword', - 'return!': 'keyword', - 'select': 'keyword', - 'static': 'keyword', - 'struct': 'keyword', - 'upcast': 'keyword', - 'use': 'keyword', - 'use!': 'keyword', - 'val': 'keyword', - 'when': 'keyword', - 'yield': 'keyword', - 'yield!': 'keyword', - - 'List': 'builtin', - 'Seq': 'builtin', - 'Map': 'builtin', - 'Set': 'builtin', - 'int': 'builtin', - 'string': 'builtin', - 'raise': 'builtin', - 'failwith': 'builtin', - 'not': 'builtin', - 'true': 'builtin', - 'false': 'builtin' - }, - slashComments: true -}); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/modelica/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/modelica/index.html deleted file mode 100644 index 408c3b1..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/modelica/index.html +++ /dev/null @@ -1,67 +0,0 @@ - - -CodeMirror: Modelica mode - - - - - - - - - - - - -
        -

        Modelica mode

        - -
        - - - -

        Simple mode that tries to handle Modelica as well as it can.

        - -

        MIME types defined: text/x-modelica - (Modlica code).

        -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/modelica/modelica.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/modelica/modelica.js deleted file mode 100644 index 77ec7a3..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/modelica/modelica.js +++ /dev/null @@ -1,245 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Modelica support for CodeMirror, copyright (c) by Lennart Ochel - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -}) - -(function(CodeMirror) { - "use strict"; - - CodeMirror.defineMode("modelica", function(config, parserConfig) { - - var indentUnit = config.indentUnit; - var keywords = parserConfig.keywords || {}; - var builtin = parserConfig.builtin || {}; - var atoms = parserConfig.atoms || {}; - - var isSingleOperatorChar = /[;=\(:\),{}.*<>+\-\/^\[\]]/; - var isDoubleOperatorChar = /(:=|<=|>=|==|<>|\.\+|\.\-|\.\*|\.\/|\.\^)/; - var isDigit = /[0-9]/; - var isNonDigit = /[_a-zA-Z]/; - - function tokenLineComment(stream, state) { - stream.skipToEnd(); - state.tokenize = null; - return "comment"; - } - - function tokenBlockComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (maybeEnd && ch == "/") { - state.tokenize = null; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function tokenString(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == '"' && !escaped) { - state.tokenize = null; - state.sol = false; - break; - } - escaped = !escaped && ch == "\\"; - } - - return "string"; - } - - function tokenIdent(stream, state) { - stream.eatWhile(isDigit); - while (stream.eat(isDigit) || stream.eat(isNonDigit)) { } - - - var cur = stream.current(); - - if(state.sol && (cur == "package" || cur == "model" || cur == "when" || cur == "connector")) state.level++; - else if(state.sol && cur == "end" && state.level > 0) state.level--; - - state.tokenize = null; - state.sol = false; - - if (keywords.propertyIsEnumerable(cur)) return "keyword"; - else if (builtin.propertyIsEnumerable(cur)) return "builtin"; - else if (atoms.propertyIsEnumerable(cur)) return "atom"; - else return "variable"; - } - - function tokenQIdent(stream, state) { - while (stream.eat(/[^']/)) { } - - state.tokenize = null; - state.sol = false; - - if(stream.eat("'")) - return "variable"; - else - return "error"; - } - - function tokenUnsignedNuber(stream, state) { - stream.eatWhile(isDigit); - if (stream.eat('.')) { - stream.eatWhile(isDigit); - } - if (stream.eat('e') || stream.eat('E')) { - if (!stream.eat('-')) - stream.eat('+'); - stream.eatWhile(isDigit); - } - - state.tokenize = null; - state.sol = false; - return "number"; - } - - // Interface - return { - startState: function() { - return { - tokenize: null, - level: 0, - sol: true - }; - }, - - token: function(stream, state) { - if(state.tokenize != null) { - return state.tokenize(stream, state); - } - - if(stream.sol()) { - state.sol = true; - } - - // WHITESPACE - if(stream.eatSpace()) { - state.tokenize = null; - return null; - } - - var ch = stream.next(); - - // LINECOMMENT - if(ch == '/' && stream.eat('/')) { - state.tokenize = tokenLineComment; - } - // BLOCKCOMMENT - else if(ch == '/' && stream.eat('*')) { - state.tokenize = tokenBlockComment; - } - // TWO SYMBOL TOKENS - else if(isDoubleOperatorChar.test(ch+stream.peek())) { - stream.next(); - state.tokenize = null; - return "operator"; - } - // SINGLE SYMBOL TOKENS - else if(isSingleOperatorChar.test(ch)) { - state.tokenize = null; - return "operator"; - } - // IDENT - else if(isNonDigit.test(ch)) { - state.tokenize = tokenIdent; - } - // Q-IDENT - else if(ch == "'" && stream.peek() && stream.peek() != "'") { - state.tokenize = tokenQIdent; - } - // STRING - else if(ch == '"') { - state.tokenize = tokenString; - } - // UNSIGNED_NUBER - else if(isDigit.test(ch)) { - state.tokenize = tokenUnsignedNuber; - } - // ERROR - else { - state.tokenize = null; - return "error"; - } - - return state.tokenize(stream, state); - }, - - indent: function(state, textAfter) { - if (state.tokenize != null) return CodeMirror.Pass; - - var level = state.level; - if(/(algorithm)/.test(textAfter)) level--; - if(/(equation)/.test(textAfter)) level--; - if(/(initial algorithm)/.test(textAfter)) level--; - if(/(initial equation)/.test(textAfter)) level--; - if(/(end)/.test(textAfter)) level--; - - if(level > 0) - return indentUnit*level; - else - return 0; - }, - - blockCommentStart: "/*", - blockCommentEnd: "*/", - lineComment: "//" - }; - }); - - function words(str) { - var obj = {}, words = str.split(" "); - for (var i=0; i - -CodeMirror: NGINX mode - - - - - - - - - - - - - -
        -

        NGINX mode

        -
        - - -

        MIME types defined: text/nginx.

        - -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/nginx/nginx.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/nginx/nginx.js deleted file mode 100644 index 135b9cc..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/nginx/nginx.js +++ /dev/null @@ -1,178 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("nginx", function(config) { - - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - var keywords = words( - /* ngxDirectiveControl */ "break return rewrite set" + - /* ngxDirective */ " accept_mutex accept_mutex_delay access_log add_after_body add_before_body add_header addition_types aio alias allow ancient_browser ancient_browser_value auth_basic auth_basic_user_file auth_http auth_http_header auth_http_timeout autoindex autoindex_exact_size autoindex_localtime charset charset_types client_body_buffer_size client_body_in_file_only client_body_in_single_buffer client_body_temp_path client_body_timeout client_header_buffer_size client_header_timeout client_max_body_size connection_pool_size create_full_put_path daemon dav_access dav_methods debug_connection debug_points default_type degradation degrade deny devpoll_changes devpoll_events directio directio_alignment empty_gif env epoll_events error_log eventport_events expires fastcgi_bind fastcgi_buffer_size fastcgi_buffers fastcgi_busy_buffers_size fastcgi_cache fastcgi_cache_key fastcgi_cache_methods fastcgi_cache_min_uses fastcgi_cache_path fastcgi_cache_use_stale fastcgi_cache_valid fastcgi_catch_stderr fastcgi_connect_timeout fastcgi_hide_header fastcgi_ignore_client_abort fastcgi_ignore_headers fastcgi_index fastcgi_intercept_errors fastcgi_max_temp_file_size fastcgi_next_upstream fastcgi_param fastcgi_pass_header fastcgi_pass_request_body fastcgi_pass_request_headers fastcgi_read_timeout fastcgi_send_lowat fastcgi_send_timeout fastcgi_split_path_info fastcgi_store fastcgi_store_access fastcgi_temp_file_write_size fastcgi_temp_path fastcgi_upstream_fail_timeout fastcgi_upstream_max_fails flv geoip_city geoip_country google_perftools_profiles gzip gzip_buffers gzip_comp_level gzip_disable gzip_hash gzip_http_version gzip_min_length gzip_no_buffer gzip_proxied gzip_static gzip_types gzip_vary gzip_window if_modified_since ignore_invalid_headers image_filter image_filter_buffer image_filter_jpeg_quality image_filter_transparency imap_auth imap_capabilities imap_client_buffer index ip_hash keepalive_requests keepalive_timeout kqueue_changes kqueue_events large_client_header_buffers limit_conn limit_conn_log_level limit_rate limit_rate_after limit_req limit_req_log_level limit_req_zone limit_zone lingering_time lingering_timeout lock_file log_format log_not_found log_subrequest map_hash_bucket_size map_hash_max_size master_process memcached_bind memcached_buffer_size memcached_connect_timeout memcached_next_upstream memcached_read_timeout memcached_send_timeout memcached_upstream_fail_timeout memcached_upstream_max_fails merge_slashes min_delete_depth modern_browser modern_browser_value msie_padding msie_refresh multi_accept open_file_cache open_file_cache_errors open_file_cache_events open_file_cache_min_uses open_file_cache_valid open_log_file_cache output_buffers override_charset perl perl_modules perl_require perl_set pid pop3_auth pop3_capabilities port_in_redirect postpone_gzipping postpone_output protocol proxy proxy_bind proxy_buffer proxy_buffer_size proxy_buffering proxy_buffers proxy_busy_buffers_size proxy_cache proxy_cache_key proxy_cache_methods proxy_cache_min_uses proxy_cache_path proxy_cache_use_stale proxy_cache_valid proxy_connect_timeout proxy_headers_hash_bucket_size proxy_headers_hash_max_size proxy_hide_header proxy_ignore_client_abort proxy_ignore_headers proxy_intercept_errors proxy_max_temp_file_size proxy_method proxy_next_upstream proxy_pass_error_message proxy_pass_header proxy_pass_request_body proxy_pass_request_headers proxy_read_timeout proxy_redirect proxy_send_lowat proxy_send_timeout proxy_set_body proxy_set_header proxy_ssl_session_reuse proxy_store proxy_store_access proxy_temp_file_write_size proxy_temp_path proxy_timeout proxy_upstream_fail_timeout proxy_upstream_max_fails random_index read_ahead real_ip_header recursive_error_pages request_pool_size reset_timedout_connection resolver resolver_timeout rewrite_log rtsig_overflow_events rtsig_overflow_test rtsig_overflow_threshold rtsig_signo satisfy secure_link_secret send_lowat send_timeout sendfile sendfile_max_chunk server_name_in_redirect server_names_hash_bucket_size server_names_hash_max_size server_tokens set_real_ip_from smtp_auth smtp_capabilities smtp_client_buffer smtp_greeting_delay so_keepalive source_charset ssi ssi_ignore_recycled_buffers ssi_min_file_chunk ssi_silent_errors ssi_types ssi_value_length ssl ssl_certificate ssl_certificate_key ssl_ciphers ssl_client_certificate ssl_crl ssl_dhparam ssl_engine ssl_prefer_server_ciphers ssl_protocols ssl_session_cache ssl_session_timeout ssl_verify_client ssl_verify_depth starttls stub_status sub_filter sub_filter_once sub_filter_types tcp_nodelay tcp_nopush thread_stack_size timeout timer_resolution types_hash_bucket_size types_hash_max_size underscores_in_headers uninitialized_variable_warn use user userid userid_domain userid_expires userid_mark userid_name userid_p3p userid_path userid_service valid_referers variables_hash_bucket_size variables_hash_max_size worker_connections worker_cpu_affinity worker_priority worker_processes worker_rlimit_core worker_rlimit_nofile worker_rlimit_sigpending worker_threads working_directory xclient xml_entities xslt_stylesheet xslt_typesdrew@li229-23" - ); - - var keywords_block = words( - /* ngxDirectiveBlock */ "http mail events server types location upstream charset_map limit_except if geo map" - ); - - var keywords_important = words( - /* ngxDirectiveImportant */ "include root server server_name listen internal proxy_pass memcached_pass fastcgi_pass try_files" - ); - - var indentUnit = config.indentUnit, type; - function ret(style, tp) {type = tp; return style;} - - function tokenBase(stream, state) { - - - stream.eatWhile(/[\w\$_]/); - - var cur = stream.current(); - - - if (keywords.propertyIsEnumerable(cur)) { - return "keyword"; - } - else if (keywords_block.propertyIsEnumerable(cur)) { - return "variable-2"; - } - else if (keywords_important.propertyIsEnumerable(cur)) { - return "string-2"; - } - /**/ - - var ch = stream.next(); - if (ch == "@") {stream.eatWhile(/[\w\\\-]/); return ret("meta", stream.current());} - else if (ch == "/" && stream.eat("*")) { - state.tokenize = tokenCComment; - return tokenCComment(stream, state); - } - else if (ch == "<" && stream.eat("!")) { - state.tokenize = tokenSGMLComment; - return tokenSGMLComment(stream, state); - } - else if (ch == "=") ret(null, "compare"); - else if ((ch == "~" || ch == "|") && stream.eat("=")) return ret(null, "compare"); - else if (ch == "\"" || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - else if (ch == "#") { - stream.skipToEnd(); - return ret("comment", "comment"); - } - else if (ch == "!") { - stream.match(/^\s*\w*/); - return ret("keyword", "important"); - } - else if (/\d/.test(ch)) { - stream.eatWhile(/[\w.%]/); - return ret("number", "unit"); - } - else if (/[,.+>*\/]/.test(ch)) { - return ret(null, "select-op"); - } - else if (/[;{}:\[\]]/.test(ch)) { - return ret(null, ch); - } - else { - stream.eatWhile(/[\w\\\-]/); - return ret("variable", "variable"); - } - } - - function tokenCComment(stream, state) { - var maybeEnd = false, ch; - while ((ch = stream.next()) != null) { - if (maybeEnd && ch == "/") { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return ret("comment", "comment"); - } - - function tokenSGMLComment(stream, state) { - var dashes = 0, ch; - while ((ch = stream.next()) != null) { - if (dashes >= 2 && ch == ">") { - state.tokenize = tokenBase; - break; - } - dashes = (ch == "-") ? dashes + 1 : 0; - } - return ret("comment", "comment"); - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) - break; - escaped = !escaped && ch == "\\"; - } - if (!escaped) state.tokenize = tokenBase; - return ret("string", "string"); - }; - } - - return { - startState: function(base) { - return {tokenize: tokenBase, - baseIndent: base || 0, - stack: []}; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - type = null; - var style = state.tokenize(stream, state); - - var context = state.stack[state.stack.length-1]; - if (type == "hash" && context == "rule") style = "atom"; - else if (style == "variable") { - if (context == "rule") style = "number"; - else if (!context || context == "@media{") style = "tag"; - } - - if (context == "rule" && /^[\{\};]$/.test(type)) - state.stack.pop(); - if (type == "{") { - if (context == "@media") state.stack[state.stack.length-1] = "@media{"; - else state.stack.push("{"); - } - else if (type == "}") state.stack.pop(); - else if (type == "@media") state.stack.push("@media"); - else if (context == "{" && type != "comment") state.stack.push("rule"); - return style; - }, - - indent: function(state, textAfter) { - var n = state.stack.length; - if (/^\}/.test(textAfter)) - n -= state.stack[state.stack.length-1] == "rule" ? 2 : 1; - return state.baseIndent + n * indentUnit; - }, - - electricChars: "}" - }; -}); - -CodeMirror.defineMIME("text/nginx", "text/x-nginx-conf"); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/ntriples/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/ntriples/index.html deleted file mode 100644 index 1355e71..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/ntriples/index.html +++ /dev/null @@ -1,45 +0,0 @@ - - -CodeMirror: NTriples mode - - - - - - - - - -
        -

        NTriples mode

        -
        - -
        - - -

        MIME types defined: text/n-triples.

        -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/ntriples/ntriples.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/ntriples/ntriples.js deleted file mode 100644 index 0524b1e..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/ntriples/ntriples.js +++ /dev/null @@ -1,186 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/********************************************************** -* This script provides syntax highlighting support for -* the Ntriples format. -* Ntriples format specification: -* http://www.w3.org/TR/rdf-testcases/#ntriples -***********************************************************/ - -/* - The following expression defines the defined ASF grammar transitions. - - pre_subject -> - { - ( writing_subject_uri | writing_bnode_uri ) - -> pre_predicate - -> writing_predicate_uri - -> pre_object - -> writing_object_uri | writing_object_bnode | - ( - writing_object_literal - -> writing_literal_lang | writing_literal_type - ) - -> post_object - -> BEGIN - } otherwise { - -> ERROR - } -*/ - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("ntriples", function() { - - var Location = { - PRE_SUBJECT : 0, - WRITING_SUB_URI : 1, - WRITING_BNODE_URI : 2, - PRE_PRED : 3, - WRITING_PRED_URI : 4, - PRE_OBJ : 5, - WRITING_OBJ_URI : 6, - WRITING_OBJ_BNODE : 7, - WRITING_OBJ_LITERAL : 8, - WRITING_LIT_LANG : 9, - WRITING_LIT_TYPE : 10, - POST_OBJ : 11, - ERROR : 12 - }; - function transitState(currState, c) { - var currLocation = currState.location; - var ret; - - // Opening. - if (currLocation == Location.PRE_SUBJECT && c == '<') ret = Location.WRITING_SUB_URI; - else if(currLocation == Location.PRE_SUBJECT && c == '_') ret = Location.WRITING_BNODE_URI; - else if(currLocation == Location.PRE_PRED && c == '<') ret = Location.WRITING_PRED_URI; - else if(currLocation == Location.PRE_OBJ && c == '<') ret = Location.WRITING_OBJ_URI; - else if(currLocation == Location.PRE_OBJ && c == '_') ret = Location.WRITING_OBJ_BNODE; - else if(currLocation == Location.PRE_OBJ && c == '"') ret = Location.WRITING_OBJ_LITERAL; - - // Closing. - else if(currLocation == Location.WRITING_SUB_URI && c == '>') ret = Location.PRE_PRED; - else if(currLocation == Location.WRITING_BNODE_URI && c == ' ') ret = Location.PRE_PRED; - else if(currLocation == Location.WRITING_PRED_URI && c == '>') ret = Location.PRE_OBJ; - else if(currLocation == Location.WRITING_OBJ_URI && c == '>') ret = Location.POST_OBJ; - else if(currLocation == Location.WRITING_OBJ_BNODE && c == ' ') ret = Location.POST_OBJ; - else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '"') ret = Location.POST_OBJ; - else if(currLocation == Location.WRITING_LIT_LANG && c == ' ') ret = Location.POST_OBJ; - else if(currLocation == Location.WRITING_LIT_TYPE && c == '>') ret = Location.POST_OBJ; - - // Closing typed and language literal. - else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '@') ret = Location.WRITING_LIT_LANG; - else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '^') ret = Location.WRITING_LIT_TYPE; - - // Spaces. - else if( c == ' ' && - ( - currLocation == Location.PRE_SUBJECT || - currLocation == Location.PRE_PRED || - currLocation == Location.PRE_OBJ || - currLocation == Location.POST_OBJ - ) - ) ret = currLocation; - - // Reset. - else if(currLocation == Location.POST_OBJ && c == '.') ret = Location.PRE_SUBJECT; - - // Error - else ret = Location.ERROR; - - currState.location=ret; - } - - return { - startState: function() { - return { - location : Location.PRE_SUBJECT, - uris : [], - anchors : [], - bnodes : [], - langs : [], - types : [] - }; - }, - token: function(stream, state) { - var ch = stream.next(); - if(ch == '<') { - transitState(state, ch); - var parsedURI = ''; - stream.eatWhile( function(c) { if( c != '#' && c != '>' ) { parsedURI += c; return true; } return false;} ); - state.uris.push(parsedURI); - if( stream.match('#', false) ) return 'variable'; - stream.next(); - transitState(state, '>'); - return 'variable'; - } - if(ch == '#') { - var parsedAnchor = ''; - stream.eatWhile(function(c) { if(c != '>' && c != ' ') { parsedAnchor+= c; return true; } return false;}); - state.anchors.push(parsedAnchor); - return 'variable-2'; - } - if(ch == '>') { - transitState(state, '>'); - return 'variable'; - } - if(ch == '_') { - transitState(state, ch); - var parsedBNode = ''; - stream.eatWhile(function(c) { if( c != ' ' ) { parsedBNode += c; return true; } return false;}); - state.bnodes.push(parsedBNode); - stream.next(); - transitState(state, ' '); - return 'builtin'; - } - if(ch == '"') { - transitState(state, ch); - stream.eatWhile( function(c) { return c != '"'; } ); - stream.next(); - if( stream.peek() != '@' && stream.peek() != '^' ) { - transitState(state, '"'); - } - return 'string'; - } - if( ch == '@' ) { - transitState(state, '@'); - var parsedLang = ''; - stream.eatWhile(function(c) { if( c != ' ' ) { parsedLang += c; return true; } return false;}); - state.langs.push(parsedLang); - stream.next(); - transitState(state, ' '); - return 'string-2'; - } - if( ch == '^' ) { - stream.next(); - transitState(state, '^'); - var parsedType = ''; - stream.eatWhile(function(c) { if( c != '>' ) { parsedType += c; return true; } return false;} ); - state.types.push(parsedType); - stream.next(); - transitState(state, '>'); - return 'variable'; - } - if( ch == ' ' ) { - transitState(state, ch); - } - if( ch == '.' ) { - transitState(state, ch); - } - } - }; -}); - -CodeMirror.defineMIME("text/n-triples", "ntriples"); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/octave/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/octave/index.html deleted file mode 100644 index 79df581..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/octave/index.html +++ /dev/null @@ -1,83 +0,0 @@ - - -CodeMirror: Octave mode - - - - - - - - - -
        -

        Octave mode

        - -
        - - -

        MIME types defined: text/x-octave.

        -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/octave/octave.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/octave/octave.js deleted file mode 100644 index a7bec03..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/octave/octave.js +++ /dev/null @@ -1,135 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("octave", function() { - function wordRegexp(words) { - return new RegExp("^((" + words.join(")|(") + "))\\b"); - } - - var singleOperators = new RegExp("^[\\+\\-\\*/&|\\^~<>!@'\\\\]"); - var singleDelimiters = new RegExp('^[\\(\\[\\{\\},:=;]'); - var doubleOperators = new RegExp("^((==)|(~=)|(<=)|(>=)|(<<)|(>>)|(\\.[\\+\\-\\*/\\^\\\\]))"); - var doubleDelimiters = new RegExp("^((!=)|(\\+=)|(\\-=)|(\\*=)|(/=)|(&=)|(\\|=)|(\\^=))"); - var tripleDelimiters = new RegExp("^((>>=)|(<<=))"); - var expressionEnd = new RegExp("^[\\]\\)]"); - var identifiers = new RegExp("^[_A-Za-z\xa1-\uffff][_A-Za-z0-9\xa1-\uffff]*"); - - var builtins = wordRegexp([ - 'error', 'eval', 'function', 'abs', 'acos', 'atan', 'asin', 'cos', - 'cosh', 'exp', 'log', 'prod', 'sum', 'log10', 'max', 'min', 'sign', 'sin', 'sinh', - 'sqrt', 'tan', 'reshape', 'break', 'zeros', 'default', 'margin', 'round', 'ones', - 'rand', 'syn', 'ceil', 'floor', 'size', 'clear', 'zeros', 'eye', 'mean', 'std', 'cov', - 'det', 'eig', 'inv', 'norm', 'rank', 'trace', 'expm', 'logm', 'sqrtm', 'linspace', 'plot', - 'title', 'xlabel', 'ylabel', 'legend', 'text', 'grid', 'meshgrid', 'mesh', 'num2str', - 'fft', 'ifft', 'arrayfun', 'cellfun', 'input', 'fliplr', 'flipud', 'ismember' - ]); - - var keywords = wordRegexp([ - 'return', 'case', 'switch', 'else', 'elseif', 'end', 'endif', 'endfunction', - 'if', 'otherwise', 'do', 'for', 'while', 'try', 'catch', 'classdef', 'properties', 'events', - 'methods', 'global', 'persistent', 'endfor', 'endwhile', 'printf', 'sprintf', 'disp', 'until', - 'continue', 'pkg' - ]); - - - // tokenizers - function tokenTranspose(stream, state) { - if (!stream.sol() && stream.peek() === '\'') { - stream.next(); - state.tokenize = tokenBase; - return 'operator'; - } - state.tokenize = tokenBase; - return tokenBase(stream, state); - } - - - function tokenComment(stream, state) { - if (stream.match(/^.*%}/)) { - state.tokenize = tokenBase; - return 'comment'; - }; - stream.skipToEnd(); - return 'comment'; - } - - function tokenBase(stream, state) { - // whitespaces - if (stream.eatSpace()) return null; - - // Handle one line Comments - if (stream.match('%{')){ - state.tokenize = tokenComment; - stream.skipToEnd(); - return 'comment'; - } - - if (stream.match(/^[%#]/)){ - stream.skipToEnd(); - return 'comment'; - } - - // Handle Number Literals - if (stream.match(/^[0-9\.+-]/, false)) { - if (stream.match(/^[+-]?0x[0-9a-fA-F]+[ij]?/)) { - stream.tokenize = tokenBase; - return 'number'; }; - if (stream.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?[ij]?/)) { return 'number'; }; - if (stream.match(/^[+-]?\d+([EeDd][+-]?\d+)?[ij]?/)) { return 'number'; }; - } - if (stream.match(wordRegexp(['nan','NaN','inf','Inf']))) { return 'number'; }; - - // Handle Strings - if (stream.match(/^"([^"]|(""))*"/)) { return 'string'; } ; - if (stream.match(/^'([^']|(''))*'/)) { return 'string'; } ; - - // Handle words - if (stream.match(keywords)) { return 'keyword'; } ; - if (stream.match(builtins)) { return 'builtin'; } ; - if (stream.match(identifiers)) { return 'variable'; } ; - - if (stream.match(singleOperators) || stream.match(doubleOperators)) { return 'operator'; }; - if (stream.match(singleDelimiters) || stream.match(doubleDelimiters) || stream.match(tripleDelimiters)) { return null; }; - - if (stream.match(expressionEnd)) { - state.tokenize = tokenTranspose; - return null; - }; - - - // Handle non-detected items - stream.next(); - return 'error'; - }; - - - return { - startState: function() { - return { - tokenize: tokenBase - }; - }, - - token: function(stream, state) { - var style = state.tokenize(stream, state); - if (style === 'number' || style === 'variable'){ - state.tokenize = tokenTranspose; - } - return style; - } - }; -}); - -CodeMirror.defineMIME("text/x-octave", "octave"); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/pascal/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/pascal/index.html deleted file mode 100644 index f8a99ad..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/pascal/index.html +++ /dev/null @@ -1,61 +0,0 @@ - - -CodeMirror: Pascal mode - - - - - - - - - -
        -

        Pascal mode

        - - -
        - - - -

        MIME types defined: text/x-pascal.

        -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/pascal/pascal.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/pascal/pascal.js deleted file mode 100644 index 2d0c3d4..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/pascal/pascal.js +++ /dev/null @@ -1,109 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("pascal", function() { - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - var keywords = words("and array begin case const div do downto else end file for forward integer " + - "boolean char function goto if in label mod nil not of or packed procedure " + - "program record repeat set string then to type until var while with"); - var atoms = {"null": true}; - - var isOperatorChar = /[+\-*&%=<>!?|\/]/; - - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == "#" && state.startOfLine) { - stream.skipToEnd(); - return "meta"; - } - if (ch == '"' || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - if (ch == "(" && stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } - if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - return null; - } - if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return "number"; - } - if (ch == "/") { - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - } - if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "operator"; - } - stream.eatWhile(/[\w\$_]/); - var cur = stream.current(); - if (keywords.propertyIsEnumerable(cur)) return "keyword"; - if (atoms.propertyIsEnumerable(cur)) return "atom"; - return "variable"; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) {end = true; break;} - escaped = !escaped && next == "\\"; - } - if (end || !escaped) state.tokenize = null; - return "string"; - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == ")" && maybeEnd) { - state.tokenize = null; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - // Interface - - return { - startState: function() { - return {tokenize: null}; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - var style = (state.tokenize || tokenBase)(stream, state); - if (style == "comment" || style == "meta") return style; - return style; - }, - - electricChars: "{}" - }; -}); - -CodeMirror.defineMIME("text/x-pascal", "pascal"); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/pegjs/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/pegjs/index.html deleted file mode 100644 index 0c74604..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/pegjs/index.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - CodeMirror: PEG.js Mode - - - - - - - - - - - - -
        -

        PEG.js Mode

        -
        - -

        The PEG.js Mode

        -

        Created by Forbes Lindesay.

        -
        - - diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/pegjs/pegjs.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/pegjs/pegjs.js deleted file mode 100644 index 306e376..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/pegjs/pegjs.js +++ /dev/null @@ -1,114 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../javascript/javascript")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../javascript/javascript"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("pegjs", function (config) { - var jsMode = CodeMirror.getMode(config, "javascript"); - - function identifier(stream) { - return stream.match(/^[a-zA-Z_][a-zA-Z0-9_]*/); - } - - return { - startState: function () { - return { - inString: false, - stringType: null, - inComment: false, - inChracterClass: false, - braced: 0, - lhs: true, - localState: null - }; - }, - token: function (stream, state) { - if (stream) - - //check for state changes - if (!state.inString && !state.inComment && ((stream.peek() == '"') || (stream.peek() == "'"))) { - state.stringType = stream.peek(); - stream.next(); // Skip quote - state.inString = true; // Update state - } - if (!state.inString && !state.inComment && stream.match(/^\/\*/)) { - state.inComment = true; - } - - //return state - if (state.inString) { - while (state.inString && !stream.eol()) { - if (stream.peek() === state.stringType) { - stream.next(); // Skip quote - state.inString = false; // Clear flag - } else if (stream.peek() === '\\') { - stream.next(); - stream.next(); - } else { - stream.match(/^.[^\\\"\']*/); - } - } - return state.lhs ? "property string" : "string"; // Token style - } else if (state.inComment) { - while (state.inComment && !stream.eol()) { - if (stream.match(/\*\//)) { - state.inComment = false; // Clear flag - } else { - stream.match(/^.[^\*]*/); - } - } - return "comment"; - } else if (state.inChracterClass) { - while (state.inChracterClass && !stream.eol()) { - if (!(stream.match(/^[^\]\\]+/) || stream.match(/^\\./))) { - state.inChracterClass = false; - } - } - } else if (stream.peek() === '[') { - stream.next(); - state.inChracterClass = true; - return 'bracket'; - } else if (stream.match(/^\/\//)) { - stream.skipToEnd(); - return "comment"; - } else if (state.braced || stream.peek() === '{') { - if (state.localState === null) { - state.localState = jsMode.startState(); - } - var token = jsMode.token(stream, state.localState); - var text = stream.current(); - if (!token) { - for (var i = 0; i < text.length; i++) { - if (text[i] === '{') { - state.braced++; - } else if (text[i] === '}') { - state.braced--; - } - }; - } - return token; - } else if (identifier(stream)) { - if (stream.peek() === ':') { - return 'variable'; - } - return 'variable-2'; - } else if (['[', ']', '(', ')'].indexOf(stream.peek()) != -1) { - stream.next(); - return 'bracket'; - } else if (!stream.eatSpace()) { - stream.next(); - } - return null; - } - }; -}, "javascript"); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/perl/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/perl/index.html deleted file mode 100644 index 8c1021c..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/perl/index.html +++ /dev/null @@ -1,75 +0,0 @@ - - -CodeMirror: Perl mode - - - - - - - - - -
        -

        Perl mode

        - - -
        - - - -

        MIME types defined: text/x-perl.

        -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/perl/perl.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/perl/perl.js deleted file mode 100644 index bef62bc..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/perl/perl.js +++ /dev/null @@ -1,837 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// CodeMirror2 mode/perl/perl.js (text/x-perl) beta 0.10 (2011-11-08) -// This is a part of CodeMirror from https://github.com/sabaca/CodeMirror_mode_perl (mail@sabaca.com) - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("perl",function(){ - // http://perldoc.perl.org - var PERL={ // null - magic touch - // 1 - keyword - // 2 - def - // 3 - atom - // 4 - operator - // 5 - variable-2 (predefined) - // [x,y] - x=1,2,3; y=must be defined if x{...} - // PERL operators - '->' : 4, - '++' : 4, - '--' : 4, - '**' : 4, - // ! ~ \ and unary + and - - '=~' : 4, - '!~' : 4, - '*' : 4, - '/' : 4, - '%' : 4, - 'x' : 4, - '+' : 4, - '-' : 4, - '.' : 4, - '<<' : 4, - '>>' : 4, - // named unary operators - '<' : 4, - '>' : 4, - '<=' : 4, - '>=' : 4, - 'lt' : 4, - 'gt' : 4, - 'le' : 4, - 'ge' : 4, - '==' : 4, - '!=' : 4, - '<=>' : 4, - 'eq' : 4, - 'ne' : 4, - 'cmp' : 4, - '~~' : 4, - '&' : 4, - '|' : 4, - '^' : 4, - '&&' : 4, - '||' : 4, - '//' : 4, - '..' : 4, - '...' : 4, - '?' : 4, - ':' : 4, - '=' : 4, - '+=' : 4, - '-=' : 4, - '*=' : 4, // etc. ??? - ',' : 4, - '=>' : 4, - '::' : 4, - // list operators (rightward) - 'not' : 4, - 'and' : 4, - 'or' : 4, - 'xor' : 4, - // PERL predefined variables (I know, what this is a paranoid idea, but may be needed for people, who learn PERL, and for me as well, ...and may be for you?;) - 'BEGIN' : [5,1], - 'END' : [5,1], - 'PRINT' : [5,1], - 'PRINTF' : [5,1], - 'GETC' : [5,1], - 'READ' : [5,1], - 'READLINE' : [5,1], - 'DESTROY' : [5,1], - 'TIE' : [5,1], - 'TIEHANDLE' : [5,1], - 'UNTIE' : [5,1], - 'STDIN' : 5, - 'STDIN_TOP' : 5, - 'STDOUT' : 5, - 'STDOUT_TOP' : 5, - 'STDERR' : 5, - 'STDERR_TOP' : 5, - '$ARG' : 5, - '$_' : 5, - '@ARG' : 5, - '@_' : 5, - '$LIST_SEPARATOR' : 5, - '$"' : 5, - '$PROCESS_ID' : 5, - '$PID' : 5, - '$$' : 5, - '$REAL_GROUP_ID' : 5, - '$GID' : 5, - '$(' : 5, - '$EFFECTIVE_GROUP_ID' : 5, - '$EGID' : 5, - '$)' : 5, - '$PROGRAM_NAME' : 5, - '$0' : 5, - '$SUBSCRIPT_SEPARATOR' : 5, - '$SUBSEP' : 5, - '$;' : 5, - '$REAL_USER_ID' : 5, - '$UID' : 5, - '$<' : 5, - '$EFFECTIVE_USER_ID' : 5, - '$EUID' : 5, - '$>' : 5, - '$a' : 5, - '$b' : 5, - '$COMPILING' : 5, - '$^C' : 5, - '$DEBUGGING' : 5, - '$^D' : 5, - '${^ENCODING}' : 5, - '$ENV' : 5, - '%ENV' : 5, - '$SYSTEM_FD_MAX' : 5, - '$^F' : 5, - '@F' : 5, - '${^GLOBAL_PHASE}' : 5, - '$^H' : 5, - '%^H' : 5, - '@INC' : 5, - '%INC' : 5, - '$INPLACE_EDIT' : 5, - '$^I' : 5, - '$^M' : 5, - '$OSNAME' : 5, - '$^O' : 5, - '${^OPEN}' : 5, - '$PERLDB' : 5, - '$^P' : 5, - '$SIG' : 5, - '%SIG' : 5, - '$BASETIME' : 5, - '$^T' : 5, - '${^TAINT}' : 5, - '${^UNICODE}' : 5, - '${^UTF8CACHE}' : 5, - '${^UTF8LOCALE}' : 5, - '$PERL_VERSION' : 5, - '$^V' : 5, - '${^WIN32_SLOPPY_STAT}' : 5, - '$EXECUTABLE_NAME' : 5, - '$^X' : 5, - '$1' : 5, // - regexp $1, $2... - '$MATCH' : 5, - '$&' : 5, - '${^MATCH}' : 5, - '$PREMATCH' : 5, - '$`' : 5, - '${^PREMATCH}' : 5, - '$POSTMATCH' : 5, - "$'" : 5, - '${^POSTMATCH}' : 5, - '$LAST_PAREN_MATCH' : 5, - '$+' : 5, - '$LAST_SUBMATCH_RESULT' : 5, - '$^N' : 5, - '@LAST_MATCH_END' : 5, - '@+' : 5, - '%LAST_PAREN_MATCH' : 5, - '%+' : 5, - '@LAST_MATCH_START' : 5, - '@-' : 5, - '%LAST_MATCH_START' : 5, - '%-' : 5, - '$LAST_REGEXP_CODE_RESULT' : 5, - '$^R' : 5, - '${^RE_DEBUG_FLAGS}' : 5, - '${^RE_TRIE_MAXBUF}' : 5, - '$ARGV' : 5, - '@ARGV' : 5, - 'ARGV' : 5, - 'ARGVOUT' : 5, - '$OUTPUT_FIELD_SEPARATOR' : 5, - '$OFS' : 5, - '$,' : 5, - '$INPUT_LINE_NUMBER' : 5, - '$NR' : 5, - '$.' : 5, - '$INPUT_RECORD_SEPARATOR' : 5, - '$RS' : 5, - '$/' : 5, - '$OUTPUT_RECORD_SEPARATOR' : 5, - '$ORS' : 5, - '$\\' : 5, - '$OUTPUT_AUTOFLUSH' : 5, - '$|' : 5, - '$ACCUMULATOR' : 5, - '$^A' : 5, - '$FORMAT_FORMFEED' : 5, - '$^L' : 5, - '$FORMAT_PAGE_NUMBER' : 5, - '$%' : 5, - '$FORMAT_LINES_LEFT' : 5, - '$-' : 5, - '$FORMAT_LINE_BREAK_CHARACTERS' : 5, - '$:' : 5, - '$FORMAT_LINES_PER_PAGE' : 5, - '$=' : 5, - '$FORMAT_TOP_NAME' : 5, - '$^' : 5, - '$FORMAT_NAME' : 5, - '$~' : 5, - '${^CHILD_ERROR_NATIVE}' : 5, - '$EXTENDED_OS_ERROR' : 5, - '$^E' : 5, - '$EXCEPTIONS_BEING_CAUGHT' : 5, - '$^S' : 5, - '$WARNING' : 5, - '$^W' : 5, - '${^WARNING_BITS}' : 5, - '$OS_ERROR' : 5, - '$ERRNO' : 5, - '$!' : 5, - '%OS_ERROR' : 5, - '%ERRNO' : 5, - '%!' : 5, - '$CHILD_ERROR' : 5, - '$?' : 5, - '$EVAL_ERROR' : 5, - '$@' : 5, - '$OFMT' : 5, - '$#' : 5, - '$*' : 5, - '$ARRAY_BASE' : 5, - '$[' : 5, - '$OLD_PERL_VERSION' : 5, - '$]' : 5, - // PERL blocks - 'if' :[1,1], - elsif :[1,1], - 'else' :[1,1], - 'while' :[1,1], - unless :[1,1], - 'for' :[1,1], - foreach :[1,1], - // PERL functions - 'abs' :1, // - absolute value function - accept :1, // - accept an incoming socket connect - alarm :1, // - schedule a SIGALRM - 'atan2' :1, // - arctangent of Y/X in the range -PI to PI - bind :1, // - binds an address to a socket - binmode :1, // - prepare binary files for I/O - bless :1, // - create an object - bootstrap :1, // - 'break' :1, // - break out of a "given" block - caller :1, // - get context of the current subroutine call - chdir :1, // - change your current working directory - chmod :1, // - changes the permissions on a list of files - chomp :1, // - remove a trailing record separator from a string - chop :1, // - remove the last character from a string - chown :1, // - change the owership on a list of files - chr :1, // - get character this number represents - chroot :1, // - make directory new root for path lookups - close :1, // - close file (or pipe or socket) handle - closedir :1, // - close directory handle - connect :1, // - connect to a remote socket - 'continue' :[1,1], // - optional trailing block in a while or foreach - 'cos' :1, // - cosine function - crypt :1, // - one-way passwd-style encryption - dbmclose :1, // - breaks binding on a tied dbm file - dbmopen :1, // - create binding on a tied dbm file - 'default' :1, // - defined :1, // - test whether a value, variable, or function is defined - 'delete' :1, // - deletes a value from a hash - die :1, // - raise an exception or bail out - 'do' :1, // - turn a BLOCK into a TERM - dump :1, // - create an immediate core dump - each :1, // - retrieve the next key/value pair from a hash - endgrent :1, // - be done using group file - endhostent :1, // - be done using hosts file - endnetent :1, // - be done using networks file - endprotoent :1, // - be done using protocols file - endpwent :1, // - be done using passwd file - endservent :1, // - be done using services file - eof :1, // - test a filehandle for its end - 'eval' :1, // - catch exceptions or compile and run code - 'exec' :1, // - abandon this program to run another - exists :1, // - test whether a hash key is present - exit :1, // - terminate this program - 'exp' :1, // - raise I to a power - fcntl :1, // - file control system call - fileno :1, // - return file descriptor from filehandle - flock :1, // - lock an entire file with an advisory lock - fork :1, // - create a new process just like this one - format :1, // - declare a picture format with use by the write() function - formline :1, // - internal function used for formats - getc :1, // - get the next character from the filehandle - getgrent :1, // - get next group record - getgrgid :1, // - get group record given group user ID - getgrnam :1, // - get group record given group name - gethostbyaddr :1, // - get host record given its address - gethostbyname :1, // - get host record given name - gethostent :1, // - get next hosts record - getlogin :1, // - return who logged in at this tty - getnetbyaddr :1, // - get network record given its address - getnetbyname :1, // - get networks record given name - getnetent :1, // - get next networks record - getpeername :1, // - find the other end of a socket connection - getpgrp :1, // - get process group - getppid :1, // - get parent process ID - getpriority :1, // - get current nice value - getprotobyname :1, // - get protocol record given name - getprotobynumber :1, // - get protocol record numeric protocol - getprotoent :1, // - get next protocols record - getpwent :1, // - get next passwd record - getpwnam :1, // - get passwd record given user login name - getpwuid :1, // - get passwd record given user ID - getservbyname :1, // - get services record given its name - getservbyport :1, // - get services record given numeric port - getservent :1, // - get next services record - getsockname :1, // - retrieve the sockaddr for a given socket - getsockopt :1, // - get socket options on a given socket - given :1, // - glob :1, // - expand filenames using wildcards - gmtime :1, // - convert UNIX time into record or string using Greenwich time - 'goto' :1, // - create spaghetti code - grep :1, // - locate elements in a list test true against a given criterion - hex :1, // - convert a string to a hexadecimal number - 'import' :1, // - patch a module's namespace into your own - index :1, // - find a substring within a string - 'int' :1, // - get the integer portion of a number - ioctl :1, // - system-dependent device control system call - 'join' :1, // - join a list into a string using a separator - keys :1, // - retrieve list of indices from a hash - kill :1, // - send a signal to a process or process group - last :1, // - exit a block prematurely - lc :1, // - return lower-case version of a string - lcfirst :1, // - return a string with just the next letter in lower case - length :1, // - return the number of bytes in a string - 'link' :1, // - create a hard link in the filesytem - listen :1, // - register your socket as a server - local : 2, // - create a temporary value for a global variable (dynamic scoping) - localtime :1, // - convert UNIX time into record or string using local time - lock :1, // - get a thread lock on a variable, subroutine, or method - 'log' :1, // - retrieve the natural logarithm for a number - lstat :1, // - stat a symbolic link - m :null, // - match a string with a regular expression pattern - map :1, // - apply a change to a list to get back a new list with the changes - mkdir :1, // - create a directory - msgctl :1, // - SysV IPC message control operations - msgget :1, // - get SysV IPC message queue - msgrcv :1, // - receive a SysV IPC message from a message queue - msgsnd :1, // - send a SysV IPC message to a message queue - my : 2, // - declare and assign a local variable (lexical scoping) - 'new' :1, // - next :1, // - iterate a block prematurely - no :1, // - unimport some module symbols or semantics at compile time - oct :1, // - convert a string to an octal number - open :1, // - open a file, pipe, or descriptor - opendir :1, // - open a directory - ord :1, // - find a character's numeric representation - our : 2, // - declare and assign a package variable (lexical scoping) - pack :1, // - convert a list into a binary representation - 'package' :1, // - declare a separate global namespace - pipe :1, // - open a pair of connected filehandles - pop :1, // - remove the last element from an array and return it - pos :1, // - find or set the offset for the last/next m//g search - print :1, // - output a list to a filehandle - printf :1, // - output a formatted list to a filehandle - prototype :1, // - get the prototype (if any) of a subroutine - push :1, // - append one or more elements to an array - q :null, // - singly quote a string - qq :null, // - doubly quote a string - qr :null, // - Compile pattern - quotemeta :null, // - quote regular expression magic characters - qw :null, // - quote a list of words - qx :null, // - backquote quote a string - rand :1, // - retrieve the next pseudorandom number - read :1, // - fixed-length buffered input from a filehandle - readdir :1, // - get a directory from a directory handle - readline :1, // - fetch a record from a file - readlink :1, // - determine where a symbolic link is pointing - readpipe :1, // - execute a system command and collect standard output - recv :1, // - receive a message over a Socket - redo :1, // - start this loop iteration over again - ref :1, // - find out the type of thing being referenced - rename :1, // - change a filename - require :1, // - load in external functions from a library at runtime - reset :1, // - clear all variables of a given name - 'return' :1, // - get out of a function early - reverse :1, // - flip a string or a list - rewinddir :1, // - reset directory handle - rindex :1, // - right-to-left substring search - rmdir :1, // - remove a directory - s :null, // - replace a pattern with a string - say :1, // - print with newline - scalar :1, // - force a scalar context - seek :1, // - reposition file pointer for random-access I/O - seekdir :1, // - reposition directory pointer - select :1, // - reset default output or do I/O multiplexing - semctl :1, // - SysV semaphore control operations - semget :1, // - get set of SysV semaphores - semop :1, // - SysV semaphore operations - send :1, // - send a message over a socket - setgrent :1, // - prepare group file for use - sethostent :1, // - prepare hosts file for use - setnetent :1, // - prepare networks file for use - setpgrp :1, // - set the process group of a process - setpriority :1, // - set a process's nice value - setprotoent :1, // - prepare protocols file for use - setpwent :1, // - prepare passwd file for use - setservent :1, // - prepare services file for use - setsockopt :1, // - set some socket options - shift :1, // - remove the first element of an array, and return it - shmctl :1, // - SysV shared memory operations - shmget :1, // - get SysV shared memory segment identifier - shmread :1, // - read SysV shared memory - shmwrite :1, // - write SysV shared memory - shutdown :1, // - close down just half of a socket connection - 'sin' :1, // - return the sine of a number - sleep :1, // - block for some number of seconds - socket :1, // - create a socket - socketpair :1, // - create a pair of sockets - 'sort' :1, // - sort a list of values - splice :1, // - add or remove elements anywhere in an array - 'split' :1, // - split up a string using a regexp delimiter - sprintf :1, // - formatted print into a string - 'sqrt' :1, // - square root function - srand :1, // - seed the random number generator - stat :1, // - get a file's status information - state :1, // - declare and assign a state variable (persistent lexical scoping) - study :1, // - optimize input data for repeated searches - 'sub' :1, // - declare a subroutine, possibly anonymously - 'substr' :1, // - get or alter a portion of a stirng - symlink :1, // - create a symbolic link to a file - syscall :1, // - execute an arbitrary system call - sysopen :1, // - open a file, pipe, or descriptor - sysread :1, // - fixed-length unbuffered input from a filehandle - sysseek :1, // - position I/O pointer on handle used with sysread and syswrite - system :1, // - run a separate program - syswrite :1, // - fixed-length unbuffered output to a filehandle - tell :1, // - get current seekpointer on a filehandle - telldir :1, // - get current seekpointer on a directory handle - tie :1, // - bind a variable to an object class - tied :1, // - get a reference to the object underlying a tied variable - time :1, // - return number of seconds since 1970 - times :1, // - return elapsed time for self and child processes - tr :null, // - transliterate a string - truncate :1, // - shorten a file - uc :1, // - return upper-case version of a string - ucfirst :1, // - return a string with just the next letter in upper case - umask :1, // - set file creation mode mask - undef :1, // - remove a variable or function definition - unlink :1, // - remove one link to a file - unpack :1, // - convert binary structure into normal perl variables - unshift :1, // - prepend more elements to the beginning of a list - untie :1, // - break a tie binding to a variable - use :1, // - load in a module at compile time - utime :1, // - set a file's last access and modify times - values :1, // - return a list of the values in a hash - vec :1, // - test or set particular bits in a string - wait :1, // - wait for any child process to die - waitpid :1, // - wait for a particular child process to die - wantarray :1, // - get void vs scalar vs list context of current subroutine call - warn :1, // - print debugging info - when :1, // - write :1, // - print a picture record - y :null}; // - transliterate a string - - var RXstyle="string-2"; - var RXmodifiers=/[goseximacplud]/; // NOTE: "m", "s", "y" and "tr" need to correct real modifiers for each regexp type - - function tokenChain(stream,state,chain,style,tail){ // NOTE: chain.length > 2 is not working now (it's for s[...][...]geos;) - state.chain=null; // 12 3tail - state.style=null; - state.tail=null; - state.tokenize=function(stream,state){ - var e=false,c,i=0; - while(c=stream.next()){ - if(c===chain[i]&&!e){ - if(chain[++i]!==undefined){ - state.chain=chain[i]; - state.style=style; - state.tail=tail;} - else if(tail) - stream.eatWhile(tail); - state.tokenize=tokenPerl; - return style;} - e=!e&&c=="\\";} - return style;}; - return state.tokenize(stream,state);} - - function tokenSOMETHING(stream,state,string){ - state.tokenize=function(stream,state){ - if(stream.string==string) - state.tokenize=tokenPerl; - stream.skipToEnd(); - return "string";}; - return state.tokenize(stream,state);} - - function tokenPerl(stream,state){ - if(stream.eatSpace()) - return null; - if(state.chain) - return tokenChain(stream,state,state.chain,state.style,state.tail); - if(stream.match(/^\-?[\d\.]/,false)) - if(stream.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/)) - return 'number'; - if(stream.match(/^<<(?=\w)/)){ // NOTE: <"],RXstyle,RXmodifiers);} - if(/[\^'"!~\/]/.test(c)){ - eatSuffix(stream, 1); - return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers);}} - else if(c=="q"){ - c=look(stream, 1); - if(c=="("){ - eatSuffix(stream, 2); - return tokenChain(stream,state,[")"],"string");} - if(c=="["){ - eatSuffix(stream, 2); - return tokenChain(stream,state,["]"],"string");} - if(c=="{"){ - eatSuffix(stream, 2); - return tokenChain(stream,state,["}"],"string");} - if(c=="<"){ - eatSuffix(stream, 2); - return tokenChain(stream,state,[">"],"string");} - if(/[\^'"!~\/]/.test(c)){ - eatSuffix(stream, 1); - return tokenChain(stream,state,[stream.eat(c)],"string");}} - else if(c=="w"){ - c=look(stream, 1); - if(c=="("){ - eatSuffix(stream, 2); - return tokenChain(stream,state,[")"],"bracket");} - if(c=="["){ - eatSuffix(stream, 2); - return tokenChain(stream,state,["]"],"bracket");} - if(c=="{"){ - eatSuffix(stream, 2); - return tokenChain(stream,state,["}"],"bracket");} - if(c=="<"){ - eatSuffix(stream, 2); - return tokenChain(stream,state,[">"],"bracket");} - if(/[\^'"!~\/]/.test(c)){ - eatSuffix(stream, 1); - return tokenChain(stream,state,[stream.eat(c)],"bracket");}} - else if(c=="r"){ - c=look(stream, 1); - if(c=="("){ - eatSuffix(stream, 2); - return tokenChain(stream,state,[")"],RXstyle,RXmodifiers);} - if(c=="["){ - eatSuffix(stream, 2); - return tokenChain(stream,state,["]"],RXstyle,RXmodifiers);} - if(c=="{"){ - eatSuffix(stream, 2); - return tokenChain(stream,state,["}"],RXstyle,RXmodifiers);} - if(c=="<"){ - eatSuffix(stream, 2); - return tokenChain(stream,state,[">"],RXstyle,RXmodifiers);} - if(/[\^'"!~\/]/.test(c)){ - eatSuffix(stream, 1); - return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers);}} - else if(/[\^'"!~\/(\[{<]/.test(c)){ - if(c=="("){ - eatSuffix(stream, 1); - return tokenChain(stream,state,[")"],"string");} - if(c=="["){ - eatSuffix(stream, 1); - return tokenChain(stream,state,["]"],"string");} - if(c=="{"){ - eatSuffix(stream, 1); - return tokenChain(stream,state,["}"],"string");} - if(c=="<"){ - eatSuffix(stream, 1); - return tokenChain(stream,state,[">"],"string");} - if(/[\^'"!~\/]/.test(c)){ - return tokenChain(stream,state,[stream.eat(c)],"string");}}}} - if(ch=="m"){ - var c=look(stream, -2); - if(!(c&&/\w/.test(c))){ - c=stream.eat(/[(\[{<\^'"!~\/]/); - if(c){ - if(/[\^'"!~\/]/.test(c)){ - return tokenChain(stream,state,[c],RXstyle,RXmodifiers);} - if(c=="("){ - return tokenChain(stream,state,[")"],RXstyle,RXmodifiers);} - if(c=="["){ - return tokenChain(stream,state,["]"],RXstyle,RXmodifiers);} - if(c=="{"){ - return tokenChain(stream,state,["}"],RXstyle,RXmodifiers);} - if(c=="<"){ - return tokenChain(stream,state,[">"],RXstyle,RXmodifiers);}}}} - if(ch=="s"){ - var c=/[\/>\]})\w]/.test(look(stream, -2)); - if(!c){ - c=stream.eat(/[(\[{<\^'"!~\/]/); - if(c){ - if(c=="[") - return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers); - if(c=="{") - return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers); - if(c=="<") - return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers); - if(c=="(") - return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers); - return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}} - if(ch=="y"){ - var c=/[\/>\]})\w]/.test(look(stream, -2)); - if(!c){ - c=stream.eat(/[(\[{<\^'"!~\/]/); - if(c){ - if(c=="[") - return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers); - if(c=="{") - return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers); - if(c=="<") - return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers); - if(c=="(") - return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers); - return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}} - if(ch=="t"){ - var c=/[\/>\]})\w]/.test(look(stream, -2)); - if(!c){ - c=stream.eat("r");if(c){ - c=stream.eat(/[(\[{<\^'"!~\/]/); - if(c){ - if(c=="[") - return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers); - if(c=="{") - return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers); - if(c=="<") - return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers); - if(c=="(") - return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers); - return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}}} - if(ch=="`"){ - return tokenChain(stream,state,[ch],"variable-2");} - if(ch=="/"){ - if(!/~\s*$/.test(prefix(stream))) - return "operator"; - else - return tokenChain(stream,state,[ch],RXstyle,RXmodifiers);} - if(ch=="$"){ - var p=stream.pos; - if(stream.eatWhile(/\d/)||stream.eat("{")&&stream.eatWhile(/\d/)&&stream.eat("}")) - return "variable-2"; - else - stream.pos=p;} - if(/[$@%]/.test(ch)){ - var p=stream.pos; - if(stream.eat("^")&&stream.eat(/[A-Z]/)||!/[@$%&]/.test(look(stream, -2))&&stream.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){ - var c=stream.current(); - if(PERL[c]) - return "variable-2";} - stream.pos=p;} - if(/[$@%&]/.test(ch)){ - if(stream.eatWhile(/[\w$\[\]]/)||stream.eat("{")&&stream.eatWhile(/[\w$\[\]]/)&&stream.eat("}")){ - var c=stream.current(); - if(PERL[c]) - return "variable-2"; - else - return "variable";}} - if(ch=="#"){ - if(look(stream, -2)!="$"){ - stream.skipToEnd(); - return "comment";}} - if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(ch)){ - var p=stream.pos; - stream.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/); - if(PERL[stream.current()]) - return "operator"; - else - stream.pos=p;} - if(ch=="_"){ - if(stream.pos==1){ - if(suffix(stream, 6)=="_END__"){ - return tokenChain(stream,state,['\0'],"comment");} - else if(suffix(stream, 7)=="_DATA__"){ - return tokenChain(stream,state,['\0'],"variable-2");} - else if(suffix(stream, 7)=="_C__"){ - return tokenChain(stream,state,['\0'],"string");}}} - if(/\w/.test(ch)){ - var p=stream.pos; - if(look(stream, -2)=="{"&&(look(stream, 0)=="}"||stream.eatWhile(/\w/)&&look(stream, 0)=="}")) - return "string"; - else - stream.pos=p;} - if(/[A-Z]/.test(ch)){ - var l=look(stream, -2); - var p=stream.pos; - stream.eatWhile(/[A-Z_]/); - if(/[\da-z]/.test(look(stream, 0))){ - stream.pos=p;} - else{ - var c=PERL[stream.current()]; - if(!c) - return "meta"; - if(c[1]) - c=c[0]; - if(l!=":"){ - if(c==1) - return "keyword"; - else if(c==2) - return "def"; - else if(c==3) - return "atom"; - else if(c==4) - return "operator"; - else if(c==5) - return "variable-2"; - else - return "meta";} - else - return "meta";}} - if(/[a-zA-Z_]/.test(ch)){ - var l=look(stream, -2); - stream.eatWhile(/\w/); - var c=PERL[stream.current()]; - if(!c) - return "meta"; - if(c[1]) - c=c[0]; - if(l!=":"){ - if(c==1) - return "keyword"; - else if(c==2) - return "def"; - else if(c==3) - return "atom"; - else if(c==4) - return "operator"; - else if(c==5) - return "variable-2"; - else - return "meta";} - else - return "meta";} - return null;} - - return { - startState: function() { - return { - tokenize: tokenPerl, - chain: null, - style: null, - tail: null - }; - }, - token: function(stream, state) { - return (state.tokenize || tokenPerl)(stream, state); - }, - lineComment: '#' - }; -}); - -CodeMirror.registerHelper("wordChars", "perl", /[\w$]/); - -CodeMirror.defineMIME("text/x-perl", "perl"); - -// it's like "peek", but need for look-ahead or look-behind if index < 0 -function look(stream, c){ - return stream.string.charAt(stream.pos+(c||0)); -} - -// return a part of prefix of current stream from current position -function prefix(stream, c){ - if(c){ - var x=stream.pos-c; - return stream.string.substr((x>=0?x:0),c);} - else{ - return stream.string.substr(0,stream.pos-1); - } -} - -// return a part of suffix of current stream from current position -function suffix(stream, c){ - var y=stream.string.length; - var x=y-stream.pos+1; - return stream.string.substr(stream.pos,(c&&c=(y=stream.string.length-1)) - stream.pos=y; - else - stream.pos=x; -} - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/php/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/php/index.html deleted file mode 100644 index adf6b1b..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/php/index.html +++ /dev/null @@ -1,64 +0,0 @@ - - -CodeMirror: PHP mode - - - - - - - - - - - - - - - -
        -

        PHP mode

        -
        - - - -

        Simple HTML/PHP mode based on - the C-like mode. Depends on XML, - JavaScript, CSS, HTMLMixed, and C-like modes.

        - -

        MIME types defined: application/x-httpd-php (HTML with PHP code), text/x-php (plain, non-wrapped PHP code).

        -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/php/php.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/php/php.js deleted file mode 100644 index e112d91..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/php/php.js +++ /dev/null @@ -1,226 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), require("../clike/clike")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../htmlmixed/htmlmixed", "../clike/clike"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - function keywords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - // Helper for stringWithEscapes - function matchSequence(list, end) { - if (list.length == 0) return stringWithEscapes(end); - return function (stream, state) { - var patterns = list[0]; - for (var i = 0; i < patterns.length; i++) if (stream.match(patterns[i][0])) { - state.tokenize = matchSequence(list.slice(1), end); - return patterns[i][1]; - } - state.tokenize = stringWithEscapes(end); - return "string"; - }; - } - function stringWithEscapes(closing) { - return function(stream, state) { return stringWithEscapes_(stream, state, closing); }; - } - function stringWithEscapes_(stream, state, closing) { - // "Complex" syntax - if (stream.match("${", false) || stream.match("{$", false)) { - state.tokenize = null; - return "string"; - } - - // Simple syntax - if (stream.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/)) { - // After the variable name there may appear array or object operator. - if (stream.match("[", false)) { - // Match array operator - state.tokenize = matchSequence([ - [["[", null]], - [[/\d[\w\.]*/, "number"], - [/\$[a-zA-Z_][a-zA-Z0-9_]*/, "variable-2"], - [/[\w\$]+/, "variable"]], - [["]", null]] - ], closing); - } - if (stream.match(/\-\>\w/, false)) { - // Match object operator - state.tokenize = matchSequence([ - [["->", null]], - [[/[\w]+/, "variable"]] - ], closing); - } - return "variable-2"; - } - - var escaped = false; - // Normal string - while (!stream.eol() && - (escaped || (!stream.match("{$", false) && - !stream.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/, false)))) { - if (!escaped && stream.match(closing)) { - state.tokenize = null; - state.tokStack.pop(); state.tokStack.pop(); - break; - } - escaped = stream.next() == "\\" && !escaped; - } - return "string"; - } - - var phpKeywords = "abstract and array as break case catch class clone const continue declare default " + - "do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final " + - "for foreach function global goto if implements interface instanceof namespace " + - "new or private protected public static switch throw trait try use var while xor " + - "die echo empty exit eval include include_once isset list require require_once return " + - "print unset __halt_compiler self static parent yield insteadof finally"; - var phpAtoms = "true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__"; - var phpBuiltin = "func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count"; - CodeMirror.registerHelper("hintWords", "php", [phpKeywords, phpAtoms, phpBuiltin].join(" ").split(" ")); - CodeMirror.registerHelper("wordChars", "php", /[\w$]/); - - var phpConfig = { - name: "clike", - helperType: "php", - keywords: keywords(phpKeywords), - blockKeywords: keywords("catch do else elseif for foreach if switch try while finally"), - atoms: keywords(phpAtoms), - builtin: keywords(phpBuiltin), - multiLineStrings: true, - hooks: { - "$": function(stream) { - stream.eatWhile(/[\w\$_]/); - return "variable-2"; - }, - "<": function(stream, state) { - if (stream.match(/<", false)) stream.next(); - return "comment"; - }, - "/": function(stream) { - if (stream.eat("/")) { - while (!stream.eol() && !stream.match("?>", false)) stream.next(); - return "comment"; - } - return false; - }, - '"': function(_stream, state) { - (state.tokStack || (state.tokStack = [])).push('"', 0); - state.tokenize = stringWithEscapes('"'); - return "string"; - }, - "{": function(_stream, state) { - if (state.tokStack && state.tokStack.length) - state.tokStack[state.tokStack.length - 1]++; - return false; - }, - "}": function(_stream, state) { - if (state.tokStack && state.tokStack.length > 0 && - !--state.tokStack[state.tokStack.length - 1]) { - state.tokenize = stringWithEscapes(state.tokStack[state.tokStack.length - 2]); - } - return false; - } - } - }; - - CodeMirror.defineMode("php", function(config, parserConfig) { - var htmlMode = CodeMirror.getMode(config, "text/html"); - var phpMode = CodeMirror.getMode(config, phpConfig); - - function dispatch(stream, state) { - var isPHP = state.curMode == phpMode; - if (stream.sol() && state.pending && state.pending != '"' && state.pending != "'") state.pending = null; - if (!isPHP) { - if (stream.match(/^<\?\w*/)) { - state.curMode = phpMode; - state.curState = state.php; - return "meta"; - } - if (state.pending == '"' || state.pending == "'") { - while (!stream.eol() && stream.next() != state.pending) {} - var style = "string"; - } else if (state.pending && stream.pos < state.pending.end) { - stream.pos = state.pending.end; - var style = state.pending.style; - } else { - var style = htmlMode.token(stream, state.curState); - } - if (state.pending) state.pending = null; - var cur = stream.current(), openPHP = cur.search(/<\?/), m; - if (openPHP != -1) { - if (style == "string" && (m = cur.match(/[\'\"]$/)) && !/\?>/.test(cur)) state.pending = m[0]; - else state.pending = {end: stream.pos, style: style}; - stream.backUp(cur.length - openPHP); - } - return style; - } else if (isPHP && state.php.tokenize == null && stream.match("?>")) { - state.curMode = htmlMode; - state.curState = state.html; - return "meta"; - } else { - return phpMode.token(stream, state.curState); - } - } - - return { - startState: function() { - var html = CodeMirror.startState(htmlMode), php = CodeMirror.startState(phpMode); - return {html: html, - php: php, - curMode: parserConfig.startOpen ? phpMode : htmlMode, - curState: parserConfig.startOpen ? php : html, - pending: null}; - }, - - copyState: function(state) { - var html = state.html, htmlNew = CodeMirror.copyState(htmlMode, html), - php = state.php, phpNew = CodeMirror.copyState(phpMode, php), cur; - if (state.curMode == htmlMode) cur = htmlNew; - else cur = phpNew; - return {html: htmlNew, php: phpNew, curMode: state.curMode, curState: cur, - pending: state.pending}; - }, - - token: dispatch, - - indent: function(state, textAfter) { - if ((state.curMode != phpMode && /^\s*<\//.test(textAfter)) || - (state.curMode == phpMode && /^\?>/.test(textAfter))) - return htmlMode.indent(state.html, textAfter); - return state.curMode.indent(state.curState, textAfter); - }, - - blockCommentStart: "/*", - blockCommentEnd: "*/", - lineComment: "//", - - innerMode: function(state) { return {state: state.curState, mode: state.curMode}; } - }; - }, "htmlmixed", "clike"); - - CodeMirror.defineMIME("application/x-httpd-php", "php"); - CodeMirror.defineMIME("application/x-httpd-php-open", {name: "php", startOpen: true}); - CodeMirror.defineMIME("text/x-php", phpConfig); -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/php/test.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/php/test.js deleted file mode 100644 index e2ecefc..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/php/test.js +++ /dev/null @@ -1,154 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({indentUnit: 2}, "php"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - MT('simple_test', - '[meta ]'); - - MT('variable_interpolation_non_alphanumeric', - '[meta $/$\\$}$\\\"$:$;$?$|$[[$]]$+$=aaa"]', - '[meta ?>]'); - - MT('variable_interpolation_digits', - '[meta ]'); - - MT('variable_interpolation_simple_syntax_1', - '[meta ]'); - - MT('variable_interpolation_simple_syntax_2', - '[meta ]'); - - MT('variable_interpolation_simple_syntax_3', - '[meta [variable aaaaa][string .aaaaaa"];', - '[keyword echo] [string "aaa][variable-2 $aaaa][string ->][variable-2 $aaaaa][string .aaaaaa"];', - '[keyword echo] [string "aaa][variable-2 $aaaa]->[variable aaaaa][string [[2]].aaaaaa"];', - '[keyword echo] [string "aaa][variable-2 $aaaa]->[variable aaaaa][string ->aaaa2.aaaaaa"];', - '[meta ?>]'); - - MT('variable_interpolation_escaping', - '[meta aaa.aaa"];', - '[keyword echo] [string "aaa\\$aaaa[[2]]aaa.aaa"];', - '[keyword echo] [string "aaa\\$aaaa[[asd]]aaa.aaa"];', - '[keyword echo] [string "aaa{\\$aaaa->aaa.aaa"];', - '[keyword echo] [string "aaa{\\$aaaa[[2]]aaa.aaa"];', - '[keyword echo] [string "aaa{\\aaaaa[[asd]]aaa.aaa"];', - '[keyword echo] [string "aaa\\${aaaa->aaa.aaa"];', - '[keyword echo] [string "aaa\\${aaaa[[2]]aaa.aaa"];', - '[keyword echo] [string "aaa\\${aaaa[[asd]]aaa.aaa"];', - '[meta ?>]'); - - MT('variable_interpolation_complex_syntax_1', - '[meta aaa.aaa"];', - '[keyword echo] [string "aaa][variable-2 $]{[variable-2 $aaaa]}[string ->aaa.aaa"];', - '[keyword echo] [string "aaa][variable-2 $]{[variable-2 $aaaa][[',' [number 42]',']]}[string ->aaa.aaa"];', - '[keyword echo] [string "aaa][variable-2 $]{[variable aaaa][meta ?>]aaaaaa'); - - MT('variable_interpolation_complex_syntax_2', - '[meta } $aaaaaa.aaa"];', - '[keyword echo] [string "][variable-2 $]{[variable aaa][comment /*}?>*/][[',' [string "aaa][variable-2 $aaa][string {}][variable-2 $]{[variable aaa]}[string "]',']]}[string ->aaa.aaa"];', - '[keyword echo] [string "][variable-2 $]{[variable aaa][comment /*} } $aaa } */]}[string ->aaa.aaa"];'); - - - function build_recursive_monsters(nt, t, n){ - var monsters = [t]; - for (var i = 1; i <= n; ++i) - monsters[i] = nt.join(monsters[i - 1]); - return monsters; - } - - var m1 = build_recursive_monsters( - ['[string "][variable-2 $]{[variable aaa] [operator +] ', '}[string "]'], - '[comment /* }?>} */] [string "aaa][variable-2 $aaa][string .aaa"]', - 10 - ); - - MT('variable_interpolation_complex_syntax_3_1', - '[meta ]'); - - var m2 = build_recursive_monsters( - ['[string "a][variable-2 $]{[variable aaa] [operator +] ', ' [operator +] ', '}[string .a"]'], - '[comment /* }?>{{ */] [string "a?>}{{aa][variable-2 $aaa][string .a}a?>a"]', - 5 - ); - - MT('variable_interpolation_complex_syntax_3_2', - '[meta ]'); - - function build_recursive_monsters_2(mf1, mf2, nt, t, n){ - var monsters = [t]; - for (var i = 1; i <= n; ++i) - monsters[i] = nt[0] + mf1[i - 1] + nt[1] + mf2[i - 1] + nt[2] + monsters[i - 1] + nt[3]; - return monsters; - } - - var m3 = build_recursive_monsters_2( - m1, - m2, - ['[string "a][variable-2 $]{[variable aaa] [operator +] ', ' [operator +] ', ' [operator +] ', '}[string .a"]'], - '[comment /* }?>{{ */] [string "a?>}{{aa][variable-2 $aaa][string .a}a?>a"]', - 4 - ); - - MT('variable_interpolation_complex_syntax_3_3', - '[meta ]'); - - MT("variable_interpolation_heredoc", - "[meta - -CodeMirror: Pig Latin mode - - - - - - - - - -
        -

        Pig Latin mode

        -
        - - - -

        - Simple mode that handles Pig Latin language. -

        - -

        MIME type defined: text/x-pig - (PIG code) - -

        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/pig/pig.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/pig/pig.js deleted file mode 100644 index c74b2cc..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/pig/pig.js +++ /dev/null @@ -1,188 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/* - * Pig Latin Mode for CodeMirror 2 - * @author Prasanth Jayachandran - * @link https://github.com/prasanthj/pig-codemirror-2 - * This implementation is adapted from PL/SQL mode in CodeMirror 2. - */ -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("pig", function(_config, parserConfig) { - var keywords = parserConfig.keywords, - builtins = parserConfig.builtins, - types = parserConfig.types, - multiLineStrings = parserConfig.multiLineStrings; - - var isOperatorChar = /[*+\-%<>=&?:\/!|]/; - - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - - var type; - function ret(tp, style) { - type = tp; - return style; - } - - function tokenComment(stream, state) { - var isEnd = false; - var ch; - while(ch = stream.next()) { - if(ch == "/" && isEnd) { - state.tokenize = tokenBase; - break; - } - isEnd = (ch == "*"); - } - return ret("comment", "comment"); - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while((next = stream.next()) != null) { - if (next == quote && !escaped) { - end = true; break; - } - escaped = !escaped && next == "\\"; - } - if (end || !(escaped || multiLineStrings)) - state.tokenize = tokenBase; - return ret("string", "error"); - }; - } - - function tokenBase(stream, state) { - var ch = stream.next(); - - // is a start of string? - if (ch == '"' || ch == "'") - return chain(stream, state, tokenString(ch)); - // is it one of the special chars - else if(/[\[\]{}\(\),;\.]/.test(ch)) - return ret(ch); - // is it a number? - else if(/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return ret("number", "number"); - } - // multi line comment or operator - else if (ch == "/") { - if (stream.eat("*")) { - return chain(stream, state, tokenComment); - } - else { - stream.eatWhile(isOperatorChar); - return ret("operator", "operator"); - } - } - // single line comment or operator - else if (ch=="-") { - if(stream.eat("-")){ - stream.skipToEnd(); - return ret("comment", "comment"); - } - else { - stream.eatWhile(isOperatorChar); - return ret("operator", "operator"); - } - } - // is it an operator - else if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return ret("operator", "operator"); - } - else { - // get the while word - stream.eatWhile(/[\w\$_]/); - // is it one of the listed keywords? - if (keywords && keywords.propertyIsEnumerable(stream.current().toUpperCase())) { - if (stream.eat(")") || stream.eat(".")) { - //keywords can be used as variables like flatten(group), group.$0 etc.. - } - else { - return ("keyword", "keyword"); - } - } - // is it one of the builtin functions? - if (builtins && builtins.propertyIsEnumerable(stream.current().toUpperCase())) - { - return ("keyword", "variable-2"); - } - // is it one of the listed types? - if (types && types.propertyIsEnumerable(stream.current().toUpperCase())) - return ("keyword", "variable-3"); - // default is a 'variable' - return ret("variable", "pig-word"); - } - } - - // Interface - return { - startState: function() { - return { - tokenize: tokenBase, - startOfLine: true - }; - }, - - token: function(stream, state) { - if(stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - return style; - } - }; -}); - -(function() { - function keywords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - // builtin funcs taken from trunk revision 1303237 - var pBuiltins = "ABS ACOS ARITY ASIN ATAN AVG BAGSIZE BINSTORAGE BLOOM BUILDBLOOM CBRT CEIL " - + "CONCAT COR COS COSH COUNT COUNT_STAR COV CONSTANTSIZE CUBEDIMENSIONS DIFF DISTINCT DOUBLEABS " - + "DOUBLEAVG DOUBLEBASE DOUBLEMAX DOUBLEMIN DOUBLEROUND DOUBLESUM EXP FLOOR FLOATABS FLOATAVG " - + "FLOATMAX FLOATMIN FLOATROUND FLOATSUM GENERICINVOKER INDEXOF INTABS INTAVG INTMAX INTMIN " - + "INTSUM INVOKEFORDOUBLE INVOKEFORFLOAT INVOKEFORINT INVOKEFORLONG INVOKEFORSTRING INVOKER " - + "ISEMPTY JSONLOADER JSONMETADATA JSONSTORAGE LAST_INDEX_OF LCFIRST LOG LOG10 LOWER LONGABS " - + "LONGAVG LONGMAX LONGMIN LONGSUM MAX MIN MAPSIZE MONITOREDUDF NONDETERMINISTIC OUTPUTSCHEMA " - + "PIGSTORAGE PIGSTREAMING RANDOM REGEX_EXTRACT REGEX_EXTRACT_ALL REPLACE ROUND SIN SINH SIZE " - + "SQRT STRSPLIT SUBSTRING SUM STRINGCONCAT STRINGMAX STRINGMIN STRINGSIZE TAN TANH TOBAG " - + "TOKENIZE TOMAP TOP TOTUPLE TRIM TEXTLOADER TUPLESIZE UCFIRST UPPER UTF8STORAGECONVERTER "; - - // taken from QueryLexer.g - var pKeywords = "VOID IMPORT RETURNS DEFINE LOAD FILTER FOREACH ORDER CUBE DISTINCT COGROUP " - + "JOIN CROSS UNION SPLIT INTO IF OTHERWISE ALL AS BY USING INNER OUTER ONSCHEMA PARALLEL " - + "PARTITION GROUP AND OR NOT GENERATE FLATTEN ASC DESC IS STREAM THROUGH STORE MAPREDUCE " - + "SHIP CACHE INPUT OUTPUT STDERROR STDIN STDOUT LIMIT SAMPLE LEFT RIGHT FULL EQ GT LT GTE LTE " - + "NEQ MATCHES TRUE FALSE DUMP"; - - // data types - var pTypes = "BOOLEAN INT LONG FLOAT DOUBLE CHARARRAY BYTEARRAY BAG TUPLE MAP "; - - CodeMirror.defineMIME("text/x-pig", { - name: "pig", - builtins: keywords(pBuiltins), - keywords: keywords(pKeywords), - types: keywords(pTypes) - }); - - CodeMirror.registerHelper("hintWords", "pig", (pBuiltins + pTypes + pKeywords).split(" ")); -}()); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/properties/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/properties/index.html deleted file mode 100644 index f885302..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/properties/index.html +++ /dev/null @@ -1,53 +0,0 @@ - - -CodeMirror: Properties files mode - - - - - - - - - -
        -

        Properties files mode

        -
        - - -

        MIME types defined: text/x-properties, - text/x-ini.

        - -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/properties/properties.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/properties/properties.js deleted file mode 100644 index 0740084..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/properties/properties.js +++ /dev/null @@ -1,78 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("properties", function() { - return { - token: function(stream, state) { - var sol = stream.sol() || state.afterSection; - var eol = stream.eol(); - - state.afterSection = false; - - if (sol) { - if (state.nextMultiline) { - state.inMultiline = true; - state.nextMultiline = false; - } else { - state.position = "def"; - } - } - - if (eol && ! state.nextMultiline) { - state.inMultiline = false; - state.position = "def"; - } - - if (sol) { - while(stream.eatSpace()); - } - - var ch = stream.next(); - - if (sol && (ch === "#" || ch === "!" || ch === ";")) { - state.position = "comment"; - stream.skipToEnd(); - return "comment"; - } else if (sol && ch === "[") { - state.afterSection = true; - stream.skipTo("]"); stream.eat("]"); - return "header"; - } else if (ch === "=" || ch === ":") { - state.position = "quote"; - return null; - } else if (ch === "\\" && state.position === "quote") { - if (stream.next() !== "u") { // u = Unicode sequence \u1234 - // Multiline value - state.nextMultiline = true; - } - } - - return state.position; - }, - - startState: function() { - return { - position : "def", // Current position, "def", "quote" or "comment" - nextMultiline : false, // Is the next line multiline value - inMultiline : false, // Is the current line a multiline value - afterSection : false // Did we just open a section - }; - } - - }; -}); - -CodeMirror.defineMIME("text/x-properties", "properties"); -CodeMirror.defineMIME("text/x-ini", "properties"); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/puppet/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/puppet/index.html deleted file mode 100644 index 5614c36..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/puppet/index.html +++ /dev/null @@ -1,121 +0,0 @@ - - -CodeMirror: Puppet mode - - - - - - - - - - -
        -

        Puppet mode

        -
        - - -

        MIME types defined: text/x-puppet.

        - -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/puppet/puppet.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/puppet/puppet.js deleted file mode 100644 index e7f799f..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/puppet/puppet.js +++ /dev/null @@ -1,220 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("puppet", function () { - // Stores the words from the define method - var words = {}; - // Taken, mostly, from the Puppet official variable standards regex - var variable_regex = /({)?([a-z][a-z0-9_]*)?((::[a-z][a-z0-9_]*)*::)?[a-zA-Z0-9_]+(})?/; - - // Takes a string of words separated by spaces and adds them as - // keys with the value of the first argument 'style' - function define(style, string) { - var split = string.split(' '); - for (var i = 0; i < split.length; i++) { - words[split[i]] = style; - } - } - - // Takes commonly known puppet types/words and classifies them to a style - define('keyword', 'class define site node include import inherits'); - define('keyword', 'case if else in and elsif default or'); - define('atom', 'false true running present absent file directory undef'); - define('builtin', 'action augeas burst chain computer cron destination dport exec ' + - 'file filebucket group host icmp iniface interface jump k5login limit log_level ' + - 'log_prefix macauthorization mailalias maillist mcx mount nagios_command ' + - 'nagios_contact nagios_contactgroup nagios_host nagios_hostdependency ' + - 'nagios_hostescalation nagios_hostextinfo nagios_hostgroup nagios_service ' + - 'nagios_servicedependency nagios_serviceescalation nagios_serviceextinfo ' + - 'nagios_servicegroup nagios_timeperiod name notify outiface package proto reject ' + - 'resources router schedule scheduled_task selboolean selmodule service source ' + - 'sport ssh_authorized_key sshkey stage state table tidy todest toports tosource ' + - 'user vlan yumrepo zfs zone zpool'); - - // After finding a start of a string ('|") this function attempts to find the end; - // If a variable is encountered along the way, we display it differently when it - // is encapsulated in a double-quoted string. - function tokenString(stream, state) { - var current, prev, found_var = false; - while (!stream.eol() && (current = stream.next()) != state.pending) { - if (current === '$' && prev != '\\' && state.pending == '"') { - found_var = true; - break; - } - prev = current; - } - if (found_var) { - stream.backUp(1); - } - if (current == state.pending) { - state.continueString = false; - } else { - state.continueString = true; - } - return "string"; - } - - // Main function - function tokenize(stream, state) { - // Matches one whole word - var word = stream.match(/[\w]+/, false); - // Matches attributes (i.e. ensure => present ; 'ensure' would be matched) - var attribute = stream.match(/(\s+)?\w+\s+=>.*/, false); - // Matches non-builtin resource declarations - // (i.e. "apache::vhost {" or "mycustomclasss {" would be matched) - var resource = stream.match(/(\s+)?[\w:_]+(\s+)?{/, false); - // Matches virtual and exported resources (i.e. @@user { ; and the like) - var special_resource = stream.match(/(\s+)?[@]{1,2}[\w:_]+(\s+)?{/, false); - - // Finally advance the stream - var ch = stream.next(); - - // Have we found a variable? - if (ch === '$') { - if (stream.match(variable_regex)) { - // If so, and its in a string, assign it a different color - return state.continueString ? 'variable-2' : 'variable'; - } - // Otherwise return an invalid variable - return "error"; - } - // Should we still be looking for the end of a string? - if (state.continueString) { - // If so, go through the loop again - stream.backUp(1); - return tokenString(stream, state); - } - // Are we in a definition (class, node, define)? - if (state.inDefinition) { - // If so, return def (i.e. for 'class myclass {' ; 'myclass' would be matched) - if (stream.match(/(\s+)?[\w:_]+(\s+)?/)) { - return 'def'; - } - // Match the rest it the next time around - stream.match(/\s+{/); - state.inDefinition = false; - } - // Are we in an 'include' statement? - if (state.inInclude) { - // Match and return the included class - stream.match(/(\s+)?\S+(\s+)?/); - state.inInclude = false; - return 'def'; - } - // Do we just have a function on our hands? - // In 'ensure_resource("myclass")', 'ensure_resource' is matched - if (stream.match(/(\s+)?\w+\(/)) { - stream.backUp(1); - return 'def'; - } - // Have we matched the prior attribute regex? - if (attribute) { - stream.match(/(\s+)?\w+/); - return 'tag'; - } - // Do we have Puppet specific words? - if (word && words.hasOwnProperty(word)) { - // Negates the initial next() - stream.backUp(1); - // Acutally move the stream - stream.match(/[\w]+/); - // We want to process these words differently - // do to the importance they have in Puppet - if (stream.match(/\s+\S+\s+{/, false)) { - state.inDefinition = true; - } - if (word == 'include') { - state.inInclude = true; - } - // Returns their value as state in the prior define methods - return words[word]; - } - // Is there a match on a reference? - if (/(^|\s+)[A-Z][\w:_]+/.test(word)) { - // Negate the next() - stream.backUp(1); - // Match the full reference - stream.match(/(^|\s+)[A-Z][\w:_]+/); - return 'def'; - } - // Have we matched the prior resource regex? - if (resource) { - stream.match(/(\s+)?[\w:_]+/); - return 'def'; - } - // Have we matched the prior special_resource regex? - if (special_resource) { - stream.match(/(\s+)?[@]{1,2}/); - return 'special'; - } - // Match all the comments. All of them. - if (ch == "#") { - stream.skipToEnd(); - return "comment"; - } - // Have we found a string? - if (ch == "'" || ch == '"') { - // Store the type (single or double) - state.pending = ch; - // Perform the looping function to find the end - return tokenString(stream, state); - } - // Match all the brackets - if (ch == '{' || ch == '}') { - return 'bracket'; - } - // Match characters that we are going to assume - // are trying to be regex - if (ch == '/') { - stream.match(/.*?\//); - return 'variable-3'; - } - // Match all the numbers - if (ch.match(/[0-9]/)) { - stream.eatWhile(/[0-9]+/); - return 'number'; - } - // Match the '=' and '=>' operators - if (ch == '=') { - if (stream.peek() == '>') { - stream.next(); - } - return "operator"; - } - // Keep advancing through all the rest - stream.eatWhile(/[\w-]/); - // Return a blank line for everything else - return null; - } - // Start it all - return { - startState: function () { - var state = {}; - state.inDefinition = false; - state.inInclude = false; - state.continueString = false; - state.pending = false; - return state; - }, - token: function (stream, state) { - // Strip the spaces, but regex will account for them eitherway - if (stream.eatSpace()) return null; - // Go through the main process - return tokenize(stream, state); - } - }; -}); - -CodeMirror.defineMIME("text/x-puppet", "puppet"); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/python/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/python/index.html deleted file mode 100644 index 86eb3d5..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/python/index.html +++ /dev/null @@ -1,198 +0,0 @@ - - -CodeMirror: Python mode - - - - - - - - - - -
        -

        Python mode

        - -
        - - -

        Cython mode

        - -
        - - -

        Configuration Options for Python mode:

        -
          -
        • version - 2/3 - The version of Python to recognize. Default is 2.
        • -
        • singleLineStringErrors - true/false - If you have a single-line string that is not terminated at the end of the line, this will show subsequent lines as errors if true, otherwise it will consider the newline as the end of the string. Default is false.
        • -
        • hangingIndent - int - If you want to write long arguments to a function starting on a new line, how much that line should be indented. Defaults to one normal indentation unit.
        • -
        -

        Advanced Configuration Options:

        -

        Usefull for superset of python syntax like Enthought enaml, IPython magics and questionmark help

        -
          -
        • singleOperators - RegEx - Regular Expression for single operator matching, default :
          ^[\\+\\-\\*/%&|\\^~<>!]
          including
          @
          on Python 3
        • -
        • singleDelimiters - RegEx - Regular Expression for single delimiter matching, default :
          ^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]
        • -
        • doubleOperators - RegEx - Regular Expression for double operators matching, default :
          ^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))
        • -
        • doubleDelimiters - RegEx - Regular Expressoin for double delimiters matching, default :
          ^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))
        • -
        • tripleDelimiters - RegEx - Regular Expression for triple delimiters matching, default :
          ^((//=)|(>>=)|(<<=)|(\\*\\*=))
        • -
        • identifiers - RegEx - Regular Expression for identifier, default :
          ^[_A-Za-z][_A-Za-z0-9]*
          on Python 2 and
          ^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*
          on Python 3.
        • -
        • extra_keywords - list of string - List of extra words ton consider as keywords
        • -
        • extra_builtins - list of string - List of extra words ton consider as builtins
        • -
        - - -

        MIME types defined: text/x-python and text/x-cython.

        -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/python/python.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/python/python.js deleted file mode 100644 index 98c0409..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/python/python.js +++ /dev/null @@ -1,359 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - function wordRegexp(words) { - return new RegExp("^((" + words.join(")|(") + "))\\b"); - } - - var wordOperators = wordRegexp(["and", "or", "not", "is"]); - var commonKeywords = ["as", "assert", "break", "class", "continue", - "def", "del", "elif", "else", "except", "finally", - "for", "from", "global", "if", "import", - "lambda", "pass", "raise", "return", - "try", "while", "with", "yield", "in"]; - var commonBuiltins = ["abs", "all", "any", "bin", "bool", "bytearray", "callable", "chr", - "classmethod", "compile", "complex", "delattr", "dict", "dir", "divmod", - "enumerate", "eval", "filter", "float", "format", "frozenset", - "getattr", "globals", "hasattr", "hash", "help", "hex", "id", - "input", "int", "isinstance", "issubclass", "iter", "len", - "list", "locals", "map", "max", "memoryview", "min", "next", - "object", "oct", "open", "ord", "pow", "property", "range", - "repr", "reversed", "round", "set", "setattr", "slice", - "sorted", "staticmethod", "str", "sum", "super", "tuple", - "type", "vars", "zip", "__import__", "NotImplemented", - "Ellipsis", "__debug__"]; - var py2 = {builtins: ["apply", "basestring", "buffer", "cmp", "coerce", "execfile", - "file", "intern", "long", "raw_input", "reduce", "reload", - "unichr", "unicode", "xrange", "False", "True", "None"], - keywords: ["exec", "print"]}; - var py3 = {builtins: ["ascii", "bytes", "exec", "print"], - keywords: ["nonlocal", "False", "True", "None"]}; - - CodeMirror.registerHelper("hintWords", "python", commonKeywords.concat(commonBuiltins)); - - function top(state) { - return state.scopes[state.scopes.length - 1]; - } - - CodeMirror.defineMode("python", function(conf, parserConf) { - var ERRORCLASS = "error"; - - var singleDelimiters = parserConf.singleDelimiters || new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"); - var doubleOperators = parserConf.doubleOperators || new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"); - var doubleDelimiters = parserConf.doubleDelimiters || new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"); - var tripleDelimiters = parserConf.tripleDelimiters || new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"); - - if (parserConf.version && parseInt(parserConf.version, 10) == 3){ - // since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator - var singleOperators = parserConf.singleOperators || new RegExp("^[\\+\\-\\*/%&|\\^~<>!@]"); - var identifiers = parserConf.identifiers|| new RegExp("^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*"); - } else { - var singleOperators = parserConf.singleOperators || new RegExp("^[\\+\\-\\*/%&|\\^~<>!]"); - var identifiers = parserConf.identifiers|| new RegExp("^[_A-Za-z][_A-Za-z0-9]*"); - } - - var hangingIndent = parserConf.hangingIndent || conf.indentUnit; - - var myKeywords = commonKeywords, myBuiltins = commonBuiltins; - if(parserConf.extra_keywords != undefined){ - myKeywords = myKeywords.concat(parserConf.extra_keywords); - } - if(parserConf.extra_builtins != undefined){ - myBuiltins = myBuiltins.concat(parserConf.extra_builtins); - } - if (parserConf.version && parseInt(parserConf.version, 10) == 3) { - myKeywords = myKeywords.concat(py3.keywords); - myBuiltins = myBuiltins.concat(py3.builtins); - var stringPrefixes = new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))", "i"); - } else { - myKeywords = myKeywords.concat(py2.keywords); - myBuiltins = myBuiltins.concat(py2.builtins); - var stringPrefixes = new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))", "i"); - } - var keywords = wordRegexp(myKeywords); - var builtins = wordRegexp(myBuiltins); - - // tokenizers - function tokenBase(stream, state) { - // Handle scope changes - if (stream.sol() && top(state).type == "py") { - var scopeOffset = top(state).offset; - if (stream.eatSpace()) { - var lineOffset = stream.indentation(); - if (lineOffset > scopeOffset) - pushScope(stream, state, "py"); - else if (lineOffset < scopeOffset && dedent(stream, state)) - state.errorToken = true; - return null; - } else { - var style = tokenBaseInner(stream, state); - if (scopeOffset > 0 && dedent(stream, state)) - style += " " + ERRORCLASS; - return style; - } - } - return tokenBaseInner(stream, state); - } - - function tokenBaseInner(stream, state) { - if (stream.eatSpace()) return null; - - var ch = stream.peek(); - - // Handle Comments - if (ch == "#") { - stream.skipToEnd(); - return "comment"; - } - - // Handle Number Literals - if (stream.match(/^[0-9\.]/, false)) { - var floatLiteral = false; - // Floats - if (stream.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)) { floatLiteral = true; } - if (stream.match(/^\d+\.\d*/)) { floatLiteral = true; } - if (stream.match(/^\.\d+/)) { floatLiteral = true; } - if (floatLiteral) { - // Float literals may be "imaginary" - stream.eat(/J/i); - return "number"; - } - // Integers - var intLiteral = false; - // Hex - if (stream.match(/^0x[0-9a-f]+/i)) intLiteral = true; - // Binary - if (stream.match(/^0b[01]+/i)) intLiteral = true; - // Octal - if (stream.match(/^0o[0-7]+/i)) intLiteral = true; - // Decimal - if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) { - // Decimal literals may be "imaginary" - stream.eat(/J/i); - // TODO - Can you have imaginary longs? - intLiteral = true; - } - // Zero by itself with no other piece of number. - if (stream.match(/^0(?![\dx])/i)) intLiteral = true; - if (intLiteral) { - // Integer literals may be "long" - stream.eat(/L/i); - return "number"; - } - } - - // Handle Strings - if (stream.match(stringPrefixes)) { - state.tokenize = tokenStringFactory(stream.current()); - return state.tokenize(stream, state); - } - - // Handle operators and Delimiters - if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters)) - return null; - - if (stream.match(doubleOperators) - || stream.match(singleOperators) - || stream.match(wordOperators)) - return "operator"; - - if (stream.match(singleDelimiters)) - return null; - - if (stream.match(keywords)) - return "keyword"; - - if (stream.match(builtins)) - return "builtin"; - - if (stream.match(/^(self|cls)\b/)) - return "variable-2"; - - if (stream.match(identifiers)) { - if (state.lastToken == "def" || state.lastToken == "class") - return "def"; - return "variable"; - } - - // Handle non-detected items - stream.next(); - return ERRORCLASS; - } - - function tokenStringFactory(delimiter) { - while ("rub".indexOf(delimiter.charAt(0).toLowerCase()) >= 0) - delimiter = delimiter.substr(1); - - var singleline = delimiter.length == 1; - var OUTCLASS = "string"; - - function tokenString(stream, state) { - while (!stream.eol()) { - stream.eatWhile(/[^'"\\]/); - if (stream.eat("\\")) { - stream.next(); - if (singleline && stream.eol()) - return OUTCLASS; - } else if (stream.match(delimiter)) { - state.tokenize = tokenBase; - return OUTCLASS; - } else { - stream.eat(/['"]/); - } - } - if (singleline) { - if (parserConf.singleLineStringErrors) - return ERRORCLASS; - else - state.tokenize = tokenBase; - } - return OUTCLASS; - } - tokenString.isString = true; - return tokenString; - } - - function pushScope(stream, state, type) { - var offset = 0, align = null; - if (type == "py") { - while (top(state).type != "py") - state.scopes.pop(); - } - offset = top(state).offset + (type == "py" ? conf.indentUnit : hangingIndent); - if (type != "py" && !stream.match(/^(\s|#.*)*$/, false)) - align = stream.column() + 1; - state.scopes.push({offset: offset, type: type, align: align}); - } - - function dedent(stream, state) { - var indented = stream.indentation(); - while (top(state).offset > indented) { - if (top(state).type != "py") return true; - state.scopes.pop(); - } - return top(state).offset != indented; - } - - function tokenLexer(stream, state) { - var style = state.tokenize(stream, state); - var current = stream.current(); - - // Handle '.' connected identifiers - if (current == ".") { - style = stream.match(identifiers, false) ? null : ERRORCLASS; - if (style == null && state.lastStyle == "meta") { - // Apply 'meta' style to '.' connected identifiers when - // appropriate. - style = "meta"; - } - return style; - } - - // Handle decorators - if (current == "@"){ - if(parserConf.version && parseInt(parserConf.version, 10) == 3){ - return stream.match(identifiers, false) ? "meta" : "operator"; - } else { - return stream.match(identifiers, false) ? "meta" : ERRORCLASS; - } - } - - if ((style == "variable" || style == "builtin") - && state.lastStyle == "meta") - style = "meta"; - - // Handle scope changes. - if (current == "pass" || current == "return") - state.dedent += 1; - - if (current == "lambda") state.lambda = true; - if (current == ":" && !state.lambda && top(state).type == "py") - pushScope(stream, state, "py"); - - var delimiter_index = current.length == 1 ? "[({".indexOf(current) : -1; - if (delimiter_index != -1) - pushScope(stream, state, "])}".slice(delimiter_index, delimiter_index+1)); - - delimiter_index = "])}".indexOf(current); - if (delimiter_index != -1) { - if (top(state).type == current) state.scopes.pop(); - else return ERRORCLASS; - } - if (state.dedent > 0 && stream.eol() && top(state).type == "py") { - if (state.scopes.length > 1) state.scopes.pop(); - state.dedent -= 1; - } - - return style; - } - - var external = { - startState: function(basecolumn) { - return { - tokenize: tokenBase, - scopes: [{offset: basecolumn || 0, type: "py", align: null}], - lastStyle: null, - lastToken: null, - lambda: false, - dedent: 0 - }; - }, - - token: function(stream, state) { - var addErr = state.errorToken; - if (addErr) state.errorToken = false; - var style = tokenLexer(stream, state); - - state.lastStyle = style; - - var current = stream.current(); - if (current && style) - state.lastToken = current; - - if (stream.eol() && state.lambda) - state.lambda = false; - return addErr ? style + " " + ERRORCLASS : style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase) - return state.tokenize.isString ? CodeMirror.Pass : 0; - - var scope = top(state); - var closing = textAfter && textAfter.charAt(0) == scope.type; - if (scope.align != null) - return scope.align - (closing ? 1 : 0); - else if (closing && state.scopes.length > 1) - return state.scopes[state.scopes.length - 2].offset; - else - return scope.offset; - }, - - lineComment: "#", - fold: "indent" - }; - return external; - }); - - CodeMirror.defineMIME("text/x-python", "python"); - - var words = function(str) { return str.split(" "); }; - - CodeMirror.defineMIME("text/x-cython", { - name: "python", - extra_keywords: words("by cdef cimport cpdef ctypedef enum except"+ - "extern gil include nogil property public"+ - "readonly struct union DEF IF ELIF ELSE") - }); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/q/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/q/index.html deleted file mode 100644 index 72785ba..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/q/index.html +++ /dev/null @@ -1,144 +0,0 @@ - - -CodeMirror: Q mode - - - - - - - - - - -
        -

        Q mode

        - - -
        - - - -

        MIME type defined: text/x-q.

        -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/q/q.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/q/q.js deleted file mode 100644 index a4af938..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/q/q.js +++ /dev/null @@ -1,139 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("q",function(config){ - var indentUnit=config.indentUnit, - curPunc, - keywords=buildRE(["abs","acos","aj","aj0","all","and","any","asc","asin","asof","atan","attr","avg","avgs","bin","by","ceiling","cols","cor","cos","count","cov","cross","csv","cut","delete","deltas","desc","dev","differ","distinct","div","do","each","ej","enlist","eval","except","exec","exit","exp","fby","fills","first","fkeys","flip","floor","from","get","getenv","group","gtime","hclose","hcount","hdel","hopen","hsym","iasc","idesc","if","ij","in","insert","inter","inv","key","keys","last","like","list","lj","load","log","lower","lsq","ltime","ltrim","mavg","max","maxs","mcount","md5","mdev","med","meta","min","mins","mmax","mmin","mmu","mod","msum","neg","next","not","null","or","over","parse","peach","pj","plist","prd","prds","prev","prior","rand","rank","ratios","raze","read0","read1","reciprocal","reverse","rload","rotate","rsave","rtrim","save","scan","select","set","setenv","show","signum","sin","sqrt","ss","ssr","string","sublist","sum","sums","sv","system","tables","tan","til","trim","txf","type","uj","ungroup","union","update","upper","upsert","value","var","view","views","vs","wavg","where","where","while","within","wj","wj1","wsum","xasc","xbar","xcol","xcols","xdesc","xexp","xgroup","xkey","xlog","xprev","xrank"]), - E=/[|/&^!+:\\\-*%$=~#;@><,?_\'\"\[\(\]\)\s{}]/; - function buildRE(w){return new RegExp("^("+w.join("|")+")$");} - function tokenBase(stream,state){ - var sol=stream.sol(),c=stream.next(); - curPunc=null; - if(sol) - if(c=="/") - return(state.tokenize=tokenLineComment)(stream,state); - else if(c=="\\"){ - if(stream.eol()||/\s/.test(stream.peek())) - return stream.skipToEnd(),/^\\\s*$/.test(stream.current())?(state.tokenize=tokenCommentToEOF)(stream, state):state.tokenize=tokenBase,"comment"; - else - return state.tokenize=tokenBase,"builtin"; - } - if(/\s/.test(c)) - return stream.peek()=="/"?(stream.skipToEnd(),"comment"):"whitespace"; - if(c=='"') - return(state.tokenize=tokenString)(stream,state); - if(c=='`') - return stream.eatWhile(/[A-Z|a-z|\d|_|:|\/|\.]/),"symbol"; - if(("."==c&&/\d/.test(stream.peek()))||/\d/.test(c)){ - var t=null; - stream.backUp(1); - if(stream.match(/^\d{4}\.\d{2}(m|\.\d{2}([D|T](\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)?)?)/) - || stream.match(/^\d+D(\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)/) - || stream.match(/^\d{2}:\d{2}(:\d{2}(\.\d{1,9})?)?/) - || stream.match(/^\d+[ptuv]{1}/)) - t="temporal"; - else if(stream.match(/^0[NwW]{1}/) - || stream.match(/^0x[\d|a-f|A-F]*/) - || stream.match(/^[0|1]+[b]{1}/) - || stream.match(/^\d+[chijn]{1}/) - || stream.match(/-?\d*(\.\d*)?(e[+\-]?\d+)?(e|f)?/)) - t="number"; - return(t&&(!(c=stream.peek())||E.test(c)))?t:(stream.next(),"error"); - } - if(/[A-Z|a-z]|\./.test(c)) - return stream.eatWhile(/[A-Z|a-z|\.|_|\d]/),keywords.test(stream.current())?"keyword":"variable"; - if(/[|/&^!+:\\\-*%$=~#;@><\.,?_\']/.test(c)) - return null; - if(/[{}\(\[\]\)]/.test(c)) - return null; - return"error"; - } - function tokenLineComment(stream,state){ - return stream.skipToEnd(),/\/\s*$/.test(stream.current())?(state.tokenize=tokenBlockComment)(stream,state):(state.tokenize=tokenBase),"comment"; - } - function tokenBlockComment(stream,state){ - var f=stream.sol()&&stream.peek()=="\\"; - stream.skipToEnd(); - if(f&&/^\\\s*$/.test(stream.current())) - state.tokenize=tokenBase; - return"comment"; - } - function tokenCommentToEOF(stream){return stream.skipToEnd(),"comment";} - function tokenString(stream,state){ - var escaped=false,next,end=false; - while((next=stream.next())){ - if(next=="\""&&!escaped){end=true;break;} - escaped=!escaped&&next=="\\"; - } - if(end)state.tokenize=tokenBase; - return"string"; - } - function pushContext(state,type,col){state.context={prev:state.context,indent:state.indent,col:col,type:type};} - function popContext(state){state.indent=state.context.indent;state.context=state.context.prev;} - return{ - startState:function(){ - return{tokenize:tokenBase, - context:null, - indent:0, - col:0}; - }, - token:function(stream,state){ - if(stream.sol()){ - if(state.context&&state.context.align==null) - state.context.align=false; - state.indent=stream.indentation(); - } - //if (stream.eatSpace()) return null; - var style=state.tokenize(stream,state); - if(style!="comment"&&state.context&&state.context.align==null&&state.context.type!="pattern"){ - state.context.align=true; - } - if(curPunc=="(")pushContext(state,")",stream.column()); - else if(curPunc=="[")pushContext(state,"]",stream.column()); - else if(curPunc=="{")pushContext(state,"}",stream.column()); - else if(/[\]\}\)]/.test(curPunc)){ - while(state.context&&state.context.type=="pattern")popContext(state); - if(state.context&&curPunc==state.context.type)popContext(state); - } - else if(curPunc=="."&&state.context&&state.context.type=="pattern")popContext(state); - else if(/atom|string|variable/.test(style)&&state.context){ - if(/[\}\]]/.test(state.context.type)) - pushContext(state,"pattern",stream.column()); - else if(state.context.type=="pattern"&&!state.context.align){ - state.context.align=true; - state.context.col=stream.column(); - } - } - return style; - }, - indent:function(state,textAfter){ - var firstChar=textAfter&&textAfter.charAt(0); - var context=state.context; - if(/[\]\}]/.test(firstChar)) - while (context&&context.type=="pattern")context=context.prev; - var closing=context&&firstChar==context.type; - if(!context) - return 0; - else if(context.type=="pattern") - return context.col; - else if(context.align) - return context.col+(closing?0:1); - else - return context.indent+(closing?0:indentUnit); - } - }; -}); -CodeMirror.defineMIME("text/x-q","q"); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/r/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/r/index.html deleted file mode 100644 index 6dd9634..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/r/index.html +++ /dev/null @@ -1,85 +0,0 @@ - - -CodeMirror: R mode - - - - - - - - - -
        -

        R mode

        -
        - - -

        MIME types defined: text/x-rsrc.

        - -

        Development of the CodeMirror R mode was kindly sponsored - by Ubalo.

        - -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/r/r.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/r/r.js deleted file mode 100644 index 1ab4a95..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/r/r.js +++ /dev/null @@ -1,162 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("r", function(config) { - function wordObj(str) { - var words = str.split(" "), res = {}; - for (var i = 0; i < words.length; ++i) res[words[i]] = true; - return res; - } - var atoms = wordObj("NULL NA Inf NaN NA_integer_ NA_real_ NA_complex_ NA_character_"); - var builtins = wordObj("list quote bquote eval return call parse deparse"); - var keywords = wordObj("if else repeat while function for in next break"); - var blockkeywords = wordObj("if else repeat while function for"); - var opChars = /[+\-*\/^<>=!&|~$:]/; - var curPunc; - - function tokenBase(stream, state) { - curPunc = null; - var ch = stream.next(); - if (ch == "#") { - stream.skipToEnd(); - return "comment"; - } else if (ch == "0" && stream.eat("x")) { - stream.eatWhile(/[\da-f]/i); - return "number"; - } else if (ch == "." && stream.eat(/\d/)) { - stream.match(/\d*(?:e[+\-]?\d+)?/); - return "number"; - } else if (/\d/.test(ch)) { - stream.match(/\d*(?:\.\d+)?(?:e[+\-]\d+)?L?/); - return "number"; - } else if (ch == "'" || ch == '"') { - state.tokenize = tokenString(ch); - return "string"; - } else if (ch == "." && stream.match(/.[.\d]+/)) { - return "keyword"; - } else if (/[\w\.]/.test(ch) && ch != "_") { - stream.eatWhile(/[\w\.]/); - var word = stream.current(); - if (atoms.propertyIsEnumerable(word)) return "atom"; - if (keywords.propertyIsEnumerable(word)) { - // Block keywords start new blocks, except 'else if', which only starts - // one new block for the 'if', no block for the 'else'. - if (blockkeywords.propertyIsEnumerable(word) && - !stream.match(/\s*if(\s+|$)/, false)) - curPunc = "block"; - return "keyword"; - } - if (builtins.propertyIsEnumerable(word)) return "builtin"; - return "variable"; - } else if (ch == "%") { - if (stream.skipTo("%")) stream.next(); - return "variable-2"; - } else if (ch == "<" && stream.eat("-")) { - return "arrow"; - } else if (ch == "=" && state.ctx.argList) { - return "arg-is"; - } else if (opChars.test(ch)) { - if (ch == "$") return "dollar"; - stream.eatWhile(opChars); - return "operator"; - } else if (/[\(\){}\[\];]/.test(ch)) { - curPunc = ch; - if (ch == ";") return "semi"; - return null; - } else { - return null; - } - } - - function tokenString(quote) { - return function(stream, state) { - if (stream.eat("\\")) { - var ch = stream.next(); - if (ch == "x") stream.match(/^[a-f0-9]{2}/i); - else if ((ch == "u" || ch == "U") && stream.eat("{") && stream.skipTo("}")) stream.next(); - else if (ch == "u") stream.match(/^[a-f0-9]{4}/i); - else if (ch == "U") stream.match(/^[a-f0-9]{8}/i); - else if (/[0-7]/.test(ch)) stream.match(/^[0-7]{1,2}/); - return "string-2"; - } else { - var next; - while ((next = stream.next()) != null) { - if (next == quote) { state.tokenize = tokenBase; break; } - if (next == "\\") { stream.backUp(1); break; } - } - return "string"; - } - }; - } - - function push(state, type, stream) { - state.ctx = {type: type, - indent: state.indent, - align: null, - column: stream.column(), - prev: state.ctx}; - } - function pop(state) { - state.indent = state.ctx.indent; - state.ctx = state.ctx.prev; - } - - return { - startState: function() { - return {tokenize: tokenBase, - ctx: {type: "top", - indent: -config.indentUnit, - align: false}, - indent: 0, - afterIdent: false}; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (state.ctx.align == null) state.ctx.align = false; - state.indent = stream.indentation(); - } - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - if (style != "comment" && state.ctx.align == null) state.ctx.align = true; - - var ctype = state.ctx.type; - if ((curPunc == ";" || curPunc == "{" || curPunc == "}") && ctype == "block") pop(state); - if (curPunc == "{") push(state, "}", stream); - else if (curPunc == "(") { - push(state, ")", stream); - if (state.afterIdent) state.ctx.argList = true; - } - else if (curPunc == "[") push(state, "]", stream); - else if (curPunc == "block") push(state, "block", stream); - else if (curPunc == ctype) pop(state); - state.afterIdent = style == "variable" || style == "keyword"; - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), ctx = state.ctx, - closing = firstChar == ctx.type; - if (ctx.type == "block") return ctx.indent + (firstChar == "{" ? 0 : config.indentUnit); - else if (ctx.align) return ctx.column + (closing ? 0 : 1); - else return ctx.indent + (closing ? 0 : config.indentUnit); - }, - - lineComment: "#" - }; -}); - -CodeMirror.defineMIME("text/x-rsrc", "r"); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/rpm/changes/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/rpm/changes/index.html deleted file mode 100644 index 6e5031b..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/rpm/changes/index.html +++ /dev/null @@ -1,66 +0,0 @@ - - -CodeMirror: RPM changes mode - - - - - - - - - - - -
        -

        RPM changes mode

        - -
        - - -

        MIME types defined: text/x-rpm-changes.

        -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/rpm/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/rpm/index.html deleted file mode 100644 index 9a34e6d..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/rpm/index.html +++ /dev/null @@ -1,149 +0,0 @@ - - -CodeMirror: RPM changes mode - - - - - - - - - - - -
        -

        RPM changes mode

        - -
        - - -

        RPM spec mode

        - -
        - - -

        MIME types defined: text/x-rpm-spec, text/x-rpm-changes.

        -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/rpm/rpm.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/rpm/rpm.js deleted file mode 100644 index 3bb7cd2..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/rpm/rpm.js +++ /dev/null @@ -1,101 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("rpm-changes", function() { - var headerSeperator = /^-+$/; - var headerLine = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /; - var simpleEmail = /^[\w+.-]+@[\w.-]+/; - - return { - token: function(stream) { - if (stream.sol()) { - if (stream.match(headerSeperator)) { return 'tag'; } - if (stream.match(headerLine)) { return 'tag'; } - } - if (stream.match(simpleEmail)) { return 'string'; } - stream.next(); - return null; - } - }; -}); - -CodeMirror.defineMIME("text/x-rpm-changes", "rpm-changes"); - -// Quick and dirty spec file highlighting - -CodeMirror.defineMode("rpm-spec", function() { - var arch = /^(i386|i586|i686|x86_64|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/; - - var preamble = /^(Name|Version|Release|License|Summary|Url|Group|Source|BuildArch|BuildRequires|BuildRoot|AutoReqProv|Provides|Requires(\(\w+\))?|Obsoletes|Conflicts|Recommends|Source\d*|Patch\d*|ExclusiveArch|NoSource|Supplements):/; - var section = /^%(debug_package|package|description|prep|build|install|files|clean|changelog|preinstall|preun|postinstall|postun|pre|post|triggerin|triggerun|pretrans|posttrans|verifyscript|check|triggerpostun|triggerprein|trigger)/; - var control_flow_complex = /^%(ifnarch|ifarch|if)/; // rpm control flow macros - var control_flow_simple = /^%(else|endif)/; // rpm control flow macros - var operators = /^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/; // operators in control flow macros - - return { - startState: function () { - return { - controlFlow: false, - macroParameters: false, - section: false - }; - }, - token: function (stream, state) { - var ch = stream.peek(); - if (ch == "#") { stream.skipToEnd(); return "comment"; } - - if (stream.sol()) { - if (stream.match(preamble)) { return "preamble"; } - if (stream.match(section)) { return "section"; } - } - - if (stream.match(/^\$\w+/)) { return "def"; } // Variables like '$RPM_BUILD_ROOT' - if (stream.match(/^\$\{\w+\}/)) { return "def"; } // Variables like '${RPM_BUILD_ROOT}' - - if (stream.match(control_flow_simple)) { return "keyword"; } - if (stream.match(control_flow_complex)) { - state.controlFlow = true; - return "keyword"; - } - if (state.controlFlow) { - if (stream.match(operators)) { return "operator"; } - if (stream.match(/^(\d+)/)) { return "number"; } - if (stream.eol()) { state.controlFlow = false; } - } - - if (stream.match(arch)) { return "number"; } - - // Macros like '%make_install' or '%attr(0775,root,root)' - if (stream.match(/^%[\w]+/)) { - if (stream.match(/^\(/)) { state.macroParameters = true; } - return "macro"; - } - if (state.macroParameters) { - if (stream.match(/^\d+/)) { return "number";} - if (stream.match(/^\)/)) { - state.macroParameters = false; - return "macro"; - } - } - if (stream.match(/^%\{\??[\w \-]+\}/)) { return "macro"; } // Macros like '%{defined fedora}' - - //TODO: Include bash script sub-parser (CodeMirror supports that) - stream.next(); - return null; - } - }; -}); - -CodeMirror.defineMIME("text/x-rpm-spec", "rpm-spec"); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/rst/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/rst/index.html deleted file mode 100644 index 2902dea..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/rst/index.html +++ /dev/null @@ -1,535 +0,0 @@ - - -CodeMirror: reStructuredText mode - - - - - - - - - - -
        -

        reStructuredText mode

        -
        - - -

        - The python mode will be used for highlighting blocks - containing Python/IPython terminal sessions: blocks starting with - >>> (for Python) or In [num]: (for - IPython). - - Further, the stex mode will be used for highlighting - blocks containing LaTex code. -

        - -

        MIME types defined: text/x-rst.

        -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/rst/rst.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/rst/rst.js deleted file mode 100644 index bcf110c..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/rst/rst.js +++ /dev/null @@ -1,557 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../python/python"), require("../stex/stex"), require("../../addon/mode/overlay")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../python/python", "../stex/stex", "../../addon/mode/overlay"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode('rst', function (config, options) { - - var rx_strong = /^\*\*[^\*\s](?:[^\*]*[^\*\s])?\*\*/; - var rx_emphasis = /^\*[^\*\s](?:[^\*]*[^\*\s])?\*/; - var rx_literal = /^``[^`\s](?:[^`]*[^`\s])``/; - - var rx_number = /^(?:[\d]+(?:[\.,]\d+)*)/; - var rx_positive = /^(?:\s\+[\d]+(?:[\.,]\d+)*)/; - var rx_negative = /^(?:\s\-[\d]+(?:[\.,]\d+)*)/; - - var rx_uri_protocol = "[Hh][Tt][Tt][Pp][Ss]?://"; - var rx_uri_domain = "(?:[\\d\\w.-]+)\\.(?:\\w{2,6})"; - var rx_uri_path = "(?:/[\\d\\w\\#\\%\\&\\-\\.\\,\\/\\:\\=\\?\\~]+)*"; - var rx_uri = new RegExp("^" + rx_uri_protocol + rx_uri_domain + rx_uri_path); - - var overlay = { - token: function (stream) { - - if (stream.match(rx_strong) && stream.match (/\W+|$/, false)) - return 'strong'; - if (stream.match(rx_emphasis) && stream.match (/\W+|$/, false)) - return 'em'; - if (stream.match(rx_literal) && stream.match (/\W+|$/, false)) - return 'string-2'; - if (stream.match(rx_number)) - return 'number'; - if (stream.match(rx_positive)) - return 'positive'; - if (stream.match(rx_negative)) - return 'negative'; - if (stream.match(rx_uri)) - return 'link'; - - while (stream.next() != null) { - if (stream.match(rx_strong, false)) break; - if (stream.match(rx_emphasis, false)) break; - if (stream.match(rx_literal, false)) break; - if (stream.match(rx_number, false)) break; - if (stream.match(rx_positive, false)) break; - if (stream.match(rx_negative, false)) break; - if (stream.match(rx_uri, false)) break; - } - - return null; - } - }; - - var mode = CodeMirror.getMode( - config, options.backdrop || 'rst-base' - ); - - return CodeMirror.overlayMode(mode, overlay, true); // combine -}, 'python', 'stex'); - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -CodeMirror.defineMode('rst-base', function (config) { - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - function format(string) { - var args = Array.prototype.slice.call(arguments, 1); - return string.replace(/{(\d+)}/g, function (match, n) { - return typeof args[n] != 'undefined' ? args[n] : match; - }); - } - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - var mode_python = CodeMirror.getMode(config, 'python'); - var mode_stex = CodeMirror.getMode(config, 'stex'); - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - var SEPA = "\\s+"; - var TAIL = "(?:\\s*|\\W|$)", - rx_TAIL = new RegExp(format('^{0}', TAIL)); - - var NAME = - "(?:[^\\W\\d_](?:[\\w!\"#$%&'()\\*\\+,\\-\\.\/:;<=>\\?]*[^\\W_])?)", - rx_NAME = new RegExp(format('^{0}', NAME)); - var NAME_WWS = - "(?:[^\\W\\d_](?:[\\w\\s!\"#$%&'()\\*\\+,\\-\\.\/:;<=>\\?]*[^\\W_])?)"; - var REF_NAME = format('(?:{0}|`{1}`)', NAME, NAME_WWS); - - var TEXT1 = "(?:[^\\s\\|](?:[^\\|]*[^\\s\\|])?)"; - var TEXT2 = "(?:[^\\`]+)", - rx_TEXT2 = new RegExp(format('^{0}', TEXT2)); - - var rx_section = new RegExp( - "^([!'#$%&\"()*+,-./:;<=>?@\\[\\\\\\]^_`{|}~])\\1{3,}\\s*$"); - var rx_explicit = new RegExp( - format('^\\.\\.{0}', SEPA)); - var rx_link = new RegExp( - format('^_{0}:{1}|^__:{1}', REF_NAME, TAIL)); - var rx_directive = new RegExp( - format('^{0}::{1}', REF_NAME, TAIL)); - var rx_substitution = new RegExp( - format('^\\|{0}\\|{1}{2}::{3}', TEXT1, SEPA, REF_NAME, TAIL)); - var rx_footnote = new RegExp( - format('^\\[(?:\\d+|#{0}?|\\*)]{1}', REF_NAME, TAIL)); - var rx_citation = new RegExp( - format('^\\[{0}\\]{1}', REF_NAME, TAIL)); - - var rx_substitution_ref = new RegExp( - format('^\\|{0}\\|', TEXT1)); - var rx_footnote_ref = new RegExp( - format('^\\[(?:\\d+|#{0}?|\\*)]_', REF_NAME)); - var rx_citation_ref = new RegExp( - format('^\\[{0}\\]_', REF_NAME)); - var rx_link_ref1 = new RegExp( - format('^{0}__?', REF_NAME)); - var rx_link_ref2 = new RegExp( - format('^`{0}`_', TEXT2)); - - var rx_role_pre = new RegExp( - format('^:{0}:`{1}`{2}', NAME, TEXT2, TAIL)); - var rx_role_suf = new RegExp( - format('^`{1}`:{0}:{2}', NAME, TEXT2, TAIL)); - var rx_role = new RegExp( - format('^:{0}:{1}', NAME, TAIL)); - - var rx_directive_name = new RegExp(format('^{0}', REF_NAME)); - var rx_directive_tail = new RegExp(format('^::{0}', TAIL)); - var rx_substitution_text = new RegExp(format('^\\|{0}\\|', TEXT1)); - var rx_substitution_sepa = new RegExp(format('^{0}', SEPA)); - var rx_substitution_name = new RegExp(format('^{0}', REF_NAME)); - var rx_substitution_tail = new RegExp(format('^::{0}', TAIL)); - var rx_link_head = new RegExp("^_"); - var rx_link_name = new RegExp(format('^{0}|_', REF_NAME)); - var rx_link_tail = new RegExp(format('^:{0}', TAIL)); - - var rx_verbatim = new RegExp('^::\\s*$'); - var rx_examples = new RegExp('^\\s+(?:>>>|In \\[\\d+\\]:)\\s'); - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - function to_normal(stream, state) { - var token = null; - - if (stream.sol() && stream.match(rx_examples, false)) { - change(state, to_mode, { - mode: mode_python, local: CodeMirror.startState(mode_python) - }); - } else if (stream.sol() && stream.match(rx_explicit)) { - change(state, to_explicit); - token = 'meta'; - } else if (stream.sol() && stream.match(rx_section)) { - change(state, to_normal); - token = 'header'; - } else if (phase(state) == rx_role_pre || - stream.match(rx_role_pre, false)) { - - switch (stage(state)) { - case 0: - change(state, to_normal, context(rx_role_pre, 1)); - stream.match(/^:/); - token = 'meta'; - break; - case 1: - change(state, to_normal, context(rx_role_pre, 2)); - stream.match(rx_NAME); - token = 'keyword'; - - if (stream.current().match(/^(?:math|latex)/)) { - state.tmp_stex = true; - } - break; - case 2: - change(state, to_normal, context(rx_role_pre, 3)); - stream.match(/^:`/); - token = 'meta'; - break; - case 3: - if (state.tmp_stex) { - state.tmp_stex = undefined; state.tmp = { - mode: mode_stex, local: CodeMirror.startState(mode_stex) - }; - } - - if (state.tmp) { - if (stream.peek() == '`') { - change(state, to_normal, context(rx_role_pre, 4)); - state.tmp = undefined; - break; - } - - token = state.tmp.mode.token(stream, state.tmp.local); - break; - } - - change(state, to_normal, context(rx_role_pre, 4)); - stream.match(rx_TEXT2); - token = 'string'; - break; - case 4: - change(state, to_normal, context(rx_role_pre, 5)); - stream.match(/^`/); - token = 'meta'; - break; - case 5: - change(state, to_normal, context(rx_role_pre, 6)); - stream.match(rx_TAIL); - break; - default: - change(state, to_normal); - } - } else if (phase(state) == rx_role_suf || - stream.match(rx_role_suf, false)) { - - switch (stage(state)) { - case 0: - change(state, to_normal, context(rx_role_suf, 1)); - stream.match(/^`/); - token = 'meta'; - break; - case 1: - change(state, to_normal, context(rx_role_suf, 2)); - stream.match(rx_TEXT2); - token = 'string'; - break; - case 2: - change(state, to_normal, context(rx_role_suf, 3)); - stream.match(/^`:/); - token = 'meta'; - break; - case 3: - change(state, to_normal, context(rx_role_suf, 4)); - stream.match(rx_NAME); - token = 'keyword'; - break; - case 4: - change(state, to_normal, context(rx_role_suf, 5)); - stream.match(/^:/); - token = 'meta'; - break; - case 5: - change(state, to_normal, context(rx_role_suf, 6)); - stream.match(rx_TAIL); - break; - default: - change(state, to_normal); - } - } else if (phase(state) == rx_role || stream.match(rx_role, false)) { - - switch (stage(state)) { - case 0: - change(state, to_normal, context(rx_role, 1)); - stream.match(/^:/); - token = 'meta'; - break; - case 1: - change(state, to_normal, context(rx_role, 2)); - stream.match(rx_NAME); - token = 'keyword'; - break; - case 2: - change(state, to_normal, context(rx_role, 3)); - stream.match(/^:/); - token = 'meta'; - break; - case 3: - change(state, to_normal, context(rx_role, 4)); - stream.match(rx_TAIL); - break; - default: - change(state, to_normal); - } - } else if (phase(state) == rx_substitution_ref || - stream.match(rx_substitution_ref, false)) { - - switch (stage(state)) { - case 0: - change(state, to_normal, context(rx_substitution_ref, 1)); - stream.match(rx_substitution_text); - token = 'variable-2'; - break; - case 1: - change(state, to_normal, context(rx_substitution_ref, 2)); - if (stream.match(/^_?_?/)) token = 'link'; - break; - default: - change(state, to_normal); - } - } else if (stream.match(rx_footnote_ref)) { - change(state, to_normal); - token = 'quote'; - } else if (stream.match(rx_citation_ref)) { - change(state, to_normal); - token = 'quote'; - } else if (stream.match(rx_link_ref1)) { - change(state, to_normal); - if (!stream.peek() || stream.peek().match(/^\W$/)) { - token = 'link'; - } - } else if (phase(state) == rx_link_ref2 || - stream.match(rx_link_ref2, false)) { - - switch (stage(state)) { - case 0: - if (!stream.peek() || stream.peek().match(/^\W$/)) { - change(state, to_normal, context(rx_link_ref2, 1)); - } else { - stream.match(rx_link_ref2); - } - break; - case 1: - change(state, to_normal, context(rx_link_ref2, 2)); - stream.match(/^`/); - token = 'link'; - break; - case 2: - change(state, to_normal, context(rx_link_ref2, 3)); - stream.match(rx_TEXT2); - break; - case 3: - change(state, to_normal, context(rx_link_ref2, 4)); - stream.match(/^`_/); - token = 'link'; - break; - default: - change(state, to_normal); - } - } else if (stream.match(rx_verbatim)) { - change(state, to_verbatim); - } - - else { - if (stream.next()) change(state, to_normal); - } - - return token; - } - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - function to_explicit(stream, state) { - var token = null; - - if (phase(state) == rx_substitution || - stream.match(rx_substitution, false)) { - - switch (stage(state)) { - case 0: - change(state, to_explicit, context(rx_substitution, 1)); - stream.match(rx_substitution_text); - token = 'variable-2'; - break; - case 1: - change(state, to_explicit, context(rx_substitution, 2)); - stream.match(rx_substitution_sepa); - break; - case 2: - change(state, to_explicit, context(rx_substitution, 3)); - stream.match(rx_substitution_name); - token = 'keyword'; - break; - case 3: - change(state, to_explicit, context(rx_substitution, 4)); - stream.match(rx_substitution_tail); - token = 'meta'; - break; - default: - change(state, to_normal); - } - } else if (phase(state) == rx_directive || - stream.match(rx_directive, false)) { - - switch (stage(state)) { - case 0: - change(state, to_explicit, context(rx_directive, 1)); - stream.match(rx_directive_name); - token = 'keyword'; - - if (stream.current().match(/^(?:math|latex)/)) - state.tmp_stex = true; - else if (stream.current().match(/^python/)) - state.tmp_py = true; - break; - case 1: - change(state, to_explicit, context(rx_directive, 2)); - stream.match(rx_directive_tail); - token = 'meta'; - - if (stream.match(/^latex\s*$/) || state.tmp_stex) { - state.tmp_stex = undefined; change(state, to_mode, { - mode: mode_stex, local: CodeMirror.startState(mode_stex) - }); - } - break; - case 2: - change(state, to_explicit, context(rx_directive, 3)); - if (stream.match(/^python\s*$/) || state.tmp_py) { - state.tmp_py = undefined; change(state, to_mode, { - mode: mode_python, local: CodeMirror.startState(mode_python) - }); - } - break; - default: - change(state, to_normal); - } - } else if (phase(state) == rx_link || stream.match(rx_link, false)) { - - switch (stage(state)) { - case 0: - change(state, to_explicit, context(rx_link, 1)); - stream.match(rx_link_head); - stream.match(rx_link_name); - token = 'link'; - break; - case 1: - change(state, to_explicit, context(rx_link, 2)); - stream.match(rx_link_tail); - token = 'meta'; - break; - default: - change(state, to_normal); - } - } else if (stream.match(rx_footnote)) { - change(state, to_normal); - token = 'quote'; - } else if (stream.match(rx_citation)) { - change(state, to_normal); - token = 'quote'; - } - - else { - stream.eatSpace(); - if (stream.eol()) { - change(state, to_normal); - } else { - stream.skipToEnd(); - change(state, to_comment); - token = 'comment'; - } - } - - return token; - } - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - function to_comment(stream, state) { - return as_block(stream, state, 'comment'); - } - - function to_verbatim(stream, state) { - return as_block(stream, state, 'meta'); - } - - function as_block(stream, state, token) { - if (stream.eol() || stream.eatSpace()) { - stream.skipToEnd(); - return token; - } else { - change(state, to_normal); - return null; - } - } - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - function to_mode(stream, state) { - - if (state.ctx.mode && state.ctx.local) { - - if (stream.sol()) { - if (!stream.eatSpace()) change(state, to_normal); - return null; - } - - return state.ctx.mode.token(stream, state.ctx.local); - } - - change(state, to_normal); - return null; - } - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - function context(phase, stage, mode, local) { - return {phase: phase, stage: stage, mode: mode, local: local}; - } - - function change(state, tok, ctx) { - state.tok = tok; - state.ctx = ctx || {}; - } - - function stage(state) { - return state.ctx.stage || 0; - } - - function phase(state) { - return state.ctx.phase; - } - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - return { - startState: function () { - return {tok: to_normal, ctx: context(undefined, 0)}; - }, - - copyState: function (state) { - var ctx = state.ctx, tmp = state.tmp; - if (ctx.local) - ctx = {mode: ctx.mode, local: CodeMirror.copyState(ctx.mode, ctx.local)}; - if (tmp) - tmp = {mode: tmp.mode, local: CodeMirror.copyState(tmp.mode, tmp.local)}; - return {tok: state.tok, ctx: ctx, tmp: tmp}; - }, - - innerMode: function (state) { - return state.tmp ? {state: state.tmp.local, mode: state.tmp.mode} - : state.ctx.mode ? {state: state.ctx.local, mode: state.ctx.mode} - : null; - }, - - token: function (stream, state) { - return state.tok(stream, state); - } - }; -}, 'python', 'stex'); - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -CodeMirror.defineMIME('text/x-rst', 'rst'); - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/ruby/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/ruby/index.html deleted file mode 100644 index 97544ba..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/ruby/index.html +++ /dev/null @@ -1,183 +0,0 @@ - - -CodeMirror: Ruby mode - - - - - - - - - - -
        -

        Ruby mode

        -
        - - -

        MIME types defined: text/x-ruby.

        - -

        Development of the CodeMirror Ruby mode was kindly sponsored - by Ubalo.

        - -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/ruby/ruby.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/ruby/ruby.js deleted file mode 100644 index eab9d9d..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/ruby/ruby.js +++ /dev/null @@ -1,285 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("ruby", function(config) { - function wordObj(words) { - var o = {}; - for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true; - return o; - } - var keywords = wordObj([ - "alias", "and", "BEGIN", "begin", "break", "case", "class", "def", "defined?", "do", "else", - "elsif", "END", "end", "ensure", "false", "for", "if", "in", "module", "next", "not", "or", - "redo", "rescue", "retry", "return", "self", "super", "then", "true", "undef", "unless", - "until", "when", "while", "yield", "nil", "raise", "throw", "catch", "fail", "loop", "callcc", - "caller", "lambda", "proc", "public", "protected", "private", "require", "load", - "require_relative", "extend", "autoload", "__END__", "__FILE__", "__LINE__", "__dir__" - ]); - var indentWords = wordObj(["def", "class", "case", "for", "while", "module", "then", - "catch", "loop", "proc", "begin"]); - var dedentWords = wordObj(["end", "until"]); - var matching = {"[": "]", "{": "}", "(": ")"}; - var curPunc; - - function chain(newtok, stream, state) { - state.tokenize.push(newtok); - return newtok(stream, state); - } - - function tokenBase(stream, state) { - curPunc = null; - if (stream.sol() && stream.match("=begin") && stream.eol()) { - state.tokenize.push(readBlockComment); - return "comment"; - } - if (stream.eatSpace()) return null; - var ch = stream.next(), m; - if (ch == "`" || ch == "'" || ch == '"') { - return chain(readQuoted(ch, "string", ch == '"' || ch == "`"), stream, state); - } else if (ch == "/") { - var currentIndex = stream.current().length; - if (stream.skipTo("/")) { - var search_till = stream.current().length; - stream.backUp(stream.current().length - currentIndex); - var balance = 0; // balance brackets - while (stream.current().length < search_till) { - var chchr = stream.next(); - if (chchr == "(") balance += 1; - else if (chchr == ")") balance -= 1; - if (balance < 0) break; - } - stream.backUp(stream.current().length - currentIndex); - if (balance == 0) - return chain(readQuoted(ch, "string-2", true), stream, state); - } - return "operator"; - } else if (ch == "%") { - var style = "string", embed = true; - if (stream.eat("s")) style = "atom"; - else if (stream.eat(/[WQ]/)) style = "string"; - else if (stream.eat(/[r]/)) style = "string-2"; - else if (stream.eat(/[wxq]/)) { style = "string"; embed = false; } - var delim = stream.eat(/[^\w\s=]/); - if (!delim) return "operator"; - if (matching.propertyIsEnumerable(delim)) delim = matching[delim]; - return chain(readQuoted(delim, style, embed, true), stream, state); - } else if (ch == "#") { - stream.skipToEnd(); - return "comment"; - } else if (ch == "<" && (m = stream.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/))) { - return chain(readHereDoc(m[1]), stream, state); - } else if (ch == "0") { - if (stream.eat("x")) stream.eatWhile(/[\da-fA-F]/); - else if (stream.eat("b")) stream.eatWhile(/[01]/); - else stream.eatWhile(/[0-7]/); - return "number"; - } else if (/\d/.test(ch)) { - stream.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/); - return "number"; - } else if (ch == "?") { - while (stream.match(/^\\[CM]-/)) {} - if (stream.eat("\\")) stream.eatWhile(/\w/); - else stream.next(); - return "string"; - } else if (ch == ":") { - if (stream.eat("'")) return chain(readQuoted("'", "atom", false), stream, state); - if (stream.eat('"')) return chain(readQuoted('"', "atom", true), stream, state); - - // :> :>> :< :<< are valid symbols - if (stream.eat(/[\<\>]/)) { - stream.eat(/[\<\>]/); - return "atom"; - } - - // :+ :- :/ :* :| :& :! are valid symbols - if (stream.eat(/[\+\-\*\/\&\|\:\!]/)) { - return "atom"; - } - - // Symbols can't start by a digit - if (stream.eat(/[a-zA-Z$@_\xa1-\uffff]/)) { - stream.eatWhile(/[\w$\xa1-\uffff]/); - // Only one ? ! = is allowed and only as the last character - stream.eat(/[\?\!\=]/); - return "atom"; - } - return "operator"; - } else if (ch == "@" && stream.match(/^@?[a-zA-Z_\xa1-\uffff]/)) { - stream.eat("@"); - stream.eatWhile(/[\w\xa1-\uffff]/); - return "variable-2"; - } else if (ch == "$") { - if (stream.eat(/[a-zA-Z_]/)) { - stream.eatWhile(/[\w]/); - } else if (stream.eat(/\d/)) { - stream.eat(/\d/); - } else { - stream.next(); // Must be a special global like $: or $! - } - return "variable-3"; - } else if (/[a-zA-Z_\xa1-\uffff]/.test(ch)) { - stream.eatWhile(/[\w\xa1-\uffff]/); - stream.eat(/[\?\!]/); - if (stream.eat(":")) return "atom"; - return "ident"; - } else if (ch == "|" && (state.varList || state.lastTok == "{" || state.lastTok == "do")) { - curPunc = "|"; - return null; - } else if (/[\(\)\[\]{}\\;]/.test(ch)) { - curPunc = ch; - return null; - } else if (ch == "-" && stream.eat(">")) { - return "arrow"; - } else if (/[=+\-\/*:\.^%<>~|]/.test(ch)) { - var more = stream.eatWhile(/[=+\-\/*:\.^%<>~|]/); - if (ch == "." && !more) curPunc = "."; - return "operator"; - } else { - return null; - } - } - - function tokenBaseUntilBrace(depth) { - if (!depth) depth = 1; - return function(stream, state) { - if (stream.peek() == "}") { - if (depth == 1) { - state.tokenize.pop(); - return state.tokenize[state.tokenize.length-1](stream, state); - } else { - state.tokenize[state.tokenize.length - 1] = tokenBaseUntilBrace(depth - 1); - } - } else if (stream.peek() == "{") { - state.tokenize[state.tokenize.length - 1] = tokenBaseUntilBrace(depth + 1); - } - return tokenBase(stream, state); - }; - } - function tokenBaseOnce() { - var alreadyCalled = false; - return function(stream, state) { - if (alreadyCalled) { - state.tokenize.pop(); - return state.tokenize[state.tokenize.length-1](stream, state); - } - alreadyCalled = true; - return tokenBase(stream, state); - }; - } - function readQuoted(quote, style, embed, unescaped) { - return function(stream, state) { - var escaped = false, ch; - - if (state.context.type === 'read-quoted-paused') { - state.context = state.context.prev; - stream.eat("}"); - } - - while ((ch = stream.next()) != null) { - if (ch == quote && (unescaped || !escaped)) { - state.tokenize.pop(); - break; - } - if (embed && ch == "#" && !escaped) { - if (stream.eat("{")) { - if (quote == "}") { - state.context = {prev: state.context, type: 'read-quoted-paused'}; - } - state.tokenize.push(tokenBaseUntilBrace()); - break; - } else if (/[@\$]/.test(stream.peek())) { - state.tokenize.push(tokenBaseOnce()); - break; - } - } - escaped = !escaped && ch == "\\"; - } - return style; - }; - } - function readHereDoc(phrase) { - return function(stream, state) { - if (stream.match(phrase)) state.tokenize.pop(); - else stream.skipToEnd(); - return "string"; - }; - } - function readBlockComment(stream, state) { - if (stream.sol() && stream.match("=end") && stream.eol()) - state.tokenize.pop(); - stream.skipToEnd(); - return "comment"; - } - - return { - startState: function() { - return {tokenize: [tokenBase], - indented: 0, - context: {type: "top", indented: -config.indentUnit}, - continuedLine: false, - lastTok: null, - varList: false}; - }, - - token: function(stream, state) { - if (stream.sol()) state.indented = stream.indentation(); - var style = state.tokenize[state.tokenize.length-1](stream, state), kwtype; - var thisTok = curPunc; - if (style == "ident") { - var word = stream.current(); - style = state.lastTok == "." ? "property" - : keywords.propertyIsEnumerable(stream.current()) ? "keyword" - : /^[A-Z]/.test(word) ? "tag" - : (state.lastTok == "def" || state.lastTok == "class" || state.varList) ? "def" - : "variable"; - if (style == "keyword") { - thisTok = word; - if (indentWords.propertyIsEnumerable(word)) kwtype = "indent"; - else if (dedentWords.propertyIsEnumerable(word)) kwtype = "dedent"; - else if ((word == "if" || word == "unless") && stream.column() == stream.indentation()) - kwtype = "indent"; - else if (word == "do" && state.context.indented < state.indented) - kwtype = "indent"; - } - } - if (curPunc || (style && style != "comment")) state.lastTok = thisTok; - if (curPunc == "|") state.varList = !state.varList; - - if (kwtype == "indent" || /[\(\[\{]/.test(curPunc)) - state.context = {prev: state.context, type: curPunc || style, indented: state.indented}; - else if ((kwtype == "dedent" || /[\)\]\}]/.test(curPunc)) && state.context.prev) - state.context = state.context.prev; - - if (stream.eol()) - state.continuedLine = (curPunc == "\\" || style == "operator"); - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize[state.tokenize.length-1] != tokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0); - var ct = state.context; - var closing = ct.type == matching[firstChar] || - ct.type == "keyword" && /^(?:end|until|else|elsif|when|rescue)\b/.test(textAfter); - return ct.indented + (closing ? 0 : config.indentUnit) + - (state.continuedLine ? config.indentUnit : 0); - }, - - electricChars: "}de", // enD and rescuE - lineComment: "#" - }; -}); - -CodeMirror.defineMIME("text/x-ruby", "ruby"); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/ruby/test.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/ruby/test.js deleted file mode 100644 index cade864..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/ruby/test.js +++ /dev/null @@ -1,14 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({indentUnit: 2}, "ruby"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - MT("divide_equal_operator", - "[variable bar] [operator /=] [variable foo]"); - - MT("divide_equal_operator_no_spacing", - "[variable foo][operator /=][number 42]"); - -})(); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/rust/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/rust/index.html deleted file mode 100644 index 407e84f..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/rust/index.html +++ /dev/null @@ -1,60 +0,0 @@ - - -CodeMirror: Rust mode - - - - - - - - - -
        -

        Rust mode

        - - -
        - - - -

        MIME types defined: text/x-rustsrc.

        -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/rust/rust.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/rust/rust.js deleted file mode 100644 index 2bffa9a..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/rust/rust.js +++ /dev/null @@ -1,451 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("rust", function() { - var indentUnit = 4, altIndentUnit = 2; - var valKeywords = { - "if": "if-style", "while": "if-style", "loop": "else-style", "else": "else-style", - "do": "else-style", "ret": "else-style", "fail": "else-style", - "break": "atom", "cont": "atom", "const": "let", "resource": "fn", - "let": "let", "fn": "fn", "for": "for", "alt": "alt", "iface": "iface", - "impl": "impl", "type": "type", "enum": "enum", "mod": "mod", - "as": "op", "true": "atom", "false": "atom", "assert": "op", "check": "op", - "claim": "op", "native": "ignore", "unsafe": "ignore", "import": "else-style", - "export": "else-style", "copy": "op", "log": "op", "log_err": "op", - "use": "op", "bind": "op", "self": "atom", "struct": "enum" - }; - var typeKeywords = function() { - var keywords = {"fn": "fn", "block": "fn", "obj": "obj"}; - var atoms = "bool uint int i8 i16 i32 i64 u8 u16 u32 u64 float f32 f64 str char".split(" "); - for (var i = 0, e = atoms.length; i < e; ++i) keywords[atoms[i]] = "atom"; - return keywords; - }(); - var operatorChar = /[+\-*&%=<>!?|\.@]/; - - // Tokenizer - - // Used as scratch variable to communicate multiple values without - // consing up tons of objects. - var tcat, content; - function r(tc, style) { - tcat = tc; - return style; - } - - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"') { - state.tokenize = tokenString; - return state.tokenize(stream, state); - } - if (ch == "'") { - tcat = "atom"; - if (stream.eat("\\")) { - if (stream.skipTo("'")) { stream.next(); return "string"; } - else { return "error"; } - } else { - stream.next(); - return stream.eat("'") ? "string" : "error"; - } - } - if (ch == "/") { - if (stream.eat("/")) { stream.skipToEnd(); return "comment"; } - if (stream.eat("*")) { - state.tokenize = tokenComment(1); - return state.tokenize(stream, state); - } - } - if (ch == "#") { - if (stream.eat("[")) { tcat = "open-attr"; return null; } - stream.eatWhile(/\w/); - return r("macro", "meta"); - } - if (ch == ":" && stream.match(":<")) { - return r("op", null); - } - if (ch.match(/\d/) || (ch == "." && stream.eat(/\d/))) { - var flp = false; - if (!stream.match(/^x[\da-f]+/i) && !stream.match(/^b[01]+/)) { - stream.eatWhile(/\d/); - if (stream.eat(".")) { flp = true; stream.eatWhile(/\d/); } - if (stream.match(/^e[+\-]?\d+/i)) { flp = true; } - } - if (flp) stream.match(/^f(?:32|64)/); - else stream.match(/^[ui](?:8|16|32|64)/); - return r("atom", "number"); - } - if (ch.match(/[()\[\]{}:;,]/)) return r(ch, null); - if (ch == "-" && stream.eat(">")) return r("->", null); - if (ch.match(operatorChar)) { - stream.eatWhile(operatorChar); - return r("op", null); - } - stream.eatWhile(/\w/); - content = stream.current(); - if (stream.match(/^::\w/)) { - stream.backUp(1); - return r("prefix", "variable-2"); - } - if (state.keywords.propertyIsEnumerable(content)) - return r(state.keywords[content], content.match(/true|false/) ? "atom" : "keyword"); - return r("name", "variable"); - } - - function tokenString(stream, state) { - var ch, escaped = false; - while (ch = stream.next()) { - if (ch == '"' && !escaped) { - state.tokenize = tokenBase; - return r("atom", "string"); - } - escaped = !escaped && ch == "\\"; - } - // Hack to not confuse the parser when a string is split in - // pieces. - return r("op", "string"); - } - - function tokenComment(depth) { - return function(stream, state) { - var lastCh = null, ch; - while (ch = stream.next()) { - if (ch == "/" && lastCh == "*") { - if (depth == 1) { - state.tokenize = tokenBase; - break; - } else { - state.tokenize = tokenComment(depth - 1); - return state.tokenize(stream, state); - } - } - if (ch == "*" && lastCh == "/") { - state.tokenize = tokenComment(depth + 1); - return state.tokenize(stream, state); - } - lastCh = ch; - } - return "comment"; - }; - } - - // Parser - - var cx = {state: null, stream: null, marked: null, cc: null}; - function pass() { - for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); - } - function cont() { - pass.apply(null, arguments); - return true; - } - - function pushlex(type, info) { - var result = function() { - var state = cx.state; - state.lexical = {indented: state.indented, column: cx.stream.column(), - type: type, prev: state.lexical, info: info}; - }; - result.lex = true; - return result; - } - function poplex() { - var state = cx.state; - if (state.lexical.prev) { - if (state.lexical.type == ")") - state.indented = state.lexical.indented; - state.lexical = state.lexical.prev; - } - } - function typecx() { cx.state.keywords = typeKeywords; } - function valcx() { cx.state.keywords = valKeywords; } - poplex.lex = typecx.lex = valcx.lex = true; - - function commasep(comb, end) { - function more(type) { - if (type == ",") return cont(comb, more); - if (type == end) return cont(); - return cont(more); - } - return function(type) { - if (type == end) return cont(); - return pass(comb, more); - }; - } - - function stat_of(comb, tag) { - return cont(pushlex("stat", tag), comb, poplex, block); - } - function block(type) { - if (type == "}") return cont(); - if (type == "let") return stat_of(letdef1, "let"); - if (type == "fn") return stat_of(fndef); - if (type == "type") return cont(pushlex("stat"), tydef, endstatement, poplex, block); - if (type == "enum") return stat_of(enumdef); - if (type == "mod") return stat_of(mod); - if (type == "iface") return stat_of(iface); - if (type == "impl") return stat_of(impl); - if (type == "open-attr") return cont(pushlex("]"), commasep(expression, "]"), poplex); - if (type == "ignore" || type.match(/[\]\);,]/)) return cont(block); - return pass(pushlex("stat"), expression, poplex, endstatement, block); - } - function endstatement(type) { - if (type == ";") return cont(); - return pass(); - } - function expression(type) { - if (type == "atom" || type == "name") return cont(maybeop); - if (type == "{") return cont(pushlex("}"), exprbrace, poplex); - if (type.match(/[\[\(]/)) return matchBrackets(type, expression); - if (type.match(/[\]\)\};,]/)) return pass(); - if (type == "if-style") return cont(expression, expression); - if (type == "else-style" || type == "op") return cont(expression); - if (type == "for") return cont(pattern, maybetype, inop, expression, expression); - if (type == "alt") return cont(expression, altbody); - if (type == "fn") return cont(fndef); - if (type == "macro") return cont(macro); - return cont(); - } - function maybeop(type) { - if (content == ".") return cont(maybeprop); - if (content == "::<"){return cont(typarams, maybeop);} - if (type == "op" || content == ":") return cont(expression); - if (type == "(" || type == "[") return matchBrackets(type, expression); - return pass(); - } - function maybeprop() { - if (content.match(/^\w+$/)) {cx.marked = "variable"; return cont(maybeop);} - return pass(expression); - } - function exprbrace(type) { - if (type == "op") { - if (content == "|") return cont(blockvars, poplex, pushlex("}", "block"), block); - if (content == "||") return cont(poplex, pushlex("}", "block"), block); - } - if (content == "mutable" || (content.match(/^\w+$/) && cx.stream.peek() == ":" - && !cx.stream.match("::", false))) - return pass(record_of(expression)); - return pass(block); - } - function record_of(comb) { - function ro(type) { - if (content == "mutable" || content == "with") {cx.marked = "keyword"; return cont(ro);} - if (content.match(/^\w*$/)) {cx.marked = "variable"; return cont(ro);} - if (type == ":") return cont(comb, ro); - if (type == "}") return cont(); - return cont(ro); - } - return ro; - } - function blockvars(type) { - if (type == "name") {cx.marked = "def"; return cont(blockvars);} - if (type == "op" && content == "|") return cont(); - return cont(blockvars); - } - - function letdef1(type) { - if (type.match(/[\]\)\};]/)) return cont(); - if (content == "=") return cont(expression, letdef2); - if (type == ",") return cont(letdef1); - return pass(pattern, maybetype, letdef1); - } - function letdef2(type) { - if (type.match(/[\]\)\};,]/)) return pass(letdef1); - else return pass(expression, letdef2); - } - function maybetype(type) { - if (type == ":") return cont(typecx, rtype, valcx); - return pass(); - } - function inop(type) { - if (type == "name" && content == "in") {cx.marked = "keyword"; return cont();} - return pass(); - } - function fndef(type) { - if (content == "@" || content == "~") {cx.marked = "keyword"; return cont(fndef);} - if (type == "name") {cx.marked = "def"; return cont(fndef);} - if (content == "<") return cont(typarams, fndef); - if (type == "{") return pass(expression); - if (type == "(") return cont(pushlex(")"), commasep(argdef, ")"), poplex, fndef); - if (type == "->") return cont(typecx, rtype, valcx, fndef); - if (type == ";") return cont(); - return cont(fndef); - } - function tydef(type) { - if (type == "name") {cx.marked = "def"; return cont(tydef);} - if (content == "<") return cont(typarams, tydef); - if (content == "=") return cont(typecx, rtype, valcx); - return cont(tydef); - } - function enumdef(type) { - if (type == "name") {cx.marked = "def"; return cont(enumdef);} - if (content == "<") return cont(typarams, enumdef); - if (content == "=") return cont(typecx, rtype, valcx, endstatement); - if (type == "{") return cont(pushlex("}"), typecx, enumblock, valcx, poplex); - return cont(enumdef); - } - function enumblock(type) { - if (type == "}") return cont(); - if (type == "(") return cont(pushlex(")"), commasep(rtype, ")"), poplex, enumblock); - if (content.match(/^\w+$/)) cx.marked = "def"; - return cont(enumblock); - } - function mod(type) { - if (type == "name") {cx.marked = "def"; return cont(mod);} - if (type == "{") return cont(pushlex("}"), block, poplex); - return pass(); - } - function iface(type) { - if (type == "name") {cx.marked = "def"; return cont(iface);} - if (content == "<") return cont(typarams, iface); - if (type == "{") return cont(pushlex("}"), block, poplex); - return pass(); - } - function impl(type) { - if (content == "<") return cont(typarams, impl); - if (content == "of" || content == "for") {cx.marked = "keyword"; return cont(rtype, impl);} - if (type == "name") {cx.marked = "def"; return cont(impl);} - if (type == "{") return cont(pushlex("}"), block, poplex); - return pass(); - } - function typarams() { - if (content == ">") return cont(); - if (content == ",") return cont(typarams); - if (content == ":") return cont(rtype, typarams); - return pass(rtype, typarams); - } - function argdef(type) { - if (type == "name") {cx.marked = "def"; return cont(argdef);} - if (type == ":") return cont(typecx, rtype, valcx); - return pass(); - } - function rtype(type) { - if (type == "name") {cx.marked = "variable-3"; return cont(rtypemaybeparam); } - if (content == "mutable") {cx.marked = "keyword"; return cont(rtype);} - if (type == "atom") return cont(rtypemaybeparam); - if (type == "op" || type == "obj") return cont(rtype); - if (type == "fn") return cont(fntype); - if (type == "{") return cont(pushlex("{"), record_of(rtype), poplex); - return matchBrackets(type, rtype); - } - function rtypemaybeparam() { - if (content == "<") return cont(typarams); - return pass(); - } - function fntype(type) { - if (type == "(") return cont(pushlex("("), commasep(rtype, ")"), poplex, fntype); - if (type == "->") return cont(rtype); - return pass(); - } - function pattern(type) { - if (type == "name") {cx.marked = "def"; return cont(patternmaybeop);} - if (type == "atom") return cont(patternmaybeop); - if (type == "op") return cont(pattern); - if (type.match(/[\]\)\};,]/)) return pass(); - return matchBrackets(type, pattern); - } - function patternmaybeop(type) { - if (type == "op" && content == ".") return cont(); - if (content == "to") {cx.marked = "keyword"; return cont(pattern);} - else return pass(); - } - function altbody(type) { - if (type == "{") return cont(pushlex("}", "alt"), altblock1, poplex); - return pass(); - } - function altblock1(type) { - if (type == "}") return cont(); - if (type == "|") return cont(altblock1); - if (content == "when") {cx.marked = "keyword"; return cont(expression, altblock2);} - if (type.match(/[\]\);,]/)) return cont(altblock1); - return pass(pattern, altblock2); - } - function altblock2(type) { - if (type == "{") return cont(pushlex("}", "alt"), block, poplex, altblock1); - else return pass(altblock1); - } - - function macro(type) { - if (type.match(/[\[\(\{]/)) return matchBrackets(type, expression); - return pass(); - } - function matchBrackets(type, comb) { - if (type == "[") return cont(pushlex("]"), commasep(comb, "]"), poplex); - if (type == "(") return cont(pushlex(")"), commasep(comb, ")"), poplex); - if (type == "{") return cont(pushlex("}"), commasep(comb, "}"), poplex); - return cont(); - } - - function parse(state, stream, style) { - var cc = state.cc; - // Communicate our context to the combinators. - // (Less wasteful than consing up a hundred closures on every call.) - cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; - - while (true) { - var combinator = cc.length ? cc.pop() : block; - if (combinator(tcat)) { - while(cc.length && cc[cc.length - 1].lex) - cc.pop()(); - return cx.marked || style; - } - } - } - - return { - startState: function() { - return { - tokenize: tokenBase, - cc: [], - lexical: {indented: -indentUnit, column: 0, type: "top", align: false}, - keywords: valKeywords, - indented: 0 - }; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (!state.lexical.hasOwnProperty("align")) - state.lexical.align = false; - state.indented = stream.indentation(); - } - if (stream.eatSpace()) return null; - tcat = content = null; - var style = state.tokenize(stream, state); - if (style == "comment") return style; - if (!state.lexical.hasOwnProperty("align")) - state.lexical.align = true; - if (tcat == "prefix") return style; - if (!content) content = stream.current(); - return parse(state, stream, style); - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, - type = lexical.type, closing = firstChar == type; - if (type == "stat") return lexical.indented + indentUnit; - if (lexical.align) return lexical.column + (closing ? 0 : 1); - return lexical.indented + (closing ? 0 : (lexical.info == "alt" ? altIndentUnit : indentUnit)); - }, - - electricChars: "{}", - blockCommentStart: "/*", - blockCommentEnd: "*/", - lineComment: "//", - fold: "brace" - }; -}); - -CodeMirror.defineMIME("text/x-rustsrc", "rust"); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/sass/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/sass/index.html deleted file mode 100644 index 9f4a790..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/sass/index.html +++ /dev/null @@ -1,66 +0,0 @@ - - -CodeMirror: Sass mode - - - - - - - - - - -
        -

        Sass mode

        -
        - - -

        MIME types defined: text/x-sass.

        -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/sass/sass.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/sass/sass.js deleted file mode 100644 index 52a6682..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/sass/sass.js +++ /dev/null @@ -1,414 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("sass", function(config) { - function tokenRegexp(words) { - return new RegExp("^" + words.join("|")); - } - - var keywords = ["true", "false", "null", "auto"]; - var keywordsRegexp = new RegExp("^" + keywords.join("|")); - - var operators = ["\\(", "\\)", "=", ">", "<", "==", ">=", "<=", "\\+", "-", - "\\!=", "/", "\\*", "%", "and", "or", "not", ";","\\{","\\}",":"]; - var opRegexp = tokenRegexp(operators); - - var pseudoElementsRegexp = /^::?[a-zA-Z_][\w\-]*/; - - function urlTokens(stream, state) { - var ch = stream.peek(); - - if (ch === ")") { - stream.next(); - state.tokenizer = tokenBase; - return "operator"; - } else if (ch === "(") { - stream.next(); - stream.eatSpace(); - - return "operator"; - } else if (ch === "'" || ch === '"') { - state.tokenizer = buildStringTokenizer(stream.next()); - return "string"; - } else { - state.tokenizer = buildStringTokenizer(")", false); - return "string"; - } - } - function comment(indentation, multiLine) { - return function(stream, state) { - if (stream.sol() && stream.indentation() <= indentation) { - state.tokenizer = tokenBase; - return tokenBase(stream, state); - } - - if (multiLine && stream.skipTo("*/")) { - stream.next(); - stream.next(); - state.tokenizer = tokenBase; - } else { - stream.skipToEnd(); - } - - return "comment"; - }; - } - - function buildStringTokenizer(quote, greedy) { - if (greedy == null) { greedy = true; } - - function stringTokenizer(stream, state) { - var nextChar = stream.next(); - var peekChar = stream.peek(); - var previousChar = stream.string.charAt(stream.pos-2); - - var endingString = ((nextChar !== "\\" && peekChar === quote) || (nextChar === quote && previousChar !== "\\")); - - if (endingString) { - if (nextChar !== quote && greedy) { stream.next(); } - state.tokenizer = tokenBase; - return "string"; - } else if (nextChar === "#" && peekChar === "{") { - state.tokenizer = buildInterpolationTokenizer(stringTokenizer); - stream.next(); - return "operator"; - } else { - return "string"; - } - } - - return stringTokenizer; - } - - function buildInterpolationTokenizer(currentTokenizer) { - return function(stream, state) { - if (stream.peek() === "}") { - stream.next(); - state.tokenizer = currentTokenizer; - return "operator"; - } else { - return tokenBase(stream, state); - } - }; - } - - function indent(state) { - if (state.indentCount == 0) { - state.indentCount++; - var lastScopeOffset = state.scopes[0].offset; - var currentOffset = lastScopeOffset + config.indentUnit; - state.scopes.unshift({ offset:currentOffset }); - } - } - - function dedent(state) { - if (state.scopes.length == 1) return; - - state.scopes.shift(); - } - - function tokenBase(stream, state) { - var ch = stream.peek(); - - // Comment - if (stream.match("/*")) { - state.tokenizer = comment(stream.indentation(), true); - return state.tokenizer(stream, state); - } - if (stream.match("//")) { - state.tokenizer = comment(stream.indentation(), false); - return state.tokenizer(stream, state); - } - - // Interpolation - if (stream.match("#{")) { - state.tokenizer = buildInterpolationTokenizer(tokenBase); - return "operator"; - } - - // Strings - if (ch === '"' || ch === "'") { - stream.next(); - state.tokenizer = buildStringTokenizer(ch); - return "string"; - } - - if(!state.cursorHalf){// state.cursorHalf === 0 - // first half i.e. before : for key-value pairs - // including selectors - - if (ch === ".") { - stream.next(); - if (stream.match(/^[\w-]+/)) { - indent(state); - return "atom"; - } else if (stream.peek() === "#") { - indent(state); - return "atom"; - } - } - - if (ch === "#") { - stream.next(); - // ID selectors - if (stream.match(/^[\w-]+/)) { - indent(state); - return "atom"; - } - if (stream.peek() === "#") { - indent(state); - return "atom"; - } - } - - // Variables - if (ch === "$") { - stream.next(); - stream.eatWhile(/[\w-]/); - return "variable-2"; - } - - // Numbers - if (stream.match(/^-?[0-9\.]+/)) - return "number"; - - // Units - if (stream.match(/^(px|em|in)\b/)) - return "unit"; - - if (stream.match(keywordsRegexp)) - return "keyword"; - - if (stream.match(/^url/) && stream.peek() === "(") { - state.tokenizer = urlTokens; - return "atom"; - } - - if (ch === "=") { - // Match shortcut mixin definition - if (stream.match(/^=[\w-]+/)) { - indent(state); - return "meta"; - } - } - - if (ch === "+") { - // Match shortcut mixin definition - if (stream.match(/^\+[\w-]+/)){ - return "variable-3"; - } - } - - if(ch === "@"){ - if(stream.match(/@extend/)){ - if(!stream.match(/\s*[\w]/)) - dedent(state); - } - } - - - // Indent Directives - if (stream.match(/^@(else if|if|media|else|for|each|while|mixin|function)/)) { - indent(state); - return "meta"; - } - - // Other Directives - if (ch === "@") { - stream.next(); - stream.eatWhile(/[\w-]/); - return "meta"; - } - - if (stream.eatWhile(/[\w-]/)){ - if(stream.match(/ *: *[\w-\+\$#!\("']/,false)){ - return "propery"; - } - else if(stream.match(/ *:/,false)){ - indent(state); - state.cursorHalf = 1; - return "atom"; - } - else if(stream.match(/ *,/,false)){ - return "atom"; - } - else{ - indent(state); - return "atom"; - } - } - - if(ch === ":"){ - if (stream.match(pseudoElementsRegexp)){ // could be a pseudo-element - return "keyword"; - } - stream.next(); - state.cursorHalf=1; - return "operator"; - } - - } // cursorHalf===0 ends here - else{ - - if (ch === "#") { - stream.next(); - // Hex numbers - if (stream.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)){ - if(!stream.peek()){ - state.cursorHalf = 0; - } - return "number"; - } - } - - // Numbers - if (stream.match(/^-?[0-9\.]+/)){ - if(!stream.peek()){ - state.cursorHalf = 0; - } - return "number"; - } - - // Units - if (stream.match(/^(px|em|in)\b/)){ - if(!stream.peek()){ - state.cursorHalf = 0; - } - return "unit"; - } - - if (stream.match(keywordsRegexp)){ - if(!stream.peek()){ - state.cursorHalf = 0; - } - return "keyword"; - } - - if (stream.match(/^url/) && stream.peek() === "(") { - state.tokenizer = urlTokens; - if(!stream.peek()){ - state.cursorHalf = 0; - } - return "atom"; - } - - // Variables - if (ch === "$") { - stream.next(); - stream.eatWhile(/[\w-]/); - if(!stream.peek()){ - state.cursorHalf = 0; - } - return "variable-3"; - } - - // bang character for !important, !default, etc. - if (ch === "!") { - stream.next(); - if(!stream.peek()){ - state.cursorHalf = 0; - } - return stream.match(/^[\w]+/) ? "keyword": "operator"; - } - - if (stream.match(opRegexp)){ - if(!stream.peek()){ - state.cursorHalf = 0; - } - return "operator"; - } - - // attributes - if (stream.eatWhile(/[\w-]/)) { - if(!stream.peek()){ - state.cursorHalf = 0; - } - return "attribute"; - } - - //stream.eatSpace(); - if(!stream.peek()){ - state.cursorHalf = 0; - return null; - } - - } // else ends here - - if (stream.match(opRegexp)) - return "operator"; - - // If we haven't returned by now, we move 1 character - // and return an error - stream.next(); - return null; - } - - function tokenLexer(stream, state) { - if (stream.sol()) state.indentCount = 0; - var style = state.tokenizer(stream, state); - var current = stream.current(); - - if (current === "@return" || current === "}"){ - dedent(state); - } - - if (style !== null) { - var startOfToken = stream.pos - current.length; - - var withCurrentIndent = startOfToken + (config.indentUnit * state.indentCount); - - var newScopes = []; - - for (var i = 0; i < state.scopes.length; i++) { - var scope = state.scopes[i]; - - if (scope.offset <= withCurrentIndent) - newScopes.push(scope); - } - - state.scopes = newScopes; - } - - - return style; - } - - return { - startState: function() { - return { - tokenizer: tokenBase, - scopes: [{offset: 0, type: "sass"}], - indentCount: 0, - cursorHalf: 0, // cursor half tells us if cursor lies after (1) - // or before (0) colon (well... more or less) - definedVars: [], - definedMixins: [] - }; - }, - token: function(stream, state) { - var style = tokenLexer(stream, state); - - state.lastToken = { style: style, content: stream.current() }; - - return style; - }, - - indent: function(state) { - return state.scopes[0].offset; - } - }; -}); - -CodeMirror.defineMIME("text/x-sass", "sass"); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/scheme/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/scheme/index.html deleted file mode 100644 index 04d5c6a..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/scheme/index.html +++ /dev/null @@ -1,77 +0,0 @@ - - -CodeMirror: Scheme mode - - - - - - - - - -
        -

        Scheme mode

        -
        - - -

        MIME types defined: text/x-scheme.

        - -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/scheme/scheme.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/scheme/scheme.js deleted file mode 100644 index 979edc0..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/scheme/scheme.js +++ /dev/null @@ -1,248 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/** - * Author: Koh Zi Han, based on implementation by Koh Zi Chun - */ - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("scheme", function () { - var BUILTIN = "builtin", COMMENT = "comment", STRING = "string", - ATOM = "atom", NUMBER = "number", BRACKET = "bracket"; - var INDENT_WORD_SKIP = 2; - - function makeKeywords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - var keywords = makeKeywords("λ case-lambda call/cc class define-class exit-handler field import inherit init-field interface let*-values let-values let/ec mixin opt-lambda override protect provide public rename require require-for-syntax syntax syntax-case syntax-error unit/sig unless when with-syntax and begin call-with-current-continuation call-with-input-file call-with-output-file case cond define define-syntax delay do dynamic-wind else for-each if lambda let let* let-syntax letrec letrec-syntax map or syntax-rules abs acos angle append apply asin assoc assq assv atan boolean? caar cadr call-with-input-file call-with-output-file call-with-values car cdddar cddddr cdr ceiling char->integer char-alphabetic? char-ci<=? char-ci=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt #f floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string=? string>? string? substring symbol->string symbol? #t tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"); - var indentKeys = makeKeywords("define let letrec let* lambda"); - - function stateStack(indent, type, prev) { // represents a state stack object - this.indent = indent; - this.type = type; - this.prev = prev; - } - - function pushStack(state, indent, type) { - state.indentStack = new stateStack(indent, type, state.indentStack); - } - - function popStack(state) { - state.indentStack = state.indentStack.prev; - } - - var binaryMatcher = new RegExp(/^(?:[-+]i|[-+][01]+#*(?:\/[01]+#*)?i|[-+]?[01]+#*(?:\/[01]+#*)?@[-+]?[01]+#*(?:\/[01]+#*)?|[-+]?[01]+#*(?:\/[01]+#*)?[-+](?:[01]+#*(?:\/[01]+#*)?)?i|[-+]?[01]+#*(?:\/[01]+#*)?)(?=[()\s;"]|$)/i); - var octalMatcher = new RegExp(/^(?:[-+]i|[-+][0-7]+#*(?:\/[0-7]+#*)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?@[-+]?[0-7]+#*(?:\/[0-7]+#*)?|[-+]?[0-7]+#*(?:\/[0-7]+#*)?[-+](?:[0-7]+#*(?:\/[0-7]+#*)?)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?)(?=[()\s;"]|$)/i); - var hexMatcher = new RegExp(/^(?:[-+]i|[-+][\da-f]+#*(?:\/[\da-f]+#*)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?@[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?[-+](?:[\da-f]+#*(?:\/[\da-f]+#*)?)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?)(?=[()\s;"]|$)/i); - var decimalMatcher = new RegExp(/^(?:[-+]i|[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)i|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)@[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)?i|(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*))(?=[()\s;"]|$)/i); - - function isBinaryNumber (stream) { - return stream.match(binaryMatcher); - } - - function isOctalNumber (stream) { - return stream.match(octalMatcher); - } - - function isDecimalNumber (stream, backup) { - if (backup === true) { - stream.backUp(1); - } - return stream.match(decimalMatcher); - } - - function isHexNumber (stream) { - return stream.match(hexMatcher); - } - - return { - startState: function () { - return { - indentStack: null, - indentation: 0, - mode: false, - sExprComment: false - }; - }, - - token: function (stream, state) { - if (state.indentStack == null && stream.sol()) { - // update indentation, but only if indentStack is empty - state.indentation = stream.indentation(); - } - - // skip spaces - if (stream.eatSpace()) { - return null; - } - var returnType = null; - - switch(state.mode){ - case "string": // multi-line string parsing mode - var next, escaped = false; - while ((next = stream.next()) != null) { - if (next == "\"" && !escaped) { - - state.mode = false; - break; - } - escaped = !escaped && next == "\\"; - } - returnType = STRING; // continue on in scheme-string mode - break; - case "comment": // comment parsing mode - var next, maybeEnd = false; - while ((next = stream.next()) != null) { - if (next == "#" && maybeEnd) { - - state.mode = false; - break; - } - maybeEnd = (next == "|"); - } - returnType = COMMENT; - break; - case "s-expr-comment": // s-expr commenting mode - state.mode = false; - if(stream.peek() == "(" || stream.peek() == "["){ - // actually start scheme s-expr commenting mode - state.sExprComment = 0; - }else{ - // if not we just comment the entire of the next token - stream.eatWhile(/[^/s]/); // eat non spaces - returnType = COMMENT; - break; - } - default: // default parsing mode - var ch = stream.next(); - - if (ch == "\"") { - state.mode = "string"; - returnType = STRING; - - } else if (ch == "'") { - returnType = ATOM; - } else if (ch == '#') { - if (stream.eat("|")) { // Multi-line comment - state.mode = "comment"; // toggle to comment mode - returnType = COMMENT; - } else if (stream.eat(/[tf]/i)) { // #t/#f (atom) - returnType = ATOM; - } else if (stream.eat(';')) { // S-Expr comment - state.mode = "s-expr-comment"; - returnType = COMMENT; - } else { - var numTest = null, hasExactness = false, hasRadix = true; - if (stream.eat(/[ei]/i)) { - hasExactness = true; - } else { - stream.backUp(1); // must be radix specifier - } - if (stream.match(/^#b/i)) { - numTest = isBinaryNumber; - } else if (stream.match(/^#o/i)) { - numTest = isOctalNumber; - } else if (stream.match(/^#x/i)) { - numTest = isHexNumber; - } else if (stream.match(/^#d/i)) { - numTest = isDecimalNumber; - } else if (stream.match(/^[-+0-9.]/, false)) { - hasRadix = false; - numTest = isDecimalNumber; - // re-consume the intial # if all matches failed - } else if (!hasExactness) { - stream.eat('#'); - } - if (numTest != null) { - if (hasRadix && !hasExactness) { - // consume optional exactness after radix - stream.match(/^#[ei]/i); - } - if (numTest(stream)) - returnType = NUMBER; - } - } - } else if (/^[-+0-9.]/.test(ch) && isDecimalNumber(stream, true)) { // match non-prefixed number, must be decimal - returnType = NUMBER; - } else if (ch == ";") { // comment - stream.skipToEnd(); // rest of the line is a comment - returnType = COMMENT; - } else if (ch == "(" || ch == "[") { - var keyWord = ''; var indentTemp = stream.column(), letter; - /** - Either - (indent-word .. - (non-indent-word .. - (;something else, bracket, etc. - */ - - while ((letter = stream.eat(/[^\s\(\[\;\)\]]/)) != null) { - keyWord += letter; - } - - if (keyWord.length > 0 && indentKeys.propertyIsEnumerable(keyWord)) { // indent-word - - pushStack(state, indentTemp + INDENT_WORD_SKIP, ch); - } else { // non-indent word - // we continue eating the spaces - stream.eatSpace(); - if (stream.eol() || stream.peek() == ";") { - // nothing significant after - // we restart indentation 1 space after - pushStack(state, indentTemp + 1, ch); - } else { - pushStack(state, indentTemp + stream.current().length, ch); // else we match - } - } - stream.backUp(stream.current().length - 1); // undo all the eating - - if(typeof state.sExprComment == "number") state.sExprComment++; - - returnType = BRACKET; - } else if (ch == ")" || ch == "]") { - returnType = BRACKET; - if (state.indentStack != null && state.indentStack.type == (ch == ")" ? "(" : "[")) { - popStack(state); - - if(typeof state.sExprComment == "number"){ - if(--state.sExprComment == 0){ - returnType = COMMENT; // final closing bracket - state.sExprComment = false; // turn off s-expr commenting mode - } - } - } - } else { - stream.eatWhile(/[\w\$_\-!$%&*+\.\/:<=>?@\^~]/); - - if (keywords && keywords.propertyIsEnumerable(stream.current())) { - returnType = BUILTIN; - } else returnType = "variable"; - } - } - return (typeof state.sExprComment == "number") ? COMMENT : returnType; - }, - - indent: function (state) { - if (state.indentStack == null) return state.indentation; - return state.indentStack.indent; - }, - - lineComment: ";;" - }; -}); - -CodeMirror.defineMIME("text/x-scheme", "scheme"); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/shell/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/shell/index.html deleted file mode 100644 index 0b56300..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/shell/index.html +++ /dev/null @@ -1,66 +0,0 @@ - - -CodeMirror: Shell mode - - - - - - - - - - -
        -

        Shell mode

        - - - - - - -

        MIME types defined: text/x-sh.

        -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/shell/shell.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/shell/shell.js deleted file mode 100644 index a684e8c..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/shell/shell.js +++ /dev/null @@ -1,139 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode('shell', function() { - - var words = {}; - function define(style, string) { - var split = string.split(' '); - for(var i = 0; i < split.length; i++) { - words[split[i]] = style; - } - }; - - // Atoms - define('atom', 'true false'); - - // Keywords - define('keyword', 'if then do else elif while until for in esac fi fin ' + - 'fil done exit set unset export function'); - - // Commands - define('builtin', 'ab awk bash beep cat cc cd chown chmod chroot clear cp ' + - 'curl cut diff echo find gawk gcc get git grep kill killall ln ls make ' + - 'mkdir openssl mv nc node npm ping ps restart rm rmdir sed service sh ' + - 'shopt shred source sort sleep ssh start stop su sudo tee telnet top ' + - 'touch vi vim wall wc wget who write yes zsh'); - - function tokenBase(stream, state) { - if (stream.eatSpace()) return null; - - var sol = stream.sol(); - var ch = stream.next(); - - if (ch === '\\') { - stream.next(); - return null; - } - if (ch === '\'' || ch === '"' || ch === '`') { - state.tokens.unshift(tokenString(ch)); - return tokenize(stream, state); - } - if (ch === '#') { - if (sol && stream.eat('!')) { - stream.skipToEnd(); - return 'meta'; // 'comment'? - } - stream.skipToEnd(); - return 'comment'; - } - if (ch === '$') { - state.tokens.unshift(tokenDollar); - return tokenize(stream, state); - } - if (ch === '+' || ch === '=') { - return 'operator'; - } - if (ch === '-') { - stream.eat('-'); - stream.eatWhile(/\w/); - return 'attribute'; - } - if (/\d/.test(ch)) { - stream.eatWhile(/\d/); - if(stream.eol() || !/\w/.test(stream.peek())) { - return 'number'; - } - } - stream.eatWhile(/[\w-]/); - var cur = stream.current(); - if (stream.peek() === '=' && /\w+/.test(cur)) return 'def'; - return words.hasOwnProperty(cur) ? words[cur] : null; - } - - function tokenString(quote) { - return function(stream, state) { - var next, end = false, escaped = false; - while ((next = stream.next()) != null) { - if (next === quote && !escaped) { - end = true; - break; - } - if (next === '$' && !escaped && quote !== '\'') { - escaped = true; - stream.backUp(1); - state.tokens.unshift(tokenDollar); - break; - } - escaped = !escaped && next === '\\'; - } - if (end || !escaped) { - state.tokens.shift(); - } - return (quote === '`' || quote === ')' ? 'quote' : 'string'); - }; - }; - - var tokenDollar = function(stream, state) { - if (state.tokens.length > 1) stream.eat('$'); - var ch = stream.next(), hungry = /\w/; - if (ch === '{') hungry = /[^}]/; - if (ch === '(') { - state.tokens[0] = tokenString(')'); - return tokenize(stream, state); - } - if (!/\d/.test(ch)) { - stream.eatWhile(hungry); - stream.eat('}'); - } - state.tokens.shift(); - return 'def'; - }; - - function tokenize(stream, state) { - return (state.tokens[0] || tokenBase) (stream, state); - }; - - return { - startState: function() {return {tokens:[]};}, - token: function(stream, state) { - return tokenize(stream, state); - }, - lineComment: '#', - fold: "brace" - }; -}); - -CodeMirror.defineMIME('text/x-sh', 'shell'); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/shell/test.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/shell/test.js deleted file mode 100644 index a413b5a..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/shell/test.js +++ /dev/null @@ -1,58 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({}, "shell"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - MT("var", - "text [def $var] text"); - MT("varBraces", - "text[def ${var}]text"); - MT("varVar", - "text [def $a$b] text"); - MT("varBracesVarBraces", - "text[def ${a}${b}]text"); - - MT("singleQuotedVar", - "[string 'text $var text']"); - MT("singleQuotedVarBraces", - "[string 'text ${var} text']"); - - MT("doubleQuotedVar", - '[string "text ][def $var][string text"]'); - MT("doubleQuotedVarBraces", - '[string "text][def ${var}][string text"]'); - MT("doubleQuotedVarPunct", - '[string "text ][def $@][string text"]'); - MT("doubleQuotedVarVar", - '[string "][def $a$b][string "]'); - MT("doubleQuotedVarBracesVarBraces", - '[string "][def ${a}${b}][string "]'); - - MT("notAString", - "text\\'text"); - MT("escapes", - "outside\\'\\\"\\`\\\\[string \"inside\\`\\'\\\"\\\\`\\$notAVar\"]outside\\$\\(notASubShell\\)"); - - MT("subshell", - "[builtin echo] [quote $(whoami)] s log, stardate [quote `date`]."); - MT("doubleQuotedSubshell", - "[builtin echo] [string \"][quote $(whoami)][string 's log, stardate `date`.\"]"); - - MT("hashbang", - "[meta #!/bin/bash]"); - MT("comment", - "text [comment # Blurb]"); - - MT("numbers", - "[number 0] [number 1] [number 2]"); - MT("keywords", - "[keyword while] [atom true]; [keyword do]", - " [builtin sleep] [number 3]", - "[keyword done]"); - MT("options", - "[builtin ls] [attribute -l] [attribute --human-readable]"); - MT("operator", - "[def var][operator =]value"); -})(); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/sieve/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/sieve/index.html deleted file mode 100644 index 6f029b6..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/sieve/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - -CodeMirror: Sieve (RFC5228) mode - - - - - - - - - -
        -

        Sieve (RFC5228) mode

        -
        - - -

        MIME types defined: application/sieve.

        - -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/sieve/sieve.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/sieve/sieve.js deleted file mode 100644 index f67db2f..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/sieve/sieve.js +++ /dev/null @@ -1,193 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("sieve", function(config) { - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - var keywords = words("if elsif else stop require"); - var atoms = words("true false not"); - var indentUnit = config.indentUnit; - - function tokenBase(stream, state) { - - var ch = stream.next(); - if (ch == "/" && stream.eat("*")) { - state.tokenize = tokenCComment; - return tokenCComment(stream, state); - } - - if (ch === '#') { - stream.skipToEnd(); - return "comment"; - } - - if (ch == "\"") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - - if (ch == "(") { - state._indent.push("("); - // add virtual angel wings so that editor behaves... - // ...more sane incase of broken brackets - state._indent.push("{"); - return null; - } - - if (ch === "{") { - state._indent.push("{"); - return null; - } - - if (ch == ")") { - state._indent.pop(); - state._indent.pop(); - } - - if (ch === "}") { - state._indent.pop(); - return null; - } - - if (ch == ",") - return null; - - if (ch == ";") - return null; - - - if (/[{}\(\),;]/.test(ch)) - return null; - - // 1*DIGIT "K" / "M" / "G" - if (/\d/.test(ch)) { - stream.eatWhile(/[\d]/); - stream.eat(/[KkMmGg]/); - return "number"; - } - - // ":" (ALPHA / "_") *(ALPHA / DIGIT / "_") - if (ch == ":") { - stream.eatWhile(/[a-zA-Z_]/); - stream.eatWhile(/[a-zA-Z0-9_]/); - - return "operator"; - } - - stream.eatWhile(/\w/); - var cur = stream.current(); - - // "text:" *(SP / HTAB) (hash-comment / CRLF) - // *(multiline-literal / multiline-dotstart) - // "." CRLF - if ((cur == "text") && stream.eat(":")) - { - state.tokenize = tokenMultiLineString; - return "string"; - } - - if (keywords.propertyIsEnumerable(cur)) - return "keyword"; - - if (atoms.propertyIsEnumerable(cur)) - return "atom"; - - return null; - } - - function tokenMultiLineString(stream, state) - { - state._multiLineString = true; - // the first line is special it may contain a comment - if (!stream.sol()) { - stream.eatSpace(); - - if (stream.peek() == "#") { - stream.skipToEnd(); - return "comment"; - } - - stream.skipToEnd(); - return "string"; - } - - if ((stream.next() == ".") && (stream.eol())) - { - state._multiLineString = false; - state.tokenize = tokenBase; - } - - return "string"; - } - - function tokenCComment(stream, state) { - var maybeEnd = false, ch; - while ((ch = stream.next()) != null) { - if (maybeEnd && ch == "/") { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) - break; - escaped = !escaped && ch == "\\"; - } - if (!escaped) state.tokenize = tokenBase; - return "string"; - }; - } - - return { - startState: function(base) { - return {tokenize: tokenBase, - baseIndent: base || 0, - _indent: []}; - }, - - token: function(stream, state) { - if (stream.eatSpace()) - return null; - - return (state.tokenize || tokenBase)(stream, state);; - }, - - indent: function(state, _textAfter) { - var length = state._indent.length; - if (_textAfter && (_textAfter[0] == "}")) - length--; - - if (length <0) - length = 0; - - return length * indentUnit; - }, - - electricChars: "}" - }; -}); - -CodeMirror.defineMIME("application/sieve", "sieve"); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/slim/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/slim/index.html deleted file mode 100644 index 7fa4e50..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/slim/index.html +++ /dev/null @@ -1,96 +0,0 @@ - - -CodeMirror: SLIM mode - - - - - - - - - - - - - - - - - - - - -
        -

        SLIM mode

        -
        - - -

        MIME types defined: application/x-slim.

        - -

        - Parsing/Highlighting Tests: - normal, - verbose. -

        -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/slim/slim.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/slim/slim.js deleted file mode 100644 index 164464d..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/slim/slim.js +++ /dev/null @@ -1,575 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Slim Highlighting for CodeMirror copyright (c) HicknHack Software Gmbh - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), require("../ruby/ruby")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../htmlmixed/htmlmixed", "../ruby/ruby"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - - CodeMirror.defineMode("slim", function(config) { - var htmlMode = CodeMirror.getMode(config, {name: "htmlmixed"}); - var rubyMode = CodeMirror.getMode(config, "ruby"); - var modes = { html: htmlMode, ruby: rubyMode }; - var embedded = { - ruby: "ruby", - javascript: "javascript", - css: "text/css", - sass: "text/x-sass", - scss: "text/x-scss", - less: "text/x-less", - styl: "text/x-styl", // no highlighting so far - coffee: "coffeescript", - asciidoc: "text/x-asciidoc", - markdown: "text/x-markdown", - textile: "text/x-textile", // no highlighting so far - creole: "text/x-creole", // no highlighting so far - wiki: "text/x-wiki", // no highlighting so far - mediawiki: "text/x-mediawiki", // no highlighting so far - rdoc: "text/x-rdoc", // no highlighting so far - builder: "text/x-builder", // no highlighting so far - nokogiri: "text/x-nokogiri", // no highlighting so far - erb: "application/x-erb" - }; - var embeddedRegexp = function(map){ - var arr = []; - for(var key in map) arr.push(key); - return new RegExp("^("+arr.join('|')+"):"); - }(embedded); - - var styleMap = { - "commentLine": "comment", - "slimSwitch": "operator special", - "slimTag": "tag", - "slimId": "attribute def", - "slimClass": "attribute qualifier", - "slimAttribute": "attribute", - "slimSubmode": "keyword special", - "closeAttributeTag": null, - "slimDoctype": null, - "lineContinuation": null - }; - var closing = { - "{": "}", - "[": "]", - "(": ")" - }; - - var nameStartChar = "_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD"; - var nameChar = nameStartChar + "\\-0-9\xB7\u0300-\u036F\u203F-\u2040"; - var nameRegexp = new RegExp("^[:"+nameStartChar+"](?::["+nameChar+"]|["+nameChar+"]*)"); - var attributeNameRegexp = new RegExp("^[:"+nameStartChar+"][:\\."+nameChar+"]*(?=\\s*=)"); - var wrappedAttributeNameRegexp = new RegExp("^[:"+nameStartChar+"][:\\."+nameChar+"]*"); - var classNameRegexp = /^\.-?[_a-zA-Z]+[\w\-]*/; - var classIdRegexp = /^#[_a-zA-Z]+[\w\-]*/; - - function backup(pos, tokenize, style) { - var restore = function(stream, state) { - state.tokenize = tokenize; - if (stream.pos < pos) { - stream.pos = pos; - return style; - } - return state.tokenize(stream, state); - }; - return function(stream, state) { - state.tokenize = restore; - return tokenize(stream, state); - }; - } - - function maybeBackup(stream, state, pat, offset, style) { - var cur = stream.current(); - var idx = cur.search(pat); - if (idx > -1) { - state.tokenize = backup(stream.pos, state.tokenize, style); - stream.backUp(cur.length - idx - offset); - } - return style; - } - - function continueLine(state, column) { - state.stack = { - parent: state.stack, - style: "continuation", - indented: column, - tokenize: state.line - }; - state.line = state.tokenize; - } - function finishContinue(state) { - if (state.line == state.tokenize) { - state.line = state.stack.tokenize; - state.stack = state.stack.parent; - } - } - - function lineContinuable(column, tokenize) { - return function(stream, state) { - finishContinue(state); - if (stream.match(/^\\$/)) { - continueLine(state, column); - return "lineContinuation"; - } - var style = tokenize(stream, state); - if (stream.eol() && stream.current().match(/(?:^|[^\\])(?:\\\\)*\\$/)) { - stream.backUp(1); - } - return style; - }; - } - function commaContinuable(column, tokenize) { - return function(stream, state) { - finishContinue(state); - var style = tokenize(stream, state); - if (stream.eol() && stream.current().match(/,$/)) { - continueLine(state, column); - } - return style; - }; - } - - function rubyInQuote(endQuote, tokenize) { - // TODO: add multi line support - return function(stream, state) { - var ch = stream.peek(); - if (ch == endQuote && state.rubyState.tokenize.length == 1) { - // step out of ruby context as it seems to complete processing all the braces - stream.next(); - state.tokenize = tokenize; - return "closeAttributeTag"; - } else { - return ruby(stream, state); - } - }; - } - function startRubySplat(tokenize) { - var rubyState; - var runSplat = function(stream, state) { - if (state.rubyState.tokenize.length == 1 && !state.rubyState.context.prev) { - stream.backUp(1); - if (stream.eatSpace()) { - state.rubyState = rubyState; - state.tokenize = tokenize; - return tokenize(stream, state); - } - stream.next(); - } - return ruby(stream, state); - }; - return function(stream, state) { - rubyState = state.rubyState; - state.rubyState = rubyMode.startState(); - state.tokenize = runSplat; - return ruby(stream, state); - }; - } - - function ruby(stream, state) { - return rubyMode.token(stream, state.rubyState); - } - - function htmlLine(stream, state) { - if (stream.match(/^\\$/)) { - return "lineContinuation"; - } - return html(stream, state); - } - function html(stream, state) { - if (stream.match(/^#\{/)) { - state.tokenize = rubyInQuote("}", state.tokenize); - return null; - } - return maybeBackup(stream, state, /[^\\]#\{/, 1, htmlMode.token(stream, state.htmlState)); - } - - function startHtmlLine(lastTokenize) { - return function(stream, state) { - var style = htmlLine(stream, state); - if (stream.eol()) state.tokenize = lastTokenize; - return style; - }; - } - - function startHtmlMode(stream, state, offset) { - state.stack = { - parent: state.stack, - style: "html", - indented: stream.column() + offset, // pipe + space - tokenize: state.line - }; - state.line = state.tokenize = html; - return null; - } - - function comment(stream, state) { - stream.skipToEnd(); - return state.stack.style; - } - - function commentMode(stream, state) { - state.stack = { - parent: state.stack, - style: "comment", - indented: state.indented + 1, - tokenize: state.line - }; - state.line = comment; - return comment(stream, state); - } - - function attributeWrapper(stream, state) { - if (stream.eat(state.stack.endQuote)) { - state.line = state.stack.line; - state.tokenize = state.stack.tokenize; - state.stack = state.stack.parent; - return null; - } - if (stream.match(wrappedAttributeNameRegexp)) { - state.tokenize = attributeWrapperAssign; - return "slimAttribute"; - } - stream.next(); - return null; - } - function attributeWrapperAssign(stream, state) { - if (stream.match(/^==?/)) { - state.tokenize = attributeWrapperValue; - return null; - } - return attributeWrapper(stream, state); - } - function attributeWrapperValue(stream, state) { - var ch = stream.peek(); - if (ch == '"' || ch == "\'") { - state.tokenize = readQuoted(ch, "string", true, false, attributeWrapper); - stream.next(); - return state.tokenize(stream, state); - } - if (ch == '[') { - return startRubySplat(attributeWrapper)(stream, state); - } - if (stream.match(/^(true|false|nil)\b/)) { - state.tokenize = attributeWrapper; - return "keyword"; - } - return startRubySplat(attributeWrapper)(stream, state); - } - - function startAttributeWrapperMode(state, endQuote, tokenize) { - state.stack = { - parent: state.stack, - style: "wrapper", - indented: state.indented + 1, - tokenize: tokenize, - line: state.line, - endQuote: endQuote - }; - state.line = state.tokenize = attributeWrapper; - return null; - } - - function sub(stream, state) { - if (stream.match(/^#\{/)) { - state.tokenize = rubyInQuote("}", state.tokenize); - return null; - } - var subStream = new CodeMirror.StringStream(stream.string.slice(state.stack.indented), stream.tabSize); - subStream.pos = stream.pos - state.stack.indented; - subStream.start = stream.start - state.stack.indented; - subStream.lastColumnPos = stream.lastColumnPos - state.stack.indented; - subStream.lastColumnValue = stream.lastColumnValue - state.stack.indented; - var style = state.subMode.token(subStream, state.subState); - stream.pos = subStream.pos + state.stack.indented; - return style; - } - function firstSub(stream, state) { - state.stack.indented = stream.column(); - state.line = state.tokenize = sub; - return state.tokenize(stream, state); - } - - function createMode(mode) { - var query = embedded[mode]; - var spec = CodeMirror.mimeModes[query]; - if (spec) { - return CodeMirror.getMode(config, spec); - } - var factory = CodeMirror.modes[query]; - if (factory) { - return factory(config, {name: query}); - } - return CodeMirror.getMode(config, "null"); - } - - function getMode(mode) { - if (!modes.hasOwnProperty(mode)) { - return modes[mode] = createMode(mode); - } - return modes[mode]; - } - - function startSubMode(mode, state) { - var subMode = getMode(mode); - var subState = subMode.startState && subMode.startState(); - - state.subMode = subMode; - state.subState = subState; - - state.stack = { - parent: state.stack, - style: "sub", - indented: state.indented + 1, - tokenize: state.line - }; - state.line = state.tokenize = firstSub; - return "slimSubmode"; - } - - function doctypeLine(stream, _state) { - stream.skipToEnd(); - return "slimDoctype"; - } - - function startLine(stream, state) { - var ch = stream.peek(); - if (ch == '<') { - return (state.tokenize = startHtmlLine(state.tokenize))(stream, state); - } - if (stream.match(/^[|']/)) { - return startHtmlMode(stream, state, 1); - } - if (stream.match(/^\/(!|\[\w+])?/)) { - return commentMode(stream, state); - } - if (stream.match(/^(-|==?[<>]?)/)) { - state.tokenize = lineContinuable(stream.column(), commaContinuable(stream.column(), ruby)); - return "slimSwitch"; - } - if (stream.match(/^doctype\b/)) { - state.tokenize = doctypeLine; - return "keyword"; - } - - var m = stream.match(embeddedRegexp); - if (m) { - return startSubMode(m[1], state); - } - - return slimTag(stream, state); - } - - function slim(stream, state) { - if (state.startOfLine) { - return startLine(stream, state); - } - return slimTag(stream, state); - } - - function slimTag(stream, state) { - if (stream.eat('*')) { - state.tokenize = startRubySplat(slimTagExtras); - return null; - } - if (stream.match(nameRegexp)) { - state.tokenize = slimTagExtras; - return "slimTag"; - } - return slimClass(stream, state); - } - function slimTagExtras(stream, state) { - if (stream.match(/^(<>?|> state.indented && state.last != "slimSubmode") { - state.line = state.tokenize = state.stack.tokenize; - state.stack = state.stack.parent; - state.subMode = null; - state.subState = null; - } - } - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - state.startOfLine = false; - if (style) state.last = style; - return styleMap.hasOwnProperty(style) ? styleMap[style] : style; - }, - - blankLine: function(state) { - if (state.subMode && state.subMode.blankLine) { - return state.subMode.blankLine(state.subState); - } - }, - - innerMode: function(state) { - if (state.subMode) return {state: state.subState, mode: state.subMode}; - return {state: state, mode: mode}; - } - - //indent: function(state) { - // return state.indented; - //} - }; - return mode; - }, "htmlmixed", "ruby"); - - CodeMirror.defineMIME("text/x-slim", "slim"); - CodeMirror.defineMIME("application/x-slim", "slim"); -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/slim/test.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/slim/test.js deleted file mode 100644 index be4ddac..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/slim/test.js +++ /dev/null @@ -1,96 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Slim Highlighting for CodeMirror copyright (c) HicknHack Software Gmbh - -(function() { - var mode = CodeMirror.getMode({tabSize: 4, indentUnit: 2}, "slim"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - // Requires at least one media query - MT("elementName", - "[tag h1] Hey There"); - - MT("oneElementPerLine", - "[tag h1] Hey There .h2"); - - MT("idShortcut", - "[attribute&def #test] Hey There"); - - MT("tagWithIdShortcuts", - "[tag h1][attribute&def #test] Hey There"); - - MT("classShortcut", - "[attribute&qualifier .hello] Hey There"); - - MT("tagWithIdAndClassShortcuts", - "[tag h1][attribute&def #test][attribute&qualifier .hello] Hey There"); - - MT("docType", - "[keyword doctype] xml"); - - MT("comment", - "[comment / Hello WORLD]"); - - MT("notComment", - "[tag h1] This is not a / comment "); - - MT("attributes", - "[tag a]([attribute title]=[string \"test\"]) [attribute href]=[string \"link\"]}"); - - MT("multiLineAttributes", - "[tag a]([attribute title]=[string \"test\"]", - " ) [attribute href]=[string \"link\"]}"); - - MT("htmlCode", - "[tag&bracket <][tag h1][tag&bracket >]Title[tag&bracket ]"); - - MT("rubyBlock", - "[operator&special =][variable-2 @item]"); - - MT("selectorRubyBlock", - "[tag a][attribute&qualifier .test][operator&special =] [variable-2 @item]"); - - MT("nestedRubyBlock", - "[tag a]", - " [operator&special =][variable puts] [string \"test\"]"); - - MT("multilinePlaintext", - "[tag p]", - " | Hello,", - " World"); - - MT("multilineRuby", - "[tag p]", - " [comment /# this is a comment]", - " [comment and this is a comment too]", - " | Date/Time", - " [operator&special -] [variable now] [operator =] [tag DateTime][operator .][property now]", - " [tag strong][operator&special =] [variable now]", - " [operator&special -] [keyword if] [variable now] [operator >] [tag DateTime][operator .][property parse]([string \"December 31, 2006\"])", - " [operator&special =][string \"Happy\"]", - " [operator&special =][string \"Belated\"]", - " [operator&special =][string \"Birthday\"]"); - - MT("multilineComment", - "[comment /]", - " [comment Multiline]", - " [comment Comment]"); - - MT("hamlAfterRubyTag", - "[attribute&qualifier .block]", - " [tag strong][operator&special =] [variable now]", - " [attribute&qualifier .test]", - " [operator&special =][variable now]", - " [attribute&qualifier .right]"); - - MT("stretchedRuby", - "[operator&special =] [variable puts] [string \"Hello\"],", - " [string \"World\"]"); - - MT("interpolationInHashAttribute", - "[tag div]{[attribute id] = [string \"]#{[variable test]}[string _]#{[variable ting]}[string \"]} test"); - - MT("interpolationInHTMLAttribute", - "[tag div]([attribute title]=[string \"]#{[variable test]}[string _]#{[variable ting]()}[string \"]) Test"); -})(); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/smalltalk/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/smalltalk/index.html deleted file mode 100644 index 2155ebc..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/smalltalk/index.html +++ /dev/null @@ -1,68 +0,0 @@ - - -CodeMirror: Smalltalk mode - - - - - - - - - - -
        -

        Smalltalk mode

        -
        - - - -

        Simple Smalltalk mode.

        - -

        MIME types defined: text/x-stsrc.

        -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/smalltalk/smalltalk.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/smalltalk/smalltalk.js deleted file mode 100644 index bb510ba..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/smalltalk/smalltalk.js +++ /dev/null @@ -1,168 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode('smalltalk', function(config) { - - var specialChars = /[+\-\/\\*~<>=@%|&?!.,:;^]/; - var keywords = /true|false|nil|self|super|thisContext/; - - var Context = function(tokenizer, parent) { - this.next = tokenizer; - this.parent = parent; - }; - - var Token = function(name, context, eos) { - this.name = name; - this.context = context; - this.eos = eos; - }; - - var State = function() { - this.context = new Context(next, null); - this.expectVariable = true; - this.indentation = 0; - this.userIndentationDelta = 0; - }; - - State.prototype.userIndent = function(indentation) { - this.userIndentationDelta = indentation > 0 ? (indentation / config.indentUnit - this.indentation) : 0; - }; - - var next = function(stream, context, state) { - var token = new Token(null, context, false); - var aChar = stream.next(); - - if (aChar === '"') { - token = nextComment(stream, new Context(nextComment, context)); - - } else if (aChar === '\'') { - token = nextString(stream, new Context(nextString, context)); - - } else if (aChar === '#') { - if (stream.peek() === '\'') { - stream.next(); - token = nextSymbol(stream, new Context(nextSymbol, context)); - } else { - if (stream.eatWhile(/[^\s.{}\[\]()]/)) - token.name = 'string-2'; - else - token.name = 'meta'; - } - - } else if (aChar === '$') { - if (stream.next() === '<') { - stream.eatWhile(/[^\s>]/); - stream.next(); - } - token.name = 'string-2'; - - } else if (aChar === '|' && state.expectVariable) { - token.context = new Context(nextTemporaries, context); - - } else if (/[\[\]{}()]/.test(aChar)) { - token.name = 'bracket'; - token.eos = /[\[{(]/.test(aChar); - - if (aChar === '[') { - state.indentation++; - } else if (aChar === ']') { - state.indentation = Math.max(0, state.indentation - 1); - } - - } else if (specialChars.test(aChar)) { - stream.eatWhile(specialChars); - token.name = 'operator'; - token.eos = aChar !== ';'; // ; cascaded message expression - - } else if (/\d/.test(aChar)) { - stream.eatWhile(/[\w\d]/); - token.name = 'number'; - - } else if (/[\w_]/.test(aChar)) { - stream.eatWhile(/[\w\d_]/); - token.name = state.expectVariable ? (keywords.test(stream.current()) ? 'keyword' : 'variable') : null; - - } else { - token.eos = state.expectVariable; - } - - return token; - }; - - var nextComment = function(stream, context) { - stream.eatWhile(/[^"]/); - return new Token('comment', stream.eat('"') ? context.parent : context, true); - }; - - var nextString = function(stream, context) { - stream.eatWhile(/[^']/); - return new Token('string', stream.eat('\'') ? context.parent : context, false); - }; - - var nextSymbol = function(stream, context) { - stream.eatWhile(/[^']/); - return new Token('string-2', stream.eat('\'') ? context.parent : context, false); - }; - - var nextTemporaries = function(stream, context) { - var token = new Token(null, context, false); - var aChar = stream.next(); - - if (aChar === '|') { - token.context = context.parent; - token.eos = true; - - } else { - stream.eatWhile(/[^|]/); - token.name = 'variable'; - } - - return token; - }; - - return { - startState: function() { - return new State; - }, - - token: function(stream, state) { - state.userIndent(stream.indentation()); - - if (stream.eatSpace()) { - return null; - } - - var token = state.context.next(stream, state.context, state); - state.context = token.context; - state.expectVariable = token.eos; - - return token.name; - }, - - blankLine: function(state) { - state.userIndent(0); - }, - - indent: function(state, textAfter) { - var i = state.context.next === next && textAfter && textAfter.charAt(0) === ']' ? -1 : state.userIndentationDelta; - return (state.indentation + i) * config.indentUnit; - }, - - electricChars: ']' - }; - -}); - -CodeMirror.defineMIME('text/x-stsrc', {name: 'smalltalk'}); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/smarty/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/smarty/index.html deleted file mode 100644 index 8d88c9a..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/smarty/index.html +++ /dev/null @@ -1,136 +0,0 @@ - - -CodeMirror: Smarty mode - - - - - - - - - -
        -

        Smarty mode

        -
        - - - -
        - -

        Smarty 2, custom delimiters

        -
        - - - -
        - -

        Smarty 3

        - - - - - - -

        A plain text/Smarty version 2 or 3 mode, which allows for custom delimiter tags.

        - -

        MIME types defined: text/x-smarty

        -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/smarty/smarty.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/smarty/smarty.js deleted file mode 100644 index bb05324..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/smarty/smarty.js +++ /dev/null @@ -1,221 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/** - * Smarty 2 and 3 mode. - */ - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("smarty", function(config) { - "use strict"; - - // our default settings; check to see if they're overridden - var settings = { - rightDelimiter: '}', - leftDelimiter: '{', - smartyVersion: 2 // for backward compatibility - }; - if (config.hasOwnProperty("leftDelimiter")) { - settings.leftDelimiter = config.leftDelimiter; - } - if (config.hasOwnProperty("rightDelimiter")) { - settings.rightDelimiter = config.rightDelimiter; - } - if (config.hasOwnProperty("smartyVersion") && config.smartyVersion === 3) { - settings.smartyVersion = 3; - } - - var keyFunctions = ["debug", "extends", "function", "include", "literal"]; - var last; - var regs = { - operatorChars: /[+\-*&%=<>!?]/, - validIdentifier: /[a-zA-Z0-9_]/, - stringChar: /['"]/ - }; - - var helpers = { - cont: function(style, lastType) { - last = lastType; - return style; - }, - chain: function(stream, state, parser) { - state.tokenize = parser; - return parser(stream, state); - } - }; - - - // our various parsers - var parsers = { - - // the main tokenizer - tokenizer: function(stream, state) { - if (stream.match(settings.leftDelimiter, true)) { - if (stream.eat("*")) { - return helpers.chain(stream, state, parsers.inBlock("comment", "*" + settings.rightDelimiter)); - } else { - // Smarty 3 allows { and } surrounded by whitespace to NOT slip into Smarty mode - state.depth++; - var isEol = stream.eol(); - var isFollowedByWhitespace = /\s/.test(stream.peek()); - if (settings.smartyVersion === 3 && settings.leftDelimiter === "{" && (isEol || isFollowedByWhitespace)) { - state.depth--; - return null; - } else { - state.tokenize = parsers.smarty; - last = "startTag"; - return "tag"; - } - } - } else { - stream.next(); - return null; - } - }, - - // parsing Smarty content - smarty: function(stream, state) { - if (stream.match(settings.rightDelimiter, true)) { - if (settings.smartyVersion === 3) { - state.depth--; - if (state.depth <= 0) { - state.tokenize = parsers.tokenizer; - } - } else { - state.tokenize = parsers.tokenizer; - } - return helpers.cont("tag", null); - } - - if (stream.match(settings.leftDelimiter, true)) { - state.depth++; - return helpers.cont("tag", "startTag"); - } - - var ch = stream.next(); - if (ch == "$") { - stream.eatWhile(regs.validIdentifier); - return helpers.cont("variable-2", "variable"); - } else if (ch == "|") { - return helpers.cont("operator", "pipe"); - } else if (ch == ".") { - return helpers.cont("operator", "property"); - } else if (regs.stringChar.test(ch)) { - state.tokenize = parsers.inAttribute(ch); - return helpers.cont("string", "string"); - } else if (regs.operatorChars.test(ch)) { - stream.eatWhile(regs.operatorChars); - return helpers.cont("operator", "operator"); - } else if (ch == "[" || ch == "]") { - return helpers.cont("bracket", "bracket"); - } else if (ch == "(" || ch == ")") { - return helpers.cont("bracket", "operator"); - } else if (/\d/.test(ch)) { - stream.eatWhile(/\d/); - return helpers.cont("number", "number"); - } else { - - if (state.last == "variable") { - if (ch == "@") { - stream.eatWhile(regs.validIdentifier); - return helpers.cont("property", "property"); - } else if (ch == "|") { - stream.eatWhile(regs.validIdentifier); - return helpers.cont("qualifier", "modifier"); - } - } else if (state.last == "pipe") { - stream.eatWhile(regs.validIdentifier); - return helpers.cont("qualifier", "modifier"); - } else if (state.last == "whitespace") { - stream.eatWhile(regs.validIdentifier); - return helpers.cont("attribute", "modifier"); - } if (state.last == "property") { - stream.eatWhile(regs.validIdentifier); - return helpers.cont("property", null); - } else if (/\s/.test(ch)) { - last = "whitespace"; - return null; - } - - var str = ""; - if (ch != "/") { - str += ch; - } - var c = null; - while (c = stream.eat(regs.validIdentifier)) { - str += c; - } - for (var i=0, j=keyFunctions.length; i - -CodeMirror: Smarty mixed mode - - - - - - - - - - - - - -
        -

        Smarty mixed mode

        -
        - - - -

        The Smarty mixed mode depends on the Smarty and HTML mixed modes. HTML - mixed mode itself depends on XML, JavaScript, and CSS modes.

        - -

        It takes the same options, as Smarty and HTML mixed modes.

        - -

        MIME types defined: text/x-smarty.

        -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/smartymixed/smartymixed.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/smartymixed/smartymixed.js deleted file mode 100644 index 4fc7ca4..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/smartymixed/smartymixed.js +++ /dev/null @@ -1,197 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/** -* @file smartymixed.js -* @brief Smarty Mixed Codemirror mode (Smarty + Mixed HTML) -* @author Ruslan Osmanov -* @version 3.0 -* @date 05.07.2013 -*/ - -// Warning: Don't base other modes on this one. This here is a -// terrible way to write a mixed mode. - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), require("../smarty/smarty")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../htmlmixed/htmlmixed", "../smarty/smarty"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("smartymixed", function(config) { - var htmlMixedMode = CodeMirror.getMode(config, "htmlmixed"); - var smartyMode = CodeMirror.getMode(config, "smarty"); - - var settings = { - rightDelimiter: '}', - leftDelimiter: '{' - }; - - if (config.hasOwnProperty("leftDelimiter")) { - settings.leftDelimiter = config.leftDelimiter; - } - if (config.hasOwnProperty("rightDelimiter")) { - settings.rightDelimiter = config.rightDelimiter; - } - - function reEsc(str) { return str.replace(/[^\s\w]/g, "\\$&"); } - - var reLeft = reEsc(settings.leftDelimiter), reRight = reEsc(settings.rightDelimiter); - var regs = { - smartyComment: new RegExp("^" + reRight + "\\*"), - literalOpen: new RegExp(reLeft + "literal" + reRight), - literalClose: new RegExp(reLeft + "\/literal" + reRight), - hasLeftDelimeter: new RegExp(".*" + reLeft), - htmlHasLeftDelimeter: new RegExp("[^<>]*" + reLeft) - }; - - var helpers = { - chain: function(stream, state, parser) { - state.tokenize = parser; - return parser(stream, state); - }, - - cleanChain: function(stream, state, parser) { - state.tokenize = null; - state.localState = null; - state.localMode = null; - return (typeof parser == "string") ? (parser ? parser : null) : parser(stream, state); - }, - - maybeBackup: function(stream, pat, style) { - var cur = stream.current(); - var close = cur.search(pat), - m; - if (close > - 1) stream.backUp(cur.length - close); - else if (m = cur.match(/<\/?$/)) { - stream.backUp(cur.length); - if (!stream.match(pat, false)) stream.match(cur[0]); - } - return style; - } - }; - - var parsers = { - html: function(stream, state) { - var htmlTagName = state.htmlMixedState.htmlState.context && state.htmlMixedState.htmlState.context.tagName - ? state.htmlMixedState.htmlState.context.tagName - : null; - - if (!state.inLiteral && stream.match(regs.htmlHasLeftDelimeter, false) && htmlTagName === null) { - state.tokenize = parsers.smarty; - state.localMode = smartyMode; - state.localState = smartyMode.startState(htmlMixedMode.indent(state.htmlMixedState, "")); - return helpers.maybeBackup(stream, settings.leftDelimiter, smartyMode.token(stream, state.localState)); - } else if (!state.inLiteral && stream.match(settings.leftDelimiter, false)) { - state.tokenize = parsers.smarty; - state.localMode = smartyMode; - state.localState = smartyMode.startState(htmlMixedMode.indent(state.htmlMixedState, "")); - return helpers.maybeBackup(stream, settings.leftDelimiter, smartyMode.token(stream, state.localState)); - } - return htmlMixedMode.token(stream, state.htmlMixedState); - }, - - smarty: function(stream, state) { - if (stream.match(settings.leftDelimiter, false)) { - if (stream.match(regs.smartyComment, false)) { - return helpers.chain(stream, state, parsers.inBlock("comment", "*" + settings.rightDelimiter)); - } - } else if (stream.match(settings.rightDelimiter, false)) { - stream.eat(settings.rightDelimiter); - state.tokenize = parsers.html; - state.localMode = htmlMixedMode; - state.localState = state.htmlMixedState; - return "tag"; - } - - return helpers.maybeBackup(stream, settings.rightDelimiter, smartyMode.token(stream, state.localState)); - }, - - inBlock: function(style, terminator) { - return function(stream, state) { - while (!stream.eol()) { - if (stream.match(terminator)) { - helpers.cleanChain(stream, state, ""); - break; - } - stream.next(); - } - return style; - }; - } - }; - - return { - startState: function() { - var state = htmlMixedMode.startState(); - return { - token: parsers.html, - localMode: null, - localState: null, - htmlMixedState: state, - tokenize: null, - inLiteral: false - }; - }, - - copyState: function(state) { - var local = null, tok = (state.tokenize || state.token); - if (state.localState) { - local = CodeMirror.copyState((tok != parsers.html ? smartyMode : htmlMixedMode), state.localState); - } - return { - token: state.token, - tokenize: state.tokenize, - localMode: state.localMode, - localState: local, - htmlMixedState: CodeMirror.copyState(htmlMixedMode, state.htmlMixedState), - inLiteral: state.inLiteral - }; - }, - - token: function(stream, state) { - if (stream.match(settings.leftDelimiter, false)) { - if (!state.inLiteral && stream.match(regs.literalOpen, true)) { - state.inLiteral = true; - return "keyword"; - } else if (state.inLiteral && stream.match(regs.literalClose, true)) { - state.inLiteral = false; - return "keyword"; - } - } - if (state.inLiteral && state.localState != state.htmlMixedState) { - state.tokenize = parsers.html; - state.localMode = htmlMixedMode; - state.localState = state.htmlMixedState; - } - - var style = (state.tokenize || state.token)(stream, state); - return style; - }, - - indent: function(state, textAfter) { - if (state.localMode == smartyMode - || (state.inLiteral && !state.localMode) - || regs.hasLeftDelimeter.test(textAfter)) { - return CodeMirror.Pass; - } - return htmlMixedMode.indent(state.htmlMixedState, textAfter); - }, - - innerMode: function(state) { - return { - state: state.localState || state.htmlMixedState, - mode: state.localMode || htmlMixedMode - }; - } - }; -}, "htmlmixed", "smarty"); - -CodeMirror.defineMIME("text/x-smarty", "smartymixed"); -// vim: et ts=2 sts=2 sw=2 - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/solr/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/solr/index.html deleted file mode 100644 index 4b18c25..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/solr/index.html +++ /dev/null @@ -1,57 +0,0 @@ - - -CodeMirror: Solr mode - - - - - - - - - -
        -

        Solr mode

        - -
        - -
        - - - -

        MIME types defined: text/x-solr.

        -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/solr/solr.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/solr/solr.js deleted file mode 100644 index f7f7087..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/solr/solr.js +++ /dev/null @@ -1,104 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("solr", function() { - "use strict"; - - var isStringChar = /[^\s\|\!\+\-\*\?\~\^\&\:\(\)\[\]\{\}\^\"\\]/; - var isOperatorChar = /[\|\!\+\-\*\?\~\^\&]/; - var isOperatorString = /^(OR|AND|NOT|TO)$/i; - - function isNumber(word) { - return parseFloat(word, 10).toString() === word; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) break; - escaped = !escaped && next == "\\"; - } - - if (!escaped) state.tokenize = tokenBase; - return "string"; - }; - } - - function tokenOperator(operator) { - return function(stream, state) { - var style = "operator"; - if (operator == "+") - style += " positive"; - else if (operator == "-") - style += " negative"; - else if (operator == "|") - stream.eat(/\|/); - else if (operator == "&") - stream.eat(/\&/); - else if (operator == "^") - style += " boost"; - - state.tokenize = tokenBase; - return style; - }; - } - - function tokenWord(ch) { - return function(stream, state) { - var word = ch; - while ((ch = stream.peek()) && ch.match(isStringChar) != null) { - word += stream.next(); - } - - state.tokenize = tokenBase; - if (isOperatorString.test(word)) - return "operator"; - else if (isNumber(word)) - return "number"; - else if (stream.peek() == ":") - return "field"; - else - return "string"; - }; - } - - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"') - state.tokenize = tokenString(ch); - else if (isOperatorChar.test(ch)) - state.tokenize = tokenOperator(ch); - else if (isStringChar.test(ch)) - state.tokenize = tokenWord(ch); - - return (state.tokenize != tokenBase) ? state.tokenize(stream, state) : null; - } - - return { - startState: function() { - return { - tokenize: tokenBase - }; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - return state.tokenize(stream, state); - } - }; -}); - -CodeMirror.defineMIME("text/x-solr", "solr"); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/soy/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/soy/index.html deleted file mode 100644 index f0216f0..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/soy/index.html +++ /dev/null @@ -1,68 +0,0 @@ - - -CodeMirror: Soy (Closure Template) mode - - - - - - - - - - - - - - -
        -

        Soy (Closure Template) mode

        -
        - - - -

        A mode for Closure Templates (Soy).

        -

        MIME type defined: text/x-soy.

        -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/soy/soy.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/soy/soy.js deleted file mode 100644 index 7e81e8d..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/soy/soy.js +++ /dev/null @@ -1,198 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../htmlmixed/htmlmixed"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var indentingTags = ["template", "literal", "msg", "fallbackmsg", "let", "if", "elseif", - "else", "switch", "case", "default", "foreach", "ifempty", "for", - "call", "param", "deltemplate", "delcall", "log"]; - - CodeMirror.defineMode("soy", function(config) { - var textMode = CodeMirror.getMode(config, "text/plain"); - var modes = { - html: CodeMirror.getMode(config, {name: "text/html", multilineTagIndentFactor: 2, multilineTagIndentPastTag: false}), - attributes: textMode, - text: textMode, - uri: textMode, - css: CodeMirror.getMode(config, "text/css"), - js: CodeMirror.getMode(config, {name: "text/javascript", statementIndent: 2 * config.indentUnit}) - }; - - function last(array) { - return array[array.length - 1]; - } - - function tokenUntil(stream, state, untilRegExp) { - var oldString = stream.string; - var match = untilRegExp.exec(oldString.substr(stream.pos)); - if (match) { - // We don't use backUp because it backs up just the position, not the state. - // This uses an undocumented API. - stream.string = oldString.substr(0, stream.pos + match.index); - } - var result = stream.hideFirstChars(state.indent, function() { - return state.localMode.token(stream, state.localState); - }); - stream.string = oldString; - return result; - } - - return { - startState: function() { - return { - kind: [], - kindTag: [], - soyState: [], - indent: 0, - localMode: modes.html, - localState: CodeMirror.startState(modes.html) - }; - }, - - copyState: function(state) { - return { - tag: state.tag, // Last seen Soy tag. - kind: state.kind.concat([]), // Values of kind="" attributes. - kindTag: state.kindTag.concat([]), // Opened tags with kind="" attributes. - soyState: state.soyState.concat([]), - indent: state.indent, // Indentation of the following line. - localMode: state.localMode, - localState: CodeMirror.copyState(state.localMode, state.localState) - }; - }, - - token: function(stream, state) { - var match; - - switch (last(state.soyState)) { - case "comment": - if (stream.match(/^.*?\*\//)) { - state.soyState.pop(); - } else { - stream.skipToEnd(); - } - return "comment"; - - case "variable": - if (stream.match(/^}/)) { - state.indent -= 2 * config.indentUnit; - state.soyState.pop(); - return "variable-2"; - } - stream.next(); - return null; - - case "tag": - if (stream.match(/^\/?}/)) { - if (state.tag == "/template" || state.tag == "/deltemplate") state.indent = 0; - else state.indent -= (stream.current() == "/}" || indentingTags.indexOf(state.tag) == -1 ? 2 : 1) * config.indentUnit; - state.soyState.pop(); - return "keyword"; - } else if (stream.match(/^(\w+)(?==)/)) { - if (stream.current() == "kind" && (match = stream.match(/^="([^"]+)/, false))) { - var kind = match[1]; - state.kind.push(kind); - state.kindTag.push(state.tag); - state.localMode = modes[kind] || modes.html; - state.localState = CodeMirror.startState(state.localMode); - } - return "attribute"; - } else if (stream.match(/^"/)) { - state.soyState.push("string"); - return "string"; - } - stream.next(); - return null; - - case "literal": - if (stream.match(/^(?=\{\/literal})/)) { - state.indent -= config.indentUnit; - state.soyState.pop(); - return this.token(stream, state); - } - return tokenUntil(stream, state, /\{\/literal}/); - - case "string": - if (stream.match(/^.*?"/)) { - state.soyState.pop(); - } else { - stream.skipToEnd(); - } - return "string"; - } - - if (stream.match(/^\/\*/)) { - state.soyState.push("comment"); - return "comment"; - } else if (stream.match(stream.sol() ? /^\s*\/\/.*/ : /^\s+\/\/.*/)) { - return "comment"; - } else if (stream.match(/^\{\$\w*/)) { - state.indent += 2 * config.indentUnit; - state.soyState.push("variable"); - return "variable-2"; - } else if (stream.match(/^\{literal}/)) { - state.indent += config.indentUnit; - state.soyState.push("literal"); - return "keyword"; - } else if (match = stream.match(/^\{([\/@\\]?\w*)/)) { - if (match[1] != "/switch") - state.indent += (/^(\/|(else|elseif|case|default)$)/.test(match[1]) && state.tag != "switch" ? 1 : 2) * config.indentUnit; - state.tag = match[1]; - if (state.tag == "/" + last(state.kindTag)) { - // We found the tag that opened the current kind="". - state.kind.pop(); - state.kindTag.pop(); - state.localMode = modes[last(state.kind)] || modes.html; - state.localState = CodeMirror.startState(state.localMode); - } - state.soyState.push("tag"); - return "keyword"; - } - - return tokenUntil(stream, state, /\{|\s+\/\/|\/\*/); - }, - - indent: function(state, textAfter) { - var indent = state.indent, top = last(state.soyState); - if (top == "comment") return CodeMirror.Pass; - - if (top == "literal") { - if (/^\{\/literal}/.test(textAfter)) indent -= config.indentUnit; - } else { - if (/^\s*\{\/(template|deltemplate)\b/.test(textAfter)) return 0; - if (/^\{(\/|(fallbackmsg|elseif|else|ifempty)\b)/.test(textAfter)) indent -= config.indentUnit; - if (state.tag != "switch" && /^\{(case|default)\b/.test(textAfter)) indent -= config.indentUnit; - if (/^\{\/switch\b/.test(textAfter)) indent -= config.indentUnit; - } - if (indent && state.localMode.indent) - indent += state.localMode.indent(state.localState, textAfter); - return indent; - }, - - innerMode: function(state) { - if (state.soyState.length && last(state.soyState) != "literal") return null; - else return {state: state.localState, mode: state.localMode}; - }, - - electricInput: /^\s*\{(\/|\/template|\/deltemplate|\/switch|fallbackmsg|elseif|else|case|default|ifempty|\/literal\})$/, - lineComment: "//", - blockCommentStart: "/*", - blockCommentEnd: "*/", - blockCommentContinue: " * ", - fold: "indent" - }; - }, "htmlmixed"); - - CodeMirror.registerHelper("hintWords", "soy", indentingTags.concat( - ["delpackage", "namespace", "alias", "print", "css", "debugger"])); - - CodeMirror.defineMIME("text/x-soy", "soy"); -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/sparql/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/sparql/index.html deleted file mode 100644 index 84ef4d3..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/sparql/index.html +++ /dev/null @@ -1,61 +0,0 @@ - - -CodeMirror: SPARQL mode - - - - - - - - - - -
        -

        SPARQL mode

        -
        - - -

        MIME types defined: application/sparql-query.

        - -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/sparql/sparql.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/sparql/sparql.js deleted file mode 100644 index bbf8a76..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/sparql/sparql.js +++ /dev/null @@ -1,174 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("sparql", function(config) { - var indentUnit = config.indentUnit; - var curPunc; - - function wordRegexp(words) { - return new RegExp("^(?:" + words.join("|") + ")$", "i"); - } - var ops = wordRegexp(["str", "lang", "langmatches", "datatype", "bound", "sameterm", "isiri", "isuri", - "iri", "uri", "bnode", "count", "sum", "min", "max", "avg", "sample", - "group_concat", "rand", "abs", "ceil", "floor", "round", "concat", "substr", "strlen", - "replace", "ucase", "lcase", "encode_for_uri", "contains", "strstarts", "strends", - "strbefore", "strafter", "year", "month", "day", "hours", "minutes", "seconds", - "timezone", "tz", "now", "uuid", "struuid", "md5", "sha1", "sha256", "sha384", - "sha512", "coalesce", "if", "strlang", "strdt", "isnumeric", "regex", "exists", - "isblank", "isliteral", "a"]); - var keywords = wordRegexp(["base", "prefix", "select", "distinct", "reduced", "construct", "describe", - "ask", "from", "named", "where", "order", "limit", "offset", "filter", "optional", - "graph", "by", "asc", "desc", "as", "having", "undef", "values", "group", - "minus", "in", "not", "service", "silent", "using", "insert", "delete", "union", - "true", "false", "with", - "data", "copy", "to", "move", "add", "create", "drop", "clear", "load"]); - var operatorChars = /[*+\-<>=&|\^\/!\?]/; - - function tokenBase(stream, state) { - var ch = stream.next(); - curPunc = null; - if (ch == "$" || ch == "?") { - if(ch == "?" && stream.match(/\s/, false)){ - return "operator"; - } - stream.match(/^[\w\d]*/); - return "variable-2"; - } - else if (ch == "<" && !stream.match(/^[\s\u00a0=]/, false)) { - stream.match(/^[^\s\u00a0>]*>?/); - return "atom"; - } - else if (ch == "\"" || ch == "'") { - state.tokenize = tokenLiteral(ch); - return state.tokenize(stream, state); - } - else if (/[{}\(\),\.;\[\]]/.test(ch)) { - curPunc = ch; - return "bracket"; - } - else if (ch == "#") { - stream.skipToEnd(); - return "comment"; - } - else if (operatorChars.test(ch)) { - stream.eatWhile(operatorChars); - return "operator"; - } - else if (ch == ":") { - stream.eatWhile(/[\w\d\._\-]/); - return "atom"; - } - else if (ch == "@") { - stream.eatWhile(/[a-z\d\-]/i); - return "meta"; - } - else { - stream.eatWhile(/[_\w\d]/); - if (stream.eat(":")) { - stream.eatWhile(/[\w\d_\-]/); - return "atom"; - } - var word = stream.current(); - if (ops.test(word)) - return "builtin"; - else if (keywords.test(word)) - return "keyword"; - else - return "variable"; - } - } - - function tokenLiteral(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) { - state.tokenize = tokenBase; - break; - } - escaped = !escaped && ch == "\\"; - } - return "string"; - }; - } - - function pushContext(state, type, col) { - state.context = {prev: state.context, indent: state.indent, col: col, type: type}; - } - function popContext(state) { - state.indent = state.context.indent; - state.context = state.context.prev; - } - - return { - startState: function() { - return {tokenize: tokenBase, - context: null, - indent: 0, - col: 0}; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (state.context && state.context.align == null) state.context.align = false; - state.indent = stream.indentation(); - } - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - - if (style != "comment" && state.context && state.context.align == null && state.context.type != "pattern") { - state.context.align = true; - } - - if (curPunc == "(") pushContext(state, ")", stream.column()); - else if (curPunc == "[") pushContext(state, "]", stream.column()); - else if (curPunc == "{") pushContext(state, "}", stream.column()); - else if (/[\]\}\)]/.test(curPunc)) { - while (state.context && state.context.type == "pattern") popContext(state); - if (state.context && curPunc == state.context.type) popContext(state); - } - else if (curPunc == "." && state.context && state.context.type == "pattern") popContext(state); - else if (/atom|string|variable/.test(style) && state.context) { - if (/[\}\]]/.test(state.context.type)) - pushContext(state, "pattern", stream.column()); - else if (state.context.type == "pattern" && !state.context.align) { - state.context.align = true; - state.context.col = stream.column(); - } - } - - return style; - }, - - indent: function(state, textAfter) { - var firstChar = textAfter && textAfter.charAt(0); - var context = state.context; - if (/[\]\}]/.test(firstChar)) - while (context && context.type == "pattern") context = context.prev; - - var closing = context && firstChar == context.type; - if (!context) - return 0; - else if (context.type == "pattern") - return context.col; - else if (context.align) - return context.col + (closing ? 0 : 1); - else - return context.indent + (closing ? 0 : indentUnit); - } - }; -}); - -CodeMirror.defineMIME("application/sparql-query", "sparql"); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/spreadsheet/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/spreadsheet/index.html deleted file mode 100644 index a52f76f..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/spreadsheet/index.html +++ /dev/null @@ -1,42 +0,0 @@ - - -CodeMirror: Spreadsheet mode - - - - - - - - - - -
        -

        Spreadsheet mode

        -
        - - - -

        MIME types defined: text/x-spreadsheet.

        - -

        The Spreadsheet Mode

        -

        Created by Robert Plummer

        -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/spreadsheet/spreadsheet.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/spreadsheet/spreadsheet.js deleted file mode 100644 index 6fab00f..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/spreadsheet/spreadsheet.js +++ /dev/null @@ -1,109 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineMode("spreadsheet", function () { - return { - startState: function () { - return { - stringType: null, - stack: [] - }; - }, - token: function (stream, state) { - if (!stream) return; - - //check for state changes - if (state.stack.length === 0) { - //strings - if ((stream.peek() == '"') || (stream.peek() == "'")) { - state.stringType = stream.peek(); - stream.next(); // Skip quote - state.stack.unshift("string"); - } - } - - //return state - //stack has - switch (state.stack[0]) { - case "string": - while (state.stack[0] === "string" && !stream.eol()) { - if (stream.peek() === state.stringType) { - stream.next(); // Skip quote - state.stack.shift(); // Clear flag - } else if (stream.peek() === "\\") { - stream.next(); - stream.next(); - } else { - stream.match(/^.[^\\\"\']*/); - } - } - return "string"; - - case "characterClass": - while (state.stack[0] === "characterClass" && !stream.eol()) { - if (!(stream.match(/^[^\]\\]+/) || stream.match(/^\\./))) - state.stack.shift(); - } - return "operator"; - } - - var peek = stream.peek(); - - //no stack - switch (peek) { - case "[": - stream.next(); - state.stack.unshift("characterClass"); - return "bracket"; - case ":": - stream.next(); - return "operator"; - case "\\": - if (stream.match(/\\[a-z]+/)) return "string-2"; - else return null; - case ".": - case ",": - case ";": - case "*": - case "-": - case "+": - case "^": - case "<": - case "/": - case "=": - stream.next(); - return "atom"; - case "$": - stream.next(); - return "builtin"; - } - - if (stream.match(/\d+/)) { - if (stream.match(/^\w+/)) return "error"; - return "number"; - } else if (stream.match(/^[a-zA-Z_]\w*/)) { - if (stream.match(/(?=[\(.])/, false)) return "keyword"; - return "variable-2"; - } else if (["[", "]", "(", ")", "{", "}"].indexOf(peek) != -1) { - stream.next(); - return "bracket"; - } else if (!stream.eatSpace()) { - stream.next(); - } - return null; - } - }; - }); - - CodeMirror.defineMIME("text/x-spreadsheet", "spreadsheet"); -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/sql/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/sql/index.html deleted file mode 100644 index a0d8d9e..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/sql/index.html +++ /dev/null @@ -1,84 +0,0 @@ - - -CodeMirror: SQL Mode for CodeMirror - - - - - - - - - - - - -
        -

        SQL Mode for CodeMirror

        -
        - -
        -

        MIME types defined: - text/x-sql, - text/x-mysql, - text/x-mariadb, - text/x-cassandra, - text/x-plsql, - text/x-mssql, - text/x-hive. -

        - - -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/sql/sql.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/sql/sql.js deleted file mode 100644 index ee6c194..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/sql/sql.js +++ /dev/null @@ -1,391 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("sql", function(config, parserConfig) { - "use strict"; - - var client = parserConfig.client || {}, - atoms = parserConfig.atoms || {"false": true, "true": true, "null": true}, - builtin = parserConfig.builtin || {}, - keywords = parserConfig.keywords || {}, - operatorChars = parserConfig.operatorChars || /^[*+\-%<>!=&|~^]/, - support = parserConfig.support || {}, - hooks = parserConfig.hooks || {}, - dateSQL = parserConfig.dateSQL || {"date" : true, "time" : true, "timestamp" : true}; - - function tokenBase(stream, state) { - var ch = stream.next(); - - // call hooks from the mime type - if (hooks[ch]) { - var result = hooks[ch](stream, state); - if (result !== false) return result; - } - - if (support.hexNumber == true && - ((ch == "0" && stream.match(/^[xX][0-9a-fA-F]+/)) - || (ch == "x" || ch == "X") && stream.match(/^'[0-9a-fA-F]+'/))) { - // hex - // ref: http://dev.mysql.com/doc/refman/5.5/en/hexadecimal-literals.html - return "number"; - } else if (support.binaryNumber == true && - (((ch == "b" || ch == "B") && stream.match(/^'[01]+'/)) - || (ch == "0" && stream.match(/^b[01]+/)))) { - // bitstring - // ref: http://dev.mysql.com/doc/refman/5.5/en/bit-field-literals.html - return "number"; - } else if (ch.charCodeAt(0) > 47 && ch.charCodeAt(0) < 58) { - // numbers - // ref: http://dev.mysql.com/doc/refman/5.5/en/number-literals.html - stream.match(/^[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/); - support.decimallessFloat == true && stream.eat('.'); - return "number"; - } else if (ch == "?" && (stream.eatSpace() || stream.eol() || stream.eat(";"))) { - // placeholders - return "variable-3"; - } else if (ch == "'" || (ch == '"' && support.doubleQuote)) { - // strings - // ref: http://dev.mysql.com/doc/refman/5.5/en/string-literals.html - state.tokenize = tokenLiteral(ch); - return state.tokenize(stream, state); - } else if ((((support.nCharCast == true && (ch == "n" || ch == "N")) - || (support.charsetCast == true && ch == "_" && stream.match(/[a-z][a-z0-9]*/i))) - && (stream.peek() == "'" || stream.peek() == '"'))) { - // charset casting: _utf8'str', N'str', n'str' - // ref: http://dev.mysql.com/doc/refman/5.5/en/string-literals.html - return "keyword"; - } else if (/^[\(\),\;\[\]]/.test(ch)) { - // no highlightning - return null; - } else if (support.commentSlashSlash && ch == "/" && stream.eat("/")) { - // 1-line comment - stream.skipToEnd(); - return "comment"; - } else if ((support.commentHash && ch == "#") - || (ch == "-" && stream.eat("-") && (!support.commentSpaceRequired || stream.eat(" ")))) { - // 1-line comments - // ref: https://kb.askmonty.org/en/comment-syntax/ - stream.skipToEnd(); - return "comment"; - } else if (ch == "/" && stream.eat("*")) { - // multi-line comments - // ref: https://kb.askmonty.org/en/comment-syntax/ - state.tokenize = tokenComment; - return state.tokenize(stream, state); - } else if (ch == ".") { - // .1 for 0.1 - if (support.zerolessFloat == true && stream.match(/^(?:\d+(?:e[+-]?\d+)?)/i)) { - return "number"; - } - // .table_name (ODBC) - // // ref: http://dev.mysql.com/doc/refman/5.6/en/identifier-qualifiers.html - if (support.ODBCdotTable == true && stream.match(/^[a-zA-Z_]+/)) { - return "variable-2"; - } - } else if (operatorChars.test(ch)) { - // operators - stream.eatWhile(operatorChars); - return null; - } else if (ch == '{' && - (stream.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/) || stream.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/))) { - // dates (weird ODBC syntax) - // ref: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-literals.html - return "number"; - } else { - stream.eatWhile(/^[_\w\d]/); - var word = stream.current().toLowerCase(); - // dates (standard SQL syntax) - // ref: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-literals.html - if (dateSQL.hasOwnProperty(word) && (stream.match(/^( )+'[^']*'/) || stream.match(/^( )+"[^"]*"/))) - return "number"; - if (atoms.hasOwnProperty(word)) return "atom"; - if (builtin.hasOwnProperty(word)) return "builtin"; - if (keywords.hasOwnProperty(word)) return "keyword"; - if (client.hasOwnProperty(word)) return "string-2"; - return null; - } - } - - // 'string', with char specified in quote escaped by '\' - function tokenLiteral(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) { - state.tokenize = tokenBase; - break; - } - escaped = !escaped && ch == "\\"; - } - return "string"; - }; - } - function tokenComment(stream, state) { - while (true) { - if (stream.skipTo("*")) { - stream.next(); - if (stream.eat("/")) { - state.tokenize = tokenBase; - break; - } - } else { - stream.skipToEnd(); - break; - } - } - return "comment"; - } - - function pushContext(stream, state, type) { - state.context = { - prev: state.context, - indent: stream.indentation(), - col: stream.column(), - type: type - }; - } - - function popContext(state) { - state.indent = state.context.indent; - state.context = state.context.prev; - } - - return { - startState: function() { - return {tokenize: tokenBase, context: null}; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (state.context && state.context.align == null) - state.context.align = false; - } - if (stream.eatSpace()) return null; - - var style = state.tokenize(stream, state); - if (style == "comment") return style; - - if (state.context && state.context.align == null) - state.context.align = true; - - var tok = stream.current(); - if (tok == "(") - pushContext(stream, state, ")"); - else if (tok == "[") - pushContext(stream, state, "]"); - else if (state.context && state.context.type == tok) - popContext(state); - return style; - }, - - indent: function(state, textAfter) { - var cx = state.context; - if (!cx) return CodeMirror.Pass; - var closing = textAfter.charAt(0) == cx.type; - if (cx.align) return cx.col + (closing ? 0 : 1); - else return cx.indent + (closing ? 0 : config.indentUnit); - }, - - blockCommentStart: "/*", - blockCommentEnd: "*/", - lineComment: support.commentSlashSlash ? "//" : support.commentHash ? "#" : null - }; -}); - -(function() { - "use strict"; - - // `identifier` - function hookIdentifier(stream) { - // MySQL/MariaDB identifiers - // ref: http://dev.mysql.com/doc/refman/5.6/en/identifier-qualifiers.html - var ch; - while ((ch = stream.next()) != null) { - if (ch == "`" && !stream.eat("`")) return "variable-2"; - } - stream.backUp(stream.current().length - 1); - return stream.eatWhile(/\w/) ? "variable-2" : null; - } - - // variable token - function hookVar(stream) { - // variables - // @@prefix.varName @varName - // varName can be quoted with ` or ' or " - // ref: http://dev.mysql.com/doc/refman/5.5/en/user-variables.html - if (stream.eat("@")) { - stream.match(/^session\./); - stream.match(/^local\./); - stream.match(/^global\./); - } - - if (stream.eat("'")) { - stream.match(/^.*'/); - return "variable-2"; - } else if (stream.eat('"')) { - stream.match(/^.*"/); - return "variable-2"; - } else if (stream.eat("`")) { - stream.match(/^.*`/); - return "variable-2"; - } else if (stream.match(/^[0-9a-zA-Z$\.\_]+/)) { - return "variable-2"; - } - return null; - }; - - // short client keyword token - function hookClient(stream) { - // \N means NULL - // ref: http://dev.mysql.com/doc/refman/5.5/en/null-values.html - if (stream.eat("N")) { - return "atom"; - } - // \g, etc - // ref: http://dev.mysql.com/doc/refman/5.5/en/mysql-commands.html - return stream.match(/^[a-zA-Z.#!?]/) ? "variable-2" : null; - } - - // these keywords are used by all SQL dialects (however, a mode can still overwrite it) - var sqlKeywords = "alter and as asc between by count create delete desc distinct drop from having in insert into is join like not on or order select set table union update values where "; - - // turn a space-separated list into an array - function set(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - // A generic SQL Mode. It's not a standard, it just try to support what is generally supported - CodeMirror.defineMIME("text/x-sql", { - name: "sql", - keywords: set(sqlKeywords + "begin"), - builtin: set("bool boolean bit blob enum long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision real date datetime year unsigned signed decimal numeric"), - atoms: set("false true null unknown"), - operatorChars: /^[*+\-%<>!=]/, - dateSQL: set("date time timestamp"), - support: set("ODBCdotTable doubleQuote binaryNumber hexNumber") - }); - - CodeMirror.defineMIME("text/x-mssql", { - name: "sql", - client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"), - keywords: set(sqlKeywords + "begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered"), - builtin: set("bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table "), - atoms: set("false true null unknown"), - operatorChars: /^[*+\-%<>!=]/, - dateSQL: set("date datetimeoffset datetime2 smalldatetime datetime time"), - hooks: { - "@": hookVar - } - }); - - CodeMirror.defineMIME("text/x-mysql", { - name: "sql", - client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"), - keywords: set(sqlKeywords + "accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group groupby_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"), - builtin: set("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"), - atoms: set("false true null unknown"), - operatorChars: /^[*+\-%<>!=&|^]/, - dateSQL: set("date time timestamp"), - support: set("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"), - hooks: { - "@": hookVar, - "`": hookIdentifier, - "\\": hookClient - } - }); - - CodeMirror.defineMIME("text/x-mariadb", { - name: "sql", - client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"), - keywords: set(sqlKeywords + "accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"), - builtin: set("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"), - atoms: set("false true null unknown"), - operatorChars: /^[*+\-%<>!=&|^]/, - dateSQL: set("date time timestamp"), - support: set("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"), - hooks: { - "@": hookVar, - "`": hookIdentifier, - "\\": hookClient - } - }); - - // the query language used by Apache Cassandra is called CQL, but this mime type - // is called Cassandra to avoid confusion with Contextual Query Language - CodeMirror.defineMIME("text/x-cassandra", { - name: "sql", - client: { }, - keywords: set("use select from using consistency where limit first reversed first and in insert into values using consistency ttl update set delete truncate begin batch apply create keyspace with columnfamily primary key index on drop alter type add any one quorum all local_quorum each_quorum"), - builtin: set("ascii bigint blob boolean counter decimal double float int text timestamp uuid varchar varint"), - atoms: set("false true"), - operatorChars: /^[<>=]/, - dateSQL: { }, - support: set("commentSlashSlash decimallessFloat"), - hooks: { } - }); - - // this is based on Peter Raganitsch's 'plsql' mode - CodeMirror.defineMIME("text/x-plsql", { - name: "sql", - client: set("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"), - keywords: set("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"), - builtin: set("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least lenght lenghtb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"), - operatorChars: /^[*+\-%<>!=~]/, - dateSQL: set("date time timestamp"), - support: set("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber") - }); - - // Created to support specific hive keywords - CodeMirror.defineMIME("text/x-hive", { - name: "sql", - keywords: set("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external false fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger true unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with"), - builtin: set("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"), - atoms: set("false true null unknown"), - operatorChars: /^[*+\-%<>!=]/, - dateSQL: set("date timestamp"), - support: set("ODBCdotTable doubleQuote binaryNumber hexNumber") - }); -}()); - -}); - -/* - How Properties of Mime Types are used by SQL Mode - ================================================= - - keywords: - A list of keywords you want to be highlighted. - builtin: - A list of builtin types you want to be highlighted (if you want types to be of class "builtin" instead of "keyword"). - operatorChars: - All characters that must be handled as operators. - client: - Commands parsed and executed by the client (not the server). - support: - A list of supported syntaxes which are not common, but are supported by more than 1 DBMS. - * ODBCdotTable: .tableName - * zerolessFloat: .1 - * doubleQuote - * nCharCast: N'string' - * charsetCast: _utf8'string' - * commentHash: use # char for comments - * commentSlashSlash: use // for comments - * commentSpaceRequired: require a space after -- for comments - atoms: - Keywords that must be highlighted as atoms,. Some DBMS's support more atoms than others: - UNKNOWN, INFINITY, UNDERFLOW, NaN... - dateSQL: - Used for date/time SQL standard syntax, because not all DBMS's support same temporal types. -*/ diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/stex/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/stex/index.html deleted file mode 100644 index 14679da..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/stex/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - -CodeMirror: sTeX mode - - - - - - - - - -
        -

        sTeX mode

        -
        - - -

        MIME types defined: text/x-stex.

        - -

        Parsing/Highlighting Tests: normal, verbose.

        - -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/stex/stex.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/stex/stex.js deleted file mode 100644 index 835ed46..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/stex/stex.js +++ /dev/null @@ -1,251 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/* - * Author: Constantin Jucovschi (c.jucovschi@jacobs-university.de) - * Licence: MIT - */ - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineMode("stex", function() { - "use strict"; - - function pushCommand(state, command) { - state.cmdState.push(command); - } - - function peekCommand(state) { - if (state.cmdState.length > 0) { - return state.cmdState[state.cmdState.length - 1]; - } else { - return null; - } - } - - function popCommand(state) { - var plug = state.cmdState.pop(); - if (plug) { - plug.closeBracket(); - } - } - - // returns the non-default plugin closest to the end of the list - function getMostPowerful(state) { - var context = state.cmdState; - for (var i = context.length - 1; i >= 0; i--) { - var plug = context[i]; - if (plug.name == "DEFAULT") { - continue; - } - return plug; - } - return { styleIdentifier: function() { return null; } }; - } - - function addPluginPattern(pluginName, cmdStyle, styles) { - return function () { - this.name = pluginName; - this.bracketNo = 0; - this.style = cmdStyle; - this.styles = styles; - this.argument = null; // \begin and \end have arguments that follow. These are stored in the plugin - - this.styleIdentifier = function() { - return this.styles[this.bracketNo - 1] || null; - }; - this.openBracket = function() { - this.bracketNo++; - return "bracket"; - }; - this.closeBracket = function() {}; - }; - } - - var plugins = {}; - - plugins["importmodule"] = addPluginPattern("importmodule", "tag", ["string", "builtin"]); - plugins["documentclass"] = addPluginPattern("documentclass", "tag", ["", "atom"]); - plugins["usepackage"] = addPluginPattern("usepackage", "tag", ["atom"]); - plugins["begin"] = addPluginPattern("begin", "tag", ["atom"]); - plugins["end"] = addPluginPattern("end", "tag", ["atom"]); - - plugins["DEFAULT"] = function () { - this.name = "DEFAULT"; - this.style = "tag"; - - this.styleIdentifier = this.openBracket = this.closeBracket = function() {}; - }; - - function setState(state, f) { - state.f = f; - } - - // called when in a normal (no environment) context - function normal(source, state) { - var plug; - // Do we look like '\command' ? If so, attempt to apply the plugin 'command' - if (source.match(/^\\[a-zA-Z@]+/)) { - var cmdName = source.current().slice(1); - plug = plugins[cmdName] || plugins["DEFAULT"]; - plug = new plug(); - pushCommand(state, plug); - setState(state, beginParams); - return plug.style; - } - - // escape characters - if (source.match(/^\\[$&%#{}_]/)) { - return "tag"; - } - - // white space control characters - if (source.match(/^\\[,;!\/\\]/)) { - return "tag"; - } - - // find if we're starting various math modes - if (source.match("\\[")) { - setState(state, function(source, state){ return inMathMode(source, state, "\\]"); }); - return "keyword"; - } - if (source.match("$$")) { - setState(state, function(source, state){ return inMathMode(source, state, "$$"); }); - return "keyword"; - } - if (source.match("$")) { - setState(state, function(source, state){ return inMathMode(source, state, "$"); }); - return "keyword"; - } - - var ch = source.next(); - if (ch == "%") { - source.skipToEnd(); - return "comment"; - } else if (ch == '}' || ch == ']') { - plug = peekCommand(state); - if (plug) { - plug.closeBracket(ch); - setState(state, beginParams); - } else { - return "error"; - } - return "bracket"; - } else if (ch == '{' || ch == '[') { - plug = plugins["DEFAULT"]; - plug = new plug(); - pushCommand(state, plug); - return "bracket"; - } else if (/\d/.test(ch)) { - source.eatWhile(/[\w.%]/); - return "atom"; - } else { - source.eatWhile(/[\w\-_]/); - plug = getMostPowerful(state); - if (plug.name == 'begin') { - plug.argument = source.current(); - } - return plug.styleIdentifier(); - } - } - - function inMathMode(source, state, endModeSeq) { - if (source.eatSpace()) { - return null; - } - if (source.match(endModeSeq)) { - setState(state, normal); - return "keyword"; - } - if (source.match(/^\\[a-zA-Z@]+/)) { - return "tag"; - } - if (source.match(/^[a-zA-Z]+/)) { - return "variable-2"; - } - // escape characters - if (source.match(/^\\[$&%#{}_]/)) { - return "tag"; - } - // white space control characters - if (source.match(/^\\[,;!\/]/)) { - return "tag"; - } - // special math-mode characters - if (source.match(/^[\^_&]/)) { - return "tag"; - } - // non-special characters - if (source.match(/^[+\-<>|=,\/@!*:;'"`~#?]/)) { - return null; - } - if (source.match(/^(\d+\.\d*|\d*\.\d+|\d+)/)) { - return "number"; - } - var ch = source.next(); - if (ch == "{" || ch == "}" || ch == "[" || ch == "]" || ch == "(" || ch == ")") { - return "bracket"; - } - - if (ch == "%") { - source.skipToEnd(); - return "comment"; - } - return "error"; - } - - function beginParams(source, state) { - var ch = source.peek(), lastPlug; - if (ch == '{' || ch == '[') { - lastPlug = peekCommand(state); - lastPlug.openBracket(ch); - source.eat(ch); - setState(state, normal); - return "bracket"; - } - if (/[ \t\r]/.test(ch)) { - source.eat(ch); - return null; - } - setState(state, normal); - popCommand(state); - - return normal(source, state); - } - - return { - startState: function() { - return { - cmdState: [], - f: normal - }; - }, - copyState: function(s) { - return { - cmdState: s.cmdState.slice(), - f: s.f - }; - }, - token: function(stream, state) { - return state.f(stream, state); - }, - blankLine: function(state) { - state.f = normal; - state.cmdState.length = 0; - }, - lineComment: "%" - }; - }); - - CodeMirror.defineMIME("text/x-stex", "stex"); - CodeMirror.defineMIME("text/x-latex", "stex"); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/stex/test.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/stex/test.js deleted file mode 100644 index 22f027e..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/stex/test.js +++ /dev/null @@ -1,123 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({tabSize: 4}, "stex"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - MT("word", - "foo"); - - MT("twoWords", - "foo bar"); - - MT("beginEndDocument", - "[tag \\begin][bracket {][atom document][bracket }]", - "[tag \\end][bracket {][atom document][bracket }]"); - - MT("beginEndEquation", - "[tag \\begin][bracket {][atom equation][bracket }]", - " E=mc^2", - "[tag \\end][bracket {][atom equation][bracket }]"); - - MT("beginModule", - "[tag \\begin][bracket {][atom module][bracket }[[]]]"); - - MT("beginModuleId", - "[tag \\begin][bracket {][atom module][bracket }[[]id=bbt-size[bracket ]]]"); - - MT("importModule", - "[tag \\importmodule][bracket [[][string b-b-t][bracket ]]{][builtin b-b-t][bracket }]"); - - MT("importModulePath", - "[tag \\importmodule][bracket [[][tag \\KWARCslides][bracket {][string dmath/en/cardinality][bracket }]]{][builtin card][bracket }]"); - - MT("psForPDF", - "[tag \\PSforPDF][bracket [[][atom 1][bracket ]]{]#1[bracket }]"); - - MT("comment", - "[comment % foo]"); - - MT("tagComment", - "[tag \\item][comment % bar]"); - - MT("commentTag", - " [comment % \\item]"); - - MT("commentLineBreak", - "[comment %]", - "foo"); - - MT("tagErrorCurly", - "[tag \\begin][error }][bracket {]"); - - MT("tagErrorSquare", - "[tag \\item][error ]]][bracket {]"); - - MT("commentCurly", - "[comment % }]"); - - MT("tagHash", - "the [tag \\#] key"); - - MT("tagNumber", - "a [tag \\$][atom 5] stetson"); - - MT("tagPercent", - "[atom 100][tag \\%] beef"); - - MT("tagAmpersand", - "L [tag \\&] N"); - - MT("tagUnderscore", - "foo[tag \\_]bar"); - - MT("tagBracketOpen", - "[tag \\emph][bracket {][tag \\{][bracket }]"); - - MT("tagBracketClose", - "[tag \\emph][bracket {][tag \\}][bracket }]"); - - MT("tagLetterNumber", - "section [tag \\S][atom 1]"); - - MT("textTagNumber", - "para [tag \\P][atom 2]"); - - MT("thinspace", - "x[tag \\,]y"); - - MT("thickspace", - "x[tag \\;]y"); - - MT("negativeThinspace", - "x[tag \\!]y"); - - MT("periodNotSentence", - "J.\\ L.\\ is"); - - MT("periodSentence", - "X[tag \\@]. The"); - - MT("italicCorrection", - "[bracket {][tag \\em] If[tag \\/][bracket }] I"); - - MT("tagBracket", - "[tag \\newcommand][bracket {][tag \\pop][bracket }]"); - - MT("inlineMathTagFollowedByNumber", - "[keyword $][tag \\pi][number 2][keyword $]"); - - MT("inlineMath", - "[keyword $][number 3][variable-2 x][tag ^][number 2.45]-[tag \\sqrt][bracket {][tag \\$\\alpha][bracket }] = [number 2][keyword $] other text"); - - MT("displayMath", - "More [keyword $$]\t[variable-2 S][tag ^][variable-2 n][tag \\sum] [variable-2 i][keyword $$] other text"); - - MT("mathWithComment", - "[keyword $][variable-2 x] [comment % $]", - "[variable-2 y][keyword $] other text"); - - MT("lineBreakArgument", - "[tag \\\\][bracket [[][atom 1cm][bracket ]]]"); -})(); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/stylus/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/stylus/index.html deleted file mode 100644 index 354bf30..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/stylus/index.html +++ /dev/null @@ -1,104 +0,0 @@ - - -CodeMirror: Stylus mode - - - - - - - - - - - -
        -

        Stylus mode

        -
        -
        - - -

        MIME types defined: text/x-styl.

        - -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/stylus/stylus.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/stylus/stylus.js deleted file mode 100644 index 6f7c754..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/stylus/stylus.js +++ /dev/null @@ -1,444 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineMode("stylus", function(config) { - - var operatorsRegexp = /^(\?:?|\+[+=]?|-[\-=]?|\*[\*=]?|\/=?|[=!:\?]?=|<=?|>=?|%=?|&&|\|=?|\~|!|\^|\\)/, - delimitersRegexp = /^(?:[()\[\]{},:`=;]|\.\.?\.?)/, - wordOperatorsRegexp = wordRegexp(wordOperators), - commonKeywordsRegexp = wordRegexp(commonKeywords), - commonAtomsRegexp = wordRegexp(commonAtoms), - commonDefRegexp = wordRegexp(commonDef), - vendorPrefixesRegexp = new RegExp(/^\-(moz|ms|o|webkit)-/), - cssValuesWithBracketsRegexp = new RegExp("^(" + cssValuesWithBrackets_.join("|") + ")\\([\\w\-\\#\\,\\.\\%\\s\\(\\)]*\\)"); - - var tokenBase = function(stream, state) { - - if (stream.eatSpace()) return null; - - var ch = stream.peek(); - - // Single line Comment - if (stream.match('//')) { - stream.skipToEnd(); - return "comment"; - } - - // Multiline Comment - if (stream.match('/*')) { - state.tokenizer = multilineComment; - return state.tokenizer(stream, state); - } - - // Strings - if (ch === '"' || ch === "'") { - stream.next(); - state.tokenizer = buildStringTokenizer(ch); - return "string"; - } - - // Def - if (ch === "@") { - stream.next(); - if (stream.match(/extend/)) { - dedent(state); // remove indentation after selectors - } else if (stream.match(/media[\w-\s]*[\w-]/)) { - indent(state); - } else if(stream.eatWhile(/[\w-]/)) { - if(stream.current().match(commonDefRegexp)) { - indent(state); - } - } - return "def"; - } - - // Number - if (stream.match(/^-?[0-9\.]/, false)) { - - // Floats - if (stream.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i) || stream.match(/^-?\d+\.\d*/)) { - - // Prevent from getting extra . on 1.. - if (stream.peek() == ".") { - stream.backUp(1); - } - // Units - stream.eatWhile(/[a-z%]/i); - return "number"; - } - // Integers - if (stream.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/) || stream.match(/^-?0(?![\dx])/i)) { - // Units - stream.eatWhile(/[a-z%]/i); - return "number"; - } - } - - // Hex color and id selector - if (ch === "#") { - stream.next(); - - // Hex color - if (stream.match(/^[0-9a-f]{6}|[0-9a-f]{3}/i)) { - return "atom"; - } - - // ID selector - if (stream.match(/^[\w-]+/i)) { - indent(state); - return "builtin"; - } - } - - // Vendor prefixes - if (stream.match(vendorPrefixesRegexp)) { - return "meta"; - } - - // Gradients and animation as CSS value - if (stream.match(cssValuesWithBracketsRegexp)) { - return "atom"; - } - - // Mixins / Functions with indentation - if (stream.sol() && stream.match(/^\.?[a-z][\w-]*\(/i)) { - stream.backUp(1); - indent(state); - return "keyword"; - } - - // Mixins / Functions - if (stream.match(/^\.?[a-z][\w-]*\(/i)) { - stream.backUp(1); - return "keyword"; - } - - // +Block mixins - if (stream.match(/^(\+|\-)[a-z][\w-]+\(/i)) { - stream.backUp(1); - indent(state); - return "keyword"; - } - - // url tokens - if (stream.match(/^url/) && stream.peek() === "(") { - state.tokenizer = urlTokens; - if(!stream.peek()) { - state.cursorHalf = 0; - } - return "atom"; - } - - // Class - if (stream.match(/^\.[a-z][\w-]*/i)) { - indent(state); - return "qualifier"; - } - - // & Parent Reference with BEM naming - if (stream.match(/^(_|__|-|--)[a-z0-9-]+/)) { - return "qualifier"; - } - - // Pseudo elements/classes - if (ch == ':' && stream.match(/^::?[\w-]+/)) { - indent(state); - return "variable-3"; - } - - // Conditionals - if (stream.match(wordRegexp(["for", "if", "else", "unless"]))) { - indent(state); - return "keyword"; - } - - // Keywords - if (stream.match(commonKeywordsRegexp)) { - return "keyword"; - } - - // Atoms - if (stream.match(commonAtomsRegexp)) { - return "atom"; - } - - // Variables - if (stream.match(/^\$?[a-z][\w-]+\s?=(\s|[\w-'"\$])/i)) { - stream.backUp(2); - var cssPropertie = stream.current().toLowerCase().match(/[\w-]+/)[0]; - return cssProperties[cssPropertie] === undefined ? "variable-2" : "property"; - } else if (stream.match(/\$[\w-\.]+/i)) { - return "variable-2"; - } else if (stream.match(/\$?[\w-]+\.[\w-]+/i)) { - var cssTypeSelector = stream.current().toLowerCase().match(/[\w]+/)[0]; - if(cssTypeSelectors[cssTypeSelector] === undefined) { - return "variable-2"; - } else stream.backUp(stream.current().length); - } - - // !important - if (ch === "!") { - stream.next(); - return stream.match(/^[\w]+/) ? "keyword": "operator"; - } - - // / Root Reference - if (stream.match(/^\/(:|\.|#|[a-z])/)) { - stream.backUp(1); - return "variable-3"; - } - - // Operators and delimiters - if (stream.match(operatorsRegexp) || stream.match(wordOperatorsRegexp)) { - return "operator"; - } - if (stream.match(delimitersRegexp)) { - return null; - } - - // & Parent Reference - if (ch === "&") { - stream.next(); - return "variable-3"; - } - - // Font family - if (stream.match(/^[A-Z][a-z0-9-]+/)) { - return "string"; - } - - // CSS rule - // NOTE: Some css selectors and property values have the same name - // (embed, menu, pre, progress, sub, table), - // so they will have the same color (.cm-atom). - if (stream.match(/[\w-]*/i)) { - - var word = stream.current().toLowerCase(); - - if(cssProperties[word] !== undefined) { - // CSS property - if(!stream.eol()) - return "property"; - else - return "variable-2"; - - } else if(cssValues[word] !== undefined) { - // CSS value - return "atom"; - - } else if(cssTypeSelectors[word] !== undefined) { - // CSS type selectors - indent(state); - return "tag"; - - } else if(word) { - // By default variable-2 - return "variable-2"; - } - } - - // Handle non-detected items - stream.next(); - return null; - - }; - - var tokenLexer = function(stream, state) { - - if (stream.sol()) { - state.indentCount = 0; - } - - var style = state.tokenizer(stream, state); - var current = stream.current(); - - if (stream.eol() && (current === "}" || current === ",")) { - dedent(state); - } - - if (style !== null) { - var startOfToken = stream.pos - current.length; - var withCurrentIndent = startOfToken + (config.indentUnit * state.indentCount); - - var newScopes = []; - - for (var i = 0; i < state.scopes.length; i++) { - var scope = state.scopes[i]; - - if (scope.offset <= withCurrentIndent) { - newScopes.push(scope); - } - } - - state.scopes = newScopes; - } - - return style; - }; - - return { - startState: function() { - return { - tokenizer: tokenBase, - scopes: [{offset: 0, type: 'styl'}] - }; - }, - - token: function(stream, state) { - var style = tokenLexer(stream, state); - state.lastToken = { style: style, content: stream.current() }; - return style; - }, - - indent: function(state) { - return state.scopes[0].offset; - }, - - lineComment: "//", - fold: "indent" - - }; - - function urlTokens(stream, state) { - var ch = stream.peek(); - - if (ch === ")") { - stream.next(); - state.tokenizer = tokenBase; - return "operator"; - } else if (ch === "(") { - stream.next(); - stream.eatSpace(); - - return "operator"; - } else if (ch === "'" || ch === '"') { - state.tokenizer = buildStringTokenizer(stream.next()); - return "string"; - } else { - state.tokenizer = buildStringTokenizer(")", false); - return "string"; - } - } - - function multilineComment(stream, state) { - if (stream.skipTo("*/")) { - stream.next(); - stream.next(); - state.tokenizer = tokenBase; - } else { - stream.next(); - } - return "comment"; - } - - function buildStringTokenizer(quote, greedy) { - - if(greedy == null) { - greedy = true; - } - - function stringTokenizer(stream, state) { - var nextChar = stream.next(); - var peekChar = stream.peek(); - var previousChar = stream.string.charAt(stream.pos-2); - - var endingString = ((nextChar !== "\\" && peekChar === quote) || - (nextChar === quote && previousChar !== "\\")); - - if (endingString) { - if (nextChar !== quote && greedy) { - stream.next(); - } - state.tokenizer = tokenBase; - return "string"; - } else if (nextChar === "#" && peekChar === "{") { - state.tokenizer = buildInterpolationTokenizer(stringTokenizer); - stream.next(); - return "operator"; - } else { - return "string"; - } - } - - return stringTokenizer; - } - - function buildInterpolationTokenizer(currentTokenizer) { - return function(stream, state) { - if (stream.peek() === "}") { - stream.next(); - state.tokenizer = currentTokenizer; - return "operator"; - } else { - return tokenBase(stream, state); - } - }; - } - - function indent(state) { - if (state.indentCount == 0) { - state.indentCount++; - var lastScopeOffset = state.scopes[0].offset; - var currentOffset = lastScopeOffset + config.indentUnit; - state.scopes.unshift({ offset:currentOffset }); - } - } - - function dedent(state) { - if (state.scopes.length == 1) { return true; } - state.scopes.shift(); - } - - }); - - // https://developer.mozilla.org/en-US/docs/Web/HTML/Element - var cssTypeSelectors_ = ["a","abbr","address","area","article","aside","audio", "b", "base","bdi","bdo","bgsound","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","nobr","noframes","noscript","object","ol","optgroup","option","output","p","param","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]; - // https://github.com/csscomb/csscomb.js/blob/master/config/zen.json - var cssProperties_ = ["position","top","right","bottom","left","z-index","display","visibility","flex-direction","flex-order","flex-pack","float","clear","flex-align","overflow","overflow-x","overflow-y","overflow-scrolling","clip","box-sizing","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","min-width","min-height","max-width","max-height","width","height","outline","outline-width","outline-style","outline-color","outline-offset","border","border-spacing","border-collapse","border-width","border-style","border-color","border-top","border-top-width","border-top-style","border-top-color","border-right","border-right-width","border-right-style","border-right-color","border-bottom","border-bottom-width","border-bottom-style","border-bottom-color","border-left","border-left-width","border-left-style","border-left-color","border-radius","border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius","border-image","border-image-source","border-image-slice","border-image-width","border-image-outset","border-image-repeat","border-top-image","border-right-image","border-bottom-image","border-left-image","border-corner-image","border-top-left-image","border-top-right-image","border-bottom-right-image","border-bottom-left-image","background","filter:progid:DXImageTransform\\.Microsoft\\.AlphaImageLoader","background-color","background-image","background-attachment","background-position","background-position-x","background-position-y","background-clip","background-origin","background-size","background-repeat","box-decoration-break","box-shadow","color","table-layout","caption-side","empty-cells","list-style","list-style-position","list-style-type","list-style-image","quotes","content","counter-increment","counter-reset","writing-mode","vertical-align","text-align","text-align-last","text-decoration","text-emphasis","text-emphasis-position","text-emphasis-style","text-emphasis-color","text-indent","-ms-text-justify","text-justify","text-outline","text-transform","text-wrap","text-overflow","text-overflow-ellipsis","text-overflow-mode","text-size-adjust","text-shadow","white-space","word-spacing","word-wrap","word-break","tab-size","hyphens","letter-spacing","font","font-weight","font-style","font-variant","font-size-adjust","font-stretch","font-size","font-family","src","line-height","opacity","filter:\\\\\\\\'progid:DXImageTransform.Microsoft.Alpha","filter:progid:DXImageTransform.Microsoft.Alpha\\(Opacity","interpolation-mode","filter","resize","cursor","nav-index","nav-up","nav-right","nav-down","nav-left","transition","transition-delay","transition-timing-function","transition-duration","transition-property","transform","transform-origin","animation","animation-name","animation-duration","animation-play-state","animation-timing-function","animation-delay","animation-iteration-count","animation-direction","pointer-events","unicode-bidi","direction","columns","column-span","column-width","column-count","column-fill","column-gap","column-rule","column-rule-width","column-rule-style","column-rule-color","break-before","break-inside","break-after","page-break-before","page-break-inside","page-break-after","orphans","widows","zoom","max-zoom","min-zoom","user-zoom","orientation","text-rendering","speak","animation-fill-mode","backface-visibility","user-drag","user-select","appearance"]; - // https://github.com/codemirror/CodeMirror/blob/master/mode/css/css.js#L501 - var cssValues_ = ["above","absolute","activeborder","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","cambodian","capitalize","caps-lock-indicator","captiontext","caret","cell","center","checkbox","circle","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","cover","crop","cross","crosshair","currentcolor","cursive","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ew-resize","expanded","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-table","inset","inside","intrinsic","invert","italic","justify","kannada","katakana","katakana-iroha","keep-all","khmer","landscape","lao","large","larger","left","level","lighter","line-through","linear","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","single","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","telugu","text","text-bottom","text-top","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","x-large","x-small","xor","xx-large","xx-small","bicubic","optimizespeed","grayscale"]; - var cssColorValues_ = ["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]; - var cssValuesWithBrackets_ = ["gradient","linear-gradient","radial-gradient","repeating-linear-gradient","repeating-radial-gradient","cubic-bezier","translateX","translateY","translate3d","rotate3d","scale","scale3d","perspective","skewX"]; - - var wordOperators = ["in", "and", "or", "not", "is a", "is", "isnt", "defined", "if unless"], - commonKeywords = ["for", "if", "else", "unless", "return"], - commonAtoms = ["null", "true", "false", "href", "title", "type", "not-allowed", "readonly", "disabled"], - commonDef = ["@font-face", "@keyframes", "@media", "@viewport", "@page", "@host", "@supports", "@block", "@css"], - cssTypeSelectors = keySet(cssTypeSelectors_), - cssProperties = keySet(cssProperties_), - cssValues = keySet(cssValues_.concat(cssColorValues_)), - hintWords = wordOperators.concat(commonKeywords, - commonAtoms, - commonDef, - cssTypeSelectors_, - cssProperties_, - cssValues_, - cssValuesWithBrackets_, - cssColorValues_); - - function wordRegexp(words) { - return new RegExp("^((" + words.join(")|(") + "))\\b"); - }; - - function keySet(array) { - var keys = {}; - for (var i = 0; i < array.length; ++i) { - keys[array[i]] = true; - } - return keys; - }; - - CodeMirror.registerHelper("hintWords", "stylus", hintWords); - CodeMirror.defineMIME("text/x-styl", "stylus"); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/tcl/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/tcl/index.html deleted file mode 100644 index ce4ad34..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/tcl/index.html +++ /dev/null @@ -1,142 +0,0 @@ - - -CodeMirror: Tcl mode - - - - - - - - - - -
        -

        Tcl mode

        -
        - - -

        MIME types defined: text/x-tcl.

        - -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/tcl/tcl.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/tcl/tcl.js deleted file mode 100644 index 056accb..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/tcl/tcl.js +++ /dev/null @@ -1,147 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -//tcl mode by Ford_Lawnmower :: Based on Velocity mode by Steve O'Hara - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("tcl", function() { - function parseWords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - var keywords = parseWords("Tcl safe after append array auto_execok auto_import auto_load " + - "auto_mkindex auto_mkindex_old auto_qualify auto_reset bgerror " + - "binary break catch cd close concat continue dde eof encoding error " + - "eval exec exit expr fblocked fconfigure fcopy file fileevent filename " + - "filename flush for foreach format gets glob global history http if " + - "incr info interp join lappend lindex linsert list llength load lrange " + - "lreplace lsearch lset lsort memory msgcat namespace open package parray " + - "pid pkg::create pkg_mkIndex proc puts pwd re_syntax read regex regexp " + - "registry regsub rename resource return scan seek set socket source split " + - "string subst switch tcl_endOfWord tcl_findLibrary tcl_startOfNextWord " + - "tcl_wordBreakAfter tcl_startOfPreviousWord tcl_wordBreakBefore tcltest " + - "tclvars tell time trace unknown unset update uplevel upvar variable " + - "vwait"); - var functions = parseWords("if elseif else and not or eq ne in ni for foreach while switch"); - var isOperatorChar = /[+\-*&%=<>!?^\/\|]/; - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - function tokenBase(stream, state) { - var beforeParams = state.beforeParams; - state.beforeParams = false; - var ch = stream.next(); - if ((ch == '"' || ch == "'") && state.inParams) - return chain(stream, state, tokenString(ch)); - else if (/[\[\]{}\(\),;\.]/.test(ch)) { - if (ch == "(" && beforeParams) state.inParams = true; - else if (ch == ")") state.inParams = false; - return null; - } - else if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return "number"; - } - else if (ch == "#" && stream.eat("*")) { - return chain(stream, state, tokenComment); - } - else if (ch == "#" && stream.match(/ *\[ *\[/)) { - return chain(stream, state, tokenUnparsed); - } - else if (ch == "#" && stream.eat("#")) { - stream.skipToEnd(); - return "comment"; - } - else if (ch == '"') { - stream.skipTo(/"/); - return "comment"; - } - else if (ch == "$") { - stream.eatWhile(/[$_a-z0-9A-Z\.{:]/); - stream.eatWhile(/}/); - state.beforeParams = true; - return "builtin"; - } - else if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "comment"; - } - else { - stream.eatWhile(/[\w\$_{}\xa1-\uffff]/); - var word = stream.current().toLowerCase(); - if (keywords && keywords.propertyIsEnumerable(word)) - return "keyword"; - if (functions && functions.propertyIsEnumerable(word)) { - state.beforeParams = true; - return "keyword"; - } - return null; - } - } - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) { - end = true; - break; - } - escaped = !escaped && next == "\\"; - } - if (end) state.tokenize = tokenBase; - return "string"; - }; - } - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "#" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - function tokenUnparsed(stream, state) { - var maybeEnd = 0, ch; - while (ch = stream.next()) { - if (ch == "#" && maybeEnd == 2) { - state.tokenize = tokenBase; - break; - } - if (ch == "]") - maybeEnd++; - else if (ch != " ") - maybeEnd = 0; - } - return "meta"; - } - return { - startState: function() { - return { - tokenize: tokenBase, - beforeParams: false, - inParams: false - }; - }, - token: function(stream, state) { - if (stream.eatSpace()) return null; - return state.tokenize(stream, state); - } - }; -}); -CodeMirror.defineMIME("text/x-tcl", "tcl"); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/textile/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/textile/index.html deleted file mode 100644 index 42b156b..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/textile/index.html +++ /dev/null @@ -1,191 +0,0 @@ - - -CodeMirror: Textile mode - - - - - - - - - -
        -

        Textile mode

        -
        - - -

        MIME types defined: text/x-textile.

        - -

        Parsing/Highlighting Tests: normal, verbose.

        - -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/textile/test.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/textile/test.js deleted file mode 100644 index 49cdaf9..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/textile/test.js +++ /dev/null @@ -1,417 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({tabSize: 4}, 'textile'); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - MT('simpleParagraphs', - 'Some text.', - '', - 'Some more text.'); - - /* - * Phrase Modifiers - */ - - MT('em', - 'foo [em _bar_]'); - - MT('emBoogus', - 'code_mirror'); - - MT('strong', - 'foo [strong *bar*]'); - - MT('strongBogus', - '3 * 3 = 9'); - - MT('italic', - 'foo [em __bar__]'); - - MT('italicBogus', - 'code__mirror'); - - MT('bold', - 'foo [strong **bar**]'); - - MT('boldBogus', - '3 ** 3 = 27'); - - MT('simpleLink', - '[link "CodeMirror":http://codemirror.net]'); - - MT('referenceLink', - '[link "CodeMirror":code_mirror]', - 'Normal Text.', - '[link [[code_mirror]]http://codemirror.net]'); - - MT('footCite', - 'foo bar[qualifier [[1]]]'); - - MT('footCiteBogus', - 'foo bar[[1a2]]'); - - MT('special-characters', - 'Registered [tag (r)], ' + - 'Trademark [tag (tm)], and ' + - 'Copyright [tag (c)] 2008'); - - MT('cite', - "A book is [keyword ??The Count of Monte Cristo??] by Dumas."); - - MT('additionAndDeletion', - 'The news networks declared [negative -Al Gore-] ' + - '[positive +George W. Bush+] the winner in Florida.'); - - MT('subAndSup', - 'f(x, n) = log [builtin ~4~] x [builtin ^n^]'); - - MT('spanAndCode', - 'A [quote %span element%] and [atom @code element@]'); - - MT('spanBogus', - 'Percentage 25% is not a span.'); - - MT('citeBogus', - 'Question? is not a citation.'); - - MT('codeBogus', - 'user@example.com'); - - MT('subBogus', - '~username'); - - MT('supBogus', - 'foo ^ bar'); - - MT('deletionBogus', - '3 - 3 = 0'); - - MT('additionBogus', - '3 + 3 = 6'); - - MT('image', - 'An image: [string !http://www.example.com/image.png!]'); - - MT('imageWithAltText', - 'An image: [string !http://www.example.com/image.png (Alt Text)!]'); - - MT('imageWithUrl', - 'An image: [string !http://www.example.com/image.png!:http://www.example.com/]'); - - /* - * Headers - */ - - MT('h1', - '[header&header-1 h1. foo]'); - - MT('h2', - '[header&header-2 h2. foo]'); - - MT('h3', - '[header&header-3 h3. foo]'); - - MT('h4', - '[header&header-4 h4. foo]'); - - MT('h5', - '[header&header-5 h5. foo]'); - - MT('h6', - '[header&header-6 h6. foo]'); - - MT('h7Bogus', - 'h7. foo'); - - MT('multipleHeaders', - '[header&header-1 h1. Heading 1]', - '', - 'Some text.', - '', - '[header&header-2 h2. Heading 2]', - '', - 'More text.'); - - MT('h1inline', - '[header&header-1 h1. foo ][header&header-1&em _bar_][header&header-1 baz]'); - - /* - * Lists - */ - - MT('ul', - 'foo', - 'bar', - '', - '[variable-2 * foo]', - '[variable-2 * bar]'); - - MT('ulNoBlank', - 'foo', - 'bar', - '[variable-2 * foo]', - '[variable-2 * bar]'); - - MT('ol', - 'foo', - 'bar', - '', - '[variable-2 # foo]', - '[variable-2 # bar]'); - - MT('olNoBlank', - 'foo', - 'bar', - '[variable-2 # foo]', - '[variable-2 # bar]'); - - MT('ulFormatting', - '[variable-2 * ][variable-2&em _foo_][variable-2 bar]', - '[variable-2 * ][variable-2&strong *][variable-2&em&strong _foo_]' + - '[variable-2&strong *][variable-2 bar]', - '[variable-2 * ][variable-2&strong *foo*][variable-2 bar]'); - - MT('olFormatting', - '[variable-2 # ][variable-2&em _foo_][variable-2 bar]', - '[variable-2 # ][variable-2&strong *][variable-2&em&strong _foo_]' + - '[variable-2&strong *][variable-2 bar]', - '[variable-2 # ][variable-2&strong *foo*][variable-2 bar]'); - - MT('ulNested', - '[variable-2 * foo]', - '[variable-3 ** bar]', - '[keyword *** bar]', - '[variable-2 **** bar]', - '[variable-3 ** bar]'); - - MT('olNested', - '[variable-2 # foo]', - '[variable-3 ## bar]', - '[keyword ### bar]', - '[variable-2 #### bar]', - '[variable-3 ## bar]'); - - MT('ulNestedWithOl', - '[variable-2 * foo]', - '[variable-3 ## bar]', - '[keyword *** bar]', - '[variable-2 #### bar]', - '[variable-3 ** bar]'); - - MT('olNestedWithUl', - '[variable-2 # foo]', - '[variable-3 ** bar]', - '[keyword ### bar]', - '[variable-2 **** bar]', - '[variable-3 ## bar]'); - - MT('definitionList', - '[number - coffee := Hot ][number&em _and_][number black]', - '', - 'Normal text.'); - - MT('definitionListSpan', - '[number - coffee :=]', - '', - '[number Hot ][number&em _and_][number black =:]', - '', - 'Normal text.'); - - MT('boo', - '[number - dog := woof woof]', - '[number - cat := meow meow]', - '[number - whale :=]', - '[number Whale noises.]', - '', - '[number Also, ][number&em _splashing_][number . =:]'); - - /* - * Attributes - */ - - MT('divWithAttribute', - '[punctuation div][punctuation&attribute (#my-id)][punctuation . foo bar]'); - - MT('divWithAttributeAnd2emRightPadding', - '[punctuation div][punctuation&attribute (#my-id)((][punctuation . foo bar]'); - - MT('divWithClassAndId', - '[punctuation div][punctuation&attribute (my-class#my-id)][punctuation . foo bar]'); - - MT('paragraphWithCss', - 'p[attribute {color:red;}]. foo bar'); - - MT('paragraphNestedStyles', - 'p. [strong *foo ][strong&em _bar_][strong *]'); - - MT('paragraphWithLanguage', - 'p[attribute [[fr]]]. Parlez-vous français?'); - - MT('paragraphLeftAlign', - 'p[attribute <]. Left'); - - MT('paragraphRightAlign', - 'p[attribute >]. Right'); - - MT('paragraphRightAlign', - 'p[attribute =]. Center'); - - MT('paragraphJustified', - 'p[attribute <>]. Justified'); - - MT('paragraphWithLeftIndent1em', - 'p[attribute (]. Left'); - - MT('paragraphWithRightIndent1em', - 'p[attribute )]. Right'); - - MT('paragraphWithLeftIndent2em', - 'p[attribute ((]. Left'); - - MT('paragraphWithRightIndent2em', - 'p[attribute ))]. Right'); - - MT('paragraphWithLeftIndent3emRightIndent2em', - 'p[attribute ((())]. Right'); - - MT('divFormatting', - '[punctuation div. ][punctuation&strong *foo ]' + - '[punctuation&strong&em _bar_][punctuation&strong *]'); - - MT('phraseModifierAttributes', - 'p[attribute (my-class)]. This is a paragraph that has a class and' + - ' this [em _][em&attribute (#special-phrase)][em emphasized phrase_]' + - ' has an id.'); - - MT('linkWithClass', - '[link "(my-class). This is a link with class":http://redcloth.org]'); - - /* - * Layouts - */ - - MT('paragraphLayouts', - 'p. This is one paragraph.', - '', - 'p. This is another.'); - - MT('div', - '[punctuation div. foo bar]'); - - MT('pre', - '[operator pre. Text]'); - - MT('bq.', - '[bracket bq. foo bar]', - '', - 'Normal text.'); - - MT('footnote', - '[variable fn123. foo ][variable&strong *bar*]'); - - /* - * Spanning Layouts - */ - - MT('bq..ThenParagraph', - '[bracket bq.. foo bar]', - '', - '[bracket More quote.]', - 'p. Normal Text'); - - MT('bq..ThenH1', - '[bracket bq.. foo bar]', - '', - '[bracket More quote.]', - '[header&header-1 h1. Header Text]'); - - MT('bc..ThenParagraph', - '[atom bc.. # Some ruby code]', - '[atom obj = {foo: :bar}]', - '[atom puts obj]', - '', - '[atom obj[[:love]] = "*love*"]', - '[atom puts obj.love.upcase]', - '', - 'p. Normal text.'); - - MT('fn1..ThenParagraph', - '[variable fn1.. foo bar]', - '', - '[variable More.]', - 'p. Normal Text'); - - MT('pre..ThenParagraph', - '[operator pre.. foo bar]', - '', - '[operator More.]', - 'p. Normal Text'); - - /* - * Tables - */ - - MT('table', - '[variable-3&operator |_. name |_. age|]', - '[variable-3 |][variable-3&strong *Walter*][variable-3 | 5 |]', - '[variable-3 |Florence| 6 |]', - '', - 'p. Normal text.'); - - MT('tableWithAttributes', - '[variable-3&operator |_. name |_. age|]', - '[variable-3 |][variable-3&attribute /2.][variable-3 Jim |]', - '[variable-3 |][variable-3&attribute \\2{color: red}.][variable-3 Sam |]'); - - /* - * HTML - */ - - MT('html', - '[comment
        ]', - '[comment
        ]', - '', - '[header&header-1 h1. Welcome]', - '', - '[variable-2 * Item one]', - '[variable-2 * Item two]', - '', - '[comment Example]', - '', - '[comment
        ]', - '[comment
        ]'); - - MT('inlineHtml', - 'I can use HTML directly in my [comment Textile].'); - - /* - * No-Textile - */ - - MT('notextile', - '[string-2 notextile. *No* formatting]'); - - MT('notextileInline', - 'Use [string-2 ==*asterisks*==] for [strong *strong*] text.'); - - MT('notextileWithPre', - '[operator pre. *No* formatting]'); - - MT('notextileWithSpanningPre', - '[operator pre.. *No* formatting]', - '', - '[operator *No* formatting]'); - - /* Only toggling phrases between non-word chars. */ - - MT('phrase-in-word', - 'foo_bar_baz'); - - MT('phrase-non-word', - '[negative -x-] aaa-bbb ccc-ddd [negative -eee-] fff [negative -ggg-]'); - - MT('phrase-lone-dash', - 'foo - bar - baz'); -})(); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/textile/textile.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/textile/textile.js deleted file mode 100644 index a6f7576..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/textile/textile.js +++ /dev/null @@ -1,469 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") { // CommonJS - mod(require("../../lib/codemirror")); - } else if (typeof define == "function" && define.amd) { // AMD - define(["../../lib/codemirror"], mod); - } else { // Plain browser env - mod(CodeMirror); - } -})(function(CodeMirror) { - "use strict"; - - var TOKEN_STYLES = { - addition: "positive", - attributes: "attribute", - bold: "strong", - cite: "keyword", - code: "atom", - definitionList: "number", - deletion: "negative", - div: "punctuation", - em: "em", - footnote: "variable", - footCite: "qualifier", - header: "header", - html: "comment", - image: "string", - italic: "em", - link: "link", - linkDefinition: "link", - list1: "variable-2", - list2: "variable-3", - list3: "keyword", - notextile: "string-2", - pre: "operator", - p: "property", - quote: "bracket", - span: "quote", - specialChar: "tag", - strong: "strong", - sub: "builtin", - sup: "builtin", - table: "variable-3", - tableHeading: "operator" - }; - - function startNewLine(stream, state) { - state.mode = Modes.newLayout; - state.tableHeading = false; - - if (state.layoutType === "definitionList" && state.spanningLayout && - stream.match(RE("definitionListEnd"), false)) - state.spanningLayout = false; - } - - function handlePhraseModifier(stream, state, ch) { - if (ch === "_") { - if (stream.eat("_")) - return togglePhraseModifier(stream, state, "italic", /__/, 2); - else - return togglePhraseModifier(stream, state, "em", /_/, 1); - } - - if (ch === "*") { - if (stream.eat("*")) { - return togglePhraseModifier(stream, state, "bold", /\*\*/, 2); - } - return togglePhraseModifier(stream, state, "strong", /\*/, 1); - } - - if (ch === "[") { - if (stream.match(/\d+\]/)) state.footCite = true; - return tokenStyles(state); - } - - if (ch === "(") { - var spec = stream.match(/^(r|tm|c)\)/); - if (spec) - return tokenStylesWith(state, TOKEN_STYLES.specialChar); - } - - if (ch === "<" && stream.match(/(\w+)[^>]+>[^<]+<\/\1>/)) - return tokenStylesWith(state, TOKEN_STYLES.html); - - if (ch === "?" && stream.eat("?")) - return togglePhraseModifier(stream, state, "cite", /\?\?/, 2); - - if (ch === "=" && stream.eat("=")) - return togglePhraseModifier(stream, state, "notextile", /==/, 2); - - if (ch === "-" && !stream.eat("-")) - return togglePhraseModifier(stream, state, "deletion", /-/, 1); - - if (ch === "+") - return togglePhraseModifier(stream, state, "addition", /\+/, 1); - - if (ch === "~") - return togglePhraseModifier(stream, state, "sub", /~/, 1); - - if (ch === "^") - return togglePhraseModifier(stream, state, "sup", /\^/, 1); - - if (ch === "%") - return togglePhraseModifier(stream, state, "span", /%/, 1); - - if (ch === "@") - return togglePhraseModifier(stream, state, "code", /@/, 1); - - if (ch === "!") { - var type = togglePhraseModifier(stream, state, "image", /(?:\([^\)]+\))?!/, 1); - stream.match(/^:\S+/); // optional Url portion - return type; - } - return tokenStyles(state); - } - - function togglePhraseModifier(stream, state, phraseModifier, closeRE, openSize) { - var charBefore = stream.pos > openSize ? stream.string.charAt(stream.pos - openSize - 1) : null; - var charAfter = stream.peek(); - if (state[phraseModifier]) { - if ((!charAfter || /\W/.test(charAfter)) && charBefore && /\S/.test(charBefore)) { - var type = tokenStyles(state); - state[phraseModifier] = false; - return type; - } - } else if ((!charBefore || /\W/.test(charBefore)) && charAfter && /\S/.test(charAfter) && - stream.match(new RegExp("^.*\\S" + closeRE.source + "(?:\\W|$)"), false)) { - state[phraseModifier] = true; - state.mode = Modes.attributes; - } - return tokenStyles(state); - }; - - function tokenStyles(state) { - var disabled = textileDisabled(state); - if (disabled) return disabled; - - var styles = []; - if (state.layoutType) styles.push(TOKEN_STYLES[state.layoutType]); - - styles = styles.concat(activeStyles( - state, "addition", "bold", "cite", "code", "deletion", "em", "footCite", - "image", "italic", "link", "span", "strong", "sub", "sup", "table", "tableHeading")); - - if (state.layoutType === "header") - styles.push(TOKEN_STYLES.header + "-" + state.header); - - return styles.length ? styles.join(" ") : null; - } - - function textileDisabled(state) { - var type = state.layoutType; - - switch(type) { - case "notextile": - case "code": - case "pre": - return TOKEN_STYLES[type]; - default: - if (state.notextile) - return TOKEN_STYLES.notextile + (type ? (" " + TOKEN_STYLES[type]) : ""); - return null; - } - } - - function tokenStylesWith(state, extraStyles) { - var disabled = textileDisabled(state); - if (disabled) return disabled; - - var type = tokenStyles(state); - if (extraStyles) - return type ? (type + " " + extraStyles) : extraStyles; - else - return type; - } - - function activeStyles(state) { - var styles = []; - for (var i = 1; i < arguments.length; ++i) { - if (state[arguments[i]]) - styles.push(TOKEN_STYLES[arguments[i]]); - } - return styles; - } - - function blankLine(state) { - var spanningLayout = state.spanningLayout, type = state.layoutType; - - for (var key in state) if (state.hasOwnProperty(key)) - delete state[key]; - - state.mode = Modes.newLayout; - if (spanningLayout) { - state.layoutType = type; - state.spanningLayout = true; - } - } - - var REs = { - cache: {}, - single: { - bc: "bc", - bq: "bq", - definitionList: /- [^(?::=)]+:=+/, - definitionListEnd: /.*=:\s*$/, - div: "div", - drawTable: /\|.*\|/, - foot: /fn\d+/, - header: /h[1-6]/, - html: /\s*<(?:\/)?(\w+)(?:[^>]+)?>(?:[^<]+<\/\1>)?/, - link: /[^"]+":\S/, - linkDefinition: /\[[^\s\]]+\]\S+/, - list: /(?:#+|\*+)/, - notextile: "notextile", - para: "p", - pre: "pre", - table: "table", - tableCellAttributes: /[\/\\]\d+/, - tableHeading: /\|_\./, - tableText: /[^"_\*\[\(\?\+~\^%@|-]+/, - text: /[^!"_=\*\[\(<\?\+~\^%@-]+/ - }, - attributes: { - align: /(?:<>|<|>|=)/, - selector: /\([^\(][^\)]+\)/, - lang: /\[[^\[\]]+\]/, - pad: /(?:\(+|\)+){1,2}/, - css: /\{[^\}]+\}/ - }, - createRe: function(name) { - switch (name) { - case "drawTable": - return REs.makeRe("^", REs.single.drawTable, "$"); - case "html": - return REs.makeRe("^", REs.single.html, "(?:", REs.single.html, ")*", "$"); - case "linkDefinition": - return REs.makeRe("^", REs.single.linkDefinition, "$"); - case "listLayout": - return REs.makeRe("^", REs.single.list, RE("allAttributes"), "*\\s+"); - case "tableCellAttributes": - return REs.makeRe("^", REs.choiceRe(REs.single.tableCellAttributes, - RE("allAttributes")), "+\\."); - case "type": - return REs.makeRe("^", RE("allTypes")); - case "typeLayout": - return REs.makeRe("^", RE("allTypes"), RE("allAttributes"), - "*\\.\\.?", "(\\s+|$)"); - case "attributes": - return REs.makeRe("^", RE("allAttributes"), "+"); - - case "allTypes": - return REs.choiceRe(REs.single.div, REs.single.foot, - REs.single.header, REs.single.bc, REs.single.bq, - REs.single.notextile, REs.single.pre, REs.single.table, - REs.single.para); - - case "allAttributes": - return REs.choiceRe(REs.attributes.selector, REs.attributes.css, - REs.attributes.lang, REs.attributes.align, REs.attributes.pad); - - default: - return REs.makeRe("^", REs.single[name]); - } - }, - makeRe: function() { - var pattern = ""; - for (var i = 0; i < arguments.length; ++i) { - var arg = arguments[i]; - pattern += (typeof arg === "string") ? arg : arg.source; - } - return new RegExp(pattern); - }, - choiceRe: function() { - var parts = [arguments[0]]; - for (var i = 1; i < arguments.length; ++i) { - parts[i * 2 - 1] = "|"; - parts[i * 2] = arguments[i]; - } - - parts.unshift("(?:"); - parts.push(")"); - return REs.makeRe.apply(null, parts); - } - }; - - function RE(name) { - return (REs.cache[name] || (REs.cache[name] = REs.createRe(name))); - } - - var Modes = { - newLayout: function(stream, state) { - if (stream.match(RE("typeLayout"), false)) { - state.spanningLayout = false; - return (state.mode = Modes.blockType)(stream, state); - } - var newMode; - if (!textileDisabled(state)) { - if (stream.match(RE("listLayout"), false)) - newMode = Modes.list; - else if (stream.match(RE("drawTable"), false)) - newMode = Modes.table; - else if (stream.match(RE("linkDefinition"), false)) - newMode = Modes.linkDefinition; - else if (stream.match(RE("definitionList"))) - newMode = Modes.definitionList; - else if (stream.match(RE("html"), false)) - newMode = Modes.html; - } - return (state.mode = (newMode || Modes.text))(stream, state); - }, - - blockType: function(stream, state) { - var match, type; - state.layoutType = null; - - if (match = stream.match(RE("type"))) - type = match[0]; - else - return (state.mode = Modes.text)(stream, state); - - if (match = type.match(RE("header"))) { - state.layoutType = "header"; - state.header = parseInt(match[0][1]); - } else if (type.match(RE("bq"))) { - state.layoutType = "quote"; - } else if (type.match(RE("bc"))) { - state.layoutType = "code"; - } else if (type.match(RE("foot"))) { - state.layoutType = "footnote"; - } else if (type.match(RE("notextile"))) { - state.layoutType = "notextile"; - } else if (type.match(RE("pre"))) { - state.layoutType = "pre"; - } else if (type.match(RE("div"))) { - state.layoutType = "div"; - } else if (type.match(RE("table"))) { - state.layoutType = "table"; - } - - state.mode = Modes.attributes; - return tokenStyles(state); - }, - - text: function(stream, state) { - if (stream.match(RE("text"))) return tokenStyles(state); - - var ch = stream.next(); - if (ch === '"') - return (state.mode = Modes.link)(stream, state); - return handlePhraseModifier(stream, state, ch); - }, - - attributes: function(stream, state) { - state.mode = Modes.layoutLength; - - if (stream.match(RE("attributes"))) - return tokenStylesWith(state, TOKEN_STYLES.attributes); - else - return tokenStyles(state); - }, - - layoutLength: function(stream, state) { - if (stream.eat(".") && stream.eat(".")) - state.spanningLayout = true; - - state.mode = Modes.text; - return tokenStyles(state); - }, - - list: function(stream, state) { - var match = stream.match(RE("list")); - state.listDepth = match[0].length; - var listMod = (state.listDepth - 1) % 3; - if (!listMod) - state.layoutType = "list1"; - else if (listMod === 1) - state.layoutType = "list2"; - else - state.layoutType = "list3"; - - state.mode = Modes.attributes; - return tokenStyles(state); - }, - - link: function(stream, state) { - state.mode = Modes.text; - if (stream.match(RE("link"))) { - stream.match(/\S+/); - return tokenStylesWith(state, TOKEN_STYLES.link); - } - return tokenStyles(state); - }, - - linkDefinition: function(stream, state) { - stream.skipToEnd(); - return tokenStylesWith(state, TOKEN_STYLES.linkDefinition); - }, - - definitionList: function(stream, state) { - stream.match(RE("definitionList")); - - state.layoutType = "definitionList"; - - if (stream.match(/\s*$/)) - state.spanningLayout = true; - else - state.mode = Modes.attributes; - - return tokenStyles(state); - }, - - html: function(stream, state) { - stream.skipToEnd(); - return tokenStylesWith(state, TOKEN_STYLES.html); - }, - - table: function(stream, state) { - state.layoutType = "table"; - return (state.mode = Modes.tableCell)(stream, state); - }, - - tableCell: function(stream, state) { - if (stream.match(RE("tableHeading"))) - state.tableHeading = true; - else - stream.eat("|"); - - state.mode = Modes.tableCellAttributes; - return tokenStyles(state); - }, - - tableCellAttributes: function(stream, state) { - state.mode = Modes.tableText; - - if (stream.match(RE("tableCellAttributes"))) - return tokenStylesWith(state, TOKEN_STYLES.attributes); - else - return tokenStyles(state); - }, - - tableText: function(stream, state) { - if (stream.match(RE("tableText"))) - return tokenStyles(state); - - if (stream.peek() === "|") { // end of cell - state.mode = Modes.tableCell; - return tokenStyles(state); - } - return handlePhraseModifier(stream, state, stream.next()); - } - }; - - CodeMirror.defineMode("textile", function() { - return { - startState: function() { - return { mode: Modes.newLayout }; - }, - token: function(stream, state) { - if (stream.sol()) startNewLine(stream, state); - return state.mode(stream, state); - }, - blankLine: blankLine - }; - }); - - CodeMirror.defineMIME("text/x-textile", "textile"); -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/tiddlywiki/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/tiddlywiki/index.html deleted file mode 100644 index 77dd045..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/tiddlywiki/index.html +++ /dev/null @@ -1,154 +0,0 @@ - - -CodeMirror: TiddlyWiki mode - - - - - - - - - - - -
        -

        TiddlyWiki mode

        - - -
        - - - -

        TiddlyWiki mode supports a single configuration.

        - -

        MIME types defined: text/x-tiddlywiki.

        -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/tiddlywiki/tiddlywiki.css b/src/main/resources/static/editor.md-master/lib/codemirror/mode/tiddlywiki/tiddlywiki.css deleted file mode 100644 index 9a69b63..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/tiddlywiki/tiddlywiki.css +++ /dev/null @@ -1,14 +0,0 @@ -span.cm-underlined { - text-decoration: underline; -} -span.cm-strikethrough { - text-decoration: line-through; -} -span.cm-brace { - color: #170; - font-weight: bold; -} -span.cm-table { - color: blue; - font-weight: bold; -} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/tiddlywiki/tiddlywiki.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/tiddlywiki/tiddlywiki.js deleted file mode 100644 index 88c9768..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/tiddlywiki/tiddlywiki.js +++ /dev/null @@ -1,369 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/*** - |''Name''|tiddlywiki.js| - |''Description''|Enables TiddlyWikiy syntax highlighting using CodeMirror| - |''Author''|PMario| - |''Version''|0.1.7| - |''Status''|''stable''| - |''Source''|[[GitHub|https://github.com/pmario/CodeMirror2/blob/tw-syntax/mode/tiddlywiki]]| - |''Documentation''|http://codemirror.tiddlyspace.com/| - |''License''|[[MIT License|http://www.opensource.org/licenses/mit-license.php]]| - |''CoreVersion''|2.5.0| - |''Requires''|codemirror.js| - |''Keywords''|syntax highlighting color code mirror codemirror| - ! Info - CoreVersion parameter is needed for TiddlyWiki only! -***/ -//{{{ - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("tiddlywiki", function () { - // Tokenizer - var textwords = {}; - - var keywords = function () { - function kw(type) { - return { type: type, style: "macro"}; - } - return { - "allTags": kw('allTags'), "closeAll": kw('closeAll'), "list": kw('list'), - "newJournal": kw('newJournal'), "newTiddler": kw('newTiddler'), - "permaview": kw('permaview'), "saveChanges": kw('saveChanges'), - "search": kw('search'), "slider": kw('slider'), "tabs": kw('tabs'), - "tag": kw('tag'), "tagging": kw('tagging'), "tags": kw('tags'), - "tiddler": kw('tiddler'), "timeline": kw('timeline'), - "today": kw('today'), "version": kw('version'), "option": kw('option'), - - "with": kw('with'), - "filter": kw('filter') - }; - }(); - - var isSpaceName = /[\w_\-]/i, - reHR = /^\-\-\-\-+$/, //
        - reWikiCommentStart = /^\/\*\*\*$/, // /*** - reWikiCommentStop = /^\*\*\*\/$/, // ***/ - reBlockQuote = /^<<<$/, - - reJsCodeStart = /^\/\/\{\{\{$/, // //{{{ js block start - reJsCodeStop = /^\/\/\}\}\}$/, // //}}} js stop - reXmlCodeStart = /^$/, // xml block start - reXmlCodeStop = /^$/, // xml stop - - reCodeBlockStart = /^\{\{\{$/, // {{{ TW text div block start - reCodeBlockStop = /^\}\}\}$/, // }}} TW text stop - - reUntilCodeStop = /.*?\}\}\}/; - - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - - // Used as scratch variables to communicate multiple values without - // consing up tons of objects. - var type, content; - - function ret(tp, style, cont) { - type = tp; - content = cont; - return style; - } - - function jsTokenBase(stream, state) { - var sol = stream.sol(), ch; - - state.block = false; // indicates the start of a code block. - - ch = stream.peek(); // don't eat, to make matching simpler - - // check start of blocks - if (sol && /[<\/\*{}\-]/.test(ch)) { - if (stream.match(reCodeBlockStart)) { - state.block = true; - return chain(stream, state, twTokenCode); - } - if (stream.match(reBlockQuote)) { - return ret('quote', 'quote'); - } - if (stream.match(reWikiCommentStart) || stream.match(reWikiCommentStop)) { - return ret('code', 'comment'); - } - if (stream.match(reJsCodeStart) || stream.match(reJsCodeStop) || stream.match(reXmlCodeStart) || stream.match(reXmlCodeStop)) { - return ret('code', 'comment'); - } - if (stream.match(reHR)) { - return ret('hr', 'hr'); - } - } // sol - ch = stream.next(); - - if (sol && /[\/\*!#;:>|]/.test(ch)) { - if (ch == "!") { // tw header - stream.skipToEnd(); - return ret("header", "header"); - } - if (ch == "*") { // tw list - stream.eatWhile('*'); - return ret("list", "comment"); - } - if (ch == "#") { // tw numbered list - stream.eatWhile('#'); - return ret("list", "comment"); - } - if (ch == ";") { // definition list, term - stream.eatWhile(';'); - return ret("list", "comment"); - } - if (ch == ":") { // definition list, description - stream.eatWhile(':'); - return ret("list", "comment"); - } - if (ch == ">") { // single line quote - stream.eatWhile(">"); - return ret("quote", "quote"); - } - if (ch == '|') { - return ret('table', 'header'); - } - } - - if (ch == '{' && stream.match(/\{\{/)) { - return chain(stream, state, twTokenCode); - } - - // rudimentary html:// file:// link matching. TW knows much more ... - if (/[hf]/i.test(ch)) { - if (/[ti]/i.test(stream.peek()) && stream.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i)) { - return ret("link", "link"); - } - } - // just a little string indicator, don't want to have the whole string covered - if (ch == '"') { - return ret('string', 'string'); - } - if (ch == '~') { // _no_ CamelCase indicator should be bold - return ret('text', 'brace'); - } - if (/[\[\]]/.test(ch)) { // check for [[..]] - if (stream.peek() == ch) { - stream.next(); - return ret('brace', 'brace'); - } - } - if (ch == "@") { // check for space link. TODO fix @@...@@ highlighting - stream.eatWhile(isSpaceName); - return ret("link", "link"); - } - if (/\d/.test(ch)) { // numbers - stream.eatWhile(/\d/); - return ret("number", "number"); - } - if (ch == "/") { // tw invisible comment - if (stream.eat("%")) { - return chain(stream, state, twTokenComment); - } - else if (stream.eat("/")) { // - return chain(stream, state, twTokenEm); - } - } - if (ch == "_") { // tw underline - if (stream.eat("_")) { - return chain(stream, state, twTokenUnderline); - } - } - // strikethrough and mdash handling - if (ch == "-") { - if (stream.eat("-")) { - // if strikethrough looks ugly, change CSS. - if (stream.peek() != ' ') - return chain(stream, state, twTokenStrike); - // mdash - if (stream.peek() == ' ') - return ret('text', 'brace'); - } - } - if (ch == "'") { // tw bold - if (stream.eat("'")) { - return chain(stream, state, twTokenStrong); - } - } - if (ch == "<") { // tw macro - if (stream.eat("<")) { - return chain(stream, state, twTokenMacro); - } - } - else { - return ret(ch); - } - - // core macro handling - stream.eatWhile(/[\w\$_]/); - var word = stream.current(), - known = textwords.propertyIsEnumerable(word) && textwords[word]; - - return known ? ret(known.type, known.style, word) : ret("text", null, word); - - } // jsTokenBase() - - // tw invisible comment - function twTokenComment(stream, state) { - var maybeEnd = false, - ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = jsTokenBase; - break; - } - maybeEnd = (ch == "%"); - } - return ret("comment", "comment"); - } - - // tw strong / bold - function twTokenStrong(stream, state) { - var maybeEnd = false, - ch; - while (ch = stream.next()) { - if (ch == "'" && maybeEnd) { - state.tokenize = jsTokenBase; - break; - } - maybeEnd = (ch == "'"); - } - return ret("text", "strong"); - } - - // tw code - function twTokenCode(stream, state) { - var ch, sb = state.block; - - if (sb && stream.current()) { - return ret("code", "comment"); - } - - if (!sb && stream.match(reUntilCodeStop)) { - state.tokenize = jsTokenBase; - return ret("code", "comment"); - } - - if (sb && stream.sol() && stream.match(reCodeBlockStop)) { - state.tokenize = jsTokenBase; - return ret("code", "comment"); - } - - ch = stream.next(); - return (sb) ? ret("code", "comment") : ret("code", "comment"); - } - - // tw em / italic - function twTokenEm(stream, state) { - var maybeEnd = false, - ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = jsTokenBase; - break; - } - maybeEnd = (ch == "/"); - } - return ret("text", "em"); - } - - // tw underlined text - function twTokenUnderline(stream, state) { - var maybeEnd = false, - ch; - while (ch = stream.next()) { - if (ch == "_" && maybeEnd) { - state.tokenize = jsTokenBase; - break; - } - maybeEnd = (ch == "_"); - } - return ret("text", "underlined"); - } - - // tw strike through text looks ugly - // change CSS if needed - function twTokenStrike(stream, state) { - var maybeEnd = false, ch; - - while (ch = stream.next()) { - if (ch == "-" && maybeEnd) { - state.tokenize = jsTokenBase; - break; - } - maybeEnd = (ch == "-"); - } - return ret("text", "strikethrough"); - } - - // macro - function twTokenMacro(stream, state) { - var ch, word, known; - - if (stream.current() == '<<') { - return ret('brace', 'macro'); - } - - ch = stream.next(); - if (!ch) { - state.tokenize = jsTokenBase; - return ret(ch); - } - if (ch == ">") { - if (stream.peek() == '>') { - stream.next(); - state.tokenize = jsTokenBase; - return ret("brace", "macro"); - } - } - - stream.eatWhile(/[\w\$_]/); - word = stream.current(); - known = keywords.propertyIsEnumerable(word) && keywords[word]; - - if (known) { - return ret(known.type, known.style, word); - } - else { - return ret("macro", null, word); - } - } - - // Interface - return { - startState: function () { - return { - tokenize: jsTokenBase, - indented: 0, - level: 0 - }; - }, - - token: function (stream, state) { - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - return style; - }, - - electricChars: "" - }; -}); - -CodeMirror.defineMIME("text/x-tiddlywiki", "tiddlywiki"); -}); - -//}}} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/tiki/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/tiki/index.html deleted file mode 100644 index 091c5fb..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/tiki/index.html +++ /dev/null @@ -1,95 +0,0 @@ - - -CodeMirror: Tiki wiki mode - - - - - - - - - - -
        -

        Tiki wiki mode

        - - -
        - - - -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/tiki/tiki.css b/src/main/resources/static/editor.md-master/lib/codemirror/mode/tiki/tiki.css deleted file mode 100644 index 0dbc3ea..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/tiki/tiki.css +++ /dev/null @@ -1,26 +0,0 @@ -.cm-tw-syntaxerror { - color: #FFF; - background-color: #900; -} - -.cm-tw-deleted { - text-decoration: line-through; -} - -.cm-tw-header5 { - font-weight: bold; -} -.cm-tw-listitem:first-child { /*Added first child to fix duplicate padding when highlighting*/ - padding-left: 10px; -} - -.cm-tw-box { - border-top-width: 0px ! important; - border-style: solid; - border-width: 1px; - border-color: inherit; -} - -.cm-tw-underline { - text-decoration: underline; -} \ No newline at end of file diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/tiki/tiki.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/tiki/tiki.js deleted file mode 100644 index c90aac9..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/tiki/tiki.js +++ /dev/null @@ -1,323 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode('tiki', function(config) { - function inBlock(style, terminator, returnTokenizer) { - return function(stream, state) { - while (!stream.eol()) { - if (stream.match(terminator)) { - state.tokenize = inText; - break; - } - stream.next(); - } - - if (returnTokenizer) state.tokenize = returnTokenizer; - - return style; - }; - } - - function inLine(style) { - return function(stream, state) { - while(!stream.eol()) { - stream.next(); - } - state.tokenize = inText; - return style; - }; - } - - function inText(stream, state) { - function chain(parser) { - state.tokenize = parser; - return parser(stream, state); - } - - var sol = stream.sol(); - var ch = stream.next(); - - //non start of line - switch (ch) { //switch is generally much faster than if, so it is used here - case "{": //plugin - stream.eat("/"); - stream.eatSpace(); - var tagName = ""; - var c; - while ((c = stream.eat(/[^\s\u00a0=\"\'\/?(}]/))) tagName += c; - state.tokenize = inPlugin; - return "tag"; - break; - case "_": //bold - if (stream.eat("_")) { - return chain(inBlock("strong", "__", inText)); - } - break; - case "'": //italics - if (stream.eat("'")) { - // Italic text - return chain(inBlock("em", "''", inText)); - } - break; - case "(":// Wiki Link - if (stream.eat("(")) { - return chain(inBlock("variable-2", "))", inText)); - } - break; - case "[":// Weblink - return chain(inBlock("variable-3", "]", inText)); - break; - case "|": //table - if (stream.eat("|")) { - return chain(inBlock("comment", "||")); - } - break; - case "-": - if (stream.eat("=")) {//titleBar - return chain(inBlock("header string", "=-", inText)); - } else if (stream.eat("-")) {//deleted - return chain(inBlock("error tw-deleted", "--", inText)); - } - break; - case "=": //underline - if (stream.match("==")) { - return chain(inBlock("tw-underline", "===", inText)); - } - break; - case ":": - if (stream.eat(":")) { - return chain(inBlock("comment", "::")); - } - break; - case "^": //box - return chain(inBlock("tw-box", "^")); - break; - case "~": //np - if (stream.match("np~")) { - return chain(inBlock("meta", "~/np~")); - } - break; - } - - //start of line types - if (sol) { - switch (ch) { - case "!": //header at start of line - if (stream.match('!!!!!')) { - return chain(inLine("header string")); - } else if (stream.match('!!!!')) { - return chain(inLine("header string")); - } else if (stream.match('!!!')) { - return chain(inLine("header string")); - } else if (stream.match('!!')) { - return chain(inLine("header string")); - } else { - return chain(inLine("header string")); - } - break; - case "*": //unordered list line item, or
      • at start of line - case "#": //ordered list line item, or
      • at start of line - case "+": //ordered list line item, or
      • at start of line - return chain(inLine("tw-listitem bracket")); - break; - } - } - - //stream.eatWhile(/[&{]/); was eating up plugins, turned off to act less like html and more like tiki - return null; - } - - var indentUnit = config.indentUnit; - - // Return variables for tokenizers - var pluginName, type; - function inPlugin(stream, state) { - var ch = stream.next(); - var peek = stream.peek(); - - if (ch == "}") { - state.tokenize = inText; - //type = ch == ")" ? "endPlugin" : "selfclosePlugin"; inPlugin - return "tag"; - } else if (ch == "(" || ch == ")") { - return "bracket"; - } else if (ch == "=") { - type = "equals"; - - if (peek == ">") { - ch = stream.next(); - peek = stream.peek(); - } - - //here we detect values directly after equal character with no quotes - if (!/[\'\"]/.test(peek)) { - state.tokenize = inAttributeNoQuote(); - } - //end detect values - - return "operator"; - } else if (/[\'\"]/.test(ch)) { - state.tokenize = inAttribute(ch); - return state.tokenize(stream, state); - } else { - stream.eatWhile(/[^\s\u00a0=\"\'\/?]/); - return "keyword"; - } - } - - function inAttribute(quote) { - return function(stream, state) { - while (!stream.eol()) { - if (stream.next() == quote) { - state.tokenize = inPlugin; - break; - } - } - return "string"; - }; - } - - function inAttributeNoQuote() { - return function(stream, state) { - while (!stream.eol()) { - var ch = stream.next(); - var peek = stream.peek(); - if (ch == " " || ch == "," || /[ )}]/.test(peek)) { - state.tokenize = inPlugin; - break; - } - } - return "string"; -}; - } - -var curState, setStyle; -function pass() { - for (var i = arguments.length - 1; i >= 0; i--) curState.cc.push(arguments[i]); -} - -function cont() { - pass.apply(null, arguments); - return true; -} - -function pushContext(pluginName, startOfLine) { - var noIndent = curState.context && curState.context.noIndent; - curState.context = { - prev: curState.context, - pluginName: pluginName, - indent: curState.indented, - startOfLine: startOfLine, - noIndent: noIndent - }; -} - -function popContext() { - if (curState.context) curState.context = curState.context.prev; -} - -function element(type) { - if (type == "openPlugin") {curState.pluginName = pluginName; return cont(attributes, endplugin(curState.startOfLine));} - else if (type == "closePlugin") { - var err = false; - if (curState.context) { - err = curState.context.pluginName != pluginName; - popContext(); - } else { - err = true; - } - if (err) setStyle = "error"; - return cont(endcloseplugin(err)); - } - else if (type == "string") { - if (!curState.context || curState.context.name != "!cdata") pushContext("!cdata"); - if (curState.tokenize == inText) popContext(); - return cont(); - } - else return cont(); -} - -function endplugin(startOfLine) { - return function(type) { - if ( - type == "selfclosePlugin" || - type == "endPlugin" - ) - return cont(); - if (type == "endPlugin") {pushContext(curState.pluginName, startOfLine); return cont();} - return cont(); - }; -} - -function endcloseplugin(err) { - return function(type) { - if (err) setStyle = "error"; - if (type == "endPlugin") return cont(); - return pass(); - }; -} - -function attributes(type) { - if (type == "keyword") {setStyle = "attribute"; return cont(attributes);} - if (type == "equals") return cont(attvalue, attributes); - return pass(); -} -function attvalue(type) { - if (type == "keyword") {setStyle = "string"; return cont();} - if (type == "string") return cont(attvaluemaybe); - return pass(); -} -function attvaluemaybe(type) { - if (type == "string") return cont(attvaluemaybe); - else return pass(); -} -return { - startState: function() { - return {tokenize: inText, cc: [], indented: 0, startOfLine: true, pluginName: null, context: null}; - }, - token: function(stream, state) { - if (stream.sol()) { - state.startOfLine = true; - state.indented = stream.indentation(); - } - if (stream.eatSpace()) return null; - - setStyle = type = pluginName = null; - var style = state.tokenize(stream, state); - if ((style || type) && style != "comment") { - curState = state; - while (true) { - var comb = state.cc.pop() || element; - if (comb(type || style)) break; - } - } - state.startOfLine = false; - return setStyle || style; - }, - indent: function(state, textAfter) { - var context = state.context; - if (context && context.noIndent) return 0; - if (context && /^{\//.test(textAfter)) - context = context.prev; - while (context && !context.startOfLine) - context = context.prev; - if (context) return context.indent + indentUnit; - else return 0; - }, - electricChars: "/" - }; -}); - -CodeMirror.defineMIME("text/tiki", "tiki"); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/toml/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/toml/index.html deleted file mode 100644 index 90a2a02..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/toml/index.html +++ /dev/null @@ -1,73 +0,0 @@ - - -CodeMirror: TOML Mode - - - - - - - - - -
        -

        TOML Mode

        -
        - -

        The TOML Mode

        -

        Created by Forbes Lindesay.

        -

        MIME type defined: text/x-toml.

        -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/toml/toml.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/toml/toml.js deleted file mode 100644 index baeca15..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/toml/toml.js +++ /dev/null @@ -1,88 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("toml", function () { - return { - startState: function () { - return { - inString: false, - stringType: "", - lhs: true, - inArray: 0 - }; - }, - token: function (stream, state) { - //check for state changes - if (!state.inString && ((stream.peek() == '"') || (stream.peek() == "'"))) { - state.stringType = stream.peek(); - stream.next(); // Skip quote - state.inString = true; // Update state - } - if (stream.sol() && state.inArray === 0) { - state.lhs = true; - } - //return state - if (state.inString) { - while (state.inString && !stream.eol()) { - if (stream.peek() === state.stringType) { - stream.next(); // Skip quote - state.inString = false; // Clear flag - } else if (stream.peek() === '\\') { - stream.next(); - stream.next(); - } else { - stream.match(/^.[^\\\"\']*/); - } - } - return state.lhs ? "property string" : "string"; // Token style - } else if (state.inArray && stream.peek() === ']') { - stream.next(); - state.inArray--; - return 'bracket'; - } else if (state.lhs && stream.peek() === '[' && stream.skipTo(']')) { - stream.next();//skip closing ] - // array of objects has an extra open & close [] - if (stream.peek() === ']') stream.next(); - return "atom"; - } else if (stream.peek() === "#") { - stream.skipToEnd(); - return "comment"; - } else if (stream.eatSpace()) { - return null; - } else if (state.lhs && stream.eatWhile(function (c) { return c != '=' && c != ' '; })) { - return "property"; - } else if (state.lhs && stream.peek() === "=") { - stream.next(); - state.lhs = false; - return null; - } else if (!state.lhs && stream.match(/^\d\d\d\d[\d\-\:\.T]*Z/)) { - return 'atom'; //date - } else if (!state.lhs && (stream.match('true') || stream.match('false'))) { - return 'atom'; - } else if (!state.lhs && stream.peek() === '[') { - state.inArray++; - stream.next(); - return 'bracket'; - } else if (!state.lhs && stream.match(/^\-?\d+(?:\.\d+)?/)) { - return 'number'; - } else if (!stream.eatSpace()) { - stream.next(); - } - return null; - } - }; -}); - -CodeMirror.defineMIME('text/x-toml', 'toml'); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/tornado/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/tornado/index.html deleted file mode 100644 index 8ee7ef5..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/tornado/index.html +++ /dev/null @@ -1,63 +0,0 @@ - - -CodeMirror: Tornado template mode - - - - - - - - - - - - -
        -

        Tornado template mode

        -
        - - - -

        Mode for HTML with embedded Tornado template markup.

        - -

        MIME types defined: text/x-tornado

        -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/tornado/tornado.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/tornado/tornado.js deleted file mode 100644 index dbfbc34..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/tornado/tornado.js +++ /dev/null @@ -1,68 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), - require("../../addon/mode/overlay")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../htmlmixed/htmlmixed", - "../../addon/mode/overlay"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineMode("tornado:inner", function() { - var keywords = ["and","as","assert","autoescape","block","break","class","comment","context", - "continue","datetime","def","del","elif","else","end","escape","except", - "exec","extends","false","finally","for","from","global","if","import","in", - "include","is","json_encode","lambda","length","linkify","load","module", - "none","not","or","pass","print","put","raise","raw","return","self","set", - "squeeze","super","true","try","url_escape","while","with","without","xhtml_escape","yield"]; - keywords = new RegExp("^((" + keywords.join(")|(") + "))\\b"); - - function tokenBase (stream, state) { - stream.eatWhile(/[^\{]/); - var ch = stream.next(); - if (ch == "{") { - if (ch = stream.eat(/\{|%|#/)) { - state.tokenize = inTag(ch); - return "tag"; - } - } - } - function inTag (close) { - if (close == "{") { - close = "}"; - } - return function (stream, state) { - var ch = stream.next(); - if ((ch == close) && stream.eat("}")) { - state.tokenize = tokenBase; - return "tag"; - } - if (stream.match(keywords)) { - return "keyword"; - } - return close == "#" ? "comment" : "string"; - }; - } - return { - startState: function () { - return {tokenize: tokenBase}; - }, - token: function (stream, state) { - return state.tokenize(stream, state); - } - }; - }); - - CodeMirror.defineMode("tornado", function(config) { - var htmlBase = CodeMirror.getMode(config, "text/html"); - var tornadoInner = CodeMirror.getMode(config, "tornado:inner"); - return CodeMirror.overlayMode(htmlBase, tornadoInner); - }); - - CodeMirror.defineMIME("text/x-tornado", "tornado"); -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/turtle/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/turtle/index.html deleted file mode 100644 index a4962b6..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/turtle/index.html +++ /dev/null @@ -1,50 +0,0 @@ - - -CodeMirror: Turtle mode - - - - - - - - - -
        -

        Turtle mode

        -
        - - -

        MIME types defined: text/turtle.

        - -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/turtle/turtle.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/turtle/turtle.js deleted file mode 100644 index 0988f0a..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/turtle/turtle.js +++ /dev/null @@ -1,162 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("turtle", function(config) { - var indentUnit = config.indentUnit; - var curPunc; - - function wordRegexp(words) { - return new RegExp("^(?:" + words.join("|") + ")$", "i"); - } - var ops = wordRegexp([]); - var keywords = wordRegexp(["@prefix", "@base", "a"]); - var operatorChars = /[*+\-<>=&|]/; - - function tokenBase(stream, state) { - var ch = stream.next(); - curPunc = null; - if (ch == "<" && !stream.match(/^[\s\u00a0=]/, false)) { - stream.match(/^[^\s\u00a0>]*>?/); - return "atom"; - } - else if (ch == "\"" || ch == "'") { - state.tokenize = tokenLiteral(ch); - return state.tokenize(stream, state); - } - else if (/[{}\(\),\.;\[\]]/.test(ch)) { - curPunc = ch; - return null; - } - else if (ch == "#") { - stream.skipToEnd(); - return "comment"; - } - else if (operatorChars.test(ch)) { - stream.eatWhile(operatorChars); - return null; - } - else if (ch == ":") { - return "operator"; - } else { - stream.eatWhile(/[_\w\d]/); - if(stream.peek() == ":") { - return "variable-3"; - } else { - var word = stream.current(); - - if(keywords.test(word)) { - return "meta"; - } - - if(ch >= "A" && ch <= "Z") { - return "comment"; - } else { - return "keyword"; - } - } - var word = stream.current(); - if (ops.test(word)) - return null; - else if (keywords.test(word)) - return "meta"; - else - return "variable"; - } - } - - function tokenLiteral(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) { - state.tokenize = tokenBase; - break; - } - escaped = !escaped && ch == "\\"; - } - return "string"; - }; - } - - function pushContext(state, type, col) { - state.context = {prev: state.context, indent: state.indent, col: col, type: type}; - } - function popContext(state) { - state.indent = state.context.indent; - state.context = state.context.prev; - } - - return { - startState: function() { - return {tokenize: tokenBase, - context: null, - indent: 0, - col: 0}; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (state.context && state.context.align == null) state.context.align = false; - state.indent = stream.indentation(); - } - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - - if (style != "comment" && state.context && state.context.align == null && state.context.type != "pattern") { - state.context.align = true; - } - - if (curPunc == "(") pushContext(state, ")", stream.column()); - else if (curPunc == "[") pushContext(state, "]", stream.column()); - else if (curPunc == "{") pushContext(state, "}", stream.column()); - else if (/[\]\}\)]/.test(curPunc)) { - while (state.context && state.context.type == "pattern") popContext(state); - if (state.context && curPunc == state.context.type) popContext(state); - } - else if (curPunc == "." && state.context && state.context.type == "pattern") popContext(state); - else if (/atom|string|variable/.test(style) && state.context) { - if (/[\}\]]/.test(state.context.type)) - pushContext(state, "pattern", stream.column()); - else if (state.context.type == "pattern" && !state.context.align) { - state.context.align = true; - state.context.col = stream.column(); - } - } - - return style; - }, - - indent: function(state, textAfter) { - var firstChar = textAfter && textAfter.charAt(0); - var context = state.context; - if (/[\]\}]/.test(firstChar)) - while (context && context.type == "pattern") context = context.prev; - - var closing = context && firstChar == context.type; - if (!context) - return 0; - else if (context.type == "pattern") - return context.col; - else if (context.align) - return context.col + (closing ? 0 : 1); - else - return context.indent + (closing ? 0 : indentUnit); - }, - - lineComment: "#" - }; -}); - -CodeMirror.defineMIME("text/turtle", "turtle"); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/vb/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/vb/index.html deleted file mode 100644 index adcc44f..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/vb/index.html +++ /dev/null @@ -1,102 +0,0 @@ - - -CodeMirror: VB.NET mode - - - - - - - - - - - -
        -

        VB.NET mode

        - - - -
        - -
        -
        
        -  

        MIME type defined: text/x-vb.

        - -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/vb/vb.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/vb/vb.js deleted file mode 100644 index 902203e..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/vb/vb.js +++ /dev/null @@ -1,274 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("vb", function(conf, parserConf) { - var ERRORCLASS = 'error'; - - function wordRegexp(words) { - return new RegExp("^((" + words.join(")|(") + "))\\b", "i"); - } - - var singleOperators = new RegExp("^[\\+\\-\\*/%&\\\\|\\^~<>!]"); - var singleDelimiters = new RegExp('^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]'); - var doubleOperators = new RegExp("^((==)|(<>)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"); - var doubleDelimiters = new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"); - var tripleDelimiters = new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"); - var identifiers = new RegExp("^[_A-Za-z][_A-Za-z0-9]*"); - - var openingKeywords = ['class','module', 'sub','enum','select','while','if','function', 'get','set','property', 'try']; - var middleKeywords = ['else','elseif','case', 'catch']; - var endKeywords = ['next','loop']; - - var wordOperators = wordRegexp(['and', 'or', 'not', 'xor', 'in']); - var commonkeywords = ['as', 'dim', 'break', 'continue','optional', 'then', 'until', - 'goto', 'byval','byref','new','handles','property', 'return', - 'const','private', 'protected', 'friend', 'public', 'shared', 'static', 'true','false']; - var commontypes = ['integer','string','double','decimal','boolean','short','char', 'float','single']; - - var keywords = wordRegexp(commonkeywords); - var types = wordRegexp(commontypes); - var stringPrefixes = '"'; - - var opening = wordRegexp(openingKeywords); - var middle = wordRegexp(middleKeywords); - var closing = wordRegexp(endKeywords); - var doubleClosing = wordRegexp(['end']); - var doOpening = wordRegexp(['do']); - - var indentInfo = null; - - - - - function indent(_stream, state) { - state.currentIndent++; - } - - function dedent(_stream, state) { - state.currentIndent--; - } - // tokenizers - function tokenBase(stream, state) { - if (stream.eatSpace()) { - return null; - } - - var ch = stream.peek(); - - // Handle Comments - if (ch === "'") { - stream.skipToEnd(); - return 'comment'; - } - - - // Handle Number Literals - if (stream.match(/^((&H)|(&O))?[0-9\.a-f]/i, false)) { - var floatLiteral = false; - // Floats - if (stream.match(/^\d*\.\d+F?/i)) { floatLiteral = true; } - else if (stream.match(/^\d+\.\d*F?/)) { floatLiteral = true; } - else if (stream.match(/^\.\d+F?/)) { floatLiteral = true; } - - if (floatLiteral) { - // Float literals may be "imaginary" - stream.eat(/J/i); - return 'number'; - } - // Integers - var intLiteral = false; - // Hex - if (stream.match(/^&H[0-9a-f]+/i)) { intLiteral = true; } - // Octal - else if (stream.match(/^&O[0-7]+/i)) { intLiteral = true; } - // Decimal - else if (stream.match(/^[1-9]\d*F?/)) { - // Decimal literals may be "imaginary" - stream.eat(/J/i); - // TODO - Can you have imaginary longs? - intLiteral = true; - } - // Zero by itself with no other piece of number. - else if (stream.match(/^0(?![\dx])/i)) { intLiteral = true; } - if (intLiteral) { - // Integer literals may be "long" - stream.eat(/L/i); - return 'number'; - } - } - - // Handle Strings - if (stream.match(stringPrefixes)) { - state.tokenize = tokenStringFactory(stream.current()); - return state.tokenize(stream, state); - } - - // Handle operators and Delimiters - if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters)) { - return null; - } - if (stream.match(doubleOperators) - || stream.match(singleOperators) - || stream.match(wordOperators)) { - return 'operator'; - } - if (stream.match(singleDelimiters)) { - return null; - } - if (stream.match(doOpening)) { - indent(stream,state); - state.doInCurrentLine = true; - return 'keyword'; - } - if (stream.match(opening)) { - if (! state.doInCurrentLine) - indent(stream,state); - else - state.doInCurrentLine = false; - return 'keyword'; - } - if (stream.match(middle)) { - return 'keyword'; - } - - if (stream.match(doubleClosing)) { - dedent(stream,state); - dedent(stream,state); - return 'keyword'; - } - if (stream.match(closing)) { - dedent(stream,state); - return 'keyword'; - } - - if (stream.match(types)) { - return 'keyword'; - } - - if (stream.match(keywords)) { - return 'keyword'; - } - - if (stream.match(identifiers)) { - return 'variable'; - } - - // Handle non-detected items - stream.next(); - return ERRORCLASS; - } - - function tokenStringFactory(delimiter) { - var singleline = delimiter.length == 1; - var OUTCLASS = 'string'; - - return function(stream, state) { - while (!stream.eol()) { - stream.eatWhile(/[^'"]/); - if (stream.match(delimiter)) { - state.tokenize = tokenBase; - return OUTCLASS; - } else { - stream.eat(/['"]/); - } - } - if (singleline) { - if (parserConf.singleLineStringErrors) { - return ERRORCLASS; - } else { - state.tokenize = tokenBase; - } - } - return OUTCLASS; - }; - } - - - function tokenLexer(stream, state) { - var style = state.tokenize(stream, state); - var current = stream.current(); - - // Handle '.' connected identifiers - if (current === '.') { - style = state.tokenize(stream, state); - current = stream.current(); - if (style === 'variable') { - return 'variable'; - } else { - return ERRORCLASS; - } - } - - - var delimiter_index = '[({'.indexOf(current); - if (delimiter_index !== -1) { - indent(stream, state ); - } - if (indentInfo === 'dedent') { - if (dedent(stream, state)) { - return ERRORCLASS; - } - } - delimiter_index = '])}'.indexOf(current); - if (delimiter_index !== -1) { - if (dedent(stream, state)) { - return ERRORCLASS; - } - } - - return style; - } - - var external = { - electricChars:"dDpPtTfFeE ", - startState: function() { - return { - tokenize: tokenBase, - lastToken: null, - currentIndent: 0, - nextLineIndent: 0, - doInCurrentLine: false - - - }; - }, - - token: function(stream, state) { - if (stream.sol()) { - state.currentIndent += state.nextLineIndent; - state.nextLineIndent = 0; - state.doInCurrentLine = 0; - } - var style = tokenLexer(stream, state); - - state.lastToken = {style:style, content: stream.current()}; - - - - return style; - }, - - indent: function(state, textAfter) { - var trueText = textAfter.replace(/^\s+|\s+$/g, '') ; - if (trueText.match(closing) || trueText.match(doubleClosing) || trueText.match(middle)) return conf.indentUnit*(state.currentIndent-1); - if(state.currentIndent < 0) return 0; - return state.currentIndent * conf.indentUnit; - } - - }; - return external; -}); - -CodeMirror.defineMIME("text/x-vb", "vb"); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/vbscript/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/vbscript/index.html deleted file mode 100644 index ad7532d..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/vbscript/index.html +++ /dev/null @@ -1,55 +0,0 @@ - - -CodeMirror: VBScript mode - - - - - - - - - -
        -

        VBScript mode

        - - -
        - - - -

        MIME types defined: text/vbscript.

        -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/vbscript/vbscript.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/vbscript/vbscript.js deleted file mode 100644 index b66df22..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/vbscript/vbscript.js +++ /dev/null @@ -1,350 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/* -For extra ASP classic objects, initialize CodeMirror instance with this option: - isASP: true - -E.G.: - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - isASP: true - }); -*/ - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("vbscript", function(conf, parserConf) { - var ERRORCLASS = 'error'; - - function wordRegexp(words) { - return new RegExp("^((" + words.join(")|(") + "))\\b", "i"); - } - - var singleOperators = new RegExp("^[\\+\\-\\*/&\\\\\\^<>=]"); - var doubleOperators = new RegExp("^((<>)|(<=)|(>=))"); - var singleDelimiters = new RegExp('^[\\.,]'); - var brakets = new RegExp('^[\\(\\)]'); - var identifiers = new RegExp("^[A-Za-z][_A-Za-z0-9]*"); - - var openingKeywords = ['class','sub','select','while','if','function', 'property', 'with', 'for']; - var middleKeywords = ['else','elseif','case']; - var endKeywords = ['next','loop','wend']; - - var wordOperators = wordRegexp(['and', 'or', 'not', 'xor', 'is', 'mod', 'eqv', 'imp']); - var commonkeywords = ['dim', 'redim', 'then', 'until', 'randomize', - 'byval','byref','new','property', 'exit', 'in', - 'const','private', 'public', - 'get','set','let', 'stop', 'on error resume next', 'on error goto 0', 'option explicit', 'call', 'me']; - - //This list was from: http://msdn.microsoft.com/en-us/library/f8tbc79x(v=vs.84).aspx - var atomWords = ['true', 'false', 'nothing', 'empty', 'null']; - //This list was from: http://msdn.microsoft.com/en-us/library/3ca8tfek(v=vs.84).aspx - var builtinFuncsWords = ['abs', 'array', 'asc', 'atn', 'cbool', 'cbyte', 'ccur', 'cdate', 'cdbl', 'chr', 'cint', 'clng', 'cos', 'csng', 'cstr', 'date', 'dateadd', 'datediff', 'datepart', - 'dateserial', 'datevalue', 'day', 'escape', 'eval', 'execute', 'exp', 'filter', 'formatcurrency', 'formatdatetime', 'formatnumber', 'formatpercent', 'getlocale', 'getobject', - 'getref', 'hex', 'hour', 'inputbox', 'instr', 'instrrev', 'int', 'fix', 'isarray', 'isdate', 'isempty', 'isnull', 'isnumeric', 'isobject', 'join', 'lbound', 'lcase', 'left', - 'len', 'loadpicture', 'log', 'ltrim', 'rtrim', 'trim', 'maths', 'mid', 'minute', 'month', 'monthname', 'msgbox', 'now', 'oct', 'replace', 'rgb', 'right', 'rnd', 'round', - 'scriptengine', 'scriptenginebuildversion', 'scriptenginemajorversion', 'scriptengineminorversion', 'second', 'setlocale', 'sgn', 'sin', 'space', 'split', 'sqr', 'strcomp', - 'string', 'strreverse', 'tan', 'time', 'timer', 'timeserial', 'timevalue', 'typename', 'ubound', 'ucase', 'unescape', 'vartype', 'weekday', 'weekdayname', 'year']; - - //This list was from: http://msdn.microsoft.com/en-us/library/ydz4cfk3(v=vs.84).aspx - var builtinConsts = ['vbBlack', 'vbRed', 'vbGreen', 'vbYellow', 'vbBlue', 'vbMagenta', 'vbCyan', 'vbWhite', 'vbBinaryCompare', 'vbTextCompare', - 'vbSunday', 'vbMonday', 'vbTuesday', 'vbWednesday', 'vbThursday', 'vbFriday', 'vbSaturday', 'vbUseSystemDayOfWeek', 'vbFirstJan1', 'vbFirstFourDays', 'vbFirstFullWeek', - 'vbGeneralDate', 'vbLongDate', 'vbShortDate', 'vbLongTime', 'vbShortTime', 'vbObjectError', - 'vbOKOnly', 'vbOKCancel', 'vbAbortRetryIgnore', 'vbYesNoCancel', 'vbYesNo', 'vbRetryCancel', 'vbCritical', 'vbQuestion', 'vbExclamation', 'vbInformation', 'vbDefaultButton1', 'vbDefaultButton2', - 'vbDefaultButton3', 'vbDefaultButton4', 'vbApplicationModal', 'vbSystemModal', 'vbOK', 'vbCancel', 'vbAbort', 'vbRetry', 'vbIgnore', 'vbYes', 'vbNo', - 'vbCr', 'VbCrLf', 'vbFormFeed', 'vbLf', 'vbNewLine', 'vbNullChar', 'vbNullString', 'vbTab', 'vbVerticalTab', 'vbUseDefault', 'vbTrue', 'vbFalse', - 'vbEmpty', 'vbNull', 'vbInteger', 'vbLong', 'vbSingle', 'vbDouble', 'vbCurrency', 'vbDate', 'vbString', 'vbObject', 'vbError', 'vbBoolean', 'vbVariant', 'vbDataObject', 'vbDecimal', 'vbByte', 'vbArray']; - //This list was from: http://msdn.microsoft.com/en-us/library/hkc375ea(v=vs.84).aspx - var builtinObjsWords = ['WScript', 'err', 'debug', 'RegExp']; - var knownProperties = ['description', 'firstindex', 'global', 'helpcontext', 'helpfile', 'ignorecase', 'length', 'number', 'pattern', 'source', 'value', 'count']; - var knownMethods = ['clear', 'execute', 'raise', 'replace', 'test', 'write', 'writeline', 'close', 'open', 'state', 'eof', 'update', 'addnew', 'end', 'createobject', 'quit']; - - var aspBuiltinObjsWords = ['server', 'response', 'request', 'session', 'application']; - var aspKnownProperties = ['buffer', 'cachecontrol', 'charset', 'contenttype', 'expires', 'expiresabsolute', 'isclientconnected', 'pics', 'status', //response - 'clientcertificate', 'cookies', 'form', 'querystring', 'servervariables', 'totalbytes', //request - 'contents', 'staticobjects', //application - 'codepage', 'lcid', 'sessionid', 'timeout', //session - 'scripttimeout']; //server - var aspKnownMethods = ['addheader', 'appendtolog', 'binarywrite', 'end', 'flush', 'redirect', //response - 'binaryread', //request - 'remove', 'removeall', 'lock', 'unlock', //application - 'abandon', //session - 'getlasterror', 'htmlencode', 'mappath', 'transfer', 'urlencode']; //server - - var knownWords = knownMethods.concat(knownProperties); - - builtinObjsWords = builtinObjsWords.concat(builtinConsts); - - if (conf.isASP){ - builtinObjsWords = builtinObjsWords.concat(aspBuiltinObjsWords); - knownWords = knownWords.concat(aspKnownMethods, aspKnownProperties); - }; - - var keywords = wordRegexp(commonkeywords); - var atoms = wordRegexp(atomWords); - var builtinFuncs = wordRegexp(builtinFuncsWords); - var builtinObjs = wordRegexp(builtinObjsWords); - var known = wordRegexp(knownWords); - var stringPrefixes = '"'; - - var opening = wordRegexp(openingKeywords); - var middle = wordRegexp(middleKeywords); - var closing = wordRegexp(endKeywords); - var doubleClosing = wordRegexp(['end']); - var doOpening = wordRegexp(['do']); - var noIndentWords = wordRegexp(['on error resume next', 'exit']); - var comment = wordRegexp(['rem']); - - - function indent(_stream, state) { - state.currentIndent++; - } - - function dedent(_stream, state) { - state.currentIndent--; - } - // tokenizers - function tokenBase(stream, state) { - if (stream.eatSpace()) { - return 'space'; - //return null; - } - - var ch = stream.peek(); - - // Handle Comments - if (ch === "'") { - stream.skipToEnd(); - return 'comment'; - } - if (stream.match(comment)){ - stream.skipToEnd(); - return 'comment'; - } - - - // Handle Number Literals - if (stream.match(/^((&H)|(&O))?[0-9\.]/i, false) && !stream.match(/^((&H)|(&O))?[0-9\.]+[a-z_]/i, false)) { - var floatLiteral = false; - // Floats - if (stream.match(/^\d*\.\d+/i)) { floatLiteral = true; } - else if (stream.match(/^\d+\.\d*/)) { floatLiteral = true; } - else if (stream.match(/^\.\d+/)) { floatLiteral = true; } - - if (floatLiteral) { - // Float literals may be "imaginary" - stream.eat(/J/i); - return 'number'; - } - // Integers - var intLiteral = false; - // Hex - if (stream.match(/^&H[0-9a-f]+/i)) { intLiteral = true; } - // Octal - else if (stream.match(/^&O[0-7]+/i)) { intLiteral = true; } - // Decimal - else if (stream.match(/^[1-9]\d*F?/)) { - // Decimal literals may be "imaginary" - stream.eat(/J/i); - // TODO - Can you have imaginary longs? - intLiteral = true; - } - // Zero by itself with no other piece of number. - else if (stream.match(/^0(?![\dx])/i)) { intLiteral = true; } - if (intLiteral) { - // Integer literals may be "long" - stream.eat(/L/i); - return 'number'; - } - } - - // Handle Strings - if (stream.match(stringPrefixes)) { - state.tokenize = tokenStringFactory(stream.current()); - return state.tokenize(stream, state); - } - - // Handle operators and Delimiters - if (stream.match(doubleOperators) - || stream.match(singleOperators) - || stream.match(wordOperators)) { - return 'operator'; - } - if (stream.match(singleDelimiters)) { - return null; - } - - if (stream.match(brakets)) { - return "bracket"; - } - - if (stream.match(noIndentWords)) { - state.doInCurrentLine = true; - - return 'keyword'; - } - - if (stream.match(doOpening)) { - indent(stream,state); - state.doInCurrentLine = true; - - return 'keyword'; - } - if (stream.match(opening)) { - if (! state.doInCurrentLine) - indent(stream,state); - else - state.doInCurrentLine = false; - - return 'keyword'; - } - if (stream.match(middle)) { - return 'keyword'; - } - - - if (stream.match(doubleClosing)) { - dedent(stream,state); - dedent(stream,state); - - return 'keyword'; - } - if (stream.match(closing)) { - if (! state.doInCurrentLine) - dedent(stream,state); - else - state.doInCurrentLine = false; - - return 'keyword'; - } - - if (stream.match(keywords)) { - return 'keyword'; - } - - if (stream.match(atoms)) { - return 'atom'; - } - - if (stream.match(known)) { - return 'variable-2'; - } - - if (stream.match(builtinFuncs)) { - return 'builtin'; - } - - if (stream.match(builtinObjs)){ - return 'variable-2'; - } - - if (stream.match(identifiers)) { - return 'variable'; - } - - // Handle non-detected items - stream.next(); - return ERRORCLASS; - } - - function tokenStringFactory(delimiter) { - var singleline = delimiter.length == 1; - var OUTCLASS = 'string'; - - return function(stream, state) { - while (!stream.eol()) { - stream.eatWhile(/[^'"]/); - if (stream.match(delimiter)) { - state.tokenize = tokenBase; - return OUTCLASS; - } else { - stream.eat(/['"]/); - } - } - if (singleline) { - if (parserConf.singleLineStringErrors) { - return ERRORCLASS; - } else { - state.tokenize = tokenBase; - } - } - return OUTCLASS; - }; - } - - - function tokenLexer(stream, state) { - var style = state.tokenize(stream, state); - var current = stream.current(); - - // Handle '.' connected identifiers - if (current === '.') { - style = state.tokenize(stream, state); - - current = stream.current(); - if (style && (style.substr(0, 8) === 'variable' || style==='builtin' || style==='keyword')){//|| knownWords.indexOf(current.substring(1)) > -1) { - if (style === 'builtin' || style === 'keyword') style='variable'; - if (knownWords.indexOf(current.substr(1)) > -1) style='variable-2'; - - return style; - } else { - return ERRORCLASS; - } - } - - return style; - } - - var external = { - electricChars:"dDpPtTfFeE ", - startState: function() { - return { - tokenize: tokenBase, - lastToken: null, - currentIndent: 0, - nextLineIndent: 0, - doInCurrentLine: false, - ignoreKeyword: false - - - }; - }, - - token: function(stream, state) { - if (stream.sol()) { - state.currentIndent += state.nextLineIndent; - state.nextLineIndent = 0; - state.doInCurrentLine = 0; - } - var style = tokenLexer(stream, state); - - state.lastToken = {style:style, content: stream.current()}; - - if (style==='space') style=null; - - return style; - }, - - indent: function(state, textAfter) { - var trueText = textAfter.replace(/^\s+|\s+$/g, '') ; - if (trueText.match(closing) || trueText.match(doubleClosing) || trueText.match(middle)) return conf.indentUnit*(state.currentIndent-1); - if(state.currentIndent < 0) return 0; - return state.currentIndent * conf.indentUnit; - } - - }; - return external; -}); - -CodeMirror.defineMIME("text/vbscript", "vbscript"); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/velocity/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/velocity/index.html deleted file mode 100644 index 2747878..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/velocity/index.html +++ /dev/null @@ -1,118 +0,0 @@ - - -CodeMirror: Velocity mode - - - - - - - - - - -
        -

        Velocity mode

        -
        - - -

        MIME types defined: text/velocity.

        - -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/velocity/velocity.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/velocity/velocity.js deleted file mode 100644 index 8fc4f95..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/velocity/velocity.js +++ /dev/null @@ -1,201 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("velocity", function() { - function parseWords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - var keywords = parseWords("#end #else #break #stop #[[ #]] " + - "#{end} #{else} #{break} #{stop}"); - var functions = parseWords("#if #elseif #foreach #set #include #parse #macro #define #evaluate " + - "#{if} #{elseif} #{foreach} #{set} #{include} #{parse} #{macro} #{define} #{evaluate}"); - var specials = parseWords("$foreach.count $foreach.hasNext $foreach.first $foreach.last $foreach.topmost $foreach.parent.count $foreach.parent.hasNext $foreach.parent.first $foreach.parent.last $foreach.parent $velocityCount $!bodyContent $bodyContent"); - var isOperatorChar = /[+\-*&%=<>!?:\/|]/; - - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - function tokenBase(stream, state) { - var beforeParams = state.beforeParams; - state.beforeParams = false; - var ch = stream.next(); - // start of unparsed string? - if ((ch == "'") && state.inParams) { - state.lastTokenWasBuiltin = false; - return chain(stream, state, tokenString(ch)); - } - // start of parsed string? - else if ((ch == '"')) { - state.lastTokenWasBuiltin = false; - if (state.inString) { - state.inString = false; - return "string"; - } - else if (state.inParams) - return chain(stream, state, tokenString(ch)); - } - // is it one of the special signs []{}().,;? Seperator? - else if (/[\[\]{}\(\),;\.]/.test(ch)) { - if (ch == "(" && beforeParams) - state.inParams = true; - else if (ch == ")") { - state.inParams = false; - state.lastTokenWasBuiltin = true; - } - return null; - } - // start of a number value? - else if (/\d/.test(ch)) { - state.lastTokenWasBuiltin = false; - stream.eatWhile(/[\w\.]/); - return "number"; - } - // multi line comment? - else if (ch == "#" && stream.eat("*")) { - state.lastTokenWasBuiltin = false; - return chain(stream, state, tokenComment); - } - // unparsed content? - else if (ch == "#" && stream.match(/ *\[ *\[/)) { - state.lastTokenWasBuiltin = false; - return chain(stream, state, tokenUnparsed); - } - // single line comment? - else if (ch == "#" && stream.eat("#")) { - state.lastTokenWasBuiltin = false; - stream.skipToEnd(); - return "comment"; - } - // variable? - else if (ch == "$") { - stream.eatWhile(/[\w\d\$_\.{}]/); - // is it one of the specials? - if (specials && specials.propertyIsEnumerable(stream.current())) { - return "keyword"; - } - else { - state.lastTokenWasBuiltin = true; - state.beforeParams = true; - return "builtin"; - } - } - // is it a operator? - else if (isOperatorChar.test(ch)) { - state.lastTokenWasBuiltin = false; - stream.eatWhile(isOperatorChar); - return "operator"; - } - else { - // get the whole word - stream.eatWhile(/[\w\$_{}@]/); - var word = stream.current(); - // is it one of the listed keywords? - if (keywords && keywords.propertyIsEnumerable(word)) - return "keyword"; - // is it one of the listed functions? - if (functions && functions.propertyIsEnumerable(word) || - (stream.current().match(/^#@?[a-z0-9_]+ *$/i) && stream.peek()=="(") && - !(functions && functions.propertyIsEnumerable(word.toLowerCase()))) { - state.beforeParams = true; - state.lastTokenWasBuiltin = false; - return "keyword"; - } - if (state.inString) { - state.lastTokenWasBuiltin = false; - return "string"; - } - if (stream.pos > word.length && stream.string.charAt(stream.pos-word.length-1)=="." && state.lastTokenWasBuiltin) - return "builtin"; - // default: just a "word" - state.lastTokenWasBuiltin = false; - return null; - } - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if ((next == quote) && !escaped) { - end = true; - break; - } - if (quote=='"' && stream.peek() == '$' && !escaped) { - state.inString = true; - end = true; - break; - } - escaped = !escaped && next == "\\"; - } - if (end) state.tokenize = tokenBase; - return "string"; - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "#" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function tokenUnparsed(stream, state) { - var maybeEnd = 0, ch; - while (ch = stream.next()) { - if (ch == "#" && maybeEnd == 2) { - state.tokenize = tokenBase; - break; - } - if (ch == "]") - maybeEnd++; - else if (ch != " ") - maybeEnd = 0; - } - return "meta"; - } - // Interface - - return { - startState: function() { - return { - tokenize: tokenBase, - beforeParams: false, - inParams: false, - inString: false, - lastTokenWasBuiltin: false - }; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - return state.tokenize(stream, state); - }, - blockCommentStart: "#*", - blockCommentEnd: "*#", - lineComment: "##", - fold: "velocity" - }; -}); - -CodeMirror.defineMIME("text/velocity", "velocity"); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/verilog/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/verilog/index.html deleted file mode 100644 index 96b3d64..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/verilog/index.html +++ /dev/null @@ -1,120 +0,0 @@ - - -CodeMirror: Verilog/SystemVerilog mode - - - - - - - - - - -
        -

        SystemVerilog mode

        - -
        - - - -

        -Syntax highlighting and indentation for the Verilog and SystemVerilog languages (IEEE 1800). -

        Configuration options:

        -
          -
        • noIndentKeywords - List of keywords which should not cause identation to increase. E.g. ["package", "module"]. Default: None
        • -
        -

        - -

        MIME types defined: text/x-verilog and text/x-systemverilog.

        -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/verilog/test.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/verilog/test.js deleted file mode 100644 index 9c8c094..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/verilog/test.js +++ /dev/null @@ -1,273 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({indentUnit: 4}, "verilog"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - MT("binary_literals", - "[number 1'b0]", - "[number 1'b1]", - "[number 1'bx]", - "[number 1'bz]", - "[number 1'bX]", - "[number 1'bZ]", - "[number 1'B0]", - "[number 1'B1]", - "[number 1'Bx]", - "[number 1'Bz]", - "[number 1'BX]", - "[number 1'BZ]", - "[number 1'b0]", - "[number 1'b1]", - "[number 2'b01]", - "[number 2'bxz]", - "[number 2'b11]", - "[number 2'b10]", - "[number 2'b1Z]", - "[number 12'b0101_0101_0101]", - "[number 1'b 0]", - "[number 'b0101]" - ); - - MT("octal_literals", - "[number 3'o7]", - "[number 3'O7]", - "[number 3'so7]", - "[number 3'SO7]" - ); - - MT("decimal_literals", - "[number 0]", - "[number 1]", - "[number 7]", - "[number 123_456]", - "[number 'd33]", - "[number 8'd255]", - "[number 8'D255]", - "[number 8'sd255]", - "[number 8'SD255]", - "[number 32'd123]", - "[number 32 'd123]", - "[number 32 'd 123]" - ); - - MT("hex_literals", - "[number 4'h0]", - "[number 4'ha]", - "[number 4'hF]", - "[number 4'hx]", - "[number 4'hz]", - "[number 4'hX]", - "[number 4'hZ]", - "[number 32'hdc78]", - "[number 32'hDC78]", - "[number 32 'hDC78]", - "[number 32'h DC78]", - "[number 32 'h DC78]", - "[number 32'h44x7]", - "[number 32'hFFF?]" - ); - - MT("real_number_literals", - "[number 1.2]", - "[number 0.1]", - "[number 2394.26331]", - "[number 1.2E12]", - "[number 1.2e12]", - "[number 1.30e-2]", - "[number 0.1e-0]", - "[number 23E10]", - "[number 29E-2]", - "[number 236.123_763_e-12]" - ); - - MT("operators", - "[meta ^]" - ); - - MT("keywords", - "[keyword logic]", - "[keyword logic] [variable foo]", - "[keyword reg] [variable abc]" - ); - - MT("variables", - "[variable _leading_underscore]", - "[variable _if]", - "[number 12] [variable foo]", - "[variable foo] [number 14]" - ); - - MT("tick_defines", - "[def `FOO]", - "[def `foo]", - "[def `FOO_bar]" - ); - - MT("system_calls", - "[meta $display]", - "[meta $vpi_printf]" - ); - - MT("line_comment", "[comment // Hello world]"); - - // Alignment tests - MT("align_port_map_style1", - /** - * mod mod(.a(a), - * .b(b) - * ); - */ - "[variable mod] [variable mod][bracket (].[variable a][bracket (][variable a][bracket )],", - " .[variable b][bracket (][variable b][bracket )]", - " [bracket )];", - "" - ); - - MT("align_port_map_style2", - /** - * mod mod( - * .a(a), - * .b(b) - * ); - */ - "[variable mod] [variable mod][bracket (]", - " .[variable a][bracket (][variable a][bracket )],", - " .[variable b][bracket (][variable b][bracket )]", - "[bracket )];", - "" - ); - - // Indentation tests - MT("indent_single_statement_if", - "[keyword if] [bracket (][variable foo][bracket )]", - " [keyword break];", - "" - ); - - MT("no_indent_after_single_line_if", - "[keyword if] [bracket (][variable foo][bracket )] [keyword break];", - "" - ); - - MT("indent_after_if_begin_same_line", - "[keyword if] [bracket (][variable foo][bracket )] [keyword begin]", - " [keyword break];", - " [keyword break];", - "[keyword end]", - "" - ); - - MT("indent_after_if_begin_next_line", - "[keyword if] [bracket (][variable foo][bracket )]", - " [keyword begin]", - " [keyword break];", - " [keyword break];", - " [keyword end]", - "" - ); - - MT("indent_single_statement_if_else", - "[keyword if] [bracket (][variable foo][bracket )]", - " [keyword break];", - "[keyword else]", - " [keyword break];", - "" - ); - - MT("indent_if_else_begin_same_line", - "[keyword if] [bracket (][variable foo][bracket )] [keyword begin]", - " [keyword break];", - " [keyword break];", - "[keyword end] [keyword else] [keyword begin]", - " [keyword break];", - " [keyword break];", - "[keyword end]", - "" - ); - - MT("indent_if_else_begin_next_line", - "[keyword if] [bracket (][variable foo][bracket )]", - " [keyword begin]", - " [keyword break];", - " [keyword break];", - " [keyword end]", - "[keyword else]", - " [keyword begin]", - " [keyword break];", - " [keyword break];", - " [keyword end]", - "" - ); - - MT("indent_if_nested_without_begin", - "[keyword if] [bracket (][variable foo][bracket )]", - " [keyword if] [bracket (][variable foo][bracket )]", - " [keyword if] [bracket (][variable foo][bracket )]", - " [keyword break];", - "" - ); - - MT("indent_case", - "[keyword case] [bracket (][variable state][bracket )]", - " [variable FOO]:", - " [keyword break];", - " [variable BAR]:", - " [keyword break];", - "[keyword endcase]", - "" - ); - - MT("unindent_after_end_with_preceding_text", - "[keyword begin]", - " [keyword break]; [keyword end]", - "" - ); - - MT("export_function_one_line_does_not_indent", - "[keyword export] [string \"DPI-C\"] [keyword function] [variable helloFromSV];", - "" - ); - - MT("export_task_one_line_does_not_indent", - "[keyword export] [string \"DPI-C\"] [keyword task] [variable helloFromSV];", - "" - ); - - MT("export_function_two_lines_indents_properly", - "[keyword export]", - " [string \"DPI-C\"] [keyword function] [variable helloFromSV];", - "" - ); - - MT("export_task_two_lines_indents_properly", - "[keyword export]", - " [string \"DPI-C\"] [keyword task] [variable helloFromSV];", - "" - ); - - MT("import_function_one_line_does_not_indent", - "[keyword import] [string \"DPI-C\"] [keyword function] [variable helloFromC];", - "" - ); - - MT("import_task_one_line_does_not_indent", - "[keyword import] [string \"DPI-C\"] [keyword task] [variable helloFromC];", - "" - ); - - MT("import_package_single_line_does_not_indent", - "[keyword import] [variable p]::[variable x];", - "[keyword import] [variable p]::[variable y];", - "" - ); - - MT("covergoup_with_function_indents_properly", - "[keyword covergroup] [variable cg] [keyword with] [keyword function] [variable sample][bracket (][keyword bit] [variable b][bracket )];", - " [variable c] : [keyword coverpoint] [variable c];", - "[keyword endgroup]: [variable cg]", - "" - ); - -})(); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/verilog/verilog.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/verilog/verilog.js deleted file mode 100644 index 96b9f24..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/verilog/verilog.js +++ /dev/null @@ -1,537 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("verilog", function(config, parserConfig) { - - var indentUnit = config.indentUnit, - statementIndentUnit = parserConfig.statementIndentUnit || indentUnit, - dontAlignCalls = parserConfig.dontAlignCalls, - noIndentKeywords = parserConfig.noIndentKeywords || [], - multiLineStrings = parserConfig.multiLineStrings, - hooks = parserConfig.hooks || {}; - - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - /** - * Keywords from IEEE 1800-2012 - */ - var keywords = words( - "accept_on alias always always_comb always_ff always_latch and assert assign assume automatic before begin bind " + - "bins binsof bit break buf bufif0 bufif1 byte case casex casez cell chandle checker class clocking cmos config " + - "const constraint context continue cover covergroup coverpoint cross deassign default defparam design disable " + - "dist do edge else end endcase endchecker endclass endclocking endconfig endfunction endgenerate endgroup " + - "endinterface endmodule endpackage endprimitive endprogram endproperty endspecify endsequence endtable endtask " + - "enum event eventually expect export extends extern final first_match for force foreach forever fork forkjoin " + - "function generate genvar global highz0 highz1 if iff ifnone ignore_bins illegal_bins implements implies import " + - "incdir include initial inout input inside instance int integer interconnect interface intersect join join_any " + - "join_none large let liblist library local localparam logic longint macromodule matches medium modport module " + - "nand negedge nettype new nexttime nmos nor noshowcancelled not notif0 notif1 null or output package packed " + - "parameter pmos posedge primitive priority program property protected pull0 pull1 pulldown pullup " + - "pulsestyle_ondetect pulsestyle_onevent pure rand randc randcase randsequence rcmos real realtime ref reg " + - "reject_on release repeat restrict return rnmos rpmos rtran rtranif0 rtranif1 s_always s_eventually s_nexttime " + - "s_until s_until_with scalared sequence shortint shortreal showcancelled signed small soft solve specify " + - "specparam static string strong strong0 strong1 struct super supply0 supply1 sync_accept_on sync_reject_on " + - "table tagged task this throughout time timeprecision timeunit tran tranif0 tranif1 tri tri0 tri1 triand trior " + - "trireg type typedef union unique unique0 unsigned until until_with untyped use uwire var vectored virtual void " + - "wait wait_order wand weak weak0 weak1 while wildcard wire with within wor xnor xor"); - - /** Operators from IEEE 1800-2012 - unary_operator ::= - + | - | ! | ~ | & | ~& | | | ~| | ^ | ~^ | ^~ - binary_operator ::= - + | - | * | / | % | == | != | === | !== | ==? | !=? | && | || | ** - | < | <= | > | >= | & | | | ^ | ^~ | ~^ | >> | << | >>> | <<< - | -> | <-> - inc_or_dec_operator ::= ++ | -- - unary_module_path_operator ::= - ! | ~ | & | ~& | | | ~| | ^ | ~^ | ^~ - binary_module_path_operator ::= - == | != | && | || | & | | | ^ | ^~ | ~^ - */ - var isOperatorChar = /[\+\-\*\/!~&|^%=?:]/; - var isBracketChar = /[\[\]{}()]/; - - var unsignedNumber = /\d[0-9_]*/; - var decimalLiteral = /\d*\s*'s?d\s*\d[0-9_]*/i; - var binaryLiteral = /\d*\s*'s?b\s*[xz01][xz01_]*/i; - var octLiteral = /\d*\s*'s?o\s*[xz0-7][xz0-7_]*/i; - var hexLiteral = /\d*\s*'s?h\s*[0-9a-fxz?][0-9a-fxz?_]*/i; - var realLiteral = /(\d[\d_]*(\.\d[\d_]*)?E-?[\d_]+)|(\d[\d_]*\.\d[\d_]*)/i; - - var closingBracketOrWord = /^((\w+)|[)}\]])/; - var closingBracket = /[)}\]]/; - - var curPunc; - var curKeyword; - - // Block openings which are closed by a matching keyword in the form of ("end" + keyword) - // E.g. "task" => "endtask" - var blockKeywords = words( - "case checker class clocking config function generate interface module package" + - "primitive program property specify sequence table task" - ); - - // Opening/closing pairs - var openClose = {}; - for (var keyword in blockKeywords) { - openClose[keyword] = "end" + keyword; - } - openClose["begin"] = "end"; - openClose["casex"] = "endcase"; - openClose["casez"] = "endcase"; - openClose["do" ] = "while"; - openClose["fork" ] = "join;join_any;join_none"; - openClose["covergroup"] = "endgroup"; - - for (var i in noIndentKeywords) { - var keyword = noIndentKeywords[i]; - if (openClose[keyword]) { - openClose[keyword] = undefined; - } - } - - // Keywords which open statements that are ended with a semi-colon - var statementKeywords = words("always always_comb always_ff always_latch assert assign assume else export for foreach forever if import initial repeat while"); - - function tokenBase(stream, state) { - var ch = stream.peek(), style; - if (hooks[ch] && (style = hooks[ch](stream, state)) != false) return style; - if (hooks.tokenBase && (style = hooks.tokenBase(stream, state)) != false) - return style; - - if (/[,;:\.]/.test(ch)) { - curPunc = stream.next(); - return null; - } - if (isBracketChar.test(ch)) { - curPunc = stream.next(); - return "bracket"; - } - // Macros (tick-defines) - if (ch == '`') { - stream.next(); - if (stream.eatWhile(/[\w\$_]/)) { - return "def"; - } else { - return null; - } - } - // System calls - if (ch == '$') { - stream.next(); - if (stream.eatWhile(/[\w\$_]/)) { - return "meta"; - } else { - return null; - } - } - // Time literals - if (ch == '#') { - stream.next(); - stream.eatWhile(/[\d_.]/); - return "def"; - } - // Strings - if (ch == '"') { - stream.next(); - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - // Comments - if (ch == "/") { - stream.next(); - if (stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - stream.backUp(1); - } - - // Numeric literals - if (stream.match(realLiteral) || - stream.match(decimalLiteral) || - stream.match(binaryLiteral) || - stream.match(octLiteral) || - stream.match(hexLiteral) || - stream.match(unsignedNumber) || - stream.match(realLiteral)) { - return "number"; - } - - // Operators - if (stream.eatWhile(isOperatorChar)) { - return "meta"; - } - - // Keywords / plain variables - if (stream.eatWhile(/[\w\$_]/)) { - var cur = stream.current(); - if (keywords[cur]) { - if (openClose[cur]) { - curPunc = "newblock"; - } - if (statementKeywords[cur]) { - curPunc = "newstatement"; - } - curKeyword = cur; - return "keyword"; - } - return "variable"; - } - - stream.next(); - return null; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) {end = true; break;} - escaped = !escaped && next == "\\"; - } - if (end || !(escaped || multiLineStrings)) - state.tokenize = tokenBase; - return "string"; - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function Context(indented, column, type, align, prev) { - this.indented = indented; - this.column = column; - this.type = type; - this.align = align; - this.prev = prev; - } - function pushContext(state, col, type) { - var indent = state.indented; - var c = new Context(indent, col, type, null, state.context); - return state.context = c; - } - function popContext(state) { - var t = state.context.type; - if (t == ")" || t == "]" || t == "}") { - state.indented = state.context.indented; - } - return state.context = state.context.prev; - } - - function isClosing(text, contextClosing) { - if (text == contextClosing) { - return true; - } else { - // contextClosing may be mulitple keywords separated by ; - var closingKeywords = contextClosing.split(";"); - for (var i in closingKeywords) { - if (text == closingKeywords[i]) { - return true; - } - } - return false; - } - } - - function buildElectricInputRegEx() { - // Reindentation should occur on any bracket char: {}()[] - // or on a match of any of the block closing keywords, at - // the end of a line - var allClosings = []; - for (var i in openClose) { - if (openClose[i]) { - var closings = openClose[i].split(";"); - for (var j in closings) { - allClosings.push(closings[j]); - } - } - } - var re = new RegExp("[{}()\\[\\]]|(" + allClosings.join("|") + ")$"); - return re; - } - - // Interface - return { - - // Regex to force current line to reindent - electricInput: buildElectricInputRegEx(), - - startState: function(basecolumn) { - var state = { - tokenize: null, - context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), - indented: 0, - startOfLine: true - }; - if (hooks.startState) hooks.startState(state); - return state; - }, - - token: function(stream, state) { - var ctx = state.context; - if (stream.sol()) { - if (ctx.align == null) ctx.align = false; - state.indented = stream.indentation(); - state.startOfLine = true; - } - if (hooks.token) hooks.token(stream, state); - if (stream.eatSpace()) return null; - curPunc = null; - curKeyword = null; - var style = (state.tokenize || tokenBase)(stream, state); - if (style == "comment" || style == "meta" || style == "variable") return style; - if (ctx.align == null) ctx.align = true; - - if (curPunc == ctx.type) { - popContext(state); - } else if ((curPunc == ";" && ctx.type == "statement") || - (ctx.type && isClosing(curKeyword, ctx.type))) { - ctx = popContext(state); - while (ctx && ctx.type == "statement") ctx = popContext(state); - } else if (curPunc == "{") { - pushContext(state, stream.column(), "}"); - } else if (curPunc == "[") { - pushContext(state, stream.column(), "]"); - } else if (curPunc == "(") { - pushContext(state, stream.column(), ")"); - } else if (ctx && ctx.type == "endcase" && curPunc == ":") { - pushContext(state, stream.column(), "statement"); - } else if (curPunc == "newstatement") { - pushContext(state, stream.column(), "statement"); - } else if (curPunc == "newblock") { - if (curKeyword == "function" && ctx && (ctx.type == "statement" || ctx.type == "endgroup")) { - // The 'function' keyword can appear in some other contexts where it actually does not - // indicate a function (import/export DPI and covergroup definitions). - // Do nothing in this case - } else if (curKeyword == "task" && ctx && ctx.type == "statement") { - // Same thing for task - } else { - var close = openClose[curKeyword]; - pushContext(state, stream.column(), close); - } - } - - state.startOfLine = false; - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass; - if (hooks.indent) { - var fromHook = hooks.indent(state); - if (fromHook >= 0) return fromHook; - } - var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); - if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev; - var closing = false; - var possibleClosing = textAfter.match(closingBracketOrWord); - if (possibleClosing) - closing = isClosing(possibleClosing[0], ctx.type); - if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit); - else if (closingBracket.test(ctx.type) && ctx.align && !dontAlignCalls) return ctx.column + (closing ? 0 : 1); - else if (ctx.type == ")" && !closing) return ctx.indented + statementIndentUnit; - else return ctx.indented + (closing ? 0 : indentUnit); - }, - - blockCommentStart: "/*", - blockCommentEnd: "*/", - lineComment: "//" - }; -}); - - CodeMirror.defineMIME("text/x-verilog", { - name: "verilog" - }); - - CodeMirror.defineMIME("text/x-systemverilog", { - name: "verilog" - }); - - // SVXVerilog mode - - var svxchScopePrefixes = { - ">": "property", "->": "property", "-": "hr", "|": "link", "?$": "qualifier", "?*": "qualifier", - "@-": "variable-3", "@": "variable-3", "?": "qualifier" - }; - - function svxGenIndent(stream, state) { - var svxindentUnit = 2; - var rtnIndent = -1, indentUnitRq = 0, curIndent = stream.indentation(); - switch (state.svxCurCtlFlowChar) { - case "\\": - curIndent = 0; - break; - case "|": - if (state.svxPrevPrevCtlFlowChar == "@") { - indentUnitRq = -2; //-2 new pipe rq after cur pipe - break; - } - if (svxchScopePrefixes[state.svxPrevCtlFlowChar]) - indentUnitRq = 1; // +1 new scope - break; - case "M": // m4 - if (state.svxPrevPrevCtlFlowChar == "@") { - indentUnitRq = -2; //-2 new inst rq after pipe - break; - } - if (svxchScopePrefixes[state.svxPrevCtlFlowChar]) - indentUnitRq = 1; // +1 new scope - break; - case "@": - if (state.svxPrevCtlFlowChar == "S") - indentUnitRq = -1; // new pipe stage after stmts - if (state.svxPrevCtlFlowChar == "|") - indentUnitRq = 1; // 1st pipe stage - break; - case "S": - if (state.svxPrevCtlFlowChar == "@") - indentUnitRq = 1; // flow in pipe stage - if (svxchScopePrefixes[state.svxPrevCtlFlowChar]) - indentUnitRq = 1; // +1 new scope - break; - } - var statementIndentUnit = svxindentUnit; - rtnIndent = curIndent + (indentUnitRq*statementIndentUnit); - return rtnIndent >= 0 ? rtnIndent : curIndent; - } - - CodeMirror.defineMIME("text/x-svx", { - name: "verilog", - hooks: { - "\\": function(stream, state) { - var vxIndent = 0, style = false; - var curPunc = stream.string; - if ((stream.sol()) && (/\\SV/.test(stream.string))) { - curPunc = (/\\SVX_version/.test(stream.string)) - ? "\\SVX_version" : stream.string; - stream.skipToEnd(); - if (curPunc == "\\SV" && state.vxCodeActive) {state.vxCodeActive = false;}; - if ((/\\SVX/.test(curPunc) && !state.vxCodeActive) - || (curPunc=="\\SVX_version" && state.vxCodeActive)) {state.vxCodeActive = true;}; - style = "keyword"; - state.svxCurCtlFlowChar = state.svxPrevPrevCtlFlowChar - = state.svxPrevCtlFlowChar = ""; - if (state.vxCodeActive == true) { - state.svxCurCtlFlowChar = "\\"; - vxIndent = svxGenIndent(stream, state); - } - state.vxIndentRq = vxIndent; - } - return style; - }, - tokenBase: function(stream, state) { - var vxIndent = 0, style = false; - var svxisOperatorChar = /[\[\]=:]/; - var svxkpScopePrefixs = { - "**":"variable-2", "*":"variable-2", "$$":"variable", "$":"variable", - "^^":"attribute", "^":"attribute"}; - var ch = stream.peek(); - var vxCurCtlFlowCharValueAtStart = state.svxCurCtlFlowChar; - if (state.vxCodeActive == true) { - if (/[\[\]{}\(\);\:]/.test(ch)) { - // bypass nesting and 1 char punc - style = "meta"; - stream.next(); - } else if (ch == "/") { - stream.next(); - if (stream.eat("/")) { - stream.skipToEnd(); - style = "comment"; - state.svxCurCtlFlowChar = "S"; - } else { - stream.backUp(1); - } - } else if (ch == "@") { - // pipeline stage - style = svxchScopePrefixes[ch]; - state.svxCurCtlFlowChar = "@"; - stream.next(); - stream.eatWhile(/[\w\$_]/); - } else if (stream.match(/\b[mM]4+/, true)) { // match: function(pattern, consume, caseInsensitive) - // m4 pre proc - stream.skipTo("("); - style = "def"; - state.svxCurCtlFlowChar = "M"; - } else if (ch == "!" && stream.sol()) { - // v stmt in svx region - // state.svxCurCtlFlowChar = "S"; - style = "comment"; - stream.next(); - } else if (svxisOperatorChar.test(ch)) { - // operators - stream.eatWhile(svxisOperatorChar); - style = "operator"; - } else if (ch == "#") { - // phy hier - state.svxCurCtlFlowChar = (state.svxCurCtlFlowChar == "") - ? ch : state.svxCurCtlFlowChar; - stream.next(); - stream.eatWhile(/[+-]\d/); - style = "tag"; - } else if (svxkpScopePrefixs.propertyIsEnumerable(ch)) { - // special SVX operators - style = svxkpScopePrefixs[ch]; - state.svxCurCtlFlowChar = state.svxCurCtlFlowChar == "" ? "S" : state.svxCurCtlFlowChar; // stmt - stream.next(); - stream.match(/[a-zA-Z_0-9]+/); - } else if (style = svxchScopePrefixes[ch] || false) { - // special SVX operators - state.svxCurCtlFlowChar = state.svxCurCtlFlowChar == "" ? ch : state.svxCurCtlFlowChar; - stream.next(); - stream.match(/[a-zA-Z_0-9]+/); - } - if (state.svxCurCtlFlowChar != vxCurCtlFlowCharValueAtStart) { // flow change - vxIndent = svxGenIndent(stream, state); - state.vxIndentRq = vxIndent; - } - } - return style; - }, - token: function(stream, state) { - if (state.vxCodeActive == true && stream.sol() && state.svxCurCtlFlowChar != "") { - state.svxPrevPrevCtlFlowChar = state.svxPrevCtlFlowChar; - state.svxPrevCtlFlowChar = state.svxCurCtlFlowChar; - state.svxCurCtlFlowChar = ""; - } - }, - indent: function(state) { - return (state.vxCodeActive == true) ? state.vxIndentRq : -1; - }, - startState: function(state) { - state.svxCurCtlFlowChar = ""; - state.svxPrevCtlFlowChar = ""; - state.svxPrevPrevCtlFlowChar = ""; - state.vxCodeActive = true; - state.vxIndentRq = 0; - } - } - }); -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/xml/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/xml/index.html deleted file mode 100644 index 7149f06..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/xml/index.html +++ /dev/null @@ -1,57 +0,0 @@ - - -CodeMirror: XML mode - - - - - - - - - -
        -

        XML mode

        -
        - -

        The XML mode supports two configuration parameters:

        -
        -
        htmlMode (boolean)
        -
        This switches the mode to parse HTML instead of XML. This - means attributes do not have to be quoted, and some elements - (such as br) do not require a closing tag.
        -
        alignCDATA (boolean)
        -
        Setting this to true will force the opening tag of CDATA - blocks to not be indented.
        -
        - -

        MIME types defined: application/xml, text/html.

        -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/xml/test.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/xml/test.js deleted file mode 100644 index f48156b..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/xml/test.js +++ /dev/null @@ -1,51 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({indentUnit: 2}, "xml"), mname = "xml"; - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), mname); } - - MT("matching", - "[tag&bracket <][tag top][tag&bracket >]", - " text", - " [tag&bracket <][tag inner][tag&bracket />]", - "[tag&bracket ]"); - - MT("nonmatching", - "[tag&bracket <][tag top][tag&bracket >]", - " [tag&bracket <][tag inner][tag&bracket />]", - " [tag&bracket ]"); - - MT("doctype", - "[meta ]", - "[tag&bracket <][tag top][tag&bracket />]"); - - MT("cdata", - "[tag&bracket <][tag top][tag&bracket >]", - " [atom ]", - "[tag&bracket ]"); - - // HTML tests - mode = CodeMirror.getMode({indentUnit: 2}, "text/html"); - - MT("selfclose", - "[tag&bracket <][tag html][tag&bracket >]", - " [tag&bracket <][tag link] [attribute rel]=[string stylesheet] [attribute href]=[string \"/foobar\"][tag&bracket >]", - "[tag&bracket ]"); - - MT("list", - "[tag&bracket <][tag ol][tag&bracket >]", - " [tag&bracket <][tag li][tag&bracket >]one", - " [tag&bracket <][tag li][tag&bracket >]two", - "[tag&bracket ]"); - - MT("valueless", - "[tag&bracket <][tag input] [attribute type]=[string checkbox] [attribute checked][tag&bracket />]"); - - MT("pThenArticle", - "[tag&bracket <][tag p][tag&bracket >]", - " foo", - "[tag&bracket <][tag article][tag&bracket >]bar"); - -})(); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/xml/xml.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/xml/xml.js deleted file mode 100644 index 2f3b8f8..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/xml/xml.js +++ /dev/null @@ -1,384 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("xml", function(config, parserConfig) { - var indentUnit = config.indentUnit; - var multilineTagIndentFactor = parserConfig.multilineTagIndentFactor || 1; - var multilineTagIndentPastTag = parserConfig.multilineTagIndentPastTag; - if (multilineTagIndentPastTag == null) multilineTagIndentPastTag = true; - - var Kludges = parserConfig.htmlMode ? { - autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true, - 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true, - 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true, - 'track': true, 'wbr': true, 'menuitem': true}, - implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true, - 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true, - 'th': true, 'tr': true}, - contextGrabbers: { - 'dd': {'dd': true, 'dt': true}, - 'dt': {'dd': true, 'dt': true}, - 'li': {'li': true}, - 'option': {'option': true, 'optgroup': true}, - 'optgroup': {'optgroup': true}, - 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true, - 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true, - 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true, - 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true, - 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true}, - 'rp': {'rp': true, 'rt': true}, - 'rt': {'rp': true, 'rt': true}, - 'tbody': {'tbody': true, 'tfoot': true}, - 'td': {'td': true, 'th': true}, - 'tfoot': {'tbody': true}, - 'th': {'td': true, 'th': true}, - 'thead': {'tbody': true, 'tfoot': true}, - 'tr': {'tr': true} - }, - doNotIndent: {"pre": true}, - allowUnquoted: true, - allowMissing: true, - caseFold: true - } : { - autoSelfClosers: {}, - implicitlyClosed: {}, - contextGrabbers: {}, - doNotIndent: {}, - allowUnquoted: false, - allowMissing: false, - caseFold: false - }; - var alignCDATA = parserConfig.alignCDATA; - - // Return variables for tokenizers - var type, setStyle; - - function inText(stream, state) { - function chain(parser) { - state.tokenize = parser; - return parser(stream, state); - } - - var ch = stream.next(); - if (ch == "<") { - if (stream.eat("!")) { - if (stream.eat("[")) { - if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>")); - else return null; - } else if (stream.match("--")) { - return chain(inBlock("comment", "-->")); - } else if (stream.match("DOCTYPE", true, true)) { - stream.eatWhile(/[\w\._\-]/); - return chain(doctype(1)); - } else { - return null; - } - } else if (stream.eat("?")) { - stream.eatWhile(/[\w\._\-]/); - state.tokenize = inBlock("meta", "?>"); - return "meta"; - } else { - type = stream.eat("/") ? "closeTag" : "openTag"; - state.tokenize = inTag; - return "tag bracket"; - } - } else if (ch == "&") { - var ok; - if (stream.eat("#")) { - if (stream.eat("x")) { - ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";"); - } else { - ok = stream.eatWhile(/[\d]/) && stream.eat(";"); - } - } else { - ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";"); - } - return ok ? "atom" : "error"; - } else { - stream.eatWhile(/[^&<]/); - return null; - } - } - - function inTag(stream, state) { - var ch = stream.next(); - if (ch == ">" || (ch == "/" && stream.eat(">"))) { - state.tokenize = inText; - type = ch == ">" ? "endTag" : "selfcloseTag"; - return "tag bracket"; - } else if (ch == "=") { - type = "equals"; - return null; - } else if (ch == "<") { - state.tokenize = inText; - state.state = baseState; - state.tagName = state.tagStart = null; - var next = state.tokenize(stream, state); - return next ? next + " tag error" : "tag error"; - } else if (/[\'\"]/.test(ch)) { - state.tokenize = inAttribute(ch); - state.stringStartCol = stream.column(); - return state.tokenize(stream, state); - } else { - stream.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/); - return "word"; - } - } - - function inAttribute(quote) { - var closure = function(stream, state) { - while (!stream.eol()) { - if (stream.next() == quote) { - state.tokenize = inTag; - break; - } - } - return "string"; - }; - closure.isInAttribute = true; - return closure; - } - - function inBlock(style, terminator) { - return function(stream, state) { - while (!stream.eol()) { - if (stream.match(terminator)) { - state.tokenize = inText; - break; - } - stream.next(); - } - return style; - }; - } - function doctype(depth) { - return function(stream, state) { - var ch; - while ((ch = stream.next()) != null) { - if (ch == "<") { - state.tokenize = doctype(depth + 1); - return state.tokenize(stream, state); - } else if (ch == ">") { - if (depth == 1) { - state.tokenize = inText; - break; - } else { - state.tokenize = doctype(depth - 1); - return state.tokenize(stream, state); - } - } - } - return "meta"; - }; - } - - function Context(state, tagName, startOfLine) { - this.prev = state.context; - this.tagName = tagName; - this.indent = state.indented; - this.startOfLine = startOfLine; - if (Kludges.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent)) - this.noIndent = true; - } - function popContext(state) { - if (state.context) state.context = state.context.prev; - } - function maybePopContext(state, nextTagName) { - var parentTagName; - while (true) { - if (!state.context) { - return; - } - parentTagName = state.context.tagName; - if (!Kludges.contextGrabbers.hasOwnProperty(parentTagName) || - !Kludges.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) { - return; - } - popContext(state); - } - } - - function baseState(type, stream, state) { - if (type == "openTag") { - state.tagStart = stream.column(); - return tagNameState; - } else if (type == "closeTag") { - return closeTagNameState; - } else { - return baseState; - } - } - function tagNameState(type, stream, state) { - if (type == "word") { - state.tagName = stream.current(); - setStyle = "tag"; - return attrState; - } else { - setStyle = "error"; - return tagNameState; - } - } - function closeTagNameState(type, stream, state) { - if (type == "word") { - var tagName = stream.current(); - if (state.context && state.context.tagName != tagName && - Kludges.implicitlyClosed.hasOwnProperty(state.context.tagName)) - popContext(state); - if (state.context && state.context.tagName == tagName) { - setStyle = "tag"; - return closeState; - } else { - setStyle = "tag error"; - return closeStateErr; - } - } else { - setStyle = "error"; - return closeStateErr; - } - } - - function closeState(type, _stream, state) { - if (type != "endTag") { - setStyle = "error"; - return closeState; - } - popContext(state); - return baseState; - } - function closeStateErr(type, stream, state) { - setStyle = "error"; - return closeState(type, stream, state); - } - - function attrState(type, _stream, state) { - if (type == "word") { - setStyle = "attribute"; - return attrEqState; - } else if (type == "endTag" || type == "selfcloseTag") { - var tagName = state.tagName, tagStart = state.tagStart; - state.tagName = state.tagStart = null; - if (type == "selfcloseTag" || - Kludges.autoSelfClosers.hasOwnProperty(tagName)) { - maybePopContext(state, tagName); - } else { - maybePopContext(state, tagName); - state.context = new Context(state, tagName, tagStart == state.indented); - } - return baseState; - } - setStyle = "error"; - return attrState; - } - function attrEqState(type, stream, state) { - if (type == "equals") return attrValueState; - if (!Kludges.allowMissing) setStyle = "error"; - return attrState(type, stream, state); - } - function attrValueState(type, stream, state) { - if (type == "string") return attrContinuedState; - if (type == "word" && Kludges.allowUnquoted) {setStyle = "string"; return attrState;} - setStyle = "error"; - return attrState(type, stream, state); - } - function attrContinuedState(type, stream, state) { - if (type == "string") return attrContinuedState; - return attrState(type, stream, state); - } - - return { - startState: function() { - return {tokenize: inText, - state: baseState, - indented: 0, - tagName: null, tagStart: null, - context: null}; - }, - - token: function(stream, state) { - if (!state.tagName && stream.sol()) - state.indented = stream.indentation(); - - if (stream.eatSpace()) return null; - type = null; - var style = state.tokenize(stream, state); - if ((style || type) && style != "comment") { - setStyle = null; - state.state = state.state(type || style, stream, state); - if (setStyle) - style = setStyle == "error" ? style + " error" : setStyle; - } - return style; - }, - - indent: function(state, textAfter, fullLine) { - var context = state.context; - // Indent multi-line strings (e.g. css). - if (state.tokenize.isInAttribute) { - if (state.tagStart == state.indented) - return state.stringStartCol + 1; - else - return state.indented + indentUnit; - } - if (context && context.noIndent) return CodeMirror.Pass; - if (state.tokenize != inTag && state.tokenize != inText) - return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0; - // Indent the starts of attribute names. - if (state.tagName) { - if (multilineTagIndentPastTag) - return state.tagStart + state.tagName.length + 2; - else - return state.tagStart + indentUnit * multilineTagIndentFactor; - } - if (alignCDATA && /$/, - blockCommentStart: "", - - configuration: parserConfig.htmlMode ? "html" : "xml", - helperType: parserConfig.htmlMode ? "html" : "xml" - }; -}); - -CodeMirror.defineMIME("text/xml", "xml"); -CodeMirror.defineMIME("application/xml", "xml"); -if (!CodeMirror.mimeModes.hasOwnProperty("text/html")) - CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true}); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/xquery/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/xquery/index.html deleted file mode 100644 index 7ac5aae..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/xquery/index.html +++ /dev/null @@ -1,210 +0,0 @@ - - -CodeMirror: XQuery mode - - - - - - - - - - -
        -

        XQuery mode

        - - -
        - -
        - - - -

        MIME types defined: application/xquery.

        - -

        Development of the CodeMirror XQuery mode was sponsored by - MarkLogic and developed by - Mike Brevoort. -

        - -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/xquery/test.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/xquery/test.js deleted file mode 100644 index 1f148cd..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/xquery/test.js +++ /dev/null @@ -1,67 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Don't take these too seriously -- the expected results appear to be -// based on the results of actual runs without any serious manual -// verification. If a change you made causes them to fail, the test is -// as likely to wrong as the code. - -(function() { - var mode = CodeMirror.getMode({tabSize: 4}, "xquery"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - MT("eviltest", - "[keyword xquery] [keyword version] [variable "1][keyword .][atom 0][keyword -][variable ml"][def&variable ;] [comment (: this is : a \"comment\" :)]", - " [keyword let] [variable $let] [keyword :=] [variable <x] [variable attr][keyword =][variable "value">"test"<func>][def&variable ;function]() [variable $var] {[keyword function]()} {[variable $var]}[variable <][keyword /][variable func><][keyword /][variable x>]", - " [keyword let] [variable $joe][keyword :=][atom 1]", - " [keyword return] [keyword element] [variable element] {", - " [keyword attribute] [variable attribute] { [atom 1] },", - " [keyword element] [variable test] { [variable 'a'] }, [keyword attribute] [variable foo] { [variable "bar"] },", - " [def&variable fn:doc]()[[ [variable foo][keyword /][variable @bar] [keyword eq] [variable $let] ]],", - " [keyword //][variable x] } [comment (: a more 'evil' test :)]", - " [comment (: Modified Blakeley example (: with nested comment :) ... :)]", - " [keyword declare] [keyword private] [keyword function] [def&variable local:declare]() {()}[variable ;]", - " [keyword declare] [keyword private] [keyword function] [def&variable local:private]() {()}[variable ;]", - " [keyword declare] [keyword private] [keyword function] [def&variable local:function]() {()}[variable ;]", - " [keyword declare] [keyword private] [keyword function] [def&variable local:local]() {()}[variable ;]", - " [keyword let] [variable $let] [keyword :=] [variable <let>let] [variable $let] [keyword :=] [variable "let"<][keyword /let][variable >]", - " [keyword return] [keyword element] [variable element] {", - " [keyword attribute] [variable attribute] { [keyword try] { [def&variable xdmp:version]() } [keyword catch]([variable $e]) { [def&variable xdmp:log]([variable $e]) } },", - " [keyword attribute] [variable fn:doc] { [variable "bar"] [variable castable] [keyword as] [atom xs:string] },", - " [keyword element] [variable text] { [keyword text] { [variable "text"] } },", - " [def&variable fn:doc]()[[ [qualifier child::][variable eq][keyword /]([variable @bar] [keyword |] [qualifier attribute::][variable attribute]) [keyword eq] [variable $let] ]],", - " [keyword //][variable fn:doc]", - " }"); - - MT("testEmptySequenceKeyword", - "[string \"foo\"] [keyword instance] [keyword of] [keyword empty-sequence]()"); - - MT("testMultiAttr", - "[tag

        ][variable hello] [variable world][tag

        ]"); - - MT("test namespaced variable", - "[keyword declare] [keyword namespace] [variable e] [keyword =] [string \"http://example.com/ANamespace\"][variable ;declare] [keyword variable] [variable $e:exampleComThisVarIsNotRecognized] [keyword as] [keyword element]([keyword *]) [variable external;]"); - - MT("test EQName variable", - "[keyword declare] [keyword variable] [variable $\"http://www.example.com/ns/my\":var] [keyword :=] [atom 12][variable ;]", - "[tag ]{[variable $\"http://www.example.com/ns/my\":var]}[tag ]"); - - MT("test EQName function", - "[keyword declare] [keyword function] [def&variable \"http://www.example.com/ns/my\":fn] ([variable $a] [keyword as] [atom xs:integer]) [keyword as] [atom xs:integer] {", - " [variable $a] [keyword +] [atom 2]", - "}[variable ;]", - "[tag ]{[def&variable \"http://www.example.com/ns/my\":fn]([atom 12])}[tag ]"); - - MT("test EQName function with single quotes", - "[keyword declare] [keyword function] [def&variable 'http://www.example.com/ns/my':fn] ([variable $a] [keyword as] [atom xs:integer]) [keyword as] [atom xs:integer] {", - " [variable $a] [keyword +] [atom 2]", - "}[variable ;]", - "[tag ]{[def&variable 'http://www.example.com/ns/my':fn]([atom 12])}[tag ]"); - - MT("testProcessingInstructions", - "[def&variable data]([comment&meta ]) [keyword instance] [keyword of] [atom xs:string]"); - - MT("testQuoteEscapeDouble", - "[keyword let] [variable $rootfolder] [keyword :=] [string \"c:\\builds\\winnt\\HEAD\\qa\\scripts\\\"]", - "[keyword let] [variable $keysfolder] [keyword :=] [def&variable concat]([variable $rootfolder], [string \"keys\\\"])"); -})(); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/xquery/xquery.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/xquery/xquery.js deleted file mode 100644 index c8f3d90..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/xquery/xquery.js +++ /dev/null @@ -1,447 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("xquery", function() { - - // The keywords object is set to the result of this self executing - // function. Each keyword is a property of the keywords object whose - // value is {type: atype, style: astyle} - var keywords = function(){ - // conveinence functions used to build keywords object - function kw(type) {return {type: type, style: "keyword"};} - var A = kw("keyword a") - , B = kw("keyword b") - , C = kw("keyword c") - , operator = kw("operator") - , atom = {type: "atom", style: "atom"} - , punctuation = {type: "punctuation", style: null} - , qualifier = {type: "axis_specifier", style: "qualifier"}; - - // kwObj is what is return from this function at the end - var kwObj = { - 'if': A, 'switch': A, 'while': A, 'for': A, - 'else': B, 'then': B, 'try': B, 'finally': B, 'catch': B, - 'element': C, 'attribute': C, 'let': C, 'implements': C, 'import': C, 'module': C, 'namespace': C, - 'return': C, 'super': C, 'this': C, 'throws': C, 'where': C, 'private': C, - ',': punctuation, - 'null': atom, 'fn:false()': atom, 'fn:true()': atom - }; - - // a list of 'basic' keywords. For each add a property to kwObj with the value of - // {type: basic[i], style: "keyword"} e.g. 'after' --> {type: "after", style: "keyword"} - var basic = ['after','ancestor','ancestor-or-self','and','as','ascending','assert','attribute','before', - 'by','case','cast','child','comment','declare','default','define','descendant','descendant-or-self', - 'descending','document','document-node','element','else','eq','every','except','external','following', - 'following-sibling','follows','for','function','if','import','in','instance','intersect','item', - 'let','module','namespace','node','node','of','only','or','order','parent','precedes','preceding', - 'preceding-sibling','processing-instruction','ref','return','returns','satisfies','schema','schema-element', - 'self','some','sortby','stable','text','then','to','treat','typeswitch','union','variable','version','where', - 'xquery', 'empty-sequence']; - for(var i=0, l=basic.length; i < l; i++) { kwObj[basic[i]] = kw(basic[i]);}; - - // a list of types. For each add a property to kwObj with the value of - // {type: "atom", style: "atom"} - var types = ['xs:string', 'xs:float', 'xs:decimal', 'xs:double', 'xs:integer', 'xs:boolean', 'xs:date', 'xs:dateTime', - 'xs:time', 'xs:duration', 'xs:dayTimeDuration', 'xs:time', 'xs:yearMonthDuration', 'numeric', 'xs:hexBinary', - 'xs:base64Binary', 'xs:anyURI', 'xs:QName', 'xs:byte','xs:boolean','xs:anyURI','xf:yearMonthDuration']; - for(var i=0, l=types.length; i < l; i++) { kwObj[types[i]] = atom;}; - - // each operator will add a property to kwObj with value of {type: "operator", style: "keyword"} - var operators = ['eq', 'ne', 'lt', 'le', 'gt', 'ge', ':=', '=', '>', '>=', '<', '<=', '.', '|', '?', 'and', 'or', 'div', 'idiv', 'mod', '*', '/', '+', '-']; - for(var i=0, l=operators.length; i < l; i++) { kwObj[operators[i]] = operator;}; - - // each axis_specifiers will add a property to kwObj with value of {type: "axis_specifier", style: "qualifier"} - var axis_specifiers = ["self::", "attribute::", "child::", "descendant::", "descendant-or-self::", "parent::", - "ancestor::", "ancestor-or-self::", "following::", "preceding::", "following-sibling::", "preceding-sibling::"]; - for(var i=0, l=axis_specifiers.length; i < l; i++) { kwObj[axis_specifiers[i]] = qualifier; }; - - return kwObj; - }(); - - // Used as scratch variables to communicate multiple values without - // consing up tons of objects. - var type, content; - - function ret(tp, style, cont) { - type = tp; content = cont; - return style; - } - - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - - // the primary mode tokenizer - function tokenBase(stream, state) { - var ch = stream.next(), - mightBeFunction = false, - isEQName = isEQNameAhead(stream); - - // an XML tag (if not in some sub, chained tokenizer) - if (ch == "<") { - if(stream.match("!--", true)) - return chain(stream, state, tokenXMLComment); - - if(stream.match("![CDATA", false)) { - state.tokenize = tokenCDATA; - return ret("tag", "tag"); - } - - if(stream.match("?", false)) { - return chain(stream, state, tokenPreProcessing); - } - - var isclose = stream.eat("/"); - stream.eatSpace(); - var tagName = "", c; - while ((c = stream.eat(/[^\s\u00a0=<>\"\'\/?]/))) tagName += c; - - return chain(stream, state, tokenTag(tagName, isclose)); - } - // start code block - else if(ch == "{") { - pushStateStack(state,{ type: "codeblock"}); - return ret("", null); - } - // end code block - else if(ch == "}") { - popStateStack(state); - return ret("", null); - } - // if we're in an XML block - else if(isInXmlBlock(state)) { - if(ch == ">") - return ret("tag", "tag"); - else if(ch == "/" && stream.eat(">")) { - popStateStack(state); - return ret("tag", "tag"); - } - else - return ret("word", "variable"); - } - // if a number - else if (/\d/.test(ch)) { - stream.match(/^\d*(?:\.\d*)?(?:E[+\-]?\d+)?/); - return ret("number", "atom"); - } - // comment start - else if (ch === "(" && stream.eat(":")) { - pushStateStack(state, { type: "comment"}); - return chain(stream, state, tokenComment); - } - // quoted string - else if ( !isEQName && (ch === '"' || ch === "'")) - return chain(stream, state, tokenString(ch)); - // variable - else if(ch === "$") { - return chain(stream, state, tokenVariable); - } - // assignment - else if(ch ===":" && stream.eat("=")) { - return ret("operator", "keyword"); - } - // open paren - else if(ch === "(") { - pushStateStack(state, { type: "paren"}); - return ret("", null); - } - // close paren - else if(ch === ")") { - popStateStack(state); - return ret("", null); - } - // open paren - else if(ch === "[") { - pushStateStack(state, { type: "bracket"}); - return ret("", null); - } - // close paren - else if(ch === "]") { - popStateStack(state); - return ret("", null); - } - else { - var known = keywords.propertyIsEnumerable(ch) && keywords[ch]; - - // if there's a EQName ahead, consume the rest of the string portion, it's likely a function - if(isEQName && ch === '\"') while(stream.next() !== '"'){} - if(isEQName && ch === '\'') while(stream.next() !== '\''){} - - // gobble up a word if the character is not known - if(!known) stream.eatWhile(/[\w\$_-]/); - - // gobble a colon in the case that is a lib func type call fn:doc - var foundColon = stream.eat(":"); - - // if there's not a second colon, gobble another word. Otherwise, it's probably an axis specifier - // which should get matched as a keyword - if(!stream.eat(":") && foundColon) { - stream.eatWhile(/[\w\$_-]/); - } - // if the next non whitespace character is an open paren, this is probably a function (if not a keyword of other sort) - if(stream.match(/^[ \t]*\(/, false)) { - mightBeFunction = true; - } - // is the word a keyword? - var word = stream.current(); - known = keywords.propertyIsEnumerable(word) && keywords[word]; - - // if we think it's a function call but not yet known, - // set style to variable for now for lack of something better - if(mightBeFunction && !known) known = {type: "function_call", style: "variable def"}; - - // if the previous word was element, attribute, axis specifier, this word should be the name of that - if(isInXmlConstructor(state)) { - popStateStack(state); - return ret("word", "variable", word); - } - // as previously checked, if the word is element,attribute, axis specifier, call it an "xmlconstructor" and - // push the stack so we know to look for it on the next word - if(word == "element" || word == "attribute" || known.type == "axis_specifier") pushStateStack(state, {type: "xmlconstructor"}); - - // if the word is known, return the details of that else just call this a generic 'word' - return known ? ret(known.type, known.style, word) : - ret("word", "variable", word); - } - } - - // handle comments, including nested - function tokenComment(stream, state) { - var maybeEnd = false, maybeNested = false, nestedCount = 0, ch; - while (ch = stream.next()) { - if (ch == ")" && maybeEnd) { - if(nestedCount > 0) - nestedCount--; - else { - popStateStack(state); - break; - } - } - else if(ch == ":" && maybeNested) { - nestedCount++; - } - maybeEnd = (ch == ":"); - maybeNested = (ch == "("); - } - - return ret("comment", "comment"); - } - - // tokenizer for string literals - // optionally pass a tokenizer function to set state.tokenize back to when finished - function tokenString(quote, f) { - return function(stream, state) { - var ch; - - if(isInString(state) && stream.current() == quote) { - popStateStack(state); - if(f) state.tokenize = f; - return ret("string", "string"); - } - - pushStateStack(state, { type: "string", name: quote, tokenize: tokenString(quote, f) }); - - // if we're in a string and in an XML block, allow an embedded code block - if(stream.match("{", false) && isInXmlAttributeBlock(state)) { - state.tokenize = tokenBase; - return ret("string", "string"); - } - - - while (ch = stream.next()) { - if (ch == quote) { - popStateStack(state); - if(f) state.tokenize = f; - break; - } - else { - // if we're in a string and in an XML block, allow an embedded code block in an attribute - if(stream.match("{", false) && isInXmlAttributeBlock(state)) { - state.tokenize = tokenBase; - return ret("string", "string"); - } - - } - } - - return ret("string", "string"); - }; - } - - // tokenizer for variables - function tokenVariable(stream, state) { - var isVariableChar = /[\w\$_-]/; - - // a variable may start with a quoted EQName so if the next character is quote, consume to the next quote - if(stream.eat("\"")) { - while(stream.next() !== '\"'){}; - stream.eat(":"); - } else { - stream.eatWhile(isVariableChar); - if(!stream.match(":=", false)) stream.eat(":"); - } - stream.eatWhile(isVariableChar); - state.tokenize = tokenBase; - return ret("variable", "variable"); - } - - // tokenizer for XML tags - function tokenTag(name, isclose) { - return function(stream, state) { - stream.eatSpace(); - if(isclose && stream.eat(">")) { - popStateStack(state); - state.tokenize = tokenBase; - return ret("tag", "tag"); - } - // self closing tag without attributes? - if(!stream.eat("/")) - pushStateStack(state, { type: "tag", name: name, tokenize: tokenBase}); - if(!stream.eat(">")) { - state.tokenize = tokenAttribute; - return ret("tag", "tag"); - } - else { - state.tokenize = tokenBase; - } - return ret("tag", "tag"); - }; - } - - // tokenizer for XML attributes - function tokenAttribute(stream, state) { - var ch = stream.next(); - - if(ch == "/" && stream.eat(">")) { - if(isInXmlAttributeBlock(state)) popStateStack(state); - if(isInXmlBlock(state)) popStateStack(state); - return ret("tag", "tag"); - } - if(ch == ">") { - if(isInXmlAttributeBlock(state)) popStateStack(state); - return ret("tag", "tag"); - } - if(ch == "=") - return ret("", null); - // quoted string - if (ch == '"' || ch == "'") - return chain(stream, state, tokenString(ch, tokenAttribute)); - - if(!isInXmlAttributeBlock(state)) - pushStateStack(state, { type: "attribute", tokenize: tokenAttribute}); - - stream.eat(/[a-zA-Z_:]/); - stream.eatWhile(/[-a-zA-Z0-9_:.]/); - stream.eatSpace(); - - // the case where the attribute has not value and the tag was closed - if(stream.match(">", false) || stream.match("/", false)) { - popStateStack(state); - state.tokenize = tokenBase; - } - - return ret("attribute", "attribute"); - } - - // handle comments, including nested - function tokenXMLComment(stream, state) { - var ch; - while (ch = stream.next()) { - if (ch == "-" && stream.match("->", true)) { - state.tokenize = tokenBase; - return ret("comment", "comment"); - } - } - } - - - // handle CDATA - function tokenCDATA(stream, state) { - var ch; - while (ch = stream.next()) { - if (ch == "]" && stream.match("]", true)) { - state.tokenize = tokenBase; - return ret("comment", "comment"); - } - } - } - - // handle preprocessing instructions - function tokenPreProcessing(stream, state) { - var ch; - while (ch = stream.next()) { - if (ch == "?" && stream.match(">", true)) { - state.tokenize = tokenBase; - return ret("comment", "comment meta"); - } - } - } - - - // functions to test the current context of the state - function isInXmlBlock(state) { return isIn(state, "tag"); } - function isInXmlAttributeBlock(state) { return isIn(state, "attribute"); } - function isInXmlConstructor(state) { return isIn(state, "xmlconstructor"); } - function isInString(state) { return isIn(state, "string"); } - - function isEQNameAhead(stream) { - // assume we've already eaten a quote (") - if(stream.current() === '"') - return stream.match(/^[^\"]+\"\:/, false); - else if(stream.current() === '\'') - return stream.match(/^[^\"]+\'\:/, false); - else - return false; - } - - function isIn(state, type) { - return (state.stack.length && state.stack[state.stack.length - 1].type == type); - } - - function pushStateStack(state, newState) { - state.stack.push(newState); - } - - function popStateStack(state) { - state.stack.pop(); - var reinstateTokenize = state.stack.length && state.stack[state.stack.length-1].tokenize; - state.tokenize = reinstateTokenize || tokenBase; - } - - // the interface for the mode API - return { - startState: function() { - return { - tokenize: tokenBase, - cc: [], - stack: [] - }; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - return style; - }, - - blockCommentStart: "(:", - blockCommentEnd: ":)" - - }; - -}); - -CodeMirror.defineMIME("application/xquery", "xquery"); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/yaml/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/yaml/index.html deleted file mode 100644 index be9b632..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/yaml/index.html +++ /dev/null @@ -1,80 +0,0 @@ - - -CodeMirror: YAML mode - - - - - - - - - -
        -

        YAML mode

        -
        - - -

        MIME types defined: text/x-yaml.

        - -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/yaml/yaml.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/yaml/yaml.js deleted file mode 100644 index b7015e5..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/yaml/yaml.js +++ /dev/null @@ -1,117 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("yaml", function() { - - var cons = ['true', 'false', 'on', 'off', 'yes', 'no']; - var keywordRegex = new RegExp("\\b(("+cons.join(")|(")+"))$", 'i'); - - return { - token: function(stream, state) { - var ch = stream.peek(); - var esc = state.escaped; - state.escaped = false; - /* comments */ - if (ch == "#" && (stream.pos == 0 || /\s/.test(stream.string.charAt(stream.pos - 1)))) { - stream.skipToEnd(); - return "comment"; - } - - if (stream.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/)) - return "string"; - - if (state.literal && stream.indentation() > state.keyCol) { - stream.skipToEnd(); return "string"; - } else if (state.literal) { state.literal = false; } - if (stream.sol()) { - state.keyCol = 0; - state.pair = false; - state.pairStart = false; - /* document start */ - if(stream.match(/---/)) { return "def"; } - /* document end */ - if (stream.match(/\.\.\./)) { return "def"; } - /* array list item */ - if (stream.match(/\s*-\s+/)) { return 'meta'; } - } - /* inline pairs/lists */ - if (stream.match(/^(\{|\}|\[|\])/)) { - if (ch == '{') - state.inlinePairs++; - else if (ch == '}') - state.inlinePairs--; - else if (ch == '[') - state.inlineList++; - else - state.inlineList--; - return 'meta'; - } - - /* list seperator */ - if (state.inlineList > 0 && !esc && ch == ',') { - stream.next(); - return 'meta'; - } - /* pairs seperator */ - if (state.inlinePairs > 0 && !esc && ch == ',') { - state.keyCol = 0; - state.pair = false; - state.pairStart = false; - stream.next(); - return 'meta'; - } - - /* start of value of a pair */ - if (state.pairStart) { - /* block literals */ - if (stream.match(/^\s*(\||\>)\s*/)) { state.literal = true; return 'meta'; }; - /* references */ - if (stream.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i)) { return 'variable-2'; } - /* numbers */ - if (state.inlinePairs == 0 && stream.match(/^\s*-?[0-9\.\,]+\s?$/)) { return 'number'; } - if (state.inlinePairs > 0 && stream.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/)) { return 'number'; } - /* keywords */ - if (stream.match(keywordRegex)) { return 'keyword'; } - } - - /* pairs (associative arrays) -> key */ - if (!state.pair && stream.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)) { - state.pair = true; - state.keyCol = stream.indentation(); - return "atom"; - } - if (state.pair && stream.match(/^:\s*/)) { state.pairStart = true; return 'meta'; } - - /* nothing found, continue */ - state.pairStart = false; - state.escaped = (ch == '\\'); - stream.next(); - return null; - }, - startState: function() { - return { - pair: false, - pairStart: false, - keyCol: 0, - inlinePairs: 0, - inlineList: 0, - literal: false, - escaped: false - }; - } - }; -}); - -CodeMirror.defineMIME("text/x-yaml", "yaml"); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/z80/index.html b/src/main/resources/static/editor.md-master/lib/codemirror/mode/z80/index.html deleted file mode 100644 index 1ad3ace..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/z80/index.html +++ /dev/null @@ -1,52 +0,0 @@ - - -CodeMirror: Z80 assembly mode - - - - - - - - - -
        -

        Z80 assembly mode

        - - -
        - - - -

        MIME type defined: text/x-z80.

        -
        diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/mode/z80/z80.js b/src/main/resources/static/editor.md-master/lib/codemirror/mode/z80/z80.js deleted file mode 100644 index ec41d05..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/mode/z80/z80.js +++ /dev/null @@ -1,100 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode('z80', function() { - var keywords1 = /^(exx?|(ld|cp|in)([di]r?)?|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|rst|[de]i|halt|im|ot[di]r|out[di]?)\b/i; - var keywords2 = /^(call|j[pr]|ret[in]?)\b/i; - var keywords3 = /^b_?(call|jump)\b/i; - var variables1 = /^(af?|bc?|c|de?|e|hl?|l|i[xy]?|r|sp)\b/i; - var variables2 = /^(n?[zc]|p[oe]?|m)\b/i; - var errors = /^([hl][xy]|i[xy][hl]|slia|sll)\b/i; - var numbers = /^([\da-f]+h|[0-7]+o|[01]+b|\d+)\b/i; - - return { - startState: function() { - return {context: 0}; - }, - token: function(stream, state) { - if (!stream.column()) - state.context = 0; - - if (stream.eatSpace()) - return null; - - var w; - - if (stream.eatWhile(/\w/)) { - w = stream.current(); - - if (stream.indentation()) { - if (state.context == 1 && variables1.test(w)) - return 'variable-2'; - - if (state.context == 2 && variables2.test(w)) - return 'variable-3'; - - if (keywords1.test(w)) { - state.context = 1; - return 'keyword'; - } else if (keywords2.test(w)) { - state.context = 2; - return 'keyword'; - } else if (keywords3.test(w)) { - state.context = 3; - return 'keyword'; - } - - if (errors.test(w)) - return 'error'; - } else if (numbers.test(w)) { - return 'number'; - } else { - return null; - } - } else if (stream.eat(';')) { - stream.skipToEnd(); - return 'comment'; - } else if (stream.eat('"')) { - while (w = stream.next()) { - if (w == '"') - break; - - if (w == '\\') - stream.next(); - } - return 'string'; - } else if (stream.eat('\'')) { - if (stream.match(/\\?.'/)) - return 'number'; - } else if (stream.eat('.') || stream.sol() && stream.eat('#')) { - state.context = 4; - - if (stream.eatWhile(/\w/)) - return 'def'; - } else if (stream.eat('$')) { - if (stream.eatWhile(/[\da-f]/i)) - return 'number'; - } else if (stream.eat('%')) { - if (stream.eatWhile(/[01]/)) - return 'number'; - } else { - stream.next(); - } - return null; - } - }; -}); - -CodeMirror.defineMIME("text/x-z80", "z80"); - -}); diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/modes.min.js b/src/main/resources/static/editor.md-master/lib/codemirror/modes.min.js deleted file mode 100644 index 49faebe..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/modes.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/*! Editor.md v1.5.0 | modes.min.js | Open source online markdown editor. | MIT License | By: Pandao | https://github.com/pandao/editor.md | 2015-06-09 */ -!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror")):"function"==typeof define&&define.amd?define(["../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj"]},{name:"CoffeeScript",mime:"text/x-coffeescript",mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history).md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy"]},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Jade",mime:"text/x-jade",mode:"jade",ext:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"Jinja2",mime:"null",mode:"jinja2"},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"kotlin",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NTriples",mime:"text/n-triples",mode:"ntriples",ext:["nt"]},{name:"Objective C",mime:"text/x-objectivec",mode:"clike",ext:["m","mm"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mime:"application/x-httpd-php",mode:"php",ext:["php","php3","php4","php5","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["py","pyw"]},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mime:"text/x-sh",mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"]},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"SmartyMixed",mime:"text/x-smarty",mode:"smartymixed"},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"MariaDB",mime:"text/x-mariadb",mode:"sql"},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki ",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"YAML",mime:"text/x-yaml",mode:"yaml",ext:["yaml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]}];for(var t=0;t-1&&t.substring(i+1,t.length);return o?e.findModeByExtension(o):void 0},e.findModeByName=function(t){t=t.toLowerCase();for(var r=0;r")?(e.match("-->"),t.tokenize=null):e.skipToEnd(),["comment","comment"]}e.defineMode("css",function(t,r){function n(e,t){return m=t,e}function i(e,t){var r=e.next();if(g[r]){var i=g[r](e,t);if(i!==!1)return i}return"@"==r?(e.eatWhile(/[\w\\\-]/),n("def",e.current())):"="==r||("~"==r||"|"==r)&&e.eat("=")?n(null,"compare"):'"'==r||"'"==r?(t.tokenize=o(r),t.tokenize(e,t)):"#"==r?(e.eatWhile(/[\w\\\-]/),n("atom","hash")):"!"==r?(e.match(/^\s*\w*/),n("keyword","important")):/\d/.test(r)||"."==r&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),n("number","unit")):"-"!==r?/[,+>*\/]/.test(r)?n(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?n("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?n(null,r):"u"==r&&e.match(/rl(-prefix)?\(/)||"d"==r&&e.match("omain(")||"r"==r&&e.match("egexp(")?(e.backUp(1),t.tokenize=a,n("property","word")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),n("property","word")):n(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),n("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?n("variable-2","variable-definition"):n("variable-2","variable")):e.match(/^\w+-/)?n("meta","meta"):void 0}function o(e){return function(t,r){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==i}return(i==e||!o&&")"!=e)&&(r.tokenize=null),n("string","string")}}function a(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=o(")"),n(null,"(")}function s(e,t,r){this.type=e,this.indent=t,this.prev=r}function l(e,t,r){return e.context=new s(r,t.indentation()+p,e.context),r}function c(e){return e.context=e.context.prev,e.context.type}function u(e,t,r){return M[r.context.type](e,t,r)}function d(e,t,r,n){for(var i=n||1;i>0;i--)r.context=r.context.prev;return u(e,t,r)}function f(e){var t=e.current().toLowerCase();h=S.hasOwnProperty(t)?"atom":C.hasOwnProperty(t)?"keyword":"variable"}r.propertyKeywords||(r=e.resolveMode("text/css"));var m,h,p=t.indentUnit,g=r.tokenHooks,v=r.documentTypes||{},b=r.mediaTypes||{},y=r.mediaFeatures||{},x=r.propertyKeywords||{},k=r.nonStandardPropertyKeywords||{},w=r.fontProperties||{},_=r.counterDescriptors||{},C=r.colorKeywords||{},S=r.valueKeywords||{},T=r.allowNested,M={};return M.top=function(e,t,r){if("{"==e)return l(r,t,"block");if("}"==e&&r.context.prev)return c(r);if(/@(media|supports|(-moz-)?document)/.test(e))return l(r,t,"atBlock");if(/@(font-face|counter-style)/.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return l(r,t,"at");if("hash"==e)h="builtin";else if("word"==e)h="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return l(r,t,"interpolation");if(":"==e)return"pseudo";if(T&&"("==e)return l(r,t,"parens")}return r.context.type},M.block=function(e,t,r){if("word"==e){var n=t.current().toLowerCase();return x.hasOwnProperty(n)?(h="property","maybeprop"):k.hasOwnProperty(n)?(h="string-2","maybeprop"):T?(h=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(h+=" error","maybeprop")}return"meta"==e?"block":T||"hash"!=e&&"qualifier"!=e?M.top(e,t,r):(h="error","block")},M.maybeprop=function(e,t,r){return":"==e?l(r,t,"prop"):u(e,t,r)},M.prop=function(e,t,r){if(";"==e)return c(r);if("{"==e&&T)return l(r,t,"propBlock");if("}"==e||"{"==e)return d(e,t,r);if("("==e)return l(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t.current())){if("word"==e)f(t);else if("interpolation"==e)return l(r,t,"interpolation")}else h+=" error";return"prop"},M.propBlock=function(e,t,r){return"}"==e?c(r):"word"==e?(h="property","maybeprop"):r.context.type},M.parens=function(e,t,r){return"{"==e||"}"==e?d(e,t,r):")"==e?c(r):"("==e?l(r,t,"parens"):("word"==e&&f(t),"parens")},M.pseudo=function(e,t,r){return"word"==e?(h="variable-3",r.context.type):u(e,t,r)},M.atBlock=function(e,t,r){if("("==e)return l(r,t,"atBlock_parens");if("}"==e)return d(e,t,r);if("{"==e)return c(r)&&l(r,t,T?"block":"top");if("word"==e){var n=t.current().toLowerCase();h="only"==n||"not"==n||"and"==n||"or"==n?"keyword":v.hasOwnProperty(n)?"tag":b.hasOwnProperty(n)?"attribute":y.hasOwnProperty(n)?"property":x.hasOwnProperty(n)?"property":k.hasOwnProperty(n)?"string-2":S.hasOwnProperty(n)?"atom":"error"}return r.context.type},M.atBlock_parens=function(e,t,r){return")"==e?c(r):"{"==e||"}"==e?d(e,t,r,2):M.atBlock(e,t,r)},M.restricted_atBlock_before=function(e,t,r){return"{"==e?l(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(h="variable","restricted_atBlock_before"):u(e,t,r)},M.restricted_atBlock=function(e,t,r){return"}"==e?(r.stateArg=null,c(r)):"word"==e?(h="@font-face"==r.stateArg&&!w.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!_.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},M.keyframes=function(e,t,r){return"word"==e?(h="variable","keyframes"):"{"==e?l(r,t,"top"):u(e,t,r)},M.at=function(e,t,r){return";"==e?c(r):"{"==e||"}"==e?d(e,t,r):("word"==e?h="tag":"hash"==e&&(h="builtin"),"at")},M.interpolation=function(e,t,r){return"}"==e?c(r):"{"==e||";"==e?d(e,t,r):("variable"!=e&&(h="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:"top",stateArg:null,context:new s("top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||i)(e,t);return r&&"object"==typeof r&&(m=r[1],r=r[0]),h=r,t.state=M[t.state](m,e,t),h},indent:function(e,t){var r=e.context,n=t&&t.charAt(0),i=r.indent;return"prop"!=r.type||"}"!=n&&")"!=n||(r=r.prev),!r.prev||("}"!=n||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"restricted_atBlock"!=r.type)&&(")"!=n||"parens"!=r.type&&"atBlock_parens"!=r.type)&&("{"!=n||"at"!=r.type&&"atBlock"!=r.type)||(i=r.indent-p,r=r.prev),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}});var i=["domain","regexp","url","url-prefix"],o=t(i),a=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],s=t(a),l=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"],c=t(l),u=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],d=t(u),f=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],m=t(f),h=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],p=t(h),g=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],v=t(g),b=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],y=t(b),x=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","x-large","x-small","xor","xx-large","xx-small"],k=t(x),w=i.concat(a).concat(l).concat(u).concat(f).concat(b).concat(x);e.registerHelper("hintWords","css",w),e.defineMIME("text/css",{documentTypes:o,mediaTypes:s,mediaFeatures:c,propertyKeywords:d,nonStandardPropertyKeywords:m,fontProperties:p,counterDescriptors:v,colorKeywords:y,valueKeywords:k,tokenHooks:{"<":function(e,t){return e.match("!--")?(t.tokenize=n,n(e,t)):!1},"/":function(e,t){return e.eat("*")?(t.tokenize=r,r(e,t)):!1}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:s,mediaFeatures:c,propertyKeywords:d,nonStandardPropertyKeywords:m,colorKeywords:y,valueKeywords:k,fontProperties:p,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},":":function(e){return e.match(/\s*\{/)?[null,"{"]:!1},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return e.eat("{")?[null,"interpolation"]:!1}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:s,mediaFeatures:c,propertyKeywords:d,nonStandardPropertyKeywords:m,colorKeywords:y,valueKeywords:k,fontProperties:p,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},"@":function(e){return e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)?!1:(e.eatWhile(/[\w\\\-]/), -e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("sass",function(e){function t(e){return new RegExp("^"+e.join("|"))}function r(e,t){var r=e.peek();return")"===r?(e.next(),t.tokenizer=l,"operator"):"("===r?(e.next(),e.eatSpace(),"operator"):"'"===r||'"'===r?(t.tokenizer=i(e.next()),"string"):(t.tokenizer=i(")",!1),"string")}function n(e,t){return function(r,n){return r.sol()&&r.indentation()<=e?(n.tokenizer=l,l(r,n)):(t&&r.skipTo("*/")?(r.next(),r.next(),n.tokenizer=l):r.skipToEnd(),"comment")}}function i(e,t){function r(n,i){var a=n.next(),s=n.peek(),c=n.string.charAt(n.pos-2),u="\\"!==a&&s===e||a===e&&"\\"!==c;return u?(a!==e&&t&&n.next(),i.tokenizer=l,"string"):"#"===a&&"{"===s?(i.tokenizer=o(r),n.next(),"operator"):"string"}return null==t&&(t=!0),r}function o(e){return function(t,r){return"}"===t.peek()?(t.next(),r.tokenizer=e,"operator"):l(t,r)}}function a(t){if(0==t.indentCount){t.indentCount++;var r=t.scopes[0].offset,n=r+e.indentUnit;t.scopes.unshift({offset:n})}}function s(e){1!=e.scopes.length&&e.scopes.shift()}function l(e,t){var c=e.peek();if(e.match("/*"))return t.tokenizer=n(e.indentation(),!0),t.tokenizer(e,t);if(e.match("//"))return t.tokenizer=n(e.indentation(),!1),t.tokenizer(e,t);if(e.match("#{"))return t.tokenizer=o(l),"operator";if('"'===c||"'"===c)return e.next(),t.tokenizer=i(c),"string";if(t.cursorHalf){if("#"===c&&(e.next(),e.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)))return e.peek()||(t.cursorHalf=0),"number";if(e.match(/^-?[0-9\.]+/))return e.peek()||(t.cursorHalf=0),"number";if(e.match(/^(px|em|in)\b/))return e.peek()||(t.cursorHalf=0),"unit";if(e.match(d))return e.peek()||(t.cursorHalf=0),"keyword";if(e.match(/^url/)&&"("===e.peek())return t.tokenizer=r,e.peek()||(t.cursorHalf=0),"atom";if("$"===c)return e.next(),e.eatWhile(/[\w-]/),e.peek()||(t.cursorHalf=0),"variable-3";if("!"===c)return e.next(),e.peek()||(t.cursorHalf=0),e.match(/^[\w]+/)?"keyword":"operator";if(e.match(m))return e.peek()||(t.cursorHalf=0),"operator";if(e.eatWhile(/[\w-]/))return e.peek()||(t.cursorHalf=0),"attribute";if(!e.peek())return t.cursorHalf=0,null}else{if("."===c){if(e.next(),e.match(/^[\w-]+/))return a(t),"atom";if("#"===e.peek())return a(t),"atom"}if("#"===c){if(e.next(),e.match(/^[\w-]+/))return a(t),"atom";if("#"===e.peek())return a(t),"atom"}if("$"===c)return e.next(),e.eatWhile(/[\w-]/),"variable-2";if(e.match(/^-?[0-9\.]+/))return"number";if(e.match(/^(px|em|in)\b/))return"unit";if(e.match(d))return"keyword";if(e.match(/^url/)&&"("===e.peek())return t.tokenizer=r,"atom";if("="===c&&e.match(/^=[\w-]+/))return a(t),"meta";if("+"===c&&e.match(/^\+[\w-]+/))return"variable-3";if("@"===c&&e.match(/@extend/)&&(e.match(/\s*[\w]/)||s(t)),e.match(/^@(else if|if|media|else|for|each|while|mixin|function)/))return a(t),"meta";if("@"===c)return e.next(),e.eatWhile(/[\w-]/),"meta";if(e.eatWhile(/[\w-]/))return e.match(/ *: *[\w-\+\$#!\("']/,!1)?"propery":e.match(/ *:/,!1)?(a(t),t.cursorHalf=1,"atom"):e.match(/ *,/,!1)?"atom":(a(t),"atom");if(":"===c)return e.match(h)?"keyword":(e.next(),t.cursorHalf=1,"operator")}return e.match(m)?"operator":(e.next(),null)}function c(t,r){t.sol()&&(r.indentCount=0);var n=r.tokenizer(t,r),i=t.current();if(("@return"===i||"}"===i)&&s(r),null!==n){for(var o=t.pos-i.length,a=o+e.indentUnit*r.indentCount,l=[],c=0;c","<","==",">=","<=","\\+","-","\\!=","/","\\*","%","and","or","not",";","\\{","\\}",":"],m=t(f),h=/^::?[a-zA-Z_][\w\-]*/;return{startState:function(){return{tokenizer:l,scopes:[{offset:0,type:"sass"}],indentCount:0,cursorHalf:0,definedVars:[],definedMixins:[]}},token:function(e,t){var r=c(e,t);return t.lastToken={style:r,content:e.current()},r},indent:function(e){return e.scopes[0].offset}}}),e.defineMIME("text/x-sass","sass")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("shell",function(){function e(e,t){for(var r=t.split(" "),n=0;n1&&e.eat("$");var i=e.next(),o=/\w/;return"{"===i&&(o=/[^}]/),"("===i?(t.tokens[0]=r(")"),n(e,t)):(/\d/.test(i)||(e.eatWhile(o),e.eat("}")),t.tokens.shift(),"def")};return{startState:function(){return{tokens:[]}},token:function(e,t){return n(e,t)},lineComment:"#",fold:"brace"}}),e.defineMIME("text/x-sh","shell")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("sql",function(t,r){function n(e,t){var r=e.next();if(h[r]){var n=h[r](e,t);if(n!==!1)return n}if(1==m.hexNumber&&("0"==r&&e.match(/^[xX][0-9a-fA-F]+/)||("x"==r||"X"==r)&&e.match(/^'[0-9a-fA-F]+'/)))return"number";if(1==m.binaryNumber&&(("b"==r||"B"==r)&&e.match(/^'[01]+'/)||"0"==r&&e.match(/^b[01]+/)))return"number";if(r.charCodeAt(0)>47&&r.charCodeAt(0)<58)return e.match(/^[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/),1==m.decimallessFloat&&e.eat("."),"number";if("?"==r&&(e.eatSpace()||e.eol()||e.eat(";")))return"variable-3";if("'"==r||'"'==r&&m.doubleQuote)return t.tokenize=i(r),t.tokenize(e,t);if((1==m.nCharCast&&("n"==r||"N"==r)||1==m.charsetCast&&"_"==r&&e.match(/[a-z][a-z0-9]*/i))&&("'"==e.peek()||'"'==e.peek()))return"keyword";if(/^[\(\),\;\[\]]/.test(r))return null;if(m.commentSlashSlash&&"/"==r&&e.eat("/"))return e.skipToEnd(),"comment";if(m.commentHash&&"#"==r||"-"==r&&e.eat("-")&&(!m.commentSpaceRequired||e.eat(" ")))return e.skipToEnd(),"comment";if("/"==r&&e.eat("*"))return t.tokenize=o,t.tokenize(e,t);if("."!=r){if(f.test(r))return e.eatWhile(f),null;if("{"==r&&(e.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/)||e.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/)))return"number";e.eatWhile(/^[_\w\d]/);var a=e.current().toLowerCase();return p.hasOwnProperty(a)&&(e.match(/^( )+'[^']*'/)||e.match(/^( )+"[^"]*"/))?"number":c.hasOwnProperty(a)?"atom":u.hasOwnProperty(a)?"builtin":d.hasOwnProperty(a)?"keyword":l.hasOwnProperty(a)?"string-2":null}return 1==m.zerolessFloat&&e.match(/^(?:\d+(?:e[+-]?\d+)?)/i)?"number":1==m.ODBCdotTable&&e.match(/^[a-zA-Z_]+/)?"variable-2":void 0}function i(e){return function(t,r){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){r.tokenize=n;break}o=!o&&"\\"==i}return"string"}}function o(e,t){for(;;){if(!e.skipTo("*")){e.skipToEnd();break}if(e.next(),e.eat("/")){t.tokenize=n;break}}return"comment"}function a(e,t,r){t.context={prev:t.context,indent:e.indentation(),col:e.column(),type:r}}function s(e){e.indent=e.context.indent,e.context=e.context.prev}var l=r.client||{},c=r.atoms||{"false":!0,"true":!0,"null":!0},u=r.builtin||{},d=r.keywords||{},f=r.operatorChars||/^[*+\-%<>!=&|~^]/,m=r.support||{},h=r.hooks||{},p=r.dateSQL||{date:!0,time:!0,timestamp:!0};return{startState:function(){return{tokenize:n,context:null}},token:function(e,t){if(e.sol()&&t.context&&null==t.context.align&&(t.context.align=!1),e.eatSpace())return null;var r=t.tokenize(e,t);if("comment"==r)return r;t.context&&null==t.context.align&&(t.context.align=!0);var n=e.current();return"("==n?a(e,t,")"):"["==n?a(e,t,"]"):t.context&&t.context.type==n&&s(t),r},indent:function(r,n){var i=r.context;if(!i)return e.Pass;var o=n.charAt(0)==i.type;return i.align?i.col+(o?0:1):i.indent+(o?0:t.indentUnit)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:m.commentSlashSlash?"//":m.commentHash?"#":null}}),function(){function t(e){for(var t;null!=(t=e.next());)if("`"==t&&!e.eat("`"))return"variable-2";return e.backUp(e.current().length-1),e.eatWhile(/\w/)?"variable-2":null}function r(e){return e.eat("@")&&(e.match(/^session\./),e.match(/^local\./),e.match(/^global\./)),e.eat("'")?(e.match(/^.*'/),"variable-2"):e.eat('"')?(e.match(/^.*"/),"variable-2"):e.eat("`")?(e.match(/^.*`/),"variable-2"):e.match(/^[0-9a-zA-Z$\.\_]+/)?"variable-2":null}function n(e){return e.eat("N")?"atom":e.match(/^[a-zA-Z.#!?]/)?"variable-2":null}function i(e){for(var t={},r=e.split(" "),n=0;n!=]/,dateSQL:i("date time timestamp"),support:i("ODBCdotTable doubleQuote binaryNumber hexNumber")}),e.defineMIME("text/x-mssql",{name:"sql",client:i("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:i(o+"begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered"),builtin:i("bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table "),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:i("date datetimeoffset datetime2 smalldatetime datetime time"),hooks:{"@":r}}),e.defineMIME("text/x-mysql",{name:"sql",client:i("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:i(o+"accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group groupby_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:i("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:i("date time timestamp"),support:i("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":r,"`":t,"\\":n}}),e.defineMIME("text/x-mariadb",{name:"sql",client:i("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:i(o+"accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:i("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:i("date time timestamp"),support:i("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":r,"`":t,"\\":n}}),e.defineMIME("text/x-cassandra",{name:"sql",client:{},keywords:i("use select from using consistency where limit first reversed first and in insert into values using consistency ttl update set delete truncate begin batch apply create keyspace with columnfamily primary key index on drop alter type add any one quorum all local_quorum each_quorum"),builtin:i("ascii bigint blob boolean counter decimal double float int text timestamp uuid varchar varint"),atoms:i("false true"),operatorChars:/^[<>=]/,dateSQL:{},support:i("commentSlashSlash decimallessFloat"),hooks:{}}),e.defineMIME("text/x-plsql",{name:"sql",client:i("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"),keywords:i("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"),builtin:i("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least lenght lenghtb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"),operatorChars:/^[*+\-%<>!=~]/,dateSQL:i("date time timestamp"),support:i("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")}),e.defineMIME("text/x-hive",{name:"sql",keywords:i("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external false fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger true unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with"),builtin:i("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:i("date timestamp"),support:i("ODBCdotTable doubleQuote binaryNumber hexNumber")})}()}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},r=e.split(" "),n=0;n!?|\/]/;return{startState:function(e){return{tokenize:null,context:new a((e||0)-u,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var r=t.context;if(e.sol()&&(null==r.align&&(r.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;c=null;var i=(t.tokenize||n)(e,t);if("comment"==i||"meta"==i)return i;if(null==r.align&&(r.align=!0),";"!=c&&":"!=c&&","!=c||"statement"!=r.type)if("{"==c)s(t,e.column(),"}");else if("["==c)s(t,e.column(),"]");else if("("==c)s(t,e.column(),")");else if("}"==c){for(;"statement"==r.type;)r=l(t);for("}"==r.type&&(r=l(t));"statement"==r.type;)r=l(t)}else c==r.type?l(t):y&&(("}"==r.type||"top"==r.type)&&";"!=c||"statement"==r.type&&"newstatement"==c)&&s(t,e.column(),"statement");else l(t);return t.startOfLine=!1,i},indent:function(t,r){if(t.tokenize!=n&&null!=t.tokenize)return e.Pass;var i=t.context,o=r&&r.charAt(0);"statement"==i.type&&"}"==o&&(i=i.prev);var a=o==i.type;return"statement"==i.type?i.indented+("{"==o?0:d):!i.align||f&&")"==i.type?")"!=i.type||a?i.indented+(a?0:u):i.indented+d:i.column+(a?0:1)},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});var l="auto if break int case long char register continue return default short do sizeof double static else struct entry switch extern typedef float union for unsigned goto while enum void const signed volatile";a(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:t(l),blockKeywords:t("case do else for if switch while struct"),atoms:t("null"),hooks:{"#":r},modeProps:{fold:["brace","include"]}}),a(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:t(l+" asm dynamic_cast namespace reinterpret_cast try bool explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected wchar_t alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),blockKeywords:t("catch class do else finally for if struct switch try while"),atoms:t("true false null"),hooks:{"#":r,u:n,U:n,L:n,R:n},modeProps:{fold:["brace","include"]}}),a("text/x-java",{name:"clike",keywords:t("abstract assert boolean break byte case catch char class const continue default do double else enum extends final finally float for goto if implements import instanceof int interface long native new package private protected public return short static strictfp super switch synchronized this throw throws transient try void volatile while"),blockKeywords:t("catch class do else finally for if switch try while"),atoms:t("true false null"),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"}},modeProps:{fold:["brace","import"]}}),a("text/x-csharp",{name:"clike",keywords:t("abstract as base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),blockKeywords:t("catch class do else finally for foreach if struct switch try while"),builtin:t("Boolean Byte Char DateTime DateTimeOffset Decimal Double Guid Int16 Int32 Int64 Object SByte Single String TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),atoms:t("true false null"),hooks:{"@":function(e,t){return e.eat('"')?(t.tokenize=i,i(e,t)):(e.eatWhile(/[\w\$_]/),"meta")}}}),a("text/x-scala",{name:"clike",keywords:t("abstract case catch class def do else extends false final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try trye type val var while with yield _ : = => <- <: <% >: # @ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector :: #:: Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"), -multiLineStrings:!0,blockKeywords:t("catch class do else finally for forSome if match switch try while"),atoms:t("true false null"),indentStatements:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return e.match('""')?(t.tokenize=s,t.tokenize(e,t)):!1},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"}}}),a(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:t("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4 sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),blockKeywords:t("for while do if else struct"),builtin:t("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:t("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),hooks:{"#":r},modeProps:{fold:["brace","include"]}}),a("text/x-nesc",{name:"clike",keywords:t(l+"as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),blockKeywords:t("case do else for if switch while struct"),atoms:t("null"),hooks:{"#":r},modeProps:{fold:["brace","include"]}}),a("text/x-objectivec",{name:"clike",keywords:t(l+"inline restrict _Bool _Complex _Imaginery BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),atoms:t("YES NO NULL NILL ON OFF"),hooks:{"@":function(e){return e.eatWhile(/[\w\$]/),"keyword"},"#":r},modeProps:{fold:"brace"}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},r=e.split(" "),n=0;n\w/,!1)&&(t.tokenize=r([[["->",null]],[[/[\w]+/,"variable"]]],n)),"variable-2";for(var i=!1;!e.eol()&&(i||!e.match("{$",!1)&&!e.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1));){if(!i&&e.match(n)){t.tokenize=null,t.tokStack.pop(),t.tokStack.pop();break}i="\\"==e.next()&&!i}return"string"}var o="abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally",a="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__",s="func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";e.registerHelper("hintWords","php",[o,a,s].join(" ").split(" ")),e.registerHelper("wordChars","php",/[\w$]/);var l={name:"clike",helperType:"php",keywords:t(o),blockKeywords:t("catch do else elseif for foreach if switch try while finally"),atoms:t(a),builtin:t(s),multiLineStrings:!0,hooks:{$:function(e){return e.eatWhile(/[\w\$_]/),"variable-2"},"<":function(e,t){if(e.match(/<",!1);)e.next();return"comment"},"/":function(e){if(e.eat("/")){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"}return!1},'"':function(e,t){return(t.tokStack||(t.tokStack=[])).push('"',0),t.tokenize=n('"'),"string"},"{":function(e,t){return t.tokStack&&t.tokStack.length&&t.tokStack[t.tokStack.length-1]++,!1},"}":function(e,t){return t.tokStack&&t.tokStack.length>0&&!--t.tokStack[t.tokStack.length-1]&&(t.tokenize=n(t.tokStack[t.tokStack.length-2])),!1}}};e.defineMode("php",function(t,r){function n(e,t){var r=t.curMode==o;if(e.sol()&&t.pending&&'"'!=t.pending&&"'"!=t.pending&&(t.pending=null),r)return r&&null==t.php.tokenize&&e.match("?>")?(t.curMode=i,t.curState=t.html,"meta"):o.token(e,t.curState);if(e.match(/^<\?\w*/))return t.curMode=o,t.curState=t.php,"meta";if('"'==t.pending||"'"==t.pending){for(;!e.eol()&&e.next()!=t.pending;);var n="string"}else if(t.pending&&e.pos/.test(s)?t.pending=a[0]:t.pending={end:e.pos,style:n},e.backUp(s.length-l)),n}var i=e.getMode(t,"text/html"),o=e.getMode(t,l);return{startState:function(){var t=e.startState(i),n=e.startState(o);return{html:t,php:n,curMode:r.startOpen?o:i,curState:r.startOpen?n:t,pending:null}},copyState:function(t){var r,n=t.html,a=e.copyState(i,n),s=t.php,l=e.copyState(o,s);return r=t.curMode==i?a:l,{html:a,php:l,curMode:t.curMode,curState:r,pending:t.pending}},token:n,indent:function(e,t){return e.curMode!=o&&/^\s*<\//.test(t)||e.curMode==o&&/^\?>/.test(t)?i.indent(e.html,t):e.curMode.indent(e.curState,t)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(e){return{state:e.curState,mode:e.curMode}}}},"htmlmixed","clike"),e.defineMIME("application/x-httpd-php","php"),e.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),e.defineMIME("text/x-php",l)}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("xml",function(t,r){function n(e,t){function r(r){return t.tokenize=r,r(e,t)}var n=e.next();if("<"==n)return e.eat("!")?e.eat("[")?e.match("CDATA[")?r(a("atom","]]>")):null:e.match("--")?r(a("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),r(s(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=a("meta","?>"),"meta"):(_=e.eat("/")?"closeTag":"openTag",t.tokenize=i,"tag bracket");if("&"==n){var o;return o=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),o?"atom":"error"}return e.eatWhile(/[^&<]/),null}function i(e,t){var r=e.next();if(">"==r||"/"==r&&e.eat(">"))return t.tokenize=n,_=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return _="equals",null;if("<"==r){t.tokenize=n,t.state=d,t.tagName=t.tagStart=null;var i=t.tokenize(e,t);return i?i+" tag error":"tag error"}return/[\'\"]/.test(r)?(t.tokenize=o(r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function o(e){var t=function(t,r){for(;!t.eol();)if(t.next()==e){r.tokenize=i;break}return"string"};return t.isInAttribute=!0,t}function a(e,t){return function(r,i){for(;!r.eol();){if(r.match(t)){i.tokenize=n;break}r.next()}return e}}function s(e){return function(t,r){for(var i;null!=(i=t.next());){if("<"==i)return r.tokenize=s(e+1),r.tokenize(t,r);if(">"==i){if(1==e){r.tokenize=n;break}return r.tokenize=s(e-1),r.tokenize(t,r)}}return"meta"}}function l(e,t,r){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r,(S.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function c(e){e.context&&(e.context=e.context.prev)}function u(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!S.contextGrabbers.hasOwnProperty(r)||!S.contextGrabbers[r].hasOwnProperty(t))return;c(e)}}function d(e,t,r){return"openTag"==e?(r.tagStart=t.column(),f):"closeTag"==e?m:d}function f(e,t,r){return"word"==e?(r.tagName=t.current(),C="tag",g):(C="error",f)}function m(e,t,r){if("word"==e){var n=t.current();return r.context&&r.context.tagName!=n&&S.implicitlyClosed.hasOwnProperty(r.context.tagName)&&c(r),r.context&&r.context.tagName==n?(C="tag",h):(C="tag error",p)}return C="error",p}function h(e,t,r){return"endTag"!=e?(C="error",h):(c(r),d)}function p(e,t,r){return C="error",h(e,t,r)}function g(e,t,r){if("word"==e)return C="attribute",v;if("endTag"==e||"selfcloseTag"==e){var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||S.autoSelfClosers.hasOwnProperty(n)?u(r,n):(u(r,n),r.context=new l(r,n,i==r.indented)),d}return C="error",g}function v(e,t,r){return"equals"==e?b:(S.allowMissing||(C="error"),g(e,t,r))}function b(e,t,r){return"string"==e?y:"word"==e&&S.allowUnquoted?(C="string",g):(C="error",g(e,t,r))}function y(e,t,r){return"string"==e?y:g(e,t,r)}var x=t.indentUnit,k=r.multilineTagIndentFactor||1,w=r.multilineTagIndentPastTag;null==w&&(w=!0);var _,C,S=r.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1},T=r.alignCDATA;return{startState:function(){return{tokenize:n,state:d,indented:0,tagName:null,tagStart:null,context:null}},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;_=null;var r=t.tokenize(e,t);return(r||_)&&"comment"!=r&&(C=null,t.state=t.state(_||r,e,t),C&&(r="error"==C?r+" error":C)),r},indent:function(t,r,o){var a=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+x;if(a&&a.noIndent)return e.Pass;if(t.tokenize!=i&&t.tokenize!=n)return o?o.match(/^(\s*)/)[0].length:0;if(t.tagName)return w?t.tagStart+t.tagName.length+2:t.tagStart+x*k;if(T&&/$/,blockCommentStart:"",configuration:r.htmlMode?"html":"xml",helperType:r.htmlMode?"html":"xml"}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../meta")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../meta"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("markdown",function(t,r){function n(r){if(e.findModeByName){var n=e.findModeByName(r);n&&(r=n.mime||n.mimes[0])}var i=e.getMode(t,r);return"null"==i.name?null:i}function i(e,t,r){return t.f=t.inline=r,r(e,t)}function o(e,t,r){return t.f=t.block=r,r(e,t)}function a(e){return e.linkTitle=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,k||e.f!=l||(e.f=m,e.block=s),e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.thisLineHasContent=!1,null}function s(e,t){var o=e.sol(),a=t.list!==!1;t.list!==!1&&t.indentationDiff>=0?(t.indentationDiff<4&&(t.indentation-=t.indentationDiff),t.list=null):t.list!==!1&&t.indentation>0?(t.list=null,t.listDepth=Math.floor(t.indentation/4)):t.list!==!1&&(t.list=!1,t.listDepth=0);var s=null;if(t.indentationDiff>=4)return t.indentation-=4,e.skipToEnd(),S;if(e.eatSpace())return null;if(s=e.match(U))return t.header=s[0].length<=6?s[0].length:6,r.highlightFormatting&&(t.formatting="header"),t.f=t.inline,d(t);if(t.prevLineHasContent&&(s=e.match(W)))return t.header="="==s[0].charAt(0)?1:2,r.highlightFormatting&&(t.formatting="header"),t.f=t.inline,d(t);if(e.eat(">"))return t.indentation++,t.quote=o?1:t.quote+1,r.highlightFormatting&&(t.formatting="quote"),e.eatSpace(),d(t);if("["===e.peek())return i(e,t,v);if(e.match(F,!0))return q;if((!t.prevLineHasContent||a)&&(e.match(H,!1)||e.match(N,!1))){var l=null;return e.match(H,!0)?l="ul":(e.match(N,!0),l="ol"),t.indentation+=4,t.list=!0,t.listDepth++,r.taskLists&&e.match(B,!1)&&(t.taskList=!0),t.f=t.inline,r.highlightFormatting&&(t.formatting=["list","list-"+l]),d(t)}return r.fencedCodeBlocks&&e.match(/^```[ \t]*([\w+#]*)/,!0)?(t.localMode=n(RegExp.$1),t.localMode&&(t.localState=t.localMode.startState()),t.f=t.block=c,r.highlightFormatting&&(t.formatting="code-block"),t.code=!0,d(t)):i(e,t,t.inline)}function l(e,t){var r=w.token(e,t.htmlState);return(k&&null===t.htmlState.tagStart&&!t.htmlState.context||t.md_inside&&e.current().indexOf(">")>-1)&&(t.f=m,t.block=s,t.htmlState=null),r}function c(e,t){return e.sol()&&e.match("```",!1)?(t.localMode=t.localState=null,t.f=t.block=u,null):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),S)}function u(e,t){e.match("```"),t.block=s,t.f=m,r.highlightFormatting&&(t.formatting="code-block"),t.code=!0;var n=d(t);return t.code=!1,n}function d(e){var t=[];if(e.formatting){t.push(z),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var n=0;n=e.quote?z+"-"+e.formatting[n]+"-"+e.quote:"error")}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref)return t.push(A),t.length?t.join(" "):null;if(e.strong&&t.push(O),e.em&&t.push($),e.strikethrough&&t.push(R),e.linkText&&t.push(D),e.code&&t.push(S),e.header&&(t.push(C),t.push(C+"-"+e.header)),e.quote&&(t.push(T),t.push(!r.maxBlockquoteDepth||r.maxBlockquoteDepth>=e.quote?T+"-"+e.quote:T+"-"+r.maxBlockquoteDepth)),e.list!==!1){var i=(e.listDepth-1)%3;t.push(i?1===i?L:E:M)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function f(e,t){return e.match(V,!0)?d(t):void 0}function m(t,n){var i=n.text(t,n);if("undefined"!=typeof i)return i;if(n.list)return n.list=null,d(n);if(n.taskList){var a="x"!==t.match(B,!0)[1];return a?n.taskOpen=!0:n.taskClosed=!0,r.highlightFormatting&&(n.formatting="task"),n.taskList=!1,d(n)}if(n.taskOpen=!1,n.taskClosed=!1,n.header&&t.match(/^#+$/,!0))return r.highlightFormatting&&(n.formatting="header"),d(n);var s=t.sol(),c=t.next();if("\\"===c&&(t.next(),r.highlightFormatting)){var u=d(n);return u?u+" formatting-escape":"formatting-escape"}if(n.linkTitle){n.linkTitle=!1;var f=c;"("===c&&(f=")"),f=(f+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var m="^\\s*(?:[^"+f+"\\\\]+|\\\\\\\\|\\\\.)"+f;if(t.match(new RegExp(m),!0))return A}if("`"===c){var g=n.formatting;r.highlightFormatting&&(n.formatting="code");var v=d(n),b=t.pos;t.eatWhile("`");var y=1+t.pos-b;return n.code?y===_?(n.code=!1,v):(n.formatting=g,d(n)):(_=y,n.code=!0,d(n))}if(n.code)return d(n);if("!"===c&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return t.match(/\[[^\]]*\]/),n.inline=n.f=p,j;if("["===c&&t.match(/.*\](\(.*\)| ?\[.*\])/,!1))return n.linkText=!0,r.highlightFormatting&&(n.formatting="link"),d(n);if("]"===c&&n.linkText&&t.match(/\(.*\)| ?\[.*\]/,!1)){r.highlightFormatting&&(n.formatting="link");var u=d(n);return n.linkText=!1,n.inline=n.f=p,u}if("<"===c&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){n.f=n.inline=h,r.highlightFormatting&&(n.formatting="link");var u=d(n);return u?u+=" ":u="",u+I}if("<"===c&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){n.f=n.inline=h,r.highlightFormatting&&(n.formatting="link");var u=d(n);return u?u+=" ":u="",u+P}if("<"===c&&t.match(/^\w/,!1)){if(-1!=t.string.indexOf(">")){var x=t.string.substring(1,t.string.indexOf(">"));/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(x)&&(n.md_inside=!0)}return t.backUp(1),n.htmlState=e.startState(w),o(t,n,l)}if("<"===c&&t.match(/^\/\w*?>/))return n.md_inside=!1,"tag";var k=!1;if(!r.underscoresBreakWords&&"_"===c&&"_"!==t.peek()&&t.match(/(\w)/,!1)){var C=t.pos-2;if(C>=0){var S=t.string.charAt(C);"_"!==S&&S.match(/(\w)/,!1)&&(k=!0)}}if("*"===c||"_"===c&&!k)if(s&&" "===t.peek());else{if(n.strong===c&&t.eat(c)){r.highlightFormatting&&(n.formatting="strong");var v=d(n);return n.strong=!1,v}if(!n.strong&&t.eat(c))return n.strong=c,r.highlightFormatting&&(n.formatting="strong"),d(n);if(n.em===c){r.highlightFormatting&&(n.formatting="em");var v=d(n);return n.em=!1,v}if(!n.em)return n.em=c,r.highlightFormatting&&(n.formatting="em"),d(n)}else if(" "===c&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return d(n);t.backUp(1)}if(r.strikethrough)if("~"===c&&t.eatWhile(c)){if(n.strikethrough){r.highlightFormatting&&(n.formatting="strikethrough");var v=d(n);return n.strikethrough=!1,v}if(t.match(/^[^\s]/,!1))return n.strikethrough=!0,r.highlightFormatting&&(n.formatting="strikethrough"),d(n)}else if(" "===c&&t.match(/^~~/,!0)){if(" "===t.peek())return d(n);t.backUp(2)}return" "===c&&(t.match(/ +$/,!1)?n.trailingSpace++:n.trailingSpace&&(n.trailingSpaceNewLine=!0)),d(n)}function h(e,t){var n=e.next();if(">"===n){t.f=t.inline=m,r.highlightFormatting&&(t.formatting="link");var i=d(t);return i?i+=" ":i="",i+I}return e.match(/^[^>]+/,!0),I}function p(e,t){if(e.eatSpace())return null;var n=e.next();return"("===n||"["===n?(t.f=t.inline=g("("===n?")":"]"),r.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,d(t)):"error"}function g(e){return function(t,n){var i=t.next();if(i===e){n.f=n.inline=m,r.highlightFormatting&&(n.formatting="link-string");var o=d(n);return n.linkHref=!1,o}return t.match(x(e),!0)&&t.backUp(1),n.linkHref=!0,d(n)}}function v(e,t){return e.match(/^[^\]]*\]:/,!1)?(t.f=b,e.next(),r.highlightFormatting&&(t.formatting="link"),t.linkText=!0,d(t)):i(e,t,m)}function b(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=y,r.highlightFormatting&&(t.formatting="link");var n=d(t);return t.linkText=!1,n}return e.match(/^[^\]]+/,!0),D}function y(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=m,A)}function x(e){return K[e]||(e=(e+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),K[e]=new RegExp("^(?:[^\\\\]|\\\\.)*?("+e+")")),K[e]}var k=e.modes.hasOwnProperty("xml"),w=e.getMode(t,k?{name:"xml",htmlMode:!0}:"text/plain");void 0===r.highlightFormatting&&(r.highlightFormatting=!1),void 0===r.maxBlockquoteDepth&&(r.maxBlockquoteDepth=0),void 0===r.underscoresBreakWords&&(r.underscoresBreakWords=!0),void 0===r.fencedCodeBlocks&&(r.fencedCodeBlocks=!1),void 0===r.taskLists&&(r.taskLists=!1),void 0===r.strikethrough&&(r.strikethrough=!1);var _=0,C="header",S="comment",T="quote",M="variable-2",L="variable-3",E="keyword",q="hr",j="tag",z="formatting",I="link",P="link",D="link",A="string",$="em",O="strong",R="strikethrough",F=/^([*\-=_])(?:\s*\1){2,}\s*$/,H=/^[*\-+]\s+/,N=/^[0-9]+\.\s+/,B=/^\[(x| )\](?=\s)/,U=/^#+/,W=/^(?:\={1,}|-{1,})$/,V=/^[^#!\[\]*_\\<>` "'(~]+/,K=[],Z={startState:function(){return{f:s,prevLineHasContent:!1,thisLineHasContent:!1,block:s,htmlState:null,indentation:0,inline:m,text:f,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,em:!1,strong:!1,header:0,taskList:!1,list:!1,listDepth:0,quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1}},copyState:function(t){return{f:t.f,prevLineHasContent:t.prevLineHasContent,thisLineHasContent:t.thisLineHasContent,block:t.block,htmlState:t.htmlState&&e.copyState(w,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkTitle:t.linkTitle,em:t.em,strong:t.strong,strikethrough:t.strikethrough,header:t.header,taskList:t.taskList,list:t.list,listDepth:t.listDepth,quote:t.quote, -trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside}},token:function(e,t){if(t.formatting=!1,e.sol()){var r=!!t.header;if(t.header=0,e.match(/^\s*$/,!0)||r)return t.prevLineHasContent=!1,a(t),r?this.token(e,t):null;t.prevLineHasContent=t.thisLineHasContent,t.thisLineHasContent=!0,t.taskList=!1,t.code=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.f=t.block;var n=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length,i=4*Math.floor((n-t.indentation)/4);i>4&&(i=4);var o=t.indentation+i;if(t.indentationDiff=o-t.indentation,t.indentation=o,n>0)return null}return t.f(e,t)},innerMode:function(e){return e.block==l?{state:e.htmlState,mode:w}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:Z}},blankLine:a,getType:d,fold:"markdown"};return Z},"xml"),e.defineMIME("text/x-markdown","markdown")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("javascript",function(t,r){function n(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}function i(e,t,r){return pe=e,ge=r,t}function o(e,t){var r=e.next();if('"'==r||"'"==r)return t.tokenize=a(r),t.tokenize(e,t);if("."==r&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return i("number","number");if("."==r&&e.match(".."))return i("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return i(r);if("="==r&&e.eat(">"))return i("=>","operator");if("0"==r&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),i("number","number");if(/\d/.test(r))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),i("number","number");if("/"==r)return e.eat("*")?(t.tokenize=s,s(e,t)):e.eat("/")?(e.skipToEnd(),i("comment","comment")):"operator"==t.lastType||"keyword c"==t.lastType||"sof"==t.lastType||/^[\[{}\(,;:]$/.test(t.lastType)?(n(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),i("regexp","string-2")):(e.eatWhile(Ce),i("operator","operator",e.current()));if("`"==r)return t.tokenize=l,l(e,t);if("#"==r)return e.skipToEnd(),i("error","error");if(Ce.test(r))return e.eatWhile(Ce),i("operator","operator",e.current());if(we.test(r)){e.eatWhile(we);var o=e.current(),c=_e.propertyIsEnumerable(o)&&_e[o];return c&&"."!=t.lastType?i(c.type,c.style,o):i("variable","variable",o)}}function a(e){return function(t,r){var n,a=!1;if(ye&&"@"==t.peek()&&t.match(Se))return r.tokenize=o,i("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||a);)a=!a&&"\\"==n;return a||(r.tokenize=o),i("string","string")}}function s(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=o;break}n="*"==r}return i("comment","comment")}function l(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=o;break}n=!n&&"\\"==r}return i("quasi","string-2",e.current())}function c(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(0>r)){for(var n=0,i=!1,o=r-1;o>=0;--o){var a=e.string.charAt(o),s=Te.indexOf(a);if(s>=0&&3>s){if(!n){++o;break}if(0==--n)break}else if(s>=3&&6>s)++n;else if(we.test(a))i=!0;else{if(/["'\/]/.test(a))return;if(i&&!n){++o;break}}}i&&!n&&(t.fatArrowAt=o)}}function u(e,t,r,n,i,o){this.indented=e,this.column=t,this.type=r,this.prev=i,this.info=o,null!=n&&(this.align=n)}function d(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(var r=n.vars;r;r=r.next)if(r.name==t)return!0}function f(e,t,r,n,i){var o=e.cc;for(Le.state=e,Le.stream=i,Le.marked=null,Le.cc=o,Le.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var a=o.length?o.pop():xe?w:k;if(a(r,n)){for(;o.length&&o[o.length-1].lex;)o.pop()();return Le.marked?Le.marked:"variable"==r&&d(e,n)?"variable-2":t}}}function m(){for(var e=arguments.length-1;e>=0;e--)Le.cc.push(arguments[e])}function h(){return m.apply(null,arguments),!0}function p(e){function t(t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}var n=Le.state;if(n.context){if(Le.marked="def",t(n.localVars))return;n.localVars={name:e,next:n.localVars}}else{if(t(n.globalVars))return;r.globalVars&&(n.globalVars={name:e,next:n.globalVars})}}function g(){Le.state.context={prev:Le.state.context,vars:Le.state.localVars},Le.state.localVars=Ee}function v(){Le.state.localVars=Le.state.context.vars,Le.state.context=Le.state.context.prev}function b(e,t){var r=function(){var r=Le.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var i=r.lexical;i&&")"==i.type&&i.align;i=i.prev)n=i.indented;r.lexical=new u(n,Le.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function y(){var e=Le.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function x(e){function t(r){return r==e?h():";"==e?m():h(t)}return t}function k(e,t){return"var"==e?h(b("vardef",t.length),B,x(";"),y):"keyword a"==e?h(b("form"),w,k,y):"keyword b"==e?h(b("form"),k,y):"{"==e?h(b("}"),F,y):";"==e?h():"if"==e?("else"==Le.state.lexical.info&&Le.state.cc[Le.state.cc.length-1]==y&&Le.state.cc.pop()(),h(b("form"),w,k,y,Z)):"function"==e?h(ee):"for"==e?h(b("form"),G,k,y):"variable"==e?h(b("stat"),I):"switch"==e?h(b("form"),w,b("}","switch"),x("{"),F,y,y):"case"==e?h(w,x(":")):"default"==e?h(x(":")):"catch"==e?h(b("form"),g,x("("),te,x(")"),k,y,v):"module"==e?h(b("form"),g,ae,v,y):"class"==e?h(b("form"),re,y):"export"==e?h(b("form"),se,y):"import"==e?h(b("form"),le,y):m(b("stat"),w,x(";"),y)}function w(e){return C(e,!1)}function _(e){return C(e,!0)}function C(e,t){if(Le.state.fatArrowAt==Le.stream.start){var r=t?z:j;if("("==e)return h(g,b(")"),O(U,")"),y,x("=>"),r,v);if("variable"==e)return m(g,U,x("=>"),r,v)}var n=t?L:M;return Me.hasOwnProperty(e)?h(n):"function"==e?h(ee,n):"keyword c"==e?h(t?T:S):"("==e?h(b(")"),S,me,x(")"),y,n):"operator"==e||"spread"==e?h(t?_:w):"["==e?h(b("]"),de,y,n):"{"==e?R(D,"}",null,n):"quasi"==e?m(E,n):h()}function S(e){return e.match(/[;\}\)\],]/)?m():m(w)}function T(e){return e.match(/[;\}\)\],]/)?m():m(_)}function M(e,t){return","==e?h(w):L(e,t,!1)}function L(e,t,r){var n=0==r?M:L,i=0==r?w:_;return"=>"==e?h(g,r?z:j,v):"operator"==e?/\+\+|--/.test(t)?h(n):"?"==t?h(w,x(":"),i):h(i):"quasi"==e?m(E,n):";"!=e?"("==e?R(_,")","call",n):"."==e?h(P,n):"["==e?h(b("]"),S,x("]"),y,n):void 0:void 0}function E(e,t){return"quasi"!=e?m():"${"!=t.slice(t.length-2)?h(E):h(w,q)}function q(e){return"}"==e?(Le.marked="string-2",Le.state.tokenize=l,h(E)):void 0}function j(e){return c(Le.stream,Le.state),m("{"==e?k:w)}function z(e){return c(Le.stream,Le.state),m("{"==e?k:_)}function I(e){return":"==e?h(y,k):m(M,x(";"),y)}function P(e){return"variable"==e?(Le.marked="property",h()):void 0}function D(e,t){return"variable"==e||"keyword"==Le.style?(Le.marked="property",h("get"==t||"set"==t?A:$)):"number"==e||"string"==e?(Le.marked=ye?"property":Le.style+" property",h($)):"jsonld-keyword"==e?h($):"["==e?h(w,x("]"),$):void 0}function A(e){return"variable"!=e?m($):(Le.marked="property",h(ee))}function $(e){return":"==e?h(_):"("==e?m(ee):void 0}function O(e,t){function r(n){if(","==n){var i=Le.state.lexical;return"call"==i.info&&(i.pos=(i.pos||0)+1),h(e,r)}return n==t?h():h(x(t))}return function(n){return n==t?h():m(e,r)}}function R(e,t,r){for(var n=3;n!?|~^]/,Se=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Te="([{}])",Me={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},Le={state:null,column:null,marked:null,cc:null},Ee={name:"this",next:{name:"arguments"}};return y.lex=!0,{startState:function(e){var t={tokenize:o,lastType:"sof",cc:[],lexical:new u((e||0)-ve,0,"block",!1),localVars:r.localVars,context:r.localVars&&{vars:r.localVars},indented:0};return r.globalVars&&"object"==typeof r.globalVars&&(t.globalVars=r.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),c(e,t)),t.tokenize!=s&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==pe?r:(t.lastType="operator"!=pe||"++"!=ge&&"--"!=ge?pe:"incdec",f(t,r,pe,ge,e))},indent:function(t,n){if(t.tokenize==s)return e.Pass;if(t.tokenize!=o)return 0;var i=n&&n.charAt(0),a=t.lexical;if(!/^\s*else\b/.test(n))for(var l=t.cc.length-1;l>=0;--l){var c=t.cc[l];if(c==y)a=a.prev;else if(c!=Z)break}"stat"==a.type&&"}"==i&&(a=a.prev),be&&")"==a.type&&"stat"==a.prev.type&&(a=a.prev);var u=a.type,d=i==u;return"vardef"==u?a.indented+("operator"==t.lastType||","==t.lastType?a.info+1:0):"form"==u&&"{"==i?a.indented:"form"==u?a.indented+ve:"stat"==u?a.indented+(he(t,n)?be||ve:0):"switch"!=a.info||d||0==r.doubleIndentSwitch?a.align?a.column+(d?0:1):a.indented+(d?0:ve):a.indented+(/^(?:case|default)\b/.test(n)?ve:2*ve)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:xe?null:"/*",blockCommentEnd:xe?null:"*/",lineComment:xe?null:"//",fold:"brace",helperType:xe?"json":"javascript",jsonldMode:ye,jsonMode:xe}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("htmlmixed",function(t,r){function n(e,t){var r=t.htmlState.tagName;r&&(r=r.toLowerCase());var n=s.token(e,t.htmlState);if("script"==r&&/\btag\b/.test(n)&&">"==e.current()){var i=e.string.slice(Math.max(0,e.pos-100),e.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i);i=i?i[1]:"",i&&/[\"\']/.test(i.charAt(0))&&(i=i.slice(1,i.length-1));for(var u=0;u"==e.current()&&(t.token=a,t.localMode=l,t.localState=l.startState(s.indent(t.htmlState,"")));return n}function i(e,t,r){var n,i=e.current(),o=i.search(t);return o>-1?e.backUp(i.length-o):(n=i.match(/<\/?$/))&&(e.backUp(i.length),e.match(t,!1)||e.match(i)),r}function o(e,t){return e.match(/^<\/\s*script\s*>/i,!1)?(t.token=n,t.localState=t.localMode=null,null):i(e,/<\/\s*script\s*>/,t.localMode.token(e,t.localState))}function a(e,t){return e.match(/^<\/\s*style\s*>/i,!1)?(t.token=n,t.localState=t.localMode=null,null):i(e,/<\/\s*style\s*>/,l.token(e,t.localState))}var s=e.getMode(t,{name:"xml",htmlMode:!0,multilineTagIndentFactor:r.multilineTagIndentFactor,multilineTagIndentPastTag:r.multilineTagIndentPastTag}),l=e.getMode(t,"css"),c=[],u=r&&r.scriptTypes;if(c.push({matches:/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,mode:e.getMode(t,"javascript")}),u)for(var d=0;d]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i)&&"]("!=e.string.slice(e.start-2,e.start)?(t.combineTokens=!0,"link"):(e.next(),null)},blankLine:n},a={underscoresBreakWords:!1,taskLists:!0,fencedCodeBlocks:!0,strikethrough:!0};for(var s in r)a[s]=r[s];return a.name="markdown",e.defineMIME("gfmBase",a),e.overlayMode(e.getMode(t,"gfmBase"),o)},"markdown")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("http",function(){function e(e,t){return e.skipToEnd(),t.cur=a,"error"}function t(t,n){return t.match(/^HTTP\/\d\.\d/)?(n.cur=r,"keyword"):t.match(/^[A-Z]+/)&&/[ \t]/.test(t.peek())?(n.cur=i,"keyword"):e(t,n)}function r(t,r){var i=t.match(/^\d+/);if(!i)return e(t,r);r.cur=n;var o=Number(i[0]);return o>=100&&200>o?"positive informational":o>=200&&300>o?"positive success":o>=300&&400>o?"positive redirect":o>=400&&500>o?"negative client-error":o>=500&&600>o?"negative server-error":"error"}function n(e,t){return e.skipToEnd(),t.cur=a,null}function i(e,t){return e.eatWhile(/\S/),t.cur=o,"string-2"}function o(t,r){return t.match(/^HTTP\/\d\.\d$/)?(r.cur=a,"keyword"):e(t,r)}function a(e){return e.sol()&&!e.eat(/[ \t]/)?e.match(/^.*?:/)?"atom":(e.skipToEnd(),"error"):(e.skipToEnd(),"string")}function s(e){return e.skipToEnd(),null}return{token:function(e,t){var r=t.cur;return r!=a&&r!=s&&e.eatSpace()?null:r(e,t)},blankLine:function(e){e.cur=s},startState:function(){return{cur:t}}}}),e.defineMIME("message/http","http")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("go",function(e){function t(e,t){var i=e.next();if('"'==i||"'"==i||"`"==i)return t.tokenize=r(i),t.tokenize(e,t);if(/[\d\.]/.test(i))return"."==i?e.match(/^[0-9]+([eE][\-+]?[0-9]+)?/):"0"==i?e.match(/^[xX][0-9a-fA-F]+/)||e.match(/^0[0-7]+/):e.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/),"number";if(/[\[\]{}\(\),;\:\.]/.test(i))return s=i,null;if("/"==i){if(e.eat("*"))return t.tokenize=n,n(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(d.test(i))return e.eatWhile(d),"operator";e.eatWhile(/[\w\$_\xa1-\uffff]/);var o=e.current();return c.propertyIsEnumerable(o)?(("case"==o||"default"==o)&&(s="case"),"keyword"):u.propertyIsEnumerable(o)?"atom":"variable"}function r(e){return function(r,n){for(var i,o=!1,a=!1;null!=(i=r.next());){if(i==e&&!o){a=!0;break}o=!o&&"\\"==i}return(a||!o&&"`"!=e)&&(n.tokenize=t),"string"}}function n(e,r){for(var n,i=!1;n=e.next();){if("/"==n&&i){r.tokenize=t;break}i="*"==n}return"comment"}function i(e,t,r,n,i){this.indented=e,this.column=t,this.type=r,this.align=n,this.prev=i}function o(e,t,r){return e.context=new i(e.indented,t,r,null,e.context)}function a(e){if(e.context.prev){var t=e.context.type;return(")"==t||"]"==t||"}"==t)&&(e.indented=e.context.indented),e.context=e.context.prev}}var s,l=e.indentUnit,c={"break":!0,"case":!0,chan:!0,"const":!0,"continue":!0,"default":!0,defer:!0,"else":!0,fallthrough:!0,"for":!0,func:!0,go:!0,"goto":!0,"if":!0,"import":!0,"interface":!0,map:!0,"package":!0,range:!0,"return":!0,select:!0,struct:!0,"switch":!0,type:!0,"var":!0,bool:!0,"byte":!0,complex64:!0,complex128:!0,float32:!0,float64:!0,int8:!0,int16:!0,int32:!0,int64:!0,string:!0,uint8:!0,uint16:!0,uint32:!0,uint64:!0,"int":!0,uint:!0,uintptr:!0},u={"true":!0,"false":!0,iota:!0,nil:!0,append:!0,cap:!0,close:!0,complex:!0,copy:!0,imag:!0,len:!0,make:!0,"new":!0,panic:!0,print:!0,println:!0,real:!0,recover:!0},d=/[+\-*&^%:=<>!|\/]/;return{startState:function(e){return{tokenize:null,context:new i((e||0)-l,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,r){var n=r.context;if(e.sol()&&(null==n.align&&(n.align=!1),r.indented=e.indentation(),r.startOfLine=!0,"case"==n.type&&(n.type="}")),e.eatSpace())return null;s=null;var i=(r.tokenize||t)(e,r);return"comment"==i?i:(null==n.align&&(n.align=!0),"{"==s?o(r,e.column(),"}"):"["==s?o(r,e.column(),"]"):"("==s?o(r,e.column(),")"):"case"==s?n.type="case":"}"==s&&"}"==n.type?n=a(r):s==n.type&&a(r),r.startOfLine=!1,i)},indent:function(e,r){if(e.tokenize!=t&&null!=e.tokenize)return 0;var n=e.context,i=r&&r.charAt(0);if("case"==n.type&&/^(?:case|default)\b/.test(r))return e.context.type="}",n.indented;var o=i==n.type;return n.align?n.column+(o?0:1):n.indented+(o?0:l)},electricChars:"{}):",fold:"brace",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}}),e.defineMIME("text/x-go","go")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../clike/clike"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},r=0;rr&&"coffee"==t.scope.type?"indent":r>n?"dedent":null}r>0&&s(e,t)}if(e.eatSpace())return null;var a=e.peek();if(e.match("####"))return e.skipToEnd(),"comment";if(e.match("###"))return t.tokenize=o,t.tokenize(e,t);if("#"===a)return e.skipToEnd(),"comment";if(e.match(/^-?[0-9\.]/,!1)){var l=!1;if(e.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)&&(l=!0),e.match(/^-?\d+\.\d*/)&&(l=!0),e.match(/^-?\.\d+/)&&(l=!0),l)return"."==e.peek()&&e.backUp(1),"number";var p=!1;if(e.match(/^-?0x[0-9a-f]+/i)&&(p=!0),e.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)&&(p=!0),e.match(/^-?0(?![\dx])/i)&&(p=!0),p)return"number"}if(e.match(b))return t.tokenize=i(e.current(),!1,"string"),t.tokenize(e,t);if(e.match(y)){if("/"!=e.current()||e.match(/^.*\//,!1))return t.tokenize=i(e.current(),!0,"string-2"),t.tokenize(e,t);e.backUp(1)}return e.match(u)||e.match(h)?"operator":e.match(d)?"punctuation":e.match(k)?"atom":e.match(v)?"keyword":e.match(f)?"variable":e.match(m)?"property":(e.next(),c)}function i(e,r,i){return function(o,a){for(;!o.eol();)if(o.eatWhile(/[^'"\/\\]/),o.eat("\\")){if(o.next(),r&&o.eol())return i}else{if(o.match(e))return a.tokenize=n,i;o.eat(/['"\/]/)}return r&&(t.singleLineStringErrors?i=c:a.tokenize=n),i}}function o(e,t){for(;!e.eol();){if(e.eatWhile(/[^#]/),e.match("###")){t.tokenize=n;break}e.eatWhile("#")}return"comment"}function a(t,r,n){n=n||"coffee";for(var i=0,o=!1,a=null,s=r.scope;s;s=s.prev)if("coffee"===s.type||"}"==s.type){i=s.offset+e.indentUnit;break}"coffee"!==n?(o=null,a=t.column()+t.current().length):r.scope.align&&(r.scope.align=!1),r.scope={offset:i,type:n,prev:r.scope,align:o,alignOffset:a}}function s(e,t){if(t.scope.prev){if("coffee"===t.scope.type){for(var r=e.indentation(),n=!1,i=t.scope;i;i=i.prev)if(r===i.offset){n=!0;break}if(!n)return!0;for(;t.scope.prev&&t.scope.offset!==r;)t.scope=t.scope.prev;return!1}return t.scope=t.scope.prev,!1}}function l(e,t){var r=t.tokenize(e,t),n=e.current();if("."===n)return r=t.tokenize(e,t),n=e.current(),/^\.[\w$]+$/.test(n)?"variable":c;"return"===n&&(t.dedent=!0),("->"!==n&&"=>"!==n||t.lambda||e.peek())&&"indent"!==r||a(e,t);var i="[({".indexOf(n);if(-1!==i&&a(e,t,"])}".slice(i,i+1)),p.exec(n)&&a(e,t),"then"==n&&s(e,t),"dedent"===r&&s(e,t))return c;if(i="])}".indexOf(n),-1!==i){for(;"coffee"==t.scope.type&&t.scope.prev;)t.scope=t.scope.prev;t.scope.type==n&&(t.scope=t.scope.prev)}return t.dedent&&e.eol()&&("coffee"==t.scope.type&&t.scope.prev&&(t.scope=t.scope.prev),t.dedent=!1),r}var c="error",u=/^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?|(or|and|\|\||&&|\?)=)/,d=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/,f=/^[_A-Za-z$][_A-Za-z$0-9]*/,m=/^(@|this\.)[_A-Za-z$][_A-Za-z$0-9]*/,h=r(["and","or","not","is","isnt","in","instanceof","typeof"]),p=["for","while","loop","if","unless","else","switch","try","catch","finally","class"],g=["break","by","continue","debugger","delete","do","in","of","new","return","then","this","@","throw","when","until","extends"],v=r(p.concat(g));p=r(p);var b=/^('{3}|\"{3}|['\"])/,y=/^(\/{3}|\/)/,x=["Infinity","NaN","undefined","null","true","false","on","off","yes","no"],k=r(x),w={startState:function(e){return{tokenize:n,scope:{offset:e||0,type:"coffee",prev:null,align:!1},lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var r=null===t.scope.align&&t.scope;r&&e.sol()&&(r.align=!1);var n=l(e,t);return r&&n&&"comment"!=n&&(r.align=!0),t.lastToken={style:n,content:e.current()},e.eol()&&e.lambda&&(t.lambda=!1),n},indent:function(e,t){if(e.tokenize!=n)return 0;var r=e.scope,i=t&&"])}".indexOf(t.charAt(0))>-1;if(i)for(;"coffee"==r.type&&r.prev;)r=r.prev;var o=i&&r.type===t.charAt(0);return r.align?r.alignOffset-(o?1:0):(o?r.prev:r).offset},lineComment:"#",fold:"indent"};return w}),e.defineMIME("text/x-coffeescript","coffeescript")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("nginx",function(e){function t(e){for(var t={},r=e.split(" "),n=0;n*\/]/.test(s)?r(null,"select-op"):/[;{}:\[\]]/.test(s)?r(null,s):(e.eatWhile(/[\w\\\-]/),r("variable","variable")):r(null,"compare"):void r(null,"compare")}function i(e,t){for(var i,o=!1;null!=(i=e.next());){if(o&&"/"==i){t.tokenize=n;break}o="*"==i}return r("comment","comment")}function o(e,t){for(var i,o=0;null!=(i=e.next());){if(o>=2&&">"==i){t.tokenize=n;break}o="-"==i?o+1:0}return r("comment","comment")}function a(e){return function(t,i){for(var o,a=!1;null!=(o=t.next())&&(o!=e||a);)a=!a&&"\\"==o;return a||(i.tokenize=n),r("string","string")}}var s,l=t("break return rewrite set accept_mutex accept_mutex_delay access_log add_after_body add_before_body add_header addition_types aio alias allow ancient_browser ancient_browser_value auth_basic auth_basic_user_file auth_http auth_http_header auth_http_timeout autoindex autoindex_exact_size autoindex_localtime charset charset_types client_body_buffer_size client_body_in_file_only client_body_in_single_buffer client_body_temp_path client_body_timeout client_header_buffer_size client_header_timeout client_max_body_size connection_pool_size create_full_put_path daemon dav_access dav_methods debug_connection debug_points default_type degradation degrade deny devpoll_changes devpoll_events directio directio_alignment empty_gif env epoll_events error_log eventport_events expires fastcgi_bind fastcgi_buffer_size fastcgi_buffers fastcgi_busy_buffers_size fastcgi_cache fastcgi_cache_key fastcgi_cache_methods fastcgi_cache_min_uses fastcgi_cache_path fastcgi_cache_use_stale fastcgi_cache_valid fastcgi_catch_stderr fastcgi_connect_timeout fastcgi_hide_header fastcgi_ignore_client_abort fastcgi_ignore_headers fastcgi_index fastcgi_intercept_errors fastcgi_max_temp_file_size fastcgi_next_upstream fastcgi_param fastcgi_pass_header fastcgi_pass_request_body fastcgi_pass_request_headers fastcgi_read_timeout fastcgi_send_lowat fastcgi_send_timeout fastcgi_split_path_info fastcgi_store fastcgi_store_access fastcgi_temp_file_write_size fastcgi_temp_path fastcgi_upstream_fail_timeout fastcgi_upstream_max_fails flv geoip_city geoip_country google_perftools_profiles gzip gzip_buffers gzip_comp_level gzip_disable gzip_hash gzip_http_version gzip_min_length gzip_no_buffer gzip_proxied gzip_static gzip_types gzip_vary gzip_window if_modified_since ignore_invalid_headers image_filter image_filter_buffer image_filter_jpeg_quality image_filter_transparency imap_auth imap_capabilities imap_client_buffer index ip_hash keepalive_requests keepalive_timeout kqueue_changes kqueue_events large_client_header_buffers limit_conn limit_conn_log_level limit_rate limit_rate_after limit_req limit_req_log_level limit_req_zone limit_zone lingering_time lingering_timeout lock_file log_format log_not_found log_subrequest map_hash_bucket_size map_hash_max_size master_process memcached_bind memcached_buffer_size memcached_connect_timeout memcached_next_upstream memcached_read_timeout memcached_send_timeout memcached_upstream_fail_timeout memcached_upstream_max_fails merge_slashes min_delete_depth modern_browser modern_browser_value msie_padding msie_refresh multi_accept open_file_cache open_file_cache_errors open_file_cache_events open_file_cache_min_uses open_file_cache_valid open_log_file_cache output_buffers override_charset perl perl_modules perl_require perl_set pid pop3_auth pop3_capabilities port_in_redirect postpone_gzipping postpone_output protocol proxy proxy_bind proxy_buffer proxy_buffer_size proxy_buffering proxy_buffers proxy_busy_buffers_size proxy_cache proxy_cache_key proxy_cache_methods proxy_cache_min_uses proxy_cache_path proxy_cache_use_stale proxy_cache_valid proxy_connect_timeout proxy_headers_hash_bucket_size proxy_headers_hash_max_size proxy_hide_header proxy_ignore_client_abort proxy_ignore_headers proxy_intercept_errors proxy_max_temp_file_size proxy_method proxy_next_upstream proxy_pass_error_message proxy_pass_header proxy_pass_request_body proxy_pass_request_headers proxy_read_timeout proxy_redirect proxy_send_lowat proxy_send_timeout proxy_set_body proxy_set_header proxy_ssl_session_reuse proxy_store proxy_store_access proxy_temp_file_write_size proxy_temp_path proxy_timeout proxy_upstream_fail_timeout proxy_upstream_max_fails random_index read_ahead real_ip_header recursive_error_pages request_pool_size reset_timedout_connection resolver resolver_timeout rewrite_log rtsig_overflow_events rtsig_overflow_test rtsig_overflow_threshold rtsig_signo satisfy secure_link_secret send_lowat send_timeout sendfile sendfile_max_chunk server_name_in_redirect server_names_hash_bucket_size server_names_hash_max_size server_tokens set_real_ip_from smtp_auth smtp_capabilities smtp_client_buffer smtp_greeting_delay so_keepalive source_charset ssi ssi_ignore_recycled_buffers ssi_min_file_chunk ssi_silent_errors ssi_types ssi_value_length ssl ssl_certificate ssl_certificate_key ssl_ciphers ssl_client_certificate ssl_crl ssl_dhparam ssl_engine ssl_prefer_server_ciphers ssl_protocols ssl_session_cache ssl_session_timeout ssl_verify_client ssl_verify_depth starttls stub_status sub_filter sub_filter_once sub_filter_types tcp_nodelay tcp_nopush thread_stack_size timeout timer_resolution types_hash_bucket_size types_hash_max_size underscores_in_headers uninitialized_variable_warn use user userid userid_domain userid_expires userid_mark userid_name userid_p3p userid_path userid_service valid_referers variables_hash_bucket_size variables_hash_max_size worker_connections worker_cpu_affinity worker_priority worker_processes worker_rlimit_core worker_rlimit_nofile worker_rlimit_sigpending worker_threads working_directory xclient xml_entities xslt_stylesheet xslt_typesdrew@li229-23"),c=t("http mail events server types location upstream charset_map limit_except if geo map"),u=t("include root server server_name listen internal proxy_pass memcached_pass fastcgi_pass try_files"),d=e.indentUnit; - -return{startState:function(e){return{tokenize:n,baseIndent:e||0,stack:[]}},token:function(e,t){if(e.eatSpace())return null;s=null;var r=t.tokenize(e,t),n=t.stack[t.stack.length-1];return"hash"==s&&"rule"==n?r="atom":"variable"==r&&("rule"==n?r="number":n&&"@media{"!=n||(r="tag")),"rule"==n&&/^[\{\};]$/.test(s)&&t.stack.pop(),"{"==s?"@media"==n?t.stack[t.stack.length-1]="@media{":t.stack.push("{"):"}"==s?t.stack.pop():"@media"==s?t.stack.push("@media"):"{"==n&&"comment"!=s&&t.stack.push("rule"),r},indent:function(e,t){var r=e.stack.length;return/^\}/.test(t)&&(r-="rule"==e.stack[e.stack.length-1]?2:1),e.baseIndent+r*d},electricChars:"}"}}),e.defineMIME("text/nginx","text/x-nginx-conf")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function r(e){return e.scopes[e.scopes.length-1]}var n=t(["and","or","not","is"]),i=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in"],o=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"],a={builtins:["apply","basestring","buffer","cmp","coerce","execfile","file","intern","long","raw_input","reduce","reload","unichr","unicode","xrange","False","True","None"],keywords:["exec","print"]},s={builtins:["ascii","bytes","exec","print"],keywords:["nonlocal","False","True","None"]};e.registerHelper("hintWords","python",i.concat(o)),e.defineMode("python",function(l,c){function u(e,t){if(e.sol()&&"py"==r(t).type){var n=r(t).offset;if(e.eatSpace()){var i=e.indentation();return i>n?m(e,t,"py"):n>i&&h(e,t)&&(t.errorToken=!0),null}var o=d(e,t);return n>0&&h(e,t)&&(o+=" "+g),o}return d(e,t)}function d(e,t){if(e.eatSpace())return null;var r=e.peek();if("#"==r)return e.skipToEnd(),"comment";if(e.match(/^[0-9\.]/,!1)){var i=!1;if(e.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)&&(i=!0),e.match(/^\d+\.\d*/)&&(i=!0),e.match(/^\.\d+/)&&(i=!0),i)return e.eat(/J/i),"number";var o=!1;if(e.match(/^0x[0-9a-f]+/i)&&(o=!0),e.match(/^0b[01]+/i)&&(o=!0),e.match(/^0o[0-7]+/i)&&(o=!0),e.match(/^[1-9]\d*(e[\+\-]?\d+)?/)&&(e.eat(/J/i),o=!0),e.match(/^0(?![\dx])/i)&&(o=!0),o)return e.eat(/L/i),"number"}return e.match(T)?(t.tokenize=f(e.current()),t.tokenize(e,t)):e.match(x)||e.match(y)?null:e.match(b)||e.match(k)||e.match(n)?"operator":e.match(v)?null:e.match(M)?"keyword":e.match(L)?"builtin":e.match(/^(self|cls)\b/)?"variable-2":e.match(w)?"def"==t.lastToken||"class"==t.lastToken?"def":"variable":(e.next(),g)}function f(e){function t(t,i){for(;!t.eol();)if(t.eatWhile(/[^'"\\]/),t.eat("\\")){if(t.next(),r&&t.eol())return n}else{if(t.match(e))return i.tokenize=u,n;t.eat(/['"]/)}if(r){if(c.singleLineStringErrors)return g;i.tokenize=u}return n}for(;"rub".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var r=1==e.length,n="string";return t.isString=!0,t}function m(e,t,n){var i=0,o=null;if("py"==n)for(;"py"!=r(t).type;)t.scopes.pop();i=r(t).offset+("py"==n?l.indentUnit:_),"py"==n||e.match(/^(\s|#.*)*$/,!1)||(o=e.column()+1),t.scopes.push({offset:i,type:n,align:o})}function h(e,t){for(var n=e.indentation();r(t).offset>n;){if("py"!=r(t).type)return!0;t.scopes.pop()}return r(t).offset!=n}function p(e,t){var n=t.tokenize(e,t),i=e.current();if("."==i)return n=e.match(w,!1)?null:g,null==n&&"meta"==t.lastStyle&&(n="meta"),n;if("@"==i)return c.version&&3==parseInt(c.version,10)?e.match(w,!1)?"meta":"operator":e.match(w,!1)?"meta":g;"variable"!=n&&"builtin"!=n||"meta"!=t.lastStyle||(n="meta"),("pass"==i||"return"==i)&&(t.dedent+=1),"lambda"==i&&(t.lambda=!0),":"!=i||t.lambda||"py"!=r(t).type||m(e,t,"py");var o=1==i.length?"[({".indexOf(i):-1;if(-1!=o&&m(e,t,"])}".slice(o,o+1)),o="])}".indexOf(i),-1!=o){if(r(t).type!=i)return g;t.scopes.pop()}return t.dedent>0&&e.eol()&&"py"==r(t).type&&(t.scopes.length>1&&t.scopes.pop(),t.dedent-=1),n}var g="error",v=c.singleDelimiters||new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),b=c.doubleOperators||new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),y=c.doubleDelimiters||new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),x=c.tripleDelimiters||new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))");if(c.version&&3==parseInt(c.version,10))var k=c.singleOperators||new RegExp("^[\\+\\-\\*/%&|\\^~<>!@]"),w=c.identifiers||new RegExp("^[_A-Za-z¡-￿][_A-Za-z0-9¡-￿]*");else var k=c.singleOperators||new RegExp("^[\\+\\-\\*/%&|\\^~<>!]"),w=c.identifiers||new RegExp("^[_A-Za-z][_A-Za-z0-9]*");var _=c.hangingIndent||l.indentUnit,C=i,S=o;if(void 0!=c.extra_keywords&&(C=C.concat(c.extra_keywords)),void 0!=c.extra_builtins&&(S=S.concat(c.extra_builtins)),c.version&&3==parseInt(c.version,10)){C=C.concat(s.keywords),S=S.concat(s.builtins);var T=new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))","i")}else{C=C.concat(a.keywords),S=S.concat(a.builtins);var T=new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))","i")}var M=t(C),L=t(S),E={startState:function(e){return{tokenize:u,scopes:[{offset:e||0,type:"py",align:null}],lastStyle:null,lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var r=t.errorToken;r&&(t.errorToken=!1);var n=p(e,t);t.lastStyle=n;var i=e.current();return i&&n&&(t.lastToken=i),e.eol()&&t.lambda&&(t.lambda=!1),r?n+" "+g:n},indent:function(t,n){if(t.tokenize!=u)return t.tokenize.isString?e.Pass:0;var i=r(t),o=n&&n.charAt(0)==i.type;return null!=i.align?i.align-(o?1:0):o&&t.scopes.length>1?t.scopes[t.scopes.length-2].offset:i.offset},lineComment:"#",fold:"indent"};return E}),e.defineMIME("text/x-python","python");var l=function(e){return e.split(" ")};e.defineMIME("text/x-cython",{name:"python",extra_keywords:l("by cdef cimport cpdef ctypedef enum exceptextern gil include nogil property publicreadonly struct union DEF IF ELIF ELSE")})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){return e.string.charAt(e.pos+(t||0))}function r(e,t){if(t){var r=e.pos-t;return e.string.substr(r>=0?r:0,t)}return e.string.substr(0,e.pos-1)}function n(e,t){var r=e.string.length,n=r-e.pos+1;return e.string.substr(e.pos,t&&r>t?t:n)}function i(e,t){var r,n=e.pos+t;0>=n?e.pos=0:n>=(r=e.string.length-1)?e.pos=r:e.pos=n}e.defineMode("perl",function(){function e(e,t,r,n,i){return t.chain=null,t.style=null,t.tail=null,t.tokenize=function(e,t){for(var o,s=!1,l=0;o=e.next();){if(o===r[l]&&!s)return void 0!==r[++l]?(t.chain=r[l],t.style=n,t.tail=i):i&&e.eatWhile(i),t.tokenize=a,n;s=!s&&"\\"==o}return n},t.tokenize(e,t)}function o(e,t,r){return t.tokenize=function(e,t){return e.string==r&&(t.tokenize=a),e.skipToEnd(),"string"},t.tokenize(e,t)}function a(a,u){if(a.eatSpace())return null;if(u.chain)return e(a,u,u.chain,u.style,u.tail);if(a.match(/^\-?[\d\.]/,!1)&&a.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/))return"number";if(a.match(/^<<(?=\w)/))return a.eatWhile(/\w/),o(a,u,a.current().substr(2));if(a.sol()&&a.match(/^\=item(?!\w)/))return o(a,u,"=cut");var d=a.next();if('"'==d||"'"==d){if(r(a,3)=="<<"+d){var f=a.pos;a.eatWhile(/\w/);var m=a.current().substr(1);if(m&&a.eat(d))return o(a,u,m);a.pos=f}return e(a,u,[d],"string")}if("q"==d){var h=t(a,-2);if(!h||!/\w/.test(h))if(h=t(a,0),"x"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],l,c);if("["==h)return i(a,2),e(a,u,["]"],l,c);if("{"==h)return i(a,2),e(a,u,["}"],l,c);if("<"==h)return i(a,2),e(a,u,[">"],l,c);if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],l,c)}else if("q"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],"string");if("["==h)return i(a,2),e(a,u,["]"],"string");if("{"==h)return i(a,2),e(a,u,["}"],"string");if("<"==h)return i(a,2),e(a,u,[">"],"string");if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],"string")}else if("w"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],"bracket");if("["==h)return i(a,2),e(a,u,["]"],"bracket");if("{"==h)return i(a,2),e(a,u,["}"],"bracket");if("<"==h)return i(a,2),e(a,u,[">"],"bracket");if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],"bracket")}else if("r"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],l,c);if("["==h)return i(a,2),e(a,u,["]"],l,c);if("{"==h)return i(a,2),e(a,u,["}"],l,c);if("<"==h)return i(a,2),e(a,u,[">"],l,c);if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],l,c)}else if(/[\^'"!~\/(\[{<]/.test(h)){if("("==h)return i(a,1),e(a,u,[")"],"string");if("["==h)return i(a,1),e(a,u,["]"],"string");if("{"==h)return i(a,1),e(a,u,["}"],"string");if("<"==h)return i(a,1),e(a,u,[">"],"string");if(/[\^'"!~\/]/.test(h))return e(a,u,[a.eat(h)],"string")}}if("m"==d){var h=t(a,-2);if((!h||!/\w/.test(h))&&(h=a.eat(/[(\[{<\^'"!~\/]/))){if(/[\^'"!~\/]/.test(h))return e(a,u,[h],l,c);if("("==h)return e(a,u,[")"],l,c);if("["==h)return e(a,u,["]"],l,c);if("{"==h)return e(a,u,["}"],l,c);if("<"==h)return e(a,u,[">"],l,c)}}if("s"==d){var h=/[\/>\]})\w]/.test(t(a,-2));if(!h&&(h=a.eat(/[(\[{<\^'"!~\/]/)))return"["==h?e(a,u,["]","]"],l,c):"{"==h?e(a,u,["}","}"],l,c):"<"==h?e(a,u,[">",">"],l,c):"("==h?e(a,u,[")",")"],l,c):e(a,u,[h,h],l,c)}if("y"==d){var h=/[\/>\]})\w]/.test(t(a,-2));if(!h&&(h=a.eat(/[(\[{<\^'"!~\/]/)))return"["==h?e(a,u,["]","]"],l,c):"{"==h?e(a,u,["}","}"],l,c):"<"==h?e(a,u,[">",">"],l,c):"("==h?e(a,u,[")",")"],l,c):e(a,u,[h,h],l,c)}if("t"==d){var h=/[\/>\]})\w]/.test(t(a,-2));if(!h&&(h=a.eat("r"),h&&(h=a.eat(/[(\[{<\^'"!~\/]/))))return"["==h?e(a,u,["]","]"],l,c):"{"==h?e(a,u,["}","}"],l,c):"<"==h?e(a,u,[">",">"],l,c):"("==h?e(a,u,[")",")"],l,c):e(a,u,[h,h],l,c)}if("`"==d)return e(a,u,[d],"variable-2");if("/"==d)return/~\s*$/.test(r(a))?e(a,u,[d],l,c):"operator";if("$"==d){var f=a.pos;if(a.eatWhile(/\d/)||a.eat("{")&&a.eatWhile(/\d/)&&a.eat("}"))return"variable-2";a.pos=f}if(/[$@%]/.test(d)){var f=a.pos;if(a.eat("^")&&a.eat(/[A-Z]/)||!/[@$%&]/.test(t(a,-2))&&a.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){var h=a.current();if(s[h])return"variable-2"}a.pos=f}if(/[$@%&]/.test(d)&&(a.eatWhile(/[\w$\[\]]/)||a.eat("{")&&a.eatWhile(/[\w$\[\]]/)&&a.eat("}"))){var h=a.current();return s[h]?"variable-2":"variable"}if("#"==d&&"$"!=t(a,-2))return a.skipToEnd(),"comment";if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(d)){var f=a.pos;if(a.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/),s[a.current()])return"operator";a.pos=f}if("_"==d&&1==a.pos){if("_END__"==n(a,6))return e(a,u,["\x00"],"comment");if("_DATA__"==n(a,7))return e(a,u,["\x00"],"variable-2");if("_C__"==n(a,7))return e(a,u,["\x00"],"string")}if(/\w/.test(d)){var f=a.pos;if("{"==t(a,-2)&&("}"==t(a,0)||a.eatWhile(/\w/)&&"}"==t(a,0)))return"string";a.pos=f}if(/[A-Z]/.test(d)){var p=t(a,-2),f=a.pos;if(a.eatWhile(/[A-Z_]/),!/[\da-z]/.test(t(a,0))){var h=s[a.current()];return h?(h[1]&&(h=h[0]),":"!=p?1==h?"keyword":2==h?"def":3==h?"atom":4==h?"operator":5==h?"variable-2":"meta":"meta"):"meta"}a.pos=f}if(/[a-zA-Z_]/.test(d)){var p=t(a,-2);a.eatWhile(/\w/);var h=s[a.current()];return h?(h[1]&&(h=h[0]),":"!=p?1==h?"keyword":2==h?"def":3==h?"atom":4==h?"operator":5==h?"variable-2":"meta":"meta"):"meta"}return null}var s={"->":4,"++":4,"--":4,"**":4,"=~":4,"!~":4,"*":4,"/":4,"%":4,x:4,"+":4,"-":4,".":4,"<<":4,">>":4,"<":4,">":4,"<=":4,">=":4,lt:4,gt:4,le:4,ge:4,"==":4,"!=":4,"<=>":4,eq:4,ne:4,cmp:4,"~~":4,"&":4,"|":4,"^":4,"&&":4,"||":4,"//":4,"..":4,"...":4,"?":4,":":4,"=":4,"+=":4,"-=":4,"*=":4,",":4,"=>":4,"::":4,not:4,and:4,or:4,xor:4,BEGIN:[5,1],END:[5,1],PRINT:[5,1],PRINTF:[5,1],GETC:[5,1],READ:[5,1],READLINE:[5,1],DESTROY:[5,1],TIE:[5,1],TIEHANDLE:[5,1],UNTIE:[5,1],STDIN:5,STDIN_TOP:5,STDOUT:5,STDOUT_TOP:5,STDERR:5,STDERR_TOP:5,$ARG:5,$_:5,"@ARG":5,"@_":5,$LIST_SEPARATOR:5,'$"':5,$PROCESS_ID:5,$PID:5,$$:5,$REAL_GROUP_ID:5,$GID:5,"$(":5,$EFFECTIVE_GROUP_ID:5,$EGID:5,"$)":5,$PROGRAM_NAME:5,$0:5,$SUBSCRIPT_SEPARATOR:5,$SUBSEP:5,"$;":5,$REAL_USER_ID:5,$UID:5,"$<":5,$EFFECTIVE_USER_ID:5,$EUID:5,"$>":5,$a:5,$b:5,$COMPILING:5,"$^C":5,$DEBUGGING:5,"$^D":5,"${^ENCODING}":5,$ENV:5,"%ENV":5,$SYSTEM_FD_MAX:5,"$^F":5,"@F":5,"${^GLOBAL_PHASE}":5,"$^H":5,"%^H":5,"@INC":5,"%INC":5,$INPLACE_EDIT:5,"$^I":5,"$^M":5,$OSNAME:5,"$^O":5,"${^OPEN}":5,$PERLDB:5,"$^P":5,$SIG:5,"%SIG":5,$BASETIME:5,"$^T":5,"${^TAINT}":5,"${^UNICODE}":5,"${^UTF8CACHE}":5,"${^UTF8LOCALE}":5,$PERL_VERSION:5,"$^V":5,"${^WIN32_SLOPPY_STAT}":5,$EXECUTABLE_NAME:5,"$^X":5,$1:5,$MATCH:5,"$&":5,"${^MATCH}":5,$PREMATCH:5,"$`":5,"${^PREMATCH}":5,$POSTMATCH:5,"$'":5,"${^POSTMATCH}":5,$LAST_PAREN_MATCH:5,"$+":5,$LAST_SUBMATCH_RESULT:5,"$^N":5,"@LAST_MATCH_END":5,"@+":5,"%LAST_PAREN_MATCH":5,"%+":5,"@LAST_MATCH_START":5,"@-":5,"%LAST_MATCH_START":5,"%-":5,$LAST_REGEXP_CODE_RESULT:5,"$^R":5,"${^RE_DEBUG_FLAGS}":5,"${^RE_TRIE_MAXBUF}":5,$ARGV:5,"@ARGV":5,ARGV:5,ARGVOUT:5,$OUTPUT_FIELD_SEPARATOR:5,$OFS:5,"$,":5,$INPUT_LINE_NUMBER:5,$NR:5,"$.":5,$INPUT_RECORD_SEPARATOR:5,$RS:5,"$/":5,$OUTPUT_RECORD_SEPARATOR:5,$ORS:5,"$\\":5,$OUTPUT_AUTOFLUSH:5,"$|":5,$ACCUMULATOR:5,"$^A":5,$FORMAT_FORMFEED:5,"$^L":5,$FORMAT_PAGE_NUMBER:5,"$%":5,$FORMAT_LINES_LEFT:5,"$-":5,$FORMAT_LINE_BREAK_CHARACTERS:5,"$:":5,$FORMAT_LINES_PER_PAGE:5,"$=":5,$FORMAT_TOP_NAME:5,"$^":5,$FORMAT_NAME:5,"$~":5,"${^CHILD_ERROR_NATIVE}":5,$EXTENDED_OS_ERROR:5,"$^E":5,$EXCEPTIONS_BEING_CAUGHT:5,"$^S":5,$WARNING:5,"$^W":5,"${^WARNING_BITS}":5,$OS_ERROR:5,$ERRNO:5,"$!":5,"%OS_ERROR":5,"%ERRNO":5,"%!":5,$CHILD_ERROR:5,"$?":5,$EVAL_ERROR:5,"$@":5,$OFMT:5,"$#":5,"$*":5,$ARRAY_BASE:5,"$[":5,$OLD_PERL_VERSION:5,"$]":5,"if":[1,1],elsif:[1,1],"else":[1,1],"while":[1,1],unless:[1,1],"for":[1,1],foreach:[1,1],abs:1,accept:1,alarm:1,atan2:1,bind:1,binmode:1,bless:1,bootstrap:1,"break":1,caller:1,chdir:1,chmod:1,chomp:1,chop:1,chown:1,chr:1,chroot:1,close:1,closedir:1,connect:1,"continue":[1,1],cos:1,crypt:1,dbmclose:1,dbmopen:1,"default":1,defined:1,"delete":1,die:1,"do":1,dump:1,each:1,endgrent:1,endhostent:1,endnetent:1,endprotoent:1,endpwent:1,endservent:1,eof:1,eval:1,exec:1,exists:1,exit:1,exp:1,fcntl:1,fileno:1,flock:1,fork:1,format:1,formline:1,getc:1,getgrent:1,getgrgid:1,getgrnam:1,gethostbyaddr:1,gethostbyname:1,gethostent:1,getlogin:1,getnetbyaddr:1,getnetbyname:1,getnetent:1,getpeername:1,getpgrp:1,getppid:1,getpriority:1,getprotobyname:1,getprotobynumber:1,getprotoent:1,getpwent:1,getpwnam:1,getpwuid:1,getservbyname:1,getservbyport:1,getservent:1,getsockname:1,getsockopt:1,given:1,glob:1,gmtime:1,"goto":1,grep:1,hex:1,"import":1,index:1,"int":1,ioctl:1,join:1,keys:1,kill:1,last:1,lc:1,lcfirst:1,length:1,link:1,listen:1,local:2,localtime:1,lock:1,log:1,lstat:1,m:null,map:1,mkdir:1,msgctl:1,msgget:1,msgrcv:1,msgsnd:1,my:2,"new":1,next:1,no:1,oct:1,open:1,opendir:1,ord:1,our:2,pack:1,"package":1,pipe:1,pop:1,pos:1,print:1,printf:1,prototype:1,push:1,q:null,qq:null,qr:null,quotemeta:null,qw:null,qx:null,rand:1,read:1,readdir:1,readline:1,readlink:1,readpipe:1,recv:1,redo:1,ref:1,rename:1,require:1,reset:1,"return":1,reverse:1,rewinddir:1,rindex:1,rmdir:1,s:null,say:1,scalar:1,seek:1,seekdir:1,select:1,semctl:1,semget:1,semop:1,send:1,setgrent:1,sethostent:1,setnetent:1,setpgrp:1,setpriority:1,setprotoent:1,setpwent:1,setservent:1,setsockopt:1,shift:1,shmctl:1,shmget:1,shmread:1,shmwrite:1,shutdown:1,sin:1,sleep:1,socket:1,socketpair:1,sort:1,splice:1,split:1,sprintf:1,sqrt:1,srand:1,stat:1,state:1,study:1,sub:1,substr:1,symlink:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,tell:1,telldir:1,tie:1,tied:1,time:1,times:1,tr:null,truncate:1,uc:1,ucfirst:1,umask:1,undef:1,unlink:1,unpack:1,unshift:1,untie:1,use:1,utime:1,values:1,vec:1,wait:1,waitpid:1,wantarray:1,warn:1,when:1,write:1,y:null},l="string-2",c=/[goseximacplud]/;return{startState:function(){return{tokenize:a,chain:null,style:null,tail:null}},token:function(e,t){return(t.tokenize||a)(e,t)},lineComment:"#"}}),e.registerHelper("wordChars","perl",/[\w$]/),e.defineMIME("text/x-perl","perl")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("lua",function(e,t){function r(e){return new RegExp("^(?:"+e.join("|")+")","i")}function n(e){return new RegExp("^(?:"+e.join("|")+")$","i")}function i(e){for(var t=0;e.eat("=");)++t;return e.eat("["),t}function o(e,t){var r=e.next();return"-"==r&&e.eat("-")?e.eat("[")&&e.eat("[")?(t.cur=a(i(e),"comment"))(e,t):(e.skipToEnd(),"comment"):'"'==r||"'"==r?(t.cur=s(r))(e,t):"["==r&&/[\[=]/.test(e.peek())?(t.cur=a(i(e),"string"))(e,t):/\d/.test(r)?(e.eatWhile(/[\w.%]/),"number"):/[\w_]/.test(r)?(e.eatWhile(/[\w\\\-_.]/),"variable"):null}function a(e,t){return function(r,n){for(var i,a=null;null!=(i=r.next());)if(null==a)"]"==i&&(a=0);else if("="==i)++a;else{if("]"==i&&a==e){n.cur=o;break}a=null}return t}}function s(e){return function(t,r){for(var n,i=!1;null!=(n=t.next())&&(n!=e||i);)i=!i&&"\\"==n;return i||(r.cur=o),"string"}}var l=e.indentUnit,c=n(t.specials||[]),u=n(["_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load","loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require","select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall","coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield","debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable","debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable","debug.setupvalue","debug.traceback","close","flush","lines","read","seek","setvbuf","write","io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin","io.stdout","io.tmpfile","io.type","io.write","math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg","math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max","math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh","math.sqrt","math.tan","math.tanh","os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale","os.time","os.tmpname","package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload","package.seeall","string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub","string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper","table.concat","table.insert","table.maxn","table.remove","table.sort"]),d=n(["and","break","elseif","false","nil","not","or","return","true","function","end","if","then","else","do","while","repeat","until","for","in","local"]),f=n(["function","if","repeat","do","\\(","{"]),m=n(["end","until","\\)","}"]),h=r(["end","until","\\)","}","else","elseif"]);return{startState:function(e){return{basecol:e||0,indentDepth:0,cur:o}},token:function(e,t){if(e.eatSpace())return null;var r=t.cur(e,t),n=e.current();return"variable"==r&&(d.test(n)?r="keyword":u.test(n)?r="builtin":c.test(n)&&(r="variable-2")),"comment"!=r&&"string"!=r&&(f.test(n)?++t.indentDepth:m.test(n)&&--t.indentDepth),r},indent:function(e,t){var r=h.test(t);return e.basecol+l*(e.indentDepth-(r?1:0))},lineComment:"--",blockCommentStart:"--[[",blockCommentEnd:"]]"}}),e.defineMIME("text/x-lua","lua")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("r",function(e){function t(e){for(var t=e.split(" "),r={},n=0;n=!&|~$:]/;return{startState:function(){return{tokenize:r,ctx:{type:"top",indent:-e.indentUnit,align:!1},indent:0,afterIdent:!1}},token:function(e,t){if(e.sol()&&(null==t.ctx.align&&(t.ctx.align=!1),t.indent=e.indentation()),e.eatSpace())return null;var r=t.tokenize(e,t);"comment"!=r&&null==t.ctx.align&&(t.ctx.align=!0);var n=t.ctx.type;return";"!=a&&"{"!=a&&"}"!=a||"block"!=n||o(t),"{"==a?i(t,"}",e):"("==a?(i(t,")",e),t.afterIdent&&(t.ctx.argList=!0)):"["==a?i(t,"]",e):"block"==a?i(t,"block",e):a==n&&o(t),t.afterIdent="variable"==r||"keyword"==r,r},indent:function(t,n){if(t.tokenize!=r)return 0;var i=n&&n.charAt(0),o=t.ctx,a=i==o.type;return"block"==o.type?o.indent+("{"==i?0:e.indentUnit):o.align?o.column+(a?0:1):o.indent+(a?0:e.indentUnit)},lineComment:"#"}}),e.defineMIME("text/x-rsrc","r")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("ruby",function(e){function t(e){for(var t={},r=0,n=e.length;n>r;++r)t[e[r]]=!0;return t}function r(e,t,r){return r.tokenize.push(e),e(t,r)}function n(e,t){if(c=null,e.sol()&&e.match("=begin")&&e.eol())return t.tokenize.push(l),"comment";if(e.eatSpace())return null;var n,i=e.next();if("`"==i||"'"==i||'"'==i)return r(a(i,"string",'"'==i||"`"==i),e,t);if("/"==i){var o=e.current().length;if(e.skipTo("/")){var u=e.current().length;e.backUp(e.current().length-o);for(var d=0;e.current().lengthd)break}if(e.backUp(e.current().length-o),0==d)return r(a(i,"string-2",!0),e,t)}return"operator"}if("%"==i){var h="string",p=!0;e.eat("s")?h="atom":e.eat(/[WQ]/)?h="string":e.eat(/[r]/)?h="string-2":e.eat(/[wxq]/)&&(h="string",p=!1);var g=e.eat(/[^\w\s=]/);return g?(m.propertyIsEnumerable(g)&&(g=m[g]),r(a(g,h,p,!0),e,t)):"operator"}if("#"==i)return e.skipToEnd(),"comment";if("<"==i&&(n=e.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/)))return r(s(n[1]),e,t);if("0"==i)return e.eatWhile(e.eat("x")?/[\da-fA-F]/:e.eat("b")?/[01]/:/[0-7]/),"number";if(/\d/.test(i))return e.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/),"number";if("?"==i){for(;e.match(/^\\[CM]-/););return e.eat("\\")?e.eatWhile(/\w/):e.next(),"string"}if(":"==i)return e.eat("'")?r(a("'","atom",!1),e,t):e.eat('"')?r(a('"',"atom",!0),e,t):e.eat(/[\<\>]/)?(e.eat(/[\<\>]/),"atom"):e.eat(/[\+\-\*\/\&\|\:\!]/)?"atom":e.eat(/[a-zA-Z$@_\xa1-\uffff]/)?(e.eatWhile(/[\w$\xa1-\uffff]/),e.eat(/[\?\!\=]/),"atom"):"operator";if("@"==i&&e.match(/^@?[a-zA-Z_\xa1-\uffff]/))return e.eat("@"),e.eatWhile(/[\w\xa1-\uffff]/),"variable-2";if("$"==i)return e.eat(/[a-zA-Z_]/)?e.eatWhile(/[\w]/):e.eat(/\d/)?e.eat(/\d/):e.next(),"variable-3";if(/[a-zA-Z_\xa1-\uffff]/.test(i))return e.eatWhile(/[\w\xa1-\uffff]/),e.eat(/[\?\!]/),e.eat(":")?"atom":"ident";if("|"!=i||!t.varList&&"{"!=t.lastTok&&"do"!=t.lastTok){if(/[\(\)\[\]{}\\;]/.test(i))return c=i,null;if("-"==i&&e.eat(">"))return"arrow";if(/[=+\-\/*:\.^%<>~|]/.test(i)){var v=e.eatWhile(/[=+\-\/*:\.^%<>~|]/);return"."!=i||v||(c="."),"operator"}return null}return c="|",null}function i(e){return e||(e=1),function(t,r){if("}"==t.peek()){if(1==e)return r.tokenize.pop(),r.tokenize[r.tokenize.length-1](t,r);r.tokenize[r.tokenize.length-1]=i(e-1)}else"{"==t.peek()&&(r.tokenize[r.tokenize.length-1]=i(e+1));return n(t,r)}}function o(){var e=!1;return function(t,r){return e?(r.tokenize.pop(),r.tokenize[r.tokenize.length-1](t,r)):(e=!0,n(t,r))}}function a(e,t,r,n){return function(a,s){var l,c=!1;for("read-quoted-paused"===s.context.type&&(s.context=s.context.prev,a.eat("}"));null!=(l=a.next());){if(l==e&&(n||!c)){s.tokenize.pop();break}if(r&&"#"==l&&!c){if(a.eat("{")){"}"==e&&(s.context={prev:s.context,type:"read-quoted-paused"}),s.tokenize.push(i());break}if(/[@\$]/.test(a.peek())){s.tokenize.push(o());break}}c=!c&&"\\"==l}return t}}function s(e){return function(t,r){return t.match(e)?r.tokenize.pop():t.skipToEnd(),"string"}}function l(e,t){return e.sol()&&e.match("=end")&&e.eol()&&t.tokenize.pop(),e.skipToEnd(),"comment"}var c,u=t(["alias","and","BEGIN","begin","break","case","class","def","defined?","do","else","elsif","END","end","ensure","false","for","if","in","module","next","not","or","redo","rescue","retry","return","self","super","then","true","undef","unless","until","when","while","yield","nil","raise","throw","catch","fail","loop","callcc","caller","lambda","proc","public","protected","private","require","load","require_relative","extend","autoload","__END__","__FILE__","__LINE__","__dir__"]),d=t(["def","class","case","for","while","module","then","catch","loop","proc","begin"]),f=t(["end","until"]),m={"[":"]","{":"}","(":")"};return{startState:function(){return{tokenize:[n],indented:0,context:{type:"top",indented:-e.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(e,t){e.sol()&&(t.indented=e.indentation());var r,n=t.tokenize[t.tokenize.length-1](e,t),i=c;if("ident"==n){var o=e.current();n="."==t.lastTok?"property":u.propertyIsEnumerable(e.current())?"keyword":/^[A-Z]/.test(o)?"tag":"def"==t.lastTok||"class"==t.lastTok||t.varList?"def":"variable","keyword"==n&&(i=o,d.propertyIsEnumerable(o)?r="indent":f.propertyIsEnumerable(o)?r="dedent":"if"!=o&&"unless"!=o||e.column()!=e.indentation()?"do"==o&&t.context.indented\\?]*[^\\W_])?)",y=new RegExp(r("^{0}",b)),x="(?:[^\\W\\d_](?:[\\w\\s!\"#$%&'()\\*\\+,\\-\\./:;<=>\\?]*[^\\W_])?)",k=r("(?:{0}|`{1}`)",b,x),w="(?:[^\\s\\|](?:[^\\|]*[^\\s\\|])?)",_="(?:[^\\`]+)",C=new RegExp(r("^{0}",_)),S=new RegExp("^([!'#$%&\"()*+,-./:;<=>?@\\[\\\\\\]^_`{|}~])\\1{3,}\\s*$"),T=new RegExp(r("^\\.\\.{0}",p)),M=new RegExp(r("^_{0}:{1}|^__:{1}",k,g)),L=new RegExp(r("^{0}::{1}",k,g)),E=new RegExp(r("^\\|{0}\\|{1}{2}::{3}",w,p,k,g)),q=new RegExp(r("^\\[(?:\\d+|#{0}?|\\*)]{1}",k,g)),j=new RegExp(r("^\\[{0}\\]{1}",k,g)),z=new RegExp(r("^\\|{0}\\|",w)),I=new RegExp(r("^\\[(?:\\d+|#{0}?|\\*)]_",k)),P=new RegExp(r("^\\[{0}\\]_",k)),D=new RegExp(r("^{0}__?",k)),A=new RegExp(r("^`{0}`_",_)),$=new RegExp(r("^:{0}:`{1}`{2}",b,_,g)),O=new RegExp(r("^`{1}`:{0}:{2}",b,_,g)),R=new RegExp(r("^:{0}:{1}",b,g)),F=new RegExp(r("^{0}",k)),H=new RegExp(r("^::{0}",g)),N=new RegExp(r("^\\|{0}\\|",w)),B=new RegExp(r("^{0}",p)),U=new RegExp(r("^{0}",k)),W=new RegExp(r("^::{0}",g)),V=new RegExp("^_"),K=new RegExp(r("^{0}|_",k)),Z=new RegExp(r("^:{0}",g)),G=new RegExp("^::\\s*$"),X=new RegExp("^\\s+(?:>>>|In \\[\\d+\\]:)\\s");return{startState:function(){return{tok:n,ctx:c(void 0,0)}},copyState:function(t){var r=t.ctx,n=t.tmp;return r.local&&(r={mode:r.mode,local:e.copyState(r.mode,r.local)}),n&&(n={mode:n.mode,local:e.copyState(n.mode,n.local)}),{tok:t.tok,ctx:r,tmp:n}},innerMode:function(e){return e.tmp?{state:e.tmp.local,mode:e.tmp.mode}:e.ctx.mode?{state:e.ctx.local,mode:e.ctx.mode}:null},token:function(e,t){return t.tok(e,t)}}},"python","stex"),e.defineMIME("text/x-rst","rst")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../smarty/smarty")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../smarty/smarty"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("smartymixed",function(t){function r(e){return e.replace(/[^\s\w]/g,"\\$&")}var n=e.getMode(t,"htmlmixed"),i=e.getMode(t,"smarty"),o={rightDelimiter:"}",leftDelimiter:"{"};t.hasOwnProperty("leftDelimiter")&&(o.leftDelimiter=t.leftDelimiter),t.hasOwnProperty("rightDelimiter")&&(o.rightDelimiter=t.rightDelimiter);var a=r(o.leftDelimiter),s=r(o.rightDelimiter),l={smartyComment:new RegExp("^"+s+"\\*"),literalOpen:new RegExp(a+"literal"+s),literalClose:new RegExp(a+"/literal"+s),hasLeftDelimeter:new RegExp(".*"+a),htmlHasLeftDelimeter:new RegExp("[^<>]*"+a)},c={chain:function(e,t,r){return t.tokenize=r,r(e,t)},cleanChain:function(e,t,r){return t.tokenize=null,t.localState=null,t.localMode=null,"string"==typeof r?r?r:null:r(e,t)},maybeBackup:function(e,t,r){var n,i=e.current(),o=i.search(t);return o>-1?e.backUp(i.length-o):(n=i.match(/<\/?$/))&&(e.backUp(i.length),e.match(t,!1)||e.match(i[0])),r}},u={html:function(e,t){var r=t.htmlMixedState.htmlState.context&&t.htmlMixedState.htmlState.context.tagName?t.htmlMixedState.htmlState.context.tagName:null;return!t.inLiteral&&e.match(l.htmlHasLeftDelimeter,!1)&&null===r?(t.tokenize=u.smarty,t.localMode=i,t.localState=i.startState(n.indent(t.htmlMixedState,"")),c.maybeBackup(e,o.leftDelimiter,i.token(e,t.localState))):!t.inLiteral&&e.match(o.leftDelimiter,!1)?(t.tokenize=u.smarty,t.localMode=i,t.localState=i.startState(n.indent(t.htmlMixedState,"")),c.maybeBackup(e,o.leftDelimiter,i.token(e,t.localState))):n.token(e,t.htmlMixedState)},smarty:function(e,t){if(e.match(o.leftDelimiter,!1)){if(e.match(l.smartyComment,!1))return c.chain(e,t,u.inBlock("comment","*"+o.rightDelimiter))}else if(e.match(o.rightDelimiter,!1))return e.eat(o.rightDelimiter),t.tokenize=u.html,t.localMode=n,t.localState=t.htmlMixedState,"tag";return c.maybeBackup(e,o.rightDelimiter,i.token(e,t.localState))},inBlock:function(e,t){return function(r,n){for(;!r.eol();){if(r.match(t)){c.cleanChain(r,n,"");break}r.next()}return e}}};return{startState:function(){var e=n.startState();return{token:u.html,localMode:null,localState:null,htmlMixedState:e,tokenize:null,inLiteral:!1}},copyState:function(t){var r=null,o=t.tokenize||t.token;return t.localState&&(r=e.copyState(o!=u.html?i:n,t.localState)),{token:t.token,tokenize:t.tokenize,localMode:t.localMode,localState:r,htmlMixedState:e.copyState(n,t.htmlMixedState),inLiteral:t.inLiteral}},token:function(e,t){if(e.match(o.leftDelimiter,!1)){if(!t.inLiteral&&e.match(l.literalOpen,!0))return t.inLiteral=!0,"keyword";if(t.inLiteral&&e.match(l.literalClose,!0))return t.inLiteral=!1,"keyword"}t.inLiteral&&t.localState!=t.htmlMixedState&&(t.tokenize=u.html,t.localMode=n,t.localState=t.htmlMixedState);var r=(t.tokenize||t.token)(e,t);return r},indent:function(t,r){return t.localMode==i||t.inLiteral&&!t.localMode||l.hasLeftDelimeter.test(r)?e.Pass:n.indent(t.htmlMixedState,r)},innerMode:function(e){return{state:e.localState||e.htmlMixedState,mode:e.localMode||n}}}},"htmlmixed","smarty"),e.defineMIME("text/x-smarty","smartymixed")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("vb",function(e,t){function r(e){return new RegExp("^(("+e.join(")|(")+"))\\b","i")}function n(e,t){t.currentIndent++}function i(e,t){t.currentIndent--}function o(e,t){if(e.eatSpace())return null;var r=e.peek();if("'"===r)return e.skipToEnd(),"comment";if(e.match(/^((&H)|(&O))?[0-9\.a-f]/i,!1)){var o=!1;if(e.match(/^\d*\.\d+F?/i)?o=!0:e.match(/^\d+\.\d*F?/)?o=!0:e.match(/^\.\d+F?/)&&(o=!0),o)return e.eat(/J/i),"number";var s=!1;if(e.match(/^&H[0-9a-f]+/i)?s=!0:e.match(/^&O[0-7]+/i)?s=!0:e.match(/^[1-9]\d*F?/)?(e.eat(/J/i),s=!0):e.match(/^0(?![\dx])/i)&&(s=!0),s)return e.eat(/L/i),"number"}return e.match(_)?(t.tokenize=a(e.current()),t.tokenize(e,t)):e.match(m)||e.match(f)?null:e.match(d)||e.match(c)||e.match(b)?"operator":e.match(u)?null:e.match(L)?(n(e,t),t.doInCurrentLine=!0,"keyword"):e.match(C)?(t.doInCurrentLine?t.doInCurrentLine=!1:n(e,t),"keyword"):e.match(S)?"keyword":e.match(M)?(i(e,t),i(e,t),"keyword"):e.match(T)?(i(e,t),"keyword"):e.match(w)?"keyword":e.match(k)?"keyword":e.match(h)?"variable":(e.next(),l)}function a(e){var r=1==e.length,n="string";return function(i,a){for(;!i.eol();){if(i.eatWhile(/[^'"]/),i.match(e))return a.tokenize=o,n;i.eat(/['"]/)}if(r){if(t.singleLineStringErrors)return l;a.tokenize=o}return n}}function s(e,t){var r=t.tokenize(e,t),o=e.current();if("."===o)return r=t.tokenize(e,t),o=e.current(),"variable"===r?"variable":l;var a="[({".indexOf(o);return-1!==a&&n(e,t),"dedent"===E&&i(e,t)?l:(a="])}".indexOf(o),-1!==a&&i(e,t)?l:r)}var l="error",c=new RegExp("^[\\+\\-\\*/%&\\\\|\\^~<>!]"),u=new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),d=new RegExp("^((==)|(<>)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),f=new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),m=new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"),h=new RegExp("^[_A-Za-z][_A-Za-z0-9]*"),p=["class","module","sub","enum","select","while","if","function","get","set","property","try"],g=["else","elseif","case","catch"],v=["next","loop"],b=r(["and","or","not","xor","in"]),y=["as","dim","break","continue","optional","then","until","goto","byval","byref","new","handles","property","return","const","private","protected","friend","public","shared","static","true","false"],x=["integer","string","double","decimal","boolean","short","char","float","single"],k=r(y),w=r(x),_='"',C=r(p),S=r(g),T=r(v),M=r(["end"]),L=r(["do"]),E=null,q={electricChars:"dDpPtTfFeE ",startState:function(){return{tokenize:o,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1}},token:function(e,t){e.sol()&&(t.currentIndent+=t.nextLineIndent,t.nextLineIndent=0,t.doInCurrentLine=0);var r=s(e,t);return t.lastToken={style:r,content:e.current()},r},indent:function(t,r){var n=r.replace(/^\s+|\s+$/g,"");return n.match(T)||n.match(M)||n.match(S)?e.indentUnit*(t.currentIndent-1):t.currentIndent<0?0:t.currentIndent*e.indentUnit}};return q}),e.defineMIME("text/x-vb","vb")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("vbscript",function(e,t){function r(e){return new RegExp("^(("+e.join(")|(")+"))\\b","i")}function n(e,t){t.currentIndent++}function i(e,t){t.currentIndent--}function o(e,t){if(e.eatSpace())return"space";var r=e.peek();if("'"===r)return e.skipToEnd(),"comment";if(e.match(H))return e.skipToEnd(),"comment";if(e.match(/^((&H)|(&O))?[0-9\.]/i,!1)&&!e.match(/^((&H)|(&O))?[0-9\.]+[a-z_]/i,!1)){var o=!1;if(e.match(/^\d*\.\d+/i)?o=!0:e.match(/^\d+\.\d*/)?o=!0:e.match(/^\.\d+/)&&(o=!0),o)return e.eat(/J/i),"number";var s=!1;if(e.match(/^&H[0-9a-f]+/i)?s=!0:e.match(/^&O[0-7]+/i)?s=!0:e.match(/^[1-9]\d*F?/)?(e.eat(/J/i),s=!0):e.match(/^0(?![\dx])/i)&&(s=!0),s)return e.eat(/L/i),"number"}return e.match(P)?(t.tokenize=a(e.current()),t.tokenize(e,t)):e.match(u)||e.match(c)||e.match(v)?"operator":e.match(d)?null:e.match(f)?"bracket":e.match(F)?(t.doInCurrentLine=!0,"keyword"):e.match(R)?(n(e,t),t.doInCurrentLine=!0,"keyword"):e.match(D)?(t.doInCurrentLine?t.doInCurrentLine=!1:n(e,t),"keyword"):e.match(A)?"keyword":e.match(O)?(i(e,t),i(e,t),"keyword"):e.match($)?(t.doInCurrentLine?t.doInCurrentLine=!1:i(e,t),"keyword"):e.match(E)?"keyword":e.match(q)?"atom":e.match(I)?"variable-2":e.match(j)?"builtin":e.match(z)?"variable-2":e.match(m)?"variable":(e.next(),l)}function a(e){var r=1==e.length,n="string";return function(i,a){for(;!i.eol();){if(i.eatWhile(/[^'"]/),i.match(e))return a.tokenize=o,n;i.eat(/['"]/)}if(r){if(t.singleLineStringErrors)return l;a.tokenize=o}return n}}function s(e,t){var r=t.tokenize(e,t),n=e.current();return"."===n?(r=t.tokenize(e,t),n=e.current(),!r||"variable"!==r.substr(0,8)&&"builtin"!==r&&"keyword"!==r?l:(("builtin"===r||"keyword"===r)&&(r="variable"),L.indexOf(n.substr(1))>-1&&(r="variable-2"),r)):r}var l="error",c=new RegExp("^[\\+\\-\\*/&\\\\\\^<>=]"),u=new RegExp("^((<>)|(<=)|(>=))"),d=new RegExp("^[\\.,]"),f=new RegExp("^[\\(\\)]"),m=new RegExp("^[A-Za-z][_A-Za-z0-9]*"),h=["class","sub","select","while","if","function","property","with","for"],p=["else","elseif","case"],g=["next","loop","wend"],v=r(["and","or","not","xor","is","mod","eqv","imp"]),b=["dim","redim","then","until","randomize","byval","byref","new","property","exit","in","const","private","public","get","set","let","stop","on error resume next","on error goto 0","option explicit","call","me"],y=["true","false","nothing","empty","null"],x=["abs","array","asc","atn","cbool","cbyte","ccur","cdate","cdbl","chr","cint","clng","cos","csng","cstr","date","dateadd","datediff","datepart","dateserial","datevalue","day","escape","eval","execute","exp","filter","formatcurrency","formatdatetime","formatnumber","formatpercent","getlocale","getobject","getref","hex","hour","inputbox","instr","instrrev","int","fix","isarray","isdate","isempty","isnull","isnumeric","isobject","join","lbound","lcase","left","len","loadpicture","log","ltrim","rtrim","trim","maths","mid","minute","month","monthname","msgbox","now","oct","replace","rgb","right","rnd","round","scriptengine","scriptenginebuildversion","scriptenginemajorversion","scriptengineminorversion","second","setlocale","sgn","sin","space","split","sqr","strcomp","string","strreverse","tan","time","timer","timeserial","timevalue","typename","ubound","ucase","unescape","vartype","weekday","weekdayname","year"],k=["vbBlack","vbRed","vbGreen","vbYellow","vbBlue","vbMagenta","vbCyan","vbWhite","vbBinaryCompare","vbTextCompare","vbSunday","vbMonday","vbTuesday","vbWednesday","vbThursday","vbFriday","vbSaturday","vbUseSystemDayOfWeek","vbFirstJan1","vbFirstFourDays","vbFirstFullWeek","vbGeneralDate","vbLongDate","vbShortDate","vbLongTime","vbShortTime","vbObjectError","vbOKOnly","vbOKCancel","vbAbortRetryIgnore","vbYesNoCancel","vbYesNo","vbRetryCancel","vbCritical","vbQuestion","vbExclamation","vbInformation","vbDefaultButton1","vbDefaultButton2","vbDefaultButton3","vbDefaultButton4","vbApplicationModal","vbSystemModal","vbOK","vbCancel","vbAbort","vbRetry","vbIgnore","vbYes","vbNo","vbCr","VbCrLf","vbFormFeed","vbLf","vbNewLine","vbNullChar","vbNullString","vbTab","vbVerticalTab","vbUseDefault","vbTrue","vbFalse","vbEmpty","vbNull","vbInteger","vbLong","vbSingle","vbDouble","vbCurrency","vbDate","vbString","vbObject","vbError","vbBoolean","vbVariant","vbDataObject","vbDecimal","vbByte","vbArray"],w=["WScript","err","debug","RegExp"],_=["description","firstindex","global","helpcontext","helpfile","ignorecase","length","number","pattern","source","value","count"],C=["clear","execute","raise","replace","test","write","writeline","close","open","state","eof","update","addnew","end","createobject","quit"],S=["server","response","request","session","application"],T=["buffer","cachecontrol","charset","contenttype","expires","expiresabsolute","isclientconnected","pics","status","clientcertificate","cookies","form","querystring","servervariables","totalbytes","contents","staticobjects","codepage","lcid","sessionid","timeout","scripttimeout"],M=["addheader","appendtolog","binarywrite","end","flush","redirect","binaryread","remove","removeall","lock","unlock","abandon","getlasterror","htmlencode","mappath","transfer","urlencode"],L=C.concat(_);w=w.concat(k),e.isASP&&(w=w.concat(S),L=L.concat(M,T));var E=r(b),q=r(y),j=r(x),z=r(w),I=r(L),P='"',D=r(h),A=r(p),$=r(g),O=r(["end"]),R=r(["do"]),F=r(["on error resume next","exit"]),H=r(["rem"]),N={electricChars:"dDpPtTfFeE ",startState:function(){return{tokenize:o,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1,ignoreKeyword:!1}},token:function(e,t){e.sol()&&(t.currentIndent+=t.nextLineIndent,t.nextLineIndent=0,t.doInCurrentLine=0);var r=s(e,t);return t.lastToken={style:r,content:e.current()},"space"===r&&(r=null),r},indent:function(t,r){var n=r.replace(/^\s+|\s+$/g,"");return n.match($)||n.match(O)||n.match(A)?e.indentUnit*(t.currentIndent-1):t.currentIndent<0?0:t.currentIndent*e.indentUnit}};return N}),e.defineMIME("text/vbscript","vbscript")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("velocity",function(){function e(e){for(var t={},r=e.split(" "),n=0;nf.length&&"."==e.string.charAt(e.pos-f.length-1)&&r.lastTokenWasBuiltin?"builtin":(r.lastTokenWasBuiltin=!1,null)}return r.lastTokenWasBuiltin=!1,r.inString?(r.inString=!1,"string"):r.inParams?t(e,r,n(d)):void 0}function n(e){return function(t,n){for(var i,o=!1,a=!1;null!=(i=t.next());){if(i==e&&!o){a=!0;break}if('"'==e&&"$"==t.peek()&&!o){n.inString=!0,a=!0;break}o=!o&&"\\"==i}return a&&(n.tokenize=r),"string"}}function i(e,t){for(var n,i=!1;n=e.next();){if("#"==n&&i){t.tokenize=r;break}i="*"==n}return"comment"}function o(e,t){for(var n,i=0;n=e.next();){if("#"==n&&2==i){t.tokenize=r;break}"]"==n?i++:" "!=n&&(i=0)}return"meta"}var a=e("#end #else #break #stop #[[ #]] #{end} #{else} #{break} #{stop}"),s=e("#if #elseif #foreach #set #include #parse #macro #define #evaluate #{if} #{elseif} #{foreach} #{set} #{include} #{parse} #{macro} #{define} #{evaluate}"),l=e("$foreach.count $foreach.hasNext $foreach.first $foreach.last $foreach.topmost $foreach.parent.count $foreach.parent.hasNext $foreach.parent.first $foreach.parent.last $foreach.parent $velocityCount $!bodyContent $bodyContent"),c=/[+\-*&%=<>!?:\/|]/;return{startState:function(){return{tokenize:r,beforeParams:!1,inParams:!1,inString:!1,lastTokenWasBuiltin:!1}},token:function(e,t){return e.eatSpace()?null:t.tokenize(e,t)},blockCommentStart:"#*",blockCommentEnd:"*#",lineComment:"##",fold:"velocity"}}),e.defineMIME("text/velocity","velocity")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("xquery",function(){function e(e,t,r){return y=e,x=r,t}function t(e,t,r){return t.tokenize=r,r(e,t)}function r(r,s){var f=r.next(),h=!1,g=p(r);if("<"==f){if(r.match("!--",!0))return t(r,s,l);if(r.match("![CDATA",!1))return s.tokenize=c,e("tag","tag");if(r.match("?",!1))return t(r,s,u);var y=r.eat("/");r.eatSpace();for(var x,w="";x=r.eat(/[^\s\u00a0=<>\"\'\/?]/);)w+=x;return t(r,s,a(w,y))}if("{"==f)return v(s,{type:"codeblock"}),e("",null);if("}"==f)return b(s),e("",null);if(d(s))return">"==f?e("tag","tag"):"/"==f&&r.eat(">")?(b(s),e("tag","tag")):e("word","variable");if(/\d/.test(f))return r.match(/^\d*(?:\.\d*)?(?:E[+\-]?\d+)?/),e("number","atom");if("("===f&&r.eat(":"))return v(s,{type:"comment"}),t(r,s,n);if(g||'"'!==f&&"'"!==f){if("$"===f)return t(r,s,o);if(":"===f&&r.eat("="))return e("operator","keyword");if("("===f)return v(s,{type:"paren"}),e("",null);if(")"===f)return b(s),e("",null);if("["===f)return v(s,{type:"bracket"}),e("",null);if("]"===f)return b(s),e("",null);var _=k.propertyIsEnumerable(f)&&k[f];if(g&&'"'===f)for(;'"'!==r.next(););if(g&&"'"===f)for(;"'"!==r.next(););_||r.eatWhile(/[\w\$_-]/);var C=r.eat(":");!r.eat(":")&&C&&r.eatWhile(/[\w\$_-]/),r.match(/^[ \t]*\(/,!1)&&(h=!0);var S=r.current();return _=k.propertyIsEnumerable(S)&&k[S],h&&!_&&(_={type:"function_call",style:"variable def"}),m(s)?(b(s),e("word","variable",S)):(("element"==S||"attribute"==S||"axis_specifier"==_.type)&&v(s,{type:"xmlconstructor"}),_?e(_.type,_.style,S):e("word","variable",S))}return t(r,s,i(f))}function n(t,r){for(var n,i=!1,o=!1,a=0;n=t.next();){if(")"==n&&i){if(!(a>0)){b(r);break}a--}else":"==n&&o&&a++;i=":"==n,o="("==n}return e("comment","comment")}function i(t,n){return function(o,a){var s;if(h(a)&&o.current()==t)return b(a),n&&(a.tokenize=n),e("string","string");if(v(a,{type:"string",name:t,tokenize:i(t,n)}),o.match("{",!1)&&f(a))return a.tokenize=r,e("string","string");for(;s=o.next();){if(s==t){b(a),n&&(a.tokenize=n);break}if(o.match("{",!1)&&f(a))return a.tokenize=r,e("string","string")}return e("string","string")}}function o(t,n){var i=/[\w\$_-]/;if(t.eat('"')){for(;'"'!==t.next(););t.eat(":")}else t.eatWhile(i),t.match(":=",!1)||t.eat(":");return t.eatWhile(i),n.tokenize=r,e("variable","variable")}function a(t,n){return function(i,o){return i.eatSpace(),n&&i.eat(">")?(b(o),o.tokenize=r,e("tag","tag")):(i.eat("/")||v(o,{type:"tag",name:t,tokenize:r}),i.eat(">")?(o.tokenize=r,e("tag","tag")):(o.tokenize=s,e("tag","tag")))}}function s(n,o){var a=n.next();return"/"==a&&n.eat(">")?(f(o)&&b(o),d(o)&&b(o),e("tag","tag")):">"==a?(f(o)&&b(o),e("tag","tag")):"="==a?e("",null):'"'==a||"'"==a?t(n,o,i(a,s)):(f(o)||v(o,{type:"attribute",tokenize:s}),n.eat(/[a-zA-Z_:]/),n.eatWhile(/[-a-zA-Z0-9_:.]/),n.eatSpace(),(n.match(">",!1)||n.match("/",!1))&&(b(o),o.tokenize=r),e("attribute","attribute"))}function l(t,n){for(var i;i=t.next();)if("-"==i&&t.match("->",!0))return n.tokenize=r,e("comment","comment")}function c(t,n){for(var i;i=t.next();)if("]"==i&&t.match("]",!0))return n.tokenize=r,e("comment","comment")}function u(t,n){for(var i;i=t.next();)if("?"==i&&t.match(">",!0))return n.tokenize=r,e("comment","comment meta")}function d(e){return g(e,"tag")}function f(e){return g(e,"attribute")}function m(e){return g(e,"xmlconstructor")}function h(e){return g(e,"string")}function p(e){return'"'===e.current()?e.match(/^[^\"]+\"\:/,!1):"'"===e.current()?e.match(/^[^\"]+\'\:/,!1):!1}function g(e,t){return e.stack.length&&e.stack[e.stack.length-1].type==t}function v(e,t){e.stack.push(t)}function b(e){e.stack.pop();var t=e.stack.length&&e.stack[e.stack.length-1].tokenize;e.tokenize=t||r}var y,x,k=function(){function e(e){return{type:e,style:"keyword"}}for(var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),i=e("operator"),o={type:"atom",style:"atom"},a={type:"punctuation",style:null},s={type:"axis_specifier",style:"qualifier"},l={"if":t,"switch":t,"while":t,"for":t,"else":r,then:r,"try":r,"finally":r,"catch":r,element:n,attribute:n,let:n,"implements":n,"import":n,module:n,namespace:n,"return":n,"super":n,"this":n,"throws":n,where:n,"private":n,",":a,"null":o,"fn:false()":o,"fn:true()":o},c=["after","ancestor","ancestor-or-self","and","as","ascending","assert","attribute","before","by","case","cast","child","comment","declare","default","define","descendant","descendant-or-self","descending","document","document-node","element","else","eq","every","except","external","following","following-sibling","follows","for","function","if","import","in","instance","intersect","item","let","module","namespace","node","node","of","only","or","order","parent","precedes","preceding","preceding-sibling","processing-instruction","ref","return","returns","satisfies","schema","schema-element","self","some","sortby","stable","text","then","to","treat","typeswitch","union","variable","version","where","xquery","empty-sequence"],u=0,d=c.length;d>u;u++)l[c[u]]=e(c[u]);for(var f=["xs:string","xs:float","xs:decimal","xs:double","xs:integer","xs:boolean","xs:date","xs:dateTime","xs:time","xs:duration","xs:dayTimeDuration","xs:time","xs:yearMonthDuration","numeric","xs:hexBinary","xs:base64Binary","xs:anyURI","xs:QName","xs:byte","xs:boolean","xs:anyURI","xf:yearMonthDuration"],u=0,d=f.length;d>u;u++)l[f[u]]=o;for(var m=["eq","ne","lt","le","gt","ge",":=","=",">",">=","<","<=",".","|","?","and","or","div","idiv","mod","*","/","+","-"],u=0,d=m.length;d>u;u++)l[m[u]]=i;for(var h=["self::","attribute::","child::","descendant::","descendant-or-self::","parent::","ancestor::","ancestor-or-self::","following::","preceding::","following-sibling::","preceding-sibling::"],u=0,d=h.length;d>u;u++)l[h[u]]=s;return l}();return{startState:function(){return{tokenize:r,cc:[],stack:[]}},token:function(e,t){if(e.eatSpace())return null;var r=t.tokenize(e,t);return r},blockCommentStart:"(:",blockCommentEnd:":)"}}),e.defineMIME("application/xquery","xquery")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("yaml",function(){var e=["true","false","on","off","yes","no"],t=new RegExp("\\b(("+e.join(")|(")+"))$","i");return{token:function(e,r){var n=e.peek(),i=r.escaped;if(r.escaped=!1,"#"==n&&(0==e.pos||/\s/.test(e.string.charAt(e.pos-1))))return e.skipToEnd(),"comment";if(e.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(r.literal&&e.indentation()>r.keyCol)return e.skipToEnd(),"string";if(r.literal&&(r.literal=!1),e.sol()){if(r.keyCol=0,r.pair=!1,r.pairStart=!1,e.match(/---/))return"def";if(e.match(/\.\.\./))return"def";if(e.match(/\s*-\s+/))return"meta"}if(e.match(/^(\{|\}|\[|\])/))return"{"==n?r.inlinePairs++:"}"==n?r.inlinePairs--:"["==n?r.inlineList++:r.inlineList--,"meta";if(r.inlineList>0&&!i&&","==n)return e.next(),"meta";if(r.inlinePairs>0&&!i&&","==n)return r.keyCol=0,r.pair=!1,r.pairStart=!1,e.next(),"meta";if(r.pairStart){if(e.match(/^\s*(\||\>)\s*/))return r.literal=!0,"meta";if(e.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(0==r.inlinePairs&&e.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(r.inlinePairs>0&&e.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(e.match(t))return"keyword"}return!r.pair&&e.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(r.pair=!0,r.keyCol=e.indentation(),"atom"):r.pair&&e.match(/^:\s*/)?(r.pairStart=!0,"meta"):(r.pairStart=!1,r.escaped="\\"==n,e.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}}}}),e.defineMIME("text/x-yaml","yaml")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMIME("text/x-erlang","erlang"),e.defineMode("erlang",function(t){function r(e,t){if(t.in_string)return t.in_string=!o(e),u(t,e,"string");if(t.in_atom)return t.in_atom=!a(e),u(t,e,"atom");if(e.eatSpace())return u(t,e,"whitespace");if(!h(t)&&e.match(/-\s*[a-zß-öø-ÿ][\wØ-ÞÀ-Öß-öø-ÿ]*/))return c(e.current(),T)?u(t,e,"type"):u(t,e,"attribute");var r=e.next();if("%"==r)return e.skipToEnd(),u(t,e,"comment");if(":"==r)return u(t,e,"colon");if("?"==r)return e.eatSpace(),e.eatWhile(R),u(t,e,"macro");if("#"==r)return e.eatSpace(),e.eatWhile(R),u(t,e,"record");if("$"==r)return"\\"!=e.next()||e.match(F)?u(t,e,"number"):u(t,e,"error");if("."==r)return u(t,e,"dot");if("'"==r){if(!(t.in_atom=!a(e))){if(e.match(/\s*\/\s*[0-9]/,!1))return e.match(/\s*\/\s*[0-9]/,!0),u(t,e,"fun");if(e.match(/\s*\(/,!1)||e.match(/\s*:/,!1))return u(t,e,"function")}return u(t,e,"atom")}if('"'==r)return t.in_string=!o(e),u(t,e,"string");if(/[A-Z_Ø-ÞÀ-Ö]/.test(r))return e.eatWhile(R),u(t,e,"variable");if(/[a-z_ß-öø-ÿ]/.test(r)){if(e.eatWhile(R),e.match(/\s*\/\s*[0-9]/,!1))return e.match(/\s*\/\s*[0-9]/,!0),u(t,e,"fun");var s=e.current();return c(s,M)?u(t,e,"keyword"):c(s,q)?u(t,e,"operator"):e.match(/\s*\(/,!1)?!c(s,O)||":"==h(t).token&&"erlang"!=h(t,2).token?c(s,$)?u(t,e,"guard"):u(t,e,"function"):u(t,e,"builtin"):c(s,q)?u(t,e,"operator"):":"==l(e)?"erlang"==s?u(t,e,"builtin"):u(t,e,"function"):c(s,["true","false"])?u(t,e,"boolean"):c(s,["true","false"])?u(t,e,"boolean"):u(t,e,"atom")}var d=/[0-9]/,f=/[0-9a-zA-Z]/;return d.test(r)?(e.eatWhile(d),e.eat("#")?e.eatWhile(f)||e.backUp(1):e.eat(".")&&(e.eatWhile(d)?e.eat(/[eE]/)&&(e.eat(/[-+]/)?e.eatWhile(d)||e.backUp(2):e.eatWhile(d)||e.backUp(1)):e.backUp(1)),u(t,e,"number")):n(e,I,P)?u(t,e,"open_paren"):n(e,D,A)?u(t,e,"close_paren"):i(e,L,E)?u(t,e,"separator"):i(e,j,z)?u(t,e,"operator"):u(t,e,null)}function n(e,t,r){if(1==e.current().length&&t.test(e.current())){for(e.backUp(1);t.test(e.peek());)if(e.next(),c(e.current(),r))return!0;e.backUp(e.current().length-1)}return!1}function i(e,t,r){if(1==e.current().length&&t.test(e.current())){for(;t.test(e.peek());)e.next();for(;0r?!1:e.tokenStack[r-n]}function p(e,t){"comment"!=t.type&&"whitespace"!=t.type&&(e.tokenStack=g(e.tokenStack,t),e.tokenStack=v(e.tokenStack))}function g(e,t){var r=e.length-1;return r>0&&"record"===e[r].type&&"dot"===t.type?e.pop():r>0&&"group"===e[r].type?(e.pop(),e.push(t)):e.push(t),e}function v(e){var t=e.length-1;if("dot"===e[t].type)return[];if("fun"===e[t].type&&"fun"===e[t-1].token)return e.slice(0,t-1);switch(e[e.length-1].token){case"}":return b(e,{g:["{"]});case"]":return b(e,{i:["["]});case")":return b(e,{i:["("]});case">>":return b(e,{i:["<<"]});case"end":return b(e,{i:["begin","case","fun","if","receive","try"]});case",":return b(e,{e:["begin","try","when","->",",","(","[","{","<<"]});case"->":return b(e,{r:["when"],m:["try","if","case","receive"]});case";":return b(e,{E:["case","fun","if","receive","try","when"]});case"catch":return b(e,{e:["try"]});case"of":return b(e,{e:["case"]});case"after":return b(e,{e:["receive","try"]});default:return e}}function b(e,t){for(var r in t)for(var n=e.length-1,i=t[r],o=n-1;o>-1;o--)if(c(e[o].token,i)){var a=e.slice(0,o);switch(r){case"m":return a.concat(e[o]).concat(e[n]);case"r":return a.concat(e[n]);case"i":return a;case"g":return a.concat(m("group"));case"E":return a.concat(e[o]);case"e":return a.concat(e[o])}}return"E"==r?[]:e}function y(r,n){var i,o=t.indentUnit,a=x(n),s=h(r,1),l=h(r,2);return r.in_string||r.in_atom?e.Pass:l?"when"==s.token?s.column+o:"when"===a&&"function"===l.type?l.indent+o:"("===a&&"fun"===s.token?s.column+3:"catch"===a&&(i=_(r,["try"]))?i.column:c(a,["end","after","of"])?(i=_(r,["begin","case","fun","if","receive","try"]),i?i.column:e.Pass):c(a,A)?(i=_(r,P),i?i.column:e.Pass):c(s.token,[",","|","||"])||c(a,[",","|","||"])?(i=k(r),i?i.column+i.token.length:o):"->"==s.token?c(l.token,["receive","case","if","try"])?l.column+o+o:l.column+o:c(s.token,P)?s.column+s.token.length:(i=w(r),S(i)?i.column+o:0):0}function x(e){var t=e.match(/,|[a-z]+|\}|\]|\)|>>|\|+|\(/);return S(t)&&0===t.index?t[0]:""}function k(e){var t=e.tokenStack.slice(0,-1),r=C(t,"type",["open_paren"]);return S(t[r])?t[r]:!1}function w(e){var t=e.tokenStack,r=C(t,"type",["open_paren","separator","keyword"]),n=C(t,"type",["operator"]);return S(r)&&S(n)&&n>r?t[r+1]:S(r)?t[r]:!1}function _(e,t){var r=e.tokenStack,n=C(r,"token",t); - -return S(r[n])?r[n]:!1}function C(e,t,r){for(var n=e.length-1;n>-1;n--)if(c(e[n][t],r))return n;return!1}function S(e){return e!==!1&&null!=e}var T=["-type","-spec","-export_type","-opaque"],M=["after","begin","catch","case","cond","end","fun","if","let","of","query","receive","try","when"],L=/[\->,;]/,E=["->",";",","],q=["and","andalso","band","bnot","bor","bsl","bsr","bxor","div","not","or","orelse","rem","xor"],j=/[\+\-\*\/<>=\|:!]/,z=["=","+","-","*","/",">",">=","<","=<","=:=","==","=/=","/=","||","<-","!"],I=/[<\(\[\{]/,P=["<<","(","[","{"],D=/[>\)\]\}]/,A=["}","]",")",">>"],$=["is_atom","is_binary","is_bitstring","is_boolean","is_float","is_function","is_integer","is_list","is_number","is_pid","is_port","is_record","is_reference","is_tuple","atom","binary","bitstring","boolean","function","integer","list","number","pid","port","record","reference","tuple"],O=["abs","adler32","adler32_combine","alive","apply","atom_to_binary","atom_to_list","binary_to_atom","binary_to_existing_atom","binary_to_list","binary_to_term","bit_size","bitstring_to_list","byte_size","check_process_code","contact_binary","crc32","crc32_combine","date","decode_packet","delete_module","disconnect_node","element","erase","exit","float","float_to_list","garbage_collect","get","get_keys","group_leader","halt","hd","integer_to_list","internal_bif","iolist_size","iolist_to_binary","is_alive","is_atom","is_binary","is_bitstring","is_boolean","is_float","is_function","is_integer","is_list","is_number","is_pid","is_port","is_process_alive","is_record","is_reference","is_tuple","length","link","list_to_atom","list_to_binary","list_to_bitstring","list_to_existing_atom","list_to_float","list_to_integer","list_to_pid","list_to_tuple","load_module","make_ref","module_loaded","monitor_node","node","node_link","node_unlink","nodes","notalive","now","open_port","pid_to_list","port_close","port_command","port_connect","port_control","pre_loaded","process_flag","process_info","processes","purge_module","put","register","registered","round","self","setelement","size","spawn","spawn_link","spawn_monitor","spawn_opt","split_binary","statistics","term_to_binary","time","throw","tl","trunc","tuple_size","tuple_to_list","unlink","unregister","whereis"],R=/[\w@Ø-ÞÀ-Öß-öø-ÿ]/,F=/[0-7]{1,3}|[bdefnrstv\\"']|\^[a-zA-Z]|x[0-9a-zA-Z]{2}|x{[0-9a-zA-Z]+}/;return{startState:function(){return{tokenStack:[],in_string:!1,in_atom:!1}},token:function(e,t){return r(e,t)},indent:function(e,t){return y(e,t)},lineComment:"%"}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../javascript/javascript"),require("../css/css"),require("../htmlmixed/htmlmixed")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../javascript/javascript","../css/css","../htmlmixed/htmlmixed"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("jade",function(t){function r(){this.javaScriptLine=!1,this.javaScriptLineExcludesColon=!1,this.javaScriptArguments=!1,this.javaScriptArgumentsDepth=0,this.isInterpolating=!1,this.interpolationNesting=0,this.jsState=Q.startState(),this.restOfLine="",this.isIncludeFiltered=!1,this.isEach=!1,this.lastTag="",this.scriptType="",this.isAttrs=!1,this.attrsNest=[],this.inAttributeName=!0,this.attributeIsType=!1,this.attrValue="",this.indentOf=1/0,this.indentToken="",this.innerMode=null,this.innerState=null,this.innerModeForLine=!1}function n(e,t){if(e.sol()&&(t.javaScriptLine=!1,t.javaScriptLineExcludesColon=!1),t.javaScriptLine){if(t.javaScriptLineExcludesColon&&":"===e.peek())return t.javaScriptLine=!1,void(t.javaScriptLineExcludesColon=!1);var r=Q.token(e,t.jsState);return e.eol()&&(t.javaScriptLine=!1),r||!0}}function i(e,t){if(t.javaScriptArguments){if(0===t.javaScriptArgumentsDepth&&"("!==e.peek())return void(t.javaScriptArguments=!1);if("("===e.peek()?t.javaScriptArgumentsDepth++:")"===e.peek()&&t.javaScriptArgumentsDepth--,0===t.javaScriptArgumentsDepth)return void(t.javaScriptArguments=!1);var r=Q.token(e,t.jsState);return r||!0}}function o(e){return e.match(/^yield\b/)?"keyword":void 0}function a(e){return e.match(/^(?:doctype) *([^\n]+)?/)?K:void 0}function s(e,t){return e.match("#{")?(t.isInterpolating=!0,t.interpolationNesting=0,"punctuation"):void 0}function l(e,t){if(t.isInterpolating){if("}"===e.peek()){if(t.interpolationNesting--,t.interpolationNesting<0)return e.next(),t.isInterpolating=!1,"puncutation"}else"{"===e.peek()&&t.interpolationNesting++;return Q.token(e,t.jsState)||!0}}function c(e,t){return e.match(/^case\b/)?(t.javaScriptLine=!0,V):void 0}function u(e,t){return e.match(/^when\b/)?(t.javaScriptLine=!0,t.javaScriptLineExcludesColon=!0,V):void 0}function d(e){return e.match(/^default\b/)?V:void 0}function f(e,t){return e.match(/^extends?\b/)?(t.restOfLine="string",V):void 0}function m(e,t){return e.match(/^append\b/)?(t.restOfLine="variable",V):void 0}function h(e,t){return e.match(/^prepend\b/)?(t.restOfLine="variable",V):void 0}function p(e,t){return e.match(/^block\b *(?:(prepend|append)\b)?/)?(t.restOfLine="variable",V):void 0}function g(e,t){return e.match(/^include\b/)?(t.restOfLine="string",V):void 0}function v(e,t){return e.match(/^include:([a-zA-Z0-9\-]+)/,!1)&&e.match("include")?(t.isIncludeFiltered=!0,V):void 0}function b(e,t){if(t.isIncludeFiltered){var r=M(e,t);return t.isIncludeFiltered=!1,t.restOfLine="string",r}}function y(e,t){return e.match(/^mixin\b/)?(t.javaScriptLine=!0,V):void 0}function x(e,t){return e.match(/^\+([-\w]+)/)?(e.match(/^\( *[-\w]+ *=/,!1)||(t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0),"variable"):e.match(/^\+#{/,!1)?(e.next(),t.mixinCallAfter=!0,s(e,t)):void 0}function k(e,t){return t.mixinCallAfter?(t.mixinCallAfter=!1,e.match(/^\( *[-\w]+ *=/,!1)||(t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0),!0):void 0}function w(e,t){return e.match(/^(if|unless|else if|else)\b/)?(t.javaScriptLine=!0,V):void 0}function _(e,t){return e.match(/^(- *)?(each|for)\b/)?(t.isEach=!0,V):void 0}function C(e,t){if(t.isEach){if(e.match(/^ in\b/))return t.javaScriptLine=!0,t.isEach=!1,V;if(e.sol()||e.eol())t.isEach=!1;else if(e.next()){for(;!e.match(/^ in\b/,!1)&&e.next(););return"variable"}}}function S(e,t){return e.match(/^while\b/)?(t.javaScriptLine=!0,V):void 0}function T(e,t){var r;return(r=e.match(/^(\w(?:[-:\w]*\w)?)\/?/))?(t.lastTag=r[1].toLowerCase(),"script"===t.lastTag&&(t.scriptType="application/javascript"),"tag"):void 0}function M(r,n){if(r.match(/^:([\w\-]+)/)){var i;return t&&t.innerModes&&(i=t.innerModes(r.current().substring(1))),i||(i=r.current().substring(1)),"string"==typeof i&&(i=e.getMode(t,i)),F(r,n,i),"atom"}}function L(e,t){return e.match(/^(!?=|-)/)?(t.javaScriptLine=!0,"punctuation"):void 0}function E(e){return e.match(/^#([\w-]+)/)?Z:void 0}function q(e){return e.match(/^\.([\w-]+)/)?G:void 0}function j(e,t){return"("==e.peek()?(e.next(),t.isAttrs=!0,t.attrsNest=[],t.inAttributeName=!0,t.attrValue="",t.attributeIsType=!1,"punctuation"):void 0}function z(e,t){if(t.isAttrs){if(X[e.peek()]&&t.attrsNest.push(X[e.peek()]),t.attrsNest[t.attrsNest.length-1]===e.peek())t.attrsNest.pop();else if(e.eat(")"))return t.isAttrs=!1,"punctuation";if(t.inAttributeName&&e.match(/^[^=,\)!]+/))return("="===e.peek()||"!"===e.peek())&&(t.inAttributeName=!1,t.jsState=Q.startState(),"script"===t.lastTag&&"type"===e.current().trim().toLowerCase()?t.attributeIsType=!0:t.attributeIsType=!1),"attribute";var r=Q.token(e,t.jsState);if(t.attributeIsType&&"string"===r&&(t.scriptType=e.current().toString()),0===t.attrsNest.length&&("string"===r||"variable"===r||"keyword"===r))try{return Function("","var x "+t.attrValue.replace(/,\s*$/,"").replace(/^!/,"")),t.inAttributeName=!0,t.attrValue="",e.backUp(e.current().length),z(e,t)}catch(n){}return t.attrValue+=e.current(),r||!0}}function I(e,t){return e.match(/^&attributes\b/)?(t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0,"keyword"):void 0}function P(e){return e.sol()&&e.eatSpace()?"indent":void 0}function D(e,t){return e.match(/^ *\/\/(-)?([^\n]*)/)?(t.indentOf=e.indentation(),t.indentToken="comment","comment"):void 0}function A(e){return e.match(/^: */)?"colon":void 0}function $(e,t){return e.match(/^(?:\| ?| )([^\n]+)/)?"string":e.match(/^(<[^\n]*)/,!1)?(F(e,t,"htmlmixed"),t.innerModeForLine=!0,H(e,t,!0)):void 0}function O(e,t){if(e.eat(".")){var r=null;return"script"===t.lastTag&&-1!=t.scriptType.toLowerCase().indexOf("javascript")?r=t.scriptType.toLowerCase().replace(/"|'/g,""):"style"===t.lastTag&&(r="css"),F(e,t,r),"dot"}}function R(e){return e.next(),null}function F(r,n,i){i=e.mimeModes[i]||i,i=t.innerModes?t.innerModes(i)||i:i,i=e.mimeModes[i]||i,i=e.getMode(t,i),n.indentOf=r.indentation(),i&&"null"!==i.name?n.innerMode=i:n.indentToken="string"}function H(e,t,r){return e.indentation()>t.indentOf||t.innerModeForLine&&!e.sol()||r?t.innerMode?(t.innerState||(t.innerState=t.innerMode.startState?t.innerMode.startState(e.indentation()):{}),e.hideFirstChars(t.indentOf+2,function(){return t.innerMode.token(e,t.innerState)||!0})):(e.skipToEnd(),t.indentToken):void(e.sol()&&(t.indentOf=1/0,t.indentToken=null,t.innerMode=null,t.innerState=null))}function N(e,t){if(e.sol()&&(t.restOfLine=""),t.restOfLine){e.skipToEnd();var r=t.restOfLine;return t.restOfLine="",r}}function B(){return new r}function U(e){return e.copy()}function W(e,t){var r=H(e,t)||N(e,t)||l(e,t)||b(e,t)||C(e,t)||z(e,t)||n(e,t)||i(e,t)||k(e,t)||o(e,t)||a(e,t)||s(e,t)||c(e,t)||u(e,t)||d(e,t)||f(e,t)||m(e,t)||h(e,t)||p(e,t)||g(e,t)||v(e,t)||y(e,t)||x(e,t)||w(e,t)||_(e,t)||S(e,t)||T(e,t)||M(e,t)||L(e,t)||E(e,t)||q(e,t)||j(e,t)||I(e,t)||P(e,t)||$(e,t)||D(e,t)||A(e,t)||O(e,t)||R(e,t);return r===!0?null:r}var V="keyword",K="meta",Z="builtin",G="qualifier",X={"{":"}","(":")","[":"]"},Q=e.getMode(t,"javascript");return r.prototype.copy=function(){var t=new r;return t.javaScriptLine=this.javaScriptLine,t.javaScriptLineExcludesColon=this.javaScriptLineExcludesColon,t.javaScriptArguments=this.javaScriptArguments,t.javaScriptArgumentsDepth=this.javaScriptArgumentsDepth,t.isInterpolating=this.isInterpolating,t.interpolationNesting=this.intpolationNesting,t.jsState=e.copyState(Q,this.jsState),t.innerMode=this.innerMode,this.innerMode&&this.innerState&&(t.innerState=e.copyState(this.innerMode,this.innerState)),t.restOfLine=this.restOfLine,t.isIncludeFiltered=this.isIncludeFiltered,t.isEach=this.isEach,t.lastTag=this.lastTag,t.scriptType=this.scriptType,t.isAttrs=this.isAttrs,t.attrsNest=this.attrsNest.slice(),t.inAttributeName=this.inAttributeName,t.attributeIsType=this.attributeIsType,t.attrValue=this.attrValue,t.indentOf=this.indentOf,t.indentToken=this.indentToken,t.innerModeForLine=this.innerModeForLine,t},{startState:B,copyState:U,token:W}}),e.defineMIME("text/x-jade","jade")}); \ No newline at end of file diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/package.json b/src/main/resources/static/editor.md-master/lib/codemirror/package.json deleted file mode 100644 index b4a9b53..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "codemirror", - "version":"5.0.0", - "main": "lib/codemirror.js", - "description": "In-browser code editing made bearable", - "licenses": [{"type": "MIT", - "url": "http://codemirror.net/LICENSE"}], - "directories": {"lib": "./lib"}, - "scripts": {"test": "node ./test/run.js"}, - "devDependencies": {"node-static": "0.6.0", - "phantomjs": "1.9.2-5", - "blint": ">=0.1.1"}, - "bugs": "http://github.com/codemirror/CodeMirror/issues", - "keywords": ["JavaScript", "CodeMirror", "Editor"], - "homepage": "http://codemirror.net", - "maintainers":[{"name": "Marijn Haverbeke", - "email": "marijnh@gmail.com", - "web": "http://marijnhaverbeke.nl"}], - "repository": {"type": "git", - "url": "https://github.com/codemirror/CodeMirror.git"} -} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/3024-day.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/3024-day.css deleted file mode 100644 index 3592816..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/3024-day.css +++ /dev/null @@ -1,40 +0,0 @@ -/* - - Name: 3024 day - Author: Jan T. Sott (http://github.com/idleberg) - - CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) - Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) - -*/ - -.cm-s-3024-day.CodeMirror {background: #f7f7f7; color: #3a3432;} -.cm-s-3024-day div.CodeMirror-selected {background: #d6d5d4 !important;} -.cm-s-3024-day.CodeMirror ::selection { background: #d6d5d4; } -.cm-s-3024-day.CodeMirror ::-moz-selection { background: #d9d9d9; } - -.cm-s-3024-day .CodeMirror-gutters {background: #f7f7f7; border-right: 0px;} -.cm-s-3024-day .CodeMirror-guttermarker { color: #db2d20; } -.cm-s-3024-day .CodeMirror-guttermarker-subtle { color: #807d7c; } -.cm-s-3024-day .CodeMirror-linenumber {color: #807d7c;} - -.cm-s-3024-day .CodeMirror-cursor {border-left: 1px solid #5c5855 !important;} - -.cm-s-3024-day span.cm-comment {color: #cdab53;} -.cm-s-3024-day span.cm-atom {color: #a16a94;} -.cm-s-3024-day span.cm-number {color: #a16a94;} - -.cm-s-3024-day span.cm-property, .cm-s-3024-day span.cm-attribute {color: #01a252;} -.cm-s-3024-day span.cm-keyword {color: #db2d20;} -.cm-s-3024-day span.cm-string {color: #fded02;} - -.cm-s-3024-day span.cm-variable {color: #01a252;} -.cm-s-3024-day span.cm-variable-2 {color: #01a0e4;} -.cm-s-3024-day span.cm-def {color: #e8bbd0;} -.cm-s-3024-day span.cm-bracket {color: #3a3432;} -.cm-s-3024-day span.cm-tag {color: #db2d20;} -.cm-s-3024-day span.cm-link {color: #a16a94;} -.cm-s-3024-day span.cm-error {background: #db2d20; color: #5c5855;} - -.cm-s-3024-day .CodeMirror-activeline-background {background: #e8f2ff !important;} -.cm-s-3024-day .CodeMirror-matchingbracket { text-decoration: underline; color: #a16a94 !important;} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/3024-night.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/3024-night.css deleted file mode 100644 index ccab9d5..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/3024-night.css +++ /dev/null @@ -1,39 +0,0 @@ -/* - - Name: 3024 night - Author: Jan T. Sott (http://github.com/idleberg) - - CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) - Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) - -*/ - -.cm-s-3024-night.CodeMirror {background: #090300; color: #d6d5d4;} -.cm-s-3024-night div.CodeMirror-selected {background: #3a3432 !important;} -.cm-s-3024-night.CodeMirror ::selection { background: rgba(58, 52, 50, .99); } -.cm-s-3024-night.CodeMirror ::-moz-selection { background: rgba(58, 52, 50, .99); } -.cm-s-3024-night .CodeMirror-gutters {background: #090300; border-right: 0px;} -.cm-s-3024-night .CodeMirror-guttermarker { color: #db2d20; } -.cm-s-3024-night .CodeMirror-guttermarker-subtle { color: #5c5855; } -.cm-s-3024-night .CodeMirror-linenumber {color: #5c5855;} - -.cm-s-3024-night .CodeMirror-cursor {border-left: 1px solid #807d7c !important;} - -.cm-s-3024-night span.cm-comment {color: #cdab53;} -.cm-s-3024-night span.cm-atom {color: #a16a94;} -.cm-s-3024-night span.cm-number {color: #a16a94;} - -.cm-s-3024-night span.cm-property, .cm-s-3024-night span.cm-attribute {color: #01a252;} -.cm-s-3024-night span.cm-keyword {color: #db2d20;} -.cm-s-3024-night span.cm-string {color: #fded02;} - -.cm-s-3024-night span.cm-variable {color: #01a252;} -.cm-s-3024-night span.cm-variable-2 {color: #01a0e4;} -.cm-s-3024-night span.cm-def {color: #e8bbd0;} -.cm-s-3024-night span.cm-bracket {color: #d6d5d4;} -.cm-s-3024-night span.cm-tag {color: #db2d20;} -.cm-s-3024-night span.cm-link {color: #a16a94;} -.cm-s-3024-night span.cm-error {background: #db2d20; color: #807d7c;} - -.cm-s-3024-night .CodeMirror-activeline-background {background: #2F2F2F !important;} -.cm-s-3024-night .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/ambiance-mobile.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/ambiance-mobile.css deleted file mode 100644 index 88d332e..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/ambiance-mobile.css +++ /dev/null @@ -1,5 +0,0 @@ -.cm-s-ambiance.CodeMirror { - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; -} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/ambiance.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/ambiance.css deleted file mode 100644 index afcf15a..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/ambiance.css +++ /dev/null @@ -1,75 +0,0 @@ -/* ambiance theme for codemirror */ - -/* Color scheme */ - -.cm-s-ambiance .cm-keyword { color: #cda869; } -.cm-s-ambiance .cm-atom { color: #CF7EA9; } -.cm-s-ambiance .cm-number { color: #78CF8A; } -.cm-s-ambiance .cm-def { color: #aac6e3; } -.cm-s-ambiance .cm-variable { color: #ffb795; } -.cm-s-ambiance .cm-variable-2 { color: #eed1b3; } -.cm-s-ambiance .cm-variable-3 { color: #faded3; } -.cm-s-ambiance .cm-property { color: #eed1b3; } -.cm-s-ambiance .cm-operator {color: #fa8d6a;} -.cm-s-ambiance .cm-comment { color: #555; font-style:italic; } -.cm-s-ambiance .cm-string { color: #8f9d6a; } -.cm-s-ambiance .cm-string-2 { color: #9d937c; } -.cm-s-ambiance .cm-meta { color: #D2A8A1; } -.cm-s-ambiance .cm-qualifier { color: yellow; } -.cm-s-ambiance .cm-builtin { color: #9999cc; } -.cm-s-ambiance .cm-bracket { color: #24C2C7; } -.cm-s-ambiance .cm-tag { color: #fee4ff } -.cm-s-ambiance .cm-attribute { color: #9B859D; } -.cm-s-ambiance .cm-header {color: blue;} -.cm-s-ambiance .cm-quote { color: #24C2C7; } -.cm-s-ambiance .cm-hr { color: pink; } -.cm-s-ambiance .cm-link { color: #F4C20B; } -.cm-s-ambiance .cm-special { color: #FF9D00; } -.cm-s-ambiance .cm-error { color: #AF2018; } - -.cm-s-ambiance .CodeMirror-matchingbracket { color: #0f0; } -.cm-s-ambiance .CodeMirror-nonmatchingbracket { color: #f22; } - -.cm-s-ambiance .CodeMirror-selected { background: rgba(255, 255, 255, 0.15); } -.cm-s-ambiance.CodeMirror-focused .CodeMirror-selected { background: rgba(255, 255, 255, 0.10); } -.cm-s-ambiance.CodeMirror ::selection { background: rgba(255, 255, 255, 0.10); } -.cm-s-ambiance.CodeMirror ::-moz-selection { background: rgba(255, 255, 255, 0.10); } - -/* Editor styling */ - -.cm-s-ambiance.CodeMirror { - line-height: 1.40em; - color: #E6E1DC; - background-color: #202020; - -webkit-box-shadow: inset 0 0 10px black; - -moz-box-shadow: inset 0 0 10px black; - box-shadow: inset 0 0 10px black; -} - -.cm-s-ambiance .CodeMirror-gutters { - background: #3D3D3D; - border-right: 1px solid #4D4D4D; - box-shadow: 0 10px 20px black; -} - -.cm-s-ambiance .CodeMirror-linenumber { - text-shadow: 0px 1px 1px #4d4d4d; - color: #111; - padding: 0 5px; -} - -.cm-s-ambiance .CodeMirror-guttermarker { color: #aaa; } -.cm-s-ambiance .CodeMirror-guttermarker-subtle { color: #111; } - -.cm-s-ambiance .CodeMirror-lines .CodeMirror-cursor { - border-left: 1px solid #7991E8; -} - -.cm-s-ambiance .CodeMirror-activeline-background { - background: none repeat scroll 0% 0% rgba(255, 255, 255, 0.031); -} - -.cm-s-ambiance.CodeMirror, -.cm-s-ambiance .CodeMirror-gutters { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAQAAAAHUWYVAABFFUlEQVQYGbzBCeDVU/74/6fj9HIcx/FRHx9JCFmzMyGRURhLZIkUsoeRfUjS2FNDtr6WkMhO9sm+S8maJfu+Jcsg+/o/c+Z4z/t97/vezy3z+z8ekGlnYICG/o7gdk+wmSHZ1z4pJItqapjoKXWahm8NmV6eOTbWUOp6/6a/XIg6GQqmenJ2lDHyvCFZ2cBDbmtHA043VFhHwXxClWmeYAdLhV00Bd85go8VmaFCkbVkzlQENzfBDZ5gtN7HwF0KDrTwJ0dypSOzpaKCMwQHKTIreYIxlmhXTzTWkVm+LTynZhiSBT3RZQ7aGfjGEd3qyXQ1FDymqbKxpspERQN2MiRjNZlFFQXfCNFm9nM1zpAsoYjmtRTc5ajwuaXc5xrWskT97RaKzAGe5ARHhVUsDbjKklziiX5WROcJwSNCNI+9w1Jwv4Zb2r7lCMZ4oq5C0EdTx+2GzNuKpJ+iFf38JEWkHJn9DNF7mmBDITrWEg0VWL3pHU20tSZnuqWu+R3BtYa8XxV1HO7GyD32UkOpL/yDloINFTmvtId+nmAjxRw40VMwVKiwrKLE4bK5UOVntYwhOcSSXKrJHKPJedocpGjVz/ZMIbnYUPB10/eKCrs5apqpgVmWzBYWpmtKHecJPjaUuEgRDDaU0oZghCJ6zNMQ5ZhDYx05r5v2muQdM0EILtXUsaKiQX9WMEUotagQzFbUNN6NUPC2nm5pxEWGCjMc3GdJHjSU2kORLK/JGSrkfGEIjncU/CYUnOipoYemwj8tST9NsJmB7TUVXtbUtXATJVZXBMvYeTXJfobgJUPmGMP/yFaWonaa6BcFO3nqcIqCozSZoZoSr1g4zJOzuyGnxTEX3lUEJ7WcZgme8ddaWvWJo2AJR9DZU3CUIbhCSG6ybSwN6qtJVnCU2svDTP2ZInOw2cBTrqtQahtNZn9NcJ4l2NaSmSkkP1noZWnVwkLmdUPOwLZEwy2Z3S3R+4rIG9hcbpPXHFVWcQdZkn2FOta3cKWQnNRC5g1LsJah4GCzSVsKnCOY5OAFRTBekyyryeyilhFKva75r4Mc0aWanGEaThcy31s439KKxTzJYY5WTHPU1FtIHjQU3Oip4xlNzj/lBw23dYZVliQa7WAXf4shetcQfatI+jWRDBPmyNeW6A1P5kdDgyYJlba0BIM8BZu1JfrFwItyjcAMR3K0BWOIrtMEXyhyrlVEx3ui5dUBjmB/Q3CXW85R4mBD0s7B+4q5tKUjOlb9qqmhi5AZ6GFIC5HXtOobdYGlVdMVbNJ8toNTFcHxnoL+muBagcctjWnbNMuR00uI7nQESwg5q2qqrKWIfrNUmeQocY6HuyxJV02wj36w00yhpmUFenv4p6fUkZYqLyuinx2RGOjhCXYyJF84oiU00YMOOhhquNdfbOB7gU88pY4xJO8LVdp6/q2voeB4R04vIdhSE40xZObx1HGGJ/ja0LBthFInKaLPPFzuCaYaoj8JjPME8yoyxo6zlBqkiUZYgq00OYMswbWO5NGmq+xhipxHLRW29ARjNKXO0wRnear8XSg4XFPLKEPUS1GqvyLwiuBUoa7zpZ0l5xxFwWmWZC1H5h5FwU8eQ7K+g8UcVY6TMQreVQT/8uQ8Z+ALIXnSEa2pYZQneE9RZbSBNYXfWYJzW/h/4j4Dp1tYVcFIC5019Vyi4ThPqSFCzjGWaHQTBU8q6vrVwgxP9Lkm840imWKpcLCjYTtrKuwvsKSnrvHCXGkSMk9p6lhckfRpIeis+N2PiszT+mFLspyGleUhDwcLrZqmyeylxwjBcKHEapqkmyangyLZRVOijwOtCY5SsG5zL0OwlCJ4y5KznF3EUNDDrinwiyLZRzOXtlBbK5ITHFGLp8Q0R6ab6mS7enI2cFrxOyHvOCFaT1HThS1krjCwqWeurCkk+willhCC+RSZnRXBiZaC5RXRIZYKp2lyfrHwiKPKR0JDzrdU2EFgpidawlFDR6FgXUMNa+g1FY3bUQh2cLCwosRdnuQTS/S+JVrGLeWIvtQUvONJxlqSQYYKpwoN2kaocLjdVsis4Mk80ESF2YpSkzwldjHkjFCUutI/r+EHDU8oCs6yzL3PhWiEooZdFMkymlas4AcI3KmoMMNSQ3tHzjGWCrcJJdYyZC7QFGwjRL9p+MrRkAGWzIaWCn9W0F3TsK01c2ZvQw0byvxuQU0r1lM0qJO7wW0kRIMdDTtXEdzi4VIh+EoIHm0mWtAtpCixlabgn83fKTI7anJe9ST7WIK1DMGpQmYeA58ImV6ezOGOzK2Kgq01pd60cKWiUi9Lievb/0vIDPHQ05Kzt4ddPckQBQtoaurjyHnek/nKzpQLrVgKPjIkh2v4uyezpv+Xoo7fPFXaGFp1vaLKxQ4uUpQQS5VuQs7BCq4xRJv7fwpVvvFEB3j+620haOuocqMhWd6TTPAEx+mdFNGHdranFe95WrWmIvlY4F1Dle2ECgc6cto7SryuqGGGha0tFQ5V53migUKmg6XKAo4qS3mik+0OZpAhOLeZKicacgaYcyx5hypYQE02ZA4xi/pNhOQxR4klNKyqacj+mpxnLTnnGSo85++3ZCZq6lrZkXlGEX3o+C9FieccJbZWVFjC0Yo1FZnJhoYMFoI1hEZ9r6hwg75HwzBNhbZCdJEfJwTPGzJvaKImw1yYX1HDAmpXR+ZJQ/SmgqMNVQb5vgamGwLtt7VwvP7Qk1xpiM5x5Cyv93E06MZmgs0Nya2azIKOYKCGBQQW97RmhKNKF02JZqHEJ4o58qp7X5EcZmc56trXEqzjCBZ1MFGR87Ql2tSTs6CGxS05PTzRQorkbw7aKoKXFDXsYW42VJih/q+FP2BdTzDTwVqOYB13liM50vG7wy28qagyuIXMeQI/Oqq8bcn5wJI50xH00CRntyfpL1T4hydYpoXgNiFzoIUTDZnLNRzh4TBHwbYGDvZkxmlyJloyr6tRihpeUG94GnKtIznREF0tzJG/OOr73JBcrSh1k6WuTprgLU+mnSGnv6Zge0NNz+kTDdH8nuAuTdJDCNb21LCiIuqlYbqGzT3RAoZofQfjFazkqeNWdYaGvYTM001EW2oKPvVk1ldUGSgUtHFwjKM1h9jnFcmy5lChoLNaQMGGDsYbKixlaMBmmsx1QjCfflwTfO/gckW0ruZ3jugKR3R5W9hGUWqCgxuFgsuaCHorotGKzGaeZB9DMsaTnKCpMtwTvOzhYk0rdrArKCqcaWmVk1+F372ur1YkKxgatI8Qfe1gIX9wE9FgS8ESmuABIXnRUbCapcKe+nO7slClSZFzpV/LkLncEb1qiO42fS3R855Su2mCLh62t1SYZZYVmKwIHjREF2uihTzB20JOkz7dkxzYQnK0UOU494wh+VWRc6Un2kpTaVgLDFEkJ/uhzRcI0YKGgpGWOlocBU/a4fKoJ/pEaNV6jip3+Es9VXY078rGnmAdf7t9ylPXS34RBSuYPs1UecZTU78WanhBCHpZ5sAoTz0LGZKjPf9TRypqWEiTvOFglL1fCEY3wY/++rbk7C8bWebA6p6om6PgOL2kp44TFJlVNBXae2rqqdZztOJpT87GQsE9jqCPIe9VReZuQ/CIgacsyZdCpIScSYqcZk8r+nsyCzhyfhOqHGOIvrLknC8wTpFcaYiGC/RU1NRbUeUpocQOnkRpGOrIOcNRx+1uA0UrzhSSt+VyS3SJpnFWkzNDqOFGIWcfR86DnmARTQ1HKIL33ExPiemeOhYSSjzlSUZZuE4TveoJLnBUOFof6KiysCbnAEcZgcUNTDOwkqWu3RWtmGpZwlHhJENdZ3miGz0lJlsKnjbwqSHQjpxnFDlTLLwqJPMZMjd7KrzkSG7VsxXBZE+F8YZkb01Oe00yyRK9psh5SYh29ySPKBo2ylNht7ZkZnsKenjKNJu9PNEyZpaCHv4Kt6RQsLvAVp7M9kIimmCUwGeWqLMmGuIotYMmWNpSahkhZw9FqZsVnKJhsjAHvtHMsTM9fCI06Dx/u3vfUXCqfsKRc4oFY2jMsoo/7DJDwZ1CsIKnJu+J9ldkpmiCxQx1rWjI+T9FwcWWzOuaYH0Hj7klNRVWEQpmaqosakiGNTFHdjS/qnUdmf0NJW5xsL0HhimCCZZSRzmSPTXJQ4aaztAwtZnoabebJ+htCaZ7Cm535ByoqXKbX1WRc4Eh2MkRXWzImVc96Cj4VdOKVxR84VdQsIUM8Psoou2byVHyZFuq7O8otbSQ2UAoeEWTudATLGSpZzVLlXVkPU2Jc+27lsw2jmg5T5VhbeE3BT083K9WsTTkFU/Osi0rC5lRlpwRHUiesNS0sOvmqGML1aRbPAxTJD9ZKtxuob+hhl8cwYGWpJ8nub7t5p6coYbMovZ1BTdaKn1jYD6h4GFDNFyT/Kqe1XCXphXHOKLZmuRSRdBPEfVUXQzJm5YGPGGJdvAEr7hHNdGZnuBvrpciGmopOLf5N0uVMy0FfYToJk90uUCbJupaVpO53UJXR2bVpoU00V2KOo4zMFrBd0Jtz2pa0clT5Q5L8IpQ177mWQejPMEJhuQjS10ref6HHjdEhy1P1EYR7GtO0uSsKJQYLiTnG1rVScj5lyazpqWGl5uBbRWl7m6ixGOOnEsMJR7z8J0n6KMnCdxhiNYQCoZ6CmYLnO8omC3MkW3bktlPmEt/VQQHejL3+dOE5FlPdK/Mq8hZxxJtLyRrepLThYKbLZxkSb5W52vYxNOaOxUF0yxMUPwBTYqCzy01XayYK0sJyWBLqX0MwU5CzoymRzV0EjjeUeLgDpTo6ij42ZAzvD01dHUUTPLU96MdLbBME8nFBn7zJCMtJcZokn8YoqU0FS5WFKyniHobguMcmW8N0XkWZjkyN3hqOMtS08r+/xTBwpZSZ3qiVRX8SzMHHjfUNFjgHEPmY9PL3ykEzxkSre/1ZD6z/NuznuB0RcE1TWTm9zRgfUWVJiG6yrzgmWPXC8EAR4Wxhlad0ZbgQyEz3pG5RVEwwDJH2mgKpjcTiCOzn1lfUWANFbZ2BA8balnEweJC9J0iuaeZoI+ippFCztEKVvckR2iice1JvhVytrQwUAZpgsubCPaU7xUe9vWnaOpaSBEspalykhC9bUlOMpT42ZHca6hyrqKmw/wMR8H5ZmdFoBVJb03O4UL0tSNnvIeRmkrLWqrs78gcrEn2tpcboh0UPOW3UUR9PMk4T4nnNKWmCjlrefhCwxRNztfmIQVdDElvS4m1/WuOujoZCs5XVOjtKPGokJzsYCtFYoWonSPT21DheU/wWhM19FcElwqNGOsp9Q8N/cwXaiND1MmeL1Q5XROtYYgGeFq1aTMsoMmcrKjQrOFQTQ1fmBYhmW6o8Jkjc7iDJRTBIo5kgJD5yMEYA3srCg7VFKwiVJkmRCc5ohGOKhsYMn/XBLdo5taZjlb9YAlGWRimqbCsoY7HFAXLa5I1HPRxMMsQDHFkWtRNniqT9UEeNjcE7RUlrCJ4R2CSJuqlKHWvJXjAUNcITYkenuBRB84TbeepcqTj3zZyFJzgYQdHnqfgI0ddUwS6GqWpsKWhjq9cV0vBAEMN2znq+EBfIWT+pClYw5xsTlJU6GeIBsjGmmANTzJZiIYpgrM0Oa8ZMjd7NP87jxhqGOhJlnQtjuQpB+8aEE00wZFznSJPyHxgH3HkPOsJFvYk8zqCHzTs1BYOa4J3PFU+UVRZxlHDM4YavlNUuMoRveiZA2d7grMNc2g+RbSCEKzmgYsUmWmazFJyoiOZ4KnyhKOGRzWJa0+moyV4TVHDzn51Awtqaphfk/lRQ08FX1iiqxTB/kLwd0VynKfEvI6cd4XMV5bMhZ7gZUWVzYQ6Nm2BYzxJbw3bGthEUUMfgbGeorae6DxHtJoZ6alhZ0+ytiVoK1R4z5PTrOECT/SugseEOlb1MMNR4VRNcJy+V1Hg9ONClSZFZjdHlc6W6FBLdJja2MC5hhpu0DBYEY1TFGwiFAxRRCsYkiM9JRb0JNMVkW6CZYT/2EiTGWmo8k+h4FhDNE7BvppoTSFnmCV5xZKzvcCdDo7VVPnIU+I+Rc68juApC90MwcFCsJ5hDqxgScYKreruyQwTqrzoqDCmhWi4IbhB0Yrt3RGa6GfDv52rKXWhh28dyZaWUvcZeMTBaZoSGyiCtRU5J8iviioHaErs7Jkj61syVzTTgOcUOQ8buFBTYWdL5g3T4qlpe0+wvD63heAXRfCCIed9RbCsp2CiI7raUOYOTU13N8PNHvpaGvayo4a3LLT1lDrVEPT2zLUlheB1R+ZTRfKWJ+dcocLJfi11vyJ51lLqJ0WD7tRwryezjiV5W28uJO9qykzX8JDe2lHl/9oyBwa2UMfOngpXCixvKdXTk3wrsKmiVYdZIqsoWEERjbcUNDuiaQomGoIbFdEHmsyWnuR+IeriKDVLnlawlyNHKwKlSU631PKep8J4Q+ayjkSLKYLhalNHlYvttb6fHm0p6OApsZ4l2VfdqZkjuysy6ysKLlckf1KUutCTs39bmCgEyyoasIWlVaMF7mgmWtBT8Kol5xpH9IGllo8cJdopcvZ2sImlDmMIbtDk3KIpeNiS08lQw11NFPTwVFlPP6pJ2gvRfI7gQUfmNAtf6Gs0wQxDsKGlVBdF8rCa3jzdwMaGHOsItrZk7hAyOzpK9VS06j5F49b0VNGOOfKs3lDToMsMBe9ZWtHFEgxTJLs7qrygKZjUnmCYoeAqeU6jqWuLJup4WghOdvCYJnrSkSzoyRkm5M2StQwVltPkfCAk58tET/CSg+8MUecmotMEnhBKfWBIZsg2ihruMJQaoIm+tkTLKEqspMh00w95gvFCQRtDwTT1gVDDSEVdlwqZfxoQRbK0g+tbiBZxzKlpnpypejdDwTaeOvorMk/IJE10h9CqRe28hhLbe0pMsdSwv4ZbhKivo2BjDWfL8UKJgeavwlwb5KlwhyE4u4XkGE2ytZCznKLCDZZq42VzT8HLCrpruFbIfOIINmh/qCdZ1ZBc65kLHR1Bkyf5zn6pN3SvGKIlFNGplhrO9QSXanLOMQTLCa0YJCRrCZm/CZmrLTm7WzCK4GJDiWUdFeYx1LCFg3NMd0XmCuF3Y5rITLDUsYS9zoHVzwnJoYpSTQoObyEzr4cFBNqYTopoaU/wkyLZ2lPhX/5Y95ulxGTV7KjhWrOZgl8MyUUafjYraNjNU1N3IWcjT5WzWqjwtoarHSUObGYO3GCJZpsBlnJGPd6ZYLyl1GdCA2625IwwJDP8GUKymbzuyPlZlvTUsaUh5zFDhRWFzPKKZLAlWdcQbObgF9tOqOsmB1dqcqYJmWstFbZRRI9poolmqiLnU0POvxScpah2iSL5UJNzgScY5+AuIbpO0YD3NCW+dLMszFSdFCWGqG6eVq2uYVNDdICGD6W7EPRWZEY5gpsE9rUkS3mijzzJnm6UpUFXG1hCUeVoS5WfNcFpblELL2qqrCvMvRfd45oalvKU2tiQ6ePJOVMRXase9iTtLJztPxJKLWpo2CRDcJwn2sWSLKIO1WQWNTCvpVUvOZhgSC40JD0dOctaSqzkCRbXsKlb11Oip6PCJ0IwSJM31j3akRxlP7Rwn6aGaUL0qiLnJkvB3xWZ2+Q1TfCwpQH3G0o92UzmX4o/oJNQMMSQc547wVHhdk+VCw01DFYEnTxzZKAm74QmeNNR1w6WzEhNK15VJzuCdxQ53dRUDws5KvwgBMOEgpcVNe0hZI6RXT1Jd0cyj5nsaEAHgVmGaJIlWdsc5Ui2ElrRR6jrRAttNMEAIWrTDFubkZaok7/AkzfIwfuWVq0jHzuCK4QabtLUMVPB3kJ0oyHTSVFlqMALilJf2Rf8k5aaHtMfayocLBS8L89oKoxpJvnAkDPa0qp5DAUTHKWmCcnthlou8iCKaFFLHWcINd1nyIwXqrSxMNmSs6KmoL2QrKuWtlQ5V0120xQ5vRyZS1rgFkWwhiOwiuQbR0OOVhQM9iS3tiXp4RawRPMp5tDletOOBL95MpM01dZTBM9pkn5qF010rIeHFcFZhmSGpYpTsI6nwhqe5C9ynhlpp5ophuRb6WcJFldkVnVEwwxVfrVkvnWUuNLCg5bgboFHPDlDPDmnK7hUrWiIbjadDclujlZcaokOFup4Ri1kacV6jmrrK1hN9bGwpKEBQ4Q6DvIUXOmo6U5LqQM6EPyiKNjVkPnJkDPNEaxhiFay5ExW1NXVUGqcpYYdPcGiCq7z/TSlbhL4pplWXKd7NZO5QQFrefhRQW/NHOsqcIglc4UhWklR8K0QzbAw08CBDnpbgqXdeD/QUsM4RZXDFBW6WJKe/mFPdH0LtBgiq57wFLzlyQzz82qYx5D5WJP5yVJDW01BfyHnS6HKO/reZqId1WGa4Hkh2kWodJ8i6KoIPlAj2hPt76CzXsVR6koPRzWTfKqIentatYpQw2me4AA3y1Kind3SwoOKZDcFXTwl9tWU6mfgRk9d71sKtlNwrjnYw5tC5n5LdKiGry3JKNlHEd3oaMCFHrazBPMp/uNJ+V7IudcSbeOIdjUEdwl0VHCOZo5t6YluEuaC9mQeMgSfOyKnYGFHcIeQ84yQWbuJYJpZw5CzglDH7gKnWqqM9ZTaXcN0TeYhR84eQtJT76JJ1lREe7WnnvsMmRc9FQ7SBBM9mV3lCUdmHk/S2RAMt0QjFNFqQpWjDPQ01DXWUdDBkXziKPjGEP3VP+zIWU2t7im41FOloyWzn/L6dkUy3VLDaZ6appgDLHPjJEsyvJngWEPUyVBiAaHCTEXwrLvSEbV1e1gKJniicWorC1MUrVjB3uDhJE/wgSOzk1DXpk0k73qCM8xw2UvD5kJmDUfOomqMpWCkJRlvKXGmoeBm18USjVIk04SClxTB6YrgLAPLWYK9HLUt5cmc0vYES8GnTeRc6skZbQkWdxRsIcyBRzx1DbTk9FbU0caTPOgJHhJKnOGIVhQqvKmo0llRw9sabrZkDtdg3PqaKi9oatjY8B+G371paMg6+mZFNNtQ04mWBq3rYLOmtWWQp8KJnpy9DdFensyjdqZ+yY40VJlH8wcdLzC8PZnvHMFUTZUrDTkLyQaGus5X5LzpYAf3i+e/ZlhqGqWhh6Ou6xTR9Z6oi5AZZtp7Mj2EEm8oSpxiYZCHU/1fbGdNNNRRoZMhmilEb2gqHOEJDtXkHK/JnG6IrvbPCwV3NhONVdS1thBMs1T4QOBcTWa2IzhMk2nW5Kyn9tXUtpv9RsG2msxk+ZsQzRQacJncpgke0+T8y5Fzj8BiGo7XlJjaTIlpQs7KFjpqGnKuoyEPeIKnFMkZHvopgh81ySxNFWvJWcKRs70j2FOT012IllEEO1n4pD1513Yg2ssQPOThOkvyrqHUdEXOSEsihmBbTbKX1kLBPWqWkLOqJbjB3GBIZmoa8qWl4CG/iZ7oiA72ZL7TJNeZUY7kFQftDcHHluBzRbCegzMtrRjVQpX2lgoPKKLJAkcbMl01XK2p7yhL8pCBbQ3BN2avJgKvttcrWDK3CiUOVxQ8ZP+pqXKyIxnmBymCg5vJjNfkPK4+c8cIfK8ocVt7kmfd/I5SR1hKvCzUtb+lhgc00ZaO6CyhIQP1Uv4yIZjload72PXX0OIJvnFU+0Zf6MhsJwTfW0r0UwQfW4LNLZl5HK261JCZ4qnBaAreVAS3WrjV0LBnNDUNNDToCEeFfwgcb4gOEqLRhirWkexrCEYKVV711DLYEE1XBEsp5tpTGjorkomKYF9FDXv7fR3BGwbettSxnyL53MBPjsxDZjMh+VUW9NRxq1DhVk+FSxQcaGjV9Pawv6eGByw5qzoy7xk4RsOShqjJwWKe/1pEEfzkobeD/dQJmpqedcyBTy2sr4nGNRH0c0SPWTLrqAc0OQcb/gemKgqucQT7ySWKCn2EUotoCvpZct7RO2sy/QW0IWcXd7pQRQyZVwT2USRO87uhjioTLKV2brpMUcMQRbKH/N2T+UlTpaMls6cmc6CCNy3JdYYSUzzJQ4oSD3oKLncULOiJvjBEC2oqnCJkJluCYy2ZQ5so9YYlZ1VLlQU1mXEW1jZERwj/MUSRc24TdexlqLKfQBtDTScJUV8FszXBEY5ktpD5Ur9hYB4Nb1iikw3JoYpkKX+RodRKFt53MMuRnKSpY31PwYaGaILh3wxJGz9TkTPEETxoCWZrgvOlmyMzxFEwVJE5xZKzvyJ4WxEc16Gd4Xe3Weq4XH2jKRikqOkGQ87hQnC7wBmGYLAnesX3M+S87eFATauuN+Qcrh7xIxXJbUIdMw3JGE3ylCWzrieaqCn4zhGM19TQ3z1oH1AX+pWEqIc7wNGAkULBo/ZxRaV9NNyh4Br3rCHZzbzmSfawBL0dNRwpW1kK9mxPXR9povcdrGSZK9c2k0xwFGzjuniCtRSZCZ6ccZ7gaktmgAOtKbG/JnOkJrjcQTdFMsxRQ2cLY3WTIrlCw1eWKn8R6pvt4GFDso3QoL4a3nLk3G6JrtME3dSenpx7PNFTmga0EaJTLQ061sEeQoWXhSo9LTXsaSjoJQRXeZLtDclbCrYzfzHHeaKjHCVOUkQHO3JeEepr56mhiyaYYKjjNU+Fed1wS5VlhWSqI/hYUdDOkaxiKehoyOnrCV5yBHtbWFqTHCCwtpDcYolesVR5yUzTZBb3RNMd0d6WP+SvhuBmRcGxnuQzT95IC285cr41cLGQ6aJJhmi4TMGempxeimBRQw1tFKV+8jd6KuzoSTqqDxzRtpZkurvKEHxlqXKRIjjfUNNXQsNOsRScoWFLT+YeRZVD3GRN0MdQcKqQjHDMrdGGVu3iYJpQx3WGUvfbmxwFfR20WBq0oYY7LMFhhgYtr8jpaEnaOzjawWWaTP8mMr0t/EPDPoqcnxTBI5o58L7uoWnMrpoqPwgVrlAUWE+V+TQl9rawoyP6QGAlQw2TPRX+YSkxyBC8Z6jhHkXBgQL7WII3DVFnRfCrBfxewv9D6xsyjys4VkhWb9pUU627JllV0YDNHMku/ldNMMXDEo4aFnAkk4U6frNEU4XgZUPmEKHUl44KrzmYamjAbh0JFvGnaTLPu1s9jPCwjFpYiN7z1DTOk/nc07CfDFzmCf7i+bfNHXhDtLeBXzTBT5rkMvWOIxpl4EMh2LGJBu2syDnAEx2naEhHDWMMzPZEhygyS1mS5RTJr5ZkoKbEUoYqr2kqdDUE8ztK7OaIntJkFrIECwv8LJTaVx5XJE86go8dFeZ3FN3rjabCAYpoYEeC9zzJVULBbmZhDyd7ko09ydpNZ3nm2Kee4FPPXHnYEF1nqOFEC08LUVcDvYXkJHW8gTaKCk9YGOeIJhqiE4ToPEepdp7IWFjdwnWaufGMwJJCMtUTTBBK9BGCOy2tGGrJTHIwyEOzp6aPzNMOtlZkDvcEWpP5SVNhfkvDxhmSazTJXYrM9U1E0xwFVwqZQwzJxw6+kGGGUj2FglGGmnb1/G51udRSMNlTw6GGnCcUwVcOpmsqTHa06o72sw1RL02p9z0VbnMLOaIX3QKaYKSCFQzBKEUNHTSc48k53RH9wxGMtpQa5KjjW0W0n6XCCCG4yxNNdhQ4R4l1Ff+2sSd6UFHiIEOyqqFgT01mEUMD+joy75jPhOA+oVVLm309FR4yVOlp4RhLiScNmSmaYF5Pw0STrOIoWMSR2UkRXOMp+M4SHW8o8Zoi6OZgjKOaFar8zZDzkWzvKOjkKBjmCXby8JahhjXULY4KlzgKLvAwxVGhvyd4zxB1d9T0piazmKLCVZY5sKiD0y2ZSYrkUEPUbIk+dlQ4SJHTR50k1DPaUWIdTZW9NJwnJMOECgd7ou/MnppMJ02O1VT4Wsh85MnZzcFTngpXGKo84qmwgKbCL/orR/SzJ2crA+t6Mp94KvxJUeIbT3CQu1uIdlQEOzlKfS3UMcrTiFmOuroocrZrT2AcmamOKg8YomeEKm/rlT2sociMaybaUlFhuqHCM2qIJ+rg4EcDFymiDSxzaHdPcpE62pD5kyM5SBMoA1PaUtfIthS85ig1VPiPPYXgYEMNk4Qq7TXBgo7oT57gPUdwgCHzhIVFPFU6OYJzHAX9m5oNrVjeE61miDrqQ4VSa1oiURTsKHC0IfjNwU2WzK6eqK8jWln4g15TVBnqmDteCJ501PGAocJhhqjZdtBEB6lnhLreFJKxmlKbeGrqLiSThVIbCdGzloasa6lpMQXHCME2boLpJgT7yWaemu6wBONbqGNVRS0PKIL7LckbjmQtR7K8I5qtqel+T/ChJTNIKLjdUMNIRyvOEko9YYl2cwQveBikCNawJKcLBbc7+JM92mysNvd/Fqp8a0k6CNEe7cnZrxlW0wQXaXjaktnRwNOGZKYiONwS7a1JVheq3WgJHlQUGKHKmp4KAxXR/ULURcNgoa4zhKSLpZR3kxRRb0NmD0OFn+UCS7CzI1nbP6+o4x47QZE5xRCt3ZagnYcvmpYQktXdk5YKXTzBC57kKEe0VVuiSYqapssMS3C9p2CKkHOg8B8Pa8p5atrIw3qezIWanMGa5HRDNF6RM9wcacl0N+Q8Z8hsIkSnaIIdHRUOEebAPy1zbCkhM062FCJtif7PU+UtoVXzWKqM1PxXO8cfdruhFQ/a6x3JKYagvVDhQEtNiyiiSQ7OsuRsZUku0CRNDs4Sog6KKjsZgk2bYJqijgsEenoKeniinRXBn/U3lgpPdyDZynQx8IiioMnCep5Ky8mjGs6Wty0l1hUQTcNWswS3WRp2kCNZwJG8omG8JphPUaFbC8lEfabwP7VtM9yoaNCAjpR41VNhrD9LkbN722v0CoZMByFzhaW+MyzRYEWFDQwN2M4/JiT76PuljT3VU/A36eaIThb+R9oZGOAJ9tewkgGvqOMNRWYjT/Cwu99Q8LqDE4TgbLWxJ1jaDDAERsFOFrobgjUsBScaguXU8kKm2RL19tRypSHnHNlHiIZqgufs4opgQdVdwxBNNFBR6kVFqb8ogimOzB6a6HTzrlDHEpYaxjiiA4TMQobkDg2vejjfwJGWmnbVFAw3H3hq2NyQfG7hz4aC+w3BbwbesG0swYayvpAs6++Ri1Vfzx93mFChvyN5xVHTS+0p9aqCAxyZ6ZacZyw5+7uuQkFPR9DDk9NOiE7X1PCYJVjVUqq7JlrHwWALF5nfHNGjApdpqgzx5OwilDhCiDYTgnc9waGW4BdLNNUQvOtpzDOWHDH8D7TR/A/85KljEQu3NREc4Pl/6B1Hhc8Umb5CsKMmGC9EPcxoT2amwHNCmeOEnOPbklnMkbOgIvO5UMOpQrS9UGVdt6iH/fURjhI/WOpaW9OKLYRod6HCUEdOX000wpDZQ6hwg6LgZfOqo1RfT/CrJzjekXOGhpc1VW71ZLbXyyp+93ILbC1kPtIEYx0FIx1VDrLoVzXRKRYWk809yYlC9ImcrinxtabKnzRJk3lAU1OLEN1j2zrYzr2myHRXJFf4h4QKT1qSTzTB5+ZNTzTRkAxX8FcLV2uS8eoQQ2aAkFzvCM72sJIcJET3WPjRk5wi32uSS9rfZajpWEvj9hW42F4o5NytSXYy8IKHay10VYdrcl4SkqscrXpMwyGOgtkajheSxdQqmpxP1L3t4R5PqasFnrQEjytq6qgp9Y09Qx9o4S1FzhUCn1kyHSzBWLemoSGvOqLNhZyBjmCaAUYpMgt4Ck7wBBMMwWKWgjsUwTaGVsxWC1mYoKiyqqeGKYqonSIRQ3KIkHO0pmAxTdBHkbOvfllfr+AA+7gnc50huVKYK393FOyg7rbPO/izI7hE4CnHHHnJ0ogNPRUGeUpsrZZTBJcrovUcJe51BPsr6GkJdhCCsZ6aTtMEb2pqWkqeVtDXE/QVggsU/Nl86d9RMF3DxvZTA58agu810RWawCiSzzXBeU3MMW9oyJUedvNEvQyNu1f10BSMddR1vaLCYpYa/mGocLSiYDcLbQz8aMn5iyF4xBNMs1P0QEOV7o5gaWGuzSeLue4tt3ro7y4Tgm4G/mopdZgl6q0o6KzJWE3mMksNr3r+a6CbT8g5wZNzT9O7fi/zpaOmnz3BRoqos+tv9zMbdpxsqDBOEewtJLt7cg5wtKKbvldpSzRRCD43VFheCI7yZLppggMVBS/KMAdHODJvOwq2NQSbKKKPLdFWQs7Fqo+mpl01JXYRgq8dnGLhTiFzqmWsUMdpllZdbKlyvSdYxhI9YghOtxR8LgSLWHK62mGGVoxzBE8LNWzqH9CUesQzFy5RQzTc56mhi6fgXEWwpKfE5Z7M05ZgZUPmo6auiv8YKzDYwWBLMErIbKHJvOwIrvEdhOBcQ9JdU1NHQ7CXn2XIDFBKU2WAgcX9UAUzDXWd5alwuyJ41Z9rjKLCL4aCp4WarhPm2rH+SaHUYE001JDZ2ZAzXPjdMpZWvC9wmqIB2lLhQ01D5jO06hghWMndbM7yRJMsoCj1vYbnFQVrW9jak3OlEJ3s/96+p33dEPRV5GxiqaGjIthUU6FFEZyqCa5qJrpBdzSw95IUnOPIrCUUjRZQFrbw5PR0R1qiYx3cb6nrWUMrBmmiBQxVHtTew5ICP/ip6g4hed/Akob/32wvBHsIOX83cI8hGeNeNPCIkPmXe8fPKx84OMSRM1MTdXSwjCZ4S30jVGhvqTRak/OVhgGazHuOCud5onEO1lJr6ecVyaOK6H7zqlBlIaHE0oroCgfvGJIdPcmfLNGLjpz7hZwZQpUbFME0A1cIJa7VNORkgfsMBatbKgwwJM9bSvQXeNOvbIjelg6WWvo5kvbKaJJNHexkKNHL9xRyFlH8Ti2riB5wVPhUk7nGkJnoCe428LR/wRGdYIlmWebCyxou1rCk4g/ShugBDX0V0ZQWkh0dOVsagkM0yV6OoLd5ye+pRlsCr0n+KiQrGuq5yJDzrTAXHtLUMduTDBVKrSm3eHL+6ijxhFDX9Z5gVU/wliHYTMiMFpKLNMEywu80wd3meoFmt6VbRMPenhrOc6DVe4pgXU8DnnHakLOIIrlF4FZPIw6R+zxBP0dyq6OOZ4Q5sLKCcz084ok+VsMMyQhNZmmBgX5xIXOEJTmi7VsGTvMTNdHHhpzdbE8Du2oKxgvBqQKdDDnTFOylCFaxR1syz2iqrOI/FEpNc3C6f11/7+ASS6l2inq2ciTrCCzgyemrCL5SVPjQkdPZUmGy2c9Sw9FtR1sS30RmsKPCS4rkIC/2U0MduwucYolGaPjKEyhzmiPYXagyWbYz8LWBDdzRimAXzxx4z8K9hpzlhLq+NiQ97HuKorMUfK/OVvC2JfiHUPCQI/q7J2gjK+tTDNxkCc4TMssqCs4TGtLVwQihyoAWgj9bosU80XGW6Ac9TJGziaUh5+hnFcHOnlaM1iRn29NaqGENTTTSUHCH2tWTeV0osUhH6psuVLjRUmGWhm6OZEshGeNowABHcJ2Bpy2ZszRcKkRXd2QuKVEeXnbfaEq825FguqfgfE2whlChSRMdron+LATTPQ2Z369t4B9C5gs/ylzv+CMmepIDPclFQl13W0rspPd1JOcbghGOEutqCv5qacURQl3dDKyvyJlqKXGPgcM9FfawJAMVmdcspcYKOZc4GjDYkFlK05olNMHyHn4zFNykyOxt99RkHlfwmiHo60l2EKI+mhreEKp080Tbug08BVPcgoqC5zWt+NLDTZ7oNSF51N1qie7Va3uCCwyZbkINf/NED6jzOsBdZjFN8oqG3wxVunqCSYYKf3EdhJyf9YWGf7tRU2oH3VHgPr1fe5J9hOgHd7xQ0y7qBwXr23aGErP0cm64JVjZwsOGqL+mhNgZmhJLW2oY4UhedsyBgzrCKrq7BmcpNVhR6jBPq64Vgi+kn6XE68pp8J5/+0wRHGOpsKenQn9DZntPzjRLZpDAdD2fnSgkG9tmIXnUwQ6WVighs7Yi2MxQ0N3CqYaCXkJ0oyOztMDJjmSSpcpvlrk0RMMOjmArQ04PRV1DO1FwhCVaUVPpKUM03JK5SxPsIWRu8/CGHi8UHChiqGFDTbSRJWeYUDDcH6vJWUxR4k1FXbMUwV6e4AJFXS8oMqsZKqzvYQ9DDQdZckY4aGsIhtlubbd2r3j4QBMoTamdPZk7O/Bf62lacZwneNjQoGcdVU7zJOd7ghsUHOkosagic6cnWc8+4gg285R6zZP5s1/LUbCKIznTwK36PkdwlOrl4U1LwfdCCa+IrvFkmgw1PCAUXKWo0sURXWcI2muKJlgyFzhynCY4RBOsqCjoI1R5zREco0n2Vt09BQtYSizgKNHfUmUrQ5UOCh51BFcLmY7umhYqXKQomOop8bUnWNNQcIiBcYaC6xzMNOS8JQQfeqKBmmglB+97ok/lfk3ygaHSyZaCRTzRxQo6GzLfa2jWBPepw+UmT7SQEJyiyRkhBLMVOfcoMjcK0eZChfUNzFAUzCsEN5vP/X1uP/n/aoMX+K+nw/Hjr/9xOo7j7Pju61tLcgvJpTWXNbfN5jLpi6VfCOviTktKlFusQixdEKWmEBUKNaIpjZRSSOXSgzaaKLdabrm1/9nZ+/f+vd/vz/v9+Xy+zZ7PRorYoZqyLrCwQdEAixxVOEXNNnjX2nUSRlkqGmWowk8lxR50JPy9Bo6qJXaXwNvREBvnThPEPrewryLhcAnj5WE15Fqi8W7R1sAuEu86S4ENikItFN4xkv9Af4nXSnUVcLiA9xzesFpivRRVeFKtsMRaKBhuSbjOELnAUtlSQUpXgdfB4Z1oSbnFEetbQ0IrAe+Y+pqnDcEJFj6S8LDZzZHwY4e3XONNlARraomNEt2bkvGsosA3ioyHm+6jCMbI59wqt4eeara28IzEmyPgoRaUOEDhTVdEJhmCoTWfC0p8aNkCp0oYqih2iqGi4yXeMkOsn4LdLLnmKfh/YogjNsPebeFGR4m9BJHLzB61XQ3BtpISfS2FugsK9FAtLWX1dCRcrCnUp44CNzuCowUZmxSRgYaE6Za0W2u/E7CVXCiI/UOR8aAm1+OSyE3mOUcwyc1zBBeoX1kiKy0Zfxck1Gsyulti11i83QTBF5Kg3pDQThFMVHiPSlK+0cSedng/VaS8bOZbtsBcTcZAR8JP5KeqQ1OYKAi20njdNNRpgnsU//K+JnaXJaGTomr7aYIphoRn9aeShJWKEq9LcozSF7QleEfDI5LYm5bgVkFkRwVDBCVu0DDIkGupo8TZBq+/pMQURYErJQmPKGKjNDkWOLx7Jd5QizdUweIaKrlP7SwJDhZvONjLkOsBBX9UpGxnydhXkfBLQ8IxgojQbLFnJf81JytSljclYYyEFyx0kVBvKWOFJmONpshGAcsduQY5giVNCV51eOdJYo/pLhbvM0uDHSevNKRcrKZIqnCtJeEsO95RoqcgGK4ocZcho1tTYtcZvH41pNQ7vA0WrhIfOSraIIntIAi+NXWCErdbkvrWwjRLrt0NKUdL6KSOscTOdMSOUtBHwL6OLA0vNSdynaWQEnCpIvKaIrJJEbvHkmuNhn6OjM8VkSGSqn1uYJCGHnq9I3aLhNME3t6GjIkO7xrNFumpyTNX/NrwX7CrIRiqqWijI9JO4d1iieykyfiposQIQ8YjjsjlBh6oHWbwRjgYJQn2NgSnNycmJAk3NiXhx44Sxykihxm8ybUwT1OVKySc7vi3OXVkdBJ4AyXBeksDXG0IhgtYY0lY5ahCD0ehborIk5aUWRJviMA7Xt5kyRjonrXENkm8yYqgs8VzgrJmClK20uMM3jRJ0FiQICQF9hdETlLQWRIb5ki6WDfWRPobvO6a4GP5mcOrNzDFELtTkONLh9dXE8xypEg7z8A9jkhrQ6Fhjlg/QVktJXxt4WXzT/03Q8IaQWSqIuEvloQ2mqC9Jfi7wRul4RX3pSPlzpoVlmCtI2jvKHCFhjcM3sN6lqF6HxnKelLjXWbwrpR4xzuCrTUZx2qq9oAh8p6ixCUGr78g8oyjRAtB5CZFwi80VerVpI0h+IeBxa6Zg6kWvpDHaioYYuEsRbDC3eOmC2JvGYLeioxGknL2UATNJN6hmtj1DlpLvDVmocYbrGCVJKOrg4X6DgddLA203BKMFngdJJFtFd7vJLm6KEpc5yjQrkk7M80SGe34X24nSex1Ra5Omgb71JKyg8SrU3i/kARKwWpH0kOGhKkObyfd0ZGjvyXlAkVZ4xRbYJ2irFMkFY1SwyWxr2oo4zlNiV+7zmaweFpT4kR3kaDAFW6xpSqzJay05FtYR4HmZhc9UxKbbfF2V8RG1MBmSaE+kmC6JnaRXK9gsiXhJHl/U0qM0WTcbyhwkYIvFGwjSbjfwhiJt8ZSQU+Bd5+marPMOkVkD0muxYLIfEuhh60x/J92itguihJSEMySVPQnTewnEm+620rTQEMsOfo4/kP/0ARvWjitlpSX7GxBgcMEsd3EEeYWvdytd+Saawi6aCIj1CkGb6Aj9rwhx16Cf3vAwFy5pyLhVonXzy51FDpdEblbkdJbUcEPDEFzQ8qNmhzzLTmmKWKbFCXeEuRabp6rxbvAtLF442QjQ+wEA9eL1xSR7Q0JXzlSHjJ4exq89yR0laScJ/FW6z4a73pFMEfDiRZvuvijIt86RaSFOl01riV2mD1UEvxGk/Geg5aWwGki1zgKPG9J2U8PEg8qYvMsZeytiTRXBMslCU8JSlxi8EabjwUldlDNLfzTUmCgxWsjqWCOHavYAqsknKFIO0yQ61VL5AVFxk6WhEaCAkdJgt9aSkzXlKNX2jEa79waYuc7gq0N3GDJGCBhoiTXUEPsdknCUE1CK0fwsiaylSF2uiDyO4XX3pFhNd7R4itFGc0k/ElBZwWvq+GC6szVeEoS/MZ+qylwpKNKv9Z469UOjqCjwlusicyTxG6VpNxcQ8IncoR4RhLbR+NdpGGmJWOcIzJGUuKPGpQg8rrG21dOMqQssJQ4RxH5jaUqnZuQ0F4Q+cjxLwPtpZbIAk3QTJHQWBE5S1BokoVtDd6lhqr9UpHSUxMcIYl9pojsb8h4SBOsMQcqvOWC2E8EVehqiJ1hrrAEbQxeK0NGZ0Gkq+guSRgniM23bIHVkqwx4hiHd7smaOyglyIyQuM978j4VS08J/A2G1KeMBRo4fBaSNhKUEZfQewVQ/C1I+MgfbEleEzCUw7mKXI0M3hd1EESVji8x5uQ41nxs1q4RMJCCXs7Iq9acpxn22oSDnQ/sJTxsCbHIYZiLyhY05TY0ZLIOQrGaSJDDN4t8pVaIrsqqFdEegtizc1iTew5Q4ayBDMUsQMkXocaYkc0hZua412siZ1rSXlR460zRJ5SlHGe5j801RLMlJTxtaOM3Q1pvxJ45zUlWFD7rsAbpfEm1JHxG0eh8w2R7QQVzBUw28FhFp5QZzq8t2rx2joqulYTWSuJdTYfWwqMFMcovFmSyJPNyLhE4E10pHzYjOC3huArRa571ZsGajQpQx38SBP5pyZB6lMU3khDnp0MBV51BE9o2E+TY5Ml2E8S7C0o6w1xvCZjf0HkVEHCzFoyNmqC+9wdcqN+Tp7jSDheE9ws8Y5V0NJCn2bk2tqSY4okdrEhx1iDN8cSudwepWmAGXKcJXK65H9to8jYQRH7SBF01ESUJdd0TayVInaWhLkOjlXE5irKGOnI6GSWGCJa482zBI9rCr0jyTVcEuzriC1vcr6mwFGSiqy5zMwxBH/TJHwjSPhL8+01kaaSUuMFKTcLEvaUePcrSmwn8DZrgikWb7CGPxkSjhQwrRk57tctmxLsb9sZvL9LSlyuSLlWkqOjwduo8b6Uv1DkmudIeFF2dHCgxVtk8dpIvHpBxhEOdhKk7OLIUSdJ+cSRY57B+0DgGUUlNfpthTfGkauzxrvTsUUaCVhlKeteTXCoJDCa2NOKhOmC4G1H8JBd4OBZReSRGkqcb/CO1PyLJTLB4j1q8JYaIutEjSLX8YKM+a6phdMsdLFUoV5RTm9JSkuDN8WcIon0NZMNZWh1q8C7SJEwV5HxrmnnTrf3KoJBlmCYI2ilSLlfEvlE4011NNgjgthzEua0oKK7JLE7HZHlEl60BLMVFewg4EWNt0ThrVNEVkkiTwpKXSWJzdRENgvKGq4IhjsiezgSFtsfCUq8qki5S1LRQeYQQ4nemmCkImWMw3tFUoUBZk4NOeZYEp4XRKTGa6wJjrWNHBVJR4m3FCnbuD6aak2WsMTh3SZImGCIPKNgsDpVwnsa70K31lCFJZYcwwSMFcQulGTsZuEaSdBXkPGZhu0FsdUO73RHjq8MPGGIfaGIbVTk6iuI3GFgucHrIQkmWSJdBd7BBu+uOryWAhY7+Lki9rK5wtEQzWwvtbqGhIMFwWRJsElsY4m9IIg9L6lCX0VklaPAYkfkZEGDnOWowlBJjtMUkcGK4Lg6EtoZInMUBVYLgn0UsdmCyCz7gIGHFfk+k1QwTh5We7A9x+IdJ6CvIkEagms0hR50eH9UnTQJ+2oiKyVlLFUE+8gBGu8MQ3CppUHesnjTHN4QB/UGPhCTHLFPHMFrCqa73gqObUJGa03wgbhHkrCfpEpzNLE7JDS25FMKhlhKKWKfCgqstLCPu1zBXy0J2ztwjtixBu8UTRn9LVtkmCN2iyFhtME70JHRQ1KVZXqKI/KNIKYMCYs1GUMEKbM1bKOI9LDXC7zbHS+bt+1MTWS9odA9DtrYtpbImQJ2VHh/lisEwaHqUk1kjKTAKknkBEXkbkdMGwq0dnhzLJF3NJH3JVwrqOB4Sca2hti75nmJN0WzxS6UxDYoEpxpa4htVlRjkYE7DZGzJVU72uC9IyhQL4i8YfGWSYLLNcHXloyz7QhNifmKSE9JgfGmuyLhc403Xm9vqcp6gXe3xuuv8F6VJNxkyTHEkHG2g0aKXL0MsXc1bGfgas2//dCONXiNLCX+5mB7eZIl1kHh7ajwpikyzlUUWOVOsjSQlsS+M0R+pPje/dzBXRZGO0rMtgQrLLG9VSu9n6CMXS3BhwYmSoIBhsjNBmZbgusE9BCPCP5triU4VhNbJfE+swSP27aayE8tuTpYYjtrYjMVGZdp2NpS1s6aBnKSHDsbKuplKbHM4a0wMFd/5/DmGyKrJSUaW4IBrqUhx0vyfzTBBLPIUcnZdrAkNsKR0sWRspumSns6Ch0v/qqIbBYUWKvPU/CFoyrDJGwSNFhbA/MlzKqjrO80hRbpKx0Jewsi/STftwGSlKc1JZyAzx05dhLEdnfQvhZOqiHWWEAHC7+30FuRcZUgaO5gpaIK+xsiHRUsqaPElTV40xQZQ107Q9BZE1nryDVGU9ZSQ47bmhBpLcYpUt7S+xuK/FiT8qKjwXYw5ypS2iuCv7q1gtgjhuBuB8LCFY5cUuCNtsQOFcT+4Ih9JX+k8Ea6v0iCIRZOtCT0Et00JW5UeC85Cg0ScK0k411HcG1zKtre3SeITBRk7WfwDhEvaYLTHP9le0m8By0JDwn4TlLW/aJOvGHxdjYUes+ScZigCkYQdNdEOhkiezgShqkx8ueKjI8lDfK2oNiOFvrZH1hS+tk7NV7nOmLHicGWEgubkXKdwdtZknCLJXaCpkrjZBtLZFsDP9CdxWsSr05Sxl6CMmoFbCOgryX40uDtamB7SVmXW4Ihlgpmq+00tBKUUa83WbjLUNkzDmY7cow1JDygyPGlhgGKYKz4vcV7QBNbJIgM11TUqZaMdwTeSguH6rOaw1JRKzaaGyxVm2EJ/uCIrVWUcZUkcp2grMsEjK+DMwS59jQk3Kd6SEq1d0S6uVmO4Bc1lDXTUcHjluCXEq+1OlBDj1pi9zgiXxnKuE0SqTXwhqbETW6RggMEnGl/q49UT2iCzgJvRwVXS2K/d6+ZkyUl7jawSVLit46EwxVljDZwoSQ20sDBihztHfk2yA8NVZghiXwrYHQdfKAOtzsayjhY9bY0yE2CWEeJ9xfzO423xhL5syS2TFJofO2pboHob0nY4GiAgRrvGQEDa/FWSsoaaYl0syRsEt3kWoH3B01shCXhTUWe9w3Bt44SC9QCh3eShQctwbaK2ApLroGCMlZrYqvlY3qYhM0aXpFkPOuoqJ3Dm6fxXrGwVF9gCWZagjPqznfkuMKQ8DPTQRO8ZqG1hPGKEm9IgpGW4DZDgTNriTxvFiq+Lz+0cKfp4wj6OCK9JSnzNSn9LFU7UhKZZMnYwcJ8s8yRsECScK4j5UOB95HFO0CzhY4xJxuCix0lDlEUeMdS6EZBkTsUkZ4K74dugyTXS7aNgL8aqjDfkCE0ZbwkCXpaWCKhl8P7VD5jxykivSyxyZrYERbe168LYu9ZYh86IkscgVLE7tWPKmJv11CgoyJltMEbrohtVAQfO4ImltiHEroYEs7RxAarVpY8AwXMcMReFOTYWe5iiLRQxJ5Q8DtJ8LQhWOhIeFESPGsILhbNDRljNbHzNRlTFbk2S3L0NOS6V1KFJYKUbSTcIIhM0wQ/s2TM0SRMNcQmSap3jCH4yhJZKSkwyRHpYYgsFeQ4U7xoCB7VVOExhXepo9ABBsYbvGWKXPME3lyH95YioZ0gssQRWWbI+FaSMkXijZXwgiTlYdPdkNLaETxlyDVIwqeaEus0aTcYcg0RVOkpR3CSJqIddK+90JCxzsDVloyrFd5ZAr4TBKfaWa6boEA7C7s6EpYaeFPjveooY72mjIccLHJ9HUwVlDhKkmutJDJBwnp1rvulJZggKDRfbXAkvC/4l3ozQOG9a8lxjx0i7nV4jSXc7vhe3OwIxjgSHjdEhhsif9YkPGlus3iLFDnWOFhtCZbJg0UbQcIaR67JjthoCyMEZRwhiXWyxO5QxI6w5NhT4U1WsJvDO60J34fW9hwzwlKij6ZAW9ne4L0s8C6XeBMEkd/LQy1VucBRot6QMlbivaBhoBgjqGiCJNhsqVp/S2SsG6DIONCR0dXhvWbJ+MRRZJkkuEjgDXJjFQW6SSL7GXK8Z2CZg7cVsbWGoKmEpzQ5elpiy8Ryg7dMkLLUEauzeO86CuwlSOlgYLojZWeJ9xM3S1PWfEfKl5ISLQ0MEKR8YOB2QfCxJBjrKPCN4f9MkaSsqoVXJBmP7EpFZ9UQfOoOFwSzBN4MQ8LsGrymlipcJQhmy0GaQjPqCHaXRwuCZwRbqK2Fg9wlClZqYicrIgMdZfxTQ0c7TBIbrChxmuzoKG8XRaSrIhhiyNFJkrC7oIAWMEOQa5aBekPCRknCo4IKPrYkvCDI8aYmY7WFtprgekcJZ3oLIqssCSMtFbQTJKwXYy3BY5oCh2iKPCpJOE+zRdpYgi6O2KmOAgvVCYaU4ySRek1sgyFhJ403QFHiVEmJHwtybO1gs8Hr5+BETQX3War0qZngYGgtVZtoqd6vFSk/UwdZElYqyjrF4HXUeFspIi9IGKf4j92pKGAdCYMVsbcV3kRF0N+R8LUd5PCsIGWoxDtBkCI0nKofdJQxT+LtZflvuc8Q3CjwWkq8KwUpHzkK/NmSsclCL0nseQdj5FRH5CNHSgtLiW80Of5HU9Hhlsga9bnBq3fEVltKfO5IaSTmGjjc4J0otcP7QsJUSQM8pEj5/wCuUuC2DWz8AAAAAElFTkSuQmCC"); -} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/base16-dark.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/base16-dark.css deleted file mode 100644 index b009d2b..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/base16-dark.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - - Name: Base16 Default Dark - Author: Chris Kempson (http://chriskempson.com) - - CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-chrome-devtools) - Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) - -*/ - -.cm-s-base16-dark.CodeMirror {background: #151515; color: #e0e0e0;} -.cm-s-base16-dark div.CodeMirror-selected {background: #303030 !important;} -.cm-s-base16-dark.CodeMirror ::selection { background: rgba(48, 48, 48, .99); } -.cm-s-base16-dark.CodeMirror ::-moz-selection { background: rgba(48, 48, 48, .99); } -.cm-s-base16-dark .CodeMirror-gutters {background: #151515; border-right: 0px;} -.cm-s-base16-dark .CodeMirror-guttermarker { color: #ac4142; } -.cm-s-base16-dark .CodeMirror-guttermarker-subtle { color: #505050; } -.cm-s-base16-dark .CodeMirror-linenumber {color: #505050;} -.cm-s-base16-dark .CodeMirror-cursor {border-left: 1px solid #b0b0b0 !important;} - -.cm-s-base16-dark span.cm-comment {color: #8f5536;} -.cm-s-base16-dark span.cm-atom {color: #aa759f;} -.cm-s-base16-dark span.cm-number {color: #aa759f;} - -.cm-s-base16-dark span.cm-property, .cm-s-base16-dark span.cm-attribute {color: #90a959;} -.cm-s-base16-dark span.cm-keyword {color: #ac4142;} -.cm-s-base16-dark span.cm-string {color: #f4bf75;} - -.cm-s-base16-dark span.cm-variable {color: #90a959;} -.cm-s-base16-dark span.cm-variable-2 {color: #6a9fb5;} -.cm-s-base16-dark span.cm-def {color: #d28445;} -.cm-s-base16-dark span.cm-bracket {color: #e0e0e0;} -.cm-s-base16-dark span.cm-tag {color: #ac4142;} -.cm-s-base16-dark span.cm-link {color: #aa759f;} -.cm-s-base16-dark span.cm-error {background: #ac4142; color: #b0b0b0;} - -.cm-s-base16-dark .CodeMirror-activeline-background {background: #202020 !important;} -.cm-s-base16-dark .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/base16-light.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/base16-light.css deleted file mode 100644 index 15df6d3..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/base16-light.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - - Name: Base16 Default Light - Author: Chris Kempson (http://chriskempson.com) - - CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-chrome-devtools) - Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) - -*/ - -.cm-s-base16-light.CodeMirror {background: #f5f5f5; color: #202020;} -.cm-s-base16-light div.CodeMirror-selected {background: #e0e0e0 !important;} -.cm-s-base16-light.CodeMirror ::selection { background: #e0e0e0; } -.cm-s-base16-light.CodeMirror ::-moz-selection { background: #e0e0e0; } -.cm-s-base16-light .CodeMirror-gutters {background: #f5f5f5; border-right: 0px;} -.cm-s-base16-light .CodeMirror-guttermarker { color: #ac4142; } -.cm-s-base16-light .CodeMirror-guttermarker-subtle { color: #b0b0b0; } -.cm-s-base16-light .CodeMirror-linenumber {color: #b0b0b0;} -.cm-s-base16-light .CodeMirror-cursor {border-left: 1px solid #505050 !important;} - -.cm-s-base16-light span.cm-comment {color: #8f5536;} -.cm-s-base16-light span.cm-atom {color: #aa759f;} -.cm-s-base16-light span.cm-number {color: #aa759f;} - -.cm-s-base16-light span.cm-property, .cm-s-base16-light span.cm-attribute {color: #90a959;} -.cm-s-base16-light span.cm-keyword {color: #ac4142;} -.cm-s-base16-light span.cm-string {color: #f4bf75;} - -.cm-s-base16-light span.cm-variable {color: #90a959;} -.cm-s-base16-light span.cm-variable-2 {color: #6a9fb5;} -.cm-s-base16-light span.cm-def {color: #d28445;} -.cm-s-base16-light span.cm-bracket {color: #202020;} -.cm-s-base16-light span.cm-tag {color: #ac4142;} -.cm-s-base16-light span.cm-link {color: #aa759f;} -.cm-s-base16-light span.cm-error {background: #ac4142; color: #505050;} - -.cm-s-base16-light .CodeMirror-activeline-background {background: #DDDCDC !important;} -.cm-s-base16-light .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/blackboard.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/blackboard.css deleted file mode 100644 index 02289b6..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/blackboard.css +++ /dev/null @@ -1,32 +0,0 @@ -/* Port of TextMate's Blackboard theme */ - -.cm-s-blackboard.CodeMirror { background: #0C1021; color: #F8F8F8; } -.cm-s-blackboard .CodeMirror-selected { background: #253B76 !important; } -.cm-s-blackboard.CodeMirror ::selection { background: rgba(37, 59, 118, .99); } -.cm-s-blackboard.CodeMirror ::-moz-selection { background: rgba(37, 59, 118, .99); } -.cm-s-blackboard .CodeMirror-gutters { background: #0C1021; border-right: 0; } -.cm-s-blackboard .CodeMirror-guttermarker { color: #FBDE2D; } -.cm-s-blackboard .CodeMirror-guttermarker-subtle { color: #888; } -.cm-s-blackboard .CodeMirror-linenumber { color: #888; } -.cm-s-blackboard .CodeMirror-cursor { border-left: 1px solid #A7A7A7 !important; } - -.cm-s-blackboard .cm-keyword { color: #FBDE2D; } -.cm-s-blackboard .cm-atom { color: #D8FA3C; } -.cm-s-blackboard .cm-number { color: #D8FA3C; } -.cm-s-blackboard .cm-def { color: #8DA6CE; } -.cm-s-blackboard .cm-variable { color: #FF6400; } -.cm-s-blackboard .cm-operator { color: #FBDE2D;} -.cm-s-blackboard .cm-comment { color: #AEAEAE; } -.cm-s-blackboard .cm-string { color: #61CE3C; } -.cm-s-blackboard .cm-string-2 { color: #61CE3C; } -.cm-s-blackboard .cm-meta { color: #D8FA3C; } -.cm-s-blackboard .cm-builtin { color: #8DA6CE; } -.cm-s-blackboard .cm-tag { color: #8DA6CE; } -.cm-s-blackboard .cm-attribute { color: #8DA6CE; } -.cm-s-blackboard .cm-header { color: #FF6400; } -.cm-s-blackboard .cm-hr { color: #AEAEAE; } -.cm-s-blackboard .cm-link { color: #8DA6CE; } -.cm-s-blackboard .cm-error { background: #9D1E15; color: #F8F8F8; } - -.cm-s-blackboard .CodeMirror-activeline-background {background: #3C3636 !important;} -.cm-s-blackboard .CodeMirror-matchingbracket {outline:1px solid grey;color:white !important} \ No newline at end of file diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/cobalt.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/cobalt.css deleted file mode 100644 index 3915589..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/cobalt.css +++ /dev/null @@ -1,25 +0,0 @@ -.cm-s-cobalt.CodeMirror { background: #002240; color: white; } -.cm-s-cobalt div.CodeMirror-selected { background: #b36539 !important; } -.cm-s-cobalt.CodeMirror ::selection { background: rgba(179, 101, 57, .99); } -.cm-s-cobalt.CodeMirror ::-moz-selection { background: rgba(179, 101, 57, .99); } -.cm-s-cobalt .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } -.cm-s-cobalt .CodeMirror-guttermarker { color: #ffee80; } -.cm-s-cobalt .CodeMirror-guttermarker-subtle { color: #d0d0d0; } -.cm-s-cobalt .CodeMirror-linenumber { color: #d0d0d0; } -.cm-s-cobalt .CodeMirror-cursor { border-left: 1px solid white !important; } - -.cm-s-cobalt span.cm-comment { color: #08f; } -.cm-s-cobalt span.cm-atom { color: #845dc4; } -.cm-s-cobalt span.cm-number, .cm-s-cobalt span.cm-attribute { color: #ff80e1; } -.cm-s-cobalt span.cm-keyword { color: #ffee80; } -.cm-s-cobalt span.cm-string { color: #3ad900; } -.cm-s-cobalt span.cm-meta { color: #ff9d00; } -.cm-s-cobalt span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #9effff; } -.cm-s-cobalt span.cm-variable-3, .cm-s-cobalt span.cm-def { color: white; } -.cm-s-cobalt span.cm-bracket { color: #d8d8d8; } -.cm-s-cobalt span.cm-builtin, .cm-s-cobalt span.cm-special { color: #ff9e59; } -.cm-s-cobalt span.cm-link { color: #845dc4; } -.cm-s-cobalt span.cm-error { color: #9d1e15; } - -.cm-s-cobalt .CodeMirror-activeline-background {background: #002D57 !important;} -.cm-s-cobalt .CodeMirror-matchingbracket {outline:1px solid grey;color:white !important} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/colorforth.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/colorforth.css deleted file mode 100644 index 73fbf80..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/colorforth.css +++ /dev/null @@ -1,33 +0,0 @@ -.cm-s-colorforth.CodeMirror { background: #000000; color: #f8f8f8; } -.cm-s-colorforth .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; } -.cm-s-colorforth .CodeMirror-guttermarker { color: #FFBD40; } -.cm-s-colorforth .CodeMirror-guttermarker-subtle { color: #78846f; } -.cm-s-colorforth .CodeMirror-linenumber { color: #bababa; } -.cm-s-colorforth .CodeMirror-cursor { border-left: 1px solid white !important; } - -.cm-s-colorforth span.cm-comment { color: #ededed; } -.cm-s-colorforth span.cm-def { color: #ff1c1c; font-weight:bold; } -.cm-s-colorforth span.cm-keyword { color: #ffd900; } -.cm-s-colorforth span.cm-builtin { color: #00d95a; } -.cm-s-colorforth span.cm-variable { color: #73ff00; } -.cm-s-colorforth span.cm-string { color: #007bff; } -.cm-s-colorforth span.cm-number { color: #00c4ff; } -.cm-s-colorforth span.cm-atom { color: #606060; } - -.cm-s-colorforth span.cm-variable-2 { color: #EEE; } -.cm-s-colorforth span.cm-variable-3 { color: #DDD; } -.cm-s-colorforth span.cm-property {} -.cm-s-colorforth span.cm-operator {} - -.cm-s-colorforth span.cm-meta { color: yellow; } -.cm-s-colorforth span.cm-qualifier { color: #FFF700; } -.cm-s-colorforth span.cm-bracket { color: #cc7; } -.cm-s-colorforth span.cm-tag { color: #FFBD40; } -.cm-s-colorforth span.cm-attribute { color: #FFF700; } -.cm-s-colorforth span.cm-error { color: #f00; } - -.cm-s-colorforth .CodeMirror-selected { background: #333d53 !important; } - -.cm-s-colorforth span.cm-compilation { background: rgba(255, 255, 255, 0.12); } - -.cm-s-colorforth .CodeMirror-activeline-background {background: #253540 !important;} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/eclipse.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/eclipse.css deleted file mode 100644 index 317218e..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/eclipse.css +++ /dev/null @@ -1,23 +0,0 @@ -.cm-s-eclipse span.cm-meta {color: #FF1717;} -.cm-s-eclipse span.cm-keyword { line-height: 1em; font-weight: bold; color: #7F0055; } -.cm-s-eclipse span.cm-atom {color: #219;} -.cm-s-eclipse span.cm-number {color: #164;} -.cm-s-eclipse span.cm-def {color: #00f;} -.cm-s-eclipse span.cm-variable {color: black;} -.cm-s-eclipse span.cm-variable-2 {color: #0000C0;} -.cm-s-eclipse span.cm-variable-3 {color: #0000C0;} -.cm-s-eclipse span.cm-property {color: black;} -.cm-s-eclipse span.cm-operator {color: black;} -.cm-s-eclipse span.cm-comment {color: #3F7F5F;} -.cm-s-eclipse span.cm-string {color: #2A00FF;} -.cm-s-eclipse span.cm-string-2 {color: #f50;} -.cm-s-eclipse span.cm-qualifier {color: #555;} -.cm-s-eclipse span.cm-builtin {color: #30a;} -.cm-s-eclipse span.cm-bracket {color: #cc7;} -.cm-s-eclipse span.cm-tag {color: #170;} -.cm-s-eclipse span.cm-attribute {color: #00c;} -.cm-s-eclipse span.cm-link {color: #219;} -.cm-s-eclipse span.cm-error {color: #f00;} - -.cm-s-eclipse .CodeMirror-activeline-background {background: #e8f2ff !important;} -.cm-s-eclipse .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/elegant.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/elegant.css deleted file mode 100644 index dd7df7b..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/elegant.css +++ /dev/null @@ -1,13 +0,0 @@ -.cm-s-elegant span.cm-number, .cm-s-elegant span.cm-string, .cm-s-elegant span.cm-atom {color: #762;} -.cm-s-elegant span.cm-comment {color: #262; font-style: italic; line-height: 1em;} -.cm-s-elegant span.cm-meta {color: #555; font-style: italic; line-height: 1em;} -.cm-s-elegant span.cm-variable {color: black;} -.cm-s-elegant span.cm-variable-2 {color: #b11;} -.cm-s-elegant span.cm-qualifier {color: #555;} -.cm-s-elegant span.cm-keyword {color: #730;} -.cm-s-elegant span.cm-builtin {color: #30a;} -.cm-s-elegant span.cm-link {color: #762;} -.cm-s-elegant span.cm-error {background-color: #fdd;} - -.cm-s-elegant .CodeMirror-activeline-background {background: #e8f2ff !important;} -.cm-s-elegant .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/erlang-dark.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/erlang-dark.css deleted file mode 100644 index 25c7e0a..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/erlang-dark.css +++ /dev/null @@ -1,34 +0,0 @@ -.cm-s-erlang-dark.CodeMirror { background: #002240; color: white; } -.cm-s-erlang-dark div.CodeMirror-selected { background: #b36539 !important; } -.cm-s-erlang-dark.CodeMirror ::selection { background: rgba(179, 101, 57, .99); } -.cm-s-erlang-dark.CodeMirror ::-moz-selection { background: rgba(179, 101, 57, .99); } -.cm-s-erlang-dark .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } -.cm-s-erlang-dark .CodeMirror-guttermarker { color: white; } -.cm-s-erlang-dark .CodeMirror-guttermarker-subtle { color: #d0d0d0; } -.cm-s-erlang-dark .CodeMirror-linenumber { color: #d0d0d0; } -.cm-s-erlang-dark .CodeMirror-cursor { border-left: 1px solid white !important; } - -.cm-s-erlang-dark span.cm-atom { color: #f133f1; } -.cm-s-erlang-dark span.cm-attribute { color: #ff80e1; } -.cm-s-erlang-dark span.cm-bracket { color: #ff9d00; } -.cm-s-erlang-dark span.cm-builtin { color: #eaa; } -.cm-s-erlang-dark span.cm-comment { color: #77f; } -.cm-s-erlang-dark span.cm-def { color: #e7a; } -.cm-s-erlang-dark span.cm-keyword { color: #ffee80; } -.cm-s-erlang-dark span.cm-meta { color: #50fefe; } -.cm-s-erlang-dark span.cm-number { color: #ffd0d0; } -.cm-s-erlang-dark span.cm-operator { color: #d55; } -.cm-s-erlang-dark span.cm-property { color: #ccc; } -.cm-s-erlang-dark span.cm-qualifier { color: #ccc; } -.cm-s-erlang-dark span.cm-quote { color: #ccc; } -.cm-s-erlang-dark span.cm-special { color: #ffbbbb; } -.cm-s-erlang-dark span.cm-string { color: #3ad900; } -.cm-s-erlang-dark span.cm-string-2 { color: #ccc; } -.cm-s-erlang-dark span.cm-tag { color: #9effff; } -.cm-s-erlang-dark span.cm-variable { color: #50fe50; } -.cm-s-erlang-dark span.cm-variable-2 { color: #e0e; } -.cm-s-erlang-dark span.cm-variable-3 { color: #ccc; } -.cm-s-erlang-dark span.cm-error { color: #9d1e15; } - -.cm-s-erlang-dark .CodeMirror-activeline-background {background: #013461 !important;} -.cm-s-erlang-dark .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/lesser-dark.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/lesser-dark.css deleted file mode 100644 index 5af8b7f..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/lesser-dark.css +++ /dev/null @@ -1,47 +0,0 @@ -/* -http://lesscss.org/ dark theme -Ported to CodeMirror by Peter Kroon -*/ -.cm-s-lesser-dark { - line-height: 1.3em; -} -.cm-s-lesser-dark.CodeMirror { background: #262626; color: #EBEFE7; text-shadow: 0 -1px 1px #262626; } -.cm-s-lesser-dark div.CodeMirror-selected {background: #45443B !important;} /* 33322B*/ -.cm-s-lesser-dark.CodeMirror ::selection { background: rgba(69, 68, 59, .99); } -.cm-s-lesser-dark.CodeMirror ::-moz-selection { background: rgba(69, 68, 59, .99); } -.cm-s-lesser-dark .CodeMirror-cursor { border-left: 1px solid white !important; } -.cm-s-lesser-dark pre { padding: 0 8px; }/*editable code holder*/ - -.cm-s-lesser-dark.CodeMirror span.CodeMirror-matchingbracket { color: #7EFC7E; }/*65FC65*/ - -.cm-s-lesser-dark .CodeMirror-gutters { background: #262626; border-right:1px solid #aaa; } -.cm-s-lesser-dark .CodeMirror-guttermarker { color: #599eff; } -.cm-s-lesser-dark .CodeMirror-guttermarker-subtle { color: #777; } -.cm-s-lesser-dark .CodeMirror-linenumber { color: #777; } - -.cm-s-lesser-dark span.cm-keyword { color: #599eff; } -.cm-s-lesser-dark span.cm-atom { color: #C2B470; } -.cm-s-lesser-dark span.cm-number { color: #B35E4D; } -.cm-s-lesser-dark span.cm-def {color: white;} -.cm-s-lesser-dark span.cm-variable { color:#D9BF8C; } -.cm-s-lesser-dark span.cm-variable-2 { color: #669199; } -.cm-s-lesser-dark span.cm-variable-3 { color: white; } -.cm-s-lesser-dark span.cm-property {color: #92A75C;} -.cm-s-lesser-dark span.cm-operator {color: #92A75C;} -.cm-s-lesser-dark span.cm-comment { color: #666; } -.cm-s-lesser-dark span.cm-string { color: #BCD279; } -.cm-s-lesser-dark span.cm-string-2 {color: #f50;} -.cm-s-lesser-dark span.cm-meta { color: #738C73; } -.cm-s-lesser-dark span.cm-qualifier {color: #555;} -.cm-s-lesser-dark span.cm-builtin { color: #ff9e59; } -.cm-s-lesser-dark span.cm-bracket { color: #EBEFE7; } -.cm-s-lesser-dark span.cm-tag { color: #669199; } -.cm-s-lesser-dark span.cm-attribute {color: #00c;} -.cm-s-lesser-dark span.cm-header {color: #a0a;} -.cm-s-lesser-dark span.cm-quote {color: #090;} -.cm-s-lesser-dark span.cm-hr {color: #999;} -.cm-s-lesser-dark span.cm-link {color: #00c;} -.cm-s-lesser-dark span.cm-error { color: #9d1e15; } - -.cm-s-lesser-dark .CodeMirror-activeline-background {background: #3C3A3A !important;} -.cm-s-lesser-dark .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/mbo.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/mbo.css deleted file mode 100644 index e398795..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/mbo.css +++ /dev/null @@ -1,37 +0,0 @@ -/****************************************************************/ -/* Based on mbonaci's Brackets mbo theme */ -/* https://github.com/mbonaci/global/blob/master/Mbo.tmTheme */ -/* Create your own: http://tmtheme-editor.herokuapp.com */ -/****************************************************************/ - -.cm-s-mbo.CodeMirror {background: #2c2c2c; color: #ffffec;} -.cm-s-mbo div.CodeMirror-selected {background: #716C62 !important;} -.cm-s-mbo.CodeMirror ::selection { background: rgba(113, 108, 98, .99); } -.cm-s-mbo.CodeMirror ::-moz-selection { background: rgba(113, 108, 98, .99); } -.cm-s-mbo .CodeMirror-gutters {background: #4e4e4e; border-right: 0px;} -.cm-s-mbo .CodeMirror-guttermarker { color: white; } -.cm-s-mbo .CodeMirror-guttermarker-subtle { color: grey; } -.cm-s-mbo .CodeMirror-linenumber {color: #dadada;} -.cm-s-mbo .CodeMirror-cursor {border-left: 1px solid #ffffec !important;} - -.cm-s-mbo span.cm-comment {color: #95958a;} -.cm-s-mbo span.cm-atom {color: #00a8c6;} -.cm-s-mbo span.cm-number {color: #00a8c6;} - -.cm-s-mbo span.cm-property, .cm-s-mbo span.cm-attribute {color: #9ddfe9;} -.cm-s-mbo span.cm-keyword {color: #ffb928;} -.cm-s-mbo span.cm-string {color: #ffcf6c;} -.cm-s-mbo span.cm-string.cm-property {color: #ffffec;} - -.cm-s-mbo span.cm-variable {color: #ffffec;} -.cm-s-mbo span.cm-variable-2 {color: #00a8c6;} -.cm-s-mbo span.cm-def {color: #ffffec;} -.cm-s-mbo span.cm-bracket {color: #fffffc; font-weight: bold;} -.cm-s-mbo span.cm-tag {color: #9ddfe9;} -.cm-s-mbo span.cm-link {color: #f54b07;} -.cm-s-mbo span.cm-error {border-bottom: #636363; color: #ffffec;} -.cm-s-mbo span.cm-qualifier {color: #ffffec;} - -.cm-s-mbo .CodeMirror-activeline-background {background: #494b41 !important;} -.cm-s-mbo .CodeMirror-matchingbracket {color: #222 !important;} -.cm-s-mbo .CodeMirror-matchingtag {background: rgba(255, 255, 255, .37);} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/mdn-like.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/mdn-like.css deleted file mode 100644 index 93293c0..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/mdn-like.css +++ /dev/null @@ -1,46 +0,0 @@ -/* - MDN-LIKE Theme - Mozilla - Ported to CodeMirror by Peter Kroon - Report bugs/issues here: https://github.com/codemirror/CodeMirror/issues - GitHub: @peterkroon - - The mdn-like theme is inspired on the displayed code examples at: https://developer.mozilla.org/en-US/docs/Web/CSS/animation - -*/ -.cm-s-mdn-like.CodeMirror { color: #999; background-color: #fff; } -.cm-s-mdn-like .CodeMirror-selected { background: #cfc !important; } -.cm-s-mdn-like.CodeMirror ::selection { background: #cfc; } -.cm-s-mdn-like.CodeMirror ::-moz-selection { background: #cfc; } - -.cm-s-mdn-like .CodeMirror-gutters { background: #f8f8f8; border-left: 6px solid rgba(0,83,159,0.65); color: #333; } -.cm-s-mdn-like .CodeMirror-linenumber { color: #aaa; margin-left: 3px; } -div.cm-s-mdn-like .CodeMirror-cursor { border-left: 2px solid #222; } - -.cm-s-mdn-like .cm-keyword { color: #6262FF; } -.cm-s-mdn-like .cm-atom { color: #F90; } -.cm-s-mdn-like .cm-number { color: #ca7841; } -.cm-s-mdn-like .cm-def { color: #8DA6CE; } -.cm-s-mdn-like span.cm-variable-2, .cm-s-mdn-like span.cm-tag { color: #690; } -.cm-s-mdn-like span.cm-variable-3, .cm-s-mdn-like span.cm-def { color: #07a; } - -.cm-s-mdn-like .cm-variable { color: #07a; } -.cm-s-mdn-like .cm-property { color: #905; } -.cm-s-mdn-like .cm-qualifier { color: #690; } - -.cm-s-mdn-like .cm-operator { color: #cda869; } -.cm-s-mdn-like .cm-comment { color:#777; font-weight:normal; } -.cm-s-mdn-like .cm-string { color:#07a; font-style:italic; } -.cm-s-mdn-like .cm-string-2 { color:#bd6b18; } /*?*/ -.cm-s-mdn-like .cm-meta { color: #000; } /*?*/ -.cm-s-mdn-like .cm-builtin { color: #9B7536; } /*?*/ -.cm-s-mdn-like .cm-tag { color: #997643; } -.cm-s-mdn-like .cm-attribute { color: #d6bb6d; } /*?*/ -.cm-s-mdn-like .cm-header { color: #FF6400; } -.cm-s-mdn-like .cm-hr { color: #AEAEAE; } -.cm-s-mdn-like .cm-link { color:#ad9361; font-style:italic; text-decoration:none; } -.cm-s-mdn-like .cm-error { border-bottom: 1px solid red; } - -div.cm-s-mdn-like .CodeMirror-activeline-background {background: #efefff;} -div.cm-s-mdn-like span.CodeMirror-matchingbracket {outline:1px solid grey; color: inherit;} - -.cm-s-mdn-like.CodeMirror { background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFcAAAAyCAYAAAAp8UeFAAAHvklEQVR42s2b63bcNgyEQZCSHCdt2vd/0tWF7I+Q6XgMXiTtuvU5Pl57ZQKkKHzEAOtF5KeIJBGJ8uvL599FRFREZhFx8DeXv8trn68RuGaC8TRfo3SNp9dlDDHedyLyTUTeRWStXKPZrjtpZxaRw5hPqozRs1N8/enzIiQRWcCgy4MUA0f+XWliDhyL8Lfyvx7ei/Ae3iQFHyw7U/59pQVIMEEPEz0G7XiwdRjzSfC3UTtz9vchIntxvry5iMgfIhJoEflOz2CQr3F5h/HfeFe+GTdLaKcu9L8LTeQb/R/7GgbsfKedyNdoHsN31uRPWrfZ5wsj/NzzRQHuToIdU3ahwnsKPxXCjJITuOsi7XLc7SG/v5GdALs7wf8JjTFiB5+QvTEfRyGOfX3Lrx8wxyQi3sNq46O7QahQiCsRFgqddjBouVEHOKDgXAQHD9gJCr5sMKkEdjwsarG/ww3BMHBU7OBjXnzdyY7SfCxf5/z6ATccrwlKuwC/jhznnPF4CgVzhhVf4xp2EixcBActO75iZ8/fM9zAs2OMzKdslgXWJ9XG8PQoOAMA5fGcsvORgv0doBXyHrCwfLJAOwo71QLNkb8n2Pl6EWiR7OCibtkPaz4Kc/0NNAze2gju3zOwekALDaCFPI5vjPFmgGY5AZqyGEvH1x7QfIb8YtxMnA/b+QQ0aQDAwc6JMFg8CbQZ4qoYEEHbRwNojuK3EHwd7VALSgq+MNDKzfT58T8qdpADrgW0GmgcAS1lhzztJmkAzcPNOQbsWEALBDSlMKUG0Eq4CLAQWvEVQ9WU57gZJwZtgPO3r9oBTQ9WO8TjqXINx8R0EYpiZEUWOF3FxkbJkgU9B2f41YBrIj5ZfsQa0M5kTgiAAqM3ShXLgu8XMqcrQBvJ0CL5pnTsfMB13oB8athpAq2XOQmcGmoACCLydx7nToa23ATaSIY2ichfOdPTGxlasXMLaL0MLZAOwAKIM+y8CmicobGdCcbbK9DzN+yYGVoNNI5iUKTMyYOjPse4A8SM1MmcXgU0toOq1yO/v8FOxlASyc7TgeYaAMBJHcY1CcCwGI/TK4AmDbDyKYBBtFUkRwto8gygiQEaByFgJ00BH2M8JWwQS1nafDXQCidWyOI8AcjDCSjCLk8ngObuAm3JAHAdubAmOaK06V8MNEsKPJOhobSprwQa6gD7DclRQdqcwL4zxqgBrQcabUiBLclRDKAlWp+etPkBaNMA0AKlrHwTdEByZAA4GM+SNluSY6wAzcMNewxmgig5Ks0nkrSpBvSaQHMdKTBAnLojOdYyGpQ254602ZILPdTD1hdlggdIm74jbTp8vDwF5ZYUeLWGJpWsh6XNyXgcYwVoJQTEhhTYkxzZjiU5npU2TaB979TQehlaAVq4kaGpiPwwwLkYUuBbQwocyQTv1tA0+1UFWoJF3iv1oq+qoSk8EQdJmwHkziIF7oOZk14EGitibAdjLYYK78H5vZOhtWpoI0ATGHs0Q8OMb4Ey+2bU2UYztCtA0wFAs7TplGLRVQCcqaFdGSPCeTI1QNIC52iWNzof6Uib7xjEp07mNNoUYmVosVItHrHzRlLgBn9LFyRHaQCtVUMbtTNhoXWiTOO9k/V8BdAc1Oq0ArSQs6/5SU0hckNy9NnXqQY0PGYo5dWJ7nINaN6o958FWin27aBaWRka1r5myvLOAm0j30eBJqCxHLReVclxhxOEN2JfDWjxBtAC7MIH1fVaGdoOp4qJYDgKtKPSFNID2gSnGldrCqkFZ+5UeQXQBIRrSwocbdZYQT/2LwRahBPBXoHrB8nxaGROST62DKUbQOMMzZIC9abkuELfQzQALWTnDNAm8KHWFOJgJ5+SHIvTPcmx1xQyZRhNL5Qci689aXMEaN/uNIWkEwDAvFpOZmgsBaaGnbs1NPa1Jm32gBZAIh1pCtG7TSH4aE0y1uVY4uqoFPisGlpP2rSA5qTecWn5agK6BzSpgAyD+wFaqhnYoSZ1Vwr8CmlTQbrcO3ZaX0NAEyMbYaAlyquFoLKK3SPby9CeVUPThrSJmkCAE0CrKUQadi4DrdSlWhmah0YL9z9vClH59YGbHx1J8VZTyAjQepJjmXwAKTDQI3omc3p1U4gDUf6RfcdYfrUp5ClAi2J3Ba6UOXGo+K+bQrjjssitG2SJzshaLwMtXgRagUNpYYoVkMSBLM+9GGiJZMvduG6DRZ4qc04DMPtQQxOjEtACmhO7K1AbNbQDEggZyJwscFpAGwENhoBeUwh3bWolhe8BTYVKxQEWrSUn/uhcM5KhvUu/+eQu0Lzhi+VrK0PrZZNDQKs9cpYUuFYgMVpD4/NxenJTiMCNqdUEUf1qZWjppLT5qSkkUZbCwkbZMSuVnu80hfSkzRbQeqCZSAh6huR4VtoM2gHAlLf72smuWgE+VV7XpE25Ab2WFDgyhnSuKbs4GuGzCjR+tIoUuMFg3kgcWKLTwRqanJQ2W00hAsenfaApRC42hbCvK1SlE0HtE9BGgneJO+ELamitD1YjjOYnNYVcraGhtKkW0EqVVeDx733I2NH581k1NNxNLG0i0IJ8/NjVaOZ0tYZ2Vtr0Xv7tPV3hkWp9EFkgS/J0vosngTaSoaG06WHi+xObQkaAdlbanP8B2+2l0f90LmUAAAAASUVORK5CYII=); } diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/midnight.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/midnight.css deleted file mode 100644 index 296af4f..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/midnight.css +++ /dev/null @@ -1,47 +0,0 @@ -/* Based on the theme at http://bonsaiden.github.com/JavaScript-Garden */ - -/**/ -.cm-s-midnight span.CodeMirror-matchhighlight { background: #494949; } -.cm-s-midnight.CodeMirror-focused span.CodeMirror-matchhighlight { background: #314D67 !important; } - -/**/ -.cm-s-midnight .CodeMirror-activeline-background {background: #253540 !important;} - -.cm-s-midnight.CodeMirror { - background: #0F192A; - color: #D1EDFF; -} - -.cm-s-midnight.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;} - -.cm-s-midnight div.CodeMirror-selected {background: #314D67 !important;} -.cm-s-midnight.CodeMirror ::selection { background: rgba(49, 77, 103, .99); } -.cm-s-midnight.CodeMirror ::-moz-selection { background: rgba(49, 77, 103, .99); } -.cm-s-midnight .CodeMirror-gutters {background: #0F192A; border-right: 1px solid;} -.cm-s-midnight .CodeMirror-guttermarker { color: white; } -.cm-s-midnight .CodeMirror-guttermarker-subtle { color: #d0d0d0; } -.cm-s-midnight .CodeMirror-linenumber {color: #D0D0D0;} -.cm-s-midnight .CodeMirror-cursor { - border-left: 1px solid #F8F8F0 !important; -} - -.cm-s-midnight span.cm-comment {color: #428BDD;} -.cm-s-midnight span.cm-atom {color: #AE81FF;} -.cm-s-midnight span.cm-number {color: #D1EDFF;} - -.cm-s-midnight span.cm-property, .cm-s-midnight span.cm-attribute {color: #A6E22E;} -.cm-s-midnight span.cm-keyword {color: #E83737;} -.cm-s-midnight span.cm-string {color: #1DC116;} - -.cm-s-midnight span.cm-variable {color: #FFAA3E;} -.cm-s-midnight span.cm-variable-2 {color: #FFAA3E;} -.cm-s-midnight span.cm-def {color: #4DD;} -.cm-s-midnight span.cm-bracket {color: #D1EDFF;} -.cm-s-midnight span.cm-tag {color: #449;} -.cm-s-midnight span.cm-link {color: #AE81FF;} -.cm-s-midnight span.cm-error {background: #F92672; color: #F8F8F0;} - -.cm-s-midnight .CodeMirror-matchingbracket { - text-decoration: underline; - color: white !important; -} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/monokai.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/monokai.css deleted file mode 100644 index 6dfcc73..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/monokai.css +++ /dev/null @@ -1,33 +0,0 @@ -/* Based on Sublime Text's Monokai theme */ - -.cm-s-monokai.CodeMirror {background: #272822; color: #f8f8f2;} -.cm-s-monokai div.CodeMirror-selected {background: #49483E !important;} -.cm-s-monokai.CodeMirror ::selection { background: rgba(73, 72, 62, .99); } -.cm-s-monokai.CodeMirror ::-moz-selection { background: rgba(73, 72, 62, .99); } -.cm-s-monokai .CodeMirror-gutters {background: #272822; border-right: 0px;} -.cm-s-monokai .CodeMirror-guttermarker { color: white; } -.cm-s-monokai .CodeMirror-guttermarker-subtle { color: #d0d0d0; } -.cm-s-monokai .CodeMirror-linenumber {color: #d0d0d0;} -.cm-s-monokai .CodeMirror-cursor {border-left: 1px solid #f8f8f0 !important;} - -.cm-s-monokai span.cm-comment {color: #75715e;} -.cm-s-monokai span.cm-atom {color: #ae81ff;} -.cm-s-monokai span.cm-number {color: #ae81ff;} - -.cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute {color: #a6e22e;} -.cm-s-monokai span.cm-keyword {color: #f92672;} -.cm-s-monokai span.cm-string {color: #e6db74;} - -.cm-s-monokai span.cm-variable {color: #a6e22e;} -.cm-s-monokai span.cm-variable-2 {color: #9effff;} -.cm-s-monokai span.cm-def {color: #fd971f;} -.cm-s-monokai span.cm-bracket {color: #f8f8f2;} -.cm-s-monokai span.cm-tag {color: #f92672;} -.cm-s-monokai span.cm-link {color: #ae81ff;} -.cm-s-monokai span.cm-error {background: #f92672; color: #f8f8f0;} - -.cm-s-monokai .CodeMirror-activeline-background {background: #373831 !important;} -.cm-s-monokai .CodeMirror-matchingbracket { - text-decoration: underline; - color: white !important; -} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/neat.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/neat.css deleted file mode 100644 index 115083b..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/neat.css +++ /dev/null @@ -1,12 +0,0 @@ -.cm-s-neat span.cm-comment { color: #a86; } -.cm-s-neat span.cm-keyword { line-height: 1em; font-weight: bold; color: blue; } -.cm-s-neat span.cm-string { color: #a22; } -.cm-s-neat span.cm-builtin { line-height: 1em; font-weight: bold; color: #077; } -.cm-s-neat span.cm-special { line-height: 1em; font-weight: bold; color: #0aa; } -.cm-s-neat span.cm-variable { color: black; } -.cm-s-neat span.cm-number, .cm-s-neat span.cm-atom { color: #3a3; } -.cm-s-neat span.cm-meta {color: #555;} -.cm-s-neat span.cm-link { color: #3a3; } - -.cm-s-neat .CodeMirror-activeline-background {background: #e8f2ff !important;} -.cm-s-neat .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/neo.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/neo.css deleted file mode 100644 index cecaaf2..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/neo.css +++ /dev/null @@ -1,43 +0,0 @@ -/* neo theme for codemirror */ - -/* Color scheme */ - -.cm-s-neo.CodeMirror { - background-color:#ffffff; - color:#2e383c; - line-height:1.4375; -} -.cm-s-neo .cm-comment {color:#75787b} -.cm-s-neo .cm-keyword, .cm-s-neo .cm-property {color:#1d75b3} -.cm-s-neo .cm-atom,.cm-s-neo .cm-number {color:#75438a} -.cm-s-neo .cm-node,.cm-s-neo .cm-tag {color:#9c3328} -.cm-s-neo .cm-string {color:#b35e14} -.cm-s-neo .cm-variable,.cm-s-neo .cm-qualifier {color:#047d65} - - -/* Editor styling */ - -.cm-s-neo pre { - padding:0; -} - -.cm-s-neo .CodeMirror-gutters { - border:none; - border-right:10px solid transparent; - background-color:transparent; -} - -.cm-s-neo .CodeMirror-linenumber { - padding:0; - color:#e0e2e5; -} - -.cm-s-neo .CodeMirror-guttermarker { color: #1d75b3; } -.cm-s-neo .CodeMirror-guttermarker-subtle { color: #e0e2e5; } - -.cm-s-neo div.CodeMirror-cursor { - width: auto; - border: 0; - background: rgba(155,157,162,0.37); - z-index: 1; -} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/night.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/night.css deleted file mode 100644 index 6b2ac6c..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/night.css +++ /dev/null @@ -1,28 +0,0 @@ -/* Loosely based on the Midnight Textmate theme */ - -.cm-s-night.CodeMirror { background: #0a001f; color: #f8f8f8; } -.cm-s-night div.CodeMirror-selected { background: #447 !important; } -.cm-s-night.CodeMirror ::selection { background: rgba(68, 68, 119, .99); } -.cm-s-night.CodeMirror ::-moz-selection { background: rgba(68, 68, 119, .99); } -.cm-s-night .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; } -.cm-s-night .CodeMirror-guttermarker { color: white; } -.cm-s-night .CodeMirror-guttermarker-subtle { color: #bbb; } -.cm-s-night .CodeMirror-linenumber { color: #f8f8f8; } -.cm-s-night .CodeMirror-cursor { border-left: 1px solid white !important; } - -.cm-s-night span.cm-comment { color: #6900a1; } -.cm-s-night span.cm-atom { color: #845dc4; } -.cm-s-night span.cm-number, .cm-s-night span.cm-attribute { color: #ffd500; } -.cm-s-night span.cm-keyword { color: #599eff; } -.cm-s-night span.cm-string { color: #37f14a; } -.cm-s-night span.cm-meta { color: #7678e2; } -.cm-s-night span.cm-variable-2, .cm-s-night span.cm-tag { color: #99b2ff; } -.cm-s-night span.cm-variable-3, .cm-s-night span.cm-def { color: white; } -.cm-s-night span.cm-bracket { color: #8da6ce; } -.cm-s-night span.cm-comment { color: #6900a1; } -.cm-s-night span.cm-builtin, .cm-s-night span.cm-special { color: #ff9e59; } -.cm-s-night span.cm-link { color: #845dc4; } -.cm-s-night span.cm-error { color: #9d1e15; } - -.cm-s-night .CodeMirror-activeline-background {background: #1C005A !important;} -.cm-s-night .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/paraiso-dark.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/paraiso-dark.css deleted file mode 100644 index af914b6..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/paraiso-dark.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - - Name: Paraíso (Dark) - Author: Jan T. Sott - - Color scheme by Jan T. Sott (https://github.com/idleberg/Paraiso-CodeMirror) - Inspired by the art of Rubens LP (http://www.rubenslp.com.br) - -*/ - -.cm-s-paraiso-dark.CodeMirror {background: #2f1e2e; color: #b9b6b0;} -.cm-s-paraiso-dark div.CodeMirror-selected {background: #41323f !important;} -.cm-s-paraiso-dark.CodeMirror ::selection { background: rgba(65, 50, 63, .99); } -.cm-s-paraiso-dark.CodeMirror ::-moz-selection { background: rgba(65, 50, 63, .99); } -.cm-s-paraiso-dark .CodeMirror-gutters {background: #2f1e2e; border-right: 0px;} -.cm-s-paraiso-dark .CodeMirror-guttermarker { color: #ef6155; } -.cm-s-paraiso-dark .CodeMirror-guttermarker-subtle { color: #776e71; } -.cm-s-paraiso-dark .CodeMirror-linenumber {color: #776e71;} -.cm-s-paraiso-dark .CodeMirror-cursor {border-left: 1px solid #8d8687 !important;} - -.cm-s-paraiso-dark span.cm-comment {color: #e96ba8;} -.cm-s-paraiso-dark span.cm-atom {color: #815ba4;} -.cm-s-paraiso-dark span.cm-number {color: #815ba4;} - -.cm-s-paraiso-dark span.cm-property, .cm-s-paraiso-dark span.cm-attribute {color: #48b685;} -.cm-s-paraiso-dark span.cm-keyword {color: #ef6155;} -.cm-s-paraiso-dark span.cm-string {color: #fec418;} - -.cm-s-paraiso-dark span.cm-variable {color: #48b685;} -.cm-s-paraiso-dark span.cm-variable-2 {color: #06b6ef;} -.cm-s-paraiso-dark span.cm-def {color: #f99b15;} -.cm-s-paraiso-dark span.cm-bracket {color: #b9b6b0;} -.cm-s-paraiso-dark span.cm-tag {color: #ef6155;} -.cm-s-paraiso-dark span.cm-link {color: #815ba4;} -.cm-s-paraiso-dark span.cm-error {background: #ef6155; color: #8d8687;} - -.cm-s-paraiso-dark .CodeMirror-activeline-background {background: #4D344A !important;} -.cm-s-paraiso-dark .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/paraiso-light.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/paraiso-light.css deleted file mode 100644 index e198066..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/paraiso-light.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - - Name: Paraíso (Light) - Author: Jan T. Sott - - Color scheme by Jan T. Sott (https://github.com/idleberg/Paraiso-CodeMirror) - Inspired by the art of Rubens LP (http://www.rubenslp.com.br) - -*/ - -.cm-s-paraiso-light.CodeMirror {background: #e7e9db; color: #41323f;} -.cm-s-paraiso-light div.CodeMirror-selected {background: #b9b6b0 !important;} -.cm-s-paraiso-light.CodeMirror ::selection { background: #b9b6b0; } -.cm-s-paraiso-light.CodeMirror ::-moz-selection { background: #b9b6b0; } -.cm-s-paraiso-light .CodeMirror-gutters {background: #e7e9db; border-right: 0px;} -.cm-s-paraiso-light .CodeMirror-guttermarker { color: black; } -.cm-s-paraiso-light .CodeMirror-guttermarker-subtle { color: #8d8687; } -.cm-s-paraiso-light .CodeMirror-linenumber {color: #8d8687;} -.cm-s-paraiso-light .CodeMirror-cursor {border-left: 1px solid #776e71 !important;} - -.cm-s-paraiso-light span.cm-comment {color: #e96ba8;} -.cm-s-paraiso-light span.cm-atom {color: #815ba4;} -.cm-s-paraiso-light span.cm-number {color: #815ba4;} - -.cm-s-paraiso-light span.cm-property, .cm-s-paraiso-light span.cm-attribute {color: #48b685;} -.cm-s-paraiso-light span.cm-keyword {color: #ef6155;} -.cm-s-paraiso-light span.cm-string {color: #fec418;} - -.cm-s-paraiso-light span.cm-variable {color: #48b685;} -.cm-s-paraiso-light span.cm-variable-2 {color: #06b6ef;} -.cm-s-paraiso-light span.cm-def {color: #f99b15;} -.cm-s-paraiso-light span.cm-bracket {color: #41323f;} -.cm-s-paraiso-light span.cm-tag {color: #ef6155;} -.cm-s-paraiso-light span.cm-link {color: #815ba4;} -.cm-s-paraiso-light span.cm-error {background: #ef6155; color: #776e71;} - -.cm-s-paraiso-light .CodeMirror-activeline-background {background: #CFD1C4 !important;} -.cm-s-paraiso-light .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/pastel-on-dark.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/pastel-on-dark.css deleted file mode 100644 index 0d06f63..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/pastel-on-dark.css +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Pastel On Dark theme ported from ACE editor - * @license MIT - * @copyright AtomicPages LLC 2014 - * @author Dennis Thompson, AtomicPages LLC - * @version 1.1 - * @source https://github.com/atomicpages/codemirror-pastel-on-dark-theme - */ - -.cm-s-pastel-on-dark.CodeMirror { - background: #2c2827; - color: #8F938F; - line-height: 1.5; - font-size: 14px; -} -.cm-s-pastel-on-dark div.CodeMirror-selected { background: rgba(221,240,255,0.2) !important; } -.cm-s-pastel-on-dark.CodeMirror ::selection { background: rgba(221,240,255,0.2); } -.cm-s-pastel-on-dark.CodeMirror ::-moz-selection { background: rgba(221,240,255,0.2); } - -.cm-s-pastel-on-dark .CodeMirror-gutters { - background: #34302f; - border-right: 0px; - padding: 0 3px; -} -.cm-s-pastel-on-dark .CodeMirror-guttermarker { color: white; } -.cm-s-pastel-on-dark .CodeMirror-guttermarker-subtle { color: #8F938F; } -.cm-s-pastel-on-dark .CodeMirror-linenumber { color: #8F938F; } -.cm-s-pastel-on-dark .CodeMirror-cursor { border-left: 1px solid #A7A7A7 !important; } -.cm-s-pastel-on-dark span.cm-comment { color: #A6C6FF; } -.cm-s-pastel-on-dark span.cm-atom { color: #DE8E30; } -.cm-s-pastel-on-dark span.cm-number { color: #CCCCCC; } -.cm-s-pastel-on-dark span.cm-property { color: #8F938F; } -.cm-s-pastel-on-dark span.cm-attribute { color: #a6e22e; } -.cm-s-pastel-on-dark span.cm-keyword { color: #AEB2F8; } -.cm-s-pastel-on-dark span.cm-string { color: #66A968; } -.cm-s-pastel-on-dark span.cm-variable { color: #AEB2F8; } -.cm-s-pastel-on-dark span.cm-variable-2 { color: #BEBF55; } -.cm-s-pastel-on-dark span.cm-variable-3 { color: #DE8E30; } -.cm-s-pastel-on-dark span.cm-def { color: #757aD8; } -.cm-s-pastel-on-dark span.cm-bracket { color: #f8f8f2; } -.cm-s-pastel-on-dark span.cm-tag { color: #C1C144; } -.cm-s-pastel-on-dark span.cm-link { color: #ae81ff; } -.cm-s-pastel-on-dark span.cm-qualifier,.cm-s-pastel-on-dark span.cm-builtin { color: #C1C144; } -.cm-s-pastel-on-dark span.cm-error { - background: #757aD8; - color: #f8f8f0; -} -.cm-s-pastel-on-dark .CodeMirror-activeline-background { background: rgba(255, 255, 255, 0.031) !important; } -.cm-s-pastel-on-dark .CodeMirror-matchingbracket { - border: 1px solid rgba(255,255,255,0.25); - color: #8F938F !important; - margin: -1px -1px 0 -1px; -} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/rubyblue.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/rubyblue.css deleted file mode 100644 index d2fc0ec..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/rubyblue.css +++ /dev/null @@ -1,25 +0,0 @@ -.cm-s-rubyblue.CodeMirror { background: #112435; color: white; } -.cm-s-rubyblue div.CodeMirror-selected { background: #38566F !important; } -.cm-s-rubyblue.CodeMirror ::selection { background: rgba(56, 86, 111, 0.99); } -.cm-s-rubyblue.CodeMirror ::-moz-selection { background: rgba(56, 86, 111, 0.99); } -.cm-s-rubyblue .CodeMirror-gutters { background: #1F4661; border-right: 7px solid #3E7087; } -.cm-s-rubyblue .CodeMirror-guttermarker { color: white; } -.cm-s-rubyblue .CodeMirror-guttermarker-subtle { color: #3E7087; } -.cm-s-rubyblue .CodeMirror-linenumber { color: white; } -.cm-s-rubyblue .CodeMirror-cursor { border-left: 1px solid white !important; } - -.cm-s-rubyblue span.cm-comment { color: #999; font-style:italic; line-height: 1em; } -.cm-s-rubyblue span.cm-atom { color: #F4C20B; } -.cm-s-rubyblue span.cm-number, .cm-s-rubyblue span.cm-attribute { color: #82C6E0; } -.cm-s-rubyblue span.cm-keyword { color: #F0F; } -.cm-s-rubyblue span.cm-string { color: #F08047; } -.cm-s-rubyblue span.cm-meta { color: #F0F; } -.cm-s-rubyblue span.cm-variable-2, .cm-s-rubyblue span.cm-tag { color: #7BD827; } -.cm-s-rubyblue span.cm-variable-3, .cm-s-rubyblue span.cm-def { color: white; } -.cm-s-rubyblue span.cm-bracket { color: #F0F; } -.cm-s-rubyblue span.cm-link { color: #F4C20B; } -.cm-s-rubyblue span.CodeMirror-matchingbracket { color:#F0F !important; } -.cm-s-rubyblue span.cm-builtin, .cm-s-rubyblue span.cm-special { color: #FF9D00; } -.cm-s-rubyblue span.cm-error { color: #AF2018; } - -.cm-s-rubyblue .CodeMirror-activeline-background {background: #173047 !important;} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/solarized.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/solarized.css deleted file mode 100644 index 4a10b7c..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/solarized.css +++ /dev/null @@ -1,165 +0,0 @@ -/* -Solarized theme for code-mirror -http://ethanschoonover.com/solarized -*/ - -/* -Solarized color pallet -http://ethanschoonover.com/solarized/img/solarized-palette.png -*/ - -.solarized.base03 { color: #002b36; } -.solarized.base02 { color: #073642; } -.solarized.base01 { color: #586e75; } -.solarized.base00 { color: #657b83; } -.solarized.base0 { color: #839496; } -.solarized.base1 { color: #93a1a1; } -.solarized.base2 { color: #eee8d5; } -.solarized.base3 { color: #fdf6e3; } -.solarized.solar-yellow { color: #b58900; } -.solarized.solar-orange { color: #cb4b16; } -.solarized.solar-red { color: #dc322f; } -.solarized.solar-magenta { color: #d33682; } -.solarized.solar-violet { color: #6c71c4; } -.solarized.solar-blue { color: #268bd2; } -.solarized.solar-cyan { color: #2aa198; } -.solarized.solar-green { color: #859900; } - -/* Color scheme for code-mirror */ - -.cm-s-solarized { - line-height: 1.45em; - color-profile: sRGB; - rendering-intent: auto; -} -.cm-s-solarized.cm-s-dark { - color: #839496; - background-color: #002b36; - text-shadow: #002b36 0 1px; -} -.cm-s-solarized.cm-s-light { - background-color: #fdf6e3; - color: #657b83; - text-shadow: #eee8d5 0 1px; -} - -.cm-s-solarized .CodeMirror-widget { - text-shadow: none; -} - - -.cm-s-solarized .cm-keyword { color: #cb4b16 } -.cm-s-solarized .cm-atom { color: #d33682; } -.cm-s-solarized .cm-number { color: #d33682; } -.cm-s-solarized .cm-def { color: #2aa198; } - -.cm-s-solarized .cm-variable { color: #268bd2; } -.cm-s-solarized .cm-variable-2 { color: #b58900; } -.cm-s-solarized .cm-variable-3 { color: #6c71c4; } - -.cm-s-solarized .cm-property { color: #2aa198; } -.cm-s-solarized .cm-operator {color: #6c71c4;} - -.cm-s-solarized .cm-comment { color: #586e75; font-style:italic; } - -.cm-s-solarized .cm-string { color: #859900; } -.cm-s-solarized .cm-string-2 { color: #b58900; } - -.cm-s-solarized .cm-meta { color: #859900; } -.cm-s-solarized .cm-qualifier { color: #b58900; } -.cm-s-solarized .cm-builtin { color: #d33682; } -.cm-s-solarized .cm-bracket { color: #cb4b16; } -.cm-s-solarized .CodeMirror-matchingbracket { color: #859900; } -.cm-s-solarized .CodeMirror-nonmatchingbracket { color: #dc322f; } -.cm-s-solarized .cm-tag { color: #93a1a1 } -.cm-s-solarized .cm-attribute { color: #2aa198; } -.cm-s-solarized .cm-header { color: #586e75; } -.cm-s-solarized .cm-quote { color: #93a1a1; } -.cm-s-solarized .cm-hr { - color: transparent; - border-top: 1px solid #586e75; - display: block; -} -.cm-s-solarized .cm-link { color: #93a1a1; cursor: pointer; } -.cm-s-solarized .cm-special { color: #6c71c4; } -.cm-s-solarized .cm-em { - color: #999; - text-decoration: underline; - text-decoration-style: dotted; -} -.cm-s-solarized .cm-strong { color: #eee; } -.cm-s-solarized .cm-error, -.cm-s-solarized .cm-invalidchar { - color: #586e75; - border-bottom: 1px dotted #dc322f; -} - -.cm-s-solarized.cm-s-dark .CodeMirror-selected { background: #073642; } -.cm-s-solarized.cm-s-dark.CodeMirror ::selection { background: rgba(7, 54, 66, 0.99); } -.cm-s-solarized.cm-s-dark.CodeMirror ::-moz-selection { background: rgba(7, 54, 66, 0.99); } - -.cm-s-solarized.cm-s-light .CodeMirror-selected { background: #eee8d5; } -.cm-s-solarized.cm-s-light.CodeMirror ::selection { background: #eee8d5; } -.cm-s-solarized.cm-s-lightCodeMirror ::-moz-selection { background: #eee8d5; } - -/* Editor styling */ - - - -/* Little shadow on the view-port of the buffer view */ -.cm-s-solarized.CodeMirror { - -moz-box-shadow: inset 7px 0 12px -6px #000; - -webkit-box-shadow: inset 7px 0 12px -6px #000; - box-shadow: inset 7px 0 12px -6px #000; -} - -/* Gutter border and some shadow from it */ -.cm-s-solarized .CodeMirror-gutters { - border-right: 1px solid; -} - -/* Gutter colors and line number styling based of color scheme (dark / light) */ - -/* Dark */ -.cm-s-solarized.cm-s-dark .CodeMirror-gutters { - background-color: #002b36; - border-color: #00232c; -} - -.cm-s-solarized.cm-s-dark .CodeMirror-linenumber { - text-shadow: #021014 0 -1px; -} - -/* Light */ -.cm-s-solarized.cm-s-light .CodeMirror-gutters { - background-color: #fdf6e3; - border-color: #eee8d5; -} - -/* Common */ -.cm-s-solarized .CodeMirror-linenumber { - color: #586e75; - padding: 0 5px; -} -.cm-s-solarized .CodeMirror-guttermarker-subtle { color: #586e75; } -.cm-s-solarized.cm-s-dark .CodeMirror-guttermarker { color: #ddd; } -.cm-s-solarized.cm-s-light .CodeMirror-guttermarker { color: #cb4b16; } - -.cm-s-solarized .CodeMirror-gutter .CodeMirror-gutter-text { - color: #586e75; -} - -.cm-s-solarized .CodeMirror-lines .CodeMirror-cursor { - border-left: 1px solid #819090; -} - -/* -Active line. Negative margin compensates left padding of the text in the -view-port -*/ -.cm-s-solarized.cm-s-dark .CodeMirror-activeline-background { - background: rgba(255, 255, 255, 0.10); -} -.cm-s-solarized.cm-s-light .CodeMirror-activeline-background { - background: rgba(0, 0, 0, 0.10); -} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/the-matrix.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/the-matrix.css deleted file mode 100644 index f29b22b..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/the-matrix.css +++ /dev/null @@ -1,30 +0,0 @@ -.cm-s-the-matrix.CodeMirror { background: #000000; color: #00FF00; } -.cm-s-the-matrix div.CodeMirror-selected { background: #2D2D2D !important; } -.cm-s-the-matrix.CodeMirror ::selection { background: rgba(45, 45, 45, 0.99); } -.cm-s-the-matrix.CodeMirror ::-moz-selection { background: rgba(45, 45, 45, 0.99); } -.cm-s-the-matrix .CodeMirror-gutters { background: #060; border-right: 2px solid #00FF00; } -.cm-s-the-matrix .CodeMirror-guttermarker { color: #0f0; } -.cm-s-the-matrix .CodeMirror-guttermarker-subtle { color: white; } -.cm-s-the-matrix .CodeMirror-linenumber { color: #FFFFFF; } -.cm-s-the-matrix .CodeMirror-cursor { border-left: 1px solid #00FF00 !important; } - -.cm-s-the-matrix span.cm-keyword {color: #008803; font-weight: bold;} -.cm-s-the-matrix span.cm-atom {color: #3FF;} -.cm-s-the-matrix span.cm-number {color: #FFB94F;} -.cm-s-the-matrix span.cm-def {color: #99C;} -.cm-s-the-matrix span.cm-variable {color: #F6C;} -.cm-s-the-matrix span.cm-variable-2 {color: #C6F;} -.cm-s-the-matrix span.cm-variable-3 {color: #96F;} -.cm-s-the-matrix span.cm-property {color: #62FFA0;} -.cm-s-the-matrix span.cm-operator {color: #999} -.cm-s-the-matrix span.cm-comment {color: #CCCCCC;} -.cm-s-the-matrix span.cm-string {color: #39C;} -.cm-s-the-matrix span.cm-meta {color: #C9F;} -.cm-s-the-matrix span.cm-qualifier {color: #FFF700;} -.cm-s-the-matrix span.cm-builtin {color: #30a;} -.cm-s-the-matrix span.cm-bracket {color: #cc7;} -.cm-s-the-matrix span.cm-tag {color: #FFBD40;} -.cm-s-the-matrix span.cm-attribute {color: #FFF700;} -.cm-s-the-matrix span.cm-error {color: #FF0000;} - -.cm-s-the-matrix .CodeMirror-activeline-background {background: #040;} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/tomorrow-night-bright.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/tomorrow-night-bright.css deleted file mode 100644 index decb82d..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/tomorrow-night-bright.css +++ /dev/null @@ -1,35 +0,0 @@ -/* - - Name: Tomorrow Night - Bright - Author: Chris Kempson - - Port done by Gerard Braad - -*/ - -.cm-s-tomorrow-night-bright.CodeMirror {background: #000000; color: #eaeaea;} -.cm-s-tomorrow-night-bright div.CodeMirror-selected {background: #424242 !important;} -.cm-s-tomorrow-night-bright .CodeMirror-gutters {background: #000000; border-right: 0px;} -.cm-s-tomorrow-night-bright .CodeMirror-guttermarker { color: #e78c45; } -.cm-s-tomorrow-night-bright .CodeMirror-guttermarker-subtle { color: #777; } -.cm-s-tomorrow-night-bright .CodeMirror-linenumber {color: #424242;} -.cm-s-tomorrow-night-bright .CodeMirror-cursor {border-left: 1px solid #6A6A6A !important;} - -.cm-s-tomorrow-night-bright span.cm-comment {color: #d27b53;} -.cm-s-tomorrow-night-bright span.cm-atom {color: #a16a94;} -.cm-s-tomorrow-night-bright span.cm-number {color: #a16a94;} - -.cm-s-tomorrow-night-bright span.cm-property, .cm-s-tomorrow-night-bright span.cm-attribute {color: #99cc99;} -.cm-s-tomorrow-night-bright span.cm-keyword {color: #d54e53;} -.cm-s-tomorrow-night-bright span.cm-string {color: #e7c547;} - -.cm-s-tomorrow-night-bright span.cm-variable {color: #b9ca4a;} -.cm-s-tomorrow-night-bright span.cm-variable-2 {color: #7aa6da;} -.cm-s-tomorrow-night-bright span.cm-def {color: #e78c45;} -.cm-s-tomorrow-night-bright span.cm-bracket {color: #eaeaea;} -.cm-s-tomorrow-night-bright span.cm-tag {color: #d54e53;} -.cm-s-tomorrow-night-bright span.cm-link {color: #a16a94;} -.cm-s-tomorrow-night-bright span.cm-error {background: #d54e53; color: #6A6A6A;} - -.cm-s-tomorrow-night-bright .CodeMirror-activeline-background {background: #2a2a2a !important;} -.cm-s-tomorrow-night-bright .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/tomorrow-night-eighties.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/tomorrow-night-eighties.css deleted file mode 100644 index 5fca3ca..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/tomorrow-night-eighties.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - - Name: Tomorrow Night - Eighties - Author: Chris Kempson - - CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) - Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) - -*/ - -.cm-s-tomorrow-night-eighties.CodeMirror {background: #000000; color: #CCCCCC;} -.cm-s-tomorrow-night-eighties div.CodeMirror-selected {background: #2D2D2D !important;} -.cm-s-tomorrow-night-eighties.CodeMirror ::selection { background: rgba(45, 45, 45, 0.99); } -.cm-s-tomorrow-night-eighties.CodeMirror ::-moz-selection { background: rgba(45, 45, 45, 0.99); } -.cm-s-tomorrow-night-eighties .CodeMirror-gutters {background: #000000; border-right: 0px;} -.cm-s-tomorrow-night-eighties .CodeMirror-guttermarker { color: #f2777a; } -.cm-s-tomorrow-night-eighties .CodeMirror-guttermarker-subtle { color: #777; } -.cm-s-tomorrow-night-eighties .CodeMirror-linenumber {color: #515151;} -.cm-s-tomorrow-night-eighties .CodeMirror-cursor {border-left: 1px solid #6A6A6A !important;} - -.cm-s-tomorrow-night-eighties span.cm-comment {color: #d27b53;} -.cm-s-tomorrow-night-eighties span.cm-atom {color: #a16a94;} -.cm-s-tomorrow-night-eighties span.cm-number {color: #a16a94;} - -.cm-s-tomorrow-night-eighties span.cm-property, .cm-s-tomorrow-night-eighties span.cm-attribute {color: #99cc99;} -.cm-s-tomorrow-night-eighties span.cm-keyword {color: #f2777a;} -.cm-s-tomorrow-night-eighties span.cm-string {color: #ffcc66;} - -.cm-s-tomorrow-night-eighties span.cm-variable {color: #99cc99;} -.cm-s-tomorrow-night-eighties span.cm-variable-2 {color: #6699cc;} -.cm-s-tomorrow-night-eighties span.cm-def {color: #f99157;} -.cm-s-tomorrow-night-eighties span.cm-bracket {color: #CCCCCC;} -.cm-s-tomorrow-night-eighties span.cm-tag {color: #f2777a;} -.cm-s-tomorrow-night-eighties span.cm-link {color: #a16a94;} -.cm-s-tomorrow-night-eighties span.cm-error {background: #f2777a; color: #6A6A6A;} - -.cm-s-tomorrow-night-eighties .CodeMirror-activeline-background {background: #343600 !important;} -.cm-s-tomorrow-night-eighties .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/twilight.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/twilight.css deleted file mode 100644 index 889a83d..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/twilight.css +++ /dev/null @@ -1,32 +0,0 @@ -.cm-s-twilight.CodeMirror { background: #141414; color: #f7f7f7; } /**/ -.cm-s-twilight .CodeMirror-selected { background: #323232 !important; } /**/ -.cm-s-twilight.CodeMirror ::selection { background: rgba(50, 50, 50, 0.99); } -.cm-s-twilight.CodeMirror ::-moz-selection { background: rgba(50, 50, 50, 0.99); } - -.cm-s-twilight .CodeMirror-gutters { background: #222; border-right: 1px solid #aaa; } -.cm-s-twilight .CodeMirror-guttermarker { color: white; } -.cm-s-twilight .CodeMirror-guttermarker-subtle { color: #aaa; } -.cm-s-twilight .CodeMirror-linenumber { color: #aaa; } -.cm-s-twilight .CodeMirror-cursor { border-left: 1px solid white !important; } - -.cm-s-twilight .cm-keyword { color: #f9ee98; } /**/ -.cm-s-twilight .cm-atom { color: #FC0; } -.cm-s-twilight .cm-number { color: #ca7841; } /**/ -.cm-s-twilight .cm-def { color: #8DA6CE; } -.cm-s-twilight span.cm-variable-2, .cm-s-twilight span.cm-tag { color: #607392; } /**/ -.cm-s-twilight span.cm-variable-3, .cm-s-twilight span.cm-def { color: #607392; } /**/ -.cm-s-twilight .cm-operator { color: #cda869; } /**/ -.cm-s-twilight .cm-comment { color:#777; font-style:italic; font-weight:normal; } /**/ -.cm-s-twilight .cm-string { color:#8f9d6a; font-style:italic; } /**/ -.cm-s-twilight .cm-string-2 { color:#bd6b18 } /*?*/ -.cm-s-twilight .cm-meta { background-color:#141414; color:#f7f7f7; } /*?*/ -.cm-s-twilight .cm-builtin { color: #cda869; } /*?*/ -.cm-s-twilight .cm-tag { color: #997643; } /**/ -.cm-s-twilight .cm-attribute { color: #d6bb6d; } /*?*/ -.cm-s-twilight .cm-header { color: #FF6400; } -.cm-s-twilight .cm-hr { color: #AEAEAE; } -.cm-s-twilight .cm-link { color:#ad9361; font-style:italic; text-decoration:none; } /**/ -.cm-s-twilight .cm-error { border-bottom: 1px solid red; } - -.cm-s-twilight .CodeMirror-activeline-background {background: #27282E !important;} -.cm-s-twilight .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/vibrant-ink.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/vibrant-ink.css deleted file mode 100644 index 8ea5359..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/vibrant-ink.css +++ /dev/null @@ -1,34 +0,0 @@ -/* Taken from the popular Visual Studio Vibrant Ink Schema */ - -.cm-s-vibrant-ink.CodeMirror { background: black; color: white; } -.cm-s-vibrant-ink .CodeMirror-selected { background: #35493c !important; } -.cm-s-vibrant-ink.CodeMirror ::selection { background: rgba(53, 73, 60, 0.99); } -.cm-s-vibrant-ink.CodeMirror ::-moz-selection { background: rgba(53, 73, 60, 0.99); } - -.cm-s-vibrant-ink .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } -.cm-s-vibrant-ink .CodeMirror-guttermarker { color: white; } -.cm-s-vibrant-ink .CodeMirror-guttermarker-subtle { color: #d0d0d0; } -.cm-s-vibrant-ink .CodeMirror-linenumber { color: #d0d0d0; } -.cm-s-vibrant-ink .CodeMirror-cursor { border-left: 1px solid white !important; } - -.cm-s-vibrant-ink .cm-keyword { color: #CC7832; } -.cm-s-vibrant-ink .cm-atom { color: #FC0; } -.cm-s-vibrant-ink .cm-number { color: #FFEE98; } -.cm-s-vibrant-ink .cm-def { color: #8DA6CE; } -.cm-s-vibrant-ink span.cm-variable-2, .cm-s-vibrant span.cm-tag { color: #FFC66D } -.cm-s-vibrant-ink span.cm-variable-3, .cm-s-vibrant span.cm-def { color: #FFC66D } -.cm-s-vibrant-ink .cm-operator { color: #888; } -.cm-s-vibrant-ink .cm-comment { color: gray; font-weight: bold; } -.cm-s-vibrant-ink .cm-string { color: #A5C25C } -.cm-s-vibrant-ink .cm-string-2 { color: red } -.cm-s-vibrant-ink .cm-meta { color: #D8FA3C; } -.cm-s-vibrant-ink .cm-builtin { color: #8DA6CE; } -.cm-s-vibrant-ink .cm-tag { color: #8DA6CE; } -.cm-s-vibrant-ink .cm-attribute { color: #8DA6CE; } -.cm-s-vibrant-ink .cm-header { color: #FF6400; } -.cm-s-vibrant-ink .cm-hr { color: #AEAEAE; } -.cm-s-vibrant-ink .cm-link { color: blue; } -.cm-s-vibrant-ink .cm-error { border-bottom: 1px solid red; } - -.cm-s-vibrant-ink .CodeMirror-activeline-background {background: #27282E !important;} -.cm-s-vibrant-ink .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;} diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/xq-dark.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/xq-dark.css deleted file mode 100644 index d537993..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/xq-dark.css +++ /dev/null @@ -1,53 +0,0 @@ -/* -Copyright (C) 2011 by MarkLogic Corporation -Author: Mike Brevoort - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ -.cm-s-xq-dark.CodeMirror { background: #0a001f; color: #f8f8f8; } -.cm-s-xq-dark .CodeMirror-selected { background: #27007A !important; } -.cm-s-xq-dark.CodeMirror ::selection { background: rgba(39, 0, 122, 0.99); } -.cm-s-xq-dark.CodeMirror ::-moz-selection { background: rgba(39, 0, 122, 0.99); } -.cm-s-xq-dark .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; } -.cm-s-xq-dark .CodeMirror-guttermarker { color: #FFBD40; } -.cm-s-xq-dark .CodeMirror-guttermarker-subtle { color: #f8f8f8; } -.cm-s-xq-dark .CodeMirror-linenumber { color: #f8f8f8; } -.cm-s-xq-dark .CodeMirror-cursor { border-left: 1px solid white !important; } - -.cm-s-xq-dark span.cm-keyword {color: #FFBD40;} -.cm-s-xq-dark span.cm-atom {color: #6C8CD5;} -.cm-s-xq-dark span.cm-number {color: #164;} -.cm-s-xq-dark span.cm-def {color: #FFF; text-decoration:underline;} -.cm-s-xq-dark span.cm-variable {color: #FFF;} -.cm-s-xq-dark span.cm-variable-2 {color: #EEE;} -.cm-s-xq-dark span.cm-variable-3 {color: #DDD;} -.cm-s-xq-dark span.cm-property {} -.cm-s-xq-dark span.cm-operator {} -.cm-s-xq-dark span.cm-comment {color: gray;} -.cm-s-xq-dark span.cm-string {color: #9FEE00;} -.cm-s-xq-dark span.cm-meta {color: yellow;} -.cm-s-xq-dark span.cm-qualifier {color: #FFF700;} -.cm-s-xq-dark span.cm-builtin {color: #30a;} -.cm-s-xq-dark span.cm-bracket {color: #cc7;} -.cm-s-xq-dark span.cm-tag {color: #FFBD40;} -.cm-s-xq-dark span.cm-attribute {color: #FFF700;} -.cm-s-xq-dark span.cm-error {color: #f00;} - -.cm-s-xq-dark .CodeMirror-activeline-background {background: #27282E !important;} -.cm-s-xq-dark .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;} \ No newline at end of file diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/xq-light.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/xq-light.css deleted file mode 100644 index 20b5c79..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/xq-light.css +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright (C) 2011 by MarkLogic Corporation -Author: Mike Brevoort - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ -.cm-s-xq-light span.cm-keyword {line-height: 1em; font-weight: bold; color: #5A5CAD; } -.cm-s-xq-light span.cm-atom {color: #6C8CD5;} -.cm-s-xq-light span.cm-number {color: #164;} -.cm-s-xq-light span.cm-def {text-decoration:underline;} -.cm-s-xq-light span.cm-variable {color: black; } -.cm-s-xq-light span.cm-variable-2 {color:black;} -.cm-s-xq-light span.cm-variable-3 {color: black; } -.cm-s-xq-light span.cm-property {} -.cm-s-xq-light span.cm-operator {} -.cm-s-xq-light span.cm-comment {color: #0080FF; font-style: italic;} -.cm-s-xq-light span.cm-string {color: red;} -.cm-s-xq-light span.cm-meta {color: yellow;} -.cm-s-xq-light span.cm-qualifier {color: grey} -.cm-s-xq-light span.cm-builtin {color: #7EA656;} -.cm-s-xq-light span.cm-bracket {color: #cc7;} -.cm-s-xq-light span.cm-tag {color: #3F7F7F;} -.cm-s-xq-light span.cm-attribute {color: #7F007F;} -.cm-s-xq-light span.cm-error {color: #f00;} - -.cm-s-xq-light .CodeMirror-activeline-background {background: #e8f2ff !important;} -.cm-s-xq-light .CodeMirror-matchingbracket {outline:1px solid grey;color:black !important;background:yellow;} \ No newline at end of file diff --git a/src/main/resources/static/editor.md-master/lib/codemirror/theme/zenburn.css b/src/main/resources/static/editor.md-master/lib/codemirror/theme/zenburn.css deleted file mode 100644 index f817198..0000000 --- a/src/main/resources/static/editor.md-master/lib/codemirror/theme/zenburn.css +++ /dev/null @@ -1,37 +0,0 @@ -/** - * " - * Using Zenburn color palette from the Emacs Zenburn Theme - * https://github.com/bbatsov/zenburn-emacs/blob/master/zenburn-theme.el - * - * Also using parts of https://github.com/xavi/coderay-lighttable-theme - * " - * From: https://github.com/wisenomad/zenburn-lighttable-theme/blob/master/zenburn.css - */ - -.cm-s-zenburn .CodeMirror-gutters { background: #3f3f3f !important; } -.cm-s-zenburn .CodeMirror-foldgutter-open, .CodeMirror-foldgutter-folded { color: #999; } -.cm-s-zenburn .CodeMirror-cursor { border-left: 1px solid white !important; } -.cm-s-zenburn { background-color: #3f3f3f; color: #dcdccc; } -.cm-s-zenburn span.cm-builtin { color: #dcdccc; font-weight: bold; } -.cm-s-zenburn span.cm-comment { color: #7f9f7f; } -.cm-s-zenburn span.cm-keyword { color: #f0dfaf; font-weight: bold; } -.cm-s-zenburn span.cm-atom { color: #bfebbf; } -.cm-s-zenburn span.cm-def { color: #dcdccc; } -.cm-s-zenburn span.cm-variable { color: #dfaf8f; } -.cm-s-zenburn span.cm-variable-2 { color: #dcdccc; } -.cm-s-zenburn span.cm-string { color: #cc9393; } -.cm-s-zenburn span.cm-string-2 { color: #cc9393; } -.cm-s-zenburn span.cm-number { color: #dcdccc; } -.cm-s-zenburn span.cm-tag { color: #93e0e3; } -.cm-s-zenburn span.cm-property { color: #dfaf8f; } -.cm-s-zenburn span.cm-attribute { color: #dfaf8f; } -.cm-s-zenburn span.cm-qualifier { color: #7cb8bb; } -.cm-s-zenburn span.cm-meta { color: #f0dfaf; } -.cm-s-zenburn span.cm-header { color: #f0efd0; } -.cm-s-zenburn span.cm-operator { color: #f0efd0; } -.cm-s-zenburn span.CodeMirror-matchingbracket { box-sizing: border-box; background: transparent; border-bottom: 1px solid; } -.cm-s-zenburn span.CodeMirror-nonmatchingbracket { border-bottom: 1px solid; background: none; } -.cm-s-zenburn .CodeMirror-activeline { background: #000000; } -.cm-s-zenburn .CodeMirror-activeline-background { background: #000000; } -.cm-s-zenburn .CodeMirror-selected { background: #545454; } -.cm-s-zenburn .CodeMirror-focused .CodeMirror-selected { background: #4f4f4f; } diff --git a/src/main/resources/static/editor.md-master/lib/flowchart.min.js b/src/main/resources/static/editor.md-master/lib/flowchart.min.js deleted file mode 100644 index 7808021..0000000 --- a/src/main/resources/static/editor.md-master/lib/flowchart.min.js +++ /dev/null @@ -1,5 +0,0 @@ -// flowchart, v1.3.4 -// Copyright (c)2014 Adriano Raiano (adrai). -// Distributed under MIT license -// http://adrai.github.io/flowchart.js -!function(){function a(b,c){if(!b||"function"==typeof b)return c;var d={};for(var e in c)d[e]=c[e];for(e in b)b[e]&&(d[e]="object"==typeof d[e]?a(d[e],b[e]):b[e]);return d}function b(a,b){if("function"==typeof Object.create)a.super_=b,a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});else{a.super_=b;var c=function(){};c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a}}function c(a,b,c){var d,e,f="M{0},{1}";for(d=2,e=2*c.length+2;e>d;d+=2)f+=" L{"+d+"},{"+(d+1)+"}";var g=[b.x,b.y];for(d=0,e=c.length;e>d;d++)g.push(c[d].x),g.push(c[d].y);var h=a.paper.path(f,g);h.attr("stroke",a.options["element-color"]),h.attr("stroke-width",a.options["line-width"]);var i=a.options.font,j=a.options["font-family"],k=a.options["font-weight"];return i&&h.attr({font:i}),j&&h.attr({"font-family":j}),k&&h.attr({"font-weight":k}),h}function d(a,b,c,d){var e,f;"[object Array]"!==Object.prototype.toString.call(c)&&(c=[c]);var g="M{0},{1}";for(e=2,f=2*c.length+2;f>e;e+=2)g+=" L{"+e+"},{"+(e+1)+"}";var h=[b.x,b.y];for(e=0,f=c.length;f>e;e++)h.push(c[e].x),h.push(c[e].y);var i=a.paper.path(g,h);i.attr({stroke:a.options["line-color"],"stroke-width":a.options["line-width"],"arrow-end":a.options["arrow-end"]});var j=a.options.font,k=a.options["font-family"],l=a.options["font-weight"];if(j&&i.attr({font:j}),k&&i.attr({"font-family":k}),l&&i.attr({"font-weight":l}),d){var m=!1,n=a.paper.text(0,0,d),o=!1,p=c[0];b.y===p.y&&(o=!0);var q=0,r=0;m?(q=b.x>p.x?b.x-(b.x-p.x)/2:p.x-(p.x-b.x)/2,r=b.y>p.y?b.y-(b.y-p.y)/2:p.y-(p.y-b.y)/2,o?(q-=n.getBBox().width/2,r-=a.options["text-margin"]):(q+=a.options["text-margin"],r-=n.getBBox().height/2)):(q=b.x,r=b.y,o?(q+=a.options["text-margin"]/2,r-=a.options["text-margin"]):(q+=a.options["text-margin"]/2,r+=a.options["text-margin"])),n.attr({"text-anchor":"start","font-size":a.options["font-size"],fill:a.options["font-color"],x:q,y:r}),j&&n.attr({font:j}),k&&n.attr({"font-family":k}),l&&n.attr({"font-weight":l})}return i}function e(a,b,c,d,e,f,g,h){var i,j,k,l,m,n={x:null,y:null,onLine1:!1,onLine2:!1};return i=(h-f)*(c-a)-(g-e)*(d-b),0===i?n:(j=b-f,k=a-e,l=(g-e)*j-(h-f)*k,m=(c-a)*j-(d-b)*k,j=l/i,k=m/i,n.x=a+j*(c-a),n.y=b+j*(d-b),j>0&&1>j&&(n.onLine1=!0),k>0&&1>k&&(n.onLine2=!0),n)}function f(a,b){b=b||{},this.paper=new Raphael(a),this.options=r.defaults(b,q),this.symbols=[],this.lines=[],this.start=null}function g(a,b,c){this.chart=a,this.group=this.chart.paper.set(),this.symbol=c,this.connectedTo=[],this.symbolType=b.symbolType,this.flowstate=b.flowstate||"future",this.next_direction=b.next&&b.direction_next?b.direction_next:void 0,this.text=this.chart.paper.text(0,0,b.text),b.key&&(this.text.node.id=b.key+"t"),this.text.node.setAttribute("class",this.getAttr("class")+"t"),this.text.attr({"text-anchor":"start",x:this.getAttr("text-margin"),fill:this.getAttr("font-color"),"font-size":this.getAttr("font-size")});var d=this.getAttr("font"),e=this.getAttr("font-family"),f=this.getAttr("font-weight");d&&this.text.attr({font:d}),e&&this.text.attr({"font-family":e}),f&&this.text.attr({"font-weight":f}),b.link&&this.text.attr("href",b.link),b.target&&this.text.attr("target",b.target);var g=this.getAttr("maxWidth");if(g){for(var h=b.text.split(" "),i="",j=0,k=h.length;k>j;j++){var l=h[j];this.text.attr("text",i+" "+l),i+=this.text.getBBox().width>g?"\n"+l:" "+l}this.text.attr("text",i.substring(1))}if(this.group.push(this.text),c){var m=this.getAttr("text-margin");c.attr({fill:this.getAttr("fill"),stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),width:this.text.getBBox().width+2*m,height:this.text.getBBox().height+2*m}),c.node.setAttribute("class",this.getAttr("class")),b.link&&c.attr("href",b.link),b.target&&c.attr("target",b.target),b.key&&(c.node.id=b.key),this.group.push(c),c.insertBefore(this.text),this.text.attr({y:c.getBBox().height/2}),this.initialize()}}function h(a,b){var c=a.paper.rect(0,0,0,0,20);b=b||{},b.text=b.text||"Start",g.call(this,a,b,c)}function i(a,b){var c=a.paper.rect(0,0,0,0,20);b=b||{},b.text=b.text||"End",g.call(this,a,b,c)}function j(a,b){var c=a.paper.rect(0,0,0,0);b=b||{},g.call(this,a,b,c)}function k(a,b){var c=a.paper.rect(0,0,0,0);b=b||{},g.call(this,a,b,c),c.attr({width:this.text.getBBox().width+4*this.getAttr("text-margin")}),this.text.attr({x:2*this.getAttr("text-margin")});var d=a.paper.rect(0,0,0,0);d.attr({x:this.getAttr("text-margin"),stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),width:this.text.getBBox().width+2*this.getAttr("text-margin"),height:this.text.getBBox().height+2*this.getAttr("text-margin"),fill:this.getAttr("fill")}),b.key&&(d.node.id=b.key+"i");var e=this.getAttr("font"),f=this.getAttr("font-family"),h=this.getAttr("font-weight");e&&d.attr({font:e}),f&&d.attr({"font-family":f}),h&&d.attr({"font-weight":h}),b.link&&d.attr("href",b.link),b.target&&d.attr("target",b.target),this.group.push(d),d.insertBefore(this.text),this.initialize()}function l(a,b){b=b||{},g.call(this,a,b),this.textMargin=this.getAttr("text-margin"),this.text.attr({x:3*this.textMargin});var d=this.text.getBBox().width+4*this.textMargin,e=this.text.getBBox().height+2*this.textMargin,f=this.textMargin,h=e/2,i={x:f,y:h},j=[{x:f-this.textMargin,y:e},{x:f-this.textMargin+d,y:e},{x:f-this.textMargin+d+2*this.textMargin,y:0},{x:f-this.textMargin+2*this.textMargin,y:0},{x:f,y:h}],k=c(a,i,j);k.attr({stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),fill:this.getAttr("fill")}),b.link&&k.attr("href",b.link),b.target&&k.attr("target",b.target),b.key&&(k.node.id=b.key),k.node.setAttribute("class",this.getAttr("class")),this.text.attr({y:k.getBBox().height/2}),this.group.push(k),k.insertBefore(this.text),this.initialize()}function m(a,b){b=b||{},g.call(this,a,b),this.textMargin=this.getAttr("text-margin"),this.yes_direction="bottom",this.no_direction="right",b.yes&&b.direction_yes&&b.no&&!b.direction_no?"right"===b.direction_yes?(this.no_direction="bottom",this.yes_direction="right"):(this.no_direction="right",this.yes_direction="bottom"):b.yes&&!b.direction_yes&&b.no&&b.direction_no?"right"===b.direction_no?(this.yes_direction="bottom",this.no_direction="right"):(this.yes_direction="right",this.no_direction="bottom"):(this.yes_direction="bottom",this.no_direction="right"),this.yes_direction=this.yes_direction||"bottom",this.no_direction=this.no_direction||"right",this.text.attr({x:2*this.textMargin});var d=this.text.getBBox().width+3*this.textMargin;d+=d/2;var e=this.text.getBBox().height+2*this.textMargin;e+=e/2,e=Math.max(.5*d,e);var f=d/4,h=e/4;this.text.attr({x:f+this.textMargin/2});var i={x:f,y:h},j=[{x:f-d/4,y:h+e/4},{x:f-d/4+d/2,y:h+e/4+e/2},{x:f-d/4+d,y:h+e/4},{x:f-d/4+d/2,y:h+e/4-e/2},{x:f-d/4,y:h+e/4}],k=c(a,i,j);k.attr({stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),fill:this.getAttr("fill")}),b.link&&k.attr("href",b.link),b.target&&k.attr("target",b.target),b.key&&(k.node.id=b.key),k.node.setAttribute("class",this.getAttr("class")),this.text.attr({y:k.getBBox().height/2}),this.group.push(k),k.insertBefore(this.text),this.initialize()}function n(a){function b(a){var b=a.indexOf("(")+1,c=a.indexOf(")");return b>=0&&c>=0?d.symbols[a.substring(0,b-1)]:d.symbols[a]}function c(a){var b="next",c=a.indexOf("(")+1,d=a.indexOf(")");return c>=0&&d>=0&&(b=D.substring(c,d),b.indexOf(",")<0&&"yes"!==b&&"no"!==b&&(b="next, "+b)),b}a=a||"",a=a.trim();for(var d={symbols:{},start:null,drawSVG:function(a,b){function c(a){if(g[a.key])return g[a.key];switch(a.symbolType){case"start":g[a.key]=new h(e,a);break;case"end":g[a.key]=new i(e,a);break;case"operation":g[a.key]=new j(e,a);break;case"inputoutput":g[a.key]=new l(e,a);break;case"subroutine":g[a.key]=new k(e,a);break;case"condition":g[a.key]=new m(e,a);break;default:return new Error("Wrong symbol type!")}return g[a.key]}var d=this;this.diagram&&this.diagram.clean();var e=new f(a,b);this.diagram=e;var g={};!function n(a,b,f){var g=c(a);return d.start===a?e.startWith(g):b&&f&&!b.pathOk&&(b instanceof m?(f.yes===a&&b.yes(g),f.no===a&&b.no(g)):b.then(g)),g.pathOk?g:(g instanceof m?(a.yes&&n(a.yes,g,a),a.no&&n(a.no,g,a)):a.next&&n(a.next,g,a),g)}(this.start),e.render()},clean:function(){this.diagram.clean()}},e=[],g=0,n=1,o=a.length;o>n;n++)if("\n"===a[n]&&"\\"!==a[n-1]){var p=a.substring(g,n);g=n+1,e.push(p.replace(/\\\n/g,"\n"))}gq;){var s=e[q];s.indexOf(": ")<0&&s.indexOf("(")<0&&s.indexOf(")")<0&&s.indexOf("->")<0&&s.indexOf("=>")<0?(e[q-1]+="\n"+s,e.splice(q,1),r--):q++}for(;e.length>0;){var t=e.splice(0,1)[0];if(t.indexOf("=>")>=0){var u,v=t.split("=>"),w={key:v[0],symbolType:v[1],text:null,link:null,target:null,flowstate:null};if(w.symbolType.indexOf(": ")>=0&&(u=w.symbolType.split(": "),w.symbolType=u[0],w.text=u[1]),w.text&&w.text.indexOf(":>")>=0?(u=w.text.split(":>"),w.text=u[0],w.link=u[1]):w.symbolType.indexOf(":>")>=0&&(u=w.symbolType.split(":>"),w.symbolType=u[0],w.link=u[1]),w.symbolType.indexOf("\n")>=0&&(w.symbolType=w.symbolType.split("\n")[0]),w.link){var x=w.link.indexOf("[")+1,y=w.link.indexOf("]");x>=0&&y>=0&&(w.target=w.link.substring(x,y),w.link=w.link.substring(0,x-1))}if(w.text&&w.text.indexOf("|")>=0){var z=w.text.split("|");w.text=z[0],w.flowstate=z[1].trim()}d.symbols[w.key]=w}else if(t.indexOf("->")>=0)for(var A=t.split("->"),B=0,C=A.length;C>B;B++){var D=A[B],E=b(D),F=c(D),G=null;if(F.indexOf(",")>=0){var H=F.split(",");F=H[0],G=H[1].trim()}if(d.start||(d.start=E),C>B+1){var I=A[B+1];E[F]=b(I),E["direction_"+F]=G,G=null}}}return d}Array.prototype.indexOf||(Array.prototype.indexOf=function(a){"use strict";if(null===this)throw new TypeError;var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>0&&(d=Number(arguments[1]),d!=d?d=0:0!==d&&1/0!=d&&d!=-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1}),Array.prototype.lastIndexOf||(Array.prototype.lastIndexOf=function(a){"use strict";if(null===this)throw new TypeError;var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=c;arguments.length>1&&(d=Number(arguments[1]),d!=d?d=0:0!==d&&d!=1/0&&d!=-(1/0)&&(d=(d>0||-1)*Math.floor(Math.abs(d))));for(var e=d>=0?Math.min(d,c-1):c-Math.abs(d);e>=0;e--)if(e in b&&b[e]===a)return e;return-1}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")});var o=this,p={};"undefined"!=typeof module&&module.exports?module.exports=p:o.flowchart=o.flowchart||p;var q={x:0,y:0,"line-width":3,"line-length":50,"text-margin":10,"font-size":14,"font-color":"black","line-color":"black","element-color":"black",fill:"white","yes-text":"yes","no-text":"no","arrow-end":"block","class":"flowchart",symbols:{start:{},end:{},condition:{},inputoutput:{},operation:{},subroutine:{}}},r={defaults:a,inherits:b};f.prototype.handle=function(a){this.symbols.indexOf(a)<=-1&&this.symbols.push(a);var b=this;return a instanceof m?(a.yes=function(c){return a.yes_symbol=c,a.no_symbol&&(a.pathOk=!0),b.handle(c)},a.no=function(c){return a.no_symbol=c,a.yes_symbol&&(a.pathOk=!0),b.handle(c)}):a.then=function(c){return a.next=c,a.pathOk=!0,b.handle(c)},a},f.prototype.startWith=function(a){return this.start=a,this.handle(a)},f.prototype.render=function(){var a,b=0,c=0,d=0,e=0,f=0,g=0;for(d=0,e=this.symbols.length;e>d;d++)a=this.symbols[d],a.width>b&&(b=a.width),a.height>c&&(c=a.height);for(d=0,e=this.symbols.length;e>d;d++)a=this.symbols[d],a.shiftX(this.options.x+(b-a.width)/2+this.options["line-width"]),a.shiftY(this.options.y+(c-a.height)/2+this.options["line-width"]);for(this.start.render(),d=0,e=this.symbols.length;e>d;d++)a=this.symbols[d],a.renderLines();for(f=this.maxXFromLine,d=0,e=this.symbols.length;e>d;d++){a=this.symbols[d];var h=a.getX()+a.width,i=a.getY()+a.height;h>f&&(f=h),i>g&&(g=i)}this.paper.setSize(f+this.options["line-width"],g+this.options["line-width"])},f.prototype.clean=function(){if(this.paper){var a=this.paper.canvas;a.parentNode.removeChild(a)}},g.prototype.getAttr=function(a){if(!this.chart)return void 0;var b,c=this.chart.options?this.chart.options[a]:void 0,d=this.chart.options.symbols?this.chart.options.symbols[this.symbolType][a]:void 0;return this.chart.options.flowstate&&this.chart.options.flowstate[this.flowstate]&&(b=this.chart.options.flowstate[this.flowstate][a]),b||d||c},g.prototype.initialize=function(){this.group.transform("t"+this.getAttr("line-width")+","+this.getAttr("line-width")),this.width=this.group.getBBox().width,this.height=this.group.getBBox().height},g.prototype.getCenter=function(){return{x:this.getX()+this.width/2,y:this.getY()+this.height/2}},g.prototype.getX=function(){return this.group.getBBox().x},g.prototype.getY=function(){return this.group.getBBox().y},g.prototype.shiftX=function(a){this.group.transform("t"+(this.getX()+a)+","+this.getY())},g.prototype.setX=function(a){this.group.transform("t"+a+","+this.getY())},g.prototype.shiftY=function(a){this.group.transform("t"+this.getX()+","+(this.getY()+a))},g.prototype.setY=function(a){this.group.transform("t"+this.getX()+","+a)},g.prototype.getTop=function(){var a=this.getY(),b=this.getX()+this.width/2;return{x:b,y:a}},g.prototype.getBottom=function(){var a=this.getY()+this.height,b=this.getX()+this.width/2;return{x:b,y:a}},g.prototype.getLeft=function(){var a=this.getY()+this.group.getBBox().height/2,b=this.getX();return{x:b,y:a}},g.prototype.getRight=function(){var a=this.getY()+this.group.getBBox().height/2,b=this.getX()+this.group.getBBox().width;return{x:b,y:a}},g.prototype.render=function(){if(this.next){var a=this.getAttr("line-length");if("right"===this.next_direction){var b=this.getRight();if(this.next.getLeft(),!this.next.isPositioned){this.next.setY(b.y-this.next.height/2),this.next.shiftX(this.group.getBBox().x+this.width+a);var c=this;!function e(){for(var b,d=!1,f=0,g=c.chart.symbols.length;g>f;f++){b=c.chart.symbols[f];var h=Math.abs(b.getCenter().x-c.next.getCenter().x);if(b.getCenter().y>c.next.getCenter().y&&h<=c.next.width/2){d=!0;break}}d&&(c.next.setX(b.getX()+b.width+a),e())}(),this.next.isPositioned=!0,this.next.render()}}else{var d=this.getBottom();this.next.getTop(),this.next.isPositioned||(this.next.shiftY(this.getY()+this.height+a),this.next.setX(d.x-this.next.width/2),this.next.isPositioned=!0,this.next.render())}}},g.prototype.renderLines=function(){this.next&&(this.next_direction?this.drawLineTo(this.next,"",this.next_direction):this.drawLineTo(this.next))},g.prototype.drawLineTo=function(a,b,c){this.connectedTo.indexOf(a)<0&&this.connectedTo.push(a);var f,g=this.getCenter().x,h=this.getCenter().y,i=(this.getTop(),this.getRight()),j=this.getBottom(),k=this.getLeft(),l=a.getCenter().x,m=a.getCenter().y,n=a.getTop(),o=a.getRight(),p=(a.getBottom(),a.getLeft()),q=g===l,r=h===m,s=m>h,t=h>m,u=g>l,v=l>g,w=0,x=this.getAttr("line-length"),y=this.getAttr("line-width");if(c&&"bottom"!==c||!q||!s)if(c&&"right"!==c||!r||!v)if(c&&"left"!==c||!r||!u)if(c&&"right"!==c||!q||!t)if(c&&"right"!==c||!q||!s)if(c&&"bottom"!==c||!u)if(c&&"bottom"!==c||!v)if(c&&"right"===c&&u)f=d(this.chart,i,[{x:i.x+x/2,y:i.y},{x:i.x+x/2,y:n.y-x/2},{x:n.x,y:n.y-x/2},{x:n.x,y:n.y}],b),this.rightStart=!0,a.topEnd=!0,w=i.x+x/2;else if(c&&"right"===c&&v)f=d(this.chart,i,[{x:n.x,y:i.y},{x:n.x,y:n.y}],b),this.rightStart=!0,a.topEnd=!0,w=i.x+x/2;else if(c&&"bottom"===c&&q&&t)f=d(this.chart,j,[{x:j.x,y:j.y+x/2},{x:i.x+x/2,y:j.y+x/2},{x:i.x+x/2,y:n.y-x/2},{x:n.x,y:n.y-x/2},{x:n.x,y:n.y}],b),this.bottomStart=!0,a.topEnd=!0,w=j.x+x/2;else if("left"===c&&q&&t){var z=k.x-x/2;p.xA;A++)for(var C,D=this.chart.lines[A],E=D.attr("path"),F=f.attr("path"),G=0,H=E.length-1;H>G;G++){var I=[];I.push(["M",E[G][1],E[G][2]]),I.push(["L",E[G+1][1],E[G+1][2]]);for(var J=I[0][1],K=I[0][2],L=I[1][1],M=I[1][2],N=0,O=F.length-1;O>N;N++){var P=[];P.push(["M",F[N][1],F[N][2]]),P.push(["L",F[N+1][1],F[N+1][2]]);var Q=P[0][1],R=P[0][2],S=P[1][1],T=P[1][2],U=e(J,K,L,M,Q,R,S,T);if(U.onLine1&&U.onLine2){var V;R===T?Q>S?(V=["L",U.x+2*y,R],F.splice(N+1,0,V),V=["C",U.x+2*y,R,U.x,R-4*y,U.x-2*y,R],F.splice(N+2,0,V),f.attr("path",F)):(V=["L",U.x-2*y,R],F.splice(N+1,0,V),V=["C",U.x-2*y,R,U.x,R-4*y,U.x+2*y,R],F.splice(N+2,0,V),f.attr("path",F)):R>T?(V=["L",Q,U.y+2*y],F.splice(N+1,0,V),V=["C",Q,U.y+2*y,Q+4*y,U.y,Q,U.y-2*y],F.splice(N+2,0,V),f.attr("path",F)):(V=["L",Q,U.y-2*y],F.splice(N+1,0,V),V=["C",Q,U.y-2*y,Q+4*y,U.y,Q,U.y+2*y],F.splice(N+2,0,V),f.attr("path",F)),N+=2,C+=2}}}this.chart.lines.push(f)}(!this.chart.maxXFromLine||this.chart.maxXFromLine&&w>this.chart.maxXFromLine)&&(this.chart.maxXFromLine=w)},r.inherits(h,g),r.inherits(i,g),r.inherits(j,g),r.inherits(k,g),r.inherits(l,g),l.prototype.getLeft=function(){var a=this.getY()+this.group.getBBox().height/2,b=this.getX()+this.textMargin;return{x:b,y:a}},l.prototype.getRight=function(){var a=this.getY()+this.group.getBBox().height/2,b=this.getX()+this.group.getBBox().width-this.textMargin;return{x:b,y:a}},r.inherits(m,g),m.prototype.render=function(){this.yes_direction&&(this[this.yes_direction+"_symbol"]=this.yes_symbol),this.no_direction&&(this[this.no_direction+"_symbol"]=this.no_symbol);var a=this.getAttr("line-length");if(this.bottom_symbol){var b=this.getBottom();this.bottom_symbol.getTop(),this.bottom_symbol.isPositioned||(this.bottom_symbol.shiftY(this.getY()+this.height+a),this.bottom_symbol.setX(b.x-this.bottom_symbol.width/2),this.bottom_symbol.isPositioned=!0,this.bottom_symbol.render())}if(this.right_symbol){var c=this.getRight();if(this.right_symbol.getLeft(),!this.right_symbol.isPositioned){this.right_symbol.setY(c.y-this.right_symbol.height/2),this.right_symbol.shiftX(this.group.getBBox().x+this.width+a);var d=this;!function e(){for(var b,c=!1,f=0,g=d.chart.symbols.length;g>f;f++){b=d.chart.symbols[f];var h=Math.abs(b.getCenter().x-d.right_symbol.getCenter().x);if(b.getCenter().y>d.right_symbol.getCenter().y&&h<=d.right_symbol.width/2){c=!0;break}}c&&(d.right_symbol.setX(b.getX()+b.width+a),e())}(),this.right_symbol.isPositioned=!0,this.right_symbol.render()}}},m.prototype.renderLines=function(){this.yes_symbol&&this.drawLineTo(this.yes_symbol,this.getAttr("yes-text"),this.yes_direction),this.no_symbol&&this.drawLineTo(this.no_symbol,this.getAttr("no-text"),this.no_direction)},p.parse=n}(); \ No newline at end of file diff --git a/src/main/resources/static/editor.md-master/lib/jquery.flowchart.min.js b/src/main/resources/static/editor.md-master/lib/jquery.flowchart.min.js deleted file mode 100644 index a30a8fd..0000000 --- a/src/main/resources/static/editor.md-master/lib/jquery.flowchart.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! jQuery.flowchart.js v1.1.0 | jquery.flowchart.min.js | jQuery plugin for flowchart.js. | MIT License | By: Pandao | https://github.com/pandao/jquery.flowchart.js | 2015-03-09 */ -(function(factory){if(typeof require==="function"&&typeof exports==="object"&&typeof module==="object"){module.exports=factory}else{if(typeof define==="function"){factory(jQuery,flowchart)}else{factory($,flowchart)}}}(function(jQuery,flowchart){(function($){$.fn.flowChart=function(options){options=options||{};var defaults={"x":0,"y":0,"line-width":2,"line-length":50,"text-margin":10,"font-size":14,"font-color":"black","line-color":"black","element-color":"black","fill":"white","yes-text":"yes","no-text":"no","arrow-end":"block","symbols":{"start":{"font-color":"black","element-color":"black","fill":"white"},"end":{"class":"end-element"}},"flowstate":{"past":{"fill":"#CCCCCC","font-size":12},"current":{"fill":"black","font-color":"white","font-weight":"bold"},"future":{"fill":"white"},"request":{"fill":"blue"},"invalid":{"fill":"#444444"},"approved":{"fill":"#58C4A3","font-size":12,"yes-text":"APPROVED","no-text":"n/a"},"rejected":{"fill":"#C45879","font-size":12,"yes-text":"n/a","no-text":"REJECTED"}}};return this.each(function(){var $this=$(this);var diagram=flowchart.parse($this.text());var settings=$.extend(true,defaults,options);$this.html("");diagram.drawSVG(this,settings)})}})(jQuery)})); \ No newline at end of file diff --git a/src/main/resources/static/editor.md-master/lib/marked.min.js b/src/main/resources/static/editor.md-master/lib/marked.min.js deleted file mode 100644 index 5597fa4..0000000 --- a/src/main/resources/static/editor.md-master/lib/marked.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * marked v0.3.3 - a markdown parser - * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) - * https://github.com/chjj/marked - */ -(function(){var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=replace(block.item,"gm")(/bull/g,block.bullet)();block.list=replace(block.list)(/bull/g,block.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+block.def.source+")")();block.blockquote=replace(block.blockquote)("def",block.def)();block._tag="(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code"+"|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo"+"|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b";block.html=replace(block.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,block._tag)();block.paragraph=replace(block.paragraph)("hr",block.hr)("heading",block.heading)("lheading",block.lheading)("blockquote",block.blockquote)("tag","<"+block._tag)("def",block.def)();block.normal=merge({},block);block.gfm=merge({},block.normal,{fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,paragraph:/^/});block.gfm.paragraph=replace(block.paragraph)("(?!","(?!"+block.gfm.fences.source.replace("\\1","\\2")+"|"+block.list.source.replace("\\1","\\3")+"|")();block.tables=merge({},block.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});function Lexer(options){this.tokens=[];this.tokens.links={};this.options=options||marked.defaults;this.rules=block.normal;if(this.options.gfm){if(this.options.tables){this.rules=block.tables}else{this.rules=block.gfm}}}Lexer.rules=block;Lexer.lex=function(src,options){var lexer=new Lexer(options);return lexer.lex(src)};Lexer.prototype.lex=function(src){src=src.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");return this.token(src,true)};Lexer.prototype.token=function(src,top,bq){var src=src.replace(/^ +$/gm,""),next,loose,cap,bull,b,item,space,i,l;while(src){if(cap=this.rules.newline.exec(src)){src=src.substring(cap[0].length);if(cap[0].length>1){this.tokens.push({type:"space"})}}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);cap=cap[0].replace(/^ {4}/gm,"");this.tokens.push({type:"code",text:!this.options.pedantic?cap.replace(/\n+$/,""):cap});continue}if(cap=this.rules.fences.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"code",lang:cap[2],text:cap[3]});continue}if(cap=this.rules.heading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"heading",depth:cap[1].length,text:cap[2]});continue}if(top&&(cap=this.rules.nptable.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/\n$/,"").split("\n")};for(i=0;i ?/gm,"");this.token(cap,top,true);this.tokens.push({type:"blockquote_end"});continue}if(cap=this.rules.list.exec(src)){src=src.substring(cap[0].length);bull=cap[2];this.tokens.push({type:"list_start",ordered:bull.length>1});cap=cap[0].match(this.rules.item);next=false;l=cap.length;i=0;for(;i1&&b.length>1)){src=cap.slice(i+1).join("\n")+src;i=l-1}}loose=next||/\n\n(?!\s*$)/.test(item);if(i!==l-1){next=item.charAt(item.length-1)==="\n";if(!loose){loose=next}}this.tokens.push({type:loose?"loose_item_start":"list_item_start"});this.token(item,false,bq); -this.tokens.push({type:"list_item_end"})}this.tokens.push({type:"list_end"});continue}if(cap=this.rules.html.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:cap[1]==="pre"||cap[1]==="script"||cap[1]==="style",text:cap[0]});continue}if((!bq&&top)&&(cap=this.rules.def.exec(src))){src=src.substring(cap[0].length);this.tokens.links[cap[1].toLowerCase()]={href:cap[2],title:cap[3]};continue}if(top&&(cap=this.rules.table.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(i=0;i])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/;inline.link=replace(inline.link)("inside",inline._inside)("href",inline._href)();inline.reflink=replace(inline.reflink)("inside",inline._inside)();inline.normal=merge({},inline);inline.pedantic=merge({},inline.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});inline.gfm=merge({},inline.normal,{escape:replace(inline.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(inline.text)("]|","~]|")("|","|https?://|")()});inline.breaks=merge({},inline.gfm,{br:replace(inline.br)("{2,}","*")(),text:replace(inline.gfm.text)("{2,}","*")()});function InlineLexer(links,options){this.options=options||marked.defaults;this.links=links;this.rules=inline.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options;if(!this.links){throw new Error("Tokens array requires a `links` property.")}if(this.options.gfm){if(this.options.breaks){this.rules=inline.breaks}else{this.rules=inline.gfm}}else{if(this.options.pedantic){this.rules=inline.pedantic}}}InlineLexer.rules=inline;InlineLexer.output=function(src,links,options){var inline=new InlineLexer(links,options);return inline.output(src)};InlineLexer.prototype.output=function(src){var out="",link,text,href,cap;while(src){if(cap=this.rules.escape.exec(src)){src=src.substring(cap[0].length);out+=cap[1];continue}if(cap=this.rules.autolink.exec(src)){src=src.substring(cap[0].length);if(cap[2]==="@"){text=cap[1].charAt(6)===":"?this.mangle(cap[1].substring(7)):this.mangle(cap[1]);href=this.mangle("mailto:")+text}else{text=escape(cap[1]);href=text}out+=this.renderer.link(href,null,text);continue}if(!this.inLink&&(cap=this.rules.url.exec(src))){src=src.substring(cap[0].length);text=escape(cap[1]);href=text;out+=this.renderer.link(href,null,text);continue}if(cap=this.rules.tag.exec(src)){if(!this.inLink&&/^/i.test(cap[0])){this.inLink=false}}src=src.substring(cap[0].length);out+=this.options.sanitize?escape(cap[0]):cap[0];continue}if(cap=this.rules.link.exec(src)){src=src.substring(cap[0].length);this.inLink=true;out+=this.outputLink(cap,{href:cap[2],title:cap[3]});this.inLink=false;continue}if((cap=this.rules.reflink.exec(src))||(cap=this.rules.nolink.exec(src))){src=src.substring(cap[0].length);link=(cap[2]||cap[1]).replace(/\s+/g," ");link=this.links[link.toLowerCase()];if(!link||!link.href){out+=cap[0].charAt(0);src=cap[0].substring(1)+src;continue}this.inLink=true;out+=this.outputLink(cap,link);this.inLink=false;continue}if(cap=this.rules.strong.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.strong(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.em.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.em(this.output(cap[2]||cap[1]));continue -}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.codespan(escape(cap[2],true));continue}if(cap=this.rules.br.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.br();continue}if(cap=this.rules.del.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.del(this.output(cap[1]));continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);out+=escape(this.smartypants(cap[0]));continue}if(src){throw new Error("Infinite loop on byte: "+src.charCodeAt(0))}}return out};InlineLexer.prototype.outputLink=function(cap,link){var href=escape(link.href),title=link.title?escape(link.title):null;return cap[0].charAt(0)!=="!"?this.renderer.link(href,title,this.output(cap[1])):this.renderer.image(href,title,escape(cap[1]))};InlineLexer.prototype.smartypants=function(text){if(!this.options.smartypants){return text}return text.replace(/--/g,"\u2014").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201c").replace(/"/g,"\u201d").replace(/\.{3}/g,"\u2026")};InlineLexer.prototype.mangle=function(text){var out="",l=text.length,i=0,ch;for(;i0.5){ch="x"+ch.toString(16)}out+="&#"+ch+";"}return out};function Renderer(options){this.options=options||{}}Renderer.prototype.code=function(code,lang,escaped){if(this.options.highlight){var out=this.options.highlight(code,lang);if(out!=null&&out!==code){escaped=true;code=out}}if(!lang){return"
        "+(escaped?code:escape(code,true))+"\n
        "}return'
        '+(escaped?code:escape(code,true))+"\n
        \n"};Renderer.prototype.blockquote=function(quote){return"
        \n"+quote+"
        \n"};Renderer.prototype.html=function(html){return html};Renderer.prototype.heading=function(text,level,raw){return"'+text+"\n"};Renderer.prototype.hr=function(){return this.options.xhtml?"
        \n":"
        \n"};Renderer.prototype.list=function(body,ordered){var type=ordered?"ol":"ul";return"<"+type+">\n"+body+"\n"};Renderer.prototype.listitem=function(text){return"
      • "+text+"
      • \n"};Renderer.prototype.paragraph=function(text){return"

        "+text+"

        \n"};Renderer.prototype.table=function(header,body){return"\n"+"\n"+header+"\n"+"\n"+body+"\n"+"
        \n"};Renderer.prototype.tablerow=function(content){return"\n"+content+"\n"};Renderer.prototype.tablecell=function(content,flags){var type=flags.header?"th":"td";var tag=flags.align?"<"+type+' style="text-align:'+flags.align+'">':"<"+type+">";return tag+content+"\n"};Renderer.prototype.strong=function(text){return""+text+""};Renderer.prototype.em=function(text){return""+text+""};Renderer.prototype.codespan=function(text){return""+text+""};Renderer.prototype.br=function(){return this.options.xhtml?"
        ":"
        "};Renderer.prototype.del=function(text){return""+text+""};Renderer.prototype.link=function(href,title,text){if(this.options.sanitize){try{var prot=decodeURIComponent(unescape(href)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(prot.indexOf("javascript:")===0||prot.indexOf("vbscript:")===0){return""}}var out='
        ";return out};Renderer.prototype.image=function(href,title,text){var out=''+text+'":">";return out};function Parser(options){this.tokens=[];this.token=null;this.options=options||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options}Parser.parse=function(src,options,renderer){var parser=new Parser(options,renderer);return parser.parse(src)};Parser.prototype.parse=function(src){this.inline=new InlineLexer(src.links,this.options,this.renderer);this.tokens=src.reverse();var out="";while(this.next()){out+=this.tok()}return out};Parser.prototype.next=function(){return this.token=this.tokens.pop()};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};Parser.prototype.parseText=function(){var body=this.token.text;while(this.peek().type==="text"){body+="\n"+this.next().text}return this.inline.output(body)};Parser.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var header="",body="",i,row,cell,flags,j;cell="";for(i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function unescape(html){return html.replace(/&([#\w]+);/g,function(_,n){n=n.toLowerCase();if(n==="colon"){return":"}if(n.charAt(0)==="#"){return n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1))}return""})}function replace(regex,opt){regex=regex.source;opt=opt||"";return function self(name,val){if(!name){return new RegExp(regex,opt)}val=val.source||val;val=val.replace(/(^|[^\[])\^/g,"$1");regex=regex.replace(name,val);return self}}function noop(){}noop.exec=noop;function merge(obj){var i=1,target,key;for(;iAn error occured:

        "+escape(e.message+"",true)+"
        "}throw e}}marked.options=marked.setOptions=function(opt){merge(marked.defaults,opt);return marked};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,smartLists:false,silent:false,highlight:null,langPrefix:"lang-",smartypants:false,headerPrefix:"",renderer:new Renderer,xhtml:false};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;if(typeof module!=="undefined"&&typeof exports==="object"){module.exports=marked}else{if(typeof define==="function"&&define.amd){define(function(){return marked})}else{this.marked=marked}}}).call(function(){return this||(typeof window!=="undefined"?window:global)}()); \ No newline at end of file diff --git a/src/main/resources/static/editor.md-master/lib/prettify.min.js b/src/main/resources/static/editor.md-master/lib/prettify.min.js deleted file mode 100644 index 056f968..0000000 --- a/src/main/resources/static/editor.md-master/lib/prettify.min.js +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (C) 2006 Google Inc. -// -// 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. - -var IN_GLOBAL_SCOPE=true;window["PR_SHOULD_USE_CONTINUATION"]=true;var prettyPrintOne;var prettyPrint;(function(){var P=window;var i=["break,continue,do,else,for,if,return,while"];var u=[i,"auto,case,char,const,default,"+"double,enum,extern,float,goto,inline,int,long,register,short,signed,"+"sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,"+"new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,"+"concept,concept_map,const_cast,constexpr,decltype,delegate,"+"dynamic_cast,explicit,export,friend,generic,late_check,"+"mutable,namespace,nullptr,property,reinterpret_cast,static_assert,"+"static_cast,template,typeid,typename,using,virtual,where"];var y=[p,"abstract,assert,boolean,byte,extends,final,finally,implements,import,"+"instanceof,interface,null,native,package,strictfp,super,synchronized,"+"throws,transient"];var U=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,"+"fixed,foreach,from,group,implicit,in,internal,into,is,let,"+"lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,"+"sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,"+"var,virtual,where"];var r="all,and,by,catch,class,else,extends,false,finally,"+"for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,"+"throw,true,try,unless,until,when,while,yes";var x=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,"+"Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,"+"goto,if,import,last,local,my,next,no,our,print,package,redo,require,"+"sub,undef,unless,until,use,wantarray,while,BEGIN,END";var K=[i,"and,as,assert,class,def,del,"+"elif,except,exec,finally,from,global,import,in,is,lambda,"+"nonlocal,not,or,pass,print,raise,try,with,yield,"+"False,True,None"];var g=[i,"alias,and,begin,case,class,"+"def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,"+"rescue,retry,self,super,then,true,undef,unless,until,when,yield,"+"BEGIN,END"];var z=[i,"as,assert,const,copy,drop,"+"enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,"+"pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"];var J=[i,"case,done,elif,esac,eval,fi,"+"function,in,local,set,then,until"];var C=[l,U,x,s,K,g,J];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var E="str";var B="kwd";var j="com";var R="typ";var I="lit";var N="pun";var H="pln";var m="tag";var G="dec";var L="src";var S="atn";var n="atv";var Q="nocode";var O="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(ac){var ag=0;var V=false;var af=false;for(var Y=0,X=ac.length;Y122)){if(!(an<65||aj>90)){ai.push([Math.max(65,aj)|32,Math.min(an,90)|32])}if(!(an<97||aj>122)){ai.push([Math.max(97,aj)&~32,Math.min(an,122)&~32])}}}}ai.sort(function(ax,aw){return(ax[0]-aw[0])||(aw[1]-ax[1])});var al=[];var ar=[];for(var au=0;auav[0]){if(av[1]+1>av[0]){ap.push("-")}ap.push(W(av[1]))}}ap.push("]");return ap.join("")}function Z(ao){var am=ao.source.match(new RegExp("(?:"+"\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]"+"|\\\\u[A-Fa-f0-9]{4}"+"|\\\\x[A-Fa-f0-9]{2}"+"|\\\\[0-9]+"+"|\\\\[^ux0-9]"+"|\\(\\?[:!=]"+"|[\\(\\)\\^]"+"|[^\\x5B\\x5C\\(\\)\\^]+"+")","g"));var ak=am.length;var aq=[];for(var an=0,ap=0;an=2&&al==="["){am[an]=aa(aj)}else{if(al!=="\\"){am[an]=aj.replace(/[a-zA-Z]/g,function(ar){var at=ar.charCodeAt(0);return"["+String.fromCharCode(at&~32,at|32)+"]"})}}}}return am.join("")}var ad=[];for(var Y=0,X=ac.length;Y=0;){V[af.charAt(ah)]=ab}}var ai=ab[1];var ad=""+ai;if(!aj.hasOwnProperty(ad)){ak.push(ai);aj[ad]=null}}ak.push(/[\0-\uffff]/);Y=k(ak)})();var aa=W.length;var Z=function(ak){var ac=ak.sourceCode,ab=ak.basePos;var ag=[ab,H];var ai=0;var aq=ac.match(Y)||[];var am={};for(var ah=0,au=aq.length;ah=5&&"lang-"===at.substring(0,5);if(ap&&!(al&&typeof al[1]==="string")){ap=false;at=L}if(!ap){am[aj]=at}}var ae=ai;ai+=aj.length;if(!ap){ag.push(ab+ae,at)}else{var ao=al[1];var an=aj.indexOf(ao);var af=an+ao.length;if(al[2]){af=aj.length-al[2].length;an=af-ao.length}var av=at.substring(5);D(ab+ae,aj.substring(0,an),Z,ag);D(ab+ae+an,ao,q(av,ao),ag);D(ab+ae+af,aj.substring(af),Z,ag)}}ak.decorations=ag};return Z}function h(af){var X=[],ab=[];if(af["tripleQuotedStrings"]){X.push([E,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(af["multiLineStrings"]){X.push([E,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{X.push([E,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(af["verbatimStrings"]){ab.push([E,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ad=af["hashComments"];if(ad){if(af["cStyleComments"]){if(ad>1){X.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{X.push([j,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}ab.push([E,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{X.push([j,/^#[^\r\n]*/,null,"#"])}}if(af["cStyleComments"]){ab.push([j,/^\/\/[^\r\n]*/,null]);ab.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}var W=af["regexLiterals"];if(W){var Y=W>1?"":"\n\r";var aa=Y?".":"[\\S\\s]";var Z=("/(?=[^/*"+Y+"])"+"(?:[^/\\x5B\\x5C"+Y+"]"+"|\\x5C"+aa+"|\\x5B(?:[^\\x5C\\x5D"+Y+"]"+"|\\x5C"+aa+")*(?:\\x5D|$))+"+"/");ab.push(["lang-regex",RegExp("^"+O+"("+Z+")")])}var ae=af["types"];if(ae){ab.push([R,ae])}var ac=(""+af["keywords"]).replace(/^ | $/g,"");if(ac.length){ab.push([B,new RegExp("^(?:"+ac.replace(/[\s,]+/g,"|")+")\\b"),null])}X.push([H,/^\s+/,null," \r\n\t\xA0"]);var V="^.[^\\s\\w.$@'\"`/\\\\]*";if(af["regexLiterals"]){V+="(?!s*/)"}ab.push([I,/^@[a-z_$][a-z_$@0-9]*/i,null],[R,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[H,/^[a-z_$][a-z_$@0-9]*/i,null],[I,new RegExp("^(?:"+"0x[a-f0-9]+"+"|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)"+"(?:e[+\\-]?\\d+)?"+")"+"[a-z]*","i"),null,"0123456789"],[H,/^\\[\s\S]?/,null],[N,new RegExp(V),null]);return f(X,ab)}var M=h({"keywords":C,"hashComments":true,"cStyleComments":true,"multiLineStrings":true,"regexLiterals":true});function T(X,ai,ab){var W=/(?:^|\s)nocode(?:\s|$)/;var ad=/\r\n?|\n/;var ae=X.ownerDocument;var ah=ae.createElement("li");while(X.firstChild){ah.appendChild(X.firstChild)}var Y=[ah];function ag(ao){var an=ao.nodeType;if(an==1&&!W.test(ao.className)){if("br"===ao.nodeName){af(ao);if(ao.parentNode){ao.parentNode.removeChild(ao)}}else{for(var aq=ao.firstChild;aq;aq=aq.nextSibling){ag(aq)}}}else{if((an==3||an==4)&&ab){var ap=ao.nodeValue;var al=ap.match(ad);if(al){var ak=ap.substring(0,al.index);ao.nodeValue=ak;var aj=ap.substring(al.index+al[0].length);if(aj){var am=ao.parentNode;am.insertBefore(ae.createTextNode(aj),ao.nextSibling)}af(ao);if(!ak){ao.parentNode.removeChild(ao)}}}}}function af(am){while(!am.nextSibling){am=am.parentNode;if(!am){return}}function ak(an,au){var at=au?an.cloneNode(false):an;var aq=an.parentNode;if(aq){var ar=ak(aq,1);var ap=an.nextSibling;ar.appendChild(at);for(var ao=ap;ao;ao=ap){ap=ao.nextSibling;ar.appendChild(ao)}}return at}var aj=ak(am.nextSibling,0);for(var al;(al=aj.parentNode)&&al.nodeType===1;){aj=al}Y.push(aj)}for(var aa=0;aa=V){ak+=2}if(Z>=at){ad+=2}}}finally{if(av){av.style.display=al}}}var t={};function c(X,Y){for(var V=Y.length;--V>=0;){var W=Y[V];if(!t.hasOwnProperty(W)){t[W]=X}else{if(P["console"]){console["warn"]("cannot override language handler %s",W)}}}}function q(W,V){if(!(W&&t.hasOwnProperty(W))){W=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[N,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(f([[H,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[S,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[N,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(f([],[[n,/^[\s\S]+/]]),["uq.val"]);c(h({"keywords":l,"hashComments":true,"cStyleComments":true,"types":e}),["c","cc","cpp","cxx","cyc","m"]);c(h({"keywords":"null,true,false"}),["json"]);c(h({"keywords":U,"hashComments":true,"cStyleComments":true,"verbatimStrings":true,"types":e}),["cs"]);c(h({"keywords":y,"cStyleComments":true}),["java"]);c(h({"keywords":J,"hashComments":true,"multiLineStrings":true}),["bash","bsh","csh","sh"]);c(h({"keywords":K,"hashComments":true,"multiLineStrings":true,"tripleQuotedStrings":true}),["cv","py","python"]);c(h({"keywords":s,"hashComments":true,"multiLineStrings":true,"regexLiterals":2}),["perl","pl","pm"]);c(h({"keywords":g,"hashComments":true,"multiLineStrings":true,"regexLiterals":true}),["rb","ruby"]);c(h({"keywords":x,"cStyleComments":true,"regexLiterals":true}),["javascript","js"]);c(h({"keywords":r,"hashComments":3,"cStyleComments":true,"multilineStrings":true,"tripleQuotedStrings":true,"regexLiterals":true}),["coffee"]);c(h({"keywords":z,"cStyleComments":true,"multilineStrings":true}),["rc","rs","rust"]);c(f([],[[E,/^[\s\S]+/]]),["regex"]);function d(Y){var X=Y.langExtension;try{var V=b(Y.sourceNode,Y.pre);var W=V.sourceCode;Y.sourceCode=W;Y.spans=V.spans;Y.basePos=0;q(X,W)(Y);F(Y)}catch(Z){if(P["console"]){console["log"](Z&&Z["stack"]||Z)}}}function A(Z,Y,X){var V=document.createElement("div");V.innerHTML="
        "+Z+"
        ";V=V.firstChild;if(X){T(V,X,true)}var W={langExtension:Y,numberLines:X,sourceNode:V,pre:1};d(W);return V.innerHTML}function w(al,ab){var ah=ab||document.body;var ao=ah.ownerDocument||document;function aa(aq){return ah.getElementsByTagName(aq)}var ad=[aa("pre"),aa("code"),aa("xmp")];var ae=[];for(var ak=0;akp;p++)"zIndex"in h[p]&&(l.push(h[p].zIndex),h[p].zIndex<0&&(m[h[p].zIndex]=h[p]));for(l.sort(i);l[j]<0;)if(e=m[l[j++]],n.push(e.apply(d,g)),c)return c=f,n;for(p=0;q>p;p++)if(e=h[p],"zIndex"in e)if(e.zIndex==l[j]){if(n.push(e.apply(d,g)),c)break;do if(j++,e=m[l[j]],e&&n.push(e.apply(d,g)),c)break;while(e)}else m[e.zIndex]=e;else if(n.push(e.apply(d,g)),c)break;return c=f,b=o,n.length?n:null};k._events=j,k.listeners=function(a){var b,c,d,e,h,i,k,l,m=a.split(f),n=j,o=[n],p=[];for(e=0,h=m.length;h>e;e++){for(l=[],i=0,k=o.length;k>i;i++)for(n=o[i].n,c=[n[m[e]],n[g]],d=2;d--;)b=c[d],b&&(l.push(b),p=p.concat(b.f||[]));o=l}return p},k.on=function(a,b){if(a=String(a),"function"!=typeof b)return function(){};for(var c=a.split(f),d=j,e=0,g=c.length;g>e;e++)d=d.n,d=d.hasOwnProperty(c[e])&&d[c[e]]||(d[c[e]]={n:{}});for(d.f=d.f||[],e=0,g=d.f.length;g>e;e++)if(d.f[e]==b)return h;return d.f.push(b),function(a){+a==+a&&(b.zIndex=+a)}},k.f=function(a){var b=[].slice.call(arguments,1);return function(){k.apply(null,[a,null].concat(b).concat([].slice.call(arguments,0)))}},k.stop=function(){c=1},k.nt=function(a){return a?new RegExp("(?:\\.|\\/|^)"+a+"(?:\\.|\\/|$)").test(b):b},k.nts=function(){return b.split(f)},k.off=k.unbind=function(a,b){if(!a)return void(k._events=j={n:{}});var c,d,h,i,l,m,n,o=a.split(f),p=[j];for(i=0,l=o.length;l>i;i++)for(m=0;mi;i++)for(c=p[i];c.n;){if(b){if(c.f){for(m=0,n=c.f.length;n>m;m++)if(c.f[m]==b){c.f.splice(m,1);break}!c.f.length&&delete c.f}for(d in c.n)if(c.n[e](d)&&c.n[d].f){var q=c.n[d].f;for(m=0,n=q.length;n>m;m++)if(q[m]==b){q.splice(m,1);break}!q.length&&delete c.n[d].f}}else{delete c.f;for(d in c.n)c.n[e](d)&&c.n[d].f&&delete c.n[d].f}c=c.n}},k.once=function(a,b){var c=function(){return k.unbind(a,c),b.apply(this,arguments)};return k.on(a,c)},k.version=d,k.toString=function(){return"You are running Eve "+d},"undefined"!=typeof module&&module.exports?module.exports=k:"undefined"!=typeof define?define("eve",[],function(){return k}):a.eve=k}(window||this),function(a,b){"function"==typeof define&&define.amd?define(["eve"],function(c){return b(a,c)}):b(a,a.eve||"function"==typeof require&&require("eve"))}(this,function(a,b){function c(a){if(c.is(a,"function"))return u?a():b.on("raphael.DOMload",a);if(c.is(a,V))return c._engine.create[D](c,a.splice(0,3+c.is(a[0],T))).add(a);var d=Array.prototype.slice.call(arguments,0);if(c.is(d[d.length-1],"function")){var e=d.pop();return u?e.call(c._engine.create[D](c,d)):b.on("raphael.DOMload",function(){e.call(c._engine.create[D](c,d))})}return c._engine.create[D](c,arguments)}function d(a){if("function"==typeof a||Object(a)!==a)return a;var b=new a.constructor;for(var c in a)a[z](c)&&(b[c]=d(a[c]));return b}function e(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return a.push(a.splice(c,1)[0])}function f(a,b,c){function d(){var f=Array.prototype.slice.call(arguments,0),g=f.join("␀"),h=d.cache=d.cache||{},i=d.count=d.count||[];return h[z](g)?(e(i,g),c?c(h[g]):h[g]):(i.length>=1e3&&delete h[i.shift()],i.push(g),h[g]=a[D](b,f),c?c(h[g]):h[g])}return d}function g(){return this.hex}function h(a,b){for(var c=[],d=0,e=a.length;e-2*!b>d;d+=2){var f=[{x:+a[d-2],y:+a[d-1]},{x:+a[d],y:+a[d+1]},{x:+a[d+2],y:+a[d+3]},{x:+a[d+4],y:+a[d+5]}];b?d?e-4==d?f[3]={x:+a[0],y:+a[1]}:e-2==d&&(f[2]={x:+a[0],y:+a[1]},f[3]={x:+a[2],y:+a[3]}):f[0]={x:+a[e-2],y:+a[e-1]}:e-4==d?f[3]=f[2]:d||(f[0]={x:+a[d],y:+a[d+1]}),c.push(["C",(-f[0].x+6*f[1].x+f[2].x)/6,(-f[0].y+6*f[1].y+f[2].y)/6,(f[1].x+6*f[2].x-f[3].x)/6,(f[1].y+6*f[2].y-f[3].y)/6,f[2].x,f[2].y])}return c}function i(a,b,c,d,e){var f=-3*b+9*c-9*d+3*e,g=a*f+6*b-12*c+6*d;return a*g-3*b+3*c}function j(a,b,c,d,e,f,g,h,j){null==j&&(j=1),j=j>1?1:0>j?0:j;for(var k=j/2,l=12,m=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],n=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],o=0,p=0;l>p;p++){var q=k*m[p]+k,r=i(q,a,c,e,g),s=i(q,b,d,f,h),t=r*r+s*s;o+=n[p]*N.sqrt(t)}return k*o}function k(a,b,c,d,e,f,g,h,i){if(!(0>i||j(a,b,c,d,e,f,g,h)o;)m/=2,n+=(i>k?1:-1)*m,k=j(a,b,c,d,e,f,g,h,n);return n}}function l(a,b,c,d,e,f,g,h){if(!(O(a,c)O(e,g)||O(b,d)O(f,h))){var i=(a*d-b*c)*(e-g)-(a-c)*(e*h-f*g),j=(a*d-b*c)*(f-h)-(b-d)*(e*h-f*g),k=(a-c)*(f-h)-(b-d)*(e-g);if(k){var l=i/k,m=j/k,n=+l.toFixed(2),o=+m.toFixed(2);if(!(n<+P(a,c).toFixed(2)||n>+O(a,c).toFixed(2)||n<+P(e,g).toFixed(2)||n>+O(e,g).toFixed(2)||o<+P(b,d).toFixed(2)||o>+O(b,d).toFixed(2)||o<+P(f,h).toFixed(2)||o>+O(f,h).toFixed(2)))return{x:l,y:m}}}}function m(a,b,d){var e=c.bezierBBox(a),f=c.bezierBBox(b);if(!c.isBBoxIntersect(e,f))return d?0:[];for(var g=j.apply(0,a),h=j.apply(0,b),i=O(~~(g/5),1),k=O(~~(h/5),1),m=[],n=[],o={},p=d?0:[],q=0;i+1>q;q++){var r=c.findDotsAtSegment.apply(c,a.concat(q/i));m.push({x:r.x,y:r.y,t:q/i})}for(q=0;k+1>q;q++)r=c.findDotsAtSegment.apply(c,b.concat(q/k)),n.push({x:r.x,y:r.y,t:q/k});for(q=0;i>q;q++)for(var s=0;k>s;s++){var t=m[q],u=m[q+1],v=n[s],w=n[s+1],x=Q(u.x-t.x)<.001?"y":"x",y=Q(w.x-v.x)<.001?"y":"x",z=l(t.x,t.y,u.x,u.y,v.x,v.y,w.x,w.y);if(z){if(o[z.x.toFixed(4)]==z.y.toFixed(4))continue;o[z.x.toFixed(4)]=z.y.toFixed(4);var A=t.t+Q((z[x]-t[x])/(u[x]-t[x]))*(u.t-t.t),B=v.t+Q((z[y]-v[y])/(w[y]-v[y]))*(w.t-v.t);A>=0&&1.001>=A&&B>=0&&1.001>=B&&(d?p++:p.push({x:z.x,y:z.y,t1:P(A,1),t2:P(B,1)}))}}return p}function n(a,b,d){a=c._path2curve(a),b=c._path2curve(b);for(var e,f,g,h,i,j,k,l,n,o,p=d?0:[],q=0,r=a.length;r>q;q++){var s=a[q];if("M"==s[0])e=i=s[1],f=j=s[2];else{"C"==s[0]?(n=[e,f].concat(s.slice(1)),e=n[6],f=n[7]):(n=[e,f,e,f,i,j,i,j],e=i,f=j);for(var t=0,u=b.length;u>t;t++){var v=b[t];if("M"==v[0])g=k=v[1],h=l=v[2];else{"C"==v[0]?(o=[g,h].concat(v.slice(1)),g=o[6],h=o[7]):(o=[g,h,g,h,k,l,k,l],g=k,h=l);var w=m(n,o,d);if(d)p+=w;else{for(var x=0,y=w.length;y>x;x++)w[x].segment1=q,w[x].segment2=t,w[x].bez1=n,w[x].bez2=o;p=p.concat(w)}}}}}return p}function o(a,b,c,d,e,f){null!=a?(this.a=+a,this.b=+b,this.c=+c,this.d=+d,this.e=+e,this.f=+f):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0)}function p(){return this.x+H+this.y+H+this.width+" × "+this.height}function q(a,b,c,d,e,f){function g(a){return((l*a+k)*a+j)*a}function h(a,b){var c=i(a,b);return((o*c+n)*c+m)*c}function i(a,b){var c,d,e,f,h,i;for(e=a,i=0;8>i;i++){if(f=g(e)-a,Q(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),Q(f-a)f?c=e:d=e,e=(d-c)/2+c}return e}var j=3*b,k=3*(d-b)-j,l=1-j-k,m=3*c,n=3*(e-c)-m,o=1-m-n;return h(a,1/(200*f))}function r(a,b){var c=[],d={};if(this.ms=b,this.times=1,a){for(var e in a)a[z](e)&&(d[_(e)]=a[e],c.push(_(e)));c.sort(lb)}this.anim=d,this.top=c[c.length-1],this.percents=c}function s(a,d,e,f,g,h){e=_(e);var i,j,k,l,m,n,p=a.ms,r={},s={},t={};if(f)for(v=0,x=ic.length;x>v;v++){var u=ic[v];if(u.el.id==d.id&&u.anim==a){u.percent!=e?(ic.splice(v,1),k=1):j=u,d.attr(u.totalOrigin);break}}else f=+s;for(var v=0,x=a.percents.length;x>v;v++){if(a.percents[v]==e||a.percents[v]>f*a.top){e=a.percents[v],m=a.percents[v-1]||0,p=p/a.top*(e-m),l=a.percents[v+1],i=a.anim[e];break}f&&d.attr(a.anim[a.percents[v]])}if(i){if(j)j.initstatus=f,j.start=new Date-j.ms*f;else{for(var y in i)if(i[z](y)&&(db[z](y)||d.paper.customAttributes[z](y)))switch(r[y]=d.attr(y),null==r[y]&&(r[y]=cb[y]),s[y]=i[y],db[y]){case T:t[y]=(s[y]-r[y])/p;break;case"colour":r[y]=c.getRGB(r[y]);var A=c.getRGB(s[y]);t[y]={r:(A.r-r[y].r)/p,g:(A.g-r[y].g)/p,b:(A.b-r[y].b)/p};break;case"path":var B=Kb(r[y],s[y]),C=B[1];for(r[y]=B[0],t[y]=[],v=0,x=r[y].length;x>v;v++){t[y][v]=[0];for(var D=1,F=r[y][v].length;F>D;D++)t[y][v][D]=(C[v][D]-r[y][v][D])/p}break;case"transform":var G=d._,H=Pb(G[y],s[y]);if(H)for(r[y]=H.from,s[y]=H.to,t[y]=[],t[y].real=!0,v=0,x=r[y].length;x>v;v++)for(t[y][v]=[r[y][v][0]],D=1,F=r[y][v].length;F>D;D++)t[y][v][D]=(s[y][v][D]-r[y][v][D])/p;else{var K=d.matrix||new o,L={_:{transform:G.transform},getBBox:function(){return d.getBBox(1)}};r[y]=[K.a,K.b,K.c,K.d,K.e,K.f],Nb(L,s[y]),s[y]=L._.transform,t[y]=[(L.matrix.a-K.a)/p,(L.matrix.b-K.b)/p,(L.matrix.c-K.c)/p,(L.matrix.d-K.d)/p,(L.matrix.e-K.e)/p,(L.matrix.f-K.f)/p]}break;case"csv":var M=I(i[y])[J](w),N=I(r[y])[J](w);if("clip-rect"==y)for(r[y]=N,t[y]=[],v=N.length;v--;)t[y][v]=(M[v]-r[y][v])/p;s[y]=M;break;default:for(M=[][E](i[y]),N=[][E](r[y]),t[y]=[],v=d.paper.customAttributes[y].length;v--;)t[y][v]=((M[v]||0)-(N[v]||0))/p}var O=i.easing,P=c.easing_formulas[O];if(!P)if(P=I(O).match(Z),P&&5==P.length){var Q=P;P=function(a){return q(a,+Q[1],+Q[2],+Q[3],+Q[4],p)}}else P=nb;if(n=i.start||a.start||+new Date,u={anim:a,percent:e,timestamp:n,start:n+(a.del||0),status:0,initstatus:f||0,stop:!1,ms:p,easing:P,from:r,diff:t,to:s,el:d,callback:i.callback,prev:m,next:l,repeat:h||a.times,origin:d.attr(),totalOrigin:g},ic.push(u),f&&!j&&!k&&(u.stop=!0,u.start=new Date-p*f,1==ic.length))return kc();k&&(u.start=new Date-u.ms*f),1==ic.length&&jc(kc)}b("raphael.anim.start."+d.id,d,a)}}function t(a){for(var b=0;be;e++)for(i=a[e],f=1,h=i.length;h>f;f+=2)c=b.x(i[f],i[f+1]),d=b.y(i[f],i[f+1]),i[f]=c,i[f+1]=d;return a};if(c._g=A,c.type=A.win.SVGAngle||A.doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML","VML"==c.type){var sb,tb=A.doc.createElement("div");if(tb.innerHTML='',sb=tb.firstChild,sb.style.behavior="url(#default#VML)",!sb||"object"!=typeof sb.adj)return c.type=G;tb=null}c.svg=!(c.vml="VML"==c.type),c._Paper=C,c.fn=v=C.prototype=c.prototype,c._id=0,c._oid=0,c.is=function(a,b){return b=M.call(b),"finite"==b?!Y[z](+a):"array"==b?a instanceof Array:"null"==b&&null===a||b==typeof a&&null!==a||"object"==b&&a===Object(a)||"array"==b&&Array.isArray&&Array.isArray(a)||W.call(a).slice(8,-1).toLowerCase()==b},c.angle=function(a,b,d,e,f,g){if(null==f){var h=a-d,i=b-e;return h||i?(180+180*N.atan2(-i,-h)/S+360)%360:0}return c.angle(a,b,f,g)-c.angle(d,e,f,g)},c.rad=function(a){return a%360*S/180},c.deg=function(a){return 180*a/S%360},c.snapTo=function(a,b,d){if(d=c.is(d,"finite")?d:10,c.is(a,V)){for(var e=a.length;e--;)if(Q(a[e]-b)<=d)return a[e]}else{a=+a;var f=b%a;if(d>f)return b-f;if(f>a-d)return b-f+a}return b};c.createUUID=function(a,b){return function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(a,b).toUpperCase()}}(/[xy]/g,function(a){var b=16*N.random()|0,c="x"==a?b:3&b|8;return c.toString(16)});c.setWindow=function(a){b("raphael.setWindow",c,A.win,a),A.win=a,A.doc=A.win.document,c._engine.initWin&&c._engine.initWin(A.win)};var ub=function(a){if(c.vml){var b,d=/^\s+|\s+$/g;try{var e=new ActiveXObject("htmlfile");e.write(""),e.close(),b=e.body}catch(g){b=createPopup().document.body}var h=b.createTextRange();ub=f(function(a){try{b.style.color=I(a).replace(d,G);var c=h.queryCommandValue("ForeColor");return c=(255&c)<<16|65280&c|(16711680&c)>>>16,"#"+("000000"+c.toString(16)).slice(-6)}catch(e){return"none"}})}else{var i=A.doc.createElement("i");i.title="Raphaël Colour Picker",i.style.display="none",A.doc.body.appendChild(i),ub=f(function(a){return i.style.color=a,A.doc.defaultView.getComputedStyle(i,G).getPropertyValue("color")})}return ub(a)},vb=function(){return"hsb("+[this.h,this.s,this.b]+")"},wb=function(){return"hsl("+[this.h,this.s,this.l]+")"},xb=function(){return this.hex},yb=function(a,b,d){if(null==b&&c.is(a,"object")&&"r"in a&&"g"in a&&"b"in a&&(d=a.b,b=a.g,a=a.r),null==b&&c.is(a,U)){var e=c.getRGB(a);a=e.r,b=e.g,d=e.b}return(a>1||b>1||d>1)&&(a/=255,b/=255,d/=255),[a,b,d]},zb=function(a,b,d,e){a*=255,b*=255,d*=255;var f={r:a,g:b,b:d,hex:c.rgb(a,b,d),toString:xb};return c.is(e,"finite")&&(f.opacity=e),f};c.color=function(a){var b;return c.is(a,"object")&&"h"in a&&"s"in a&&"b"in a?(b=c.hsb2rgb(a),a.r=b.r,a.g=b.g,a.b=b.b,a.hex=b.hex):c.is(a,"object")&&"h"in a&&"s"in a&&"l"in a?(b=c.hsl2rgb(a),a.r=b.r,a.g=b.g,a.b=b.b,a.hex=b.hex):(c.is(a,"string")&&(a=c.getRGB(a)),c.is(a,"object")&&"r"in a&&"g"in a&&"b"in a?(b=c.rgb2hsl(a),a.h=b.h,a.s=b.s,a.l=b.l,b=c.rgb2hsb(a),a.v=b.b):(a={hex:"none"},a.r=a.g=a.b=a.h=a.s=a.v=a.l=-1)),a.toString=xb,a},c.hsb2rgb=function(a,b,c,d){this.is(a,"object")&&"h"in a&&"s"in a&&"b"in a&&(c=a.b,b=a.s,d=a.o,a=a.h),a*=360;var e,f,g,h,i;return a=a%360/60,i=c*b,h=i*(1-Q(a%2-1)),e=f=g=c-i,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a],zb(e,f,g,d)},c.hsl2rgb=function(a,b,c,d){this.is(a,"object")&&"h"in a&&"s"in a&&"l"in a&&(c=a.l,b=a.s,a=a.h),(a>1||b>1||c>1)&&(a/=360,b/=100,c/=100),a*=360;var e,f,g,h,i;return a=a%360/60,i=2*b*(.5>c?c:1-c),h=i*(1-Q(a%2-1)),e=f=g=c-i/2,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a],zb(e,f,g,d)},c.rgb2hsb=function(a,b,c){c=yb(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g;return f=O(a,b,c),g=f-P(a,b,c),d=0==g?null:f==a?(b-c)/g:f==b?(c-a)/g+2:(a-b)/g+4,d=(d+360)%6*60/360,e=0==g?0:g/f,{h:d,s:e,b:f,toString:vb}},c.rgb2hsl=function(a,b,c){c=yb(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g,h,i;return g=O(a,b,c),h=P(a,b,c),i=g-h,d=0==i?null:g==a?(b-c)/i:g==b?(c-a)/i+2:(a-b)/i+4,d=(d+360)%6*60/360,f=(g+h)/2,e=0==i?0:.5>f?i/(2*f):i/(2-2*f),{h:d,s:e,l:f,toString:wb}},c._path2string=function(){return this.join(",").replace(gb,"$1")};c._preload=function(a,b){var c=A.doc.createElement("img");c.style.cssText="position:absolute;left:-9999em;top:-9999em",c.onload=function(){b.call(this),this.onload=null,A.doc.body.removeChild(this)},c.onerror=function(){A.doc.body.removeChild(this)},A.doc.body.appendChild(c),c.src=a};c.getRGB=f(function(a){if(!a||(a=I(a)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:g};if("none"==a)return{r:-1,g:-1,b:-1,hex:"none",toString:g};!(fb[z](a.toLowerCase().substring(0,2))||"#"==a.charAt())&&(a=ub(a));var b,d,e,f,h,i,j=a.match(X);return j?(j[2]&&(e=ab(j[2].substring(5),16),d=ab(j[2].substring(3,5),16),b=ab(j[2].substring(1,3),16)),j[3]&&(e=ab((h=j[3].charAt(3))+h,16),d=ab((h=j[3].charAt(2))+h,16),b=ab((h=j[3].charAt(1))+h,16)),j[4]&&(i=j[4][J](eb),b=_(i[0]),"%"==i[0].slice(-1)&&(b*=2.55),d=_(i[1]),"%"==i[1].slice(-1)&&(d*=2.55),e=_(i[2]),"%"==i[2].slice(-1)&&(e*=2.55),"rgba"==j[1].toLowerCase().slice(0,4)&&(f=_(i[3])),i[3]&&"%"==i[3].slice(-1)&&(f/=100)),j[5]?(i=j[5][J](eb),b=_(i[0]),"%"==i[0].slice(-1)&&(b*=2.55),d=_(i[1]),"%"==i[1].slice(-1)&&(d*=2.55),e=_(i[2]),"%"==i[2].slice(-1)&&(e*=2.55),("deg"==i[0].slice(-3)||"°"==i[0].slice(-1))&&(b/=360),"hsba"==j[1].toLowerCase().slice(0,4)&&(f=_(i[3])),i[3]&&"%"==i[3].slice(-1)&&(f/=100),c.hsb2rgb(b,d,e,f)):j[6]?(i=j[6][J](eb),b=_(i[0]),"%"==i[0].slice(-1)&&(b*=2.55),d=_(i[1]),"%"==i[1].slice(-1)&&(d*=2.55),e=_(i[2]),"%"==i[2].slice(-1)&&(e*=2.55),("deg"==i[0].slice(-3)||"°"==i[0].slice(-1))&&(b/=360),"hsla"==j[1].toLowerCase().slice(0,4)&&(f=_(i[3])),i[3]&&"%"==i[3].slice(-1)&&(f/=100),c.hsl2rgb(b,d,e,f)):(j={r:b,g:d,b:e,toString:g},j.hex="#"+(16777216|e|d<<8|b<<16).toString(16).slice(1),c.is(f,"finite")&&(j.opacity=f),j)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:g}},c),c.hsb=f(function(a,b,d){return c.hsb2rgb(a,b,d).hex}),c.hsl=f(function(a,b,d){return c.hsl2rgb(a,b,d).hex}),c.rgb=f(function(a,b,c){return"#"+(16777216|c|b<<8|a<<16).toString(16).slice(1)}),c.getColor=function(a){var b=this.getColor.start=this.getColor.start||{h:0,s:1,b:a||.75},c=this.hsb2rgb(b.h,b.s,b.b);return b.h+=.075,b.h>1&&(b.h=0,b.s-=.2,b.s<=0&&(this.getColor.start={h:0,s:1,b:b.b})),c.hex},c.getColor.reset=function(){delete this.start},c.parsePathString=function(a){if(!a)return null;var b=Ab(a);if(b.arr)return Cb(b.arr);var d={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},e=[];return c.is(a,V)&&c.is(a[0],V)&&(e=Cb(a)),e.length||I(a).replace(hb,function(a,b,c){var f=[],g=b.toLowerCase();if(c.replace(jb,function(a,b){b&&f.push(+b)}),"m"==g&&f.length>2&&(e.push([b][E](f.splice(0,2))),g="l",b="m"==b?"l":"L"),"r"==g)e.push([b][E](f));else for(;f.length>=d[g]&&(e.push([b][E](f.splice(0,d[g]))),d[g]););}),e.toString=c._path2string,b.arr=Cb(e),e},c.parseTransformString=f(function(a){if(!a)return null;var b=[];return c.is(a,V)&&c.is(a[0],V)&&(b=Cb(a)),b.length||I(a).replace(ib,function(a,c,d){{var e=[];M.call(c)}d.replace(jb,function(a,b){b&&e.push(+b)}),b.push([c][E](e))}),b.toString=c._path2string,b});var Ab=function(a){var b=Ab.ps=Ab.ps||{};return b[a]?b[a].sleep=100:b[a]={sleep:100},setTimeout(function(){for(var c in b)b[z](c)&&c!=a&&(b[c].sleep--,!b[c].sleep&&delete b[c])}),b[a]};c.findDotsAtSegment=function(a,b,c,d,e,f,g,h,i){var j=1-i,k=R(j,3),l=R(j,2),m=i*i,n=m*i,o=k*a+3*l*i*c+3*j*i*i*e+n*g,p=k*b+3*l*i*d+3*j*i*i*f+n*h,q=a+2*i*(c-a)+m*(e-2*c+a),r=b+2*i*(d-b)+m*(f-2*d+b),s=c+2*i*(e-c)+m*(g-2*e+c),t=d+2*i*(f-d)+m*(h-2*f+d),u=j*a+i*c,v=j*b+i*d,w=j*e+i*g,x=j*f+i*h,y=90-180*N.atan2(q-s,r-t)/S;return(q>s||t>r)&&(y+=180),{x:o,y:p,m:{x:q,y:r},n:{x:s,y:t},start:{x:u,y:v},end:{x:w,y:x},alpha:y}},c.bezierBBox=function(a,b,d,e,f,g,h,i){c.is(a,"array")||(a=[a,b,d,e,f,g,h,i]);var j=Jb.apply(null,a);return{x:j.min.x,y:j.min.y,x2:j.max.x,y2:j.max.y,width:j.max.x-j.min.x,height:j.max.y-j.min.y}},c.isPointInsideBBox=function(a,b,c){return b>=a.x&&b<=a.x2&&c>=a.y&&c<=a.y2},c.isBBoxIntersect=function(a,b){var d=c.isPointInsideBBox;return d(b,a.x,a.y)||d(b,a.x2,a.y)||d(b,a.x,a.y2)||d(b,a.x2,a.y2)||d(a,b.x,b.y)||d(a,b.x2,b.y)||d(a,b.x,b.y2)||d(a,b.x2,b.y2)||(a.xb.x||b.xa.x)&&(a.yb.y||b.ya.y)},c.pathIntersection=function(a,b){return n(a,b)},c.pathIntersectionNumber=function(a,b){return n(a,b,1)},c.isPointInsidePath=function(a,b,d){var e=c.pathBBox(a);return c.isPointInsideBBox(e,b,d)&&n(a,[["M",b,d],["H",e.x2+10]],1)%2==1},c._removedFactory=function(a){return function(){b("raphael.log",null,"Raphaël: you are calling to method “"+a+"” of removed object",a)}};var Bb=c.pathBBox=function(a){var b=Ab(a);if(b.bbox)return d(b.bbox);if(!a)return{x:0,y:0,width:0,height:0,x2:0,y2:0};a=Kb(a);for(var c,e=0,f=0,g=[],h=[],i=0,j=a.length;j>i;i++)if(c=a[i],"M"==c[0])e=c[1],f=c[2],g.push(e),h.push(f);else{var k=Jb(e,f,c[1],c[2],c[3],c[4],c[5],c[6]);g=g[E](k.min.x,k.max.x),h=h[E](k.min.y,k.max.y),e=c[5],f=c[6]}var l=P[D](0,g),m=P[D](0,h),n=O[D](0,g),o=O[D](0,h),p=n-l,q=o-m,r={x:l,y:m,x2:n,y2:o,width:p,height:q,cx:l+p/2,cy:m+q/2};return b.bbox=d(r),r},Cb=function(a){var b=d(a);return b.toString=c._path2string,b},Db=c._pathToRelative=function(a){var b=Ab(a);if(b.rel)return Cb(b.rel);c.is(a,V)&&c.is(a&&a[0],V)||(a=c.parsePathString(a));var d=[],e=0,f=0,g=0,h=0,i=0;"M"==a[0][0]&&(e=a[0][1],f=a[0][2],g=e,h=f,i++,d.push(["M",e,f]));for(var j=i,k=a.length;k>j;j++){var l=d[j]=[],m=a[j];if(m[0]!=M.call(m[0]))switch(l[0]=M.call(m[0]),l[0]){case"a":l[1]=m[1],l[2]=m[2],l[3]=m[3],l[4]=m[4],l[5]=m[5],l[6]=+(m[6]-e).toFixed(3),l[7]=+(m[7]-f).toFixed(3);break;case"v":l[1]=+(m[1]-f).toFixed(3);break;case"m":g=m[1],h=m[2];default:for(var n=1,o=m.length;o>n;n++)l[n]=+(m[n]-(n%2?e:f)).toFixed(3)}else{l=d[j]=[],"m"==m[0]&&(g=m[1]+e,h=m[2]+f);for(var p=0,q=m.length;q>p;p++)d[j][p]=m[p]}var r=d[j].length;switch(d[j][0]){case"z":e=g,f=h;break;case"h":e+=+d[j][r-1];break;case"v":f+=+d[j][r-1];break;default:e+=+d[j][r-2],f+=+d[j][r-1]}}return d.toString=c._path2string,b.rel=Cb(d),d},Eb=c._pathToAbsolute=function(a){var b=Ab(a);if(b.abs)return Cb(b.abs);if(c.is(a,V)&&c.is(a&&a[0],V)||(a=c.parsePathString(a)),!a||!a.length)return[["M",0,0]];var d=[],e=0,f=0,g=0,i=0,j=0;"M"==a[0][0]&&(e=+a[0][1],f=+a[0][2],g=e,i=f,j++,d[0]=["M",e,f]);for(var k,l,m=3==a.length&&"M"==a[0][0]&&"R"==a[1][0].toUpperCase()&&"Z"==a[2][0].toUpperCase(),n=j,o=a.length;o>n;n++){if(d.push(k=[]),l=a[n],l[0]!=bb.call(l[0]))switch(k[0]=bb.call(l[0]),k[0]){case"A":k[1]=l[1],k[2]=l[2],k[3]=l[3],k[4]=l[4],k[5]=l[5],k[6]=+(l[6]+e),k[7]=+(l[7]+f);break;case"V":k[1]=+l[1]+f;break;case"H":k[1]=+l[1]+e;break;case"R":for(var p=[e,f][E](l.slice(1)),q=2,r=p.length;r>q;q++)p[q]=+p[q]+e,p[++q]=+p[q]+f;d.pop(),d=d[E](h(p,m));break;case"M":g=+l[1]+e,i=+l[2]+f;default:for(q=1,r=l.length;r>q;q++)k[q]=+l[q]+(q%2?e:f)}else if("R"==l[0])p=[e,f][E](l.slice(1)),d.pop(),d=d[E](h(p,m)),k=["R"][E](l.slice(-2));else for(var s=0,t=l.length;t>s;s++)k[s]=l[s];switch(k[0]){case"Z":e=g,f=i;break;case"H":e=k[1];break;case"V":f=k[1];break;case"M":g=k[k.length-2],i=k[k.length-1];default:e=k[k.length-2],f=k[k.length-1]}}return d.toString=c._path2string,b.abs=Cb(d),d},Fb=function(a,b,c,d){return[a,b,c,d,c,d]},Gb=function(a,b,c,d,e,f){var g=1/3,h=2/3;return[g*a+h*c,g*b+h*d,g*e+h*c,g*f+h*d,e,f]},Hb=function(a,b,c,d,e,g,h,i,j,k){var l,m=120*S/180,n=S/180*(+e||0),o=[],p=f(function(a,b,c){var d=a*N.cos(c)-b*N.sin(c),e=a*N.sin(c)+b*N.cos(c);return{x:d,y:e}});if(k)y=k[0],z=k[1],w=k[2],x=k[3];else{l=p(a,b,-n),a=l.x,b=l.y,l=p(i,j,-n),i=l.x,j=l.y;var q=(N.cos(S/180*e),N.sin(S/180*e),(a-i)/2),r=(b-j)/2,s=q*q/(c*c)+r*r/(d*d);s>1&&(s=N.sqrt(s),c=s*c,d=s*d);var t=c*c,u=d*d,v=(g==h?-1:1)*N.sqrt(Q((t*u-t*r*r-u*q*q)/(t*r*r+u*q*q))),w=v*c*r/d+(a+i)/2,x=v*-d*q/c+(b+j)/2,y=N.asin(((b-x)/d).toFixed(9)),z=N.asin(((j-x)/d).toFixed(9));y=w>a?S-y:y,z=w>i?S-z:z,0>y&&(y=2*S+y),0>z&&(z=2*S+z),h&&y>z&&(y-=2*S),!h&&z>y&&(z-=2*S)}var A=z-y;if(Q(A)>m){var B=z,C=i,D=j;z=y+m*(h&&z>y?1:-1),i=w+c*N.cos(z),j=x+d*N.sin(z),o=Hb(i,j,c,d,e,0,h,C,D,[z,B,w,x])}A=z-y;var F=N.cos(y),G=N.sin(y),H=N.cos(z),I=N.sin(z),K=N.tan(A/4),L=4/3*c*K,M=4/3*d*K,O=[a,b],P=[a+L*G,b-M*F],R=[i+L*I,j-M*H],T=[i,j];if(P[0]=2*O[0]-P[0],P[1]=2*O[1]-P[1],k)return[P,R,T][E](o);o=[P,R,T][E](o).join()[J](",");for(var U=[],V=0,W=o.length;W>V;V++)U[V]=V%2?p(o[V-1],o[V],n).y:p(o[V],o[V+1],n).x;return U},Ib=function(a,b,c,d,e,f,g,h,i){var j=1-i;return{x:R(j,3)*a+3*R(j,2)*i*c+3*j*i*i*e+R(i,3)*g,y:R(j,3)*b+3*R(j,2)*i*d+3*j*i*i*f+R(i,3)*h}},Jb=f(function(a,b,c,d,e,f,g,h){var i,j=e-2*c+a-(g-2*e+c),k=2*(c-a)-2*(e-c),l=a-c,m=(-k+N.sqrt(k*k-4*j*l))/2/j,n=(-k-N.sqrt(k*k-4*j*l))/2/j,o=[b,h],p=[a,g];return Q(m)>"1e12"&&(m=.5),Q(n)>"1e12"&&(n=.5),m>0&&1>m&&(i=Ib(a,b,c,d,e,f,g,h,m),p.push(i.x),o.push(i.y)),n>0&&1>n&&(i=Ib(a,b,c,d,e,f,g,h,n),p.push(i.x),o.push(i.y)),j=f-2*d+b-(h-2*f+d),k=2*(d-b)-2*(f-d),l=b-d,m=(-k+N.sqrt(k*k-4*j*l))/2/j,n=(-k-N.sqrt(k*k-4*j*l))/2/j,Q(m)>"1e12"&&(m=.5),Q(n)>"1e12"&&(n=.5),m>0&&1>m&&(i=Ib(a,b,c,d,e,f,g,h,m),p.push(i.x),o.push(i.y)),n>0&&1>n&&(i=Ib(a,b,c,d,e,f,g,h,n),p.push(i.x),o.push(i.y)),{min:{x:P[D](0,p),y:P[D](0,o)},max:{x:O[D](0,p),y:O[D](0,o)}}}),Kb=c._path2curve=f(function(a,b){var c=!b&&Ab(a);if(!b&&c.curve)return Cb(c.curve);for(var d=Eb(a),e=b&&Eb(b),f={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},g={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},h=(function(a,b,c){var d,e,f={T:1,Q:1};if(!a)return["C",b.x,b.y,b.x,b.y,b.x,b.y];switch(!(a[0]in f)&&(b.qx=b.qy=null),a[0]){case"M":b.X=a[1],b.Y=a[2];break;case"A":a=["C"][E](Hb[D](0,[b.x,b.y][E](a.slice(1))));break;case"S":"C"==c||"S"==c?(d=2*b.x-b.bx,e=2*b.y-b.by):(d=b.x,e=b.y),a=["C",d,e][E](a.slice(1));break;case"T":"Q"==c||"T"==c?(b.qx=2*b.x-b.qx,b.qy=2*b.y-b.qy):(b.qx=b.x,b.qy=b.y),a=["C"][E](Gb(b.x,b.y,b.qx,b.qy,a[1],a[2]));break;case"Q":b.qx=a[1],b.qy=a[2],a=["C"][E](Gb(b.x,b.y,a[1],a[2],a[3],a[4]));break;case"L":a=["C"][E](Fb(b.x,b.y,a[1],a[2]));break;case"H":a=["C"][E](Fb(b.x,b.y,a[1],b.y));break;case"V":a=["C"][E](Fb(b.x,b.y,b.x,a[1]));break;case"Z":a=["C"][E](Fb(b.x,b.y,b.X,b.Y))}return a}),i=function(a,b){if(a[b].length>7){a[b].shift();for(var c=a[b];c.length;)k[b]="A",e&&(l[b]="A"),a.splice(b++,0,["C"][E](c.splice(0,6)));a.splice(b,1),p=O(d.length,e&&e.length||0)}},j=function(a,b,c,f,g){a&&b&&"M"==a[g][0]&&"M"!=b[g][0]&&(b.splice(g,0,["M",f.x,f.y]),c.bx=0,c.by=0,c.x=a[g][1],c.y=a[g][2],p=O(d.length,e&&e.length||0))},k=[],l=[],m="",n="",o=0,p=O(d.length,e&&e.length||0);p>o;o++){d[o]&&(m=d[o][0]),"C"!=m&&(k[o]=m,o&&(n=k[o-1])),d[o]=h(d[o],f,n),"A"!=k[o]&&"C"==m&&(k[o]="C"),i(d,o),e&&(e[o]&&(m=e[o][0]),"C"!=m&&(l[o]=m,o&&(n=l[o-1])),e[o]=h(e[o],g,n),"A"!=l[o]&&"C"==m&&(l[o]="C"),i(e,o)),j(d,e,f,g,o),j(e,d,g,f,o);var q=d[o],r=e&&e[o],s=q.length,t=e&&r.length;f.x=q[s-2],f.y=q[s-1],f.bx=_(q[s-4])||f.x,f.by=_(q[s-3])||f.y,g.bx=e&&(_(r[t-4])||g.x),g.by=e&&(_(r[t-3])||g.y),g.x=e&&r[t-2],g.y=e&&r[t-1]}return e||(c.curve=Cb(d)),e?[d,e]:d},null,Cb),Lb=(c._parseDots=f(function(a){for(var b=[],d=0,e=a.length;e>d;d++){var f={},g=a[d].match(/^([^:]*):?([\d\.]*)/);if(f.color=c.getRGB(g[1]),f.color.error)return null;f.color=f.color.hex,g[2]&&(f.offset=g[2]+"%"),b.push(f)}for(d=1,e=b.length-1;e>d;d++)if(!b[d].offset){for(var h=_(b[d-1].offset||0),i=0,j=d+1;e>j;j++)if(b[j].offset){i=b[j].offset;break}i||(i=100,j=e),i=_(i);for(var k=(i-h)/(j-d+1);j>d;d++)h+=k,b[d].offset=h+"%"}return b}),c._tear=function(a,b){a==b.top&&(b.top=a.prev),a==b.bottom&&(b.bottom=a.next),a.next&&(a.next.prev=a.prev),a.prev&&(a.prev.next=a.next)}),Mb=(c._tofront=function(a,b){b.top!==a&&(Lb(a,b),a.next=null,a.prev=b.top,b.top.next=a,b.top=a)},c._toback=function(a,b){b.bottom!==a&&(Lb(a,b),a.next=b.bottom,a.prev=null,b.bottom.prev=a,b.bottom=a)},c._insertafter=function(a,b,c){Lb(a,c),b==c.top&&(c.top=a),b.next&&(b.next.prev=a),a.next=b.next,a.prev=b,b.next=a},c._insertbefore=function(a,b,c){Lb(a,c),b==c.bottom&&(c.bottom=a),b.prev&&(b.prev.next=a),a.prev=b.prev,b.prev=a,a.next=b},c.toMatrix=function(a,b){var c=Bb(a),d={_:{transform:G},getBBox:function(){return c}};return Nb(d,b),d.matrix}),Nb=(c.transformPath=function(a,b){return rb(a,Mb(a,b))},c._extractTransform=function(a,b){if(null==b)return a._.transform;b=I(b).replace(/\.{3}|\u2026/g,a._.transform||G);var d=c.parseTransformString(b),e=0,f=0,g=0,h=1,i=1,j=a._,k=new o;if(j.transform=d||[],d)for(var l=0,m=d.length;m>l;l++){var n,p,q,r,s,t=d[l],u=t.length,v=I(t[0]).toLowerCase(),w=t[0]!=v,x=w?k.invert():0;"t"==v&&3==u?w?(n=x.x(0,0),p=x.y(0,0),q=x.x(t[1],t[2]),r=x.y(t[1],t[2]),k.translate(q-n,r-p)):k.translate(t[1],t[2]):"r"==v?2==u?(s=s||a.getBBox(1),k.rotate(t[1],s.x+s.width/2,s.y+s.height/2),e+=t[1]):4==u&&(w?(q=x.x(t[2],t[3]),r=x.y(t[2],t[3]),k.rotate(t[1],q,r)):k.rotate(t[1],t[2],t[3]),e+=t[1]):"s"==v?2==u||3==u?(s=s||a.getBBox(1),k.scale(t[1],t[u-1],s.x+s.width/2,s.y+s.height/2),h*=t[1],i*=t[u-1]):5==u&&(w?(q=x.x(t[3],t[4]),r=x.y(t[3],t[4]),k.scale(t[1],t[2],q,r)):k.scale(t[1],t[2],t[3],t[4]),h*=t[1],i*=t[2]):"m"==v&&7==u&&k.add(t[1],t[2],t[3],t[4],t[5],t[6]),j.dirtyT=1,a.matrix=k}a.matrix=k,j.sx=h,j.sy=i,j.deg=e,j.dx=f=k.e,j.dy=g=k.f,1==h&&1==i&&!e&&j.bbox?(j.bbox.x+=+f,j.bbox.y+=+g):j.dirtyT=1}),Ob=function(a){var b=a[0];switch(b.toLowerCase()){case"t":return[b,0,0];case"m":return[b,1,0,0,1,0,0];case"r":return 4==a.length?[b,0,a[2],a[3]]:[b,0];case"s":return 5==a.length?[b,1,1,a[3],a[4]]:3==a.length?[b,1,1]:[b,1]}},Pb=c._equaliseTransform=function(a,b){b=I(b).replace(/\.{3}|\u2026/g,a),a=c.parseTransformString(a)||[],b=c.parseTransformString(b)||[]; -for(var d,e,f,g,h=O(a.length,b.length),i=[],j=[],k=0;h>k;k++){if(f=a[k]||Ob(b[k]),g=b[k]||Ob(f),f[0]!=g[0]||"r"==f[0].toLowerCase()&&(f[2]!=g[2]||f[3]!=g[3])||"s"==f[0].toLowerCase()&&(f[3]!=g[3]||f[4]!=g[4]))return;for(i[k]=[],j[k]=[],d=0,e=O(f.length,g.length);e>d;d++)d in f&&(i[k][d]=f[d]),d in g&&(j[k][d]=g[d])}return{from:i,to:j}};c._getContainer=function(a,b,d,e){var f;return f=null!=e||c.is(a,"object")?a:A.doc.getElementById(a),null!=f?f.tagName?null==b?{container:f,width:f.style.pixelWidth||f.offsetWidth,height:f.style.pixelHeight||f.offsetHeight}:{container:f,width:b,height:d}:{container:1,x:a,y:b,width:d,height:e}:void 0},c.pathToRelative=Db,c._engine={},c.path2curve=Kb,c.matrix=function(a,b,c,d,e,f){return new o(a,b,c,d,e,f)},function(a){function b(a){return a[0]*a[0]+a[1]*a[1]}function d(a){var c=N.sqrt(b(a));a[0]&&(a[0]/=c),a[1]&&(a[1]/=c)}a.add=function(a,b,c,d,e,f){var g,h,i,j,k=[[],[],[]],l=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],m=[[a,c,e],[b,d,f],[0,0,1]];for(a&&a instanceof o&&(m=[[a.a,a.c,a.e],[a.b,a.d,a.f],[0,0,1]]),g=0;3>g;g++)for(h=0;3>h;h++){for(j=0,i=0;3>i;i++)j+=l[g][i]*m[i][h];k[g][h]=j}this.a=k[0][0],this.b=k[1][0],this.c=k[0][1],this.d=k[1][1],this.e=k[0][2],this.f=k[1][2]},a.invert=function(){var a=this,b=a.a*a.d-a.b*a.c;return new o(a.d/b,-a.b/b,-a.c/b,a.a/b,(a.c*a.f-a.d*a.e)/b,(a.b*a.e-a.a*a.f)/b)},a.clone=function(){return new o(this.a,this.b,this.c,this.d,this.e,this.f)},a.translate=function(a,b){this.add(1,0,0,1,a,b)},a.scale=function(a,b,c,d){null==b&&(b=a),(c||d)&&this.add(1,0,0,1,c,d),this.add(a,0,0,b,0,0),(c||d)&&this.add(1,0,0,1,-c,-d)},a.rotate=function(a,b,d){a=c.rad(a),b=b||0,d=d||0;var e=+N.cos(a).toFixed(9),f=+N.sin(a).toFixed(9);this.add(e,f,-f,e,b,d),this.add(1,0,0,1,-b,-d)},a.x=function(a,b){return a*this.a+b*this.c+this.e},a.y=function(a,b){return a*this.b+b*this.d+this.f},a.get=function(a){return+this[I.fromCharCode(97+a)].toFixed(4)},a.toString=function(){return c.svg?"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")":[this.get(0),this.get(2),this.get(1),this.get(3),0,0].join()},a.toFilter=function(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.get(0)+", M12="+this.get(2)+", M21="+this.get(1)+", M22="+this.get(3)+", Dx="+this.get(4)+", Dy="+this.get(5)+", sizingmethod='auto expand')"},a.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},a.split=function(){var a={};a.dx=this.e,a.dy=this.f;var e=[[this.a,this.c],[this.b,this.d]];a.scalex=N.sqrt(b(e[0])),d(e[0]),a.shear=e[0][0]*e[1][0]+e[0][1]*e[1][1],e[1]=[e[1][0]-e[0][0]*a.shear,e[1][1]-e[0][1]*a.shear],a.scaley=N.sqrt(b(e[1])),d(e[1]),a.shear/=a.scaley;var f=-e[0][1],g=e[1][1];return 0>g?(a.rotate=c.deg(N.acos(g)),0>f&&(a.rotate=360-a.rotate)):a.rotate=c.deg(N.asin(f)),a.isSimple=!(+a.shear.toFixed(9)||a.scalex.toFixed(9)!=a.scaley.toFixed(9)&&a.rotate),a.isSuperSimple=!+a.shear.toFixed(9)&&a.scalex.toFixed(9)==a.scaley.toFixed(9)&&!a.rotate,a.noRotation=!+a.shear.toFixed(9)&&!a.rotate,a},a.toTransformString=function(a){var b=a||this[J]();return b.isSimple?(b.scalex=+b.scalex.toFixed(4),b.scaley=+b.scaley.toFixed(4),b.rotate=+b.rotate.toFixed(4),(b.dx||b.dy?"t"+[b.dx,b.dy]:G)+(1!=b.scalex||1!=b.scaley?"s"+[b.scalex,b.scaley,0,0]:G)+(b.rotate?"r"+[b.rotate,0,0]:G)):"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]}}(o.prototype);var Qb=navigator.userAgent.match(/Version\/(.*?)\s/)||navigator.userAgent.match(/Chrome\/(\d+)/);v.safari="Apple Computer, Inc."==navigator.vendor&&(Qb&&Qb[1]<4||"iP"==navigator.platform.slice(0,2))||"Google Inc."==navigator.vendor&&Qb&&Qb[1]<8?function(){var a=this.rect(-99,-99,this.width+99,this.height+99).attr({stroke:"none"});setTimeout(function(){a.remove()})}:mb;for(var Rb=function(){this.returnValue=!1},Sb=function(){return this.originalEvent.preventDefault()},Tb=function(){this.cancelBubble=!0},Ub=function(){return this.originalEvent.stopPropagation()},Vb=function(a){var b=A.doc.documentElement.scrollTop||A.doc.body.scrollTop,c=A.doc.documentElement.scrollLeft||A.doc.body.scrollLeft;return{x:a.clientX+c,y:a.clientY+b}},Wb=function(){return A.doc.addEventListener?function(a,b,c,d){var e=function(a){var b=Vb(a);return c.call(d,a,b.x,b.y)};if(a.addEventListener(b,e,!1),F&&L[b]){var f=function(b){for(var e=Vb(b),f=b,g=0,h=b.targetTouches&&b.targetTouches.length;h>g;g++)if(b.targetTouches[g].target==a){b=b.targetTouches[g],b.originalEvent=f,b.preventDefault=Sb,b.stopPropagation=Ub;break}return c.call(d,b,e.x,e.y)};a.addEventListener(L[b],f,!1)}return function(){return a.removeEventListener(b,e,!1),F&&L[b]&&a.removeEventListener(L[b],f,!1),!0}}:A.doc.attachEvent?function(a,b,c,d){var e=function(a){a=a||A.win.event;var b=A.doc.documentElement.scrollTop||A.doc.body.scrollTop,e=A.doc.documentElement.scrollLeft||A.doc.body.scrollLeft,f=a.clientX+e,g=a.clientY+b;return a.preventDefault=a.preventDefault||Rb,a.stopPropagation=a.stopPropagation||Tb,c.call(d,a,f,g)};a.attachEvent("on"+b,e);var f=function(){return a.detachEvent("on"+b,e),!0};return f}:void 0}(),Xb=[],Yb=function(a){for(var c,d=a.clientX,e=a.clientY,f=A.doc.documentElement.scrollTop||A.doc.body.scrollTop,g=A.doc.documentElement.scrollLeft||A.doc.body.scrollLeft,h=Xb.length;h--;){if(c=Xb[h],F&&a.touches){for(var i,j=a.touches.length;j--;)if(i=a.touches[j],i.identifier==c.el._drag.id){d=i.clientX,e=i.clientY,(a.originalEvent?a.originalEvent:a).preventDefault();break}}else a.preventDefault();var k,l=c.el.node,m=l.nextSibling,n=l.parentNode,o=l.style.display;A.win.opera&&n.removeChild(l),l.style.display="none",k=c.el.paper.getElementByPoint(d,e),l.style.display=o,A.win.opera&&(m?n.insertBefore(l,m):n.appendChild(l)),k&&b("raphael.drag.over."+c.el.id,c.el,k),d+=g,e+=f,b("raphael.drag.move."+c.el.id,c.move_scope||c.el,d-c.el._drag.x,e-c.el._drag.y,d,e,a)}},Zb=function(a){c.unmousemove(Yb).unmouseup(Zb);for(var d,e=Xb.length;e--;)d=Xb[e],d.el._drag={},b("raphael.drag.end."+d.el.id,d.end_scope||d.start_scope||d.move_scope||d.el,a);Xb=[]},$b=c.el={},_b=K.length;_b--;)!function(a){c[a]=$b[a]=function(b,d){return c.is(b,"function")&&(this.events=this.events||[],this.events.push({name:a,f:b,unbind:Wb(this.shape||this.node||A.doc,a,b,d||this)})),this},c["un"+a]=$b["un"+a]=function(b){for(var d=this.events||[],e=d.length;e--;)d[e].name!=a||!c.is(b,"undefined")&&d[e].f!=b||(d[e].unbind(),d.splice(e,1),!d.length&&delete this.events);return this}}(K[_b]);$b.data=function(a,d){var e=kb[this.id]=kb[this.id]||{};if(0==arguments.length)return e;if(1==arguments.length){if(c.is(a,"object")){for(var f in a)a[z](f)&&this.data(f,a[f]);return this}return b("raphael.data.get."+this.id,this,e[a],a),e[a]}return e[a]=d,b("raphael.data.set."+this.id,this,d,a),this},$b.removeData=function(a){return null==a?kb[this.id]={}:kb[this.id]&&delete kb[this.id][a],this},$b.getData=function(){return d(kb[this.id]||{})},$b.hover=function(a,b,c,d){return this.mouseover(a,c).mouseout(b,d||c)},$b.unhover=function(a,b){return this.unmouseover(a).unmouseout(b)};var ac=[];$b.drag=function(a,d,e,f,g,h){function i(i){(i.originalEvent||i).preventDefault();var j=i.clientX,k=i.clientY,l=A.doc.documentElement.scrollTop||A.doc.body.scrollTop,m=A.doc.documentElement.scrollLeft||A.doc.body.scrollLeft;if(this._drag.id=i.identifier,F&&i.touches)for(var n,o=i.touches.length;o--;)if(n=i.touches[o],this._drag.id=n.identifier,n.identifier==this._drag.id){j=n.clientX,k=n.clientY;break}this._drag.x=j+m,this._drag.y=k+l,!Xb.length&&c.mousemove(Yb).mouseup(Zb),Xb.push({el:this,move_scope:f,start_scope:g,end_scope:h}),d&&b.on("raphael.drag.start."+this.id,d),a&&b.on("raphael.drag.move."+this.id,a),e&&b.on("raphael.drag.end."+this.id,e),b("raphael.drag.start."+this.id,g||f||this,i.clientX+m,i.clientY+l,i)}return this._drag={},ac.push({el:this,start:i}),this.mousedown(i),this},$b.onDragOver=function(a){a?b.on("raphael.drag.over."+this.id,a):b.unbind("raphael.drag.over."+this.id)},$b.undrag=function(){for(var a=ac.length;a--;)ac[a].el==this&&(this.unmousedown(ac[a].start),ac.splice(a,1),b.unbind("raphael.drag.*."+this.id));!ac.length&&c.unmousemove(Yb).unmouseup(Zb),Xb=[]},v.circle=function(a,b,d){var e=c._engine.circle(this,a||0,b||0,d||0);return this.__set__&&this.__set__.push(e),e},v.rect=function(a,b,d,e,f){var g=c._engine.rect(this,a||0,b||0,d||0,e||0,f||0);return this.__set__&&this.__set__.push(g),g},v.ellipse=function(a,b,d,e){var f=c._engine.ellipse(this,a||0,b||0,d||0,e||0);return this.__set__&&this.__set__.push(f),f},v.path=function(a){a&&!c.is(a,U)&&!c.is(a[0],V)&&(a+=G);var b=c._engine.path(c.format[D](c,arguments),this);return this.__set__&&this.__set__.push(b),b},v.image=function(a,b,d,e,f){var g=c._engine.image(this,a||"about:blank",b||0,d||0,e||0,f||0);return this.__set__&&this.__set__.push(g),g},v.text=function(a,b,d){var e=c._engine.text(this,a||0,b||0,I(d));return this.__set__&&this.__set__.push(e),e},v.set=function(a){!c.is(a,"array")&&(a=Array.prototype.splice.call(arguments,0,arguments.length));var b=new mc(a);return this.__set__&&this.__set__.push(b),b.paper=this,b.type="set",b},v.setStart=function(a){this.__set__=a||this.set()},v.setFinish=function(){var a=this.__set__;return delete this.__set__,a},v.getSize=function(){var a=this.canvas.parentNode;return{width:a.offsetWidth,height:a.offsetHeight}},v.setSize=function(a,b){return c._engine.setSize.call(this,a,b)},v.setViewBox=function(a,b,d,e,f){return c._engine.setViewBox.call(this,a,b,d,e,f)},v.top=v.bottom=null,v.raphael=c;var bc=function(a){var b=a.getBoundingClientRect(),c=a.ownerDocument,d=c.body,e=c.documentElement,f=e.clientTop||d.clientTop||0,g=e.clientLeft||d.clientLeft||0,h=b.top+(A.win.pageYOffset||e.scrollTop||d.scrollTop)-f,i=b.left+(A.win.pageXOffset||e.scrollLeft||d.scrollLeft)-g;return{y:h,x:i}};v.getElementByPoint=function(a,b){var c=this,d=c.canvas,e=A.doc.elementFromPoint(a,b);if(A.win.opera&&"svg"==e.tagName){var f=bc(d),g=d.createSVGRect();g.x=a-f.x,g.y=b-f.y,g.width=g.height=1;var h=d.getIntersectionList(g,null);h.length&&(e=h[h.length-1])}if(!e)return null;for(;e.parentNode&&e!=d.parentNode&&!e.raphael;)e=e.parentNode;return e==c.canvas.parentNode&&(e=d),e=e&&e.raphael?c.getById(e.raphaelid):null},v.getElementsByBBox=function(a){var b=this.set();return this.forEach(function(d){c.isBBoxIntersect(d.getBBox(),a)&&b.push(d)}),b},v.getById=function(a){for(var b=this.bottom;b;){if(b.id==a)return b;b=b.next}return null},v.forEach=function(a,b){for(var c=this.bottom;c;){if(a.call(b,c)===!1)return this;c=c.next}return this},v.getElementsByPoint=function(a,b){var c=this.set();return this.forEach(function(d){d.isPointInside(a,b)&&c.push(d)}),c},$b.isPointInside=function(a,b){var d=this.realPath=qb[this.type](this);return this.attr("transform")&&this.attr("transform").length&&(d=c.transformPath(d,this.attr("transform"))),c.isPointInsidePath(d,a,b)},$b.getBBox=function(a){if(this.removed)return{};var b=this._;return a?((b.dirty||!b.bboxwt)&&(this.realPath=qb[this.type](this),b.bboxwt=Bb(this.realPath),b.bboxwt.toString=p,b.dirty=0),b.bboxwt):((b.dirty||b.dirtyT||!b.bbox)&&((b.dirty||!this.realPath)&&(b.bboxwt=0,this.realPath=qb[this.type](this)),b.bbox=Bb(rb(this.realPath,this.matrix)),b.bbox.toString=p,b.dirty=b.dirtyT=0),b.bbox)},$b.clone=function(){if(this.removed)return null;var a=this.paper[this.type]().attr(this.attr());return this.__set__&&this.__set__.push(a),a},$b.glow=function(a){if("text"==this.type)return null;a=a||{};var b={width:(a.width||10)+(+this.attr("stroke-width")||1),fill:a.fill||!1,opacity:a.opacity||.5,offsetx:a.offsetx||0,offsety:a.offsety||0,color:a.color||"#000"},c=b.width/2,d=this.paper,e=d.set(),f=this.realPath||qb[this.type](this);f=this.matrix?rb(f,this.matrix):f;for(var g=1;c+1>g;g++)e.push(d.path(f).attr({stroke:b.color,fill:b.fill?b.color:"none","stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(b.width/c*g).toFixed(3),opacity:+(b.opacity/c).toFixed(3)}));return e.insertBefore(this).translate(b.offsetx,b.offsety)};var cc=function(a,b,d,e,f,g,h,i,l){return null==l?j(a,b,d,e,f,g,h,i):c.findDotsAtSegment(a,b,d,e,f,g,h,i,k(a,b,d,e,f,g,h,i,l))},dc=function(a,b){return function(d,e,f){d=Kb(d);for(var g,h,i,j,k,l="",m={},n=0,o=0,p=d.length;p>o;o++){if(i=d[o],"M"==i[0])g=+i[1],h=+i[2];else{if(j=cc(g,h,i[1],i[2],i[3],i[4],i[5],i[6]),n+j>e){if(b&&!m.start){if(k=cc(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n),l+=["C"+k.start.x,k.start.y,k.m.x,k.m.y,k.x,k.y],f)return l;m.start=l,l=["M"+k.x,k.y+"C"+k.n.x,k.n.y,k.end.x,k.end.y,i[5],i[6]].join(),n+=j,g=+i[5],h=+i[6];continue}if(!a&&!b)return k=cc(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n),{x:k.x,y:k.y,alpha:k.alpha}}n+=j,g=+i[5],h=+i[6]}l+=i.shift()+i}return m.end=l,k=a?n:b?m:c.findDotsAtSegment(g,h,i[0],i[1],i[2],i[3],i[4],i[5],1),k.alpha&&(k={x:k.x,y:k.y,alpha:k.alpha}),k}},ec=dc(1),fc=dc(),gc=dc(0,1);c.getTotalLength=ec,c.getPointAtLength=fc,c.getSubpath=function(a,b,c){if(this.getTotalLength(a)-c<1e-6)return gc(a,b).end;var d=gc(a,c,1);return b?gc(d,b).end:d},$b.getTotalLength=function(){var a=this.getPath();if(a)return this.node.getTotalLength?this.node.getTotalLength():ec(a)},$b.getPointAtLength=function(a){var b=this.getPath();if(b)return fc(b,a)},$b.getPath=function(){var a,b=c._getPath[this.type];if("text"!=this.type&&"set"!=this.type)return b&&(a=b(this)),a},$b.getSubpath=function(a,b){var d=this.getPath();if(d)return c.getSubpath(d,a,b)};var hc=c.easing_formulas={linear:function(a){return a},"<":function(a){return R(a,1.7)},">":function(a){return R(a,.48)},"<>":function(a){var b=.48-a/1.04,c=N.sqrt(.1734+b*b),d=c-b,e=R(Q(d),1/3)*(0>d?-1:1),f=-c-b,g=R(Q(f),1/3)*(0>f?-1:1),h=e+g+.5;return 3*(1-h)*h*h+h*h*h},backIn:function(a){var b=1.70158;return a*a*((b+1)*a-b)},backOut:function(a){a-=1;var b=1.70158;return a*a*((b+1)*a+b)+1},elastic:function(a){return a==!!a?a:R(2,-10*a)*N.sin(2*(a-.075)*S/.3)+1},bounce:function(a){var b,c=7.5625,d=2.75;return 1/d>a?b=c*a*a:2/d>a?(a-=1.5/d,b=c*a*a+.75):2.5/d>a?(a-=2.25/d,b=c*a*a+.9375):(a-=2.625/d,b=c*a*a+.984375),b}};hc.easeIn=hc["ease-in"]=hc["<"],hc.easeOut=hc["ease-out"]=hc[">"],hc.easeInOut=hc["ease-in-out"]=hc["<>"],hc["back-in"]=hc.backIn,hc["back-out"]=hc.backOut;var ic=[],jc=a.requestAnimationFrame||a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame||a.msRequestAnimationFrame||function(a){setTimeout(a,16)},kc=function(){for(var a=+new Date,d=0;dh))if(i>h){var q=j(h/i);for(var r in k)if(k[z](r)){switch(db[r]){case T:f=+k[r]+q*i*l[r];break;case"colour":f="rgb("+[lc($(k[r].r+q*i*l[r].r)),lc($(k[r].g+q*i*l[r].g)),lc($(k[r].b+q*i*l[r].b))].join(",")+")";break;case"path":f=[];for(var t=0,u=k[r].length;u>t;t++){f[t]=[k[r][t][0]];for(var v=1,w=k[r][t].length;w>v;v++)f[t][v]=+k[r][t][v]+q*i*l[r][t][v];f[t]=f[t].join(H)}f=f.join(H);break;case"transform":if(l[r].real)for(f=[],t=0,u=k[r].length;u>t;t++)for(f[t]=[k[r][t][0]],v=1,w=k[r][t].length;w>v;v++)f[t][v]=k[r][t][v]+q*i*l[r][t][v];else{var x=function(a){return+k[r][a]+q*i*l[r][a]};f=[["m",x(0),x(1),x(2),x(3),x(4),x(5)]]}break;case"csv":if("clip-rect"==r)for(f=[],t=4;t--;)f[t]=+k[r][t]+q*i*l[r][t];break;default:var y=[][E](k[r]);for(f=[],t=n.paper.customAttributes[r].length;t--;)f[t]=+y[t]+q*i*l[r][t]}o[r]=f}n.attr(o),function(a,c,d){setTimeout(function(){b("raphael.anim.frame."+a,c,d)})}(n.id,n,e.anim)}else{if(function(a,d,e){setTimeout(function(){b("raphael.anim.frame."+d.id,d,e),b("raphael.anim.finish."+d.id,d,e),c.is(a,"function")&&a.call(d)})}(e.callback,n,e.anim),n.attr(m),ic.splice(d--,1),e.repeat>1&&!e.next){for(g in m)m[z](g)&&(p[g]=e.totalOrigin[g]);e.el.attr(p),s(e.anim,e.el,e.anim.percents[0],null,e.totalOrigin,e.repeat-1)}e.next&&!e.stop&&s(e.anim,e.el,e.next,null,e.totalOrigin,e.repeat)}}}c.svg&&n&&n.paper&&n.paper.safari(),ic.length&&jc(kc)},lc=function(a){return a>255?255:0>a?0:a};$b.animateWith=function(a,b,d,e,f,g){var h=this;if(h.removed)return g&&g.call(h),h;var i=d instanceof r?d:c.animation(d,e,f,g);s(i,h,i.percents[0],null,h.attr());for(var j=0,k=ic.length;k>j;j++)if(ic[j].anim==b&&ic[j].el==a){ic[k-1].start=ic[j].start;break}return h},$b.onAnimation=function(a){return a?b.on("raphael.anim.frame."+this.id,a):b.unbind("raphael.anim.frame."+this.id),this},r.prototype.delay=function(a){var b=new r(this.anim,this.ms);return b.times=this.times,b.del=+a||0,b},r.prototype.repeat=function(a){var b=new r(this.anim,this.ms);return b.del=this.del,b.times=N.floor(O(a,0))||1,b},c.animation=function(a,b,d,e){if(a instanceof r)return a;(c.is(d,"function")||!d)&&(e=e||d||null,d=null),a=Object(a),b=+b||0;var f,g,h={};for(g in a)a[z](g)&&_(g)!=g&&_(g)+"%"!=g&&(f=!0,h[g]=a[g]);if(f)return d&&(h.easing=d),e&&(h.callback=e),new r({100:h},b);if(e){var i=0;for(var j in a){var k=ab(j);a[z](j)&&k>i&&(i=k)}i+="%",!a[i].callback&&(a[i].callback=e)}return new r(a,b)},$b.animate=function(a,b,d,e){var f=this;if(f.removed)return e&&e.call(f),f;var g=a instanceof r?a:c.animation(a,b,d,e);return s(g,f,g.percents[0],null,f.attr()),f},$b.setTime=function(a,b){return a&&null!=b&&this.status(a,P(b,a.ms)/a.ms),this},$b.status=function(a,b){var c,d,e=[],f=0;if(null!=b)return s(a,this,-1,P(b,1)),this;for(c=ic.length;c>f;f++)if(d=ic[f],d.el.id==this.id&&(!a||d.anim==a)){if(a)return d.status;e.push({anim:d.anim,status:d.status})}return a?0:e},$b.pause=function(a){for(var c=0;cb;b++)!a[b]||a[b].constructor!=$b.constructor&&a[b].constructor!=mc||(this[this.items.length]=this.items[this.items.length]=a[b],this.length++)},nc=mc.prototype;nc.push=function(){for(var a,b,c=0,d=arguments.length;d>c;c++)a=arguments[c],!a||a.constructor!=$b.constructor&&a.constructor!=mc||(b=this.items.length,this[b]=this.items[b]=a,this.length++);return this},nc.pop=function(){return this.length&&delete this[this.length--],this.items.pop()},nc.forEach=function(a,b){for(var c=0,d=this.items.length;d>c;c++)if(a.call(b,this.items[c],c)===!1)return this;return this};for(var oc in $b)$b[z](oc)&&(nc[oc]=function(a){return function(){var b=arguments;return this.forEach(function(c){c[a][D](c,b)})}}(oc));return nc.attr=function(a,b){if(a&&c.is(a,V)&&c.is(a[0],"object"))for(var d=0,e=a.length;e>d;d++)this.items[d].attr(a[d]);else for(var f=0,g=this.items.length;g>f;f++)this.items[f].attr(a,b);return this},nc.clear=function(){for(;this.length;)this.pop()},nc.splice=function(a,b){a=0>a?O(this.length+a,0):a,b=O(0,P(this.length-a,b));var c,d=[],e=[],f=[];for(c=2;cc;c++)e.push(this[a+c]);for(;cc?f[c]:d[c-g];for(c=this.items.length=this.length-=b-g;this[c];)delete this[c++];return new mc(e)},nc.exclude=function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]==a)return this.splice(b,1),!0},nc.animate=function(a,b,d,e){(c.is(d,"function")||!d)&&(e=d||null);var f,g,h=this.items.length,i=h,j=this;if(!h)return this;e&&(g=function(){!--h&&e.call(j)}),d=c.is(d,U)?d:g;var k=c.animation(a,b,d,g);for(f=this.items[--i].animate(k);i--;)this.items[i]&&!this.items[i].removed&&this.items[i].animateWith(f,k,k),this.items[i]&&!this.items[i].removed||h--;return this},nc.insertAfter=function(a){for(var b=this.items.length;b--;)this.items[b].insertAfter(a);return this},nc.getBBox=function(){for(var a=[],b=[],c=[],d=[],e=this.items.length;e--;)if(!this.items[e].removed){var f=this.items[e].getBBox();a.push(f.x),b.push(f.y),c.push(f.x+f.width),d.push(f.y+f.height)}return a=P[D](0,a),b=P[D](0,b),c=O[D](0,c),d=O[D](0,d),{x:a,y:b,x2:c,y2:d,width:c-a,height:d-b}},nc.clone=function(a){a=this.paper.set();for(var b=0,c=this.items.length;c>b;b++)a.push(this.items[b].clone());return a},nc.toString=function(){return"Raphaël‘s set"},nc.glow=function(a){var b=this.paper.set();return this.forEach(function(c){var d=c.glow(a);null!=d&&d.forEach(function(a){b.push(a)})}),b},nc.isPointInside=function(a,b){var c=!1;return this.forEach(function(d){return d.isPointInside(a,b)?(c=!0,!1):void 0}),c},c.registerFont=function(a){if(!a.face)return a;this.fonts=this.fonts||{};var b={w:a.w,face:{},glyphs:{}},c=a.face["font-family"];for(var d in a.face)a.face[z](d)&&(b.face[d]=a.face[d]);if(this.fonts[c]?this.fonts[c].push(b):this.fonts[c]=[b],!a.svg){b.face["units-per-em"]=ab(a.face["units-per-em"],10);for(var e in a.glyphs)if(a.glyphs[z](e)){var f=a.glyphs[e];if(b.glyphs[e]={w:f.w,k:{},d:f.d&&"M"+f.d.replace(/[mlcxtrv]/g,function(a){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[a]||"M"})+"z"},f.k)for(var g in f.k)f[z](g)&&(b.glyphs[e].k[g]=f.k[g])}}return a},v.getFont=function(a,b,d,e){if(e=e||"normal",d=d||"normal",b=+b||{normal:400,bold:700,lighter:300,bolder:800}[b]||400,c.fonts){var f=c.fonts[a];if(!f){var g=new RegExp("(^|\\s)"+a.replace(/[^\w\d\s+!~.:_-]/g,G)+"(\\s|$)","i");for(var h in c.fonts)if(c.fonts[z](h)&&g.test(h)){f=c.fonts[h];break}}var i;if(f)for(var j=0,k=f.length;k>j&&(i=f[j],i.face["font-weight"]!=b||i.face["font-style"]!=d&&i.face["font-style"]||i.face["font-stretch"]!=e);j++);return i}},v.print=function(a,b,d,e,f,g,h,i){g=g||"middle",h=O(P(h||0,1),-1),i=O(P(i||1,3),1);var j,k=I(d)[J](G),l=0,m=0,n=G;if(c.is(e,"string")&&(e=this.getFont(e)),e){j=(f||16)/e.face["units-per-em"];for(var o=e.face.bbox[J](w),p=+o[0],q=o[3]-o[1],r=0,s=+o[1]+("baseline"==g?q+ +e.face.descent:q/2),t=0,u=k.length;u>t;t++){if("\n"==k[t])l=0,x=0,m=0,r+=q*i;else{var v=m&&e.glyphs[k[t-1]]||{},x=e.glyphs[k[t]];l+=m?(v.w||e.w)+(v.k&&v.k[k[t]]||0)+e.w*h:0,m=1}x&&x.d&&(n+=c.transformPath(x.d,["t",l*j,r*j,"s",j,j,p,s,"t",(a-p)/j,(b-s)/j]))}}return this.path(n).attr({fill:"#000",stroke:"none"})},v.add=function(a){if(c.is(a,"array"))for(var b,d=this.set(),e=0,f=a.length;f>e;e++)b=a[e]||{},x[z](b.type)&&d.push(this[b.type]().attr(b));return d},c.format=function(a,b){var d=c.is(b,V)?[0][E](b):arguments;return a&&c.is(a,U)&&d.length-1&&(a=a.replace(y,function(a,b){return null==d[++b]?G:d[b]})),a||G},c.fullfill=function(){var a=/\{([^\}]+)\}/g,b=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,c=function(a,c,d){var e=d;return c.replace(b,function(a,b,c,d,f){b=b||d,e&&(b in e&&(e=e[b]),"function"==typeof e&&f&&(e=e()))}),e=(null==e||e==d?a:e)+""};return function(b,d){return String(b).replace(a,function(a,b){return c(a,b,d)})}}(),c.ninja=function(){return B.was?A.win.Raphael=B.is:delete Raphael,c},c.st=nc,b.on("raphael.DOMload",function(){u=!0}),function(a,b,d){function e(){/in/.test(a.readyState)?setTimeout(e,9):c.eve("raphael.DOMload")}null==a.readyState&&a.addEventListener&&(a.addEventListener(b,d=function(){a.removeEventListener(b,d,!1),a.readyState="complete"},!1),a.readyState="loading"),e()}(document,"DOMContentLoaded"),function(){if(c.svg){var a="hasOwnProperty",b=String,d=parseFloat,e=parseInt,f=Math,g=f.max,h=f.abs,i=f.pow,j=/[, ]+/,k=c.eve,l="",m=" ",n="http://www.w3.org/1999/xlink",o={block:"M5,0 0,2.5 5,5z",classic:"M5,0 0,2.5 5,5 3.5,3 3.5,2z",diamond:"M2.5,0 5,2.5 2.5,5 0,2.5z",open:"M6,1 1,3.5 6,6",oval:"M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"},p={};c.toString=function(){return"Your browser supports SVG.\nYou are running Raphaël "+this.version};var q=function(d,e){if(e){"string"==typeof d&&(d=q(d));for(var f in e)e[a](f)&&("xlink:"==f.substring(0,6)?d.setAttributeNS(n,f.substring(6),b(e[f])):d.setAttribute(f,b(e[f])))}else d=c._g.doc.createElementNS("http://www.w3.org/2000/svg",d),d.style&&(d.style.webkitTapHighlightColor="rgba(0,0,0,0)");return d},r=function(a,e){var j="linear",k=a.id+e,m=.5,n=.5,o=a.node,p=a.paper,r=o.style,s=c._g.doc.getElementById(k);if(!s){if(e=b(e).replace(c._radial_gradient,function(a,b,c){if(j="radial",b&&c){m=d(b),n=d(c);var e=2*(n>.5)-1;i(m-.5,2)+i(n-.5,2)>.25&&(n=f.sqrt(.25-i(m-.5,2))*e+.5)&&.5!=n&&(n=n.toFixed(5)-1e-5*e)}return l}),e=e.split(/\s*\-\s*/),"linear"==j){var t=e.shift();if(t=-d(t),isNaN(t))return null;var u=[0,0,f.cos(c.rad(t)),f.sin(c.rad(t))],v=1/(g(h(u[2]),h(u[3]))||1);u[2]*=v,u[3]*=v,u[2]<0&&(u[0]=-u[2],u[2]=0),u[3]<0&&(u[1]=-u[3],u[3]=0)}var w=c._parseDots(e);if(!w)return null;if(k=k.replace(/[\(\)\s,\xb0#]/g,"_"),a.gradient&&k!=a.gradient.id&&(p.defs.removeChild(a.gradient),delete a.gradient),!a.gradient){s=q(j+"Gradient",{id:k}),a.gradient=s,q(s,"radial"==j?{fx:m,fy:n}:{x1:u[0],y1:u[1],x2:u[2],y2:u[3],gradientTransform:a.matrix.invert()}),p.defs.appendChild(s);for(var x=0,y=w.length;y>x;x++)s.appendChild(q("stop",{offset:w[x].offset?w[x].offset:x?"100%":"0%","stop-color":w[x].color||"#fff"}))}}return q(o,{fill:"url("+document.location+"#"+k+")",opacity:1,"fill-opacity":1}),r.fill=l,r.opacity=1,r.fillOpacity=1,1},s=function(a){var b=a.getBBox(1);q(a.pattern,{patternTransform:a.matrix.invert()+" translate("+b.x+","+b.y+")"})},t=function(d,e,f){if("path"==d.type){for(var g,h,i,j,k,m=b(e).toLowerCase().split("-"),n=d.paper,r=f?"end":"start",s=d.node,t=d.attrs,u=t["stroke-width"],v=m.length,w="classic",x=3,y=3,z=5;v--;)switch(m[v]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":w=m[v];break;case"wide":y=5;break;case"narrow":y=2;break;case"long":x=5;break;case"short":x=2}if("open"==w?(x+=2,y+=2,z+=2,i=1,j=f?4:1,k={fill:"none",stroke:t.stroke}):(j=i=x/2,k={fill:t.stroke,stroke:"none"}),d._.arrows?f?(d._.arrows.endPath&&p[d._.arrows.endPath]--,d._.arrows.endMarker&&p[d._.arrows.endMarker]--):(d._.arrows.startPath&&p[d._.arrows.startPath]--,d._.arrows.startMarker&&p[d._.arrows.startMarker]--):d._.arrows={},"none"!=w){var A="raphael-marker-"+w,B="raphael-marker-"+r+w+x+y+"-obj"+d.id;c._g.doc.getElementById(A)?p[A]++:(n.defs.appendChild(q(q("path"),{"stroke-linecap":"round",d:o[w],id:A})),p[A]=1);var C,D=c._g.doc.getElementById(B);D?(p[B]++,C=D.getElementsByTagName("use")[0]):(D=q(q("marker"),{id:B,markerHeight:y,markerWidth:x,orient:"auto",refX:j,refY:y/2}),C=q(q("use"),{"xlink:href":"#"+A,transform:(f?"rotate(180 "+x/2+" "+y/2+") ":l)+"scale("+x/z+","+y/z+")","stroke-width":(1/((x/z+y/z)/2)).toFixed(4)}),D.appendChild(C),n.defs.appendChild(D),p[B]=1),q(C,k);var E=i*("diamond"!=w&&"oval"!=w);f?(g=d._.arrows.startdx*u||0,h=c.getTotalLength(t.path)-E*u):(g=E*u,h=c.getTotalLength(t.path)-(d._.arrows.enddx*u||0)),k={},k["marker-"+r]="url(#"+B+")",(h||g)&&(k.d=c.getSubpath(t.path,g,h)),q(s,k),d._.arrows[r+"Path"]=A,d._.arrows[r+"Marker"]=B,d._.arrows[r+"dx"]=E,d._.arrows[r+"Type"]=w,d._.arrows[r+"String"]=e}else f?(g=d._.arrows.startdx*u||0,h=c.getTotalLength(t.path)-g):(g=0,h=c.getTotalLength(t.path)-(d._.arrows.enddx*u||0)),d._.arrows[r+"Path"]&&q(s,{d:c.getSubpath(t.path,g,h)}),delete d._.arrows[r+"Path"],delete d._.arrows[r+"Marker"],delete d._.arrows[r+"dx"],delete d._.arrows[r+"Type"],delete d._.arrows[r+"String"];for(k in p)if(p[a](k)&&!p[k]){var F=c._g.doc.getElementById(k);F&&F.parentNode.removeChild(F)}}},u={"":[0],none:[0],"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},v=function(a,c,d){if(c=u[b(c).toLowerCase()]){for(var e=a.attrs["stroke-width"]||"1",f={round:e,square:e,butt:0}[a.attrs["stroke-linecap"]||d["stroke-linecap"]]||0,g=[],h=c.length;h--;)g[h]=c[h]*e+(h%2?1:-1)*f;q(a.node,{"stroke-dasharray":g.join(",")})}},w=function(d,f){var i=d.node,k=d.attrs,m=i.style.visibility;i.style.visibility="hidden";for(var o in f)if(f[a](o)){if(!c._availableAttrs[a](o))continue;var p=f[o];switch(k[o]=p,o){case"blur":d.blur(p);break;case"title":var u=i.getElementsByTagName("title");if(u.length&&(u=u[0]))u.firstChild.nodeValue=p;else{u=q("title");var w=c._g.doc.createTextNode(p);u.appendChild(w),i.appendChild(u)}break;case"href":case"target":var x=i.parentNode;if("a"!=x.tagName.toLowerCase()){var z=q("a");x.insertBefore(z,i),z.appendChild(i),x=z}"target"==o?x.setAttributeNS(n,"show","blank"==p?"new":p):x.setAttributeNS(n,o,p);break;case"cursor":i.style.cursor=p;break;case"transform":d.transform(p);break;case"arrow-start":t(d,p);break;case"arrow-end":t(d,p,1);break;case"clip-rect":var A=b(p).split(j);if(4==A.length){d.clip&&d.clip.parentNode.parentNode.removeChild(d.clip.parentNode);var B=q("clipPath"),C=q("rect");B.id=c.createUUID(),q(C,{x:A[0],y:A[1],width:A[2],height:A[3]}),B.appendChild(C),d.paper.defs.appendChild(B),q(i,{"clip-path":"url(#"+B.id+")"}),d.clip=C}if(!p){var D=i.getAttribute("clip-path");if(D){var E=c._g.doc.getElementById(D.replace(/(^url\(#|\)$)/g,l));E&&E.parentNode.removeChild(E),q(i,{"clip-path":l}),delete d.clip}}break;case"path":"path"==d.type&&(q(i,{d:p?k.path=c._pathToAbsolute(p):"M0,0"}),d._.dirty=1,d._.arrows&&("startString"in d._.arrows&&t(d,d._.arrows.startString),"endString"in d._.arrows&&t(d,d._.arrows.endString,1)));break;case"width":if(i.setAttribute(o,p),d._.dirty=1,!k.fx)break;o="x",p=k.x;case"x":k.fx&&(p=-k.x-(k.width||0));case"rx":if("rx"==o&&"rect"==d.type)break;case"cx":i.setAttribute(o,p),d.pattern&&s(d),d._.dirty=1;break;case"height":if(i.setAttribute(o,p),d._.dirty=1,!k.fy)break;o="y",p=k.y;case"y":k.fy&&(p=-k.y-(k.height||0));case"ry":if("ry"==o&&"rect"==d.type)break;case"cy":i.setAttribute(o,p),d.pattern&&s(d),d._.dirty=1;break;case"r":"rect"==d.type?q(i,{rx:p,ry:p}):i.setAttribute(o,p),d._.dirty=1;break;case"src":"image"==d.type&&i.setAttributeNS(n,"href",p);break;case"stroke-width":(1!=d._.sx||1!=d._.sy)&&(p/=g(h(d._.sx),h(d._.sy))||1),i.setAttribute(o,p),k["stroke-dasharray"]&&v(d,k["stroke-dasharray"],f),d._.arrows&&("startString"in d._.arrows&&t(d,d._.arrows.startString),"endString"in d._.arrows&&t(d,d._.arrows.endString,1));break;case"stroke-dasharray":v(d,p,f);break;case"fill":var F=b(p).match(c._ISURL);if(F){B=q("pattern");var G=q("image");B.id=c.createUUID(),q(B,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),q(G,{x:0,y:0,"xlink:href":F[1]}),B.appendChild(G),function(a){c._preload(F[1],function(){var b=this.offsetWidth,c=this.offsetHeight;q(a,{width:b,height:c}),q(G,{width:b,height:c}),d.paper.safari()})}(B),d.paper.defs.appendChild(B),q(i,{fill:"url(#"+B.id+")"}),d.pattern=B,d.pattern&&s(d);break}var H=c.getRGB(p);if(H.error){if(("circle"==d.type||"ellipse"==d.type||"r"!=b(p).charAt())&&r(d,p)){if("opacity"in k||"fill-opacity"in k){var I=c._g.doc.getElementById(i.getAttribute("fill").replace(/^url\(#|\)$/g,l));if(I){var J=I.getElementsByTagName("stop");q(J[J.length-1],{"stop-opacity":("opacity"in k?k.opacity:1)*("fill-opacity"in k?k["fill-opacity"]:1)})}}k.gradient=p,k.fill="none";break}}else delete f.gradient,delete k.gradient,!c.is(k.opacity,"undefined")&&c.is(f.opacity,"undefined")&&q(i,{opacity:k.opacity}),!c.is(k["fill-opacity"],"undefined")&&c.is(f["fill-opacity"],"undefined")&&q(i,{"fill-opacity":k["fill-opacity"]});H[a]("opacity")&&q(i,{"fill-opacity":H.opacity>1?H.opacity/100:H.opacity});case"stroke":H=c.getRGB(p),i.setAttribute(o,H.hex),"stroke"==o&&H[a]("opacity")&&q(i,{"stroke-opacity":H.opacity>1?H.opacity/100:H.opacity}),"stroke"==o&&d._.arrows&&("startString"in d._.arrows&&t(d,d._.arrows.startString),"endString"in d._.arrows&&t(d,d._.arrows.endString,1));break;case"gradient":("circle"==d.type||"ellipse"==d.type||"r"!=b(p).charAt())&&r(d,p);break; -case"opacity":k.gradient&&!k[a]("stroke-opacity")&&q(i,{"stroke-opacity":p>1?p/100:p});case"fill-opacity":if(k.gradient){I=c._g.doc.getElementById(i.getAttribute("fill").replace(/^url\(#|\)$/g,l)),I&&(J=I.getElementsByTagName("stop"),q(J[J.length-1],{"stop-opacity":p}));break}default:"font-size"==o&&(p=e(p,10)+"px");var K=o.replace(/(\-.)/g,function(a){return a.substring(1).toUpperCase()});i.style[K]=p,d._.dirty=1,i.setAttribute(o,p)}}y(d,f),i.style.visibility=m},x=1.2,y=function(d,f){if("text"==d.type&&(f[a]("text")||f[a]("font")||f[a]("font-size")||f[a]("x")||f[a]("y"))){var g=d.attrs,h=d.node,i=h.firstChild?e(c._g.doc.defaultView.getComputedStyle(h.firstChild,l).getPropertyValue("font-size"),10):10;if(f[a]("text")){for(g.text=f.text;h.firstChild;)h.removeChild(h.firstChild);for(var j,k=b(f.text).split("\n"),m=[],n=0,o=k.length;o>n;n++)j=q("tspan"),n&&q(j,{dy:i*x,x:g.x}),j.appendChild(c._g.doc.createTextNode(k[n])),h.appendChild(j),m[n]=j}else for(m=h.getElementsByTagName("tspan"),n=0,o=m.length;o>n;n++)n?q(m[n],{dy:i*x,x:g.x}):q(m[0],{dy:0});q(h,{x:g.x,y:g.y}),d._.dirty=1;var p=d._getBBox(),r=g.y-(p.y+p.height/2);r&&c.is(r,"finite")&&q(m[0],{dy:r})}},z=function(a){return a.parentNode&&"a"===a.parentNode.tagName.toLowerCase()?a.parentNode:a};Element=function(a,b){this[0]=this.node=a,a.raphael=!0,this.id=c._oid++,a.raphaelid=this.id,this.matrix=c.matrix(),this.realPath=null,this.paper=b,this.attrs=this.attrs||{},this._={transform:[],sx:1,sy:1,deg:0,dx:0,dy:0,dirty:1},!b.bottom&&(b.bottom=this),this.prev=b.top,b.top&&(b.top.next=this),b.top=this,this.next=null},$b=c.el,Element.prototype=$b,$b.constructor=Element,c._engine.path=function(a,b){var c=q("path");b.canvas&&b.canvas.appendChild(c);var d=new Element(c,b);return d.type="path",w(d,{fill:"none",stroke:"#000",path:a}),d},$b.rotate=function(a,c,e){if(this.removed)return this;if(a=b(a).split(j),a.length-1&&(c=d(a[1]),e=d(a[2])),a=d(a[0]),null==e&&(c=e),null==c||null==e){var f=this.getBBox(1);c=f.x+f.width/2,e=f.y+f.height/2}return this.transform(this._.transform.concat([["r",a,c,e]])),this},$b.scale=function(a,c,e,f){if(this.removed)return this;if(a=b(a).split(j),a.length-1&&(c=d(a[1]),e=d(a[2]),f=d(a[3])),a=d(a[0]),null==c&&(c=a),null==f&&(e=f),null==e||null==f)var g=this.getBBox(1);return e=null==e?g.x+g.width/2:e,f=null==f?g.y+g.height/2:f,this.transform(this._.transform.concat([["s",a,c,e,f]])),this},$b.translate=function(a,c){return this.removed?this:(a=b(a).split(j),a.length-1&&(c=d(a[1])),a=d(a[0])||0,c=+c||0,this.transform(this._.transform.concat([["t",a,c]])),this)},$b.transform=function(b){var d=this._;if(null==b)return d.transform;if(c._extractTransform(this,b),this.clip&&q(this.clip,{transform:this.matrix.invert()}),this.pattern&&s(this),this.node&&q(this.node,{transform:this.matrix}),1!=d.sx||1!=d.sy){var e=this.attrs[a]("stroke-width")?this.attrs["stroke-width"]:1;this.attr({"stroke-width":e})}return this},$b.hide=function(){return!this.removed&&this.paper.safari(this.node.style.display="none"),this},$b.show=function(){return!this.removed&&this.paper.safari(this.node.style.display=""),this},$b.remove=function(){var a=z(this.node);if(!this.removed&&a.parentNode){var b=this.paper;b.__set__&&b.__set__.exclude(this),k.unbind("raphael.*.*."+this.id),this.gradient&&b.defs.removeChild(this.gradient),c._tear(this,b),a.parentNode.removeChild(a),this.removeData();for(var d in this)this[d]="function"==typeof this[d]?c._removedFactory(d):null;this.removed=!0}},$b._getBBox=function(){if("none"==this.node.style.display){this.show();var a=!0}var b,c=!1;this.paper.canvas.parentElement?b=this.paper.canvas.parentElement.style:this.paper.canvas.parentNode&&(b=this.paper.canvas.parentNode.style),b&&"none"==b.display&&(c=!0,b.display="");var d={};try{d=this.node.getBBox()}catch(e){d={x:this.node.clientLeft,y:this.node.clientTop,width:this.node.clientWidth,height:this.node.clientHeight}}finally{d=d||{},c&&(b.display="none")}return a&&this.hide(),d},$b.attr=function(b,d){if(this.removed)return this;if(null==b){var e={};for(var f in this.attrs)this.attrs[a](f)&&(e[f]=this.attrs[f]);return e.gradient&&"none"==e.fill&&(e.fill=e.gradient)&&delete e.gradient,e.transform=this._.transform,e}if(null==d&&c.is(b,"string")){if("fill"==b&&"none"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;if("transform"==b)return this._.transform;for(var g=b.split(j),h={},i=0,l=g.length;l>i;i++)b=g[i],h[b]=b in this.attrs?this.attrs[b]:c.is(this.paper.customAttributes[b],"function")?this.paper.customAttributes[b].def:c._availableAttrs[b];return l-1?h:h[g[0]]}if(null==d&&c.is(b,"array")){for(h={},i=0,l=b.length;l>i;i++)h[b[i]]=this.attr(b[i]);return h}if(null!=d){var m={};m[b]=d}else null!=b&&c.is(b,"object")&&(m=b);for(var n in m)k("raphael.attr."+n+"."+this.id,this,m[n]);for(n in this.paper.customAttributes)if(this.paper.customAttributes[a](n)&&m[a](n)&&c.is(this.paper.customAttributes[n],"function")){var o=this.paper.customAttributes[n].apply(this,[].concat(m[n]));this.attrs[n]=m[n];for(var p in o)o[a](p)&&(m[p]=o[p])}return w(this,m),this},$b.toFront=function(){if(this.removed)return this;var a=z(this.node);a.parentNode.appendChild(a);var b=this.paper;return b.top!=this&&c._tofront(this,b),this},$b.toBack=function(){if(this.removed)return this;var a=z(this.node),b=a.parentNode;b.insertBefore(a,b.firstChild),c._toback(this,this.paper);this.paper;return this},$b.insertAfter=function(a){if(this.removed||!a)return this;var b=z(this.node),d=z(a.node||a[a.length-1].node);return d.nextSibling?d.parentNode.insertBefore(b,d.nextSibling):d.parentNode.appendChild(b),c._insertafter(this,a,this.paper),this},$b.insertBefore=function(a){if(this.removed||!a)return this;var b=z(this.node),d=z(a.node||a[0].node);return d.parentNode.insertBefore(b,d),c._insertbefore(this,a,this.paper),this},$b.blur=function(a){var b=this;if(0!==+a){var d=q("filter"),e=q("feGaussianBlur");b.attrs.blur=a,d.id=c.createUUID(),q(e,{stdDeviation:+a||1.5}),d.appendChild(e),b.paper.defs.appendChild(d),b._blur=d,q(b.node,{filter:"url(#"+d.id+")"})}else b._blur&&(b._blur.parentNode.removeChild(b._blur),delete b._blur,delete b.attrs.blur),b.node.removeAttribute("filter");return b},c._engine.circle=function(a,b,c,d){var e=q("circle");a.canvas&&a.canvas.appendChild(e);var f=new Element(e,a);return f.attrs={cx:b,cy:c,r:d,fill:"none",stroke:"#000"},f.type="circle",q(e,f.attrs),f},c._engine.rect=function(a,b,c,d,e,f){var g=q("rect");a.canvas&&a.canvas.appendChild(g);var h=new Element(g,a);return h.attrs={x:b,y:c,width:d,height:e,rx:f||0,ry:f||0,fill:"none",stroke:"#000"},h.type="rect",q(g,h.attrs),h},c._engine.ellipse=function(a,b,c,d,e){var f=q("ellipse");a.canvas&&a.canvas.appendChild(f);var g=new Element(f,a);return g.attrs={cx:b,cy:c,rx:d,ry:e,fill:"none",stroke:"#000"},g.type="ellipse",q(f,g.attrs),g},c._engine.image=function(a,b,c,d,e,f){var g=q("image");q(g,{x:c,y:d,width:e,height:f,preserveAspectRatio:"none"}),g.setAttributeNS(n,"href",b),a.canvas&&a.canvas.appendChild(g);var h=new Element(g,a);return h.attrs={x:c,y:d,width:e,height:f,src:b},h.type="image",h},c._engine.text=function(a,b,d,e){var f=q("text");a.canvas&&a.canvas.appendChild(f);var g=new Element(f,a);return g.attrs={x:b,y:d,"text-anchor":"middle",text:e,"font-family":c._availableAttrs["font-family"],"font-size":c._availableAttrs["font-size"],stroke:"none",fill:"#000"},g.type="text",w(g,g.attrs),g},c._engine.setSize=function(a,b){return this.width=a||this.width,this.height=b||this.height,this.canvas.setAttribute("width",this.width),this.canvas.setAttribute("height",this.height),this._viewBox&&this.setViewBox.apply(this,this._viewBox),this},c._engine.create=function(){var a=c._getContainer.apply(0,arguments),b=a&&a.container,d=a.x,e=a.y,f=a.width,g=a.height;if(!b)throw new Error("SVG container not found.");var h,i=q("svg"),j="overflow:hidden;";return d=d||0,e=e||0,f=f||512,g=g||342,q(i,{height:g,version:1.1,width:f,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}),1==b?(i.style.cssText=j+"position:absolute;left:"+d+"px;top:"+e+"px",c._g.doc.body.appendChild(i),h=1):(i.style.cssText=j+"position:relative",b.firstChild?b.insertBefore(i,b.firstChild):b.appendChild(i)),b=new c._Paper,b.width=f,b.height=g,b.canvas=i,b.clear(),b._left=b._top=0,h&&(b.renderfix=function(){}),b.renderfix(),b},c._engine.setViewBox=function(a,b,c,d,e){k("raphael.setViewBox",this,this._viewBox,[a,b,c,d,e]);var f,h,i=this.getSize(),j=g(c/i.width,d/i.height),l=this.top,n=e?"xMidYMid meet":"xMinYMin";for(null==a?(this._vbSize&&(j=1),delete this._vbSize,f="0 0 "+this.width+m+this.height):(this._vbSize=j,f=a+m+b+m+c+m+d),q(this.canvas,{viewBox:f,preserveAspectRatio:n});j&&l;)h="stroke-width"in l.attrs?l.attrs["stroke-width"]:1,l.attr({"stroke-width":h}),l._.dirty=1,l._.dirtyT=1,l=l.prev;return this._viewBox=[a,b,c,d,!!e],this},c.prototype.renderfix=function(){var a,b=this.canvas,c=b.style;try{a=b.getScreenCTM()||b.createSVGMatrix()}catch(d){a=b.createSVGMatrix()}var e=-a.e%1,f=-a.f%1;(e||f)&&(e&&(this._left=(this._left+e)%1,c.left=this._left+"px"),f&&(this._top=(this._top+f)%1,c.top=this._top+"px"))},c.prototype.clear=function(){c.eve("raphael.clear",this);for(var a=this.canvas;a.firstChild;)a.removeChild(a.firstChild);this.bottom=this.top=null,(this.desc=q("desc")).appendChild(c._g.doc.createTextNode("Created with Raphaël "+c.version)),a.appendChild(this.desc),a.appendChild(this.defs=q("defs"))},c.prototype.remove=function(){k("raphael.remove",this),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);for(var a in this)this[a]="function"==typeof this[a]?c._removedFactory(a):null};var A=c.st;for(var B in $b)$b[a](B)&&!A[a](B)&&(A[B]=function(a){return function(){var b=arguments;return this.forEach(function(c){c[a].apply(c,b)})}}(B))}}(),function(){if(c.vml){var a="hasOwnProperty",b=String,d=parseFloat,e=Math,f=e.round,g=e.max,h=e.min,i=e.abs,j="fill",k=/[, ]+/,l=c.eve,m=" progid:DXImageTransform.Microsoft",n=" ",o="",p={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},q=/([clmz]),?([^clmz]*)/gi,r=/ progid:\S+Blur\([^\)]+\)/g,s=/-?[^,\s-]+/g,t="position:absolute;left:0;top:0;width:1px;height:1px;behavior:url(#default#VML)",u=21600,v={path:1,rect:1,image:1},w={circle:1,ellipse:1},x=function(a){var d=/[ahqstv]/gi,e=c._pathToAbsolute;if(b(a).match(d)&&(e=c._path2curve),d=/[clmz]/g,e==c._pathToAbsolute&&!b(a).match(d)){var g=b(a).replace(q,function(a,b,c){var d=[],e="m"==b.toLowerCase(),g=p[b];return c.replace(s,function(a){e&&2==d.length&&(g+=d+p["m"==b?"l":"L"],d=[]),d.push(f(a*u))}),g+d});return g}var h,i,j=e(a);g=[];for(var k=0,l=j.length;l>k;k++){h=j[k],i=j[k][0].toLowerCase(),"z"==i&&(i="x");for(var m=1,r=h.length;r>m;m++)i+=f(h[m]*u)+(m!=r-1?",":o);g.push(i)}return g.join(n)},y=function(a,b,d){var e=c.matrix();return e.rotate(-a,.5,.5),{dx:e.x(b,d),dy:e.y(b,d)}},z=function(a,b,c,d,e,f){var g=a._,h=a.matrix,k=g.fillpos,l=a.node,m=l.style,o=1,p="",q=u/b,r=u/c;if(m.visibility="hidden",b&&c){if(l.coordsize=i(q)+n+i(r),m.rotation=f*(0>b*c?-1:1),f){var s=y(f,d,e);d=s.dx,e=s.dy}if(0>b&&(p+="x"),0>c&&(p+=" y")&&(o=-1),m.flip=p,l.coordorigin=d*-q+n+e*-r,k||g.fillsize){var t=l.getElementsByTagName(j);t=t&&t[0],l.removeChild(t),k&&(s=y(f,h.x(k[0],k[1]),h.y(k[0],k[1])),t.position=s.dx*o+n+s.dy*o),g.fillsize&&(t.size=g.fillsize[0]*i(b)+n+g.fillsize[1]*i(c)),l.appendChild(t)}m.visibility="visible"}};c.toString=function(){return"Your browser doesn’t support SVG. Falling down to VML.\nYou are running Raphaël "+this.version};var A=function(a,c,d){for(var e=b(c).toLowerCase().split("-"),f=d?"end":"start",g=e.length,h="classic",i="medium",j="medium";g--;)switch(e[g]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":h=e[g];break;case"wide":case"narrow":j=e[g];break;case"long":case"short":i=e[g]}var k=a.node.getElementsByTagName("stroke")[0];k[f+"arrow"]=h,k[f+"arrowlength"]=i,k[f+"arrowwidth"]=j},B=function(e,i){e.attrs=e.attrs||{};var l=e.node,m=e.attrs,p=l.style,q=v[e.type]&&(i.x!=m.x||i.y!=m.y||i.width!=m.width||i.height!=m.height||i.cx!=m.cx||i.cy!=m.cy||i.rx!=m.rx||i.ry!=m.ry||i.r!=m.r),r=w[e.type]&&(m.cx!=i.cx||m.cy!=i.cy||m.r!=i.r||m.rx!=i.rx||m.ry!=i.ry),s=e;for(var t in i)i[a](t)&&(m[t]=i[t]);if(q&&(m.path=c._getPath[e.type](e),e._.dirty=1),i.href&&(l.href=i.href),i.title&&(l.title=i.title),i.target&&(l.target=i.target),i.cursor&&(p.cursor=i.cursor),"blur"in i&&e.blur(i.blur),(i.path&&"path"==e.type||q)&&(l.path=x(~b(m.path).toLowerCase().indexOf("r")?c._pathToAbsolute(m.path):m.path),e._.dirty=1,"image"==e.type&&(e._.fillpos=[m.x,m.y],e._.fillsize=[m.width,m.height],z(e,1,1,0,0,0))),"transform"in i&&e.transform(i.transform),r){var y=+m.cx,B=+m.cy,D=+m.rx||+m.r||0,E=+m.ry||+m.r||0;l.path=c.format("ar{0},{1},{2},{3},{4},{1},{4},{1}x",f((y-D)*u),f((B-E)*u),f((y+D)*u),f((B+E)*u),f(y*u)),e._.dirty=1}if("clip-rect"in i){var G=b(i["clip-rect"]).split(k);if(4==G.length){G[2]=+G[2]+ +G[0],G[3]=+G[3]+ +G[1];var H=l.clipRect||c._g.doc.createElement("div"),I=H.style;I.clip=c.format("rect({1}px {2}px {3}px {0}px)",G),l.clipRect||(I.position="absolute",I.top=0,I.left=0,I.width=e.paper.width+"px",I.height=e.paper.height+"px",l.parentNode.insertBefore(H,l),H.appendChild(l),l.clipRect=H)}i["clip-rect"]||l.clipRect&&(l.clipRect.style.clip="auto")}if(e.textpath){var J=e.textpath.style;i.font&&(J.font=i.font),i["font-family"]&&(J.fontFamily='"'+i["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g,o)+'"'),i["font-size"]&&(J.fontSize=i["font-size"]),i["font-weight"]&&(J.fontWeight=i["font-weight"]),i["font-style"]&&(J.fontStyle=i["font-style"])}if("arrow-start"in i&&A(s,i["arrow-start"]),"arrow-end"in i&&A(s,i["arrow-end"],1),null!=i.opacity||null!=i["stroke-width"]||null!=i.fill||null!=i.src||null!=i.stroke||null!=i["stroke-width"]||null!=i["stroke-opacity"]||null!=i["fill-opacity"]||null!=i["stroke-dasharray"]||null!=i["stroke-miterlimit"]||null!=i["stroke-linejoin"]||null!=i["stroke-linecap"]){var K=l.getElementsByTagName(j),L=!1;if(K=K&&K[0],!K&&(L=K=F(j)),"image"==e.type&&i.src&&(K.src=i.src),i.fill&&(K.on=!0),(null==K.on||"none"==i.fill||null===i.fill)&&(K.on=!1),K.on&&i.fill){var M=b(i.fill).match(c._ISURL);if(M){K.parentNode==l&&l.removeChild(K),K.rotate=!0,K.src=M[1],K.type="tile";var N=e.getBBox(1);K.position=N.x+n+N.y,e._.fillpos=[N.x,N.y],c._preload(M[1],function(){e._.fillsize=[this.offsetWidth,this.offsetHeight]})}else K.color=c.getRGB(i.fill).hex,K.src=o,K.type="solid",c.getRGB(i.fill).error&&(s.type in{circle:1,ellipse:1}||"r"!=b(i.fill).charAt())&&C(s,i.fill,K)&&(m.fill="none",m.gradient=i.fill,K.rotate=!1)}if("fill-opacity"in i||"opacity"in i){var O=((+m["fill-opacity"]+1||2)-1)*((+m.opacity+1||2)-1)*((+c.getRGB(i.fill).o+1||2)-1);O=h(g(O,0),1),K.opacity=O,K.src&&(K.color="none")}l.appendChild(K);var P=l.getElementsByTagName("stroke")&&l.getElementsByTagName("stroke")[0],Q=!1;!P&&(Q=P=F("stroke")),(i.stroke&&"none"!=i.stroke||i["stroke-width"]||null!=i["stroke-opacity"]||i["stroke-dasharray"]||i["stroke-miterlimit"]||i["stroke-linejoin"]||i["stroke-linecap"])&&(P.on=!0),("none"==i.stroke||null===i.stroke||null==P.on||0==i.stroke||0==i["stroke-width"])&&(P.on=!1);var R=c.getRGB(i.stroke);P.on&&i.stroke&&(P.color=R.hex),O=((+m["stroke-opacity"]+1||2)-1)*((+m.opacity+1||2)-1)*((+R.o+1||2)-1);var S=.75*(d(i["stroke-width"])||1);if(O=h(g(O,0),1),null==i["stroke-width"]&&(S=m["stroke-width"]),i["stroke-width"]&&(P.weight=S),S&&1>S&&(O*=S)&&(P.weight=1),P.opacity=O,i["stroke-linejoin"]&&(P.joinstyle=i["stroke-linejoin"]||"miter"),P.miterlimit=i["stroke-miterlimit"]||8,i["stroke-linecap"]&&(P.endcap="butt"==i["stroke-linecap"]?"flat":"square"==i["stroke-linecap"]?"square":"round"),"stroke-dasharray"in i){var T={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};P.dashstyle=T[a](i["stroke-dasharray"])?T[i["stroke-dasharray"]]:o}Q&&l.appendChild(P)}if("text"==s.type){s.paper.canvas.style.display=o;var U=s.paper.span,V=100,W=m.font&&m.font.match(/\d+(?:\.\d*)?(?=px)/);p=U.style,m.font&&(p.font=m.font),m["font-family"]&&(p.fontFamily=m["font-family"]),m["font-weight"]&&(p.fontWeight=m["font-weight"]),m["font-style"]&&(p.fontStyle=m["font-style"]),W=d(m["font-size"]||W&&W[0])||10,p.fontSize=W*V+"px",s.textpath.string&&(U.innerHTML=b(s.textpath.string).replace(/"));var X=U.getBoundingClientRect();s.W=m.w=(X.right-X.left)/V,s.H=m.h=(X.bottom-X.top)/V,s.X=m.x,s.Y=m.y+s.H/2,("x"in i||"y"in i)&&(s.path.v=c.format("m{0},{1}l{2},{1}",f(m.x*u),f(m.y*u),f(m.x*u)+1));for(var Y=["x","y","text","font","font-family","font-weight","font-style","font-size"],Z=0,$=Y.length;$>Z;Z++)if(Y[Z]in i){s._.dirty=1;break}switch(m["text-anchor"]){case"start":s.textpath.style["v-text-align"]="left",s.bbx=s.W/2;break;case"end":s.textpath.style["v-text-align"]="right",s.bbx=-s.W/2;break;default:s.textpath.style["v-text-align"]="center",s.bbx=0}s.textpath.style["v-text-kern"]=!0}},C=function(a,f,g){a.attrs=a.attrs||{};var h=(a.attrs,Math.pow),i="linear",j=".5 .5";if(a.attrs.gradient=f,f=b(f).replace(c._radial_gradient,function(a,b,c){return i="radial",b&&c&&(b=d(b),c=d(c),h(b-.5,2)+h(c-.5,2)>.25&&(c=e.sqrt(.25-h(b-.5,2))*(2*(c>.5)-1)+.5),j=b+n+c),o}),f=f.split(/\s*\-\s*/),"linear"==i){var k=f.shift();if(k=-d(k),isNaN(k))return null}var l=c._parseDots(f);if(!l)return null;if(a=a.shape||a.node,l.length){a.removeChild(g),g.on=!0,g.method="none",g.color=l[0].color,g.color2=l[l.length-1].color;for(var m=[],p=0,q=l.length;q>p;p++)l[p].offset&&m.push(l[p].offset+n+l[p].color);g.colors=m.length?m.join():"0% "+g.color,"radial"==i?(g.type="gradientTitle",g.focus="100%",g.focussize="0 0",g.focusposition=j,g.angle=0):(g.type="gradient",g.angle=(270-k)%360),a.appendChild(g)}return 1},D=function(a,b){this[0]=this.node=a,a.raphael=!0,this.id=c._oid++,a.raphaelid=this.id,this.X=0,this.Y=0,this.attrs={},this.paper=b,this.matrix=c.matrix(),this._={transform:[],sx:1,sy:1,dx:0,dy:0,deg:0,dirty:1,dirtyT:1},!b.bottom&&(b.bottom=this),this.prev=b.top,b.top&&(b.top.next=this),b.top=this,this.next=null},E=c.el;D.prototype=E,E.constructor=D,E.transform=function(a){if(null==a)return this._.transform;var d,e=this.paper._viewBoxShift,f=e?"s"+[e.scale,e.scale]+"-1-1t"+[e.dx,e.dy]:o;e&&(d=a=b(a).replace(/\.{3}|\u2026/g,this._.transform||o)),c._extractTransform(this,f+a);var g,h=this.matrix.clone(),i=this.skew,j=this.node,k=~b(this.attrs.fill).indexOf("-"),l=!b(this.attrs.fill).indexOf("url(");if(h.translate(1,1),l||k||"image"==this.type)if(i.matrix="1 0 0 1",i.offset="0 0",g=h.split(),k&&g.noRotation||!g.isSimple){j.style.filter=h.toFilter();var m=this.getBBox(),p=this.getBBox(1),q=m.x-p.x,r=m.y-p.y;j.coordorigin=q*-u+n+r*-u,z(this,1,1,q,r,0)}else j.style.filter=o,z(this,g.scalex,g.scaley,g.dx,g.dy,g.rotate);else j.style.filter=o,i.matrix=b(h),i.offset=h.offset();return null!==d&&(this._.transform=d,c._extractTransform(this,d)),this},E.rotate=function(a,c,e){if(this.removed)return this;if(null!=a){if(a=b(a).split(k),a.length-1&&(c=d(a[1]),e=d(a[2])),a=d(a[0]),null==e&&(c=e),null==c||null==e){var f=this.getBBox(1);c=f.x+f.width/2,e=f.y+f.height/2}return this._.dirtyT=1,this.transform(this._.transform.concat([["r",a,c,e]])),this}},E.translate=function(a,c){return this.removed?this:(a=b(a).split(k),a.length-1&&(c=d(a[1])),a=d(a[0])||0,c=+c||0,this._.bbox&&(this._.bbox.x+=a,this._.bbox.y+=c),this.transform(this._.transform.concat([["t",a,c]])),this)},E.scale=function(a,c,e,f){if(this.removed)return this;if(a=b(a).split(k),a.length-1&&(c=d(a[1]),e=d(a[2]),f=d(a[3]),isNaN(e)&&(e=null),isNaN(f)&&(f=null)),a=d(a[0]),null==c&&(c=a),null==f&&(e=f),null==e||null==f)var g=this.getBBox(1);return e=null==e?g.x+g.width/2:e,f=null==f?g.y+g.height/2:f,this.transform(this._.transform.concat([["s",a,c,e,f]])),this._.dirtyT=1,this},E.hide=function(){return!this.removed&&(this.node.style.display="none"),this},E.show=function(){return!this.removed&&(this.node.style.display=o),this},E.auxGetBBox=c.el.getBBox,E.getBBox=function(){var a=this.auxGetBBox();if(this.paper&&this.paper._viewBoxShift){var b={},c=1/this.paper._viewBoxShift.scale;return b.x=a.x-this.paper._viewBoxShift.dx,b.x*=c,b.y=a.y-this.paper._viewBoxShift.dy,b.y*=c,b.width=a.width*c,b.height=a.height*c,b.x2=b.x+b.width,b.y2=b.y+b.height,b}return a},E._getBBox=function(){return this.removed?{}:{x:this.X+(this.bbx||0)-this.W/2,y:this.Y-this.H,width:this.W,height:this.H}},E.remove=function(){if(!this.removed&&this.node.parentNode){this.paper.__set__&&this.paper.__set__.exclude(this),c.eve.unbind("raphael.*.*."+this.id),c._tear(this,this.paper),this.node.parentNode.removeChild(this.node),this.shape&&this.shape.parentNode.removeChild(this.shape);for(var a in this)this[a]="function"==typeof this[a]?c._removedFactory(a):null;this.removed=!0}},E.attr=function(b,d){if(this.removed)return this;if(null==b){var e={};for(var f in this.attrs)this.attrs[a](f)&&(e[f]=this.attrs[f]);return e.gradient&&"none"==e.fill&&(e.fill=e.gradient)&&delete e.gradient,e.transform=this._.transform,e}if(null==d&&c.is(b,"string")){if(b==j&&"none"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;for(var g=b.split(k),h={},i=0,m=g.length;m>i;i++)b=g[i],h[b]=b in this.attrs?this.attrs[b]:c.is(this.paper.customAttributes[b],"function")?this.paper.customAttributes[b].def:c._availableAttrs[b];return m-1?h:h[g[0]]}if(this.attrs&&null==d&&c.is(b,"array")){for(h={},i=0,m=b.length;m>i;i++)h[b[i]]=this.attr(b[i]);return h}var n;null!=d&&(n={},n[b]=d),null==d&&c.is(b,"object")&&(n=b);for(var o in n)l("raphael.attr."+o+"."+this.id,this,n[o]);if(n){for(o in this.paper.customAttributes)if(this.paper.customAttributes[a](o)&&n[a](o)&&c.is(this.paper.customAttributes[o],"function")){var p=this.paper.customAttributes[o].apply(this,[].concat(n[o]));this.attrs[o]=n[o];for(var q in p)p[a](q)&&(n[q]=p[q])}n.text&&"text"==this.type&&(this.textpath.string=n.text),B(this,n)}return this},E.toFront=function(){return!this.removed&&this.node.parentNode.appendChild(this.node),this.paper&&this.paper.top!=this&&c._tofront(this,this.paper),this},E.toBack=function(){return this.removed?this:(this.node.parentNode.firstChild!=this.node&&(this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild),c._toback(this,this.paper)),this)},E.insertAfter=function(a){return this.removed?this:(a.constructor==c.st.constructor&&(a=a[a.length-1]),a.node.nextSibling?a.node.parentNode.insertBefore(this.node,a.node.nextSibling):a.node.parentNode.appendChild(this.node),c._insertafter(this,a,this.paper),this)},E.insertBefore=function(a){return this.removed?this:(a.constructor==c.st.constructor&&(a=a[0]),a.node.parentNode.insertBefore(this.node,a.node),c._insertbefore(this,a,this.paper),this)},E.blur=function(a){var b=this.node.runtimeStyle,d=b.filter;return d=d.replace(r,o),0!==+a?(this.attrs.blur=a,b.filter=d+n+m+".Blur(pixelradius="+(+a||1.5)+")",b.margin=c.format("-{0}px 0 0 -{0}px",f(+a||1.5))):(b.filter=d,b.margin=0,delete this.attrs.blur),this},c._engine.path=function(a,b){var c=F("shape");c.style.cssText=t,c.coordsize=u+n+u,c.coordorigin=b.coordorigin;var d=new D(c,b),e={fill:"none",stroke:"#000"};a&&(e.path=a),d.type="path",d.path=[],d.Path=o,B(d,e),b.canvas.appendChild(c);var f=F("skew");return f.on=!0,c.appendChild(f),d.skew=f,d.transform(o),d},c._engine.rect=function(a,b,d,e,f,g){var h=c._rectPath(b,d,e,f,g),i=a.path(h),j=i.attrs;return i.X=j.x=b,i.Y=j.y=d,i.W=j.width=e,i.H=j.height=f,j.r=g,j.path=h,i.type="rect",i},c._engine.ellipse=function(a,b,c,d,e){{var f=a.path();f.attrs}return f.X=b-d,f.Y=c-e,f.W=2*d,f.H=2*e,f.type="ellipse",B(f,{cx:b,cy:c,rx:d,ry:e}),f},c._engine.circle=function(a,b,c,d){{var e=a.path();e.attrs}return e.X=b-d,e.Y=c-d,e.W=e.H=2*d,e.type="circle",B(e,{cx:b,cy:c,r:d}),e},c._engine.image=function(a,b,d,e,f,g){var h=c._rectPath(d,e,f,g),i=a.path(h).attr({stroke:"none"}),k=i.attrs,l=i.node,m=l.getElementsByTagName(j)[0];return k.src=b,i.X=k.x=d,i.Y=k.y=e,i.W=k.width=f,i.H=k.height=g,k.path=h,i.type="image",m.parentNode==l&&l.removeChild(m),m.rotate=!0,m.src=b,m.type="tile",i._.fillpos=[d,e],i._.fillsize=[f,g],l.appendChild(m),z(i,1,1,0,0,0),i},c._engine.text=function(a,d,e,g){var h=F("shape"),i=F("path"),j=F("textpath");d=d||0,e=e||0,g=g||"",i.v=c.format("m{0},{1}l{2},{1}",f(d*u),f(e*u),f(d*u)+1),i.textpathok=!0,j.string=b(g),j.on=!0,h.style.cssText=t,h.coordsize=u+n+u,h.coordorigin="0 0";var k=new D(h,a),l={fill:"#000",stroke:"none",font:c._availableAttrs.font,text:g};k.shape=h,k.path=i,k.textpath=j,k.type="text",k.attrs.text=b(g),k.attrs.x=d,k.attrs.y=e,k.attrs.w=1,k.attrs.h=1,B(k,l),h.appendChild(j),h.appendChild(i),a.canvas.appendChild(h);var m=F("skew");return m.on=!0,h.appendChild(m),k.skew=m,k.transform(o),k},c._engine.setSize=function(a,b){var d=this.canvas.style;return this.width=a,this.height=b,a==+a&&(a+="px"),b==+b&&(b+="px"),d.width=a,d.height=b,d.clip="rect(0 "+a+" "+b+" 0)",this._viewBox&&c._engine.setViewBox.apply(this,this._viewBox),this},c._engine.setViewBox=function(a,b,d,e,f){c.eve("raphael.setViewBox",this,this._viewBox,[a,b,d,e,f]);var g,h,i=this.getSize(),j=i.width,k=i.height;return f&&(g=k/e,h=j/d,j>d*g&&(a-=(j-d*g)/2/g),k>e*h&&(b-=(k-e*h)/2/h)),this._viewBox=[a,b,d,e,!!f],this._viewBoxShift={dx:-a,dy:-b,scale:size},this.forEach(function(a){a.transform("...")}),this};var F;c._engine.initWin=function(a){var b=a.document;b.styleSheets.length<31?b.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)"):b.styleSheets[0].addRule(".rvml","behavior:url(#default#VML)");try{!b.namespaces.rvml&&b.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),F=function(a){return b.createElement("')}}catch(c){F=function(a){return b.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},c._engine.initWin(c._g.win),c._engine.create=function(){var a=c._getContainer.apply(0,arguments),b=a.container,d=a.height,e=a.width,f=a.x,g=a.y;if(!b)throw new Error("VML container not found.");var h=new c._Paper,i=h.canvas=c._g.doc.createElement("div"),j=i.style;return f=f||0,g=g||0,e=e||512,d=d||342,h.width=e,h.height=d,e==+e&&(e+="px"),d==+d&&(d+="px"),h.coordsize=1e3*u+n+1e3*u,h.coordorigin="0 0",h.span=c._g.doc.createElement("span"),h.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",i.appendChild(h.span),j.cssText=c.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",e,d),1==b?(c._g.doc.body.appendChild(i),j.left=f+"px",j.top=g+"px",j.position="absolute"):b.firstChild?b.insertBefore(i,b.firstChild):b.appendChild(i),h.renderfix=function(){},h},c.prototype.clear=function(){c.eve("raphael.clear",this),this.canvas.innerHTML=o,this.span=c._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},c.prototype.remove=function(){c.eve("raphael.remove",this),this.canvas.parentNode.removeChild(this.canvas);for(var a in this)this[a]="function"==typeof this[a]?c._removedFactory(a):null;return!0};var G=c.st;for(var H in E)E[a](H)&&!G[a](H)&&(G[H]=function(a){return function(){var b=arguments;return this.forEach(function(c){c[a].apply(c,b)})}}(H))}}(),B.was?A.win.Raphael=c:Raphael=c,"object"==typeof exports&&(module.exports=c),c}); \ No newline at end of file diff --git a/src/main/resources/static/editor.md-master/lib/sequence-diagram.min.js b/src/main/resources/static/editor.md-master/lib/sequence-diagram.min.js deleted file mode 100644 index 521b782..0000000 --- a/src/main/resources/static/editor.md-master/lib/sequence-diagram.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/** js sequence diagrams 1.0.4 - * http://bramp.github.io/js-sequence-diagrams/ - * (c) 2012-2013 Andrew Brampton (bramp.net) - * @license Simplified BSD license. - */ -!function(){"use strict";function Diagram(){this.title=void 0,this.actors=[],this.signals=[]}function ParseError(message,hash){_.extend(this,hash),this.name="ParseError",this.message=message||""}Diagram.prototype.getActor=function(alias){var s=/^(.+) as (\S+)$/i.exec(alias.trim());s?(name=s[1].trim(),alias=s[2].trim()):name=alias.trim(),name=name.replace(/\\n/gm,"\n");var i,actors=this.actors;for(i in actors)if(actors[i].alias==alias)return actors[i];return i=actors.push(new Diagram.Actor(alias,name,actors.length)),actors[i-1]},Diagram.prototype.setTitle=function(title){this.title=title},Diagram.prototype.addSignal=function(signal){this.signals.push(signal)},Diagram.Actor=function(alias,name,index){this.alias=alias,this.name=name,this.index=index},Diagram.Signal=function(actorA,signaltype,actorB,message){this.type="Signal",this.actorA=actorA,this.actorB=actorB,this.linetype=3&signaltype,this.arrowtype=3&signaltype>>2,this.message=message},Diagram.Signal.prototype.isSelf=function(){return this.actorA.index==this.actorB.index},Diagram.Note=function(actor,placement,message){if(this.type="Note",this.actor=actor,this.placement=placement,this.message=message,this.hasManyActors()&&actor[0]==actor[1])throw new Error("Note should be over two different actors")},Diagram.Note.prototype.hasManyActors=function(){return _.isArray(this.actor)},Diagram.LINETYPE={SOLID:0,DOTTED:1},Diagram.ARROWTYPE={FILLED:0,OPEN:1},Diagram.PLACEMENT={LEFTOF:0,RIGHTOF:1,OVER:2};var grammar=function(){function Parser(){this.yy={}}var parser={trace:function(){},yy:{},symbols_:{error:2,start:3,document:4,EOF:5,line:6,statement:7,NL:8,participant:9,actor:10,signal:11,note_statement:12,title:13,message:14,note:15,placement:16,over:17,actor_pair:18,",":19,left_of:20,right_of:21,signaltype:22,ACTOR:23,linetype:24,arrowtype:25,LINE:26,DOTLINE:27,ARROW:28,OPENARROW:29,MESSAGE:30,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",8:"NL",9:"participant",13:"title",15:"note",17:"over",19:",",20:"left_of",21:"right_of",23:"ACTOR",26:"LINE",27:"DOTLINE",28:"ARROW",29:"OPENARROW",30:"MESSAGE"},productions_:[0,[3,2],[4,0],[4,2],[6,1],[6,1],[7,2],[7,1],[7,1],[7,2],[12,4],[12,4],[18,1],[18,3],[16,1],[16,1],[11,4],[10,1],[22,2],[22,1],[24,1],[24,1],[25,1],[25,1],[14,1]],performAction:function(yytext,yyleng,yylineno,yy,yystate,$$){var $0=$$.length-1;switch(yystate){case 1:return yy;case 4:break;case 6:$$[$0];break;case 7:yy.addSignal($$[$0]);break;case 8:yy.addSignal($$[$0]);break;case 9:yy.setTitle($$[$0]);break;case 10:this.$=new Diagram.Note($$[$0-1],$$[$0-2],$$[$0]);break;case 11:this.$=new Diagram.Note($$[$0-1],Diagram.PLACEMENT.OVER,$$[$0]);break;case 12:this.$=$$[$0];break;case 13:this.$=[$$[$0-2],$$[$0]];break;case 14:this.$=Diagram.PLACEMENT.LEFTOF;break;case 15:this.$=Diagram.PLACEMENT.RIGHTOF;break;case 16:this.$=new Diagram.Signal($$[$0-3],$$[$0-2],$$[$0-1],$$[$0]);break;case 17:this.$=yy.getActor($$[$0]);break;case 18:this.$=$$[$0-1]|$$[$0]<<2;break;case 19:this.$=$$[$0];break;case 20:this.$=Diagram.LINETYPE.SOLID;break;case 21:this.$=Diagram.LINETYPE.DOTTED;break;case 22:this.$=Diagram.ARROWTYPE.FILLED;break;case 23:this.$=Diagram.ARROWTYPE.OPEN;break;case 24:this.$=$$[$0].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:2,5:[2,2],8:[2,2],9:[2,2],13:[2,2],15:[2,2],23:[2,2]},{1:[3]},{5:[1,3],6:4,7:5,8:[1,6],9:[1,7],10:11,11:8,12:9,13:[1,10],15:[1,12],23:[1,13]},{1:[2,1]},{5:[2,3],8:[2,3],9:[2,3],13:[2,3],15:[2,3],23:[2,3]},{5:[2,4],8:[2,4],9:[2,4],13:[2,4],15:[2,4],23:[2,4]},{5:[2,5],8:[2,5],9:[2,5],13:[2,5],15:[2,5],23:[2,5]},{10:14,23:[1,13]},{5:[2,7],8:[2,7],9:[2,7],13:[2,7],15:[2,7],23:[2,7]},{5:[2,8],8:[2,8],9:[2,8],13:[2,8],15:[2,8],23:[2,8]},{14:15,30:[1,16]},{22:17,24:18,26:[1,19],27:[1,20]},{16:21,17:[1,22],20:[1,23],21:[1,24]},{5:[2,17],8:[2,17],9:[2,17],13:[2,17],15:[2,17],19:[2,17],23:[2,17],26:[2,17],27:[2,17],30:[2,17]},{5:[2,6],8:[2,6],9:[2,6],13:[2,6],15:[2,6],23:[2,6]},{5:[2,9],8:[2,9],9:[2,9],13:[2,9],15:[2,9],23:[2,9]},{5:[2,24],8:[2,24],9:[2,24],13:[2,24],15:[2,24],23:[2,24]},{10:25,23:[1,13]},{23:[2,19],25:26,28:[1,27],29:[1,28]},{23:[2,20],28:[2,20],29:[2,20]},{23:[2,21],28:[2,21],29:[2,21]},{10:29,23:[1,13]},{10:31,18:30,23:[1,13]},{23:[2,14]},{23:[2,15]},{14:32,30:[1,16]},{23:[2,18]},{23:[2,22]},{23:[2,23]},{14:33,30:[1,16]},{14:34,30:[1,16]},{19:[1,35],30:[2,12]},{5:[2,16],8:[2,16],9:[2,16],13:[2,16],15:[2,16],23:[2,16]},{5:[2,10],8:[2,10],9:[2,10],13:[2,10],15:[2,10],23:[2,10]},{5:[2,11],8:[2,11],9:[2,11],13:[2,11],15:[2,11],23:[2,11]},{10:36,23:[1,13]},{30:[2,13]}],defaultActions:{3:[2,1],23:[2,14],24:[2,15],26:[2,18],27:[2,22],28:[2,23],36:[2,13]},parseError:function(str,hash){if(!hash.recoverable)throw new Error(str);this.trace(str)},parse:function(input){function lex(){var token;return token=self.lexer.lex()||EOF,"number"!=typeof token&&(token=self.symbols_[token]||token),token}var self=this,stack=[0],vstack=[null],lstack=[],table=this.table,yytext="",yylineno=0,yyleng=0,recovering=0,TERROR=2,EOF=1;this.lexer.setInput(input),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var yyloc=this.lexer.yylloc;lstack.push(yyloc);var ranges=this.lexer.options&&this.lexer.options.ranges;this.parseError="function"==typeof this.yy.parseError?this.yy.parseError:Object.getPrototypeOf(this).parseError;for(var symbol,preErrorSymbol,state,action,r,p,len,newState,expected,yyval={};;){if(state=stack[stack.length-1],this.defaultActions[state]?action=this.defaultActions[state]:((null===symbol||"undefined"==typeof symbol)&&(symbol=lex()),action=table[state]&&table[state][symbol]),"undefined"==typeof action||!action.length||!action[0]){var errStr="";expected=[];for(p in table[state])this.terminals_[p]&&p>TERROR&&expected.push("'"+this.terminals_[p]+"'");errStr=this.lexer.showPosition?"Parse error on line "+(yylineno+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+expected.join(", ")+", got '"+(this.terminals_[symbol]||symbol)+"'":"Parse error on line "+(yylineno+1)+": Unexpected "+(symbol==EOF?"end of input":"'"+(this.terminals_[symbol]||symbol)+"'"),this.parseError(errStr,{text:this.lexer.match,token:this.terminals_[symbol]||symbol,line:this.lexer.yylineno,loc:yyloc,expected:expected})}if(action[0]instanceof Array&&action.length>1)throw new Error("Parse Error: multiple actions possible at state: "+state+", token: "+symbol);switch(action[0]){case 1:stack.push(symbol),vstack.push(this.lexer.yytext),lstack.push(this.lexer.yylloc),stack.push(action[1]),symbol=null,preErrorSymbol?(symbol=preErrorSymbol,preErrorSymbol=null):(yyleng=this.lexer.yyleng,yytext=this.lexer.yytext,yylineno=this.lexer.yylineno,yyloc=this.lexer.yylloc,recovering>0&&recovering--);break;case 2:if(len=this.productions_[action[1]][1],yyval.$=vstack[vstack.length-len],yyval._$={first_line:lstack[lstack.length-(len||1)].first_line,last_line:lstack[lstack.length-1].last_line,first_column:lstack[lstack.length-(len||1)].first_column,last_column:lstack[lstack.length-1].last_column},ranges&&(yyval._$.range=[lstack[lstack.length-(len||1)].range[0],lstack[lstack.length-1].range[1]]),r=this.performAction.call(yyval,yytext,yyleng,yylineno,this.yy,action[1],vstack,lstack),"undefined"!=typeof r)return r;len&&(stack=stack.slice(0,2*-1*len),vstack=vstack.slice(0,-1*len),lstack=lstack.slice(0,-1*len)),stack.push(this.productions_[action[1]][0]),vstack.push(yyval.$),lstack.push(yyval._$),newState=table[stack[stack.length-2]][stack[stack.length-1]],stack.push(newState);break;case 3:return!0}}return!0}},lexer=function(){var lexer={EOF:1,parseError:function(str,hash){if(!this.yy.parser)throw new Error(str);this.yy.parser.parseError(str,hash)},setInput:function(input){return this._input=input,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var ch=this._input[0];this.yytext+=ch,this.yyleng++,this.offset++,this.match+=ch,this.matched+=ch;var lines=ch.match(/(?:\r\n?|\n).*/g);return lines?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),ch},unput:function(ch){var len=ch.length,lines=ch.split(/(?:\r\n?|\n)/g);this._input=ch+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-len-1),this.offset-=len;var oldLines=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),lines.length-1&&(this.yylineno-=lines.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:lines?(lines.length===oldLines.length?this.yylloc.first_column:0)+oldLines[oldLines.length-lines.length].length-lines[0].length:this.yylloc.first_column-len},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-len]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(n){this.unput(this.match.slice(n))},pastInput:function(){var past=this.matched.substr(0,this.matched.length-this.match.length);return(past.length>20?"...":"")+past.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var next=this.match;return next.length<20&&(next+=this._input.substr(0,20-next.length)),(next.substr(0,20)+(next.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var pre=this.pastInput(),c=new Array(pre.length+1).join("-");return pre+this.upcomingInput()+"\n"+c+"^"},test_match:function(match,indexed_rule){var token,lines,backup;if(this.options.backtrack_lexer&&(backup={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(backup.yylloc.range=this.yylloc.range.slice(0))),lines=match[0].match(/(?:\r\n?|\n).*/g),lines&&(this.yylineno+=lines.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:lines?lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+match[0].length},this.yytext+=match[0],this.match+=match[0],this.matches=match,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(match[0].length),this.matched+=match[0],token=this.performAction.call(this,this.yy,this,indexed_rule,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),token)return token;if(this._backtrack){for(var k in backup)this[k]=backup[k];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var token,match,tempMatch,index;this._more||(this.yytext="",this.match="");for(var rules=this._currentRules(),i=0;imatch[0].length)){if(match=tempMatch,index=i,this.options.backtrack_lexer){if(token=this.test_match(tempMatch,rules[i]),token!==!1)return token;if(this._backtrack){match=!1;continue}return!1}if(!this.options.flex)break}return match?(token=this.test_match(match,rules[index]),token!==!1?token:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var r=this.next();return r?r:this.lex()},begin:function(condition){this.conditionStack.push(condition)},popState:function(){var n=this.conditionStack.length-1;return n>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(n){return n=this.conditionStack.length-1-Math.abs(n||0),n>=0?this.conditionStack[n]:"INITIAL"},pushState:function(condition){this.begin(condition)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(yy,yy_,$avoiding_name_collisions,YY_START){switch($avoiding_name_collisions){case 0:return 8;case 1:break;case 2:break;case 3:return 9;case 4:return 20;case 5:return 21;case 6:return 17;case 7:return 15;case 8:return 13;case 9:return 19;case 10:return 23;case 11:return 27;case 12:return 26;case 13:return 29;case 14:return 28;case 15:return 30;case 16:return 5;case 17:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:participant\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:title\b)/i,/^(?:,)/i,/^(?:[^\->:\n,]+)/i,/^(?:--)/i,/^(?:-)/i,/^(?:>>)/i,/^(?:>)/i,/^(?:[^#\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],inclusive:!0}}};return lexer}();return parser.lexer=lexer,Parser.prototype=parser,parser.Parser=Parser,new Parser}();"undefined"!=typeof require&&"undefined"!=typeof exports&&(exports.parser=grammar,exports.Parser=grammar.Parser,exports.parse=function(){return grammar.parse.apply(grammar,arguments)},exports.main=function(args){args[1]||(console.log("Usage: "+args[0]+" FILE"),process.exit(1));var source=require("fs").readFileSync(require("path").normalize(args[1]),"utf8");return exports.parser.parse(source)},"undefined"!=typeof module&&require.main===module&&exports.main(process.argv.slice(1))),ParseError.prototype=new Error,Diagram.ParseError=ParseError,grammar.parseError=function(message,hash){throw new ParseError(message,hash)},Diagram.parse=function(input){return grammar.yy=new Diagram,grammar.parse(input)},this.Diagram=Diagram}.call(this),"undefined"!=typeof jQuery&&function($){$.fn.sequenceDiagram=function(options){return this.each(function(){var $this=$(this),diagram=Diagram.parse($this.text());$this.html(""),diagram.drawSVG(this,options)})}}(jQuery),Raphael.registerFont({w:209,face:{"font-family":"daniel","font-weight":700,"font-stretch":"normal","units-per-em":"360","panose-1":"2 11 8 0 0 0 0 0 0 0",ascent:"288",descent:"-72","x-height":"7",bbox:"-92.0373 -310.134 632 184.967","underline-thickness":"3.51562","underline-position":"-21.6211","unicode-range":"U+0009-U+F002"},glyphs:{" ":{w:179}," ":{w:179},"!":{d:"66,-306v9,3,18,11,19,24v-18,73,-20,111,-37,194v0,10,2,34,-12,34v-12,0,-18,-9,-18,-28v0,-85,23,-136,38,-214v1,-7,4,-10,10,-10xm25,-30v15,-1,28,34,5,35v-11,-1,-38,-36,-5,-35",w:115},'"':{d:"91,-214v-32,3,-25,-40,-20,-68v3,-16,7,-25,12,-27v35,13,14,56,8,95xm8,-231v4,-31,1,-40,18,-75v37,7,11,51,11,79v-3,3,-4,8,-5,13v-17,4,-16,-10,-24,-17",w:117},"#":{d:"271,-64v-30,26,-96,-7,-102,51v-6,2,-13,2,-24,-2v-2,-11,10,-21,2,-28v-14,5,-48,0,-48,22v0,23,-11,14,-29,10v-7,-6,6,-19,-1,-24r-32,4v-19,-8,-15,-24,5,-28r33,-6v4,0,24,-23,11,-27v-26,0,-63,14,-74,-10v3,-1,9,-17,16,-10v15,-8,81,4,89,-30v8,-14,16,-34,24,-38v23,9,24,38,5,49v37,24,55,-38,72,-43v19,10,20,23,-1,45v2,8,23,1,29,4v3,3,6,6,10,11v-14,13,-20,12,-45,12v-17,0,-16,17,-19,29v18,-7,49,3,67,-2v4,0,8,4,12,11xm161,-104v-30,-1,-44,10,-44,37v14,1,24,0,40,-5v0,-1,3,-10,8,-26v0,-4,-1,-6,-4,-6",w:285},$:{d:"164,-257v29,4,1,42,-3,50v5,5,38,13,41,24v8,4,6,15,-2,21v-18,3,-36,-17,-49,-17v-17,1,-31,40,-28,48v5,4,8,8,9,10v13,1,35,37,28,44v-10,21,-36,20,-65,28v-10,10,-12,40,-17,51v-9,-3,-28,1,-18,-17v0,-13,5,-24,-1,-35v-18,1,-59,-10,-42,-29v21,0,56,16,55,-16v5,-4,9,-18,9,-26v-14,-15,-55,-41,-53,-65v2,-33,56,-19,98,-26v10,-14,31,-43,38,-45xm93,-152v11,-10,15,-15,14,-29v-17,-3,-37,1,-43,6v10,12,20,19,29,23xm111,-103v-8,1,-11,12,-10,22v10,0,28,2,27,-8v0,-4,-13,-15,-17,-14",w:225},"%":{d:"181,-96v24,-7,67,-13,104,1v14,18,21,19,22,44v-13,43,-99,61,-146,36v-9,-9,-22,-11,-32,-29v0,-27,24,-53,52,-52xm139,-185v-9,68,-138,73,-131,-5v0,-3,3,-9,9,-17v13,1,27,1,17,-16v5,-39,63,0,93,-6v36,1,80,-9,102,11v15,32,12,32,-8,56v-16,21,-103,78,-152,125r-14,28v-23,11,-25,-7,-29,-20v34,-71,133,-98,171,-162v-13,-12,-52,-5,-61,1v0,1,1,3,3,5xm38,-190v0,34,55,29,70,8v0,-14,-20,-11,-32,-14v-14,-3,-24,-9,-40,-10v1,0,5,11,2,16xm172,-53v12,27,90,18,102,-5v-18,-7,-32,-10,-40,-10v-29,3,-57,-4,-62,15",w:308},"&":{d:"145,-82v17,-8,47,-15,71,-26v13,2,25,12,9,23v-23,7,-40,16,-53,27r0,6v13,8,30,21,36,38v0,8,-4,12,-11,12v-19,0,-43,-39,-59,-44v-30,12,-65,29,-97,32v-32,3,-45,-41,-23,-63v21,-20,52,-26,70,-48v-4,-31,-12,-47,9,-73v13,-16,20,-29,23,-39v15,-15,32,-22,51,-22v30,9,62,64,32,96v-2,3,-47,42,-69,48v-15,8,-11,9,0,22v6,7,10,11,11,11xm114,-138v25,-13,62,-38,74,-62v0,-9,-10,-31,-20,-29v-28,7,-60,42,-60,75v0,10,2,15,6,16xm99,-91v-18,10,-54,18,-59,45v26,5,61,-12,77,-22v-1,-5,-13,-23,-18,-23",w:253},"'":{d:"36,-182v-36,7,-34,-61,-17,-80v15,1,21,19,21,20r-1,-1v0,0,-1,12,-5,35v1,5,3,17,2,26",w:63},"(":{d:"130,-306v13,2,23,43,-1,43v-49,43,-77,77,-90,148v5,49,27,67,64,101v4,14,5,6,2,19r-15,0v-35,-17,-79,-58,-79,-120v0,-58,66,-176,119,-191",w:120},")":{d:"108,-138v-2,73,-48,120,-98,153v-17,-5,-16,-20,-6,-31v52,-64,73,-62,74,-135v1,-42,-40,-98,-58,-128v0,-5,-1,-12,-2,-22v18,-18,25,0,42,27v25,39,50,66,48,136",w:120},"*":{d:"121,-271v15,-5,36,-8,40,9v-5,10,-31,19,-47,31v0,11,34,43,14,53v-18,8,-24,-24,-34,-20v-4,10,-4,19,-12,41v-25,7,-15,-30,-17,-47v-13,-1,-17,9,-46,30r-10,0v-20,-32,37,-43,54,-64v-10,-11,-36,-33,-16,-51v3,0,14,8,33,24v8,-10,26,-39,32,-42v14,7,15,23,9,36",w:177},"+":{d:"163,-64v-7,22,-65,2,-77,21v-2,10,-6,21,-11,35v-20,4,-21,-12,-19,-29v3,-23,-44,6,-39,-27v-8,-22,36,-8,49,-18v8,-13,6,-36,24,-40v19,-4,14,32,11,39v18,3,19,2,54,8v2,1,5,5,8,11",w:170},",":{d:"25,63v-26,21,-48,-2,-22,-24v14,-12,35,-40,35,-69v3,-2,3,-11,12,-9v35,17,5,88,-25,102",w:97},"-":{d:"57,-94v19,4,55,-5,54,17v-15,23,-54,20,-91,15v-4,2,-13,-10,-11,-16v-1,-22,28,-15,48,-16",w:124},".":{d:"40,-48v21,20,21,44,-4,44v-33,0,-26,-24,-10,-44r14,0",w:67},"/":{d:"21,20v-22,-45,21,-95,41,-126v38,-57,115,-158,193,-201v2,0,4,3,7,11v11,29,-15,34,-25,55v-81,56,-189,208,-197,261r-19,0",w:275},0:{d:"78,-237v70,-47,269,-41,270,59v0,34,-11,53,-29,76v-13,35,-30,32,-85,64v-6,2,-10,6,-7,8v-73,14,-98,38,-173,1v-7,-13,-52,-48,-46,-88v9,-57,27,-75,70,-120xm123,-38v100,0,202,-46,195,-153v-32,-55,-144,-73,-211,-35v-16,34,-68,54,-53,108v6,25,1,22,-3,39v6,24,41,41,72,41",w:353},1:{d:"39,-208v0,-14,6,-59,29,-39v3,4,6,13,10,24r-22,128r8,87v-4,6,-9,3,-16,2v-44,-38,-9,-137,-9,-202",w:93},2:{d:"88,-35v47,-10,119,-24,168,-9v0,12,-23,13,-35,16v1,1,3,1,5,1v-74,8,-118,23,-194,23v-14,0,-20,-13,-21,-28v55,-40,83,-61,123,-104v26,-13,65,-67,71,-102v-1,-9,-11,-16,-22,-16v-20,-1,-120,29,-156,49v-10,-2,-30,-20,-10,-28v50,-21,111,-51,178,-48v25,10,44,22,36,39v12,30,-19,64,-34,83v-39,48,-37,39,-115,109v0,5,-3,8,-8,11v4,3,8,4,14,4",w:265},3:{d:"188,-282v34,-10,74,25,47,51v-19,32,-55,50,-92,70v28,14,116,25,108,70v8,14,-49,40,-63,48v-29,9,-130,22,-168,42v-6,-5,-19,-7,-12,-22v56,-36,175,-21,210,-76v-9,-20,-88,-42,-97,-33v-20,-1,-41,2,-56,-7r5,-21v56,-25,103,-36,137,-78v1,-1,2,-5,4,-11v-15,-14,-56,7,-79,0v-10,9,-73,22,-92,31v-11,-4,-28,-23,-13,-30v50,-22,96,-26,154,-37v0,-1,8,3,7,3",w:260},4:{d:"79,-249v-7,17,-29,75,-33,96v0,6,3,8,8,8v43,-2,111,6,141,-6v17,-47,20,-100,63,-148v9,4,16,7,21,10v-17,31,-44,95,-51,141v7,4,24,-4,23,10v-1,16,-29,12,-31,23v-10,22,-9,69,-7,103v-3,2,-7,5,-10,9v-47,-11,-23,-74,-16,-114v0,-4,-2,-6,-7,-6v-65,2,-89,13,-162,4v-22,-22,-2,-53,5,-76v16,-15,17,-57,35,-70v6,-1,21,11,21,16",w:267},5:{d:"185,-272v30,7,45,-8,53,18v1,16,-17,18,-34,14v0,0,-95,-11,-129,1v-6,9,-24,33,-29,54v76,10,171,5,214,47v11,11,22,30,5,52v-14,12,-30,14,-34,27v-26,11,-141,63,-157,60v-16,-2,-25,-19,-4,-27v48,-18,128,-39,170,-86v4,-14,-65,-41,-85,-41r-92,0v-10,-4,-66,-1,-57,-23v0,-23,23,-51,35,-83v11,-28,133,-10,144,-13",w:284},6:{d:"70,-64v9,-51,63,-74,123,-71v43,2,109,3,111,41r-25,47v0,1,1,2,2,3v-5,0,-39,10,-41,20v-15,3,-22,4,-22,11v-39,1,-77,20,-119,13v-42,-7,-35,-9,-77,-46v-56,-118,94,-201,176,-229v7,0,21,8,20,15v-2,17,-23,15,-43,24v-69,31,-119,72,-134,145v-5,25,36,68,78,64v59,-6,128,-18,153,-61v-7,-14,-13,-9,-32,-21v-67,-15,-118,-5,-150,43r0,12v-13,4,-17,-3,-20,-10",w:310},7:{d:"37,-228v33,-14,173,-17,181,-19v28,-1,24,31,9,45v-17,15,-45,49,-59,69v-17,26,-55,67,-61,113v-10,13,-9,14,-14,20v-33,-13,-20,-25,-11,-53v16,-48,73,-115,109,-156v2,-7,5,-14,-10,-12v-26,4,-54,6,-76,13v-23,-5,-83,31,-94,-9v2,-8,18,-19,26,-11",w:245},8:{d:"57,-236v40,-50,166,-51,213,-10v22,28,10,63,-22,78r-35,17v8,5,54,24,53,44v-5,14,-4,33,-18,42v-13,13,-35,18,-44,34v-60,27,-190,49,-194,-42v7,-41,17,-54,59,-70r0,-4v-32,-9,-73,-62,-26,-85v4,0,8,-2,14,-4xm142,-160v24,-2,160,-31,99,-72v-28,-18,-108,-33,-146,-5v-16,12,-28,30,-33,59v24,12,37,20,80,18xm41,-62v30,65,189,6,199,-37v3,-14,-60,-30,-74,-30v-70,0,-118,10,-125,67",w:290},9:{d:"11,-192v15,-49,119,-61,161,-23v16,15,27,55,11,79v-20,62,-51,79,-96,118v-10,4,-45,27,-50,6v9,-15,66,-52,98,-99v-7,-7,-8,-3,-25,0v-49,-11,-96,-25,-99,-81xm145,-131v7,-5,13,-34,13,-41v-2,-51,-104,-38,-114,-6v-2,10,37,35,46,35v23,1,43,-1,55,12",w:198},":":{d:"39,-125v15,-8,40,-1,40,15v0,15,-6,22,-19,22v-13,0,-29,-21,-21,-37xm66,-17v-8,27,-51,19,-46,-8v-1,-6,8,-22,14,-20v29,0,30,6,32,28",w:95},";":{d:"56,-93v2,-30,37,-22,40,2v0,2,-1,7,-3,15v-13,8,-15,6,-27,4xm64,-44v11,-11,30,-4,32,14v-21,39,-63,71,-92,85v-5,0,-11,-2,-18,-8v11,-23,36,-36,50,-61v11,-7,19,-20,28,-30",w:107},"<":{d:"166,-202v12,0,29,15,24,29v0,4,-119,64,-120,73v15,21,89,64,91,86v2,29,-18,12,-30,15v-27,-29,-59,-54,-95,-75v-18,-10,-25,-13,-24,-41",w:176},"=":{d:"125,-121v18,7,55,-9,69,14v0,17,-45,26,-135,26v-18,0,-27,-7,-27,-21v-1,-37,60,-5,93,-19xm138,-71v20,0,48,-1,50,16v-13,24,-86,32,-131,29v-29,-2,-43,-10,-43,-24v-7,-23,36,-14,39,-17v27,6,57,-4,85,-4",w:196},">":{d:"4,-14v20,-48,77,-59,118,-94v-16,-19,-58,-52,-81,-75v-11,-7,-15,-38,-1,-40v33,16,83,71,121,105v26,23,-6,35,-41,53v-29,16,-56,28,-73,54v-21,15,-16,20,-34,15v-3,0,-9,-16,-9,-18",w:174},"?":{d:"105,-291v57,-13,107,-4,107,39v0,67,-136,85,-155,137v-1,6,10,23,-4,23v-23,1,-33,-35,-23,-57v31,-41,124,-60,149,-103v-8,-21,-72,-5,-88,-1v-23,6,-59,39,-71,8v0,0,-1,0,1,-17v10,-4,45,-20,84,-29xm80,-25v-6,4,-8,39,-24,22v-24,3,-22,-21,-13,-35v17,-7,29,5,37,13",w:216},"@":{d:"218,-207v23,8,42,14,47,37v44,68,-27,137,-87,85r1,0v0,2,-59,19,-61,17v-35,0,-42,-47,-17,-68r0,-4v-19,-1,-45,37,-49,40v-37,76,58,72,121,62v11,-2,34,-13,36,3v-14,31,-69,31,-114,33v-51,2,-99,-41,-80,-92v2,-30,22,-40,42,-63v35,-20,91,-53,161,-50xm217,-101v23,0,35,-19,35,-41v0,-43,-75,-41,-102,-19v36,3,55,16,62,41v-6,5,-6,19,5,19xm127,-110v8,5,51,-15,28,-16v-4,0,-25,4,-28,16",w:291},A:{d:"97,-81v-23,-10,-39,38,-52,60v-8,6,-8,6,-22,18v-22,-7,-23,-37,-4,-49v7,-8,11,-15,15,-23r-1,1v-14,-26,23,-29,31,-40v1,-1,15,-29,26,-36v17,-31,39,-58,54,-92v16,-20,20,-51,41,-66v29,5,34,62,45,92v9,64,21,103,49,155v-3,25,-44,11,-54,0v-34,-12,-97,-29,-128,-20xm107,-118v20,6,80,10,111,17v6,-7,-4,-15,-7,-24v-11,-28,-9,-92,-30,-117v-9,9,-19,44,-34,55v-9,23,-27,40,-40,69",w:294},B:{d:"256,-179v41,10,115,34,91,91v-6,3,-14,12,-19,20v-37,19,-50,34,-63,25v-9,10,-12,11,-34,13r3,-3v-4,-4,-12,-4,-18,0v0,0,2,2,5,4v-21,14,-26,6,-44,15v-4,0,-7,-2,-8,-5v-6,11,-20,-5,-18,11v-36,4,-91,35,-114,4v-7,-62,-10,-138,4,-199v-1,-19,-37,2,-37,-27v0,-8,2,-13,6,-15v68,-31,231,-92,311,-39v8,12,12,20,12,25v-8,42,-32,49,-77,80xm79,-160v72,-17,135,-39,184,-70v20,-13,31,-23,31,-27v1,-6,-30,-13,-38,-12v-54,0,-116,13,-186,41v11,21,1,48,9,68xm262,-43v0,-4,3,-6,-4,-5v0,1,1,2,4,5xm211,-140v-34,7,-94,24,-139,15v-6,20,-4,56,-4,82v0,29,43,1,56,2v48,-11,108,-25,154,-48v20,-10,32,-17,32,-25v0,-18,-33,-26,-99,-26xm195,-20v6,1,6,-2,5,-7v-3,2,-7,2,-5,7",w:364},C:{d:"51,-114v-12,75,96,76,166,71r145,-10v9,2,9,5,9,18v-37,18,-85,28,-109,22v-18,10,-47,10,-71,10v-29,0,-68,1,-105,-11v-6,-1,-10,-3,-10,-8v-33,-13,-48,-33,-66,-59v-19,-114,146,-150,224,-177v35,0,88,-31,99,7v-1,29,-49,14,-76,28v-55,8,-115,35,-175,71v-13,8,-23,21,-31,38",w:376},D:{d:"312,-78v-2,1,-3,7,-10,5v6,-3,10,-4,10,-5xm4,-252v2,-27,83,-38,106,-39v130,-7,267,1,291,109v0,0,-2,8,-3,25v-5,9,-4,28,-23,34v-4,4,-2,5,-7,0v-3,3,-15,7,-5,10v0,0,-10,14,-13,2v-11,1,-8,5,-20,14v1,2,7,3,9,1v-4,13,-22,13,-11,4v0,-3,1,-6,-3,-5v-40,29,-103,38,-141,65v10,6,22,-7,34,-3v-41,20,-127,44,-171,46v-21,1,-47,-33,-11,-39v15,-2,43,-6,56,-11v-16,-101,-5,-130,9,-207v2,0,4,-1,6,-3v-16,-17,-91,38,-103,-3xm297,-69v-7,3,-17,8,-25,7v1,1,3,2,5,2v-4,2,-11,5,-23,9v4,-11,30,-21,43,-18xm240,-51v10,0,12,2,0,6r0,-6xm220,-36v-1,-3,4,-6,6,-3v0,1,-2,1,-6,3xm125,-48v16,6,137,-46,155,-53v29,-18,101,-44,82,-93v-21,-53,-84,-61,-168,-67v-20,7,-50,3,-77,8v33,54,-12,132,8,205xm159,-22v-4,-1,-15,-5,-15,2v7,-1,12,-2,15,-2",w:381},E:{d:"45,-219v-19,-36,34,-41,63,-36v44,-10,133,-8,194,-15v3,2,38,11,52,15v-73,19,-171,21,-246,38v-9,11,-16,32,-20,61v35,11,133,-6,183,3v1,6,2,7,3,14v-46,24,-118,16,-193,27v-15,13,-22,52,-22,66v60,1,121,-20,188,-20v22,10,53,-7,74,5v16,29,-23,26,-43,32v-73,4,-139,13,-216,27r-52,-10v-4,-22,23,-69,26,-98v-3,0,-10,-15,-12,-24v20,-12,34,-23,35,-67v2,-1,5,-5,5,-7v0,-4,-14,-11,-19,-11",w:353},F:{d:"270,-258v13,2,59,6,48,34v-78,-3,-143,1,-212,22v-10,16,-21,43,-24,69r145,-9v8,3,29,-3,16,21v-14,-1,-59,13,-60,7v-12,13,-67,18,-108,21v-2,1,-4,3,-7,6v-2,23,-8,43,-7,69v1,28,-30,11,-40,5r10,-80r-26,-14v5,-10,10,-33,28,-25v21,-3,15,-46,26,-59v-1,-3,-32,-13,-28,-24v2,-22,45,-16,59,-30v47,4,99,-14,151,-9v5,-3,25,-3,29,-4",w:236},G:{d:"311,-168v53,0,94,57,74,110v-31,37,-71,34,-136,52v-13,-7,-41,10,-57,7v-73,-1,-122,-17,-162,-59v-49,-51,-24,-80,5,-130v35,-61,138,-93,214,-106v16,4,42,-1,40,21v-5,40,-39,2,-73,21v-76,19,-162,65,-177,142v28,103,237,76,312,29v2,-3,3,-7,3,-13v-10,-35,-37,-43,-87,-45v-16,-13,-53,-9,-78,1v-4,-3,-5,-7,-5,-11v17,-29,73,-17,108,-24v12,4,18,5,19,5",w:391},H:{d:"300,-268v18,12,19,32,4,51v-35,44,-34,140,-46,217v-1,5,-5,13,-11,12v-6,1,-19,-14,-18,-27r7,-106v-28,7,-76,22,-116,14v-18,2,-36,6,-55,3v-43,-8,-14,53,-33,75v-29,1,-26,-67,-21,-97v5,-31,28,-73,43,-98v2,2,7,3,14,3v13,33,-11,48,-13,78v61,4,118,2,176,2v8,0,13,-6,15,-20v4,-47,21,-87,54,-107",w:288},I:{d:"63,-266v34,10,-4,105,-8,128r-24,126v-2,2,-3,1,-9,6v-12,-10,-12,-15,-12,-47v0,-93,9,-156,28,-188v10,-17,19,-25,25,-25",w:79},J:{d:"235,-291v26,11,31,104,31,142v0,37,-2,95,-32,126v-33,34,-121,26,-167,1v-18,-11,-54,-29,-59,-59v0,-3,5,-15,16,-14v31,36,90,57,162,51v63,-30,56,-148,32,-226v-1,-16,11,-13,17,-21",w:282},K:{d:"212,-219v17,-5,80,-60,80,-19v0,9,-2,14,-5,16r-132,78v-34,23,-54,32,-21,50v39,21,74,23,124,41v5,2,7,5,7,9v-4,24,-55,15,-79,8v-67,-19,-98,-36,-116,-83v9,-24,38,-35,66,-61v7,-4,49,-30,76,-39xm47,-194v11,-20,11,-45,31,-55v2,2,4,3,6,0v29,39,-21,96,-18,128v-17,24,-15,62,-29,113v-4,3,-10,7,-19,11v-12,-13,-10,-28,-8,-53v3,-31,17,-79,37,-144",w:270},L:{d:"84,-43v58,0,179,-27,242,-4v3,17,-29,24,-40,26v-85,-4,-202,46,-268,3v-24,-16,-2,-33,-4,-57v26,-76,38,-108,86,-191v14,-7,26,-50,45,-32v6,22,5,31,-12,46v-20,39,-50,82,-67,142v-7,6,-19,46,-19,54v0,9,12,13,37,13",w:331},M:{d:"174,-236v-1,52,-11,92,-7,143v10,5,15,-12,22,-18v42,-55,90,-130,136,-174r15,-18v42,2,32,53,11,80v-12,58,-54,143,-34,210v0,3,-3,12,-9,10v-31,-5,-32,-57,-27,-92v4,-27,12,-58,25,-93v-5,-10,5,-19,6,-30v-46,44,-66,110,-129,172v-11,10,-18,15,-22,15v-34,6,-28,-103,-28,-152v-28,22,-65,119,-96,170v-9,15,-34,3,-31,-19v30,-64,91,-177,139,-229v12,-1,29,13,29,25",w:343},N:{d:"248,-20v-3,17,-37,18,-43,3v-24,-35,-53,-145,-80,-203v-32,40,-55,120,-92,174v-13,3,-26,-13,-27,-22r87,-171v4,-13,20,-57,42,-32v42,48,46,139,82,198v29,-45,46,-88,65,-153v12,-19,23,-42,38,-60v27,-1,14,18,4,44v-6,46,-32,68,-37,121v-15,29,-33,69,-39,101",w:307},O:{d:"240,-268v85,1,163,29,150,125v13,7,-12,18,-5,26v-23,63,-133,112,-228,124v-80,-16,-171,-56,-148,-153v11,-47,20,-43,53,-83v17,-9,39,-22,73,-29v45,-10,81,-10,105,-10xm363,-156v16,-51,-62,-85,-111,-79v-25,-11,-50,8,-81,0v-15,10,-70,16,-85,31v6,20,-27,24,-39,45v-42,75,40,128,115,128v56,0,209,-71,201,-125",w:383},P:{d:"70,-225v-7,-12,-36,16,-49,19v-4,0,-9,-5,-14,-17v21,-47,114,-55,172,-59v41,-3,132,33,99,87v-21,34,-72,59,-144,80v-2,16,-79,3,-74,46v3,25,-5,47,-10,68v-22,-1,-23,-29,-22,-56v2,-25,-20,-32,-8,-50v21,-5,10,-35,25,-57v6,-28,14,-48,25,-61xm71,-229v47,14,-2,50,-1,99v41,-3,113,-37,173,-76v5,-9,8,-14,8,-15v-28,-47,-125,-29,-180,-8",w:252},Q:{d:"374,-217v20,59,-11,127,-48,156r30,38v-1,6,-8,16,-14,9v-3,0,-19,-9,-47,-26v-72,35,-173,75,-236,12v-70,-40,-67,-213,26,-217r8,5v24,-20,72,-48,112,-38v21,-4,22,-1,50,-2v66,-2,94,20,119,63xm296,-88v13,5,61,-49,63,-84v4,-62,-54,-78,-119,-76v-14,-6,-49,5,-71,3v-42,16,-89,41,-93,94v-9,11,1,25,-7,38v-12,-19,-7,-67,-1,-88v-56,30,-37,137,19,155v27,17,92,19,119,0v12,-2,29,-9,52,-20v2,-2,3,-3,3,-6v-11,-12,-46,-27,-54,-56v0,-13,3,-19,9,-19v18,1,60,52,80,59",w:379},R:{d:"100,-275v96,-23,196,-10,208,78v-3,18,-17,52,-49,62v-14,20,-54,23,-79,40v-2,0,-14,2,-36,6v-40,8,-30,14,-3,33v37,27,52,30,118,55v16,6,31,23,12,27v-58,-2,-104,-29,-143,-61v-14,-3,-16,-15,-39,-27v-23,-19,-28,-12,-15,-38v63,-19,111,-15,163,-53v27,-20,43,-36,43,-49v0,-64,-120,-62,-173,-38v-9,4,-38,9,-40,18v-10,32,-16,70,-13,116v-10,21,-8,47,-6,75v2,31,-9,29,-27,22v-9,-55,5,-140,15,-190v-8,-6,-24,10,-24,-11v0,-34,16,-34,42,-55v2,-1,17,-4,46,-10",w:297},S:{d:"13,-3v-7,-3,-22,-18,-5,-22v68,-15,119,-32,154,-45v51,-19,39,-34,3,-53v-46,-25,-82,-30,-121,-64v-33,-29,-50,-35,-25,-58v37,-20,119,-29,181,-29v29,0,44,6,44,18v-9,26,-62,6,-104,14v-17,2,-72,6,-92,16v37,53,132,58,180,111v8,9,11,20,11,30v-4,17,-23,35,-42,34v-21,16,-17,1,-49,17v-14,7,-41,9,-56,20v-25,-3,-49,10,-79,11",w:234},T:{d:"141,-3v-36,-6,1,-49,-3,-79v10,-19,6,-35,15,-64r26,-85v-51,-9,-100,10,-141,14v-16,2,-30,-26,-11,-32v26,-8,143,-8,179,-19r12,6v67,-2,142,-1,200,-1v8,0,14,3,19,10v-18,16,-74,3,-103,14v-48,-4,-60,4,-113,7v-42,22,-36,130,-58,187v1,12,-9,44,-22,42",w:277},U:{d:"365,-262v13,56,-22,104,-36,141v-19,22,-30,38,-57,56v-4,18,-60,35,-78,50v-53,28,-142,0,-161,-34v-31,-56,-37,-108,-11,-164v17,-33,29,-50,48,-29v-2,2,-3,7,-4,13v-44,36,-38,149,7,174v30,26,55,19,102,4v56,-17,66,-34,120,-76v12,-24,56,-68,46,-122r0,-16v0,1,-1,3,-1,6v4,-13,11,-10,25,-3",w:368},V:{d:"246,-258v21,-22,31,-26,44,-8v1,1,-12,22,-28,35v-15,25,-41,38,-56,69v-13,15,-20,31,-28,57v-15,13,-11,29,-27,72v3,21,-5,24,-27,27v-33,-45,-54,-118,-84,-167v-5,-26,-18,-50,-25,-76v-3,-12,24,-8,29,-5v8,13,18,52,26,70r52,115v9,-2,4,-9,10,-21r25,-47v25,-44,46,-76,89,-121",w:234},W:{d:"31,-213v16,46,17,106,41,151v31,-35,49,-89,76,-127v30,-15,39,27,52,56v10,22,21,48,35,67v2,0,4,-1,5,-3v16,-28,50,-76,79,-121v14,-21,40,-63,64,-83r5,8v-30,58,-76,110,-97,173v-18,28,-25,37,-33,63v-11,1,-16,25,-30,15v-21,-31,-44,-89,-62,-131v0,-2,-1,-3,-5,-5v-17,11,-16,36,-31,50v-20,33,-20,84,-68,94v-24,-19,-23,-81,-39,-111v-1,-15,-29,-94,-10,-108v9,2,12,5,18,12",w:331},X:{d:"143,-183v43,-25,69,-36,126,-62v22,-10,86,-10,56,21v-51,3,-158,61,-154,64v10,15,41,30,50,52v27,17,46,60,70,82v9,14,-6,30,-24,20v-35,-43,-75,-100,-116,-132v-48,13,-100,47,-118,94v-1,49,-26,34,-27,4v-1,-26,13,-27,17,-48v22,-27,68,-55,90,-77v-9,-12,-60,-39,-79,-57v-6,-10,-6,-25,12,-25",w:312},Y:{d:"216,-240v19,-14,42,10,22,26v-54,66,-121,109,-156,197v-8,21,-11,15,-30,4v3,-37,27,-61,33,-76v12,-12,15,-19,32,-42v-8,-6,-40,5,-45,5v-48,-6,-69,-65,-56,-113v14,0,13,-1,24,7v2,33,12,75,42,73v36,-2,102,-57,134,-81",w:189},Z:{d:"60,-255v66,12,200,-34,240,21v-13,42,-63,62,-98,89v-19,15,-47,33,-82,55v-25,16,-47,32,-66,47v58,24,129,-6,208,-6v23,0,36,12,13,19v-33,2,-53,5,-86,10v-32,18,-88,15,-135,15v-9,-1,-55,-1,-48,-29v1,-24,30,-24,40,-41v64,-50,151,-86,208,-147v-38,-17,-155,12,-198,-4v0,0,-11,-33,4,-29",w:310},"[":{d:"72,-258r-15,250v30,4,55,-3,80,-6v7,-1,8,17,9,23v-28,15,-73,23,-121,21v-7,0,-10,-6,-10,-17v0,-60,25,-193,22,-288v0,-16,13,-20,33,-19v9,-3,34,-12,51,-12v16,0,15,16,19,29v-16,7,-48,10,-68,19",w:151},"\\":{d:"21,38v-20,-21,9,-72,13,-90v44,-78,113,-189,200,-253v2,0,5,4,7,12v11,31,-13,36,-24,58v-74,61,-174,219,-180,273r-16,0",w:257},"]":{d:"133,-258v-23,-13,-84,6,-85,-32v0,-10,5,-15,14,-15v0,0,30,2,90,7v10,1,15,13,15,36v2,7,-8,59,-13,112r-11,125v-9,48,9,90,-59,71v-20,-4,-39,-1,-59,-4v-5,-10,-25,-12,-14,-30v8,-3,61,-13,78,-8v14,1,8,-7,10,-17v15,-69,21,-166,34,-245",w:171},"^":{d:"68,-306v20,15,47,36,58,60v-1,4,0,7,-9,7v-26,0,-47,-38,-49,-32v-15,9,-41,50,-54,30v-2,-31,17,-23,33,-51v8,-9,15,-14,21,-14",w:135},_:{d:"11,15v-8,33,18,45,50,34r205,2r197,-5v11,-5,14,-9,7,-28v-95,-21,-258,-10,-376,-10v-25,0,-72,-3,-83,7",w:485},"`":{d:"75,-264v16,8,56,14,39,43v-30,-8,-65,-23,-105,-44v-1,-3,-3,-28,5,-25v16,5,44,17,61,26",w:129},a:{d:"124,-56v10,4,59,41,65,50v1,7,-6,17,-12,17r-60,-30v-22,2,-42,21,-65,19v-33,4,-68,-67,-15,-81v41,-27,96,-39,110,9v0,6,-4,12,-11,16v-33,-25,-67,-5,-88,12v10,16,61,-18,76,-12",w:196},b:{d:"80,-140v69,1,123,0,134,52v5,26,-71,71,-97,70v-11,11,-88,22,-94,22v-11,-3,-26,-18,-6,-24v19,-5,-2,-19,-1,-35v1,-18,11,-36,-5,-47v-6,-17,-6,-21,14,-32v6,-45,18,-89,28,-124v2,-7,8,-12,17,-15v5,3,10,11,16,28v-12,27,-13,63,-23,96v0,6,6,9,17,9xm87,-107v-40,-9,-31,31,-39,54v8,15,0,25,12,22v30,-8,60,-18,88,-32v39,-18,49,-33,-1,-42v-20,-4,-45,-7,-60,-2",w:217},c:{d:"128,-123v29,-7,37,29,12,33v-27,-4,-40,6,-79,25v-8,4,-13,11,-16,22v30,32,91,3,134,11v5,13,-8,26,-22,19v-51,25,-139,28,-150,-30v6,-50,69,-82,121,-80",w:194},d:{d:"224,-201v0,-35,-17,-111,24,-94v7,86,-2,119,0,197v-4,2,-8,21,-18,16v-62,-7,-154,-8,-185,29v6,17,28,26,51,26v16,0,100,-15,132,-18v7,5,-6,20,-10,22v-24,8,-122,42,-163,25v-32,-5,-62,-53,-36,-80v35,-37,118,-46,198,-43v1,-22,7,-49,7,-80",w:265},e:{d:"4,-57v0,-58,51,-71,110,-74v33,-1,45,16,59,35v1,14,2,39,-7,42v-24,-2,-73,13,-99,11v-2,2,-2,3,-2,3v0,3,12,8,37,15v21,0,69,9,31,22v-9,14,-34,6,-56,6v-27,-5,-73,-28,-73,-60xm123,-102v-22,2,-68,5,-65,26v24,-2,66,5,79,-6v-5,-13,-1,-13,-14,-20",w:182},f:{d:"6,-59v6,-29,53,-4,53,-43v0,-64,29,-118,84,-150v45,-25,167,-24,155,51v-1,2,-7,6,0,6r-10,2v-45,-58,-165,-39,-186,39v-7,26,-11,42,-9,62v44,8,95,-21,135,-7v-12,25,-39,21,-76,30v-19,5,-18,7,-54,19v-2,8,15,32,17,35v-6,25,-26,26,-40,-5r-15,-24v-41,10,-44,12,-54,-15",w:234},g:{d:"132,-97v30,27,21,75,30,117v-12,31,-11,66,-36,103v-32,46,-105,83,-167,39v-31,-21,-49,-29,-51,-75v-2,-37,77,-50,121,-57v37,-6,68,-10,95,-11v7,-6,3,-32,4,-46v0,0,-1,1,-1,2v0,-18,-5,-31,-14,-45v-44,5,-79,20,-94,-18v3,-54,73,-54,125,-50v12,7,12,13,4,25v-30,-11,-76,8,-90,20v23,3,50,-16,74,-4xm-34,121v60,53,168,1,159,-86v-47,-7,-93,24,-142,30v-12,7,-45,19,-42,29v0,10,8,19,25,27",w:188},h:{d:"100,-310v11,-2,10,19,11,20v-11,52,-40,133,-53,189v-6,30,-9,37,-9,47v27,0,113,-34,143,-34v42,0,31,47,39,79v0,4,-5,17,-16,16v4,2,11,3,4,6v-24,-1,-28,-34,-25,-64v-1,-1,-2,-3,-5,-5v-51,0,-110,38,-162,51v-9,1,-15,-15,-16,-23v17,-89,39,-141,71,-264v0,-9,6,-19,18,-18",w:251},i:{d:"62,-209v7,18,9,23,-5,38v-23,-6,-21,-18,-11,-36v2,0,8,-1,16,-2xm34,-7v-18,-21,-8,-73,-1,-106v7,-10,20,-8,23,6v-1,36,7,72,-2,104v-8,2,-8,0,-20,-4",w:80},j:{d:"88,-191v5,28,-18,40,-28,21v0,-20,12,-29,28,-21xm82,-99v28,-1,16,35,16,61v0,60,-19,150,-35,202v-12,8,-19,31,-35,16v-32,-7,-43,-19,-56,-44r2,-17v11,4,49,45,61,18v10,-55,27,-107,30,-171v0,-16,0,-59,17,-65",w:120},k:{d:"59,-66v33,26,114,37,155,62v8,-4,22,-2,19,-17v0,-4,-12,-11,-30,-24v-36,-25,-54,-22,-99,-33v14,-21,119,-13,103,-63r-16,-7r-123,47r25,-93v-3,-15,16,-49,18,-81v1,-15,-21,-14,-25,-3v-31,82,-49,168,-75,257v2,2,22,30,27,10v2,-5,4,-9,9,-11v4,-16,4,-15,12,-44",w:236},l:{d:"66,-300v21,-6,37,23,30,55v-10,51,-28,135,-28,208v0,11,6,36,-13,37v-29,-5,-30,-48,-25,-83r28,-177v-6,-17,1,-29,8,-40",w:102},m:{d:"348,-59v-2,21,0,57,3,73v-17,3,-30,-1,-32,-16v-8,-7,-5,-44,-13,-70v-35,3,-82,49,-111,70v-12,8,-40,4,-39,-15r2,-56v-1,-13,4,-28,-8,-29v-35,8,-79,72,-115,87v-6,2,-20,-18,-21,-22v1,-20,14,-105,39,-64r8,15v17,-14,72,-56,93,-54v27,3,49,40,43,80v24,-2,66,-55,124,-53v11,14,28,23,27,54",w:368},n:{d:"121,-136v37,6,62,54,62,111v0,32,-16,25,-31,17v-18,-30,-5,-45,-22,-85v-37,-13,-71,55,-92,65v-20,-3,-39,-39,-21,-62v2,-12,3,-15,11,-30v12,-8,20,11,29,12",w:194},o:{d:"108,-139v52,-24,104,18,104,63v0,59,-66,67,-114,83v-52,-2,-115,-50,-80,-105v23,-18,52,-35,90,-41xm45,-60v16,54,125,16,131,-23v-12,-59,-129,-8,-131,23",w:217},p:{d:"82,14v-10,12,-8,117,-24,142v-15,2,-19,0,-29,-13v0,-76,9,-113,22,-192v14,-27,35,-6,37,13v0,8,-3,21,-7,38v2,2,3,2,4,2v26,-9,116,-33,126,-72v-7,-17,-24,-33,-49,-31v-40,3,-116,13,-116,47v-5,7,-2,17,-16,20v-17,-12,-18,-20,-12,-38v8,-25,74,-61,110,-59v55,-15,113,15,118,70v-15,52,-84,79,-146,83v-5,0,-11,-4,-18,-10",w:251},q:{d:"144,-147v27,-8,89,-3,97,31v-9,29,-42,-4,-73,1v-32,6,-118,20,-111,49v0,7,13,13,21,13v21,0,78,-24,104,-34v2,0,9,8,22,21v1,1,1,2,1,5v-27,90,-22,70,-43,203v11,15,-15,54,-33,33v-6,-8,-10,-20,-3,-28v1,-72,5,-114,15,-172v-35,3,-35,10,-59,8v-41,-4,-98,-41,-56,-85v33,-34,59,-27,118,-45",w:248},r:{d:"242,-117v2,22,5,10,-14,23v-73,-7,-166,-23,-174,56v-8,6,-3,20,-8,36v-29,10,-40,-9,-33,-46v6,-31,7,-69,32,-55v58,-37,66,-42,175,-19v3,5,15,4,22,5",w:229},s:{d:"154,-151v19,1,27,24,13,32v-4,1,-22,4,-53,7v-16,8,-22,-2,-39,9v23,21,89,16,96,62v-13,24,-85,35,-124,42v-9,-3,-18,-3,-27,0v-6,-4,-21,-16,-8,-25v30,-6,83,-13,102,-24v-17,-16,-80,-33,-97,-48v-3,-2,-4,-7,-4,-15v-6,-6,3,-13,15,-18v22,-9,94,-23,126,-22",w:188},t:{d:"85,-150v10,-41,35,-126,65,-134v4,1,24,19,11,36v-17,22,-29,57,-36,104v26,8,50,-7,73,5v14,0,22,3,22,9v-1,19,-44,18,-57,23v-10,1,-46,0,-54,10v-10,24,-4,67,-20,98v-21,-3,-26,1,-26,-20v0,-9,2,-36,8,-81v-15,-13,-81,9,-77,-27v4,-38,71,6,91,-23",w:194},u:{d:"207,-136v-1,-2,11,-14,14,-13v6,0,10,7,10,22v-3,40,-23,56,-40,82v-13,19,-62,43,-93,43v-67,-2,-111,-75,-71,-133v26,-3,21,29,19,49v-1,27,26,44,57,42v41,-2,93,-55,104,-92",w:242},v:{d:"24,-127r52,71v42,-16,70,-54,124,-65v5,4,8,7,8,11v-8,19,-4,8,-33,32v0,1,-1,3,-1,5v-61,45,-93,68,-97,68v-40,-15,-50,-72,-68,-100v6,-14,10,-22,15,-22",w:214},w:{d:"15,-139v38,-2,27,57,45,86v30,2,67,-66,101,-78v26,6,36,69,60,78v47,-35,51,-54,119,-104v3,0,7,-2,15,-4v19,23,-9,28,-21,49v-33,28,-68,90,-107,109v-10,6,-52,-47,-72,-71v-20,17,-85,74,-97,73v-38,7,-41,-98,-52,-122v0,-1,3,-7,9,-16",w:325},x:{d:"95,-124v22,-13,78,-32,99,-31v16,0,23,6,23,18v0,22,-17,11,-49,21v-3,0,-45,20,-42,24v0,1,2,4,8,10v20,24,49,41,44,80v-35,3,-27,-9,-60,-44v-40,-43,-37,-26,-79,9v-1,1,-2,3,-3,8v-12,8,-28,10,-27,-11v-6,-8,45,-65,48,-65v-17,-21,-61,-52,-24,-68v9,0,48,37,62,49",w:223},y:{d:"44,-65v22,33,70,4,99,-8v5,-4,28,-15,41,-31r17,0v25,47,-26,70,-40,114v-5,4,-9,8,-10,21v-16,12,-11,33,-27,51v-5,18,-12,43,-23,71v-1,-1,-2,34,-18,29v-12,1,-22,-12,-22,-23v20,-70,24,-65,68,-177v-47,16,-111,8,-116,-39v-11,-13,-7,-62,8,-62v18,0,22,26,23,54",w:216},z:{d:"189,-43v9,-1,46,-6,41,12v0,7,-5,13,-15,14v-45,6,-148,24,-181,13v0,-3,-5,-8,-14,-15v5,-44,66,-46,90,-85v-15,-18,-84,21,-84,-14v0,-10,5,-17,14,-18v33,-3,79,-13,109,-3v4,-2,14,11,12,15v0,23,-26,51,-78,84v28,10,73,-3,106,-3",w:244},"{":{d:"94,-303v27,-9,90,-14,79,26v-20,17,-55,-5,-87,13v-4,1,-6,4,-6,8v33,42,31,44,7,85v-6,10,-13,16,-13,13v5,6,17,17,15,31r-33,78v7,35,28,49,57,63r49,0v7,42,-51,41,-86,20v-43,-13,-51,-51,-56,-89v-2,-25,25,-54,27,-71v-3,-4,-46,-5,-41,-21v2,-10,-3,-29,11,-25v2,0,51,-17,52,-38v4,-3,-25,-23,-25,-49v0,-41,8,-30,50,-44",w:179},"|":{d:"30,-308v26,5,14,50,15,80v5,78,-8,153,-3,225v-2,15,-1,31,-11,36v-8,-3,-25,-22,-25,-32r9,-183v0,-40,0,-78,1,-112v0,-4,9,-15,14,-14",w:63},"}":{d:"47,-298v34,-17,118,-18,112,36v6,25,-76,98,-69,103v4,16,39,7,44,28v7,34,-34,17,-37,39v8,29,49,83,23,123v-15,23,-43,26,-73,46v-34,8,-43,11,-49,-17v1,-15,30,-15,33,-20v24,-12,70,-27,55,-61v-14,-33,-37,-68,-19,-103v-46,-50,46,-100,60,-141v-10,-16,-68,6,-77,-12",w:143},"~":{d:"7,-254v2,-6,59,-50,67,-46v11,-1,35,19,46,26v5,0,27,-10,66,-31v21,8,-1,25,-7,38v-27,21,-48,31,-65,31v-24,-11,-37,-39,-65,-9v-7,7,-26,36,-42,11v3,-5,-3,-17,0,-20",w:199},"Ä":{d:"161,-217v20,53,23,124,54,170v-2,20,-34,9,-42,0v-27,-12,-78,-18,-101,-18v-26,6,-29,51,-54,63v-18,-4,-19,-30,-3,-38v5,-9,15,-16,8,-29v1,-12,23,-9,26,-19v6,-10,11,-20,20,-27r70,-121v12,-4,16,4,22,19xm82,-91v17,3,62,7,86,13v-13,-33,-13,-80,-29,-109v-15,30,-38,63,-57,96xm187,-259v0,8,-4,13,-12,13v-18,0,-21,-20,-16,-34v18,-1,28,2,28,21xm90,-284v7,3,28,11,28,18v0,9,-9,18,-18,17v-17,0,-25,-24,-10,-35"},"Å":{d:"161,-217v20,53,23,124,54,170v-2,20,-34,9,-42,0v-27,-12,-78,-18,-101,-18v-26,6,-29,51,-54,63v-18,-4,-19,-30,-3,-38v5,-9,15,-16,8,-29v1,-12,23,-9,26,-19v6,-10,11,-20,20,-27r70,-121v12,-4,16,4,22,19xm82,-91v17,3,62,7,86,13v-13,-33,-13,-80,-29,-109v-15,30,-38,63,-57,96xm112,-239v-31,-17,-9,-61,29,-56v12,2,22,3,33,12v24,39,-30,62,-62,44xm119,-262v2,14,41,8,41,-4v0,-4,-8,-6,-24,-9v-10,-2,-17,10,-17,13"},"Ç":{d:"48,-108v-12,70,90,71,159,67r138,-9v9,-1,7,9,7,17v-37,16,-80,27,-103,21v-14,9,-40,3,-67,9v-30,0,-64,1,-100,-10v-6,-1,-10,-4,-10,-8v-32,-12,-46,-31,-63,-56v-16,-61,47,-103,83,-121v82,-42,118,-45,200,-60v21,-4,36,34,11,37v-90,11,-148,31,-225,77v-12,8,-23,20,-30,36xm172,18v29,4,47,14,53,35v-2,7,-14,31,-27,31v-28,7,-55,9,-84,14v-18,-5,-13,-32,7,-32v21,0,55,-5,69,-13v-16,-14,-63,10,-50,-35v9,-10,1,-27,23,-29v7,8,11,16,9,29",w:331},"É":{d:"49,-160v1,-4,-10,-9,-15,-8v-15,-35,32,-30,57,-31r142,-8v2,1,30,7,40,10v-52,16,-133,17,-190,30v-7,9,-12,24,-15,47v26,10,102,-6,141,3v1,3,1,6,2,10v-36,18,-92,12,-149,21v-11,9,-16,41,-16,51v55,-1,111,-21,168,-13v15,-8,48,1,31,18v-53,16,-130,13,-198,29r-39,-8v-4,-19,17,-53,20,-76v-1,0,-7,-11,-9,-18v18,-7,22,-28,30,-57xm133,-248v27,-11,48,-32,59,-14v3,11,-79,52,-88,53v-14,1,-16,-11,-12,-21v10,-4,23,-11,41,-18",w:252},"Ñ":{d:"224,-182v1,-17,15,-24,22,-38v20,0,13,10,3,33v-3,36,-25,52,-28,94v-10,24,-30,55,-29,82r-19,7v-32,-8,-36,-70,-58,-111v-2,-23,-7,-27,-19,-54v-28,36,-41,93,-71,133v-9,5,-20,-9,-20,-17r73,-149v9,-24,31,-5,36,7v19,41,31,98,53,139v22,-35,34,-69,50,-118v2,-3,3,-3,7,-8xm203,-257v22,-8,41,-24,65,-26v3,11,-8,9,-7,21v-26,20,-46,31,-59,31v-2,3,-49,-27,-49,-29v-11,0,-32,31,-46,32v-11,-2,-12,-21,-4,-23v4,-6,28,-30,48,-34v17,-4,43,28,52,28",w:219},"Ö":{d:"62,-184v78,-31,249,-50,238,74v-6,65,-102,105,-179,115v-77,-7,-152,-71,-101,-149v2,-5,24,-33,42,-40xm279,-120v14,-38,-47,-64,-85,-61v-20,-9,-41,7,-62,0v-11,7,-54,12,-66,24v0,20,-51,35,-38,66v-1,43,50,67,96,67v44,0,162,-55,155,-96xm197,-229v0,8,-4,13,-12,13v-17,0,-19,-19,-16,-34v18,-1,29,1,28,21xm101,-254v7,3,28,9,27,18v1,8,-8,17,-17,17v-18,0,-26,-24,-10,-35",w:273},"Ü":{d:"281,-202v6,67,-30,121,-71,152v-3,14,-47,26,-60,39v-41,20,-110,1,-125,-26v-24,-44,-28,-84,-8,-127v12,-26,23,-38,37,-22v-2,2,-3,5,-3,10v-34,26,-29,116,5,134v22,32,86,-1,109,-8v38,-28,104,-64,97,-149v2,-10,7,-8,19,-3xm197,-227v0,8,-4,13,-12,13v-18,0,-21,-20,-16,-34v18,-1,28,2,28,21xm101,-252v7,3,27,10,27,18v0,8,-9,18,-18,17v-18,-1,-24,-25,-9,-35",w:262},"á":{d:"118,-53v10,4,55,41,62,47v0,7,-5,16,-12,16r-57,-28v-20,3,-40,19,-61,18v-10,2,-43,-17,-42,-36v0,-14,7,-40,27,-41v39,-26,92,-36,104,9v0,6,-2,11,-9,15v-32,-24,-64,-6,-84,11v8,15,58,-17,72,-11xm32,-117v24,-3,85,-55,101,-32v3,11,-80,53,-89,53v-13,2,-14,-10,-12,-21",w:173},"à":{d:"118,-53v10,4,55,41,62,47v0,7,-5,16,-12,16r-57,-28v-20,3,-40,19,-61,18v-10,2,-43,-17,-42,-36v0,-14,7,-40,27,-41v39,-26,92,-36,104,9v0,6,-2,11,-9,15v-32,-24,-64,-6,-84,11v8,15,58,-17,72,-11xm99,-137v7,6,56,14,37,40v-28,-7,-62,-21,-100,-41v-2,-3,-2,-26,5,-23v16,4,42,17,58,24",w:173},"â":{d:"118,-53v10,4,55,41,62,47v0,7,-5,16,-12,16r-57,-28v-20,3,-40,19,-61,18v-10,2,-43,-17,-42,-36v0,-14,7,-40,27,-41v39,-26,92,-36,104,9v0,6,-2,11,-9,15v-32,-24,-64,-6,-84,11v8,15,58,-17,72,-11xm147,-97v-27,-6,-39,-26,-60,-37v-21,7,-38,46,-65,23v-2,-5,-3,-10,-4,-14v18,-4,43,-31,61,-42v28,5,40,21,62,36v12,8,18,17,18,25v0,6,-4,9,-12,9",w:173},"ä":{d:"118,-53v10,4,55,41,62,47v0,7,-5,16,-12,16r-57,-28v-20,3,-40,19,-61,18v-32,5,-66,-64,-15,-77v39,-26,92,-36,104,9v0,6,-3,11,-9,15v-32,-24,-64,-6,-84,11v8,15,58,-17,72,-11xm142,-119v0,8,-4,13,-12,13v-18,0,-21,-20,-16,-34v18,-1,28,2,28,21xm46,-144v7,3,28,9,27,18v1,8,-9,18,-18,17v-18,-1,-25,-25,-9,-35",w:173},"ã":{d:"118,-53v10,4,55,41,62,47v0,7,-5,16,-12,16r-57,-28v-20,3,-40,19,-61,18v-10,2,-43,-17,-42,-36v0,-14,7,-40,27,-41v39,-26,92,-36,104,9v0,6,-2,11,-9,15v-32,-24,-64,-6,-84,11v8,15,58,-17,72,-11xm114,-136v22,-8,41,-24,64,-26v3,11,-7,10,-7,21v-26,20,-45,30,-58,30v-3,3,-49,-26,-49,-28v-10,-1,-32,35,-51,31v-12,-32,8,-29,32,-51v24,-21,54,20,69,23",w:173},"å":{d:"118,-53v10,4,55,41,62,47v0,7,-5,16,-12,16r-57,-28v-20,3,-40,19,-61,18v-10,2,-43,-17,-42,-36v0,-14,7,-40,27,-41v39,-26,92,-36,104,9v0,6,-2,11,-9,15v-32,-24,-64,-6,-84,11v8,15,58,-17,72,-11xm54,-101v-37,-20,-9,-71,34,-65v13,1,25,3,38,13v27,45,-34,73,-72,52xm61,-128v4,20,48,7,49,-5v0,-5,-9,-7,-28,-10v-12,-2,-21,11,-21,15",w:173},"ç":{d:"108,-118v30,-6,56,21,25,33v-24,-6,-39,5,-75,23v-7,4,-12,12,-15,22v31,28,86,3,128,9v3,28,-29,16,-44,28v-53,15,-106,10,-120,-37v0,-48,62,-70,101,-78xm92,18v23,4,45,12,48,32v-2,6,-12,28,-25,28v-24,6,-50,10,-77,13v-16,-4,-11,-28,7,-29v17,-1,51,-4,63,-12v-14,-15,-57,10,-46,-32v9,-8,0,-25,21,-26v6,6,12,14,9,26",w:171},"é":{d:"108,-124v42,-3,70,39,50,73v-22,-1,-70,12,-94,10v-1,1,-2,3,-2,3v0,3,12,7,35,14v18,0,64,7,30,21v-10,14,-31,6,-53,6v-26,-7,-70,-26,-70,-58v0,-54,48,-65,104,-69xm130,-78v-2,-35,-66,-13,-77,3v16,6,62,6,77,-3xm76,-169v26,-11,48,-32,59,-14v3,10,-80,53,-89,53v-14,1,-14,-10,-12,-21v15,-7,16,-7,42,-18",w:161},"è":{d:"108,-124v42,-3,70,39,50,73v-22,-1,-70,12,-94,10v-1,1,-2,3,-2,3v0,3,12,7,35,14v18,0,64,7,30,21v-10,14,-31,6,-53,6v-26,-7,-70,-26,-70,-58v0,-54,48,-65,104,-69xm130,-78v-2,-35,-66,-13,-77,3v16,6,62,6,77,-3xm95,-166v7,6,54,14,37,40v-28,-7,-62,-21,-100,-41v-3,-3,-3,-26,5,-24v16,5,42,18,58,25",w:161},"ê":{d:"108,-124v42,-3,70,39,50,73v-22,-1,-70,12,-94,10v-1,1,-2,3,-2,3v0,3,12,7,35,14v18,0,64,7,30,21v-10,14,-31,6,-53,6v-26,-7,-70,-26,-70,-58v0,-54,48,-65,104,-69xm130,-78v-2,-35,-66,-13,-77,3v16,6,62,6,77,-3xm145,-129v-27,-6,-39,-26,-60,-37v-8,0,-10,4,-14,10v-11,15,-51,34,-56,0v17,-4,44,-32,61,-43v28,5,41,21,63,36v12,8,17,17,17,25v0,6,-3,9,-11,9",w:161},"ë":{d:"108,-124v42,-3,70,39,50,73v-22,-1,-70,12,-94,10r-3,3v0,3,12,7,36,14v18,0,64,7,30,21v-10,14,-31,6,-53,6v-26,-7,-67,-27,-71,-58v7,-52,48,-65,105,-69xm130,-78v-2,-35,-66,-13,-77,3v16,6,62,6,77,-3xm140,-144v0,8,-4,12,-12,12v-18,0,-19,-19,-16,-33v18,-1,29,1,28,21xm44,-169v7,3,28,9,28,17v0,9,-9,18,-18,18v-18,0,-25,-24,-10,-35",w:161},"í":{d:"59,-98v20,4,15,53,10,95v-6,1,-11,2,-19,-4v1,-7,-12,-18,-10,-24v4,-22,-4,-65,19,-67xm50,-139v27,-11,49,-32,59,-14v3,11,-80,53,-89,53v-14,1,-14,-12,-11,-22v15,-7,14,-6,41,-17",w:105},"ì":{d:"57,-98v22,5,13,50,11,95v-7,1,-11,2,-20,-4v1,-7,-12,-18,-10,-24v4,-22,-2,-64,19,-67xm70,-139v14,10,54,14,37,41v-28,-7,-61,-22,-99,-42v-3,-2,-3,-25,5,-23v15,5,41,17,57,24",w:109},"î":{d:"72,-98v20,5,12,51,10,95v-6,2,-13,1,-20,-4v1,-8,-12,-18,-10,-24v4,-22,-3,-65,20,-67xm134,-94v-26,-7,-39,-25,-60,-37v-7,0,-9,4,-13,10v-14,15,-51,34,-56,-1v18,-4,45,-33,61,-43v27,6,40,22,62,37v12,8,18,17,18,25v0,6,-4,9,-12,9",w:143},"ï":{d:"55,-97v19,5,15,53,10,95v-17,5,-26,-14,-30,-28v6,-20,-3,-65,20,-67xm110,-118v0,8,-4,13,-12,13v-17,0,-19,-19,-16,-34v18,-1,29,1,28,21xm14,-143v6,3,28,8,28,17v0,9,-9,18,-18,18v-18,0,-25,-24,-10,-35",w:107},"ñ":{d:"115,-129v34,6,59,50,59,105v0,31,-15,24,-30,17v-15,-29,-5,-42,-20,-81v-35,-13,-68,52,-88,61v-20,-4,-38,-36,-19,-59v0,-12,3,-14,10,-28v11,-8,18,11,27,12xm117,-166v22,-7,41,-23,64,-26v3,11,-7,10,-7,21v-26,20,-45,30,-58,30v-3,3,-49,-26,-49,-28v-10,-1,-32,35,-51,31v-5,-12,-8,-16,0,-23v4,-6,28,-29,48,-33v17,-3,43,28,53,28",w:171},"ó":{d:"102,-132v50,-20,99,16,99,60v0,54,-60,64,-108,79v-50,-2,-110,-48,-76,-100v22,-17,49,-33,85,-39xm136,-104v-34,0,-91,27,-94,47v16,51,125,16,125,-22v0,-17,-10,-25,-31,-25xm49,-154v24,-3,85,-55,101,-32v3,11,-80,53,-89,53v-14,0,-13,-8,-12,-21",w:191},"ò":{d:"102,-132v50,-20,99,16,99,60v0,54,-60,64,-108,79v-50,-2,-110,-48,-76,-100v22,-17,49,-33,85,-39xm136,-104v-34,0,-91,27,-94,47v16,51,125,16,125,-22v0,-17,-10,-25,-31,-25xm115,-181v14,10,51,13,37,40v-28,-7,-62,-21,-100,-41v-3,-2,-3,-26,5,-23v16,5,42,17,58,24",w:191},"ô":{d:"102,-132v50,-20,99,16,99,60v0,54,-60,64,-108,79v-50,-2,-110,-48,-76,-100v22,-17,49,-33,85,-39xm136,-104v-34,0,-91,27,-94,47v16,51,125,16,125,-22v0,-17,-10,-25,-31,-25xm110,-177v-22,6,-38,45,-65,22v-2,-4,-3,-9,-4,-13v18,-4,43,-32,61,-43v27,6,40,21,62,36v12,9,18,17,18,25v1,11,-15,10,-23,7",w:191},"ö":{d:"102,-132v50,-20,99,16,99,60v0,54,-60,64,-108,79v-50,-2,-110,-48,-76,-100v22,-17,49,-33,85,-39xm136,-104v-34,0,-91,27,-94,47v16,51,125,16,125,-22v0,-17,-10,-25,-31,-25xm161,-160v0,8,-4,13,-12,13v-17,0,-19,-19,-16,-34v18,-1,29,1,28,21xm65,-185v7,3,28,9,28,18v0,7,-9,18,-18,17v-18,1,-25,-24,-10,-35",w:191},"õ":{d:"102,-132v50,-20,99,16,99,60v0,54,-60,64,-108,79v-50,-2,-110,-48,-76,-100v22,-17,49,-33,85,-39xm136,-104v-34,0,-91,27,-94,47v16,51,125,16,125,-22v0,-17,-10,-25,-31,-25xm58,-199v26,-21,54,18,69,22v4,0,15,-5,34,-13v22,-9,21,-16,31,-13v3,11,-9,9,-7,22v-26,20,-46,30,-59,30v-2,4,-49,-28,-49,-29v-11,0,-32,31,-46,32v-12,-3,-13,-21,-4,-23v4,-6,14,-15,31,-28",w:191},"ú":{d:"196,-129v-1,-4,12,-13,15,-13v6,0,8,7,8,21v0,24,-7,25,-13,45v-7,7,-14,21,-24,29v-9,24,-61,45,-89,45v-63,0,-105,-72,-67,-126v24,-3,19,27,18,46v-1,26,23,42,54,40v38,-3,88,-51,98,-87xm106,-174v26,-11,48,-32,59,-14v3,11,-81,53,-89,54v-13,1,-15,-12,-11,-22v15,-7,14,-7,41,-18",w:213},"ù":{d:"196,-129v-1,-4,12,-13,15,-13v6,0,8,7,8,21v0,24,-7,25,-13,45v-7,7,-14,21,-24,29v-9,24,-61,45,-89,45v-63,0,-105,-72,-67,-126v24,-3,19,27,18,46v-1,26,23,42,54,40v38,-3,88,-51,98,-87xm126,-166v7,6,56,14,37,40v-28,-7,-62,-22,-100,-42v-2,-3,-2,-26,5,-23v16,4,42,18,58,25",w:213},"û":{d:"196,-129v-1,-4,12,-13,15,-13v6,0,8,7,8,21v0,24,-7,25,-13,45v-7,7,-14,21,-24,29v-9,24,-61,45,-89,45v-63,0,-105,-72,-67,-126v24,-3,19,27,18,46v-1,26,23,42,54,40v38,-3,88,-51,98,-87xm172,-143v-27,-6,-39,-26,-60,-37v-8,0,-10,4,-14,10v-11,15,-49,35,-56,0v17,-4,44,-32,61,-43v27,6,41,21,63,36v12,9,17,17,17,25v0,6,-3,9,-11,9",w:213},"ü":{d:"196,-129v-1,-4,12,-13,15,-13v6,0,8,7,8,21v0,24,-7,25,-13,45v-7,7,-14,21,-24,29v-9,24,-61,45,-89,45v-63,0,-105,-72,-67,-126v24,-3,19,27,18,46v-1,26,23,42,54,40v38,-3,88,-51,98,-87xm168,-161v0,8,-3,13,-11,13v-17,0,-20,-19,-17,-34v18,-1,29,1,28,21xm72,-186v7,3,29,9,28,18v0,7,-9,18,-18,17v-18,1,-25,-24,-10,-35",w:213},"†":{d:"22,-286v15,6,5,-20,19,-19v9,-3,15,21,17,22v6,1,12,3,20,6v3,10,5,16,-9,16v-34,-10,-6,51,-34,52v-20,-7,11,-47,-15,-49v-14,3,-25,-5,-17,-24v7,-2,14,-4,19,-4",w:77},"°":{d:"106,-268v0,36,-35,38,-51,46v-48,5,-60,-58,-25,-78v33,-11,76,-9,76,32xm38,-257v16,7,39,2,38,-17v-13,-9,-28,-1,-32,11v-5,3,-7,0,-6,6",w:114},"¢":{d:"105,-188v13,-12,14,-18,26,-15v7,23,7,15,-3,49v6,0,18,14,17,20v-3,5,-12,19,-26,13v-14,1,-14,5,-16,21v10,10,46,-13,38,18v-9,17,-23,16,-54,20v-17,16,-4,55,-29,60v-37,-10,19,-64,-24,-71v-20,-10,-37,-47,-6,-62v23,-20,73,-4,77,-53xm65,-101v4,-9,7,-8,3,-13v-14,4,-22,10,-3,13",w:154},"£":{d:"153,-170v3,22,62,0,49,39v-18,6,-31,12,-58,9v-12,-1,-17,30,-23,39v19,26,50,56,91,35v9,-2,27,-13,27,4v0,27,-27,39,-58,42v-32,-5,-59,-19,-78,-39v-6,1,-35,44,-57,39v-25,0,-37,-15,-37,-46v0,-41,43,-53,73,-50v4,1,12,-18,12,-21v-7,-15,-49,0,-44,-30v-2,-31,31,-16,60,-19v16,-30,25,-119,93,-113v16,2,75,16,50,44v-4,5,-7,7,-12,8v-18,-12,-32,-18,-41,-18v-35,-1,-38,52,-47,77xm43,-45v4,5,12,-2,11,-9v-1,2,-12,1,-11,9",w:242},"§":{d:"141,-115v12,10,29,36,28,56v-4,68,-129,69,-152,16v-1,-12,-10,-22,8,-23v17,3,47,21,67,23v16,1,40,-8,38,-21v-8,-49,-119,-30,-117,-85v1,-28,15,-45,-3,-64v-1,-53,55,-61,103,-62v15,-5,6,-5,20,-2v16,17,23,27,23,30v-1,26,-29,7,-45,7v-21,0,-51,2,-62,17v19,14,87,8,97,43v18,14,16,57,-5,65xm64,-147r57,17v10,-28,-22,-43,-47,-44v-25,-1,-35,19,-10,27",w:174},"•":{d:"130,-114v0,47,-124,54,-120,-8r6,-31v44,-28,64,-34,104,0v8,6,10,20,10,39",w:139},"¶":{d:"121,-237v21,-9,44,-13,63,-1v-1,7,5,6,7,11r-4,190v-2,33,4,39,-15,40v-16,1,-10,-20,-10,-33r4,-161v0,-17,-1,-34,-16,-25v2,10,1,23,1,35v-9,46,-6,75,-15,156v-3,4,-7,5,-12,5v-17,-10,-3,-89,-10,-115v-43,14,-98,10,-101,-29v-4,-53,59,-63,104,-75v3,1,4,2,4,2xm95,-204v2,9,-30,50,1,50v35,0,23,-13,29,-43v0,-1,-2,-7,-4,-15v-12,-1,-14,2,-26,8",w:206},"ß":{d:"33,10v-29,4,-28,-32,-16,-70v18,-58,17,-137,56,-176v12,-24,46,-58,82,-43v20,8,47,24,47,54v0,30,-62,59,-67,90v33,23,56,33,63,63v-18,21,-22,36,-48,54v-24,17,-27,41,-53,16v-2,-19,7,-35,24,-42v15,-13,26,-22,34,-40v-13,-17,-78,-29,-56,-70v-3,-27,64,-54,66,-86v-8,-25,-41,-4,-52,8v-29,30,-47,83,-51,141v-17,25,-8,71,-29,101"},"®":{d:"75,-194v78,-29,116,9,130,84v-2,42,-22,47,-57,67v-74,20,-161,-19,-129,-110v6,-18,29,-34,57,-40xm46,-86v51,36,84,21,129,-15v7,-15,0,-39,-10,-49v-13,-37,-49,-26,-86,-18v-28,7,-49,46,-33,82xm72,-123v-5,-43,68,-57,75,-14v-17,26,-18,17,3,32v2,25,-25,18,-45,7r-4,-4v-1,8,-3,20,-12,24v-10,-3,-21,-34,-17,-45xm112,-135v-10,-1,-20,13,-9,14v6,-6,9,-11,9,-14",w:217},"©":{d:"102,-29v-74,5,-124,-84,-70,-140v22,-22,53,-35,97,-38v46,-4,88,49,74,100v0,44,-51,75,-101,78xm96,-66v42,-3,75,-23,75,-69v0,-23,-4,-38,-44,-38v-16,0,-33,6,-49,20v36,-4,55,-12,62,20v-5,16,-49,1,-50,21v10,15,53,-14,54,11v0,18,-14,27,-42,27v-22,1,-46,-11,-46,-31v0,-25,7,-39,20,-44v-1,-1,-2,-2,-3,-2v-51,22,-32,89,23,85",w:217},"™":{d:"213,-307v28,9,11,49,7,75v-1,4,-4,6,-11,6v-7,1,-11,-14,-11,-34v-14,-6,-34,34,-46,28v-2,0,-10,-9,-24,-27v-10,7,-3,36,-27,31v-15,-24,-3,-27,1,-48v-6,-7,-27,-1,-31,3v-3,14,-7,30,-11,51v-5,10,-29,9,-24,-12v-5,-8,1,-18,3,-35v-13,6,-33,2,-29,-18v20,-17,64,-17,100,-19v28,-1,29,30,45,39v11,-6,35,-32,58,-40",w:239},"´":{d:"52,-284v29,-11,50,-34,62,-14v3,12,-86,54,-94,56v-14,0,-16,-12,-12,-23v11,-5,25,-11,44,-19",w:120},"¨":{d:"124,-259v0,9,-4,13,-12,13v-18,0,-22,-21,-17,-35v19,-1,30,1,29,22xm23,-285v7,2,30,9,29,18v1,10,-9,19,-18,19v-19,0,-28,-26,-11,-37",w:136},"≠":{d:"48,-130v29,11,49,-57,60,-50v25,6,7,27,-1,46v22,5,29,7,21,22v-18,2,-48,-1,-50,15v9,8,53,-7,54,10v-4,22,-46,20,-72,24v-7,13,-18,32,-34,57v-8,6,-15,-3,-13,-14v-1,-9,15,-39,14,-45v-30,5,-24,-17,-13,-25v12,-1,36,4,29,-13v-14,0,-47,6,-36,-12v0,-18,27,-13,41,-15",w:140},"Æ":{d:"335,-259v0,30,-102,12,-122,34v10,21,2,79,16,100v24,-6,59,-13,86,-16v23,-2,32,21,13,26r-103,29v-3,22,-4,38,8,43v28,-5,60,-6,86,-14v5,-1,14,7,14,11v6,16,-90,40,-107,40v-29,0,-39,-19,-32,-46v-2,-4,0,-26,-9,-28v-29,2,-58,6,-88,6v-31,0,-40,74,-82,73v-18,-23,4,-37,12,-50v40,-65,112,-126,165,-207v20,-17,69,-11,112,-13v21,0,31,4,31,12xm123,-111v28,1,44,-2,67,-10v-4,-22,5,-49,-7,-65v-3,6,-65,61,-60,75",w:348},"Ø":{d:"76,-211v41,-13,100,-22,140,-3v26,-19,40,-29,44,-29v10,0,15,7,15,20v0,15,-23,23,-30,35v23,39,29,114,-21,139v-36,19,-102,35,-147,18v-14,-5,-29,29,-46,35v-25,-13,-19,-24,3,-56v-9,-17,-28,-27,-28,-60v0,-38,23,-72,70,-99xm107,-66v55,15,125,-12,123,-70v0,-16,-5,-25,-13,-29r-110,95r0,4xm39,-108v-1,3,17,31,22,27v8,-6,109,-90,123,-106v-15,-11,-43,1,-63,2v-33,10,-80,35,-82,77",w:270},"∞":{d:"322,-72v-4,22,-54,41,-76,41v-43,0,-83,-17,-114,-35v-46,19,-125,53,-128,-18v-1,-14,10,-22,13,-35v29,-10,62,-31,97,-4v37,28,47,5,75,-8v40,-19,73,-10,114,1v13,1,18,55,19,58xm228,-69v15,0,62,-12,61,-25v-19,-23,-89,-10,-105,11v0,2,1,4,2,4v28,6,42,10,42,10xm75,-102v-13,2,-41,4,-44,19v0,4,3,7,10,7v21,0,40,-6,54,-17v-9,-6,-16,-9,-20,-9",w:330},"±":{d:"93,-163v-7,46,76,-4,46,47v-14,6,-27,13,-38,8v-24,2,-14,28,-28,44r-14,0v-7,-12,-5,-15,-7,-33v-12,-7,-41,-1,-37,-24v2,-11,23,-17,36,-14r28,-38v4,0,9,4,14,10xm113,-27v-12,18,-58,27,-85,24v-16,2,-22,-23,-13,-36v28,-7,85,-11,98,12",w:151},"≤":{d:"73,-109v10,15,87,16,87,42v0,11,-5,16,-13,16v-36,-11,-69,-24,-109,-31v-18,-8,-18,-13,-9,-36v59,-56,93,-83,101,-83v16,0,18,17,14,28v-27,24,-42,35,-71,64xm10,-29v35,-12,117,-26,148,-3v1,2,-5,19,-8,18r-124,15v-16,2,-26,-18,-16,-30",w:168},"≥":{d:"115,-174v20,7,53,36,20,57v-19,11,-91,68,-82,59v-18,3,-25,-22,-13,-31v15,-10,14,-10,70,-51r-50,-37v-5,-4,-5,-27,4,-28v16,7,40,17,51,31xm14,-32v33,-10,86,-14,127,-10v12,12,5,23,-11,27v-49,9,-82,13,-99,13v-22,0,-24,-16,-17,-30",w:163},"¥":{d:"31,-248v30,-3,64,64,74,59v37,-22,77,-65,107,-82v20,-11,34,18,21,32v-28,19,-52,38,-70,57v-18,8,-40,21,-35,60v2,19,39,7,64,7v25,0,16,21,2,27v-36,16,-46,8,-68,18v6,11,101,-20,66,24v-21,11,-42,12,-75,20v-2,1,-5,6,-10,18v-8,3,-11,10,-24,8v-7,-17,-2,-18,-9,-26v-13,5,-39,3,-53,-2v-10,-17,-7,-27,0,-34v23,-1,45,1,64,-5v-11,-7,-28,-4,-64,-6v-13,-8,-15,-24,-6,-35v33,-2,102,9,76,-37v-14,-14,-33,-38,-60,-66v-10,-10,-8,-28,0,-37",w:219},"µ":{d:"123,-114v41,0,54,-9,127,-17v12,-2,20,-6,25,-12v5,-78,43,-127,119,-138v38,-5,46,23,55,48v-5,5,2,4,2,12v-2,47,-72,81,-129,95v-17,4,-12,32,-2,39v30,-5,24,0,99,4v14,9,14,20,-1,23v-17,3,-71,-1,-85,13v1,19,18,35,-3,47v-1,-6,-10,-7,-16,-5v-3,-3,-20,-37,-29,-41v-15,8,-50,22,-49,-9v1,-19,2,-27,28,-26v24,1,13,-12,8,-30v-22,1,-64,16,-111,23v-50,7,-17,47,-17,57v0,10,-5,15,-13,15v-20,-9,-27,-30,-33,-55v-20,-17,-52,8,-85,-6v-2,-10,-13,-26,4,-29v32,-6,41,-1,65,-7v-17,-74,-4,-173,69,-180v55,-20,130,8,131,65v-11,9,-10,2,-29,-11v-33,-23,-37,-26,-76,-25v-41,13,-69,38,-67,100v0,34,4,50,13,50xm317,-152v29,-6,106,-43,106,-71v0,-23,-24,-25,-42,-17v-31,1,-74,48,-64,88",w:462},"∂":{d:"456,-113v55,-37,119,-8,176,5v-19,37,-104,-5,-144,18v-5,64,-45,87,-130,87v-43,0,-70,-8,-96,-21v-54,15,-146,29,-209,10v-18,-11,-43,-26,-46,-53v-1,-9,28,-48,51,-46v55,-10,55,-8,101,-8v29,0,17,-26,23,-56v4,-19,4,-74,34,-49v4,42,-7,83,-10,124v0,4,-11,10,-34,17v-29,-1,-45,-4,-74,1v-10,2,-57,3,-52,18v30,43,132,30,190,18v2,-10,-7,-19,-5,-28v5,-36,31,-59,74,-56v27,2,71,4,70,35v-1,30,-37,41,-58,57v35,13,131,15,135,-23v2,-19,-5,-36,4,-50xm262,-85v0,3,13,28,19,25v7,0,48,-13,61,-29v-10,-17,-71,-17,-80,4",w:640},"∑":{d:"235,-95v-3,-59,120,-41,160,-28v3,-2,15,-3,14,4v1,3,-16,19,-21,18r-97,4v-25,5,-18,18,-23,56v-16,14,-25,24,-36,18v-83,32,-154,29,-212,-17v-45,-68,41,-114,107,-119v50,-4,59,66,22,85v-16,8,-61,10,-79,15v36,27,185,24,165,-36xm128,-119v-23,-3,-43,4,-53,15v13,5,46,-4,53,-15",w:414},"∏":{d:"243,-190v7,-18,27,-19,38,6v0,2,-5,8,-14,16v-8,-9,-27,-4,-24,-22xm221,-111v55,-7,60,22,45,64v5,23,17,47,-22,47v-35,0,-18,-40,-15,-70v-2,-19,-35,-13,-52,-18v-2,0,-13,1,-34,3v-4,0,-10,11,-13,31v-3,20,1,43,-11,54v-12,-4,-13,-5,-21,-3v-13,-13,-3,-25,-12,-41v7,-6,12,-22,10,-39v-23,-8,-79,15,-87,-21v12,-28,78,-4,101,-20r36,-96v8,-19,17,-28,27,-28v10,0,15,6,15,18v-6,32,-31,62,-38,109v25,10,47,-1,71,10",w:282},"π":{d:"247,-240v-3,5,-14,12,-21,6v-41,5,-71,-4,-85,37v-6,7,-21,42,-25,61v28,12,104,-16,129,24v8,11,12,24,12,38v-7,17,-2,99,-40,68v-9,-23,-5,-47,-1,-73v3,-24,-40,-24,-50,-19v-4,0,-18,2,-44,6v-30,-6,-16,49,-33,58v-19,-11,-14,2,-29,-10v8,-71,20,-114,43,-170v-24,-2,-49,4,-73,7v-30,3,-32,-33,-7,-36r184,-22v17,-1,40,13,40,25",w:265},"∫":{d:"62,-151v-7,-70,20,-130,63,-150v28,1,39,10,70,23v20,8,6,33,-6,35v-29,-13,-45,-20,-49,-20v-20,-4,-45,51,-43,70v8,60,5,129,5,189v0,62,-27,93,-79,93v-37,-1,-71,-14,-63,-57v21,0,79,34,91,-2v16,-3,14,-64,21,-85v-2,-31,-1,-74,-10,-96",w:156},"ª":{d:"6,-265v1,-31,58,-53,80,-22v-11,14,25,28,25,36v-2,8,-15,12,-27,10v-22,-29,-68,19,-78,-24xm52,-281v-8,1,-24,10,-9,13v11,1,24,-10,9,-13",w:117},"º":{d:"13,-273v1,-31,56,-41,83,-18v36,8,14,48,-9,52v-35,6,-64,-5,-74,-34xm81,-269v-7,-7,-20,-11,-29,-6v5,13,13,11,29,6",w:128},"Ω":{d:"121,-111v9,16,43,-5,54,5v28,-4,62,8,81,-5v48,-33,166,-28,160,44v15,34,-51,53,-88,53v-34,0,-53,-21,-71,-37v-15,7,-32,-4,-28,-22v-26,-4,-93,-6,-108,8v8,17,5,37,12,54v-1,15,-18,15,-31,10v-9,-15,-20,-39,-19,-63v-20,-9,-73,15,-79,-18v4,-28,50,-11,77,-24v12,-99,36,-168,137,-178v35,5,64,20,67,57v0,13,-14,18,-20,5v-15,-35,-83,-31,-104,4v-26,20,-39,82,-40,107xm334,-45v15,2,51,-14,53,-22v-7,-20,-36,-31,-69,-29v-8,-1,-39,6,-37,14v-3,10,44,38,53,37",w:424},"æ":{d:"145,-44r33,7v2,42,-59,29,-85,16v-6,7,-35,24,-48,15v-19,2,-35,-21,-33,-37v2,-24,5,-19,28,-36v-6,-8,-45,3,-33,-21v21,-22,58,-12,85,-1v6,-5,35,-28,45,-15v20,-4,36,17,36,35v0,23,-4,21,-28,37xm111,-72v12,3,49,-16,19,-17v-5,0,-20,12,-19,17xm74,-50v-14,-4,-48,16,-19,17v4,1,19,-14,19,-17",w:184},"ø":{d:"76,-136v17,7,33,-8,51,0v9,-6,21,-13,36,-21v23,22,-13,31,3,50v11,13,4,21,14,35v-4,5,-1,14,-4,23v-14,23,-45,41,-84,39v-12,2,-29,28,-41,38v-2,-11,-34,-10,-15,-30v3,-7,5,-11,5,-11v-15,-24,-60,-54,-22,-89v23,-21,25,-32,57,-34xm102,-54v18,1,50,-19,30,-32v-12,7,-22,18,-30,32xm85,-92v-14,3,-26,8,-38,17v2,20,17,13,26,0v6,-8,12,-13,12,-17",w:188},"¿":{d:"181,-247v3,1,31,2,29,15v-4,22,-37,27,-41,4v1,-5,7,-20,12,-19xm161,-34v-45,-1,-105,19,-124,51v0,11,18,17,54,17v39,0,82,-13,112,4v-10,35,-58,31,-100,31v-47,0,-80,-10,-99,-31v-10,-56,22,-73,64,-90v8,-3,32,-9,74,-18v21,-15,7,-62,22,-92v-1,-5,-1,-11,4,-12v16,0,24,7,24,22v-8,30,-8,73,-17,111v-3,5,-7,7,-14,7",w:213},"¡":{d:"86,-197v8,16,-7,41,-24,25v-11,-11,-4,-16,-3,-29v13,0,15,-2,27,4xm46,-107v4,-8,11,-16,23,-7v19,26,-5,57,-6,87v-7,0,-5,18,-9,28v0,14,-17,52,-11,70v-2,7,-15,28,-25,12v-4,-6,-15,-7,-6,-16v2,-39,14,-96,34,-174",w:95},"¬":{d:"141,-99v47,7,103,-3,149,6v14,24,18,15,10,39v-10,34,-7,31,-26,76v-4,6,-15,8,-16,21v-4,2,-4,1,-13,5v-22,-33,-4,-33,16,-104v-5,-9,-28,-4,-38,-6r-183,4v-14,0,-41,-29,-17,-36v31,-9,82,5,118,-5",w:315},"√":{d:"364,-218v43,-21,80,-51,104,-32v-3,19,-24,21,-44,40v-41,15,-78,53,-136,78r-137,98v-20,16,-79,66,-91,68v-3,1,-25,-11,-24,-13v-4,-28,-43,-61,-30,-85v26,-15,42,19,58,32r295,-188v0,1,2,2,5,2",w:474},"ƒ":{d:"115,-262v-23,6,-39,63,-38,96v1,3,57,2,54,16v1,22,-45,15,-51,30v3,34,12,68,10,103v14,17,-18,53,-28,63v-48,8,-89,5,-95,-37v20,-5,77,21,83,-18v17,-29,-4,-61,0,-98v0,-5,-3,-10,-7,-17v-33,4,-43,-17,-25,-37v10,-4,27,5,27,-10v0,-43,15,-77,32,-109v12,-7,16,-22,38,-20v11,1,51,35,25,55v-9,1,-16,-17,-25,-17",w:145},"≈":{d:"133,-112v21,15,48,-30,78,-17v3,3,5,7,5,9v-8,30,-47,45,-76,45v-19,0,-64,-48,-90,-21r-29,20v-6,-1,-17,-16,-15,-32v24,-17,70,-42,107,-21v4,4,10,9,20,17xm138,-57v28,2,48,-25,76,-26v13,30,-21,42,-40,53v-41,24,-77,-15,-114,-23v-15,14,-46,32,-49,-1v-3,-9,27,-28,54,-30",w:223},"∆":{d:"18,-1v-24,-30,8,-48,25,-71v14,-19,34,-28,40,-56v20,-35,29,-14,57,4v9,39,43,62,57,102v0,16,-34,17,-50,14v-28,2,-72,4,-129,7xm139,-47r-22,-52v-12,-5,-12,15,-24,27v-7,6,-14,16,-23,28v23,1,36,-1,69,-3",w:199},"«":{d:"191,-64v16,6,87,37,53,63v-39,-9,-71,-28,-107,-40v-14,-13,-13,-34,10,-47v27,-15,48,-55,84,-62v9,-2,21,10,21,18r-13,21v-16,5,-44,22,-51,41v0,4,1,6,3,6xm71,-65v17,6,87,35,55,62v-39,-8,-66,-27,-108,-40v-14,-13,-13,-36,10,-46v23,-18,50,-56,84,-63v9,-2,21,10,21,18r-13,22v-20,6,-32,17,-51,37v0,3,-1,11,2,10",w:265},"»":{d:"120,-129v9,-33,48,-10,64,5v9,20,86,52,50,86v-36,11,-66,31,-107,40v-6,-7,-9,-13,-9,-17v-2,-13,50,-46,63,-46v11,-18,-33,-42,-48,-47xm1,-128v10,-33,46,-8,64,6v8,19,86,50,51,85v-40,13,-69,30,-108,40v-6,-7,-8,-12,-8,-16v-2,-14,50,-46,63,-47v7,-13,-9,-20,-19,-30v-10,-9,-20,-15,-30,-17",w:252},"…":{d:"244,-24v-1,21,-38,32,-41,3v-2,-19,23,-22,34,-17v0,7,0,15,7,14xm113,-24v0,-22,28,-21,38,-8v5,34,-39,40,-38,8xm35,-2v-10,-2,-36,-17,-18,-29v-1,-15,17,-17,31,-6v7,17,6,33,-13,35",w:258}," ":{w:179},"À":{d:"161,-217v20,53,23,124,54,170v-2,20,-34,9,-42,0v-27,-12,-78,-18,-101,-18v-26,6,-29,51,-54,63v-18,-4,-19,-30,-3,-38v5,-9,15,-16,8,-29v1,-12,23,-9,26,-19v6,-10,11,-20,20,-27r70,-121v12,-4,16,4,22,19xm82,-91v17,3,62,7,86,13v-13,-33,-13,-80,-29,-109v-15,30,-38,63,-57,96xm150,-268v14,10,54,14,37,41v-28,-7,-62,-22,-100,-42v-2,-3,-2,-26,5,-23v16,4,42,17,58,24"},"Ã":{d:"161,-217v20,53,23,124,54,170v-2,20,-34,9,-42,0v-27,-12,-78,-18,-101,-18v-26,6,-29,51,-54,63v-18,-4,-19,-30,-3,-38v5,-9,15,-16,8,-29v1,-12,23,-9,26,-19v6,-10,11,-20,20,-27r70,-121v12,-4,16,4,22,19xm82,-91v17,3,62,7,86,13v-13,-33,-13,-80,-29,-109v-15,30,-38,63,-57,96xm100,-285v26,-19,54,19,69,22v4,0,15,-5,34,-13v23,-9,22,-17,31,-12v3,11,-9,9,-7,21v-26,20,-46,30,-59,30v-3,3,-50,-26,-49,-29v-12,1,-31,35,-51,32v-3,-8,-5,-14,-5,-18v10,-9,16,-17,37,-33"},"Õ":{d:"62,-184v78,-31,249,-50,238,74v-6,65,-102,105,-179,115v-77,-7,-152,-71,-101,-149v2,-5,24,-33,42,-40xm279,-120v14,-38,-47,-64,-85,-61v-20,-9,-41,7,-62,0v-11,7,-54,12,-66,24v0,20,-51,35,-38,66v-1,43,50,67,96,67v44,0,162,-55,155,-96xm116,-270v26,-19,54,19,69,22v4,0,15,-5,34,-13v23,-10,22,-16,31,-12v3,11,-8,9,-7,21v-45,28,-47,42,-88,16v-29,-19,-12,-20,-43,2v-8,5,-12,18,-23,15v-13,-3,-12,-20,-4,-23v4,-6,14,-15,31,-28",w:273},"Œ":{d:"247,-243v71,4,161,-7,245,-8v17,0,27,6,27,17v-8,27,-70,14,-104,23v-3,1,-52,0,-65,7r0,4v16,16,17,29,17,65v32,10,74,-14,99,16v-14,25,-76,17,-127,24v-17,18,-55,32,-75,51v85,0,128,-3,204,-11v15,-2,21,11,20,29v-78,24,-177,12,-270,24v-24,3,-24,-29,-48,-15v-46,7,-70,4,-105,-4v-19,-18,-42,-22,-52,-55v-10,-34,0,-47,12,-78v-18,-59,48,-78,105,-84v17,-18,103,-13,117,-5xm125,-45v76,-9,186,-43,209,-105v-26,-67,-137,-83,-217,-54v3,34,-45,25,-60,58v-41,48,5,108,68,101",w:492},"œ":{d:"185,-54v25,28,107,-17,104,33v-12,12,-60,14,-87,14v0,0,1,1,2,1v-11,1,-39,-9,-50,-17v-28,17,-75,32,-114,7v-22,-14,-34,-11,-34,-41v0,-36,33,-49,48,-75v29,-16,72,-3,95,11v12,-9,48,-27,59,-26v30,0,64,15,65,40v0,7,-6,20,-20,37v-29,1,-44,11,-68,16xm226,-106v-21,-7,-41,-2,-48,13v14,1,42,-7,48,-13xm132,-87v-21,-35,-94,11,-92,24v-2,14,43,21,61,21v25,0,36,-20,31,-45",w:295},"–":{d:"6,-66v-8,-72,79,-21,146,-39v37,-10,79,7,111,0v9,8,14,13,14,17v2,26,-72,13,-99,21v-83,4,-124,21,-172,1",w:282},"—":{d:"175,-106v86,-9,201,1,286,-1v11,6,13,11,6,30v-118,15,-246,10,-377,10v-25,0,-73,3,-82,-8r-2,-26v11,-13,32,-9,52,-7v38,3,84,-5,117,2",w:485},"“":{d:"66,-261v-21,5,-37,51,-22,77v0,4,-2,6,-7,6v-31,-9,-38,-62,-12,-94v12,-15,21,-28,31,-34v16,-1,19,24,22,34v10,-11,22,-32,43,-23v-2,8,4,16,5,19v-6,11,-51,53,-29,74v-12,21,-30,5,-33,-17v-6,-13,9,-28,2,-42",w:118},"”":{d:"120,-294v12,3,30,26,19,34v2,15,-40,70,-55,66v-40,-10,10,-51,14,-64v3,-3,8,-31,22,-36xm70,-306v14,3,26,34,16,49v-19,30,-31,45,-58,59v-12,-11,-33,-17,-7,-36v13,-19,36,-27,36,-59v0,-5,9,-13,13,-13",w:148},"‘":{d:"73,-262v-10,7,-41,39,-38,69v-15,13,-27,-16,-28,-28v-2,-20,51,-83,66,-83v20,0,25,41,0,42",w:95},"’":{d:"74,-300v13,31,-1,99,-44,101v-13,0,-19,-5,-19,-15v6,-10,31,-34,35,-59v2,-11,1,-32,11,-32v6,0,11,2,17,5",w:90},"÷":{d:"167,-158v-4,3,-7,9,-10,20v-23,4,-34,-8,-29,-31v14,-6,18,1,39,11xm78,-72v-53,11,-53,12,-69,-15v-1,-12,11,-17,22,-14v71,-13,151,-18,230,-24v11,1,21,16,23,28v-28,20,-90,11,-126,16v-36,5,-62,5,-80,9xm123,-40v19,-17,41,-1,41,17v0,13,-6,19,-17,19v-15,0,-29,-14,-24,-36",w:293},"◊":{d:"76,-158v48,-8,64,11,100,36v28,19,-5,39,-22,54v-15,13,-40,32,-48,49v-17,5,-12,0,-27,-16v-6,-6,-86,-31,-68,-53r2,-9v27,-23,48,-44,63,-61xm93,-65v12,-2,35,-31,41,-38v-5,-10,-16,-14,-34,-24v-12,12,-36,29,-40,44v19,11,30,18,33,18",w:199},"ÿ":{d:"118,85v-11,11,-11,38,-22,61v-2,-1,-2,31,-17,27v-11,0,-21,-10,-21,-22v20,-66,23,-61,64,-168v-22,1,-38,16,-58,4v-22,4,-51,-16,-51,-42v-11,-13,-7,-59,7,-58v16,1,21,24,22,51v21,33,66,5,94,-7v4,-3,26,-14,38,-29r17,0v23,44,-23,59,-34,102v-6,9,-13,9,-13,26v-15,6,-12,33,-27,48v0,2,1,4,1,7xm158,-136v0,8,-4,13,-12,13v-18,0,-21,-20,-16,-34v18,-1,29,1,28,21xm62,-161v7,3,28,9,27,18v1,8,-8,17,-17,17v-18,0,-26,-24,-10,-35",w:190},"Ÿ":{d:"176,-189v35,20,-25,54,-39,72v-26,34,-57,57,-74,104v-10,15,-4,14,-23,3r0,-10v19,-44,27,-46,50,-81v-9,-5,-24,4,-34,4v-38,0,-54,-50,-44,-87v21,-5,18,19,22,35v4,18,15,27,29,27v41,0,60,-39,113,-67xm153,-222v0,8,-3,12,-11,12v-18,0,-21,-19,-16,-33v18,-1,28,2,27,21xm57,-247v8,2,29,9,28,17v0,21,-37,24,-36,1v0,-7,2,-13,8,-18",w:135},"⁄":{d:"193,-305v7,6,17,31,3,41v-10,7,-12,13,-21,25v-79,56,-190,209,-197,260r-18,0v-23,-19,9,-70,15,-85v52,-83,121,-179,218,-241",w:120},"¤":{d:"308,-133r-200,16v-2,1,-6,4,-10,10v70,-2,144,-14,211,-8v3,0,8,4,13,8v-1,4,-3,9,-9,17v-57,11,-164,6,-219,25v26,32,112,25,173,25v9,0,35,2,35,19v0,9,-4,13,-12,14v-115,12,-146,23,-211,-19v-12,-4,-22,-9,-25,-27v-6,-29,-61,3,-43,-49v17,-1,36,7,42,-12v-32,7,-36,-39,-11,-40v29,14,63,-25,73,-30v52,-25,72,-44,142,-44v23,0,21,41,-1,39v-35,-3,-61,9,-102,31v2,2,5,4,8,4v18,-6,101,-9,115,-9v7,0,55,13,31,30",w:312},"€":{d:"308,-133r-200,16v-2,1,-6,4,-10,10v70,-2,144,-14,211,-8v3,0,8,4,13,8v-1,4,-3,9,-9,17v-57,11,-164,6,-219,25v26,32,112,25,173,25v9,0,35,2,35,19v0,9,-4,13,-12,14v-115,12,-146,23,-211,-19v-12,-4,-22,-9,-25,-27v-6,-29,-61,3,-43,-49v17,-1,36,7,42,-12v-32,7,-36,-39,-11,-40v29,14,63,-25,73,-30v52,-25,72,-44,142,-44v23,0,21,41,-1,39v-35,-3,-61,9,-102,31v2,2,5,4,8,4v18,-6,101,-9,115,-9v7,0,55,13,31,30",w:312},"‹":{d:"64,-107v9,17,86,17,87,43v0,11,-4,16,-13,16v-36,-11,-70,-22,-109,-31v-19,-4,-18,-14,-9,-36v59,-56,93,-84,101,-84v17,0,19,20,13,29",w:159},"›":{d:"41,-181v26,27,112,44,70,91r-82,60v-20,3,-25,-23,-13,-32r70,-51r-66,-46v-5,-6,-4,-28,5,-29v4,2,9,4,16,7",w:137},"":{d:"74,-74v-6,-24,-70,8,-68,-27v0,-6,6,-20,20,-18v44,6,45,-9,42,-49v7,-40,26,-114,90,-104v48,-2,63,-1,90,30v11,25,4,14,2,44v-7,17,-54,9,-49,-7r8,-21v-5,-13,-22,-9,-43,-11v-56,-6,-63,45,-67,92v-2,21,5,23,22,22v37,-1,80,-9,113,-1v13,31,-9,82,-22,106v-13,10,-26,-6,-22,-25r11,-46v0,-3,-2,-6,-6,-6v-19,0,-47,3,-83,9v-6,1,-9,4,-8,11r12,59v-1,9,-11,30,-23,18v-18,-18,-15,-59,-19,-76",w:272},"":{d:"43,-61v-21,4,-36,2,-39,-15v-4,-35,41,-8,34,-47v4,-59,12,-99,46,-124v11,-42,157,-47,149,13v1,7,-7,15,-13,15v-18,-7,-19,-26,-47,-23v-34,3,-65,6,-79,37v-12,27,-22,52,-21,91v13,9,31,-11,45,-4v32,-15,50,-6,94,-13v12,-30,19,-79,36,-133v1,-5,5,-8,12,-8v44,18,-18,106,-12,144v-9,22,-1,73,-16,104v2,28,-23,28,-37,16v1,-26,9,-48,11,-75v0,-6,-3,-9,-9,-9v-43,0,-83,8,-119,24v8,40,17,33,-7,56v-20,-9,-21,-19,-28,-49",w:283},"‡":{d:"102,-284v16,2,42,-2,33,18v-7,15,-42,1,-38,30v3,3,31,1,30,11v4,15,-29,19,-36,24v-2,18,-4,24,-16,29r-25,-26v-25,7,-53,3,-42,-25v4,-10,70,0,51,-22v-17,4,-41,12,-39,-15v-5,-16,39,-18,44,-20v4,-2,7,-10,10,-24v19,-3,23,6,28,20",w:145},"∙":{d:"57,-77v6,18,-7,21,-19,23v-34,6,-25,-40,-9,-43v18,-3,29,8,28,20",w:67},"‚":{d:"25,63v-26,21,-48,-2,-22,-24v14,-12,35,-40,35,-69v3,-2,3,-11,12,-9v35,17,5,88,-25,102",w:97},"„":{d:"25,63v-26,21,-48,-2,-22,-24v11,-9,36,-41,35,-69v3,-2,4,-12,12,-9v36,14,5,89,-25,102xm84,64v-24,20,-45,-1,-21,-24v21,-20,32,-35,35,-69v3,-2,3,-11,12,-9v36,17,9,86,-26,102",w:135},"‰":{d:"398,-131v58,-1,87,13,72,65v-1,30,-66,63,-99,65v-56,3,-99,-58,-62,-102v2,2,5,2,8,2v20,-16,51,-17,81,-30xm202,-279v33,0,94,-24,95,18v-7,31,-33,27,-54,55v-36,32,-71,74,-112,99v-18,18,-40,34,-51,58v-19,14,-25,37,-56,40v-17,2,-25,-29,-10,-40v15,-11,40,-37,52,-52r87,-72v-51,13,-100,6,-116,-27v1,-5,-6,-30,-9,-36v-3,-5,22,-41,27,-39v29,2,16,34,5,49v0,15,14,23,42,23v42,0,59,-31,28,-38v-17,-4,-53,3,-50,-23v0,-7,1,-12,4,-16v16,-9,36,4,49,5v0,0,23,-4,69,-4xm222,-118v33,-2,55,18,50,57v-29,36,-48,45,-96,50v-27,-5,-56,-17,-58,-51v13,-37,64,-43,104,-56xm335,-61v13,44,101,7,108,-31v-11,-3,-20,-4,-30,-4v-18,-1,-82,18,-78,35xm225,-244v-18,0,-29,-1,-46,3v7,15,6,28,0,43v15,-14,34,-30,46,-46xm164,-53v26,5,59,-10,76,-26v-17,-16,-49,2,-67,14v1,8,-8,6,-9,12",w:485},"Â":{d:"161,-217v20,53,23,124,54,170v-2,20,-34,9,-42,0v-27,-12,-78,-18,-101,-18v-26,6,-29,51,-54,63v-18,-4,-19,-30,-3,-38v5,-9,15,-16,8,-29v1,-12,23,-9,26,-19v6,-10,11,-20,20,-27r70,-121v12,-4,16,4,22,19xm82,-91v17,3,62,7,86,13v-13,-33,-13,-80,-29,-109v-15,30,-38,63,-57,96xm202,-219v-27,-6,-40,-26,-61,-37v-21,7,-39,46,-65,23v-2,-4,-3,-10,-4,-14v19,-4,43,-32,61,-43v27,6,40,22,62,37v12,8,18,17,18,25v0,6,-3,9,-11,9"},"Ê":{d:"49,-160v1,-4,-10,-9,-15,-8v-15,-35,32,-30,57,-31r142,-8v2,1,30,7,40,10v-52,16,-133,17,-190,30v-7,9,-12,24,-15,47v26,10,102,-6,141,3v1,3,1,6,2,10v-36,18,-92,12,-149,21v-11,9,-16,41,-16,51v55,-1,111,-21,168,-13v15,-8,48,1,31,18v-53,16,-130,13,-198,29r-39,-8v-4,-19,17,-53,20,-76v-1,0,-7,-11,-9,-18v18,-7,22,-28,30,-57xm199,-211v-27,-6,-39,-26,-60,-37v-21,7,-40,47,-65,22v-2,-7,-2,-7,-4,-13v18,-5,44,-31,61,-43v27,6,41,22,62,37v12,9,18,17,18,25v0,6,-4,9,-12,9",w:252},"Á":{d:"161,-217v20,53,23,124,54,170v-2,20,-34,9,-42,0v-27,-12,-78,-18,-101,-18v-26,6,-29,51,-54,63v-18,-4,-19,-30,-3,-38v5,-9,15,-16,8,-29v1,-12,23,-9,26,-19v6,-10,11,-20,20,-27r70,-121v12,-4,16,4,22,19xm82,-91v17,3,62,7,86,13v-13,-33,-13,-80,-29,-109v-15,30,-38,63,-57,96xm84,-250v31,-5,83,-53,100,-31v0,5,-11,15,-35,28v-16,5,-51,28,-53,25v-14,1,-16,-11,-12,-22"},"Ë":{d:"49,-160v1,-4,-10,-9,-15,-8v-15,-35,32,-30,57,-31r142,-8v2,1,30,7,40,10v-52,16,-133,17,-190,30v-7,9,-12,24,-15,47v26,10,102,-6,141,3v1,3,1,6,2,10v-36,18,-92,12,-149,21v-11,9,-17,41,-17,51v55,0,112,-21,169,-13v15,-8,48,1,31,18v-53,16,-130,13,-198,29r-39,-8v-3,-21,17,-53,20,-76v-1,0,-7,-11,-9,-18v18,-7,22,-28,30,-57xm191,-236v0,8,-4,13,-12,13v-17,0,-19,-19,-16,-34v18,-1,29,1,28,21xm95,-261v7,3,29,9,28,18v0,7,-9,17,-18,17v-18,0,-26,-25,-10,-35",w:252},"È":{d:"49,-160v1,-4,-10,-9,-15,-8v-15,-35,32,-30,57,-31r142,-8v2,1,30,7,40,10v-52,16,-133,17,-190,30v-7,9,-12,24,-15,47v26,10,102,-6,141,3v1,3,1,6,2,10v-36,18,-92,12,-149,21v-11,9,-16,41,-16,51v55,-1,111,-21,168,-13v15,-8,48,1,31,18v-53,16,-130,13,-198,29r-39,-8v-4,-19,17,-53,20,-76v-1,0,-7,-11,-9,-18v18,-7,22,-28,30,-57xm184,-236v6,9,5,13,0,23v-28,-7,-62,-21,-100,-41v-3,-2,-3,-27,5,-23v34,11,60,25,95,41",w:252},"Í":{d:"26,-5v-9,-6,-9,-12,-9,-36v0,-71,7,-119,21,-144v8,-13,14,-20,19,-20v28,19,-7,89,-10,120v-2,21,-8,47,-14,76v-2,1,-2,0,-7,4xm6,-233v31,-6,83,-53,101,-31v2,11,-80,53,-89,53v-14,1,-14,-11,-12,-22",w:104},"Î":{d:"53,-9v-15,7,-16,-3,-16,-32v0,-71,7,-119,21,-144v8,-13,14,-20,19,-20v28,19,-7,89,-10,120v-2,21,-8,47,-14,76xm137,-209v-27,-6,-40,-26,-61,-37v-8,0,-9,4,-13,10v-11,13,-50,37,-56,0v18,-5,43,-32,61,-43v28,5,40,21,62,36v12,9,18,17,18,25v0,6,-4,9,-11,9",w:144},"Ï":{d:"33,-5v-9,-6,-9,-12,-9,-36v0,-71,8,-119,22,-144v8,-13,14,-20,19,-20v27,20,-11,87,-10,120r-15,76v-1,1,-4,2,-7,4xm111,-222v0,8,-4,12,-12,12v-18,0,-19,-19,-16,-33v18,-1,29,1,28,21xm15,-247v8,2,29,9,28,17v0,21,-37,24,-36,1v0,-7,2,-13,8,-18",w:110},"Ì":{d:"33,-5v-9,-6,-9,-12,-9,-36v0,-71,8,-119,22,-144v8,-13,14,-20,19,-20v27,20,-11,87,-10,120r-15,76v-1,1,-4,2,-7,4xm72,-247v7,6,55,15,36,40v-28,-7,-61,-21,-99,-41v-3,-2,-3,-27,5,-23v18,3,41,17,58,24",w:111},"Ó":{d:"62,-184v78,-31,249,-50,238,74v-6,65,-102,105,-179,115v-77,-7,-152,-71,-101,-149v2,-5,24,-33,42,-40xm279,-120v14,-38,-47,-64,-85,-61v-20,-9,-41,7,-62,0v-11,7,-54,12,-66,24v0,20,-51,35,-38,66v-1,43,50,67,96,67v44,0,162,-55,155,-96xm142,-250v27,-11,47,-32,59,-14v2,11,-80,53,-89,53v-13,1,-15,-11,-12,-21v10,-5,24,-11,42,-18",w:273},"Ô":{d:"62,-184v78,-31,249,-50,238,74v-6,65,-102,105,-179,115v-77,-7,-152,-71,-101,-149v2,-5,24,-33,42,-40xm279,-120v14,-38,-47,-64,-85,-61v-20,-9,-41,7,-62,0v-11,7,-54,12,-66,24v0,20,-51,35,-38,66v-1,43,50,67,96,67v44,0,162,-55,155,-96xm157,-282v17,18,52,34,54,63v-24,12,-52,-36,-53,-29r-42,34v-23,-4,-6,-31,5,-34v1,1,27,-37,36,-34",w:273},"":{d:"231,-188v31,-74,91,-99,188,-116v28,1,6,39,1,51v-20,52,-100,91,-148,126v2,4,6,7,12,10v42,-42,181,-41,166,46v-1,8,-19,8,-28,5v-43,1,-168,42,-106,86v15,16,33,28,61,39v0,10,0,17,-6,22v-8,8,-35,26,-78,51v-52,7,-128,22,-154,-17v-23,-35,-99,-35,-117,-77v-29,-68,25,-149,75,-175v44,-23,89,5,135,13v14,-26,2,-39,-1,-64",w:461},"Ò":{d:"62,-184v78,-31,249,-50,238,74v-6,65,-102,105,-179,115v-77,-7,-152,-71,-101,-149v2,-5,24,-33,42,-40xm279,-120v14,-38,-47,-64,-85,-61v-20,-9,-41,7,-62,0v-11,7,-54,12,-66,24v0,20,-51,35,-38,66v-1,43,50,67,96,67v44,0,162,-55,155,-96xm161,-262v14,10,52,13,37,41v-28,-7,-62,-21,-100,-41v-3,-3,-3,-26,5,-24v16,5,42,17,58,24",w:273},"Ú":{d:"281,-202v6,67,-30,121,-71,152v-3,14,-47,26,-60,39v-41,20,-110,1,-125,-26v-24,-44,-28,-84,-8,-127v12,-26,23,-38,37,-22v-2,2,-3,5,-3,10v-34,26,-30,116,5,134v22,32,86,-1,109,-8v38,-28,104,-64,97,-149v2,-10,7,-8,19,-3xm194,-265v3,-1,11,4,11,6v3,12,-81,52,-89,54v-14,0,-13,-9,-12,-22",w:262},"Û":{d:"281,-202v6,67,-30,121,-71,152v-3,14,-47,26,-60,39v-41,20,-110,1,-125,-26v-24,-44,-28,-84,-8,-127v12,-26,23,-38,37,-22v-2,2,-3,5,-3,10v-34,26,-30,116,5,134v22,32,86,-1,109,-8v38,-28,104,-64,97,-149v2,-10,7,-8,19,-3xm150,-266v24,11,58,27,73,46v0,5,-3,6,-10,6v-28,2,-61,-30,-63,-25v-10,0,-57,40,-69,23v3,-10,-8,-15,8,-19v17,-1,34,-29,61,-31",w:262},"Ù":{d:"281,-202v6,67,-30,121,-71,152v-3,14,-47,26,-60,39v-41,20,-110,1,-125,-26v-24,-44,-28,-84,-8,-127v12,-26,23,-38,37,-22v-2,2,-3,5,-3,10v-34,26,-30,116,5,134v22,32,86,-1,109,-8v38,-28,104,-64,97,-149v2,-10,7,-8,19,-3xm151,-243v14,10,54,14,37,41v-28,-7,-61,-22,-99,-42v-3,-2,-4,-25,4,-23v16,5,42,17,58,24",w:262},"ı":{d:"43,-103v21,4,16,56,11,100v-7,2,-11,1,-20,-5v0,-7,-13,-18,-11,-25v4,-23,-3,-68,20,-70",w:80},"ˆ":{d:"144,-220v-29,0,-41,-27,-63,-39v-8,0,-11,5,-15,11v-17,12,-32,31,-54,13v-2,-5,-3,-9,-4,-14v20,-5,45,-33,64,-45v28,6,43,23,65,38v12,9,19,19,19,27v0,6,-4,9,-12,9",w:165},"˜":{d:"47,-300v26,-21,57,19,72,23v4,0,16,-5,36,-14v24,-10,22,-16,32,-13v3,12,-7,11,-7,23v-27,21,-48,32,-62,32v-3,2,-52,-27,-51,-31v-12,-2,-34,40,-54,33v-4,-13,-8,-18,1,-24v5,-7,16,-15,33,-29",w:186},"¯":{d:"63,-295v28,-7,73,10,105,7v11,1,6,8,5,19v-37,21,-72,11,-136,11v-23,0,-31,-14,-27,-36v12,-15,40,0,53,-1",w:183},"˘":{d:"65,-269v20,-11,45,-31,74,-36v20,30,-42,40,-59,66v-5,6,-11,8,-18,8v-8,-3,-45,-32,-51,-54v5,-24,14,-13,34,1",w:158},"˙":{d:"23,-302v15,-13,32,1,32,18v1,22,-36,29,-39,4v0,0,3,-7,7,-22",w:70},"˚":{d:"23,-225v-43,-24,-11,-85,41,-78v16,2,31,4,46,17v32,54,-41,86,-87,61xm33,-257v2,20,57,11,57,-6v0,-6,-11,-9,-33,-12v-14,-2,-24,13,-24,18",w:123},"¸":{d:"74,16v32,2,49,14,55,36v-3,7,-14,31,-29,33v-28,4,-57,11,-88,14v-19,-6,-13,-31,8,-33v20,-1,59,-5,73,-14v-17,-14,-68,8,-53,-37v9,-10,2,-28,24,-30v8,8,13,17,10,31",w:129},"˝":{d:"91,-249v15,-11,38,-53,57,-29v0,9,0,14,-3,23v-2,3,-20,22,-54,55v-5,5,-10,8,-16,8v-17,2,-6,-22,-7,-31v-1,0,-2,0,-4,1v-17,21,-29,31,-50,27v-5,-18,-3,-15,3,-27v23,-27,40,-46,48,-59v7,-12,31,3,29,9v-1,14,-3,24,-13,31v4,4,9,-1,10,-8",w:151},"˛":{d:"82,-5v-8,12,-16,55,-21,75v0,4,2,7,7,7v6,0,22,-7,50,-20v8,0,12,7,12,20v-2,22,-6,14,-27,30v-15,12,-26,16,-30,16v-47,-8,-59,-14,-56,-75v8,-27,12,-54,25,-77v19,-21,35,15,40,24",w:138},"ˇ":{d:"39,-286v33,46,63,-4,96,-16v6,0,9,6,9,19v0,24,-49,46,-77,46v-32,0,-52,-28,-59,-48v0,-25,23,-17,31,-1",w:153},"\r":{w:179}}}),function(){"use strict"; -function AssertException(message){this.message=message}function assert(exp,message){if(!exp)throw new AssertException(message)}function getCenterX(box){return box.x+box.width/2}function getCenterY(box){return box.y+box.height/2}var DIAGRAM_MARGIN=10,ACTOR_MARGIN=10,ACTOR_PADDING=10,SIGNAL_MARGIN=5,SIGNAL_PADDING=5,NOTE_MARGIN=10,NOTE_PADDING=5,NOTE_OVERLAP=15,TITLE_MARGIN=0,TITLE_PADDING=5,SELF_SIGNAL_WIDTH=20,PLACEMENT=Diagram.PLACEMENT,LINETYPE=Diagram.LINETYPE,ARROWTYPE=Diagram.ARROWTYPE,LINE={stroke:"#000","stroke-width":2},RECT={fill:"#fff"};AssertException.prototype.toString=function(){return"AssertException: "+this.message},String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),Raphael.fn.line=function(x1,y1,x2,y2){return assert(_.all([x1,x2,y1,y2],_.isFinite),"x1,x2,y1,y2 must be numeric"),this.path("M{0},{1} L{2},{3}",x1,y1,x2,y2)},Raphael.fn.wobble=function(x1,y1,x2,y2){assert(_.all([x1,x2,y1,y2],_.isFinite),"x1,x2,y1,y2 must be numeric");var wobble=Math.sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1))/25,r1=Math.random(),r2=Math.random(),xfactor=Math.random()>.5?wobble:-wobble,yfactor=Math.random()>.5?wobble:-wobble,p1={x:(x2-x1)*r1+x1+xfactor,y:(y2-y1)*r1+y1+yfactor},p2={x:(x2-x1)*r2+x1-xfactor,y:(y2-y1)*r2+y1-yfactor};return"C"+p1.x+","+p1.y+" "+p2.x+","+p2.y+" "+x2+","+y2},Raphael.fn.text_bbox=function(text,font){var p;font._obj?p=this.print_center(0,0,text,font._obj,font["font-size"]):(p=this.text(0,0,text),p.attr(font));var bb=p.getBBox();return p.remove(),bb},Raphael.fn.handRect=function(x,y,w,h){return assert(_.all([x,y,w,h],_.isFinite),"x, y, w, h must be numeric"),this.path("M"+x+","+y+this.wobble(x,y,x+w,y)+this.wobble(x+w,y,x+w,y+h)+this.wobble(x+w,y+h,x,y+h)+this.wobble(x,y+h,x,y)).attr(RECT)},Raphael.fn.handLine=function(x1,y1,x2,y2){return assert(_.all([x1,x2,y1,y2],_.isFinite),"x1,x2,y1,y2 must be numeric"),this.path("M"+x1+","+y1+this.wobble(x1,y1,x2,y2))},Raphael.fn.print_center=function(x,y,string,font,size,letter_spacing){var path=this.print(x,y,string,font,size,"baseline",letter_spacing),bb=path.getBBox(),dx=x-bb.x-bb.width/2,dy=y-bb.y-bb.height/2,m=new Raphael.matrix;return m.translate(dx,dy),path.attr("path",Raphael.mapPath(path.attr("path"),m))};var BaseTheme=function(diagram){this.init(diagram)};_.extend(BaseTheme.prototype,{init:function(diagram){this.diagram=diagram,this._paper=void 0,this._font=void 0,this._title=void 0,this._actors_height=0,this._signals_height=0;var a=this.arrow_types={};a[ARROWTYPE.FILLED]="block",a[ARROWTYPE.OPEN]="open";var l=this.line_types={};l[LINETYPE.SOLID]="",l[LINETYPE.DOTTED]="-"},init_paper:function(container){this._paper=new Raphael(container,320,200)},init_font:function(){},draw_line:function(x1,y1,x2,y2){return this._paper.line(x1,y1,x2,y2)},draw_rect:function(x,y,w,h){return this._paper.rect(x,y,w,h)},draw:function(container){var diagram=this.diagram;this.init_paper(container),this.init_font(),this.layout();var title_height=this._title?this._title.height:0;this._paper.setStart(),this._paper.setSize(diagram.width,diagram.height);var y=DIAGRAM_MARGIN+title_height;this.draw_title(),this.draw_actors(y),this.draw_signals(y+this._actors_height),this._paper.setFinish()},layout:function(){function actor_ensure_distance(a,b,d){assert(b>a,"a must be less than or equal to b"),0>a?(b=actors[b],b.x=Math.max(d-b.width/2,b.x)):b>=actors.length?(a=actors[a],a.padding_right=Math.max(d,a.padding_right)):(a=actors[a],a.distances[b]=Math.max(d,a.distances[b]?a.distances[b]:0))}var diagram=this.diagram,paper=this._paper,font=this._font,actors=diagram.actors,signals=diagram.signals;if(diagram.width=0,diagram.height=0,diagram.title){var title=this._title={},bb=paper.text_bbox(diagram.title,font);title.text_bb=bb,title.message=diagram.title,title.width=bb.width+2*(TITLE_PADDING+TITLE_MARGIN),title.height=bb.height+2*(TITLE_PADDING+TITLE_MARGIN),title.x=DIAGRAM_MARGIN,title.y=DIAGRAM_MARGIN,diagram.width+=title.width,diagram.height+=title.height}_.each(actors,function(a){var bb=paper.text_bbox(a.name,font);a.text_bb=bb,a.x=0,a.y=0,a.width=bb.width+2*(ACTOR_PADDING+ACTOR_MARGIN),a.height=bb.height+2*(ACTOR_PADDING+ACTOR_MARGIN),a.distances=[],a.padding_right=0,this._actors_height=Math.max(a.height,this._actors_height)},this),_.each(signals,function(s){var a,b,bb=paper.text_bbox(s.message,font);s.text_bb=bb,s.width=bb.width,s.height=bb.height;var extra_width=0;if("Signal"==s.type)s.width+=2*(SIGNAL_MARGIN+SIGNAL_PADDING),s.height+=2*(SIGNAL_MARGIN+SIGNAL_PADDING),s.isSelf()?(a=s.actorA.index,b=a+1,s.width+=SELF_SIGNAL_WIDTH):(a=Math.min(s.actorA.index,s.actorB.index),b=Math.max(s.actorA.index,s.actorB.index));else{if("Note"!=s.type)throw new Error("Unhandled signal type:"+s.type);if(s.width+=2*(NOTE_MARGIN+NOTE_PADDING),s.height+=2*(NOTE_MARGIN+NOTE_PADDING),extra_width=2*ACTOR_MARGIN,s.placement==PLACEMENT.LEFTOF)b=s.actor.index,a=b-1;else if(s.placement==PLACEMENT.RIGHTOF)a=s.actor.index,b=a+1;else if(s.placement==PLACEMENT.OVER&&s.hasManyActors())a=Math.min(s.actor[0].index,s.actor[1].index),b=Math.max(s.actor[0].index,s.actor[1].index),extra_width=-(2*NOTE_PADDING+2*NOTE_OVERLAP);else if(s.placement==PLACEMENT.OVER)return a=s.actor.index,actor_ensure_distance(a-1,a,s.width/2),actor_ensure_distance(a,a+1,s.width/2),this._signals_height+=s.height,void 0}actor_ensure_distance(a,b,s.width+extra_width),this._signals_height+=s.height},this);var actors_x=0;return _.each(actors,function(a){a.x=Math.max(actors_x,a.x),_.each(a.distances,function(distance,b){"undefined"!=typeof distance&&(b=actors[b],distance=Math.max(distance,a.width/2,b.width/2),b.x=Math.max(b.x,a.x+a.width/2+distance-b.width/2))}),actors_x=a.x+a.width+a.padding_right},this),diagram.width=Math.max(actors_x,diagram.width),diagram.width+=2*DIAGRAM_MARGIN,diagram.height+=2*DIAGRAM_MARGIN+2*this._actors_height+this._signals_height,this},draw_title:function(){var title=this._title;title&&this.draw_text_box(title,title.message,TITLE_MARGIN,TITLE_PADDING,this._font)},draw_actors:function(offsetY){var y=offsetY;_.each(this.diagram.actors,function(a){this.draw_actor(a,y,this._actors_height),this.draw_actor(a,y+this._actors_height+this._signals_height,this._actors_height);var aX=getCenterX(a),line=this.draw_line(aX,y+this._actors_height-ACTOR_MARGIN,aX,y+this._actors_height+ACTOR_MARGIN+this._signals_height);line.attr(LINE)},this)},draw_actor:function(actor,offsetY,height){actor.y=offsetY,actor.height=height,this.draw_text_box(actor,actor.name,ACTOR_MARGIN,ACTOR_PADDING,this._font)},draw_signals:function(offsetY){var y=offsetY;_.each(this.diagram.signals,function(s){"Signal"==s.type?s.isSelf()?this.draw_self_signal(s,y):this.draw_signal(s,y):"Note"==s.type&&this.draw_note(s,y),y+=s.height},this)},draw_self_signal:function(signal,offsetY){assert(signal.isSelf(),"signal must be a self signal");var text_bb=signal.text_bb,aX=getCenterX(signal.actorA),x=aX+SELF_SIGNAL_WIDTH+SIGNAL_PADDING-text_bb.x,y=offsetY+signal.height/2;this.draw_text(x,y,signal.message,this._font);var line,attr=_.extend({},LINE,{"stroke-dasharray":this.line_types[signal.linetype]}),y1=offsetY+SIGNAL_MARGIN,y2=y1+signal.height-SIGNAL_MARGIN;line=this.draw_line(aX,y1,aX+SELF_SIGNAL_WIDTH,y1),line.attr(attr),line=this.draw_line(aX+SELF_SIGNAL_WIDTH,y1,aX+SELF_SIGNAL_WIDTH,y2),line.attr(attr),line=this.draw_line(aX+SELF_SIGNAL_WIDTH,y2,aX,y2),attr["arrow-end"]=this.arrow_types[signal.arrowtype]+"-wide-long",line.attr(attr)},draw_signal:function(signal,offsetY){var aX=getCenterX(signal.actorA),bX=getCenterX(signal.actorB),x=(bX-aX)/2+aX,y=offsetY+SIGNAL_MARGIN+2*SIGNAL_PADDING;this.draw_text(x,y,signal.message,this._font),y=offsetY+signal.height-SIGNAL_MARGIN-SIGNAL_PADDING;var line=this.draw_line(aX,y,bX,y);line.attr(LINE),line.attr({"arrow-end":this.arrow_types[signal.arrowtype]+"-wide-long","stroke-dasharray":this.line_types[signal.linetype]})},draw_note:function(note,offsetY){note.y=offsetY;var actorA=note.hasManyActors()?note.actor[0]:note.actor,aX=getCenterX(actorA);switch(note.placement){case PLACEMENT.RIGHTOF:note.x=aX+ACTOR_MARGIN;break;case PLACEMENT.LEFTOF:note.x=aX-ACTOR_MARGIN-note.width;break;case PLACEMENT.OVER:if(note.hasManyActors()){var bX=getCenterX(note.actor[1]),overlap=NOTE_OVERLAP+NOTE_PADDING;note.x=aX-overlap,note.width=bX+overlap-note.x}else note.x=aX-note.width/2;break;default:throw new Error("Unhandled note placement:"+note.placement)}this.draw_text_box(note,note.message,NOTE_MARGIN,NOTE_PADDING,this._font)},draw_text:function(x,y,text,font){var t,paper=this._paper,f=font||{};f._obj?t=paper.print_center(x,y,text,f._obj,f["font-size"]):(t=paper.text(x,y,text),t.attr(f));var bb=t.getBBox(),r=paper.rect(bb.x,bb.y,bb.width,bb.height);r.attr({fill:"#fff",stroke:"none"}),t.toFront()},draw_text_box:function(box,text,margin,padding,font){var x=box.x+margin,y=box.y+margin,w=box.width-2*margin,h=box.height-2*margin,rect=this.draw_rect(x,y,w,h);rect.attr(LINE),x=getCenterX(box),y=getCenterY(box),this.draw_text(x,y,text,font)}});var RaphaëlTheme=function(diagram){this.init(diagram)};_.extend(RaphaëlTheme.prototype,BaseTheme.prototype,{init_font:function(){this._font={"font-size":16,"font-family":"Andale Mono, monospace"}}});var HandRaphaëlTheme=function(diagram){this.init(diagram)};_.extend(HandRaphaëlTheme.prototype,BaseTheme.prototype,{init_font:function(){this._font={"font-size":16,"font-family":"daniel"},this._font._obj=this._paper.getFont("daniel")},draw_line:function(x1,y1,x2,y2){return this._paper.handLine(x1,y1,x2,y2)},draw_rect:function(x,y,w,h){return this._paper.handRect(x,y,w,h)}});var themes={simple:RaphaëlTheme,hand:HandRaphaëlTheme};Diagram.prototype.drawSVG=function(container,options){var default_options={theme:"hand"};if(options=_.defaults(options||{},default_options),!(options.theme in themes))throw new Error("Unsupported theme: "+options.theme);var drawing=new themes[options.theme](this);drawing.draw(container)}}(); \ No newline at end of file diff --git a/src/main/resources/static/editor.md-master/lib/underscore.min.js b/src/main/resources/static/editor.md-master/lib/underscore.min.js deleted file mode 100644 index 447e19b..0000000 --- a/src/main/resources/static/editor.md-master/lib/underscore.min.js +++ /dev/null @@ -1,5 +0,0 @@ -// Underscore.js 1.8.2 -// http://underscorejs.org -// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors -// Underscore may be freely distributed under the MIT license. -(function(){function n(n){function t(t,r,e,u,i,o){for(;i>=0&&o>i;i+=n){var a=u?u[i]:i;e=r(e,t[a],a,t)}return e}return function(r,e,u,i){e=d(e,i,4);var o=!w(r)&&m.keys(r),a=(o||r).length,c=n>0?0:a-1;return arguments.length<3&&(u=r[o?o[c]:c],c+=n),t(r,e,u,o,c,a)}}function t(n){return function(t,r,e){r=b(r,e);for(var u=null!=t&&t.length,i=n>0?0:u-1;i>=0&&u>i;i+=n)if(r(t[i],i,t))return i;return-1}}function r(n,t){var r=S.length,e=n.constructor,u=m.isFunction(e)&&e.prototype||o,i="constructor";for(m.has(n,i)&&!m.contains(t,i)&&t.push(i);r--;)i=S[r],i in n&&n[i]!==u[i]&&!m.contains(t,i)&&t.push(i)}var e=this,u=e._,i=Array.prototype,o=Object.prototype,a=Function.prototype,c=i.push,l=i.slice,f=o.toString,s=o.hasOwnProperty,p=Array.isArray,h=Object.keys,v=a.bind,g=Object.create,y=function(){},m=function(n){return n instanceof m?n:this instanceof m?void(this._wrapped=n):new m(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=m),exports._=m):e._=m,m.VERSION="1.8.2";var d=function(n,t,r){if(t===void 0)return n;switch(null==r?3:r){case 1:return function(r){return n.call(t,r)};case 2:return function(r,e){return n.call(t,r,e)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,i){return n.call(t,r,e,u,i)}}return function(){return n.apply(t,arguments)}},b=function(n,t,r){return null==n?m.identity:m.isFunction(n)?d(n,t,r):m.isObject(n)?m.matcher(n):m.property(n)};m.iteratee=function(n,t){return b(n,t,1/0)};var x=function(n,t){return function(r){var e=arguments.length;if(2>e||null==r)return r;for(var u=1;e>u;u++)for(var i=arguments[u],o=n(i),a=o.length,c=0;a>c;c++){var l=o[c];t&&r[l]!==void 0||(r[l]=i[l])}return r}},_=function(n){if(!m.isObject(n))return{};if(g)return g(n);y.prototype=n;var t=new y;return y.prototype=null,t},j=Math.pow(2,53)-1,w=function(n){var t=n&&n.length;return"number"==typeof t&&t>=0&&j>=t};m.each=m.forEach=function(n,t,r){t=d(t,r);var e,u;if(w(n))for(e=0,u=n.length;u>e;e++)t(n[e],e,n);else{var i=m.keys(n);for(e=0,u=i.length;u>e;e++)t(n[i[e]],i[e],n)}return n},m.map=m.collect=function(n,t,r){t=b(t,r);for(var e=!w(n)&&m.keys(n),u=(e||n).length,i=Array(u),o=0;u>o;o++){var a=e?e[o]:o;i[o]=t(n[a],a,n)}return i},m.reduce=m.foldl=m.inject=n(1),m.reduceRight=m.foldr=n(-1),m.find=m.detect=function(n,t,r){var e;return e=w(n)?m.findIndex(n,t,r):m.findKey(n,t,r),e!==void 0&&e!==-1?n[e]:void 0},m.filter=m.select=function(n,t,r){var e=[];return t=b(t,r),m.each(n,function(n,r,u){t(n,r,u)&&e.push(n)}),e},m.reject=function(n,t,r){return m.filter(n,m.negate(b(t)),r)},m.every=m.all=function(n,t,r){t=b(t,r);for(var e=!w(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(!t(n[o],o,n))return!1}return!0},m.some=m.any=function(n,t,r){t=b(t,r);for(var e=!w(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(t(n[o],o,n))return!0}return!1},m.contains=m.includes=m.include=function(n,t,r){return w(n)||(n=m.values(n)),m.indexOf(n,t,"number"==typeof r&&r)>=0},m.invoke=function(n,t){var r=l.call(arguments,2),e=m.isFunction(t);return m.map(n,function(n){var u=e?t:n[t];return null==u?u:u.apply(n,r)})},m.pluck=function(n,t){return m.map(n,m.property(t))},m.where=function(n,t){return m.filter(n,m.matcher(t))},m.findWhere=function(n,t){return m.find(n,m.matcher(t))},m.max=function(n,t,r){var e,u,i=-1/0,o=-1/0;if(null==t&&null!=n){n=w(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],e>i&&(i=e)}else t=b(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(u>o||u===-1/0&&i===-1/0)&&(i=n,o=u)});return i},m.min=function(n,t,r){var e,u,i=1/0,o=1/0;if(null==t&&null!=n){n=w(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],i>e&&(i=e)}else t=b(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(o>u||1/0===u&&1/0===i)&&(i=n,o=u)});return i},m.shuffle=function(n){for(var t,r=w(n)?n:m.values(n),e=r.length,u=Array(e),i=0;e>i;i++)t=m.random(0,i),t!==i&&(u[i]=u[t]),u[t]=r[i];return u},m.sample=function(n,t,r){return null==t||r?(w(n)||(n=m.values(n)),n[m.random(n.length-1)]):m.shuffle(n).slice(0,Math.max(0,t))},m.sortBy=function(n,t,r){return t=b(t,r),m.pluck(m.map(n,function(n,r,e){return{value:n,index:r,criteria:t(n,r,e)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var A=function(n){return function(t,r,e){var u={};return r=b(r,e),m.each(t,function(e,i){var o=r(e,i,t);n(u,e,o)}),u}};m.groupBy=A(function(n,t,r){m.has(n,r)?n[r].push(t):n[r]=[t]}),m.indexBy=A(function(n,t,r){n[r]=t}),m.countBy=A(function(n,t,r){m.has(n,r)?n[r]++:n[r]=1}),m.toArray=function(n){return n?m.isArray(n)?l.call(n):w(n)?m.map(n,m.identity):m.values(n):[]},m.size=function(n){return null==n?0:w(n)?n.length:m.keys(n).length},m.partition=function(n,t,r){t=b(t,r);var e=[],u=[];return m.each(n,function(n,r,i){(t(n,r,i)?e:u).push(n)}),[e,u]},m.first=m.head=m.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:m.initial(n,n.length-t)},m.initial=function(n,t,r){return l.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))},m.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:m.rest(n,Math.max(0,n.length-t))},m.rest=m.tail=m.drop=function(n,t,r){return l.call(n,null==t||r?1:t)},m.compact=function(n){return m.filter(n,m.identity)};var k=function(n,t,r,e){for(var u=[],i=0,o=e||0,a=n&&n.length;a>o;o++){var c=n[o];if(w(c)&&(m.isArray(c)||m.isArguments(c))){t||(c=k(c,t,r));var l=0,f=c.length;for(u.length+=f;f>l;)u[i++]=c[l++]}else r||(u[i++]=c)}return u};m.flatten=function(n,t){return k(n,t,!1)},m.without=function(n){return m.difference(n,l.call(arguments,1))},m.uniq=m.unique=function(n,t,r,e){if(null==n)return[];m.isBoolean(t)||(e=r,r=t,t=!1),null!=r&&(r=b(r,e));for(var u=[],i=[],o=0,a=n.length;a>o;o++){var c=n[o],l=r?r(c,o,n):c;t?(o&&i===l||u.push(c),i=l):r?m.contains(i,l)||(i.push(l),u.push(c)):m.contains(u,c)||u.push(c)}return u},m.union=function(){return m.uniq(k(arguments,!0,!0))},m.intersection=function(n){if(null==n)return[];for(var t=[],r=arguments.length,e=0,u=n.length;u>e;e++){var i=n[e];if(!m.contains(t,i)){for(var o=1;r>o&&m.contains(arguments[o],i);o++);o===r&&t.push(i)}}return t},m.difference=function(n){var t=k(arguments,!0,!0,1);return m.filter(n,function(n){return!m.contains(t,n)})},m.zip=function(){return m.unzip(arguments)},m.unzip=function(n){for(var t=n&&m.max(n,"length").length||0,r=Array(t),e=0;t>e;e++)r[e]=m.pluck(n,e);return r},m.object=function(n,t){for(var r={},e=0,u=n&&n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},m.indexOf=function(n,t,r){var e=0,u=n&&n.length;if("number"==typeof r)e=0>r?Math.max(0,u+r):r;else if(r&&u)return e=m.sortedIndex(n,t),n[e]===t?e:-1;if(t!==t)return m.findIndex(l.call(n,e),m.isNaN);for(;u>e;e++)if(n[e]===t)return e;return-1},m.lastIndexOf=function(n,t,r){var e=n?n.length:0;if("number"==typeof r&&(e=0>r?e+r+1:Math.min(e,r+1)),t!==t)return m.findLastIndex(l.call(n,0,e),m.isNaN);for(;--e>=0;)if(n[e]===t)return e;return-1},m.findIndex=t(1),m.findLastIndex=t(-1),m.sortedIndex=function(n,t,r,e){r=b(r,e,1);for(var u=r(t),i=0,o=n.length;o>i;){var a=Math.floor((i+o)/2);r(n[a])i;i++,n+=r)u[i]=n;return u};var O=function(n,t,r,e,u){if(!(e instanceof t))return n.apply(r,u);var i=_(n.prototype),o=n.apply(i,u);return m.isObject(o)?o:i};m.bind=function(n,t){if(v&&n.bind===v)return v.apply(n,l.call(arguments,1));if(!m.isFunction(n))throw new TypeError("Bind must be called on a function");var r=l.call(arguments,2),e=function(){return O(n,e,t,this,r.concat(l.call(arguments)))};return e},m.partial=function(n){var t=l.call(arguments,1),r=function(){for(var e=0,u=t.length,i=Array(u),o=0;u>o;o++)i[o]=t[o]===m?arguments[e++]:t[o];for(;e=e)throw new Error("bindAll must be passed function names");for(t=1;e>t;t++)r=arguments[t],n[r]=m.bind(n[r],n);return n},m.memoize=function(n,t){var r=function(e){var u=r.cache,i=""+(t?t.apply(this,arguments):e);return m.has(u,i)||(u[i]=n.apply(this,arguments)),u[i]};return r.cache={},r},m.delay=function(n,t){var r=l.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},m.defer=m.partial(m.delay,m,1),m.throttle=function(n,t,r){var e,u,i,o=null,a=0;r||(r={});var c=function(){a=r.leading===!1?0:m.now(),o=null,i=n.apply(e,u),o||(e=u=null)};return function(){var l=m.now();a||r.leading!==!1||(a=l);var f=t-(l-a);return e=this,u=arguments,0>=f||f>t?(o&&(clearTimeout(o),o=null),a=l,i=n.apply(e,u),o||(e=u=null)):o||r.trailing===!1||(o=setTimeout(c,f)),i}},m.debounce=function(n,t,r){var e,u,i,o,a,c=function(){var l=m.now()-o;t>l&&l>=0?e=setTimeout(c,t-l):(e=null,r||(a=n.apply(i,u),e||(i=u=null)))};return function(){i=this,u=arguments,o=m.now();var l=r&&!e;return e||(e=setTimeout(c,t)),l&&(a=n.apply(i,u),i=u=null),a}},m.wrap=function(n,t){return m.partial(t,n)},m.negate=function(n){return function(){return!n.apply(this,arguments)}},m.compose=function(){var n=arguments,t=n.length-1;return function(){for(var r=t,e=n[t].apply(this,arguments);r--;)e=n[r].call(this,e);return e}},m.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},m.before=function(n,t){var r;return function(){return--n>0&&(r=t.apply(this,arguments)),1>=n&&(t=null),r}},m.once=m.partial(m.before,2);var F=!{toString:null}.propertyIsEnumerable("toString"),S=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];m.keys=function(n){if(!m.isObject(n))return[];if(h)return h(n);var t=[];for(var e in n)m.has(n,e)&&t.push(e);return F&&r(n,t),t},m.allKeys=function(n){if(!m.isObject(n))return[];var t=[];for(var e in n)t.push(e);return F&&r(n,t),t},m.values=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},m.mapObject=function(n,t,r){t=b(t,r);for(var e,u=m.keys(n),i=u.length,o={},a=0;i>a;a++)e=u[a],o[e]=t(n[e],e,n);return o},m.pairs=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},m.invert=function(n){for(var t={},r=m.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},m.functions=m.methods=function(n){var t=[];for(var r in n)m.isFunction(n[r])&&t.push(r);return t.sort()},m.extend=x(m.allKeys),m.extendOwn=m.assign=x(m.keys),m.findKey=function(n,t,r){t=b(t,r);for(var e,u=m.keys(n),i=0,o=u.length;o>i;i++)if(e=u[i],t(n[e],e,n))return e},m.pick=function(n,t,r){var e,u,i={},o=n;if(null==o)return i;m.isFunction(t)?(u=m.allKeys(o),e=d(t,r)):(u=k(arguments,!1,!1,1),e=function(n,t,r){return t in r},o=Object(o));for(var a=0,c=u.length;c>a;a++){var l=u[a],f=o[l];e(f,l,o)&&(i[l]=f)}return i},m.omit=function(n,t,r){if(m.isFunction(t))t=m.negate(t);else{var e=m.map(k(arguments,!1,!1,1),String);t=function(n,t){return!m.contains(e,t)}}return m.pick(n,t,r)},m.defaults=x(m.allKeys,!0),m.clone=function(n){return m.isObject(n)?m.isArray(n)?n.slice():m.extend({},n):n},m.tap=function(n,t){return t(n),n},m.isMatch=function(n,t){var r=m.keys(t),e=r.length;if(null==n)return!e;for(var u=Object(n),i=0;e>i;i++){var o=r[i];if(t[o]!==u[o]||!(o in u))return!1}return!0};var E=function(n,t,r,e){if(n===t)return 0!==n||1/n===1/t;if(null==n||null==t)return n===t;n instanceof m&&(n=n._wrapped),t instanceof m&&(t=t._wrapped);var u=f.call(n);if(u!==f.call(t))return!1;switch(u){case"[object RegExp]":case"[object String]":return""+n==""+t;case"[object Number]":return+n!==+n?+t!==+t:0===+n?1/+n===1/t:+n===+t;case"[object Date]":case"[object Boolean]":return+n===+t}var i="[object Array]"===u;if(!i){if("object"!=typeof n||"object"!=typeof t)return!1;var o=n.constructor,a=t.constructor;if(o!==a&&!(m.isFunction(o)&&o instanceof o&&m.isFunction(a)&&a instanceof a)&&"constructor"in n&&"constructor"in t)return!1}r=r||[],e=e||[];for(var c=r.length;c--;)if(r[c]===n)return e[c]===t;if(r.push(n),e.push(t),i){if(c=n.length,c!==t.length)return!1;for(;c--;)if(!E(n[c],t[c],r,e))return!1}else{var l,s=m.keys(n);if(c=s.length,m.keys(t).length!==c)return!1;for(;c--;)if(l=s[c],!m.has(t,l)||!E(n[l],t[l],r,e))return!1}return r.pop(),e.pop(),!0};m.isEqual=function(n,t){return E(n,t)},m.isEmpty=function(n){return null==n?!0:w(n)&&(m.isArray(n)||m.isString(n)||m.isArguments(n))?0===n.length:0===m.keys(n).length},m.isElement=function(n){return!(!n||1!==n.nodeType)},m.isArray=p||function(n){return"[object Array]"===f.call(n)},m.isObject=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},m.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(n){m["is"+n]=function(t){return f.call(t)==="[object "+n+"]"}}),m.isArguments(arguments)||(m.isArguments=function(n){return m.has(n,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(m.isFunction=function(n){return"function"==typeof n||!1}),m.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},m.isNaN=function(n){return m.isNumber(n)&&n!==+n},m.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"===f.call(n)},m.isNull=function(n){return null===n},m.isUndefined=function(n){return n===void 0},m.has=function(n,t){return null!=n&&s.call(n,t)},m.noConflict=function(){return e._=u,this},m.identity=function(n){return n},m.constant=function(n){return function(){return n}},m.noop=function(){},m.property=function(n){return function(t){return null==t?void 0:t[n]}},m.propertyOf=function(n){return null==n?function(){}:function(t){return n[t]}},m.matcher=m.matches=function(n){return n=m.extendOwn({},n),function(t){return m.isMatch(t,n)}},m.times=function(n,t,r){var e=Array(Math.max(0,n));t=d(t,r,1);for(var u=0;n>u;u++)e[u]=t(u);return e},m.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},m.now=Date.now||function(){return(new Date).getTime()};var M={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},N=m.invert(M),I=function(n){var t=function(t){return n[t]},r="(?:"+m.keys(n).join("|")+")",e=RegExp(r),u=RegExp(r,"g");return function(n){return n=null==n?"":""+n,e.test(n)?n.replace(u,t):n}};m.escape=I(M),m.unescape=I(N),m.result=function(n,t,r){var e=null==n?void 0:n[t];return e===void 0&&(e=r),m.isFunction(e)?e.call(n):e};var B=0;m.uniqueId=function(n){var t=++B+"";return n?n+t:t},m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var T=/(.)^/,R={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},q=/\\|'|\r|\n|\u2028|\u2029/g,K=function(n){return"\\"+R[n]};m.template=function(n,t,r){!t&&r&&(t=r),t=m.defaults({},t,m.templateSettings);var e=RegExp([(t.escape||T).source,(t.interpolate||T).source,(t.evaluate||T).source].join("|")+"|$","g"),u=0,i="__p+='";n.replace(e,function(t,r,e,o,a){return i+=n.slice(u,a).replace(q,K),u=a+t.length,r?i+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":e?i+="'+\n((__t=("+e+"))==null?'':__t)+\n'":o&&(i+="';\n"+o+"\n__p+='"),t}),i+="';\n",t.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var o=new Function(t.variable||"obj","_",i)}catch(a){throw a.source=i,a}var c=function(n){return o.call(this,n,m)},l=t.variable||"obj";return c.source="function("+l+"){\n"+i+"}",c},m.chain=function(n){var t=m(n);return t._chain=!0,t};var z=function(n,t){return n._chain?m(t).chain():t};m.mixin=function(n){m.each(m.functions(n),function(t){var r=m[t]=n[t];m.prototype[t]=function(){var n=[this._wrapped];return c.apply(n,arguments),z(this,r.apply(m,n))}})},m.mixin(m),m.each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=i[n];m.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!==n&&"splice"!==n||0!==r.length||delete r[0],z(this,r)}}),m.each(["concat","join","slice"],function(n){var t=i[n];m.prototype[n]=function(){return z(this,t.apply(this._wrapped,arguments))}}),m.prototype.value=function(){return this._wrapped},m.prototype.valueOf=m.prototype.toJSON=m.prototype.value,m.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return m})}).call(this); \ No newline at end of file diff --git a/src/main/resources/static/editor.md-master/plugins/code-block-dialog/code-block-dialog.js b/src/main/resources/static/editor.md-master/plugins/code-block-dialog/code-block-dialog.js deleted file mode 100644 index 4f0d370..0000000 --- a/src/main/resources/static/editor.md-master/plugins/code-block-dialog/code-block-dialog.js +++ /dev/null @@ -1,237 +0,0 @@ -/*! - * Code block dialog plugin for Editor.md - * - * @file code-block-dialog.js - * @author pandao - * @version 1.2.0 - * @updateTime 2015-03-07 - * {@link https://github.com/pandao/editor.md} - * @license MIT - */ - -(function() { - - var factory = function (exports) { - var cmEditor; - var pluginName = "code-block-dialog"; - - // for CodeBlock dialog select - var codeLanguages = exports.codeLanguages = { - asp : ["ASP", "vbscript"], - actionscript : ["ActionScript(3.0)/Flash/Flex", "clike"], - bash : ["Bash/Bat", "shell"], - css : ["CSS", "css"], - c : ["C", "clike"], - cpp : ["C++", "clike"], - csharp : ["C#", "clike"], - coffeescript : ["CoffeeScript", "coffeescript"], - d : ["D", "d"], - dart : ["Dart", "dart"], - delphi : ["Delphi/Pascal", "pascal"], - erlang : ["Erlang", "erlang"], - go : ["Golang", "go"], - groovy : ["Groovy", "groovy"], - html : ["HTML", "text/html"], - java : ["Java", "clike"], - json : ["JSON", "text/json"], - javascript : ["Javascript", "javascript"], - lua : ["Lua", "lua"], - less : ["LESS", "css"], - markdown : ["Markdown", "gfm"], - "objective-c" : ["Objective-C", "clike"], - php : ["PHP", "php"], - perl : ["Perl", "perl"], - python : ["Python", "python"], - r : ["R", "r"], - rst : ["reStructedText", "rst"], - ruby : ["Ruby", "ruby"], - sql : ["SQL", "sql"], - sass : ["SASS/SCSS", "sass"], - shell : ["Shell", "shell"], - scala : ["Scala", "clike"], - swift : ["Swift", "clike"], - vb : ["VB/VBScript", "vb"], - xml : ["XML", "text/xml"], - yaml : ["YAML", "yaml"] - }; - - exports.fn.codeBlockDialog = function() { - - var _this = this; - var cm = this.cm; - var lang = this.lang; - var editor = this.editor; - var settings = this.settings; - var cursor = cm.getCursor(); - var selection = cm.getSelection(); - var classPrefix = this.classPrefix; - var dialogName = classPrefix + pluginName, dialog; - var dialogLang = lang.dialog.codeBlock; - - cm.focus(); - - if (editor.find("." + dialogName).length > 0) - { - dialog = editor.find("." + dialogName); - dialog.find("option:first").attr("selected", "selected"); - dialog.find("textarea").val(selection); - - this.dialogShowMask(dialog); - this.dialogLockScreen(); - dialog.show(); - } - else - { - var dialogHTML = "
        " + - dialogLang.selectLabel + "" + - "
        " + - ""; - - dialog = this.createDialog({ - name : dialogName, - title : dialogLang.title, - width : 780, - height : 565, - mask : settings.dialogShowMask, - drag : settings.dialogDraggable, - content : dialogHTML, - lockScreen : settings.dialogLockScreen, - maskStyle : { - opacity : settings.dialogMaskOpacity, - backgroundColor : settings.dialogMaskBgColor - }, - buttons : { - enter : [lang.buttons.enter, function() { - var codeTexts = this.find("textarea").val(); - var langName = this.find("select").val(); - - if (langName === "") - { - alert(lang.dialog.codeBlock.unselectedLanguageAlert); - return false; - } - - if (codeTexts === "") - { - alert(lang.dialog.codeBlock.codeEmptyAlert); - return false; - } - - langName = (langName === "other") ? "" : langName; - - cm.replaceSelection(["```" + langName, codeTexts, "```"].join("\n")); - - if (langName === "") { - cm.setCursor(cursor.line, cursor.ch + 3); - } - - this.hide().lockScreen(false).hideMask(); - - return false; - }], - cancel : [lang.buttons.cancel, function() { - this.hide().lockScreen(false).hideMask(); - - return false; - }] - } - }); - } - - var langSelect = dialog.find("select"); - - if (langSelect.find("option").length === 1) - { - for (var key in codeLanguages) - { - var codeLang = codeLanguages[key]; - langSelect.append(""); - } - - langSelect.append(""); - } - - var mode = langSelect.find("option:selected").attr("mode"); - - var cmConfig = { - mode : (mode) ? mode : "text/html", - theme : settings.theme, - tabSize : 4, - autofocus : true, - autoCloseTags : true, - indentUnit : 4, - lineNumbers : true, - lineWrapping : true, - extraKeys : {"Ctrl-Q": function(cm){ cm.foldCode(cm.getCursor()); }}, - foldGutter : true, - gutters : ["CodeMirror-linenumbers", "CodeMirror-foldgutter"], - matchBrackets : true, - indentWithTabs : true, - styleActiveLine : true, - styleSelectedText : true, - autoCloseBrackets : true, - showTrailingSpace : true, - highlightSelectionMatches : true - }; - - var textarea = dialog.find("textarea"); - var cmObj = dialog.find(".CodeMirror"); - - if (dialog.find(".CodeMirror").length < 1) - { - cmEditor = exports.$CodeMirror.fromTextArea(textarea[0], cmConfig); - cmObj = dialog.find(".CodeMirror"); - - cmObj.css({ - "float" : "none", - margin : "8px 0", - border : "1px solid #ddd", - fontSize : settings.fontSize, - width : "100%", - height : "390px" - }); - - cmEditor.on("change", function(cm) { - textarea.val(cm.getValue()); - }); - } - else - { - - cmEditor.setValue(cm.getSelection()); - } - - langSelect.change(function(){ - var _mode = $(this).find("option:selected").attr("mode"); - cmEditor.setOption("mode", _mode); - }); - }; - - }; - - // CommonJS/Node.js - if (typeof require === "function" && typeof exports === "object" && typeof module === "object") - { - module.exports = factory; - } - else if (typeof define === "function") // AMD/CMD/Sea.js - { - if (define.amd) { // for Require.js - - define(["editormd"], function(editormd) { - factory(editormd); - }); - - } else { // for Sea.js - define(function(require) { - var editormd = require("./../../editormd"); - factory(editormd); - }); - } - } - else - { - factory(window.editormd); - } - -})(); diff --git a/src/main/resources/static/editor.md-master/plugins/emoji-dialog/emoji-dialog.js b/src/main/resources/static/editor.md-master/plugins/emoji-dialog/emoji-dialog.js deleted file mode 100644 index d43ef20..0000000 --- a/src/main/resources/static/editor.md-master/plugins/emoji-dialog/emoji-dialog.js +++ /dev/null @@ -1,327 +0,0 @@ -/*! - * Emoji dialog plugin for Editor.md - * - * @file emoji-dialog.js - * @author pandao - * @version 1.2.0 - * @updateTime 2015-03-08 - * {@link https://github.com/pandao/editor.md} - * @license MIT - */ - -(function() { - - var factory = function (exports) { - - var $ = jQuery; - var pluginName = "emoji-dialog"; - var emojiTabIndex = 0; - var emojiData = []; - var selecteds = []; - - var logoPrefix = "editormd-logo"; - var logos = [ - logoPrefix, - logoPrefix + "-1x", - logoPrefix + "-2x", - logoPrefix + "-3x", - logoPrefix + "-4x", - logoPrefix + "-5x", - logoPrefix + "-6x", - logoPrefix + "-7x", - logoPrefix + "-8x" - ]; - - var langs = { - "zh-cn" : { - toolbar : { - emoji : "Emoji 表情" - }, - dialog : { - emoji : { - title : "Emoji 表情" - } - } - }, - "zh-tw" : { - toolbar : { - emoji : "Emoji 表情" - }, - dialog : { - emoji : { - title : "Emoji 表情" - } - } - }, - "en" : { - toolbar : { - emoji : "Emoji" - }, - dialog : { - emoji : { - title : "Emoji" - } - } - } - }; - - exports.fn.emojiDialog = function() { - var _this = this; - var cm = this.cm; - var settings = _this.settings; - - if (!settings.emoji) - { - alert("settings.emoji == false"); - return ; - } - - var path = settings.pluginPath + pluginName + "/"; - var editor = this.editor; - var cursor = cm.getCursor(); - var selection = cm.getSelection(); - var classPrefix = this.classPrefix; - - $.extend(true, this.lang, langs[this.lang.name]); - this.setToolbar(); - - var lang = this.lang; - var dialogName = classPrefix + pluginName, dialog; - var dialogLang = lang.dialog.emoji; - - var dialogContent = [ - "
        ", - "
        ", - "
        ", - ].join("\n"); - - cm.focus(); - - if (editor.find("." + dialogName).length > 0) - { - dialog = editor.find("." + dialogName); - - selecteds = []; - dialog.find("a").removeClass("selected"); - - this.dialogShowMask(dialog); - this.dialogLockScreen(); - dialog.show(); - } - else - { - dialog = this.createDialog({ - name : dialogName, - title : dialogLang.title, - width : 800, - height : 475, - mask : settings.dialogShowMask, - drag : settings.dialogDraggable, - content : dialogContent, - lockScreen : settings.dialogLockScreen, - maskStyle : { - opacity : settings.dialogMaskOpacity, - backgroundColor : settings.dialogMaskBgColor - }, - buttons : { - enter : [lang.buttons.enter, function() { - cm.replaceSelection(selecteds.join(" ")); - this.hide().lockScreen(false).hideMask(); - - return false; - }], - cancel : [lang.buttons.cancel, function() { - this.hide().lockScreen(false).hideMask(); - - return false; - }] - } - }); - } - - var category = ["Github emoji", "Twemoji", "Font awesome", "Editor.md logo"]; - var tab = dialog.find("." + classPrefix + "tab"); - - if (tab.html() === "") - { - var head = "
        "; - - tab.append(head); - - var container = "
        "; - - for (var x = 0; x < 4; x++) - { - var display = (x === 0) ? "" : "display:none;"; - container += "
        "; - } - - container += "
        "; - - tab.append(container); - } - - var tabBoxs = tab.find("." + classPrefix + "tab-box"); - var emojiCategories = ["github-emoji", "twemoji", "font-awesome", logoPrefix]; - - var drawTable = function() { - var cname = emojiCategories[emojiTabIndex]; - var $data = emojiData[cname]; - var $tab = tabBoxs.eq(emojiTabIndex); - - if ($tab.html() !== "") { - //console.log("break =>", cname); - return ; - } - - var pagination = function(data, type) { - var rowNumber = (type === "editormd-logo") ? "5" : 20; - var pageTotal = Math.ceil(data.length / rowNumber); - var table = "
        "; - - for (var i = 0; i < pageTotal; i++) - { - var row = "
        "; - - for (var x = 0; x < rowNumber; x++) - { - var emoji = $.trim(data[(i * rowNumber) + x]); - - if (typeof emoji !== "undefined" && emoji !== "") - { - var img = "", icon = ""; - - if (type === "github-emoji") - { - var src = (emoji === "+1") ? "plus1" : emoji; - src = (src === "black_large_square") ? "black_square" : src; - src = (src === "moon") ? "waxing_gibbous_moon" : src; - - src = exports.emoji.path + src + exports.emoji.ext; - img = "\":""; - row += "" + img + ""; - } - else if (type === "twemoji") - { - var twemojiSrc = exports.twemoji.path + emoji + exports.twemoji.ext; - img = "\"twemoji-""; - row += "" + img + ""; - } - else if (type === "font-awesome") - { - icon = ""; - row += "" + icon + ""; - } - else if (type === "editormd-logo") - { - icon = ""; - row += "" + icon + ""; - } - } - else - { - row += ""; - } - } - - row += "
        "; - - table += row; - } - - table += "
        "; - - return table; - }; - - if (emojiTabIndex === 0) - { - for (var i = 0, len = $data.length; i < len; i++) - { - var h4Style = (i === 0) ? " style=\"margin: 0 0 10px;\"" : " style=\"margin: 10px 0;\""; - $tab.append("" + $data[i].category + ""); - $tab.append(pagination($data[i].list, cname)); - } - } - else - { - $tab.append(pagination($data, cname)); - } - - $tab.find("." + classPrefix + "emoji-btn").bind(exports.mouseOrTouch("click", "touchend"), function() { - $(this).toggleClass("selected"); - - if ($(this).hasClass("selected")) - { - selecteds.push($(this).attr("value")); - } - }); - }; - - if (emojiData.length < 1) - { - if (typeof dialog.loading === "function") { - dialog.loading(true); - } - - $.getJSON(path + "emoji.json?temp=" + Math.random(), function(json) { - - if (typeof dialog.loading === "function") { - dialog.loading(false); - } - - emojiData = json; - emojiData[logoPrefix] = logos; - drawTable(); - }); - } - else - { - drawTable(); - } - - tab.find("li").bind(exports.mouseOrTouch("click", "touchend"), function() { - var $this = $(this); - emojiTabIndex = $this.index(); - - $this.addClass("active").siblings().removeClass("active"); - tabBoxs.eq(emojiTabIndex).show().siblings().hide(); - drawTable(); - }); - }; - - }; - - // CommonJS/Node.js - if (typeof require === "function" && typeof exports === "object" && typeof module === "object") - { - module.exports = factory; - } - else if (typeof define === "function") // AMD/CMD/Sea.js - { - if (define.amd) { // for Require.js - - define(["editormd"], function(editormd) { - factory(editormd); - }); - - } else { // for Sea.js - define(function(require) { - var editormd = require("./../../editormd"); - factory(editormd); - }); - } - } - else - { - factory(window.editormd); - } - -})(); diff --git a/src/main/resources/static/editor.md-master/plugins/emoji-dialog/emoji.json b/src/main/resources/static/editor.md-master/plugins/emoji-dialog/emoji.json deleted file mode 100644 index 46d8473..0000000 --- a/src/main/resources/static/editor.md-master/plugins/emoji-dialog/emoji.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "github-emoji" : [ - { - "category" :"People", - "list" : ["bowtie","smile","laughing","blush","smiley","relaxed","smirk","heart_eyes","kissing_heart","kissing_closed_eyes","flushed","relieved","satisfied","grin","wink","stuck_out_tongue_winking_eye","stuck_out_tongue_closed_eyes","grinning","kissing","kissing_smiling_eyes","stuck_out_tongue","sleeping","worried","frowning","anguished","open_mouth","grimacing","confused","hushed","expressionless","unamused","sweat_smile","sweat","disappointed_relieved","weary","pensive","disappointed","confounded","fearful","cold_sweat","persevere","cry","sob","joy","astonished","scream","neckbeard","tired_face","angry","rage","triumph","sleepy","yum","mask","sunglasses","dizzy_face","imp","smiling_imp","neutral_face","no_mouth","innocent","alien","yellow_heart","blue_heart","purple_heart","heart","green_heart","broken_heart","heartbeat","heartpulse","two_hearts","revolving_hearts","cupid","sparkling_heart","sparkles","star","star2","dizzy","boom","collision","anger","exclamation","question","grey_exclamation","grey_question","zzz","dash","sweat_drops","notes","musical_note","fire","hankey","poop","shit","+1","thumbsup","-1","thumbsdown","ok_hand","punch","facepunch","fist","v","wave","hand","raised_hand","open_hands","point_up","point_down","point_left","point_right","raised_hands","pray","point_up_2","clap","muscle","metal","fu","walking","runner","running","couple","family","two_men_holding_hands","two_women_holding_hands","dancer","dancers","ok_woman","no_good","information_desk_person","raising_hand","bride_with_veil","person_with_pouting_face","person_frowning","bow","couplekiss","couple_with_heart","massage","haircut","nail_care","boy","girl","woman","man","baby","older_woman","older_man","person_with_blond_hair","man_with_gua_pi_mao","man_with_turban","construction_worker","cop","angel","princess","smiley_cat","smile_cat","heart_eyes_cat","kissing_cat","smirk_cat","scream_cat","crying_cat_face","joy_cat","pouting_cat","japanese_ogre","japanese_goblin","see_no_evil","hear_no_evil","speak_no_evil","guardsman","skull","feet","lips","kiss","droplet","ear","eyes","nose","tongue","love_letter","bust_in_silhouette","busts_in_silhouette","speech_balloon","thought_balloon","feelsgood","finnadie","goberserk","godmode","hurtrealbad","rage1","rage2","rage3","rage4","suspect","trollface"] - }, - { - "category" :"Nature", - "list" : ["sunny","umbrella","cloud","snowflake","snowman","zap","cyclone","foggy","ocean","cat","dog","mouse","hamster","rabbit","wolf","frog","tiger","koala","bear","pig","pig_nose","cow","boar","monkey_face","monkey","horse","racehorse","camel","sheep","elephant","panda_face","snake","bird","baby_chick","hatched_chick","hatching_chick","chicken","penguin","turtle","bug","honeybee","ant","beetle","snail","octopus","tropical_fish","fish","whale","whale2","dolphin","cow2","ram","rat","water_buffalo","tiger2","rabbit2","dragon","goat","rooster","dog2","pig2","mouse2","ox","dragon_face","blowfish","crocodile","dromedary_camel","leopard","cat2","poodle","paw_prints","bouquet","cherry_blossom","tulip","four_leaf_clover","rose","sunflower","hibiscus","maple_leaf","leaves","fallen_leaf","herb","mushroom","cactus","palm_tree","evergreen_tree","deciduous_tree","chestnut","seedling","blossom","ear_of_rice","shell","globe_with_meridians","sun_with_face","full_moon_with_face","new_moon_with_face","new_moon","waxing_crescent_moon","first_quarter_moon","waxing_gibbous_moon","full_moon","waning_gibbous_moon","last_quarter_moon","waning_crescent_moon","last_quarter_moon_with_face","first_quarter_moon_with_face","moon","earth_africa","earth_americas","earth_asia","volcano","milky_way","partly_sunny","octocat","squirrel"] - }, - { - "category" :"Objects", - "list" : ["bamboo","gift_heart","dolls","school_satchel","mortar_board","flags","fireworks","sparkler","wind_chime","rice_scene","jack_o_lantern","ghost","santa","christmas_tree","gift","bell","no_bell","tanabata_tree","tada","confetti_ball","balloon","crystal_ball","cd","dvd","floppy_disk","camera","video_camera","movie_camera","computer","tv","iphone","phone","telephone","telephone_receiver","pager","fax","minidisc","vhs","sound","speaker","mute","loudspeaker","mega","hourglass","hourglass_flowing_sand","alarm_clock","watch","radio","satellite","loop","mag","mag_right","unlock","lock","lock_with_ink_pen","closed_lock_with_key","key","bulb","flashlight","high_brightness","low_brightness","electric_plug","battery","calling","email","mailbox","postbox","bath","bathtub","shower","toilet","wrench","nut_and_bolt","hammer","seat","moneybag","yen","dollar","pound","euro","credit_card","money_with_wings","e-mail","inbox_tray","outbox_tray","envelope","incoming_envelope","postal_horn","mailbox_closed","mailbox_with_mail","mailbox_with_no_mail","package","door","smoking","bomb","gun","hocho","pill","syringe","page_facing_up","page_with_curl","bookmark_tabs","bar_chart","chart_with_upwards_trend","chart_with_downwards_trend","scroll","clipboard","calendar","date","card_index","file_folder","open_file_folder","scissors","pushpin","paperclip","black_nib","pencil2","straight_ruler","triangular_ruler","closed_book","green_book","blue_book","orange_book","notebook","notebook_with_decorative_cover","ledger","books","bookmark","name_badge","microscope","telescope","newspaper","football","basketball","soccer","baseball","tennis","8ball","rugby_football","bowling","golf","mountain_bicyclist","bicyclist","horse_racing","snowboarder","swimmer","surfer","ski","spades","hearts","clubs","diamonds","gem","ring","trophy","musical_score","musical_keyboard","violin","space_invader","video_game","black_joker","flower_playing_cards","game_die","dart","mahjong","clapper","memo","pencil","book","art","microphone","headphones","trumpet","saxophone","guitar","shoe","sandal","high_heel","lipstick","boot","shirt","tshirt","necktie","womans_clothes","dress","running_shirt_with_sash","jeans","kimono","bikini","ribbon","tophat","crown","womans_hat","mans_shoe","closed_umbrella","briefcase","handbag","pouch","purse","eyeglasses","fishing_pole_and_fish","coffee","tea","sake","baby_bottle","beer","beers","cocktail","tropical_drink","wine_glass","fork_and_knife","pizza","hamburger","fries","poultry_leg","meat_on_bone","spaghetti","curry","fried_shrimp","bento","sushi","fish_cake","rice_ball","rice_cracker","rice","ramen","stew","oden","dango","egg","bread","doughnut","custard","icecream","ice_cream","shaved_ice","birthday","cake","cookie","chocolate_bar","candy","lollipop","honey_pot","apple","green_apple","tangerine","lemon","cherries","grapes","watermelon","strawberry","peach","melon","banana","pear","pineapple","sweet_potato","eggplant","tomato","corn"] - }, - { - "category" :"Places", - "list" : ["house","house_with_garden","school","office","post_office","hospital","bank","convenience_store","love_hotel","hotel","wedding","church","department_store","european_post_office","city_sunrise","city_sunset","japanese_castle","european_castle","tent","factory","tokyo_tower","japan","mount_fuji","sunrise_over_mountains","sunrise","stars","statue_of_liberty","bridge_at_night","carousel_horse","rainbow","ferris_wheel","fountain","roller_coaster","ship","speedboat","boat","sailboat","rowboat","anchor","rocket","airplane","helicopter","steam_locomotive","tram","mountain_railway","bike","aerial_tramway","suspension_railway","mountain_cableway","tractor","blue_car","oncoming_automobile","car","red_car","taxi","oncoming_taxi","articulated_lorry","bus","oncoming_bus","rotating_light","police_car","oncoming_police_car","fire_engine","ambulance","minibus","truck","train","station","train2","bullettrain_front","bullettrain_side","light_rail","monorail","railway_car","trolleybus","ticket","fuelpump","vertical_traffic_light","traffic_light","warning","construction","beginner","atm","slot_machine","busstop","barber","hotsprings","checkered_flag","crossed_flags","izakaya_lantern","moyai","circus_tent","performing_arts","round_pushpin","triangular_flag_on_post","jp","kr","cn","us","fr","es","it","ru","gb","uk","de"] - }, - { - "category" :"Symbols", - "list" : ["one","two","three","four","five","six","seven","eight","nine","keycap_ten","1234","zero","hash","symbols","arrow_backward","arrow_down","arrow_forward","arrow_left","capital_abcd","abcd","abc","arrow_lower_left","arrow_lower_right","arrow_right","arrow_up","arrow_upper_left","arrow_upper_right","arrow_double_down","arrow_double_up","arrow_down_small","arrow_heading_down","arrow_heading_up","leftwards_arrow_with_hook","arrow_right_hook","left_right_arrow","arrow_up_down","arrow_up_small","arrows_clockwise","arrows_counterclockwise","rewind","fast_forward","information_source","ok","twisted_rightwards_arrows","repeat","repeat_one","new","top","up","cool","free","ng","cinema","koko","signal_strength","u5272","u5408","u55b6","u6307","u6708","u6709","u6e80","u7121","u7533","u7a7a","u7981","sa","restroom","mens","womens","baby_symbol","no_smoking","parking","wheelchair","metro","baggage_claim","accept","wc","potable_water","put_litter_in_its_place","secret","congratulations","m","passport_control","left_luggage","customs","ideograph_advantage","cl","sos","id","no_entry_sign","underage","no_mobile_phones","do_not_litter","non-potable_water","no_bicycles","no_pedestrians","children_crossing","no_entry","eight_spoked_asterisk","sparkle","eight_pointed_black_star","heart_decoration","vs","vibration_mode","mobile_phone_off","chart","currency_exchange","aries","taurus","gemini","cancer","leo","virgo","libra","scorpius","sagittarius","capricorn","aquarius","pisces","ophiuchus","six_pointed_star","negative_squared_cross_mark","a","b","ab","o2","diamond_shape_with_a_dot_inside","recycle","end","back","on","soon","clock1","clock130","clock10","clock1030","clock11","clock1130","clock12","clock1230","clock2","clock230","clock3","clock330","clock4","clock430","clock5","clock530","clock6","clock630","clock7","clock730","clock8","clock830","clock9","clock930","heavy_dollar_sign","copyright","registered","tm","x","heavy_exclamation_mark","bangbang","interrobang","o","heavy_multiplication_x","heavy_plus_sign","heavy_minus_sign","heavy_division_sign","white_flower","100","heavy_check_mark","ballot_box_with_check","radio_button","link","curly_loop","wavy_dash","part_alternation_mark","trident","black_small_square","white_small_square","black_medium_small_square","white_medium_small_square","black_medium_square","white_medium_square","black_large_square","white_large_square","white_check_mark","black_square_button","white_square_button","black_circle","white_circle","red_circle","large_blue_circle","large_blue_diamond","large_orange_diamond","small_blue_diamond","small_orange_diamond","small_red_triangle","small_red_triangle_down","shipit"] - } - ], - - "twemoji" : ["1f004","1f0cf","1f170","1f171","1f17e","1f17f","1f18e","1f191","1f192","1f193","1f194","1f195","1f196","1f197","1f198","1f199","1f19a","1f1e6","1f1e7","1f1e8-1f1f3","1f1e8","1f1e9-1f1ea","1f1e9","1f1ea-1f1f8","1f1ea","1f1eb-1f1f7","1f1eb","1f1ec-1f1e7","1f1ec","1f1ed","1f1ee-1f1f9","1f1ee","1f1ef-1f1f5","1f1ef","1f1f0-1f1f7","1f1f0","1f1f1","1f1f2","1f1f3","1f1f4","1f1f5","1f1f6","1f1f7-1f1fa","1f1f7","1f1f8","1f1f9","1f1fa-1f1f8","1f1fa","1f1fb","1f1fc","1f1fd","1f1fe","1f1ff","1f201","1f202","1f21a","1f22f","1f232","1f233","1f234","1f235","1f236","1f237","1f238","1f239","1f23a","1f250","1f251","1f300","1f301","1f302","1f303","1f304","1f305","1f306","1f307","1f308","1f309","1f30a","1f30b","1f30c","1f30d","1f30e","1f30f","1f310","1f311","1f312","1f313","1f314","1f315","1f316","1f317","1f318","1f319","1f31a","1f31b","1f31c","1f31d","1f31e","1f31f","1f320","1f330","1f331","1f332","1f333","1f334","1f335","1f337","1f338","1f339","1f33a","1f33b","1f33c","1f33d","1f33e","1f33f","1f340","1f341","1f342","1f343","1f344","1f345","1f346","1f347","1f348","1f349","1f34a","1f34b","1f34c","1f34d","1f34e","1f34f","1f350","1f351","1f352","1f353","1f354","1f355","1f356","1f357","1f358","1f359","1f35a","1f35b","1f35c","1f35d","1f35e","1f35f","1f360","1f361","1f362","1f363","1f364","1f365","1f366","1f367","1f368","1f369","1f36a","1f36b","1f36c","1f36d","1f36e","1f36f","1f370","1f371","1f372","1f373","1f374","1f375","1f376","1f377","1f378","1f379","1f37a","1f37b","1f37c","1f380","1f381","1f382","1f383","1f384","1f385","1f386","1f387","1f388","1f389","1f38a","1f38b","1f38c","1f38d","1f38e","1f38f","1f390","1f391","1f392","1f393","1f3a0","1f3a1","1f3a2","1f3a3","1f3a4","1f3a5","1f3a6","1f3a7","1f3a8","1f3a9","1f3aa","1f3ab","1f3ac","1f3ad","1f3ae","1f3af","1f3b0","1f3b1","1f3b2","1f3b3","1f3b4","1f3b5","1f3b6","1f3b7","1f3b8","1f3b9","1f3ba","1f3bb","1f3bc","1f3bd","1f3be","1f3bf","1f3c0","1f3c1","1f3c2","1f3c3","1f3c4","1f3c6","1f3c7","1f3c8","1f3c9","1f3ca","1f3e0","1f3e1","1f3e2","1f3e3","1f3e4","1f3e5","1f3e6","1f3e7","1f3e8","1f3e9","1f3ea","1f3eb","1f3ec","1f3ed","1f3ee","1f3ef","1f3f0","1f400","1f401","1f402","1f403","1f404","1f405","1f406","1f407","1f408","1f409","1f40a","1f40b","1f40c","1f40d","1f40e","1f40f","1f410","1f411","1f412","1f413","1f414","1f415","1f416","1f417","1f418","1f419","1f41a","1f41b","1f41c","1f41d","1f41e","1f41f","1f420","1f421","1f422","1f423","1f424","1f425","1f426","1f427","1f428","1f429","1f42a","1f42b","1f42c","1f42d","1f42e","1f42f","1f430","1f431","1f432","1f433","1f434","1f435","1f436","1f437","1f438","1f439","1f43a","1f43b","1f43c","1f43d","1f43e","1f440","1f442","1f443","1f444","1f445","1f446","1f447","1f448","1f449","1f44a","1f44b","1f44c","1f44d","1f44e","1f44f","1f450","1f451","1f452","1f453","1f454","1f455","1f456","1f457","1f458","1f459","1f45a","1f45b","1f45c","1f45d","1f45e","1f45f","1f460","1f461","1f462","1f463","1f464","1f465","1f466","1f467","1f468","1f469","1f46a","1f46b","1f46c","1f46d","1f46e","1f46f","1f470","1f471","1f472","1f473","1f474","1f475","1f476","1f477","1f478","1f479","1f47a","1f47b","1f47c","1f47d","1f47e","1f47f","1f480","1f481","1f482","1f483","1f484","1f485","1f486","1f487","1f488","1f489","1f48a","1f48b","1f48c","1f48d","1f48e","1f48f","1f490","1f491","1f492","1f493","1f494","1f495","1f496","1f497","1f498","1f499","1f49a","1f49b","1f49c","1f49d","1f49e","1f49f","1f4a0","1f4a1","1f4a2","1f4a3","1f4a4","1f4a5","1f4a6","1f4a7","1f4a8","1f4a9","1f4aa","1f4ab","1f4ac","1f4ad","1f4ae","1f4af","1f4b0","1f4b1","1f4b2","1f4b3","1f4b4","1f4b5","1f4b6","1f4b7","1f4b8","1f4b9","1f4ba","1f4bb","1f4bc","1f4bd","1f4be","1f4bf","1f4c0","1f4c1","1f4c2","1f4c3","1f4c4","1f4c5","1f4c6","1f4c7","1f4c8","1f4c9","1f4ca","1f4cb","1f4cc","1f4cd","1f4ce","1f4cf","1f4d0","1f4d1","1f4d2","1f4d3","1f4d4","1f4d5","1f4d6","1f4d7","1f4d8","1f4d9","1f4da","1f4db","1f4dc","1f4dd","1f4de","1f4df","1f4e0","1f4e1","1f4e2","1f4e3","1f4e4","1f4e5","1f4e6","1f4e7","1f4e8","1f4e9","1f4ea","1f4eb","1f4ec","1f4ed","1f4ee","1f4ef","1f4f0","1f4f1","1f4f2","1f4f3","1f4f4","1f4f5","1f4f6","1f4f7","1f4f9","1f4fa","1f4fb","1f4fc","1f500","1f501","1f502","1f503","1f504","1f505","1f506","1f507","1f508","1f509","1f50a","1f50b","1f50c","1f50d","1f50e","1f50f","1f510","1f511","1f512","1f513","1f514","1f515","1f516","1f517","1f518","1f519","1f51a","1f51b","1f51c","1f51d","1f51e","1f51f","1f520","1f521","1f522","1f523","1f524","1f525","1f526","1f527","1f528","1f529","1f52a","1f52b","1f52c","1f52d","1f52e","1f52f","1f530","1f531","1f532","1f533","1f534","1f535","1f536","1f537","1f538","1f539","1f53a","1f53b","1f53c","1f53d","1f550","1f551","1f552","1f553","1f554","1f555","1f556","1f557","1f558","1f559","1f55a","1f55b","1f55c","1f55d","1f55e","1f55f","1f560","1f561","1f562","1f563","1f564","1f565","1f566","1f567","1f5fb","1f5fc","1f5fd","1f5fe","1f5ff","1f600","1f601","1f602","1f603","1f604","1f605","1f606","1f607","1f608","1f609","1f60a","1f60b","1f60c","1f60d","1f60e","1f60f","1f610","1f611","1f612","1f613","1f614","1f615","1f616","1f617","1f618","1f619","1f61a","1f61b","1f61c","1f61d","1f61e","1f61f","1f620","1f621","1f622","1f623","1f624","1f625","1f626","1f627","1f628","1f629","1f62a","1f62b","1f62c","1f62d","1f62e","1f62f","1f630","1f631","1f632","1f633","1f634","1f635","1f636","1f637","1f638","1f639","1f63a","1f63b","1f63c","1f63d","1f63e","1f63f","1f640","1f645","1f646","1f647","1f648","1f649","1f64a","1f64b","1f64c","1f64d","1f64e","1f64f","1f680","1f681","1f682","1f683","1f684","1f685","1f686","1f687","1f688","1f689","1f68a","1f68b","1f68c","1f68d","1f68e","1f68f","1f690","1f691","1f692","1f693","1f694","1f695","1f696","1f697","1f698","1f699","1f69a","1f69b","1f69c","1f69d","1f69e","1f69f","1f6a0","1f6a1","1f6a2","1f6a3","1f6a4","1f6a5","1f6a6","1f6a7","1f6a8","1f6a9","1f6aa","1f6ab","1f6ac","1f6ad","1f6ae","1f6af","1f6b0","1f6b1","1f6b2","1f6b3","1f6b4","1f6b5","1f6b6","1f6b7","1f6b8","1f6b9","1f6ba","1f6bb","1f6bc","1f6bd","1f6be","1f6bf","1f6c0","1f6c1","1f6c2","1f6c3","1f6c4","1f6c5","203c","2049","2122","2139","2194","2195","2196","2197","2198","2199","21a9","21aa","23-20e3","231a","231b","23e9","23ea","23eb","23ec","23f0","23f3","24c2","25aa","25ab","25b6","25c0","25fb","25fc","25fd","25fe","2600","2601","260e","2611","2614","2615","261d","263a","2648","2649","264a","264b","264c","264d","264e","264f","2650","2651","2652","2653","2660","2663","2665","2666","2668","267b","267f","2693","26a0","26a1","26aa","26ab","26bd","26be","26c4","26c5","26ce","26d4","26ea","26f2","26f3","26f5","26fa","26fd","2702","2705","2708","2709","270a","270b","270c","270f","2712","2714","2716","2728","2733","2734","2744","2747","274c","274e","2753","2754","2755","2757","2764","2795","2796","2797","27a1","27b0","27bf","2934","2935","2b05","2b06","2b07","2b1b","2b1c","2b50","2b55","30-20e3","3030","303d","31-20e3","32-20e3","3297","3299","33-20e3","34-20e3","35-20e3","36-20e3","37-20e3","38-20e3","39-20e3","a9","ae","e50a"], - - "font-awesome" : ["glass","music","search","envelope-o","heart","star","star-o","user","film","th-large","th","th-list","check","times","search-plus","search-minus","power-off","signal","cog","trash-o","home","file-o","clock-o","road","download","arrow-circle-o-down","arrow-circle-o-up","inbox","play-circle-o","repeat","refresh","list-alt","lock","flag","headphones","volume-off","volume-down","volume-up","qrcode","barcode","tag","tags","book","bookmark","print","camera","font","bold","italic","text-height","text-width","align-left","align-center","align-right","align-justify","list","outdent","indent","video-camera","picture-o","pencil","map-marker","adjust","tint","pencil-square-o","share-square-o","check-square-o","arrows","step-backward","fast-backward","backward","play","pause","stop","forward","fast-forward","step-forward","eject","chevron-left","chevron-right","plus-circle","minus-circle","times-circle","check-circle","question-circle","info-circle","crosshairs","times-circle-o","check-circle-o","ban","arrow-left","arrow-right","arrow-up","arrow-down","share","expand","compress","plus","minus","asterisk","exclamation-circle","gift","leaf","fire","eye","eye-slash","exclamation-triangle","plane","calendar","random","comment","magnet","chevron-up","chevron-down","retweet","shopping-cart","folder","folder-open","arrows-v","arrows-h","bar-chart","twitter-square","facebook-square","camera-retro","key","cogs","comments","thumbs-o-up","thumbs-o-down","star-half","heart-o","sign-out","linkedin-square","thumb-tack","external-link","sign-in","trophy","github-square","upload","lemon-o","phone","square-o","bookmark-o","phone-square","twitter","facebook","github","unlock","credit-card","rss","hdd-o","bullhorn","bell","certificate","hand-o-right","hand-o-left","hand-o-up","hand-o-down","arrow-circle-left","arrow-circle-right","arrow-circle-up","arrow-circle-down","globe","wrench","tasks","filter","briefcase","arrows-alt","users","link","cloud","flask","scissors","files-o","paperclip","floppy-o","square","bars","list-ul","list-ol","strikethrough","underline","table","magic","truck","pinterest","pinterest-square","google-plus-square","google-plus","money","caret-down","caret-up","caret-left","caret-right","columns","sort","sort-desc","sort-asc","envelope","linkedin","undo","gavel","tachometer","comment-o","comments-o","bolt","sitemap","umbrella","clipboard","lightbulb-o","exchange","cloud-download","cloud-upload","user-md","stethoscope","suitcase","bell-o","coffee","cutlery","file-text-o","building-o","hospital-o","ambulance","medkit","fighter-jet","beer","h-square","plus-square","angle-double-left","angle-double-right","angle-double-up","angle-double-down","angle-left","angle-right","angle-up","angle-down","desktop","laptop","tablet","mobile","circle-o","quote-left","quote-right","spinner","circle","reply","github-alt","folder-o","folder-open-o","smile-o","frown-o","meh-o","gamepad","keyboard-o","flag-o","flag-checkered","terminal","code","reply-all","star-half-o","location-arrow","crop","code-fork","chain-broken","question","info","exclamation","superscript","subscript","eraser","puzzle-piece","microphone","microphone-slash","shield","calendar-o","fire-extinguisher","rocket","maxcdn","chevron-circle-left","chevron-circle-right","chevron-circle-up","chevron-circle-down","html5","css3","anchor","unlock-alt","bullseye","ellipsis-h","ellipsis-v","rss-square","play-circle","ticket","minus-square","minus-square-o","level-up","level-down","check-square","pencil-square","share-square","compass","caret-square-o-down","caret-square-o-up","caret-square-o-right","eur","gbp","usd","inr","jpy","rub","krw","btc","file","file-text","sort-alpha-asc","sort-alpha-desc","sort-amount-asc","sort-amount-desc","sort-numeric-asc","sort-numeric-desc","thumbs-up","thumbs-down","youtube-square","youtube","xing","xing-square","youtube-play","dropbox","stack-overflow","instagram","flickr","adn","bitbucket","bitbucket-square","tumblr","tumblr-square","long-arrow-down","long-arrow-up","long-arrow-left","long-arrow-right","apple","windows","android","linux","dribbble","skype","foursquare","trello","female","male","gratipay","sun-o","moon-o","archive","bug","vk","weibo","renren","pagelines","stack-exchange","arrow-circle-o-right","arrow-circle-o-left","caret-square-o-left","dot-circle-o","wheelchair","vimeo-square","try","plus-square-o","space-shuttle","slack","envelope-square","wordpress","openid","university","graduation-cap","yahoo","google","reddit","reddit-square","stumbleupon-circle","stumbleupon","delicious","digg","pied-piper","pied-piper-alt","drupal","joomla","language","fax","building","child","paw","spoon","cube","cubes","behance","behance-square","steam","steam-square","recycle","car","taxi","tree","spotify","deviantart","soundcloud","database","file-pdf-o","file-word-o","file-excel-o","file-powerpoint-o","file-image-o","file-archive-o","file-audio-o","file-video-o","file-code-o","vine","codepen","jsfiddle","life-ring","circle-o-notch","rebel","empire","git-square","git","hacker-news","tencent-weibo","qq","weixin","paper-plane","paper-plane-o","history","circle-thin","header","paragraph","sliders","share-alt","share-alt-square","bomb","futbol-o","tty","binoculars","plug","slideshare","twitch","yelp","newspaper-o","wifi","calculator","paypal","google-wallet","cc-visa","cc-mastercard","cc-discover","cc-amex","cc-paypal","cc-stripe","bell-slash","bell-slash-o","trash","copyright","at","eyedropper","paint-brush","birthday-cake","area-chart","pie-chart","line-chart","lastfm","lastfm-square","toggle-off","toggle-on","bicycle","bus","ioxhost","angellist","cc","ils","meanpath","buysellads","connectdevelop","dashcube","forumbee","leanpub","sellsy","shirtsinbulk","simplybuilt","skyatlas","cart-plus","cart-arrow-down","diamond","ship","user-secret","motorcycle","street-view","heartbeat","venus","mars","mercury","transgender","transgender-alt","venus-double","mars-double","venus-mars","mars-stroke","mars-stroke-v","mars-stroke-h","neuter","facebook-official","pinterest-p","whatsapp","server","user-plus","user-times","bed","viacoin","train","subway","medium","GitHub","bed","buysellads","cart-arrow-down","cart-plus","connectdevelop","dashcube","diamond","facebook-official","forumbee","heartbeat","hotel","leanpub","mars","mars-double","mars-stroke","mars-stroke-h","mars-stroke-v","medium","mercury","motorcycle","neuter","pinterest-p","sellsy","server","ship","shirtsinbulk","simplybuilt","skyatlas","street-view","subway","train","transgender","transgender-alt","user-plus","user-secret","user-times","venus","venus-double","venus-mars","viacoin","whatsapp","adjust","anchor","archive","area-chart","arrows","arrows-h","arrows-v","asterisk","at","automobile","ban","bank","bar-chart","bar-chart-o","barcode","bars","bed","beer","bell","bell-o","bell-slash","bell-slash-o","bicycle","binoculars","birthday-cake","bolt","bomb","book","bookmark","bookmark-o","briefcase","bug","building","building-o","bullhorn","bullseye","bus","cab","calculator","calendar","calendar-o","camera","camera-retro","car","caret-square-o-down","caret-square-o-left","caret-square-o-right","caret-square-o-up","cart-arrow-down","cart-plus","cc","certificate","check","check-circle","check-circle-o","check-square","check-square-o","child","circle","circle-o","circle-o-notch","circle-thin","clock-o","close","cloud","cloud-download","cloud-upload","code","code-fork","coffee","cog","cogs","comment","comment-o","comments","comments-o","compass","copyright","credit-card","crop","crosshairs","cube","cubes","cutlery","dashboard","database","desktop","diamond","dot-circle-o","download","edit","ellipsis-h","ellipsis-v","envelope","envelope-o","envelope-square","eraser","exchange","exclamation","exclamation-circle","exclamation-triangle","external-link","external-link-square","eye","eye-slash","eyedropper","fax","female","fighter-jet","file-archive-o","file-audio-o","file-code-o","file-excel-o","file-image-o","file-movie-o","file-pdf-o","file-photo-o","file-picture-o","file-powerpoint-o","file-sound-o","file-video-o","file-word-o","file-zip-o","film","filter","fire","fire-extinguisher","flag","flag-checkered","flag-o","flash","flask","folder","folder-o","folder-open","folder-open-o","frown-o","futbol-o","gamepad","gavel","gear","gears","genderless","gift","glass","globe","graduation-cap","group","hdd-o","headphones","heart","heart-o","heartbeat","history","home","hotel","image","inbox","info","info-circle","institution","key","keyboard-o","language","laptop","leaf","legal","lemon-o","level-down","level-up","life-bouy","life-buoy","life-ring","life-saver","lightbulb-o","line-chart","location-arrow","lock","magic","magnet","mail-forward","mail-reply","mail-reply-all","male","map-marker","meh-o","microphone","microphone-slash","minus","minus-circle","minus-square","minus-square-o","mobile","mobile-phone","money","moon-o","mortar-board","motorcycle","music","navicon","newspaper-o","paint-brush","paper-plane","paper-plane-o","paw","pencil","pencil-square","pencil-square-o","phone","phone-square","photo","picture-o","pie-chart","plane","plug","plus","plus-circle","plus-square","plus-square-o","power-off","print","puzzle-piece","qrcode","question","question-circle","quote-left","quote-right","random","recycle","refresh","remove","reorder","reply","reply-all","retweet","road","rocket","rss","rss-square","search","search-minus","search-plus","send","send-o","server","share","share-alt","share-alt-square","share-square","share-square-o","shield","ship","shopping-cart","sign-in","sign-out","signal","sitemap","sliders","smile-o","soccer-ball-o","sort","sort-alpha-asc","sort-alpha-desc","sort-amount-asc","sort-amount-desc","sort-asc","sort-desc","sort-down","sort-numeric-asc","sort-numeric-desc","sort-up","space-shuttle","spinner","spoon","square","square-o","star","star-half","star-half-empty","star-half-full","star-half-o","star-o","street-view","suitcase","sun-o","support","tablet","tachometer","tag","tags","tasks","taxi","terminal","thumb-tack","thumbs-down","thumbs-o-down","thumbs-o-up","thumbs-up","ticket","times","times-circle","times-circle-o","tint","toggle-down","toggle-left","toggle-off","toggle-on","toggle-right","toggle-up","trash","trash-o","tree","trophy","truck","tty","umbrella","university","unlock","unlock-alt","unsorted","upload","user","user-plus","user-secret","user-times","users","video-camera","volume-down","volume-off","volume-up","warning","wheelchair","wifi","wrench","ambulance","automobile","bicycle","bus","cab","car","fighter-jet","motorcycle","plane","rocket","ship","space-shuttle","subway","taxi","train","truck","wheelchair","circle-thin","genderless","mars","mars-double","mars-stroke","mars-stroke-h","mars-stroke-v","mercury","neuter","transgender","transgender-alt","venus","venus-double","venus-mars","file","file-archive-o","file-audio-o","file-code-o","file-excel-o","file-image-o","file-movie-o","file-o","file-pdf-o","file-photo-o","file-picture-o","file-powerpoint-o","file-sound-o","file-text","file-text-o","file-video-o","file-word-o","file-zip-o","circle-o-notch","cog","gear","refresh","spinner","check-square","check-square-o","circle","circle-o","dot-circle-o","minus-square","minus-square-o","plus-square","plus-square-o","square","square-o","cc-amex","cc-discover","cc-mastercard","cc-paypal","cc-stripe","cc-visa","credit-card","google-wallet","paypal","area-chart","bar-chart","bar-chart-o","line-chart","pie-chart","bitcoin","btc","cny","dollar","eur","euro","gbp","ils","inr","jpy","krw","money","rmb","rouble","rub","ruble","rupee","shekel","sheqel","try","turkish-lira","usd","won","yen","align-center","align-justify","align-left","align-right","bold","chain","chain-broken","clipboard","columns","copy","cut","dedent","eraser","file","file-o","file-text","file-text-o","files-o","floppy-o","font","header","indent","italic","link","list","list-alt","list-ol","list-ul","outdent","paperclip","paragraph","paste","repeat","rotate-left","rotate-right","save","scissors","strikethrough","subscript","superscript","table","text-height","text-width","th","th-large","th-list","underline","undo","unlink","angle-double-down","angle-double-left","angle-double-right","angle-double-up","angle-down","angle-left","angle-right","angle-up","arrow-circle-down","arrow-circle-left","arrow-circle-o-down","arrow-circle-o-left","arrow-circle-o-right","arrow-circle-o-up","arrow-circle-right","arrow-circle-up","arrow-down","arrow-left","arrow-right","arrow-up","arrows","arrows-alt","arrows-h","arrows-v","caret-down","caret-left","caret-right","caret-square-o-down","caret-square-o-left","caret-square-o-right","caret-square-o-up","caret-up","chevron-circle-down","chevron-circle-left","chevron-circle-right","chevron-circle-up","chevron-down","chevron-left","chevron-right","chevron-up","hand-o-down","hand-o-left","hand-o-right","hand-o-up","long-arrow-down","long-arrow-left","long-arrow-right","long-arrow-up","toggle-down","toggle-left","toggle-right","toggle-up","arrows-alt","backward","compress","eject","expand","fast-backward","fast-forward","forward","pause","play","play-circle","play-circle-o","step-backward","step-forward","stop","youtube-play","report an issue with Adblock Plus","adn","android","angellist","apple","behance","behance-square","bitbucket","bitbucket-square","bitcoin","btc","buysellads","cc-amex","cc-discover","cc-mastercard","cc-paypal","cc-stripe","cc-visa","codepen","connectdevelop","css3","dashcube","delicious","deviantart","digg","dribbble","dropbox","drupal","empire","facebook","facebook-f","facebook-official","facebook-square","flickr","forumbee","foursquare","ge","git","git-square","github","github-alt","github-square","gittip","google","google-plus","google-plus-square","google-wallet","gratipay","hacker-news","html5","instagram","ioxhost","joomla","jsfiddle","lastfm","lastfm-square","leanpub","linkedin","linkedin-square","linux","maxcdn","meanpath","medium","openid","pagelines","paypal","pied-piper","pied-piper-alt","pinterest","pinterest-p","pinterest-square","qq","ra","rebel","reddit","reddit-square","renren","sellsy","share-alt","share-alt-square","shirtsinbulk","simplybuilt","skyatlas","skype","slack","slideshare","soundcloud","spotify","stack-exchange","stack-overflow","steam","steam-square","stumbleupon","stumbleupon-circle","tencent-weibo","trello","tumblr","tumblr-square","twitch","twitter","twitter-square","viacoin","vimeo-square","vine","vk","wechat","weibo","weixin","whatsapp","windows","wordpress","xing","xing-square","yahoo","yelp","youtube","youtube-play","youtube-square","ambulance","h-square","heart","heart-o","heartbeat","hospital-o","medkit","plus-square","stethoscope","user-md","wheelchair"] -} \ No newline at end of file diff --git a/src/main/resources/static/editor.md-master/plugins/goto-line-dialog/goto-line-dialog.js b/src/main/resources/static/editor.md-master/plugins/goto-line-dialog/goto-line-dialog.js deleted file mode 100644 index f875743..0000000 --- a/src/main/resources/static/editor.md-master/plugins/goto-line-dialog/goto-line-dialog.js +++ /dev/null @@ -1,157 +0,0 @@ -/*! - * Goto line dialog plugin for Editor.md - * - * @file goto-line-dialog.js - * @author pandao - * @version 1.2.1 - * @updateTime 2015-06-09 - * {@link https://github.com/pandao/editor.md} - * @license MIT - */ - -(function() { - - var factory = function (exports) { - - var $ = jQuery; - var pluginName = "goto-line-dialog"; - - var langs = { - "zh-cn" : { - toolbar : { - "goto-line" : "跳转到行" - }, - dialog : { - "goto-line" : { - title : "跳转到行", - label : "请输入行号", - error : "错误:" - } - } - }, - "zh-tw" : { - toolbar : { - "goto-line" : "跳轉到行" - }, - dialog : { - "goto-line" : { - title : "跳轉到行", - label : "請輸入行號", - error : "錯誤:" - } - } - }, - "en" : { - toolbar : { - "goto-line" : "Goto line" - }, - dialog : { - "goto-line" : { - title : "Goto line", - label : "Enter a line number, range ", - error : "Error: " - } - } - } - }; - - exports.fn.gotoLineDialog = function() { - var _this = this; - var cm = this.cm; - var editor = this.editor; - var settings = this.settings; - var path = settings.pluginPath + pluginName +"/"; - var classPrefix = this.classPrefix; - var dialogName = classPrefix + pluginName, dialog; - - $.extend(true, this.lang, langs[this.lang.name]); - this.setToolbar(); - - var lang = this.lang; - var dialogLang = lang.dialog["goto-line"]; - var lineCount = cm.lineCount(); - - dialogLang.error += dialogLang.label + " 1-" + lineCount; - - if (editor.find("." + dialogName).length < 1) - { - var dialogContent = [ - "
        ", - "

        " + dialogLang.label + " 1-" + lineCount +"   

        ", - "
        " - ].join("\n"); - - dialog = this.createDialog({ - name : dialogName, - title : dialogLang.title, - width : 400, - height : 180, - mask : settings.dialogShowMask, - drag : settings.dialogDraggable, - content : dialogContent, - lockScreen : settings.dialogLockScreen, - maskStyle : { - opacity : settings.dialogMaskOpacity, - backgroundColor : settings.dialogMaskBgColor - }, - buttons : { - enter : [lang.buttons.enter, function() { - var line = parseInt(this.find("[data-line-number]").val()); - - if (line < 1 || line > lineCount) { - alert(dialogLang.error); - - return false; - } - - _this.gotoLine(line); - - this.hide().lockScreen(false).hideMask(); - - return false; - }], - - cancel : [lang.buttons.cancel, function() { - this.hide().lockScreen(false).hideMask(); - - return false; - }] - } - }); - } - - dialog = editor.find("." + dialogName); - - this.dialogShowMask(dialog); - this.dialogLockScreen(); - dialog.show(); - }; - - }; - - // CommonJS/Node.js - if (typeof require === "function" && typeof exports === "object" && typeof module === "object") - { - module.exports = factory; - } - else if (typeof define === "function") // AMD/CMD/Sea.js - { - if (define.amd) { // for Require.js - - define(["editormd"], function(editormd) { - factory(editormd); - }); - - } else { // for Sea.js - define(function(require) { - var editormd = require("./../../editormd"); - factory(editormd); - }); - } - } - else - { - factory(window.editormd); - } - -})(); diff --git a/src/main/resources/static/editor.md-master/plugins/help-dialog/help-dialog.js b/src/main/resources/static/editor.md-master/plugins/help-dialog/help-dialog.js deleted file mode 100644 index 339b3c0..0000000 --- a/src/main/resources/static/editor.md-master/plugins/help-dialog/help-dialog.js +++ /dev/null @@ -1,102 +0,0 @@ -/*! - * Help dialog plugin for Editor.md - * - * @file help-dialog.js - * @author pandao - * @version 1.2.0 - * @updateTime 2015-03-08 - * {@link https://github.com/pandao/editor.md} - * @license MIT - */ - -(function() { - - var factory = function (exports) { - - var $ = jQuery; - var pluginName = "help-dialog"; - - exports.fn.helpDialog = function() { - var _this = this; - var lang = this.lang; - var editor = this.editor; - var settings = this.settings; - var path = settings.pluginPath + pluginName + "/"; - var classPrefix = this.classPrefix; - var dialogName = classPrefix + pluginName, dialog; - var dialogLang = lang.dialog.help; - - if (editor.find("." + dialogName).length < 1) - { - var dialogContent = "
        "; - - dialog = this.createDialog({ - name : dialogName, - title : dialogLang.title, - width : 840, - height : 540, - mask : settings.dialogShowMask, - drag : settings.dialogDraggable, - content : dialogContent, - lockScreen : settings.dialogLockScreen, - maskStyle : { - opacity : settings.dialogMaskOpacity, - backgroundColor : settings.dialogMaskBgColor - }, - buttons : { - close : [lang.buttons.close, function() { - this.hide().lockScreen(false).hideMask(); - - return false; - }] - } - }); - } - - dialog = editor.find("." + dialogName); - - this.dialogShowMask(dialog); - this.dialogLockScreen(); - dialog.show(); - - var helpContent = dialog.find(".markdown-body"); - - if (helpContent.html() === "") - { - $.get(path + "help.md", function(text) { - var md = exports.$marked(text); - helpContent.html(md); - - helpContent.find("a").attr("target", "_blank"); - }); - } - }; - - }; - - // CommonJS/Node.js - if (typeof require === "function" && typeof exports === "object" && typeof module === "object") - { - module.exports = factory; - } - else if (typeof define === "function") // AMD/CMD/Sea.js - { - if (define.amd) { // for Require.js - - define(["editormd"], function(editormd) { - factory(editormd); - }); - - } else { // for Sea.js - define(function(require) { - var editormd = require("./../../editormd"); - factory(editormd); - }); - } - } - else - { - factory(window.editormd); - } - -})(); diff --git a/src/main/resources/static/editor.md-master/plugins/help-dialog/help.md b/src/main/resources/static/editor.md-master/plugins/help-dialog/help.md deleted file mode 100644 index 9a030f2..0000000 --- a/src/main/resources/static/editor.md-master/plugins/help-dialog/help.md +++ /dev/null @@ -1,77 +0,0 @@ -##### Markdown语法教程 (Markdown syntax tutorial) - -- [Markdown Syntax](http://daringfireball.net/projects/markdown/syntax/ "Markdown Syntax") -- [Mastering Markdown](https://guides.github.com/features/mastering-markdown/ "Mastering Markdown") -- [Markdown Basics](https://help.github.com/articles/markdown-basics/ "Markdown Basics") -- [GitHub Flavored Markdown](https://help.github.com/articles/github-flavored-markdown/ "GitHub Flavored Markdown") -- [Markdown 语法说明(简体中文)](http://www.markdown.cn/ "Markdown 语法说明(简体中文)") -- [Markdown 語法說明(繁體中文)](http://markdown.tw/ "Markdown 語法說明(繁體中文)") - -##### 键盘快捷键 (Keyboard shortcuts) - -> If Editor.md code editor is on focus, you can use keyboard shortcuts. - -| Keyboard shortcuts (键盘快捷键) | 说明 | Description | -| :---------------------------------------------- |:--------------------------------- | :------------------------------------------------- | -| F9 | 切换实时预览 | Switch watch/unwatch | -| F10 | 全屏HTML预览(按 Shift + ESC 退出) | Full preview HTML (Press Shift + ESC exit) | -| F11 | 切换全屏状态 | Switch fullscreen (Press ESC exit) | -| Ctrl + 1~6 / Command + 1~6 | 插入标题1~6 | Insert heading 1~6 | -| Ctrl + A / Command + A | 全选 | Select all | -| Ctrl + B / Command + B | 插入粗体 | Insert bold | -| Ctrl + D / Command + D | 插入日期时间 | Insert datetime | -| Ctrl + E / Command + E | 插入Emoji符号 | Insert :emoji: | -| Ctrl + F / Command + F | 查找/搜索 | Start searching | -| Ctrl + G / Command + G | 切换到下一个搜索结果项 | Find next search results | -| Ctrl + H / Command + H | 插入水平线 | Insert horizontal rule | -| Ctrl + I / Command + I | 插入斜体 | Insert italic | -| Ctrl + K / Command + K | 插入行内代码 | Insert inline code | -| Ctrl + L / Command + L | 插入链接 | Insert link | -| Ctrl + U / Command + U | 插入无序列表 | Insert unordered list | -| Ctrl + Q | 代码折叠切换 | Switch code fold | -| Ctrl + Z / Command + Z | 撤销 | Undo | -| Ctrl + Y / Command + Y | 重做 | Redo | -| Ctrl + Shift + A | 插入@链接 | Insert @link | -| Ctrl + Shift + C | 插入行内代码 | Insert inline code | -| Ctrl + Shift + E | 打开插入Emoji表情对话框 | Open emoji dialog | -| Ctrl + Shift + F / Command + Option + F | 替换 | Replace | -| Ctrl + Shift + G / Shift + Command + G | 切换到上一个搜索结果项 | Find previous search results | -| Ctrl + Shift + H | 打开HTML实体字符对话框 | Open HTML Entities dialog | -| Ctrl + Shift + I | 插入图片 | Insert image ![]() | -| Ctrl + Shift + K | 插入TeX(KaTeX)公式符号 | Insert TeX(KaTeX) symbol $$TeX$$ | -| Ctrl + Shift + L | 打开插入链接对话框 | Open link dialog | -| Ctrl + Shift + O | 插入有序列表 | Insert ordered list | -| Ctrl + Shift + P | 打开插入PRE对话框 | Open Preformatted text dialog | -| Ctrl + Shift + Q | 插入引用 | Insert blockquotes | -| Ctrl + Shift + R / Shift + Command + Option + F | 全部替换 | Replace all | -| Ctrl + Shift + S | 插入删除线 | Insert strikethrough | -| Ctrl + Shift + T | 打开插入表格对话框 | Open table dialog | -| Ctrl + Shift + U | 将所选文字转成大写 | Selection text convert to uppercase | -| Shift + Alt + C | 插入```代码 | Insert code blocks (```) | -| Shift + Alt + H | 打开使用帮助对话框 | Open help dialog | -| Shift + Alt + L | 将所选文本转成小写 | Selection text convert to lowercase | -| Shift + Alt + P | 插入分页符 | Insert page break | -| Alt + L | 将所选文本转成小写 | Selection text convert to lowercase | -| Shift + Alt + U | 将所选的每个单词的首字母转成大写 | Selection words first letter convert to Uppercase | -| Ctrl + Shift + Alt + C | 打开插入代码块对话框层 | Open code blocks dialog | -| Ctrl + Shift + Alt + I | 打开插入图片对话框层 | Open image dialog | -| Ctrl + Shift + Alt + U | 将所选文本的第一个首字母转成大写 | Selection text first letter convert to uppercase | -| Ctrl + Alt + G | 跳转到指定的行 | Goto line | - -##### Emoji表情参考 (Emoji reference) - -- [Github emoji](http://www.emoji-cheat-sheet.com/ "Github emoji") -- [Twitter Emoji \(Twemoji\)](http://twitter.github.io/twemoji/preview.html "Twitter Emoji \(Twemoji\)") -- [FontAwesome icons emoji](http://fortawesome.github.io/Font-Awesome/icons/ "FontAwesome icons emoji") - -##### 流程图参考 (Flowchart reference) - -[http://adrai.github.io/flowchart.js/](http://adrai.github.io/flowchart.js/) - -##### 时序图参考 (SequenceDiagram reference) - -[http://bramp.github.io/js-sequence-diagrams/](http://bramp.github.io/js-sequence-diagrams/) - -##### TeX/LaTeX reference - -[http://meta.wikimedia.org/wiki/Help:Formula](http://meta.wikimedia.org/wiki/Help:Formula) diff --git a/src/main/resources/static/editor.md-master/plugins/html-entities-dialog/html-entities-dialog.js b/src/main/resources/static/editor.md-master/plugins/html-entities-dialog/html-entities-dialog.js deleted file mode 100644 index 6c77053..0000000 --- a/src/main/resources/static/editor.md-master/plugins/html-entities-dialog/html-entities-dialog.js +++ /dev/null @@ -1,173 +0,0 @@ -/*! - * HTML entities dialog plugin for Editor.md - * - * @file html-entities-dialog.js - * @author pandao - * @version 1.2.0 - * @updateTime 2015-03-08 - * {@link https://github.com/pandao/editor.md} - * @license MIT - */ - -(function() { - - var factory = function (exports) { - - var $ = jQuery; - var pluginName = "html-entities-dialog"; - var selecteds = []; - var entitiesData = []; - - exports.fn.htmlEntitiesDialog = function() { - var _this = this; - var cm = this.cm; - var lang = _this.lang; - var settings = _this.settings; - var path = settings.pluginPath + pluginName + "/"; - var editor = this.editor; - var cursor = cm.getCursor(); - var selection = cm.getSelection(); - var classPrefix = _this.classPrefix; - - var dialogName = classPrefix + "dialog-" + pluginName, dialog; - var dialogLang = lang.dialog.htmlEntities; - - var dialogContent = [ - '
        ', - '
        ', - '
        ', - '
        ', - ].join("\r\n"); - - cm.focus(); - - if (editor.find("." + dialogName).length > 0) - { - dialog = editor.find("." + dialogName); - - selecteds = []; - dialog.find("a").removeClass("selected"); - - this.dialogShowMask(dialog); - this.dialogLockScreen(); - dialog.show(); - } - else - { - dialog = this.createDialog({ - name : dialogName, - title : dialogLang.title, - width : 800, - height : 475, - mask : settings.dialogShowMask, - drag : settings.dialogDraggable, - content : dialogContent, - lockScreen : settings.dialogLockScreen, - maskStyle : { - opacity : settings.dialogMaskOpacity, - backgroundColor : settings.dialogMaskBgColor - }, - buttons : { - enter : [lang.buttons.enter, function() { - cm.replaceSelection(selecteds.join(" ")); - this.hide().lockScreen(false).hideMask(); - - return false; - }], - cancel : [lang.buttons.cancel, function() { - this.hide().lockScreen(false).hideMask(); - - return false; - }] - } - }); - } - - var table = dialog.find("." + classPrefix + "grid-table"); - - var drawTable = function() { - - if (entitiesData.length < 1) return ; - - var rowNumber = 20; - var pageTotal = Math.ceil(entitiesData.length / rowNumber); - - table.html(""); - - for (var i = 0; i < pageTotal; i++) - { - var row = "
        "; - - for (var x = 0; x < rowNumber; x++) - { - var entity = entitiesData[(i * rowNumber) + x]; - - if (typeof entity !== "undefined") - { - var name = entity.name.replace("&", "&"); - - row += "" + name + ""; - } - } - - row += "
        "; - - table.append(row); - } - - dialog.find("." + classPrefix + "html-entity-btn").bind(exports.mouseOrTouch("click", "touchend"), function() { - $(this).toggleClass("selected"); - - if ($(this).hasClass("selected")) - { - selecteds.push($(this).attr("value")); - } - }); - }; - - if (entitiesData.length < 1) - { - if (typeof (dialog.loading) == "function") dialog.loading(true); - - $.getJSON(path + pluginName.replace("-dialog", "") + ".json", function(json) { - - if (typeof (dialog.loading) == "function") dialog.loading(false); - - entitiesData = json; - drawTable(); - }); - } - else - { - drawTable(); - } - }; - - }; - - // CommonJS/Node.js - if (typeof require === "function" && typeof exports === "object" && typeof module === "object") - { - module.exports = factory; - } - else if (typeof define === "function") // AMD/CMD/Sea.js - { - if (define.amd) { // for Require.js - - define(["editormd"], function(editormd) { - factory(editormd); - }); - - } else { // for Sea.js - define(function(require) { - var editormd = require("./../../editormd"); - factory(editormd); - }); - } - } - else - { - factory(window.editormd); - } - -})(); diff --git a/src/main/resources/static/editor.md-master/plugins/html-entities-dialog/html-entities.json b/src/main/resources/static/editor.md-master/plugins/html-entities-dialog/html-entities.json deleted file mode 100644 index e9e8229..0000000 --- a/src/main/resources/static/editor.md-master/plugins/html-entities-dialog/html-entities.json +++ /dev/null @@ -1,936 +0,0 @@ -[ - { - "name" : "&#64;", - "description":"at symbol" - }, - { - "name":"&copy;", - "description":"copyright symbol" - }, - { - "name":"&reg;", - "description":"registered symbol" - }, - { - "name":"&trade;", - "description":"trademark symbol" - }, - { - "name":"&hearts;", - "description":"heart" - }, - { - "name":"&nbsp;", - "description":"Inserts a non-breaking blank space" - }, - { - "name":"&amp;", - "description":"Ampersand" - }, - { - "name":"&#36;", - "description":"dollar symbol" - }, - { - "name":"&cent;", - "description":"Cent symbol" - }, - { - "name":"&pound;", - "description":"Pound" - }, - { - "name":"&yen;", - "description":"Yen" - }, - { - "name":"&euro;", - "description":"Euro symbol" - }, - { - "name":"&quot;", - "description":"quotation mark" - }, - { - "name":"&ldquo;", - "description":"Opening Double Quotes " - }, - { - "name":"&rdquo;", - "description":"Closing Double Quotes " - }, - { - "name":"&lsquo;", - "description":"Opening Single Quote Mark " - }, - { - "name":"&rsquo;", - "description":"Closing Single Quote Mark " - }, - { - "name":"&laquo;", - "description":"angle quotation mark (left)" - }, - { - "name":"&raquo;", - "description":"angle quotation mark (right)" - }, - { - "name":"&lsaquo;", - "description":"single left angle quotation" - }, - { - "name":"&rsaquo;", - "description":"single right angle quotation" - }, - { - "name":"&sect;", - "description":"Section Symbol" - }, - { - "name":"&micro;", - "description":"micro sign" - }, - { - "name":"&para;", - "description":"Paragraph symbol" - }, - { - "name":"&bull;", - "description":"Big List Dot" - }, - { - "name":"&middot;", - "description":"Medium List Dot" - }, - { - "name":"&hellip;", - "description":"horizontal ellipsis" - }, - { - "name":"&#124;", - "description":"vertical bar" - }, - { - "name":"&brvbar;", - "description":"broken vertical bar" - }, - { - "name":"&ndash;", - "description":"en-dash" - }, - { - "name":"&mdash;", - "description":"em-dash" - }, - { - "name":"&curren;", - "description":"Generic currency symbol" - }, - { - "name":"&#33;", - "description":"exclamation point" - }, - { - "name":"&#35;", - "description":"number sign" - }, - { - "name":"&#39;", - "description":"single quote" - }, - { - "name":"&#40;", - "description":"" - }, - { - "name":"&#41;", - "description":"" - }, - { - "name":"&#42;", - "description":"asterisk" - }, - { - "name":"&#43;", - "description":"plus sign" - }, - { - "name":"&#44;", - "description":"comma" - }, - { - "name":"&#45;", - "description":"minus sign - hyphen" - }, - { - "name":"&#46;", - "description":"period" - }, - { - "name":"&#47;", - "description":"slash" - }, - { - "name":"&#48;", - "description":"0" - }, - { - "name":"&#49;", - "description":"1" - }, - { - "name":"&#50;", - "description":"2" - }, - { - "name":"&#51;", - "description":"3" - }, - { - "name":"&#52;", - "description":"4" - }, - { - "name":"&#53;", - "description":"5" - }, - { - "name":"&#54;", - "description":"6" - }, - { - "name":"&#55;", - "description":"7" - }, - { - "name":"&#56;", - "description":"8" - }, - { - "name":"&#57;", - "description":"9" - }, - { - "name":"&#58;", - "description":"colon" - }, - { - "name":"&#59;", - "description":"semicolon" - }, - { - "name":"&#61;", - "description":"equal sign" - }, - { - "name":"&#63;", - "description":"question mark" - }, - { - "name":"&lt;", - "description":"Less than" - }, - { - "name":"&gt;", - "description":"Greater than" - }, - { - "name":"&le;", - "description":"Less than or Equal to" - }, - { - "name":"&ge;", - "description":"Greater than or Equal to" - }, - { - "name":"&times;", - "description":"Multiplication symbol" - }, - { - "name":"&divide;", - "description":"Division symbol" - }, - { - "name":"&minus;", - "description":"Minus symbol" - }, - { - "name":"&plusmn;", - "description":"Plus/minus symbol" - }, - { - "name":"&ne;", - "description":"Not Equal" - }, - { - "name":"&sup1;", - "description":"Superscript 1" - }, - { - "name":"&sup2;", - "description":"Superscript 2" - }, - { - "name":"&sup3;", - "description":"Superscript 3" - }, - { - "name":"&frac12;", - "description":"Fraction ½" - }, - { - "name":"&frac14;", - "description":"Fraction ¼" - }, - { - "name":"&frac34;", - "description":"Fraction ¾" - }, - { - "name":"&permil;", - "description":"per mille" - }, - { - "name":"&deg;", - "description":"Degree symbol" - }, - { - "name":"&radic;", - "description":"square root" - }, - { - "name":"&infin;", - "description":"Infinity" - }, - { - "name":"&larr;", - "description":"left arrow" - }, - { - "name":"&uarr;", - "description":"up arrow" - }, - { - "name":"&rarr;", - "description":"right arrow" - }, - { - "name":"&darr;", - "description":"down arrow" - }, - { - "name":"&harr;", - "description":"left right arrow" - }, - { - "name":"&crarr;", - "description":"carriage return arrow" - }, - { - "name":"&lceil;", - "description":"left ceiling" - }, - { - "name":"&rceil;", - "description":"right ceiling" - }, - { - "name":"&lfloor;", - "description":"left floor" - }, - { - "name":"&rfloor;", - "description":"right floor" - }, - { - "name":"&spades;", - "description":"spade" - }, - { - "name":"&clubs;", - "description":"club" - }, - { - "name":"&hearts;", - "description":"heart" - }, - { - "name":"&diams;", - "description":"diamond" - }, - { - "name":"&loz;", - "description":"lozenge" - }, - { - "name":"&dagger;", - "description":"dagger" - }, - { - "name":"&Dagger;", - "description":"double dagger" - }, - { - "name":"&iexcl;", - "description":"inverted exclamation mark" - }, - { - "name":"&iquest;", - "description":"inverted question mark" - }, - { - "name":"&#338;", - "description":"latin capital letter OE" - }, - { - "name":"&#339;", - "description":"latin small letter oe" - }, - { - "name":"&#352;", - "description":"latin capital letter S with caron" - }, - { - "name":"&#353;", - "description":"latin small letter s with caron" - }, - { - "name":"&#376;", - "description":"latin capital letter Y with diaeresis" - }, - { - "name":"&#402;", - "description":"latin small f with hook - function" - }, - { - "name":"&not;", - "description":"not sign" - }, - { - "name":"&ordf;", - "description":"feminine ordinal indicator" - }, - { - "name":"&uml;", - "description":"spacing diaeresis - umlaut" - }, - { - "name":"&macr;", - "description":"spacing macron - overline" - }, - { - "name":"&acute;", - "description":"acute accent - spacing acute" - }, - { - "name":"&Agrave;", - "description":"latin capital letter A with grave" - }, - { - "name":"&Aacute;", - "description":"latin capital letter A with acute" - }, - { - "name":"&Acirc;", - "description":"latin capital letter A with circumflex" - }, - { - "name":"&Atilde;", - "description":"latin capital letter A with tilde" - }, - { - "name":"&Auml;", - "description":"latin capital letter A with diaeresis" - }, - { - "name":"&Aring;", - "description":"latin capital letter A with ring above" - }, - { - "name":"&AElig;", - "description":"latin capital letter AE" - }, - { - "name":"&Ccedil;", - "description":"latin capital letter C with cedilla" - }, - { - "name":"&Egrave;", - "description":"latin capital letter E with grave" - }, - { - "name":"&Eacute;", - "description":"latin capital letter E with acute" - }, - { - "name":"&Ecirc;", - "description":"latin capital letter E with circumflex" - }, - { - "name":"&Euml;", - "description":"latin capital letter E with diaeresis" - }, - { - "name":"&Igrave;", - "description":"latin capital letter I with grave" - }, - { - "name":"&Iacute;", - "description":"latin capital letter I with acute" - }, - { - "name":"&Icirc;", - "description":"latin capital letter I with circumflex" - }, - { - "name":"&Iuml;", - "description":"latin capital letter I with diaeresis" - }, - - { - "name":"&ETH;", - "description":"latin capital letter ETH" - }, - { - "name":"&Ntilde;", - "description":"latin capital letter N with tilde" - }, - { - "name":"&Ograve;", - "description":"latin capital letter O with grave" - }, - { - "name":"&Oacute;", - "description":"latin capital letter O with acute" - }, - { - "name":"&Ocirc;", - "description":"latin capital letter O with circumflex" - }, - { - "name":"&Otilde;", - "description":"latin capital letter O with tilde" - }, - { - "name":"&Ouml;", - "description":"latin capital letter O with diaeresis" - }, - { - "name":"&times;", - "description":"multiplication sign" - }, - { - "name":"&Oslash;", - "description":"latin capital letter O with slash" - }, - { - "name":"&Ugrave;", - "description":"latin capital letter U with grave" - }, - { - "name":"&Uacute;", - "description":"latin capital letter U with acute" - }, - { - "name":"&Ucirc;", - "description":"latin capital letter U with circumflex" - }, - { - "name":"&Uuml;", - "description":"latin capital letter U with diaeresis" - }, - { - "name":"&Yacute;", - "description":"latin capital letter Y with acute" - }, - { - "name":"&THORN;", - "description":"latin capital letter THORN" - }, - { - "name":"&szlig;", - "description":"latin small letter sharp s - ess-zed" - }, - - - { - "name":"&eth;", - "description":"latin capital letter eth" - }, - { - "name":"&ntilde;", - "description":"latin capital letter n with tilde" - }, - { - "name":"&ograve;", - "description":"latin capital letter o with grave" - }, - { - "name":"&oacute;", - "description":"latin capital letter o with acute" - }, - { - "name":"&ocirc;", - "description":"latin capital letter o with circumflex" - }, - { - "name":"&otilde;", - "description":"latin capital letter o with tilde" - }, - { - "name":"&ouml;", - "description":"latin capital letter o with diaeresis" - }, - { - "name":"&times;", - "description":"multiplication sign" - }, - { - "name":"&oslash;", - "description":"latin capital letter o with slash" - }, - { - "name":"&ugrave;", - "description":"latin capital letter u with grave" - }, - { - "name":"&uacute;", - "description":"latin capital letter u with acute" - }, - { - "name":"&ucirc;", - "description":"latin capital letter u with circumflex" - }, - { - "name":"&uuml;", - "description":"latin capital letter u with diaeresis" - }, - { - "name":"&yacute;", - "description":"latin capital letter y with acute" - }, - { - "name":"&thorn;", - "description":"latin capital letter thorn" - }, - { - "name":"&yuml;", - "description":"latin small letter y with diaeresis" - }, - - { - "name":"&agrave;", - "description":"latin capital letter a with grave" - }, - { - "name":"&aacute;", - "description":"latin capital letter a with acute" - }, - { - "name":"&acirc;", - "description":"latin capital letter a with circumflex" - }, - { - "name":"&atilde;", - "description":"latin capital letter a with tilde" - }, - { - "name":"&auml;", - "description":"latin capital letter a with diaeresis" - }, - { - "name":"&aring;", - "description":"latin capital letter a with ring above" - }, - { - "name":"&aelig;", - "description":"latin capital letter ae" - }, - { - "name":"&ccedil;", - "description":"latin capital letter c with cedilla" - }, - { - "name":"&egrave;", - "description":"latin capital letter e with grave" - }, - { - "name":"&eacute;", - "description":"latin capital letter e with acute" - }, - { - "name":"&ecirc;", - "description":"latin capital letter e with circumflex" - }, - { - "name":"&euml;", - "description":"latin capital letter e with diaeresis" - }, - { - "name":"&igrave;", - "description":"latin capital letter i with grave" - }, - { - "name":"&Iacute;", - "description":"latin capital letter i with acute" - }, - { - "name":"&icirc;", - "description":"latin capital letter i with circumflex" - }, - { - "name":"&iuml;", - "description":"latin capital letter i with diaeresis" - }, - - { - "name":"&#65;", - "description":"A" - }, - { - "name":"&#66;", - "description":"B" - }, - { - "name":"&#67;", - "description":"C" - }, - { - "name":"&#68;", - "description":"D" - }, - { - "name":"&#69;", - "description":"E" - }, - { - "name":"&#70;", - "description":"F" - }, - { - "name":"&#71;", - "description":"G" - }, - { - "name":"&#72;", - "description":"H" - }, - { - "name":"&#73;", - "description":"I" - }, - { - "name":"&#74;", - "description":"J" - }, - { - "name":"&#75;", - "description":"K" - }, - { - "name":"&#76;", - "description":"L" - }, - { - "name":"&#77;", - "description":"M" - }, - { - "name":"&#78;", - "description":"N" - }, - { - "name":"&#79;", - "description":"O" - }, - { - "name":"&#80;", - "description":"P" - }, - { - "name":"&#81;", - "description":"Q" - }, - { - "name":"&#82;", - "description":"R" - }, - { - "name":"&#83;", - "description":"S" - }, - { - "name":"&#84;", - "description":"T" - }, - { - "name":"&#85;", - "description":"U" - }, - { - "name":"&#86;", - "description":"V" - }, - { - "name":"&#87;", - "description":"W" - }, - { - "name":"&#88;", - "description":"X" - }, - { - "name":"&#89;", - "description":"Y" - }, - { - "name":"&#90;", - "description":"Z" - }, - { - "name":"&#91;", - "description":"opening bracket" - }, - { - "name":"&#92;", - "description":"backslash" - }, - { - "name":"&#93;", - "description":"closing bracket" - }, - { - "name":"&#94;", - "description":"caret - circumflex" - }, - { - "name":"&#95;", - "description":"underscore" - }, - - { - "name":"&#96;", - "description":"grave accent" - }, - { - "name":"&#97;", - "description":"a" - }, - { - "name":"&#98;", - "description":"b" - }, - { - "name":"&#99;", - "description":"c" - }, - { - "name":"&#100;", - "description":"d" - }, - { - "name":"&#101;", - "description":"e" - }, - { - "name":"&#102;", - "description":"f" - }, - { - "name":"&#103;", - "description":"g" - }, - { - "name":"&#104;", - "description":"h" - }, - { - "name":"&#105;", - "description":"i" - }, - { - "name":"&#106;", - "description":"j" - }, - { - "name":"&#107;", - "description":"k" - }, - { - "name":"&#108;", - "description":"l" - }, - { - "name":"&#109;", - "description":"m" - }, - { - "name":"&#110;", - "description":"n" - }, - { - "name":"&#111;", - "description":"o" - }, - { - "name":"&#112;", - "description":"p" - }, - { - "name":"&#113;", - "description":"q" - }, - { - "name":"&#114;", - "description":"r" - }, - { - "name":"&#115;", - "description":"s" - }, - { - "name":"&#116;", - "description":"t" - }, - { - "name":"&#117;", - "description":"u" - }, - { - "name":"&#118;", - "description":"v" - }, - { - "name":"&#119;", - "description":"w" - }, - { - "name":"&#120;", - "description":"x" - }, - { - "name":"&#121;", - "description":"y" - }, - { - "name":"&#122;", - "description":"z" - }, - { - "name":"&#123;", - "description":"opening brace" - }, - { - "name":"&#124;", - "description":"vertical bar" - }, - { - "name":"&#125;", - "description":"closing brace" - }, - { - "name":"&#126;", - "description":"equivalency sign - tilde" - } -] \ No newline at end of file diff --git a/src/main/resources/static/editor.md-master/plugins/image-dialog/image-dialog.js b/src/main/resources/static/editor.md-master/plugins/image-dialog/image-dialog.js deleted file mode 100644 index 2ff5051..0000000 --- a/src/main/resources/static/editor.md-master/plugins/image-dialog/image-dialog.js +++ /dev/null @@ -1,227 +0,0 @@ -/*! - * Image (upload) dialog plugin for Editor.md - * - * @file image-dialog.js - * @author pandao - * @version 1.3.4 - * @updateTime 2015-06-09 - * {@link https://github.com/pandao/editor.md} - * @license MIT - */ - -(function() { - - var factory = function (exports) { - - var pluginName = "image-dialog"; - - exports.fn.imageDialog = function() { - - var _this = this; - var cm = this.cm; - var lang = this.lang; - var editor = this.editor; - var settings = this.settings; - var cursor = cm.getCursor(); - var selection = cm.getSelection(); - var imageLang = lang.dialog.image; - var classPrefix = this.classPrefix; - var iframeName = classPrefix + "image-iframe"; - var dialogName = classPrefix + pluginName, dialog; - - cm.focus(); - - var loading = function(show) { - var _loading = dialog.find("." + classPrefix + "dialog-mask"); - _loading[(show) ? "show" : "hide"](); - }; - - if (editor.find("." + dialogName).length < 1) - { - var guid = (new Date).getTime(); - var action = settings.imageUploadURL + (settings.imageUploadURL.indexOf("?") >= 0 ? "&" : "?") + "guid=" + guid; - - if (settings.crossDomainUpload) - { - action += "&callback=" + settings.uploadCallbackURL + "&dialog_id=editormd-image-dialog-" + guid; - } - - var dialogContent = ( (settings.imageUpload) ? "
        " : "
        " ) + - ( (settings.imageUpload) ? "" : "" ) + - "" + - "" + (function(){ - return (settings.imageUpload) ? "
        " + - "" + - "" + - "
        " : ""; - })() + - "
        " + - "" + - "" + - "
        " + - "" + - "" + - "
        " + - ( (settings.imageUpload) ? "" : "
        "); - - //var imageFooterHTML = ""; - - dialog = this.createDialog({ - title : imageLang.title, - width : (settings.imageUpload) ? 465 : 380, - height : 254, - name : dialogName, - content : dialogContent, - mask : settings.dialogShowMask, - drag : settings.dialogDraggable, - lockScreen : settings.dialogLockScreen, - maskStyle : { - opacity : settings.dialogMaskOpacity, - backgroundColor : settings.dialogMaskBgColor - }, - buttons : { - enter : [lang.buttons.enter, function() { - var url = this.find("[data-url]").val(); - var alt = this.find("[data-alt]").val(); - var link = this.find("[data-link]").val(); - - if (url === "") - { - alert(imageLang.imageURLEmpty); - return false; - } - - var altAttr = (alt !== "") ? " \"" + alt + "\"" : ""; - - if (link === "" || link === "http://") - { - cm.replaceSelection("![" + alt + "](" + url + altAttr + ")"); - } - else - { - cm.replaceSelection("[![" + alt + "](" + url + altAttr + ")](" + link + altAttr + ")"); - } - - if (alt === "") { - cm.setCursor(cursor.line, cursor.ch + 2); - } - - this.hide().lockScreen(false).hideMask(); - - //删除对话框 - this.remove(); - - return false; - }], - - cancel : [lang.buttons.cancel, function() { - this.hide().lockScreen(false).hideMask(); - - //删除对话框 - this.remove(); - - return false; - }] - } - }); - - dialog.attr("id", classPrefix + "image-dialog-" + guid); - - if (!settings.imageUpload) { - return ; - } - - var fileInput = dialog.find("[name=\"" + classPrefix + "image-file\"]"); - - fileInput.bind("change", function() { - var fileName = fileInput.val(); - var isImage = new RegExp("(\\.(" + settings.imageFormats.join("|") + "))$", "i"); // /(\.(webp|jpg|jpeg|gif|bmp|png))$/ - - if (fileName === "") - { - alert(imageLang.uploadFileEmpty); - - return false; - } - - if (!isImage.test(fileName)) - { - alert(imageLang.formatNotAllowed + settings.imageFormats.join(", ")); - - return false; - } - - loading(true); - - var submitHandler = function() { - - var uploadIframe = document.getElementById(iframeName); - - uploadIframe.onload = function() { - - loading(false); - - var body = (uploadIframe.contentWindow ? uploadIframe.contentWindow : uploadIframe.contentDocument).document.body; - var json = (body.innerText) ? body.innerText : ( (body.textContent) ? body.textContent : null); - - json = (typeof JSON.parse !== "undefined") ? JSON.parse(json) : eval("(" + json + ")"); - - if(!settings.crossDomainUpload) - { - if (json.success === 1) - { - dialog.find("[data-url]").val(json.url); - } - else - { - alert(json.message); - } - } - - return false; - }; - }; - - dialog.find("[type=\"submit\"]").bind("click", submitHandler).trigger("click"); - }); - } - - dialog = editor.find("." + dialogName); - dialog.find("[type=\"text\"]").val(""); - dialog.find("[type=\"file\"]").val(""); - dialog.find("[data-link]").val("http://"); - - this.dialogShowMask(dialog); - this.dialogLockScreen(); - dialog.show(); - - }; - - }; - - // CommonJS/Node.js - if (typeof require === "function" && typeof exports === "object" && typeof module === "object") - { - module.exports = factory; - } - else if (typeof define === "function") // AMD/CMD/Sea.js - { - if (define.amd) { // for Require.js - - define(["editormd"], function(editormd) { - factory(editormd); - }); - - } else { // for Sea.js - define(function(require) { - var editormd = require("./../../editormd"); - factory(editormd); - }); - } - } - else - { - factory(window.editormd); - } - -})(); diff --git a/src/main/resources/static/editor.md-master/plugins/link-dialog/link-dialog.js b/src/main/resources/static/editor.md-master/plugins/link-dialog/link-dialog.js deleted file mode 100644 index 3e1d0bf..0000000 --- a/src/main/resources/static/editor.md-master/plugins/link-dialog/link-dialog.js +++ /dev/null @@ -1,133 +0,0 @@ -/*! - * Link dialog plugin for Editor.md - * - * @file link-dialog.js - * @author pandao - * @version 1.2.1 - * @updateTime 2015-06-09 - * {@link https://github.com/pandao/editor.md} - * @license MIT - */ - -(function() { - - var factory = function (exports) { - - var pluginName = "link-dialog"; - - exports.fn.linkDialog = function() { - - var _this = this; - var cm = this.cm; - var editor = this.editor; - var settings = this.settings; - var selection = cm.getSelection(); - var lang = this.lang; - var linkLang = lang.dialog.link; - var classPrefix = this.classPrefix; - var dialogName = classPrefix + pluginName, dialog; - - cm.focus(); - - if (editor.find("." + dialogName).length > 0) - { - dialog = editor.find("." + dialogName); - dialog.find("[data-url]").val("http://"); - dialog.find("[data-title]").val(selection); - - this.dialogShowMask(dialog); - this.dialogLockScreen(); - dialog.show(); - } - else - { - var dialogHTML = "
        " + - "" + - "" + - "
        " + - "" + - "" + - "
        " + - "
        "; - - dialog = this.createDialog({ - title : linkLang.title, - width : 380, - height : 211, - content : dialogHTML, - mask : settings.dialogShowMask, - drag : settings.dialogDraggable, - lockScreen : settings.dialogLockScreen, - maskStyle : { - opacity : settings.dialogMaskOpacity, - backgroundColor : settings.dialogMaskBgColor - }, - buttons : { - enter : [lang.buttons.enter, function() { - var url = this.find("[data-url]").val(); - var title = this.find("[data-title]").val(); - - if (url === "http://" || url === "") - { - alert(linkLang.urlEmpty); - return false; - } - - /*if (title === "") - { - alert(linkLang.titleEmpty); - return false; - }*/ - - var str = "[" + title + "](" + url + " \"" + title + "\")"; - - if (title == "") - { - str = "[" + url + "](" + url + ")"; - } - - cm.replaceSelection(str); - - this.hide().lockScreen(false).hideMask(); - - return false; - }], - - cancel : [lang.buttons.cancel, function() { - this.hide().lockScreen(false).hideMask(); - - return false; - }] - } - }); - } - }; - - }; - - // CommonJS/Node.js - if (typeof require === "function" && typeof exports === "object" && typeof module === "object") - { - module.exports = factory; - } - else if (typeof define === "function") // AMD/CMD/Sea.js - { - if (define.amd) { // for Require.js - - define(["editormd"], function(editormd) { - factory(editormd); - }); - - } else { // for Sea.js - define(function(require) { - var editormd = require("./../../editormd"); - factory(editormd); - }); - } - } - else - { - factory(window.editormd); - } - -})(); diff --git a/src/main/resources/static/editor.md-master/plugins/plugin-template.js b/src/main/resources/static/editor.md-master/plugins/plugin-template.js deleted file mode 100644 index 8e30169..0000000 --- a/src/main/resources/static/editor.md-master/plugins/plugin-template.js +++ /dev/null @@ -1,111 +0,0 @@ -/*! - * Link dialog plugin for Editor.md - * - * @file link-dialog.js - * @author pandao - * @version 1.2.0 - * @updateTime 2015-03-07 - * {@link https://github.com/pandao/editor.md} - * @license MIT - */ - -(function() { - - var factory = function (exports) { - - var $ = jQuery; // if using module loader(Require.js/Sea.js). - - var langs = { - "zh-cn" : { - toolbar : { - table : "表格" - }, - dialog : { - table : { - title : "添加表格", - cellsLabel : "单元格数", - alignLabel : "对齐方式", - rows : "行数", - cols : "列数", - aligns : ["默认", "左对齐", "居中对齐", "右对齐"] - } - } - }, - "zh-tw" : { - toolbar : { - table : "添加表格" - }, - dialog : { - table : { - title : "添加表格", - cellsLabel : "單元格數", - alignLabel : "對齊方式", - rows : "行數", - cols : "列數", - aligns : ["默認", "左對齊", "居中對齊", "右對齊"] - } - } - }, - "en" : { - toolbar : { - table : "Tables" - }, - dialog : { - table : { - title : "Tables", - cellsLabel : "Cells", - alignLabel : "Align", - rows : "Rows", - cols : "Cols", - aligns : ["Default", "Left align", "Center align", "Right align"] - } - } - } - }; - - exports.fn.htmlEntities = function() { - /* - var _this = this; // this == the current instance object of Editor.md - var lang = _this.lang; - var settings = _this.settings; - var editor = this.editor; - var cursor = cm.getCursor(); - var selection = cm.getSelection(); - var classPrefix = this.classPrefix; - - $.extend(true, this.lang, langs[this.lang.name]); // l18n - this.setToolbar(); - - cm.focus(); - */ - //.... - }; - - }; - - // CommonJS/Node.js - if (typeof require === "function" && typeof exports === "object" && typeof module === "object") - { - module.exports = factory; - } - else if (typeof define === "function") // AMD/CMD/Sea.js - { - if (define.amd) { // for Require.js - - define(["editormd"], function(editormd) { - factory(editormd); - }); - - } else { // for Sea.js - define(function(require) { - var editormd = require("./../../editormd"); - factory(editormd); - }); - } - } - else - { - factory(window.editormd); - } - -})(); diff --git a/src/main/resources/static/editor.md-master/plugins/preformatted-text-dialog/preformatted-text-dialog.js b/src/main/resources/static/editor.md-master/plugins/preformatted-text-dialog/preformatted-text-dialog.js deleted file mode 100644 index 9a30860..0000000 --- a/src/main/resources/static/editor.md-master/plugins/preformatted-text-dialog/preformatted-text-dialog.js +++ /dev/null @@ -1,172 +0,0 @@ -/*! - * Preformatted text dialog plugin for Editor.md - * - * @file preformatted-text-dialog.js - * @author pandao - * @version 1.2.0 - * @updateTime 2015-03-07 - * {@link https://github.com/pandao/editor.md} - * @license MIT - */ - -(function() { - - var factory = function (exports) { - var cmEditor; - var pluginName = "preformatted-text-dialog"; - - exports.fn.preformattedTextDialog = function() { - - var _this = this; - var cm = this.cm; - var lang = this.lang; - var editor = this.editor; - var settings = this.settings; - var cursor = cm.getCursor(); - var selection = cm.getSelection(); - var classPrefix = this.classPrefix; - var dialogLang = lang.dialog.preformattedText; - var dialogName = classPrefix + pluginName, dialog; - - cm.focus(); - - if (editor.find("." + dialogName).length > 0) - { - dialog = editor.find("." + dialogName); - dialog.find("textarea").val(selection); - - this.dialogShowMask(dialog); - this.dialogLockScreen(); - dialog.show(); - } - else - { - var dialogContent = ""; - - dialog = this.createDialog({ - name : dialogName, - title : dialogLang.title, - width : 780, - height : 540, - mask : settings.dialogShowMask, - drag : settings.dialogDraggable, - content : dialogContent, - lockScreen : settings.dialogLockScreen, - maskStyle : { - opacity : settings.dialogMaskOpacity, - backgroundColor : settings.dialogMaskBgColor - }, - buttons : { - enter : [lang.buttons.enter, function() { - var codeTexts = this.find("textarea").val(); - - if (codeTexts === "") - { - alert(dialogLang.emptyAlert); - return false; - } - - codeTexts = codeTexts.split("\n"); - - for (var i in codeTexts) - { - codeTexts[i] = " " + codeTexts[i]; - } - - codeTexts = codeTexts.join("\n"); - - if (cursor.ch !== 0) { - codeTexts = "\r\n\r\n" + codeTexts; - } - - cm.replaceSelection(codeTexts); - - this.hide().lockScreen(false).hideMask(); - - return false; - }], - cancel : [lang.buttons.cancel, function() { - this.hide().lockScreen(false).hideMask(); - - return false; - }] - } - }); - } - - var cmConfig = { - mode : "text/html", - theme : settings.theme, - tabSize : 4, - autofocus : true, - autoCloseTags : true, - indentUnit : 4, - lineNumbers : true, - lineWrapping : true, - extraKeys : {"Ctrl-Q": function(cm){ cm.foldCode(cm.getCursor()); }}, - foldGutter : true, - gutters : ["CodeMirror-linenumbers", "CodeMirror-foldgutter"], - matchBrackets : true, - indentWithTabs : true, - styleActiveLine : true, - styleSelectedText : true, - autoCloseBrackets : true, - showTrailingSpace : true, - highlightSelectionMatches : true - }; - - var textarea = dialog.find("textarea"); - var cmObj = dialog.find(".CodeMirror"); - - if (dialog.find(".CodeMirror").length < 1) - { - cmEditor = exports.$CodeMirror.fromTextArea(textarea[0], cmConfig); - cmObj = dialog.find(".CodeMirror"); - - cmObj.css({ - "float" : "none", - margin : "0 0 5px", - border : "1px solid #ddd", - fontSize : settings.fontSize, - width : "100%", - height : "410px" - }); - - cmEditor.on("change", function(cm) { - textarea.val(cm.getValue()); - }); - } - else - { - cmEditor.setValue(cm.getSelection()); - } - }; - - }; - - // CommonJS/Node.js - if (typeof require === "function" && typeof exports === "object" && typeof module === "object") - { - module.exports = factory; - } - else if (typeof define === "function") // AMD/CMD/Sea.js - { - if (define.amd) { // for Require.js - - define(["editormd"], function(editormd) { - factory(editormd); - }); - - } else { // for Sea.js - define(function(require) { - var editormd = require("./../../editormd"); - factory(editormd); - }); - } - } - else - { - factory(window.editormd); - } - -})(); diff --git a/src/main/resources/static/editor.md-master/plugins/reference-link-dialog/reference-link-dialog.js b/src/main/resources/static/editor.md-master/plugins/reference-link-dialog/reference-link-dialog.js deleted file mode 100644 index f1ad086..0000000 --- a/src/main/resources/static/editor.md-master/plugins/reference-link-dialog/reference-link-dialog.js +++ /dev/null @@ -1,153 +0,0 @@ -/*! - * Reference link dialog plugin for Editor.md - * - * @file reference-link-dialog.js - * @author pandao - * @version 1.2.1 - * @updateTime 2015-06-09 - * {@link https://github.com/pandao/editor.md} - * @license MIT - */ - -(function() { - - var factory = function (exports) { - - var pluginName = "reference-link-dialog"; - var ReLinkId = 1; - - exports.fn.referenceLinkDialog = function() { - - var _this = this; - var cm = this.cm; - var lang = this.lang; - var editor = this.editor; - var settings = this.settings; - var cursor = cm.getCursor(); - var selection = cm.getSelection(); - var dialogLang = lang.dialog.referenceLink; - var classPrefix = this.classPrefix; - var dialogName = classPrefix + pluginName, dialog; - - cm.focus(); - - if (editor.find("." + dialogName).length < 1) - { - var dialogHTML = "
        " + - "" + - "" + - "
        " + - "" + - "" + - "
        " + - "" + - "" + - "
        " + - "" + - "" + - "
        " + - "
        "; - - dialog = this.createDialog({ - name : dialogName, - title : dialogLang.title, - width : 380, - height : 296, - content : dialogHTML, - mask : settings.dialogShowMask, - drag : settings.dialogDraggable, - lockScreen : settings.dialogLockScreen, - maskStyle : { - opacity : settings.dialogMaskOpacity, - backgroundColor : settings.dialogMaskBgColor - }, - buttons : { - enter : [lang.buttons.enter, function() { - var name = this.find("[data-name]").val(); - var url = this.find("[data-url]").val(); - var rid = this.find("[data-url-id]").val(); - var title = this.find("[data-title]").val(); - - if (name === "") - { - alert(dialogLang.nameEmpty); - return false; - } - - if (rid === "") - { - alert(dialogLang.idEmpty); - return false; - } - - if (url === "http://" || url === "") - { - alert(dialogLang.urlEmpty); - return false; - } - - //cm.replaceSelection("[" + title + "][" + name + "]\n[" + name + "]: " + url + ""); - cm.replaceSelection("[" + name + "][" + rid + "]"); - - if (selection === "") { - cm.setCursor(cursor.line, cursor.ch + 1); - } - - title = (title === "") ? "" : " \"" + title + "\""; - - cm.setValue(cm.getValue() + "\n[" + rid + "]: " + url + title + ""); - - this.hide().lockScreen(false).hideMask(); - - return false; - }], - cancel : [lang.buttons.cancel, function() { - this.hide().lockScreen(false).hideMask(); - - return false; - }] - } - }); - } - - dialog = editor.find("." + dialogName); - dialog.find("[data-name]").val("[" + ReLinkId + "]"); - dialog.find("[data-url-id]").val(""); - dialog.find("[data-url]").val("http://"); - dialog.find("[data-title]").val(selection); - - this.dialogShowMask(dialog); - this.dialogLockScreen(); - dialog.show(); - - ReLinkId++; - }; - - }; - - // CommonJS/Node.js - if (typeof require === "function" && typeof exports === "object" && typeof module === "object") - { - module.exports = factory; - } - else if (typeof define === "function") // AMD/CMD/Sea.js - { - if (define.amd) { // for Require.js - - define(["editormd"], function(editormd) { - factory(editormd); - }); - - } else { // for Sea.js - define(function(require) { - var editormd = require("./../../editormd"); - factory(editormd); - }); - } - } - else - { - factory(window.editormd); - } - -})(); diff --git a/src/main/resources/static/editor.md-master/plugins/table-dialog/table-dialog.js b/src/main/resources/static/editor.md-master/plugins/table-dialog/table-dialog.js deleted file mode 100644 index 578adf2..0000000 --- a/src/main/resources/static/editor.md-master/plugins/table-dialog/table-dialog.js +++ /dev/null @@ -1,218 +0,0 @@ -/*! - * Table dialog plugin for Editor.md - * - * @file table-dialog.js - * @author pandao - * @version 1.2.1 - * @updateTime 2015-06-09 - * {@link https://github.com/pandao/editor.md} - * @license MIT - */ - -(function() { - - var factory = function (exports) { - - var $ = jQuery; - var pluginName = "table-dialog"; - - var langs = { - "zh-cn" : { - toolbar : { - table : "表格" - }, - dialog : { - table : { - title : "添加表格", - cellsLabel : "单元格数", - alignLabel : "对齐方式", - rows : "行数", - cols : "列数", - aligns : ["默认", "左对齐", "居中对齐", "右对齐"] - } - } - }, - "zh-tw" : { - toolbar : { - table : "添加表格" - }, - dialog : { - table : { - title : "添加表格", - cellsLabel : "單元格數", - alignLabel : "對齊方式", - rows : "行數", - cols : "列數", - aligns : ["默認", "左對齊", "居中對齊", "右對齊"] - } - } - }, - "en" : { - toolbar : { - table : "Tables" - }, - dialog : { - table : { - title : "Tables", - cellsLabel : "Cells", - alignLabel : "Align", - rows : "Rows", - cols : "Cols", - aligns : ["Default", "Left align", "Center align", "Right align"] - } - } - } - }; - - exports.fn.tableDialog = function() { - var _this = this; - var cm = this.cm; - var editor = this.editor; - var settings = this.settings; - var path = settings.path + "../plugins/" + pluginName +"/"; - var classPrefix = this.classPrefix; - var dialogName = classPrefix + pluginName, dialog; - - $.extend(true, this.lang, langs[this.lang.name]); - this.setToolbar(); - - var lang = this.lang; - var dialogLang = lang.dialog.table; - - var dialogContent = [ - "
        ", - "", - dialogLang.rows + "   ", - dialogLang.cols + "
        ", - "", - "
        ", - "
        " - ].join("\n"); - - if (editor.find("." + dialogName).length > 0) - { - dialog = editor.find("." + dialogName); - - this.dialogShowMask(dialog); - this.dialogLockScreen(); - dialog.show(); - } - else - { - dialog = this.createDialog({ - name : dialogName, - title : dialogLang.title, - width : 360, - height : 226, - mask : settings.dialogShowMask, - drag : settings.dialogDraggable, - content : dialogContent, - lockScreen : settings.dialogLockScreen, - maskStyle : { - opacity : settings.dialogMaskOpacity, - backgroundColor : settings.dialogMaskBgColor - }, - buttons : { - enter : [lang.buttons.enter, function() { - var rows = parseInt(this.find("[data-rows]").val()); - var cols = parseInt(this.find("[data-cols]").val()); - var align = this.find("[name=\"table-align\"]:checked").val(); - var table = ""; - var hrLine = "------------"; - - var alignSign = { - _default : hrLine, - left : ":" + hrLine, - center : ":" + hrLine + ":", - right : hrLine + ":" - }; - - if ( rows > 1 && cols > 0) - { - for (var r = 0, len = rows; r < len; r++) - { - var row = []; - var head = []; - - for (var c = 0, len2 = cols; c < len2; c++) - { - if (r === 1) { - head.push(alignSign[align]); - } - - row.push(" "); - } - - if (r === 1) { - table += "| " + head.join(" | ") + " |" + "\n"; - } - - table += "| " + row.join( (cols === 1) ? "" : " | " ) + " |" + "\n"; - } - } - - cm.replaceSelection(table); - - this.hide().lockScreen(false).hideMask(); - - return false; - }], - - cancel : [lang.buttons.cancel, function() { - this.hide().lockScreen(false).hideMask(); - - return false; - }] - } - }); - } - - var faBtns = dialog.find(".fa-btns"); - - if (faBtns.html() === "") - { - var icons = ["align-justify", "align-left", "align-center", "align-right"]; - var _lang = dialogLang.aligns; - var values = ["_default", "left", "center", "right"]; - - for (var i = 0, len = icons.length; i < len; i++) - { - var checked = (i === 0) ? " checked=\"checked\"" : ""; - var btn = ""; - - faBtns.append(btn); - } - } - }; - - }; - - // CommonJS/Node.js - if (typeof require === "function" && typeof exports === "object" && typeof module === "object") - { - module.exports = factory; - } - else if (typeof define === "function") // AMD/CMD/Sea.js - { - if (define.amd) { // for Require.js - - define(["editormd"], function(editormd) { - factory(editormd); - }); - - } else { // for Sea.js - define(function(require) { - var editormd = require("./../../editormd"); - factory(editormd); - }); - } - } - else - { - factory(window.editormd); - } - -})(); diff --git a/src/main/resources/static/editor.md-master/plugins/test-plugin/test-plugin.js b/src/main/resources/static/editor.md-master/plugins/test-plugin/test-plugin.js deleted file mode 100644 index bc4da31..0000000 --- a/src/main/resources/static/editor.md-master/plugins/test-plugin/test-plugin.js +++ /dev/null @@ -1,66 +0,0 @@ -/*! - * Test plugin for Editor.md - * - * @file test-plugin.js - * @author pandao - * @version 1.2.0 - * @updateTime 2015-03-07 - * {@link https://github.com/pandao/editor.md} - * @license MIT - */ - -(function() { - - var factory = function (exports) { - - var $ = jQuery; // if using module loader(Require.js/Sea.js). - - exports.testPlugin = function(){ - alert("testPlugin"); - }; - - exports.fn.testPluginMethodA = function() { - /* - var _this = this; // this == the current instance object of Editor.md - var lang = _this.lang; - var settings = _this.settings; - var editor = this.editor; - var cursor = cm.getCursor(); - var selection = cm.getSelection(); - var classPrefix = this.classPrefix; - - cm.focus(); - */ - //.... - - alert("testPluginMethodA"); - }; - - }; - - // CommonJS/Node.js - if (typeof require === "function" && typeof exports === "object" && typeof module === "object") - { - module.exports = factory; - } - else if (typeof define === "function") // AMD/CMD/Sea.js - { - if (define.amd) { // for Require.js - - define(["editormd"], function(editormd) { - factory(editormd); - }); - - } else { // for Sea.js - define(function(require) { - var editormd = require("./../../editormd"); - factory(editormd); - }); - } - } - else - { - factory(window.editormd); - } - -})(); diff --git a/src/main/resources/static/font-awesome-4.5.0/HELP-US-OUT.txt b/src/main/resources/static/font-awesome-4.5.0/HELP-US-OUT.txt deleted file mode 100644 index cfd9d9f..0000000 --- a/src/main/resources/static/font-awesome-4.5.0/HELP-US-OUT.txt +++ /dev/null @@ -1,7 +0,0 @@ -I hope you love Font Awesome. If you've found it useful, please do me a favor and check out my latest project, -Fonticons (https://fonticons.com). It makes it easy to put the perfect icons on your website. Choose from our awesome, -comprehensive icon sets or copy and paste your own. - -Please. Check it out. - --Dave Gandy diff --git a/src/main/resources/static/font-awesome-4.5.0/css/font-awesome.min.css b/src/main/resources/static/font-awesome-4.5.0/css/font-awesome.min.css deleted file mode 100644 index d0603cb..0000000 --- a/src/main/resources/static/font-awesome-4.5.0/css/font-awesome.min.css +++ /dev/null @@ -1,4 +0,0 @@ -/*! - * Font Awesome 4.5.0 by @davegandy - http://fontawesome.io - @fontawesome - * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) - */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.5.0');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.5.0') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2?v=4.5.0') format('woff2'),url('../fonts/fontawesome-webfont.woff?v=4.5.0') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.5.0') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.5.0#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-y-combinator-square:before,.fa-yc-square:before,.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-hotel:before,.fa-bed:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-yc:before,.fa-y-combinator:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery-full:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-stop-o:before,.fa-hand-paper-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-tv:before,.fa-television:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"}.fa-reddit-alien:before{content:"\f281"}.fa-edge:before{content:"\f282"}.fa-credit-card-alt:before{content:"\f283"}.fa-codiepie:before{content:"\f284"}.fa-modx:before{content:"\f285"}.fa-fort-awesome:before{content:"\f286"}.fa-usb:before{content:"\f287"}.fa-product-hunt:before{content:"\f288"}.fa-mixcloud:before{content:"\f289"}.fa-scribd:before{content:"\f28a"}.fa-pause-circle:before{content:"\f28b"}.fa-pause-circle-o:before{content:"\f28c"}.fa-stop-circle:before{content:"\f28d"}.fa-stop-circle-o:before{content:"\f28e"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-hashtag:before{content:"\f292"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-percent:before{content:"\f295"} diff --git a/src/main/resources/static/font-awesome-4.5.0/fonts/FontAwesome.otf b/src/main/resources/static/font-awesome-4.5.0/fonts/FontAwesome.otf deleted file mode 100644 index 3ed7f8b..0000000 Binary files a/src/main/resources/static/font-awesome-4.5.0/fonts/FontAwesome.otf and /dev/null differ diff --git a/src/main/resources/static/font-awesome-4.5.0/fonts/fontawesome-webfont.eot b/src/main/resources/static/font-awesome-4.5.0/fonts/fontawesome-webfont.eot deleted file mode 100644 index 9b6afae..0000000 Binary files a/src/main/resources/static/font-awesome-4.5.0/fonts/fontawesome-webfont.eot and /dev/null differ diff --git a/src/main/resources/static/font-awesome-4.5.0/fonts/fontawesome-webfont.svg b/src/main/resources/static/font-awesome-4.5.0/fonts/fontawesome-webfont.svg deleted file mode 100644 index d05688e..0000000 --- a/src/main/resources/static/font-awesome-4.5.0/fonts/fontawesome-webfont.svg +++ /dev/null @@ -1,655 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/static/font-awesome-4.5.0/fonts/fontawesome-webfont.ttf b/src/main/resources/static/font-awesome-4.5.0/fonts/fontawesome-webfont.ttf deleted file mode 100644 index 26dea79..0000000 Binary files a/src/main/resources/static/font-awesome-4.5.0/fonts/fontawesome-webfont.ttf and /dev/null differ diff --git a/src/main/resources/static/font-awesome-4.5.0/fonts/fontawesome-webfont.woff b/src/main/resources/static/font-awesome-4.5.0/fonts/fontawesome-webfont.woff deleted file mode 100644 index dc35ce3..0000000 Binary files a/src/main/resources/static/font-awesome-4.5.0/fonts/fontawesome-webfont.woff and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-01-tn.jpg b/src/main/resources/static/img/tm-img-01-tn.jpg deleted file mode 100644 index 10e0e7b..0000000 Binary files a/src/main/resources/static/img/tm-img-01-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-01.jpg b/src/main/resources/static/img/tm-img-01.jpg deleted file mode 100644 index 1aceecd..0000000 Binary files a/src/main/resources/static/img/tm-img-01.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-02-tn.jpg b/src/main/resources/static/img/tm-img-02-tn.jpg deleted file mode 100644 index 2abfc96..0000000 Binary files a/src/main/resources/static/img/tm-img-02-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-02.jpg b/src/main/resources/static/img/tm-img-02.jpg deleted file mode 100644 index 6dc667f..0000000 Binary files a/src/main/resources/static/img/tm-img-02.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-03-tn.jpg b/src/main/resources/static/img/tm-img-03-tn.jpg deleted file mode 100644 index 703afed..0000000 Binary files a/src/main/resources/static/img/tm-img-03-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-03.jpg b/src/main/resources/static/img/tm-img-03.jpg deleted file mode 100644 index b10ef01..0000000 Binary files a/src/main/resources/static/img/tm-img-03.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-04-tn.jpg b/src/main/resources/static/img/tm-img-04-tn.jpg deleted file mode 100644 index e226b60..0000000 Binary files a/src/main/resources/static/img/tm-img-04-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-04.jpg b/src/main/resources/static/img/tm-img-04.jpg deleted file mode 100644 index 5165a03..0000000 Binary files a/src/main/resources/static/img/tm-img-04.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-05-tn.jpg b/src/main/resources/static/img/tm-img-05-tn.jpg deleted file mode 100644 index cc1cdbf..0000000 Binary files a/src/main/resources/static/img/tm-img-05-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-05.jpg b/src/main/resources/static/img/tm-img-05.jpg deleted file mode 100644 index eccd1a2..0000000 Binary files a/src/main/resources/static/img/tm-img-05.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-06-tn.jpg b/src/main/resources/static/img/tm-img-06-tn.jpg deleted file mode 100644 index 1affbb7..0000000 Binary files a/src/main/resources/static/img/tm-img-06-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-06.jpg b/src/main/resources/static/img/tm-img-06.jpg deleted file mode 100644 index 76f563b..0000000 Binary files a/src/main/resources/static/img/tm-img-06.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-07-tn.jpg b/src/main/resources/static/img/tm-img-07-tn.jpg deleted file mode 100644 index 78c2aa9..0000000 Binary files a/src/main/resources/static/img/tm-img-07-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-07.jpg b/src/main/resources/static/img/tm-img-07.jpg deleted file mode 100644 index feebd52..0000000 Binary files a/src/main/resources/static/img/tm-img-07.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-08-tn.jpg b/src/main/resources/static/img/tm-img-08-tn.jpg deleted file mode 100644 index 3966ecb..0000000 Binary files a/src/main/resources/static/img/tm-img-08-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-08.jpg b/src/main/resources/static/img/tm-img-08.jpg deleted file mode 100644 index 98c7368..0000000 Binary files a/src/main/resources/static/img/tm-img-08.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-09-tn.jpg b/src/main/resources/static/img/tm-img-09-tn.jpg deleted file mode 100644 index c4e97e5..0000000 Binary files a/src/main/resources/static/img/tm-img-09-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-09.jpg b/src/main/resources/static/img/tm-img-09.jpg deleted file mode 100644 index 4040df4..0000000 Binary files a/src/main/resources/static/img/tm-img-09.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-10-tn.jpg b/src/main/resources/static/img/tm-img-10-tn.jpg deleted file mode 100644 index 1b07b1c..0000000 Binary files a/src/main/resources/static/img/tm-img-10-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-10.jpg b/src/main/resources/static/img/tm-img-10.jpg deleted file mode 100644 index d9fb410..0000000 Binary files a/src/main/resources/static/img/tm-img-10.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-11-tn.jpg b/src/main/resources/static/img/tm-img-11-tn.jpg deleted file mode 100644 index 228ec56..0000000 Binary files a/src/main/resources/static/img/tm-img-11-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-11.jpg b/src/main/resources/static/img/tm-img-11.jpg deleted file mode 100644 index 4442b09..0000000 Binary files a/src/main/resources/static/img/tm-img-11.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-12-tn.jpg b/src/main/resources/static/img/tm-img-12-tn.jpg deleted file mode 100644 index e047104..0000000 Binary files a/src/main/resources/static/img/tm-img-12-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-12.jpg b/src/main/resources/static/img/tm-img-12.jpg deleted file mode 100644 index 7c3a691..0000000 Binary files a/src/main/resources/static/img/tm-img-12.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-13-tn.jpg b/src/main/resources/static/img/tm-img-13-tn.jpg deleted file mode 100644 index 9289dad..0000000 Binary files a/src/main/resources/static/img/tm-img-13-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-13.jpg b/src/main/resources/static/img/tm-img-13.jpg deleted file mode 100644 index 7bba72e..0000000 Binary files a/src/main/resources/static/img/tm-img-13.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-14-tn.jpg b/src/main/resources/static/img/tm-img-14-tn.jpg deleted file mode 100644 index 3807ba0..0000000 Binary files a/src/main/resources/static/img/tm-img-14-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-14.jpg b/src/main/resources/static/img/tm-img-14.jpg deleted file mode 100644 index ccf99d6..0000000 Binary files a/src/main/resources/static/img/tm-img-14.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-15-tn.jpg b/src/main/resources/static/img/tm-img-15-tn.jpg deleted file mode 100644 index 13cbed1..0000000 Binary files a/src/main/resources/static/img/tm-img-15-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-15.jpg b/src/main/resources/static/img/tm-img-15.jpg deleted file mode 100644 index 63872dd..0000000 Binary files a/src/main/resources/static/img/tm-img-15.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-16-tn.jpg b/src/main/resources/static/img/tm-img-16-tn.jpg deleted file mode 100644 index d57d988..0000000 Binary files a/src/main/resources/static/img/tm-img-16-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-16.jpg b/src/main/resources/static/img/tm-img-16.jpg deleted file mode 100644 index 9d72164..0000000 Binary files a/src/main/resources/static/img/tm-img-16.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-17-tn.jpg b/src/main/resources/static/img/tm-img-17-tn.jpg deleted file mode 100644 index 924803f..0000000 Binary files a/src/main/resources/static/img/tm-img-17-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-17.jpg b/src/main/resources/static/img/tm-img-17.jpg deleted file mode 100644 index 924803f..0000000 Binary files a/src/main/resources/static/img/tm-img-17.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-18-tn.jpg b/src/main/resources/static/img/tm-img-18-tn.jpg deleted file mode 100644 index f017aa1..0000000 Binary files a/src/main/resources/static/img/tm-img-18-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-18.jpg b/src/main/resources/static/img/tm-img-18.jpg deleted file mode 100644 index f017aa1..0000000 Binary files a/src/main/resources/static/img/tm-img-18.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-19-tn.jpg b/src/main/resources/static/img/tm-img-19-tn.jpg deleted file mode 100644 index 64785d9..0000000 Binary files a/src/main/resources/static/img/tm-img-19-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-19.jpg b/src/main/resources/static/img/tm-img-19.jpg deleted file mode 100644 index 64785d9..0000000 Binary files a/src/main/resources/static/img/tm-img-19.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-20-tn.jpg b/src/main/resources/static/img/tm-img-20-tn.jpg deleted file mode 100644 index 924803f..0000000 Binary files a/src/main/resources/static/img/tm-img-20-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-20.jpg b/src/main/resources/static/img/tm-img-20.jpg deleted file mode 100644 index 924803f..0000000 Binary files a/src/main/resources/static/img/tm-img-20.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-21-tn.jpg b/src/main/resources/static/img/tm-img-21-tn.jpg deleted file mode 100644 index 0746d97..0000000 Binary files a/src/main/resources/static/img/tm-img-21-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-21.jpg b/src/main/resources/static/img/tm-img-21.jpg deleted file mode 100644 index 0746d97..0000000 Binary files a/src/main/resources/static/img/tm-img-21.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-22-tn.jpg b/src/main/resources/static/img/tm-img-22-tn.jpg deleted file mode 100644 index ae0b126..0000000 Binary files a/src/main/resources/static/img/tm-img-22-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-22.jpg b/src/main/resources/static/img/tm-img-22.jpg deleted file mode 100644 index ae0b126..0000000 Binary files a/src/main/resources/static/img/tm-img-22.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-23-tn.jpg b/src/main/resources/static/img/tm-img-23-tn.jpg deleted file mode 100644 index 9b77585..0000000 Binary files a/src/main/resources/static/img/tm-img-23-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-23.jpg b/src/main/resources/static/img/tm-img-23.jpg deleted file mode 100644 index 9b77585..0000000 Binary files a/src/main/resources/static/img/tm-img-23.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-24-tn.jpg b/src/main/resources/static/img/tm-img-24-tn.jpg deleted file mode 100644 index bb9aa4c..0000000 Binary files a/src/main/resources/static/img/tm-img-24-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-24.jpg b/src/main/resources/static/img/tm-img-24.jpg deleted file mode 100644 index bb9aa4c..0000000 Binary files a/src/main/resources/static/img/tm-img-24.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-25-tn.jpg b/src/main/resources/static/img/tm-img-25-tn.jpg deleted file mode 100644 index ce70e01..0000000 Binary files a/src/main/resources/static/img/tm-img-25-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-25.jpg b/src/main/resources/static/img/tm-img-25.jpg deleted file mode 100644 index ce70e01..0000000 Binary files a/src/main/resources/static/img/tm-img-25.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-26-tn.jpg b/src/main/resources/static/img/tm-img-26-tn.jpg deleted file mode 100644 index 551201a..0000000 Binary files a/src/main/resources/static/img/tm-img-26-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-26.jpg b/src/main/resources/static/img/tm-img-26.jpg deleted file mode 100644 index 551201a..0000000 Binary files a/src/main/resources/static/img/tm-img-26.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-30-tn.jpg b/src/main/resources/static/img/tm-img-30-tn.jpg deleted file mode 100644 index f59d8bf..0000000 Binary files a/src/main/resources/static/img/tm-img-30-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-30.jpg b/src/main/resources/static/img/tm-img-30.jpg deleted file mode 100644 index f59d8bf..0000000 Binary files a/src/main/resources/static/img/tm-img-30.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-31-tn.jpg b/src/main/resources/static/img/tm-img-31-tn.jpg deleted file mode 100644 index 00eef09..0000000 Binary files a/src/main/resources/static/img/tm-img-31-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-31.jpg b/src/main/resources/static/img/tm-img-31.jpg deleted file mode 100644 index 00eef09..0000000 Binary files a/src/main/resources/static/img/tm-img-31.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-32-tn.jpg b/src/main/resources/static/img/tm-img-32-tn.jpg deleted file mode 100644 index fce3f4f..0000000 Binary files a/src/main/resources/static/img/tm-img-32-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-32.jpg b/src/main/resources/static/img/tm-img-32.jpg deleted file mode 100644 index fce3f4f..0000000 Binary files a/src/main/resources/static/img/tm-img-32.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-33-tn.jpg b/src/main/resources/static/img/tm-img-33-tn.jpg deleted file mode 100644 index 7d67044..0000000 Binary files a/src/main/resources/static/img/tm-img-33-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-33.jpg b/src/main/resources/static/img/tm-img-33.jpg deleted file mode 100644 index 7d67044..0000000 Binary files a/src/main/resources/static/img/tm-img-33.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-34-tn.jpg b/src/main/resources/static/img/tm-img-34-tn.jpg deleted file mode 100644 index eb1fac4..0000000 Binary files a/src/main/resources/static/img/tm-img-34-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-34.jpg b/src/main/resources/static/img/tm-img-34.jpg deleted file mode 100644 index eb1fac4..0000000 Binary files a/src/main/resources/static/img/tm-img-34.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-35-tn.jpg b/src/main/resources/static/img/tm-img-35-tn.jpg deleted file mode 100644 index c92cb8f..0000000 Binary files a/src/main/resources/static/img/tm-img-35-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-35.jpg b/src/main/resources/static/img/tm-img-35.jpg deleted file mode 100644 index c92cb8f..0000000 Binary files a/src/main/resources/static/img/tm-img-35.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-36-tn.jpg b/src/main/resources/static/img/tm-img-36-tn.jpg deleted file mode 100644 index d808da4..0000000 Binary files a/src/main/resources/static/img/tm-img-36-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-36.jpg b/src/main/resources/static/img/tm-img-36.jpg deleted file mode 100644 index d808da4..0000000 Binary files a/src/main/resources/static/img/tm-img-36.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-37-tn.jpg b/src/main/resources/static/img/tm-img-37-tn.jpg deleted file mode 100644 index e994dd1..0000000 Binary files a/src/main/resources/static/img/tm-img-37-tn.jpg and /dev/null differ diff --git a/src/main/resources/static/img/tm-img-37.jpg b/src/main/resources/static/img/tm-img-37.jpg deleted file mode 100644 index e994dd1..0000000 Binary files a/src/main/resources/static/img/tm-img-37.jpg and /dev/null differ diff --git a/src/main/resources/static/js/APlayer.min.js b/src/main/resources/static/js/APlayer.min.js deleted file mode 100644 index a1c9036..0000000 --- a/src/main/resources/static/js/APlayer.min.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("APlayer",[],t):"object"==typeof exports?exports.APlayer=t():e.APlayer=t()}(window,function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var a=t[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=41)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=/mobile/i.test(window.navigator.userAgent),a={secondToTime:function(e){var t=Math.floor(e/3600),n=Math.floor((e-3600*t)/60),i=Math.floor(e-3600*t-60*n);return(t>0?[t,n,i]:[n,i]).map(function(e){return e<10?"0"+e:""+e}).join(":")},getElementViewLeft:function(e){var t=e.offsetLeft,n=e.offsetParent,i=document.body.scrollLeft+document.documentElement.scrollLeft;if(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement)for(;null!==n&&n!==e;)t+=n.offsetLeft,n=n.offsetParent;else for(;null!==n;)t+=n.offsetLeft,n=n.offsetParent;return t-i},getElementViewTop:function(e,t){for(var n,i=e.offsetTop,a=e.offsetParent;null!==a;)i+=a.offsetTop,a=a.offsetParent;return n=document.body.scrollTop+document.documentElement.scrollTop,t?i:i-n},isMobile:i,storage:{set:function(e,t){localStorage.setItem(e,t)},get:function(e){return localStorage.getItem(e)}},nameMap:{dragStart:i?"touchstart":"mousedown",dragMove:i?"touchmove":"mousemove",dragEnd:i?"touchend":"mouseup"},randomOrder:function(e){return function(e){for(var t=e.length-1;t>=0;t--){var n=Math.floor(Math.random()*(t+1)),i=e[n];e[n]=e[t],e[t]=i}return e}([].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t\n ',t+=r(n+s),t+='\n ',t+=r(e.name),t+='\n ',t+=r(e.artist),t+="\n\n"}),t}},function(e,t,n){"use strict";e.exports=n(15)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=g(n(33)),a=g(n(32)),r=g(n(31)),o=g(n(30)),s=g(n(29)),l=g(n(28)),u=g(n(27)),c=g(n(26)),p=g(n(25)),d=g(n(24)),h=g(n(23)),y=g(n(22)),f=g(n(21)),v=g(n(20)),m=g(n(19));function g(e){return e&&e.__esModule?e:{default:e}}var w={play:i.default,pause:a.default,volumeUp:r.default,volumeDown:o.default,volumeOff:s.default,orderRandom:l.default,orderList:u.default,menu:c.default,loopAll:p.default,loopOne:d.default,loopNone:h.default,loading:y.default,right:f.default,skip:v.default,lrc:m.default};t.default=w},function(e,t,n){"use strict";var i,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":a(window))&&(i=window)}e.exports=i},function(e,t,n){"use strict";var i,a,r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};void 0===(a="function"==typeof(i=function(){if("object"===("undefined"==typeof window?"undefined":r(window))&&void 0!==document.querySelectorAll&&void 0!==window.pageYOffset&&void 0!==history.pushState){var e=function(e,t,n,i){return n>i?t:e+(t-e)*((a=n/i)<.5?4*a*a*a:(a-1)*(2*a-2)*(2*a-2)+1);var a},t=function(t,n,i,a){n=n||500;var r=(a=a||window).scrollTop||window.pageYOffset;if("number"==typeof t)var o=parseInt(t);else var o=function(e,t){return"HTML"===e.nodeName?-t:e.getBoundingClientRect().top+t}(t,r);var s=Date.now(),l=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){window.setTimeout(e,15)};!function u(){var c=Date.now()-s;a!==window?a.scrollTop=e(r,o,c,n):window.scroll(0,e(r,o,c,n)),c>n?"function"==typeof i&&i(t):l(u)}()},n=function(e){if(!e.defaultPrevented){e.preventDefault(),location.hash!==this.hash&&window.history.pushState(null,null,this.hash);var n=document.getElementById(this.hash.substring(1));if(!n)return;t(n,500,function(e){location.replace("#"+e.id)})}};return document.addEventListener("DOMContentLoaded",function(){for(var e,t=document.querySelectorAll('a[href^="#"]:not([href="#"])'),i=t.length;e=t[--i];)e.addEventListener("click",n,!1)}),t}})?i.call(t,n,t,e):i)||(e.exports=a)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n1),n=0===this.audios.length;this.player.template.listOl.innerHTML+=(0,a.default)({theme:this.player.options.theme,audio:e,index:this.audios.length+1}),this.audios=this.audios.concat(e),t&&this.audios.length>1&&this.player.container.classList.add("aplayer-withlist"),this.player.randomOrder=r.default.randomOrder(this.audios.length),this.player.template.listCurs=this.player.container.querySelectorAll(".aplayer-list-cur"),this.player.template.listCurs[this.audios.length-1].style.backgroundColor=e.theme||this.player.options.theme,n&&("random"===this.player.options.order?this.switch(this.player.randomOrder[0]):this.switch(0))}},{key:"remove",value:function(e){if(this.player.events.trigger("listremove",{index:e}),this.audios[e])if(this.audios.length>1){var t=this.player.container.querySelectorAll(".aplayer-list li");t[e].remove(),this.audios.splice(e,1),this.lrc.parsed.splice(e,1),e===this.index&&(this.audios[e]?this.switch(e):this.switch(e-1)),this.index>e&&this.index--;for(var n=e;nt&&!e.player.audio.paused&&(e.player.container.classList.remove("aplayer-loading"),i=!1),t=n)},100)}},{key:"enable",value:function(e){this["enable"+e+"Checker"]=!0,"fps"===e&&this.initfpsChecker()}},{key:"disable",value:function(e){this["enable"+e+"Checker"]=!1}},{key:"destroy",value:function(){var e=this;this.types.forEach(function(t){e["enable"+t+"Checker"]=!1,e[t+"Checker"]&&clearInterval(e[t+"Checker"])})}}]),e}();t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n1?"one"===e.player.options.loop?(e.player.options.loop="none",e.player.template.loop.innerHTML=r.default.loopNone):"none"===e.player.options.loop?(e.player.options.loop="all",e.player.template.loop.innerHTML=r.default.loopAll):"all"===e.player.options.loop&&(e.player.options.loop="one",e.player.template.loop.innerHTML=r.default.loopOne):"one"===e.player.options.loop||"all"===e.player.options.loop?(e.player.options.loop="none",e.player.template.loop.innerHTML=r.default.loopNone):"none"===e.player.options.loop&&(e.player.options.loop="all",e.player.template.loop.innerHTML=r.default.loopAll)})}},{key:"initMenuButton",value:function(){var e=this;this.player.template.menu.addEventListener("click",function(){e.player.list.toggle()})}},{key:"initMiniSwitcher",value:function(){var e=this;this.player.template.miniSwitcher.addEventListener("click",function(){e.player.setMode("mini"===e.player.mode?"normal":"mini")})}},{key:"initSkipButton",value:function(){var e=this;this.player.template.skipBackButton.addEventListener("click",function(){e.player.skipBack()}),this.player.template.skipForwardButton.addEventListener("click",function(){e.player.skipForward()}),this.player.template.skipPlayButton.addEventListener("click",function(){e.player.toggle()})}},{key:"initLrcButton",value:function(){var e=this;this.player.template.lrcButton.addEventListener("click",function(){e.player.template.lrcButton.classList.contains("aplayer-icon-lrc-inactivity")?(e.player.template.lrcButton.classList.remove("aplayer-icon-lrc-inactivity"),e.player.lrc&&e.player.lrc.show()):(e.player.template.lrcButton.classList.add("aplayer-icon-lrc-inactivity"),e.player.lrc&&e.player.lrc.hide())})}}]),e}();t.default=s},function(e,t,n){var i=n(2);e.exports=function(e){"use strict";e=e||{};var t="",n=i.$each,a=e.lyrics,r=(e.$value,e.$index,i.$escape);return n(a,function(e,n){t+="\n \n"}),t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,a=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:this.player.audio.currentTime;if(this.index>this.current.length-1||e=this.current[this.index+1][0])for(var t=0;t=this.current[t][0]&&(!this.current[t+1]||e=200&&n.status<300||304===n.status?t.parsed[e]=t.parse(n.responseText):(t.player.notice("LRC file request fails: status "+n.status),t.parsed[e]=[["00:00","Not available"]]),t.container.innerHTML=(0,o.default)({lyrics:t.parsed[e]}),t.update(0),t.current=t.parsed[e])};var i=this.player.list.audios[e].lrc;n.open("get",i,!0),n.send(null)}else this.player.list.audios[e].lrc?this.parsed[e]=this.parse(this.player.list.audios[e].lrc):this.parsed[e]=[["00:00","Not available"]];this.container.innerHTML=(0,o.default)({lyrics:this.parsed[e]}),this.update(0),this.current=this.parsed[e]}},{key:"parse",value:function(e){if(e){for(var t=(e=e.replace(/([^\]^\n])\[/g,function(e,t){return t+"\n["})).split("\n"),n=[],i=t.length,a=0;a/g,"").replace(/^\s+|\s+$/g,"");if(r)for(var s=r.length,l=0;l]/;a.$escape=function(e){return function(e){var t=""+e,n=r.exec(t);if(!n)return e;var i="",a=void 0,o=void 0,s=void 0;for(a=n.index,o=0;a\n \n
        ',t+=s.play,t+='
        \n
        \n \n
        \n
        \n\n
        \n
        \n
        \n'):(t+='\n
        \n
        \n
        ',t+=s.play,t+='
        \n
        \n
        \n
        \n No audio\n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n \n ',t+=s.loading,t+='\n \n
        \n
        \n
        \n
        \n \n 00:00 / 00:00\n \n \n ',t+=s.skip,t+='\n \n \n ',t+=s.play,t+='\n \n \n ',t+=s.skip,t+='\n \n
        \n \n
        \n
        \n
        \n
        \n
        \n
        \n \n \n \n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n '},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t,n){"use strict";var i,a,r=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function l(e){if(i===setTimeout)return setTimeout(e,0);if((i===o||!i)&&setTimeout)return i=setTimeout,setTimeout(e,0);try{return i(e,0)}catch(t){try{return i.call(null,e,0)}catch(t){return i.call(this,e,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:o}catch(e){i=o}try{a="function"==typeof clearTimeout?clearTimeout:s}catch(e){a=s}}();var u,c=[],p=!1,d=-1;function h(){p&&u&&(p=!1,u.length?c=u.concat(c):d=-1,c.length&&y())}function y(){if(!p){var e=l(h);p=!0;for(var t=c.length;t;){for(u=c,c=[];++d1)for(var n=1;n=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(35),t.setImmediate=setImmediate,t.clearImmediate=clearImmediate},function(e,t,n){"use strict";(function(t){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=setTimeout;function a(){}function r(e){if(!(this instanceof r))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],c(e,this)}function o(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,r._immediateFn(function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var i;try{i=n(e._value)}catch(e){return void l(t.promise,e)}s(t.promise,i)}else(1===e._state?s:l)(t.promise,e._value)})):e._deferreds.push(t)}function s(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"===(void 0===t?"undefined":n(t))||"function"==typeof t)){var i=t.then;if(t instanceof r)return e._state=3,e._value=t,void u(e);if("function"==typeof i)return void c((a=i,o=t,function(){a.apply(o,arguments)}),e)}e._state=1,e._value=t,u(e)}catch(t){l(e,t)}var a,o}function l(e,t){e._state=2,e._value=t,u(e)}function u(e){2===e._state&&0===e._deferreds.length&&r._immediateFn(function(){e._handled||r._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t1&&this.container.classList.add("aplayer-withlist"),r.default.isMobile&&this.container.classList.add("aplayer-mobile"),this.arrow=this.container.offsetWidth<=300,this.arrow&&this.container.classList.add("aplayer-arrow"),this.container=this.options.container,2===this.options.lrcType||!0===this.options.lrcType)for(var n=this.container.getElementsByClassName("aplayer-lrc-content"),i=0;i0&&void 0!==arguments[0]?arguments[0]:this.list.audios[this.list.index].theme||this.options.theme,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.list.index;(!(arguments.length>2&&void 0!==arguments[2])||arguments[2])&&this.list.audios[t]&&(this.list.audios[t].theme=e),this.template.listCurs[t]&&(this.template.listCurs[t].style.backgroundColor=e),t===this.list.index&&(this.template.pic.style.backgroundColor=e,this.template.played.style.background=e,this.template.thumb.style.background=e,this.template.volume.style.background=e)}},{key:"seek",value:function(e){e=Math.max(e,0),e=Math.min(e,this.duration),this.audio.currentTime=e,this.bar.set("played",e/this.duration,"width"),this.template.ptime.innerHTML=r.default.secondToTime(e)}},{key:"setUIPlaying",value:function(){var e=this;if(this.paused&&(this.paused=!1,this.template.button.classList.remove("aplayer-play"),this.template.button.classList.add("aplayer-pause"),this.template.button.innerHTML="",setTimeout(function(){e.template.button.innerHTML=o.default.pause},100),this.template.skipPlayButton.innerHTML=o.default.pause),this.timer.enable("loading"),this.options.mutex)for(var t=0;t=.95?this.template.volumeButton.innerHTML=o.default.volumeUp:this.volume()>0?this.template.volumeButton.innerHTML=o.default.volumeDown:this.template.volumeButton.innerHTML=o.default.volumeOff}},{key:"volume",value:function(e,t){return e=parseFloat(e),isNaN(e)||(e=Math.max(e,0),e=Math.min(e,1),this.bar.set("volume",e,"height"),t||this.storage.set("volume",e),this.audio.volume=e,this.audio.muted&&(this.audio.muted=!1),this.switchVolumeIcon()),this.audio.muted?0:this.audio.volume}},{key:"on",value:function(e,t){this.events.on(e,t)}},{key:"toggle",value:function(){this.template.button.classList.contains("aplayer-play")?this.play():this.template.button.classList.contains("aplayer-pause")&&this.pause()}},{key:"switchAudio",value:function(e){this.list.switch(e)}},{key:"addAudio",value:function(e){this.list.add(e)}},{key:"removeAudio",value:function(e){this.list.remove(e)}},{key:"destroy",value:function(){m.splice(m.indexOf(this),1),this.pause(),this.container.innerHTML="",this.audio.src="",this.timer.destroy(),this.events.trigger("destroy")}},{key:"setMode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"normal";this.mode=e,"mini"===e?this.container.classList.add("aplayer-narrow"):"normal"===e&&this.container.classList.remove("aplayer-narrow")}},{key:"notice",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.8;this.template.notice.innerHTML=e,this.template.notice.style.opacity=i,this.noticeTime&&clearTimeout(this.noticeTime),this.events.trigger("noticeshow",{text:e}),n&&(this.noticeTime=setTimeout(function(){t.template.notice.style.opacity=0,t.events.trigger("noticehide")},n))}},{key:"prevIndex",value:function(){if(!(this.list.audios.length>1))return 0;if("list"===this.options.order)return this.list.index-1<0?this.list.audios.length-1:this.list.index-1;if("random"===this.options.order){var e=this.randomOrder.indexOf(this.list.index);return 0===e?this.randomOrder[this.randomOrder.length-1]:this.randomOrder[e-1]}}},{key:"nextIndex",value:function(){if(!(this.list.audios.length>1))return 0;if("list"===this.options.order)return(this.list.index+1)%this.list.audios.length;if("random"===this.options.order){var e=this.randomOrder.indexOf(this.list.index);return e===this.randomOrder.length-1?this.randomOrder[0]:this.randomOrder[e+1]}}},{key:"skipBack",value:function(){this.list.switch(this.prevIndex())}},{key:"skipForward",value:function(){this.list.switch(this.nextIndex())}},{key:"duration",get:function(){return isNaN(this.audio.duration)?0:this.audio.duration}}],[{key:"version",get:function(){return"1.10.0"}}]),e}();t.default=g},,function(e,t,n){},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(40);var i,a=n(38),r=(i=a)&&i.__esModule?i:{default:i};t.default=r.default}]).default}); -//# sourceMappingURL=APlayer.min.js.map diff --git a/src/main/resources/static/js/Meting.min.js b/src/main/resources/static/js/Meting.min.js deleted file mode 100644 index 2ce9cd3..0000000 --- a/src/main/resources/static/js/Meting.min.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";var aplayers=[],loadMeting=function(){function a(a,t){var e={container:a,audio:t,mini:null,fixed:null,autoplay:!1,mutex:!0,lrcType:3,listFolded:!1,preload:"auto",theme:"#2980b9",loop:"all",order:"list",volume:null,listMaxHeight:null,customAudioType:null,storageName:"metingjs"};if(t.length){t[0].lrc||(e.lrcType=0);var r={};for(var s in e){var n=s.toLowerCase();(a.dataset.hasOwnProperty(n)||a.dataset.hasOwnProperty(s)||null!==e[s])&&(r[s]=a.dataset[n]||a.dataset[s]||e[s],"true"!==r[s]&&"false"!==r[s]||(r[s]="true"==r[s]))}aplayers.push(new APlayer(r))}}var t="https://api.i-meto.com/meting/api?server=:server&type=:type&id=:id&r=:r";"undefined"!=typeof meting_api&&(t=meting_api);for(var e=0;e=200&&o.status<300||304===o.status)){var t=JSON.parse(o.responseText);a(e,t)}},o.open("get",n,!0),o.send(null)}else if(e.dataset.url){var l=[{name:e.dataset.name||e.dataset.title||"Audio name",artist:e.dataset.artist||e.dataset.author||"Audio artist",url:e.dataset.url,cover:e.dataset.cover||e.dataset.pic,lrc:e.dataset.lrc,type:e.dataset.type||"auto"}];a(e,l)}})()}};document.addEventListener("DOMContentLoaded",loadMeting,!1); diff --git a/src/main/resources/static/js/app.js b/src/main/resources/static/js/app.js deleted file mode 100644 index b862d90..0000000 --- a/src/main/resources/static/js/app.js +++ /dev/null @@ -1,127 +0,0 @@ -/* ----------------------------------------------- -/* How to use? : Check the GitHub README -/* ----------------------------------------------- */ - -/* To load a config file (particles.json) you need to host this demo (MAMP/WAMP/local)... */ -/* -particlesJS.load('particles-js', 'particles.json', function() { - console.log('particles.js loaded - callback'); -}); -*/ - -/* Otherwise just put the config content (json): */ - -particlesJS('particles-js', - - { - "particles": { - "number": { - "value": 40, - "density": { - "enable": true, - "value_area": 800 - } - }, - "color": { - "value": "#ffffff" - }, - "shape": { - "type": "circle", - "stroke": { - "width": 0, - "color": "#000000" - }, - "polygon": { - "nb_sides": 5 - }, - "image": { - "src": "img/github.svg", - "width": 100, - "height": 100 - } - }, - "opacity": { - "value": 0.7, - "random": false, - "anim": { - "enable": false, - "speed": 1, - "opacity_min": 0.1, - "sync": false - } - }, - "size": { - "value": 3, - "random": true, - "anim": { - "enable": false, - "speed": 40, - "size_min": 0.1, - "sync": false - } - }, - "line_linked": { - "enable": true, - "distance": 150, - "color": "#ffffff", - "opacity": 0.6, - "width": 1 - }, - "move": { - "enable": true, - "speed": 6, - "direction": "none", - "random": false, - "straight": false, - "out_mode": "out", - "bounce": false, - "attract": { - "enable": false, - "rotateX": 600, - "rotateY": 1200 - } - } - }, - "interactivity": { - "detect_on": "canvas", - "events": { - "onhover": { - "enable": true, - "mode": "grab" - }, - "onclick": { - "enable": true, - "mode": "push" - }, - "resize": true - }, - "modes": { - "grab": { - "distance": 200, - "line_linked": { - "opacity": 1 - } - }, - "bubble": { - "distance": 400, - "size": 40, - "duration": 2, - "opacity": 8, - "speed": 3 - }, - "repulse": { - "distance": 200, - "duration": 0.4 - }, - "push": { - "particles_nb": 4 - }, - "remove": { - "particles_nb": 2 - } - } - }, - "retina_detect": false - } - -); \ No newline at end of file diff --git a/src/main/resources/static/js/bignumber.min.js b/src/main/resources/static/js/bignumber.min.js deleted file mode 100644 index af525b1..0000000 --- a/src/main/resources/static/js/bignumber.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* bignumber.js v8.1.1 https://github.com/MikeMcl/bignumber.js/LICENCE */ -!function(e){"use strict";var r,x=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,U=Math.ceil,I=Math.floor,T="[BigNumber Error] ",C=T+"Number primitive has more than 15 significant digits: ",M=1e14,G=14,k=9007199254740991,F=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],j=1e7,q=1e9;function $(e){var r=0|e;return 0o[s]^n?1:-1;return u==l?0:l(t=e.length)){for(i=n,r-=t;--r;i+=n);e+=i}else rb?c.c=c.e=null:e.eb)c.c=c.e=null;else if(ob?e.c=e.e=null:e.c=n=a.length){if(!t)break e;for(;a.length<=l;a.push(0));u=c=0,s=(o%=G)-G+(i=1)}else{for(u=f=a[l],i=1;10<=f;f/=10,i++);c=(s=(o%=G)-G+i)<0?0:u/h[i-s-1]%10|0}if(t=t||r<0||null!=a[l+1]||(s<0?u:u%h[i-s-1]),t=n<4?(c||t)&&(0==n||n==(e.s<0?3:2)):5b?e.c=e.e=null:e.e>>11))?(n=crypto.getRandomValues(new Uint32Array(2)),r[s]=n[0],r[s+1]=n[1]):(f.push(o%1e14),s+=2);s=i/2}else{if(!crypto.randomBytes)throw O=!1,Error(T+"crypto unavailable");for(r=crypto.randomBytes(i*=7);sn-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/n|0,s[i]%=n)}return s.reverse()}return function(e,r,n,t,i){var o,s,f,u,l,c,a,h,g=e.indexOf("."),p=y,w=N;for(0<=g&&(u=E,E=0,e=e.replace(".",""),c=(h=new _(r)).pow(e.length-g),E=u,h.c=d(Y(z(c.c),c.e,"0"),10,n,m),h.e=h.c.length),f=u=(a=d(e,r,n,i?(o=S,m):(o=m,S))).length;0==a[--u];a.pop());if(!a[0])return o.charAt(0);if(g<0?--f:(c.c=a,c.e=f,c.s=t,a=(c=v(c,h,p,w,n)).c,l=c.r,f=c.e),g=a[s=f+p+1],u=n/2,l=l||s<0||null!=a[s+1],l=w<4?(null!=g||l)&&(0==w||w==(c.s<0?3:2)):un;)a[s]=0,s||(++f,a=[1].concat(a));for(u=a.length;!a[--u];);for(g=0,e="";g<=u;e+=o.charAt(a[g++]));e=Y(e,f,o.charAt(0))}return e}}(),v=function(){function S(e,r,n){var t,i,o,s,f=0,u=e.length,l=r%j,c=r/j|0;for(e=e.slice();u--;)f=((i=l*(o=e[u]%j)+(t=c*o+(s=e[u]/j|0)*l)%j*j+f)/n|0)+(t/j|0)+c*s,e[u]=i%n;return f&&(e=[f].concat(e)),e}function B(e,r,n,t){var i,o;if(n!=t)o=tr[i]?1:-1;break}return o}function R(e,r,n,t){for(var i=0;n--;)e[n]-=i,i=e[n](E[f]||0)&&s--,O<0)g.push(1),u=!0;else{for(v=E.length,N=A.length,O+=2,1<(l=I(i/(A[f=0]+1)))&&(A=S(A,l,i),E=S(E,l,i),N=A.length,v=E.length),d=N,w=(p=E.slice(0,N)).length;w=i/2&&y++;do{if(l=0,(o=B(A,p,N,w))<0){if(m=p[0],N!=w&&(m=m*i+(p[1]||0)),1<(l=I(m/y)))for(i<=l&&(l=i-1),a=(c=S(A,l,i)).length,w=p.length;1==B(c,p,a,w);)l--,R(c,No&&(l.c.length=o):t&&(l=l.mod(r))}if(i){if(0===(i=I(i/2)))break;u=i%2}else if(D(e=e.times(n),e.e+1,1),14o&&(c.c.length=o):t&&(c=c.mod(r))}return t?l:(f&&(l=w.div(l)),r?l.mod(r):o?D(l,E,N,void 0):l)},t.integerValue=function(e){var r=new _(this);return null==e?e=N:V(e,0,8),D(r,r.e+1,e)},t.isEqualTo=t.eq=function(e,r){return 0===H(this,new _(e,r))},t.isFinite=function(){return!!this.c},t.isGreaterThan=t.gt=function(e,r){return 0this.c.length-2},t.isLessThan=t.lt=function(e,r){return H(this,new _(e,r))<0},t.isLessThanOrEqualTo=t.lte=function(e,r){return-1===(r=H(this,new _(e,r)))||0===r},t.isNaN=function(){return!this.s},t.isNegative=function(){return this.s<0},t.isPositive=function(){return 0t&&(t=this.e+1),t},t.shiftedBy=function(e){return V(e,-k,k),this.times("1e"+e)},t.squareRoot=t.sqrt=function(){var e,r,n,t,i,o=this,s=o.c,f=o.s,u=o.e,l=y+4,c=new _("0.5");if(1!==f||!s||!s[0])return new _(!f||f<0&&(!s||s[0])?NaN:s?o:1/0);if((n=0==(f=Math.sqrt(+P(o)))||f==1/0?(((r=z(s)).length+u)%2==0&&(r+="0"),f=Math.sqrt(+r),u=$((u+1)/2)-(u<0||u%2),new _(r=f==1/0?"1e"+u:(r=f.toExponential()).slice(0,r.indexOf("e")+1)+u)):new _(f+"")).c[0])for((f=(u=n.e)+l)<3&&(f=0);;)if(i=n,n=c.times(i.plus(v(o,i,l,1))),z(i.c).slice(0,f)===(r=z(n.c)).slice(0,f)){if(n.e=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}(),function(){function t(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function e(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;n0?n:null}catch(t){return null}},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(e){t(e).trigger(s.end)},supportsTransitionEnd:function(){return Boolean(s)},typeCheckConfig:function(t,i,o){for(var r in o)if(o.hasOwnProperty(r)){var s=o[r],a=i[r],l=a&&n(a)?"element":e(a);if(!new RegExp(s).test(l))throw new Error(t.toUpperCase()+': Option "'+r+'" provided type "'+l+'" but expected type "'+s+'".')}}};return s=o(),t.fn.emulateTransitionEnd=r,l.supportsTransitionEnd()&&(t.event.special[l.TRANSITION_END]=i()),l}(jQuery),s=(function(t){var e="alert",i=t.fn[e],s={DISMISS:'[data-dismiss="alert"]'},a={CLOSE:"close.bs.alert",CLOSED:"closed.bs.alert",CLICK_DATA_API:"click.bs.alert.data-api"},l={ALERT:"alert",FADE:"fade",SHOW:"show"},h=function(){function e(t){n(this,e),this._element=t}return e.prototype.close=function(t){t=t||this._element;var e=this._getRootElement(t);this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},e.prototype.dispose=function(){t.removeData(this._element,"bs.alert"),this._element=null},e.prototype._getRootElement=function(e){var n=r.getSelectorFromElement(e),i=!1;return n&&(i=t(n)[0]),i||(i=t(e).closest("."+l.ALERT)[0]),i},e.prototype._triggerCloseEvent=function(e){var n=t.Event(a.CLOSE);return t(e).trigger(n),n},e.prototype._removeElement=function(e){var n=this;t(e).removeClass(l.SHOW),r.supportsTransitionEnd()&&t(e).hasClass(l.FADE)?t(e).one(r.TRANSITION_END,function(t){return n._destroyElement(e,t)}).emulateTransitionEnd(150):this._destroyElement(e)},e.prototype._destroyElement=function(e){t(e).detach().trigger(a.CLOSED).remove()},e._jQueryInterface=function(n){return this.each(function(){var i=t(this),o=i.data("bs.alert");o||(o=new e(this),i.data("bs.alert",o)),"close"===n&&o[n](this)})},e._handleDismiss=function(t){return function(e){e&&e.preventDefault(),t.close(this)}},o(e,null,[{key:"VERSION",get:function(){return"4.0.0-beta"}}]),e}();t(document).on(a.CLICK_DATA_API,s.DISMISS,h._handleDismiss(new h)),t.fn[e]=h._jQueryInterface,t.fn[e].Constructor=h,t.fn[e].noConflict=function(){return t.fn[e]=i,h._jQueryInterface}}(jQuery),function(t){var e="button",i=t.fn[e],r={ACTIVE:"active",BUTTON:"btn",FOCUS:"focus"},s={DATA_TOGGLE_CARROT:'[data-toggle^="button"]',DATA_TOGGLE:'[data-toggle="buttons"]',INPUT:"input",ACTIVE:".active",BUTTON:".btn"},a={CLICK_DATA_API:"click.bs.button.data-api",FOCUS_BLUR_DATA_API:"focus.bs.button.data-api blur.bs.button.data-api"},l=function(){function e(t){n(this,e),this._element=t}return e.prototype.toggle=function(){var e=!0,n=!0,i=t(this._element).closest(s.DATA_TOGGLE)[0];if(i){var o=t(this._element).find(s.INPUT)[0];if(o){if("radio"===o.type)if(o.checked&&t(this._element).hasClass(r.ACTIVE))e=!1;else{var a=t(i).find(s.ACTIVE)[0];a&&t(a).removeClass(r.ACTIVE)}if(e){if(o.hasAttribute("disabled")||i.hasAttribute("disabled")||o.classList.contains("disabled")||i.classList.contains("disabled"))return;o.checked=!t(this._element).hasClass(r.ACTIVE),t(o).trigger("change")}o.focus(),n=!1}}n&&this._element.setAttribute("aria-pressed",!t(this._element).hasClass(r.ACTIVE)),e&&t(this._element).toggleClass(r.ACTIVE)},e.prototype.dispose=function(){t.removeData(this._element,"bs.button"),this._element=null},e._jQueryInterface=function(n){return this.each(function(){var i=t(this).data("bs.button");i||(i=new e(this),t(this).data("bs.button",i)),"toggle"===n&&i[n]()})},o(e,null,[{key:"VERSION",get:function(){return"4.0.0-beta"}}]),e}();t(document).on(a.CLICK_DATA_API,s.DATA_TOGGLE_CARROT,function(e){e.preventDefault();var n=e.target;t(n).hasClass(r.BUTTON)||(n=t(n).closest(s.BUTTON)),l._jQueryInterface.call(t(n),"toggle")}).on(a.FOCUS_BLUR_DATA_API,s.DATA_TOGGLE_CARROT,function(e){var n=t(e.target).closest(s.BUTTON)[0];t(n).toggleClass(r.FOCUS,/^focus(in)?$/.test(e.type))}),t.fn[e]=l._jQueryInterface,t.fn[e].Constructor=l,t.fn[e].noConflict=function(){return t.fn[e]=i,l._jQueryInterface}}(jQuery),function(t){var e="carousel",s="bs.carousel",a="."+s,l=t.fn[e],h={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0},c={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean"},u={NEXT:"next",PREV:"prev",LEFT:"left",RIGHT:"right"},d={SLIDE:"slide"+a,SLID:"slid"+a,KEYDOWN:"keydown"+a,MOUSEENTER:"mouseenter"+a,MOUSELEAVE:"mouseleave"+a,TOUCHEND:"touchend"+a,LOAD_DATA_API:"load.bs.carousel.data-api",CLICK_DATA_API:"click.bs.carousel.data-api"},f={CAROUSEL:"carousel",ACTIVE:"active",SLIDE:"slide",RIGHT:"carousel-item-right",LEFT:"carousel-item-left",NEXT:"carousel-item-next",PREV:"carousel-item-prev",ITEM:"carousel-item"},p={ACTIVE:".active",ACTIVE_ITEM:".active.carousel-item",ITEM:".carousel-item",NEXT_PREV:".carousel-item-next, .carousel-item-prev",INDICATORS:".carousel-indicators",DATA_SLIDE:"[data-slide], [data-slide-to]",DATA_RIDE:'[data-ride="carousel"]'},_=function(){function l(e,i){n(this,l),this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this._config=this._getConfig(i),this._element=t(e)[0],this._indicatorsElement=t(this._element).find(p.INDICATORS)[0],this._addEventListeners()}return l.prototype.next=function(){this._isSliding||this._slide(u.NEXT)},l.prototype.nextWhenVisible=function(){document.hidden||this.next()},l.prototype.prev=function(){this._isSliding||this._slide(u.PREV)},l.prototype.pause=function(e){e||(this._isPaused=!0),t(this._element).find(p.NEXT_PREV)[0]&&r.supportsTransitionEnd()&&(r.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},l.prototype.cycle=function(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},l.prototype.to=function(e){var n=this;this._activeElement=t(this._element).find(p.ACTIVE_ITEM)[0];var i=this._getItemIndex(this._activeElement);if(!(e>this._items.length-1||e<0))if(this._isSliding)t(this._element).one(d.SLID,function(){return n.to(e)});else{if(i===e)return this.pause(),void this.cycle();var o=e>i?u.NEXT:u.PREV;this._slide(o,this._items[e])}},l.prototype.dispose=function(){t(this._element).off(a),t.removeData(this._element,s),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},l.prototype._getConfig=function(n){return n=t.extend({},h,n),r.typeCheckConfig(e,n,c),n},l.prototype._addEventListeners=function(){var e=this;this._config.keyboard&&t(this._element).on(d.KEYDOWN,function(t){return e._keydown(t)}),"hover"===this._config.pause&&(t(this._element).on(d.MOUSEENTER,function(t){return e.pause(t)}).on(d.MOUSELEAVE,function(t){return e.cycle(t)}),"ontouchstart"in document.documentElement&&t(this._element).on(d.TOUCHEND,function(){e.pause(),e.touchTimeout&&clearTimeout(e.touchTimeout),e.touchTimeout=setTimeout(function(t){return e.cycle(t)},500+e._config.interval)}))},l.prototype._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case 37:t.preventDefault(),this.prev();break;case 39:t.preventDefault(),this.next();break;default:return}},l.prototype._getItemIndex=function(e){return this._items=t.makeArray(t(e).parent().find(p.ITEM)),this._items.indexOf(e)},l.prototype._getItemByDirection=function(t,e){var n=t===u.NEXT,i=t===u.PREV,o=this._getItemIndex(e),r=this._items.length-1;if((i&&0===o||n&&o===r)&&!this._config.wrap)return e;var s=(o+(t===u.PREV?-1:1))%this._items.length;return-1===s?this._items[this._items.length-1]:this._items[s]},l.prototype._triggerSlideEvent=function(e,n){var i=this._getItemIndex(e),o=this._getItemIndex(t(this._element).find(p.ACTIVE_ITEM)[0]),r=t.Event(d.SLIDE,{relatedTarget:e,direction:n,from:o,to:i});return t(this._element).trigger(r),r},l.prototype._setActiveIndicatorElement=function(e){if(this._indicatorsElement){t(this._indicatorsElement).find(p.ACTIVE).removeClass(f.ACTIVE);var n=this._indicatorsElement.children[this._getItemIndex(e)];n&&t(n).addClass(f.ACTIVE)}},l.prototype._slide=function(e,n){var i=this,o=t(this._element).find(p.ACTIVE_ITEM)[0],s=this._getItemIndex(o),a=n||o&&this._getItemByDirection(e,o),l=this._getItemIndex(a),h=Boolean(this._interval),c=void 0,_=void 0,g=void 0;if(e===u.NEXT?(c=f.LEFT,_=f.NEXT,g=u.LEFT):(c=f.RIGHT,_=f.PREV,g=u.RIGHT),a&&t(a).hasClass(f.ACTIVE))this._isSliding=!1;else if(!this._triggerSlideEvent(a,g).isDefaultPrevented()&&o&&a){this._isSliding=!0,h&&this.pause(),this._setActiveIndicatorElement(a);var m=t.Event(d.SLID,{relatedTarget:a,direction:g,from:s,to:l});r.supportsTransitionEnd()&&t(this._element).hasClass(f.SLIDE)?(t(a).addClass(_),r.reflow(a),t(o).addClass(c),t(a).addClass(c),t(o).one(r.TRANSITION_END,function(){t(a).removeClass(c+" "+_).addClass(f.ACTIVE),t(o).removeClass(f.ACTIVE+" "+_+" "+c),i._isSliding=!1,setTimeout(function(){return t(i._element).trigger(m)},0)}).emulateTransitionEnd(600)):(t(o).removeClass(f.ACTIVE),t(a).addClass(f.ACTIVE),this._isSliding=!1,t(this._element).trigger(m)),h&&this.cycle()}},l._jQueryInterface=function(e){return this.each(function(){var n=t(this).data(s),o=t.extend({},h,t(this).data());"object"===(void 0===e?"undefined":i(e))&&t.extend(o,e);var r="string"==typeof e?e:o.slide;if(n||(n=new l(this,o),t(this).data(s,n)),"number"==typeof e)n.to(e);else if("string"==typeof r){if(void 0===n[r])throw new Error('No method named "'+r+'"');n[r]()}else o.interval&&(n.pause(),n.cycle())})},l._dataApiClickHandler=function(e){var n=r.getSelectorFromElement(this);if(n){var i=t(n)[0];if(i&&t(i).hasClass(f.CAROUSEL)){var o=t.extend({},t(i).data(),t(this).data()),a=this.getAttribute("data-slide-to");a&&(o.interval=!1),l._jQueryInterface.call(t(i),o),a&&t(i).data(s).to(a),e.preventDefault()}}},o(l,null,[{key:"VERSION",get:function(){return"4.0.0-beta"}},{key:"Default",get:function(){return h}}]),l}();t(document).on(d.CLICK_DATA_API,p.DATA_SLIDE,_._dataApiClickHandler),t(window).on(d.LOAD_DATA_API,function(){t(p.DATA_RIDE).each(function(){var e=t(this);_._jQueryInterface.call(e,e.data())})}),t.fn[e]=_._jQueryInterface,t.fn[e].Constructor=_,t.fn[e].noConflict=function(){return t.fn[e]=l,_._jQueryInterface}}(jQuery),function(t){var e="collapse",s="bs.collapse",a=t.fn[e],l={toggle:!0,parent:""},h={toggle:"boolean",parent:"string"},c={SHOW:"show.bs.collapse",SHOWN:"shown.bs.collapse",HIDE:"hide.bs.collapse",HIDDEN:"hidden.bs.collapse",CLICK_DATA_API:"click.bs.collapse.data-api"},u={SHOW:"show",COLLAPSE:"collapse",COLLAPSING:"collapsing",COLLAPSED:"collapsed"},d={WIDTH:"width",HEIGHT:"height"},f={ACTIVES:".show, .collapsing",DATA_TOGGLE:'[data-toggle="collapse"]'},p=function(){function a(e,i){n(this,a),this._isTransitioning=!1,this._element=e,this._config=this._getConfig(i),this._triggerArray=t.makeArray(t('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'));for(var o=t(f.DATA_TOGGLE),s=0;s0&&this._triggerArray.push(l)}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}return a.prototype.toggle=function(){t(this._element).hasClass(u.SHOW)?this.hide():this.show()},a.prototype.show=function(){var e=this;if(!this._isTransitioning&&!t(this._element).hasClass(u.SHOW)){var n=void 0,i=void 0;if(this._parent&&((n=t.makeArray(t(this._parent).children().children(f.ACTIVES))).length||(n=null)),!(n&&(i=t(n).data(s))&&i._isTransitioning)){var o=t.Event(c.SHOW);if(t(this._element).trigger(o),!o.isDefaultPrevented()){n&&(a._jQueryInterface.call(t(n),"hide"),i||t(n).data(s,null));var l=this._getDimension();t(this._element).removeClass(u.COLLAPSE).addClass(u.COLLAPSING),this._element.style[l]=0,this._triggerArray.length&&t(this._triggerArray).removeClass(u.COLLAPSED).attr("aria-expanded",!0),this.setTransitioning(!0);var h=function(){t(e._element).removeClass(u.COLLAPSING).addClass(u.COLLAPSE).addClass(u.SHOW),e._element.style[l]="",e.setTransitioning(!1),t(e._element).trigger(c.SHOWN)};if(r.supportsTransitionEnd()){var d="scroll"+(l[0].toUpperCase()+l.slice(1));t(this._element).one(r.TRANSITION_END,h).emulateTransitionEnd(600),this._element.style[l]=this._element[d]+"px"}else h()}}}},a.prototype.hide=function(){var e=this;if(!this._isTransitioning&&t(this._element).hasClass(u.SHOW)){var n=t.Event(c.HIDE);if(t(this._element).trigger(n),!n.isDefaultPrevented()){var i=this._getDimension();if(this._element.style[i]=this._element.getBoundingClientRect()[i]+"px",r.reflow(this._element),t(this._element).addClass(u.COLLAPSING).removeClass(u.COLLAPSE).removeClass(u.SHOW),this._triggerArray.length)for(var o=0;o0},l.prototype._getPopperConfig=function(){var t={placement:this._getPlacement(),modifiers:{offset:{offset:this._config.offset},flip:{enabled:this._config.flip}}};return this._inNavbar&&(t.modifiers.applyStyle={enabled:!this._inNavbar}),t},l._jQueryInterface=function(e){return this.each(function(){var n=t(this).data(s),o="object"===(void 0===e?"undefined":i(e))?e:null;if(n||(n=new l(this,o),t(this).data(s,n)),"string"==typeof e){if(void 0===n[e])throw new Error('No method named "'+e+'"');n[e]()}})},l._clearMenus=function(e){if(!e||3!==e.which&&("keyup"!==e.type||9===e.which))for(var n=t.makeArray(t(d.DATA_TOGGLE)),i=0;i0&&r--,40===e.which&&rdocument.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},a.prototype._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},a.prototype._checkScrollbar=function(){this._isBodyOverflowing=document.body.clientWidth=n){var i=this._targets[this._targets.length-1];this._activeTarget!==i&&this._activate(i)}else{if(this._activeTarget&&t0)return this._activeTarget=null,void this._clear();for(var o=this._offsets.length;o--;)this._activeTarget!==this._targets[o]&&t>=this._offsets[o]&&(void 0===this._offsets[o+1]||t .dropdown-menu .active"},l=function(){function e(t){n(this,e),this._element=t}return e.prototype.show=function(){var e=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&t(this._element).hasClass(s.ACTIVE)||t(this._element).hasClass(s.DISABLED))){var n=void 0,o=void 0,l=t(this._element).closest(a.NAV_LIST_GROUP)[0],h=r.getSelectorFromElement(this._element);l&&(o=t.makeArray(t(l).find(a.ACTIVE)),o=o[o.length-1]);var c=t.Event(i.HIDE,{relatedTarget:this._element}),u=t.Event(i.SHOW,{relatedTarget:o});if(o&&t(o).trigger(c),t(this._element).trigger(u),!u.isDefaultPrevented()&&!c.isDefaultPrevented()){h&&(n=t(h)[0]),this._activate(this._element,l);var d=function(){var n=t.Event(i.HIDDEN,{relatedTarget:e._element}),r=t.Event(i.SHOWN,{relatedTarget:o});t(o).trigger(n),t(e._element).trigger(r)};n?this._activate(n,n.parentNode,d):d()}}},e.prototype.dispose=function(){t.removeData(this._element,"bs.tab"),this._element=null},e.prototype._activate=function(e,n,i){var o=this,l=t(n).find(a.ACTIVE)[0],h=i&&r.supportsTransitionEnd()&&l&&t(l).hasClass(s.FADE),c=function(){return o._transitionComplete(e,l,h,i)};l&&h?t(l).one(r.TRANSITION_END,c).emulateTransitionEnd(150):c(),l&&t(l).removeClass(s.SHOW)},e.prototype._transitionComplete=function(e,n,i,o){if(n){t(n).removeClass(s.ACTIVE);var l=t(n.parentNode).find(a.DROPDOWN_ACTIVE_CHILD)[0];l&&t(l).removeClass(s.ACTIVE),n.setAttribute("aria-expanded",!1)}if(t(e).addClass(s.ACTIVE),e.setAttribute("aria-expanded",!0),i?(r.reflow(e),t(e).addClass(s.SHOW)):t(e).removeClass(s.FADE),e.parentNode&&t(e.parentNode).hasClass(s.DROPDOWN_MENU)){var h=t(e).closest(a.DROPDOWN)[0];h&&t(h).find(a.DROPDOWN_TOGGLE).addClass(s.ACTIVE),e.setAttribute("aria-expanded",!0)}o&&o()},e._jQueryInterface=function(n){return this.each(function(){var i=t(this),o=i.data("bs.tab");if(o||(o=new e(this),i.data("bs.tab",o)),"string"==typeof n){if(void 0===o[n])throw new Error('No method named "'+n+'"');o[n]()}})},o(e,null,[{key:"VERSION",get:function(){return"4.0.0-beta"}}]),e}();t(document).on(i.CLICK_DATA_API,a.DATA_TOGGLE,function(e){e.preventDefault(),l._jQueryInterface.call(t(this),"show")}),t.fn.tab=l._jQueryInterface,t.fn.tab.Constructor=l,t.fn.tab.noConflict=function(){return t.fn.tab=e,l._jQueryInterface}}(jQuery),function(t){if("undefined"==typeof Popper)throw new Error("Bootstrap tooltips require Popper.js (https://popper.js.org)");var e="tooltip",s=".bs.tooltip",a=t.fn[e],l=new RegExp("(^|\\s)bs-tooltip\\S+","g"),h={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"(number|string)",container:"(string|element|boolean)",fallbackPlacement:"(string|array)"},c={AUTO:"auto",TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left"},u={animation:!0,template:'',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip"},d={SHOW:"show",OUT:"out"},f={HIDE:"hide"+s,HIDDEN:"hidden"+s,SHOW:"show"+s,SHOWN:"shown"+s,INSERTED:"inserted"+s,CLICK:"click"+s,FOCUSIN:"focusin"+s,FOCUSOUT:"focusout"+s,MOUSEENTER:"mouseenter"+s,MOUSELEAVE:"mouseleave"+s},p={FADE:"fade",SHOW:"show"},_={TOOLTIP:".tooltip",TOOLTIP_INNER:".tooltip-inner",ARROW:".arrow"},g={HOVER:"hover",FOCUS:"focus",CLICK:"click",MANUAL:"manual"},m=function(){function a(t,e){n(this,a),this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}return a.prototype.enable=function(){this._isEnabled=!0},a.prototype.disable=function(){this._isEnabled=!1},a.prototype.toggleEnabled=function(){this._isEnabled=!this._isEnabled},a.prototype.toggle=function(e){if(e){var n=this.constructor.DATA_KEY,i=t(e.currentTarget).data(n);i||(i=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(n,i)),i._activeTrigger.click=!i._activeTrigger.click,i._isWithActiveTrigger()?i._enter(null,i):i._leave(null,i)}else{if(t(this.getTipElement()).hasClass(p.SHOW))return void this._leave(null,this);this._enter(null,this)}},a.prototype.dispose=function(){clearTimeout(this._timeout),t.removeData(this.element,this.constructor.DATA_KEY),t(this.element).off(this.constructor.EVENT_KEY),t(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&t(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,null!==this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},a.prototype.show=function(){var e=this;if("none"===t(this.element).css("display"))throw new Error("Please use show on visible elements");var n=t.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){t(this.element).trigger(n);var i=t.contains(this.element.ownerDocument.documentElement,this.element);if(n.isDefaultPrevented()||!i)return;var o=this.getTipElement(),s=r.getUID(this.constructor.NAME);o.setAttribute("id",s),this.element.setAttribute("aria-describedby",s),this.setContent(),this.config.animation&&t(o).addClass(p.FADE);var l="function"==typeof this.config.placement?this.config.placement.call(this,o,this.element):this.config.placement,h=this._getAttachment(l);this.addAttachmentClass(h);var c=!1===this.config.container?document.body:t(this.config.container);t(o).data(this.constructor.DATA_KEY,this),t.contains(this.element.ownerDocument.documentElement,this.tip)||t(o).appendTo(c),t(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new Popper(this.element,o,{placement:h,modifiers:{offset:{offset:this.config.offset},flip:{behavior:this.config.fallbackPlacement},arrow:{element:_.ARROW}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){e._handlePopperPlacementChange(t)}}),t(o).addClass(p.SHOW),"ontouchstart"in document.documentElement&&t("body").children().on("mouseover",null,t.noop);var u=function(){e.config.animation&&e._fixTransition();var n=e._hoverState;e._hoverState=null,t(e.element).trigger(e.constructor.Event.SHOWN),n===d.OUT&&e._leave(null,e)};r.supportsTransitionEnd()&&t(this.tip).hasClass(p.FADE)?t(this.tip).one(r.TRANSITION_END,u).emulateTransitionEnd(a._TRANSITION_DURATION):u()}},a.prototype.hide=function(e){var n=this,i=this.getTipElement(),o=t.Event(this.constructor.Event.HIDE),s=function(){n._hoverState!==d.SHOW&&i.parentNode&&i.parentNode.removeChild(i),n._cleanTipClass(),n.element.removeAttribute("aria-describedby"),t(n.element).trigger(n.constructor.Event.HIDDEN),null!==n._popper&&n._popper.destroy(),e&&e()};t(this.element).trigger(o),o.isDefaultPrevented()||(t(i).removeClass(p.SHOW),"ontouchstart"in document.documentElement&&t("body").children().off("mouseover",null,t.noop),this._activeTrigger[g.CLICK]=!1,this._activeTrigger[g.FOCUS]=!1,this._activeTrigger[g.HOVER]=!1,r.supportsTransitionEnd()&&t(this.tip).hasClass(p.FADE)?t(i).one(r.TRANSITION_END,s).emulateTransitionEnd(150):s(),this._hoverState="")},a.prototype.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},a.prototype.isWithContent=function(){return Boolean(this.getTitle())},a.prototype.addAttachmentClass=function(e){t(this.getTipElement()).addClass("bs-tooltip-"+e)},a.prototype.getTipElement=function(){return this.tip=this.tip||t(this.config.template)[0]},a.prototype.setContent=function(){var e=t(this.getTipElement());this.setElementContent(e.find(_.TOOLTIP_INNER),this.getTitle()),e.removeClass(p.FADE+" "+p.SHOW)},a.prototype.setElementContent=function(e,n){var o=this.config.html;"object"===(void 0===n?"undefined":i(n))&&(n.nodeType||n.jquery)?o?t(n).parent().is(e)||e.empty().append(n):e.text(t(n).text()):e[o?"html":"text"](n)},a.prototype.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},a.prototype._getAttachment=function(t){return c[t.toUpperCase()]},a.prototype._setListeners=function(){var e=this;this.config.trigger.split(" ").forEach(function(n){if("click"===n)t(e.element).on(e.constructor.Event.CLICK,e.config.selector,function(t){return e.toggle(t)});else if(n!==g.MANUAL){var i=n===g.HOVER?e.constructor.Event.MOUSEENTER:e.constructor.Event.FOCUSIN,o=n===g.HOVER?e.constructor.Event.MOUSELEAVE:e.constructor.Event.FOCUSOUT;t(e.element).on(i,e.config.selector,function(t){return e._enter(t)}).on(o,e.config.selector,function(t){return e._leave(t)})}t(e.element).closest(".modal").on("hide.bs.modal",function(){return e.hide()})}),this.config.selector?this.config=t.extend({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},a.prototype._fixTitle=function(){var t=i(this.element.getAttribute("data-original-title"));(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},a.prototype._enter=function(e,n){var i=this.constructor.DATA_KEY;(n=n||t(e.currentTarget).data(i))||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(i,n)),e&&(n._activeTrigger["focusin"===e.type?g.FOCUS:g.HOVER]=!0),t(n.getTipElement()).hasClass(p.SHOW)||n._hoverState===d.SHOW?n._hoverState=d.SHOW:(clearTimeout(n._timeout),n._hoverState=d.SHOW,n.config.delay&&n.config.delay.show?n._timeout=setTimeout(function(){n._hoverState===d.SHOW&&n.show()},n.config.delay.show):n.show())},a.prototype._leave=function(e,n){var i=this.constructor.DATA_KEY;(n=n||t(e.currentTarget).data(i))||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(i,n)),e&&(n._activeTrigger["focusout"===e.type?g.FOCUS:g.HOVER]=!1),n._isWithActiveTrigger()||(clearTimeout(n._timeout),n._hoverState=d.OUT,n.config.delay&&n.config.delay.hide?n._timeout=setTimeout(function(){n._hoverState===d.OUT&&n.hide()},n.config.delay.hide):n.hide())},a.prototype._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},a.prototype._getConfig=function(n){return(n=t.extend({},this.constructor.Default,t(this.element).data(),n)).delay&&"number"==typeof n.delay&&(n.delay={show:n.delay,hide:n.delay}),n.title&&"number"==typeof n.title&&(n.title=n.title.toString()),n.content&&"number"==typeof n.content&&(n.content=n.content.toString()),r.typeCheckConfig(e,n,this.constructor.DefaultType),n},a.prototype._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},a.prototype._cleanTipClass=function(){var e=t(this.getTipElement()),n=e.attr("class").match(l);null!==n&&n.length>0&&e.removeClass(n.join(""))},a.prototype._handlePopperPlacementChange=function(t){this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},a.prototype._fixTransition=function(){var e=this.getTipElement(),n=this.config.animation;null===e.getAttribute("x-placement")&&(t(e).removeClass(p.FADE),this.config.animation=!1,this.hide(),this.show(),this.config.animation=n)},a._jQueryInterface=function(e){return this.each(function(){var n=t(this).data("bs.tooltip"),o="object"===(void 0===e?"undefined":i(e))&&e;if((n||!/dispose|hide/.test(e))&&(n||(n=new a(this,o),t(this).data("bs.tooltip",n)),"string"==typeof e)){if(void 0===n[e])throw new Error('No method named "'+e+'"');n[e]()}})},o(a,null,[{key:"VERSION",get:function(){return"4.0.0-beta"}},{key:"Default",get:function(){return u}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return"bs.tooltip"}},{key:"Event",get:function(){return f}},{key:"EVENT_KEY",get:function(){return s}},{key:"DefaultType",get:function(){return h}}]),a}();return t.fn[e]=m._jQueryInterface,t.fn[e].Constructor=m,t.fn[e].noConflict=function(){return t.fn[e]=a,m._jQueryInterface},m}(jQuery));!function(r){var a="popover",l=".bs.popover",h=r.fn[a],c=new RegExp("(^|\\s)bs-popover\\S+","g"),u=r.extend({},s.Default,{placement:"right",trigger:"click",content:"",template:''}),d=r.extend({},s.DefaultType,{content:"(string|element|function)"}),f={FADE:"fade",SHOW:"show"},p={TITLE:".popover-header",CONTENT:".popover-body"},_={HIDE:"hide"+l,HIDDEN:"hidden"+l,SHOW:"show"+l,SHOWN:"shown"+l,INSERTED:"inserted"+l,CLICK:"click"+l,FOCUSIN:"focusin"+l,FOCUSOUT:"focusout"+l,MOUSEENTER:"mouseenter"+l,MOUSELEAVE:"mouseleave"+l},g=function(s){function h(){return n(this,h),t(this,s.apply(this,arguments))}return e(h,s),h.prototype.isWithContent=function(){return this.getTitle()||this._getContent()},h.prototype.addAttachmentClass=function(t){r(this.getTipElement()).addClass("bs-popover-"+t)},h.prototype.getTipElement=function(){return this.tip=this.tip||r(this.config.template)[0]},h.prototype.setContent=function(){var t=r(this.getTipElement());this.setElementContent(t.find(p.TITLE),this.getTitle()),this.setElementContent(t.find(p.CONTENT),this._getContent()),t.removeClass(f.FADE+" "+f.SHOW)},h.prototype._getContent=function(){return this.element.getAttribute("data-content")||("function"==typeof this.config.content?this.config.content.call(this.element):this.config.content)},h.prototype._cleanTipClass=function(){var t=r(this.getTipElement()),e=t.attr("class").match(c);null!==e&&e.length>0&&t.removeClass(e.join(""))},h._jQueryInterface=function(t){return this.each(function(){var e=r(this).data("bs.popover"),n="object"===(void 0===t?"undefined":i(t))?t:null;if((e||!/destroy|hide/.test(t))&&(e||(e=new h(this,n),r(this).data("bs.popover",e)),"string"==typeof t)){if(void 0===e[t])throw new Error('No method named "'+t+'"');e[t]()}})},o(h,null,[{key:"VERSION",get:function(){return"4.0.0-beta"}},{key:"Default",get:function(){return u}},{key:"NAME",get:function(){return a}},{key:"DATA_KEY",get:function(){return"bs.popover"}},{key:"Event",get:function(){return _}},{key:"EVENT_KEY",get:function(){return l}},{key:"DefaultType",get:function(){return d}}]),h}(s);r.fn[a]=g._jQueryInterface,r.fn[a].Constructor=g,r.fn[a].noConflict=function(){return r.fn[a]=h,g._jQueryInterface}}(jQuery)}(); \ No newline at end of file diff --git a/src/main/resources/static/js/chart-page.js b/src/main/resources/static/js/chart-page.js deleted file mode 100644 index 4486eaa..0000000 --- a/src/main/resources/static/js/chart-page.js +++ /dev/null @@ -1,388 +0,0 @@ -// Bar chart -new Chart(document.getElementById("bar-chart"), { - type: 'bar', - data: { - labels: ["Africa", "Asia", "Europe", "Latin America", "North America"], - datasets: [ - { - label: "Business (millions)", - backgroundColor: ["#3e95cd", "#8e5ea2","#3cba9f","#e8c3b9","#c45850"], - data: [2478,5267,734,784,433] - } - ] - }, - options: { - legend: { display: false }, - title: { - display: true, - text: 'Predicted world Business (millions) in 2050' - } - } -}); - -//Line chart -new Chart(document.getElementById("line-chart"), { - type: 'line', - data: { - labels: [1500,1600,1700,1750,1800,1850,1900,1950,1999,2050], - datasets: [{ - data: [86,114,106,106,107,111,133,221,783,2478], - label: "Africa", - borderColor: "#3e95cd", - fill: false - }, { - data: [282,350,411,502,635,809,947,1402,3700,5267], - label: "Asia", - borderColor: "#8e5ea2", - fill: false - }, { - data: [168,170,178,190,203,276,408,547,675,734], - label: "Europe", - borderColor: "#3cba9f", - fill: false - }, { - data: [40,20,10,16,24,38,74,167,508,784], - label: "Latin America", - borderColor: "#e8c3b9", - fill: false - }, { - data: [6,3,2,2,7,26,82,172,312,433], - label: "North America", - borderColor: "#c45850", - fill: false - } - ] - }, - options: { - title: { - display: true, - text: 'World Business per region (in millions)' - } - } -}); - -//Line chart 2D -new Chart(document.getElementById('line-chart-2D').getContext('2d'), { - type: 'line', - data: { - labels: ['M', 'T', 'W', 'T', 'F', 'S', 'S'], - datasets: [{ - label: 'apples', - data: [12, 19, 3, 17, 6, 3, 7], - backgroundColor: "rgba(153,255,51,0.4)" - }, { - label: 'oranges', - data: [2, 29, 5, 5, 2, 3, 10], - backgroundColor: "rgba(255,153,0,0.9)" - }] - } -}); - -//Pie chart1 -new Chart(document.getElementById("pie-chart1"), { - type: 'pie', - data: { - labels: ["Africa", "Asia", "Europe", "Latin America", "North America"], - datasets: [{ - label: "Business (millions)", - backgroundColor: ["#3e95cd", "#8e5ea2","#3cba9f","#e8c3b9","#c45850"], - data: [2478,5267,734,784,433] - }] - }, - options: { - title: { - display: true, - text: 'Predicted world Business (millions) in 2050' - } - } -}); - -//Pie chart2 -new Chart(document.getElementById("pie-chart2").getContext('2d'), { - type: 'pie', - data: { - labels: ["M", "T", "W", "T", "F", "S", "S"], - datasets: [{ - backgroundColor: [ - "#2ecc71", - "#3498db", - "#95a5a6", - "#9b59b6", - "#f1c40f", - "#e74c3c", - "#34495e" - ], - data: [12, 19, 3, 17, 28, 24, 7] - }] - } -}); - -//Radar Chart -new Chart(document.getElementById("radar-chart"), { - type: 'radar', - data: { - labels: ["Africa", "Asia", "Europe", "Latin America", "North America"], - datasets: [ - { - label: "1950", - fill: true, - backgroundColor: "rgba(179,181,198,0.2)", - borderColor: "rgba(179,181,198,1)", - pointBorderColor: "#fff", - pointBackgroundColor: "rgba(179,181,198,1)", - data: [8.77,55.61,21.69,6.62,6.82] - }, { - label: "2050", - fill: true, - backgroundColor: "rgba(255,99,132,0.2)", - borderColor: "rgba(255,99,132,1)", - pointBorderColor: "#fff", - pointBackgroundColor: "rgba(255,99,132,1)", - pointBorderColor: "#fff", - data: [25.48,54.16,7.61,8.06,4.45] - } - ] - }, - options: { - title: { - display: true, - text: 'Distribution in % of world Business' - } - } -}); - -//Polar Chart1 -new Chart(document.getElementById("polar-chart1"), { - type: 'polarArea', - data: { - labels: ["Africa", "Asia", "Europe", "Latin America", "North America"], - datasets: [ - { - label: "Business (millions)", - backgroundColor: ["#3e95cd", "#8e5ea2","#3cba9f","#e8c3b9","#c45850"], - data: [2478,5267,734,784,433] - } - ] - }, - options: { - title: { - display: true, - text: 'Predicted world Business (millions) in 2050' - } - } -}); - -//Polar Chart2 -new Chart(document.getElementById("polar-chart2").getContext('2d'), { - type: 'polarArea', - data: { - labels: ["M", "T", "W", "T", "F", "S", "S"], - datasets: [{ - backgroundColor: [ - "#2ecc71", - "#3498db", - "#95a5a6", - "#9b59b6", - "#f1c40f", - "#e74c3c", - "#34495e" - ], - data: [12, 19, 3, 17, 28, 24, 7] - }] - } -}); - -//Doughnut Chart1 -new Chart(document.getElementById("doughnut-chart1"), { - type: 'doughnut', - data: { - labels: ["Africa", "Asia", "Europe", "Latin America", "North America"], - datasets: [ - { - label: "Business (millions)", - backgroundColor: ["#3e95cd", "#8e5ea2","#3cba9f","#e8c3b9","#c45850"], - data: [2478,5267,734,784,433] - } - ] - }, - options: { - title: { - display: true, - text: 'Predicted world Business (millions) in 2050' - } - } -}); - -//Doughnut Chart2 -new Chart(document.getElementById("doughnut-chart2").getContext('2d'), { - type: 'doughnut', - data: { - labels: ["M", "T", "W", "T", "F", "S", "S"], - datasets: [{ - backgroundColor: [ - "#2ecc71", - "#3498db", - "#95a5a6", - "#9b59b6", - "#f1c40f", - "#e74c3c", - "#34495e" - ], - data: [12, 19, 3, 17, 28, 24, 7] - }] - } -}); - - -//Bar horizontal Chart -new Chart(document.getElementById("bar-chart-horizontal"), { - type: 'horizontalBar', - data: { - labels: ["Africa", "Asia", "Europe", "Latin America", "North America"], - datasets: [ - { - label: "Business (millions)", - backgroundColor: ["#3e95cd", "#8e5ea2","#3cba9f","#e8c3b9","#c45850"], - data: [2478,5267,734,784,433] - } - ] - }, - options: { - legend: { display: false }, - title: { - display: true, - text: 'Predicted world Business (millions) in 2050' - } - } -}); - -//Grouped bar Chart -new Chart(document.getElementById("bar-chart-grouped"), { - type: 'bar', - data: { - labels: ["1900", "1950", "1999", "2050"], - datasets: [ - { - label: "Africa", - backgroundColor: "#3e95cd", - data: [133,221,783,2478] - }, { - label: "Europe", - backgroundColor: "#8e5ea2", - data: [408,547,675,734] - } - ] - }, - options: { - title: { - display: true, - text: 'Business growth (millions)' - } - } -}); - -//Mixed Chart -new Chart(document.getElementById("mixed-chart"), { - type: 'bar', - data: { - labels: ["1900", "1950", "1999", "2050"], - datasets: [{ - label: "Europe", - type: "line", - borderColor: "#8e5ea2", - data: [408,547,675,734], - fill: false - }, { - label: "Africa", - type: "line", - borderColor: "#3e95cd", - data: [133,221,783,2478], - fill: false - }, { - label: "Europe", - type: "bar", - backgroundColor: "rgba(0,0,0,0.2)", - data: [408,547,675,734], - }, { - label: "Africa", - type: "bar", - backgroundColor: "rgba(0,0,0,0.2)", - backgroundColorHover: "#3e95cd", - data: [133,221,783,2478] - } - ] - }, - options: { - title: { - display: true, - text: 'Business growth (millions): Europe & Africa' - }, - legend: { display: false } - } -}); - -//Bubble Chart -new Chart(document.getElementById("bubble-chart"), { - type: 'bubble', - data: { - labels: "Africa", - datasets: [ - { - label: ["China"], - backgroundColor: "rgba(255,221,50,0.2)", - borderColor: "rgba(255,221,50,1)", - data: [{ - x: 21269017, - y: 5.245, - r: 15 - }] - }, { - label: ["Denmark"], - backgroundColor: "rgba(60,186,159,0.2)", - borderColor: "rgba(60,186,159,1)", - data: [{ - x: 258702, - y: 7.526, - r: 10 - }] - }, { - label: ["Germany"], - backgroundColor: "rgba(0,0,0,0.2)", - borderColor: "#000", - data: [{ - x: 3979083, - y: 6.994, - r: 15 - }] - }, { - label: ["Japan"], - backgroundColor: "rgba(193,46,12,0.2)", - borderColor: "rgba(193,46,12,1)", - data: [{ - x: 4931877, - y: 5.921, - r: 15 - }] - } - ] - }, - options: { - title: { - display: true, - text: 'Predicted world Business (millions) in 2050' - }, scales: { - yAxes: [{ - scaleLabel: { - display: true, - labelString: "Happiness" - } - }], - xAxes: [{ - scaleLabel: { - display: true, - labelString: "GDP (PPP)" - } - }] - } - } -}); \ No newline at end of file diff --git a/src/main/resources/static/js/chart.min.js b/src/main/resources/static/js/chart.min.js deleted file mode 100644 index f4c4a94..0000000 --- a/src/main/resources/static/js/chart.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/*! - * Chart.js - * http://chartjs.org/ - * Version: 2.7.0 - * - * Copyright 2017 Nick Downie - * Released under the MIT license - * https://github.com/chartjs/Chart.js/blob/master/LICENSE.md - */ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Chart=t()}}(function(){return function t(e,n,i){function a(r,l){if(!n[r]){if(!e[r]){var s="function"==typeof require&&require;if(!l&&s)return s(r,!0);if(o)return o(r,!0);var u=new Error("Cannot find module '"+r+"'");throw u.code="MODULE_NOT_FOUND",u}var d=n[r]={exports:{}};e[r][0].call(d.exports,function(t){var n=e[r][1][t];return a(n||t)},d,d.exports,t,e,n,i)}return n[r].exports}for(var o="function"==typeof require&&require,r=0;rn?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){var e=this.values.hsl;return e[2]+=e[2]*t,this.setValues("hsl",e),this},darken:function(t){var e=this.values.hsl;return e[2]-=e[2]*t,this.setValues("hsl",e),this},saturate:function(t){var e=this.values.hsl;return e[1]+=e[1]*t,this.setValues("hsl",e),this},desaturate:function(t){var e=this.values.hsl;return e[1]-=e[1]*t,this.setValues("hsl",e),this},whiten:function(t){var e=this.values.hwb;return e[1]+=e[1]*t,this.setValues("hwb",e),this},blacken:function(t){var e=this.values.hwb;return e[2]+=e[2]*t,this.setValues("hwb",e),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){var e=this.values.alpha;return this.setValues("alpha",e-e*t),this},opaquer:function(t){var e=this.values.alpha;return this.setValues("alpha",e+e*t),this},rotate:function(t){var e=this.values.hsl,n=(e[0]+t)%360;return e[0]=n<0?360+n:n,this.setValues("hsl",e),this},mix:function(t,e){var n=this,i=t,a=void 0===e?.5:e,o=2*a-1,r=n.alpha()-i.alpha(),l=((o*r==-1?o:(o+r)/(1+o*r))+1)/2,s=1-l;return this.rgb(l*n.red()+s*i.red(),l*n.green()+s*i.green(),l*n.blue()+s*i.blue()).alpha(n.alpha()*a+i.alpha()*(1-a))},toJSON:function(){return this.rgb()},clone:function(){var t,e,n=new o,i=this.values,a=n.values;for(var r in i)i.hasOwnProperty(r)&&(t=i[r],"[object Array]"===(e={}.toString.call(t))?a[r]=t.slice(0):"[object Number]"===e?a[r]=t:console.error("unexpected color value:",t));return n}},o.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},o.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},o.prototype.getValues=function(t){for(var e=this.values,n={},i=0;i.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)),100*(.2126*e+.7152*n+.0722*i),100*(.0193*e+.1192*n+.9505*i)]}function d(t){var e,n,i,a=u(t),o=a[0],r=a[1],l=a[2];return o/=95.047,r/=100,l/=108.883,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,l=l>.008856?Math.pow(l,1/3):7.787*l+16/116,e=116*r-16,n=500*(o-r),i=200*(r-l),[e,n,i]}function c(t){var e,n,i,a,o,r=t[0]/360,l=t[1]/100,s=t[2]/100;if(0==l)return o=255*s,[o,o,o];e=2*s-(n=s<.5?s*(1+l):s+l-s*l),a=[0,0,0];for(var u=0;u<3;u++)(i=r+1/3*-(u-1))<0&&i++,i>1&&i--,o=6*i<1?e+6*(n-e)*i:2*i<1?n:3*i<2?e+(n-e)*(2/3-i)*6:e,a[u]=255*o;return a}function h(t){var e=t[0]/60,n=t[1]/100,i=t[2]/100,a=Math.floor(e)%6,o=e-Math.floor(e),r=255*i*(1-n),l=255*i*(1-n*o),s=255*i*(1-n*(1-o)),i=255*i;switch(a){case 0:return[i,s,r];case 1:return[l,i,r];case 2:return[r,i,s];case 3:return[r,l,i];case 4:return[s,r,i];case 5:return[i,r,l]}}function f(t){var e,n,i,a,o=t[0]/360,l=t[1]/100,s=t[2]/100,u=l+s;switch(u>1&&(l/=u,s/=u),e=Math.floor(6*o),n=1-s,i=6*o-e,0!=(1&e)&&(i=1-i),a=l+i*(n-l),e){default:case 6:case 0:r=n,g=a,b=l;break;case 1:r=a,g=n,b=l;break;case 2:r=l,g=n,b=a;break;case 3:r=l,g=a,b=n;break;case 4:r=a,g=l,b=n;break;case 5:r=n,g=l,b=a}return[255*r,255*g,255*b]}function p(t){var e,n,i,a=t[0]/100,o=t[1]/100,r=t[2]/100,l=t[3]/100;return e=1-Math.min(1,a*(1-l)+l),n=1-Math.min(1,o*(1-l)+l),i=1-Math.min(1,r*(1-l)+l),[255*e,255*n,255*i]}function v(t){var e,n,i,a=t[0]/100,o=t[1]/100,r=t[2]/100;return e=3.2406*a+-1.5372*o+-.4986*r,n=-.9689*a+1.8758*o+.0415*r,i=.0557*a+-.204*o+1.057*r,e=e>.0031308?1.055*Math.pow(e,1/2.4)-.055:e*=12.92,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*=12.92,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*=12.92,e=Math.min(Math.max(0,e),1),n=Math.min(Math.max(0,n),1),i=Math.min(Math.max(0,i),1),[255*e,255*n,255*i]}function m(t){var e,n,i,a=t[0],o=t[1],r=t[2];return a/=95.047,o/=100,r/=108.883,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,e=116*o-16,n=500*(a-o),i=200*(o-r),[e,n,i]}function x(t){var e,n,i,a,o=t[0],r=t[1],l=t[2];return o<=8?a=(n=100*o/903.3)/100*7.787+16/116:(n=100*Math.pow((o+16)/116,3),a=Math.pow(n/100,1/3)),e=e/95.047<=.008856?e=95.047*(r/500+a-16/116)/7.787:95.047*Math.pow(r/500+a,3),i=i/108.883<=.008859?i=108.883*(a-l/200-16/116)/7.787:108.883*Math.pow(a-l/200,3),[e,n,i]}function y(t){var e,n,i,a=t[0],o=t[1],r=t[2];return e=Math.atan2(r,o),(n=360*e/2/Math.PI)<0&&(n+=360),i=Math.sqrt(o*o+r*r),[a,i,n]}function k(t){return v(x(t))}function w(t){var e,n,i,a=t[0],o=t[1];return i=t[2]/360*2*Math.PI,e=o*Math.cos(i),n=o*Math.sin(i),[a,e,n]}function M(t){return S[t]}e.exports={rgb2hsl:i,rgb2hsv:a,rgb2hwb:o,rgb2cmyk:l,rgb2keyword:s,rgb2xyz:u,rgb2lab:d,rgb2lch:function(t){return y(d(t))},hsl2rgb:c,hsl2hsv:function(t){var e,n,i=t[0],a=t[1]/100,o=t[2]/100;return 0===o?[0,0,0]:(o*=2,a*=o<=1?o:2-o,n=(o+a)/2,e=2*a/(o+a),[i,100*e,100*n])},hsl2hwb:function(t){return o(c(t))},hsl2cmyk:function(t){return l(c(t))},hsl2keyword:function(t){return s(c(t))},hsv2rgb:h,hsv2hsl:function(t){var e,n,i=t[0],a=t[1]/100,o=t[2]/100;return n=(2-a)*o,e=a*o,e/=n<=1?n:2-n,e=e||0,n/=2,[i,100*e,100*n]},hsv2hwb:function(t){return o(h(t))},hsv2cmyk:function(t){return l(h(t))},hsv2keyword:function(t){return s(h(t))},hwb2rgb:f,hwb2hsl:function(t){return i(f(t))},hwb2hsv:function(t){return a(f(t))},hwb2cmyk:function(t){return l(f(t))},hwb2keyword:function(t){return s(f(t))},cmyk2rgb:p,cmyk2hsl:function(t){return i(p(t))},cmyk2hsv:function(t){return a(p(t))},cmyk2hwb:function(t){return o(p(t))},cmyk2keyword:function(t){return s(p(t))},keyword2rgb:M,keyword2hsl:function(t){return i(M(t))},keyword2hsv:function(t){return a(M(t))},keyword2hwb:function(t){return o(M(t))},keyword2cmyk:function(t){return l(M(t))},keyword2lab:function(t){return d(M(t))},keyword2xyz:function(t){return u(M(t))},xyz2rgb:v,xyz2lab:m,xyz2lch:function(t){return y(m(t))},lab2xyz:x,lab2rgb:k,lab2lch:y,lch2lab:w,lch2xyz:function(t){return x(w(t))},lch2rgb:function(t){return k(w(t))}};var S={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},C={};for(var _ in S)C[JSON.stringify(S[_])]=_},{}],5:[function(t,e,n){var i=t(4),a=function(){return new u};for(var o in i){a[o+"Raw"]=function(t){return function(e){return"number"==typeof e&&(e=Array.prototype.slice.call(arguments)),i[t](e)}}(o);var r=/(\w+)2(\w+)/.exec(o),l=r[1],s=r[2];(a[l]=a[l]||{})[s]=a[o]=function(t){return function(e){"number"==typeof e&&(e=Array.prototype.slice.call(arguments));var n=i[t](e);if("string"==typeof n||void 0===n)return n;for(var a=0;a0&&(t[0].yLabel?n=t[0].yLabel:e.labels.length>0&&t[0].index=0&&a>0)&&(v+=a));return o=c.getPixelForValue(v),r=c.getPixelForValue(v+f),l=(r-o)/2,{size:l,base:o,head:r,center:r+l/2}},calculateBarIndexPixels:function(t,e,n){var i,a,r,l,s,u,d=this,c=n.scale.options,h=d.getStackIndex(t),f=n.pixels,g=f[e],p=f.length,v=n.start,m=n.end;return 1===p?(i=g>v?g-v:m-g,a=g0&&(i=(g-f[e-1])/2,e===p-1&&(a=i)),e');var n=t.data,i=n.datasets,a=n.labels;if(i.length)for(var o=0;o'),a[o]&&e.push(a[o]),e.push("");return e.push("
      "),e.join("")},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map(function(n,i){var a=t.getDatasetMeta(0),r=e.datasets[0],l=a.data[i],s=l&&l.custom||{},u=o.valueAtIndexOrDefault,d=t.options.elements.arc;return{text:n,fillStyle:s.backgroundColor?s.backgroundColor:u(r.backgroundColor,i,d.backgroundColor),strokeStyle:s.borderColor?s.borderColor:u(r.borderColor,i,d.borderColor),lineWidth:s.borderWidth?s.borderWidth:u(r.borderWidth,i,d.borderWidth),hidden:isNaN(r.data[i])||a.data[i].hidden,index:i}}):[]}},onClick:function(t,e){var n,i,a,o=e.index,r=this.chart;for(n=0,i=(r.data.datasets||[]).length;n=Math.PI?-1:g<-Math.PI?1:0))+f,v={x:Math.cos(g),y:Math.sin(g)},m={x:Math.cos(p),y:Math.sin(p)},b=g<=0&&p>=0||g<=2*Math.PI&&2*Math.PI<=p,x=g<=.5*Math.PI&&.5*Math.PI<=p||g<=2.5*Math.PI&&2.5*Math.PI<=p,y=g<=-Math.PI&&-Math.PI<=p||g<=Math.PI&&Math.PI<=p,k=g<=.5*-Math.PI&&.5*-Math.PI<=p||g<=1.5*Math.PI&&1.5*Math.PI<=p,w=h/100,M={x:y?-1:Math.min(v.x*(v.x<0?1:w),m.x*(m.x<0?1:w)),y:k?-1:Math.min(v.y*(v.y<0?1:w),m.y*(m.y<0?1:w))},S={x:b?1:Math.max(v.x*(v.x>0?1:w),m.x*(m.x>0?1:w)),y:x?1:Math.max(v.y*(v.y>0?1:w),m.y*(m.y>0?1:w))},C={width:.5*(S.x-M.x),height:.5*(S.y-M.y)};u=Math.min(l/C.width,s/C.height),d={x:-.5*(S.x+M.x),y:-.5*(S.y+M.y)}}n.borderWidth=e.getMaxBorderWidth(c.data),n.outerRadius=Math.max((u-n.borderWidth)/2,0),n.innerRadius=Math.max(h?n.outerRadius/100*h:0,0),n.radiusLength=(n.outerRadius-n.innerRadius)/n.getVisibleDatasetCount(),n.offsetX=d.x*n.outerRadius,n.offsetY=d.y*n.outerRadius,c.total=e.calculateTotal(),e.outerRadius=n.outerRadius-n.radiusLength*e.getRingIndex(e.index),e.innerRadius=Math.max(e.outerRadius-n.radiusLength,0),o.each(c.data,function(n,i){e.updateElement(n,i,t)})},updateElement:function(t,e,n){var i=this,a=i.chart,r=a.chartArea,l=a.options,s=l.animation,u=(r.left+r.right)/2,d=(r.top+r.bottom)/2,c=l.rotation,h=l.rotation,f=i.getDataset(),g=n&&s.animateRotate?0:t.hidden?0:i.calculateCircumference(f.data[e])*(l.circumference/(2*Math.PI)),p=n&&s.animateScale?0:i.innerRadius,v=n&&s.animateScale?0:i.outerRadius,m=o.valueAtIndexOrDefault;o.extend(t,{_datasetIndex:i.index,_index:e,_model:{x:u+a.offsetX,y:d+a.offsetY,startAngle:c,endAngle:h,circumference:g,outerRadius:v,innerRadius:p,label:m(f.label,e,a.data.labels[e])}});var b=t._model;this.removeHoverStyle(t),n&&s.animateRotate||(b.startAngle=0===e?l.rotation:i.getMeta().data[e-1]._model.endAngle,b.endAngle=b.startAngle+b.circumference),t.pivot()},removeHoverStyle:function(e){t.DatasetController.prototype.removeHoverStyle.call(this,e,this.chart.options.elements.arc)},calculateTotal:function(){var t,e=this.getDataset(),n=this.getMeta(),i=0;return o.each(n.data,function(n,a){t=e.data[a],isNaN(t)||n.hidden||(i+=Math.abs(t))}),i},calculateCircumference:function(t){var e=this.getMeta().total;return e>0&&!isNaN(t)?2*Math.PI*(t/e):0},getMaxBorderWidth:function(t){for(var e,n,i=0,a=this.index,o=t.length,r=0;r(i=e>i?e:i)?n:i;return i}})}},{25:25,40:40,45:45}],18:[function(t,e,n){"use strict";var i=t(25),a=t(40),o=t(45);i._set("line",{showLines:!0,spanGaps:!1,hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}}),e.exports=function(t){function e(t,e){return o.valueOrDefault(t.showLine,e.showLines)}t.controllers.line=t.DatasetController.extend({datasetElementType:a.Line,dataElementType:a.Point,update:function(t){var n,i,a,r=this,l=r.getMeta(),s=l.dataset,u=l.data||[],d=r.chart.options,c=d.elements.line,h=r.getScaleForId(l.yAxisID),f=r.getDataset(),g=e(f,d);for(g&&(a=s.custom||{},void 0!==f.tension&&void 0===f.lineTension&&(f.lineTension=f.tension),s._scale=h,s._datasetIndex=r.index,s._children=u,s._model={spanGaps:f.spanGaps?f.spanGaps:d.spanGaps,tension:a.tension?a.tension:o.valueOrDefault(f.lineTension,c.tension),backgroundColor:a.backgroundColor?a.backgroundColor:f.backgroundColor||c.backgroundColor,borderWidth:a.borderWidth?a.borderWidth:f.borderWidth||c.borderWidth,borderColor:a.borderColor?a.borderColor:f.borderColor||c.borderColor,borderCapStyle:a.borderCapStyle?a.borderCapStyle:f.borderCapStyle||c.borderCapStyle,borderDash:a.borderDash?a.borderDash:f.borderDash||c.borderDash,borderDashOffset:a.borderDashOffset?a.borderDashOffset:f.borderDashOffset||c.borderDashOffset,borderJoinStyle:a.borderJoinStyle?a.borderJoinStyle:f.borderJoinStyle||c.borderJoinStyle,fill:a.fill?a.fill:void 0!==f.fill?f.fill:c.fill,steppedLine:a.steppedLine?a.steppedLine:o.valueOrDefault(f.steppedLine,c.stepped),cubicInterpolationMode:a.cubicInterpolationMode?a.cubicInterpolationMode:o.valueOrDefault(f.cubicInterpolationMode,c.cubicInterpolationMode)},s.pivot()),n=0,i=u.length;n');var n=t.data,i=n.datasets,a=n.labels;if(i.length)for(var o=0;o'),a[o]&&e.push(a[o]),e.push("
    • ");return e.push(""),e.join("")},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map(function(n,i){var a=t.getDatasetMeta(0),r=e.datasets[0],l=a.data[i].custom||{},s=o.valueAtIndexOrDefault,u=t.options.elements.arc;return{text:n,fillStyle:l.backgroundColor?l.backgroundColor:s(r.backgroundColor,i,u.backgroundColor),strokeStyle:l.borderColor?l.borderColor:s(r.borderColor,i,u.borderColor),lineWidth:l.borderWidth?l.borderWidth:s(r.borderWidth,i,u.borderWidth),hidden:isNaN(r.data[i])||a.data[i].hidden,index:i}}):[]}},onClick:function(t,e){var n,i,a,o=e.index,r=this.chart;for(n=0,i=(r.data.datasets||[]).length;n0&&!isNaN(t)?2*Math.PI/e:0}})}},{25:25,40:40,45:45}],20:[function(t,e,n){"use strict";var i=t(25),a=t(40),o=t(45);i._set("radar",{scale:{type:"radialLinear"},elements:{line:{tension:0}}}),e.exports=function(t){t.controllers.radar=t.DatasetController.extend({datasetElementType:a.Line,dataElementType:a.Point,linkScales:o.noop,update:function(t){var e=this,n=e.getMeta(),i=n.dataset,a=n.data,r=i.custom||{},l=e.getDataset(),s=e.chart.options.elements.line,u=e.chart.scale;void 0!==l.tension&&void 0===l.lineTension&&(l.lineTension=l.tension),o.extend(n.dataset,{_datasetIndex:e.index,_scale:u,_children:a,_loop:!0,_model:{tension:r.tension?r.tension:o.valueOrDefault(l.lineTension,s.tension),backgroundColor:r.backgroundColor?r.backgroundColor:l.backgroundColor||s.backgroundColor,borderWidth:r.borderWidth?r.borderWidth:l.borderWidth||s.borderWidth,borderColor:r.borderColor?r.borderColor:l.borderColor||s.borderColor,fill:r.fill?r.fill:void 0!==l.fill?l.fill:s.fill,borderCapStyle:r.borderCapStyle?r.borderCapStyle:l.borderCapStyle||s.borderCapStyle,borderDash:r.borderDash?r.borderDash:l.borderDash||s.borderDash,borderDashOffset:r.borderDashOffset?r.borderDashOffset:l.borderDashOffset||s.borderDashOffset,borderJoinStyle:r.borderJoinStyle?r.borderJoinStyle:l.borderJoinStyle||s.borderJoinStyle}}),n.dataset.pivot(),o.each(a,function(n,i){e.updateElement(n,i,t)},e),e.updateBezierControlPoints()},updateElement:function(t,e,n){var i=this,a=t.custom||{},r=i.getDataset(),l=i.chart.scale,s=i.chart.options.elements.point,u=l.getPointPositionForValue(e,r.data[e]);void 0!==r.radius&&void 0===r.pointRadius&&(r.pointRadius=r.radius),void 0!==r.hitRadius&&void 0===r.pointHitRadius&&(r.pointHitRadius=r.hitRadius),o.extend(t,{_datasetIndex:i.index,_index:e,_scale:l,_model:{x:n?l.xCenter:u.x,y:n?l.yCenter:u.y,tension:a.tension?a.tension:o.valueOrDefault(r.lineTension,i.chart.options.elements.line.tension),radius:a.radius?a.radius:o.valueAtIndexOrDefault(r.pointRadius,e,s.radius),backgroundColor:a.backgroundColor?a.backgroundColor:o.valueAtIndexOrDefault(r.pointBackgroundColor,e,s.backgroundColor),borderColor:a.borderColor?a.borderColor:o.valueAtIndexOrDefault(r.pointBorderColor,e,s.borderColor),borderWidth:a.borderWidth?a.borderWidth:o.valueAtIndexOrDefault(r.pointBorderWidth,e,s.borderWidth),pointStyle:a.pointStyle?a.pointStyle:o.valueAtIndexOrDefault(r.pointStyle,e,s.pointStyle),hitRadius:a.hitRadius?a.hitRadius:o.valueAtIndexOrDefault(r.pointHitRadius,e,s.hitRadius)}}),t._model.skip=a.skip?a.skip:isNaN(t._model.x)||isNaN(t._model.y)},updateBezierControlPoints:function(){var t=this.chart.chartArea,e=this.getMeta();o.each(e.data,function(n,i){var a=n._model,r=o.splineCurve(o.previousItem(e.data,i,!0)._model,a,o.nextItem(e.data,i,!0)._model,a.tension);a.controlPointPreviousX=Math.max(Math.min(r.previous.x,t.right),t.left),a.controlPointPreviousY=Math.max(Math.min(r.previous.y,t.bottom),t.top),a.controlPointNextX=Math.max(Math.min(r.next.x,t.right),t.left),a.controlPointNextY=Math.max(Math.min(r.next.y,t.bottom),t.top),n.pivot()})},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t.custom||{},i=t._index,a=t._model;a.radius=n.hoverRadius?n.hoverRadius:o.valueAtIndexOrDefault(e.pointHoverRadius,i,this.chart.options.elements.point.hoverRadius),a.backgroundColor=n.hoverBackgroundColor?n.hoverBackgroundColor:o.valueAtIndexOrDefault(e.pointHoverBackgroundColor,i,o.getHoverColor(a.backgroundColor)),a.borderColor=n.hoverBorderColor?n.hoverBorderColor:o.valueAtIndexOrDefault(e.pointHoverBorderColor,i,o.getHoverColor(a.borderColor)),a.borderWidth=n.hoverBorderWidth?n.hoverBorderWidth:o.valueAtIndexOrDefault(e.pointHoverBorderWidth,i,a.borderWidth)},removeHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t.custom||{},i=t._index,a=t._model,r=this.chart.options.elements.point;a.radius=n.radius?n.radius:o.valueAtIndexOrDefault(e.pointRadius,i,r.radius),a.backgroundColor=n.backgroundColor?n.backgroundColor:o.valueAtIndexOrDefault(e.pointBackgroundColor,i,r.backgroundColor),a.borderColor=n.borderColor?n.borderColor:o.valueAtIndexOrDefault(e.pointBorderColor,i,r.borderColor),a.borderWidth=n.borderWidth?n.borderWidth:o.valueAtIndexOrDefault(e.pointBorderWidth,i,r.borderWidth)}})}},{25:25,40:40,45:45}],21:[function(t,e,n){"use strict";t(25)._set("scatter",{hover:{mode:"single"},scales:{xAxes:[{id:"x-axis-1",type:"linear",position:"bottom"}],yAxes:[{id:"y-axis-1",type:"linear",position:"left"}]},showLines:!1,tooltips:{callbacks:{title:function(){return""},label:function(t){return"("+t.xLabel+", "+t.yLabel+")"}}}}),e.exports=function(t){t.controllers.scatter=t.controllers.line}},{25:25}],22:[function(t,e,n){"use strict";var i=t(25),a=t(26),o=t(45);i._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:o.noop,onComplete:o.noop}}),e.exports=function(t){t.Animation=a.extend({chart:null,currentStep:0,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),t.animationService={frameDuration:17,animations:[],dropFrames:0,request:null,addAnimation:function(t,e,n,i){var a,o,r=this.animations;for(e.chart=t,i||(t.animating=!0),a=0,o=r.length;a1&&(n=Math.floor(t.dropFrames),t.dropFrames=t.dropFrames%1),t.advance(1+n);var i=Date.now();t.dropFrames+=(i-e)/t.frameDuration,t.animations.length>0&&t.requestAnimationFrame()},advance:function(t){for(var e,n,i=this.animations,a=0;a=e.numSteps?(o.callback(e.onAnimationComplete,[e],n),n.animating=!1,i.splice(a,1)):++a}},Object.defineProperty(t.Animation.prototype,"animationObject",{get:function(){return this}}),Object.defineProperty(t.Animation.prototype,"chartInstance",{get:function(){return this.chart},set:function(t){this.chart=t}})}},{25:25,26:26,45:45}],23:[function(t,e,n){"use strict";var i=t(25),a=t(45),o=t(28),r=t(48);e.exports=function(t){function e(t){var e=(t=t||{}).data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=a.configMerge(i.global,i[t.type],t.options||{}),t}function n(t){var e=t.options;e.scale?t.scale.options=e.scale:e.scales&&e.scales.xAxes.concat(e.scales.yAxes).forEach(function(e){t.scales[e.id].options=e}),t.tooltip._options=e.tooltips}function l(t){return"top"===t||"bottom"===t}var s=t.plugins;t.types={},t.instances={},t.controllers={},a.extend(t.prototype,{construct:function(n,i){var o=this;i=e(i);var l=r.acquireContext(n,i),s=l&&l.canvas,u=s&&s.height,d=s&&s.width;o.id=a.uid(),o.ctx=l,o.canvas=s,o.config=i,o.width=d,o.height=u,o.aspectRatio=u?d/u:null,o.options=i.options,o._bufferedRender=!1,o.chart=o,o.controller=o,t.instances[o.id]=o,Object.defineProperty(o,"data",{get:function(){return o.config.data},set:function(t){o.config.data=t}}),l&&s?(o.initialize(),o.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return s.notify(t,"beforeInit"),a.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.ensureScalesHaveIDs(),t.buildScales(),t.initToolTip(),s.notify(t,"afterInit"),t},clear:function(){return a.canvas.clear(this),this},stop:function(){return t.animationService.cancelAnimation(this),this},resize:function(t){var e=this,n=e.options,i=e.canvas,o=n.maintainAspectRatio&&e.aspectRatio||null,r=Math.max(0,Math.floor(a.getMaximumWidth(i))),l=Math.max(0,Math.floor(o?r/o:a.getMaximumHeight(i)));if((e.width!==r||e.height!==l)&&(i.width=e.width=r,i.height=e.height=l,i.style.width=r+"px",i.style.height=l+"px",a.retinaScale(e,n.devicePixelRatio),!t)){var u={width:r,height:l};s.notify(e,"resize",[u]),e.options.onResize&&e.options.onResize(e,u),e.stop(),e.update(e.options.responsiveAnimationDuration)}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},n=t.scale;a.each(e.xAxes,function(t,e){t.id=t.id||"x-axis-"+e}),a.each(e.yAxes,function(t,e){t.id=t.id||"y-axis-"+e}),n&&(n.id=n.id||"scale")},buildScales:function(){var e=this,n=e.options,i=e.scales={},o=[];n.scales&&(o=o.concat((n.scales.xAxes||[]).map(function(t){return{options:t,dtype:"category",dposition:"bottom"}}),(n.scales.yAxes||[]).map(function(t){return{options:t,dtype:"linear",dposition:"left"}}))),n.scale&&o.push({options:n.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),a.each(o,function(n){var o=n.options,r=a.valueOrDefault(o.type,n.dtype),s=t.scaleService.getScaleConstructor(r);if(s){l(o.position)!==l(n.dposition)&&(o.position=n.dposition);var u=new s({id:o.id,options:o,ctx:e.ctx,chart:e});i[u.id]=u,u.mergeTicksOptions(),n.isDefault&&(e.scale=u)}}),t.scaleService.addScalesToLayout(this)},buildOrUpdateControllers:function(){var e=this,n=[],i=[];return a.each(e.data.datasets,function(a,o){var r=e.getDatasetMeta(o),l=a.type||e.config.type;if(r.type&&r.type!==l&&(e.destroyDatasetMeta(o),r=e.getDatasetMeta(o)),r.type=l,n.push(r.type),r.controller)r.controller.updateIndex(o);else{var s=t.controllers[r.type];if(void 0===s)throw new Error('"'+r.type+'" is not a chart type.');r.controller=new s(e,o),i.push(r.controller)}},e),i},resetElements:function(){var t=this;a.each(t.data.datasets,function(e,n){t.getDatasetMeta(n).controller.reset()},t)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(t){var e=this;if(t&&"object"==typeof t||(t={duration:t,lazy:arguments[1]}),n(e),!1!==s.notify(e,"beforeUpdate")){e.tooltip._data=e.data;var i=e.buildOrUpdateControllers();a.each(e.data.datasets,function(t,n){e.getDatasetMeta(n).controller.buildOrUpdateElements()},e),e.updateLayout(),a.each(i,function(t){t.reset()}),e.updateDatasets(),s.notify(e,"afterUpdate"),e._bufferedRender?e._bufferedRequest={duration:t.duration,easing:t.easing,lazy:t.lazy}:e.render(t)}},updateLayout:function(){var e=this;!1!==s.notify(e,"beforeLayout")&&(t.layoutService.update(this,this.width,this.height),s.notify(e,"afterScaleUpdate"),s.notify(e,"afterLayout"))},updateDatasets:function(){var t=this;if(!1!==s.notify(t,"beforeDatasetsUpdate")){for(var e=0,n=t.data.datasets.length;e=0;--n)e.isDatasetVisible(n)&&e.drawDataset(n,t);s.notify(e,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var n=this,i=n.getDatasetMeta(t),a={meta:i,index:t,easingValue:e};!1!==s.notify(n,"beforeDatasetDraw",[a])&&(i.controller.draw(e),s.notify(n,"afterDatasetDraw",[a]))},getElementAtEvent:function(t){return o.modes.single(this,t)},getElementsAtEvent:function(t){return o.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return o.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,n){var i=o.modes[e];return"function"==typeof i?i(this,t,n):[]},getDatasetAtEvent:function(t){return o.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this,n=e.data.datasets[t];n._meta||(n._meta={});var i=n._meta[e.id];return i||(i=n._meta[e.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null}),i},getVisibleDatasetCount:function(){for(var t=0,e=0,n=this.data.datasets.length;e0||(a.forEach(function(e){delete t[e]}),delete t._chartjs)}}var a=["push","pop","shift","splice","unshift"];t.DatasetController=function(t,e){this.initialize(t,e)},i.extend(t.DatasetController.prototype,{datasetElementType:null,dataElementType:null,initialize:function(t,e){var n=this;n.chart=t,n.index=e,n.linkScales(),n.addElements()},updateIndex:function(t){this.index=t},linkScales:function(){var t=this,e=t.getMeta(),n=t.getDataset();null===e.xAxisID&&(e.xAxisID=n.xAxisID||t.chart.options.scales.xAxes[0].id),null===e.yAxisID&&(e.yAxisID=n.yAxisID||t.chart.options.scales.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},reset:function(){this.update(!0)},destroy:function(){this._data&&n(this._data,this)},createMetaDataset:function(){var t=this,e=t.datasetElementType;return e&&new e({_chart:t.chart,_datasetIndex:t.index})},createMetaData:function(t){var e=this,n=e.dataElementType;return n&&new n({_chart:e.chart,_datasetIndex:e.index,_index:t})},addElements:function(){var t,e,n=this,i=n.getMeta(),a=n.getDataset().data||[],o=i.data;for(t=0,e=a.length;ti&&t.insertElements(i,a-i)},insertElements:function(t,e){for(var n=0;n=n[e].length&&n[e].push({}),!n[e][r].type||s.type&&s.type!==n[e][r].type?o.merge(n[e][r],[t.scaleService.getScaleDefaults(l),s]):o.merge(n[e][r],s)}else o._merger(e,n,i,a)}})},o.where=function(t,e){if(o.isArray(t)&&Array.prototype.filter)return t.filter(e);var n=[];return o.each(t,function(t){e(t)&&n.push(t)}),n},o.findIndex=Array.prototype.findIndex?function(t,e,n){return t.findIndex(e,n)}:function(t,e,n){n=void 0===n?t:n;for(var i=0,a=t.length;i=0;i--){var a=t[i];if(e(a))return a}},o.inherits=function(t){var e=this,n=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},i=function(){this.constructor=n};return i.prototype=e.prototype,n.prototype=new i,n.extend=o.inherits,t&&o.extend(n.prototype,t),n.__super__=e.prototype,n},o.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},o.almostEquals=function(t,e,n){return Math.abs(t-e)t},o.max=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.max(t,e)},Number.NEGATIVE_INFINITY)},o.min=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.min(t,e)},Number.POSITIVE_INFINITY)},o.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0==(t=+t)||isNaN(t)?t:t>0?1:-1},o.log10=Math.log10?function(t){return Math.log10(t)}:function(t){return Math.log(t)/Math.LN10},o.toRadians=function(t){return t*(Math.PI/180)},o.toDegrees=function(t){return t*(180/Math.PI)},o.getAngleFromPoint=function(t,e){var n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),o=Math.atan2(i,n);return o<-.5*Math.PI&&(o+=2*Math.PI),{angle:o,distance:a}},o.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},o.aliasPixel=function(t){return t%2==0?0:.5},o.splineCurve=function(t,e,n,i){var a=t.skip?e:t,o=e,r=n.skip?e:n,l=Math.sqrt(Math.pow(o.x-a.x,2)+Math.pow(o.y-a.y,2)),s=Math.sqrt(Math.pow(r.x-o.x,2)+Math.pow(r.y-o.y,2)),u=l/(l+s),d=s/(l+s),c=i*(u=isNaN(u)?0:u),h=i*(d=isNaN(d)?0:d);return{previous:{x:o.x-c*(r.x-a.x),y:o.y-c*(r.y-a.y)},next:{x:o.x+h*(r.x-a.x),y:o.y+h*(r.y-a.y)}}},o.EPSILON=Number.EPSILON||1e-14,o.splineCurveMonotone=function(t){var e,n,i,a,r=(t||[]).map(function(t){return{model:t._model,deltaK:0,mK:0}}),l=r.length;for(e=0;e0?r[e-1]:null,(a=e0?r[e-1]:null,a=e=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},o.previousItem=function(t,e,n){return n?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},o.niceNum=function(t,e){var n=Math.floor(o.log10(t)),i=t/Math.pow(10,n);return(e?i<1.5?1:i<3?2:i<7?5:10:i<=1?1:i<=2?2:i<=5?5:10)*Math.pow(10,n)},o.requestAnimFrame="undefined"==typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},o.getRelativePosition=function(t,e){var n,i,a=t.originalEvent||t,r=t.currentTarget||t.srcElement,l=r.getBoundingClientRect(),s=a.touches;s&&s.length>0?(n=s[0].clientX,i=s[0].clientY):(n=a.clientX,i=a.clientY);var u=parseFloat(o.getStyle(r,"padding-left")),d=parseFloat(o.getStyle(r,"padding-top")),c=parseFloat(o.getStyle(r,"padding-right")),h=parseFloat(o.getStyle(r,"padding-bottom")),f=l.right-l.left-u-c,g=l.bottom-l.top-d-h;return n=Math.round((n-l.left-u)/f*r.width/e.currentDevicePixelRatio),i=Math.round((i-l.top-d)/g*r.height/e.currentDevicePixelRatio),{x:n,y:i}},o.getConstraintWidth=function(t){return r(t,"max-width","clientWidth")},o.getConstraintHeight=function(t){return r(t,"max-height","clientHeight")},o.getMaximumWidth=function(t){var e=t.parentNode;if(!e)return t.clientWidth;var n=parseInt(o.getStyle(e,"padding-left"),10),i=parseInt(o.getStyle(e,"padding-right"),10),a=e.clientWidth-n-i,r=o.getConstraintWidth(t);return isNaN(r)?a:Math.min(a,r)},o.getMaximumHeight=function(t){var e=t.parentNode;if(!e)return t.clientHeight;var n=parseInt(o.getStyle(e,"padding-top"),10),i=parseInt(o.getStyle(e,"padding-bottom"),10),a=e.clientHeight-n-i,r=o.getConstraintHeight(t);return isNaN(r)?a:Math.min(a,r)},o.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},o.retinaScale=function(t,e){var n=t.currentDevicePixelRatio=e||window.devicePixelRatio||1;if(1!==n){var i=t.canvas,a=t.height,o=t.width;i.height=a*n,i.width=o*n,t.ctx.scale(n,n),i.style.height=a+"px",i.style.width=o+"px"}},o.fontString=function(t,e,n){return e+" "+t+"px "+n},o.longestText=function(t,e,n,i){var a=(i=i||{}).data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(a=i.data={},r=i.garbageCollect=[],i.font=e),t.font=e;var l=0;o.each(n,function(e){void 0!==e&&null!==e&&!0!==o.isArray(e)?l=o.measureText(t,a,r,l,e):o.isArray(e)&&o.each(e,function(e){void 0===e||null===e||o.isArray(e)||(l=o.measureText(t,a,r,l,e))})});var s=r.length/2;if(s>n.length){for(var u=0;ui&&(i=o),i},o.numberOfLabelLines=function(t){var e=1;return o.each(t,function(t){o.isArray(t)&&t.length>e&&(e=t.length)}),e},o.color=i?function(t){return t instanceof CanvasGradient&&(t=a.global.defaultColor),i(t)}:function(t){return console.error("Color.js not found!"),t},o.getHoverColor=function(t){return t instanceof CanvasPattern?t:o.color(t).saturate(.5).darken(.1).rgbString()}}},{25:25,3:3,45:45}],28:[function(t,e,n){"use strict";function i(t,e){return t.native?{x:t.x,y:t.y}:u.getRelativePosition(t,e)}function a(t,e){var n,i,a,o,r;for(i=0,o=t.data.datasets.length;i0&&(u=t.getDatasetMeta(u[0]._datasetIndex).data),u},"x-axis":function(t,e){return s(t,e,{intersect:!0})},point:function(t,e){return o(t,i(e,t))},nearest:function(t,e,n){var a=i(e,t);n.axis=n.axis||"xy";var o=l(n.axis),s=r(t,a,n.intersect,o);return s.length>1&&s.sort(function(t,e){var n=t.getArea()-e.getArea();return 0===n&&(n=t._datasetIndex-e._datasetIndex),n}),s.slice(0,1)},x:function(t,e,n){var o=i(e,t),r=[],l=!1;return a(t,function(t){t.inXRange(o.x)&&r.push(t),t.inRange(o.x,o.y)&&(l=!0)}),n.intersect&&!l&&(r=[]),r},y:function(t,e,n){var o=i(e,t),r=[],l=!1;return a(t,function(t){t.inYRange(o.y)&&r.push(t),t.inRange(o.x,o.y)&&(l=!0)}),n.intersect&&!l&&(r=[]),r}}}},{45:45}],29:[function(t,e,n){"use strict";t(25)._set("global",{responsive:!0,responsiveAnimationDuration:0,maintainAspectRatio:!0,events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",showLines:!0,elements:{},layout:{padding:{top:0,right:0,bottom:0,left:0}}}),e.exports=function(){var t=function(t,e){return this.construct(t,e),this};return t.Chart=t,t}},{25:25}],30:[function(t,e,n){"use strict";var i=t(45);e.exports=function(t){function e(t,e){return i.where(t,function(t){return t.position===e})}function n(t,e){t.forEach(function(t,e){return t._tmpIndex_=e,t}),t.sort(function(t,n){var i=e?n:t,a=e?t:n;return i.weight===a.weight?i._tmpIndex_-a._tmpIndex_:i.weight-a.weight}),t.forEach(function(t){delete t._tmpIndex_})}t.layoutService={defaults:{},addBox:function(t,e){t.boxes||(t.boxes=[]),e.fullWidth=e.fullWidth||!1,e.position=e.position||"top",e.weight=e.weight||0,t.boxes.push(e)},removeBox:function(t,e){var n=t.boxes?t.boxes.indexOf(e):-1;-1!==n&&t.boxes.splice(n,1)},configure:function(t,e,n){for(var i,a=["fullWidth","position","weight"],o=a.length,r=0;rh&&st.maxHeight){s--;break}s++,c=u*d}t.labelRotation=s},afterCalculateTickRotation:function(){l.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){l.callback(this.options.beforeFit,[this])},fit:function(){var t=this,a=t.minSize={width:0,height:0},o=i(t._ticks),r=t.options,u=r.ticks,d=r.scaleLabel,c=r.gridLines,h=r.display,f=t.isHorizontal(),g=n(u),p=r.gridLines.tickMarkLength;if(a.width=f?t.isFullWidth()?t.maxWidth-t.margins.left-t.margins.right:t.maxWidth:h&&c.drawTicks?p:0,a.height=f?h&&c.drawTicks?p:0:t.maxHeight,d.display&&h){var v=s(d)+l.options.toPadding(d.padding).height;f?a.height+=v:a.width+=v}if(u.display&&h){var m=l.longestText(t.ctx,g.font,o,t.longestTextCache),b=l.numberOfLabelLines(o),x=.5*g.size,y=t.options.ticks.padding;if(f){t.longestLabelWidth=m;var k=l.toRadians(t.labelRotation),w=Math.cos(k),M=Math.sin(k)*m+g.size*b+x*(b-1)+x;a.height=Math.min(t.maxHeight,a.height+M+y),t.ctx.font=g.font;var S=e(t.ctx,o[0],g.font),C=e(t.ctx,o[o.length-1],g.font);0!==t.labelRotation?(t.paddingLeft="bottom"===r.position?w*S+3:w*x+3,t.paddingRight="bottom"===r.position?w*x+3:w*C+3):(t.paddingLeft=S/2+3,t.paddingRight=C/2+3)}else u.mirror?m=0:m+=y+x,a.width=Math.min(t.maxWidth,a.width+m),t.paddingTop=g.size/2,t.paddingBottom=g.size/2}t.handleMargins(),t.width=a.width,t.height=a.height},handleMargins:function(){var t=this;t.margins&&(t.paddingLeft=Math.max(t.paddingLeft-t.margins.left,0),t.paddingTop=Math.max(t.paddingTop-t.margins.top,0),t.paddingRight=Math.max(t.paddingRight-t.margins.right,0),t.paddingBottom=Math.max(t.paddingBottom-t.margins.bottom,0))},afterFit:function(){l.callback(this.options.afterFit,[this])},isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(l.isNullOrUndef(t))return NaN;if("number"==typeof t&&!isFinite(t))return NaN;if(t)if(this.isHorizontal()){if(void 0!==t.x)return this.getRightValue(t.x)}else if(void 0!==t.y)return this.getRightValue(t.y);return t},getLabelForIndex:l.noop,getPixelForValue:l.noop,getValueForPixel:l.noop,getPixelForTick:function(t){var e=this,n=e.options.offset;if(e.isHorizontal()){var i=(e.width-(e.paddingLeft+e.paddingRight))/Math.max(e._ticks.length-(n?0:1),1),a=i*t+e.paddingLeft;n&&(a+=i/2);var o=e.left+Math.round(a);return o+=e.isFullWidth()?e.margins.left:0}var r=e.height-(e.paddingTop+e.paddingBottom);return e.top+t*(r/(e._ticks.length-1))},getPixelForDecimal:function(t){var e=this;if(e.isHorizontal()){var n=(e.width-(e.paddingLeft+e.paddingRight))*t+e.paddingLeft,i=e.left+Math.round(n);return i+=e.isFullWidth()?e.margins.left:0}return e.top+t*e.height},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this,e=t.min,n=t.max;return t.beginAtZero?0:e<0&&n<0?n:e>0&&n>0?e:0},_autoSkip:function(t){var e,n,i,a,o=this,r=o.isHorizontal(),s=o.options.ticks.minor,u=t.length,d=l.toRadians(o.labelRotation),c=Math.cos(d),h=o.longestLabelWidth*c,f=[];for(s.maxTicksLimit&&(a=s.maxTicksLimit),r&&(e=!1,(h+s.autoSkipPadding)*u>o.width-(o.paddingLeft+o.paddingRight)&&(e=1+Math.floor((h+s.autoSkipPadding)*u/(o.width-(o.paddingLeft+o.paddingRight)))),a&&u>a&&(e=Math.max(e,Math.floor(u/a)))),n=0;n1&&n%e>0||n%e==0&&n+e>=u)&&n!==u-1||l.isNullOrUndef(i.label))&&delete i.label,f.push(i);return f},draw:function(t){var e=this,i=e.options;if(i.display){var r=e.ctx,u=o.global,d=i.ticks.minor,c=i.ticks.major||d,h=i.gridLines,f=i.scaleLabel,g=0!==e.labelRotation,p=e.isHorizontal(),v=d.autoSkip?e._autoSkip(e.getTicks()):e.getTicks(),m=l.valueOrDefault(d.fontColor,u.defaultFontColor),b=n(d),x=l.valueOrDefault(c.fontColor,u.defaultFontColor),y=n(c),k=h.drawTicks?h.tickMarkLength:0,w=l.valueOrDefault(f.fontColor,u.defaultFontColor),M=n(f),S=l.options.toPadding(f.padding),C=l.toRadians(e.labelRotation),_=[],D="right"===i.position?e.left:e.right-k,I="right"===i.position?e.left+k:e.right,P="bottom"===i.position?e.top:e.bottom-k,A="bottom"===i.position?e.top+k:e.bottom;if(l.each(v,function(n,o){if(void 0!==n.label){var r,s,c,f,m=n.label;o===e.zeroLineIndex&&i.offset===h.offsetGridLines?(r=h.zeroLineWidth,s=h.zeroLineColor,c=h.zeroLineBorderDash,f=h.zeroLineBorderDashOffset):(r=l.valueAtIndexOrDefault(h.lineWidth,o),s=l.valueAtIndexOrDefault(h.color,o),c=l.valueOrDefault(h.borderDash,u.borderDash),f=l.valueOrDefault(h.borderDashOffset,u.borderDashOffset));var b,x,y,w,M,S,T,F,O,R,L="middle",z="middle",B=d.padding;if(p){var W=k+B;"bottom"===i.position?(z=g?"middle":"top",L=g?"right":"center",R=e.top+W):(z=g?"middle":"bottom",L=g?"left":"center",R=e.bottom-W);var N=a(e,o,h.offsetGridLines&&v.length>1);N1);H0)n=t.stepSize;else{var o=i.niceNum(e.max-e.min,!1);n=i.niceNum(o/(t.maxTicks-1),!0)}var r=Math.floor(e.min/n)*n,l=Math.ceil(e.max/n)*n;t.min&&t.max&&t.stepSize&&i.almostWhole((t.max-t.min)/t.stepSize,n/1e3)&&(r=t.min,l=t.max);var s=(l-r)/n;s=i.almostEquals(s,Math.round(s),n/1e3)?Math.round(s):Math.ceil(s),a.push(void 0!==t.min?t.min:r);for(var u=1;u3?n[2]-n[1]:n[1]-n[0];Math.abs(a)>1&&t!==Math.floor(t)&&(a=t-Math.floor(t));var o=i.log10(Math.abs(a)),r="";if(0!==t){var l=-1*Math.floor(o);l=Math.max(Math.min(l,20),0),r=t.toFixed(l)}else r="0";return r},logarithmic:function(t,e,n){var a=t/Math.pow(10,Math.floor(i.log10(t)));return 0===t?"0":1===a||2===a||5===a||0===e||e===n.length-1?t.toExponential():""}}}},{45:45}],35:[function(t,e,n){"use strict";var i=t(25),a=t(26),o=t(45);i._set("global",{tooltips:{enabled:!0,custom:null,mode:"nearest",position:"average",intersect:!0,backgroundColor:"rgba(0,0,0,0.8)",titleFontStyle:"bold",titleSpacing:2,titleMarginBottom:6,titleFontColor:"#fff",titleAlign:"left",bodySpacing:2,bodyFontColor:"#fff",bodyAlign:"left",footerFontStyle:"bold",footerSpacing:2,footerMarginTop:6,footerFontColor:"#fff",footerAlign:"left",yPadding:6,xPadding:6,caretPadding:2,caretSize:5,cornerRadius:6,multiKeyBackground:"#fff",displayColors:!0,borderColor:"rgba(0,0,0,0)",borderWidth:0,callbacks:{beforeTitle:o.noop,title:function(t,e){var n="",i=e.labels,a=i?i.length:0;if(t.length>0){var o=t[0];o.xLabel?n=o.xLabel:a>0&&o.indexi.height-e.height&&(r="bottom");var l,s,u,d,c,h=(a.left+a.right)/2,f=(a.top+a.bottom)/2;"center"===r?(l=function(t){return t<=h},s=function(t){return t>h}):(l=function(t){return t<=e.width/2},s=function(t){return t>=i.width-e.width/2}),u=function(t){return t+e.width>i.width},d=function(t){return t-e.width<0},c=function(t){return t<=f?"top":"bottom"},l(n.x)?(o="left",u(n.x)&&(o="center",r=c(n.y))):s(n.x)&&(o="right",d(n.x)&&(o="center",r=c(n.y)));var g=t._options;return{xAlign:g.xAlign?g.xAlign:o,yAlign:g.yAlign?g.yAlign:r}}function d(t,e,n){var i=t.x,a=t.y,o=t.caretSize,r=t.caretPadding,l=t.cornerRadius,s=n.xAlign,u=n.yAlign,d=o+r,c=l+r;return"right"===s?i-=e.width:"center"===s&&(i-=e.width/2),"top"===u?a+=d:a-="bottom"===u?e.height+d:e.height/2,"center"===u?"left"===s?i+=d:"right"===s&&(i-=d):"left"===s?i-=c:"right"===s&&(i+=c),{x:i,y:a}}t.Tooltip=a.extend({initialize:function(){this._model=l(this._options)},getTitle:function(){var t=this,e=t._options.callbacks,i=e.beforeTitle.apply(t,arguments),a=e.title.apply(t,arguments),o=e.afterTitle.apply(t,arguments),r=[];return r=n(r,i),r=n(r,a),r=n(r,o)},getBeforeBody:function(){var t=this._options.callbacks.beforeBody.apply(this,arguments);return o.isArray(t)?t:void 0!==t?[t]:[]},getBody:function(t,e){var i=this,a=i._options.callbacks,r=[];return o.each(t,function(t){var o={before:[],lines:[],after:[]};n(o.before,a.beforeLabel.call(i,t,e)),n(o.lines,a.label.call(i,t,e)),n(o.after,a.afterLabel.call(i,t,e)),r.push(o)}),r},getAfterBody:function(){var t=this._options.callbacks.afterBody.apply(this,arguments);return o.isArray(t)?t:void 0!==t?[t]:[]},getFooter:function(){var t=this,e=t._options.callbacks,i=e.beforeFooter.apply(t,arguments),a=e.footer.apply(t,arguments),o=e.afterFooter.apply(t,arguments),r=[];return r=n(r,i),r=n(r,a),r=n(r,o)},update:function(e){var n,i,a=this,c=a._options,h=a._model,f=a._model=l(c),g=a._active,p=a._data,v={xAlign:h.xAlign,yAlign:h.yAlign},m={x:h.x,y:h.y},b={width:h.width,height:h.height},x={x:h.caretX,y:h.caretY};if(g.length){f.opacity=1;var y=[],k=[];x=t.Tooltip.positioners[c.position](g,a._eventPosition);var w=[];for(n=0,i=g.length;n0&&i.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var n={width:e.width,height:e.height},i={x:e.x,y:e.y},a=Math.abs(e.opacity<.001)?0:e.opacity,o=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;this._options.enabled&&o&&(this.drawBackground(i,e,t,n,a),i.x+=e.xPadding,i.y+=e.yPadding,this.drawTitle(i,e,t,a),this.drawBody(i,e,t,a),this.drawFooter(i,e,t,a))}},handleEvent:function(t){var e=this,n=e._options,i=!1;if(e._lastActive=e._lastActive||[],"mouseout"===t.type?e._active=[]:e._active=e._chart.getElementsAtEventForMode(t,n.mode,n),!(i=!o.arrayEquals(e._active,e._lastActive)))return!1;if(e._lastActive=e._active,n.enabled||n.custom){e._eventPosition={x:t.x,y:t.y};var a=e._model;e.update(!0),e.pivot(),i|=a.x!==e._model.x||a.y!==e._model.y}return i}}),t.Tooltip.positioners={average:function(t){if(!t.length)return!1;var e,n,i=0,a=0,o=0;for(e=0,n=t.length;es;)a-=2*Math.PI;for(;a=l&&a<=s,d=r>=n.innerRadius&&r<=n.outerRadius;return u&&d}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,n=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},getArea:function(){var t=this._view;return Math.PI*((t.endAngle-t.startAngle)/(2*Math.PI))*(Math.pow(t.outerRadius,2)-Math.pow(t.innerRadius,2))},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,n=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},draw:function(){var t=this._chart.ctx,e=this._view,n=e.startAngle,i=e.endAngle;t.beginPath(),t.arc(e.x,e.y,e.outerRadius,n,i),t.arc(e.x,e.y,e.innerRadius,i,n,!0),t.closePath(),t.strokeStyle=e.borderColor,t.lineWidth=e.borderWidth,t.fillStyle=e.backgroundColor,t.fill(),t.lineJoin="bevel",e.borderWidth&&t.stroke()}})},{25:25,26:26,45:45}],37:[function(t,e,n){"use strict";var i=t(25),a=t(26),o=t(45),r=i.global;i._set("global",{elements:{line:{tension:.4,backgroundColor:r.defaultColor,borderWidth:3,borderColor:r.defaultColor,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}}),e.exports=a.extend({draw:function(){var t,e,n,i,a=this,l=a._view,s=a._chart.ctx,u=l.spanGaps,d=a._children.slice(),c=r.elements.line,h=-1;for(a._loop&&d.length&&d.push(d[0]),s.save(),s.lineCap=l.borderCapStyle||c.borderCapStyle,s.setLineDash&&s.setLineDash(l.borderDash||c.borderDash),s.lineDashOffset=l.borderDashOffset||c.borderDashOffset,s.lineJoin=l.borderJoinStyle||c.borderJoinStyle,s.lineWidth=l.borderWidth||c.borderWidth,s.strokeStyle=l.borderColor||r.defaultColor,s.beginPath(),h=-1,t=0;te?1:-1,r=1,l=u.borderSkipped||"left"):(e=u.x-u.width/2,n=u.x+u.width/2,i=u.y,o=1,r=(a=u.base)>i?1:-1,l=u.borderSkipped||"bottom"),d){var c=Math.min(Math.abs(e-n),Math.abs(i-a)),h=(d=d>c?c:d)/2,f=e+("left"!==l?h*o:0),g=n+("right"!==l?-h*o:0),p=i+("top"!==l?h*r:0),v=a+("bottom"!==l?-h*r:0);f!==g&&(i=p,a=v),p!==v&&(e=f,n=g)}s.beginPath(),s.fillStyle=u.backgroundColor,s.strokeStyle=u.borderColor,s.lineWidth=d;var m=[[e,a],[e,i],[n,i],[n,a]],b=["bottom","left","top","right"].indexOf(l,0);-1===b&&(b=0);var x=t(0);s.moveTo(x[0],x[1]);for(var y=1;y<4;y++)x=t(y),s.lineTo(x[0],x[1]);s.fill(),d&&s.stroke()},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){var n=!1;if(this._view){var i=a(this);n=t>=i.left&&t<=i.right&&e>=i.top&&e<=i.bottom}return n},inLabelRange:function(t,e){var n=this;if(!n._view)return!1;var o=a(n);return i(n)?t>=o.left&&t<=o.right:e>=o.top&&e<=o.bottom},inXRange:function(t){var e=a(this);return t>=e.left&&t<=e.right},inYRange:function(t){var e=a(this);return t>=e.top&&t<=e.bottom},getCenterPoint:function(){var t,e,n=this._view;return i(this)?(t=n.x,e=(n.y+n.base)/2):(t=(n.x+n.base)/2,e=n.y),{x:t,y:e}},getArea:function(){var t=this._view;return t.width*Math.abs(t.y-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}})},{25:25,26:26}],40:[function(t,e,n){"use strict";e.exports={},e.exports.Arc=t(36),e.exports.Line=t(37),e.exports.Point=t(38),e.exports.Rectangle=t(39)},{36:36,37:37,38:38,39:39}],41:[function(t,e,n){"use strict";var i=t(42),n=e.exports={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,n,i,a,o){if(o){var r=Math.min(o,i/2),l=Math.min(o,a/2);t.moveTo(e+r,n),t.lineTo(e+i-r,n),t.quadraticCurveTo(e+i,n,e+i,n+l),t.lineTo(e+i,n+a-l),t.quadraticCurveTo(e+i,n+a,e+i-r,n+a),t.lineTo(e+r,n+a),t.quadraticCurveTo(e,n+a,e,n+a-l),t.lineTo(e,n+l),t.quadraticCurveTo(e,n,e+r,n)}else t.rect(e,n,i,a)},drawPoint:function(t,e,n,i,a){var o,r,l,s,u,d;if("object"!=typeof e||"[object HTMLImageElement]"!==(o=e.toString())&&"[object HTMLCanvasElement]"!==o){if(!(isNaN(n)||n<=0)){switch(e){default:t.beginPath(),t.arc(i,a,n,0,2*Math.PI),t.closePath(),t.fill();break;case"triangle":t.beginPath(),u=(r=3*n/Math.sqrt(3))*Math.sqrt(3)/2,t.moveTo(i-r/2,a+u/3),t.lineTo(i+r/2,a+u/3),t.lineTo(i,a-2*u/3),t.closePath(),t.fill();break;case"rect":d=1/Math.SQRT2*n,t.beginPath(),t.fillRect(i-d,a-d,2*d,2*d),t.strokeRect(i-d,a-d,2*d,2*d);break;case"rectRounded":var c=n/Math.SQRT2,h=i-c,f=a-c,g=Math.SQRT2*n;t.beginPath(),this.roundedRect(t,h,f,g,g,n/2),t.closePath(),t.fill();break;case"rectRot":d=1/Math.SQRT2*n,t.beginPath(),t.moveTo(i-d,a),t.lineTo(i,a+d),t.lineTo(i+d,a),t.lineTo(i,a-d),t.closePath(),t.fill();break;case"cross":t.beginPath(),t.moveTo(i,a+n),t.lineTo(i,a-n),t.moveTo(i-n,a),t.lineTo(i+n,a),t.closePath();break;case"crossRot":t.beginPath(),l=Math.cos(Math.PI/4)*n,s=Math.sin(Math.PI/4)*n,t.moveTo(i-l,a-s),t.lineTo(i+l,a+s),t.moveTo(i-l,a+s),t.lineTo(i+l,a-s),t.closePath();break;case"star":t.beginPath(),t.moveTo(i,a+n),t.lineTo(i,a-n),t.moveTo(i-n,a),t.lineTo(i+n,a),l=Math.cos(Math.PI/4)*n,s=Math.sin(Math.PI/4)*n,t.moveTo(i-l,a-s),t.lineTo(i+l,a+s),t.moveTo(i-l,a+s),t.lineTo(i+l,a-s),t.closePath();break;case"line":t.beginPath(),t.moveTo(i-n,a),t.lineTo(i+n,a),t.closePath();break;case"dash":t.beginPath(),t.moveTo(i,a),t.lineTo(i+n,a),t.closePath()}t.stroke()}}else t.drawImage(e,i-e.width/2,a-e.height/2,e.width,e.height)},clipArea:function(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()},unclipArea:function(t){t.restore()},lineTo:function(t,e,n,i){if(n.steppedLine)return"after"===n.steppedLine&&!i||"after"!==n.steppedLine&&i?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y),void t.lineTo(n.x,n.y);n.tension?t.bezierCurveTo(i?e.controlPointPreviousX:e.controlPointNextX,i?e.controlPointPreviousY:e.controlPointNextY,i?n.controlPointNextX:n.controlPointPreviousX,i?n.controlPointNextY:n.controlPointPreviousY,n.x,n.y):t.lineTo(n.x,n.y)}};i.clear=n.clear,i.drawRoundedRectangle=function(t){t.beginPath(),n.roundedRect.apply(n,arguments),t.closePath()}},{42:42}],42:[function(t,e,n){"use strict";var i={noop:function(){},uid:function(){var t=0;return function(){return t++}}(),isNullOrUndef:function(t){return null===t||void 0===t},isArray:Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},isObject:function(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)},valueOrDefault:function(t,e){return void 0===t?e:t},valueAtIndexOrDefault:function(t,e,n){return i.valueOrDefault(i.isArray(t)?t[e]:t,n)},callback:function(t,e,n){if(t&&"function"==typeof t.call)return t.apply(n,e)},each:function(t,e,n,a){var o,r,l;if(i.isArray(t))if(r=t.length,a)for(o=r-1;o>=0;o--)e.call(n,t[o],o);else for(o=0;o=1?t:-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t-=1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n))},easeOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},easeInOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:2==(t/=.5)?1:(n||(n=.45),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),t<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-a.easeOutBounce(1-t)},easeOutBounce:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*a.easeInBounce(2*t):.5*a.easeOutBounce(2*t-1)+.5}};e.exports={effects:a},i.easingEffects=a},{42:42}],44:[function(t,e,n){"use strict";var i=t(42);e.exports={toLineHeight:function(t,e){var n=(""+t).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!n||"normal"===n[1])return 1.2*e;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100}return e*t},toPadding:function(t){var e,n,a,o;return i.isObject(t)?(e=+t.top||0,n=+t.right||0,a=+t.bottom||0,o=+t.left||0):e=n=a=o=+t||0,{top:e,right:n,bottom:a,left:o,height:e+a,width:o+n}},resolve:function(t,e,n){var a,o,r;for(a=0,o=t.length;a
      ';var a=e.childNodes[0],r=e.childNodes[1];e._reset=function(){a.scrollLeft=1e6,a.scrollTop=1e6,r.scrollLeft=1e6,r.scrollTop=1e6};var l=function(){e._reset(),t()};return o(a,"scroll",l.bind(a,"expand")),o(r,"scroll",l.bind(r,"shrink")),e}function c(t,e){var n=(t[m]||(t[m]={})).renderProxy=function(t){t.animationName===y&&e()};v.each(k,function(e){o(t,e,n)}),t.classList.add(x)}function h(t){var e=t[m]||{},n=e.renderProxy;n&&(v.each(k,function(e){r(t,e,n)}),delete e.renderProxy),t.classList.remove(x)}function f(t,e,n){var i=t[m]||(t[m]={}),a=i.resizer=d(u(function(){if(i.resizer)return e(l("resize",n))}));c(t,function(){if(i.resizer){var e=t.parentNode;e&&e!==a.parentNode&&e.insertBefore(a,e.firstChild),a._reset()}})}function g(t){var e=t[m]||{},n=e.resizer;delete e.resizer,h(t),n&&n.parentNode&&n.parentNode.removeChild(n)}function p(t,e){var n=t._style||document.createElement("style");t._style||(t._style=n,e="/* Chart.js */\n"+e,n.setAttribute("type","text/css"),document.getElementsByTagName("head")[0].appendChild(n)),n.appendChild(document.createTextNode(e))}var v=t(45),m="$chartjs",b="chartjs-",x=b+"render-monitor",y=b+"render-animation",k=["animationstart","webkitAnimationStart"],w={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},M=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(t){}return t}()&&{passive:!0};e.exports={_enabled:"undefined"!=typeof window&&"undefined"!=typeof document,initialize:function(){var t="from{opacity:0.99}to{opacity:1}";p(this,"@-webkit-keyframes "+y+"{"+t+"}@keyframes "+y+"{"+t+"}."+x+"{-webkit-animation:"+y+" 0.001s;animation:"+y+" 0.001s;}")},acquireContext:function(t,e){"string"==typeof t?t=document.getElementById(t):t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas);var n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(a(t,e),n):null},releaseContext:function(t){var e=t.canvas;if(e[m]){var n=e[m].initial;["height","width"].forEach(function(t){var i=n[t];v.isNullOrUndef(i)?e.removeAttribute(t):e.setAttribute(t,i)}),v.each(n.style||{},function(t,n){e.style[n]=t}),e.width=e.width,delete e[m]}},addEventListener:function(t,e,n){var i=t.canvas;if("resize"!==e){var a=n[m]||(n[m]={});o(i,e,(a.proxies||(a.proxies={}))[t.id+"_"+e]=function(e){n(s(e,t))})}else f(i,n,t)},removeEventListener:function(t,e,n){var i=t.canvas;if("resize"!==e){var a=((n[m]||{}).proxies||{})[t.id+"_"+e];a&&r(i,e,a)}else g(i)}},v.addEvent=o,v.removeEvent=r},{45:45}],48:[function(t,e,n){"use strict";var i=t(45),a=t(46),o=t(47),r=o._enabled?o:a;e.exports=i.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},r)},{45:45,46:46,47:47}],49:[function(t,e,n){"use strict";var i=t(25),a=t(40),o=t(45);i._set("global",{plugins:{filler:{propagate:!0}}}),e.exports=function(){function t(t,e,n){var i,a=t._model||{},o=a.fill;if(void 0===o&&(o=!!a.backgroundColor),!1===o||null===o)return!1;if(!0===o)return"origin";if(i=parseFloat(o,10),isFinite(i)&&Math.floor(i)===i)return"-"!==o[0]&&"+"!==o[0]||(i=e+i),!(i===e||i<0||i>=n)&&i;switch(o){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return o;default:return!1}}function e(t){var e,n=t.el._model||{},i=t.el._scale||{},a=t.fill,o=null;if(isFinite(a))return null;if("start"===a?o=void 0===n.scaleBottom?i.bottom:n.scaleBottom:"end"===a?o=void 0===n.scaleTop?i.top:n.scaleTop:void 0!==n.scaleZero?o=n.scaleZero:i.getBasePosition?o=i.getBasePosition():i.getBasePixel&&(o=i.getBasePixel()),void 0!==o&&null!==o){if(void 0!==o.x&&void 0!==o.y)return o;if("number"==typeof o&&isFinite(o))return e=i.isHorizontal(),{x:e?o:null,y:e?null:o}}return null}function n(t,e,n){var i,a=t[e].fill,o=[e];if(!n)return a;for(;!1!==a&&-1===o.indexOf(a);){if(!isFinite(a))return a;if(!(i=t[a]))return!1;if(i.visible)return a;o.push(a),a=i.fill}return!1}function r(t){var e=t.fill,n="dataset";return!1===e?null:(isFinite(e)||(n="boundary"),d[n](t))}function l(t){return t&&!t.skip}function s(t,e,n,i,a){var r;if(i&&a){for(t.moveTo(e[0].x,e[0].y),r=1;r0;--r)o.canvas.lineTo(t,n[r],n[r-1],!0)}}function u(t,e,n,i,a,o){var r,u,d,c,h,f,g,p=e.length,v=i.spanGaps,m=[],b=[],x=0,y=0;for(t.beginPath(),r=0,u=p+!!o;r');for(var n=0;n'),t.data.datasets[n].label&&e.push(t.data.datasets[n].label),e.push("");return e.push(""),e.join("")}}),e.exports=function(t){function e(t,e){return t.usePointStyle?e*Math.SQRT2:t.boxWidth}function n(e,n){var i=new t.Legend({ctx:e.ctx,options:n,chart:e});r.configure(e,i,n),r.addBox(e,i),e.legend=i}var r=t.layoutService,l=o.noop;return t.Legend=a.extend({initialize:function(t){o.extend(this,t),this.legendHitBoxes=[],this.doughnutMode=!1},beforeUpdate:l,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:l,beforeSetDimensions:l,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:l,beforeBuildLabels:l,buildLabels:function(){var t=this,e=t.options.labels||{},n=o.callback(e.generateLabels,[t.chart],t)||[];e.filter&&(n=n.filter(function(n){return e.filter(n,t.chart.data)})),t.options.reverse&&n.reverse(),t.legendItems=n},afterBuildLabels:l,beforeFit:l,fit:function(){var t=this,n=t.options,a=n.labels,r=n.display,l=t.ctx,s=i.global,u=o.valueOrDefault,d=u(a.fontSize,s.defaultFontSize),c=u(a.fontStyle,s.defaultFontStyle),h=u(a.fontFamily,s.defaultFontFamily),f=o.fontString(d,c,h),g=t.legendHitBoxes=[],p=t.minSize,v=t.isHorizontal();if(v?(p.width=t.maxWidth,p.height=r?10:0):(p.width=r?10:0,p.height=t.maxHeight),r)if(l.font=f,v){var m=t.lineWidths=[0],b=t.legendItems.length?d+a.padding:0;l.textAlign="left",l.textBaseline="top",o.each(t.legendItems,function(n,i){var o=e(a,d)+d/2+l.measureText(n.text).width;m[m.length-1]+o+a.padding>=t.width&&(b+=d+a.padding,m[m.length]=t.left),g[i]={left:0,top:0,width:o,height:d},m[m.length-1]+=o+a.padding}),p.height+=b}else{var x=a.padding,y=t.columnWidths=[],k=a.padding,w=0,M=0,S=d+x;o.each(t.legendItems,function(t,n){var i=e(a,d)+d/2+l.measureText(t.text).width;M+S>p.height&&(k+=w+a.padding,y.push(w),w=0,M=0),w=Math.max(w,i),M+=S,g[n]={left:0,top:0,width:i,height:d}}),k+=w,y.push(w),p.width+=k}t.width=p.width,t.height=p.height},afterFit:l,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,n=t.options,a=n.labels,r=i.global,l=r.elements.line,s=t.width,u=t.lineWidths;if(n.display){var d,c=t.ctx,h=o.valueOrDefault,f=h(a.fontColor,r.defaultFontColor),g=h(a.fontSize,r.defaultFontSize),p=h(a.fontStyle,r.defaultFontStyle),v=h(a.fontFamily,r.defaultFontFamily),m=o.fontString(g,p,v);c.textAlign="left",c.textBaseline="middle",c.lineWidth=.5,c.strokeStyle=f,c.fillStyle=f,c.font=m;var b=e(a,g),x=t.legendHitBoxes,y=function(t,e,i){if(!(isNaN(b)||b<=0)){c.save(),c.fillStyle=h(i.fillStyle,r.defaultColor),c.lineCap=h(i.lineCap,l.borderCapStyle),c.lineDashOffset=h(i.lineDashOffset,l.borderDashOffset),c.lineJoin=h(i.lineJoin,l.borderJoinStyle),c.lineWidth=h(i.lineWidth,l.borderWidth),c.strokeStyle=h(i.strokeStyle,r.defaultColor);var a=0===h(i.lineWidth,l.borderWidth);if(c.setLineDash&&c.setLineDash(h(i.lineDash,l.borderDash)),n.labels&&n.labels.usePointStyle){var s=g*Math.SQRT2/2,u=s/Math.SQRT2,d=t+u,f=e+u;o.canvas.drawPoint(c,i.pointStyle,s,d,f)}else a||c.strokeRect(t,e,b,g),c.fillRect(t,e,b,g);c.restore()}},k=function(t,e,n,i){var a=g/2,o=b+a+t,r=e+a;c.fillText(n.text,o,r),n.hidden&&(c.beginPath(),c.lineWidth=2,c.moveTo(o,r),c.lineTo(o+i,r),c.stroke())},w=t.isHorizontal();d=w?{x:t.left+(s-u[0])/2,y:t.top+a.padding,line:0}:{x:t.left+a.padding,y:t.top+a.padding,line:0};var M=g+a.padding;o.each(t.legendItems,function(e,n){var i=c.measureText(e.text).width,o=b+g/2+i,r=d.x,l=d.y;w?r+o>=s&&(l=d.y+=M,d.line++,r=d.x=t.left+(s-u[d.line])/2):l+M>t.bottom&&(r=d.x=r+t.columnWidths[d.line]+a.padding,l=d.y=t.top+a.padding,d.line++),y(r,l,e),x[n].left=r,x[n].top=l,k(r,l,e,i),w?d.x+=o+a.padding:d.y+=M})}},handleEvent:function(t){var e=this,n=e.options,i="mouseup"===t.type?"click":t.type,a=!1;if("mousemove"===i){if(!n.onHover)return}else{if("click"!==i)return;if(!n.onClick)return}var o=t.x,r=t.y;if(o>=e.left&&o<=e.right&&r>=e.top&&r<=e.bottom)for(var l=e.legendHitBoxes,s=0;s=u.left&&o<=u.left+u.width&&r>=u.top&&r<=u.top+u.height){if("click"===i){n.onClick.call(e,t.native,e.legendItems[s]),a=!0;break}if("mousemove"===i){n.onHover.call(e,t.native,e.legendItems[s]),a=!0;break}}}return a}}),{id:"legend",beforeInit:function(t){var e=t.options.legend;e&&n(t,e)},beforeUpdate:function(t){var e=t.options.legend,a=t.legend;e?(o.mergeIf(e,i.global.legend),a?(r.configure(t,a,e),a.options=e):n(t,e)):a&&(r.removeBox(t,a),delete t.legend)},afterEvent:function(t,e){var n=t.legend;n&&n.handleEvent(e)}}}},{25:25,26:26,45:45}],51:[function(t,e,n){"use strict";var i=t(25),a=t(26),o=t(45);i._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,lineHeight:1.2,padding:10,position:"top",text:"",weight:2e3}}),e.exports=function(t){function e(e,i){var a=new t.Title({ctx:e.ctx,options:i,chart:e});n.configure(e,a,i),n.addBox(e,a),e.titleBlock=a}var n=t.layoutService,r=o.noop;return t.Title=a.extend({initialize:function(t){var e=this;o.extend(e,t),e.legendHitBoxes=[]},beforeUpdate:r,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:r,beforeSetDimensions:r,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:r,beforeBuildLabels:r,buildLabels:r,afterBuildLabels:r,beforeFit:r,fit:function(){var t=this,e=o.valueOrDefault,n=t.options,a=n.display,r=e(n.fontSize,i.global.defaultFontSize),l=t.minSize,s=o.isArray(n.text)?n.text.length:1,u=o.options.toLineHeight(n.lineHeight,r),d=a?s*u+2*n.padding:0;t.isHorizontal()?(l.width=t.maxWidth,l.height=d):(l.width=d,l.height=t.maxHeight),t.width=l.width,t.height=l.height},afterFit:r,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,n=o.valueOrDefault,a=t.options,r=i.global;if(a.display){var l,s,u,d=n(a.fontSize,r.defaultFontSize),c=n(a.fontStyle,r.defaultFontStyle),h=n(a.fontFamily,r.defaultFontFamily),f=o.fontString(d,c,h),g=o.options.toLineHeight(a.lineHeight,d),p=g/2+a.padding,v=0,m=t.top,b=t.left,x=t.bottom,y=t.right;e.fillStyle=n(a.fontColor,r.defaultFontColor),e.font=f,t.isHorizontal()?(s=b+(y-b)/2,u=m+p,l=y-b):(s="left"===a.position?b+p:y-p,u=m+(x-m)/2,l=x-m,v=Math.PI*("left"===a.position?-.5:.5)),e.save(),e.translate(s,u),e.rotate(v),e.textAlign="center",e.textBaseline="middle";var k=a.text;if(o.isArray(k))for(var w=0,M=0;Me.max&&(e.max=i))})});e.min=isFinite(e.min)&&!isNaN(e.min)?e.min:0,e.max=isFinite(e.max)&&!isNaN(e.max)?e.max:1,this.handleTickRangeOptions()},getTickLimit:function(){var t,e=this,n=e.options.ticks;if(e.isHorizontal())t=Math.min(n.maxTicksLimit?n.maxTicksLimit:11,Math.ceil(e.width/50));else{var o=a.valueOrDefault(n.fontSize,i.global.defaultFontSize);t=Math.min(n.maxTicksLimit?n.maxTicksLimit:11,Math.ceil(e.height/(2*o)))}return t},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},getPixelForValue:function(t){var e,n=this,i=n.start,a=+n.getRightValue(t),o=n.end-i;return n.isHorizontal()?(e=n.left+n.width/o*(a-i),Math.round(e)):(e=n.bottom-n.height/o*(a-i),Math.round(e))},getValueForPixel:function(t){var e=this,n=e.isHorizontal(),i=n?e.width:e.height,a=(n?t-e.left:e.bottom-t)/i;return e.start+(e.end-e.start)*a},getPixelForTick:function(t){return this.getPixelForValue(this.ticksAsNumbers[t])}});t.scaleService.registerScaleType("linear",n,e)}},{25:25,34:34,45:45}],54:[function(t,e,n){"use strict";var i=t(45),a=t(34);e.exports=function(t){var e=i.noop;t.LinearScaleBase=t.Scale.extend({getRightValue:function(e){return"string"==typeof e?+e:t.Scale.prototype.getRightValue.call(this,e)},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;if(e.beginAtZero){var n=i.sign(t.min),a=i.sign(t.max);n<0&&a<0?t.max=0:n>0&&a>0&&(t.min=0)}var o=void 0!==e.min||void 0!==e.suggestedMin,r=void 0!==e.max||void 0!==e.suggestedMax;void 0!==e.min?t.min=e.min:void 0!==e.suggestedMin&&(null===t.min?t.min=e.suggestedMin:t.min=Math.min(t.min,e.suggestedMin)),void 0!==e.max?t.max=e.max:void 0!==e.suggestedMax&&(null===t.max?t.max=e.suggestedMax:t.max=Math.max(t.max,e.suggestedMax)),o!==r&&t.min>=t.max&&(o?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,e.beginAtZero||t.min--)},getTickLimit:e,handleDirectionalChanges:e,buildTicks:function(){var t=this,e=t.options.ticks,n=t.getTickLimit(),o={maxTicks:n=Math.max(2,n),min:e.min,max:e.max,stepSize:i.valueOrDefault(e.fixedStepSize,e.stepSize)},r=t.ticks=a.generators.linear(o,t);t.handleDirectionalChanges(),t.max=i.max(r),t.min=i.min(r),e.reverse?(r.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){var e=this;e.ticksAsNumbers=e.ticks.slice(),e.zeroLineIndex=e.ticks.indexOf(0),t.Scale.prototype.convertTicksToLabels.call(e)}})}},{34:34,45:45}],55:[function(t,e,n){"use strict";var i=t(45),a=t(34);e.exports=function(t){var e={position:"left",ticks:{callback:a.formatters.logarithmic}},n=t.Scale.extend({determineDataLimits:function(){function t(t){return s?t.xAxisID===e.id:t.yAxisID===e.id}var e=this,n=e.options,a=n.ticks,o=e.chart,r=o.data.datasets,l=i.valueOrDefault,s=e.isHorizontal();e.min=null,e.max=null,e.minNotZero=null;var u=n.stacked;if(void 0===u&&i.each(r,function(e,n){if(!u){var i=o.getDatasetMeta(n);o.isDatasetVisible(n)&&t(i)&&void 0!==i.stack&&(u=!0)}}),n.stacked||u){var d={};i.each(r,function(a,r){var l=o.getDatasetMeta(r),s=[l.type,void 0===n.stacked&&void 0===l.stack?r:"",l.stack].join(".");o.isDatasetVisible(r)&&t(l)&&(void 0===d[s]&&(d[s]=[]),i.each(a.data,function(t,i){var a=d[s],o=+e.getRightValue(t);isNaN(o)||l.data[i].hidden||(a[i]=a[i]||0,n.relativePoints?a[i]=100:a[i]+=o)}))}),i.each(d,function(t){var n=i.min(t),a=i.max(t);e.min=null===e.min?n:Math.min(e.min,n),e.max=null===e.max?a:Math.max(e.max,a)})}else i.each(r,function(n,a){var r=o.getDatasetMeta(a);o.isDatasetVisible(a)&&t(r)&&i.each(n.data,function(t,n){var i=+e.getRightValue(t);isNaN(i)||r.data[n].hidden||(null===e.min?e.min=i:ie.max&&(e.max=i),0!==i&&(null===e.minNotZero||ia?{start:e-n-5,end:e}:{start:e,end:e+n+5}}function s(t){var i,o,s,u=n(t),d=Math.min(t.height/2,t.width/2),c={r:t.width,l:0,t:t.height,b:0},h={};t.ctx.font=u.font,t._pointLabelSizes=[];var f=e(t);for(i=0;ic.r&&(c.r=v.end,h.r=g),m.startc.b&&(c.b=m.end,h.b=g)}t.setReductions(d,c,h)}function u(t){var e=Math.min(t.height/2,t.width/2);t.drawingArea=Math.round(e),t.setCenterPoint(0,0,0,0)}function d(t){return 0===t||180===t?"center":t<180?"left":"right"}function c(t,e,n,i){if(a.isArray(e))for(var o=n.y,r=1.5*i,l=0;l270||t<90)&&(n.y-=e.h)}function f(t){var i=t.ctx,o=a.valueOrDefault,r=t.options,l=r.angleLines,s=r.pointLabels;i.lineWidth=l.lineWidth,i.strokeStyle=l.color;var u=t.getDistanceFromCenterForValue(r.ticks.reverse?t.min:t.max),f=n(t);i.textBaseline="top";for(var g=e(t)-1;g>=0;g--){if(l.display){var p=t.getPointPosition(g,u);i.beginPath(),i.moveTo(t.xCenter,t.yCenter),i.lineTo(p.x,p.y),i.stroke(),i.closePath()}if(s.display){var m=t.getPointPosition(g,u+5),b=o(s.fontColor,v.defaultFontColor);i.font=f.font,i.fillStyle=b;var x=t.getIndexAngle(g),y=a.toDegrees(x);i.textAlign=d(y),h(y,t._pointLabelSizes[g],m),c(i,t.pointLabels[g]||"",m,f.size)}}}function g(t,n,i,o){var r=t.ctx;if(r.strokeStyle=a.valueAtIndexOrDefault(n.color,o-1),r.lineWidth=a.valueAtIndexOrDefault(n.lineWidth,o-1),t.options.gridLines.circular)r.beginPath(),r.arc(t.xCenter,t.yCenter,i,0,2*Math.PI),r.closePath(),r.stroke();else{var l=e(t);if(0===l)return;r.beginPath();var s=t.getPointPosition(0,i);r.moveTo(s.x,s.y);for(var u=1;u0&&n>0?e:0)},draw:function(){var t=this,e=t.options,n=e.gridLines,i=e.ticks,o=a.valueOrDefault;if(e.display){var r=t.ctx,l=this.getIndexAngle(0),s=o(i.fontSize,v.defaultFontSize),u=o(i.fontStyle,v.defaultFontStyle),d=o(i.fontFamily,v.defaultFontFamily),c=a.fontString(s,u,d);a.each(t.ticks,function(e,a){if(a>0||i.reverse){var u=t.getDistanceFromCenterForValue(t.ticksAsNumbers[a]);if(n.display&&0!==a&&g(t,n,u,a),i.display){var d=o(i.fontColor,v.defaultFontColor);if(r.font=c,r.save(),r.translate(t.xCenter,t.yCenter),r.rotate(l),i.showLabelBackdrop){var h=r.measureText(e).width;r.fillStyle=i.backdropColor,r.fillRect(-h/2-i.backdropPaddingX,-u-s/2-i.backdropPaddingY,h+2*i.backdropPaddingX,s+2*i.backdropPaddingY)}r.textAlign="center",r.textBaseline="middle",r.fillStyle=d,r.fillText(e,0,-u),r.restore()}}}),(e.angleLines.display||e.pointLabels.display)&&f(t)}}});t.scaleService.registerScaleType("radialLinear",b,m)}},{25:25,34:34,45:45}],57:[function(t,e,n){"use strict";function i(t,e){return t-e}function a(t){var e,n,i,a={},o=[];for(e=0,n=t.length;ee&&l=0&&r<=l;){if(i=r+l>>1,a=t[i-1]||null,o=t[i],!a)return{lo:null,hi:o};if(o[e]n))return{lo:a,hi:o};l=i-1}}return{lo:o,hi:null}}function l(t,e,n,i){var a=r(t,e,n),o=a.lo?a.hi?a.lo:t[t.length-2]:t[0],l=a.lo?a.hi?a.hi:t[t.length-1]:t[1],s=l[e]-o[e],u=s?(n-o[e])/s:0,d=(l[i]-o[i])*u;return o[i]+d}function s(t,e){var n=e.parser,i=e.parser||e.format;return"function"==typeof n?n(t):"string"==typeof t&&"string"==typeof i?v(t,i):(t instanceof v||(t=v(t)),t.isValid()?t:"function"==typeof i?i(t):t)}function u(t,e){if(b.isNullOrUndef(t))return null;var n=e.options.time,i=s(e.getRightValue(t),n);return i.isValid()?(n.round&&i.startOf(n.round),i.valueOf()):null}function d(t,e,n,i){var a,o,r,l=e-t,s=k[n],u=s.size,d=s.steps;if(!d)return Math.ceil(l/((i||1)*u));for(a=0,o=d.length;a1?e[1]:i,r=e[0],s=(l(t,"time",o,"pos")-l(t,"time",r,"pos"))/2),a.time.max||(o=e[e.length-1],r=e.length>1?e[e.length-2]:n,u=(l(t,"time",o,"pos")-l(t,"time",r,"pos"))/2)),{left:s,right:u}}function p(t,e){var n,i,a,o,r=[];for(n=0,i=t.length;n=a&&n<=r&&y.push(n);return i.min=a,i.max=r,i._unit=m,i._majorUnit=b,i._minorFormat=d[m],i._majorFormat=d[b],i._table=o(i._timestamps.data,a,r,l.distribution),i._offsets=g(i._table,y,a,r,l),p(y,b)},getLabelForIndex:function(t,e){var n=this,i=n.chart.data,a=n.options.time,o=i.labels&&t=0&&t1&&void 0!==arguments[1]?arguments[1]:{},i=e.prefix,n=void 0===i?"":i,s=e.firstUpperCase,r=void 0!==s&&s,a=t.name,l=a.replace(/^cube-/i,""),u=""+(0,o.camelize)(""+n+l);return r&&(u=u.charAt(0).toUpperCase()+u.slice(1)),u}function v(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=e.split("."),n=t,o=0;o2&&void 0!==arguments[2]?arguments[2]:{},n=i.type,o=void 0===n?"Event":n,s=i.bubbles,r=void 0===s||s,a=i.cancelable,l=void 0===a||a,u=document.createEvent(o);u.initEvent(e,r,l),t.dispatchEvent(u)}Object.defineProperty(t,"__esModule",{value:!0}),t.hasClass=i,t.addClass=n,t.removeClass=o,t.getData=s,t.getRect=r,t.prefixStyle=a,t.getMatchedTarget=l,t.dispatchEvent=u;var c=function(){if(!e.inBrowser)return!1;var t=document.createElement("div").style,i={standard:"transform",webkit:"webkitTransform",Moz:"MozTransform",O:"OTransform",ms:"msTransform"};for(var n in i)if(void 0!==t[i[n]])return n;return!1}()})},function(t,e,i){var n,o,s;!function(r,a){o=[t,e,i(4),i(1),i(5)],n=a,void 0!==(s="function"==typeof n?n.apply(e,o):n)&&(t.exports=s)}(0,function(t,e,i,n,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default={computed:{$t:function(){var t=this.$cubeLang,e=this.$cubeMessages[t];return(0,n.isUndef)(e)?((0,o.warn)("Translation is not registered correctly, you can call Locale.use() to install it."),""):function(t){return(0,n.parsePath)(e,t)}}},beforeCreate:function(){s.default.install(this.$root.constructor)}},t.exports=e.default})},function(t,e){var i=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(t,e,i){var n=i(22),o=i(72),s=i(47),r=Object.defineProperty;e.f=i(15)?Object.defineProperty:function(t,e,i){if(n(t),e=s(e,!0),n(i),o)try{return r(t,e,i)}catch(t){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(t[e]=i.value),t}},function(t,e,i){var n=i(12),o=i(2),s=i(71),r=i(21),a=i(16),l=function(t,e,i){var u,c,d,f=t&l.F,h=t&l.G,p=t&l.S,v=t&l.P,m=t&l.B,y=t&l.W,b=h?o:o[e]||(o[e]={}),g=b.prototype,_=h?n:p?n[e]:(n[e]||{}).prototype;h&&(i=e);for(u in i)(c=!f&&_&&void 0!==_[u])&&a(b,u)||(d=c?_[u]:i[u],b[u]=h&&"function"!=typeof _[u]?i[u]:m&&c?s(d,n):y&&_[u]==d?function(t){var e=function(e,i,n){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,i)}return new t(e,i,n)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(d):v&&"function"==typeof d?s(Function.call,d):d,v&&((b.virtual||(b.virtual={}))[u]=d,t&l.R&&g&&!g[u]&&r(g,u,d)))};l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,t.exports=l},function(t,e,i){t.exports=!i(23)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){var i={}.hasOwnProperty;t.exports=function(t,e){return i.call(t,e)}},function(t,e,i){t.exports={default:i(122),__esModule:!0}},function(t,e,i){var n=i(75),o=i(48);t.exports=function(t){return n(o(t))}},function(t,e,i){function n(t){i(219)}var o=i(0)(i(220),i(231),n,null,null);t.exports=o.exports},function(t,e,i){"use strict";e.__esModule=!0;var n=i(117),o=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=function(t,e,i){return e in t?(0,o.default)(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}},function(t,e,i){var n=i(13),o=i(31);t.exports=i(15)?function(t,e,i){return n.f(t,e,o(1,i))}:function(t,e,i){return t[e]=i,t}},function(t,e,i){var n=i(30);t.exports=function(t){if(!n(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,i){var n=i(74),o=i(53);t.exports=Object.keys||function(t){return n(t,o)}},function(t,e){t.exports={}},function(t,e,i){function n(t){i(162)}var o=i(0)(i(163),i(164),n,null,null);t.exports=o.exports},function(t,e,i){function n(t){i(228)}var o=i(0)(i(229),i(230),n,null,null);t.exports=o.exports},function(t,e,i){var n,o,s;!function(r,a){o=[t,e,i(8),i(5)],n=a,void 0!==(s="function"==typeof n?n.apply(e,o):n)&&(t.exports=s)}(0,function(t,e,i,n){"use strict";function o(t,e){(0,s.default)(t,e,["select","value-change","cancel","change"]).before(function(t,e,i){i&&(0,n.tip)("Picker component can not be a singleton.")})}Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var s=function(t){return t&&t.__esModule?t:{default:t}}(i);t.exports=e.default})},function(t,e,i){function n(t){i(325)}var o=i(0)(i(326),i(341),n,null,null);t.exports=o.exports},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=i(127),s=n(o),r=i(137),a=n(r),l="function"==typeof a.default&&"symbol"==typeof s.default?function(t){return typeof t}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":typeof t};e.default="function"==typeof a.default&&"symbol"===l(s.default)?function(t){return void 0===t?"undefined":l(t)}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":void 0===t?"undefined":l(t)}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,i){function n(t){i(153)}var o=i(0)(i(154),i(155),n,null,null);t.exports=o.exports},function(t,e,i){var n,o,s;!function(i,r){o=[t,e],n=r,void 0!==(s="function"==typeof n?n.apply(e,o):n)&&(t.exports=s)}(0,function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={props:{title:{type:String},subtitle:{type:String},cancelTxt:{type:String,default:""},confirmTxt:{type:String,default:""},swipeTime:{type:Number,default:2500},maskClosable:{type:Boolean,default:!0}},computed:{_cancelTxt:function(){return this.cancelTxt||this.$t("cancel")},_confirmTxt:function(){return this.confirmTxt||this.$t("ok")}}},t.exports=e.default})},function(t,e,i){var n,o,s;!function(i,r){o=[t,e],n=r,void 0!==(s="function"==typeof n?n.apply(e,o):n)&&(t.exports=s)}(0,function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={props:{options:{type:Object,default:function(){return{}}}}},t.exports=e.default})},function(t,e,i){var n=i(48);t.exports=function(t){return Object(n(t))}},function(t,e){t.exports=!0},function(t,e){var i=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++i+n).toString(36))}},function(t,e,i){"use strict";var n=i(129)(!0);i(77)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,i=this._i;return i>=e.length?{value:void 0,done:!0}:(t=n(e,i),this._i+=t.length,{value:t,done:!1})})},function(t,e,i){var n,o,s;!function(i,r){o=[e],n=r,void 0!==(s="function"==typeof n?n.apply(e,o):n)&&(t.exports=s)}(0,function(t){"use strict";function e(t,e,n,o){var s={year:"(Y+)",month:"(M+)",date:"(D+)",hour:"(h+)",minute:"(m+)",second:"(s+)",quarter:"(q+)",millisecond:"(S)"};if(new RegExp(s[t],o).test(e)){var r="year"===t?n.toString().substr(4-RegExp.$1.length):1===RegExp.$1.length?n:i(n);e=e.replace(RegExp.$1,r)}return e}function i(t){return("00"+t).substr((""+t).length)}function n(t,i){var n={year:{value:t.getFullYear(),regExpAttributes:"i"},month:{value:t.getMonth()+1},date:{value:t.getDate(),regExpAttributes:"i"},hour:{value:t.getHours(),regExpAttributes:"i"},minute:{value:t.getMinutes()},second:{value:t.getSeconds()},quarter:{value:Math.floor((t.getMonth()+3)/3),regExpAttributes:"i"},millisecond:{value:t.getMilliseconds()}};for(var o in n)i=e(o,i,n[o].value,n[o].regExpAttributes);return i}function o(t){var e=t.getFullYear(),i=t.getMonth()+1,n=t.getDate();return+new Date(e+"/"+i+"/"+n+" 00:00:00")}function s(t,e){return Math.floor((o(t)-o(e))/l)}function r(){return window.performance&&window.performance.now?window.performance.now()+window.performance.timing.navigationStart:+new Date}function a(t,e){var i=30;return[1,3,5,7,8,10,12].indexOf(t)>-1?i=31:2===t&&(i=e&&e%400&&(e%4||!(e%100))?28:29),i}Object.defineProperty(t,"__esModule",{value:!0});var l=864e5;t.DAY_TIMESTAMP=l,t.HOUR_TIMESTAMP=36e5,t.MINUTE_TIMESTAMP=6e4,t.pad=i,t.formatType=e,t.formatDate=n,t.getZeroStamp=o,t.getDayDiff=s,t.getNow=r,t.computeNatureMaxDay=a})},function(t,e,i){function n(t){i(149)}var o=i(0)(i(150),i(151),n,null,null);t.exports=o.exports},function(t,e,i){var n,o,s;!function(i,r){o=[e],n=r,void 0!==(s="function"==typeof n?n.apply(e,o):n)&&(t.exports=s)}(0,function(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=t.inBrowser="undefined"!=typeof window,i=t.ua=e&&navigator.userAgent.toLowerCase();t.isAndroid=i&&i.indexOf("android")>0})},function(t,e,i){function n(t){i(208)}var o=i(0)(i(209),i(213),n,null,null);t.exports=o.exports},function(t,e,i){"use strict";function n(){return window.performance&&window.performance.now?window.performance.now()+window.performance.timing.navigationStart:+new Date}function o(t){for(var e=arguments.length,i=Array(e>1?e-1:0),n=1;n1&&void 0!==arguments[1]?arguments[1]:"click",n=void 0;"mouseup"===t.type||"mousecancel"===t.type?n=t:"touchend"!==t.type&&"touchcancel"!==t.type||(n=t.changedTouches[0]);var s={};n&&(s.screenX=n.screenX||0,s.screenY=n.screenY||0,s.clientX=n.clientX||0,s.clientY=n.clientY||0);var r=void 0,a=!0,l=!0;if("undefined"!=typeof MouseEvent)try{r=new MouseEvent(i,o({bubbles:a,cancelable:l},s))}catch(t){e()}else e();r.forwardedTouchEvent=!0,r._constructed=!0,t.target.dispatchEvent(r)}function m(t){v(t,"dblclick")}function y(t,e){e.firstChild?b(t,e.firstChild):e.appendChild(t)}function b(t,e){e.parentNode.insertBefore(t,e)}function g(t,e){t.removeChild(e)}function _(t,e,i,n,o,s,r){var a=t-e,l=Math.abs(a)/i,u=r.deceleration,c=r.itemHeight,d=r.swipeBounceTime,f=r.wheel,h=r.swipeTime,p=h,v=f?4:15,m=t+l/u*(a<0?-1:1);return f&&c&&(m=Math.round(m/c)*c),mo&&(m=s?Math.min(o+s/4,o+s/v*l):o,p=d),{destination:Math.round(m),duration:p}}function x(){}function w(t){console.error("[BScroll warn]: "+t)}function S(t,e){if(!t)throw new Error("[BScroll] "+e)}function T(t){var e=document.createElement("div"),i=document.createElement("div");return e.style.cssText="position:absolute;z-index:9999;pointerEvents:none",i.style.cssText="box-sizing:border-box;position:absolute;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);border-radius:3px;",i.className="bscroll-indicator","horizontal"===t?(e.style.cssText+=";height:7px;left:2px;right:2px;bottom:0",i.style.height="100%",e.className="bscroll-horizontal-scrollbar"):(e.style.cssText+=";width:7px;bottom:2px;top:2px;right:1px",i.style.width="100%",e.className="bscroll-vertical-scrollbar"),e.style.cssText+=";overflow:hidden",e.appendChild(i),e}function k(t,e){this.wrapper=e.el,this.wrapperStyle=this.wrapper.style,this.indicator=this.wrapper.children[0],this.indicatorStyle=this.indicator.style,this.scroller=t,this.direction=e.direction,e.fade?(this.visible=0,this.wrapperStyle.opacity="0"):this.visible=1,this.sizeRatioX=1,this.sizeRatioY=1,this.maxPosX=0,this.maxPosY=0,this.x=0,this.y=0,e.interactive&&this._addDOMEvents()}function M(t){if(t&&t.classList)return t.classList.contains("tombstone")}function P(t,e){var i=this;this.options=e,S("function"==typeof this.options.createTombstone,"Infinite scroll need createTombstone Function to create tombstone"),S("function"==typeof this.options.fetch,"Infinite scroll need fetch Function to fetch new data."),S("function"==typeof this.options.render,"Infinite scroll need render Function to render each item."),this.firstAttachedItem=0,this.lastAttachedItem=0,this.anchorScrollTop=0,this.anchorItem={index:0,offset:0},this.tombstoneHeight=0,this.tombstoneWidth=0,this.tombstones=[],this.items=[],this.loadedItems=0,this.requestInProgress=!1,this.hasMore=!0,this.scroller=t,this.wrapperEl=this.scroller.wrapper,this.scrollerEl=this.scroller.scroller,this.scroller.on("scroll",function(){i.onScroll()}),this.scroller.on("resize",function(){i.onResize()}),this.onResize()}function C(t,e){this.wrapper="string"==typeof t?document.querySelector(t):t,this.wrapper||w("Can not resolve the wrapper DOM."),this.scroller=this.wrapper.children[0],this.scroller||w("The wrapper need at least one child element to be scroller."),this.scrollerStyle=this.scroller.style,this._init(t,e)}Object.defineProperty(e,"__esModule",{value:!0});/*! - * better-normal-scroll v1.12.6 - * (c) 2016-2018 ustbhuangyi - * Released under the MIT License. - */ -var O=function(){function t(t,e){var i=[],n=!0,o=!1,s=void 0;try{for(var r,a=t[Symbol.iterator]();!(n=(r=a.next()).done)&&(i.push(r.value),!e||i.length!==e);n=!0);}catch(t){o=!0,s=t}finally{try{!n&&a.return&&a.return()}finally{if(o)throw s}}return i}return function(e,i){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),$=function(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e0,A=E&&document.createElement("div").style,j=function(){if(!E)return!1;var t={webkit:"webkitTransform",Moz:"MozTransform",O:"OTransform",ms:"msTransform",standard:"transform"};for(var e in t)if(void 0!==A[t[e]])return e;return!1}(),R=a("transform"),H=E&&a("perspective")in A,Y=E&&("ontouchstart"in window||I),N=!1!==R,X=E&&a("transition")in A,F={transform:R,transitionTimingFunction:a("transitionTimingFunction"),transitionDuration:a("transitionDuration"),transitionDelay:a("transitionDelay"),transformOrigin:a("transformOrigin"),transitionEnd:a("transitionEnd")},B=1,L={touchstart:B,touchmove:B,touchend:B,mousedown:2,mousemove:2,mouseup:2},z={startX:0,startY:0,scrollX:!1,scrollY:!0,freeScroll:!1,directionLockThreshold:5,eventPassthrough:"",click:!1,tap:!1,bounce:!0,bounceTime:800,momentum:!0,momentumLimitTime:300,momentumLimitDistance:15,swipeTime:2500,swipeBounceTime:500,deceleration:.0015,flickLimitTime:200,flickLimitDistance:100,resizePolling:60,probeType:0,preventDefault:!0,preventDefaultException:{tagName:/^(INPUT|TEXTAREA|BUTTON|SELECT)$/},HWCompositing:!0,useTransition:!0,useTransform:!0,bindToWrapper:!1,disableMouse:Y,disableTouch:!Y,observeDOM:!0,autoBlur:!0,wheel:!1,snap:!1,scrollbar:!1,pullDownRefresh:!1,pullUpLoad:!1,mouseWheel:!1,stopPropagation:!1,zoom:!1,infinity:!1,dblclick:!1},U={swipe:{style:"cubic-bezier(0.23, 1, 0.32, 1)",fn:function(t){return 1+--t*t*t*t*t}},swipeBounce:{style:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",fn:function(t){return t*(2-t)}},bounce:{style:"cubic-bezier(0.165, 0.84, 0.44, 1)",fn:function(t){return 1- --t*t*t*t}}},W=function(){return E?window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||function(t){return window.setTimeout(t,(t.interval||100/60)/2)}:x}(),q=function(){return E?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||function(t){window.clearTimeout(t)}:x}(),G=1,K=-1,Z=1,J=-1,Q=1,tt=3;k.prototype.handleEvent=function(t){switch(t.type){case"touchstart":case"mousedown":this._start(t);break;case"touchmove":case"mousemove":this._move(t);break;case"touchend":case"mouseup":case"touchcancel":case"mousecancel":this._end(t)}},k.prototype.refresh=function(){this._shouldShow()&&(this.transitionTime(),this._calculate(),this.updatePosition())},k.prototype.fade=function(t,e){var i=this;if(!e||this.visible){var n=t?250:500;t=t?"1":"0",this.wrapperStyle[F.transitionDuration]=n+"ms",clearTimeout(this.fadeTimeout),this.fadeTimeout=setTimeout(function(){i.wrapperStyle.opacity=t,i.visible=+t},0)}},k.prototype.updatePosition=function(){if("vertical"===this.direction){var t=Math.round(this.sizeRatioY*this.scroller.y);if(t<0){this.transitionTime(500);var e=Math.max(this.indicatorHeight+3*t,8);this.indicatorStyle.height=e+"px",t=0}else if(t>this.maxPosY){this.transitionTime(500);var i=Math.max(this.indicatorHeight-3*(t-this.maxPosY),8);this.indicatorStyle.height=i+"px",t=this.maxPosY+this.indicatorHeight-i}else this.indicatorStyle.height=this.indicatorHeight+"px";this.y=t,this.scroller.options.useTransform?this.indicatorStyle[F.transform]="translateY("+t+"px)"+this.scroller.translateZ:this.indicatorStyle.top=t+"px"}else{var n=Math.round(this.sizeRatioX*this.scroller.x);if(n<0){this.transitionTime(500);var o=Math.max(this.indicatorWidth+3*n,8);this.indicatorStyle.width=o+"px",n=0}else if(n>this.maxPosX){this.transitionTime(500);var s=Math.max(this.indicatorWidth-3*(n-this.maxPosX),8);this.indicatorStyle.width=s+"px",n=this.maxPosX+this.indicatorWidth-s}else this.indicatorStyle.width=this.indicatorWidth+"px";this.x=n,this.scroller.options.useTransform?this.indicatorStyle[F.transform]="translateX("+n+"px)"+this.scroller.translateZ:this.indicatorStyle.left=n+"px"}},k.prototype.transitionTime=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.indicatorStyle[F.transitionDuration]=t+"ms"},k.prototype.transitionTimingFunction=function(t){this.indicatorStyle[F.transitionTimingFunction]=t},k.prototype.destroy=function(){this._removeDOMEvents(),this.wrapper.parentNode.removeChild(this.wrapper)},k.prototype._start=function(t){var e=t.touches?t.touches[0]:t;t.preventDefault(),t.stopPropagation(),this.transitionTime(),this.initiated=!0,this.moved=!1,this.lastPointX=e.pageX,this.lastPointY=e.pageY,this.startTime=n(),this._handleMoveEvents(l),this.scroller.trigger("beforeScrollStart")},k.prototype._move=function(t){var e=t.touches?t.touches[0]:t;t.preventDefault(),t.stopPropagation(),this.moved||this.scroller.trigger("scrollStart"),this.moved=!0;var i=e.pageX-this.lastPointX;this.lastPointX=e.pageX;var n=e.pageY-this.lastPointY;this.lastPointY=e.pageY;var o=this.x+i,s=this.y+n;this._pos(o,s)},k.prototype._end=function(t){if(this.initiated){this.initiated=!1,t.preventDefault(),t.stopPropagation(),this._handleMoveEvents(u);var e=this.scroller.options.snap;if(e){var i=e.speed,n=e.easing,o=void 0===n?U.bounce:n,s=this.scroller._nearestSnap(this.scroller.x,this.scroller.y),r=i||Math.max(Math.max(Math.min(Math.abs(this.scroller.x-s.x),1e3),Math.min(Math.abs(this.scroller.y-s.y),1e3)),300);this.scroller.x===s.x&&this.scroller.y===s.y||(this.scroller.directionX=0,this.scroller.directionY=0,this.scroller.currentPage=s,this.scroller.scrollTo(s.x,s.y,r,o))}this.moved&&this.scroller.trigger("scrollEnd",{x:this.scroller.x,y:this.scroller.y})}},k.prototype._pos=function(t,e){t<0?t=0:t>this.maxPosX&&(t=this.maxPosX),e<0?e=0:e>this.maxPosY&&(e=this.maxPosY),t=Math.round(t/this.sizeRatioX),e=Math.round(e/this.sizeRatioY),this.scroller.scrollTo(t,e),this.scroller.trigger("scroll",{x:this.scroller.x,y:this.scroller.y})},k.prototype._shouldShow=function(){return"vertical"===this.direction&&this.scroller.hasVerticalScroll||"horizontal"===this.direction&&this.scroller.hasHorizontalScroll?(this.wrapper.style.display="",!0):(this.wrapper.style.display="none",!1)},k.prototype._calculate=function(){if("vertical"===this.direction){var t=this.wrapper.clientHeight;this.indicatorHeight=Math.max(Math.round(t*t/(this.scroller.scrollerHeight||t||1)),8),this.indicatorStyle.height=this.indicatorHeight+"px",this.maxPosY=t-this.indicatorHeight,this.sizeRatioY=this.maxPosY/this.scroller.maxScrollY}else{var e=this.wrapper.clientWidth;this.indicatorWidth=Math.max(Math.round(e*e/(this.scroller.scrollerWidth||e||1)),8),this.indicatorStyle.width=this.indicatorWidth+"px",this.maxPosX=e-this.indicatorWidth,this.sizeRatioX=this.maxPosX/this.scroller.maxScrollX}},k.prototype._addDOMEvents=function(){var t=l;this._handleDOMEvents(t)},k.prototype._removeDOMEvents=function(){var t=u;this._handleDOMEvents(t),this._handleMoveEvents(t)},k.prototype._handleMoveEvents=function(t){this.scroller.options.disableTouch||t(window,"touchmove",this),this.scroller.options.disableMouse||t(window,"mousemove",this)},k.prototype._handleDOMEvents=function(t){this.scroller.options.disableTouch||(t(this.indicator,"touchstart",this),t(window,"touchend",this)),this.scroller.options.disableMouse||(t(this.indicator,"mousedown",this),t(window,"mouseup",this))};var et=2e3;P.prototype.onScroll=function(){var t=-this.scroller.y,e=t-this.anchorScrollTop;this.anchorItem=0===t?{index:0,offset:0}:this._calculateAnchoredItem(this.anchorItem,e),this.anchorScrollTop=t;var i=this._calculateAnchoredItem(this.anchorItem,this.wrapperEl.offsetHeight),n=this.anchorItem.index,o=i.index;e<0?(n-=30,o+=10):(n-=10,o+=30),this.fill(n,o),this.maybeRequestContent()},P.prototype.onResize=function(){var t=this.options.createTombstone();t.style.position="absolute",this.scrollerEl.appendChild(t),t.style.display="",this.tombstoneHeight=t.offsetHeight,this.tombstoneWidth=t.offsetWidth,this.scrollerEl.removeChild(t);for(var e=0;ethis.firstAttachedItem;)e-=this.items[i-1].height||this.tombstoneHeight,i--;return e},P.prototype._setupAnimations=function(t,e){var i=this;for(var n in t){var o=t[n];this.items[n].node.style.transform="translateY("+(this.anchorScrollTop+o[1])+"px) scale("+this.tombstoneWidth/this.items[n].width+", "+this.tombstoneHeight/this.items[n].height+")",this.items[n].node.offsetTop,o[0].offsetTop,this.items[n].node.style.transition="transform 200ms"}for(var s=this.firstAttachedItem;s0&&this.items[i-1].height;)e+=this.items[i-1].height,i--;n=Math.max(-i,Math.ceil(Math.min(e,0)/this.tombstoneHeight))}else{for(;e>0&&i=this.items.length||!this.items[i].height)&&(n=Math.floor(Math.max(e,0)/this.tombstoneHeight))}return i+=n,e-=n*this.tombstoneHeight,{index:i,offset:e}},function(t){t.prototype._init=function(t,e){this._handleOptions(e),this._events={},this.x=0,this.y=0,this.directionX=0,this.directionY=0,this.setScale(1),this._addDOMEvents(),this._initExtFeatures(),this._watchTransition(),this.options.observeDOM&&this._initDOMObserver(),this.options.autoBlur&&this._handleAutoBlur(),this.refresh(),this.options.snap||this.scrollTo(this.options.startX,this.options.startY),this.enable()},t.prototype.setScale=function(t){this.lastScale=s(this.scale)?t:this.scale,this.scale=t},t.prototype._handleOptions=function(t){this.options=o({},z,t),this.translateZ=this.options.HWCompositing&&H?" translateZ(0)":"",this.options.useTransition=this.options.useTransition&&X,this.options.useTransform=this.options.useTransform&&N,this.options.preventDefault=!this.options.eventPassthrough&&this.options.preventDefault,this.options.scrollX="horizontal"!==this.options.eventPassthrough&&this.options.scrollX,this.options.scrollY="vertical"!==this.options.eventPassthrough&&this.options.scrollY,this.options.freeScroll=this.options.freeScroll&&!this.options.eventPassthrough,this.options.directionLockThreshold=this.options.eventPassthrough?0:this.options.directionLockThreshold,!0===this.options.tap&&(this.options.tap="tap")},t.prototype._addDOMEvents=function(){var t=l;this._handleDOMEvents(t)},t.prototype._removeDOMEvents=function(){var t=u;this._handleDOMEvents(t)},t.prototype._handleDOMEvents=function(t){var e=this.options.bindToWrapper?this.wrapper:window;t(window,"orientationchange",this),t(window,"resize",this),this.options.click&&t(this.wrapper,"click",this,!0),this.options.disableMouse||(t(this.wrapper,"mousedown",this),t(e,"mousemove",this),t(e,"mousecancel",this),t(e,"mouseup",this)),Y&&!this.options.disableTouch&&(t(this.wrapper,"touchstart",this),t(e,"touchmove",this),t(e,"touchcancel",this),t(e,"touchend",this)),t(this.scroller,F.transitionEnd,this)},t.prototype._initExtFeatures=function(){this.options.snap&&this._initSnap(),this.options.scrollbar&&this._initScrollbar(),this.options.pullUpLoad&&this._initPullUp(),this.options.pullDownRefresh&&this._initPullDown(),this.options.wheel&&this._initWheel(),this.options.mouseWheel&&this._initMouseWheel(),this.options.zoom&&this._initZoom(),this.options.infinity&&this._initInfinite()},t.prototype._watchTransition=function(){if("function"==typeof Object.defineProperty){var t=this,e=!1,i=this.useTransition?"isInTransition":"isAnimating";Object.defineProperty(this,i,{get:function(){return e},set:function(i){e=i;for(var n=t.scroller.children.length?t.scroller.children:[t.scroller],o=e&&!t.pulling?"none":"auto",s=0;sthis.minScrollX||this.xthis.minScrollY||this.y1&&this._zoomStart(t);break;case"touchmove":case"mousemove":this.options.zoom&&t.touches&&t.touches.length>1?this._zoom(t):this._move(t);break;case"touchend":case"mouseup":case"touchcancel":case"mousecancel":this.scaled?this._zoomEnd(t):this._end(t);break;case"orientationchange":case"resize":this._resize();break;case"transitionend":case"webkitTransitionEnd":case"oTransitionEnd":case"MSTransitionEnd":this._transitionEnd(t);break;case"click":this.enabled&&!t._constructed&&(h(t.target,this.options.preventDefaultException)||(t.preventDefault(),t.stopPropagation()));break;case"wheel":case"DOMMouseScroll":case"mousewheel":this._onMouseWheel(t)}},t.prototype.refresh=function(){var t="static"===window.getComputedStyle(this.wrapper,null).position,e=f(this.wrapper);this.wrapperWidth=e.width,this.wrapperHeight=e.height;var i=f(this.scroller);this.scrollerWidth=Math.round(i.width*this.scale),this.scrollerHeight=Math.round(i.height*this.scale),this.relativeX=i.left,this.relativeY=i.top,t&&(this.relativeX-=e.left,this.relativeY-=e.top),this.minScrollX=0,this.minScrollY=0;var n=this.options.wheel;n?(this.items=this.scroller.children,this.options.itemHeight=this.itemHeight=this.items.length?this.scrollerHeight/this.items.length:0,void 0===this.selectedIndex&&(this.selectedIndex=n.selectedIndex||0),this.options.startY=-this.selectedIndex*this.itemHeight,this.maxScrollX=0,this.maxScrollY=-this.itemHeight*(this.items.length-1)):(this.maxScrollX=this.wrapperWidth-this.scrollerWidth,this.options.infinity||(this.maxScrollY=this.wrapperHeight-this.scrollerHeight),this.maxScrollX<0?(this.maxScrollX-=this.relativeX,this.minScrollX=-this.relativeX):this.scale>1&&(this.maxScrollX=this.maxScrollX/2-this.relativeX,this.minScrollX=this.maxScrollX),this.maxScrollY<0?(this.maxScrollY-=this.relativeY,this.minScrollY=-this.relativeY):this.scale>1&&(this.maxScrollY=this.maxScrollY/2-this.relativeY,this.minScrollY=this.maxScrollY)),this.hasHorizontalScroll=this.options.scrollX&&this.maxScrollXthis.options.momentumLimitTime&&rr+this.options.directionLockThreshold?this.directionLocked="h":r>=s+this.options.directionLockThreshold?this.directionLocked="v":this.directionLocked="n"),"h"===this.directionLocked){if("vertical"===this.options.eventPassthrough)t.preventDefault();else if("horizontal"===this.options.eventPassthrough)return void(this.initiated=!1);o=0}else if("v"===this.directionLocked){if("horizontal"===this.options.eventPassthrough)t.preventDefault();else if("vertical"===this.options.eventPassthrough)return void(this.initiated=!1);i=0}i=this.hasHorizontalScroll?i:0,o=this.hasVerticalScroll?o:0,this.movingDirectionX=i>0?J:i<0?Z:0,this.movingDirectionY=o>0?K:o<0?G:0;var l=this.x+i,u=this.y+o,c=!1,d=!1,f=!1,h=!1,p=this.options.bounce;!1!==p&&(c=void 0===p.top||p.top,d=void 0===p.bottom||p.bottom,f=void 0===p.left||p.left,h=void 0===p.right||p.right),(l>this.minScrollX||lthis.minScrollX&&f||lthis.minScrollX?this.minScrollX:this.maxScrollX),(u>this.minScrollY||uthis.minScrollY&&c||uthis.minScrollY?this.minScrollY:this.maxScrollY),this.moved||(this.moved=!0,this.trigger("scrollStart")),this._translate(l,u),a-this.startTime>this.options.momentumLimitTime&&(this.startTime=a,this.startX=this.x,this.startY=this.y,this.options.probeType===Q&&this.trigger("scroll",{x:this.x,y:this.y})),this.options.probeType>Q&&this.trigger("scroll",{x:this.x,y:this.y});var v=document.documentElement.scrollLeft||window.pageXOffset||document.body.scrollLeft,m=document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop,y=this.pointX-v,b=this.pointY-m;(y>document.documentElement.clientWidth-this.options.momentumLimitDistance||ydocument.documentElement.clientHeight-this.options.momentumLimitDistance)&&this._end(t)}}},t.prototype._end=function(t){if(this.enabled&&!this.destroyed&&L[t.type]===this.initiated){this.initiated=!1,this.options.preventDefault&&!h(t.target,this.options.preventDefaultException)&&t.preventDefault(),this.options.stopPropagation&&t.stopPropagation(),this.trigger("touchEnd",{x:this.x,y:this.y}),this.isInTransition=!1;var e=Math.round(this.x),i=Math.round(this.y),o=e-this.absStartX,s=i-this.absStartY;if(this.directionX=o>0?J:o<0?Z:0,this.directionY=s>0?K:s<0?G:0,!this.options.pullDownRefresh||!this._checkPullDown()){if(this._checkClick(t))return void this.trigger("scrollCancel");if(!this.resetPosition(this.options.bounceTime,U.bounce)){this._translate(e,i),this.endTime=n();var r=this.endTime-this.startTime,a=Math.abs(e-this.startX),l=Math.abs(i-this.startY);if(this._events.flick&&rthis.options.momentumLimitDistance||a>this.options.momentumLimitDistance)){var c=!1,d=!1,f=!1,p=!1,v=this.options.bounce;!1!==v&&(c=void 0===v.top||v.top,d=void 0===v.bottom||v.bottom,f=void 0===v.left||v.left,p=void 0===v.right||v.right);var m=this.directionX===J&&f||this.directionX===Z&&p?this.wrapperWidth:0,y=this.directionY===K&&c||this.directionY===G&&d?this.wrapperHeight:0,b=this.hasHorizontalScroll?_(this.x,this.startX,r,this.maxScrollX,this.minScrollX,m,this.options):{destination:e,duration:0},g=this.hasVerticalScroll?_(this.y,this.startY,r,this.maxScrollY,this.minScrollY,y,this.options):{destination:i,duration:0};e=b.destination,i=g.destination,u=Math.max(b.duration,g.duration),this.isInTransition=!0}else this.options.wheel&&(i=Math.round(i/this.itemHeight)*this.itemHeight,u=this.options.wheel.adjustTime||400);var x=U.swipe;if(this.options.snap){var w=this._nearestSnap(e,i);this.currentPage=w,u=this.options.snapSpeed||Math.max(Math.max(Math.min(Math.abs(e-w.x),1e3),Math.min(Math.abs(i-w.y),1e3)),300),e=w.x,i=w.y,this.directionX=0,this.directionY=0,x=this.options.snap.easing||U.bounce}if(e!==this.x||i!==this.y)return(e>this.minScrollX||ethis.minScrollY||i0&&void 0!==arguments[0]?arguments[0]:0;if(this.scrollerStyle[F.transitionDuration]=t+"ms",this.options.wheel)for(var e=0;e=f)return r.isAnimating=!1,r._translate(t,e,c),r.trigger("scroll",{x:r.x,y:r.y}),void(r.pulling||r.resetPosition(r.options.bounceTime)||r.trigger("scrollEnd",{x:r.x,y:r.y}));h=(h-d)/i;var p=o(h),v=(t-a)*p+a,m=(e-l)*p+l,y=(c-u)*p+u;r._translate(v,m,y),r.isAnimating&&(r.animateTimer=W(s)),r.options.probeType===tt&&r.trigger("scroll",{x:r.x,y:r.y})}var r=this,a=this.x,l=this.y,u=this.lastScale,c=this.scale,d=n(),f=d+i;this.isAnimating=!0,q(this.animateTimer),s()},t.prototype.scrollBy=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:U.bounce;t=this.x+t,e=this.y+e,this.scrollTo(t,e,i,n)},t.prototype.scrollTo=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:U.bounce;this.isInTransition=this.options.useTransition&&i>0&&(t!==this.x||e!==this.y),!i||this.options.useTransition?(this._transitionTimingFunction(n.style),this._transitionTime(i),this._translate(t,e),i&&this.options.probeType===tt&&this._startProbe(),i||t===this.x&&e===this.y||(this.trigger("scroll",{x:t,y:e}),this._reflow=document.body.offsetHeight,this.resetPosition(this.options.bounceTime,U.bounce)||this.trigger("scrollEnd",{x:t,y:e})),this.options.wheel&&(e>this.minScrollY?this.selectedIndex=0:ethis.minScrollX?this.minScrollX:s.leftthis.minScrollY?this.minScrollY:s.top0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:U.bounce,i=this.x,n=Math.round(i);!this.hasHorizontalScroll||n>this.minScrollX?i=this.minScrollX:nthis.minScrollY?o=this.minScrollY:s2&&void 0!==arguments[2]?arguments[2]:this;this._events[t]||(this._events[t]=[]),this._events[t].push([e,i])},t.prototype.once=function(t,e){function i(){this.off(t,i),e.apply(n,arguments)}var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;i.fn=e,this.on(t,i)},t.prototype.off=function(t,e){var i=this._events[t];if(i)for(var n=i.length;n--;)(i[n][0]===e||i[n][0]&&i[n][0].fn===e)&&(i[n][0]=void 0)},t.prototype.trigger=function(t){var e=this._events[t];if(e)for(var i=e.length,n=[].concat($(e)),o=0;o1?(y(i[i.length-1].cloneNode(!0),this.scroller),this.scroller.appendChild(i[1].cloneNode(!0))):e.loop=!1}var n=e.el;"string"==typeof n&&(n=this.scroller.querySelectorAll(n)),this.on("refresh",function(){if(t.pages=[],t.wrapperWidth&&t.wrapperHeight&&t.scrollerWidth&&t.scrollerHeight){var i=e.stepX||t.wrapperWidth,o=e.stepY||t.wrapperHeight,s=0,r=void 0,a=void 0,l=void 0,u=0,c=void 0,d=0,h=void 0,p=void 0;if(n)for(c=n.length,h=-1;ut.maxScrollX&&d++;else for(a=Math.round(i/2),l=Math.round(o/2);s>-t.scrollerWidth;){for(t.pages[u]=[],c=0,r=0;r>-t.scrollerHeight;)t.pages[u][c]={x:Math.max(s,t.maxScrollX),y:Math.max(r,t.maxScrollY),width:i,height:o,cx:s-a,cy:r-l},r-=o,c++;s-=i,u++}t._checkSnapLoop();var v=e._loopX?1:0,m=e._loopY?1:0;t._goToPage(t.currentPage.pageX||v,t.currentPage.pageY||m,0);var y=e.threshold;y%1==0?(t.snapThresholdX=y,t.snapThresholdY=y):(t.snapThresholdX=Math.round(t.pages[t.currentPage.pageX][t.currentPage.pageY].width*y),t.snapThresholdY=Math.round(t.pages[t.currentPage.pageX][t.currentPage.pageY].height*y))}}),this.on("scrollEnd",function(){e.loop&&(e._loopX?(0===t.currentPage.pageX&&t._goToPage(t.pages.length-2,t.currentPage.pageY,0),t.currentPage.pageX===t.pages.length-1&&t._goToPage(1,t.currentPage.pageY,0)):(0===t.currentPage.pageY&&t._goToPage(t.currentPage.pageX,t.pages[0].length-2,0),t.currentPage.pageY===t.pages[0].length-1&&t._goToPage(t.currentPage.pageX,1,0)))}),!1!==e.listenFlick&&this.on("flick",function(){var i=e.speed||Math.max(Math.max(Math.min(Math.abs(t.x-t.startX),1e3),Math.min(Math.abs(t.y-t.startY),1e3)),300);t._goToPage(t.currentPage.pageX+t.directionX,t.currentPage.pageY+t.directionY,i)}),this.on("destroy",function(){if(e.loop){var i=t.scroller.children;i.length>2&&(g(t.scroller,i[i.length-1]),g(t.scroller,i[0]))}})},t.prototype._checkSnapLoop=function(){var t=this.options.snap;t.loop&&this.pages&&this.pages.length&&(this.pages.length>1&&(t._loopX=!0),this.pages[0]&&this.pages[0].length>1&&(t._loopY=!0),t._loopX&&t._loopY&&w("Loop does not support two direction at the same time."))},t.prototype._nearestSnap=function(t,e){if(!this.pages.length)return{x:0,y:0,pageX:0,pageY:0};var i=0;if(Math.abs(t-this.absStartX)<=this.snapThresholdX&&Math.abs(e-this.absStartY)<=this.snapThresholdY)return this.currentPage;t>this.minScrollX?t=this.minScrollX:tthis.minScrollY?e=this.minScrollY:e=this.pages[i][0].cx){t=this.pages[i][0].x;break}n=this.pages[i].length;for(var o=0;o=this.pages[0][o].cy){e=this.pages[0][o].y;break}return i===this.currentPage.pageX&&(i+=this.directionX,i<0?i=0:i>=this.pages.length&&(i=this.pages.length-1),t=this.pages[i][0].x),o===this.currentPage.pageY&&(o+=this.directionY,o<0?o=0:o>=this.pages[0].length&&(o=this.pages[0].length-1),e=this.pages[0][o].y),{x:t,y:e,pageX:i,pageY:o}},t.prototype._goToPage=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments[2],n=arguments[3],o=this.options.snap;if(o&&this.pages&&this.pages.length&&(n=n||o.easing||U.bounce,t>=this.pages.length?t=this.pages.length-1:t<0&&(t=0),this.pages[t])){e>=this.pages[t].length?e=this.pages[t].length-1:e<0&&(e=0);var s=this.pages[t][e].x,r=this.pages[t][e].y;i=void 0===i?o.speed||Math.max(Math.max(Math.min(Math.abs(s-this.x),1e3),Math.min(Math.abs(r-this.y),1e3)),300):i,this.currentPage={x:s,y:r,pageX:t,pageY:e},this.scrollTo(s,r,i,n)}},t.prototype.goToPage=function(t,e,i,n){var o=this.options.snap;if(o&&this.pages&&this.pages.length){if(o.loop){var s=void 0;o._loopX?(s=this.pages.length-2,t>=s?t=s-1:t<0&&(t=0),t+=1):(s=this.pages[0].length-2,e>=s?e=s-1:e<0&&(e=0),e+=1)}this._goToPage(t,e,i,n)}},t.prototype.next=function(t,e){if(this.options.snap){var i=this.currentPage.pageX,n=this.currentPage.pageY;i++,i>=this.pages.length&&this.hasVerticalScroll&&(i=0,n++),this._goToPage(i,n,t,e)}},t.prototype.prev=function(t,e){if(this.options.snap){var i=this.currentPage.pageX,n=this.currentPage.pageY;i--,i<0&&this.hasVerticalScroll&&(i=0,n--),this._goToPage(i,n,t,e)}},t.prototype.getCurrentPage=function(){var t=this.options.snap;return t?t.loop?t._loopX?o({},this.currentPage,{pageX:this.currentPage.pageX-1}):o({},this.currentPage,{pageY:this.currentPage.pageY-1}):this.currentPage:null}}(C),function(t){t.prototype.wheelTo=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.options.wheel&&(this.y=-t*this.itemHeight,this.scrollTo(0,this.y))},t.prototype.getSelectedIndex=function(){return this.options.wheel&&this.selectedIndex},t.prototype._initWheel=function(){var t=this.options.wheel;t.wheelWrapperClass||(t.wheelWrapperClass="wheel-scroll"),t.wheelItemClass||(t.wheelItemClass="wheel-item"),void 0===t.selectedIndex&&(t.selectedIndex=0,w("wheel option selectedIndex is required!"))}}(C),function(t){t.prototype._initScrollbar=function(){var t=this,e=this.options.scrollbar,i=e.fade,n=void 0===i||i,o=e.interactive,s=void 0!==o&&o;this.indicators=[];var r=void 0;this.options.scrollX&&(r={el:T("horizontal"),direction:"horizontal",fade:n,interactive:s},this._insertScrollBar(r.el),this.indicators.push(new k(this,r))),this.options.scrollY&&(r={el:T("vertical"),direction:"vertical",fade:n,interactive:s},this._insertScrollBar(r.el),this.indicators.push(new k(this,r))),this.on("refresh",function(){for(var e=0;e0&&void 0!==arguments[0])||arguments[0];this.options.pullDownRefresh=t,this._initPullDown()},t.prototype.closePullDown=function(){this.options.pullDownRefresh=!1}}(C),function(t){t.prototype._initPullUp=function(){this.options.probeType=tt,this.pullupWatching=!1,this._watchPullUp()},t.prototype._watchPullUp=function(){this.pullupWatching||(this.pullupWatching=!0,this.on("scroll",this._checkToEnd))},t.prototype._checkToEnd=function(t){var e=this,i=this.options.pullUpLoad.threshold,n=void 0===i?0:i;this.movingDirectionY===G&&t.y<=this.maxScrollY+n&&(this.once("scrollEnd",function(){e.pullupWatching=!1}),this.trigger("pullingUp"),this.off("scroll",this._checkToEnd))},t.prototype.finishPullUp=function(){var t=this;this.pullupWatching?this.once("scrollEnd",function(){t._watchPullUp()}):this._watchPullUp()},t.prototype.openPullUp=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.options.pullUpLoad=t,this._initPullUp()},t.prototype.closePullUp=function(){this.options.pullUpLoad=!1,this.pullupWatching&&(this.pullupWatching=!1,this.off("scroll",this._checkToEnd))}}(C),function(t){t.prototype._initMouseWheel=function(){var t=this;this._handleMouseWheelEvent(l),this.on("destroy",function(){clearTimeout(t.mouseWheelTimer),clearTimeout(t.mouseWheelEndTimer),t._handleMouseWheelEvent(u)}),this.firstWheelOpreation=!0},t.prototype._handleMouseWheelEvent=function(t){t(this.wrapper,"wheel",this),t(this.wrapper,"mousewheel",this),t(this.wrapper,"DOMMouseScroll",this)},t.prototype._onMouseWheel=function(t){var e=this;if(this.enabled){t.preventDefault(),this.options.stopPropagation&&t.stopPropagation(),this.firstWheelOpreation&&this.trigger("scrollStart"),this.firstWheelOpreation=!1;var i=this.options.mouseWheel,n=i.speed,o=void 0===n?20:n,s=i.invert,r=void 0!==s&&s,a=i.easeTime,l=void 0===a?300:a;clearTimeout(this.mouseWheelTimer),this.mouseWheelTimer=setTimeout(function(){e.options.snap||l||e.trigger("scrollEnd",{x:e.x,y:e.y}),e.firstWheelOpreation=!0},400);var u=void 0,c=void 0;switch(!0){case"deltaX"in t:1===t.deltaMode?(u=-t.deltaX*o,c=-t.deltaY*o):(u=-t.deltaX,c=-t.deltaY);break;case"wheelDeltaX"in t:u=t.wheelDeltaX/120*o,c=t.wheelDeltaY/120*o;break;case"wheelDelta"in t:u=c=t.wheelDelta/120*o;break;case"detail"in t:u=c=-t.detail/3*o;break;default:return}var d=r?-1:1;u*=d,c*=d,this.hasVerticalScroll||(u=c,c=0);var f=void 0,h=void 0;if(this.options.snap)return f=this.currentPage.pageX,h=this.currentPage.pageY,u>0?f--:u<0&&f++,c>0?h--:c<0&&h++,void this._goToPage(f,h);f=this.x+Math.round(this.hasHorizontalScroll?u:0),h=this.y+Math.round(this.hasVerticalScroll?c:0),this.movingDirectionX=this.directionX=u>0?-1:u<0?1:0,this.movingDirectionY=this.directionY=c>0?-1:c<0?1:0,f>this.minScrollX?f=this.minScrollX:fthis.minScrollY?h=this.minScrollY:hthis.minScrollX?s=this.minScrollX:sthis.minScrollY?r=this.minScrollY:rf&&(a=2*f*Math.pow(.5,f/a));var h=a/this.startScale,p=this.startX-(this.originX-this.relativeX)*(h-1),v=this.startY-(this.originY-this.relativeY)*(h-1);this.setScale(a),this.scrollTo(p,v,0)}},t.prototype._zoomEnd=function(t){if(this.enabled&&!this.destroyed&&L[t.type]===this.initiated){this.options.preventDefault&&t.preventDefault(),this.options.stopPropagation&&t.stopPropagation(),this.isInTransition=!1,this.isAnimating=!1,this.initiated=0;var e=this.options.zoom,i=e.min,n=void 0===i?1:i,o=e.max,s=void 0===o?4:o,r=this.scale>s?s:this.scale0?n:i)(t)}},function(t,e,i){var n=i(52)("keys"),o=i(39);t.exports=function(t){return n[t]||(n[t]=o(t))}},function(t,e,i){var n=i(2),o=i(12),s=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(t.exports=function(t,e){return s[t]||(s[t]=void 0!==e?e:{})})("versions",[]).push({version:n.version,mode:i(38)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,i){var n=i(13).f,o=i(16),s=i(6)("toStringTag");t.exports=function(t,e,i){t&&!o(t=i?t:t.prototype,s)&&n(t,s,{configurable:!0,value:e})}},function(t,e,i){i(134);for(var n=i(12),o=i(21),s=i(25),r=i(6)("toStringTag"),a="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),l=0;l0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,r=o&&o.base64||"";return{name:t,size:e,url:r?"":s(o),base64:r,status:i,progress:n,file:o}}function s(t){return t&&a?a.createObjectURL(t):""}function r(t){if("function"==typeof t){for(var e=arguments.length,i=Array(e>1?e-1:0),n=1;nl;)n(a,i=e[l++])&&(~s(u,i)||u.push(i));return u}},function(t,e,i){var n=i(49);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==n(t)?t.split(""):Object(t)}},function(t,e,i){var n=i(50),o=Math.min;t.exports=function(t){return t>0?o(n(t),9007199254740991):0}},function(t,e,i){"use strict";var n=i(38),o=i(14),s=i(78),r=i(21),a=i(25),l=i(130),u=i(54),c=i(133),d=i(6)("iterator"),f=!([].keys&&"next"in[].keys()),h=function(){return this};t.exports=function(t,e,i,p,v,m,y){l(i,e,p);var b,g,_,x=function(t){if(!f&&t in k)return k[t];switch(t){case"keys":case"values":return function(){return new i(this,t)}}return function(){return new i(this,t)}},w=e+" Iterator",S="values"==v,T=!1,k=t.prototype,M=k[d]||k["@@iterator"]||v&&k[v],P=M||x(v),C=v?S?x("entries"):P:void 0,O="Array"==e?k.entries||M:M;if(O&&(_=c(O.call(new t)))!==Object.prototype&&_.next&&(u(_,w,!0),n||"function"==typeof _[d]||r(_,d,h)),S&&M&&"values"!==M.name&&(T=!0,P=function(){return M.call(this)}),n&&!y||!f&&!T&&k[d]||r(k,d,P),a[e]=P,a[w]=h,v)if(b={values:S?P:x("values"),keys:m?P:x("keys"),entries:C},y)for(g in b)g in k||s(k,g,b[g]);else o(o.P+o.F*(f||T),e,b);return b}},function(t,e,i){t.exports=i(21)},function(t,e,i){var n=i(22),o=i(131),s=i(53),r=i(51)("IE_PROTO"),a=function(){},l=function(){var t,e=i(73)("iframe"),n=s.length;for(e.style.display="none",i(132).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(" - - - - - - - - - - -

      jQuery miniColors v0.1

      -

      - A miniature color selector for input elements. -

      - -
      - -

      - Default
      -

      - -

      - Black theme (set class="black" on the input element)
      - -

      - -

      - Preset value (set value attribute on the input element)
      - -

      - -

      - Attached to a hidden input
      - -

      - - - -

      - Select an action to apply to all of the controls on this page: -
      - -
      - -
      - -
      - -

      - - - - diff --git a/src/main/resources/static/js/jquery.miniColors-0.1/jquery.miniColors.css b/src/main/resources/static/js/jquery.miniColors-0.1/jquery.miniColors.css deleted file mode 100644 index 0ba1976..0000000 --- a/src/main/resources/static/js/jquery.miniColors-0.1/jquery.miniColors.css +++ /dev/null @@ -1,65 +0,0 @@ -.miniColors-trigger { - height: 22px; - width: 22px; - background: url(images/trigger.png) center no-repeat; - vertical-align: middle; - margin: 0 .25em; - display: inline-block; - outline: none; -} - -.miniColors-selector { - position: absolute; - width: 175px; - height: 150px; - background: #FFF; - border: solid 1px #BBB; - -moz-box-shadow: 0 0 6px rgba(0, 0, 0, .25); - -webkit-box-shadow: 0 0 6px rgba(0, 0, 0, .25); - box-shadow: 0 0 6px rgba(0, 0, 0, .25); - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - padding: 5px; - z-index: 999999; -} - -.miniColors-selector.black { - background: #000; - border-color: #000; -} - -.miniColors-colors { - position: absolute; - top: 5px; - left: 5px; - width: 150px; - height: 150px; - background: url(images/gradient.png) center no-repeat; - cursor: crosshair; -} - -.miniColors-hues { - position: absolute; - top: 5px; - left: 160px; - width: 20px; - height: 150px; - background: url(images/rainbow.png) center no-repeat; - cursor: crosshair; -} - -.miniColors-colorPicker { - position: absolute; - width: 11px; - height: 11px; - background: url(images/circle.gif) center no-repeat; -} - -.miniColors-huePicker { - position: absolute; - left: -3px; - width: 26px; - height: 3px; - background: url(images/line.gif) center no-repeat; -} \ No newline at end of file diff --git a/src/main/resources/static/js/jquery.miniColors-0.1/jquery.miniColors.js b/src/main/resources/static/js/jquery.miniColors-0.1/jquery.miniColors.js deleted file mode 100644 index 2b4fbbf..0000000 --- a/src/main/resources/static/js/jquery.miniColors-0.1/jquery.miniColors.js +++ /dev/null @@ -1,647 +0,0 @@ -/* - * jQuery miniColors: A small color selector - * - * Copyright 2011 Cory LaViska for A Beautiful Site, LLC. (http://abeautifulsite.net/) - * - * Dual licensed under the MIT or GPL Version 2 licenses - * - * - * Usage: - * - * 1. Link to jQuery: - * - * 2. Link to miniColors: - * - * 3. Include miniColors stylesheet: - * - * 4. Apply $([selector]).miniColors() to one or more INPUT elements - * - * - * Options: - * - * disabled [true|false] - * readonly [true|false] - * - * - * Specify options on creation: - * - * $([selector]).miniColors({ - * - * optionName: value, - * optionName: value, - * ... - * - * }); - * - * - * Methods: - * - * Call a method using: $([selector]).miniColors('methodName', [value]); - * - * disabled [true|false] - * readonly [true|false] - * value [hex value] - * destroy - * - * - * Events: - * - * Attach events on creation: - * - * $([selector]).miniColors({ - * - * change: function(hex, rgb) { ... } - * - * }); - * - * change(hex, rgb) called when the color value changes; 'this' will refer to the original input element; - * hex is the string hex value of the selected color; rgb is an object with the RGB values - * - * - * Change log: - * - * - v0.1 (2011-02-24) - Initial release - * - * - * Attribution: - * - * - The color picker icon is based on an icon from the amazing Fugue icon set: - * http://p.yusukekamiyamane.com/ - * - * - The gradient image, the hue image, and the math functions are courtesy of - * the eyecon.co jQuery color picker: http://www.eyecon.ro/colorpicker/ - * - * -*/ -if(jQuery) (function($) { - - $.extend($.fn, { - - miniColors: function(o, data) { - - - var create = function(input, o, data) { - - // - // Creates a new instance of the miniColors selector - // - - // Determine initial color (defaults to white) - var color = cleanHex(input.val()); - if( !color ) color = 'FFFFFF'; - var hsb = hex2hsb(color); - - // Create trigger - var trigger = $(''); - trigger.insertAfter(input); - - // Add necessary attributes - input.addClass('miniColors').attr('maxlength', 7).attr('autocomplete', 'off'); - - // Set input data - input.data('trigger', trigger); - input.data('hsb', hsb); - if( o.change ) input.data('change', o.change); - - // Handle options - if( o.readonly ) input.attr('readonly', true); - if( o.disabled ) disable(input); - - // Show selector when trigger is clicked - trigger.bind('click.miniColors', function(event) { - event.preventDefault(); - input.trigger('focus'); - }); - - // Show selector when input receives focus - input.bind('focus.miniColors', function(event) { - show(input); - }); - - // Hide on blur - input.bind('blur.miniColors', function(event) { - var hex = cleanHex(input.val()); - input.val( hex ? '#' + hex : '' ); - }); - - // Hide when tabbing out of the input - input.bind('keydown.miniColors', function(event) { - if( event.keyCode === 9 ) hide(input); - }); - - // Update when color is typed in - input.bind('keyup.miniColors', function(event) { - // Remove non-hex characters - var filteredHex = input.val().replace(/[^A-F0-9#]/ig, ''); - input.val(filteredHex); - if( !setColorFromInput(input) ) { - // Reset trigger color when color is invalid - input.data('trigger').css('backgroundColor', '#FFF'); - } - }); - - // Handle pasting - input.bind('paste.miniColors', function(event) { - // Short pause to wait for paste to complete - setTimeout( function() { - input.trigger('keyup'); - }, 5); - }); - - }; - - - var destroy = function(input) { - - // - // Destroys an active instance of the miniColors selector - // - - hide(); - - input = $(input); - input.data('trigger').remove(); - input.removeAttr('autocomplete'); - input.removeData('trigger'); - input.removeData('selector'); - input.removeData('hsb'); - input.removeData('huePicker'); - input.removeData('colorPicker'); - input.removeData('mousebutton'); - input.removeData('moving'); - input.unbind('click.miniColors'); - input.unbind('focus.miniColors'); - input.unbind('blur.miniColors'); - input.unbind('keyup.miniColors'); - input.unbind('keydown.miniColors'); - input.unbind('paste.miniColors'); - $(document).unbind('mousedown.miniColors'); - $(document).unbind('mousemove.miniColors'); - - }; - - - var enable = function(input) { - - // - // Disables the input control and the selector - // - - input.attr('disabled', false); - input.data('trigger').css('opacity', 1); - - }; - - - var disable = function(input) { - - // - // Disables the input control and the selector - // - - hide(input); - input.attr('disabled', true); - input.data('trigger').css('opacity', .5); - - }; - - - var show = function(input) { - - // - // Shows the miniColors selector - // - - if( input.attr('disabled') ) return false; - - // Hide all other instances - hide(); - - // Generate the selector - var selector = $('
      '); - selector.append('
      '); - selector.append('
      '); - selector.css({ - top: input.is(':visible') ? input.offset().top + input.outerHeight() : input.data('trigger').offset().top + input.data('trigger').outerHeight(), - left: input.is(':visible') ? input.offset().left : input.data('trigger').offset().left, - display: 'none' - }).addClass( input.attr('class') ); - - // Set background for colors - var hsb = input.data('hsb'); - selector.find('.miniColors-colors').css('backgroundColor', '#' + hsb2hex({ h: hsb.h, s: 100, b: 100 })); - - // Set colorPicker position - var colorPosition = input.data('colorPosition'); - if( !colorPosition ) colorPosition = getColorPositionFromHSB(hsb); - selector.find('.miniColors-colorPicker').css('top', colorPosition.y + 'px').css('left', colorPosition.x + 'px'); - - // Set huePicker position - var huePosition = input.data('huePosition'); - if( !huePosition ) huePosition = getHuePositionFromHSB(hsb); - selector.find('.miniColors-huePicker').css('top', huePosition.y + 'px'); - - - // Set input data - input.data('selector', selector); - input.data('huePicker', selector.find('.miniColors-huePicker')); - input.data('colorPicker', selector.find('.miniColors-colorPicker')); - input.data('mousebutton', 0); - - $('BODY').append(selector); - selector.fadeIn(100); - - // Prevent text selection in IE - selector.bind('selectstart', function() { return false; }); - - $(document).bind('mousedown.miniColors', function(event) { - input.data('mousebutton', 1); - - if( $(event.target).parents().andSelf().hasClass('miniColors-colors') ) { - event.preventDefault(); - input.data('moving', 'colors'); - moveColor(input, event); - } - - if( $(event.target).parents().andSelf().hasClass('miniColors-hues') ) { - event.preventDefault(); - input.data('moving', 'hues'); - moveHue(input, event); - } - - if( $(event.target).parents().andSelf().hasClass('miniColors-selector') ) { - event.preventDefault(); - return; - } - - if( $(event.target).parents().andSelf().hasClass('miniColors') ) return; - - hide(input); - }); - - $(document).bind('mouseup.miniColors', function(event) { - input.data('mousebutton', 0); - input.removeData('moving'); - }); - - $(document).bind('mousemove.miniColors', function(event) { - if( input.data('mousebutton') === 1 ) { - if( input.data('moving') === 'colors' ) moveColor(input, event); - if( input.data('moving') === 'hues' ) moveHue(input, event); - } - }); - - }; - - - var hide = function(input) { - - // - // Hides one or more miniColors selectors - // - - // Hide all other instances if input isn't specified - if( !input ) input = '.miniColors'; - - $(input).each( function() { - var selector = $(this).data('selector'); - $(this).removeData('selector'); - $(selector).fadeOut(100, function() { - $(this).remove(); - }); - }); - - $(document).unbind('mousedown.miniColors'); - $(document).unbind('mousemove.miniColors'); - - }; - - - var moveColor = function(input, event) { - - var colorPicker = input.data('colorPicker'); - - colorPicker.hide(); - - var position = { - x: event.clientX - input.data('selector').find('.miniColors-colors').offset().left + $(document).scrollLeft() - 5, - y: event.clientY - input.data('selector').find('.miniColors-colors').offset().top + $(document).scrollTop() - 5 - }; - - if( position.x <= -5 ) position.x = -5; - if( position.x >= 144 ) position.x = 144; - if( position.y <= -5 ) position.y = -5; - if( position.y >= 144 ) position.y = 144; - input.data('colorPosition', position); - colorPicker.css('left', position.x).css('top', position.y).show(); - - // Calculate saturation - var s = Math.round((position.x + 5) * .67); - if( s < 0 ) s = 0; - if( s > 100 ) s = 100; - - // Calculate brightness - var b = 100 - Math.round((position.y + 5) * .67); - if( b < 0 ) b = 0; - if( b > 100 ) b = 100; - - // Update HSB values - var hsb = input.data('hsb'); - hsb.s = s; - hsb.b = b; - - // Set color - setColor(input, hsb, true); - - }; - - - var moveHue = function(input, event) { - - var huePicker = input.data('huePicker'); - - huePicker.hide(); - - var position = { - y: event.clientY - input.data('selector').find('.miniColors-colors').offset().top + $(document).scrollTop() - 1 - }; - - if( position.y <= -1 ) position.y = -1; - if( position.y >= 149 ) position.y = 149; - input.data('huePosition', position); - huePicker.css('top', position.y).show(); - - // Calculate hue - var h = Math.round((150 - position.y - 1) * 2.4); - if( h < 0 ) h = 0; - if( h > 360 ) h = 360; - - // Update HSB values - var hsb = input.data('hsb'); - hsb.h = h; - - // Set color - setColor(input, hsb, true); - - }; - - - var setColor = function(input, hsb, updateInputValue) { - - input.data('hsb', hsb); - var hex = hsb2hex(hsb); - if( updateInputValue ) input.val('#' + hex); - input.data('trigger').css('backgroundColor', '#' + hex); - if( input.data('selector') ) input.data('selector').find('.miniColors-colors').css('backgroundColor', '#' + hsb2hex({ h: hsb.h, s: 100, b: 100 })); - - if( input.data('change') ) { - input.data('change').call(input, '#' + hex, hsb2rgb(hsb)); - } - - }; - - - var setColorFromInput = function(input) { - - // Don't update if the hex color is invalid - var hex = cleanHex(input.val()); - if( !hex ) return false; - - // Get HSB equivalent - var hsb = hex2hsb(hex); - - // If color is the same, no change required - var currentHSB = input.data('hsb'); - if( hsb.h === currentHSB.h && hsb.s === currentHSB.s && hsb.b === currentHSB.b ) return true; - - // Set colorPicker position - var colorPosition = getColorPositionFromHSB(hsb); - var colorPicker = $(input.data('colorPicker')); - colorPicker.css('top', colorPosition.y + 'px').css('left', colorPosition.x + 'px'); - - // Set huePosition position - var huePosition = getHuePositionFromHSB(hsb); - var huePicker = $(input.data('huePicker')); - huePicker.css('top', huePosition.y + 'px'); - - setColor(input, hsb, false); - - return true; - - }; - - - var getColorPositionFromHSB = function(hsb) { - - var x = Math.ceil(hsb.s / .67); - if( x < 0 ) x = 0; - if( x > 150 ) x = 150; - - var y = 150 - Math.ceil(hsb.b / .67); - if( y < 0 ) y = 0; - if( y > 150 ) y = 150; - - return { x: x - 5, y: y - 5 }; - - } - - - var getHuePositionFromHSB = function(hsb) { - - var y = 150 - (hsb.h / 2.4); - if( y < 0 ) h = 0; - if( y > 150 ) h = 150; - - return { y: y - 1 }; - - } - - - var cleanHex = function(hex) { - - // - // Turns a dirty hex string into clean, 6-character hex color - // - - hex = hex.replace(/[^A-Fa-f0-9]/, ''); - - if( hex.length == 3 ) { - hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2]; - } - - return hex.length === 6 ? hex : null; - - }; - - - var hsb2rgb = function(hsb) { - var rgb = {}; - var h = Math.round(hsb.h); - var s = Math.round(hsb.s*255/100); - var v = Math.round(hsb.b*255/100); - if(s == 0) { - rgb.r = rgb.g = rgb.b = v; - } else { - var t1 = v; - var t2 = (255 - s) * v / 255; - var t3 = (t1 - t2) * (h % 60) / 60; - if( h == 360 ) h = 0; - if( h < 60 ) { rgb.r = t1; rgb.b = t2; rgb.g = t2 + t3; } - else if( h<120 ) {rgb.g = t1; rgb.b = t2; rgb.r = t1 - t3; } - else if( h<180 ) {rgb.g = t1; rgb.r = t2; rgb.b = t2 + t3; } - else if( h<240 ) {rgb.b = t1; rgb.r = t2; rgb.g = t1 - t3; } - else if( h<300 ) {rgb.b = t1; rgb.g = t2; rgb.r = t2 + t3; } - else if( h<360 ) {rgb.r = t1; rgb.g = t2; rgb.b = t1 - t3; } - else { rgb.r = 0; rgb.g = 0; rgb.b = 0; } - } - return { - r: Math.round(rgb.r), - g: Math.round(rgb.g), - b: Math.round(rgb.b) - }; - }; - - - var rgb2hex = function(rgb) { - - var hex = [ - rgb.r.toString(16), - rgb.g.toString(16), - rgb.b.toString(16) - ]; - $.each(hex, function(nr, val) { - if (val.length == 1) hex[nr] = '0' + val; - }); - - return hex.join(''); - }; - - - var hex2rgb = function(hex) { - var hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16); - - return { - r: hex >> 16, - g: (hex & 0x00FF00) >> 8, - b: (hex & 0x0000FF) - }; - }; - - - var rgb2hsb = function(rgb) { - var hsb = { h: 0, s: 0, b: 0 }; - var min = Math.min(rgb.r, rgb.g, rgb.b); - var max = Math.max(rgb.r, rgb.g, rgb.b); - var delta = max - min; - hsb.b = max; - hsb.s = max != 0 ? 255 * delta / max : 0; - if( hsb.s != 0 ) { - if( rgb.r == max ) { - hsb.h = (rgb.g - rgb.b) / delta; - } else if( rgb.g == max ) { - hsb.h = 2 + (rgb.b - rgb.r) / delta; - } else { - hsb.h = 4 + (rgb.r - rgb.g) / delta; - } - } else { - hsb.h = -1; - } - hsb.h *= 60; - if( hsb.h < 0 ) { - hsb.h += 360; - } - hsb.s *= 100/255; - hsb.b *= 100/255; - return hsb; - }; - - - var hex2hsb = function(hex) { - var hsb = rgb2hsb(hex2rgb(hex)); - // Zero out hue marker for black, white, and grays (saturation === 0) - if( hsb.s === 0 ) hsb.h = 360; - return hsb; - }; - - - var hsb2hex = function(hsb) { - return rgb2hex(hsb2rgb(hsb)); - }; - - - // - // Handle calls to $([selector]).miniColors() - // - switch(o) { - - case 'readonly': - - $(this).each( function() { - $(this).attr('readonly', data); - }); - - return $(this); - - break; - - case 'disabled': - - $(this).each( function() { - if( data ) { - disable($(this)); - } else { - enable($(this)); - } - }); - - return $(this); - - case 'value': - - $(this).each( function() { - $(this).val(data).trigger('keyup'); - }); - - return $(this); - - break; - - case 'destroy': - - $(this).each( function() { - destroy($(this)); - }); - - return $(this); - - default: - - if( !o ) o = {}; - - $(this).each( function() { - - // Must be called on an input element - if( $(this)[0].tagName.toLowerCase() !== 'input' ) return; - - // If a trigger is present, the control was already created - if( $(this).data('trigger') ) return; - - // Create the control - create($(this), o, data); - - }); - - return $(this); - - } - - - } - - - }); - -})(jQuery); - - - diff --git a/src/main/resources/static/js/jquery.miniColors-0.1/jquery.miniColors.min.js b/src/main/resources/static/js/jquery.miniColors-0.1/jquery.miniColors.min.js deleted file mode 100644 index 6972934..0000000 --- a/src/main/resources/static/js/jquery.miniColors-0.1/jquery.miniColors.min.js +++ /dev/null @@ -1,16 +0,0 @@ -if(jQuery)(function($){$.extend($.fn,{miniColors:function(o,data){var create=function(input,o,data){var color=cleanHex(input.val());if(!color)color='FFFFFF';var hsb=hex2hsb(color);var trigger=$('');trigger.insertAfter(input);input.addClass('miniColors').attr('maxlength',7).attr('autocomplete','off');input.data('trigger',trigger);input.data('hsb',hsb);if(o.change)input.data('change',o.change);if(o.readonly)input.attr('readonly',true);if(o.disabled)disable(input);trigger.bind('click.miniColors',function(event){event.preventDefault();input.trigger('focus');});input.bind('focus.miniColors',function(event){show(input);});input.bind('blur.miniColors',function(event){var hex=cleanHex(input.val());input.val(hex?'#'+hex:'');});input.bind('keydown.miniColors',function(event){if(event.keyCode===9)hide(input);});input.bind('keyup.miniColors',function(event){var filteredHex=input.val().replace(/[^A-F0-9#]/ig,'');input.val(filteredHex);if(!setColorFromInput(input)){input.data('trigger').css('backgroundColor','#FFF');}});input.bind('paste.miniColors',function(event){setTimeout(function(){input.trigger('keyup');},5);});};var destroy=function(input){hide();input=$(input);input.data('trigger').remove();input.removeAttr('autocomplete');input.removeData('trigger');input.removeData('selector');input.removeData('hsb');input.removeData('huePicker');input.removeData('colorPicker');input.removeData('mousebutton');input.removeData('moving');input.unbind('click.miniColors');input.unbind('focus.miniColors');input.unbind('blur.miniColors');input.unbind('keyup.miniColors');input.unbind('keydown.miniColors');input.unbind('paste.miniColors');$(document).unbind('mousedown.miniColors');$(document).unbind('mousemove.miniColors');};var enable=function(input){input.attr('disabled',false);input.data('trigger').css('opacity',1);};var disable=function(input){hide(input);input.attr('disabled',true);input.data('trigger').css('opacity',.5);};var show=function(input){if(input.attr('disabled'))return false;hide();var selector=$('
      ');selector.append('
      ');selector.append('
      ');selector.css({top:input.is(':visible')?input.offset().top+input.outerHeight():input.data('trigger').offset().top+input.data('trigger').outerHeight(),left:input.is(':visible')?input.offset().left:input.data('trigger').offset().left,display:'none'}).addClass(input.attr('class'));var hsb=input.data('hsb');selector.find('.miniColors-colors').css('backgroundColor','#'+hsb2hex({h:hsb.h,s:100,b:100}));var colorPosition=input.data('colorPosition');if(!colorPosition)colorPosition=getColorPositionFromHSB(hsb);selector.find('.miniColors-colorPicker').css('top',colorPosition.y+'px').css('left',colorPosition.x+'px');var huePosition=input.data('huePosition');if(!huePosition)huePosition=getHuePositionFromHSB(hsb);selector.find('.miniColors-huePicker').css('top',huePosition.y+'px');input.data('selector',selector);input.data('huePicker',selector.find('.miniColors-huePicker'));input.data('colorPicker',selector.find('.miniColors-colorPicker'));input.data('mousebutton',0);$('BODY').append(selector);selector.fadeIn(100);selector.bind('selectstart',function(){return false;});$(document).bind('mousedown.miniColors',function(event){input.data('mousebutton',1);if($(event.target).parents().andSelf().hasClass('miniColors-colors')){event.preventDefault();input.data('moving','colors');moveColor(input,event);} -if($(event.target).parents().andSelf().hasClass('miniColors-hues')){event.preventDefault();input.data('moving','hues');moveHue(input,event);} -if($(event.target).parents().andSelf().hasClass('miniColors-selector')){event.preventDefault();return;} -if($(event.target).parents().andSelf().hasClass('miniColors'))return;hide(input);});$(document).bind('mouseup.miniColors',function(event){input.data('mousebutton',0);input.removeData('moving');});$(document).bind('mousemove.miniColors',function(event){if(input.data('mousebutton')===1){if(input.data('moving')==='colors')moveColor(input,event);if(input.data('moving')==='hues')moveHue(input,event);}});};var hide=function(input){if(!input)input='.miniColors';$(input).each(function(){var selector=$(this).data('selector');$(this).removeData('selector');$(selector).fadeOut(100,function(){$(this).remove();});});$(document).unbind('mousedown.miniColors');$(document).unbind('mousemove.miniColors');};var moveColor=function(input,event){var colorPicker=input.data('colorPicker');colorPicker.hide();var position={x:event.clientX-input.data('selector').find('.miniColors-colors').offset().left+$(document).scrollLeft()-5,y:event.clientY-input.data('selector').find('.miniColors-colors').offset().top+$(document).scrollTop()-5};if(position.x<=-5)position.x=-5;if(position.x>=144)position.x=144;if(position.y<=-5)position.y=-5;if(position.y>=144)position.y=144;input.data('colorPosition',position);colorPicker.css('left',position.x).css('top',position.y).show();var s=Math.round((position.x+5)*.67);if(s<0)s=0;if(s>100)s=100;var b=100-Math.round((position.y+5)*.67);if(b<0)b=0;if(b>100)b=100;var hsb=input.data('hsb');hsb.s=s;hsb.b=b;setColor(input,hsb,true);};var moveHue=function(input,event){var huePicker=input.data('huePicker');huePicker.hide();var position={y:event.clientY-input.data('selector').find('.miniColors-colors').offset().top+$(document).scrollTop()-1};if(position.y<=-1)position.y=-1;if(position.y>=149)position.y=149;input.data('huePosition',position);huePicker.css('top',position.y).show();var h=Math.round((150-position.y-1)*2.4);if(h<0)h=0;if(h>360)h=360;var hsb=input.data('hsb');hsb.h=h;setColor(input,hsb,true);};var setColor=function(input,hsb,updateInputValue){input.data('hsb',hsb);var hex=hsb2hex(hsb);if(updateInputValue)input.val('#'+hex);input.data('trigger').css('backgroundColor','#'+hex);if(input.data('selector'))input.data('selector').find('.miniColors-colors').css('backgroundColor','#'+hsb2hex({h:hsb.h,s:100,b:100}));if(input.data('change')){input.data('change').call(input,'#'+hex,hsb2rgb(hsb));}};var setColorFromInput=function(input){var hex=cleanHex(input.val());if(!hex)return false;var hsb=hex2hsb(hex);var currentHSB=input.data('hsb');if(hsb.h===currentHSB.h&&hsb.s===currentHSB.s&&hsb.b===currentHSB.b)return true;var colorPosition=getColorPositionFromHSB(hsb);var colorPicker=$(input.data('colorPicker'));colorPicker.css('top',colorPosition.y+'px').css('left',colorPosition.x+'px');var huePosition=getHuePositionFromHSB(hsb);var huePicker=$(input.data('huePicker'));huePicker.css('top',huePosition.y+'px');setColor(input,hsb,false);return true;};var getColorPositionFromHSB=function(hsb){var x=Math.ceil(hsb.s/.67);if(x<0)x=0;if(x>150)x=150;var y=150-Math.ceil(hsb.b/.67);if(y<0)y=0;if(y>150)y=150;return{x:x-5,y:y-5};} -var getHuePositionFromHSB=function(hsb){var y=150-(hsb.h/2.4);if(y<0)h=0;if(y>150)h=150;return{y:y-1};} -var cleanHex=function(hex){hex=hex.replace(/[^A-Fa-f0-9]/,'');if(hex.length==3){hex=hex[0]+hex[0]+hex[1]+hex[1]+hex[2]+hex[2];} -return hex.length===6?hex:null;};var hsb2rgb=function(hsb){var rgb={};var h=Math.round(hsb.h);var s=Math.round(hsb.s*255/100);var v=Math.round(hsb.b*255/100);if(s==0){rgb.r=rgb.g=rgb.b=v;}else{var t1=v;var t2=(255-s)*v/255;var t3=(t1-t2)*(h%60)/60;if(h==360)h=0;if(h<60){rgb.r=t1;rgb.b=t2;rgb.g=t2+t3;} -else if(h<120){rgb.g=t1;rgb.b=t2;rgb.r=t1-t3;} -else if(h<180){rgb.g=t1;rgb.r=t2;rgb.b=t2+t3;} -else if(h<240){rgb.b=t1;rgb.r=t2;rgb.g=t1-t3;} -else if(h<300){rgb.b=t1;rgb.g=t2;rgb.r=t2+t3;} -else if(h<360){rgb.r=t1;rgb.g=t2;rgb.b=t1-t3;} -else{rgb.r=0;rgb.g=0;rgb.b=0;}} -return{r:Math.round(rgb.r),g:Math.round(rgb.g),b:Math.round(rgb.b)};};var rgb2hex=function(rgb){var hex=[rgb.r.toString(16),rgb.g.toString(16),rgb.b.toString(16)];$.each(hex,function(nr,val){if(val.length==1)hex[nr]='0'+val;});return hex.join('');};var hex2rgb=function(hex){var hex=parseInt(((hex.indexOf('#')>-1)?hex.substring(1):hex),16);return{r:hex>>16,g:(hex&0x00FF00)>>8,b:(hex&0x0000FF)};};var rgb2hsb=function(rgb){var hsb={h:0,s:0,b:0};var min=Math.min(rgb.r,rgb.g,rgb.b);var max=Math.max(rgb.r,rgb.g,rgb.b);var delta=max-min;hsb.b=max;hsb.s=max!=0?255*delta/max:0;if(hsb.s!=0){if(rgb.r==max){hsb.h=(rgb.g-rgb.b)/delta;}else if(rgb.g==max){hsb.h=2+(rgb.b-rgb.r)/delta;}else{hsb.h=4+(rgb.r-rgb.g)/delta;}}else{hsb.h=-1;} -hsb.h*=60;if(hsb.h<0){hsb.h+=360;} -hsb.s*=100/255;hsb.b*=100/255;return hsb;};var hex2hsb=function(hex){var hsb=rgb2hsb(hex2rgb(hex));if(hsb.s===0)hsb.h=360;return hsb;};var hsb2hex=function(hsb){return rgb2hex(hsb2rgb(hsb));};switch(o){case'readonly':$(this).each(function(){$(this).attr('readonly',data);});return $(this);break;case'disabled':$(this).each(function(){if(data){disable($(this));}else{enable($(this));}});return $(this);case'value':$(this).each(function(){$(this).val(data).trigger('keyup');});return $(this);break;case'destroy':$(this).each(function(){destroy($(this));});return $(this);default:if(!o)o={};$(this).each(function(){if($(this)[0].tagName.toLowerCase()!=='input')return;if($(this).data('trigger'))return;create($(this),o,data);});return $(this);}}});})(jQuery); \ No newline at end of file diff --git a/src/main/resources/static/js/jquery.validate.min.js b/src/main/resources/static/js/jquery.validate.min.js deleted file mode 100644 index 010f57c..0000000 --- a/src/main/resources/static/js/jquery.validate.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}(function(t){t.extend(t.fn,{validate:function(e){if(!this.length)return void(e&&e.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var i=t.data(this[0],"validator");return i?i:(this.attr("novalidate","novalidate"),i=new t.validator(e,this[0]),t.data(this[0],"validator",i),i.settings.onsubmit&&(this.on("click.validate",":submit",function(e){i.settings.submitHandler&&(i.submitButton=e.target),t(this).hasClass("cancel")&&(i.cancelSubmit=!0),void 0!==t(this).attr("formnovalidate")&&(i.cancelSubmit=!0)}),this.on("submit.validate",function(e){function s(){var s,r;return i.settings.submitHandler?(i.submitButton&&(s=t("").attr("name",i.submitButton.name).val(t(i.submitButton).val()).appendTo(i.currentForm)),r=i.settings.submitHandler.call(i,i.currentForm,e),i.submitButton&&s.remove(),void 0!==r?r:!1):!0}return i.settings.debug&&e.preventDefault(),i.cancelSubmit?(i.cancelSubmit=!1,s()):i.form()?i.pendingRequest?(i.formSubmitted=!0,!1):s():(i.focusInvalid(),!1)})),i)},valid:function(){var e,i,s;return t(this[0]).is("form")?e=this.validate().form():(s=[],e=!0,i=t(this[0].form).validate(),this.each(function(){e=i.element(this)&&e,e||(s=s.concat(i.errorList))}),i.errorList=s),e},rules:function(e,i){var s,r,n,a,o,l,h=this[0];if(null!=h&&null!=h.form){if(e)switch(s=t.data(h.form,"validator").settings,r=s.rules,n=t.validator.staticRules(h),e){case"add":t.extend(n,t.validator.normalizeRule(i)),delete n.messages,r[h.name]=n,i.messages&&(s.messages[h.name]=t.extend(s.messages[h.name],i.messages));break;case"remove":return i?(l={},t.each(i.split(/\s/),function(e,i){l[i]=n[i],delete n[i],"required"===i&&t(h).removeAttr("aria-required")}),l):(delete r[h.name],n)}return a=t.validator.normalizeRules(t.extend({},t.validator.classRules(h),t.validator.attributeRules(h),t.validator.dataRules(h),t.validator.staticRules(h)),h),a.required&&(o=a.required,delete a.required,a=t.extend({required:o},a),t(h).attr("aria-required","true")),a.remote&&(o=a.remote,delete a.remote,a=t.extend(a,{remote:o})),a}}}),t.extend(t.expr[":"],{blank:function(e){return!t.trim(""+t(e).val())},filled:function(e){var i=t(e).val();return null!==i&&!!t.trim(""+i)},unchecked:function(e){return!t(e).prop("checked")}}),t.validator=function(e,i){this.settings=t.extend(!0,{},t.validator.defaults,e),this.currentForm=i,this.init()},t.validator.format=function(e,i){return 1===arguments.length?function(){var i=t.makeArray(arguments);return i.unshift(e),t.validator.format.apply(this,i)}:void 0===i?e:(arguments.length>2&&i.constructor!==Array&&(i=t.makeArray(arguments).slice(1)),i.constructor!==Array&&(i=[i]),t.each(i,function(t,i){e=e.replace(new RegExp("\\{"+t+"\\}","g"),function(){return i})}),e)},t.extend(t.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",pendingClass:"pending",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:t([]),errorLabelContainer:t([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(t){this.lastActive=t,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,t,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(t)))},onfocusout:function(t){this.checkable(t)||!(t.name in this.submitted)&&this.optional(t)||this.element(t)},onkeyup:function(e,i){var s=[16,17,18,20,35,36,37,38,39,40,45,144,225];9===i.which&&""===this.elementValue(e)||-1!==t.inArray(i.keyCode,s)||(e.name in this.submitted||e.name in this.invalid)&&this.element(e)},onclick:function(t){t.name in this.submitted?this.element(t):t.parentNode.name in this.submitted&&this.element(t.parentNode)},highlight:function(e,i,s){"radio"===e.type?this.findByName(e.name).addClass(i).removeClass(s):t(e).addClass(i).removeClass(s)},unhighlight:function(e,i,s){"radio"===e.type?this.findByName(e.name).removeClass(i).addClass(s):t(e).removeClass(i).addClass(s)}},setDefaults:function(e){t.extend(t.validator.defaults,e)},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.",equalTo:"Please enter the same value again.",maxlength:t.validator.format("Please enter no more than {0} characters."),minlength:t.validator.format("Please enter at least {0} characters."),rangelength:t.validator.format("Please enter a value between {0} and {1} characters long."),range:t.validator.format("Please enter a value between {0} and {1}."),max:t.validator.format("Please enter a value less than or equal to {0}."),min:t.validator.format("Please enter a value greater than or equal to {0}."),step:t.validator.format("Please enter a multiple of {0}.")},autoCreateRanges:!1,prototype:{init:function(){function e(e){!this.form&&this.hasAttribute("contenteditable")&&(this.form=t(this).closest("form")[0]);var i=t.data(this.form,"validator"),s="on"+e.type.replace(/^validate/,""),r=i.settings;r[s]&&!t(this).is(r.ignore)&&r[s].call(i,this,e)}this.labelContainer=t(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||t(this.currentForm),this.containers=t(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var i,s=this.groups={};t.each(this.settings.groups,function(e,i){"string"==typeof i&&(i=i.split(/\s/)),t.each(i,function(t,i){s[i]=e})}),i=this.settings.rules,t.each(i,function(e,s){i[e]=t.validator.normalizeRule(s)}),t(this.currentForm).on("focusin.validate focusout.validate keyup.validate",":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], [type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox'], [contenteditable]",e).on("click.validate","select, option, [type='radio'], [type='checkbox']",e),this.settings.invalidHandler&&t(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler),t(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required","true")},form:function(){return this.checkForm(),t.extend(this.submitted,this.errorMap),this.invalid=t.extend({},this.errorMap),this.valid()||t(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var t=0,e=this.currentElements=this.elements();e[t];t++)this.check(e[t]);return this.valid()},element:function(e){var i,s,r=this.clean(e),n=this.validationTargetFor(r),a=this,o=!0;return void 0===n?delete this.invalid[r.name]:(this.prepareElement(n),this.currentElements=t(n),s=this.groups[n.name],s&&t.each(this.groups,function(t,e){e===s&&t!==n.name&&(r=a.validationTargetFor(a.clean(a.findByName(t))),r&&r.name in a.invalid&&(a.currentElements.push(r),o=a.check(r)&&o))}),i=this.check(n)!==!1,o=o&&i,this.invalid[n.name]=i?!1:!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),t(e).attr("aria-invalid",!i)),o},showErrors:function(e){if(e){var i=this;t.extend(this.errorMap,e),this.errorList=t.map(this.errorMap,function(t,e){return{message:t,element:i.findByName(e)[0]}}),this.successList=t.grep(this.successList,function(t){return!(t.name in e)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){t.fn.resetForm&&t(this.currentForm).resetForm(),this.invalid={},this.submitted={},this.prepareForm(),this.hideErrors();var e=this.elements().removeData("previousValue").removeAttr("aria-invalid");this.resetElements(e)},resetElements:function(t){var e;if(this.settings.unhighlight)for(e=0;t[e];e++)this.settings.unhighlight.call(this,t[e],this.settings.errorClass,""),this.findByName(t[e].name).removeClass(this.settings.validClass);else t.removeClass(this.settings.errorClass).removeClass(this.settings.validClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(t){var e,i=0;for(e in t)t[e]&&i++;return i},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(t){t.not(this.containers).text(""),this.addWrapper(t).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{t(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(e){}},findLastActive:function(){var e=this.lastActive;return e&&1===t.grep(this.errorList,function(t){return t.element.name===e.name}).length&&e},elements:function(){var e=this,i={};return t(this.currentForm).find("input, select, textarea, [contenteditable]").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){var s=this.name||t(this).attr("name");return!s&&e.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.hasAttribute("contenteditable")&&(this.form=t(this).closest("form")[0]),s in i||!e.objectLength(t(this).rules())?!1:(i[s]=!0,!0)})},clean:function(e){return t(e)[0]},errors:function(){var e=this.settings.errorClass.split(" ").join(".");return t(this.settings.errorElement+"."+e,this.errorContext)},resetInternals:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=t([]),this.toHide=t([])},reset:function(){this.resetInternals(),this.currentElements=t([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(t){this.reset(),this.toHide=this.errorsFor(t)},elementValue:function(e){var i,s,r=t(e),n=e.type;return"radio"===n||"checkbox"===n?this.findByName(e.name).filter(":checked").val():"number"===n&&"undefined"!=typeof e.validity?e.validity.badInput?"NaN":r.val():(i=e.hasAttribute("contenteditable")?r.text():r.val(),"file"===n?"C:\\fakepath\\"===i.substr(0,12)?i.substr(12):(s=i.lastIndexOf("/"),s>=0?i.substr(s+1):(s=i.lastIndexOf("\\"),s>=0?i.substr(s+1):i)):"string"==typeof i?i.replace(/\r/g,""):i)},check:function(e){e=this.validationTargetFor(this.clean(e));var i,s,r,n=t(e).rules(),a=t.map(n,function(t,e){return e}).length,o=!1,l=this.elementValue(e);if("function"==typeof n.normalizer){if(l=n.normalizer.call(e,l),"string"!=typeof l)throw new TypeError("The normalizer should return a string value.");delete n.normalizer}for(s in n){r={method:s,parameters:n[s]};try{if(i=t.validator.methods[s].call(this,l,e,r.parameters),"dependency-mismatch"===i&&1===a){o=!0;continue}if(o=!1,"pending"===i)return void(this.toHide=this.toHide.not(this.errorsFor(e)));if(!i)return this.formatAndAdd(e,r),!1}catch(h){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+e.id+", check the '"+r.method+"' method.",h),h instanceof TypeError&&(h.message+=". Exception occurred when checking element "+e.id+", check the '"+r.method+"' method."),h}}if(!o)return this.objectLength(n)&&this.successList.push(e),!0},customDataMessage:function(e,i){return t(e).data("msg"+i.charAt(0).toUpperCase()+i.substring(1).toLowerCase())||t(e).data("msg")},customMessage:function(t,e){var i=this.settings.messages[t];return i&&(i.constructor===String?i:i[e])},findDefined:function(){for(var t=0;tWarning: No message defined for "+e.name+""),r=/\$?\{(\d+)\}/g;return"function"==typeof s?s=s.call(this,i.parameters,e):r.test(s)&&(s=t.validator.format(s.replace(r,"{$1}"),i.parameters)),s},formatAndAdd:function(t,e){var i=this.defaultMessage(t,e);this.errorList.push({message:i,element:t,method:e.method}),this.errorMap[t.name]=i,this.submitted[t.name]=i},addWrapper:function(t){return this.settings.wrapper&&(t=t.add(t.parent(this.settings.wrapper))),t},defaultShowErrors:function(){var t,e,i;for(t=0;this.errorList[t];t++)i=this.errorList[t],this.settings.highlight&&this.settings.highlight.call(this,i.element,this.settings.errorClass,this.settings.validClass),this.showLabel(i.element,i.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(t=0;this.successList[t];t++)this.showLabel(this.successList[t]);if(this.settings.unhighlight)for(t=0,e=this.validElements();e[t];t++)this.settings.unhighlight.call(this,e[t],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 t(this.errorList).map(function(){return this.element})},showLabel:function(e,i){var s,r,n,a,o=this.errorsFor(e),l=this.idOrName(e),h=t(e).attr("aria-describedby");o.length?(o.removeClass(this.settings.validClass).addClass(this.settings.errorClass),o.html(i)):(o=t("<"+this.settings.errorElement+">").attr("id",l+"-error").addClass(this.settings.errorClass).html(i||""),s=o,this.settings.wrapper&&(s=o.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(s):this.settings.errorPlacement?this.settings.errorPlacement.call(this,s,t(e)):s.insertAfter(e),o.is("label")?o.attr("for",l):0===o.parents("label[for='"+this.escapeCssMeta(l)+"']").length&&(n=o.attr("id"),h?h.match(new RegExp("\\b"+this.escapeCssMeta(n)+"\\b"))||(h+=" "+n):h=n,t(e).attr("aria-describedby",h),r=this.groups[e.name],r&&(a=this,t.each(a.groups,function(e,i){i===r&&t("[name='"+a.escapeCssMeta(e)+"']",a.currentForm).attr("aria-describedby",o.attr("id"))})))),!i&&this.settings.success&&(o.text(""),"string"==typeof this.settings.success?o.addClass(this.settings.success):this.settings.success(o,e)),this.toShow=this.toShow.add(o)},errorsFor:function(e){var i=this.escapeCssMeta(this.idOrName(e)),s=t(e).attr("aria-describedby"),r="label[for='"+i+"'], label[for='"+i+"'] *";return s&&(r=r+", #"+this.escapeCssMeta(s).replace(/\s+/g,", #")),this.errors().filter(r)},escapeCssMeta:function(t){return t.replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g,"\\$1")},idOrName:function(t){return this.groups[t.name]||(this.checkable(t)?t.name:t.id||t.name)},validationTargetFor:function(e){return this.checkable(e)&&(e=this.findByName(e.name)),t(e).not(this.settings.ignore)[0]},checkable:function(t){return/radio|checkbox/i.test(t.type)},findByName:function(e){return t(this.currentForm).find("[name='"+this.escapeCssMeta(e)+"']")},getLength:function(e,i){switch(i.nodeName.toLowerCase()){case"select":return t("option:selected",i).length;case"input":if(this.checkable(i))return this.findByName(i.name).filter(":checked").length}return e.length},depend:function(t,e){return this.dependTypes[typeof t]?this.dependTypes[typeof t](t,e):!0},dependTypes:{"boolean":function(t){return t},string:function(e,i){return!!t(e,i.form).length},"function":function(t,e){return t(e)}},optional:function(e){var i=this.elementValue(e);return!t.validator.methods.required.call(this,i,e)&&"dependency-mismatch"},startRequest:function(e){this.pending[e.name]||(this.pendingRequest++,t(e).addClass(this.settings.pendingClass),this.pending[e.name]=!0)},stopRequest:function(e,i){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[e.name],t(e).removeClass(this.settings.pendingClass),i&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(t(this.currentForm).submit(),this.formSubmitted=!1):!i&&0===this.pendingRequest&&this.formSubmitted&&(t(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(e,i){return i="string"==typeof i&&i||"remote",t.data(e,"previousValue")||t.data(e,"previousValue",{old:null,valid:!0,message:this.defaultMessage(e,{method:i})})},destroy:function(){this.resetForm(),t(this.currentForm).off(".validate").removeData("validator").find(".validate-equalTo-blur").off(".validate-equalTo").removeClass("validate-equalTo-blur")}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(e,i){e.constructor===String?this.classRuleSettings[e]=i:t.extend(this.classRuleSettings,e)},classRules:function(e){var i={},s=t(e).attr("class");return s&&t.each(s.split(" "),function(){this in t.validator.classRuleSettings&&t.extend(i,t.validator.classRuleSettings[this])}),i},normalizeAttributeRule:function(t,e,i,s){/min|max|step/.test(i)&&(null===e||/number|range|text/.test(e))&&(s=Number(s),isNaN(s)&&(s=void 0)),s||0===s?t[i]=s:e===i&&"range"!==e&&(t[i]=!0)},attributeRules:function(e){var i,s,r={},n=t(e),a=e.getAttribute("type");for(i in t.validator.methods)"required"===i?(s=e.getAttribute(i),""===s&&(s=!0),s=!!s):s=n.attr(i),this.normalizeAttributeRule(r,a,i,s);return r.maxlength&&/-1|2147483647|524288/.test(r.maxlength)&&delete r.maxlength,r},dataRules:function(e){var i,s,r={},n=t(e),a=e.getAttribute("type");for(i in t.validator.methods)s=n.data("rule"+i.charAt(0).toUpperCase()+i.substring(1).toLowerCase()),this.normalizeAttributeRule(r,a,i,s);return r},staticRules:function(e){var i={},s=t.data(e.form,"validator");return s.settings.rules&&(i=t.validator.normalizeRule(s.settings.rules[e.name])||{}),i},normalizeRules:function(e,i){return t.each(e,function(s,r){if(r===!1)return void delete e[s];if(r.param||r.depends){var n=!0;switch(typeof r.depends){case"string":n=!!t(r.depends,i.form).length;break;case"function":n=r.depends.call(i,i)}n?e[s]=void 0!==r.param?r.param:!0:(t.data(i.form,"validator").resetElements(t(i)),delete e[s])}}),t.each(e,function(s,r){e[s]=t.isFunction(r)&&"normalizer"!==s?r(i):r}),t.each(["minlength","maxlength"],function(){e[this]&&(e[this]=Number(e[this]))}),t.each(["rangelength","range"],function(){var i;e[this]&&(t.isArray(e[this])?e[this]=[Number(e[this][0]),Number(e[this][1])]:"string"==typeof e[this]&&(i=e[this].replace(/[\[\]]/g,"").split(/[\s,]+/),e[this]=[Number(i[0]),Number(i[1])]))}),t.validator.autoCreateRanges&&(null!=e.min&&null!=e.max&&(e.range=[e.min,e.max],delete e.min,delete e.max),null!=e.minlength&&null!=e.maxlength&&(e.rangelength=[e.minlength,e.maxlength],delete e.minlength,delete e.maxlength)),e},normalizeRule:function(e){if("string"==typeof e){var i={};t.each(e.split(/\s/),function(){i[this]=!0}),e=i}return e},addMethod:function(e,i,s){t.validator.methods[e]=i,t.validator.messages[e]=void 0!==s?s:t.validator.messages[e],i.length<3&&t.validator.addClassRules(e,t.validator.normalizeRule(e))},methods:{required:function(e,i,s){if(!this.depend(s,i))return"dependency-mismatch";if("select"===i.nodeName.toLowerCase()){var r=t(i).val();return r&&r.length>0}return this.checkable(i)?this.getLength(e,i)>0:e.length>0},email:function(t,e){return this.optional(e)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(t)},url:function(t,e){return this.optional(e)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(t)},date:function(t,e){return this.optional(e)||!/Invalid|NaN/.test(new Date(t).toString())},dateISO:function(t,e){return this.optional(e)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(t)},number:function(t,e){return this.optional(e)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(t)},digits:function(t,e){return this.optional(e)||/^\d+$/.test(t)},minlength:function(e,i,s){var r=t.isArray(e)?e.length:this.getLength(e,i);return this.optional(i)||r>=s},maxlength:function(e,i,s){var r=t.isArray(e)?e.length:this.getLength(e,i);return this.optional(i)||s>=r},rangelength:function(e,i,s){var r=t.isArray(e)?e.length:this.getLength(e,i);return this.optional(i)||r>=s[0]&&r<=s[1]},min:function(t,e,i){return this.optional(e)||t>=i},max:function(t,e,i){return this.optional(e)||i>=t},range:function(t,e,i){return this.optional(e)||t>=i[0]&&t<=i[1]},step:function(e,i,s){var r,n=t(i).attr("type"),a="Step attribute on input type "+n+" is not supported.",o=["text","number","range"],l=new RegExp("\\b"+n+"\\b"),h=n&&!l.test(o.join()),u=function(t){var e=(""+t).match(/(?:\.(\d+))?$/);return e&&e[1]?e[1].length:0},d=function(t){return Math.round(t*Math.pow(10,r))},c=!0;if(h)throw new Error(a);return r=u(s),(u(e)>r||d(e)%d(s)!==0)&&(c=!1),this.optional(i)||c},equalTo:function(e,i,s){var r=t(s);return this.settings.onfocusout&&r.not(".validate-equalTo-blur").length&&r.addClass("validate-equalTo-blur").on("blur.validate-equalTo",function(){t(i).valid()}),e===r.val()},remote:function(e,i,s,r){if(this.optional(i))return"dependency-mismatch";r="string"==typeof r&&r||"remote";var n,a,o,l=this.previousValue(i,r);return this.settings.messages[i.name]||(this.settings.messages[i.name]={}),l.originalMessage=l.originalMessage||this.settings.messages[i.name][r],this.settings.messages[i.name][r]=l.message,s="string"==typeof s&&{url:s}||s,o=t.param(t.extend({data:e},s.data)),l.old===o?l.valid:(l.old=o,n=this,this.startRequest(i),a={},a[i.name]=e,t.ajax(t.extend(!0,{mode:"abort",port:"validate"+i.name,dataType:"json",data:a,context:n.currentForm,success:function(t){var s,a,o,h=t===!0||"true"===t;n.settings.messages[i.name][r]=l.originalMessage,h?(o=n.formSubmitted,n.resetInternals(),n.toHide=n.errorsFor(i),n.formSubmitted=o,n.successList.push(i),n.invalid[i.name]=!1,n.showErrors()):(s={},a=t||n.defaultMessage(i,{method:r,parameters:e}),s[i.name]=l.message=a,n.invalid[i.name]=!0,n.showErrors(s)),l.valid=h,n.stopRequest(i,h)}},s)),"pending")}}});var e,i={};t.ajaxPrefilter?t.ajaxPrefilter(function(t,e,s){var r=t.port;"abort"===t.mode&&(i[r]&&i[r].abort(),i[r]=s)}):(e=t.ajax,t.ajax=function(s){var r=("mode"in s?s:t.ajaxSettings).mode,n=("port"in s?s:t.ajaxSettings).port;return"abort"===r?(i[n]&&i[n].abort(),i[n]=e.apply(this,arguments),i[n]):e.apply(this,arguments)})}); \ No newline at end of file diff --git a/src/main/resources/static/js/json2.min.js b/src/main/resources/static/js/json2.min.js deleted file mode 100644 index 9ecddae..0000000 --- a/src/main/resources/static/js/json2.min.js +++ /dev/null @@ -1 +0,0 @@ -if(typeof JSON!=="object"){JSON={}}(function(){var rx_one=/^[\],:{}\s]*$/;var rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g;var rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g;var rx_four=/(?:^|:|,)(?:\s*\[)+/g;var rx_escapable=/[\\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;var rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;function f(n){return n<10?"0"+n:n}function this_value(){return this.valueOf()}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};Boolean.prototype.toJSON=this_value;Number.prototype.toJSON=this_value;String.prototype.toJSON=this_value}var gap;var indent;var meta;var rep;function quote(string){rx_escapable.lastIndex=0;return rx_escapable.test(string)?'"'+string.replace(rx_escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i;var k;var v;var length;var mind=gap;var partial;var value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i=0}function o(a,c){c=c||"px";return a&&/^\d+$/.test(a)?a+c:a}function l(a){var c;return a&&(c=/(\d+)/.exec(a))?parseInt(c[1],10):0}function s(a){return a.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}function v(a){return a.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/&/g,"&")}function p(a){var c=a.split("-"),a="";h(c,function(c,b){a+=c>0?b.charAt(0).toUpperCase()+ -b.substr(1):b});return a}function r(a){function c(a){a=parseInt(a,10).toString(16).toUpperCase();return a.length>1?a:"0"+a}return a.replace(/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/ig,function(a,b,d,k){return"#"+c(b)+c(d)+c(k)})}function z(a,c){var c=c===d?",":c,g={},b=f(a)?a:a.split(c),t;h(b,function(a,c){if(t=/^(\d+)\.\.(\d+)$/.exec(c))for(var b=parseInt(t[1],10);b<=parseInt(t[2],10);b++)g[b.toString()]=!0;else g[c]=!0});return g}function D(a,c){return Array.prototype.slice.call(a,c||0)}function q(a, -c){return a===d?c:a}function A(a,c,g){g||(g=c,c=null);var b;if(c){var d=function(){};d.prototype=c.prototype;b=new d;h(g,function(a,c){b[a]=c})}else b=g;b.constructor=a;a.prototype=b;a.parent=c?c.prototype:null}function B(a){var c;if(c=/\{[\s\S]*\}|\[[\s\S]*\]/.exec(a))a=c[0];c=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;c.lastIndex=0;c.test(a)&&(a=a.replace(c,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})); -if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return eval("("+a+")");throw"JSON parse error";}function G(a,c,g){a.addEventListener?a.addEventListener(c,g,fb):a.attachEvent&&a.attachEvent("on"+c,g)}function C(a,c,g){a.removeEventListener?a.removeEventListener(c,g,fb):a.detachEvent&&a.detachEvent("on"+c,g)}function u(a,c){this.init(a,c)}function I(a){try{delete a[ma]}catch(c){a.removeAttribute&& -a.removeAttribute(ma)}}function E(a,c,g){if(c.indexOf(",")>=0)h(c.split(","),function(){E(a,this,g)});else{var b=a[ma]||null;b||(a[ma]=++gb,b=gb);L[b]===d&&(L[b]={});var t=L[b][c];t&&t.length>0?C(a,c,t[0]):(L[b][c]=[],L[b].el=a);t=L[b][c];t.length===0&&(t[0]=function(c){var g=c?new u(a,c):d;h(t,function(c,b){c>0&&b&&b.call(a,g)})});e(g,t)<0&&t.push(g);G(a,c,t[0])}}function T(a,c,g){if(c&&c.indexOf(",")>=0)h(c.split(","),function(){T(a,this,g)});else{var b=a[ma]||null;if(b)if(c===d)b in L&&(h(L[b], -function(c,g){c!="el"&&g.length>0&&C(a,c,g[0])}),delete L[b],I(a));else if(L[b]){var t=L[b][c];if(t&&t.length>0){g===d?(C(a,c,t[0]),delete L[b][c]):(h(t,function(a,c){a>0&&c===g&&t.splice(a,1)}),t.length==1&&(C(a,c,t[0]),delete L[b][c]));var k=0;h(L[b],function(){k++});k<2&&(delete L[b],I(a))}}}}function qa(a,c){if(c.indexOf(",")>=0)h(c.split(","),function(){qa(a,this)});else{var g=a[ma]||null;if(g){var b=L[g][c];if(L[g]&&b&&b.length>0)b[0]()}}}function $(a,c,g){c=/^\d{2,}$/.test(c)?c:c.toUpperCase().charCodeAt(0); -E(a,"keydown",function(b){b.ctrlKey&&b.which==c&&!b.shiftKey&&!b.altKey&&(g.call(a),b.stop())})}function M(a){for(var c={},g=/\s*([\w\-]+)\s*:([^;]*)(;|$)/g,b;b=g.exec(a);){var d=m(b[1].toLowerCase());b=m(r(b[2]));c[d]=b}return c}function K(a){for(var c={},g=/\s+(?:([\w\-:]+)|(?:([\w\-:]+)=([^\s"'<>]+))|(?:([\w\-:"]+)="([^"]*)")|(?:([\w\-:"]+)='([^']*)'))(?=(?:\s|\/|>)+)/g,b;b=g.exec(a);){var d=(b[1]||b[2]||b[4]||b[6]).toLowerCase();c[d]=(b[2]?b[3]:b[4]?b[5]:b[7])||""}return c}function O(a,c){return a= -/\s+class\s*=/.test(a)?a.replace(/(\s+class=["']?)([^"']*)(["']?[\s>])/,function(a,b,d,k){return(" "+d+" ").indexOf(" "+c+" ")<0?d===""?b+c+k:b+d+" "+c+k:a}):a.substr(0,a.length-1)+' class="'+c+'">'}function Q(a){var c="";h(M(a),function(a,b){c+=a+":"+b+";"});return c}function R(a,c,g,b){function t(a){for(var a=a.split("/"),c=[],g=0,b=a.length;g0&&c.pop():d!==""&&d!="."&&c.push(d)}return"/"+c.join("/")}function k(c,g){if(a.substr(0,c.length)===c){for(var d=[],t= -0;t0&&(t+="/"+d.join("/"));b=="/"&&(t+="/");return t+a.substr(c.length)}else if(i=/^(.*)\//.exec(c))return k(i[1],++g)}c=q(c,"").toLowerCase();a.substr(0,5)!="data:"&&(a=a.replace(/([^:])\/\//g,"$1/"));if(e(c,["absolute","relative","domain"])<0)return a;g=g||location.protocol+"//"+location.host;if(b===d)var w=location.pathname.match(/^(\/.*)\//),b=w?w[1]:"";var i;if(i=/^(\w+:\/\/[^\/]*)/.exec(a)){if(i[1]!==g)return a}else if(/^\w+:/.test(a))return a;/^\//.test(a)? -a=g+t(a.substr(1)):/^\w+:\/\//.test(a)||(a=g+t(b+"/"+a));c==="relative"?a=k(g+b,0).substr(2):c==="absolute"&&a.substr(0,g.length)===g&&(a=a.substr(g.length));return a}function H(a,c,g,b,d){a==null&&(a="");var g=g||"",b=q(b,!1),d=q(d,"\t"),k="xx-small,x-small,small,medium,large,x-large,xx-large".split(","),a=a.replace(/(<(?:pre|pre\s[^>]*)>)([\s\S]*?)(<\/pre>)/ig,function(a,c,g,b){return c+g.replace(/<(?:br|br\s[^>]*)>/ig,"\n")+b}),a=a.replace(/<(?:br|br\s[^>]*)\s*\/?>\s*<\/p>/ig,"

      "),a=a.replace(/(<(?:p|p\s[^>]*)>)\s*(<\/p>)/ig, -"$1
      $2"),a=a.replace(/\u200B/g,""),a=a.replace(/\u00A9/g,"©"),a=a.replace(/\u00AE/g,"®"),a=a.replace(/<[^>]+/g,function(a){return a.replace(/\s+/g," ")}),w={};c&&(h(c,function(a,c){for(var g=a.split(","),b=0,d=g.length;b]*)>)([\s\S]*?)(<\/script>)/ig,"")),w.style||(a=a.replace(/(<(?:style|style\s[^>]*)>)([\s\S]*?)(<\/style>)/ig,"")));var i=[],a=a.replace(/(\s*)<(\/)?([\w\-:]+)((?:\s+|(?:\s+[\w\-:]+)|(?:\s+[\w\-:]+=[^\s"'<>]+)|(?:\s+[\w\-:"]+="[^"]*")|(?:\s+[\w\-:"]+='[^']*'))*)(\/)?>(\s*)/g, -function(a,f,n,l,o,j,s){var f=f||"",n=n||"",m=l.toLowerCase(),r=o||"",l=j?" "+j:"",s=s||"";if(c&&!w[m])return"";l===""&&hb[m]&&(l=" /");ib[m]&&(f&&(f=" "),s&&(s=" "));Ma[m]&&(n?s="\n":f="\n");b&&m=="br"&&(s="\n");if(jb[m]&&!Ma[m])if(b){n&&i.length>0&&i[i.length-1]===m?i.pop():i.push(m);s=f="\n";o=0;for(j=n?i.length:i.length-1;o=0&&(p[a]=R(b,g));(c&&a!=="style"&&!w[m]["*"]&&!w[m][a]||m==="body"&&a==="contenteditable"||/^kindeditor_\d+$/.test(a))&&delete p[a];if(a==="style"&&b!==""){var d=M(b);h(d,function(a){c&&!w[m].style&&!w[m]["."+a]&&delete d[a]}); -var V="";h(d,function(a,c){V+=a+":"+c+";"});p.style=V}});r="";h(p,function(a,c){a==="style"&&c===""||(c=c.replace(/"/g,"""),r+=" "+a+'="'+c+'"')})}m==="font"&&(m="span");return f+"<"+n+m+r+l+">"+s}),a=a.replace(/(<(?:pre|pre\s[^>]*)>)([\s\S]*?)(<\/pre>)/ig,function(a,c,g,b){return c+g.replace(/\n/g,'\n')+b}),a=a.replace(/\n\s*\n/g,"\n"),a=a.replace(/\n/g,"\n");return m(a)}function U(a,c){a=a.replace(//ig, -"").replace(//ig,"").replace(/]*>[\s\S]*?<\/style>/ig,"").replace(/]*>[\s\S]*?<\/script>/ig,"").replace(/]+>[\s\S]*?<\/w:[^>]+>/ig,"").replace(/]+>[\s\S]*?<\/o:[^>]+>/ig,"").replace(/[\s\S]*?<\/xml>/ig,"").replace(/<(?:table|td)[^>]*>/ig,function(a){return a.replace(/border-bottom:([#\w\s]+)/ig,"border:$1")});return H(a,c)}function W(a){if(/\.(rm|rmvb)(\?|$)/i.test(a))return"audio/x-pn-realaudio-plugin";if(/\.(swf|flv)(\?|$)/i.test(a))return"application/x-shockwave-flash"; -return"video/x-ms-asf-plugin"}function S(a){return K(unescape(a))}function Na(a){var c="0&&(w+="width:"+g+"px;");/\D/.test(b)?w+="height:"+b+";":b>0&&(w+="height:"+b+"px;");g=/realaudio/i.test(d)?"ke-rm":/flash/i.test(d)?"ke-flash":"ke-media";g='';return g}function Da(a,c){if(a.nodeType==9&&c.nodeType!=9)return!0;for(;c=c.parentNode;)if(c==a)return!0;return!1}function Ea(a,c){var c=c.toLowerCase(),g=null;if(!Mb&&a.nodeName.toLowerCase()!="script"){var b=a.ownerDocument.createElement("div");b.appendChild(a.cloneNode(!1));b=K(v(b.innerHTML));c in b&&(g=b[c])}else try{g=a.getAttribute(c,2)}catch(d){g=a.getAttribute(c,1)}c==="style"&&g!==null&&(g=Q(g));return g}function Fa(a,c){function g(a){if(typeof a!="string")return a;return a.replace(/([^\w\-])/g, -"\\$1")}function b(a,c){return a==="*"||a.toLowerCase()===g(c.toLowerCase())}function d(a,c,g){var t=[];(a=(g.ownerDocument||g).getElementById(a.replace(/\\/g,"")))&&b(c,a.nodeName)&&Da(g,a)&&t.push(a);return t}function k(a,c,g){var d=g.ownerDocument||g,t=[],k,w,i;if(g.getElementsByClassName){d=g.getElementsByClassName(a.replace(/\\/g,""));k=0;for(w=d.length;k-1&&t.push(i)}return t}function w(a,c,b,d){for(var t=[],b=d.getElementsByTagName(b),V=0,k=b.length;V])+)/.exec(a))?e[1]:"*";if(e=/#((?:[\w\-]|\\.)+)$/.exec(a))g= -d(e[1],f,c);else if(e=/\.((?:[\w\-]|\\.)+)$/.exec(a))g=k(e[1],f,c);else if(e=/\[((?:[\w\-]|\\.)+)\]/.exec(a))g=w(e[1].toLowerCase(),null,f,c);else if(e=/\[((?:[\w\-]|\\.)+)\s*=\s*['"]?((?:\\.|[^'"]+)+)['"]?\]/.exec(a)){g=e[1].toLowerCase();e=e[2];if(g==="id")f=d(e,f,c);else if(g==="class")f=k(e,f,c);else if(g==="name"){g=[];e=(c.ownerDocument||c).getElementsByName(e.replace(/\\/g,""));for(var Z,h=0,l=e.length;h1){var n=[];h(f,function(){h(Fa(this,c),function(){e(this,n)<0&&n.push(this)})});return n}for(var c=c||document,f=[],l,o=/((?:\\.|[^\s>])+|[\s>])/g;l=o.exec(a);)l[1]!==" "&&f.push(l[1]);l=[];if(f.length==1)return i(f[0],c);var o=!1,m,s,j,r,p,v,q,B,E,u;v=0;for(lenth=f.length;v")o=!0;else{if(v>0){s=[];q=0;for(E=l.length;q");b.innerHTML='
      '+this.editor.getLang("elementPathTip")+": "+d.join(" > ")+"
      "}else b.style.display="none"},disableElementPath:function(){var a=this.getDom("elementpath");a.innerHTML="",a.style.display="none",this.elementPathEnabled=!1},enableElementPath:function(){var a=this.getDom("elementpath");a.style.display="",this.elementPathEnabled=!0,this._updateElementPath()},_scale:function(){function a(){o=e.getXY(h),p||(p=g.options.minFrameHeight+j.offsetHeight+k.offsetHeight),m.style.cssText="position:absolute;left:0;display:;top:0;background-color:#41ABFF;opacity:0.4;filter: Alpha(opacity=40);width:"+h.offsetWidth+"px;height:"+h.offsetHeight+"px;z-index:"+(g.options.zIndex+1),e.on(f,"mousemove",b),e.on(i,"mouseup",c),e.on(f,"mouseup",c)}function b(a){d();var b=a||window.event;r=b.pageX||f.documentElement.scrollLeft+b.clientX,s=b.pageY||f.documentElement.scrollTop+b.clientY,t=r-o.x,u=s-o.y,t>=q&&(n=!0,m.style.width=t+"px"),u>=p&&(n=!0,m.style.height=u+"px")}function c(){n&&(n=!1,g.ui._actualFrameWidth=m.offsetWidth-2,h.style.width=g.ui._actualFrameWidth+"px",g.setHeight(m.offsetHeight-k.offsetHeight-j.offsetHeight-2,!0)),m&&(m.style.display="none"),d(),e.un(f,"mousemove",b),e.un(i,"mouseup",c),e.un(f,"mouseup",c)}function d(){browser.ie?f.selection.clear():window.getSelection().removeAllRanges()}var f=document,g=this.editor,h=g.container,i=g.document,j=this.getDom("toolbarbox"),k=this.getDom("bottombar"),l=this.getDom("scale"),m=this.getDom("scalelayer"),n=!1,o=null,p=0,q=g.options.minFrameWidth,r=0,s=0,t=0,u=0,v=this;this.editor.addListener("fullscreenchanged",function(a,b){if(b)v.disableScale();else if(v.editor.options.scaleEnabled){v.enableScale();var c=v.editor.document.createElement("span");v.editor.body.appendChild(c),v.editor.body.style.height=Math.max(e.getXY(c).y,v.editor.iframe.offsetHeight-20)+"px",e.remove(c)}}),this.enableScale=function(){1!=g.queryCommandState("source")&&(l.style.display="",this.scaleEnabled=!0,e.on(l,"mousedown",a))},this.disableScale=function(){l.style.display="none",this.scaleEnabled=!1,e.un(l,"mousedown",a)}},isFullScreen:function(){return this._fullscreen},postRender:function(){d.prototype.postRender.call(this);for(var a=0;a[\n\r\t]+([ ]{4})+/g,">").replace(/[\n\r\t]+([ ]{4})+[\n\r\t]+<"),c.className&&(b.className=c.className),c.style.cssText&&(b.style.cssText=c.style.cssText),/textarea/i.test(c.tagName)?(d.textarea=c,d.textarea.style.display="none"):c.parentNode.removeChild(c),c.id&&(b.id=c.id,e.removeAttributes(c,"id")),c=b,c.innerHTML=""}e.addClass(c,"edui-"+d.options.theme),d.ui.render(c);var h=d.options;d.container=d.ui.getDom();for(var i,j=e.findParents(c,!0),k=[],l=0;i=j[l];l++)k[l]=i.style.display,i.style.display="block";if(h.initialFrameWidth)h.minFrameWidth=h.initialFrameWidth;else{h.minFrameWidth=h.initialFrameWidth=c.offsetWidth;var m=c.style.width;/%$/.test(m)&&(h.initialFrameWidth=m)}h.initialFrameHeight?h.minFrameHeight=h.initialFrameHeight:h.initialFrameHeight=h.minFrameHeight=c.offsetHeight;for(var i,l=0;i=j[l];l++)i.style.display=k[l];c.style.height&&(c.style.height=""),d.container.style.width=h.initialFrameWidth+(/%$/.test(h.initialFrameWidth)?"":"px"),d.container.style.zIndex=h.zIndex,f.call(d,d.ui.getDom("iframeholder")),d.fireEvent("afteruiready")}d.langIsReady?b():d.addListener("langReady",b)})},d},UE.getEditor=function(a,b){var c=g[a];return c||(c=g[a]=new UE.ui.Editor(b),c.render(a)),c},UE.delEditor=function(a){var b;(b=g[a])&&(b.key&&b.destroy(),delete g[a])},UE.registerUI=function(a,c,d,e){b.each(a.split(/\s+/),function(a){UE._customizeUI[a]={id:e,execFn:c,index:d}})}}(),UE.registerUI("message",function(a){function b(){var a=g.ui.getDom("toolbarbox");a&&(c.style.top=a.offsetHeight+3+"px"),c.style.zIndex=Math.max(g.options.zIndex,g.iframe.style.zIndex)+1}var c,d=baidu.editor.ui,e=d.Message,f=[],g=a;g.addListener("ready",function(){c=document.getElementById(g.ui.id+"_message_holder"),b(),setTimeout(function(){b()},500)}),g.addListener("showmessage",function(a,d){d=utils.isString(d)?{content:d}:d;var h=new e({timeout:d.timeout,type:d.type,content:d.content,keepshow:d.keepshow,editor:g}),i=d.id||"msg_"+(+new Date).toString(36);return h.render(c),f[i]=h,h.reset(d),b(),i}),g.addListener("updatemessage",function(a,b,d){d=utils.isString(d)?{content:d}:d;var e=f[b];e.render(c),e&&e.reset(d)}),g.addListener("hidemessage",function(a,b){var c=f[b];c&&c.hide()})}),UE.registerUI("autosave",function(a){var b=null,c=null;a.on("afterautosave",function(){clearTimeout(b),b=setTimeout(function(){c&&a.trigger("hidemessage",c),c=a.trigger("showmessage",{content:a.getLang("autosave.success"),timeout:2e3})},2e3)})})}(); \ No newline at end of file diff --git a/src/main/resources/static/js/ueditor/ueditor.config.js b/src/main/resources/static/js/ueditor/ueditor.config.js deleted file mode 100644 index 0c9fa96..0000000 --- a/src/main/resources/static/js/ueditor/ueditor.config.js +++ /dev/null @@ -1,497 +0,0 @@ -/** - * ueditor完整配置项 - * 可以在这里配置整个编辑器的特性 - */ -/**************************提示******************************** - * 所有被注释的配置项均为UEditor默认值。 - * 修改默认配置请首先确保已经完全明确该参数的真实用途。 - * 主要有两种修改方案,一种是取消此处注释,然后修改成对应参数;另一种是在实例化编辑器时传入对应参数。 - * 当升级编辑器时,可直接使用旧版配置文件替换新版配置文件,不用担心旧版配置文件中因缺少新功能所需的参数而导致脚本报错。 - **************************提示********************************/ - -(function () { - - /** - * 编辑器资源文件根路径。它所表示的含义是:以编辑器实例化页面为当前路径,指向编辑器资源文件(即dialog等文件夹)的路径。 - * 鉴于很多同学在使用编辑器的时候出现的种种路径问题,此处强烈建议大家使用"相对于网站根目录的相对路径"进行配置。 - * "相对于网站根目录的相对路径"也就是以斜杠开头的形如"/myProject/ueditor/"这样的路径。 - * 如果站点中有多个不在同一层级的页面需要实例化编辑器,且引用了同一UEditor的时候,此处的URL可能不适用于每个页面的编辑器。 - * 因此,UEditor提供了针对不同页面的编辑器可单独配置的根路径,具体来说,在需要实例化编辑器的页面最顶部写上如下代码即可。当然,需要令此处的URL等于对应的配置。 - * window.UEDITOR_HOME_URL = "/xxxx/xxxx/"; - */ - var URL = window.UEDITOR_HOME_URL || getUEBasePath(); - - /** - * 配置项主体。注意,此处所有涉及到路径的配置别遗漏URL变量。 - */ - window.UEDITOR_CONFIG = { - - //为编辑器实例添加一个路径,这个不能被注释 - UEDITOR_HOME_URL: URL - - // 服务器统一请求接口路径 - , serverUrl: URL + "jsp/controller.jsp" - - //工具栏上的所有的功能按钮和下拉框,可以在new编辑器的实例时选择自己需要的重新定义 - , toolbars: [[ - 'fullscreen', 'source', '|', 'undo', 'redo', '|', - 'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|', - 'rowspacingtop', 'rowspacingbottom', 'lineheight', '|', - 'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|', - 'directionalityltr', 'directionalityrtl', 'indent', '|', - 'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|', - 'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|', - 'simpleupload', 'insertimage', 'emotion', 'scrawl', 'insertvideo', 'music', 'attachment', 'map', 'gmap', 'insertframe', 'insertcode', 'webapp', 'pagebreak', 'template', 'background', '|', - 'horizontal', 'date', 'time', 'spechars', 'snapscreen', 'wordimage', '|', - 'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|', - 'print', 'preview', 'searchreplace', 'drafts', 'help' - ]] - //当鼠标放在工具栏上时显示的tooltip提示,留空支持自动多语言配置,否则以配置值为准 - //,labelMap:{ - // 'anchor':'', 'undo':'' - //} - - //语言配置项,默认是zh-cn。有需要的话也可以使用如下这样的方式来自动多语言切换,当然,前提条件是lang文件夹下存在对应的语言文件: - //lang值也可以通过自动获取 (navigator.language||navigator.browserLanguage ||navigator.userLanguage).toLowerCase() - //,lang:"zh-cn" - //,langPath:URL +"lang/" - - //主题配置项,默认是default。有需要的话也可以使用如下这样的方式来自动多主题切换,当然,前提条件是themes文件夹下存在对应的主题文件: - //现有如下皮肤:default - //,theme:'default' - //,themePath:URL +"themes/" - - //,zIndex : 900 //编辑器层级的基数,默认是900 - - //针对getAllHtml方法,会在对应的head标签中增加该编码设置。 - //,charset:"utf-8" - - //若实例化编辑器的页面手动修改的domain,此处需要设置为true - //,customDomain:false - - //常用配置项目 - //,isShow : true //默认显示编辑器 - - //,textarea:'editorValue' // 提交表单时,服务器获取编辑器提交内容的所用的参数,多实例时可以给容器name属性,会将name给定的值最为每个实例的键值,不用每次实例化的时候都设置这个值 - - //,initialContent:'欢迎使用ueditor!' //初始化编辑器的内容,也可以通过textarea/script给值,看官网例子 - - //,autoClearinitialContent:true //是否自动清除编辑器初始内容,注意:如果focus属性设置为true,这个也为真,那么编辑器一上来就会触发导致初始化的内容看不到了 - - //,focus:false //初始化时,是否让编辑器获得焦点true或false - - //如果自定义,最好给p标签如下的行高,要不输入中文时,会有跳动感 - //,initialStyle:'p{line-height:1em}'//编辑器层级的基数,可以用来改变字体等 - - //,iframeCssUrl: URL + '/themes/iframe.css' //给编辑区域的iframe引入一个css文件 - - //indentValue - //首行缩进距离,默认是2em - //,indentValue:'2em' - - //,initialFrameWidth:1000 //初始化编辑器宽度,默认1000 - //,initialFrameHeight:320 //初始化编辑器高度,默认320 - - //,readonly : false //编辑器初始化结束后,编辑区域是否是只读的,默认是false - - //,autoClearEmptyNode : true //getContent时,是否删除空的inlineElement节点(包括嵌套的情况) - - //启用自动保存 - //,enableAutoSave: true - //自动保存间隔时间, 单位ms - //,saveInterval: 500 - - //,fullscreen : false //是否开启初始化时即全屏,默认关闭 - - //,imagePopup:true //图片操作的浮层开关,默认打开 - - //,autoSyncData:true //自动同步编辑器要提交的数据 - //,emotionLocalization:false //是否开启表情本地化,默认关闭。若要开启请确保emotion文件夹下包含官网提供的images表情文件夹 - - //粘贴只保留标签,去除标签所有属性 - //,retainOnlyLabelPasted: false - - //,pasteplain:false //是否默认为纯文本粘贴。false为不使用纯文本粘贴,true为使用纯文本粘贴 - //纯文本粘贴模式下的过滤规则 - //'filterTxtRules' : function(){ - // function transP(node){ - // node.tagName = 'p'; - // node.setStyle(); - // } - // return { - // //直接删除及其字节点内容 - // '-' : 'script style object iframe embed input select', - // 'p': {$:{}}, - // 'br':{$:{}}, - // 'div':{'$':{}}, - // 'li':{'$':{}}, - // 'caption':transP, - // 'th':transP, - // 'tr':transP, - // 'h1':transP,'h2':transP,'h3':transP,'h4':transP,'h5':transP,'h6':transP, - // 'td':function(node){ - // //没有内容的td直接删掉 - // var txt = !!node.innerText(); - // if(txt){ - // node.parentNode.insertAfter(UE.uNode.createText('    '),node); - // } - // node.parentNode.removeChild(node,node.innerText()) - // } - // } - //}() - - //,allHtmlEnabled:false //提交到后台的数据是否包含整个html字符串 - - //insertorderedlist - //有序列表的下拉配置,值留空时支持多语言自动识别,若配置值,则以此值为准 - //,'insertorderedlist':{ - // //自定的样式 - // 'num':'1,2,3...', - // 'num1':'1),2),3)...', - // 'num2':'(1),(2),(3)...', - // 'cn':'一,二,三....', - // 'cn1':'一),二),三)....', - // 'cn2':'(一),(二),(三)....', - // //系统自带 - // 'decimal' : '' , //'1,2,3...' - // 'lower-alpha' : '' , // 'a,b,c...' - // 'lower-roman' : '' , //'i,ii,iii...' - // 'upper-alpha' : '' , lang //'A,B,C' - // 'upper-roman' : '' //'I,II,III...' - //} - - //insertunorderedlist - //无序列表的下拉配置,值留空时支持多语言自动识别,若配置值,则以此值为准 - //,insertunorderedlist : { //自定的样式 - // 'dash' :'— 破折号', //-破折号 - // 'dot':' 。 小圆圈', //系统自带 - // 'circle' : '', // '○ 小圆圈' - // 'disc' : '', // '● 小圆点' - // 'square' : '' //'■ 小方块' - //} - //,listDefaultPaddingLeft : '30'//默认的左边缩进的基数倍 - //,listiconpath : 'http://bs.baidu.com/listicon/'//自定义标号的路径 - //,maxListLevel : 3 //限制可以tab的级数, 设置-1为不限制 - - //,autoTransWordToList:false //禁止word中粘贴进来的列表自动变成列表标签 - - //fontfamily - //字体设置 label留空支持多语言自动切换,若配置,则以配置值为准 - //,'fontfamily':[ - // { label:'',name:'songti',val:'宋体,SimSun'}, - // { label:'',name:'kaiti',val:'楷体,楷体_GB2312, SimKai'}, - // { label:'',name:'yahei',val:'微软雅黑,Microsoft YaHei'}, - // { label:'',name:'heiti',val:'黑体, SimHei'}, - // { label:'',name:'lishu',val:'隶书, SimLi'}, - // { label:'',name:'andaleMono',val:'andale mono'}, - // { label:'',name:'arial',val:'arial, helvetica,sans-serif'}, - // { label:'',name:'arialBlack',val:'arial black,avant garde'}, - // { label:'',name:'comicSansMs',val:'comic sans ms'}, - // { label:'',name:'impact',val:'impact,chicago'}, - // { label:'',name:'timesNewRoman',val:'times new roman'} - //] - - //fontsize - //字号 - //,'fontsize':[10, 11, 12, 14, 16, 18, 20, 24, 36] - - //paragraph - //段落格式 值留空时支持多语言自动识别,若配置,则以配置值为准 - //,'paragraph':{'p':'', 'h1':'', 'h2':'', 'h3':'', 'h4':'', 'h5':'', 'h6':''} - - //rowspacingtop - //段间距 值和显示的名字相同 - //,'rowspacingtop':['5', '10', '15', '20', '25'] - - //rowspacingBottom - //段间距 值和显示的名字相同 - //,'rowspacingbottom':['5', '10', '15', '20', '25'] - - //lineheight - //行内间距 值和显示的名字相同 - //,'lineheight':['1', '1.5','1.75','2', '3', '4', '5'] - - //customstyle - //自定义样式,不支持国际化,此处配置值即可最后显示值 - //block的元素是依据设置段落的逻辑设置的,inline的元素依据BIU的逻辑设置 - //尽量使用一些常用的标签 - //参数说明 - //tag 使用的标签名字 - //label 显示的名字也是用来标识不同类型的标识符,注意这个值每个要不同, - //style 添加的样式 - //每一个对象就是一个自定义的样式 - //,'customstyle':[ - // {tag:'h1', name:'tc', label:'', style:'border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:center;margin:0 0 20px 0;'}, - // {tag:'h1', name:'tl',label:'', style:'border-bottom:#ccc 2px solid;padding:0 4px 0 0;margin:0 0 10px 0;'}, - // {tag:'span',name:'im', label:'', style:'font-style:italic;font-weight:bold'}, - // {tag:'span',name:'hi', label:'', style:'font-style:italic;font-weight:bold;color:rgb(51, 153, 204)'} - //] - - //打开右键菜单功能 - //,enableContextMenu: true - //右键菜单的内容,可以参考plugins/contextmenu.js里边的默认菜单的例子,label留空支持国际化,否则以此配置为准 - //,contextMenu:[ - // { - // label:'', //显示的名称 - // cmdName:'selectall',//执行的command命令,当点击这个右键菜单时 - // //exec可选,有了exec就会在点击时执行这个function,优先级高于cmdName - // exec:function () { - // //this是当前编辑器的实例 - // //this.ui._dialogs['inserttableDialog'].open(); - // } - // } - //] - - //快捷菜单 - //,shortcutMenu:["fontfamily", "fontsize", "bold", "italic", "underline", "forecolor", "backcolor", "insertorderedlist", "insertunorderedlist"] - - //elementPathEnabled - //是否启用元素路径,默认是显示 - //,elementPathEnabled : true - - //wordCount - //,wordCount:true //是否开启字数统计 - //,maximumWords:10000 //允许的最大字符数 - //字数统计提示,{#count}代表当前字数,{#leave}代表还可以输入多少字符数,留空支持多语言自动切换,否则按此配置显示 - //,wordCountMsg:'' //当前已输入 {#count} 个字符,您还可以输入{#leave} 个字符 - //超出字数限制提示 留空支持多语言自动切换,否则按此配置显示 - //,wordOverFlowMsg:'' //你输入的字符个数已经超出最大允许值,服务器可能会拒绝保存! - - //tab - //点击tab键时移动的距离,tabSize倍数,tabNode什么字符做为单位 - //,tabSize:4 - //,tabNode:' ' - - //removeFormat - //清除格式时可以删除的标签和属性 - //removeForamtTags标签 - //,removeFormatTags:'b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var' - //removeFormatAttributes属性 - //,removeFormatAttributes:'class,style,lang,width,height,align,hspace,valign' - - //undo - //可以最多回退的次数,默认20 - //,maxUndoCount:20 - //当输入的字符数超过该值时,保存一次现场 - //,maxInputCount:1 - - //autoHeightEnabled - // 是否自动长高,默认true - //,autoHeightEnabled:true - - //scaleEnabled - //是否可以拉伸长高,默认true(当开启时,自动长高失效) - //,scaleEnabled:false - //,minFrameWidth:800 //编辑器拖动时最小宽度,默认800 - //,minFrameHeight:220 //编辑器拖动时最小高度,默认220 - - //autoFloatEnabled - //是否保持toolbar的位置不动,默认true - //,autoFloatEnabled:true - //浮动时工具栏距离浏览器顶部的高度,用于某些具有固定头部的页面 - //,topOffset:30 - //编辑器底部距离工具栏高度(如果参数大于等于编辑器高度,则设置无效) - //,toolbarTopOffset:400 - - //设置远程图片是否抓取到本地保存 - //,catchRemoteImageEnable: true //设置是否抓取远程图片 - - //pageBreakTag - //分页标识符,默认是_ueditor_page_break_tag_ - //,pageBreakTag:'_ueditor_page_break_tag_' - - //autotypeset - //自动排版参数 - //,autotypeset: { - // mergeEmptyline: true, //合并空行 - // removeClass: true, //去掉冗余的class - // removeEmptyline: false, //去掉空行 - // textAlign:"left", //段落的排版方式,可以是 left,right,center,justify 去掉这个属性表示不执行排版 - // imageBlockLine: 'center', //图片的浮动方式,独占一行剧中,左右浮动,默认: center,left,right,none 去掉这个属性表示不执行排版 - // pasteFilter: false, //根据规则过滤没事粘贴进来的内容 - // clearFontSize: false, //去掉所有的内嵌字号,使用编辑器默认的字号 - // clearFontFamily: false, //去掉所有的内嵌字体,使用编辑器默认的字体 - // removeEmptyNode: false, // 去掉空节点 - // //可以去掉的标签 - // removeTagNames: {标签名字:1}, - // indent: false, // 行首缩进 - // indentValue : '2em', //行首缩进的大小 - // bdc2sb: false, - // tobdc: false - //} - - //tableDragable - //表格是否可以拖拽 - //,tableDragable: true - - - - //sourceEditor - //源码的查看方式,codemirror 是代码高亮,textarea是文本框,默认是codemirror - //注意默认codemirror只能在ie8+和非ie中使用 - //,sourceEditor:"codemirror" - //如果sourceEditor是codemirror,还用配置一下两个参数 - //codeMirrorJsUrl js加载的路径,默认是 URL + "third-party/codemirror/codemirror.js" - //,codeMirrorJsUrl:URL + "third-party/codemirror/codemirror.js" - //codeMirrorCssUrl css加载的路径,默认是 URL + "third-party/codemirror/codemirror.css" - //,codeMirrorCssUrl:URL + "third-party/codemirror/codemirror.css" - //编辑器初始化完成后是否进入源码模式,默认为否。 - //,sourceEditorFirst:false - - //iframeUrlMap - //dialog内容的路径 ~会被替换成URL,垓属性一旦打开,将覆盖所有的dialog的默认路径 - //,iframeUrlMap:{ - // 'anchor':'~/dialogs/anchor/anchor.html', - //} - - //allowLinkProtocol 允许的链接地址,有这些前缀的链接地址不会自动添加http - //, allowLinkProtocols: ['http:', 'https:', '#', '/', 'ftp:', 'mailto:', 'tel:', 'git:', 'svn:'] - - //webAppKey 百度应用的APIkey,每个站长必须首先去百度官网注册一个key后方能正常使用app功能,注册介绍,http://app.baidu.com/static/cms/getapikey.html - //, webAppKey: "" - - //默认过滤规则相关配置项目 - //,disabledTableInTable:true //禁止表格嵌套 - //,allowDivTransToP:true //允许进入编辑器的div标签自动变成p标签 - //,rgb2Hex:true //默认产出的数据中的color自动从rgb格式变成16进制格式 - - // xss 过滤是否开启,inserthtml等操作 - ,xssFilterRules: true - //input xss过滤 - ,inputXssFilter: true - //output xss过滤 - ,outputXssFilter: true - // xss过滤白名单 名单来源: https://raw.githubusercontent.com/leizongmin/js-xss/master/lib/default.js - ,whitList: { - a: ['target', 'href', 'title', 'class', 'style'], - abbr: ['title', 'class', 'style'], - address: ['class', 'style'], - area: ['shape', 'coords', 'href', 'alt'], - article: [], - aside: [], - audio: ['autoplay', 'controls', 'loop', 'preload', 'src', 'class', 'style'], - b: ['class', 'style'], - bdi: ['dir'], - bdo: ['dir'], - big: [], - blockquote: ['cite', 'class', 'style'], - br: [], - caption: ['class', 'style'], - center: [], - cite: [], - code: ['class', 'style'], - col: ['align', 'valign', 'span', 'width', 'class', 'style'], - colgroup: ['align', 'valign', 'span', 'width', 'class', 'style'], - dd: ['class', 'style'], - del: ['datetime'], - details: ['open'], - div: ['class', 'style'], - dl: ['class', 'style'], - dt: ['class', 'style'], - em: ['class', 'style'], - font: ['color', 'size', 'face'], - footer: [], - h1: ['class', 'style'], - h2: ['class', 'style'], - h3: ['class', 'style'], - h4: ['class', 'style'], - h5: ['class', 'style'], - h6: ['class', 'style'], - header: [], - hr: [], - i: ['class', 'style'], - img: ['src', 'alt', 'title', 'width', 'height', 'id', '_src', 'loadingclass', 'class', 'data-latex'], - ins: ['datetime'], - li: ['class', 'style'], - mark: [], - nav: [], - ol: ['class', 'style'], - p: ['class', 'style'], - pre: ['class', 'style'], - s: [], - section:[], - small: [], - span: ['class', 'style'], - sub: ['class', 'style'], - sup: ['class', 'style'], - strong: ['class', 'style'], - table: ['width', 'border', 'align', 'valign', 'class', 'style'], - tbody: ['align', 'valign', 'class', 'style'], - td: ['width', 'rowspan', 'colspan', 'align', 'valign', 'class', 'style'], - tfoot: ['align', 'valign', 'class', 'style'], - th: ['width', 'rowspan', 'colspan', 'align', 'valign', 'class', 'style'], - thead: ['align', 'valign', 'class', 'style'], - tr: ['rowspan', 'align', 'valign', 'class', 'style'], - tt: [], - u: [], - ul: ['class', 'style'], - video: ['autoplay', 'controls', 'loop', 'preload', 'src', 'height', 'width', 'class', 'style'] - } - }; - - function getUEBasePath(docUrl, confUrl) { - - return getBasePath(docUrl || self.document.URL || self.location.href, confUrl || getConfigFilePath()); - - } - - function getConfigFilePath() { - - var configPath = document.getElementsByTagName('script'); - - return configPath[ configPath.length - 1 ].src; - - } - - function getBasePath(docUrl, confUrl) { - - var basePath = confUrl; - - - if (/^(\/|\\\\)/.test(confUrl)) { - - basePath = /^.+?\w(\/|\\\\)/.exec(docUrl)[0] + confUrl.replace(/^(\/|\\\\)/, ''); - - } else if (!/^[a-z]+:/i.test(confUrl)) { - - docUrl = docUrl.split("#")[0].split("?")[0].replace(/[^\\\/]+$/, ''); - - basePath = docUrl + "" + confUrl; - - } - - return optimizationPath(basePath); - - } - - function optimizationPath(path) { - - var protocol = /^[a-z]+:\/\//.exec(path)[ 0 ], - tmp = null, - res = []; - - path = path.replace(protocol, "").split("?")[0].split("#")[0]; - - path = path.replace(/\\/g, '/').split(/\//); - - path[ path.length - 1 ] = ""; - - while (path.length) { - - if (( tmp = path.shift() ) === "..") { - res.pop(); - } else if (tmp !== ".") { - res.push(tmp); - } - - } - - return protocol + res.join("/"); - - } - - window.UE = { - getUEBasePath: getUEBasePath - }; - -})(); diff --git a/src/main/resources/static/js/ueditor/ueditor.parse.js b/src/main/resources/static/js/ueditor/ueditor.parse.js deleted file mode 100644 index 84421f2..0000000 --- a/src/main/resources/static/js/ueditor/ueditor.parse.js +++ /dev/null @@ -1,1022 +0,0 @@ -/*! - * UEditor - * version: ueditor - * build: Wed Aug 10 2016 11:06:16 GMT+0800 (CST) - */ - -(function(){ - -(function(){ - UE = window.UE || {}; - var isIE = !!window.ActiveXObject; - //定义utils工具 - var utils = { - removeLastbs : function(url){ - return url.replace(/\/$/,'') - }, - extend : function(t,s){ - var a = arguments, - notCover = this.isBoolean(a[a.length - 1]) ? a[a.length - 1] : false, - len = this.isBoolean(a[a.length - 1]) ? a.length - 1 : a.length; - for (var i = 1; i < len; i++) { - var x = a[i]; - for (var k in x) { - if (!notCover || !t.hasOwnProperty(k)) { - t[k] = x[k]; - } - } - } - return t; - }, - isIE : isIE, - cssRule : isIE ? function(key,style,doc){ - var indexList,index; - doc = doc || document; - if(doc.indexList){ - indexList = doc.indexList; - }else{ - indexList = doc.indexList = {}; - } - var sheetStyle; - if(!indexList[key]){ - if(style === undefined){ - return '' - } - sheetStyle = doc.createStyleSheet('',index = doc.styleSheets.length); - indexList[key] = index; - }else{ - sheetStyle = doc.styleSheets[indexList[key]]; - } - if(style === undefined){ - return sheetStyle.cssText - } - sheetStyle.cssText = sheetStyle.cssText + '\n' + (style || '') - } : function(key,style,doc){ - doc = doc || document; - var head = doc.getElementsByTagName('head')[0],node; - if(!(node = doc.getElementById(key))){ - if(style === undefined){ - return '' - } - node = doc.createElement('style'); - node.id = key; - head.appendChild(node) - } - if(style === undefined){ - return node.innerHTML - } - if(style !== ''){ - node.innerHTML = node.innerHTML + '\n' + style; - }else{ - head.removeChild(node) - } - }, - domReady : function (onready) { - var doc = window.document; - if (doc.readyState === "complete") { - onready(); - }else{ - if (isIE) { - (function () { - if (doc.isReady) return; - try { - doc.documentElement.doScroll("left"); - } catch (error) { - setTimeout(arguments.callee, 0); - return; - } - onready(); - })(); - window.attachEvent('onload', function(){ - onready() - }); - } else { - doc.addEventListener("DOMContentLoaded", function () { - doc.removeEventListener("DOMContentLoaded", arguments.callee, false); - onready(); - }, false); - window.addEventListener('load', function(){onready()}, false); - } - } - - }, - each : function(obj, iterator, context) { - if (obj == null) return; - if (obj.length === +obj.length) { - for (var i = 0, l = obj.length; i < l; i++) { - if(iterator.call(context, obj[i], i, obj) === false) - return false; - } - } else { - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - if(iterator.call(context, obj[key], key, obj) === false) - return false; - } - } - } - }, - inArray : function(arr,item){ - var index = -1; - this.each(arr,function(v,i){ - if(v === item){ - index = i; - return false; - } - }); - return index; - }, - pushItem : function(arr,item){ - if(this.inArray(arr,item)==-1){ - arr.push(item) - } - }, - trim: function (str) { - return str.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g, ''); - }, - indexOf: function (array, item, start) { - var index = -1; - start = this.isNumber(start) ? start : 0; - this.each(array, function (v, i) { - if (i >= start && v === item) { - index = i; - return false; - } - }); - return index; - }, - hasClass: function (element, className) { - className = className.replace(/(^[ ]+)|([ ]+$)/g, '').replace(/[ ]{2,}/g, ' ').split(' '); - for (var i = 0, ci, cls = element.className; ci = className[i++];) { - if (!new RegExp('\\b' + ci + '\\b', 'i').test(cls)) { - return false; - } - } - return i - 1 == className.length; - }, - addClass:function (elm, classNames) { - if(!elm)return; - classNames = this.trim(classNames).replace(/[ ]{2,}/g,' ').split(' '); - for(var i = 0,ci,cls = elm.className;ci=classNames[i++];){ - if(!new RegExp('\\b' + ci + '\\b').test(cls)){ - cls += ' ' + ci; - } - } - elm.className = utils.trim(cls); - }, - removeClass:function (elm, classNames) { - classNames = this.isArray(classNames) ? classNames : - this.trim(classNames).replace(/[ ]{2,}/g,' ').split(' '); - for(var i = 0,ci,cls = elm.className;ci=classNames[i++];){ - cls = cls.replace(new RegExp('\\b' + ci + '\\b'),'') - } - cls = this.trim(cls).replace(/[ ]{2,}/g,' '); - elm.className = cls; - !cls && elm.removeAttribute('className'); - }, - on: function (element, type, handler) { - var types = this.isArray(type) ? type : type.split(/\s+/), - k = types.length; - if (k) while (k--) { - type = types[k]; - if (element.addEventListener) { - element.addEventListener(type, handler, false); - } else { - if (!handler._d) { - handler._d = { - els : [] - }; - } - var key = type + handler.toString(),index = utils.indexOf(handler._d.els,element); - if (!handler._d[key] || index == -1) { - if(index == -1){ - handler._d.els.push(element); - } - if(!handler._d[key]){ - handler._d[key] = function (evt) { - return handler.call(evt.srcElement, evt || window.event); - }; - } - - - element.attachEvent('on' + type, handler._d[key]); - } - } - } - element = null; - }, - off: function (element, type, handler) { - var types = this.isArray(type) ? type : type.split(/\s+/), - k = types.length; - if (k) while (k--) { - type = types[k]; - if (element.removeEventListener) { - element.removeEventListener(type, handler, false); - } else { - var key = type + handler.toString(); - try{ - element.detachEvent('on' + type, handler._d ? handler._d[key] : handler); - }catch(e){} - if (handler._d && handler._d[key]) { - var index = utils.indexOf(handler._d.els,element); - if(index!=-1){ - handler._d.els.splice(index,1); - } - handler._d.els.length == 0 && delete handler._d[key]; - } - } - } - }, - loadFile : function () { - var tmpList = []; - function getItem(doc,obj){ - try{ - for(var i= 0,ci;ci=tmpList[i++];){ - if(ci.doc === doc && ci.url == (obj.src || obj.href)){ - return ci; - } - } - }catch(e){ - return null; - } - - } - return function (doc, obj, fn) { - var item = getItem(doc,obj); - if (item) { - if(item.ready){ - fn && fn(); - }else{ - item.funs.push(fn) - } - return; - } - tmpList.push({ - doc:doc, - url:obj.src||obj.href, - funs:[fn] - }); - if (!doc.body) { - var html = []; - for(var p in obj){ - if(p == 'tag')continue; - html.push(p + '="' + obj[p] + '"') - } - doc.write('<' + obj.tag + ' ' + html.join(' ') + ' >'); - return; - } - if (obj.id && doc.getElementById(obj.id)) { - return; - } - var element = doc.createElement(obj.tag); - delete obj.tag; - for (var p in obj) { - element.setAttribute(p, obj[p]); - } - element.onload = element.onreadystatechange = function () { - if (!this.readyState || /loaded|complete/.test(this.readyState)) { - item = getItem(doc,obj); - if (item.funs.length > 0) { - item.ready = 1; - for (var fi; fi = item.funs.pop();) { - fi(); - } - } - element.onload = element.onreadystatechange = null; - } - }; - element.onerror = function(){ - throw Error('The load '+(obj.href||obj.src)+' fails,check the url') - }; - doc.getElementsByTagName("head")[0].appendChild(element); - } - }() - }; - utils.each(['String', 'Function', 'Array', 'Number', 'RegExp', 'Object','Boolean'], function (v) { - utils['is' + v] = function (obj) { - return Object.prototype.toString.apply(obj) == '[object ' + v + ']'; - } - }); - var parselist = {}; - UE.parse = { - register : function(parseName,fn){ - parselist[parseName] = fn; - }, - load : function(opt){ - utils.each(parselist,function(v){ - v.call(opt,utils); - }) - } - }; - uParse = function(selector,opt){ - utils.domReady(function(){ - var contents; - if(document.querySelectorAll){ - contents = document.querySelectorAll(selector) - }else{ - if(/^#/.test(selector)){ - contents = [document.getElementById(selector.replace(/^#/,''))] - }else if(/^\./.test(selector)){ - var contents = []; - utils.each(document.getElementsByTagName('*'),function(node){ - if(node.className && new RegExp('\\b' + selector.replace(/^\./,'') + '\\b','i').test(node.className)){ - contents.push(node) - } - }) - }else{ - contents = document.getElementsByTagName(selector) - } - } - utils.each(contents,function(v){ - UE.parse.load(utils.extend({root:v,selector:selector},opt)) - }) - }) - } -})(); - -UE.parse.register('insertcode',function(utils){ - var pres = this.root.getElementsByTagName('pre'); - if(pres.length){ - if(typeof XRegExp == "undefined"){ - var jsurl,cssurl; - if(this.rootPath !== undefined){ - jsurl = utils.removeLastbs(this.rootPath) + '/third-party/SyntaxHighlighter/shCore.js'; - cssurl = utils.removeLastbs(this.rootPath) + '/third-party/SyntaxHighlighter/shCoreDefault.css'; - }else{ - jsurl = this.highlightJsUrl; - cssurl = this.highlightCssUrl; - } - utils.loadFile(document,{ - id : "syntaxhighlighter_css", - tag : "link", - rel : "stylesheet", - type : "text/css", - href : cssurl - }); - utils.loadFile(document,{ - id : "syntaxhighlighter_js", - src : jsurl, - tag : "script", - type : "text/javascript", - defer : "defer" - },function(){ - utils.each(pres,function(pi){ - if(pi && /brush/i.test(pi.className)){ - SyntaxHighlighter.highlight(pi); - } - }); - }); - }else{ - utils.each(pres,function(pi){ - if(pi && /brush/i.test(pi.className)){ - SyntaxHighlighter.highlight(pi); - } - }); - } - } - -}); -UE.parse.register('table', function (utils) { - var me = this, - root = this.root, - tables = root.getElementsByTagName('table'); - if (tables.length) { - var selector = this.selector; - //追加默认的表格样式 - utils.cssRule('table', - selector + ' table.noBorderTable td,' + - selector + ' table.noBorderTable th,' + - selector + ' table.noBorderTable caption{border:1px dashed #ddd !important}' + - selector + ' table.sortEnabled tr.firstRow th,' + selector + ' table.sortEnabled tr.firstRow td{padding-right:20px; background-repeat: no-repeat;' + - 'background-position: center right; background-image:url(' + this.rootPath + 'themes/default/images/sortable.png);}' + - selector + ' table.sortEnabled tr.firstRow th:hover,' + selector + ' table.sortEnabled tr.firstRow td:hover{background-color: #EEE;}' + - selector + ' table{margin-bottom:10px;border-collapse:collapse;display:table;}' + - selector + ' td,' + selector + ' th{ background:white; padding: 5px 10px;border: 1px solid #DDD;}' + - selector + ' caption{border:1px dashed #DDD;border-bottom:0;padding:3px;text-align:center;}' + - selector + ' th{border-top:1px solid #BBB;background:#F7F7F7;}' + - selector + ' table tr.firstRow th{border-top:2px solid #BBB;background:#F7F7F7;}' + - selector + ' tr.ue-table-interlace-color-single td{ background: #fcfcfc; }' + - selector + ' tr.ue-table-interlace-color-double td{ background: #f7faff; }' + - selector + ' td p{margin:0;padding:0;}', - document); - //填充空的单元格 - - utils.each('td th caption'.split(' '), function (tag) { - var cells = root.getElementsByTagName(tag); - cells.length && utils.each(cells, function (node) { - if (!node.firstChild) { - node.innerHTML = ' '; - - } - }) - }); - - //表格可排序 - var tables = root.getElementsByTagName('table'); - utils.each(tables, function (table) { - if (/\bsortEnabled\b/.test(table.className)) { - utils.on(table, 'click', function(e){ - var target = e.target || e.srcElement, - cell = findParentByTagName(target, ['td', 'th']); - var table = findParentByTagName(target, 'table'), - colIndex = utils.indexOf(table.rows[0].cells, cell), - sortType = table.getAttribute('data-sort-type'); - if(colIndex != -1) { - sortTable(table, colIndex, me.tableSortCompareFn || sortType); - updateTable(table); - } - }); - } - }); - - //按照标签名查找父节点 - function findParentByTagName(target, tagNames) { - var i, current = target; - tagNames = utils.isArray(tagNames) ? tagNames:[tagNames]; - while(current){ - for(i = 0;i < tagNames.length; i++) { - if(current.tagName == tagNames[i].toUpperCase()) return current; - } - current = current.parentNode; - } - return null; - } - //表格排序 - function sortTable(table, sortByCellIndex, compareFn) { - var rows = table.rows, - trArray = [], - flag = rows[0].cells[0].tagName === "TH", - lastRowIndex = 0; - - for (var i = 0,len = rows.length; i < len; i++) { - trArray[i] = rows[i]; - } - - var Fn = { - 'reversecurrent': function(td1,td2){ - return 1; - }, - 'orderbyasc': function(td1,td2){ - var value1 = td1.innerText||td1.textContent, - value2 = td2.innerText||td2.textContent; - return value1.localeCompare(value2); - }, - 'reversebyasc': function(td1,td2){ - var value1 = td1.innerHTML, - value2 = td2.innerHTML; - return value2.localeCompare(value1); - }, - 'orderbynum': function(td1,td2){ - var value1 = td1[utils.isIE ? 'innerText':'textContent'].match(/\d+/), - value2 = td2[utils.isIE ? 'innerText':'textContent'].match(/\d+/); - if(value1) value1 = +value1[0]; - if(value2) value2 = +value2[0]; - return (value1||0) - (value2||0); - }, - 'reversebynum': function(td1,td2){ - var value1 = td1[utils.isIE ? 'innerText':'textContent'].match(/\d+/), - value2 = td2[utils.isIE ? 'innerText':'textContent'].match(/\d+/); - if(value1) value1 = +value1[0]; - if(value2) value2 = +value2[0]; - return (value2||0) - (value1||0); - } - }; - - //对表格设置排序的标记data-sort-type - table.setAttribute('data-sort-type', compareFn && typeof compareFn === "string" && Fn[compareFn] ? compareFn:''); - - //th不参与排序 - flag && trArray.splice(0, 1); - trArray = sort(trArray,function (tr1, tr2) { - var result; - if (compareFn && typeof compareFn === "function") { - result = compareFn.call(this, tr1.cells[sortByCellIndex], tr2.cells[sortByCellIndex]); - } else if (compareFn && typeof compareFn === "number") { - result = 1; - } else if (compareFn && typeof compareFn === "string" && Fn[compareFn]) { - result = Fn[compareFn].call(this, tr1.cells[sortByCellIndex], tr2.cells[sortByCellIndex]); - } else { - result = Fn['orderbyasc'].call(this, tr1.cells[sortByCellIndex], tr2.cells[sortByCellIndex]); - } - return result; - }); - var fragment = table.ownerDocument.createDocumentFragment(); - for (var j = 0, len = trArray.length; j < len; j++) { - fragment.appendChild(trArray[j]); - } - var tbody = table.getElementsByTagName("tbody")[0]; - if(!lastRowIndex){ - tbody.appendChild(fragment); - }else{ - tbody.insertBefore(fragment,rows[lastRowIndex- range.endRowIndex + range.beginRowIndex - 1]) - } - } - //冒泡排序 - function sort(array, compareFn){ - compareFn = compareFn || function(item1, item2){ return item1.localeCompare(item2);}; - for(var i= 0,len = array.length; i 0){ - var t = array[i]; - array[i] = array[j]; - array[j] = t; - } - } - } - return array; - } - //更新表格 - function updateTable(table) { - //给第一行设置firstRow的样式名称,在排序图标的样式上使用到 - if(!utils.hasClass(table.rows[0], "firstRow")) { - for(var i = 1; i< table.rows.length; i++) { - utils.removeClass(table.rows[i], "firstRow"); - } - utils.addClass(table.rows[0], "firstRow"); - } - } - } -}); -UE.parse.register('charts',function( utils ){ - - utils.cssRule('chartsContainerHeight','.edui-chart-container { height:'+(this.chartContainerHeight||300)+'px}'); - var resourceRoot = this.rootPath, - containers = this.root, - sources = null; - - //不存在指定的根路径, 则直接退出 - if ( !resourceRoot ) { - return; - } - - if ( sources = parseSources() ) { - - loadResources(); - - } - - - function parseSources () { - - if ( !containers ) { - return null; - } - - return extractChartData( containers ); - - } - - /** - * 提取数据 - */ - function extractChartData ( rootNode ) { - - var data = [], - tables = rootNode.getElementsByTagName( "table" ); - - for ( var i = 0, tableNode; tableNode = tables[ i ]; i++ ) { - - if ( tableNode.getAttribute( "data-chart" ) !== null ) { - - data.push( formatData( tableNode ) ); - - } - - } - - return data.length ? data : null; - - } - - function formatData ( tableNode ) { - - var meta = tableNode.getAttribute( "data-chart" ), - metaConfig = {}, - data = []; - - //提取table数据 - for ( var i = 0, row; row = tableNode.rows[ i ]; i++ ) { - - var rowData = []; - - for ( var j = 0, cell; cell = row.cells[ j ]; j++ ) { - - var value = ( cell.innerText || cell.textContent || '' ); - rowData.push( cell.tagName == 'TH' ? value:(value | 0) ); - - } - - data.push( rowData ); - - } - - //解析元信息 - meta = meta.split( ";" ); - for ( var i = 0, metaData; metaData = meta[ i ]; i++ ) { - - metaData = metaData.split( ":" ); - metaConfig[ metaData[ 0 ] ] = metaData[ 1 ]; - - } - - - return { - table: tableNode, - meta: metaConfig, - data: data - }; - - } - - //加载资源 - function loadResources () { - - loadJQuery(); - - } - - function loadJQuery () { - - //不存在jquery, 则加载jquery - if ( !window.jQuery ) { - - utils.loadFile(document,{ - src : resourceRoot + "/third-party/jquery-1.10.2.min.js", - tag : "script", - type : "text/javascript", - defer : "defer" - },function(){ - - loadHighcharts(); - - }); - - } else { - - loadHighcharts(); - - } - - } - - function loadHighcharts () { - - //不存在Highcharts, 则加载Highcharts - if ( !window.Highcharts ) { - - utils.loadFile(document,{ - src : resourceRoot + "/third-party/highcharts/highcharts.js", - tag : "script", - type : "text/javascript", - defer : "defer" - },function(){ - - loadTypeConfig(); - - }); - - } else { - - loadTypeConfig(); - - } - - } - - //加载图表差异化配置文件 - function loadTypeConfig () { - - utils.loadFile(document,{ - src : resourceRoot + "/dialogs/charts/chart.config.js", - tag : "script", - type : "text/javascript", - defer : "defer" - },function(){ - - render(); - - }); - - } - - //渲染图表 - function render () { - - var config = null, - chartConfig = null, - container = null; - - for ( var i = 0, len = sources.length; i < len; i++ ) { - - config = sources[ i ]; - - chartConfig = analysisConfig( config ); - - container = createContainer( config.table ); - - renderChart( container, typeConfig[ config.meta.chartType ], chartConfig ); - - } - - - } - - /** - * 渲染图表 - * @param container 图表容器节点对象 - * @param typeConfig 图表类型配置 - * @param config 图表通用配置 - * */ - function renderChart ( container, typeConfig, config ) { - - - $( container ).highcharts( $.extend( {}, typeConfig, { - - credits: { - enabled: false - }, - exporting: { - enabled: false - }, - title: { - text: config.title, - x: -20 //center - }, - subtitle: { - text: config.subTitle, - x: -20 - }, - xAxis: { - title: { - text: config.xTitle - }, - categories: config.categories - }, - yAxis: { - title: { - text: config.yTitle - }, - plotLines: [{ - value: 0, - width: 1, - color: '#808080' - }] - }, - tooltip: { - enabled: true, - valueSuffix: config.suffix - }, - legend: { - layout: 'vertical', - align: 'right', - verticalAlign: 'middle', - borderWidth: 1 - }, - series: config.series - - } )); - - } - - /** - * 创建图表的容器 - * 新创建的容器会替换掉对应的table对象 - * */ - function createContainer ( tableNode ) { - - var container = document.createElement( "div" ); - container.className = "edui-chart-container"; - - tableNode.parentNode.replaceChild( container, tableNode ); - - return container; - - } - - //根据config解析出正确的类别和图表数据信息 - function analysisConfig ( config ) { - - var series = [], - //数据类别 - categories = [], - result = [], - data = config.data, - meta = config.meta; - - //数据对齐方式为相反的方式, 需要反转数据 - if ( meta.dataFormat != "1" ) { - - for ( var i = 0, len = data.length; i < len ; i++ ) { - - for ( var j = 0, jlen = data[ i ].length; j < jlen; j++ ) { - - if ( !result[ j ] ) { - result[ j ] = []; - } - - result[ j ][ i ] = data[ i ][ j ]; - - } - - } - - data = result; - - } - - result = {}; - - //普通图表 - if ( meta.chartType != typeConfig.length - 1 ) { - - categories = data[ 0 ].slice( 1 ); - - for ( var i = 1, curData; curData = data[ i ]; i++ ) { - series.push( { - name: curData[ 0 ], - data: curData.slice( 1 ) - } ); - } - - result.series = series; - result.categories = categories; - result.title = meta.title; - result.subTitle = meta.subTitle; - result.xTitle = meta.xTitle; - result.yTitle = meta.yTitle; - result.suffix = meta.suffix; - - } else { - - var curData = []; - - for ( var i = 1, len = data[ 0 ].length; i < len; i++ ) { - - curData.push( [ data[ 0 ][ i ], data[ 1 ][ i ] | 0 ] ); - - } - - //饼图 - series[ 0 ] = { - type: 'pie', - name: meta.tip, - data: curData - }; - - result.series = series; - result.title = meta.title; - result.suffix = meta.suffix; - - } - - return result; - - } - -}); -UE.parse.register('background', function (utils) { - var me = this, - root = me.root, - p = root.getElementsByTagName('p'), - styles; - - for (var i = 0,ci; ci = p[i++];) { - styles = ci.getAttribute('data-background'); - if (styles){ - ci.parentNode.removeChild(ci); - } - } - - //追加默认的表格样式 - styles && utils.cssRule('ueditor_background', me.selector + '{' + styles + '}', document); -}); -UE.parse.register('list',function(utils){ - var customCss = [], - customStyle = { - 'cn' : 'cn-1-', - 'cn1' : 'cn-2-', - 'cn2' : 'cn-3-', - 'num' : 'num-1-', - 'num1' : 'num-2-', - 'num2' : 'num-3-', - 'dash' : 'dash', - 'dot' : 'dot' - }; - - - utils.extend(this,{ - liiconpath : 'http://bs.baidu.com/listicon/', - listDefaultPaddingLeft : '20' - }); - - var root = this.root, - ols = root.getElementsByTagName('ol'), - uls = root.getElementsByTagName('ul'), - selector = this.selector; - - if(ols.length){ - applyStyle.call(this,ols); - } - - if(uls.length){ - applyStyle.call(this,uls); - } - - if(ols.length || uls.length){ - customCss.push(selector +' .list-paddingleft-1{padding-left:0}'); - customCss.push(selector +' .list-paddingleft-2{padding-left:'+ this.listDefaultPaddingLeft+'px}'); - customCss.push(selector +' .list-paddingleft-3{padding-left:'+ this.listDefaultPaddingLeft*2+'px}'); - - utils.cssRule('list', selector +' ol,'+selector +' ul{margin:0;padding:0;}li{clear:both;}'+customCss.join('\n'), document); - } - function applyStyle(nodes){ - var T = this; - utils.each(nodes,function(list){ - if(list.className && /custom_/i.test(list.className)){ - var listStyle = list.className.match(/custom_(\w+)/)[1]; - if(listStyle == 'dash' || listStyle == 'dot'){ - utils.pushItem(customCss,selector +' li.list-' + customStyle[listStyle] + '{background-image:url(' + T.liiconpath +customStyle[listStyle]+'.gif)}'); - utils.pushItem(customCss,selector +' ul.custom_'+listStyle+'{list-style:none;} '+ selector +' ul.custom_'+listStyle+' li{background-position:0 3px;background-repeat:no-repeat}'); - - }else{ - var index = 1; - utils.each(list.childNodes,function(li){ - if(li.tagName == 'LI'){ - utils.pushItem(customCss,selector + ' li.list-' + customStyle[listStyle] + index + '{background-image:url(' + T.liiconpath + 'list-'+customStyle[listStyle] +index + '.gif)}'); - index++; - } - }); - utils.pushItem(customCss,selector + ' ol.custom_'+listStyle+'{list-style:none;}'+selector+' ol.custom_'+listStyle+' li{background-position:0 3px;background-repeat:no-repeat}'); - } - switch(listStyle){ - case 'cn': - utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-1{padding-left:25px}'); - utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-2{padding-left:40px}'); - utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-3{padding-left:55px}'); - break; - case 'cn1': - utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-1{padding-left:30px}'); - utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-2{padding-left:40px}'); - utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-3{padding-left:55px}'); - break; - case 'cn2': - utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-1{padding-left:40px}'); - utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-2{padding-left:55px}'); - utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-3{padding-left:68px}'); - break; - case 'num': - case 'num1': - utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-1{padding-left:25px}'); - break; - case 'num2': - utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-1{padding-left:35px}'); - utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-2{padding-left:40px}'); - break; - case 'dash': - utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft{padding-left:35px}'); - break; - case 'dot': - utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft{padding-left:20px}'); - } - } - }); - } - - -}); -UE.parse.register('vedio',function(utils){ - var video = this.root.getElementsByTagName('video'), - audio = this.root.getElementsByTagName('audio'); - - document.createElement('video');document.createElement('audio'); - if(video.length || audio.length){ - var sourcePath = utils.removeLastbs(this.rootPath), - jsurl = sourcePath + '/third-party/video-js/video.js', - cssurl = sourcePath + '/third-party/video-js/video-js.min.css', - swfUrl = sourcePath + '/third-party/video-js/video-js.swf'; - - if(window.videojs) { - videojs.autoSetup(); - } else { - utils.loadFile(document,{ - id : "video_css", - tag : "link", - rel : "stylesheet", - type : "text/css", - href : cssurl - }); - utils.loadFile(document,{ - id : "video_js", - src : jsurl, - tag : "script", - type : "text/javascript" - },function(){ - videojs.options.flash.swf = swfUrl; - videojs.autoSetup(); - }); - } - - } -}); - -})(); diff --git a/src/main/resources/static/js/ueditor/ueditor.parse.min.js b/src/main/resources/static/js/ueditor/ueditor.parse.min.js deleted file mode 100644 index 9fe9a08..0000000 --- a/src/main/resources/static/js/ueditor/ueditor.parse.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * UEditor - * version: ueditor - * build: Wed Aug 10 2016 11:06:19 GMT+0800 (CST) - */ - -!function(){!function(){UE=window.UE||{};var a=!!window.ActiveXObject,b={removeLastbs:function(a){return a.replace(/\/$/,"")},extend:function(a,b){for(var c=arguments,d=!!this.isBoolean(c[c.length-1])&&c[c.length-1],e=this.isBoolean(c[c.length-1])?c.length-1:c.length,f=1;f=c&&a===b)return d=e,!1}),d},hasClass:function(a,b){b=b.replace(/(^[ ]+)|([ ]+$)/g,"").replace(/[ ]{2,}/g," ").split(" ");for(var c,d=0,e=a.className;c=b[d++];)if(!new RegExp("\\b"+c+"\\b","i").test(e))return!1;return d-1==b.length},addClass:function(a,c){if(a){c=this.trim(c).replace(/[ ]{2,}/g," ").split(" ");for(var d,e=0,f=a.className;d=c[e++];)new RegExp("\\b"+d+"\\b").test(f)||(f+=" "+d);a.className=b.trim(f)}},removeClass:function(a,b){b=this.isArray(b)?b:this.trim(b).replace(/[ ]{2,}/g," ").split(" ");for(var c,d=0,e=a.className;c=b[d++];)e=e.replace(new RegExp("\\b"+c+"\\b"),"");e=this.trim(e).replace(/[ ]{2,}/g," "),a.className=e,!e&&a.removeAttribute("className")},on:function(a,c,d){var e=this.isArray(c)?c:c.split(/\s+/),f=e.length;if(f)for(;f--;)if(c=e[f],a.addEventListener)a.addEventListener(c,d,!1);else{d._d||(d._d={els:[]});var g=c+d.toString(),h=b.indexOf(d._d.els,a);d._d[g]&&h!=-1||(h==-1&&d._d.els.push(a),d._d[g]||(d._d[g]=function(a){return d.call(a.srcElement,a||window.event)}),a.attachEvent("on"+c,d._d[g]))}a=null},off:function(a,c,d){var e=this.isArray(c)?c:c.split(/\s+/),f=e.length;if(f)for(;f--;)if(c=e[f],a.removeEventListener)a.removeEventListener(c,d,!1);else{var g=c+d.toString();try{a.detachEvent("on"+c,d._d?d._d[g]:d)}catch(h){}if(d._d&&d._d[g]){var i=b.indexOf(d._d.els,a);i!=-1&&d._d.els.splice(i,1),0==d._d.els.length&&delete d._d[g]}}},loadFile:function(){function a(a,c){try{for(var d,e=0;d=b[e++];)if(d.doc===a&&d.url==(c.src||c.href))return d}catch(f){return null}}var b=[];return function(c,d,e){var f=a(c,d);if(f)return void(f.ready?e&&e():f.funs.push(e));if(b.push({doc:c,url:d.src||d.href,funs:[e]}),!c.body){var g=[];for(var h in d)"tag"!=h&&g.push(h+'="'+d[h]+'"');return void c.write("<"+d.tag+" "+g.join(" ")+" >")}if(!d.id||!c.getElementById(d.id)){var i=c.createElement(d.tag);delete d.tag;for(var h in d)i.setAttribute(h,d[h]);i.onload=i.onreadystatechange=function(){if(!this.readyState||/loaded|complete/.test(this.readyState)){if(f=a(c,d),f.funs.length>0){f.ready=1;for(var b;b=f.funs.pop();)b()}i.onload=i.onreadystatechange=null}},i.onerror=function(){throw Error("The load "+(d.href||d.src)+" fails,check the url")},c.getElementsByTagName("head")[0].appendChild(i)}}}()};b.each(["String","Function","Array","Number","RegExp","Object","Boolean"],function(a){b["is"+a]=function(b){return Object.prototype.toString.apply(b)=="[object "+a+"]"}});var c={};UE.parse={register:function(a,b){c[a]=b},load:function(a){b.each(c,function(c){c.call(a,b)})}},uParse=function(a,c){b.domReady(function(){var d;if(document.querySelectorAll)d=document.querySelectorAll(a);else if(/^#/.test(a))d=[document.getElementById(a.replace(/^#/,""))];else if(/^\./.test(a)){var d=[];b.each(document.getElementsByTagName("*"),function(b){b.className&&new RegExp("\\b"+a.replace(/^\./,"")+"\\b","i").test(b.className)&&d.push(b)})}else d=document.getElementsByTagName(a);b.each(d,function(d){UE.parse.load(b.extend({root:d,selector:a},c))})})}}(),UE.parse.register("insertcode",function(a){var b=this.root.getElementsByTagName("pre");if(b.length)if("undefined"==typeof XRegExp){var c,d;void 0!==this.rootPath?(c=a.removeLastbs(this.rootPath)+"/third-party/SyntaxHighlighter/shCore.js",d=a.removeLastbs(this.rootPath)+"/third-party/SyntaxHighlighter/shCoreDefault.css"):(c=this.highlightJsUrl,d=this.highlightCssUrl),a.loadFile(document,{id:"syntaxhighlighter_css",tag:"link",rel:"stylesheet",type:"text/css",href:d}),a.loadFile(document,{id:"syntaxhighlighter_js",src:c,tag:"script",type:"text/javascript",defer:"defer"},function(){a.each(b,function(a){a&&/brush/i.test(a.className)&&SyntaxHighlighter.highlight(a)})})}else a.each(b,function(a){a&&/brush/i.test(a.className)&&SyntaxHighlighter.highlight(a)})}),UE.parse.register("table",function(a){function b(b,c){var d,e=b;for(c=a.isArray(c)?c:[c];e;){for(d=0;d0){var g=a[c];a[c]=a[e],a[e]=g}return a}function e(b){if(!a.hasClass(b.rows[0],"firstRow")){for(var c=1;c - * Released under the MIT License. - */ -t.exports=function(){"use strict";function t(t){t=t||{};var i=arguments.length,s=0;if(1===i)return t;for(;++s-1?t.splice(n,1):void 0}}function o(t,e){if("IMG"===t.tagName&&t.getAttribute("data-srcset")){var n=t.getAttribute("data-srcset"),i=[],s=t.parentNode,o=s.offsetWidth*e,a=void 0,r=void 0,l=void 0;(n=n.trim().split(",")).map(function(t){t=t.trim(),-1===(a=t.lastIndexOf(" "))?(r=t,l=999998):(r=t.substr(0,a),l=parseInt(t.substr(a+1,t.length-a-2),10)),i.push([l,r])}),i.sort(function(t,e){if(t[0]e[0])return 1;if(t[0]===e[0]){if(-1!==e[1].indexOf(".webp",e[1].length-5))return 1;if(-1!==t[1].indexOf(".webp",t[1].length-5))return-1}return 0});for(var u="",c=void 0,d=i.length,h=0;h=o){u=c[1];break}return u}}function a(t,e){for(var n=void 0,i=0,s=t.length;i0&&void 0!==arguments[0]?arguments[0]:1;return v&&window.devicePixelRatio||t},_=function(){if(v){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e)}catch(t){}return t}}(),x={on:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];_?t.addEventListener(e,n,{capture:i,passive:!0}):t.addEventListener(e,n,i)},off:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];t.removeEventListener(e,n,i)}},S=function(t,e,n){var i=new Image;i.src=t.src,i.onload=function(){e({naturalHeight:i.naturalHeight,naturalWidth:i.naturalWidth,src:i.src})},i.onerror=function(t){n(t)}},w=function(t,e){return"undefined"!=typeof getComputedStyle?getComputedStyle(t,null).getPropertyValue(e):t.style[e]},C=function(t){return w(t,"overflow")+w(t,"overflow-y")+w(t,"overflow-x")},$={},T=function(){function t(e){var n=e.el,i=e.src,s=e.error,o=e.loading,a=e.bindType,r=e.$parent,l=e.options,c=e.elRenderer;u(this,t),this.el=n,this.src=i,this.error=s,this.loading=o,this.bindType=a,this.attempt=0,this.naturalHeight=0,this.naturalWidth=0,this.options=l,this.rect=null,this.$parent=r,this.elRenderer=c,this.performanceData={init:Date.now(),loadStart:0,loadEnd:0},this.filter(),this.initState(),this.render("loading",!1)}return c(t,[{key:"initState",value:function(){this.el.dataset.src=this.src,this.state={error:!1,loaded:!1,rendered:!1}}},{key:"record",value:function(t){this.performanceData[t]=Date.now()}},{key:"update",value:function(t){var e=t.src,n=t.loading,i=t.error,s=this.src;this.src=e,this.loading=n,this.error=i,this.filter(),s!==this.src&&(this.attempt=0,this.initState())}},{key:"getRect",value:function(){this.rect=this.el.getBoundingClientRect()}},{key:"checkInView",value:function(){return this.getRect(),this.rect.topthis.options.preLoadTop&&this.rect.left0}},{key:"filter",value:function(){var t=this;(function(t){if(!(t instanceof Object))return[];if(Object.keys)return Object.keys(t);var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(n);return e})(this.options.filter).map(function(e){t.options.filter[e](t,t.options)})}},{key:"renderLoading",value:function(t){var e=this;S({src:this.loading},function(n){e.render("loading",!1),t()},function(){t(),e.options.silent||console.warn("VueLazyload log: load failed with loading image("+e.loading+")")})}},{key:"load",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r;return this.attempt>this.options.attempt-1&&this.state.error?(this.options.silent||console.log("VueLazyload log: "+this.src+" tried too more than "+this.options.attempt+" times"),void e()):this.state.loaded||$[this.src]?(this.state.loaded=!0,e(),this.render("loaded",!0)):void this.renderLoading(function(){t.attempt++,t.record("loadStart"),S({src:t.src},function(n){t.naturalHeight=n.naturalHeight,t.naturalWidth=n.naturalWidth,t.state.loaded=!0,t.state.error=!1,t.record("loadEnd"),t.render("loaded",!1),$[t.src]=1,e()},function(e){!t.options.silent&&console.error(e),t.state.error=!0,t.state.loaded=!1,t.render("error",!1)})})}},{key:"render",value:function(t,e){this.elRenderer(this,t,e)}},{key:"performance",value:function(){var t="loading",e=0;return this.state.loaded&&(t="loaded",e=(this.performanceData.loadEnd-this.performanceData.loadStart)/1e3),this.state.error&&(t="error"),{src:this.src,state:t,time:e}}},{key:"destroy",value:function(){this.el=null,this.src=null,this.error=null,this.loading=null,this.bindType=null,this.attempt=0}}]),t}(),B="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",E=["scroll","wheel","mousewheel","resize","animationend","transitionend","touchmove"],I={rootMargin:"0px",threshold:0},D=function(t){return function(){function e(t){var n=t.preLoad,i=t.error,s=t.throttleWait,o=t.preLoadTop,a=t.dispatchEvent,r=t.loading,l=t.attempt,c=t.silent,d=void 0===c||c,h=t.scale,f=t.listenEvents,p=(t.hasbind,t.filter),m=t.adapter,g=t.observer,y=t.observerOptions;u(this,e),this.version="1.2.3",this.mode=b.event,this.ListenerQueue=[],this.TargetIndex=0,this.TargetQueue=[],this.options={silent:d,dispatchEvent:!!a,throttleWait:s||200,preLoad:n||1.3,preLoadTop:o||0,error:i||B,loading:r||B,attempt:l||3,scale:h||k(h),ListenEvents:f||E,hasbind:!1,supportWebp:function(){if(!v)return!1;var t=!0,e=document;try{var n=e.createElement("object");n.type="image/webp",n.style.visibility="hidden",n.innerHTML="!",e.body.appendChild(n),t=!n.offsetWidth,e.body.removeChild(n)}catch(e){t=!1}return t}(),filter:p||{},adapter:m||{},observer:!!g,observerOptions:y||I},this._initEvent(),this.lazyLoadHandler=function(t,e){var n=null,i=0;return function(){if(!n){var s=Date.now()-i,o=this,a=arguments,r=function(){i=Date.now(),n=!1,t.apply(o,a)};s>=e?r():n=setTimeout(r,e)}}}(this._lazyLoadHandler.bind(this),this.options.throttleWait),this.setMode(this.options.observer?b.observer:b.event)}return c(e,[{key:"config",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this.options,t)}},{key:"performance",value:function(){var t=[];return this.ListenerQueue.map(function(e){t.push(e.performance())}),t}},{key:"addLazyBox",value:function(t){this.ListenerQueue.push(t),v&&(this._addListenerTarget(window),this._observer&&this._observer.observe(t.el),t.$el&&t.$el.parentNode&&this._addListenerTarget(t.$el.parentNode))}},{key:"add",value:function(e,n,i){var s=this;if(function(t,e){for(var n=!1,i=0,s=t.length;i1&&void 0!==arguments[1]?arguments[1]:{},n=D(t),i=new n(e),s=new A({lazy:i}),o="2"===t.version.split(".")[0];t.prototype.$Lazyload=i,e.lazyComponent&&t.component("lazy-component",function(t){return{props:{tag:{type:String,default:"div"}},render:function(t){return!1===this.show?t(this.tag):t(this.tag,null,this.$slots.default)},data:function(){return{el:null,state:{loaded:!1},rect:{},show:!1}},mounted:function(){this.el=this.$el,t.addLazyBox(this),t.lazyLoadHandler()},beforeDestroy:function(){t.removeComponent(this)},methods:{getRect:function(){this.rect=this.$el.getBoundingClientRect()},checkInView:function(){return this.getRect(),v&&this.rect.top0&&this.rect.left0},load:function(){this.show=!0,this.state.loaded=!0,this.$emit("show",this)}}}}(i)),o?(t.directive("lazy",{bind:i.add.bind(i),update:i.update.bind(i),componentUpdated:i.lazyLoadHandler.bind(i),unbind:i.remove.bind(i)}),t.directive("lazy-container",{bind:s.bind.bind(s),update:s.update.bind(s),unbind:s.unbind.bind(s)})):(t.directive("lazy",{bind:i.lazyLoadHandler.bind(i),update:function(t,e){m(this.vm.$refs,this.vm.$els),i.add(this.el,{modifiers:this.modifiers||{},arg:this.arg,value:t,oldValue:e},{context:this.vm})},unbind:function(){i.remove(this.el)}}),t.directive("lazy-container",{update:function(t,e){s.update(this.el,{modifiers:this.modifiers||{},arg:this.arg,value:t,oldValue:e},{context:this.vm})},unbind:function(){s.unbind(this.el)}}))}}}()},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";function i(){return(i=Object.assign||function(t){for(var e=1;e1?s-1:0),r=1;rn&&e>z?"horizontal":n>e&&n>z?"vertical":"")},resetTouchStatus:function(){this.direction="",this.deltaX=0,this.deltaY=0,this.offsetX=0,this.offsetY=0}}},V={mixins:[P],props:{value:Boolean,overlay:Boolean,overlayStyle:Object,overlayClass:String,closeOnClickOverlay:Boolean,zIndex:[String,Number],getContainer:[String,Function],lockScroll:{type:Boolean,default:!0},lazyRender:{type:Boolean,default:!0}},data:function(){return{inited:this.value}},computed:{shouldRender:function(){return this.inited||!this.lazyRender}},watch:{value:function(t){this.inited=this.inited||this.value,this[t?"open":"close"]()},getContainer:function(){this.move()},overlay:function(){this.renderOverlay()}},mounted:function(){this.getContainer&&this.move(),this.value&&this.open()},activated:function(){this.value&&this.open()},beforeDestroy:function(){this.close(),this.getContainer&&this.$parent.$el.appendChild(this.$el)},deactivated:function(){this.close()},methods:{open:function(){this.$isServer||this.opened||(void 0!==this.zIndex&&(E.zIndex=this.zIndex),this.opened=!0,this.renderOverlay(),this.lockScroll&&(L(document,"touchstart",this.touchStart),L(document,"touchmove",this.onTouchMove),E.lockCount||document.body.classList.add("van-overflow-hidden"),E.lockCount++))},close:function(){this.opened&&(this.lockScroll&&(E.lockCount--,M(document,"touchstart",this.touchStart),M(document,"touchmove",this.onTouchMove),E.lockCount||document.body.classList.remove("van-overflow-hidden")),this.opened=!1,A.close(this),this.$emit("input",!1))},move:function(){var t,e=this.getContainer;e?t="string"==typeof e?document.querySelector(e):e():this.$parent&&(t=this.$parent.$el),t&&t.appendChild(this.$el)},onTouchMove:function(t){this.touchMove(t);var e=this.deltaY>0?"10":"01",n=N.getScrollEventTarget(t.target,this.$el),i=n.scrollHeight,s=n.offsetHeight,o=n.scrollTop,a="11";0===o?a=s>=i?"00":"01":o+s>=i&&(a="10"),"11"===a||"vertical"!==this.direction||parseInt(a,2)&parseInt(e,2)||(t.preventDefault(),t.stopPropagation())},renderOverlay:function(){var t=this;this.overlay?A.open(this,{zIndex:E.zIndex++,className:this.overlayClass,customStyle:this.overlayStyle}):A.close(this),this.$nextTick(function(){t.$el.style.zIndex=E.zIndex++})}}},j=B({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"van-slide-up"}},[t.shouldRender?n("div",{directives:[{name:"show",rawName:"v-show",value:t.value,expression:"value"}],class:t.b({withtitle:t.title})},[t.title?n("div",{staticClass:"van-hairline--top-bottom",class:t.b("header")},[n("div",{domProps:{textContent:t._s(t.title)}}),n("icon",{attrs:{name:"close"},on:{click:t.onCancel}})],1):n("ul",{staticClass:"van-hairline--bottom"},t._l(t.actions,function(e){return n("li",{class:[t.b("item",{disabled:e.disabled||e.loading}),e.className,"van-hairline--top"],on:{click:function(n){n.stopPropagation(),t.onSelect(e)}}},[e.loading?n("loading",{class:t.b("loading"),attrs:{size:"20px"}}):[n("span",{class:t.b("name")},[t._v(t._s(e.name))]),e.subname?n("span",{class:t.b("subname")},[t._v("\n "+t._s(e.subname)+"\n ")]):t._e()]],2)})),t.cancelText?n("div",{class:[t.b("cancel"),"van-hairline--top"],domProps:{textContent:t._s(t.cancelText)},on:{click:t.onCancel}}):n("div",{class:t.b("content")},[t._t("default")],2)]):t._e()])},name:"actionsheet",mixins:[V],props:{title:String,value:Boolean,actions:Array,cancelText:String,overlay:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0}},methods:{onSelect:function(t){t.disabled||t.loading||(t.callback&&t.callback(t),this.$emit("select",t))},onCancel:function(){this.$emit("input",!1),this.$emit("cancel")}}}),H=B({render:function(){var t,e=this,n=e.$createElement,i=e._self._c||n;return i("cell",{class:e.b((t={error:e.error,disabled:e.$attrs.disabled,"min-height":"textarea"===e.type&&!e.autosize},t["label-"+e.labelAlign]=e.labelAlign,t)),attrs:{icon:e.leftIcon,title:e.label,center:e.center,border:e.border,"is-link":e.isLink,required:e.required}},[e._t("left-icon",null,{slot:"icon"}),e._t("label",null,{slot:"title"}),i("div",{class:e.b("body")},["textarea"===e.type?i("textarea",e._g(e._b({ref:"input",class:e.b("control",e.inputAlign),attrs:{readonly:e.readonly},domProps:{value:e.value}},"textarea",e.$attrs,!1),e.listeners)):i("input",e._g(e._b({ref:"input",class:e.b("control",e.inputAlign),attrs:{type:e.type,readonly:e.readonly},domProps:{value:e.value}},"input",e.$attrs,!1),e.listeners)),e.showClear?i("icon",{class:e.b("clear"),attrs:{name:"clear"},on:{touchstart:function(t){return t.preventDefault(),e.onClear(t)}}}):e._e(),e.$slots.icon||e.icon?i("div",{class:e.b("icon"),on:{click:e.onClickIcon}},[e._t("icon",[i("icon",{attrs:{name:e.icon}})])],2):e._e(),e.$slots.button?i("div",{class:e.b("button")},[e._t("button")],2):e._e()],1),e.errorMessage?i("div",{class:e.b("error-message"),domProps:{textContent:e._s(e.errorMessage)}}):e._e()],2)},name:"field",inheritAttrs:!1,mixins:[w],props:{error:Boolean,leftIcon:String,readonly:Boolean,clearable:Boolean,labelAlign:String,inputAlign:String,onIconClick:Function,autosize:[Boolean,Object],errorMessage:String,type:{type:String,default:"text"}},data:function(){return{focused:!1}},watch:{value:function(){this.$nextTick(this.adjustSize)}},mounted:function(){this.format(),this.$nextTick(this.adjustSize)},computed:{showClear:function(){return this.clearable&&this.focused&&""!==this.value&&this.isDef(this.value)&&!this.readonly},listeners:function(){return i({},this.$listeners,{input:this.onInput,keypress:this.onKeypress,focus:this.onFocus,blur:this.onBlur})}},methods:{focus:function(){this.$refs.input&&this.$refs.input.focus()},blur:function(){this.$refs.input&&this.$refs.input.blur()},format:function(t){void 0===t&&(t=this.$refs.input);var e=t.value,n=this.$attrs.maxlength;return this.isDef(n)&&e.length>n&&(e=e.slice(0,n),t.value=e),e},onInput:function(t){this.$emit("input",this.format(t.target))},onFocus:function(t){this.focused=!0,this.$emit("focus",t),this.readonly&&this.blur()},onBlur:function(t){this.focused=!1,this.$emit("blur",t)},onClickIcon:function(){this.$emit("click-icon"),this.onIconClick&&this.onIconClick()},onClear:function(){this.$emit("input",""),this.$emit("clear")},onKeypress:function(t){if("number"===this.type){var e=t.keyCode,n=-1===String(this.value).indexOf(".");e>=48&&e<=57||46===e&&n||45===e||t.preventDefault()}"search"===this.type&&13===t.keyCode&&this.blur(),this.$emit("keypress",t)},adjustSize:function(){var t=this.$refs.input;if("textarea"===this.type&&this.autosize&&t){t.style.height="auto";var e=t.scrollHeight;if(Object(a.e)(this.autosize)){var n=this.autosize,i=n.maxHeight,s=n.minHeight;i&&(e=Math.min(e,i)),s&&(e=Math.max(e,s))}e&&(t.style.height=e+"px")}}}}),R=B({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n(t.tag,{tag:"component",class:t.b([t.type,t.size,{block:t.block,plain:t.plain,round:t.round,square:t.square,loading:t.loading,disabled:t.disabled,unclickable:t.disabled||t.loading,"bottom-action":t.bottomAction}]),attrs:{type:t.nativeType,disabled:t.disabled},on:{click:t.onClick}},[t.loading?n("loading",{attrs:{size:"20px",color:"default"===t.type?void 0:""}}):n("span",{class:t.b("text")},[t._t("default",[t._v(t._s(t.text))])],2)],1)},name:"button",props:{text:String,block:Boolean,plain:Boolean,round:Boolean,square:Boolean,loading:Boolean,disabled:Boolean,nativeType:String,bottomAction:Boolean,tag:{type:String,default:"button"},type:{type:String,default:"default"},size:{type:String,default:"normal"}},methods:{onClick:function(t){this.loading||this.disabled||this.$emit("click",t)}}}),W=B({render:function(){var t,e=this,n=e.$createElement,i=e._self._c||n;return i("transition",{attrs:{name:e.currentTransition}},[e.shouldRender?i("div",{directives:[{name:"show",rawName:"v-show",value:e.value,expression:"value"}],class:e.b((t={},t[e.position]=e.position,t))},[e._t("default")],2):e._e()])},name:"popup",mixins:[V],props:{position:String,transition:String,overlay:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0}},computed:{currentTransition:function(){return this.transition||(this.position?"popup-slide-"+this.position:"van-fade")}}}),Y=["success","fail","loading"],q=B({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"van-fade"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.value,expression:"value"}],class:t.b([t.style,t.position])},["text"===t.style?n("div",[t._v(t._s(t.message))]):t._e(),"html"===t.style?n("div",{domProps:{innerHTML:t._s(t.message)}}):t._e(),"default"===t.style?["loading"===t.type?n("loading",{attrs:{color:"white",type:t.loadingType}}):n("icon",{class:t.b("icon"),attrs:{name:t.type}}),t.isDef(t.message)?n("div",{class:t.b("text")},[t._v("\n "+t._s(t.message)+"\n ")]):t._e()]:t._e()],2)])},name:"toast",mixins:[V],props:{forbidClick:Boolean,message:[String,Number],type:{type:String,default:"text"},loadingType:{type:String,default:"circular"},position:{type:String,default:"middle"},lockScroll:{type:Boolean,default:!1}},data:function(){return{clickable:!1}},computed:{style:function(){return-1!==Y.indexOf(this.type)?"default":this.type}},mounted:function(){this.toggleClickale()},destroyed:function(){this.toggleClickale()},watch:{value:function(){this.toggleClickale()},forbidClick:function(){this.toggleClickale()}},methods:{toggleClickale:function(){var t=this.value&&this.forbidClick;if(this.clickable!==t){this.clickable=t;var e=t?"add":"remove";document.body.classList[e]("van-toast--unclickable")}}}}),X={type:"text",mask:!1,message:"",value:!0,duration:3e3,position:"middle",loadingType:"circular",forbidClick:!1,overlayStyle:{}},K=function(t){return Object(a.e)(t)?t:{message:t}},Q=[],U=!0,G=i({},X);function Z(t){void 0===t&&(t={});var e=function(){if(a.f)return{};if(!Q.length||!U){var t=new(o.a.extend(q))({el:document.createElement("div")});document.body.appendChild(t.$el),Q.push(t)}return Q[Q.length-1]}();return t=i({},G,K(t),{clear:function(){e.value=!1,U||a.f||(document.body.removeChild(e.$el),e.$destroy())}}),i(e,function(t){return t.overlay=t.mask,t}(t)),clearTimeout(e.timer),t.duration>0&&(e.timer=setTimeout(function(){e.clear()},t.duration)),e}["loading","success","fail"].forEach(function(t){var e;Z[t]=(e=t,function(t){return Z(i({type:e},K(t)))})}),Z.clear=function(t){Q.length&&(t?(Q.forEach(function(t){t.clear()}),Q=[]):U?Q[0].clear():Q.shift().clear())},Z.setDefaultOptions=function(t){i(G,t)},Z.resetDefaultOptions=function(){G=i({},X)},Z.allowMultiple=function(t){void 0===t&&(t=!0),U=!t},Z.install=function(){o.a.use(q)},o.a.prototype.$toast=Z;var J,tt=Z,et=B({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"van-dialog-bounce"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.value,expression:"value"}],class:[t.b(),t.className]},[t.title?n("div",{class:t.b("header",{isolated:!t.message&&!t.$slots.default}),domProps:{textContent:t._s(t.title)}}):t._e(),t.message||t.$slots.default?n("div",{class:t.b("content")},[t._t("default",[t.message?n("div",{class:t.b("message",{"has-title":t.title}),domProps:{innerHTML:t._s(t.message)}}):t._e()])],2):t._e(),n("div",{staticClass:"van-hairline--top",class:t.b("footer",{buttons:t.showCancelButton&&t.showConfirmButton})},[n("van-button",{directives:[{name:"show",rawName:"v-show",value:t.showCancelButton,expression:"showCancelButton"}],class:t.b("cancel"),attrs:{loading:t.loading.cancel,size:"large"},on:{click:function(e){t.handleAction("cancel")}}},[t._v("\n "+t._s(t.cancelButtonText||t.$t("cancel"))+"\n ")]),n("van-button",{directives:[{name:"show",rawName:"v-show",value:t.showConfirmButton,expression:"showConfirmButton"}],class:[t.b("confirm"),{"van-hairline--left":t.showCancelButton&&t.showConfirmButton}],attrs:{size:"large",loading:t.loading.confirm},on:{click:function(e){t.handleAction("confirm")}}},[t._v("\n "+t._s(t.confirmButtonText||t.$t("confirm"))+"\n ")])],1)])])},name:"dialog",components:{VanButton:R},mixins:[V],props:{title:String,message:String,callback:Function,className:[String,Object,Array],beforeClose:Function,confirmButtonText:String,cancelButtonText:String,showCancelButton:Boolean,showConfirmButton:{type:Boolean,default:!0},overlay:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!1}},data:function(){return{loading:{confirm:!1,cancel:!1}}},methods:{handleAction:function(t){var e=this;this.beforeClose?(this.loading[t]=!0,this.beforeClose(t,function(n){!1!==n&&e.onClose(t),e.loading[t]=!1})):this.onClose(t)},onClose:function(t){this.$emit("input",!1),this.$emit(t),this.callback&&this.callback(t)}}}),nt=function t(e){return a.f?Promise.resolve():new Promise(function(n,s){J||((J=new(o.a.extend(et))({el:document.createElement("div")})).$on("input",function(t){J.value=t}),document.body.appendChild(J.$el)),i(J,i({resolve:n,reject:s},t.currentOptions,e))})};nt.defaultOptions={value:!0,title:"",message:"",overlay:!0,className:"",lockScroll:!0,beforeClose:null,confirmButtonText:"",cancelButtonText:"",showConfirmButton:!0,showCancelButton:!1,closeOnClickOverlay:!1,callback:function(t){J["confirm"===t?"resolve":"reject"](t)}},nt.alert=nt,nt.confirm=function(t){return nt(i({showCancelButton:!0},t))},nt.close=function(){J&&(J.value=!1)},nt.setDefaultOptions=function(t){i(nt.currentOptions,t)},nt.resetDefaultOptions=function(){nt.currentOptions=i({},nt.defaultOptions)},nt.install=function(){o.a.use(et)},o.a.prototype.$dialog=nt,nt.resetDefaultOptions();var it=nt;function st(t){return Array.isArray(t)?t.map(function(t){return st(t)}):"object"==typeof t?u({},t):t}var ot=B({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:[t.b(),t.className],style:t.columnStyle,on:{touchstart:t.onTouchStart,touchmove:function(e){return e.preventDefault(),t.onTouchMove(e)},touchend:t.onTouchEnd,touchcancel:t.onTouchEnd}},[n("ul",{style:t.wrapperStyle},t._l(t.options,function(e,i){return n("li",{staticClass:"van-ellipsis",class:t.b("item",{disabled:t.isDisabled(e),selected:i===t.currentIndex}),style:t.optionStyle,domProps:{innerHTML:t._s(t.getOptionText(e))},on:{click:function(e){t.setIndex(i,!0)}}})}))])},name:"picker-column",props:{valueKey:String,className:String,itemHeight:Number,defaultIndex:Number,initialOptions:Array,visibleItemCount:Number},data:function(){return{startY:0,offset:0,duration:0,startOffset:0,options:st(this.initialOptions),currentIndex:this.defaultIndex}},created:function(){this.$parent.children&&this.$parent.children.push(this),this.setIndex(this.currentIndex)},destroyed:function(){var t=this.$parent.children;t&&t.splice(t.indexOf(this),1)},watch:{defaultIndex:function(){this.setIndex(this.defaultIndex)}},computed:{count:function(){return this.options.length},baseOffset:function(){return this.itemHeight*(this.visibleItemCount-1)/2},columnStyle:function(){return{height:this.itemHeight*this.visibleItemCount+"px"}},wrapperStyle:function(){return{transition:this.duration+"ms",transform:"translate3d(0, "+(this.offset+this.baseOffset)+"px, 0)",lineHeight:this.itemHeight+"px"}},optionStyle:function(){return{height:this.itemHeight+"px"}}},methods:{onTouchStart:function(t){this.startY=t.touches[0].clientY,this.startOffset=this.offset,this.duration=0},onTouchMove:function(t){var e=t.touches[0].clientY-this.startY;this.offset=Object(a.g)(this.startOffset+e,-this.count*this.itemHeight,this.itemHeight)},onTouchEnd:function(){if(this.offset!==this.startOffset){this.duration=200;var t=Object(a.g)(Math.round(-this.offset/this.itemHeight),0,this.count-1);this.setIndex(t,!0)}},adjustIndex:function(t){for(var e=t=Object(a.g)(t,0,this.count);e=0;n--)if(!this.isDisabled(this.options[n]))return n},isDisabled:function(t){return Object(a.e)(t)&&t.disabled},getOptionText:function(t){return Object(a.e)(t)&&this.valueKey in t?t[this.valueKey]:t},setIndex:function(t,e){t=this.adjustIndex(t)||0,this.offset=-t*this.itemHeight,t!==this.currentIndex&&(this.currentIndex=t,e&&this.$emit("change",t))},setValue:function(t){for(var e=this.options,n=0;n=e.max)return;-1===n.indexOf(this.name)&&(n.push(this.name),e.$emit("input",n))}else{var i=n.indexOf(this.name);-1!==i&&(n.splice(i,1),e.$emit("input",n))}}}}),Bt=B({render:function(){var t=this.$createElement;return(this._self._c||t)("div",{class:this.b()},[this._t("default")],2)},name:"checkbox-group",props:{max:Number,value:Array,disabled:Boolean},watch:{value:function(t){this.$emit("change",t)}}}),Et=n(2),It=B({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.b(),style:t.style},[n("svg",{attrs:{viewBox:"0 0 1060 1060"}},[n("path",{class:t.b("hover"),style:t.hoverStyle,attrs:{d:t.path}}),n("path",{class:t.b("layer"),style:t.layerStyle,attrs:{d:t.path}})]),t._t("default",[n("div",{class:t.b("text")},[t._v(t._s(t.text))])])],2)},name:"circle",props:{text:String,value:Number,speed:Number,size:{type:String,default:"100px"},fill:{type:String,default:"none"},rate:{type:Number,default:100},layerColor:{type:String,default:"#fff"},color:{type:String,default:"#1989fa"},strokeWidth:{type:Number,default:40},clockwise:{type:Boolean,default:!0}},beforeCreate:function(){this.perimeter=3140,this.path="M 530 530 m -500, 0 a 500, 500 0 1, 1 1000, 0 a 500, 500 0 1, 1 -1000, 0"},computed:{style:function(){return{width:this.size,height:this.size}},layerStyle:function(){var t=this.perimeter*(100-this.value)/100;return t=this.clockwise?t:2*this.perimeter-t,{stroke:""+this.color,strokeDashoffset:t+"px",strokeWidth:this.strokeWidth+1+"px"}},hoverStyle:function(){return{fill:""+this.fill,stroke:""+this.layerColor,strokeWidth:this.strokeWidth+"px"}}},watch:{rate:{handler:function(){this.startTime=Date.now(),this.startRate=this.value,this.endRate=this.format(this.rate),this.increase=this.endRate>this.startRate,this.duration=Math.abs(1e3*(this.startRate-this.endRate)/this.speed),this.speed?(Object(Et.a)(this.rafId),this.rafId=Object(Et.b)(this.animate)):this.$emit("input",this.endRate)},immediate:!0}},methods:{animate:function(){var t=Date.now(),e=Math.min((t-this.startTime)/this.duration,1)*(this.endRate-this.startRate)+this.startRate;this.$emit("input",this.format(parseFloat(e.toFixed(1)))),(this.increase?ethis.endRate)&&(this.rafId=Object(Et.b)(this.animate))},format:function(t){return Math.min(Math.max(t,0),100)}}}),Dt=B({render:function(){var t,e=this,n=e.$createElement;return(e._self._c||n)(e.tag,{tag:"component",class:e.b((t={},t[e.span]=e.span,t["offset-"+e.offset]=e.offset,t)),style:e.style},[e._t("default")],2)},name:"col",props:{span:[Number,String],offset:[Number,String],tag:{type:String,default:"div"}},computed:{gutter:function(){return this.$parent&&Number(this.$parent.gutter)||0},style:function(){var t=this.gutter/2+"px";return this.gutter?{paddingLeft:t,paddingRight:t}:{}}}}),At=B({render:function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"van-hairline--top-bottom",class:this.b()},[this._t("default")],2)},name:"collapse",props:{accordion:Boolean,value:[String,Number,Array]},data:function(){return{items:[]}},methods:{switch:function(t,e){this.accordion||(t=e?this.value.concat(t):this.value.filter(function(e){return e!==t})),this.$emit("change",t),this.$emit("input",t)}}}),Nt=B({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:[t.b(),{"van-hairline--top":t.index}]},[n("cell",t._b({class:t.b("title",{disabled:t.disabled,expanded:t.expanded}),on:{click:t.onClick}},"cell",t.$props,!1),[t._t("title",null,{slot:"title"}),t._t("icon",null,{slot:"icon"}),t._t("value"),t._t("right-icon",null,{slot:"right-icon"})],2),t.inited?n("div",{directives:[{name:"show",rawName:"v-show",value:t.show,expression:"show"}],ref:"wrapper",class:t.b("wrapper"),on:{transitionend:t.onTransitionEnd}},[n("div",{ref:"content",class:t.b("content")},[t._t("default")],2)]):t._e()],1)},name:"collapse-item",mixins:[w,bt],props:{name:[String,Number],disabled:Boolean,isLink:{type:Boolean,default:!0}},data:function(){return{show:null,inited:null}},computed:{items:function(){return this.parent.items},index:function(){return this.items.indexOf(this)},currentName:function(){return this.isDef(this.name)?this.name:this.index},expanded:function(){var t=this;if(!this.parent)return null;var e=this.parent.value;return this.parent.accordion?e===this.currentName:e.some(function(e){return e===t.currentName})}},created:function(){this.findParent("van-collapse"),this.items.push(this),this.show=this.expanded,this.inited=this.expanded},destroyed:function(){this.items.splice(this.index,1)},watch:{expanded:function(t,e){var n=this;null!==e&&(t&&(this.show=!0,this.inited=!0),this.$nextTick(function(){var e=n.$refs,i=e.content,s=e.wrapper;if(i&&s){var o=i.clientHeight+"px";s.style.height=t?0:o,Object(Et.b)(function(){s.style.height=t?o:0})}}))}},methods:{onClick:function(){if(!this.disabled){var t=this.parent,e=t.accordion&&this.currentName===t.value?"":this.currentName,n=!this.expanded;this.parent.switch(e,n)}},onTransitionEnd:function(){this.expanded?this.$refs.wrapper.style.height=null:this.show=!1}}}),Ot=B({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("cell",{class:t.b([t.type]),attrs:{center:"",border:!1,"is-link":t.editable,icon:"edit"===t.type?"contact":"add2"},on:{click:t.onClick}},["add"===t.type?[t._v(t._s(t.addText||t.$t("addText")))]:[n("div",[t._v(t._s(t.$t("name"))+":"+t._s(t.name))]),n("div",[t._v(t._s(t.$t("tel"))+":"+t._s(t.tel))])]],2)},name:"contact-card",props:{tel:String,name:String,addText:String,editable:{type:Boolean,default:!0},type:{type:String,default:"add"}},methods:{onClick:function(t){this.editable&&this.$emit("click",t)}}}),Ft={id:"",tel:"",name:""},Lt=B({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.b()},[n("cell-group",[n("field",{attrs:{maxlength:"30",label:t.$t("name"),placeholder:t.$t("nameEmpty"),error:t.errorInfo.name},on:{focus:function(e){t.onFocus("name")}},model:{value:t.data.name,callback:function(e){t.$set(t.data,"name",e)},expression:"data.name"}}),n("field",{attrs:{type:"tel",label:t.$t("tel"),placeholder:t.$t("telEmpty"),error:t.errorInfo.tel},on:{focus:function(e){t.onFocus("tel")}},model:{value:t.data.tel,callback:function(e){t.$set(t.data,"tel",e)},expression:"data.tel"}})],1),n("div",{class:t.b("buttons")},[n("van-button",{attrs:{block:"",loading:t.isSaving,type:"danger"},on:{click:t.onSave}},[t._v("\n "+t._s(t.$t("save"))+"\n ")]),t.isEdit?n("van-button",{attrs:{block:"",loading:t.isDeleting},on:{click:t.onDelete}},[t._v("\n "+t._s(t.$t("delete"))+"\n ")]):t._e()],1)],1)},name:"contact-edit",components:{Field:H,VanButton:R},props:{isEdit:Boolean,isSaving:Boolean,isDeleting:Boolean,contactInfo:{type:Object,default:function(){return i({},Ft)}},telValidator:{type:Function,default:ht}},data:function(){return{data:i({},this.defaultContact,this.contactInfo),errorInfo:{name:!1,tel:!1}}},watch:{contactInfo:function(t){this.data=t}},methods:{onFocus:function(t){this.errorInfo[t]=!1},getErrorMessageByKey:function(t){var e=this.data[t].trim();switch(t){case"name":return e?"":this.$t("nameEmpty");case"tel":return this.telValidator(e)?"":this.$t("telInvalid")}},onSave:function(){var t=this;["name","tel"].every(function(e){var n=t.getErrorMessageByKey(e);return n&&(t.errorInfo[e]=!0,tt(n)),!n})&&!this.isSaving&&this.$emit("save",this.data)},onDelete:function(){var t=this;it.confirm({message:this.$t("confirmDelete")}).then(function(){t.$emit("delete",t.data)})}}}),Mt=B({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.b()},[n("radio-group",{attrs:{value:t.value},on:{input:function(e){t.$emit("input",e)}}},[n("cell-group",t._l(t.list,function(e,i){return n("cell",{key:e.id,attrs:{"is-link":""}},[n("radio",{attrs:{name:e.id},on:{click:function(n){t.$emit("select",e,i)}}},[n("div",{class:t.b("name")},[t._v(t._s(e.name)+","+t._s(e.tel))])]),n("icon",{class:t.b("edit"),attrs:{slot:"right-icon",name:"edit"},on:{click:function(n){t.$emit("edit",e,i)}},slot:"right-icon"})],1)}))],1),n("van-button",{class:t.b("add"),attrs:{square:"",size:"large",type:"danger",text:t.addText||t.$t("addText")},on:{click:function(e){t.$emit("add")}}})],1)},name:"contact-list",components:{Radio:yt,RadioGroup:gt},props:{value:null,list:Array,addText:String}}),zt=B({render:function(){var t=this,e=t.$createElement;return(t._self._c||e)("cell",{class:t.b(),attrs:{title:t.title||t.$t("title"),value:t.value,border:t.border,"is-link":t.editable},on:{click:function(e){t.$emit("click")}}})},name:"coupon-cell",model:{prop:"chosenCoupon"},props:{title:String,coupons:Array,border:{type:Boolean,default:!0},chosenCoupon:{type:Number,default:-1},editable:{type:Boolean,default:!0}},computed:{value:function(){var t=this.coupons,e=t[this.chosenCoupon];if(e){var n=e.denominations||e.value;return"-¥"+(n/100).toFixed(2)}return 0===t.length?this.$t("tips"):this.$t("count",t.length)}}}),Pt=B({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.b({disabled:t.disabled})},[n("div",{class:t.b("content")},[n("div",{class:t.b("head")},[n("h2",{domProps:{innerHTML:t._s(t.faceAmount)}}),n("p",[t._v(t._s(t.conditionMessage))])]),n("div",{class:t.b("body")},[n("h2",[t._v(t._s(t.data.name))]),n("p",[t._v(t._s(t.validPeriod))]),t.chosen?n("checkbox",{class:t.b("corner"),attrs:{value:!0}}):t._e()],1)]),t.disabled&&t.data.reason?n("p",{class:t.b("reason")},[t._v("\n "+t._s(t.data.reason)+"\n ")]):t._e()])},name:"coupon-item",props:{data:Object,chosen:Boolean,disabled:Boolean},components:{Checkbox:Tt},computed:{validPeriod:function(){return this.$t("valid")+":"+this.getDate(this.data.startAt)+" - "+this.getDate(this.data.endAt)},faceAmount:function(){return 0!==this.data.denominations?"¥ "+this.formatAmount(this.data.denominations):0!==this.data.discount?this.formatDiscount(this.data.discount):""},conditionMessage:function(){var t=this.data.originCondition;return t=t%100==0?Math.round(t/100):(t/100).toFixed(2),0===this.data.originCondition?this.$t("unlimited"):this.$t("condition",t)}},methods:{getDate:function(t){var e=new Date(1e3*t);return e.getFullYear()+"."+this.padZero(e.getMonth()+1)+"."+this.padZero(e.getDate())},padZero:function(t){return(t<10?"0":"")+t},formatDiscount:function(t){return this.$t("discount",""+(t/10).toFixed(t%10==0?0:1))},formatAmount:function(t){return(t/100).toFixed(t%100==0?0:t%10==0?1:2)}}}),Vt=B({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"show",rawName:"v-show",value:t.parent.animated||t.isSelected,expression:"parent.animated || isSelected"}],class:t.b("pane",{float:t.parent.animated}),style:t.paneStyle},[t.inited?t._t("default"):t._e(),t.$slots.title?n("div",{ref:"title"},[t._t("title")],2):t._e()],2)},name:"tab",mixins:[bt],props:{title:String,disabled:Boolean},data:function(){return{inited:!1,paneStyle:{}}},computed:{index:function(){return this.parent.tabs.indexOf(this)},isSelected:function(){return this.index===this.parent.curActive}},watch:{"parent.curActive":function(){this.inited=this.inited||this.isSelected},"parent.computedWidth":function(t){this.paneStyle={width:t+"px"}},title:function(){this.parent.setLine()}},created:function(){this.findParent("van-tabs")},mounted:function(){var t=this.parent.tabs,e=this.parent.$slots.default.indexOf(this.$vnode);t.splice(-1===e?t.length:e,0,this),this.$slots.title&&this.parent.renderTitle(this.$refs.title,this.index)},beforeDestroy:function(){this.parent.tabs.splice(this.index,1)}}),jt=B({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.b([t.type])},[n("div",{ref:"wrap",class:[t.b("wrap",{scrollable:t.scrollable}),{"van-hairline--top-bottom":"line"===t.type}],style:t.wrapStyle},[n("div",{ref:"nav",class:t.b("nav",[t.type]),style:t.navStyle},["line"===t.type?n("div",{class:t.b("line"),style:t.lineStyle}):t._e(),t._l(t.tabs,function(e,i){return n("div",{ref:"tabs",refInFor:!0,staticClass:"van-tab",class:{"van-tab--active":i===t.curActive,"van-tab--disabled":e.disabled},style:t.getTabStyle(e,i),on:{click:function(e){t.onClick(i)}}},[n("span",{ref:"title",refInFor:!0,staticClass:"van-ellipsis"},[t._v("\n "+t._s(e.title)+"\n ")])])})],2)]),n("div",{ref:"content",class:t.b("content")},[n("div",{directives:[{name:"show",rawName:"v-show",value:0!==t.computedWidth,expression:"computedWidth !== 0"}],class:t.b("track"),style:t.trackStyle},[t._t("default")],2)])])},name:"tabs",mixins:[P],model:{prop:"active"},props:{color:String,sticky:Boolean,animated:Boolean,offsetTop:Number,swipeable:Boolean,lineWidth:{type:Number,default:null},active:{type:[Number,String],default:0},type:{type:String,default:"line"},duration:{type:Number,default:.3},swipeThreshold:{type:Number,default:4}},data:function(){return{tabs:[],position:"",curActive:null,lineStyle:{},events:{resize:!1,sticky:!1,swipeable:!1},computedWidth:0}},computed:{scrollable:function(){return this.tabs.length>this.swipeThreshold},wrapStyle:function(){switch(this.position){case"top":return{top:this.offsetTop+"px",position:"fixed"};case"bottom":return{top:"auto",bottom:0};default:return null}},navStyle:function(){return{borderColor:this.color}},trackStyle:function(){var t=this.curActive,e=this.computedWidth,n=void 0===e?0:e,i=this.tabs;if(!this.animated)return{};var s=-1*n*t;return{width:n*i.length+"px",transitionDuration:this.duration+"s",transform:"translateX("+s+"px)"}}},watch:{active:function(t){t!==this.curActive&&this.correctActive(t)},color:function(){this.setLine()},tabs:function(t){this.correctActive(this.curActive||this.active),this.scrollIntoView(),this.setLine()},curActive:function(){this.scrollIntoView(),this.setLine(),"top"!==this.position&&"bottom"!==this.position||N.setScrollTop(window,N.getElementTop(this.$el))},sticky:function(){this.handlers(!0)},swipeable:function(){this.handlers(!0)}},mounted:function(){var t=this;this.correctActive(this.active),this.setLine(),this.setWidth(),this.$nextTick(function(){t.handlers(!0),t.scrollIntoView(!0)})},activated:function(){var t=this;this.$nextTick(function(){t.handlers(!0),t.scrollIntoView(!0)})},deactivated:function(){this.handlers(!1)},beforeDestroy:function(){this.handlers(!1)},methods:{setWidth:function(){if(this.$el){var t=this.$el.getBoundingClientRect()||{};this.computedWidth=t.width}},handlers:function(t){var e=this.events,n=this.sticky&&t,i=this.swipeable&&t;if(e.resize!==t&&(e.resize=t,(t?L:M)(window,"resize",this.setLine,!0)),e.sticky!==n&&(e.sticky=n,this.scrollEl=this.scrollEl||N.getScrollEventTarget(this.$el),(n?L:M)(this.scrollEl,"scroll",this.onScroll,!0),this.onScroll()),e.swipeable!==i){e.swipeable=i;var s=this.$refs.content,o=i?L:M;o(s,"touchstart",this.touchStart),o(s,"touchmove",this.touchMove),o(s,"touchend",this.onTouchEnd),o(s,"touchcancel",this.onTouchEnd)}},onTouchEnd:function(){var t=this.direction,e=this.deltaX,n=this.curActive;"horizontal"===t&&this.offsetX>=50&&(e>0&&0!==n?this.setCurActive(n-1):e<0&&n!==this.tabs.length-1&&this.setCurActive(n+1))},onScroll:function(){var t=N.getScrollTop(window)+this.offsetTop,e=N.getElementTop(this.$el),n=e+this.$el.offsetHeight-this.$refs.wrap.offsetHeight;this.position=t>n?"bottom":t>e?"top":"";var i={scrollTop:t,isFixed:"top"===this.position};this.$emit("scroll",i)},setLine:function(){var t=this;this.$nextTick(function(){var e=t.$refs.tabs;if(e&&"line"===t.type){var n=e[t.curActive],i=t.isDef(t.lineWidth)?t.lineWidth:n.offsetWidth/2,s=n.offsetLeft+(n.offsetWidth-i)/2;t.lineStyle={width:i+"px",backgroundColor:t.color,transform:"translateX("+s+"px)",transitionDuration:t.duration+"s"}}})},correctActive:function(t){t=+t;var e=this.tabs.some(function(e){return e.index===t}),n=(this.tabs[0]||{}).index||0;this.setCurActive(e?t:n)},setCurActive:function(t){t=this.findAvailableTab(t,t=0&&i10?n:"0"+n)+":00"}if(!e){var i=t.split(":"),s=i[0],o=i[1];return(s=this.pad(Object(a.g)(s,this.minHour,this.maxHour)))+":"+(o=this.pad(Object(a.g)(o,this.minMinute,this.maxMinute)))}return t=Math.max(t,this.minDate.getTime()),t=Math.min(t,this.maxDate.getTime()),new Date(t)},times:function(t,e){for(var n=-1,i=Array(t);++nr?r:l;var u=0,c=0;"datetime"===this.type&&(u=this.getTrueValue(s[3]),c=this.getTrueValue(s[4])),e=new Date(o,a-1,l,u,c)}this.innerValue=this.correctValue(e),this.$nextTick(function(){n.$nextTick(function(){n.$emit("change",t)})})},updateColumnValue:function(t){var e=this,n=[],i=this.formatter,s=this.pad;if("time"===this.type){var o=t.split(":");n=[i("hour",o[0]),i("minute",o[1])]}else n=[i("year",""+t.getFullYear()),i("month",s(t.getMonth()+1)),i("day",s(t.getDate()))],"datetime"===this.type&&n.push(i("hour",s(t.getHours())),i("minute",s(t.getMinutes()))),"year-month"===this.type&&(n=n.slice(0,2));this.$nextTick(function(){e.$refs.picker.setValues(n)})}},mounted:function(){this.updateColumnValue(this.innerValue)}}),qt=B({render:function(){var t=this.$createElement;return(this._self._c||t)("div",{class:this.b()},[this._t("default")],2)},name:"goods-action"}),Xt=B({render:function(){var t=this,e=t.$createElement;return(t._self._c||e)("van-button",{class:t.b(),attrs:{square:"",size:"large",loading:t.loading,disabled:t.disabled,type:t.primary?"danger":"warning"},on:{click:t.onClick}},[t._t("default",[t._v(t._s(t.text))])],2)},name:"goods-action-big-btn",mixins:[C],components:{VanButton:R},props:{text:String,primary:Boolean,loading:Boolean,disabled:Boolean},methods:{onClick:function(t){this.$emit("click",t),this.routerLink()}}}),Kt=B({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"van-hairline",class:t.b(),on:{click:t.onClick}},[n("icon",{class:[t.b("icon"),t.iconClass],attrs:{info:t.info,name:t.icon}}),t._t("default",[t._v(t._s(t.text))])],2)},name:"goods-action-mini-btn",mixins:[C],props:{text:String,info:[String,Number],icon:String,iconClass:String},methods:{onClick:function(t){this.$emit("click",t),this.routerLink()}}}),Qt=B({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.b()},[n("div",{class:t.b("track"),style:t.trackStyle,on:{touchstart:t.onTouchStart,touchmove:t.onTouchMove,touchend:t.onTouchEnd,touchcancel:t.onTouchEnd,transitionend:function(e){t.$emit("change",t.activeIndicator)}}},[t._t("default")],2),t._t("indicator",[t.showIndicators&&t.count>1?n("div",{class:t.b("indicators",{vertical:t.vertical})},t._l(t.count,function(e){return n("i",{class:t.b("indicator",{active:e-1===t.activeIndicator}),style:t.indicatorStyle})})):t._e()])],2)},name:"swipe",mixins:[P],props:{width:Number,height:Number,autoplay:Number,vertical:Boolean,initialSwipe:Number,indicatorColor:String,loop:{type:Boolean,default:!0},touchable:{type:Boolean,default:!0},showIndicators:{type:Boolean,default:!0},duration:{type:Number,default:500}},data:function(){return{computedWidth:0,computedHeight:0,offset:0,active:0,deltaX:0,deltaY:0,swipes:[],swiping:!1}},mounted:function(){this.initialize(),this.$isServer||L(window,"resize",this.onResize,!0)},destroyed:function(){this.clear(),this.$isServer||M(window,"resize",this.onResize)},watch:{swipes:function(){this.initialize()},initialSwipe:function(){this.initialize()},autoplay:function(t){t?this.autoPlay():this.clear()}},computed:{count:function(){return this.swipes.length},delta:function(){return this.vertical?this.deltaY:this.deltaX},size:function(){return this[this.vertical?"computedHeight":"computedWidth"]},trackSize:function(){return this.count*this.size},activeIndicator:function(){return(this.active+this.count)%this.count},isCorrectDirection:function(){var t=this.vertical?"vertical":"horizontal";return this.direction===t},trackStyle:function(){var t,e=this.vertical?"height":"width",n=this.vertical?"width":"height";return(t={})[e]=this.trackSize+"px",t[n]=this[n]?this[n]+"px":"",t.transitionDuration=(this.swiping?0:this.duration)+"ms",t.transform="translate"+(this.vertical?"Y":"X")+"("+this.offset+"px)",t},indicatorStyle:function(){return{backgroundColor:this.indicatorColor}}},methods:{initialize:function(t){if(void 0===t&&(t=this.initialSwipe),clearTimeout(this.timer),this.$el){var e=this.$el.getBoundingClientRect();this.computedWidth=this.width||e.width,this.computedHeight=this.height||e.height}this.swiping=!0,this.active=t,this.offset=this.count>1?-this.size*this.active:0,this.swipes.forEach(function(t){t.offset=0}),this.autoPlay()},onResize:function(){this.initialize(this.activeIndicator)},onTouchStart:function(t){this.touchable&&(this.clear(),this.swiping=!0,this.touchStart(t),this.correctPosition())},onTouchMove:function(t){this.touchable&&this.swiping&&(this.touchMove(t),this.isCorrectDirection&&(t.preventDefault(),t.stopPropagation(),this.move(0,Math.min(Math.max(this.delta,-this.size),this.size))))},onTouchEnd:function(){if(this.touchable&&this.swiping){if(this.delta&&this.isCorrectDirection){var t=this.vertical?this.offsetY:this.offsetX;this.move(t>0?this.delta>0?-1:1:0)}this.swiping=!1,this.autoPlay()}},move:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0);var n=this.delta,i=this.active,s=this.count,o=this.swipes,a=this.trackSize,r=0===i,l=i===s-1;!this.loop&&(r&&(e>0||t<0)||l&&(e<0||t>0))||s<=1||(o[0].offset=l&&(n<0||t>0)?a:0,o[s-1].offset=r&&(n>0||t<0)?-a:0,t&&i+t>=-1&&i+t<=s&&(this.active+=t),this.offset=e-this.active*this.size)},swipeTo:function(t){var e=this;this.swiping=!0,this.correctPosition(),setTimeout(function(){e.swiping=!1,e.move(t%e.count-e.active)},30)},correctPosition:function(){this.active<=-1&&this.move(this.count),this.active>=this.count&&this.move(-this.count)},clear:function(){clearTimeout(this.timer)},autoPlay:function(){var t=this,e=this.autoplay;e&&this.count>1&&(this.clear(),this.timer=setTimeout(function(){t.swiping=!0,t.resetTouchStatus(),t.correctPosition(),setTimeout(function(){t.swiping=!1,t.move(1),t.autoPlay()},30)},e))}}}),Ut=B({render:function(){var t=this.$createElement;return(this._self._c||t)("div",{class:this.b(),style:this.style},[this._t("default")],2)},name:"swipe-item",data:function(){return{offset:0}},computed:{style:function(){var t=this.$parent,e=t.vertical,n=t.computedWidth,i=t.computedHeight;return{width:n+"px",height:e?i+"px":"100%",transform:"translate"+(e?"Y":"X")+"("+this.offset+"px)"}}},beforeCreate:function(){this.$parent.swipes.push(this)},destroyed:function(){this.$parent.swipes.splice(this.$parent.swipes.indexOf(this),1)}}),Gt=B({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"van-fade"}},[t.value?n("div",{class:t.b(),on:{touchstart:t.onWrapperTouchStart,touchend:t.onWrapperTouchEnd,touchcancel:t.onWrapperTouchEnd}},[t.showIndex?n("div",{class:t.b("index")},[t._v("\n "+t._s(t.active+1)+"/"+t._s(t.count)+"\n ")]):t._e(),n("swipe",{ref:"swipe",attrs:{loop:t.loop,"indicator-color":"white","initial-swipe":t.startPosition,"show-indicators":t.showIndicators},on:{change:t.onChange}},t._l(t.images,function(e,i){return n("swipe-item",{key:i},[n("img",{class:t.b("image"),style:i===t.active?t.imageStyle:null,attrs:{src:e},on:{touchstart:t.onTouchStart,touchmove:t.onTouchMove,touchend:t.onTouchEnd,touchcancel:t.onTouchEnd}})])}))],1):t._e()])},name:"image-preview",mixins:[V,P],components:{Swipe:Qt,SwipeItem:Ut},props:{images:Array,asyncClose:Boolean,startPosition:Number,showIndicators:Boolean,loop:{type:Boolean,default:!0},overlay:{type:Boolean,default:!0},showIndex:{type:Boolean,default:!0},overlayClass:{type:String,default:"van-image-preview__overlay"},closeOnClickOverlay:{type:Boolean,default:!0}},data:function(){return{scale:1,moveX:0,moveY:0,moving:!1,zooming:!1,active:0}},computed:{count:function(){return this.images.length},imageStyle:function(){var t=this.scale,e={transition:this.zooming||this.moving?"":".3s all"};return 1!==t&&(e.transform="scale3d("+t+", "+t+", 1) translate("+this.moveX/t+"px, "+this.moveY/t+"px)"),e}},watch:{value:function(){this.active=this.startPosition},startPosition:function(t){this.active=t}},methods:{onWrapperTouchStart:function(){this.touchStartTime=new Date},onWrapperTouchEnd:function(t){t.preventDefault();var e=new Date-this.touchStartTime,n=this.$refs.swipe||{},i=n.offsetX,s=void 0===i?0:i,o=n.offsetY;if(e<300&&s<10&&(void 0===o?0:o)<10){var a=this.active;this.resetScale(),this.$emit("close",{index:a,url:this.images[a]}),this.asyncClose||this.$emit("input",!1)}},getDistance:function(t){return Math.sqrt(Math.abs((t[0].clientX-t[1].clientX)*(t[0].clientY-t[1].clientY)))},startMove:function(t){var e=t.currentTarget.getBoundingClientRect(),n=window.innerWidth,i=window.innerHeight;this.touchStart(t),this.moving=!0,this.startMoveX=this.moveX,this.startMoveY=this.moveY,this.maxMoveX=Math.max(0,(e.width-n)/2),this.maxMoveY=Math.max(0,(e.height-i)/2)},startZoom:function(t){this.moving=!1,this.zooming=!0,this.startScale=this.scale,this.startDistance=this.getDistance(t.touches)},onTouchStart:function(t){var e=t.touches,n=(this.$refs.swipe||{}).offsetX,i=void 0===n?0:n;1===e.length&&1!==this.scale?this.startMove(t):2!==e.length||i||this.startZoom(t)},onTouchMove:function(t){var e=t.touches;if((this.moving||this.zooming)&&(t.preventDefault(),t.stopPropagation()),this.moving){this.touchMove(t);var n=this.deltaX+this.startMoveX,i=this.deltaY+this.startMoveY;this.moveX=Object(a.g)(n,-this.maxMoveX,this.maxMoveX),this.moveY=Object(a.g)(i,-this.maxMoveY,this.maxMoveY)}if(this.zooming&&2===e.length){var s=this.getDistance(e),o=this.startScale*s/this.startDistance;this.scale=Object(a.g)(o,1/3,3)}},onTouchEnd:function(t){if(this.moving||this.zooming){var e=!0;this.moving&&this.startMoveX===this.moveX&&this.startMoveY===this.moveY&&(e=!1),t.touches.length||(this.moving=!1,this.zooming=!1,this.startMoveX=0,this.startMoveY=0,this.startScale=1,this.scale<1&&this.resetScale()),e&&(t.preventDefault(),t.stopPropagation())}},onChange:function(t){this.resetScale(),this.active=t},resetScale:function(){this.scale=1,this.moveX=0,this.moveY=0}}}),Zt={images:[],loop:!0,value:!0,showIndex:!0,asyncClose:!1,startPosition:0,showIndicators:!1},Jt=function(t,e){if(void 0===e&&(e=0),!a.f){pt||(pt=new(o.a.extend(Gt))({el:document.createElement("div")}),document.body.appendChild(pt.$el));var n=Array.isArray(t)?{images:t,startPosition:e}:t;return i(pt,i({},Zt,n)),pt.$once("input",function(t){pt.value=t}),n.onClose&&pt.$once("close",n.onClose),pt}};Jt.install=function(){o.a.use(Gt)};var te,ee,ne=Jt,ie=n(3),se=n.n(ie).a,oe=B({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.b()},[t._t("default"),t.loading?n("div",{class:t.b("loading")},[t._t("loading",[n("loading",{class:t.b("loading-icon")}),n("span",{class:t.b("loading-text")},[t._v(t._s(t.loadingText||t.$t("loadingTip")))])])],2):t._e(),t.finished&&t.finishedText?n("div",{class:t.b("finished-text")},[t._v("\n "+t._s(t.finishedText)+"\n ")]):t._e()],2)},name:"list",model:{prop:"loading"},props:{loading:Boolean,finished:Boolean,loadingText:String,finishedText:String,immediateCheck:{type:Boolean,default:!0},offset:{type:Number,default:300}},mounted:function(){this.scroller=N.getScrollEventTarget(this.$el),this.handler(!0),this.immediateCheck&&this.$nextTick(this.check)},destroyed:function(){this.handler(!1)},activated:function(){this.handler(!0)},deactivated:function(){this.handler(!1)},watch:{loading:function(){this.$nextTick(this.check)},finished:function(){this.$nextTick(this.check)}},methods:{check:function(){if(!this.loading&&!this.finished){var t=this.$el,e=this.scroller,n=N.getVisibleHeight(e);if(n&&"none"!==N.getComputedStyle(t).display&&null!==t.offsetParent){var i=N.getScrollTop(e)+n,s=!1;if(t===e)s=e.scrollHeight-is&&(t.wrapWidth=s,t.offsetWidth=o,t.duration=o/t.speed,t.animationClass=t.b("play"))}})},immediate:!0}},methods:{onClickIcon:function(){this.showNoticeBar="closeable"!==this.mode},onAnimationEnd:function(){var t=this;this.firstRound=!1,this.$nextTick(function(){t.duration=(t.offsetWidth+t.wrapWidth)/t.speed,t.animationClass=t.b("play--infinite")})}}}),le=B({render:function(){var t=this.$createElement,e=this._self._c||t;return e("transition",{attrs:{name:"van-slide-down"}},[e("div",{directives:[{name:"show",rawName:"v-show",value:this.value,expression:"value"}],class:this.b(),style:this.style},[this._v("\n "+this._s(this.message)+"\n ")])])},name:"notify",mixins:[V],props:{message:[String,Number],color:{type:String,value:"#fff"},background:{type:String,value:"#f44"},duration:{type:Number,value:3e3},lockScroll:{type:Boolean,default:!1}},computed:{style:function(){return{color:this.color,background:this.background}}}}),ue=function t(e){var n;if(!a.f)return ee||(ee=new(o.a.extend(le))({el:document.createElement("div")}),document.body.appendChild(ee.$el)),e=i({},t.currentOptions,(n=e,Object(a.e)(n)?n:{message:n})),i(ee,e),clearTimeout(te),e.duration>0&&(te=setTimeout(t.clear,e.duration)),ee};ue.clear=function(){ee&&(ee.value=!1)},ue.defaultOptions={value:!0,text:"",color:"#fff",background:"#f44",duration:3e3},ue.setDefaultOptions=function(t){i(ue.currentOptions,t)},ue.resetDefaultOptions=function(){ue.currentOptions=i({},ue.defaultOptions)},ue.install=function(){o.a.use(le)},ue.resetDefaultOptions(),o.a.prototype.$notify=ue;var ce=ue,de=B({render:function(){var t=this,e=t.$createElement;return(t._self._c||e)("i",{class:["van-hairline",t.className],domProps:{textContent:t._s(t.text)},on:{touchstart:function(e){return e.stopPropagation(),e.preventDefault(),t.onFocus(e)},touchmove:t.onBlur,touchend:t.onBlur,touchcancel:t.onBlur}})},name:"key",props:{type:Array,text:[String,Number]},data:function(){return{active:!1}},computed:{className:function(){var t=this.type.slice(0);return this.active&&t.push("active"),this.b(t)}},methods:{onFocus:function(){this.active=!0,this.$emit("press",this.text)},onBlur:function(){this.active=!1}}}),he=B({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:t.transition?"van-slide-up":""}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.show,expression:"show"}],class:t.b([t.theme]),style:t.style,on:{touchstart:function(t){t.stopPropagation()},animationend:t.onAnimationEnd,webkitAnimationEnd:t.onAnimationEnd}},[t.title||t.showTitleClose?n("div",{staticClass:"van-hairline--top",class:t.b("title")},[n("span",{domProps:{textContent:t._s(t.title)}}),t.showTitleClose?n("span",{class:t.b("close"),domProps:{textContent:t._s(t.closeButtonText)},on:{click:t.onClose}}):t._e()]):t._e(),n("div",{class:t.b("body")},t._l(t.keys,function(e){return n("key",{key:e.text,attrs:{text:e.text,type:e.type},on:{press:t.onPressKey}})})),"custom"===t.theme?n("div",{class:t.b("sidebar")},[n("key",{attrs:{text:t.deleteText,type:["delete","big","gray"]},on:{press:t.onPressKey}}),n("key",{attrs:{text:t.closeButtonText,type:["blue","big"]},on:{press:t.onPressKey}})],1):t._e()])])},name:"number-keyboard",components:{Key:de},props:{show:Boolean,title:String,closeButtonText:String,deleteButtonText:String,theme:{type:String,default:"default"},extraKey:{type:String,default:""},zIndex:{type:Number,default:100},transition:{type:Boolean,default:!0},showDeleteKey:{type:Boolean,default:!0},hideOnClickOutside:{type:Boolean,default:!0}},mounted:function(){this.handler(!0)},destroyed:function(){this.handler(!1)},activated:function(){this.handler(!0)},deactivated:function(){this.handler(!1)},watch:{show:function(){this.transition||this.$emit(this.show?"show":"hide")}},computed:{keys:function(){for(var t=[],e=1;e<=9;e++)t.push({text:e});switch(this.theme){case"default":t.push({text:this.extraKey,type:["gray"]},{text:0},{text:this.deleteText,type:["gray","delete"]});break;case"custom":t.push({text:0,type:["middle"]},{text:this.extraKey})}return t},style:function(){return{zIndex:this.zIndex}},showTitleClose:function(){return this.closeButtonText&&"default"===this.theme},deleteText:function(){return this.deleteButtonText||this.$t("delete")}},methods:{handler:function(t){this.$isServer||t!==this.handlerStatus&&this.hideOnClickOutside&&(this.handlerStatus=t,document.body[(t?"add":"remove")+"EventListener"]("touchstart",this.onBlur))},onBlur:function(){this.$emit("blur")},onClose:function(){this.$emit("close"),this.onBlur()},onAnimationEnd:function(){this.$emit(this.show?"show":"hide")},onPressKey:function(t){""!==t&&(t===this.deleteText?this.$emit("delete"):t===this.closeButtonText?this.onClose():this.$emit("input",t))}}}),fe=B({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ul",{class:t.b({simple:!t.isMultiMode})},[n("li",{staticClass:"van-hairline",class:[t.b("item",{disabled:1===t.value}),t.b("prev")],on:{click:function(e){t.selectPage(t.value-1)}}},[t._v("\n "+t._s(t.prevText||t.$t("prev"))+"\n ")]),t._l(t.pages,function(e){return n("li",{staticClass:"van-hairline",class:[t.b("item",{active:e.active}),t.b("page")],on:{click:function(n){t.selectPage(e.number)}}},[t._v("\n "+t._s(e.text)+"\n ")])}),t.isMultiMode?t._e():n("li",{class:t.b("page-desc")},[t._t("pageDesc",[t._v(t._s(t.pageDesc))])],2),n("li",{staticClass:"van-hairline",class:[t.b("item",{disabled:t.value===t.computedPageCount}),t.b("next")],on:{click:function(e){t.selectPage(t.value+1)}}},[t._v("\n "+t._s(t.nextText||t.$t("next"))+"\n ")])],2)},name:"pagination",props:{value:Number,prevText:String,nextText:String,pageCount:Number,totalItems:Number,forceEllipses:Boolean,mode:{type:String,default:"multi"},itemsPerPage:{type:Number,default:10},showPageSize:{type:Number,default:5}},computed:{isMultiMode:function(){return"multi"===this.mode},computedPageCount:function(){var t=this.pageCount||Math.ceil(this.totalItems/this.itemsPerPage);return Math.max(1,t)},pageDesc:function(){return this.value+"/"+this.computedPageCount},pages:function(){var t=[],e=this.computedPageCount;if(!this.isMultiMode)return t;var n=1,i=e,s=void 0!==this.showPageSize&&this.showPageSizee&&(n=(i=e)-this.showPageSize+1);for(var o=n;o<=i;o++){var a=this.makePage(o,o,o===this.value);t.push(a)}if(s&&this.showPageSize>0&&this.forceEllipses){if(n>1){var r=this.makePage(n-1,"...",!1);t.unshift(r)}if(i=0&&t<=100}},showPivot:{type:Boolean,default:!0},color:{type:String,default:"#1989fa"},textColor:{type:String,default:"#fff"}},data:function(){return{pivotWidth:0,progressWidth:0}},computed:{text:function(){return this.isDef(this.pivotText)?this.pivotText:this.percentage+"%"},currentColor:function(){return this.inactive?"#cacaca":this.color},pivotStyle:function(){return{color:this.textColor,background:this.pivotColor||this.currentColor}},portionStyle:function(){return{width:(this.progressWidth-this.pivotWidth)*this.percentage/100+"px",background:this.currentColor}}},mounted:function(){this.getWidth()},watch:{showPivot:function(){this.getWidth()},pivotText:function(){this.getWidth()}},methods:{getWidth:function(){this.progressWidth=this.$el.offsetWidth,this.pivotWidth=this.$refs.pivot?this.$refs.pivot.offsetWidth:0}}}),ge=B({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.b()},[n("div",{class:t.b("track"),style:t.style,on:{touchstart:t.onTouchStart,touchmove:t.onTouchMove,touchend:t.onTouchEnd,touchcancel:t.onTouchEnd}},[n("div",{class:t.b("head")},["normal"===t.status?t._t("normal"):t._e(),"pulling"===t.status?t._t("pulling",[n("span",{class:t.b("text")},[t._v(t._s(t.pullingText||t.$t("pulling")))])]):t._e(),"loosing"===t.status?t._t("loosing",[n("span",{class:t.b("text")},[t._v(t._s(t.loosingText||t.$t("loosing")))])]):t._e(),"loading"===t.status?t._t("loading",[n("div",{class:t.b("loading")},[n("loading"),n("span",[t._v(t._s(t.loadingText||t.$t("loadingTip")))])],1)]):t._e()],2),t._t("default")],2)])},name:"pull-refresh",mixins:[P],props:{disabled:Boolean,pullingText:String,loosingText:String,loadingText:String,value:{type:Boolean,required:!0},animationDuration:{type:Number,default:300},headHeight:{type:Number,default:50}},data:function(){return{status:"normal",height:0,duration:0}},computed:{style:function(){return{transition:this.duration+"ms",transform:"translate3d(0,"+this.height+"px, 0)"}},untouchable:function(){return"loading"===this.status||this.disabled}},mounted:function(){this.scrollEl=N.getScrollEventTarget(this.$el)},watch:{value:function(t){this.duration=this.animationDuration,this.getStatus(t?this.headHeight:0,t)}},methods:{onTouchStart:function(t){this.untouchable||this.getCeiling()&&(this.duration=0,this.touchStart(t))},onTouchMove:function(t){this.untouchable||(this.touchMove(t),!this.ceiling&&this.getCeiling()&&(this.duration=0,this.startY=t.touches[0].clientY,this.deltaY=0),this.ceiling&&this.deltaY>=0&&"vertical"===this.direction&&(this.getStatus(this.ease(this.deltaY)),t.cancelable&&t.preventDefault()))},onTouchEnd:function(){this.untouchable||this.ceiling&&this.deltaY&&(this.duration=this.animationDuration,"loosing"===this.status?(this.getStatus(this.headHeight,!0),this.$emit("input",!0),this.$emit("refresh")):this.getStatus(0))},getCeiling:function(){return this.ceiling=0===N.getScrollTop(this.scrollEl),this.ceiling},ease:function(t){var e=this.headHeight;return t0},Ie={normalizeSkuTree:Ce,getSkuComb:Te,getSelectedSkuValues:Be,isAllSelected:$e,isSkuChoosable:Ee},De=B({render:function(){var t=this.$createElement;return(this._self._c||t)("span",{staticClass:"van-sku-row__item",class:{"van-sku-row__item--active":this.isChoosed,"van-sku-row__item--disabled":!this.isChoosable},on:{click:this.onSelect}},[this._v("\n "+this._s(this.skuValue.name)+"\n")])},name:"sku-row-item",props:{skuEventBus:Object,skuValue:Object,skuList:Array,selectedSku:Object,skuKeyStr:String},computed:{isChoosed:function(){return this.skuValue.id===this.selectedSku[this.skuKeyStr]},isChoosable:function(){return Ee(this.skuList,this.selectedSku,{key:this.skuKeyStr,valueId:this.skuValue.id})}},methods:{onSelect:function(){this.isChoosable&&this.skuEventBus.$emit("sku:select",i({},this.skuValue,{skuKeyStr:this.skuKeyStr}))}}}),Ae=B({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.b()},[n("button",{class:t.b("minus",{disabled:t.minusDisabled}),on:{click:function(e){t.onChange("minus")}}}),n("input",{class:t.b("input"),attrs:{type:"number",disabled:t.disabled||t.disableInput},domProps:{value:t.currentValue},on:{input:t.onInput,blur:t.onBlur}}),n("button",{class:t.b("plus",{disabled:t.plusDisabled}),on:{click:function(e){t.onChange("plus")}}})])},name:"stepper",props:{value:null,integer:Boolean,disabled:Boolean,disableInput:Boolean,min:{type:[String,Number],default:1},max:{type:[String,Number],default:1/0},step:{type:[String,Number],default:1},defaultValue:{type:[String,Number],default:1}},data:function(){var t=this.range(this.isDef(this.value)?this.value:this.defaultValue);return t!==+this.value&&this.$emit("input",t),{currentValue:t}},computed:{minusDisabled:function(){return this.disabled||this.currentValue<=this.min},plusDisabled:function(){return this.disabled||this.currentValue>=this.max}},watch:{value:function(t){t!==this.currentValue&&(this.currentValue=this.format(t))},currentValue:function(t){this.$emit("input",t),this.$emit("change",t)}},methods:{format:function(t){return""===(t=String(t).replace(/[^0-9\.-]/g,""))?0:this.integer?Math.floor(t):+t},range:function(t){return Math.max(Math.min(this.max,this.format(t)),this.min)},onInput:function(t){var e=t.target.value,n=this.format(e);+e!==n&&(t.target.value=n),this.currentValue=n},onChange:function(t){if(this[t+"Disabled"])this.$emit("overlimit",t);else{var e="minus"===t?-this.step:+this.step,n=Math.round(100*(this.currentValue+e))/100;this.currentValue=this.range(n),this.$emit(t)}},onBlur:function(t){this.currentValue=this.range(this.currentValue),this.$emit("blur",t)}}}),Ne=Se.QUOTA_LIMIT,Oe=Se.STOCK_LIMIT,Fe=B({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"van-sku-stepper-stock"},[n("div",{staticClass:"van-sku-stepper-container"},[n("div",{staticClass:"van-sku__stepper-title"},[t._v(t._s(t.stepperTitle||"购买数量")+":")]),n("stepper",{staticClass:"van-sku__stepper",attrs:{min:1,max:t.stepperLimit,"disable-input":t.disableStepperInput},on:{overlimit:t.onOverLimit,change:t.onChange},model:{value:t.currentNum,callback:function(e){t.currentNum=e},expression:"currentNum"}})],1),t.hideStock?t._e():n("div",{staticClass:"van-sku__stock"},[t._v("\n "+t._s(t.stockText)+"\n ")]),!t.hideQuotaText&&t.quotaText?n("div",{staticClass:"van-sku__quota"},[t._v("\n "+t._s(t.quotaText)+"\n ")]):t._e()])},name:"sku-stepper",components:{Stepper:Ae},props:{quota:Number,hideQuotaText:Boolean,quotaUsed:Number,hideStock:Boolean,skuEventBus:Object,skuStockNum:Number,selectedSku:Object,selectedSkuComb:Object,selectedNum:Number,stepperTitle:String,disableStepperInput:Boolean,customStepperConfig:Object},data:function(){return{currentNum:this.selectedNum,limitType:Oe}},watch:{currentNum:function(t){this.skuEventBus.$emit("sku:numChange",t)},stepperLimit:function(t){t0&&(n="每人限购"+this.quota+"件"),n},stepperLimit:function(){var t,e=this.quota-this.quotaUsed;return this.quota>0&&e<=this.stock?(t=e<0?0:e,this.limitType=Ne):(t=this.stock,this.limitType=Oe),t}},methods:{setCurrentNum:function(t){this.currentNum=t},onOverLimit:function(t){this.skuEventBus.$emit("sku:overLimit",{action:t,limitType:this.limitType,quota:this.quota,quotaUsed:this.quotaUsed})},onChange:function(t){var e=this.customStepperConfig.handleStepperChange;e&&e(t),this.$emit("change",t)}}});function Le(t){return/^((([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(t)}function Me(t){return/^\d+$/.test(t)}var ze=B({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.b()},[t._t("default"),n("input",t._b({ref:"input",class:t.b("input"),attrs:{type:"file",accept:t.accept,disabled:t.disabled},on:{change:t.onChange}},"input",t.$attrs,!1))],2)},name:"uploader",inheritAttrs:!1,props:{disabled:Boolean,beforeRead:Function,afterRead:Function,accept:{type:String,default:"image/*"},resultType:{type:String,default:"dataUrl"},maxSize:{type:Number,default:Number.MAX_VALUE}},methods:{onChange:function(t){var e=this,n=t.target.files;!this.disabled&&n.length&&(!(n=1===n.length?n[0]:[].slice.call(n,0))||this.beforeRead&&!this.beforeRead(n)||(Array.isArray(n)?Promise.all(n.map(this.readFile)).then(function(t){var i=!1,s=n.map(function(s,o){return s.size>e.maxSize&&(i=!0),{file:n[o],content:t[o]}});e.onAfterRead(s,i)}):this.readFile(n).then(function(t){e.onAfterRead({file:n,content:t},n.size>e.maxSize)})))},readFile:function(t){var e=this;return new Promise(function(n){var i=new FileReader;i.onload=function(t){n(t.target.result)},"dataUrl"===e.resultType?i.readAsDataURL(t):"text"===e.resultType&&i.readAsText(t)})},onAfterRead:function(t,e){e?this.$emit("oversize",t):(this.afterRead&&this.afterRead(t),this.$refs.input&&(this.$refs.input.value=""))}}}),Pe=B({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.b()},[n("van-uploader",{attrs:{disabled:!!t.paddingImg,"after-read":t.afterReadFile,"max-size":1024*t.maxSize*1024},on:{oversize:t.onOversize}},[n("div",{class:t.b("header")},[t.paddingImg?n("div",[t._v("正在上传...")]):[n("icon",{attrs:{name:"photograph"}}),n("span",{staticClass:"label"},[t._v(t._s(t.value?"重拍":"拍照"))]),t._v(" 或\n "),n("icon",{attrs:{name:"photo"}}),n("span",{staticClass:"label"},[t._v(t._s(t.value?"重新选择照片":"选择照片"))])]],2)]),t.paddingImg||t.imgList.length>0?n("div",{staticClass:"van-clearfix"},[t._l(t.imgList,function(e){return n("div",{class:t.b("img")},[n("img",{attrs:{src:e}}),n("icon",{class:t.b("delete"),attrs:{name:"clear"},on:{click:function(e){t.$emit("input","")}}})],1)}),t.paddingImg?n("div",{class:t.b("img")},[n("img",{attrs:{src:t.paddingImg}}),n("loading",{class:t.b("uploading"),attrs:{type:"spinner"}})],1):t._e()],2):t._e()],1)},name:"sku-img-uploader",components:{VanUploader:ze},props:{value:String,uploadImg:Function,maxSize:{type:Number,default:6}},data:function(){return{paddingImg:""}},computed:{imgList:function(){return this.value&&!this.paddingImg?[this.value]:[]}},methods:{afterReadFile:function(t){var e=this;this.paddingImg=t.content,this.uploadImg(t.file,t.content).then(function(t){e.$emit("input",t),e.$nextTick(function(){e.paddingImg=""})}).catch(function(){e.paddingImg=""})},onOversize:function(){this.$toast("最大可上传图片为"+this.maxSize+"MB,请尝试压缩图片尺寸")}}}),Ve={id_no:"输入身份证号码",text:"输入文本",tel:"输入数字",email:"输入邮箱",date:"点击选择日期",time:"点击选择时间",textarea:"点击填写段落文本",mobile:"输入手机号码"},je=B({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("cell-group",{class:t.b()},[t._l(t.messages,function(e,i){return["image"===e.type?n("cell",{key:t.goodsId+"-"+i,class:t.b("image-cell"),attrs:{label:"仅限一张",required:"1"==e.required,title:e.name}},[n("sku-img-uploader",{attrs:{"upload-img":t.messageConfig.uploadImg,"max-size":t.messageConfig.uploadMaxSize},model:{value:t.messageValues[i].value,callback:function(e){t.$set(t.messageValues[i],"value",e)},expression:"messageValues[index].value"}})],1):n("field",{key:t.goodsId+"-"+i,attrs:{maxlength:"200",required:"1"==e.required,label:e.name,placeholder:t.getPlaceholder(e),type:t.getType(e)},model:{value:t.messageValues[i].value,callback:function(e){t.$set(t.messageValues[i],"value",e)},expression:"messageValues[index].value"}})]})],2)},name:"sku-messages",components:{SkuImgUploader:Pe,Field:H},props:{messages:Array,messageConfig:Object,goodsId:[Number,String]},data:function(){return{messageValues:this.resetMessageValues(this.messages)}},watch:{messages:function(t){this.messageValues=this.resetMessageValues(t)}},computed:{messagePlaceholderMap:function(){return this.messageConfig.placeholderMap||{}}},methods:{resetMessageValues:function(t){return(t||[]).map(function(){return{value:""}})},getType:function(t){return 1==+t.multiple?"textarea":"id_no"===t.type?"text":t.datetime>0?"datetime-local":t.type},getMessages:function(){var t=this,e={};return this.messageValues.forEach(function(n,i){var s=n.value;t.messages[i].datetime>0&&(s=s.replace(/T/g," ")),e["message_"+i]=s}),e},getCartMessages:function(){var t=this,e={};return this.messageValues.forEach(function(n,i){var s=n.value,o=t.messages[i];o.datetime>0&&(s=s.replace(/T/g," ")),e[o.name]=s}),e},getPlaceholder:function(t){var e=1==+t.multiple?"textarea":t.type;return this.messagePlaceholderMap[e]||Ve[e]},validateMessages:function(){for(var t=this.messageValues,e=0;e18))return"请填写正确的身份证号码"}}}}}),He=B({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.b()},[t.showAddCartBtn?n("van-button",{attrs:{"bottom-action":"",text:"加入购物车"},on:{click:function(e){t.skuEventBus.$emit("sku:addCart")}}}):t._e(),n("van-button",{attrs:{type:"primary","bottom-action":"",text:t.buyText||"立即购买"},on:{click:function(e){t.skuEventBus.$emit("sku:buy")}}})],1)},name:"sku-actions",components:{VanButton:R},props:{buyText:String,skuEventBus:Object,showAddCartBtn:Boolean}}),Re=Se.QUOTA_LIMIT,We=B({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.isSkuEmpty?t._e():n("popup",{staticClass:"van-sku-container",attrs:{position:"bottom","close-on-click-overlay":t.closeOnClickOverlay,"get-container":t.getContainer},model:{value:t.show,callback:function(e){t.show=e},expression:"show"}},[t._t("sku-header",[n("sku-header",{attrs:{"sku-event-bus":t.skuEventBus,"selected-sku":t.selectedSku,goods:t.goods,sku:t.sku}},[t._t("sku-header-price",[n("div",{staticClass:"van-sku__goods-price"},[n("span",{staticClass:"van-sku__price-symbol"},[t._v("¥")]),n("span",{staticClass:"van-sku__price-num"},[t._v(t._s(t.price))])])],{price:t.price,selectedSkuComb:t.selectedSkuComb})],2)],{skuEventBus:t.skuEventBus,selectedSku:t.selectedSku,selectedSkuComb:t.selectedSkuComb}),n("div",{staticClass:"van-sku-body",style:t.bodyStyle},[t._t("sku-body-top",null,{selectedSku:t.selectedSku,skuEventBus:t.skuEventBus}),t._t("sku-group",[t.hasSku?n("div",{staticClass:"van-sku-group-container van-hairline--bottom"},t._l(t.skuTree,function(e,i){return n("sku-row",{key:i,attrs:{"sku-row":e}},t._l(e.v,function(i,s){return n("sku-row-item",{key:s,attrs:{"sku-key-str":e.k_s,"sku-value":i,"sku-event-bus":t.skuEventBus,"selected-sku":t.selectedSku,"sku-list":t.sku.list}})}))})):t._e()],{selectedSku:t.selectedSku,skuEventBus:t.skuEventBus}),t._t("extra-sku-group",null,{skuEventBus:t.skuEventBus}),t._t("sku-stepper",[n("sku-stepper",{ref:"skuStepper",attrs:{"sku-event-bus":t.skuEventBus,"selected-sku":t.selectedSku,"selected-sku-comb":t.selectedSkuComb,"selected-num":t.selectedNum,"stepper-title":t.stepperTitle,"sku-stock-num":t.sku.stock_num,"hide-quota-text":t.hideQuotaText,quota:t.quota,"quota-used":t.quotaUsed,"disable-stepper-input":t.disableStepperInput,"hide-stock":t.hideStock,"custom-stepper-config":t.customStepperConfig},on:{change:function(e){t.$emit("stepper-change",e)}}})],{skuEventBus:t.skuEventBus,selectedSku:t.selectedSku,selectedSkuComb:t.selectedSkuComb,selectedNum:t.selectedNum}),t._t("sku-messages",[n("sku-messages",{ref:"skuMessages",attrs:{"goods-id":t.goodsId,"message-config":t.messageConfig,messages:t.sku.messages}})])],2),t._t("sku-actions",[n("sku-actions",{attrs:{"sku-event-bus":t.skuEventBus,"buy-text":t.buyText,"show-add-cart-btn":t.showAddCartBtn}})],{skuEventBus:t.skuEventBus})],2)},name:"sku",components:{Popup:W,SkuHeader:_e,SkuRow:xe,SkuRowItem:De,SkuStepper:Fe,SkuMessages:je,SkuActions:He},props:{sku:Object,goods:Object,quota:Number,value:Boolean,buyText:String,quotaUsed:Number,goodsId:[Number,String],hideStock:Boolean,hideQuotaText:Boolean,stepperTitle:String,getContainer:Function,resetStepperOnHide:Boolean,resetSelectedSkuOnHide:Boolean,disableStepperInput:Boolean,closeOnClickOverlay:Boolean,initialSku:{type:Object,default:function(){return{}}},showAddCartBtn:{type:Boolean,default:!0},bodyOffsetTop:{type:Number,default:200},messageConfig:{type:Object,default:function(){return{placeholderMap:{},uploadImg:function(){return Promise.resolve()},uploadMaxSize:5}}},customStepperConfig:{type:Object,default:function(){return{}}},customSkuValidator:Function},data:function(){return{selectedSku:{},selectedNum:1,show:this.value}},watch:{show:function(t){if(this.$emit("input",t),!t){var e=Be(this.sku.tree,this.selectedSku);this.$emit("sku-close",{selectedSkuValues:e,selectedNum:this.selectedNum,selectedSkuComb:this.selectedSkuComb}),this.resetStepperOnHide&&this.$refs.skuStepper&&this.$refs.skuStepper.setCurrentNum(1),this.resetSelectedSkuOnHide&&this.resetSelectedSku(this.skuTree)}},value:function(t){this.show=t},skuTree:function(t){this.resetSelectedSku(t)}},computed:{bodyStyle:function(){if(!this.$isServer)return{maxHeight:window.innerHeight-this.bodyOffsetTop+"px"}},isSkuCombSelected:function(){return $e(this.sku.tree,this.selectedSku)},isSkuEmpty:function(){return 0===Object.keys(this.sku).length},hasSku:function(){return!this.sku.none_sku},selectedSkuComb:function(){return this.hasSku?this.isSkuCombSelected?Te(this.sku.list,this.selectedSku):null:{id:this.sku.collection_id,price:Math.round(100*this.sku.price),stock_num:this.sku.stock_num}},price:function(){return this.selectedSkuComb?(this.selectedSkuComb.price/100).toFixed(2):this.sku.price},skuTree:function(){return this.sku.tree||[]},imageList:function(){var t=[this.goods.picture];if(this.skuTree.length>0){var e=this.skuTree.filter(function(t){return"s1"===t.k_s})[0]||{};if(!e.v)return;e.v.forEach(function(e){e.imgUrl&&t.push(e.imgUrl)})}return t}},created:function(){var t=new o.a;this.skuEventBus=t,t.$on("sku:close",this.onClose),t.$on("sku:select",this.onSelect),t.$on("sku:numChange",this.onNumChange),t.$on("sku:previewImage",this.onPreviewImage),t.$on("sku:overLimit",this.onOverLimit),t.$on("sku:addCart",this.onAddCart),t.$on("sku:buy",this.onBuy),this.resetSelectedSku(this.skuTree),this.$emit("after-sku-create",t)},methods:{resetSelectedSku:function(t){var e=this;this.selectedSku={},t.forEach(function(t){e.selectedSku[t.k_s]=e.initialSku[t.k_s]||""}),t.forEach(function(t){var n=t.k_s,i=t.v[0].id;1===t.v.length&&Ee(e.sku.list,e.selectedSku,{key:n,valueId:i})&&(e.selectedSku[n]=i)})},getSkuMessages:function(){return this.$refs.skuMessages?this.$refs.skuMessages.getMessages():{}},getSkuCartMessages:function(){return this.$refs.skuMessages?this.$refs.skuMessages.getCartMessages():{}},validateSkuMessages:function(){return this.$refs.skuMessages?this.$refs.skuMessages.validateMessages():""},validateSku:function(){if(0===this.selectedNum)return"商品已经无法购买啦";if(this.isSkuCombSelected)return this.validateSkuMessages();if(this.customSkuValidator){var t=this.customSkuValidator(this);if(t)return t}return"请先选择商品规格"},onClose:function(){this.show=!1},onSelect:function(t){var e,n;this.selectedSku=this.selectedSku[t.skuKeyStr]===t.id?i({},this.selectedSku,((e={})[t.skuKeyStr]="",e)):i({},this.selectedSku,((n={})[t.skuKeyStr]=t.id,n)),this.$emit("sku-selected",{skuValue:t,selectedSku:this.selectedSku,selectedSkuComb:this.selectedSkuComb})},onNumChange:function(t){this.selectedNum=t},onPreviewImage:function(t){var e=this,n=this.imageList.findIndex(function(e){return e===t}),i={index:n,imageList:this.imageList,indexImage:t};this.$emit("preview-on",i),ne({images:this.imageList,startPosition:n,onClose:function(){e.$emit("preview-close",i)}})},onOverLimit:function(t){var e=t.action,n=t.limitType,i=t.quota,s=t.quotaUsed,o=this.customStepperConfig.handleOverLimit;if(o)o(t);else if("minus"===e)tt("至少选择一件");else if("plus"===e)if(n===Re){var a="限购"+i+"件";s>0&&(a+=",你已购买"+s+"件"),tt(a)}else tt("库存不足")},onAddCart:function(){this.onBuyOrAddCart("add-cart")},onBuy:function(){this.onBuyOrAddCart("buy-clicked")},onBuyOrAddCart:function(t){var e=this.validateSku();e?tt(e):this.$emit(t,this.getSkuData())},getSkuData:function(){return{goodsId:this.goodsId,selectedNum:this.selectedNum,selectedSkuComb:this.selectedSkuComb,messages:this.getSkuMessages(),cartMessages:this.getSkuCartMessages()}}}});We.SkuActions=He,We.SkuHeader=_e,We.SkuMessages=je,We.SkuStepper=Fe,We.SkuRow=xe,We.SkuRowItem=De,We.skuHelper=Ie,We.skuConstants=we;var Ye,qe=We,Xe=B({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.b({disabled:t.disabled}),on:{click:function(e){return e.stopPropagation(),t.onClick(e)}}},[n("div",{class:t.b("bar"),style:t.barStyle},[n("span",{class:t.b("button"),on:{touchstart:t.onTouchStart,touchmove:function(e){return e.preventDefault(),e.stopPropagation(),t.onTouchMove(e)},touchend:t.onTouchEnd,touchcancel:t.onTouchEnd}})])])},name:"slider",mixins:[P],props:{min:Number,value:Number,disabled:Boolean,max:{type:Number,default:100},step:{type:Number,default:1},barHeight:{type:String,default:"2px"}},computed:{barStyle:function(){return{width:this.format(this.value)+"%",height:this.barHeight}}},methods:{onTouchStart:function(t){this.disabled||(this.touchStart(t),this.startValue=this.format(this.value))},onTouchMove:function(t){if(!this.disabled){this.touchMove(t);var e=this.$el.getBoundingClientRect(),n=this.deltaX/e.width*100;this.updateValue(this.startValue+n)}},onTouchEnd:function(){this.disabled||this.updateValue(this.value,!0)},onClick:function(t){if(!this.disabled){var e=this.$el.getBoundingClientRect(),n=(t.clientX-e.left)/e.width*100;this.updateValue(n,!0)}},updateValue:function(t,e){t=this.format(t),this.$emit("input",t),e&&this.$emit("change",t)},format:function(t){return Math.round(Math.max(this.min,Math.min(t,this.max))/this.step)*this.step}}}),Ke=B({render:function(){var t,e=this,n=e.$createElement,i=e._self._c||n;return i("div",{staticClass:"van-hairline",class:e.b([e.$parent.direction,(t={},t[e.status]=e.status,t)])},[i("div",{class:e.b("title"),style:e.titleStyle},[e._t("default")],2),i("div",{class:e.b("circle-container")},["process"!==e.status?i("i",{class:e.b("circle")}):i("icon",{style:{color:e.$parent.activeColor},attrs:{name:"checked"}})],1),i("div",{class:e.b("line")})])},name:"step",beforeCreate:function(){this.$parent.steps.push(this)},computed:{status:function(){var t=this.$parent.steps.indexOf(this),e=this.$parent.active;return t0&&-e>i*s&&i>0?this.open("right"):t<0&&e>n*s&&n>0?this.open("left"):this.swipeMove()},startDrag:function(t){this.disabled||(this.draging=!0,this.touchStart(t),this.opened&&(this.startX-=this.offset))},onDrag:function(t){if(!this.disabled){this.touchMove(t);var e=this.deltaX;e<0&&(-e>this.rightWidth||!this.rightWidth)||e>0&&(e>this.leftWidth||e>0&&!this.leftWidth)||"horizontal"===this.direction&&(t.preventDefault(),this.swipeMove(e))}},endDrag:function(){this.disabled||(this.draging=!1,this.swiping&&this.swipeLeaveTransition(this.offset>0?-1:1))},onClick:function(t){void 0===t&&(t="outside"),this.$emit("click",t),this.offset&&(this.onClose?this.onClose(t,this):this.swipeMove(0))}}}),Ze=B({render:function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"van-hairline--top-bottom",class:this.b({fixed:this.fixed}),style:this.style},[this._t("default")],2)},name:"tabbar",data:function(){return{items:[]}},props:{value:Number,fixed:{type:Boolean,default:!0},zIndex:{type:Number,default:1}},computed:{style:function(){return{zIndex:this.zIndex}}},watch:{items:function(){this.setActiveItem()},value:function(){this.setActiveItem()}},methods:{setActiveItem:function(){var t=this;this.items.forEach(function(e,n){e.active=n===t.value})},onChange:function(t){t!==this.value&&(this.$emit("input",t),this.$emit("change",t))}}}),Je=B({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.b({active:t.active}),on:{click:t.onClick}},[n("div",{class:t.b("icon",{dot:t.dot})},[t._t("icon",[t.icon?n("icon",{attrs:{name:t.icon}}):t._e()],{active:t.active}),n("van-info",{attrs:{info:t.info}})],2),n("div",{class:t.b("text")},[t._t("default",null,{active:t.active})],2)])},name:"tabbar-item",components:(Ye={},Ye[_.name]=_,Ye),mixins:[C],props:{icon:String,dot:Boolean,info:[String,Number]},data:function(){return{active:!1}},beforeCreate:function(){this.$parent.items.push(this)},destroyed:function(){this.$parent.items.splice(this.$parent.items.indexOf(this),1)},methods:{onClick:function(t){this.$parent.onChange(this.$parent.items.indexOf(this)),this.$emit("click",t),this.routerLink()}}}),tn=B({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.b(),style:{height:t.height+"px"}},[n("div",{class:t.b("nav")},t._l(t.items,function(e,i){return n("div",{staticClass:"van-ellipsis",class:t.b("nitem",{active:t.mainActiveIndex===i}),on:{click:function(e){t.$emit("navclick",i)}}},[t._v("\n "+t._s(e.text)+"\n ")])})),n("div",{class:t.b("content")},t._l(t.subItems,function(e){return n("div",{key:e.id,staticClass:"van-ellipsis",class:t.b("item",{active:t.activeId===e.id,disabled:e.disabled}),on:{click:function(n){t.onItemSelect(e)}}},[t._v("\n "+t._s(e.text)+"\n "),t.activeId===e.id?n("icon",{class:t.b("selected"),attrs:{name:"success"}}):t._e()],1)}))])},name:"tree-select",props:{items:Array,mainActiveIndex:Number,activeId:{type:[Number,String],default:0},height:{type:Number,default:300}},computed:{subItems:function(){return(this.items[this.mainActiveIndex]||{}).children||[]}},methods:{onItemSelect:function(t){t.disabled||this.$emit("itemclick",t)}}}),en="@@Waterfall",nn=300;function sn(){var t=this;if(!this.el[en].binded){this.el[en].binded=!0,this.scrollEventListener=function(){var t=this.el,e=this.scrollEventTarget;if(this.disabled)return;var n=N.getScrollTop(e),i=N.getVisibleHeight(e),s=n+i;if(!i)return;var o=!1;if(t===e)o=e.scrollHeight-s0}r&&this.cb.upper&&this.cb.upper({target:e,top:n})}.bind(this),this.scrollEventTarget=N.getScrollEventTarget(this.el);var e=this.el.getAttribute("waterfall-disabled"),n=!1;e&&(this.vm.$watch(e,function(e){t.disabled=e,t.scrollEventListener()}),n=Boolean(this.vm[e])),this.disabled=n;var i=this.el.getAttribute("waterfall-offset");this.offset=Number(i)||nn,L(this.scrollEventTarget,"scroll",this.scrollEventListener,!0),this.scrollEventListener()}}function on(t){t[en].vm.$nextTick(function(){sn.call(t[en])})}var an=function(t){return{bind:function(e,n,i){e[en]||(e[en]={el:e,vm:i.context,cb:{}}),e[en].cb[t]=n.value,function(t){var e=t[en];e.vm._isMounted?on(t):e.vm.$on("hook:mounted",function(){on(t)})}(e)},update:function(t){var e=t[en];e.scrollEventListener&&e.scrollEventListener()},unbind:function(t){var e=t[en];e.scrollEventTarget&&M(e.scrollEventTarget,"scroll",e.scrollEventListener)}}};an.install=function(t){t.directive("WaterfallLower",an("lower")),t.directive("WaterfallUpper",an("upper"))};var rn=an;n.d(e,"install",function(){return cn}),n.d(e,"version",function(){return ln}),n.d(e,"Actionsheet",function(){return j}),n.d(e,"AddressEdit",function(){return vt}),n.d(e,"AddressList",function(){return _t}),n.d(e,"Area",function(){return lt}),n.d(e,"Badge",function(){return xt}),n.d(e,"BadgeGroup",function(){return St}),n.d(e,"Button",function(){return R}),n.d(e,"Card",function(){return $t}),n.d(e,"Cell",function(){return $}),n.d(e,"CellGroup",function(){return T}),n.d(e,"Checkbox",function(){return Tt}),n.d(e,"CheckboxGroup",function(){return Bt}),n.d(e,"Circle",function(){return It}),n.d(e,"Col",function(){return Dt}),n.d(e,"Collapse",function(){return At}),n.d(e,"CollapseItem",function(){return Nt}),n.d(e,"ContactCard",function(){return Ot}),n.d(e,"ContactEdit",function(){return Lt}),n.d(e,"ContactList",function(){return Mt}),n.d(e,"CouponCell",function(){return zt}),n.d(e,"CouponList",function(){return Ht}),n.d(e,"DatetimePicker",function(){return Yt}),n.d(e,"Dialog",function(){return it}),n.d(e,"Field",function(){return H}),n.d(e,"GoodsAction",function(){return qt}),n.d(e,"GoodsActionBigBtn",function(){return Xt}),n.d(e,"GoodsActionMiniBtn",function(){return Kt}),n.d(e,"Icon",function(){return x}),n.d(e,"ImagePreview",function(){return ne}),n.d(e,"Info",function(){return _}),n.d(e,"Lazyload",function(){return se}),n.d(e,"List",function(){return oe}),n.d(e,"Loading",function(){return S}),n.d(e,"Locale",function(){return f}),n.d(e,"NavBar",function(){return ae}),n.d(e,"NoticeBar",function(){return re}),n.d(e,"Notify",function(){return ce}),n.d(e,"NumberKeyboard",function(){return he}),n.d(e,"Overlay",function(){return I}),n.d(e,"Pagination",function(){return fe}),n.d(e,"Panel",function(){return pe}),n.d(e,"PasswordInput",function(){return me}),n.d(e,"Picker",function(){return rt}),n.d(e,"Popup",function(){return W}),n.d(e,"Progress",function(){return ve}),n.d(e,"PullRefresh",function(){return ge}),n.d(e,"Radio",function(){return yt}),n.d(e,"RadioGroup",function(){return gt}),n.d(e,"Rate",function(){return be}),n.d(e,"Row",function(){return ye}),n.d(e,"Search",function(){return ke}),n.d(e,"Sku",function(){return qe}),n.d(e,"Slider",function(){return Xe}),n.d(e,"Step",function(){return Ke}),n.d(e,"Stepper",function(){return Ae}),n.d(e,"Steps",function(){return Qe}),n.d(e,"SubmitBar",function(){return Ue}),n.d(e,"Swipe",function(){return Qt}),n.d(e,"SwipeCell",function(){return Ge}),n.d(e,"SwipeItem",function(){return Ut}),n.d(e,"Switch",function(){return ct}),n.d(e,"SwitchCell",function(){return dt}),n.d(e,"Tab",function(){return Vt}),n.d(e,"Tabbar",function(){return Ze}),n.d(e,"TabbarItem",function(){return Je}),n.d(e,"Tabs",function(){return jt}),n.d(e,"Tag",function(){return Ct}),n.d(e,"Toast",function(){return tt}),n.d(e,"TreeSelect",function(){return tn}),n.d(e,"Uploader",function(){return ze}),n.d(e,"Waterfall",function(){return rn});var ln="1.4.8",un=[j,vt,_t,lt,xt,St,R,$t,$,T,Tt,Bt,It,Dt,At,Nt,Ot,Lt,Mt,zt,Ht,Yt,it,H,qt,Xt,Kt,x,ne,_,oe,S,f,ae,re,ce,he,I,fe,pe,me,rt,W,ve,ge,yt,gt,be,ye,ke,qe,Xe,Ke,Ae,Qe,Ue,Qt,Ge,Ut,ct,dt,Vt,Ze,Je,jt,Ct,tt,tn,ze],cn=function(t){un.forEach(function(e){t.use(e)})};"undefined"!=typeof window&&window.Vue&&cn(window.Vue);e.default={install:cn,version:ln}}])}); \ No newline at end of file diff --git a/src/main/resources/static/js/vue.min.js b/src/main/resources/static/js/vue.min.js deleted file mode 100644 index 88d54a4..0000000 --- a/src/main/resources/static/js/vue.min.js +++ /dev/null @@ -1,6 +0,0 @@ -/*! - * Vue.js v2.5.17 - * (c) 2014-2018 Evan You - * Released under the MIT License. - */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Vue=t()}(this,function(){"use strict";var y=Object.freeze({});function M(e){return null==e}function D(e){return null!=e}function S(e){return!0===e}function T(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function P(e){return null!==e&&"object"==typeof e}var r=Object.prototype.toString;function l(e){return"[object Object]"===r.call(e)}function i(e){var t=parseFloat(String(e));return 0<=t&&Math.floor(t)===t&&isFinite(e)}function t(e){return null==e?"":"object"==typeof e?JSON.stringify(e,null,2):String(e)}function F(e){var t=parseFloat(e);return isNaN(t)?e:t}function s(e,t){for(var n=Object.create(null),r=e.split(","),i=0;ie.id;)n--;bt.splice(n+1,0,e)}else bt.push(e);Ct||(Ct=!0,Ze(At))}}(this)},St.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||P(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){Fe(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},St.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},St.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},St.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||f(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var Tt={enumerable:!0,configurable:!0,get:$,set:$};function Et(e,t,n){Tt.get=function(){return this[t][n]},Tt.set=function(e){this[t][n]=e},Object.defineProperty(e,n,Tt)}function jt(e){e._watchers=[];var t=e.$options;t.props&&function(n,r){var i=n.$options.propsData||{},o=n._props={},a=n.$options._propKeys=[];n.$parent&&ge(!1);var e=function(e){a.push(e);var t=Ie(e,r,i,n);Ce(o,e,t),e in n||Et(n,"_props",e)};for(var t in r)e(t);ge(!0)}(e,t.props),t.methods&&function(e,t){e.$options.props;for(var n in t)e[n]=null==t[n]?$:v(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;l(t=e._data="function"==typeof t?function(e,t){se();try{return e.call(t,t)}catch(e){return Fe(e,t,"data()"),{}}finally{ce()}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);for(;i--;){var o=n[i];r&&p(r,o)||(void 0,36!==(a=(o+"").charCodeAt(0))&&95!==a&&Et(e,"_data",o))}var a;we(t,!0)}(e):we(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=Y();for(var i in t){var o=t[i],a="function"==typeof o?o:o.get;r||(n[i]=new St(e,a||$,$,Nt)),i in e||Lt(e,i,o)}}(e,t.computed),t.watch&&t.watch!==G&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;iparseInt(this.max)&&bn(a,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};$n=hn,Cn={get:function(){return j}},Object.defineProperty($n,"config",Cn),$n.util={warn:re,extend:m,mergeOptions:Ne,defineReactive:Ce},$n.set=xe,$n.delete=ke,$n.nextTick=Ze,$n.options=Object.create(null),k.forEach(function(e){$n.options[e+"s"]=Object.create(null)}),m(($n.options._base=$n).options.components,kn),$n.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(-1=a&&l()};setTimeout(function(){c\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,oo="[a-zA-Z_][\\w\\-\\.]*",ao="((?:"+oo+"\\:)?"+oo+")",so=new RegExp("^<"+ao),co=/^\s*(\/?)>/,lo=new RegExp("^<\\/"+ao+"[^>]*>"),uo=/^]+>/i,fo=/^",""":'"',"&":"&"," ":"\n"," ":"\t"},go=/&(?:lt|gt|quot|amp);/g,_o=/&(?:lt|gt|quot|amp|#10|#9);/g,bo=s("pre,textarea",!0),$o=function(e,t){return e&&bo(e)&&"\n"===t[0]};var wo,Co,xo,ko,Ao,Oo,So,To,Eo=/^@|^v-on:/,jo=/^v-|^@|^:/,No=/([^]*?)\s+(?:in|of)\s+([^]*)/,Lo=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Io=/^\(|\)$/g,Mo=/:(.*)$/,Do=/^:|^v-bind:/,Po=/\.[^.]+/g,Fo=e(eo);function Ro(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:function(e){for(var t={},n=0,r=e.length;n]*>)","i")),n=i.replace(t,function(e,t,n){return r=n.length,ho(o)||"noscript"===o||(t=t.replace(//g,"$1").replace(//g,"$1")),$o(o,t)&&(t=t.slice(1)),d.chars&&d.chars(t),""});a+=i.length-n.length,i=n,A(o,a-r,a)}else{var s=i.indexOf("<");if(0===s){if(fo.test(i)){var c=i.indexOf("--\x3e");if(0<=c){d.shouldKeepComment&&d.comment(i.substring(4,c)),C(c+3);continue}}if(po.test(i)){var l=i.indexOf("]>");if(0<=l){C(l+2);continue}}var u=i.match(uo);if(u){C(u[0].length);continue}var f=i.match(lo);if(f){var p=a;C(f[0].length),A(f[1],p,a);continue}var _=x();if(_){k(_),$o(v,i)&&C(1);continue}}var b=void 0,$=void 0,w=void 0;if(0<=s){for($=i.slice(s);!(lo.test($)||so.test($)||fo.test($)||po.test($)||(w=$.indexOf("<",1))<0);)s+=w,$=i.slice(s);b=i.substring(0,s),C(s)}s<0&&(b=i,i=""),d.chars&&b&&d.chars(b)}if(i===e){d.chars&&d.chars(i);break}}function C(e){a+=e,i=i.substring(e)}function x(){var e=i.match(so);if(e){var t,n,r={tagName:e[1],attrs:[],start:a};for(C(e[0].length);!(t=i.match(co))&&(n=i.match(io));)C(n[0].length),r.attrs.push(n);if(t)return r.unarySlash=t[1],C(t[0].length),r.end=a,r}}function k(e){var t=e.tagName,n=e.unarySlash;m&&("p"===v&&ro(t)&&A(v),g(t)&&v===t&&A(t));for(var r,i,o,a=y(t)||!!n,s=e.attrs.length,c=new Array(s),l=0;l-1"+("true"===d?":("+l+")":":_q("+l+","+d+")")),Ar(c,"change","var $$a="+l+",$$el=$event.target,$$c=$$el.checked?("+d+"):("+v+");if(Array.isArray($$a)){var $$v="+(f?"_n("+p+")":p)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Er(l,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Er(l,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Er(l,"$$c")+"}",null,!0);else if("input"===$&&"radio"===w)r=e,i=_,a=(o=b)&&o.number,s=Or(r,"value")||"null",Cr(r,"checked","_q("+i+","+(s=a?"_n("+s+")":s)+")"),Ar(r,"change",Er(i,s),null,!0);else if("input"===$||"textarea"===$)!function(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,l=o?"change":"range"===r?Pr:"input",u="$event.target.value";s&&(u="$event.target.value.trim()"),a&&(u="_n("+u+")");var f=Er(t,u);c&&(f="if($event.target.composing)return;"+f),Cr(e,"value","("+t+")"),Ar(e,l,f,null,!0),(s||a)&&Ar(e,"blur","$forceUpdate()")}(e,_,b);else if(!j.isReservedTag($))return Tr(e,_,b),!1;return!0},text:function(e,t){t.value&&Cr(e,"textContent","_s("+t.value+")")},html:function(e,t){t.value&&Cr(e,"innerHTML","_s("+t.value+")")}},isPreTag:function(e){return"pre"===e},isUnaryTag:to,mustUseProp:Sn,canBeLeftOpenTag:no,isReservedTag:Un,getTagNamespace:Vn,staticKeys:(Go=Wo,Go.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(","))},Qo=e(function(e){return s("type,tag,attrsList,attrsMap,plain,parent,children,attrs"+(e?","+e:""))});function ea(e,t){e&&(Zo=Qo(t.staticKeys||""),Xo=t.isReservedTag||O,function e(t){t.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||c(e.tag)||!Xo(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every(Zo)))}(t);if(1===t.type){if(!Xo(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var n=0,r=t.children.length;n|^function\s*\(/,na=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,ra={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},ia={esc:"Escape",tab:"Tab",enter:"Enter",space:" ",up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete"]},oa=function(e){return"if("+e+")return null;"},aa={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:oa("$event.target !== $event.currentTarget"),ctrl:oa("!$event.ctrlKey"),shift:oa("!$event.shiftKey"),alt:oa("!$event.altKey"),meta:oa("!$event.metaKey"),left:oa("'button' in $event && $event.button !== 0"),middle:oa("'button' in $event && $event.button !== 1"),right:oa("'button' in $event && $event.button !== 2")};function sa(e,t,n){var r=t?"nativeOn:{":"on:{";for(var i in e)r+='"'+i+'":'+ca(i,e[i])+",";return r.slice(0,-1)+"}"}function ca(t,e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map(function(e){return ca(t,e)}).join(",")+"]";var n=na.test(e.value),r=ta.test(e.value);if(e.modifiers){var i="",o="",a=[];for(var s in e.modifiers)if(aa[s])o+=aa[s],ra[s]&&a.push(s);else if("exact"===s){var c=e.modifiers;o+=oa(["ctrl","shift","alt","meta"].filter(function(e){return!c[e]}).map(function(e){return"$event."+e+"Key"}).join("||"))}else a.push(s);return a.length&&(i+="if(!('button' in $event)&&"+a.map(la).join("&&")+")return null;"),o&&(i+=o),"function($event){"+i+(n?"return "+e.value+"($event)":r?"return ("+e.value+")($event)":e.value)+"}"}return n||r?e.value:"function($event){"+e.value+"}"}function la(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=ra[e],r=ia[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var ua={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(t,n){t.wrapData=function(e){return"_b("+e+",'"+t.tag+"',"+n.value+","+(n.modifiers&&n.modifiers.prop?"true":"false")+(n.modifiers&&n.modifiers.sync?",true":"")+")"}},cloak:$},fa=function(e){this.options=e,this.warn=e.warn||$r,this.transforms=wr(e.modules,"transformCode"),this.dataGenFns=wr(e.modules,"genData"),this.directives=m(m({},ua),e.directives);var t=e.isReservedTag||O;this.maybeComponent=function(e){return!t(e.tag)},this.onceId=0,this.staticRenderFns=[]};function pa(e,t){var n=new fa(t);return{render:"with(this){return "+(e?da(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function da(e,t){if(e.staticRoot&&!e.staticProcessed)return va(e,t);if(e.once&&!e.onceProcessed)return ha(e,t);if(e.for&&!e.forProcessed)return f=t,v=(u=e).for,h=u.alias,m=u.iterator1?","+u.iterator1:"",y=u.iterator2?","+u.iterator2:"",u.forProcessed=!0,(d||"_l")+"(("+v+"),function("+h+m+y+"){return "+(p||da)(u,f)+"})";if(e.if&&!e.ifProcessed)return ma(e,t);if("template"!==e.tag||e.slotTarget){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=_a(e,t),i="_t("+n+(r?","+r:""),o=e.attrs&&"{"+e.attrs.map(function(e){return g(e.name)+":"+e.value}).join(",")+"}",a=e.attrsMap["v-bind"];!o&&!a||r||(i+=",null");o&&(i+=","+o);a&&(i+=(o?"":",null")+","+a);return i+")"}(e,t);var n;if(e.component)a=e.component,c=t,l=(s=e).inlineTemplate?null:_a(s,c,!0),n="_c("+a+","+ya(s,c)+(l?","+l:"")+")";else{var r=e.plain?void 0:ya(e,t),i=e.inlineTemplate?null:_a(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o':'
      ',0 - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/templates/article.html b/src/main/resources/templates/article.html deleted file mode 100644 index dd89560..0000000 --- a/src/main/resources/templates/article.html +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/templates/detail.html b/src/main/resources/templates/detail.html deleted file mode 100644 index ba5337e..0000000 --- a/src/main/resources/templates/detail.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/templates/editor.html b/src/main/resources/templates/editor.html deleted file mode 100644 index f113d5c..0000000 --- a/src/main/resources/templates/editor.html +++ /dev/null @@ -1,226 +0,0 @@ - - - - - 富文本编辑器 - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/templates/editorlist.html b/src/main/resources/templates/editorlist.html deleted file mode 100644 index 570352a..0000000 --- a/src/main/resources/templates/editorlist.html +++ /dev/null @@ -1,261 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/templates/error.html b/src/main/resources/templates/error.html deleted file mode 100644 index 7ffe800..0000000 --- a/src/main/resources/templates/error.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html deleted file mode 100644 index 94e58e5..0000000 --- a/src/main/resources/templates/index.html +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/templates/list.html b/src/main/resources/templates/list.html deleted file mode 100644 index eb0c5b1..0000000 --- a/src/main/resources/templates/list.html +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/templates/login.html b/src/main/resources/templates/login.html deleted file mode 100644 index bbef1a7..0000000 --- a/src/main/resources/templates/login.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/templates/loginloglist.html b/src/main/resources/templates/loginloglist.html deleted file mode 100644 index b1a5516..0000000 --- a/src/main/resources/templates/loginloglist.html +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/templates/logoutloglist.html b/src/main/resources/templates/logoutloglist.html deleted file mode 100644 index 1d506b4..0000000 --- a/src/main/resources/templates/logoutloglist.html +++ /dev/null @@ -1,252 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/templates/markdown.html b/src/main/resources/templates/markdown.html deleted file mode 100644 index fd89ac5..0000000 --- a/src/main/resources/templates/markdown.html +++ /dev/null @@ -1,103 +0,0 @@ - - - - - MarkDown编辑器 - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/templates/markdownlist.html b/src/main/resources/templates/markdownlist.html deleted file mode 100644 index e4bcb55..0000000 --- a/src/main/resources/templates/markdownlist.html +++ /dev/null @@ -1,262 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/templates/noauth.html b/src/main/resources/templates/noauth.html deleted file mode 100644 index 0a6c08e..0000000 --- a/src/main/resources/templates/noauth.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/templates/regist.html b/src/main/resources/templates/regist.html deleted file mode 100644 index 5d7176b..0000000 --- a/src/main/resources/templates/regist.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/templates/systemloglist.html b/src/main/resources/templates/systemloglist.html deleted file mode 100644 index 23413ec..0000000 --- a/src/main/resources/templates/systemloglist.html +++ /dev/null @@ -1,261 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/templates/userlist.html b/src/main/resources/templates/userlist.html deleted file mode 100644 index e4ad0bf..0000000 --- a/src/main/resources/templates/userlist.html +++ /dev/null @@ -1,252 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/templates/website.html b/src/main/resources/templates/website.html deleted file mode 100644 index b78990a..0000000 --- a/src/main/resources/templates/website.html +++ /dev/null @@ -1,775 +0,0 @@ - - - - - - - - 一个风景,美食,音乐及各种兴趣爱好的网站 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - -
      -
      -
      - -
      - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/static/font-awesome-4.5.0/fonts/fontawesome-webfont.woff2 b/src/main/resources/xixi.txt similarity index 100% rename from src/main/resources/static/font-awesome-4.5.0/fonts/fontawesome-webfont.woff2 rename to src/main/resources/xixi.txt diff --git "a/src/main/resources/\350\256\260\345\275\225.txt" "b/src/main/resources/\350\256\260\345\275\225.txt" index 6747d06..750135f 100644 --- "a/src/main/resources/\350\256\260\345\275\225.txt" +++ "b/src/main/resources/\350\256\260\345\275\225.txt" @@ -10,7 +10,10 @@ likeʮв̫,elasticsearch 2019122119:10:00 -slogan:Կ +slogan:Կ, +202021812:41:22 +slogan:ֹ + ʵȨ޹:ԱûԽlist,ûֻ, ûдǩ,дımarkdown,ֻܿԼ @@ -83,4 +86,116 @@ slogan: stringRedisTemplate.opsForValue().set("test", "100",60*10,TimeUnit.SECONDS);//redisݺûʱ 20202912:20:12 https:ȫ취 -https://www.cnblogs.com/zhucezmf/p/9896577.html \ No newline at end of file +https://www.cnblogs.com/zhucezmf/p/9896577.html + + +202021514:58:34 +spring bootfastDFS + +?? ??? ??? ?com.github.tobato +?? ??? ??? ?fastdfs-client +?? ??? ??? ?1.26.5 +?? ??? ? + +ȨΪCSDNKBXHԭ£ѭ CC 4.0 BY-SA ȨЭ飬ת븽ԭijӼ +ԭӣhttps://blog.csdn.net/u013792404/article/details/90546809 + +202021622:32:23 +https://blog.csdn.net/chenmingxu438521/article/details/94485695 +spring bootquartz + +202021801:57:21 +error: dst refspec 1.1.1 matches more than one. +취 +https://blog.csdn.net/qq_32452623/article/details/76649109 +202021802:10:16 +ĵ,Ǵ,ʱ,ļС,ͳ,,·ʲôĸȥ +Щļûתɹİɾ,ȻԵܿ, +Ƿֶεes +鼮_ +鼮_½ +鼮_ҳ +鼮_ +ʷѯϵͳ +ѯϵͳ, +ѯϵͳ +˾ѯϵͳ +ʳѯϵͳ +Լԭ,ϱһЩ, +ѯϵͳ +鼮ѯϵͳ +ϲѯϵͳ, +زIJѯϵͳ +ҳݲѯϵͳ +־ѯϵͳ +elk +ѯʷӻʲô +ڶ + +202021811:59:24 +1.Ϊû,ͬʱ,Ϊά,,,Ʒ,UIһ,Ʒ +2.϶Ҫ漰ݸʽ໥ת,һתapi,һETLϵͳ +3.ҪƵ־ϵͳ,Debug,ҪELKϵͳ,־Ҫϸּ +4.Ƶ쳣,۶ϻ,Բ쳣¼,γһű,Ȼ֮,¼Ͻ,,ַʽ +5.ЩȽ걸֮,Ҫ˽繥֪ʶ,ȻܻҪӪ,ƹʲô +6.뷨Ҫʵ,ʱ̬ó,ͬһ׽ӿ,ͬʵ +7.ʱ͹ʵ෴Ĵ,һ ǹ֮,һάⲻ֮ +8,ڵĻ,Լһ,Ǿʡ˺ܶܶ,簲ȫ,Ӫɱ,ʱ,Ļ, +ÿû,ֻԼ͹,ɶȸ,ֱӴһ˾ŶӲܸ㶨,һ˾ܸ㶨 +9.Ӫ,ϸ,û,Ϊ͵,ȼԽ,ȨԽ,Խ, +ͻر,νԽ,Խ,ɾһЩû,DzƷӪ,Ͻ, +ûԽ,ȾԽ,ܵĸԽ,һϵ,߻ϵ,ȼƶȱҪ +10.Լ׼ȷλԼԲƷλ,ŶӶλ,ûλdzdzdzҪ,Ȼȥ׷һЩʵʵĶ +֪ϿһЩλ,ƷӪصĻش,֪ܰ,ʲô뷨֪֪õһջ +ʡȥããϢɸѡijɱ,ò˵֪ĵ޻Ǹܺõ,Ϊ֪ɸѡƷ +֪ûʲô,Ǹûĸ,ֻ֪Ǵһƽ̨ +11.ǹ˾,Ŷ,,˲ŵ֪һõĴʵ,̵ļֵ,пտ˾ļֵͺô,⹫˾ +֪ƽ̵̨ƽ̨ΰ֮,ÿDzͬ,˵ǹһ˵IJ, +һ˵ͨ,ͨƽ̨,Ͱ˵,໥,ȡ,ʵ˾Ҳһƽ̨ +12.ϵͳһô,Ϊø,ѧܶණ,Ӵܶ, +Ȼ,ᷢЩֻ;ͬ,ͬ,繫˾ƽ̨ı,ǰѲͬ˽,ȡ, +ֵ,ʾǽ,е񾭼ѧԭ˵,ʹÿ˵״,ֵ,Թ,ȻһЩԹ +к,Ϳô̶,Ҳһźѧʰ +ڶ,иô,ͨ˺֮ܶ,ԼܳΪԼĹ۵,۵ûձĶԴ,ô, +е,ǸǶȾǶԵ,Զʷ,,վڲͬ۵,ϵӽȥ,γԼ۵,ʵʱ +,,ҪһЩ໥ֵ̽ĵط,õļ, +,⵽,һЩȷʵ,ûɶ̫ô,Ǿ仰,֮,ֺᷢܶ۵͸ͨ, +ȫ,վڸߵӽǿ,ܴԲܵ,Ȼ,ϵͳûļֵ, +ҲЩ֪ʶȫ,Ȼϵͳ϶мֵ,Ͷ˵Ļ,аٷ֮ٵĸϵͳмֵ +ָ,ɿ,;Ʋز,ʵڲ,ʱ,Ҳ߼˼ά,д,, +,滮,һ̶ȵĹ֪ʶ,Ӫ֪ʶ,Ҳ,Ͼʱ˵,д3000ƪ, +֤õ +202021817:07:11 +1.nginxʵļ +2.ʵֶļϴ +202021817:49:33 +ջmybatisעxmlͬʱʹ +sqlע,xml + +202021818:38:50 +һuploadServiceӿʵ,һ,һ,ͬһļ1150kb,View.javaٶ48ms,85ms,໹ͦԵ, +ԼӶ߳,һٶ,˶̬ĺô +controllerҵ߼ת嵽service,˷ֲ˼ +ideaķȡͦõ,ڼԼһЩ,Լظ +,ʹûһαȽ,ͷdz + + + + + +202022211:48:33 +νĺʽӿڣȻһӿڣȻӿֻһ󷽷 + +͵ĽӿҲΪSAMӿڣSingle Abstract Method interfaces + +ص +ӿҽһ󷽷 +徲̬ +ĬϷ +java.lang.Objectеpublic +עⲻDZģһӿڷ"ʽӿ"壬ôӲӸעⶼûӰ졣ϸעܹõñм顣дIJǺʽӿڣǼ@FunctionInterfaceôᱨ + +ߣhei +ӣhttps://www.jianshu.com/p/52cdc402fb5d +Դ +ȨСҵתϵ߻Ȩҵתע \ No newline at end of file