提交 d30171fd authored 作者: javamaoyang's avatar javamaoyang

init

上级 f6b09a5e
流水线 #8624 已失败 于阶段
in 6 seconds
...@@ -48,6 +48,12 @@ ...@@ -48,6 +48,12 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency> <dependency>
<groupId>org.json</groupId> <groupId>org.json</groupId>
<artifactId>json</artifactId> <artifactId>json</artifactId>
......
...@@ -2,10 +2,16 @@ package com.example.controller; ...@@ -2,10 +2,16 @@ package com.example.controller;
import com.example.baidu.ueditor.ActionEnter; import com.example.baidu.ueditor.ActionEnter;
import com.example.baidu.ueditor.ConfigManager; import com.example.baidu.ueditor.ConfigManager;
import com.example.util.AliyunOSSConfigConstant;
import com.example.util.AliyunOSSUtil;
import com.example.util.DataConfig;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -13,17 +19,20 @@ import javax.servlet.http.HttpServletRequest; ...@@ -13,17 +19,20 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;
@Controller @Controller
public class UEditorController { public class UEditorController {
@Value("${oss.host}") private Map<String, AliyunOSSConfigConstant> projectMap = new HashMap<String, AliyunOSSConfigConstant>();
private String imageUrl;
@Autowired
private AliyunOSSUtil aliyunOSSUtil;
@Value("${oss.folder}")
private String ossPath;
@RequestMapping("/") @RequestMapping("/")
private String showPage() { private String showPage() {
...@@ -33,7 +42,12 @@ public class UEditorController { ...@@ -33,7 +42,12 @@ public class UEditorController {
@RequestMapping(value = "/config") @RequestMapping(value = "/config")
public void config(HttpServletRequest request, HttpServletResponse response) { public void config(HttpServletRequest request, HttpServletResponse response) {
String env=request.getParameter("env");
AliyunOSSConfigConstant aliyunOSSConfigConstant=aliyunOSSUtil.getOssConfig(env);
//OSSConfigConstant oSSConfigConstant=ev.getProperty("projectMap.woyou", OSSConfigConstant.class);
response.setContentType("application/json"); response.setContentType("application/json");
String rootPath = request.getSession().getServletContext().getRealPath("/"); String rootPath = request.getSession().getServletContext().getRealPath("/");
try { try {
...@@ -43,8 +57,8 @@ public class UEditorController { ...@@ -43,8 +57,8 @@ public class UEditorController {
String exec = new ActionEnter(request, rootPath).exec(); String exec = new ActionEnter(request, rootPath).exec();
//exec=exec.replace("\"imageUrlPrefix\":\"https://imgb.mofangx.com/\"","'imageUrlPrefix':'"+imageUrlPrefix+"'"); //exec=exec.replace("\"imageUrlPrefix\":\"https://imgb.mofangx.com/\"","'imageUrlPrefix':'"+imageUrlPrefix+"'");
exec=exec.replace("{imgUrl}",imageUrl+"/"); exec=exec.replace("{imgUrl}",aliyunOSSConfigConstant.getHost()+"/");
exec=exec.replace("{basePath}",ossPath); exec=exec.replace("{basePath}",aliyunOSSConfigConstant.getFolder());
//exec=exec.replace("'basePath':'erp/'","'basePath':'"+ossPath+"'"); //exec=exec.replace("'basePath':'erp/'","'basePath':'"+ossPath+"'");
......
package com.example.util; package com.example.util;
import com.aliyun.oss.ClientException; import com.aliyun.oss.ClientException;
import com.aliyun.oss.OSSClient; import com.aliyun.oss.OSSClient;
import com.aliyun.oss.OSSException; import com.aliyun.oss.OSSException;
import com.aliyun.oss.model.*; import com.aliyun.oss.model.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired; import org.slf4j.Logger;
import org.springframework.stereotype.Component; import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import javax.activation.MimetypesFileTypeMap; import org.springframework.beans.factory.annotation.Autowired;
import javax.imageio.ImageIO; import org.springframework.beans.factory.annotation.Value;
import java.awt.*; import org.springframework.stereotype.Component;
import java.io.File;
import java.io.IOException; import javax.activation.MimetypesFileTypeMap;
import java.text.SimpleDateFormat; import javax.imageio.ImageIO;
import java.util.Date; import java.awt.*;
import java.util.UUID; import java.io.File;
import java.io.IOException;
/** import java.lang.reflect.Field;
* 〈一句话功能简述〉<br> import java.lang.reflect.Modifier;
* 〈阿里云OSS服务相关工具类〉 import java.text.SimpleDateFormat;
* import java.util.Date;
* @author xunyong import java.util.LinkedHashMap;
* @create 2019/2/21 import java.util.Map;
* @since 1.0.0 import java.util.UUID;
*/
@Component /**
public class AliyunOSSUtil { * 〈一句话功能简述〉<br>
* 〈阿里云OSS服务相关工具类〉
private static final Logger logger = LoggerFactory.getLogger(AliyunOSSUtil.class); *
///private static String bucketName = AliyunOSSConfigConstant.BUCKE_NAME; * @author xunyong
private static String FILE_URL; * @create 2019/2/21
//private static String endpoint = AliyunOSSConfigConstant.END_POINT; * @since 1.0.0
// private static String accessKeyId = AliyunOSSConfigConstant.AccessKey_ID; */
// private static String accessKeySecret = AliyunOSSConfigConstant.AccessKey_Secret; @Component
// private static String fileHost = AliyunOSSConfigConstant.FILE_HOST; public class AliyunOSSUtil {
@Autowired private static final Logger logger = LoggerFactory.getLogger(AliyunOSSUtil.class);
private AliyunOSSConfigConstant aliyunOSSConfigConstant; /// private static String bucketName = AliyunOSSConfigConstant.BUCKE_NAME;
private static String FILE_URL;
/** // private static String endpoint = AliyunOSSConfigConstant.END_POINT;
* Description: upolad // private static String accessKeyId = AliyunOSSConfigConstant.AccessKey_ID;
* 嵌入ueditor的上传 // private static String accessKeySecret =
* // AliyunOSSConfigConstant.AccessKey_Secret;
* @param file // private static String fileHost = AliyunOSSConfigConstant.FILE_HOST;
* @param fileUrl
* @return java.lang.String //@Autowired
* @date 2019/2/21 16:40 private AliyunOSSConfigConstant aliyunOSSConfigConstant=new AliyunOSSConfigConstant();
*/
@Autowired
public String upolad(File file, String fileUrl) { private DataConfig dataConfig;
String bucketName=aliyunOSSConfigConstant.getBucketName();
// 创建OSSClient实例。
OSSClient ossClient = new OSSClient(aliyunOSSConfigConstant.getHost(), aliyunOSSConfigConstant.getKeyId(), aliyunOSSConfigConstant.getKeySecret()); /**
try { * Description: upolad 嵌入ueditor的上传
// 判断容器是否存在,不存在就创建 *
if (!ossClient.doesBucketExist(bucketName)) { * @param file
ossClient.createBucket(bucketName); * @param fileUrl
CreateBucketRequest createBucketRequest = new CreateBucketRequest(bucketName); * @return java.lang.String
createBucketRequest.setCannedACL(CannedAccessControlList.PublicRead); * @date 2019/2/21 16:40
ossClient.createBucket(createBucketRequest); */
}
String fileType=new MimetypesFileTypeMap().getContentType(file); public AliyunOSSConfigConstant getOssConfig(String env) {
ObjectMetadata meta = new ObjectMetadata(); // 创建上传Object的Metadata
meta.setContentType(AliyunOSSUtil.contentType(fileType)); // 设置上传内容类型 dataConfig.getUeditor().forEach(oSSConfigConstant -> {
meta.setCacheControl("no-cache");
if(oSSConfigConstant.getEnv().equals(env)) {
PutObjectResult result = ossClient.putObject(new PutObjectRequest(bucketName, fileUrl, file,meta)); BeanUtils.copyProperties(oSSConfigConstant, aliyunOSSConfigConstant);
// 设置权限(公开读) }
ossClient.setBucketAcl(bucketName, CannedAccessControlList.PublicRead); });
if (result != null) {
logger.info("------OSS文件上传成功------" + fileUrl); return aliyunOSSConfigConstant;
} }
} finally {
if (ossClient != null) { public String upolad(File file, String fileUrl) {
ossClient.shutdown();
}
} String bucketName = aliyunOSSConfigConstant.getBucketName();
return fileUrl; // 创建OSSClient实例。
} OSSClient ossClient = new OSSClient(aliyunOSSConfigConstant.getHost(), aliyunOSSConfigConstant.getKeyId(),
aliyunOSSConfigConstant.getKeySecret());
/** try {
* 上传文件。 // 判断容器是否存在,不存在就创建
* if (!ossClient.doesBucketExist(bucketName)) {
* @param file 需要上传的文件路径 ossClient.createBucket(bucketName);
* @return 如果上传的文件是图片的话,会返回图片的"URL",如果非图片的话会返回"非图片,不可预览。文件路径为:+文件路径" CreateBucketRequest createBucketRequest = new CreateBucketRequest(bucketName);
*/ createBucketRequest.setCannedACL(CannedAccessControlList.PublicRead);
public String upLoad(File file) { ossClient.createBucket(createBucketRequest);
// 默认值为:true }
boolean isImage = true; String fileType = new MimetypesFileTypeMap().getContentType(file);
// 判断所要上传的图片是否是图片,图片可以预览,其他文件不提供通过URL预览 ObjectMetadata meta = new ObjectMetadata(); // 创建上传Object的Metadata
try { meta.setContentType(AliyunOSSUtil.contentType(fileType)); // 设置上传内容类型
Image image = ImageIO.read(file); meta.setCacheControl("no-cache");
isImage = image == null ? false : true;
} catch (IOException e) { PutObjectResult result = ossClient.putObject(new PutObjectRequest(bucketName, fileUrl, file, meta));
e.printStackTrace(); // 设置权限(公开读)
} ossClient.setBucketAcl(bucketName, CannedAccessControlList.PublicRead);
if (result != null) {
logger.info("------OSS文件上传开始--------" + file.getName()); logger.info("------OSS文件上传成功------" + fileUrl);
}
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); } finally {
String dateStr = format.format(new Date()); if (ossClient != null) {
ossClient.shutdown();
// 判断文件 }
if (file == null) { }
return null; return fileUrl;
} }
String bucketName=aliyunOSSConfigConstant.getBucketName(); /**
* 上传文件。
// 创建OSSClient实例。 *
OSSClient ossClient = new OSSClient(aliyunOSSConfigConstant.getHost(), aliyunOSSConfigConstant.getKeyId(), aliyunOSSConfigConstant.getKeySecret()); * @param file 需要上传的文件路径
try { * @return 如果上传的文件是图片的话,会返回图片的"URL",如果非图片的话会返回"非图片,不可预览。文件路径为:+文件路径"
// 判断容器是否存在,不存在就创建 */
if (!ossClient.doesBucketExist(bucketName)) { public String upLoad(File file) {
ossClient.createBucket(bucketName); // 默认值为:true
CreateBucketRequest createBucketRequest = new CreateBucketRequest(bucketName); boolean isImage = true;
createBucketRequest.setCannedACL(CannedAccessControlList.PublicRead); // 判断所要上传的图片是否是图片,图片可以预览,其他文件不提供通过URL预览
ossClient.createBucket(createBucketRequest); try {
} Image image = ImageIO.read(file);
// 设置文件路径和名称 isImage = image == null ? false : true;
String fileUrl = aliyunOSSConfigConstant.getFolder() + UUID.randomUUID().toString().replace("-", "") + "-" + file.getName(); } catch (IOException e) {
if (isImage) {//如果是图片,则图片的URL为:.... e.printStackTrace();
FILE_URL = aliyunOSSConfigConstant.getHost() + "/" + fileUrl; }
} else {
FILE_URL = "非图片,不可预览。文件路径为:" + fileUrl; logger.info("------OSS文件上传开始--------" + file.getName());
}
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
// 上传文件 String dateStr = format.format(new Date());
PutObjectResult result = ossClient.putObject(new PutObjectRequest(bucketName, fileUrl, file));
// 设置权限(公开读) // 判断文件
ossClient.setBucketAcl(bucketName, CannedAccessControlList.PublicRead); if (file == null) {
if (result != null) { return null;
logger.info("------OSS文件上传成功------" + fileUrl); }
}
} catch (OSSException oe) { String bucketName = aliyunOSSConfigConstant.getBucketName();
logger.error(oe.getMessage());
} catch (ClientException ce) { // 创建OSSClient实例。
logger.error(ce.getErrorMessage()); OSSClient ossClient = new OSSClient(aliyunOSSConfigConstant.getHost(), aliyunOSSConfigConstant.getKeyId(),
} finally { aliyunOSSConfigConstant.getKeySecret());
if (ossClient != null) { try {
ossClient.shutdown(); // 判断容器是否存在,不存在就创建
} if (!ossClient.doesBucketExist(bucketName)) {
} ossClient.createBucket(bucketName);
return FILE_URL; CreateBucketRequest createBucketRequest = new CreateBucketRequest(bucketName);
} createBucketRequest.setCannedACL(CannedAccessControlList.PublicRead);
ossClient.createBucket(createBucketRequest);
}
/** // 设置文件路径和名称
* 通过文件名下载文件 String fileUrl = aliyunOSSConfigConstant.getFolder() + UUID.randomUUID().toString().replace("-", "") + "-"
* + file.getName();
* @param objectName 要下载的文件名 if (isImage) {// 如果是图片,则图片的URL为:....
* @param localFileName 本地要创建的文件名 FILE_URL = aliyunOSSConfigConstant.getHost() + "/" + fileUrl;
*/ } else {
public void downloadFile(String objectName, String localFileName) { FILE_URL = "非图片,不可预览。文件路径为:" + fileUrl;
}
// 创建OSSClient实例。
OSSClient ossClient = new OSSClient(aliyunOSSConfigConstant.getHost(), aliyunOSSConfigConstant.getKeyId(), aliyunOSSConfigConstant.getKeySecret()); // 上传文件
// 下载OSS文件到本地文件。如果指定的本地文件存在会覆盖,不存在则新建。 PutObjectResult result = ossClient.putObject(new PutObjectRequest(bucketName, fileUrl, file));
ossClient.getObject(new GetObjectRequest(aliyunOSSConfigConstant.getBucketName(), objectName), new File(localFileName)); // 设置权限(公开读)
// 关闭OSSClient。 ossClient.setBucketAcl(bucketName, CannedAccessControlList.PublicRead);
ossClient.shutdown(); if (result != null) {
} logger.info("------OSS文件上传成功------" + fileUrl);
}
/** } catch (OSSException oe) {
* 列举 test 文件下所有的文件 logger.error(oe.getMessage());
*/ } catch (ClientException ce) {
public void listFile() { logger.error(ce.getErrorMessage());
// 创建OSSClient实例。 } finally {
OSSClient ossClient = new OSSClient(aliyunOSSConfigConstant.getHost(), aliyunOSSConfigConstant.getKeyId(), aliyunOSSConfigConstant.getKeySecret()); if (ossClient != null) {
// 构造ListObjectsRequest请求。 ossClient.shutdown();
ListObjectsRequest listObjectsRequest = new ListObjectsRequest(aliyunOSSConfigConstant.getBucketName()); }
}
// 设置prefix参数来获取fun目录下的所有文件。 return FILE_URL;
listObjectsRequest.setPrefix("test/"); }
// 列出文件。
ObjectListing listing = ossClient.listObjects(listObjectsRequest); /**
// 遍历所有文件。 * 通过文件名下载文件
System.out.println("Objects:"); *
for (OSSObjectSummary objectSummary : listing.getObjectSummaries()) { * @param objectName 要下载的文件名
System.out.println(objectSummary.getKey()); * @param localFileName 本地要创建的文件名
} */
// 遍历所有commonPrefix。 public void downloadFile(String objectName, String localFileName) {
System.out.println("CommonPrefixes:");
for (String commonPrefix : listing.getCommonPrefixes()) { // 创建OSSClient实例。
System.out.println(commonPrefix); OSSClient ossClient = new OSSClient(aliyunOSSConfigConstant.getHost(), aliyunOSSConfigConstant.getKeyId(),
} aliyunOSSConfigConstant.getKeySecret());
// 关闭OSSClient。 // 下载OSS文件到本地文件。如果指定的本地文件存在会覆盖,不存在则新建。
ossClient.shutdown(); ossClient.getObject(new GetObjectRequest(aliyunOSSConfigConstant.getBucketName(), objectName),
} new File(localFileName));
// 关闭OSSClient。
ossClient.shutdown();
}
/**
* /**
* @MethodName: contentType * 列举 test 文件下所有的文件
* @Description: 获取文件类型 */
* @param FileType public void listFile() {
* @return String // 创建OSSClient实例。
*/ OSSClient ossClient = new OSSClient(aliyunOSSConfigConstant.getHost(), aliyunOSSConfigConstant.getKeyId(),
private static String contentType(String fileType){ aliyunOSSConfigConstant.getKeySecret());
fileType = fileType.toLowerCase(); // 构造ListObjectsRequest请求。
String contentType = ""; ListObjectsRequest listObjectsRequest = new ListObjectsRequest(aliyunOSSConfigConstant.getBucketName());
switch (fileType) {
case "bmp": contentType = "image/bmp"; // 设置prefix参数来获取fun目录下的所有文件。
break; listObjectsRequest.setPrefix("test/");
case "gif": contentType = "image/gif"; // 列出文件。
break; ObjectListing listing = ossClient.listObjects(listObjectsRequest);
case "png": // 遍历所有文件。
case "jpeg": System.out.println("Objects:");
case "jpg": contentType = "image/jpeg"; for (OSSObjectSummary objectSummary : listing.getObjectSummaries()) {
break; System.out.println(objectSummary.getKey());
case "html":contentType = "text/html"; }
break; // 遍历所有commonPrefix。
case "txt": contentType = "text/plain"; System.out.println("CommonPrefixes:");
break; for (String commonPrefix : listing.getCommonPrefixes()) {
case "vsd": contentType = "application/vnd.visio"; System.out.println(commonPrefix);
break; }
case "ppt": // 关闭OSSClient。
case "pptx":contentType = "application/vnd.ms-powerpoint"; ossClient.shutdown();
break; }
case "doc":
case "docx":contentType = "application/msword"; /**
break; *
case "xml":contentType = "text/xml"; * @MethodName: contentType
break; * @Description: 获取文件类型
case "mp4":contentType = "video/mp4"; * @param FileType
break; * @return String
default: contentType = "image/jpeg"; */
break; private static String contentType(String fileType) {
} fileType = fileType.toLowerCase();
return contentType; String contentType = "";
} switch (fileType) {
case "bmp":
contentType = "image/bmp";
break;
case "gif":
contentType = "image/gif";
break;
case "png":
case "jpeg":
case "jpg":
contentType = "image/jpeg";
break;
case "html":
contentType = "text/html";
break;
case "txt":
contentType = "text/plain";
break;
case "vsd":
contentType = "application/vnd.visio";
break;
case "ppt":
case "pptx":
contentType = "application/vnd.ms-powerpoint";
break;
case "doc":
case "docx":
contentType = "application/msword";
break;
case "xml":
contentType = "text/xml";
break;
case "mp4":
contentType = "video/mp4";
break;
default:
contentType = "image/jpeg";
break;
}
return contentType;
}
} }
\ No newline at end of file
/** /**
* ueditor完整配置项 * ueditor完整配置项
* 可以在这里配置整个编辑器的特性 * 可以在这里配置整个编辑器的特性
*/ */
/**************************提示******************************** /**************************提示********************************
* 所有被注释的配置项均为UEditor默认值。 * 所有被注释的配置项均为UEditor默认值。
* 修改默认配置请首先确保已经完全明确该参数的真实用途。 * 修改默认配置请首先确保已经完全明确该参数的真实用途。
* 主要有两种修改方案,一种是取消此处注释,然后修改成对应参数;另一种是在实例化编辑器时传入对应参数。 * 主要有两种修改方案,一种是取消此处注释,然后修改成对应参数;另一种是在实例化编辑器时传入对应参数。
* 当升级编辑器时,可直接使用旧版配置文件替换新版配置文件,不用担心旧版配置文件中因缺少新功能所需的参数而导致脚本报错。 * 当升级编辑器时,可直接使用旧版配置文件替换新版配置文件,不用担心旧版配置文件中因缺少新功能所需的参数而导致脚本报错。
**************************提示********************************/ **************************提示********************************/
(function () { (function () {
/** /**
* 编辑器资源文件根路径。它所表示的含义是:以编辑器实例化页面为当前路径,指向编辑器资源文件(即dialog等文件夹)的路径。 * 编辑器资源文件根路径。它所表示的含义是:以编辑器实例化页面为当前路径,指向编辑器资源文件(即dialog等文件夹)的路径。
* 鉴于很多同学在使用编辑器的时候出现的种种路径问题,此处强烈建议大家使用"相对于网站根目录的相对路径"进行配置。 * 鉴于很多同学在使用编辑器的时候出现的种种路径问题,此处强烈建议大家使用"相对于网站根目录的相对路径"进行配置。
* "相对于网站根目录的相对路径"也就是以斜杠开头的形如"/myProject/ueditor/"这样的路径。 * "相对于网站根目录的相对路径"也就是以斜杠开头的形如"/myProject/ueditor/"这样的路径。
* 如果站点中有多个不在同一层级的页面需要实例化编辑器,且引用了同一UEditor的时候,此处的URL可能不适用于每个页面的编辑器。 * 如果站点中有多个不在同一层级的页面需要实例化编辑器,且引用了同一UEditor的时候,此处的URL可能不适用于每个页面的编辑器。
* 因此,UEditor提供了针对不同页面的编辑器可单独配置的根路径,具体来说,在需要实例化编辑器的页面最顶部写上如下代码即可。当然,需要令此处的URL等于对应的配置。 * 因此,UEditor提供了针对不同页面的编辑器可单独配置的根路径,具体来说,在需要实例化编辑器的页面最顶部写上如下代码即可。当然,需要令此处的URL等于对应的配置。
* window.UEDITOR_HOME_URL = "/xxxx/xxxx/"; * window.UEDITOR_HOME_URL = "/xxxx/xxxx/";
*/ */
var URL = window.UEDITOR_HOME_URL || getUEBasePath(); var URL = window.UEDITOR_HOME_URL || getUEBasePath();
/** var env=getQueryString("env");
* 配置项主体。注意,此处所有涉及到路径的配置别遗漏URL变量。
*/ /**
window.UEDITOR_CONFIG = { * 配置项主体。注意,此处所有涉及到路径的配置别遗漏URL变量。
*/
//为编辑器实例添加一个路径,这个不能被注释 window.UEDITOR_CONFIG = {
UEDITOR_HOME_URL: URL
//为编辑器实例添加一个路径,这个不能被注释
// 服务器统一请求接口路径 UEDITOR_HOME_URL: URL
, serverUrl: URL + "config"
// 服务器统一请求接口路径
//工具栏上的所有的功能按钮和下拉框,可以在new编辑器的实例时选择自己需要的重新定义 , serverUrl: URL + "config?env="+env
, toolbars: [[
'fullscreen', 'source', '|', 'undo', 'redo', '|', //工具栏上的所有的功能按钮和下拉框,可以在new编辑器的实例时选择自己需要的重新定义
'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|', , toolbars: [[
'rowspacingtop', 'rowspacingbottom', 'lineheight', '|', 'fullscreen', 'source', '|', 'undo', 'redo', '|',
'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|', 'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
'directionalityltr', 'directionalityrtl', 'indent', '|', 'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|', 'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|', 'directionalityltr', 'directionalityrtl', 'indent', '|',
'simpleupload', 'insertimage', 'emotion', 'scrawl', 'insertvideo', 'music', 'attachment', 'map', 'gmap', 'insertframe', 'insertcode', 'webapp', 'pagebreak', 'template', 'background', '|', 'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
'horizontal', 'date', 'time', 'spechars', 'snapscreen', 'wordimage', '|', 'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|', 'simpleupload', 'insertimage', 'emotion', 'scrawl', 'insertvideo', 'music', 'attachment', 'map', 'gmap', 'insertframe', 'insertcode', 'webapp', 'pagebreak', 'template', 'background', '|',
'print', 'preview', 'searchreplace', 'drafts', 'help' 'horizontal', 'date', 'time', 'spechars', 'snapscreen', 'wordimage', '|',
]] 'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|',
//当鼠标放在工具栏上时显示的tooltip提示,留空支持自动多语言配置,否则以配置值为准 'print', 'preview', 'searchreplace', 'drafts', 'help'
//,labelMap:{ ]]
// 'anchor':'', 'undo':'' //当鼠标放在工具栏上时显示的tooltip提示,留空支持自动多语言配置,否则以配置值为准
//} //,labelMap:{
// 'anchor':'', 'undo':''
//语言配置项,默认是zh-cn。有需要的话也可以使用如下这样的方式来自动多语言切换,当然,前提条件是lang文件夹下存在对应的语言文件: //}
//lang值也可以通过自动获取 (navigator.language||navigator.browserLanguage ||navigator.userLanguage).toLowerCase()
//,lang:"zh-cn" //语言配置项,默认是zh-cn。有需要的话也可以使用如下这样的方式来自动多语言切换,当然,前提条件是lang文件夹下存在对应的语言文件:
//,langPath:URL +"lang/" //lang值也可以通过自动获取 (navigator.language||navigator.browserLanguage ||navigator.userLanguage).toLowerCase()
//,lang:"zh-cn"
//主题配置项,默认是default。有需要的话也可以使用如下这样的方式来自动多主题切换,当然,前提条件是themes文件夹下存在对应的主题文件: //,langPath:URL +"lang/"
//现有如下皮肤:default
//,theme:'default' //主题配置项,默认是default。有需要的话也可以使用如下这样的方式来自动多主题切换,当然,前提条件是themes文件夹下存在对应的主题文件:
//,themePath:URL +"themes/" //现有如下皮肤:default
//,theme:'default'
//,zIndex : 900 //编辑器层级的基数,默认是900 //,themePath:URL +"themes/"
//针对getAllHtml方法,会在对应的head标签中增加该编码设置。 //,zIndex : 900 //编辑器层级的基数,默认是900
//,charset:"utf-8"
//针对getAllHtml方法,会在对应的head标签中增加该编码设置。
//若实例化编辑器的页面手动修改的domain,此处需要设置为true //,charset:"utf-8"
//,customDomain:false
//若实例化编辑器的页面手动修改的domain,此处需要设置为true
//常用配置项目 //,customDomain:false
//,isShow : true //默认显示编辑器
//常用配置项目
//,textarea:'editorValue' // 提交表单时,服务器获取编辑器提交内容的所用的参数,多实例时可以给容器name属性,会将name给定的值最为每个实例的键值,不用每次实例化的时候都设置这个值 //,isShow : true //默认显示编辑器
//,initialContent:'欢迎使用ueditor!' //初始化编辑器的内容,也可以通过textarea/script给值,看官网例子 //,textarea:'editorValue' // 提交表单时,服务器获取编辑器提交内容的所用的参数,多实例时可以给容器name属性,会将name给定的值最为每个实例的键值,不用每次实例化的时候都设置这个值
//,autoClearinitialContent:true //是否自动清除编辑器初始内容,注意:如果focus属性设置为true,这个也为真,那么编辑器一上来就会触发导致初始化的内容看不到了 //,initialContent:'欢迎使用ueditor!' //初始化编辑器的内容,也可以通过textarea/script给值,看官网例子
//,focus:false //初始化时,是否让编辑器获得焦点true或false //,autoClearinitialContent:true //是否自动清除编辑器初始内容,注意:如果focus属性设置为true,这个也为真,那么编辑器一上来就会触发导致初始化的内容看不到了
//如果自定义,最好给p标签如下的行高,要不输入中文时,会有跳动感 //,focus:false //初始化时,是否让编辑器获得焦点true或false
//,initialStyle:'p{line-height:1em}'//编辑器层级的基数,可以用来改变字体等
//如果自定义,最好给p标签如下的行高,要不输入中文时,会有跳动感
//,iframeCssUrl: URL + '/themes/iframe.css' //给编辑区域的iframe引入一个css文件 //,initialStyle:'p{line-height:1em}'//编辑器层级的基数,可以用来改变字体等
//indentValue //,iframeCssUrl: URL + '/themes/iframe.css' //给编辑区域的iframe引入一个css文件
//首行缩进距离,默认是2em
//,indentValue:'2em' //indentValue
//首行缩进距离,默认是2em
//,initialFrameWidth:1000 //初始化编辑器宽度,默认1000 //,indentValue:'2em'
//,initialFrameHeight:320 //初始化编辑器高度,默认320
//,initialFrameWidth:1000 //初始化编辑器宽度,默认1000
//,readonly : false //编辑器初始化结束后,编辑区域是否是只读的,默认是false //,initialFrameHeight:320 //初始化编辑器高度,默认320
//,autoClearEmptyNode : true //getContent时,是否删除空的inlineElement节点(包括嵌套的情况) //,readonly : false //编辑器初始化结束后,编辑区域是否是只读的,默认是false
//启用自动保存 //,autoClearEmptyNode : true //getContent时,是否删除空的inlineElement节点(包括嵌套的情况)
//,enableAutoSave: true
//自动保存间隔时间, 单位ms //启用自动保存
//,saveInterval: 500 //,enableAutoSave: true
//自动保存间隔时间, 单位ms
//,fullscreen : false //是否开启初始化时即全屏,默认关闭 //,saveInterval: 500
//,imagePopup:true //图片操作的浮层开关,默认打开 //,fullscreen : false //是否开启初始化时即全屏,默认关闭
//,autoSyncData:true //自动同步编辑器要提交的数据 //,imagePopup:true //图片操作的浮层开关,默认打开
//,emotionLocalization:false //是否开启表情本地化,默认关闭。若要开启请确保emotion文件夹下包含官网提供的images表情文件夹
//,autoSyncData:true //自动同步编辑器要提交的数据
//粘贴只保留标签,去除标签所有属性 //,emotionLocalization:false //是否开启表情本地化,默认关闭。若要开启请确保emotion文件夹下包含官网提供的images表情文件夹
//,retainOnlyLabelPasted: false
//粘贴只保留标签,去除标签所有属性
//,pasteplain:false //是否默认为纯文本粘贴。false为不使用纯文本粘贴,true为使用纯文本粘贴 //,retainOnlyLabelPasted: false
//纯文本粘贴模式下的过滤规则
//'filterTxtRules' : function(){ //,pasteplain:false //是否默认为纯文本粘贴。false为不使用纯文本粘贴,true为使用纯文本粘贴
// function transP(node){ //纯文本粘贴模式下的过滤规则
// node.tagName = 'p'; //'filterTxtRules' : function(){
// node.setStyle(); // function transP(node){
// } // node.tagName = 'p';
// return { // node.setStyle();
// //直接删除及其字节点内容 // }
// '-' : 'script style object iframe embed input select', // return {
// 'p': {$:{}}, // //直接删除及其字节点内容
// 'br':{$:{}}, // '-' : 'script style object iframe embed input select',
// 'div':{'$':{}}, // 'p': {$:{}},
// 'li':{'$':{}}, // 'br':{$:{}},
// 'caption':transP, // 'div':{'$':{}},
// 'th':transP, // 'li':{'$':{}},
// 'tr':transP, // 'caption':transP,
// 'h1':transP,'h2':transP,'h3':transP,'h4':transP,'h5':transP,'h6':transP, // 'th':transP,
// 'td':function(node){ // 'tr':transP,
// //没有内容的td直接删掉 // 'h1':transP,'h2':transP,'h3':transP,'h4':transP,'h5':transP,'h6':transP,
// var txt = !!node.innerText(); // 'td':function(node){
// if(txt){ // //没有内容的td直接删掉
// node.parentNode.insertAfter(UE.uNode.createText(' &nbsp; &nbsp;'),node); // var txt = !!node.innerText();
// } // if(txt){
// node.parentNode.removeChild(node,node.innerText()) // node.parentNode.insertAfter(UE.uNode.createText(' &nbsp; &nbsp;'),node);
// } // }
// } // node.parentNode.removeChild(node,node.innerText())
//}() // }
// }
//,allHtmlEnabled:false //提交到后台的数据是否包含整个html字符串 //}()
//insertorderedlist //,allHtmlEnabled:false //提交到后台的数据是否包含整个html字符串
//有序列表的下拉配置,值留空时支持多语言自动识别,若配置值,则以此值为准
//,'insertorderedlist':{ //insertorderedlist
// //自定的样式 //有序列表的下拉配置,值留空时支持多语言自动识别,若配置值,则以此值为准
// 'num':'1,2,3...', //,'insertorderedlist':{
// 'num1':'1),2),3)...', // //自定的样式
// 'num2':'(1),(2),(3)...', // 'num':'1,2,3...',
// 'cn':'一,二,三....', // 'num1':'1),2),3)...',
// 'cn1':'一),二),三)....', // 'num2':'(1),(2),(3)...',
// 'cn2':'(一),(二),(三)....', // 'cn':'一,二,三....',
// //系统自带 // 'cn1':'一),二),三)....',
// 'decimal' : '' , //'1,2,3...' // 'cn2':'(一),(二),(三)....',
// 'lower-alpha' : '' , // 'a,b,c...' // //系统自带
// 'lower-roman' : '' , //'i,ii,iii...' // 'decimal' : '' , //'1,2,3...'
// 'upper-alpha' : '' , lang //'A,B,C' // 'lower-alpha' : '' , // 'a,b,c...'
// 'upper-roman' : '' //'I,II,III...' // 'lower-roman' : '' , //'i,ii,iii...'
//} // 'upper-alpha' : '' , lang //'A,B,C'
// 'upper-roman' : '' //'I,II,III...'
//insertunorderedlist //}
//无序列表的下拉配置,值留空时支持多语言自动识别,若配置值,则以此值为准
//,insertunorderedlist : { //自定的样式 //insertunorderedlist
// 'dash' :'— 破折号', //-破折号 //无序列表的下拉配置,值留空时支持多语言自动识别,若配置值,则以此值为准
// 'dot':' 。 小圆圈', //系统自带 //,insertunorderedlist : { //自定的样式
// 'circle' : '', // '○ 小圆圈' // 'dash' :'— 破折号', //-破折号
// 'disc' : '', // '● 小圆点' // 'dot':' 。 小圆圈', //系统自带
// 'square' : '' //'■ 小方块' // 'circle' : '', // '○ 小圆圈'
//} // 'disc' : '', // '● 小圆点'
//,listDefaultPaddingLeft : '30'//默认的左边缩进的基数倍 // 'square' : '' //'■ 小方块'
//,listiconpath : 'http://bs.baidu.com/listicon/'//自定义标号的路径 //}
//,maxListLevel : 3 //限制可以tab的级数, 设置-1为不限制 //,listDefaultPaddingLeft : '30'//默认的左边缩进的基数倍
//,listiconpath : 'http://bs.baidu.com/listicon/'//自定义标号的路径
//,autoTransWordToList:false //禁止word中粘贴进来的列表自动变成列表标签 //,maxListLevel : 3 //限制可以tab的级数, 设置-1为不限制
//fontfamily //,autoTransWordToList:false //禁止word中粘贴进来的列表自动变成列表标签
//字体设置 label留空支持多语言自动切换,若配置,则以配置值为准
//,'fontfamily':[ //fontfamily
// { label:'',name:'songti',val:'宋体,SimSun'}, //字体设置 label留空支持多语言自动切换,若配置,则以配置值为准
// { label:'',name:'kaiti',val:'楷体,楷体_GB2312, SimKai'}, //,'fontfamily':[
// { label:'',name:'yahei',val:'微软雅黑,Microsoft YaHei'}, // { label:'',name:'songti',val:'宋体,SimSun'},
// { label:'',name:'heiti',val:'黑体, SimHei'}, // { label:'',name:'kaiti',val:'楷体,楷体_GB2312, SimKai'},
// { label:'',name:'lishu',val:'隶书, SimLi'}, // { label:'',name:'yahei',val:'微软雅黑,Microsoft YaHei'},
// { label:'',name:'andaleMono',val:'andale mono'}, // { label:'',name:'heiti',val:'黑体, SimHei'},
// { label:'',name:'arial',val:'arial, helvetica,sans-serif'}, // { label:'',name:'lishu',val:'隶书, SimLi'},
// { label:'',name:'arialBlack',val:'arial black,avant garde'}, // { label:'',name:'andaleMono',val:'andale mono'},
// { label:'',name:'comicSansMs',val:'comic sans ms'}, // { label:'',name:'arial',val:'arial, helvetica,sans-serif'},
// { label:'',name:'impact',val:'impact,chicago'}, // { label:'',name:'arialBlack',val:'arial black,avant garde'},
// { label:'',name:'timesNewRoman',val:'times new roman'} // { label:'',name:'comicSansMs',val:'comic sans ms'},
//] // { label:'',name:'impact',val:'impact,chicago'},
// { label:'',name:'timesNewRoman',val:'times new roman'}
//fontsize //]
//字号
//,'fontsize':[10, 11, 12, 14, 16, 18, 20, 24, 36] //fontsize
//字号
//paragraph //,'fontsize':[10, 11, 12, 14, 16, 18, 20, 24, 36]
//段落格式 值留空时支持多语言自动识别,若配置,则以配置值为准
//,'paragraph':{'p':'', 'h1':'', 'h2':'', 'h3':'', 'h4':'', 'h5':'', 'h6':''} //paragraph
//段落格式 值留空时支持多语言自动识别,若配置,则以配置值为准
//rowspacingtop //,'paragraph':{'p':'', 'h1':'', 'h2':'', 'h3':'', 'h4':'', 'h5':'', 'h6':''}
//段间距 值和显示的名字相同
//,'rowspacingtop':['5', '10', '15', '20', '25'] //rowspacingtop
//段间距 值和显示的名字相同
//rowspacingBottom //,'rowspacingtop':['5', '10', '15', '20', '25']
//段间距 值和显示的名字相同
//,'rowspacingbottom':['5', '10', '15', '20', '25'] //rowspacingBottom
//段间距 值和显示的名字相同
//lineheight //,'rowspacingbottom':['5', '10', '15', '20', '25']
//行内间距 值和显示的名字相同
//,'lineheight':['1', '1.5','1.75','2', '3', '4', '5'] //lineheight
//行内间距 值和显示的名字相同
//customstyle //,'lineheight':['1', '1.5','1.75','2', '3', '4', '5']
//自定义样式,不支持国际化,此处配置值即可最后显示值
//block的元素是依据设置段落的逻辑设置的,inline的元素依据BIU的逻辑设置 //customstyle
//尽量使用一些常用的标签 //自定义样式,不支持国际化,此处配置值即可最后显示值
//参数说明 //block的元素是依据设置段落的逻辑设置的,inline的元素依据BIU的逻辑设置
//tag 使用的标签名字 //尽量使用一些常用的标签
//label 显示的名字也是用来标识不同类型的标识符,注意这个值每个要不同, //参数说明
//style 添加的样式 //tag 使用的标签名字
//每一个对象就是一个自定义的样式 //label 显示的名字也是用来标识不同类型的标识符,注意这个值每个要不同,
//,'customstyle':[ //style 添加的样式
// {tag:'h1', name:'tc', label:'', style:'border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:center;margin:0 0 20px 0;'}, //每一个对象就是一个自定义的样式
// {tag:'h1', name:'tl',label:'', style:'border-bottom:#ccc 2px solid;padding:0 4px 0 0;margin:0 0 10px 0;'}, //,'customstyle':[
// {tag:'span',name:'im', label:'', style:'font-style:italic;font-weight:bold'}, // {tag:'h1', name:'tc', label:'', style:'border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:center;margin:0 0 20px 0;'},
// {tag:'span',name:'hi', label:'', style:'font-style:italic;font-weight:bold;color:rgb(51, 153, 204)'} // {tag:'h1', name:'tl',label:'', style:'border-bottom:#ccc 2px solid;padding:0 4px 0 0;margin:0 0 10px 0;'},
//] // {tag:'span',name:'im', label:'', style:'font-style:italic;font-weight:bold'},
// {tag:'span',name:'hi', label:'', style:'font-style:italic;font-weight:bold;color:rgb(51, 153, 204)'}
//打开右键菜单功能 //]
//,enableContextMenu: true
//右键菜单的内容,可以参考plugins/contextmenu.js里边的默认菜单的例子,label留空支持国际化,否则以此配置为准 //打开右键菜单功能
//,contextMenu:[ //,enableContextMenu: true
// { //右键菜单的内容,可以参考plugins/contextmenu.js里边的默认菜单的例子,label留空支持国际化,否则以此配置为准
// label:'', //显示的名称 //,contextMenu:[
// cmdName:'selectall',//执行的command命令,当点击这个右键菜单时 // {
// //exec可选,有了exec就会在点击时执行这个function,优先级高于cmdName // label:'', //显示的名称
// exec:function () { // cmdName:'selectall',//执行的command命令,当点击这个右键菜单时
// //this是当前编辑器的实例 // //exec可选,有了exec就会在点击时执行这个function,优先级高于cmdName
// //this.ui._dialogs['inserttableDialog'].open(); // exec:function () {
// } // //this是当前编辑器的实例
// } // //this.ui._dialogs['inserttableDialog'].open();
//] // }
// }
//快捷菜单 //]
//,shortcutMenu:["fontfamily", "fontsize", "bold", "italic", "underline", "forecolor", "backcolor", "insertorderedlist", "insertunorderedlist"]
//快捷菜单
//elementPathEnabled //,shortcutMenu:["fontfamily", "fontsize", "bold", "italic", "underline", "forecolor", "backcolor", "insertorderedlist", "insertunorderedlist"]
//是否启用元素路径,默认是显示
//,elementPathEnabled : true //elementPathEnabled
//是否启用元素路径,默认是显示
//wordCount //,elementPathEnabled : true
//,wordCount:true //是否开启字数统计
//,maximumWords:10000 //允许的最大字符数 //wordCount
//字数统计提示,{#count}代表当前字数,{#leave}代表还可以输入多少字符数,留空支持多语言自动切换,否则按此配置显示 //,wordCount:true //是否开启字数统计
//,wordCountMsg:'' //当前已输入 {#count} 个字符,您还可以输入{#leave} 个字符 //,maximumWords:10000 //允许的最大字符数
//超出字数限制提示 留空支持多语言自动切换,否则按此配置显示 //字数统计提示,{#count}代表当前字数,{#leave}代表还可以输入多少字符数,留空支持多语言自动切换,否则按此配置显示
//,wordOverFlowMsg:'' //<span style="color:red;">你输入的字符个数已经超出最大允许值,服务器可能会拒绝保存!</span> //,wordCountMsg:'' //当前已输入 {#count} 个字符,您还可以输入{#leave} 个字符
//超出字数限制提示 留空支持多语言自动切换,否则按此配置显示
//tab //,wordOverFlowMsg:'' //<span style="color:red;">你输入的字符个数已经超出最大允许值,服务器可能会拒绝保存!</span>
//点击tab键时移动的距离,tabSize倍数,tabNode什么字符做为单位
//,tabSize:4 //tab
//,tabNode:'&nbsp;' //点击tab键时移动的距离,tabSize倍数,tabNode什么字符做为单位
//,tabSize:4
//removeFormat //,tabNode:'&nbsp;'
//清除格式时可以删除的标签和属性
//removeForamtTags标签 //removeFormat
//,removeFormatTags:'b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var' //清除格式时可以删除的标签和属性
//removeFormatAttributes属性 //removeForamtTags标签
//,removeFormatAttributes:'class,style,lang,width,height,align,hspace,valign' //,removeFormatTags:'b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var'
//removeFormatAttributes属性
//undo //,removeFormatAttributes:'class,style,lang,width,height,align,hspace,valign'
//可以最多回退的次数,默认20
//,maxUndoCount:20 //undo
//当输入的字符数超过该值时,保存一次现场 //可以最多回退的次数,默认20
//,maxInputCount:1 //,maxUndoCount:20
//当输入的字符数超过该值时,保存一次现场
//autoHeightEnabled //,maxInputCount:1
// 是否自动长高,默认true
//,autoHeightEnabled:true //autoHeightEnabled
// 是否自动长高,默认true
//scaleEnabled //,autoHeightEnabled:true
//是否可以拉伸长高,默认true(当开启时,自动长高失效)
//,scaleEnabled:false //scaleEnabled
//,minFrameWidth:800 //编辑器拖动时最小宽度,默认800 //是否可以拉伸长高,默认true(当开启时,自动长高失效)
//,minFrameHeight:220 //编辑器拖动时最小高度,默认220 //,scaleEnabled:false
//,minFrameWidth:800 //编辑器拖动时最小宽度,默认800
//autoFloatEnabled //,minFrameHeight:220 //编辑器拖动时最小高度,默认220
//是否保持toolbar的位置不动,默认true
//,autoFloatEnabled:true //autoFloatEnabled
//浮动时工具栏距离浏览器顶部的高度,用于某些具有固定头部的页面 //是否保持toolbar的位置不动,默认true
//,topOffset:30 //,autoFloatEnabled:true
//编辑器底部距离工具栏高度(如果参数大于等于编辑器高度,则设置无效) //浮动时工具栏距离浏览器顶部的高度,用于某些具有固定头部的页面
//,toolbarTopOffset:400 //,topOffset:30
//编辑器底部距离工具栏高度(如果参数大于等于编辑器高度,则设置无效)
//设置远程图片是否抓取到本地保存 //,toolbarTopOffset:400
//,catchRemoteImageEnable: true //设置是否抓取远程图片
//设置远程图片是否抓取到本地保存
//pageBreakTag //,catchRemoteImageEnable: true //设置是否抓取远程图片
//分页标识符,默认是_ueditor_page_break_tag_
//,pageBreakTag:'_ueditor_page_break_tag_' //pageBreakTag
//分页标识符,默认是_ueditor_page_break_tag_
//autotypeset //,pageBreakTag:'_ueditor_page_break_tag_'
//自动排版参数
//,autotypeset: { //autotypeset
// mergeEmptyline: true, //合并空行 //自动排版参数
// removeClass: true, //去掉冗余的class //,autotypeset: {
// removeEmptyline: false, //去掉空行 // mergeEmptyline: true, //合并空行
// textAlign:"left", //段落的排版方式,可以是 left,right,center,justify 去掉这个属性表示不执行排版 // removeClass: true, //去掉冗余的class
// imageBlockLine: 'center', //图片的浮动方式,独占一行剧中,左右浮动,默认: center,left,right,none 去掉这个属性表示不执行排版 // removeEmptyline: false, //去掉空行
// pasteFilter: false, //根据规则过滤没事粘贴进来的内容 // textAlign:"left", //段落的排版方式,可以是 left,right,center,justify 去掉这个属性表示不执行排版
// clearFontSize: false, //去掉所有的内嵌字号,使用编辑器默认的字号 // imageBlockLine: 'center', //图片的浮动方式,独占一行剧中,左右浮动,默认: center,left,right,none 去掉这个属性表示不执行排版
// clearFontFamily: false, //去掉所有的内嵌字体,使用编辑器默认的字体 // pasteFilter: false, //根据规则过滤没事粘贴进来的内容
// removeEmptyNode: false, // 去掉空节点 // clearFontSize: false, //去掉所有的内嵌字号,使用编辑器默认的字号
// //可以去掉的标签 // clearFontFamily: false, //去掉所有的内嵌字体,使用编辑器默认的字体
// removeTagNames: {标签名字:1}, // removeEmptyNode: false, // 去掉空节点
// indent: false, // 行首缩进 // //可以去掉的标签
// indentValue : '2em', //行首缩进的大小 // removeTagNames: {标签名字:1},
// bdc2sb: false, // indent: false, // 行首缩进
// tobdc: false // indentValue : '2em', //行首缩进的大小
//} // bdc2sb: false,
// tobdc: false
//tableDragable //}
//表格是否可以拖拽
//,tableDragable: true //tableDragable
//表格是否可以拖拽
//,tableDragable: true
//sourceEditor
//源码的查看方式,codemirror 是代码高亮,textarea是文本框,默认是codemirror
//注意默认codemirror只能在ie8+和非ie中使用 //sourceEditor
//,sourceEditor:"codemirror" //源码的查看方式,codemirror 是代码高亮,textarea是文本框,默认是codemirror
//如果sourceEditor是codemirror,还用配置一下两个参数 //注意默认codemirror只能在ie8+和非ie中使用
//codeMirrorJsUrl js加载的路径,默认是 URL + "third-party/codemirror/codemirror.js" //,sourceEditor:"codemirror"
//,codeMirrorJsUrl:URL + "third-party/codemirror/codemirror.js" //如果sourceEditor是codemirror,还用配置一下两个参数
//codeMirrorCssUrl css加载的路径,默认是 URL + "third-party/codemirror/codemirror.css" //codeMirrorJsUrl js加载的路径,默认是 URL + "third-party/codemirror/codemirror.js"
//,codeMirrorCssUrl:URL + "third-party/codemirror/codemirror.css" //,codeMirrorJsUrl:URL + "third-party/codemirror/codemirror.js"
//编辑器初始化完成后是否进入源码模式,默认为否。 //codeMirrorCssUrl css加载的路径,默认是 URL + "third-party/codemirror/codemirror.css"
//,sourceEditorFirst:false //,codeMirrorCssUrl:URL + "third-party/codemirror/codemirror.css"
//编辑器初始化完成后是否进入源码模式,默认为否。
//iframeUrlMap //,sourceEditorFirst:false
//dialog内容的路径 ~会被替换成URL,垓属性一旦打开,将覆盖所有的dialog的默认路径
//,iframeUrlMap:{ //iframeUrlMap
// 'anchor':'~/dialogs/anchor/anchor.html', //dialog内容的路径 ~会被替换成URL,垓属性一旦打开,将覆盖所有的dialog的默认路径
//} //,iframeUrlMap:{
// 'anchor':'~/dialogs/anchor/anchor.html',
//allowLinkProtocol 允许的链接地址,有这些前缀的链接地址不会自动添加http //}
//, allowLinkProtocols: ['http:', 'https:', '#', '/', 'ftp:', 'mailto:', 'tel:', 'git:', 'svn:']
//allowLinkProtocol 允许的链接地址,有这些前缀的链接地址不会自动添加http
//webAppKey 百度应用的APIkey,每个站长必须首先去百度官网注册一个key后方能正常使用app功能,注册介绍,http://app.baidu.com/static/cms/getapikey.html //, allowLinkProtocols: ['http:', 'https:', '#', '/', 'ftp:', 'mailto:', 'tel:', 'git:', 'svn:']
//, webAppKey: ""
//webAppKey 百度应用的APIkey,每个站长必须首先去百度官网注册一个key后方能正常使用app功能,注册介绍,http://app.baidu.com/static/cms/getapikey.html
//默认过滤规则相关配置项目 //, webAppKey: ""
//,disabledTableInTable:true //禁止表格嵌套
//,allowDivTransToP:true //允许进入编辑器的div标签自动变成p标签 //默认过滤规则相关配置项目
//,rgb2Hex:true //默认产出的数据中的color自动从rgb格式变成16进制格式 //,disabledTableInTable:true //禁止表格嵌套
//,allowDivTransToP:true //允许进入编辑器的div标签自动变成p标签
// xss 过滤是否开启,inserthtml等操作 //,rgb2Hex:true //默认产出的数据中的color自动从rgb格式变成16进制格式
,xssFilterRules: true
//input xss过滤 // xss 过滤是否开启,inserthtml等操作
,inputXssFilter: true ,xssFilterRules: true
//output xss过滤 //input xss过滤
,outputXssFilter: true ,inputXssFilter: true
// xss过滤白名单 名单来源: https://raw.githubusercontent.com/leizongmin/js-xss/master/lib/default.js //output xss过滤
,whitList: { ,outputXssFilter: true
a: ['target', 'href', 'title', 'class', 'style'], // xss过滤白名单 名单来源: https://raw.githubusercontent.com/leizongmin/js-xss/master/lib/default.js
abbr: ['title', 'class', 'style'], ,whitList: {
address: ['class', 'style'], a: ['target', 'href', 'title', 'class', 'style'],
area: ['shape', 'coords', 'href', 'alt'], abbr: ['title', 'class', 'style'],
article: [], address: ['class', 'style'],
aside: [], area: ['shape', 'coords', 'href', 'alt'],
audio: ['autoplay', 'controls', 'loop', 'preload', 'src', 'class', 'style'], article: [],
b: ['class', 'style'], aside: [],
bdi: ['dir'], audio: ['autoplay', 'controls', 'loop', 'preload', 'src', 'class', 'style'],
bdo: ['dir'], b: ['class', 'style'],
big: [], bdi: ['dir'],
blockquote: ['cite', 'class', 'style'], bdo: ['dir'],
br: [], big: [],
caption: ['class', 'style'], blockquote: ['cite', 'class', 'style'],
center: [], br: [],
cite: [], caption: ['class', 'style'],
code: ['class', 'style'], center: [],
col: ['align', 'valign', 'span', 'width', 'class', 'style'], cite: [],
colgroup: ['align', 'valign', 'span', 'width', 'class', 'style'], code: ['class', 'style'],
dd: ['class', 'style'], col: ['align', 'valign', 'span', 'width', 'class', 'style'],
del: ['datetime'], colgroup: ['align', 'valign', 'span', 'width', 'class', 'style'],
details: ['open'], dd: ['class', 'style'],
div: ['class', 'style'], del: ['datetime'],
dl: ['class', 'style'], details: ['open'],
dt: ['class', 'style'], div: ['class', 'style'],
em: ['class', 'style'], dl: ['class', 'style'],
font: ['color', 'size', 'face'], dt: ['class', 'style'],
footer: [], em: ['class', 'style'],
h1: ['class', 'style'], font: ['color', 'size', 'face'],
h2: ['class', 'style'], footer: [],
h3: ['class', 'style'], h1: ['class', 'style'],
h4: ['class', 'style'], h2: ['class', 'style'],
h5: ['class', 'style'], h3: ['class', 'style'],
h6: ['class', 'style'], h4: ['class', 'style'],
header: [], h5: ['class', 'style'],
hr: [], h6: ['class', 'style'],
i: ['class', 'style'], header: [],
img: ['src', 'alt', 'title', 'width', 'height', 'id', '_src', 'loadingclass', 'class', 'data-latex'], hr: [],
ins: ['datetime'], i: ['class', 'style'],
li: ['class', 'style'], img: ['src', 'alt', 'title', 'width', 'height', 'id', '_src', 'loadingclass', 'class', 'data-latex'],
mark: [], ins: ['datetime'],
nav: [], li: ['class', 'style'],
ol: ['class', 'style'], mark: [],
p: ['class', 'style'], nav: [],
pre: ['class', 'style'], ol: ['class', 'style'],
s: [], p: ['class', 'style'],
section:[], pre: ['class', 'style'],
small: [], s: [],
span: ['class', 'style'], section:[],
sub: ['class', 'style'], small: [],
sup: ['class', 'style'], span: ['class', 'style'],
strong: ['class', 'style'], sub: ['class', 'style'],
table: ['width', 'border', 'align', 'valign', 'class', 'style'], sup: ['class', 'style'],
tbody: ['align', 'valign', 'class', 'style'], strong: ['class', 'style'],
td: ['width', 'rowspan', 'colspan', 'align', 'valign', 'class', 'style'], table: ['width', 'border', 'align', 'valign', 'class', 'style'],
tfoot: ['align', 'valign', 'class', 'style'], tbody: ['align', 'valign', 'class', 'style'],
th: ['width', 'rowspan', 'colspan', 'align', 'valign', 'class', 'style'], td: ['width', 'rowspan', 'colspan', 'align', 'valign', 'class', 'style'],
thead: ['align', 'valign', 'class', 'style'], tfoot: ['align', 'valign', 'class', 'style'],
tr: ['rowspan', 'align', 'valign', 'class', 'style'], th: ['width', 'rowspan', 'colspan', 'align', 'valign', 'class', 'style'],
tt: [], thead: ['align', 'valign', 'class', 'style'],
u: [], tr: ['rowspan', 'align', 'valign', 'class', 'style'],
ul: ['class', 'style'], tt: [],
video: ['autoplay', 'controls', 'loop', 'preload', 'src', 'height', 'width', 'class', 'style'] u: [],
} ul: ['class', 'style'],
}; video: ['autoplay', 'controls', 'loop', 'preload', 'src', 'height', 'width', 'class', 'style']
}
function getUEBasePath(docUrl, confUrl) { };
return getBasePath(docUrl || self.document.URL || self.location.href, confUrl || getConfigFilePath()); function getUEBasePath(docUrl, confUrl) {
} return getBasePath(docUrl || self.document.URL || self.location.href, confUrl || getConfigFilePath());
function getConfigFilePath() { }
var configPath = document.getElementsByTagName('script'); function getConfigFilePath() {
return configPath[ configPath.length - 1 ].src; var configPath = document.getElementsByTagName('script');
} return configPath[ configPath.length - 1 ].src;
function getBasePath(docUrl, confUrl) { }
var basePath = confUrl; function getBasePath(docUrl, confUrl) {
var basePath = confUrl;
if (/^(\/|\\\\)/.test(confUrl)) {
basePath = /^.+?\w(\/|\\\\)/.exec(docUrl)[0] + confUrl.replace(/^(\/|\\\\)/, ''); if (/^(\/|\\\\)/.test(confUrl)) {
} else if (!/^[a-z]+:/i.test(confUrl)) { basePath = /^.+?\w(\/|\\\\)/.exec(docUrl)[0] + confUrl.replace(/^(\/|\\\\)/, '');
docUrl = docUrl.split("#")[0].split("?")[0].replace(/[^\\\/]+$/, ''); } else if (!/^[a-z]+:/i.test(confUrl)) {
basePath = docUrl + "" + confUrl; docUrl = docUrl.split("#")[0].split("?")[0].replace(/[^\\\/]+$/, '');
} basePath = docUrl + "" + confUrl;
return optimizationPath(basePath); }
} return optimizationPath(basePath);
function optimizationPath(path) { }
var protocol = /^[a-z]+:\/\//.exec(path)[ 0 ], function optimizationPath(path) {
tmp = null,
res = []; var protocol = /^[a-z]+:\/\//.exec(path)[ 0 ],
tmp = null,
path = path.replace(protocol, "").split("?")[0].split("#")[0]; res = [];
path = path.replace(/\\/g, '/').split(/\//); path = path.replace(protocol, "").split("?")[0].split("#")[0];
path[ path.length - 1 ] = ""; path = path.replace(/\\/g, '/').split(/\//);
while (path.length) { path[ path.length - 1 ] = "";
if (( tmp = path.shift() ) === "..") { while (path.length) {
res.pop();
} else if (tmp !== ".") { if (( tmp = path.shift() ) === "..") {
res.push(tmp); res.pop();
} } else if (tmp !== ".") {
res.push(tmp);
} }
return protocol + res.join("/"); }
} return protocol + res.join("/");
window.UE = { }
getUEBasePath: getUEBasePath
}; function getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
})(); var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]); return null;
}
window.UE = {
getUEBasePath: getUEBasePath
};
})();
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论