Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
org.mybatis.generator.api.plus.MybatisUtilHtmlBack Maven / Gradle / Ivy
package org.mybatis.generator.api.plus;
import org.mybatis.generator.api.IntrospectedColumn;
import org.mybatis.generator.api.IntrospectedTable;
import org.mybatis.generator.api.dom.java.FullyQualifiedJavaType;
import java.io.*;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/**
* @author wangfupeng
*/
public class MybatisUtilHtmlBack {
public static void writeAllPage(IntrospectedTable introspectedTable, String htmlPath, String modelUrl, String fileServer, String serverUrl, String basePackage, String aspectPackage, String tokenErrorStatus, String encryptPasswordMethod) {
writeJsCommonJqueryJs(htmlPath, serverUrl);
writeJsCommonMd5Js(htmlPath, serverUrl);
writeJsCommonSha256Js(htmlPath, serverUrl);
writeJsCustomCustomJs(htmlPath, serverUrl, tokenErrorStatus);
writeCssCustomCustomCss(htmlPath, serverUrl, tokenErrorStatus);
writeJsCommonServerJs(htmlPath, serverUrl, tokenErrorStatus, fileServer);
writeJsCommonValueJs(htmlPath, serverUrl, tokenErrorStatus, fileServer);
writeCssCommonServerCss(htmlPath, serverUrl, tokenErrorStatus, fileServer);
writeIndexPage(introspectedTable, htmlPath, modelUrl);
writeCustomIndexJs(introspectedTable, htmlPath, modelUrl);
writeCustomIndexCss(introspectedTable, htmlPath, modelUrl);
writeLoginPage(introspectedTable, htmlPath, modelUrl, encryptPasswordMethod);
writeLeftFramePage(introspectedTable, htmlPath, modelUrl);
writeBlankPage(htmlPath, modelUrl);
writeJsPlusTrumbowygJs(htmlPath, serverUrl);
writeJsPlusJjlcJs(htmlPath, serverUrl);
writeJsPlusTrumbowygCss(htmlPath, serverUrl);
writeJsPlusIconsSvg(htmlPath, serverUrl);
writeTableJsPage(introspectedTable, htmlPath, modelUrl, fileServer, serverUrl, basePackage, aspectPackage);
writeTableJsCustomTableJs(introspectedTable, htmlPath, modelUrl, fileServer, serverUrl, basePackage, aspectPackage);
writeTableCssPage(introspectedTable, htmlPath, modelUrl, fileServer, serverUrl, basePackage, aspectPackage);
writeTableCssCustomTableCss(introspectedTable, htmlPath, modelUrl, fileServer, serverUrl, basePackage, aspectPackage);
writeBlankPage(htmlPath, modelUrl);
writeTablePage(introspectedTable, htmlPath, modelUrl, fileServer, serverUrl, basePackage, aspectPackage);
}
public static void writeIndexPage(IntrospectedTable introspectedTable, String htmlPath, String modelUrl) {
File file = null;
OutputStream fileOutputStream = null;
BufferedWriter bufferedWriter = null;
try {
File folder = new File(htmlPath + "");
folder.mkdirs();
file = new File(htmlPath + "/index.html");
//如果文件不存在,则创建文件,如果已存在,则覆盖
file.createNewFile();
fileOutputStream = new FileOutputStream(file);
bufferedWriter = new BufferedWriter(new OutputStreamWriter(fileOutputStream, "utf-8"));
bufferedWriter.write("\n");
bufferedWriter.write("\n");
bufferedWriter.write("\n");
bufferedWriter.write(" \n");
bufferedWriter.write(" \n");
bufferedWriter.write(" \n");
bufferedWriter.write(" \n");
bufferedWriter.write(" \n");
bufferedWriter.write(" \n");
bufferedWriter.write(" \n");
bufferedWriter.write("后台管理 \n");
bufferedWriter.write("\n");
writePageHead(bufferedWriter);
bufferedWriter.write("\n");
bufferedWriter.write("\n");
bufferedWriter.write("\n");
bufferedWriter.write("\n");
bufferedWriter.write("\n");
bufferedWriter.write("\n");
bufferedWriter.write(" \n");
bufferedWriter.write("\n");
bufferedWriter.write("\n");
bufferedWriter.write(" \n");
bufferedWriter.write("\n");
bufferedWriter.write("\n");
System.out.println("write to file success : " + file.getPath());
} catch (IOException e) {
e.printStackTrace();
} finally {
MybatisUtilCommon.closeBufferWriterAndFileOutputStream(fileOutputStream, bufferedWriter);
}
}
public static void writePageHead(BufferedWriter bufferedWriter) throws IOException {
bufferedWriter.write("\n");
bufferedWriter.write("\n");
bufferedWriter.write("\n");
bufferedWriter.write("\n");
bufferedWriter.write("\n");
bufferedWriter.write("\n");
bufferedWriter.write("\n");
bufferedWriter.write("\n");
bufferedWriter.write(" \n");
bufferedWriter.write(" \n");
bufferedWriter.write(" \n");
}
public static void writeLeftFramePage(IntrospectedTable introspectedTable, String htmlPath, String modelUrl) {
File file = null;
OutputStream fileOutputStream = null;
BufferedWriter bufferedWriter = null;
String table = introspectedTable.getBaseRecordType();
String tableName = table.replaceAll(modelUrl + ".", "");
try {
File folder = new File(htmlPath + "");
folder.mkdirs();
file = new File(htmlPath + "/page-left-frame.html");
//判断文件里有没有内容已经写过。
//如果文件不存在,则创建文件,如果已存在,则覆盖
List fileList = MybatisUtilCommon.getFileListFromConfigFile();
fileList.sort(new Comparator() {
public int compare(Map o1, Map o2) {
String tableIntrospectedTableName1 = (String) o1.get("tableIntrospectedTableName");
String tableIntrospectedTableName2 = (String) o2.get("tableIntrospectedTableName");
return tableIntrospectedTableName1.compareTo(tableIntrospectedTableName2);
}
});
file.createNewFile();
fileOutputStream = new FileOutputStream(file, false);
bufferedWriter = new BufferedWriter(new OutputStreamWriter(fileOutputStream, "utf-8"));
for (int i = 0; i < fileList.size(); i++) {
Map fileMap = fileList.get(i);
String tableIntrospectedTableName = (String) fileMap.get("tableIntrospectedTableName");
String tableDomainObjectName = (String) fileMap.get("tableDomainObjectName");
List fieldOriginalNames = (List) fileMap.get("fieldOriginalNames");
String tableRemarks = (String) fileMap.get("tableRemarks");
bufferedWriter.write("" + tableRemarks + "
\n");
}
System.out.println("write to file success : " + file.getPath());
} catch (IOException e) {
e.printStackTrace();
} finally {
MybatisUtilCommon.closeBufferWriterAndFileOutputStream(fileOutputStream, bufferedWriter);
}
}
public static void writeBlankPage(String htmlPath, String serverUrl) {
File file = null;
OutputStream fileOutputStream = null;
BufferedWriter bufferedWriter = null;
try {
File folder = new File(htmlPath + "");
folder.mkdirs();
file = new File(htmlPath + "/page-blank.html");
//如果文件不存在,则创建文件,如果已存在,则覆盖
file.createNewFile();
fileOutputStream = new FileOutputStream(file);
bufferedWriter = new BufferedWriter(new OutputStreamWriter(fileOutputStream, "utf-8"));
bufferedWriter.write("后台管理系统\n");
System.out.println("write to file success : " + file.getPath());
} catch (
IOException e) {
e.printStackTrace();
} finally {
MybatisUtilCommon.closeBufferWriterAndFileOutputStream(fileOutputStream, bufferedWriter);
}
}
public static void writeJsCustomCustomJs(String htmlPath, String serverUrl, String tokenErrorStatus) {
if (serverUrl == null) {
serverUrl = "http://localhost:8080/";
}
File file = null;
OutputStream fileOutputStream = null;
BufferedWriter bufferedWriter = null;
try {
File folder = new File(htmlPath + "/custom/page-common/js");
folder.mkdirs();
file = new File(htmlPath + "/custom/page-common/js/custom.js");
//如果文件不存在,则创建文件,如果已存在,则覆盖
if (!file.exists()) {
file.createNewFile();
fileOutputStream = new FileOutputStream(file);
bufferedWriter = new BufferedWriter(new OutputStreamWriter(fileOutputStream, "utf-8"));
bufferedWriter.write("\n");
System.out.println("write to file success : " + file.getPath());
} else {
System.out.println("write to file success : " + file.getPath());
}
} catch (IOException e) {
e.printStackTrace();
} finally {
MybatisUtilCommon.closeBufferWriterAndFileOutputStream(fileOutputStream, bufferedWriter);
}
}
public static void writeCssCustomCustomCss(String htmlPath, String serverUrl, String tokenErrorStatus) {
if (serverUrl == null) {
serverUrl = "http://localhost:8080/";
}
File file = null;
OutputStream fileOutputStream = null;
BufferedWriter bufferedWriter = null;
try {
File folder = new File(htmlPath + "/custom/page-common/css");
folder.mkdirs();
file = new File(htmlPath + "/custom/page-common/css/custom.css");
//如果文件不存在,则创建文件,如果已存在,则覆盖
if (!file.exists()) {
file.createNewFile();
fileOutputStream = new FileOutputStream(file);
bufferedWriter = new BufferedWriter(new OutputStreamWriter(fileOutputStream, "utf-8"));
bufferedWriter.write("\n");
System.out.println("write to file success : " + file.getPath());
} else {
System.out.println("write to file success : " + file.getPath());
}
} catch (IOException e) {
e.printStackTrace();
} finally {
MybatisUtilCommon.closeBufferWriterAndFileOutputStream(fileOutputStream, bufferedWriter);
}
}
public static void writeJsPlusIconsSvg(String htmlPath, String serverUrl) {
File file = null;
OutputStream fileOutputStream = null;
BufferedWriter bufferedWriter = null;
try {
File folder = new File(htmlPath + "/content/page-common/css");
folder.mkdirs();
file = new File(htmlPath + "/content/page-common/css/icons.svg");
//如果文件不存在,则创建文件,如果已存在,则覆盖
file.createNewFile();
fileOutputStream = new FileOutputStream(file);
bufferedWriter = new BufferedWriter(new OutputStreamWriter(fileOutputStream, "utf-8"));
bufferedWriter.write(" ");
System.out.println("write to file success : " + file.getPath());
} catch (IOException e) {
e.printStackTrace();
} finally {
MybatisUtilCommon.closeBufferWriterAndFileOutputStream(fileOutputStream, bufferedWriter);
}
}
public static void writeJsPlusTrumbowygCss(String htmlPath, String serverUrl) {
File file = null;
OutputStream fileOutputStream = null;
BufferedWriter bufferedWriter = null;
try {
File folder = new File(htmlPath + "/content/page-common/css");
folder.mkdirs();
file = new File(htmlPath + "/content/page-common/css/trumbowyg.css");
//如果文件不存在,则创建文件,如果已存在,则覆盖
file.createNewFile();
fileOutputStream = new FileOutputStream(file);
bufferedWriter = new BufferedWriter(new OutputStreamWriter(fileOutputStream, "utf-8"));
bufferedWriter.write("#trumbowyg-icons, #trumbowyg-icons svg {\n" +
" height: 0;\n" +
" width: 0\n" +
"}\n" +
"\n" +
"#trumbowyg-icons {\n" +
" overflow: hidden;\n" +
" visibility: hidden\n" +
"}\n" +
"\n" +
".trumbowyg-box *, .trumbowyg-box ::after, .trumbowyg-box ::before {\n" +
" box-sizing: border-box\n" +
"}\n" +
"\n" +
".trumbowyg-box svg {\n" +
" width: 17px;\n" +
" height: 100%;\n" +
" fill: #222\n" +
"}\n" +
"\n" +
".trumbowyg-box, .trumbowyg-editor {\n" +
" display: block;\n" +
" position: relative;\n" +
" border: 1px solid #DDD;\n" +
" width: 100%;\n" +
" min-height: 300px;\n" +
" margin: 17px auto\n" +
"}\n" +
"\n" +
".trumbowyg-box .trumbowyg-editor {\n" +
" margin: 0 auto\n" +
"}\n" +
"\n" +
".trumbowyg-box.trumbowyg-fullscreen {\n" +
" background: #FEFEFE;\n" +
" border: none !important\n" +
"}\n" +
"\n" +
".trumbowyg-editor, .trumbowyg-textarea {\n" +
" position: relative;\n" +
" box-sizing: border-box;\n" +
" padding: 20px;\n" +
" min-height: 300px;\n" +
" width: 100%;\n" +
" border-style: none;\n" +
" resize: none;\n" +
" outline: 0;\n" +
" overflow: auto\n" +
"}\n" +
"\n" +
".trumbowyg-editor.trumbowyg-autogrow-on-enter, .trumbowyg-textarea.trumbowyg-autogrow-on-enter {\n" +
" transition: height .3s ease-out\n" +
"}\n" +
"\n" +
".trumbowyg-box-blur .trumbowyg-editor *, .trumbowyg-box-blur .trumbowyg-editor::before {\n" +
" color: transparent !important;\n" +
" text-shadow: 0 0 7px #333\n" +
"}\n" +
"\n" +
"@media screen and (min-width: 0 \\0\n" +
") {\n" +
" .trumbowyg-box-blur .trumbowyg-editor *, .trumbowyg-box-blur .trumbowyg-editor::before {\n" +
" color: rgba(200, 200, 200, .6) !important\n" +
" }\n" +
"}\n" +
"\n" +
"@supports (-ms-accelerator:true) {\n" +
" .trumbowyg-box-blur .trumbowyg-editor *, .trumbowyg-box-blur .trumbowyg-editor::before {\n" +
" color: rgba(200, 200, 200, .6) !important\n" +
" }\n" +
"}\n" +
"\n" +
".trumbowyg-box-blur .trumbowyg-editor hr, .trumbowyg-box-blur .trumbowyg-editor img {\n" +
" opacity: .2\n" +
"}\n" +
"\n" +
".trumbowyg-textarea {\n" +
" position: relative;\n" +
" display: block;\n" +
" overflow: auto;\n" +
" border: none;\n" +
" font-size: 14px;\n" +
" font-family: Inconsolata, Consolas, Courier, \"Courier New\", sans-serif;\n" +
" line-height: 18px\n" +
"}\n" +
"\n" +
".trumbowyg-box.trumbowyg-editor-visible .trumbowyg-textarea {\n" +
" height: 1px !important;\n" +
" width: 25%;\n" +
" min-height: 0 !important;\n" +
" padding: 0 !important;\n" +
" background: 0 0;\n" +
" opacity: 0 !important\n" +
"}\n" +
"\n" +
".trumbowyg-box.trumbowyg-editor-hidden .trumbowyg-textarea {\n" +
" display: block\n" +
"}\n" +
"\n" +
".trumbowyg-box.trumbowyg-editor-hidden .trumbowyg-editor {\n" +
" display: none\n" +
"}\n" +
"\n" +
".trumbowyg-box.trumbowyg-disabled .trumbowyg-textarea {\n" +
" opacity: .8;\n" +
" background: 0 0\n" +
"}\n" +
"\n" +
".trumbowyg-editor[contenteditable=true]:empty:not(:focus)::before {\n" +
" content: attr(placeholder);\n" +
" color: #999;\n" +
" pointer-events: none\n" +
"}\n" +
"\n" +
".trumbowyg-button-pane {\n" +
" width: 100%;\n" +
" min-height: 36px;\n" +
" background: #ecf0f1;\n" +
" border-bottom: 1px solid #d7e0e2;\n" +
" margin: 0;\n" +
" padding: 0 5px;\n" +
" position: relative;\n" +
" list-style-type: none;\n" +
" line-height: 10px;\n" +
" backface-visibility: hidden;\n" +
" z-index: 11\n" +
"}\n" +
"\n" +
".trumbowyg-button-pane::after {\n" +
" content: \" \";\n" +
" display: block;\n" +
" position: absolute;\n" +
" top: 36px;\n" +
" left: 0;\n" +
" right: 0;\n" +
" width: 100%;\n" +
" height: 1px;\n" +
" background: #d7e0e2\n" +
"}\n" +
"\n" +
".trumbowyg-button-pane .trumbowyg-button-group {\n" +
" display: inline-block\n" +
"}\n" +
"\n" +
".trumbowyg-button-pane .trumbowyg-button-group .trumbowyg-fullscreen-button svg {\n" +
" color: transparent\n" +
"}\n" +
"\n" +
".trumbowyg-button-pane .trumbowyg-button-group::after {\n" +
" content: \" \";\n" +
" display: inline-block;\n" +
" width: 1px;\n" +
" background: #d7e0e2;\n" +
" margin: 0 5px;\n" +
" height: 35px;\n" +
" vertical-align: top\n" +
"}\n" +
"\n" +
".trumbowyg-button-pane .trumbowyg-button-group:last-child::after {\n" +
" content: none\n" +
"}\n" +
"\n" +
".trumbowyg-button-pane button {\n" +
" display: inline-block;\n" +
" position: relative;\n" +
" width: 35px;\n" +
" height: 35px;\n" +
" padding: 1px 6px !important;\n" +
" margin-bottom: 1px;\n" +
" overflow: hidden;\n" +
" border: none;\n" +
" cursor: pointer;\n" +
" background: 0 0;\n" +
" vertical-align: middle;\n" +
" transition: background-color 150ms, opacity 150ms\n" +
"}\n" +
"\n" +
".trumbowyg-button-pane button.trumbowyg-textual-button {\n" +
" width: auto;\n" +
" line-height: 35px;\n" +
" -webkit-user-select: none;\n" +
" -moz-user-select: none;\n" +
" -ms-user-select: none;\n" +
" user-select: none\n" +
"}\n" +
"\n" +
".trumbowyg-button-pane button.trumbowyg-disable, .trumbowyg-button-pane.trumbowyg-disable button:not(.trumbowyg-not-disable):not(.trumbowyg-active), .trumbowyg-disabled .trumbowyg-button-pane button:not(.trumbowyg-not-disable):not(.trumbowyg-viewHTML-button) {\n" +
" opacity: .2;\n" +
" cursor: default\n" +
"}\n" +
"\n" +
".trumbowyg-button-pane.trumbowyg-disable .trumbowyg-button-group::before, .trumbowyg-disabled .trumbowyg-button-pane .trumbowyg-button-group::before {\n" +
" background: #e3e9eb\n" +
"}\n" +
"\n" +
".trumbowyg-button-pane button.trumbowyg-active, .trumbowyg-button-pane button:not(.trumbowyg-disable):focus, .trumbowyg-button-pane button:not(.trumbowyg-disable):hover {\n" +
" background-color: #FFF;\n" +
" outline: 0\n" +
"}\n" +
"\n" +
".trumbowyg-button-pane .trumbowyg-open-dropdown::after {\n" +
" display: block;\n" +
" content: \" \";\n" +
" position: absolute;\n" +
" top: 25px;\n" +
" right: 3px;\n" +
" height: 0;\n" +
" width: 0;\n" +
" border: 3px solid transparent;\n" +
" border-top-color: #555\n" +
"}\n" +
"\n" +
".trumbowyg-button-pane .trumbowyg-open-dropdown.trumbowyg-textual-button {\n" +
" padding-left: 10px !important;\n" +
" padding-right: 18px !important\n" +
"}\n" +
"\n" +
".trumbowyg-button-pane .trumbowyg-open-dropdown.trumbowyg-textual-button::after {\n" +
" top: 17px;\n" +
" right: 7px\n" +
"}\n" +
"\n" +
".trumbowyg-modal, .trumbowyg-modal-box {\n" +
" top: 0;\n" +
" left: 50%;\n" +
" transform: translateX(-50%);\n" +
" backface-visibility: hidden;\n" +
" position: absolute\n" +
"}\n" +
"\n" +
".trumbowyg-button-pane .trumbowyg-right {\n" +
" float: right\n" +
"}\n" +
"\n" +
".trumbowyg-dropdown {\n" +
" width: 200px;\n" +
" border: 1px solid #ecf0f1;\n" +
" padding: 5px 0;\n" +
" border-top: none;\n" +
" background: #FFF;\n" +
" margin-left: -1px;\n" +
" box-shadow: rgba(0, 0, 0, .1) 0 2px 3px;\n" +
" z-index: 12\n" +
"}\n" +
"\n" +
".trumbowyg-dropdown button {\n" +
" display: block;\n" +
" width: 100%;\n" +
" height: 35px;\n" +
" line-height: 35px;\n" +
" text-decoration: none;\n" +
" background: #FFF;\n" +
" padding: 0 10px;\n" +
" color: #333 !important;\n" +
" border: none;\n" +
" cursor: pointer;\n" +
" text-align: left;\n" +
" font-size: 15px;\n" +
" transition: all 150ms\n" +
"}\n" +
"\n" +
".trumbowyg-dropdown button:focus, .trumbowyg-dropdown button:hover {\n" +
" background: #ecf0f1\n" +
"}\n" +
"\n" +
".trumbowyg-dropdown button svg {\n" +
" float: left;\n" +
" margin-right: 14px\n" +
"}\n" +
"\n" +
".trumbowyg-modal {\n" +
" max-width: 520px;\n" +
" width: 100%;\n" +
" height: 350px;\n" +
" z-index: 12;\n" +
" overflow: hidden\n" +
"}\n" +
"\n" +
".trumbowyg-modal-box {\n" +
" max-width: 500px;\n" +
" width: calc(100% - 20px);\n" +
" padding-bottom: 45px;\n" +
" z-index: 1;\n" +
" background-color: #FFF;\n" +
" text-align: center;\n" +
" font-size: 14px;\n" +
" box-shadow: rgba(0, 0, 0, .2) 0 2px 3px\n" +
"}\n" +
"\n" +
".trumbowyg-modal-box .trumbowyg-modal-title {\n" +
" font-size: 24px;\n" +
" font-weight: 700;\n" +
" margin: 0 0 20px;\n" +
" padding: 15px 0 13px;\n" +
" display: block;\n" +
" border-bottom: 1px solid #EEE;\n" +
" color: #333;\n" +
" background: #fbfcfc\n" +
"}\n" +
"\n" +
".trumbowyg-modal-box .trumbowyg-progress {\n" +
" width: 100%;\n" +
" height: 3px;\n" +
" position: absolute;\n" +
" top: 58px\n" +
"}\n" +
"\n" +
".trumbowyg-modal-box .trumbowyg-progress .trumbowyg-progress-bar {\n" +
" background: #2BC06A;\n" +
" width: 0;\n" +
" height: 100%;\n" +
" transition: width 150ms linear\n" +
"}\n" +
"\n" +
".trumbowyg-modal-box label {\n" +
" display: block;\n" +
" position: relative;\n" +
" margin: 15px 12px;\n" +
" height: 29px;\n" +
" line-height: 29px;\n" +
" overflow: hidden\n" +
"}\n" +
"\n" +
".trumbowyg-modal-box label .trumbowyg-input-infos {\n" +
" display: block;\n" +
" text-align: left;\n" +
" height: 25px;\n" +
" line-height: 25px;\n" +
" transition: all 150ms\n" +
"}\n" +
"\n" +
".trumbowyg-modal-box label .trumbowyg-input-infos span {\n" +
" display: block;\n" +
" color: #69878f;\n" +
" background-color: #fbfcfc;\n" +
" border: 1px solid #DEDEDE;\n" +
" padding: 0 7px;\n" +
" width: 150px\n" +
"}\n" +
"\n" +
".trumbowyg-modal-box label .trumbowyg-input-infos span.trumbowyg-msg-error {\n" +
" color: #e74c3c\n" +
"}\n" +
"\n" +
".trumbowyg-modal-box label.trumbowyg-input-error input, .trumbowyg-modal-box label.trumbowyg-input-error textarea {\n" +
" border: 1px solid #e74c3c\n" +
"}\n" +
"\n" +
".trumbowyg-modal-box label.trumbowyg-input-error .trumbowyg-input-infos {\n" +
" margin-top: -27px\n" +
"}\n" +
"\n" +
".trumbowyg-modal-box label input {\n" +
" position: absolute;\n" +
" top: 0;\n" +
" right: 0;\n" +
" height: 27px;\n" +
" line-height: 27px;\n" +
" border: 1px solid #DEDEDE;\n" +
" background: #fff;\n" +
" font-size: 14px;\n" +
" max-width: 330px;\n" +
" width: 70%;\n" +
" padding: 0 7px;\n" +
" transition: all 150ms\n" +
"}\n" +
"\n" +
".trumbowyg-modal-box label input:focus, .trumbowyg-modal-box label input:hover {\n" +
" outline: 0;\n" +
" border: 1px solid #95a5a6\n" +
"}\n" +
"\n" +
".trumbowyg-modal-box label input:focus {\n" +
" background: #fbfcfc\n" +
"}\n" +
"\n" +
".trumbowyg-modal-box label input[type=checkbox] {\n" +
" left: 5px;\n" +
" top: 5px;\n" +
" right: auto\n" +
"}\n" +
"\n" +
".trumbowyg-modal-box label input[type=checkbox] + .trumbowyg-input-infos span {\n" +
" width: auto;\n" +
" padding-left: 25px\n" +
"}\n" +
"\n" +
".trumbowyg-modal-box .error {\n" +
" margin-top: 25px;\n" +
" display: block;\n" +
" color: red\n" +
"}\n" +
"\n" +
".trumbowyg-modal-box .trumbowyg-modal-button {\n" +
" position: absolute;\n" +
" bottom: 10px;\n" +
" right: 0;\n" +
" text-decoration: none;\n" +
" color: #FFF;\n" +
" display: block;\n" +
" width: 100px;\n" +
" height: 35px;\n" +
" line-height: 33px;\n" +
" margin: 0 10px;\n" +
" background-color: #333;\n" +
" border: none;\n" +
" cursor: pointer;\n" +
" font-family: \"Trebuchet MS\", Helvetica, Verdana, sans-serif;\n" +
" font-size: 16px;\n" +
" transition: all 150ms\n" +
"}\n" +
"\n" +
".trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit {\n" +
" right: 110px;\n" +
" background: #2bc06a\n" +
"}\n" +
"\n" +
".trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:focus, .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:hover {\n" +
" background: #40d47e;\n" +
" outline: 0\n" +
"}\n" +
"\n" +
".trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:active {\n" +
" background: #25a25a\n" +
"}\n" +
"\n" +
".trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset {\n" +
" color: #555;\n" +
" background: #e6e6e6\n" +
"}\n" +
"\n" +
".trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:focus, .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:hover {\n" +
" background: #fbfbfb;\n" +
" outline: 0\n" +
"}\n" +
"\n" +
".trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:active {\n" +
" background: #d5d5d5\n" +
"}\n" +
"\n" +
".trumbowyg-overlay {\n" +
" position: absolute;\n" +
" background-color: rgba(255, 255, 255, .5);\n" +
" height: 100%;\n" +
" width: 100%;\n" +
" left: 0;\n" +
" display: none;\n" +
" top: 0;\n" +
" z-index: 10\n" +
"}\n" +
"\n" +
"body.trumbowyg-body-fullscreen {\n" +
" overflow: hidden\n" +
"}\n" +
"\n" +
".trumbowyg-fullscreen {\n" +
" position: fixed;\n" +
" top: 0;\n" +
" left: 0;\n" +
" width: 100%;\n" +
" height: 100%;\n" +
" margin: 0;\n" +
" padding: 0;\n" +
" z-index: 99999\n" +
"}\n" +
"\n" +
".trumbowyg-fullscreen .trumbowyg-editor, .trumbowyg-fullscreen.trumbowyg-box {\n" +
" border: none\n" +
"}\n" +
"\n" +
".trumbowyg-fullscreen .trumbowyg-editor, .trumbowyg-fullscreen .trumbowyg-textarea {\n" +
" height: calc(100% - 37px) !important;\n" +
" overflow: auto\n" +
"}\n" +
"\n" +
".trumbowyg-fullscreen .trumbowyg-overlay {\n" +
" height: 100% !important\n" +
"}\n" +
"\n" +
".trumbowyg-fullscreen .trumbowyg-button-group .trumbowyg-fullscreen-button svg {\n" +
" color: #222;\n" +
" fill: transparent\n" +
"}\n" +
"\n" +
".trumbowyg-editor embed, .trumbowyg-editor img, .trumbowyg-editor object, .trumbowyg-editor video {\n" +
" max-width: 100%\n" +
"}\n" +
"\n" +
".trumbowyg-editor img, .trumbowyg-editor video {\n" +
" height: auto\n" +
"}\n" +
"\n" +
".trumbowyg-editor img {\n" +
" cursor: move\n" +
"}\n" +
"\n" +
".trumbowyg-editor.trumbowyg-reset-css {\n" +
" background: #FEFEFE !important;\n" +
" font-family: \"Trebuchet MS\", Helvetica, Verdana, sans-serif !important;\n" +
" font-size: 14px !important;\n" +
" line-height: 1.45em !important;\n" +
" color: #333\n" +
"}\n" +
"\n" +
".trumbowyg-editor.trumbowyg-reset-css a {\n" +
" color: #15c !important;\n" +
" text-decoration: underline !important\n" +
"}\n" +
"\n" +
".trumbowyg-editor.trumbowyg-reset-css blockquote, .trumbowyg-editor.trumbowyg-reset-css div, .trumbowyg-editor.trumbowyg-reset-css ol, .trumbowyg-editor.trumbowyg-reset-css p, .trumbowyg-editor.trumbowyg-reset-css ul {\n" +
" box-shadow: none !important;\n" +
" background: 0 0 !important;\n" +
" margin: 0 0 15px !important;\n" +
" line-height: 1.4em !important;\n" +
" font-family: \"Trebuchet MS\", Helvetica, Verdana, sans-serif !important;\n" +
" font-size: 14px !important;\n" +
" border: none\n" +
"}\n" +
"\n" +
".trumbowyg-editor.trumbowyg-reset-css hr, .trumbowyg-editor.trumbowyg-reset-css iframe, .trumbowyg-editor.trumbowyg-reset-css object {\n" +
" margin-bottom: 15px !important\n" +
"}\n" +
"\n" +
".trumbowyg-editor.trumbowyg-reset-css blockquote {\n" +
" margin-left: 32px !important;\n" +
" font-style: italic !important;\n" +
" color: #555\n" +
"}\n" +
"\n" +
".trumbowyg-editor.trumbowyg-reset-css ul {\n" +
" list-style: disc\n" +
"}\n" +
"\n" +
".trumbowyg-editor.trumbowyg-reset-css ol, .trumbowyg-editor.trumbowyg-reset-css ul {\n" +
" padding-left: 20px !important\n" +
"}\n" +
"\n" +
".trumbowyg-editor.trumbowyg-reset-css ol ol, .trumbowyg-editor.trumbowyg-reset-css ol ul, .trumbowyg-editor.trumbowyg-reset-css ul ol, .trumbowyg-editor.trumbowyg-reset-css ul ul {\n" +
" border: none;\n" +
" margin: 2px !important;\n" +
" padding: 0 0 0 24px !important\n" +
"}\n" +
"\n" +
".trumbowyg-editor.trumbowyg-reset-css hr {\n" +
" display: block;\n" +
" height: 1px;\n" +
" border: none;\n" +
" border-top: 1px solid #CCC\n" +
"}\n" +
"\n" +
".trumbowyg-editor.trumbowyg-reset-css h1, .trumbowyg-editor.trumbowyg-reset-css h2, .trumbowyg-editor.trumbowyg-reset-css h3, .trumbowyg-editor.trumbowyg-reset-css h4 {\n" +
" color: #111;\n" +
" background: 0 0;\n" +
" margin: 0 !important;\n" +
" padding: 0 !important;\n" +
" font-weight: 700\n" +
"}\n" +
"\n" +
".trumbowyg-editor.trumbowyg-reset-css h1 {\n" +
" font-size: 32px !important;\n" +
" line-height: 38px !important;\n" +
" margin-bottom: 20px !important\n" +
"}\n" +
"\n" +
".trumbowyg-editor.trumbowyg-reset-css h2 {\n" +
" font-size: 26px !important;\n" +
" line-height: 34px !important;\n" +
" margin-bottom: 15px !important\n" +
"}\n" +
"\n" +
".trumbowyg-editor.trumbowyg-reset-css h3 {\n" +
" font-size: 22px !important;\n" +
" line-height: 28px !important;\n" +
" margin-bottom: 7px !important\n" +
"}\n" +
"\n" +
".trumbowyg-editor.trumbowyg-reset-css h4 {\n" +
" font-size: 16px !important;\n" +
" line-height: 22px !important;\n" +
" margin-bottom: 7px !important\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-textarea {\n" +
" background: #111;\n" +
" color: #ddd\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-box {\n" +
" border: 1px solid #343434\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-box.trumbowyg-fullscreen {\n" +
" background: #111\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-box.trumbowyg-box-blur .trumbowyg-editor *, .trumbowyg-dark .trumbowyg-box.trumbowyg-box-blur .trumbowyg-editor::before {\n" +
" text-shadow: 0 0 7px #ccc\n" +
"}\n" +
"\n" +
"@media screen and (min-width: 0 \\0\n" +
") {\n" +
" .trumbowyg-dark .trumbowyg-box.trumbowyg-box-blur .trumbowyg-editor *, .trumbowyg-dark .trumbowyg-box.trumbowyg-box-blur .trumbowyg-editor::before {\n" +
" color: rgba(20, 20, 20, .6) !important\n" +
" }\n" +
"}\n" +
"\n" +
"@supports (-ms-accelerator:true) {\n" +
" .trumbowyg-dark .trumbowyg-box.trumbowyg-box-blur .trumbowyg-editor *, .trumbowyg-dark .trumbowyg-box.trumbowyg-box-blur .trumbowyg-editor::before {\n" +
" color: rgba(20, 20, 20, .6) !important\n" +
" }\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-box svg {\n" +
" fill: #ecf0f1;\n" +
" color: #ecf0f1\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-button-pane {\n" +
" background-color: #222;\n" +
" border-bottom-color: #343434\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-button-pane::after {\n" +
" background: #343434\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-button-pane .trumbowyg-button-group:not(:empty)::after {\n" +
" background-color: #343434\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-button-pane .trumbowyg-button-group:not(:empty) .trumbowyg-fullscreen-button svg {\n" +
" color: transparent\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-button-pane.trumbowyg-disable .trumbowyg-button-group::after {\n" +
" background-color: #2a2a2a\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-button-pane button.trumbowyg-active, .trumbowyg-dark .trumbowyg-button-pane button:not(.trumbowyg-disable):focus, .trumbowyg-dark .trumbowyg-button-pane button:not(.trumbowyg-disable):hover {\n" +
" background-color: #333\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-button-pane .trumbowyg-open-dropdown::after {\n" +
" border-top-color: #fff\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-fullscreen .trumbowyg-button-group .trumbowyg-fullscreen-button svg {\n" +
" color: #ecf0f1;\n" +
" fill: transparent\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-dropdown {\n" +
" border-color: #222;\n" +
" background: #333;\n" +
" box-shadow: rgba(0, 0, 0, .3) 0 2px 3px\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-dropdown button {\n" +
" background: #333;\n" +
" color: #fff !important\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-dropdown button:focus, .trumbowyg-dark .trumbowyg-dropdown button:hover {\n" +
" background: #222\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-modal-box {\n" +
" background-color: #222\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-title {\n" +
" border-bottom: 1px solid #555;\n" +
" color: #fff;\n" +
" background: #3c3c3c\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-modal-box label {\n" +
" display: block;\n" +
" position: relative;\n" +
" margin: 15px 12px;\n" +
" height: 27px;\n" +
" line-height: 27px;\n" +
" overflow: hidden\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-modal-box label .trumbowyg-input-infos span {\n" +
" color: #eee;\n" +
" background-color: #2f2f2f;\n" +
" border-color: #222\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-modal-box label .trumbowyg-input-infos span.trumbowyg-msg-error {\n" +
" color: #e74c3c\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-modal-box label.trumbowyg-input-error input, .trumbowyg-dark .trumbowyg-modal-box label.trumbowyg-input-error textarea {\n" +
" border-color: #e74c3c\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-modal-box label input {\n" +
" border-color: #222;\n" +
" color: #eee;\n" +
" background: #333\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-modal-box label input:focus, .trumbowyg-dark .trumbowyg-modal-box label input:hover {\n" +
" border-color: #626262\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-modal-box label input:focus {\n" +
" background-color: #2f2f2f\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit {\n" +
" background: #1b7943\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:focus, .trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:hover {\n" +
" background: #25a25a\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:active {\n" +
" background: #176437\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset {\n" +
" background: #333;\n" +
" color: #ccc\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:focus, .trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:hover {\n" +
" background: #444\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:active {\n" +
" background: #111\n" +
"}\n" +
"\n" +
".trumbowyg-dark .trumbowyg-overlay {\n" +
" background-color: rgba(15, 15, 15, .6)\n" +
"}");
System.out.println("write to file success : " + file.getPath());
} catch (IOException e) {
e.printStackTrace();
} finally {
MybatisUtilCommon.closeBufferWriterAndFileOutputStream(fileOutputStream, bufferedWriter);
}
}
public static void writeJsPlusTrumbowygJs(String htmlPath, String serverUrl) {
File file = null;
OutputStream fileOutputStream = null;
BufferedWriter bufferedWriter = null;
try {
File folder = new File(htmlPath + "/content/page-common/js");
folder.mkdirs();
file = new File(htmlPath + "/content/page-common/js/trumbowyg.js");
//如果文件不存在,则创建文件,如果已存在,则覆盖
file.createNewFile();
fileOutputStream = new FileOutputStream(file);
bufferedWriter = new BufferedWriter(new OutputStreamWriter(fileOutputStream, "utf-8"));
bufferedWriter.write("jQuery.trumbowyg={langs:{en:{viewHTML:\"View HTML\",undo:\"Undo\",redo:\"Redo\",formatting:\"Formatting\",p:\"Paragraph\",blockquote:\"Quote\",code:\"Code\",header:\"Header\",bold:\"Bold\",italic:\"Italic\",strikethrough:\"Stroke\",underline:\"Underline\",strong:\"Strong\",em:\"Emphasis\",del:\"Deleted\",superscript:\"Superscript\",subscript:\"Subscript\",unorderedList:\"Unordered list\",orderedList:\"Ordered list\",insertImage:\"Insert Image\",link:\"Link\",createLink:\"Insert link\",unlink:\"Remove link\",justifyLeft:\"Align Left\",justifyCenter:\"Align Center\",justifyRight:\"Align Right\",justifyFull:\"Align Justify\",horizontalRule:\"Insert horizontal rule\",removeformat:\"Remove format\",fullscreen:\"Fullscreen\",close:\"Close\",submit:\"Confirm\",reset:\"Cancel\",required:\"Required\",description:\"Description\",title:\"Title\",text:\"Text\",target:\"Target\",width:\"Width\"}},plugins:{},svgPath:null,hideButtonTexts:null},Object.defineProperty(jQuery.trumbowyg,\"defaultOptions\",{value:{lang:\"en\",fixedBtnPane:!1,fixedFullWidth:!1,autogrow:!1,autogrowOnEnter:!1,imageWidthModalEdit:!1,prefix:\"trumbowyg-\",semantic:!0,resetCss:!1,removeformatPasted:!1,tagsToRemove:[],btns:[[\"viewHTML\"],[\"undo\",\"redo\"],[\"formatting\"],[\"strong\",\"em\",\"del\"],[\"superscript\",\"subscript\"],[\"link\"],[\"insertImage\"],[\"justifyLeft\",\"justifyCenter\",\"justifyRight\",\"justifyFull\"],[\"unorderedList\",\"orderedList\"],[\"horizontalRule\"],[\"removeformat\"],[\"fullscreen\"]],btnsDef:{},inlineElementsSelector:\"a,abbr,acronym,b,caption,cite,code,col,dfn,dir,dt,dd,em,font,hr,i,kbd,li,q,span,strikeout,strong,sub,sup,u\",pasteHandlers:[],plugins:{},urlProtocol:!1,minimalLinks:!1},writable:!1,enumerable:!0,configurable:!1}),function(e,t,n,a){\"use strict\";var o=\"tbwconfirm\",r=\"tbwcancel\";a.fn.trumbowyg=function(e,t){var n=\"trumbowyg\";if(e===Object(e)||!e)return this.each(function(){a(this).data(n)||a(this).data(n,new i(this,e))});if(1===this.length)try{var o=a(this).data(n);switch(e){case\"execCmd\":return o.execCmd(t.cmd,t.param,t.forceCss);case\"openModal\":return o.openModal(t.title,t.content);case\"closeModal\":return o.closeModal();case\"openModalInsert\":return o.openModalInsert(t.title,t.fields,t.callback);case\"saveRange\":return o.saveRange();case\"getRange\":return o.range;case\"getRangeText\":return o.getRangeText();case\"restoreRange\":return o.restoreRange();case\"enable\":return o.setDisabled(!1);case\"disable\":return o.setDisabled(!0);case\"toggle\":return o.toggle();case\"destroy\":return o.destroy();case\"empty\":return o.empty();case\"html\":return o.html(t)}}catch(r){}return!1};var i=function(o,r){var i=this,s=\"trumbowyg-icons\",l=a.trumbowyg;i.doc=o.ownerDocument||n,i.$ta=a(o),i.$c=a(o),r=r||{},null!=r.lang||null!=l.langs[r.lang]?i.lang=a.extend(!0,{},l.langs.en,l.langs[r.lang]):i.lang=l.langs.en,i.hideButtonTexts=null!=l.hideButtonTexts?l.hideButtonTexts:r.hideButtonTexts;var d=null!=l.svgPath?l.svgPath:r.svgPath;if(i.hasSvg=d!==!1,i.svgPath=i.doc.querySelector(\"base\")?t.location.href.split(\"#\")[0]:\"\",0===a(\"#\"+s,i.doc).length&&d!==!1){if(null==d){for(var c=n.getElementsByTagName(\"script\"),u=0;u\",{\"class\":n+\"box \"+n+\"editor-visible \"+n+e.o.lang+\" trumbowyg\"}),e.isTextarea=e.$ta.is(\"textarea\"),e.isTextarea?(o=e.$ta.val(),e.$ed=a(\"
\"),e.$box.insertAfter(e.$ta).append(e.$ed,e.$ta)):(e.$ed=e.$ta,o=e.$ed.html(),e.$ta=a(\"\",{name:e.$ta.attr(\"id\"),height:e.height}).val(o),e.$box.insertAfter(e.$ed).append(e.$ta,e.$ed),e.syncCode()),e.$ta.addClass(n+\"textarea\").attr(\"tabindex\",-1),e.$ed.addClass(n+\"editor\").attr({contenteditable:!0,dir:e.lang._dir||\"ltr\"}).html(o),e.o.tabindex&&e.$ed.attr(\"tabindex\",e.o.tabindex),e.$c.is(\"[placeholder]\")&&e.$ed.attr(\"placeholder\",e.$c.attr(\"placeholder\")),e.$c.is(\"[spellcheck]\")&&e.$ed.attr(\"spellcheck\",e.$c.attr(\"spellcheck\")),e.o.resetCss&&e.$ed.addClass(n+\"reset-css\"),e.o.autogrow||e.$ta.add(e.$ed).css({height:e.height}),e.semanticCode(),e.o.autogrowOnEnter&&e.$ed.addClass(n+\"autogrow-on-enter\");var r,i=!1,s=!1,l=\"keyup\";e.$ed.on(\"dblclick\",\"img\",e.o.imgDblClickHandler).on(\"keydown\",function(t){if((t.ctrlKey||t.metaKey)&&!t.altKey){i=!0;var n=e.keys[String.fromCharCode(t.which).toUpperCase()];try{return e.execCmd(n.fn,n.param),!1}catch(a){}}}).on(\"compositionstart compositionupdate\",function(){s=!0}).on(l+\" compositionend\",function(t){if(\"compositionend\"===t.type)s=!1;else if(s)return;var n=t.which;if(!(n>=37&&n<=40)){if(!t.ctrlKey&&!t.metaKey||89!==n&&90!==n)if(i||17===n)\"undefined\"==typeof t.which&&e.semanticCode(!1,!1,!0);else{var a=!e.isIE||\"compositionend\"===t.type;e.semanticCode(!1,a&&13===n),e.$c.trigger(\"tbwchange\")}else e.$c.trigger(\"tbwchange\");setTimeout(function(){i=!1},50)}}).on(\"mouseup keydown keyup\",function(t){(!t.ctrlKey&&!t.metaKey||t.altKey)&&setTimeout(function(){i=!1},50),clearTimeout(r),r=setTimeout(function(){e.updateButtonPaneStatus()},50)}).on(\"focus blur\",function(t){if(e.$c.trigger(\"tbw\"+t.type),\"blur\"===t.type&&a(\".\"+n+\"active-button\",e.$btnPane).removeClass(n+\"active-button \"+n+\"active\"),e.o.autogrowOnEnter){if(e.autogrowOnEnterDontClose)return;\"focus\"===t.type?(e.autogrowOnEnterWasFocused=!0,e.autogrowEditorOnEnter()):e.o.autogrow||(e.$ed.css({height:e.$ed.css(\"min-height\")}),e.$c.trigger(\"tbwresize\"))}}).on(\"cut\",function(){setTimeout(function(){e.semanticCode(!1,!0),e.$c.trigger(\"tbwchange\")},0)}).on(\"paste\",function(n){if(e.o.removeformatPasted){n.preventDefault(),t.getSelection&&t.getSelection().deleteFromDocument&&t.getSelection().deleteFromDocument();try{var o=t.clipboardData.getData(\"Text\");try{e.doc.selection.createRange().pasteHTML(o)}catch(r){e.doc.getSelection().getRangeAt(0).insertNode(e.doc.createTextNode(o))}e.$c.trigger(\"tbwchange\",n)}catch(i){e.execCmd(\"insertText\",(n.originalEvent||n).clipboardData.getData(\"text/plain\"))}}a.each(e.pasteHandlers,function(e,t){t(n)}),setTimeout(function(){e.semanticCode(!1,!0),e.$c.trigger(\"tbwpaste\",n)},0)}),e.$ta.on(\"keyup\",function(){e.$c.trigger(\"tbwchange\")}).on(\"paste\",function(){setTimeout(function(){e.$c.trigger(\"tbwchange\")},0)}),e.$box.on(\"keydown\",function(t){if(27===t.which&&1===a(\".\"+n+\"modal-box\",e.$box).length)return e.closeModal(),!1})},autogrowEditorOnEnter:function(){var e=this;e.$ed.removeClass(\"autogrow-on-enter\");var t=e.$ed[0].clientHeight;e.$ed.height(\"auto\");var n=e.$ed[0].scrollHeight;e.$ed.addClass(\"autogrow-on-enter\"),t!==n&&(e.$ed.height(t),setTimeout(function(){e.$ed.css({height:n}),e.$c.trigger(\"tbwresize\")},0))},buildBtnPane:function(){var e=this,t=e.o.prefix,n=e.$btnPane=a(\"
\",{\"class\":t+\"button-pane\"});a.each(e.o.btns,function(o,r){a.isArray(r)||(r=[r]);var i=a(\"
\",{\"class\":t+\"button-group \"+(r.indexOf(\"fullscreen\")>=0?t+\"right\":\"\")});a.each(r,function(t,n){try{e.isSupportedBtn(n)&&i.append(e.buildBtn(n))}catch(a){}}),i.html().trim().length>0&&n.append(i)}),e.$box.prepend(n)},buildBtn:function(e){var t=this,n=t.o.prefix,o=t.btnsDef[e],r=o.dropdown,i=null==o.hasIcon||o.hasIcon,s=t.lang[e]||e,l=a(\" \",{type:\"button\",\"class\":n+e+\"-button \"+(o[\"class\"]||\"\")+(i?\"\":\" \"+n+\"textual-button\"),html:t.hasSvg&&i?' ':t.hideButtonTexts?\"\":o.text||o.title||t.lang[e]||e,title:(o.title||o.text||s)+(o.key?\" (Ctrl + \"+o.key+\")\":\"\"),tabindex:-1,mousedown:function(){return r&&!a(\".\"+e+\"-\"+n+\"dropdown\",t.$box).is(\":hidden\")||a(\"body\",t.doc).trigger(\"mousedown\"),!((t.$btnPane.hasClass(n+\"disable\")||t.$box.hasClass(n+\"disabled\"))&&!a(this).hasClass(n+\"active\")&&!a(this).hasClass(n+\"not-disable\"))&&(t.execCmd(!!r&&\"dropdown\"||o.fn||e,o.param||e,o.forceCss),!1)}});if(r){l.addClass(n+\"open-dropdown\");var d=n+\"dropdown\",c={\"class\":d+\"-\"+e+\" \"+d+\" \"+n+\"fixed-top\"};c[\"data-\"+d]=e;var u=a(\"
\",c);a.each(r,function(e,n){t.btnsDef[n]&&t.isSupportedBtn(n)&&u.append(t.buildSubBtn(n))}),t.$box.append(u.hide())}else o.key&&(t.keys[o.key]={fn:o.fn||e,param:o.param||e});return r||(t.tagToButton[(o.tag||e).toLowerCase()]=e),l},buildSubBtn:function(e){var t=this,n=t.o.prefix,o=t.btnsDef[e],r=null==o.hasIcon||o.hasIcon;return o.key&&(t.keys[o.key]={fn:o.fn||e,param:o.param||e}),t.tagToButton[(o.tag||e).toLowerCase()]=e,a(\" \",{type:\"button\",\"class\":n+e+\"-dropdown-button\"+(o.ico?\" \"+n+o.ico+\"-button\":\"\"),html:t.hasSvg&&r?' '+(o.text||o.title||t.lang[e]||e):o.text||o.title||t.lang[e]||e,title:o.key?\" (Ctrl + \"+o.key+\")\":null,style:o.style||null,mousedown:function(){return a(\"body\",t.doc).trigger(\"mousedown\"),t.execCmd(o.fn||e,o.param||e,o.forceCss),!1}})},isSupportedBtn:function(e){try{return this.btnsDef[e].isSupported()}catch(t){}return!0},buildOverlay:function(){var e=this;return e.$overlay=a(\"
\",{\"class\":e.o.prefix+\"overlay\"}).appendTo(e.$box),e.$overlay},showOverlay:function(){var e=this;a(t).trigger(\"scroll\"),e.$overlay.fadeIn(200),e.$box.addClass(e.o.prefix+\"box-blur\")},hideOverlay:function(){var e=this;e.$overlay.fadeOut(50),e.$box.removeClass(e.o.prefix+\"box-blur\")},fixedBtnPaneEvents:function(){var e=this,n=e.o.fixedFullWidth,o=e.$box;e.o.fixedBtnPane&&(e.isFixed=!1,a(t).on(\"scroll.\"+e.eventNamespace+\" resize.\"+e.eventNamespace,function(){if(o){e.syncCode();var r=a(t).scrollTop(),i=o.offset().top+1,s=e.$btnPane,l=s.outerHeight()-2;r-i>0&&r-i-e.height<0?(e.isFixed||(e.isFixed=!0,s.css({position:\"fixed\",top:0,left:n?\"0\":\"auto\",zIndex:7}),a([e.$ta,e.$ed]).css({marginTop:s.height()})),s.css({width:n?\"100%\":o.width()-1+\"px\"}),a(\".\"+e.o.prefix+\"fixed-top\",o).css({position:n?\"fixed\":\"absolute\",top:n?l:l+(r-i)+\"px\",zIndex:15})):e.isFixed&&(e.isFixed=!1,s.removeAttr(\"style\"),a([e.$ta,e.$ed]).css({marginTop:0}),a(\".\"+e.o.prefix+\"fixed-top\",o).css({position:\"absolute\",top:l}))}}))},setDisabled:function(e){var t=this,n=t.o.prefix;t.disabled=e,e?t.$ta.attr(\"disabled\",!0):t.$ta.removeAttr(\"disabled\"),t.$box.toggleClass(n+\"disabled\",e),t.$ed.attr(\"contenteditable\",!e)},destroy:function(){var e=this,n=e.o.prefix;e.isTextarea?e.$box.after(e.$ta.css({height:\"\"}).val(e.html()).removeClass(n+\"textarea\").show()):e.$box.after(e.$ed.css({height:\"\"}).removeClass(n+\"editor\").removeAttr(\"contenteditable\").removeAttr(\"dir\").html(e.html()).show()),e.$ed.off(\"dblclick\",\"img\"),e.destroyPlugins(),e.$box.remove(),e.$c.removeData(\"trumbowyg\"),a(\"body\").removeClass(n+\"body-fullscreen\"),e.$c.trigger(\"tbwclose\"),a(t).off(\"scroll.\"+e.eventNamespace+\" resize.\"+e.eventNamespace)},empty:function(){this.$ta.val(\"\"),this.syncCode(!0)},toggle:function(){var e=this,t=e.o.prefix;e.o.autogrowOnEnter&&(e.autogrowOnEnterDontClose=!e.$box.hasClass(t+\"editor-hidden\")),e.semanticCode(!1,!0),setTimeout(function(){e.doc.activeElement.blur(),e.$box.toggleClass(t+\"editor-hidden \"+t+\"editor-visible\"),e.$btnPane.toggleClass(t+\"disable\"),a(\".\"+t+\"viewHTML-button\",e.$btnPane).toggleClass(t+\"active\"),e.$box.hasClass(t+\"editor-visible\")?e.$ta.attr(\"tabindex\",-1):e.$ta.removeAttr(\"tabindex\"),e.o.autogrowOnEnter&&!e.autogrowOnEnterDontClose&&e.autogrowEditorOnEnter()},0)},dropdown:function(e){var n=this,o=n.doc,r=n.o.prefix,i=a(\"[data-\"+r+\"dropdown=\"+e+\"]\",n.$box),s=a(\".\"+r+e+\"-button\",n.$btnPane),l=i.is(\":hidden\");if(a(\"body\",o).trigger(\"mousedown\"),l){var d=s.offset().left;s.addClass(r+\"active\"),i.css({position:\"absolute\",top:s.offset().top-n.$btnPane.offset().top+s.outerHeight(),left:n.o.fixedFullWidth&&n.isFixed?d+\"px\":d-n.$btnPane.offset().left+\"px\"}).show(),a(t).trigger(\"scroll\"),a(\"body\",o).on(\"mousedown.\"+n.eventNamespace,function(e){i.is(e.target)||(a(\".\"+r+\"dropdown\",n.$box).hide(),a(\".\"+r+\"active\",n.$btnPane).removeClass(r+\"active\"),a(\"body\",o).off(\"mousedown.\"+n.eventNamespace))})}},html:function(e){var t=this;return null!=e?(t.$ta.val(e),t.syncCode(!0),t.$c.trigger(\"tbwchange\"),t):t.$ta.val()},syncTextarea:function(){var e=this;e.$ta.val(e.$ed.text().trim().length>0||e.$ed.find(\"hr,img,embed,iframe,input\").length>0?e.$ed.html():\"\")},syncCode:function(e){var t=this;if(!e&&t.$ed.is(\":visible\"))t.syncTextarea();else{var n=a(\"\").html(t.$ta.val()),o=a(\"
\").append(n);a(t.o.tagsToRemove.join(\",\"),o).remove(),t.$ed.html(o.contents().html())}if(t.o.autogrow&&(t.height=t.$ed.height(),t.height!==t.$ta.css(\"height\")&&(t.$ta.css({height:t.height}),t.$c.trigger(\"tbwresize\"))),t.o.autogrowOnEnter){t.$ed.height(\"auto\");var r=t.autogrowOnEnterWasFocused?t.$ed[0].scrollHeight:t.$ed.css(\"min-height\");r!==t.$ta.css(\"height\")&&(t.$ed.css({height:r}),t.$c.trigger(\"tbwresize\"))}},semanticCode:function(e,t,n){var o=this;if(o.saveRange(),o.syncCode(e),o.o.semantic){if(o.semanticTag(\"b\"),o.semanticTag(\"i\"),o.semanticTag(\"s\"),o.semanticTag(\"strike\"),t){var r=o.o.inlineElementsSelector,i=\":not(\"+r+\")\";o.$ed.contents().filter(function(){return 3===this.nodeType&&this.nodeValue.trim().length>0}).wrap(\"
\");var s=function(e){if(0!==e.length){var t=e.nextUntil(i).addBack().wrapAll(\"
\").parent(),n=t.nextAll(r).first();t.next(\"br\").remove(),s(n)}};s(o.$ed.children(r).first()),o.semanticTag(\"div\",!0),o.$ed.find(\"p\").filter(function(){return(!o.range||this!==o.range.startContainer)&&(0===a(this).text().trim().length&&0===a(this).children().not(\"br,span\").length)}).contents().unwrap(),a(\"[data-tbw]\",o.$ed).contents().unwrap(),o.$ed.find(\"p:empty\").remove()}n||o.restoreRange(),o.syncTextarea()}},semanticTag:function(e,t){var n;if(null!=this.o.semantic&&\"object\"==typeof this.o.semantic&&this.o.semantic.hasOwnProperty(e))n=this.o.semantic[e];else{if(this.o.semantic!==!0||!this.DEFAULT_SEMANTIC_MAP.hasOwnProperty(e))return;n=this.DEFAULT_SEMANTIC_MAP[e]}a(e,this.$ed).each(function(){var e=a(this);e.wrap(\"<\"+n+\"/>\"),t&&a.each(e.prop(\"attributes\"),function(){e.parent().attr(this.name,this.value)}),e.contents().unwrap()})},createLink:function(){for(var e,t,n,o=this,r=o.doc.getSelection(),i=r.focusNode,s=(new XMLSerializer).serializeToString(r.getRangeAt(0).cloneContents());[\"A\",\"DIV\"].indexOf(i.nodeName)<0;)i=i.parentNode;if(i&&\"A\"===i.nodeName){var l=a(i);s=l.text(),e=l.attr(\"href\"),o.o.minimalLinks||(t=l.attr(\"title\"),n=l.attr(\"target\"));var d=o.doc.createRange();d.selectNode(i),r.removeAllRanges(),r.addRange(d)}o.saveRange();var c={url:{label:\"URL\",required:!0,value:e},text:{label:o.lang.text,value:s}};o.o.minimalLinks||Object.assign(c,{title:{label:o.lang.title,value:t},target:{label:o.lang.target,value:n}}),o.openModalInsert(o.lang.createLink,c,function(e){var t=o.prependUrlPrefix(e.url);if(!t.length)return!1;var n=a(['
',e.text||e.url,\" \"].join(\"\"));return o.o.minimalLinks||(e.title.length>0&&n.attr(\"title\",e.title),e.target.length>0&&n.attr(\"target\",e.target)),o.range.deleteContents(),o.range.insertNode(n[0]),o.syncCode(),o.$c.trigger(\"tbwchange\"),!0})},prependUrlPrefix:function(e){var t=this;if(!t.urlPrefix)return e;var n=/^([a-z][-+.a-z0-9]*:|\\/|#)/i;if(n.test(e))return e;var a=/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;return a.test(e)?\"mailto:\"+e:t.urlPrefix+e},unlink:function(){var e=this,t=e.doc.getSelection(),n=t.focusNode;if(t.isCollapsed){for(;[\"A\",\"DIV\"].indexOf(n.nodeName)<0;)n=n.parentNode;if(n&&\"A\"===n.nodeName){var a=e.doc.createRange();a.selectNode(n),t.removeAllRanges(),t.addRange(a)}}e.execCmd(\"unlink\",void 0,void 0,!0)},insertImage:function(){var e=this;e.saveRange();var t={url:{label:\"URL\",required:!0},alt:{label:e.lang.description,value:e.getRangeText()}};e.o.imageWidthModalEdit&&(t.width={}),e.openModalInsert(e.lang.insertImage,t,function(t){e.execCmd(\"insertImage\",t.url);var n=a('img[src=\"'+t.url+'\"]:not([alt])',e.$box);return n.attr(\"alt\",t.alt),e.o.imageWidthModalEdit&&n.attr({width:t.width}),e.syncCode(),e.$c.trigger(\"tbwchange\"),!0})},fullscreen:function(){var e,n=this,o=n.o.prefix,r=o+\"fullscreen\";n.$box.toggleClass(r),e=n.$box.hasClass(r),a(\"body\").toggleClass(o+\"body-fullscreen\",e),a(t).trigger(\"scroll\"),n.$c.trigger(\"tbw\"+(e?\"open\":\"close\")+\"fullscreen\")},execCmd:function(e,t,n,a){var o=this;a=!!a||\"\",\"dropdown\"!==e&&o.$ed.focus();try{o.doc.execCommand(\"styleWithCSS\",!1,n||!1)}catch(r){}try{o[e+a](t)}catch(r){try{e(t)}catch(i){\"insertHorizontalRule\"===e?t=void 0:\"formatBlock\"===e&&o.isIE&&(t=\"<\"+t+\">\"),o.doc.execCommand(e,!1,t),o.syncCode(),o.semanticCode(!1,!0)}\"dropdown\"!==e&&(o.updateButtonPaneStatus(),o.$c.trigger(\"tbwchange\"))}},openModal:function(e,n){var i=this,s=i.o.prefix;if(a(\".\"+s+\"modal-box\",i.$box).length>0)return!1;i.o.autogrowOnEnter&&(i.autogrowOnEnterDontClose=!0),i.saveRange(),i.showOverlay(),i.$btnPane.addClass(s+\"disable\");var l=a(\"
\",{\"class\":s+\"modal \"+s+\"fixed-top\"}).css({top:i.$btnPane.height()}).appendTo(i.$box);i.$overlay.one(\"click\",function(){return l.trigger(r),!1});var d=a(\"
\",{action:\"\",html:n}).on(\"submit\",function(){return l.trigger(o),!1}).on(\"reset\",function(){return l.trigger(r),!1}).on(\"submit reset\",function(){i.o.autogrowOnEnter&&(i.autogrowOnEnterDontClose=!1)}),c=a(\"
\",{\"class\":s+\"modal-box\",html:d}).css({top:\"-\"+i.$btnPane.outerHeight()+\"px\",opacity:0}).appendTo(l).animate({top:0,opacity:1},100);return a(\"
\",{text:e,\"class\":s+\"modal-title\"}).prependTo(c),l.height(c.outerHeight()+10),a(\"input:first\",c).focus(),i.buildModalBtn(\"submit\",c),i.buildModalBtn(\"reset\",c),a(t).trigger(\"scroll\"),l},buildModalBtn:function(e,t){var n=this,o=n.o.prefix;return a(\"
\",{\"class\":o+\"modal-button \"+o+\"modal-\"+e,type:e,text:n.lang[e]||e}).appendTo(a(\"form\",t))},closeModal:function(){var e=this,t=e.o.prefix;e.$btnPane.removeClass(t+\"disable\"),e.$overlay.off();var n=a(\".\"+t+\"modal-box\",e.$box);n.animate({top:\"-\"+n.height()},100,function(){n.parent().remove(),e.hideOverlay()}),e.restoreRange()},openModalInsert:function(e,t,n){var i=this,s=i.o.prefix,l=i.lang,d=\"\";return a.each(t,function(e,t){var n=t.label||e,a=t.name||e,o=t.attributes||{},r=Object.keys(o).map(function(e){return e+'=\"'+o[e]+'\"'}).join(\" \");d+='
'+(l[n]?l[n]:n)+\" \"}),i.openModal(e,d).on(o,function(){var e=a(\"form\",a(this)),r=!0,s={};a.each(t,function(t,n){var o=n.name||t,l=a('input[name=\"'+o+'\"]',e),d=l.attr(\"type\");switch(d.toLowerCase()){case\"checkbox\":s[o]=l.is(\":checked\");break;case\"radio\":s[o]=l.filter(\":checked\").val();break;default:s[o]=a.trim(l.val())}n.required&&\"\"===s[o]?(r=!1,i.addErrorOnModalField(l,i.lang.required)):n.pattern&&!n.pattern.test(s[o])&&(r=!1,i.addErrorOnModalField(l,n.patternError))}),r&&(i.restoreRange(),n(s,t)&&(i.syncCode(),i.$c.trigger(\"tbwchange\"),i.closeModal(),a(this).off(o)))}).one(r,function(){a(this).off(o),i.closeModal()})},addErrorOnModalField:function(e,t){var n=this.o.prefix,o=e.parent();e.on(\"change keyup\",function(){o.removeClass(n+\"input-error\")}),o.addClass(n+\"input-error\").find(\"input+span\").append(a(\"
\",{\"class\":n+\"msg-error\",text:t}))},getDefaultImgDblClickHandler:function(){var e=this;return function(){var t=a(this),n=t.attr(\"src\"),o=\"(Base64)\";0===n.indexOf(\"data:image\")&&(n=o);var r={url:{label:\"URL\",value:n,required:!0},alt:{label:e.lang.description,value:t.attr(\"alt\")}};return e.o.imageWidthModalEdit&&(r.width={value:t.attr(\"width\")?t.attr(\"width\"):\"\"}),e.openModalInsert(e.lang.insertImage,r,function(n){return n.url!==o&&t.attr({src:n.url}),t.attr({alt:n.alt}),e.o.imageWidthModalEdit&&(parseInt(n.width)>0?t.attr({width:n.width}):t.removeAttr(\"width\")),!0}),!1}},saveRange:function(){var e=this,t=e.doc.getSelection();if(e.range=null,t.rangeCount){var n,a=e.range=t.getRangeAt(0),o=e.doc.createRange();o.selectNodeContents(e.$ed[0]),o.setEnd(a.startContainer,a.startOffset),n=(o+\"\").length,e.metaRange={start:n,end:n+(a+\"\").length}}},restoreRange:function(){var e,t=this,n=t.metaRange,a=t.range,o=t.doc.getSelection();if(a){if(n&&n.start!==n.end){var r,i=0,s=[t.$ed[0]],l=!1,d=!1;for(e=t.doc.createRange();!d&&(r=s.pop());)if(3===r.nodeType){var c=i+r.length;!l&&n.start>=i&&n.start<=c&&(e.setStart(r,n.start-i),l=!0),l&&n.end>=i&&n.end<=c&&(e.setEnd(r,n.end-i),d=!0),i=c}else for(var u=r.childNodes,g=u.length;g>0;)g-=1,s.push(u[g])}o.removeAllRanges(),o.addRange(e||a)}},getRangeText:function(){return this.range+\"\"},updateButtonPaneStatus:function(){var e=this,t=e.o.prefix,n=e.getTagsRecursive(e.doc.getSelection().focusNode),o=t+\"active-button \"+t+\"active\";a(\".\"+t+\"active-button\",e.$btnPane).removeClass(o),a.each(n,function(n,r){var i=e.tagToButton[r.toLowerCase()],s=a(\".\"+t+i+\"-button\",e.$btnPane);if(s.length>0)s.addClass(o);else try{s=a(\".\"+t+\"dropdown .\"+t+i+\"-dropdown-button\",e.$box);var l=s.parent().data(\"dropdown\");a(\".\"+t+l+\"-button\",e.$box).addClass(o)}catch(d){}})},getTagsRecursive:function(e,t){var n=this;if(t=t||(e&&e.tagName?[e.tagName]:[]),!e||!e.parentNode)return t;e=e.parentNode;var o=e.tagName;return\"DIV\"===o?t:(\"P\"===o&&\"\"!==e.style.textAlign&&t.push(e.style.textAlign),a.each(n.tagHandlers,function(a,o){t=t.concat(o(e,n))}),t.push(o),n.getTagsRecursive(e,t).filter(function(e){return null!=e}))},initPlugins:function(){var e=this;e.loadedPlugins=[],a.each(a.trumbowyg.plugins,function(t,n){n.shouldInit&&!n.shouldInit(e)||(n.init(e),n.tagHandler&&e.tagHandlers.push(n.tagHandler),e.loadedPlugins.push(n))})},destroyPlugins:function(){a.each(this.loadedPlugins,function(e,t){t.destroy&&t.destroy()})}}}(navigator,window,document,jQuery);");
System.out.println("write to file success : " + file.getPath());
} catch (IOException e) {
e.printStackTrace();
} finally {
MybatisUtilCommon.closeBufferWriterAndFileOutputStream(fileOutputStream, bufferedWriter);
}
}
public static void writeJsPlusJjlcJs(String htmlPath, String serverUrl) {
File file = null;
OutputStream fileOutputStream = null;
BufferedWriter bufferedWriter = null;
try {
File folder = new File(htmlPath + "/content/page-common/js");
folder.mkdirs();
file = new File(htmlPath + "/content/page-common/js/jcompress.js");
//如果文件不存在,则创建文件,如果已存在,则覆盖
file.createNewFile();
fileOutputStream = new FileOutputStream(file);
bufferedWriter = new BufferedWriter(new OutputStreamWriter(fileOutputStream, "utf-8"));
bufferedWriter.write("!function(e){\"use strict\";function t(e){var t,n=[],r={};for(t in e)n.push([t,e[t]]);n.sort(function(e,t){return t[1]-e[1]});for(t in n)r[n[t][0]]=n[t][1];return r}function n(e){var t,r=e[e" +
".length-1],o=e.substring(0,e.length-1);return\"undefined\"==typeof r?t=\"a\":\"z\"===r?t=\"A\":\"Z\"===r?(t=\"a\",o=\"\"!==o?n(o):\"a\"):t=String.fromCharCode(r.charCodeAt(0)+1),r=t,o+r}function r(e){var r,o," +
"i={}," +
"f=\"\",d=e.match(u);for(r in d)d[r].length>f.length+2&&(\"undefined\"!=typeof i[d[r]]?i[d[r]]+=1:i[d[r]]=0);o=t(i);for(r in o)f=n(f),o[r]=a+f+a;return o}function o(e,t){var n,r;for(n in t)r=new RegExp(n,\"g\")," +
"e=e" +
".replace(r,t[n]);return e}function i(e,t){var n,r;for(n in t)r=new RegExp(t[n],\"g\"),e=e.replace(r,n);return e}function f(){this.setItem=function(e,t,n){var i,f,u;return(\"undefined\"==typeof " +
"n||\"no-beautify\"!==n)" +
"&&(f=JSON.parse(t),t=JSON.stringify(f)),u=r(t),i=o(t,u),\"undefined\"!=typeof n&&\"local-dict\"===n?d[e]=u:localStorage.setItem(e,i),\"undefined\"==typeof d[e]&&localStorage.setItem(\"d_\"+e,JSON.stringify(u))," +
"i}," +
"this.getItem=function(e){var t,n;return t=localStorage.getItem(e),n=\"undefined\"==typeof d[e]?JSON.parse(localStorage.getItem(\"d_\"+e)):d[e],i(t,n)},this.getDict=function(e){var t;return t=\"undefined\"==typeof" +
" " +
"d[e]?JSON.parse(localStorage.getItem(\"d_\"+e)):d[e]},this.setDict=function(e,t,n){\"undefined\"==typeof n?localStorage.setItem(\"d_\"+e,t):d[e]=t}}var u=/\\\"[a-zA-Z0-9]*\\\":/g,a=\"£\",d={};" +
"\"undefined\"!=typeof " +
"define&&define.amd?define([],function(){return new f}):\"undefined\"!=typeof module&&module.exports?module.exports=new f:e.JCOMPRESS=new f}(this);");
System.out.println("write to file success : " + file.getPath());
} catch (IOException e) {
e.printStackTrace();
} finally {
MybatisUtilCommon.closeBufferWriterAndFileOutputStream(fileOutputStream, bufferedWriter);
}
}
public static void writeJsCommonServerJs(String htmlPath, String serverUrl, String tokenErrorStatus, String fileServer) {
if (serverUrl == null) {
serverUrl = "http://localhost:8080/";
}
File file = null;
OutputStream fileOutputStream = null;
BufferedWriter bufferedWriter = null;
try {
File folder = new File(htmlPath + "/content/page-common/js");
folder.mkdirs();
file = new File(htmlPath + "/content/page-common/js/server.js");
//如果文件不存在,则创建文件,如果已存在,则覆盖
file.createNewFile();
fileOutputStream = new FileOutputStream(file);
bufferedWriter = new BufferedWriter(new OutputStreamWriter(fileOutputStream, "utf-8"));
bufferedWriter.write("var validResForIndex = function(res){\nif(res.status==" + tokenErrorStatus + "){\nalert(res.message);\ngotoLoginForIndex();\n}else{\nalert(res.message);\n}\n}\n" +
"var validResForContent = function(res){\nif(res.status==" + tokenErrorStatus + "){\nalert(res.message);\ngotoLoginForContent();\n}else{\nalert(res.message);\n}\n}\n" +
"var timestampToTime = function (timestamp) {\n" +
" var date = new Date(timestamp);\n" +
" Y = date.getFullYear() + '-';\n" +
" M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';\n" +
" D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + 'T';\n" +
" h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':';\n" +
" m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + ':';\n" +
" s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds());\n" +
" return Y + M + D + h + m + s;\n" +
"}\n\n" +
"var gotoLoginForIndex=function(){\ntop.location.href='page-login.html';\nlocation.href='page-login.html';\n}\n" +
"var gotoLoginForContent=function(){\ntop.location.href='page-login.html';\nlocation.href='page-login.html';\n}\n" +
"var gotoIndex=function(){\ntop.location.href='index.html';\nlocation.href='index.html';\n}\n" +
"var gotoUrl=function(url){\nlocation.href=url;\n}\n" +
"\n" +
"var getLocalStorageItem = function (key) {\n" +
" var data = JCOMPRESS.getItem(sha256(key));\n" +
" if(data==undefined){\n" +
" return undefined;\n" +
" }\n" +
" var dataJson = JSON.parse(data);\n" +
" return dataJson.value;\n" +
"}\n" +
"\n" +
"var setLocalStorageItem = function (key, value) {\n" +
" if (value != null && value != undefined) {\n" +
" var data = {};\n" +
" data.value=value;\n" +
" JCOMPRESS.setItem(sha256(key), JSON.stringify(data));\n" +
" }\n" +
"}\n" +
"\n" +
"var setLocalStorageObject = function (key, value) {\n" +
" if (value != null && value != undefined) {\n" +
" var data = {};\n" +
" data.value=value;\n" +
" JCOMPRESS.setItem(sha256(key), JSON.stringify(data));\n" +
" }\n" +
"}\n" +
"\n" +
"var getLocalStorageObject = function (key) {\n" +
" var data = JCOMPRESS.getItem(sha256(key));\n" +
" if(data==undefined){\n" +
" return undefined;\n" +
" }\n" +
" var dataJson = JSON.parse(data);\n" +
" return dataJson.value;\n" +
"}\n" +
"\n" +
"var removeLocalStorageItem = function (key) {\n" +
" localStorage.removeItem(\"d_\"+sha256(key));\n" +
" localStorage.removeItem(sha256(key));\n" +
"}\n" +
"\n" +
"var base64Encode = function (str) {\n" +
" return btoa(encodeURIComponent(str));\n" +
"}\n" +
"\n" +
"var base64Decode = function (str) {\n" +
" if (str == null || str == undefined) {\n" +
" return undefined;\n" +
" }\n" +
" return decodeURIComponent(atob(str));\n" +
"}\n\n");
System.out.println("write to file success : " + file.getPath());
} catch (IOException e) {
e.printStackTrace();
} finally {
MybatisUtilCommon.closeBufferWriterAndFileOutputStream(fileOutputStream, bufferedWriter);
}
}
public static void writeJsCommonMd5Js(String htmlPath, String serverUrl) {
File file = null;
OutputStream fileOutputStream = null;
BufferedWriter bufferedWriter = null;
try {
File folder = new File(htmlPath + "/content/page-common/js");
folder.mkdirs();
file = new File(htmlPath + "/content/page-common/js/md5.js");
//如果文件不存在,则创建文件,如果已存在,则覆盖
file.createNewFile();
fileOutputStream = new FileOutputStream(file);
bufferedWriter = new BufferedWriter(new OutputStreamWriter(fileOutputStream, "utf-8"));
bufferedWriter.write("!function(a){\"use strict\";function b(a,b){var c=(65535&a)+(65535&b),d=(a>>16)+(b>>16)+(c>>16);return d<<16|65535&c}function c(a,b){return a<
>>32-b}function d(a,d,e,f,g,h){return b(c(b(b(d,a),b(f,h)),g),e)}function e(a,b,c,e,f,g,h){return d(b&c|~b&e,a,b,f,g,h)}function f(a,b,c,e,f,g,h){return d(b&e|c&~e,a,b,f,g,h)}function g(a,b,c,e,f,g,h){return d(b^c^e,a,b,f,g,h)}function h(a,b,c,e,f,g,h){return d(c^(b|~e),a,b,f,g,h)}function i(a,c){a[c>>5]|=128<>>9<<4)+14]=c;var d,i,j,k,l,m=1732584193,n=-271733879,o=-1732584194,p=271733878;for(d=0;d>5]>>>b%32&255);return c}function k(a){var b,c=[];for(c[(a.length>>2)-1]=void 0,b=0;b>5]|=(255&a.charCodeAt(b/8))<16&&(e=i(e,8*a.length)),c=0;16>c;c+=1)f[c]=909522486^e[c],g[c]=1549556828^e[c];return d=i(f.concat(k(b)),512+8*b.length),j(i(g.concat(d),640))}function n(a){var b,c,d=\"0123456789abcdef\",e=\"\";for(c=0;c>>4&15)+d.charAt(15&b);return e}function o(a){return unescape(encodeURIComponent(a))}function p(a){return l(o(a))}function q(a){return n(p(a))}function r(a,b){return m(o(a),o(b))}function s(a,b){return n(r(a,b))}function t(a,b,c){return b?c?r(b,a):s(b,a):c?p(a):q(a)}\"function\"==typeof define&&define.amd?define(function(){return t}):a.md5=t}(this);");
System.out.println("write to file success : " + file.getPath());
} catch (IOException e) {
e.printStackTrace();
} finally {
MybatisUtilCommon.closeBufferWriterAndFileOutputStream(fileOutputStream, bufferedWriter);
}
}
public static void writeJsCommonSha256Js(String htmlPath, String serverUrl) {
File file = null;
OutputStream fileOutputStream = null;
BufferedWriter bufferedWriter = null;
try {
File folder = new File(htmlPath + "/content/page-common/js");
folder.mkdirs();
file = new File(htmlPath + "/content/page-common/js/sha256.js");
//如果文件不存在,则创建文件,如果已存在,则覆盖
file.createNewFile();
fileOutputStream = new FileOutputStream(file);
bufferedWriter = new BufferedWriter(new OutputStreamWriter(fileOutputStream, "utf-8"));
bufferedWriter.write("function sha256(s){var chrsz=8;var hexcase=0;function safe_add(x,y){var lsw=(x&0xFFFF)+(y&0xFFFF);var msw=(x>>16)+(y>>16)+(lsw>>16);return(msw<<16)|(lsw&0xFFFF)}function S(X,n){return(X>>>n)|(X<<(32-n))}function R(X,n){return(X>>>n)}function Ch(x,y,z){return((x&y)^((~x)&z))}function Maj(x,y,z){return((x&y)^(x&z)^(y&z))}function Sigma0256(x){return(S(x,2)^S(x,13)^S(x,22))}function Sigma1256(x){return(S(x,6)^S(x,11)^S(x,25))}function Gamma0256(x){return(S(x,7)^S(x,18)^R(x,3))}function Gamma1256(x){return(S(x,17)^S(x,19)^R(x,10))}function core_sha256(m,l){var K=new Array(0x428A2F98,0x71374491,0xB5C0FBCF,0xE9B5DBA5,0x3956C25B,0x59F111F1,0x923F82A4,0xAB1C5ED5,0xD807AA98,0x12835B01,0x243185BE,0x550C7DC3,0x72BE5D74,0x80DEB1FE,0x9BDC06A7,0xC19BF174,0xE49B69C1,0xEFBE4786,0xFC19DC6,0x240CA1CC,0x2DE92C6F,0x4A7484AA,0x5CB0A9DC,0x76F988DA,0x983E5152,0xA831C66D,0xB00327C8,0xBF597FC7,0xC6E00BF3,0xD5A79147,0x6CA6351,0x14292967,0x27B70A85,0x2E1B2138,0x4D2C6DFC,0x53380D13,0x650A7354,0x766A0ABB,0x81C2C92E,0x92722C85,0xA2BFE8A1,0xA81A664B,0xC24B8B70,0xC76C51A3,0xD192E819,0xD6990624,0xF40E3585,0x106AA070,0x19A4C116,0x1E376C08,0x2748774C,0x34B0BCB5,0x391C0CB3,0x4ED8AA4A,0x5B9CCA4F,0x682E6FF3,0x748F82EE,0x78A5636F,0x84C87814,0x8CC70208,0x90BEFFFA,0xA4506CEB,0xBEF9A3F7,0xC67178F2);var HASH=new Array(0x6A09E667,0xBB67AE85,0x3C6EF372,0xA54FF53A,0x510E527F,0x9B05688C,0x1F83D9AB,0x5BE0CD19);var W=new Array(64);var a,b,c,d,e,f,g,h,i,j;var T1,T2;m[l>>5]|=0x80<<(24-l%32);m[((l+64>>9)<<4)+15]=l;for(var i=0;i>5]|=(str.charCodeAt(i/chrsz)&mask)<<(24-i%32)}return bin}function Utf8Encode(string){string=string.replace(/\\r\\n/g,\"\\n\");var utftext=\"\";for(var n=0;n127)&&(c<2048)){utftext+=String.fromCharCode((c>>6)|192);utftext+=String.fromCharCode((c&63)|128)}else{utftext+=String.fromCharCode((c>>12)|224);utftext+=String.fromCharCode(((c>>6)&63)|128);utftext+=String.fromCharCode((c&63)|128)}}return utftext}function binb2hex(binarray){var hex_tab=hexcase?\"0123456789ABCDEF\":\"0123456789abcdef\";var str=\"\";for(var i=0;i>2]>>((3-i%4)*8+4))&0xF)+hex_tab.charAt((binarray[i>>2]>>((3-i%4)*8))&0xF)}return str}s=Utf8Encode(s);return binb2hex(core_sha256(str2binb(s),s.length*chrsz))}");
System.out.println("write to file success : " + file.getPath());
} catch (IOException e) {
e.printStackTrace();
} finally {
MybatisUtilCommon.closeBufferWriterAndFileOutputStream(fileOutputStream, bufferedWriter);
}
}
public static void writeJsCommonJqueryJs(String htmlPath, String serverUrl) {
File file = null;
OutputStream fileOutputStream = null;
BufferedWriter bufferedWriter = null;
try {
File folder = new File(htmlPath + "/content/page-common/js");
folder.mkdirs();
file = new File(htmlPath + "/content/page-common/js/jquery.js");
//如果文件不存在,则创建文件,如果已存在,则覆盖
file.createNewFile();
fileOutputStream = new FileOutputStream(file);
bufferedWriter = new BufferedWriter(new OutputStreamWriter(fileOutputStream, "utf-8"));
bufferedWriter.write("window.jQuery||function(e,t){function n(e){var t=he[e]={};return K.each(e.split(te),function(e,n){t[n]=!0}),t}function r(e,n,r){if(r===t&&1===e.nodeType){var i=\"data-\"+n.replace(me,\"-$1\").toLowerCase();if(r=e.getAttribute(i),\"string\"==typeof r){try{r=\"true\"===r?!0:\"false\"===r?!1:\"null\"===r?null:+r+\"\"===r?+r:ge.test(r)?K.parseJSON(r):r}catch(o){}K.data(e,n,r)}else r=t}return r}function i(e){var t;for(t in e)if((\"data\"!==t||!K.isEmptyObject(e[t]))&&\"toJSON\"!==t)return!1;return!0}function o(){return!1}function a(){return!0}function s(e){return!e||!e.parentNode||11===e.parentNode.nodeType}function l(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function u(e,t,n){if(t=t||0,K.isFunction(t))return K.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return K.grep(e,function(e,r){return e===t===n});if(\"string\"==typeof t){var r=K.grep(e,function(e){return 1===e.nodeType});if(qe.test(t))return K.filter(t,r,!n);t=K.filter(t,r)}return K.grep(e,function(e,r){return K.inArray(e,t)>=0===n})}function c(e){var t=We.split(\"|\"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function f(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function p(e,t){if(1===t.nodeType&&K.hasData(e)){var n,r,i,o=K._data(e),a=K._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)K.event.add(t,n,s[n][r])}a.data&&(a.data=K.extend({},a.data))}}function d(e,t){var n;1===t.nodeType&&(t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),n=t.nodeName.toLowerCase(),\"object\"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),K.support.html5Clone&&e.innerHTML&&!K.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):\"input\"===n&&Ve.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):\"option\"===n?t.selected=e.defaultSelected:\"input\"===n||\"textarea\"===n?t.defaultValue=e.defaultValue:\"script\"===n&&t.text!==e.text&&(t.text=e.text),t.removeAttribute(K.expando))}function h(e){return\"undefined\"!=typeof e.getElementsByTagName?e.getElementsByTagName(\"*\"):\"undefined\"!=typeof e.querySelectorAll?e.querySelectorAll(\"*\"):[]}function g(e){Ve.test(e.type)&&(e.defaultChecked=e.checked)}function m(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=yt.length;i--;)if(t=yt[i]+n,t in e)return t;return r}function y(e,t){return e=t||e,\"none\"===K.css(e,\"display\")||!K.contains(e.ownerDocument,e)}function v(e,t){for(var n,r,i=[],o=0,a=e.length;a>o;o++)n=e[o],n.style&&(i[o]=K._data(n,\"olddisplay\"),t?(!i[o]&&\"none\"===n.style.display&&(n.style.display=\"\"),\"\"===n.style.display&&y(n)&&(i[o]=K._data(n,\"olddisplay\",T(n.nodeName)))):(r=nt(n,\"display\"),!i[o]&&\"none\"!==r&&K._data(n,\"olddisplay\",r)));for(o=0;a>o;o++)n=e[o],n.style&&(t&&\"none\"!==n.style.display&&\"\"!==n.style.display||(n.style.display=t?i[o]||\"\":\"none\"));return e}function b(e,t,n){var r=ct.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||\"px\"):t}function x(e,t,n,r){for(var i=n===(r?\"border\":\"content\")?4:\"width\"===t?1:0,o=0;4>i;i+=2)\"margin\"===n&&(o+=K.css(e,n+mt[i],!0)),r?(\"content\"===n&&(o-=parseFloat(nt(e,\"padding\"+mt[i]))||0),\"margin\"!==n&&(o-=parseFloat(nt(e,\"border\"+mt[i]+\"Width\"))||0)):(o+=parseFloat(nt(e,\"padding\"+mt[i]))||0,\"padding\"!==n&&(o+=parseFloat(nt(e,\"border\"+mt[i]+\"Width\"))||0));return o}function w(e,t,n){var r=\"width\"===t?e.offsetWidth:e.offsetHeight,i=!0,o=K.support.boxSizing&&\"border-box\"===K.css(e,\"boxSizing\");if(0>=r||null==r){if(r=nt(e,t),(0>r||null==r)&&(r=e.style[t]),ft.test(r))return r;i=o&&(K.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+x(e,t,n||(o?\"border\":\"content\"),i)+\"px\"}function T(e){if(dt[e])return dt[e];var t=K(\"<\"+e+\">\").appendTo(R.body),n=t.css(\"display\");return t.remove(),(\"none\"===n||\"\"===n)&&(rt=R.body.appendChild(rt||K.extend(R.createElement(\"iframe\"),{frameBorder:0,width:0,height:0})),it&&rt.createElement||(it=(rt.contentWindow||rt.contentDocument).document,it.write(\"\"),it.close()),t=it.body.appendChild(it.createElement(e)),n=nt(t,\"display\"),R.body.removeChild(rt)),dt[e]=n,n}function N(e,t,n,r){var i;if(K.isArray(t))K.each(t,function(t,i){n||xt.test(e)?r(e,i):N(e+\"[\"+(\"object\"==typeof i?t:\"\")+\"]\",i,n,r)});else if(n||\"object\"!==K.type(t))r(e,t);else for(i in t)N(e+\"[\"+i+\"]\",t[i],n,r)}function C(e){return function(t,n){\"string\"!=typeof t&&(n=t,t=\"*\");var r,i,o,a=t.toLowerCase().split(te),s=0,l=a.length;if(K.isFunction(n))for(;l>s;s++)r=a[s],o=/^\\+/.test(r),o&&(r=r.substr(1)||\"*\"),i=e[r]=e[r]||[],i[o?\"unshift\":\"push\"](n)}}function k(e,n,r,i,o,a){o=o||n.dataTypes[0],a=a||{},a[o]=!0;for(var s,l=e[o],u=0,c=l?l.length:0,f=e===qt;c>u&&(f||!s);u++)s=l[u](n,r,i),\"string\"==typeof s&&(!f||a[s]?s=t:(n.dataTypes.unshift(s),s=k(e,n,r,i,s,a)));return(f||!s)&&!a[\"*\"]&&(s=k(e,n,r,i,\"*\",a)),s}function E(e,n){var r,i,o=K.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((o[r]?e:i||(i={}))[r]=n[r]);i&&K.extend(!0,e,i)}function S(e,n,r){var i,o,a,s,l=e.contents,u=e.dataTypes,c=e.responseFields;for(o in c)o in r&&(n[c[o]]=r[o]);for(;\"*\"===u[0];)u.shift(),i===t&&(i=e.mimeType||n.getResponseHeader(\"content-type\"));if(i)for(o in l)if(l[o]&&l[o].test(i)){u.unshift(o);break}if(u[0]in r)a=u[0];else{for(o in r){if(!u[0]||e.converters[o+\" \"+u[0]]){a=o;break}s||(s=o)}a=a||s}return a?(a!==u[0]&&u.unshift(a),r[a]):void 0}function j(e,t){var n,r,i,o,a=e.dataTypes.slice(),s=a[0],l={},u=0;if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),a[1])for(n in e.converters)l[n.toLowerCase()]=e.converters[n];for(;i=a[++u];)if(\"*\"!==i){if(\"*\"!==s&&s!==i){if(n=l[s+\" \"+i]||l[\"* \"+i],!n)for(r in l)if(o=r.split(\" \"),o[1]===i&&(n=l[s+\" \"+o[0]]||l[\"* \"+o[0]])){n===!0?n=l[r]:l[r]!==!0&&(i=o[0],a.splice(u--,0,i));break}if(n!==!0)if(n&&e[\"throws\"])t=n(t);else try{t=n(t)}catch(c){return{state:\"parsererror\",error:n?c:\"No conversion from \"+s+\" to \"+i}}}s=i}return{state:\"success\",data:t}}function A(){try{return new e.XMLHttpRequest}catch(t){}}function L(){try{return new e.ActiveXObject(\"Microsoft.XMLHTTP\")}catch(t){}}function D(){return setTimeout(function(){Qt=t},0),Qt=K.now()}function H(e,t){K.each(t,function(t,n){for(var r=(Zt[t]||[]).concat(Zt[\"*\"]),i=0,o=r.length;o>i;i++)if(r[i].call(e,t,n))return})}function F(e,t,n){var r,i=0,o=Kt.length,a=K.Deferred().always(function(){delete s.elem}),s=function(){for(var t=Qt||D(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,i=1-r,o=0,s=l.tweens.length;s>o;o++)l.tweens[o].run(i);return a.notifyWith(e,[l,i,n]),1>i&&s?n:(a.resolveWith(e,[l]),!1)},l=a.promise({elem:e,props:K.extend({},t),opts:K.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Qt||D(),duration:n.duration,tweens:[],createTween:function(t,n,r){var i=K.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(i),i},stop:function(t){for(var n=0,r=t?l.tweens.length:0;r>n;n++)l.tweens[n].run(1);return t?a.resolveWith(e,[l,t]):a.rejectWith(e,[l,t]),this}}),u=l.props;for(M(u,l.opts.specialEasing);o>i;i++)if(r=Kt[i].call(l,e,u,l.opts))return r;return H(l,u),K.isFunction(l.opts.start)&&l.opts.start.call(e,l),K.fx.timer(K.extend(s,{anim:l,queue:l.opts.queue,elem:e})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function M(e,t){var n,r,i,o,a;for(n in e)if(r=K.camelCase(n),i=t[r],o=e[n],K.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=K.cssHooks[r],a&&\"expand\"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}function O(e,t,n){var r,i,o,a,s,l,u,c,f,p=this,d=e.style,h={},g=[],m=e.nodeType&&y(e);n.queue||(c=K._queueHooks(e,\"fx\"),null==c.unqueued&&(c.unqueued=0,f=c.empty.fire,c.empty.fire=function(){c.unqueued||f()}),c.unqueued++,p.always(function(){p.always(function(){c.unqueued--,K.queue(e,\"fx\").length||c.empty.fire()})})),1===e.nodeType&&(\"height\"in t||\"width\"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],\"inline\"===K.css(e,\"display\")&&\"none\"===K.css(e,\"float\")&&(K.support.inlineBlockNeedsLayout&&\"inline\"!==T(e.nodeName)?d.zoom=1:d.display=\"inline-block\")),n.overflow&&(d.overflow=\"hidden\",K.support.shrinkWrapBlocks||p.done(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(r in t)if(o=t[r],Vt.exec(o)){if(delete t[r],l=l||\"toggle\"===o,o===(m?\"hide\":\"show\"))continue;g.push(r)}if(a=g.length){s=K._data(e,\"fxshow\")||K._data(e,\"fxshow\",{}),\"hidden\"in s&&(m=s.hidden),l&&(s.hidden=!m),m?K(e).show():p.done(function(){K(e).hide()}),p.done(function(){var t;K.removeData(e,\"fxshow\",!0);for(t in h)K.style(e,t,h[t])});for(r=0;a>r;r++)i=g[r],u=p.createTween(i,m?s[i]:0),h[i]=s[i]||K.style(e,i),i in s||(s[i]=u.start,m&&(u.end=u.start,u.start=\"width\"===i||\"height\"===i?1:0))}}function q(e,t,n,r,i){return new q.prototype.init(e,t,n,r,i)}function _(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=mt[i],r[\"margin\"+n]=r[\"padding\"+n]=e;return t&&(r.opacity=r.width=e),r}function B(e){return K.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}var W,P,R=e.document,$=e.location,I=e.navigator,z=e.jQuery,X=e.$,U=Array.prototype.push,Q=Array.prototype.slice,Y=Array.prototype.indexOf,V=Object.prototype.toString,J=Object.prototype.hasOwnProperty,G=String.prototype.trim,K=function(e,t){return new K.fn.init(e,t,W)},Z=/[\\-+]?(?:\\d*\\.|)\\d+(?:[eE][\\-+]?\\d+|)/.source,ee=/\\S/,te=/\\s+/,ne=/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g,re=/^(?:[^#<]*(<[\\w\\W]+>)[^>]*$|#([\\w\\-]*)$)/,ie=/^<(\\w+)\\s*\\/?>(?:<\\/\\1>|)$/,oe=/^[\\],:{}\\s]*$/,ae=/(?:^|:|,)(?:\\s*\\[)+/g,se=/\\\\(?:[\"\\\\\\/bfnrt]|u[\\da-fA-F]{4})/g,le=/\"[^\"\\\\\\r\\n]*\"|true|false|null|-?(?:\\d\\d*\\.|)\\d+(?:[eE][\\-+]?\\d+|)/g,ue=/^-ms-/,ce=/-([\\da-z])/gi,fe=function(e,t){return(t+\"\").toUpperCase()},pe=function(){R.addEventListener?(R.removeEventListener(\"DOMContentLoaded\",pe,!1),K.ready()):\"complete\"===R.readyState&&(R.detachEvent(\"onreadystatechange\",pe),K.ready())},de={};K.fn=K.prototype={constructor:K,init:function(e,n,r){var i,o,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(\"string\"==typeof e){if(i=\"<\"===e.charAt(0)&&\">\"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:re.exec(e),i&&(i[1]||!n)){if(i[1])return n=n instanceof K?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:R,e=K.parseHTML(i[1],a,!0),ie.test(i[1])&&K.isPlainObject(n)&&this.attr.call(e,n,!0),K.merge(this,e);if(o=R.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=R,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return K.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),K.makeArray(e,this))},selector:\"\",jquery:\"1.8.3\",length:0,size:function(){return this.length},toArray:function(){return Q.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=K.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,\"find\"===t?r.selector=this.selector+(this.selector?\" \":\"\")+n:t&&(r.selector=this.selector+\".\"+t+\"(\"+n+\")\"),r},each:function(e,t){return K.each(this,e,t)},ready:function(e){return K.ready.promise().done(e),this},eq:function(e){return e=+e,-1===e?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(Q.apply(this,arguments),\"slice\",Q.call(arguments).join(\",\"))},map:function(e){return this.pushStack(K.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:U,sort:[].sort,splice:[].splice},K.fn.init.prototype=K.fn,K.extend=K.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for(\"boolean\"==typeof s&&(c=s,s=arguments[1]||{},l=2),\"object\"!=typeof s&&!K.isFunction(s)&&(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(e=arguments[l]))for(n in e)r=s[n],i=e[n],s!==i&&(c&&i&&(K.isPlainObject(i)||(o=K.isArray(i)))?(o?(o=!1,a=r&&K.isArray(r)?r:[]):a=r&&K.isPlainObject(r)?r:{},s[n]=K.extend(c,a,i)):i!==t&&(s[n]=i));return s},K.extend({noConflict:function(t){return e.$===K&&(e.$=X),t&&e.jQuery===K&&(e.jQuery=z),K},isReady:!1,readyWait:1,holdReady:function(e){e?K.readyWait++:K.ready(!0)},ready:function(e){if(e===!0?!--K.readyWait:!K.isReady){if(!R.body)return setTimeout(K.ready,1);K.isReady=!0,e!==!0&&--K.readyWait>0||(P.resolveWith(R,[K]),K.fn.trigger&&K(R).trigger(\"ready\").off(\"ready\"))}},isFunction:function(e){return\"function\"===K.type(e)},isArray:Array.isArray||function(e){return\"array\"===K.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?String(e):de[V.call(e)]||\"object\"},isPlainObject:function(e){if(!e||\"object\"!==K.type(e)||e.nodeType||K.isWindow(e))return!1;try{if(e.constructor&&!J.call(e,\"constructor\")&&!J.call(e.constructor.prototype,\"isPrototypeOf\"))return!1}catch(n){return!1}var r;for(r in e);return r===t||J.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return e&&\"string\"==typeof e?(\"boolean\"==typeof t&&(n=t,t=0),t=t||R,(r=ie.exec(e))?[t.createElement(r[1])]:(r=K.buildFragment([e],t,n?null:[]),K.merge([],(r.cacheable?K.clone(r.fragment):r.fragment).childNodes))):null},parseJSON:function(t){return t&&\"string\"==typeof t?(t=K.trim(t),e.JSON&&e.JSON.parse?e.JSON.parse(t):oe.test(t.replace(se,\"@\").replace(le,\"]\").replace(ae,\"\"))?new Function(\"return \"+t)():void K.error(\"Invalid JSON: \"+t)):null},parseXML:function(n){var r,i;if(!n||\"string\"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,\"text/xml\")):(r=new ActiveXObject(\"Microsoft.XMLDOM\"),r.async=\"false\",r.loadXML(n))}catch(o){r=t}return(!r||!r.documentElement||r.getElementsByTagName(\"parsererror\").length)&&K.error(\"Invalid XML: \"+n),r},noop:function(){},globalEval:function(t){t&&ee.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(ue,\"ms-\").replace(ce,fe)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,o=0,a=e.length,s=a===t||K.isFunction(e);if(r)if(s){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;a>o&&n.apply(e[o++],r)!==!1;);else if(s){for(i in e)if(n.call(e[i],i,e[i])===!1)break}else for(;a>o&&n.call(e[o],o,e[o++])!==!1;);return e},trim:G&&!G.call(\"\\ufeff\\xa0\")?function(e){return null==e?\"\":G.call(e)}:function(e){return null==e?\"\":(e+\"\").replace(ne,\"\")},makeArray:function(e,t){var n,r=t||[];return null!=e&&(n=K.type(e),null==e.length||\"string\"===n||\"function\"===n||\"regexp\"===n||K.isWindow(e)?U.call(r,e):K.merge(r,e)),r},inArray:function(e,t,n){var r;if(t){if(Y)return Y.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if(\"number\"==typeof r)for(;r>o;o++)e[i++]=n[o];else for(;n[o]!==t;)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,n,r){var i,o,a=[],s=0,l=e.length,u=e instanceof K||l!==t&&\"number\"==typeof l&&(l>0&&e[0]&&e[l-1]||0===l||K.isArray(e));if(u)for(;l>s;s++)i=n(e[s],s,r),null!=i&&(a[a.length]=i);else for(o in e)i=n(e[o],o,r),null!=i&&(a[a.length]=i);return a.concat.apply([],a)},guid:1,proxy:function(e,n){var r,i,o;return\"string\"==typeof n&&(r=e[n],n=e,e=r),K.isFunction(e)?(i=Q.call(arguments,2),o=function(){return e.apply(n,i.concat(Q.call(arguments)))},o.guid=e.guid=e.guid||K.guid++,o):t},access:function(e,n,r,i,o,a,s){var l,u=null==r,c=0,f=e.length;if(r&&\"object\"==typeof r){for(c in r)K.access(e,n,c,r[c],1,a,i);o=1}else if(i!==t){if(l=s===t&&K.isFunction(i),u&&(l?(l=n,n=function(e,t,n){return l.call(K(e),n)}):(n.call(e,i),n=null)),n)for(;f>c;c++)n(e[c],r,l?i.call(e[c],c,n(e[c],r)):i,s);o=1}return o?e:u?n.call(e):f?n(e[0],r):a},now:function(){return(new Date).getTime()}}),K.ready.promise=function(t){if(!P)if(P=K.Deferred(),\"complete\"===R.readyState)setTimeout(K.ready,1);else if(R.addEventListener)R.addEventListener(\"DOMContentLoaded\",pe,!1),e.addEventListener(\"load\",K.ready,!1);else{R.attachEvent(\"onreadystatechange\",pe),e.attachEvent(\"onload\",K.ready);var n=!1;try{n=null==e.frameElement&&R.documentElement}catch(r){}n&&n.doScroll&&function i(){if(!K.isReady){try{n.doScroll(\"left\")}catch(e){return setTimeout(i,50)}K.ready()}}()}return P.promise(t)},K.each(\"Boolean Number String Function Array Date RegExp Object\".split(\" \"),function(e,t){de[\"[object \"+t+\"]\"]=t.toLowerCase()}),W=K(R);var he={};K.Callbacks=function(e){e=\"string\"==typeof e?he[e]||n(e):K.extend({},e);var r,i,o,a,s,l,u=[],c=!e.once&&[],f=function(t){for(r=e.memory&&t,i=!0,l=a||0,a=0,s=u.length,o=!0;u&&s>l;l++)if(u[l].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}o=!1,u&&(c?c.length&&f(c.shift()):r?u=[]:p.disable())},p={add:function(){if(u){var t=u.length;!function n(t){K.each(t,function(t,r){var i=K.type(r);\"function\"===i?(!e.unique||!p.has(r))&&u.push(r):r&&r.length&&\"string\"!==i&&n(r)})}(arguments),o?s=u.length:r&&(a=t,f(r))}return this},remove:function(){return u&&K.each(arguments,function(e,t){for(var n;(n=K.inArray(t,u,n))>-1;)u.splice(n,1),o&&(s>=n&&s--,l>=n&&l--)}),this},has:function(e){return K.inArray(e,u)>-1},empty:function(){return u=[],this},disable:function(){return u=c=r=t,this},disabled:function(){return!u},lock:function(){return c=t,r||p.disable(),this},locked:function(){return!c},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],u&&(!i||c)&&(o?c.push(t):f(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},K.extend({Deferred:function(e){var t=[[\"resolve\",\"done\",K.Callbacks(\"once memory\"),\"resolved\"],[\"reject\",\"fail\",K.Callbacks(\"once memory\"),\"rejected\"],[\"notify\",\"progress\",K.Callbacks(\"memory\")]],n=\"pending\",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return K.Deferred(function(n){K.each(t,function(t,r){var o=r[0],a=e[t];i[r[1]](K.isFunction(a)?function(){var e=a.apply(this,arguments);e&&K.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o+\"With\"](this===i?n:this,[e])}:n[o])}),e=null}).promise()},promise:function(e){return null!=e?K.extend(e,r):r}},i={};return r.pipe=r.then,K.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=a.fire,i[o[0]+\"With\"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,i=0,o=Q.call(arguments),a=o.length,s=1!==a||e&&K.isFunction(e.promise)?a:0,l=1===s?e:K.Deferred(),u=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?Q.call(arguments):i,r===t?l.notifyWith(n,r):--s||l.resolveWith(n,r)}};if(a>1)for(t=new Array(a),n=new Array(a),r=new Array(a);a>i;i++)o[i]&&K.isFunction(o[i].promise)?o[i].promise().done(u(i,r,o)).fail(l.reject).progress(u(i,n,t)):--s;return s||l.resolveWith(r,o),l.promise()}}),K.support=function(){var t,n,r,i,o,a,s,l,u,c,f,p=R.createElement(\"div\");if(p.setAttribute(\"className\",\"t\"),p.innerHTML=\" a \",n=p.getElementsByTagName(\"*\"),r=p.getElementsByTagName(\"a\")[0],!n||!r||!n.length)return{};i=R.createElement(\"select\"),o=i.appendChild(R.createElement(\"option\")),a=p.getElementsByTagName(\"input\")[0],r.style.cssText=\"top:1px;float:left;opacity:.5\",t={leadingWhitespace:3===p.firstChild.nodeType,tbody:!p.getElementsByTagName(\"tbody\").length,htmlSerialize:!!p.getElementsByTagName(\"link\").length,style:/top/.test(r.getAttribute(\"style\")),hrefNormalized:\"/a\"===r.getAttribute(\"href\"),opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:\"on\"===a.value,optSelected:o.selected,getSetAttribute:\"t\"!==p.className,enctype:!!R.createElement(\"form\").enctype,html5Clone:\"<:nav>\"!==R.createElement(\"nav\").cloneNode(!0).outerHTML,boxModel:\"CSS1Compat\"===R.compatMode,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,i.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}if(!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent(\"onclick\",f=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent(\"onclick\"),p.detachEvent(\"onclick\",f)),a=R.createElement(\"input\"),a.value=\"t\",a.setAttribute(\"type\",\"radio\"),t.radioValue=\"t\"===a.value,a.setAttribute(\"checked\",\"checked\"),a.setAttribute(\"name\",\"t\"),p.appendChild(a),s=R.createDocumentFragment(),s.appendChild(p.lastChild),t.checkClone=s.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=a.checked,s.removeChild(a),s.appendChild(p),p.attachEvent)for(u in{submit:!0,change:!0,focusin:!0})l=\"on\"+u,c=l in p,c||(p.setAttribute(l,\"return;\"),c=\"function\"==typeof p[l]),t[u+\"Bubbles\"]=c;return K(function(){var n,r,i,o,a=\"padding:0;margin:0;border:0;display:block;overflow:hidden;\",s=R.getElementsByTagName(\"body\")[0];s&&(n=R.createElement(\"div\"),n.style.cssText=\"visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px\",s.insertBefore(n,s.firstChild),r=R.createElement(\"div\"),n.appendChild(r),r.innerHTML=\"\",i=r.getElementsByTagName(\"td\"),i[0].style.cssText=\"padding:0;margin:0;border:0;display:none\",c=0===i[0].offsetHeight,i[0].style.display=\"\",i[1].style.display=\"none\",t.reliableHiddenOffsets=c&&0===i[0].offsetHeight,r.innerHTML=\"\",r.style.cssText=\"box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;\",t.boxSizing=4===r.offsetWidth,t.doesNotIncludeMarginInBodyOffset=1!==s.offsetTop,e.getComputedStyle&&(t.pixelPosition=\"1%\"!==(e.getComputedStyle(r,null)||{}).top,t.boxSizingReliable=\"4px\"===(e.getComputedStyle(r,null)||{width:\"4px\"}).width,o=R.createElement(\"div\"),o.style.cssText=r.style.cssText=a,o.style.marginRight=o.style.width=\"0\",r.style.width=\"1px\",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),\"undefined\"!=typeof r.style.zoom&&(r.innerHTML=\"\",r.style.cssText=a+\"width:1px;padding:1px;display:inline;zoom:1\",t.inlineBlockNeedsLayout=3===r.offsetWidth,r.style.display=\"block\",r.style.overflow=\"visible\",r.innerHTML=\"
\",r.firstChild.style.width=\"5px\",t.shrinkWrapBlocks=3!==r.offsetWidth,n.style.zoom=1),s.removeChild(n),n=r=i=o=null)}),s.removeChild(p),n=r=i=o=a=s=p=null,t}();var ge=/(?:\\{[\\s\\S]*\\}|\\[[\\s\\S]*\\])$/,me=/([A-Z])/g;K.extend({cache:{},deletedIds:[],uuid:0,expando:\"jQuery\"+(K.fn.jquery+Math.random()).replace(/\\D/g,\"\"),noData:{embed:!0,object:\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\",applet:!0},hasData:function(e){return e=e.nodeType?K.cache[e[K.expando]]:e[K.expando],!!e&&!i(e)},data:function(e,n,r,i){if(K.acceptData(e)){var o,a,s=K.expando,l=\"string\"==typeof n,u=e.nodeType,c=u?K.cache:e,f=u?e[s]:e[s]&&s;if(f&&c[f]&&(i||c[f].data)||!l||r!==t)return f||(u?e[s]=f=K.deletedIds.pop()||K.guid++:f=s),c[f]||(c[f]={},u||(c[f].toJSON=K.noop)),(\"object\"==typeof n||\"function\"==typeof n)&&(i?c[f]=K.extend(c[f],n):c[f].data=K.extend(c[f].data,n)),o=c[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[K.camelCase(n)]=r),l?(a=o[n],null==a&&(a=o[K.camelCase(n)])):a=o,a}},removeData:function(e,t,n){if(K.acceptData(e)){var r,o,a,s=e.nodeType,l=s?K.cache:e,u=s?e[K.expando]:K.expando;if(l[u]){if(t&&(r=n?l[u]:l[u].data)){K.isArray(t)||(t in r?t=[t]:(t=K.camelCase(t),t=t in r?[t]:t.split(\" \")));for(o=0,a=t.length;a>o;o++)delete r[t[o]];if(!(n?i:K.isEmptyObject)(r))return}(n||(delete l[u].data,i(l[u])))&&(s?K.cleanData([e],!0):K.support.deleteExpando||l!=l.window?delete l[u]:l[u]=null)}}},_data:function(e,t,n){return K.data(e,t,n,!0)},acceptData:function(e){var t=e.nodeName&&K.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute(\"classid\")===t}}),K.fn.extend({data:function(e,n){var i,o,a,s,l,u=this[0],c=0,f=null;if(e===t){if(this.length&&(f=K.data(u),1===u.nodeType&&!K._data(u,\"parsedAttrs\"))){for(a=u.attributes,l=a.length;l>c;c++)s=a[c].name,s.indexOf(\"data-\")||(s=K.camelCase(s.substring(5)),r(u,s,f[s]));K._data(u,\"parsedAttrs\",!0)}return f}return\"object\"==typeof e?this.each(function(){K.data(this,e)}):(i=e.split(\".\",2),i[1]=i[1]?\".\"+i[1]:\"\",o=i[1]+\"!\",K.access(this,function(n){return n===t?(f=this.triggerHandler(\"getData\"+o,[i[0]]),f===t&&u&&(f=K.data(u,e),f=r(u,e,f)),f===t&&i[1]?this.data(i[0]):f):(i[1]=n,void this.each(function(){var t=K(this);t.triggerHandler(\"setData\"+o,i),K.data(this,e,n),t.triggerHandler(\"changeData\"+o,i)}))},null,n,arguments.length>1,null,!1))},removeData:function(e){return this.each(function(){K.removeData(this,e)})}}),K.extend({queue:function(e,t,n){var r;return e?(t=(t||\"fx\")+\"queue\",r=K._data(e,t),n&&(!r||K.isArray(n)?r=K._data(e,t,K.makeArray(n)):r.push(n)),r||[]):void 0},dequeue:function(e,t){t=t||\"fx\";var n=K.queue(e,t),r=n.length,i=n.shift(),o=K._queueHooks(e,t),a=function(){K.dequeue(e,t)};\"inprogress\"===i&&(i=n.shift(),r--),i&&(\"fx\"===t&&n.unshift(\"inprogress\"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+\"queueHooks\";return K._data(e,n)||K._data(e,n,{empty:K.Callbacks(\"once memory\").add(function(){K.removeData(e,t+\"queue\",!0),K.removeData(e,n,!0)})})}}),K.fn.extend({queue:function(e,n){var r=2;return\"string\"!=typeof e&&(n=e,e=\"fx\",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){K.removeAttr(this,e)})},prop:function(e,t){return K.access(this,K.prop,e,t,arguments.length>1)},removeProp:function(e){return e=K.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a,s;if(K.isFunction(e))return this.each(function(t){K(this).addClass(e.call(this,t,this.className))});if(e&&\"string\"==typeof e)for(t=e.split(te),n=0,r=this.length;r>n;n++)if(i=this[n],1===i.nodeType)if(i.className||1!==t.length){for(o=\" \"+i.className+\" \",a=0,s=t.length;s>a;a++)o.indexOf(\" \"+t[a]+\" \")<0&&(o+=t[a]+\" \");i.className=K.trim(o)}else i.className=e;return this},removeClass:function(e){var n,r,i,o,a,s,l;if(K.isFunction(e))return this.each(function(t){K(this).removeClass(e.call(this,t,this.className))});if(e&&\"string\"==typeof e||e===t)for(n=(e||\"\").split(te),s=0,l=this.length;l>s;s++)if(i=this[s],1===i.nodeType&&i.className){for(r=(\" \"+i.className+\" \").replace(xe,\" \"),o=0,a=n.length;a>o;o++)for(;r.indexOf(\" \"+n[o]+\" \")>=0;)r=r.replace(\" \"+n[o]+\" \",\" \");i.className=e?K.trim(r):\"\"}return this},toggleClass:function(e,t){var n=typeof e,r=\"boolean\"==typeof t;return this.each(K.isFunction(e)?function(n){K(this).toggleClass(e.call(this,n,this.className,t),t)}:function(){if(\"string\"===n)for(var i,o=0,a=K(this),s=t,l=e.split(te);i=l[o++];)s=r?s:!a.hasClass(i),a[s?\"addClass\":\"removeClass\"](i);else(\"undefined\"===n||\"boolean\"===n)&&(this.className&&K._data(this,\"__className__\",this.className),this.className=this.className||e===!1?\"\":K._data(this,\"__className__\")||\"\")})},hasClass:function(e){for(var t=\" \"+e+\" \",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(\" \"+this[n].className+\" \").replace(xe,\" \").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=K.isFunction(e),this.each(function(r){var o,a=K(this);1===this.nodeType&&(o=i?e.call(this,r,a.val()):e,null==o?o=\"\":\"number\"==typeof o?o+=\"\":K.isArray(o)&&(o=K.map(o,function(e){return null==e?\"\":e+\"\"})),n=K.valHooks[this.type]||K.valHooks[this.nodeName.toLowerCase()],n&&\"set\"in n&&n.set(this,o,\"value\")!==t||(this.value=o))});if(o)return n=K.valHooks[o.type]||K.valHooks[o.nodeName.toLowerCase()],n&&\"get\"in n&&(r=n.get(o,\"value\"))!==t?r:(r=o.value,\"string\"==typeof r?r.replace(we,\"\"):null==r?\"\":r)}}}),K.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o=\"select-one\"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(K.support.optDisabled?n.disabled:null!==n.getAttribute(\"disabled\"))||n.parentNode.disabled&&K.nodeName(n.parentNode,\"optgroup\"))){if(t=K(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=K.makeArray(t);return K(e).find(\"option\").each(function(){this.selected=K.inArray(K(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var o,a,s,l=e.nodeType;if(e&&3!==l&&8!==l&&2!==l)return i&&K.isFunction(K.fn[n])?K(e)[n](r):\"undefined\"==typeof e.getAttribute?K.prop(e,n,r):(s=1!==l||!K.isXMLDoc(e),s&&(n=n.toLowerCase(),a=K.attrHooks[n]||(ke.test(n)?ve:ye)),r!==t?null===r?void K.removeAttr(e,n):a&&\"set\"in a&&s&&(o=a.set(e,r,n))!==t?o:(e.setAttribute(n,r+\"\"),r):a&&\"get\"in a&&s&&null!==(o=a.get(e,n))?o:(o=e.getAttribute(n),null===o?t:o))},removeAttr:function(e,t){var n,r,i,o,a=0;if(t&&1===e.nodeType)for(r=t.split(te);a=0:void 0}})});var Se=/^(?:textarea|input|select)$/i,je=/^([^\\.]*|)(?:\\.(.+)|)$/,Ae=/(?:^|\\s)hover(\\.\\S+|)\\b/,Le=/^key/,De=/^(?:mouse|contextmenu)|click/,He=/^(?:focusinfocus|focusoutblur)$/,Fe=function(e){return K.event.special.hover?e:e.replace(Ae,\"mouseenter$1 mouseleave$1\")};K.event={add:function(e,n,r,i,o){var a,s,l,u,c,f,p,d,h,g,m;if(3!==e.nodeType&&8!==e.nodeType&&n&&r&&(a=K._data(e))){for(r.handler&&(h=r,r=h.handler,o=h.selector),r.guid||(r.guid=K.guid++),l=a.events,l||(a.events=l={}),s=a.handle,s||(a.handle=s=function(e){return\"undefined\"==typeof K||e&&K.event.triggered===e.type?t:K.event.dispatch.apply(s.elem,arguments)},s.elem=e),n=K.trim(Fe(n)).split(\" \"),u=0;u=0&&(m=m.slice(0,-1),s=!0),m.indexOf(\".\")>=0&&(y=m.split(\".\"),m=y.shift(),y.sort()),(!i||K.event.customEvent[m])&&!K.event.global[m])return;if(n=\"object\"==typeof n?n[K.expando]?n:new K.Event(m,n):new K.Event(m),n.type=m,n.isTrigger=!0,n.exclusive=s,n.namespace=y.join(\".\"),n.namespace_re=n.namespace?new RegExp(\"(^|\\\\.)\"+y.join(\"\\\\.(?:.*\\\\.|)\")+\"(\\\\.|$)\"):null,f=m.indexOf(\":\")<0?\"on\"+m:\"\",!i){a=K.cache;for(l in a)a[l].events&&a[l].events[m]&&K.event.trigger(n,r,a[l].handle.elem,!0);return}if(n.result=t,n.target||(n.target=i),r=null!=r?K.makeArray(r):[],r.unshift(n),p=K.event.special[m]||{},p.trigger&&p.trigger.apply(i,r)===!1)return;if(h=[[i,p.bindType||m]],!o&&!p.noBubble&&!K.isWindow(i)){for(g=p.delegateType||m,u=He.test(g+m)?i:i.parentNode,c=i;u;u=u.parentNode)h.push([u,g]),c=u;c===(i.ownerDocument||R)&&h.push([c.defaultView||c.parentWindow||e,g])}for(l=0;lr;r++)c=p[r],f=c.selector,s[f]===t&&(s[f]=c.needsContext?K(f,this).index(o)>=0:K.find(f,this,null,[o]).length),s[f]&&u.push(c);u.length&&y.push({elem:o,matches:u})}for(p.length>d&&y.push({elem:this,matches:p.slice(d)}),r=0;r0?this.on(t,null,e,n):this.trigger(t)},Le.test(t)&&(K.event.fixHooks[t]=K.event.keyHooks),De.test(t)&&(K.event.fixHooks[t]=K.event.mouseHooks)}),function(e,t){function n(e,t,n,r){n=n||[],t=t||D;var i,o,a,s,l=t.nodeType;if(!e||\"string\"!=typeof e)return n;if(1!==l&&9!==l)return[];if(a=w(t),!a&&!r&&(i=ne.exec(e)))if(s=i[1]){if(9===l){if(o=t.getElementById(s),!o||!o.parentNode)return n;if(o.id===s)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(s))&&T(t,o)&&o.id===s)return n.push(o),n}else{if(i[2])return q.apply(n,_.call(t.getElementsByTagName(e),0)),n;if((s=i[3])&&pe&&t.getElementsByClassName)return q.apply(n,_.call(t.getElementsByClassName(s),0)),n}return g(e.replace(G,\"$1\"),t,n,r,a)}function r(e){return function(t){var n=t.nodeName.toLowerCase();return\"input\"===n&&t.type===e}}function i(e){return function(t){var n=t.nodeName.toLowerCase();return(\"input\"===n||\"button\"===n)&&t.type===e}}function o(e){return W(function(t){return t=+t,W(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function a(e,t,n){if(e===t)return n;for(var r=e.nextSibling;r;){if(r===t)return-1;r=r.nextSibling}return 1}function s(e,t){var r,i,o,a,s,l,u,c=$[A][e+\" \"];if(c)return t?0:c.slice(0);for(s=e,l=[],u=b.preFilter;s;){(!r||(i=Z.exec(s)))&&(i&&(s=s.slice(i[0].length)||s),l.push(o=[])),r=!1,(i=ee.exec(s))&&(o.push(r=new L(i.shift())),s=s.slice(r.length),r.type=i[0].replace(G,\" \"));for(a in b.filter)(i=se[a].exec(s))&&(!u[a]||(i=u[a](i)))&&(o.push(r=new L(i.shift())),s=s.slice(r.length),r.type=a,r.matches=i);if(!r)break}return t?s.length:s?n.error(e):$(e,l).slice(0)}function l(e,t,n){var r=t.dir,i=n&&\"parentNode\"===t.dir,o=M++;return t.first?function(t,n,o){for(;t=t[r];)if(i||1===t.nodeType)return e(t,n,o)}:function(t,n,a){if(a){for(;t=t[r];)if((i||1===t.nodeType)&&e(t,n,a))return t}else for(var s,l=F+\" \"+o+\" \",u=l+y;t=t[r];)if(i||1===t.nodeType){if((s=t[A])===u)return t.sizset;if(\"string\"==typeof s&&0===s.indexOf(l)){if(t.sizset)return t}else{if(t[A]=u,e(t,n,a))return t.sizset=!0,t;t.sizset=!1}}}}function u(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function c(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,u=null!=t;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function f(e,t,n,r,i,o){return r&&!r[A]&&(r=f(r)),i&&!i[A]&&(i=f(i,o)),W(function(o,a,s,l){var u,f,p,d=[],g=[],m=a.length,y=o||h(t||\"*\",s.nodeType?[s]:s,[]),v=!e||!o&&t?y:c(y,d,e,s,l),b=n?i||(o?e:m||r)?[]:a:v;if(n&&n(v,b,s,l),r)for(u=c(b,g),r(u,[],s,l),f=u.length;f--;)(p=u[f])&&(b[g[f]]=!(v[g[f]]=p));if(o){if(i||e){if(i){for(u=[],f=b.length;f--;)(p=b[f])&&u.push(v[f]=p);i(null,b=[],u,l)}for(f=b.length;f--;)(p=b[f])&&(u=i?B.call(o,p):d[f])>-1&&(o[u]=!(a[u]=p))}}else b=c(b===a?b.splice(m,b.length):b),i?i(null,a,b,l):q.apply(a,b)})}function p(e){for(var t,n,r,i=e.length,o=b.relative[e[0].type],a=o||b.relative[\" \"],s=o?1:0,c=l(function(e){return e===t},a,!0),d=l(function(e){return B.call(t,e)>-1},a,!0),h=[function(e,n,r){return!o&&(r||n!==E)||((t=n).nodeType?c(e,n,r):d(e,n,r))}];i>s;s++)if(n=b.relative[e[s].type])h=[l(u(h),n)];else{if(n=b.filter[e[s].type].apply(null,e[s].matches),n[A]){for(r=++s;i>r&&!b.relative[e[r].type];r++);return f(s>1&&u(h),s>1&&e.slice(0,s-1).join(\"\").replace(G,\"$1\"),n,r>s&&p(e.slice(s,r)),i>r&&p(e=e.slice(r)),i>r&&e.join(\"\"))}h.push(n)}return u(h)}function d(e,t){var r=t.length>0,i=e.length>0,o=function(a,s,l,u,f){var p,d,h,g=[],m=0,v=\"0\",x=a&&[],w=null!=f,T=E,N=a||i&&b.find.TAG(\"*\",f&&s.parentNode||s),C=F+=null==T?1:Math.E;for(w&&(E=s!==D&&s,y=o.el);null!=(p=N[v]);v++){if(i&&p){for(d=0;h=e[d];d++)if(h(p,s,l)){u.push(p);break}w&&(F=C,y=++o.el)}r&&((p=!h&&p)&&m--,a&&x.push(p))}if(m+=v,r&&v!==m){for(d=0;h=t[d];d++)h(x,g,s,l);if(a){if(m>0)for(;v--;)!x[v]&&!g[v]&&(g[v]=O.call(u));g=c(g)}q.apply(u,g),w&&!a&&g.length>0&&m+t.length>1&&n.uniqueSort(u)}return w&&(F=C,E=T),x};return o.el=0,r?W(o):o}function h(e,t,r){for(var i=0,o=t.length;o>i;i++)n(e,t[i],r);return r}function g(e,t,n,r,i){{var o,a,l,u,c,f=s(e);f.length}if(!r&&1===f.length){if(a=f[0]=f[0].slice(0),a.length>2&&\"ID\"===(l=a[0]).type&&9===t.nodeType&&!i&&b.relative[a[1].type]){if(t=b.find.ID(l.matches[0].replace(ae,\"\"),t,i)[0],!t)return n;e=e.slice(a.shift().length)}for(o=se.POS.test(e)?-1:a.length-1;o>=0&&(l=a[o],!b.relative[u=l.type]);o--)if((c=b.find[u])&&(r=c(l.matches[0].replace(ae,\"\"),re.test(a[0].type)&&t.parentNode||t,i))){if(a.splice(o,1),e=r.length&&a.join(\"\"),!e)return q.apply(n,_.call(r,0)),n;break}}return N(e,f)(r,t,i,n,re.test(e)),n}function m(){}var y,v,b,x,w,T,N,C,k,E,S=!0,j=\"undefined\",A=(\"sizcache\"+Math.random()).replace(\".\",\"\"),L=String,D=e.document,H=D.documentElement,F=0,M=0,O=[].pop,q=[].push,_=[].slice,B=[].indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},W=function(e,t){return e[A]=null==t||t,e},P=function(){var e={},t=[];return W(function(n,r){return t.push(n)>b.cacheLength&&delete e[t.shift()],e[n+\" \"]=r},e)},R=P(),$=P(),I=P(),z=\"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\",X=\"(?:\\\\\\\\.|[-\\\\w]|[^\\\\x00-\\\\xa0])+\",U=X.replace(\"w\",\"w#\"),Q=\"([*^$|!~]?=)\",Y=\"\\\\[\"+z+\"*(\"+X+\")\"+z+\"*(?:\"+Q+z+\"*(?:(['\\\"])((?:\\\\\\\\.|[^\\\\\\\\])*?)\\\\3|(\"+U+\")|)|)\"+z+\"*\\\\]\",V=\":(\"+X+\")(?:\\\\((?:(['\\\"])((?:\\\\\\\\.|[^\\\\\\\\])*?)\\\\2|([^()[\\\\]]*|(?:(?:\"+Y+\")|[^:]|\\\\\\\\.)*|.*))\\\\)|)\",J=\":(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\"+z+\"*((?:-\\\\d)?\\\\d*)\"+z+\"*\\\\)|)(?=[^-]|$)\",G=new RegExp(\"^\"+z+\"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\"+z+\"+$\",\"g\"),Z=new RegExp(\"^\"+z+\"*,\"+z+\"*\"),ee=new RegExp(\"^\"+z+\"*([\\\\x20\\\\t\\\\r\\\\n\\\\f>+~])\"+z+\"*\"),te=new RegExp(V),ne=/^(?:#([\\w\\-]+)|(\\w+)|\\.([\\w\\-]+))$/,re=/[\\x20\\t\\r\\n\\f]*[+~]/,ie=/h\\d/i,oe=/input|select|textarea|button/i,ae=/\\\\(?!\\\\)/g,se={ID:new RegExp(\"^#(\"+X+\")\"),CLASS:new RegExp(\"^\\\\.(\"+X+\")\"),NAME:new RegExp(\"^\\\\[name=['\\\"]?(\"+X+\")['\\\"]?\\\\]\"),TAG:new RegExp(\"^(\"+X.replace(\"w\",\"w*\")+\")\"),ATTR:new RegExp(\"^\"+Y),PSEUDO:new RegExp(\"^\"+V),POS:new RegExp(J,\"i\"),CHILD:new RegExp(\"^:(only|nth|first|last)-child(?:\\\\(\"+z+\"*(even|odd|(([+-]|)(\\\\d*)n|)\"+z+\"*(?:([+-]|)\"+z+\"*(\\\\d+)|))\"+z+\"*\\\\)|)\",\"i\"),needsContext:new RegExp(\"^\"+z+\"*[>+~]|\"+J,\"i\")},le=function(e){var t=D.createElement(\"div\");try{return e(t)}catch(n){return!1}finally{t=null}},ue=le(function(e){return e.appendChild(D.createComment(\"\")),!e.getElementsByTagName(\"*\").length}),ce=le(function(e){return e.innerHTML=\" \",e.firstChild&&typeof e.firstChild.getAttribute!==j&&\"#\"===e.firstChild.getAttribute(\"href\")}),fe=le(function(e){e.innerHTML=\" \";var t=typeof e.lastChild.getAttribute(\"multiple\");return\"boolean\"!==t&&\"string\"!==t}),pe=le(function(e){return e.innerHTML=\"
\",e.getElementsByClassName&&e.getElementsByClassName(\"e\").length?(e.lastChild.className=\"e\",2===e.getElementsByClassName(\"e\").length):!1}),de=le(function(e){e.id=A+0,e.innerHTML=\"
\",H.insertBefore(e,H.firstChild);var t=D.getElementsByName&&D.getElementsByName(A).length===2+D.getElementsByName(A+0).length;return v=!D.getElementById(A),H.removeChild(e),t});try{_.call(H.childNodes,0)[0].nodeType}catch(he){_=function(e){for(var t,n=[];t=this[e];e++)n.push(t);return n}}n.matches=function(e,t){return n(e,null,null,t)},n.matchesSelector=function(e,t){return n(t,null,null,[e]).length>0},x=n.getText=function(e){var t,n=\"\",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if(\"string\"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=x(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=x(t);return n},w=n.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?\"HTML\"!==t.nodeName:!1},T=n.contains=H.contains?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&1===r.nodeType&&n.contains&&n.contains(r))}:H.compareDocumentPosition?function(e,t){return t&&!!(16&e.compareDocumentPosition(t))}:function(e,t){for(;t=t.parentNode;)if(t===e)return!0;return!1},n.attr=function(e,t){var n,r=w(e);return r||(t=t.toLowerCase()),(n=b.attrHandle[t])?n(e):r||fe?e.getAttribute(t):(n=e.getAttributeNode(t),n?\"boolean\"==typeof e[t]?e[t]?t:null:n.specified?n.value:null:null)},b=n.selectors={cacheLength:50,createPseudo:W,match:se,attrHandle:ce?{}:{href:function(e){return e.getAttribute(\"href\",2)},type:function(e){return e.getAttribute(\"type\")}},find:{ID:v?function(e,t,n){if(typeof t.getElementById!==j&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==j&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==j&&i.getAttributeNode(\"id\").value===e?[i]:t:[]}},TAG:ue?function(e,t){return typeof t.getElementsByTagName!==j?t.getElementsByTagName(e):void 0}:function(e,t){var n=t.getElementsByTagName(e);if(\"*\"===e){for(var r,i=[],o=0;r=n[o];o++)1===r.nodeType&&i.push(r);return i}return n},NAME:de&&function(e,t){return typeof t.getElementsByName!==j?t.getElementsByName(name):void 0},CLASS:pe&&function(e,t,n){return typeof t.getElementsByClassName===j||n?void 0:t.getElementsByClassName(e)}},relative:{\">\":{dir:\"parentNode\",first:!0},\" \":{dir:\"parentNode\"},\"+\":{dir:\"previousSibling\",first:!0},\"~\":{dir:\"previousSibling\"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ae,\"\"),e[3]=(e[4]||e[5]||\"\").replace(ae,\"\"),\"~=\"===e[2]&&(e[3]=\" \"+e[3]+\" \"),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),\"nth\"===e[1]?(e[2]||n.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(\"even\"===e[2]||\"odd\"===e[2])),e[4]=+(e[6]+e[7]||\"odd\"===e[2])):e[2]&&n.error(e[0]),e},PSEUDO:function(e){var t,n;return se.CHILD.test(e[0])?null:(e[3]?e[2]=e[3]:(t=e[4])&&(te.test(t)&&(n=s(t,!0))&&(n=t.indexOf(\")\",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t),e.slice(0,3))}},filter:{ID:v?function(e){return e=e.replace(ae,\"\"),function(t){return t.getAttribute(\"id\")===e}}:function(e){return e=e.replace(ae,\"\"),function(t){var n=typeof t.getAttributeNode!==j&&t.getAttributeNode(\"id\");return n&&n.value===e}},TAG:function(e){return\"*\"===e?function(){return!0}:(e=e.replace(ae,\"\").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=R[A][e+\" \"];return t||(t=new RegExp(\"(^|\"+z+\")\"+e+\"(\"+z+\"|$)\"))&&R(e,function(e){return t.test(e.className||typeof e.getAttribute!==j&&e.getAttribute(\"class\")||\"\")})},ATTR:function(e,t,r){return function(i,o){var a=n.attr(i,e);return null==a?\"!=\"===t:t?(a+=\"\",\"=\"===t?a===r:\"!=\"===t?a!==r:\"^=\"===t?r&&0===a.indexOf(r):\"*=\"===t?r&&a.indexOf(r)>-1:\"$=\"===t?r&&a.substr(a.length-r.length)===r:\"~=\"===t?(\" \"+a+\" \").indexOf(r)>-1:\"|=\"===t?a===r||a.substr(0,r.length+1)===r+\"-\":!1):!0}},CHILD:function(e,t,n,r){return\"nth\"===e?function(e){var t,i,o=e.parentNode;if(1===n&&0===r)return!0;if(o)for(i=0,t=o.firstChild;t&&(1!==t.nodeType||(i++,e!==t));t=t.nextSibling);return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case\"only\":case\"first\":for(;n=n.previousSibling;)if(1===n.nodeType)return!1;if(\"first\"===e)return!0;n=t;case\"last\":for(;n=n.nextSibling;)if(1===n.nodeType)return!1;return!0}}},PSEUDO:function(e,t){var r,i=b.pseudos[e]||b.setFilters[e.toLowerCase()]||n.error(\"unsupported pseudo: \"+e);return i[A]?i(t):i.length>1?(r=[e,e,\"\",t],b.setFilters.hasOwnProperty(e.toLowerCase())?W(function(e,n){for(var r,o=i(e,t),a=o.length;a--;)r=B.call(e,o[a]),e[r]=!(n[r]=o[a])}):function(e){return i(e,0,r)}):i}},pseudos:{not:W(function(e){var t=[],n=[],r=N(e.replace(G,\"$1\"));return r[A]?W(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:W(function(e){return function(t){return n(e,t).length>0}}),contains:W(function(e){return function(t){return(t.textContent||t.innerText||x(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return\"input\"===t&&!!e.checked||\"option\"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!b.pseudos.empty(e)},empty:function(e){var t;for(e=e.firstChild;e;){if(e.nodeName>\"@\"||3===(t=e.nodeType)||4===t)return!1;e=e.nextSibling}return!0},header:function(e){return ie.test(e.nodeName)},text:function(e){var t,n;return\"input\"===e.nodeName.toLowerCase()&&\"text\"===(t=e.type)&&(null==(n=e.getAttribute(\"type\"))||n.toLowerCase()===t)},radio:r(\"radio\"),checkbox:r(\"checkbox\"),file:r(\"file\"),password:r(\"password\"),image:r(\"image\"),submit:i(\"submit\"),reset:i(\"reset\"),button:function(e){var t=e.nodeName.toLowerCase();return\"input\"===t&&\"button\"===e.type||\"button\"===t},input:function(e){return oe.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:o(function(){return[0]}),last:o(function(e,t){return[t-1]}),eq:o(function(e,t,n){return[0>n?n+t:n]}),even:o(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:o(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:o(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:o(function(e,t,n){for(var r=0>n?n+t:n;++rc&&r>c;c++)if(i[c]!==o[c])return a(i[c],o[c]);return c===n?a(e,o[c],-1):a(i[c],t,1)},[0,0].sort(C),S=!k,n.uniqueSort=function(e){var t,n=[],r=1,i=0;if(k=S,e.sort(C),k){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));for(;i--;)e.splice(n[i],1)}return e},n.error=function(e){throw new Error(\"Syntax error, unrecognized expression: \"+e)},N=n.compile=function(e,t){var n,r=[],i=[],o=I[A][e+\" \"];if(!o){for(t||(t=s(e)),n=t.length;n--;)o=p(t[n]),o[A]?r.push(o):i.push(o);o=I(e,d(i,r))}return o},D.querySelectorAll&&function(){var e,t=g,r=/'|\\\\/g,i=/\\=[\\x20\\t\\r\\n\\f]*([^'\"\\]]*)[\\x20\\t\\r\\n\\f]*\\]/g,o=[\":focus\"],a=[\":active\"],l=H.matchesSelector||H.mozMatchesSelector||H.webkitMatchesSelector||H.oMatchesSelector||H.msMatchesSelector;le(function(e){e.innerHTML=\" \",e.querySelectorAll(\"[selected]\").length||o.push(\"\\\\[\"+z+\"*(?:checked|disabled|ismap|multiple|readonly|selected|value)\"),e.querySelectorAll(\":checked\").length||o.push(\":checked\")}),le(function(e){e.innerHTML=\"
\",e.querySelectorAll(\"[test^='']\").length&&o.push(\"[*^$]=\"+z+\"*(?:\\\"\\\"|'')\"),e.innerHTML=\" \",e.querySelectorAll(\":enabled\").length||o.push(\":enabled\",\":disabled\")}),o=new RegExp(o.join(\"|\")),g=function(e,n,i,a,l){if(!a&&!l&&!o.test(e)){var u,c,f=!0,p=A,d=n,h=9===n.nodeType&&e;if(1===n.nodeType&&\"object\"!==n.nodeName.toLowerCase()){for(u=s(e),(f=n.getAttribute(\"id\"))?p=f.replace(r,\"\\\\$&\"):n.setAttribute(\"id\",p),p=\"[id='\"+p+\"'] \",c=u.length;c--;)u[c]=p+u[c].join(\"\");d=re.test(e)&&n.parentNode||n,h=u.join(\",\")}if(h)try{return q.apply(i,_.call(d.querySelectorAll(h),0)),i}catch(g){}finally{f||n.removeAttribute(\"id\")}}return t(e,n,i,a,l)},l&&(le(function(t){e=l.call(t,\"div\");try{l.call(t,\"[test!='']:sizzle\"),a.push(\"!=\",V)}catch(n){}}),a=new RegExp(a.join(\"|\")),n.matchesSelector=function(t,r){if(r=r.replace(i,\"='$1']\"),!w(t)&&!a.test(r)&&!o.test(r))try{var s=l.call(t,r);if(s||e||t.document&&11!==t.document.nodeType)return s}catch(u){}return n(r,null,null,[t]).length>0})}(),b.pseudos.nth=b.pseudos.eq,b.filters=m.prototype=b.pseudos,b.setFilters=new m,n.attr=K.attr,K.find=n,K.expr=n.selectors,K.expr[\":\"]=K.expr.pseudos,K.unique=n.uniqueSort,K.text=n.getText,K.isXMLDoc=n.isXML,K.contains=n.contains}(e);var Me=/Until$/,Oe=/^(?:parents|prev(?:Until|All))/,qe=/^.[^:#\\[\\.,]*$/,_e=K.expr.match.needsContext,Be={children:!0,contents:!0,next:!0,prev:!0};K.fn.extend({find:function(e){var t,n,r,i,o,a,s=this;if(\"string\"!=typeof e)return K(e).filter(function(){for(t=0,n=s.length;n>t;t++)if(K.contains(s[t],this))return!0});for(a=this.pushStack(\"\",\"find\",e),t=0,n=this.length;n>t;t++)if(r=a.length,K.find(e,this[t],a),t>0)for(i=r;io;o++)if(a[o]===a[i]){a.splice(i--,1);break}return a},has:function(e){var t,n=K(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(K.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(u(this,e,!1),\"not\",e)},filter:function(e){return this.pushStack(u(this,e,!0),\"filter\",e)},is:function(e){return!!e&&(\"string\"==typeof e?_e.test(e)?K(e,this.context).index(this[0])>=0:K.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){for(var n,r=0,i=this.length,o=[],a=_e.test(e)||\"string\"!=typeof e?K(e,t||this.context):0;i>r;r++)for(n=this[r];n&&n.ownerDocument&&n!==t&&11!==n.nodeType;){if(a?a.index(n)>-1:K.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}return o=o.length>1?K.unique(o):o,this.pushStack(o,\"closest\",e)},index:function(e){return e?\"string\"==typeof e?K.inArray(this[0],K(e)):K.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=\"string\"==typeof e?K(e,t):K.makeArray(e&&e.nodeType?[e]:e),r=K.merge(this.get(),n);return this.pushStack(s(n[0])||s(r[0])?r:K.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),K.fn.andSelf=K.fn.addBack,K.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return K.dir(e,\"parentNode\")},parentsUntil:function(e,t,n){return K.dir(e,\"parentNode\",n)},next:function(e){return l(e,\"nextSibling\")},prev:function(e){return l(e,\"previousSibling\")},nextAll:function(e){return K.dir(e,\"nextSibling\")},prevAll:function(e){return K.dir(e,\"previousSibling\")},nextUntil:function(e,t,n){return K.dir(e,\"nextSibling\",n)},prevUntil:function(e,t,n){return K.dir(e,\"previousSibling\",n)},siblings:function(e){return K.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return K.sibling(e.firstChild)},contents:function(e){return K.nodeName(e,\"iframe\")?e.contentDocument||e.contentWindow.document:K.merge([],e.childNodes)}},function(e,t){K.fn[e]=function(n,r){var i=K.map(this,t,n);return Me.test(e)||(r=n),r&&\"string\"==typeof r&&(i=K.filter(r,i)),i=this.length>1&&!Be[e]?K.unique(i):i,this.length>1&&Oe.test(e)&&(i=i.reverse()),this.pushStack(i,e,Q.call(arguments).join(\",\"))}}),K.extend({filter:function(e,t,n){return n&&(e=\":not(\"+e+\")\"),1===t.length?K.find.matchesSelector(t[0],e)?[t[0]]:[]:K.find.matches(e,t)},dir:function(e,n,r){for(var i=[],o=e[n];o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!K(o).is(r));)1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});var We=\"abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video\",Pe=/ jQuery\\d+=\"(?:null|\\d+)\"/g,Re=/^\\s+/,$e=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\\w:]+)[^>]*)\\/>/gi,Ie=/<([\\w:]+)/,ze=/ ]\",\"i\"),Ve=/^(?:checkbox|radio)$/,Je=/checked\\s*(?:[^=]|=\\s*.checked.)/i,Ge=/\\/(java|ecma)script/i,Ke=/^\\s*\\s*$/g,Ze={\n" +
" option:[1,\"\",\" \"],legend:[1,\"\",\" \"],thead:[1,\"\"],tr:[2,\"\"],td:[3,\"\"],col:[2,\"\"],area:[1,\"\",\" \"],_default:[0,\"\",\"\"]},et=c(R),tt=et.appendChild(R.createElement(\"div\"));Ze.optgroup=Ze.option,Ze.tbody=Ze.tfoot=Ze.colgroup=Ze.caption=Ze.thead,Ze.th=Ze.td,K.support.htmlSerialize||(Ze._default=[1,\"X\",\"
\"]),K.fn.extend({text:function(e){return K.access(this,function(e){return e===t?K.text(this):this.empty().append((this[0]&&this[0].ownerDocument||R).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(K.isFunction(e))return this.each(function(t){K(this).wrapAll(e.call(this,t))});if(this[0]){var t=K(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return this.each(K.isFunction(e)?function(t){K(this).wrapInner(e.call(this,t))}:function(){var t=K(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=K.isFunction(e);return this.each(function(n){K(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){K.nodeName(this,\"body\")||K(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!s(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=K.clean(arguments);return this.pushStack(K.merge(e,this),\"before\",this.selector)}},after:function(){if(!s(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=K.clean(arguments);return this.pushStack(K.merge(this,e),\"after\",this.selector)}},remove:function(e,t){for(var n,r=0;null!=(n=this[r]);r++)(!e||K.filter(e,[n]).length)&&(!t&&1===n.nodeType&&(K.cleanData(n.getElementsByTagName(\"*\")),K.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)for(1===e.nodeType&&K.cleanData(e.getElementsByTagName(\"*\"));e.firstChild;)e.removeChild(e.firstChild);return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return K.clone(this,e,t)})},html:function(e){return K.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(Pe,\"\"):t;if(!(\"string\"!=typeof e||Ue.test(e)||!K.support.htmlSerialize&&Ye.test(e)||!K.support.leadingWhitespace&&Re.test(e)||Ze[(Ie.exec(e)||[\"\",\"\"])[1].toLowerCase()])){e=e.replace($e,\"<$1>$2>\");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(K.cleanData(n.getElementsByTagName(\"*\")),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){return s(this[0])?this.length?this.pushStack(K(K.isFunction(e)?e():e),\"replaceWith\",e):this:K.isFunction(e)?this.each(function(t){var n=K(this),r=n.html();n.replaceWith(e.call(this,t,r))}):(\"string\"!=typeof e&&(e=K(e).detach()),this.each(function(){var t=this.nextSibling,n=this.parentNode;K(this).remove(),t?K(t).before(e):K(n).append(e)}))},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=[].concat.apply([],e);var i,o,a,s,l=0,u=e[0],c=[],p=this.length;if(!K.support.checkClone&&p>1&&\"string\"==typeof u&&Je.test(u))return this.each(function(){K(this).domManip(e,n,r)});if(K.isFunction(u))return this.each(function(i){var o=K(this);e[0]=u.call(this,i,n?o.html():t),o.domManip(e,n,r)});if(this[0]){if(i=K.buildFragment(e,this,c),a=i.fragment,o=a.firstChild,1===a.childNodes.length&&(a=o),o)for(n=n&&K.nodeName(o,\"tr\"),s=i.cacheable||p-1;p>l;l++)r.call(n&&K.nodeName(this[l],\"table\")?f(this[l],\"tbody\"):this[l],l===s?a:K.clone(a,!0,!0));a=o=null,c.length&&K.each(c,function(e,t){t.src?K.ajax?K.ajax({url:t.src,type:\"GET\",dataType:\"script\",async:!1,global:!1,\"throws\":!0}):K.error(\"no ajax\"):K.globalEval((t.text||t.textContent||t.innerHTML||\"\").replace(Ke,\"\")),t.parentNode&&t.parentNode.removeChild(t)})}return this}}),K.buildFragment=function(e,n,r){var i,o,a,s=e[0];return n=n||R,n=!n.nodeType&&n[0]||n,n=n.ownerDocument||n,1===e.length&&\"string\"==typeof s&&s.length<512&&n===R&&\"<\"===s.charAt(0)&&!Qe.test(s)&&(K.support.checkClone||!Je.test(s))&&(K.support.html5Clone||!Ye.test(s))&&(o=!0,i=K.fragments[s],a=i!==t),i||(i=n.createDocumentFragment(),K.clean(e,n,i,r),o&&(K.fragments[s]=a&&i)),{fragment:i,cacheable:o}},K.fragments={},K.each({appendTo:\"append\",prependTo:\"prepend\",insertBefore:\"before\",insertAfter:\"after\",replaceAll:\"replaceWith\"},function(e,t){K.fn[e]=function(n){var r,i=0,o=[],a=K(n),s=a.length,l=1===this.length&&this[0].parentNode;if((null==l||l&&11===l.nodeType&&1===l.childNodes.length)&&1===s)return a[t](this[0]),this;for(;s>i;i++)r=(i>0?this.clone(!0):this).get(),K(a[i])[t](r),o=o.concat(r);return this.pushStack(o,e,a.selector)}}),K.extend({clone:function(e,t,n){var r,i,o,a;if(K.support.html5Clone||K.isXMLDoc(e)||!Ye.test(\"<\"+e.nodeName+\">\")?a=e.cloneNode(!0):(tt.innerHTML=e.outerHTML,tt.removeChild(a=tt.firstChild)),!(K.support.noCloneEvent&&K.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||K.isXMLDoc(e)))for(d(e,a),r=h(e),i=h(a),o=0;r[o];++o)i[o]&&d(r[o],i[o]);if(t&&(p(e,a),n))for(r=h(e),i=h(a),o=0;r[o];++o)p(r[o],i[o]);return r=i=null,a},clean:function(e,t,n,r){var i,o,a,s,l,u,f,p,d,h,m,y=t===R&&et,v=[];for(t&&\"undefined\"!=typeof t.createDocumentFragment||(t=R),i=0;null!=(a=e[i]);i++)if(\"number\"==typeof a&&(a+=\"\"),a){if(\"string\"==typeof a)if(Xe.test(a)){for(y=y||c(t),f=t.createElement(\"div\"),y.appendChild(f),a=a.replace($e,\"<$1>$2>\"),s=(Ie.exec(a)||[\"\",\"\"])[1].toLowerCase(),l=Ze[s]||Ze._default,u=l[0],f.innerHTML=l[1]+a+l[2];u--;)f=f.lastChild;if(!K.support.tbody)for(p=ze.test(a),d=\"table\"!==s||p?\"\"!==l[1]||p?[]:f.childNodes:f.firstChild&&f.firstChild.childNodes,o=d.length-1;o>=0;--o)K.nodeName(d[o],\"tbody\")&&!d[o].childNodes.length&&d[o].parentNode.removeChild(d[o]);!K.support.leadingWhitespace&&Re.test(a)&&f.insertBefore(t.createTextNode(Re.exec(a)[0]),f.firstChild),a=f.childNodes,f.parentNode.removeChild(f)}else a=t.createTextNode(a);a.nodeType?v.push(a):K.merge(v,a)}if(f&&(a=f=y=null),!K.support.appendChecked)for(i=0;null!=(a=v[i]);i++)K.nodeName(a,\"input\")?g(a):\"undefined\"!=typeof a.getElementsByTagName&&K.grep(a.getElementsByTagName(\"input\"),g);if(n)for(h=function(e){return!e.type||Ge.test(e.type)?r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e):void 0},i=0;null!=(a=v[i]);i++)K.nodeName(a,\"script\")&&h(a)||(n.appendChild(a),\"undefined\"!=typeof a.getElementsByTagName&&(m=K.grep(K.merge([],a.getElementsByTagName(\"script\")),h),v.splice.apply(v,[i+1,0].concat(m)),i+=m.length));return v},cleanData:function(e,t){for(var n,r,i,o,a=0,s=K.expando,l=K.cache,u=K.support.deleteExpando,c=K.event.special;null!=(i=e[a]);a++)if((t||K.acceptData(i))&&(r=i[s],n=r&&l[r])){if(n.events)for(o in n.events)c[o]?K.event.remove(i,o):K.removeEvent(i,o,n.handle);l[r]&&(delete l[r],u?delete i[s]:i.removeAttribute?i.removeAttribute(s):i[s]=null,K.deletedIds.push(r))}}}),function(){var e,t;K.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \\/]([\\w.]+)/.exec(e)||/(webkit)[ \\/]([\\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \\/]([\\w.]+)/.exec(e)||/(msie) ([\\w.]+)/.exec(e)||e.indexOf(\"compatible\")<0&&/(mozilla)(?:.*? rv:([\\w.]+)|)/.exec(e)||[];return{browser:t[1]||\"\",version:t[2]||\"0\"}},e=K.uaMatch(I.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),K.browser=t,K.sub=function(){function e(t,n){return new e.fn.init(t,n)}K.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(n,r){return r&&r instanceof K&&!(r instanceof e)&&(r=e(r)),K.fn.init.call(this,n,r,t)},e.fn.init.prototype=e.fn;var t=e(R);return e}}();var nt,rt,it,ot=/alpha\\([^)]*\\)/i,at=/opacity=([^)]*)/,st=/^(top|right|bottom|left)$/,lt=/^(none|table(?!-c[ea]).+)/,ut=/^margin/,ct=new RegExp(\"^(\"+Z+\")(.*)$\",\"i\"),ft=new RegExp(\"^(\"+Z+\")(?!px)[a-z%]+$\",\"i\"),pt=new RegExp(\"^([-+])=(\"+Z+\")\",\"i\"),dt={BODY:\"block\"},ht={position:\"absolute\",visibility:\"hidden\",display:\"block\"},gt={letterSpacing:0,fontWeight:400},mt=[\"Top\",\"Right\",\"Bottom\",\"Left\"],yt=[\"Webkit\",\"O\",\"Moz\",\"ms\"],vt=K.fn.toggle;K.fn.extend({css:function(e,n){return K.access(this,function(e,n,r){return r!==t?K.style(e,n,r):K.css(e,n)},e,n,arguments.length>1)},show:function(){return v(this,!0)},hide:function(){return v(this)},toggle:function(e,t){var n=\"boolean\"==typeof e;return K.isFunction(e)&&K.isFunction(t)?vt.apply(this,arguments):this.each(function(){(n?e:y(this))?K(this).show():K(this).hide()})}}),K.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=nt(e,\"opacity\");return\"\"===n?\"1\":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{\"float\":K.support.cssFloat?\"cssFloat\":\"styleFloat\"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=K.camelCase(n),u=e.style;if(n=K.cssProps[l]||(K.cssProps[l]=m(u,l)),s=K.cssHooks[n]||K.cssHooks[l],r===t)return s&&\"get\"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,\"string\"===a&&(o=pt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(K.css(e,n)),a=\"number\"),!(null==r||\"number\"===a&&isNaN(r)||(\"number\"===a&&!K.cssNumber[l]&&(r+=\"px\"),s&&\"set\"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=K.camelCase(n);return n=K.cssProps[l]||(K.cssProps[l]=m(e.style,l)),s=K.cssHooks[n]||K.cssHooks[l],s&&\"get\"in s&&(o=s.get(e,!0,i)),o===t&&(o=nt(e,n)),\"normal\"===o&&n in gt&&(o=gt[n]),r||i!==t?(a=parseFloat(o),r||K.isNumeric(a)?a||0:o):o},swap:function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=o[i];return r}}),e.getComputedStyle?nt=function(t,n){var r,i,o,a,s=e.getComputedStyle(t,null),l=t.style;return s&&(r=s.getPropertyValue(n)||s[n],\"\"===r&&!K.contains(t.ownerDocument,t)&&(r=K.style(t,n)),ft.test(r)&&ut.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=r,r=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),r}:R.documentElement.currentStyle&&(nt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],o=e.style;return null==i&&o&&o[t]&&(i=o[t]),ft.test(i)&&!st.test(t)&&(n=o.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),o.left=\"fontSize\"===t?\"1em\":i,i=o.pixelLeft+\"px\",o.left=n,r&&(e.runtimeStyle.left=r)),\"\"===i?\"auto\":i}),K.each([\"height\",\"width\"],function(e,t){K.cssHooks[t]={get:function(e,n,r){return n?0===e.offsetWidth&<.test(nt(e,\"display\"))?K.swap(e,ht,function(){return w(e,t,r)}):w(e,t,r):void 0},set:function(e,n,r){return b(e,n,r?x(e,t,r,K.support.boxSizing&&\"border-box\"===K.css(e,\"boxSizing\")):0)}}}),K.support.opacity||(K.cssHooks.opacity={get:function(e,t){return at.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||\"\")?.01*parseFloat(RegExp.$1)+\"\":t?\"1\":\"\"},set:function(e,t){var n=e.style,r=e.currentStyle,i=K.isNumeric(t)?\"alpha(opacity=\"+100*t+\")\":\"\",o=r&&r.filter||n.filter||\"\";n.zoom=1,t>=1&&\"\"===K.trim(o.replace(ot,\"\"))&&n.removeAttribute&&(n.removeAttribute(\"filter\"),r&&!r.filter)||(n.filter=ot.test(o)?o.replace(ot,i):o+\" \"+i)}}),K(function(){K.support.reliableMarginRight||(K.cssHooks.marginRight={get:function(e,t){return K.swap(e,{display:\"inline-block\"},function(){return t?nt(e,\"marginRight\"):void 0})}}),!K.support.pixelPosition&&K.fn.position&&K.each([\"top\",\"left\"],function(e,t){K.cssHooks[t]={get:function(e,n){if(n){var r=nt(e,t);return ft.test(r)?K(e).position()[t]+\"px\":r}}}})}),K.expr&&K.expr.filters&&(K.expr.filters.hidden=function(e){return 0===e.offsetWidth&&0===e.offsetHeight||!K.support.reliableHiddenOffsets&&\"none\"===(e.style&&e.style.display||nt(e,\"display\"))},K.expr.filters.visible=function(e){return!K.expr.filters.hidden(e)}),K.each({margin:\"\",padding:\"\",border:\"Width\"},function(e,t){K.cssHooks[e+t]={expand:function(n){var r,i=\"string\"==typeof n?n.split(\" \"):[n],o={};for(r=0;4>r;r++)o[e+mt[r]+t]=i[r]||i[r-2]||i[0];return o}},ut.test(e)||(K.cssHooks[e+t].set=b)});var bt=/%20/g,xt=/\\[\\]$/,wt=/\\r?\\n/g,Tt=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,Nt=/^(?:select|textarea)/i;K.fn.extend({serialize:function(){return K.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?K.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||Nt.test(this.nodeName)||Tt.test(this.type))}).map(function(e,t){var n=K(this).val();return null==n?null:K.isArray(n)?K.map(n,function(e,n){return{name:t.name,value:e.replace(wt,\"\\r\\n\")}}):{name:t.name,value:n.replace(wt,\"\\r\\n\")}}).get()}}),K.param=function(e,n){var r,i=[],o=function(e,t){t=K.isFunction(t)?t():null==t?\"\":t,i[i.length]=encodeURIComponent(e)+\"=\"+encodeURIComponent(t)};if(n===t&&(n=K.ajaxSettings&&K.ajaxSettings.traditional),K.isArray(e)||e.jquery&&!K.isPlainObject(e))K.each(e,function(){o(this.name,this.value)});else for(r in e)N(r,e[r],n,o);return i.join(\"&\").replace(bt,\"+\")};var Ct,kt,Et=/#.*$/,St=/^(.*?):[ \\t]*([^\\r\\n]*)\\r?$/gm,jt=/^(?:about|app|app\\-storage|.+\\-extension|file|res|widget):$/,At=/^(?:GET|HEAD)$/,Lt=/^\\/\\//,Dt=/\\?/,Ht=/\n");
bufferedWriter.write("\n");
bufferedWriter.write(" \n");
bufferedWriter.write(" \n");
bufferedWriter.write("\n");
bufferedWriter.write("\n");
bufferedWriter.write("\n");
bufferedWriter.write("\n");
MybatisUtilHtmlBack.writeQueryDiv(bufferedWriter, introspectedTable, tableName);
bufferedWriter.write("
\n");
bufferedWriter.write("");
MybatisUtilHtmlBack.writeNewDiv(bufferedWriter, introspectedTable, tableName);
bufferedWriter.write("
\n");
bufferedWriter.write(" \n");
bufferedWriter.write("\n");
bufferedWriter.write("\n");
bufferedWriter.write("
\n");
bufferedWriter.write(" \n");
bufferedWriter.write("\n");
bufferedWriter.write("\n");
bufferedWriter.write(" \n");
bufferedWriter.write("\n");
bufferedWriter.write("
\n");
bufferedWriter.write(" \n");
bufferedWriter.write(" \n");
bufferedWriter.write("\n");
bufferedWriter.write("\n");
System.out.println("write to file success : " + file.getPath());
} catch (IOException e) {
e.printStackTrace();
} finally {
MybatisUtilCommon.closeBufferWriterAndFileOutputStream(outputStream, bufferedWriter);
}
}
public static void writeNewDiv(BufferedWriter bufferedWriter, IntrospectedTable introspectedTable, String tableName) throws IOException {
bufferedWriter.write(" " +
" " +
"" +
"");
bufferedWriter.write("");
bufferedWriter.write("
" +
" " +
" " +
"
");
List
introspectedColumns = introspectedTable.getAllColumns();
Iterator iterator = introspectedColumns.iterator();
while (iterator.hasNext()) {
IntrospectedColumn introspectedColumn = iterator.next();
String columnName = introspectedColumn.getJavaProperty();
if (introspectedColumn.isBLOBColumn()) {
bufferedWriter.write("" + columnName +
" :
\n" +
"\n" +
"
\n");
} else {
bufferedWriter.write("" + columnName +
" : \n" +
" \n" +
" \n" +
"" + introspectedColumn.getRemarks() + " " +
"
\n");
}
}
}
public static void writeQueryDiv(BufferedWriter bufferedWriter, IntrospectedTable introspectedTable, String tableName) throws
IOException {
bufferedWriter.write("\n" +
"" +
"" +
" " +
"" +
" " +
"" +
" " +
"" +
" " +
"每页条数: " +
"" +
"10 20 50 " +
"100 " +
"
" +
"\n");
bufferedWriter.write("
\n");
}
public static void writeQueryDivHead(BufferedWriter bufferedWriter, IntrospectedTable introspectedTable) throws IOException {
List introspectedColumns = introspectedTable.getAllColumns();
Iterator iterator = introspectedColumns.iterator();
bufferedWriter.write("\n");
while (iterator.hasNext()) {
IntrospectedColumn introspectedColumn = iterator.next();
FullyQualifiedJavaType fullyQualifiedJavaType = introspectedColumn
.getFullyQualifiedJavaType();
String columnName = introspectedColumn.getJavaProperty();
bufferedWriter.write("" + columnName + " ");
}
bufferedWriter.write(" ");
}
public static void writeScriptQueryFunction(BufferedWriter bufferedWriter, IntrospectedTable
introspectedTable, String tableName) throws IOException {
writeScriptForQueryPage(bufferedWriter, introspectedTable, tableName);
writeScriptForClearQueryCondition(bufferedWriter, introspectedTable, tableName);
writeScriptForEditLine(bufferedWriter, introspectedTable);
writeScriptForCancelThisLine(bufferedWriter, introspectedTable);
writeScriptForConfirmThisLine(bufferedWriter, introspectedTable, tableName);
writeScriptForAddLine(bufferedWriter, introspectedTable, tableName);
writeScriptForCloseThisLineDiv(bufferedWriter, introspectedTable, tableName);
writeScriptForSubmitThisLineDiv(bufferedWriter, introspectedTable, tableName);
writeScriptForDeleteThisLineDiv(bufferedWriter, introspectedTable, tableName);
}
private static void writeScriptForClearQueryCondition(BufferedWriter bufferedWriter, IntrospectedTable introspectedTable, String tableName) throws
IOException {
List introspectedColumns = introspectedTable.getAllColumns();
bufferedWriter.write("var clearQueryCondition=function(){\n");
Iterator iterator = introspectedColumns.iterator();
while (iterator.hasNext()) {
IntrospectedColumn introspectedColumn = iterator.next();
if (introspectedColumn.isBLOBColumn()) {
} else {
FullyQualifiedJavaType fullyQualifiedJavaType = introspectedColumn
.getFullyQualifiedJavaType();
String columnName = introspectedColumn.getJavaProperty();
if (fullyQualifiedJavaType.isPrimitive()) {
if ("boolean".equals(fullyQualifiedJavaType.getFullyQualifiedName())) {
bufferedWriter.write("if($('.class-" + columnName + "').val()!=undefined && $('.class-" + columnName + "').val()!=''){\n$('.class-" + columnName + "').val('');\n}\n");
} else if ("byte".equals(fullyQualifiedJavaType.getFullyQualifiedName())
|| "double".equals(fullyQualifiedJavaType.getFullyQualifiedName())
|| "float".equals(fullyQualifiedJavaType.getFullyQualifiedName())
|| "int".equals(fullyQualifiedJavaType.getFullyQualifiedName())
|| "long".equals(fullyQualifiedJavaType.getFullyQualifiedName())
|| "short".equals(fullyQualifiedJavaType.getFullyQualifiedName())
) {
bufferedWriter.write("if($('.class-" + columnName + "').val()!=undefined && $('.class-" + columnName + "').val()!=''){\n$('.class-" + columnName + "').val('');\n}\n");
bufferedWriter.write("if($('.class-" + columnName + "-max').val()!=undefined && $('.class-" + columnName + "-max').val()!=''){\n$('.class-" + columnName + "-max').val('');\n}\n");
bufferedWriter.write("if($('.class-" + columnName + "-min').val()!=undefined && $('.class-" + columnName + "-min').val()!=''){\n$('.class-" + columnName + "-min').val('');\n}\n");
bufferedWriter.write("if($('.class-" + columnName + "-not').val()!=undefined && $('.class-" + columnName + "-not').val()!=''){\n$('.class-" + columnName + "-not').val('');\n}\n");
} else if ("char".equals(fullyQualifiedJavaType.getFullyQualifiedName())) {
bufferedWriter.write("if($('.class-" + columnName + "').val()!=undefined && $('.class-" + columnName + "').val()!=''){\n$('.class-" + columnName + "').val('');\n}\n");
bufferedWriter.write("if($('.class-" + columnName + "-not').val()!=undefined && $('.class-" + columnName + "-not').val()!=''){\n$('.class-" + columnName + "-not').val('');\n}\n");
}
} else if ("java.lang.Boolean".equals(fullyQualifiedJavaType.getFullyQualifiedName())) {
bufferedWriter.write("if($('.class-" + columnName + "').val()!=undefined && $('.class-" + columnName + "').val()!=''){\n$('.class-" + columnName + "').val('');\n}\n");
} else if ("java.lang.Byte".equals(fullyQualifiedJavaType.getFullyQualifiedName())
|| "java.lang.Double".equals(fullyQualifiedJavaType.getFullyQualifiedName())
|| "java.lang.Integer".equals(fullyQualifiedJavaType.getFullyQualifiedName())
|| "java.lang.Long".equals(fullyQualifiedJavaType.getFullyQualifiedName())
|| "java.lang.Short".equals(fullyQualifiedJavaType.getFullyQualifiedName())
|| "java.lang.BigDecimal".equals(fullyQualifiedJavaType.getFullyQualifiedName())
|| "java.util.Date".equals(fullyQualifiedJavaType.getFullyQualifiedName())
) {
bufferedWriter.write("if($('.class-" + columnName + "').val()!=undefined && $('.class-" + columnName + "').val()!=''){\n$('.class-" + columnName + "').val('');\n}\n");
bufferedWriter.write("if($('.class-" + columnName + "-max').val()!==undefined && $('.class-" + columnName + "-max').val()!=''){\n$('.class-" + columnName + "-max').val('');\n}\n");
bufferedWriter.write("if($('.class-" + columnName + "-min').val()!==undefined && $('.class-" + columnName + "-min').val()!=''){\n$('.class-" + columnName + "-min').val('');\n}\n");
bufferedWriter.write("if($('.class-" + columnName + "-not').val()!==undefined && $('.class-" + columnName + "-not').val()!=''){\n$('.class-" + columnName + "-not').val('');\n}\n");
} else if ("java.lang.String".equals(fullyQualifiedJavaType.getFullyQualifiedName())) {
bufferedWriter.write("if($('.class-" + columnName + "').val()!==undefined && $('.class-" + columnName + "').val()!=''){\n$('.class-" + columnName + "').val('');\n}\n");
bufferedWriter.write("if($('.class-" + columnName + "-suffix').val()!==undefined && $('.class-" + columnName + "-suffix').val()!=''){\n$('.class-" + columnName + "-suffix').val('');\n}\n");
bufferedWriter.write("if($('.class-" + columnName + "-prefix').val()!==undefined && $('.class-" + columnName + "-prefix').val()!=''){\n$('.class-" + columnName + "-prefix').val('');\n}\n");
bufferedWriter.write("if($('.class-" + columnName + "-like').val()!==undefined && $('.class-" + columnName + "-like').val()!=''){\n$('.class-" + columnName + "-like').val('');\n}\n");
bufferedWriter.write("if($('.class-" + columnName + "-not').val()!==undefined && $('.class-" + columnName + "-not').val()!=''){\n$('.class-" + columnName + "-not').val('');\n}\n");
}
}
}
bufferedWriter.write("queryPage(1);\n" +
"};\n");
}
private static void writeScriptForQueryPage(BufferedWriter bufferedWriter, IntrospectedTable introspectedTable, String tableName) throws
IOException {
List introspectedColumns = introspectedTable.getAllColumns();
bufferedWriter.write("var queryPage=function(page){\n");
bufferedWriter.write("$('.class-table-article-section-content').html(loadingImage);\n");
bufferedWriter.write("var limit = $('.class-select-limit').val();\n");
bufferedWriter.write("var token=getLocalStorageItem(\"token\");\n");
bufferedWriter.write("if(token==undefined || token==\"\"){gotoLoginForContent()}\n");
bufferedWriter.write("var queryString=\"\";\n");
bufferedWriter.write(" queryString+=\"page=\"+page+\"&limit=\"+limit;\n");
Iterator iterator = introspectedColumns.iterator();
while (iterator.hasNext()) {
IntrospectedColumn introspectedColumn = iterator.next();
if (introspectedColumn.isBLOBColumn()) {
} else {
FullyQualifiedJavaType fullyQualifiedJavaType = introspectedColumn
.getFullyQualifiedJavaType();
String columnName = introspectedColumn.getJavaProperty();
if (fullyQualifiedJavaType.isPrimitive()) {
if ("boolean".equals(fullyQualifiedJavaType.getFullyQualifiedName())) {
bufferedWriter.write("if($('.class-" + columnName + "').val()!=undefined && $('.class-" + columnName + "').val()!=''){\nqueryString+='&'+'" + columnName + "='+$('.class-" + columnName + "').val();\n}\n");
} else if ("byte".equals(fullyQualifiedJavaType.getFullyQualifiedName())
|| "double".equals(fullyQualifiedJavaType.getFullyQualifiedName())
|| "float".equals(fullyQualifiedJavaType.getFullyQualifiedName())
|| "int".equals(fullyQualifiedJavaType.getFullyQualifiedName())
|| "long".equals(fullyQualifiedJavaType.getFullyQualifiedName())
|| "short".equals(fullyQualifiedJavaType.getFullyQualifiedName())
) {
bufferedWriter.write("if($('.class-" + columnName + "').val()!=undefined && $('.class-" + columnName + "').val()!=''){\nqueryString+='&'+'" + columnName + "='+$('.class-" + columnName + "').val();\n}\n");
bufferedWriter.write("if($('.class-" + columnName + "-max').val()!=undefined && $('.class-" + columnName + "-max').val()!=''){\nqueryString+='&'+'" + columnName + "-max='+$('.class-" + columnName + "-max').val();\n}\n");
bufferedWriter.write("if($('.class-" + columnName + "-min').val()!=undefined && $('.class-" + columnName + "-min').val()!=''){\nqueryString+='&'+'" + columnName + "-min='+$('.class-" + columnName + "-min').val();\n}\n");
bufferedWriter.write("if($('.class-" + columnName + "-not').val()!=undefined && $('.class-" + columnName + "-not').val()!=''){\nqueryString+='&'+'" + columnName + "-not='+$('.class-" + columnName + "-not').val();\n}\n");
} else if ("char".equals(fullyQualifiedJavaType.getFullyQualifiedName())) {
bufferedWriter.write("if($('.class-" + columnName + "').val()!=undefined && $('.class-" + columnName + "').val()!=''){\nqueryString+='&'+'" + columnName + "='+$('.class-" + columnName + "').val();\n}\n");
bufferedWriter.write("if($('.class-" + columnName + "-not').val()!=undefined && $('.class-" + columnName + "-not').val()!=''){\nqueryString+='&'+'" + columnName + "-not='+$('.class-" + columnName + "-not').val();\n}\n");
}
} else if ("java.lang.Boolean".equals(fullyQualifiedJavaType.getFullyQualifiedName())) {
bufferedWriter.write("if($('.class-" + columnName + "').val()!=undefined && $('.class-" + columnName + "').val()!=''){\nqueryString+='&'+'" + columnName + "='+$('.class-" + columnName + "').val();\n}\n");
} else if ("java.lang.Byte".equals(fullyQualifiedJavaType.getFullyQualifiedName())
|| "java.lang.Double".equals(fullyQualifiedJavaType.getFullyQualifiedName())
|| "java.lang.Integer".equals(fullyQualifiedJavaType.getFullyQualifiedName())
|| "java.lang.Long".equals(fullyQualifiedJavaType.getFullyQualifiedName())
|| "java.lang.Short".equals(fullyQualifiedJavaType.getFullyQualifiedName())
|| "java.lang.BigDecimal".equals(fullyQualifiedJavaType.getFullyQualifiedName())
|| "java.util.Date".equals(fullyQualifiedJavaType.getFullyQualifiedName())
) {
bufferedWriter.write("if($('.class-" + columnName + "').val()!=undefined && $('.class-" + columnName + "').val()!=''){\nqueryString+='&'+'" + columnName + "='+$('.class-" + columnName + "').val();\n}\n");
bufferedWriter.write("if($('.class-" + columnName + "-max').val()!==undefined && $('.class-" + columnName + "-max').val()!=''){\nqueryString+='&'+'" + columnName + "-max='+$('.class-" + columnName + "-max').val();\n}\n");
bufferedWriter.write("if($('.class-" + columnName + "-min').val()!==undefined && $('.class-" + columnName + "-min').val()!=''){\nqueryString+='&'+'" + columnName + "-min='+$('.class-" + columnName + "-min').val();\n}\n");
bufferedWriter.write("if($('.class-" + columnName + "-not').val()!==undefined && $('.class-" + columnName + "-not').val()!=''){\nqueryString+='&'+'" + columnName + "-not='+$('.class-" + columnName + "-not').val();\n}\n");
} else if ("java.lang.String".equals(fullyQualifiedJavaType.getFullyQualifiedName())) {
bufferedWriter.write("if($('.class-" + columnName + "').val()!==undefined && $('.class-" + columnName + "').val()!=''){\nqueryString+='&'+'" + columnName + "='+$('.class-" + columnName + "').val();\n}\n");
bufferedWriter.write("if($('.class-" + columnName + "-suffix').val()!==undefined && $('.class-" + columnName + "-suffix').val()!=''){\nqueryString+='&'+'" + columnName + "-suffix='+$('.class-" + columnName + "-suffix').val();\n}\n");
bufferedWriter.write("if($('.class-" + columnName + "-prefix').val()!==undefined && $('.class-" + columnName + "-prefix').val()!=''){\nqueryString+='&'+'" + columnName + "-prefix='+$('.class-" + columnName + "-prefix').val();\n}\n");
bufferedWriter.write("if($('.class-" + columnName + "-like').val()!==undefined && $('.class-" + columnName + "-like').val()!=''){\nqueryString+='&'+'" + columnName + "-like='+$('.class-" + columnName + "-like').val();\n}\n");
bufferedWriter.write("if($('.class-" + columnName + "-not').val()!==undefined && $('.class-" + columnName + "-not').val()!=''){\nqueryString+='&'+'" + columnName + "-not='+$('.class-" + columnName + "-not').val();\n}\n");
}
}
}
bufferedWriter.write("var url=SERVER_URL+\"/v1/common/" + MybatisUtilCommon.getTableNameWithSlash(introspectedTable) + "/query?\"+queryString;\n");
bufferedWriter.write("$.ajax({\n");
bufferedWriter.write("url: url,\n");
bufferedWriter.write("type: \"get\",\n");
bufferedWriter.write("cache: false,\n");
bufferedWriter.write("async: true,\n");
bufferedWriter.write("headers: {\"token\": token },\n");
bufferedWriter.write("contentType: \"application/json\",\n");
bufferedWriter.write("success: function (res) {\n");
bufferedWriter.write("if(res.status!=200){\n");
bufferedWriter.write("validResForContent(res);\n");
bufferedWriter.write("}else{\n");
bufferedWriter.write("var list = res.data;\n");
bufferedWriter.write("var articleHtmlString = '';\n");
bufferedWriter.write("var tableString = '';\n");
bufferedWriter.write("if(list==null){tableString='empty';}else{\n");
writeScriptTableHead(bufferedWriter, introspectedTable);
bufferedWriter.write("for(i=0;i';\n");
bufferedWriter.write("var totalPage=res.totalPage;\n");
bufferedWriter.write("var page=res.page;\n");
bufferedWriter.write("var pageString=\"1 \";\n");
bufferedWriter.write("pageString+=\"\";\n");
bufferedWriter.write("if(page>=4){pageString+=\"\"+(page-2)+\" \";}\n");
bufferedWriter.write("if(page>=3){pageString+=\"\"+(page-1)+\" \";}\n");
bufferedWriter.write("if(page>=2 && page<=totalPage-1){pageString+=\"\"+(page)+\" \";}\n");
bufferedWriter.write("if(page<=totalPage-2){pageString+=\"\"+(page+1)+\" \";}\n");
bufferedWriter.write("if(page<=totalPage-3){pageString+=\"\"+(page+2)+\" \";}\n");
bufferedWriter.write("pageString+=\"\";\n");
bufferedWriter.write("pageString+=\"\"+(totalPage)+\" \";\n");
bufferedWriter.write("pageString+=\" 页码:\"+page+\"/\"+totalPage+\"
\";\n");
bufferedWriter.write("articleHtmlString = pageString+tableString+pageString;\n");
bufferedWriter.write("$('.class-article-content').html(articleHtmlString);\n");
bufferedWriter.write("}\n");
bufferedWriter.write("},\n");
bufferedWriter.write("error: function (message) {\n");
bufferedWriter.write("$('.class-table-article-section-content').html(message.responseText == undefined ? \"无法连接服务器\" : message.responseText);\n");
bufferedWriter.write("}\n");
bufferedWriter.write("});\n");
bufferedWriter.write("};\n");
}
public static void writeScriptTable(BufferedWriter bufferedWriter, IntrospectedTable introspectedTable) throws
IOException {
String tableId = /*MybatisUtilCommon.generateToken()*/"table-id";
bufferedWriter.write("tableString+=\"" +
"" +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" \";\n");
List introspectedColumns = introspectedTable.getAllColumns();
List introspectedColumnsPrimaryKey = introspectedTable.getPrimaryKeyColumns();
Iterator iterator = introspectedColumns.iterator();
String table = introspectedTable.getBaseRecordType();
String[] tableNames = table.split("\\.");
String tableName = tableNames[tableNames.length - 1];
while (iterator.hasNext()) {
IntrospectedColumn introspectedColumn = iterator.next();
FullyQualifiedJavaType fullyQualifiedJavaType = introspectedColumn
.getFullyQualifiedJavaType();
String columnName = introspectedColumn.getJavaProperty();
bufferedWriter.write("tableString+= \"" +
"\"+" +
("java.util.Date".equals(fullyQualifiedJavaType.getFullyQualifiedName()) ?
"timestampToTime(list[i]." + columnName + ")" :
"list[i]." + columnName
) +
"+\" " +
" \"+\n" +
"\" " +
" " +
" \";\n");
}
bufferedWriter.write("tableString+=' ';\n");
}
private static void writeScriptTableHead(BufferedWriter bufferedWriter, IntrospectedTable introspectedTable) throws
IOException {
List introspectedColumns = introspectedTable.getAllColumns();
Iterator iterator = introspectedColumns.iterator();
bufferedWriter.write("tableString+=\"加载 编辑 确认 取消 删除 \";\n");
while (iterator.hasNext()) {
IntrospectedColumn introspectedColumn = iterator.next();
FullyQualifiedJavaType fullyQualifiedJavaType = introspectedColumn
.getFullyQualifiedJavaType();
String columnName = introspectedColumn.getJavaProperty();
bufferedWriter.write("tableString+= \"" + columnName + " \";\n");
}
bufferedWriter.write("tableString+=' ';\n");
}
private static void writeScriptForEditLine(BufferedWriter bufferedWriter, IntrospectedTable introspectedTable) throws
IOException {
bufferedWriter.write("var editThisLine = function(tableId){");
bufferedWriter.write("$(\".class-span-\"+tableId).hide();\n");
bufferedWriter.write("$(\".class-image-edit-\"+tableId).hide();\n");
bufferedWriter.write("$(\".class-image-cancel-\"+tableId).show();\n");
bufferedWriter.write("$(\".class-image-confirm-\"+tableId).show();\n");
bufferedWriter.write("$(\".class-input-\"+tableId).show();\n");
bufferedWriter.write("$(\".class-image-showSelectBox-\"+tableId).show();\n");
bufferedWriter.write("}\n");
}
private static void writeScriptForCancelThisLine(BufferedWriter bufferedWriter, IntrospectedTable
introspectedTable) throws IOException {
bufferedWriter.write("var cancelThisLine = function(tableId){");
bufferedWriter.write("$(\".class-span-\"+tableId).show();\n");
bufferedWriter.write("$(\".class-image-edit-\"+tableId).show();\n");
bufferedWriter.write("$(\".class-input-\"+tableId).hide();\n");
bufferedWriter.write("$(\".class-image-cancel-\"+tableId).hide();\n");
bufferedWriter.write("$(\".class-image-confirm-\"+tableId).hide();\n");
bufferedWriter.write("$(\".class-image-showSelectBox-\"+tableId).hide();\n");
List introspectedColumns = introspectedTable.getAllColumns();
List introspectedColumnsPrimaryKey = introspectedTable.getPrimaryKeyColumns();
Iterator iterator = introspectedColumns.iterator();
while (iterator.hasNext()) {
IntrospectedColumn introspectedColumn = iterator.next();
String columnName = introspectedColumn.getJavaProperty();
bufferedWriter.write("$(\".class-input-\"+tableId+\"-" + columnName + "\").val($(\".class-span-\"+tableId+\"-" + columnName + "\").html());\n");
}
bufferedWriter.write("}\n");
}
private static void writeScriptForConfirmThisLine(BufferedWriter bufferedWriter, IntrospectedTable
introspectedTable, String tableName) throws IOException {
bufferedWriter.write("var confirmThisLine = function(tableId){");
bufferedWriter.write("$(\".class-image-loading-\"+tableId).show();\n");
bufferedWriter.write("$(\".class-input-\"+tableId).attr('disabled','disabled');\n");
bufferedWriter.write("var url=SERVER_URL+\"/v1/common/" + MybatisUtilCommon.getTableNameWithSlash(introspectedTable) + "/update\";\n");
bufferedWriter.write("var token=getLocalStorageItem(\"token\");\n");
bufferedWriter.write("$.ajax({\n");
bufferedWriter.write("url: url,\n");
bufferedWriter.write("type: \"post\",\n");
bufferedWriter.write("cache: false,\n");
bufferedWriter.write("async: true,\n");
bufferedWriter.write("headers: {\"token\": token },\n");
bufferedWriter.write("contentType: \"application/json\",\n");
bufferedWriter.write("data: JSON.stringify({\n");
List introspectedColumns = introspectedTable.getAllColumns();
List introspectedColumnsPrimaryKey = introspectedTable.getPrimaryKeyColumns();
Iterator iterator = introspectedColumns.iterator();
Integer columnCount = 0;
while (iterator.hasNext()) {
IntrospectedColumn introspectedColumn = iterator.next();
String columnName = introspectedColumn.getJavaProperty();
bufferedWriter.write("\"" + columnName + "\": $(\".class-input-\" + tableId + \"-" + columnName + "\").val(),\n");
columnCount += 1;
}
bufferedWriter.write("}),\n");
bufferedWriter.write("success: function (res) {\n");
bufferedWriter.write("$(\".class-image-loading-\"+tableId).hide();\n");
bufferedWriter.write("$(\".class-input-\"+tableId).removeAttr('disabled');\n");
bufferedWriter.write("if(res.status!=200){\n");
bufferedWriter.write("validResForContent(res);\n");
bufferedWriter.write("}else{\n");
introspectedColumns = introspectedTable.getAllColumns();
iterator = introspectedColumns.iterator();
while (iterator.hasNext()) {
IntrospectedColumn introspectedColumn = iterator.next();
String columnName = introspectedColumn.getJavaProperty();
bufferedWriter.write("$(\".class-span-\"+tableId+\"-" + columnName + "\").html($(\".class-input-\"+tableId+\"-" + columnName + "\").val());\n");
}
bufferedWriter.write("$(\".class-input-\"+tableId).hide();\n");
bufferedWriter.write("$(\".class-span-\"+tableId).show();\n");
bufferedWriter.write("$(\".class-image-edit-\"+tableId).show();\n");
bufferedWriter.write("$(\".class-image-cancel-\"+tableId).hide();\n");
bufferedWriter.write("$(\".class-image-confirm-\"+tableId).hide();\n");
bufferedWriter.write("$(\".class-image-showSelectBox-\"+tableId).hide();\n");
bufferedWriter.write("}\n");
bufferedWriter.write("}\n");
bufferedWriter.write("});\n");
bufferedWriter.write("}\n");
}
private static void writeScriptForAddLine(BufferedWriter bufferedWriter, IntrospectedTable
introspectedTable, String tableName) throws IOException {
bufferedWriter.write("var addLine =function(){\n");
bufferedWriter.write("$(\".class-div-add-line\").show();\n");
bufferedWriter.write("}\n");
}
private static void writeScriptForCloseThisLineDiv(BufferedWriter bufferedWriter, IntrospectedTable
introspectedTable, String tableName) throws IOException {
bufferedWriter.write("var closeThisLineDiv =function(){\n");
Boolean hasBlob = false;
List introspectedColumns = introspectedTable.getAllColumns();
//List introspectedColumnsPrimaryKey = introspectedTable.getPrimaryKeyColumns();
Iterator iterator = introspectedColumns.iterator();
while (iterator.hasNext()) {
IntrospectedColumn introspectedColumn = iterator.next();
String columnName = introspectedColumn.getJavaProperty();
if (introspectedColumn.getLength() > MybatisUtilCommon.COLUMN_FIELD_LENGTH || introspectedColumn.isBLOBColumn()) {
hasBlob = true;
}
}
if (hasBlob == true) {
bufferedWriter.write("location.href=location.href.split('#')[0];\n");
} else {
bufferedWriter.write("$(\".class-div-add-line\").hide();\n");
}
bufferedWriter.write("}\n");
}
private static void writeScriptForSubmitThisLineDiv(BufferedWriter bufferedWriter, IntrospectedTable
introspectedTable, String tableName) throws IOException {
bufferedWriter.write("var submitThisLineDiv = function(){\n");
bufferedWriter.write("$(\".class-div-add-line-button\").append(loadingImage);\n");
bufferedWriter.write("$('.class-input-add-line-column').attr('disabled','disabled');\n");
bufferedWriter.write("var url=SERVER-URL+\"/v1/common/" + MybatisUtilCommon.getTableNameWithSlash(introspectedTable) + "/create\";\n");
bufferedWriter.write("var token=getLocalStorageItem(\"token\");\n");
bufferedWriter.write("$.ajax({\n");
bufferedWriter.write("url: url,\n");
bufferedWriter.write("type: \"post\",\n");
bufferedWriter.write("cache: false,\n");
bufferedWriter.write("async: true,\n");
bufferedWriter.write("headers: {\"token\": token },\n");
bufferedWriter.write("contentType: \"application/json\",\n");
bufferedWriter.write("data: JSON.stringify({\n");
List introspectedColumns = introspectedTable.getAllColumns();
List introspectedColumnsPrimaryKey = introspectedTable.getPrimaryKeyColumns();
Iterator iterator = introspectedColumns.iterator();
while (iterator.hasNext()) {
IntrospectedColumn introspectedColumn = iterator.next();
String columnName = introspectedColumn.getJavaProperty();
if (introspectedColumn.getLength() > MybatisUtilCommon.COLUMN_FIELD_LENGTH || introspectedColumn.isBLOBColumn()) {
bufferedWriter.write("\"" + columnName + "\": $(\".class-input-add-line-" + columnName + "\").html()==\"\"?null:$(\".class-input-add-line-" + columnName + "\").html(),\n");
} else {
bufferedWriter.write("\"" + columnName + "\": $(\".class-input-add-line-" + columnName + "\").val()==\"\"?null:$(\".class-input-add-line-" + columnName + "\").val(),\n");
}
}
bufferedWriter.write("}),\n");
bufferedWriter.write("success: function (res) {\n");
bufferedWriter.write("$(\".class-div-add-line-button\").find('.class-loading-image-only').remove();\n");
bufferedWriter.write("$(\".class-input-add-line-column\").removeAttr('disabled');\n");
bufferedWriter.write("if(res.status!=200){\n");
bufferedWriter.write("validResForContent(res);\n");
bufferedWriter.write("}else{\n");
bufferedWriter.write("$(\".class-div-add-line\").hide();\n" /*+
"$(\".class-input-add-line-column\").val(\"\");\n"*/);
bufferedWriter.write("alert(res.message);\n");
bufferedWriter.write("}\n");
bufferedWriter.write("}\n");
bufferedWriter.write("});\n");
bufferedWriter.write("}\n");
}
private static void writeScriptForDeleteThisLineDiv(BufferedWriter bufferedWriter, IntrospectedTable
introspectedTable, String tableName) throws IOException {
bufferedWriter.write("var deleteThisLine = function(tableId){");
bufferedWriter.write("if(confirm('确认删除吗?')==0){return;}\n");
bufferedWriter.write("$(\".class-image-loading-\"+tableId).show();\n");
bufferedWriter.write("$(\".class-input-\"+tableId).attr('disabled','disabled');\n");
bufferedWriter.write("var url=SERVER_URL+\"/v1/common/" + MybatisUtilCommon.getTableNameWithSlash(introspectedTable) + "/delete");
List introspectedColumnsPrimaryKey = introspectedTable.getPrimaryKeyColumns();
Iterator iteratorPrimaryKey = introspectedColumnsPrimaryKey.iterator();
while (iteratorPrimaryKey.hasNext()) {
IntrospectedColumn introspectedColumn = iteratorPrimaryKey.next();
String columnName = introspectedColumn.getJavaProperty();
if (introspectedColumn.isBLOBColumn()) {
} else {
bufferedWriter.write("/\"+$(\".class-span-\"+tableId+\"-" + columnName + "\").html()+\"");
}
}
bufferedWriter.write("\";\n");
bufferedWriter.write("var token=getLocalStorageItem(\"token\");\n");
bufferedWriter.write("$.ajax({\n");
bufferedWriter.write("url: url,\n");
bufferedWriter.write("type: \"get\",\n");
bufferedWriter.write("cache: false,\n");
bufferedWriter.write("async: true,\n");
bufferedWriter.write("headers: {\"token\": token },\n");
bufferedWriter.write("contentType: \"application/json\",\n");
List introspectedColumns = introspectedTable.getPrimaryKeyColumns();
Iterator iterator = introspectedColumns.iterator();
bufferedWriter.write("success: function (res) {\n");
bufferedWriter.write("$(\".class-image-loading-\"+tableId).hide();\n");
bufferedWriter.write("$(\".class-input-\"+tableId).removeAttr('disabled');\n");
bufferedWriter.write("if(res.status!=200){\n");
bufferedWriter.write("validResForContent(res);\n");
bufferedWriter.write("}else{\n");
bufferedWriter.write("$('.class-tr-'+tableId).remove();");
bufferedWriter.write("}\n");
bufferedWriter.write("}\n");
bufferedWriter.write("});\n");
bufferedWriter.write("}\n");
}
public static void writeLoginPage(IntrospectedTable introspectedTable, String htmlPath, String modelUrl, String encryptPasswordMethod) {
File file = null;
OutputStream fileOutputStream = null;
BufferedWriter bufferedWriter = null;
try {
File folder = new File(htmlPath + "");
folder.mkdirs();
file = new File(htmlPath + "/page-login.html");
//如果文件不存在,则创建文件,如果已存在,则覆盖
file.createNewFile();
fileOutputStream = new FileOutputStream(file);
bufferedWriter = new BufferedWriter(new OutputStreamWriter(fileOutputStream, "utf-8"));
String table = introspectedTable.getBaseRecordType();
String tableName = table.replaceAll(modelUrl + ".", "");
bufferedWriter.write("\n");
bufferedWriter.write("\n");
bufferedWriter.write("\n");
bufferedWriter.write("\n");
bufferedWriter.write(" \n");
bufferedWriter.write(" \n");
bufferedWriter.write(" \n");
bufferedWriter.write(" \n");
bufferedWriter.write(" \n");
bufferedWriter.write(" \n");
bufferedWriter.write(" \n");
bufferedWriter.write("login \n");
bufferedWriter.write("\n");
writePageHead(bufferedWriter);
bufferedWriter.write("\n");
bufferedWriter.write("\n");
bufferedWriter.write("\n");
bufferedWriter.write("\n");
bufferedWriter.write("
后台登陆 \n");
bufferedWriter.write("\n");
bufferedWriter.write(" \n");
bufferedWriter.write(" \n");
bufferedWriter.write(" \n");
bufferedWriter.write("\n");
bufferedWriter.write(" \n");
bufferedWriter.write(" \n");
bufferedWriter.write("\n");
bufferedWriter.write(" \n");
bufferedWriter.write("\n");
bufferedWriter.write("
\n");
bufferedWriter.write("\n");
bufferedWriter.write("\n");
System.out.println("write to file success : " + file.getPath());
} catch (IOException e) {
e.printStackTrace();
} finally {
MybatisUtilCommon.closeBufferWriterAndFileOutputStream(fileOutputStream, bufferedWriter);
}
}
public static void writeTableJsPage(IntrospectedTable introspectedTable, String htmlPath, String modelUrl, String fileServer, String serverUrl, String basePackage, String aspectPackage) {
String table = introspectedTable.getBaseRecordType();
String tableName = table.replaceAll(modelUrl + ".", "");
File file = null;
OutputStream fileOutputStream = null;
BufferedWriter bufferedWriter = null;
try {
File folder = new File(htmlPath + "/content/" + MybatisUtilCommon.getLowerCaseAndDash(tableName) + "/js");
folder.mkdirs();
file = new File(htmlPath + "/content/" + MybatisUtilCommon.getLowerCaseAndDash(tableName) + "/js/" + MybatisUtilCommon.getLowerCaseAndDash(tableName) + ".js");
//如果文件不存在,则创建文件,如果已存在,则覆盖
file.createNewFile();
fileOutputStream = new FileOutputStream(file);
bufferedWriter = new BufferedWriter(new OutputStreamWriter(fileOutputStream, "utf-8"));
writeScriptOnlyForTablePage(bufferedWriter, introspectedTable);
writeScriptQueryFunction(bufferedWriter, introspectedTable, tableName);
System.out.println("write to file success : " + file.getPath());
} catch (
IOException e) {
e.printStackTrace();
} finally {
MybatisUtilCommon.closeBufferWriterAndFileOutputStream(fileOutputStream, bufferedWriter);
}
}
public static void writeTableCssPage(IntrospectedTable introspectedTable, String htmlPath, String modelUrl, String fileServer, String serverUrl, String basePackage, String aspectPackage) {
String table = introspectedTable.getBaseRecordType();
String tableName = table.replaceAll(modelUrl + ".", "");
File file = null;
OutputStream fileOutputStream = null;
BufferedWriter bufferedWriter = null;
try {
File folder = new File(htmlPath + "/content/" + MybatisUtilCommon.getLowerCaseAndDash(tableName) + "/css");
folder.mkdirs();
file = new File(htmlPath + "/content/" + MybatisUtilCommon.getLowerCaseAndDash(tableName) + "/css/" + MybatisUtilCommon.getLowerCaseAndDash(tableName) + ".css");
//如果文件不存在,则创建文件,如果已存在,则覆盖
file.createNewFile();
fileOutputStream = new FileOutputStream(file);
bufferedWriter = new BufferedWriter(new OutputStreamWriter(fileOutputStream, "utf-8"));
bufferedWriter.write("\n\n\n\n\n\n");
System.out.println("write to file success : " + file.getPath());
} catch (
IOException e) {
e.printStackTrace();
} finally {
MybatisUtilCommon.closeBufferWriterAndFileOutputStream(fileOutputStream, bufferedWriter);
}
}
public static void writeCssCommonServerCss(String htmlPath, String serverUrl, String tokenErrorStatus, String fileServer) {
File file = null;
OutputStream fileOutputStream = null;
BufferedWriter bufferedWriter = null;
try {
File folder = new File(htmlPath + "/content/page-common/css");
folder.mkdirs();
file = new File(htmlPath + "/content/page-common/css/server.css");
//如果文件不存在,则创建文件,如果已存在,则覆盖
file.createNewFile();
fileOutputStream = new FileOutputStream(file);
bufferedWriter = new BufferedWriter(new OutputStreamWriter(fileOutputStream, "utf-8"));
bufferedWriter.write("\n" +
".class-image-icon{\n" +
" width:12px;\n" +
"}\n" +
".class-span-page {\n" +
" cursor: pointer;\n" +
"}\n" +
"\n" +
".class-span-page:hover {\n" +
" background-color: #ffff00;\n" +
" cursor: pointer;\n" +
"}\n" +
"\n" +
".class-div-article-section-pager-top {\n" +
" margin-top: 8px;\n" +
" margin-bottom: 8px;\n" +
"}\n" +
"\n" +
".class-div-article-section-pager-bottom {\n" +
" margin-top: 8px;\n" +
" margin-bottom: 8px;\n" +
"}\n" +
"\n" +
".class-div-query-button-and-number {\n" +
" margin-top: 6px;\n" +
" height: 31px;\n" +
" padding-bottom: 6px;\n" +
"}\n" +
"\n" +
"table {\n" +
" empty-cells: show;\n" +
" border-collapse: collapse;\n" +
" margin: 0 auto;\n" +
"}\n" +
"\n" +
"td {\n" +
" height: 30px;\n" +
" text-align: center;\n" +
"}\n" +
"\n" +
"h1, h2, h3 {\n" +
" font-size: 12px;\n" +
" margin: 0;\n" +
" padding: 0;\n" +
"}\n" +
"\n" +
".table {\n" +
" width: 100%;\n" +
" border: 1px solid #cad9ea;\n" +
" color: #666;\n" +
"}\n" +
"\n" +
".table th {\n" +
" background-repeat: repeat-x;\n" +
" height: 30px;\n" +
"}\n" +
"\n" +
".table td, .table th {\n" +
" border: 1px solid #cad9ea;\n" +
" padding: 0 1em 0;\n" +
"}\n" +
"\n" +
".table tr.alter {\n" +
" background-color: #f5fafe;\n" +
"}\n" +
"\n" +
".btn {\n" +
" padding: 6px;\n" +
" color: #fff;\n" +
" text-decoration: none;\n" +
" cursor: pointer;\n" +
"}\n" +
"\n" +
".btn * {\n" +
" font-style: normal;\n" +
" background-repeat: no-repeat;\n" +
" display: block;\n" +
" position: relative;\n" +
"}\n" +
"\n" +
".btn i {\n" +
" background-position: top left;\n" +
" position: absolute;\n" +
" margin-bottom: -5px;\n" +
" top: 0;\n" +
" left: 0;\n" +
" width: 5px;\n" +
" height: 5px;\n" +
"}\n" +
"\n" +
".btn span {\n" +
" background-position: bottom left;\n" +
" left: -5px;\n" +
" padding: 0 0 5px 10px;\n" +
" margin-bottom: -5px;\n" +
"}\n" +
"\n" +
".btn span i {\n" +
" background-position: bottom right;\n" +
" margin-bottom: 0;\n" +
" position: absolute;\n" +
" left: 100%;\n" +
" width: 10px;\n" +
" height: 100%;\n" +
" top: 0;\n" +
"}\n" +
"\n" +
".btn span span {\n" +
" background-position: top right;\n" +
" position: absolute;\n" +
" right: -10px;\n" +
" margin-left: 10px;\n" +
" top: -5px;\n" +
" height: 0;\n" +
"}\n" +
"\n" +
"* html .btn span, * html .btn i {\n" +
" float: left;\n" +
" width: auto;\n" +
" background-image: none;\n" +
" cursor: pointer;\n" +
"}\n" +
"\n" +
".btn.pink {\n" +
" background: #e1a;\n" +
"}\n" +
"\n" +
".btn:hover {\n" +
" background-color: #F66666;\n" +
"}\n" +
"\n" +
".btn:active {\n" +
" background-color: #444;\n" +
"}\n" +
"\n" +
".btn[class] {\n" +
" background-position: bottom;\n" +
"}\n" +
"\n" +
"* html .btn {\n" +
" border: 3px double #aaa;\n" +
"}\n" +
"\n" +
"* html .btn.pink {\n" +
" border-color: #e1a;\n" +
"}\n" +
"\n" +
"* html .btn:hover {\n" +
" border-color: #F66666;\n" +
"}\n" +
"\n" +
"p {\n" +
" clear: both;\n" +
" padding-bottom: 2em;\n" +
"}\n" +
"\n" +
"form {\n" +
" margin-top: 2em;\n" +
"}\n" +
"\n" +
"form p .btn {\n" +
" margin-right: 1em;\n" +
"}\n" +
"\n" +
"textarea {\n" +
" margin: 1em 0;\n\n" +
" font-family: Inconsolata, Consolas, Courier, \"Courier New\", sans-serif;\n" +
"}\n" +
".class-button-after-input:hover{\n" +
" background-color:#F66666;\n" +
"}\n" +
".class-button-query{\n" +
"\n" +
"}\n");
System.out.println("write to file success : " + file.getPath());
} catch (IOException e) {
e.printStackTrace();
} finally {
MybatisUtilCommon.closeBufferWriterAndFileOutputStream(fileOutputStream, bufferedWriter);
}
}
public static void writeJsCommonValueJs(String htmlPath, String serverUrl, String tokenErrorStatus, String fileServer) {
if (serverUrl == null) {
serverUrl = "http://localhost:8080/";
}
File file = null;
OutputStream fileOutputStream = null;
BufferedWriter bufferedWriter = null;
try {
File folder = new File(htmlPath + "/content/page-common/js");
folder.mkdirs();
file = new File(htmlPath + "/content/page-common/js/common-value.js");
//如果文件不存在,则创建文件,如果已存在,则覆盖
file.createNewFile();
fileOutputStream = new FileOutputStream(file);
bufferedWriter = new BufferedWriter(new OutputStreamWriter(fileOutputStream, "utf-8"));
bufferedWriter.write("var SERVER_URL='" + serverUrl + "';\n");
bufferedWriter.write("var loadingImage = \"\";\n");
System.out.println("write to file success : " + file.getPath());
} catch (IOException e) {
e.printStackTrace();
} finally {
MybatisUtilCommon.closeBufferWriterAndFileOutputStream(fileOutputStream, bufferedWriter);
}
}
public static void writeTableJsCustomTableJs(IntrospectedTable introspectedTable, String htmlPath, String modelUrl, String fileServer, String serverUrl, String basePackage, String aspectPackage) {
String table = introspectedTable.getBaseRecordType();
String tableName = table.replaceAll(modelUrl + ".", "");
if (serverUrl == null) {
serverUrl = "http://localhost:8080/";
}
File file = null;
OutputStream fileOutputStream = null;
BufferedWriter bufferedWriter = null;
try {
File folder = new File(htmlPath + "/custom/" + MybatisUtilCommon.getLowerCaseAndDash(tableName) + "/js");
folder.mkdirs();
file = new File(htmlPath + "/custom/" + MybatisUtilCommon.getLowerCaseAndDash(tableName) + "/js/custom-" + MybatisUtilCommon.getLowerCaseAndDash(tableName) + ".js");
//如果文件不存在,则创建文件,如果已存在,则覆盖
if (!file.exists()) {
file.createNewFile();
fileOutputStream = new FileOutputStream(file);
bufferedWriter = new BufferedWriter(new OutputStreamWriter(fileOutputStream, "utf-8"));
bufferedWriter.write("\n");
System.out.println("write to file success : " + file.getPath());
} else {
System.out.println("write to file success : " + file.getPath());
}
} catch (IOException e) {
e.printStackTrace();
} finally {
MybatisUtilCommon.closeBufferWriterAndFileOutputStream(fileOutputStream, bufferedWriter);
}
}
public static void writeTableCssCustomTableCss(IntrospectedTable introspectedTable, String htmlPath, String modelUrl, String fileServer, String serverUrl, String basePackage, String aspectPackage) {
String table = introspectedTable.getBaseRecordType();
String tableName = table.replaceAll(modelUrl + ".", "");
if (serverUrl == null) {
serverUrl = "http://localhost:8080/";
}
File file = null;
OutputStream fileOutputStream = null;
BufferedWriter bufferedWriter = null;
try {
File folder = new File(htmlPath + "/custom/" + MybatisUtilCommon.getLowerCaseAndDash(tableName) + "/css");
folder.mkdirs();
file = new File(htmlPath + "/custom/" + MybatisUtilCommon.getLowerCaseAndDash(tableName) + "/css/custom-" + MybatisUtilCommon.getLowerCaseAndDash(tableName) + ".css");
//如果文件不存在,则创建文件,如果已存在,则覆盖
if (!file.exists()) {
file.createNewFile();
fileOutputStream = new FileOutputStream(file);
bufferedWriter = new BufferedWriter(new OutputStreamWriter(fileOutputStream, "utf-8"));
bufferedWriter.write("\n");
System.out.println("write to file success : " + file.getPath());
} else {
System.out.println("write to file success : " + file.getPath());
}
} catch (IOException e) {
e.printStackTrace();
} finally {
MybatisUtilCommon.closeBufferWriterAndFileOutputStream(fileOutputStream, bufferedWriter);
}
}
public static void writeCustomIndexCss(IntrospectedTable introspectedTable, String htmlPath, String modelUrl) {
File file = null;
OutputStream fileOutputStream = null;
BufferedWriter bufferedWriter = null;
try {
File folder = new File(htmlPath + "/custom/index/css");
folder.mkdirs();
file = new File(htmlPath + "/custom/index/css/custom-index.css");
//如果文件不存在,则创建文件,如果已存在,则覆盖
if (!file.exists()) {
file.createNewFile();
fileOutputStream = new FileOutputStream(file);
bufferedWriter = new BufferedWriter(new OutputStreamWriter(fileOutputStream, "utf-8"));
bufferedWriter.write("\n");
System.out.println("write to file success : " + file.getPath());
} else {
System.out.println("write to file success : " + file.getPath());
}
} catch (IOException e) {
e.printStackTrace();
} finally {
MybatisUtilCommon.closeBufferWriterAndFileOutputStream(fileOutputStream, bufferedWriter);
}
}
public static void writeCustomIndexJs(IntrospectedTable introspectedTable, String htmlPath, String modelUrl) {
File file = null;
OutputStream fileOutputStream = null;
BufferedWriter bufferedWriter = null;
try {
File folder = new File(htmlPath + "/custom/index/js");
folder.mkdirs();
file = new File(htmlPath + "/custom/index/js/custom-index.js");
//如果文件不存在,则创建文件,如果已存在,则覆盖
if (!file.exists()) {
file.createNewFile();
fileOutputStream = new FileOutputStream(file);
bufferedWriter = new BufferedWriter(new OutputStreamWriter(fileOutputStream, "utf-8"));
bufferedWriter.write("\n");
System.out.println("write to file success : " + file.getPath());
} else {
System.out.println("write to file success : " + file.getPath());
}
} catch (IOException e) {
e.printStackTrace();
} finally {
MybatisUtilCommon.closeBufferWriterAndFileOutputStream(fileOutputStream, bufferedWriter);
}
}
}